rcs-js 2.0.14 → 2.0.16

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 (118) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/campaigns/resources/rcs/client/Client.d.ts +6 -12
  3. package/dist/cjs/api/resources/campaigns/resources/rcs/client/Client.js +6 -12
  4. package/dist/cjs/api/resources/campaigns/resources/rcs/client/requests/UpsertRcsCampaignParams.d.ts +12 -32
  5. package/dist/cjs/api/resources/messages/resources/rcs/client/Client.d.ts +0 -10
  6. package/dist/cjs/api/resources/messages/resources/rcs/client/Client.js +0 -10
  7. package/dist/cjs/api/resources/phoneNumbers/client/Client.d.ts +0 -3
  8. package/dist/cjs/api/resources/phoneNumbers/client/Client.js +0 -5
  9. package/dist/cjs/api/resources/phoneNumbers/resources/index.d.ts +0 -1
  10. package/dist/cjs/api/resources/phoneNumbers/resources/index.js +1 -2
  11. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +43 -0
  12. package/dist/cjs/api/resources/webhooks/client/Client.js +157 -0
  13. package/dist/cjs/api/resources/webhooks/client/requests/AttachWebhookParams.d.ts +23 -0
  14. package/dist/cjs/api/resources/webhooks/client/requests/DetachWebhookParams.d.ts +13 -0
  15. package/dist/cjs/api/resources/webhooks/client/requests/index.d.ts +2 -0
  16. package/dist/cjs/api/types/AttachWebhookResult.d.ts +22 -0
  17. package/dist/cjs/api/types/BaseRichMessage.d.ts +18 -1
  18. package/dist/cjs/api/types/DetachWebhookResult.d.ts +9 -0
  19. package/dist/cjs/api/types/ExtendedBrandWithVetting.d.ts +2 -2
  20. package/dist/cjs/api/types/ExtendedRcsCampaign.d.ts +6 -20
  21. package/dist/cjs/api/types/FailedSender.d.ts +6 -0
  22. package/dist/cjs/api/types/FailedSender.js +3 -0
  23. package/dist/cjs/api/types/RcsCampaign.d.ts +6 -20
  24. package/dist/cjs/api/types/RcsCampaignSummary.d.ts +0 -2
  25. package/dist/cjs/api/types/RcsCardsContent.d.ts +1 -1
  26. package/dist/cjs/api/types/RcsMediaContent.d.ts +1 -1
  27. package/dist/cjs/api/types/RcsValidateContent.d.ts +1 -1
  28. package/dist/cjs/api/types/RichCards.d.ts +1 -1
  29. package/dist/cjs/api/types/RichCardsMessage.d.ts +15 -1
  30. package/dist/cjs/api/types/RichMediaMessage.d.ts +1 -1
  31. package/dist/cjs/api/types/RichText.d.ts +1 -1
  32. package/dist/cjs/api/types/{SendRichMessageOptions.d.ts → SendRichMessageOptions4.d.ts} +1 -1
  33. package/dist/cjs/api/types/SendRichMessageOptions4.js +3 -0
  34. package/dist/cjs/api/types/SentRichMessageFallbackMms.d.ts +1 -1
  35. package/dist/cjs/api/types/SentRichMessageFallbackSms.d.ts +1 -1
  36. package/dist/cjs/api/types/SuccessfulConversationUpdate.d.ts +1 -1
  37. package/dist/cjs/api/types/VcardContent.d.ts +1 -1
  38. package/dist/cjs/api/types/WebhookEventEnum.d.ts +3 -2
  39. package/dist/cjs/api/types/WebhookEventEnum.js +3 -2
  40. package/dist/cjs/api/types/index.d.ts +4 -5
  41. package/dist/cjs/api/types/index.js +4 -5
  42. package/dist/cjs/version.d.ts +1 -1
  43. package/dist/cjs/version.js +1 -1
  44. package/dist/esm/Client.mjs +2 -2
  45. package/dist/esm/api/resources/campaigns/resources/rcs/client/Client.d.mts +6 -12
  46. package/dist/esm/api/resources/campaigns/resources/rcs/client/Client.mjs +6 -12
  47. package/dist/esm/api/resources/campaigns/resources/rcs/client/requests/UpsertRcsCampaignParams.d.mts +12 -32
  48. package/dist/esm/api/resources/messages/resources/rcs/client/Client.d.mts +0 -10
  49. package/dist/esm/api/resources/messages/resources/rcs/client/Client.mjs +0 -10
  50. package/dist/esm/api/resources/phoneNumbers/client/Client.d.mts +0 -3
  51. package/dist/esm/api/resources/phoneNumbers/client/Client.mjs +0 -5
  52. package/dist/esm/api/resources/phoneNumbers/resources/index.d.mts +0 -1
  53. package/dist/esm/api/resources/phoneNumbers/resources/index.mjs +0 -1
  54. package/dist/esm/api/resources/webhooks/client/Client.d.mts +43 -0
  55. package/dist/esm/api/resources/webhooks/client/Client.mjs +157 -0
  56. package/dist/esm/api/resources/webhooks/client/requests/AttachWebhookParams.d.mts +23 -0
  57. package/dist/esm/api/resources/webhooks/client/requests/DetachWebhookParams.d.mts +13 -0
  58. package/dist/esm/api/resources/webhooks/client/requests/index.d.mts +2 -0
  59. package/dist/esm/api/types/AttachWebhookResult.d.mts +22 -0
  60. package/dist/esm/api/types/BaseRichMessage.d.mts +18 -1
  61. package/dist/esm/api/types/DetachWebhookResult.d.mts +9 -0
  62. package/dist/esm/api/types/ExtendedBrandWithVetting.d.mts +2 -2
  63. package/dist/esm/api/types/ExtendedRcsCampaign.d.mts +6 -20
  64. package/dist/esm/api/types/FailedSender.d.mts +6 -0
  65. package/dist/esm/api/types/FailedSender.mjs +2 -0
  66. package/dist/esm/api/types/RcsCampaign.d.mts +6 -20
  67. package/dist/esm/api/types/RcsCampaignSummary.d.mts +0 -2
  68. package/dist/esm/api/types/RcsCardsContent.d.mts +1 -1
  69. package/dist/esm/api/types/RcsMediaContent.d.mts +1 -1
  70. package/dist/esm/api/types/RcsValidateContent.d.mts +1 -1
  71. package/dist/esm/api/types/RichCards.d.mts +1 -1
  72. package/dist/esm/api/types/RichCardsMessage.d.mts +15 -1
  73. package/dist/esm/api/types/RichMediaMessage.d.mts +1 -1
  74. package/dist/esm/api/types/RichText.d.mts +1 -1
  75. package/dist/esm/api/types/{SendRichMessageOptions.d.mts → SendRichMessageOptions4.d.mts} +1 -1
  76. package/dist/esm/api/types/SendRichMessageOptions4.mjs +2 -0
  77. package/dist/esm/api/types/SentRichMessageFallbackMms.d.mts +1 -1
  78. package/dist/esm/api/types/SentRichMessageFallbackSms.d.mts +1 -1
  79. package/dist/esm/api/types/SuccessfulConversationUpdate.d.mts +1 -1
  80. package/dist/esm/api/types/VcardContent.d.mts +1 -1
  81. package/dist/esm/api/types/WebhookEventEnum.d.mts +3 -2
  82. package/dist/esm/api/types/WebhookEventEnum.mjs +3 -2
  83. package/dist/esm/api/types/index.d.mts +4 -5
  84. package/dist/esm/api/types/index.mjs +4 -5
  85. package/dist/esm/version.d.mts +1 -1
  86. package/dist/esm/version.mjs +1 -1
  87. package/package.json +1 -1
  88. package/reference.md +143 -182
  89. package/dist/cjs/api/resources/phoneNumbers/resources/webhook/client/Client.d.ts +0 -63
  90. package/dist/cjs/api/resources/phoneNumbers/resources/webhook/client/Client.js +0 -231
  91. package/dist/cjs/api/resources/phoneNumbers/resources/webhook/client/index.d.ts +0 -1
  92. package/dist/cjs/api/resources/phoneNumbers/resources/webhook/client/index.js +0 -2
  93. package/dist/cjs/api/resources/phoneNumbers/resources/webhook/index.d.ts +0 -1
  94. package/dist/cjs/api/resources/phoneNumbers/resources/webhook/index.js +0 -17
  95. package/dist/cjs/api/types/AttachWebhookParams.d.ts +0 -19
  96. package/dist/cjs/api/types/ConfiguredWebhook.d.ts +0 -32
  97. package/dist/cjs/api/types/DetachedWebhookInfo.d.ts +0 -8
  98. package/dist/cjs/api/types/RcsCampaignUseCaseEnum.d.ts +0 -37
  99. package/dist/cjs/api/types/RcsCampaignUseCaseEnum.js +0 -40
  100. package/dist/esm/api/resources/phoneNumbers/resources/webhook/client/Client.d.mts +0 -63
  101. package/dist/esm/api/resources/phoneNumbers/resources/webhook/client/Client.mjs +0 -194
  102. package/dist/esm/api/resources/phoneNumbers/resources/webhook/client/index.d.mts +0 -1
  103. package/dist/esm/api/resources/phoneNumbers/resources/webhook/client/index.mjs +0 -1
  104. package/dist/esm/api/resources/phoneNumbers/resources/webhook/index.d.mts +0 -1
  105. package/dist/esm/api/resources/phoneNumbers/resources/webhook/index.mjs +0 -1
  106. package/dist/esm/api/types/AttachWebhookParams.d.mts +0 -19
  107. package/dist/esm/api/types/ConfiguredWebhook.d.mts +0 -32
  108. package/dist/esm/api/types/DetachedWebhookInfo.d.mts +0 -8
  109. package/dist/esm/api/types/RcsCampaignUseCaseEnum.d.mts +0 -37
  110. package/dist/esm/api/types/RcsCampaignUseCaseEnum.mjs +0 -37
  111. /package/dist/cjs/api/{types → resources/webhooks/client/requests}/AttachWebhookParams.js +0 -0
  112. /package/dist/cjs/api/{types/ConfiguredWebhook.js → resources/webhooks/client/requests/DetachWebhookParams.js} +0 -0
  113. /package/dist/cjs/api/types/{DetachedWebhookInfo.js → AttachWebhookResult.js} +0 -0
  114. /package/dist/cjs/api/types/{SendRichMessageOptions.js → DetachWebhookResult.js} +0 -0
  115. /package/dist/esm/api/{types → resources/webhooks/client/requests}/AttachWebhookParams.mjs +0 -0
  116. /package/dist/esm/api/{types/ConfiguredWebhook.mjs → resources/webhooks/client/requests/DetachWebhookParams.mjs} +0 -0
  117. /package/dist/esm/api/types/{DetachedWebhookInfo.mjs → AttachWebhookResult.mjs} +0 -0
  118. /package/dist/esm/api/types/{SendRichMessageOptions.mjs → DetachWebhookResult.mjs} +0 -0
