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.
Files changed (84) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +13 -8
  4. package/dist/cjs/api/resources/agents/client/Client.d.ts +1 -1
  5. package/dist/cjs/api/resources/agents/client/Client.js +1 -1
  6. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +6 -0
  7. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +6 -0
  8. package/dist/cjs/api/resources/calls/client/Client.d.ts +4 -4
  9. package/dist/cjs/api/resources/calls/client/Client.js +4 -4
  10. package/dist/cjs/api/resources/conversations/client/Client.d.ts +39 -1
  11. package/dist/cjs/api/resources/conversations/client/Client.js +114 -1
  12. package/dist/cjs/api/resources/conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.d.ts +9 -0
  13. package/dist/cjs/api/resources/conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.js +3 -0
  14. package/dist/cjs/api/resources/conversations/client/requests/SetBackgroundRequest.d.ts +12 -0
  15. package/dist/cjs/api/resources/conversations/client/requests/SetBackgroundRequest.js +3 -0
  16. package/dist/cjs/api/resources/conversations/client/requests/index.d.ts +2 -0
  17. package/dist/cjs/api/resources/index.d.ts +2 -0
  18. package/dist/cjs/api/resources/index.js +3 -1
  19. package/dist/cjs/api/resources/integrations/client/Client.d.ts +64 -0
  20. package/dist/cjs/api/resources/integrations/client/Client.js +268 -0
  21. package/dist/cjs/api/resources/integrations/client/index.d.ts +1 -0
  22. package/dist/cjs/api/resources/integrations/client/index.js +17 -0
  23. package/dist/cjs/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.d.ts +9 -0
  24. package/dist/cjs/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.js +3 -0
  25. package/dist/cjs/api/resources/integrations/client/requests/index.d.ts +1 -0
  26. package/dist/cjs/api/resources/integrations/client/requests/index.js +2 -0
  27. package/dist/cjs/api/resources/integrations/index.d.ts +1 -0
  28. package/dist/cjs/api/resources/integrations/index.js +17 -0
  29. package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.d.ts +2 -0
  30. package/dist/cjs/api/resources/messages/client/requests/SendReactionRequest.d.ts +2 -14
  31. package/dist/cjs/api/resources/messages/client/requests/SendReactionRequest.js +0 -13
  32. package/dist/cjs/api/resources/messages/client/requests/index.d.ts +1 -1
  33. package/dist/cjs/api/resources/messages/client/requests/index.js +1 -3
  34. package/dist/cjs/api/types/AgentResponse.d.ts +6 -0
  35. package/dist/cjs/api/types/SendMessageResponse.d.ts +2 -0
  36. package/dist/cjs/api/types/SetBackgroundResponse.d.ts +8 -0
  37. package/dist/cjs/api/types/SetBackgroundResponse.js +3 -0
  38. package/dist/cjs/api/types/index.d.ts +1 -0
  39. package/dist/cjs/api/types/index.js +1 -0
  40. package/dist/cjs/version.d.ts +1 -1
  41. package/dist/cjs/version.js +1 -1
  42. package/dist/esm/BaseClient.mjs +2 -2
  43. package/dist/esm/Client.d.mts +3 -0
  44. package/dist/esm/Client.mjs +5 -0
  45. package/dist/esm/api/resources/agents/client/Client.d.mts +1 -1
  46. package/dist/esm/api/resources/agents/client/Client.mjs +1 -1
  47. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +6 -0
  48. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +6 -0
  49. package/dist/esm/api/resources/calls/client/Client.d.mts +4 -4
  50. package/dist/esm/api/resources/calls/client/Client.mjs +4 -4
  51. package/dist/esm/api/resources/conversations/client/Client.d.mts +39 -1
  52. package/dist/esm/api/resources/conversations/client/Client.mjs +114 -1
  53. package/dist/esm/api/resources/conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.d.mts +9 -0
  54. package/dist/esm/api/resources/conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.mjs +2 -0
  55. package/dist/esm/api/resources/conversations/client/requests/SetBackgroundRequest.d.mts +12 -0
  56. package/dist/esm/api/resources/conversations/client/requests/SetBackgroundRequest.mjs +2 -0
  57. package/dist/esm/api/resources/conversations/client/requests/index.d.mts +2 -0
  58. package/dist/esm/api/resources/index.d.mts +2 -0
  59. package/dist/esm/api/resources/index.mjs +2 -0
  60. package/dist/esm/api/resources/integrations/client/Client.d.mts +64 -0
  61. package/dist/esm/api/resources/integrations/client/Client.mjs +231 -0
  62. package/dist/esm/api/resources/integrations/client/index.d.mts +1 -0
  63. package/dist/esm/api/resources/integrations/client/index.mjs +1 -0
  64. package/dist/esm/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.d.mts +9 -0
  65. package/dist/esm/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.mjs +2 -0
  66. package/dist/esm/api/resources/integrations/client/requests/index.d.mts +1 -0
  67. package/dist/esm/api/resources/integrations/client/requests/index.mjs +1 -0
  68. package/dist/esm/api/resources/integrations/index.d.mts +1 -0
  69. package/dist/esm/api/resources/integrations/index.mjs +1 -0
  70. package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.d.mts +2 -0
  71. package/dist/esm/api/resources/messages/client/requests/SendReactionRequest.d.mts +2 -14
  72. package/dist/esm/api/resources/messages/client/requests/SendReactionRequest.mjs +1 -12
  73. package/dist/esm/api/resources/messages/client/requests/index.d.mts +1 -1
  74. package/dist/esm/api/resources/messages/client/requests/index.mjs +0 -1
  75. package/dist/esm/api/types/AgentResponse.d.mts +6 -0
  76. package/dist/esm/api/types/SendMessageResponse.d.mts +2 -0
  77. package/dist/esm/api/types/SetBackgroundResponse.d.mts +8 -0
  78. package/dist/esm/api/types/SetBackgroundResponse.mjs +2 -0
  79. package/dist/esm/api/types/index.d.mts +1 -0
  80. package/dist/esm/api/types/index.mjs +1 -0
  81. package/dist/esm/version.d.mts +1 -1
  82. package/dist/esm/version.mjs +1 -1
  83. package/package.json +1 -1
  84. package/reference.md +402 -6
