rcs-js 2.0.12 → 2.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/conversations/types/ConversationsListMessagesRequestStatus.d.ts +1 -0
- package/dist/cjs/api/resources/conversations/types/ConversationsListMessagesRequestStatus.js +1 -0
- package/dist/cjs/api/resources/messages/resources/blast/client/Client.d.ts +4 -0
- package/dist/cjs/api/resources/messages/resources/blast/client/Client.js +4 -0
- package/dist/cjs/api/resources/messages/resources/blast/client/requests/BlastRcs.d.ts +9 -0
- package/dist/cjs/api/types/BaseRichMessage.d.ts +1 -0
- package/dist/cjs/api/types/FallbackMessage.d.ts +32 -0
- package/dist/cjs/api/types/FallbackMessage.js +3 -0
- package/dist/cjs/api/types/Message.d.ts +8 -0
- package/dist/cjs/api/types/MessageEvent.d.ts +40 -0
- package/dist/cjs/api/types/MessageEvent.js +8 -0
- package/dist/cjs/api/types/MessageEventContent.d.ts +30 -7
- package/dist/cjs/api/types/MessageEventMmsContent.d.ts +0 -2
- package/dist/cjs/api/types/MessageEventRcsButtonData.d.ts +50 -3
- package/dist/cjs/api/types/MessageEventRcsButtonData.js +17 -0
- package/dist/cjs/api/types/MessageEventRcsCardsContent.d.ts +0 -2
- package/dist/cjs/api/types/MessageEventRcsLocationData.d.ts +20 -4
- package/dist/cjs/api/types/MessageEventRcsMediaContent.d.ts +0 -2
- package/dist/cjs/api/types/MessageEventRcsTextContent.d.ts +0 -2
- package/dist/cjs/api/types/MessageEventSmsContent.d.ts +0 -2
- package/dist/cjs/api/types/MessageStatusEnum.d.ts +1 -0
- package/dist/cjs/api/types/MessageStatusEnum.js +1 -0
- package/dist/cjs/api/types/RichCardsMessage.d.ts +1 -0
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/conversations/types/ConversationsListMessagesRequestStatus.d.mts +1 -0
- package/dist/esm/api/resources/conversations/types/ConversationsListMessagesRequestStatus.mjs +1 -0
- package/dist/esm/api/resources/messages/resources/blast/client/Client.d.mts +4 -0
- package/dist/esm/api/resources/messages/resources/blast/client/Client.mjs +4 -0
- package/dist/esm/api/resources/messages/resources/blast/client/requests/BlastRcs.d.mts +9 -0
- package/dist/esm/api/types/BaseRichMessage.d.mts +1 -0
- package/dist/esm/api/types/FallbackMessage.d.mts +32 -0
- package/dist/esm/api/types/FallbackMessage.mjs +2 -0
- package/dist/esm/api/types/Message.d.mts +8 -0
- package/dist/esm/api/types/MessageEvent.d.mts +40 -0
- package/dist/esm/api/types/MessageEvent.mjs +8 -0
- package/dist/esm/api/types/MessageEventContent.d.mts +30 -7
- package/dist/esm/api/types/MessageEventMmsContent.d.mts +0 -2
- package/dist/esm/api/types/MessageEventRcsButtonData.d.mts +50 -3
- package/dist/esm/api/types/MessageEventRcsButtonData.mjs +16 -1
- package/dist/esm/api/types/MessageEventRcsCardsContent.d.mts +0 -2
- package/dist/esm/api/types/MessageEventRcsLocationData.d.mts +20 -4
- package/dist/esm/api/types/MessageEventRcsMediaContent.d.mts +0 -2
- package/dist/esm/api/types/MessageEventRcsTextContent.d.mts +0 -2
- package/dist/esm/api/types/MessageEventSmsContent.d.mts +0 -2
- package/dist/esm/api/types/MessageStatusEnum.d.mts +1 -0
- package/dist/esm/api/types/MessageStatusEnum.mjs +1 -0
- package/dist/esm/api/types/RichCardsMessage.d.mts +1 -0
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +4 -0
package/dist/cjs/Client.js
CHANGED
|
@@ -53,8 +53,8 @@ class PinnacleClient {
|
|
|
53
53
|
this._options = Object.assign(Object.assign({}, _options), { logging: core.logging.createLogger(_options === null || _options === void 0 ? void 0 : _options.logging), headers: (0, headers_js_1.mergeHeaders)({
|
|
54
54
|
"X-Fern-Language": "JavaScript",
|
|
55
55
|
"X-Fern-SDK-Name": "rcs-js",
|
|
56
|
-
"X-Fern-SDK-Version": "2.0.
|
|
57
|
-
"User-Agent": "rcs-js/2.0.
|
|
56
|
+
"X-Fern-SDK-Version": "2.0.13",
|
|
57
|
+
"User-Agent": "rcs-js/2.0.13",
|
|
58
58
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
59
59
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
60
60
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
package/dist/cjs/api/resources/conversations/types/ConversationsListMessagesRequestStatus.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const ConversationsListMessagesRequestStatus: {
|
|
|
4
4
|
readonly SendFailed: "SEND_FAILED";
|
|
5
5
|
readonly Delivered: "DELIVERED";
|
|
6
6
|
readonly DeliveryFailed: "DELIVERY_FAILED";
|
|
7
|
+
readonly FallbackSent: "FALLBACK_SENT";
|
|
7
8
|
readonly Received: "RECEIVED";
|
|
8
9
|
readonly Read: "READ";
|
|
9
10
|
};
|
|
@@ -96,6 +96,10 @@ export declare class Blast {
|
|
|
96
96
|
* }],
|
|
97
97
|
* text: "Hello from Pinnacle RCS!"
|
|
98
98
|
* },
|
|
99
|
+
* fallback: {
|
|
100
|
+
* from: "+14155164736",
|
|
101
|
+
* text: "Hello from Pinnacle! Reply LEARN to learn more."
|
|
102
|
+
* },
|
|
99
103
|
* options: {
|
|
100
104
|
* transcode: true,
|
|
101
105
|
* validate: true
|
|
@@ -257,6 +257,10 @@ class Blast {
|
|
|
257
257
|
* }],
|
|
258
258
|
* text: "Hello from Pinnacle RCS!"
|
|
259
259
|
* },
|
|
260
|
+
* fallback: {
|
|
261
|
+
* from: "+14155164736",
|
|
262
|
+
* text: "Hello from Pinnacle! Reply LEARN to learn more."
|
|
263
|
+
* },
|
|
260
264
|
* options: {
|
|
261
265
|
* transcode: true,
|
|
262
266
|
* validate: true
|
|
@@ -12,6 +12,10 @@ import type * as Pinnacle from "../../../../../../index.js";
|
|
|
12
12
|
* }],
|
|
13
13
|
* text: "Hello from Pinnacle RCS!"
|
|
14
14
|
* },
|
|
15
|
+
* fallback: {
|
|
16
|
+
* from: "+14155164736",
|
|
17
|
+
* text: "Hello from Pinnacle! Reply LEARN to learn more."
|
|
18
|
+
* },
|
|
15
19
|
* options: {
|
|
16
20
|
* transcode: true,
|
|
17
21
|
* validate: true
|
|
@@ -30,6 +34,10 @@ import type * as Pinnacle from "../../../../../../index.js";
|
|
|
30
34
|
* }],
|
|
31
35
|
* text: "Hello from Pinnacle RCS!"
|
|
32
36
|
* },
|
|
37
|
+
* fallback: {
|
|
38
|
+
* from: "+14155164736",
|
|
39
|
+
* text: "Hello from Pinnacle! Reply LEARN to learn more."
|
|
40
|
+
* },
|
|
33
41
|
* options: {
|
|
34
42
|
* transcode: true,
|
|
35
43
|
* validate: true
|
|
@@ -54,6 +62,7 @@ export interface BlastRcs {
|
|
|
54
62
|
*/
|
|
55
63
|
senders: string[];
|
|
56
64
|
message: Pinnacle.RcsValidateContent;
|
|
65
|
+
fallback?: Pinnacle.FallbackMessage;
|
|
57
66
|
/** Configure how your RCS blast is sent and tracked. */
|
|
58
67
|
options?: BlastRcs.Options;
|
|
59
68
|
}
|
|
@@ -2,6 +2,7 @@ import type * as Pinnacle from "../index.js";
|
|
|
2
2
|
export interface BaseRichMessage {
|
|
3
3
|
/** Your RCS agent ID which must be prefixed with 'agent_'. */
|
|
4
4
|
from: string;
|
|
5
|
+
fallback?: Pinnacle.FallbackMessage;
|
|
5
6
|
/** Configure how your RCS message is sent and tracked. */
|
|
6
7
|
options?: Pinnacle.SendRichMessageOptions;
|
|
7
8
|
/** Recipient's phone number in E.164 format. */
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SMS/MMS fallback message to send if the RCS message fails to deliver.
|
|
3
|
+
*
|
|
4
|
+
* When a recipient's device doesn't support RCS or the RCS message cannot be delivered, this fallback message will be sent as SMS or MMS instead. The fallback is sent from the specified phone number.
|
|
5
|
+
*
|
|
6
|
+
* > **Note:** At least one of `text` or `mediaUrls` must be provided. Fallback messages require a verified `from` phone number with SMS/MMS sending capabilities.
|
|
7
|
+
* > **Note:** You will not be charged for the fallback message, only the original RCS message will be charged.
|
|
8
|
+
*/
|
|
9
|
+
export interface FallbackMessage {
|
|
10
|
+
/**
|
|
11
|
+
* Phone number to send the fallback message from in E.164 format.
|
|
12
|
+
*
|
|
13
|
+
* Must be a verified phone number with SMS/MMS sending capabilities. Sandbox numbers cannot be used for fallbacks. The phone number must be connected an active toll-free or 10DLC campaign.
|
|
14
|
+
*/
|
|
15
|
+
from: string;
|
|
16
|
+
/**
|
|
17
|
+
* Text content for the fallback message.
|
|
18
|
+
*
|
|
19
|
+
* At least one of `text` or `mediaUrls` must be provided.
|
|
20
|
+
*
|
|
21
|
+
* > **Note:** If text exceeds 3072 characters, the fallback will be sent as MMS instead of SMS.
|
|
22
|
+
*/
|
|
23
|
+
text?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Media file URLs to include in the fallback MMS message.
|
|
26
|
+
*
|
|
27
|
+
* See [supported media types](https://app.pinnacle.sh/supported-file-types?type=MMS).
|
|
28
|
+
*
|
|
29
|
+
* If provided, the fallback will be sent as MMS. Otherwise, it will be sent as SMS (unless text exceeds 3072 characters). At least one of `text` or `mediaUrls` must be provided.
|
|
30
|
+
*/
|
|
31
|
+
mediaUrls?: string[];
|
|
32
|
+
}
|
|
@@ -19,6 +19,14 @@ export interface Message {
|
|
|
19
19
|
* Null indicates no errors.
|
|
20
20
|
*/
|
|
21
21
|
error: string | null;
|
|
22
|
+
/**
|
|
23
|
+
* The fallback SMS/MMS message configuration for this RCS message.
|
|
24
|
+
*
|
|
25
|
+
* Null indicates no fallback was configured for this message. Only applicable for RCS messages.
|
|
26
|
+
*
|
|
27
|
+
* The original RCS message with have status `FALLBACK_SENT` when the fallback message was sent instead.
|
|
28
|
+
*/
|
|
29
|
+
fallback?: Pinnacle.FallbackMessage | null;
|
|
22
30
|
/** Unique identifier of the message. This identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. */
|
|
23
31
|
id: string;
|
|
24
32
|
method: Pinnacle.MessageMethodEnum;
|
|
@@ -20,6 +20,14 @@ export interface MessageEvent {
|
|
|
20
20
|
*/
|
|
21
21
|
deliveredAt?: string | null;
|
|
22
22
|
message: Pinnacle.MessageEventContent;
|
|
23
|
+
/**
|
|
24
|
+
* Details of the fallback SMS/MMS message that was sent instead of the original RCS message.
|
|
25
|
+
*
|
|
26
|
+
* This field is only present when the message `status` is `FALLBACK_SENT`, indicating the original RCS message could not be delivered and a fallback message was sent instead.
|
|
27
|
+
*
|
|
28
|
+
* Use this information to track which fallback messages were sent and their content.
|
|
29
|
+
*/
|
|
30
|
+
fallbackMessage?: MessageEvent.FallbackMessage | null;
|
|
23
31
|
}
|
|
24
32
|
export declare namespace MessageEvent {
|
|
25
33
|
/**
|
|
@@ -42,4 +50,36 @@ export declare namespace MessageEvent {
|
|
|
42
50
|
readonly Outbound: "OUTBOUND";
|
|
43
51
|
};
|
|
44
52
|
type Direction = (typeof Direction)[keyof typeof Direction];
|
|
53
|
+
/**
|
|
54
|
+
* Details of the fallback SMS/MMS message that was sent instead of the original RCS message.
|
|
55
|
+
*
|
|
56
|
+
* This field is only present when the message `status` is `FALLBACK_SENT`, indicating the original RCS message could not be delivered and a fallback message was sent instead.
|
|
57
|
+
*
|
|
58
|
+
* Use this information to track which fallback messages were sent and their content.
|
|
59
|
+
*/
|
|
60
|
+
interface FallbackMessage {
|
|
61
|
+
/**
|
|
62
|
+
* Unique identifier of the fallback message. This identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
|
|
63
|
+
* To get the full message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint.
|
|
64
|
+
*/
|
|
65
|
+
id: string;
|
|
66
|
+
/** Type of the fallback message sent. */
|
|
67
|
+
type: FallbackMessage.Type;
|
|
68
|
+
/** Phone number the fallback message was sent from in E.164 format. */
|
|
69
|
+
from: string;
|
|
70
|
+
/** Recipient's phone number in E.164 format. */
|
|
71
|
+
to: string;
|
|
72
|
+
/** Text content of the fallback message. */
|
|
73
|
+
text?: string;
|
|
74
|
+
/** Media URLs included in the fallback MMS message. Empty array for SMS fallbacks. */
|
|
75
|
+
mediaUrls?: string[];
|
|
76
|
+
}
|
|
77
|
+
namespace FallbackMessage {
|
|
78
|
+
/** Type of the fallback message sent. */
|
|
79
|
+
const Type: {
|
|
80
|
+
readonly Sms: "SMS";
|
|
81
|
+
readonly Mms: "MMS";
|
|
82
|
+
};
|
|
83
|
+
type Type = (typeof Type)[keyof typeof Type];
|
|
84
|
+
}
|
|
45
85
|
}
|
|
@@ -9,4 +9,12 @@ var MessageEvent;
|
|
|
9
9
|
Inbound: "INBOUND",
|
|
10
10
|
Outbound: "OUTBOUND",
|
|
11
11
|
};
|
|
12
|
+
let FallbackMessage;
|
|
13
|
+
(function (FallbackMessage) {
|
|
14
|
+
/** Type of the fallback message sent. */
|
|
15
|
+
FallbackMessage.Type = {
|
|
16
|
+
Sms: "SMS",
|
|
17
|
+
Mms: "MMS",
|
|
18
|
+
};
|
|
19
|
+
})(FallbackMessage = MessageEvent.FallbackMessage || (MessageEvent.FallbackMessage = {}));
|
|
12
20
|
})(MessageEvent || (exports.MessageEvent = MessageEvent = {}));
|
|
@@ -5,22 +5,45 @@ import type * as Pinnacle from "../index.js";
|
|
|
5
5
|
export type MessageEventContent =
|
|
6
6
|
/**
|
|
7
7
|
* SMS message containing plain text only. Has type `SMS`. */
|
|
8
|
-
Pinnacle.
|
|
8
|
+
Pinnacle.MessageEventContent.Sms
|
|
9
9
|
/**
|
|
10
10
|
* MMS message with text and/or media files from a phone number. Has type `MMS`. */
|
|
11
|
-
| Pinnacle.
|
|
11
|
+
| Pinnacle.MessageEventContent.Mms
|
|
12
12
|
/**
|
|
13
13
|
* RCS message containing longer text content with optional quick reply buttons. Has type `RCS_TEXT`. */
|
|
14
|
-
| Pinnacle.
|
|
14
|
+
| Pinnacle.MessageEventContent.RcsText
|
|
15
15
|
/**
|
|
16
16
|
* RCS message containing media file with optional quick reply buttons. Has type `RCS_MEDIA`. */
|
|
17
|
-
| Pinnacle.
|
|
17
|
+
| Pinnacle.MessageEventContent.RcsMedia
|
|
18
18
|
/**
|
|
19
19
|
* RCS message containing cards with titles, subtitles, and buttons. Has type `RCS_CARDS`. */
|
|
20
|
-
| Pinnacle.
|
|
20
|
+
| Pinnacle.MessageEventContent.RcsCards
|
|
21
21
|
/**
|
|
22
22
|
* RCS button click data. Sent when user clicks any button. Has type `RCS_BUTTON_DATA`. */
|
|
23
|
-
| Pinnacle.
|
|
23
|
+
| Pinnacle.MessageEventContent.RcsButtonData
|
|
24
24
|
/**
|
|
25
25
|
* RCS location sharing data. Sent when user shares their location via a `requestUserLocation` button. Has type `RCS_LOCATION_DATA`. */
|
|
26
|
-
| Pinnacle.
|
|
26
|
+
| Pinnacle.MessageEventContent.RcsLocationData;
|
|
27
|
+
export declare namespace MessageEventContent {
|
|
28
|
+
interface Sms extends Pinnacle.MessageEventSmsContent {
|
|
29
|
+
type: "SMS";
|
|
30
|
+
}
|
|
31
|
+
interface Mms extends Pinnacle.MessageEventMmsContent {
|
|
32
|
+
type: "MMS";
|
|
33
|
+
}
|
|
34
|
+
interface RcsText extends Pinnacle.MessageEventRcsTextContent {
|
|
35
|
+
type: "RCS_TEXT";
|
|
36
|
+
}
|
|
37
|
+
interface RcsMedia extends Pinnacle.MessageEventRcsMediaContent {
|
|
38
|
+
type: "RCS_MEDIA";
|
|
39
|
+
}
|
|
40
|
+
interface RcsCards extends Pinnacle.MessageEventRcsCardsContent {
|
|
41
|
+
type: "RCS_CARDS";
|
|
42
|
+
}
|
|
43
|
+
interface RcsButtonData extends Pinnacle.MessageEventRcsButtonData {
|
|
44
|
+
type: "RCS_BUTTON_DATA";
|
|
45
|
+
}
|
|
46
|
+
interface RcsLocationData extends Pinnacle.MessageEventRcsLocationData {
|
|
47
|
+
type: "RCS_LOCATION_DATA";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
* MMS message with text and/or media files from a phone number.
|
|
3
3
|
*/
|
|
4
4
|
export interface MessageEventMmsContent {
|
|
5
|
-
/** Message type identifier. */
|
|
6
|
-
type: "MMS";
|
|
7
5
|
/**
|
|
8
6
|
* Unique identifier of the message. This identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
|
|
9
7
|
* To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint.
|
|
@@ -4,12 +4,59 @@ import type * as Pinnacle from "../index.js";
|
|
|
4
4
|
*
|
|
5
5
|
* This event contains information about which button was clicked, how many times it's been clicked, and any payload or metadata attached to the button. Use this data to handle user interactions with your RCS messages.
|
|
6
6
|
*/
|
|
7
|
-
export interface MessageEventRcsButtonData
|
|
8
|
-
/** Message type identifier. */
|
|
9
|
-
type: "RCS_BUTTON_DATA";
|
|
7
|
+
export interface MessageEventRcsButtonData {
|
|
10
8
|
/**
|
|
11
9
|
* Unique identifier of the message. This identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
|
|
12
10
|
* To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint.
|
|
13
11
|
*/
|
|
14
12
|
id: string;
|
|
13
|
+
/** Information about the button that was clicked. */
|
|
14
|
+
button: MessageEventRcsButtonData.Button;
|
|
15
|
+
/** ID of the message this button was sent in, or null if not available. To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint. */
|
|
16
|
+
messageId: string | null;
|
|
17
|
+
}
|
|
18
|
+
export declare namespace MessageEventRcsButtonData {
|
|
19
|
+
/**
|
|
20
|
+
* Information about the button that was clicked.
|
|
21
|
+
*/
|
|
22
|
+
interface Button {
|
|
23
|
+
/**
|
|
24
|
+
* Type of button clicked.
|
|
25
|
+
* - `CARD` for card buttons,
|
|
26
|
+
* - `QUICK_REPLY` for quick replies.
|
|
27
|
+
* - `null` if we cannot determine the button type. This is a rare edge case and is mainly here for backward compatibility.
|
|
28
|
+
*/
|
|
29
|
+
type?: Button.Type | null;
|
|
30
|
+
/** Raw button data. Contains the entire button that was clicked by the user. In rare cases where we cannot determine the exact button, this will return only the button title. */
|
|
31
|
+
raw: Button.Raw;
|
|
32
|
+
/** Extracted payload from the button's `payload` field, if provided. Provides quick access to any payload that was attached to the button. */
|
|
33
|
+
payload?: string | null;
|
|
34
|
+
/** Additional metadata attached to the button's `metadata` field, if provided. */
|
|
35
|
+
metadata?: string | null;
|
|
36
|
+
/** Number of times the button has been clicked. */
|
|
37
|
+
clicks: number;
|
|
38
|
+
}
|
|
39
|
+
namespace Button {
|
|
40
|
+
/**
|
|
41
|
+
* Type of button clicked.
|
|
42
|
+
* - `CARD` for card buttons,
|
|
43
|
+
* - `QUICK_REPLY` for quick replies.
|
|
44
|
+
* - `null` if we cannot determine the button type. This is a rare edge case and is mainly here for backward compatibility.
|
|
45
|
+
*/
|
|
46
|
+
const Type: {
|
|
47
|
+
readonly Card: "CARD";
|
|
48
|
+
readonly QuickReply: "QUICK_REPLY";
|
|
49
|
+
};
|
|
50
|
+
type Type = (typeof Type)[keyof typeof Type];
|
|
51
|
+
/**
|
|
52
|
+
* Raw button data. Contains the entire button that was clicked by the user. In rare cases where we cannot determine the exact button, this will return only the button title.
|
|
53
|
+
*/
|
|
54
|
+
type Raw =
|
|
55
|
+
/**
|
|
56
|
+
* Full button object if we can determine the exact button. */
|
|
57
|
+
Pinnacle.RichButton
|
|
58
|
+
/**
|
|
59
|
+
* Button title if we cannot determine the exact button. This is a rare edge case and is mainly here for backward compatibility. */
|
|
60
|
+
| string;
|
|
61
|
+
}
|
|
15
62
|
}
|
|
@@ -1,3 +1,20 @@
|
|
|
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.MessageEventRcsButtonData = void 0;
|
|
5
|
+
var MessageEventRcsButtonData;
|
|
6
|
+
(function (MessageEventRcsButtonData) {
|
|
7
|
+
let Button;
|
|
8
|
+
(function (Button) {
|
|
9
|
+
/**
|
|
10
|
+
* Type of button clicked.
|
|
11
|
+
* - `CARD` for card buttons,
|
|
12
|
+
* - `QUICK_REPLY` for quick replies.
|
|
13
|
+
* - `null` if we cannot determine the button type. This is a rare edge case and is mainly here for backward compatibility.
|
|
14
|
+
*/
|
|
15
|
+
Button.Type = {
|
|
16
|
+
Card: "CARD",
|
|
17
|
+
QuickReply: "QUICK_REPLY",
|
|
18
|
+
};
|
|
19
|
+
})(Button = MessageEventRcsButtonData.Button || (MessageEventRcsButtonData.Button = {}));
|
|
20
|
+
})(MessageEventRcsButtonData || (exports.MessageEventRcsButtonData = MessageEventRcsButtonData = {}));
|
|
@@ -5,8 +5,6 @@ import type * as Pinnacle from "../index.js";
|
|
|
5
5
|
* See [supported file types](https://app.pinnacle.sh/supported-file-types?type=RCS-CARD).
|
|
6
6
|
*/
|
|
7
7
|
export interface MessageEventRcsCardsContent {
|
|
8
|
-
/** Message type identifier. */
|
|
9
|
-
type: "RCS_CARDS";
|
|
10
8
|
/**
|
|
11
9
|
* Unique identifier of the message. This identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
|
|
12
10
|
* To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint.
|
|
@@ -1,15 +1,31 @@
|
|
|
1
|
-
import type * as Pinnacle from "../index.js";
|
|
2
1
|
/**
|
|
3
2
|
* Location sharing event data received when a user responds to a `requestUserLocation` button and shares their current location.
|
|
4
3
|
*
|
|
5
4
|
* This event contains the geographic coordinates (latitude/longitude) and human-readable address of the location the user chose to share. Use this data to process location-based requests or provide location-specific services.
|
|
6
5
|
*/
|
|
7
|
-
export interface MessageEventRcsLocationData
|
|
8
|
-
/** Message type identifier. */
|
|
9
|
-
type: "RCS_LOCATION_DATA";
|
|
6
|
+
export interface MessageEventRcsLocationData {
|
|
10
7
|
/**
|
|
11
8
|
* Unique identifier of the message. This identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
|
|
12
9
|
* To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint.
|
|
13
10
|
*/
|
|
14
11
|
id: string;
|
|
12
|
+
/** Location data shared by the user. */
|
|
13
|
+
data: MessageEventRcsLocationData.Data;
|
|
14
|
+
/** ID of the message this button was sent in, or null if not available. To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint. */
|
|
15
|
+
messageId?: string | null;
|
|
16
|
+
}
|
|
17
|
+
export declare namespace MessageEventRcsLocationData {
|
|
18
|
+
/**
|
|
19
|
+
* Location data shared by the user.
|
|
20
|
+
*/
|
|
21
|
+
interface Data {
|
|
22
|
+
/** Address corresponding to the shared location. */
|
|
23
|
+
address: string;
|
|
24
|
+
/** Latitude of the shared location. */
|
|
25
|
+
latitude: number;
|
|
26
|
+
/** Longitude of the shared location. */
|
|
27
|
+
longitude: number;
|
|
28
|
+
/** Text message sent with the location. */
|
|
29
|
+
text?: string;
|
|
30
|
+
}
|
|
15
31
|
}
|
|
@@ -5,8 +5,6 @@ import type * as Pinnacle from "../index.js";
|
|
|
5
5
|
* See [supported file types](https://app.pinnacle.sh/supported-file-types?type=RCS-MEDIA).
|
|
6
6
|
*/
|
|
7
7
|
export interface MessageEventRcsMediaContent {
|
|
8
|
-
/** Message type identifier. */
|
|
9
|
-
type: "RCS_MEDIA";
|
|
10
8
|
/**
|
|
11
9
|
* Unique identifier of the message. This identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
|
|
12
10
|
* To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint.
|
|
@@ -3,8 +3,6 @@ import type * as Pinnacle from "../index.js";
|
|
|
3
3
|
* RCS message containing longer text content with optional quick reply buttons.
|
|
4
4
|
*/
|
|
5
5
|
export interface MessageEventRcsTextContent {
|
|
6
|
-
/** Message type identifier. */
|
|
7
|
-
type: "RCS_TEXT";
|
|
8
6
|
/**
|
|
9
7
|
* Unique identifier of the message. This identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
|
|
10
8
|
* To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint.
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
* SMS message containing plain text only.
|
|
3
3
|
*/
|
|
4
4
|
export interface MessageEventSmsContent {
|
|
5
|
-
/** Message type identifier. */
|
|
6
|
-
type: "SMS";
|
|
7
5
|
/**
|
|
8
6
|
* Unique identifier of the message. This identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
|
|
9
7
|
* To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint.
|
|
@@ -8,5 +8,6 @@ export declare const MessageStatusEnum: {
|
|
|
8
8
|
readonly DeliveryFailed: "DELIVERY_FAILED";
|
|
9
9
|
readonly Received: "RECEIVED";
|
|
10
10
|
readonly Read: "READ";
|
|
11
|
+
readonly FallbackSent: "FALLBACK_SENT";
|
|
11
12
|
};
|
|
12
13
|
export type MessageStatusEnum = (typeof MessageStatusEnum)[keyof typeof MessageStatusEnum];
|
|
@@ -3,6 +3,7 @@ export interface RichCardsMessage extends Pinnacle.RichCards {
|
|
|
3
3
|
options?: RichCardsMessage.Options;
|
|
4
4
|
/** Your RCS agent ID which must be prefixed with 'agent_'. */
|
|
5
5
|
from: string;
|
|
6
|
+
fallback?: Pinnacle.FallbackMessage;
|
|
6
7
|
/** Recipient's phone number in E.164 format. */
|
|
7
8
|
to: string;
|
|
8
9
|
}
|
|
@@ -40,6 +40,7 @@ export * from "./Error_.js";
|
|
|
40
40
|
export * from "./ExtendedBrand.js";
|
|
41
41
|
export * from "./ExtendedBrandWithVetting.js";
|
|
42
42
|
export * from "./ExtendedRcsCampaign.js";
|
|
43
|
+
export * from "./FallbackMessage.js";
|
|
43
44
|
export * from "./GetConversationParams.js";
|
|
44
45
|
export * from "./LinkClickEvent.js";
|
|
45
46
|
export * from "./LocationShareAction.js";
|
|
@@ -56,6 +56,7 @@ __exportStar(require("./Error_.js"), exports);
|
|
|
56
56
|
__exportStar(require("./ExtendedBrand.js"), exports);
|
|
57
57
|
__exportStar(require("./ExtendedBrandWithVetting.js"), exports);
|
|
58
58
|
__exportStar(require("./ExtendedRcsCampaign.js"), exports);
|
|
59
|
+
__exportStar(require("./FallbackMessage.js"), exports);
|
|
59
60
|
__exportStar(require("./GetConversationParams.js"), exports);
|
|
60
61
|
__exportStar(require("./LinkClickEvent.js"), exports);
|
|
61
62
|
__exportStar(require("./LocationShareAction.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.
|
|
1
|
+
export declare const SDK_VERSION = "2.0.13";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -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.
|
|
21
|
-
"User-Agent": "rcs-js/2.0.
|
|
20
|
+
"X-Fern-SDK-Version": "2.0.13",
|
|
21
|
+
"User-Agent": "rcs-js/2.0.13",
|
|
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) });
|
package/dist/esm/api/resources/conversations/types/ConversationsListMessagesRequestStatus.d.mts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const ConversationsListMessagesRequestStatus: {
|
|
|
4
4
|
readonly SendFailed: "SEND_FAILED";
|
|
5
5
|
readonly Delivered: "DELIVERED";
|
|
6
6
|
readonly DeliveryFailed: "DELIVERY_FAILED";
|
|
7
|
+
readonly FallbackSent: "FALLBACK_SENT";
|
|
7
8
|
readonly Received: "RECEIVED";
|
|
8
9
|
readonly Read: "READ";
|
|
9
10
|
};
|
|
@@ -96,6 +96,10 @@ export declare class Blast {
|
|
|
96
96
|
* }],
|
|
97
97
|
* text: "Hello from Pinnacle RCS!"
|
|
98
98
|
* },
|
|
99
|
+
* fallback: {
|
|
100
|
+
* from: "+14155164736",
|
|
101
|
+
* text: "Hello from Pinnacle! Reply LEARN to learn more."
|
|
102
|
+
* },
|
|
99
103
|
* options: {
|
|
100
104
|
* transcode: true,
|
|
101
105
|
* validate: true
|
|
@@ -221,6 +221,10 @@ export class Blast {
|
|
|
221
221
|
* }],
|
|
222
222
|
* text: "Hello from Pinnacle RCS!"
|
|
223
223
|
* },
|
|
224
|
+
* fallback: {
|
|
225
|
+
* from: "+14155164736",
|
|
226
|
+
* text: "Hello from Pinnacle! Reply LEARN to learn more."
|
|
227
|
+
* },
|
|
224
228
|
* options: {
|
|
225
229
|
* transcode: true,
|
|
226
230
|
* validate: true
|
|
@@ -12,6 +12,10 @@ import type * as Pinnacle from "../../../../../../index.mjs";
|
|
|
12
12
|
* }],
|
|
13
13
|
* text: "Hello from Pinnacle RCS!"
|
|
14
14
|
* },
|
|
15
|
+
* fallback: {
|
|
16
|
+
* from: "+14155164736",
|
|
17
|
+
* text: "Hello from Pinnacle! Reply LEARN to learn more."
|
|
18
|
+
* },
|
|
15
19
|
* options: {
|
|
16
20
|
* transcode: true,
|
|
17
21
|
* validate: true
|
|
@@ -30,6 +34,10 @@ import type * as Pinnacle from "../../../../../../index.mjs";
|
|
|
30
34
|
* }],
|
|
31
35
|
* text: "Hello from Pinnacle RCS!"
|
|
32
36
|
* },
|
|
37
|
+
* fallback: {
|
|
38
|
+
* from: "+14155164736",
|
|
39
|
+
* text: "Hello from Pinnacle! Reply LEARN to learn more."
|
|
40
|
+
* },
|
|
33
41
|
* options: {
|
|
34
42
|
* transcode: true,
|
|
35
43
|
* validate: true
|
|
@@ -54,6 +62,7 @@ export interface BlastRcs {
|
|
|
54
62
|
*/
|
|
55
63
|
senders: string[];
|
|
56
64
|
message: Pinnacle.RcsValidateContent;
|
|
65
|
+
fallback?: Pinnacle.FallbackMessage;
|
|
57
66
|
/** Configure how your RCS blast is sent and tracked. */
|
|
58
67
|
options?: BlastRcs.Options;
|
|
59
68
|
}
|
|
@@ -2,6 +2,7 @@ import type * as Pinnacle from "../index.mjs";
|
|
|
2
2
|
export interface BaseRichMessage {
|
|
3
3
|
/** Your RCS agent ID which must be prefixed with 'agent_'. */
|
|
4
4
|
from: string;
|
|
5
|
+
fallback?: Pinnacle.FallbackMessage;
|
|
5
6
|
/** Configure how your RCS message is sent and tracked. */
|
|
6
7
|
options?: Pinnacle.SendRichMessageOptions;
|
|
7
8
|
/** Recipient's phone number in E.164 format. */
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SMS/MMS fallback message to send if the RCS message fails to deliver.
|
|
3
|
+
*
|
|
4
|
+
* When a recipient's device doesn't support RCS or the RCS message cannot be delivered, this fallback message will be sent as SMS or MMS instead. The fallback is sent from the specified phone number.
|
|
5
|
+
*
|
|
6
|
+
* > **Note:** At least one of `text` or `mediaUrls` must be provided. Fallback messages require a verified `from` phone number with SMS/MMS sending capabilities.
|
|
7
|
+
* > **Note:** You will not be charged for the fallback message, only the original RCS message will be charged.
|
|
8
|
+
*/
|
|
9
|
+
export interface FallbackMessage {
|
|
10
|
+
/**
|
|
11
|
+
* Phone number to send the fallback message from in E.164 format.
|
|
12
|
+
*
|
|
13
|
+
* Must be a verified phone number with SMS/MMS sending capabilities. Sandbox numbers cannot be used for fallbacks. The phone number must be connected an active toll-free or 10DLC campaign.
|
|
14
|
+
*/
|
|
15
|
+
from: string;
|
|
16
|
+
/**
|
|
17
|
+
* Text content for the fallback message.
|
|
18
|
+
*
|
|
19
|
+
* At least one of `text` or `mediaUrls` must be provided.
|
|
20
|
+
*
|
|
21
|
+
* > **Note:** If text exceeds 3072 characters, the fallback will be sent as MMS instead of SMS.
|
|
22
|
+
*/
|
|
23
|
+
text?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Media file URLs to include in the fallback MMS message.
|
|
26
|
+
*
|
|
27
|
+
* See [supported media types](https://app.pinnacle.sh/supported-file-types?type=MMS).
|
|
28
|
+
*
|
|
29
|
+
* If provided, the fallback will be sent as MMS. Otherwise, it will be sent as SMS (unless text exceeds 3072 characters). At least one of `text` or `mediaUrls` must be provided.
|
|
30
|
+
*/
|
|
31
|
+
mediaUrls?: string[];
|
|
32
|
+
}
|
|
@@ -19,6 +19,14 @@ export interface Message {
|
|
|
19
19
|
* Null indicates no errors.
|
|
20
20
|
*/
|
|
21
21
|
error: string | null;
|
|
22
|
+
/**
|
|
23
|
+
* The fallback SMS/MMS message configuration for this RCS message.
|
|
24
|
+
*
|
|
25
|
+
* Null indicates no fallback was configured for this message. Only applicable for RCS messages.
|
|
26
|
+
*
|
|
27
|
+
* The original RCS message with have status `FALLBACK_SENT` when the fallback message was sent instead.
|
|
28
|
+
*/
|
|
29
|
+
fallback?: Pinnacle.FallbackMessage | null;
|
|
22
30
|
/** Unique identifier of the message. This identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. */
|
|
23
31
|
id: string;
|
|
24
32
|
method: Pinnacle.MessageMethodEnum;
|
|
@@ -20,6 +20,14 @@ export interface MessageEvent {
|
|
|
20
20
|
*/
|
|
21
21
|
deliveredAt?: string | null;
|
|
22
22
|
message: Pinnacle.MessageEventContent;
|
|
23
|
+
/**
|
|
24
|
+
* Details of the fallback SMS/MMS message that was sent instead of the original RCS message.
|
|
25
|
+
*
|
|
26
|
+
* This field is only present when the message `status` is `FALLBACK_SENT`, indicating the original RCS message could not be delivered and a fallback message was sent instead.
|
|
27
|
+
*
|
|
28
|
+
* Use this information to track which fallback messages were sent and their content.
|
|
29
|
+
*/
|
|
30
|
+
fallbackMessage?: MessageEvent.FallbackMessage | null;
|
|
23
31
|
}
|
|
24
32
|
export declare namespace MessageEvent {
|
|
25
33
|
/**
|
|
@@ -42,4 +50,36 @@ export declare namespace MessageEvent {
|
|
|
42
50
|
readonly Outbound: "OUTBOUND";
|
|
43
51
|
};
|
|
44
52
|
type Direction = (typeof Direction)[keyof typeof Direction];
|
|
53
|
+
/**
|
|
54
|
+
* Details of the fallback SMS/MMS message that was sent instead of the original RCS message.
|
|
55
|
+
*
|
|
56
|
+
* This field is only present when the message `status` is `FALLBACK_SENT`, indicating the original RCS message could not be delivered and a fallback message was sent instead.
|
|
57
|
+
*
|
|
58
|
+
* Use this information to track which fallback messages were sent and their content.
|
|
59
|
+
*/
|
|
60
|
+
interface FallbackMessage {
|
|
61
|
+
/**
|
|
62
|
+
* Unique identifier of the fallback message. This identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
|
|
63
|
+
* To get the full message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint.
|
|
64
|
+
*/
|
|
65
|
+
id: string;
|
|
66
|
+
/** Type of the fallback message sent. */
|
|
67
|
+
type: FallbackMessage.Type;
|
|
68
|
+
/** Phone number the fallback message was sent from in E.164 format. */
|
|
69
|
+
from: string;
|
|
70
|
+
/** Recipient's phone number in E.164 format. */
|
|
71
|
+
to: string;
|
|
72
|
+
/** Text content of the fallback message. */
|
|
73
|
+
text?: string;
|
|
74
|
+
/** Media URLs included in the fallback MMS message. Empty array for SMS fallbacks. */
|
|
75
|
+
mediaUrls?: string[];
|
|
76
|
+
}
|
|
77
|
+
namespace FallbackMessage {
|
|
78
|
+
/** Type of the fallback message sent. */
|
|
79
|
+
const Type: {
|
|
80
|
+
readonly Sms: "SMS";
|
|
81
|
+
readonly Mms: "MMS";
|
|
82
|
+
};
|
|
83
|
+
type Type = (typeof Type)[keyof typeof Type];
|
|
84
|
+
}
|
|
45
85
|
}
|
|
@@ -6,4 +6,12 @@ export var MessageEvent;
|
|
|
6
6
|
Inbound: "INBOUND",
|
|
7
7
|
Outbound: "OUTBOUND",
|
|
8
8
|
};
|
|
9
|
+
let FallbackMessage;
|
|
10
|
+
(function (FallbackMessage) {
|
|
11
|
+
/** Type of the fallback message sent. */
|
|
12
|
+
FallbackMessage.Type = {
|
|
13
|
+
Sms: "SMS",
|
|
14
|
+
Mms: "MMS",
|
|
15
|
+
};
|
|
16
|
+
})(FallbackMessage = MessageEvent.FallbackMessage || (MessageEvent.FallbackMessage = {}));
|
|
9
17
|
})(MessageEvent || (MessageEvent = {}));
|
|
@@ -5,22 +5,45 @@ import type * as Pinnacle from "../index.mjs";
|
|
|
5
5
|
export type MessageEventContent =
|
|
6
6
|
/**
|
|
7
7
|
* SMS message containing plain text only. Has type `SMS`. */
|
|
8
|
-
Pinnacle.
|
|
8
|
+
Pinnacle.MessageEventContent.Sms
|
|
9
9
|
/**
|
|
10
10
|
* MMS message with text and/or media files from a phone number. Has type `MMS`. */
|
|
11
|
-
| Pinnacle.
|
|
11
|
+
| Pinnacle.MessageEventContent.Mms
|
|
12
12
|
/**
|
|
13
13
|
* RCS message containing longer text content with optional quick reply buttons. Has type `RCS_TEXT`. */
|
|
14
|
-
| Pinnacle.
|
|
14
|
+
| Pinnacle.MessageEventContent.RcsText
|
|
15
15
|
/**
|
|
16
16
|
* RCS message containing media file with optional quick reply buttons. Has type `RCS_MEDIA`. */
|
|
17
|
-
| Pinnacle.
|
|
17
|
+
| Pinnacle.MessageEventContent.RcsMedia
|
|
18
18
|
/**
|
|
19
19
|
* RCS message containing cards with titles, subtitles, and buttons. Has type `RCS_CARDS`. */
|
|
20
|
-
| Pinnacle.
|
|
20
|
+
| Pinnacle.MessageEventContent.RcsCards
|
|
21
21
|
/**
|
|
22
22
|
* RCS button click data. Sent when user clicks any button. Has type `RCS_BUTTON_DATA`. */
|
|
23
|
-
| Pinnacle.
|
|
23
|
+
| Pinnacle.MessageEventContent.RcsButtonData
|
|
24
24
|
/**
|
|
25
25
|
* RCS location sharing data. Sent when user shares their location via a `requestUserLocation` button. Has type `RCS_LOCATION_DATA`. */
|
|
26
|
-
| Pinnacle.
|
|
26
|
+
| Pinnacle.MessageEventContent.RcsLocationData;
|
|
27
|
+
export declare namespace MessageEventContent {
|
|
28
|
+
interface Sms extends Pinnacle.MessageEventSmsContent {
|
|
29
|
+
type: "SMS";
|
|
30
|
+
}
|
|
31
|
+
interface Mms extends Pinnacle.MessageEventMmsContent {
|
|
32
|
+
type: "MMS";
|
|
33
|
+
}
|
|
34
|
+
interface RcsText extends Pinnacle.MessageEventRcsTextContent {
|
|
35
|
+
type: "RCS_TEXT";
|
|
36
|
+
}
|
|
37
|
+
interface RcsMedia extends Pinnacle.MessageEventRcsMediaContent {
|
|
38
|
+
type: "RCS_MEDIA";
|
|
39
|
+
}
|
|
40
|
+
interface RcsCards extends Pinnacle.MessageEventRcsCardsContent {
|
|
41
|
+
type: "RCS_CARDS";
|
|
42
|
+
}
|
|
43
|
+
interface RcsButtonData extends Pinnacle.MessageEventRcsButtonData {
|
|
44
|
+
type: "RCS_BUTTON_DATA";
|
|
45
|
+
}
|
|
46
|
+
interface RcsLocationData extends Pinnacle.MessageEventRcsLocationData {
|
|
47
|
+
type: "RCS_LOCATION_DATA";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
* MMS message with text and/or media files from a phone number.
|
|
3
3
|
*/
|
|
4
4
|
export interface MessageEventMmsContent {
|
|
5
|
-
/** Message type identifier. */
|
|
6
|
-
type: "MMS";
|
|
7
5
|
/**
|
|
8
6
|
* Unique identifier of the message. This identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
|
|
9
7
|
* To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint.
|
|
@@ -4,12 +4,59 @@ import type * as Pinnacle from "../index.mjs";
|
|
|
4
4
|
*
|
|
5
5
|
* This event contains information about which button was clicked, how many times it's been clicked, and any payload or metadata attached to the button. Use this data to handle user interactions with your RCS messages.
|
|
6
6
|
*/
|
|
7
|
-
export interface MessageEventRcsButtonData
|
|
8
|
-
/** Message type identifier. */
|
|
9
|
-
type: "RCS_BUTTON_DATA";
|
|
7
|
+
export interface MessageEventRcsButtonData {
|
|
10
8
|
/**
|
|
11
9
|
* Unique identifier of the message. This identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
|
|
12
10
|
* To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint.
|
|
13
11
|
*/
|
|
14
12
|
id: string;
|
|
13
|
+
/** Information about the button that was clicked. */
|
|
14
|
+
button: MessageEventRcsButtonData.Button;
|
|
15
|
+
/** ID of the message this button was sent in, or null if not available. To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint. */
|
|
16
|
+
messageId: string | null;
|
|
17
|
+
}
|
|
18
|
+
export declare namespace MessageEventRcsButtonData {
|
|
19
|
+
/**
|
|
20
|
+
* Information about the button that was clicked.
|
|
21
|
+
*/
|
|
22
|
+
interface Button {
|
|
23
|
+
/**
|
|
24
|
+
* Type of button clicked.
|
|
25
|
+
* - `CARD` for card buttons,
|
|
26
|
+
* - `QUICK_REPLY` for quick replies.
|
|
27
|
+
* - `null` if we cannot determine the button type. This is a rare edge case and is mainly here for backward compatibility.
|
|
28
|
+
*/
|
|
29
|
+
type?: Button.Type | null;
|
|
30
|
+
/** Raw button data. Contains the entire button that was clicked by the user. In rare cases where we cannot determine the exact button, this will return only the button title. */
|
|
31
|
+
raw: Button.Raw;
|
|
32
|
+
/** Extracted payload from the button's `payload` field, if provided. Provides quick access to any payload that was attached to the button. */
|
|
33
|
+
payload?: string | null;
|
|
34
|
+
/** Additional metadata attached to the button's `metadata` field, if provided. */
|
|
35
|
+
metadata?: string | null;
|
|
36
|
+
/** Number of times the button has been clicked. */
|
|
37
|
+
clicks: number;
|
|
38
|
+
}
|
|
39
|
+
namespace Button {
|
|
40
|
+
/**
|
|
41
|
+
* Type of button clicked.
|
|
42
|
+
* - `CARD` for card buttons,
|
|
43
|
+
* - `QUICK_REPLY` for quick replies.
|
|
44
|
+
* - `null` if we cannot determine the button type. This is a rare edge case and is mainly here for backward compatibility.
|
|
45
|
+
*/
|
|
46
|
+
const Type: {
|
|
47
|
+
readonly Card: "CARD";
|
|
48
|
+
readonly QuickReply: "QUICK_REPLY";
|
|
49
|
+
};
|
|
50
|
+
type Type = (typeof Type)[keyof typeof Type];
|
|
51
|
+
/**
|
|
52
|
+
* Raw button data. Contains the entire button that was clicked by the user. In rare cases where we cannot determine the exact button, this will return only the button title.
|
|
53
|
+
*/
|
|
54
|
+
type Raw =
|
|
55
|
+
/**
|
|
56
|
+
* Full button object if we can determine the exact button. */
|
|
57
|
+
Pinnacle.RichButton
|
|
58
|
+
/**
|
|
59
|
+
* Button title if we cannot determine the exact button. This is a rare edge case and is mainly here for backward compatibility. */
|
|
60
|
+
| string;
|
|
61
|
+
}
|
|
15
62
|
}
|
|
@@ -1,2 +1,17 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export
|
|
2
|
+
export var MessageEventRcsButtonData;
|
|
3
|
+
(function (MessageEventRcsButtonData) {
|
|
4
|
+
let Button;
|
|
5
|
+
(function (Button) {
|
|
6
|
+
/**
|
|
7
|
+
* Type of button clicked.
|
|
8
|
+
* - `CARD` for card buttons,
|
|
9
|
+
* - `QUICK_REPLY` for quick replies.
|
|
10
|
+
* - `null` if we cannot determine the button type. This is a rare edge case and is mainly here for backward compatibility.
|
|
11
|
+
*/
|
|
12
|
+
Button.Type = {
|
|
13
|
+
Card: "CARD",
|
|
14
|
+
QuickReply: "QUICK_REPLY",
|
|
15
|
+
};
|
|
16
|
+
})(Button = MessageEventRcsButtonData.Button || (MessageEventRcsButtonData.Button = {}));
|
|
17
|
+
})(MessageEventRcsButtonData || (MessageEventRcsButtonData = {}));
|
|
@@ -5,8 +5,6 @@ import type * as Pinnacle from "../index.mjs";
|
|
|
5
5
|
* See [supported file types](https://app.pinnacle.sh/supported-file-types?type=RCS-CARD).
|
|
6
6
|
*/
|
|
7
7
|
export interface MessageEventRcsCardsContent {
|
|
8
|
-
/** Message type identifier. */
|
|
9
|
-
type: "RCS_CARDS";
|
|
10
8
|
/**
|
|
11
9
|
* Unique identifier of the message. This identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
|
|
12
10
|
* To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint.
|
|
@@ -1,15 +1,31 @@
|
|
|
1
|
-
import type * as Pinnacle from "../index.mjs";
|
|
2
1
|
/**
|
|
3
2
|
* Location sharing event data received when a user responds to a `requestUserLocation` button and shares their current location.
|
|
4
3
|
*
|
|
5
4
|
* This event contains the geographic coordinates (latitude/longitude) and human-readable address of the location the user chose to share. Use this data to process location-based requests or provide location-specific services.
|
|
6
5
|
*/
|
|
7
|
-
export interface MessageEventRcsLocationData
|
|
8
|
-
/** Message type identifier. */
|
|
9
|
-
type: "RCS_LOCATION_DATA";
|
|
6
|
+
export interface MessageEventRcsLocationData {
|
|
10
7
|
/**
|
|
11
8
|
* Unique identifier of the message. This identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
|
|
12
9
|
* To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint.
|
|
13
10
|
*/
|
|
14
11
|
id: string;
|
|
12
|
+
/** Location data shared by the user. */
|
|
13
|
+
data: MessageEventRcsLocationData.Data;
|
|
14
|
+
/** ID of the message this button was sent in, or null if not available. To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint. */
|
|
15
|
+
messageId?: string | null;
|
|
16
|
+
}
|
|
17
|
+
export declare namespace MessageEventRcsLocationData {
|
|
18
|
+
/**
|
|
19
|
+
* Location data shared by the user.
|
|
20
|
+
*/
|
|
21
|
+
interface Data {
|
|
22
|
+
/** Address corresponding to the shared location. */
|
|
23
|
+
address: string;
|
|
24
|
+
/** Latitude of the shared location. */
|
|
25
|
+
latitude: number;
|
|
26
|
+
/** Longitude of the shared location. */
|
|
27
|
+
longitude: number;
|
|
28
|
+
/** Text message sent with the location. */
|
|
29
|
+
text?: string;
|
|
30
|
+
}
|
|
15
31
|
}
|
|
@@ -5,8 +5,6 @@ import type * as Pinnacle from "../index.mjs";
|
|
|
5
5
|
* See [supported file types](https://app.pinnacle.sh/supported-file-types?type=RCS-MEDIA).
|
|
6
6
|
*/
|
|
7
7
|
export interface MessageEventRcsMediaContent {
|
|
8
|
-
/** Message type identifier. */
|
|
9
|
-
type: "RCS_MEDIA";
|
|
10
8
|
/**
|
|
11
9
|
* Unique identifier of the message. This identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
|
|
12
10
|
* To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint.
|
|
@@ -3,8 +3,6 @@ import type * as Pinnacle from "../index.mjs";
|
|
|
3
3
|
* RCS message containing longer text content with optional quick reply buttons.
|
|
4
4
|
*/
|
|
5
5
|
export interface MessageEventRcsTextContent {
|
|
6
|
-
/** Message type identifier. */
|
|
7
|
-
type: "RCS_TEXT";
|
|
8
6
|
/**
|
|
9
7
|
* Unique identifier of the message. This identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
|
|
10
8
|
* To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint.
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
* SMS message containing plain text only.
|
|
3
3
|
*/
|
|
4
4
|
export interface MessageEventSmsContent {
|
|
5
|
-
/** Message type identifier. */
|
|
6
|
-
type: "SMS";
|
|
7
5
|
/**
|
|
8
6
|
* Unique identifier of the message. This identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
|
|
9
7
|
* To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint.
|
|
@@ -8,5 +8,6 @@ export declare const MessageStatusEnum: {
|
|
|
8
8
|
readonly DeliveryFailed: "DELIVERY_FAILED";
|
|
9
9
|
readonly Received: "RECEIVED";
|
|
10
10
|
readonly Read: "READ";
|
|
11
|
+
readonly FallbackSent: "FALLBACK_SENT";
|
|
11
12
|
};
|
|
12
13
|
export type MessageStatusEnum = (typeof MessageStatusEnum)[keyof typeof MessageStatusEnum];
|
|
@@ -3,6 +3,7 @@ export interface RichCardsMessage extends Pinnacle.RichCards {
|
|
|
3
3
|
options?: RichCardsMessage.Options;
|
|
4
4
|
/** Your RCS agent ID which must be prefixed with 'agent_'. */
|
|
5
5
|
from: string;
|
|
6
|
+
fallback?: Pinnacle.FallbackMessage;
|
|
6
7
|
/** Recipient's phone number in E.164 format. */
|
|
7
8
|
to: string;
|
|
8
9
|
}
|
|
@@ -40,6 +40,7 @@ export * from "./Error_.mjs";
|
|
|
40
40
|
export * from "./ExtendedBrand.mjs";
|
|
41
41
|
export * from "./ExtendedBrandWithVetting.mjs";
|
|
42
42
|
export * from "./ExtendedRcsCampaign.mjs";
|
|
43
|
+
export * from "./FallbackMessage.mjs";
|
|
43
44
|
export * from "./GetConversationParams.mjs";
|
|
44
45
|
export * from "./LinkClickEvent.mjs";
|
|
45
46
|
export * from "./LocationShareAction.mjs";
|
|
@@ -40,6 +40,7 @@ export * from "./Error_.mjs";
|
|
|
40
40
|
export * from "./ExtendedBrand.mjs";
|
|
41
41
|
export * from "./ExtendedBrandWithVetting.mjs";
|
|
42
42
|
export * from "./ExtendedRcsCampaign.mjs";
|
|
43
|
+
export * from "./FallbackMessage.mjs";
|
|
43
44
|
export * from "./GetConversationParams.mjs";
|
|
44
45
|
export * from "./LinkClickEvent.mjs";
|
|
45
46
|
export * from "./LocationShareAction.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.
|
|
1
|
+
export declare const SDK_VERSION = "2.0.13";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "2.0.
|
|
1
|
+
export const SDK_VERSION = "2.0.13";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -3774,6 +3774,10 @@ await client.messages.blast.rcs({
|
|
|
3774
3774
|
}],
|
|
3775
3775
|
text: "Hello from Pinnacle RCS!"
|
|
3776
3776
|
},
|
|
3777
|
+
fallback: {
|
|
3778
|
+
from: "+14155164736",
|
|
3779
|
+
text: "Hello from Pinnacle! Reply LEARN to learn more."
|
|
3780
|
+
},
|
|
3777
3781
|
options: {
|
|
3778
3782
|
transcode: true,
|
|
3779
3783
|
validate: true
|