rcs-js 2.0.7 → 2.0.9
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.js +2 -2
- package/dist/cjs/api/resources/brands/client/Client.d.ts +4 -21
- package/dist/cjs/api/resources/brands/client/Client.js +5 -22
- package/dist/cjs/api/resources/brands/client/requests/UpsertBrandParams.d.ts +58 -5
- package/dist/cjs/api/resources/brands/client/requests/UpsertBrandParams.js +40 -0
- package/dist/cjs/api/resources/brands/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/messages/client/Client.d.ts +6 -21
- package/dist/cjs/api/resources/messages/client/Client.js +16 -84
- package/dist/cjs/api/resources/messages/resources/blast/client/Client.d.ts +105 -0
- package/dist/cjs/api/resources/messages/resources/blast/client/Client.js +325 -0
- package/dist/cjs/api/resources/messages/resources/blast/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/messages/resources/blast/client/index.js +17 -0
- package/dist/cjs/api/resources/messages/resources/blast/client/requests/BlastMms.d.ts +61 -0
- package/dist/cjs/api/resources/messages/resources/blast/client/requests/BlastRcs.d.ts +110 -0
- package/dist/cjs/api/resources/messages/resources/blast/client/requests/BlastRcs.js +23 -0
- package/dist/cjs/api/resources/messages/resources/blast/client/requests/BlastSms.d.ts +47 -0
- package/dist/cjs/api/resources/messages/resources/blast/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/messages/resources/blast/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/messages/resources/blast/index.d.ts +2 -0
- package/dist/cjs/api/resources/messages/resources/blast/index.js +18 -0
- package/dist/cjs/api/resources/messages/resources/blast/types/BlastMmsResponse.d.ts +2 -0
- package/dist/cjs/api/resources/messages/resources/blast/types/BlastRcsResponse.d.ts +2 -0
- package/dist/cjs/api/resources/messages/resources/blast/types/BlastRcsResponse.js +3 -0
- package/dist/cjs/api/resources/messages/resources/blast/types/BlastSmsResponse.d.ts +2 -0
- package/dist/cjs/api/resources/messages/resources/blast/types/BlastSmsResponse.js +3 -0
- package/dist/cjs/api/resources/messages/resources/blast/types/index.d.ts +3 -0
- package/dist/cjs/api/resources/messages/resources/blast/types/index.js +19 -0
- package/dist/cjs/api/resources/messages/resources/index.d.ts +4 -0
- package/dist/cjs/api/resources/messages/resources/index.js +5 -1
- package/dist/cjs/api/resources/messages/resources/schedule/client/Client.d.ts +32 -0
- package/dist/cjs/api/resources/messages/resources/schedule/client/Client.js +135 -0
- package/dist/cjs/api/resources/messages/resources/schedule/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/messages/resources/schedule/client/index.js +2 -0
- package/dist/cjs/api/resources/messages/resources/schedule/index.d.ts +1 -0
- package/dist/cjs/api/resources/messages/resources/schedule/index.js +17 -0
- package/dist/cjs/api/types/BlastDetails.d.ts +17 -0
- package/dist/cjs/api/types/BlastDetails.js +3 -0
- package/dist/cjs/api/types/DlcCampaignWithExtendedBrandAndStatus.d.ts +42 -0
- package/dist/cjs/api/types/DlcCampaignWithExtendedBrandAndStatus.js +32 -0
- package/dist/cjs/api/types/MessageSchedule.d.ts +25 -11
- package/dist/cjs/api/types/MessageStatusEnum.d.ts +1 -0
- package/dist/cjs/api/types/MessageStatusEnum.js +1 -0
- package/dist/cjs/api/types/ScheduleCancelResult.d.ts +7 -0
- package/dist/cjs/api/types/ScheduleCancelResult.js +3 -0
- package/dist/cjs/api/types/ScheduledBlastDetails.d.ts +24 -0
- package/dist/cjs/api/types/ScheduledBlastDetails.js +3 -0
- package/dist/cjs/api/types/index.d.ts +3 -2
- package/dist/cjs/api/types/index.js +3 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/brands/client/Client.d.mts +4 -21
- package/dist/esm/api/resources/brands/client/Client.mjs +5 -22
- package/dist/esm/api/resources/brands/client/requests/UpsertBrandParams.d.mts +58 -5
- package/dist/esm/api/resources/brands/client/requests/UpsertBrandParams.mjs +39 -1
- package/dist/esm/api/resources/brands/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/messages/client/Client.d.mts +6 -21
- package/dist/esm/api/resources/messages/client/Client.mjs +10 -78
- package/dist/esm/api/resources/messages/resources/blast/client/Client.d.mts +105 -0
- package/dist/esm/api/resources/messages/resources/blast/client/Client.mjs +288 -0
- package/dist/esm/api/resources/messages/resources/blast/client/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/resources/blast/client/index.mjs +1 -0
- package/dist/esm/api/resources/messages/resources/blast/client/requests/BlastMms.d.mts +61 -0
- package/dist/esm/api/resources/messages/resources/blast/client/requests/BlastRcs.d.mts +110 -0
- package/dist/esm/api/resources/messages/resources/blast/client/requests/BlastRcs.mjs +20 -0
- package/dist/esm/api/resources/messages/resources/blast/client/requests/BlastSms.d.mts +47 -0
- package/dist/esm/api/resources/messages/resources/blast/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/messages/resources/blast/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/messages/resources/blast/index.d.mts +2 -0
- package/dist/esm/api/resources/messages/resources/blast/index.mjs +2 -0
- package/dist/esm/api/resources/messages/resources/blast/types/BlastMmsResponse.d.mts +2 -0
- package/dist/esm/api/resources/messages/resources/blast/types/BlastRcsResponse.d.mts +2 -0
- package/dist/esm/api/resources/messages/resources/blast/types/BlastRcsResponse.mjs +2 -0
- package/dist/esm/api/resources/messages/resources/blast/types/BlastSmsResponse.d.mts +2 -0
- package/dist/esm/api/resources/messages/resources/blast/types/BlastSmsResponse.mjs +2 -0
- package/dist/esm/api/resources/messages/resources/blast/types/index.d.mts +3 -0
- package/dist/esm/api/resources/messages/resources/blast/types/index.mjs +3 -0
- package/dist/esm/api/resources/messages/resources/index.d.mts +4 -0
- package/dist/esm/api/resources/messages/resources/index.mjs +4 -0
- package/dist/esm/api/resources/messages/resources/schedule/client/Client.d.mts +32 -0
- package/dist/esm/api/resources/messages/resources/schedule/client/Client.mjs +98 -0
- package/dist/esm/api/resources/messages/resources/schedule/client/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/resources/schedule/client/index.mjs +1 -0
- package/dist/esm/api/resources/messages/resources/schedule/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/resources/schedule/index.mjs +1 -0
- package/dist/esm/api/types/BlastDetails.d.mts +17 -0
- package/dist/esm/api/types/BlastDetails.mjs +2 -0
- package/dist/esm/api/types/DlcCampaignWithExtendedBrandAndStatus.d.mts +42 -0
- package/dist/esm/api/types/DlcCampaignWithExtendedBrandAndStatus.mjs +31 -1
- package/dist/esm/api/types/MessageSchedule.d.mts +25 -11
- package/dist/esm/api/types/MessageStatusEnum.d.mts +1 -0
- package/dist/esm/api/types/MessageStatusEnum.mjs +1 -0
- package/dist/esm/api/types/ScheduleCancelResult.d.mts +7 -0
- package/dist/esm/api/types/ScheduleCancelResult.mjs +2 -0
- package/dist/esm/api/types/ScheduledBlastDetails.d.mts +24 -0
- package/dist/esm/api/types/ScheduledBlastDetails.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +3 -2
- package/dist/esm/api/types/index.mjs +3 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +301 -87
- package/dist/cjs/api/resources/brands/client/requests/ValidateBrandParams.d.ts +0 -59
- package/dist/cjs/api/types/CancelScheduledMessageResponse.d.ts +0 -4
- package/dist/cjs/api/types/UpsertContact.d.ts +0 -13
- package/dist/esm/api/resources/brands/client/requests/ValidateBrandParams.d.mts +0 -59
- package/dist/esm/api/types/CancelScheduledMessageResponse.d.mts +0 -4
- package/dist/esm/api/types/UpsertContact.d.mts +0 -13
- /package/dist/cjs/api/resources/{brands/client/requests/ValidateBrandParams.js → messages/resources/blast/client/requests/BlastMms.js} +0 -0
- /package/dist/cjs/api/{types/CancelScheduledMessageResponse.js → resources/messages/resources/blast/client/requests/BlastSms.js} +0 -0
- /package/dist/cjs/api/{types/UpsertContact.js → resources/messages/resources/blast/types/BlastMmsResponse.js} +0 -0
- /package/dist/esm/api/resources/{brands/client/requests/ValidateBrandParams.mjs → messages/resources/blast/client/requests/BlastMms.mjs} +0 -0
- /package/dist/esm/api/{types/CancelScheduledMessageResponse.mjs → resources/messages/resources/blast/client/requests/BlastSms.mjs} +0 -0
- /package/dist/esm/api/{types/UpsertContact.mjs → resources/messages/resources/blast/types/BlastMmsResponse.mjs} +0 -0
package/dist/cjs/Client.js
CHANGED
|
@@ -53,8 +53,8 @@ class PinnacleClient {
|
|
|
53
53
|
this._options = Object.assign(Object.assign({}, _options), { logging: core.logging.createLogger(_options === null || _options === void 0 ? void 0 : _options.logging), headers: (0, headers_js_1.mergeHeaders)({
|
|
54
54
|
"X-Fern-Language": "JavaScript",
|
|
55
55
|
"X-Fern-SDK-Name": "rcs-js",
|
|
56
|
-
"X-Fern-SDK-Version": "2.0.
|
|
57
|
-
"User-Agent": "rcs-js/2.0.
|
|
56
|
+
"X-Fern-SDK-Version": "2.0.9",
|
|
57
|
+
"User-Agent": "rcs-js/2.0.9",
|
|
58
58
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
59
59
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
60
60
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -63,7 +63,7 @@ export declare class Brands {
|
|
|
63
63
|
* website: "https://www.pinnacle.sh"
|
|
64
64
|
* })
|
|
65
65
|
*/
|
|
66
|
-
upsert(request
|
|
66
|
+
upsert(request?: Pinnacle.UpsertBrandParams, requestOptions?: Brands.RequestOptions): core.HttpResponsePromise<Pinnacle.ExtendedBrand>;
|
|
67
67
|
private __upsert;
|
|
68
68
|
/**
|
|
69
69
|
* Retrieve detailed information for a specific brand in your account by ID.
|
|
@@ -105,7 +105,7 @@ export declare class Brands {
|
|
|
105
105
|
/**
|
|
106
106
|
* Validate your brand information for compliance and correctness before submission or storage.
|
|
107
107
|
*
|
|
108
|
-
* @param {Pinnacle.
|
|
108
|
+
* @param {Pinnacle.OptionalBrandInfo} request
|
|
109
109
|
* @param {Brands.RequestOptions} requestOptions - Request-specific configuration.
|
|
110
110
|
*
|
|
111
111
|
* @throws {@link Pinnacle.BadRequestError}
|
|
@@ -113,26 +113,9 @@ export declare class Brands {
|
|
|
113
113
|
* @throws {@link Pinnacle.InternalServerError}
|
|
114
114
|
*
|
|
115
115
|
* @example
|
|
116
|
-
* await client.brands.validate({
|
|
117
|
-
* address: "500 Folsom St, San Francisco, CA 94105",
|
|
118
|
-
* contact: {
|
|
119
|
-
* email: "michael.chen@trypinnacle.app",
|
|
120
|
-
* name: "Michael Chen",
|
|
121
|
-
* phone: "+14155551234",
|
|
122
|
-
* title: "Customer Support Representative"
|
|
123
|
-
* },
|
|
124
|
-
* dba: "Pinnacle Messaging",
|
|
125
|
-
* description: "Pinnacle is an SMS, MMS, and RCS API for scaling conversations with customers you value.",
|
|
126
|
-
* ein: "88-1234567",
|
|
127
|
-
* email: "founders@trypinnacle.app",
|
|
128
|
-
* name: "Pinnacle",
|
|
129
|
-
* sector: "TECHNOLOGY",
|
|
130
|
-
* type: "PRIVATE_PROFIT",
|
|
131
|
-
* entityType: "LLC",
|
|
132
|
-
* website: "https://www.pinnacle.sh"
|
|
133
|
-
* })
|
|
116
|
+
* await client.brands.validate({})
|
|
134
117
|
*/
|
|
135
|
-
validate(request: Pinnacle.
|
|
118
|
+
validate(request: Pinnacle.OptionalBrandInfo, requestOptions?: Brands.RequestOptions): core.HttpResponsePromise<Pinnacle.ValidationResults>;
|
|
136
119
|
private __validate;
|
|
137
120
|
/**
|
|
138
121
|
* Submit a brand for external vetting verification to enhance your brand's trust score and improved message delivery rates.
|
|
@@ -161,11 +161,11 @@ class Brands {
|
|
|
161
161
|
* website: "https://www.pinnacle.sh"
|
|
162
162
|
* })
|
|
163
163
|
*/
|
|
164
|
-
upsert(request, requestOptions) {
|
|
164
|
+
upsert(request = {}, requestOptions) {
|
|
165
165
|
return core.HttpResponsePromise.fromPromise(this.__upsert(request, requestOptions));
|
|
166
166
|
}
|
|
167
|
-
__upsert(
|
|
168
|
-
return __awaiter(this,
|
|
167
|
+
__upsert() {
|
|
168
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
169
169
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
170
170
|
const _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);
|
|
171
171
|
const _response = yield core.fetcher({
|
|
@@ -375,7 +375,7 @@ class Brands {
|
|
|
375
375
|
/**
|
|
376
376
|
* Validate your brand information for compliance and correctness before submission or storage.
|
|
377
377
|
*
|
|
378
|
-
* @param {Pinnacle.
|
|
378
|
+
* @param {Pinnacle.OptionalBrandInfo} request
|
|
379
379
|
* @param {Brands.RequestOptions} requestOptions - Request-specific configuration.
|
|
380
380
|
*
|
|
381
381
|
* @throws {@link Pinnacle.BadRequestError}
|
|
@@ -383,24 +383,7 @@ class Brands {
|
|
|
383
383
|
* @throws {@link Pinnacle.InternalServerError}
|
|
384
384
|
*
|
|
385
385
|
* @example
|
|
386
|
-
* await client.brands.validate({
|
|
387
|
-
* address: "500 Folsom St, San Francisco, CA 94105",
|
|
388
|
-
* contact: {
|
|
389
|
-
* email: "michael.chen@trypinnacle.app",
|
|
390
|
-
* name: "Michael Chen",
|
|
391
|
-
* phone: "+14155551234",
|
|
392
|
-
* title: "Customer Support Representative"
|
|
393
|
-
* },
|
|
394
|
-
* dba: "Pinnacle Messaging",
|
|
395
|
-
* description: "Pinnacle is an SMS, MMS, and RCS API for scaling conversations with customers you value.",
|
|
396
|
-
* ein: "88-1234567",
|
|
397
|
-
* email: "founders@trypinnacle.app",
|
|
398
|
-
* name: "Pinnacle",
|
|
399
|
-
* sector: "TECHNOLOGY",
|
|
400
|
-
* type: "PRIVATE_PROFIT",
|
|
401
|
-
* entityType: "LLC",
|
|
402
|
-
* website: "https://www.pinnacle.sh"
|
|
403
|
-
* })
|
|
386
|
+
* await client.brands.validate({})
|
|
404
387
|
*/
|
|
405
388
|
validate(request, requestOptions) {
|
|
406
389
|
return core.HttpResponsePromise.fromPromise(this.__validate(request, requestOptions));
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type * as Pinnacle from "../../../../index.js";
|
|
2
1
|
/**
|
|
3
2
|
* @example
|
|
4
3
|
* {
|
|
@@ -25,7 +24,7 @@ export interface UpsertBrandParams {
|
|
|
25
24
|
/** Primary brand address where the company is located. */
|
|
26
25
|
address?: string | null;
|
|
27
26
|
/** Contact information for the brand. */
|
|
28
|
-
contact
|
|
27
|
+
contact?: UpsertBrandParams.Contact | null;
|
|
29
28
|
/** "Doing Business As" name - the public name the brand operates under. */
|
|
30
29
|
dba?: string | null;
|
|
31
30
|
/** Brief description of what the brand does. */
|
|
@@ -42,11 +41,65 @@ export interface UpsertBrandParams {
|
|
|
42
41
|
/** Legal name of the brand as registered. */
|
|
43
42
|
name?: string | null;
|
|
44
43
|
/** Industry the brand operates in. */
|
|
45
|
-
sector
|
|
44
|
+
sector?: UpsertBrandParams.Sector | null;
|
|
46
45
|
/** Legal structure of the brand. */
|
|
47
|
-
type
|
|
46
|
+
type?: UpsertBrandParams.Type | null;
|
|
48
47
|
/** Legal entity type of the brand. */
|
|
49
|
-
entityType?:
|
|
48
|
+
entityType?: UpsertBrandParams.EntityType | null;
|
|
50
49
|
/** Brand website URL. */
|
|
51
50
|
website?: string | null;
|
|
52
51
|
}
|
|
52
|
+
export declare namespace UpsertBrandParams {
|
|
53
|
+
/**
|
|
54
|
+
* Contact information for the brand.
|
|
55
|
+
*/
|
|
56
|
+
interface Contact {
|
|
57
|
+
/** Email address of the contact person. */
|
|
58
|
+
email?: string | null;
|
|
59
|
+
/** Full name of the contact person. */
|
|
60
|
+
name?: string | null;
|
|
61
|
+
/** Phone number of the contact person in E.164 format. */
|
|
62
|
+
phone?: string | null;
|
|
63
|
+
/** Job title of the contact person. */
|
|
64
|
+
title?: string | null;
|
|
65
|
+
}
|
|
66
|
+
/** Industry the brand operates in. */
|
|
67
|
+
const Sector: {
|
|
68
|
+
readonly Agriculture: "AGRICULTURE";
|
|
69
|
+
readonly Communication: "COMMUNICATION";
|
|
70
|
+
readonly Construction: "CONSTRUCTION";
|
|
71
|
+
readonly Education: "EDUCATION";
|
|
72
|
+
readonly Energy: "ENERGY";
|
|
73
|
+
readonly Entertainment: "ENTERTAINMENT";
|
|
74
|
+
readonly Financial: "FINANCIAL";
|
|
75
|
+
readonly Gambling: "GAMBLING";
|
|
76
|
+
readonly Government: "GOVERNMENT";
|
|
77
|
+
readonly Healthcare: "HEALTHCARE";
|
|
78
|
+
readonly Hospitality: "HOSPITALITY";
|
|
79
|
+
readonly Insurance: "INSURANCE";
|
|
80
|
+
readonly Manufacturing: "MANUFACTURING";
|
|
81
|
+
readonly Ngo: "NGO";
|
|
82
|
+
readonly RealEstate: "REAL_ESTATE";
|
|
83
|
+
readonly Retail: "RETAIL";
|
|
84
|
+
readonly Technology: "TECHNOLOGY";
|
|
85
|
+
};
|
|
86
|
+
type Sector = (typeof Sector)[keyof typeof Sector];
|
|
87
|
+
/** Legal structure of the brand. */
|
|
88
|
+
const Type: {
|
|
89
|
+
readonly Government: "GOVERNMENT";
|
|
90
|
+
readonly NonProfit: "NON_PROFIT";
|
|
91
|
+
readonly PrivateProfit: "PRIVATE_PROFIT";
|
|
92
|
+
readonly PublicProfit: "PUBLIC_PROFIT";
|
|
93
|
+
readonly SoleProprietor: "SOLE_PROPRIETOR";
|
|
94
|
+
};
|
|
95
|
+
type Type = (typeof Type)[keyof typeof Type];
|
|
96
|
+
/** Legal entity type of the brand. */
|
|
97
|
+
const EntityType: {
|
|
98
|
+
readonly Llc: "LLC";
|
|
99
|
+
readonly SoleProprietorship: "SOLE_PROPRIETORSHIP";
|
|
100
|
+
readonly Partnership: "PARTNERSHIP";
|
|
101
|
+
readonly Corp: "CORP";
|
|
102
|
+
readonly SCorp: "S_CORP";
|
|
103
|
+
};
|
|
104
|
+
type EntityType = (typeof EntityType)[keyof typeof EntityType];
|
|
105
|
+
}
|
|
@@ -1,3 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.UpsertBrandParams = void 0;
|
|
5
|
+
var UpsertBrandParams;
|
|
6
|
+
(function (UpsertBrandParams) {
|
|
7
|
+
/** Industry the brand operates in. */
|
|
8
|
+
UpsertBrandParams.Sector = {
|
|
9
|
+
Agriculture: "AGRICULTURE",
|
|
10
|
+
Communication: "COMMUNICATION",
|
|
11
|
+
Construction: "CONSTRUCTION",
|
|
12
|
+
Education: "EDUCATION",
|
|
13
|
+
Energy: "ENERGY",
|
|
14
|
+
Entertainment: "ENTERTAINMENT",
|
|
15
|
+
Financial: "FINANCIAL",
|
|
16
|
+
Gambling: "GAMBLING",
|
|
17
|
+
Government: "GOVERNMENT",
|
|
18
|
+
Healthcare: "HEALTHCARE",
|
|
19
|
+
Hospitality: "HOSPITALITY",
|
|
20
|
+
Insurance: "INSURANCE",
|
|
21
|
+
Manufacturing: "MANUFACTURING",
|
|
22
|
+
Ngo: "NGO",
|
|
23
|
+
RealEstate: "REAL_ESTATE",
|
|
24
|
+
Retail: "RETAIL",
|
|
25
|
+
Technology: "TECHNOLOGY",
|
|
26
|
+
};
|
|
27
|
+
/** Legal structure of the brand. */
|
|
28
|
+
UpsertBrandParams.Type = {
|
|
29
|
+
Government: "GOVERNMENT",
|
|
30
|
+
NonProfit: "NON_PROFIT",
|
|
31
|
+
PrivateProfit: "PRIVATE_PROFIT",
|
|
32
|
+
PublicProfit: "PUBLIC_PROFIT",
|
|
33
|
+
SoleProprietor: "SOLE_PROPRIETOR",
|
|
34
|
+
};
|
|
35
|
+
/** Legal entity type of the brand. */
|
|
36
|
+
UpsertBrandParams.EntityType = {
|
|
37
|
+
Llc: "LLC",
|
|
38
|
+
SoleProprietorship: "SOLE_PROPRIETORSHIP",
|
|
39
|
+
Partnership: "PARTNERSHIP",
|
|
40
|
+
Corp: "CORP",
|
|
41
|
+
SCorp: "S_CORP",
|
|
42
|
+
};
|
|
43
|
+
})(UpsertBrandParams || (exports.UpsertBrandParams = UpsertBrandParams = {}));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export type { AutofillBrandParams } from "./AutofillBrandParams.js";
|
|
2
2
|
export type { BrandsGetRequest } from "./BrandsGetRequest.js";
|
|
3
3
|
export type { UpsertBrandParams } from "./UpsertBrandParams.js";
|
|
4
|
-
export type { ValidateBrandParams } from "./ValidateBrandParams.js";
|
|
5
4
|
export type { VetBrandParams } from "./VetBrandParams.js";
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
2
|
import * as core from "../../../../core/index.js";
|
|
3
3
|
import * as Pinnacle from "../../../index.js";
|
|
4
|
+
import { Blast } from "../resources/blast/client/Client.js";
|
|
4
5
|
import { Mms } from "../resources/mms/client/Client.js";
|
|
5
6
|
import { Rcs } from "../resources/rcs/client/Client.js";
|
|
7
|
+
import { Schedule } from "../resources/schedule/client/Client.js";
|
|
6
8
|
import { Sms } from "../resources/sms/client/Client.js";
|
|
7
9
|
export declare namespace Messages {
|
|
8
10
|
interface Options extends BaseClientOptions {
|
|
@@ -15,10 +17,14 @@ export declare class Messages {
|
|
|
15
17
|
protected _sms: Sms | undefined;
|
|
16
18
|
protected _mms: Mms | undefined;
|
|
17
19
|
protected _rcs: Rcs | undefined;
|
|
20
|
+
protected _blast: Blast | undefined;
|
|
21
|
+
protected _schedule: Schedule | undefined;
|
|
18
22
|
constructor(_options?: Messages.Options);
|
|
19
23
|
get sms(): Sms;
|
|
20
24
|
get mms(): Mms;
|
|
21
25
|
get rcs(): Rcs;
|
|
26
|
+
get blast(): Blast;
|
|
27
|
+
get schedule(): Schedule;
|
|
22
28
|
/**
|
|
23
29
|
* Retrieve a previously sent message.
|
|
24
30
|
*
|
|
@@ -59,26 +65,5 @@ export declare class Messages {
|
|
|
59
65
|
*/
|
|
60
66
|
react(request: Pinnacle.ReactMessageParams, requestOptions?: Messages.RequestOptions): core.HttpResponsePromise<Pinnacle.ReactionResult>;
|
|
61
67
|
private __react;
|
|
62
|
-
/**
|
|
63
|
-
* Cancel a previously scheduled message before it is sent.
|
|
64
|
-
*
|
|
65
|
-
* Use the `scheduleId` returned from a scheduled send request (SMS, MMS, or RCS) to cancel the message.
|
|
66
|
-
* Once cancelled, the scheduled message will stop being sent.
|
|
67
|
-
*
|
|
68
|
-
* > **Note:** You cannot cancel a message that has already been sent.
|
|
69
|
-
*
|
|
70
|
-
* @param {string} id - Unique identifier of the scheduled message. This identifier is a string that always begins with the prefix `msg_sched_`, for example: `msg_sched_1234567890`.
|
|
71
|
-
* @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
|
|
72
|
-
*
|
|
73
|
-
* @throws {@link Pinnacle.BadRequestError}
|
|
74
|
-
* @throws {@link Pinnacle.UnauthorizedError}
|
|
75
|
-
* @throws {@link Pinnacle.NotFoundError}
|
|
76
|
-
* @throws {@link Pinnacle.InternalServerError}
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* await client.messages.cancel("msg_sched_1234567890")
|
|
80
|
-
*/
|
|
81
|
-
cancel(id: string, requestOptions?: Messages.RequestOptions): core.HttpResponsePromise<Pinnacle.CancelScheduledMessageResponse>;
|
|
82
|
-
private __cancel;
|
|
83
68
|
protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
|
|
84
69
|
}
|
|
@@ -49,24 +49,34 @@ const core = __importStar(require("../../../../core/index.js"));
|
|
|
49
49
|
const environments = __importStar(require("../../../../environments.js"));
|
|
50
50
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
51
51
|
const Pinnacle = __importStar(require("../../../index.js"));
|
|
52
|
-
const Client_js_1 = require("../resources/
|
|
53
|
-
const Client_js_2 = require("../resources/
|
|
54
|
-
const Client_js_3 = require("../resources/
|
|
52
|
+
const Client_js_1 = require("../resources/blast/client/Client.js");
|
|
53
|
+
const Client_js_2 = require("../resources/mms/client/Client.js");
|
|
54
|
+
const Client_js_3 = require("../resources/rcs/client/Client.js");
|
|
55
|
+
const Client_js_4 = require("../resources/schedule/client/Client.js");
|
|
56
|
+
const Client_js_5 = require("../resources/sms/client/Client.js");
|
|
55
57
|
class Messages {
|
|
56
58
|
constructor(_options = {}) {
|
|
57
59
|
this._options = _options;
|
|
58
60
|
}
|
|
59
61
|
get sms() {
|
|
60
62
|
var _a;
|
|
61
|
-
return ((_a = this._sms) !== null && _a !== void 0 ? _a : (this._sms = new
|
|
63
|
+
return ((_a = this._sms) !== null && _a !== void 0 ? _a : (this._sms = new Client_js_5.Sms(this._options)));
|
|
62
64
|
}
|
|
63
65
|
get mms() {
|
|
64
66
|
var _a;
|
|
65
|
-
return ((_a = this._mms) !== null && _a !== void 0 ? _a : (this._mms = new
|
|
67
|
+
return ((_a = this._mms) !== null && _a !== void 0 ? _a : (this._mms = new Client_js_2.Mms(this._options)));
|
|
66
68
|
}
|
|
67
69
|
get rcs() {
|
|
68
70
|
var _a;
|
|
69
|
-
return ((_a = this._rcs) !== null && _a !== void 0 ? _a : (this._rcs = new
|
|
71
|
+
return ((_a = this._rcs) !== null && _a !== void 0 ? _a : (this._rcs = new Client_js_3.Rcs(this._options)));
|
|
72
|
+
}
|
|
73
|
+
get blast() {
|
|
74
|
+
var _a;
|
|
75
|
+
return ((_a = this._blast) !== null && _a !== void 0 ? _a : (this._blast = new Client_js_1.Blast(this._options)));
|
|
76
|
+
}
|
|
77
|
+
get schedule() {
|
|
78
|
+
var _a;
|
|
79
|
+
return ((_a = this._schedule) !== null && _a !== void 0 ? _a : (this._schedule = new Client_js_4.Schedule(this._options)));
|
|
70
80
|
}
|
|
71
81
|
/**
|
|
72
82
|
* Retrieve a previously sent message.
|
|
@@ -223,84 +233,6 @@ class Messages {
|
|
|
223
233
|
}
|
|
224
234
|
});
|
|
225
235
|
}
|
|
226
|
-
/**
|
|
227
|
-
* Cancel a previously scheduled message before it is sent.
|
|
228
|
-
*
|
|
229
|
-
* Use the `scheduleId` returned from a scheduled send request (SMS, MMS, or RCS) to cancel the message.
|
|
230
|
-
* Once cancelled, the scheduled message will stop being sent.
|
|
231
|
-
*
|
|
232
|
-
* > **Note:** You cannot cancel a message that has already been sent.
|
|
233
|
-
*
|
|
234
|
-
* @param {string} id - Unique identifier of the scheduled message. This identifier is a string that always begins with the prefix `msg_sched_`, for example: `msg_sched_1234567890`.
|
|
235
|
-
* @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
|
|
236
|
-
*
|
|
237
|
-
* @throws {@link Pinnacle.BadRequestError}
|
|
238
|
-
* @throws {@link Pinnacle.UnauthorizedError}
|
|
239
|
-
* @throws {@link Pinnacle.NotFoundError}
|
|
240
|
-
* @throws {@link Pinnacle.InternalServerError}
|
|
241
|
-
*
|
|
242
|
-
* @example
|
|
243
|
-
* await client.messages.cancel("msg_sched_1234567890")
|
|
244
|
-
*/
|
|
245
|
-
cancel(id, requestOptions) {
|
|
246
|
-
return core.HttpResponsePromise.fromPromise(this.__cancel(id, requestOptions));
|
|
247
|
-
}
|
|
248
|
-
__cancel(id, requestOptions) {
|
|
249
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
250
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
251
|
-
const _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);
|
|
252
|
-
const _response = yield core.fetcher({
|
|
253
|
-
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/schedule/${core.url.encodePathParam(id)}`),
|
|
254
|
-
method: "DELETE",
|
|
255
|
-
headers: _headers,
|
|
256
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
257
|
-
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
258
|
-
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
259
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
260
|
-
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
261
|
-
logging: this._options.logging,
|
|
262
|
-
});
|
|
263
|
-
if (_response.ok) {
|
|
264
|
-
return {
|
|
265
|
-
data: _response.body,
|
|
266
|
-
rawResponse: _response.rawResponse,
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
if (_response.error.reason === "status-code") {
|
|
270
|
-
switch (_response.error.statusCode) {
|
|
271
|
-
case 400:
|
|
272
|
-
throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
|
|
273
|
-
case 401:
|
|
274
|
-
throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
275
|
-
case 404:
|
|
276
|
-
throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
|
|
277
|
-
case 500:
|
|
278
|
-
throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
|
|
279
|
-
default:
|
|
280
|
-
throw new errors.PinnacleError({
|
|
281
|
-
statusCode: _response.error.statusCode,
|
|
282
|
-
body: _response.error.body,
|
|
283
|
-
rawResponse: _response.rawResponse,
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
switch (_response.error.reason) {
|
|
288
|
-
case "non-json":
|
|
289
|
-
throw new errors.PinnacleError({
|
|
290
|
-
statusCode: _response.error.statusCode,
|
|
291
|
-
body: _response.error.rawBody,
|
|
292
|
-
rawResponse: _response.rawResponse,
|
|
293
|
-
});
|
|
294
|
-
case "timeout":
|
|
295
|
-
throw new errors.PinnacleTimeoutError("Timeout exceeded when calling DELETE /messages/send/schedule/{id}.");
|
|
296
|
-
case "unknown":
|
|
297
|
-
throw new errors.PinnacleError({
|
|
298
|
-
message: _response.error.errorMessage,
|
|
299
|
-
rawResponse: _response.rawResponse,
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
236
|
_getCustomAuthorizationHeaders() {
|
|
305
237
|
return __awaiter(this, void 0, void 0, function* () {
|
|
306
238
|
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
|
|
2
|
+
import * as core from "../../../../../../core/index.js";
|
|
3
|
+
import * as Pinnacle from "../../../../../index.js";
|
|
4
|
+
export declare namespace Blast {
|
|
5
|
+
interface Options extends BaseClientOptions {
|
|
6
|
+
}
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class Blast {
|
|
11
|
+
protected readonly _options: Blast.Options;
|
|
12
|
+
constructor(_options?: Blast.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Send an SMS message to all contacts in an audience. <br>
|
|
15
|
+
*
|
|
16
|
+
* Messages are distributed evenly across the provided sender phone numbers. <br>
|
|
17
|
+
*
|
|
18
|
+
* Use the optional `schedule` parameter in `options` to schedule the blast for future delivery. When scheduled, the response will contain a `scheduleId` instead of blast details.
|
|
19
|
+
*
|
|
20
|
+
* @param {Pinnacle.messages.BlastSms} request
|
|
21
|
+
* @param {Blast.RequestOptions} requestOptions - Request-specific configuration.
|
|
22
|
+
*
|
|
23
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
24
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
25
|
+
* @throws {@link Pinnacle.PaymentRequiredError}
|
|
26
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* await client.messages.blast.sms({
|
|
30
|
+
* audienceId: "aud_abc123",
|
|
31
|
+
* senders: ["+14155164736", "+14155164737"],
|
|
32
|
+
* message: {
|
|
33
|
+
* text: "Hello from Pinnacle!"
|
|
34
|
+
* }
|
|
35
|
+
* })
|
|
36
|
+
*/
|
|
37
|
+
sms(request: Pinnacle.messages.BlastSms, requestOptions?: Blast.RequestOptions): core.HttpResponsePromise<Pinnacle.messages.BlastSmsResponse>;
|
|
38
|
+
private __sms;
|
|
39
|
+
/**
|
|
40
|
+
* Send an MMS message to all contacts in an audience. <br>
|
|
41
|
+
*
|
|
42
|
+
* Messages are distributed evenly across the provided sender phone numbers. <br>
|
|
43
|
+
*
|
|
44
|
+
* Use the optional `schedule` parameter in `options` to schedule the blast for future delivery. When scheduled, the response will contain a `scheduleId` instead of blast details.
|
|
45
|
+
*
|
|
46
|
+
* @param {Pinnacle.messages.BlastMms} request
|
|
47
|
+
* @param {Blast.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
|
+
*
|
|
49
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
50
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
51
|
+
* @throws {@link Pinnacle.PaymentRequiredError}
|
|
52
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* await client.messages.blast.mms({
|
|
56
|
+
* audienceId: "aud_abc123",
|
|
57
|
+
* senders: ["+14155164736", "+14155164737"],
|
|
58
|
+
* message: {
|
|
59
|
+
* mediaUrls: ["https://fastly.picsum.photos/id/941/300/300.jpg"],
|
|
60
|
+
* text: "Check out this image!"
|
|
61
|
+
* },
|
|
62
|
+
* options: {
|
|
63
|
+
* validate: true
|
|
64
|
+
* }
|
|
65
|
+
* })
|
|
66
|
+
*/
|
|
67
|
+
mms(request: Pinnacle.messages.BlastMms, requestOptions?: Blast.RequestOptions): core.HttpResponsePromise<Pinnacle.messages.BlastMmsResponse>;
|
|
68
|
+
private __mms;
|
|
69
|
+
/**
|
|
70
|
+
* Send an RCS message to all contacts in an audience. <br>
|
|
71
|
+
*
|
|
72
|
+
* Messages are distributed evenly across the provided RCS agents for load balancing. Requires active RCS agents and recipient devices that support RCS Business Messaging. <br>
|
|
73
|
+
*
|
|
74
|
+
* Use the optional `schedule` parameter in `options` to schedule the blast for future delivery. When scheduled, the response will contain a `scheduleId` instead of blast details.
|
|
75
|
+
*
|
|
76
|
+
* @param {Pinnacle.messages.BlastRcs} request
|
|
77
|
+
* @param {Blast.RequestOptions} requestOptions - Request-specific configuration.
|
|
78
|
+
*
|
|
79
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
80
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
81
|
+
* @throws {@link Pinnacle.PaymentRequiredError}
|
|
82
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* await client.messages.blast.rcs({
|
|
86
|
+
* audienceId: "aud_abc123",
|
|
87
|
+
* senders: ["agent_pinnacle", "agent_pinnacle2"],
|
|
88
|
+
* message: {
|
|
89
|
+
* quickReplies: [{
|
|
90
|
+
* type: "trigger",
|
|
91
|
+
* payload: "payload",
|
|
92
|
+
* title: "title"
|
|
93
|
+
* }],
|
|
94
|
+
* text: "Hello from Pinnacle RCS!"
|
|
95
|
+
* },
|
|
96
|
+
* options: {
|
|
97
|
+
* transcode: true,
|
|
98
|
+
* validate: true
|
|
99
|
+
* }
|
|
100
|
+
* })
|
|
101
|
+
*/
|
|
102
|
+
rcs(request: Pinnacle.messages.BlastRcs, requestOptions?: Blast.RequestOptions): core.HttpResponsePromise<Pinnacle.messages.BlastRcsResponse>;
|
|
103
|
+
private __rcs;
|
|
104
|
+
protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
|
|
105
|
+
}
|