agentphone 1.0.12 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +3 -0
- package/dist/cjs/Client.js +9 -4
- package/dist/cjs/api/resources/agents/client/Client.js +11 -11
- package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +2 -0
- package/dist/cjs/api/resources/agents/client/requests/DeleteAgentV1AgentsAgentIdDeleteRequest.d.ts +2 -0
- package/dist/cjs/api/resources/agents/client/requests/GetAgentV1AgentsAgentIdGetRequest.d.ts +2 -0
- package/dist/cjs/api/resources/agents/client/requests/ListAgentsV1AgentsGetRequest.d.ts +2 -1
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +2 -0
- package/dist/cjs/api/resources/calls/client/Client.js +16 -5
- package/dist/cjs/api/resources/calls/client/requests/CreateOutboundCallRequest.d.ts +2 -0
- package/dist/cjs/api/resources/calls/client/requests/ListCallsV1CallsGetRequest.d.ts +2 -1
- package/dist/cjs/api/resources/contacts/client/Client.js +2 -3
- package/dist/cjs/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.d.ts +2 -1
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +5 -3
- package/dist/cjs/api/resources/conversations/client/Client.js +7 -6
- package/dist/cjs/api/resources/conversations/client/requests/ListConversationsV1ConversationsGetRequest.d.ts +2 -1
- package/dist/cjs/api/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/index.js +3 -1
- package/dist/cjs/api/resources/numbers/client/Client.js +18 -7
- package/dist/cjs/api/resources/numbers/client/requests/CreateNumberRequest.d.ts +2 -0
- package/dist/cjs/api/resources/numbers/client/requests/DeleteNumberV1NumbersNumberIdDeleteRequest.d.ts +2 -0
- package/dist/cjs/api/resources/numbers/client/requests/ListNumbersV1NumbersGetRequest.d.ts +2 -1
- package/dist/cjs/api/resources/subAccounts/client/Client.d.ts +61 -0
- package/dist/cjs/api/resources/subAccounts/client/Client.js +261 -0
- package/dist/cjs/api/resources/subAccounts/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/subAccounts/client/index.js +17 -0
- package/dist/cjs/api/resources/subAccounts/client/requests/CreateSubAccountRequest.d.ts +9 -0
- package/dist/cjs/api/resources/subAccounts/client/requests/CreateSubAccountRequest.js +3 -0
- package/dist/cjs/api/resources/subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.d.ts +9 -0
- package/dist/cjs/api/resources/subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.js +3 -0
- package/dist/cjs/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.d.ts +11 -0
- package/dist/cjs/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.js +3 -0
- package/dist/cjs/api/resources/subAccounts/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/subAccounts/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/subAccounts/index.d.ts +1 -0
- package/dist/cjs/api/resources/subAccounts/index.js +17 -0
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +7 -4
- package/dist/cjs/api/resources/webhooks/client/Client.js +14 -9
- package/dist/cjs/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.d.ts +14 -0
- package/dist/cjs/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.d.ts +8 -0
- package/dist/cjs/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/types/AppRoutesConversationsConversationSummary.d.ts +6 -0
- package/dist/cjs/api/types/ConversationDetail.d.ts +5 -0
- package/dist/cjs/api/types/GroupParticipant.d.ts +7 -0
- package/dist/cjs/api/types/GroupParticipant.js +3 -0
- package/dist/cjs/api/types/MessageInConversation.d.ts +1 -0
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +5 -0
- package/dist/esm/api/resources/agents/client/Client.mjs +12 -12
- package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +2 -0
- package/dist/esm/api/resources/agents/client/requests/DeleteAgentV1AgentsAgentIdDeleteRequest.d.mts +2 -0
- package/dist/esm/api/resources/agents/client/requests/GetAgentV1AgentsAgentIdGetRequest.d.mts +2 -0
- package/dist/esm/api/resources/agents/client/requests/ListAgentsV1AgentsGetRequest.d.mts +2 -1
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +2 -0
- package/dist/esm/api/resources/calls/client/Client.mjs +17 -6
- package/dist/esm/api/resources/calls/client/requests/CreateOutboundCallRequest.d.mts +2 -0
- package/dist/esm/api/resources/calls/client/requests/ListCallsV1CallsGetRequest.d.mts +2 -1
- package/dist/esm/api/resources/contacts/client/Client.mjs +3 -4
- package/dist/esm/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.d.mts +2 -1
- package/dist/esm/api/resources/conversations/client/Client.d.mts +5 -3
- package/dist/esm/api/resources/conversations/client/Client.mjs +8 -7
- package/dist/esm/api/resources/conversations/client/requests/ListConversationsV1ConversationsGetRequest.d.mts +2 -1
- package/dist/esm/api/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/index.mjs +2 -0
- package/dist/esm/api/resources/numbers/client/Client.mjs +19 -8
- package/dist/esm/api/resources/numbers/client/requests/CreateNumberRequest.d.mts +2 -0
- package/dist/esm/api/resources/numbers/client/requests/DeleteNumberV1NumbersNumberIdDeleteRequest.d.mts +2 -0
- package/dist/esm/api/resources/numbers/client/requests/ListNumbersV1NumbersGetRequest.d.mts +2 -1
- package/dist/esm/api/resources/subAccounts/client/Client.d.mts +61 -0
- package/dist/esm/api/resources/subAccounts/client/Client.mjs +224 -0
- package/dist/esm/api/resources/subAccounts/client/index.d.mts +1 -0
- package/dist/esm/api/resources/subAccounts/client/index.mjs +1 -0
- package/dist/esm/api/resources/subAccounts/client/requests/CreateSubAccountRequest.d.mts +9 -0
- package/dist/esm/api/resources/subAccounts/client/requests/CreateSubAccountRequest.mjs +2 -0
- package/dist/esm/api/resources/subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.d.mts +9 -0
- package/dist/esm/api/resources/subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.mjs +2 -0
- package/dist/esm/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.d.mts +11 -0
- package/dist/esm/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.mjs +2 -0
- package/dist/esm/api/resources/subAccounts/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/subAccounts/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/subAccounts/index.d.mts +1 -0
- package/dist/esm/api/resources/subAccounts/index.mjs +1 -0
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +7 -4
- package/dist/esm/api/resources/webhooks/client/Client.mjs +15 -10
- package/dist/esm/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.d.mts +14 -0
- package/dist/esm/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.d.mts +8 -0
- package/dist/esm/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/index.d.mts +2 -0
- package/dist/esm/api/types/AppRoutesConversationsConversationSummary.d.mts +6 -0
- package/dist/esm/api/types/ConversationDetail.d.mts +5 -0
- package/dist/esm/api/types/GroupParticipant.d.mts +7 -0
- package/dist/esm/api/types/GroupParticipant.mjs +2 -0
- package/dist/esm/api/types/MessageInConversation.d.mts +1 -0
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +214 -6
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "agentphone",
|
|
46
|
-
"X-Fern-SDK-Version": "1.0.
|
|
47
|
-
"User-Agent": "agentphone/1.0.
|
|
46
|
+
"X-Fern-SDK-Version": "1.0.13",
|
|
47
|
+
"User-Agent": "agentphone/1.0.13",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { ConversationsClient } from "./api/resources/conversations/client/Client
|
|
|
7
7
|
import { MessagesClient } from "./api/resources/messages/client/Client.js";
|
|
8
8
|
import { NumbersClient } from "./api/resources/numbers/client/Client.js";
|
|
9
9
|
import { RegistrationClient } from "./api/resources/registration/client/Client.js";
|
|
10
|
+
import { SubAccountsClient } from "./api/resources/subAccounts/client/Client.js";
|
|
10
11
|
import { UsageClient } from "./api/resources/usage/client/Client.js";
|
|
11
12
|
import { WebhooksClient } from "./api/resources/webhooks/client/Client.js";
|
|
12
13
|
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
|
|
@@ -29,6 +30,7 @@ export declare class AgentPhoneClient {
|
|
|
29
30
|
protected _messages: MessagesClient | undefined;
|
|
30
31
|
protected _contactCards: ContactCardsClient | undefined;
|
|
31
32
|
protected _registration: RegistrationClient | undefined;
|
|
33
|
+
protected _subAccounts: SubAccountsClient | undefined;
|
|
32
34
|
constructor(options?: AgentPhoneClient.Options);
|
|
33
35
|
get agents(): AgentsClient;
|
|
34
36
|
get numbers(): NumbersClient;
|
|
@@ -41,4 +43,5 @@ export declare class AgentPhoneClient {
|
|
|
41
43
|
get messages(): MessagesClient;
|
|
42
44
|
get contactCards(): ContactCardsClient;
|
|
43
45
|
get registration(): RegistrationClient;
|
|
46
|
+
get subAccounts(): SubAccountsClient;
|
|
44
47
|
}
|
package/dist/cjs/Client.js
CHANGED
|
@@ -11,8 +11,9 @@ const Client_js_6 = require("./api/resources/conversations/client/Client.js");
|
|
|
11
11
|
const Client_js_7 = require("./api/resources/messages/client/Client.js");
|
|
12
12
|
const Client_js_8 = require("./api/resources/numbers/client/Client.js");
|
|
13
13
|
const Client_js_9 = require("./api/resources/registration/client/Client.js");
|
|
14
|
-
const Client_js_10 = require("./api/resources/
|
|
15
|
-
const Client_js_11 = require("./api/resources/
|
|
14
|
+
const Client_js_10 = require("./api/resources/subAccounts/client/Client.js");
|
|
15
|
+
const Client_js_11 = require("./api/resources/usage/client/Client.js");
|
|
16
|
+
const Client_js_12 = require("./api/resources/webhooks/client/Client.js");
|
|
16
17
|
const BaseClient_js_1 = require("./BaseClient.js");
|
|
17
18
|
class AgentPhoneClient {
|
|
18
19
|
constructor(options = {}) {
|
|
@@ -28,7 +29,7 @@ class AgentPhoneClient {
|
|
|
28
29
|
}
|
|
29
30
|
get webhooks() {
|
|
30
31
|
var _a;
|
|
31
|
-
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new
|
|
32
|
+
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_js_12.WebhooksClient(this._options)));
|
|
32
33
|
}
|
|
33
34
|
get agentWebhooks() {
|
|
34
35
|
var _a;
|
|
@@ -48,7 +49,7 @@ class AgentPhoneClient {
|
|
|
48
49
|
}
|
|
49
50
|
get usage() {
|
|
50
51
|
var _a;
|
|
51
|
-
return ((_a = this._usage) !== null && _a !== void 0 ? _a : (this._usage = new
|
|
52
|
+
return ((_a = this._usage) !== null && _a !== void 0 ? _a : (this._usage = new Client_js_11.UsageClient(this._options)));
|
|
52
53
|
}
|
|
53
54
|
get messages() {
|
|
54
55
|
var _a;
|
|
@@ -62,5 +63,9 @@ class AgentPhoneClient {
|
|
|
62
63
|
var _a;
|
|
63
64
|
return ((_a = this._registration) !== null && _a !== void 0 ? _a : (this._registration = new Client_js_9.RegistrationClient(this._options)));
|
|
64
65
|
}
|
|
66
|
+
get subAccounts() {
|
|
67
|
+
var _a;
|
|
68
|
+
return ((_a = this._subAccounts) !== null && _a !== void 0 ? _a : (this._subAccounts = new Client_js_10.SubAccountsClient(this._options)));
|
|
69
|
+
}
|
|
65
70
|
}
|
|
66
71
|
exports.AgentPhoneClient = AgentPhoneClient;
|
|
@@ -123,13 +123,12 @@ class AgentsClient {
|
|
|
123
123
|
__listAgents() {
|
|
124
124
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
125
125
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
126
|
-
const {
|
|
126
|
+
const { offset, "X-Sub-Account-Id": subAccountId } = request;
|
|
127
127
|
const _queryParams = {
|
|
128
|
-
limit,
|
|
129
128
|
offset,
|
|
130
129
|
};
|
|
131
130
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
132
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
131
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
133
132
|
const _response = yield core.fetcher({
|
|
134
133
|
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.AgentPhoneEnvironment.Production, "v1/agents"),
|
|
135
134
|
method: "GET",
|
|
@@ -184,8 +183,9 @@ class AgentsClient {
|
|
|
184
183
|
__createAgent(request, requestOptions) {
|
|
185
184
|
return __awaiter(this, void 0, void 0, function* () {
|
|
186
185
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
186
|
+
const { "X-Sub-Account-Id": subAccountId } = request, _body = __rest(request, ["X-Sub-Account-Id"]);
|
|
187
187
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
188
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
188
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
189
189
|
const _response = yield core.fetcher({
|
|
190
190
|
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.AgentPhoneEnvironment.Production, "v1/agents"),
|
|
191
191
|
method: "POST",
|
|
@@ -193,7 +193,7 @@ class AgentsClient {
|
|
|
193
193
|
contentType: "application/json",
|
|
194
194
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
195
195
|
requestType: "json",
|
|
196
|
-
body:
|
|
196
|
+
body: _body,
|
|
197
197
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
198
198
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
199
199
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -237,9 +237,9 @@ class AgentsClient {
|
|
|
237
237
|
__getAgent(request, requestOptions) {
|
|
238
238
|
return __awaiter(this, void 0, void 0, function* () {
|
|
239
239
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
240
|
-
const { agent_id: agentId } = request;
|
|
240
|
+
const { agent_id: agentId, "X-Sub-Account-Id": subAccountId } = request;
|
|
241
241
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
242
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
242
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
243
243
|
const _response = yield core.fetcher({
|
|
244
244
|
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.AgentPhoneEnvironment.Production, `v1/agents/${core.url.encodePathParam(agentId)}`),
|
|
245
245
|
method: "GET",
|
|
@@ -291,9 +291,9 @@ class AgentsClient {
|
|
|
291
291
|
__deleteAgent(request, requestOptions) {
|
|
292
292
|
return __awaiter(this, void 0, void 0, function* () {
|
|
293
293
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
294
|
-
const { agent_id: agentId } = request;
|
|
294
|
+
const { agent_id: agentId, "X-Sub-Account-Id": subAccountId } = request;
|
|
295
295
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
296
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
296
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
297
297
|
const _response = yield core.fetcher({
|
|
298
298
|
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.AgentPhoneEnvironment.Production, `v1/agents/${core.url.encodePathParam(agentId)}`),
|
|
299
299
|
method: "DELETE",
|
|
@@ -345,9 +345,9 @@ class AgentsClient {
|
|
|
345
345
|
__updateAgent(request, requestOptions) {
|
|
346
346
|
return __awaiter(this, void 0, void 0, function* () {
|
|
347
347
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
348
|
-
const { agent_id: agentId } = request, _body = __rest(request, ["agent_id"]);
|
|
348
|
+
const { agent_id: agentId, "X-Sub-Account-Id": subAccountId } = request, _body = __rest(request, ["agent_id", "X-Sub-Account-Id"]);
|
|
349
349
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
350
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
350
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
351
351
|
const _response = yield core.fetcher({
|
|
352
352
|
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.AgentPhoneEnvironment.Production, `v1/agents/${core.url.encodePathParam(agentId)}`),
|
|
353
353
|
method: "PATCH",
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* }
|
|
6
6
|
*/
|
|
7
7
|
export interface CreateAgentRequest {
|
|
8
|
+
/** Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account. */
|
|
9
|
+
"X-Sub-Account-Id"?: string;
|
|
8
10
|
name: string;
|
|
9
11
|
description?: string | null;
|
|
10
12
|
voiceMode?: CreateAgentRequest.VoiceMode;
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export interface UpdateAgentRequest {
|
|
8
8
|
agent_id: string;
|
|
9
|
+
/** Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account. */
|
|
10
|
+
"X-Sub-Account-Id"?: string;
|
|
9
11
|
name?: string | null;
|
|
10
12
|
description?: string | null;
|
|
11
13
|
voiceMode?: UpdateAgentRequest.VoiceMode;
|
|
@@ -42,6 +42,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
42
42
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
46
|
+
var t = {};
|
|
47
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
48
|
+
t[p] = s[p];
|
|
49
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
50
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
51
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
52
|
+
t[p[i]] = s[p[i]];
|
|
53
|
+
}
|
|
54
|
+
return t;
|
|
55
|
+
};
|
|
45
56
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
57
|
exports.CallsClient = void 0;
|
|
47
58
|
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
@@ -72,9 +83,8 @@ class CallsClient {
|
|
|
72
83
|
__listCalls() {
|
|
73
84
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
74
85
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
75
|
-
const {
|
|
86
|
+
const { offset, status, direction, type: type_, search, "X-Sub-Account-Id": subAccountId } = request;
|
|
76
87
|
const _queryParams = {
|
|
77
|
-
limit,
|
|
78
88
|
offset,
|
|
79
89
|
status,
|
|
80
90
|
direction,
|
|
@@ -82,7 +92,7 @@ class CallsClient {
|
|
|
82
92
|
search,
|
|
83
93
|
};
|
|
84
94
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
85
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
95
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
86
96
|
const _response = yield core.fetcher({
|
|
87
97
|
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.AgentPhoneEnvironment.Production, "v1/calls"),
|
|
88
98
|
method: "GET",
|
|
@@ -143,8 +153,9 @@ class CallsClient {
|
|
|
143
153
|
__createOutboundCall(request, requestOptions) {
|
|
144
154
|
return __awaiter(this, void 0, void 0, function* () {
|
|
145
155
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
156
|
+
const { "X-Sub-Account-Id": subAccountId } = request, _body = __rest(request, ["X-Sub-Account-Id"]);
|
|
146
157
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
147
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
158
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
148
159
|
const _response = yield core.fetcher({
|
|
149
160
|
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.AgentPhoneEnvironment.Production, "v1/calls"),
|
|
150
161
|
method: "POST",
|
|
@@ -152,7 +163,7 @@ class CallsClient {
|
|
|
152
163
|
contentType: "application/json",
|
|
153
164
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
154
165
|
requestType: "json",
|
|
155
|
-
body:
|
|
166
|
+
body: _body,
|
|
156
167
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
157
168
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
158
169
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* }
|
|
7
7
|
*/
|
|
8
8
|
export interface CreateOutboundCallRequest {
|
|
9
|
+
/** Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account. */
|
|
10
|
+
"X-Sub-Account-Id"?: string;
|
|
9
11
|
/** Agent ID to make the call from */
|
|
10
12
|
agentId: string;
|
|
11
13
|
/** Phone number to call (E.164 format) */
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* {}
|
|
4
4
|
*/
|
|
5
5
|
export interface ListCallsV1CallsGetRequest {
|
|
6
|
-
limit?: number;
|
|
7
6
|
offset?: number;
|
|
8
7
|
/** Filter by status: completed, in-progress, failed */
|
|
9
8
|
status?: string | null;
|
|
@@ -13,4 +12,6 @@ export interface ListCallsV1CallsGetRequest {
|
|
|
13
12
|
type?: string | null;
|
|
14
13
|
/** Search fromNumber or toNumber (contains) */
|
|
15
14
|
search?: string | null;
|
|
15
|
+
/** Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account. */
|
|
16
|
+
"X-Sub-Account-Id"?: string;
|
|
16
17
|
}
|
|
@@ -85,14 +85,13 @@ class ContactsClient {
|
|
|
85
85
|
__listContacts() {
|
|
86
86
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
87
87
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
88
|
-
const {
|
|
88
|
+
const { limit, offset, "X-Sub-Account-Id": subAccountId } = request;
|
|
89
89
|
const _queryParams = {
|
|
90
|
-
search,
|
|
91
90
|
limit,
|
|
92
91
|
offset,
|
|
93
92
|
};
|
|
94
93
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
95
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
94
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
96
95
|
const _response = yield core.fetcher({
|
|
97
96
|
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.AgentPhoneEnvironment.Production, "v1/contacts"),
|
|
98
97
|
method: "GET",
|
package/dist/cjs/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.d.ts
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* {}
|
|
4
4
|
*/
|
|
5
5
|
export interface ListContactsV1ContactsGetRequest {
|
|
6
|
-
search?: string | null;
|
|
7
6
|
limit?: number;
|
|
8
7
|
offset?: number;
|
|
8
|
+
/** Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account. */
|
|
9
|
+
"X-Sub-Account-Id"?: string;
|
|
9
10
|
}
|
|
@@ -83,9 +83,11 @@ export declare class ConversationsClient {
|
|
|
83
83
|
/**
|
|
84
84
|
* Show a typing indicator in the conversation (iMessage only).
|
|
85
85
|
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
86
|
+
* Works for both 1:1 and group chats: a group id is itself a valid typing
|
|
87
|
+
* target, so every participant sees the indicator. Best-effort: the
|
|
88
|
+
* indicator may be silently dropped if the chat has no recent activity, the
|
|
89
|
+
* recipient isn't on iMessage, or it's RCS-routed (RCS carries no composing
|
|
90
|
+
* state). Auto-expires after a few seconds; no "stop typing" call needed.
|
|
89
91
|
*
|
|
90
92
|
* @param {AgentPhone.SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest} request
|
|
91
93
|
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -86,13 +86,12 @@ class ConversationsClient {
|
|
|
86
86
|
__listConversations() {
|
|
87
87
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
88
88
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
89
|
-
const {
|
|
89
|
+
const { offset, "X-Sub-Account-Id": subAccountId } = request;
|
|
90
90
|
const _queryParams = {
|
|
91
|
-
limit,
|
|
92
91
|
offset,
|
|
93
92
|
};
|
|
94
93
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
95
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
94
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
96
95
|
const _response = yield core.fetcher({
|
|
97
96
|
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.AgentPhoneEnvironment.Production, "v1/conversations"),
|
|
98
97
|
method: "GET",
|
|
@@ -301,9 +300,11 @@ class ConversationsClient {
|
|
|
301
300
|
/**
|
|
302
301
|
* Show a typing indicator in the conversation (iMessage only).
|
|
303
302
|
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
303
|
+
* Works for both 1:1 and group chats: a group id is itself a valid typing
|
|
304
|
+
* target, so every participant sees the indicator. Best-effort: the
|
|
305
|
+
* indicator may be silently dropped if the chat has no recent activity, the
|
|
306
|
+
* recipient isn't on iMessage, or it's RCS-routed (RCS carries no composing
|
|
307
|
+
* state). Auto-expires after a few seconds; no "stop typing" call needed.
|
|
307
308
|
*
|
|
308
309
|
* @param {AgentPhone.SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest} request
|
|
309
310
|
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -16,6 +16,8 @@ export * from "./numbers/client/requests/index.js";
|
|
|
16
16
|
export * as numbers from "./numbers/index.js";
|
|
17
17
|
export * from "./registration/client/requests/index.js";
|
|
18
18
|
export * as registration from "./registration/index.js";
|
|
19
|
+
export * from "./subAccounts/client/requests/index.js";
|
|
20
|
+
export * as subAccounts from "./subAccounts/index.js";
|
|
19
21
|
export * from "./usage/client/requests/index.js";
|
|
20
22
|
export * as usage from "./usage/index.js";
|
|
21
23
|
export * from "./usage/types/index.js";
|
|
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.webhooks = exports.usage = exports.registration = exports.numbers = exports.messages = exports.conversations = exports.contacts = exports.contactCards = exports.calls = exports.agentWebhooks = exports.agents = void 0;
|
|
39
|
+
exports.webhooks = exports.usage = exports.subAccounts = exports.registration = exports.numbers = exports.messages = exports.conversations = exports.contacts = exports.contactCards = exports.calls = exports.agentWebhooks = exports.agents = void 0;
|
|
40
40
|
__exportStar(require("./agents/client/requests/index.js"), exports);
|
|
41
41
|
exports.agents = __importStar(require("./agents/index.js"));
|
|
42
42
|
__exportStar(require("./agentWebhooks/client/requests/index.js"), exports);
|
|
@@ -55,6 +55,8 @@ __exportStar(require("./numbers/client/requests/index.js"), exports);
|
|
|
55
55
|
exports.numbers = __importStar(require("./numbers/index.js"));
|
|
56
56
|
__exportStar(require("./registration/client/requests/index.js"), exports);
|
|
57
57
|
exports.registration = __importStar(require("./registration/index.js"));
|
|
58
|
+
__exportStar(require("./subAccounts/client/requests/index.js"), exports);
|
|
59
|
+
exports.subAccounts = __importStar(require("./subAccounts/index.js"));
|
|
58
60
|
__exportStar(require("./usage/client/requests/index.js"), exports);
|
|
59
61
|
exports.usage = __importStar(require("./usage/index.js"));
|
|
60
62
|
__exportStar(require("./usage/types/index.js"), exports);
|
|
@@ -42,6 +42,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
42
42
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
46
|
+
var t = {};
|
|
47
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
48
|
+
t[p] = s[p];
|
|
49
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
50
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
51
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
52
|
+
t[p[i]] = s[p[i]];
|
|
53
|
+
}
|
|
54
|
+
return t;
|
|
55
|
+
};
|
|
45
56
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
57
|
exports.NumbersClient = void 0;
|
|
47
58
|
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
@@ -72,13 +83,12 @@ class NumbersClient {
|
|
|
72
83
|
__listNumbers() {
|
|
73
84
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
74
85
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
75
|
-
const {
|
|
86
|
+
const { offset, "X-Sub-Account-Id": subAccountId } = request;
|
|
76
87
|
const _queryParams = {
|
|
77
|
-
limit,
|
|
78
88
|
offset,
|
|
79
89
|
};
|
|
80
90
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
81
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
91
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
82
92
|
const _response = yield core.fetcher({
|
|
83
93
|
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.AgentPhoneEnvironment.Production, "v1/numbers"),
|
|
84
94
|
method: "GET",
|
|
@@ -131,8 +141,9 @@ class NumbersClient {
|
|
|
131
141
|
__createNumber() {
|
|
132
142
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
133
143
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
144
|
+
const { "X-Sub-Account-Id": subAccountId } = request, _body = __rest(request, ["X-Sub-Account-Id"]);
|
|
134
145
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
135
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
146
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
136
147
|
const _response = yield core.fetcher({
|
|
137
148
|
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.AgentPhoneEnvironment.Production, "v1/numbers"),
|
|
138
149
|
method: "POST",
|
|
@@ -140,7 +151,7 @@ class NumbersClient {
|
|
|
140
151
|
contentType: "application/json",
|
|
141
152
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
142
153
|
requestType: "json",
|
|
143
|
-
body:
|
|
154
|
+
body: _body,
|
|
144
155
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
145
156
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
146
157
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -249,9 +260,9 @@ class NumbersClient {
|
|
|
249
260
|
__deleteNumber(request, requestOptions) {
|
|
250
261
|
return __awaiter(this, void 0, void 0, function* () {
|
|
251
262
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
252
|
-
const { number_id: numberId } = request;
|
|
263
|
+
const { number_id: numberId, "X-Sub-Account-Id": subAccountId } = request;
|
|
253
264
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
254
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
265
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
255
266
|
const _response = yield core.fetcher({
|
|
256
267
|
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.AgentPhoneEnvironment.Production, `v1/numbers/${core.url.encodePathParam(numberId)}`),
|
|
257
268
|
method: "DELETE",
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
|
+
import * as core from "../../../../core/index.js";
|
|
4
|
+
import * as AgentPhone from "../../../index.js";
|
|
5
|
+
export declare namespace SubAccountsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class SubAccountsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<SubAccountsClient.Options>;
|
|
12
|
+
constructor(options?: SubAccountsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* await client.subAccounts.listSubAccounts()
|
|
18
|
+
*/
|
|
19
|
+
listSubAccounts(requestOptions?: SubAccountsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
20
|
+
private __listSubAccounts;
|
|
21
|
+
/**
|
|
22
|
+
* @param {AgentPhone.CreateSubAccountRequest} request
|
|
23
|
+
* @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
24
|
+
*
|
|
25
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* await client.subAccounts.createSubAccount({
|
|
29
|
+
* name: "name"
|
|
30
|
+
* })
|
|
31
|
+
*/
|
|
32
|
+
createSubAccount(request: AgentPhone.CreateSubAccountRequest, requestOptions?: SubAccountsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
33
|
+
private __createSubAccount;
|
|
34
|
+
/**
|
|
35
|
+
* @param {AgentPhone.DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest} request
|
|
36
|
+
* @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
|
+
*
|
|
38
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* await client.subAccounts.deleteSubAccount({
|
|
42
|
+
* sub_account_id: "sub_account_id"
|
|
43
|
+
* })
|
|
44
|
+
*/
|
|
45
|
+
deleteSubAccount(request: AgentPhone.DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest, requestOptions?: SubAccountsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
46
|
+
private __deleteSubAccount;
|
|
47
|
+
/**
|
|
48
|
+
* @param {AgentPhone.UpdateSubAccountRequest} request
|
|
49
|
+
* @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
50
|
+
*
|
|
51
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* await client.subAccounts.updateSubAccount({
|
|
55
|
+
* sub_account_id: "sub_account_id",
|
|
56
|
+
* name: "name"
|
|
57
|
+
* })
|
|
58
|
+
*/
|
|
59
|
+
updateSubAccount(request: AgentPhone.UpdateSubAccountRequest, requestOptions?: SubAccountsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
60
|
+
private __updateSubAccount;
|
|
61
|
+
}
|