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
@@ -1,3 +1,35 @@
1
1
  "use strict";
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.DlcCampaignWithExtendedBrandAndStatus = void 0;
5
+ var DlcCampaignWithExtendedBrandAndStatus;
6
+ (function (DlcCampaignWithExtendedBrandAndStatus) {
7
+ /**
8
+ * The MNO brand tier for T-Mobile rate limits. Tiers range from `TOP` (highest) to `LOW` (lowest), based on your brand's vetting score.
9
+ *
10
+ * See [SMS Rate Limits](/guides/messages/rate-limits) for details.
11
+ */
12
+ DlcCampaignWithExtendedBrandAndStatus.MnoBrandTier = {
13
+ Top: "TOP",
14
+ HighMid: "HIGH_MID",
15
+ LowMid: "LOW_MID",
16
+ Low: "LOW",
17
+ };
18
+ /**
19
+ * 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.
20
+ *
21
+ * See [SMS Rate Limits](/guides/messages/rate-limits) for details.
22
+ */
23
+ DlcCampaignWithExtendedBrandAndStatus.MnoTcrTier = {
24
+ A: "A",
25
+ B: "B",
26
+ C: "C",
27
+ D: "D",
28
+ E: "E",
29
+ F: "F",
30
+ G: "G",
31
+ N: "N",
32
+ T: "T",
33
+ S: "S",
34
+ };
35
+ })(DlcCampaignWithExtendedBrandAndStatus || (exports.DlcCampaignWithExtendedBrandAndStatus = DlcCampaignWithExtendedBrandAndStatus = {}));
@@ -2,22 +2,36 @@
2
2
  * Define when and how your message should be sent.
3
3
  */
4
4
  export interface MessageSchedule {
5
- /** Date and time when you want recurring messages to stop in ISO 8601 format. */
6
- endDate?: string;
7
- /**
8
- * Provide an AWS cron expression to control the when messages are sent. <br>
9
- *
10
- * [Learn more about cron expressions](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-scheduled-rule-pattern.html).
11
- */
12
- recurrence?: string;
13
5
  /**
14
6
  * The date and time you want your message to be sent.
15
- * - Use [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601), for example: `2024-12-17T14:30:00Z`.
7
+ * - Use [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601), for example: `2024-12-17T14:30:00Z`. Format: `YYYY-MM-DDThh:mm` (e.g., `2024-12-25T14:30`).
16
8
  * - This time must be at least 5 minutes in the future.
17
9
  * - The message will be scheduled based on the `timezone` you provide.
18
10
  * - If you set a `recurrence` schedule, this is the start date and time for the recurring schedule.
19
11
  */
20
12
  sendAt: string;
21
- /** Timezone for your scheduled message, using an IANA identifier. */
22
- timezone: string;
13
+ /**
14
+ * AWS cron expression for recurring schedules (6 fields). <br>
15
+ *
16
+ * [Learn more about cron expressions](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-scheduled-rule-pattern.html). <br>
17
+ *
18
+ * **Examples:**
19
+ * - `0 10 * * ? *` - Every day at 10:00 AM
20
+ * - `0/30 * * * ? *` - Every 30 minutes
21
+ * - `0 9 ? * MON-FRI *` - Every weekday at 9:00 AM
22
+ * - `0 12 1 * ? *` - First day of every month at noon
23
+ */
24
+ recurrence?: string;
25
+ /**
26
+ * IANA timezone identifier (e.g., `America/New_York`, `UTC`). <br>
27
+ *
28
+ * Defaults to `UTC` if not specified.
29
+ */
30
+ timezone?: string;
31
+ /**
32
+ * Date and time when recurring messages should stop. <br>
33
+ *
34
+ * Format: `YYYY-MM-DDThh:mm`. Required if `recurrence` is set.
35
+ */
36
+ endDate?: string;
23
37
  }
@@ -1,5 +1,6 @@
1
1
  /** Current status of the message. */
