rcs-js 2.0.5 → 2.0.6
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/README.md +0 -199
- package/dist/cjs/Client.d.ts +3 -0
- package/dist/cjs/Client.js +25 -20
- package/dist/cjs/api/resources/audiences/client/Client.d.ts +129 -0
- package/dist/cjs/api/resources/audiences/client/Client.js +385 -0
- package/dist/cjs/api/resources/audiences/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/audiences/client/index.js +17 -0
- package/dist/cjs/api/resources/audiences/client/requests/AudiencesDeleteRequest.d.ts +13 -0
- package/dist/cjs/api/resources/audiences/client/requests/AudiencesDeleteRequest.js +5 -0
- package/dist/cjs/api/resources/audiences/client/requests/AudiencesGetRequest.d.ts +22 -0
- package/dist/cjs/api/resources/audiences/client/requests/AudiencesGetRequest.js +5 -0
- package/dist/cjs/api/resources/audiences/client/requests/CreateAudienceParams.d.ts +31 -0
- package/dist/cjs/api/resources/audiences/client/requests/CreateAudienceParams.js +5 -0
- package/dist/cjs/api/resources/audiences/client/requests/UpdateAudienceParams.d.ts +19 -0
- package/dist/cjs/api/resources/audiences/client/requests/UpdateAudienceParams.js +5 -0
- package/dist/cjs/api/resources/audiences/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/audiences/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/audiences/index.d.ts +3 -0
- package/dist/cjs/api/resources/audiences/index.js +19 -0
- package/dist/cjs/api/resources/audiences/resources/contacts/client/Client.d.ts +80 -0
- package/dist/cjs/api/resources/audiences/resources/contacts/client/Client.js +220 -0
- package/dist/cjs/api/resources/audiences/resources/contacts/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/audiences/resources/contacts/client/index.js +17 -0
- package/dist/cjs/api/resources/audiences/resources/contacts/client/requests/AddContactsParams.d.ts +16 -0
- package/dist/cjs/api/resources/audiences/resources/contacts/client/requests/AddContactsParams.js +5 -0
- package/dist/cjs/api/resources/audiences/resources/contacts/client/requests/RemoveContactsParams.d.ts +16 -0
- package/dist/cjs/api/resources/audiences/resources/contacts/client/requests/RemoveContactsParams.js +5 -0
- package/dist/cjs/api/resources/audiences/resources/contacts/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/audiences/resources/contacts/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/audiences/resources/contacts/index.d.ts +1 -0
- package/dist/cjs/api/resources/audiences/resources/contacts/index.js +17 -0
- package/dist/cjs/api/resources/audiences/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/audiences/resources/index.js +41 -0
- package/dist/cjs/api/resources/audiences/types/AudiencesGetResponse.d.ts +11 -0
- package/dist/cjs/api/resources/audiences/types/AudiencesGetResponse.js +5 -0
- package/dist/cjs/api/resources/audiences/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/audiences/types/index.js +17 -0
- package/dist/cjs/api/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/index.js +4 -1
- package/dist/cjs/api/types/AudienceCountOnly.d.ts +17 -0
- package/dist/cjs/api/types/AudienceCountOnly.js +5 -0
- package/dist/cjs/api/types/AudienceWithPagination.d.ts +17 -0
- package/dist/cjs/api/types/AudienceWithPagination.js +5 -0
- package/dist/cjs/api/types/DeleteAudienceResponse.d.ts +7 -0
- package/dist/cjs/api/types/DeleteAudienceResponse.js +5 -0
- package/dist/cjs/api/types/Pagination.d.ts +13 -0
- package/dist/cjs/api/types/Pagination.js +5 -0
- package/dist/cjs/api/types/SentMmsDetails.d.ts +5 -1
- package/dist/cjs/api/types/index.d.ts +4 -0
- package/dist/cjs/api/types/index.js +4 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +7 -2
- package/dist/esm/api/resources/audiences/client/Client.d.mts +129 -0
- package/dist/esm/api/resources/audiences/client/Client.mjs +348 -0
- package/dist/esm/api/resources/audiences/client/index.d.mts +2 -0
- package/dist/esm/api/resources/audiences/client/index.mjs +1 -0
- package/dist/esm/api/resources/audiences/client/requests/AudiencesDeleteRequest.d.mts +13 -0
- package/dist/esm/api/resources/audiences/client/requests/AudiencesDeleteRequest.mjs +4 -0
- package/dist/esm/api/resources/audiences/client/requests/AudiencesGetRequest.d.mts +22 -0
- package/dist/esm/api/resources/audiences/client/requests/AudiencesGetRequest.mjs +4 -0
- package/dist/esm/api/resources/audiences/client/requests/CreateAudienceParams.d.mts +31 -0
- package/dist/esm/api/resources/audiences/client/requests/CreateAudienceParams.mjs +4 -0
- package/dist/esm/api/resources/audiences/client/requests/UpdateAudienceParams.d.mts +19 -0
- package/dist/esm/api/resources/audiences/client/requests/UpdateAudienceParams.mjs +4 -0
- package/dist/esm/api/resources/audiences/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/audiences/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/audiences/index.d.mts +3 -0
- package/dist/esm/api/resources/audiences/index.mjs +3 -0
- package/dist/esm/api/resources/audiences/resources/contacts/client/Client.d.mts +80 -0
- package/dist/esm/api/resources/audiences/resources/contacts/client/Client.mjs +183 -0
- package/dist/esm/api/resources/audiences/resources/contacts/client/index.d.mts +2 -0
- package/dist/esm/api/resources/audiences/resources/contacts/client/index.mjs +1 -0
- package/dist/esm/api/resources/audiences/resources/contacts/client/requests/AddContactsParams.d.mts +16 -0
- package/dist/esm/api/resources/audiences/resources/contacts/client/requests/AddContactsParams.mjs +4 -0
- package/dist/esm/api/resources/audiences/resources/contacts/client/requests/RemoveContactsParams.d.mts +16 -0
- package/dist/esm/api/resources/audiences/resources/contacts/client/requests/RemoveContactsParams.mjs +4 -0
- package/dist/esm/api/resources/audiences/resources/contacts/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/audiences/resources/contacts/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/audiences/resources/contacts/index.d.mts +1 -0
- package/dist/esm/api/resources/audiences/resources/contacts/index.mjs +1 -0
- package/dist/esm/api/resources/audiences/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/audiences/resources/index.mjs +2 -0
- package/dist/esm/api/resources/audiences/types/AudiencesGetResponse.d.mts +11 -0
- package/dist/esm/api/resources/audiences/types/AudiencesGetResponse.mjs +4 -0
- package/dist/esm/api/resources/audiences/types/index.d.mts +1 -0
- package/dist/esm/api/resources/audiences/types/index.mjs +1 -0
- package/dist/esm/api/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/index.mjs +3 -0
- package/dist/esm/api/types/AudienceCountOnly.d.mts +17 -0
- package/dist/esm/api/types/AudienceCountOnly.mjs +4 -0
- package/dist/esm/api/types/AudienceWithPagination.d.mts +17 -0
- package/dist/esm/api/types/AudienceWithPagination.mjs +4 -0
- package/dist/esm/api/types/DeleteAudienceResponse.d.mts +7 -0
- package/dist/esm/api/types/DeleteAudienceResponse.mjs +4 -0
- package/dist/esm/api/types/Pagination.d.mts +13 -0
- package/dist/esm/api/types/Pagination.mjs +4 -0
- package/dist/esm/api/types/SentMmsDetails.d.mts +5 -1
- package/dist/esm/api/types/index.d.mts +4 -0
- package/dist/esm/api/types/index.mjs +4 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +408 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
5
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
6
|
+
import * as Pinnacle from "../../../../../index.mjs";
|
|
7
|
+
export declare namespace Contacts {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.PinnacleEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
12
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
13
|
+
/** Additional headers to include in requests. */
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
15
|
+
}
|
|
16
|
+
interface RequestOptions {
|
|
17
|
+
/** The maximum time to wait for a response in seconds. */
|
|
18
|
+
timeoutInSeconds?: number;
|
|
19
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
20
|
+
maxRetries?: number;
|
|
21
|
+
/** A hook to abort the request. */
|
|
22
|
+
abortSignal?: AbortSignal;
|
|
23
|
+
/** Additional query string parameters to include in the request. */
|
|
24
|
+
queryParams?: Record<string, unknown>;
|
|
25
|
+
/** Additional headers to include in the request. */
|
|
26
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export declare class Contacts {
|
|
30
|
+
protected readonly _options: Contacts.Options;
|
|
31
|
+
constructor(_options?: Contacts.Options);
|
|
32
|
+
/**
|
|
33
|
+
* Remove contacts from an existing audience. This operation is idempotent.
|
|
34
|
+
*
|
|
35
|
+
* - Only removes contacts that exist in the audience
|
|
36
|
+
* - Contacts not in the audience are ignored
|
|
37
|
+
*
|
|
38
|
+
* @param {Pinnacle.audiences.RemoveContactsParams} request
|
|
39
|
+
* @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
|
|
40
|
+
*
|
|
41
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
42
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
43
|
+
* @throws {@link Pinnacle.NotFoundError}
|
|
44
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* await client.audiences.contacts.remove({
|
|
48
|
+
* id: "aud_abc123",
|
|
49
|
+
* contacts: ["+12125551234", "co_def456"]
|
|
50
|
+
* })
|
|
51
|
+
*/
|
|
52
|
+
remove(request: Pinnacle.audiences.RemoveContactsParams, requestOptions?: Contacts.RequestOptions): core.HttpResponsePromise<Pinnacle.AudienceCountOnly>;
|
|
53
|
+
private __remove;
|
|
54
|
+
/**
|
|
55
|
+
* Add contacts to an existing audience. This operation is additive and idempotent.
|
|
56
|
+
*
|
|
57
|
+
* - Phone numbers that don't exist will be auto-created as contacts
|
|
58
|
+
* - Duplicate adds are ignored
|
|
59
|
+
* - Contacts already in the audience are ignored
|
|
60
|
+
*
|
|
61
|
+
* @param {Pinnacle.audiences.AddContactsParams} request
|
|
62
|
+
* @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
|
+
*
|
|
64
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
65
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
66
|
+
* @throws {@link Pinnacle.NotFoundError}
|
|
67
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* await client.audiences.contacts.add({
|
|
71
|
+
* id: "aud_abc123",
|
|
72
|
+
* contacts: ["+12125551234", "co_def456", "+13105551234"]
|
|
73
|
+
* })
|
|
74
|
+
*/
|
|
75
|
+
add(request: Pinnacle.audiences.AddContactsParams, requestOptions?: Contacts.RequestOptions): core.HttpResponsePromise<Pinnacle.AudienceCountOnly>;
|
|
76
|
+
private __add;
|
|
77
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
78
|
+
"PINNACLE-API-KEY": string | undefined;
|
|
79
|
+
}>;
|
|
80
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
14
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
15
|
+
import * as Pinnacle from "../../../../../index.mjs";
|
|
16
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
|
|
17
|
+
import * as errors from "../../../../../../errors/index.mjs";
|
|
18
|
+
export class Contacts {
|
|
19
|
+
constructor(_options = {}) {
|
|
20
|
+
this._options = _options;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Remove contacts from an existing audience. This operation is idempotent.
|
|
24
|
+
*
|
|
25
|
+
* - Only removes contacts that exist in the audience
|
|
26
|
+
* - Contacts not in the audience are ignored
|
|
27
|
+
*
|
|
28
|
+
* @param {Pinnacle.audiences.RemoveContactsParams} request
|
|
29
|
+
* @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
|
|
30
|
+
*
|
|
31
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
32
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
33
|
+
* @throws {@link Pinnacle.NotFoundError}
|
|
34
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* await client.audiences.contacts.remove({
|
|
38
|
+
* id: "aud_abc123",
|
|
39
|
+
* contacts: ["+12125551234", "co_def456"]
|
|
40
|
+
* })
|
|
41
|
+
*/
|
|
42
|
+
remove(request, requestOptions) {
|
|
43
|
+
return core.HttpResponsePromise.fromPromise(this.__remove(request, requestOptions));
|
|
44
|
+
}
|
|
45
|
+
__remove(request, requestOptions) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
var _a, _b, _c;
|
|
48
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
49
|
+
const _response = yield core.fetcher({
|
|
50
|
+
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, "audiences/contacts"),
|
|
51
|
+
method: "DELETE",
|
|
52
|
+
headers: _headers,
|
|
53
|
+
contentType: "application/json",
|
|
54
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
55
|
+
requestType: "json",
|
|
56
|
+
body: request,
|
|
57
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
58
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
59
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
60
|
+
});
|
|
61
|
+
if (_response.ok) {
|
|
62
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
63
|
+
}
|
|
64
|
+
if (_response.error.reason === "status-code") {
|
|
65
|
+
switch (_response.error.statusCode) {
|
|
66
|
+
case 400:
|
|
67
|
+
throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
|
|
68
|
+
case 401:
|
|
69
|
+
throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
70
|
+
case 404:
|
|
71
|
+
throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
|
|
72
|
+
case 500:
|
|
73
|
+
throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
|
|
74
|
+
default:
|
|
75
|
+
throw new errors.PinnacleError({
|
|
76
|
+
statusCode: _response.error.statusCode,
|
|
77
|
+
body: _response.error.body,
|
|
78
|
+
rawResponse: _response.rawResponse,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
switch (_response.error.reason) {
|
|
83
|
+
case "non-json":
|
|
84
|
+
throw new errors.PinnacleError({
|
|
85
|
+
statusCode: _response.error.statusCode,
|
|
86
|
+
body: _response.error.rawBody,
|
|
87
|
+
rawResponse: _response.rawResponse,
|
|
88
|
+
});
|
|
89
|
+
case "timeout":
|
|
90
|
+
throw new errors.PinnacleTimeoutError("Timeout exceeded when calling DELETE /audiences/contacts.");
|
|
91
|
+
case "unknown":
|
|
92
|
+
throw new errors.PinnacleError({
|
|
93
|
+
message: _response.error.errorMessage,
|
|
94
|
+
rawResponse: _response.rawResponse,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Add contacts to an existing audience. This operation is additive and idempotent.
|
|
101
|
+
*
|
|
102
|
+
* - Phone numbers that don't exist will be auto-created as contacts
|
|
103
|
+
* - Duplicate adds are ignored
|
|
104
|
+
* - Contacts already in the audience are ignored
|
|
105
|
+
*
|
|
106
|
+
* @param {Pinnacle.audiences.AddContactsParams} request
|
|
107
|
+
* @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
|
|
108
|
+
*
|
|
109
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
110
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
111
|
+
* @throws {@link Pinnacle.NotFoundError}
|
|
112
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* await client.audiences.contacts.add({
|
|
116
|
+
* id: "aud_abc123",
|
|
117
|
+
* contacts: ["+12125551234", "co_def456", "+13105551234"]
|
|
118
|
+
* })
|
|
119
|
+
*/
|
|
120
|
+
add(request, requestOptions) {
|
|
121
|
+
return core.HttpResponsePromise.fromPromise(this.__add(request, requestOptions));
|
|
122
|
+
}
|
|
123
|
+
__add(request, requestOptions) {
|
|
124
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
+
var _a, _b, _c;
|
|
126
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
127
|
+
const _response = yield core.fetcher({
|
|
128
|
+
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, "audiences/contacts"),
|
|
129
|
+
method: "PATCH",
|
|
130
|
+
headers: _headers,
|
|
131
|
+
contentType: "application/json",
|
|
132
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
133
|
+
requestType: "json",
|
|
134
|
+
body: request,
|
|
135
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
136
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
137
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
138
|
+
});
|
|
139
|
+
if (_response.ok) {
|
|
140
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
141
|
+
}
|
|
142
|
+
if (_response.error.reason === "status-code") {
|
|
143
|
+
switch (_response.error.statusCode) {
|
|
144
|
+
case 400:
|
|
145
|
+
throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
|
|
146
|
+
case 401:
|
|
147
|
+
throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
148
|
+
case 404:
|
|
149
|
+
throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
|
|
150
|
+
case 500:
|
|
151
|
+
throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
|
|
152
|
+
default:
|
|
153
|
+
throw new errors.PinnacleError({
|
|
154
|
+
statusCode: _response.error.statusCode,
|
|
155
|
+
body: _response.error.body,
|
|
156
|
+
rawResponse: _response.rawResponse,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
switch (_response.error.reason) {
|
|
161
|
+
case "non-json":
|
|
162
|
+
throw new errors.PinnacleError({
|
|
163
|
+
statusCode: _response.error.statusCode,
|
|
164
|
+
body: _response.error.rawBody,
|
|
165
|
+
rawResponse: _response.rawResponse,
|
|
166
|
+
});
|
|
167
|
+
case "timeout":
|
|
168
|
+
throw new errors.PinnacleTimeoutError("Timeout exceeded when calling PATCH /audiences/contacts.");
|
|
169
|
+
case "unknown":
|
|
170
|
+
throw new errors.PinnacleError({
|
|
171
|
+
message: _response.error.errorMessage,
|
|
172
|
+
rawResponse: _response.rawResponse,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
_getCustomAuthorizationHeaders() {
|
|
178
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
179
|
+
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
180
|
+
return { "PINNACLE-API-KEY": apiKeyValue };
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
package/dist/esm/api/resources/audiences/resources/contacts/client/requests/AddContactsParams.d.mts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* id: "aud_abc123",
|
|
8
|
+
* contacts: ["+12125551234", "co_def456", "+13105551234"]
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface AddContactsParams {
|
|
12
|
+
/** Audience ID. This identifier is a string that always begins with the prefix `aud_`, for example: `aud_abc123`. */
|
|
13
|
+
id: string;
|
|
14
|
+
/** Array of phone numbers (E.164 format) or contact IDs (minimum 1 item). */
|
|
15
|
+
contacts: string[];
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* id: "aud_abc123",
|
|
8
|
+
* contacts: ["+12125551234", "co_def456"]
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface RemoveContactsParams {
|
|
12
|
+
/** Audience ID. This identifier is a string that always begins with the prefix `aud_`, for example: `aud_abc123`. */
|
|
13
|
+
id: string;
|
|
14
|
+
/** Array of phone numbers (E.164 format) or contact IDs (minimum 1 item). */
|
|
15
|
+
contacts: string[];
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Pinnacle from "../../../index.mjs";
|
|
5
|
+
export type AudiencesGetResponse =
|
|
6
|
+
/**
|
|
7
|
+
* Returned when page and/or limit parameters are provided. */
|
|
8
|
+
Pinnacle.AudienceWithPagination
|
|
9
|
+
/**
|
|
10
|
+
* Returned when no pagination parameters are provided. */
|
|
11
|
+
| Pinnacle.AudienceCountOnly;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./AudiencesGetResponse.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./AudiencesGetResponse.mjs";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * as audiences from "./audiences/index.mjs";
|
|
2
|
+
export * from "./audiences/types/index.mjs";
|
|
1
3
|
export * as conversations from "./conversations/index.mjs";
|
|
2
4
|
export * from "./conversations/types/index.mjs";
|
|
3
5
|
export * as phoneNumbers from "./phoneNumbers/index.mjs";
|
|
@@ -11,6 +13,7 @@ export * as webhooks from "./webhooks/index.mjs";
|
|
|
11
13
|
export * as status from "./status/index.mjs";
|
|
12
14
|
export * as tools from "./tools/index.mjs";
|
|
13
15
|
export * from "./brands/client/requests/index.mjs";
|
|
16
|
+
export * from "./audiences/client/requests/index.mjs";
|
|
14
17
|
export * from "./contacts/client/requests/index.mjs";
|
|
15
18
|
export * from "./conversations/client/requests/index.mjs";
|
|
16
19
|
export * from "./messages/client/requests/index.mjs";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * as audiences from "./audiences/index.mjs";
|
|
2
|
+
export * from "./audiences/types/index.mjs";
|
|
1
3
|
export * as conversations from "./conversations/index.mjs";
|
|
2
4
|
export * from "./conversations/types/index.mjs";
|
|
3
5
|
export * as phoneNumbers from "./phoneNumbers/index.mjs";
|
|
@@ -11,6 +13,7 @@ export * as webhooks from "./webhooks/index.mjs";
|
|
|
11
13
|
export * as status from "./status/index.mjs";
|
|
12
14
|
export * as tools from "./tools/index.mjs";
|
|
13
15
|
export * from "./brands/client/requests/index.mjs";
|
|
16
|
+
export * from "./audiences/client/requests/index.mjs";
|
|
14
17
|
export * from "./contacts/client/requests/index.mjs";
|
|
15
18
|
export * from "./conversations/client/requests/index.mjs";
|
|
16
19
|
export * from "./messages/client/requests/index.mjs";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface AudienceCountOnly {
|
|
5
|
+
/** Audience public ID. This identifier is a string that always begins with the prefix `aud_`, for example: `aud_abc123`. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Audience name. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Audience description. */
|
|
10
|
+
description: string;
|
|
11
|
+
/**
|
|
12
|
+
* Total number of contacts in audience.
|
|
13
|
+
*
|
|
14
|
+
* Use the [Get Audience](/api-reference/audiences/get) endpoint with the pagination parameters to get the audience with its contacts.
|
|
15
|
+
*/
|
|
16
|
+
contactCount: number;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Pinnacle from "../index.mjs";
|
|
5
|
+
export interface AudienceWithPagination {
|
|
6
|
+
/** Audience public ID. This identifier is a string that always begins with the prefix `aud_`, for example: `aud_abc123`. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Audience name. */
|
|
9
|
+
name: string;
|
|
10
|
+
/** Audience description. */
|
|
11
|
+
description: string;
|
|
12
|
+
/** Array of contact objects (paginated). */
|
|
13
|
+
contacts: Pinnacle.Contact[];
|
|
14
|
+
/** Total number of contacts in audience. */
|
|
15
|
+
contactCount: number;
|
|
16
|
+
pagination: Pinnacle.Pagination;
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface Pagination {
|
|
5
|
+
/** Current page number (1-indexed). */
|
|
6
|
+
page: number;
|
|
7
|
+
/** Items per page (max 100, default 50). */
|
|
8
|
+
limit: number;
|
|
9
|
+
/** Total number of contacts in the audience. */
|
|
10
|
+
total: number;
|
|
11
|
+
/** Whether more pages exist. */
|
|
12
|
+
hasMore: boolean;
|
|
13
|
+
}
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
export interface SentMmsDetails {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Array of unique message identifiers for an individual MMS send. Each identifier is a string that always begins with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
|
|
7
|
+
* When media assets are too large to fit in a single MMS and `options.multiple_messages` is set to true, the content is automatically split across multiple messages. Each split message gets its own ID, and all IDs are returned in this array. <br><br>
|
|
8
|
+
* Note: When sending to audiences, you'll receive multiple response objects (one per recipient), each containing its own messageIds array.
|
|
9
|
+
*/
|
|
6
10
|
messageIds: string[];
|
|
7
11
|
/** Total number of segments used across the message. */
|
|
8
12
|
segments: number;
|
|
@@ -35,6 +35,10 @@ export * from "./RcsCampaignUseCaseEnum.mjs";
|
|
|
35
35
|
export * from "./RcsCampaign.mjs";
|
|
36
36
|
export * from "./ExtendedRcsCampaign.mjs";
|
|
37
37
|
export * from "./Contact.mjs";
|
|
38
|
+
export * from "./Pagination.mjs";
|
|
39
|
+
export * from "./AudienceWithPagination.mjs";
|
|
40
|
+
export * from "./AudienceCountOnly.mjs";
|
|
41
|
+
export * from "./DeleteAudienceResponse.mjs";
|
|
38
42
|
export * from "./OptionalContact.mjs";
|
|
39
43
|
export * from "./UpdatedContactId.mjs";
|
|
40
44
|
export * from "./ContactId.mjs";
|
|
@@ -35,6 +35,10 @@ export * from "./RcsCampaignUseCaseEnum.mjs";
|
|
|
35
35
|
export * from "./RcsCampaign.mjs";
|
|
36
36
|
export * from "./ExtendedRcsCampaign.mjs";
|
|
37
37
|
export * from "./Contact.mjs";
|
|
38
|
+
export * from "./Pagination.mjs";
|
|
39
|
+
export * from "./AudienceWithPagination.mjs";
|
|
40
|
+
export * from "./AudienceCountOnly.mjs";
|
|
41
|
+
export * from "./DeleteAudienceResponse.mjs";
|
|
38
42
|
export * from "./OptionalContact.mjs";
|
|
39
43
|
export * from "./UpdatedContactId.mjs";
|
|
40
44
|
export * from "./ContactId.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.
|
|
1
|
+
export declare const SDK_VERSION = "2.0.6";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "2.0.
|
|
1
|
+
export const SDK_VERSION = "2.0.6";
|