@routr/sdk 2.12.1 → 2.13.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 +44 -44
- package/dist/{acl → acls}/acl.d.ts +22 -22
- package/dist/{acl → acls}/acl.js +25 -25
- package/dist/acls/index.d.ts +2 -0
- package/dist/{acl → acls}/index.js +1 -1
- package/dist/acls/types.d.ts +11 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/numbers/numbers.d.ts +2 -2
- package/dist/numbers/numbers.js +2 -2
- package/dist/trunks/types.d.ts +8 -8
- package/dist/types.d.ts +3 -0
- package/package.json +3 -3
- package/dist/acl/index.d.ts +0 -2
- package/dist/acl/types.d.ts +0 -11
- /package/dist/{acl → acls}/types.js +0 -0
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ $ npm install --save @routr/sdk
|
|
|
20
20
|
<!-- usagestop -->
|
|
21
21
|
# APIs
|
|
22
22
|
<!-- apis -->
|
|
23
|
-
* [`
|
|
23
|
+
* [`Acls`](#acl--apiclient)
|
|
24
24
|
* [`Agents`](#agents--apiclient)
|
|
25
25
|
* [`Credentials`](#credentials--apiclient)
|
|
26
26
|
* [`Domains`](#domains--apiclient)
|
|
@@ -29,9 +29,9 @@ $ npm install --save @routr/sdk
|
|
|
29
29
|
* [`Trunks`](#trunks--apiclient)
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
<a name="
|
|
32
|
+
<a name="Acls"></a>
|
|
33
33
|
|
|
34
|
-
##
|
|
34
|
+
## Acls ⇐ <code>APIClient</code>
|
|
35
35
|
Use Routr ACL, a capability of Routr SIP Proxy, to create, update, get
|
|
36
36
|
and delete Access Control Lists. The ACL API requires of a running Routr deployment.
|
|
37
37
|
|
|
@@ -39,18 +39,18 @@ and delete Access Control Lists. The ACL API requires of a running Routr deploym
|
|
|
39
39
|
**Extends**: <code>APIClient</code>
|
|
40
40
|
**See**: module:core:APIClient
|
|
41
41
|
|
|
42
|
-
* [
|
|
43
|
-
* [new
|
|
44
|
-
* [.
|
|
45
|
-
* [.
|
|
46
|
-
* [.
|
|
47
|
-
* [.
|
|
48
|
-
* [.
|
|
42
|
+
* [Acls](#Acls) ⇐ <code>APIClient</code>
|
|
43
|
+
* [new Acls(options)](#new_Acls_new)
|
|
44
|
+
* [.createAcl(request)](#Acls+createAcl) ⇒ <code>Promise.<CreateAclResponse></code>
|
|
45
|
+
* [.updateAcl(request)](#Acls+updateAcl) ⇒ <code>Promise.<UpdateAclResponse></code>
|
|
46
|
+
* [.getAcl(ref)](#Acls+getAcl) ⇒ <code>Promise.<GetAclResponse></code>
|
|
47
|
+
* [.deleteAcl(ref)](#Acls+deleteAcl) ⇒ <code>Promise.<void></code>
|
|
48
|
+
* [.listAcls(request)](#Acls+listAcls) ⇒ <code>Promise.<ListAclResponse></code>
|
|
49
49
|
|
|
50
|
-
<a name="
|
|
50
|
+
<a name="new_Acls_new"></a>
|
|
51
51
|
|
|
52
|
-
### new
|
|
53
|
-
Constructs a new
|
|
52
|
+
### new Acls(options)
|
|
53
|
+
Constructs a new API object.
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
| Param | Type | Description |
|
|
@@ -60,7 +60,7 @@ Constructs a new ACL API object.
|
|
|
60
60
|
**Example**
|
|
61
61
|
```js
|
|
62
62
|
const SDK = require("@routr/sdk")
|
|
63
|
-
const acl = new SDK.
|
|
63
|
+
const acl = new SDK.Acls()
|
|
64
64
|
|
|
65
65
|
const request = {
|
|
66
66
|
name: "Peer network",
|
|
@@ -68,17 +68,17 @@ const request = {
|
|
|
68
68
|
deny: "0.0.0.0/0"
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
acl.
|
|
71
|
+
acl.createAcl(request)
|
|
72
72
|
.then(console.log)
|
|
73
73
|
.catch(console.error) // an error occurred
|
|
74
74
|
```
|
|
75
|
-
<a name="
|
|
75
|
+
<a name="Acls+createAcl"></a>
|
|
76
76
|
|
|
77
|
-
###
|
|
77
|
+
### acls.createAcl(request) ⇒ <code>Promise.<CreateAclResponse></code>
|
|
78
78
|
Creates a new AccessControlList on Routr.
|
|
79
79
|
|
|
80
|
-
**Kind**: instance method of [<code>
|
|
81
|
-
**Returns**: <code>Promise.<
|
|
80
|
+
**Kind**: instance method of [<code>Acls</code>](#Acls)
|
|
81
|
+
**Returns**: <code>Promise.<CreateAclResponse></code> - The newly created AccessControlList
|
|
82
82
|
**Throws**:
|
|
83
83
|
|
|
84
84
|
- if request is null
|
|
@@ -86,7 +86,7 @@ Creates a new AccessControlList on Routr.
|
|
|
86
86
|
|
|
87
87
|
| Param | Type | Description |
|
|
88
88
|
| --- | --- | --- |
|
|
89
|
-
| request | <code>
|
|
89
|
+
| request | <code>CreateAclRequest</code> | The request to create an ACL |
|
|
90
90
|
| request.name | <code>string</code> | Name of the ACL |
|
|
91
91
|
| request.allow | <code>Array.<string></code> | List of IP addresses or CIDR blocks to allow |
|
|
92
92
|
| request.deny | <code>Array.<string></code> | List of IP addresses or CIDR blocks to deny |
|
|
@@ -100,21 +100,21 @@ const request = {
|
|
|
100
100
|
deny: "0.0.0.0/0"
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
acl.
|
|
103
|
+
acl.createAcl(request)
|
|
104
104
|
.then(console.log)
|
|
105
105
|
.catch(console.error) // an error occurred
|
|
106
106
|
```
|
|
107
|
-
<a name="
|
|
107
|
+
<a name="Acls+updateAcl"></a>
|
|
108
108
|
|
|
109
|
-
###
|
|
109
|
+
### acls.updateAcl(request) ⇒ <code>Promise.<UpdateAclResponse></code>
|
|
110
110
|
Updates an already existing AccessControlList on Routr.
|
|
111
111
|
|
|
112
|
-
**Kind**: instance method of [<code>
|
|
113
|
-
**Returns**: <code>Promise.<
|
|
112
|
+
**Kind**: instance method of [<code>Acls</code>](#Acls)
|
|
113
|
+
**Returns**: <code>Promise.<UpdateAclResponse></code> - The AccessControlList
|
|
114
114
|
|
|
115
115
|
| Param | Type | Description |
|
|
116
116
|
| --- | --- | --- |
|
|
117
|
-
| request | <code>
|
|
117
|
+
| request | <code>UpdateAclRequest</code> | Partial with the fields to update |
|
|
118
118
|
| request.name | <code>string</code> | Name of the ACL |
|
|
119
119
|
| request.allow | <code>Array.<string></code> | List of IP addresses or CIDR blocks to allow |
|
|
120
120
|
| request.deny | <code>Array.<string></code> | List of IP addresses or CIDR blocks to deny |
|
|
@@ -127,17 +127,17 @@ const request = {
|
|
|
127
127
|
name: "Peer network updated",
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
acl.
|
|
130
|
+
acl.updateAcl(request)
|
|
131
131
|
.then(console.log)
|
|
132
132
|
.catch(console.error) // an error occurred
|
|
133
133
|
```
|
|
134
|
-
<a name="
|
|
134
|
+
<a name="Acls+getAcl"></a>
|
|
135
135
|
|
|
136
|
-
###
|
|
136
|
+
### acls.getAcl(ref) ⇒ <code>Promise.<GetAclResponse></code>
|
|
137
137
|
Gets an AccessControlList from Routr.
|
|
138
138
|
|
|
139
|
-
**Kind**: instance method of [<code>
|
|
140
|
-
**Returns**: <code>Promise.<
|
|
139
|
+
**Kind**: instance method of [<code>Acls</code>](#Acls)
|
|
140
|
+
**Returns**: <code>Promise.<GetAclResponse></code> - The AccessControlList
|
|
141
141
|
|
|
142
142
|
| Param | Type | Description |
|
|
143
143
|
| --- | --- | --- |
|
|
@@ -147,16 +147,16 @@ Gets an AccessControlList from Routr.
|
|
|
147
147
|
```js
|
|
148
148
|
const ref = "4671371b-ff5d-48b1-aabe-d3c5ca5317a3"
|
|
149
149
|
|
|
150
|
-
acl.
|
|
150
|
+
acl.getAcl(ref)
|
|
151
151
|
.then(console.log)
|
|
152
152
|
.catch(console.error) // an error occurred
|
|
153
153
|
```
|
|
154
|
-
<a name="
|
|
154
|
+
<a name="Acls+deleteAcl"></a>
|
|
155
155
|
|
|
156
|
-
###
|
|
156
|
+
### acls.deleteAcl(ref) ⇒ <code>Promise.<void></code>
|
|
157
157
|
Deletes an AccessControlList from Routr.
|
|
158
158
|
|
|
159
|
-
**Kind**: instance method of [<code>
|
|
159
|
+
**Kind**: instance method of [<code>Acls</code>](#Acls)
|
|
160
160
|
|
|
161
161
|
| Param | Type | Description |
|
|
162
162
|
| --- | --- | --- |
|
|
@@ -166,21 +166,21 @@ Deletes an AccessControlList from Routr.
|
|
|
166
166
|
```js
|
|
167
167
|
const ref = "4671371b-ff5d-48b1-aabe-d3c5ca5317a3"
|
|
168
168
|
|
|
169
|
-
acl.
|
|
169
|
+
acl.deleteAcl(ref)
|
|
170
170
|
.then(console.log)
|
|
171
171
|
.catch(console.error) // an error occurred
|
|
172
172
|
```
|
|
173
|
-
<a name="
|
|
173
|
+
<a name="Acls+listAcls"></a>
|
|
174
174
|
|
|
175
|
-
###
|
|
175
|
+
### acls.listAcls(request) ⇒ <code>Promise.<ListAclResponse></code>
|
|
176
176
|
Lists all AccessControlLists from Routr with pagination.
|
|
177
177
|
|
|
178
|
-
**Kind**: instance method of [<code>
|
|
179
|
-
**Returns**: <code>Promise.<
|
|
178
|
+
**Kind**: instance method of [<code>Acls</code>](#Acls)
|
|
179
|
+
**Returns**: <code>Promise.<ListAclResponse></code> - The list of AccessControlLists
|
|
180
180
|
|
|
181
181
|
| Param | Type | Description |
|
|
182
182
|
| --- | --- | --- |
|
|
183
|
-
| request | <code>
|
|
183
|
+
| request | <code>ListAclRequest</code> | The request to list ACLs |
|
|
184
184
|
| request.pageSize | <code>number</code> | The number of ACLs to return |
|
|
185
185
|
| request.pageToken | <code>string</code> | The page token to use for pagination |
|
|
186
186
|
|
|
@@ -190,7 +190,7 @@ const request = {
|
|
|
190
190
|
pageSize: 10
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
acl.
|
|
193
|
+
acl.listAcls(request)
|
|
194
194
|
.then(console.log)
|
|
195
195
|
.catch(console.error) // an error occurred
|
|
196
196
|
```
|
|
@@ -808,7 +808,7 @@ Creates a new Number on Routr.
|
|
|
808
808
|
| request.city | <code>string</code> | The city where the number is located |
|
|
809
809
|
| request.country | <code>string</code> | The country where the number is located |
|
|
810
810
|
| request.countryIsoCode | <code>string</code> | The country ISO code where the number is located |
|
|
811
|
-
|
|
|
811
|
+
| | <code>Array.<{name: string, value: string}></code> | Extra headers to be used (e.g., [\{name: "X-Room-Id", value: "abc-us-123"\}]) |
|
|
812
812
|
| request.trunkRef | <code>string</code> | The Trunk reference to be used |
|
|
813
813
|
| request.sessionAffinityHeader | <code>string</code> | Optional session affinity header |
|
|
814
814
|
| request.extended | <code>string</code> | Optional extended attributes |
|
|
@@ -850,7 +850,7 @@ Updates an already existing Number on Routr.
|
|
|
850
850
|
| request | <code>UpdateNumberRequest</code> | Partial with the fields to update |
|
|
851
851
|
| request.name | <code>string</code> | Name of the Number |
|
|
852
852
|
| request.aorLink | <code>string</code> | The AOR link to be used (e.g., sip:1001@sip.local) |
|
|
853
|
-
| request.extraHeaders | <code>Array.<
|
|
853
|
+
| request.extraHeaders | <code>Array.<{name: string, value: string}></code> | Extra headers to be used (e.g., [\{name: "X-Room-Id", value: "abc-us-123"\}]) |
|
|
854
854
|
| request.trunkRef | <code>string</code> | The Trunk reference to be used |
|
|
855
855
|
| request.sessionAffinityHeader | <code>string</code> | Optional session affinity header |
|
|
856
856
|
| request.extended | <code>string</code> | Optional extended attributes |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { APIClient } from "../client";
|
|
2
2
|
import { ClientOptions } from "../types";
|
|
3
|
-
import {
|
|
3
|
+
import { CreateAclRequest, CreateAclResponse, GetAclResponse, ListAclRequest, ListAclResponse, UpdateAclRequest, UpdateAclResponse } from "./types";
|
|
4
4
|
/**
|
|
5
5
|
* @classdesc Use Routr ACL, a capability of Routr SIP Proxy, to create, update, get
|
|
6
6
|
* and delete Access Control Lists. The ACL API requires of a running Routr deployment.
|
|
@@ -9,7 +9,7 @@ import { CreateACLRequest, CreateACLResponse, GetACLResponse, ListACLRequest, Li
|
|
|
9
9
|
* @example
|
|
10
10
|
*
|
|
11
11
|
* const SDK = require("@routr/sdk")
|
|
12
|
-
* const acl = new SDK.
|
|
12
|
+
* const acl = new SDK.Acls()
|
|
13
13
|
*
|
|
14
14
|
* const request = {
|
|
15
15
|
* name: "Peer network",
|
|
@@ -17,13 +17,13 @@ import { CreateACLRequest, CreateACLResponse, GetACLResponse, ListACLRequest, Li
|
|
|
17
17
|
* deny: "0.0.0.0/0"
|
|
18
18
|
* }
|
|
19
19
|
*
|
|
20
|
-
* acl.
|
|
20
|
+
* acl.createAcl(request)
|
|
21
21
|
* .then(console.log)
|
|
22
22
|
* .catch(console.error) // an error occurred
|
|
23
23
|
*/
|
|
24
|
-
export declare class
|
|
24
|
+
export declare class Acls extends APIClient {
|
|
25
25
|
/**
|
|
26
|
-
* Constructs a new
|
|
26
|
+
* Constructs a new API object.
|
|
27
27
|
*
|
|
28
28
|
* @param {ClientOptions} options - Options to indicate the objects endpoint
|
|
29
29
|
* @see module:core:APIClient
|
|
@@ -32,12 +32,12 @@ export declare class ACL extends APIClient {
|
|
|
32
32
|
/**
|
|
33
33
|
* Creates a new AccessControlList on Routr.
|
|
34
34
|
*
|
|
35
|
-
* @param {
|
|
35
|
+
* @param {CreateAclRequest} request - The request to create an ACL
|
|
36
36
|
* @param {string} request.name - Name of the ACL
|
|
37
37
|
* @param {string[]} request.allow - List of IP addresses or CIDR blocks to allow
|
|
38
38
|
* @param {string[]} request.deny - List of IP addresses or CIDR blocks to deny
|
|
39
39
|
* @param {Object} request.extended - Optional extended attributes
|
|
40
|
-
* @return {Promise<
|
|
40
|
+
* @return {Promise<CreateAclResponse>} The newly created AccessControlList
|
|
41
41
|
* @throws if request is null
|
|
42
42
|
* @example
|
|
43
43
|
*
|
|
@@ -47,20 +47,20 @@ export declare class ACL extends APIClient {
|
|
|
47
47
|
* deny: "0.0.0.0/0"
|
|
48
48
|
* }
|
|
49
49
|
*
|
|
50
|
-
* acl.
|
|
50
|
+
* acl.createAcl(request)
|
|
51
51
|
* .then(console.log)
|
|
52
52
|
* .catch(console.error) // an error occurred
|
|
53
53
|
*/
|
|
54
|
-
|
|
54
|
+
createAcl(request: CreateAclRequest): Promise<CreateAclResponse>;
|
|
55
55
|
/**
|
|
56
56
|
* Updates an already existing AccessControlList on Routr.
|
|
57
57
|
*
|
|
58
|
-
* @param {
|
|
58
|
+
* @param {UpdateAclRequest} request - Partial with the fields to update
|
|
59
59
|
* @param {string} request.name - Name of the ACL
|
|
60
60
|
* @param {string[]} request.allow - List of IP addresses or CIDR blocks to allow
|
|
61
61
|
* @param {string[]} request.deny - List of IP addresses or CIDR blocks to deny
|
|
62
62
|
* @param {Object} request.extended - Optional extended attributes
|
|
63
|
-
* @return {Promise<
|
|
63
|
+
* @return {Promise<UpdateAclResponse>} The AccessControlList
|
|
64
64
|
* @example
|
|
65
65
|
*
|
|
66
66
|
* const request = {
|
|
@@ -68,25 +68,25 @@ export declare class ACL extends APIClient {
|
|
|
68
68
|
* name: "Peer network updated",
|
|
69
69
|
* }
|
|
70
70
|
*
|
|
71
|
-
* acl.
|
|
71
|
+
* acl.updateAcl(request)
|
|
72
72
|
* .then(console.log)
|
|
73
73
|
* .catch(console.error) // an error occurred
|
|
74
74
|
*/
|
|
75
|
-
|
|
75
|
+
updateAcl(request: UpdateAclRequest): Promise<UpdateAclResponse>;
|
|
76
76
|
/**
|
|
77
77
|
* Gets an AccessControlList from Routr.
|
|
78
78
|
*
|
|
79
79
|
* @param {string} ref - The ACL reference
|
|
80
|
-
* @return {Promise<
|
|
80
|
+
* @return {Promise<GetAclResponse>} The AccessControlList
|
|
81
81
|
* @example
|
|
82
82
|
*
|
|
83
83
|
* const ref = "4671371b-ff5d-48b1-aabe-d3c5ca5317a3"
|
|
84
84
|
*
|
|
85
|
-
* acl.
|
|
85
|
+
* acl.getAcl(ref)
|
|
86
86
|
* .then(console.log)
|
|
87
87
|
* .catch(console.error) // an error occurred
|
|
88
88
|
*/
|
|
89
|
-
|
|
89
|
+
getAcl(ref: string): Promise<GetAclResponse>;
|
|
90
90
|
/**
|
|
91
91
|
* Deletes an AccessControlList from Routr.
|
|
92
92
|
*
|
|
@@ -96,27 +96,27 @@ export declare class ACL extends APIClient {
|
|
|
96
96
|
*
|
|
97
97
|
* const ref = "4671371b-ff5d-48b1-aabe-d3c5ca5317a3"
|
|
98
98
|
*
|
|
99
|
-
* acl.
|
|
99
|
+
* acl.deleteAcl(ref)
|
|
100
100
|
* .then(console.log)
|
|
101
101
|
* .catch(console.error) // an error occurred
|
|
102
102
|
*/
|
|
103
|
-
|
|
103
|
+
deleteAcl(ref: string): Promise<void>;
|
|
104
104
|
/**
|
|
105
105
|
* Lists all AccessControlLists from Routr with pagination.
|
|
106
106
|
*
|
|
107
|
-
* @param {
|
|
107
|
+
* @param {ListAclRequest} request - The request to list ACLs
|
|
108
108
|
* @param {number} request.pageSize - The number of ACLs to return
|
|
109
109
|
* @param {string} request.pageToken - The page token to use for pagination
|
|
110
|
-
* @return {Promise<
|
|
110
|
+
* @return {Promise<ListAclResponse>} The list of AccessControlLists
|
|
111
111
|
* @example
|
|
112
112
|
*
|
|
113
113
|
* const request = {
|
|
114
114
|
* pageSize: 10
|
|
115
115
|
* }
|
|
116
116
|
*
|
|
117
|
-
* acl.
|
|
117
|
+
* acl.listAcls(request)
|
|
118
118
|
* .then(console.log)
|
|
119
119
|
* .catch(console.error) // an error occurred
|
|
120
120
|
*/
|
|
121
|
-
|
|
121
|
+
listAcls(request: ListAclRequest): Promise<ListAclResponse>;
|
|
122
122
|
}
|
package/dist/{acl → acls}/acl.js
RENAMED
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.Acls = void 0;
|
|
13
13
|
/*
|
|
14
14
|
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
15
15
|
* http://github.com/fonoster/routr
|
|
@@ -37,7 +37,7 @@ const client_1 = require("../client");
|
|
|
37
37
|
* @example
|
|
38
38
|
*
|
|
39
39
|
* const SDK = require("@routr/sdk")
|
|
40
|
-
* const acl = new SDK.
|
|
40
|
+
* const acl = new SDK.Acls()
|
|
41
41
|
*
|
|
42
42
|
* const request = {
|
|
43
43
|
* name: "Peer network",
|
|
@@ -45,13 +45,13 @@ const client_1 = require("../client");
|
|
|
45
45
|
* deny: "0.0.0.0/0"
|
|
46
46
|
* }
|
|
47
47
|
*
|
|
48
|
-
* acl.
|
|
48
|
+
* acl.createAcl(request)
|
|
49
49
|
* .then(console.log)
|
|
50
50
|
* .catch(console.error) // an error occurred
|
|
51
51
|
*/
|
|
52
|
-
class
|
|
52
|
+
class Acls extends client_1.APIClient {
|
|
53
53
|
/**
|
|
54
|
-
* Constructs a new
|
|
54
|
+
* Constructs a new API object.
|
|
55
55
|
*
|
|
56
56
|
* @param {ClientOptions} options - Options to indicate the objects endpoint
|
|
57
57
|
* @see module:core:APIClient
|
|
@@ -62,12 +62,12 @@ class ACL extends client_1.APIClient {
|
|
|
62
62
|
/**
|
|
63
63
|
* Creates a new AccessControlList on Routr.
|
|
64
64
|
*
|
|
65
|
-
* @param {
|
|
65
|
+
* @param {CreateAclRequest} request - The request to create an ACL
|
|
66
66
|
* @param {string} request.name - Name of the ACL
|
|
67
67
|
* @param {string[]} request.allow - List of IP addresses or CIDR blocks to allow
|
|
68
68
|
* @param {string[]} request.deny - List of IP addresses or CIDR blocks to deny
|
|
69
69
|
* @param {Object} request.extended - Optional extended attributes
|
|
70
|
-
* @return {Promise<
|
|
70
|
+
* @return {Promise<CreateAclResponse>} The newly created AccessControlList
|
|
71
71
|
* @throws if request is null
|
|
72
72
|
* @example
|
|
73
73
|
*
|
|
@@ -77,24 +77,24 @@ class ACL extends client_1.APIClient {
|
|
|
77
77
|
* deny: "0.0.0.0/0"
|
|
78
78
|
* }
|
|
79
79
|
*
|
|
80
|
-
* acl.
|
|
80
|
+
* acl.createAcl(request)
|
|
81
81
|
* .then(console.log)
|
|
82
82
|
* .catch(console.error) // an error occurred
|
|
83
83
|
*/
|
|
84
|
-
|
|
84
|
+
createAcl(request) {
|
|
85
85
|
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
-
return this.client.acl.create(request);
|
|
86
|
+
return yield this.client.acl.create(request);
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
90
|
* Updates an already existing AccessControlList on Routr.
|
|
91
91
|
*
|
|
92
|
-
* @param {
|
|
92
|
+
* @param {UpdateAclRequest} request - Partial with the fields to update
|
|
93
93
|
* @param {string} request.name - Name of the ACL
|
|
94
94
|
* @param {string[]} request.allow - List of IP addresses or CIDR blocks to allow
|
|
95
95
|
* @param {string[]} request.deny - List of IP addresses or CIDR blocks to deny
|
|
96
96
|
* @param {Object} request.extended - Optional extended attributes
|
|
97
|
-
* @return {Promise<
|
|
97
|
+
* @return {Promise<UpdateAclResponse>} The AccessControlList
|
|
98
98
|
* @example
|
|
99
99
|
*
|
|
100
100
|
* const request = {
|
|
@@ -102,11 +102,11 @@ class ACL extends client_1.APIClient {
|
|
|
102
102
|
* name: "Peer network updated",
|
|
103
103
|
* }
|
|
104
104
|
*
|
|
105
|
-
* acl.
|
|
105
|
+
* acl.updateAcl(request)
|
|
106
106
|
* .then(console.log)
|
|
107
107
|
* .catch(console.error) // an error occurred
|
|
108
108
|
*/
|
|
109
|
-
|
|
109
|
+
updateAcl(request) {
|
|
110
110
|
return __awaiter(this, void 0, void 0, function* () {
|
|
111
111
|
return this.client.acl.update(request);
|
|
112
112
|
});
|
|
@@ -115,18 +115,18 @@ class ACL extends client_1.APIClient {
|
|
|
115
115
|
* Gets an AccessControlList from Routr.
|
|
116
116
|
*
|
|
117
117
|
* @param {string} ref - The ACL reference
|
|
118
|
-
* @return {Promise<
|
|
118
|
+
* @return {Promise<GetAclResponse>} The AccessControlList
|
|
119
119
|
* @example
|
|
120
120
|
*
|
|
121
121
|
* const ref = "4671371b-ff5d-48b1-aabe-d3c5ca5317a3"
|
|
122
122
|
*
|
|
123
|
-
* acl.
|
|
123
|
+
* acl.getAcl(ref)
|
|
124
124
|
* .then(console.log)
|
|
125
125
|
* .catch(console.error) // an error occurred
|
|
126
126
|
*/
|
|
127
|
-
|
|
127
|
+
getAcl(ref) {
|
|
128
128
|
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
-
return this.client.acl.get(ref);
|
|
129
|
+
return yield this.client.acl.get(ref);
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
@@ -138,11 +138,11 @@ class ACL extends client_1.APIClient {
|
|
|
138
138
|
*
|
|
139
139
|
* const ref = "4671371b-ff5d-48b1-aabe-d3c5ca5317a3"
|
|
140
140
|
*
|
|
141
|
-
* acl.
|
|
141
|
+
* acl.deleteAcl(ref)
|
|
142
142
|
* .then(console.log)
|
|
143
143
|
* .catch(console.error) // an error occurred
|
|
144
144
|
*/
|
|
145
|
-
|
|
145
|
+
deleteAcl(ref) {
|
|
146
146
|
return __awaiter(this, void 0, void 0, function* () {
|
|
147
147
|
return this.client.acl.del(ref);
|
|
148
148
|
});
|
|
@@ -150,24 +150,24 @@ class ACL extends client_1.APIClient {
|
|
|
150
150
|
/**
|
|
151
151
|
* Lists all AccessControlLists from Routr with pagination.
|
|
152
152
|
*
|
|
153
|
-
* @param {
|
|
153
|
+
* @param {ListAclRequest} request - The request to list ACLs
|
|
154
154
|
* @param {number} request.pageSize - The number of ACLs to return
|
|
155
155
|
* @param {string} request.pageToken - The page token to use for pagination
|
|
156
|
-
* @return {Promise<
|
|
156
|
+
* @return {Promise<ListAclResponse>} The list of AccessControlLists
|
|
157
157
|
* @example
|
|
158
158
|
*
|
|
159
159
|
* const request = {
|
|
160
160
|
* pageSize: 10
|
|
161
161
|
* }
|
|
162
162
|
*
|
|
163
|
-
* acl.
|
|
163
|
+
* acl.listAcls(request)
|
|
164
164
|
* .then(console.log)
|
|
165
165
|
* .catch(console.error) // an error occurred
|
|
166
166
|
*/
|
|
167
|
-
|
|
167
|
+
listAcls(request) {
|
|
168
168
|
return __awaiter(this, void 0, void 0, function* () {
|
|
169
169
|
return this.client.acl.list(request);
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
exports.
|
|
173
|
+
exports.Acls = Acls;
|
|
@@ -35,4 +35,4 @@ exports.default = void 0;
|
|
|
35
35
|
*/
|
|
36
36
|
__exportStar(require("./acl"), exports);
|
|
37
37
|
var acl_1 = require("./acl");
|
|
38
|
-
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return acl_1.
|
|
38
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return acl_1.Acls; } });
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CommonConnect as CC } from "@routr/common";
|
|
2
|
+
import { CreateBaseOmit, Flatten } from "../types";
|
|
3
|
+
export type CreateAclRequest = Omit<CC.AccessControlList, CreateBaseOmit>;
|
|
4
|
+
export type CreateAclResponse = Flatten<CC.AccessControlList>;
|
|
5
|
+
export type UpdateAclRequest = Flatten<{
|
|
6
|
+
ref: string;
|
|
7
|
+
} & Partial<CreateAclRequest>>;
|
|
8
|
+
export type UpdateAclResponse = Flatten<CC.AccessControlList>;
|
|
9
|
+
export type ListAclRequest = Flatten<CC.ListRequest>;
|
|
10
|
+
export type ListAclResponse = Flatten<CC.ListResponse<CC.AccessControlList>>;
|
|
11
|
+
export type GetAclResponse = Flatten<CC.AccessControlList>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Acls from "./acls";
|
|
2
2
|
import Agents from "./agents";
|
|
3
3
|
import Domains from "./domains";
|
|
4
4
|
import Credentials from "./credentials";
|
|
@@ -6,7 +6,7 @@ import Peers from "./peers";
|
|
|
6
6
|
import Numbers from "./numbers";
|
|
7
7
|
import Trunks from "./trunks";
|
|
8
8
|
declare const SDK: {
|
|
9
|
-
|
|
9
|
+
Acls: typeof Acls;
|
|
10
10
|
Agents: typeof Agents;
|
|
11
11
|
Domains: typeof Domains;
|
|
12
12
|
Numbers: typeof Numbers;
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ exports.default = void 0;
|
|
|
22
22
|
* See the License for the specific language governing permissions and
|
|
23
23
|
* limitations under the License.
|
|
24
24
|
*/
|
|
25
|
-
const
|
|
25
|
+
const acls_1 = __importDefault(require("./acls"));
|
|
26
26
|
const agents_1 = __importDefault(require("./agents"));
|
|
27
27
|
const domains_1 = __importDefault(require("./domains"));
|
|
28
28
|
const credentials_1 = __importDefault(require("./credentials"));
|
|
@@ -30,7 +30,7 @@ const peers_1 = __importDefault(require("./peers"));
|
|
|
30
30
|
const numbers_1 = __importDefault(require("./numbers"));
|
|
31
31
|
const trunks_1 = __importDefault(require("./trunks"));
|
|
32
32
|
const SDK = {
|
|
33
|
-
|
|
33
|
+
Acls: acls_1.default,
|
|
34
34
|
Agents: agents_1.default,
|
|
35
35
|
Domains: domains_1.default,
|
|
36
36
|
Numbers: numbers_1.default,
|
|
@@ -51,7 +51,7 @@ export declare class Numbers extends APIClient {
|
|
|
51
51
|
* @param {string} request.city - The city where the number is located
|
|
52
52
|
* @param {string} request.country - The country where the number is located
|
|
53
53
|
* @param {string} request.countryIsoCode - The country ISO code where the number is located
|
|
54
|
-
* @param {
|
|
54
|
+
* @param {Array<{name: string, value: string}>} - Extra headers to be used (e.g., [\{name: "X-Room-Id", value: "abc-us-123"\}])
|
|
55
55
|
* @param {string} request.trunkRef - The Trunk reference to be used
|
|
56
56
|
* @param {string} request.sessionAffinityHeader - Optional session affinity header
|
|
57
57
|
* @param {string} request.extended - Optional extended attributes
|
|
@@ -88,7 +88,7 @@ export declare class Numbers extends APIClient {
|
|
|
88
88
|
* @param {UpdateNumberRequest} request - Partial with the fields to update
|
|
89
89
|
* @param {string} request.name - Name of the Number
|
|
90
90
|
* @param {string} request.aorLink - The AOR link to be used (e.g., sip:1001@sip.local)
|
|
91
|
-
* @param {
|
|
91
|
+
* @param {Array<{name: string, value: string}>} request.extraHeaders - Extra headers to be used (e.g., [\{name: "X-Room-Id", value: "abc-us-123"\}])
|
|
92
92
|
* @param {string} request.trunkRef - The Trunk reference to be used
|
|
93
93
|
* @param {string} request.sessionAffinityHeader - Optional session affinity header
|
|
94
94
|
* @param {string} request.extended - Optional extended attributes
|
package/dist/numbers/numbers.js
CHANGED
|
@@ -81,7 +81,7 @@ class Numbers extends client_1.APIClient {
|
|
|
81
81
|
* @param {string} request.city - The city where the number is located
|
|
82
82
|
* @param {string} request.country - The country where the number is located
|
|
83
83
|
* @param {string} request.countryIsoCode - The country ISO code where the number is located
|
|
84
|
-
* @param {
|
|
84
|
+
* @param {Array<{name: string, value: string}>} - Extra headers to be used (e.g., [\{name: "X-Room-Id", value: "abc-us-123"\}])
|
|
85
85
|
* @param {string} request.trunkRef - The Trunk reference to be used
|
|
86
86
|
* @param {string} request.sessionAffinityHeader - Optional session affinity header
|
|
87
87
|
* @param {string} request.extended - Optional extended attributes
|
|
@@ -122,7 +122,7 @@ class Numbers extends client_1.APIClient {
|
|
|
122
122
|
* @param {UpdateNumberRequest} request - Partial with the fields to update
|
|
123
123
|
* @param {string} request.name - Name of the Number
|
|
124
124
|
* @param {string} request.aorLink - The AOR link to be used (e.g., sip:1001@sip.local)
|
|
125
|
-
* @param {
|
|
125
|
+
* @param {Array<{name: string, value: string}>} request.extraHeaders - Extra headers to be used (e.g., [\{name: "X-Room-Id", value: "abc-us-123"\}])
|
|
126
126
|
* @param {string} request.trunkRef - The Trunk reference to be used
|
|
127
127
|
* @param {string} request.sessionAffinityHeader - Optional session affinity header
|
|
128
128
|
* @param {string} request.extended - Optional extended attributes
|
package/dist/trunks/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CommonConnect as CC } from "@routr/common";
|
|
2
|
-
import { CreateBaseOmit } from "../types";
|
|
2
|
+
import { CreateBaseOmit, Flatten } from "../types";
|
|
3
3
|
export type CreateTrunkRequest = Omit<CC.Trunk, CreateBaseOmit | "accessControlList" | "inboundCredentials" | "outboundCredentials">;
|
|
4
|
-
export type CreateTrunkResponse = CC.Trunk
|
|
5
|
-
export type UpdateTrunkRequest = {
|
|
4
|
+
export type CreateTrunkResponse = Flatten<CC.Trunk>;
|
|
5
|
+
export type UpdateTrunkRequest = Flatten<{
|
|
6
6
|
ref: string;
|
|
7
|
-
} & Partial<CreateTrunkRequest
|
|
8
|
-
export type UpdateTrunkResponse = CC.Trunk
|
|
9
|
-
export type ListTrunkRequest = CC.ListRequest
|
|
10
|
-
export type ListTrunkResponse = CC.ListResponse<CC.Trunk
|
|
11
|
-
export type GetTrunkResponse = CC.Trunk
|
|
7
|
+
} & Partial<CreateTrunkRequest>>;
|
|
8
|
+
export type UpdateTrunkResponse = Flatten<CC.Trunk>;
|
|
9
|
+
export type ListTrunkRequest = Flatten<CC.ListRequest>;
|
|
10
|
+
export type ListTrunkResponse = Flatten<CC.ListResponse<CC.Trunk>>;
|
|
11
|
+
export type GetTrunkResponse = Flatten<CC.Trunk>;
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@routr/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"description": "The Routr SDK for Node.js",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/routr#readme",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@opentelemetry/sdk-trace-base": "^1.0.4",
|
|
28
28
|
"@opentelemetry/sdk-trace-node": "^1.0.4",
|
|
29
29
|
"@opentelemetry/semantic-conventions": "^1.0.4",
|
|
30
|
-
"@routr/common": "^2.
|
|
30
|
+
"@routr/common": "^2.13.0",
|
|
31
31
|
"google-protobuf": "^3.9.2",
|
|
32
32
|
"pb-util": "^1.0.3"
|
|
33
33
|
},
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/google-protobuf": "^3.15.6"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "6272ef833472f0df1204073739c48eeb37ce705f"
|
|
51
51
|
}
|
package/dist/acl/index.d.ts
DELETED
package/dist/acl/types.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { CommonConnect as CC } from "@routr/common";
|
|
2
|
-
import { CreateBaseOmit } from "../types";
|
|
3
|
-
export type CreateACLRequest = Omit<CC.AccessControlList, CreateBaseOmit>;
|
|
4
|
-
export type CreateACLResponse = CC.AccessControlList;
|
|
5
|
-
export type UpdateACLRequest = {
|
|
6
|
-
ref: string;
|
|
7
|
-
} & Partial<CreateACLRequest>;
|
|
8
|
-
export type UpdateACLResponse = CC.AccessControlList;
|
|
9
|
-
export type ListACLRequest = CC.ListRequest;
|
|
10
|
-
export type ListACLResponse = CC.ListResponse<CC.AccessControlList>;
|
|
11
|
-
export type GetACLResponse = CC.AccessControlList;
|
|
File without changes
|