@unboundcx/sdk 1.0.2 → 1.0.3

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.
@@ -13,14 +13,14 @@ export class SmsService {
13
13
  this.templates = new SmsTemplatesService(sdk);
14
14
  }
15
15
 
16
- async send({
17
- from,
18
- to,
19
- message,
20
- templateId,
21
- variables,
22
- mediaUrls,
23
- webhookUrl
16
+ async send({
17
+ from,
18
+ to,
19
+ message,
20
+ templateId,
21
+ variables,
22
+ mediaUrls,
23
+ webhookUrl,
24
24
  }) {
25
25
  const messageData = {};
26
26
  if (from) messageData.from = from;
@@ -86,7 +86,11 @@ export class SmsTemplatesService {
86
86
  body: templateData,
87
87
  };
88
88
 
89
- const result = await this.sdk._fetch('/messaging/sms/templates', 'POST', options);
89
+ const result = await this.sdk._fetch(
90
+ '/messaging/sms/templates',
91
+ 'POST',
92
+ options,
93
+ );
90
94
  return result;
91
95
  }
92
96
 
@@ -110,7 +114,11 @@ export class SmsTemplatesService {
110
114
  body: updateData,
111
115
  };
112
116
 
113
- const result = await this.sdk._fetch(`/messaging/sms/templates/${id}`, 'PUT', options);
117
+ const result = await this.sdk._fetch(
118
+ `/messaging/sms/templates/${id}`,
119
+ 'PUT',
120
+ options,
121
+ );
114
122
  return result;
115
123
  }
116
124
 
@@ -122,7 +130,10 @@ export class SmsTemplatesService {
122
130
  },
123
131
  );
124
132
 
125
- const result = await this.sdk._fetch(`/messaging/sms/templates/${id}`, 'DELETE');
133
+ const result = await this.sdk._fetch(
134
+ `/messaging/sms/templates/${id}`,
135
+ 'DELETE',
136
+ );
126
137
  return result;
127
138
  }
128
139
 
@@ -134,7 +145,10 @@ export class SmsTemplatesService {
134
145
  },
135
146
  );
136
147
 
137
- const result = await this.sdk._fetch(`/messaging/sms/templates/${id}`, 'GET');
148
+ const result = await this.sdk._fetch(
149
+ `/messaging/sms/templates/${id}`,
150
+ 'GET',
151
+ );
138
152
  return result;
139
153
  }
140
154
 
@@ -152,20 +166,20 @@ export class EmailService {
152
166
  this.addresses = new EmailAddressesService(sdk);
153
167
  }
154
168
 
155
- async send({
156
- from,
157
- to,
158
- cc,
159
- bcc,
160
- subject,
161
- htmlBody,
162
- textBody,
163
- templateId,
164
- variables,
169
+ async send({
170
+ from,
171
+ to,
172
+ cc,
173
+ bcc,
174
+ subject,
175
+ htmlBody,
176
+ textBody,
177
+ templateId,
178
+ variables,
165
179
  attachments,
166
180
  replyTo,
167
181
  priority,
168
- tags
182
+ tags,
169
183
  }) {
170
184
  this.sdk.validateParams(
171
185
  { from, to, subject },
@@ -241,7 +255,11 @@ export class EmailService {
241
255
  body: updateData,
242
256
  };
243
257
 
244
- const result = await this.sdk._fetch(`/messaging/email/domain/${domain}`, 'PUT', options);
258
+ const result = await this.sdk._fetch(
259
+ `/messaging/email/domain/${domain}`,
260
+ 'PUT',
261
+ options,
262
+ );
245
263
  return result;
246
264
  }
247
265
  }
@@ -272,7 +290,11 @@ export class EmailTemplatesService {
272
290
  body: templateData,
273
291
  };
274
292
 
275
- const result = await this.sdk._fetch('/messaging/email/templates', 'POST', options);
293
+ const result = await this.sdk._fetch(
294
+ '/messaging/email/templates',
295
+ 'POST',
296
+ options,
297
+ );
276
298
  return result;
277
299
  }
278
300
 
@@ -300,7 +322,11 @@ export class EmailTemplatesService {
300
322
  body: updateData,
301
323
  };
302
324
 
303
- const result = await this.sdk._fetch(`/messaging/email/templates/${id}`, 'PUT', options);
325
+ const result = await this.sdk._fetch(
326
+ `/messaging/email/templates/${id}`,
327
+ 'PUT',
328
+ options,
329
+ );
304
330
  return result;
305
331
  }
