rcs-js 2.0.7 → 2.0.8

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 (100) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/messages/client/Client.d.ts +6 -21
  3. package/dist/cjs/api/resources/messages/client/Client.js +16 -84
  4. package/dist/cjs/api/resources/messages/resources/blast/client/Client.d.ts +105 -0
  5. package/dist/cjs/api/resources/messages/resources/blast/client/Client.js +325 -0
  6. package/dist/cjs/api/resources/messages/resources/blast/client/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/messages/resources/blast/client/index.js +17 -0
  8. package/dist/cjs/api/resources/messages/resources/blast/client/requests/BlastMms.d.ts +61 -0
  9. package/dist/cjs/api/resources/messages/resources/blast/client/requests/BlastRcs.d.ts +110 -0
  10. package/dist/cjs/api/resources/messages/resources/blast/client/requests/BlastRcs.js +23 -0
  11. package/dist/cjs/api/resources/messages/resources/blast/client/requests/BlastSms.d.ts +47 -0
  12. package/dist/cjs/api/resources/messages/resources/blast/client/requests/BlastSms.js +3 -0
  13. package/dist/cjs/api/resources/messages/resources/blast/client/requests/index.d.ts +3 -0
  14. package/dist/cjs/api/resources/messages/resources/blast/client/requests/index.js +2 -0
  15. package/dist/cjs/api/resources/messages/resources/blast/index.d.ts +2 -0
  16. package/dist/cjs/api/resources/messages/resources/blast/index.js +18 -0
  17. package/dist/cjs/api/resources/messages/resources/blast/types/BlastMmsResponse.d.ts +2 -0
  18. package/dist/cjs/api/resources/messages/resources/blast/types/BlastMmsResponse.js +3 -0
  19. package/dist/cjs/api/resources/messages/resources/blast/types/BlastRcsResponse.d.ts +2 -0
  20. package/dist/cjs/api/resources/messages/resources/blast/types/BlastRcsResponse.js +3 -0
  21. package/dist/cjs/api/resources/messages/resources/blast/types/BlastSmsResponse.d.ts +2 -0
  22. package/dist/cjs/api/resources/messages/resources/blast/types/BlastSmsResponse.js +3 -0
  23. package/dist/cjs/api/resources/messages/resources/blast/types/index.d.ts +3 -0
  24. package/dist/cjs/api/resources/messages/resources/blast/types/index.js +19 -0
  25. package/dist/cjs/api/resources/messages/resources/index.d.ts +4 -0
  26. package/dist/cjs/api/resources/messages/resources/index.js +5 -1
  27. package/dist/cjs/api/resources/messages/resources/schedule/client/Client.d.ts +32 -0
  28. package/dist/cjs/api/resources/messages/resources/schedule/client/Client.js +135 -0
  29. package/dist/cjs/api/resources/messages/resources/schedule/client/index.d.ts +1 -0
  30. package/dist/cjs/api/resources/messages/resources/schedule/client/index.js +2 -0
  31. package/dist/cjs/api/resources/messages/resources/schedule/index.d.ts +1 -0
  32. package/dist/cjs/api/resources/messages/resources/schedule/index.js +17 -0
  33. package/dist/cjs/api/types/BlastDetails.d.ts +17 -0
  34. package/dist/cjs/api/types/BlastDetails.js +3 -0
  35. package/dist/cjs/api/types/DlcCampaignWithExtendedBrandAndStatus.d.ts +42 -0
  36. package/dist/cjs/api/types/DlcCampaignWithExtendedBrandAndStatus.js +32 -0
  37. package/dist/cjs/api/types/MessageSchedule.d.ts +25 -11
  38. package/dist/cjs/api/types/MessageStatusEnum.d.ts +1 -0
  39. package/dist/cjs/api/types/MessageStatusEnum.js +1 -0
  40. package/dist/cjs/api/types/ScheduleCancelResult.d.ts +7 -0
  41. package/dist/cjs/api/types/ScheduleCancelResult.js +3 -0
  42. package/dist/cjs/api/types/ScheduledBlastDetails.d.ts +24 -0
  43. package/dist/cjs/api/types/ScheduledBlastDetails.js +3 -0
  44. package/dist/cjs/api/types/index.d.ts +3 -1
  45. package/dist/cjs/api/types/index.js +3 -1
  46. package/dist/cjs/version.d.ts +1 -1
  47. package/dist/cjs/version.js +1 -1
  48. package/dist/esm/Client.mjs +2 -2
  49. package/dist/esm/api/resources/messages/client/Client.d.mts +6 -21
  50. package/dist/esm/api/resources/messages/client/Client.mjs +10 -78
  51. package/dist/esm/api/resources/messages/resources/blast/client/Client.d.mts +105 -0
  52. package/dist/esm/api/resources/messages/resources/blast/client/Client.mjs +288 -0
  53. package/dist/esm/api/resources/messages/resources/blast/client/index.d.mts +1 -0
  54. package/dist/esm/api/resources/messages/resources/blast/client/index.mjs +1 -0
  55. package/dist/esm/api/resources/messages/resources/blast/client/requests/BlastMms.d.mts +61 -0
  56. package/dist/esm/api/resources/messages/resources/blast/client/requests/BlastRcs.d.mts +110 -0
  57. package/dist/esm/api/resources/messages/resources/blast/client/requests/BlastRcs.mjs +20 -0
  58. package/dist/esm/api/resources/messages/resources/blast/client/requests/BlastSms.d.mts +47 -0
  59. package/dist/esm/api/resources/messages/resources/blast/client/requests/BlastSms.mjs +2 -0
  60. package/dist/esm/api/resources/messages/resources/blast/client/requests/index.d.mts +3 -0
  61. package/dist/esm/api/resources/messages/resources/blast/client/requests/index.mjs +1 -0
  62. package/dist/esm/api/resources/messages/resources/blast/index.d.mts +2 -0
  63. package/dist/esm/api/resources/messages/resources/blast/index.mjs +2 -0
  64. package/dist/esm/api/resources/messages/resources/blast/types/BlastMmsResponse.d.mts +2 -0
  65. package/dist/esm/api/resources/messages/resources/blast/types/BlastMmsResponse.mjs +2 -0
  66. package/dist/esm/api/resources/messages/resources/blast/types/BlastRcsResponse.d.mts +2 -0
  67. package/dist/esm/api/resources/messages/resources/blast/types/BlastRcsResponse.mjs +2 -0
  68. package/dist/esm/api/resources/messages/resources/blast/types/BlastSmsResponse.d.mts +2 -0
  69. package/dist/esm/api/resources/messages/resources/blast/types/BlastSmsResponse.mjs +2 -0
  70. package/dist/esm/api/resources/messages/resources/blast/types/index.d.mts +3 -0
  71. package/dist/esm/api/resources/messages/resources/blast/types/index.mjs +3 -0
  72. package/dist/esm/api/resources/messages/resources/index.d.mts +4 -0
  73. package/dist/esm/api/resources/messages/resources/index.mjs +4 -0
  74. package/dist/esm/api/resources/messages/resources/schedule/client/Client.d.mts +32 -0
  75. package/dist/esm/api/resources/messages/resources/schedule/client/Client.mjs +98 -0
  76. package/dist/esm/api/resources/messages/resources/schedule/client/index.d.mts +1 -0
  77. package/dist/esm/api/resources/messages/resources/schedule/client/index.mjs +1 -0
  78. package/dist/esm/api/resources/messages/resources/schedule/index.d.mts +1 -0
  79. package/dist/esm/api/resources/messages/resources/schedule/index.mjs +1 -0
  80. package/dist/esm/api/types/BlastDetails.d.mts +17 -0
  81. package/dist/esm/api/types/BlastDetails.mjs +2 -0
  82. package/dist/esm/api/types/DlcCampaignWithExtendedBrandAndStatus.d.mts +42 -0
  83. package/dist/esm/api/types/DlcCampaignWithExtendedBrandAndStatus.mjs +31 -1
  84. package/dist/esm/api/types/MessageSchedule.d.mts +25 -11
  85. package/dist/esm/api/types/MessageStatusEnum.d.mts +1 -0
  86. package/dist/esm/api/types/MessageStatusEnum.mjs +1 -0
  87. package/dist/esm/api/types/ScheduleCancelResult.d.mts +7 -0
  88. package/dist/esm/api/types/ScheduleCancelResult.mjs +2 -0
  89. package/dist/esm/api/types/ScheduledBlastDetails.d.mts +24 -0
  90. package/dist/esm/api/types/ScheduledBlastDetails.mjs +2 -0
  91. package/dist/esm/api/types/index.d.mts +3 -1
  92. package/dist/esm/api/types/index.mjs +3 -1
  93. package/dist/esm/version.d.mts +1 -1
  94. package/dist/esm/version.mjs +1 -1
  95. package/package.json +1 -1
  96. package/reference.md +299 -68
  97. package/dist/cjs/api/types/CancelScheduledMessageResponse.d.ts +0 -4
  98. package/dist/esm/api/types/CancelScheduledMessageResponse.d.mts +0 -4
  99. /package/dist/cjs/api/{types/CancelScheduledMessageResponse.js → resources/messages/resources/blast/client/requests/BlastMms.js} +0 -0
  100. /package/dist/esm/api/{types/CancelScheduledMessageResponse.mjs → resources/messages/resources/blast/client/requests/BlastMms.mjs} +0 -0
