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,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments.js";
|
|
5
|
+
import * as core from "../../../../core/index.js";
|
|
6
|
+
import * as Pinnacle from "../../../index.js";
|
|
7
|
+
export declare namespace Rcs {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.PinnacleEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
12
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
13
|
+
/** Additional headers to include in requests. */
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
15
|
+
}
|
|
16
|
+
interface RequestOptions {
|
|
17
|
+
/** The maximum time to wait for a response in seconds. */
|
|
18
|
+
timeoutInSeconds?: number;
|
|
19
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
20
|
+
maxRetries?: number;
|
|
21
|
+
/** A hook to abort the request. */
|
|
22
|
+
abortSignal?: AbortSignal;
|
|
23
|
+
/** Additional query string parameters to include in the request. */
|
|
24
|
+
queryParams?: Record<string, unknown>;
|
|
25
|
+
/** Additional headers to include in the request. */
|
|
26
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export declare class Rcs {
|
|
30
|
+
protected readonly _options: Rcs.Options;
|
|
31
|
+
constructor(_options?: Rcs.Options);
|
|
32
|
+
/**
|
|
33
|
+
* Check RCS capabilities for one or more phone numbers.
|
|
34
|
+
*
|
|
35
|
+
* This endpoint allows you to verify which RCS features (cards, buttons, etc.) are supported
|
|
36
|
+
* on specific phone numbers before sending RCS messages to them.
|
|
37
|
+
*
|
|
38
|
+
* @param {Pinnacle.RcsCapabilitiesQuery} request
|
|
39
|
+
* @param {Rcs.RequestOptions} requestOptions - Request-specific configuration.
|
|
40
|
+
*
|
|
41
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
42
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
43
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
44
|
+
* @throws {@link Pinnacle.NotImplementedError}
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* await client.rcs.getCapabilities({
|
|
48
|
+
* phoneNumbers: ["+12345678901", "+19876543210"]
|
|
49
|
+
* })
|
|
50
|
+
*/
|
|
51
|
+
getCapabilities(request: Pinnacle.RcsCapabilitiesQuery, requestOptions?: Rcs.RequestOptions): core.HttpResponsePromise<Pinnacle.RcsCapabilitiesResult>;
|
|
52
|
+
private __getCapabilities;
|
|
53
|
+
/**
|
|
54
|
+
* Whitelist a phone number for testing with your test RCS agent.
|
|
55
|
+
*
|
|
56
|
+
* ## Overview
|
|
57
|
+
* During development and testing, RCS agents can only send messages to whitelisted phone numbers.
|
|
58
|
+
* Use this endpoint to add test devices to your agent's whitelist before sending test messages.
|
|
59
|
+
*
|
|
60
|
+
* ## Verification Process
|
|
61
|
+
* After whitelisting a number, you'll need to complete verification:
|
|
62
|
+
*
|
|
63
|
+
* 1. Check the test device for an "RBM Tester Management" request
|
|
64
|
+
* 2. Accept the request on the device
|
|
65
|
+
* 3. Enter the 4-digit verification code in the Pinnacle dashboard at:
|
|
66
|
+
* ```
|
|
67
|
+
* https://app.pinnacle.sh/dashboard/brands/{brandId}?campaignId={campaignId}&campaignType=RCS
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* > **Important Notes**
|
|
71
|
+
* >
|
|
72
|
+
* > - **Testing only:** This is only required for test agents. Production agents can message any RCS-enabled number
|
|
73
|
+
* > - **AT&T limitation:** Whitelisting may currently fail for AT&T numbers
|
|
74
|
+
* > - **Verification required:** The whitelist request isn't complete until you verify the device.
|
|
75
|
+
*
|
|
76
|
+
* @param {Pinnacle.RcsWhitelistRequest} request
|
|
77
|
+
* @param {Rcs.RequestOptions} requestOptions - Request-specific configuration.
|
|
78
|
+
*
|
|
79
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
80
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
81
|
+
* @throws {@link Pinnacle.NotFoundError}
|
|
82
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
83
|
+
* @throws {@link Pinnacle.NotImplementedError}
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* await client.rcs.whitelist({
|
|
87
|
+
* agentId: "agent_XXXXXXXXXXXX",
|
|
88
|
+
* phoneNumber: "+12345678901"
|
|
89
|
+
* })
|
|
90
|
+
*/
|
|
91
|
+
whitelist(request: Pinnacle.RcsWhitelistRequest, requestOptions?: Rcs.RequestOptions): core.HttpResponsePromise<Pinnacle.RcsWhitelistResponse>;
|
|
92
|
+
private __whitelist;
|
|
93
|
+
/**
|
|
94
|
+
* Generate a link for initiating an RCS conversation with your agent.
|
|
95
|
+
*
|
|
96
|
+
* Users can click these links to start conversations with your RCS agent directly
|
|
97
|
+
* from websites, emails, or other applications.
|
|
98
|
+
*
|
|
99
|
+
* @param {Pinnacle.RcsLinkRequest} request
|
|
100
|
+
* @param {Rcs.RequestOptions} requestOptions - Request-specific configuration.
|
|
101
|
+
*
|
|
102
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
103
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
104
|
+
* @throws {@link Pinnacle.NotFoundError}
|
|
105
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
106
|
+
* @throws {@link Pinnacle.NotImplementedError}
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* await client.rcs.getLink({
|
|
110
|
+
* agentId: "agent_XXXXXXXXXXXX",
|
|
111
|
+
* testMode: false,
|
|
112
|
+
* phoneNumber: "+12345678901",
|
|
113
|
+
* body: "Hello, I need help with my order"
|
|
114
|
+
* })
|
|
115
|
+
*/
|
|
116
|
+
getLink(request: Pinnacle.RcsLinkRequest, requestOptions?: Rcs.RequestOptions): core.HttpResponsePromise<Pinnacle.RcsLinkResult>;
|
|
117
|
+
private __getLink;
|
|
118
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
119
|
+
"PINNACLE-API-KEY": string | undefined;
|
|
120
|
+
}>;
|
|
121
|
+
}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
39
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
40
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
41
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
42
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
43
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
44
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.Rcs = void 0;
|
|
49
|
+
const environments = __importStar(require("../../../../environments.js"));
|
|
50
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
51
|
+
const Pinnacle = __importStar(require("../../../index.js"));
|
|
52
|
+
const headers_js_1 = require("../../../../core/headers.js");
|
|
53
|
+
const errors = __importStar(require("../../../../errors/index.js"));
|
|
54
|
+
class Rcs {
|
|
55
|
+
constructor(_options = {}) {
|
|
56
|
+
this._options = _options;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Check RCS capabilities for one or more phone numbers.
|
|
60
|
+
*
|
|
61
|
+
* This endpoint allows you to verify which RCS features (cards, buttons, etc.) are supported
|
|
62
|
+
* on specific phone numbers before sending RCS messages to them.
|
|
63
|
+
*
|
|
64
|
+
* @param {Pinnacle.RcsCapabilitiesQuery} request
|
|
65
|
+
* @param {Rcs.RequestOptions} requestOptions - Request-specific configuration.
|
|
66
|
+
*
|
|
67
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
68
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
69
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
70
|
+
* @throws {@link Pinnacle.NotImplementedError}
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* await client.rcs.getCapabilities({
|
|
74
|
+
* phoneNumbers: ["+12345678901", "+19876543210"]
|
|
75
|
+
* })
|
|
76
|
+
*/
|
|
77
|
+
getCapabilities(request, requestOptions) {
|
|
78
|
+
return core.HttpResponsePromise.fromPromise(this.__getCapabilities(request, requestOptions));
|
|
79
|
+
}
|
|
80
|
+
__getCapabilities(request, requestOptions) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
var _a, _b, _c;
|
|
83
|
+
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
84
|
+
const _response = yield core.fetcher({
|
|
85
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PinnacleEnvironment.Default, "rcs/capabilities"),
|
|
86
|
+
method: "POST",
|
|
87
|
+
headers: _headers,
|
|
88
|
+
contentType: "application/json",
|
|
89
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
90
|
+
requestType: "json",
|
|
91
|
+
body: request,
|
|
92
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
93
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
94
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
95
|
+
});
|
|
96
|
+
if (_response.ok) {
|
|
97
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
98
|
+
}
|
|
99
|
+
if (_response.error.reason === "status-code") {
|
|
100
|
+
switch (_response.error.statusCode) {
|
|
101
|
+
case 400:
|
|
102
|
+
throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
|
|
103
|
+
case 401:
|
|
104
|
+
throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
105
|
+
case 500:
|
|
106
|
+
throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
|
|
107
|
+
case 501:
|
|
108
|
+
throw new Pinnacle.NotImplementedError(_response.error.body, _response.rawResponse);
|
|
109
|
+
default:
|
|
110
|
+
throw new errors.PinnacleError({
|
|
111
|
+
statusCode: _response.error.statusCode,
|
|
112
|
+
body: _response.error.body,
|
|
113
|
+
rawResponse: _response.rawResponse,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
switch (_response.error.reason) {
|
|
118
|
+
case "non-json":
|
|
119
|
+
throw new errors.PinnacleError({
|
|
120
|
+
statusCode: _response.error.statusCode,
|
|
121
|
+
body: _response.error.rawBody,
|
|
122
|
+
rawResponse: _response.rawResponse,
|
|
123
|
+
});
|
|
124
|
+
case "timeout":
|
|
125
|
+
throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /rcs/capabilities.");
|
|
126
|
+
case "unknown":
|
|
127
|
+
throw new errors.PinnacleError({
|
|
128
|
+
message: _response.error.errorMessage,
|
|
129
|
+
rawResponse: _response.rawResponse,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Whitelist a phone number for testing with your test RCS agent.
|
|
136
|
+
*
|
|
137
|
+
* ## Overview
|
|
138
|
+
* During development and testing, RCS agents can only send messages to whitelisted phone numbers.
|
|
139
|
+
* Use this endpoint to add test devices to your agent's whitelist before sending test messages.
|
|
140
|
+
*
|
|
141
|
+
* ## Verification Process
|
|
142
|
+
* After whitelisting a number, you'll need to complete verification:
|
|
143
|
+
*
|
|
144
|
+
* 1. Check the test device for an "RBM Tester Management" request
|
|
145
|
+
* 2. Accept the request on the device
|
|
146
|
+
* 3. Enter the 4-digit verification code in the Pinnacle dashboard at:
|
|
147
|
+
* ```
|
|
148
|
+
* https://app.pinnacle.sh/dashboard/brands/{brandId}?campaignId={campaignId}&campaignType=RCS
|
|
149
|
+
* ```
|
|
150
|
+
*
|
|
151
|
+
* > **Important Notes**
|
|
152
|
+
* >
|
|
153
|
+
* > - **Testing only:** This is only required for test agents. Production agents can message any RCS-enabled number
|
|
154
|
+
* > - **AT&T limitation:** Whitelisting may currently fail for AT&T numbers
|
|
155
|
+
* > - **Verification required:** The whitelist request isn't complete until you verify the device.
|
|
156
|
+
*
|
|
157
|
+
* @param {Pinnacle.RcsWhitelistRequest} request
|
|
158
|
+
* @param {Rcs.RequestOptions} requestOptions - Request-specific configuration.
|
|
159
|
+
*
|
|
160
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
161
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
162
|
+
* @throws {@link Pinnacle.NotFoundError}
|
|
163
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
164
|
+
* @throws {@link Pinnacle.NotImplementedError}
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* await client.rcs.whitelist({
|
|
168
|
+
* agentId: "agent_XXXXXXXXXXXX",
|
|
169
|
+
* phoneNumber: "+12345678901"
|
|
170
|
+
* })
|
|
171
|
+
*/
|
|
172
|
+
whitelist(request, requestOptions) {
|
|
173
|
+
return core.HttpResponsePromise.fromPromise(this.__whitelist(request, requestOptions));
|
|
174
|
+
}
|
|
175
|
+
__whitelist(request, requestOptions) {
|
|
176
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
177
|
+
var _a, _b, _c;
|
|
178
|
+
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
179
|
+
const _response = yield core.fetcher({
|
|
180
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PinnacleEnvironment.Default, "rcs/whitelist"),
|
|
181
|
+
method: "POST",
|
|
182
|
+
headers: _headers,
|
|
183
|
+
contentType: "application/json",
|
|
184
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
185
|
+
requestType: "json",
|
|
186
|
+
body: request,
|
|
187
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
188
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
189
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
190
|
+
});
|
|
191
|
+
if (_response.ok) {
|
|
192
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
193
|
+
}
|
|
194
|
+
if (_response.error.reason === "status-code") {
|
|
195
|
+
switch (_response.error.statusCode) {
|
|
196
|
+
case 400:
|
|
197
|
+
throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
|
|
198
|
+
case 401:
|
|
199
|
+
throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
200
|
+
case 404:
|
|
201
|
+
throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
|
|
202
|
+
case 500:
|
|
203
|
+
throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
|
|
204
|
+
case 501:
|
|
205
|
+
throw new Pinnacle.NotImplementedError(_response.error.body, _response.rawResponse);
|
|
206
|
+
default:
|
|
207
|
+
throw new errors.PinnacleError({
|
|
208
|
+
statusCode: _response.error.statusCode,
|
|
209
|
+
body: _response.error.body,
|
|
210
|
+
rawResponse: _response.rawResponse,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
switch (_response.error.reason) {
|
|
215
|
+
case "non-json":
|
|
216
|
+
throw new errors.PinnacleError({
|
|
217
|
+
statusCode: _response.error.statusCode,
|
|
218
|
+
body: _response.error.rawBody,
|
|
219
|
+
rawResponse: _response.rawResponse,
|
|
220
|
+
});
|
|
221
|
+
case "timeout":
|
|
222
|
+
throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /rcs/whitelist.");
|
|
223
|
+
case "unknown":
|
|
224
|
+
throw new errors.PinnacleError({
|
|
225
|
+
message: _response.error.errorMessage,
|
|
226
|
+
rawResponse: _response.rawResponse,
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Generate a link for initiating an RCS conversation with your agent.
|
|
233
|
+
*
|
|
234
|
+
* Users can click these links to start conversations with your RCS agent directly
|
|
235
|
+
* from websites, emails, or other applications.
|
|
236
|
+
*
|
|
237
|
+
* @param {Pinnacle.RcsLinkRequest} request
|
|
238
|
+
* @param {Rcs.RequestOptions} requestOptions - Request-specific configuration.
|
|
239
|
+
*
|
|
240
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
241
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
242
|
+
* @throws {@link Pinnacle.NotFoundError}
|
|
243
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
244
|
+
* @throws {@link Pinnacle.NotImplementedError}
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* await client.rcs.getLink({
|
|
248
|
+
* agentId: "agent_XXXXXXXXXXXX",
|
|
249
|
+
* testMode: false,
|
|
250
|
+
* phoneNumber: "+12345678901",
|
|
251
|
+
* body: "Hello, I need help with my order"
|
|
252
|
+
* })
|
|
253
|
+
*/
|
|
254
|
+
getLink(request, requestOptions) {
|
|
255
|
+
return core.HttpResponsePromise.fromPromise(this.__getLink(request, requestOptions));
|
|
256
|
+
}
|
|
257
|
+
__getLink(request, requestOptions) {
|
|
258
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
259
|
+
var _a, _b, _c;
|
|
260
|
+
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
261
|
+
const _response = yield core.fetcher({
|
|
262
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PinnacleEnvironment.Default, "rcs/link"),
|
|
263
|
+
method: "POST",
|
|
264
|
+
headers: _headers,
|
|
265
|
+
contentType: "application/json",
|
|
266
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
267
|
+
requestType: "json",
|
|
268
|
+
body: request,
|
|
269
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
270
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
271
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
272
|
+
});
|
|
273
|
+
if (_response.ok) {
|
|
274
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
275
|
+
}
|
|
276
|
+
if (_response.error.reason === "status-code") {
|
|
277
|
+
switch (_response.error.statusCode) {
|
|
278
|
+
case 400:
|
|
279
|
+
throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
|
|
280
|
+
case 401:
|
|
281
|
+
throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
282
|
+
case 404:
|
|
283
|
+
throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
|
|
284
|
+
case 500:
|
|
285
|
+
throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
|
|
286
|
+
case 501:
|
|
287
|
+
throw new Pinnacle.NotImplementedError(_response.error.body, _response.rawResponse);
|
|
288
|
+
default:
|
|
289
|
+
throw new errors.PinnacleError({
|
|
290
|
+
statusCode: _response.error.statusCode,
|
|
291
|
+
body: _response.error.body,
|
|
292
|
+
rawResponse: _response.rawResponse,
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
switch (_response.error.reason) {
|
|
297
|
+
case "non-json":
|
|
298
|
+
throw new errors.PinnacleError({
|
|
299
|
+
statusCode: _response.error.statusCode,
|
|
300
|
+
body: _response.error.rawBody,
|
|
301
|
+
rawResponse: _response.rawResponse,
|
|
302
|
+
});
|
|
303
|
+
case "timeout":
|
|
304
|
+
throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /rcs/link.");
|
|
305
|
+
case "unknown":
|
|
306
|
+
throw new errors.PinnacleError({
|
|
307
|
+
message: _response.error.errorMessage,
|
|
308
|
+
rawResponse: _response.rawResponse,
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
_getCustomAuthorizationHeaders() {
|
|
314
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
315
|
+
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
316
|
+
return { "PINNACLE-API-KEY": apiKeyValue };
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
exports.Rcs = Rcs;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests/index.js"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* phoneNumbers: ["+12345678901", "+19876543210"]
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface RcsCapabilitiesQuery {
|
|
11
|
+
/** List of phone numbers to check RCS capabilities for (E.164 format) */
|
|
12
|
+
phoneNumbers: string[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* agentId: "agent_XXXXXXXXXXXX",
|
|
8
|
+
* testMode: false,
|
|
9
|
+
* phoneNumber: "+12345678901",
|
|
10
|
+
* body: "Hello, I need help with my order"
|
|
11
|
+
* }
|
|
12
|
+
*/
|
|
13
|
+
export interface RcsLinkRequest {
|
|
14
|
+
/** The RCS agent ID (must be prefixed with 'agent_') */
|
|
15
|
+
agentId: string;
|
|
16
|
+
/** Link to the test agent or the production agent if false */
|
|
17
|
+
testMode?: boolean;
|
|
18
|
+
/** Fallback phone number (E.164 format) to use if the phone number does not support RCS. If not provided, no url will be generated. */
|
|
19
|
+
phoneNumber?: string;
|
|
20
|
+
/** Optional message body to pre-fill after the user clicks the link */
|
|
21
|
+
body?: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* agentId: "agent_XXXXXXXXXXXX",
|
|
8
|
+
* phoneNumber: "+12345678901"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface RcsWhitelistRequest {
|
|
12
|
+
/** The RCS agent ID (must be prefixed with 'agent_') */
|
|
13
|
+
agentId: string;
|
|
14
|
+
/** Phone number to whitelist for testing (E.164 format) */
|
|
15
|
+
phoneNumber: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -9,7 +9,7 @@ export declare namespace Status {
|
|
|
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
|
}
|
|
@@ -17,6 +17,6 @@ export declare namespace Status {
|
|
|
17
17
|
export declare class Status {
|
|
18
18
|
protected readonly _options: Status.Options;
|
|
19
19
|
protected _get: Get | undefined;
|
|
20
|
-
constructor(_options
|
|
20
|
+
constructor(_options?: Status.Options);
|
|
21
21
|
get get(): Get;
|
|
22
22
|
}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Status = void 0;
|
|
7
7
|
const Client_js_1 = require("../resources/get/client/Client.js");
|
|
8
8
|
class Status {
|
|
9
|
-
constructor(_options) {
|
|
9
|
+
constructor(_options = {}) {
|
|
10
10
|
this._options = _options;
|
|
11
11
|
}
|
|
12
12
|
get get() {
|
|
@@ -9,7 +9,7 @@ export declare namespace Get {
|
|
|
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 Get {
|
|
|
28
28
|
}
|
|
29
29
|
export declare class Get {
|
|
30
30
|
protected readonly _options: Get.Options;
|
|
31
|
-
constructor(_options
|
|
31
|
+
constructor(_options?: Get.Options);
|
|
32
32
|
/**
|
|
33
33
|
* Retrieve a brand's status.
|
|
34
34
|
*
|
|
@@ -64,9 +64,9 @@ export declare class Get {
|
|
|
64
64
|
tollFree(campaignId: number, requestOptions?: Get.RequestOptions): core.HttpResponsePromise<Pinnacle.TollFreeCampaignStatus>;
|
|
65
65
|
private __tollFree;
|
|
66
66
|
/**
|
|
67
|
-
* Retrieve a
|
|
67
|
+
* Retrieve a 10DLC campaign's status.
|
|
68
68
|
*
|
|
69
|
-
* @param {number} campaignId - ID of the
|
|
69
|
+
* @param {number} campaignId - ID of the 10DLC campaign.
|
|
70
70
|
* @param {Get.RequestOptions} requestOptions - Request-specific configuration.
|
|
71
71
|
*
|
|
72
72
|
* @throws {@link Pinnacle.BadRequestError}
|
|
@@ -117,6 +117,6 @@ export declare class Get {
|
|
|
117
117
|
phoneNumber(phoneNumber: string, requestOptions?: Get.RequestOptions): core.HttpResponsePromise<Pinnacle.PhoneNumberStatus>;
|
|
118
118
|
private __phoneNumber;
|
|
119
119
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
120
|
-
"PINNACLE-API-KEY": string;
|
|
120
|
+
"PINNACLE-API-KEY": string | undefined;
|
|
121
121
|
}>;
|
|
122
122
|
}
|
|
@@ -52,7 +52,7 @@ const Pinnacle = __importStar(require("../../../../../index.js"));
|
|
|
52
52
|
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
53
53
|
const errors = __importStar(require("../../../../../../errors/index.js"));
|
|
54
54
|
class Get {
|
|
55
|
-
constructor(_options) {
|
|
55
|
+
constructor(_options = {}) {
|
|
56
56
|
this._options = _options;
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
@@ -198,9 +198,9 @@ class Get {
|
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
200
|
/**
|
|
201
|
-
* Retrieve a
|
|
201
|
+
* Retrieve a 10DLC campaign's status.
|
|
202
202
|
*
|
|
203
|
-
* @param {number} campaignId - ID of the
|
|
203
|
+
* @param {number} campaignId - ID of the 10DLC campaign.
|
|
204
204
|
* @param {Get.RequestOptions} requestOptions - Request-specific configuration.
|
|
205
205
|
*
|
|
206
206
|
* @throws {@link Pinnacle.BadRequestError}
|
|
@@ -11,7 +11,7 @@ export declare namespace Tools {
|
|
|
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 Tools {
|
|
|
21
21
|
protected _url: Url | undefined;
|
|
22
22
|
protected _file: File_ | undefined;
|
|
23
23
|
protected _contactCard: ContactCard | undefined;
|
|
24
|
-
constructor(_options
|
|
24
|
+
constructor(_options?: Tools.Options);
|
|
25
25
|
get url(): Url;
|
|
26
26
|
get file(): File_;
|
|
27
27
|
get contactCard(): ContactCard;
|
|
@@ -8,7 +8,7 @@ const Client_js_1 = require("../resources/url/client/Client.js");
|
|
|
8
8
|
const Client_js_2 = require("../resources/file/client/Client.js");
|
|
9
9
|
const Client_js_3 = require("../resources/contactCard/client/Client.js");
|
|
10
10
|
class Tools {
|
|
11
|
-
constructor(_options) {
|
|
11
|
+
constructor(_options = {}) {
|
|
12
12
|
this._options = _options;
|
|
13
13
|
}
|
|
14
14
|
get url() {
|