@vonage/accounts 1.1.0 → 1.1.2
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.d.ts +11 -0
- package/dist/accounts.js +21 -0
- package/dist/accounts.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/AccountCallbacks.d.ts +4 -0
- package/dist/interfaces/AccountCallbacks.js +3 -0
- package/dist/interfaces/AccountCallbacks.js.map +1 -0
- package/dist/interfaces/Response/APISecretResponse.d.ts +9 -0
- package/dist/interfaces/Response/APISecretResponse.js +3 -0
- package/dist/interfaces/Response/APISecretResponse.js.map +1 -0
- package/dist/interfaces/Response/AccountUpdateResponse.d.ts +7 -0
- package/dist/interfaces/Response/AccountUpdateResponse.js +3 -0
- package/dist/interfaces/Response/AccountUpdateResponse.js.map +1 -0
- package/dist/interfaces/Response/GetBalanceResponse.d.ts +4 -0
- package/dist/interfaces/Response/GetBalanceResponse.js +3 -0
- package/dist/interfaces/Response/GetBalanceResponse.js.map +1 -0
- package/dist/interfaces/Response/ListAPISecretsResponse.d.ts +11 -0
- package/dist/interfaces/Response/ListAPISecretsResponse.js +3 -0
- package/dist/interfaces/Response/ListAPISecretsResponse.js.map +1 -0
- package/dist/interfaces/Response/TopUpBalanceResponse.d.ts +4 -0
- package/dist/interfaces/Response/TopUpBalanceResponse.js +3 -0
- package/dist/interfaces/Response/TopUpBalanceResponse.js.map +1 -0
- package/dist/secrets.d.ts +10 -0
- package/dist/secrets.js +24 -0
- package/dist/secrets.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,11 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Accounts = void 0;
|
|
4
|
+
const server_client_1 = require("@vonage/server-client");
|
|
5
|
+
class Accounts extends server_client_1.Client {
|
|
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;
|
|
10
|
+
}
|
|
11
|
+
async topUpBalance(trx) {
|
|
12
|
+
const response = await this.sendFormSubmitRequest(`${this.config.restHost}/account/top-up`, { trx });
|
|
13
|
+
return response.data;
|
|
14
|
+
}
|
|
15
|
+
async updateAccountCallbacks(callbacks) {
|
|
16
|
+
const response = await this.sendFormSubmitRequest(`${this.config.restHost}/account/settings`, callbacks);
|
|
17
|
+
return response.data;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.Accounts = Accounts;
|
|
21
|
+
//# sourceMappingURL=accounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountCallbacks.js","sourceRoot":"","sources":["../../lib/interfaces/AccountCallbacks.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"APISecretResponse.js","sourceRoot":"","sources":["../../../lib/interfaces/Response/APISecretResponse.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountUpdateResponse.js","sourceRoot":"","sources":["../../../lib/interfaces/Response/AccountUpdateResponse.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetBalanceResponse.js","sourceRoot":"","sources":["../../../lib/interfaces/Response/GetBalanceResponse.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListAPISecretsResponse.js","sourceRoot":"","sources":["../../../lib/interfaces/Response/ListAPISecretsResponse.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TopUpBalanceResponse.js","sourceRoot":"","sources":["../../../lib/interfaces/Response/TopUpBalanceResponse.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Secrets = void 0;
|
|
4
|
+
const server_client_1 = require("@vonage/server-client");
|
|
5
|
+
class Secrets extends server_client_1.Client {
|
|
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;
|
|
10
|
+
}
|
|
11
|
+
async deleteSecret(apiKey, id) {
|
|
12
|
+
await this.sendDeleteRequest(`${this.config.apiHost}/accounts/${apiKey}/secrets/${id}`);
|
|
13
|
+
}
|
|
14
|
+
async getSecret(apiKey, id) {
|
|
15
|
+
const response = await this.sendGetRequest(`${this.config.apiHost}/accounts/${apiKey}/secrets/${id}`);
|
|
16
|
+
return response.data;
|
|
17
|
+
}
|
|
18
|
+
async listSecrets(apiKey) {
|
|
19
|
+
const response = await this.sendGetRequest(`${this.config.apiHost}/accounts/${apiKey}/secrets`);
|
|
20
|
+
return response.data;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.Secrets = Secrets;
|
|
24
|
+
//# sourceMappingURL=secrets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secrets.js","sourceRoot":"","sources":["../lib/secrets.ts"],"names":[],"mappings":";;;AAAA,yDAAkE;AAIlE,MAAa,OAAQ,SAAQ,sBAAM;IACrB,QAAQ,GAAG,kCAAkB,CAAC,KAAK,CAAA;IAEtC,KAAK,CAAC,YAAY,CACrB,MAAc,EACd,MAAc;QAEd,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,eAAe,CACvC,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,aAAa,MAAM,UAAU,EACnD,EAAE,MAAM,EAAE,CACb,CAAA;QACD,OAAO,QAAQ,CAAC,IAAI,CAAA;IACxB,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,MAAc,EAAE,EAAU;QAChD,MAAM,IAAI,CAAC,iBAAiB,CACxB,GAAG,IAAI,CAAC,MAAM,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.1.
|
|
3
|
+
"version": "1.1.2",
|
|
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.1.
|
|
30
|
+
"@vonage/server-client": "^1.1.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@vonage/auth": "^1.1.
|
|
33
|
+
"@vonage/auth": "^1.1.2",
|
|
34
34
|
"nock": "^13.2.9"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|