rcs-js 2.0.0-rc.11 → 2.0.0-rc.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.
Files changed (106) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/campaigns/resources/rcs/client/Client.d.ts +1 -0
  3. package/dist/cjs/api/resources/campaigns/resources/rcs/client/Client.js +3 -0
  4. package/dist/cjs/api/resources/messages/resources/rcs/client/Client.d.ts +2 -2
  5. package/dist/cjs/api/resources/messages/resources/rcs/client/Client.js +1 -1
  6. package/dist/cjs/api/resources/tools/resources/file/client/Client.d.ts +21 -0
  7. package/dist/cjs/api/resources/tools/resources/file/client/Client.js +74 -0
  8. package/dist/cjs/api/resources/tools/resources/file/client/requests/RefreshFileParams.d.ts +21 -0
  9. package/dist/cjs/api/resources/tools/resources/file/client/requests/index.d.ts +1 -0
  10. package/dist/cjs/api/resources/tools/resources/url/client/Client.d.ts +1 -1
  11. package/dist/cjs/api/resources/tools/resources/url/client/Client.js +1 -1
  12. package/dist/cjs/api/types/AutofillDlcCampaignResponse.d.ts +11 -11
  13. package/dist/cjs/api/types/ButtonClicked.d.ts +11 -0
  14. package/dist/cjs/api/types/ButtonClickedData.d.ts +56 -0
  15. package/dist/cjs/api/types/ButtonClickedData.js +16 -0
  16. package/dist/cjs/api/types/CreateUrlOptions.d.ts +1 -1
  17. package/dist/cjs/api/types/DlcCampaignWithExtendedBrandAndStatus.d.ts +13 -10
  18. package/dist/cjs/api/types/ExtendedBrand.d.ts +7 -4
  19. package/dist/cjs/api/types/ExtendedRcsCampaign.d.ts +9 -8
  20. package/dist/cjs/api/types/MessageContent.d.ts +2 -2
  21. package/dist/cjs/api/types/MessageEvent.d.ts +56 -0
  22. package/dist/cjs/api/types/MessageEvent.js +13 -0
  23. package/dist/cjs/api/types/ProfileStatusEnum.d.ts +7 -4
  24. package/dist/cjs/api/types/RcsBase.d.ts +2 -0
  25. package/dist/cjs/api/types/RcsButtonCall.d.ts +2 -0
  26. package/dist/cjs/api/types/RcsButtonOpenUrl.d.ts +2 -0
  27. package/dist/cjs/api/types/RcsButtonRequestUserLocation.d.ts +2 -0
  28. package/dist/cjs/api/types/RcsButtonScheduleEvent.d.ts +2 -0
  29. package/dist/cjs/api/types/RcsButtonSendLocation.d.ts +2 -0
  30. package/dist/cjs/api/types/RcsButtonTrigger.d.ts +2 -2
  31. package/dist/cjs/api/types/RefreshedFile.d.ts +9 -0
  32. package/dist/cjs/api/types/{Rcs.d.ts → RichMessage.d.ts} +1 -1
  33. package/dist/cjs/api/types/RichMessage.js +5 -0
  34. package/dist/cjs/api/types/index.d.ts +5 -3
  35. package/dist/cjs/api/types/index.js +5 -3
  36. package/dist/cjs/index.d.ts +1 -1
  37. package/dist/cjs/index.js +2 -2
  38. package/dist/cjs/version.d.ts +1 -1
  39. package/dist/cjs/version.js +1 -1
  40. package/dist/cjs/wrapper/PinnacleClient.d.ts +9 -0
  41. package/dist/cjs/wrapper/PinnacleClient.js +17 -0
  42. package/dist/cjs/wrapper/messages/Client.d.ts +13 -0
  43. package/dist/cjs/wrapper/messages/Client.js +49 -0
  44. package/dist/cjs/wrapper/tools/Client.d.ts +6 -0
  45. package/dist/cjs/wrapper/tools/Client.js +12 -0
  46. package/dist/cjs/wrapper/tools/FileUploader.d.ts +15 -0
  47. package/dist/cjs/wrapper/tools/FileUploader.js +162 -0
  48. package/dist/esm/Client.mjs +2 -2
  49. package/dist/esm/api/resources/campaigns/resources/rcs/client/Client.d.mts +1 -0
  50. package/dist/esm/api/resources/campaigns/resources/rcs/client/Client.mjs +3 -0
  51. package/dist/esm/api/resources/messages/resources/rcs/client/Client.d.mts +2 -2
  52. package/dist/esm/api/resources/messages/resources/rcs/client/Client.mjs +1 -1
  53. package/dist/esm/api/resources/tools/resources/file/client/Client.d.mts +21 -0
  54. package/dist/esm/api/resources/tools/resources/file/client/Client.mjs +74 -0
  55. package/dist/esm/api/resources/tools/resources/file/client/requests/RefreshFileParams.d.mts +21 -0
  56. package/dist/esm/api/resources/tools/resources/file/client/requests/index.d.mts +1 -0
  57. package/dist/esm/api/resources/tools/resources/url/client/Client.d.mts +1 -1
  58. package/dist/esm/api/resources/tools/resources/url/client/Client.mjs +1 -1
  59. package/dist/esm/api/types/AutofillDlcCampaignResponse.d.mts +11 -11
  60. package/dist/esm/api/types/ButtonClicked.d.mts +11 -0
  61. package/dist/esm/api/types/ButtonClickedData.d.mts +56 -0
  62. package/dist/esm/api/types/ButtonClickedData.mjs +13 -0
  63. package/dist/esm/api/types/CreateUrlOptions.d.mts +1 -1
  64. package/dist/esm/api/types/DlcCampaignWithExtendedBrandAndStatus.d.mts +13 -10
  65. package/dist/esm/api/types/ExtendedBrand.d.mts +7 -4
  66. package/dist/esm/api/types/ExtendedRcsCampaign.d.mts +9 -8
  67. package/dist/esm/api/types/MessageContent.d.mts +2 -2
  68. package/dist/esm/api/types/MessageEvent.d.mts +56 -0
  69. package/dist/esm/api/types/MessageEvent.mjs +10 -0
  70. package/dist/esm/api/types/ProfileStatusEnum.d.mts +7 -4
  71. package/dist/esm/api/types/RcsBase.d.mts +2 -0
  72. package/dist/esm/api/types/RcsButtonCall.d.mts +2 -0
  73. package/dist/esm/api/types/RcsButtonOpenUrl.d.mts +2 -0
  74. package/dist/esm/api/types/RcsButtonRequestUserLocation.d.mts +2 -0
  75. package/dist/esm/api/types/RcsButtonScheduleEvent.d.mts +2 -0
  76. package/dist/esm/api/types/RcsButtonSendLocation.d.mts +2 -0
  77. package/dist/esm/api/types/RcsButtonTrigger.d.mts +2 -2
  78. package/dist/esm/api/types/RefreshedFile.d.mts +9 -0
  79. package/dist/esm/api/types/{Rcs.d.mts → RichMessage.d.mts} +1 -1
  80. package/dist/esm/api/types/RichMessage.mjs +4 -0
  81. package/dist/esm/api/types/index.d.mts +5 -3
  82. package/dist/esm/api/types/index.mjs +5 -3
  83. package/dist/esm/index.d.mts +1 -1
  84. package/dist/esm/index.mjs +1 -1
  85. package/dist/esm/version.d.mts +1 -1
  86. package/dist/esm/version.mjs +1 -1
  87. package/dist/esm/wrapper/PinnacleClient.d.mts +9 -0
  88. package/dist/esm/wrapper/PinnacleClient.mjs +13 -0
  89. package/dist/esm/wrapper/messages/Client.d.mts +13 -0
  90. package/dist/esm/wrapper/messages/Client.mjs +45 -0
  91. package/dist/esm/wrapper/tools/Client.d.mts +6 -0
  92. package/dist/esm/wrapper/tools/Client.mjs +8 -0
  93. package/dist/esm/wrapper/tools/FileUploader.d.mts +15 -0
  94. package/dist/esm/wrapper/tools/FileUploader.mjs +125 -0
  95. package/package.json +7 -3
  96. package/reference.md +76 -2
  97. package/dist/cjs/api/types/ClickAction.d.ts +0 -28
  98. package/dist/cjs/api/types/InboundButton.d.ts +0 -11
  99. package/dist/esm/api/types/ClickAction.d.mts +0 -28
  100. package/dist/esm/api/types/InboundButton.d.mts +0 -11
  101. /package/dist/cjs/api/{types/ClickAction.js → resources/tools/resources/file/client/requests/RefreshFileParams.js} +0 -0
  102. /package/dist/cjs/api/types/{InboundButton.js → ButtonClicked.js} +0 -0
  103. /package/dist/cjs/api/types/{Rcs.js → RefreshedFile.js} +0 -0
  104. /package/dist/esm/api/{types/ClickAction.mjs → resources/tools/resources/file/client/requests/RefreshFileParams.mjs} +0 -0
  105. /package/dist/esm/api/types/{InboundButton.mjs → ButtonClicked.mjs} +0 -0
  106. /package/dist/esm/api/types/{Rcs.mjs → RefreshedFile.mjs} +0 -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.0-rc.11",
