agentphone 1.0.2 → 1.0.4
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/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +6 -0
- package/dist/cjs/Client.js +18 -8
- package/dist/cjs/api/resources/agentWebhooks/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/agentWebhooks/client/Client.js +1 -1
- package/dist/cjs/api/resources/agents/client/Client.d.ts +30 -2
- package/dist/cjs/api/resources/agents/client/Client.js +96 -2
- package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +2 -0
- package/dist/cjs/api/resources/agents/client/requests/DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest.d.ts +11 -0
- package/dist/cjs/api/resources/agents/client/requests/DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest.js +3 -0
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +2 -0
- package/dist/cjs/api/resources/agents/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/calls/client/Client.d.ts +27 -3
- package/dist/cjs/api/resources/calls/client/Client.js +68 -4
- package/dist/cjs/api/resources/calls/client/requests/CreateOutboundCallRequest.d.ts +2 -2
- package/dist/cjs/api/resources/calls/client/requests/ListCallsV1CallsGetRequest.d.ts +8 -0
- package/dist/cjs/api/resources/calls/client/requests/StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest.d.ts +9 -0
- package/dist/cjs/api/resources/calls/client/requests/StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest.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 +94 -0
- package/dist/cjs/api/resources/contacts/client/Client.js +341 -0
- package/dist/cjs/api/resources/contacts/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/contacts/client/index.js +17 -0
- package/dist/cjs/api/resources/contacts/client/requests/CreateContactRequest.d.ts +13 -0
- package/dist/cjs/api/resources/contacts/client/requests/CreateContactRequest.js +3 -0
- package/dist/cjs/api/resources/contacts/client/requests/DeleteContactV1ContactsContactIdDeleteRequest.d.ts +9 -0
- package/dist/cjs/api/resources/contacts/client/requests/DeleteContactV1ContactsContactIdDeleteRequest.js +3 -0
- package/dist/cjs/api/resources/contacts/client/requests/GetContactV1ContactsContactIdGetRequest.d.ts +9 -0
- package/dist/cjs/api/resources/contacts/client/requests/GetContactV1ContactsContactIdGetRequest.js +3 -0
- package/dist/cjs/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.d.ts +9 -0
- package/dist/cjs/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.js +3 -0
- package/dist/cjs/api/resources/contacts/client/requests/UpdateContactRequest.d.ts +13 -0
- package/dist/cjs/api/resources/contacts/client/requests/UpdateContactRequest.js +3 -0
- package/dist/cjs/api/resources/contacts/client/requests/index.d.ts +5 -0
- package/dist/cjs/api/resources/contacts/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/contacts/index.d.ts +1 -0
- package/dist/cjs/api/resources/contacts/index.js +17 -0
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/conversations/client/Client.js +1 -1
- package/dist/cjs/api/resources/index.d.ts +4 -0
- package/dist/cjs/api/resources/index.js +5 -1
- package/dist/cjs/api/resources/messages/client/Client.d.ts +49 -0
- package/dist/cjs/api/resources/messages/client/Client.js +183 -0
- package/dist/cjs/api/resources/messages/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/messages/client/index.js +17 -0
- package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.d.ts +15 -0
- package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.js +3 -0
- package/dist/cjs/api/resources/messages/client/requests/SendReactionRequest.d.ts +11 -0
- package/dist/cjs/api/resources/messages/client/requests/SendReactionRequest.js +3 -0
- package/dist/cjs/api/resources/messages/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/messages/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/messages/index.d.ts +1 -0
- package/dist/cjs/api/resources/messages/index.js +17 -0
- package/dist/cjs/api/resources/numbers/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/numbers/client/Client.js +1 -1
- package/dist/cjs/api/resources/usage/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/usage/client/Client.js +1 -1
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +6 -6
- package/dist/cjs/api/resources/webhooks/client/Client.js +6 -6
- package/dist/cjs/api/types/AgentNumberResponse.d.ts +1 -0
- package/dist/cjs/api/types/AgentResponse.d.ts +2 -0
- package/dist/cjs/api/types/CallSummary.d.ts +1 -1
- package/dist/cjs/api/types/ContactListResponse.d.ts +6 -0
- package/dist/cjs/api/types/ContactListResponse.js +3 -0
- package/dist/cjs/api/types/ContactResponse.d.ts +9 -0
- package/dist/cjs/api/types/ContactResponse.js +3 -0
- package/dist/cjs/api/types/MessageInConversation.d.ts +2 -0
- package/dist/cjs/api/types/MessageResponse.d.ts +2 -0
- package/dist/cjs/api/types/PhoneNumberResponse.d.ts +1 -0
- package/dist/cjs/api/types/SendMessageResponse.d.ts +7 -0
- package/dist/cjs/api/types/SendMessageResponse.js +3 -0
- package/dist/cjs/api/types/SendReactionResponse.d.ts +6 -0
- package/dist/cjs/api/types/SendReactionResponse.js +3 -0
- package/dist/cjs/api/types/WebhookCreateRequest.d.ts +1 -0
- package/dist/cjs/api/types/WebhookResponse.d.ts +1 -0
- package/dist/cjs/api/types/index.d.ts +4 -0
- package/dist/cjs/api/types/index.js +4 -0
- 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 +6 -0
- package/dist/esm/Client.mjs +10 -0
- package/dist/esm/api/resources/agentWebhooks/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/agentWebhooks/client/Client.mjs +1 -1
- package/dist/esm/api/resources/agents/client/Client.d.mts +30 -2
- package/dist/esm/api/resources/agents/client/Client.mjs +96 -2
- package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +2 -0
- package/dist/esm/api/resources/agents/client/requests/DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest.d.mts +11 -0
- package/dist/esm/api/resources/agents/client/requests/DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest.mjs +2 -0
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +2 -0
- package/dist/esm/api/resources/agents/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/calls/client/Client.d.mts +27 -3
- package/dist/esm/api/resources/calls/client/Client.mjs +68 -4
- package/dist/esm/api/resources/calls/client/requests/CreateOutboundCallRequest.d.mts +2 -2
- package/dist/esm/api/resources/calls/client/requests/ListCallsV1CallsGetRequest.d.mts +8 -0
- package/dist/esm/api/resources/calls/client/requests/StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest.d.mts +9 -0
- package/dist/esm/api/resources/calls/client/requests/StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest.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 +94 -0
- package/dist/esm/api/resources/contacts/client/Client.mjs +304 -0
- package/dist/esm/api/resources/contacts/client/index.d.mts +1 -0
- package/dist/esm/api/resources/contacts/client/index.mjs +1 -0
- package/dist/esm/api/resources/contacts/client/requests/CreateContactRequest.d.mts +13 -0
- package/dist/esm/api/resources/contacts/client/requests/CreateContactRequest.mjs +2 -0
- package/dist/esm/api/resources/contacts/client/requests/DeleteContactV1ContactsContactIdDeleteRequest.d.mts +9 -0
- package/dist/esm/api/resources/contacts/client/requests/DeleteContactV1ContactsContactIdDeleteRequest.mjs +2 -0
- package/dist/esm/api/resources/contacts/client/requests/GetContactV1ContactsContactIdGetRequest.d.mts +9 -0
- package/dist/esm/api/resources/contacts/client/requests/GetContactV1ContactsContactIdGetRequest.mjs +2 -0
- package/dist/esm/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.d.mts +9 -0
- package/dist/esm/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.mjs +2 -0
- package/dist/esm/api/resources/contacts/client/requests/UpdateContactRequest.d.mts +13 -0
- package/dist/esm/api/resources/contacts/client/requests/UpdateContactRequest.mjs +2 -0
- package/dist/esm/api/resources/contacts/client/requests/index.d.mts +5 -0
- package/dist/esm/api/resources/contacts/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/contacts/index.d.mts +1 -0
- package/dist/esm/api/resources/contacts/index.mjs +1 -0
- package/dist/esm/api/resources/conversations/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/conversations/client/Client.mjs +1 -1
- package/dist/esm/api/resources/index.d.mts +4 -0
- package/dist/esm/api/resources/index.mjs +4 -0
- package/dist/esm/api/resources/messages/client/Client.d.mts +49 -0
- package/dist/esm/api/resources/messages/client/Client.mjs +146 -0
- package/dist/esm/api/resources/messages/client/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/client/index.mjs +1 -0
- package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.d.mts +15 -0
- package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.mjs +2 -0
- package/dist/esm/api/resources/messages/client/requests/SendReactionRequest.d.mts +11 -0
- package/dist/esm/api/resources/messages/client/requests/SendReactionRequest.mjs +2 -0
- package/dist/esm/api/resources/messages/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/messages/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/messages/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/index.mjs +1 -0
- package/dist/esm/api/resources/numbers/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/numbers/client/Client.mjs +1 -1
- package/dist/esm/api/resources/usage/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/usage/client/Client.mjs +1 -1
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +6 -6
- package/dist/esm/api/resources/webhooks/client/Client.mjs +6 -6
- package/dist/esm/api/types/AgentNumberResponse.d.mts +1 -0
- package/dist/esm/api/types/AgentResponse.d.mts +2 -0
- package/dist/esm/api/types/CallSummary.d.mts +1 -1
- package/dist/esm/api/types/ContactListResponse.d.mts +6 -0
- package/dist/esm/api/types/ContactListResponse.mjs +2 -0
- package/dist/esm/api/types/ContactResponse.d.mts +9 -0
- package/dist/esm/api/types/ContactResponse.mjs +2 -0
- package/dist/esm/api/types/MessageInConversation.d.mts +2 -0
- package/dist/esm/api/types/MessageResponse.d.mts +2 -0
- package/dist/esm/api/types/PhoneNumberResponse.d.mts +1 -0
- package/dist/esm/api/types/SendMessageResponse.d.mts +7 -0
- package/dist/esm/api/types/SendMessageResponse.mjs +2 -0
- package/dist/esm/api/types/SendReactionResponse.d.mts +6 -0
- package/dist/esm/api/types/SendReactionResponse.mjs +2 -0
- package/dist/esm/api/types/WebhookCreateRequest.d.mts +1 -0
- package/dist/esm/api/types/WebhookResponse.d.mts +1 -0
- package/dist/esm/api/types/index.d.mts +4 -0
- package/dist/esm/api/types/index.mjs +4 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +780 -114
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.4",
|
|
10
|
+
"User-Agent": "agentphone/1.0.4",
|
|
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,7 +1,9 @@
|
|
|
1
1
|
import { AgentsClient } from "./api/resources/agents/client/Client.mjs";
|
|
2
2
|
import { AgentWebhooksClient } from "./api/resources/agentWebhooks/client/Client.mjs";
|
|
3
3
|
import { CallsClient } from "./api/resources/calls/client/Client.mjs";
|
|
4
|
+
import { ContactsClient } from "./api/resources/contacts/client/Client.mjs";
|
|
4
5
|
import { ConversationsClient } from "./api/resources/conversations/client/Client.mjs";
|
|
6
|
+
import { MessagesClient } from "./api/resources/messages/client/Client.mjs";
|
|
5
7
|
import { NumbersClient } from "./api/resources/numbers/client/Client.mjs";
|
|
6
8
|
import { UsageClient } from "./api/resources/usage/client/Client.mjs";
|
|
7
9
|
import { WebhooksClient } from "./api/resources/webhooks/client/Client.mjs";
|
|
@@ -18,15 +20,19 @@ export declare class AgentPhoneClient {
|
|
|
18
20
|
protected _numbers: NumbersClient | undefined;
|
|
19
21
|
protected _webhooks: WebhooksClient | undefined;
|
|
20
22
|
protected _agentWebhooks: AgentWebhooksClient | undefined;
|
|
23
|
+
protected _contacts: ContactsClient | undefined;
|
|
21
24
|
protected _conversations: ConversationsClient | undefined;
|
|
22
25
|
protected _calls: CallsClient | undefined;
|
|
23
26
|
protected _usage: UsageClient | undefined;
|
|
27
|
+
protected _messages: MessagesClient | undefined;
|
|
24
28
|
constructor(options: AgentPhoneClient.Options);
|
|
25
29
|
get agents(): AgentsClient;
|
|
26
30
|
get numbers(): NumbersClient;
|
|
27
31
|
get webhooks(): WebhooksClient;
|
|
28
32
|
get agentWebhooks(): AgentWebhooksClient;
|
|
33
|
+
get contacts(): ContactsClient;
|
|
29
34
|
get conversations(): ConversationsClient;
|
|
30
35
|
get calls(): CallsClient;
|
|
31
36
|
get usage(): UsageClient;
|
|
37
|
+
get messages(): MessagesClient;
|
|
32
38
|
}
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import { AgentsClient } from "./api/resources/agents/client/Client.mjs";
|
|
3
3
|
import { AgentWebhooksClient } from "./api/resources/agentWebhooks/client/Client.mjs";
|
|
4
4
|
import { CallsClient } from "./api/resources/calls/client/Client.mjs";
|
|
5
|
+
import { ContactsClient } from "./api/resources/contacts/client/Client.mjs";
|
|
5
6
|
import { ConversationsClient } from "./api/resources/conversations/client/Client.mjs";
|
|
7
|
+
import { MessagesClient } from "./api/resources/messages/client/Client.mjs";
|
|
6
8
|
import { NumbersClient } from "./api/resources/numbers/client/Client.mjs";
|
|
7
9
|
import { UsageClient } from "./api/resources/usage/client/Client.mjs";
|
|
8
10
|
import { WebhooksClient } from "./api/resources/webhooks/client/Client.mjs";
|
|
@@ -27,6 +29,10 @@ export class AgentPhoneClient {
|
|
|
27
29
|
var _a;
|
|
28
30
|
return ((_a = this._agentWebhooks) !== null && _a !== void 0 ? _a : (this._agentWebhooks = new AgentWebhooksClient(this._options)));
|
|
29
31
|
}
|
|
32
|
+
get contacts() {
|
|
33
|
+
var _a;
|
|
34
|
+
return ((_a = this._contacts) !== null && _a !== void 0 ? _a : (this._contacts = new ContactsClient(this._options)));
|
|
35
|
+
}
|
|
30
36
|
get conversations() {
|
|
31
37
|
var _a;
|
|
32
38
|
return ((_a = this._conversations) !== null && _a !== void 0 ? _a : (this._conversations = new ConversationsClient(this._options)));
|
|
@@ -39,4 +45,8 @@ export class AgentPhoneClient {
|
|
|
39
45
|
var _a;
|
|
40
46
|
return ((_a = this._usage) !== null && _a !== void 0 ? _a : (this._usage = new UsageClient(this._options)));
|
|
41
47
|
}
|
|
48
|
+
get messages() {
|
|
49
|
+
var _a;
|
|
50
|
+
return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new MessagesClient(this._options)));
|
|
51
|
+
}
|
|
42
52
|
}
|
|
@@ -28,7 +28,7 @@ export declare class AgentWebhooksClient {
|
|
|
28
28
|
/**
|
|
29
29
|
* Register or update a webhook URL for a specific agent.
|
|
30
30
|
*
|
|
31
|
-
* When set, this agent's events are delivered here instead of the
|
|
31
|
+
* When set, this agent's events are delivered here instead of the account default webhook.
|
|
32
32
|
*
|
|
33
33
|
* @param {AgentPhone.CreateOrUpdateAgentWebhookV1AgentsAgentIdWebhookPostRequest} request
|
|
34
34
|
* @param {AgentWebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -73,7 +73,7 @@ export class AgentWebhooksClient {
|
|
|
73
73
|
/**
|
|
74
74
|
* Register or update a webhook URL for a specific agent.
|
|
75
75
|
*
|
|
76
|
-
* When set, this agent's events are delivered here instead of the
|
|
76
|
+
* When set, this agent's events are delivered here instead of the account default webhook.
|
|
77
77
|
*
|
|
78
78
|
* @param {AgentPhone.CreateOrUpdateAgentWebhookV1AgentsAgentIdWebhookPostRequest} request
|
|
79
79
|
* @param {AgentWebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -11,7 +11,17 @@ export declare class AgentsClient {
|
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<AgentsClient.Options>;
|
|
12
12
|
constructor(options: AgentsClient.Options);
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Return available voices from the call provider (Retell).
|
|
15
|
+
*
|
|
16
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* await client.agents.listVoices()
|
|
20
|
+
*/
|
|
21
|
+
listVoices(requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
22
|
+
private __listVoices;
|
|
23
|
+
/**
|
|
24
|
+
* List all agents for this account.
|
|
15
25
|
*
|
|
16
26
|
* @param {AgentPhone.ListAgentsV1AgentsGetRequest} request
|
|
17
27
|
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -98,7 +108,7 @@ export declare class AgentsClient {
|
|
|
98
108
|
/**
|
|
99
109
|
* Attach an existing phone number to an agent.
|
|
100
110
|
*
|
|
101
|
-
* The number must belong to the same
|
|
111
|
+
* The number must belong to the same account and not be released.
|
|
102
112
|
*
|
|
103
113
|
* @param {AgentPhone.AttachNumberRequest} request
|
|
104
114
|
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -113,6 +123,24 @@ export declare class AgentsClient {
|
|
|
113
123
|
*/
|
|
114
124
|
attachNumberToAgent(request: AgentPhone.AttachNumberRequest, requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.AttachNumberResponse>;
|
|
115
125
|
private __attachNumberToAgent;
|
|
126
|
+
/**
|
|
127
|
+
* Detach a phone number from an agent (sets agentId to null).
|
|
128
|
+
*
|
|
129
|
+
* The number remains active and can be re-attached to any agent.
|
|
130
|
+
*
|
|
131
|
+
* @param {AgentPhone.DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest} request
|
|
132
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
133
|
+
*
|
|
134
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* await client.agents.detachNumberFromAgent({
|
|
138
|
+
* agent_id: "agent_id",
|
|
139
|
+
* number_id: "number_id"
|
|
140
|
+
* })
|
|
141
|
+
*/
|
|
142
|
+
detachNumberFromAgent(request: AgentPhone.DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest, requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
143
|
+
private __detachNumberFromAgent;
|
|
116
144
|
/**
|
|
117
145
|
* List all conversations for an agent.
|
|
118
146
|
*
|
|
@@ -31,7 +31,47 @@ export class AgentsClient {
|
|
|
31
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* Return available voices from the call provider (Retell).
|
|
35
|
+
*
|
|
36
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* await client.agents.listVoices()
|
|
40
|
+
*/
|
|
41
|
+
listVoices(requestOptions) {
|
|
42
|
+
return core.HttpResponsePromise.fromPromise(this.__listVoices(requestOptions));
|
|
43
|
+
}
|
|
44
|
+
__listVoices(requestOptions) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
47
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
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
|
+
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.Default, "v1/agents/voices"),
|
|
51
|
+
method: "GET",
|
|
52
|
+
headers: _headers,
|
|
53
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
54
|
+
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,
|
|
55
|
+
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,
|
|
56
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
57
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
58
|
+
logging: this._options.logging,
|
|
59
|
+
});
|
|
60
|
+
if (_response.ok) {
|
|
61
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
62
|
+
}
|
|
63
|
+
if (_response.error.reason === "status-code") {
|
|
64
|
+
throw new errors.AgentPhoneError({
|
|
65
|
+
statusCode: _response.error.statusCode,
|
|
66
|
+
body: _response.error.body,
|
|
67
|
+
rawResponse: _response.rawResponse,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/agents/voices");
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* List all agents for this account.
|
|
35
75
|
*
|
|
36
76
|
* @param {AgentPhone.ListAgentsV1AgentsGetRequest} request
|
|
37
77
|
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -307,7 +347,7 @@ export class AgentsClient {
|
|
|
307
347
|
/**
|
|
308
348
|
* Attach an existing phone number to an agent.
|
|
309
349
|
*
|
|
310
|
-
* The number must belong to the same
|
|
350
|
+
* The number must belong to the same account and not be released.
|
|
311
351
|
*
|
|
312
352
|
* @param {AgentPhone.AttachNumberRequest} request
|
|
313
353
|
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -361,6 +401,60 @@ export class AgentsClient {
|
|
|
361
401
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/agents/{agent_id}/numbers");
|
|
362
402
|
});
|
|
363
403
|
}
|
|
404
|
+
/**
|
|
405
|
+
* Detach a phone number from an agent (sets agentId to null).
|
|
406
|
+
*
|
|
407
|
+
* The number remains active and can be re-attached to any agent.
|
|
408
|
+
*
|
|
409
|
+
* @param {AgentPhone.DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest} request
|
|
410
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
411
|
+
*
|
|
412
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
413
|
+
*
|
|
414
|
+
* @example
|
|
415
|
+
* await client.agents.detachNumberFromAgent({
|
|
416
|
+
* agent_id: "agent_id",
|
|
417
|
+
* number_id: "number_id"
|
|
418
|
+
* })
|
|
419
|
+
*/
|
|
420
|
+
detachNumberFromAgent(request, requestOptions) {
|
|
421
|
+
return core.HttpResponsePromise.fromPromise(this.__detachNumberFromAgent(request, requestOptions));
|
|
422
|
+
}
|
|
423
|
+
__detachNumberFromAgent(request, requestOptions) {
|
|
424
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
425
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
426
|
+
const { agent_id: agentId, number_id: numberId } = request;
|
|
427
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
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
|
+
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.Default, `v1/agents/${core.url.encodePathParam(agentId)}/numbers/${core.url.encodePathParam(numberId)}`),
|
|
431
|
+
method: "DELETE",
|
|
432
|
+
headers: _headers,
|
|
433
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
434
|
+
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,
|
|
435
|
+
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,
|
|
436
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
437
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
438
|
+
logging: this._options.logging,
|
|
439
|
+
});
|
|
440
|
+
if (_response.ok) {
|
|
441
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
442
|
+
}
|
|
443
|
+
if (_response.error.reason === "status-code") {
|
|
444
|
+
switch (_response.error.statusCode) {
|
|
445
|
+
case 422:
|
|
446
|
+
throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
447
|
+
default:
|
|
448
|
+
throw new errors.AgentPhoneError({
|
|
449
|
+
statusCode: _response.error.statusCode,
|
|
450
|
+
body: _response.error.body,
|
|
451
|
+
rawResponse: _response.rawResponse,
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/agents/{agent_id}/numbers/{number_id}");
|
|
456
|
+
});
|
|
457
|
+
}
|
|
364
458
|
/**
|
|
365
459
|
* List all conversations for an agent.
|
|
366
460
|
*
|
|
@@ -8,8 +8,10 @@ export interface CreateAgentRequest {
|
|
|
8
8
|
name: string;
|
|
9
9
|
description?: string | null;
|
|
10
10
|
voiceMode?: string | null;
|
|
11
|
+
modelTier?: string | null;
|
|
11
12
|
systemPrompt?: string | null;
|
|
12
13
|
beginMessage?: string | null;
|
|
13
14
|
voice?: string | null;
|
|
14
15
|
transferNumber?: string | null;
|
|
16
|
+
voicemailMessage?: string | null;
|
|
15
17
|
}
|
|
@@ -9,8 +9,10 @@ export interface UpdateAgentRequest {
|
|
|
9
9
|
name?: string | null;
|
|
10
10
|
description?: string | null;
|
|
11
11
|
voiceMode?: string | null;
|
|
12
|
+
modelTier?: string | null;
|
|
12
13
|
systemPrompt?: string | null;
|
|
13
14
|
beginMessage?: string | null;
|
|
14
15
|
voice?: string | null;
|
|
15
16
|
transferNumber?: string | null;
|
|
17
|
+
voicemailMessage?: string | null;
|
|
16
18
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type { AttachNumberRequest } from "./AttachNumberRequest.mjs";
|
|
2
2
|
export type { CreateAgentRequest } from "./CreateAgentRequest.mjs";
|
|
3
3
|
export type { DeleteAgentV1AgentsAgentIdDeleteRequest } from "./DeleteAgentV1AgentsAgentIdDeleteRequest.mjs";
|
|
4
|
+
export type { DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest } from "./DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest.mjs";
|
|
4
5
|
export type { GetAgentV1AgentsAgentIdGetRequest } from "./GetAgentV1AgentsAgentIdGetRequest.mjs";
|
|
5
6
|
export type { ListAgentCallsV1AgentsAgentIdCallsGetRequest } from "./ListAgentCallsV1AgentsAgentIdCallsGetRequest.mjs";
|
|
6
7
|
export type { ListAgentConversationsV1AgentsAgentIdConversationsGetRequest } from "./ListAgentConversationsV1AgentsAgentIdConversationsGetRequest.mjs";
|
|
@@ -11,7 +11,7 @@ export declare class CallsClient {
|
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<CallsClient.Options>;
|
|
12
12
|
constructor(options: CallsClient.Options);
|
|
13
13
|
/**
|
|
14
|
-
* List all calls for this
|
|
14
|
+
* List all calls for this account.
|
|
15
15
|
*
|
|
16
16
|
* @param {AgentPhone.ListCallsV1CallsGetRequest} request
|
|
17
17
|
* @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -31,7 +31,7 @@ export declare class CallsClient {
|
|
|
31
31
|
* to use as caller ID; if omitted, the first assigned number is used.
|
|
32
32
|
*
|
|
33
33
|
* Flow:
|
|
34
|
-
* 1. Validates the agent belongs to your
|
|
34
|
+
* 1. Validates the agent belongs to your account and has a phone number
|
|
35
35
|
* 2. Initiates a call from the agent's number to the destination
|
|
36
36
|
* 3. When recipient answers, speaks the initial greeting (if provided)
|
|
37
37
|
* 4. Listens for recipient's speech and sends to your webhook
|
|
@@ -58,7 +58,7 @@ export declare class CallsClient {
|
|
|
58
58
|
* expires 30 seconds after creation.
|
|
59
59
|
*
|
|
60
60
|
* Flow:
|
|
61
|
-
* 1. Validates the agent belongs to your
|
|
61
|
+
* 1. Validates the agent belongs to your account
|
|
62
62
|
* 2. Creates a web call and returns an access token
|
|
63
63
|
* 3. Your client calls `webClient.startCall({ accessToken })` to connect
|
|
64
64
|
* 4. Call lifecycle (transcripts, webhooks) works the same as phone calls
|
|
@@ -109,6 +109,30 @@ export declare class CallsClient {
|
|
|
109
109
|
*/
|
|
110
110
|
getCallTranscript(request: AgentPhone.GetCallTranscriptV1CallsCallIdTranscriptGetRequest, requestOptions?: CallsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
111
111
|
private __getCallTranscript;
|
|
112
|
+
/**
|
|
113
|
+
* Stream a call's transcript via Server-Sent Events.
|
|
114
|
+
*
|
|
115
|
+
* On connect the server replays all existing transcript turns from the
|
|
116
|
+
* database, then streams new turns in real time as they arrive from the
|
|
117
|
+
* voice provider. A ``: heartbeat`` comment is sent every 15 s to keep
|
|
118
|
+
* proxies alive. The stream closes after sending an ``ended`` event
|
|
119
|
+
* when the call completes (or immediately after replay if the call has
|
|
120
|
+
* already ended).
|
|
121
|
+
*
|
|
122
|
+
* Works for both live and completed calls — same URL either way.
|
|
123
|
+
*
|
|
124
|
+
* @param {AgentPhone.StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest} request
|
|
125
|
+
* @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
126
|
+
*
|
|
127
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* await client.calls.streamCallTranscript({
|
|
131
|
+
* call_id: "call_id"
|
|
132
|
+
* })
|
|
133
|
+
*/
|
|
134
|
+
streamCallTranscript(request: AgentPhone.StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest, requestOptions?: CallsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
135
|
+
private __streamCallTranscript;
|
|
112
136
|
/**
|
|
113
137
|
* List all calls for a specific phone number.
|
|
114
138
|
*
|
|
@@ -20,7 +20,7 @@ export class CallsClient {
|
|
|
20
20
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* List all calls for this
|
|
23
|
+
* List all calls for this account.
|
|
24
24
|
*
|
|
25
25
|
* @param {AgentPhone.ListCallsV1CallsGetRequest} request
|
|
26
26
|
* @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -36,10 +36,14 @@ export class CallsClient {
|
|
|
36
36
|
__listCalls() {
|
|
37
37
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
38
38
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
39
|
-
const { limit, offset } = request;
|
|
39
|
+
const { limit, offset, status, direction, type: type_, search } = request;
|
|
40
40
|
const _queryParams = {
|
|
41
41
|
limit,
|
|
42
42
|
offset,
|
|
43
|
+
status,
|
|
44
|
+
direction,
|
|
45
|
+
type: type_,
|
|
46
|
+
search,
|
|
43
47
|
};
|
|
44
48
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
45
49
|
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);
|
|
@@ -80,7 +84,7 @@ export class CallsClient {
|
|
|
80
84
|
* to use as caller ID; if omitted, the first assigned number is used.
|
|
81
85
|
*
|
|
82
86
|
* Flow:
|
|
83
|
-
* 1. Validates the agent belongs to your
|
|
87
|
+
* 1. Validates the agent belongs to your account and has a phone number
|
|
84
88
|
* 2. Initiates a call from the agent's number to the destination
|
|
85
89
|
* 3. When recipient answers, speaks the initial greeting (if provided)
|
|
86
90
|
* 4. Listens for recipient's speech and sends to your webhook
|
|
@@ -145,7 +149,7 @@ export class CallsClient {
|
|
|
145
149
|
* expires 30 seconds after creation.
|
|
146
150
|
*
|
|
147
151
|
* Flow:
|
|
148
|
-
* 1. Validates the agent belongs to your
|
|
152
|
+
* 1. Validates the agent belongs to your account
|
|
149
153
|
* 2. Creates a web call and returns an access token
|
|
150
154
|
* 3. Your client calls `webClient.startCall({ accessToken })` to connect
|
|
151
155
|
* 4. Call lifecycle (transcripts, webhooks) works the same as phone calls
|
|
@@ -306,6 +310,66 @@ export class CallsClient {
|
|
|
306
310
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/calls/{call_id}/transcript");
|
|
307
311
|
});
|
|
308
312
|
}
|
|
313
|
+
/**
|
|
314
|
+
* Stream a call's transcript via Server-Sent Events.
|
|
315
|
+
*
|
|
316
|
+
* On connect the server replays all existing transcript turns from the
|
|
317
|
+
* database, then streams new turns in real time as they arrive from the
|
|
318
|
+
* voice provider. A ``: heartbeat`` comment is sent every 15 s to keep
|
|
319
|
+
* proxies alive. The stream closes after sending an ``ended`` event
|
|
320
|
+
* when the call completes (or immediately after replay if the call has
|
|
321
|
+
* already ended).
|
|
322
|
+
*
|
|
323
|
+
* Works for both live and completed calls — same URL either way.
|
|
324
|
+
*
|
|
325
|
+
* @param {AgentPhone.StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest} request
|
|
326
|
+
* @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
327
|
+
*
|
|
328
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
329
|
+
*
|
|
330
|
+
* @example
|
|
331
|
+
* await client.calls.streamCallTranscript({
|
|
332
|
+
* call_id: "call_id"
|
|
333
|
+
* })
|
|
334
|
+
*/
|
|
335
|
+
streamCallTranscript(request, requestOptions) {
|
|
336
|
+
return core.HttpResponsePromise.fromPromise(this.__streamCallTranscript(request, requestOptions));
|
|
337
|
+
}
|
|
338
|
+
__streamCallTranscript(request, requestOptions) {
|
|
339
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
340
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
341
|
+
const { call_id: callId } = request;
|
|
342
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
343
|
+
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);
|
|
344
|
+
const _response = yield core.fetcher({
|
|
345
|
+
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.Default, `v1/calls/${core.url.encodePathParam(callId)}/transcript/stream`),
|
|
346
|
+
method: "GET",
|
|
347
|
+
headers: _headers,
|
|
348
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
349
|
+
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,
|
|
350
|
+
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,
|
|
351
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
352
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
353
|
+
logging: this._options.logging,
|
|
354
|
+
});
|
|
355
|
+
if (_response.ok) {
|
|
356
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
357
|
+
}
|
|
358
|
+
if (_response.error.reason === "status-code") {
|
|
359
|
+
switch (_response.error.statusCode) {
|
|
360
|
+
case 422:
|
|
361
|
+
throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
362
|
+
default:
|
|
363
|
+
throw new errors.AgentPhoneError({
|
|
364
|
+
statusCode: _response.error.statusCode,
|
|
365
|
+
body: _response.error.body,
|
|
366
|
+
rawResponse: _response.rawResponse,
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/calls/{call_id}/transcript/stream");
|
|
371
|
+
});
|
|
372
|
+
}
|
|
309
373
|
/**
|
|
310
374
|
* List all calls for a specific phone number.
|
|
311
375
|
*
|
|
@@ -14,8 +14,8 @@ export interface CreateOutboundCallRequest {
|
|
|
14
14
|
fromNumberId?: string | null;
|
|
15
15
|
/** Optional initial greeting to speak when recipient answers */
|
|
16
16
|
initialGreeting?: string | null;
|
|
17
|
-
/** Voice
|
|
18
|
-
voice?: string;
|
|
17
|
+
/** Voice ID override for this call (uses agent's configured voice if omitted) */
|
|
18
|
+
voice?: string | null;
|
|
19
19
|
/** When provided, uses a built-in LLM for the conversation instead of forwarding to a webhook. The prompt defines the AI's personality and conversation topic. */
|
|
20
20
|
systemPrompt?: string | null;
|
|
21
21
|
}
|
|
@@ -5,4 +5,12 @@
|
|
|
5
5
|
export interface ListCallsV1CallsGetRequest {
|
|
6
6
|
limit?: number;
|
|
7
7
|
offset?: number;
|
|
8
|
+
/** Filter by status: completed, in-progress, failed */
|
|
9
|
+
status?: string | null;
|
|
10
|
+
/** Filter by direction: inbound, outbound */
|
|
11
|
+
direction?: string | null;
|
|
12
|
+
/** Filter by type: pstn, web */
|
|
13
|
+
type?: string | null;
|
|
14
|
+
/** Search fromNumber or toNumber (contains) */
|
|
15
|
+
search?: string | null;
|
|
8
16
|
}
|
|
@@ -4,3 +4,4 @@ export type { GetCallTranscriptV1CallsCallIdTranscriptGetRequest } from "./GetCa
|
|
|
4
4
|
export type { GetCallV1CallsCallIdGetRequest } from "./GetCallV1CallsCallIdGetRequest.mjs";
|
|
5
5
|
export type { ListCallsForNumberV1NumbersNumberIdCallsGetRequest } from "./ListCallsForNumberV1NumbersNumberIdCallsGetRequest.mjs";
|
|
6
6
|
export type { ListCallsV1CallsGetRequest } from "./ListCallsV1CallsGetRequest.mjs";
|
|
7
|
+
export type { StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest } from "./StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest.mjs";
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as AgentPhone from "../../../index.mjs";
|
|
5
|
+
export declare namespace ContactsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class ContactsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<ContactsClient.Options>;
|
|
12
|
+
constructor(options: ContactsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* List all contacts for this account.
|
|
15
|
+
*
|
|
16
|
+
* Optional `search` query filters by name or phone number (case-insensitive contains).
|
|
17
|
+
*
|
|
18
|
+
* @param {AgentPhone.ListContactsV1ContactsGetRequest} request
|
|
19
|
+
* @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
20
|
+
*
|
|
21
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* await client.contacts.listContacts()
|
|
25
|
+
*/
|
|
26
|
+
listContacts(request?: AgentPhone.ListContactsV1ContactsGetRequest, requestOptions?: ContactsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.ContactListResponse>;
|
|
27
|
+
private __listContacts;
|
|
28
|
+
/**
|
|
29
|
+
* Create a new contact.
|
|
30
|
+
*
|
|
31
|
+
* Phone number is normalized to E.164 format. Returns 409 if a contact
|
|
32
|
+
* with this phone number already exists for the project.
|
|
33
|
+
*
|
|
34
|
+
* @param {AgentPhone.CreateContactRequest} request
|
|
35
|
+
* @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
|
+
*
|
|
37
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* await client.contacts.createContact({
|
|
41
|
+
* phoneNumber: "phoneNumber",
|
|
42
|
+
* name: "name"
|
|
43
|
+
* })
|
|
44
|
+
*/
|
|
45
|
+
createContact(request: AgentPhone.CreateContactRequest, requestOptions?: ContactsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.ContactResponse>;
|
|
46
|
+
private __createContact;
|
|
47
|
+
/**
|
|
48
|
+
* Get a single contact by ID.
|
|
49
|
+
*
|
|
50
|
+
* @param {AgentPhone.GetContactV1ContactsContactIdGetRequest} request
|
|
51
|
+
* @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
52
|
+
*
|
|
53
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* await client.contacts.getContact({
|
|
57
|
+
* contact_id: "contact_id"
|
|
58
|
+
* })
|
|
59
|
+
*/
|
|
60
|
+
getContact(request: AgentPhone.GetContactV1ContactsContactIdGetRequest, requestOptions?: ContactsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.ContactResponse>;
|
|
61
|
+
private __getContact;
|
|
62
|
+
/**
|
|
63
|
+
* Delete a contact.
|
|
64
|
+
*
|
|
65
|
+
* @param {AgentPhone.DeleteContactV1ContactsContactIdDeleteRequest} request
|
|
66
|
+
* @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
67
|
+
*
|
|
68
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* await client.contacts.deleteContact({
|
|
72
|
+
* contact_id: "contact_id"
|
|
73
|
+
* })
|
|
74
|
+
*/
|
|
75
|
+
deleteContact(request: AgentPhone.DeleteContactV1ContactsContactIdDeleteRequest, requestOptions?: ContactsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
76
|
+
private __deleteContact;
|
|
77
|
+
/**
|
|
78
|
+
* Update a contact's fields.
|
|
79
|
+
*
|
|
80
|
+
* If phoneNumber is updated, it's re-normalized and checked for uniqueness (409 on conflict).
|
|
81
|
+
*
|
|
82
|
+
* @param {AgentPhone.UpdateContactRequest} request
|
|
83
|
+
* @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
84
|
+
*
|
|
85
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* await client.contacts.updateContact({
|
|
89
|
+
* contact_id: "contact_id"
|
|
90
|
+
* })
|
|
91
|
+
*/
|
|
92
|
+
updateContact(request: AgentPhone.UpdateContactRequest, requestOptions?: ContactsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.ContactResponse>;
|
|
93
|
+
private __updateContact;
|
|
94
|
+
}
|