@@ -1,231 +0,0 @@
1
- "use strict";
2
- // This file was auto-generated by Fern from our API Definition.
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
36
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
- return new (P || (P = Promise))(function (resolve, reject) {
39
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
- step((generator = generator.apply(thisArg, _arguments || [])).next());
43
- });
44
- };
45
- Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.Webhook = void 0;
47
- const headers_js_1 = require("../../../../../../core/headers.js");
48
- const core = __importStar(require("../../../../../../core/index.js"));
49
- const environments = __importStar(require("../../../../../../environments.js"));
50
- const errors = __importStar(require("../../../../../../errors/index.js"));
51
- const Pinnacle = __importStar(require("../../../../../index.js"));
52
- class Webhook {
53
- constructor(_options) {
54
- this._options = _options;
55
- }
56
- /**
57
- * Connect a webhook to your phone number to receive real-time notifications for incoming messages, delivery status updates, and other communication events.
58
- *
59
- * @param {string} phone - The phone number you want to attach the webhook to in E.164 format. Make sure it is url encoded (i.e. replace the leading + with %2B). <br>
60
- *
61
- * Must be a phone number that you own and have already [purchased](./buy) through the API. A phone number can have multiple webhooks attached to it.
62
- * @param {Pinnacle.AttachWebhookParams} request
63
- * @param {Webhook.RequestOptions} requestOptions - Request-specific configuration.
64
- *
65
- * @throws {@link Pinnacle.BadRequestError}
66
- * @throws {@link Pinnacle.UnauthorizedError}
67
- * @throws {@link Pinnacle.ForbiddenError}
68
- * @throws {@link Pinnacle.NotFoundError}
69
- * @throws {@link Pinnacle.InternalServerError}
70
- * @throws {@link Pinnacle.NotImplementedError}
71
- *
72
- * @example
73
- * await client.phoneNumbers.webhook.attach("%2B14155551234", {
74
- * webhookId: "wh_1234567890",
75
- * event: "MESSAGE.STATUS"
76
- * })
77
- */
78
- attach(phone, request, requestOptions) {
79
- return core.HttpResponsePromise.fromPromise(this.__attach(phone, request, requestOptions));
80
- }
81
- __attach(phone, request, requestOptions) {
82
- return __awaiter(this, void 0, void 0, function* () {
83
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
84
- const _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, `phone-numbers/${core.url.encodePathParam(phone)}/attach-webhook`),
87
- method: "POST",
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: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
94
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
95
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
96
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
97
- logging: this._options.logging,
98
- });
99
- if (_response.ok) {
100
- return { data: _response.body, rawResponse: _response.rawResponse };
101
- }
102
- if (_response.error.reason === "status-code") {
103
- switch (_response.error.statusCode) {
104
- case 400:
105
- throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
106
- case 401:
107
- throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
108
- case 403:
109
- throw new Pinnacle.ForbiddenError(_response.error.body, _response.rawResponse);
110
- case 404:
111
- throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
112
- case 500:
113
- throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
114
- case 501:
115
- throw new Pinnacle.NotImplementedError(_response.error.body, _response.rawResponse);
116
- default:
117
- throw new errors.PinnacleError({
118
- statusCode: _response.error.statusCode,
119
- body: _response.error.body,
120
- rawResponse: _response.rawResponse,
121
- });
122
- }
123
- }
124
- switch (_response.error.reason) {
125
- case "non-json":
126
- throw new errors.PinnacleError({
127
- statusCode: _response.error.statusCode,
128
- body: _response.error.rawBody,
129
- rawResponse: _response.rawResponse,
130
- });
131
- case "timeout":
132
- throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /phone-numbers/{phone}/attach-webhook.");
133
- case "unknown":
134
- throw new errors.PinnacleError({
135
- message: _response.error.errorMessage,
136
- rawResponse: _response.rawResponse,
137
- });
138
- }
139
- });
140
- }
141
- /**
142
- * Disconnect a webhook from your phone number to stop receiving event notifications for that specific number. <br>
143
- *
144
- * The webhook configuration itself remains intact and available for use with other phone numbers.
145
- *
146
- * @param {string} phone - The phone number you want to attach the webhook to in E.164 format. Make sure it is url encoded (i.e. replace the leading + with %2B). <br>
147
- *
148
- * Must be a phone number that you own and currently has the specified webhook attached.
149
- * @param {string} webhookId - The unique identifier of the webhook you want to detach from the phone number. <br>
150
- *
151
- * This must be a valid webhook ID that is currently attached to the specified phone number. This identifier is a string that always begins with the prefix `wh_`, for example: `wh_1234567890`.
152
- * @param {Webhook.RequestOptions} requestOptions - Request-specific configuration.
153
- *
154
- * @throws {@link Pinnacle.BadRequestError}
155
- * @throws {@link Pinnacle.UnauthorizedError}
156
- * @throws {@link Pinnacle.ForbiddenError}
157
- * @throws {@link Pinnacle.NotFoundError}
158
- * @throws {@link Pinnacle.InternalServerError}
159
- * @throws {@link Pinnacle.NotImplementedError}
160
- *
161
- * @example
162
- * await client.phoneNumbers.webhook.detach("+14155551234", "wh_1234567890")
163
- */
164
- detach(phone, webhookId, requestOptions) {
165
- return core.HttpResponsePromise.fromPromise(this.__detach(phone, webhookId, requestOptions));
166
- }
167
- __detach(phone, webhookId, requestOptions) {
168
- return __awaiter(this, void 0, void 0, function* () {
169
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
170
- const _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);
171
- const _response = yield core.fetcher({
172
- 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, `phone-numbers/${core.url.encodePathParam(phone)}/detach-webhook/${core.url.encodePathParam(webhookId)}`),
173
- method: "DELETE",
174
- headers: _headers,
175
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
176
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
177
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
178
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
179
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
180
- logging: this._options.logging,
181
- });
182
- if (_response.ok) {
183
- return { data: _response.body, rawResponse: _response.rawResponse };
184
- }
185
- if (_response.error.reason === "status-code") {
186
- switch (_response.error.statusCode) {
187
- case 400:
188
- throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
189
- case 401:
190
- throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
191
- case 403:
192
- throw new Pinnacle.ForbiddenError(_response.error.body, _response.rawResponse);
193
- case 404:
194
- throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
195
- case 500:
196
- throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
197
- case 501:
198
- throw new Pinnacle.NotImplementedError(_response.error.body, _response.rawResponse);
199
- default:
200
- throw new errors.PinnacleError({
201
- statusCode: _response.error.statusCode,
202
- body: _response.error.body,
203
- rawResponse: _response.rawResponse,
204
- });
205
- }
206
- }
207
- switch (_response.error.reason) {
208
- case "non-json":
209
- throw new errors.PinnacleError({
210
- statusCode: _response.error.statusCode,
211
- body: _response.error.rawBody,
212
- rawResponse: _response.rawResponse,
213
- });
214
- case "timeout":
215
- throw new errors.PinnacleTimeoutError("Timeout exceeded when calling DELETE /phone-numbers/{phone}/detach-webhook/{webhookId}.");
216
- case "unknown":
217
- throw new errors.PinnacleError({
218
- message: _response.error.errorMessage,
219
- rawResponse: _response.rawResponse,
220
- });
221
- }
222
- });
223
- }
224
- _getCustomAuthorizationHeaders() {
225
- return __awaiter(this, void 0, void 0, function* () {
226
- const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
227
- return { "PINNACLE-API-KEY": apiKeyValue };
228
- });
229
- }
230
- }
231
- exports.Webhook = Webhook;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +0,0 @@
1
- export * from "./client/index.js";
@@ -1,17 +0,0 @@
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);
@@ -1,19 +0,0 @@
1
- import type * as Pinnacle from "../index.js";
2
- /**
3
- * Use this request to connect a webhook to your phone number and receive real-time event notifications.
4
- * You can either attach one of your existing webhooks by providing its ID or create a new webhook by specifying its name, URL, and event type.
5
- */
6
- export type AttachWebhookParams =
7
- /**
8
- * Attach a webhook you've already created in your account to this phone number. */
9
- {
10
- webhookId: string;
11
- event: Pinnacle.WebhookEventEnum | null;
12
- }
13
- /**
14
- * Create a new webhook and immediately attach it to your phone number. */
15
- | {
16
- name: string;
17
- url: string;
18
- event: Pinnacle.WebhookEventEnum | null;
19
- };
@@ -1,32 +0,0 @@
1
- import type * as Pinnacle from "../index.js";
2
- /**
3
- * Confirmation that a webhook has been successfully attached to the specified phone number.
4
- * Includes detailed webhook information, the subscribed event type, and the associated phone number.
5
- */
6
- export interface ConfiguredWebhook {
7
- /** Detailed information about the attached webhook. */
8
- webhook: ConfiguredWebhook.Webhook;
9
- /** Specific event type configured for this webhook attachment. */
10
- event: Pinnacle.WebhookEventEnum;
11
- /** Phone number in E.164 format that is linked to the webhook. */
12
- phoneNumber: string;
13
- }
14
- export declare namespace ConfiguredWebhook {
15
- /**
16
- * Detailed information about the attached webhook.
17
- */
18
- interface Webhook {
19
- /** Unique identifier of the webhook within the account. This identifier is a string that always begins with the prefix `wh_`, for example: `wh_1234567890`. */
20
- id: string;
21
- /** Name of the webhook. */
22
- name: string;
23
- /** The HTTPS endpoint URL where webhook events will be sent as HTTP POST requests. */
24
- url: string;
25
- /**
26
- * Secret key used to verify the authenticity of incoming webhook requests. <br>
27
- *
28
- * This secret key will be stored in the `PINNACLE-SIGNING-SECRET` header.
29
- */
30
- secret?: string;
31
- }
32
- }
@@ -1,8 +0,0 @@
1
- export interface DetachedWebhookInfo {
2
- /** Confirmation message. */
3
- message: string;
4
- /** Unique identifier of the webhook within the account. This identifier is a string that always begins with the prefix `wh_`, for example: `wh_1234567890`. */
5
- webhookId: string;
6
- /** Phone number the webhook was detached from in E.164 format. */
7
- phoneNumber: string;
8
- }
@@ -1,37 +0,0 @@
1
- /** The primary use case classification for this campaign. */
2
- export declare const RcsCampaignUseCaseEnum: {
3
- readonly AdvertisingMarketing: "ADVERTISING_MARKETING";
4
- readonly ArtsAndEntertainment: "ARTS_AND_ENTERTAINMENT";
5
- readonly Bfsi: "BFSI";
6
- readonly CommercialAndIndustrial: "COMMERCIAL_AND_INDUSTRIAL";
7
- readonly CommunityOrganizations: "COMMUNITY_ORGANIZATIONS";
8
- readonly CreditRating: "CREDIT_RATING";
9
- readonly DeliveryPartner: "DELIVERY_PARTNER";
10
- readonly Education: "EDUCATION";
11
- readonly Finance: "FINANCE";
12
- readonly FoodAndBeverage: "FOOD_AND_BEVERAGE";
13
- readonly Gaming: "GAMING";
14
- readonly Government: "GOVERNMENT";
15
- readonly Health: "HEALTH";
16
- readonly HotelAndBnb: "HOTEL_AND_BNB";
17
- readonly Insurance: "INSURANCE";
18
- readonly Legal: "LEGAL";
19
- readonly Lending: "LENDING";
20
- readonly Loans: "LOANS";
21
- readonly LocalServices: "LOCAL_SERVICES";
22
- readonly News: "NEWS";
23
- readonly NonGovernmentalOrganizations: "NON_GOVERNMENTAL_ORGANIZATIONS";
24
- readonly NonProfitOrganizations: "NON_PROFIT_ORGANIZATIONS";
25
- readonly OnlineSeller: "ONLINE_SELLER";
26
- readonly Other: "OTHER";
27
- readonly Productivity: "PRODUCTIVITY";
28
- readonly Property: "PROPERTY";
29
- readonly ScienceTechnologyEngineering: "SCIENCE_TECHNOLOGY_ENGINEERING";
30
- readonly ShoppingAndRetail: "SHOPPING_AND_RETAIL";
31
- readonly Social: "SOCIAL";
32
- readonly Sports: "SPORTS";
33
- readonly Telecommunications: "TELECOMMUNICATIONS";
34
- readonly Travel: "TRAVEL";
35
- readonly Utilities: "UTILITIES";
36
- };
37
- export type RcsCampaignUseCaseEnum = (typeof RcsCampaignUseCaseEnum)[keyof typeof RcsCampaignUseCaseEnum];
@@ -1,40 +0,0 @@
1
- "use strict";
2
- // This file was auto-generated by Fern from our API Definition.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.RcsCampaignUseCaseEnum = void 0;
5
- /** The primary use case classification for this campaign. */
6
- exports.RcsCampaignUseCaseEnum = {
7
- AdvertisingMarketing: "ADVERTISING_MARKETING",
8
- ArtsAndEntertainment: "ARTS_AND_ENTERTAINMENT",
9
- Bfsi: "BFSI",
10
- CommercialAndIndustrial: "COMMERCIAL_AND_INDUSTRIAL",
11
- CommunityOrganizations: "COMMUNITY_ORGANIZATIONS",
12
- CreditRating: "CREDIT_RATING",
13
- DeliveryPartner: "DELIVERY_PARTNER",
14
- Education: "EDUCATION",
15
- Finance: "FINANCE",
16
- FoodAndBeverage: "FOOD_AND_BEVERAGE",
17
- Gaming: "GAMING",
18
- Government: "GOVERNMENT",
19
- Health: "HEALTH",
20
- HotelAndBnb: "HOTEL_AND_BNB",
21
- Insurance: "INSURANCE",
22
- Legal: "LEGAL",
23
- Lending: "LENDING",
24
- Loans: "LOANS",
25
- LocalServices: "LOCAL_SERVICES",
26
- News: "NEWS",
27
- NonGovernmentalOrganizations: "NON_GOVERNMENTAL_ORGANIZATIONS",
28
- NonProfitOrganizations: "NON_PROFIT_ORGANIZATIONS",
29
- OnlineSeller: "ONLINE_SELLER",
30
- Other: "OTHER",
31
- Productivity: "PRODUCTIVITY",
32
- Property: "PROPERTY",
33
- ScienceTechnologyEngineering: "SCIENCE_TECHNOLOGY_ENGINEERING",
34
- ShoppingAndRetail: "SHOPPING_AND_RETAIL",
35
- Social: "SOCIAL",
36
- Sports: "SPORTS",
37
- Telecommunications: "TELECOMMUNICATIONS",
38
- Travel: "TRAVEL",
39
- Utilities: "UTILITIES",
40
- };
@@ -1,63 +0,0 @@
1
- import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
2
- import * as core from "../../../../../../core/index.mjs";
3
- import * as Pinnacle from "../../../../../index.mjs";
4
- export declare namespace Webhook {
5
- interface Options extends BaseClientOptions {
6
- }
7
- interface RequestOptions extends BaseRequestOptions {
8
- }
9
- }
10
- export declare class Webhook {
11
- protected readonly _options: Webhook.Options;
12
- constructor(_options: Webhook.Options);
13
- /**
14
- * Connect a webhook to your phone number to receive real-time notifications for incoming messages, delivery status updates, and other communication events.
15
- *
16
- * @param {string} phone - The phone number you want to attach the webhook to in E.164 format. Make sure it is url encoded (i.e. replace the leading + with %2B). <br>
17
- *
18
- * Must be a phone number that you own and have already [purchased](./buy) through the API. A phone number can have multiple webhooks attached to it.
19
- * @param {Pinnacle.AttachWebhookParams} request
20
- * @param {Webhook.RequestOptions} requestOptions - Request-specific configuration.
21
- *
22
- * @throws {@link Pinnacle.BadRequestError}
23
- * @throws {@link Pinnacle.UnauthorizedError}
24
- * @throws {@link Pinnacle.ForbiddenError}
25
- * @throws {@link Pinnacle.NotFoundError}
26
- * @throws {@link Pinnacle.InternalServerError}
27
- * @throws {@link Pinnacle.NotImplementedError}
28
- *
29
- * @example
30
- * await client.phoneNumbers.webhook.attach("%2B14155551234", {
31
- * webhookId: "wh_1234567890",
32
- * event: "MESSAGE.STATUS"
33
- * })
34
- */
35
- attach(phone: string, request: Pinnacle.AttachWebhookParams, requestOptions?: Webhook.RequestOptions): core.HttpResponsePromise<Pinnacle.ConfiguredWebhook>;
36
- private __attach;
37
- /**
38
- * Disconnect a webhook from your phone number to stop receiving event notifications for that specific number. <br>
39
- *
40
- * The webhook configuration itself remains intact and available for use with other phone numbers.
41
- *
42
- * @param {string} phone - The phone number you want to attach the webhook to in E.164 format. Make sure it is url encoded (i.e. replace the leading + with %2B). <br>
43
- *
44
- * Must be a phone number that you own and currently has the specified webhook attached.
45
- * @param {string} webhookId - The unique identifier of the webhook you want to detach from the phone number. <br>
46
- *
47
- * This must be a valid webhook ID that is currently attached to the specified phone number. This identifier is a string that always begins with the prefix `wh_`, for example: `wh_1234567890`.
48
- * @param {Webhook.RequestOptions} requestOptions - Request-specific configuration.
49
- *
50
- * @throws {@link Pinnacle.BadRequestError}
51
- * @throws {@link Pinnacle.UnauthorizedError}
52
- * @throws {@link Pinnacle.ForbiddenError}
53
- * @throws {@link Pinnacle.NotFoundError}
54
- * @throws {@link Pinnacle.InternalServerError}
55
- * @throws {@link Pinnacle.NotImplementedError}
56
- *
57
- * @example
58
- * await client.phoneNumbers.webhook.detach("+14155551234", "wh_1234567890")
59
- */
60
- detach(phone: string, webhookId: string, requestOptions?: Webhook.RequestOptions): core.HttpResponsePromise<Pinnacle.DetachedWebhookInfo>;
61
- private __detach;
62
- protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
63
- }