agentphone 1.0.9 → 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 +6 -0
- package/dist/cjs/Client.js +22 -12
- package/dist/cjs/api/resources/agentSignup/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/agentSignup/client/Client.js +1 -1
- 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 +8 -0
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +8 -0
- package/dist/cjs/api/resources/calls/client/Client.d.ts +20 -0
- package/dist/cjs/api/resources/calls/client/Client.js +56 -0
- package/dist/cjs/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.d.ts +9 -0
- package/dist/cjs/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.js +3 -0
- package/dist/cjs/api/resources/calls/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/contactCards/client/Client.d.ts +61 -0
- package/dist/cjs/api/resources/contactCards/client/Client.js +229 -0
- package/dist/cjs/api/resources/contactCards/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/contactCards/client/index.js +17 -0
- package/dist/cjs/api/resources/contactCards/client/requests/ContactCardWriteRequest.d.ts +16 -0
- package/dist/cjs/api/resources/contactCards/client/requests/ContactCardWriteRequest.js +3 -0
- package/dist/cjs/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.d.ts +9 -0
- package/dist/cjs/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.js +3 -0
- package/dist/cjs/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.d.ts +9 -0
- package/dist/cjs/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.js +3 -0
- package/dist/cjs/api/resources/contactCards/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/contactCards/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/contactCards/index.d.ts +1 -0
- package/dist/cjs/api/resources/contactCards/index.js +17 -0
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +39 -0
- package/dist/cjs/api/resources/conversations/client/Client.js +114 -0
- 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 +4 -0
- package/dist/cjs/api/resources/index.js +5 -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/Client.d.ts +10 -11
- package/dist/cjs/api/resources/messages/client/Client.js +10 -11
- package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.d.ts +22 -0
- package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.js +19 -0
- package/dist/cjs/api/resources/messages/client/requests/SendReactionRequest.d.ts +2 -1
- package/dist/cjs/api/resources/messages/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/messages/client/requests/index.js +3 -0
- package/dist/cjs/api/resources/numbers/client/Client.d.ts +4 -4
- package/dist/cjs/api/resources/numbers/client/Client.js +4 -4
- package/dist/cjs/api/types/AgentResponse.d.ts +7 -0
- package/dist/cjs/api/types/ContactCardResponse.d.ts +6 -0
- package/dist/cjs/api/types/ContactCardResponse.js +3 -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 +2 -0
- package/dist/cjs/api/types/index.js +2 -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/agentSignup/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/agentSignup/client/Client.mjs +1 -1
- 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 +8 -0
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +8 -0
- package/dist/esm/api/resources/calls/client/Client.d.mts +20 -0
- package/dist/esm/api/resources/calls/client/Client.mjs +56 -0
- package/dist/esm/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.d.mts +9 -0
- package/dist/esm/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.mjs +2 -0
- package/dist/esm/api/resources/calls/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/contactCards/client/Client.d.mts +61 -0
- package/dist/esm/api/resources/contactCards/client/Client.mjs +192 -0
- package/dist/esm/api/resources/contactCards/client/index.d.mts +1 -0
- package/dist/esm/api/resources/contactCards/client/index.mjs +1 -0
- package/dist/esm/api/resources/contactCards/client/requests/ContactCardWriteRequest.d.mts +16 -0
- package/dist/esm/api/resources/contactCards/client/requests/ContactCardWriteRequest.mjs +2 -0
- package/dist/esm/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.d.mts +9 -0
- package/dist/esm/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.mjs +2 -0
- package/dist/esm/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.d.mts +9 -0
- package/dist/esm/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.mjs +2 -0
- package/dist/esm/api/resources/contactCards/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/contactCards/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/contactCards/index.d.mts +1 -0
- package/dist/esm/api/resources/contactCards/index.mjs +1 -0
- package/dist/esm/api/resources/conversations/client/Client.d.mts +39 -0
- package/dist/esm/api/resources/conversations/client/Client.mjs +114 -0
- 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 +4 -0
- package/dist/esm/api/resources/index.mjs +4 -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/Client.d.mts +10 -11
- package/dist/esm/api/resources/messages/client/Client.mjs +10 -11
- package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.d.mts +22 -0
- package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.mjs +18 -1
- package/dist/esm/api/resources/messages/client/requests/SendReactionRequest.d.mts +2 -1
- package/dist/esm/api/resources/messages/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/messages/client/requests/index.mjs +1 -1
- package/dist/esm/api/resources/numbers/client/Client.d.mts +4 -4
- package/dist/esm/api/resources/numbers/client/Client.mjs +4 -4
- package/dist/esm/api/types/AgentResponse.d.mts +7 -0
- package/dist/esm/api/types/ContactCardResponse.d.mts +6 -0
- package/dist/esm/api/types/ContactCardResponse.mjs +2 -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 +2 -0
- package/dist/esm/api/types/index.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +709 -44
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { ContactCardWriteRequest } from "./ContactCardWriteRequest.js";
|
|
2
|
+
export type { DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest } from "./DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.js";
|
|
3
|
+
export type { GetContactCardV1NumbersNumberIdContactCardGetRequest } from "./GetContactCardV1NumbersNumberIdContactCardGetRequest.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -14,6 +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
|
+
* Sorted by most recent activity.
|
|
17
18
|
*
|
|
18
19
|
* @param {AgentPhone.ListConversationsV1ConversationsGetRequest} request
|
|
19
20
|
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -98,4 +99,42 @@ export declare class ConversationsClient {
|
|
|
98
99
|
*/
|
|
99
100
|
sendTypingIndicator(request: AgentPhone.SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest, requestOptions?: ConversationsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.SendTypingResponse>;
|
|
100
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;
|
|
101
140
|
}
|
|
@@ -70,6 +70,7 @@ class ConversationsClient {
|
|
|
70
70
|
* List all conversations for this account.
|
|
71
71
|
*
|
|
72
72
|
* Sorted by most recent activity (lastMessageAt desc).
|
|
73
|
+
* Sorted by most recent activity.
|
|
73
74
|
*
|
|
74
75
|
* @param {AgentPhone.ListConversationsV1ConversationsGetRequest} request
|
|
75
76
|
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -352,5 +353,118 @@ class ConversationsClient {
|
|
|
352
353
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/conversations/{conversation_id}/typing");
|
|
353
354
|
});
|
|
354
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
|
+
}
|
|
355
469
|
}
|
|
356
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";
|
|
@@ -6,10 +6,14 @@ export * from "./agentWebhooks/client/requests/index.js";
|
|
|
6
6
|
export * as agentWebhooks from "./agentWebhooks/index.js";
|
|
7
7
|
export * from "./calls/client/requests/index.js";
|
|
8
8
|
export * as calls from "./calls/index.js";
|
|
9
|
+
export * from "./contactCards/client/requests/index.js";
|
|
10
|
+
export * as contactCards from "./contactCards/index.js";
|
|
9
11
|
export * from "./contacts/client/requests/index.js";
|
|
10
12
|
export * as contacts from "./contacts/index.js";
|
|
11
13
|
export * from "./conversations/client/requests/index.js";
|
|
12
14
|
export * as conversations from "./conversations/index.js";
|
|
15
|
+
export * from "./integrations/client/requests/index.js";
|
|
16
|
+
export * as integrations from "./integrations/index.js";
|
|
13
17
|
export * from "./messages/client/requests/index.js";
|
|
14
18
|
export * as messages from "./messages/index.js";
|
|
15
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.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);
|
|
@@ -45,10 +45,14 @@ __exportStar(require("./agentWebhooks/client/requests/index.js"), exports);
|
|
|
45
45
|
exports.agentWebhooks = __importStar(require("./agentWebhooks/index.js"));
|
|
46
46
|
__exportStar(require("./calls/client/requests/index.js"), exports);
|
|
47
47
|
exports.calls = __importStar(require("./calls/index.js"));
|
|
48
|
+
__exportStar(require("./contactCards/client/requests/index.js"), exports);
|
|
49
|
+
exports.contactCards = __importStar(require("./contactCards/index.js"));
|
|
48
50
|
__exportStar(require("./contacts/client/requests/index.js"), exports);
|
|
49
51
|
exports.contacts = __importStar(require("./contacts/index.js"));
|
|
50
52
|
__exportStar(require("./conversations/client/requests/index.js"), exports);
|
|
51
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"));
|
|
52
56
|
__exportStar(require("./messages/client/requests/index.js"), exports);
|
|
53
57
|
exports.messages = __importStar(require("./messages/index.js"));
|
|
54
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
|
+
}
|