2
2
  export declare const MessageStatusEnum: {
3
+ readonly Queued: "QUEUED";
3
4
  readonly Pending: "PENDING";
4
5
  readonly Sent: "SENT";
5
6
  readonly SendFailed: "SEND_FAILED";
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.MessageStatusEnum = void 0;
5
5
  /** Current status of the message. */
6
6
  exports.MessageStatusEnum = {
7
+ Queued: "QUEUED",
7
8
  Pending: "PENDING",
8
9
  Sent: "SENT",
9
10
  SendFailed: "SEND_FAILED",
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Response returned when a scheduled message or blast is cancelled.
3
+ */
4
+ export interface ScheduleCancelResult {
5
+ /** Indicates whether the schedule was successfully cancelled. */
6
+ success: boolean;
7
+ }
@@ -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,24 @@
1
+ /**
2
+ * Response returned when a blast is scheduled for future delivery.
3
+ */
4
+ export interface ScheduledBlastDetails {
5
+ /** Unique identifier for the scheduled blast. This identifier is a string that always begins with the prefix `msg_sched_`, for example: `msg_sched_xxxxx`. */
6
+ scheduleId: string;
7
+ /** The schedule configuration for the blast. */
8
+ config: ScheduledBlastDetails.Config;
9
+ }
10
+ export declare namespace ScheduledBlastDetails {
11
+ /**
12
+ * The schedule configuration for the blast.
13
+ */
14
+ interface Config {
15
+ /** When the first message will be sent. */
16
+ sendAt?: string;
17
+ /** AWS cron expression for recurring schedules. */
18
+ recurrence?: string;
19
+ /** IANA timezone identifier. */
20
+ timezone?: string;
21
+ /** When recurring schedules will stop. */
22
+ endDate?: string;
23
+ }
24
+ }
@@ -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 });
@@ -8,6 +8,7 @@ export * from "./AutofillDlcCampaignResponse.js";
8
8
  export * from "./BadRequestErrorBody.js";
9
9
  export * from "./BaseRichMessage.js";
10
10
  export * from "./BasicPhoneInformation.js";
11
+ export * from "./BlastDetails.js";
11
12
  export * from "./BrandStatus.js";
12
13
  export * from "./BrandStatusEnum.js";
13
14
  export * from "./ButtonClicked.js";
@@ -16,7 +17,6 @@ export * from "./CampaignEnum.js";
16
17
  export * from "./CampaignQuery.js";
17
18
  export * from "./CampaignSubmissionResult.js";
18
19
  export * from "./CampaignValidationResult.js";
19
- export * from "./CancelScheduledMessageResponse.js";
20
20
  export * from "./CompanyEntityTypeEnum.js";
21
21
  export * from "./CompanySectorEnum.js";
22
22
  export * from "./CompanyTypeEnum.js";
@@ -109,6 +109,8 @@ export * from "./RichMediaMessage.js";
109
109
  export * from "./RichMessage.js";
110
110
  export * from "./RichText.js";
111
111
  export * from "./RichTextMessage.js";
112
+ export * from "./ScheduleCancelResult.js";
113
+ export * from "./ScheduledBlastDetails.js";
112
114
  export * from "./ScheduledMessage.js";
113
115
  export * from "./Sender.js";
114
116
  export * from "./SendRichMessageOptions.js";
@@ -24,6 +24,7 @@ __exportStar(require("./AutofillDlcCampaignResponse.js"), exports);
24
24
  __exportStar(require("./BadRequestErrorBody.js"), exports);
25
25
  __exportStar(require("./BaseRichMessage.js"), exports);
26
26
  __exportStar(require("./BasicPhoneInformation.js"), exports);
27
+ __exportStar(require("./BlastDetails.js"), exports);
27
28
  __exportStar(require("./BrandStatus.js"), exports);
28
29
  __exportStar(require("./BrandStatusEnum.js"), exports);
29
30
  __exportStar(require("./ButtonClicked.js"), exports);
@@ -32,7 +33,6 @@ __exportStar(require("./CampaignEnum.js"), exports);
32
33
  __exportStar(require("./CampaignQuery.js"), exports);
33
34
  __exportStar(require("./CampaignSubmissionResult.js"), exports);
34
35
  __exportStar(require("./CampaignValidationResult.js"), exports);
35
- __exportStar(require("./CancelScheduledMessageResponse.js"), exports);
36
36
  __exportStar(require("./CompanyEntityTypeEnum.js"), exports);
37
37
  __exportStar(require("./CompanySectorEnum.js"), exports);
38
38
  __exportStar(require("./CompanyTypeEnum.js"), exports);
@@ -125,6 +125,8 @@ __exportStar(require("./RichMediaMessage.js"), exports);
125
125
  __exportStar(require("./RichMessage.js"), exports);
126
126
  __exportStar(require("./RichText.js"), exports);