58
- "User-Agent": "rcs-js/2.0.0-rc.11",
57
+ "X-Fern-SDK-Version": "2.0.0-rc.13",
58
+ "User-Agent": "rcs-js/2.0.0-rc.13",
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) });
@@ -71,6 +71,7 @@ export declare class Rcs {
71
71
  *
72
72
  * @throws {@link Pinnacle.BadRequestError}
73
73
  * @throws {@link Pinnacle.UnauthorizedError}
74
+ * @throws {@link Pinnacle.PaymentRequiredError}
74
75
  * @throws {@link Pinnacle.NotFoundError}
75
76
  * @throws {@link Pinnacle.InternalServerError}
76
77
  *
@@ -205,6 +205,7 @@ class Rcs {
205
205
  *
206
206
  * @throws {@link Pinnacle.BadRequestError}
207
207
  * @throws {@link Pinnacle.UnauthorizedError}
208
+ * @throws {@link Pinnacle.PaymentRequiredError}
208
209
  * @throws {@link Pinnacle.NotFoundError}
209
210
  * @throws {@link Pinnacle.InternalServerError}
210
211
  *
@@ -236,6 +237,8 @@ class Rcs {
236
237
  throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
237
238
  case 401:
238
239
  throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
240
+ case 402:
241
+ throw new Pinnacle.PaymentRequiredError(_response.error.body, _response.rawResponse);
239
242
  case 404:
240
243
  throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
241
244
  case 500:
@@ -34,7 +34,7 @@ export declare class Rcs {
34
34
  *
35
35
  * Requires an active RCS agent and recipient devices that support RCS Business Messaging.
36
36
  *
37
- * @param {Pinnacle.Rcs} request
37
+ * @param {Pinnacle.RichMessage} request
38
38
  * @param {Rcs.RequestOptions} requestOptions - Request-specific configuration.
39
39
  *
40
40
  * @throws {@link Pinnacle.BadRequestError}
@@ -56,7 +56,7 @@ export declare class Rcs {
56
56
  * to: "to"
57
57
  * })
58
58
  */
59
- send(request: Pinnacle.Rcs, requestOptions?: Rcs.RequestOptions): core.HttpResponsePromise<Pinnacle.messages.RcsSendResponse>;
59
+ send(request: Pinnacle.RichMessage, requestOptions?: Rcs.RequestOptions): core.HttpResponsePromise<Pinnacle.messages.RcsSendResponse>;
60
60
  private __send;
61
61
  /**
62
62
  * Validate RCS message content without sending it.
@@ -60,7 +60,7 @@ class Rcs {
60
60
  *
61
61
  * Requires an active RCS agent and recipient devices that support RCS Business Messaging.
62
62
  *
63
- * @param {Pinnacle.Rcs} request
63
+ * @param {Pinnacle.RichMessage} request
64
64
  * @param {Rcs.RequestOptions} requestOptions - Request-specific configuration.
65
65
  *
66
66
  * @throws {@link Pinnacle.BadRequestError}
@@ -53,6 +53,27 @@ export declare class File_ {
53
53
  */
54
54
  upload(request: Pinnacle.tools.UploadFileParams, requestOptions?: File_.RequestOptions): core.HttpResponsePromise<Pinnacle.UploadResults>;
55
55
  private __upload;
56
+ /**
57
+ * Refresh expiring presigned URLs for Pinnacle-hosted files to extend their access time.
58
+ *
59
+ * <Callout type="info">
60
+ * This only works for presigned download URLs. At this moment, you cannot refresh a presigned upload URL, generate a new one instead.
61
+ * </Callout>
62
+ *
63
+ * @param {Pinnacle.tools.RefreshFileParams} request
64
+ * @param {File_.RequestOptions} requestOptions - Request-specific configuration.
65
+ *
66
+ * @throws {@link Pinnacle.BadRequestError}
67
+ * @throws {@link Pinnacle.UnauthorizedError}
68
+ * @throws {@link Pinnacle.InternalServerError}
69
+ *
70
+ * @example
71
+ * await client.tools.file.refresh({
72
+ * uris: ["https://server.trypinnacle.app/storage/v1/object/sign/vault/3/test.jpg?token=oldtoken", "https://server.trypinnacle.app/storage/v1/object/sign/vault/3/document.pdf?token=oldtoken2", "icons/3/test.jpg", "invalid/url", "https://google.com"]
73
+ * })
74
+ */
75
+ refresh(request: Pinnacle.tools.RefreshFileParams, requestOptions?: File_.RequestOptions): core.HttpResponsePromise<Pinnacle.RefreshedFile[]>;
76
+ private __refresh;
56
77
  protected _getCustomAuthorizationHeaders(): Promise<{
57
78
  "PINNACLE-API-KEY": string;
58
79
  }>;
@@ -132,6 +132,80 @@ class File_ {
132
132
  }
133
133
  });
134
134
  }
