@vonage/number-insights
Advanced tools
Comparing version 1.9.0 to 1.10.0
@@ -0,5 +1,17 @@ | ||
/** | ||
* Enum representing the type of caller for a phone number. | ||
*/ | ||
export declare enum CallerType { | ||
/** | ||
* The value will be "unknown" if the information about the caller type is not available. | ||
*/ | ||
UNKNOWN = "unknown", | ||
/** | ||
* The value will be "business" if the owner of a phone number is a business. | ||
*/ | ||
BUSINESS = "business", | ||
CONSUMER = "consumer," | ||
/** | ||
* The value will be "consumer" if the owner of a phone number is an individual. | ||
*/ | ||
CONSUMER = "consumer" | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CallerType = void 0; | ||
/** | ||
* Enum representing the type of caller for a phone number. | ||
*/ | ||
var CallerType; | ||
(function (CallerType) { | ||
/** | ||
* The value will be "unknown" if the information about the caller type is not available. | ||
*/ | ||
CallerType["UNKNOWN"] = "unknown"; | ||
/** | ||
* The value will be "business" if the owner of a phone number is a business. | ||
*/ | ||
CallerType["BUSINESS"] = "business"; | ||
CallerType["CONSUMER"] = "consumer,"; | ||
/** | ||
* The value will be "consumer" if the owner of a phone number is an individual. | ||
*/ | ||
CallerType["CONSUMER"] = "consumer"; | ||
})(CallerType || (exports.CallerType = CallerType = {})); | ||
//# sourceMappingURL=CallerType.js.map |
@@ -0,5 +1,17 @@ | ||
/** | ||
* Enum representing the outcomes of a lookup operation. | ||
*/ | ||
export declare enum LookupOutcome { | ||
/** | ||
* The lookup operation was successful. | ||
*/ | ||
SUCCESS = 0, | ||
/** | ||
* The lookup operation partially succeeded. | ||
*/ | ||
PARTIAL_SUCCESS = 1, | ||
/** | ||
* The lookup operation failed. | ||
*/ | ||
FAILED = 2 | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LookupOutcome = void 0; | ||
/** | ||
* Enum representing the outcomes of a lookup operation. | ||
*/ | ||
var LookupOutcome; | ||
(function (LookupOutcome) { | ||
/** | ||
* The lookup operation was successful. | ||
*/ | ||
LookupOutcome[LookupOutcome["SUCCESS"] = 0] = "SUCCESS"; | ||
/** | ||
* The lookup operation partially succeeded. | ||
*/ | ||
LookupOutcome[LookupOutcome["PARTIAL_SUCCESS"] = 1] = "PARTIAL_SUCCESS"; | ||
/** | ||
* The lookup operation failed. | ||
*/ | ||
LookupOutcome[LookupOutcome["FAILED"] = 2] = "FAILED"; | ||
})(LookupOutcome || (exports.LookupOutcome = LookupOutcome = {})); | ||
//# sourceMappingURL=LookupOutcome.js.map |
@@ -0,9 +1,33 @@ | ||
/** | ||
* Enum representing the type of network associated with a phone number. | ||
*/ | ||
export declare enum NetworkType { | ||
/** | ||
* The phone number is associated with a mobile network. | ||
*/ | ||
MOBILE = "mobile", | ||
/** | ||
* The phone number is associated with a landline network. | ||
*/ | ||
LANDLINE = "landline", | ||
/** | ||
* The phone number is associated with a premium landline network. | ||
*/ | ||
LANDLINE_PREMIUM = "landline_premium", | ||
/** | ||
* The phone number is associated with a toll-free landline network. | ||
*/ | ||
LANDLINE_TOLLFREE = "landline_tollfree", | ||
/** | ||
* The phone number is associated with a virtual network. | ||
*/ | ||
VIRTUAL = "virtual", | ||
/** | ||
* The type of network associated with the phone number is unknown. | ||
*/ | ||
UNKNOWN = "unknown", | ||
/** | ||
* The phone number is associated with a pager network. | ||
*/ | ||
PAGER = "pager" | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.NetworkType = void 0; | ||
/** | ||
* Enum representing the type of network associated with a phone number. | ||
*/ | ||
var NetworkType; | ||
(function (NetworkType) { | ||
/** | ||
* The phone number is associated with a mobile network. | ||
*/ | ||
NetworkType["MOBILE"] = "mobile"; | ||
/** | ||
* The phone number is associated with a landline network. | ||
*/ | ||
NetworkType["LANDLINE"] = "landline"; | ||
/** | ||
* The phone number is associated with a premium landline network. | ||
*/ | ||
NetworkType["LANDLINE_PREMIUM"] = "landline_premium"; | ||
/** | ||
* The phone number is associated with a toll-free landline network. | ||
*/ | ||
NetworkType["LANDLINE_TOLLFREE"] = "landline_tollfree"; | ||
/** | ||
* The phone number is associated with a virtual network. | ||
*/ | ||
NetworkType["VIRTUAL"] = "virtual"; | ||
/** | ||
* The type of network associated with the phone number is unknown. | ||
*/ | ||
NetworkType["UNKNOWN"] = "unknown"; | ||
/** | ||
* The phone number is associated with a pager network. | ||
*/ | ||
NetworkType["PAGER"] = "pager"; | ||
})(NetworkType || (exports.NetworkType = NetworkType = {})); | ||
//# sourceMappingURL=NetworkType.js.map |
@@ -0,8 +1,29 @@ | ||
/** | ||
* Enum representing the reachability status of a phone number. | ||
*/ | ||
export declare enum Reachable { | ||
/** | ||
* The reachability status is unknown. | ||
*/ | ||
UNKNOWN = "unknown", | ||
/** | ||
* The phone number is reachable. | ||
*/ | ||
REACHABLE = "reachable", | ||
/** | ||
* The phone number is undeliverable. | ||
*/ | ||
UNDELIVERABLE = "undeliverable", | ||
/** | ||
* The phone number's owner is absent. | ||
*/ | ||
ABSENT = "absent", | ||
/** | ||
* The phone number is invalid or a bad number. | ||
*/ | ||
BAD_NUMBER = "bad_number", | ||
/** | ||
* The phone number is blacklisted. | ||
*/ | ||
BLACKLISTED = "blacklisted" | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Reachable = void 0; | ||
/** | ||
* Enum representing the reachability status of a phone number. | ||
*/ | ||
var Reachable; | ||
(function (Reachable) { | ||
/** | ||
* The reachability status is unknown. | ||
*/ | ||
Reachable["UNKNOWN"] = "unknown"; | ||
/** | ||
* The phone number is reachable. | ||
*/ | ||
Reachable["REACHABLE"] = "reachable"; | ||
/** | ||
* The phone number is undeliverable. | ||
*/ | ||
Reachable["UNDELIVERABLE"] = "undeliverable"; | ||
/** | ||
* The phone number's owner is absent. | ||
*/ | ||
Reachable["ABSENT"] = "absent"; | ||
/** | ||
* The phone number is invalid or a bad number. | ||
*/ | ||
Reachable["BAD_NUMBER"] = "bad_number"; | ||
/** | ||
* The phone number is blacklisted. | ||
*/ | ||
Reachable["BLACKLISTED"] = "blacklisted"; | ||
})(Reachable || (exports.Reachable = Reachable = {})); | ||
//# sourceMappingURL=Reachable.js.map |
@@ -0,7 +1,25 @@ | ||
/** | ||
* Enum representing the validity status of a phone number. | ||
*/ | ||
export declare enum ValidNumber { | ||
/** | ||
* The validity status is unknown. | ||
*/ | ||
UNKNOWN = "unknown", | ||
/** | ||
* The phone number is valid. | ||
*/ | ||
VALID = "valid", | ||
/** | ||
* The phone number is not valid. | ||
*/ | ||
NOT_VALID = "not_valid", | ||
/** | ||
* The validity of the phone number is inferred. | ||
*/ | ||
INFERRED = "inferred", | ||
/** | ||
* The inferred validity of the phone number is not valid. | ||
*/ | ||
INFERRED_NOT_VALID = "inferred_not_valid" | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ValidNumber = void 0; | ||
/** | ||
* Enum representing the validity status of a phone number. | ||
*/ | ||
var ValidNumber; | ||
(function (ValidNumber) { | ||
/** | ||
* The validity status is unknown. | ||
*/ | ||
ValidNumber["UNKNOWN"] = "unknown"; | ||
/** | ||
* The phone number is valid. | ||
*/ | ||
ValidNumber["VALID"] = "valid"; | ||
/** | ||
* The phone number is not valid. | ||
*/ | ||
ValidNumber["NOT_VALID"] = "not_valid"; | ||
/** | ||
* The validity of the phone number is inferred. | ||
*/ | ||
ValidNumber["INFERRED"] = "inferred"; | ||
/** | ||
* The inferred validity of the phone number is not valid. | ||
*/ | ||
ValidNumber["INFERRED_NOT_VALID"] = "inferred_not_valid"; | ||
})(ValidNumber || (exports.ValidNumber = ValidNumber = {})); | ||
//# sourceMappingURL=ValidNumber.js.map |
@@ -1,1 +0,3 @@ | ||
export { NumberInsights } from './number-insights'; | ||
export * from './number-insights'; | ||
export * from './enums'; | ||
export * from './types'; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.NumberInsights = void 0; | ||
var number_insights_1 = require("./number-insights"); | ||
Object.defineProperty(exports, "NumberInsights", { enumerable: true, get: function () { return number_insights_1.NumberInsights; } }); | ||
//# sourceMappingURL=index.js.map | ||
__exportStar(require("./number-insights"), exports); | ||
__exportStar(require("./enums"), exports); | ||
__exportStar(require("./types"), exports); |
import { Client } from '@vonage/server-client'; | ||
import { AdvancedLookupOptions } from './interfaces/AdvancedLookupOptions'; | ||
import { BasicLookupOptions } from './interfaces/BasicLookupOptions'; | ||
import { AdvancedResponse } from './interfaces/Responses/AdvancedResponse'; | ||
import { AsyncAdvancedResponse } from './interfaces/Responses/AsyncAdvancedResponse'; | ||
import { BasicResponse } from './interfaces/Responses/BasicResponse'; | ||
import { StandardResponse } from './interfaces/Responses/StandardResponse'; | ||
import { StandardLookupOptions } from './interfaces/StandardLookupOptions'; | ||
import { AdvancedLookupOptions, BasicLookupOptions, AdvancedResponse, AsyncAdvancedResponse, BasicResponse, StandardResponse, StandardLookupOptions } from './types'; | ||
/** | ||
* Client for the Vonage Number Insights API. | ||
* | ||
* @example | ||
* Create a standalone Number Insight client | ||
* | ||
* ```ts | ||
* import { NumberInsights } from '@vonage/numberInsight'; | ||
* | ||
* const numberInsightClient = new NumberInsights({ | ||
* apiKey: VONAGE_API_KEY, | ||
* apiSecret: VONAGE_API_SECRET | ||
* }); | ||
* ``` | ||
* | ||
* @example | ||
* Create an Number Insight client from the Vonage client | ||
* | ||
* ```ts | ||
* import { Vonage } from '@vonage/server-client'; | ||
* | ||
* const vonage = new Vonage({ | ||
* apiKey: VONAGE_API_KEY, | ||
* apiSecret: VONAGE_API_SECRET | ||
* }); | ||
* | ||
* const numberInsightClient = vonage.numberInsight; | ||
* ``` | ||
*/ | ||
export declare class NumberInsights extends Client { | ||
/** | ||
* Perform an advanced number lookup operation. | ||
* | ||
* @param {string} phoneNumber - The phone number to perform the lookup for. | ||
* @param {AdvancedLookupOptions} options - Additional options for the lookup. | ||
* @return {Promise<AdvancedResponse>} A promise that resolves to the advanced lookup response. | ||
* @example | ||
* ```ts | ||
* const lookup = await numberInsightsClient.advancedLookup('15555551212'); | ||
* console.log(`Ths number is ${lookup.valid_number}`); | ||
* ``` | ||
*/ | ||
advancedLookup(phoneNumber: string, options?: AdvancedLookupOptions): Promise<AdvancedResponse>; | ||
/** | ||
* Perform an asynchronous advanced number lookup operation. | ||
* | ||
* @param {string} phoneNumber - The phone number to perform the lookup for. | ||
* @param {string} callback - The callback URL for receiving the async lookup response. | ||
* @param {StandardLookupOptions} options - Additional options for the lookup. | ||
* @return {Promise<AsyncAdvancedResponse>} A promise that resolves to the async advanced lookup response. | ||
* | ||
* @example | ||
* ```ts | ||
* const lookup = await numberInsightsClient.asyncAdvancedLookup( | ||
* '15555551212', | ||
* 'https://example.com/number-insights', | ||
* ); | ||
* console.log(`The request ID is ${lookup.request_id}`); | ||
* ``` | ||
* | ||
* @example | ||
* Lookup with the CNAME option: | ||
* ```ts | ||
* const lookup = await numberInsightsClient.asyncAdvancedLookup( | ||
* '15555551212', | ||
* 'https://example.com/number-insights', | ||
* { cname: true }, | ||
* ); | ||
* console.log(`The request ID is ${lookup.request_id}`); | ||
* ``` | ||
*/ | ||
asyncAdvancedLookup(phoneNumber: string, callback: string, options: StandardLookupOptions): Promise<AsyncAdvancedResponse>; | ||
/** | ||
* Perform a basic number lookup operation. | ||
* | ||
* @param {string} phoneNumber - The phone number to perform the lookup for. | ||
* @param {BasicLookupOptions} options - Additional options for the lookup. | ||
* @return {Promise<BasicResponse>} A promise that resolves to the basic lookup response. | ||
* | ||
* @example | ||
* ```ts | ||
* const lookup = await numberInsightsClient.basicLookup( | ||
* '15555551212', | ||
* ); | ||
* console.log(`The request ID is ${lookup.request_id}`); | ||
* ``` | ||
* | ||
* @example | ||
* Lookup with the country option: | ||
* ```ts | ||
* const lookup = await numberInsightsClient.basicLookup( | ||
* '15555551212', | ||
* { country: 'US' }, | ||
* ); | ||
* console.log(`The request ID is ${lookup.request_id}`); | ||
* ``` | ||
*/ | ||
basicLookup(phoneNumber: string, options?: BasicLookupOptions): Promise<BasicResponse>; | ||
/** | ||
* Perform a standard number lookup operation. | ||
* | ||
* @param {string} phoneNumber - The phone number to perform the lookup for. | ||
* @param {StandardLookupOptions} options - Additional options for the lookup. | ||
* @return {Promise<StandardResponse>} A promise that resolves to the standard lookup response. | ||
* | ||
* @example | ||
* ```ts | ||
* const lookup = await numberInsightsClient.standardLookup( | ||
* '15555551212', | ||
* ); | ||
* console.log(`The request ID is ${lookup.request_id}`); | ||
* ``` | ||
* | ||
* @example | ||
* Lookup with the cname option: | ||
* ```ts | ||
* const lookup = await numberInsightsClient.standardLookup( | ||
* '15555551212', | ||
* { cname: true }, | ||
* ); | ||
* console.log(`The request ID is ${lookup.request_id}`); | ||
* ``` | ||
*/ | ||
standardLookup(phoneNumber: string, options?: StandardLookupOptions): Promise<StandardResponse>; | ||
} |
@@ -5,3 +5,44 @@ "use strict"; | ||
const server_client_1 = require("@vonage/server-client"); | ||
/** | ||
* Client for the Vonage Number Insights API. | ||
* | ||
* @example | ||
* Create a standalone Number Insight client | ||
* | ||
* ```ts | ||
* import { NumberInsights } from '@vonage/numberInsight'; | ||
* | ||
* const numberInsightClient = new NumberInsights({ | ||
* apiKey: VONAGE_API_KEY, | ||
* apiSecret: VONAGE_API_SECRET | ||
* }); | ||
* ``` | ||
* | ||
* @example | ||
* Create an Number Insight client from the Vonage client | ||
* | ||
* ```ts | ||
* import { Vonage } from '@vonage/server-client'; | ||
* | ||
* const vonage = new Vonage({ | ||
* apiKey: VONAGE_API_KEY, | ||
* apiSecret: VONAGE_API_SECRET | ||
* }); | ||
* | ||
* const numberInsightClient = vonage.numberInsight; | ||
* ``` | ||
*/ | ||
class NumberInsights extends server_client_1.Client { | ||
/** | ||
* Perform an advanced number lookup operation. | ||
* | ||
* @param {string} phoneNumber - The phone number to perform the lookup for. | ||
* @param {AdvancedLookupOptions} options - Additional options for the lookup. | ||
* @return {Promise<AdvancedResponse>} A promise that resolves to the advanced lookup response. | ||
* @example | ||
* ```ts | ||
* const lookup = await numberInsightsClient.advancedLookup('15555551212'); | ||
* console.log(`Ths number is ${lookup.valid_number}`); | ||
* ``` | ||
*/ | ||
async advancedLookup(phoneNumber, options) { | ||
@@ -12,2 +53,30 @@ const params = { number: phoneNumber, ...options }; | ||
} | ||
/** | ||
* Perform an asynchronous advanced number lookup operation. | ||
* | ||
* @param {string} phoneNumber - The phone number to perform the lookup for. | ||
* @param {string} callback - The callback URL for receiving the async lookup response. | ||
* @param {StandardLookupOptions} options - Additional options for the lookup. | ||
* @return {Promise<AsyncAdvancedResponse>} A promise that resolves to the async advanced lookup response. | ||
* | ||
* @example | ||
* ```ts | ||
* const lookup = await numberInsightsClient.asyncAdvancedLookup( | ||
* '15555551212', | ||
* 'https://example.com/number-insights', | ||
* ); | ||
* console.log(`The request ID is ${lookup.request_id}`); | ||
* ``` | ||
* | ||
* @example | ||
* Lookup with the CNAME option: | ||
* ```ts | ||
* const lookup = await numberInsightsClient.asyncAdvancedLookup( | ||
* '15555551212', | ||
* 'https://example.com/number-insights', | ||
* { cname: true }, | ||
* ); | ||
* console.log(`The request ID is ${lookup.request_id}`); | ||
* ``` | ||
*/ | ||
async asyncAdvancedLookup(phoneNumber, callback, options) { | ||
@@ -18,2 +87,27 @@ const params = { number: phoneNumber, callback, ...options }; | ||
} | ||
/** | ||
* Perform a basic number lookup operation. | ||
* | ||
* @param {string} phoneNumber - The phone number to perform the lookup for. | ||
* @param {BasicLookupOptions} options - Additional options for the lookup. | ||
* @return {Promise<BasicResponse>} A promise that resolves to the basic lookup response. | ||
* | ||
* @example | ||
* ```ts | ||
* const lookup = await numberInsightsClient.basicLookup( | ||
* '15555551212', | ||
* ); | ||
* console.log(`The request ID is ${lookup.request_id}`); | ||
* ``` | ||
* | ||
* @example | ||
* Lookup with the country option: | ||
* ```ts | ||
* const lookup = await numberInsightsClient.basicLookup( | ||
* '15555551212', | ||
* { country: 'US' }, | ||
* ); | ||
* console.log(`The request ID is ${lookup.request_id}`); | ||
* ``` | ||
*/ | ||
async basicLookup(phoneNumber, options) { | ||
@@ -24,2 +118,27 @@ const params = { number: phoneNumber, ...options }; | ||
} | ||
/** | ||
* Perform a standard number lookup operation. | ||
* | ||
* @param {string} phoneNumber - The phone number to perform the lookup for. | ||
* @param {StandardLookupOptions} options - Additional options for the lookup. | ||
* @return {Promise<StandardResponse>} A promise that resolves to the standard lookup response. | ||
* | ||
* @example | ||
* ```ts | ||
* const lookup = await numberInsightsClient.standardLookup( | ||
* '15555551212', | ||
* ); | ||
* console.log(`The request ID is ${lookup.request_id}`); | ||
* ``` | ||
* | ||
* @example | ||
* Lookup with the cname option: | ||
* ```ts | ||
* const lookup = await numberInsightsClient.standardLookup( | ||
* '15555551212', | ||
* { cname: true }, | ||
* ); | ||
* console.log(`The request ID is ${lookup.request_id}`); | ||
* ``` | ||
*/ | ||
async standardLookup(phoneNumber, options) { | ||
@@ -32,2 +151,1 @@ const params = { number: phoneNumber, ...options }; | ||
exports.NumberInsights = NumberInsights; | ||
//# sourceMappingURL=number-insights.js.map |
{ | ||
"$schema": "https://json.schemastore.org/package.json", | ||
"name": "@vonage/number-insights", | ||
"version": "1.9.0", | ||
"version": "1.10.0", | ||
"description": "Vonage Number Insights API", | ||
@@ -14,3 +15,12 @@ "homepage": "https://developer.vonage.com", | ||
"license": "Apache-2.0", | ||
"author": "Chris Tankersley <chris@ctankersley.com>", | ||
"contributors": [ | ||
{ | ||
"name": "Chris Tankersley", | ||
"url": "https://github.com/dragonmantank" | ||
}, | ||
{ | ||
"name": "Chuck \"MANCHUCK\" Reeves", | ||
"url": "https://github.com/manchuck" | ||
} | ||
], | ||
"main": "dist/index.js", | ||
@@ -28,8 +38,9 @@ "types": "dist/index.d.ts", | ||
"clean": "npx shx rm -rf dist tsconfig.tsbuildinfo", | ||
"compile": "npx tsc --build --verbose" | ||
"compile": "npx tsc --build --verbose", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
"dependencies": { | ||
"@vonage/auth": "^1.7.0", | ||
"@vonage/server-client": "^1.9.0", | ||
"@vonage/vetch": "^1.6.0" | ||
"@vonage/auth": "^1.8.0", | ||
"@vonage/server-client": "^1.10.0", | ||
"@vonage/vetch": "^1.7.0" | ||
}, | ||
@@ -41,4 +52,3 @@ "devDependencies": { | ||
"directory": "dist" | ||
}, | ||
"gitHead": "328f18e5c8a458cb4d06d7955ec2399a6ce6f5d8" | ||
} | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
37262
946
48
1
Updated@vonage/auth@^1.8.0
Updated@vonage/vetch@^1.7.0