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
|
@@ -75,9 +75,9 @@ __exportStar(require("./RcsMediaDetailsContent.js"), exports);
|
|
|
75
75
|
__exportStar(require("./RcsMediaContent.js"), exports);
|
|
76
76
|
__exportStar(require("./RcsCardsContent.js"), exports);
|
|
77
77
|
__exportStar(require("./RcsContent.js"), exports);
|
|
78
|
-
__exportStar(require("./
|
|
78
|
+
__exportStar(require("./ButtonClickedData.js"), exports);
|
|
79
79
|
__exportStar(require("./LocationShareAction.js"), exports);
|
|
80
|
-
__exportStar(require("./
|
|
80
|
+
__exportStar(require("./ButtonClicked.js"), exports);
|
|
81
81
|
__exportStar(require("./MessageContent.js"), exports);
|
|
82
82
|
__exportStar(require("./MessageMethodEnum.js"), exports);
|
|
83
83
|
__exportStar(require("./MessageStatusEnum.js"), exports);
|
|
@@ -94,7 +94,7 @@ __exportStar(require("./RichTextMessage.js"), exports);
|
|
|
94
94
|
__exportStar(require("./RichMediaMessage.js"), exports);
|
|
95
95
|
__exportStar(require("./RcsCards.js"), exports);
|
|
96
96
|
__exportStar(require("./RichCardsMessage.js"), exports);
|
|
97
|
-
__exportStar(require("./
|
|
97
|
+
__exportStar(require("./RichMessage.js"), exports);
|
|
98
98
|
__exportStar(require("./SentRcsDetails.js"), exports);
|
|
99
99
|
__exportStar(require("./SmsValidationResult.js"), exports);
|
|
100
100
|
__exportStar(require("./MmsValidationResult.js"), exports);
|
|
@@ -118,6 +118,10 @@ __exportStar(require("./DetachedWebhookInfo.js"), exports);
|
|
|
118
118
|
__exportStar(require("./MessagingProfileEnum.js"), exports);
|
|
119
119
|
__exportStar(require("./AttachedPhoneNumberResult.js"), exports);
|
|
120
120
|
__exportStar(require("./DetachedPhoneNumberResult.js"), exports);
|
|
121
|
+
__exportStar(require("./RcsCapability.js"), exports);
|
|
122
|
+
__exportStar(require("./RcsCapabilitiesResult.js"), exports);
|
|
123
|
+
__exportStar(require("./RcsWhitelistResponse.js"), exports);
|
|
124
|
+
__exportStar(require("./RcsLinkResult.js"), exports);
|
|
121
125
|
__exportStar(require("./BrandStatus.js"), exports);
|
|
122
126
|
__exportStar(require("./TollFreeStatusEnum.js"), exports);
|
|
123
127
|
__exportStar(require("./TollFreeCampaignStatus.js"), exports);
|
|
@@ -131,6 +135,7 @@ __exportStar(require("./ShortenedUrl.js"), exports);
|
|
|
131
135
|
__exportStar(require("./LinkClickEvent.js"), exports);
|
|
132
136
|
__exportStar(require("./ShortenedUrlWithClickData.js"), exports);
|
|
133
137
|
__exportStar(require("./UploadResults.js"), exports);
|
|
138
|
+
__exportStar(require("./RefreshedFile.js"), exports);
|
|
134
139
|
__exportStar(require("./VcardAddress.js"), exports);
|
|
135
140
|
__exportStar(require("./VcardPhone.js"), exports);
|
|
136
141
|
__exportStar(require("./VcardEmail.js"), exports);
|
|
@@ -140,3 +145,4 @@ __exportStar(require("./VCardData.js"), exports);
|
|
|
140
145
|
__exportStar(require("./VcardResource.js"), exports);
|
|
141
146
|
__exportStar(require("./Webhooks.js"), exports);
|
|
142
147
|
__exportStar(require("./WebhookResult.js"), exports);
|
|
148
|
+
__exportStar(require("./MessageEvent.js"), exports);
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * as Pinnacle from "./api/index.js";
|
|
2
|
-
export { PinnacleClient } from "./
|
|
2
|
+
export { PinnacleClient } from "./wrapper/PinnacleClient.js";
|
|
3
3
|
export { PinnacleEnvironment } from "./environments.js";
|
|
4
4
|
export { PinnacleError, PinnacleTimeoutError } from "./errors/index.js";
|
package/dist/cjs/index.js
CHANGED
|
@@ -35,8 +35,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.PinnacleTimeoutError = exports.PinnacleError = exports.PinnacleEnvironment = exports.PinnacleClient = exports.Pinnacle = void 0;
|
|
37
37
|
exports.Pinnacle = __importStar(require("./api/index.js"));
|
|
38
|
-
var
|
|
39
|
-
Object.defineProperty(exports, "PinnacleClient", { enumerable: true, get: function () { return
|
|
38
|
+
var PinnacleClient_js_1 = require("./wrapper/PinnacleClient.js");
|
|
39
|
+
Object.defineProperty(exports, "PinnacleClient", { enumerable: true, get: function () { return PinnacleClient_js_1.PinnacleClient; } });
|
|
40
40
|
var environments_js_1 = require("./environments.js");
|
|
41
41
|
Object.defineProperty(exports, "PinnacleEnvironment", { enumerable: true, get: function () { return environments_js_1.PinnacleEnvironment; } });
|
|
42
42
|
var index_js_1 = require("./errors/index.js");
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.0
|
|
1
|
+
export declare const SDK_VERSION = "2.0.0";
|
package/dist/cjs/version.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PinnacleClient as FernClient } from "../Client.js";
|
|
2
|
+
import { EnhancedTools } from "./tools/Client.js";
|
|
3
|
+
import { EnhancedMessages } from "./messages/Client.js";
|
|
4
|
+
export declare class PinnacleClient extends FernClient {
|
|
5
|
+
protected _tools: EnhancedTools | undefined;
|
|
6
|
+
protected _messages: EnhancedMessages | undefined;
|
|
7
|
+
get tools(): EnhancedTools;
|
|
8
|
+
get messages(): EnhancedMessages;
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PinnacleClient = void 0;
|
|
4
|
+
const Client_js_1 = require("../Client.js");
|
|
5
|
+
const Client_js_2 = require("./tools/Client.js");
|
|
6
|
+
const Client_js_3 = require("./messages/Client.js");
|
|
7
|
+
class PinnacleClient extends Client_js_1.PinnacleClient {
|
|
8
|
+
get tools() {
|
|
9
|
+
var _a;
|
|
10
|
+
return ((_a = this._tools) !== null && _a !== void 0 ? _a : (this._tools = new Client_js_2.EnhancedTools(this._options)));
|
|
11
|
+
}
|
|
12
|
+
get messages() {
|
|
13
|
+
var _a;
|
|
14
|
+
return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_js_3.EnhancedMessages(this._options)));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.PinnacleClient = PinnacleClient;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Messages } from "../../api/resources/messages/client/Client.js";
|
|
2
|
+
import * as Pinnacle from "../../api/index.js";
|
|
3
|
+
interface ExpressLikeRequest {
|
|
4
|
+
headers: Record<string, string | string[] | undefined>;
|
|
5
|
+
body?: any;
|
|
6
|
+
get?: (name: string) => string | undefined;
|
|
7
|
+
protocol?: string;
|
|
8
|
+
originalUrl?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class EnhancedMessages extends Messages {
|
|
11
|
+
process(req: Request | ExpressLikeRequest, secret?: string): Promise<Pinnacle.MessageEvent>;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EnhancedMessages = void 0;
|
|
13
|
+
const Client_js_1 = require("../../api/resources/messages/client/Client.js");
|
|
14
|
+
const index_js_1 = require("../../api/errors/index.js");
|
|
15
|
+
class EnhancedMessages extends Client_js_1.Messages {
|
|
16
|
+
process(req, secret) {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
const signingSecret = secret || process.env.PINNACLE_SIGNING_SECRET;
|
|
20
|
+
let headerSecret;
|
|
21
|
+
let body;
|
|
22
|
+
if (req instanceof Request) {
|
|
23
|
+
headerSecret =
|
|
24
|
+
((_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;
|
|
25
|
+
body = yield req.json();
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
const headers = req.headers;
|
|
29
|
+
headerSecret = headers["pinnacle-signing-secret"];
|
|
30
|
+
body = req.body;
|
|
31
|
+
}
|
|
32
|
+
if (!signingSecret) {
|
|
33
|
+
throw new index_js_1.UnauthorizedError({
|
|
34
|
+
error: "Make sure to set the PINNACLE_SIGNING_SECRET environment variable or pass the secret as an argument to the process method",
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
if (!headerSecret) {
|
|
38
|
+
throw new index_js_1.UnauthorizedError({
|
|
39
|
+
error: "Failed to get the PINNACLE-SIGNING-SECRET header from request",
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
if (headerSecret !== signingSecret) {
|
|
43
|
+
throw new index_js_1.UnauthorizedError({ error: "Invalid webhook signature" });
|
|
44
|
+
}
|
|
45
|
+
return body;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.EnhancedMessages = EnhancedMessages;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnhancedTools = void 0;
|
|
4
|
+
const Client_js_1 = require("../../api/resources/tools/client/Client.js");
|
|
5
|
+
const FileUploader_js_1 = require("./FileUploader.js");
|
|
6
|
+
class EnhancedTools extends Client_js_1.Tools {
|
|
7
|
+
get file() {
|
|
8
|
+
var _a;
|
|
9
|
+
return ((_a = this._fileUploader) !== null && _a !== void 0 ? _a : (this._fileUploader = new FileUploader_js_1.FileUploader(this._options)));
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.EnhancedTools = EnhancedTools;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { File_ } from "../../api/resources/tools/resources/file/client/Client.js";
|
|
2
|
+
import { UploadFileParams } from "../../api/resources/tools/resources/file/client/requests/index.js";
|
|
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,162 @@
|
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.FileUploader = void 0;
|
|
46
|
+
const mime = __importStar(require("mime-types"));
|
|
47
|
+
const Client_js_1 = require("../../api/resources/tools/resources/file/client/Client.js");
|
|
48
|
+
const index_js_1 = require("../../api/errors/index.js");
|
|
49
|
+
class FileUploader extends Client_js_1.File_ {
|
|
50
|
+
/**
|
|
51
|
+
* Upload a file from a file path (Node.js) or File object (browser)
|
|
52
|
+
* @param fileInput - File path string (Node.js) or File object (browser)
|
|
53
|
+
* @param options - Upload options
|
|
54
|
+
* @returns The download URL of the uploaded file
|
|
55
|
+
*/
|
|
56
|
+
uploadFromPath(fileInput, options) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
let size;
|
|
59
|
+
let fileName;
|
|
60
|
+
let contentType;
|
|
61
|
+
let blob;
|
|
62
|
+
if (typeof window === "undefined") {
|
|
63
|
+
if (typeof fileInput !== "string") {
|
|
64
|
+
throw new index_js_1.BadRequestError({ message: "In Node.js, fileInput must be a file path string" });
|
|
65
|
+
}
|
|
66
|
+
const fs = yield Promise.resolve().then(() => __importStar(require("fs")));
|
|
67
|
+
const path = yield Promise.resolve().then(() => __importStar(require("path")));
|
|
68
|
+
const filePath = fileInput;
|
|
69
|
+
let stats;
|
|
70
|
+
try {
|
|
71
|
+
stats = yield fs.promises.stat(filePath);
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
if (error.code === "ENOENT") {
|
|
75
|
+
throw new index_js_1.NotFoundError({ error: `File not found: ${filePath}` });
|
|
76
|
+
}
|
|
77
|
+
throw new index_js_1.InternalServerError({ error: `Failed to access file: ${error.message}` });
|
|
78
|
+
}
|
|
79
|
+
if (stats.isDirectory()) {
|
|
80
|
+
throw new index_js_1.BadRequestError({ message: `Path is a directory, not a file: ${filePath}` });
|
|
81
|
+
}
|
|
82
|
+
size = stats.size;
|
|
83
|
+
fileName = (options === null || options === void 0 ? void 0 : options.name) || path.default.basename(filePath);
|
|
84
|
+
contentType = this.getMimeType(filePath);
|
|
85
|
+
const fileBuffer = yield fs.promises.readFile(filePath);
|
|
86
|
+
const arrayBuffer = new Uint8Array(fileBuffer).buffer;
|
|
87
|
+
blob = new Blob([arrayBuffer], { type: contentType });
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
if (!(fileInput instanceof File)) {
|
|
91
|
+
throw new index_js_1.BadRequestError({ message: "In browser, fileInput must be a File object" });
|
|
92
|
+
}
|
|
93
|
+
const file = fileInput;
|
|
94
|
+
size = file.size;
|
|
95
|
+
fileName = (options === null || options === void 0 ? void 0 : options.name) || file.name;
|
|
96
|
+
contentType = file.type || this.getMimeType(file.name);
|
|
97
|
+
blob = file;
|
|
98
|
+
}
|
|
99
|
+
const uploadParams = {
|
|
100
|
+
contentType,
|
|
101
|
+
size,
|
|
102
|
+
name: fileName,
|
|
103
|
+
options: options === null || options === void 0 ? void 0 : options.options,
|
|
104
|
+
};
|
|
105
|
+
const uploadResult = yield this.upload(uploadParams);
|
|
106
|
+
if (uploadResult.uploadUrl) {
|
|
107
|
+
yield fetch(uploadResult.uploadUrl, {
|
|
108
|
+
method: "PUT",
|
|
109
|
+
body: blob,
|
|
110
|
+
headers: {
|
|
111
|
+
"Content-Type": contentType,
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
return uploadResult.downloadUrl;
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
getMimeType(filePath) {
|
|
119
|
+
const mimeType = mime.lookup(filePath);
|
|
120
|
+
if (!mimeType) {
|
|
121
|
+
return "application/octet-stream";
|
|
122
|
+
}
|
|
123
|
+
const supportedTypes = new Set([
|
|
124
|
+
"audio/mpeg",
|
|
125
|
+
"audio/mp4",
|
|
126
|
+
"audio/ogg",
|
|
127
|
+
"audio/aac",
|
|
128
|
+
"audio/webm",
|
|
129
|
+
"audio/wav",
|
|
130
|
+
"audio/3gpp",
|
|
131
|
+
"audio/amr",
|
|
132
|
+
"video/mp4",
|
|
133
|
+
"video/mpeg",
|
|
134
|
+
"video/quicktime",
|
|
135
|
+
"video/webm",
|
|
136
|
+
"video/3gpp",
|
|
137
|
+
"video/H264",
|
|
138
|
+
"video/x-m4v",
|
|
139
|
+
"image/jpeg",
|
|
140
|
+
"image/png",
|
|
141
|
+
"image/gif",
|
|
142
|
+
"image/bmp",
|
|
143
|
+
"image/tiff",
|
|
144
|
+
"image/webp",
|
|
145
|
+
"application/pdf",
|
|
146
|
+
"text/csv",
|
|
147
|
+
"application/rtf",
|
|
148
|
+
"text/vcard",
|
|
149
|
+
"text/calendar",
|
|
150
|
+
]);
|
|
151
|
+
if (supportedTypes.has(mimeType)) {
|
|
152
|
+
return mimeType;
|
|
153
|
+
}
|
|
154
|
+
const baseType = mimeType.split("/")[0];
|
|
155
|
+
if (["audio", "video", "image"].includes(baseType)) {
|
|
156
|
+
console.warn(`MIME type ${mimeType} may not be fully supported. Proceeding anyway.`);
|
|
157
|
+
return mimeType;
|
|
158
|
+
}
|
|
159
|
+
return "application/octet-stream";
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
exports.FileUploader = FileUploader;
|
package/dist/esm/Client.d.mts
CHANGED
|
@@ -8,6 +8,7 @@ import { Contacts } from "./api/resources/contacts/client/Client.mjs";
|
|
|
8
8
|
import { Conversations } from "./api/resources/conversations/client/Client.mjs";
|
|
9
9
|
import { Messages } from "./api/resources/messages/client/Client.mjs";
|
|
10
10
|
import { PhoneNumbers } from "./api/resources/phoneNumbers/client/Client.mjs";
|
|
11
|
+
import { Rcs } from "./api/resources/rcs/client/Client.mjs";
|
|
11
12
|
import { Webhooks } from "./api/resources/webhooks/client/Client.mjs";
|
|
12
13
|
import { Campaigns } from "./api/resources/campaigns/client/Client.mjs";
|
|
13
14
|
import { Status } from "./api/resources/status/client/Client.mjs";
|
|
@@ -17,7 +18,7 @@ export declare namespace PinnacleClient {
|
|
|
17
18
|
environment?: core.Supplier<environments.PinnacleEnvironment | string>;
|
|
18
19
|
/** Specify a custom URL to connect the client to. */
|
|
19
20
|
baseUrl?: core.Supplier<string>;
|
|
20
|
-
apiKey
|
|
21
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
21
22
|
/** Additional headers to include in requests. */
|
|
22
23
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
23
24
|
}
|
|
@@ -41,16 +42,18 @@ export declare class PinnacleClient {
|
|
|
41
42
|
protected _conversations: Conversations | undefined;
|
|
42
43
|
protected _messages: Messages | undefined;
|
|
43
44
|
protected _phoneNumbers: PhoneNumbers | undefined;
|
|
45
|
+
protected _rcs: Rcs | undefined;
|
|
44
46
|
protected _webhooks: Webhooks | undefined;
|
|
45
47
|
protected _campaigns: Campaigns | undefined;
|
|
46
48
|
protected _status: Status | undefined;
|
|
47
49
|
protected _tools: Tools | undefined;
|
|
48
|
-
constructor(_options
|
|
50
|
+
constructor(_options?: PinnacleClient.Options);
|
|
49
51
|
get brands(): Brands;
|
|
50
52
|
get contacts(): Contacts;
|
|
51
53
|
get conversations(): Conversations;
|
|
52
54
|
get messages(): Messages;
|
|
53
55
|
get phoneNumbers(): PhoneNumbers;
|
|
56
|
+
get rcs(): Rcs;
|
|
54
57
|
get webhooks(): Webhooks;
|
|
55
58
|
get campaigns(): Campaigns;
|
|
56
59
|
get status(): Status;
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -8,17 +8,18 @@ import { Contacts } from "./api/resources/contacts/client/Client.mjs";
|
|
|
8
8
|
import { Conversations } from "./api/resources/conversations/client/Client.mjs";
|
|
9
9
|
import { Messages } from "./api/resources/messages/client/Client.mjs";
|
|
10
10
|
import { PhoneNumbers } from "./api/resources/phoneNumbers/client/Client.mjs";
|
|
11
|
+
import { Rcs } from "./api/resources/rcs/client/Client.mjs";
|
|
11
12
|
import { Webhooks } from "./api/resources/webhooks/client/Client.mjs";
|
|
12
13
|
import { Campaigns } from "./api/resources/campaigns/client/Client.mjs";
|
|
13
14
|
import { Status } from "./api/resources/status/client/Client.mjs";
|
|
14
15
|
import { Tools } from "./api/resources/tools/client/Client.mjs";
|
|
15
16
|
export class PinnacleClient {
|
|
16
|
-
constructor(_options) {
|
|
17
|
+
constructor(_options = {}) {
|
|
17
18
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
18
19
|
"X-Fern-Language": "JavaScript",
|
|
19
20
|
"X-Fern-SDK-Name": "rcs-js",
|
|
20
|
-
"X-Fern-SDK-Version": "2.0.0
|
|
21
|
-
"User-Agent": "rcs-js/2.0.0
|
|
21
|
+
"X-Fern-SDK-Version": "2.0.0",
|
|
22
|
+
"User-Agent": "rcs-js/2.0.0",
|
|
22
23
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
23
24
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
24
25
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -43,6 +44,10 @@ export class PinnacleClient {
|
|
|
43
44
|
var _a;
|
|
44
45
|
return ((_a = this._phoneNumbers) !== null && _a !== void 0 ? _a : (this._phoneNumbers = new PhoneNumbers(this._options)));
|
|
45
46
|
}
|
|
47
|
+
get rcs() {
|
|
48
|
+
var _a;
|
|
49
|
+
return ((_a = this._rcs) !== null && _a !== void 0 ? _a : (this._rcs = new Rcs(this._options)));
|
|
50
|
+
}
|
|
46
51
|
get webhooks() {
|
|
47
52
|
var _a;
|
|
48
53
|
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Webhooks(this._options)));
|
|
@@ -9,7 +9,7 @@ export declare namespace Brands {
|
|
|
9
9
|
environment?: core.Supplier<environments.PinnacleEnvironment | string>;
|
|
10
10
|
/** Specify a custom URL to connect the client to. */
|
|
11
11
|
baseUrl?: core.Supplier<string>;
|
|
12
|
-
apiKey
|
|
12
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
13
13
|
/** Additional headers to include in requests. */
|
|
14
14
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
15
15
|
}
|
|
@@ -28,7 +28,7 @@ export declare namespace Brands {
|
|
|
28
28
|
}
|
|
29
29
|
export declare class Brands {
|
|
30
30
|
protected readonly _options: Brands.Options;
|
|
31
|
-
constructor(_options
|
|
31
|
+
constructor(_options?: Brands.Options);
|
|
32
32
|
/**
|
|
33
33
|
* Automatically populate brand information based on partial input data you provide.
|
|
34
34
|
*
|
|
@@ -81,7 +81,7 @@ export declare class Brands {
|
|
|
81
81
|
* website: "https://www.pinnacle.sh"
|
|
82
82
|
* })
|
|
83
83
|
*/
|
|
84
|
-
upsert(request
|
|
84
|
+
upsert(request: Pinnacle.UpsertBrandParams, requestOptions?: Brands.RequestOptions): core.HttpResponsePromise<Pinnacle.ExtendedBrand>;
|
|
85
85
|
private __upsert;
|
|
86
86
|
/**
|
|
87
87
|
* Retrieve detailed information for a specific brand in your account by ID.
|
|
@@ -111,6 +111,7 @@ export declare class Brands {
|
|
|
111
111
|
* @throws {@link Pinnacle.BadRequestError}
|
|
112
112
|
* @throws {@link Pinnacle.UnauthorizedError}
|
|
113
113
|
* @throws {@link Pinnacle.PaymentRequiredError}
|
|
114
|
+
* @throws {@link Pinnacle.NotFoundError}
|
|
114
115
|
* @throws {@link Pinnacle.InternalServerError}
|
|
115
116
|
* @throws {@link Pinnacle.NotImplementedError}
|
|
116
117
|
*
|
|
@@ -162,6 +163,7 @@ export declare class Brands {
|
|
|
162
163
|
* @throws {@link Pinnacle.BadRequestError}
|
|
163
164
|
* @throws {@link Pinnacle.UnauthorizedError}
|
|
164
165
|
* @throws {@link Pinnacle.PaymentRequiredError}
|
|
166
|
+
* @throws {@link Pinnacle.NotFoundError}
|
|
165
167
|
* @throws {@link Pinnacle.InternalServerError}
|
|
166
168
|
* @throws {@link Pinnacle.NotImplementedError}
|
|
167
169
|
*
|
|
@@ -171,6 +173,6 @@ export declare class Brands {
|
|
|
171
173
|
vet(brandId: number, request: Pinnacle.VetBrandParams, requestOptions?: Brands.RequestOptions): core.HttpResponsePromise<Pinnacle.VettingResults>;
|
|
172
174
|
private __vet;
|
|
173
175
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
174
|
-
"PINNACLE-API-KEY": string;
|
|
176
|
+
"PINNACLE-API-KEY": string | undefined;
|
|
175
177
|
}>;
|
|
176
178
|
}
|
|
@@ -16,7 +16,7 @@ import * as Pinnacle from "../../../index.mjs";
|
|
|
16
16
|
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
17
17
|
import * as errors from "../../../../errors/index.mjs";
|
|
18
18
|
export class Brands {
|
|
19
|
-
constructor(_options) {
|
|
19
|
+
constructor(_options = {}) {
|
|
20
20
|
this._options = _options;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -124,11 +124,11 @@ export class Brands {
|
|
|
124
124
|
* website: "https://www.pinnacle.sh"
|
|
125
125
|
* })
|
|
126
126
|
*/
|
|
127
|
-
upsert(request
|
|
127
|
+
upsert(request, requestOptions) {
|
|
128
128
|
return core.HttpResponsePromise.fromPromise(this.__upsert(request, requestOptions));
|
|
129
129
|
}
|
|
130
|
-
__upsert() {
|
|
131
|
-
return __awaiter(this,
|
|
130
|
+
__upsert(request, requestOptions) {
|
|
131
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
132
132
|
var _a, _b, _c;
|
|
133
133
|
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
134
134
|
const _response = yield core.fetcher({
|
|
@@ -199,15 +199,15 @@ export class Brands {
|
|
|
199
199
|
}
|
|
200
200
|
__get(id_1) {
|
|
201
201
|
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
202
|
-
var _a, _b, _c
|
|
202
|
+
var _a, _b, _c;
|
|
203
203
|
const { hideEIN: hideEin } = request;
|
|
204
204
|
const _queryParams = {};
|
|
205
|
-
if (hideEin
|
|
206
|
-
_queryParams["hideEIN"] =
|
|
205
|
+
if (hideEin != null) {
|
|
206
|
+
_queryParams["hideEIN"] = hideEin.toString();
|
|
207
207
|
}
|
|
208
|
-
let _headers = mergeHeaders((
|
|
208
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
209
209
|
const _response = yield core.fetcher({
|
|
210
|
-
url: core.url.join((
|
|
210
|
+
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, `brands/${encodeURIComponent(id)}`),
|
|
211
211
|
method: "GET",
|
|
212
212
|
headers: _headers,
|
|
213
213
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -264,6 +264,7 @@ export class Brands {
|
|
|
264
264
|
* @throws {@link Pinnacle.BadRequestError}
|
|
265
265
|
* @throws {@link Pinnacle.UnauthorizedError}
|
|
266
266
|
* @throws {@link Pinnacle.PaymentRequiredError}
|
|
267
|
+
* @throws {@link Pinnacle.NotFoundError}
|
|
267
268
|
* @throws {@link Pinnacle.InternalServerError}
|
|
268
269
|
* @throws {@link Pinnacle.NotImplementedError}
|
|
269
270
|
*
|
|
@@ -297,6 +298,8 @@ export class Brands {
|
|
|
297
298
|
throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
298
299
|
case 402:
|
|
299
300
|
throw new Pinnacle.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
301
|
+
case 404:
|
|
302
|
+
throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
|
|
300
303
|
case 500:
|
|
301
304
|
throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
|
|
302
305
|
case 501:
|
|
@@ -422,6 +425,7 @@ export class Brands {
|
|
|
422
425
|
* @throws {@link Pinnacle.BadRequestError}
|
|
423
426
|
* @throws {@link Pinnacle.UnauthorizedError}
|
|
424
427
|
* @throws {@link Pinnacle.PaymentRequiredError}
|
|
428
|
+
* @throws {@link Pinnacle.NotFoundError}
|
|
425
429
|
* @throws {@link Pinnacle.InternalServerError}
|
|
426
430
|
* @throws {@link Pinnacle.NotImplementedError}
|
|
427
431
|
*
|
|
@@ -458,6 +462,8 @@ export class Brands {
|
|
|
458
462
|
throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
459
463
|
case 402:
|
|
460
464
|
throw new Pinnacle.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
465
|
+
case 404:
|
|
466
|
+
throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
|
|
461
467
|
case 500:
|
|
462
468
|
throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
|
|
463
469
|
case 501:
|
|
@@ -27,7 +27,7 @@ export interface UpsertBrandParams {
|
|
|
27
27
|
/** Primary brand address where the company is located. */
|
|
28
28
|
address?: string | null;
|
|
29
29
|
/** Contact information for the brand. */
|
|
30
|
-
contact
|
|
30
|
+
contact: Pinnacle.UpsertContact | null;
|
|
31
31
|
/** "Doing Business As" name - the public name the brand operates under. */
|
|
32
32
|
dba?: string | null;
|
|
33
33
|
/** Brief description of what the brand does. */
|
|
@@ -41,9 +41,9 @@ export interface UpsertBrandParams {
|
|
|
41
41
|
/** Legal name of the brand as registered. */
|
|
42
42
|
name?: string | null;
|
|
43
43
|
/** Industry the brand operates in. */
|
|
44
|
-
sector
|
|
44
|
+
sector: Pinnacle.CompanySectorEnum | null;
|
|
45
45
|
/** Legal structure of the brand. */
|
|
46
|
-
type
|
|
46
|
+
type: Pinnacle.CompanyTypeEnum | null;
|
|
47
47
|
/** Brand website URL. */
|
|
48
48
|
website?: string | null;
|
|
49
49
|
}
|
|
@@ -11,7 +11,7 @@ export declare namespace Campaigns {
|
|
|
11
11
|
environment?: core.Supplier<environments.PinnacleEnvironment | string>;
|
|
12
12
|
/** Specify a custom URL to connect the client to. */
|
|
13
13
|
baseUrl?: core.Supplier<string>;
|
|
14
|
-
apiKey
|
|
14
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
15
15
|
/** Additional headers to include in requests. */
|
|
16
16
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
17
17
|
}
|
|
@@ -21,7 +21,7 @@ export declare class Campaigns {
|
|
|
21
21
|
protected _dlc: Dlc | undefined;
|
|
22
22
|
protected _tollFree: TollFree | undefined;
|
|
23
23
|
protected _rcs: Rcs | undefined;
|
|
24
|
-
constructor(_options
|
|
24
|
+
constructor(_options?: Campaigns.Options);
|
|
25
25
|
get dlc(): Dlc;
|
|
26
26
|
get tollFree(): TollFree;
|
|
27
27
|
get rcs(): Rcs;
|
|
@@ -5,7 +5,7 @@ import { Dlc } from "../resources/dlc/client/Client.mjs";
|
|
|
5
5
|
import { TollFree } from "../resources/tollFree/client/Client.mjs";
|
|
6
6
|
import { Rcs } from "../resources/rcs/client/Client.mjs";
|
|
7
7
|
export class Campaigns {
|
|
8
|
-
constructor(_options) {
|
|
8
|
+
constructor(_options = {}) {
|
|
9
9
|
this._options = _options;
|
|
10
10
|
}
|
|
11
11
|
get dlc() {
|