@unboundcx/sdk 4.8.10 → 4.8.12

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 (56) hide show
  1. package/base.js +41 -1
  2. package/index.js +9 -6
  3. package/package.json +1 -4
  4. package/services/ai/playbooks.js +22 -21
  5. package/services/ai/settings.js +4 -2
  6. package/services/ai/translate.js +3 -1
  7. package/services/ai/vocabulary.js +4 -3
  8. package/services/ai.js +21 -20
  9. package/services/chat.js +267 -52
  10. package/services/developerApis.js +174 -0
  11. package/services/directory.js +40 -9
  12. package/services/documents.js +11 -10
  13. package/services/engagementMetrics.js +2 -1
  14. package/services/enroll.js +16 -15
  15. package/services/externalOAuth.js +12 -11
  16. package/services/fax.js +4 -3
  17. package/services/generateId.js +3 -2
  18. package/services/googleCalendar.js +7 -6
  19. package/services/knowledgeBase.js +9 -8
  20. package/services/layouts.js +15 -14
  21. package/services/login.js +8 -7
  22. package/services/lookup.js +4 -3
  23. package/services/messaging/EmailAddressesService.js +5 -4
  24. package/services/messaging/EmailAnalyticsService.js +5 -4
  25. package/services/messaging/EmailDomainsService.js +8 -7
  26. package/services/messaging/EmailMailboxesService.js +13 -12
  27. package/services/messaging/EmailQueueService.js +2 -1
  28. package/services/messaging/EmailService.js +12 -11
  29. package/services/messaging/EmailSuppressionService.js +5 -4
  30. package/services/messaging/EmailTemplatesService.js +6 -5
  31. package/services/messaging/SmsService.js +3 -2
  32. package/services/messaging/SmsTemplatesService.js +6 -5
  33. package/services/messaging/TenDlcBrandsService.js +11 -10
  34. package/services/messaging/TenDlcCampaignManagementService.js +14 -13
  35. package/services/messaging/TenDlcCampaignsService.js +2 -1
  36. package/services/messaging/TollFreeCampaignsService.js +13 -12
  37. package/services/notes.js +7 -6
  38. package/services/objects.js +97 -36
  39. package/services/permissions.js +34 -33
  40. package/services/phoneNumbers.js +28 -27
  41. package/services/portals.js +8 -7
  42. package/services/{inbox.js → recents.js} +9 -8
  43. package/services/recordTypes.js +12 -11
  44. package/services/search.js +2 -1
  45. package/services/sipEndpoints.js +8 -7
  46. package/services/storage.js +16 -15
  47. package/services/subscriptions.js +4 -3
  48. package/services/taskRouter/CCService.js +9 -8
  49. package/services/taskRouter/MetricsService.js +3 -2
  50. package/services/taskRouter/TaskService.js +13 -12
  51. package/services/taskRouter/WorkerService.js +9 -8
  52. package/services/triggers.js +9 -8
  53. package/services/verification.js +5 -4
  54. package/services/video.js +52 -51
  55. package/services/voice.js +13 -12
  56. package/services/workflows.js +22 -21
