rcs-js 1.0.14 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +3 -0
- package/Client.js +6 -1
- package/README.md +10 -0
- package/api/resources/company/client/Client.d.ts +8 -0
- package/api/resources/company/client/Client.js +11 -3
- package/api/resources/company/client/requests/CompanyRegisterRequest.d.ts +9 -0
- package/api/resources/company/client/requests/CompanyUpdateRequest.d.ts +1 -0
- package/api/resources/index.d.ts +3 -0
- package/api/resources/index.js +4 -1
- package/api/resources/send/client/Client.js +3 -3
- package/api/resources/tools/client/Client.d.ts +61 -0
- package/api/resources/tools/client/Client.js +195 -0
- package/api/resources/tools/client/index.d.ts +1 -0
- package/api/resources/tools/client/index.js +17 -0
- package/api/resources/tools/client/requests/ToolsShortenUrlRequest.d.ts +15 -0
- package/api/resources/tools/client/requests/ToolsShortenUrlRequest.js +5 -0
- package/api/resources/tools/client/requests/ToolsUploadUrlRequest.d.ts +24 -0
- package/api/resources/tools/client/requests/ToolsUploadUrlRequest.js +5 -0
- package/api/resources/tools/client/requests/index.d.ts +2 -0
- package/api/resources/tools/client/requests/index.js +2 -0
- package/api/resources/tools/index.d.ts +2 -0
- package/api/resources/tools/index.js +18 -0
- package/api/resources/tools/types/ToolsShortenUrlResponse.d.ts +9 -0
- package/api/resources/tools/types/ToolsShortenUrlResponse.js +5 -0
- package/api/resources/tools/types/ToolsUploadUrlResponse.d.ts +9 -0
- package/api/resources/tools/types/ToolsUploadUrlResponse.js +5 -0
- package/api/resources/tools/types/index.d.ts +2 -0
- package/api/resources/tools/types/index.js +18 -0
- package/api/types/Company.d.ts +12 -0
- package/api/types/CompanyCategory.d.ts +20 -0
- package/api/types/CompanyCategory.js +22 -0
- package/api/types/CompanyDetails.d.ts +3 -0
- package/api/types/InboundActionMessage.d.ts +13 -0
- package/api/types/InboundActionMessage.js +5 -0
- package/api/types/InboundLocationMessage.d.ts +11 -0
- package/api/types/InboundLocationMessage.js +5 -0
- package/api/types/InboundLocationMessageCoordinates.d.ts +7 -0
- package/api/types/InboundLocationMessageCoordinates.js +5 -0
- package/api/types/InboundMediaMessage.d.ts +12 -0
- package/api/types/InboundMediaMessage.js +5 -0
- package/api/types/InboundMessage.d.ts +10 -0
- package/api/types/InboundMessage.js +5 -0
- package/api/types/InboundMessageMessageType.d.ts +10 -0
- package/api/types/InboundMessageMessageType.js +12 -0
- package/api/types/InboundMessageMetadata.d.ts +8 -0
- package/api/types/InboundMessageMetadata.js +5 -0
- package/api/types/InboundTextMessage.d.ts +11 -0
- package/api/types/InboundTextMessage.js +5 -0
- package/api/types/MediaPayload.d.ts +7 -0
- package/api/types/MediaPayload.js +5 -0
- package/api/types/MessageMetadata.d.ts +6 -0
- package/api/types/MessageMetadata.js +5 -0
- package/api/types/Messaging.d.ts +15 -0
- package/api/types/Messaging.js +5 -0
- package/api/types/SenderMetadata.d.ts +8 -0
- package/api/types/SenderMetadata.js +5 -0
- package/api/types/index.d.ts +13 -0
- package/api/types/index.js +13 -0
- package/dist/Client.d.ts +3 -0
- package/dist/Client.js +6 -1
- package/dist/api/resources/company/client/Client.d.ts +8 -0
- package/dist/api/resources/company/client/Client.js +11 -3
- package/dist/api/resources/company/client/requests/CompanyRegisterRequest.d.ts +9 -0
- package/dist/api/resources/company/client/requests/CompanyUpdateRequest.d.ts +1 -0
- package/dist/api/resources/index.d.ts +3 -0
- package/dist/api/resources/index.js +4 -1
- package/dist/api/resources/send/client/Client.js +3 -3
- package/dist/api/resources/tools/client/Client.d.ts +61 -0
- package/dist/api/resources/tools/client/Client.js +195 -0
- package/dist/api/resources/tools/client/index.d.ts +1 -0
- package/dist/api/resources/tools/client/index.js +17 -0
- package/dist/api/resources/tools/client/requests/ToolsShortenUrlRequest.d.ts +15 -0
- package/dist/api/resources/tools/client/requests/ToolsShortenUrlRequest.js +5 -0
- package/dist/api/resources/tools/client/requests/ToolsUploadUrlRequest.d.ts +24 -0
- package/dist/api/resources/tools/client/requests/ToolsUploadUrlRequest.js +5 -0
- package/dist/api/resources/tools/client/requests/index.d.ts +2 -0
- package/dist/api/resources/tools/client/requests/index.js +2 -0
- package/dist/api/resources/tools/index.d.ts +2 -0
- package/dist/api/resources/tools/index.js +18 -0
- package/dist/api/resources/tools/types/ToolsShortenUrlResponse.d.ts +9 -0
- package/dist/api/resources/tools/types/ToolsShortenUrlResponse.js +5 -0
- package/dist/api/resources/tools/types/ToolsUploadUrlResponse.d.ts +9 -0
- package/dist/api/resources/tools/types/ToolsUploadUrlResponse.js +5 -0
- package/dist/api/resources/tools/types/index.d.ts +2 -0
- package/dist/api/resources/tools/types/index.js +18 -0
- package/dist/api/types/Company.d.ts +12 -0
- package/dist/api/types/CompanyCategory.d.ts +20 -0
- package/dist/api/types/CompanyCategory.js +22 -0
- package/dist/api/types/CompanyDetails.d.ts +3 -0
- package/dist/api/types/InboundActionMessage.d.ts +13 -0
- package/dist/api/types/InboundActionMessage.js +5 -0
- package/dist/api/types/InboundLocationMessage.d.ts +11 -0
- package/dist/api/types/InboundLocationMessage.js +5 -0
- package/dist/api/types/InboundLocationMessageCoordinates.d.ts +7 -0
- package/dist/api/types/InboundLocationMessageCoordinates.js +5 -0
- package/dist/api/types/InboundMediaMessage.d.ts +12 -0
- package/dist/api/types/InboundMediaMessage.js +5 -0
- package/dist/api/types/InboundMessage.d.ts +10 -0
- package/dist/api/types/InboundMessage.js +5 -0
- package/dist/api/types/InboundMessageMessageType.d.ts +10 -0
- package/dist/api/types/InboundMessageMessageType.js +12 -0
- package/dist/api/types/InboundMessageMetadata.d.ts +8 -0
- package/dist/api/types/InboundMessageMetadata.js +5 -0
- package/dist/api/types/InboundTextMessage.d.ts +11 -0
- package/dist/api/types/InboundTextMessage.js +5 -0
- package/dist/api/types/MediaPayload.d.ts +7 -0
- package/dist/api/types/MediaPayload.js +5 -0
- package/dist/api/types/MessageMetadata.d.ts +6 -0
- package/dist/api/types/MessageMetadata.js +5 -0
- package/dist/api/types/Messaging.d.ts +15 -0
- package/dist/api/types/Messaging.js +5 -0
- package/dist/api/types/SenderMetadata.d.ts +8 -0
- package/dist/api/types/SenderMetadata.js +5 -0
- package/dist/api/types/index.d.ts +13 -0
- package/dist/api/types/index.js +13 -0
- package/dist/serialization/resources/company/client/requests/CompanyRegisterRequest.d.ts +2 -0
- package/dist/serialization/resources/company/client/requests/CompanyRegisterRequest.js +2 -0
- package/dist/serialization/resources/company/client/requests/CompanyUpdateRequest.d.ts +2 -0
- package/dist/serialization/resources/company/client/requests/CompanyUpdateRequest.js +2 -0
- package/dist/serialization/resources/index.d.ts +3 -0
- package/dist/serialization/resources/index.js +4 -1
- package/dist/serialization/resources/tools/client/index.d.ts +1 -0
- package/dist/serialization/resources/tools/client/index.js +17 -0
- package/dist/serialization/resources/tools/client/requests/ToolsShortenUrlRequest.d.ts +13 -0
- package/dist/serialization/resources/tools/client/requests/ToolsShortenUrlRequest.js +34 -0
- package/dist/serialization/resources/tools/client/requests/ToolsUploadUrlRequest.d.ts +14 -0
- package/dist/serialization/resources/tools/client/requests/ToolsUploadUrlRequest.js +35 -0
- package/dist/serialization/resources/tools/client/requests/index.d.ts +2 -0
- package/dist/serialization/resources/tools/client/requests/index.js +7 -0
- package/dist/serialization/resources/tools/index.d.ts +2 -0
- package/dist/serialization/resources/tools/index.js +18 -0
- package/dist/serialization/resources/tools/types/ToolsShortenUrlResponse.d.ts +13 -0
- package/dist/serialization/resources/tools/types/ToolsShortenUrlResponse.js +34 -0
- package/dist/serialization/resources/tools/types/ToolsUploadUrlResponse.d.ts +13 -0
- package/dist/serialization/resources/tools/types/ToolsUploadUrlResponse.js +34 -0
- package/dist/serialization/resources/tools/types/index.d.ts +2 -0
- package/dist/serialization/resources/tools/types/index.js +18 -0
- package/dist/serialization/types/Company.d.ts +7 -0
- package/dist/serialization/types/Company.js +7 -0
- package/dist/serialization/types/CompanyCategory.d.ts +10 -0
- package/dist/serialization/types/CompanyCategory.js +46 -0
- package/dist/serialization/types/CompanyDetails.d.ts +2 -0
- package/dist/serialization/types/CompanyDetails.js +2 -0
- package/dist/serialization/types/InboundActionMessage.d.ts +19 -0
- package/dist/serialization/types/InboundActionMessage.js +40 -0
- package/dist/serialization/types/InboundLocationMessage.d.ts +18 -0
- package/dist/serialization/types/InboundLocationMessage.js +39 -0
- package/dist/serialization/types/InboundLocationMessageCoordinates.d.ts +13 -0
- package/dist/serialization/types/InboundLocationMessageCoordinates.js +34 -0
- package/dist/serialization/types/InboundMediaMessage.d.ts +19 -0
- package/dist/serialization/types/InboundMediaMessage.js +40 -0
- package/dist/serialization/types/InboundMessage.d.ts +17 -0
- package/dist/serialization/types/InboundMessage.js +38 -0
- package/dist/serialization/types/InboundMessageMessageType.d.ts +10 -0
- package/dist/serialization/types/InboundMessageMessageType.js +31 -0
- package/dist/serialization/types/InboundMessageMetadata.d.ts +15 -0
- package/dist/serialization/types/InboundMessageMetadata.js +36 -0
- package/dist/serialization/types/InboundTextMessage.d.ts +17 -0
- package/dist/serialization/types/InboundTextMessage.js +38 -0
- package/dist/serialization/types/MediaPayload.d.ts +13 -0
- package/dist/serialization/types/MediaPayload.js +34 -0
- package/dist/serialization/types/MessageMetadata.d.ts +12 -0
- package/dist/serialization/types/MessageMetadata.js +33 -0
- package/dist/serialization/types/Messaging.d.ts +16 -0
- package/dist/serialization/types/Messaging.js +37 -0
- package/dist/serialization/types/SenderMetadata.d.ts +14 -0
- package/dist/serialization/types/SenderMetadata.js +35 -0
- package/dist/serialization/types/index.d.ts +13 -0
- package/dist/serialization/types/index.js +13 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -3
- package/reference.md +144 -0
- package/serialization/resources/company/client/requests/CompanyRegisterRequest.d.ts +2 -0
- package/serialization/resources/company/client/requests/CompanyRegisterRequest.js +2 -0
- package/serialization/resources/company/client/requests/CompanyUpdateRequest.d.ts +2 -0
- package/serialization/resources/company/client/requests/CompanyUpdateRequest.js +2 -0
- package/serialization/resources/index.d.ts +3 -0
- package/serialization/resources/index.js +4 -1
- package/serialization/resources/tools/client/index.d.ts +1 -0
- package/serialization/resources/tools/client/index.js +17 -0
- package/serialization/resources/tools/client/requests/ToolsShortenUrlRequest.d.ts +13 -0
- package/serialization/resources/tools/client/requests/ToolsShortenUrlRequest.js +34 -0
- package/serialization/resources/tools/client/requests/ToolsUploadUrlRequest.d.ts +14 -0
- package/serialization/resources/tools/client/requests/ToolsUploadUrlRequest.js +35 -0
- package/serialization/resources/tools/client/requests/index.d.ts +2 -0
- package/serialization/resources/tools/client/requests/index.js +7 -0
- package/serialization/resources/tools/index.d.ts +2 -0
- package/serialization/resources/tools/index.js +18 -0
- package/serialization/resources/tools/types/ToolsShortenUrlResponse.d.ts +13 -0
- package/serialization/resources/tools/types/ToolsShortenUrlResponse.js +34 -0
- package/serialization/resources/tools/types/ToolsUploadUrlResponse.d.ts +13 -0
- package/serialization/resources/tools/types/ToolsUploadUrlResponse.js +34 -0
- package/serialization/resources/tools/types/index.d.ts +2 -0
- package/serialization/resources/tools/types/index.js +18 -0
- package/serialization/types/Company.d.ts +7 -0
- package/serialization/types/Company.js +7 -0
- package/serialization/types/CompanyCategory.d.ts +10 -0
- package/serialization/types/CompanyCategory.js +46 -0
- package/serialization/types/CompanyDetails.d.ts +2 -0
- package/serialization/types/CompanyDetails.js +2 -0
- package/serialization/types/InboundActionMessage.d.ts +19 -0
- package/serialization/types/InboundActionMessage.js +40 -0
- package/serialization/types/InboundLocationMessage.d.ts +18 -0
- package/serialization/types/InboundLocationMessage.js +39 -0
- package/serialization/types/InboundLocationMessageCoordinates.d.ts +13 -0
- package/serialization/types/InboundLocationMessageCoordinates.js +34 -0
- package/serialization/types/InboundMediaMessage.d.ts +19 -0
- package/serialization/types/InboundMediaMessage.js +40 -0
- package/serialization/types/InboundMessage.d.ts +17 -0
- package/serialization/types/InboundMessage.js +38 -0
- package/serialization/types/InboundMessageMessageType.d.ts +10 -0
- package/serialization/types/InboundMessageMessageType.js +31 -0
- package/serialization/types/InboundMessageMetadata.d.ts +15 -0
- package/serialization/types/InboundMessageMetadata.js +36 -0
- package/serialization/types/InboundTextMessage.d.ts +17 -0
- package/serialization/types/InboundTextMessage.js +38 -0
- package/serialization/types/MediaPayload.d.ts +13 -0
- package/serialization/types/MediaPayload.js +34 -0
- package/serialization/types/MessageMetadata.d.ts +12 -0
- package/serialization/types/MessageMetadata.js +33 -0
- package/serialization/types/Messaging.d.ts +16 -0
- package/serialization/types/Messaging.js +37 -0
- package/serialization/types/SenderMetadata.d.ts +14 -0
- package/serialization/types/SenderMetadata.js +35 -0
- package/serialization/types/index.d.ts +13 -0
- package/serialization/types/index.js +13 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/Client.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import * as core from "./core";
|
|
|
6
6
|
import * as Pinnacle from "./api/index";
|
|
7
7
|
import { Company } from "./api/resources/company/client/Client";
|
|
8
8
|
import { Send } from "./api/resources/send/client/Client";
|
|
9
|
+
import { Tools } from "./api/resources/tools/client/Client";
|
|
9
10
|
export declare namespace PinnacleClient {
|
|
10
11
|
interface Options {
|
|
11
12
|
environment?: core.Supplier<environments.PinnacleEnvironment | string>;
|
|
@@ -41,6 +42,8 @@ export declare class PinnacleClient {
|
|
|
41
42
|
get company(): Company;
|
|
42
43
|
protected _send: Send | undefined;
|
|
43
44
|
get send(): Send;
|
|
45
|
+
protected _tools: Tools | undefined;
|
|
46
|
+
get tools(): Tools;
|
|
44
47
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
45
48
|
"PINNACLE-API-Key": string;
|
|
46
49
|
}>;
|
package/Client.js
CHANGED
|
@@ -47,6 +47,7 @@ const serializers = __importStar(require("./serialization/index"));
|
|
|
47
47
|
const errors = __importStar(require("./errors/index"));
|
|
48
48
|
const Client_1 = require("./api/resources/company/client/Client");
|
|
49
49
|
const Client_2 = require("./api/resources/send/client/Client");
|
|
50
|
+
const Client_3 = require("./api/resources/tools/client/Client");
|
|
50
51
|
class PinnacleClient {
|
|
51
52
|
constructor(_options) {
|
|
52
53
|
this._options = _options;
|
|
@@ -75,7 +76,7 @@ class PinnacleClient {
|
|
|
75
76
|
const _response = yield core.fetcher({
|
|
76
77
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "rcs_functionality"),
|
|
77
78
|
method: "GET",
|
|
78
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.
|
|
79
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
79
80
|
contentType: "application/json",
|
|
80
81
|
queryParameters: _queryParams,
|
|
81
82
|
requestType: "json",
|
|
@@ -129,6 +130,10 @@ class PinnacleClient {
|
|
|
129
130
|
var _a;
|
|
130
131
|
return ((_a = this._send) !== null && _a !== void 0 ? _a : (this._send = new Client_2.Send(this._options)));
|
|
131
132
|
}
|
|
133
|
+
get tools() {
|
|
134
|
+
var _a;
|
|
135
|
+
return ((_a = this._tools) !== null && _a !== void 0 ? _a : (this._tools = new Client_3.Tools(this._options)));
|
|
136
|
+
}
|
|
132
137
|
_getCustomAuthorizationHeaders() {
|
|
133
138
|
return __awaiter(this, void 0, void 0, function* () {
|
|
134
139
|
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
package/README.md
CHANGED
|
@@ -22,6 +22,7 @@ const client = new PinnacleClient({ apiKey: "YOUR_API_KEY" });
|
|
|
22
22
|
await client.company.register({
|
|
23
23
|
company: {
|
|
24
24
|
name: "name",
|
|
25
|
+
category: "Entertainment",
|
|
25
26
|
address: "address",
|
|
26
27
|
ein: "ein",
|
|
27
28
|
description: "description",
|
|
@@ -39,6 +40,15 @@ await client.company.register({
|
|
|
39
40
|
privacyPolicyUrl: "privacyPolicyUrl",
|
|
40
41
|
tosUrl: "tosUrl",
|
|
41
42
|
},
|
|
43
|
+
messaging: {
|
|
44
|
+
optIn: "By opting in, you agree to receive messages from Pinnacle, including updates and promotions. Reply \u201CSTOP\u201D to unsubscribe. Standard message and data rates may apply.",
|
|
45
|
+
optOut: "Reply with keywords like STOP or UNSUBSCRIBE to opt-out. A confirmation message will be sent, and no further messages will be received unless you re-subscribe.",
|
|
46
|
+
optOutKeywords: ["STOP", "UNSUBSCRIBE"],
|
|
47
|
+
agentUseCase:
|
|
48
|
+
"Pinnacle\u2019s agent assists with product updates, promotions, order tracking, and support. It answers FAQs, provides order updates, and helps with opt-in/out processes. Escalates to live support when needed.",
|
|
49
|
+
expectedAgentResponses:
|
|
50
|
+
"General Inquiry: \u201CHow can I assist you today?\u201D\nOrder Status: \u201CProvide your order number.\u201D\nOpt-In: \u201CYou\u2019re now subscribed!\u201D\nOpt-Out: \u201CYou have unsubscribed.\u201D\nEscalation: \u201CConnecting to a live agent.\u201D \n",
|
|
51
|
+
},
|
|
42
52
|
pointOfContact: {
|
|
43
53
|
pocName: "pocName",
|
|
44
54
|
pocTitle: "pocTitle",
|
|
@@ -50,6 +50,7 @@ export declare class Company {
|
|
|
50
50
|
* await client.company.register({
|
|
51
51
|
* company: {
|
|
52
52
|
* name: "name",
|
|
53
|
+
* category: "Entertainment",
|
|
53
54
|
* address: "address",
|
|
54
55
|
* ein: "ein",
|
|
55
56
|
* description: "description",
|
|
@@ -67,6 +68,13 @@ export declare class Company {
|
|
|
67
68
|
* privacyPolicyUrl: "privacyPolicyUrl",
|
|
68
69
|
* tosUrl: "tosUrl"
|
|
69
70
|
* },
|
|
71
|
+
* messaging: {
|
|
72
|
+
* optIn: "By opting in, you agree to receive messages from Pinnacle, including updates and promotions. Reply \u201CSTOP\u201D to unsubscribe. Standard message and data rates may apply.",
|
|
73
|
+
* optOut: "Reply with keywords like STOP or UNSUBSCRIBE to opt-out. A confirmation message will be sent, and no further messages will be received unless you re-subscribe.",
|
|
74
|
+
* optOutKeywords: ["STOP", "UNSUBSCRIBE"],
|
|
75
|
+
* agentUseCase: "Pinnacle\u2019s agent assists with product updates, promotions, order tracking, and support. It answers FAQs, provides order updates, and helps with opt-in/out processes. Escalates to live support when needed.",
|
|
76
|
+
* expectedAgentResponses: "General Inquiry: \u201CHow can I assist you today?\u201D\nOrder Status: \u201CProvide your order number.\u201D\nOpt-In: \u201CYou\u2019re now subscribed!\u201D\nOpt-Out: \u201CYou have unsubscribed.\u201D\nEscalation: \u201CConnecting to a live agent.\u201D \n"
|
|
77
|
+
* },
|
|
70
78
|
* pointOfContact: {
|
|
71
79
|
* pocName: "pocName",
|
|
72
80
|
* pocTitle: "pocTitle",
|
|
@@ -76,7 +76,7 @@ class Company {
|
|
|
76
76
|
const _response = yield core.fetcher({
|
|
77
77
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "company"),
|
|
78
78
|
method: "GET",
|
|
79
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.
|
|
79
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
80
80
|
contentType: "application/json",
|
|
81
81
|
queryParameters: _queryParams,
|
|
82
82
|
requestType: "json",
|
|
@@ -137,6 +137,7 @@ class Company {
|
|
|
137
137
|
* await client.company.register({
|
|
138
138
|
* company: {
|
|
139
139
|
* name: "name",
|
|
140
|
+
* category: "Entertainment",
|
|
140
141
|
* address: "address",
|
|
141
142
|
* ein: "ein",
|
|
142
143
|
* description: "description",
|
|
@@ -154,6 +155,13 @@ class Company {
|
|
|
154
155
|
* privacyPolicyUrl: "privacyPolicyUrl",
|
|
155
156
|
* tosUrl: "tosUrl"
|
|
156
157
|
* },
|
|
158
|
+
* messaging: {
|
|
159
|
+
* optIn: "By opting in, you agree to receive messages from Pinnacle, including updates and promotions. Reply \u201CSTOP\u201D to unsubscribe. Standard message and data rates may apply.",
|
|
160
|
+
* optOut: "Reply with keywords like STOP or UNSUBSCRIBE to opt-out. A confirmation message will be sent, and no further messages will be received unless you re-subscribe.",
|
|
161
|
+
* optOutKeywords: ["STOP", "UNSUBSCRIBE"],
|
|
162
|
+
* agentUseCase: "Pinnacle\u2019s agent assists with product updates, promotions, order tracking, and support. It answers FAQs, provides order updates, and helps with opt-in/out processes. Escalates to live support when needed.",
|
|
163
|
+
* expectedAgentResponses: "General Inquiry: \u201CHow can I assist you today?\u201D\nOrder Status: \u201CProvide your order number.\u201D\nOpt-In: \u201CYou\u2019re now subscribed!\u201D\nOpt-Out: \u201CYou have unsubscribed.\u201D\nEscalation: \u201CConnecting to a live agent.\u201D \n"
|
|
164
|
+
* },
|
|
157
165
|
* pointOfContact: {
|
|
158
166
|
* pocName: "pocName",
|
|
159
167
|
* pocTitle: "pocTitle",
|
|
@@ -167,7 +175,7 @@ class Company {
|
|
|
167
175
|
const _response = yield core.fetcher({
|
|
168
176
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "company/register"),
|
|
169
177
|
method: "POST",
|
|
170
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.
|
|
178
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
171
179
|
contentType: "application/json",
|
|
172
180
|
requestType: "json",
|
|
173
181
|
body: serializers.CompanyRegisterRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -236,7 +244,7 @@ class Company {
|
|
|
236
244
|
const _response = yield core.fetcher({
|
|
237
245
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "company/update"),
|
|
238
246
|
method: "POST",
|
|
239
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.
|
|
247
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
240
248
|
contentType: "application/json",
|
|
241
249
|
requestType: "json",
|
|
242
250
|
body: serializers.CompanyUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -7,6 +7,7 @@ import * as Pinnacle from "../../../../index";
|
|
|
7
7
|
* {
|
|
8
8
|
* company: {
|
|
9
9
|
* name: "name",
|
|
10
|
+
* category: "Entertainment",
|
|
10
11
|
* address: "address",
|
|
11
12
|
* ein: "ein",
|
|
12
13
|
* description: "description",
|
|
@@ -24,6 +25,13 @@ import * as Pinnacle from "../../../../index";
|
|
|
24
25
|
* privacyPolicyUrl: "privacyPolicyUrl",
|
|
25
26
|
* tosUrl: "tosUrl"
|
|
26
27
|
* },
|
|
28
|
+
* messaging: {
|
|
29
|
+
* optIn: "By opting in, you agree to receive messages from Pinnacle, including updates and promotions. Reply \u201CSTOP\u201D to unsubscribe. Standard message and data rates may apply.",
|
|
30
|
+
* optOut: "Reply with keywords like STOP or UNSUBSCRIBE to opt-out. A confirmation message will be sent, and no further messages will be received unless you re-subscribe.",
|
|
31
|
+
* optOutKeywords: ["STOP", "UNSUBSCRIBE"],
|
|
32
|
+
* agentUseCase: "Pinnacle\u2019s agent assists with product updates, promotions, order tracking, and support. It answers FAQs, provides order updates, and helps with opt-in/out processes. Escalates to live support when needed.",
|
|
33
|
+
* expectedAgentResponses: "General Inquiry: \u201CHow can I assist you today?\u201D\nOrder Status: \u201CProvide your order number.\u201D\nOpt-In: \u201CYou\u2019re now subscribed!\u201D\nOpt-Out: \u201CYou have unsubscribed.\u201D\nEscalation: \u201CConnecting to a live agent.\u201D \n"
|
|
34
|
+
* },
|
|
27
35
|
* pointOfContact: {
|
|
28
36
|
* pocName: "pocName",
|
|
29
37
|
* pocTitle: "pocTitle",
|
|
@@ -34,6 +42,7 @@ import * as Pinnacle from "../../../../index";
|
|
|
34
42
|
export interface CompanyRegisterRequest {
|
|
35
43
|
company: Pinnacle.CompanyDetails;
|
|
36
44
|
companyContact: Pinnacle.CompanyContact;
|
|
45
|
+
messaging: Pinnacle.Messaging;
|
|
37
46
|
pointOfContact: Pinnacle.PointOfContact;
|
|
38
47
|
optionals?: Pinnacle.Optionals;
|
|
39
48
|
}
|
package/api/resources/index.d.ts
CHANGED
|
@@ -2,5 +2,8 @@ export * as company from "./company";
|
|
|
2
2
|
export * from "./company/types";
|
|
3
3
|
export * as send from "./send";
|
|
4
4
|
export * from "./send/types";
|
|
5
|
+
export * as tools from "./tools";
|
|
6
|
+
export * from "./tools/types";
|
|
5
7
|
export * from "./company/client/requests";
|
|
6
8
|
export * from "./send/client/requests";
|
|
9
|
+
export * from "./tools/client/requests";
|
package/api/resources/index.js
CHANGED
|
@@ -26,10 +26,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
26
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.send = exports.company = void 0;
|
|
29
|
+
exports.tools = exports.send = exports.company = void 0;
|
|
30
30
|
exports.company = __importStar(require("./company"));
|
|
31
31
|
__exportStar(require("./company/types"), exports);
|
|
32
32
|
exports.send = __importStar(require("./send"));
|
|
33
33
|
__exportStar(require("./send/types"), exports);
|
|
34
|
+
exports.tools = __importStar(require("./tools"));
|
|
35
|
+
__exportStar(require("./tools/types"), exports);
|
|
34
36
|
__exportStar(require("./company/client/requests"), exports);
|
|
35
37
|
__exportStar(require("./send/client/requests"), exports);
|
|
38
|
+
__exportStar(require("./tools/client/requests"), exports);
|
|
@@ -75,7 +75,7 @@ class Send {
|
|
|
75
75
|
const _response = yield core.fetcher({
|
|
76
76
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "send/rcs"),
|
|
77
77
|
method: "POST",
|
|
78
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.
|
|
78
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
79
79
|
contentType: "application/json",
|
|
80
80
|
requestType: "json",
|
|
81
81
|
body: serializers.Rcs.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -150,7 +150,7 @@ class Send {
|
|
|
150
150
|
const _response = yield core.fetcher({
|
|
151
151
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "send/sms"),
|
|
152
152
|
method: "POST",
|
|
153
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.
|
|
153
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
154
154
|
contentType: "application/json",
|
|
155
155
|
requestType: "json",
|
|
156
156
|
body: serializers.SendSmsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -225,7 +225,7 @@ class Send {
|
|
|
225
225
|
const _response = yield core.fetcher({
|
|
226
226
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "send/mms"),
|
|
227
227
|
method: "POST",
|
|
228
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.
|
|
228
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
229
229
|
contentType: "application/json",
|
|
230
230
|
requestType: "json",
|
|
231
231
|
body: serializers.SendMmsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments";
|
|
5
|
+
import * as core from "../../../../core";
|
|
6
|
+
import * as Pinnacle from "../../../index";
|
|
7
|
+
export declare namespace Tools {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.PinnacleEnvironment | string>;
|
|
10
|
+
apiKey: core.Supplier<string>;
|
|
11
|
+
}
|
|
12
|
+
interface RequestOptions {
|
|
13
|
+
/** The maximum time to wait for a response in seconds. */
|
|
14
|
+
timeoutInSeconds?: number;
|
|
15
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
16
|
+
maxRetries?: number;
|
|
17
|
+
/** A hook to abort the request. */
|
|
18
|
+
abortSignal?: AbortSignal;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export declare class Tools {
|
|
22
|
+
protected readonly _options: Tools.Options;
|
|
23
|
+
constructor(_options: Tools.Options);
|
|
24
|
+
/**
|
|
25
|
+
* Create a shortened URL with an optional expiration date (default and max expiration is 90 days). The shortened URL will redirect to the original URL and will have the following format https://urls.p1n.io/ABCD5678.
|
|
26
|
+
*
|
|
27
|
+
* @param {Pinnacle.ToolsShortenUrlRequest} request
|
|
28
|
+
* @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
|
+
*
|
|
30
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
31
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
32
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* await client.tools.shortenUrl({
|
|
36
|
+
* url: "https://example.com"
|
|
37
|
+
* })
|
|
38
|
+
*/
|
|
39
|
+
shortenUrl(request: Pinnacle.ToolsShortenUrlRequest, requestOptions?: Tools.RequestOptions): Promise<Pinnacle.ToolsShortenUrlResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Generate signed upload (expires in 2 hours) and download URLs for a file (expires in 1 hour).
|
|
42
|
+
*
|
|
43
|
+
* @param {Pinnacle.ToolsUploadUrlRequest} request
|
|
44
|
+
* @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
|
|
45
|
+
*
|
|
46
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
47
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
48
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* await client.tools.uploadUrl({
|
|
52
|
+
* contentType: "image/png",
|
|
53
|
+
* size: 1024,
|
|
54
|
+
* name: "example.png"
|
|
55
|
+
* })
|
|
56
|
+
*/
|
|
57
|
+
uploadUrl(request: Pinnacle.ToolsUploadUrlRequest, requestOptions?: Tools.RequestOptions): Promise<Pinnacle.ToolsUploadUrlResponse>;
|
|
58
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
59
|
+
"PINNACLE-API-Key": string;
|
|
60
|
+
}>;
|
|
61
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
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 (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
38
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.Tools = void 0;
|
|
42
|
+
const environments = __importStar(require("../../../../environments"));
|
|
43
|
+
const core = __importStar(require("../../../../core"));
|
|
44
|
+
const Pinnacle = __importStar(require("../../../index"));
|
|
45
|
+
const serializers = __importStar(require("../../../../serialization/index"));
|
|
46
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
47
|
+
const errors = __importStar(require("../../../../errors/index"));
|
|
48
|
+
class Tools {
|
|
49
|
+
constructor(_options) {
|
|
50
|
+
this._options = _options;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Create a shortened URL with an optional expiration date (default and max expiration is 90 days). The shortened URL will redirect to the original URL and will have the following format https://urls.p1n.io/ABCD5678.
|
|
54
|
+
*
|
|
55
|
+
* @param {Pinnacle.ToolsShortenUrlRequest} request
|
|
56
|
+
* @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
|
+
*
|
|
58
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
59
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
60
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* await client.tools.shortenUrl({
|
|
64
|
+
* url: "https://example.com"
|
|
65
|
+
* })
|
|
66
|
+
*/
|
|
67
|
+
shortenUrl(request, requestOptions) {
|
|
68
|
+
var _a;
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const _response = yield core.fetcher({
|
|
71
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "tools/urls/shorten"),
|
|
72
|
+
method: "POST",
|
|
73
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
74
|
+
contentType: "application/json",
|
|
75
|
+
requestType: "json",
|
|
76
|
+
body: serializers.ToolsShortenUrlRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
77
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
78
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
79
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
80
|
+
});
|
|
81
|
+
if (_response.ok) {
|
|
82
|
+
return serializers.ToolsShortenUrlResponse.parseOrThrow(_response.body, {
|
|
83
|
+
unrecognizedObjectKeys: "passthrough",
|
|
84
|
+
allowUnrecognizedUnionMembers: true,
|
|
85
|
+
allowUnrecognizedEnumValues: true,
|
|
86
|
+
breadcrumbsPrefix: ["response"],
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
if (_response.error.reason === "status-code") {
|
|
90
|
+
switch (_response.error.statusCode) {
|
|
91
|
+
case 400:
|
|
92
|
+
throw new Pinnacle.BadRequestError(_response.error.body);
|
|
93
|
+
case 401:
|
|
94
|
+
throw new Pinnacle.UnauthorizedError(_response.error.body);
|
|
95
|
+
case 500:
|
|
96
|
+
throw new Pinnacle.InternalServerError(_response.error.body);
|
|
97
|
+
default:
|
|
98
|
+
throw new errors.PinnacleError({
|
|
99
|
+
statusCode: _response.error.statusCode,
|
|
100
|
+
body: _response.error.body,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
switch (_response.error.reason) {
|
|
105
|
+
case "non-json":
|
|
106
|
+
throw new errors.PinnacleError({
|
|
107
|
+
statusCode: _response.error.statusCode,
|
|
108
|
+
body: _response.error.rawBody,
|
|
109
|
+
});
|
|
110
|
+
case "timeout":
|
|
111
|
+
throw new errors.PinnacleTimeoutError();
|
|
112
|
+
case "unknown":
|
|
113
|
+
throw new errors.PinnacleError({
|
|
114
|
+
message: _response.error.errorMessage,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Generate signed upload (expires in 2 hours) and download URLs for a file (expires in 1 hour).
|
|
121
|
+
*
|
|
122
|
+
* @param {Pinnacle.ToolsUploadUrlRequest} request
|
|
123
|
+
* @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
|
|
124
|
+
*
|
|
125
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
126
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
127
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* await client.tools.uploadUrl({
|
|
131
|
+
* contentType: "image/png",
|
|
132
|
+
* size: 1024,
|
|
133
|
+
* name: "example.png"
|
|
134
|
+
* })
|
|
135
|
+
*/
|
|
136
|
+
uploadUrl(request, requestOptions) {
|
|
137
|
+
var _a;
|
|
138
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
const _response = yield core.fetcher({
|
|
140
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "tools/uploadUrl"),
|
|
141
|
+
method: "POST",
|
|
142
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
143
|
+
contentType: "application/json",
|
|
144
|
+
requestType: "json",
|
|
145
|
+
body: serializers.ToolsUploadUrlRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
146
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
147
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
148
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
149
|
+
});
|
|
150
|
+
if (_response.ok) {
|
|
151
|
+
return serializers.ToolsUploadUrlResponse.parseOrThrow(_response.body, {
|
|
152
|
+
unrecognizedObjectKeys: "passthrough",
|
|
153
|
+
allowUnrecognizedUnionMembers: true,
|
|
154
|
+
allowUnrecognizedEnumValues: true,
|
|
155
|
+
breadcrumbsPrefix: ["response"],
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
if (_response.error.reason === "status-code") {
|
|
159
|
+
switch (_response.error.statusCode) {
|
|
160
|
+
case 400:
|
|
161
|
+
throw new Pinnacle.BadRequestError(_response.error.body);
|
|
162
|
+
case 401:
|
|
163
|
+
throw new Pinnacle.UnauthorizedError(_response.error.body);
|
|
164
|
+
case 500:
|
|
165
|
+
throw new Pinnacle.InternalServerError(_response.error.body);
|
|
166
|
+
default:
|
|
167
|
+
throw new errors.PinnacleError({
|
|
168
|
+
statusCode: _response.error.statusCode,
|
|
169
|
+
body: _response.error.body,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
switch (_response.error.reason) {
|
|
174
|
+
case "non-json":
|
|
175
|
+
throw new errors.PinnacleError({
|
|
176
|
+
statusCode: _response.error.statusCode,
|
|
177
|
+
body: _response.error.rawBody,
|
|
178
|
+
});
|
|
179
|
+
case "timeout":
|
|
180
|
+
throw new errors.PinnacleTimeoutError();
|
|
181
|
+
case "unknown":
|
|
182
|
+
throw new errors.PinnacleError({
|
|
183
|
+
message: _response.error.errorMessage,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
_getCustomAuthorizationHeaders() {
|
|
189
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
190
|
+
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
191
|
+
return { "PINNACLE-API-Key": apiKeyValue };
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
exports.Tools = Tools;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests";
|
|
@@ -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"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* url: "https://example.com"
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface ToolsShortenUrlRequest {
|
|
11
|
+
/** The URL to be shortened. Must be a valid URL with either http or https protocol. */
|
|
12
|
+
url: string;
|
|
13
|
+
/** Optional expiration date for the shortened URL in ISO 8601 format. Default and max expiration is 90 days. */
|
|
14
|
+
expiresAt?: Date;
|
|
15
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* contentType: "image/png",
|
|
8
|
+
* size: 1024,
|
|
9
|
+
* name: "example.png"
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
export interface ToolsUploadUrlRequest {
|
|
13
|
+
/**
|
|
14
|
+
* The MIME type of the file.
|
|
15
|
+
*
|
|
16
|
+
* Supported types are audio/basic, audio/L24, audio/mp4, audio/mpeg, audio/mpg, audio/mp3, audio/ogg, audio/aac, audio/vndrn-realaudio, audio/vndwave, audio/3gpp, audio/3gpp2, audio/ac3, audio/webm, audio/amrnb, audio/amr, video/mpeg, video/mp4, video/quicktime, video/webm, video/3gpp, video/3gpp2, video/3gpptt, video/H261, video/H263, video/H2631998, video/H2632000, video/H264, video/m4v, video/mpeg4, video/webm, image/jpeg, image/gif, image/png, image/gif, image/bmp, image/tiff, image/webp, text/vcard, text/xvcard, text/csv, text/rtf, text/richtext, text/calendar, text/directory, application/ogg, application/pdf, application/vcard, application/vndapple.pkpass.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
contentType: string;
|
|
20
|
+
/** The size of the file in bytes. Should be less than 100 MB. */
|
|
21
|
+
size: number;
|
|
22
|
+
/** The name of the file. */
|
|
23
|
+
name: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./types"), exports);
|
|
18
|
+
__exportStar(require("./client"), exports);
|