306
332
 
@@ -312,7 +338,10 @@ export class EmailTemplatesService {
312
338
  },
313
339
  );
314
340
 
315
- const result = await this.sdk._fetch(`/messaging/email/templates/${id}`, 'DELETE');
341
+ const result = await this.sdk._fetch(
342
+ `/messaging/email/templates/${id}`,
343
+ 'DELETE',
344
+ );
316
345
  return result;
317
346
  }
318
347
 
@@ -324,7 +353,10 @@ export class EmailTemplatesService {
324
353
  },
325
354
  );
326
355
 
327
- const result = await this.sdk._fetch(`/messaging/email/templates/${id}`, 'GET');
356
+ const result = await this.sdk._fetch(
357
+ `/messaging/email/templates/${id}`,
358
+ 'GET',
359
+ );
328
360
  return result;
329
361
  }
330
362
 
@@ -351,7 +383,11 @@ export class EmailDomainsService {
351
383
  body: { domain },
352
384
  };
353
385
 
354
- const result = await this.sdk._fetch('/messaging/email/domains', 'POST', options);
386
+ const result = await this.sdk._fetch(
387
+ '/messaging/email/domains',
388
+ 'POST',
389
+ options,
390
+ );
355
391
  return result;
356
392
  }
357
393
 
@@ -363,7 +399,10 @@ export class EmailDomainsService {
363
399
  },
364
400
  );
365
401
 
366
- const result = await this.sdk._fetch(`/messaging/email/domains/${domain}`, 'DELETE');
402
+ const result = await this.sdk._fetch(
403
+ `/messaging/email/domains/${domain}`,
404
+ 'DELETE',
405
+ );
367
406
  return result;
368
407
  }
369
408
 
@@ -380,7 +419,10 @@ export class EmailDomainsService {
380
419
  },
381
420
  );
382
421
 
383
- const result = await this.sdk._fetch(`/messaging/email/domains/${domain}/validate`, 'POST');
422
+ const result = await this.sdk._fetch(
423
+ `/messaging/email/domains/${domain}/validate`,
424
+ 'POST',
425
+ );
384
426
  return result;
385
427
  }
386
428
 
@@ -392,7 +434,10 @@ export class EmailDomainsService {
392
434
  },
393
435
  );
394
436
 
395
- const result = await this.sdk._fetch(`/messaging/email/domains/${domain}/status`, 'GET');
437
+ const result = await this.sdk._fetch(
438
+ `/messaging/email/domains/${domain}/status`,
439
+ 'GET',
440
+ );
396
441
  return result;
397
442
  }
398
443
 
@@ -414,7 +459,11 @@ export class EmailDomainsService {
414
459
  body: updateData,
415
460
  };
416
461
 
417
- const result = await this.sdk._fetch(`/messaging/email/domains/${domain}`, 'PUT', options);
462
+ const result = await this.sdk._fetch(
463
+ `/messaging/email/domains/${domain}`,
464
+ 'PUT',
465
+ options,
466
+ );
418
467
  return result;
419
468
  }
420
469
  }
@@ -436,7 +485,11 @@ export class EmailAddressesService {
436
485
  body: { email },
437
486
  };
438
487
 
439
- const result = await this.sdk._fetch('/messaging/email/addresses', 'POST', options);
488
+ const result = await this.sdk._fetch(
489
+ '/messaging/email/addresses',
490
+ 'POST',
491
+ options,
492
+ );
440
493
  return result;
