@vonage/accounts 1.0.13 → 1.0.15

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/accounts.js CHANGED
@@ -1,38 +1,20 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.Accounts = void 0;
13
4
  const server_client_1 = require("@vonage/server-client");
14
5
  class Accounts extends server_client_1.Client {
15
- constructor() {
16
- super(...arguments);
17
- this.authType = server_client_1.AuthenticationType.QUERY_KEY_SECRET;
6
+ authType = server_client_1.AuthenticationType.QUERY_KEY_SECRET;
7
+ async getBalance() {
8
+ const response = await this.sendGetRequest(`${this.config.restHost}/account/get-balance`);
9
+ return response.data;
18
10
  }
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
- });
11
+ async topUpBalance(trx) {
12
+ const response = await this.sendFormSubmitRequest(`${this.config.restHost}/account/top-up`, { trx });
13
+ return response.data;
24
14
  }
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
- });
15
+ async updateAccountCallbacks(callbacks) {
16
+ const response = await this.sendFormSubmitRequest(`${this.config.restHost}/account/settings`, callbacks);
17
+ return response.data;
36
18
  }
37
19
  }
38
20
  exports.Accounts = Accounts;
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"accounts.js","sourceRoot":"","sources":["../lib/accounts.ts"],"names":[],"mappings":";;;AAAA,yDAAkE;AAMlE,MAAa,QAAS,SAAQ,sBAAM;IACtB,QAAQ,GAAG,kCAAkB,CAAC,gBAAgB,CAAA;IAEjD,KAAK,CAAC,UAAU;QACnB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,CACtC,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,sBAAsB,CAChD,CAAA;QACD,OAAO,QAAQ,CAAC,IAAI,CAAA;IACxB,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,GAAW;QACjC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAC7C,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,iBAAiB,EACxC,EAAE,GAAG,EAAE,CACV,CAAA;QACD,OAAO,QAAQ,CAAC,IAAI,CAAA;IACxB,CAAC;IAEM,KAAK,CAAC,sBAAsB,CAC/B,SAA2B;QAE3B,MAAM,QAAQ,GACV,MAAM,IAAI,CAAC,qBAAqB,CAC5B,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,mBAAmB,EAC1C,SAAS,CACZ,CAAA;QACL,OAAO,QAAQ,CAAC,IAAI,CAAA;IACxB,CAAC;CACJ;AA5BD,4BA4BC"}
package/dist/secrets.js CHANGED
@@ -1,43 +1,23 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.Secrets = void 0;
13
4
  const server_client_1 = require("@vonage/server-client");
14
5
  class Secrets extends server_client_1.Client {
15
- constructor() {
16
- super(...arguments);
17
- this.authType = server_client_1.AuthenticationType.BASIC;
6
+ authType = server_client_1.AuthenticationType.BASIC;
7
+ async createSecret(apiKey, secret) {
8
+ const response = await this.sendPostRequest(`${this.config.apiHost}/accounts/${apiKey}/secrets`, { secret });
9
+ return response.data;
18
10
  }
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
- });
11
+ async deleteSecret(apiKey, id) {
12
+ await this.sendDeleteRequest(`${this.config.apiHost}/accounts/${apiKey}/secrets/${id}`);
24
13
  }
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
- });
14
+ async getSecret(apiKey, id) {
15
+ const response = await this.sendGetRequest(`${this.config.apiHost}/accounts/${apiKey}/secrets/${id}`);
16
+ return response.data;
29
17
  }
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
- });
18
+ async listSecrets(apiKey) {
19
+ const response = await this.sendGetRequest(`${this.config.apiHost}/accounts/${apiKey}/secrets`);
20
+ return response.data;
41
21
  }
42
22
  }
43
23
  exports.Secrets = Secrets;
@@ -1 +1 @@
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,M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AAM,CAAC,OAAO,aAAa,MAAM,YAAY,EAAE,EAAE,CAC5D,CAAA;IACL,CAAC;IAEM,KAAK,CAAC,SAAS,CAClB,MAAc,EACd,EAAU;QAEV,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,CACtC,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,aAAa,MAAM,YAAY,EAAE,EAAE,CAC5D,CAAA;QACD,OAAO,QAAQ,CAAC,IAAI,CAAA;IACxB,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,MAAc;QACnC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,CACtC,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,aAAa,MAAM,UAAU,CACtD,CAAA;QACD,OAAO,QAAQ,CAAC,IAAI,CAAA;IACxB,CAAC;CACJ;AApCD,0BAoCC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vonage/accounts",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
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": {