135
+ /**
136
+ * Refresh expiring presigned URLs for Pinnacle-hosted files to extend their access time.
137
+ *
138
+ * <Callout type="info">
139
+ * This only works for presigned download URLs. At this moment, you cannot refresh a presigned upload URL, generate a new one instead.
140
+ * </Callout>
141
+ *
142
+ * @param {Pinnacle.tools.RefreshFileParams} request
143
+ * @param {File_.RequestOptions} requestOptions - Request-specific configuration.
144
+ *
145
+ * @throws {@link Pinnacle.BadRequestError}
146
+ * @throws {@link Pinnacle.UnauthorizedError}
147
+ * @throws {@link Pinnacle.InternalServerError}
148
+ *
149
+ * @example
150
+ * await client.tools.file.refresh({
151
+ * uris: ["https://server.trypinnacle.app/storage/v1/object/sign/vault/3/test.jpg?token=oldtoken", "https://server.trypinnacle.app/storage/v1/object/sign/vault/3/document.pdf?token=oldtoken2", "icons/3/test.jpg", "invalid/url", "https://google.com"]
152
+ * })
153
+ */
154
+ refresh(request, requestOptions) {
155
+ return core.HttpResponsePromise.fromPromise(this.__refresh(request, requestOptions));
156
+ }
157
+ __refresh(request, requestOptions) {
158
+ return __awaiter(this, void 0, void 0, function* () {
159
+ var _a, _b, _c;
160
+ 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);
161
+ const _response = yield core.fetcher({
162
+ 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, "tools/files/refresh"),
163
+ method: "POST",
164
+ headers: _headers,
165
+ contentType: "application/json",
166
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
167
+ requestType: "json",
168
+ body: request,
169
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
170
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
171
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
172
+ });
173
+ if (_response.ok) {
174
+ return { data: _response.body, rawResponse: _response.rawResponse };
175
+ }
176
+ if (_response.error.reason === "status-code") {
177
+ switch (_response.error.statusCode) {
178
+ case 400:
179
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
180
+ case 401:
181
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
182
+ case 500:
183
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
184
+ default:
185
+ throw new errors.PinnacleError({
186
+ statusCode: _response.error.statusCode,
187
+ body: _response.error.body,
188
+ rawResponse: _response.rawResponse,
189
+ });
190
+ }
191
+ }
192
+ switch (_response.error.reason) {
193
+ case "non-json":
194
+ throw new errors.PinnacleError({
195
+ statusCode: _response.error.statusCode,
196
+ body: _response.error.rawBody,
197
+ rawResponse: _response.rawResponse,
198
+ });
199
+ case "timeout":
200
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /tools/files/refresh.");
201
+ case "unknown":
202
+ throw new errors.PinnacleError({
203
+ message: _response.error.errorMessage,
204
+ rawResponse: _response.rawResponse,
205
+ });
206
+ }
207
+ });
208
+ }
135
209
  _getCustomAuthorizationHeaders() {
136
210
  return __awaiter(this, void 0, void 0, function* () {
137
211
  const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * uris: ["https://server.trypinnacle.app/storage/v1/object/sign/vault/3/test.jpg?token=oldtoken", "https://server.trypinnacle.app/storage/v1/object/sign/vault/3/document.pdf?token=oldtoken2", "icons/3/test.jpg", "invalid/url", "https://google.com"]
8
+ * }
9
+ */
10
+ export interface RefreshFileParams {
11
+ /**
12
+ * Array of file URIs to refresh for extended access. <br>
13
+ *
14
+ * Accepted formats:
15
+ * - **Full presigned URLs**: `https://server.trypinnacle.app/storage/v1/object/sign/...`
16
+ * - **Short URIs**: `{BUCKET}/${TEAM_ID}/...` (e.g., `vault/3/document.pdf`)
17
+ *
18
+ * Invalid or external URLs will be returned unchanged in the response.
19
+ */
20
+ uris: string[];
21
+ }
@@ -1 +1,2 @@
1
1
  export { type UploadFileParams } from "./UploadFileParams.js";
2
+ export { type RefreshFileParams } from "./RefreshFileParams.js";
@@ -67,7 +67,7 @@ export declare class Url {
67
67
  get(linkId: string, requestOptions?: Url.RequestOptions): core.HttpResponsePromise<Pinnacle.ShortenedUrlWithClickData>;
68
68
  private __get;
69
69
  /**
70
- * Update the destination or configuration of an existing shortened URL.
70
+ * Update the destination or expiration date of an existing shortened URL. Expiring links cannot be updated into a permalink.
71
71
  *
72
72
  * @param {string} linkId - Unique identifier from your shortened URL. For example, for `https://pncl.to/ePzVxILF`, the `linkId` is `ePzVxILF`. <br>
73
73
  *
@@ -196,7 +196,7 @@ class Url {
196
196
  });
197
197
  }
198
198
  /**
199
- * Update the destination or configuration of an existing shortened URL.
199
+ * Update the destination or expiration date of an existing shortened URL. Expiring links cannot be updated into a permalink.
200
200
  *
201
201
  * @param {string} linkId - Unique identifier from your shortened URL. For example, for `https://pncl.to/ePzVxILF`, the `linkId` is `ePzVxILF`. <br>
202
202
  *
@@ -32,11 +32,11 @@ export declare namespace AutofillDlcCampaignResponse {
32
32
  */
33
33
  interface Keywords {
34
34
  /** Help keyword settings. */
35
- HELP?: Keywords.Help;
35
+ HELP: Keywords.Help;
36
36
  /** Opt-in keyword settings. */
37
- OPT_IN?: Keywords.OptIn;
37
+ OPT_IN: Keywords.OptIn;
38
38
  /** Opt-out keyword settings. */
39
- OPT_OUT?: Keywords.OptOut;
39
+ OPT_OUT: Keywords.OptOut;
40
40
  }
41
41
  namespace Keywords {
42
42
  /**
@@ -46,14 +46,14 @@ export declare namespace AutofillDlcCampaignResponse {
46
46
  /** Response message for help keywords. */
47
47
  message?: string;
48
48
  /** Keywords that trigger help response. */
49
- values?: string[];
49
+ values: string[];
50
50
  }
51
51
  /**
52
52
  * Opt-in keyword settings.
53
53
  */
54
54
  interface OptIn {
55
55
  /** Response message for opt-in keywords. */
56
- message: string;
56
+ message?: string;
57
57
  /** Keywords that trigger opt-in. */
58
58
  values: string[];
59
59
  }
@@ -64,7 +64,7 @@ export declare namespace AutofillDlcCampaignResponse {
64
64
  /** Response message for opt-out keywords. */
65
65
  message?: string;
66
66
  /** Keywords that trigger opt-out. */
67
- values?: string[];
67
+ values: string[];
68
68
  }
69
69
  }
70
70
  /**
@@ -81,17 +81,17 @@ export declare namespace AutofillDlcCampaignResponse {
81
81
  */
82
82
  interface Options {
83
83
  /** Whether the campaign uses affiliate marketing. */
84
- affiliateMarketing?: boolean;
84
+ affiliateMarketing: boolean;
85
85
  /** Whether the campaign is age-gated. */
86
- ageGated?: boolean;
86
+ ageGated: boolean;
87
87
  /** Whether the campaign involves direct lending. */
88
- directLending?: boolean;
88
+ directLending: boolean;
89
89
  /** Link embedded in campaign message. */
90
90
  embeddedLink?: string;
91
91
  /** Whether messages include phone numbers. */
92
- embeddedPhone?: boolean;
92
+ embeddedPhone: boolean;
93
93
  /** Whether the campaign uses number pooling. */
94
- numberPooling?: boolean;
94
+ numberPooling: boolean;
95
95
  }
96
96
  /**
97
97
  * Use case for the campaign.
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Pinnacle from "../index.js";
5
+ export type ButtonClicked =
6
+ /**
7
+ * Data about a button that was clicked. */
8
+ Pinnacle.ButtonClickedData
9
+ /**
10
+ * User provided location. Occurs when recipient responds to `requestUserLocation` button and shares a location. */
11
+ | Pinnacle.LocationShareAction;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Pinnacle from "../index.js";
5
+ /**
6
+ * Unified data structure for button click events.
7
+ */
8
+ export interface ButtonClickedData {
9
+ /** Information about the button that was clicked. */
10
+ button: ButtonClickedData.Button;
11
+ /** ID of the message this button was attached to, or null if not available. To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint. */
12
+ messageId?: number | null;
13
+ }
14
+ export declare namespace ButtonClickedData {
15
+ /**
16
+ * Information about the button that was clicked.
17
+ */
18
+ interface Button {
19
+ /**
20
+ * Type of button clicked.
21
+ * - `CARD` for card buttons,
22
+ * - `QUICK_REPLY` for quick replies.
23
+ * - `null` if we cannot determine the button type. This is a rare edge case and is mainly here for backward compatibility.
24
+ */
25
+ type?: Button.Type | null;
26
+ /** 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. */
27
+ raw: Button.Raw;
28
+ /** Extracted payload from the button's `payload` field, if provided. Provides quick access to any payload that was attached to the button. */
29
+ payload?: string | null;
30
+ /** Additional metadata attached to the button's `metadata` field, if provided. */
31
+ metadata?: string | null;
32
+ }
33
+ namespace Button {
34
+ /**
35
+ * Type of button clicked.
36
+ * - `CARD` for card buttons,
37
+ * - `QUICK_REPLY` for quick replies.
38
+ * - `null` if we cannot determine the button type. This is a rare edge case and is mainly here for backward compatibility.
39
+ */
40
+ type Type = "CARD" | "QUICK_REPLY";
41
+ const Type: {
42
+ readonly Card: "CARD";
43
+ readonly QuickReply: "QUICK_REPLY";
44
+ };
45
+ /**
46
+ * 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.
47
+ */
48
+ type Raw =
49
+ /**
50
+ * Full button object if we can determine the exact button. */
51
+ Pinnacle.RichButton
52
+ /**
53
+ * Button title if we cannot determine the exact button. This is a rare edge case and is mainly here for backward compatibility. */
54
+ | string;
55
+ }
56
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ButtonClickedData = void 0;
7
+ var ButtonClickedData;
8
+ (function (ButtonClickedData) {
9
+ let Button;
10
+ (function (Button) {
11
+ Button.Type = {
12
+ Card: "CARD",
13
+ QuickReply: "QUICK_REPLY",
14
+ };
15
+ })(Button = ButtonClickedData.Button || (ButtonClickedData.Button = {}));
16
+ })(ButtonClickedData || (exports.ButtonClickedData = ButtonClickedData = {}));
@@ -5,7 +5,7 @@ export interface CreateUrlOptions {
5
5
  /**
6
6
  * Expiration date in ISO 8601 format for the shortened URL. <br>
7
7
  *
8
- * If omitted, then a permalink is generated instead.
8
+ * If omitted, then a permalink is generated instead. Short permalinks contain a 30-digit link id. Short links with an expiration date contain a 8-digit link id.
9
9
  */
10
10
  expiresAt?: string | null;
11
11
  }
@@ -15,7 +15,7 @@ export interface DlcCampaignWithExtendedBrandAndStatus {
15
15
  /** Description of the campaign. */
16
16
  description?: string;
17
17
  /** Keyword response configuration. */
18
- keywords?: DlcCampaignWithExtendedBrandAndStatus.Keywords;
18
+ keywords: DlcCampaignWithExtendedBrandAndStatus.Keywords;
19
19
  /** Legal documentation links. */
20
20
  links?: DlcCampaignWithExtendedBrandAndStatus.Links;
21
21
  /** Describe the flow of how users will opt in to this campaign. */
@@ -23,16 +23,19 @@ export interface DlcCampaignWithExtendedBrandAndStatus {
23
23
  /** Display name of the campaign. */
24
24
  name?: string;
25
25
  /** Campaign configuration options. */
26
- options?: DlcCampaignWithExtendedBrandAndStatus.Options;
26
+ options: DlcCampaignWithExtendedBrandAndStatus.Options;
27
27
  /** Example messages for the campaign. */
28
28
  sampleMessages?: string[];
29
29
  /**
30
- * Current review status of the campaign.<br>
30
+ * Current review status of the campaign. <br>
31
31
  *
32
- * `INCOMPLETE`: Not submitted.<br>
33
- * `IN REVIEW`: Being reviewed by carriers.<br>
34
- * `VERIFIED`: Approved and ready to send messages.<br>
35
- * `FAILED`: Issues and errors related to the campaign's details.<br>
32
+ * `INCOMPLETE`: Not submitted. <br>
33
+ *
34
+ * `IN REVIEW`: Being reviewed by carriers. <br>
35
+ *
36
+ * `VERIFIED`: Approved and ready to send messages. <br>
37
+ *
38
+ * `FAILED`: Issues and errors related to the campaign's details.
36
39
  */
37
40
  status: Pinnacle.ProfileStatusEnum;
38
41
  /** Use case for the campaign. */
@@ -58,14 +61,14 @@ export declare namespace DlcCampaignWithExtendedBrandAndStatus {
58
61
  /** Response message for help keywords. */
59
62
  message?: string;
60
63
  /** Keywords that trigger help response. */
61
- values?: string[];
64
+ values: string[];
62
65
  }
63
66
  /**
64
67
  * Opt-in keyword settings.
65
68
  */
66
69
  interface OptIn {
67
70
  /** Response message for opt-in keywords. */
68
- message: string;
71
+ message?: string;
69
72
  /** Keywords that trigger opt-in. */
70
73
  values: string[];
71
74
  }
@@ -74,7 +77,7 @@ export declare namespace DlcCampaignWithExtendedBrandAndStatus {
74
77
  */
75
78
  interface OptOut {
76
79
  /** Response message for opt-out keywords. */
77
- message: string;
80
+ message?: string;
78
81
  /** Keywords that trigger opt-out. */
79
82
  values: string[];
80
83
  }
@@ -10,11 +10,14 @@ export interface ExtendedBrand extends Pinnacle.OptionalBrandInfo {
10
10
  /** Indicates if this brand is archived. */
11
11
  isArchived: boolean;
12
12
  /**
13
- * Current review status of the campaign.<br>
13
+ * Current review status of the campaign. <br>
14
+ *
15
+ * `INCOMPLETE`: Not submitted. <br>
16
+ *
17
+ * `IN REVIEW`: Being reviewed by carriers. <br>
18
+ *
19
+ * `VERIFIED`: Approved and ready to send messages. <br>
14
20
  *
15
- * `INCOMPLETE`: Not submitted.<br>
16
- * `IN REVIEW`: Being reviewed by carriers.<br>
17
- * `VERIFIED`: Approved and ready to send messages.<br>
18
21
  * `FAILED`: Issues and errors related to the campaign's details.
19
22
  */
20
23
  status: Pinnacle.BrandStatusEnum;
@@ -14,17 +14,18 @@ export interface ExtendedRcsCampaign {
14
14
  /** Indicates whether the brand has provided an attestation. */
15
15
  brandAttestation: boolean;
16
16
  /** Unique identifier for the campaign. */
17
- campaignId: number;
17
+ campaignId?: number;
18
18
  /** List of what the agent might say to users. */
19
19
  expectedAgentResponses?: string[];
20
20
  /** Legal documentation links. */
21
- links: ExtendedRcsCampaign.Links;
21
+ links?: ExtendedRcsCampaign.Links;
22
+ status: Pinnacle.ProfileStatusEnum;
22
23
  /** Opt-in configuration. */
23
- optIn: ExtendedRcsCampaign.OptIn;
24
+ optIn?: ExtendedRcsCampaign.OptIn;
24
25
  /** Opt-out configuration. */
25
- optOut: ExtendedRcsCampaign.OptOut;
26
+ optOut?: ExtendedRcsCampaign.OptOut;
26
27
  /** Use case classification for the campaign. */
27
- useCase: ExtendedRcsCampaign.UseCase;
28
+ useCase?: ExtendedRcsCampaign.UseCase;
28
29
  }
29
30
  export declare namespace ExtendedRcsCampaign {
30
31
  /**
@@ -36,7 +37,7 @@ export declare namespace ExtendedRcsCampaign {
36
37
  /** Description of the agent. */
37
38
  description?: string;
38
39
  /** List of emails. */
39
- emails?: Agent.Emails.Item[];
40
+ emails: Agent.Emails.Item[];
40
41
  /** Link to the agent's hero. Hero must be an image file with dimensions 1440x448px. */
41
42
  heroUrl?: string;
42
43
  /** Link to the agent's icon. Icon must be an image file with dimensions 224x224px. */
@@ -44,9 +45,9 @@ export declare namespace ExtendedRcsCampaign {
44
45
  /** Name of the agent. */
45
46
  name?: string;
46
47
  /** List of phone numbers. */
47
- phones?: Agent.Phones.Item[];
48
+ phones: Agent.Phones.Item[];
48
49
  /** List of urls. */
49
- websites?: Agent.Websites.Item[];
50
+ websites: Agent.Websites.Item[];
50
51
  }
51
52
  namespace Agent {
52
53
  type Emails = Emails.Item[];
@@ -18,5 +18,5 @@ Pinnacle.SmsContent
18
18
  * Message that contains richer content (longer text, higher quality media, cards, buttons, and quick replies) from an RCS agent. */
19
19
  | Pinnacle.RcsContent
20
20
  /**
21
- * Message that represents when a user clicks on a RCS button or quick reply that was previously sent. */
22
- | Pinnacle.InboundButton;
21
+ * Message that represents when a user clicks on a RCS button or quick reply. */
22
+ | Pinnacle.ButtonClicked;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Pinnacle from "../index.js";
5
+ /**
6
+ * Represents an incoming message or message status update received via webhook.
7
+ */
8
+ export interface MessageEvent {
9
+ /** Type of webhook event. MESSAGE.STATUS for message status updates or MESSAGE.RECEIVED for inbound messages. */
10
+ type: Pinnacle.WebhookEventEnum;
11
+ /** Conversation metadata containing the conversation ID, sender, and recipient information. */
12
+ conversation: MessageEvent.Conversation;
13
+ status: Pinnacle.MessageStatusEnum;
14
+ /** Direction of the message flow. */
15
+ direction: MessageEvent.Direction;
16
+ /** Number of segments for this message. */
17
+ segments: number;
18
+ /** Timestamp when the message was sent in ISO 8601 format. */
19
+ sentAt: string;
20
+ /**
21
+ * Timestamp when the message was delivered in ISO 8601 format.
22
+ * Null if not yet delivered or for inbound messages.
23
+ */
24
+ deliveredAt?: string | null;
25
+ /** Message details including ID and content. */
26
+ message: MessageEvent.Message;
27
+ }
28
+ export declare namespace MessageEvent {
29
+ /**
30
+ * Conversation metadata containing the conversation ID, sender, and recipient information.
31
+ */
32
+ interface Conversation {
33
+ /** Unique identifier for the conversation. To get more conversation details, use the [POST /conversations/get](/api-reference/conversations/get) endpoint. */
34
+ id: number;
35
+ /** Sender's phone number or agent ID. */
36
+ from: string;
37
+ /** Recipient's phone number. */
38
+ to: string;
39
+ }
40
+ /**
41
+ * Direction of the message flow.
42
+ */
43
+ type Direction = "INBOUND" | "OUTBOUND";
44
+ const Direction: {
45
+ readonly Inbound: "INBOUND";
46
+ readonly Outbound: "OUTBOUND";
47
+ };
48
+ /**
49
+ * Message details including ID and content.
50
+ */
51
+ interface Message {
52
+ /** Unique identifier of the message. To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint. */
53
+ id: number;
54
+ content: Pinnacle.MessageContent;
55
+ }
56
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MessageEvent = void 0;
7
+ var MessageEvent;
8
+ (function (MessageEvent) {
9
+ MessageEvent.Direction = {
10
+ Inbound: "INBOUND",
11
+ Outbound: "OUTBOUND",
12
+ };
13
+ })(MessageEvent || (exports.MessageEvent = MessageEvent = {}));
@@ -2,11 +2,14 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  /**
5
- * Current review status of the campaign.
5
+ * Current review status of the campaign. <br>
6
+ *
7
+ * `INCOMPLETE`: Not submitted. <br>
8
+ *
9
+ * `IN REVIEW`: Being reviewed by carriers. <br>
10
+ *
11
+ * `VERIFIED`: Approved and ready to send messages.<br>
6
12
  *
7
- * `INCOMPLETE`: Not submitted.
8
- * `IN REVIEW`: Being reviewed by carriers.
9
- * `VERIFIED`: Approved and ready to send messages.
10
13
  * `FAILED`: Issues and errors related to the campaign's details.
11
14
  */
12
15
  export type ProfileStatusEnum = "INCOMPLETE" | "IN REVIEW" | "VERIFIED" | "FAILED";
@@ -19,6 +19,8 @@ export declare namespace RcsBase {
19
19
  /** Send via the test agent to whitelisted test devices. Useful for development and debugging. */
20
20
  test_mode?: boolean;
21
21
  tracking?: Pinnacle.Tracking;
22
+ /** 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. */
23
+ transcode?: boolean;
22
24
  /**
23
25
  * Validate your message for any unsupported files. <br>
24
26
  *
@@ -5,6 +5,8 @@
5
5
  * Button that initiates a phone call when tapped by the recipient.
6
6
  */
7
7
  export interface RcsButtonCall {
8
+ /** Optional additional data to attach to this button. */
9
+ metadata?: string;
8
10
  /** Phone number to call in E.164 format */
9
11
  payload: string;
10
12
  /** Display text for the button. */
@@ -5,6 +5,8 @@
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
10
  /** The URL to open when the button is tapped. Must be a valid HTTP or HTTPS URL. */
9
11
  payload: string;
10
12
  /** Display text for the button. */
@@ -5,6 +5,8 @@
5
5
  * Button that prompts the recipient to share their current location.
6
6
  */
7
7
  export interface RcsButtonRequestUserLocation {
8
+ /** Optional additional data to attach to this button. */
9
+ metadata?: string;
8
10
  /** Display text for the button. */
9
11
  title: string;
10
12
  }