@fonoster/sdk 0.6.4 → 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.
Files changed (61) hide show
  1. package/README.md +519 -454
  2. package/dist/node/Acls.d.ts +43 -44
  3. package/dist/node/Acls.js +62 -49
  4. package/dist/node/Agents.d.ts +44 -45
  5. package/dist/node/Agents.js +47 -46
  6. package/dist/node/ApiKeys.d.ts +29 -29
  7. package/dist/node/ApiKeys.js +29 -29
  8. package/dist/node/Applications.d.ts +39 -39
  9. package/dist/node/Applications.js +52 -40
  10. package/dist/node/Calls.d.ts +28 -29
  11. package/dist/node/Calls.js +32 -27
  12. package/dist/node/Credentials.d.ts +39 -39
  13. package/dist/node/Credentials.js +39 -39
  14. package/dist/node/Domains.d.ts +37 -37
  15. package/dist/node/Domains.js +37 -37
  16. package/dist/node/Numbers.d.ts +40 -40
  17. package/dist/node/Numbers.js +40 -40
  18. package/dist/node/Secrets.d.ts +37 -37
  19. package/dist/node/Secrets.js +37 -37
  20. package/dist/node/Trunks.d.ts +58 -52
  21. package/dist/node/Trunks.js +104 -70
  22. package/dist/node/Users.d.ts +34 -34
  23. package/dist/node/Users.js +34 -34
  24. package/dist/node/Workspaces.d.ts +55 -54
  25. package/dist/node/Workspaces.js +61 -54
  26. package/dist/node/client/jsonToObject.js +1 -1
  27. package/dist/node/client/makeRpcRequest.js +1 -1
  28. package/dist/node/client/objectToJson.d.ts +1 -1
  29. package/dist/node/client/objectToJson.js +12 -2
  30. package/dist/node/client/types/IdentityClient.d.ts +2 -2
  31. package/dist/node/client/utils.js +6 -3
  32. package/dist/node/generated/node/agents_grpc_pb.js +0 -2
  33. package/dist/node/generated/node/agents_pb.js +444 -24
  34. package/dist/node/generated/node/applications_pb.js +6 -6
  35. package/dist/node/generated/node/credentials_pb.js +11 -41
  36. package/dist/node/generated/node/domains_pb.js +30 -30
  37. package/dist/node/generated/node/identity_grpc_pb.js +14 -14
  38. package/dist/node/generated/node/identity_pb.js +37 -37
  39. package/dist/node/generated/node/numbers_grpc_pb.js +0 -1
  40. package/dist/node/generated/node/numbers_pb.js +191 -11
  41. package/dist/node/generated/node/trunks_grpc_pb.js +0 -2
  42. package/dist/node/generated/node/trunks_pb.js +526 -31
  43. package/dist/node/generated/web/IdentityServiceClientPb.ts +5 -5
  44. package/dist/node/generated/web/agents_pb.d.ts +62 -10
  45. package/dist/node/generated/web/agents_pb.js +444 -24
  46. package/dist/node/generated/web/applications_pb.js +6 -6
  47. package/dist/node/generated/web/credentials_pb.d.ts +0 -4
  48. package/dist/node/generated/web/credentials_pb.js +11 -41
  49. package/dist/node/generated/web/domains_pb.js +30 -30
  50. package/dist/node/generated/web/identity_pb.d.ts +13 -13
  51. package/dist/node/generated/web/identity_pb.js +37 -37
  52. package/dist/node/generated/web/numbers_pb.d.ts +26 -4
  53. package/dist/node/generated/web/numbers_pb.js +191 -11
  54. package/dist/node/generated/web/trunks_pb.d.ts +71 -11
  55. package/dist/node/generated/web/trunks_pb.js +526 -31
  56. package/dist/node/tsconfig.node.tsbuildinfo +1 -1
  57. package/dist/node/utils.d.ts +4 -3
  58. package/dist/node/utils.js +36 -0
  59. package/dist/web/fonoster.min.js +1 -1
  60. package/dist/web/index.esm.js +1 -1
  61. package/package.json +5 -4
