@fonoster/sdk 0.6.5 → 0.6.6
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 +519 -454
- package/dist/node/Acls.d.ts +43 -44
- package/dist/node/Acls.js +62 -49
- package/dist/node/Agents.d.ts +44 -45
- package/dist/node/Agents.js +47 -46
- package/dist/node/ApiKeys.d.ts +29 -29
- package/dist/node/ApiKeys.js +29 -29
- package/dist/node/Applications.d.ts +39 -39
- package/dist/node/Applications.js +52 -40
- package/dist/node/Calls.d.ts +28 -29
- package/dist/node/Calls.js +32 -27
- package/dist/node/Credentials.d.ts +39 -39
- package/dist/node/Credentials.js +39 -39
- package/dist/node/Domains.d.ts +37 -37
- package/dist/node/Domains.js +37 -37
- package/dist/node/Numbers.d.ts +40 -40
- package/dist/node/Numbers.js +40 -40
- package/dist/node/Secrets.d.ts +37 -37
- package/dist/node/Secrets.js +37 -37
- package/dist/node/Trunks.d.ts +58 -52
- package/dist/node/Trunks.js +104 -70
- package/dist/node/Users.d.ts +34 -34
- package/dist/node/Users.js +34 -34
- package/dist/node/Workspaces.d.ts +55 -54
- package/dist/node/Workspaces.js +61 -54
- package/dist/node/client/jsonToObject.js +1 -1
- package/dist/node/client/makeRpcRequest.js +1 -1
- package/dist/node/client/objectToJson.d.ts +1 -1
- package/dist/node/client/objectToJson.js +12 -2
- package/dist/node/client/types/IdentityClient.d.ts +2 -2
- package/dist/node/client/utils.js +6 -3
- package/dist/node/generated/node/agents_grpc_pb.js +0 -2
- package/dist/node/generated/node/agents_pb.js +444 -24
- package/dist/node/generated/node/applications_pb.js +6 -6
- package/dist/node/generated/node/credentials_pb.js +11 -41
- package/dist/node/generated/node/domains_pb.js +30 -30
- package/dist/node/generated/node/identity_grpc_pb.js +14 -14
- package/dist/node/generated/node/identity_pb.js +37 -37
- package/dist/node/generated/node/numbers_grpc_pb.js +0 -1
- package/dist/node/generated/node/numbers_pb.js +191 -11
- package/dist/node/generated/node/trunks_grpc_pb.js +0 -2
- package/dist/node/generated/node/trunks_pb.js +526 -31
- package/dist/node/generated/web/IdentityServiceClientPb.ts +5 -5
- package/dist/node/generated/web/agents_pb.d.ts +62 -10
- package/dist/node/generated/web/agents_pb.js +444 -24
- package/dist/node/generated/web/applications_pb.js +6 -6
- package/dist/node/generated/web/credentials_pb.d.ts +0 -4
- package/dist/node/generated/web/credentials_pb.js +11 -41
- package/dist/node/generated/web/domains_pb.js +30 -30
- package/dist/node/generated/web/identity_pb.d.ts +13 -13
- package/dist/node/generated/web/identity_pb.js +37 -37
- package/dist/node/generated/web/numbers_pb.d.ts +26 -4
- package/dist/node/generated/web/numbers_pb.js +191 -11
- package/dist/node/generated/web/trunks_pb.d.ts +71 -11
- package/dist/node/generated/web/trunks_pb.js +526 -31
- package/dist/node/tsconfig.node.tsbuildinfo +1 -1
- package/dist/node/utils.d.ts +4 -3
- package/dist/node/utils.js +36 -0
- package/dist/web/fonoster.min.js +1 -1
- package/dist/web/index.esm.js +1 -1
- package/package.json +4 -4
package/dist/node/Calls.js
CHANGED
|
@@ -32,13 +32,12 @@ const calls_pb_1 = require("./generated/node/calls_pb");
|
|
|
32
32
|
* const SDK = require("@fonoster/sdk");
|
|
33
33
|
*
|
|
34
34
|
* async function main(request) {
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* const accessKeyId = "00000000-0000-0000-0000-000000000000";
|
|
35
|
+
* const API_KEY = "your-api-key";
|
|
36
|
+
* const ACCESS_KEY_ID = "00000000-0000-0000-0000-000000000000";
|
|
38
37
|
*
|
|
39
|
-
*
|
|
40
|
-
* const client = SDK.Client({ accessKeyId });
|
|
41
|
-
* await client.
|
|
38
|
+
* try {
|
|
39
|
+
* const client = SDK.Client({ accessKeyId: ACCESS_KEY_ID });
|
|
40
|
+
* await client.loginWithApiKey(apiKey);
|
|
42
41
|
*
|
|
43
42
|
* const calls = new SDK.Calls(client);
|
|
44
43
|
* const response = await apiKeys.createCall(request);
|
|
@@ -78,18 +77,18 @@ class Calls {
|
|
|
78
77
|
* @param {string} request.appRef - The reference of the App that will handle the call
|
|
79
78
|
* @return {Promise<CreateCallResponse>} - The response object that contains the reference to the created Call
|
|
80
79
|
* @example
|
|
80
|
+
* const calls = new SDK.Calls(client); // Existing client object
|
|
81
81
|
*
|
|
82
82
|
* const request = {
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
83
|
+
* from: "8287854037",
|
|
84
|
+
* to: "+17853178070",
|
|
85
|
+
* appRef: "00000000-0000-0000-0000-000000000000"
|
|
86
86
|
* };
|
|
87
87
|
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* .catch(console.error); // an error occurred
|
|
88
|
+
* calls
|
|
89
|
+
* .createCall(request)
|
|
90
|
+
* .then(console.log) // successful response
|
|
91
|
+
* .catch(console.error); // an error occurred
|
|
93
92
|
*/
|
|
94
93
|
async createCall(request) {
|
|
95
94
|
const client = this.client.getCallsClient();
|
|
@@ -107,14 +106,14 @@ class Calls {
|
|
|
107
106
|
* @param {string} ref - The reference of the Call to retrieve
|
|
108
107
|
* @return {Promise<Acl>} - The response object that contains the Call detail
|
|
109
108
|
* @example
|
|
110
|
-
*
|
|
111
|
-
* const ref = "00000000-0000-0000-0000-000000000000"
|
|
112
|
-
*
|
|
113
109
|
* const calls = new SDK.Calls(client); // Existing client object
|
|
114
110
|
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
111
|
+
* const ref = "00000000-0000-0000-0000-000000000000";
|
|
112
|
+
*
|
|
113
|
+
* calls
|
|
114
|
+
* .getCall(ref)
|
|
115
|
+
* .then(console.log) // successful response
|
|
116
|
+
* .catch(console.error); // an error occurred
|
|
118
117
|
*/
|
|
119
118
|
async getCall(ref) {
|
|
120
119
|
const client = this.client.getCallsClient();
|
|
@@ -139,17 +138,17 @@ class Calls {
|
|
|
139
138
|
* @param {string} request.pageToken - The token to retrieve the next page of Calls
|
|
140
139
|
* @return {Promise<ListCallsResponse>} - The response object that contains the list of Calls
|
|
141
140
|
* @example
|
|
141
|
+
* const calls = new SDK.Calls(client); // Existing client object
|
|
142
142
|
*
|
|
143
143
|
* const request = {
|
|
144
|
-
*
|
|
145
|
-
*
|
|
144
|
+
* pageSize: 10,
|
|
145
|
+
* pageToken: "00000000-0000-0000-0000-000000000000"
|
|
146
146
|
* };
|
|
147
147
|
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* .catch(console.error); // an error occurred
|
|
148
|
+
* calls
|
|
149
|
+
* .listCalls(request)
|
|
150
|
+
* .then(console.log) // successful response
|
|
151
|
+
* .catch(console.error); // an error occurred
|
|
153
152
|
*/
|
|
154
153
|
async listCalls(request) {
|
|
155
154
|
const client = this.client.getCallsClient();
|
|
@@ -158,6 +157,12 @@ class Calls {
|
|
|
158
157
|
requestPBObjectConstructor: calls_pb_1.ListCallsRequest,
|
|
159
158
|
metadata: this.client.getMetadata(),
|
|
160
159
|
request,
|
|
160
|
+
enumMapping: [
|
|
161
|
+
["type", types_1.CallType],
|
|
162
|
+
["callStatus", types_1.CallStatus],
|
|
163
|
+
["hangupCause", types_1.HangupCause],
|
|
164
|
+
["callDirection", types_1.CallDirection]
|
|
165
|
+
],
|
|
161
166
|
repeatableObjectMapping: [["itemsList", calls_pb_1.Call]]
|
|
162
167
|
});
|
|
163
168
|
}
|
|
@@ -10,11 +10,11 @@ import { FonosterClient } from "./client/types";
|
|
|
10
10
|
* const SDK = require("@fonoster/sdk");
|
|
11
11
|
*
|
|
12
12
|
* async function main(request) {
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* const API_KEY = "your-api-key";
|
|
14
|
+
* const ACCESS_KEY_ID = "00000000-0000-0000-0000-000000000000";
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
* const client = SDK.Client({ accessKeyId });
|
|
16
|
+
* try {
|
|
17
|
+
* const client = SDK.Client({ accessKeyId: ACCESS_KEY_ID });
|
|
18
18
|
* await client.loginWithApiKey(apiKey);
|
|
19
19
|
*
|
|
20
20
|
* const credentials = new SDK.Credentials(client);
|
|
@@ -53,18 +53,18 @@ declare class Credentials {
|
|
|
53
53
|
* @param {string} request.password - The password of the Credentials
|
|
54
54
|
* @return {Promise<BaseApiObject>} - The response object that contains the reference to the created Credentials
|
|
55
55
|
* @example
|
|
56
|
+
* const credentials = new SDK.Credentials(client); // Existing client object
|
|
56
57
|
*
|
|
57
58
|
* const request = {
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
59
|
+
* name: "My Credentials",
|
|
60
|
+
* username: "myusername",
|
|
61
|
+
* password: "mysecret"
|
|
61
62
|
* };
|
|
62
63
|
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* .catch(console.error); // an error occurred
|
|
64
|
+
* credentials
|
|
65
|
+
* .createCredentials(request)
|
|
66
|
+
* .then(console.log) // successful response
|
|
67
|
+
* .catch(console.error); // an error occurred
|
|
68
68
|
*/
|
|
69
69
|
createCredentials(request: CreateCredentialsRequest): Promise<BaseApiObject>;
|
|
70
70
|
/**
|
|
@@ -73,14 +73,14 @@ declare class Credentials {
|
|
|
73
73
|
* @param {string} ref - The reference of the Credentials to retrieve
|
|
74
74
|
* @return {Promise<Acl>} - The response object that contains the Credentials
|
|
75
75
|
* @example
|
|
76
|
-
*
|
|
77
|
-
* const ref = "00000000-0000-0000-0000-000000000000"
|
|
78
|
-
*
|
|
79
76
|
* const credentials = new SDK.Credentials(client); // Existing client object
|
|
80
77
|
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
78
|
+
* const ref = "00000000-0000-0000-0000-000000000000";
|
|
79
|
+
*
|
|
80
|
+
* credentials
|
|
81
|
+
* .getCredentials(ref)
|
|
82
|
+
* .then(console.log) // successful response
|
|
83
|
+
* .catch(console.error); // an error occurred
|
|
84
84
|
*/
|
|
85
85
|
getCredentials(ref: string): Promise<CredentialsType>;
|
|
86
86
|
/**
|
|
@@ -92,18 +92,18 @@ declare class Credentials {
|
|
|
92
92
|
* @param {string} request.password - The password of the Credentials
|
|
93
93
|
* @return {Promise<BaseApiObject>} - The response object that contains the reference to the updated Credentials
|
|
94
94
|
* @example
|
|
95
|
+
* const credentials = new SDK.Credentials(client); // Existing client object
|
|
95
96
|
*
|
|
96
97
|
* const request = {
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
98
|
+
* ref: "00000000-0000-0000-0000-000000000000",
|
|
99
|
+
* name: "My Credentials",
|
|
100
|
+
* password: "mysecret"
|
|
100
101
|
* };
|
|
101
102
|
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* .catch(console.error); // an error occurred
|
|
103
|
+
* credentials
|
|
104
|
+
* .updateCredentials(request)
|
|
105
|
+
* .then(console.log) // successful response
|
|
106
|
+
* .catch(console.error); // an error occurred
|
|
107
107
|
*/
|
|
108
108
|
updateCredentials(request: UpdateCredentialsRequest): Promise<BaseApiObject>;
|
|
109
109
|
/**
|
|
@@ -114,17 +114,17 @@ declare class Credentials {
|
|
|
114
114
|
* @param {string} request.pageToken - The token to retrieve the next page of Credentials
|
|
115
115
|
* @return {Promise<ListCredentialsResponse>} - The response object that contains the list of Credentials
|
|
116
116
|
* @example
|
|
117
|
+
* const credentials = new SDK.Credentials(client); // Existing client object
|
|
117
118
|
*
|
|
118
119
|
* const request = {
|
|
119
|
-
*
|
|
120
|
-
*
|
|
120
|
+
* pageSize: 10,
|
|
121
|
+
* pageToken: "00000000-0000-0000-0000-000000000000"
|
|
121
122
|
* };
|
|
122
123
|
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* .catch(console.error); // an error occurred
|
|
124
|
+
* credentials
|
|
125
|
+
* .listCredentials(request)
|
|
126
|
+
* .then(console.log) // successful response
|
|
127
|
+
* .catch(console.error); // an error occurred
|
|
128
128
|
*/
|
|
129
129
|
listCredentials(request: ListCredentialsRequest): Promise<ListCredentialsResponse>;
|
|
130
130
|
/**
|
|
@@ -134,14 +134,14 @@ declare class Credentials {
|
|
|
134
134
|
* @param {string} ref - The reference of the Credentials to delete
|
|
135
135
|
* @return {Promise<BaseApiObject>} - The response object that contains the reference to the deleted Credentials
|
|
136
136
|
* @example
|
|
137
|
-
*
|
|
138
|
-
* const ref = "00000000-0000-0000-0000-000000000000"
|
|
139
|
-
*
|
|
140
137
|
* const credentials = new SDK.Credentials(client); // Existing client object
|
|
141
138
|
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
139
|
+
* const ref = "00000000-0000-0000-0000-000000000000";
|
|
140
|
+
*
|
|
141
|
+
* credentials
|
|
142
|
+
* .deleteCredentials(ref)
|
|
143
|
+
* .then(console.log) // successful response
|
|
144
|
+
* .catch(console.error); // an error occurred
|
|
145
145
|
*/
|
|
146
146
|
deleteCredentials(ref: string): Promise<BaseApiObject>;
|
|
147
147
|
}
|
package/dist/node/Credentials.js
CHANGED
|
@@ -13,11 +13,11 @@ const credentials_pb_1 = require("./generated/node/credentials_pb");
|
|
|
13
13
|
* const SDK = require("@fonoster/sdk");
|
|
14
14
|
*
|
|
15
15
|
* async function main(request) {
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* const API_KEY = "your-api-key";
|
|
17
|
+
* const ACCESS_KEY_ID = "00000000-0000-0000-0000-000000000000";
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
* const client = SDK.Client({ accessKeyId });
|
|
19
|
+
* try {
|
|
20
|
+
* const client = SDK.Client({ accessKeyId: ACCESS_KEY_ID });
|
|
21
21
|
* await client.loginWithApiKey(apiKey);
|
|
22
22
|
*
|
|
23
23
|
* const credentials = new SDK.Credentials(client);
|
|
@@ -58,18 +58,18 @@ class Credentials {
|
|
|
58
58
|
* @param {string} request.password - The password of the Credentials
|
|
59
59
|
* @return {Promise<BaseApiObject>} - The response object that contains the reference to the created Credentials
|
|
60
60
|
* @example
|
|
61
|
+
* const credentials = new SDK.Credentials(client); // Existing client object
|
|
61
62
|
*
|
|
62
63
|
* const request = {
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
64
|
+
* name: "My Credentials",
|
|
65
|
+
* username: "myusername",
|
|
66
|
+
* password: "mysecret"
|
|
66
67
|
* };
|
|
67
68
|
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* .catch(console.error); // an error occurred
|
|
69
|
+
* credentials
|
|
70
|
+
* .createCredentials(request)
|
|
71
|
+
* .then(console.log) // successful response
|
|
72
|
+
* .catch(console.error); // an error occurred
|
|
73
73
|
*/
|
|
74
74
|
async createCredentials(request) {
|
|
75
75
|
const client = this.client.getCredentialsClient();
|
|
@@ -86,14 +86,14 @@ class Credentials {
|
|
|
86
86
|
* @param {string} ref - The reference of the Credentials to retrieve
|
|
87
87
|
* @return {Promise<Acl>} - The response object that contains the Credentials
|
|
88
88
|
* @example
|
|
89
|
-
*
|
|
90
|
-
* const ref = "00000000-0000-0000-0000-000000000000"
|
|
91
|
-
*
|
|
92
89
|
* const credentials = new SDK.Credentials(client); // Existing client object
|
|
93
90
|
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
91
|
+
* const ref = "00000000-0000-0000-0000-000000000000";
|
|
92
|
+
*
|
|
93
|
+
* credentials
|
|
94
|
+
* .getCredentials(ref)
|
|
95
|
+
* .then(console.log) // successful response
|
|
96
|
+
* .catch(console.error); // an error occurred
|
|
97
97
|
*/
|
|
98
98
|
async getCredentials(ref) {
|
|
99
99
|
const client = this.client.getCredentialsClient();
|
|
@@ -113,18 +113,18 @@ class Credentials {
|
|
|
113
113
|
* @param {string} request.password - The password of the Credentials
|
|
114
114
|
* @return {Promise<BaseApiObject>} - The response object that contains the reference to the updated Credentials
|
|
115
115
|
* @example
|
|
116
|
+
* const credentials = new SDK.Credentials(client); // Existing client object
|
|
116
117
|
*
|
|
117
118
|
* const request = {
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
119
|
+
* ref: "00000000-0000-0000-0000-000000000000",
|
|
120
|
+
* name: "My Credentials",
|
|
121
|
+
* password: "mysecret"
|
|
121
122
|
* };
|
|
122
123
|
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* .catch(console.error); // an error occurred
|
|
124
|
+
* credentials
|
|
125
|
+
* .updateCredentials(request)
|
|
126
|
+
* .then(console.log) // successful response
|
|
127
|
+
* .catch(console.error); // an error occurred
|
|
128
128
|
*/
|
|
129
129
|
async updateCredentials(request) {
|
|
130
130
|
const client = this.client.getCredentialsClient();
|
|
@@ -143,17 +143,17 @@ class Credentials {
|
|
|
143
143
|
* @param {string} request.pageToken - The token to retrieve the next page of Credentials
|
|
144
144
|
* @return {Promise<ListCredentialsResponse>} - The response object that contains the list of Credentials
|
|
145
145
|
* @example
|
|
146
|
+
* const credentials = new SDK.Credentials(client); // Existing client object
|
|
146
147
|
*
|
|
147
148
|
* const request = {
|
|
148
|
-
*
|
|
149
|
-
*
|
|
149
|
+
* pageSize: 10,
|
|
150
|
+
* pageToken: "00000000-0000-0000-0000-000000000000"
|
|
150
151
|
* };
|
|
151
152
|
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
* .catch(console.error); // an error occurred
|
|
153
|
+
* credentials
|
|
154
|
+
* .listCredentials(request)
|
|
155
|
+
* .then(console.log) // successful response
|
|
156
|
+
* .catch(console.error); // an error occurred
|
|
157
157
|
*/
|
|
158
158
|
async listCredentials(request) {
|
|
159
159
|
const client = this.client.getCredentialsClient();
|
|
@@ -172,14 +172,14 @@ class Credentials {
|
|
|
172
172
|
* @param {string} ref - The reference of the Credentials to delete
|
|
173
173
|
* @return {Promise<BaseApiObject>} - The response object that contains the reference to the deleted Credentials
|
|
174
174
|
* @example
|
|
175
|
-
*
|
|
176
|
-
* const ref = "00000000-0000-0000-0000-000000000000"
|
|
177
|
-
*
|
|
178
175
|
* const credentials = new SDK.Credentials(client); // Existing client object
|
|
179
176
|
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
177
|
+
* const ref = "00000000-0000-0000-0000-000000000000";
|
|
178
|
+
*
|
|
179
|
+
* credentials
|
|
180
|
+
* .deleteCredentials(ref)
|
|
181
|
+
* .then(console.log) // successful response
|
|
182
|
+
* .catch(console.error); // an error occurred
|
|
183
183
|
*/
|
|
184
184
|
async deleteCredentials(ref) {
|
|
185
185
|
const applicationsClient = this.client.getCredentialsClient();
|
package/dist/node/Domains.d.ts
CHANGED
|
@@ -10,11 +10,11 @@ import { FonosterClient } from "./client/types";
|
|
|
10
10
|
* const SDK = require("@fonoster/sdk");
|
|
11
11
|
*
|
|
12
12
|
* async function main(request) {
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* const API_KEY = "your-api-key";
|
|
14
|
+
* const ACCESS_KEY_ID = "00000000-0000-0000-0000-000000000000";
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
* const client = SDK.Client({ accessKeyId });
|
|
16
|
+
* try {
|
|
17
|
+
* const client = SDK.Client({ accessKeyId: ACCESS_KEY_ID });
|
|
18
18
|
* await client.loginWithApiKey(apiKey);
|
|
19
19
|
*
|
|
20
20
|
* const domains = new SDK.Domains(client);
|
|
@@ -55,17 +55,17 @@ declare class Domains {
|
|
|
55
55
|
* @param {string} request.egressPolicy[].numberRef - The Number that will be used to send the call to the PSTN
|
|
56
56
|
* @return {Promise<BaseApiObject>} - The response object that contains the reference to the created Domain
|
|
57
57
|
* @example
|
|
58
|
+
* const domains = new SDK.Domains(client); // Existing client object
|
|
58
59
|
*
|
|
59
60
|
* const request = {
|
|
60
|
-
*
|
|
61
|
-
*
|
|
61
|
+
* name: "My Domain",
|
|
62
|
+
* domainUri: "sip.project.fonoster.io"
|
|
62
63
|
* };
|
|
63
64
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* .catch(console.error); // an error occurred
|
|
65
|
+
* domains
|
|
66
|
+
* .createDomain(request)
|
|
67
|
+
* .then(console.log) // successful response
|
|
68
|
+
* .catch(console.error); // an error occurred
|
|
69
69
|
*/
|
|
70
70
|
createDomain(request: CreateDomainRequest): Promise<BaseApiObject>;
|
|
71
71
|
/**
|
|
@@ -74,14 +74,14 @@ declare class Domains {
|
|
|
74
74
|
* @param {string} ref - The reference of the Domain to retrieve
|
|
75
75
|
* @return {Promise<Acl>} - The response object that contains the Domain
|
|
76
76
|
* @example
|
|
77
|
-
*
|
|
78
|
-
* const ref = "00000000-0000-0000-0000-000000000000"
|
|
79
|
-
*
|
|
80
77
|
* const domains = new SDK.Domains(client); // Existing client object
|
|
81
78
|
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
79
|
+
* const ref = "00000000-0000-0000-0000-000000000000";
|
|
80
|
+
*
|
|
81
|
+
* domains
|
|
82
|
+
* .getDomain(ref)
|
|
83
|
+
* .then(console.log) // successful response
|
|
84
|
+
* .catch(console.error); // an error occurred
|
|
85
85
|
*/
|
|
86
86
|
getDomain(ref: string): Promise<Domain>;
|
|
87
87
|
/**
|
|
@@ -97,17 +97,17 @@ declare class Domains {
|
|
|
97
97
|
* @param {string} request.egressPolicy[].numberRef - The Number that will be used to send the call to the PSTN
|
|
98
98
|
* @return {Promise<BaseApiObject>} - The response object that contains the reference to the updated Domain
|
|
99
99
|
* @example
|
|
100
|
+
* const domains = new SDK.Domains(client); // Existing client object
|
|
100
101
|
*
|
|
101
102
|
* const request = {
|
|
102
|
-
*
|
|
103
|
-
*
|
|
103
|
+
* ref: "00000000-0000-0000-0000-000000000000",
|
|
104
|
+
* accessControlListRef: "00000000-0000-0000-0000-000000000001"
|
|
104
105
|
* };
|
|
105
106
|
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* .catch(console.error); // an error occurred
|
|
107
|
+
* domains
|
|
108
|
+
* .updateDomain(request)
|
|
109
|
+
* .then(console.log) // successful response
|
|
110
|
+
* .catch(console.error); // an error occurred
|
|
111
111
|
*/
|
|
112
112
|
updateDomain(request: UpdateDomainRequest): Promise<BaseApiObject>;
|
|
113
113
|
/**
|
|
@@ -118,17 +118,17 @@ declare class Domains {
|
|
|
118
118
|
* @param {string} request.pageToken - The token to retrieve the next page of Domains
|
|
119
119
|
* @return {Promise<ListDomainsResponse>} - The response object that contains the list of Domains
|
|
120
120
|
* @example
|
|
121
|
+
* const domains = new SDK.Domains(client); // Existing client object
|
|
121
122
|
*
|
|
122
123
|
* const request = {
|
|
123
|
-
*
|
|
124
|
-
*
|
|
124
|
+
* pageSize: 10,
|
|
125
|
+
* pageToken: "00000000-0000-0000-0000-000000000000"
|
|
125
126
|
* };
|
|
126
127
|
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
* .catch(console.error); // an error occurred
|
|
128
|
+
* domains
|
|
129
|
+
* .listDomains(request)
|
|
130
|
+
* .then(console.log) // successful response
|
|
131
|
+
* .catch(console.error); // an error occurred
|
|
132
132
|
*/
|
|
133
133
|
listDomains(request: ListDomainsRequest): Promise<ListDomainsResponse>;
|
|
134
134
|
/**
|
|
@@ -138,14 +138,14 @@ declare class Domains {
|
|
|
138
138
|
* @param {string} ref - The reference of the Domain to delete
|
|
139
139
|
* @return {Promise<BaseApiObject>} - The response object that contains the reference to the deleted Domain
|
|
140
140
|
* @example
|
|
141
|
-
*
|
|
142
|
-
* const ref = "00000000-0000-0000-0000-000000000000"
|
|
143
|
-
*
|
|
144
141
|
* const domains = new SDK.Domains(client); // Existing client object
|
|
145
142
|
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
143
|
+
* const ref = "00000000-0000-0000-0000-000000000000";
|
|
144
|
+
*
|
|
145
|
+
* domains
|
|
146
|
+
* .deleteDomain(ref)
|
|
147
|
+
* .then(console.log) // successful response
|
|
148
|
+
* .catch(console.error); // an error occurred
|
|
149
149
|
*/
|
|
150
150
|
deleteDomain(ref: string): Promise<BaseApiObject>;
|
|
151
151
|
}
|
package/dist/node/Domains.js
CHANGED
|
@@ -13,11 +13,11 @@ const domains_pb_1 = require("./generated/node/domains_pb");
|
|
|
13
13
|
* const SDK = require("@fonoster/sdk");
|
|
14
14
|
*
|
|
15
15
|
* async function main(request) {
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* const API_KEY = "your-api-key";
|
|
17
|
+
* const ACCESS_KEY_ID = "00000000-0000-0000-0000-000000000000";
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
* const client = SDK.Client({ accessKeyId });
|
|
19
|
+
* try {
|
|
20
|
+
* const client = SDK.Client({ accessKeyId: ACCESS_KEY_ID });
|
|
21
21
|
* await client.loginWithApiKey(apiKey);
|
|
22
22
|
*
|
|
23
23
|
* const domains = new SDK.Domains(client);
|
|
@@ -60,17 +60,17 @@ class Domains {
|
|
|
60
60
|
* @param {string} request.egressPolicy[].numberRef - The Number that will be used to send the call to the PSTN
|
|
61
61
|
* @return {Promise<BaseApiObject>} - The response object that contains the reference to the created Domain
|
|
62
62
|
* @example
|
|
63
|
+
* const domains = new SDK.Domains(client); // Existing client object
|
|
63
64
|
*
|
|
64
65
|
* const request = {
|
|
65
|
-
*
|
|
66
|
-
*
|
|
66
|
+
* name: "My Domain",
|
|
67
|
+
* domainUri: "sip.project.fonoster.io"
|
|
67
68
|
* };
|
|
68
69
|
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* .catch(console.error); // an error occurred
|
|
70
|
+
* domains
|
|
71
|
+
* .createDomain(request)
|
|
72
|
+
* .then(console.log) // successful response
|
|
73
|
+
* .catch(console.error); // an error occurred
|
|
74
74
|
*/
|
|
75
75
|
async createDomain(request) {
|
|
76
76
|
const client = this.client.getDomainsClient();
|
|
@@ -87,14 +87,14 @@ class Domains {
|
|
|
87
87
|
* @param {string} ref - The reference of the Domain to retrieve
|
|
88
88
|
* @return {Promise<Acl>} - The response object that contains the Domain
|
|
89
89
|
* @example
|
|
90
|
-
*
|
|
91
|
-
* const ref = "00000000-0000-0000-0000-000000000000"
|
|
92
|
-
*
|
|
93
90
|
* const domains = new SDK.Domains(client); // Existing client object
|
|
94
91
|
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
92
|
+
* const ref = "00000000-0000-0000-0000-000000000000";
|
|
93
|
+
*
|
|
94
|
+
* domains
|
|
95
|
+
* .getDomain(ref)
|
|
96
|
+
* .then(console.log) // successful response
|
|
97
|
+
* .catch(console.error); // an error occurred
|
|
98
98
|
*/
|
|
99
99
|
async getDomain(ref) {
|
|
100
100
|
const client = this.client.getDomainsClient();
|
|
@@ -118,17 +118,17 @@ class Domains {
|
|
|
118
118
|
* @param {string} request.egressPolicy[].numberRef - The Number that will be used to send the call to the PSTN
|
|
119
119
|
* @return {Promise<BaseApiObject>} - The response object that contains the reference to the updated Domain
|
|
120
120
|
* @example
|
|
121
|
+
* const domains = new SDK.Domains(client); // Existing client object
|
|
121
122
|
*
|
|
122
123
|
* const request = {
|
|
123
|
-
*
|
|
124
|
-
*
|
|
124
|
+
* ref: "00000000-0000-0000-0000-000000000000",
|
|
125
|
+
* accessControlListRef: "00000000-0000-0000-0000-000000000001"
|
|
125
126
|
* };
|
|
126
127
|
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
* .catch(console.error); // an error occurred
|
|
128
|
+
* domains
|
|
129
|
+
* .updateDomain(request)
|
|
130
|
+
* .then(console.log) // successful response
|
|
131
|
+
* .catch(console.error); // an error occurred
|
|
132
132
|
*/
|
|
133
133
|
async updateDomain(request) {
|
|
134
134
|
const client = this.client.getDomainsClient();
|
|
@@ -147,17 +147,17 @@ class Domains {
|
|
|
147
147
|
* @param {string} request.pageToken - The token to retrieve the next page of Domains
|
|
148
148
|
* @return {Promise<ListDomainsResponse>} - The response object that contains the list of Domains
|
|
149
149
|
* @example
|
|
150
|
+
* const domains = new SDK.Domains(client); // Existing client object
|
|
150
151
|
*
|
|
151
152
|
* const request = {
|
|
152
|
-
*
|
|
153
|
-
*
|
|
153
|
+
* pageSize: 10,
|
|
154
|
+
* pageToken: "00000000-0000-0000-0000-000000000000"
|
|
154
155
|
* };
|
|
155
156
|
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
* .catch(console.error); // an error occurred
|
|
157
|
+
* domains
|
|
158
|
+
* .listDomains(request)
|
|
159
|
+
* .then(console.log) // successful response
|
|
160
|
+
* .catch(console.error); // an error occurred
|
|
161
161
|
*/
|
|
162
162
|
async listDomains(request) {
|
|
163
163
|
const client = this.client.getDomainsClient();
|
|
@@ -176,14 +176,14 @@ class Domains {
|
|
|
176
176
|
* @param {string} ref - The reference of the Domain to delete
|
|
177
177
|
* @return {Promise<BaseApiObject>} - The response object that contains the reference to the deleted Domain
|
|
178
178
|
* @example
|
|
179
|
-
*
|
|
180
|
-
* const ref = "00000000-0000-0000-0000-000000000000"
|
|
181
|
-
*
|
|
182
179
|
* const domains = new SDK.Domains(client); // Existing client object
|
|
183
180
|
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
181
|
+
* const ref = "00000000-0000-0000-0000-000000000000";
|
|
182
|
+
*
|
|
183
|
+
* domains
|
|
184
|
+
* .deleteDomain(ref)
|
|
185
|
+
* .then(console.log) // successful response
|
|
186
|
+
* .catch(console.error); // an error occurred
|
|
187
187
|
*/
|
|
188
188
|
async deleteDomain(ref) {
|
|
189
189
|
const applicationsClient = this.client.getDomainsClient();
|