agentphone 1.0.10 → 1.0.11
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 +3 -0
- package/dist/cjs/Client.js +13 -8
- package/dist/cjs/api/resources/agents/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/agents/client/Client.js +1 -1
- package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +6 -0
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +6 -0
- package/dist/cjs/api/resources/calls/client/Client.d.ts +4 -4
- package/dist/cjs/api/resources/calls/client/Client.js +4 -4
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +39 -1
- package/dist/cjs/api/resources/conversations/client/Client.js +114 -1
- package/dist/cjs/api/resources/conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.d.ts +9 -0
- package/dist/cjs/api/resources/conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.js +3 -0
- package/dist/cjs/api/resources/conversations/client/requests/SetBackgroundRequest.d.ts +12 -0
- package/dist/cjs/api/resources/conversations/client/requests/SetBackgroundRequest.js +3 -0
- package/dist/cjs/api/resources/conversations/client/requests/index.d.ts +2 -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/integrations/client/Client.d.ts +64 -0
- package/dist/cjs/api/resources/integrations/client/Client.js +268 -0
- package/dist/cjs/api/resources/integrations/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/integrations/client/index.js +17 -0
- package/dist/cjs/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.d.ts +9 -0
- package/dist/cjs/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.js +3 -0
- package/dist/cjs/api/resources/integrations/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/integrations/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/integrations/index.d.ts +1 -0
- package/dist/cjs/api/resources/integrations/index.js +17 -0
- package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.d.ts +2 -0
- package/dist/cjs/api/resources/messages/client/requests/SendReactionRequest.d.ts +2 -14
- package/dist/cjs/api/resources/messages/client/requests/SendReactionRequest.js +0 -13
- package/dist/cjs/api/resources/messages/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/messages/client/requests/index.js +1 -3
- package/dist/cjs/api/types/AgentResponse.d.ts +6 -0
- package/dist/cjs/api/types/SendMessageResponse.d.ts +2 -0
- package/dist/cjs/api/types/SetBackgroundResponse.d.ts +8 -0
- package/dist/cjs/api/types/SetBackgroundResponse.js +3 -0
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -0
- package/dist/cjs/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 +3 -0
- package/dist/esm/Client.mjs +5 -0
- package/dist/esm/api/resources/agents/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/agents/client/Client.mjs +1 -1
- package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +6 -0
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +6 -0
- package/dist/esm/api/resources/calls/client/Client.d.mts +4 -4
- package/dist/esm/api/resources/calls/client/Client.mjs +4 -4
- package/dist/esm/api/resources/conversations/client/Client.d.mts +39 -1
- package/dist/esm/api/resources/conversations/client/Client.mjs +114 -1
- package/dist/esm/api/resources/conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.d.mts +9 -0
- package/dist/esm/api/resources/conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.mjs +2 -0
- package/dist/esm/api/resources/conversations/client/requests/SetBackgroundRequest.d.mts +12 -0
- package/dist/esm/api/resources/conversations/client/requests/SetBackgroundRequest.mjs +2 -0
- package/dist/esm/api/resources/conversations/client/requests/index.d.mts +2 -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/integrations/client/Client.d.mts +64 -0
- package/dist/esm/api/resources/integrations/client/Client.mjs +231 -0
- package/dist/esm/api/resources/integrations/client/index.d.mts +1 -0
- package/dist/esm/api/resources/integrations/client/index.mjs +1 -0
- package/dist/esm/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.d.mts +9 -0
- package/dist/esm/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.mjs +2 -0
- package/dist/esm/api/resources/integrations/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/integrations/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/integrations/index.d.mts +1 -0
- package/dist/esm/api/resources/integrations/index.mjs +1 -0
- package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.d.mts +2 -0
- package/dist/esm/api/resources/messages/client/requests/SendReactionRequest.d.mts +2 -14
- package/dist/esm/api/resources/messages/client/requests/SendReactionRequest.mjs +1 -12
- package/dist/esm/api/resources/messages/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/messages/client/requests/index.mjs +0 -1
- package/dist/esm/api/types/AgentResponse.d.mts +6 -0
- package/dist/esm/api/types/SendMessageResponse.d.mts +2 -0
- package/dist/esm/api/types/SetBackgroundResponse.d.mts +8 -0
- package/dist/esm/api/types/SetBackgroundResponse.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +402 -6
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "agentphone",
|
|
46
|
-
"X-Fern-SDK-Version": "1.0.
|
|
47
|
-
"User-Agent": "agentphone/1.0.
|
|
46
|
+
"X-Fern-SDK-Version": "1.0.11",
|
|
47
|
+
"User-Agent": "agentphone/1.0.11",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { CallsClient } from "./api/resources/calls/client/Client.js";
|
|
|
5
5
|
import { ContactCardsClient } from "./api/resources/contactCards/client/Client.js";
|
|
6
6
|
import { ContactsClient } from "./api/resources/contacts/client/Client.js";
|
|
7
7
|
import { ConversationsClient } from "./api/resources/conversations/client/Client.js";
|
|
8
|
+
import { IntegrationsClient } from "./api/resources/integrations/client/Client.js";
|
|
8
9
|
import { MessagesClient } from "./api/resources/messages/client/Client.js";
|
|
9
10
|
import { NumbersClient } from "./api/resources/numbers/client/Client.js";
|
|
10
11
|
import { UsageClient } from "./api/resources/usage/client/Client.js";
|
|
@@ -27,6 +28,7 @@ export declare class AgentPhoneClient {
|
|
|
27
28
|
protected _conversations: ConversationsClient | undefined;
|
|
28
29
|
protected _calls: CallsClient | undefined;
|
|
29
30
|
protected _usage: UsageClient | undefined;
|
|
31
|
+
protected _integrations: IntegrationsClient | undefined;
|
|
30
32
|
protected _messages: MessagesClient | undefined;
|
|
31
33
|
protected _contactCards: ContactCardsClient | undefined;
|
|
32
34
|
constructor(options?: AgentPhoneClient.Options);
|
|
@@ -39,6 +41,7 @@ export declare class AgentPhoneClient {
|
|
|
39
41
|
get conversations(): ConversationsClient;
|
|
40
42
|
get calls(): CallsClient;
|
|
41
43
|
get usage(): UsageClient;
|
|
44
|
+
get integrations(): IntegrationsClient;
|
|
42
45
|
get messages(): MessagesClient;
|
|
43
46
|
get contactCards(): ContactCardsClient;
|
|
44
47
|
}
|
package/dist/cjs/Client.js
CHANGED
|
@@ -9,10 +9,11 @@ const Client_js_4 = require("./api/resources/calls/client/Client.js");
|
|
|
9
9
|
const Client_js_5 = require("./api/resources/contactCards/client/Client.js");
|
|
10
10
|
const Client_js_6 = require("./api/resources/contacts/client/Client.js");
|
|
11
11
|
const Client_js_7 = require("./api/resources/conversations/client/Client.js");
|
|
12
|
-
const Client_js_8 = require("./api/resources/
|
|
13
|
-
const Client_js_9 = require("./api/resources/
|
|
14
|
-
const Client_js_10 = require("./api/resources/
|
|
15
|
-
const Client_js_11 = require("./api/resources/
|
|
12
|
+
const Client_js_8 = require("./api/resources/integrations/client/Client.js");
|
|
13
|
+
const Client_js_9 = require("./api/resources/messages/client/Client.js");
|
|
14
|
+
const Client_js_10 = require("./api/resources/numbers/client/Client.js");
|
|
15
|
+
const Client_js_11 = require("./api/resources/usage/client/Client.js");
|
|
16
|
+
const Client_js_12 = require("./api/resources/webhooks/client/Client.js");
|
|
16
17
|
const BaseClient_js_1 = require("./BaseClient.js");
|
|
17
18
|
class AgentPhoneClient {
|
|
18
19
|
constructor(options = {}) {
|
|
@@ -28,11 +29,11 @@ class AgentPhoneClient {
|
|
|
28
29
|
}
|
|
29
30
|
get numbers() {
|
|
30
31
|
var _a;
|
|
31
|
-
return ((_a = this._numbers) !== null && _a !== void 0 ? _a : (this._numbers = new
|
|
32
|
+
return ((_a = this._numbers) !== null && _a !== void 0 ? _a : (this._numbers = new Client_js_10.NumbersClient(this._options)));
|
|
32
33
|
}
|
|
33
34
|
get webhooks() {
|
|
34
35
|
var _a;
|
|
35
|
-
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new
|
|
36
|
+
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_js_12.WebhooksClient(this._options)));
|
|
36
37
|
}
|
|
37
38
|
get agentWebhooks() {
|
|
38
39
|
var _a;
|
|
@@ -52,11 +53,15 @@ class AgentPhoneClient {
|
|
|
52
53
|
}
|
|
53
54
|
get usage() {
|
|
54
55
|
var _a;
|
|
55
|
-
return ((_a = this._usage) !== null && _a !== void 0 ? _a : (this._usage = new
|
|
56
|
+
return ((_a = this._usage) !== null && _a !== void 0 ? _a : (this._usage = new Client_js_11.UsageClient(this._options)));
|
|
57
|
+
}
|
|
58
|
+
get integrations() {
|
|
59
|
+
var _a;
|
|
60
|
+
return ((_a = this._integrations) !== null && _a !== void 0 ? _a : (this._integrations = new Client_js_8.IntegrationsClient(this._options)));
|
|
56
61
|
}
|
|
57
62
|
get messages() {
|
|
58
63
|
var _a;
|
|
59
|
-
return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new
|
|
64
|
+
return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_js_9.MessagesClient(this._options)));
|
|
60
65
|
}
|
|
61
66
|
get contactCards() {
|
|
62
67
|
var _a;
|
|
@@ -11,7 +11,7 @@ export declare class AgentsClient {
|
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<AgentsClient.Options>;
|
|
12
12
|
constructor(options?: AgentsClient.Options);
|
|
13
13
|
/**
|
|
14
|
-
* Return available voices from the
|
|
14
|
+
* Return available voices from the configured voice provider.
|
|
15
15
|
*
|
|
16
16
|
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
17
17
|
*
|
|
@@ -67,7 +67,7 @@ class AgentsClient {
|
|
|
67
67
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
|
-
* Return available voices from the
|
|
70
|
+
* Return available voices from the configured voice provider.
|
|
71
71
|
*
|
|
72
72
|
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
73
73
|
*
|
|
@@ -24,6 +24,12 @@ export interface CreateAgentRequest {
|
|
|
24
24
|
denoisingMode?: CreateAgentRequest.DenoisingMode;
|
|
25
25
|
/** Hang up the call after this many milliseconds of caller silence. Default 600000 (10 min). Raise for IVR/hold-music workflows; lower to fail fast on dead lines. Range 10000 (10s) to 3600000 (1 hour). */
|
|
26
26
|
maxSilenceMs?: number | null;
|
|
27
|
+
/** Voice speed multiplier. 1.0 is normal pace; lower values slow speech (0.5 is half speed), higher values speed it up (2.0 is double). Range 0.5 to 2.0. */
|
|
28
|
+
voiceSpeed?: number | null;
|
|
29
|
+
/** How easily callers can interrupt the agent. 0 means the agent is never interrupted, 1 means the agent stops at the first sound. Default 0.8. Range 0.0 to 1.0. */
|
|
30
|
+
interruptionSensitivity?: number | null;
|
|
31
|
+
/** When true, the agent interjects short filler words like 'uh-huh' or 'mhmm' during longer caller utterances. Set false to keep the agent silent while the caller is speaking. Defaults to true. */
|
|
32
|
+
enableBackchannel?: boolean | null;
|
|
27
33
|
}
|
|
28
34
|
export declare namespace CreateAgentRequest {
|
|
29
35
|
const VoiceMode: {
|
|
@@ -25,6 +25,12 @@ export interface UpdateAgentRequest {
|
|
|
25
25
|
denoisingMode?: UpdateAgentRequest.DenoisingMode;
|
|
26
26
|
/** Hang up the call after this many milliseconds of caller silence. Default 600000 (10 min). Raise for IVR/hold-music workflows; lower to fail fast on dead lines. Range 10000 (10s) to 3600000 (1 hour). */
|
|
27
27
|
maxSilenceMs?: number | null;
|
|
28
|
+
/** Voice speed multiplier. 1.0 is normal pace; lower slows speech (0.5 is half speed), higher speeds it up (2.0 is double). Range 0.5 to 2.0. */
|
|
29
|
+
voiceSpeed?: number | null;
|
|
30
|
+
/** How easily callers can interrupt the agent. 0 means the agent is never interrupted, 1 means the agent stops at the first sound. Default 0.8. Range 0.0 to 1.0. */
|
|
31
|
+
interruptionSensitivity?: number | null;
|
|
32
|
+
/** When true, the agent interjects short filler words like 'uh-huh' or 'mhmm' during longer caller utterances. Set false to keep the agent silent while the caller is speaking. */
|
|
33
|
+
enableBackchannel?: boolean | null;
|
|
28
34
|
}
|
|
29
35
|
export declare namespace UpdateAgentRequest {
|
|
30
36
|
const VoiceMode: {
|
|
@@ -93,10 +93,10 @@ export declare class CallsClient {
|
|
|
93
93
|
/**
|
|
94
94
|
* Terminate an ongoing call.
|
|
95
95
|
*
|
|
96
|
-
* Works for both hosted-mode and webhook-mode calls.
|
|
97
|
-
* webhook from
|
|
98
|
-
* endpoint returns the current call as soon as the stop request
|
|
99
|
-
* accepted
|
|
96
|
+
* Works for both hosted-mode and webhook-mode calls. The call_ended
|
|
97
|
+
* webhook from the voice provider updates status/endedAt asynchronously,
|
|
98
|
+
* so this endpoint returns the current call as soon as the stop request
|
|
99
|
+
* is accepted upstream.
|
|
100
100
|
*
|
|
101
101
|
* @param {AgentPhone.EndCallV1CallsCallIdEndPostRequest} request
|
|
102
102
|
* @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -294,10 +294,10 @@ class CallsClient {
|
|
|
294
294
|
/**
|
|
295
295
|
* Terminate an ongoing call.
|
|
296
296
|
*
|
|
297
|
-
* Works for both hosted-mode and webhook-mode calls.
|
|
298
|
-
* webhook from
|
|
299
|
-
* endpoint returns the current call as soon as the stop request
|
|
300
|
-
* accepted
|
|
297
|
+
* Works for both hosted-mode and webhook-mode calls. The call_ended
|
|
298
|
+
* webhook from the voice provider updates status/endedAt asynchronously,
|
|
299
|
+
* so this endpoint returns the current call as soon as the stop request
|
|
300
|
+
* is accepted upstream.
|
|
301
301
|
*
|
|
302
302
|
* @param {AgentPhone.EndCallV1CallsCallIdEndPostRequest} request
|
|
303
303
|
* @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -14,7 +14,7 @@ export declare class ConversationsClient {
|
|
|
14
14
|
* List all conversations for this account.
|
|
15
15
|
*
|
|
16
16
|
* Sorted by most recent activity (lastMessageAt desc).
|
|
17
|
-
*
|
|
17
|
+
* Sorted by most recent activity.
|
|
18
18
|
*
|
|
19
19
|
* @param {AgentPhone.ListConversationsV1ConversationsGetRequest} request
|
|
20
20
|
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -99,4 +99,42 @@ export declare class ConversationsClient {
|
|
|
99
99
|
*/
|
|
100
100
|
sendTypingIndicator(request: AgentPhone.SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest, requestOptions?: ConversationsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.SendTypingResponse>;
|
|
101
101
|
private __sendTypingIndicator;
|
|
102
|
+
/**
|
|
103
|
+
* Set a custom wallpaper for the chat (iMessage only).
|
|
104
|
+
*
|
|
105
|
+
* Customer sends `image_url`; we fetch (≤10MB, JPEG/PNG/GIF/WebP/HEIC),
|
|
106
|
+
* validate, and forward as multipart to the iMessage provider. Idempotent —
|
|
107
|
+
* re-setting replaces. Recipients on iOS < 18 fall back to the default
|
|
108
|
+
* silently.
|
|
109
|
+
*
|
|
110
|
+
* @param {AgentPhone.SetBackgroundRequest} request
|
|
111
|
+
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
112
|
+
*
|
|
113
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* await client.conversations.setChatBackground({
|
|
117
|
+
* conversation_id: "conversation_id",
|
|
118
|
+
* image_url: "https://example.com/wallpaper.jpg"
|
|
119
|
+
* })
|
|
120
|
+
*/
|
|
121
|
+
setChatBackground(request: AgentPhone.SetBackgroundRequest, requestOptions?: ConversationsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.SetBackgroundResponse>;
|
|
122
|
+
private __setChatBackground;
|
|
123
|
+
/**
|
|
124
|
+
* Clear the custom wallpaper for the chat (iMessage only).
|
|
125
|
+
*
|
|
126
|
+
* Idempotent: deleting a default-background chat returns 204 (no-op).
|
|
127
|
+
*
|
|
128
|
+
* @param {AgentPhone.RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest} request
|
|
129
|
+
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
130
|
+
*
|
|
131
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* await client.conversations.removeChatBackground({
|
|
135
|
+
* conversation_id: "conversation_id"
|
|
136
|
+
* })
|
|
137
|
+
*/
|
|
138
|
+
removeChatBackground(request: AgentPhone.RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest, requestOptions?: ConversationsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
139
|
+
private __removeChatBackground;
|
|
102
140
|
}
|
|
@@ -70,7 +70,7 @@ class ConversationsClient {
|
|
|
70
70
|
* List all conversations for this account.
|
|
71
71
|
*
|
|
72
72
|
* Sorted by most recent activity (lastMessageAt desc).
|
|
73
|
-
*
|
|
73
|
+
* Sorted by most recent activity.
|
|
74
74
|
*
|
|
75
75
|
* @param {AgentPhone.ListConversationsV1ConversationsGetRequest} request
|
|
76
76
|
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -353,5 +353,118 @@ class ConversationsClient {
|
|
|
353
353
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/conversations/{conversation_id}/typing");
|
|
354
354
|
});
|
|
355
355
|
}
|
|
356
|
+
/**
|
|
357
|
+
* Set a custom wallpaper for the chat (iMessage only).
|
|
358
|
+
*
|
|
359
|
+
* Customer sends `image_url`; we fetch (≤10MB, JPEG/PNG/GIF/WebP/HEIC),
|
|
360
|
+
* validate, and forward as multipart to the iMessage provider. Idempotent —
|
|
361
|
+
* re-setting replaces. Recipients on iOS < 18 fall back to the default
|
|
362
|
+
* silently.
|
|
363
|
+
*
|
|
364
|
+
* @param {AgentPhone.SetBackgroundRequest} request
|
|
365
|
+
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
366
|
+
*
|
|
367
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
368
|
+
*
|
|
369
|
+
* @example
|
|
370
|
+
* await client.conversations.setChatBackground({
|
|
371
|
+
* conversation_id: "conversation_id",
|
|
372
|
+
* image_url: "https://example.com/wallpaper.jpg"
|
|
373
|
+
* })
|
|
374
|
+
*/
|
|
375
|
+
setChatBackground(request, requestOptions) {
|
|
376
|
+
return core.HttpResponsePromise.fromPromise(this.__setChatBackground(request, requestOptions));
|
|
377
|
+
}
|
|
378
|
+
__setChatBackground(request, requestOptions) {
|
|
379
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
380
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
381
|
+
const { conversation_id: conversationId } = request, _body = __rest(request, ["conversation_id"]);
|
|
382
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
383
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
384
|
+
const _response = yield core.fetcher({
|
|
385
|
+
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)}/background`),
|
|
386
|
+
method: "POST",
|
|
387
|
+
headers: _headers,
|
|
388
|
+
contentType: "application/json",
|
|
389
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
390
|
+
requestType: "json",
|
|
391
|
+
body: _body,
|
|
392
|
+
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,
|
|
393
|
+
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,
|
|
394
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
395
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
396
|
+
logging: this._options.logging,
|
|
397
|
+
});
|
|
398
|
+
if (_response.ok) {
|
|
399
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
400
|
+
}
|
|
401
|
+
if (_response.error.reason === "status-code") {
|
|
402
|
+
switch (_response.error.statusCode) {
|
|
403
|
+
case 422:
|
|
404
|
+
throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
405
|
+
default:
|
|
406
|
+
throw new errors.AgentPhoneError({
|
|
407
|
+
statusCode: _response.error.statusCode,
|
|
408
|
+
body: _response.error.body,
|
|
409
|
+
rawResponse: _response.rawResponse,
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/conversations/{conversation_id}/background");
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Clear the custom wallpaper for the chat (iMessage only).
|
|
418
|
+
*
|
|
419
|
+
* Idempotent: deleting a default-background chat returns 204 (no-op).
|
|
420
|
+
*
|
|
421
|
+
* @param {AgentPhone.RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest} request
|
|
422
|
+
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
423
|
+
*
|
|
424
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
425
|
+
*
|
|
426
|
+
* @example
|
|
427
|
+
* await client.conversations.removeChatBackground({
|
|
428
|
+
* conversation_id: "conversation_id"
|
|
429
|
+
* })
|
|
430
|
+
*/
|
|
431
|
+
removeChatBackground(request, requestOptions) {
|
|
432
|
+
return core.HttpResponsePromise.fromPromise(this.__removeChatBackground(request, requestOptions));
|
|
433
|
+
}
|
|
434
|
+
__removeChatBackground(request, requestOptions) {
|
|
435
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
436
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
437
|
+
const { conversation_id: conversationId } = request;
|
|
438
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
439
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
440
|
+
const _response = yield core.fetcher({
|
|
441
|
+
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)}/background`),
|
|
442
|
+
method: "DELETE",
|
|
443
|
+
headers: _headers,
|
|
444
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
445
|
+
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,
|
|
446
|
+
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,
|
|
447
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
448
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
449
|
+
logging: this._options.logging,
|
|
450
|
+
});
|
|
451
|
+
if (_response.ok) {
|
|
452
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
453
|
+
}
|
|
454
|
+
if (_response.error.reason === "status-code") {
|
|
455
|
+
switch (_response.error.statusCode) {
|
|
456
|
+
case 422:
|
|
457
|
+
throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
458
|
+
default:
|
|
459
|
+
throw new errors.AgentPhoneError({
|
|
460
|
+
statusCode: _response.error.statusCode,
|
|
461
|
+
body: _response.error.body,
|
|
462
|
+
rawResponse: _response.rawResponse,
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v1/conversations/{conversation_id}/background");
|
|
467
|
+
});
|
|
468
|
+
}
|
|
356
469
|
}
|
|
357
470
|
exports.ConversationsClient = ConversationsClient;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* conversation_id: "conversation_id",
|
|
5
|
+
* image_url: "https://example.com/wallpaper.jpg"
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface SetBackgroundRequest {
|
|
9
|
+
conversation_id: string;
|
|
10
|
+
/** HTTPS URL of the background image. JPEG/PNG/GIF/WebP/HEIC, max 10MB. Recipients on iOS < 18 see the default background; no error is raised. */
|
|
11
|
+
image_url: string;
|
|
12
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export type { GetConversationMessagesV1ConversationsConversationIdMessagesGetRequest } from "./GetConversationMessagesV1ConversationsConversationIdMessagesGetRequest.js";
|
|
2
2
|
export type { GetConversationV1ConversationsConversationIdGetRequest } from "./GetConversationV1ConversationsConversationIdGetRequest.js";
|
|
3
3
|
export type { ListConversationsV1ConversationsGetRequest } from "./ListConversationsV1ConversationsGetRequest.js";
|
|
4
|
+
export type { RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest } from "./RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.js";
|
|
4
5
|
export type { SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest } from "./SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.js";
|
|
6
|
+
export type { SetBackgroundRequest } from "./SetBackgroundRequest.js";
|
|
5
7
|
export type { UpdateConversationRequest } from "./UpdateConversationRequest.js";
|
|
@@ -12,6 +12,8 @@ export * from "./contacts/client/requests/index.js";
|
|
|
12
12
|
export * as contacts from "./contacts/index.js";
|
|
13
13
|
export * from "./conversations/client/requests/index.js";
|
|
14
14
|
export * as conversations from "./conversations/index.js";
|
|
15
|
+
export * from "./integrations/client/requests/index.js";
|
|
16
|
+
export * as integrations from "./integrations/index.js";
|
|
15
17
|
export * from "./messages/client/requests/index.js";
|
|
16
18
|
export * as messages from "./messages/index.js";
|
|
17
19
|
export * from "./numbers/client/requests/index.js";
|
|
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.webhooks = exports.usage = exports.numbers = exports.messages = exports.conversations = exports.contacts = exports.contactCards = exports.calls = exports.agentWebhooks = exports.agents = exports.agentSignup = void 0;
|
|
39
|
+
exports.webhooks = exports.usage = exports.numbers = exports.messages = exports.integrations = exports.conversations = exports.contacts = exports.contactCards = exports.calls = exports.agentWebhooks = exports.agents = exports.agentSignup = void 0;
|
|
40
40
|
__exportStar(require("./agentSignup/client/requests/index.js"), exports);
|
|
41
41
|
exports.agentSignup = __importStar(require("./agentSignup/index.js"));
|
|
42
42
|
__exportStar(require("./agents/client/requests/index.js"), exports);
|
|
@@ -51,6 +51,8 @@ __exportStar(require("./contacts/client/requests/index.js"), exports);
|
|
|
51
51
|
exports.contacts = __importStar(require("./contacts/index.js"));
|
|
52
52
|
__exportStar(require("./conversations/client/requests/index.js"), exports);
|
|
53
53
|
exports.conversations = __importStar(require("./conversations/index.js"));
|
|
54
|
+
__exportStar(require("./integrations/client/requests/index.js"), exports);
|
|
55
|
+
exports.integrations = __importStar(require("./integrations/index.js"));
|
|
54
56
|
__exportStar(require("./messages/client/requests/index.js"), exports);
|
|
55
57
|
exports.messages = __importStar(require("./messages/index.js"));
|
|
56
58
|
__exportStar(require("./numbers/client/requests/index.js"), exports);
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
|
+
import * as core from "../../../../core/index.js";
|
|
4
|
+
import * as AgentPhone from "../../../index.js";
|
|
5
|
+
export declare namespace IntegrationsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class IntegrationsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<IntegrationsClient.Options>;
|
|
12
|
+
constructor(options?: IntegrationsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Exchange a one-time connect code and redirect to Supabase OAuth.
|
|
15
|
+
*
|
|
16
|
+
* @param {AgentPhone.SupabaseConnectIntegrationsSupabaseConnectGetRequest} request
|
|
17
|
+
* @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
+
*
|
|
19
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* await client.integrations.supabaseConnect({
|
|
23
|
+
* code: "code"
|
|
24
|
+
* })
|
|
25
|
+
*/
|
|
26
|
+
supabaseConnect(request: AgentPhone.SupabaseConnectIntegrationsSupabaseConnectGetRequest, requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
27
|
+
private __supabaseConnect;
|
|
28
|
+
/**
|
|
29
|
+
* Create a short-lived one-time code for initiating the Supabase OAuth flow.
|
|
30
|
+
*
|
|
31
|
+
* @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* await client.integrations.supabaseConnectCode()
|
|
35
|
+
*/
|
|
36
|
+
supabaseConnectCode(requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
37
|
+
private __supabaseConnectCode;
|
|
38
|
+
/**
|
|
39
|
+
* @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await client.integrations.supabaseStatus()
|
|
43
|
+
*/
|
|
44
|
+
supabaseStatus(requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
45
|
+
private __supabaseStatus;
|
|
46
|
+
/**
|
|
47
|
+
* Get a valid Supabase access token, auto-refreshing if expired.
|
|
48
|
+
*
|
|
49
|
+
* @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* await client.integrations.supabaseToken()
|
|
53
|
+
*/
|
|
54
|
+
supabaseToken(requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
55
|
+
private __supabaseToken;
|
|
56
|
+
/**
|
|
57
|
+
* @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* await client.integrations.supabaseDisconnect()
|
|
61
|
+
*/
|
|
62
|
+
supabaseDisconnect(requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
63
|
+
private __supabaseDisconnect;
|
|
64
|
+
}
|