@surgeapi/node 0.26.0 → 0.27.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 (77) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/client.d.mts +16 -16
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +16 -16
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs +2 -2
  8. package/client.mjs.map +1 -1
  9. package/internal/to-file.d.mts +1 -1
  10. package/internal/to-file.d.ts +1 -1
  11. package/internal/to-file.js +1 -1
  12. package/internal/to-file.mjs +1 -1
  13. package/package.json +1 -1
  14. package/resources/accounts.d.mts +292 -191
  15. package/resources/accounts.d.mts.map +1 -1
  16. package/resources/accounts.d.ts +292 -191
  17. package/resources/accounts.d.ts.map +1 -1
  18. package/resources/blasts.d.mts +11 -32
  19. package/resources/blasts.d.mts.map +1 -1
  20. package/resources/blasts.d.ts +11 -32
  21. package/resources/blasts.d.ts.map +1 -1
  22. package/resources/blasts.js.map +1 -1
  23. package/resources/blasts.mjs.map +1 -1
  24. package/resources/campaigns.d.mts +1 -103
  25. package/resources/campaigns.d.mts.map +1 -1
  26. package/resources/campaigns.d.ts +1 -103
  27. package/resources/campaigns.d.ts.map +1 -1
  28. package/resources/contacts.d.mts +1 -28
  29. package/resources/contacts.d.mts.map +1 -1
  30. package/resources/contacts.d.ts +1 -28
  31. package/resources/contacts.d.ts.map +1 -1
  32. package/resources/index.d.mts +8 -8
  33. package/resources/index.d.mts.map +1 -1
  34. package/resources/index.d.ts +8 -8
  35. package/resources/index.d.ts.map +1 -1
  36. package/resources/index.js.map +1 -1
  37. package/resources/index.mjs +2 -2
  38. package/resources/index.mjs.map +1 -1
  39. package/resources/messages.d.mts +49 -81
  40. package/resources/messages.d.mts.map +1 -1
  41. package/resources/messages.d.ts +49 -81
  42. package/resources/messages.d.ts.map +1 -1
  43. package/resources/messages.js.map +1 -1
  44. package/resources/messages.mjs.map +1 -1
  45. package/resources/phone-numbers.d.mts +0 -30
  46. package/resources/phone-numbers.d.mts.map +1 -1
  47. package/resources/phone-numbers.d.ts +0 -30
  48. package/resources/phone-numbers.d.ts.map +1 -1
  49. package/resources/users.d.mts +1 -33
  50. package/resources/users.d.mts.map +1 -1
  51. package/resources/users.d.ts +1 -33
  52. package/resources/users.d.ts.map +1 -1
  53. package/resources/verifications.d.mts +1 -19
  54. package/resources/verifications.d.mts.map +1 -1
  55. package/resources/verifications.d.ts +1 -19
  56. package/resources/verifications.d.ts.map +1 -1
  57. package/resources/webhooks.d.mts +60 -41
  58. package/resources/webhooks.d.mts.map +1 -1
  59. package/resources/webhooks.d.ts +60 -41
  60. package/resources/webhooks.d.ts.map +1 -1
  61. package/src/client.ts +12 -43
  62. package/src/internal/to-file.ts +1 -1
  63. package/src/resources/accounts.ts +475 -284
  64. package/src/resources/blasts.ts +11 -42
  65. package/src/resources/campaigns.ts +1 -127
  66. package/src/resources/contacts.ts +0 -31
  67. package/src/resources/index.ts +8 -23
  68. package/src/resources/messages.ts +54 -99
  69. package/src/resources/phone-numbers.ts +0 -34
  70. package/src/resources/users.ts +0 -37
  71. package/src/resources/verifications.ts +1 -22
  72. package/src/resources/webhooks.ts +72 -39
  73. package/src/version.ts +1 -1
  74. package/version.d.mts +1 -1
  75. package/version.d.ts +1 -1
  76. package/version.js +1 -1
  77. package/version.mjs +1 -1
@@ -20,10 +20,6 @@ export class Webhooks extends APIResource {
20
20
  }
21
21
  }
22
22
 
