agentphone 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +4 -1
- package/dist/cjs/Client.js +24 -19
- package/dist/cjs/api/resources/agentSignup/client/Client.d.ts +50 -0
- package/dist/cjs/api/resources/agentSignup/client/Client.js +170 -0
- package/dist/cjs/api/resources/agentSignup/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/agentSignup/client/index.js +17 -0
- package/dist/cjs/api/resources/agentSignup/client/requests/AgentSignUpRequest.d.ts +10 -0
- package/dist/cjs/api/resources/agentSignup/client/requests/AgentSignUpRequest.js +3 -0
- package/dist/cjs/api/resources/agentSignup/client/requests/AgentVerifyRequest.d.ts +11 -0
- package/dist/cjs/api/resources/agentSignup/client/requests/AgentVerifyRequest.js +3 -0
- package/dist/cjs/api/resources/agentSignup/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/agentSignup/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/agentSignup/index.d.ts +1 -0
- package/dist/cjs/api/resources/agentSignup/index.js +17 -0
- package/dist/cjs/api/resources/agentWebhooks/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/agentWebhooks/client/Client.js +6 -6
- package/dist/cjs/api/resources/agents/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/agents/client/Client.js +11 -11
- package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +41 -2
- package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.js +30 -0
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +41 -2
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +30 -0
- package/dist/cjs/api/resources/agents/client/requests/index.d.ts +2 -2
- package/dist/cjs/api/resources/agents/client/requests/index.js +5 -0
- package/dist/cjs/api/resources/calls/client/Client.d.ts +27 -1
- package/dist/cjs/api/resources/calls/client/Client.js +69 -8
- package/dist/cjs/api/resources/calls/client/requests/CreateOutboundCallRequest.d.ts +2 -0
- package/dist/cjs/api/resources/calls/client/requests/CreateWebCallRequest.d.ts +2 -0
- package/dist/cjs/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.d.ts +9 -0
- package/dist/cjs/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.js +3 -0
- package/dist/cjs/api/resources/calls/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/contacts/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/contacts/client/Client.js +6 -6
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +20 -1
- package/dist/cjs/api/resources/conversations/client/Client.js +60 -5
- package/dist/cjs/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.d.ts +9 -0
- package/dist/cjs/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.js +3 -0
- package/dist/cjs/api/resources/conversations/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/index.js +3 -1
- package/dist/cjs/api/resources/messages/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/messages/client/Client.js +3 -3
- package/dist/cjs/api/resources/numbers/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/numbers/client/Client.js +5 -5
- package/dist/cjs/api/resources/usage/client/Client.d.ts +11 -1
- package/dist/cjs/api/resources/usage/client/Client.js +44 -4
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/webhooks/client/Client.js +8 -8
- package/dist/cjs/api/types/AgentResponse.d.ts +41 -2
- package/dist/cjs/api/types/AgentResponse.js +30 -0
- package/dist/cjs/api/types/MessageInConversation.d.ts +2 -0
- package/dist/cjs/api/types/NumberUsageItem.d.ts +10 -0
- package/dist/cjs/api/types/NumberUsageItem.js +3 -0
- package/dist/cjs/api/types/NumberUsageResponse.d.ts +4 -0
- package/dist/cjs/api/types/NumberUsageResponse.js +3 -0
- package/dist/cjs/api/types/ReactionInConversation.d.ts +7 -0
- package/dist/cjs/api/types/ReactionInConversation.js +3 -0
- package/dist/cjs/api/types/SendTypingResponse.d.ts +5 -0
- package/dist/cjs/api/types/SendTypingResponse.js +3 -0
- package/dist/cjs/api/types/index.d.ts +4 -0
- package/dist/cjs/api/types/index.js +4 -0
- package/dist/cjs/auth/BearerAuthProvider.d.ts +1 -1
- package/dist/cjs/environments.d.ts +2 -2
- package/dist/cjs/environments.js +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +4 -1
- package/dist/esm/Client.mjs +6 -1
- package/dist/esm/api/resources/agentSignup/client/Client.d.mts +50 -0
- package/dist/esm/api/resources/agentSignup/client/Client.mjs +133 -0
- package/dist/esm/api/resources/agentSignup/client/index.d.mts +1 -0
- package/dist/esm/api/resources/agentSignup/client/index.mjs +1 -0
- package/dist/esm/api/resources/agentSignup/client/requests/AgentSignUpRequest.d.mts +10 -0
- package/dist/esm/api/resources/agentSignup/client/requests/AgentSignUpRequest.mjs +2 -0
- package/dist/esm/api/resources/agentSignup/client/requests/AgentVerifyRequest.d.mts +11 -0
- package/dist/esm/api/resources/agentSignup/client/requests/AgentVerifyRequest.mjs +2 -0
- package/dist/esm/api/resources/agentSignup/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/agentSignup/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/agentSignup/index.d.mts +1 -0
- package/dist/esm/api/resources/agentSignup/index.mjs +1 -0
- package/dist/esm/api/resources/agentWebhooks/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/agentWebhooks/client/Client.mjs +6 -6
- package/dist/esm/api/resources/agents/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/agents/client/Client.mjs +11 -11
- package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +41 -2
- package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.mjs +29 -1
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +41 -2
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +29 -1
- package/dist/esm/api/resources/agents/client/requests/index.d.mts +2 -2
- package/dist/esm/api/resources/agents/client/requests/index.mjs +2 -1
- package/dist/esm/api/resources/calls/client/Client.d.mts +27 -1
- package/dist/esm/api/resources/calls/client/Client.mjs +69 -8
- package/dist/esm/api/resources/calls/client/requests/CreateOutboundCallRequest.d.mts +2 -0
- package/dist/esm/api/resources/calls/client/requests/CreateWebCallRequest.d.mts +2 -0
- package/dist/esm/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.d.mts +9 -0
- package/dist/esm/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.mjs +2 -0
- package/dist/esm/api/resources/calls/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/contacts/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/contacts/client/Client.mjs +6 -6
- package/dist/esm/api/resources/conversations/client/Client.d.mts +20 -1
- package/dist/esm/api/resources/conversations/client/Client.mjs +60 -5
- package/dist/esm/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.d.mts +9 -0
- package/dist/esm/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.mjs +2 -0
- package/dist/esm/api/resources/conversations/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/index.mjs +2 -0
- package/dist/esm/api/resources/messages/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/messages/client/Client.mjs +3 -3
- package/dist/esm/api/resources/numbers/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/numbers/client/Client.mjs +5 -5
- package/dist/esm/api/resources/usage/client/Client.d.mts +11 -1
- package/dist/esm/api/resources/usage/client/Client.mjs +44 -4
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/webhooks/client/Client.mjs +8 -8
- package/dist/esm/api/types/AgentResponse.d.mts +41 -2
- package/dist/esm/api/types/AgentResponse.mjs +29 -1
- package/dist/esm/api/types/MessageInConversation.d.mts +2 -0
- package/dist/esm/api/types/NumberUsageItem.d.mts +10 -0
- package/dist/esm/api/types/NumberUsageItem.mjs +2 -0
- package/dist/esm/api/types/NumberUsageResponse.d.mts +4 -0
- package/dist/esm/api/types/NumberUsageResponse.mjs +2 -0
- package/dist/esm/api/types/ReactionInConversation.d.mts +7 -0
- package/dist/esm/api/types/ReactionInConversation.mjs +2 -0
- package/dist/esm/api/types/SendTypingResponse.d.mts +5 -0
- package/dist/esm/api/types/SendTypingResponse.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +4 -0
- package/dist/esm/api/types/index.mjs +4 -0
- package/dist/esm/auth/BearerAuthProvider.d.mts +1 -1
- package/dist/esm/environments.d.mts +2 -2
- package/dist/esm/environments.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +338 -0
|
@@ -23,13 +23,17 @@ export * from "./MessagesListResponse.js";
|
|
|
23
23
|
export * from "./MonthlyUsagePoint.js";
|
|
24
24
|
export * from "./MonthlyUsageResponse.js";
|
|
25
25
|
export * from "./NumberLimits.js";
|
|
26
|
+
export * from "./NumberUsageItem.js";
|
|
27
|
+
export * from "./NumberUsageResponse.js";
|
|
26
28
|
export * from "./PaginatedDeliveriesResponse.js";
|
|
27
29
|
export * from "./PhoneNumberListResponse.js";
|
|
28
30
|
export * from "./PhoneNumberResponse.js";
|
|
29
31
|
export * from "./PlanInfo.js";
|
|
30
32
|
export * from "./PlanLimits.js";
|
|
33
|
+
export * from "./ReactionInConversation.js";
|
|
31
34
|
export * from "./SendMessageResponse.js";
|
|
32
35
|
export * from "./SendReactionResponse.js";
|
|
36
|
+
export * from "./SendTypingResponse.js";
|
|
33
37
|
export * from "./UsageResponse.js";
|
|
34
38
|
export * from "./UsageStats.js";
|
|
35
39
|
export * from "./ValidationError.js";
|
|
@@ -39,13 +39,17 @@ __exportStar(require("./MessagesListResponse.js"), exports);
|
|
|
39
39
|
__exportStar(require("./MonthlyUsagePoint.js"), exports);
|
|
40
40
|
__exportStar(require("./MonthlyUsageResponse.js"), exports);
|
|
41
41
|
__exportStar(require("./NumberLimits.js"), exports);
|
|
42
|
+
__exportStar(require("./NumberUsageItem.js"), exports);
|
|
43
|
+
__exportStar(require("./NumberUsageResponse.js"), exports);
|
|
42
44
|
__exportStar(require("./PaginatedDeliveriesResponse.js"), exports);
|
|
43
45
|
__exportStar(require("./PhoneNumberListResponse.js"), exports);
|
|
44
46
|
__exportStar(require("./PhoneNumberResponse.js"), exports);
|
|
45
47
|
__exportStar(require("./PlanInfo.js"), exports);
|
|
46
48
|
__exportStar(require("./PlanLimits.js"), exports);
|
|
49
|
+
__exportStar(require("./ReactionInConversation.js"), exports);
|
|
47
50
|
__exportStar(require("./SendMessageResponse.js"), exports);
|
|
48
51
|
__exportStar(require("./SendReactionResponse.js"), exports);
|
|
52
|
+
__exportStar(require("./SendTypingResponse.js"), exports);
|
|
49
53
|
__exportStar(require("./UsageResponse.js"), exports);
|
|
50
54
|
__exportStar(require("./UsageStats.js"), exports);
|
|
51
55
|
__exportStar(require("./ValidationError.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.6";
|
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.6",
|
|
10
|
+
"User-Agent": "agentphone/1.0.6",
|
|
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
|
*
|
|
@@ -16,7 +16,7 @@ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCode
|
|
|
16
16
|
import * as errors from "../../../../errors/index.mjs";
|
|
17
17
|
import * as AgentPhone from "../../../index.mjs";
|
|
18
18
|
export class AgentWebhooksClient {
|
|
19
|
-
constructor(options) {
|
|
19
|
+
constructor(options = {}) {
|
|
20
20
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -42,7 +42,7 @@ export class AgentWebhooksClient {
|
|
|
42
42
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
43
43
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
44
44
|
const _response = yield core.fetcher({
|
|
45
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
45
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/agents/${core.url.encodePathParam(agentId)}/webhook`),
|
|
46
46
|
method: "GET",
|
|
47
47
|
headers: _headers,
|
|
48
48
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -98,7 +98,7 @@ export class AgentWebhooksClient {
|
|
|
98
98
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
99
99
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
100
100
|
const _response = yield core.fetcher({
|
|
101
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
101
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/agents/${core.url.encodePathParam(agentId)}/webhook`),
|
|
102
102
|
method: "POST",
|
|
103
103
|
headers: _headers,
|
|
104
104
|
contentType: "application/json",
|
|
@@ -152,7 +152,7 @@ export class AgentWebhooksClient {
|
|
|
152
152
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
153
153
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
154
154
|
const _response = yield core.fetcher({
|
|
155
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
155
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/agents/${core.url.encodePathParam(agentId)}/webhook`),
|
|
156
156
|
method: "DELETE",
|
|
157
157
|
headers: _headers,
|
|
158
158
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -206,7 +206,7 @@ export class AgentWebhooksClient {
|
|
|
206
206
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
207
207
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
208
208
|
const _response = yield core.fetcher({
|
|
209
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
209
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/agents/${core.url.encodePathParam(agentId)}/webhook/deliveries`),
|
|
210
210
|
method: "GET",
|
|
211
211
|
headers: _headers,
|
|
212
212
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -257,7 +257,7 @@ export class AgentWebhooksClient {
|
|
|
257
257
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
258
258
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
259
259
|
const _response = yield core.fetcher({
|
|
260
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
260
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/agents/${core.url.encodePathParam(agentId)}/webhook/test`),
|
|
261
261
|
method: "POST",
|
|
262
262
|
headers: _headers,
|
|
263
263
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -9,7 +9,7 @@ export declare namespace AgentsClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class AgentsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<AgentsClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options?: AgentsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Return available voices from the call provider (Retell).
|
|
15
15
|
*
|
|
@@ -27,7 +27,7 @@ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCode
|
|
|
27
27
|
import * as errors from "../../../../errors/index.mjs";
|
|
28
28
|
import * as AgentPhone from "../../../index.mjs";
|
|
29
29
|
export class AgentsClient {
|
|
30
|
-
constructor(options) {
|
|
30
|
+
constructor(options = {}) {
|
|
31
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -47,7 +47,7 @@ export class AgentsClient {
|
|
|
47
47
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
48
48
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
49
49
|
const _response = yield core.fetcher({
|
|
50
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
50
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v1/agents/voices"),
|
|
51
51
|
method: "GET",
|
|
52
52
|
headers: _headers,
|
|
53
53
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -95,7 +95,7 @@ export class AgentsClient {
|
|
|
95
95
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
96
96
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
97
97
|
const _response = yield core.fetcher({
|
|
98
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
98
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v1/agents"),
|
|
99
99
|
method: "GET",
|
|
100
100
|
headers: _headers,
|
|
101
101
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -151,7 +151,7 @@ export class AgentsClient {
|
|
|
151
151
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
152
152
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
153
153
|
const _response = yield core.fetcher({
|
|
154
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
154
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v1/agents"),
|
|
155
155
|
method: "POST",
|
|
156
156
|
headers: _headers,
|
|
157
157
|
contentType: "application/json",
|
|
@@ -205,7 +205,7 @@ export class AgentsClient {
|
|
|
205
205
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
206
206
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
207
207
|
const _response = yield core.fetcher({
|
|
208
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
208
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/agents/${core.url.encodePathParam(agentId)}`),
|
|
209
209
|
method: "GET",
|
|
210
210
|
headers: _headers,
|
|
211
211
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -259,7 +259,7 @@ export class AgentsClient {
|
|
|
259
259
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
260
260
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
261
261
|
const _response = yield core.fetcher({
|
|
262
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
262
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/agents/${core.url.encodePathParam(agentId)}`),
|
|
263
263
|
method: "DELETE",
|
|
264
264
|
headers: _headers,
|
|
265
265
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -313,7 +313,7 @@ export class AgentsClient {
|
|
|
313
313
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
314
314
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
315
315
|
const _response = yield core.fetcher({
|
|
316
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
316
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/agents/${core.url.encodePathParam(agentId)}`),
|
|
317
317
|
method: "PATCH",
|
|
318
318
|
headers: _headers,
|
|
319
319
|
contentType: "application/json",
|
|
@@ -370,7 +370,7 @@ export class AgentsClient {
|
|
|
370
370
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
371
371
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
372
372
|
const _response = yield core.fetcher({
|
|
373
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
373
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/agents/${core.url.encodePathParam(agentId)}/numbers`),
|
|
374
374
|
method: "POST",
|
|
375
375
|
headers: _headers,
|
|
376
376
|
contentType: "application/json",
|
|
@@ -427,7 +427,7 @@ export class AgentsClient {
|
|
|
427
427
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
428
428
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
429
429
|
const _response = yield core.fetcher({
|
|
430
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
430
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/agents/${core.url.encodePathParam(agentId)}/numbers/${core.url.encodePathParam(numberId)}`),
|
|
431
431
|
method: "DELETE",
|
|
432
432
|
headers: _headers,
|
|
433
433
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -482,7 +482,7 @@ export class AgentsClient {
|
|
|
482
482
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
483
483
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
484
484
|
const _response = yield core.fetcher({
|
|
485
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
485
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/agents/${core.url.encodePathParam(agentId)}/conversations`),
|
|
486
486
|
method: "GET",
|
|
487
487
|
headers: _headers,
|
|
488
488
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -540,7 +540,7 @@ export class AgentsClient {
|
|
|
540
540
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
541
541
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
542
542
|
const _response = yield core.fetcher({
|
|
543
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
543
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/agents/${core.url.encodePathParam(agentId)}/calls`),
|
|
544
544
|
method: "GET",
|
|
545
545
|
headers: _headers,
|
|
546
546
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -7,11 +7,50 @@
|
|
|
7
7
|
export interface CreateAgentRequest {
|
|
8
8
|
name: string;
|
|
9
9
|
description?: string | null;
|
|
10
|
-
voiceMode?:
|
|
11
|
-
modelTier?:
|
|
10
|
+
voiceMode?: CreateAgentRequest.VoiceMode;
|
|
11
|
+
modelTier?: CreateAgentRequest.ModelTier;
|
|
12
12
|
systemPrompt?: string | null;
|
|
13
13
|
beginMessage?: string | null;
|
|
14
14
|
voice?: string | null;
|
|
15
15
|
transferNumber?: string | null;
|
|
16
16
|
voicemailMessage?: string | null;
|
|
17
|
+
/** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
|
|
18
|
+
sttMode?: CreateAgentRequest.SttMode;
|
|
19
|
+
/** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
|
|
20
|
+
ambientSound?: CreateAgentRequest.AmbientSound;
|
|
21
|
+
/** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
|
|
22
|
+
denoisingMode?: CreateAgentRequest.DenoisingMode;
|
|
23
|
+
}
|
|
24
|
+
export declare namespace CreateAgentRequest {
|
|
25
|
+
const VoiceMode: {
|
|
26
|
+
readonly Webhook: "webhook";
|
|
27
|
+
readonly Hosted: "hosted";
|
|
28
|
+
};
|
|
29
|
+
type VoiceMode = (typeof VoiceMode)[keyof typeof VoiceMode];
|
|
30
|
+
const ModelTier: {
|
|
31
|
+
readonly Turbo: "turbo";
|
|
32
|
+
readonly Balanced: "balanced";
|
|
33
|
+
readonly Max: "max";
|
|
34
|
+
};
|
|
35
|
+
type ModelTier = (typeof ModelTier)[keyof typeof ModelTier];
|
|
36
|
+
/** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
|
|
37
|
+
const SttMode: {
|
|
38
|
+
readonly Fast: "fast";
|
|
39
|
+
readonly Accurate: "accurate";
|
|
40
|
+
};
|
|
41
|
+
type SttMode = (typeof SttMode)[keyof typeof SttMode];
|
|
42
|
+
/** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
|
|
43
|
+
const AmbientSound: {
|
|
44
|
+
readonly None: "none";
|
|
45
|
+
readonly Office: "office";
|
|
46
|
+
readonly CoffeeShop: "coffee-shop";
|
|
47
|
+
readonly Outdoor: "outdoor";
|
|
48
|
+
};
|
|
49
|
+
type AmbientSound = (typeof AmbientSound)[keyof typeof AmbientSound];
|
|
50
|
+
/** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
|
|
51
|
+
const DenoisingMode: {
|
|
52
|
+
readonly NoiseCancellation: "noise-cancellation";
|
|
53
|
+
readonly NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation";
|
|
54
|
+
};
|
|
55
|
+
type DenoisingMode = (typeof DenoisingMode)[keyof typeof DenoisingMode];
|
|
17
56
|
}
|