@unboundcx/sdk 4.8.10 → 4.8.11

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 +6 -3
  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 +124 -48
  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/inbox.js +5 -4
  20. package/services/knowledgeBase.js +9 -8
  21. package/services/layouts.js +15 -14
  22. package/services/login.js +8 -7
  23. package/services/lookup.js +4 -3
  24. package/services/messaging/EmailAddressesService.js +5 -4
  25. package/services/messaging/EmailAnalyticsService.js +5 -4
  26. package/services/messaging/EmailDomainsService.js +8 -7
  27. package/services/messaging/EmailMailboxesService.js +13 -12
  28. package/services/messaging/EmailQueueService.js +2 -1
  29. package/services/messaging/EmailService.js +12 -11
  30. package/services/messaging/EmailSuppressionService.js +5 -4
  31. package/services/messaging/EmailTemplatesService.js +6 -5
  32. package/services/messaging/SmsService.js +3 -2
  33. package/services/messaging/SmsTemplatesService.js +6 -5
  34. package/services/messaging/TenDlcBrandsService.js +11 -10
  35. package/services/messaging/TenDlcCampaignManagementService.js +14 -13
  36. package/services/messaging/TenDlcCampaignsService.js +2 -1
  37. package/services/messaging/TollFreeCampaignsService.js +13 -12
  38. package/services/notes.js +7 -6
  39. package/services/objects.js +97 -36
  40. package/services/permissions.js +34 -33
  41. package/services/phoneNumbers.js +28 -27
  42. package/services/portals.js +8 -7
  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
@@ -1,5 +1,6 @@
1
1
  import * as layoutSchemas from '../schemas/layouts/index.js';
2
2
 
3
+ import { internalRequest } from '../base.js';
3
4
  export class LayoutsService {
4
5
  constructor(sdk) {
5
6
  this.sdk = sdk;
@@ -26,7 +27,7 @@ export class LayoutsService {
26
27
  uri = `${uri}/${id}`;
27
28
  }
28
29
 
29
- const result = await this.sdk._fetch(uri, 'GET', params);
30
+ const result = await internalRequest(this.sdk, uri, 'GET', params);
30
31
  return result;
31
32
  }
32
33
 
@@ -42,7 +43,7 @@ export class LayoutsService {
42
43
  body: layout,
43
44
  };
44
45
 
45
- const result = await this.sdk._fetch('/layouts/', 'POST', params);
46
+ const result = await internalRequest(this.sdk, '/layouts/', 'POST', params);
46
47
  return result;
47
48
  }
48
49
 
@@ -59,7 +60,7 @@ export class LayoutsService {
59
60
  body: layout,
60
61
  };
61
62
 
62
- const result = await this.sdk._fetch(`/layouts/${id}`, 'PUT', params);
63
+ const result = await internalRequest(this.sdk, `/layouts/${id}`, 'PUT', params);
63
64
  return result;
64
65
  }
65
66
 
@@ -73,7 +74,7 @@ export class LayoutsService {
73
74
 
74
75
  const params = {};
75
76
 
76
- const result = await this.sdk._fetch(`/layouts/${id}`, 'DELETE', params);
77
+ const result = await internalRequest(this.sdk, `/layouts/${id}`, 'DELETE', params);
77
78
  return result;
78
79
  }
79
80
 
@@ -89,7 +90,7 @@ export class LayoutsService {
89
90
  query,
90
91
  };
91
92
 
