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
|
@@ -1,2 +1,30 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export
|
|
2
|
+
export var CreateAgentRequest;
|
|
3
|
+
(function (CreateAgentRequest) {
|
|
4
|
+
CreateAgentRequest.VoiceMode = {
|
|
5
|
+
Webhook: "webhook",
|
|
6
|
+
Hosted: "hosted",
|
|
7
|
+
};
|
|
8
|
+
CreateAgentRequest.ModelTier = {
|
|
9
|
+
Turbo: "turbo",
|
|
10
|
+
Balanced: "balanced",
|
|
11
|
+
Max: "max",
|
|
12
|
+
};
|
|
13
|
+
/** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
|
|
14
|
+
CreateAgentRequest.SttMode = {
|
|
15
|
+
Fast: "fast",
|
|
16
|
+
Accurate: "accurate",
|
|
17
|
+
};
|
|
18
|
+
/** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
|
|
19
|
+
CreateAgentRequest.AmbientSound = {
|
|
20
|
+
None: "none",
|
|
21
|
+
Office: "office",
|
|
22
|
+
CoffeeShop: "coffee-shop",
|
|
23
|
+
Outdoor: "outdoor",
|
|
24
|
+
};
|
|
25
|
+
/** 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). */
|
|
26
|
+
CreateAgentRequest.DenoisingMode = {
|
|
27
|
+
NoiseCancellation: "noise-cancellation",
|
|
28
|
+
NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation",
|
|
29
|
+
};
|
|
30
|
+
})(CreateAgentRequest || (CreateAgentRequest = {}));
|
|
@@ -8,11 +8,50 @@ export interface UpdateAgentRequest {
|
|
|
8
8
|
agent_id: string;
|
|
9
9
|
name?: string | null;
|
|
10
10
|
description?: string | null;
|
|
11
|
-
voiceMode?:
|
|
12
|
-
modelTier?:
|
|
11
|
+
voiceMode?: UpdateAgentRequest.VoiceMode;
|
|
12
|
+
modelTier?: UpdateAgentRequest.ModelTier;
|
|
13
13
|
systemPrompt?: string | null;
|
|
14
14
|
beginMessage?: string | null;
|
|
15
15
|
voice?: string | null;
|
|
16
16
|
transferNumber?: string | null;
|
|
17
17
|
voicemailMessage?: string | null;
|
|
18
|
+
/** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
|
|
19
|
+
sttMode?: UpdateAgentRequest.SttMode;
|
|
20
|
+
/** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
|
|
21
|
+
ambientSound?: UpdateAgentRequest.AmbientSound;
|
|
22
|
+
/** 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). */
|
|
23
|
+
denoisingMode?: UpdateAgentRequest.DenoisingMode;
|
|
24
|
+
}
|
|
25
|
+
export declare namespace UpdateAgentRequest {
|
|
26
|
+
const VoiceMode: {
|
|
27
|
+
readonly Webhook: "webhook";
|
|
28
|
+
readonly Hosted: "hosted";
|
|
29
|
+
};
|
|
30
|
+
type VoiceMode = (typeof VoiceMode)[keyof typeof VoiceMode];
|
|
31
|
+
const ModelTier: {
|
|
32
|
+
readonly Turbo: "turbo";
|
|
33
|
+
readonly Balanced: "balanced";
|
|
34
|
+
readonly Max: "max";
|
|
35
|
+
};
|
|
36
|
+
type ModelTier = (typeof ModelTier)[keyof typeof ModelTier];
|
|
37
|
+
/** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
|
|
38
|
+
const SttMode: {
|
|
39
|
+
readonly Fast: "fast";
|
|
40
|
+
readonly Accurate: "accurate";
|
|
41
|
+
};
|
|
42
|
+
type SttMode = (typeof SttMode)[keyof typeof SttMode];
|
|
43
|
+
/** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
|
|
44
|
+
const AmbientSound: {
|
|
45
|
+
readonly None: "none";
|
|
46
|
+
readonly Office: "office";
|
|
47
|
+
readonly CoffeeShop: "coffee-shop";
|
|
48
|
+
readonly Outdoor: "outdoor";
|
|
49
|
+
};
|
|
50
|
+
type AmbientSound = (typeof AmbientSound)[keyof typeof AmbientSound];
|
|
51
|
+
/** 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). */
|
|
52
|
+
const DenoisingMode: {
|
|
53
|
+
readonly NoiseCancellation: "noise-cancellation";
|
|
54
|
+
readonly NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation";
|
|
55
|
+
};
|
|
56
|
+
type DenoisingMode = (typeof DenoisingMode)[keyof typeof DenoisingMode];
|
|
18
57
|
}
|
|
@@ -1,2 +1,30 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export
|
|
2
|
+
export var UpdateAgentRequest;
|
|
3
|
+
(function (UpdateAgentRequest) {
|
|
4
|
+
UpdateAgentRequest.VoiceMode = {
|
|
5
|
+
Webhook: "webhook",
|
|
6
|
+
Hosted: "hosted",
|
|
7
|
+
};
|
|
8
|
+
UpdateAgentRequest.ModelTier = {
|
|
9
|
+
Turbo: "turbo",
|
|
10
|
+
Balanced: "balanced",
|
|
11
|
+
Max: "max",
|
|
12
|
+
};
|
|
13
|
+
/** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
|
|
14
|
+
UpdateAgentRequest.SttMode = {
|
|
15
|
+
Fast: "fast",
|
|
16
|
+
Accurate: "accurate",
|
|
17
|
+
};
|
|
18
|
+
/** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
|
|
19
|
+
UpdateAgentRequest.AmbientSound = {
|
|
20
|
+
None: "none",
|
|
21
|
+
Office: "office",
|
|
22
|
+
CoffeeShop: "coffee-shop",
|
|
23
|
+
Outdoor: "outdoor",
|
|
24
|
+
};
|
|
25
|
+
/** 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). */
|
|
26
|
+
UpdateAgentRequest.DenoisingMode = {
|
|
27
|
+
NoiseCancellation: "noise-cancellation",
|
|
28
|
+
NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation",
|
|
29
|
+
};
|
|
30
|
+
})(UpdateAgentRequest || (UpdateAgentRequest = {}));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export type { AttachNumberRequest } from "./AttachNumberRequest.mjs";
|
|
2
|
-
export
|
|
2
|
+
export { CreateAgentRequest } from "./CreateAgentRequest.mjs";
|
|
3
3
|
export type { DeleteAgentV1AgentsAgentIdDeleteRequest } from "./DeleteAgentV1AgentsAgentIdDeleteRequest.mjs";
|
|
4
4
|
export type { DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest } from "./DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest.mjs";
|
|
5
5
|
export type { GetAgentV1AgentsAgentIdGetRequest } from "./GetAgentV1AgentsAgentIdGetRequest.mjs";
|
|
6
6
|
export type { ListAgentCallsV1AgentsAgentIdCallsGetRequest } from "./ListAgentCallsV1AgentsAgentIdCallsGetRequest.mjs";
|
|
7
7
|
export type { ListAgentConversationsV1AgentsAgentIdConversationsGetRequest } from "./ListAgentConversationsV1AgentsAgentIdConversationsGetRequest.mjs";
|
|
8
8
|
export type { ListAgentsV1AgentsGetRequest } from "./ListAgentsV1AgentsGetRequest.mjs";
|
|
9
|
-
export
|
|
9
|
+
export { UpdateAgentRequest } from "./UpdateAgentRequest.mjs";
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { CreateAgentRequest } from "./CreateAgentRequest.mjs";
|
|
2
|
+
export { UpdateAgentRequest } from "./UpdateAgentRequest.mjs";
|
|
@@ -9,7 +9,7 @@ export declare namespace CallsClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class CallsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<CallsClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options?: CallsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* List all calls for this account.
|
|
15
15
|
*
|
|
@@ -90,6 +90,32 @@ export declare class CallsClient {
|
|
|
90
90
|
*/
|
|
91
91
|
getCall(request: AgentPhone.GetCallV1CallsCallIdGetRequest, requestOptions?: CallsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
92
92
|
private __getCall;
|
|
93
|
+
/**
|
|
94
|
+
* Returns the audio file (WAV format) for a completed call.
|
|
95
|
+
*
|
|
96
|
+
* This is a public endpoint -- no authentication is required. The call ID acts as the access token. The `recordingUrl` field in the call response already contains this URL when recording is enabled.
|
|
97
|
+
*
|
|
98
|
+
* Recording must be enabled on your account via `POST /credits/recording/enable` ($5/mo add-on). Returns `404` if the call doesn't exist or has no recording.
|
|
99
|
+
*
|
|
100
|
+
* **Response:** Binary audio file (`audio/wav`), auto-downloads with filename `recording-{call_id}.wav`.
|
|
101
|
+
*
|
|
102
|
+
* **Notes:**
|
|
103
|
+
* - Recording is available shortly after a call completes
|
|
104
|
+
* - Check `recordingAvailable: true` in the call response before fetching
|
|
105
|
+
* - The URL can be shared or embedded directly since it requires no authentication
|
|
106
|
+
*
|
|
107
|
+
* @param {AgentPhone.GetCallRecordingV1CallsCallIdRecordingGetRequest} request
|
|
108
|
+
* @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
109
|
+
*
|
|
110
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* await client.calls.getCallRecording({
|
|
114
|
+
* call_id: "call_id"
|
|
115
|
+
* })
|
|
116
|
+
*/
|
|
117
|
+
getCallRecording(request: AgentPhone.GetCallRecordingV1CallsCallIdRecordingGetRequest, requestOptions?: CallsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
118
|
+
private __getCallRecording;
|
|
93
119
|
/**
|
|
94
120
|
* Get the full transcript for a call.
|
|
95
121
|
*
|
|
@@ -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 CallsClient {
|
|
19
|
-
constructor(options) {
|
|
19
|
+
constructor(options = {}) {
|
|
20
20
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -48,7 +48,7 @@ export class CallsClient {
|
|
|
48
48
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
49
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);
|
|
50
50
|
const _response = yield core.fetcher({
|
|
51
|
-
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.
|
|
51
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v1/calls"),
|
|
52
52
|
method: "GET",
|
|
53
53
|
headers: _headers,
|
|
54
54
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -110,7 +110,7 @@ export class CallsClient {
|
|
|
110
110
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
111
111
|
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);
|
|
112
112
|
const _response = yield core.fetcher({
|
|
113
|
-
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.
|
|
113
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v1/calls"),
|
|
114
114
|
method: "POST",
|
|
115
115
|
headers: _headers,
|
|
116
116
|
contentType: "application/json",
|
|
@@ -173,7 +173,7 @@ export class CallsClient {
|
|
|
173
173
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
174
174
|
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);
|
|
175
175
|
const _response = yield core.fetcher({
|
|
176
|
-
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.
|
|
176
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v1/calls/web"),
|
|
177
177
|
method: "POST",
|
|
178
178
|
headers: _headers,
|
|
179
179
|
contentType: "application/json",
|
|
@@ -227,7 +227,7 @@ export class CallsClient {
|
|
|
227
227
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
228
228
|
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);
|
|
229
229
|
const _response = yield core.fetcher({
|
|
230
|
-
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.
|
|
230
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/calls/${core.url.encodePathParam(callId)}`),
|
|
231
231
|
method: "GET",
|
|
232
232
|
headers: _headers,
|
|
233
233
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -255,6 +255,67 @@ export class CallsClient {
|
|
|
255
255
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/calls/{call_id}");
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
|
+
/**
|
|
259
|
+
* Returns the audio file (WAV format) for a completed call.
|
|
260
|
+
*
|
|
261
|
+
* This is a public endpoint -- no authentication is required. The call ID acts as the access token. The `recordingUrl` field in the call response already contains this URL when recording is enabled.
|
|
262
|
+
*
|
|
263
|
+
* Recording must be enabled on your account via `POST /credits/recording/enable` ($5/mo add-on). Returns `404` if the call doesn't exist or has no recording.
|
|
264
|
+
*
|
|
265
|
+
* **Response:** Binary audio file (`audio/wav`), auto-downloads with filename `recording-{call_id}.wav`.
|
|
266
|
+
*
|
|
267
|
+
* **Notes:**
|
|
268
|
+
* - Recording is available shortly after a call completes
|
|
269
|
+
* - Check `recordingAvailable: true` in the call response before fetching
|
|
270
|
+
* - The URL can be shared or embedded directly since it requires no authentication
|
|
271
|
+
*
|
|
272
|
+
* @param {AgentPhone.GetCallRecordingV1CallsCallIdRecordingGetRequest} request
|
|
273
|
+
* @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
274
|
+
*
|
|
275
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
276
|
+
*
|
|
277
|
+
* @example
|
|
278
|
+
* await client.calls.getCallRecording({
|
|
279
|
+
* call_id: "call_id"
|
|
280
|
+
* })
|
|
281
|
+
*/
|
|
282
|
+
getCallRecording(request, requestOptions) {
|
|
283
|
+
return core.HttpResponsePromise.fromPromise(this.__getCallRecording(request, requestOptions));
|
|
284
|
+
}
|
|
285
|
+
__getCallRecording(request, requestOptions) {
|
|
286
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
287
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
288
|
+
const { call_id: callId } = request;
|
|
289
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
290
|
+
const _response = yield core.fetcher({
|
|
291
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/calls/${core.url.encodePathParam(callId)}/recording`),
|
|
292
|
+
method: "GET",
|
|
293
|
+
headers: _headers,
|
|
294
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
295
|
+
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,
|
|
296
|
+
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,
|
|
297
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
298
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
299
|
+
logging: this._options.logging,
|
|
300
|
+
});
|
|
301
|
+
if (_response.ok) {
|
|
302
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
303
|
+
}
|
|
304
|
+
if (_response.error.reason === "status-code") {
|
|
305
|
+
switch (_response.error.statusCode) {
|
|
306
|
+
case 422:
|
|
307
|
+
throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
308
|
+
default:
|
|
309
|
+
throw new errors.AgentPhoneError({
|
|
310
|
+
statusCode: _response.error.statusCode,
|
|
311
|
+
body: _response.error.body,
|
|
312
|
+
rawResponse: _response.rawResponse,
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/calls/{call_id}/recording");
|
|
317
|
+
});
|
|
318
|
+
}
|
|
258
319
|
/**
|
|
259
320
|
* Get the full transcript for a call.
|
|
260
321
|
*
|
|
@@ -282,7 +343,7 @@ export class CallsClient {
|
|
|
282
343
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
283
344
|
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);
|
|
284
345
|
const _response = yield core.fetcher({
|
|
285
|
-
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.
|
|
346
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/calls/${core.url.encodePathParam(callId)}/transcript`),
|
|
286
347
|
method: "GET",
|
|
287
348
|
headers: _headers,
|
|
288
349
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -342,7 +403,7 @@ export class CallsClient {
|
|
|
342
403
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
343
404
|
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
405
|
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.
|
|
406
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/calls/${core.url.encodePathParam(callId)}/transcript/stream`),
|
|
346
407
|
method: "GET",
|
|
347
408
|
headers: _headers,
|
|
348
409
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -397,7 +458,7 @@ export class CallsClient {
|
|
|
397
458
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
398
459
|
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);
|
|
399
460
|
const _response = yield core.fetcher({
|
|
400
|
-
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.
|
|
461
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/numbers/${core.url.encodePathParam(numberId)}/calls`),
|
|
401
462
|
method: "GET",
|
|
402
463
|
headers: _headers,
|
|
403
464
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -18,4 +18,6 @@ export interface CreateOutboundCallRequest {
|
|
|
18
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
|
+
/** Optional per-call dynamic variables. Values are substituted into ``{{var_name}}`` placeholders in the agent's system prompt and initial greeting at call time. Requires either ``systemPrompt`` or a hosted-mode agent. */
|
|
22
|
+
variables?: Record<string, string | null> | null;
|
|
21
23
|
}
|
|
@@ -9,4 +9,6 @@ export interface CreateWebCallRequest {
|
|
|
9
9
|
agentId: string;
|
|
10
10
|
/** Optional metadata to attach to the call */
|
|
11
11
|
metadata?: Record<string, unknown> | null;
|
|
12
|
+
/** Optional per-call dynamic variables. Values are substituted into ``{{var_name}}`` placeholders in the agent's system prompt and begin message at call time. Requires a hosted-mode agent. */
|
|
13
|
+
variables?: Record<string, string | null> | null;
|
|
12
14
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { CreateOutboundCallRequest } from "./CreateOutboundCallRequest.mjs";
|
|
2
2
|
export type { CreateWebCallRequest } from "./CreateWebCallRequest.mjs";
|
|
3
|
+
export type { GetCallRecordingV1CallsCallIdRecordingGetRequest } from "./GetCallRecordingV1CallsCallIdRecordingGetRequest.mjs";
|
|
3
4
|
export type { GetCallTranscriptV1CallsCallIdTranscriptGetRequest } from "./GetCallTranscriptV1CallsCallIdTranscriptGetRequest.mjs";
|
|
4
5
|
export type { GetCallV1CallsCallIdGetRequest } from "./GetCallV1CallsCallIdGetRequest.mjs";
|
|
5
6
|
export type { ListCallsForNumberV1NumbersNumberIdCallsGetRequest } from "./ListCallsForNumberV1NumbersNumberIdCallsGetRequest.mjs";
|
|
@@ -9,7 +9,7 @@ export declare namespace ContactsClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class ContactsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<ContactsClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options?: ContactsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* List all contacts for this account.
|
|
15
15
|
*
|
|
@@ -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 ContactsClient {
|
|
30
|
-
constructor(options) {
|
|
30
|
+
constructor(options = {}) {
|
|
31
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -58,7 +58,7 @@ export class ContactsClient {
|
|
|
58
58
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
59
59
|
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);
|
|
60
60
|
const _response = yield core.fetcher({
|
|
61
|
-
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.
|
|
61
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v1/contacts"),
|
|
62
62
|
method: "GET",
|
|
63
63
|
headers: _headers,
|
|
64
64
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -112,7 +112,7 @@ export class ContactsClient {
|
|
|
112
112
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
113
113
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
114
114
|
const _response = yield core.fetcher({
|
|
115
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
115
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v1/contacts"),
|
|
116
116
|
method: "POST",
|
|
117
117
|
headers: _headers,
|
|
118
118
|
contentType: "application/json",
|
|
@@ -166,7 +166,7 @@ export class ContactsClient {
|
|
|
166
166
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
167
167
|
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);
|
|
168
168
|
const _response = yield core.fetcher({
|
|
169
|
-
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.
|
|
169
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/contacts/${core.url.encodePathParam(contactId)}`),
|
|
170
170
|
method: "GET",
|
|
171
171
|
headers: _headers,
|
|
172
172
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -217,7 +217,7 @@ export class ContactsClient {
|
|
|
217
217
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
218
218
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
219
219
|
const _response = yield core.fetcher({
|
|
220
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.
|
|
220
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/contacts/${core.url.encodePathParam(contactId)}`),
|
|
221
221
|
method: "DELETE",
|
|
222
222
|
headers: _headers,
|
|
223
223
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -270,7 +270,7 @@ export class ContactsClient {
|
|
|
270
270
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
271
271
|
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);
|
|
272
272
|
const _response = yield core.fetcher({
|
|
273
|
-
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.
|
|
273
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/contacts/${core.url.encodePathParam(contactId)}`),
|
|
274
274
|
method: "PATCH",
|
|
275
275
|
headers: _headers,
|
|
276
276
|
contentType: "application/json",
|
|
@@ -9,7 +9,7 @@ export declare namespace ConversationsClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class ConversationsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<ConversationsClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options?: ConversationsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* List all conversations for this account.
|
|
15
15
|
*
|
|
@@ -79,4 +79,23 @@ export declare class ConversationsClient {
|
|
|
79
79
|
*/
|
|
80
80
|
getConversationMessages(request: AgentPhone.GetConversationMessagesV1ConversationsConversationIdMessagesGetRequest, requestOptions?: ConversationsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.MessagesListResponse>;
|
|
81
81
|
private __getConversationMessages;
|
|
82
|
+
/**
|
|
83
|
+
* Show a typing indicator in the conversation (iMessage only).
|
|
84
|
+
*
|
|
85
|
+
* Best-effort: providers may silently drop the indicator if the chat hasn't
|
|
86
|
+
* had recent activity, the recipient isn't on iMessage, or it's a group chat.
|
|
87
|
+
* Indicators auto-expire after a few seconds — no "stop typing" call needed.
|
|
88
|
+
*
|
|
89
|
+
* @param {AgentPhone.SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest} request
|
|
90
|
+
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
91
|
+
*
|
|
92
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* await client.conversations.sendTypingIndicator({
|
|
96
|
+
* conversation_id: "conversation_id"
|
|
97
|
+
* })
|
|
98
|
+
*/
|
|
99
|
+
sendTypingIndicator(request: AgentPhone.SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest, requestOptions?: ConversationsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.SendTypingResponse>;
|
|
100
|
+
private __sendTypingIndicator;
|
|
82
101
|
}
|
|
@@ -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 ConversationsClient {
|
|
30
|
-
constructor(options) {
|
|
30
|
+
constructor(options = {}) {
|
|
31
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -57,7 +57,7 @@ export class ConversationsClient {
|
|
|
57
57
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
58
58
|
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);
|
|
59
59
|
const _response = yield core.fetcher({
|
|
60
|
-
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.
|
|
60
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v1/conversations"),
|
|
61
61
|
method: "GET",
|
|
62
62
|
headers: _headers,
|
|
63
63
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -114,7 +114,7 @@ export class ConversationsClient {
|
|
|
114
114
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
115
115
|
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);
|
|
116
116
|
const _response = yield core.fetcher({
|
|
117
|
-
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.
|
|
117
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/conversations/${core.url.encodePathParam(conversationId)}`),
|
|
118
118
|
method: "GET",
|
|
119
119
|
headers: _headers,
|
|
120
120
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -172,7 +172,7 @@ export class ConversationsClient {
|
|
|
172
172
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
173
173
|
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);
|
|
174
174
|
const _response = yield core.fetcher({
|
|
175
|
-
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.
|
|
175
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/conversations/${core.url.encodePathParam(conversationId)}`),
|
|
176
176
|
method: "PATCH",
|
|
177
177
|
headers: _headers,
|
|
178
178
|
contentType: "application/json",
|
|
@@ -233,7 +233,7 @@ export class ConversationsClient {
|
|
|
233
233
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
234
234
|
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);
|
|
235
235
|
const _response = yield core.fetcher({
|
|
236
|
-
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.
|
|
236
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/conversations/${core.url.encodePathParam(conversationId)}/messages`),
|
|
237
237
|
method: "GET",
|
|
238
238
|
headers: _headers,
|
|
239
239
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -261,4 +261,59 @@ export class ConversationsClient {
|
|
|
261
261
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/conversations/{conversation_id}/messages");
|
|
262
262
|
});
|
|
263
263
|
}
|
|
264
|
+
/**
|
|
265
|
+
* Show a typing indicator in the conversation (iMessage only).
|
|
266
|
+
*
|
|
267
|
+
* Best-effort: providers may silently drop the indicator if the chat hasn't
|
|
268
|
+
* had recent activity, the recipient isn't on iMessage, or it's a group chat.
|
|
269
|
+
* Indicators auto-expire after a few seconds — no "stop typing" call needed.
|
|
270
|
+
*
|
|
271
|
+
* @param {AgentPhone.SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest} request
|
|
272
|
+
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
273
|
+
*
|
|
274
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
275
|
+
*
|
|
276
|
+
* @example
|
|
277
|
+
* await client.conversations.sendTypingIndicator({
|
|
278
|
+
* conversation_id: "conversation_id"
|
|
279
|
+
* })
|
|
280
|
+
*/
|
|
281
|
+
sendTypingIndicator(request, requestOptions) {
|
|
282
|
+
return core.HttpResponsePromise.fromPromise(this.__sendTypingIndicator(request, requestOptions));
|
|
283
|
+
}
|
|
284
|
+
__sendTypingIndicator(request, requestOptions) {
|
|
285
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
286
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
287
|
+
const { conversation_id: conversationId } = request;
|
|
288
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
289
|
+
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);
|
|
290
|
+
const _response = yield core.fetcher({
|
|
291
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/conversations/${core.url.encodePathParam(conversationId)}/typing`),
|
|
292
|
+
method: "POST",
|
|
293
|
+
headers: _headers,
|
|
294
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
295
|
+
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,
|
|
296
|
+
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,
|
|
297
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
298
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
299
|
+
logging: this._options.logging,
|
|
300
|
+
});
|
|
301
|
+
if (_response.ok) {
|
|
302
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
303
|
+
}
|
|
304
|
+
if (_response.error.reason === "status-code") {
|
|
305
|
+
switch (_response.error.statusCode) {
|
|
306
|
+
case 422:
|
|
307
|
+
throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
308
|
+
default:
|
|
309
|
+
throw new errors.AgentPhoneError({
|
|
310
|
+
statusCode: _response.error.statusCode,
|
|
311
|
+
body: _response.error.body,
|
|
312
|
+
rawResponse: _response.rawResponse,
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/conversations/{conversation_id}/typing");
|
|
317
|
+
});
|
|
318
|
+
}
|
|
264
319
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type { GetConversationMessagesV1ConversationsConversationIdMessagesGetRequest } from "./GetConversationMessagesV1ConversationsConversationIdMessagesGetRequest.mjs";
|
|
2
2
|
export type { GetConversationV1ConversationsConversationIdGetRequest } from "./GetConversationV1ConversationsConversationIdGetRequest.mjs";
|
|
3
3
|
export type { ListConversationsV1ConversationsGetRequest } from "./ListConversationsV1ConversationsGetRequest.mjs";
|
|
4
|
+
export type { SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest } from "./SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.mjs";
|
|
4
5
|
export type { UpdateConversationRequest } from "./UpdateConversationRequest.mjs";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * from "./agentSignup/client/requests/index.mjs";
|
|
2
|
+
export * as agentSignup from "./agentSignup/index.mjs";
|
|
1
3
|
export * from "./agents/client/requests/index.mjs";
|
|
2
4
|
export * as agents from "./agents/index.mjs";
|
|
3
5
|
export * from "./agentWebhooks/client/requests/index.mjs";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * from "./agentSignup/client/requests/index.mjs";
|
|
2
|
+
export * as agentSignup from "./agentSignup/index.mjs";
|
|
1
3
|
export * from "./agents/client/requests/index.mjs";
|
|
2
4
|
export * as agents from "./agents/index.mjs";
|
|
3
5
|
export * from "./agentWebhooks/client/requests/index.mjs";
|
|
@@ -9,7 +9,7 @@ export declare namespace MessagesClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class MessagesClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<MessagesClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options?: MessagesClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Send an outbound message (SMS or iMessage) via the provider assigned to the number.
|
|
15
15
|
*
|