rcs-js 2.0.5 → 2.0.6

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 (105) hide show
  1. package/README.md +0 -199
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +25 -20
  4. package/dist/cjs/api/resources/audiences/client/Client.d.ts +129 -0
  5. package/dist/cjs/api/resources/audiences/client/Client.js +385 -0
  6. package/dist/cjs/api/resources/audiences/client/index.d.ts +2 -0
  7. package/dist/cjs/api/resources/audiences/client/index.js +17 -0
  8. package/dist/cjs/api/resources/audiences/client/requests/AudiencesDeleteRequest.d.ts +13 -0
  9. package/dist/cjs/api/resources/audiences/client/requests/AudiencesDeleteRequest.js +5 -0
  10. package/dist/cjs/api/resources/audiences/client/requests/AudiencesGetRequest.d.ts +22 -0
  11. package/dist/cjs/api/resources/audiences/client/requests/AudiencesGetRequest.js +5 -0
  12. package/dist/cjs/api/resources/audiences/client/requests/CreateAudienceParams.d.ts +31 -0
  13. package/dist/cjs/api/resources/audiences/client/requests/CreateAudienceParams.js +5 -0
  14. package/dist/cjs/api/resources/audiences/client/requests/UpdateAudienceParams.d.ts +19 -0
  15. package/dist/cjs/api/resources/audiences/client/requests/UpdateAudienceParams.js +5 -0
  16. package/dist/cjs/api/resources/audiences/client/requests/index.d.ts +4 -0
  17. package/dist/cjs/api/resources/audiences/client/requests/index.js +2 -0
  18. package/dist/cjs/api/resources/audiences/index.d.ts +3 -0
  19. package/dist/cjs/api/resources/audiences/index.js +19 -0
  20. package/dist/cjs/api/resources/audiences/resources/contacts/client/Client.d.ts +80 -0
  21. package/dist/cjs/api/resources/audiences/resources/contacts/client/Client.js +220 -0
  22. package/dist/cjs/api/resources/audiences/resources/contacts/client/index.d.ts +2 -0
  23. package/dist/cjs/api/resources/audiences/resources/contacts/client/index.js +17 -0
  24. package/dist/cjs/api/resources/audiences/resources/contacts/client/requests/AddContactsParams.d.ts +16 -0
  25. package/dist/cjs/api/resources/audiences/resources/contacts/client/requests/AddContactsParams.js +5 -0
  26. package/dist/cjs/api/resources/audiences/resources/contacts/client/requests/RemoveContactsParams.d.ts +16 -0
  27. package/dist/cjs/api/resources/audiences/resources/contacts/client/requests/RemoveContactsParams.js +5 -0
  28. package/dist/cjs/api/resources/audiences/resources/contacts/client/requests/index.d.ts +2 -0
  29. package/dist/cjs/api/resources/audiences/resources/contacts/client/requests/index.js +2 -0
  30. package/dist/cjs/api/resources/audiences/resources/contacts/index.d.ts +1 -0
  31. package/dist/cjs/api/resources/audiences/resources/contacts/index.js +17 -0
  32. package/dist/cjs/api/resources/audiences/resources/index.d.ts +2 -0
  33. package/dist/cjs/api/resources/audiences/resources/index.js +41 -0
  34. package/dist/cjs/api/resources/audiences/types/AudiencesGetResponse.d.ts +11 -0
  35. package/dist/cjs/api/resources/audiences/types/AudiencesGetResponse.js +5 -0
  36. package/dist/cjs/api/resources/audiences/types/index.d.ts +1 -0
  37. package/dist/cjs/api/resources/audiences/types/index.js +17 -0
  38. package/dist/cjs/api/resources/index.d.ts +3 -0
  39. package/dist/cjs/api/resources/index.js +4 -1
  40. package/dist/cjs/api/types/AudienceCountOnly.d.ts +17 -0
  41. package/dist/cjs/api/types/AudienceCountOnly.js +5 -0
  42. package/dist/cjs/api/types/AudienceWithPagination.d.ts +17 -0
  43. package/dist/cjs/api/types/AudienceWithPagination.js +5 -0
  44. package/dist/cjs/api/types/DeleteAudienceResponse.d.ts +7 -0
  45. package/dist/cjs/api/types/DeleteAudienceResponse.js +5 -0
  46. package/dist/cjs/api/types/Pagination.d.ts +13 -0
  47. package/dist/cjs/api/types/Pagination.js +5 -0
  48. package/dist/cjs/api/types/SentMmsDetails.d.ts +5 -1
  49. package/dist/cjs/api/types/index.d.ts +4 -0
  50. package/dist/cjs/api/types/index.js +4 -0
  51. package/dist/cjs/version.d.ts +1 -1
  52. package/dist/cjs/version.js +1 -1
  53. package/dist/esm/Client.d.mts +3 -0
  54. package/dist/esm/Client.mjs +7 -2
  55. package/dist/esm/api/resources/audiences/client/Client.d.mts +129 -0
  56. package/dist/esm/api/resources/audiences/client/Client.mjs +348 -0
  57. package/dist/esm/api/resources/audiences/client/index.d.mts +2 -0
  58. package/dist/esm/api/resources/audiences/client/index.mjs +1 -0
  59. package/dist/esm/api/resources/audiences/client/requests/AudiencesDeleteRequest.d.mts +13 -0
  60. package/dist/esm/api/resources/audiences/client/requests/AudiencesDeleteRequest.mjs +4 -0
  61. package/dist/esm/api/resources/audiences/client/requests/AudiencesGetRequest.d.mts +22 -0
  62. package/dist/esm/api/resources/audiences/client/requests/AudiencesGetRequest.mjs +4 -0
  63. package/dist/esm/api/resources/audiences/client/requests/CreateAudienceParams.d.mts +31 -0
  64. package/dist/esm/api/resources/audiences/client/requests/CreateAudienceParams.mjs +4 -0
  65. package/dist/esm/api/resources/audiences/client/requests/UpdateAudienceParams.d.mts +19 -0
  66. package/dist/esm/api/resources/audiences/client/requests/UpdateAudienceParams.mjs +4 -0
  67. package/dist/esm/api/resources/audiences/client/requests/index.d.mts +4 -0
  68. package/dist/esm/api/resources/audiences/client/requests/index.mjs +1 -0
  69. package/dist/esm/api/resources/audiences/index.d.mts +3 -0
  70. package/dist/esm/api/resources/audiences/index.mjs +3 -0
  71. package/dist/esm/api/resources/audiences/resources/contacts/client/Client.d.mts +80 -0
  72. package/dist/esm/api/resources/audiences/resources/contacts/client/Client.mjs +183 -0
  73. package/dist/esm/api/resources/audiences/resources/contacts/client/index.d.mts +2 -0
  74. package/dist/esm/api/resources/audiences/resources/contacts/client/index.mjs +1 -0
  75. package/dist/esm/api/resources/audiences/resources/contacts/client/requests/AddContactsParams.d.mts +16 -0
  76. package/dist/esm/api/resources/audiences/resources/contacts/client/requests/AddContactsParams.mjs +4 -0
  77. package/dist/esm/api/resources/audiences/resources/contacts/client/requests/RemoveContactsParams.d.mts +16 -0
  78. package/dist/esm/api/resources/audiences/resources/contacts/client/requests/RemoveContactsParams.mjs +4 -0
  79. package/dist/esm/api/resources/audiences/resources/contacts/client/requests/index.d.mts +2 -0
  80. package/dist/esm/api/resources/audiences/resources/contacts/client/requests/index.mjs +1 -0
  81. package/dist/esm/api/resources/audiences/resources/contacts/index.d.mts +1 -0
  82. package/dist/esm/api/resources/audiences/resources/contacts/index.mjs +1 -0
  83. package/dist/esm/api/resources/audiences/resources/index.d.mts +2 -0
  84. package/dist/esm/api/resources/audiences/resources/index.mjs +2 -0
  85. package/dist/esm/api/resources/audiences/types/AudiencesGetResponse.d.mts +11 -0
  86. package/dist/esm/api/resources/audiences/types/AudiencesGetResponse.mjs +4 -0
  87. package/dist/esm/api/resources/audiences/types/index.d.mts +1 -0
  88. package/dist/esm/api/resources/audiences/types/index.mjs +1 -0
  89. package/dist/esm/api/resources/index.d.mts +3 -0
  90. package/dist/esm/api/resources/index.mjs +3 -0
  91. package/dist/esm/api/types/AudienceCountOnly.d.mts +17 -0
  92. package/dist/esm/api/types/AudienceCountOnly.mjs +4 -0
  93. package/dist/esm/api/types/AudienceWithPagination.d.mts +17 -0
  94. package/dist/esm/api/types/AudienceWithPagination.mjs +4 -0
  95. package/dist/esm/api/types/DeleteAudienceResponse.d.mts +7 -0
  96. package/dist/esm/api/types/DeleteAudienceResponse.mjs +4 -0
  97. package/dist/esm/api/types/Pagination.d.mts +13 -0
  98. package/dist/esm/api/types/Pagination.mjs +4 -0
  99. package/dist/esm/api/types/SentMmsDetails.d.mts +5 -1
  100. package/dist/esm/api/types/index.d.mts +4 -0
  101. package/dist/esm/api/types/index.mjs +4 -0
  102. package/dist/esm/version.d.mts +1 -1
  103. package/dist/esm/version.mjs +1 -1
  104. package/package.json +1 -1
  105. package/reference.md +408 -0
