@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,6 +1,7 @@
1
1
  import { APIResource } from "../core/resource.mjs";
2
2
  import * as WebhooksAPI from "./webhooks.mjs";
3
3
  import { APIPromise } from "../core/api-promise.mjs";
4
+ import { PagePromise, WebhookEventsPage, type WebhookEventsPageParams, WebhooksPage, type WebhooksPageParams } from "../core/pagination.mjs";
4
5
  import { RequestOptions } from "../internal/request-options.mjs";
5
6
  /**
6
7
  * Delivery reports and inbound messages, pushed to you.
@@ -15,44 +16,44 @@ export declare class Webhooks extends APIResource {
15
16
  *
16
17
  * @example
17
18
  * ```ts
18
- * const webhook = await client.webhooks.create();
19
+ * const apiResponseWebhook = await client.webhooks.create();
19
20
  * ```
20
21
  */
21
- create(params: WebhookCreateParams, options?: RequestOptions): APIPromise<WebhookCreateResponse>;
22
+ create(params: WebhookCreateParams, options?: RequestOptions): APIPromise<APIResponseWebhook>;
22
23
  /**
23
24
  * Retrieves a single webhook by ID for the authenticated customer.
24
25
  *
25
26
  * @example
26
27
  * ```ts
27
- * const webhook = await client.webhooks.retrieve(
28
+ * const apiResponseWebhook = await client.webhooks.retrieve(
28
29
  * 'd4f5a6b7-c8d9-4e0f-a1b2-c3d4e5f6a7b8',
29
30
  * );
30
31
  * ```
31
32
  */
32
- retrieve(id: string, params?: WebhookRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<WebhookRetrieveResponse>;
33
+ retrieve(id: string, params?: WebhookRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<APIResponseWebhook>;
33
34
  /**
34
35
  * Updates an existing webhook for the authenticated customer.
35
36
  *
36
37
  * @example
37
38
  * ```ts
38
- * const webhook = await client.webhooks.update(
39
+ * const apiResponseWebhook = await client.webhooks.update(
39
40
  * 'd4f5a6b7-c8d9-4e0f-a1b2-c3d4e5f6a7b8',
40
41
  * );
41
42
  * ```
42
43
  */
43
- update(id: string, params: WebhookUpdateParams, options?: RequestOptions): APIPromise<WebhookUpdateResponse>;
44
+ update(id: string, params: WebhookUpdateParams, options?: RequestOptions): APIPromise<APIResponseWebhook>;
44
45
  /**
45
46
  * Retrieves a paginated list of webhooks for the authenticated customer.
46
47
  *
47
48
  * @example
48
49
  * ```ts
49
- * const webhooks = await client.webhooks.list({
50
- * page: 0,
51
- * page_size: 0,
52
- * });
50
+ * // Automatically fetches more pages as needed.
51
+ * for await (const webhookResponse of client.webhooks.list()) {
52
+ * // ...
53
+ * }
53
54
  * ```
54
55
  */
55
- list(params: WebhookListParams, options?: RequestOptions): APIPromise<WebhookListResponse>;
56
+ list(params?: WebhookListParams | null | undefined, options?: RequestOptions): PagePromise<WebhookResponsesWebhooksPage, WebhookResponse>;
56
57
  /**
57
58
  * Deletes a webhook for the authenticated customer.
58
59
  *
@@ -78,13 +79,15 @@ export declare class Webhooks extends APIResource {
78
79
  *
79
80
  * @example
80
81
  * ```ts
81
- * const response = await client.webhooks.listEvents(
82
+ * // Automatically fetches more pages as needed.
83
+ * for await (const webhookListEventsResponse of client.webhooks.listEvents(
82
84
  * 'd4f5a6b7-c8d9-4e0f-a1b2-c3d4e5f6a7b8',
83
- * { page: 0, page_size: 0 },
84
- * );
85
+ * )) {
86
+ * // ...
87
+ * }
85
88
  * ```
86
89
  */
87
- listEvents(id: string, params: WebhookListEventsParams, options?: RequestOptions): APIPromise<WebhookListEventsResponse>;
90
+ listEvents(id: string, params?: WebhookListEventsParams | null | undefined, options?: RequestOptions): PagePromise<WebhookListEventsResponsesWebhookEventsPage, WebhookListEventsResponse>;
88
91
  /**
89
92
  * Generates a new signing secret for the specified webhook. The old secret is
90
93
  * immediately invalidated.
@@ -113,12 +116,76 @@ export declare class Webhooks extends APIResource {
113
116
  *
114
117
  * @example
115
118
  * ```ts
116
- * const response = await client.webhooks.toggleStatus(
117
- * 'd4f5a6b7-c8d9-4e0f-a1b2-c3d4e5f6a7b8',
118
- * );
119
+ * const apiResponseWebhook =
120
+ * await client.webhooks.toggleStatus(
121
+ * 'd4f5a6b7-c8d9-4e0f-a1b2-c3d4e5f6a7b8',
122
+ * );
119
123
  * ```
120
124
  */
121
- toggleStatus(id: string, params: WebhookToggleStatusParams, options?: RequestOptions): APIPromise<WebhookToggleStatusResponse>;
125
+ toggleStatus(id: string, params: WebhookToggleStatusParams, options?: RequestOptions): APIPromise<APIResponseWebhook>;
126
+ }
127
+ export type WebhookResponsesWebhooksPage = WebhooksPage<WebhookResponse>;
128
+ export type WebhookListEventsResponsesWebhookEventsPage = WebhookEventsPage<WebhookListEventsResponse>;
129
+ /**
130
+ * Request and response metadata
131
+ */
132
+ export interface APIMeta {
133
+ /**
134
+ * Unique identifier for this request (for tracing and support)
135
+ */
136
+ request_id?: string;
137
+ /**
138
+ * Server timestamp when the response was generated
139
+ */
140
+ timestamp?: string;
141
+ /**
142
+ * API version used for this request
143
+ */
144
+ version?: string;
145
+ }
146
+ /**
147
+ * Standard API response envelope for all v3 endpoints
148
+ */
149
+ export interface APIResponseWebhook {
150
+ /**
151
+ * The response data (null if error)
152
+ */
153
+ data?: WebhookResponse | null;
154
+ /**
155
+ * Error information
156
+ */
157
+ error?: ErrorDetail | null;
158
+ /**
159
+ * Request and response metadata
160
+ */
161
+ meta?: APIMeta;
162
+ /**
163
+ * Indicates whether the request was successful
164
+ */
165
+ success?: boolean;
166
+ }
167
+ /**
168
+ * Error information
169
+ */
170
+ export interface ErrorDetail {
171
+ /**
172
+ * Machine-readable error code (e.g., "RESOURCE_001")
173
+ */
174
+ code?: string;
175
+ /**
176
+ * Additional validation error details (field-level errors)
177
+ */
178
+ details?: {
179
+ [key: string]: Array<string>;
180
+ } | null;
181
+ /**
182
+ * URL to documentation about this error
183
+ */
184
+ doc_url?: string | null;
185
+ /**
186
+ * Human-readable error message
187
+ */
188
+ message?: string;
122
189
  }
123
190
  /**
124
191
  * The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
@@ -266,6 +333,57 @@ export interface MessageEventPayload {
266
333
  */
267
334
  updated_at?: string;
268
335
  }
