rcs-js 2.0.2 → 2.0.3-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/messages/resources/index.d.ts +1 -0
  3. package/dist/cjs/api/resources/messages/resources/index.js +1 -0
  4. package/dist/cjs/api/resources/messages/resources/rcs/client/Client.d.ts +33 -0
  5. package/dist/cjs/api/resources/messages/resources/rcs/client/Client.js +90 -0
  6. package/dist/cjs/api/resources/messages/resources/rcs/client/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/messages/resources/rcs/client/index.js +15 -0
  8. package/dist/cjs/api/resources/messages/resources/rcs/client/requests/SendTypingIndicatorSchema.d.ts +38 -0
  9. package/dist/cjs/api/resources/messages/resources/rcs/client/requests/SendTypingIndicatorSchema.js +5 -0
  10. package/dist/cjs/api/resources/messages/resources/rcs/client/requests/index.d.ts +1 -0
  11. package/dist/cjs/api/resources/messages/resources/rcs/client/requests/index.js +2 -0
  12. package/dist/cjs/api/types/MessageEventRcsMediaContent.d.ts +2 -1
  13. package/dist/cjs/api/types/Options.d.ts +21 -0
  14. package/dist/cjs/api/types/Options.js +5 -0
  15. package/dist/cjs/api/types/RcsButtonOpenUrl.d.ts +31 -2
  16. package/dist/cjs/api/types/RcsButtonOpenUrl.js +9 -0
  17. package/dist/cjs/api/types/RcsButtonSendLocation.d.ts +8 -2
  18. package/dist/cjs/api/types/RichCardsMessage.d.ts +51 -1
  19. package/dist/cjs/api/types/RichCardsMessage.js +18 -0
  20. package/dist/cjs/api/types/SendTypingIndicatorResponse.d.ts +22 -0
  21. package/dist/cjs/api/types/SendTypingIndicatorResponse.js +5 -0
  22. package/dist/cjs/api/types/index.d.ts +2 -0
  23. package/dist/cjs/api/types/index.js +2 -0
  24. package/dist/cjs/version.d.ts +1 -1
  25. package/dist/cjs/version.js +1 -1
  26. package/dist/cjs/wrapper/messages/Client.js +8 -3
  27. package/dist/esm/Client.mjs +2 -2
  28. package/dist/esm/api/resources/messages/resources/index.d.mts +1 -0
  29. package/dist/esm/api/resources/messages/resources/index.mjs +1 -0
  30. package/dist/esm/api/resources/messages/resources/rcs/client/Client.d.mts +33 -0
  31. package/dist/esm/api/resources/messages/resources/rcs/client/Client.mjs +90 -0
  32. package/dist/esm/api/resources/messages/resources/rcs/client/index.d.mts +1 -0
  33. package/dist/esm/api/resources/messages/resources/rcs/client/index.mjs +1 -1
  34. package/dist/esm/api/resources/messages/resources/rcs/client/requests/SendTypingIndicatorSchema.d.mts +38 -0
  35. package/dist/esm/api/resources/messages/resources/rcs/client/requests/SendTypingIndicatorSchema.mjs +4 -0
  36. package/dist/esm/api/resources/messages/resources/rcs/client/requests/index.d.mts +1 -0
  37. package/dist/esm/api/resources/messages/resources/rcs/client/requests/index.mjs +1 -0
  38. package/dist/esm/api/types/MessageEventRcsMediaContent.d.mts +2 -1
  39. package/dist/esm/api/types/Options.d.mts +21 -0
  40. package/dist/esm/api/types/Options.mjs +4 -0
  41. package/dist/esm/api/types/RcsButtonOpenUrl.d.mts +31 -2
  42. package/dist/esm/api/types/RcsButtonOpenUrl.mjs +8 -1
  43. package/dist/esm/api/types/RcsButtonSendLocation.d.mts +8 -2
  44. package/dist/esm/api/types/RichCardsMessage.d.mts +51 -1
  45. package/dist/esm/api/types/RichCardsMessage.mjs +17 -1
  46. package/dist/esm/api/types/SendTypingIndicatorResponse.d.mts +22 -0
  47. package/dist/esm/api/types/SendTypingIndicatorResponse.mjs +4 -0
  48. package/dist/esm/api/types/index.d.mts +2 -0
  49. package/dist/esm/api/types/index.mjs +2 -0
  50. package/dist/esm/version.d.mts +1 -1
  51. package/dist/esm/version.mjs +1 -1
  52. package/dist/esm/wrapper/messages/Client.mjs +8 -3
  53. package/package.json +1 -1
  54. package/reference.md +79 -0
