rcs-js 2.0.0-rc.10 → 2.0.0-rc.11

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 (110) hide show
  1. package/dist/cjs/Client.d.ts +3 -0
  2. package/dist/cjs/Client.js +15 -10
  3. package/dist/cjs/api/resources/brands/client/Client.d.ts +2 -0
  4. package/dist/cjs/api/resources/brands/client/Client.js +6 -0
  5. package/dist/cjs/api/resources/campaigns/resources/dlc/client/Client.d.ts +6 -6
  6. package/dist/cjs/api/resources/campaigns/resources/dlc/client/Client.js +6 -6
  7. package/dist/cjs/api/resources/campaigns/resources/rcs/client/requests/UpsertRcsCampaignParams.d.ts +2 -2
  8. package/dist/cjs/api/resources/index.d.ts +2 -0
  9. package/dist/cjs/api/resources/index.js +3 -1
  10. package/dist/cjs/api/resources/messages/client/Client.d.ts +3 -0
  11. package/dist/cjs/api/resources/messages/client/Client.js +9 -0
  12. package/dist/cjs/api/resources/messages/resources/mms/client/Client.d.ts +1 -0
  13. package/dist/cjs/api/resources/messages/resources/mms/client/Client.js +3 -0
  14. package/dist/cjs/api/resources/messages/resources/rcs/client/Client.d.ts +1 -0
  15. package/dist/cjs/api/resources/messages/resources/rcs/client/Client.js +3 -0
  16. package/dist/cjs/api/resources/messages/resources/sms/client/Client.d.ts +1 -0
  17. package/dist/cjs/api/resources/messages/resources/sms/client/Client.js +3 -0
  18. package/dist/cjs/api/resources/phoneNumbers/resources/campaign/client/Client.d.ts +2 -0
  19. package/dist/cjs/api/resources/phoneNumbers/resources/campaign/client/Client.js +6 -0
  20. package/dist/cjs/api/resources/phoneNumbers/resources/webhook/client/Client.d.ts +1 -0
  21. package/dist/cjs/api/resources/phoneNumbers/resources/webhook/client/Client.js +3 -0
  22. package/dist/cjs/api/resources/rcs/client/Client.d.ts +121 -0
  23. package/dist/cjs/api/resources/rcs/client/Client.js +320 -0
  24. package/dist/cjs/api/resources/rcs/client/index.d.ts +2 -0
  25. package/dist/cjs/api/resources/rcs/client/index.js +17 -0
  26. package/dist/cjs/api/resources/rcs/client/requests/RcsCapabilitiesQuery.d.ts +13 -0
  27. package/dist/cjs/api/resources/rcs/client/requests/RcsCapabilitiesQuery.js +5 -0
  28. package/dist/cjs/api/resources/rcs/client/requests/RcsLinkRequest.d.ts +22 -0
  29. package/dist/cjs/api/resources/rcs/client/requests/RcsLinkRequest.js +5 -0
  30. package/dist/cjs/api/resources/rcs/client/requests/RcsWhitelistRequest.d.ts +16 -0
  31. package/dist/cjs/api/resources/rcs/client/requests/RcsWhitelistRequest.js +5 -0
  32. package/dist/cjs/api/resources/rcs/client/requests/index.d.ts +3 -0
  33. package/dist/cjs/api/resources/rcs/client/requests/index.js +2 -0
  34. package/dist/cjs/api/resources/rcs/index.d.ts +1 -0
  35. package/dist/cjs/api/resources/rcs/index.js +17 -0
  36. package/dist/cjs/api/resources/status/resources/get/client/Client.d.ts +2 -2
  37. package/dist/cjs/api/resources/status/resources/get/client/Client.js +2 -2
  38. package/dist/cjs/api/types/ConversationList.d.ts +4 -4
  39. package/dist/cjs/api/types/DlcCampaignStatus.d.ts +2 -2
  40. package/dist/cjs/api/types/ExtendedRcsCampaign.d.ts +2 -2
  41. package/dist/cjs/api/types/RcsCampaign.d.ts +2 -2
  42. package/dist/cjs/api/types/RcsCapabilitiesResult.d.ts +8 -0
  43. package/dist/cjs/api/types/RcsCapabilitiesResult.js +5 -0
  44. package/dist/cjs/api/types/RcsCapability.d.ts +36 -0
  45. package/dist/cjs/api/types/RcsCapability.js +5 -0
  46. package/dist/cjs/api/types/RcsLinkResult.d.ts +13 -0
  47. package/dist/cjs/api/types/RcsLinkResult.js +5 -0
  48. package/dist/cjs/api/types/RcsValidateContent.d.ts +1 -0
  49. package/dist/cjs/api/types/RcsWhitelistResponse.d.ts +10 -0
  50. package/dist/cjs/api/types/RcsWhitelistResponse.js +5 -0
  51. package/dist/cjs/api/types/index.d.ts +4 -0
  52. package/dist/cjs/api/types/index.js +4 -0
  53. package/dist/cjs/version.d.ts +1 -1
  54. package/dist/cjs/version.js +1 -1
  55. package/dist/esm/Client.d.mts +3 -0
  56. package/dist/esm/Client.mjs +7 -2
  57. package/dist/esm/api/resources/brands/client/Client.d.mts +2 -0
  58. package/dist/esm/api/resources/brands/client/Client.mjs +6 -0
  59. package/dist/esm/api/resources/campaigns/resources/dlc/client/Client.d.mts +6 -6
  60. package/dist/esm/api/resources/campaigns/resources/dlc/client/Client.mjs +6 -6
  61. package/dist/esm/api/resources/campaigns/resources/rcs/client/requests/UpsertRcsCampaignParams.d.mts +2 -2
  62. package/dist/esm/api/resources/index.d.mts +2 -0
  63. package/dist/esm/api/resources/index.mjs +2 -0
  64. package/dist/esm/api/resources/messages/client/Client.d.mts +3 -0
  65. package/dist/esm/api/resources/messages/client/Client.mjs +9 -0
  66. package/dist/esm/api/resources/messages/resources/mms/client/Client.d.mts +1 -0
  67. package/dist/esm/api/resources/messages/resources/mms/client/Client.mjs +3 -0
  68. package/dist/esm/api/resources/messages/resources/rcs/client/Client.d.mts +1 -0
  69. package/dist/esm/api/resources/messages/resources/rcs/client/Client.mjs +3 -0
  70. package/dist/esm/api/resources/messages/resources/sms/client/Client.d.mts +1 -0
  71. package/dist/esm/api/resources/messages/resources/sms/client/Client.mjs +3 -0
  72. package/dist/esm/api/resources/phoneNumbers/resources/campaign/client/Client.d.mts +2 -0
  73. package/dist/esm/api/resources/phoneNumbers/resources/campaign/client/Client.mjs +6 -0
  74. package/dist/esm/api/resources/phoneNumbers/resources/webhook/client/Client.d.mts +1 -0
  75. package/dist/esm/api/resources/phoneNumbers/resources/webhook/client/Client.mjs +3 -0
  76. package/dist/esm/api/resources/rcs/client/Client.d.mts +121 -0
  77. package/dist/esm/api/resources/rcs/client/Client.mjs +283 -0
  78. package/dist/esm/api/resources/rcs/client/index.d.mts +2 -0
  79. package/dist/esm/api/resources/rcs/client/index.mjs +1 -0
  80. package/dist/esm/api/resources/rcs/client/requests/RcsCapabilitiesQuery.d.mts +13 -0
  81. package/dist/esm/api/resources/rcs/client/requests/RcsCapabilitiesQuery.mjs +4 -0
  82. package/dist/esm/api/resources/rcs/client/requests/RcsLinkRequest.d.mts +22 -0
  83. package/dist/esm/api/resources/rcs/client/requests/RcsLinkRequest.mjs +4 -0
  84. package/dist/esm/api/resources/rcs/client/requests/RcsWhitelistRequest.d.mts +16 -0
  85. package/dist/esm/api/resources/rcs/client/requests/RcsWhitelistRequest.mjs +4 -0
  86. package/dist/esm/api/resources/rcs/client/requests/index.d.mts +3 -0
  87. package/dist/esm/api/resources/rcs/client/requests/index.mjs +1 -0
  88. package/dist/esm/api/resources/rcs/index.d.mts +1 -0
  89. package/dist/esm/api/resources/rcs/index.mjs +1 -0
  90. package/dist/esm/api/resources/status/resources/get/client/Client.d.mts +2 -2
  91. package/dist/esm/api/resources/status/resources/get/client/Client.mjs +2 -2
  92. package/dist/esm/api/types/ConversationList.d.mts +4 -4
  93. package/dist/esm/api/types/DlcCampaignStatus.d.mts +2 -2
  94. package/dist/esm/api/types/ExtendedRcsCampaign.d.mts +2 -2
  95. package/dist/esm/api/types/RcsCampaign.d.mts +2 -2
  96. package/dist/esm/api/types/RcsCapabilitiesResult.d.mts +8 -0
  97. package/dist/esm/api/types/RcsCapabilitiesResult.mjs +4 -0
  98. package/dist/esm/api/types/RcsCapability.d.mts +36 -0
  99. package/dist/esm/api/types/RcsCapability.mjs +4 -0
  100. package/dist/esm/api/types/RcsLinkResult.d.mts +13 -0
  101. package/dist/esm/api/types/RcsLinkResult.mjs +4 -0
  102. package/dist/esm/api/types/RcsValidateContent.d.mts +1 -0
  103. package/dist/esm/api/types/RcsWhitelistResponse.d.mts +10 -0
  104. package/dist/esm/api/types/RcsWhitelistResponse.mjs +4 -0
  105. package/dist/esm/api/types/index.d.mts +4 -0
  106. package/dist/esm/api/types/index.mjs +4 -0
  107. package/dist/esm/version.d.mts +1 -1
  108. package/dist/esm/version.mjs +1 -1
  109. package/package.json +1 -1
  110. package/reference.md +237 -8