441
494
  }
442
495
 
@@ -448,7 +501,10 @@ export class EmailAddressesService {
448
501
  },
449
502
  );
450
503
 
451
- const result = await this.sdk._fetch(`/messaging/email/addresses/${encodeURIComponent(email)}`, 'DELETE');
504
+ const result = await this.sdk._fetch(
505
+ `/messaging/email/addresses/${encodeURIComponent(email)}`,
506
+ 'DELETE',
507
+ );
452
508
  return result;
453
509
  }
454
510
 
@@ -465,7 +521,10 @@ export class EmailAddressesService {
465
521
  },
466
522
  );
467
523
 
468
- const result = await this.sdk._fetch(`/messaging/email/addresses/${encodeURIComponent(email)}/status`, 'GET');
524
+ const result = await this.sdk._fetch(
525
+ `/messaging/email/addresses/${encodeURIComponent(email)}/status`,
526
+ 'GET',
527
+ );
469
528
  return result;
470
529
  }
471
530
  }
@@ -491,7 +550,7 @@ export class TollFreeCampaignsService {
491
550
  helpMessage,
492
551
  optInKeywords,
493
552
  optOutKeywords,
494
- website
553
+ website,
495
554
  }) {
496
555
  this.sdk.validateParams(
497
556
  { companyName, phoneNumber, description, messageFlow },
@@ -523,7 +582,11 @@ export class TollFreeCampaignsService {
523
582
  body: campaignData,
524
583
  };
525
584
 
526
- const result = await this.sdk._fetch('/messaging/campaigns/tollfree', 'POST', options);
585
+ const result = await this.sdk._fetch(
586
+ '/messaging/campaigns/tollfree',
587
+ 'POST',
588
+ options,
589
+ );
527
590
  return result;
528
591
  }
529
592
 
@@ -540,7 +603,11 @@ export class TollFreeCampaignsService {
540
603
  body: updateData,
541
604
  };
542
605
 
543
- const result = await this.sdk._fetch(`/messaging/campaigns/tollfree/${campaignId}`, 'PUT', options);
606
+ const result = await this.sdk._fetch(
607
+ `/messaging/campaigns/tollfree/${campaignId}`,
608
+ 'PUT',
609
+ options,
610
+ );
544
611
  return result;
545
612
  }
546
613
 
@@ -552,7 +619,10 @@ export class TollFreeCampaignsService {
552
619
  },
553
620
  );
554
621
 
555
- const result = await this.sdk._fetch(`/messaging/campaigns/tollfree/${campaignId}`, 'DELETE');
622
+ const result = await this.sdk._fetch(
623
+ `/messaging/campaigns/tollfree/${campaignId}`,
624
+ 'DELETE',
625
+ );
556
626
  return result;
557
627
  }
558
628
 
@@ -564,12 +634,18 @@ export class TollFreeCampaignsService {
564
634
  },
565
635
  );
566
636
 
567
- const result = await this.sdk._fetch(`/messaging/campaigns/tollfree/${campaignId}`, 'GET');
637
+ const result = await this.sdk._fetch(
638
+ `/messaging/campaigns/tollfree/${campaignId}`,
639
+ 'GET',
640
+ );
568
641
  return result;
569
642
  }
570
643
 
571
644
  async list() {
572
- const result = await this.sdk._fetch('/messaging/campaigns/tollfree', 'GET');
645
+ const result = await this.sdk._fetch(
646
+ '/messaging/campaigns/tollfree',
647
+ 'GET',
648
+ );
573
649
  return result;
574
650
  }
575
651
 
@@ -581,7 +657,10 @@ export class TollFreeCampaignsService {
581
657
  },
582
658
  );
583
659
 