92
- const result = await this.sdk._fetch(
93
+ const result = await internalRequest(this.sdk,
93
94
  '/layouts/selectDynamic/search',
94
95
  'GET',
95
96
  params,
@@ -121,7 +122,7 @@ export class LayoutsService {
121
122
 
122
123
  const params = { query };
123
124
 
124
- const result = await this.sdk._fetch('/layouts/resolve', 'GET', params);
125
+ const result = await internalRequest(this.sdk, '/layouts/resolve', 'GET', params);
125
126
  return result;
126
127
  }
127
128
 
@@ -131,7 +132,7 @@ export class LayoutsService {
131
132
  { layoutId: { type: 'string', required: true } },
132
133
  );
133
134
 
134
- const result = await this.sdk._fetch(`/layouts/${layoutId}/versions`, 'GET', {});
135
+ const result = await internalRequest(this.sdk, `/layouts/${layoutId}/versions`, 'GET', {});
135
136
  return result;
136
137
  }
137
138
 
@@ -141,7 +142,7 @@ export class LayoutsService {
141
142
  { layoutId: { type: 'string', required: true } },
142
143
  );
143
144
 
144
- const result = await this.sdk._fetch(`/layouts/${layoutId}/edit`, 'GET', {});
145
+ const result = await internalRequest(this.sdk, `/layouts/${layoutId}/edit`, 'GET', {});
145
146
  return result;
146
147
  }
147
148
 
@@ -155,7 +156,7 @@ export class LayoutsService {
155
156
  body: { changeNote },
156
157
  };
157
158
 
158
- const result = await this.sdk._fetch(`/layouts/${layoutId}/publish`, 'POST', params);
159
+ const result = await internalRequest(this.sdk, `/layouts/${layoutId}/publish`, 'POST', params);
159
160
  return result;
160
161
  }
161
162
 
@@ -168,7 +169,7 @@ export class LayoutsService {
168
169
  },
169
170
  );
170
171
 
171
- const result = await this.sdk._fetch(
172
+ const result = await internalRequest(this.sdk,
172
173
  `/layouts/${layoutId}/versions/${version}/rollback`,
173
174
  'POST',
174
175
  {},
@@ -199,7 +200,7 @@ export class LayoutAssignmentsService {
199
200
  query: { objectName: resolvedObjectName, kind },
200
201
  };
201
202
 
202
- const result = await this.sdk._fetch('/layouts/assignments', 'GET', params);
203
+ const result = await internalRequest(this.sdk, '/layouts/assignments', 'GET', params);
203
204
  return result;
204
205
  }
205
206
 
@@ -221,7 +222,7 @@ export class LayoutAssignmentsService {
221
222
  },
222
223
  };
223
224
 
224
- const result = await this.sdk._fetch('/layouts/assignments', 'POST', params);
225
+ const result = await internalRequest(this.sdk, '/layouts/assignments', 'POST', params);
225
226
  return result;
226
227
  }
227
228
 
@@ -235,7 +236,7 @@ export class LayoutAssignmentsService {
235
236
  body: updates,
236
237
  };
237
238
 
238
- const result = await this.sdk._fetch(`/layouts/assignments/${id}`, 'PUT', params);
239
+ const result = await internalRequest(this.sdk, `/layouts/assignments/${id}`, 'PUT', params);
239
240
  return result;
240
241
  }
241
242
 
@@ -245,7 +246,7 @@ export class LayoutAssignmentsService {
245
246
  { id: { type: 'string', required: true } },
246
247
  );
247
248
 
248
- const result = await this.sdk._fetch(`/layouts/assignments/${id}`, 'DELETE', {});
249
+ const result = await internalRequest(this.sdk, `/layouts/assignments/${id}`, 'DELETE', {});
249
250
  return result;
250
251
  }
251
252
  }
package/services/login.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../base.js';
1
2
  export class LoginService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -17,7 +18,7 @@ export class LoginService {
17
18
  body: { username, password, tokenType: 'cookie', namespace },
18
19
  };
19
20
 
20
- const login = await this.sdk._fetch('/login', 'POST', options, true);
21
+ const login = await internalRequest(this.sdk, '/login', 'POST', options, true);
21
22
 
