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
|
@@ -27,7 +27,7 @@ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCode
|
|
|
27
27
|
import * as errors from "../../../../errors/index.mjs";
|
|
28
28
|
import * as AgentPhone from "../../../index.mjs";
|
|
29
29
|
export class MessagesClient {
|
|
30
|
-
constructor(options) {
|
|
30
|
+
constructor(options = {}) {
|
|
31
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -54,7 +54,7 @@ export class MessagesClient {
|
|
|
54
54
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
55
55
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
56
56
|
const _response = yield core.fetcher({
|
|
57
|
-
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.
|
|
57
|
+
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"),
|
|
58
58
|
method: "POST",
|
|
59
59
|
headers: _headers,
|
|
60
60
|
contentType: "application/json",
|
|
@@ -112,7 +112,7 @@ export class MessagesClient {
|
|
|
112
112
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
113
113
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
114
114
|
const _response = yield core.fetcher({
|
|
115
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
115
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/messages/${core.url.encodePathParam(messageId)}/reactions`),
|
|
116
116
|
method: "POST",
|
|
117
117
|
headers: _headers,
|
|
118
118
|
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
|
*
|
|
@@ -16,7 +16,7 @@ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCode
|
|
|
16
16
|
import * as errors from "../../../../errors/index.mjs";
|
|
17
17
|
import * as AgentPhone from "../../../index.mjs";
|
|
18
18
|
export class NumbersClient {
|
|
19
|
-
constructor(options) {
|
|
19
|
+
constructor(options = {}) {
|
|
20
20
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -44,7 +44,7 @@ export class NumbersClient {
|
|
|
44
44
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
45
45
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
46
46
|
const _response = yield core.fetcher({
|
|
47
|
-
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.
|
|
47
|
+
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"),
|
|
48
48
|
method: "GET",
|
|
49
49
|
headers: _headers,
|
|
50
50
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -98,7 +98,7 @@ export class NumbersClient {
|
|
|
98
98
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
99
99
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
100
100
|
const _response = yield core.fetcher({
|
|
101
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
101
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v1/numbers"),
|
|
102
102
|
method: "POST",
|
|
103
103
|
headers: _headers,
|
|
104
104
|
contentType: "application/json",
|
|
@@ -159,7 +159,7 @@ export class NumbersClient {
|
|
|
159
159
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
160
160
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
161
161
|
const _response = yield core.fetcher({
|
|
162
|
-
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.
|
|
162
|
+
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)}/messages`),
|
|
163
163
|
method: "GET",
|
|
164
164
|
headers: _headers,
|
|
165
165
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -217,7 +217,7 @@ export class NumbersClient {
|
|
|
217
217
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
218
218
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
219
219
|
const _response = yield core.fetcher({
|
|
220
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
220
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/numbers/${core.url.encodePathParam(numberId)}`),
|
|
221
221
|
method: "DELETE",
|
|
222
222
|
headers: _headers,
|
|
223
223
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -9,7 +9,7 @@ export declare namespace UsageClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class UsageClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<UsageClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options?: UsageClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Get usage statistics for the current account.
|
|
15
15
|
*
|
|
@@ -16,7 +16,7 @@ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCode
|
|
|
16
16
|
import * as errors from "../../../../errors/index.mjs";
|
|
17
17
|
import * as AgentPhone from "../../../index.mjs";
|
|
18
18
|
export class UsageClient {
|
|
19
|
-
constructor(options) {
|
|
19
|
+
constructor(options = {}) {
|
|
20
20
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -42,7 +42,7 @@ export class UsageClient {
|
|
|
42
42
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
43
43
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
44
44
|
const _response = yield core.fetcher({
|
|
45
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
45
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v1/usage"),
|
|
46
46
|
method: "GET",
|
|
47
47
|
headers: _headers,
|
|
48
48
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -90,7 +90,7 @@ export class UsageClient {
|
|
|
90
90
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
91
91
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
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/usage/daily"),
|
|
94
94
|
method: "GET",
|
|
95
95
|
headers: _headers,
|
|
96
96
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -143,7 +143,7 @@ export class UsageClient {
|
|
|
143
143
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
144
144
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
145
145
|
const _response = yield core.fetcher({
|
|
146
|
-
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.
|
|
146
|
+
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"),
|
|
147
147
|
method: "GET",
|
|
148
148
|
headers: _headers,
|
|
149
149
|
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
|
*
|
|
@@ -16,7 +16,7 @@ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCode
|
|
|
16
16
|
import * as errors from "../../../../errors/index.mjs";
|
|
17
17
|
import * as AgentPhone from "../../../index.mjs";
|
|
18
18
|
export class WebhooksClient {
|
|
19
|
-
constructor(options) {
|
|
19
|
+
constructor(options = {}) {
|
|
20
20
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -36,7 +36,7 @@ export class WebhooksClient {
|
|
|
36
36
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
37
37
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
38
38
|
const _response = yield core.fetcher({
|
|
39
|
-
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.
|
|
39
|
+
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"),
|
|
40
40
|
method: "GET",
|
|
41
41
|
headers: _headers,
|
|
42
42
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -87,7 +87,7 @@ export class WebhooksClient {
|
|
|
87
87
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
88
88
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
89
89
|
const _response = yield core.fetcher({
|
|
90
|
-
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.
|
|
90
|
+
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"),
|
|
91
91
|
method: "POST",
|
|
92
92
|
headers: _headers,
|
|
93
93
|
contentType: "application/json",
|
|
@@ -135,7 +135,7 @@ export class WebhooksClient {
|
|
|
135
135
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
136
136
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
137
137
|
const _response = yield core.fetcher({
|
|
138
|
-
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.
|
|
138
|
+
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"),
|
|
139
139
|
method: "DELETE",
|
|
140
140
|
headers: _headers,
|
|
141
141
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -184,7 +184,7 @@ export class WebhooksClient {
|
|
|
184
184
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
185
185
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
186
186
|
const _response = yield core.fetcher({
|
|
187
|
-
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.
|
|
187
|
+
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"),
|
|
188
188
|
method: "GET",
|
|
189
189
|
headers: _headers,
|
|
190
190
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -239,7 +239,7 @@ export class WebhooksClient {
|
|
|
239
239
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
240
240
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
241
241
|
const _response = yield core.fetcher({
|
|
242
|
-
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.
|
|
242
|
+
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"),
|
|
243
243
|
method: "GET",
|
|
244
244
|
headers: _headers,
|
|
245
245
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -287,7 +287,7 @@ export class WebhooksClient {
|
|
|
287
287
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
288
288
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
289
289
|
const _response = yield core.fetcher({
|
|
290
|
-
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.
|
|
290
|
+
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"),
|
|
291
291
|
method: "GET",
|
|
292
292
|
headers: _headers,
|
|
293
293
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -338,7 +338,7 @@ export class WebhooksClient {
|
|
|
338
338
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
339
339
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
340
340
|
const _response = yield core.fetcher({
|
|
341
|
-
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.
|
|
341
|
+
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"),
|
|
342
342
|
method: "POST",
|
|
343
343
|
headers: _headers,
|
|
344
344
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -3,12 +3,34 @@ export interface AgentResponse {
|
|
|
3
3
|
id: string;
|
|
4
4
|
name: string;
|
|
5
5
|
description: string | null;
|
|
6
|
-
voiceMode:
|
|
6
|
+
voiceMode: AgentResponse.VoiceMode;
|
|
7
|
+
modelTier?: AgentResponse.ModelTier;
|
|
7
8
|
systemPrompt?: string | null;
|
|
8
9
|
beginMessage?: string | null;
|
|
9
10
|
voice: string;
|
|
10
11
|
transferNumber?: string | null;
|
|
11
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;
|
|
12
15
|
createdAt: string;
|
|
13
16
|
numbers?: AgentPhone.AgentNumberResponse[] | null;
|
|
14
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,2 +1,18 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export
|
|
2
|
+
export var AgentResponse;
|
|
3
|
+
(function (AgentResponse) {
|
|
4
|
+
AgentResponse.VoiceMode = {
|
|
5
|
+
Webhook: "webhook",
|
|
6
|
+
Hosted: "hosted",
|
|
7
|
+
};
|
|
8
|
+
AgentResponse.ModelTier = {
|
|
9
|
+
Turbo: "turbo",
|
|
10
|
+
Balanced: "balanced",
|
|
11
|
+
Max: "max",
|
|
12
|
+
};
|
|
13
|
+
/** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
|
|
14
|
+
AgentResponse.SttMode = {
|
|
15
|
+
Fast: "fast",
|
|
16
|
+
Accurate: "accurate",
|
|
17
|
+
};
|
|
18
|
+
})(AgentResponse || (AgentResponse = {}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as AgentPhone from "../index.mjs";
|
|
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.mjs";
|
|
|
28
28
|
export * from "./PhoneNumberResponse.mjs";
|
|
29
29
|
export * from "./PlanInfo.mjs";
|
|
30
30
|
export * from "./PlanLimits.mjs";
|
|
31
|
+
export * from "./ReactionInConversation.mjs";
|
|
31
32
|
export * from "./SendMessageResponse.mjs";
|
|
32
33
|
export * from "./SendReactionResponse.mjs";
|
|
33
34
|
export * from "./UsageResponse.mjs";
|
|
@@ -28,6 +28,7 @@ export * from "./PhoneNumberListResponse.mjs";
|
|
|
28
28
|
export * from "./PhoneNumberResponse.mjs";
|
|
29
29
|
export * from "./PlanInfo.mjs";
|
|
30
30
|
export * from "./PlanLimits.mjs";
|
|
31
|
+
export * from "./ReactionInConversation.mjs";
|
|
31
32
|
export * from "./SendMessageResponse.mjs";
|
|
32
33
|
export * from "./SendReactionResponse.mjs";
|
|
33
34
|
export * from "./UsageResponse.mjs";
|
|
@@ -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/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.
|
|
1
|
+
export declare const SDK_VERSION = "1.0.5";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.0.
|
|
1
|
+
export const SDK_VERSION = "1.0.5";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -1,5 +1,198 @@
|
|
|
1
1
|
# Reference
|
|
2
|
+
## AgentSignup
|
|
3
|
+
<details><summary><code>client.agentSignup.<a href="/src/api/resources/agentSignup/client/Client.ts">agentSignUp</a>({ ...params }) -> unknown</code></summary>
|
|
4
|
+
<dl>
|
|
5
|
+
<dd>
|
|
6
|
+
|
|
7
|
+
#### 📝 Description
|
|
8
|
+
|
|
9
|
+
<dl>
|
|
10
|
+
<dd>
|
|
11
|
+
|
|
12
|
+
<dl>
|
|
13
|
+
<dd>
|
|
14
|
+
|
|
15
|
+
Kick off agent self-signup.
|
|
16
|
+
|
|
17
|
+
Sends a 6-digit OTP to the human's email. Nothing is provisioned server-side
|
|
18
|
+
until /v0/agent/verify is called with the code.
|
|
19
|
+
</dd>
|
|
20
|
+
</dl>
|
|
21
|
+
</dd>
|
|
22
|
+
</dl>
|
|
23
|
+
|
|
24
|
+
#### 🔌 Usage
|
|
25
|
+
|
|
26
|
+
<dl>
|
|
27
|
+
<dd>
|
|
28
|
+
|
|
29
|
+
<dl>
|
|
30
|
+
<dd>
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
await client.agentSignup.agentSignUp({
|
|
34
|
+
human_email: "human_email"
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
</dd>
|
|
39
|
+
</dl>
|
|
40
|
+
</dd>
|
|
41
|
+
</dl>
|
|
42
|
+
|
|
43
|
+
#### ⚙️ Parameters
|
|
44
|
+
|
|
45
|
+
<dl>
|
|
46
|
+
<dd>
|
|
47
|
+
|
|
48
|
+
<dl>
|
|
49
|
+
<dd>
|
|
50
|
+
|
|
51
|
+
**request:** `AgentPhone.AgentSignUpRequest`
|
|
52
|
+
|
|
53
|
+
</dd>
|
|
54
|
+
</dl>
|
|
55
|
+
|
|
56
|
+
<dl>
|
|
57
|
+
<dd>
|
|
58
|
+
|
|
59
|
+
**requestOptions:** `AgentSignupClient.RequestOptions`
|
|
60
|
+
|
|
61
|
+
</dd>
|
|
62
|
+
</dl>
|
|
63
|
+
</dd>
|
|
64
|
+
</dl>
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
</dd>
|
|
68
|
+
</dl>
|
|
69
|
+
</details>
|
|
70
|
+
|
|
71
|
+
<details><summary><code>client.agentSignup.<a href="/src/api/resources/agentSignup/client/Client.ts">agentVerify</a>({ ...params }) -> unknown</code></summary>
|
|
72
|
+
<dl>
|
|
73
|
+
<dd>
|
|
74
|
+
|
|
75
|
+
#### 📝 Description
|
|
76
|
+
|
|
77
|
+
<dl>
|
|
78
|
+
<dd>
|
|
79
|
+
|
|
80
|
+
<dl>
|
|
81
|
+
<dd>
|
|
82
|
+
|
|
83
|
+
Verify the OTP and atomically provision everything.
|
|
84
|
+
|
|
85
|
+
Creates: User + Project (+ mirrored Account) + starter hosted Agent + Twilio number
|
|
86
|
+
+ first-month charge + API key. Returns the key once — agents must save it.
|
|
87
|
+
</dd>
|
|
88
|
+
</dl>
|
|
89
|
+
</dd>
|
|
90
|
+
</dl>
|
|
91
|
+
|
|
92
|
+
#### 🔌 Usage
|
|
93
|
+
|
|
94
|
+
<dl>
|
|
95
|
+
<dd>
|
|
96
|
+
|
|
97
|
+
<dl>
|
|
98
|
+
<dd>
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
await client.agentSignup.agentVerify({
|
|
102
|
+
verification_id: "verification_id",
|
|
103
|
+
otp_code: "otp_code"
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
</dd>
|
|
108
|
+
</dl>
|
|
109
|
+
</dd>
|
|
110
|
+
</dl>
|
|
111
|
+
|
|
112
|
+
#### ⚙️ Parameters
|
|
113
|
+
|
|
114
|
+
<dl>
|
|
115
|
+
<dd>
|
|
116
|
+
|
|
117
|
+
<dl>
|
|
118
|
+
<dd>
|
|
119
|
+
|
|
120
|
+
**request:** `AgentPhone.AgentVerifyRequest`
|
|
121
|
+
|
|
122
|
+
</dd>
|
|
123
|
+
</dl>
|
|
124
|
+
|
|
125
|
+
<dl>
|
|
126
|
+
<dd>
|
|
127
|
+
|
|
128
|
+
**requestOptions:** `AgentSignupClient.RequestOptions`
|
|
129
|
+
|
|
130
|
+
</dd>
|
|
131
|
+
</dl>
|
|
132
|
+
</dd>
|
|
133
|
+
</dl>
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
</dd>
|
|
137
|
+
</dl>
|
|
138
|
+
</details>
|
|
139
|
+
|
|
2
140
|
## Agents
|
|
141
|
+
<details><summary><code>client.agents.<a href="/src/api/resources/agents/client/Client.ts">listVoices</a>() -> unknown</code></summary>
|
|
142
|
+
<dl>
|
|
143
|
+
<dd>
|
|
144
|
+
|
|
145
|
+
#### 📝 Description
|
|
146
|
+
|
|
147
|
+
<dl>
|
|
148
|
+
<dd>
|
|
149
|
+
|
|
150
|
+
<dl>
|
|
151
|
+
<dd>
|
|
152
|
+
|
|
153
|
+
Return available voices from the call provider (Retell).
|
|
154
|
+
</dd>
|
|
155
|
+
</dl>
|
|
156
|
+
</dd>
|
|
157
|
+
</dl>
|
|
158
|
+
|
|
159
|
+
#### 🔌 Usage
|
|
160
|
+
|
|
161
|
+
<dl>
|
|
162
|
+
<dd>
|
|
163
|
+
|
|
164
|
+
<dl>
|
|
165
|
+
<dd>
|
|
166
|
+
|
|
167
|
+
```typescript
|
|
168
|
+
await client.agents.listVoices();
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
</dd>
|
|
172
|
+
</dl>
|
|
173
|
+
</dd>
|
|
174
|
+
</dl>
|
|
175
|
+
|
|
176
|
+
#### ⚙️ Parameters
|
|
177
|
+
|
|
178
|
+
<dl>
|
|
179
|
+
<dd>
|
|
180
|
+
|
|
181
|
+
<dl>
|
|
182
|
+
<dd>
|
|
183
|
+
|
|
184
|
+
**requestOptions:** `AgentsClient.RequestOptions`
|
|
185
|
+
|
|
186
|
+
</dd>
|
|
187
|
+
</dl>
|
|
188
|
+
</dd>
|
|
189
|
+
</dl>
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
</dd>
|
|
193
|
+
</dl>
|
|
194
|
+
</details>
|
|
195
|
+
|
|
3
196
|
<details><summary><code>client.agents.<a href="/src/api/resources/agents/client/Client.ts">listAgents</a>({ ...params }) -> AgentPhone.AgentListResponse</code></summary>
|
|
4
197
|
<dl>
|
|
5
198
|
<dd>
|