@vonage/accounts 1.2.0 → 1.4.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.
Files changed (2) hide show
  1. package/README.md +16 -30
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,32 +1,21 @@
1
1
  # Vonage Accounts SDK for Node.js
2
2
 
3
- ![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/vonage/vonage-node-sdk/Vonage/3.x?logo=github&style=flat-square&label=Workflow%20Build)
4
- [![Codecov](https://img.shields.io/codecov/c/github/vonage/vonage-node-sdk?label=Codecov&logo=codecov&style=flat-square)](https://codecov.io/gh/Vonage/vonage-server-sdk)
5
- ![Latest Release](https://img.shields.io/npm/v/@vonage/accounts)
6
- [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg?style=flat-square)](../../CODE_OF_CONDUCT.md)
7
- [![License](https://img.shields.io/npm/l/@vonage/accounts?label=License&style=flat-square)][license]
3
+ ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/vonage/vonage-node-sdk/ci.yml?branch=3.x) [![Codecov](https://img.shields.io/codecov/c/github/vonage/vonage-node-sdk?label=Codecov&logo=codecov&style=flat-square)](https://codecov.io/gh/Vonage/vonage-server-sdk) ![Latest Release](https://img.shields.io/npm/v/@vonage/accounts?label=%40vonage%2Faccounts&style=flat-square) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg?style=flat-square)](../../CODE_OF_CONDUCT.md) [![License](https://img.shields.io/npm/l/@vonage/accounts?label=License&style=flat-square)][license]
8
4
 
9
5
  <img src="https://developer.nexmo.com/images/logos/vbc-logo.svg" height="48px" alt="Vonage" />
10
6
 
11
- This is the Vonage Account SDK for Node.js for use with
12
- [Vonage APIs](https://www.vonage.com/). To use it you will need a Vonage
13
- account. Sign up [for free at vonage.com][signup].
14
-
15
- We recommend using this package as part of the overall
16
- [`@vonage/server-sdk` package](https://github.com/vonage/vonage-node-sdk).
7
+ This is the Vonage Account SDK for Node.js for use with [Vonage APIs](https://www.vonage.com/). To use it you will need a Vonage account. Sign up [for free at vonage.com][signup].
17
8
 
18
9
  For full API documentation refer to [developer.vonage.com](https://developer.vonage.com/).
19
10
 
20
11
  * [Installation](#installation)
21
- * [Usage](#using-the-vonage-accounts-sdk)
12
+ * [Usage](#usage)
22
13
  * [Promises](#promises)
23
14
  * [Testing](#testing)
24
15
 
25
16
  ## Installation
26
17
 
27
- We recommend using this SDK as part of the overall
28
- [`@vonage/server-sdk` package](https://github.com/vonage/vonage-node-sdk).
29
- Please see the main package for installation.
18
+ We recommend using this SDK as part of the overall [`@vonage/server-sdk` package](https://github.com/vonage/vonage-node-sdk). Please see the main package for installation.
30
19
 
31
20
  You can also use this SDK standalone if you only need access to just the Accounts API.
32
21
 
@@ -42,43 +31,40 @@ npm install @vonage/accounts
42
31
  yarn add @vonage/accounts
43
32
  ```
44
33
 
45
- ## Using the Vonage Accounts SDK
34
+ ## Usage
46
35
 
47
36
  ### As part of the Vonage Server SDK
48
37
 
49
- If you are using this SDK as part of the Vonage Server SDK, you can access it
50
- as the `accounts` property off of the client that you instantiate.
38
+ If you are using this SDK as part of the Vonage Server SDK, you can access it as the `accounts` property off of the client that you instantiate.
51
39
 
52
40
  ```js
53
41
  const { Vonage } = require('@vonage/server-sdk');
54
42
 
55
- const vonage = new Vonage({
43
+ const vonage = new Vonage(
44
+ {
56
45
  apiKey: API_KEY,
57
46
  apiSecret: API_SECRET,
58
- applicationId: APP_ID,
59
47
  privateKey: PRIVATE_KEY_PATH,
60
48
  signatureSecret: SIGNATURE_SECRET,
61
49
  signatureMethod: SIGNATURE_METHOD
62
- }, options);
50
+ },
51
+ options
52
+ );
63
53
 
64
54
  const balance = await vonage.accounts.getBalance();
65
55
  ```
66
56
 
67
57
  ### Standalone
68
58
 
69
- The SDK can be used standalone from the main
70
- [Vonage Server SDK for Node.js](https://github.com/vonage/vonage-node-sdk) if
71
- you only need to use the Account APIs. All you need to do is
72
- `require('@vonage/account')`, and use the returned object to create your own
73
- client.
59
+ The SDK can be used standalone from the main [Vonage Server SDK for Node.js](https://github.com/vonage/vonage-node-sdk) if you only need to use the Account APIs. All you need to do is `require('@vonage/account')`, and use the returned object to create your own client.
74
60
 
75
61
  ```js
76
62
  const { Auth } = require('@vonage/auth');
77
63
  const { Accounts } = require('@vonage/account');
78
64
 
79
65
  const credentials = new Auth({
80
- apiKey: API_KEY,
81
- apiSecret: API_SECRET,
66
+ apiKey: API_KEY,
67
+ apiSecret: API_SECRET,
82
68
  });
83
69
 
84
70
  const options = {}
@@ -86,8 +72,8 @@ const options = {}
86
72
  const accountClient = new Accounts(credentials, options);
87
73
  ```
88
74
 
89
- `credentials` is any option from [`@vonage/auth`](https://github.com/Vonage/vonage-node-sdk/tree/3.x/readme/packages/auth#options),
90
- and `options` is any option from [`@vonage/server-client`](https://github.com/Vonage/vonage-node-sdk/tree/3.x/readme/packages/server-client#options)
75
+ `credentials` is any option from [`@vonage/auth`](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/auth/README.md#options),
76
+ and `options` is any option from [`@vonage/server-client`](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/server-client/README.md#options)
91
77
 
92
78
  ## Promises
93
79
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vonage/accounts",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
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.2.0"
30
+ "@vonage/server-client": "^1.4.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@vonage/auth": "^1.1.2",
33
+ "@vonage/auth": "^1.3.0",
34
34
  "nock": "^13.2.9"
35
35
  },
36
36
  "publishConfig": {