@@ -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
- * const username = "admin";
36
- * const password = "yourpassword";
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
- * try {
40
- * const client = SDK.Client({ accessKeyId });
41
- * await client.login({ username, password });
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
- * from: "8287854037",
84
- * to: "+17853178070",
85
- * appRef: "00000000-0000-0000-0000-000000000000"
83
+ * from: "8287854037",
84
+ * to: "+17853178070",
85
+ * appRef: "00000000-0000-0000-0000-000000000000"
86
86
  * };
87
87
  *
88
- * const calls = new SDK.Calls(client); // Existing client object
89
- *
90
- * calls.createCall(request)
91
- * .then(console.log) // successful response
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
- * calls.getCall(ref)
116
- * .then(console.log) // successful response
117
- * .catch(console.error); // an error occurred
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
- * pageSize: 10,
145
- * pageToken: "00000000-0000-0000-0000-000000000000"
144
+ * pageSize: 10,
145
+ * pageToken: "00000000-0000-0000-0000-000000000000"
146
146
  * };
147
147
  *
148
- * const calls = new SDK.Calls(client); // Existing client object
149
- *
150
- * calls.listCalls(request)
151
- * .then(console.log) // successful response
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
- * const apiKey = "your-api-key";
14
- * const accessKeyId = "00000000-0000-0000-0000-000000000000";
13
+ * const API_KEY = "your-api-key";
14
+ * const ACCESS_KEY_ID = "00000000-0000-0000-0000-000000000000";
15
15
  *
16
- * try {
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
- * name: "My Credentials",
59
- * username: "myusername",
60
- * password: "mysecret"
59
+ * name: "My Credentials",
60
+ * username: "myusername",
61
+ * password: "mysecret"
61
62
  * };
62
63
  *
63
- * const credentials = new SDK.Credentials(client); // Existing client object
64
- *
65
- * credentials.createCredentials(request)
66
- * .then(console.log) // successful response
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
- * credentials.getCredentials(ref)
82
- * .then(console.log) // successful response
83
- * .catch(console.error); // an error occurred
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
- * ref: "00000000-0000-0000-0000-000000000000",
98
- * name: "My Credentials",
99
- * password: "mysecret"
98
+ * ref: "00000000-0000-0000-0000-000000000000",
99
+ * name: "My Credentials",
100
+ * password: "mysecret"
100
101
  * };
101
102
  *
102
- * const credentials = new SDK.Credentials(client); // Existing client object
103
- *
104
- * credentials.updateCredentials(request)
105
- * .then(console.log) // successful response
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
- * pageSize: 10,
120
- * pageToken: "00000000-0000-0000-0000-000000000000"
120
+ * pageSize: 10,
121
+ * pageToken: "00000000-0000-0000-0000-000000000000"
121
122
  * };
122
123
  *
123
- * const credentials = new SDK.Credentials(client); // Existing client object
124
- *
125
- * credentials.listCredentials(request)
126
- * .then(console.log) // successful response
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
- * credentials.deleteCredentials(ref)
143
- * .then(console.log) // successful response
144
- * .catch(console.error); // an error occurred
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
  }
@@ -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
- * const apiKey = "your-api-key";
17
- * const accessKeyId = "00000000-0000-0000-0000-000000000000";
16
+ * const API_KEY = "your-api-key";
17
+ * const ACCESS_KEY_ID = "00000000-0000-0000-0000-000000000000";
18
18
  *
19
- * try {
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
- * name: "My Credentials",
64
- * username: "myusername",
65
- * password: "mysecret"
64
+ * name: "My Credentials",
65
+ * username: "myusername",
66
+ * password: "mysecret"
66
67
  * };
67
68
  *
68
- * const credentials = new SDK.Credentials(client); // Existing client object
69
- *
70
- * credentials.createCredentials(request)
71
- * .then(console.log) // successful response
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
- * credentials.getCredentials(ref)
95
- * .then(console.log) // successful response
96
- * .catch(console.error); // an error occurred
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
- * ref: "00000000-0000-0000-0000-000000000000",
119
- * name: "My Credentials",
120
- * password: "mysecret"
119
+ * ref: "00000000-0000-0000-0000-000000000000",
120
+ * name: "My Credentials",
121
+ * password: "mysecret"
121
122
  * };
122
123
  *
123
- * const credentials = new SDK.Credentials(client); // Existing client object
124
- *
125
- * credentials.updateCredentials(request)
126
- * .then(console.log) // successful response
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
- * pageSize: 10,
149
- * pageToken: "00000000-0000-0000-0000-000000000000"
149
+ * pageSize: 10,
150
+ * pageToken: "00000000-0000-0000-0000-000000000000"
150
151
  * };
