@sentdm/sentdm 0.36.0 → 0.38.0

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 (137) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +31 -0
  3. package/client.d.mts +28 -14
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +28 -14
  6. package/client.d.ts.map +1 -1
  7. package/client.js +10 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +10 -0
  10. package/client.mjs.map +1 -1
  11. package/core/pagination.d.mts +164 -0
  12. package/core/pagination.d.mts.map +1 -0
  13. package/core/pagination.d.ts +164 -0
  14. package/core/pagination.d.ts.map +1 -0
  15. package/core/pagination.js +212 -0
  16. package/core/pagination.js.map +1 -0
  17. package/core/pagination.mjs +202 -0
  18. package/core/pagination.mjs.map +1 -0
  19. package/index.d.mts +1 -0
  20. package/index.d.mts.map +1 -1
  21. package/index.d.ts +1 -0
  22. package/index.d.ts.map +1 -1
  23. package/index.js +3 -1
  24. package/index.js.map +1 -1
  25. package/index.mjs +1 -0
  26. package/index.mjs.map +1 -1
  27. package/internal/tslib.js +17 -17
  28. package/package.json +11 -1
  29. package/pagination.d.mts +3 -0
  30. package/pagination.d.mts.map +1 -0
  31. package/pagination.d.ts +3 -0
  32. package/pagination.d.ts.map +1 -0
  33. package/pagination.js +6 -0
  34. package/pagination.js.map +1 -0
  35. package/pagination.mjs +3 -0
  36. package/pagination.mjs.map +1 -0
  37. package/resources/contacts.d.mts +79 -626
  38. package/resources/contacts.d.mts.map +1 -1
  39. package/resources/contacts.d.ts +79 -626
  40. package/resources/contacts.d.ts.map +1 -1
  41. package/resources/contacts.js +12 -11
  42. package/resources/contacts.js.map +1 -1
  43. package/resources/contacts.mjs +12 -11
  44. package/resources/contacts.mjs.map +1 -1
  45. package/resources/conversations.d.mts +72 -346
  46. package/resources/conversations.d.mts.map +1 -1
  47. package/resources/conversations.d.ts +72 -346
  48. package/resources/conversations.d.ts.map +1 -1
  49. package/resources/conversations.js +16 -13
  50. package/resources/conversations.js.map +1 -1
  51. package/resources/conversations.mjs +16 -13
  52. package/resources/conversations.mjs.map +1 -1
  53. package/resources/index.d.mts +7 -7
  54. package/resources/index.d.mts.map +1 -1
  55. package/resources/index.d.ts +7 -7
  56. package/resources/index.d.ts.map +1 -1
  57. package/resources/index.js.map +1 -1
  58. package/resources/index.mjs.map +1 -1
  59. package/resources/me.d.mts +48 -129
  60. package/resources/me.d.mts.map +1 -1
  61. package/resources/me.d.ts +48 -129
  62. package/resources/me.d.ts.map +1 -1
  63. package/resources/me.js.map +1 -1
  64. package/resources/me.mjs.map +1 -1
  65. package/resources/messages.d.mts +8 -171
  66. package/resources/messages.d.mts.map +1 -1
  67. package/resources/messages.d.ts +8 -171
  68. package/resources/messages.d.ts.map +1 -1
  69. package/resources/messages.js.map +1 -1
  70. package/resources/messages.mjs.map +1 -1
  71. package/resources/numbers.d.mts +3 -42
  72. package/resources/numbers.d.mts.map +1 -1
  73. package/resources/numbers.d.ts +3 -42
  74. package/resources/numbers.d.ts.map +1 -1
  75. package/resources/numbers.js.map +1 -1
  76. package/resources/numbers.mjs.map +1 -1
  77. package/resources/profiles/campaigns.d.mts +149 -544
  78. package/resources/profiles/campaigns.d.mts.map +1 -1
  79. package/resources/profiles/campaigns.d.ts +149 -544
  80. package/resources/profiles/campaigns.d.ts.map +1 -1
  81. package/resources/profiles/index.d.mts +2 -2
  82. package/resources/profiles/index.d.mts.map +1 -1
  83. package/resources/profiles/index.d.ts +2 -2
  84. package/resources/profiles/index.d.ts.map +1 -1
  85. package/resources/profiles/index.js.map +1 -1
  86. package/resources/profiles/index.mjs.map +1 -1
  87. package/resources/profiles/profiles.d.mts +411 -1821
  88. package/resources/profiles/profiles.d.mts.map +1 -1
  89. package/resources/profiles/profiles.d.ts +411 -1821
  90. package/resources/profiles/profiles.d.ts.map +1 -1
  91. package/resources/profiles/profiles.js.map +1 -1
  92. package/resources/profiles/profiles.mjs.map +1 -1
  93. package/resources/templates.d.mts +87 -532
  94. package/resources/templates.d.mts.map +1 -1
  95. package/resources/templates.d.ts +87 -532
  96. package/resources/templates.d.ts.map +1 -1
  97. package/resources/templates.js +11 -10
  98. package/resources/templates.js.map +1 -1
  99. package/resources/templates.mjs +11 -10
  100. package/resources/templates.mjs.map +1 -1
  101. package/resources/users.d.mts +47 -437
  102. package/resources/users.d.mts.map +1 -1
  103. package/resources/users.d.ts +47 -437
  104. package/resources/users.d.ts.map +1 -1
  105. package/resources/users.js +3 -3
  106. package/resources/users.js.map +1 -1
  107. package/resources/users.mjs +3 -3
  108. package/resources/users.mjs.map +1 -1
  109. package/resources/webhooks.d.mts +192 -856
  110. package/resources/webhooks.d.mts.map +1 -1
  111. package/resources/webhooks.d.ts +192 -856
  112. package/resources/webhooks.d.ts.map +1 -1
  113. package/resources/webhooks.js +23 -19
  114. package/resources/webhooks.js.map +1 -1
  115. package/resources/webhooks.mjs +23 -19
  116. package/resources/webhooks.mjs.map +1 -1
  117. package/src/client.ts +124 -45
  118. package/src/core/pagination.ts +428 -0
  119. package/src/index.ts +1 -0
  120. package/src/pagination.ts +2 -0
  121. package/src/resources/contacts.ts +89 -726
  122. package/src/resources/conversations.ts +99 -427
  123. package/src/resources/index.ts +31 -23
  124. package/src/resources/me.ts +59 -148
  125. package/src/resources/messages.ts +8 -194
  126. package/src/resources/numbers.ts +3 -47
  127. package/src/resources/profiles/campaigns.ts +174 -673
  128. package/src/resources/profiles/index.ts +14 -6
  129. package/src/resources/profiles/profiles.ts +529 -2216
  130. package/src/resources/templates.ts +110 -629
  131. package/src/resources/users.ts +48 -505
  132. package/src/resources/webhooks.ts +307 -1091
  133. package/src/version.ts +1 -1
  134. package/version.d.mts +1 -1
  135. package/version.d.ts +1 -1
  136. package/version.js +1 -1
  137. package/version.mjs +1 -1
