rcs-js 2.0.0-rc.1 → 2.0.0-rc.11
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 +3 -3
- package/dist/cjs/Client.js +11 -11
- package/dist/cjs/api/resources/brands/client/Client.d.ts +2 -0
- package/dist/cjs/api/resources/brands/client/Client.js +6 -0
- package/dist/cjs/api/resources/brands/client/requests/UpsertBrandParams.d.ts +1 -1
- package/dist/cjs/api/resources/campaigns/resources/dlc/client/Client.d.ts +6 -6
- package/dist/cjs/api/resources/campaigns/resources/dlc/client/Client.js +6 -6
- package/dist/cjs/api/resources/campaigns/resources/rcs/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/campaigns/resources/rcs/client/Client.js +1 -0
- package/dist/cjs/api/resources/campaigns/resources/rcs/client/requests/UpsertRcsCampaignParams.d.ts +5 -2
- package/dist/cjs/api/resources/index.d.ts +2 -1
- package/dist/cjs/api/resources/index.js +3 -2
- package/dist/cjs/api/resources/messages/client/Client.d.ts +6 -3
- package/dist/cjs/api/resources/messages/client/Client.js +12 -3
- package/dist/cjs/api/resources/messages/resources/index.d.ts +6 -3
- package/dist/cjs/api/resources/messages/resources/index.js +7 -4
- package/dist/cjs/api/resources/messages/resources/mms/client/Client.d.ts +27 -0
- package/dist/cjs/api/resources/messages/resources/mms/client/Client.js +86 -0
- package/dist/cjs/api/resources/messages/resources/mms/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/messages/resources/mms/client/index.js +15 -0
- package/dist/cjs/api/resources/messages/resources/{send → mms}/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/messages/resources/mms/index.d.ts +1 -0
- package/dist/cjs/api/resources/messages/resources/mms/index.js +1 -0
- package/dist/cjs/api/resources/messages/resources/{send/types/SendRcsResponse.d.ts → mms/types/MmsSendResponse.d.ts} +1 -1
- package/dist/cjs/api/resources/messages/resources/mms/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/{message → messages/resources/mms/types}/index.js +1 -2
- package/dist/cjs/api/resources/messages/resources/rcs/client/Client.d.ts +29 -0
- package/dist/cjs/api/resources/messages/resources/rcs/client/Client.js +88 -0
- package/dist/cjs/api/resources/messages/resources/rcs/index.d.ts +1 -0
- package/dist/cjs/api/resources/messages/resources/rcs/index.js +1 -0
- package/dist/cjs/api/resources/messages/resources/{send/types/SendSmsResponse.d.ts → rcs/types/RcsSendResponse.d.ts} +1 -1
- package/dist/cjs/api/resources/messages/resources/rcs/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/messages/resources/rcs/types/index.js +17 -0
- package/dist/cjs/api/resources/{message → messages}/resources/sms/client/Client.d.ts +23 -1
- package/dist/cjs/api/resources/{message → messages}/resources/sms/client/Client.js +82 -1
- package/dist/cjs/api/resources/messages/resources/{send → sms}/client/requests/Sms.d.ts +2 -2
- package/dist/cjs/api/resources/messages/resources/sms/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/messages/resources/{send/types/SendMmsResponse.d.ts → sms/types/SmsSendResponse.d.ts} +1 -1
- package/dist/cjs/api/resources/messages/resources/sms/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/messages/resources/sms/types/index.js +17 -0
- package/dist/cjs/api/resources/phoneNumbers/client/requests/SearchPhoneNumberParams.d.ts +2 -2
- package/dist/cjs/api/resources/phoneNumbers/resources/campaign/client/Client.d.ts +2 -0
- package/dist/cjs/api/resources/phoneNumbers/resources/campaign/client/Client.js +6 -0
- package/dist/cjs/api/resources/phoneNumbers/resources/webhook/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/phoneNumbers/resources/webhook/client/Client.js +3 -0
- package/dist/cjs/api/resources/rcs/client/Client.d.ts +121 -0
- package/dist/cjs/api/resources/{messages/resources/send → rcs}/client/Client.js +76 -67
- 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/status/resources/get/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/status/resources/get/client/Client.js +2 -2
- package/dist/cjs/api/types/ConversationList.d.ts +4 -4
- package/dist/cjs/api/types/DlcCampaignStatus.d.ts +2 -2
- package/dist/cjs/api/types/ExtendedRcsCampaign.d.ts +4 -2
- package/dist/cjs/api/types/Rcs.d.ts +3 -3
- package/dist/cjs/api/types/RcsCampaign.d.ts +4 -2
- package/dist/cjs/api/types/RcsCapabilitiesResult.d.ts +8 -0
- package/dist/cjs/api/types/RcsCapability.d.ts +36 -0
- package/dist/cjs/api/types/RcsCards.d.ts +2 -2
- package/dist/cjs/api/types/RcsCardsContent.d.ts +2 -2
- package/dist/cjs/api/types/RcsLinkResult.d.ts +13 -0
- package/dist/cjs/api/types/RcsLinkResult.js +5 -0
- package/dist/cjs/api/types/RcsMediaContent.d.ts +1 -1
- package/dist/cjs/api/types/RcsTextContent.d.ts +1 -1
- 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/{RcsButtonContent.d.ts → RichButton.d.ts} +2 -2
- package/dist/cjs/api/types/RichButton.js +5 -0
- package/dist/cjs/api/types/{RcsCard.d.ts → RichCardsMessage.d.ts} +1 -1
- package/dist/cjs/api/types/RichCardsMessage.js +5 -0
- package/dist/cjs/api/types/{RcsMedia.d.ts → RichMediaMessage.d.ts} +2 -2
- package/dist/cjs/api/types/RichMediaMessage.js +5 -0
- package/dist/cjs/api/types/{RcsText.d.ts → RichTextMessage.d.ts} +1 -1
- package/dist/cjs/api/types/RichTextMessage.js +5 -0
- package/dist/{esm/api/types/NullableContact.d.mts → cjs/api/types/UpsertContact.d.ts} +1 -1
- package/dist/cjs/api/types/UpsertContact.js +5 -0
- package/dist/cjs/api/types/index.d.ts +9 -5
- package/dist/cjs/api/types/index.js +9 -5
- package/dist/cjs/index.d.ts +4 -4
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +3 -3
- package/dist/esm/Client.mjs +7 -7
- package/dist/esm/api/resources/brands/client/Client.d.mts +2 -0
- package/dist/esm/api/resources/brands/client/Client.mjs +6 -0
- package/dist/esm/api/resources/brands/client/requests/UpsertBrandParams.d.mts +1 -1
- package/dist/esm/api/resources/campaigns/resources/dlc/client/Client.d.mts +6 -6
- package/dist/esm/api/resources/campaigns/resources/dlc/client/Client.mjs +6 -6
- package/dist/esm/api/resources/campaigns/resources/rcs/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/campaigns/resources/rcs/client/Client.mjs +1 -0
- package/dist/esm/api/resources/campaigns/resources/rcs/client/requests/UpsertRcsCampaignParams.d.mts +5 -2
- package/dist/esm/api/resources/index.d.mts +2 -1
- package/dist/esm/api/resources/index.mjs +2 -1
- package/dist/esm/api/resources/messages/client/Client.d.mts +6 -3
- package/dist/esm/api/resources/messages/client/Client.mjs +12 -3
- package/dist/esm/api/resources/messages/resources/index.d.mts +6 -3
- package/dist/esm/api/resources/messages/resources/index.mjs +6 -3
- package/dist/esm/api/resources/messages/resources/mms/client/Client.d.mts +27 -0
- package/dist/esm/api/resources/messages/resources/mms/client/Client.mjs +86 -0
- package/dist/esm/api/resources/messages/resources/mms/client/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/resources/mms/client/index.mjs +1 -1
- package/dist/esm/api/resources/messages/resources/{send → mms}/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/messages/resources/mms/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/resources/mms/index.mjs +1 -0
- package/dist/esm/api/resources/messages/resources/{send/types/SendRcsResponse.d.mts → mms/types/MmsSendResponse.d.mts} +1 -1
- package/dist/esm/api/resources/messages/resources/mms/types/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/resources/mms/types/index.mjs +1 -0
- package/dist/esm/api/resources/messages/resources/rcs/client/Client.d.mts +29 -0
- package/dist/esm/api/resources/messages/resources/rcs/client/Client.mjs +88 -0
- package/dist/esm/api/resources/messages/resources/rcs/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/resources/rcs/index.mjs +1 -0
- package/dist/esm/api/resources/messages/resources/{send/types/SendSmsResponse.d.mts → rcs/types/RcsSendResponse.d.mts} +1 -1
- package/dist/esm/api/resources/messages/resources/rcs/types/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/resources/rcs/types/index.mjs +1 -0
- package/dist/esm/api/resources/{message → messages}/resources/sms/client/Client.d.mts +23 -1
- package/dist/esm/api/resources/{message → messages}/resources/sms/client/Client.mjs +82 -1
- package/dist/esm/api/resources/messages/resources/{send → sms}/client/requests/Sms.d.mts +2 -2
- package/dist/esm/api/resources/messages/resources/sms/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/resources/{send/types/SendMmsResponse.d.mts → sms/types/SmsSendResponse.d.mts} +1 -1
- package/dist/esm/api/resources/messages/resources/sms/types/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/resources/sms/types/index.mjs +1 -0
- package/dist/esm/api/resources/phoneNumbers/client/requests/SearchPhoneNumberParams.d.mts +2 -2
- package/dist/esm/api/resources/phoneNumbers/resources/campaign/client/Client.d.mts +2 -0
- package/dist/esm/api/resources/phoneNumbers/resources/campaign/client/Client.mjs +6 -0
- package/dist/esm/api/resources/phoneNumbers/resources/webhook/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/phoneNumbers/resources/webhook/client/Client.mjs +3 -0
- package/dist/esm/api/resources/rcs/client/Client.d.mts +121 -0
- package/dist/esm/api/resources/{messages/resources/send → rcs}/client/Client.mjs +74 -65
- 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/status/resources/get/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/status/resources/get/client/Client.mjs +2 -2
- package/dist/esm/api/types/ConversationList.d.mts +4 -4
- package/dist/esm/api/types/DlcCampaignStatus.d.mts +2 -2
- package/dist/esm/api/types/ExtendedRcsCampaign.d.mts +4 -2
- package/dist/esm/api/types/Rcs.d.mts +3 -3
- package/dist/esm/api/types/RcsCampaign.d.mts +4 -2
- package/dist/esm/api/types/RcsCapabilitiesResult.d.mts +8 -0
- package/dist/esm/api/types/RcsCapability.d.mts +36 -0
- package/dist/esm/api/types/RcsCards.d.mts +2 -2
- package/dist/esm/api/types/RcsCardsContent.d.mts +2 -2
- package/dist/esm/api/types/RcsLinkResult.d.mts +13 -0
- package/dist/esm/api/types/RcsLinkResult.mjs +4 -0
- package/dist/esm/api/types/RcsMediaContent.d.mts +1 -1
- package/dist/esm/api/types/RcsTextContent.d.mts +1 -1
- 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/{RcsButtonContent.d.mts → RichButton.d.mts} +2 -2
- package/dist/esm/api/types/RichButton.mjs +4 -0
- package/dist/esm/api/types/{RcsCard.d.mts → RichCardsMessage.d.mts} +1 -1
- package/dist/esm/api/types/RichCardsMessage.mjs +4 -0
- package/dist/esm/api/types/{RcsMedia.d.mts → RichMediaMessage.d.mts} +2 -2
- package/dist/esm/api/types/RichMediaMessage.mjs +4 -0
- package/dist/esm/api/types/{RcsText.d.mts → RichTextMessage.d.mts} +1 -1
- package/dist/esm/api/types/RichTextMessage.mjs +4 -0
- package/dist/{cjs/api/types/NullableContact.d.ts → esm/api/types/UpsertContact.d.mts} +1 -1
- package/dist/esm/api/types/UpsertContact.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +9 -5
- package/dist/esm/api/types/index.mjs +9 -5
- package/dist/esm/index.d.mts +4 -4
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +284 -56
- package/dist/cjs/api/resources/message/client/Client.d.ts +0 -22
- package/dist/cjs/api/resources/message/client/Client.js +0 -17
- package/dist/cjs/api/resources/message/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/message/index.d.ts +0 -2
- package/dist/cjs/api/resources/message/resources/index.d.ts +0 -1
- package/dist/cjs/api/resources/message/resources/index.js +0 -37
- package/dist/cjs/api/resources/message/resources/sms/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/messages/resources/send/client/Client.d.ts +0 -110
- package/dist/cjs/api/resources/messages/resources/send/types/index.d.ts +0 -3
- package/dist/cjs/api/resources/messages/resources/send/types/index.js +0 -19
- package/dist/esm/api/resources/message/client/Client.d.mts +0 -22
- package/dist/esm/api/resources/message/client/Client.mjs +0 -13
- package/dist/esm/api/resources/message/client/index.d.mts +0 -1
- package/dist/esm/api/resources/message/index.d.mts +0 -2
- package/dist/esm/api/resources/message/index.mjs +0 -2
- package/dist/esm/api/resources/message/resources/index.d.mts +0 -1
- package/dist/esm/api/resources/message/resources/index.mjs +0 -1
- package/dist/esm/api/resources/message/resources/sms/client/index.d.mts +0 -1
- package/dist/esm/api/resources/messages/resources/send/client/Client.d.mts +0 -110
- package/dist/esm/api/resources/messages/resources/send/types/index.d.mts +0 -3
- package/dist/esm/api/resources/messages/resources/send/types/index.mjs +0 -3
- /package/dist/cjs/api/resources/messages/resources/{send → mms}/client/requests/Mms.d.ts +0 -0
- /package/dist/cjs/api/resources/messages/resources/{send → mms}/client/requests/Mms.js +0 -0
- /package/dist/cjs/api/resources/{message/client → messages/resources/mms/client/requests}/index.js +0 -0
- /package/dist/cjs/api/resources/messages/resources/{send/client/requests/Sms.js → mms/types/MmsSendResponse.js} +0 -0
- /package/dist/cjs/api/resources/messages/resources/{send/types/SendMmsResponse.js → rcs/types/RcsSendResponse.js} +0 -0
- /package/dist/cjs/api/resources/messages/resources/{send → sms}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/messages/resources/{send → sms}/client/index.js +0 -0
- /package/dist/cjs/api/resources/messages/resources/{send/types/SendRcsResponse.js → sms/client/requests/Sms.js} +0 -0
- /package/dist/cjs/api/resources/{message/resources/sms/client → messages/resources/sms/client/requests}/index.js +0 -0
- /package/dist/cjs/api/resources/messages/resources/{send → sms}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/messages/resources/{send → sms}/index.js +0 -0
- /package/dist/cjs/api/resources/messages/resources/{send/types/SendSmsResponse.js → sms/types/SmsSendResponse.js} +0 -0
- /package/dist/cjs/api/{types/NullableContact.js → resources/rcs/client/requests/RcsCapabilitiesQuery.js} +0 -0
- /package/dist/cjs/api/{types/RcsButtonContent.js → resources/rcs/client/requests/RcsLinkRequest.js} +0 -0
- /package/dist/cjs/api/{types/RcsCard.js → resources/rcs/client/requests/RcsWhitelistRequest.js} +0 -0
- /package/dist/cjs/api/resources/{messages/resources/send → rcs}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/{message/resources/sms → rcs}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{message/resources/sms → rcs}/index.js +0 -0
- /package/dist/cjs/api/types/{RcsMedia.js → RcsCapabilitiesResult.js} +0 -0
- /package/dist/cjs/api/types/{RcsText.js → RcsCapability.js} +0 -0
- /package/dist/esm/api/resources/messages/resources/{send → mms}/client/requests/Mms.d.mts +0 -0
- /package/dist/esm/api/resources/messages/resources/{send → mms}/client/requests/Mms.mjs +0 -0
- /package/dist/esm/api/resources/{message/client → messages/resources/mms/client/requests}/index.mjs +0 -0
- /package/dist/esm/api/resources/messages/resources/{send/client/requests/Sms.mjs → mms/types/MmsSendResponse.mjs} +0 -0
- /package/dist/esm/api/resources/messages/resources/{send/types/SendMmsResponse.mjs → rcs/types/RcsSendResponse.mjs} +0 -0
- /package/dist/esm/api/resources/messages/resources/{send → sms}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/messages/resources/{send → sms}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/messages/resources/{send/types/SendRcsResponse.mjs → sms/client/requests/Sms.mjs} +0 -0
- /package/dist/esm/api/resources/{message/resources/sms/client → messages/resources/sms/client/requests}/index.mjs +0 -0
- /package/dist/esm/api/resources/messages/resources/{send → sms}/index.d.mts +0 -0
- /package/dist/esm/api/resources/messages/resources/{send → sms}/index.mjs +0 -0
- /package/dist/esm/api/resources/messages/resources/{send/types/SendSmsResponse.mjs → sms/types/SmsSendResponse.mjs} +0 -0
- /package/dist/esm/api/{types/NullableContact.mjs → resources/rcs/client/requests/RcsCapabilitiesQuery.mjs} +0 -0
- /package/dist/esm/api/{types/RcsButtonContent.mjs → resources/rcs/client/requests/RcsLinkRequest.mjs} +0 -0
- /package/dist/esm/api/{types/RcsCard.mjs → resources/rcs/client/requests/RcsWhitelistRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{messages/resources/send → rcs}/client/requests/index.mjs +0 -0
- /package/dist/esm/api/resources/{message/resources/sms → rcs}/index.d.mts +0 -0
- /package/dist/esm/api/resources/{message/resources/sms → rcs}/index.mjs +0 -0
- /package/dist/esm/api/types/{RcsMedia.mjs → RcsCapabilitiesResult.mjs} +0 -0
- /package/dist/esm/api/types/{RcsText.mjs → RcsCapability.mjs} +0 -0
|
@@ -29,6 +29,35 @@ export declare namespace Rcs {
|
|
|
29
29
|
export declare class Rcs {
|
|
30
30
|
protected readonly _options: Rcs.Options;
|
|
31
31
|
constructor(_options: Rcs.Options);
|
|
32
|
+
/**
|
|
33
|
+
* Send a RCS message immediately or schedule it for future delivery. <br>
|
|
34
|
+
*
|
|
35
|
+
* Requires an active RCS agent and recipient devices that support RCS Business Messaging.
|
|
36
|
+
*
|
|
37
|
+
* @param {Pinnacle.Rcs} request
|
|
38
|
+
* @param {Rcs.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
+
*
|
|
40
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
41
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
42
|
+
* @throws {@link Pinnacle.PaymentRequiredError}
|
|
43
|
+
* @throws {@link Pinnacle.NotFoundError}
|
|
44
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
45
|
+
* @throws {@link Pinnacle.NotImplementedError}
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* await client.messages.rcs.send({
|
|
49
|
+
* quickReplies: [{
|
|
50
|
+
* type: "openUrl",
|
|
51
|
+
* payload: "payload",
|
|
52
|
+
* title: "title"
|
|
53
|
+
* }],
|
|
54
|
+
* text: "text",
|
|
55
|
+
* from: "from",
|
|
56
|
+
* to: "to"
|
|
57
|
+
* })
|
|
58
|
+
*/
|
|
59
|
+
send(request: Pinnacle.Rcs, requestOptions?: Rcs.RequestOptions): core.HttpResponsePromise<Pinnacle.messages.RcsSendResponse>;
|
|
60
|
+
private __send;
|
|
32
61
|
/**
|
|
33
62
|
* Validate RCS message content without sending it.
|
|
34
63
|
*
|
|
@@ -55,6 +55,94 @@ class Rcs {
|
|
|
55
55
|
constructor(_options) {
|
|
56
56
|
this._options = _options;
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Send a RCS message immediately or schedule it for future delivery. <br>
|
|
60
|
+
*
|
|
61
|
+
* Requires an active RCS agent and recipient devices that support RCS Business Messaging.
|
|
62
|
+
*
|
|
63
|
+
* @param {Pinnacle.Rcs} request
|
|
64
|
+
* @param {Rcs.RequestOptions} requestOptions - Request-specific configuration.
|
|
65
|
+
*
|
|
66
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
67
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
68
|
+
* @throws {@link Pinnacle.PaymentRequiredError}
|
|
69
|
+
* @throws {@link Pinnacle.NotFoundError}
|
|
70
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
71
|
+
* @throws {@link Pinnacle.NotImplementedError}
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* await client.messages.rcs.send({
|
|
75
|
+
* quickReplies: [{
|
|
76
|
+
* type: "openUrl",
|
|
77
|
+
* payload: "payload",
|
|
78
|
+
* title: "title"
|
|
79
|
+
* }],
|
|
80
|
+
* text: "text",
|
|
81
|
+
* from: "from",
|
|
82
|
+
* to: "to"
|
|
83
|
+
* })
|
|
84
|
+
*/
|
|
85
|
+
send(request, requestOptions) {
|
|
86
|
+
return core.HttpResponsePromise.fromPromise(this.__send(request, requestOptions));
|
|
87
|
+
}
|
|
88
|
+
__send(request, requestOptions) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
var _a, _b, _c;
|
|
91
|
+
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);
|
|
92
|
+
const _response = yield core.fetcher({
|
|
93
|
+
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, "messages/send/rcs"),
|
|
94
|
+
method: "POST",
|
|
95
|
+
headers: _headers,
|
|
96
|
+
contentType: "application/json",
|
|
97
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
98
|
+
requestType: "json",
|
|
99
|
+
body: request,
|
|
100
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
101
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
102
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
103
|
+
});
|
|
104
|
+
if (_response.ok) {
|
|
105
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
106
|
+
}
|
|
107
|
+
if (_response.error.reason === "status-code") {
|
|
108
|
+
switch (_response.error.statusCode) {
|
|
109
|
+
case 400:
|
|
110
|
+
throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
|
|
111
|
+
case 401:
|
|
112
|
+
throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
113
|
+
case 402:
|
|
114
|
+
throw new Pinnacle.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
115
|
+
case 404:
|
|
116
|
+
throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
|
|
117
|
+
case 500:
|
|
118
|
+
throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
|
|
119
|
+
case 501:
|
|
120
|
+
throw new Pinnacle.NotImplementedError(_response.error.body, _response.rawResponse);
|
|
121
|
+
default:
|
|
122
|
+
throw new errors.PinnacleError({
|
|
123
|
+
statusCode: _response.error.statusCode,
|
|
124
|
+
body: _response.error.body,
|
|
125
|
+
rawResponse: _response.rawResponse,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
switch (_response.error.reason) {
|
|
130
|
+
case "non-json":
|
|
131
|
+
throw new errors.PinnacleError({
|
|
132
|
+
statusCode: _response.error.statusCode,
|
|
133
|
+
body: _response.error.rawBody,
|
|
134
|
+
rawResponse: _response.rawResponse,
|
|
135
|
+
});
|
|
136
|
+
case "timeout":
|
|
137
|
+
throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /messages/send/rcs.");
|
|
138
|
+
case "unknown":
|
|
139
|
+
throw new errors.PinnacleError({
|
|
140
|
+
message: _response.error.errorMessage,
|
|
141
|
+
rawResponse: _response.rawResponse,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
58
146
|
/**
|
|
59
147
|
* Validate RCS message content without sending it.
|
|
60
148
|
*
|
|
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types/index.js"), exports);
|
|
17
18
|
__exportStar(require("./client/index.js"), exports);
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Pinnacle from "../../../../../index.js";
|
|
5
|
-
export type
|
|
5
|
+
export type RcsSendResponse = Pinnacle.SentRcsDetails | Pinnacle.ScheduledMessaage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./RcsSendResponse.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("./RcsSendResponse.js"), exports);
|
|
@@ -29,6 +29,28 @@ export declare namespace Sms {
|
|
|
29
29
|
export declare class Sms {
|
|
30
30
|
protected readonly _options: Sms.Options;
|
|
31
31
|
constructor(_options: Sms.Options);
|
|
32
|
+
/**
|
|
33
|
+
* Send a SMS message immediately or schedule it for future delivery.
|
|
34
|
+
*
|
|
35
|
+
* @param {Pinnacle.messages.Sms} request
|
|
36
|
+
* @param {Sms.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
|
+
*
|
|
38
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
39
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
40
|
+
* @throws {@link Pinnacle.PaymentRequiredError}
|
|
41
|
+
* @throws {@link Pinnacle.NotFoundError}
|
|
42
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
43
|
+
* @throws {@link Pinnacle.NotImplementedError}
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* await client.messages.sms.send({
|
|
47
|
+
* from: "+14155164736",
|
|
48
|
+
* text: "Hey!",
|
|
49
|
+
* to: "+14154746461"
|
|
50
|
+
* })
|
|
51
|
+
*/
|
|
52
|
+
send(request: Pinnacle.messages.Sms, requestOptions?: Sms.RequestOptions): core.HttpResponsePromise<Pinnacle.messages.SmsSendResponse>;
|
|
53
|
+
private __send;
|
|
32
54
|
/**
|
|
33
55
|
* Validate SMS message content without sending it.
|
|
34
56
|
*
|
|
@@ -40,7 +62,7 @@ export declare class Sms {
|
|
|
40
62
|
* @throws {@link Pinnacle.InternalServerError}
|
|
41
63
|
*
|
|
42
64
|
* @example
|
|
43
|
-
* await client.
|
|
65
|
+
* await client.messages.sms.validate({
|
|
44
66
|
* text: "Hello from Pinnacle"
|
|
45
67
|
* })
|
|
46
68
|
*/
|
|
@@ -55,6 +55,87 @@ class Sms {
|
|
|
55
55
|
constructor(_options) {
|
|
56
56
|
this._options = _options;
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Send a SMS message immediately or schedule it for future delivery.
|
|
60
|
+
*
|
|
61
|
+
* @param {Pinnacle.messages.Sms} request
|
|
62
|
+
* @param {Sms.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
|
+
*
|
|
64
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
65
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
66
|
+
* @throws {@link Pinnacle.PaymentRequiredError}
|
|
67
|
+
* @throws {@link Pinnacle.NotFoundError}
|
|
68
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
69
|
+
* @throws {@link Pinnacle.NotImplementedError}
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* await client.messages.sms.send({
|
|
73
|
+
* from: "+14155164736",
|
|
74
|
+
* text: "Hey!",
|
|
75
|
+
* to: "+14154746461"
|
|
76
|
+
* })
|
|
77
|
+
*/
|
|
78
|
+
send(request, requestOptions) {
|
|
79
|
+
return core.HttpResponsePromise.fromPromise(this.__send(request, requestOptions));
|
|
80
|
+
}
|
|
81
|
+
__send(request, requestOptions) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
var _a, _b, _c;
|
|
84
|
+
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
85
|
+
const _response = yield core.fetcher({
|
|
86
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PinnacleEnvironment.Default, "messages/send/sms"),
|
|
87
|
+
method: "POST",
|
|
88
|
+
headers: _headers,
|
|
89
|
+
contentType: "application/json",
|
|
90
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
91
|
+
requestType: "json",
|
|
92
|
+
body: request,
|
|
93
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
94
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
95
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
96
|
+
});
|
|
97
|
+
if (_response.ok) {
|
|
98
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
99
|
+
}
|
|
100
|
+
if (_response.error.reason === "status-code") {
|
|
101
|
+
switch (_response.error.statusCode) {
|
|
102
|
+
case 400:
|
|
103
|
+
throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
|
|
104
|
+
case 401:
|
|
105
|
+
throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
106
|
+
case 402:
|
|
107
|
+
throw new Pinnacle.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
108
|
+
case 404:
|
|
109
|
+
throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
|
|
110
|
+
case 500:
|
|
111
|
+
throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
|
|
112
|
+
case 501:
|
|
113
|
+
throw new Pinnacle.NotImplementedError(_response.error.body, _response.rawResponse);
|
|
114
|
+
default:
|
|
115
|
+
throw new errors.PinnacleError({
|
|
116
|
+
statusCode: _response.error.statusCode,
|
|
117
|
+
body: _response.error.body,
|
|
118
|
+
rawResponse: _response.rawResponse,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
switch (_response.error.reason) {
|
|
123
|
+
case "non-json":
|
|
124
|
+
throw new errors.PinnacleError({
|
|
125
|
+
statusCode: _response.error.statusCode,
|
|
126
|
+
body: _response.error.rawBody,
|
|
127
|
+
rawResponse: _response.rawResponse,
|
|
128
|
+
});
|
|
129
|
+
case "timeout":
|
|
130
|
+
throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /messages/send/sms.");
|
|
131
|
+
case "unknown":
|
|
132
|
+
throw new errors.PinnacleError({
|
|
133
|
+
message: _response.error.errorMessage,
|
|
134
|
+
rawResponse: _response.rawResponse,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
58
139
|
/**
|
|
59
140
|
* Validate SMS message content without sending it.
|
|
60
141
|
*
|
|
@@ -66,7 +147,7 @@ class Sms {
|
|
|
66
147
|
* @throws {@link Pinnacle.InternalServerError}
|
|
67
148
|
*
|
|
68
149
|
* @example
|
|
69
|
-
* await client.
|
|
150
|
+
* await client.messages.sms.validate({
|
|
70
151
|
* text: "Hello from Pinnacle"
|
|
71
152
|
* })
|
|
72
153
|
*/
|
|
@@ -6,14 +6,14 @@ import * as Pinnacle from "../../../../../../index.js";
|
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
8
|
* from: "+14155164736",
|
|
9
|
-
* text: "Hey!
|
|
9
|
+
* text: "Hey!",
|
|
10
10
|
* to: "+14154746461"
|
|
11
11
|
* }
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* {
|
|
15
15
|
* from: "+14155164736",
|
|
16
|
-
* text: "Hey!
|
|
16
|
+
* text: "Hey!",
|
|
17
17
|
* to: "+14154746461"
|
|
18
18
|
* }
|
|
19
19
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type Sms } from "./Sms.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Pinnacle from "../../../../../index.js";
|
|
5
|
-
export type
|
|
5
|
+
export type SmsSendResponse = Pinnacle.SentSmsDetails | Pinnacle.ScheduledMessaage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SmsSendResponse.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("./SmsSendResponse.js"), exports);
|
|
@@ -29,7 +29,7 @@ export interface SearchPhoneNumberParams {
|
|
|
29
29
|
*/
|
|
30
30
|
location?: SearchPhoneNumberParams.Location;
|
|
31
31
|
/** Filter your search by digit pattern. */
|
|
32
|
-
number?: SearchPhoneNumberParams.
|
|
32
|
+
number?: SearchPhoneNumberParams.Number;
|
|
33
33
|
/** Extra search settings to control how many results you get. */
|
|
34
34
|
options?: SearchPhoneNumberParams.Options;
|
|
35
35
|
/** Types of phone numbers to return in your search. */
|
|
@@ -58,7 +58,7 @@ export declare namespace SearchPhoneNumberParams {
|
|
|
58
58
|
/**
|
|
59
59
|
* Filter your search by digit pattern.
|
|
60
60
|
*/
|
|
61
|
-
interface
|
|
61
|
+
interface Number {
|
|
62
62
|
/** Your search will return only numbers that contain this digit sequence anywhere within them. */
|
|
63
63
|
contains?: string;
|
|
64
64
|
/** Your search will return only numbers that end with these digits. */
|
|
@@ -39,6 +39,7 @@ export declare class Campaign {
|
|
|
39
39
|
* @throws {@link Pinnacle.UnauthorizedError}
|
|
40
40
|
* @throws {@link Pinnacle.NotFoundError}
|
|
41
41
|
* @throws {@link Pinnacle.InternalServerError}
|
|
42
|
+
* @throws {@link Pinnacle.NotImplementedError}
|
|
42
43
|
*
|
|
43
44
|
* @example
|
|
44
45
|
* await client.phoneNumbers.campaign.attach({
|
|
@@ -59,6 +60,7 @@ export declare class Campaign {
|
|
|
59
60
|
* @throws {@link Pinnacle.UnauthorizedError}
|
|
60
61
|
* @throws {@link Pinnacle.NotFoundError}
|
|
61
62
|
* @throws {@link Pinnacle.InternalServerError}
|
|
63
|
+
* @throws {@link Pinnacle.NotImplementedError}
|
|
62
64
|
*
|
|
63
65
|
* @example
|
|
64
66
|
* await client.phoneNumbers.campaign.detach({
|
|
@@ -65,6 +65,7 @@ class Campaign {
|
|
|
65
65
|
* @throws {@link Pinnacle.UnauthorizedError}
|
|
66
66
|
* @throws {@link Pinnacle.NotFoundError}
|
|
67
67
|
* @throws {@link Pinnacle.InternalServerError}
|
|
68
|
+
* @throws {@link Pinnacle.NotImplementedError}
|
|
68
69
|
*
|
|
69
70
|
* @example
|
|
70
71
|
* await client.phoneNumbers.campaign.attach({
|
|
@@ -105,6 +106,8 @@ class Campaign {
|
|
|
105
106
|
throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
|
|
106
107
|
case 500:
|
|
107
108
|
throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
|
|
109
|
+
case 501:
|
|
110
|
+
throw new Pinnacle.NotImplementedError(_response.error.body, _response.rawResponse);
|
|
108
111
|
default:
|
|
109
112
|
throw new errors.PinnacleError({
|
|
110
113
|
statusCode: _response.error.statusCode,
|
|
@@ -140,6 +143,7 @@ class Campaign {
|
|
|
140
143
|
* @throws {@link Pinnacle.UnauthorizedError}
|
|
141
144
|
* @throws {@link Pinnacle.NotFoundError}
|
|
142
145
|
* @throws {@link Pinnacle.InternalServerError}
|
|
146
|
+
* @throws {@link Pinnacle.NotImplementedError}
|
|
143
147
|
*
|
|
144
148
|
* @example
|
|
145
149
|
* await client.phoneNumbers.campaign.detach({
|
|
@@ -178,6 +182,8 @@ class Campaign {
|
|
|
178
182
|
throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
|
|
179
183
|
case 500:
|
|
180
184
|
throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
|
|
185
|
+
case 501:
|
|
186
|
+
throw new Pinnacle.NotImplementedError(_response.error.body, _response.rawResponse);
|
|
181
187
|
default:
|
|
182
188
|
throw new errors.PinnacleError({
|
|
183
189
|
statusCode: _response.error.statusCode,
|
|
@@ -68,6 +68,7 @@ export declare class Webhook {
|
|
|
68
68
|
* @throws {@link Pinnacle.UnauthorizedError}
|
|
69
69
|
* @throws {@link Pinnacle.NotFoundError}
|
|
70
70
|
* @throws {@link Pinnacle.InternalServerError}
|
|
71
|
+
* @throws {@link Pinnacle.NotImplementedError}
|
|
71
72
|
*
|
|
72
73
|
* @example
|
|
73
74
|
* await client.phoneNumbers.webhook.detach("+14155551234", 123)
|
|
@@ -151,6 +151,7 @@ class Webhook {
|
|
|
151
151
|
* @throws {@link Pinnacle.UnauthorizedError}
|
|
152
152
|
* @throws {@link Pinnacle.NotFoundError}
|
|
153
153
|
* @throws {@link Pinnacle.InternalServerError}
|
|
154
|
+
* @throws {@link Pinnacle.NotImplementedError}
|
|
154
155
|
*
|
|
155
156
|
* @example
|
|
156
157
|
* await client.phoneNumbers.webhook.detach("+14155551234", 123)
|
|
@@ -184,6 +185,8 @@ class Webhook {
|
|
|
184
185
|
throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
|
|
185
186
|
case 500:
|
|
186
187
|
throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
|
|
188
|
+
case 501:
|
|
189
|
+
throw new Pinnacle.NotImplementedError(_response.error.body, _response.rawResponse);
|
|
187
190
|
default:
|
|
188
191
|
throw new errors.PinnacleError({
|
|
189
192
|
statusCode: _response.error.statusCode,
|
|
@@ -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>;
|
|
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;
|
|
120
|
+
}>;
|
|
121
|
+
}
|