@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.
Files changed (116) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +31 -0
  3. package/client.d.mts +18 -8
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +18 -8
  6. package/client.d.ts.map +1 -1
  7. package/client.js +21 -2
  8. package/client.js.map +1 -1
  9. package/client.mjs +24 -5
  10. package/client.mjs.map +1 -1
  11. package/core/pagination.d.mts +60 -0
  12. package/core/pagination.d.mts.map +1 -0
  13. package/core/pagination.d.ts +60 -0
  14. package/core/pagination.d.ts.map +1 -0
  15. package/core/pagination.js +115 -0
  16. package/core/pagination.js.map +1 -0
  17. package/core/pagination.mjs +109 -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/parse.d.mts.map +1 -1
  28. package/internal/parse.d.ts.map +1 -1
  29. package/internal/parse.js +5 -0
  30. package/internal/parse.js.map +1 -1
  31. package/internal/parse.mjs +5 -0
  32. package/internal/parse.mjs.map +1 -1
  33. package/internal/tslib.js +17 -17
  34. package/package.json +11 -1
  35. package/pagination.d.mts +2 -0
  36. package/pagination.d.mts.map +1 -0
  37. package/pagination.d.ts +2 -0
  38. package/pagination.d.ts.map +1 -0
  39. package/pagination.js +6 -0
  40. package/pagination.js.map +1 -0
  41. package/pagination.mjs +2 -0
  42. package/pagination.mjs.map +1 -0
  43. package/resources/blasts.d.mts +4 -4
  44. package/resources/blasts.d.mts.map +1 -1
  45. package/resources/blasts.d.ts +4 -4
  46. package/resources/blasts.d.ts.map +1 -1
  47. package/resources/campaigns.d.mts +15 -0
  48. package/resources/campaigns.d.mts.map +1 -1
  49. package/resources/campaigns.d.ts +15 -0
  50. package/resources/campaigns.d.ts.map +1 -1
  51. package/resources/campaigns.js +13 -0
  52. package/resources/campaigns.js.map +1 -1
  53. package/resources/campaigns.mjs +13 -0
  54. package/resources/campaigns.mjs.map +1 -1
  55. package/resources/contacts.d.mts +19 -1
  56. package/resources/contacts.d.mts.map +1 -1
  57. package/resources/contacts.d.ts +19 -1
  58. package/resources/contacts.d.ts.map +1 -1
  59. package/resources/contacts.js +20 -0
  60. package/resources/contacts.js.map +1 -1
  61. package/resources/contacts.mjs +20 -0
  62. package/resources/contacts.mjs.map +1 -1
  63. package/resources/index.d.mts +5 -4
  64. package/resources/index.d.mts.map +1 -1
  65. package/resources/index.d.ts +5 -4
  66. package/resources/index.d.ts.map +1 -1
  67. package/resources/index.js +3 -1
  68. package/resources/index.js.map +1 -1
  69. package/resources/index.mjs +4 -3
  70. package/resources/index.mjs.map +1 -1
  71. package/resources/messages.d.mts +21 -3
  72. package/resources/messages.d.mts.map +1 -1
  73. package/resources/messages.d.ts +21 -3
  74. package/resources/messages.d.ts.map +1 -1
  75. package/resources/messages.js +20 -0
  76. package/resources/messages.js.map +1 -1
  77. package/resources/messages.mjs +20 -0
  78. package/resources/messages.mjs.map +1 -1
  79. package/resources/phone-numbers.d.mts +19 -1
  80. package/resources/phone-numbers.d.mts.map +1 -1
  81. package/resources/phone-numbers.d.ts +19 -1
  82. package/resources/phone-numbers.d.ts.map +1 -1
  83. package/resources/phone-numbers.js +20 -0
  84. package/resources/phone-numbers.js.map +1 -1
  85. package/resources/phone-numbers.mjs +20 -0
  86. package/resources/phone-numbers.mjs.map +1 -1
  87. package/resources/recordings.d.mts +31 -0
  88. package/resources/recordings.d.mts.map +1 -0
  89. package/resources/recordings.d.ts +31 -0
  90. package/resources/recordings.d.ts.map +1 -0
  91. package/resources/recordings.js +24 -0
  92. package/resources/recordings.js.map +1 -0
  93. package/resources/recordings.mjs +20 -0
  94. package/resources/recordings.mjs.map +1 -0
  95. package/resources/webhooks.d.mts +138 -6
  96. package/resources/webhooks.d.mts.map +1 -1
  97. package/resources/webhooks.d.ts +138 -6
  98. package/resources/webhooks.d.ts.map +1 -1
  99. package/src/client.ts +80 -6
  100. package/src/core/pagination.ts +176 -0
  101. package/src/index.ts +1 -0
  102. package/src/internal/parse.ts +6 -0
  103. package/src/pagination.ts +2 -0
  104. package/src/resources/blasts.ts +4 -4
  105. package/src/resources/campaigns.ts +19 -0
  106. package/src/resources/contacts.ts +31 -0
  107. package/src/resources/index.ts +25 -3
  108. package/src/resources/messages.ts +37 -3
  109. package/src/resources/phone-numbers.ts +35 -1
  110. package/src/resources/recordings.ts +38 -0
  111. package/src/resources/webhooks.ts +184 -5
  112. package/src/version.ts +1 -1
  113. package/version.d.mts +1 -1
  114. package/version.d.ts +1 -1
  115. package/version.js +1 -1
  116. package/version.mjs +1 -1