@@ -0,0 +1,268 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.IntegrationsClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
48
+ const headers_js_1 = require("../../../../core/headers.js");
49
+ const core = __importStar(require("../../../../core/index.js"));
50
+ const environments = __importStar(require("../../../../environments.js"));
51
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
52
+ const errors = __importStar(require("../../../../errors/index.js"));
53
+ const AgentPhone = __importStar(require("../../../index.js"));
54
+ class IntegrationsClient {
55
+ constructor(options = {}) {
56
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
+ }
58
+ /**
59
+ * Exchange a one-time connect code and redirect to Supabase OAuth.
60
+ *
61
+ * @param {AgentPhone.SupabaseConnectIntegrationsSupabaseConnectGetRequest} request
62
+ * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
63
+ *
64
+ * @throws {@link AgentPhone.UnprocessableEntityError}
65
+ *
66
+ * @example
67
+ * await client.integrations.supabaseConnect({
68
+ * code: "code"
69
+ * })
70
+ */
71
+ supabaseConnect(request, requestOptions) {
72
+ return core.HttpResponsePromise.fromPromise(this.__supabaseConnect(request, requestOptions));
73
+ }
74
+ __supabaseConnect(request, requestOptions) {
75
+ return __awaiter(this, void 0, void 0, function* () {
76
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
77
+ const { code } = request;
78
+ const _queryParams = {
79
+ code,
80
+ };
81
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
82
+ const _response = yield core.fetcher({
83
+ 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, "integrations/supabase/connect"),
84
+ method: "GET",
85
+ headers: _headers,
86
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
87
+ 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,
88
+ 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,
89
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
90
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
91
+ logging: this._options.logging,
92
+ });
93
+ if (_response.ok) {
94
+ return { data: _response.body, rawResponse: _response.rawResponse };
95
+ }
96
+ if (_response.error.reason === "status-code") {
97
+ switch (_response.error.statusCode) {
98
+ case 422:
99
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
100
+ default:
101
+ throw new errors.AgentPhoneError({
102
+ statusCode: _response.error.statusCode,
103
+ body: _response.error.body,
104
+ rawResponse: _response.rawResponse,
105
+ });
106
+ }
107
+ }
108
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/integrations/supabase/connect");
109
+ });
110
+ }
111
+ /**
112
+ * Create a short-lived one-time code for initiating the Supabase OAuth flow.
113
+ *
114
+ * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
115
+ *
116
+ * @example
117
+ * await client.integrations.supabaseConnectCode()
118
+ */
119
+ supabaseConnectCode(requestOptions) {
120
+ return core.HttpResponsePromise.fromPromise(this.__supabaseConnectCode(requestOptions));
121
+ }
122
+ __supabaseConnectCode(requestOptions) {
123
+ return __awaiter(this, void 0, void 0, function* () {
124
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
125
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
126
+ 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);
127
+ const _response = yield core.fetcher({
128
+ 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, "integrations/supabase/connect"),
129
+ method: "POST",
130
+ headers: _headers,
131
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
132
+ 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,
133
+ 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,
134
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
135
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
136
+ logging: this._options.logging,
137
+ });
138
+ if (_response.ok) {
139
+ return { data: _response.body, rawResponse: _response.rawResponse };
140
+ }
141
+ if (_response.error.reason === "status-code") {
142
+ throw new errors.AgentPhoneError({
143
+ statusCode: _response.error.statusCode,
144
+ body: _response.error.body,
145
+ rawResponse: _response.rawResponse,
146
+ });
147
+ }
148
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/integrations/supabase/connect");
149
+ });
150
+ }
151
+ /**
152
+ * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
153
+ *
154
+ * @example
155
+ * await client.integrations.supabaseStatus()
156
+ */
157
+ supabaseStatus(requestOptions) {
158
+ return core.HttpResponsePromise.fromPromise(this.__supabaseStatus(requestOptions));
159
+ }
160
+ __supabaseStatus(requestOptions) {
161
+ return __awaiter(this, void 0, void 0, function* () {
162
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
163
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
164
+ 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);
165
+ const _response = yield core.fetcher({
166
+ 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, "integrations/supabase/status"),
167
+ method: "GET",
168
+ headers: _headers,
169
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
170
+ 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,
171
+ 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,
172
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
173
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
174
+ logging: this._options.logging,
175
+ });
176
+ if (_response.ok) {
177
+ return { data: _response.body, rawResponse: _response.rawResponse };
178
+ }
179
+ if (_response.error.reason === "status-code") {
180
+ throw new errors.AgentPhoneError({
181
+ statusCode: _response.error.statusCode,
182
+ body: _response.error.body,
183
+ rawResponse: _response.rawResponse,
184
+ });
185
+ }
186
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/integrations/supabase/status");
187
+ });
188
+ }
189
+ /**
190
+ * Get a valid Supabase access token, auto-refreshing if expired.
191
+ *
192
+ * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
193
+ *
194
+ * @example
195
+ * await client.integrations.supabaseToken()
196
+ */
197
+ supabaseToken(requestOptions) {
198
+ return core.HttpResponsePromise.fromPromise(this.__supabaseToken(requestOptions));
199
+ }
200
+ __supabaseToken(requestOptions) {
201
+ return __awaiter(this, void 0, void 0, function* () {
202
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
203
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
204
+ 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);
205
+ const _response = yield core.fetcher({
206
+ 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, "integrations/supabase/token"),
207
+ method: "GET",
208
+ headers: _headers,
209
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
210
+ 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,
211
+ 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,
212
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
213
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
214
+ logging: this._options.logging,
215
+ });
216
+ if (_response.ok) {
217
+ return { data: _response.body, rawResponse: _response.rawResponse };
218
+ }
219
+ if (_response.error.reason === "status-code") {
220
+ throw new errors.AgentPhoneError({
221
+ statusCode: _response.error.statusCode,
222
+ body: _response.error.body,
223
+ rawResponse: _response.rawResponse,
224
+ });
225
+ }
226
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/integrations/supabase/token");
227
+ });
228
+ }
229
+ /**
230
+ * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
231
+ *
232
+ * @example
233
+ * await client.integrations.supabaseDisconnect()
234
+ */
235
+ supabaseDisconnect(requestOptions) {
236
+ return core.HttpResponsePromise.fromPromise(this.__supabaseDisconnect(requestOptions));
237
+ }
238
+ __supabaseDisconnect(requestOptions) {
239
+ return __awaiter(this, void 0, void 0, function* () {
240
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
241
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
242
+ 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);
243
+ const _response = yield core.fetcher({
244
+ 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, "integrations/supabase"),
245
+ method: "DELETE",
246
+ headers: _headers,
247
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
248
+ 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,
249
+ 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,
250
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
251
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
252
+ logging: this._options.logging,
253
+ });
254
+ if (_response.ok) {
255
+ return { data: _response.body, rawResponse: _response.rawResponse };
256
+ }
257
+ if (_response.error.reason === "status-code") {
258
+ throw new errors.AgentPhoneError({
259
+ statusCode: _response.error.statusCode,
260
+ body: _response.error.body,
261
+ rawResponse: _response.rawResponse,
262
+ });
263
+ }
264
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/integrations/supabase");
265
+ });
266
+ }
267
+ }
268
+ exports.IntegrationsClient = IntegrationsClient;
@@ -0,0 +1 @@
1
+ export * from "./requests/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("./requests/index.js"), exports);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * code: "code"
5
+ * }
6
+ */
7
+ export interface SupabaseConnectIntegrationsSupabaseConnectGetRequest {
8
+ code: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type { SupabaseConnectIntegrationsSupabaseConnectGetRequest } from "./SupabaseConnectIntegrationsSupabaseConnectGetRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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);
@@ -15,6 +15,8 @@ export interface SendMessageRequest {
15
15
  number_id?: string | null;
16
16
  /** Optional iMessage expressive effect. Only valid on iMessage-capable numbers. Supported values: celebration, fireworks, lasers, love, confetti, balloons, spotlight, echo, invisible, gentle, loud, slam. */
17
17
  send_style?: SendMessageRequest.SendStyle;
18
+ /** Optional parent message ID (AgentPhone Message.id) to send this message as an inline reply in iMessage. */
19
+ reply_to_message_id?: string | null;
18
20
  }
19
21
  export declare namespace SendMessageRequest {
20
22
  /** Optional iMessage expressive effect. Only valid on iMessage-capable numbers. Supported values: celebration, fireworks, lasers, love, confetti, balloons, spotlight, echo, invisible, gentle, loud, slam. */
@@ -7,18 +7,6 @@
7
7
  */
8
8
  export interface SendReactionRequest {
9
9
  message_id: string;
10
- /** iMessage tapback reaction to send. Supported values are: love, like, dislike, laugh, emphasize, question. */
11
- reaction: SendReactionRequest.Reaction;
12
- }
13
- export declare namespace SendReactionRequest {
14
- /** iMessage tapback reaction to send. Supported values are: love, like, dislike, laugh, emphasize, question. */
15
- const Reaction: {
16
- readonly Love: "love";
17
- readonly Like: "like";
18
- readonly Dislike: "dislike";
19
- readonly Laugh: "laugh";
20
- readonly Emphasize: "emphasize";
21
- readonly Question: "question";
22
- };
23
- type Reaction = (typeof Reaction)[keyof typeof Reaction];
10
+ /** iMessage reaction to send. Classic tapbacks (love, like, dislike, laugh, emphasize, question) are supported on every iMessage line. Custom emoji reactions (e.g. "🔥", "😂", "👍") are supported on newer lines only; lines that don't support them return a 400 with upgrade instructions. Custom emoji also require the recipient to be on macOS 14 / iOS 17 or later. */
11
+ reaction: string;
24
12
  }
@@ -1,16 +1,3 @@
1
1
  "use strict";
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.SendReactionRequest = void 0;
5
- var SendReactionRequest;
6
- (function (SendReactionRequest) {
7
- /** iMessage tapback reaction to send. Supported values are: love, like, dislike, laugh, emphasize, question. */
8
- SendReactionRequest.Reaction = {
9
- Love: "love",
10
- Like: "like",
11
- Dislike: "dislike",
12
- Laugh: "laugh",
13
- Emphasize: "emphasize",
14
- Question: "question",
15
- };
16
- })(SendReactionRequest || (exports.SendReactionRequest = SendReactionRequest = {}));
@@ -1,2 +1,2 @@
1
1
  export { SendMessageRequest } from "./SendMessageRequest.js";
2
- export { SendReactionRequest } from "./SendReactionRequest.js";
2
+ export type { SendReactionRequest } from "./SendReactionRequest.js";
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SendReactionRequest = exports.SendMessageRequest = void 0;
3
+ exports.SendMessageRequest = void 0;
4
4
  var SendMessageRequest_js_1 = require("./SendMessageRequest.js");
5
5
  Object.defineProperty(exports, "SendMessageRequest", { enumerable: true, get: function () { return SendMessageRequest_js_1.SendMessageRequest; } });
6
- var SendReactionRequest_js_1 = require("./SendReactionRequest.js");
7
- Object.defineProperty(exports, "SendReactionRequest", { enumerable: true, get: function () { return SendReactionRequest_js_1.SendReactionRequest; } });
@@ -19,6 +19,12 @@ export interface AgentResponse {
19
19
  denoisingMode?: AgentResponse.DenoisingMode;
20
20
  /** Hang up the call after this many milliseconds of caller silence. Range 10000 (10s) to 3600000 (1 hour). Default 600000 (10 min). */
21
21
  maxSilenceMs?: number;
22
+ /** Voice speed multiplier. Range 0.5 to 2.0. Default 1.0. */
23
+ voiceSpeed?: number;
24
+ /** How easily callers can interrupt the agent. Range 0.0 to 1.0. Default 0.8. */
25
+ interruptionSensitivity?: number;
26
+ /** When true, the agent interjects short filler words like 'uh-huh' or 'mhmm' during longer caller utterances. Defaults to true. */
27
+ enableBackchannel?: boolean;
22
28
  createdAt: string;
23
29
  numbers?: AgentPhone.AgentNumberResponse[] | null;
24
30
  }
@@ -5,4 +5,6 @@ export interface SendMessageResponse {
5
5
  from_number: string;
6
6
  to_number: string;
7
7
  media_urls?: string[];
8
+ reply_to_message_id?: string | null;
9
+ reply_parent_unresolved?: boolean | null;
8
10
  }
@@ -0,0 +1,8 @@
1
+ export interface SetBackgroundResponse {
2
+ conversationId: string;
3
+ channel: string;
4
+ hasBackground: boolean;
5
+ backgroundId?: string | null;
6
+ backgroundVersion?: number | null;
7
+ changed: boolean;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -37,6 +37,7 @@ export * from "./ReactionInConversation.js";
37
37
  export * from "./SendMessageResponse.js";
38
38
  export * from "./SendReactionResponse.js";
39
39
  export * from "./SendTypingResponse.js";
40
+ export * from "./SetBackgroundResponse.js";
40
41
  export * from "./UsageResponse.js";
41
42
  export * from "./UsageStats.js";
42
43
  export * from "./ValidationError.js";
@@ -53,6 +53,7 @@ __exportStar(require("./ReactionInConversation.js"), exports);
53
53
  __exportStar(require("./SendMessageResponse.js"), exports);
54
54
  __exportStar(require("./SendReactionResponse.js"), exports);
55
55
  __exportStar(require("./SendTypingResponse.js"), exports);
56
+ __exportStar(require("./SetBackgroundResponse.js"), exports);
56
57
  __exportStar(require("./UsageResponse.js"), exports);
57
58
  __exportStar(require("./UsageStats.js"), exports);
58
59
  __exportStar(require("./ValidationError.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.10";
1
+ export declare const SDK_VERSION = "1.0.11";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.0.10";
4
+ exports.SDK_VERSION = "1.0.11";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "agentphone",
9
- "X-Fern-SDK-Version": "1.0.10",
10
- "User-Agent": "agentphone/1.0.10",
9
+ "X-Fern-SDK-Version": "1.0.11",
10
+ "User-Agent": "agentphone/1.0.11",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -5,6 +5,7 @@ import { CallsClient } from "./api/resources/calls/client/Client.mjs";
5
5
  import { ContactCardsClient } from "./api/resources/contactCards/client/Client.mjs";
6
6
  import { ContactsClient } from "./api/resources/contacts/client/Client.mjs";
7
7
  import { ConversationsClient } from "./api/resources/conversations/client/Client.mjs";
8
+ import { IntegrationsClient } from "./api/resources/integrations/client/Client.mjs";
8
9
  import { MessagesClient } from "./api/resources/messages/client/Client.mjs";
9
10
  import { NumbersClient } from "./api/resources/numbers/client/Client.mjs";
10
11
  import { UsageClient } from "./api/resources/usage/client/Client.mjs";
@@ -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
  }
@@ -6,6 +6,7 @@ import { CallsClient } from "./api/resources/calls/client/Client.mjs";
6
6
  import { ContactCardsClient } from "./api/resources/contactCards/client/Client.mjs";
7
7
  import { ContactsClient } from "./api/resources/contacts/client/Client.mjs";
8
8
  import { ConversationsClient } from "./api/resources/conversations/client/Client.mjs";
9
+ import { IntegrationsClient } from "./api/resources/integrations/client/Client.mjs";
9
10
  import { MessagesClient } from "./api/resources/messages/client/Client.mjs";
10
11
  import { NumbersClient } from "./api/resources/numbers/client/Client.mjs";
11
12
  import { UsageClient } from "./api/resources/usage/client/Client.mjs";
@@ -51,6 +52,10 @@ export class AgentPhoneClient {
51
52
  var _a;
52
53
  return ((_a = this._usage) !== null && _a !== void 0 ? _a : (this._usage = new UsageClient(this._options)));
53
54
  }
55
+ get integrations() {
56
+ var _a;
57
+ return ((_a = this._integrations) !== null && _a !== void 0 ? _a : (this._integrations = new IntegrationsClient(this._options)));
58
+ }
54
59
  get messages() {
55
60
  var _a;
56
61
  return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new MessagesClient(this._options)));
@@ -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 call provider (Retell).
14
+ * Return available voices from the configured voice provider.
15
15
  *
16
16
  * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
17
17
  *
@@ -31,7 +31,7 @@ export class AgentsClient {
31
31
  this._options = normalizeClientOptionsWithAuth(options);
32
32
  }
33
33
  /**
34
- * Return available voices from the call provider (Retell).
34
+ * Return available voices from the configured voice provider.
35
35
  *
36
36
  * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
37
37
  *
@@ -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. The call_ended
97
- * webhook from Retell updates status/endedAt asynchronously, so this
98
- * endpoint returns the current call as soon as the stop request is
99
- * accepted by Retell.
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.
@@ -258,10 +258,10 @@ export class CallsClient {
258
258
  /**
259
259
  * Terminate an ongoing call.
260
260
  *
261
- * Works for both hosted-mode and webhook-mode calls. The call_ended
262
- * webhook from Retell updates status/endedAt asynchronously, so this
263
- * endpoint returns the current call as soon as the stop request is
264
- * accepted by Retell.
261
+ * Works for both hosted-mode and webhook-mode calls. The call_ended
262
+ * webhook from the voice provider updates status/endedAt asynchronously,
263
+ * so this endpoint returns the current call as soon as the stop request
264
+ * is accepted upstream.
265
265
  *
266
266
  * @param {AgentPhone.EndCallV1CallsCallIdEndPostRequest} request
267
267
  * @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.