agentphone 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +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 +1 -1
- package/dist/cjs/api/resources/agents/client/Client.js +11 -11
- package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +41 -2
- package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.js +30 -0
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +41 -2
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +30 -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 +27 -1
- package/dist/cjs/api/resources/calls/client/Client.js +69 -8
- package/dist/cjs/api/resources/calls/client/requests/CreateOutboundCallRequest.d.ts +2 -0
- package/dist/cjs/api/resources/calls/client/requests/CreateWebCallRequest.d.ts +2 -0
- package/dist/cjs/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.d.ts +9 -0
- package/dist/cjs/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.js +3 -0
- package/dist/cjs/api/resources/calls/client/requests/index.d.ts +1 -0
- 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 +20 -1
- package/dist/cjs/api/resources/conversations/client/Client.js +60 -5
- package/dist/cjs/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.d.ts +9 -0
- package/dist/cjs/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.js +3 -0
- package/dist/cjs/api/resources/conversations/client/requests/index.d.ts +1 -0
- 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 +11 -1
- package/dist/cjs/api/resources/usage/client/Client.js +44 -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 +41 -2
- package/dist/cjs/api/types/AgentResponse.js +30 -0
- package/dist/cjs/api/types/MessageInConversation.d.ts +2 -0
- package/dist/cjs/api/types/NumberUsageItem.d.ts +10 -0
- package/dist/cjs/api/types/NumberUsageItem.js +3 -0
- package/dist/cjs/api/types/NumberUsageResponse.d.ts +4 -0
- package/dist/cjs/api/types/NumberUsageResponse.js +3 -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/SendTypingResponse.d.ts +5 -0
- package/dist/cjs/api/types/SendTypingResponse.js +3 -0
- package/dist/cjs/api/types/index.d.ts +4 -0
- package/dist/cjs/api/types/index.js +4 -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 +1 -1
- package/dist/esm/api/resources/agents/client/Client.mjs +11 -11
- package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +41 -2
- package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.mjs +29 -1
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +41 -2
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +29 -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 +27 -1
- package/dist/esm/api/resources/calls/client/Client.mjs +69 -8
- package/dist/esm/api/resources/calls/client/requests/CreateOutboundCallRequest.d.mts +2 -0
- package/dist/esm/api/resources/calls/client/requests/CreateWebCallRequest.d.mts +2 -0
- package/dist/esm/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.d.mts +9 -0
- package/dist/esm/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.mjs +2 -0
- package/dist/esm/api/resources/calls/client/requests/index.d.mts +1 -0
- 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 +20 -1
- package/dist/esm/api/resources/conversations/client/Client.mjs +60 -5
- package/dist/esm/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.d.mts +9 -0
- package/dist/esm/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.mjs +2 -0
- package/dist/esm/api/resources/conversations/client/requests/index.d.mts +1 -0
- 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 +11 -1
- package/dist/esm/api/resources/usage/client/Client.mjs +44 -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 +41 -2
- package/dist/esm/api/types/AgentResponse.mjs +29 -1
- package/dist/esm/api/types/MessageInConversation.d.mts +2 -0
- package/dist/esm/api/types/NumberUsageItem.d.mts +10 -0
- package/dist/esm/api/types/NumberUsageItem.mjs +2 -0
- package/dist/esm/api/types/NumberUsageResponse.d.mts +4 -0
- package/dist/esm/api/types/NumberUsageResponse.mjs +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/SendTypingResponse.d.mts +5 -0
- package/dist/esm/api/types/SendTypingResponse.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +4 -0
- package/dist/esm/api/types/index.mjs +4 -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 +338 -0
|
@@ -63,7 +63,7 @@ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatu
|
|
|
63
63
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
64
64
|
const AgentPhone = __importStar(require("../../../index.js"));
|
|
65
65
|
class AgentsClient {
|
|
66
|
-
constructor(options) {
|
|
66
|
+
constructor(options = {}) {
|
|
67
67
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
@@ -83,7 +83,7 @@ class AgentsClient {
|
|
|
83
83
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
84
84
|
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);
|
|
85
85
|
const _response = yield core.fetcher({
|
|
86
|
-
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.
|
|
86
|
+
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"),
|
|
87
87
|
method: "GET",
|
|
88
88
|
headers: _headers,
|
|
89
89
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -131,7 +131,7 @@ class AgentsClient {
|
|
|
131
131
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
132
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);
|
|
133
133
|
const _response = yield core.fetcher({
|
|
134
|
-
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.
|
|
134
|
+
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
135
|
method: "GET",
|
|
136
136
|
headers: _headers,
|
|
137
137
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -187,7 +187,7 @@ class AgentsClient {
|
|
|
187
187
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
188
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);
|
|
189
189
|
const _response = yield core.fetcher({
|
|
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.
|
|
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",
|
|
192
192
|
headers: _headers,
|
|
193
193
|
contentType: "application/json",
|
|
@@ -241,7 +241,7 @@ class AgentsClient {
|
|
|
241
241
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
242
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);
|
|
243
243
|
const _response = yield core.fetcher({
|
|
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.
|
|
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",
|
|
246
246
|
headers: _headers,
|
|
247
247
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -295,7 +295,7 @@ class AgentsClient {
|
|
|
295
295
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
296
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);
|
|
297
297
|
const _response = yield core.fetcher({
|
|
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.
|
|
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",
|
|
300
300
|
headers: _headers,
|
|
301
301
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -349,7 +349,7 @@ class AgentsClient {
|
|
|
349
349
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
350
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);
|
|
351
351
|
const _response = yield core.fetcher({
|
|
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.
|
|
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",
|
|
354
354
|
headers: _headers,
|
|
355
355
|
contentType: "application/json",
|
|
@@ -406,7 +406,7 @@ class AgentsClient {
|
|
|
406
406
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
407
407
|
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);
|
|
408
408
|
const _response = yield core.fetcher({
|
|
409
|
-
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.
|
|
409
|
+
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`),
|
|
410
410
|
method: "POST",
|
|
411
411
|
headers: _headers,
|
|
412
412
|
contentType: "application/json",
|
|
@@ -463,7 +463,7 @@ class AgentsClient {
|
|
|
463
463
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
464
464
|
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);
|
|
465
465
|
const _response = yield core.fetcher({
|
|
466
|
-
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.
|
|
466
|
+
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)}`),
|
|
467
467
|
method: "DELETE",
|
|
468
468
|
headers: _headers,
|
|
469
469
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -518,7 +518,7 @@ class AgentsClient {
|
|
|
518
518
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
519
519
|
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);
|
|
520
520
|
const _response = yield core.fetcher({
|
|
521
|
-
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.
|
|
521
|
+
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`),
|
|
522
522
|
method: "GET",
|
|
523
523
|
headers: _headers,
|
|
524
524
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -576,7 +576,7 @@ class AgentsClient {
|
|
|
576
576
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
577
577
|
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);
|
|
578
578
|
const _response = yield core.fetcher({
|
|
579
|
-
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.
|
|
579
|
+
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`),
|
|
580
580
|
method: "GET",
|
|
581
581
|
headers: _headers,
|
|
582
582
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -7,11 +7,50 @@
|
|
|
7
7
|
export interface CreateAgentRequest {
|
|
8
8
|
name: string;
|
|
9
9
|
description?: string | null;
|
|
10
|
-
voiceMode?:
|
|
11
|
-
modelTier?:
|
|
10
|
+
voiceMode?: CreateAgentRequest.VoiceMode;
|
|
11
|
+
modelTier?: CreateAgentRequest.ModelTier;
|
|
12
12
|
systemPrompt?: string | null;
|
|
13
13
|
beginMessage?: string | null;
|
|
14
14
|
voice?: string | null;
|
|
15
15
|
transferNumber?: string | null;
|
|
16
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
|
+
/** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
|
|
20
|
+
ambientSound?: CreateAgentRequest.AmbientSound;
|
|
21
|
+
/** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
|
|
22
|
+
denoisingMode?: CreateAgentRequest.DenoisingMode;
|
|
23
|
+
}
|
|
24
|
+
export declare namespace CreateAgentRequest {
|
|
25
|
+
const VoiceMode: {
|
|
26
|
+
readonly Webhook: "webhook";
|
|
27
|
+
readonly Hosted: "hosted";
|
|
28
|
+
};
|
|
29
|
+
type VoiceMode = (typeof VoiceMode)[keyof typeof VoiceMode];
|
|
30
|
+
const ModelTier: {
|
|
31
|
+
readonly Turbo: "turbo";
|
|
32
|
+
readonly Balanced: "balanced";
|
|
33
|
+
readonly Max: "max";
|
|
34
|
+
};
|
|
35
|
+
type ModelTier = (typeof ModelTier)[keyof typeof ModelTier];
|
|
36
|
+
/** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
|
|
37
|
+
const SttMode: {
|
|
38
|
+
readonly Fast: "fast";
|
|
39
|
+
readonly Accurate: "accurate";
|
|
40
|
+
};
|
|
41
|
+
type SttMode = (typeof SttMode)[keyof typeof SttMode];
|
|
42
|
+
/** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
|
|
43
|
+
const AmbientSound: {
|
|
44
|
+
readonly None: "none";
|
|
45
|
+
readonly Office: "office";
|
|
46
|
+
readonly CoffeeShop: "coffee-shop";
|
|
47
|
+
readonly Outdoor: "outdoor";
|
|
48
|
+
};
|
|
49
|
+
type AmbientSound = (typeof AmbientSound)[keyof typeof AmbientSound];
|
|
50
|
+
/** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
|
|
51
|
+
const DenoisingMode: {
|
|
52
|
+
readonly NoiseCancellation: "noise-cancellation";
|
|
53
|
+
readonly NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation";
|
|
54
|
+
};
|
|
55
|
+
type DenoisingMode = (typeof DenoisingMode)[keyof typeof DenoisingMode];
|
|
17
56
|
}
|
|
@@ -1,3 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CreateAgentRequest = void 0;
|
|
5
|
+
var CreateAgentRequest;
|
|
6
|
+
(function (CreateAgentRequest) {
|
|
7
|
+
CreateAgentRequest.VoiceMode = {
|
|
8
|
+
Webhook: "webhook",
|
|
9
|
+
Hosted: "hosted",
|
|
10
|
+
};
|
|
11
|
+
CreateAgentRequest.ModelTier = {
|
|
12
|
+
Turbo: "turbo",
|
|
13
|
+
Balanced: "balanced",
|
|
14
|
+
Max: "max",
|
|
15
|
+
};
|
|
16
|
+
/** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
|
|
17
|
+
CreateAgentRequest.SttMode = {
|
|
18
|
+
Fast: "fast",
|
|
19
|
+
Accurate: "accurate",
|
|
20
|
+
};
|
|
21
|
+
/** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
|
|
22
|
+
CreateAgentRequest.AmbientSound = {
|
|
23
|
+
None: "none",
|
|
24
|
+
Office: "office",
|
|
25
|
+
CoffeeShop: "coffee-shop",
|
|
26
|
+
Outdoor: "outdoor",
|
|
27
|
+
};
|
|
28
|
+
/** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
|
|
29
|
+
CreateAgentRequest.DenoisingMode = {
|
|
30
|
+
NoiseCancellation: "noise-cancellation",
|
|
31
|
+
NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation",
|
|
32
|
+
};
|
|
33
|
+
})(CreateAgentRequest || (exports.CreateAgentRequest = CreateAgentRequest = {}));
|
|
@@ -8,11 +8,50 @@ export interface UpdateAgentRequest {
|
|
|
8
8
|
agent_id: string;
|
|
9
9
|
name?: string | null;
|
|
10
10
|
description?: string | null;
|
|
11
|
-
voiceMode?:
|
|
12
|
-
modelTier?:
|
|
11
|
+
voiceMode?: UpdateAgentRequest.VoiceMode;
|
|
12
|
+
modelTier?: UpdateAgentRequest.ModelTier;
|
|
13
13
|
systemPrompt?: string | null;
|
|
14
14
|
beginMessage?: string | null;
|
|
15
15
|
voice?: string | null;
|
|
16
16
|
transferNumber?: string | null;
|
|
17
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
|
+
/** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
|
|
21
|
+
ambientSound?: UpdateAgentRequest.AmbientSound;
|
|
22
|
+
/** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
|
|
23
|
+
denoisingMode?: UpdateAgentRequest.DenoisingMode;
|
|
24
|
+
}
|
|
25
|
+
export declare namespace UpdateAgentRequest {
|
|
26
|
+
const VoiceMode: {
|
|
27
|
+
readonly Webhook: "webhook";
|
|
28
|
+
readonly Hosted: "hosted";
|
|
29
|
+
};
|
|
30
|
+
type VoiceMode = (typeof VoiceMode)[keyof typeof VoiceMode];
|
|
31
|
+
const ModelTier: {
|
|
32
|
+
readonly Turbo: "turbo";
|
|
33
|
+
readonly Balanced: "balanced";
|
|
34
|
+
readonly Max: "max";
|
|
35
|
+
};
|
|
36
|
+
type ModelTier = (typeof ModelTier)[keyof typeof ModelTier];
|
|
37
|
+
/** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
|
|
38
|
+
const SttMode: {
|
|
39
|
+
readonly Fast: "fast";
|
|
40
|
+
readonly Accurate: "accurate";
|
|
41
|
+
};
|
|
42
|
+
type SttMode = (typeof SttMode)[keyof typeof SttMode];
|
|
43
|
+
/** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
|
|
44
|
+
const AmbientSound: {
|
|
45
|
+
readonly None: "none";
|
|
46
|
+
readonly Office: "office";
|
|
47
|
+
readonly CoffeeShop: "coffee-shop";
|
|
48
|
+
readonly Outdoor: "outdoor";
|
|
49
|
+
};
|
|
50
|
+
type AmbientSound = (typeof AmbientSound)[keyof typeof AmbientSound];
|
|
51
|
+
/** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
|
|
52
|
+
const DenoisingMode: {
|
|
53
|
+
readonly NoiseCancellation: "noise-cancellation";
|
|
54
|
+
readonly NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation";
|
|
55
|
+
};
|
|
56
|
+
type DenoisingMode = (typeof DenoisingMode)[keyof typeof DenoisingMode];
|
|
18
57
|
}
|
|
@@ -1,3 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.UpdateAgentRequest = void 0;
|
|
5
|
+
var UpdateAgentRequest;
|
|
6
|
+
(function (UpdateAgentRequest) {
|
|
7
|
+
UpdateAgentRequest.VoiceMode = {
|
|
8
|
+
Webhook: "webhook",
|
|
9
|
+
Hosted: "hosted",
|
|
10
|
+
};
|
|
11
|
+
UpdateAgentRequest.ModelTier = {
|
|
12
|
+
Turbo: "turbo",
|
|
13
|
+
Balanced: "balanced",
|
|
14
|
+
Max: "max",
|
|
15
|
+
};
|
|
16
|
+
/** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
|
|
17
|
+
UpdateAgentRequest.SttMode = {
|
|
18
|
+
Fast: "fast",
|
|
19
|
+
Accurate: "accurate",
|
|
20
|
+
};
|
|
21
|
+
/** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
|
|
22
|
+
UpdateAgentRequest.AmbientSound = {
|
|
23
|
+
None: "none",
|
|
24
|
+
Office: "office",
|
|
25
|
+
CoffeeShop: "coffee-shop",
|
|
26
|
+
Outdoor: "outdoor",
|
|
27
|
+
};
|
|
28
|
+
/** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
|
|
29
|
+
UpdateAgentRequest.DenoisingMode = {
|
|
30
|
+
NoiseCancellation: "noise-cancellation",
|
|
31
|
+
NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation",
|
|
32
|
+
};
|
|
33
|
+
})(UpdateAgentRequest || (exports.UpdateAgentRequest = UpdateAgentRequest = {}));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export type { AttachNumberRequest } from "./AttachNumberRequest.js";
|
|
2
|
-
export
|
|
2
|
+
export { CreateAgentRequest } from "./CreateAgentRequest.js";
|
|
3
3
|
export type { DeleteAgentV1AgentsAgentIdDeleteRequest } from "./DeleteAgentV1AgentsAgentIdDeleteRequest.js";
|
|
4
4
|
export type { DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest } from "./DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest.js";
|
|
5
5
|
export type { GetAgentV1AgentsAgentIdGetRequest } from "./GetAgentV1AgentsAgentIdGetRequest.js";
|
|
6
6
|
export type { ListAgentCallsV1AgentsAgentIdCallsGetRequest } from "./ListAgentCallsV1AgentsAgentIdCallsGetRequest.js";
|
|
7
7
|
export type { ListAgentConversationsV1AgentsAgentIdConversationsGetRequest } from "./ListAgentConversationsV1AgentsAgentIdConversationsGetRequest.js";
|
|
8
8
|
export type { ListAgentsV1AgentsGetRequest } from "./ListAgentsV1AgentsGetRequest.js";
|
|
9
|
-
export
|
|
9
|
+
export { UpdateAgentRequest } from "./UpdateAgentRequest.js";
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateAgentRequest = exports.CreateAgentRequest = void 0;
|
|
4
|
+
var CreateAgentRequest_js_1 = require("./CreateAgentRequest.js");
|
|
5
|
+
Object.defineProperty(exports, "CreateAgentRequest", { enumerable: true, get: function () { return CreateAgentRequest_js_1.CreateAgentRequest; } });
|
|
6
|
+
var UpdateAgentRequest_js_1 = require("./UpdateAgentRequest.js");
|
|
7
|
+
Object.defineProperty(exports, "UpdateAgentRequest", { enumerable: true, get: function () { return UpdateAgentRequest_js_1.UpdateAgentRequest; } });
|
|
@@ -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
|
*
|
|
@@ -90,6 +90,32 @@ export declare class CallsClient {
|
|
|
90
90
|
*/
|
|
91
91
|
getCall(request: AgentPhone.GetCallV1CallsCallIdGetRequest, requestOptions?: CallsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
92
92
|
private __getCall;
|
|
93
|
+
/**
|
|
94
|
+
* Returns the audio file (WAV format) for a completed call.
|
|
95
|
+
*
|
|
96
|
+
* This is a public endpoint -- no authentication is required. The call ID acts as the access token. The `recordingUrl` field in the call response already contains this URL when recording is enabled.
|
|
97
|
+
*
|
|
98
|
+
* Recording must be enabled on your account via `POST /credits/recording/enable` ($5/mo add-on). Returns `404` if the call doesn't exist or has no recording.
|
|
99
|
+
*
|
|
100
|
+
* **Response:** Binary audio file (`audio/wav`), auto-downloads with filename `recording-{call_id}.wav`.
|
|
101
|
+
*
|
|
102
|
+
* **Notes:**
|
|
103
|
+
* - Recording is available shortly after a call completes
|
|
104
|
+
* - Check `recordingAvailable: true` in the call response before fetching
|
|
105
|
+
* - The URL can be shared or embedded directly since it requires no authentication
|
|
106
|
+
*
|
|
107
|
+
* @param {AgentPhone.GetCallRecordingV1CallsCallIdRecordingGetRequest} request
|
|
108
|
+
* @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
109
|
+
*
|
|
110
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* await client.calls.getCallRecording({
|
|
114
|
+
* call_id: "call_id"
|
|
115
|
+
* })
|
|
116
|
+
*/
|
|
117
|
+
getCallRecording(request: AgentPhone.GetCallRecordingV1CallsCallIdRecordingGetRequest, requestOptions?: CallsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
118
|
+
private __getCallRecording;
|
|
93
119
|
/**
|
|
94
120
|
* Get the full transcript for a call.
|
|
95
121
|
*
|
|
@@ -52,7 +52,7 @@ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatu
|
|
|
52
52
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
53
53
|
const AgentPhone = __importStar(require("../../../index.js"));
|
|
54
54
|
class CallsClient {
|
|
55
|
-
constructor(options) {
|
|
55
|
+
constructor(options = {}) {
|
|
56
56
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
@@ -84,7 +84,7 @@ class CallsClient {
|
|
|
84
84
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
85
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);
|
|
86
86
|
const _response = yield core.fetcher({
|
|
87
|
-
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.
|
|
87
|
+
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
88
|
method: "GET",
|
|
89
89
|
headers: _headers,
|
|
90
90
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -146,7 +146,7 @@ class CallsClient {
|
|
|
146
146
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
147
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);
|
|
148
148
|
const _response = yield core.fetcher({
|
|
149
|
-
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.
|
|
149
|
+
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
150
|
method: "POST",
|
|
151
151
|
headers: _headers,
|
|
152
152
|
contentType: "application/json",
|
|
@@ -209,7 +209,7 @@ class CallsClient {
|
|
|
209
209
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
210
210
|
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);
|
|
211
211
|
const _response = yield core.fetcher({
|
|
212
|
-
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.
|
|
212
|
+
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"),
|
|
213
213
|
method: "POST",
|
|
214
214
|
headers: _headers,
|
|
215
215
|
contentType: "application/json",
|
|
@@ -263,7 +263,7 @@ class CallsClient {
|
|
|
263
263
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
264
264
|
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
265
|
const _response = yield core.fetcher({
|
|
266
|
-
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.
|
|
266
|
+
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)}`),
|
|
267
267
|
method: "GET",
|
|
268
268
|
headers: _headers,
|
|
269
269
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -291,6 +291,67 @@ class CallsClient {
|
|
|
291
291
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/calls/{call_id}");
|
|
292
292
|
});
|
|
293
293
|
}
|
|
294
|
+
/**
|
|
295
|
+
* Returns the audio file (WAV format) for a completed call.
|
|
296
|
+
*
|
|
297
|
+
* This is a public endpoint -- no authentication is required. The call ID acts as the access token. The `recordingUrl` field in the call response already contains this URL when recording is enabled.
|
|
298
|
+
*
|
|
299
|
+
* Recording must be enabled on your account via `POST /credits/recording/enable` ($5/mo add-on). Returns `404` if the call doesn't exist or has no recording.
|
|
300
|
+
*
|
|
301
|
+
* **Response:** Binary audio file (`audio/wav`), auto-downloads with filename `recording-{call_id}.wav`.
|
|
302
|
+
*
|
|
303
|
+
* **Notes:**
|
|
304
|
+
* - Recording is available shortly after a call completes
|
|
305
|
+
* - Check `recordingAvailable: true` in the call response before fetching
|
|
306
|
+
* - The URL can be shared or embedded directly since it requires no authentication
|
|
307
|
+
*
|
|
308
|
+
* @param {AgentPhone.GetCallRecordingV1CallsCallIdRecordingGetRequest} request
|
|
309
|
+
* @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
310
|
+
*
|
|
311
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
312
|
+
*
|
|
313
|
+
* @example
|
|
314
|
+
* await client.calls.getCallRecording({
|
|
315
|
+
* call_id: "call_id"
|
|
316
|
+
* })
|
|
317
|
+
*/
|
|
318
|
+
getCallRecording(request, requestOptions) {
|
|
319
|
+
return core.HttpResponsePromise.fromPromise(this.__getCallRecording(request, requestOptions));
|
|
320
|
+
}
|
|
321
|
+
__getCallRecording(request, requestOptions) {
|
|
322
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
323
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
324
|
+
const { call_id: callId } = request;
|
|
325
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
326
|
+
const _response = yield core.fetcher({
|
|
327
|
+
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)}/recording`),
|
|
328
|
+
method: "GET",
|
|
329
|
+
headers: _headers,
|
|
330
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
331
|
+
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,
|
|
332
|
+
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,
|
|
333
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
334
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
335
|
+
logging: this._options.logging,
|
|
336
|
+
});
|
|
337
|
+
if (_response.ok) {
|
|
338
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
339
|
+
}
|
|
340
|
+
if (_response.error.reason === "status-code") {
|
|
341
|
+
switch (_response.error.statusCode) {
|
|
342
|
+
case 422:
|
|
343
|
+
throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
344
|
+
default:
|
|
345
|
+
throw new errors.AgentPhoneError({
|
|
346
|
+
statusCode: _response.error.statusCode,
|
|
347
|
+
body: _response.error.body,
|
|
348
|
+
rawResponse: _response.rawResponse,
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/calls/{call_id}/recording");
|
|
353
|
+
});
|
|
354
|
+
}
|
|
294
355
|
/**
|
|
295
356
|
* Get the full transcript for a call.
|
|
296
357
|
*
|
|
@@ -318,7 +379,7 @@ class CallsClient {
|
|
|
318
379
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
319
380
|
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);
|
|
320
381
|
const _response = yield core.fetcher({
|
|
321
|
-
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.
|
|
382
|
+
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`),
|
|
322
383
|
method: "GET",
|
|
323
384
|
headers: _headers,
|
|
324
385
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -378,7 +439,7 @@ class CallsClient {
|
|
|
378
439
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
379
440
|
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);
|
|
380
441
|
const _response = yield core.fetcher({
|
|
381
|
-
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.
|
|
442
|
+
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`),
|
|
382
443
|
method: "GET",
|
|
383
444
|
headers: _headers,
|
|
384
445
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -433,7 +494,7 @@ class CallsClient {
|
|
|
433
494
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
434
495
|
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);
|
|
435
496
|
const _response = yield core.fetcher({
|
|
436
|
-
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.
|
|
497
|
+
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`),
|
|
437
498
|
method: "GET",
|
|
438
499
|
headers: _headers,
|
|
439
500
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -18,4 +18,6 @@ export interface CreateOutboundCallRequest {
|
|
|
18
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
|
+
/** Optional per-call dynamic variables. Values are substituted into ``{{var_name}}`` placeholders in the agent's system prompt and initial greeting at call time. Requires either ``systemPrompt`` or a hosted-mode agent. */
|
|
22
|
+
variables?: Record<string, string | null> | null;
|
|
21
23
|
}
|
|
@@ -9,4 +9,6 @@ export interface CreateWebCallRequest {
|
|
|
9
9
|
agentId: string;
|
|
10
10
|
/** Optional metadata to attach to the call */
|
|
11
11
|
metadata?: Record<string, unknown> | null;
|
|
12
|
+
/** Optional per-call dynamic variables. Values are substituted into ``{{var_name}}`` placeholders in the agent's system prompt and begin message at call time. Requires a hosted-mode agent. */
|
|
13
|
+
variables?: Record<string, string | null> | null;
|
|
12
14
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { CreateOutboundCallRequest } from "./CreateOutboundCallRequest.js";
|
|
2
2
|
export type { CreateWebCallRequest } from "./CreateWebCallRequest.js";
|
|
3
|
+
export type { GetCallRecordingV1CallsCallIdRecordingGetRequest } from "./GetCallRecordingV1CallsCallIdRecordingGetRequest.js";
|
|
3
4
|
export type { GetCallTranscriptV1CallsCallIdTranscriptGetRequest } from "./GetCallTranscriptV1CallsCallIdTranscriptGetRequest.js";
|
|
4
5
|
export type { GetCallV1CallsCallIdGetRequest } from "./GetCallV1CallsCallIdGetRequest.js";
|
|
5
6
|
export type { ListCallsForNumberV1NumbersNumberIdCallsGetRequest } from "./ListCallsForNumberV1NumbersNumberIdCallsGetRequest.js";
|
|
@@ -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
|
*
|
|
@@ -63,7 +63,7 @@ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatu
|
|
|
63
63
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
64
64
|
const AgentPhone = __importStar(require("../../../index.js"));
|
|
65
65
|
class ContactsClient {
|
|
66
|
-
constructor(options) {
|
|
66
|
+
constructor(options = {}) {
|
|
67
67
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
@@ -94,7 +94,7 @@ class ContactsClient {
|
|
|
94
94
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
95
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);
|
|
96
96
|
const _response = yield core.fetcher({
|
|
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.
|
|
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/contacts"),
|
|
98
98
|
method: "GET",
|
|
99
99
|
headers: _headers,
|
|
100
100
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -148,7 +148,7 @@ class ContactsClient {
|
|
|
148
148
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
149
149
|
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);
|
|
150
150
|
const _response = yield core.fetcher({
|
|
151
|
-
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.
|
|
151
|
+
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"),
|
|
152
152
|
method: "POST",
|
|
153
153
|
headers: _headers,
|
|
154
154
|
contentType: "application/json",
|
|
@@ -202,7 +202,7 @@ class ContactsClient {
|
|
|
202
202
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
203
203
|
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);
|
|
204
204
|
const _response = yield core.fetcher({
|
|
205
|
-
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.
|
|
205
|
+
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)}`),
|
|
206
206
|
method: "GET",
|
|
207
207
|
headers: _headers,
|
|
208
208
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -253,7 +253,7 @@ class ContactsClient {
|
|
|
253
253
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
254
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);
|
|
255
255
|
const _response = yield core.fetcher({
|
|
256
|
-
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.
|
|
256
|
+
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)}`),
|
|
257
257
|
method: "DELETE",
|
|
258
258
|
headers: _headers,
|
|
259
259
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -306,7 +306,7 @@ class ContactsClient {
|
|
|
306
306
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
307
307
|
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);
|
|
308
308
|
const _response = yield core.fetcher({
|
|
309
|
-
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.
|
|
309
|
+
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)}`),
|
|
310
310
|
method: "PATCH",
|
|
311
311
|
headers: _headers,
|
|
312
312
|
contentType: "application/json",
|