@@ -1,7 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
+ import * as WebhooksAPI from './webhooks';
4
5
  import { APIPromise } from '../core/api-promise';
6
+ import { PagePromise, TemplatesPage, type TemplatesPageParams } from '../core/pagination';
5
7
  import { buildHeaders } from '../internal/headers';
6
8
  import { RequestOptions } from '../internal/request-options';
7
9
  import { path } from '../internal/utils/path';
@@ -19,10 +21,10 @@ export class Templates extends APIResource {
19
21
  *
20
22
  * @example
21
23
  * ```ts
22
- * const template = await client.templates.create();
24
+ * const apiResponseTemplate = await client.templates.create();
23
25
  * ```
24
26
  */
25
- create(params: TemplateCreateParams, options?: RequestOptions): APIPromise<TemplateCreateResponse> {
27
+ create(params: TemplateCreateParams, options?: RequestOptions): APIPromise<APIResponseTemplate> {
26
28
  const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
27
29
  return this._client.post('/v3/templates', {
28
30
  body,
@@ -43,7 +45,7 @@ export class Templates extends APIResource {
43
45
  *
44
46
  * @example
45
47
  * ```ts
46
- * const template = await client.templates.retrieve(
48
+ * const apiResponseTemplate = await client.templates.retrieve(
47
49
  * '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
48
50
  * );
49
51
  * ```
@@ -52,7 +54,7 @@ export class Templates extends APIResource {
52
54
  id: string,
53
55
  params: TemplateRetrieveParams | null | undefined = {},
54
56
  options?: RequestOptions,
55
- ): APIPromise<TemplateRetrieveResponse> {
57
+ ): APIPromise<APIResponseTemplate> {
56
58
  const { 'x-profile-id': xProfileID } = params ?? {};
57
59
  return this._client.get(path`/v3/templates/${id}`, {
58
60
  ...options,
@@ -69,7 +71,7 @@ export class Templates extends APIResource {
69
71
  *
70
72
  * @example
71
73
  * ```ts
72
- * const template = await client.templates.update(
74
+ * const apiResponseTemplate = await client.templates.update(
73
75
  * '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
74
76
  * );
75
77
  * ```
@@ -78,7 +80,7 @@ export class Templates extends APIResource {
78
80
  id: string,
79
81
  params: TemplateUpdateParams,
80
82
  options?: RequestOptions,
81
- ): APIPromise<TemplateUpdateResponse> {
83
+ ): APIPromise<APIResponseTemplate> {
82
84
  const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
83
85
  return this._client.put(path`/v3/templates/${id}`, {
84
86
  body,
@@ -99,15 +101,18 @@ export class Templates extends APIResource {
99
101
  *
100
102
  * @example
101
103
  * ```ts
102
- * const templates = await client.templates.list({
103
- * page: 0,
104
- * page_size: 0,
105
- * });
104
+ * // Automatically fetches more pages as needed.
105
+ * for await (const template of client.templates.list()) {
106
+ * // ...
107
+ * }
106
108
  * ```
107
109
  */
108
- list(params: TemplateListParams, options?: RequestOptions): APIPromise<TemplateListResponse> {
109
- const { 'x-profile-id': xProfileID, ...query } = params;
110
- return this._client.get('/v3/templates', {
110
+ list(
111
+ params: TemplateListParams | null | undefined = {},
112
+ options?: RequestOptions,
113
+ ): PagePromise<TemplatesTemplatesPage, Template> {
114
+ const { 'x-profile-id': xProfileID, ...query } = params ?? {};
115
+ return this._client.getAPIList('/v3/templates', TemplatesPage<Template>, {
111
116
  query,
112
117
  ...options,
113
118
  headers: buildHeaders([
@@ -141,6 +146,33 @@ export class Templates extends APIResource {
141
146
  }
142
147
  }
143
148
 
149
+ export type TemplatesTemplatesPage = TemplatesPage<Template>;
150
+
151
+ /**
152
+ * Standard API response envelope for all v3 endpoints
153
+ */
154
+ export interface APIResponseTemplate {
155
+ /**
156
+ * Template response for v3 API
157
+ */
158
+ data?: Template | null;
159
+
160
+ /**
161
+ * Error information
162
+ */
163
+ error?: WebhooksAPI.ErrorDetail | null;
164
+
165
+ /**
166
+ * Request and response metadata
167
+ */
168
+ meta?: WebhooksAPI.APIMeta;
169
+
170
+ /**
171
+ * Indicates whether the request was successful
172
+ */
173
+ success?: boolean;
174
+ }
175
+
144
176
  /**
145
177
  * Configuration for AUTHENTICATION category templates
146
178
  */
@@ -158,6 +190,67 @@ export interface AuthenticationConfig {
158
190
  codeExpirationMinutes?: number | null;
159
191
  }
160
192
 
193
+ /**
194
+ * Template response for v3 API
195
+ */
196
+ export interface Template {
197
+ /**
198
+ * Which customer owns this — the key's own, or the profile named in x-profile-id.
199
+ * Says whose resource this is, which the resource's own id does not.
200
+ */
201
+ customer_id: string;
202
+
203
+ /**
204
+ * Unique template identifier
205
+ */
206
+ id?: string;
207
+
208
+ /**
209
+ * Template category: MARKETING, UTILITY, AUTHENTICATION
210
+ */
211
+ category?: string;
212
+
213
+ /**
214
+ * Supported channels: sms, whatsapp
215
+ */
216
+ channels?: Array<string> | null;
217
+
218
+ /**
219
+ * When the template was created
220
+ */
221
+ created_at?: string;
222
+
223
+ /**
224
+ * Whether the template is published and active
225
+ */
226
+ is_published?: boolean;
227
+
228
+ /**
229
+ * Template language code (e.g., en_US)
230
+ */
231
+ language?: string;
232
+
233
+ /**
234
+ * Template display name
235
+ */
236
+ name?: string;
237
+
238
+ /**
239
+ * Template status: APPROVED, PENDING, REJECTED
240
+ */
241
+ status?: string;
242
+
243
+ /**
244
+ * When the template was last updated
245
+ */
246
+ updated_at?: string | null;
247
+
248
+ /**
249
+ * Template variables for personalization
250
+ */
251
+ variables?: Array<string> | null;
252
+ }
253
+
161
254
  /**
162
255
  * Body section of a message template with channel-specific content
163
256
  */
@@ -351,607 +444,6 @@ export namespace TemplateVariable {
351
444
  }
352
445
  }
353
446
 
354
- /**
355
- * Standard API response envelope for all v3 endpoints
356
- */
357
- export interface TemplateCreateResponse {
358
- /**
359
- * Template response for v3 API
360
- */
361
- data?: TemplateCreateResponse.Data | null;
362
-
363
- /**
364
- * Error information
365
- */
366
- error?: TemplateCreateResponse.Error | null;
367
-
368
- /**
369
- * Request and response metadata
370
- */
371
- meta?: TemplateCreateResponse.Meta;
372
-
373
- /**
374
- * Indicates whether the request was successful
375
- */
376
- success?: boolean;
377
- }
378
-
379
- export namespace TemplateCreateResponse {
380
- /**
381
- * Template response for v3 API
382
- */
383
- export interface Data {
384
- /**
385
- * Which customer owns this — the key's own, or the profile named in x-profile-id.
386
- * Says whose resource this is, which the resource's own id does not.
387
- */
388
- customer_id: string;
389
-
390
- /**
391
- * Unique template identifier
392
- */
393
- id?: string;
394
-
395
- /**
396
- * Template category: MARKETING, UTILITY, AUTHENTICATION
397
- */
398
- category?: string;
399
-
400
- /**
401
- * Supported channels: sms, whatsapp
402
- */
403
- channels?: Array<string> | null;
404
-
405
- /**
406
- * When the template was created
407
- */
408
- created_at?: string;
409
-
410
- /**
411
- * Whether the template is published and active
412
- */
413
- is_published?: boolean;
414
-
415
- /**
416
- * Template language code (e.g., en_US)
417
- */
418
- language?: string;
419
-
420
- /**
421
- * Template display name
422
- */
423
- name?: string;
424
-
425
- /**
426
- * Template status: APPROVED, PENDING, REJECTED
427
- */
428
- status?: string;
429
-
430
- /**
431
- * When the template was last updated
432
- */
433
- updated_at?: string | null;
434
-
435
- /**
436
- * Template variables for personalization
437
- */
438
- variables?: Array<string> | null;
439
- }
440
-
441
- /**
442
- * Error information
443
- */
444
- export interface Error {
445
- /**
446
- * Machine-readable error code (e.g., "RESOURCE_001")
447
- */
448
- code?: string;
449
-
450
- /**
451
- * Additional validation error details (field-level errors)
452
- */
453
- details?: { [key: string]: Array<string> } | null;
454
-
455
- /**
456
- * URL to documentation about this error
457
- */
458
- doc_url?: string | null;
459
-
460
- /**
461
- * Human-readable error message
462
- */
463
- message?: string;
464
- }
465
-
466
- /**
467
- * Request and response metadata
468
- */
469
- export interface Meta {
470
- /**
471
- * Unique identifier for this request (for tracing and support)
472
- */
473
- request_id?: string;
474
-
475
- /**
476
- * Server timestamp when the response was generated
477
- */
478
- timestamp?: string;
479
-
480
- /**
481
- * API version used for this request
482
- */
483
- version?: string;
484
- }
485
- }
486
-
487
- /**
488
- * Standard API response envelope for all v3 endpoints
489
- */
490
- export interface TemplateRetrieveResponse {
491
- /**
492
- * Template response for v3 API
493
- */
494
- data?: TemplateRetrieveResponse.Data | null;
495
-
496
- /**
497
- * Error information
498
- */
499
- error?: TemplateRetrieveResponse.Error | null;
500
-
501
- /**
502
- * Request and response metadata
503
- */
504
- meta?: TemplateRetrieveResponse.Meta;
505
-
506
- /**
507
- * Indicates whether the request was successful
508
- */
509
- success?: boolean;
510
- }
511
-
512
- export namespace TemplateRetrieveResponse {
513
- /**
514
- * Template response for v3 API
515
- */
516
- export interface Data {
517
- /**
518
- * Which customer owns this — the key's own, or the profile named in x-profile-id.
519
- * Says whose resource this is, which the resource's own id does not.
520
- */
521
- customer_id: string;
522
-
523
- /**
524
- * Unique template identifier
525
- */
526
- id?: string;
527
-
528
- /**
529
- * Template category: MARKETING, UTILITY, AUTHENTICATION
530
- */
531
- category?: string;
532
-
533
- /**
534
- * Supported channels: sms, whatsapp
535
- */
536
- channels?: Array<string> | null;
537
-
538
- /**
539
- * When the template was created
540
- */
541
- created_at?: string;
542
-
543
- /**
544
- * Whether the template is published and active
545
- */
546
- is_published?: boolean;
547
-
548
- /**
549
- * Template language code (e.g., en_US)
550
- */
551
- language?: string;
552
-
553
- /**
554
- * Template display name
555
- */
556
- name?: string;
557
-
558
- /**
559
- * Template status: APPROVED, PENDING, REJECTED
560
- */
561
- status?: string;
562
-
563
- /**
564
- * When the template was last updated
565
- */
566
- updated_at?: string | null;
567
-
568
- /**
569
- * Template variables for personalization
570
- */
571
- variables?: Array<string> | null;
572
- }
573
-
574
- /**
575
- * Error information
576
- */
577
- export interface Error {
578
- /**
579
- * Machine-readable error code (e.g., "RESOURCE_001")
580
- */
581
- code?: string;
582
-
583
- /**
584
- * Additional validation error details (field-level errors)
585
- */
586
- details?: { [key: string]: Array<string> } | null;
587
-
588
- /**
589
- * URL to documentation about this error
590
- */
591
- doc_url?: string | null;
592
-
593
- /**
594
- * Human-readable error message
595
- */
596
- message?: string;
597
- }
598
-
599
- /**
600
- * Request and response metadata
601
- */
602
- export interface Meta {
603
- /**
604
- * Unique identifier for this request (for tracing and support)
605
- */
606
- request_id?: string;
607
-
608
- /**
609
- * Server timestamp when the response was generated
610
- */
611
- timestamp?: string;
612
-
613
- /**
614
- * API version used for this request
615
- */
616
- version?: string;
617
- }
618
- }
619
-
620
- /**
621
- * Standard API response envelope for all v3 endpoints
622
- */
623
- export interface TemplateUpdateResponse {
624
- /**
625
- * Template response for v3 API
626
- */
627
- data?: TemplateUpdateResponse.Data | null;
628
-
629
- /**
630
- * Error information
631
- */
632
- error?: TemplateUpdateResponse.Error | null;
633
-
634
- /**
635
- * Request and response metadata
636
- */
637
- meta?: TemplateUpdateResponse.Meta;
638
-
639
- /**
640
- * Indicates whether the request was successful
641
- */
642
- success?: boolean;
643
- }
644
-
645
- export namespace TemplateUpdateResponse {
646
- /**
647
- * Template response for v3 API
648
- */
649
- export interface Data {
650
- /**
651
- * Which customer owns this — the key's own, or the profile named in x-profile-id.
652
- * Says whose resource this is, which the resource's own id does not.
653
- */
654
- customer_id: string;
655
-
656
- /**
657
- * Unique template identifier
658
- */
659
- id?: string;
660
-
661
- /**
662
- * Template category: MARKETING, UTILITY, AUTHENTICATION
663
- */
664
- category?: string;
665
-
666
- /**
667
- * Supported channels: sms, whatsapp
668
- */
669
- channels?: Array<string> | null;
670
-
671
- /**
672
- * When the template was created
673
- */
674
- created_at?: string;
675
-
676
- /**
677
- * Whether the template is published and active
678
- */
679
- is_published?: boolean;
680
-
681
- /**
682
- * Template language code (e.g., en_US)
683
- */
684
- language?: string;
685
-
686
- /**
687
- * Template display name
688
- */
689
- name?: string;
690
-
691
- /**
692
- * Template status: APPROVED, PENDING, REJECTED
693
- */
694
- status?: string;
695
-
696
- /**
697
- * When the template was last updated
698
- */
699
- updated_at?: string | null;
700
-
701
- /**
702
- * Template variables for personalization
703
- */
704
- variables?: Array<string> | null;
705
- }
706
-
707
- /**
708
- * Error information
709
- */
710
- export interface Error {
711
- /**
712
- * Machine-readable error code (e.g., "RESOURCE_001")
713
- */
714
- code?: string;
715
-
716
- /**
717
- * Additional validation error details (field-level errors)
718
- */
719
- details?: { [key: string]: Array<string> } | null;
720
-
721
- /**
722
- * URL to documentation about this error
723
- */
724
- doc_url?: string | null;
725
-
726
- /**
727
- * Human-readable error message
728
- */
729
- message?: string;
730
- }
731
-
732
- /**
733
- * Request and response metadata
734
- */
735
- export interface Meta {
736
- /**
737
- * Unique identifier for this request (for tracing and support)
738
- */
739
- request_id?: string;
740
-
741
- /**
742
- * Server timestamp when the response was generated
743
- */
744
- timestamp?: string;
745
-
746
- /**
747
- * API version used for this request
748
- */
749
- version?: string;
750
- }
751
- }
752
-
753
- /**
754
- * Standard API response envelope for all v3 endpoints
755
- */
756
- export interface TemplateListResponse {
757
- /**
758
- * A paginated list of templates.
759
- */
760
- data?: TemplateListResponse.Data | null;
761
-
762
- /**
763
- * Error information
764
- */
765
- error?: TemplateListResponse.Error | null;
766
-
767
- /**
768
- * Request and response metadata
769
- */
770
- meta?: TemplateListResponse.Meta;
771
-
772
- /**
773
- * Indicates whether the request was successful
774
- */
775
- success?: boolean;
776
- }
777
-
778
- export namespace TemplateListResponse {
779
- /**
780
- * A paginated list of templates.
781
- */
782
- export interface Data {
783
- /**
784
- * Pagination metadata for list responses
785
- */
786
- pagination?: Data.Pagination;
787
-
788
- /**
789
- * The templates on this page.
790
- */
791
- templates?: Array<Data.Template>;
792
- }
793
-
794
- export namespace Data {
795
- /**
796
- * Pagination metadata for list responses
797
- */
798
- export interface Pagination {
799
- /**
800
- * @deprecated Cursor-based pagination. Never populated — see Cursors.
801
- */
802
- cursors?: Pagination.Cursors | null;
803
-
804
- /**
805
- * Whether there are more pages after this one
806
- */
807
- has_more?: boolean;
808
-
809
- /**
810
- * Current page number (1-indexed)
811
- */
812
- page?: number;
813
-
814
- /**
815
- * Number of items per page
816
- */
817
- page_size?: number;
818
-
819
- /**
820
- * Total number of items across all pages
821
- */
822
- total_count?: number;
823
-
824
- /**
825
- * Total number of pages
826
- */
827
- total_pages?: number;
828
- }
829
-
830
- export namespace Pagination {
831
- /**
832
- * @deprecated Cursor-based pagination. Never populated — see Cursors.
833
- */
834
- export interface Cursors {
835
- /**
836
- * Cursor to fetch the next page.
837
- */
838
- after?: string | null;
839
-
840
- /**
841
- * Cursor to fetch the previous page.
842
- */
843
- before?: string | null;
844
- }
845
- }
846
-
847
- /**
848
- * Template response for v3 API
849
- */
850
- export interface Template {
851
- /**
852
- * Which customer owns this — the key's own, or the profile named in x-profile-id.
853
- * Says whose resource this is, which the resource's own id does not.
854
- */
855
- customer_id: string;
856
-
857
- /**
858
- * Unique template identifier
859
- */
860
- id?: string;
861
-
862
- /**
863
- * Template category: MARKETING, UTILITY, AUTHENTICATION
864
- */
865
- category?: string;
866
-
867
- /**
868
- * Supported channels: sms, whatsapp
869
- */
870
- channels?: Array<string> | null;
871
-
872
- /**
873
- * When the template was created
874
- */
875
- created_at?: string;
876
-
877
- /**
878
- * Whether the template is published and active
879
- */
880
- is_published?: boolean;
881
-
882
- /**
883
- * Template language code (e.g., en_US)
884
- */
885
- language?: string;
886
-
887
- /**
888
- * Template display name
889
- */
890
- name?: string;
891
-
892
- /**
893
- * Template status: APPROVED, PENDING, REJECTED
894
- */
895
- status?: string;
896
-
897
- /**
898
- * When the template was last updated
899
- */
900
- updated_at?: string | null;
901
-
902
- /**
903
- * Template variables for personalization
904
- */
905
- variables?: Array<string> | null;
906
- }
907
- }
908
-
909
- /**
910
- * Error information
911
- */
912
- export interface Error {
913
- /**
914
- * Machine-readable error code (e.g., "RESOURCE_001")
915
- */
916
- code?: string;
917
-
918
- /**
919
- * Additional validation error details (field-level errors)
920
- */
921
- details?: { [key: string]: Array<string> } | null;
922
-
923
- /**
924
- * URL to documentation about this error
925
- */
926
- doc_url?: string | null;
927
-
928
- /**
929
- * Human-readable error message
930
- */
931
- message?: string;
932
- }
933
-
934
- /**
935
- * Request and response metadata
936
- */
937
- export interface Meta {
938
- /**
939
- * Unique identifier for this request (for tracing and support)
940
- */
941
- request_id?: string;
942
-
943
- /**
944
- * Server timestamp when the response was generated
945
- */
946
- timestamp?: string;
947
-
948
- /**
949
- * API version used for this request
950
- */
951
- version?: string;
952
- }
953
- }
954
-
955
447
  export interface TemplateCreateParams {
956
448
  /**
957
449
  * Body param: Template category: MARKETING, UTILITY, AUTHENTICATION (optional,
@@ -1060,17 +552,7 @@ export interface TemplateUpdateParams {
1060
552
  'x-profile-id'?: string;
1061
553
  }
1062
554
 
1063
- export interface TemplateListParams {
1064
- /**
1065
- * Query param: Page number (1-indexed)
1066
- */
1067
- page: number;
1068
-
1069
- /**
1070
- * Query param: Number of items per page
1071
- */
1072
- page_size: number;
1073
-
555
+ export interface TemplateListParams extends TemplatesPageParams {
1074
556
  /**
1075
557
  * Query param: Optional category filter: MARKETING, UTILITY, AUTHENTICATION
1076
558
  */
@@ -1126,7 +608,9 @@ export interface TemplateDeleteParams {
1126
608
 
1127
609
  export declare namespace Templates {
1128
610
  export {
611
+ type APIResponseTemplate as APIResponseTemplate,
1129
612
  type AuthenticationConfig as AuthenticationConfig,
613
+ type Template as Template,
1130
614
  type TemplateBody as TemplateBody,
1131
615
  type TemplateBodyContent as TemplateBodyContent,
1132
616
  type TemplateButton as TemplateButton,
@@ -1135,10 +619,7 @@ export declare namespace Templates {
1135
619
  type TemplateFooter as TemplateFooter,
1136
620
  type TemplateHeader as TemplateHeader,
1137
621
  type TemplateVariable as TemplateVariable,
1138
- type TemplateCreateResponse as TemplateCreateResponse,
1139
- type TemplateRetrieveResponse as TemplateRetrieveResponse,
1140
- type TemplateUpdateResponse as TemplateUpdateResponse,
1141
- type TemplateListResponse as TemplateListResponse,
622
+ type TemplatesTemplatesPage as TemplatesTemplatesPage,
1142
623
  type TemplateCreateParams as TemplateCreateParams,
1143
624
  type TemplateRetrieveParams as TemplateRetrieveParams,
1144
625
  type TemplateUpdateParams as TemplateUpdateParams,