@sinch/number-lookup 1.4.2 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/rest/v2/number-lookup/number-lookup-api.d.ts +1 -0
- package/dist/rest/v2/number-lookup/number-lookup-api.js +1 -0
- package/dist/rest/v2/number-lookup/number-lookup-api.js.map +1 -1
- package/dist/rest/v2/number-lookup-domain-api.d.ts +11 -1
- package/dist/rest/v2/number-lookup-domain-api.js +10 -2
- package/dist/rest/v2/number-lookup-domain-api.js.map +1 -1
- package/dist/rest/v2/number-lookup-service.d.ts +5 -6
- package/dist/rest/v2/number-lookup-service.js +8 -10
- package/dist/rest/v2/number-lookup-service.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -39,5 +39,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.NumberLookup = void 0;
|
|
40
40
|
exports.NumberLookup = __importStar(require("./models"));
|
|
41
41
|
__exportStar(require("./rest"), exports);
|
|
42
|
-
__exportStar(require("@sinch/sdk-client"), exports);
|
|
43
42
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAAyC;AACzC,yCAAuB
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAAyC;AACzC,yCAAuB"}
|
|
@@ -2,6 +2,7 @@ import { NumberLookupDomainApi } from '../number-lookup-domain-api';
|
|
|
2
2
|
import { LazyNumberLookupApiClient } from '../number-lookup-service';
|
|
3
3
|
import { NumberLookupRequestData, NumberLookupResponse } from '../../../models';
|
|
4
4
|
export declare class NumberLookupApi extends NumberLookupDomainApi {
|
|
5
|
+
/** @internal */
|
|
5
6
|
constructor(lazyApiClient: LazyNumberLookupApiClient);
|
|
6
7
|
/**
|
|
7
8
|
* Performs a number lookup.
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NumberLookupApi = void 0;
|
|
4
4
|
const number_lookup_domain_api_1 = require("../number-lookup-domain-api");
|
|
5
5
|
class NumberLookupApi extends number_lookup_domain_api_1.NumberLookupDomainApi {
|
|
6
|
+
/** @internal */
|
|
6
7
|
constructor(lazyApiClient) {
|
|
7
8
|
super(lazyApiClient, 'NumberLookupApi');
|
|
8
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number-lookup-api.js","sourceRoot":"","sources":["../../../../src/rest/v2/number-lookup/number-lookup-api.ts"],"names":[],"mappings":";;;AACA,0EAAoE;AAIpE,MAAa,eAAgB,SAAQ,gDAAqB;IAExD,YAAY,aAAwC;QAClD,KAAK,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;IAC1C,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,MAAM,CAAC,IAA6B;QAC/C,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAA0B,IAAI,EAAE,EAAa,CAAC,CAAC;QAC/F,MAAM,OAAO,GAA0C;YACrD,cAAc,EAAE,kBAAkB;YAClC,MAAM,EAAE,kBAAkB;SAC3B,CAAC;QAEF,MAAM,IAAI,GAAgB,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACnH,MAAM,WAAW,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,gBAAg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M,CAAC,gBAAgB,CAAC,SAAS,UAAU,CAAC;QAE7H,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC;QACpH,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,QAAQ,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;QAExF,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAuB;YACnD,GAAG;YACH,cAAc;YACd,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,cAAc;SAC5B,CAAC,CAAC;IACL,CAAC;CACF;AAhCD,0CAgCC"}
|
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
import { Api, ApiClient, UnifiedCredentials } from '@sinch/sdk-client';
|
|
2
2
|
import { LazyNumberLookupApiClient } from './number-lookup-service';
|
|
3
3
|
export declare class NumberLookupDomainApi implements Api {
|
|
4
|
+
/** @internal */
|
|
4
5
|
readonly lazyClient: LazyNumberLookupApiClient;
|
|
6
|
+
/** @internal */
|
|
5
7
|
readonly apiName: string;
|
|
6
|
-
|
|
8
|
+
/** @internal */
|
|
9
|
+
constructor(
|
|
10
|
+
/** @internal */
|
|
11
|
+
lazyClient: LazyNumberLookupApiClient,
|
|
12
|
+
/** @internal */
|
|
13
|
+
apiName: string);
|
|
14
|
+
/** @internal */
|
|
7
15
|
get client(): ApiClient;
|
|
8
16
|
/**
|
|
9
17
|
* Update the default hostname for the API
|
|
10
18
|
* @param {string} hostname - The new hostname to use for the APIs.
|
|
11
19
|
*/
|
|
20
|
+
/** @internal */
|
|
12
21
|
setHostname(hostname: string): void;
|
|
13
22
|
/**
|
|
14
23
|
* Updates the credentials used to authenticate API requests
|
|
15
24
|
* @param {UnifiedCredentials} credentials
|
|
16
25
|
*/
|
|
26
|
+
/** @internal */
|
|
17
27
|
setCredentials(credentials: Partial<UnifiedCredentials>): void;
|
|
18
28
|
}
|
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NumberLookupDomainApi = void 0;
|
|
4
4
|
class NumberLookupDomainApi {
|
|
5
|
-
|
|
5
|
+
/** @internal */
|
|
6
|
+
constructor(
|
|
7
|
+
/** @internal */
|
|
8
|
+
lazyClient,
|
|
9
|
+
/** @internal */
|
|
10
|
+
apiName) {
|
|
6
11
|
this.lazyClient = lazyClient;
|
|
7
12
|
this.apiName = apiName;
|
|
8
13
|
}
|
|
14
|
+
/** @internal */
|
|
9
15
|
get client() {
|
|
10
16
|
return this.lazyClient.getApiClient();
|
|
11
17
|
}
|
|
@@ -13,6 +19,7 @@ class NumberLookupDomainApi {
|
|
|
13
19
|
* Update the default hostname for the API
|
|
14
20
|
* @param {string} hostname - The new hostname to use for the APIs.
|
|
15
21
|
*/
|
|
22
|
+
/** @internal */
|
|
16
23
|
setHostname(hostname) {
|
|
17
24
|
this.lazyClient.sharedConfig.numberLookupHostname = hostname;
|
|
18
25
|
this.lazyClient.getApiClient().apiClientOptions.hostname = hostname;
|
|
@@ -21,6 +28,7 @@ class NumberLookupDomainApi {
|
|
|
21
28
|
* Updates the credentials used to authenticate API requests
|
|
22
29
|
* @param {UnifiedCredentials} credentials
|
|
23
30
|
*/
|
|
31
|
+
/** @internal */
|
|
24
32
|
setCredentials(credentials) {
|
|
25
33
|
const parametersBackup = { ...this.lazyClient.sharedConfig };
|
|
26
34
|
this.lazyClient.sharedConfig = {
|
|
@@ -32,7 +40,7 @@ class NumberLookupDomainApi {
|
|
|
32
40
|
this.lazyClient.getApiClient();
|
|
33
41
|
}
|
|
34
42
|
catch (error) {
|
|
35
|
-
|
|
43
|
+
this.lazyClient.sharedConfig.logger.error('Impossible to assign the new credentials to the Number Lookup API');
|
|
36
44
|
this.lazyClient.sharedConfig = parametersBackup;
|
|
37
45
|
throw error;
|
|
38
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number-lookup-domain-api.js","sourceRoot":"","sources":["../../../src/rest/v2/number-lookup-domain-api.ts"],"names":[],"mappings":";;;AAOA,MAAa,qBAAqB;IAEhC,
|
|
1
|
+
{"version":3,"file":"number-lookup-domain-api.js","sourceRoot":"","sources":["../../../src/rest/v2/number-lookup-domain-api.ts"],"names":[],"mappings":";;;AAOA,MAAa,qBAAqB;IAEhC,gBAAgB;IAChB;IACE,gBAAgB;IACA,UAAqC;IACrD,gBAAgB;IACA,OAAe;QAFf,eAAU,GAAV,UAAU,CAA2B;QAErC,YAAO,GAAP,OAAO,CAAQ;IAC9B,CAAC;IAEJ,gBAAgB;IAChB,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;IACxC,CAAC;IAED;;;OAGG;IACH,gBAAgB;IACT,WAAW,CAAC,QAAgB;QACjC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,oBAAoB,GAAG,QAAQ,CAAC;QAC7D,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC,gBAAgB,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACtE,CAAC;IAED;;;OAGG;IACH,gBAAgB;IACT,cAAc,CAAC,WAAwC;QAC5D,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;QAC7D,IAAI,CAAC,UAAU,CAAC,YAAY,GAAG;YAC7B,GAAG,gBAAgB;YACnB,GAAG,WAAW;SACf,CAAC;QACF,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;QACjC,IAAI,CAAC;YACH,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CACvC,mEAAmE,CACpE,CAAC;YACF,IAAI,CAAC,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;YAChD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CAEF;AAhDD,sDAgDC"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { ApiFetchClient, SinchClientParameters, UnifiedCredentials } from '@sinch/sdk-client';
|
|
1
|
+
import { ApiFetchClient, LazyApiClient, SinchClientParameters, UnifiedCredentials } from '@sinch/sdk-client';
|
|
2
2
|
import { NumberLookupRequestData, NumberLookupResponse } from '../../models';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
apiFetchClient?: ApiFetchClient;
|
|
6
|
-
constructor(sharedConfig: SinchClientParameters);
|
|
3
|
+
/** @internal */
|
|
4
|
+
export declare class LazyNumberLookupApiClient extends LazyApiClient {
|
|
7
5
|
getApiClient(): ApiFetchClient;
|
|
8
|
-
resetApiClient(): void;
|
|
9
6
|
}
|
|
10
7
|
export declare class NumberLookupService {
|
|
11
8
|
private readonly _numberLookup;
|
|
9
|
+
/** @internal */
|
|
12
10
|
readonly lazyClient: LazyNumberLookupApiClient;
|
|
11
|
+
/** @internal */
|
|
13
12
|
constructor(params: SinchClientParameters);
|
|
14
13
|
setApiClientConfig(newParams: SinchClientParameters): void;
|
|
15
14
|
/**
|
|
@@ -3,10 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NumberLookupService = exports.LazyNumberLookupApiClient = void 0;
|
|
4
4
|
const sdk_client_1 = require("@sinch/sdk-client");
|
|
5
5
|
const number_lookup_1 = require("./number-lookup");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
this.sharedConfig = sharedConfig;
|
|
9
|
-
}
|
|
6
|
+
/** @internal */
|
|
7
|
+
class LazyNumberLookupApiClient extends sdk_client_1.LazyApiClient {
|
|
10
8
|
getApiClient() {
|
|
11
9
|
if (!this.apiFetchClient) {
|
|
12
10
|
const apiClientOptions = (0, sdk_client_1.buildOAuth2ApiClientOptions)(this.sharedConfig, 'Number Lookup');
|
|
@@ -15,19 +13,19 @@ class LazyNumberLookupApiClient {
|
|
|
15
13
|
}
|
|
16
14
|
return this.apiFetchClient;
|
|
17
15
|
}
|
|
18
|
-
resetApiClient() {
|
|
19
|
-
this.apiFetchClient = undefined;
|
|
20
|
-
}
|
|
21
16
|
}
|
|
22
17
|
exports.LazyNumberLookupApiClient = LazyNumberLookupApiClient;
|
|
23
18
|
class NumberLookupService {
|
|
19
|
+
/** @internal */
|
|
24
20
|
constructor(params) {
|
|
25
|
-
const
|
|
21
|
+
const resolvedParams = (0, sdk_client_1.resolveClientParameters)(params);
|
|
22
|
+
const sharedClient = new LazyNumberLookupApiClient(resolvedParams);
|
|
26
23
|
this.lazyClient = sharedClient;
|
|
27
24
|
this._numberLookup = new number_lookup_1.NumberLookupApi(sharedClient);
|
|
28
25
|
}
|
|
29
26
|
setApiClientConfig(newParams) {
|
|
30
|
-
|
|
27
|
+
const resolvedParams = (0, sdk_client_1.resolveClientParameters)(newParams);
|
|
28
|
+
this.lazyClient.sharedConfig = resolvedParams;
|
|
31
29
|
this.lazyClient.resetApiClient();
|
|
32
30
|
}
|
|
33
31
|
/**
|
|
@@ -50,7 +48,7 @@ class NumberLookupService {
|
|
|
50
48
|
this.lazyClient.getApiClient();
|
|
51
49
|
}
|
|
52
50
|
catch (error) {
|
|
53
|
-
|
|
51
|
+
this.lazyClient.sharedConfig.logger.error('Impossible to assign the new credentials to the Number Lookup API');
|
|
54
52
|
this.lazyClient.sharedConfig = parametersBackup;
|
|
55
53
|
throw error;
|
|
56
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number-lookup-service.js","sourceRoot":"","sources":["../../../src/rest/v2/number-lookup-service.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"number-lookup-service.js","sourceRoot":"","sources":["../../../src/rest/v2/number-lookup-service.ts"],"names":[],"mappings":";;;AAAA,kDAQ2B;AAC3B,mDAAkD;AAGlD,gBAAgB;A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AAC,UAAU,CAAC,YAAY,EAAE,CAAC;QAC7D,IAAI,CAAC,UAAU,CAAC,YAAY,GAAG;YAC7B,GAAG,gBAAgB;YACnB,GAAG,WAAW;SACf,CAAC;QACF,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;QACjC,IAAI,CAAC;YACH,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CACvC,mEAAmE,CACpE,CAAC;YACF,IAAI,CAAC,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;YAChD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,IAA6B;QAC/C,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;CACF;AApDD,kDAoDC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sinch/number-lookup",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Sinch Number Lookup SDK for Node.js",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"repository": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"test:e2e": "cucumber-js"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@sinch/sdk-client": "1.
|
|
32
|
+
"@sinch/sdk-client": "1.5.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {},
|
|
35
35
|
"publishConfig": {
|