@surgeapi/node 0.25.6 → 0.25.7
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/api/resources/accounts/client/Client.js +2 -2
- package/api/resources/blasts/client/Client.d.ts +2 -3
- package/api/resources/blasts/client/Client.js +3 -4
- package/api/resources/blasts/client/requests/BlastRequest.d.ts +6 -5
- package/api/resources/contacts/client/Client.js +3 -3
- package/api/resources/messages/client/Client.js +1 -1
- package/api/resources/phoneNumbers/client/Client.js +1 -1
- package/api/resources/users/client/Client.js +2 -2
- package/api/resources/verifications/client/Client.js +2 -2
- package/api/types/MessageConversationParams.d.ts +1 -1
- package/dist/api/resources/accounts/client/Client.js +2 -2
- package/dist/api/resources/blasts/client/Client.d.ts +2 -3
- package/dist/api/resources/blasts/client/Client.js +3 -4
- package/dist/api/resources/blasts/client/requests/BlastRequest.d.ts +6 -5
- package/dist/api/resources/contacts/client/Client.js +3 -3
- package/dist/api/resources/messages/client/Client.js +1 -1
- package/dist/api/resources/phoneNumbers/client/Client.js +1 -1
- package/dist/api/resources/users/client/Client.js +2 -2
- package/dist/api/resources/verifications/client/Client.js +2 -2
- package/dist/api/types/MessageConversationParams.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +1 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -78,7 +78,7 @@ class Accounts {
|
|
|
78
78
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
79
79
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, "accounts"),
|
|
80
80
|
method: "POST",
|
|
81
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
81
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
82
82
|
contentType: "application/json",
|
|
83
83
|
requestType: "json",
|
|
84
84
|
body: request,
|
|
@@ -135,7 +135,7 @@ class Accounts {
|
|
|
135
135
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
136
136
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `accounts/${encodeURIComponent(id)}`),
|
|
137
137
|
method: "PATCH",
|
|
138
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
138
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
139
139
|
contentType: "application/json",
|
|
140
140
|
requestType: "json",
|
|
141
141
|
body: request,
|
|
@@ -39,10 +39,9 @@ export declare class Blasts {
|
|
|
39
39
|
* url: "https://example.com/image.jpg"
|
|
40
40
|
* }],
|
|
41
41
|
* body: "Join us for our grand opening!",
|
|
42
|
-
* contacts: ["ctc_01j9dy8mdzfn3r0e8x1tbdrdrf"],
|
|
43
42
|
* name: "Grand Opening Announcement",
|
|
44
|
-
*
|
|
45
|
-
*
|
|
43
|
+
* send_at: "2024-02-01T15:00:00Z",
|
|
44
|
+
* to: ["seg_01j9dy8mdzfn3r0e8x1tbdrdrf", "ctc_01j9dy8mdzfn3r0e8x1tbdrdrf", "+18015551234", "+18015555678"]
|
|
46
45
|
* })
|
|
47
46
|
*/
|
|
48
47
|
send(accountId: string, request?: Surge.BlastRequest, requestOptions?: Blasts.RequestOptions): core.HttpResponsePromise<Surge.BlastResponse>;
|
|
@@ -70,10 +70,9 @@ class Blasts {
|
|
|
70
70
|
* url: "https://example.com/image.jpg"
|
|
71
71
|
* }],
|
|
72
72
|
* body: "Join us for our grand opening!",
|
|
73
|
-
* contacts: ["ctc_01j9dy8mdzfn3r0e8x1tbdrdrf"],
|
|
74
73
|
* name: "Grand Opening Announcement",
|
|
75
|
-
*
|
|
76
|
-
*
|
|
74
|
+
* send_at: "2024-02-01T15:00:00Z",
|
|
75
|
+
* to: ["seg_01j9dy8mdzfn3r0e8x1tbdrdrf", "ctc_01j9dy8mdzfn3r0e8x1tbdrdrf", "+18015551234", "+18015555678"]
|
|
77
76
|
* })
|
|
78
77
|
*/
|
|
79
78
|
send(accountId, request = {}, requestOptions) {
|
|
@@ -85,7 +84,7 @@ class Blasts {
|
|
|
85
84
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
86
85
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `accounts/${encodeURIComponent(accountId)}/blasts`),
|
|
87
86
|
method: "POST",
|
|
88
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
87
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
89
88
|
contentType: "application/json",
|
|
90
89
|
requestType: "json",
|
|
91
90
|
body: request,
|
|
@@ -9,22 +9,23 @@ import * as Surge from "../../../../index";
|
|
|
9
9
|
* url: "https://example.com/image.jpg"
|
|
10
10
|
* }],
|
|
11
11
|
* body: "Join us for our grand opening!",
|
|
12
|
-
* contacts: ["ctc_01j9dy8mdzfn3r0e8x1tbdrdrf"],
|
|
13
12
|
* name: "Grand Opening Announcement",
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* send_at: "2024-02-01T15:00:00Z",
|
|
14
|
+
* to: ["seg_01j9dy8mdzfn3r0e8x1tbdrdrf", "ctc_01j9dy8mdzfn3r0e8x1tbdrdrf", "+18015551234", "+18015555678"]
|
|
16
15
|
* }
|
|
17
16
|
*/
|
|
18
17
|
export interface BlastRequest {
|
|
19
18
|
attachments?: Surge.AttachmentParams[];
|
|
20
19
|
/** The message body. */
|
|
21
20
|
body?: string;
|
|
22
|
-
/**
|
|
21
|
+
/** Deprecated. Use `to` instead. */
|
|
23
22
|
contacts?: string[];
|
|
24
23
|
/** Optional name for the blast. */
|
|
25
24
|
name?: string;
|
|
26
|
-
/**
|
|
25
|
+
/** Deprecated. Use `to` instead. */
|
|
27
26
|
segments?: string[];
|
|
28
27
|
/** When to send the blast. If not provided, sends immediately. */
|
|
29
28
|
send_at?: string;
|
|
29
|
+
/** List of recipients to whom the blast should be sent. This can be a combination of contact IDs, segment IDs, and phone numbers. */
|
|
30
|
+
to?: string[];
|
|
30
31
|
}
|
|
@@ -84,7 +84,7 @@ class Contacts {
|
|
|
84
84
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
85
85
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `accounts/${encodeURIComponent(accountId)}/contacts`),
|
|
86
86
|
method: "POST",
|
|
87
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
87
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
88
88
|
contentType: "application/json",
|
|
89
89
|
requestType: "json",
|
|
90
90
|
body: request,
|
|
@@ -137,7 +137,7 @@ class Contacts {
|
|
|
137
137
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
138
138
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `contacts/${encodeURIComponent(id)}`),
|
|
139
139
|
method: "GET",
|
|
140
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
140
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
141
141
|
contentType: "application/json",
|
|
142
142
|
requestType: "json",
|
|
143
143
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -198,7 +198,7 @@ class Contacts {
|
|
|
198
198
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
199
199
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `contacts/${encodeURIComponent(id)}`),
|
|
200
200
|
method: "PATCH",
|
|
201
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
201
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
202
202
|
contentType: "application/json",
|
|
203
203
|
requestType: "json",
|
|
204
204
|
body: request,
|
|
@@ -88,7 +88,7 @@ class Messages {
|
|
|
88
88
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
89
89
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `accounts/${encodeURIComponent(accountId)}/messages`),
|
|
90
90
|
method: "POST",
|
|
91
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
91
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
92
92
|
contentType: "application/json",
|
|
93
93
|
requestType: "json",
|
|
94
94
|
body: request,
|
|
@@ -79,7 +79,7 @@ class PhoneNumbers {
|
|
|
79
79
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
80
80
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `accounts/${encodeURIComponent(accountId)}/phone_numbers`),
|
|
81
81
|
method: "POST",
|
|
82
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
82
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
83
83
|
contentType: "application/json",
|
|
84
84
|
requestType: "json",
|
|
85
85
|
body: request,
|
|
@@ -84,7 +84,7 @@ class Users {
|
|
|
84
84
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
85
85
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `accounts/${encodeURIComponent(accountId)}/users`),
|
|
86
86
|
method: "POST",
|
|
87
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
87
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
88
88
|
contentType: "application/json",
|
|
89
89
|
requestType: "json",
|
|
90
90
|
body: request,
|
|
@@ -137,7 +137,7 @@ class Users {
|
|
|
137
137
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
138
138
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `users/${encodeURIComponent(id)}`),
|
|
139
139
|
method: "GET",
|
|
140
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
140
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
141
141
|
contentType: "application/json",
|
|
142
142
|
requestType: "json",
|
|
143
143
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -78,7 +78,7 @@ class Verifications {
|
|
|
78
78
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
79
79
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, "verifications"),
|
|
80
80
|
method: "POST",
|
|
81
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
81
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
82
82
|
contentType: "application/json",
|
|
83
83
|
requestType: "json",
|
|
84
84
|
body: request,
|
|
@@ -137,7 +137,7 @@ class Verifications {
|
|
|
137
137
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
138
138
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `verifications/${encodeURIComponent(id)}/checks`),
|
|
139
139
|
method: "POST",
|
|
140
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
140
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
141
141
|
contentType: "application/json",
|
|
142
142
|
requestType: "json",
|
|
143
143
|
body: request,
|
|
@@ -7,6 +7,6 @@ import * as Surge from "../index";
|
|
|
7
7
|
*/
|
|
8
8
|
export interface MessageConversationParams {
|
|
9
9
|
contact: Surge.MessageConversationContactParams;
|
|
10
|
-
/** The phone number from which to send the message. This can be either the phone number
|
|
10
|
+
/** The phone number from which to send the message. This can be either the phone number in E.164 format or a Surge phone number id. */
|
|
11
11
|
phone_number?: string;
|
|
12
12
|
}
|
|
@@ -78,7 +78,7 @@ class Accounts {
|
|
|
78
78
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
79
79
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, "accounts"),
|
|
80
80
|
method: "POST",
|
|
81
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
81
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
82
82
|
contentType: "application/json",
|
|
83
83
|
requestType: "json",
|
|
84
84
|
body: request,
|
|
@@ -135,7 +135,7 @@ class Accounts {
|
|
|
135
135
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
136
136
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `accounts/${encodeURIComponent(id)}`),
|
|
137
137
|
method: "PATCH",
|
|
138
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
138
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
139
139
|
contentType: "application/json",
|
|
140
140
|
requestType: "json",
|
|
141
141
|
body: request,
|
|
@@ -39,10 +39,9 @@ export declare class Blasts {
|
|
|
39
39
|
* url: "https://example.com/image.jpg"
|
|
40
40
|
* }],
|
|
41
41
|
* body: "Join us for our grand opening!",
|
|
42
|
-
* contacts: ["ctc_01j9dy8mdzfn3r0e8x1tbdrdrf"],
|
|
43
42
|
* name: "Grand Opening Announcement",
|
|
44
|
-
*
|
|
45
|
-
*
|
|
43
|
+
* send_at: "2024-02-01T15:00:00Z",
|
|
44
|
+
* to: ["seg_01j9dy8mdzfn3r0e8x1tbdrdrf", "ctc_01j9dy8mdzfn3r0e8x1tbdrdrf", "+18015551234", "+18015555678"]
|
|
46
45
|
* })
|
|
47
46
|
*/
|
|
48
47
|
send(accountId: string, request?: Surge.BlastRequest, requestOptions?: Blasts.RequestOptions): core.HttpResponsePromise<Surge.BlastResponse>;
|
|
@@ -70,10 +70,9 @@ class Blasts {
|
|
|
70
70
|
* url: "https://example.com/image.jpg"
|
|
71
71
|
* }],
|
|
72
72
|
* body: "Join us for our grand opening!",
|
|
73
|
-
* contacts: ["ctc_01j9dy8mdzfn3r0e8x1tbdrdrf"],
|
|
74
73
|
* name: "Grand Opening Announcement",
|
|
75
|
-
*
|
|
76
|
-
*
|
|
74
|
+
* send_at: "2024-02-01T15:00:00Z",
|
|
75
|
+
* to: ["seg_01j9dy8mdzfn3r0e8x1tbdrdrf", "ctc_01j9dy8mdzfn3r0e8x1tbdrdrf", "+18015551234", "+18015555678"]
|
|
77
76
|
* })
|
|
78
77
|
*/
|
|
79
78
|
send(accountId, request = {}, requestOptions) {
|
|
@@ -85,7 +84,7 @@ class Blasts {
|
|
|
85
84
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
86
85
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `accounts/${encodeURIComponent(accountId)}/blasts`),
|
|
87
86
|
method: "POST",
|
|
88
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
87
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
89
88
|
contentType: "application/json",
|
|
90
89
|
requestType: "json",
|
|
91
90
|
body: request,
|
|
@@ -9,22 +9,23 @@ import * as Surge from "../../../../index";
|
|
|
9
9
|
* url: "https://example.com/image.jpg"
|
|
10
10
|
* }],
|
|
11
11
|
* body: "Join us for our grand opening!",
|
|
12
|
-
* contacts: ["ctc_01j9dy8mdzfn3r0e8x1tbdrdrf"],
|
|
13
12
|
* name: "Grand Opening Announcement",
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* send_at: "2024-02-01T15:00:00Z",
|
|
14
|
+
* to: ["seg_01j9dy8mdzfn3r0e8x1tbdrdrf", "ctc_01j9dy8mdzfn3r0e8x1tbdrdrf", "+18015551234", "+18015555678"]
|
|
16
15
|
* }
|
|
17
16
|
*/
|
|
18
17
|
export interface BlastRequest {
|
|
19
18
|
attachments?: Surge.AttachmentParams[];
|
|
20
19
|
/** The message body. */
|
|
21
20
|
body?: string;
|
|
22
|
-
/**
|
|
21
|
+
/** Deprecated. Use `to` instead. */
|
|
23
22
|
contacts?: string[];
|
|
24
23
|
/** Optional name for the blast. */
|
|
25
24
|
name?: string;
|
|
26
|
-
/**
|
|
25
|
+
/** Deprecated. Use `to` instead. */
|
|
27
26
|
segments?: string[];
|
|
28
27
|
/** When to send the blast. If not provided, sends immediately. */
|
|
29
28
|
send_at?: string;
|
|
29
|
+
/** List of recipients to whom the blast should be sent. This can be a combination of contact IDs, segment IDs, and phone numbers. */
|
|
30
|
+
to?: string[];
|
|
30
31
|
}
|
|
@@ -84,7 +84,7 @@ class Contacts {
|
|
|
84
84
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
85
85
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `accounts/${encodeURIComponent(accountId)}/contacts`),
|
|
86
86
|
method: "POST",
|
|
87
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
87
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
88
88
|
contentType: "application/json",
|
|
89
89
|
requestType: "json",
|
|
90
90
|
body: request,
|
|
@@ -137,7 +137,7 @@ class Contacts {
|
|
|
137
137
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
138
138
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `contacts/${encodeURIComponent(id)}`),
|
|
139
139
|
method: "GET",
|
|
140
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
140
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
141
141
|
contentType: "application/json",
|
|
142
142
|
requestType: "json",
|
|
143
143
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -198,7 +198,7 @@ class Contacts {
|
|
|
198
198
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
199
199
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `contacts/${encodeURIComponent(id)}`),
|
|
200
200
|
method: "PATCH",
|
|
201
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
201
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
202
202
|
contentType: "application/json",
|
|
203
203
|
requestType: "json",
|
|
204
204
|
body: request,
|
|
@@ -88,7 +88,7 @@ class Messages {
|
|
|
88
88
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
89
89
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `accounts/${encodeURIComponent(accountId)}/messages`),
|
|
90
90
|
method: "POST",
|
|
91
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
91
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
92
92
|
contentType: "application/json",
|
|
93
93
|
requestType: "json",
|
|
94
94
|
body: request,
|
|
@@ -79,7 +79,7 @@ class PhoneNumbers {
|
|
|
79
79
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
80
80
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `accounts/${encodeURIComponent(accountId)}/phone_numbers`),
|
|
81
81
|
method: "POST",
|
|
82
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
82
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
83
83
|
contentType: "application/json",
|
|
84
84
|
requestType: "json",
|
|
85
85
|
body: request,
|
|
@@ -84,7 +84,7 @@ class Users {
|
|
|
84
84
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
85
85
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `accounts/${encodeURIComponent(accountId)}/users`),
|
|
86
86
|
method: "POST",
|
|
87
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
87
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
88
88
|
contentType: "application/json",
|
|
89
89
|
requestType: "json",
|
|
90
90
|
body: request,
|
|
@@ -137,7 +137,7 @@ class Users {
|
|
|
137
137
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
138
138
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `users/${encodeURIComponent(id)}`),
|
|
139
139
|
method: "GET",
|
|
140
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
140
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
141
141
|
contentType: "application/json",
|
|
142
142
|
requestType: "json",
|
|
143
143
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -78,7 +78,7 @@ class Verifications {
|
|
|
78
78
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
79
79
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, "verifications"),
|
|
80
80
|
method: "POST",
|
|
81
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
81
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
82
82
|
contentType: "application/json",
|
|
83
83
|
requestType: "json",
|
|
84
84
|
body: request,
|
|
@@ -137,7 +137,7 @@ class Verifications {
|
|
|
137
137
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
138
138
|
url: (0, url_join_1.default)((_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.SurgeEnvironment.Default, `verifications/${encodeURIComponent(id)}/checks`),
|
|
139
139
|
method: "POST",
|
|
140
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.
|
|
140
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@surgeapi/node", "X-Fern-SDK-Version": "0.25.7", "User-Agent": "@surgeapi/node/0.25.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
141
141
|
contentType: "application/json",
|
|
142
142
|
requestType: "json",
|
|
143
143
|
body: request,
|
|
@@ -7,6 +7,6 @@ import * as Surge from "../index";
|
|
|
7
7
|
*/
|
|
8
8
|
export interface MessageConversationParams {
|
|
9
9
|
contact: Surge.MessageConversationContactParams;
|
|
10
|
-
/** The phone number from which to send the message. This can be either the phone number
|
|
10
|
+
/** The phone number from which to send the message. This can be either the phone number in E.164 format or a Surge phone number id. */
|
|
11
11
|
phone_number?: string;
|
|
12
12
|
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.25.
|
|
1
|
+
export declare const SDK_VERSION = "0.25.7";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -179,10 +179,9 @@ await client.blasts.send("acct_01j9a43avnfqzbjfch6pygv1td", {
|
|
|
179
179
|
},
|
|
180
180
|
],
|
|
181
181
|
body: "Join us for our grand opening!",
|
|
182
|
-
contacts: ["ctc_01j9dy8mdzfn3r0e8x1tbdrdrf"],
|
|
183
182
|
name: "Grand Opening Announcement",
|
|
184
|
-
segments: ["seg_01j9dy8mdzfn3r0e8x1tbdrdrf"],
|
|
185
183
|
send_at: "2024-02-01T15:00:00Z",
|
|
184
|
+
to: ["seg_01j9dy8mdzfn3r0e8x1tbdrdrf", "ctc_01j9dy8mdzfn3r0e8x1tbdrdrf", "+18015551234", "+18015555678"],
|
|
186
185
|
});
|
|
187
186
|
```
|
|
188
187
|
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.25.
|
|
1
|
+
export declare const SDK_VERSION = "0.25.7";
|
package/version.js
CHANGED