@@ -0,0 +1,61 @@
1
+ import type * as Pinnacle from "../../../../../../index.js";
2
+ /**
3
+ * @example
4
+ * {
5
+ * audienceId: "aud_abc123",
6
+ * senders: ["+14155164736", "+14155164737"],
7
+ * message: {
8
+ * mediaUrls: ["https://fastly.picsum.photos/id/941/300/300.jpg"],
9
+ * text: "Check out this image!"
10
+ * },
11
+ * options: {
12
+ * validate: true
13
+ * }
14
+ * }
15
+ *
16
+ * @example
17
+ * {
18
+ * audienceId: "aud_abc123",
19
+ * senders: ["+14155164736", "+14155164737"],
20
+ * message: {
21
+ * mediaUrls: ["https://fastly.picsum.photos/id/941/300/300.jpg"],
22
+ * text: "Check out this image!"
23
+ * },
24
+ * options: {
25
+ * validate: true
26
+ * }
27
+ * }
28
+ */
29
+ export interface BlastMms {
30
+ /**
31
+ * The audience ID to send the blast to. This identifier is a string that always begins with the prefix `aud_`, for example: `aud_abc123`. <br>
32
+ *
33
+ * You can create an audience via [the dashboard](https://app.pinnacle.sh/dashboard/audiences) or [API](/api-reference/audiences/create).
34
+ */
35
+ audienceId: string;
36
+ /**
37
+ * Array of phone numbers to send from in E.164 format. <br>
38
+ *
39
+ * Messages will be distributed evenly across these senders.
40
+ *
41
+ * > **Note:** Sandbox numbers cannot be used for blasts.
42
+ */
43
+ senders: string[];
44
+ message: Pinnacle.MmsContent;
45
+ /** Additional settings to customize MMS blast delivery. */
46
+ options?: BlastMms.Options;
47
+ }
48
+ export declare namespace BlastMms {
49
+ /**
50
+ * Additional settings to customize MMS blast delivery.
51
+ */
52
+ interface Options {
53
+ /**
54
+ * Set to true to validate the message before sending. <br>
55
+ *
56
+ * If validation fails, the blast is not sent.
57
+ */
58
+ validate?: boolean;
59
+ schedule?: Pinnacle.MessageSchedule;
60
+ }
61
+ }
@@ -0,0 +1,110 @@
1
+ import type * as Pinnacle from "../../../../../../index.js";
2
+ /**
3
+ * @example
4
+ * {
5
+ * audienceId: "aud_abc123",
6
+ * senders: ["agent_pinnacle", "agent_pinnacle2"],
7
+ * message: {
8
+ * quickReplies: [{
9
+ * type: "trigger",
10
+ * payload: "payload",
11
+ * title: "title"
12
+ * }],
13
+ * text: "Hello from Pinnacle RCS!"
14
+ * },
15
+ * options: {
16
+ * transcode: true,
17
+ * validate: true
18
+ * }
19
+ * }
20
+ *
21
+ * @example
22
+ * {
23
+ * audienceId: "aud_abc123",
24
+ * senders: ["agent_pinnacle", "agent_pinnacle2"],
25
+ * message: {
26
+ * quickReplies: [{
27
+ * type: "trigger",
28
+ * payload: "payload",
29
+ * title: "title"
30
+ * }],
31
+ * text: "Hello from Pinnacle RCS!"
32
+ * },
33
+ * options: {
34
+ * transcode: true,
35
+ * validate: true
36
+ * }
37
+ * }
38
+ */
39
+ export interface BlastRcs {
40
+ /**
41
+ * The audience ID to send the blast to. This identifier is a string that always begins with the prefix `aud_`, for example: `aud_abc123`. <br>
42
+ *
43
+ * You can create an audience via [the dashboard](https://app.pinnacle.sh/dashboard/audiences) or [API](/api-reference/audiences/create).
44
+ */
45
+ audienceId: string;
46
+ /**
47
+ * Array of RCS agent IDs to send from. Each must be prefixed with `agent_`. <br>
48
+ *
49
+ * Messages will be evenly distributed across these agents.
50
+ *
51
+ * > **Note:** Test agents cannot be used for blasts.
52
+ */
53
+ senders: string[];
54
+ message: Pinnacle.RcsValidateContent;
55
+ /** Configure how your RCS blast is sent and tracked. */
56
+ options?: BlastRcs.Options;
57
+ }
58
+ export declare namespace BlastRcs {
59
+ /**
60
+ * Configure how your RCS blast is sent and tracked.
61
+ */
62
+ interface Options {
63
+ /** Media files and card media will be transcoded to a supported RCS format. This adds a small delay to sending the message. Ignored for rich text messages. */
64
+ transcode?: boolean;
65
+ /**
66
+ * Validate your message for any unsupported files. <br>
67
+ *
68
+ * If failed, errors will be thrown and the blast will not be sent.
69
+ */
70
+ validate?: boolean;
71
+ /**
72
+ * Configure standalone card layout options for enhanced visual presentation.
73
+ *
74
+ * > **⚠️ Important Restriction**
75
+ * >
76
+ * > This option is **only valid for single card messages**. Using it with multiple cards will cause the request to fail with a validation error.
77
+ */
78
+ standalone_card?: Options.StandaloneCard;
79
+ schedule?: Pinnacle.MessageSchedule;
80
+ }
81
+ namespace Options {
82
+ /**
83
+ * Configure standalone card layout options for enhanced visual presentation.
84
+ *
85
+ * > **⚠️ Important Restriction**
86
+ * >
87
+ * > This option is **only valid for single card messages**. Using it with multiple cards will cause the request to fail with a validation error.
88
+ */
89
+ interface StandaloneCard {
90
+ /** The orientation of the standalone card. */
91
+ orientation?: StandaloneCard.Orientation;
92
+ /** The alignment of the image in the standalone card. This field is ignored if orientation is VERTICAL. */
93
+ image_alignment?: StandaloneCard.ImageAlignment;
94
+ }
95
+ namespace StandaloneCard {
96
+ /** The orientation of the standalone card. */
97
+ const Orientation: {
98
+ readonly Horizontal: "HORIZONTAL";
99
+ readonly Vertical: "VERTICAL";
100
+ };
101
+ type Orientation = (typeof Orientation)[keyof typeof Orientation];
102
+ /** The alignment of the image in the standalone card. This field is ignored if orientation is VERTICAL. */
103
+ const ImageAlignment: {
104
+ readonly Left: "LEFT";
105
+ readonly Right: "RIGHT";
106
+ };
107
+ type ImageAlignment = (typeof ImageAlignment)[keyof typeof ImageAlignment];
108
+ }
109
+ }
110
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.BlastRcs = void 0;
5
+ var BlastRcs;
6
+ (function (BlastRcs) {
7
+ let Options;
8
+ (function (Options) {
9
+ let StandaloneCard;
10
+ (function (StandaloneCard) {
11
+ /** The orientation of the standalone card. */
12
+ StandaloneCard.Orientation = {
13
+ Horizontal: "HORIZONTAL",
14
+ Vertical: "VERTICAL",
15
+ };
16
+ /** The alignment of the image in the standalone card. This field is ignored if orientation is VERTICAL. */
17
+ StandaloneCard.ImageAlignment = {
18
+ Left: "LEFT",
19
+ Right: "RIGHT",
20
+ };
21
+ })(StandaloneCard = Options.StandaloneCard || (Options.StandaloneCard = {}));
22
+ })(Options = BlastRcs.Options || (BlastRcs.Options = {}));
23
+ })(BlastRcs || (exports.BlastRcs = BlastRcs = {}));
@@ -0,0 +1,47 @@
1
+ import type * as Pinnacle from "../../../../../../index.js";
2
+ /**
3
+ * @example
4
+ * {
5
+ * audienceId: "aud_abc123",
6
+ * senders: ["+14155164736", "+14155164737"],
7
+ * message: {
8
+ * text: "Hello from Pinnacle!"
9
+ * }
10
+ * }
11
+ *
12
+ * @example
13
+ * {
14
+ * audienceId: "aud_abc123",
15
+ * senders: ["+14155164736", "+14155164737"],
16
+ * message: {
17
+ * text: "Hello from Pinnacle!"
18
+ * }
19
+ * }
20
+ */
21
+ export interface BlastSms {
22
+ /**
23
+ * The audience ID to send the blast to. This identifier is a string that always begins with the prefix `aud_`, for example: `aud_abc123`. <br>
24
+ *
25
+ * You can create an audience via [the dashboard](https://app.pinnacle.sh/dashboard/audiences) or [API](/api-reference/audiences/create).
26
+ */
27
+ audienceId: string;
28
+ /**
29
+ * Array of phone numbers to send from in E.164 format. <br>
30
+ *
31
+ * Messages will be distributed evenly across these senders.
32
+ *
33
+ * > **Note:** Sandbox numbers cannot be used for blasts.
34
+ */
35
+ senders: string[];
36
+ message: Pinnacle.SmsContent;
37
+ /** Additional settings to customize SMS blast delivery. */
38
+ options?: BlastSms.Options;
39
+ }
40
+ export declare namespace BlastSms {
41
+ /**
42
+ * Additional settings to customize SMS blast delivery.
43
+ */
44
+ interface Options {
45
+ schedule?: Pinnacle.MessageSchedule;
46
+ }
47
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export type { BlastMms } from "./BlastMms.js";
2
+ export type { BlastRcs } from "./BlastRcs.js";
3
+ export type { BlastSms } from "./BlastSms.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
18
+ __exportStar(require("./types/index.js"), exports);
@@ -0,0 +1,2 @@
1
+ import type * as Pinnacle from "../../../../../index.js";
2
+ export type BlastMmsResponse = Pinnacle.BlastDetails | Pinnacle.ScheduledBlastDetails;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import type * as Pinnacle from "../../../../../index.js";
2
+ export type BlastRcsResponse = Pinnacle.BlastDetails | Pinnacle.ScheduledBlastDetails;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import type * as Pinnacle from "../../../../../index.js";
2
+ export type BlastSmsResponse = Pinnacle.BlastDetails | Pinnacle.ScheduledBlastDetails;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export * from "./BlastMmsResponse.js";
2
+ export * from "./BlastRcsResponse.js";
3
+ export * from "./BlastSmsResponse.js";
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./BlastMmsResponse.js"), exports);
18
+ __exportStar(require("./BlastRcsResponse.js"), exports);
19
+ __exportStar(require("./BlastSmsResponse.js"), exports);
@@ -1,9 +1,13 @@
1
+ export * from "./blast/client/requests/index.js";
2
+ export * as blast from "./blast/index.js";
3
+ export * from "./blast/types/index.js";
1
4
  export * from "./mms/client/requests/index.js";
2
5
  export * as mms from "./mms/index.js";
3
6
  export * from "./mms/types/index.js";
4
7
  export * from "./rcs/client/requests/index.js";
5
8
  export * as rcs from "./rcs/index.js";
6
9
  export * from "./rcs/types/index.js";
10
+ export * as schedule from "./schedule/index.js";
7
11
  export * from "./sms/client/requests/index.js";
8
12
  export * as sms from "./sms/index.js";
9
13
  export * from "./sms/types/index.js";
@@ -36,13 +36,17 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.sms = exports.rcs = exports.mms = void 0;
39
+ exports.sms = exports.schedule = exports.rcs = exports.mms = exports.blast = void 0;
40
+ __exportStar(require("./blast/client/requests/index.js"), exports);
41
+ exports.blast = __importStar(require("./blast/index.js"));
42
+ __exportStar(require("./blast/types/index.js"), exports);
40
43
  __exportStar(require("./mms/client/requests/index.js"), exports);
41
44
  exports.mms = __importStar(require("./mms/index.js"));
42
45
  __exportStar(require("./mms/types/index.js"), exports);
43
46
  __exportStar(require("./rcs/client/requests/index.js"), exports);
44
47
  exports.rcs = __importStar(require("./rcs/index.js"));
45
48
  __exportStar(require("./rcs/types/index.js"), exports);
49
+ exports.schedule = __importStar(require("./schedule/index.js"));
46
50
  __exportStar(require("./sms/client/requests/index.js"), exports);
47
51
  exports.sms = __importStar(require("./sms/index.js"));
48
52
  __exportStar(require("./sms/types/index.js"), exports);
@@ -0,0 +1,32 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
2
+ import * as core from "../../../../../../core/index.js";
3
+ import * as Pinnacle from "../../../../../index.js";
4
+ export declare namespace Schedule {
5
+ interface Options extends BaseClientOptions {
6
+ }
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class Schedule {
11
+ protected readonly _options: Schedule.Options;
12
+ constructor(_options?: Schedule.Options);
13
+ /**
14
+ * Cancel a scheduled message or blast. <br>
15
+ *
16
+ * Works for both individual scheduled messages and scheduled blasts. Use the `scheduleId` returned when the message or blast was scheduled.
17
+ *
18
+ * @param {string} id - Unique identifier of the scheduled message. This identifier is a string that always begins with the prefix `msg_sched_`, for example: `msg_sched_1234567890`.
19
+ * @param {Schedule.RequestOptions} requestOptions - Request-specific configuration.
20
+ *
21
+ * @throws {@link Pinnacle.BadRequestError}
22
+ * @throws {@link Pinnacle.UnauthorizedError}
23
+ * @throws {@link Pinnacle.NotFoundError}
24
+ * @throws {@link Pinnacle.InternalServerError}
25
+ *
26
+ * @example
27
+ * await client.messages.schedule.cancel("id")
28
+ */
29
+ cancel(id: string, requestOptions?: Schedule.RequestOptions): core.HttpResponsePromise<Pinnacle.ScheduleCancelResult>;
30
+ private __cancel;
31
+ protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
32
+ }
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.Schedule = void 0;
47
+ const headers_js_1 = require("../../../../../../core/headers.js");
48
+ const core = __importStar(require("../../../../../../core/index.js"));
49
+ const environments = __importStar(require("../../../../../../environments.js"));
50
+ const errors = __importStar(require("../../../../../../errors/index.js"));
51
+ const Pinnacle = __importStar(require("../../../../../index.js"));
52
+ class Schedule {
53
+ constructor(_options = {}) {
54
+ this._options = _options;
55
+ }
56
+ /**
57
+ * Cancel a scheduled message or blast. <br>
58
+ *
59
+ * Works for both individual scheduled messages and scheduled blasts. Use the `scheduleId` returned when the message or blast was scheduled.
60
+ *
61
+ * @param {string} id - Unique identifier of the scheduled message. This identifier is a string that always begins with the prefix `msg_sched_`, for example: `msg_sched_1234567890`.
62
+ * @param {Schedule.RequestOptions} requestOptions - Request-specific configuration.
63
+ *
64
+ * @throws {@link Pinnacle.BadRequestError}
65
+ * @throws {@link Pinnacle.UnauthorizedError}
66
+ * @throws {@link Pinnacle.NotFoundError}
67
+ * @throws {@link Pinnacle.InternalServerError}
68
+ *
69
+ * @example
70
+ * await client.messages.schedule.cancel("id")
71
+ */
72
+ cancel(id, requestOptions) {
73
+ return core.HttpResponsePromise.fromPromise(this.__cancel(id, requestOptions));
74
+ }
75
+ __cancel(id, requestOptions) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
78
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
79
+ const _response = yield core.fetcher({
80
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PinnacleEnvironment.Default, `messages/schedule/${core.url.encodePathParam(id)}`),
81
+ method: "DELETE",
82
+ headers: _headers,
83
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
84
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
85
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
86
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
87
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
88
+ logging: this._options.logging,
89
+ });
90
+ if (_response.ok) {
91
+ return { data: _response.body, rawResponse: _response.rawResponse };
92
+ }
93
+ if (_response.error.reason === "status-code") {
94
+ switch (_response.error.statusCode) {
95
+ case 400:
96
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
97
+ case 401:
98
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
99
+ case 404:
100
+ throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
101
+ case 500:
102
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
103
+ default:
104
+ throw new errors.PinnacleError({
105
+ statusCode: _response.error.statusCode,
106
+ body: _response.error.body,
107
+ rawResponse: _response.rawResponse,
108
+ });
109
+ }
110
+ }
111
+ switch (_response.error.reason) {
112
+ case "non-json":
113
+ throw new errors.PinnacleError({
114
+ statusCode: _response.error.statusCode,
115
+ body: _response.error.rawBody,
116
+ rawResponse: _response.rawResponse,
117
+ });
118
+ case "timeout":
119
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling DELETE /messages/schedule/{id}.");
120
+ case "unknown":
121
+ throw new errors.PinnacleError({
122
+ message: _response.error.errorMessage,
123
+ rawResponse: _response.rawResponse,
124
+ });
125
+ }
126
+ });
127
+ }
128
+ _getCustomAuthorizationHeaders() {
129
+ return __awaiter(this, void 0, void 0, function* () {
130
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
131
+ return { "PINNACLE-API-KEY": apiKeyValue };
132
+ });
133
+ }
134
+ }
135
+ exports.Schedule = Schedule;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Response containing details about the scheduled blast.
3
+ */
4
+ export interface BlastDetails {
5
+ /** Unique identifier for the blast. This identifier is a string that always begins with the prefix `blast_`, for example: `blast_1234567890`. */
6
+ blastId: string;
7
+ /** The audience ID the blast was sent to. This identifier is a string that always begins with the prefix `aud_`, for example: `aud_abc123`. */
8
+ audienceId: string;
9
+ /** Total number of recipients in the audience. */
10
+ totalRecipients: number;
11
+ /** Total number of messages to be sent. */
12
+ totalMessages: number;
13
+ /** Total number of message segments across all messages. */
14
+ totalSegments: number;
15
+ /** Total estimated cost of the blast. Calculated by multiplying the number of segments by the number of messages by the unit cost. */
16
+ totalCost: number;
17
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -37,6 +37,18 @@ export interface DlcCampaignWithExtendedBrandAndStatus {
37
37
  status: Pinnacle.ProfileStatusEnum;
38
38
  /** Use case for the campaign. */
39
39
  useCase?: DlcCampaignWithExtendedBrandAndStatus.UseCase;
40
+ /**
41
+ * The MNO brand tier for T-Mobile rate limits. Tiers range from `TOP` (highest) to `LOW` (lowest), based on your brand's vetting score.
42
+ *
43
+ * See [SMS Rate Limits](/guides/messages/rate-limits) for details.
44
+ */
45
+ mnoBrandTier?: DlcCampaignWithExtendedBrandAndStatus.MnoBrandTier;
46
+ /**
47
+ * The MNO TCR message class for AT&T, Verizon, and other carriers. Classes `A`-`G` are standard (based on vetting score), while `T`, `N`, and `S` are for special use cases.
48
+ *
49
+ * See [SMS Rate Limits](/guides/messages/rate-limits) for details.
50
+ */
51
+ mnoTcrTier?: DlcCampaignWithExtendedBrandAndStatus.MnoTcrTier;
40
52
  }
41
53
  export declare namespace DlcCampaignWithExtendedBrandAndStatus {
42
54
  /**
@@ -113,4 +125,34 @@ export declare namespace DlcCampaignWithExtendedBrandAndStatus {
113
125
  sub?: Pinnacle.SubUseCaseEnum[];
114
126
  value?: Pinnacle.DlcCampaignUseCaseEnum;
115
127
  }
128
+ /**
129
+ * The MNO brand tier for T-Mobile rate limits. Tiers range from `TOP` (highest) to `LOW` (lowest), based on your brand's vetting score.
130
+ *
131
+ * See [SMS Rate Limits](/guides/messages/rate-limits) for details.
132
+ */
133
+ const MnoBrandTier: {
134
+ readonly Top: "TOP";
135
+ readonly HighMid: "HIGH_MID";
136
+ readonly LowMid: "LOW_MID";
137
+ readonly Low: "LOW";
138
+ };
139
+ type MnoBrandTier = (typeof MnoBrandTier)[keyof typeof MnoBrandTier];
140
+ /**
141
+ * The MNO TCR message class for AT&T, Verizon, and other carriers. Classes `A`-`G` are standard (based on vetting score), while `T`, `N`, and `S` are for special use cases.
142
+ *
143
+ * See [SMS Rate Limits](/guides/messages/rate-limits) for details.
144
+ */
145
+ const MnoTcrTier: {
146
+ readonly A: "A";
147
+ readonly B: "B";
148
+ readonly C: "C";
149
+ readonly D: "D";
150
+ readonly E: "E";
151
+ readonly F: "F";
152
+ readonly G: "G";
153
+ readonly N: "N";
154
+ readonly T: "T";
155
+ readonly S: "S";
156
+ };
157
+ type MnoTcrTier = (typeof MnoTcrTier)[keyof typeof MnoTcrTier];
116
158
  }