@vonage/accounts 1.0.13 → 1.0.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vonage/accounts",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "Vonage Account Management API",
5
5
  "homepage": "https://developer.vonage.com",
6
6
  "bugs": {
@@ -27,10 +27,10 @@
27
27
  "compile": "npx tsc --build --verbose"
28
28
  },
29
29
  "dependencies": {
30
- "@vonage/server-client": "^1.0.15"
30
+ "@vonage/server-client": "^1.0.16"
31
31
  },
32
32
  "devDependencies": {
33
- "@vonage/auth": "^1.0.9",
33
+ "@vonage/auth": "^1.0.10",
34
34
  "nock": "^13.2.9"
35
35
  },
36
36
  "publishConfig": {
@@ -1,11 +0,0 @@
1
- import { AuthenticationType, Client } from '@vonage/server-client';
2
- import { AccountCallbacks } from './interfaces/AccountCallbacks';
3
- import { AccountUpdateResponse } from './interfaces/Response/AccountUpdateResponse';
4
- import { GetBalanceResponse } from './interfaces/Response/GetBalanceResponse';
5
- import { TopUpBalanceResponse } from './interfaces/Response/TopUpBalanceResponse';
6
- export declare class Accounts extends Client {
7
- protected authType: AuthenticationType;
8
- getBalance(): Promise<GetBalanceResponse>;
9
- topUpBalance(trx: string): Promise<TopUpBalanceResponse>;
10
- updateAccountCallbacks(callbacks: AccountCallbacks): Promise<AccountUpdateResponse>;
11
- }
package/dist/accounts.js DELETED
@@ -1,39 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Accounts = void 0;
13
- const server_client_1 = require("@vonage/server-client");
14
- class Accounts extends server_client_1.Client {
15
- constructor() {
16
- super(...arguments);
17
- this.authType = server_client_1.AuthenticationType.QUERY_KEY_SECRET;
18
- }
19
- getBalance() {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const response = yield this.sendGetRequest(`${this.config.restHost}/account/get-balance`);
22
- return response.data;
23
- });
24
- }
25
- topUpBalance(trx) {
26
- return __awaiter(this, void 0, void 0, function* () {
27
- const response = yield this.sendFormSubmitRequest(`${this.config.restHost}/account/top-up`, { trx });
28
- return response.data;
29
- });
30
- }
31
- updateAccountCallbacks(callbacks) {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- const response = yield this.sendFormSubmitRequest(`${this.config.restHost}/account/settings`, callbacks);
34
- return response.data;
35
- });
36
- }
37
- }
38
- exports.Accounts = Accounts;
39
- //# sourceMappingURL=accounts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"accounts.js","sourceRoot":"","sources":["../lib/accounts.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAkE;AAMlE,MAAa,QAAS,SAAQ,sBAAM;IAApC;;QACc,aAAQ,GAAG,kCAAkB,CAAC,gBAAgB,CAAA;IA2B5D,CAAC;IAzBgB,UAAU;;YACnB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,CACtC,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,sBAAsB,CAChD,CAAA;YACD,OAAO,QAAQ,CAAC,IAAI,CAAA;QACxB,CAAC;KAAA;IAEY,YAAY,CAAC,GAAW;;YACjC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAC7C,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,iBAAiB,EACxC,EAAE,GAAG,EAAE,CACV,CAAA;YACD,OAAO,QAAQ,CAAC,IAAI,CAAA;QACxB,CAAC;KAAA;IAEY,sBAAsB,CAC/B,SAA2B;;YAE3B,MAAM,QAAQ,GACV,MAAM,IAAI,CAAC,qBAAqB,CAC5B,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,mBAAmB,EAC1C,SAAS,CACZ,CAAA;YACL,OAAO,QAAQ,CAAC,IAAI,CAAA;QACxB,CAAC;KAAA;CACJ;AA5BD,4BA4BC"}
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { Accounts } from './accounts';
2
- export { Secrets } from './secrets';
package/dist/index.js DELETED
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Secrets = exports.Accounts = void 0;
4
- var accounts_1 = require("./accounts");
5
- Object.defineProperty(exports, "Accounts", { enumerable: true, get: function () { return accounts_1.Accounts; } });
6
- var secrets_1 = require("./secrets");
7
- Object.defineProperty(exports, "Secrets", { enumerable: true, get: function () { return secrets_1.Secrets; } });
8
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";;;AAAA,uCAAqC;AAA5B,oGAAA,QAAQ,OAAA;AACjB,qCAAmC;AAA1B,kGAAA,OAAO,OAAA"}
@@ -1,4 +0,0 @@
1
- export interface AccountCallbacks {
2
- moCallBackUrl?: string;
3
- drCallBackUrl?: string;
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=AccountCallbacks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AccountCallbacks.js","sourceRoot":"","sources":["../../lib/interfaces/AccountCallbacks.ts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- export interface APISecretResponse {
2
- _links: {
3
- self: {
4
- href: string;
5
- };
6
- };
7
- id: string;
8
- created_at: string;
9
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=APISecretResponse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"APISecretResponse.js","sourceRoot":"","sources":["../../../lib/interfaces/Response/APISecretResponse.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- export interface AccountUpdateResponse {
2
- 'mo-callback-url': string;
3
- 'dr-callback-url': string;
4
- 'max-outbound-request': number;
5
- 'max-inbound-request': number;
6
- 'max-calls-per-second': number;
7
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=AccountUpdateResponse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AccountUpdateResponse.js","sourceRoot":"","sources":["../../../lib/interfaces/Response/AccountUpdateResponse.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export interface GetBalanceResponse {
2
- value: number;
3
- autoReload: boolean;
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=GetBalanceResponse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GetBalanceResponse.js","sourceRoot":"","sources":["../../../lib/interfaces/Response/GetBalanceResponse.ts"],"names":[],"mappings":""}
@@ -1,11 +0,0 @@
1
- import { APISecretResponse } from './APISecretResponse';
2
- export interface ListAPISecretsResponse {
3
- _links: {
4
- self: {
5
- href: string;
6
- };
7
- };
8
- _embedded: {
9
- secrets: APISecretResponse[];
10
- };
11
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ListAPISecretsResponse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListAPISecretsResponse.js","sourceRoot":"","sources":["../../../lib/interfaces/Response/ListAPISecretsResponse.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export interface TopUpBalanceResponse {
2
- 'error-code': string;
3
- 'error-code-label': string;
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=TopUpBalanceResponse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TopUpBalanceResponse.js","sourceRoot":"","sources":["../../../lib/interfaces/Response/TopUpBalanceResponse.ts"],"names":[],"mappings":""}
package/dist/secrets.d.ts DELETED
@@ -1,10 +0,0 @@
1
- import { AuthenticationType, Client } from '@vonage/server-client';
2
- import { APISecretResponse } from './interfaces/Response/APISecretResponse';
3
- import { ListAPISecretsResponse } from './interfaces/Response/ListAPISecretsResponse';
4
- export declare class Secrets extends Client {
5
- protected authType: AuthenticationType;
6
- createSecret(apiKey: string, secret: string): Promise<APISecretResponse>;
7
- deleteSecret(apiKey: string, id: string): Promise<void>;
8
- getSecret(apiKey: string, id: string): Promise<APISecretResponse>;
9
- listSecrets(apiKey: string): Promise<ListAPISecretsResponse>;
10
- }
package/dist/secrets.js DELETED
@@ -1,44 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Secrets = void 0;
13
- const server_client_1 = require("@vonage/server-client");
14
- class Secrets extends server_client_1.Client {
15
- constructor() {
16
- super(...arguments);
17
- this.authType = server_client_1.AuthenticationType.BASIC;
18
- }
19
- createSecret(apiKey, secret) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const response = yield this.sendPostRequest(`${this.config.apiHost}/accounts/${apiKey}/secrets`, { secret });
22
- return response.data;
23
- });
24
- }
25
- deleteSecret(apiKey, id) {
26
- return __awaiter(this, void 0, void 0, function* () {
27
- yield this.sendDeleteRequest(`${this.config.apiHost}/accounts/${apiKey}/secrets/${id}`);
28
- });
29
- }
30
- getSecret(apiKey, id) {
31
- return __awaiter(this, void 0, void 0, function* () {
32
- const response = yield this.sendGetRequest(`${this.config.apiHost}/accounts/${apiKey}/secrets/${id}`);
33
- return response.data;
34
- });
35
- }
36
- listSecrets(apiKey) {
37
- return __awaiter(this, void 0, void 0, function* () {
38
- const response = yield this.sendGetRequest(`${this.config.apiHost}/accounts/${apiKey}/secrets`);
39
- return response.data;
40
- });
41
- }
42
- }
43
- exports.Secrets = Secrets;
44
- //# sourceMappingURL=secrets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"secrets.js","sourceRoot":"","sources":["../lib/secrets.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAkE;AAIlE,MAAa,OAAQ,SAAQ,sBAAM;IAAnC;;QACc,aAAQ,GAAG,kCAAkB,CAAC,KAAK,CAAA;IAmCjD,CAAC;IAjCgB,YAAY,CACrB,MAAc,EACd,MAAc;;YAEd,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,eAAe,CACvC,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,aAAa,MAAM,UAAU,EACnD,EAAE,MAAM,EAAE,CACb,CAAA;YACD,OAAO,QAAQ,CAAC,IAAI,CAAA;QACxB,CAAC;KAAA;IAEY,YAAY,CAAC,MAAc,EAAE,EAAU;;YAChD,MAAM,IAAI,CAAC,iBAAiB,CACxB,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,aAAa,MAAM,YAAY,EAAE,EAAE,CAC5D,CAAA;QACL,CAAC;KAAA;IAEY,SAAS,CAClB,MAAc,EACd,EAAU;;YAEV,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,CACtC,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,aAAa,MAAM,YAAY,EAAE,EAAE,CAC5D,CAAA;YACD,OAAO,QAAQ,CAAC,IAAI,CAAA;QACxB,CAAC;KAAA;IAEY,WAAW,CAAC,MAAc;;YACnC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,CACtC,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,aAAa,MAAM,UAAU,CACtD,CAAA;YACD,OAAO,QAAQ,CAAC,IAAI,CAAA;QACxB,CAAC;KAAA;CACJ;AApCD,0BAoCC"}