336
+ export interface MutationRequest {
337
+ /**
338
+ * Sandbox flag - when true, the operation is simulated without side effects Useful
339
+ * for testing integrations without actual execution
340
+ */
341
+ sandbox?: boolean;
342
+ }
343
+ /**
344
+ * Pagination metadata for list responses
345
+ */
346
+ export interface PaginationMeta {
347
+ /**
348
+ * @deprecated Cursor-based pagination. Never populated — see Cursors.
349
+ */
350
+ cursors?: PaginationMeta.Cursors | null;
351
+ /**
352
+ * Whether there are more pages after this one
353
+ */
354
+ has_more?: boolean;
355
+ /**
356
+ * Current page number (1-indexed)
357
+ */
358
+ page?: number;
359
+ /**
360
+ * Number of items per page
361
+ */
362
+ page_size?: number;
363
+ /**
364
+ * Total number of items across all pages
365
+ */
366
+ total_count?: number;
367
+ /**
368
+ * Total number of pages
369
+ */
370
+ total_pages?: number;
371
+ }
372
+ export declare namespace PaginationMeta {
373
+ /**
374
+ * @deprecated Cursor-based pagination. Never populated — see Cursors.
375
+ */
376
+ interface Cursors {
377
+ /**
378
+ * Cursor to fetch the next page.
379
+ */
380
+ after?: string | null;
381
+ /**
382
+ * Cursor to fetch the previous page.
383
+ */
384
+ before?: string | null;
385
+ }
386
+ }
269
387
  /**
270
388
  * The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
271
389
  * this shape and varies only in Payload.
@@ -338,417 +456,36 @@ export interface TemplateEventPayload {
338
456
  */
339
457
  template_name?: string;
340
458
  }
