@vonage/audit 1.3.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.
- package/README.md +15 -33
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,35 +1,24 @@
|
|
|
1
1
|
# Vonage Audit SDK for Node.js
|
|
2
2
|
|
|
3
|
-
](https://codecov.io/gh/Vonage/vonage-server-sdk)
|
|
5
|
-

|
|
6
|
-
[](../../CODE_OF_CONDUCT.md)
|
|
7
|
-
[][license]
|
|
3
|
+
 [](https://codecov.io/gh/Vonage/vonage-server-sdk)  [](../../CODE_OF_CONDUCT.md) [][license]
|
|
8
4
|
|
|
9
|
-
<img src="https://developer.nexmo.com/images/logos/vbc-logo.svg" height="48px" alt="Vonage" />
|
|
10
5
|
|
|
11
|
-
|
|
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].
|
|
6
|
+
<img src="https://developer.nexmo.com/images/logos/vbc-logo.svg" height="48px" alt="Vonage" />
|
|
14
7
|
|
|
15
|
-
|
|
16
|
-
`@vonage/server-sdk` package](https://github.com/vonage/vonage-node-sdk).
|
|
8
|
+
This is the Vonage Audit 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
9
|
|
|
18
10
|
For full API documentation refer to [developer.nexmo.com](https://developer.nexmo.com/).
|
|
19
11
|
|
|
20
12
|
* [Installation](#installation)
|
|
21
|
-
* [Usage](#
|
|
13
|
+
* [Usage](#usage)
|
|
22
14
|
* [Promises](#promises)
|
|
23
15
|
* [Testing](#testing)
|
|
24
16
|
|
|
25
17
|
## Installation
|
|
26
18
|
|
|
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.
|
|
19
|
+
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
20
|
|
|
31
|
-
You can also use this SDK standalone if you only need access to just the
|
|
32
|
-
Audit API.
|
|
21
|
+
You can also use this SDK standalone if you only need access to just the Audit API.
|
|
33
22
|
|
|
34
23
|
### With NPM
|
|
35
24
|
|
|
@@ -43,19 +32,18 @@ npm install @vonage/audit
|
|
|
43
32
|
yarn add @vonage/audit
|
|
44
33
|
```
|
|
45
34
|
|
|
46
|
-
##
|
|
35
|
+
## Usage
|
|
47
36
|
|
|
48
37
|
### As part of the Vonage Server SDK
|
|
49
38
|
|
|
50
|
-
If you are using this SDK as part of the Vonage Server SDK, you can access it
|
|
51
|
-
as the `audit` property off of the client that you instantiate.
|
|
39
|
+
If you are using this SDK as part of the Vonage Server SDK, you can access it as the `audit` property off of the client that you instantiate.
|
|
52
40
|
|
|
53
41
|
```js
|
|
54
42
|
const { Vonage, Auth } = require('@vonage/server-sdk');
|
|
55
43
|
|
|
56
44
|
const credentials = new Auth({
|
|
57
|
-
|
|
58
|
-
|
|
45
|
+
apiKey: API_KEY,
|
|
46
|
+
apiSecret: API_SECRET
|
|
59
47
|
});
|
|
60
48
|
const options = {};
|
|
61
49
|
const vonage = new Vonage(credentials, options);
|
|
@@ -71,32 +59,26 @@ const vonage = new Vonage(credentials, options);
|
|
|
71
59
|
|
|
72
60
|
### Standalone
|
|
73
61
|
|
|
74
|
-
The SDK can be used standalone from the main
|
|
75
|
-
[Vonage Server SDK for Node.js](https://github.com/vonage/vonage-node-sdk) if
|
|
76
|
-
you only need to use the Audit API. All you need to do is
|
|
77
|
-
`require('@vonage/audit')`, and use the returned object to create your own
|
|
78
|
-
client.
|
|
62
|
+
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 Audit API. All you need to do is `require('@vonage/audit')`, and use the returned object to create your own client.
|
|
79
63
|
|
|
80
64
|
```js
|
|
81
65
|
const { Auth } = require('@vonage/auth');
|
|
82
66
|
const { Audit } = require('@vonage/number');
|
|
83
67
|
|
|
84
68
|
const credentials = new Auth({
|
|
85
|
-
|
|
86
|
-
|
|
69
|
+
apiKey: API_KEY,
|
|
70
|
+
apiSecret: API_SECRET
|
|
87
71
|
});
|
|
88
72
|
const options = {};
|
|
89
73
|
|
|
90
74
|
const auditClient = new Audit(credentials, options);
|
|
91
75
|
```
|
|
92
76
|
|
|
93
|
-
Where `credentials` is any option from [`@vonage/auth`](https://github.com/Vonage/vonage-node-sdk/
|
|
94
|
-
and `options` is any option from [`@vonage/server-client`](https://github.com/Vonage/vonage-node-sdk/tree/3.x/readme/packages/server-client#options)
|
|
77
|
+
Where `credentials` is any option from [`@vonage/auth`](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/auth/README.md#options), 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)
|
|
95
78
|
|
|
96
79
|
## Promises
|
|
97
80
|
|
|
98
|
-
Most methods that interact with the Vonage API uses Promises. You can either
|
|
99
|
-
resolve these yourself, or use `await` to wait for a response.
|
|
81
|
+
Most methods that interact with the Vonage API uses Promises. You can either resolve these yourself, or use `await` to wait for a response.
|
|
100
82
|
|
|
101
83
|
```js
|
|
102
84
|
const resp = await vonage.audit.getEvent(eventId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vonage/audit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Vonage Audit SDK Package",
|
|
5
5
|
"homepage": "https://github.com/vonage/vonage-node-sdk/tree/master/packages/audit#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"compile": "npx tsc --build --verbose"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@vonage/auth": "^1.
|
|
31
|
-
"@vonage/server-client": "^1.
|
|
32
|
-
"@vonage/vetch": "^1.
|
|
30
|
+
"@vonage/auth": "^1.3.0",
|
|
31
|
+
"@vonage/server-client": "^1.4.0",
|
|
32
|
+
"@vonage/vetch": "^1.3.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"nock": "^13.2.9"
|