num-client
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -6,2 +6,3 @@ import { Context, NumLocation, UserVariable } from './context'; | ||
export declare const createClient: (resolvers?: DoHResolver[] | undefined) => NumClient; | ||
export declare const lookup: (uri: string) => Promise<string | null>; | ||
export interface NumClient { | ||
@@ -8,0 +9,0 @@ createContext(numAddress: NumUri): Context; |
@@ -55,3 +55,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DefaultCallbackHandler = exports.createDefaultCallbackHandler = exports.NumProtocolErrorCode = exports.createClient = void 0; | ||
exports.DefaultCallbackHandler = exports.createDefaultCallbackHandler = exports.NumProtocolErrorCode = exports.lookup = exports.createClient = void 0; | ||
var ajv_1 = __importDefault(require("ajv")); | ||
@@ -70,4 +70,11 @@ var chalk_1 = __importDefault(require("chalk")); | ||
var moduleconfig_1 = require("./moduleconfig"); | ||
var numuri_1 = require("./numuri"); | ||
var resourceloader_1 = require("./resourceloader"); | ||
exports.createClient = function (resolvers) { return new NumClientImpl(resolvers); }; | ||
exports.lookup = function (uri) { | ||
var numUri = numuri_1.parseNumUri(uri); | ||
var client = exports.createClient(); | ||
var ctx = client.createContext(numUri); | ||
return client.retrieveNumRecord(ctx); | ||
}; | ||
var NumProtocolErrorCode; | ||
@@ -74,0 +81,0 @@ (function (NumProtocolErrorCode) { |
@@ -1,2 +0,2 @@ | ||
import { createClient, DefaultCallbackHandler, NumClient, NumProtocolErrorCode } from './client'; | ||
import { createClient, DefaultCallbackHandler, lookup, NumClient, NumProtocolErrorCode } from './client'; | ||
import { createDnsClient, DoHResolver } from './dnsclient'; | ||
@@ -20,4 +20,4 @@ import { createDomainLookupGenerator, createEmailLookupGenerator, createTNUMLookupGenerator, createUrlLookupGenerator, normaliseDomainName, normalisePath, transformBranch } from './lookupgenerators'; | ||
export { MODULE_10 }; | ||
export { createClient, NumProtocolErrorCode, DefaultCallbackHandler }; | ||
export { createClient, NumProtocolErrorCode, DefaultCallbackHandler, lookup }; | ||
export { DoHResolver, createDnsClient }; | ||
export { resolvePath, ResourceLoader, normalisePath, createModuleDnsQueries, ModuleDnsQueries, transformBranch, normaliseDomainName, createTNUMLookupGenerator, createDomainLookupGenerator, createEmailLookupGenerator, createUrlLookupGenerator, }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createUrlLookupGenerator = exports.createEmailLookupGenerator = exports.createDomainLookupGenerator = exports.createTNUMLookupGenerator = exports.normaliseDomainName = exports.transformBranch = exports.createModuleDnsQueries = exports.normalisePath = exports.resolvePath = exports.createDnsClient = exports.DoHResolver = exports.DefaultCallbackHandler = exports.NumProtocolErrorCode = exports.createClient = exports.MODULE_10 = exports.MODULE_9 = exports.MODULE_8 = exports.MODULE_7 = exports.MODULE_6 = exports.MODULE_5 = exports.MODULE_4 = exports.MODULE_3 = exports.MODULE_2 = exports.MODULE_1 = exports.MODULE_0 = exports.buildNumUri = exports.UrlPath = exports.UrlUserInfo = exports.Hostname = exports.PositiveInteger = exports.NumUri = exports.parseNumUri = void 0; | ||
exports.createUrlLookupGenerator = exports.createEmailLookupGenerator = exports.createDomainLookupGenerator = exports.createTNUMLookupGenerator = exports.normaliseDomainName = exports.transformBranch = exports.createModuleDnsQueries = exports.normalisePath = exports.resolvePath = exports.createDnsClient = exports.DoHResolver = exports.lookup = exports.DefaultCallbackHandler = exports.NumProtocolErrorCode = exports.createClient = exports.MODULE_10 = exports.MODULE_9 = exports.MODULE_8 = exports.MODULE_7 = exports.MODULE_6 = exports.MODULE_5 = exports.MODULE_4 = exports.MODULE_3 = exports.MODULE_2 = exports.MODULE_1 = exports.MODULE_0 = exports.buildNumUri = exports.UrlPath = exports.UrlUserInfo = exports.Hostname = exports.PositiveInteger = exports.NumUri = exports.parseNumUri = void 0; | ||
var client_1 = require("./client"); | ||
Object.defineProperty(exports, "createClient", { enumerable: true, get: function () { return client_1.createClient; } }); | ||
Object.defineProperty(exports, "DefaultCallbackHandler", { enumerable: true, get: function () { return client_1.DefaultCallbackHandler; } }); | ||
Object.defineProperty(exports, "lookup", { enumerable: true, get: function () { return client_1.lookup; } }); | ||
Object.defineProperty(exports, "NumProtocolErrorCode", { enumerable: true, get: function () { return client_1.NumProtocolErrorCode; } }); | ||
@@ -8,0 +9,0 @@ var dnsclient_1 = require("./dnsclient"); |
{ | ||
"name": "num-client", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "A NUM Protocol Client in TypeScript", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -152,12 +152,3 @@ # NUM Client | ||
function lookup(uri) { | ||
const numUri = num.parseNumUri(uri); | ||
const client = num.createClient(); | ||
const ctx = client.createContext(numUri); | ||
return client.retrieveNumRecord(ctx); | ||
} | ||
lookup('num.uk:1').then((result) => console.log(result)); | ||
num.lookup('num.uk:1').then((result) => console.log(result)); | ||
``` | ||
@@ -164,0 +155,0 @@ ## Full Usage |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
502251
2830
259