@@ -0,0 +1,283 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
+ return new (P || (P = Promise))(function (resolve, reject) {
7
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11
+ });
12
+ };
13
+ import * as environments from "../../../../environments.mjs";
14
+ import * as core from "../../../../core/index.mjs";
15
+ import * as Pinnacle from "../../../index.mjs";
16
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
17
+ import * as errors from "../../../../errors/index.mjs";
18
+ export class Rcs {
19
+ constructor(_options) {
20
+ this._options = _options;
21
+ }
22
+ /**
23
+ * Check RCS capabilities for one or more phone numbers.
24
+ *
25
+ * This endpoint allows you to verify which RCS features (cards, buttons, etc.) are supported
26
+ * on specific phone numbers before sending RCS messages to them.
27
+ *
28
+ * @param {Pinnacle.RcsCapabilitiesQuery} request
29
+ * @param {Rcs.RequestOptions} requestOptions - Request-specific configuration.
30
+ *
31
+ * @throws {@link Pinnacle.BadRequestError}
32
+ * @throws {@link Pinnacle.UnauthorizedError}
33
+ * @throws {@link Pinnacle.InternalServerError}
34
+ * @throws {@link Pinnacle.NotImplementedError}
35
+ *
36
+ * @example
37
+ * await client.rcs.getCapabilities({
38
+ * phoneNumbers: ["+12345678901", "+19876543210"]
39
+ * })
40
+ */
41
+ getCapabilities(request, requestOptions) {
42
+ return core.HttpResponsePromise.fromPromise(this.__getCapabilities(request, requestOptions));
43
+ }
44
+ __getCapabilities(request, requestOptions) {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ var _a, _b, _c;
47
+ 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);
48
+ const _response = yield core.fetcher({
49
+ 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, "rcs/capabilities"),
50
+ method: "POST",
51
+ headers: _headers,
52
+ contentType: "application/json",
53
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
54
+ requestType: "json",
55
+ body: request,
56
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
57
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
58
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
59
+ });
60
+ if (_response.ok) {
61
+ return { data: _response.body, rawResponse: _response.rawResponse };
62
+ }
63
+ if (_response.error.reason === "status-code") {
64
+ switch (_response.error.statusCode) {
65
+ case 400:
66
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
67
+ case 401:
68
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
69
+ case 500:
70
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
71
+ case 501:
72
+ throw new Pinnacle.NotImplementedError(_response.error.body, _response.rawResponse);
73
+ default:
74
+ throw new errors.PinnacleError({
75
+ statusCode: _response.error.statusCode,
76
+ body: _response.error.body,
77
+ rawResponse: _response.rawResponse,
78
+ });
79
+ }
80
+ }
81
+ switch (_response.error.reason) {
82
+ case "non-json":
83
+ throw new errors.PinnacleError({
84
+ statusCode: _response.error.statusCode,
85
+ body: _response.error.rawBody,
86
+ rawResponse: _response.rawResponse,
87
+ });
88
+ case "timeout":
89
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /rcs/capabilities.");
90
+ case "unknown":
91
+ throw new errors.PinnacleError({
92
+ message: _response.error.errorMessage,
93
+ rawResponse: _response.rawResponse,
94
+ });
95
+ }
96
+ });
97
+ }
98
+ /**
99
+ * Whitelist a phone number for testing with your test RCS agent.
100
+ *
101
+ * ## Overview
102
+ * During development and testing, RCS agents can only send messages to whitelisted phone numbers.
103
+ * Use this endpoint to add test devices to your agent's whitelist before sending test messages.
104
+ *
105
+ * ## Verification Process
106
+ * After whitelisting a number, you'll need to complete verification:
107
+ *
108
+ * 1. Check the test device for an "RBM Tester Management" request
109
+ * 2. Accept the request on the device
110
+ * 3. Enter the 4-digit verification code in the Pinnacle dashboard at:
111
+ * ```
112
+ * https://app.pinnacle.sh/dashboard/brands/{brandId}?campaignId={campaignId}&campaignType=RCS
113
+ * ```
114
+ *
115
+ * > **Important Notes**
116
+ * >
117
+ * > - **Testing only:** This is only required for test agents. Production agents can message any RCS-enabled number
118
+ * > - **AT&T limitation:** Whitelisting may currently fail for AT&T numbers
119
+ * > - **Verification required:** The whitelist request isn't complete until you verify the device.
120
+ *
121
+ * @param {Pinnacle.RcsWhitelistRequest} request
122
+ * @param {Rcs.RequestOptions} requestOptions - Request-specific configuration.
123
+ *
124
+ * @throws {@link Pinnacle.BadRequestError}
125
+ * @throws {@link Pinnacle.UnauthorizedError}
126
+ * @throws {@link Pinnacle.NotFoundError}
127
+ * @throws {@link Pinnacle.InternalServerError}
128
+ * @throws {@link Pinnacle.NotImplementedError}
129
+ *
130
+ * @example
131
+ * await client.rcs.whitelist({
132
+ * agentId: "agent_XXXXXXXXXXXX",
133
+ * phoneNumber: "+12345678901"
134
+ * })
135
+ */
136
+ whitelist(request, requestOptions) {
137
+ return core.HttpResponsePromise.fromPromise(this.__whitelist(request, requestOptions));
138
+ }
139
+ __whitelist(request, requestOptions) {
140
+ return __awaiter(this, void 0, void 0, function* () {
141
+ var _a, _b, _c;
142
+ 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);
143
+ const _response = yield core.fetcher({
144
+ 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, "rcs/whitelist"),
145
+ method: "POST",
146
+ headers: _headers,
147
+ contentType: "application/json",
148
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
149
+ requestType: "json",
150
+ body: request,
151
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
152
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
153
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
154
+ });
155
+ if (_response.ok) {
156
+ return { data: _response.body, rawResponse: _response.rawResponse };
157
+ }
158
+ if (_response.error.reason === "status-code") {
159
+ switch (_response.error.statusCode) {
160
+ case 400:
161
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
162
+ case 401:
163
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
164
+ case 404:
165
+ throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
166
+ case 500:
167
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
168
+ case 501:
169
+ throw new Pinnacle.NotImplementedError(_response.error.body, _response.rawResponse);
170
+ default:
171
+ throw new errors.PinnacleError({
172
+ statusCode: _response.error.statusCode,
173
+ body: _response.error.body,
174
+ rawResponse: _response.rawResponse,
175
+ });
176
+ }
177
+ }
178
+ switch (_response.error.reason) {
179
+ case "non-json":
180
+ throw new errors.PinnacleError({
181
+ statusCode: _response.error.statusCode,
182
+ body: _response.error.rawBody,
183
+ rawResponse: _response.rawResponse,
184
+ });
185
+ case "timeout":
186
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /rcs/whitelist.");
187
+ case "unknown":
188
+ throw new errors.PinnacleError({
189
+ message: _response.error.errorMessage,
190
+ rawResponse: _response.rawResponse,
191
+ });
192
+ }
193
+ });
194
+ }
195
+ /**
196
+ * Generate a link for initiating an RCS conversation with your agent.
197
+ *
198
+ * Users can click these links to start conversations with your RCS agent directly
199
+ * from websites, emails, or other applications.
200
+ *
201
+ * @param {Pinnacle.RcsLinkRequest} request
202
+ * @param {Rcs.RequestOptions} requestOptions - Request-specific configuration.
203
+ *
204
+ * @throws {@link Pinnacle.BadRequestError}
205
+ * @throws {@link Pinnacle.UnauthorizedError}
206
+ * @throws {@link Pinnacle.NotFoundError}
207
+ * @throws {@link Pinnacle.InternalServerError}
208
+ * @throws {@link Pinnacle.NotImplementedError}
209
+ *
210
+ * @example
211
+ * await client.rcs.getLink({
212
+ * agentId: "agent_XXXXXXXXXXXX",
213
+ * testMode: false,
214
+ * phoneNumber: "+12345678901",
215
+ * body: "Hello, I need help with my order"
216
+ * })
217
+ */
218
+ getLink(request, requestOptions) {
219
+ return core.HttpResponsePromise.fromPromise(this.__getLink(request, requestOptions));
220
+ }
221
+ __getLink(request, requestOptions) {
222
+ return __awaiter(this, void 0, void 0, function* () {
223
+ var _a, _b, _c;
224
+ 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);
225
+ const _response = yield core.fetcher({
226
+ 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, "rcs/link"),
227
+ method: "POST",
228
+ headers: _headers,
229
+ contentType: "application/json",
230
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
231
+ requestType: "json",
232
+ body: request,
233
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
234
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
235
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
236
+ });
237
+ if (_response.ok) {
238
+ return { data: _response.body, rawResponse: _response.rawResponse };
239
+ }
240
+ if (_response.error.reason === "status-code") {
241
+ switch (_response.error.statusCode) {
242
+ case 400:
243
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
244
+ case 401:
245
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
246
+ case 404:
247
+ throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
248
+ case 500:
249
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
250
+ case 501:
251
+ throw new Pinnacle.NotImplementedError(_response.error.body, _response.rawResponse);
252
+ default:
253
+ throw new errors.PinnacleError({
254
+ statusCode: _response.error.statusCode,
255
+ body: _response.error.body,
256
+ rawResponse: _response.rawResponse,
257
+ });
258
+ }
259
+ }
260
+ switch (_response.error.reason) {
261
+ case "non-json":
262
+ throw new errors.PinnacleError({
263
+ statusCode: _response.error.statusCode,
264
+ body: _response.error.rawBody,
265
+ rawResponse: _response.rawResponse,
266
+ });
267
+ case "timeout":
268
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /rcs/link.");
269
+ case "unknown":
270
+ throw new errors.PinnacleError({
271
+ message: _response.error.errorMessage,
272
+ rawResponse: _response.rawResponse,
273
+ });
274
+ }
275
+ });
276
+ }
277
+ _getCustomAuthorizationHeaders() {
278
+ return __awaiter(this, void 0, void 0, function* () {
279
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
280
+ return { "PINNACLE-API-KEY": apiKeyValue };
281
+ });
282
+ }
283
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * phoneNumbers: ["+12345678901", "+19876543210"]
8
+ * }
9
+ */
10
+ export interface RcsCapabilitiesQuery {
11
+ /** List of phone numbers to check RCS capabilities for (E.164 format) */
12
+ phoneNumbers: string[];
13
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,22 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * agentId: "agent_XXXXXXXXXXXX",
8
+ * testMode: false,
9
+ * phoneNumber: "+12345678901",
10
+ * body: "Hello, I need help with my order"
11
+ * }
12
+ */
13
+ export interface RcsLinkRequest {
14
+ /** The RCS agent ID (must be prefixed with 'agent_') */
15
+ agentId: string;
16
+ /** Link to the test agent or the production agent if false */
17
+ testMode?: boolean;
18
+ /** Fallback phone number (E.164 format) to use if the phone number does not support RCS. If not provided, no url will be generated. */
19
+ phoneNumber?: string;
20
+ /** Optional message body to pre-fill after the user clicks the link */
21
+ body?: string;
22
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * agentId: "agent_XXXXXXXXXXXX",
8
+ * phoneNumber: "+12345678901"
9
+ * }
10
+ */
11
+ export interface RcsWhitelistRequest {
12
+ /** The RCS agent ID (must be prefixed with 'agent_') */
13
+ agentId: string;
14
+ /** Phone number to whitelist for testing (E.164 format) */
15
+ phoneNumber: string;
16
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,3 @@
1
+ export { type RcsCapabilitiesQuery } from "./RcsCapabilitiesQuery.mjs";
2
+ export { type RcsWhitelistRequest } from "./RcsWhitelistRequest.mjs";
3
+ export { type RcsLinkRequest } from "./RcsLinkRequest.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -64,9 +64,9 @@ export declare class Get {
64
64
  tollFree(campaignId: number, requestOptions?: Get.RequestOptions): core.HttpResponsePromise<Pinnacle.TollFreeCampaignStatus>;
65
65
  private __tollFree;
66
66
  /**
67
- * Retrieve a DLC campaign's status.
67
+ * Retrieve a 10DLC campaign's status.
68
68
  *
69
- * @param {number} campaignId - ID of the DLC campaign.
69
+ * @param {number} campaignId - ID of the 10DLC campaign.
70
70
  * @param {Get.RequestOptions} requestOptions - Request-specific configuration.
71
71
  *
72
72
  * @throws {@link Pinnacle.BadRequestError}
@@ -162,9 +162,9 @@ export class Get {
162
162
  });
163
163
  }
164
164
  /**
165
- * Retrieve a DLC campaign's status.
165
+ * Retrieve a 10DLC campaign's status.
166
166
  *
167
- * @param {number} campaignId - ID of the DLC campaign.
167
+ * @param {number} campaignId - ID of the 10DLC campaign.
168
168
  * @param {Get.RequestOptions} requestOptions - Request-specific configuration.
169
169
  *
170
170
  * @throws {@link Pinnacle.BadRequestError}
@@ -5,10 +5,10 @@ import * as Pinnacle from "../index.mjs";
5
5
  /**
6
6
  * Response for list conversation.
7
7
  */
8
- export interface ConversationList {
9
- /** Total number of conversations matching the filter. */
8
+ export type ConversationList = {
9
+ error?: string | undefined;
10
+ } | {
10
11
  count: number;
11
12
  conversations: Pinnacle.Conversation[];
12
- /** Indicates if more conversations are available beyond the current page. */
13
13
  hasMore: boolean;
14
- }
14
+ };
@@ -24,7 +24,7 @@ export interface DlcCampaignStatus {
24
24
  */
25
25
  status: Pinnacle.ProfileStatusEnum;
26
26
  /**
27
- * Status of toll free numbers that are being attached to this campaign. <br>
27
+ * Status of local long code numbers that are being attached to this campaign. <br>
28
28
  *
29
29
  * Note that phone numbers can only be attached to `VERIFIED` campaigns via the [attach campaign endpoint](../phone-numbers/attach-campaign).
30
30
  */
@@ -32,7 +32,7 @@ export interface DlcCampaignStatus {
32
32
  }
33
33
  export declare namespace DlcCampaignStatus {
34
34
  /**
35
- * Status of toll free numbers that are being attached to this campaign. <br>
35
+ * Status of local long code numbers that are being attached to this campaign. <br>
36
36
  *
37
37
  * Note that phone numbers can only be attached to `VERIFIED` campaigns via the [attach campaign endpoint](../phone-numbers/attach-campaign).
38
38
  */
@@ -37,9 +37,9 @@ export declare namespace ExtendedRcsCampaign {
37
37
  description?: string;
38
38
  /** List of emails. */
39
39
  emails?: Agent.Emails.Item[];
40
- /** Link to the agent's hero. */
40
+ /** Link to the agent's hero. Hero must be an image file with dimensions 1440x448px. */
41
41
  heroUrl?: string;
42
- /** Link to the agent's icon. */
42
+ /** Link to the agent's icon. Icon must be an image file with dimensions 224x224px. */
43
43
  iconUrl?: string;
44
44
  /** Name of the agent. */
45
45
  name?: string;
@@ -37,9 +37,9 @@ export declare namespace RcsCampaign {
37
37
  phones?: Agent.Phones.Item[];
38
38
  /** List of urls. */
39
39
  websites?: Agent.Websites.Item[];
40
- /** Link to the agent's hero. */
40
+ /** Link to the agent's hero. Hero must be an image file with dimensions 1440x448px. */
41
41
  heroUrl?: string;
42
- /** Link to the agent's icon. */
42
+ /** Link to the agent's icon. Icon must be an image file with dimensions 224x224px. */
43
43
  iconUrl?: string;
44
44
  }
45
45
  namespace Agent {
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Pinnacle from "../index.mjs";
5
+ /**
6
+ * Response containing RCS capabilities for requested phone numbers
7
+ */
8
+ export type RcsCapabilitiesResult = Record<string, (Pinnacle.RcsCapability | null) | undefined>;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,36 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * RCS capabilities for a phone number
6
+ */
7
+ export interface RcsCapability {
8
+ cards: RcsCapability.Cards;
9
+ /** Supported button action types inside the rich cards or quick replies. Each key is a button action type that defines a specific button type in the Pinnacle API. */
10
+ actions: RcsCapability.Actions;
11
+ }
12
+ export declare namespace RcsCapability {
13
+ interface Cards {
14
+ /** Whether the phone number supports standalone rich cards (`cards.length == 1`) */
15
+ standalone: boolean;
16
+ /** Whether the phone number supports carousel rich cards */
17
+ carousel: boolean;
18
+ }
19
+ /**
20
+ * Supported button action types inside the rich cards or quick replies. Each key is a button action type that defines a specific button type in the Pinnacle API.
21
+ */
22
+ interface Actions {
23
+ /** Buttons that open URLs are supported */
24
+ openUrl: boolean;
25
+ /** Buttons that make phone calls are supported */
26
+ call: boolean;
27
+ /** Buttons that trigger actions are supported */
28
+ trigger: boolean;
29
+ /** Buttons that request user location are supported */
30
+ requestUserLocation: boolean;
31
+ /** Buttons are supported */
32
+ scheduleEvent: boolean;
33
+ /** Buttons that send location are supported */
34
+ sendLocation: boolean;
35
+ }
36
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Response containing the generated RCS service id and/or url. You can always create a link with the service id that is returned.
6
+ * To create a link follow the format: sms://{PHONE_NUMBER}?service_id={SERVICE_ID}&body={URL_ENCODED_BODY}
7
+ */
8
+ export interface RcsLinkResult {
9
+ /** The generated RCS link URL. If no phone number is provided, no url will be generated. */
10
+ url?: string;
11
+ /** The service ID used for the link */
12
+ serviceId: string;
13
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -12,6 +12,7 @@ Pinnacle.RcsTextContent
12
12
  * See [supported media types](https://app.pinnacle.sh/supported-file-types?type=RCS-MEDIA). */
13
13
  | {
14
14
  media: string;
15
+ quickReplies: Pinnacle.RichButton[];
15
16
  }
16
17
  /**
17
18
  * Message containing cards, each with its own title, subtitle, and/or buttons. Quick replies can also be added. <br>
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Response indicating success of whitelisting operation
6
+ */
7
+ export interface RcsWhitelistResponse {
8
+ /** Whether the whitelisting operation was successful */
9
+ success: boolean;
10
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -102,6 +102,10 @@ export * from "./DetachedWebhookInfo.mjs";
102
102
  export * from "./MessagingProfileEnum.mjs";
103
103
  export * from "./AttachedPhoneNumberResult.mjs";
104
104
  export * from "./DetachedPhoneNumberResult.mjs";
105
+ export * from "./RcsCapability.mjs";
106
+ export * from "./RcsCapabilitiesResult.mjs";
107
+ export * from "./RcsWhitelistResponse.mjs";
108
+ export * from "./RcsLinkResult.mjs";
105
109
  export * from "./BrandStatus.mjs";
106
110
  export * from "./TollFreeStatusEnum.mjs";
107
111
  export * from "./TollFreeCampaignStatus.mjs";
@@ -102,6 +102,10 @@ export * from "./DetachedWebhookInfo.mjs";
102
102
  export * from "./MessagingProfileEnum.mjs";
103
103
  export * from "./AttachedPhoneNumberResult.mjs";
104
104
  export * from "./DetachedPhoneNumberResult.mjs";
105
+ export * from "./RcsCapability.mjs";
106
+ export * from "./RcsCapabilitiesResult.mjs";
107
+ export * from "./RcsWhitelistResponse.mjs";
108
+ export * from "./RcsLinkResult.mjs";
105
109
  export * from "./BrandStatus.mjs";
106
110
  export * from "./TollFreeStatusEnum.mjs";
107
111
  export * from "./TollFreeCampaignStatus.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.0.0-rc.10";
1
+ export declare const SDK_VERSION = "2.0.0-rc.11";
@@ -1 +1 @@
1
- export const SDK_VERSION = "2.0.0-rc.10";
1
+ export const SDK_VERSION = "2.0.0-rc.11";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rcs-js",
3
- "version": "2.0.0-rc.10",
3
+ "version": "2.0.0-rc.11",
4
4
  "private": false,
5
5
  "repository": "github:pinnacle-dev/rcs-js",
6
6
  "type": "commonjs",