@@ -0,0 +1,174 @@
1
+ import { internalRequest } from '../base.js';
2
+
3
+ /**
4
+ * Developer portal My APIs — account-scoped folders, requests, vars, sharing.
5
+ * API prefix: /developerApis
6
+ */
7
+ export class DeveloperApisService {
8
+ constructor(sdk) {
9
+ this.sdk = sdk;
10
+ }
11
+
12
+ async getLibrary() {
13
+ return internalRequest(this.sdk, '/developerApis', 'GET');
14
+ }
15
+
16
+ async createFolder(params = {}) {
17
+ const { name, parentId, sort } = params;
18
+ this.sdk.validateParams(
19
+ { name, parentId, sort },
20
+ {
21
+ name: { type: 'string', required: false },
22
+ parentId: { type: 'string', required: false },
23
+ sort: { type: 'number', required: false },
24
+ },
25
+ );
26
+ return internalRequest(this.sdk, '/developerApis/folders', 'POST', {
27
+ body: { name, parentId, sort },
28
+ });
29
+ }
30
+
31
+ async updateFolder(id, updates = {}) {
32
+ this.sdk.validateParams(
33
+ { id, updates },
34
+ {
35
+ id: { type: 'string', required: true },
36
+ updates: { type: 'object', required: true },
37
+ },
38
+ );
39
+ return internalRequest(this.sdk, `/developerApis/folders/${id}`, 'PUT', {
40
+ body: updates,
41
+ });
42
+ }
43
+
44
+ async deleteFolder(id) {
45
+ this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
46
+ return internalRequest(this.sdk, `/developerApis/folders/${id}`, 'DELETE');
47
+ }
48
+
49
+ async listFolderShares(folderId) {
50
+ this.sdk.validateParams(
51
+ { folderId },
52
+ { folderId: { type: 'string', required: true } },
53
+ );
54
+ return internalRequest(
55
+ this.sdk,
56
+ `/developerApis/folders/${folderId}/shares`,
57
+ 'GET',
58
+ );
59
+ }
60
+
61
+ async shareFolder(folderId, params) {
62
+ const { userId, access } = params || {};
63
+ this.sdk.validateParams(
64
+ { folderId, userId, access },
65
+ {
66
+ folderId: { type: 'string', required: true },
67
+ userId: { type: 'string', required: true },
68
+ access: { type: 'string', required: false },
69
+ },
70
+ );
71
+ return internalRequest(
72
+ this.sdk,
73
+ `/developerApis/folders/${folderId}/shares`,
74
+ 'POST',
75
+ { body: { userId, access: access === 'full' ? 'full' : 'limited' } },
76
+ );
77
+ }
78
+
79
+ async unshareFolder(folderId, userId) {
80
+ this.sdk.validateParams(
81
+ { folderId, userId },
82
+ {
83
+ folderId: { type: 'string', required: true },
84
+ userId: { type: 'string', required: true },
85
+ },
86
+ );
87
+ return internalRequest(
88
+ this.sdk,
89
+ `/developerApis/folders/${folderId}/shares/${userId}`,
90
+ 'DELETE',
91
+ );
92
+ }
93
+
94
+ async createRequest(request = {}) {
95
+ this.sdk.validateParams(
96
+ { request },
97
+ { request: { type: 'object', required: false } },
98
+ );
99
+ return internalRequest(this.sdk, '/developerApis/requests', 'POST', {
100
+ body: request,
101
+ });
102
+ }
103
+
104
+ async getRequest(id) {
105
+ this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
106
+ return internalRequest(this.sdk, `/developerApis/requests/${id}`, 'GET');
107
+ }
108
+
109
+ async updateRequest(id, updates = {}) {
110
+ this.sdk.validateParams(
111
+ { id, updates },
112
+ {
113
+ id: { type: 'string', required: true },
114
+ updates: { type: 'object', required: true },
115
+ },
116
+ );
117
+ return internalRequest(this.sdk, `/developerApis/requests/${id}`, 'PUT', {
118
+ body: updates,
119
+ });
120
+ }
121
+
122
+ async deleteRequest(id) {
123
+ this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
124
+ return internalRequest(this.sdk, `/developerApis/requests/${id}`, 'DELETE');
125
+ }
126
+
127
+ async cloneRequest(id) {
128
+ this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
129
+ return internalRequest(
130
+ this.sdk,
131
+ `/developerApis/requests/${id}/clone`,
132
+ 'POST',
133
+ { body: {} },
134
+ );
135
+ }
136
+
137
+ async listVars() {
138
+ return internalRequest(this.sdk, '/developerApis/vars', 'GET');
139
+ }
140
+
141
+ async createVar(params = {}) {
142
+ const { key, type, value, enabled } = params;
143
+ this.sdk.validateParams(
144
+ { key, type, value, enabled },
145
+ {
146
+ key: { type: 'string', required: false },
147
+ type: { type: 'string', required: false },
148
+ value: { type: 'string', required: false },
149
+ enabled: { type: 'boolean', required: false },
150
+ },
151
+ );
152
+ return internalRequest(this.sdk, '/developerApis/vars', 'POST', {
153
+ body: { key, type, value, enabled },
154
+ });
155
+ }
156
+
157
+ async updateVar(id, updates = {}) {
158
+ this.sdk.validateParams(
159
+ { id, updates },
160
+ {
161
+ id: { type: 'string', required: true },
162
+ updates: { type: 'object', required: true },
163
+ },
164
+ );
165
+ return internalRequest(this.sdk, `/developerApis/vars/${id}`, 'PUT', {
166
+ body: updates,
167
+ });
168
+ }
169
+
170
+ async deleteVar(id) {
171
+ this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
172
+ return internalRequest(this.sdk, `/developerApis/vars/${id}`, 'DELETE');
173
+ }
174
+ }
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../base.js';
1
2
  export class DirectoryService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -10,7 +11,7 @@ export class DirectoryService {
10
11
  * @returns {Promise<{favorites: Object[]}>}
11
12
  */
12
13
  async listFavorites() {
13
- const result = await this.sdk._fetch('/directory/favorites', 'GET');
14
+ const result = await internalRequest(this.sdk, '/directory/favorites', 'GET');
14
15
  return result;
15
16
  }
16
17
 
@@ -45,7 +46,7 @@ export class DirectoryService {
45
46
 
46
47
  const params = { body };
47
48
 
48
- const result = await this.sdk._fetch('/directory/favorites', 'POST', params);
49
+ const result = await internalRequest(this.sdk, '/directory/favorites', 'POST', params);
49
50
  return result;
50
51
  }
51
52
 
@@ -80,7 +81,7 @@ export class DirectoryService {
80
81
 
81
82
  const params = { body };
82
83
 
83
- const result = await this.sdk._fetch(
84
+ const result = await internalRequest(this.sdk,
84
85
  `/directory/favorites/${favoriteId}`,
85
86
  'PUT',
86
87
  params,
@@ -102,7 +103,7 @@ export class DirectoryService {
102
103
  },
103
104
  );
104
105
 
105
- const result = await this.sdk._fetch(
106
+ const result = await internalRequest(this.sdk,
106
107
  `/directory/favorites/${favoriteId}`,
107
108
  'DELETE',
108
109
  );
@@ -126,7 +127,7 @@ export class DirectoryService {
126
127
 
127
128
  const params = { body: { order } };
128
129
 
129
- const result = await this.sdk._fetch(
130
+ const result = await internalRequest(this.sdk,
130
131
  '/directory/favorites/reorder',
131
132
  'PUT',
132
133
  params,
@@ -139,11 +140,41 @@ export class DirectoryService {
139
140
  *
140
141
  * @returns {Promise<{contacts: Object[]}>}
141
142
  */
142
- async listContacts() {
143
- const result = await this.sdk._fetch('/directory/contacts', 'GET');
143
+ async listContacts({ search } = {}) {
144
+ const query = {};
145
+ if (search) query.search = search;
146
+ const result = await internalRequest(this.sdk, '/directory/contacts', 'GET', {
147
+ query,
148
+ });
144
149
  return result;
145
150
  }
146
151
 
152
+ async favoriteStatus(objectType, objectId) {
153
+ this.sdk.validateParams(
154
+ { objectType, objectId },
155
+ {
156
+ objectType: { type: 'string', required: true },
157
+ objectId: { type: 'string', required: true },
158
+ },
159
+ );
160
+ return internalRequest(this.sdk, '/directory/favorites/status', 'GET', {
161
+ query: { objectType, objectId },
162
+ });
163
+ }
164
+
165
+ async contactStatus(objectType, objectId) {
166
+ this.sdk.validateParams(
167
+ { objectType, objectId },
168
+ {
169
+ objectType: { type: 'string', required: true },
170
+ objectId: { type: 'string', required: true },
171
+ },
172
+ );
173
+ return internalRequest(this.sdk, '/directory/contacts/status', 'GET', {
174
+ query: { objectType, objectId },
175
+ });
176
+ }
177
+
147
178
  /**
148
179
  * Add a person or company to directory contacts.
149
180
  *
@@ -163,7 +194,7 @@ export class DirectoryService {
163
194
 
164
195
  const params = { body: { objectType, objectId } };
165
196
 
166
- const result = await this.sdk._fetch('/directory/contacts', 'POST', params);
197
+ const result = await internalRequest(this.sdk, '/directory/contacts', 'POST', params);
167
198
  return result;
168
199
  }
169
200
 
@@ -181,7 +212,7 @@ export class DirectoryService {
181
212
  },
182
213
  );
183
214
 
184
- const result = await this.sdk._fetch(
215
+ const result = await internalRequest(this.sdk,
185
216
  `/directory/contacts/${contactId}`,
186
217
  'DELETE',
187
218
  );
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../base.js';
1
2
  export class DocumentTemplatesService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -59,7 +60,7 @@ export class DocumentTemplatesService {
59
60
  if (draftPageJson !== undefined) body.draftPageJson = draftPageJson;
60
61
  if (draftThemeJson !== undefined) body.draftThemeJson = draftThemeJson;
61
62
 
62
- return this.sdk._fetch('/documents/templates', 'POST', { body });
63
+ return internalRequest(this.sdk, '/documents/templates', 'POST', { body });
63
64
  }
64
65
 
65
66
  /**
@@ -77,7 +78,7 @@ export class DocumentTemplatesService {
77
78
  if (status) query.status = status;
78
79
  if (use) query.use = use;
79
80
  if (limit) query.limit = limit;
80
- return this.sdk._fetch('/documents/templates', 'GET', { query });
81
+ return internalRequest(this.sdk, '/documents/templates', 'GET', { query });
81
82
  }
82
83
 
83
84
  /**
@@ -87,7 +88,7 @@ export class DocumentTemplatesService {
87
88
  */
88
89
  async get(id) {
89
90
  this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
90
- return this.sdk._fetch(`/documents/templates/${id}`, 'GET');
91
+ return internalRequest(this.sdk, `/documents/templates/${id}`, 'GET');
91
92
  }
92
93
 
93
94
  /**
@@ -145,7 +146,7 @@ export class DocumentTemplatesService {
145
146
  if (draftPageJson !== undefined) body.draftPageJson = draftPageJson;
146
147
  if (draftThemeJson !== undefined) body.draftThemeJson = draftThemeJson;
147
148
 
148
- return this.sdk._fetch(`/documents/templates/${id}`, 'PATCH', { body });
149
+ return internalRequest(this.sdk, `/documents/templates/${id}`, 'PATCH', { body });
149
150
  }
150
151
 
151
152
  /**
@@ -155,7 +156,7 @@ export class DocumentTemplatesService {
155
156
  */
156
157
  async publish(id) {
157
158
  this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
158
- return this.sdk._fetch(`/documents/templates/${id}/publish`, 'POST', {
159
+ return internalRequest(this.sdk, `/documents/templates/${id}/publish`, 'POST', {
159
160
  body: {},
160
161
  });
161
162
  }
@@ -167,7 +168,7 @@ export class DocumentTemplatesService {
167
168
  */
168
169
  async delete(id) {
169
170
  this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
170
- return this.sdk._fetch(`/documents/templates/${id}`, 'DELETE');
171
+ return internalRequest(this.sdk, `/documents/templates/${id}`, 'DELETE');
171
172
  }
172
173
  }
173
174
 
@@ -207,7 +208,7 @@ export class DocumentsService {
207
208
  if (options !== undefined) body.options = options;
208
209
  if (source !== undefined) body.source = source;
209
210
 
210
- return this.sdk._fetch('/documents/generate', 'POST', { body });
211
+ return internalRequest(this.sdk, '/documents/generate', 'POST', { body });
211
212
  }
212
213
 
213
214
  /**
@@ -232,7 +233,7 @@ export class DocumentsService {
232
233
  if (data !== undefined) body.data = data;
233
234
  if (versionId !== undefined) body.versionId = versionId;
234
235
 
235
- return this.sdk._fetch('/documents/preview', 'POST', { body });
236
+ return internalRequest(this.sdk, '/documents/preview', 'POST', { body });
236
237
  }
237
238
 
238
239
  /**
@@ -257,7 +258,7 @@ export class DocumentsService {
257
258
  if (sourceId !== undefined) body.sourceId = sourceId;
258
259
  if (sourceType !== undefined) body.sourceType = sourceType;
259
260
 
260
- return this.sdk._fetch(`/documents/generated/${id}`, 'PATCH', { body });
261
+ return internalRequest(this.sdk, `/documents/generated/${id}`, 'PATCH', { body });
261
262
  }
262
263
 
263
264
  /**
@@ -271,6 +272,6 @@ export class DocumentsService {
271
272
  { storageId },
272
273
  { storageId: { type: 'string', required: true } },
273
274
  );
274
- return this.sdk._fetch('/documents/inspect', 'POST', { body: { storageId } });
275
+ return internalRequest(this.sdk, '/documents/inspect', 'POST', { body: { storageId } });
275
276
  }
276
277
  }
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../base.js';
1
2
  export class EngagementMetricsService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -57,7 +58,7 @@ export class EngagementMetricsService {
57
58
  },
58
59
  };
59
60
 
60
- const result = await this.sdk._fetch('/engagementMetrics/', 'GET', params);
61
+ const result = await internalRequest(this.sdk, '/engagementMetrics/', 'GET', params);
61
62
  return result;
62
63
  }
63
64
 
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../base.js';
1
2
  export class EnrollService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -15,7 +16,7 @@ export class EnrollService {
15
16
  query: { namespace },
16
17
  };
17
18
 
18
- const result = await this.sdk._fetch(
19
+ const result = await internalRequest(this.sdk,
19
20
  '/enroll/checkNamespace',
20
21
  'GET',
21
22
  params,
@@ -35,7 +36,7 @@ export class EnrollService {
35
36
  body: companyInfo,
36
37
  };
37
38
 
38
- const result = await this.sdk._fetch('/enroll/companyInfo', 'POST', params);
39
+ const result = await internalRequest(this.sdk, '/enroll/companyInfo', 'POST', params);
39
40
  return result;
40
41
  }
41
42
 
@@ -52,7 +53,7 @@ export class EnrollService {
52
53
  body: updateData,
53
54
  };
54
55
 
55
- const result = await this.sdk._fetch(
56
+ const result = await internalRequest(this.sdk,
56
57
  `/enroll/enrollment/${enrollmentId}`,
57
58
  'PUT',
58
59
  params,
@@ -72,7 +73,7 @@ export class EnrollService {
72
73
  body: enrollmentData,
73
74
  };
74
75
 
75
- const result = await this.sdk._fetch('/enroll/validate', 'POST', params);
76
+ const result = await internalRequest(this.sdk, '/enroll/validate', 'POST', params);
76
77
  return result;
77
78
  }
78
79
 
@@ -89,7 +90,7 @@ export class EnrollService {
89
90
  body: { email, code },
90
91
  };
91
92
 
92
- const result = await this.sdk._fetch('/enroll/verifyEmail', 'POST', params);
93
+ const result = await internalRequest(this.sdk, '/enroll/verifyEmail', 'POST', params);
93
94
  return result;
94
95
  }
95
96
 
@@ -106,7 +107,7 @@ export class EnrollService {
106
107
  body: { phoneNumber, code },
107
108
  };
108
109
 
109
- const result = await this.sdk._fetch('/enroll/verifySms', 'POST', params);
110
+ const result = await internalRequest(this.sdk, '/enroll/verifySms', 'POST', params);
110
111
  return result;
111
112
  }
112
113
 
@@ -122,7 +123,7 @@ export class EnrollService {
122
123
  body: paymentData,
123
124
  };
124
125
 
125
- const result = await this.sdk._fetch(
126
+ const result = await internalRequest(this.sdk,
126
127
  '/enroll/verifyPayment',
127
128
  'POST',
128
129
  params,
@@ -142,7 +143,7 @@ export class EnrollService {
142
143
  body: sessionData,
143
144
  };
144
145
 
145
- const result = await this.sdk._fetch(
146
+ const result = await internalRequest(this.sdk,
146
147
  '/enroll/stripeVerification',
147
148
  'POST',
148
149
  params,
@@ -162,7 +163,7 @@ export class EnrollService {
162
163
  query: { sessionId },
163
164
  };
164
165
 
165
- const result = await this.sdk._fetch(
166
+ const result = await internalRequest(this.sdk,
166
167
  '/enroll/stripeVerification/status',
167
168
  'GET',
168
169
  params,
@@ -182,7 +183,7 @@ export class EnrollService {
182
183
  body: agreementData,
183
184
  };
184
185
 
185
- const result = await this.sdk._fetch(
186
+ const result = await internalRequest(this.sdk,
186
187
  '/enroll/signAgreement',
187
188
  'POST',
188
189
  params,
@@ -203,7 +204,7 @@ export class EnrollService {
203
204
  query: { type: agreementType, version },
204
205
  };
205
206
 
206
- const result = await this.sdk._fetch('/enroll/agreement', 'GET', params);
207
+ const result = await internalRequest(this.sdk, '/enroll/agreement', 'GET', params);
207
208
  return result;
208
209
  }
209
210
 
@@ -215,7 +216,7 @@ export class EnrollService {
215
216
  },
216
217
  );
217
218
 
218
- const result = await this.sdk._fetch(
219
+ const result = await internalRequest(this.sdk,
219
220
  `/enroll/brand/${enrollmentId}`,
220
221
  'GET',
221
222
  );
@@ -230,7 +231,7 @@ export class EnrollService {
230
231
  },
231
232
  );
232
233
 
233
- const result = await this.sdk._fetch(
234
+ const result = await internalRequest(this.sdk,
234
235
  `/enroll/buildStatus/${enrollmentId}`,
235
236
  'GET',
236
237
  );
@@ -250,7 +251,7 @@ export class EnrollService {
250
251
  body: completionData,
251
252
  };
252
253
 
253
- const result = await this.sdk._fetch(
254
+ const result = await internalRequest(this.sdk,
254
255
  `/enroll/complete/${enrollmentId}`,
255
256
  'POST',
256
257
  params,
@@ -266,7 +267,7 @@ export class EnrollService {
266
267
  },
267
268
  );
268
269
 
269
- const result = await this.sdk._fetch(
270
+ const result = await internalRequest(this.sdk,
270
271
  `/enroll/createDatabase/${enrollmentId}`,
271
272
  'POST',
272
273
  );
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../base.js';
1
2
  export class ExternalOAuthService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -23,7 +24,7 @@ export class ExternalOAuthService {
23
24
  body: oauthData,
24
25
  };
25
26
 
26
- const result = await this.sdk._fetch('/externalOAuth', 'POST', params);
27
+ const result = await internalRequest(this.sdk, '/externalOAuth', 'POST', params);
27
28
  return result;
28
29
  }
29
30
 
@@ -49,7 +50,7 @@ export class ExternalOAuthService {
49
50
  body: updateData,
50
51
  };
51
52
 
52
- const result = await this.sdk._fetch(`/externalOAuth/${id}`, 'PUT', params);
53
+ const result = await internalRequest(this.sdk, `/externalOAuth/${id}`, 'PUT', params);
53
54
  return result;
54
55
  }
55
56
 
@@ -61,7 +62,7 @@ export class ExternalOAuthService {
61
62
  },
62
63
  );
63
64
 
64
- const result = await this.sdk._fetch(`/externalOAuth/${id}`, 'DELETE');
65
+ const result = await internalRequest(this.sdk, `/externalOAuth/${id}`, 'DELETE');
65
66
  return result;
66
67
  }
67
68
 
@@ -73,7 +74,7 @@ export class ExternalOAuthService {
73
74
  },
74
75
  );
75
76
 
76
- const result = await this.sdk._fetch(`/externalOAuth/${id}`, 'GET');
77
+ const result = await internalRequest(this.sdk, `/externalOAuth/${id}`, 'GET');
77
78
  return result;
78
79
  }
79
80
 
@@ -89,7 +90,7 @@ export class ExternalOAuthService {
89
90
  query: { name },
90
91
  };
91
92
 
92
- const result = await this.sdk._fetch(
93
+ const result = await internalRequest(this.sdk,
93
94
  '/externalOAuth/byName',
94
95
  'GET',
95
96
  params,
@@ -110,7 +111,7 @@ export class ExternalOAuthService {
110
111
  query: { scope, provider },
111
112
  };
112
113
 
113
- const result = await this.sdk._fetch(
114
+ const result = await internalRequest(this.sdk,
114
115
  '/externalOAuth/byScopeAndProvider',
115
116
  'GET',
116
117
  params,
@@ -119,17 +120,17 @@ export class ExternalOAuthService {
119
120
  }
120
121
 
121
122
  async list() {
122
- const result = await this.sdk._fetch('/externalOAuth', 'GET');
123
+ const result = await internalRequest(this.sdk, '/externalOAuth', 'GET');
123
124
  return result;
124
125
  }
125
126
 
126
127
  async listUnified() {
127
- const result = await this.sdk._fetch('/externalOAuth/unified', 'GET');
128
+ const result = await internalRequest(this.sdk, '/externalOAuth/unified', 'GET');
128
129
  return result;
129
130
  }
130
131
 
131
132
  async providers() {
132
- const result = await this.sdk._fetch('/externalOAuth/providers', 'GET');
133
+ const result = await internalRequest(this.sdk, '/externalOAuth/providers', 'GET');
133
134
  return result;
134
135
  }
135
136
 
@@ -165,7 +166,7 @@ export class ExternalOAuthService {
165
166
  if (tokenUrl) body.tokenUrl = tokenUrl;
166
167
  if (fromConnectionId) body.fromConnectionId = fromConnectionId;
167
168
 
168
- const result = await this.sdk._fetch('/externalOAuth/authorize', 'POST', {
169
+ const result = await internalRequest(this.sdk, '/externalOAuth/authorize', 'POST', {
169
170
  body,
170
171
  });
171
172
  return result;
@@ -185,7 +186,7 @@ export class ExternalOAuthService {
185
186
  { id: { type: 'string', required: true } },
186
187
  );
187
188
 
188
- return this.sdk._fetch(`/externalOAuth/${id}/verify`, 'POST', {
189
+ return internalRequest(this.sdk, `/externalOAuth/${id}/verify`, 'POST', {
189
190
  body: { purpose },
190
191
  });
191
192
  }
package/services/fax.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../base.js';
1
2
  export class FaxService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -61,7 +62,7 @@ export class FaxService {
61
62
  },
62
63
  };
63
64
 
64
- return await this.sdk._fetch('/fax/receive', 'POST', params);
65
+ return await internalRequest(this.sdk, '/fax/receive', 'POST', params);
65
66
  }
66
67
 
67
68
  /**
@@ -168,7 +169,7 @@ export class FaxService {
168
169
  },
169
170
  };
170
171
 
171
- return await this.sdk._fetch('/fax/send', 'POST', params);
172
+ return await internalRequest(this.sdk, '/fax/send', 'POST', params);
172
173
  }
173
174
 
174
175
  /**
@@ -254,6 +255,6 @@ export class FaxService {
254
255
  },
255
256
  };
256
257
 
257
- return await this.sdk._fetch('/fax/status', 'POST', params);
258
+ return await internalRequest(this.sdk, '/fax/status', 'POST', params);
258
259
  }
259
260
  }
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../base.js';
1
2
  export class GenerateIdService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -21,7 +22,7 @@ export class GenerateIdService {
21
22
  query: { service, serviceCode },
22
23
  };
23
24
 
24
- const result = await this.sdk._fetch('/generateId/', 'POST', params);
25
+ const result = await internalRequest(this.sdk, '/generateId/', 'POST', params);
25
26
  return result;
26
27
  }
27
28
 
@@ -33,7 +34,7 @@ export class GenerateIdService {
33
34
  },
34
35
  );
35
36
 
36
- const result = await this.sdk._fetch(`/generateId/${input}`, 'GET');
37
+ const result = await internalRequest(this.sdk, `/generateId/${input}`, 'GET');
37
38
  return result;
38
39
  }
39
40
  }