@@ -313,7 +313,7 @@ export namespace MessageDeliveredWebhookEvent {
313
313
  /**
314
314
  * The content of the message
315
315
  */
316
- body: string;
316
+ body: string | null;
317
317
 
318
318
  /**
319
319
  * The conversation this message belongs to
@@ -412,7 +412,7 @@ export namespace MessageFailedWebhookEvent {
412
412
  /**
413
413
  * The content of the message
414
414
  */
415
- body: string;
415
+ body: string | null;
416
416
 
417
417
  /**
418
418
  * The conversation this message belongs to
@@ -516,7 +516,7 @@ export namespace MessageReceivedWebhookEvent {
516
516
  /**
517
517
  * The content of the message
518
518
  */
519
- body: string;
519
+ body: string | null;
520
520
 
521
521
  /**
522
522
  * The conversation this message belongs to
@@ -615,7 +615,7 @@ export namespace MessageSentWebhookEvent {
615
615
  /**
616
616
  * The content of the message
617
617
  */
618
- body: string;
618
+ body: string | null;
619
619
 
620
620
  /**
621
621
  * The conversation this message belongs to
@@ -679,6 +679,181 @@ export namespace MessageSentWebhookEvent {
679
679
  }
680
680
  }
681
681
 
682
+ export interface RecordingCompletedWebhookEvent {
683
+ /**
684
+ * The ID of the account in which this event occurred
685
+ */
686
+ account_id: string;
687
+
688
+ /**
689
+ * The data associated with the event
690
+ */
691
+ data: RecordingCompletedWebhookEvent.Data;
692
+
693
+ /**
694
+ * The timestamp when this event occurred, in ISO8601 format
695
+ */
696
+ timestamp: string;
697
+
698
+ /**
699
+ * The type of the event. Always `recording.completed` for this event.
700
+ */
701
+ type: 'recording.completed';
702
+ }
703
+
704
+ export namespace RecordingCompletedWebhookEvent {
705
+ /**
706
+ * The data associated with the event
707
+ */
708
+ export interface Data {
709
+ /**
710
+ * The unique identifier for the recording
711
+ */
712
+ id: string;
713
+
714
+ /**
715
+ * The call that produced this recording
716
+ */
717
+ call: Data.Call;
718
+
719
+ /**
720
+ * The duration of the recording in seconds
721
+ */
722
+ duration: number;
723
+ }
724
+
725
+ export namespace Data {
726
+ /**
727
+ * The call that produced this recording
728
+ */
729
+ export interface Call {
730
+ /**
731
+ * The unique identifier for the call
732
+ */
733
+ id: string;
734
+
735
+ /**
736
+ * A contact who has consented to receive messages
737
+ */
738
+ contact: ContactsAPI.Contact;
739
+
740
+ /**
741
+ * The duration of the call in seconds
742
+ */
743
+ duration: number;
744
+
745
+ /**
746
+ * When the call was initiated
747
+ */
748
+ initiated_at: string;
749
+
750
+ /**
751
+ * The status of the call
752
+ */
753
+ status:
754
+ | 'busy'
755
+ | 'canceled'
756
+ | 'completed'
757
+ | 'failed'
758
+ | 'in_progress'
759
+ | 'missed'
760
+ | 'no_answer'
761
+ | 'queued'
762
+ | 'ringing';
763
+ }
764
+ }
765
+ }
766
+
767
+ export interface VoicemailReceivedWebhookEvent {
768
+ /**
769
+ * The ID of the account in which this event occurred
770
+ */
771
+ account_id: string;
772
+
773
+ /**
774
+ * The data associated with the event
775
+ */
776
+ data: VoicemailReceivedWebhookEvent.Data;
777
+
778
+ /**
779
+ * The timestamp when this event occurred, in ISO8601 format
780
+ */
781
+ timestamp: string;
782
+
783
+ /**
784
+ * The type of the event. Always `voicemail.received` for this event.
785
+ */
786
+ type: 'voicemail.received';
787
+ }
788
+
789
+ export namespace VoicemailReceivedWebhookEvent {
790
+ /**
791
+ * The data associated with the event
792
+ */
793
+ export interface Data {
794
+ /**
795
+ * The unique identifier for the voicemail
796
+ */
797
+ id: string;
798
+
799
+ /**
800
+ * The call that resulted in this voicemail
801
+ */
802
+ call: Data.Call;
803
+
804
+ /**
805
+ * The duration of the voicemail in seconds
806
+ */
807
+ duration: number;
808
+
809
+ /**
810
+ * The unique identifier for the recording
811
+ */
812
+ recording_id: string;
813
+ }
814
+
815
+ export namespace Data {
816
+ /**
817
+ * The call that resulted in this voicemail
818
+ */
819
+ export interface Call {
820
+ /**
821
+ * The unique identifier for the call
822
+ */
823
+ id: string;
824
+
825
+ /**
826
+ * A contact who has consented to receive messages
827
+ */
828
+ contact: ContactsAPI.Contact;
829
+
830
+ /**
831
+ * The duration of the call in seconds
832
+ */
833
+ duration: number;
834
+
835
+ /**
836
+ * When the call was initiated
837
+ */
838
+ initiated_at: string;
839
+
840
+ /**
841
+ * The status of the call
842
+ */
843
+ status:
844
+ | 'busy'
845
+ | 'canceled'
846
+ | 'completed'
847
+ | 'failed'
848
+ | 'in_progress'
849
+ | 'missed'
850
+ | 'no_answer'
851
+ | 'queued'
852
+ | 'ringing';
853
+ }
854
+ }
855
+ }
856
+
682
857
  export type UnwrapWebhookEvent =
