@surgeapi/node 0.34.0 → 0.36.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.
- package/CHANGELOG.md +48 -0
- package/README.md +31 -0
- package/client.d.mts +18 -8
- package/client.d.mts.map +1 -1
- package/client.d.ts +18 -8
- package/client.d.ts.map +1 -1
- package/client.js +21 -2
- package/client.js.map +1 -1
- package/client.mjs +24 -5
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +60 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +60 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +115 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +109 -0
- package/core/pagination.mjs.map +1 -0
- package/index.d.mts +1 -0
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/package.json +11 -1
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resources/blasts.d.mts +4 -4
- package/resources/blasts.d.mts.map +1 -1
- package/resources/blasts.d.ts +4 -4
- package/resources/blasts.d.ts.map +1 -1
- package/resources/campaigns.d.mts +15 -0
- package/resources/campaigns.d.mts.map +1 -1
- package/resources/campaigns.d.ts +15 -0
- package/resources/campaigns.d.ts.map +1 -1
- package/resources/campaigns.js +13 -0
- package/resources/campaigns.js.map +1 -1
- package/resources/campaigns.mjs +13 -0
- package/resources/campaigns.mjs.map +1 -1
- package/resources/contacts.d.mts +19 -1
- package/resources/contacts.d.mts.map +1 -1
- package/resources/contacts.d.ts +19 -1
- package/resources/contacts.d.ts.map +1 -1
- package/resources/contacts.js +20 -0
- package/resources/contacts.js.map +1 -1
- package/resources/contacts.mjs +20 -0
- package/resources/contacts.mjs.map +1 -1
- package/resources/index.d.mts +5 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +5 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +4 -3
- package/resources/index.mjs.map +1 -1
- package/resources/messages.d.mts +21 -3
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +21 -3
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +20 -0
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +20 -0
- package/resources/messages.mjs.map +1 -1
- package/resources/phone-numbers.d.mts +19 -1
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +19 -1
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers.js +20 -0
- package/resources/phone-numbers.js.map +1 -1
- package/resources/phone-numbers.mjs +20 -0
- package/resources/phone-numbers.mjs.map +1 -1
- package/resources/recordings.d.mts +31 -0
- package/resources/recordings.d.mts.map +1 -0
- package/resources/recordings.d.ts +31 -0
- package/resources/recordings.d.ts.map +1 -0
- package/resources/recordings.js +24 -0
- package/resources/recordings.js.map +1 -0
- package/resources/recordings.mjs +20 -0
- package/resources/recordings.mjs.map +1 -0
- package/resources/webhooks.d.mts +138 -6
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +138 -6
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +80 -6
- package/src/core/pagination.ts +176 -0
- package/src/index.ts +1 -0
- package/src/internal/parse.ts +6 -0
- package/src/pagination.ts +2 -0
- package/src/resources/blasts.ts +4 -4
- package/src/resources/campaigns.ts +19 -0
- package/src/resources/contacts.ts +31 -0
- package/src/resources/index.ts +25 -3
- package/src/resources/messages.ts +37 -3
- package/src/resources/phone-numbers.ts +35 -1
- package/src/resources/recordings.ts +38 -0
- package/src/resources/webhooks.ts +184 -5
- 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
package/resources/webhooks.d.mts
CHANGED
|
@@ -247,7 +247,7 @@ export declare namespace MessageDeliveredWebhookEvent {
|
|
|
247
247
|
/**
|
|
248
248
|
* The content of the message
|
|
249
249
|
*/
|
|
250
|
-
body: string;
|
|
250
|
+
body: string | null;
|
|
251
251
|
/**
|
|
252
252
|
* The conversation this message belongs to
|
|
253
253
|
*/
|
|
@@ -330,7 +330,7 @@ export declare namespace MessageFailedWebhookEvent {
|
|
|
330
330
|
/**
|
|
331
331
|
* The content of the message
|
|
332
332
|
*/
|
|
333
|
-
body: string;
|
|
333
|
+
body: string | null;
|
|
334
334
|
/**
|
|
335
335
|
* The conversation this message belongs to
|
|
336
336
|
*/
|
|
@@ -417,7 +417,7 @@ export declare namespace MessageReceivedWebhookEvent {
|
|
|
417
417
|
/**
|
|
418
418
|
* The content of the message
|
|
419
419
|
*/
|
|
420
|
-
body: string;
|
|
420
|
+
body: string | null;
|
|
421
421
|
/**
|
|
422
422
|
* The conversation this message belongs to
|
|
423
423
|
*/
|
|
@@ -500,7 +500,7 @@ export declare namespace MessageSentWebhookEvent {
|
|
|
500
500
|
/**
|
|
501
501
|
* The content of the message
|
|
502
502
|
*/
|
|
503
|
-
body: string;
|
|
503
|
+
body: string | null;
|
|
504
504
|
/**
|
|
505
505
|
* The conversation this message belongs to
|
|
506
506
|
*/
|
|
@@ -553,8 +553,140 @@ export declare namespace MessageSentWebhookEvent {
|
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
|
-
export
|
|
556
|
+
export interface RecordingCompletedWebhookEvent {
|
|
557
|
+
/**
|
|
558
|
+
* The ID of the account in which this event occurred
|
|
559
|
+
*/
|
|
560
|
+
account_id: string;
|
|
561
|
+
/**
|
|
562
|
+
* The data associated with the event
|
|
563
|
+
*/
|
|
564
|
+
data: RecordingCompletedWebhookEvent.Data;
|
|
565
|
+
/**
|
|
566
|
+
* The timestamp when this event occurred, in ISO8601 format
|
|
567
|
+
*/
|
|
568
|
+
timestamp: string;
|
|
569
|
+
/**
|
|
570
|
+
* The type of the event. Always `recording.completed` for this event.
|
|
571
|
+
*/
|
|
572
|
+
type: 'recording.completed';
|
|
573
|
+
}
|
|
574
|
+
export declare namespace RecordingCompletedWebhookEvent {
|
|
575
|
+
/**
|
|
576
|
+
* The data associated with the event
|
|
577
|
+
*/
|
|
578
|
+
interface Data {
|
|
579
|
+
/**
|
|
580
|
+
* The unique identifier for the recording
|
|
581
|
+
*/
|
|
582
|
+
id: string;
|
|
583
|
+
/**
|
|
584
|
+
* The call that produced this recording
|
|
585
|
+
*/
|
|
586
|
+
call: Data.Call;
|
|
587
|
+
/**
|
|
588
|
+
* The duration of the recording in seconds
|
|
589
|
+
*/
|
|
590
|
+
duration: number;
|
|
591
|
+
}
|
|
592
|
+
namespace Data {
|
|
593
|
+
/**
|
|
594
|
+
* The call that produced this recording
|
|
595
|
+
*/
|
|
596
|
+
interface Call {
|
|
597
|
+
/**
|
|
598
|
+
* The unique identifier for the call
|
|
599
|
+
*/
|
|
600
|
+
id: string;
|
|
601
|
+
/**
|
|
602
|
+
* A contact who has consented to receive messages
|
|
603
|
+
*/
|
|
604
|
+
contact: ContactsAPI.Contact;
|
|
605
|
+
/**
|
|
606
|
+
* The duration of the call in seconds
|
|
607
|
+
*/
|
|
608
|
+
duration: number;
|
|
609
|
+
/**
|
|
610
|
+
* When the call was initiated
|
|
611
|
+
*/
|
|
612
|
+
initiated_at: string;
|
|
613
|
+
/**
|
|
614
|
+
* The status of the call
|
|
615
|
+
*/
|
|
616
|
+
status: 'busy' | 'canceled' | 'completed' | 'failed' | 'in_progress' | 'missed' | 'no_answer' | 'queued' | 'ringing';
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
export interface VoicemailReceivedWebhookEvent {
|
|
621
|
+
/**
|
|
622
|
+
* The ID of the account in which this event occurred
|
|
623
|
+
*/
|
|
624
|
+
account_id: string;
|
|
625
|
+
/**
|
|
626
|
+
* The data associated with the event
|
|
627
|
+
*/
|
|
628
|
+
data: VoicemailReceivedWebhookEvent.Data;
|
|
629
|
+
/**
|
|
630
|
+
* The timestamp when this event occurred, in ISO8601 format
|
|
631
|
+
*/
|
|
632
|
+
timestamp: string;
|
|
633
|
+
/**
|
|
634
|
+
* The type of the event. Always `voicemail.received` for this event.
|
|
635
|
+
*/
|
|
636
|
+
type: 'voicemail.received';
|
|
637
|
+
}
|
|
638
|
+
export declare namespace VoicemailReceivedWebhookEvent {
|
|
639
|
+
/**
|
|
640
|
+
* The data associated with the event
|
|
641
|
+
*/
|
|
642
|
+
interface Data {
|
|
643
|
+
/**
|
|
644
|
+
* The unique identifier for the voicemail
|
|
645
|
+
*/
|
|
646
|
+
id: string;
|
|
647
|
+
/**
|
|
648
|
+
* The call that resulted in this voicemail
|
|
649
|
+
*/
|
|
650
|
+
call: Data.Call;
|
|
651
|
+
/**
|
|
652
|
+
* The duration of the voicemail in seconds
|
|
653
|
+
*/
|
|
654
|
+
duration: number;
|
|
655
|
+
/**
|
|
656
|
+
* The unique identifier for the recording
|
|
657
|
+
*/
|
|
658
|
+
recording_id: string;
|
|
659
|
+
}
|
|
660
|
+
namespace Data {
|
|
661
|
+
/**
|
|
662
|
+
* The call that resulted in this voicemail
|
|
663
|
+
*/
|
|
664
|
+
interface Call {
|
|
665
|
+
/**
|
|
666
|
+
* The unique identifier for the call
|
|
667
|
+
*/
|
|
668
|
+
id: string;
|
|
669
|
+
/**
|
|
670
|
+
* A contact who has consented to receive messages
|
|
671
|
+
*/
|
|
672
|
+
contact: ContactsAPI.Contact;
|
|
673
|
+
/**
|
|
674
|
+
* The duration of the call in seconds
|
|
675
|
+
*/
|
|
676
|
+
duration: number;
|
|
677
|
+
/**
|
|
678
|
+
* When the call was initiated
|
|
679
|
+
*/
|
|
680
|
+
initiated_at: string;
|
|
681
|
+
/**
|
|
682
|
+
* The status of the call
|
|
683
|
+
*/
|
|
684
|
+
status: 'busy' | 'canceled' | 'completed' | 'failed' | 'in_progress' | 'missed' | 'no_answer' | 'queued' | 'ringing';
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
export type UnwrapWebhookEvent = CallEndedWebhookEvent | CampaignApprovedWebhookEvent | ContactOptedInWebhookEvent | ContactOptedOutWebhookEvent | ConversationCreatedWebhookEvent | LinkFollowedWebhookEvent | MessageDeliveredWebhookEvent | MessageFailedWebhookEvent | MessageReceivedWebhookEvent | MessageSentWebhookEvent | RecordingCompletedWebhookEvent | VoicemailReceivedWebhookEvent;
|
|
557
689
|
export declare namespace Webhooks {
|
|
558
|
-
export { type CallEndedWebhookEvent as CallEndedWebhookEvent, type CampaignApprovedWebhookEvent as CampaignApprovedWebhookEvent, type ContactOptedInWebhookEvent as ContactOptedInWebhookEvent, type ContactOptedOutWebhookEvent as ContactOptedOutWebhookEvent, type ConversationCreatedWebhookEvent as ConversationCreatedWebhookEvent, type LinkFollowedWebhookEvent as LinkFollowedWebhookEvent, type MessageDeliveredWebhookEvent as MessageDeliveredWebhookEvent, type MessageFailedWebhookEvent as MessageFailedWebhookEvent, type MessageReceivedWebhookEvent as MessageReceivedWebhookEvent, type MessageSentWebhookEvent as MessageSentWebhookEvent, type UnwrapWebhookEvent as UnwrapWebhookEvent, };
|
|
690
|
+
export { type CallEndedWebhookEvent as CallEndedWebhookEvent, type CampaignApprovedWebhookEvent as CampaignApprovedWebhookEvent, type ContactOptedInWebhookEvent as ContactOptedInWebhookEvent, type ContactOptedOutWebhookEvent as ContactOptedOutWebhookEvent, type ConversationCreatedWebhookEvent as ConversationCreatedWebhookEvent, type LinkFollowedWebhookEvent as LinkFollowedWebhookEvent, type MessageDeliveredWebhookEvent as MessageDeliveredWebhookEvent, type MessageFailedWebhookEvent as MessageFailedWebhookEvent, type MessageReceivedWebhookEvent as MessageReceivedWebhookEvent, type MessageSentWebhookEvent as MessageSentWebhookEvent, type RecordingCompletedWebhookEvent as RecordingCompletedWebhookEvent, type VoicemailReceivedWebhookEvent as VoicemailReceivedWebhookEvent, type UnwrapWebhookEvent as UnwrapWebhookEvent, };
|
|
559
691
|
}
|
|
560
692
|
//# 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,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE,qBAAqB,CAAC,IAAI,CAAC;IAEjC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,yBAAiB,qBAAqB,CAAC;IACrC;;OAEG;IACH,UAAiB,IAAI;QACnB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC;QAE7B;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,YAAY,EAAE,MAAM,CAAC;QAErB;;WAEG;QACH,MAAM,EACF,MAAM,GACN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B,4BAA4B,GAC5B,0BAA0B,GAC1B,2BAA2B,GAC3B,+BAA+B,GAC/B,wBAAwB,GACxB,4BAA4B,GAC5B,yBAAyB,GACzB,2BAA2B,GAC3B,uBAAuB,GACvB,8BAA8B,GAC9B,6BAA6B,CAAC;AAElC,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,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
|
package/resources/webhooks.d.ts
CHANGED
|
@@ -247,7 +247,7 @@ export declare namespace MessageDeliveredWebhookEvent {
|
|
|
247
247
|
/**
|
|
248
248
|
* The content of the message
|
|
249
249
|
*/
|
|
250
|
-
body: string;
|
|
250
|
+
body: string | null;
|
|
251
251
|
/**
|
|
252
252
|
* The conversation this message belongs to
|
|
253
253
|
*/
|
|
@@ -330,7 +330,7 @@ export declare namespace MessageFailedWebhookEvent {
|
|
|
330
330
|
/**
|
|
331
331
|
* The content of the message
|
|
332
332
|
*/
|
|
333
|
-
body: string;
|
|
333
|
+
body: string | null;
|
|
334
334
|
/**
|
|
335
335
|
* The conversation this message belongs to
|
|
336
336
|
*/
|
|
@@ -417,7 +417,7 @@ export declare namespace MessageReceivedWebhookEvent {
|
|
|
417
417
|
/**
|
|
418
418
|
* The content of the message
|
|
419
419
|
*/
|
|
420
|
-
body: string;
|
|
420
|
+
body: string | null;
|
|
421
421
|
/**
|
|
422
422
|
* The conversation this message belongs to
|
|
423
423
|
*/
|
|
@@ -500,7 +500,7 @@ export declare namespace MessageSentWebhookEvent {
|
|
|
500
500
|
/**
|
|
501
501
|
* The content of the message
|
|
502
502
|
*/
|
|
503
|
-
body: string;
|
|
503
|
+
body: string | null;
|
|
504
504
|
/**
|
|
505
505
|
* The conversation this message belongs to
|
|
506
506
|
*/
|
|
@@ -553,8 +553,140 @@ export declare namespace MessageSentWebhookEvent {
|
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
|
-
export
|
|
556
|
+
export interface RecordingCompletedWebhookEvent {
|
|
557
|
+
/**
|
|
558
|
+
* The ID of the account in which this event occurred
|
|
559
|
+
*/
|
|
560
|
+
account_id: string;
|
|
561
|
+
/**
|
|
562
|
+
* The data associated with the event
|
|
563
|
+
*/
|
|
564
|
+
data: RecordingCompletedWebhookEvent.Data;
|
|
565
|
+
/**
|
|
566
|
+
* The timestamp when this event occurred, in ISO8601 format
|
|
567
|
+
*/
|
|
568
|
+
timestamp: string;
|
|
569
|
+
/**
|
|
570
|
+
* The type of the event. Always `recording.completed` for this event.
|
|
571
|
+
*/
|
|
572
|
+
type: 'recording.completed';
|
|
573
|
+
}
|
|
574
|
+
export declare namespace RecordingCompletedWebhookEvent {
|
|
575
|
+
/**
|
|
576
|
+
* The data associated with the event
|
|
577
|
+
*/
|
|
578
|
+
interface Data {
|
|
579
|
+
/**
|
|
580
|
+
* The unique identifier for the recording
|
|
581
|
+
*/
|
|
582
|
+
id: string;
|
|
583
|
+
/**
|
|
584
|
+
* The call that produced this recording
|
|
585
|
+
*/
|
|
586
|
+
call: Data.Call;
|
|
587
|
+
/**
|
|
588
|
+
* The duration of the recording in seconds
|
|
589
|
+
*/
|
|
590
|
+
duration: number;
|
|
591
|
+
}
|
|
592
|
+
namespace Data {
|
|
593
|
+
/**
|
|
594
|
+
* The call that produced this recording
|
|
595
|
+
*/
|
|
596
|
+
interface Call {
|
|
597
|
+
/**
|
|
598
|
+
* The unique identifier for the call
|
|
599
|
+
*/
|
|
600
|
+
id: string;
|
|
601
|
+
/**
|
|
602
|
+
* A contact who has consented to receive messages
|
|
603
|
+
*/
|
|
604
|
+
contact: ContactsAPI.Contact;
|
|
605
|
+
/**
|
|
606
|
+
* The duration of the call in seconds
|
|
607
|
+
*/
|
|
608
|
+
duration: number;
|
|
609
|
+
/**
|
|
610
|
+
* When the call was initiated
|
|
611
|
+
*/
|
|
612
|
+
initiated_at: string;
|
|
613
|
+
/**
|
|
614
|
+
* The status of the call
|
|
615
|
+
*/
|
|
616
|
+
status: 'busy' | 'canceled' | 'completed' | 'failed' | 'in_progress' | 'missed' | 'no_answer' | 'queued' | 'ringing';
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
export interface VoicemailReceivedWebhookEvent {
|
|
621
|
+
/**
|
|
622
|
+
* The ID of the account in which this event occurred
|
|
623
|
+
*/
|
|
624
|
+
account_id: string;
|
|
625
|
+
/**
|
|
626
|
+
* The data associated with the event
|
|
627
|
+
*/
|
|
628
|
+
data: VoicemailReceivedWebhookEvent.Data;
|
|
629
|
+
/**
|
|
630
|
+
* The timestamp when this event occurred, in ISO8601 format
|
|
631
|
+
*/
|
|
632
|
+
timestamp: string;
|
|
633
|
+
/**
|
|
634
|
+
* The type of the event. Always `voicemail.received` for this event.
|
|
635
|
+
*/
|
|
636
|
+
type: 'voicemail.received';
|
|
637
|
+
}
|
|
638
|
+
export declare namespace VoicemailReceivedWebhookEvent {
|
|
639
|
+
/**
|
|
640
|
+
* The data associated with the event
|
|
641
|
+
*/
|
|
642
|
+
interface Data {
|
|
643
|
+
/**
|
|
644
|
+
* The unique identifier for the voicemail
|
|
645
|
+
*/
|
|
646
|
+
id: string;
|
|
647
|
+
/**
|
|
648
|
+
* The call that resulted in this voicemail
|
|
649
|
+
*/
|
|
650
|
+
call: Data.Call;
|
|
651
|
+
/**
|
|
652
|
+
* The duration of the voicemail in seconds
|
|
653
|
+
*/
|
|
654
|
+
duration: number;
|
|
655
|
+
/**
|
|
656
|
+
* The unique identifier for the recording
|
|
657
|
+
*/
|
|
658
|
+
recording_id: string;
|
|
659
|
+
}
|
|
660
|
+
namespace Data {
|
|
661
|
+
/**
|
|
662
|
+
* The call that resulted in this voicemail
|
|
663
|
+
*/
|
|
664
|
+
interface Call {
|
|
665
|
+
/**
|
|
666
|
+
* The unique identifier for the call
|
|
667
|
+
*/
|
|
668
|
+
id: string;
|
|
669
|
+
/**
|
|
670
|
+
* A contact who has consented to receive messages
|
|
671
|
+
*/
|
|
672
|
+
contact: ContactsAPI.Contact;
|
|
673
|
+
/**
|
|
674
|
+
* The duration of the call in seconds
|
|
675
|
+
*/
|
|
676
|
+
duration: number;
|
|
677
|
+
/**
|
|
678
|
+
* When the call was initiated
|
|
679
|
+
*/
|
|
680
|
+
initiated_at: string;
|
|
681
|
+
/**
|
|
682
|
+
* The status of the call
|
|
683
|
+
*/
|
|
684
|
+
status: 'busy' | 'canceled' | 'completed' | 'failed' | 'in_progress' | 'missed' | 'no_answer' | 'queued' | 'ringing';
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
export type UnwrapWebhookEvent = CallEndedWebhookEvent | CampaignApprovedWebhookEvent | ContactOptedInWebhookEvent | ContactOptedOutWebhookEvent | ConversationCreatedWebhookEvent | LinkFollowedWebhookEvent | MessageDeliveredWebhookEvent | MessageFailedWebhookEvent | MessageReceivedWebhookEvent | MessageSentWebhookEvent | RecordingCompletedWebhookEvent | VoicemailReceivedWebhookEvent;
|
|
557
689
|
export declare namespace Webhooks {
|
|
558
|
-
export { type CallEndedWebhookEvent as CallEndedWebhookEvent, type CampaignApprovedWebhookEvent as CampaignApprovedWebhookEvent, type ContactOptedInWebhookEvent as ContactOptedInWebhookEvent, type ContactOptedOutWebhookEvent as ContactOptedOutWebhookEvent, type ConversationCreatedWebhookEvent as ConversationCreatedWebhookEvent, type LinkFollowedWebhookEvent as LinkFollowedWebhookEvent, type MessageDeliveredWebhookEvent as MessageDeliveredWebhookEvent, type MessageFailedWebhookEvent as MessageFailedWebhookEvent, type MessageReceivedWebhookEvent as MessageReceivedWebhookEvent, type MessageSentWebhookEvent as MessageSentWebhookEvent, type UnwrapWebhookEvent as UnwrapWebhookEvent, };
|
|
690
|
+
export { type CallEndedWebhookEvent as CallEndedWebhookEvent, type CampaignApprovedWebhookEvent as CampaignApprovedWebhookEvent, type ContactOptedInWebhookEvent as ContactOptedInWebhookEvent, type ContactOptedOutWebhookEvent as ContactOptedOutWebhookEvent, type ConversationCreatedWebhookEvent as ConversationCreatedWebhookEvent, type LinkFollowedWebhookEvent as LinkFollowedWebhookEvent, type MessageDeliveredWebhookEvent as MessageDeliveredWebhookEvent, type MessageFailedWebhookEvent as MessageFailedWebhookEvent, type MessageReceivedWebhookEvent as MessageReceivedWebhookEvent, type MessageSentWebhookEvent as MessageSentWebhookEvent, type RecordingCompletedWebhookEvent as RecordingCompletedWebhookEvent, type VoicemailReceivedWebhookEvent as VoicemailReceivedWebhookEvent, type UnwrapWebhookEvent as UnwrapWebhookEvent, };
|
|
559
691
|
}
|
|
560
692
|
//# 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,MAAM,WAAW,qBAAqB;IACpC;;OAEG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14
14
|
import * as qs from './internal/qs';
|
|
15
15
|
import { VERSION } from './version';
|
|
16
16
|
import * as Errors from './core/error';
|
|
17
|
+
import * as Pagination from './core/pagination';
|
|
18
|
+
import { AbstractPage, type CursorParams, CursorResponse } from './core/pagination';
|
|
17
19
|
import * as Uploads from './core/uploads';
|
|
18
20
|
import * as API from './resources/index';
|
|
19
21
|
import { APIPromise } from './core/api-promise';
|
|
@@ -28,9 +30,29 @@ import {
|
|
|
28
30
|
} from './resources/accounts';
|
|
29
31
|
import { Blast, BlastCreateParams, Blasts } from './resources/blasts';
|
|
30
32
|
import { Campaign, CampaignCreateParams, Campaigns } from './resources/campaigns';
|
|
31
|
-
import {
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
import {
|
|
34
|
+
Contact,
|
|
35
|
+
ContactCreateParams,
|
|
36
|
+
ContactListParams,
|
|
37
|
+
ContactUpdateParams,
|
|
38
|
+
Contacts,
|
|
39
|
+
ContactsCursor,
|
|
40
|
+
} from './resources/contacts';
|
|
41
|
+
import {
|
|
42
|
+
Message,
|
|
43
|
+
MessageCreateParams,
|
|
44
|
+
MessageListParams,
|
|
45
|
+
Messages,
|
|
46
|
+
MessagesCursor,
|
|
47
|
+
} from './resources/messages';
|
|
48
|
+
import {
|
|
49
|
+
PhoneNumber,
|
|
50
|
+
PhoneNumberListParams,
|
|
51
|
+
PhoneNumberPurchaseParams,
|
|
52
|
+
PhoneNumbers,
|
|
53
|
+
PhoneNumbersCursor,
|
|
54
|
+
} from './resources/phone-numbers';
|
|
55
|
+
import { RecordingGetFileResponse, Recordings } from './resources/recordings';
|
|
34
56
|
import {
|
|
35
57
|
User,
|
|
36
58
|
UserCreateParams,
|
|
@@ -57,7 +79,9 @@ import {
|
|
|
57
79
|
MessageFailedWebhookEvent,
|
|
58
80
|
MessageReceivedWebhookEvent,
|
|
59
81
|
MessageSentWebhookEvent,
|
|
82
|
+
RecordingCompletedWebhookEvent,
|
|
60
83
|
UnwrapWebhookEvent,
|
|
84
|
+
VoicemailReceivedWebhookEvent,
|
|
61
85
|
Webhooks,
|
|
62
86
|
} from './resources/webhooks';
|
|
63
87
|
import { type Fetch } from './internal/builtin-types';
|
|
@@ -520,6 +544,30 @@ export class Surge {
|
|
|
520
544
|
return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
|
|
521
545
|
}
|
|
522
546
|
|
|
547
|
+
getAPIList<Item, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(
|
|
548
|
+
path: string,
|
|
549
|
+
Page: new (...args: any[]) => PageClass,
|
|
550
|
+
opts?: PromiseOrValue<RequestOptions>,
|
|
551
|
+
): Pagination.PagePromise<PageClass, Item> {
|
|
552
|
+
return this.requestAPIList(
|
|
553
|
+
Page,
|
|
554
|
+
opts && 'then' in opts ?
|
|
555
|
+
opts.then((opts) => ({ method: 'get', path, ...opts }))
|
|
556
|
+
: { method: 'get', path, ...opts },
|
|
557
|
+
);
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
requestAPIList<
|
|
561
|
+
Item = unknown,
|
|
562
|
+
PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>,
|
|
563
|
+
>(
|
|
564
|
+
Page: new (...args: ConstructorParameters<typeof Pagination.AbstractPage>) => PageClass,
|
|
565
|
+
options: PromiseOrValue<FinalRequestOptions>,
|
|
566
|
+
): Pagination.PagePromise<PageClass, Item> {
|
|
567
|
+
const request = this.makeRequest(options, null, undefined);
|
|
568
|
+
return new Pagination.PagePromise<PageClass, Item>(this as any as Surge, request, Page);
|
|
569
|
+
}
|
|
570
|
+
|
|
523
571
|
async fetchWithTimeout(
|
|
524
572
|
url: RequestInfo,
|
|
525
573
|
init: RequestInit | undefined,
|
|
@@ -527,9 +575,10 @@ export class Surge {
|
|
|
527
575
|
controller: AbortController,
|
|
528
576
|
): Promise<Response> {
|
|
529
577
|
const { signal, method, ...options } = init || {};
|
|
530
|
-
|
|
578
|
+
const abort = this._makeAbort(controller);
|
|
579
|
+
if (signal) signal.addEventListener('abort', abort, { once: true });
|
|
531
580
|
|
|
532
|
-
const timeout = setTimeout(
|
|
581
|
+
const timeout = setTimeout(abort, ms);
|
|
533
582
|
|
|
534
583
|
const isReadableBody =
|
|
535
584
|
((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
|
|
@@ -696,6 +745,12 @@ export class Surge {
|
|
|
696
745
|
return headers.values;
|
|
697
746
|
}
|
|
698
747
|
|
|
748
|
+
private _makeAbort(controller: AbortController) {
|
|
749
|
+
// note: we can't just inline this method inside `fetchWithTimeout()` because then the closure
|
|
750
|
+
// would capture all request options, and cause a memory leak.
|
|
751
|
+
return () => controller.abort();
|
|
752
|
+
}
|
|
753
|
+
|
|
699
754
|
private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
|
|
700
755
|
bodyHeaders: HeadersLike;
|
|
701
756
|
body: BodyInit | undefined;
|
|
@@ -758,6 +813,7 @@ export class Surge {
|
|
|
758
813
|
contacts: API.Contacts = new API.Contacts(this);
|
|
759
814
|
messages: API.Messages = new API.Messages(this);
|
|
760
815
|
phoneNumbers: API.PhoneNumbers = new API.PhoneNumbers(this);
|
|
816
|
+
recordings: API.Recordings = new API.Recordings(this);
|
|
761
817
|
users: API.Users = new API.Users(this);
|
|
762
818
|
verifications: API.Verifications = new API.Verifications(this);
|
|
763
819
|
webhooks: API.Webhooks = new API.Webhooks(this);
|
|
@@ -769,6 +825,7 @@ Surge.Campaigns = Campaigns;
|
|
|
769
825
|
Surge.Contacts = Contacts;
|
|
770
826
|
Surge.Messages = Messages;
|
|
771
827
|
Surge.PhoneNumbers = PhoneNumbers;
|
|
828
|
+
Surge.Recordings = Recordings;
|
|
772
829
|
Surge.Users = Users;
|
|
773
830
|
Surge.Verifications = Verifications;
|
|
774
831
|
Surge.Webhooks = Webhooks;
|
|
@@ -776,6 +833,9 @@ Surge.Webhooks = Webhooks;
|
|
|
776
833
|
export declare namespace Surge {
|
|
777
834
|
export type RequestOptions = Opts.RequestOptions;
|
|
778
835
|
|
|
836
|
+
export import Cursor = Pagination.Cursor;
|
|
837
|
+
export { type CursorParams as CursorParams, type CursorResponse as CursorResponse };
|
|
838
|
+
|
|
779
839
|
export {
|
|
780
840
|
Accounts as Accounts,
|
|
781
841
|
type Account as Account,
|
|
@@ -797,18 +857,30 @@ export declare namespace Surge {
|
|
|
797
857
|
export {
|
|
798
858
|
Contacts as Contacts,
|
|
799
859
|
type Contact as Contact,
|
|
860
|
+
type ContactsCursor as ContactsCursor,
|
|
800
861
|
type ContactCreateParams as ContactCreateParams,
|
|
801
862
|
type ContactUpdateParams as ContactUpdateParams,
|
|
863
|
+
type ContactListParams as ContactListParams,
|
|
802
864
|
};
|
|
803
865
|
|
|
804
|
-
export {
|
|
866
|
+
export {
|
|
867
|
+
Messages as Messages,
|
|
868
|
+
type Message as Message,
|
|
869
|
+
type MessagesCursor as MessagesCursor,
|
|
870
|
+
type MessageCreateParams as MessageCreateParams,
|
|
871
|
+
type MessageListParams as MessageListParams,
|
|
872
|
+
};
|
|
805
873
|
|
|
806
874
|
export {
|
|
807
875
|
PhoneNumbers as PhoneNumbers,
|
|
808
876
|
type PhoneNumber as PhoneNumber,
|
|
877
|
+
type PhoneNumbersCursor as PhoneNumbersCursor,
|
|
878
|
+
type PhoneNumberListParams as PhoneNumberListParams,
|
|
809
879
|
type PhoneNumberPurchaseParams as PhoneNumberPurchaseParams,
|
|
810
880
|
};
|
|
811
881
|
|
|
882
|
+
export { Recordings as Recordings, type RecordingGetFileResponse as RecordingGetFileResponse };
|
|
883
|
+
|
|
812
884
|
export {
|
|
813
885
|
Users as Users,
|
|
814
886
|
type User as User,
|
|
@@ -838,6 +910,8 @@ export declare namespace Surge {
|
|
|
838
910
|
type MessageFailedWebhookEvent as MessageFailedWebhookEvent,
|
|
839
911
|
type MessageReceivedWebhookEvent as MessageReceivedWebhookEvent,
|
|
840
912
|
type MessageSentWebhookEvent as MessageSentWebhookEvent,
|
|
913
|
+
type RecordingCompletedWebhookEvent as RecordingCompletedWebhookEvent,
|
|
914
|
+
type VoicemailReceivedWebhookEvent as VoicemailReceivedWebhookEvent,
|
|
841
915
|
type UnwrapWebhookEvent as UnwrapWebhookEvent,
|
|
842
916
|
};
|
|
843
917
|
|