22
23
  if (typeof window !== 'undefined') {
23
24
  const canUseLocalStorage = typeof localStorage !== 'undefined';
@@ -37,7 +38,7 @@ export class LoginService {
37
38
  }
38
39
 
39
40
  async logout() {
40
- const logout = await this.sdk._fetch('/login', 'DELETE', {}, true);
41
+ const logout = await internalRequest(this.sdk, '/login', 'DELETE', {}, true);
41
42
 
42
43
  if (typeof window !== 'undefined') {
43
44
  const canUseLocalStorage = typeof localStorage !== 'undefined';
@@ -54,7 +55,7 @@ export class LoginService {
54
55
  async validate(forceFetch = true) {
55
56
  console.log('login :: validate :: forceFetch', forceFetch);
56
57
  const options = {};
57
- const validation = await this.sdk._fetch(
58
+ const validation = await internalRequest(this.sdk,
58
59
  '/login/validate',
59
60
  'POST',
60
61
  options,
@@ -75,7 +76,7 @@ export class LoginService {
75
76
  body: { password: newPassword },
76
77
  };
77
78
 
78
- const result = await this.sdk._fetch(
79
+ const result = await internalRequest(this.sdk,
79
80
  '/login/changePassword',
80
81
  'PUT',
81
82
  options,
@@ -84,7 +85,7 @@ export class LoginService {
84
85
  }
85
86
 
86
87
  async getPasswordRequirements() {
87
- const result = await this.sdk._fetch(
88
+ const result = await internalRequest(this.sdk,
88
89
  '/login/passwordRequirements',
89
90
  'GET',
90
91
  {},
@@ -104,7 +105,7 @@ export class LoginService {
104
105
  body: { password },
105
106
  };
106
107
 
107
- const result = await this.sdk._fetch(
108
+ const result = await internalRequest(this.sdk,
108
109
  '/login/validatePasswordStrength',
109
110
  'POST',
110
111
  options,
@@ -124,7 +125,7 @@ export class LoginService {
124
125
  body: { email },
125
126
  };
126
127
 
127
- const result = await this.sdk._fetch(
128
+ const result = await internalRequest(this.sdk,
128
129
  '/login/forgotPassword',
129
130
  'POST',
130
131
  options,
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../base.js';
1
2
  export class LookupService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -15,7 +16,7 @@ export class LookupService {
15
16
  query: { phoneNumber },
16
17
  };
17
18
 
18
- const result = await this.sdk._fetch('/lookup/cnam', 'GET', params);
19
+ const result = await internalRequest(this.sdk, '/lookup/cnam', 'GET', params);
19
20
  return result;
20
21
  }
21
22
 
@@ -32,7 +33,7 @@ export class LookupService {
32
33
  query: { phoneNumber, cnam },
33
34
  };
34
35
 
35
- const result = await this.sdk._fetch('/lookup/lrn', 'GET', params);
36
+ const result = await internalRequest(this.sdk, '/lookup/lrn', 'GET', params);
36
37
  return result;
37
38
  }
38
39
 
@@ -48,7 +49,7 @@ export class LookupService {
48
49
  query: { phoneNumber },
49
50
  };
50
51
 
51
- const result = await this.sdk._fetch('/lookup/number', 'GET', params);
52
+ const result = await internalRequest(this.sdk, '/lookup/number', 'GET', params);
52
53
  return result;
53
54
  }
54
55
  }
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../../base.js';
1
2
  export class EmailAddressesService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -20,7 +21,7 @@ export class EmailAddressesService {
20
21
  body: { emailAddress },
21
22
  };
22
23
 
23
- const result = await this.sdk._fetch(
24
+ const result = await internalRequest(this.sdk,
24
25
  '/messaging/email/validate/emailAddress',
25
26
  'POST',
26
27
  options,
@@ -41,7 +42,7 @@ export class EmailAddressesService {
41
42
  },
42
43
  );
43
44
 
44
- const result = await this.sdk._fetch(
45
+ const result = await internalRequest(this.sdk,
45
46
  `/messaging/email/validate/emailAddress/${encodeURIComponent(
46
47
  emailAddress,
47
48
  )}`,
@@ -55,7 +56,7 @@ export class EmailAddressesService {
55
56
  * @returns {Promise<Array>} List of verified email addresses
56
57
  */
57
58
  async list() {
58
- const result = await this.sdk._fetch(
59
+ const result = await internalRequest(this.sdk,
59
60
  '/messaging/email/validate/emailAddress',
60
61
  'GET',
61
62
  );
@@ -79,7 +80,7 @@ export class EmailAddressesService {
79
80
  query: { emailAddress },
80
81
  };
81
82
 
82
- const result = await this.sdk._fetch(
83
+ const result = await internalRequest(this.sdk,
83
84
  '/messaging/email/validate/emailAddress/status',
84
85
  'GET',
85
86
  options,
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../../base.js';
1
2
  export class EmailAnalyticsService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -25,7 +26,7 @@ export class EmailAnalyticsService {
25
26
  if (granularity) options.query.granularity = granularity;
26
27
  if (timezone) options.query.timezone = timezone;
27
28
 
28
- const result = await this.sdk._fetch(
29
+ const result = await internalRequest(this.sdk,
29
30
  '/messaging/email/analytics/timeseries',
30
31
  'GET',
31
32
  options,
@@ -61,7 +62,7 @@ export class EmailAnalyticsService {
61
62
  if (period) options.query.period = period;
62
63
  if (timezone) options.query.timezone = timezone;
63
64
 
64
- const result = await this.sdk._fetch(
65
+ const result = await internalRequest(this.sdk,
65
66
  '/messaging/email/analytics/summary',
66
67
  'GET',
67
68
  options,
@@ -78,7 +79,7 @@ export class EmailAnalyticsService {
78
79
  * // Returns: { queueDepth, currentSendRatePerMinute, last5Minutes: { sent, delivered, failed } }
79
80
  */
80
81
  async realtime() {
81
- const result = await this.sdk._fetch(
82
+ const result = await internalRequest(this.sdk,
82
83
  '/messaging/email/analytics/realtime',
83
84
  'GET',
84
85
  );
@@ -99,7 +100,7 @@ export class EmailAnalyticsService {
99
100
  const options = { query: {} };
100
101
  if (period) options.query.period = period;
101
102
 
102
- const result = await this.sdk._fetch(
103
+ const result = await internalRequest(this.sdk,
103
104
  '/messaging/email/analytics/errors',
104
105
  'GET',
105
106
  options,
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../../base.js';
1
2
  export class EmailDomainsService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -32,7 +33,7 @@ export class EmailDomainsService {
32
33
  body: domainData,
33
34
  };
34
35
 
35
- const result = await this.sdk._fetch(
36
+ const result = await internalRequest(this.sdk,
36
37
  '/messaging/email/validate/domain',
37
38
  'POST',
38
39
  options,
@@ -57,7 +58,7 @@ export class EmailDomainsService {
57
58
  body: { domainId },
58
59
  };
59
60
 
60
- const result = await this.sdk._fetch(
61
+ const result = await internalRequest(this.sdk,
61
62
  '/messaging/email/validate/domain',
62
63
  'DELETE',
63
64
  options,
@@ -85,7 +86,7 @@ export class EmailDomainsService {
85
86
  * // }
86
87
  */
87
88
  async list() {
88
- const result = await this.sdk._fetch(
89
+ const result = await internalRequest(this.sdk,
89
90
  '/messaging/email/validate/domain',
90
91
  'GET',
91
92
  );
@@ -147,7 +148,7 @@ export class EmailDomainsService {
147
148
  },
148
149
  );
149
150
 
150
- const result = await this.sdk._fetch(
151
+ const result = await internalRequest(this.sdk,
151
152
  `/messaging/email/validate/domain/${domainId}`,
152
153
  'GET',
153
154
  );
@@ -171,7 +172,7 @@ export class EmailDomainsService {
171
172
  query: { domain },
172
173
  };
173
174
 
174
- const result = await this.sdk._fetch(
175
+ const result = await internalRequest(this.sdk,
175
176
  '/messaging/email/validate/domain/dns',
176
177
  'GET',
177
178
  options,
@@ -196,7 +197,7 @@ export class EmailDomainsService {
196
197
  query: { domain },
197
198
  };
198
199
 
199
- const result = await this.sdk._fetch(
200
+ const result = await internalRequest(this.sdk,
200
201
  '/messaging/email/validate/domain/status',
201
202
  'GET',
202
203
  options,
@@ -242,7 +243,7 @@ export class EmailDomainsService {
242
243
  body: updateData,
243
244
  };
244
245
 
245
- const result = await this.sdk._fetch(
246
+ const result = await internalRequest(this.sdk,
246
247
  '/messaging/email/validate/domain',
247
248
  'PUT',
248
249
  options,
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../../base.js';
1
2
  export class EmailMailboxesService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -76,7 +77,7 @@ export class EmailMailboxesService {
76
77
  ticketCreateEmailFrom: { type: 'string', required: false },
77
78
  });
78
79
 
79
- const result = await this.sdk._fetch('/messaging/email/mailbox', 'POST', {
80
+ const result = await internalRequest(this.sdk, '/messaging/email/mailbox', 'POST', {
80
81
  body: mailboxData,
81
82
  });
82
83
  return result;
@@ -154,7 +155,7 @@ export class EmailMailboxesService {
154
155
  },
155
156
  };
156
157
 
157
- const result = await this.sdk._fetch(
158
+ const result = await internalRequest(this.sdk,
158
159
  '/messaging/email/mailbox',
159
160
  'GET',
160
161
  params,
@@ -189,7 +190,7 @@ export class EmailMailboxesService {
189
190
  },
190
191
  };
191
192
 
192
- const result = await this.sdk._fetch(
193
+ const result = await internalRequest(this.sdk,
193
194
  `/messaging/email/mailbox/${id}`,
194
195
  'GET',
195
196
  params,
@@ -278,7 +279,7 @@ export class EmailMailboxesService {
278
279
  },
279
280
  );
280
281
 
281
- const result = await this.sdk._fetch(
282
+ const result = await internalRequest(this.sdk,
282
283
  `/messaging/email/mailbox/${id}`,
283
284
  'PUT',
284
285
  {
@@ -303,7 +304,7 @@ export class EmailMailboxesService {
303
304
  },
304
305
  );
305
306
 
306
- const result = await this.sdk._fetch(
307
+ const result = await internalRequest(this.sdk,
307
308
  `/messaging/email/mailbox/${id}`,
308
309
  'DELETE',
309
310
  );
@@ -361,7 +362,7 @@ export class EmailMailboxesService {
361
362
  },
362
363
  );
363
364
 
364
- const result = await this.sdk._fetch(
365
+ const result = await internalRequest(this.sdk,
365
366
  `/messaging/email/mailbox/${mailboxId}/alias`,
366
367
  'POST',
367
368
  {
@@ -401,7 +402,7 @@ export class EmailMailboxesService {
401
402
  },
402
403
  );
403
404
 
404
- const result = await this.sdk._fetch(
405
+ const result = await internalRequest(this.sdk,
405
406
  `/messaging/email/mailbox/alias/${aliasId}`,
406
407
  'PUT',
407
408
  {
@@ -426,7 +427,7 @@ export class EmailMailboxesService {
426
427
  },
427
428
  );
428
429
 
429
- const result = await this.sdk._fetch(
430
+ const result = await internalRequest(this.sdk,
430
431
  `/messaging/email/mailbox/alias/${aliasId}`,
431
432
  'DELETE',
432
433
  );
@@ -449,7 +450,7 @@ export class EmailMailboxesService {
449
450
  },
450
451
  );
451
452
 
452
- const result = await this.sdk._fetch(
453
+ const result = await internalRequest(this.sdk,
453
454
  `/messaging/email/mailbox/${mailboxId}/folders`,
454
455
  'GET',
455
456
  );
@@ -467,7 +468,7 @@ export class EmailMailboxesService {
467
468
  );
468
469
  const body = { name };
469
470
  if (parent) body.parent = parent;
470
- return this.sdk._fetch(
471
+ return internalRequest(this.sdk,
471
472
  `/messaging/email/mailbox/${mailboxId}/folders`,
472
473
  'POST',
473
474
  { body },
@@ -483,7 +484,7 @@ export class EmailMailboxesService {
483
484
  to: { type: 'string', required: true },
484
485
  },
485
486
  );
486
- return this.sdk._fetch(
487
+ return internalRequest(this.sdk,
487
488
  `/messaging/email/mailbox/${mailboxId}/folders`,
488
489
  'PUT',
489
490
  { body: { from, to } },
@@ -498,7 +499,7 @@ export class EmailMailboxesService {
498
499
  name: { type: 'string', required: true },
499
500
  },
500
501
  );
501
- return this.sdk._fetch(
502
+ return internalRequest(this.sdk,
502
503
  `/messaging/email/mailbox/${mailboxId}/folders`,
503
504
  'DELETE',
504
505
  { query: { name }, body: { name } },
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../../base.js';
1
2
  export class EmailQueueService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -30,7 +31,7 @@ export class EmailQueueService {
30
31
  if (limit !== undefined) options.query.limit = limit;
31
32
  if (status) options.query.status = status;
32
33
 
33
- const result = await this.sdk._fetch(
34
+ const result = await internalRequest(this.sdk,
34
35
  '/messaging/email/queue',
35
36
  'GET',
36
37
  options,
@@ -6,6 +6,7 @@ import { EmailAnalyticsService } from './EmailAnalyticsService.js';
6
6
  import { EmailQueueService } from './EmailQueueService.js';
7
7
  import { EmailSuppressionService } from './EmailSuppressionService.js';
8
8
 
9
+ import { internalRequest } from '../../base.js';
9
10
  export class EmailService {
10
11
  constructor(sdk) {
11
12
  this.sdk = sdk;
@@ -133,7 +134,7 @@ export class EmailService {
133
134
  body: emailData,
134
135
  };
135
136
 
136
- const result = await this.sdk._fetch('/messaging/email', 'POST', options);
137
+ const result = await internalRequest(this.sdk, '/messaging/email', 'POST', options);
137
138
  return result;
138
139
  }
139
140
 
@@ -167,7 +168,7 @@ export class EmailService {
167
168
  },
168
169
  );
169
170
 
170
- const result = await this.sdk._fetch(
171
+ const result = await internalRequest(this.sdk,
171
172
  `/messaging/email/message/${id}`,
172
173
  'GET',
173
174
  );
@@ -200,7 +201,7 @@ export class EmailService {
200
201
  body: updateData,
201
202
  };
202
203
 
203
- const result = await this.sdk._fetch(
204
+ const result = await internalRequest(this.sdk,
204
205
  `/messaging/email/${id}`,
205
206
  'PUT',
206
207
  options,
@@ -321,7 +322,7 @@ export class EmailService {
321
322
  body: draftData,
322
323
  };
323
324
 
324
- const result = await this.sdk._fetch(
325
+ const result = await internalRequest(this.sdk,
325
326
  '/messaging/email/drafts',
326
327
  'POST',
327
328
  params,
@@ -429,7 +430,7 @@ export class EmailService {
429
430
  body: updateData,
430
431
  };
431
432
 
432
- const result = await this.sdk._fetch(
433
+ const result = await internalRequest(this.sdk,
433
434
  `/messaging/email/drafts/${id}`,
434
435
  'PUT',
435
436
  params,
@@ -450,7 +451,7 @@ export class EmailService {
450
451
  },
451
452
  );
452
453
 
453
- const result = await this.sdk._fetch(
454
+ const result = await internalRequest(this.sdk,
454
455
  `/messaging/email/drafts/${id}`,
455
456
  'GET',
456
457
  );
@@ -470,7 +471,7 @@ export class EmailService {
470
471
  },
471
472
  );
472
473
 
473
- const result = await this.sdk._fetch(
474
+ const result = await internalRequest(this.sdk,
474
475
  `/messaging/email/drafts/${id}`,
475
476
  'DELETE',
476
477
  );
@@ -514,7 +515,7 @@ export class EmailService {
514
515
  },
515
516
  };
516
517
 
517
- const result = await this.sdk._fetch(
518
+ const result = await internalRequest(this.sdk,
518
519
  '/messaging/email/drafts',
519
520
  'GET',
520
521
  params,
@@ -608,7 +609,7 @@ export class EmailService {
608
609
  query,
609
610
  };
610
611
 
611
- const result = await this.sdk._fetch(
612
+ const result = await internalRequest(this.sdk,
612
613
  `/messaging/email/mailbox/${mailboxId}/emails`,
613
614
  'GET',
614
615
  params,
@@ -648,7 +649,7 @@ export class EmailService {
648
649
  },
649
650
  );
650
651
 
651
- const result = await this.sdk._fetch(
652
+ const result = await internalRequest(this.sdk,
652
653
  `/messaging/email/message/${emailId}`,
653
654
  'PUT',
654
655
  {
@@ -681,7 +682,7 @@ export class EmailService {
681
682
  },
682
683
  );
683
684
 
684
- const result = await this.sdk._fetch(
685
+ const result = await internalRequest(this.sdk,
685
686
  `/messaging/email/message/${emailId}`,
686
687
  'DELETE',
687
688
  );
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../../base.js';
1
2
  export class EmailSuppressionService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -38,7 +39,7 @@ export class EmailSuppressionService {
38
39
  if (page !== undefined) options.query.page = page;
39
40
  if (limit !== undefined) options.query.limit = limit;
40
41
 
41
- const result = await this.sdk._fetch(
42
+ const result = await internalRequest(this.sdk,
42
43
  '/messaging/email/suppression',
43
44
  'GET',
44
45
  options,
@@ -77,7 +78,7 @@ export class EmailSuppressionService {
77
78
  body: { reason },
78
79
  };
79
80
 
80
- const result = await this.sdk._fetch(
81
+ const result = await internalRequest(this.sdk,
81
82
  `/messaging/email/suppression/${id}`,
82
83
  'DELETE',
83
84
  options,
@@ -106,7 +107,7 @@ export class EmailSuppressionService {
106
107
  },
107
108
  );
108
109
 
109
- const result = await this.sdk._fetch(
110
+ const result = await internalRequest(this.sdk,
110
111
  `/messaging/email/suppression/global/${encodeURIComponent(emailAddress)}`,
111
112
  'GET',
112
113
  );
@@ -149,7 +150,7 @@ export class EmailSuppressionService {
149
150
  body: { reason },
150
151
  };
151
152
 
152
- const result = await this.sdk._fetch(
153
+ const result = await internalRequest(this.sdk,
153
154
  `/messaging/email/suppression/global/${encodeURIComponent(
154
155
  emailAddress,
155
156
  )}/request-removal`,
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../../base.js';
1
2
  export class EmailTemplatesService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -50,7 +51,7 @@ export class EmailTemplatesService {
50
51
  body: templateData,
51
52
  };
52
53
 
53
- const result = await this.sdk._fetch(
54
+ const result = await internalRequest(this.sdk,
54
55
  '/messaging/email/template',
55
56
  'POST',
56
57
  options,
@@ -106,7 +107,7 @@ export class EmailTemplatesService {
106
107
  body: updateData,
107
108
  };
108
109
 
109
- const result = await this.sdk._fetch(
110
+ const result = await internalRequest(this.sdk,
110
111
  `/messaging/email/template/${id}`,
111
112
  'PUT',
112
113
  options,
@@ -127,7 +128,7 @@ export class EmailTemplatesService {
127
128
  },
128
129
  );
129
130
 
130
- const result = await this.sdk._fetch(
131
+ const result = await internalRequest(this.sdk,
131
132
  `/messaging/email/template/${id}`,
132
133
  'DELETE',
133
134
  );
@@ -147,7 +148,7 @@ export class EmailTemplatesService {
147
148
  },
148
149
  );
149
150
 
150
- const result = await this.sdk._fetch(
151
+ const result = await internalRequest(this.sdk,
151
152
  `/messaging/email/template/${id}`,
152
153
  'GET',
153
154
  );
@@ -159,7 +160,7 @@ export class EmailTemplatesService {
159
160
  * @returns {Promise<Array>} List of email templates
160
161
  */
161
162
  async list() {
162
- const result = await this.sdk._fetch('/messaging/email/template', 'GET');
163
+ const result = await internalRequest(this.sdk, '/messaging/email/template', 'GET');
163
164
  return result;
164
165
  }
165
166
  }