rcs-js 2.0.0-rc.9 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Client.d.ts +5 -2
- package/dist/cjs/Client.js +16 -11
- package/dist/cjs/api/resources/brands/client/Client.d.ts +6 -4
- package/dist/cjs/api/resources/brands/client/Client.js +15 -9
- package/dist/cjs/api/resources/brands/client/requests/BrandsGetRequest.d.ts +1 -1
- package/dist/cjs/api/resources/brands/client/requests/UpsertBrandParams.d.ts +3 -3
- package/dist/cjs/api/resources/campaigns/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/campaigns/client/Client.js +1 -1
- package/dist/cjs/api/resources/campaigns/resources/dlc/client/Client.d.ts +9 -9
- package/dist/cjs/api/resources/campaigns/resources/dlc/client/Client.js +7 -7
- package/dist/cjs/api/resources/campaigns/resources/rcs/client/Client.d.ts +5 -3
- package/dist/cjs/api/resources/campaigns/resources/rcs/client/Client.js +5 -1
- package/dist/cjs/api/resources/campaigns/resources/rcs/client/requests/UpsertRcsCampaignParams.d.ts +5 -4
- package/dist/cjs/api/resources/campaigns/resources/tollFree/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/campaigns/resources/tollFree/client/Client.js +1 -1
- package/dist/cjs/api/resources/contacts/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/contacts/client/Client.js +7 -7
- package/dist/cjs/api/resources/contacts/client/requests/ContactsGetRequest.d.ts +2 -2
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +4 -4
- package/dist/cjs/api/resources/conversations/client/Client.js +2 -5
- package/dist/cjs/api/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/index.js +3 -1
- package/dist/cjs/api/resources/messages/client/Client.d.ts +6 -3
- package/dist/cjs/api/resources/messages/client/Client.js +10 -1
- package/dist/cjs/api/resources/messages/client/requests/ReactMessageParams.d.ts +1 -1
- package/dist/cjs/api/resources/messages/resources/mms/client/Client.d.ts +4 -3
- package/dist/cjs/api/resources/messages/resources/mms/client/Client.js +4 -1
- package/dist/cjs/api/resources/messages/resources/rcs/client/Client.d.ts +6 -5
- package/dist/cjs/api/resources/messages/resources/rcs/client/Client.js +5 -2
- package/dist/cjs/api/resources/messages/resources/sms/client/Client.d.ts +4 -3
- package/dist/cjs/api/resources/messages/resources/sms/client/Client.js +4 -1
- package/dist/cjs/api/resources/phoneNumbers/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/phoneNumbers/client/Client.js +1 -1
- package/dist/cjs/api/resources/phoneNumbers/resources/campaign/client/Client.d.ts +6 -4
- package/dist/cjs/api/resources/phoneNumbers/resources/campaign/client/Client.js +8 -2
- package/dist/cjs/api/resources/phoneNumbers/resources/webhook/client/Client.d.ts +7 -5
- package/dist/cjs/api/resources/phoneNumbers/resources/webhook/client/Client.js +7 -3
- package/dist/cjs/api/resources/rcs/client/Client.d.ts +121 -0
- package/dist/cjs/api/resources/rcs/client/Client.js +320 -0
- package/dist/cjs/api/resources/rcs/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/rcs/client/index.js +17 -0
- package/dist/cjs/api/resources/rcs/client/requests/RcsCapabilitiesQuery.d.ts +13 -0
- package/dist/cjs/api/resources/rcs/client/requests/RcsLinkRequest.d.ts +22 -0
- package/dist/cjs/api/resources/rcs/client/requests/RcsWhitelistRequest.d.ts +16 -0
- package/dist/cjs/api/resources/rcs/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/rcs/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/rcs/index.d.ts +1 -0
- package/dist/cjs/api/resources/rcs/index.js +17 -0
- package/dist/cjs/api/resources/status/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/status/client/Client.js +1 -1
- package/dist/cjs/api/resources/status/resources/get/client/Client.d.ts +5 -5
- package/dist/cjs/api/resources/status/resources/get/client/Client.js +3 -3
- package/dist/cjs/api/resources/tools/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/tools/client/Client.js +1 -1
- package/dist/cjs/api/resources/tools/resources/contactCard/client/Client.d.ts +5 -5
- package/dist/cjs/api/resources/tools/resources/contactCard/client/Client.js +3 -3
- package/dist/cjs/api/resources/tools/resources/file/client/Client.d.ts +24 -3
- package/dist/cjs/api/resources/tools/resources/file/client/Client.js +75 -1
- package/dist/cjs/api/resources/tools/resources/file/client/requests/RefreshFileParams.d.ts +21 -0
- package/dist/cjs/api/resources/tools/resources/file/client/requests/RefreshFileParams.js +5 -0
- package/dist/cjs/api/resources/tools/resources/file/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/tools/resources/url/client/Client.d.ts +4 -4
- package/dist/cjs/api/resources/tools/resources/url/client/Client.js +2 -2
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/webhooks/client/Client.js +1 -1
- package/dist/cjs/api/types/AdvancedPhoneInformation.d.ts +9 -9
- package/dist/cjs/api/types/AttachWebhookParams.d.ts +2 -2
- package/dist/cjs/api/types/AutofillDlcCampaignResponse.d.ts +11 -11
- package/dist/cjs/api/types/ButtonClicked.d.ts +11 -0
- package/dist/cjs/api/types/ButtonClicked.js +5 -0
- package/dist/cjs/api/types/ButtonClickedData.d.ts +58 -0
- package/dist/cjs/api/types/ButtonClickedData.js +16 -0
- package/dist/cjs/api/types/Conversation.d.ts +3 -3
- package/dist/cjs/api/types/ConversationList.d.ts +4 -4
- package/dist/cjs/api/types/CreateUrlOptions.d.ts +1 -1
- package/dist/cjs/api/types/DlcCampaignStatus.d.ts +2 -2
- package/dist/cjs/api/types/DlcCampaignWithExtendedBrandAndStatus.d.ts +13 -10
- package/dist/cjs/api/types/EnhancedContactItem.d.ts +1 -1
- package/dist/cjs/api/types/ExtendedBrand.d.ts +12 -5
- package/dist/cjs/api/types/ExtendedBrandWithVetting.d.ts +2 -2
- package/dist/cjs/api/types/ExtendedRcsCampaign.d.ts +13 -12
- package/dist/cjs/api/types/Message.d.ts +4 -4
- package/dist/cjs/api/types/MessageContent.d.ts +2 -2
- package/dist/cjs/api/types/MessageEvent.d.ts +56 -0
- package/dist/cjs/api/types/MessageEvent.js +13 -0
- package/dist/cjs/api/types/ProfileStatusEnum.d.ts +7 -4
- package/dist/cjs/api/types/RcsBase.d.ts +2 -0
- package/dist/cjs/api/types/RcsButtonCall.d.ts +2 -0
- package/dist/cjs/api/types/RcsButtonOpenUrl.d.ts +2 -0
- package/dist/cjs/api/types/RcsButtonRequestUserLocation.d.ts +2 -0
- package/dist/cjs/api/types/RcsButtonScheduleEvent.d.ts +2 -0
- package/dist/cjs/api/types/RcsButtonSendLocation.d.ts +2 -0
- package/dist/cjs/api/types/RcsButtonTrigger.d.ts +2 -2
- package/dist/cjs/api/types/RcsCampaign.d.ts +4 -4
- package/dist/cjs/api/types/RcsCapabilitiesResult.d.ts +8 -0
- package/dist/cjs/api/types/RcsCapabilitiesResult.js +5 -0
- package/dist/cjs/api/types/RcsCapability.d.ts +36 -0
- package/dist/cjs/api/types/RcsCapability.js +5 -0
- package/dist/cjs/api/types/RcsLinkResult.d.ts +13 -0
- package/dist/cjs/api/types/RcsLinkResult.js +5 -0
- package/dist/cjs/api/types/RcsValidateContent.d.ts +1 -0
- package/dist/cjs/api/types/RcsWhitelistResponse.d.ts +10 -0
- package/dist/cjs/api/types/RcsWhitelistResponse.js +5 -0
- package/dist/cjs/api/types/RefreshedFile.d.ts +9 -0
- package/dist/cjs/api/types/RefreshedFile.js +5 -0
- package/dist/cjs/api/types/{Rcs.d.ts → RichMessage.d.ts} +1 -1
- package/dist/cjs/api/types/RichMessage.js +5 -0
- package/dist/cjs/api/types/ShortenedUrl.d.ts +1 -1
- package/dist/cjs/api/types/TollFreeCampaignWithExtendedBrandAndStatus.d.ts +0 -1
- package/dist/cjs/api/types/UploadResults.d.ts +1 -1
- package/dist/cjs/api/types/VCardData.d.ts +1 -1
- package/dist/cjs/api/types/WebhookEventEnum.d.ts +1 -0
- package/dist/cjs/api/types/index.d.ts +9 -3
- package/dist/cjs/api/types/index.js +9 -3
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wrapper/PinnacleClient.d.ts +9 -0
- package/dist/cjs/wrapper/PinnacleClient.js +17 -0
- package/dist/cjs/wrapper/messages/Client.d.ts +13 -0
- package/dist/cjs/wrapper/messages/Client.js +49 -0
- package/dist/cjs/wrapper/tools/Client.d.ts +6 -0
- package/dist/cjs/wrapper/tools/Client.js +12 -0
- package/dist/cjs/wrapper/tools/FileUploader.d.ts +15 -0
- package/dist/cjs/wrapper/tools/FileUploader.js +162 -0
- package/dist/esm/Client.d.mts +5 -2
- package/dist/esm/Client.mjs +8 -3
- package/dist/esm/api/resources/brands/client/Client.d.mts +6 -4
- package/dist/esm/api/resources/brands/client/Client.mjs +15 -9
- package/dist/esm/api/resources/brands/client/requests/BrandsGetRequest.d.mts +1 -1
- package/dist/esm/api/resources/brands/client/requests/UpsertBrandParams.d.mts +3 -3
- package/dist/esm/api/resources/campaigns/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/campaigns/client/Client.mjs +1 -1
- package/dist/esm/api/resources/campaigns/resources/dlc/client/Client.d.mts +9 -9
- package/dist/esm/api/resources/campaigns/resources/dlc/client/Client.mjs +7 -7
- package/dist/esm/api/resources/campaigns/resources/rcs/client/Client.d.mts +5 -3
- package/dist/esm/api/resources/campaigns/resources/rcs/client/Client.mjs +5 -1
- package/dist/esm/api/resources/campaigns/resources/rcs/client/requests/UpsertRcsCampaignParams.d.mts +5 -4
- package/dist/esm/api/resources/campaigns/resources/tollFree/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/campaigns/resources/tollFree/client/Client.mjs +1 -1
- package/dist/esm/api/resources/contacts/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/contacts/client/Client.mjs +7 -7
- package/dist/esm/api/resources/contacts/client/requests/ContactsGetRequest.d.mts +2 -2
- package/dist/esm/api/resources/conversations/client/Client.d.mts +4 -4
- package/dist/esm/api/resources/conversations/client/Client.mjs +2 -5
- package/dist/esm/api/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/index.mjs +2 -0
- package/dist/esm/api/resources/messages/client/Client.d.mts +6 -3
- package/dist/esm/api/resources/messages/client/Client.mjs +10 -1
- package/dist/esm/api/resources/messages/client/requests/ReactMessageParams.d.mts +1 -1
- package/dist/esm/api/resources/messages/resources/mms/client/Client.d.mts +4 -3
- package/dist/esm/api/resources/messages/resources/mms/client/Client.mjs +4 -1
- package/dist/esm/api/resources/messages/resources/rcs/client/Client.d.mts +6 -5
- package/dist/esm/api/resources/messages/resources/rcs/client/Client.mjs +5 -2
- package/dist/esm/api/resources/messages/resources/sms/client/Client.d.mts +4 -3
- package/dist/esm/api/resources/messages/resources/sms/client/Client.mjs +4 -1
- package/dist/esm/api/resources/phoneNumbers/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/phoneNumbers/client/Client.mjs +1 -1
- package/dist/esm/api/resources/phoneNumbers/resources/campaign/client/Client.d.mts +6 -4
- package/dist/esm/api/resources/phoneNumbers/resources/campaign/client/Client.mjs +8 -2
- package/dist/esm/api/resources/phoneNumbers/resources/webhook/client/Client.d.mts +7 -5
- package/dist/esm/api/resources/phoneNumbers/resources/webhook/client/Client.mjs +7 -3
- package/dist/esm/api/resources/rcs/client/Client.d.mts +121 -0
- package/dist/esm/api/resources/rcs/client/Client.mjs +283 -0
- package/dist/esm/api/resources/rcs/client/index.d.mts +2 -0
- package/dist/esm/api/resources/rcs/client/index.mjs +1 -0
- package/dist/esm/api/resources/rcs/client/requests/RcsCapabilitiesQuery.d.mts +13 -0
- package/dist/esm/api/resources/rcs/client/requests/RcsLinkRequest.d.mts +22 -0
- package/dist/esm/api/resources/rcs/client/requests/RcsWhitelistRequest.d.mts +16 -0
- package/dist/esm/api/resources/rcs/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/rcs/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/rcs/index.d.mts +1 -0
- package/dist/esm/api/resources/rcs/index.mjs +1 -0
- package/dist/esm/api/resources/status/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/status/client/Client.mjs +1 -1
- package/dist/esm/api/resources/status/resources/get/client/Client.d.mts +5 -5
- package/dist/esm/api/resources/status/resources/get/client/Client.mjs +3 -3
- package/dist/esm/api/resources/tools/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/tools/client/Client.mjs +1 -1
- package/dist/esm/api/resources/tools/resources/contactCard/client/Client.d.mts +5 -5
- package/dist/esm/api/resources/tools/resources/contactCard/client/Client.mjs +3 -3
- package/dist/esm/api/resources/tools/resources/file/client/Client.d.mts +24 -3
- package/dist/esm/api/resources/tools/resources/file/client/Client.mjs +75 -1
- package/dist/esm/api/resources/tools/resources/file/client/requests/RefreshFileParams.d.mts +21 -0
- package/dist/esm/api/resources/tools/resources/file/client/requests/RefreshFileParams.mjs +4 -0
- package/dist/esm/api/resources/tools/resources/file/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/tools/resources/url/client/Client.d.mts +4 -4
- package/dist/esm/api/resources/tools/resources/url/client/Client.mjs +2 -2
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/webhooks/client/Client.mjs +1 -1
- package/dist/esm/api/types/AdvancedPhoneInformation.d.mts +9 -9
- package/dist/esm/api/types/AttachWebhookParams.d.mts +2 -2
- package/dist/esm/api/types/AutofillDlcCampaignResponse.d.mts +11 -11
- package/dist/esm/api/types/ButtonClicked.d.mts +11 -0
- package/dist/esm/api/types/ButtonClicked.mjs +4 -0
- package/dist/esm/api/types/ButtonClickedData.d.mts +58 -0
- package/dist/esm/api/types/ButtonClickedData.mjs +13 -0
- package/dist/esm/api/types/Conversation.d.mts +3 -3
- package/dist/esm/api/types/ConversationList.d.mts +4 -4
- package/dist/esm/api/types/CreateUrlOptions.d.mts +1 -1
- package/dist/esm/api/types/DlcCampaignStatus.d.mts +2 -2
- package/dist/esm/api/types/DlcCampaignWithExtendedBrandAndStatus.d.mts +13 -10
- package/dist/esm/api/types/EnhancedContactItem.d.mts +1 -1
- package/dist/esm/api/types/ExtendedBrand.d.mts +12 -5
- package/dist/esm/api/types/ExtendedBrandWithVetting.d.mts +2 -2
- package/dist/esm/api/types/ExtendedRcsCampaign.d.mts +13 -12
- package/dist/esm/api/types/Message.d.mts +4 -4
- package/dist/esm/api/types/MessageContent.d.mts +2 -2
- package/dist/esm/api/types/MessageEvent.d.mts +56 -0
- package/dist/esm/api/types/MessageEvent.mjs +10 -0
- package/dist/esm/api/types/ProfileStatusEnum.d.mts +7 -4
- package/dist/esm/api/types/RcsBase.d.mts +2 -0
- package/dist/esm/api/types/RcsButtonCall.d.mts +2 -0
- package/dist/esm/api/types/RcsButtonOpenUrl.d.mts +2 -0
- package/dist/esm/api/types/RcsButtonRequestUserLocation.d.mts +2 -0
- package/dist/esm/api/types/RcsButtonScheduleEvent.d.mts +2 -0
- package/dist/esm/api/types/RcsButtonSendLocation.d.mts +2 -0
- package/dist/esm/api/types/RcsButtonTrigger.d.mts +2 -2
- package/dist/esm/api/types/RcsCampaign.d.mts +4 -4
- package/dist/esm/api/types/RcsCapabilitiesResult.d.mts +8 -0
- package/dist/esm/api/types/RcsCapabilitiesResult.mjs +4 -0
- package/dist/esm/api/types/RcsCapability.d.mts +36 -0
- package/dist/esm/api/types/RcsCapability.mjs +4 -0
- package/dist/esm/api/types/RcsLinkResult.d.mts +13 -0
- package/dist/esm/api/types/RcsLinkResult.mjs +4 -0
- package/dist/esm/api/types/RcsValidateContent.d.mts +1 -0
- package/dist/esm/api/types/RcsWhitelistResponse.d.mts +10 -0
- package/dist/esm/api/types/RcsWhitelistResponse.mjs +4 -0
- package/dist/esm/api/types/RefreshedFile.d.mts +9 -0
- package/dist/esm/api/types/RefreshedFile.mjs +4 -0
- package/dist/esm/api/types/{Rcs.d.mts → RichMessage.d.mts} +1 -1
- package/dist/esm/api/types/RichMessage.mjs +4 -0
- package/dist/esm/api/types/ShortenedUrl.d.mts +1 -1
- package/dist/esm/api/types/TollFreeCampaignWithExtendedBrandAndStatus.d.mts +0 -1
- package/dist/esm/api/types/UploadResults.d.mts +1 -1
- package/dist/esm/api/types/VCardData.d.mts +1 -1
- package/dist/esm/api/types/WebhookEventEnum.d.mts +1 -0
- package/dist/esm/api/types/index.d.mts +9 -3
- package/dist/esm/api/types/index.mjs +9 -3
- package/dist/esm/index.d.mts +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/esm/wrapper/PinnacleClient.d.mts +9 -0
- package/dist/esm/wrapper/PinnacleClient.mjs +13 -0
- package/dist/esm/wrapper/messages/Client.d.mts +13 -0
- package/dist/esm/wrapper/messages/Client.mjs +45 -0
- package/dist/esm/wrapper/tools/Client.d.mts +6 -0
- package/dist/esm/wrapper/tools/Client.mjs +8 -0
- package/dist/esm/wrapper/tools/FileUploader.d.mts +15 -0
- package/dist/esm/wrapper/tools/FileUploader.mjs +125 -0
- package/package.json +6 -2
- package/reference.md +321 -16
- package/dist/cjs/api/types/ClickAction.d.ts +0 -28
- package/dist/cjs/api/types/InboundButton.d.ts +0 -11
- package/dist/esm/api/types/ClickAction.d.mts +0 -28
- package/dist/esm/api/types/InboundButton.d.mts +0 -11
- /package/dist/cjs/api/{types/ClickAction.js → resources/rcs/client/requests/RcsCapabilitiesQuery.js} +0 -0
- /package/dist/cjs/api/{types/InboundButton.js → resources/rcs/client/requests/RcsLinkRequest.js} +0 -0
- /package/dist/cjs/api/{types/Rcs.js → resources/rcs/client/requests/RcsWhitelistRequest.js} +0 -0
- /package/dist/esm/api/{types/ClickAction.mjs → resources/rcs/client/requests/RcsCapabilitiesQuery.mjs} +0 -0
- /package/dist/esm/api/{types/InboundButton.mjs → resources/rcs/client/requests/RcsLinkRequest.mjs} +0 -0
- /package/dist/esm/api/{types/Rcs.mjs → resources/rcs/client/requests/RcsWhitelistRequest.mjs} +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Messages } from "../../api/resources/messages/client/Client.mjs";
|
|
11
|
+
import { UnauthorizedError } from "../../api/errors/index.mjs";
|
|
12
|
+
export class EnhancedMessages extends Messages {
|
|
13
|
+
process(req, secret) {
|
|
14
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
const signingSecret = secret || process.env.PINNACLE_SIGNING_SECRET;
|
|
17
|
+
let headerSecret;
|
|
18
|
+
let body;
|
|
19
|
+
if (req instanceof Request) {
|
|
20
|
+
headerSecret =
|
|
21
|
+
((_a = req.headers) === null || _a === void 0 ? void 0 : _a.get("PINNACLE-SIGNING-SECRET")) || ((_b = req.headers) === null || _b === void 0 ? void 0 : _b.get("pinnacle-signing-secret")) || undefined;
|
|
22
|
+
body = yield req.json();
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
const headers = req.headers;
|
|
26
|
+
headerSecret = headers["pinnacle-signing-secret"];
|
|
27
|
+
body = req.body;
|
|
28
|
+
}
|
|
29
|
+
if (!signingSecret) {
|
|
30
|
+
throw new UnauthorizedError({
|
|
31
|
+
error: "Make sure to set the PINNACLE_SIGNING_SECRET environment variable or pass the secret as an argument to the process method",
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (!headerSecret) {
|
|
35
|
+
throw new UnauthorizedError({
|
|
36
|
+
error: "Failed to get the PINNACLE-SIGNING-SECRET header from request",
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (headerSecret !== signingSecret) {
|
|
40
|
+
throw new UnauthorizedError({ error: "Invalid webhook signature" });
|
|
41
|
+
}
|
|
42
|
+
return body;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Tools } from '../../api/resources/tools/client/Client.mjs';
|
|
2
|
+
import { FileUploader } from './FileUploader.mjs';
|
|
3
|
+
export class EnhancedTools extends Tools {
|
|
4
|
+
get file() {
|
|
5
|
+
var _a;
|
|
6
|
+
return ((_a = this._fileUploader) !== null && _a !== void 0 ? _a : (this._fileUploader = new FileUploader(this._options)));
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { File_ } from "../../api/resources/tools/resources/file/client/Client.mjs";
|
|
2
|
+
import { UploadFileParams } from "../../api/resources/tools/resources/file/client/requests/index.mjs";
|
|
3
|
+
export declare class FileUploader extends File_ {
|
|
4
|
+
/**
|
|
5
|
+
* Upload a file from a file path (Node.js) or File object (browser)
|
|
6
|
+
* @param fileInput - File path string (Node.js) or File object (browser)
|
|
7
|
+
* @param options - Upload options
|
|
8
|
+
* @returns The download URL of the uploaded file
|
|
9
|
+
*/
|
|
10
|
+
uploadFromPath(fileInput: string | File, options?: {
|
|
11
|
+
name?: string;
|
|
12
|
+
options?: UploadFileParams.Options;
|
|
13
|
+
}): Promise<string>;
|
|
14
|
+
private getMimeType;
|
|
15
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import * as mime from "mime-types";
|
|
11
|
+
import { File_ } from "../../api/resources/tools/resources/file/client/Client.mjs";
|
|
12
|
+
import { BadRequestError, NotFoundError, InternalServerError } from "../../api/errors/index.mjs";
|
|
13
|
+
export class FileUploader extends File_ {
|
|
14
|
+
/**
|
|
15
|
+
* Upload a file from a file path (Node.js) or File object (browser)
|
|
16
|
+
* @param fileInput - File path string (Node.js) or File object (browser)
|
|
17
|
+
* @param options - Upload options
|
|
18
|
+
* @returns The download URL of the uploaded file
|
|
19
|
+
*/
|
|
20
|
+
uploadFromPath(fileInput, options) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
let size;
|
|
23
|
+
let fileName;
|
|
24
|
+
let contentType;
|
|
25
|
+
let blob;
|
|
26
|
+
if (typeof window === "undefined") {
|
|
27
|
+
if (typeof fileInput !== "string") {
|
|
28
|
+
throw new BadRequestError({ message: "In Node.js, fileInput must be a file path string" });
|
|
29
|
+
}
|
|
30
|
+
const fs = yield import("fs");
|
|
31
|
+
const path = yield import("path");
|
|
32
|
+
const filePath = fileInput;
|
|
33
|
+
let stats;
|
|
34
|
+
try {
|
|
35
|
+
stats = yield fs.promises.stat(filePath);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
if (error.code === "ENOENT") {
|
|
39
|
+
throw new NotFoundError({ error: `File not found: ${filePath}` });
|
|
40
|
+
}
|
|
41
|
+
throw new InternalServerError({ error: `Failed to access file: ${error.message}` });
|
|
42
|
+
}
|
|
43
|
+
if (stats.isDirectory()) {
|
|
44
|
+
throw new BadRequestError({ message: `Path is a directory, not a file: ${filePath}` });
|
|
45
|
+
}
|
|
46
|
+
size = stats.size;
|
|
47
|
+
fileName = (options === null || options === void 0 ? void 0 : options.name) || path.default.basename(filePath);
|
|
48
|
+
contentType = this.getMimeType(filePath);
|
|
49
|
+
const fileBuffer = yield fs.promises.readFile(filePath);
|
|
50
|
+
const arrayBuffer = new Uint8Array(fileBuffer).buffer;
|
|
51
|
+
blob = new Blob([arrayBuffer], { type: contentType });
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
if (!(fileInput instanceof File)) {
|
|
55
|
+
throw new BadRequestError({ message: "In browser, fileInput must be a File object" });
|
|
56
|
+
}
|
|
57
|
+
const file = fileInput;
|
|
58
|
+
size = file.size;
|
|
59
|
+
fileName = (options === null || options === void 0 ? void 0 : options.name) || file.name;
|
|
60
|
+
contentType = file.type || this.getMimeType(file.name);
|
|
61
|
+
blob = file;
|
|
62
|
+
}
|
|
63
|
+
const uploadParams = {
|
|
64
|
+
contentType,
|
|
65
|
+
size,
|
|
66
|
+
name: fileName,
|
|
67
|
+
options: options === null || options === void 0 ? void 0 : options.options,
|
|
68
|
+
};
|
|
69
|
+
const uploadResult = yield this.upload(uploadParams);
|
|
70
|
+
if (uploadResult.uploadUrl) {
|
|
71
|
+
yield fetch(uploadResult.uploadUrl, {
|
|
72
|
+
method: "PUT",
|
|
73
|
+
body: blob,
|
|
74
|
+
headers: {
|
|
75
|
+
"Content-Type": contentType,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return uploadResult.downloadUrl;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
getMimeType(filePath) {
|
|
83
|
+
const mimeType = mime.lookup(filePath);
|
|
84
|
+
if (!mimeType) {
|
|
85
|
+
return "application/octet-stream";
|
|
86
|
+
}
|
|
87
|
+
const supportedTypes = new Set([
|
|
88
|
+
"audio/mpeg",
|
|
89
|
+
"audio/mp4",
|
|
90
|
+
"audio/ogg",
|
|
91
|
+
"audio/aac",
|
|
92
|
+
"audio/webm",
|
|
93
|
+
"audio/wav",
|
|
94
|
+
"audio/3gpp",
|
|
95
|
+
"audio/amr",
|
|
96
|
+
"video/mp4",
|
|
97
|
+
"video/mpeg",
|
|
98
|
+
"video/quicktime",
|
|
99
|
+
"video/webm",
|
|
100
|
+
"video/3gpp",
|
|
101
|
+
"video/H264",
|
|
102
|
+
"video/x-m4v",
|
|
103
|
+
"image/jpeg",
|
|
104
|
+
"image/png",
|
|
105
|
+
"image/gif",
|
|
106
|
+
"image/bmp",
|
|
107
|
+
"image/tiff",
|
|
108
|
+
"image/webp",
|
|
109
|
+
"application/pdf",
|
|
110
|
+
"text/csv",
|
|
111
|
+
"application/rtf",
|
|
112
|
+
"text/vcard",
|
|
113
|
+
"text/calendar",
|
|
114
|
+
]);
|
|
115
|
+
if (supportedTypes.has(mimeType)) {
|
|
116
|
+
return mimeType;
|
|
117
|
+
}
|
|
118
|
+
const baseType = mimeType.split("/")[0];
|
|
119
|
+
if (["audio", "video", "image"].includes(baseType)) {
|
|
120
|
+
console.warn(`MIME type ${mimeType} may not be fully supported. Proceeding anyway.`);
|
|
121
|
+
return mimeType;
|
|
122
|
+
}
|
|
123
|
+
return "application/octet-stream";
|
|
124
|
+
}
|
|
125
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rcs-js",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": "github:pinnacle-dev/rcs-js",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -38,6 +38,9 @@
|
|
|
38
38
|
"test:browser": "jest --selectProjects browser",
|
|
39
39
|
"test:wire": "jest --selectProjects wire"
|
|
40
40
|
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"mime-types": "^3.0.1"
|
|
43
|
+
},
|
|
41
44
|
"devDependencies": {
|
|
42
45
|
"webpack": "^5.97.1",
|
|
43
46
|
"ts-loader": "^9.5.1",
|
|
@@ -49,7 +52,8 @@
|
|
|
49
52
|
"msw": "^2.8.4",
|
|
50
53
|
"@types/node": "^18.19.70",
|
|
51
54
|
"prettier": "^3.4.2",
|
|
52
|
-
"typescript": "~5.7.2"
|
|
55
|
+
"typescript": "~5.7.2",
|
|
56
|
+
"@types/mime-types": "^3.0.1"
|
|
53
57
|
},
|
|
54
58
|
"browser": {
|
|
55
59
|
"fs": false,
|
package/reference.md
CHANGED
|
@@ -645,7 +645,7 @@ await client.contacts.update({
|
|
|
645
645
|
|
|
646
646
|
## Conversations
|
|
647
647
|
|
|
648
|
-
<details><summary><code>client.conversations.<a href="/src/api/resources/conversations/client/Client.ts">get</a>({ ...params }) ->
|
|
648
|
+
<details><summary><code>client.conversations.<a href="/src/api/resources/conversations/client/Client.ts">get</a>({ ...params }) -> Pinnacle.Conversation | null</code></summary>
|
|
649
649
|
<dl>
|
|
650
650
|
<dd>
|
|
651
651
|
|
|
@@ -1199,6 +1199,235 @@ await client.phoneNumbers.get({
|
|
|
1199
1199
|
</dl>
|
|
1200
1200
|
</details>
|
|
1201
1201
|
|
|
1202
|
+
## RCS
|
|
1203
|
+
|
|
1204
|
+
<details><summary><code>client.rcs.<a href="/src/api/resources/rcs/client/Client.ts">getCapabilities</a>({ ...params }) -> Pinnacle.RcsCapabilitiesResult</code></summary>
|
|
1205
|
+
<dl>
|
|
1206
|
+
<dd>
|
|
1207
|
+
|
|
1208
|
+
#### 📝 Description
|
|
1209
|
+
|
|
1210
|
+
<dl>
|
|
1211
|
+
<dd>
|
|
1212
|
+
|
|
1213
|
+
<dl>
|
|
1214
|
+
<dd>
|
|
1215
|
+
|
|
1216
|
+
Check RCS capabilities for one or more phone numbers.
|
|
1217
|
+
|
|
1218
|
+
This endpoint allows you to verify which RCS features (cards, buttons, etc.) are supported
|
|
1219
|
+
on specific phone numbers before sending RCS messages to them.
|
|
1220
|
+
|
|
1221
|
+
</dd>
|
|
1222
|
+
</dl>
|
|
1223
|
+
</dd>
|
|
1224
|
+
</dl>
|
|
1225
|
+
|
|
1226
|
+
#### 🔌 Usage
|
|
1227
|
+
|
|
1228
|
+
<dl>
|
|
1229
|
+
<dd>
|
|
1230
|
+
|
|
1231
|
+
<dl>
|
|
1232
|
+
<dd>
|
|
1233
|
+
|
|
1234
|
+
```typescript
|
|
1235
|
+
await client.rcs.getCapabilities({
|
|
1236
|
+
phoneNumbers: ["+12345678901", "+19876543210"],
|
|
1237
|
+
});
|
|
1238
|
+
```
|
|
1239
|
+
|
|
1240
|
+
</dd>
|
|
1241
|
+
</dl>
|
|
1242
|
+
</dd>
|
|
1243
|
+
</dl>
|
|
1244
|
+
|
|
1245
|
+
#### ⚙️ Parameters
|
|
1246
|
+
|
|
1247
|
+
<dl>
|
|
1248
|
+
<dd>
|
|
1249
|
+
|
|
1250
|
+
<dl>
|
|
1251
|
+
<dd>
|
|
1252
|
+
|
|
1253
|
+
**request:** `Pinnacle.RcsCapabilitiesQuery`
|
|
1254
|
+
|
|
1255
|
+
</dd>
|
|
1256
|
+
</dl>
|
|
1257
|
+
|
|
1258
|
+
<dl>
|
|
1259
|
+
<dd>
|
|
1260
|
+
|
|
1261
|
+
**requestOptions:** `Rcs.RequestOptions`
|
|
1262
|
+
|
|
1263
|
+
</dd>
|
|
1264
|
+
</dl>
|
|
1265
|
+
</dd>
|
|
1266
|
+
</dl>
|
|
1267
|
+
|
|
1268
|
+
</dd>
|
|
1269
|
+
</dl>
|
|
1270
|
+
</details>
|
|
1271
|
+
|
|
1272
|
+
<details><summary><code>client.rcs.<a href="/src/api/resources/rcs/client/Client.ts">whitelist</a>({ ...params }) -> Pinnacle.RcsWhitelistResponse</code></summary>
|
|
1273
|
+
<dl>
|
|
1274
|
+
<dd>
|
|
1275
|
+
|
|
1276
|
+
#### 📝 Description
|
|
1277
|
+
|
|
1278
|
+
<dl>
|
|
1279
|
+
<dd>
|
|
1280
|
+
|
|
1281
|
+
<dl>
|
|
1282
|
+
<dd>
|
|
1283
|
+
|
|
1284
|
+
Whitelist a phone number for testing with your test RCS agent.
|
|
1285
|
+
|
|
1286
|
+
## Overview
|
|
1287
|
+
|
|
1288
|
+
During development and testing, RCS agents can only send messages to whitelisted phone numbers.
|
|
1289
|
+
Use this endpoint to add test devices to your agent's whitelist before sending test messages.
|
|
1290
|
+
|
|
1291
|
+
## Verification Process
|
|
1292
|
+
|
|
1293
|
+
After whitelisting a number, you'll need to complete verification:
|
|
1294
|
+
|
|
1295
|
+
1. Check the test device for an "RBM Tester Management" request
|
|
1296
|
+
2. Accept the request on the device
|
|
1297
|
+
3. Enter the 4-digit verification code in the Pinnacle dashboard at:
|
|
1298
|
+
```
|
|
1299
|
+
https://app.pinnacle.sh/dashboard/brands/{brandId}?campaignId={campaignId}&campaignType=RCS
|
|
1300
|
+
```
|
|
1301
|
+
|
|
1302
|
+
> **Important Notes**
|
|
1303
|
+
>
|
|
1304
|
+
> - **Testing only:** This is only required for test agents. Production agents can message any RCS-enabled number
|
|
1305
|
+
> - **AT&T limitation:** Whitelisting may currently fail for AT&T numbers
|
|
1306
|
+
> - **Verification required:** The whitelist request isn't complete until you verify the device.
|
|
1307
|
+
|
|
1308
|
+
</dd>
|
|
1309
|
+
</dl>
|
|
1310
|
+
</dd>
|
|
1311
|
+
</dl>
|
|
1312
|
+
|
|
1313
|
+
#### 🔌 Usage
|
|
1314
|
+
|
|
1315
|
+
<dl>
|
|
1316
|
+
<dd>
|
|
1317
|
+
|
|
1318
|
+
<dl>
|
|
1319
|
+
<dd>
|
|
1320
|
+
|
|
1321
|
+
```typescript
|
|
1322
|
+
await client.rcs.whitelist({
|
|
1323
|
+
agentId: "agent_XXXXXXXXXXXX",
|
|
1324
|
+
phoneNumber: "+12345678901",
|
|
1325
|
+
});
|
|
1326
|
+
```
|
|
1327
|
+
|
|
1328
|
+
</dd>
|
|
1329
|
+
</dl>
|
|
1330
|
+
</dd>
|
|
1331
|
+
</dl>
|
|
1332
|
+
|
|
1333
|
+
#### ⚙️ Parameters
|
|
1334
|
+
|
|
1335
|
+
<dl>
|
|
1336
|
+
<dd>
|
|
1337
|
+
|
|
1338
|
+
<dl>
|
|
1339
|
+
<dd>
|
|
1340
|
+
|
|
1341
|
+
**request:** `Pinnacle.RcsWhitelistRequest`
|
|
1342
|
+
|
|
1343
|
+
</dd>
|
|
1344
|
+
</dl>
|
|
1345
|
+
|
|
1346
|
+
<dl>
|
|
1347
|
+
<dd>
|
|
1348
|
+
|
|
1349
|
+
**requestOptions:** `Rcs.RequestOptions`
|
|
1350
|
+
|
|
1351
|
+
</dd>
|
|
1352
|
+
</dl>
|
|
1353
|
+
</dd>
|
|
1354
|
+
</dl>
|
|
1355
|
+
|
|
1356
|
+
</dd>
|
|
1357
|
+
</dl>
|
|
1358
|
+
</details>
|
|
1359
|
+
|
|
1360
|
+
<details><summary><code>client.rcs.<a href="/src/api/resources/rcs/client/Client.ts">getLink</a>({ ...params }) -> Pinnacle.RcsLinkResult</code></summary>
|
|
1361
|
+
<dl>
|
|
1362
|
+
<dd>
|
|
1363
|
+
|
|
1364
|
+
#### 📝 Description
|
|
1365
|
+
|
|
1366
|
+
<dl>
|
|
1367
|
+
<dd>
|
|
1368
|
+
|
|
1369
|
+
<dl>
|
|
1370
|
+
<dd>
|
|
1371
|
+
|
|
1372
|
+
Generate a link for initiating an RCS conversation with your agent.
|
|
1373
|
+
|
|
1374
|
+
Users can click these links to start conversations with your RCS agent directly
|
|
1375
|
+
from websites, emails, or other applications.
|
|
1376
|
+
|
|
1377
|
+
</dd>
|
|
1378
|
+
</dl>
|
|
1379
|
+
</dd>
|
|
1380
|
+
</dl>
|
|
1381
|
+
|
|
1382
|
+
#### 🔌 Usage
|
|
1383
|
+
|
|
1384
|
+
<dl>
|
|
1385
|
+
<dd>
|
|
1386
|
+
|
|
1387
|
+
<dl>
|
|
1388
|
+
<dd>
|
|
1389
|
+
|
|
1390
|
+
```typescript
|
|
1391
|
+
await client.rcs.getLink({
|
|
1392
|
+
agentId: "agent_XXXXXXXXXXXX",
|
|
1393
|
+
testMode: false,
|
|
1394
|
+
phoneNumber: "+12345678901",
|
|
1395
|
+
body: "Hello, I need help with my order",
|
|
1396
|
+
});
|
|
1397
|
+
```
|
|
1398
|
+
|
|
1399
|
+
</dd>
|
|
1400
|
+
</dl>
|
|
1401
|
+
</dd>
|
|
1402
|
+
</dl>
|
|
1403
|
+
|
|
1404
|
+
#### ⚙️ Parameters
|
|
1405
|
+
|
|
1406
|
+
<dl>
|
|
1407
|
+
<dd>
|
|
1408
|
+
|
|
1409
|
+
<dl>
|
|
1410
|
+
<dd>
|
|
1411
|
+
|
|
1412
|
+
**request:** `Pinnacle.RcsLinkRequest`
|
|
1413
|
+
|
|
1414
|
+
</dd>
|
|
1415
|
+
</dl>
|
|
1416
|
+
|
|
1417
|
+
<dl>
|
|
1418
|
+
<dd>
|
|
1419
|
+
|
|
1420
|
+
**requestOptions:** `Rcs.RequestOptions`
|
|
1421
|
+
|
|
1422
|
+
</dd>
|
|
1423
|
+
</dl>
|
|
1424
|
+
</dd>
|
|
1425
|
+
</dl>
|
|
1426
|
+
|
|
1427
|
+
</dd>
|
|
1428
|
+
</dl>
|
|
1429
|
+
</details>
|
|
1430
|
+
|
|
1202
1431
|
## Webhooks
|
|
1203
1432
|
|
|
1204
1433
|
<details><summary><code>client.webhooks.<a href="/src/api/resources/webhooks/client/Client.ts">get</a>({ ...params }) -> Pinnacle.WebhookResult</code></summary>
|
|
@@ -1351,7 +1580,7 @@ await client.campaigns.dlc.autofill({
|
|
|
1351
1580
|
<dl>
|
|
1352
1581
|
<dd>
|
|
1353
1582
|
|
|
1354
|
-
Retrieve
|
|
1583
|
+
Retrieve 10DLC campaign.
|
|
1355
1584
|
|
|
1356
1585
|
</dd>
|
|
1357
1586
|
</dl>
|
|
@@ -1383,7 +1612,7 @@ await client.campaigns.dlc.get(28);
|
|
|
1383
1612
|
<dl>
|
|
1384
1613
|
<dd>
|
|
1385
1614
|
|
|
1386
|
-
**campaignId:** `number` — Unique identifier of the
|
|
1615
|
+
**campaignId:** `number` — Unique identifier of the 10DLC campaign.
|
|
1387
1616
|
|
|
1388
1617
|
</dd>
|
|
1389
1618
|
</dl>
|
|
@@ -1414,7 +1643,7 @@ await client.campaigns.dlc.get(28);
|
|
|
1414
1643
|
<dl>
|
|
1415
1644
|
<dd>
|
|
1416
1645
|
|
|
1417
|
-
Submit your
|
|
1646
|
+
Submit your 10DLC campaign for approval and activation with carriers.
|
|
1418
1647
|
|
|
1419
1648
|
</dd>
|
|
1420
1649
|
</dl>
|
|
@@ -1446,7 +1675,7 @@ await client.campaigns.dlc.submit(161);
|
|
|
1446
1675
|
<dl>
|
|
1447
1676
|
<dd>
|
|
1448
1677
|
|
|
1449
|
-
**campaignId:** `number` — Unique identifier of the
|
|
1678
|
+
**campaignId:** `number` — Unique identifier of the 10DLC campaign to submit.
|
|
1450
1679
|
|
|
1451
1680
|
</dd>
|
|
1452
1681
|
</dl>
|
|
@@ -1477,7 +1706,7 @@ await client.campaigns.dlc.submit(161);
|
|
|
1477
1706
|
<dl>
|
|
1478
1707
|
<dd>
|
|
1479
1708
|
|
|
1480
|
-
Create a new
|
|
1709
|
+
Create a new 10DLC campaign or updates an existing one. <br>
|
|
1481
1710
|
|
|
1482
1711
|
Omit campaignId to create a campaign.
|
|
1483
1712
|
|
|
@@ -1579,7 +1808,7 @@ await client.campaigns.dlc.upsert({
|
|
|
1579
1808
|
<dl>
|
|
1580
1809
|
<dd>
|
|
1581
1810
|
|
|
1582
|
-
Validate your
|
|
1811
|
+
Validate your 10DLC campaign configuration against carrier requirements and compliance rules.
|
|
1583
1812
|
|
|
1584
1813
|
</dd>
|
|
1585
1814
|
</dl>
|
|
@@ -2224,6 +2453,7 @@ await client.campaigns.rcs.upsert({
|
|
|
2224
2453
|
},
|
|
2225
2454
|
],
|
|
2226
2455
|
},
|
|
2456
|
+
brandVerificationUrl: "https://www.pinnacle.sh/articles-of-incorporation.pdf",
|
|
2227
2457
|
brand: 2,
|
|
2228
2458
|
expectedAgentResponses: [
|
|
2229
2459
|
"Here are the things I can help you with.",
|
|
@@ -2685,7 +2915,7 @@ await client.messages.rcs.send({
|
|
|
2685
2915
|
<dl>
|
|
2686
2916
|
<dd>
|
|
2687
2917
|
|
|
2688
|
-
**request:** `Pinnacle.
|
|
2918
|
+
**request:** `Pinnacle.RichMessage`
|
|
2689
2919
|
|
|
2690
2920
|
</dd>
|
|
2691
2921
|
</dl>
|
|
@@ -2807,7 +3037,8 @@ Connect a webhook to your phone number to receive real-time notifications for in
|
|
|
2807
3037
|
|
|
2808
3038
|
```typescript
|
|
2809
3039
|
await client.phoneNumbers.webhook.attach("%2B14155551234", {
|
|
2810
|
-
webhookId:
|
|
3040
|
+
webhookId: 123,
|
|
3041
|
+
event: "MESSAGE.STATUS",
|
|
2811
3042
|
});
|
|
2812
3043
|
```
|
|
2813
3044
|
|
|
@@ -2828,7 +3059,7 @@ await client.phoneNumbers.webhook.attach("%2B14155551234", {
|
|
|
2828
3059
|
|
|
2829
3060
|
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>
|
|
2830
3061
|
|
|
2831
|
-
Must be a phone number that you own and have already [purchased](./buy) through the API.
|
|
3062
|
+
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.
|
|
2832
3063
|
|
|
2833
3064
|
</dd>
|
|
2834
3065
|
</dl>
|
|
@@ -2950,7 +3181,7 @@ This must be a valid webhook ID that is currently attached to the specified phon
|
|
|
2950
3181
|
<dl>
|
|
2951
3182
|
<dd>
|
|
2952
3183
|
|
|
2953
|
-
Link a phone number to a specific campaign.
|
|
3184
|
+
Link a phone number to a specific campaign. Phone numbers must be linked to a campaign to send messages.
|
|
2954
3185
|
|
|
2955
3186
|
</dd>
|
|
2956
3187
|
</dl>
|
|
@@ -3210,7 +3441,7 @@ await client.status.get.tollFree(28);
|
|
|
3210
3441
|
<dl>
|
|
3211
3442
|
<dd>
|
|
3212
3443
|
|
|
3213
|
-
Retrieve a
|
|
3444
|
+
Retrieve a 10DLC campaign's status.
|
|
3214
3445
|
|
|
3215
3446
|
</dd>
|
|
3216
3447
|
</dl>
|
|
@@ -3242,7 +3473,7 @@ await client.status.get.dlc(28);
|
|
|
3242
3473
|
<dl>
|
|
3243
3474
|
<dd>
|
|
3244
3475
|
|
|
3245
|
-
**campaignId:** `number` — ID of the
|
|
3476
|
+
**campaignId:** `number` — ID of the 10DLC campaign.
|
|
3246
3477
|
|
|
3247
3478
|
</dd>
|
|
3248
3479
|
</dl>
|
|
@@ -3538,7 +3769,7 @@ See the response of [Create Shortened URL](./create-url) for more information.
|
|
|
3538
3769
|
<dl>
|
|
3539
3770
|
<dd>
|
|
3540
3771
|
|
|
3541
|
-
Update the destination or
|
|
3772
|
+
Update the destination or expiration date of an existing shortened URL. Expiring links cannot be updated into a permalink.
|
|
3542
3773
|
|
|
3543
3774
|
</dd>
|
|
3544
3775
|
</dl>
|
|
@@ -3677,6 +3908,80 @@ await client.tools.file.upload({
|
|
|
3677
3908
|
</dl>
|
|
3678
3909
|
</details>
|
|
3679
3910
|
|
|
3911
|
+
<details><summary><code>client.tools.file.<a href="/src/api/resources/tools/resources/file/client/Client.ts">refresh</a>({ ...params }) -> Pinnacle.RefreshedFile[]</code></summary>
|
|
3912
|
+
<dl>
|
|
3913
|
+
<dd>
|
|
3914
|
+
|
|
3915
|
+
#### 📝 Description
|
|
3916
|
+
|
|
3917
|
+
<dl>
|
|
3918
|
+
<dd>
|
|
3919
|
+
|
|
3920
|
+
<dl>
|
|
3921
|
+
<dd>
|
|
3922
|
+
|
|
3923
|
+
Refresh expiring presigned URLs for Pinnacle-hosted files to extend their access time.
|
|
3924
|
+
|
|
3925
|
+
<Callout type="info">
|
|
3926
|
+
This only works for presigned download URLs. At this moment, you cannot refresh a presigned upload URL, generate a new one instead.
|
|
3927
|
+
</Callout>
|
|
3928
|
+
</dd>
|
|
3929
|
+
</dl>
|
|
3930
|
+
</dd>
|
|
3931
|
+
</dl>
|
|
3932
|
+
|
|
3933
|
+
#### 🔌 Usage
|
|
3934
|
+
|
|
3935
|
+
<dl>
|
|
3936
|
+
<dd>
|
|
3937
|
+
|
|
3938
|
+
<dl>
|
|
3939
|
+
<dd>
|
|
3940
|
+
|
|
3941
|
+
```typescript
|
|
3942
|
+
await client.tools.file.refresh({
|
|
3943
|
+
uris: [
|
|
3944
|
+
"https://server.trypinnacle.app/storage/v1/object/sign/vault/3/test.jpg?token=oldtoken",
|
|
3945
|
+
"https://server.trypinnacle.app/storage/v1/object/sign/vault/3/document.pdf?token=oldtoken2",
|
|
3946
|
+
"icons/3/test.jpg",
|
|
3947
|
+
"invalid/url",
|
|
3948
|
+
"https://google.com",
|
|
3949
|
+
],
|
|
3950
|
+
});
|
|
3951
|
+
```
|
|
3952
|
+
|
|
3953
|
+
</dd>
|
|
3954
|
+
</dl>
|
|
3955
|
+
</dd>
|
|
3956
|
+
</dl>
|
|
3957
|
+
|
|
3958
|
+
#### ⚙️ Parameters
|
|
3959
|
+
|
|
3960
|
+
<dl>
|
|
3961
|
+
<dd>
|
|
3962
|
+
|
|
3963
|
+
<dl>
|
|
3964
|
+
<dd>
|
|
3965
|
+
|
|
3966
|
+
**request:** `Pinnacle.tools.RefreshFileParams`
|
|
3967
|
+
|
|
3968
|
+
</dd>
|
|
3969
|
+
</dl>
|
|
3970
|
+
|
|
3971
|
+
<dl>
|
|
3972
|
+
<dd>
|
|
3973
|
+
|
|
3974
|
+
**requestOptions:** `File_.RequestOptions`
|
|
3975
|
+
|
|
3976
|
+
</dd>
|
|
3977
|
+
</dl>
|
|
3978
|
+
</dd>
|
|
3979
|
+
</dl>
|
|
3980
|
+
|
|
3981
|
+
</dd>
|
|
3982
|
+
</dl>
|
|
3983
|
+
</details>
|
|
3984
|
+
|
|
3680
3985
|
## Tools ContactCard
|
|
3681
3986
|
|
|
3682
3987
|
<details><summary><code>client.tools.contactCard.<a href="/src/api/resources/tools/resources/contactCard/client/Client.ts">get</a>({ ...params }) -> Pinnacle.VCardData</code></summary>
|
|
@@ -3691,7 +3996,7 @@ await client.tools.file.upload({
|
|
|
3691
3996
|
<dl>
|
|
3692
3997
|
<dd>
|
|
3693
3998
|
|
|
3694
|
-
Retrieve contact information as a vCard and get a presigned URL to download the file.
|
|
3999
|
+
Retrieve contact information as a vCard and get a presigned URL to download the file. Contact cards can be sent [via MMS](/api-reference/messages/send-mms) as a media file.
|
|
3695
4000
|
|
|
3696
4001
|
</dd>
|
|
3697
4002
|
</dl>
|
|
@@ -3756,7 +4061,7 @@ await client.tools.contactCard.get({
|
|
|
3756
4061
|
<dl>
|
|
3757
4062
|
<dd>
|
|
3758
4063
|
|
|
3759
|
-
Create a new contact card or updates an existing one with full vCard data.
|
|
4064
|
+
Create a new contact card or updates an existing one with full vCard data. Contact cards can be sent [via MMS](/api-reference/messages/send-mms) as a media file.
|
|
3760
4065
|
|
|
3761
4066
|
</dd>
|
|
3762
4067
|
</dl>
|