@surgeapi/node 0.26.0 → 0.27.1
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.
- package/CHANGELOG.md +44 -0
- package/client.d.mts +16 -16
- package/client.d.mts.map +1 -1
- package/client.d.ts +16 -16
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs +2 -2
- package/client.mjs.map +1 -1
- package/internal/to-file.d.mts +1 -1
- package/internal/to-file.d.ts +1 -1
- package/internal/to-file.js +1 -1
- package/internal/to-file.mjs +1 -1
- package/package.json +1 -1
- package/resources/accounts.d.mts +306 -191
- package/resources/accounts.d.mts.map +1 -1
- package/resources/accounts.d.ts +306 -191
- package/resources/accounts.d.ts.map +1 -1
- package/resources/blasts.d.mts +11 -32
- package/resources/blasts.d.mts.map +1 -1
- package/resources/blasts.d.ts +11 -32
- package/resources/blasts.d.ts.map +1 -1
- package/resources/blasts.js.map +1 -1
- package/resources/blasts.mjs.map +1 -1
- package/resources/campaigns.d.mts +108 -201
- package/resources/campaigns.d.mts.map +1 -1
- package/resources/campaigns.d.ts +108 -201
- package/resources/campaigns.d.ts.map +1 -1
- package/resources/contacts.d.mts +1 -28
- package/resources/contacts.d.mts.map +1 -1
- package/resources/contacts.d.ts +1 -28
- package/resources/contacts.d.ts.map +1 -1
- package/resources/index.d.mts +8 -8
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +8 -8
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -2
- package/resources/index.mjs.map +1 -1
- package/resources/messages.d.mts +49 -81
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +49 -81
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs.map +1 -1
- package/resources/phone-numbers.d.mts +0 -30
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +0 -30
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/users.d.mts +1 -33
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +1 -33
- package/resources/users.d.ts.map +1 -1
- package/resources/verifications.d.mts +1 -19
- package/resources/verifications.d.mts.map +1 -1
- package/resources/verifications.d.ts +1 -19
- package/resources/verifications.d.ts.map +1 -1
- package/resources/webhooks.d.mts +60 -41
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +60 -41
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +12 -43
- package/src/internal/to-file.ts +1 -1
- package/src/resources/accounts.ts +489 -284
- package/src/resources/blasts.ts +11 -42
- package/src/resources/campaigns.ts +121 -234
- package/src/resources/contacts.ts +0 -31
- package/src/resources/index.ts +8 -23
- package/src/resources/messages.ts +54 -99
- package/src/resources/phone-numbers.ts +0 -34
- package/src/resources/users.ts +0 -37
- package/src/resources/verifications.ts +1 -22
- package/src/resources/webhooks.ts +72 -39
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifications.d.mts","sourceRoot":"","sources":["../src/resources/verifications.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAI,EAAE,wBAAwB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,YAAY,CAAC;IAI1F;;;;;;;;;;OAUG;IACH,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;CAG1G;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAE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,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
|
|
@@ -60,24 +60,6 @@ export interface VerificationCheck {
|
|
|
60
60
|
*/
|
|
61
61
|
verification?: Verification;
|
|
62
62
|
}
|
|
63
|
-
/**
|
|
64
|
-
* Parameters for checking a Verification code
|
|
65
|
-
*/
|
|
66
|
-
export interface VerificationCheckParams {
|
|
67
|
-
/**
|
|
68
|
-
* The Verification code that was received.
|
|
69
|
-
*/
|
|
70
|
-
code: string;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Parameters for creating a Verification
|
|
74
|
-
*/
|
|
75
|
-
export interface VerificationParams {
|
|
76
|
-
/**
|
|
77
|
-
* The phone number to be verified. In E.164 format.
|
|
78
|
-
*/
|
|
79
|
-
phone_number: string;
|
|
80
|
-
}
|
|
81
63
|
export interface VerificationCreateParams {
|
|
82
64
|
/**
|
|
83
65
|
* The phone number to be verified. In E.164 format.
|
|
@@ -91,6 +73,6 @@ export interface VerificationCheckParams {
|
|
|
91
73
|
code: string;
|
|
92
74
|
}
|
|
93
75
|
export declare namespace Verifications {
|
|
94
|
-
export { type Verification as Verification, type VerificationCheck as VerificationCheck, type
|
|
76
|
+
export { type Verification as Verification, type VerificationCheck as VerificationCheck, type VerificationCreateParams as VerificationCreateParams, type VerificationCheckParams as VerificationCheckParams, };
|
|
95
77
|
}
|
|
96
78
|
//# sourceMappingURL=verifications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifications.d.ts","sourceRoot":"","sources":["../src/resources/verifications.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAI,EAAE,wBAAwB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,YAAY,CAAC;IAI1F;;;;;;;;;;OAUG;IACH,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;CAG1G;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;CAC1D;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,CAAC,EAAE,IAAI,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,GAAG,kBAAkB,CAAC;IAE3E;;OAEG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED
|
|
1
|
+
{"version":3,"file":"verifications.d.ts","sourceRoot":"","sources":["../src/resources/verifications.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAI,EAAE,wBAAwB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,YAAY,CAAC;IAI1F;;;;;;;;;;OAUG;IACH,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;CAG1G;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;CAC1D;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,CAAC,EAAE,IAAI,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,GAAG,kBAAkB,CAAC;IAE3E;;OAEG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
|
package/resources/webhooks.d.mts
CHANGED
|
@@ -7,10 +7,6 @@ export declare class Webhooks extends APIResource {
|
|
|
7
7
|
key?: string;
|
|
8
8
|
}): UnwrapWebhookEvent;
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
11
|
-
* The `call.ended` event is delivered whenever a call is completed between a Surge
|
|
12
|
-
* number you own and another phone number.
|
|
13
|
-
*/
|
|
14
10
|
export interface CallEndedWebhookEvent {
|
|
15
11
|
/**
|
|
16
12
|
* The ID of the account in which this event occurred
|
|
@@ -56,10 +52,6 @@ export declare namespace CallEndedWebhookEvent {
|
|
|
56
52
|
status: 'busy' | 'canceled' | 'completed' | 'failed' | 'in_progress' | 'missed' | 'no_answer' | 'queued' | 'ringing';
|
|
57
53
|
}
|
|
58
54
|
}
|
|
59
|
-
/**
|
|
60
|
-
* The `campaign.approved` event is delivered whenever a campaign is approved by
|
|
61
|
-
* all of the US carriers and able to start sending text messages.
|
|
62
|
-
*/
|
|
63
55
|
export interface CampaignApprovedWebhookEvent {
|
|
64
56
|
/**
|
|
65
57
|
* The ID of the account in which this event occurred
|
|
@@ -93,13 +85,64 @@ export declare namespace CampaignApprovedWebhookEvent {
|
|
|
93
85
|
status: 'active';
|
|
94
86
|
}
|
|
95
87
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
88
|
+
export interface ContactOptedInWebhookEvent {
|
|
89
|
+
/**
|
|
90
|
+
* The ID of the account in which this event occurred
|
|
91
|
+
*/
|
|
92
|
+
account_id: string;
|
|
93
|
+
/**
|
|
94
|
+
* The data associated with the event
|
|
95
|
+
*/
|
|
96
|
+
data: ContactOptedInWebhookEvent.Data;
|
|
97
|
+
/**
|
|
98
|
+
* The timestamp when this event occurred, in ISO8601 format
|
|
99
|
+
*/
|
|
100
|
+
timestamp: string;
|
|
101
|
+
/**
|
|
102
|
+
* The type of the event. Always `contact.opted_in` for this event.
|
|
103
|
+
*/
|
|
104
|
+
type: 'contact.opted_in';
|
|
105
|
+
}
|
|
106
|
+
export declare namespace ContactOptedInWebhookEvent {
|
|
107
|
+
/**
|
|
108
|
+
* The data associated with the event
|
|
109
|
+
*/
|
|
110
|
+
interface Data {
|
|
111
|
+
/**
|
|
112
|
+
* The unique identifier for the contact
|
|
113
|
+
*/
|
|
114
|
+
id: string;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
export interface ContactOptedOutWebhookEvent {
|
|
118
|
+
/**
|
|
119
|
+
* The ID of the account in which this event occurred
|
|
120
|
+
*/
|
|
121
|
+
account_id: string;
|
|
122
|
+
/**
|
|
123
|
+
* The data associated with the event
|
|
124
|
+
*/
|
|
125
|
+
data: ContactOptedOutWebhookEvent.Data;
|
|
126
|
+
/**
|
|
127
|
+
* The timestamp when this event occurred, in ISO8601 format
|
|
128
|
+
*/
|
|
129
|
+
timestamp: string;
|
|
130
|
+
/**
|
|
131
|
+
* The type of the event. Always `contact.opted_out` for this event.
|
|
132
|
+
*/
|
|
133
|
+
type: 'contact.opted_out';
|
|
134
|
+
}
|
|
135
|
+
export declare namespace ContactOptedOutWebhookEvent {
|
|
136
|
+
/**
|
|
137
|
+
* The data associated with the event
|
|
138
|
+
*/
|
|
139
|
+
interface Data {
|
|
140
|
+
/**
|
|
141
|
+
* The unique identifier for the contact
|
|
142
|
+
*/
|
|
143
|
+
id: string;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
103
146
|
export interface ConversationCreatedWebhookEvent {
|
|
104
147
|
/**
|
|
105
148
|
* The ID of the account in which this event occurred
|
|
@@ -137,14 +180,6 @@ export declare namespace ConversationCreatedWebhookEvent {
|
|
|
137
180
|
phone_number: PhoneNumbersAPI.PhoneNumber;
|
|
138
181
|
}
|
|
139
182
|
}
|
|
140
|
-
/**
|
|
141
|
-
* The `message.delivered` event is delivered whenever a message sent from a Surge
|
|
142
|
-
* number is successfully delivered to the recipient. When the message is sent from
|
|
143
|
-
* a short code or toll-free number, this means that the message arrived on the
|
|
144
|
-
* recipient's device. When sent from a local number, this means that the message
|
|
145
|
-
* was successfully handed off to the recipient's mobile carrier, but does not
|
|
146
|
-
* guarantee that it arrived on the recipient's device.
|
|
147
|
-
*/
|
|
148
183
|
export interface MessageDeliveredWebhookEvent {
|
|
149
184
|
/**
|
|
150
185
|
* The ID of the account in which this event occurred
|
|
@@ -223,10 +258,6 @@ export declare namespace MessageDeliveredWebhookEvent {
|
|
|
223
258
|
}
|
|
224
259
|
}
|
|
225
260
|
}
|
|
226
|
-
/**
|
|
227
|
-
* The `message.failed` event is delivered whenever a message sent from your Surge
|
|
228
|
-
* number fails to be delivered.
|
|
229
|
-
*/
|
|
230
261
|
export interface MessageFailedWebhookEvent {
|
|
231
262
|
/**
|
|
232
263
|
* The ID of the account in which this event occurred
|
|
@@ -309,10 +340,6 @@ export declare namespace MessageFailedWebhookEvent {
|
|
|
309
340
|
}
|
|
310
341
|
}
|
|
311
342
|
}
|
|
312
|
-
/**
|
|
313
|
-
* The `message.received` event is delivered whenever a message is received at a
|
|
314
|
-
* Surge number from a contact.
|
|
315
|
-
*/
|
|
316
343
|
export interface MessageReceivedWebhookEvent {
|
|
317
344
|
/**
|
|
318
345
|
* The ID of the account in which this event occurred
|
|
@@ -391,10 +418,6 @@ export declare namespace MessageReceivedWebhookEvent {
|
|
|
391
418
|
}
|
|
392
419
|
}
|
|
393
420
|
}
|
|
394
|
-
/**
|
|
395
|
-
* The `message.sent` event is delivered whenever a message is sent from a Surge
|
|
396
|
-
* number to a contact.
|
|
397
|
-
*/
|
|
398
421
|
export interface MessageSentWebhookEvent {
|
|
399
422
|
/**
|
|
400
423
|
* The ID of the account in which this event occurred
|
|
@@ -473,12 +496,8 @@ export declare namespace MessageSentWebhookEvent {
|
|
|
473
496
|
}
|
|
474
497
|
}
|
|
475
498
|
}
|
|
476
|
-
|
|
477
|
-
* The `call.ended` event is delivered whenever a call is completed between a Surge
|
|
478
|
-
* number you own and another phone number.
|
|
479
|
-
*/
|
|
480
|
-
export type UnwrapWebhookEvent = CallEndedWebhookEvent | CampaignApprovedWebhookEvent | ConversationCreatedWebhookEvent | MessageDeliveredWebhookEvent | MessageFailedWebhookEvent | MessageReceivedWebhookEvent | MessageSentWebhookEvent;
|
|
499
|
+
export type UnwrapWebhookEvent = CallEndedWebhookEvent | CampaignApprovedWebhookEvent | ContactOptedInWebhookEvent | ContactOptedOutWebhookEvent | ConversationCreatedWebhookEvent | MessageDeliveredWebhookEvent | MessageFailedWebhookEvent | MessageReceivedWebhookEvent | MessageSentWebhookEvent;
|
|
481
500
|
export declare namespace Webhooks {
|
|
482
|
-
export { type CallEndedWebhookEvent as CallEndedWebhookEvent, type CampaignApprovedWebhookEvent as CampaignApprovedWebhookEvent, type ConversationCreatedWebhookEvent as ConversationCreatedWebhookEvent, type MessageDeliveredWebhookEvent as MessageDeliveredWebhookEvent, type MessageFailedWebhookEvent as MessageFailedWebhookEvent, type MessageReceivedWebhookEvent as MessageReceivedWebhookEvent, type MessageSentWebhookEvent as MessageSentWebhookEvent, type UnwrapWebhookEvent as UnwrapWebhookEvent, };
|
|
501
|
+
export { type CallEndedWebhookEvent as CallEndedWebhookEvent, type CampaignApprovedWebhookEvent as CampaignApprovedWebhookEvent, type ContactOptedInWebhookEvent as ContactOptedInWebhookEvent, type ContactOptedOutWebhookEvent as ContactOptedOutWebhookEvent, type ConversationCreatedWebhookEvent as ConversationCreatedWebhookEvent, type MessageDeliveredWebhookEvent as MessageDeliveredWebhookEvent, type MessageFailedWebhookEvent as MessageFailedWebhookEvent, type MessageReceivedWebhookEvent as MessageReceivedWebhookEvent, type MessageSentWebhookEvent as MessageSentWebhookEvent, type UnwrapWebhookEvent as UnwrapWebhookEvent, };
|
|
483
502
|
}
|
|
484
503
|
//# sourceMappingURL=webhooks.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.d.mts","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,KAAK,eAAe;AAG3B,qBAAa,QAAS,SAAQ,WAAW;IACvC,MAAM,CACJ,IAAI,EAAE,MAAM,EACZ,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,GAClE,kBAAkB;CAStB;AAED
|
|
1
|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G;YACH,EAAE,EAAE,MAAM,CAAC;YAEX;;eAEG;YACH,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;YAE1C;;eAEG;YACH,GAAG,EAAE,MAAM,CAAC;SACb;KACF;CACF;AAED,MAAM,MAAM,kBAAkB,GAC1B,qBAAqB,GACrB,4BAA4B,GAC5B,0BAA0B,GAC1B,2BAA2B,GAC3B,+BAA+B,GAC/B,4BAA4B,GAC5B,yBAAyB,GACzB,2BAA2B,GAC3B,uBAAuB,CAAC;AAE5B,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
|
package/resources/webhooks.d.ts
CHANGED
|
@@ -7,10 +7,6 @@ export declare class Webhooks extends APIResource {
|
|
|
7
7
|
key?: string;
|
|
8
8
|
}): UnwrapWebhookEvent;
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
11
|
-
* The `call.ended` event is delivered whenever a call is completed between a Surge
|
|
12
|
-
* number you own and another phone number.
|
|
13
|
-
*/
|
|
14
10
|
export interface CallEndedWebhookEvent {
|
|
15
11
|
/**
|
|
16
12
|
* The ID of the account in which this event occurred
|
|
@@ -56,10 +52,6 @@ export declare namespace CallEndedWebhookEvent {
|
|
|
56
52
|
status: 'busy' | 'canceled' | 'completed' | 'failed' | 'in_progress' | 'missed' | 'no_answer' | 'queued' | 'ringing';
|
|
57
53
|
}
|
|
58
54
|
}
|
|
59
|
-
/**
|
|
60
|
-
* The `campaign.approved` event is delivered whenever a campaign is approved by
|
|
61
|
-
* all of the US carriers and able to start sending text messages.
|
|
62
|
-
*/
|
|
63
55
|
export interface CampaignApprovedWebhookEvent {
|
|
64
56
|
/**
|
|
65
57
|
* The ID of the account in which this event occurred
|
|
@@ -93,13 +85,64 @@ export declare namespace CampaignApprovedWebhookEvent {
|
|
|
93
85
|
status: 'active';
|
|
94
86
|
}
|
|
95
87
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
88
|
+
export interface ContactOptedInWebhookEvent {
|
|
89
|
+
/**
|
|
90
|
+
* The ID of the account in which this event occurred
|
|
91
|
+
*/
|
|
92
|
+
account_id: string;
|
|
93
|
+
/**
|
|
94
|
+
* The data associated with the event
|
|
95
|
+
*/
|
|
96
|
+
data: ContactOptedInWebhookEvent.Data;
|
|
97
|
+
/**
|
|
98
|
+
* The timestamp when this event occurred, in ISO8601 format
|
|
99
|
+
*/
|
|
100
|
+
timestamp: string;
|
|
101
|
+
/**
|
|
102
|
+
* The type of the event. Always `contact.opted_in` for this event.
|
|
103
|
+
*/
|
|
104
|
+
type: 'contact.opted_in';
|
|
105
|
+
}
|
|
106
|
+
export declare namespace ContactOptedInWebhookEvent {
|
|
107
|
+
/**
|
|
108
|
+
* The data associated with the event
|
|
109
|
+
*/
|
|
110
|
+
interface Data {
|
|
111
|
+
/**
|
|
112
|
+
* The unique identifier for the contact
|
|
113
|
+
*/
|
|
114
|
+
id: string;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
export interface ContactOptedOutWebhookEvent {
|
|
118
|
+
/**
|
|
119
|
+
* The ID of the account in which this event occurred
|
|
120
|
+
*/
|
|
121
|
+
account_id: string;
|
|
122
|
+
/**
|
|
123
|
+
* The data associated with the event
|
|
124
|
+
*/
|
|
125
|
+
data: ContactOptedOutWebhookEvent.Data;
|
|
126
|
+
/**
|
|
127
|
+
* The timestamp when this event occurred, in ISO8601 format
|
|
128
|
+
*/
|
|
129
|
+
timestamp: string;
|
|
130
|
+
/**
|
|
131
|
+
* The type of the event. Always `contact.opted_out` for this event.
|
|
132
|
+
*/
|
|
133
|
+
type: 'contact.opted_out';
|
|
134
|
+
}
|
|
135
|
+
export declare namespace ContactOptedOutWebhookEvent {
|
|
136
|
+
/**
|
|
137
|
+
* The data associated with the event
|
|
138
|
+
*/
|
|
139
|
+
interface Data {
|
|
140
|
+
/**
|
|
141
|
+
* The unique identifier for the contact
|
|
142
|
+
*/
|
|
143
|
+
id: string;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
103
146
|
export interface ConversationCreatedWebhookEvent {
|
|
104
147
|
/**
|
|
105
148
|
* The ID of the account in which this event occurred
|
|
@@ -137,14 +180,6 @@ export declare namespace ConversationCreatedWebhookEvent {
|
|
|
137
180
|
phone_number: PhoneNumbersAPI.PhoneNumber;
|
|
138
181
|
}
|
|
139
182
|
}
|
|
140
|
-
/**
|
|
141
|
-
* The `message.delivered` event is delivered whenever a message sent from a Surge
|
|
142
|
-
* number is successfully delivered to the recipient. When the message is sent from
|
|
143
|
-
* a short code or toll-free number, this means that the message arrived on the
|
|
144
|
-
* recipient's device. When sent from a local number, this means that the message
|
|
145
|
-
* was successfully handed off to the recipient's mobile carrier, but does not
|
|
146
|
-
* guarantee that it arrived on the recipient's device.
|
|
147
|
-
*/
|
|
148
183
|
export interface MessageDeliveredWebhookEvent {
|
|
149
184
|
/**
|
|
150
185
|
* The ID of the account in which this event occurred
|
|
@@ -223,10 +258,6 @@ export declare namespace MessageDeliveredWebhookEvent {
|
|
|
223
258
|
}
|
|
224
259
|
}
|
|
225
260
|
}
|
|
226
|
-
/**
|
|
227
|
-
* The `message.failed` event is delivered whenever a message sent from your Surge
|
|
228
|
-
* number fails to be delivered.
|
|
229
|
-
*/
|
|
230
261
|
export interface MessageFailedWebhookEvent {
|
|
231
262
|
/**
|
|
232
263
|
* The ID of the account in which this event occurred
|
|
@@ -309,10 +340,6 @@ export declare namespace MessageFailedWebhookEvent {
|
|
|
309
340
|
}
|
|
310
341
|
}
|
|
311
342
|
}
|
|
312
|
-
/**
|
|
313
|
-
* The `message.received` event is delivered whenever a message is received at a
|
|
314
|
-
* Surge number from a contact.
|
|
315
|
-
*/
|
|
316
343
|
export interface MessageReceivedWebhookEvent {
|
|
317
344
|
/**
|
|
318
345
|
* The ID of the account in which this event occurred
|
|
@@ -391,10 +418,6 @@ export declare namespace MessageReceivedWebhookEvent {
|
|
|
391
418
|
}
|
|
392
419
|
}
|
|
393
420
|
}
|
|
394
|
-
/**
|
|
395
|
-
* The `message.sent` event is delivered whenever a message is sent from a Surge
|
|
396
|
-
* number to a contact.
|
|
397
|
-
*/
|
|
398
421
|
export interface MessageSentWebhookEvent {
|
|
399
422
|
/**
|
|
400
423
|
* The ID of the account in which this event occurred
|
|
@@ -473,12 +496,8 @@ export declare namespace MessageSentWebhookEvent {
|
|
|
473
496
|
}
|
|
474
497
|
}
|
|
475
498
|
}
|
|
476
|
-
|
|
477
|
-
* The `call.ended` event is delivered whenever a call is completed between a Surge
|
|
478
|
-
* number you own and another phone number.
|
|
479
|
-
*/
|
|
480
|
-
export type UnwrapWebhookEvent = CallEndedWebhookEvent | CampaignApprovedWebhookEvent | ConversationCreatedWebhookEvent | MessageDeliveredWebhookEvent | MessageFailedWebhookEvent | MessageReceivedWebhookEvent | MessageSentWebhookEvent;
|
|
499
|
+
export type UnwrapWebhookEvent = CallEndedWebhookEvent | CampaignApprovedWebhookEvent | ContactOptedInWebhookEvent | ContactOptedOutWebhookEvent | ConversationCreatedWebhookEvent | MessageDeliveredWebhookEvent | MessageFailedWebhookEvent | MessageReceivedWebhookEvent | MessageSentWebhookEvent;
|
|
481
500
|
export declare namespace Webhooks {
|
|
482
|
-
export { type CallEndedWebhookEvent as CallEndedWebhookEvent, type CampaignApprovedWebhookEvent as CampaignApprovedWebhookEvent, type ConversationCreatedWebhookEvent as ConversationCreatedWebhookEvent, type MessageDeliveredWebhookEvent as MessageDeliveredWebhookEvent, type MessageFailedWebhookEvent as MessageFailedWebhookEvent, type MessageReceivedWebhookEvent as MessageReceivedWebhookEvent, type MessageSentWebhookEvent as MessageSentWebhookEvent, type UnwrapWebhookEvent as UnwrapWebhookEvent, };
|
|
501
|
+
export { type CallEndedWebhookEvent as CallEndedWebhookEvent, type CampaignApprovedWebhookEvent as CampaignApprovedWebhookEvent, type ContactOptedInWebhookEvent as ContactOptedInWebhookEvent, type ContactOptedOutWebhookEvent as ContactOptedOutWebhookEvent, type ConversationCreatedWebhookEvent as ConversationCreatedWebhookEvent, type MessageDeliveredWebhookEvent as MessageDeliveredWebhookEvent, type MessageFailedWebhookEvent as MessageFailedWebhookEvent, type MessageReceivedWebhookEvent as MessageReceivedWebhookEvent, type MessageSentWebhookEvent as MessageSentWebhookEvent, type UnwrapWebhookEvent as UnwrapWebhookEvent, };
|
|
483
502
|
}
|
|
484
503
|
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,KAAK,eAAe;AAG3B,qBAAa,QAAS,SAAQ,WAAW;IACvC,MAAM,CACJ,IAAI,EAAE,MAAM,EACZ,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,GAClE,kBAAkB;CAStB;AAED
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,KAAK,eAAe;AAG3B,qBAAa,QAAS,SAAQ,WAAW;IACv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,MAAM,MAAM,kBAAkB,GAC1B,qBAAqB,GACrB,4BAA4B,GAC5B,0BAA0B,GAC1B,2BAA2B,GAC3B,+BAA+B,GAC/B,4BAA4B,GAC5B,yBAAyB,GACzB,2BAA2B,GAC3B,uBAAuB,CAAC;AAE5B,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
|
package/src/client.ts
CHANGED
|
@@ -20,37 +20,21 @@ import { APIPromise } from './core/api-promise';
|
|
|
20
20
|
import {
|
|
21
21
|
Account,
|
|
22
22
|
AccountCreateParams,
|
|
23
|
-
AccountParams,
|
|
24
23
|
AccountRetrieveStatusParams,
|
|
25
24
|
AccountStatus,
|
|
26
25
|
AccountUpdateParams,
|
|
27
26
|
Accounts,
|
|
28
27
|
Organization,
|
|
29
|
-
OrganizationParams,
|
|
30
28
|
} from './resources/accounts';
|
|
31
|
-
import { Blast, BlastCreateParams,
|
|
32
|
-
import { Campaign, CampaignCreateParams,
|
|
33
|
-
import {
|
|
34
|
-
|
|
35
|
-
ContactCreateParams,
|
|
36
|
-
ContactParams,
|
|
37
|
-
ContactUpdateParams,
|
|
38
|
-
Contacts,
|
|
39
|
-
} from './resources/contacts';
|
|
40
|
-
import {
|
|
41
|
-
AttachmentParams,
|
|
42
|
-
Message,
|
|
43
|
-
MessageCreateParams,
|
|
44
|
-
MessageParams,
|
|
45
|
-
Messages,
|
|
46
|
-
} from './resources/messages';
|
|
29
|
+
import { Blast, BlastCreateParams, Blasts } from './resources/blasts';
|
|
30
|
+
import { Campaign, CampaignCreateParams, Campaigns } from './resources/campaigns';
|
|
31
|
+
import { Contact, ContactCreateParams, ContactUpdateParams, Contacts } from './resources/contacts';
|
|
32
|
+
import { Message, MessageCreateParams, Messages } from './resources/messages';
|
|
47
33
|
import { PhoneNumber, PhoneNumberPurchaseParams, PhoneNumbers } from './resources/phone-numbers';
|
|
48
34
|
import {
|
|
49
35
|
User,
|
|
50
36
|
UserCreateParams,
|
|
51
37
|
UserCreateTokenParams,
|
|
52
|
-
UserParams,
|
|
53
|
-
UserTokenParams,
|
|
54
38
|
UserTokenResponse,
|
|
55
39
|
UserUpdateParams,
|
|
56
40
|
Users,
|
|
@@ -60,12 +44,13 @@ import {
|
|
|
60
44
|
VerificationCheck,
|
|
61
45
|
VerificationCheckParams,
|
|
62
46
|
VerificationCreateParams,
|
|
63
|
-
VerificationParams,
|
|
64
47
|
Verifications,
|
|
65
48
|
} from './resources/verifications';
|
|
66
49
|
import {
|
|
67
50
|
CallEndedWebhookEvent,
|
|
68
51
|
CampaignApprovedWebhookEvent,
|
|
52
|
+
ContactOptedInWebhookEvent,
|
|
53
|
+
ContactOptedOutWebhookEvent,
|
|
69
54
|
ConversationCreatedWebhookEvent,
|
|
70
55
|
MessageDeliveredWebhookEvent,
|
|
71
56
|
MessageFailedWebhookEvent,
|
|
@@ -793,44 +778,29 @@ export declare namespace Surge {
|
|
|
793
778
|
export {
|
|
794
779
|
Accounts as Accounts,
|
|
795
780
|
type Account as Account,
|
|
796
|
-
type AccountParams as AccountParams,
|
|
797
781
|
type AccountStatus as AccountStatus,
|
|
798
|
-
type AccountUpdateParams as AccountUpdateParams,
|
|
799
782
|
type Organization as Organization,
|
|
800
|
-
type OrganizationParams as OrganizationParams,
|
|
801
783
|
type AccountCreateParams as AccountCreateParams,
|
|
784
|
+
type AccountUpdateParams as AccountUpdateParams,
|
|
802
785
|
type AccountRetrieveStatusParams as AccountRetrieveStatusParams,
|
|
803
786
|
};
|
|
804
787
|
|
|
805
|
-
export {
|
|
806
|
-
Blasts as Blasts,
|
|
807
|
-
type Blast as Blast,
|
|
808
|
-
type BlastParams as BlastParams,
|
|
809
|
-
type BlastCreateParams as BlastCreateParams,
|
|
810
|
-
};
|
|
788
|
+
export { Blasts as Blasts, type Blast as Blast, type BlastCreateParams as BlastCreateParams };
|
|
811
789
|
|
|
812
790
|
export {
|
|
813
791
|
Campaigns as Campaigns,
|
|
814
792
|
type Campaign as Campaign,
|
|
815
|
-
type CampaignParams as CampaignParams,
|
|
816
793
|
type CampaignCreateParams as CampaignCreateParams,
|
|
817
794
|
};
|
|
818
795
|
|
|
819
796
|
export {
|
|
820
797
|
Contacts as Contacts,
|
|
821
798
|
type Contact as Contact,
|
|
822
|
-
type ContactParams as ContactParams,
|
|
823
799
|
type ContactCreateParams as ContactCreateParams,
|
|
824
800
|
type ContactUpdateParams as ContactUpdateParams,
|
|
825
801
|
};
|
|
826
802
|
|
|
827
|
-
export {
|
|
828
|
-
Messages as Messages,
|
|
829
|
-
type AttachmentParams as AttachmentParams,
|
|
830
|
-
type Message as Message,
|
|
831
|
-
type MessageParams as MessageParams,
|
|
832
|
-
type MessageCreateParams as MessageCreateParams,
|
|
833
|
-
};
|
|
803
|
+
export { Messages as Messages, type Message as Message, type MessageCreateParams as MessageCreateParams };
|
|
834
804
|
|
|
835
805
|
export {
|
|
836
806
|
PhoneNumbers as PhoneNumbers,
|
|
@@ -841,8 +811,6 @@ export declare namespace Surge {
|
|
|
841
811
|
export {
|
|
842
812
|
Users as Users,
|
|
843
813
|
type User as User,
|
|
844
|
-
type UserParams as UserParams,
|
|
845
|
-
type UserTokenParams as UserTokenParams,
|
|
846
814
|
type UserTokenResponse as UserTokenResponse,
|
|
847
815
|
type UserCreateParams as UserCreateParams,
|
|
848
816
|
type UserUpdateParams as UserUpdateParams,
|
|
@@ -853,15 +821,16 @@ export declare namespace Surge {
|
|
|
853
821
|
Verifications as Verifications,
|
|
854
822
|
type Verification as Verification,
|
|
855
823
|
type VerificationCheck as VerificationCheck,
|
|
856
|
-
type VerificationCheckParams as VerificationCheckParams,
|
|
857
|
-
type VerificationParams as VerificationParams,
|
|
858
824
|
type VerificationCreateParams as VerificationCreateParams,
|
|
825
|
+
type VerificationCheckParams as VerificationCheckParams,
|
|
859
826
|
};
|
|
860
827
|
|
|
861
828
|
export {
|
|
862
829
|
Webhooks as Webhooks,
|
|
863
830
|
type CallEndedWebhookEvent as CallEndedWebhookEvent,
|
|
864
831
|
type CampaignApprovedWebhookEvent as CampaignApprovedWebhookEvent,
|
|
832
|
+
type ContactOptedInWebhookEvent as ContactOptedInWebhookEvent,
|
|
833
|
+
type ContactOptedOutWebhookEvent as ContactOptedOutWebhookEvent,
|
|
865
834
|
type ConversationCreatedWebhookEvent as ConversationCreatedWebhookEvent,
|
|
866
835
|
type MessageDeliveredWebhookEvent as MessageDeliveredWebhookEvent,
|
|
867
836
|
type MessageFailedWebhookEvent as MessageFailedWebhookEvent,
|
package/src/internal/to-file.ts
CHANGED
|
@@ -73,7 +73,7 @@ export type ToFileInput =
|
|
|
73
73
|
|
|
74
74
|
/**
|
|
75
75
|
* Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
|
|
76
|
-
* @param value the raw content of the file.
|
|
76
|
+
* @param value the raw content of the file. Can be an {@link Uploadable}, BlobLikePart, or AsyncIterable of BlobLikeParts
|
|
77
77
|
* @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
|
|
78
78
|
* @param {Object=} options additional properties
|
|
79
79
|
* @param {string=} options.type the MIME type of the content
|