rcs-js 2.0.3 → 2.0.5-rc.1
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 +36 -1
- 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/resources/messages/resources/index.d.ts +1 -0
- package/dist/cjs/api/resources/messages/resources/index.js +1 -0
- package/dist/cjs/api/resources/messages/resources/rcs/client/Client.d.ts +33 -0
- package/dist/cjs/api/resources/messages/resources/rcs/client/Client.js +90 -0
- package/dist/cjs/api/resources/messages/resources/rcs/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/messages/resources/rcs/client/index.js +15 -0
- package/dist/cjs/api/resources/messages/resources/rcs/client/requests/SendTypingIndicatorSchema.d.ts +38 -0
- package/dist/cjs/api/resources/messages/resources/rcs/client/requests/SendTypingIndicatorSchema.js +5 -0
- package/dist/cjs/api/resources/messages/resources/rcs/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/messages/resources/rcs/client/requests/index.js +2 -0
- 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/Options.d.ts +21 -0
- package/dist/cjs/api/types/Options.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/RcsButtonOpenUrl.d.ts +31 -2
- package/dist/cjs/api/types/RcsButtonOpenUrl.js +9 -0
- package/dist/cjs/api/types/RcsButtonSendLocation.d.ts +8 -2
- package/dist/cjs/api/types/RichCardsMessage.d.ts +51 -1
- package/dist/cjs/api/types/RichCardsMessage.js +18 -0
- package/dist/cjs/api/types/SendTypingIndicatorResponse.d.ts +22 -0
- package/dist/cjs/api/types/SendTypingIndicatorResponse.js +5 -0
- package/dist/cjs/api/types/index.d.ts +6 -0
- package/dist/cjs/api/types/index.js +6 -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/resources/messages/resources/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/resources/index.mjs +1 -0
- package/dist/esm/api/resources/messages/resources/rcs/client/Client.d.mts +33 -0
- package/dist/esm/api/resources/messages/resources/rcs/client/Client.mjs +90 -0
- package/dist/esm/api/resources/messages/resources/rcs/client/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/resources/rcs/client/index.mjs +1 -1
- package/dist/esm/api/resources/messages/resources/rcs/client/requests/SendTypingIndicatorSchema.d.mts +38 -0
- package/dist/esm/api/resources/messages/resources/rcs/client/requests/SendTypingIndicatorSchema.mjs +4 -0
- package/dist/esm/api/resources/messages/resources/rcs/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/resources/rcs/client/requests/index.mjs +1 -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/Options.d.mts +21 -0
- package/dist/esm/api/types/Options.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/RcsButtonOpenUrl.d.mts +31 -2
- package/dist/esm/api/types/RcsButtonOpenUrl.mjs +8 -1
- package/dist/esm/api/types/RcsButtonSendLocation.d.mts +8 -2
- package/dist/esm/api/types/RichCardsMessage.d.mts +51 -1
- package/dist/esm/api/types/RichCardsMessage.mjs +17 -1
- package/dist/esm/api/types/SendTypingIndicatorResponse.d.mts +22 -0
- package/dist/esm/api/types/SendTypingIndicatorResponse.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +6 -0
- package/dist/esm/api/types/index.mjs +6 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
- package/reference.md +487 -0
package/README.md
CHANGED
|
@@ -5,6 +5,41 @@
|
|
|
5
5
|
|
|
6
6
|
The Pinnacle TypeScript library provides convenient access to the Pinnacle APIs from TypeScript.
|
|
7
7
|
|
|
8
|
+
## Table of Contents
|
|
9
|
+
|
|
10
|
+
- [Table of Contents](#table-of-contents)
|
|
11
|
+
- [Installation](#installation)
|
|
12
|
+
- [Usage](#usage)
|
|
13
|
+
- [Request and Response Types](#request-and-response-types)
|
|
14
|
+
- [Exception Handling](#exception-handling)
|
|
15
|
+
- [Advanced](#advanced)
|
|
16
|
+
- [Additional Headers](#additional-headers)
|
|
17
|
+
- [Additional Query String Parameters](#additional-query-string-parameters)
|
|
18
|
+
- [Retries](#retries)
|
|
19
|
+
- [Timeouts](#timeouts)
|
|
20
|
+
- [Aborting Requests](#aborting-requests)
|
|
21
|
+
- [Access Raw Response Data](#access-raw-response-data)
|
|
22
|
+
- [Runtime Compatibility](#runtime-compatibility)
|
|
23
|
+
- [Contributing](#contributing)
|
|
24
|
+
- [Reference](#reference)
|
|
25
|
+
|
|
26
|
+
## Table of Contents
|
|
27
|
+
|
|
28
|
+
- [Installation](#installation)
|
|
29
|
+
- [Usage](#usage)
|
|
30
|
+
- [Request and Response Types](#request-and-response-types)
|
|
31
|
+
- [Exception Handling](#exception-handling)
|
|
32
|
+
- [Advanced](#advanced)
|
|
33
|
+
- [Additional Headers](#additional-headers)
|
|
34
|
+
- [Additional Query String Parameters](#additional-query-string-parameters)
|
|
35
|
+
- [Retries](#retries)
|
|
36
|
+
- [Timeouts](#timeouts)
|
|
37
|
+
- [Aborting Requests](#aborting-requests)
|
|
38
|
+
- [Access Raw Response Data](#access-raw-response-data)
|
|
39
|
+
- [Runtime Compatibility](#runtime-compatibility)
|
|
40
|
+
- [Contributing](#contributing)
|
|
41
|
+
- [Reference](#reference)
|
|
42
|
+
|
|
8
43
|
## Installation
|
|
9
44
|
|
|
10
45
|
```sh
|
|
@@ -29,7 +64,7 @@ await client.brands.autofill({
|
|
|
29
64
|
});
|
|
30
65
|
```
|
|
31
66
|
|
|
32
|
-
## Request
|
|
67
|
+
## Request and Response Types
|
|
33
68
|
|
|
34
69
|
The SDK exports all request and response types as TypeScript interfaces. Simply import them with the
|
|
35
70
|
following namespace:
|
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import * as environments from "./environments.js";
|
|
5
5
|
import * as core from "./core/index.js";
|
|
6
6
|
import { Brands } from "./api/resources/brands/client/Client.js";
|
|
7
|
+
import { Audiences } from "./api/resources/audiences/client/Client.js";
|
|
7
8
|
import { Contacts } from "./api/resources/contacts/client/Client.js";
|
|
8
9
|
import { Conversations } from "./api/resources/conversations/client/Client.js";
|
|
9
10
|
import { Messages } from "./api/resources/messages/client/Client.js";
|
|
@@ -38,6 +39,7 @@ export declare namespace PinnacleClient {
|
|
|
38
39
|
export declare class PinnacleClient {
|
|
39
40
|
protected readonly _options: PinnacleClient.Options;
|
|
40
41
|
protected _brands: Brands | undefined;
|
|
42
|
+
protected _audiences: Audiences | undefined;
|
|
41
43
|
protected _contacts: Contacts | undefined;
|
|
42
44
|
protected _conversations: Conversations | undefined;
|
|
43
45
|
protected _messages: Messages | undefined;
|
|
@@ -49,6 +51,7 @@ export declare class PinnacleClient {
|
|
|
49
51
|
protected _tools: Tools | undefined;
|
|
50
52
|
constructor(_options?: PinnacleClient.Options);
|
|
51
53
|
get brands(): Brands;
|
|
54
|
+
get audiences(): Audiences;
|
|
52
55
|
get contacts(): Contacts;
|
|
53
56
|
get conversations(): Conversations;
|
|
54
57
|
get messages(): Messages;
|
package/dist/cjs/Client.js
CHANGED
|
@@ -40,22 +40,23 @@ exports.PinnacleClient = void 0;
|
|
|
40
40
|
const core = __importStar(require("./core/index.js"));
|
|
41
41
|
const headers_js_1 = require("./core/headers.js");
|
|
42
42
|
const Client_js_1 = require("./api/resources/brands/client/Client.js");
|
|
43
|
-
const Client_js_2 = require("./api/resources/
|
|
44
|
-
const Client_js_3 = require("./api/resources/
|
|
45
|
-
const Client_js_4 = require("./api/resources/
|
|
46
|
-
const Client_js_5 = require("./api/resources/
|
|
47
|
-
const Client_js_6 = require("./api/resources/
|
|
48
|
-
const Client_js_7 = require("./api/resources/
|
|
49
|
-
const Client_js_8 = require("./api/resources/
|
|
50
|
-
const Client_js_9 = require("./api/resources/
|
|
51
|
-
const Client_js_10 = require("./api/resources/
|
|
43
|
+
const Client_js_2 = require("./api/resources/audiences/client/Client.js");
|
|
44
|
+
const Client_js_3 = require("./api/resources/contacts/client/Client.js");
|
|
45
|
+
const Client_js_4 = require("./api/resources/conversations/client/Client.js");
|
|
46
|
+
const Client_js_5 = require("./api/resources/messages/client/Client.js");
|
|
47
|
+
const Client_js_6 = require("./api/resources/phoneNumbers/client/Client.js");
|
|
48
|
+
const Client_js_7 = require("./api/resources/rcs/client/Client.js");
|
|
49
|
+
const Client_js_8 = require("./api/resources/webhooks/client/Client.js");
|
|
50
|
+
const Client_js_9 = require("./api/resources/campaigns/client/Client.js");
|
|
51
|
+
const Client_js_10 = require("./api/resources/status/client/Client.js");
|
|
52
|
+
const Client_js_11 = require("./api/resources/tools/client/Client.js");
|
|
52
53
|
class PinnacleClient {
|
|
53
54
|
constructor(_options = {}) {
|
|
54
55
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
55
56
|
"X-Fern-Language": "JavaScript",
|
|
56
57
|
"X-Fern-SDK-Name": "rcs-js",
|
|
57
|
-
"X-Fern-SDK-Version": "2.0.
|
|
58
|
-
"User-Agent": "rcs-js/2.0.
|
|
58
|
+
"X-Fern-SDK-Version": "2.0.5-rc.1",
|
|
59
|
+
"User-Agent": "rcs-js/2.0.5-rc.1",
|
|
59
60
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
60
61
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
61
62
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -64,41 +65,45 @@ class PinnacleClient {
|
|
|
64
65
|
var _a;
|
|
65
66
|
return ((_a = this._brands) !== null && _a !== void 0 ? _a : (this._brands = new Client_js_1.Brands(this._options)));
|
|
66
67
|
}
|
|
68
|
+
get audiences() {
|
|
69
|
+
var _a;
|
|
70
|
+
return ((_a = this._audiences) !== null && _a !== void 0 ? _a : (this._audiences = new Client_js_2.Audiences(this._options)));
|
|
71
|
+
}
|
|
67
72
|
get contacts() {
|
|
68
73
|
var _a;
|
|
69
|
-
return ((_a = this._contacts) !== null && _a !== void 0 ? _a : (this._contacts = new
|
|
74
|
+
return ((_a = this._contacts) !== null && _a !== void 0 ? _a : (this._contacts = new Client_js_3.Contacts(this._options)));
|
|
70
75
|
}
|
|
71
76
|
get conversations() {
|
|
72
77
|
var _a;
|
|
73
|
-
return ((_a = this._conversations) !== null && _a !== void 0 ? _a : (this._conversations = new
|
|
78
|
+
return ((_a = this._conversations) !== null && _a !== void 0 ? _a : (this._conversations = new Client_js_4.Conversations(this._options)));
|
|
74
79
|
}
|
|
75
80
|
get messages() {
|
|
76
81
|
var _a;
|
|
77
|
-
return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new
|
|
82
|
+
return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_js_5.Messages(this._options)));
|
|
78
83
|
}
|
|
79
84
|
get phoneNumbers() {
|
|
80
85
|
var _a;
|
|
81
|
-
return ((_a = this._phoneNumbers) !== null && _a !== void 0 ? _a : (this._phoneNumbers = new
|
|
86
|
+
return ((_a = this._phoneNumbers) !== null && _a !== void 0 ? _a : (this._phoneNumbers = new Client_js_6.PhoneNumbers(this._options)));
|
|
82
87
|
}
|
|
83
88
|
get rcs() {
|
|
84
89
|
var _a;
|
|
85
|
-
return ((_a = this._rcs) !== null && _a !== void 0 ? _a : (this._rcs = new
|
|
90
|
+
return ((_a = this._rcs) !== null && _a !== void 0 ? _a : (this._rcs = new Client_js_7.Rcs(this._options)));
|
|
86
91
|
}
|
|
87
92
|
get webhooks() {
|
|
88
93
|
var _a;
|
|
89
|
-
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new
|
|
94
|
+
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_js_8.Webhooks(this._options)));
|
|
90
95
|
}
|
|
91
96
|
get campaigns() {
|
|
92
97
|
var _a;
|
|
93
|
-
return ((_a = this._campaigns) !== null && _a !== void 0 ? _a : (this._campaigns = new
|
|
98
|
+
return ((_a = this._campaigns) !== null && _a !== void 0 ? _a : (this._campaigns = new Client_js_9.Campaigns(this._options)));
|
|
94
99
|
}
|
|
95
100
|
get status() {
|
|
96
101
|
var _a;
|
|
97
|
-
return ((_a = this._status) !== null && _a !== void 0 ? _a : (this._status = new
|
|
102
|
+
return ((_a = this._status) !== null && _a !== void 0 ? _a : (this._status = new Client_js_10.Status(this._options)));
|
|
98
103
|
}
|
|
99
104
|
get tools() {
|
|
100
105
|
var _a;
|
|
101
|
-
return ((_a = this._tools) !== null && _a !== void 0 ? _a : (this._tools = new
|
|
106
|
+
return ((_a = this._tools) !== null && _a !== void 0 ? _a : (this._tools = new Client_js_11.Tools(this._options)));
|
|
102
107
|
}
|
|
103
108
|
}
|
|
104
109
|
exports.PinnacleClient = PinnacleClient;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments.js";
|
|
5
|
+
import * as core from "../../../../core/index.js";
|
|
6
|
+
import * as Pinnacle from "../../../index.js";
|
|
7
|
+
import { Contacts } from "../resources/contacts/client/Client.js";
|
|
8
|
+
export declare namespace Audiences {
|
|
9
|
+
interface Options {
|
|
10
|
+
environment?: core.Supplier<environments.PinnacleEnvironment | string>;
|
|
11
|
+
/** Specify a custom URL to connect the client to. */
|
|
12
|
+
baseUrl?: core.Supplier<string>;
|
|
13
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
14
|
+
/** Additional headers to include in requests. */
|
|
15
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
16
|
+
}
|
|
17
|
+
interface RequestOptions {
|
|
18
|
+
/** The maximum time to wait for a response in seconds. */
|
|
19
|
+
timeoutInSeconds?: number;
|
|
20
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
21
|
+
maxRetries?: number;
|
|
22
|
+
/** A hook to abort the request. */
|
|
23
|
+
abortSignal?: AbortSignal;
|
|
24
|
+
/** Additional query string parameters to include in the request. */
|
|
25
|
+
queryParams?: Record<string, unknown>;
|
|
26
|
+
/** Additional headers to include in the request. */
|
|
27
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export declare class Audiences {
|
|
31
|
+
protected readonly _options: Audiences.Options;
|
|
32
|
+
protected _contacts: Contacts | undefined;
|
|
33
|
+
constructor(_options?: Audiences.Options);
|
|
34
|
+
get contacts(): Contacts;
|
|
35
|
+
/**
|
|
36
|
+
* Retrieve an audience by ID with optional pagination.
|
|
37
|
+
*
|
|
38
|
+
* @param {Pinnacle.AudiencesGetRequest} request
|
|
39
|
+
* @param {Audiences.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.get({
|
|
48
|
+
* id: "aud_abc123"
|
|
49
|
+
* })
|
|
50
|
+
*/
|
|
51
|
+
get(request: Pinnacle.AudiencesGetRequest, requestOptions?: Audiences.RequestOptions): core.HttpResponsePromise<Pinnacle.AudiencesGetResponse>;
|
|
52
|
+
private __get;
|
|
53
|
+
/**
|
|
54
|
+
* Create a new audience with optional initial contacts. Phone numbers that don't exist will be auto-created as contacts.
|
|
55
|
+
*
|
|
56
|
+
* @param {Pinnacle.CreateAudienceParams} request
|
|
57
|
+
* @param {Audiences.RequestOptions} requestOptions - Request-specific configuration.
|
|
58
|
+
*
|
|
59
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
60
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
61
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* await client.audiences.create({
|
|
65
|
+
* name: "Marketing Campaign Q1",
|
|
66
|
+
* description: "Contacts for Q1 marketing push"
|
|
67
|
+
* })
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* await client.audiences.create({
|
|
71
|
+
* name: "VIP Customers",
|
|
72
|
+
* description: "Our best customers",
|
|
73
|
+
* contacts: ["+12125551234", "+13105551234"]
|
|
74
|
+
* })
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* await client.audiences.create({
|
|
78
|
+
* name: "Mixed Audience",
|
|
79
|
+
* contacts: ["+12125551234", "cont_abc123", "+13105551234"]
|
|
80
|
+
* })
|
|
81
|
+
*/
|
|
82
|
+
create(request: Pinnacle.CreateAudienceParams, requestOptions?: Audiences.RequestOptions): core.HttpResponsePromise<Pinnacle.AudienceCountOnly>;
|
|
83
|
+
private __create;
|
|
84
|
+
/**
|
|
85
|
+
* Permanently delete an audience and all its contact associations.
|
|
86
|
+
*
|
|
87
|
+
* Note: This will NOT delete the contacts themselves, only the audience and its memberships.
|
|
88
|
+
*
|
|
89
|
+
* @param {Pinnacle.AudiencesDeleteRequest} request
|
|
90
|
+
* @param {Audiences.RequestOptions} requestOptions - Request-specific configuration.
|
|
91
|
+
*
|
|
92
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
93
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
94
|
+
* @throws {@link Pinnacle.NotFoundError}
|
|
95
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* await client.audiences.delete({
|
|
99
|
+
* id: "aud_abc123"
|
|
100
|
+
* })
|
|
101
|
+
*/
|
|
102
|
+
delete(request: Pinnacle.AudiencesDeleteRequest, requestOptions?: Audiences.RequestOptions): core.HttpResponsePromise<Pinnacle.DeleteAudienceResponse>;
|
|
103
|
+
private __delete;
|
|
104
|
+
/**
|
|
105
|
+
* Update audience metadata. This endpoint does NOT modify contacts.
|
|
106
|
+
*
|
|
107
|
+
* To add or remove contacts, use the [Add Contacts](/api-reference/audiences/add-contacts) or [Remove Contacts](/api-reference/audiences/remove-contacts) endpoints.
|
|
108
|
+
*
|
|
109
|
+
* @param {Pinnacle.UpdateAudienceParams} request
|
|
110
|
+
* @param {Audiences.RequestOptions} requestOptions - Request-specific configuration.
|
|
111
|
+
*
|
|
112
|
+
* @throws {@link Pinnacle.BadRequestError}
|
|
113
|
+
* @throws {@link Pinnacle.UnauthorizedError}
|
|
114
|
+
* @throws {@link Pinnacle.NotFoundError}
|
|
115
|
+
* @throws {@link Pinnacle.InternalServerError}
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* await client.audiences.update({
|
|
119
|
+
* id: "aud_abc123",
|
|
120
|
+
* name: "Updated Audience Name",
|
|
121
|
+
* description: "New description"
|
|
122
|
+
* })
|
|
123
|
+
*/
|
|
124
|
+
update(request: Pinnacle.UpdateAudienceParams, requestOptions?: Audiences.RequestOptions): core.HttpResponsePromise<Pinnacle.AudienceCountOnly>;
|
|
125
|
+
private __update;
|
|
126
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
127
|
+
"PINNACLE-API-KEY": string | undefined;
|
|
128
|
+
}>;
|
|
129
|
+
}
|