@@ -0,0 +1,220 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
39
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
+ return new (P || (P = Promise))(function (resolve, reject) {
41
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
45
+ });
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.Contacts = void 0;
49
+ const environments = __importStar(require("../../../../../../environments.js"));
50
+ const core = __importStar(require("../../../../../../core/index.js"));
51
+ const Pinnacle = __importStar(require("../../../../../index.js"));
52
+ const headers_js_1 = require("../../../../../../core/headers.js");
53
+ const errors = __importStar(require("../../../../../../errors/index.js"));
54
+ class Contacts {
55
+ constructor(_options = {}) {
56
+ this._options = _options;
57
+ }
58
+ /**
59
+ * Remove contacts from an existing audience. This operation is idempotent.
60
+ *
61
+ * - Only removes contacts that exist in the audience
62
+ * - Contacts not in the audience are ignored
63
+ *
64
+ * @param {Pinnacle.audiences.RemoveContactsParams} request
65
+ * @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
66
+ *
67
+ * @throws {@link Pinnacle.BadRequestError}
68
+ * @throws {@link Pinnacle.UnauthorizedError}
69
+ * @throws {@link Pinnacle.NotFoundError}
70
+ * @throws {@link Pinnacle.InternalServerError}
71
+ *
72
+ * @example
73
+ * await client.audiences.contacts.remove({
74
+ * id: "aud_abc123",
75
+ * contacts: ["+12125551234", "co_def456"]
76
+ * })
77
+ */
78
+ remove(request, requestOptions) {
79
+ return core.HttpResponsePromise.fromPromise(this.__remove(request, requestOptions));
80
+ }
81
+ __remove(request, requestOptions) {
82
+ return __awaiter(this, void 0, void 0, function* () {
83
+ var _a, _b, _c;
84
+ 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);
85
+ const _response = yield core.fetcher({
86
+ 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, "audiences/contacts"),
87
+ method: "DELETE",
88
+ headers: _headers,
89
+ contentType: "application/json",
90
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
91
+ requestType: "json",
92
+ body: request,
93
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
94
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
95
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
96
+ });
97
+ if (_response.ok) {
98
+ return { data: _response.body, rawResponse: _response.rawResponse };
99
+ }
100
+ if (_response.error.reason === "status-code") {
101
+ switch (_response.error.statusCode) {
102
+ case 400:
103
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
104
+ case 401:
105
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
106
+ case 404:
107
+ throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
108
+ case 500:
109
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
110
+ default:
111
+ throw new errors.PinnacleError({
112
+ statusCode: _response.error.statusCode,
113
+ body: _response.error.body,
114
+ rawResponse: _response.rawResponse,
115
+ });
116
+ }
117
+ }
118
+ switch (_response.error.reason) {
119
+ case "non-json":
120
+ throw new errors.PinnacleError({
121
+ statusCode: _response.error.statusCode,
122
+ body: _response.error.rawBody,
123
+ rawResponse: _response.rawResponse,
124
+ });
125
+ case "timeout":
126
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling DELETE /audiences/contacts.");
127
+ case "unknown":
128
+ throw new errors.PinnacleError({
129
+ message: _response.error.errorMessage,
130
+ rawResponse: _response.rawResponse,
131
+ });
132
+ }
133
+ });
134
+ }
135
+ /**
136
+ * Add contacts to an existing audience. This operation is additive and idempotent.
137
+ *
138
+ * - Phone numbers that don't exist will be auto-created as contacts
139
+ * - Duplicate adds are ignored
140
+ * - Contacts already in the audience are ignored
141
+ *
142
+ * @param {Pinnacle.audiences.AddContactsParams} request
143
+ * @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
144
+ *
145
+ * @throws {@link Pinnacle.BadRequestError}
146
+ * @throws {@link Pinnacle.UnauthorizedError}
147
+ * @throws {@link Pinnacle.NotFoundError}
148
+ * @throws {@link Pinnacle.InternalServerError}
149
+ *
150
+ * @example
151
+ * await client.audiences.contacts.add({
152
+ * id: "aud_abc123",
153
+ * contacts: ["+12125551234", "co_def456", "+13105551234"]
154
+ * })
155
+ */
156
+ add(request, requestOptions) {
157
+ return core.HttpResponsePromise.fromPromise(this.__add(request, requestOptions));
158
+ }
159
+ __add(request, requestOptions) {
160
+ return __awaiter(this, void 0, void 0, function* () {
161
+ var _a, _b, _c;
162
+ 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);
163
+ const _response = yield core.fetcher({
164
+ 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, "audiences/contacts"),
165
+ method: "PATCH",
166
+ headers: _headers,
167
+ contentType: "application/json",
168
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
169
+ requestType: "json",
170
+ body: request,
171
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
172
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
173
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
174
+ });
175
+ if (_response.ok) {
176
+ return { data: _response.body, rawResponse: _response.rawResponse };
177
+ }
178
+ if (_response.error.reason === "status-code") {
179
+ switch (_response.error.statusCode) {
180
+ case 400:
181
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
182
+ case 401:
183
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
184
+ case 404:
185
+ throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
186
+ case 500:
187
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
188
+ default:
189
+ throw new errors.PinnacleError({
190
+ statusCode: _response.error.statusCode,
191
+ body: _response.error.body,
192
+ rawResponse: _response.rawResponse,
193
+ });
194
+ }
195
+ }
196
+ switch (_response.error.reason) {
197
+ case "non-json":
198
+ throw new errors.PinnacleError({
199
+ statusCode: _response.error.statusCode,
200
+ body: _response.error.rawBody,
201
+ rawResponse: _response.rawResponse,
202
+ });
203
+ case "timeout":
204
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling PATCH /audiences/contacts.");
205
+ case "unknown":
206
+ throw new errors.PinnacleError({
207
+ message: _response.error.errorMessage,
208
+ rawResponse: _response.rawResponse,
209
+ });
210
+ }
211
+ });
212
+ }
213
+ _getCustomAuthorizationHeaders() {
214
+ return __awaiter(this, void 0, void 0, function* () {
215
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
216
+ return { "PINNACLE-API-KEY": apiKeyValue };
217
+ });
218
+ }
219
+ }
220
+ exports.Contacts = Contacts;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * id: "aud_abc123",
8
+ * contacts: ["+12125551234", "co_def456", "+13105551234"]
9
+ * }
10
+ */
11
+ export interface AddContactsParams {
12
+ /** Audience ID. This identifier is a string that always begins with the prefix `aud_`, for example: `aud_abc123`. */
13
+ id: string;
14
+ /** Array of phone numbers (E.164 format) or contact IDs (minimum 1 item). */
15
+ contacts: string[];
16
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * id: "aud_abc123",
8
+ * contacts: ["+12125551234", "co_def456"]
9
+ * }
10
+ */
11
+ export interface RemoveContactsParams {
12
+ /** Audience ID. This identifier is a string that always begins with the prefix `aud_`, for example: `aud_abc123`. */
13
+ id: string;
14
+ /** Array of phone numbers (E.164 format) or contact IDs (minimum 1 item). */
15
+ contacts: string[];
16
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { type RemoveContactsParams } from "./RemoveContactsParams.js";
2
+ export { type AddContactsParams } from "./AddContactsParams.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1,2 @@
1
+ export * as contacts from "./contacts/index.js";
2
+ export * from "./contacts/client/requests/index.js";
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.contacts = void 0;
40
+ exports.contacts = __importStar(require("./contacts/index.js"));
41
+ __exportStar(require("./contacts/client/requests/index.js"), exports);
@@ -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 AudiencesGetResponse =
6
+ /**
7
+ * Returned when page and/or limit parameters are provided. */
8
+ Pinnacle.AudienceWithPagination
9
+ /**
10
+ * Returned when no pagination parameters are provided. */
11
+ | Pinnacle.AudienceCountOnly;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./AudiencesGetResponse.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./AudiencesGetResponse.js"), exports);
@@ -1,3 +1,5 @@
1
+ export * as audiences from "./audiences/index.js";
2
+ export * from "./audiences/types/index.js";
1
3
  export * as conversations from "./conversations/index.js";
2
4
  export * from "./conversations/types/index.js";
3
5
  export * as phoneNumbers from "./phoneNumbers/index.js";
@@ -11,6 +13,7 @@ export * as webhooks from "./webhooks/index.js";
11
13
  export * as status from "./status/index.js";
12
14
  export * as tools from "./tools/index.js";
13
15
  export * from "./brands/client/requests/index.js";
16
+ export * from "./audiences/client/requests/index.js";
14
17
  export * from "./contacts/client/requests/index.js";
15
18
  export * from "./conversations/client/requests/index.js";
16
19
  export * from "./messages/client/requests/index.js";
@@ -36,7 +36,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.tools = exports.status = exports.webhooks = exports.rcs = exports.contacts = exports.brands = exports.messages = exports.campaigns = exports.phoneNumbers = exports.conversations = void 0;
39
+ exports.tools = exports.status = exports.webhooks = exports.rcs = exports.contacts = exports.brands = exports.messages = exports.campaigns = exports.phoneNumbers = exports.conversations = exports.audiences = void 0;
40
+ exports.audiences = __importStar(require("./audiences/index.js"));
41
+ __exportStar(require("./audiences/types/index.js"), exports);
40
42
  exports.conversations = __importStar(require("./conversations/index.js"));
41
43
  __exportStar(require("./conversations/types/index.js"), exports);
42
44
  exports.phoneNumbers = __importStar(require("./phoneNumbers/index.js"));
@@ -50,6 +52,7 @@ exports.webhooks = __importStar(require("./webhooks/index.js"));
50
52
  exports.status = __importStar(require("./status/index.js"));
51
53
  exports.tools = __importStar(require("./tools/index.js"));
52
54
  __exportStar(require("./brands/client/requests/index.js"), exports);
55
+ __exportStar(require("./audiences/client/requests/index.js"), exports);
53
56
  __exportStar(require("./contacts/client/requests/index.js"), exports);
54
57
  __exportStar(require("./conversations/client/requests/index.js"), exports);
55
58
  __exportStar(require("./messages/client/requests/index.js"), exports);
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface AudienceCountOnly {
5
+ /** Audience public ID. This identifier is a string that always begins with the prefix `aud_`, for example: `aud_abc123`. */
6
+ id: string;
7
+ /** Audience name. */
8
+ name: string;
9
+ /** Audience description. */
10
+ description: string;
11
+ /**
12
+ * Total number of contacts in audience.
13
+ *
14
+ * Use the [Get Audience](/api-reference/audiences/get) endpoint with the pagination parameters to get the audience with its contacts.
15
+ */
16
+ contactCount: number;
17
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Pinnacle from "../index.js";
5
+ export interface AudienceWithPagination {
6
+ /** Audience public ID. This identifier is a string that always begins with the prefix `aud_`, for example: `aud_abc123`. */
7
+ id: string;
8
+ /** Audience name. */
9
+ name: string;
10
+ /** Audience description. */
11
+ description: string;
12
+ /** Array of contact objects (paginated). */
13
+ contacts: Pinnacle.Contact[];
14
+ /** Total number of contacts in audience. */
15
+ contactCount: number;
16
+ pagination: Pinnacle.Pagination;
17
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface DeleteAudienceResponse {
5
+ /** Indicates successful deletion. */
6
+ success: boolean;
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface Pagination {
5
+ /** Current page number (1-indexed). */
6
+ page: number;
7
+ /** Items per page (max 100, default 50). */
8
+ limit: number;
9
+ /** Total number of contacts in the audience. */
10
+ total: number;
11
+ /** Whether more pages exist. */
12
+ hasMore: boolean;
13
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,7 +2,11 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface SentMmsDetails {
5
- /** Array of unique identifiers for the sent MMS messages. This identifiers are strings that always begin with the prefix `msg_`, for example: `msg_1234567890`. */
5
+ /**
6
+ * Array of unique message identifiers for an individual MMS send. Each identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
7
+ * When media assets are too large to fit in a single MMS and `options.multiple_messages` is set to true, the content is automatically split across multiple messages. Each split message gets its own ID, and all IDs are returned in this array. <br><br>
8
+ * Note: When sending to audiences, you'll receive multiple response objects (one per recipient), each containing its own messageIds array.
9
+ */
6
10
  messageIds: string[];
7
11
  /** Total number of segments used across the message. */
8
12
  segments: number;
@@ -35,6 +35,10 @@ export * from "./RcsCampaignUseCaseEnum.js";
35
35
  export * from "./RcsCampaign.js";
36
36
  export * from "./ExtendedRcsCampaign.js";
37
37
  export * from "./Contact.js";
38
+ export * from "./Pagination.js";
39
+ export * from "./AudienceWithPagination.js";
40
+ export * from "./AudienceCountOnly.js";
41
+ export * from "./DeleteAudienceResponse.js";
38
42
  export * from "./OptionalContact.js";
39
43
  export * from "./UpdatedContactId.js";
40
44
  export * from "./ContactId.js";
@@ -51,6 +51,10 @@ __exportStar(require("./RcsCampaignUseCaseEnum.js"), exports);
51
51
  __exportStar(require("./RcsCampaign.js"), exports);
52
52
  __exportStar(require("./ExtendedRcsCampaign.js"), exports);
53
53
  __exportStar(require("./Contact.js"), exports);
54
+ __exportStar(require("./Pagination.js"), exports);
55
+ __exportStar(require("./AudienceWithPagination.js"), exports);
56
+ __exportStar(require("./AudienceCountOnly.js"), exports);
57
+ __exportStar(require("./DeleteAudienceResponse.js"), exports);
54
58
  __exportStar(require("./OptionalContact.js"), exports);
55
59
  __exportStar(require("./UpdatedContactId.js"), exports);
56
60
  __exportStar(require("./ContactId.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.0.5";
1
+ export declare const SDK_VERSION = "2.0.6";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "2.0.5";
4
+ exports.SDK_VERSION = "2.0.6";
@@ -4,6 +4,7 @@
4
4
  import * as environments from "./environments.mjs";
5
5
  import * as core from "./core/index.mjs";
6
6
  import { Brands } from "./api/resources/brands/client/Client.mjs";
7
+ import { Audiences } from "./api/resources/audiences/client/Client.mjs";
7
8
  import { Contacts } from "./api/resources/contacts/client/Client.mjs";
8
9
  import { Conversations } from "./api/resources/conversations/client/Client.mjs";
9
10
  import { Messages } from "./api/resources/messages/client/Client.mjs";
@@ -38,6 +39,7 @@ export declare namespace PinnacleClient {
38
39
  export declare class PinnacleClient {
39
40
  protected readonly _options: PinnacleClient.Options;
40
41
  protected _brands: Brands | undefined;
42
+ protected _audiences: Audiences | undefined;
41
43
  protected _contacts: Contacts | undefined;
42
44
  protected _conversations: Conversations | undefined;
43
45
  protected _messages: Messages | undefined;
@@ -49,6 +51,7 @@ export declare class PinnacleClient {
49
51
  protected _tools: Tools | undefined;
50
52
  constructor(_options?: PinnacleClient.Options);
51
53
  get brands(): Brands;
54
+ get audiences(): Audiences;
52
55
  get contacts(): Contacts;
53
56
  get conversations(): Conversations;
54
57
  get messages(): Messages;
@@ -4,6 +4,7 @@
4
4
  import * as core from "./core/index.mjs";
5
5
  import { mergeHeaders } from "./core/headers.mjs";
6
6
  import { Brands } from "./api/resources/brands/client/Client.mjs";
7
+ import { Audiences } from "./api/resources/audiences/client/Client.mjs";
7
8
  import { Contacts } from "./api/resources/contacts/client/Client.mjs";
8
9
  import { Conversations } from "./api/resources/conversations/client/Client.mjs";
9
10
  import { Messages } from "./api/resources/messages/client/Client.mjs";
@@ -18,8 +19,8 @@ export class PinnacleClient {
18
19
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
19
20
  "X-Fern-Language": "JavaScript",
20
21
  "X-Fern-SDK-Name": "rcs-js",
21
- "X-Fern-SDK-Version": "2.0.5",
22
- "User-Agent": "rcs-js/2.0.5",
22
+ "X-Fern-SDK-Version": "2.0.6",
23
+ "User-Agent": "rcs-js/2.0.6",
23
24
  "X-Fern-Runtime": core.RUNTIME.type,
24
25
  "X-Fern-Runtime-Version": core.RUNTIME.version,
25
26
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -28,6 +29,10 @@ export class PinnacleClient {
28
29
  var _a;
29
30
  return ((_a = this._brands) !== null && _a !== void 0 ? _a : (this._brands = new Brands(this._options)));
30
31
  }
32
+ get audiences() {
33
+ var _a;
34
+ return ((_a = this._audiences) !== null && _a !== void 0 ? _a : (this._audiences = new Audiences(this._options)));
35
+ }
31
36
  get contacts() {
32
37
  var _a;
33
38
  return ((_a = this._contacts) !== null && _a !== void 0 ? _a : (this._contacts = new Contacts(this._options)));