agentphone 1.0.4 → 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 +1 -1
- package/dist/cjs/api/resources/agents/client/Client.js +11 -11
- package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +23 -2
- package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.js +18 -0
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +23 -2
- 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/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 -2
- 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 +1 -1
- package/dist/esm/api/resources/agents/client/Client.mjs +11 -11
- package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +23 -2
- package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.mjs +17 -1
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +23 -2
- 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/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 -2
- 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 +138 -0
|
@@ -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 UsageClient {
|
|
55
|
-
constructor(options) {
|
|
55
|
+
constructor(options = {}) {
|
|
56
56
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
@@ -78,7 +78,7 @@ class UsageClient {
|
|
|
78
78
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
79
79
|
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);
|
|
80
80
|
const _response = yield core.fetcher({
|
|
81
|
-
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.
|
|
81
|
+
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/usage"),
|
|
82
82
|
method: "GET",
|
|
83
83
|
headers: _headers,
|
|
84
84
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -126,7 +126,7 @@ class UsageClient {
|
|
|
126
126
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
127
127
|
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);
|
|
128
128
|
const _response = yield core.fetcher({
|
|
129
|
-
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.
|
|
129
|
+
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/usage/daily"),
|
|
130
130
|
method: "GET",
|
|
131
131
|
headers: _headers,
|
|
132
132
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -179,7 +179,7 @@ class UsageClient {
|
|
|
179
179
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
180
180
|
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);
|
|
181
181
|
const _response = yield core.fetcher({
|
|
182
|
-
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.
|
|
182
|
+
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/usage/monthly"),
|
|
183
183
|
method: "GET",
|
|
184
184
|
headers: _headers,
|
|
185
185
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -9,7 +9,7 @@ export declare namespace WebhooksClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class WebhooksClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<WebhooksClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options?: WebhooksClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Get the master webhook configuration 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 WebhooksClient {
|
|
55
|
-
constructor(options) {
|
|
55
|
+
constructor(options = {}) {
|
|
56
56
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
@@ -72,7 +72,7 @@ class WebhooksClient {
|
|
|
72
72
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
73
73
|
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);
|
|
74
74
|
const _response = yield core.fetcher({
|
|
75
|
-
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.
|
|
75
|
+
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/webhooks"),
|
|
76
76
|
method: "GET",
|
|
77
77
|
headers: _headers,
|
|
78
78
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -123,7 +123,7 @@ class WebhooksClient {
|
|
|
123
123
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
124
124
|
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);
|
|
125
125
|
const _response = yield core.fetcher({
|
|
126
|
-
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.
|
|
126
|
+
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/webhooks"),
|
|
127
127
|
method: "POST",
|
|
128
128
|
headers: _headers,
|
|
129
129
|
contentType: "application/json",
|
|
@@ -171,7 +171,7 @@ class WebhooksClient {
|
|
|
171
171
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
172
172
|
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);
|
|
173
173
|
const _response = yield core.fetcher({
|
|
174
|
-
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.
|
|
174
|
+
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/webhooks"),
|
|
175
175
|
method: "DELETE",
|
|
176
176
|
headers: _headers,
|
|
177
177
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -220,7 +220,7 @@ class WebhooksClient {
|
|
|
220
220
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
221
221
|
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);
|
|
222
222
|
const _response = yield core.fetcher({
|
|
223
|
-
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.
|
|
223
|
+
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/webhooks/deliveries"),
|
|
224
224
|
method: "GET",
|
|
225
225
|
headers: _headers,
|
|
226
226
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -275,7 +275,7 @@ class WebhooksClient {
|
|
|
275
275
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
276
276
|
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);
|
|
277
277
|
const _response = yield core.fetcher({
|
|
278
|
-
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.
|
|
278
|
+
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/webhooks/deliveries/stats"),
|
|
279
279
|
method: "GET",
|
|
280
280
|
headers: _headers,
|
|
281
281
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -323,7 +323,7 @@ class WebhooksClient {
|
|
|
323
323
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
324
324
|
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);
|
|
325
325
|
const _response = yield core.fetcher({
|
|
326
|
-
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.
|
|
326
|
+
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/webhooks/deliveries/all-time"),
|
|
327
327
|
method: "GET",
|
|
328
328
|
headers: _headers,
|
|
329
329
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -374,7 +374,7 @@ class WebhooksClient {
|
|
|
374
374
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
375
375
|
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);
|
|
376
376
|
const _response = yield core.fetcher({
|
|
377
|
-
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.
|
|
377
|
+
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/webhooks/test"),
|
|
378
378
|
method: "POST",
|
|
379
379
|
headers: _headers,
|
|
380
380
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -3,13 +3,34 @@ export interface AgentResponse {
|
|
|
3
3
|
id: string;
|
|
4
4
|
name: string;
|
|
5
5
|
description: string | null;
|
|
6
|
-
voiceMode:
|
|
7
|
-
modelTier?:
|
|
6
|
+
voiceMode: AgentResponse.VoiceMode;
|
|
7
|
+
modelTier?: AgentResponse.ModelTier;
|
|
8
8
|
systemPrompt?: string | null;
|
|
9
9
|
beginMessage?: string | null;
|
|
10
10
|
voice: string;
|
|
11
11
|
transferNumber?: string | null;
|
|
12
12
|
voicemailMessage?: string | null;
|
|
13
|
+
/** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
|
|
14
|
+
sttMode?: AgentResponse.SttMode;
|
|
13
15
|
createdAt: string;
|
|
14
16
|
numbers?: AgentPhone.AgentNumberResponse[] | null;
|
|
15
17
|
}
|
|
18
|
+
export declare namespace AgentResponse {
|
|
19
|
+
const VoiceMode: {
|
|
20
|
+
readonly Webhook: "webhook";
|
|
21
|
+
readonly Hosted: "hosted";
|
|
22
|
+
};
|
|
23
|
+
type VoiceMode = (typeof VoiceMode)[keyof typeof VoiceMode];
|
|
24
|
+
const ModelTier: {
|
|
25
|
+
readonly Turbo: "turbo";
|
|
26
|
+
readonly Balanced: "balanced";
|
|
27
|
+
readonly Max: "max";
|
|
28
|
+
};
|
|
29
|
+
type ModelTier = (typeof ModelTier)[keyof typeof ModelTier];
|
|
30
|
+
/** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
|
|
31
|
+
const SttMode: {
|
|
32
|
+
readonly Fast: "fast";
|
|
33
|
+
readonly Accurate: "accurate";
|
|
34
|
+
};
|
|
35
|
+
type SttMode = (typeof SttMode)[keyof typeof SttMode];
|
|
36
|
+
}
|
|
@@ -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.AgentResponse = void 0;
|
|
5
|
+
var AgentResponse;
|
|
6
|
+
(function (AgentResponse) {
|
|
7
|
+
AgentResponse.VoiceMode = {
|
|
8
|
+
Webhook: "webhook",
|
|
9
|
+
Hosted: "hosted",
|
|
10
|
+
};
|
|
11
|
+
AgentResponse.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
|
+
AgentResponse.SttMode = {
|
|
18
|
+
Fast: "fast",
|
|
19
|
+
Accurate: "accurate",
|
|
20
|
+
};
|
|
21
|
+
})(AgentResponse || (exports.AgentResponse = AgentResponse = {}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as AgentPhone from "../index.js";
|
|
1
2
|
export interface MessageInConversation {
|
|
2
3
|
id: string;
|
|
3
4
|
body: string;
|
|
@@ -7,4 +8,5 @@ export interface MessageInConversation {
|
|
|
7
8
|
channel?: string | null;
|
|
8
9
|
mediaUrl?: string | null;
|
|
9
10
|
receivedAt: string;
|
|
11
|
+
reactions?: AgentPhone.ReactionInConversation[];
|
|
10
12
|
}
|
|
@@ -28,6 +28,7 @@ export * from "./PhoneNumberListResponse.js";
|
|
|
28
28
|
export * from "./PhoneNumberResponse.js";
|
|
29
29
|
export * from "./PlanInfo.js";
|
|
30
30
|
export * from "./PlanLimits.js";
|
|
31
|
+
export * from "./ReactionInConversation.js";
|
|
31
32
|
export * from "./SendMessageResponse.js";
|
|
32
33
|
export * from "./SendReactionResponse.js";
|
|
33
34
|
export * from "./UsageResponse.js";
|
|
@@ -44,6 +44,7 @@ __exportStar(require("./PhoneNumberListResponse.js"), exports);
|
|
|
44
44
|
__exportStar(require("./PhoneNumberResponse.js"), exports);
|
|
45
45
|
__exportStar(require("./PlanInfo.js"), exports);
|
|
46
46
|
__exportStar(require("./PlanLimits.js"), exports);
|
|
47
|
+
__exportStar(require("./ReactionInConversation.js"), exports);
|
|
47
48
|
__exportStar(require("./SendMessageResponse.js"), exports);
|
|
48
49
|
__exportStar(require("./SendReactionResponse.js"), exports);
|
|
49
50
|
__exportStar(require("./UsageResponse.js"), exports);
|
|
@@ -13,7 +13,7 @@ export declare namespace BearerAuthProvider {
|
|
|
13
13
|
const AUTH_CONFIG_ERROR_MESSAGE: string;
|
|
14
14
|
type Options = AuthOptions;
|
|
15
15
|
type AuthOptions = {
|
|
16
|
-
[TOKEN_PARAM]
|
|
16
|
+
[TOKEN_PARAM]?: core.Supplier<core.BearerToken>;
|
|
17
17
|
};
|
|
18
18
|
function createInstance(options: Options): core.AuthProvider;
|
|
19
19
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const AgentPhoneEnvironment: {
|
|
2
|
-
readonly
|
|
2
|
+
readonly Production: "https://api.agentphone.to";
|
|
3
3
|
};
|
|
4
|
-
export type AgentPhoneEnvironment = typeof AgentPhoneEnvironment.
|
|
4
|
+
export type AgentPhoneEnvironment = typeof AgentPhoneEnvironment.Production;
|
package/dist/cjs/environments.js
CHANGED
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.
|
|
1
|
+
export declare const SDK_VERSION = "1.0.5";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "agentphone",
|
|
9
|
-
"X-Fern-SDK-Version": "1.0.
|
|
10
|
-
"User-Agent": "agentphone/1.0.
|
|
9
|
+
"X-Fern-SDK-Version": "1.0.5",
|
|
10
|
+
"User-Agent": "agentphone/1.0.5",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/esm/Client.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AgentSignupClient } from "./api/resources/agentSignup/client/Client.mjs";
|
|
1
2
|
import { AgentsClient } from "./api/resources/agents/client/Client.mjs";
|
|
2
3
|
import { AgentWebhooksClient } from "./api/resources/agentWebhooks/client/Client.mjs";
|
|
3
4
|
import { CallsClient } from "./api/resources/calls/client/Client.mjs";
|
|
@@ -16,6 +17,7 @@ export declare namespace AgentPhoneClient {
|
|
|
16
17
|
}
|
|
17
18
|
export declare class AgentPhoneClient {
|
|
18
19
|
protected readonly _options: NormalizedClientOptionsWithAuth<AgentPhoneClient.Options>;
|
|
20
|
+
protected _agentSignup: AgentSignupClient | undefined;
|
|
19
21
|
protected _agents: AgentsClient | undefined;
|
|
20
22
|
protected _numbers: NumbersClient | undefined;
|
|
21
23
|
protected _webhooks: WebhooksClient | undefined;
|
|
@@ -25,7 +27,8 @@ export declare class AgentPhoneClient {
|
|
|
25
27
|
protected _calls: CallsClient | undefined;
|
|
26
28
|
protected _usage: UsageClient | undefined;
|
|
27
29
|
protected _messages: MessagesClient | undefined;
|
|
28
|
-
constructor(options
|
|
30
|
+
constructor(options?: AgentPhoneClient.Options);
|
|
31
|
+
get agentSignup(): AgentSignupClient;
|
|
29
32
|
get agents(): AgentsClient;
|
|
30
33
|
get numbers(): NumbersClient;
|
|
31
34
|
get webhooks(): WebhooksClient;
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import { AgentSignupClient } from "./api/resources/agentSignup/client/Client.mjs";
|
|
2
3
|
import { AgentsClient } from "./api/resources/agents/client/Client.mjs";
|
|
3
4
|
import { AgentWebhooksClient } from "./api/resources/agentWebhooks/client/Client.mjs";
|
|
4
5
|
import { CallsClient } from "./api/resources/calls/client/Client.mjs";
|
|
@@ -10,9 +11,13 @@ import { UsageClient } from "./api/resources/usage/client/Client.mjs";
|
|
|
10
11
|
import { WebhooksClient } from "./api/resources/webhooks/client/Client.mjs";
|
|
11
12
|
import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
12
13
|
export class AgentPhoneClient {
|
|
13
|
-
constructor(options) {
|
|
14
|
+
constructor(options = {}) {
|
|
14
15
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
15
16
|
}
|
|
17
|
+
get agentSignup() {
|
|
18
|
+
var _a;
|
|
19
|
+
return ((_a = this._agentSignup) !== null && _a !== void 0 ? _a : (this._agentSignup = new AgentSignupClient(this._options)));
|
|
20
|
+
}
|
|
16
21
|
get agents() {
|
|
17
22
|
var _a;
|
|
18
23
|
return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new AgentsClient(this._options)));
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptions } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as AgentPhone from "../../../index.mjs";
|
|
5
|
+
export declare namespace AgentSignupClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class AgentSignupClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptions<AgentSignupClient.Options>;
|
|
12
|
+
constructor(options?: AgentSignupClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Kick off agent self-signup.
|
|
15
|
+
*
|
|
16
|
+
* Sends a 6-digit OTP to the human's email. Nothing is provisioned server-side
|
|
17
|
+
* until /v0/agent/verify is called with the code.
|
|
18
|
+
*
|
|
19
|
+
* @param {AgentPhone.AgentSignUpRequest} request
|
|
20
|
+
* @param {AgentSignupClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
21
|
+
*
|
|
22
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* await client.agentSignup.agentSignUp({
|
|
26
|
+
* human_email: "human_email"
|
|
27
|
+
* })
|
|
28
|
+
*/
|
|
29
|
+
agentSignUp(request: AgentPhone.AgentSignUpRequest, requestOptions?: AgentSignupClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
30
|
+
private __agentSignUp;
|
|
31
|
+
/**
|
|
32
|
+
* Verify the OTP and atomically provision everything.
|
|
33
|
+
*
|
|
34
|
+
* Creates: User + Project (+ mirrored Account) + starter hosted Agent + Twilio number
|
|
35
|
+
* + first-month charge + API key. Returns the key once — agents must save it.
|
|
36
|
+
*
|
|
37
|
+
* @param {AgentPhone.AgentVerifyRequest} request
|
|
38
|
+
* @param {AgentSignupClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
+
*
|
|
40
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* await client.agentSignup.agentVerify({
|
|
44
|
+
* verification_id: "verification_id",
|
|
45
|
+
* otp_code: "otp_code"
|
|
46
|
+
* })
|
|
47
|
+
*/
|
|
48
|
+
agentVerify(request: AgentPhone.AgentVerifyRequest, requestOptions?: AgentSignupClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
49
|
+
private __agentVerify;
|
|
50
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptions } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
17
|
+
import * as AgentPhone from "../../../index.mjs";
|
|
18
|
+
export class AgentSignupClient {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this._options = normalizeClientOptions(options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Kick off agent self-signup.
|
|
24
|
+
*
|
|
25
|
+
* Sends a 6-digit OTP to the human's email. Nothing is provisioned server-side
|
|
26
|
+
* until /v0/agent/verify is called with the code.
|
|
27
|
+
*
|
|
28
|
+
* @param {AgentPhone.AgentSignUpRequest} request
|
|
29
|
+
* @param {AgentSignupClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
30
|
+
*
|
|
31
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* await client.agentSignup.agentSignUp({
|
|
35
|
+
* human_email: "human_email"
|
|
36
|
+
* })
|
|
37
|
+
*/
|
|
38
|
+
agentSignUp(request, requestOptions) {
|
|
39
|
+
return core.HttpResponsePromise.fromPromise(this.__agentSignUp(request, requestOptions));
|
|
40
|
+
}
|
|
41
|
+
__agentSignUp(request, requestOptions) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
44
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
45
|
+
const _response = yield core.fetcher({
|
|
46
|
+
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, "v0/agent/sign-up"),
|
|
47
|
+
method: "POST",
|
|
48
|
+
headers: _headers,
|
|
49
|
+
contentType: "application/json",
|
|
50
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
51
|
+
requestType: "json",
|
|
52
|
+
body: request,
|
|
53
|
+
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,
|
|
54
|
+
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,
|
|
55
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
56
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
57
|
+
logging: this._options.logging,
|
|
58
|
+
});
|
|
59
|
+
if (_response.ok) {
|
|
60
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
61
|
+
}
|
|
62
|
+
if (_response.error.reason === "status-code") {
|
|
63
|
+
switch (_response.error.statusCode) {
|
|
64
|
+
case 422:
|
|
65
|
+
throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
66
|
+
default:
|
|
67
|
+
throw new errors.AgentPhoneError({
|
|
68
|
+
statusCode: _response.error.statusCode,
|
|
69
|
+
body: _response.error.body,
|
|
70
|
+
rawResponse: _response.rawResponse,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/agent/sign-up");
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Verify the OTP and atomically provision everything.
|
|
79
|
+
*
|
|
80
|
+
* Creates: User + Project (+ mirrored Account) + starter hosted Agent + Twilio number
|
|
81
|
+
* + first-month charge + API key. Returns the key once — agents must save it.
|
|
82
|
+
*
|
|
83
|
+
* @param {AgentPhone.AgentVerifyRequest} request
|
|
84
|
+
* @param {AgentSignupClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
85
|
+
*
|
|
86
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* await client.agentSignup.agentVerify({
|
|
90
|
+
* verification_id: "verification_id",
|
|
91
|
+
* otp_code: "otp_code"
|
|
92
|
+
* })
|
|
93
|
+
*/
|
|
94
|
+
agentVerify(request, requestOptions) {
|
|
95
|
+
return core.HttpResponsePromise.fromPromise(this.__agentVerify(request, requestOptions));
|
|
96
|
+
}
|
|
97
|
+
__agentVerify(request, requestOptions) {
|
|
98
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
100
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
101
|
+
const _response = yield core.fetcher({
|
|
102
|
+
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, "v0/agent/verify"),
|
|
103
|
+
method: "POST",
|
|
104
|
+
headers: _headers,
|
|
105
|
+
contentType: "application/json",
|
|
106
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
107
|
+
requestType: "json",
|
|
108
|
+
body: request,
|
|
109
|
+
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,
|
|
110
|
+
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,
|
|
111
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
112
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
113
|
+
logging: this._options.logging,
|
|
114
|
+
});
|
|
115
|
+
if (_response.ok) {
|
|
116
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
117
|
+
}
|
|
118
|
+
if (_response.error.reason === "status-code") {
|
|
119
|
+
switch (_response.error.statusCode) {
|
|
120
|
+
case 422:
|
|
121
|
+
throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
122
|
+
default:
|
|
123
|
+
throw new errors.AgentPhoneError({
|
|
124
|
+
statusCode: _response.error.statusCode,
|
|
125
|
+
body: _response.error.body,
|
|
126
|
+
rawResponse: _response.rawResponse,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/agent/verify");
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -9,7 +9,7 @@ export declare namespace AgentWebhooksClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class AgentWebhooksClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<AgentWebhooksClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options?: AgentWebhooksClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Get the webhook configuration for a specific agent.
|
|
15
15
|
*
|