683
858
  | CallEndedWebhookEvent
684
859
  | CampaignApprovedWebhookEvent
@@ -689,7 +864,9 @@ export type UnwrapWebhookEvent =
689
864
  | MessageDeliveredWebhookEvent
690
865
  | MessageFailedWebhookEvent
691
866
  | MessageReceivedWebhookEvent
692
- | MessageSentWebhookEvent;
867
+ | MessageSentWebhookEvent
868
+ | RecordingCompletedWebhookEvent
869
+ | VoicemailReceivedWebhookEvent;
693
870
 
694
871
  export declare namespace Webhooks {
695
872
  export {
@@ -703,6 +880,8 @@ export declare namespace Webhooks {
703
880
  type MessageFailedWebhookEvent as MessageFailedWebhookEvent,
704
881
  type MessageReceivedWebhookEvent as MessageReceivedWebhookEvent,
705
882
  type MessageSentWebhookEvent as MessageSentWebhookEvent,
883
+ type RecordingCompletedWebhookEvent as RecordingCompletedWebhookEvent,
884
+ type VoicemailReceivedWebhookEvent as VoicemailReceivedWebhookEvent,
706
885
  type UnwrapWebhookEvent as UnwrapWebhookEvent,
707
886
  };
708
887
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.34.0'; // x-release-please-version
1
+ export const VERSION = '0.36.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.34.0";
1
+ export declare const VERSION = "0.36.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.34.0";
1
+ export declare const VERSION = "0.36.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.34.0'; // x-release-please-version
4
+ exports.VERSION = '0.36.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.34.0'; // x-release-please-version
1
+ export const VERSION = '0.36.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map