584
- const result = await this.sdk._fetch(`/messaging/campaigns/tollfree/${campaignId}/refresh`, 'POST');
660
+ const result = await this.sdk._fetch(
661
+ `/messaging/campaigns/tollfree/${campaignId}/refresh`,
662
+ 'POST',
663
+ );
585
664
  return result;
586
665
  }
587
666
 
@@ -597,7 +676,11 @@ export class TollFreeCampaignsService {
597
676
  query: { phoneNumber },
598
677
  };
599
678
 
600
- const result = await this.sdk._fetch('/messaging/campaigns/tollfree/phone-number-status', 'GET', options);
679
+ const result = await this.sdk._fetch(
680
+ '/messaging/campaigns/tollfree/phone-number-status',
681
+ 'GET',
682
+ options,
683
+ );
601
684
  return result;
602
685
  }
603
686
  }
@@ -619,7 +702,7 @@ export class TenDlcCampaignsService {
619
702
  optOutMessage,
620
703
  optOutKeywords,
621
704
  helpMessage,
622
- helpKeywords
705
+ helpKeywords,
623
706
  }) {
624
707
  this.sdk.validateParams(
625
708
  { companyName },
@@ -656,14 +739,15 @@ export class TenDlcCampaignsService {
656
739
  body: brandData,
657
740
  };
658
741
 
659
- const result = await this.sdk._fetch('/messaging/campaigns/10dlc/brand', 'POST', options);
742
+ const result = await this.sdk._fetch(
743
+ '/messaging/campaigns/10dlc/brand',
744
+ 'POST',
745
+ options,
746
+ );
660
747
  return result;
661
748
  }
662
749
 
663
- async updateBrand(brandId, {
664
- companyName,
665
- website
666
- }) {
750
+ async updateBrand(brandId, { companyName, website }) {
667
751
  this.sdk.validateParams(
668
752
  { brandId },
669
753
  {
@@ -681,7 +765,11 @@ export class TenDlcCampaignsService {
681
765
  body: updateData,
682
766
  };
683
767
 
684
- const result = await this.sdk._fetch(`/messaging/campaigns/10dlc/brand/${brandId}`, 'PUT', options);
768
+ const result = await this.sdk._fetch(
769
+ `/messaging/campaigns/10dlc/brand/${brandId}`,
770
+ 'PUT',
771
+ options,
772
+ );
685
773
  return result;
686
774
  }
687
- }
775
+ }
package/services/notes.js CHANGED
@@ -3,13 +3,7 @@ export class NotesService {
3
3
  this.sdk = sdk;
4
4
  }
5
5
 
6
- async list({
7
- relatedId,
8
- recordTypeId,
9
- limit,
10
- orderBy,
11
- orderDirection,
12
- }) {
6
+ async list({ relatedId, recordTypeId, limit, orderBy, orderDirection }) {
13
7
  this.sdk.validateParams(
14
8
  { relatedId, limit, orderBy, orderDirection },
15
9
  {
@@ -134,4 +128,4 @@ export class NotesService {
134
128
  const result = await this.sdk._fetch(`/notes/${noteId}`, 'GET');
135
129
  return result;
136
130
  }
137
- }
131
+ }
@@ -8,13 +8,13 @@ export class ObjectsService {
8
8
  { id, query },
9
9
  {
10
10
  id: { type: 'string', required: true },
11
- query: { type: 'object', required: false }
11
+ query: { type: 'object', required: false },
12
12
  },
13
13
  );
14
14
 
15
15
  const params = {
16
- query
17
- }
16
+ query,
17
+ };
18
18
 
19
19
  const result = await this.sdk._fetch(`/object/${id}`, 'GET', params);
20
20
  return result;
@@ -25,15 +25,19 @@ export class ObjectsService {
25
25
  { object, query },
26
26
  {
27
27
  object: { type: 'string', required: true },
28
- query: { type: 'object', required: false }
28
+ query: { type: 'object', required: false },
29
29
  },
30
30
  );
31
31
 
32
32
  const params = {
33
33
  query,
34
- }
34
+ };
35
35
 
36
- const result = await this.sdk._fetch(`/object/query/${object}`, 'GET', params);
36
+ const result = await this.sdk._fetch(
37
+ `/object/query/${object}`,
38
+ 'GET',
39
+ params,
40
+ );
37
41
  return result;
38
42
  }
39
43
 
@@ -43,7 +47,7 @@ export class ObjectsService {
43
47
  {
44
48
  object: { type: 'string', required: true },
45
49
  id: { type: 'string', required: true },
46
- update: { type: 'object', required: true }
50
+ update: { type: 'object', required: true },
47
51
  },
48
52
  );
49
53
 
@@ -54,7 +58,7 @@ export class ObjectsService {
54
58
  },
55
59
  update,
56
60
  },
