agentphone 1.0.3 → 1.0.5
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 +10 -10
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +4 -1
- package/dist/cjs/Client.js +24 -19
- package/dist/cjs/api/resources/agentSignup/client/Client.d.ts +50 -0
- package/dist/cjs/api/resources/agentSignup/client/Client.js +170 -0
- package/dist/cjs/api/resources/agentSignup/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/agentSignup/client/index.js +17 -0
- package/dist/cjs/api/resources/agentSignup/client/requests/AgentSignUpRequest.d.ts +10 -0
- package/dist/cjs/api/resources/agentSignup/client/requests/AgentSignUpRequest.js +3 -0
- package/dist/cjs/api/resources/agentSignup/client/requests/AgentVerifyRequest.d.ts +11 -0
- package/dist/cjs/api/resources/agentSignup/client/requests/AgentVerifyRequest.js +3 -0
- package/dist/cjs/api/resources/agentSignup/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/agentSignup/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/agentSignup/index.d.ts +1 -0
- package/dist/cjs/api/resources/agentSignup/index.js +17 -0
- package/dist/cjs/api/resources/agentWebhooks/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/agentWebhooks/client/Client.js +6 -6
- package/dist/cjs/api/resources/agents/client/Client.d.ts +11 -1
- package/dist/cjs/api/resources/agents/client/Client.js +50 -10
- package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +23 -1
- package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.js +18 -0
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +23 -1
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +18 -0
- package/dist/cjs/api/resources/agents/client/requests/index.d.ts +2 -2
- package/dist/cjs/api/resources/agents/client/requests/index.js +5 -0
- package/dist/cjs/api/resources/calls/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/calls/client/Client.js +8 -8
- package/dist/cjs/api/resources/calls/client/requests/CreateOutboundCallRequest.d.ts +2 -2
- package/dist/cjs/api/resources/contacts/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/contacts/client/Client.js +6 -6
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/conversations/client/Client.js +5 -5
- package/dist/cjs/api/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/index.js +3 -1
- package/dist/cjs/api/resources/messages/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/messages/client/Client.js +3 -3
- package/dist/cjs/api/resources/numbers/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/numbers/client/Client.js +5 -5
- package/dist/cjs/api/resources/usage/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/usage/client/Client.js +4 -4
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/webhooks/client/Client.js +8 -8
- package/dist/cjs/api/types/AgentResponse.d.ts +23 -1
- package/dist/cjs/api/types/AgentResponse.js +18 -0
- package/dist/cjs/api/types/MessageInConversation.d.ts +2 -0
- package/dist/cjs/api/types/ReactionInConversation.d.ts +7 -0
- package/dist/cjs/api/types/ReactionInConversation.js +3 -0
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -0
- package/dist/cjs/auth/BearerAuthProvider.d.ts +1 -1
- package/dist/cjs/environments.d.ts +2 -2
- package/dist/cjs/environments.js +1 -1
- 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 +4 -1
- package/dist/esm/Client.mjs +6 -1
- package/dist/esm/api/resources/agentSignup/client/Client.d.mts +50 -0
- package/dist/esm/api/resources/agentSignup/client/Client.mjs +133 -0
- package/dist/esm/api/resources/agentSignup/client/index.d.mts +1 -0
- package/dist/esm/api/resources/agentSignup/client/index.mjs +1 -0
- package/dist/esm/api/resources/agentSignup/client/requests/AgentSignUpRequest.d.mts +10 -0
- package/dist/esm/api/resources/agentSignup/client/requests/AgentSignUpRequest.mjs +2 -0
- package/dist/esm/api/resources/agentSignup/client/requests/AgentVerifyRequest.d.mts +11 -0
- package/dist/esm/api/resources/agentSignup/client/requests/AgentVerifyRequest.mjs +2 -0
- package/dist/esm/api/resources/agentSignup/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/agentSignup/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/agentSignup/index.d.mts +1 -0
- package/dist/esm/api/resources/agentSignup/index.mjs +1 -0
- package/dist/esm/api/resources/agentWebhooks/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/agentWebhooks/client/Client.mjs +6 -6
- package/dist/esm/api/resources/agents/client/Client.d.mts +11 -1
- package/dist/esm/api/resources/agents/client/Client.mjs +50 -10
- package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +23 -1
- package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.mjs +17 -1
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +23 -1
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +17 -1
- package/dist/esm/api/resources/agents/client/requests/index.d.mts +2 -2
- package/dist/esm/api/resources/agents/client/requests/index.mjs +2 -1
- package/dist/esm/api/resources/calls/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/calls/client/Client.mjs +8 -8
- package/dist/esm/api/resources/calls/client/requests/CreateOutboundCallRequest.d.mts +2 -2
- package/dist/esm/api/resources/contacts/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/contacts/client/Client.mjs +6 -6
- package/dist/esm/api/resources/conversations/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/conversations/client/Client.mjs +5 -5
- package/dist/esm/api/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/index.mjs +2 -0
- package/dist/esm/api/resources/messages/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/messages/client/Client.mjs +3 -3
- package/dist/esm/api/resources/numbers/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/numbers/client/Client.mjs +5 -5
- package/dist/esm/api/resources/usage/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/usage/client/Client.mjs +4 -4
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/webhooks/client/Client.mjs +8 -8
- package/dist/esm/api/types/AgentResponse.d.mts +23 -1
- package/dist/esm/api/types/AgentResponse.mjs +17 -1
- package/dist/esm/api/types/MessageInConversation.d.mts +2 -0
- package/dist/esm/api/types/ReactionInConversation.d.mts +7 -0
- package/dist/esm/api/types/ReactionInConversation.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/auth/BearerAuthProvider.d.mts +1 -1
- package/dist/esm/environments.d.mts +2 -2
- package/dist/esm/environments.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +193 -0
|
@@ -9,7 +9,7 @@ export declare namespace AgentWebhooksClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class AgentWebhooksClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<AgentWebhooksClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options?: AgentWebhooksClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Get the webhook configuration for a specific agent.
|
|
15
15
|
*
|
|
@@ -16,7 +16,7 @@ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCode
|
|
|
16
16
|
import * as errors from "../../../../errors/index.mjs";
|
|
17
17
|
import * as AgentPhone from "../../../index.mjs";
|
|
18
18
|
export class AgentWebhooksClient {
|
|
19
|
-
constructor(options) {
|
|
19
|
+
constructor(options = {}) {
|
|
20
20
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -42,7 +42,7 @@ export class AgentWebhooksClient {
|
|
|
42
42
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
43
43
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
44
44
|
const _response = yield core.fetcher({
|
|
45
|
-
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.
|
|
45
|
+
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)}/webhook`),
|
|
46
46
|
method: "GET",
|
|
47
47
|
headers: _headers,
|
|
48
48
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -98,7 +98,7 @@ export class AgentWebhooksClient {
|
|
|
98
98
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
99
99
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
100
100
|
const _response = yield core.fetcher({
|
|
101
|
-
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.
|
|
101
|
+
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)}/webhook`),
|
|
102
102
|
method: "POST",
|
|
103
103
|
headers: _headers,
|
|
104
104
|
contentType: "application/json",
|
|
@@ -152,7 +152,7 @@ export class AgentWebhooksClient {
|
|
|
152
152
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
153
153
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
154
154
|
const _response = yield core.fetcher({
|
|
155
|
-
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.
|
|
155
|
+
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)}/webhook`),
|
|
156
156
|
method: "DELETE",
|
|
157
157
|
headers: _headers,
|
|
158
158
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -206,7 +206,7 @@ export class AgentWebhooksClient {
|
|
|
206
206
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
207
207
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
208
208
|
const _response = yield core.fetcher({
|
|
209
|
-
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.
|
|
209
|
+
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)}/webhook/deliveries`),
|
|
210
210
|
method: "GET",
|
|
211
211
|
headers: _headers,
|
|
212
212
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -257,7 +257,7 @@ export class AgentWebhooksClient {
|
|
|
257
257
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
258
258
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
259
259
|
const _response = yield core.fetcher({
|
|
260
|
-
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.
|
|
260
|
+
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)}/webhook/test`),
|
|
261
261
|
method: "POST",
|
|
262
262
|
headers: _headers,
|
|
263
263
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -9,7 +9,17 @@ export declare namespace AgentsClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class AgentsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<AgentsClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options?: AgentsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Return available voices from the call provider (Retell).
|
|
15
|
+
*
|
|
16
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* await client.agents.listVoices()
|
|
20
|
+
*/
|
|
21
|
+
listVoices(requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
22
|
+
private __listVoices;
|
|
13
23
|
/**
|
|
14
24
|
* List all agents for this account.
|
|
15
25
|
*
|
|
@@ -27,9 +27,49 @@ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCode
|
|
|
27
27
|
import * as errors from "../../../../errors/index.mjs";
|
|
28
28
|
import * as AgentPhone from "../../../index.mjs";
|
|
29
29
|
export class AgentsClient {
|
|
30
|
-
constructor(options) {
|
|
30
|
+
constructor(options = {}) {
|
|
31
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Return available voices from the call provider (Retell).
|
|
35
|
+
*
|
|
36
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* await client.agents.listVoices()
|
|
40
|
+
*/
|
|
41
|
+
listVoices(requestOptions) {
|
|
42
|
+
return core.HttpResponsePromise.fromPromise(this.__listVoices(requestOptions));
|
|
43
|
+
}
|
|
44
|
+
__listVoices(requestOptions) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
47
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
48
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
49
|
+
const _response = yield core.fetcher({
|
|
50
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v1/agents/voices"),
|
|
51
|
+
method: "GET",
|
|
52
|
+
headers: _headers,
|
|
53
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
54
|
+
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,
|
|
55
|
+
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,
|
|
56
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
57
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
58
|
+
logging: this._options.logging,
|
|
59
|
+
});
|
|
60
|
+
if (_response.ok) {
|
|
61
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
62
|
+
}
|
|
63
|
+
if (_response.error.reason === "status-code") {
|
|
64
|
+
throw new errors.AgentPhoneError({
|
|
65
|
+
statusCode: _response.error.statusCode,
|
|
66
|
+
body: _response.error.body,
|
|
67
|
+
rawResponse: _response.rawResponse,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/agents/voices");
|
|
71
|
+
});
|
|
72
|
+
}
|
|
33
73
|
/**
|
|
34
74
|
* List all agents for this account.
|
|
35
75
|
*
|
|
@@ -55,7 +95,7 @@ export class AgentsClient {
|
|
|
55
95
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
56
96
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
57
97
|
const _response = yield core.fetcher({
|
|
58
|
-
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.
|
|
98
|
+
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"),
|
|
59
99
|
method: "GET",
|
|
60
100
|
headers: _headers,
|
|
61
101
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -111,7 +151,7 @@ export class AgentsClient {
|
|
|
111
151
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
112
152
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
113
153
|
const _response = yield core.fetcher({
|
|
114
|
-
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.
|
|
154
|
+
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"),
|
|
115
155
|
method: "POST",
|
|
116
156
|
headers: _headers,
|
|
117
157
|
contentType: "application/json",
|
|
@@ -165,7 +205,7 @@ export class AgentsClient {
|
|
|
165
205
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
166
206
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
167
207
|
const _response = yield core.fetcher({
|
|
168
|
-
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.
|
|
208
|
+
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)}`),
|
|
169
209
|
method: "GET",
|
|
170
210
|
headers: _headers,
|
|
171
211
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -219,7 +259,7 @@ export class AgentsClient {
|
|
|
219
259
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
220
260
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
221
261
|
const _response = yield core.fetcher({
|
|
222
|
-
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.
|
|
262
|
+
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)}`),
|
|
223
263
|
method: "DELETE",
|
|
224
264
|
headers: _headers,
|
|
225
265
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -273,7 +313,7 @@ export class AgentsClient {
|
|
|
273
313
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
274
314
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
275
315
|
const _response = yield core.fetcher({
|
|
276
|
-
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.
|
|
316
|
+
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)}`),
|
|
277
317
|
method: "PATCH",
|
|
278
318
|
headers: _headers,
|
|
279
319
|
contentType: "application/json",
|
|
@@ -330,7 +370,7 @@ export class AgentsClient {
|
|
|
330
370
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
331
371
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
332
372
|
const _response = yield core.fetcher({
|
|
333
|
-
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.
|
|
373
|
+
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)}/numbers`),
|
|
334
374
|
method: "POST",
|
|
335
375
|
headers: _headers,
|
|
336
376
|
contentType: "application/json",
|
|
@@ -387,7 +427,7 @@ export class AgentsClient {
|
|
|
387
427
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
388
428
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
389
429
|
const _response = yield core.fetcher({
|
|
390
|
-
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.
|
|
430
|
+
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)}/numbers/${core.url.encodePathParam(numberId)}`),
|
|
391
431
|
method: "DELETE",
|
|
392
432
|
headers: _headers,
|
|
393
433
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -442,7 +482,7 @@ export class AgentsClient {
|
|
|
442
482
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
443
483
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
444
484
|
const _response = yield core.fetcher({
|
|
445
|
-
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.
|
|
485
|
+
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)}/conversations`),
|
|
446
486
|
method: "GET",
|
|
447
487
|
headers: _headers,
|
|
448
488
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -500,7 +540,7 @@ export class AgentsClient {
|
|
|
500
540
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
501
541
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
502
542
|
const _response = yield core.fetcher({
|
|
503
|
-
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.
|
|
543
|
+
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)}/calls`),
|
|
504
544
|
method: "GET",
|
|
505
545
|
headers: _headers,
|
|
506
546
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -7,10 +7,32 @@
|
|
|
7
7
|
export interface CreateAgentRequest {
|
|
8
8
|
name: string;
|
|
9
9
|
description?: string | null;
|
|
10
|
-
voiceMode?:
|
|
10
|
+
voiceMode?: CreateAgentRequest.VoiceMode;
|
|
11
|
+
modelTier?: CreateAgentRequest.ModelTier;
|
|
11
12
|
systemPrompt?: string | null;
|
|
12
13
|
beginMessage?: string | null;
|
|
13
14
|
voice?: string | null;
|
|
14
15
|
transferNumber?: string | null;
|
|
15
16
|
voicemailMessage?: string | null;
|
|
17
|
+
/** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
|
|
18
|
+
sttMode?: CreateAgentRequest.SttMode;
|
|
19
|
+
}
|
|
20
|
+
export declare namespace CreateAgentRequest {
|
|
21
|
+
const VoiceMode: {
|
|
22
|
+
readonly Webhook: "webhook";
|
|
23
|
+
readonly Hosted: "hosted";
|
|
24
|
+
};
|
|
25
|
+
type VoiceMode = (typeof VoiceMode)[keyof typeof VoiceMode];
|
|
26
|
+
const ModelTier: {
|
|
27
|
+
readonly Turbo: "turbo";
|
|
28
|
+
readonly Balanced: "balanced";
|
|
29
|
+
readonly Max: "max";
|
|
30
|
+
};
|
|
31
|
+
type ModelTier = (typeof ModelTier)[keyof typeof ModelTier];
|
|
32
|
+
/** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
|
|
33
|
+
const SttMode: {
|
|
34
|
+
readonly Fast: "fast";
|
|
35
|
+
readonly Accurate: "accurate";
|
|
36
|
+
};
|
|
37
|
+
type SttMode = (typeof SttMode)[keyof typeof SttMode];
|
|
16
38
|
}
|
|
@@ -1,2 +1,18 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export
|
|
2
|
+
export var CreateAgentRequest;
|
|
3
|
+
(function (CreateAgentRequest) {
|
|
4
|
+
CreateAgentRequest.VoiceMode = {
|
|
5
|
+
Webhook: "webhook",
|
|
6
|
+
Hosted: "hosted",
|
|
7
|
+
};
|
|
8
|
+
CreateAgentRequest.ModelTier = {
|
|
9
|
+
Turbo: "turbo",
|
|
10
|
+
Balanced: "balanced",
|
|
11
|
+
Max: "max",
|
|
12
|
+
};
|
|
13
|
+
/** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
|
|
14
|
+
CreateAgentRequest.SttMode = {
|
|
15
|
+
Fast: "fast",
|
|
16
|
+
Accurate: "accurate",
|
|
17
|
+
};
|
|
18
|
+
})(CreateAgentRequest || (CreateAgentRequest = {}));
|
|
@@ -8,10 +8,32 @@ export interface UpdateAgentRequest {
|
|
|
8
8
|
agent_id: string;
|
|
9
9
|
name?: string | null;
|
|
10
10
|
description?: string | null;
|
|
11
|
-
voiceMode?:
|
|
11
|
+
voiceMode?: UpdateAgentRequest.VoiceMode;
|
|
12
|
+
modelTier?: UpdateAgentRequest.ModelTier;
|
|
12
13
|
systemPrompt?: string | null;
|
|
13
14
|
beginMessage?: string | null;
|
|
14
15
|
voice?: string | null;
|
|
15
16
|
transferNumber?: string | null;
|
|
16
17
|
voicemailMessage?: string | null;
|
|
18
|
+
/** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
|
|
19
|
+
sttMode?: UpdateAgentRequest.SttMode;
|
|
20
|
+
}
|
|
21
|
+
export declare namespace UpdateAgentRequest {
|
|
22
|
+
const VoiceMode: {
|
|
23
|
+
readonly Webhook: "webhook";
|
|
24
|
+
readonly Hosted: "hosted";
|
|
25
|
+
};
|
|
26
|
+
type VoiceMode = (typeof VoiceMode)[keyof typeof VoiceMode];
|
|
27
|
+
const ModelTier: {
|
|
28
|
+
readonly Turbo: "turbo";
|
|
29
|
+
readonly Balanced: "balanced";
|
|
30
|
+
readonly Max: "max";
|
|
31
|
+
};
|
|
32
|
+
type ModelTier = (typeof ModelTier)[keyof typeof ModelTier];
|
|
33
|
+
/** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
|
|
34
|
+
const SttMode: {
|
|
35
|
+
readonly Fast: "fast";
|
|
36
|
+
readonly Accurate: "accurate";
|
|
37
|
+
};
|
|
38
|
+
type SttMode = (typeof SttMode)[keyof typeof SttMode];
|
|
17
39
|
}
|
|
@@ -1,2 +1,18 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export
|
|
2
|
+
export var UpdateAgentRequest;
|
|
3
|
+
(function (UpdateAgentRequest) {
|
|
4
|
+
UpdateAgentRequest.VoiceMode = {
|
|
5
|
+
Webhook: "webhook",
|
|
6
|
+
Hosted: "hosted",
|
|
7
|
+
};
|
|
8
|
+
UpdateAgentRequest.ModelTier = {
|
|
9
|
+
Turbo: "turbo",
|
|
10
|
+
Balanced: "balanced",
|
|
11
|
+
Max: "max",
|
|
12
|
+
};
|
|
13
|
+
/** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
|
|
14
|
+
UpdateAgentRequest.SttMode = {
|
|
15
|
+
Fast: "fast",
|
|
16
|
+
Accurate: "accurate",
|
|
17
|
+
};
|
|
18
|
+
})(UpdateAgentRequest || (UpdateAgentRequest = {}));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export type { AttachNumberRequest } from "./AttachNumberRequest.mjs";
|
|
2
|
-
export
|
|
2
|
+
export { CreateAgentRequest } from "./CreateAgentRequest.mjs";
|
|
3
3
|
export type { DeleteAgentV1AgentsAgentIdDeleteRequest } from "./DeleteAgentV1AgentsAgentIdDeleteRequest.mjs";
|
|
4
4
|
export type { DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest } from "./DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest.mjs";
|
|
5
5
|
export type { GetAgentV1AgentsAgentIdGetRequest } from "./GetAgentV1AgentsAgentIdGetRequest.mjs";
|
|
6
6
|
export type { ListAgentCallsV1AgentsAgentIdCallsGetRequest } from "./ListAgentCallsV1AgentsAgentIdCallsGetRequest.mjs";
|
|
7
7
|
export type { ListAgentConversationsV1AgentsAgentIdConversationsGetRequest } from "./ListAgentConversationsV1AgentsAgentIdConversationsGetRequest.mjs";
|
|
8
8
|
export type { ListAgentsV1AgentsGetRequest } from "./ListAgentsV1AgentsGetRequest.mjs";
|
|
9
|
-
export
|
|
9
|
+
export { UpdateAgentRequest } from "./UpdateAgentRequest.mjs";
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { CreateAgentRequest } from "./CreateAgentRequest.mjs";
|
|
2
|
+
export { UpdateAgentRequest } from "./UpdateAgentRequest.mjs";
|
|
@@ -9,7 +9,7 @@ export declare namespace CallsClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class CallsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<CallsClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options?: CallsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* List all calls for this account.
|
|
15
15
|
*
|
|
@@ -16,7 +16,7 @@ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCode
|
|
|
16
16
|
import * as errors from "../../../../errors/index.mjs";
|
|
17
17
|
import * as AgentPhone from "../../../index.mjs";
|
|
18
18
|
export class CallsClient {
|
|
19
|
-
constructor(options) {
|
|
19
|
+
constructor(options = {}) {
|
|
20
20
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -48,7 +48,7 @@ export class CallsClient {
|
|
|
48
48
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
49
49
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
50
50
|
const _response = yield core.fetcher({
|
|
51
|
-
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.
|
|
51
|
+
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"),
|
|
52
52
|
method: "GET",
|
|
53
53
|
headers: _headers,
|
|
54
54
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -110,7 +110,7 @@ export class CallsClient {
|
|
|
110
110
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
111
111
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
112
112
|
const _response = yield core.fetcher({
|
|
113
|
-
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.
|
|
113
|
+
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"),
|
|
114
114
|
method: "POST",
|
|
115
115
|
headers: _headers,
|
|
116
116
|
contentType: "application/json",
|
|
@@ -173,7 +173,7 @@ export class CallsClient {
|
|
|
173
173
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
174
174
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
175
175
|
const _response = yield core.fetcher({
|
|
176
|
-
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.
|
|
176
|
+
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/web"),
|
|
177
177
|
method: "POST",
|
|
178
178
|
headers: _headers,
|
|
179
179
|
contentType: "application/json",
|
|
@@ -227,7 +227,7 @@ export class CallsClient {
|
|
|
227
227
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
228
228
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
229
229
|
const _response = yield core.fetcher({
|
|
230
|
-
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.
|
|
230
|
+
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/${core.url.encodePathParam(callId)}`),
|
|
231
231
|
method: "GET",
|
|
232
232
|
headers: _headers,
|
|
233
233
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -282,7 +282,7 @@ export class CallsClient {
|
|
|
282
282
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
283
283
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
284
284
|
const _response = yield core.fetcher({
|
|
285
|
-
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.
|
|
285
|
+
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/${core.url.encodePathParam(callId)}/transcript`),
|
|
286
286
|
method: "GET",
|
|
287
287
|
headers: _headers,
|
|
288
288
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -342,7 +342,7 @@ export class CallsClient {
|
|
|
342
342
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
343
343
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
344
344
|
const _response = yield core.fetcher({
|
|
345
|
-
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.
|
|
345
|
+
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/${core.url.encodePathParam(callId)}/transcript/stream`),
|
|
346
346
|
method: "GET",
|
|
347
347
|
headers: _headers,
|
|
348
348
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -397,7 +397,7 @@ export class CallsClient {
|
|
|
397
397
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
398
398
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
399
399
|
const _response = yield core.fetcher({
|
|
400
|
-
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.
|
|
400
|
+
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)}/calls`),
|
|
401
401
|
method: "GET",
|
|
402
402
|
headers: _headers,
|
|
403
403
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -14,8 +14,8 @@ export interface CreateOutboundCallRequest {
|
|
|
14
14
|
fromNumberId?: string | null;
|
|
15
15
|
/** Optional initial greeting to speak when recipient answers */
|
|
16
16
|
initialGreeting?: string | null;
|
|
17
|
-
/** Voice
|
|
18
|
-
voice?: string;
|
|
17
|
+
/** Voice ID override for this call (uses agent's configured voice if omitted) */
|
|
18
|
+
voice?: string | null;
|
|
19
19
|
/** When provided, uses a built-in LLM for the conversation instead of forwarding to a webhook. The prompt defines the AI's personality and conversation topic. */
|
|
20
20
|
systemPrompt?: string | null;
|
|
21
21
|
}
|
|
@@ -9,7 +9,7 @@ export declare namespace ContactsClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class ContactsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<ContactsClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options?: ContactsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* List all contacts for this account.
|
|
15
15
|
*
|
|
@@ -27,7 +27,7 @@ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCode
|
|
|
27
27
|
import * as errors from "../../../../errors/index.mjs";
|
|
28
28
|
import * as AgentPhone from "../../../index.mjs";
|
|
29
29
|
export class ContactsClient {
|
|
30
|
-
constructor(options) {
|
|
30
|
+
constructor(options = {}) {
|
|
31
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -58,7 +58,7 @@ export class ContactsClient {
|
|
|
58
58
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
59
59
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
60
60
|
const _response = yield core.fetcher({
|
|
61
|
-
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.
|
|
61
|
+
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"),
|
|
62
62
|
method: "GET",
|
|
63
63
|
headers: _headers,
|
|
64
64
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -112,7 +112,7 @@ export class ContactsClient {
|
|
|
112
112
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
113
113
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
114
114
|
const _response = yield core.fetcher({
|
|
115
|
-
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.
|
|
115
|
+
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"),
|
|
116
116
|
method: "POST",
|
|
117
117
|
headers: _headers,
|
|
118
118
|
contentType: "application/json",
|
|
@@ -166,7 +166,7 @@ export class ContactsClient {
|
|
|
166
166
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
167
167
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
168
168
|
const _response = yield core.fetcher({
|
|
169
|
-
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.
|
|
169
|
+
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/${core.url.encodePathParam(contactId)}`),
|
|
170
170
|
method: "GET",
|
|
171
171
|
headers: _headers,
|
|
172
172
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -217,7 +217,7 @@ export class ContactsClient {
|
|
|
217
217
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
218
218
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
219
219
|
const _response = yield core.fetcher({
|
|
220
|
-
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.
|
|
220
|
+
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/${core.url.encodePathParam(contactId)}`),
|
|
221
221
|
method: "DELETE",
|
|
222
222
|
headers: _headers,
|
|
223
223
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -270,7 +270,7 @@ export class ContactsClient {
|
|
|
270
270
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
271
271
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
272
272
|
const _response = yield core.fetcher({
|
|
273
|
-
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.
|
|
273
|
+
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/${core.url.encodePathParam(contactId)}`),
|
|
274
274
|
method: "PATCH",
|
|
275
275
|
headers: _headers,
|
|
276
276
|
contentType: "application/json",
|
|
@@ -9,7 +9,7 @@ export declare namespace ConversationsClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class ConversationsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<ConversationsClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options?: ConversationsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* List all conversations for this account.
|
|
15
15
|
*
|
|
@@ -27,7 +27,7 @@ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCode
|
|
|
27
27
|
import * as errors from "../../../../errors/index.mjs";
|
|
28
28
|
import * as AgentPhone from "../../../index.mjs";
|
|
29
29
|
export class ConversationsClient {
|
|
30
|
-
constructor(options) {
|
|
30
|
+
constructor(options = {}) {
|
|
31
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -57,7 +57,7 @@ export class ConversationsClient {
|
|
|
57
57
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
58
58
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
59
59
|
const _response = yield core.fetcher({
|
|
60
|
-
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.
|
|
60
|
+
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"),
|
|
61
61
|
method: "GET",
|
|
62
62
|
headers: _headers,
|
|
63
63
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -114,7 +114,7 @@ export class ConversationsClient {
|
|
|
114
114
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
115
115
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
116
116
|
const _response = yield core.fetcher({
|
|
117
|
-
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.
|
|
117
|
+
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/${core.url.encodePathParam(conversationId)}`),
|
|
118
118
|
method: "GET",
|
|
119
119
|
headers: _headers,
|
|
120
120
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -172,7 +172,7 @@ export class ConversationsClient {
|
|
|
172
172
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
173
173
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
174
174
|
const _response = yield core.fetcher({
|
|
175
|
-
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.
|
|
175
|
+
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/${core.url.encodePathParam(conversationId)}`),
|
|
176
176
|
method: "PATCH",
|
|
177
177
|
headers: _headers,
|
|
178
178
|
contentType: "application/json",
|
|
@@ -233,7 +233,7 @@ export class ConversationsClient {
|
|
|
233
233
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
234
234
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
235
235
|
const _response = yield core.fetcher({
|
|
236
|
-
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.
|
|
236
|
+
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/${core.url.encodePathParam(conversationId)}/messages`),
|
|
237
237
|
method: "GET",
|
|
238
238
|
headers: _headers,
|
|
239
239
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * from "./agentSignup/client/requests/index.mjs";
|
|
2
|
+
export * as agentSignup from "./agentSignup/index.mjs";
|
|
1
3
|
export * from "./agents/client/requests/index.mjs";
|
|
2
4
|
export * as agents from "./agents/index.mjs";
|
|
3
5
|
export * from "./agentWebhooks/client/requests/index.mjs";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * from "./agentSignup/client/requests/index.mjs";
|
|
2
|
+
export * as agentSignup from "./agentSignup/index.mjs";
|
|
1
3
|
export * from "./agents/client/requests/index.mjs";
|
|
2
4
|
export * as agents from "./agents/index.mjs";
|
|
3
5
|
export * from "./agentWebhooks/client/requests/index.mjs";
|
|
@@ -9,7 +9,7 @@ export declare namespace MessagesClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class MessagesClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<MessagesClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options?: MessagesClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Send an outbound message (SMS or iMessage) via the provider assigned to the number.
|
|
15
15
|
*
|