23
- /**
24
- * The `call.ended` event is delivered whenever a call is completed between a Surge
25
- * number you own and another phone number.
26
- */
27
23
  export interface CallEndedWebhookEvent {
28
24
  /**
29
25
  * The ID of the account in which this event occurred
@@ -87,10 +83,6 @@ export namespace CallEndedWebhookEvent {
87
83
  }
88
84
  }
89
85
 
90
- /**
91
- * The `campaign.approved` event is delivered whenever a campaign is approved by
92
- * all of the US carriers and able to start sending text messages.
93
- */
94
86
  export interface CampaignApprovedWebhookEvent {
95
87
  /**
96
88
  * The ID of the account in which this event occurred
@@ -130,13 +122,74 @@ export namespace CampaignApprovedWebhookEvent {
130
122
  }
131
123
  }
132
124
 
133
- /**
134
- * The `conversation.created` event is delivered whenever a new conversation is
135
- * started with a contact. This could be when either the contact sends a message to
136
- * your Surge number or when you create a conversation, whether by sending an
137
- * initial message to the contact or by manually creating the conversation using
138
- * the API.
139
- */
125
+ export interface ContactOptedInWebhookEvent {
126
+ /**
127
+ * The ID of the account in which this event occurred
128
+ */
129
+ account_id: string;
130
+
131
+ /**
132
+ * The data associated with the event
133
+ */
134
+ data: ContactOptedInWebhookEvent.Data;
135
+
136
+ /**
137
+ * The timestamp when this event occurred, in ISO8601 format
138
+ */
139
+ timestamp: string;
140
+
141
+ /**
142
+ * The type of the event. Always `contact.opted_in` for this event.
143
+ */
144
+ type: 'contact.opted_in';
145
+ }
146
+
147
+ export namespace ContactOptedInWebhookEvent {
148
+ /**
149
+ * The data associated with the event
150
+ */
151
+ export interface Data {
152
+ /**
153
+ * The unique identifier for the contact
154
+ */
155
+ id: string;
156
+ }
157
+ }
158
+
159
+ export interface ContactOptedOutWebhookEvent {
160
+ /**
161
+ * The ID of the account in which this event occurred
162
+ */
163
+ account_id: string;
164
+
165
+ /**
166
+ * The data associated with the event
167
+ */
168
+ data: ContactOptedOutWebhookEvent.Data;
169
+
170
+ /**
171
+ * The timestamp when this event occurred, in ISO8601 format
172
+ */
173
+ timestamp: string;
174
+
175
+ /**
176
+ * The type of the event. Always `contact.opted_out` for this event.
177
+ */
178
+ type: 'contact.opted_out';
179
+ }
180
+
181
+ export namespace ContactOptedOutWebhookEvent {
182
+ /**
183
+ * The data associated with the event
184
+ */
185
+ export interface Data {
186
+ /**
187
+ * The unique identifier for the contact
188
+ */
189
+ id: string;
190
+ }
191
+ }
192
+
140
193
  export interface ConversationCreatedWebhookEvent {
141
194
  /**
142
195
  * The ID of the account in which this event occurred
@@ -181,14 +234,6 @@ export namespace ConversationCreatedWebhookEvent {
181
234
  }
182
235
  }
183
236
 
184
- /**
185
- * The `message.delivered` event is delivered whenever a message sent from a Surge
186
- * number is successfully delivered to the recipient. When the message is sent from
187
- * a short code or toll-free number, this means that the message arrived on the
188
- * recipient's device. When sent from a local number, this means that the message
189
- * was successfully handed off to the recipient's mobile carrier, but does not
190
- * guarantee that it arrived on the recipient's device.
191
- */
192
237
  export interface MessageDeliveredWebhookEvent {
193
238
  /**
194
239
  * The ID of the account in which this event occurred
@@ -282,10 +327,6 @@ export namespace MessageDeliveredWebhookEvent {
282
327
  }
283
328
  }
284
329
 
285
- /**
286
- * The `message.failed` event is delivered whenever a message sent from your Surge
287
- * number fails to be delivered.
288
- */
289
330
  export interface MessageFailedWebhookEvent {
290
331
  /**
291
332
  * The ID of the account in which this event occurred
@@ -384,10 +425,6 @@ export namespace MessageFailedWebhookEvent {
384
425
  }
385
426
  }
386
427
 
387
- /**
388
- * The `message.received` event is delivered whenever a message is received at a
389
- * Surge number from a contact.
390
- */
391
428
  export interface MessageReceivedWebhookEvent {
392
429
  /**
393
430
  * The ID of the account in which this event occurred
@@ -481,10 +518,6 @@ export namespace MessageReceivedWebhookEvent {
481
518
  }
482
519
  }
483
520
 
484
- /**
485
- * The `message.sent` event is delivered whenever a message is sent from a Surge
486
- * number to a contact.
487
- */
488
521
  export interface MessageSentWebhookEvent {
489
522
  /**
490
523
  * The ID of the account in which this event occurred
@@ -578,13 +611,11 @@ export namespace MessageSentWebhookEvent {
578
611
  }
579
612
  }
580
613
 
581
- /**
582
- * The `call.ended` event is delivered whenever a call is completed between a Surge
583
- * number you own and another phone number.
584
- */
585
614
  export type UnwrapWebhookEvent =
586
615
  | CallEndedWebhookEvent
587
616
  | CampaignApprovedWebhookEvent
617
+ | ContactOptedInWebhookEvent
618
+ | ContactOptedOutWebhookEvent
588
619
  | ConversationCreatedWebhookEvent
589
620
  | MessageDeliveredWebhookEvent
590
621
  | MessageFailedWebhookEvent
@@ -595,6 +626,8 @@ export declare namespace Webhooks {
595
626
  export {
596
627
  type CallEndedWebhookEvent as CallEndedWebhookEvent,
597
628
  type CampaignApprovedWebhookEvent as CampaignApprovedWebhookEvent,
629
+ type ContactOptedInWebhookEvent as ContactOptedInWebhookEvent,
630
+ type ContactOptedOutWebhookEvent as ContactOptedOutWebhookEvent,
598
631
  type ConversationCreatedWebhookEvent as ConversationCreatedWebhookEvent,
599
632
  type MessageDeliveredWebhookEvent as MessageDeliveredWebhookEvent,
600
633
  type MessageFailedWebhookEvent as MessageFailedWebhookEvent,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.26.0'; // x-release-please-version
1
+ export const VERSION = '0.27.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.26.0";
1
+ export declare const VERSION = "0.27.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.26.0";
1
+ export declare const VERSION = "0.27.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.26.0'; // x-release-please-version
4
+ exports.VERSION = '0.27.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.26.0'; // x-release-please-version
1
+ export const VERSION = '0.27.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map