@@ -54,8 +54,8 @@ class PinnacleClient {
54
54
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
55
55
  "X-Fern-Language": "JavaScript",
56
56
  "X-Fern-SDK-Name": "rcs-js",
57
- "X-Fern-SDK-Version": "2.0.2",
58
- "User-Agent": "rcs-js/2.0.2",
57
+ "X-Fern-SDK-Version": "2.0.3-rc.1",
58
+ "User-Agent": "rcs-js/2.0.3-rc.1",
59
59
  "X-Fern-Runtime": core.RUNTIME.type,
60
60
  "X-Fern-Runtime-Version": core.RUNTIME.version,
61
61
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -6,3 +6,4 @@ export * as rcs from "./rcs/index.js";
6
6
  export * from "./rcs/types/index.js";
7
7
  export * from "./sms/client/requests/index.js";
8
8
  export * from "./mms/client/requests/index.js";
9
+ export * from "./rcs/client/requests/index.js";
@@ -45,3 +45,4 @@ exports.rcs = __importStar(require("./rcs/index.js"));
45
45
  __exportStar(require("./rcs/types/index.js"), exports);
46
46
  __exportStar(require("./sms/client/requests/index.js"), exports);
47
47
  __exportStar(require("./mms/client/requests/index.js"), exports);
48
+ __exportStar(require("./rcs/client/requests/index.js"), exports);
@@ -58,6 +58,39 @@ export declare class Rcs {
58
58
  */
59
59
  send(request: Pinnacle.RichMessage, requestOptions?: Rcs.RequestOptions): core.HttpResponsePromise<Pinnacle.messages.RcsSendResponse>;
60
60
  private __send;
61
+ /**
62
+ * Send a typing indicator from an RCS agent to a recipient.
63
+ *
64
+ * This endpoint allows RCS agents to display a typing indicator to recipients. The indicator is a message bubble with animated typing dots like this: <img src="https://server.trypinnacle.app/storage/v1/object/public/pinnacle-public-assets/ios-typing-indicator.png" alt="Typing Indicator" style="display: inline; height: 1.5em; vertical-align: middle; margin: 0 4px;" />
65
+ *
66
+ * **Use Case:** Typing indicators are especially useful for providing feedback to users while the agent is thinking or generating a response that may take some time, creating a more engaging conversational experience.
67
+ *
68
+ * **Expiration:** Typing indicators automatically expire after around 20 seconds or when the agent sends a message, whichever comes first.
69
+ *
70
+ * **Frequency:** You can send typing indicators as many times as needed, though only one will be displayed at a time. Sending multiple typing indicators will extend the duration of the current indicator.
71
+ *
72
+ * > **Note:** Typing indicators are best-effort hints, not delivery-guaranteed state. The platform is allowed to coalesce or drop them, and the client UI decides when to show/hide.
73
+ *
74
+ * @param {Pinnacle.messages.SendTypingIndicatorSchema} request
75
+ * @param {Rcs.RequestOptions} requestOptions - Request-specific configuration.
76
+ *
77
+ * @throws {@link Pinnacle.BadRequestError}
78
+ * @throws {@link Pinnacle.UnauthorizedError}
79
+ * @throws {@link Pinnacle.NotFoundError}
80
+ * @throws {@link Pinnacle.InternalServerError}
81
+ * @throws {@link Pinnacle.NotImplementedError}
82
+ *
83
+ * @example
84
+ * await client.messages.rcs.sendTyping({
85
+ * agentId: "agent_pinnacle",
86
+ * to: "+14154746461",
87
+ * options: {
88
+ * test_mode: false
89
+ * }
90
+ * })
91
+ */
92
+ sendTyping(request: Pinnacle.messages.SendTypingIndicatorSchema, requestOptions?: Rcs.RequestOptions): core.HttpResponsePromise<Pinnacle.SendTypingIndicatorResponse>;
93
+ private __sendTyping;
61
94
  /**
62
95
  * Validate RCS message content without sending it.
63
96
  *
@@ -143,6 +143,96 @@ class Rcs {
143
143
  }
144
144
  });
145
145
  }
146
+ /**
147
+ * Send a typing indicator from an RCS agent to a recipient.
148
+ *
149
+ * This endpoint allows RCS agents to display a typing indicator to recipients. The indicator is a message bubble with animated typing dots like this: <img src="https://server.trypinnacle.app/storage/v1/object/public/pinnacle-public-assets/ios-typing-indicator.png" alt="Typing Indicator" style="display: inline; height: 1.5em; vertical-align: middle; margin: 0 4px;" />
150
+ *
151
+ * **Use Case:** Typing indicators are especially useful for providing feedback to users while the agent is thinking or generating a response that may take some time, creating a more engaging conversational experience.
152
+ *
153
+ * **Expiration:** Typing indicators automatically expire after around 20 seconds or when the agent sends a message, whichever comes first.
154
+ *
155
+ * **Frequency:** You can send typing indicators as many times as needed, though only one will be displayed at a time. Sending multiple typing indicators will extend the duration of the current indicator.
156
+ *
157
+ * > **Note:** Typing indicators are best-effort hints, not delivery-guaranteed state. The platform is allowed to coalesce or drop them, and the client UI decides when to show/hide.
158
+ *
159
+ * @param {Pinnacle.messages.SendTypingIndicatorSchema} request
160
+ * @param {Rcs.RequestOptions} requestOptions - Request-specific configuration.
161
+ *
162
+ * @throws {@link Pinnacle.BadRequestError}
163
+ * @throws {@link Pinnacle.UnauthorizedError}
164
+ * @throws {@link Pinnacle.NotFoundError}
165
+ * @throws {@link Pinnacle.InternalServerError}
166
+ * @throws {@link Pinnacle.NotImplementedError}
167
+ *
168
+ * @example
169
+ * await client.messages.rcs.sendTyping({
170
+ * agentId: "agent_pinnacle",
171
+ * to: "+14154746461",
172
+ * options: {
173
+ * test_mode: false
174
+ * }
175
+ * })
176
+ */
177
+ sendTyping(request, requestOptions) {
178
+ return core.HttpResponsePromise.fromPromise(this.__sendTyping(request, requestOptions));
179
+ }
180
+ __sendTyping(request, requestOptions) {
181
+ return __awaiter(this, void 0, void 0, function* () {
182
+ var _a, _b, _c;
183
+ let _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);
184
+ const _response = yield core.fetcher({
185
+ 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/typing"),
186
+ method: "POST",
187
+ headers: _headers,
188
+ contentType: "application/json",
189
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
190
+ requestType: "json",
191
+ body: request,
192
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
193
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
194
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
195
+ });
196
+ if (_response.ok) {
197
+ return { data: _response.body, rawResponse: _response.rawResponse };
198
+ }
199
+ if (_response.error.reason === "status-code") {
200
+ switch (_response.error.statusCode) {
201
+ case 400:
202
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
203
+ case 401:
204
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
205
+ case 404:
206
+ throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
207
+ case 500:
208
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
209
+ case 501:
210
+ throw new Pinnacle.NotImplementedError(_response.error.body, _response.rawResponse);
211
+ default:
212
+ throw new errors.PinnacleError({
213
+ statusCode: _response.error.statusCode,
214
+ body: _response.error.body,
215
+ rawResponse: _response.rawResponse,
216
+ });
217
+ }
218
+ }
219
+ switch (_response.error.reason) {
220
+ case "non-json":
221
+ throw new errors.PinnacleError({
222
+ statusCode: _response.error.statusCode,
223
+ body: _response.error.rawBody,
224
+ rawResponse: _response.rawResponse,
225
+ });
226
+ case "timeout":
227
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /messages/typing.");
228
+ case "unknown":
229
+ throw new errors.PinnacleError({
230
+ message: _response.error.errorMessage,
231
+ rawResponse: _response.rawResponse,
232
+ });
233
+ }
234
+ });
235
+ }
146
236
  /**
147
237
  * Validate RCS message content without sending it.
148
238
  *
@@ -1 +1,2 @@
1
1
  export {};
2
+ export * from "./requests/index.js";
@@ -1,2 +1,17 @@
1
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
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,38 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * agentId: "agent_pinnacle",
8
+ * to: "+14154746461",
9
+ * options: {
10
+ * test_mode: false
11
+ * }
12
+ * }
13
+ */
14
+ export interface SendTypingIndicatorSchema {
15
+ /**
16
+ * The unique identifier of the RCS agent sending the typing indicator. <br>
17
+ *
18
+ * Format: `agent_` followed by alphanumeric characters (e.g., `agent_pinnacle`).
19
+ */
20
+ agentId: string;
21
+ /**
22
+ * The recipient's phone number in E.164 format. <br>
23
+ *
24
+ * Must include country code with a leading plus sign (e.g., `+14155551234`).
25
+ */
26
+ to: string;
27
+ /** Configure how your typing indicator is sent. */
28
+ options?: SendTypingIndicatorSchema.Options;
29
+ }
30
+ export declare namespace SendTypingIndicatorSchema {
31
+ /**
32
+ * Configure how your typing indicator is sent.
33
+ */
34
+ interface Options {
35
+ /** Send via the test agent to whitelisted test devices. Useful for development and debugging. */
36
+ test_mode?: boolean;
37
+ }
38
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export { type SendTypingIndicatorSchema } from "./SendTypingIndicatorSchema.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -15,7 +15,8 @@ export interface MessageEventRcsMediaContent {
15
15
  * To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint.
16
16
  */
17
17
  id: string;
18
- media: Pinnacle.RcsMediaDetailsContent;
18
+ /** URL of the media file. */
19
+ media: string;
19
20
  /** List of interactive quick reply buttons in the message. */
20
21
  quickReplies: Pinnacle.RichButton[];
21
22
  }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Pinnacle from "../index.js";
5
+ /**
6
+ * Configure how your RCS message is sent and tracked.
7
+ */
8
+ export interface Options {
9
+ schedule?: Pinnacle.MessageSchedule;
10
+ /** Send via the test agent to whitelisted test devices. Useful for development and debugging. */
11
+ test_mode?: boolean;
12
+ tracking?: Pinnacle.Tracking;
13
+ /** 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. */
14
+ transcode?: boolean;
15
+ /**
16
+ * Validate your message for any unsupported files. <br>
17
+ *
18
+ * If failed, errors will be thrown and the message will not send.
19
+ */
20
+ validate?: boolean;
21
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,10 +5,39 @@
5
5
  * Button that opens a URL when tapped by the recipient.
6
6
  */
7
7
  export interface RcsButtonOpenUrl {
8
- /** Optional additional data to attach to this button. */
9
- metadata?: string;
8
+ /**
9
+ * Controls how the URL is displayed when the button is tapped.
10
+ *
11
+ * **Default behavior:** If not specified, the URL opens in the device's default browser. If you're sending deeplinks, you should use this mode as it will open the deeplink in the native app if it is installed.
12
+ *
13
+ * **Available modes in order of size:**
14
+ * - `HALF` — Half-screen webview overlay
15
+ * - `TALL` — Tall webview overlay
16
+ * - `FULL` — Full-screen webview
17
+ */
18
+ webviewMode?: RcsButtonOpenUrl.WebviewMode;
10
19
  /** The URL to open when the button is tapped. Must be a valid HTTP or HTTPS URL. */
11
20
  payload: string;
12
21
  /** Display text for the button. */
13
22
  title: string;
23
+ /** Optional additional data to attach to this button. */
24
+ metadata?: string;
25
+ }
26
+ export declare namespace RcsButtonOpenUrl {
27
+ /**
28
+ * Controls how the URL is displayed when the button is tapped.
29
+ *
30
+ * **Default behavior:** If not specified, the URL opens in the device's default browser. If you're sending deeplinks, you should use this mode as it will open the deeplink in the native app if it is installed.
31
+ *
32
+ * **Available modes in order of size:**
33
+ * - `HALF` — Half-screen webview overlay
34
+ * - `TALL` — Tall webview overlay
35
+ * - `FULL` — Full-screen webview
36
+ */
37
+ type WebviewMode = "HALF" | "TALL" | "FULL";
38
+ const WebviewMode: {
39
+ readonly Half: "HALF";
40
+ readonly Tall: "TALL";
41
+ readonly Full: "FULL";
42
+ };
14
43
  }
@@ -3,3 +3,12 @@
3
3
  * This file was auto-generated by Fern from our API Definition.
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.RcsButtonOpenUrl = void 0;
7
+ var RcsButtonOpenUrl;
8
+ (function (RcsButtonOpenUrl) {
9
+ RcsButtonOpenUrl.WebviewMode = {
10
+ Half: "HALF",
11
+ Tall: "TALL",
12
+ Full: "FULL",
13
+ };
14
+ })(RcsButtonOpenUrl || (exports.RcsButtonOpenUrl = RcsButtonOpenUrl = {}));
@@ -5,12 +5,18 @@
5
5
  * Button that shares a specific location with the recipient when tapped.
6
6
  */
7
7
  export interface RcsButtonSendLocation {
8
+ /**
9
+ * Optional name or label for the location that will be displayed in the map app (e.g., "Central Park", "Home Office").
10
+ *
11
+ * If not provided, the button title will be used as the location name.
12
+ */
13
+ name?: string;
8
14
  /** Geographic coordinates of the location to share. */
9
15
  latLong: RcsButtonSendLocation.LatLong;
10
- /** Optional additional data to attach to this button. */
11
- metadata?: string;
12
16
  /** Display text for the button. */
13
17
  title: string;
18
+ /** Optional additional data to attach to this button. */
19
+ metadata?: string;
14
20
  }
15
21
  export declare namespace RcsButtonSendLocation {
16
22
  /**
@@ -2,5 +2,55 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Pinnacle from "../index.js";
5
- export interface RichCardsMessage extends Pinnacle.RcsBase, Pinnacle.RcsCards {
5
+ export interface RichCardsMessage extends Pinnacle.RcsCards {
6
+ options?: RichCardsMessage.Options;
7
+ /** Your RCS agent ID which must be prefixed with 'agent_'. */
8
+ from: string;
9
+ /** Recipient's phone number in E.164 format. */
10
+ to: string;
11
+ }
12
+ export declare namespace RichCardsMessage {
13
+ interface Options extends Pinnacle.Options {
14
+ /**
15
+ * Configure standalone card layout options for enhanced visual presentation.
16
+ *
17
+ * > **⚠️ Important Restriction**
18
+ * >
19
+ * > This option is **only valid for single card messages**. Using it with multiple cards will cause the request to fail with a validation error.
20
+ */
21
+ standalone_card?: Options.StandaloneCard;
22
+ }
23
+ namespace Options {
24
+ /**
25
+ * Configure standalone card layout options for enhanced visual presentation.
26
+ *
27
+ * > **⚠️ Important Restriction**
28
+ * >
29
+ * > This option is **only valid for single card messages**. Using it with multiple cards will cause the request to fail with a validation error.
30
+ */
31
+ interface StandaloneCard {
32
+ /** The orientation of the standalone card. */
33
+ orientation?: StandaloneCard.Orientation;
34
+ /** The alignment of the image in the standalone card. */
35
+ image_alignment?: StandaloneCard.ImageAlignment;
36
+ }
37
+ namespace StandaloneCard {
38
+ /**
39
+ * The orientation of the standalone card.
40
+ */
41
+ type Orientation = "HORIZONTAL" | "VERTICAL";
42
+ const Orientation: {
43
+ readonly Horizontal: "HORIZONTAL";
44
+ readonly Vertical: "VERTICAL";
45
+ };
46
+ /**
47
+ * The alignment of the image in the standalone card.
48
+ */
49
+ type ImageAlignment = "LEFT" | "RIGHT";
50
+ const ImageAlignment: {
51
+ readonly Left: "LEFT";
52
+ readonly Right: "RIGHT";
53
+ };
54
+ }
55
+ }
6
56
  }
@@ -3,3 +3,21 @@
3
3
  * This file was auto-generated by Fern from our API Definition.
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.RichCardsMessage = void 0;
7
+ var RichCardsMessage;
8
+ (function (RichCardsMessage) {
9
+ let Options;
10
+ (function (Options) {
11
+ let StandaloneCard;
12
+ (function (StandaloneCard) {
13
+ StandaloneCard.Orientation = {
14
+ Horizontal: "HORIZONTAL",
15
+ Vertical: "VERTICAL",
16
+ };
17
+ StandaloneCard.ImageAlignment = {
18
+ Left: "LEFT",
19
+ Right: "RIGHT",
20
+ };
21
+ })(StandaloneCard = Options.StandaloneCard || (Options.StandaloneCard = {}));
22
+ })(Options = RichCardsMessage.Options || (RichCardsMessage.Options = {}));
23
+ })(RichCardsMessage || (exports.RichCardsMessage = RichCardsMessage = {}));
@@ -0,0 +1,22 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Response schema confirming the typing indicator was sent.
6
+ */
7
+ export interface SendTypingIndicatorResponse {
8
+ /** Indicates whether the typing indicator was successfully sent. */
9
+ success: boolean;
10
+ /** The RCS agent that sent the typing indicator. */
11
+ agentId: string;
12
+ /** The recipient's phone number that received the typing indicator. */
13
+ recipient: string;
14
+ /** Timestamp when the typing indicator was started (ISO 8601 format). */
15
+ startedAt: string;
16
+ /**
17
+ * Timestamp when the typing indicator will automatically expire (ISO 8601 format). <br>
18
+ *
19
+ * This is typically one minute after `startedAt` unless a message is sent first.
20
+ */
21
+ endedAt: string;
22
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -80,9 +80,11 @@ export * from "./RcsBase.js";
80
80
  export * from "./RichTextMessage.js";
81
81
  export * from "./RichMediaMessage.js";
82
82
  export * from "./RcsCards.js";
83
+ export * from "./Options.js";
83
84
  export * from "./RichCardsMessage.js";
84
85
  export * from "./RichMessage.js";
85
86
  export * from "./SentRcsDetails.js";
87
+ export * from "./SendTypingIndicatorResponse.js";
86
88
  export * from "./SmsValidationResult.js";
87
89
  export * from "./MmsValidationResult.js";
88
90
  export * from "./RcsValidateContent.js";
@@ -96,9 +96,11 @@ __exportStar(require("./RcsBase.js"), exports);
96
96
  __exportStar(require("./RichTextMessage.js"), exports);
97
97
  __exportStar(require("./RichMediaMessage.js"), exports);
98
98
  __exportStar(require("./RcsCards.js"), exports);
99
+ __exportStar(require("./Options.js"), exports);
99
100
  __exportStar(require("./RichCardsMessage.js"), exports);
100
101
  __exportStar(require("./RichMessage.js"), exports);
101
102
  __exportStar(require("./SentRcsDetails.js"), exports);
103
+ __exportStar(require("./SendTypingIndicatorResponse.js"), exports);
102
104
  __exportStar(require("./SmsValidationResult.js"), exports);
103
105
  __exportStar(require("./MmsValidationResult.js"), exports);
104
106
  __exportStar(require("./RcsValidateContent.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.0.2";
1
+ export declare const SDK_VERSION = "2.0.3-rc.1";
@@ -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.2";
4
+ exports.SDK_VERSION = "2.0.3-rc.1";
@@ -15,18 +15,23 @@ const index_js_1 = require("../../api/errors/index.js");
15
15
  class EnhancedMessages extends Client_js_1.Messages {
16
16
  process(req, secret) {
17
17
  return __awaiter(this, void 0, void 0, function* () {
18
- var _a, _b;
18
+ var _a, _b, _c;
19
19
  const signingSecret = secret || process.env.PINNACLE_SIGNING_SECRET;
20
20
  let headerSecret;
21
21
  let body;
22
22
  if (req instanceof Request) {
23
23
  headerSecret =
24
- ((_a = req.headers) === null || _a === void 0 ? void 0 : _a.get("PINNACLE-SIGNING-SECRET")) || ((_b = req.headers) === null || _b === void 0 ? void 0 : _b.get("pinnacle-signing-secret")) || undefined;
24
+ ((_a = req.headers) === null || _a === void 0 ? void 0 : _a.get("PINNACLE-SIGNING-SECRET")) ||
25
+ ((_b = req.headers) === null || _b === void 0 ? void 0 : _b.get("pinnacle-signing-secret")) ||
26
+ ((_c = req.headers) === null || _c === void 0 ? void 0 : _c.get("Pinnacle-Signing-Secret")) ||
27
+ undefined;
25
28
  body = yield req.json();
26
29
  }
27
30
  else {
28
31
  const headers = req.headers;
29
- headerSecret = headers["pinnacle-signing-secret"];
32
+ headerSecret = (headers["PINNACLE-SIGNING-SECRET"] ||
33
+ headers["pinnacle-signing-secret"] ||
34
+ headers["Pinnacle-Signing-Secret"]);
30
35
  body = req.body;
31
36
  }
32
37
  if (!signingSecret) {
@@ -18,8 +18,8 @@ export class PinnacleClient {
18
18
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
19
19
  "X-Fern-Language": "JavaScript",
20
20
  "X-Fern-SDK-Name": "rcs-js",
21
- "X-Fern-SDK-Version": "2.0.2",
22
- "User-Agent": "rcs-js/2.0.2",
21
+ "X-Fern-SDK-Version": "2.0.3-rc.1",
22
+ "User-Agent": "rcs-js/2.0.3-rc.1",
23
23
  "X-Fern-Runtime": core.RUNTIME.type,
24
24
  "X-Fern-Runtime-Version": core.RUNTIME.version,
25
25
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -6,3 +6,4 @@ export * as rcs from "./rcs/index.mjs";
6
6
  export * from "./rcs/types/index.mjs";
7
7
  export * from "./sms/client/requests/index.mjs";
8
8
  export * from "./mms/client/requests/index.mjs";
9
+ export * from "./rcs/client/requests/index.mjs";
@@ -6,3 +6,4 @@ export * as rcs from "./rcs/index.mjs";
6
6
  export * from "./rcs/types/index.mjs";
7
7
  export * from "./sms/client/requests/index.mjs";
8
8
  export * from "./mms/client/requests/index.mjs";
9
+ export * from "./rcs/client/requests/index.mjs";
@@ -58,6 +58,39 @@ export declare class Rcs {
58
58
  */
59
59
  send(request: Pinnacle.RichMessage, requestOptions?: Rcs.RequestOptions): core.HttpResponsePromise<Pinnacle.messages.RcsSendResponse>;
60
60
  private __send;
61
+ /**
62
+ * Send a typing indicator from an RCS agent to a recipient.
63
+ *
64
+ * This endpoint allows RCS agents to display a typing indicator to recipients. The indicator is a message bubble with animated typing dots like this: <img src="https://server.trypinnacle.app/storage/v1/object/public/pinnacle-public-assets/ios-typing-indicator.png" alt="Typing Indicator" style="display: inline; height: 1.5em; vertical-align: middle; margin: 0 4px;" />
65
+ *
66
+ * **Use Case:** Typing indicators are especially useful for providing feedback to users while the agent is thinking or generating a response that may take some time, creating a more engaging conversational experience.
67
+ *
68
+ * **Expiration:** Typing indicators automatically expire after around 20 seconds or when the agent sends a message, whichever comes first.
69
+ *
70
+ * **Frequency:** You can send typing indicators as many times as needed, though only one will be displayed at a time. Sending multiple typing indicators will extend the duration of the current indicator.
71
+ *
72
+ * > **Note:** Typing indicators are best-effort hints, not delivery-guaranteed state. The platform is allowed to coalesce or drop them, and the client UI decides when to show/hide.
73
+ *
74
+ * @param {Pinnacle.messages.SendTypingIndicatorSchema} request
75
+ * @param {Rcs.RequestOptions} requestOptions - Request-specific configuration.
76
+ *
77
+ * @throws {@link Pinnacle.BadRequestError}
78
+ * @throws {@link Pinnacle.UnauthorizedError}
79
+ * @throws {@link Pinnacle.NotFoundError}
80
+ * @throws {@link Pinnacle.InternalServerError}
81
+ * @throws {@link Pinnacle.NotImplementedError}
82
+ *
83
+ * @example
84
+ * await client.messages.rcs.sendTyping({
85
+ * agentId: "agent_pinnacle",
86
+ * to: "+14154746461",
87
+ * options: {
88
+ * test_mode: false
89
+ * }
90
+ * })
91
+ */
92
+ sendTyping(request: Pinnacle.messages.SendTypingIndicatorSchema, requestOptions?: Rcs.RequestOptions): core.HttpResponsePromise<Pinnacle.SendTypingIndicatorResponse>;
93
+ private __sendTyping;
61
94
  /**
62
95
  * Validate RCS message content without sending it.
63
96
  *
@@ -107,6 +107,96 @@ export class Rcs {
107
107
  }
108
108
  });
109
109
  }
110
+ /**
111
+ * Send a typing indicator from an RCS agent to a recipient.
112
+ *
113
+ * This endpoint allows RCS agents to display a typing indicator to recipients. The indicator is a message bubble with animated typing dots like this: <img src="https://server.trypinnacle.app/storage/v1/object/public/pinnacle-public-assets/ios-typing-indicator.png" alt="Typing Indicator" style="display: inline; height: 1.5em; vertical-align: middle; margin: 0 4px;" />
114
+ *
115
+ * **Use Case:** Typing indicators are especially useful for providing feedback to users while the agent is thinking or generating a response that may take some time, creating a more engaging conversational experience.
116
+ *
117
+ * **Expiration:** Typing indicators automatically expire after around 20 seconds or when the agent sends a message, whichever comes first.
118
+ *
119
+ * **Frequency:** You can send typing indicators as many times as needed, though only one will be displayed at a time. Sending multiple typing indicators will extend the duration of the current indicator.
120
+ *
121
+ * > **Note:** Typing indicators are best-effort hints, not delivery-guaranteed state. The platform is allowed to coalesce or drop them, and the client UI decides when to show/hide.
122
+ *
123
+ * @param {Pinnacle.messages.SendTypingIndicatorSchema} request
124
+ * @param {Rcs.RequestOptions} requestOptions - Request-specific configuration.
125
+ *
126
+ * @throws {@link Pinnacle.BadRequestError}
127
+ * @throws {@link Pinnacle.UnauthorizedError}
128
+ * @throws {@link Pinnacle.NotFoundError}
129
+ * @throws {@link Pinnacle.InternalServerError}
130
+ * @throws {@link Pinnacle.NotImplementedError}
131
+ *
132
+ * @example
133
+ * await client.messages.rcs.sendTyping({
134
+ * agentId: "agent_pinnacle",
135
+ * to: "+14154746461",
136
+ * options: {
137
+ * test_mode: false
138
+ * }
139
+ * })
140
+ */
141
+ sendTyping(request, requestOptions) {
142
+ return core.HttpResponsePromise.fromPromise(this.__sendTyping(request, requestOptions));
143
+ }
144
+ __sendTyping(request, requestOptions) {
145
+ return __awaiter(this, void 0, void 0, function* () {
146
+ var _a, _b, _c;
147
+ let _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);
148
+ const _response = yield core.fetcher({
149
+ 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/typing"),
150
+ method: "POST",
151
+ headers: _headers,
152
+ contentType: "application/json",
153
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
154
+ requestType: "json",
155
+ body: request,
156
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
157
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
158
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
159
+ });
160
+ if (_response.ok) {
161
+ return { data: _response.body, rawResponse: _response.rawResponse };
162
+ }
163
+ if (_response.error.reason === "status-code") {
164
+ switch (_response.error.statusCode) {
165
+ case 400:
166
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
167
+ case 401:
168
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
169
+ case 404:
170
+ throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
171
+ case 500:
172
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
173
+ case 501:
174
+ throw new Pinnacle.NotImplementedError(_response.error.body, _response.rawResponse);
175
+ default:
176
+ throw new errors.PinnacleError({
177
+ statusCode: _response.error.statusCode,
178
+ body: _response.error.body,
179
+ rawResponse: _response.rawResponse,
180
+ });
181
+ }
182
+ }
183
+ switch (_response.error.reason) {
184
+ case "non-json":
185
+ throw new errors.PinnacleError({
186
+ statusCode: _response.error.statusCode,
187
+ body: _response.error.rawBody,
188
+ rawResponse: _response.rawResponse,
189
+ });
190
+ case "timeout":
191
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /messages/typing.");
192
+ case "unknown":
193
+ throw new errors.PinnacleError({
194
+ message: _response.error.errorMessage,
195
+ rawResponse: _response.rawResponse,
196
+ });
197
+ }
198
+ });
199
+ }
110
200
  /**
111
201
  * Validate RCS message content without sending it.
112
202
  *
@@ -1 +1,2 @@
1
1
  export {};
2
+ export * from "./requests/index.mjs";
@@ -1 +1 @@
1
- export {};
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,38 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * agentId: "agent_pinnacle",
8
+ * to: "+14154746461",
9
+ * options: {
10
+ * test_mode: false
11
+ * }
12
+ * }
13
+ */
14
+ export interface SendTypingIndicatorSchema {
15
+ /**
16
+ * The unique identifier of the RCS agent sending the typing indicator. <br>
17
+ *
18
+ * Format: `agent_` followed by alphanumeric characters (e.g., `agent_pinnacle`).
19
+ */
20
+ agentId: string;
21
+ /**
22
+ * The recipient's phone number in E.164 format. <br>
23
+ *
24
+ * Must include country code with a leading plus sign (e.g., `+14155551234`).
25
+ */
26
+ to: string;
27
+ /** Configure how your typing indicator is sent. */
28
+ options?: SendTypingIndicatorSchema.Options;
29
+ }
30
+ export declare namespace SendTypingIndicatorSchema {
31
+ /**
32
+ * Configure how your typing indicator is sent.
33
+ */
34
+ interface Options {
35
+ /** Send via the test agent to whitelisted test devices. Useful for development and debugging. */
36
+ test_mode?: boolean;
37
+ }
38
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1 @@
1
+ export { type SendTypingIndicatorSchema } from "./SendTypingIndicatorSchema.mjs";
@@ -15,7 +15,8 @@ export interface MessageEventRcsMediaContent {
15
15
  * To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint.
16
16
  */
17
17
  id: string;
18
- media: Pinnacle.RcsMediaDetailsContent;
18
+ /** URL of the media file. */
19
+ media: string;
19
20
  /** List of interactive quick reply buttons in the message. */
20
21
  quickReplies: Pinnacle.RichButton[];
21
22
  }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Pinnacle from "../index.mjs";
5
+ /**
6
+ * Configure how your RCS message is sent and tracked.
7
+ */
8
+ export interface Options {
9
+ schedule?: Pinnacle.MessageSchedule;
10
+ /** Send via the test agent to whitelisted test devices. Useful for development and debugging. */
11
+ test_mode?: boolean;
12
+ tracking?: Pinnacle.Tracking;
13
+ /** 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. */
14
+ transcode?: boolean;
15
+ /**
16
+ * Validate your message for any unsupported files. <br>
17
+ *
18
+ * If failed, errors will be thrown and the message will not send.
19
+ */
20
+ validate?: boolean;
21
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -5,10 +5,39 @@
5
5
  * Button that opens a URL when tapped by the recipient.
6
6
  */
7
7
  export interface RcsButtonOpenUrl {
8
- /** Optional additional data to attach to this button. */
9
- metadata?: string;
8
+ /**
9
+ * Controls how the URL is displayed when the button is tapped.
10
+ *
11
+ * **Default behavior:** If not specified, the URL opens in the device's default browser. If you're sending deeplinks, you should use this mode as it will open the deeplink in the native app if it is installed.
12
+ *
13
+ * **Available modes in order of size:**
14
+ * - `HALF` — Half-screen webview overlay
15
+ * - `TALL` — Tall webview overlay
16
+ * - `FULL` — Full-screen webview
17
+ */
18
+ webviewMode?: RcsButtonOpenUrl.WebviewMode;
10
19
  /** The URL to open when the button is tapped. Must be a valid HTTP or HTTPS URL. */
11
20
  payload: string;
12
21
  /** Display text for the button. */
13
22
  title: string;
23
+ /** Optional additional data to attach to this button. */
24
+ metadata?: string;
25
+ }
26
+ export declare namespace RcsButtonOpenUrl {
27
+ /**
28
+ * Controls how the URL is displayed when the button is tapped.
29
+ *
30
+ * **Default behavior:** If not specified, the URL opens in the device's default browser. If you're sending deeplinks, you should use this mode as it will open the deeplink in the native app if it is installed.
31
+ *
32
+ * **Available modes in order of size:**
33
+ * - `HALF` — Half-screen webview overlay
34
+ * - `TALL` — Tall webview overlay
35
+ * - `FULL` — Full-screen webview
36
+ */
37
+ type WebviewMode = "HALF" | "TALL" | "FULL";
38
+ const WebviewMode: {
39
+ readonly Half: "HALF";
40
+ readonly Tall: "TALL";
41
+ readonly Full: "FULL";
42
+ };
14
43
  }
@@ -1,4 +1,11 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export {};
4
+ export var RcsButtonOpenUrl;
5
+ (function (RcsButtonOpenUrl) {
6
+ RcsButtonOpenUrl.WebviewMode = {
7
+ Half: "HALF",
8
+ Tall: "TALL",
9
+ Full: "FULL",
10
+ };
11
+ })(RcsButtonOpenUrl || (RcsButtonOpenUrl = {}));
@@ -5,12 +5,18 @@
5
5
  * Button that shares a specific location with the recipient when tapped.
6
6
  */
7
7
  export interface RcsButtonSendLocation {
8
+ /**
9
+ * Optional name or label for the location that will be displayed in the map app (e.g., "Central Park", "Home Office").
10
+ *
11
+ * If not provided, the button title will be used as the location name.
12
+ */
13
+ name?: string;
8
14
  /** Geographic coordinates of the location to share. */
9
15
  latLong: RcsButtonSendLocation.LatLong;
10
- /** Optional additional data to attach to this button. */
11
- metadata?: string;
12
16
  /** Display text for the button. */
13
17
  title: string;
18
+ /** Optional additional data to attach to this button. */
19
+ metadata?: string;
14
20
  }
15
21
  export declare namespace RcsButtonSendLocation {
16
22
  /**
@@ -2,5 +2,55 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Pinnacle from "../index.mjs";
5
- export interface RichCardsMessage extends Pinnacle.RcsBase, Pinnacle.RcsCards {
5
+ export interface RichCardsMessage extends Pinnacle.RcsCards {
6
+ options?: RichCardsMessage.Options;
7
+ /** Your RCS agent ID which must be prefixed with 'agent_'. */
8
+ from: string;
9
+ /** Recipient's phone number in E.164 format. */
10
+ to: string;
11
+ }
12
+ export declare namespace RichCardsMessage {
13
+ interface Options extends Pinnacle.Options {
14
+ /**
15
+ * Configure standalone card layout options for enhanced visual presentation.
16
+ *
17
+ * > **⚠️ Important Restriction**
18
+ * >
19
+ * > This option is **only valid for single card messages**. Using it with multiple cards will cause the request to fail with a validation error.
20
+ */
21
+ standalone_card?: Options.StandaloneCard;
22
+ }
23
+ namespace Options {
24
+ /**
25
+ * Configure standalone card layout options for enhanced visual presentation.
26
+ *
27
+ * > **⚠️ Important Restriction**
28
+ * >
29
+ * > This option is **only valid for single card messages**. Using it with multiple cards will cause the request to fail with a validation error.
30
+ */
31
+ interface StandaloneCard {
32
+ /** The orientation of the standalone card. */
33
+ orientation?: StandaloneCard.Orientation;
34
+ /** The alignment of the image in the standalone card. */
35
+ image_alignment?: StandaloneCard.ImageAlignment;
36
+ }
37
+ namespace StandaloneCard {
38
+ /**
39
+ * The orientation of the standalone card.
40
+ */
41
+ type Orientation = "HORIZONTAL" | "VERTICAL";
42
+ const Orientation: {
43
+ readonly Horizontal: "HORIZONTAL";
44
+ readonly Vertical: "VERTICAL";
45
+ };
46
+ /**
47
+ * The alignment of the image in the standalone card.
48
+ */
49
+ type ImageAlignment = "LEFT" | "RIGHT";
50
+ const ImageAlignment: {
51
+ readonly Left: "LEFT";
52
+ readonly Right: "RIGHT";
53
+ };
54
+ }
55
+ }
6
56
  }
@@ -1,4 +1,20 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export {};
4
+ export var RichCardsMessage;
5
+ (function (RichCardsMessage) {
6
+ let Options;
7
+ (function (Options) {
8
+ let StandaloneCard;
9
+ (function (StandaloneCard) {
10
+ StandaloneCard.Orientation = {
11
+ Horizontal: "HORIZONTAL",
12
+ Vertical: "VERTICAL",
13
+ };
14
+ StandaloneCard.ImageAlignment = {
15
+ Left: "LEFT",
16
+ Right: "RIGHT",
17
+ };
18
+ })(StandaloneCard = Options.StandaloneCard || (Options.StandaloneCard = {}));
19
+ })(Options = RichCardsMessage.Options || (RichCardsMessage.Options = {}));
20
+ })(RichCardsMessage || (RichCardsMessage = {}));
@@ -0,0 +1,22 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Response schema confirming the typing indicator was sent.
6
+ */
7
+ export interface SendTypingIndicatorResponse {
8
+ /** Indicates whether the typing indicator was successfully sent. */
9
+ success: boolean;
10
+ /** The RCS agent that sent the typing indicator. */
11
+ agentId: string;
12
+ /** The recipient's phone number that received the typing indicator. */
13
+ recipient: string;
14
+ /** Timestamp when the typing indicator was started (ISO 8601 format). */
15
+ startedAt: string;
16
+ /**
17
+ * Timestamp when the typing indicator will automatically expire (ISO 8601 format). <br>
18
+ *
19
+ * This is typically one minute after `startedAt` unless a message is sent first.
20
+ */
21
+ endedAt: string;
22
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -80,9 +80,11 @@ export * from "./RcsBase.mjs";
80
80
  export * from "./RichTextMessage.mjs";
81
81
  export * from "./RichMediaMessage.mjs";
82
82
  export * from "./RcsCards.mjs";
83
+ export * from "./Options.mjs";
83
84
  export * from "./RichCardsMessage.mjs";
84
85
  export * from "./RichMessage.mjs";
85
86
  export * from "./SentRcsDetails.mjs";
87
+ export * from "./SendTypingIndicatorResponse.mjs";
86
88
  export * from "./SmsValidationResult.mjs";
87
89
  export * from "./MmsValidationResult.mjs";
88
90
  export * from "./RcsValidateContent.mjs";
@@ -80,9 +80,11 @@ export * from "./RcsBase.mjs";
80
80
  export * from "./RichTextMessage.mjs";
81
81
  export * from "./RichMediaMessage.mjs";
82
82
  export * from "./RcsCards.mjs";
83
+ export * from "./Options.mjs";
83
84
  export * from "./RichCardsMessage.mjs";
84
85
  export * from "./RichMessage.mjs";
85
86
  export * from "./SentRcsDetails.mjs";
87
+ export * from "./SendTypingIndicatorResponse.mjs";
86
88
  export * from "./SmsValidationResult.mjs";
87
89
  export * from "./MmsValidationResult.mjs";
88
90
  export * from "./RcsValidateContent.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.0.2";
1
+ export declare const SDK_VERSION = "2.0.3-rc.1";
@@ -1 +1 @@
1
- export const SDK_VERSION = "2.0.2";
1
+ export const SDK_VERSION = "2.0.3-rc.1";
@@ -12,18 +12,23 @@ import { UnauthorizedError } from "../../api/errors/index.mjs";
12
12
  export class EnhancedMessages extends Messages {
13
13
  process(req, secret) {
14
14
  return __awaiter(this, void 0, void 0, function* () {
15
- var _a, _b;
15
+ var _a, _b, _c;
16
16
  const signingSecret = secret || process.env.PINNACLE_SIGNING_SECRET;
17
17
  let headerSecret;
18
18
  let body;
19
19
  if (req instanceof Request) {
20
20
  headerSecret =
21
- ((_a = req.headers) === null || _a === void 0 ? void 0 : _a.get("PINNACLE-SIGNING-SECRET")) || ((_b = req.headers) === null || _b === void 0 ? void 0 : _b.get("pinnacle-signing-secret")) || undefined;
21
+ ((_a = req.headers) === null || _a === void 0 ? void 0 : _a.get("PINNACLE-SIGNING-SECRET")) ||
22
+ ((_b = req.headers) === null || _b === void 0 ? void 0 : _b.get("pinnacle-signing-secret")) ||
23
+ ((_c = req.headers) === null || _c === void 0 ? void 0 : _c.get("Pinnacle-Signing-Secret")) ||
24
+ undefined;
22
25
  body = yield req.json();
23
26
  }
24
27
  else {
25
28
  const headers = req.headers;
26
- headerSecret = headers["pinnacle-signing-secret"];
29
+ headerSecret = (headers["PINNACLE-SIGNING-SECRET"] ||
30
+ headers["pinnacle-signing-secret"] ||
31
+ headers["Pinnacle-Signing-Secret"]);
27
32
  body = req.body;
28
33
  }
29
34
  if (!signingSecret) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rcs-js",
3
- "version": "2.0.2",
3
+ "version": "2.0.3-rc.1",
4
4
  "private": false,
5
5
  "repository": "github:pinnacle-dev/rcs-js",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -3017,6 +3017,85 @@ await client.messages.rcs.send({
3017
3017
  </dl>
3018
3018
  </details>
3019
3019
 
3020
+ <details><summary><code>client.messages.rcs.<a href="/src/api/resources/messages/resources/rcs/client/Client.ts">sendTyping</a>({ ...params }) -> Pinnacle.SendTypingIndicatorResponse</code></summary>
3021
+ <dl>
3022
+ <dd>
3023
+
3024
+ #### 📝 Description
3025
+
3026
+ <dl>
3027
+ <dd>
3028
+
3029
+ <dl>
3030
+ <dd>
3031
+
3032
+ Send a typing indicator from an RCS agent to a recipient.
3033
+
3034
+ This endpoint allows RCS agents to display a typing indicator to recipients. The indicator is a message bubble with animated typing dots like this: <img src="https://server.trypinnacle.app/storage/v1/object/public/pinnacle-public-assets/ios-typing-indicator.png" alt="Typing Indicator" style="display: inline; height: 1.5em; vertical-align: middle; margin: 0 4px;" />
3035
+
3036
+ **Use Case:** Typing indicators are especially useful for providing feedback to users while the agent is thinking or generating a response that may take some time, creating a more engaging conversational experience.
3037
+
3038
+ **Expiration:** Typing indicators automatically expire after around 20 seconds or when the agent sends a message, whichever comes first.
3039
+
3040
+ **Frequency:** You can send typing indicators as many times as needed, though only one will be displayed at a time. Sending multiple typing indicators will extend the duration of the current indicator.
3041
+
3042
+ > **Note:** Typing indicators are best-effort hints, not delivery-guaranteed state. The platform is allowed to coalesce or drop them, and the client UI decides when to show/hide.
3043
+
3044
+ </dd>
3045
+ </dl>
3046
+ </dd>
3047
+ </dl>
3048
+
3049
+ #### 🔌 Usage
3050
+
3051
+ <dl>
3052
+ <dd>
3053
+
3054
+ <dl>
3055
+ <dd>
3056
+
3057
+ ```typescript
3058
+ await client.messages.rcs.sendTyping({
3059
+ agentId: "agent_pinnacle",
3060
+ to: "+14154746461",
3061
+ options: {
3062
+ test_mode: false,
3063
+ },
3064
+ });
3065
+ ```
3066
+
3067
+ </dd>
3068
+ </dl>
3069
+ </dd>
3070
+ </dl>
3071
+
3072
+ #### ⚙️ Parameters
3073
+
3074
+ <dl>
3075
+ <dd>
3076
+
3077
+ <dl>
3078
+ <dd>
3079
+
3080
+ **request:** `Pinnacle.messages.SendTypingIndicatorSchema`
3081
+
3082
+ </dd>
3083
+ </dl>
3084
+
3085
+ <dl>
3086
+ <dd>
3087
+
3088
+ **requestOptions:** `Rcs.RequestOptions`
3089
+
3090
+ </dd>
3091
+ </dl>
3092
+ </dd>
3093
+ </dl>
3094
+
3095
+ </dd>
3096
+ </dl>
3097
+ </details>
3098
+
3020
3099
  <details><summary><code>client.messages.rcs.<a href="/src/api/resources/messages/resources/rcs/client/Client.ts">validate</a>({ ...params }) -> Pinnacle.RcsValidationResult</code></summary>
3021
3100
  <dl>
3022
3101
  <dd>