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
|
@@ -63,9 +63,49 @@ 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
|
+
/**
|
|
70
|
+
* Return available voices from the call provider (Retell).
|
|
71
|
+
*
|
|
72
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* await client.agents.listVoices()
|
|
76
|
+
*/
|
|
77
|
+
listVoices(requestOptions) {
|
|
78
|
+
return core.HttpResponsePromise.fromPromise(this.__listVoices(requestOptions));
|
|
79
|
+
}
|
|
80
|
+
__listVoices(requestOptions) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
83
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
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
|
+
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.Production, "v1/agents/voices"),
|
|
87
|
+
method: "GET",
|
|
88
|
+
headers: _headers,
|
|
89
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
90
|
+
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,
|
|
91
|
+
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,
|
|
92
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
93
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
94
|
+
logging: this._options.logging,
|
|
95
|
+
});
|
|
96
|
+
if (_response.ok) {
|
|
97
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
98
|
+
}
|
|
99
|
+
if (_response.error.reason === "status-code") {
|
|
100
|
+
throw new errors.AgentPhoneError({
|
|
101
|
+
statusCode: _response.error.statusCode,
|
|
102
|
+
body: _response.error.body,
|
|
103
|
+
rawResponse: _response.rawResponse,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/agents/voices");
|
|
107
|
+
});
|
|
108
|
+
}
|
|
69
109
|
/**
|
|
70
110
|
* List all agents for this account.
|
|
71
111
|
*
|
|
@@ -91,7 +131,7 @@ class AgentsClient {
|
|
|
91
131
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
92
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);
|
|
93
133
|
const _response = yield core.fetcher({
|
|
94
|
-
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"),
|
|
95
135
|
method: "GET",
|
|
96
136
|
headers: _headers,
|
|
97
137
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -147,7 +187,7 @@ class AgentsClient {
|
|
|
147
187
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
148
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);
|
|
149
189
|
const _response = yield core.fetcher({
|
|
150
|
-
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"),
|
|
151
191
|
method: "POST",
|
|
152
192
|
headers: _headers,
|
|
153
193
|
contentType: "application/json",
|
|
@@ -201,7 +241,7 @@ class AgentsClient {
|
|
|
201
241
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
202
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);
|
|
203
243
|
const _response = yield core.fetcher({
|
|
204
|
-
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)}`),
|
|
205
245
|
method: "GET",
|
|
206
246
|
headers: _headers,
|
|
207
247
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -255,7 +295,7 @@ class AgentsClient {
|
|
|
255
295
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
256
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);
|
|
257
297
|
const _response = yield core.fetcher({
|
|
258
|
-
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)}`),
|
|
259
299
|
method: "DELETE",
|
|
260
300
|
headers: _headers,
|
|
261
301
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -309,7 +349,7 @@ class AgentsClient {
|
|
|
309
349
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
310
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);
|
|
311
351
|
const _response = yield core.fetcher({
|
|
312
|
-
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)}`),
|
|
313
353
|
method: "PATCH",
|
|
314
354
|
headers: _headers,
|
|
315
355
|
contentType: "application/json",
|
|
@@ -366,7 +406,7 @@ class AgentsClient {
|
|
|
366
406
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
367
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);
|
|
368
408
|
const _response = yield core.fetcher({
|
|
369
|
-
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`),
|
|
370
410
|
method: "POST",
|
|
371
411
|
headers: _headers,
|
|
372
412
|
contentType: "application/json",
|
|
@@ -423,7 +463,7 @@ class AgentsClient {
|
|
|
423
463
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
424
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);
|
|
425
465
|
const _response = yield core.fetcher({
|
|
426
|
-
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)}`),
|
|
427
467
|
method: "DELETE",
|
|
428
468
|
headers: _headers,
|
|
429
469
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -478,7 +518,7 @@ class AgentsClient {
|
|
|
478
518
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
479
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);
|
|
480
520
|
const _response = yield core.fetcher({
|
|
481
|
-
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`),
|
|
482
522
|
method: "GET",
|
|
483
523
|
headers: _headers,
|
|
484
524
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -536,7 +576,7 @@ class AgentsClient {
|
|
|
536
576
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
537
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);
|
|
538
578
|
const _response = yield core.fetcher({
|
|
539
|
-
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`),
|
|
540
580
|
method: "GET",
|
|
541
581
|
headers: _headers,
|
|
542
582
|
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,3 +1,21 @@
|
|
|
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
|
+
})(CreateAgentRequest || (exports.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,3 +1,21 @@
|
|
|
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
|
+
})(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
|
*
|
|
@@ -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,
|
|
@@ -318,7 +318,7 @@ class CallsClient {
|
|
|
318
318
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
319
319
|
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
320
|
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.
|
|
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.Production, `v1/calls/${core.url.encodePathParam(callId)}/transcript`),
|
|
322
322
|
method: "GET",
|
|
323
323
|
headers: _headers,
|
|
324
324
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -378,7 +378,7 @@ class CallsClient {
|
|
|
378
378
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
379
379
|
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
380
|
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.
|
|
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.Production, `v1/calls/${core.url.encodePathParam(callId)}/transcript/stream`),
|
|
382
382
|
method: "GET",
|
|
383
383
|
headers: _headers,
|
|
384
384
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -433,7 +433,7 @@ class CallsClient {
|
|
|
433
433
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
434
434
|
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
435
|
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.
|
|
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.Production, `v1/numbers/${core.url.encodePathParam(numberId)}/calls`),
|
|
437
437
|
method: "GET",
|
|
438
438
|
headers: _headers,
|
|
439
439
|
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
|
*
|
|
@@ -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",
|
|
@@ -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
|
*
|
|
@@ -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 ConversationsClient {
|
|
66
|
-
constructor(options) {
|
|
66
|
+
constructor(options = {}) {
|
|
67
67
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
@@ -93,7 +93,7 @@ class ConversationsClient {
|
|
|
93
93
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
94
94
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
95
95
|
const _response = yield core.fetcher({
|
|
96
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
96
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v1/conversations"),
|
|
97
97
|
method: "GET",
|
|
98
98
|
headers: _headers,
|
|
99
99
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -150,7 +150,7 @@ class ConversationsClient {
|
|
|
150
150
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
151
151
|
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);
|
|
152
152
|
const _response = yield core.fetcher({
|
|
153
|
-
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.
|
|
153
|
+
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)}`),
|
|
154
154
|
method: "GET",
|
|
155
155
|
headers: _headers,
|
|
156
156
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -208,7 +208,7 @@ class ConversationsClient {
|
|
|
208
208
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
209
209
|
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);
|
|
210
210
|
const _response = yield core.fetcher({
|
|
211
|
-
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.
|
|
211
|
+
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)}`),
|
|
212
212
|
method: "PATCH",
|
|
213
213
|
headers: _headers,
|
|
214
214
|
contentType: "application/json",
|
|
@@ -269,7 +269,7 @@ class ConversationsClient {
|
|
|
269
269
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
270
270
|
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);
|
|
271
271
|
const _response = yield core.fetcher({
|
|
272
|
-
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.
|
|
272
|
+
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`),
|
|
273
273
|
method: "GET",
|
|
274
274
|
headers: _headers,
|
|
275
275
|
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.js";
|
|
2
|
+
export * as agentSignup from "./agentSignup/index.js";
|
|
1
3
|
export * from "./agents/client/requests/index.js";
|
|
2
4
|
export * as agents from "./agents/index.js";
|
|
3
5
|
export * from "./agentWebhooks/client/requests/index.js";
|
|
@@ -36,7 +36,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.webhooks = exports.usage = exports.numbers = exports.messages = exports.conversations = exports.contacts = exports.calls = exports.agentWebhooks = exports.agents = void 0;
|
|
39
|
+
exports.webhooks = exports.usage = exports.numbers = exports.messages = exports.conversations = exports.contacts = exports.calls = exports.agentWebhooks = exports.agents = exports.agentSignup = void 0;
|
|
40
|
+
__exportStar(require("./agentSignup/client/requests/index.js"), exports);
|
|
41
|
+
exports.agentSignup = __importStar(require("./agentSignup/index.js"));
|
|
40
42
|
__exportStar(require("./agents/client/requests/index.js"), exports);
|
|
41
43
|
exports.agents = __importStar(require("./agents/index.js"));
|
|
42
44
|
__exportStar(require("./agentWebhooks/client/requests/index.js"), exports);
|
|
@@ -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
|
*
|
|
@@ -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 MessagesClient {
|
|
66
|
-
constructor(options) {
|
|
66
|
+
constructor(options = {}) {
|
|
67
67
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
@@ -90,7 +90,7 @@ class MessagesClient {
|
|
|
90
90
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
91
91
|
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);
|
|
92
92
|
const _response = yield core.fetcher({
|
|
93
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
93
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v1/messages"),
|
|
94
94
|
method: "POST",
|
|
95
95
|
headers: _headers,
|
|
96
96
|
contentType: "application/json",
|
|
@@ -148,7 +148,7 @@ class MessagesClient {
|
|
|
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/messages/${core.url.encodePathParam(messageId)}/reactions`),
|
|
152
152
|
method: "POST",
|
|
153
153
|
headers: _headers,
|
|
154
154
|
contentType: "application/json",
|
|
@@ -9,7 +9,7 @@ export declare namespace NumbersClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class NumbersClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<NumbersClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options?: NumbersClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* List all phone numbers for this account.
|
|
15
15
|
*
|