341
- /**
342
- * Standard API response envelope for all v3 endpoints
343
- */
344
- export interface WebhookCreateResponse {
345
- /**
346
- * The response data (null if error)
347
- */
348
- data?: WebhookCreateResponse.Data | null;
349
- /**
350
- * Error information
351
- */
352
- error?: WebhookCreateResponse.Error | null;
353
- /**
354
- * Request and response metadata
355
- */
356
- meta?: WebhookCreateResponse.Meta;
357
- /**
358
- * Indicates whether the request was successful
359
- */
360
- success?: boolean;
361
- }
362
- export declare namespace WebhookCreateResponse {
363
- /**
364
- * The response data (null if error)
365
- */
366
- interface Data {
367
- id?: string;
368
- consecutive_failures?: number;
369
- created_at?: string;
370
- /**
371
- * Which customer owns this — the key's own, or the profile named in x-profile-id.
372
- * Says whose resource this is, which the resource's own id does not.
373
- */
374
- customer_id?: string;
375
- display_name?: string;
376
- endpoint_url?: string;
377
- event_filters?: {
378
- [key: string]: Array<string>;
379
- } | null;
380
- event_types?: Array<string>;
381
- is_active?: boolean;
382
- last_delivery_attempt_at?: string | null;
383
- last_successful_delivery_at?: string | null;
384
- retry_count?: number;
385
- signing_secret?: string | null;
386
- timeout_seconds?: number;
387
- updated_at?: string | null;
388
- }
389
- /**
390
- * Error information
391
- */
392
- interface Error {
393
- /**
394
- * Machine-readable error code (e.g., "RESOURCE_001")
395
- */
396
- code?: string;
397
- /**
398
- * Additional validation error details (field-level errors)
399
- */
400
- details?: {
401
- [key: string]: Array<string>;
402
- } | null;
403
- /**
404
- * URL to documentation about this error
405
- */
406
- doc_url?: string | null;
407
- /**
408
- * Human-readable error message
409
- */
410
- message?: string;
411
- }
412
- /**
413
- * Request and response metadata
414
- */
415
- interface Meta {
416
- /**
417
- * Unique identifier for this request (for tracing and support)
418
- */
419
- request_id?: string;
420
- /**
421
- * Server timestamp when the response was generated
422
- */
423
- timestamp?: string;
424
- /**
425
- * API version used for this request
426
- */
427
- version?: string;
428
- }
429
- }
430
- /**
431
- * Standard API response envelope for all v3 endpoints
432
- */
433
- export interface WebhookRetrieveResponse {
434
- /**
435
- * The response data (null if error)
436
- */
437
- data?: WebhookRetrieveResponse.Data | null;
438
- /**
439
- * Error information
440
- */
441
- error?: WebhookRetrieveResponse.Error | null;
442
- /**
443
- * Request and response metadata
444
- */
445
- meta?: WebhookRetrieveResponse.Meta;
446
- /**
447
- * Indicates whether the request was successful
448
- */
449
- success?: boolean;
450
- }
451
- export declare namespace WebhookRetrieveResponse {
452
- /**
453
- * The response data (null if error)
454
- */
455
- interface Data {
456
- id?: string;
457
- consecutive_failures?: number;
458
- created_at?: string;
459
- /**
460
- * Which customer owns this — the key's own, or the profile named in x-profile-id.
461
- * Says whose resource this is, which the resource's own id does not.
462
- */
463
- customer_id?: string;
464
- display_name?: string;
465
- endpoint_url?: string;
466
- event_filters?: {
467
- [key: string]: Array<string>;
468
- } | null;
469
- event_types?: Array<string>;
470
- is_active?: boolean;
471
- last_delivery_attempt_at?: string | null;
472
- last_successful_delivery_at?: string | null;
473
- retry_count?: number;
474
- signing_secret?: string | null;
475
- timeout_seconds?: number;
476
- updated_at?: string | null;
477
- }
478
- /**
479
- * Error information
480
- */
481
- interface Error {
482
- /**
483
- * Machine-readable error code (e.g., "RESOURCE_001")
484
- */
485
- code?: string;
486
- /**
487
- * Additional validation error details (field-level errors)
488
- */
489
- details?: {
490
- [key: string]: Array<string>;
491
- } | null;
492
- /**
493
- * URL to documentation about this error
494
- */
495
- doc_url?: string | null;
496
- /**
497
- * Human-readable error message
498
- */
499
- message?: string;
500
- }
501
- /**
502
- * Request and response metadata
503
- */
504
- interface Meta {
505
- /**
506
- * Unique identifier for this request (for tracing and support)
507
- */
508
- request_id?: string;
509
- /**
510
- * Server timestamp when the response was generated
511
- */
512
- timestamp?: string;
513
- /**
514
- * API version used for this request
515
- */
516
- version?: string;
517
- }
518
- }
519
- /**
520
- * Standard API response envelope for all v3 endpoints
521
- */
522
- export interface WebhookUpdateResponse {
523
- /**
524
- * The response data (null if error)
525
- */
526
- data?: WebhookUpdateResponse.Data | null;
527
- /**
528
- * Error information
529
- */
530
- error?: WebhookUpdateResponse.Error | null;
531
- /**
532
- * Request and response metadata
533
- */
534
- meta?: WebhookUpdateResponse.Meta;
535
- /**
536
- * Indicates whether the request was successful
537
- */
538
- success?: boolean;
539
- }
540
- export declare namespace WebhookUpdateResponse {
541
- /**
542
- * The response data (null if error)
543
- */
544
- interface Data {
545
- id?: string;
546
- consecutive_failures?: number;
547
- created_at?: string;
548
- /**
549
- * Which customer owns this — the key's own, or the profile named in x-profile-id.
550
- * Says whose resource this is, which the resource's own id does not.
551
- */
552
- customer_id?: string;
553
- display_name?: string;
554
- endpoint_url?: string;
555
- event_filters?: {
556
- [key: string]: Array<string>;
557
- } | null;
558
- event_types?: Array<string>;
559
- is_active?: boolean;
560
- last_delivery_attempt_at?: string | null;
561
- last_successful_delivery_at?: string | null;
562
- retry_count?: number;
563
- signing_secret?: string | null;
564
- timeout_seconds?: number;
565
- updated_at?: string | null;
566
- }
567
- /**
568
- * Error information
569
- */
570
- interface Error {
571
- /**
572
- * Machine-readable error code (e.g., "RESOURCE_001")
573
- */
574
- code?: string;
575
- /**
576
- * Additional validation error details (field-level errors)
577
- */
578
- details?: {
579
- [key: string]: Array<string>;
580
- } | null;
581
- /**
582
- * URL to documentation about this error
583
- */
584
- doc_url?: string | null;
585
- /**
586
- * Human-readable error message
587
- */
588
- message?: string;
589
- }
590
- /**
591
- * Request and response metadata
592
- */
593
- interface Meta {
594
- /**
595
- * Unique identifier for this request (for tracing and support)
596
- */
597
- request_id?: string;
598
- /**
599
- * Server timestamp when the response was generated
600
- */
601
- timestamp?: string;
602
- /**
603
- * API version used for this request
604
- */
605
- version?: string;
606
- }
607
- }
608
- /**
609
- * Standard API response envelope for all v3 endpoints
610
- */
611
- export interface WebhookListResponse {
612
- /**
613
- * A paginated list of webhooks.
614
- */
615
- data?: WebhookListResponse.Data | null;
616
- /**
617
- * Error information
618
- */
619
- error?: WebhookListResponse.Error | null;
620
- /**
621
- * Request and response metadata
622
- */
623
- meta?: WebhookListResponse.Meta;
624
- /**
625
- * Indicates whether the request was successful
626
- */
627
- success?: boolean;
459
+ export interface WebhookEventType {
460
+ description?: string | null;
461
+ display_name?: string;
462
+ event_type?: string | null;
463
+ is_active?: boolean;
464
+ name?: string;
465
+ sub_types?: Array<WebhookEventType> | null;
628
466
  }
629
- export declare namespace WebhookListResponse {
467
+ export interface WebhookResponse {
468
+ id?: string;
469
+ consecutive_failures?: number;
470
+ created_at?: string;
630
471
  /**
631
- * A paginated list of webhooks.
632
- */
633
- interface Data {
634
- /**
635
- * Pagination metadata for list responses
636
- */
637
- pagination?: Data.Pagination;
638
- /**
639
- * The webhooks on this page.
640
- */
641
- webhooks?: Array<Data.Webhook>;
642
- }
643
- namespace Data {
644
- /**
645
- * Pagination metadata for list responses
646
- */
647
- interface Pagination {
648
- /**
649
- * @deprecated Cursor-based pagination. Never populated — see Cursors.
650
- */
651
- cursors?: Pagination.Cursors | null;
652
- /**
653
- * Whether there are more pages after this one
654
- */
655
- has_more?: boolean;
656
- /**
657
- * Current page number (1-indexed)
658
- */
659
- page?: number;
660
- /**
661
- * Number of items per page
662
- */
663
- page_size?: number;
664
- /**
665
- * Total number of items across all pages
666
- */
667
- total_count?: number;
668
- /**
669
- * Total number of pages
670
- */
671
- total_pages?: number;
672
- }
673
- namespace Pagination {
674
- /**
675
- * @deprecated Cursor-based pagination. Never populated — see Cursors.
676
- */
677
- interface Cursors {
678
- /**
679
- * Cursor to fetch the next page.
680
- */
681
- after?: string | null;
682
- /**
683
- * Cursor to fetch the previous page.
684
- */
685
- before?: string | null;
686
- }
687
- }
688
- interface Webhook {
689
- id?: string;
690
- consecutive_failures?: number;
691
- created_at?: string;
692
- /**
693
- * Which customer owns this — the key's own, or the profile named in x-profile-id.
694
- * Says whose resource this is, which the resource's own id does not.
695
- */
696
- customer_id?: string;
697
- display_name?: string;
698
- endpoint_url?: string;
699
- event_filters?: {
700
- [key: string]: Array<string>;
701
- } | null;
702
- event_types?: Array<string>;
703
- is_active?: boolean;
704
- last_delivery_attempt_at?: string | null;
705
- last_successful_delivery_at?: string | null;
706
- retry_count?: number;
707
- signing_secret?: string | null;
708
- timeout_seconds?: number;
709
- updated_at?: string | null;
710
- }
711
- }
712
- /**
713
- * Error information
472
+ * Which customer owns this — the key's own, or the profile named in x-profile-id.
473
+ * Says whose resource this is, which the resource's own id does not.
714
474
  */
715
- interface Error {
716
- /**
717
- * Machine-readable error code (e.g., "RESOURCE_001")
718
- */
719
- code?: string;
720
- /**
721
- * Additional validation error details (field-level errors)
722
- */
723
- details?: {
724
- [key: string]: Array<string>;
725
- } | null;
726
- /**
727
- * URL to documentation about this error
728
- */
729
- doc_url?: string | null;
730
- /**
731
- * Human-readable error message
732
- */
733
- message?: string;
734
- }
735
- /**
736
- * Request and response metadata
737
- */
738
- interface Meta {
739
- /**
740
- * Unique identifier for this request (for tracing and support)
741
- */
742
- request_id?: string;
743
- /**
744
- * Server timestamp when the response was generated
745
- */
746
- timestamp?: string;
747
- /**
748
- * API version used for this request
749
- */
750
- version?: string;
751
- }
475
+ customer_id?: string;
476
+ display_name?: string;
477
+ endpoint_url?: string;
478
+ event_filters?: {
479
+ [key: string]: Array<string>;
480
+ } | null;
481
+ event_types?: Array<string>;
482
+ is_active?: boolean;
483
+ last_delivery_attempt_at?: string | null;
484
+ last_successful_delivery_at?: string | null;
485
+ retry_count?: number;
486
+ signing_secret?: string | null;
487
+ timeout_seconds?: number;
488
+ updated_at?: string | null;
752
489
  }
753
490
  /**
754
491
  * Standard API response envelope for all v3 endpoints
@@ -761,11 +498,11 @@ export interface WebhookListEventTypesResponse {
761
498
  /**
762
499
  * Error information
763
500
  */
764
- error?: WebhookListEventTypesResponse.Error | null;
501
+ error?: ErrorDetail | null;
765
502
  /**
766
503
  * Request and response metadata
767
504
  */
768
- meta?: WebhookListEventTypesResponse.Meta;
505
+ meta?: APIMeta;
769
506
  /**
770
507
  * Indicates whether the request was successful
771
508
  */
@@ -779,247 +516,31 @@ export declare namespace WebhookListEventTypesResponse {
779
516
  /**
780
517
  * The event_types on this page.
781
518
  */
782
- event_types?: Array<Data.EventType>;
519
+ event_types?: Array<WebhooksAPI.WebhookEventType>;
783
520
  /**
784
521
  * Pagination metadata for list responses
785
522
  */
786
- pagination?: Data.Pagination;
787
- }
788
- namespace Data {
789
- interface EventType {
790
- description?: string | null;
791
- display_name?: string;
792
- event_type?: string | null;
793
- is_active?: boolean;
794
- name?: string;
795
- sub_types?: Array<unknown> | null;
796
- }
797
- /**
798
- * Pagination metadata for list responses
799
- */
800
- interface Pagination {
801
- /**
802
- * @deprecated Cursor-based pagination. Never populated — see Cursors.
803
- */
804
- cursors?: Pagination.Cursors | null;
805
- /**
806
- * Whether there are more pages after this one
807
- */
808
- has_more?: boolean;
809
- /**
810
- * Current page number (1-indexed)
811
- */
812
- page?: number;
813
- /**
814
- * Number of items per page
815
- */
816
- page_size?: number;
817
- /**
818
- * Total number of items across all pages
819
- */
820
- total_count?: number;
821
- /**
822
- * Total number of pages
823
- */
824
- total_pages?: number;
825
- }
826
- namespace Pagination {
827
- /**
828
- * @deprecated Cursor-based pagination. Never populated — see Cursors.
829
- */
830
- interface Cursors {
831
- /**
832
- * Cursor to fetch the next page.
833
- */
834
- after?: string | null;
835
- /**
836
- * Cursor to fetch the previous page.
837
- */
838
- before?: string | null;
839
- }
840
- }
841
- }
842
- /**
843
- * Error information
844
- */
845
- interface Error {
846
- /**
847
- * Machine-readable error code (e.g., "RESOURCE_001")
848
- */
849
- code?: string;
850
- /**
851
- * Additional validation error details (field-level errors)
852
- */
853
- details?: {
854
- [key: string]: Array<string>;
855
- } | null;
856
- /**
857
- * URL to documentation about this error
858
- */
859
- doc_url?: string | null;
860
- /**
861
- * Human-readable error message
862
- */
863
- message?: string;
864
- }
865
- /**
866
- * Request and response metadata
867
- */
868
- interface Meta {
869
- /**
870
- * Unique identifier for this request (for tracing and support)
871
- */
872
- request_id?: string;
873
- /**
874
- * Server timestamp when the response was generated
875
- */
876
- timestamp?: string;
877
- /**
878
- * API version used for this request
879
- */
880
- version?: string;
523
+ pagination?: WebhooksAPI.PaginationMeta;
881
524
  }
882
525
  }
883
- /**
884
- * Standard API response envelope for all v3 endpoints
885
- */
886
526
  export interface WebhookListEventsResponse {
887
- /**
888
- * A paginated list of webhook delivery records.
889
- */
890
- data?: WebhookListEventsResponse.Data | null;
891
- /**
892
- * Error information
893
- */
894
- error?: WebhookListEventsResponse.Error | null;
895
- /**
896
- * Request and response metadata
897
- */
898
- meta?: WebhookListEventsResponse.Meta;
899
- /**
900
- * Indicates whether the request was successful
901
- */
902
- success?: boolean;
903
- }
904
- export declare namespace WebhookListEventsResponse {
905
- /**
906
- * A paginated list of webhook delivery records.
907
- */
908
- interface Data {
909
- /**
910
- * The events on this page.
911
- */
912
- events?: Array<Data.Event>;
913
- /**
914
- * Pagination metadata for list responses
915
- */
916
- pagination?: Data.Pagination;
917
- }
918
- namespace Data {
919
- interface Event {
920
- id?: string;
921
- created_at?: string;
922
- delivery_attempts?: number;
923
- delivery_status?: string;
924
- error_message?: string | null;
925
- /**
926
- * The exact event body that was delivered, or attempted, for this record. One of
927
- * the three webhook envelopes: a message status change, an inbound message, or a
928
- * template status change. Read field and event to tell which, the same way your
929
- * endpoint does.
930
- */
931
- event_data?: WebhooksAPI.MessageEvent | WebhooksAPI.InboundMessageEvent | WebhooksAPI.TemplateEvent;
932
- event_type?: string;
933
- http_status_code?: number | null;
934
- processing_completed_at?: string | null;
935
- processing_started_at?: string | null;
936
- response_body?: string | null;
937
- }
938
- /**
939
- * Pagination metadata for list responses
940
- */
941
- interface Pagination {
942
- /**
943
- * @deprecated Cursor-based pagination. Never populated — see Cursors.
944
- */
945
- cursors?: Pagination.Cursors | null;
946
- /**
947
- * Whether there are more pages after this one
948
- */
949
- has_more?: boolean;
950
- /**
951
- * Current page number (1-indexed)
952
- */
953
- page?: number;
954
- /**
955
- * Number of items per page
956
- */
957
- page_size?: number;
958
- /**
959
- * Total number of items across all pages
960
- */
961
- total_count?: number;
962
- /**
963
- * Total number of pages
964
- */
965
- total_pages?: number;
966
- }
967
- namespace Pagination {
968
- /**
969
- * @deprecated Cursor-based pagination. Never populated — see Cursors.
970
- */
971
- interface Cursors {
972
- /**
973
- * Cursor to fetch the next page.
974
- */
975
- after?: string | null;
976
- /**
977
- * Cursor to fetch the previous page.
978
- */
979
- before?: string | null;
980
- }
981
- }
982
- }
983
- /**
984
- * Error information
985
- */
986
- interface Error {
987
- /**
988
- * Machine-readable error code (e.g., "RESOURCE_001")
989
- */
990
- code?: string;
991
- /**
992
- * Additional validation error details (field-level errors)
993
- */
994
- details?: {
995
- [key: string]: Array<string>;
996
- } | null;
997
- /**
998
- * URL to documentation about this error
999
- */
1000
- doc_url?: string | null;
1001
- /**
1002
- * Human-readable error message
1003
- */
1004
- message?: string;
1005
- }
1006
- /**
1007
- * Request and response metadata
1008
- */
1009
- interface Meta {
1010
- /**
1011
- * Unique identifier for this request (for tracing and support)
1012
- */
1013
- request_id?: string;
1014
- /**
1015
- * Server timestamp when the response was generated
1016
- */
1017
- timestamp?: string;
1018
- /**
1019
- * API version used for this request
1020
- */
1021
- version?: string;
1022
- }
527
+ id?: string;
528
+ created_at?: string;
529
+ delivery_attempts?: number;
530
+ delivery_status?: string;
531
+ error_message?: string | null;
532
+ /**
533
+ * The exact event body that was delivered, or attempted, for this record. One of
534
+ * the three webhook envelopes: a message status change, an inbound message, or a
535
+ * template status change. Read field and event to tell which, the same way your
536
+ * endpoint does.
537
+ */
538
+ event_data?: MessageEvent | InboundMessageEvent | TemplateEvent;
539
+ event_type?: string;
540
+ http_status_code?: number | null;
541
+ processing_completed_at?: string | null;
542
+ processing_started_at?: string | null;
543
+ response_body?: string | null;
1023
544
  }
1024
545
  /**
1025
546
  * Standard API response envelope for all v3 endpoints
@@ -1032,11 +553,11 @@ export interface WebhookRotateSecretResponse {
1032
553
  /**
1033
554
  * Error information
1034
555
  */
1035
- error?: WebhookRotateSecretResponse.Error | null;
556
+ error?: ErrorDetail | null;
1036
557
  /**
1037
558
  * Request and response metadata
1038
559
  */
1039
- meta?: WebhookRotateSecretResponse.Meta;
560
+ meta?: APIMeta;
1040
561
  /**
1041
562
  * Indicates whether the request was successful
1042
563
  */
@@ -1049,46 +570,6 @@ export declare namespace WebhookRotateSecretResponse {
1049
570
  interface Data {
1050
571
  signing_secret?: string;
1051
572
  }
1052
- /**
1053
- * Error information
1054
- */
1055
- interface Error {
1056
- /**
1057
- * Machine-readable error code (e.g., "RESOURCE_001")
1058
- */
1059
- code?: string;
1060
- /**
1061
- * Additional validation error details (field-level errors)
1062
- */
1063
- details?: {
1064
- [key: string]: Array<string>;
1065
- } | null;
1066
- /**
1067
- * URL to documentation about this error
1068
- */
1069
- doc_url?: string | null;
1070
- /**
1071
- * Human-readable error message
1072
- */
1073
- message?: string;
1074
- }
1075
- /**
1076
- * Request and response metadata
1077
- */
1078
- interface Meta {
1079
- /**
1080
- * Unique identifier for this request (for tracing and support)
1081
- */
1082
- request_id?: string;
1083
- /**
1084
- * Server timestamp when the response was generated
1085
- */
1086
- timestamp?: string;
1087
- /**
1088
- * API version used for this request
1089
- */
1090
- version?: string;
1091
- }
1092
573
  }
1093
574
  /**
1094
575
  * Standard API response envelope for all v3 endpoints
@@ -1101,11 +582,11 @@ export interface WebhookTestResponse {
1101
582
  /**
1102
583
  * Error information
1103
584
  */
1104
- error?: WebhookTestResponse.Error | null;
585
+ error?: ErrorDetail | null;
1105
586
  /**
1106
587
  * Request and response metadata
1107
588
  */
1108
- meta?: WebhookTestResponse.Meta;
589
+ meta?: APIMeta;
1109
590
  /**
1110
591
  * Indicates whether the request was successful
1111
592
  */
@@ -1119,135 +600,6 @@ export declare namespace WebhookTestResponse {
1119
600
  message?: string;
1120
601
  success?: boolean;
1121
602
  }
1122
- /**
1123
- * Error information
1124
- */
1125
- interface Error {
1126
- /**
1127
- * Machine-readable error code (e.g., "RESOURCE_001")
1128
- */
1129
- code?: string;
1130
- /**
1131
- * Additional validation error details (field-level errors)
1132
- */
1133
- details?: {
1134
- [key: string]: Array<string>;
1135
- } | null;
1136
- /**
1137
- * URL to documentation about this error
1138
- */
1139
- doc_url?: string | null;
1140
- /**
1141
- * Human-readable error message
1142
- */
1143
- message?: string;
1144
- }
1145
- /**
1146
- * Request and response metadata
1147
- */
1148
- interface Meta {
1149
- /**
1150
- * Unique identifier for this request (for tracing and support)
1151
- */
1152
- request_id?: string;
1153
- /**
1154
- * Server timestamp when the response was generated
1155
- */
1156
- timestamp?: string;
1157
- /**
1158
- * API version used for this request
1159
- */
1160
- version?: string;
1161
- }
1162
- }
1163
- /**
1164
- * Standard API response envelope for all v3 endpoints
1165
- */
1166
- export interface WebhookToggleStatusResponse {
1167
- /**
1168
- * The response data (null if error)
1169
- */
1170
- data?: WebhookToggleStatusResponse.Data | null;
1171
- /**
1172
- * Error information
1173
- */
1174
- error?: WebhookToggleStatusResponse.Error | null;
1175
- /**
1176
- * Request and response metadata
1177
- */
1178
- meta?: WebhookToggleStatusResponse.Meta;
1179
- /**
1180
- * Indicates whether the request was successful
1181
- */
1182
- success?: boolean;
1183
- }
1184
- export declare namespace WebhookToggleStatusResponse {
1185
- /**
1186
- * The response data (null if error)
1187
- */
1188
- interface Data {
1189
- id?: string;
1190
- consecutive_failures?: number;
1191
- created_at?: string;
1192
- /**
1193
- * Which customer owns this — the key's own, or the profile named in x-profile-id.
1194
- * Says whose resource this is, which the resource's own id does not.
1195
- */
1196
- customer_id?: string;
1197
- display_name?: string;
1198
- endpoint_url?: string;
1199
- event_filters?: {
1200
- [key: string]: Array<string>;
1201
- } | null;
1202
- event_types?: Array<string>;
1203
- is_active?: boolean;
1204
- last_delivery_attempt_at?: string | null;
1205
- last_successful_delivery_at?: string | null;
1206
- retry_count?: number;
1207
- signing_secret?: string | null;
1208
- timeout_seconds?: number;
1209
- updated_at?: string | null;
1210
- }
1211
- /**
1212
- * Error information
1213
- */
1214
- interface Error {
1215
- /**
1216
- * Machine-readable error code (e.g., "RESOURCE_001")
1217
- */
1218
- code?: string;
1219
- /**
1220
- * Additional validation error details (field-level errors)
1221
- */
1222
- details?: {
1223
- [key: string]: Array<string>;
1224
- } | null;
1225
- /**
1226
- * URL to documentation about this error
1227
- */
1228
- doc_url?: string | null;
1229
- /**
1230
- * Human-readable error message
1231
- */
1232
- message?: string;
1233
- }
1234
- /**
1235
- * Request and response metadata
1236
- */
1237
- interface Meta {
1238
- /**
1239
- * Unique identifier for this request (for tracing and support)
1240
- */
1241
- request_id?: string;
1242
- /**
1243
- * Server timestamp when the response was generated
1244
- */
1245
- timestamp?: string;
1246
- /**
1247
- * API version used for this request
1248
- */
1249
- version?: string;
1250
- }
1251
603
  }