57
- }
61
+ };
58
62
 
59
63
  const result = await this.sdk._fetch(`/object/${object}`, 'PUT', params);
60
64
  return result;
@@ -66,7 +70,7 @@ export class ObjectsService {
66
70
  {
67
71
  object: { type: 'string', required: true },
68
72
  where: { type: 'object', required: true },
69
- update: { type: 'object', required: true }
73
+ update: { type: 'object', required: true },
70
74
  },
71
75
  );
72
76
 
@@ -75,7 +79,7 @@ export class ObjectsService {
75
79
  where,
76
80
  update,
77
81
  },
78
- }
82
+ };
79
83
 
80
84
  const result = await this.sdk._fetch(`/object/${object}`, 'PUT', params);
81
85
  return result;
@@ -86,13 +90,13 @@ export class ObjectsService {
86
90
  { object, body },
87
91
  {
88
92
  object: { type: 'string', required: true },
89
- body: { type: 'object', required: true }
93
+ body: { type: 'object', required: true },
90
94
  },
91
95
  );
92
96
 
93
97
  const params = {
94
- body
95
- }
98
+ body,
99
+ };
96
100
 
97
101
  const result = await this.sdk._fetch(`/object/${object}`, 'POST', params);
98
102
  return result;
@@ -103,15 +107,15 @@ export class ObjectsService {
103
107
  { object, where },
104
108
  {
105
109
  object: { type: 'string', required: true },
106
- where: { type: 'object', required: true }
110
+ where: { type: 'object', required: true },
107
111
  },
108
112
  );
109
113
 
110
114
  const params = {
111
115
  body: {
112
- where
113
- }
114
- }
116
+ where,
117
+ },
118
+ };
115
119
 
116
120
  const result = await this.sdk._fetch(`/object/${object}`, 'DELETE', params);
117
121
  return result;
@@ -122,17 +126,17 @@ export class ObjectsService {
122
126
  { object, id },
123
127
  {
124
128
  object: { type: 'string', required: true },
125
- id: { type: 'string', required: true }
129
+ id: { type: 'string', required: true },
126
130
  },
127
131
  );
128
132
 
129
133
  const params = {
130
134
  body: {
131
135
  where: {
132
- id
133
- }
134
- }
135
- }
136
+ id,
137
+ },
138
+ },
139
+ };
136
140
 
137
141
  const result = await this.sdk._fetch(`/object/${object}`, 'DELETE', params);
138
142
  return result;
@@ -146,18 +150,20 @@ export class ObjectsService {
146
150
  },
147
151
  );
148
152
 
149
- const params = {
150
- }
153
+ const params = {};
151
154
 
152
- const result = await this.sdk._fetch(`/object/describe/${object}`, 'GET', params);
155
+ const result = await this.sdk._fetch(
156
+ `/object/describe/${object}`,
157
+ 'GET',
158
+ params,
159
+ );
153
160
  return result;
154
161
  }
155
162
 
156
163
  async list() {
157
- const params = {
158
- }
164
+ const params = {};
159
165
 
160
166
  const result = await this.sdk._fetch(`/object/`, 'GET', params);
161
167
  return result;
162
168
  }
163
- }
169
+ }