151
152
  *
152
- * const credentials = new SDK.Credentials(client); // Existing client object
153
- *
154
- * credentials.listCredentials(request)
155
- * .then(console.log) // successful response
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
- * credentials.deleteCredentials(ref)
181
- * .then(console.log) // successful response
182
- * .catch(console.error); // an error occurred
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();
@@ -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
- * const apiKey = "your-api-key";
14
- * const accessKeyId = "00000000-0000-0000-0000-000000000000";
13
+ * const API_KEY = "your-api-key";
14
+ * const ACCESS_KEY_ID = "00000000-0000-0000-0000-000000000000";
15
15
  *
16
- * try {
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
- * name: "My Domain",
61
- * domainUri: "sip.project.fonoster.io"
61
+ * name: "My Domain",
62
+ * domainUri: "sip.project.fonoster.io"
62
63
  * };
63
64
  *
64
- * const domains = new SDK.Domains(client); // Existing client object
65
- *
66
- * domains.createDomain(request)
67
- * .then(console.log) // successful response
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
- * domains.getDomain(ref)
83
- * .then(console.log) // successful response
84
- * .catch(console.error); // an error occurred
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
- * ref: "00000000-0000-0000-0000-000000000000",
103
- * accessControlListRef: "00000000-0000-0000-0000-000000000001"
103
+ * ref: "00000000-0000-0000-0000-000000000000",
104
+ * accessControlListRef: "00000000-0000-0000-0000-000000000001"
104
105
  * };
105
106
  *
106
- * const domains = new SDK.Domains(client); // Existing client object
107
- *
108
- * domains.updateDomain(request)
109
- * .then(console.log) // successful response
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
- * pageSize: 10,
124
- * pageToken: "00000000-0000-0000-0000-000000000000"
124
+ * pageSize: 10,
125
+ * pageToken: "00000000-0000-0000-0000-000000000000"
125
126
  * };
126
127
  *
127
- * const domains = new SDK.Domains(client); // Existing client object
128
- *
129
- * domains.listDomains(request)
130
- * .then(console.log) // successful response
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
- * domains.deleteDomain(ref)
147
- * .then(console.log) // successful response
148
- * .catch(console.error); // an error occurred
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
  }
@@ -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
- * const apiKey = "your-api-key";
17
- * const accessKeyId = "00000000-0000-0000-0000-000000000000";
16
+ * const API_KEY = "your-api-key";
17
+ * const ACCESS_KEY_ID = "00000000-0000-0000-0000-000000000000";
18
18
  *
19
- * try {
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
- * name: "My Domain",
66
- * domainUri: "sip.project.fonoster.io"
66
+ * name: "My Domain",
67
+ * domainUri: "sip.project.fonoster.io"
67
68
  * };
68
69
  *
69
- * const domains = new SDK.Domains(client); // Existing client object
70
- *
71
- * domains.createDomain(request)
72
- * .then(console.log) // successful response
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
- * domains.getDomain(ref)
96
- * .then(console.log) // successful response
97
- * .catch(console.error); // an error occurred
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
- * ref: "00000000-0000-0000-0000-000000000000",
124
- * accessControlListRef: "00000000-0000-0000-0000-000000000001"
124
+ * ref: "00000000-0000-0000-0000-000000000000",
125
+ * accessControlListRef: "00000000-0000-0000-0000-000000000001"
125
126
  * };
126
127
  *
127
- * const domains = new SDK.Domains(client); // Existing client object
128
- *
129
- * domains.updateDomain(request)
130
- * .then(console.log) // successful response
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
- * pageSize: 10,
153
- * pageToken: "00000000-0000-0000-0000-000000000000"
153
+ * pageSize: 10,
154
+ * pageToken: "00000000-0000-0000-0000-000000000000"
154
155
  * };
155
156
  *
156
- * const domains = new SDK.Domains(client); // Existing client object
157
- *
158
- * domains.listDomains(request)
159
- * .then(console.log) // successful response
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
- * domains.deleteDomain(ref)
185
- * .then(console.log) // successful response
186
- * .catch(console.error); // an error occurred
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();