1252
604
  export interface WebhookCreateParams {
1253
605
  /**
@@ -1346,15 +698,7 @@ export interface WebhookUpdateParams {
1346
698
  */
1347
699
  'x-profile-id'?: string;
1348
700
  }
1349
- export interface WebhookListParams {
1350
- /**
1351
- * Query param
1352
- */
1353
- page: number;
1354
- /**
1355
- * Query param
1356
- */
1357
- page_size: number;
701
+ export interface WebhookListParams extends WebhooksPageParams {
1358
702
  /**
1359
703
  * Query param
1360
704
  */
@@ -1384,15 +728,7 @@ export interface WebhookListEventTypesParams {
1384
728
  */
1385
729
  'x-profile-id'?: string;
1386
730
  }
1387
- export interface WebhookListEventsParams {
1388
- /**
1389
- * Query param
1390
- */
1391
- page: number;
1392
- /**
1393
- * Query param
1394
- */
1395
- page_size: number;
731
+ export interface WebhookListEventsParams extends WebhookEventsPageParams {
1396
732
  /**
1397
733
  * Query param
1398
734
  */
@@ -1470,6 +806,6 @@ export interface WebhookToggleStatusParams {
1470
806
  'x-profile-id'?: string;
1471
807
  }
1472
808
  export declare namespace Webhooks {
1473
- export { type InboundMessageEvent as InboundMessageEvent, type InboundMessageEventPayload as InboundMessageEventPayload, type MessageEvent as MessageEvent, type MessageEventPayload as MessageEventPayload, type TemplateEvent as TemplateEvent, type TemplateEventPayload as TemplateEventPayload, type WebhookCreateResponse as WebhookCreateResponse, type WebhookRetrieveResponse as WebhookRetrieveResponse, type WebhookUpdateResponse as WebhookUpdateResponse, type WebhookListResponse as WebhookListResponse, type WebhookListEventTypesResponse as WebhookListEventTypesResponse, type WebhookListEventsResponse as WebhookListEventsResponse, type WebhookRotateSecretResponse as WebhookRotateSecretResponse, type WebhookTestResponse as WebhookTestResponse, type WebhookToggleStatusResponse as WebhookToggleStatusResponse, type WebhookCreateParams as WebhookCreateParams, type WebhookRetrieveParams as WebhookRetrieveParams, type WebhookUpdateParams as WebhookUpdateParams, type WebhookListParams as WebhookListParams, type WebhookDeleteParams as WebhookDeleteParams, type WebhookListEventTypesParams as WebhookListEventTypesParams, type WebhookListEventsParams as WebhookListEventsParams, type WebhookRotateSecretParams as WebhookRotateSecretParams, type WebhookTestParams as WebhookTestParams, type WebhookToggleStatusParams as WebhookToggleStatusParams, };
809
+ export { type APIMeta as APIMeta, type APIResponseWebhook as APIResponseWebhook, type ErrorDetail as ErrorDetail, type InboundMessageEvent as InboundMessageEvent, type InboundMessageEventPayload as InboundMessageEventPayload, type MessageEvent as MessageEvent, type MessageEventPayload as MessageEventPayload, type MutationRequest as MutationRequest, type PaginationMeta as PaginationMeta, type TemplateEvent as TemplateEvent, type TemplateEventPayload as TemplateEventPayload, type WebhookEventType as WebhookEventType, type WebhookResponse as WebhookResponse, type WebhookListEventTypesResponse as WebhookListEventTypesResponse, type WebhookListEventsResponse as WebhookListEventsResponse, type WebhookRotateSecretResponse as WebhookRotateSecretResponse, type WebhookTestResponse as WebhookTestResponse, type WebhookResponsesWebhooksPage as WebhookResponsesWebhooksPage, type WebhookListEventsResponsesWebhookEventsPage as WebhookListEventsResponsesWebhookEventsPage, type WebhookCreateParams as WebhookCreateParams, type WebhookRetrieveParams as WebhookRetrieveParams, type WebhookUpdateParams as WebhookUpdateParams, type WebhookListParams as WebhookListParams, type WebhookDeleteParams as WebhookDeleteParams, type WebhookListEventTypesParams as WebhookListEventTypesParams, type WebhookListEventsParams as WebhookListEventsParams, type WebhookRotateSecretParams as WebhookRotateSecretParams, type WebhookTestParams as WebhookTestParams, type WebhookToggleStatusParams as WebhookToggleStatusParams, };
1474
810
  }
1475
811
  //# sourceMappingURL=webhooks.d.mts.map