127
127
  __exportStar(require("./RichTextMessage.js"), exports);
128
+ __exportStar(require("./ScheduleCancelResult.js"), exports);
129
+ __exportStar(require("./ScheduledBlastDetails.js"), exports);
128
130
  __exportStar(require("./ScheduledMessage.js"), exports);
129
131
  __exportStar(require("./Sender.js"), exports);
130
132
  __exportStar(require("./SendRichMessageOptions.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.0.7";
1
+ export declare const SDK_VERSION = "2.0.8";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "2.0.7";
4
+ exports.SDK_VERSION = "2.0.8";
@@ -17,8 +17,8 @@ export class PinnacleClient {
17
17
  this._options = Object.assign(Object.assign({}, _options), { logging: core.logging.createLogger(_options === null || _options === void 0 ? void 0 : _options.logging), headers: mergeHeaders({
18
18
  "X-Fern-Language": "JavaScript",
19
19
  "X-Fern-SDK-Name": "rcs-js",
20
- "X-Fern-SDK-Version": "2.0.7",
21
- "User-Agent": "rcs-js/2.0.7",
20
+ "X-Fern-SDK-Version": "2.0.8",
21
+ "User-Agent": "rcs-js/2.0.8",
22
22
  "X-Fern-Runtime": core.RUNTIME.type,
23
23
  "X-Fern-Runtime-Version": core.RUNTIME.version,
24
24
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -1,8 +1,10 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
2
  import * as core from "../../../../core/index.mjs";
3
3
  import * as Pinnacle from "../../../index.mjs";
4
+ import { Blast } from "../resources/blast/client/Client.mjs";
4
5
  import { Mms } from "../resources/mms/client/Client.mjs";
5
6
  import { Rcs } from "../resources/rcs/client/Client.mjs";
7
+ import { Schedule } from "../resources/schedule/client/Client.mjs";
6
8
  import { Sms } from "../resources/sms/client/Client.mjs";
7
9
  export declare namespace Messages {
8
10
  interface Options extends BaseClientOptions {
@@ -15,10 +17,14 @@ export declare class Messages {
15
17
  protected _sms: Sms | undefined;
16
18
  protected _mms: Mms | undefined;
17
19
  protected _rcs: Rcs | undefined;
20
+ protected _blast: Blast | undefined;
21
+ protected _schedule: Schedule | undefined;
18
22
  constructor(_options?: Messages.Options);
19
23
  get sms(): Sms;
20
24
  get mms(): Mms;
21
25
  get rcs(): Rcs;
26
+ get blast(): Blast;
27
+ get schedule(): Schedule;
22
28
  /**
23
29
  * Retrieve a previously sent message.
24
30
  *
@@ -59,26 +65,5 @@ export declare class Messages {
59
65
  */
60
66
  react(request: Pinnacle.ReactMessageParams, requestOptions?: Messages.RequestOptions): core.HttpResponsePromise<Pinnacle.ReactionResult>;
61
67
  private __react;
62
- /**
63
- * Cancel a previously scheduled message before it is sent.
64
- *
65
- * Use the `scheduleId` returned from a scheduled send request (SMS, MMS, or RCS) to cancel the message.
66
- * Once cancelled, the scheduled message will stop being sent.
67
- *
68
- * > **Note:** You cannot cancel a message that has already been sent.
69
- *
70
- * @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`.
71
- * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
72
- *
73
- * @throws {@link Pinnacle.BadRequestError}
74
- * @throws {@link Pinnacle.UnauthorizedError}
75
- * @throws {@link Pinnacle.NotFoundError}
76
- * @throws {@link Pinnacle.InternalServerError}
77
- *
78
- * @example
79
- * await client.messages.cancel("msg_sched_1234567890")
80
- */
81
- cancel(id: string, requestOptions?: Messages.RequestOptions): core.HttpResponsePromise<Pinnacle.CancelScheduledMessageResponse>;
82
- private __cancel;
83
68
  protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
84
69
  }
@@ -13,8 +13,10 @@ import * as core from "../../../../core/index.mjs";
13
13
  import * as environments from "../../../../environments.mjs";
14
14
  import * as errors from "../../../../errors/index.mjs";
15
15
  import * as Pinnacle from "../../../index.mjs";
16
+ import { Blast } from "../resources/blast/client/Client.mjs";
16
17
  import { Mms } from "../resources/mms/client/Client.mjs";
17
18
  import { Rcs } from "../resources/rcs/client/Client.mjs";
19
+ import { Schedule } from "../resources/schedule/client/Client.mjs";
18
20
  import { Sms } from "../resources/sms/client/Client.mjs";
19
21
  export class Messages {
20
22
  constructor(_options = {}) {
@@ -32,6 +34,14 @@ export class Messages {
32
34
  var _a;
33
35
  return ((_a = this._rcs) !== null && _a !== void 0 ? _a : (this._rcs = new Rcs(this._options)));
34
36
  }
37
+ get blast() {
38
+ var _a;
39
+ return ((_a = this._blast) !== null && _a !== void 0 ? _a : (this._blast = new Blast(this._options)));
40
+ }
41
+ get schedule() {
42
+ var _a;
43
+ return ((_a = this._schedule) !== null && _a !== void 0 ? _a : (this._schedule = new Schedule(this._options)));
44
+ }
35
45
  /**
36
46
  * Retrieve a previously sent message.
37
47
  *
@@ -187,84 +197,6 @@ export class Messages {
187
197
  }
188
198
  });
189
199
  }
190
- /**
191
- * Cancel a previously scheduled message before it is sent.
192
- *
193
- * Use the `scheduleId` returned from a scheduled send request (SMS, MMS, or RCS) to cancel the message.
194
- * Once cancelled, the scheduled message will stop being sent.
195
- *
196
- * > **Note:** You cannot cancel a message that has already been sent.
197
- *
198
- * @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`.
199
- * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
200
- *
201
- * @throws {@link Pinnacle.BadRequestError}
202
- * @throws {@link Pinnacle.UnauthorizedError}
203
- * @throws {@link Pinnacle.NotFoundError}
204
- * @throws {@link Pinnacle.InternalServerError}
205
- *
206
- * @example
207
- * await client.messages.cancel("msg_sched_1234567890")
208
- */
209
- cancel(id, requestOptions) {
210
- return core.HttpResponsePromise.fromPromise(this.__cancel(id, requestOptions));
211
- }
212
- __cancel(id, requestOptions) {
213
- return __awaiter(this, void 0, void 0, function* () {
214
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
215
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
216
- const _response = yield core.fetcher({
217
- 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/send/schedule/${core.url.encodePathParam(id)}`),
218
- method: "DELETE",
219
- headers: _headers,
220
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
221
- 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,
222
- 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,
223
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
224
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
225
- logging: this._options.logging,
226
- });
227
- if (_response.ok) {
228
- return {
229
- data: _response.body,
230
- rawResponse: _response.rawResponse,
231
- };
232
- }
233
- if (_response.error.reason === "status-code") {
234
- switch (_response.error.statusCode) {
235
- case 400:
236
- throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
237
- case 401:
238
- throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
239
- case 404:
240
- throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
241
- case 500:
242
- throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
243
- default:
244
- throw new errors.PinnacleError({
245
- statusCode: _response.error.statusCode,
246
- body: _response.error.body,
247
- rawResponse: _response.rawResponse,
248
- });
249
- }
250
- }
251
- switch (_response.error.reason) {
252
- case "non-json":
253
- throw new errors.PinnacleError({
254
- statusCode: _response.error.statusCode,
255
- body: _response.error.rawBody,
256
- rawResponse: _response.rawResponse,
257
- });
258
- case "timeout":
259
- throw new errors.PinnacleTimeoutError("Timeout exceeded when calling DELETE /messages/send/schedule/{id}.");
260
- case "unknown":
261
- throw new errors.PinnacleError({
262
- message: _response.error.errorMessage,
263
- rawResponse: _response.rawResponse,
264
- });
265
- }
266
- });
267
- }
268
200
  _getCustomAuthorizationHeaders() {
269
201
  return __awaiter(this, void 0, void 0, function* () {
270
202
  const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
@@ -0,0 +1,105 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
2
+ import * as core from "../../../../../../core/index.mjs";
3
+ import * as Pinnacle from "../../../../../index.mjs";
4
+ export declare namespace Blast {
5
+ interface Options extends BaseClientOptions {
6
+ }
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class Blast {
11
+ protected readonly _options: Blast.Options;
12
+ constructor(_options?: Blast.Options);
13
+ /**
14
+ * Send an SMS message to all contacts in an audience. <br>
15
+ *
16
+ * Messages are distributed evenly across the provided sender phone numbers. <br>
17
+ *
18
+ * Use the optional `schedule` parameter in `options` to schedule the blast for future delivery. When scheduled, the response will contain a `scheduleId` instead of blast details.
19
+ *
20
+ * @param {Pinnacle.messages.BlastSms} request
21
+ * @param {Blast.RequestOptions} requestOptions - Request-specific configuration.
22
+ *
23
+ * @throws {@link Pinnacle.BadRequestError}
24
+ * @throws {@link Pinnacle.UnauthorizedError}
25
+ * @throws {@link Pinnacle.PaymentRequiredError}
26
+ * @throws {@link Pinnacle.InternalServerError}
27
+ *
28
+ * @example
29
+ * await client.messages.blast.sms({
30
+ * audienceId: "aud_abc123",
31
+ * senders: ["+14155164736", "+14155164737"],
32
+ * message: {
33
+ * text: "Hello from Pinnacle!"
34
+ * }
35
+ * })
36
+ */
37
+ sms(request: Pinnacle.messages.BlastSms, requestOptions?: Blast.RequestOptions): core.HttpResponsePromise<Pinnacle.messages.BlastSmsResponse>;
38
+ private __sms;
39
+ /**
40
+ * Send an MMS message to all contacts in an audience. <br>
41
+ *
42
+ * Messages are distributed evenly across the provided sender phone numbers. <br>
43
+ *
44
+ * Use the optional `schedule` parameter in `options` to schedule the blast for future delivery. When scheduled, the response will contain a `scheduleId` instead of blast details.
45
+ *
46
+ * @param {Pinnacle.messages.BlastMms} request
47
+ * @param {Blast.RequestOptions} requestOptions - Request-specific configuration.
48
+ *
49
+ * @throws {@link Pinnacle.BadRequestError}
50
+ * @throws {@link Pinnacle.UnauthorizedError}
51
+ * @throws {@link Pinnacle.PaymentRequiredError}
52
+ * @throws {@link Pinnacle.InternalServerError}
53
+ *
54
+ * @example
55
+ * await client.messages.blast.mms({
56
+ * audienceId: "aud_abc123",
57
+ * senders: ["+14155164736", "+14155164737"],
58
+ * message: {
59
+ * mediaUrls: ["https://fastly.picsum.photos/id/941/300/300.jpg"],
60
+ * text: "Check out this image!"
61
+ * },
62
+ * options: {
63
+ * validate: true
64
+ * }
65
+ * })
66
+ */
67
+ mms(request: Pinnacle.messages.BlastMms, requestOptions?: Blast.RequestOptions): core.HttpResponsePromise<Pinnacle.messages.BlastMmsResponse>;
68
+ private __mms;
69
+ /**
70
+ * Send an RCS message to all contacts in an audience. <br>
71
+ *
72
+ * Messages are distributed evenly across the provided RCS agents for load balancing. Requires active RCS agents and recipient devices that support RCS Business Messaging. <br>
73
+ *
74
+ * Use the optional `schedule` parameter in `options` to schedule the blast for future delivery. When scheduled, the response will contain a `scheduleId` instead of blast details.
75
+ *
76
+ * @param {Pinnacle.messages.BlastRcs} request
77
+ * @param {Blast.RequestOptions} requestOptions - Request-specific configuration.
78
+ *
79
+ * @throws {@link Pinnacle.BadRequestError}
80
+ * @throws {@link Pinnacle.UnauthorizedError}
81
+ * @throws {@link Pinnacle.PaymentRequiredError}
82
+ * @throws {@link Pinnacle.InternalServerError}
83
+ *
84
+ * @example
85
+ * await client.messages.blast.rcs({
86
+ * audienceId: "aud_abc123",
87
+ * senders: ["agent_pinnacle", "agent_pinnacle2"],
88
+ * message: {
89
+ * quickReplies: [{
90
+ * type: "trigger",
91
+ * payload: "payload",
92
+ * title: "title"
93
+ * }],
94
+ * text: "Hello from Pinnacle RCS!"
95
+ * },
96
+ * options: {
97
+ * transcode: true,
98
+ * validate: true
99
+ * }
100
+ * })
101
+ */
102
+ rcs(request: Pinnacle.messages.BlastRcs, requestOptions?: Blast.RequestOptions): core.HttpResponsePromise<Pinnacle.messages.BlastRcsResponse>;
103
+ private __rcs;
104
+ protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
105
+ }