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.
Files changed (134) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +6 -0
  3. package/dist/cjs/Client.js +22 -12
  4. package/dist/cjs/api/resources/agentSignup/client/Client.d.ts +1 -1
  5. package/dist/cjs/api/resources/agentSignup/client/Client.js +1 -1
  6. package/dist/cjs/api/resources/agents/client/Client.d.ts +1 -1
  7. package/dist/cjs/api/resources/agents/client/Client.js +1 -1
  8. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +8 -0
  9. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +8 -0
  10. package/dist/cjs/api/resources/calls/client/Client.d.ts +20 -0
  11. package/dist/cjs/api/resources/calls/client/Client.js +56 -0
  12. package/dist/cjs/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.d.ts +9 -0
  13. package/dist/cjs/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.js +3 -0
  14. package/dist/cjs/api/resources/calls/client/requests/index.d.ts +1 -0
  15. package/dist/cjs/api/resources/contactCards/client/Client.d.ts +61 -0
  16. package/dist/cjs/api/resources/contactCards/client/Client.js +229 -0
  17. package/dist/cjs/api/resources/contactCards/client/index.d.ts +1 -0
  18. package/dist/cjs/api/resources/contactCards/client/index.js +17 -0
  19. package/dist/cjs/api/resources/contactCards/client/requests/ContactCardWriteRequest.d.ts +16 -0
  20. package/dist/cjs/api/resources/contactCards/client/requests/ContactCardWriteRequest.js +3 -0
  21. package/dist/cjs/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.d.ts +9 -0
  22. package/dist/cjs/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.js +3 -0
  23. package/dist/cjs/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.d.ts +9 -0
  24. package/dist/cjs/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.js +3 -0
  25. package/dist/cjs/api/resources/contactCards/client/requests/index.d.ts +3 -0
  26. package/dist/cjs/api/resources/contactCards/client/requests/index.js +2 -0
  27. package/dist/cjs/api/resources/contactCards/index.d.ts +1 -0
  28. package/dist/cjs/api/resources/contactCards/index.js +17 -0
  29. package/dist/cjs/api/resources/conversations/client/Client.d.ts +39 -0
  30. package/dist/cjs/api/resources/conversations/client/Client.js +114 -0
  31. package/dist/cjs/api/resources/conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.d.ts +9 -0
  32. package/dist/cjs/api/resources/conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.js +3 -0
  33. package/dist/cjs/api/resources/conversations/client/requests/SetBackgroundRequest.d.ts +12 -0
  34. package/dist/cjs/api/resources/conversations/client/requests/SetBackgroundRequest.js +3 -0
  35. package/dist/cjs/api/resources/conversations/client/requests/index.d.ts +2 -0
  36. package/dist/cjs/api/resources/index.d.ts +4 -0
  37. package/dist/cjs/api/resources/index.js +5 -1
  38. package/dist/cjs/api/resources/integrations/client/Client.d.ts +64 -0
  39. package/dist/cjs/api/resources/integrations/client/Client.js +268 -0
  40. package/dist/cjs/api/resources/integrations/client/index.d.ts +1 -0
  41. package/dist/cjs/api/resources/integrations/client/index.js +17 -0
  42. package/dist/cjs/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.d.ts +9 -0
  43. package/dist/cjs/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.js +3 -0
  44. package/dist/cjs/api/resources/integrations/client/requests/index.d.ts +1 -0
  45. package/dist/cjs/api/resources/integrations/client/requests/index.js +2 -0
  46. package/dist/cjs/api/resources/integrations/index.d.ts +1 -0
  47. package/dist/cjs/api/resources/integrations/index.js +17 -0
  48. package/dist/cjs/api/resources/messages/client/Client.d.ts +10 -11
  49. package/dist/cjs/api/resources/messages/client/Client.js +10 -11
  50. package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.d.ts +22 -0
  51. package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.js +19 -0
  52. package/dist/cjs/api/resources/messages/client/requests/SendReactionRequest.d.ts +2 -1
  53. package/dist/cjs/api/resources/messages/client/requests/index.d.ts +1 -1
  54. package/dist/cjs/api/resources/messages/client/requests/index.js +3 -0
  55. package/dist/cjs/api/resources/numbers/client/Client.d.ts +4 -4
  56. package/dist/cjs/api/resources/numbers/client/Client.js +4 -4
  57. package/dist/cjs/api/types/AgentResponse.d.ts +7 -0
  58. package/dist/cjs/api/types/ContactCardResponse.d.ts +6 -0
  59. package/dist/cjs/api/types/ContactCardResponse.js +3 -0
  60. package/dist/cjs/api/types/SendMessageResponse.d.ts +2 -0
  61. package/dist/cjs/api/types/SetBackgroundResponse.d.ts +8 -0
  62. package/dist/cjs/api/types/SetBackgroundResponse.js +3 -0
  63. package/dist/cjs/api/types/index.d.ts +2 -0
  64. package/dist/cjs/api/types/index.js +2 -0
  65. package/dist/cjs/version.d.ts +1 -1
  66. package/dist/cjs/version.js +1 -1
  67. package/dist/esm/BaseClient.mjs +2 -2
  68. package/dist/esm/Client.d.mts +6 -0
  69. package/dist/esm/Client.mjs +10 -0
  70. package/dist/esm/api/resources/agentSignup/client/Client.d.mts +1 -1
  71. package/dist/esm/api/resources/agentSignup/client/Client.mjs +1 -1
  72. package/dist/esm/api/resources/agents/client/Client.d.mts +1 -1
  73. package/dist/esm/api/resources/agents/client/Client.mjs +1 -1
  74. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +8 -0
  75. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +8 -0
  76. package/dist/esm/api/resources/calls/client/Client.d.mts +20 -0
  77. package/dist/esm/api/resources/calls/client/Client.mjs +56 -0
  78. package/dist/esm/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.d.mts +9 -0
  79. package/dist/esm/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.mjs +2 -0
  80. package/dist/esm/api/resources/calls/client/requests/index.d.mts +1 -0
  81. package/dist/esm/api/resources/contactCards/client/Client.d.mts +61 -0
  82. package/dist/esm/api/resources/contactCards/client/Client.mjs +192 -0
  83. package/dist/esm/api/resources/contactCards/client/index.d.mts +1 -0
  84. package/dist/esm/api/resources/contactCards/client/index.mjs +1 -0
  85. package/dist/esm/api/resources/contactCards/client/requests/ContactCardWriteRequest.d.mts +16 -0
  86. package/dist/esm/api/resources/contactCards/client/requests/ContactCardWriteRequest.mjs +2 -0
  87. package/dist/esm/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.d.mts +9 -0
  88. package/dist/esm/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.mjs +2 -0
  89. package/dist/esm/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.d.mts +9 -0
  90. package/dist/esm/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.mjs +2 -0
  91. package/dist/esm/api/resources/contactCards/client/requests/index.d.mts +3 -0
  92. package/dist/esm/api/resources/contactCards/client/requests/index.mjs +1 -0
  93. package/dist/esm/api/resources/contactCards/index.d.mts +1 -0
  94. package/dist/esm/api/resources/contactCards/index.mjs +1 -0
  95. package/dist/esm/api/resources/conversations/client/Client.d.mts +39 -0
  96. package/dist/esm/api/resources/conversations/client/Client.mjs +114 -0
  97. package/dist/esm/api/resources/conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.d.mts +9 -0
  98. package/dist/esm/api/resources/conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.mjs +2 -0
  99. package/dist/esm/api/resources/conversations/client/requests/SetBackgroundRequest.d.mts +12 -0
  100. package/dist/esm/api/resources/conversations/client/requests/SetBackgroundRequest.mjs +2 -0
  101. package/dist/esm/api/resources/conversations/client/requests/index.d.mts +2 -0
  102. package/dist/esm/api/resources/index.d.mts +4 -0
  103. package/dist/esm/api/resources/index.mjs +4 -0
  104. package/dist/esm/api/resources/integrations/client/Client.d.mts +64 -0
  105. package/dist/esm/api/resources/integrations/client/Client.mjs +231 -0
  106. package/dist/esm/api/resources/integrations/client/index.d.mts +1 -0
  107. package/dist/esm/api/resources/integrations/client/index.mjs +1 -0
  108. package/dist/esm/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.d.mts +9 -0
  109. package/dist/esm/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.mjs +2 -0
  110. package/dist/esm/api/resources/integrations/client/requests/index.d.mts +1 -0
  111. package/dist/esm/api/resources/integrations/client/requests/index.mjs +1 -0
  112. package/dist/esm/api/resources/integrations/index.d.mts +1 -0
  113. package/dist/esm/api/resources/integrations/index.mjs +1 -0
  114. package/dist/esm/api/resources/messages/client/Client.d.mts +10 -11
  115. package/dist/esm/api/resources/messages/client/Client.mjs +10 -11
  116. package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.d.mts +22 -0
  117. package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.mjs +18 -1
  118. package/dist/esm/api/resources/messages/client/requests/SendReactionRequest.d.mts +2 -1
  119. package/dist/esm/api/resources/messages/client/requests/index.d.mts +1 -1
  120. package/dist/esm/api/resources/messages/client/requests/index.mjs +1 -1
  121. package/dist/esm/api/resources/numbers/client/Client.d.mts +4 -4
  122. package/dist/esm/api/resources/numbers/client/Client.mjs +4 -4
  123. package/dist/esm/api/types/AgentResponse.d.mts +7 -0
  124. package/dist/esm/api/types/ContactCardResponse.d.mts +6 -0
  125. package/dist/esm/api/types/ContactCardResponse.mjs +2 -0
  126. package/dist/esm/api/types/SendMessageResponse.d.mts +2 -0
  127. package/dist/esm/api/types/SetBackgroundResponse.d.mts +8 -0
  128. package/dist/esm/api/types/SetBackgroundResponse.mjs +2 -0
  129. package/dist/esm/api/types/index.d.mts +2 -0
  130. package/dist/esm/api/types/index.mjs +2 -0
  131. package/dist/esm/version.d.mts +1 -1
  132. package/dist/esm/version.mjs +1 -1
  133. package/package.json +1 -1
  134. package/reference.md +709 -44
@@ -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);
@@ -13,7 +13,11 @@ export declare class MessagesClient {
13
13
  /**
14
14
  * Send an outbound message (SMS or iMessage) via the provider assigned to the number.
15
15
  *
16
- * Supports single attachments via `media_url` or multiple attachments via `media_urls`. You may use one or the other, but not both.
16
+ * Attach media by passing public HTTPS URLs in `media_urls`.
17
+ *
18
+ * ### Single attachment
19
+ *
20
+ * Pass a single-item array in `media_urls`. The URL must be publicly accessible.
17
21
  *
18
22
  * ### Carousel / multi-image (iMessage)
19
23
  *
@@ -23,13 +27,7 @@ export declare class MessagesClient {
23
27
  * - `body` must be omitted or empty (text cannot be sent alongside a carousel)
24
28
  * - Only supported on iMessage-capable lines
25
29
  *
26
- * ### Single attachment
27
- *
28
- * Pass a single URL in `media_url`. The URL must be publicly accessible. Works across all channels.
29
- *
30
- * ### Multi-attachment (iMessage)
31
- *
32
- * Some iMessage lines support multiple attachments (images and other file types) via `media_urls`. No minimum count; `body` can be included alongside attachments.
30
+ * > **Deprecation notice:** The `media_url` field (singular) is deprecated and will be removed in a future version. Use `media_urls` (array) instead — even for a single attachment, pass it as `media_urls: ["https://..."]`.
33
31
  *
34
32
  * @param {AgentPhone.SendMessageRequest} request
35
33
  * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -48,8 +46,9 @@ export declare class MessagesClient {
48
46
  /**
49
47
  * Send a tapback reaction to a message (iMessage only).
50
48
  *
51
- * Reactions are an iMessage feature. Attempting to react to a message
52
- * sent via an SMS/Twilio number will return a clear error.
49
+ * Reactions are available only for iMessage messages. Attempting to react
50
+ * to an SMS message or another channel that does not support tapbacks
51
+ * returns a clear error.
53
52
  *
54
53
  * @param {AgentPhone.SendReactionRequest} request
55
54
  * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -59,7 +58,7 @@ export declare class MessagesClient {
59
58
  * @example
60
59
  * await client.messages.sendReaction({
61
60
  * message_id: "message_id",
62
- * reaction: "reaction"
61
+ * reaction: "love"
63
62
  * })
64
63
  */
65
64
  sendReaction(request: AgentPhone.SendReactionRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentPhone.SendReactionResponse>;
@@ -69,7 +69,11 @@ class MessagesClient {
69
69
  /**
70
70
  * Send an outbound message (SMS or iMessage) via the provider assigned to the number.
71
71
  *
72
- * Supports single attachments via `media_url` or multiple attachments via `media_urls`. You may use one or the other, but not both.
72
+ * Attach media by passing public HTTPS URLs in `media_urls`.
73
+ *
74
+ * ### Single attachment
75
+ *
76
+ * Pass a single-item array in `media_urls`. The URL must be publicly accessible.
73
77
  *
74
78
  * ### Carousel / multi-image (iMessage)
75
79
  *
@@ -79,13 +83,7 @@ class MessagesClient {
79
83
  * - `body` must be omitted or empty (text cannot be sent alongside a carousel)
80
84
  * - Only supported on iMessage-capable lines
81
85
  *
82
- * ### Single attachment
83
- *
84
- * Pass a single URL in `media_url`. The URL must be publicly accessible. Works across all channels.
85
- *
86
- * ### Multi-attachment (iMessage)
87
- *
88
- * Some iMessage lines support multiple attachments (images and other file types) via `media_urls`. No minimum count; `body` can be included alongside attachments.
86
+ * > **Deprecation notice:** The `media_url` field (singular) is deprecated and will be removed in a future version. Use `media_urls` (array) instead — even for a single attachment, pass it as `media_urls: ["https://..."]`.
89
87
  *
90
88
  * @param {AgentPhone.SendMessageRequest} request
91
89
  * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -142,8 +140,9 @@ class MessagesClient {
142
140
  /**
143
141
  * Send a tapback reaction to a message (iMessage only).
144
142
  *
145
- * Reactions are an iMessage feature. Attempting to react to a message
146
- * sent via an SMS/Twilio number will return a clear error.
143
+ * Reactions are available only for iMessage messages. Attempting to react
144
+ * to an SMS message or another channel that does not support tapbacks
145
+ * returns a clear error.
147
146
  *
148
147
  * @param {AgentPhone.SendReactionRequest} request
149
148
  * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -153,7 +152,7 @@ class MessagesClient {
153
152
  * @example
154
153
  * await client.messages.sendReaction({
155
154
  * message_id: "message_id",
156
- * reaction: "reaction"
155
+ * reaction: "love"
157
156
  * })
158
157
  */
159
158
  sendReaction(request, requestOptions) {
@@ -13,4 +13,26 @@ export interface SendMessageRequest {
13
13
  media_url?: string | null;
14
14
  media_urls?: string[] | null;
15
15
  number_id?: string | null;
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
+ 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;
20
+ }
21
+ export declare namespace SendMessageRequest {
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. */
23
+ const SendStyle: {
24
+ readonly Celebration: "celebration";
25
+ readonly Fireworks: "fireworks";
26
+ readonly Lasers: "lasers";
27
+ readonly Love: "love";
28
+ readonly Confetti: "confetti";
29
+ readonly Balloons: "balloons";
30
+ readonly Spotlight: "spotlight";
31
+ readonly Echo: "echo";
32
+ readonly Invisible: "invisible";
33
+ readonly Gentle: "gentle";
34
+ readonly Loud: "loud";
35
+ readonly Slam: "slam";
36
+ };
37
+ type SendStyle = (typeof SendStyle)[keyof typeof SendStyle];
16
38
  }
@@ -1,3 +1,22 @@
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.SendMessageRequest = void 0;
5
+ var SendMessageRequest;
6
+ (function (SendMessageRequest) {
7
+ /** Optional iMessage expressive effect. Only valid on iMessage-capable numbers. Supported values: celebration, fireworks, lasers, love, confetti, balloons, spotlight, echo, invisible, gentle, loud, slam. */
8
+ SendMessageRequest.SendStyle = {
9
+ Celebration: "celebration",
10
+ Fireworks: "fireworks",
11
+ Lasers: "lasers",
12
+ Love: "love",
13
+ Confetti: "confetti",
14
+ Balloons: "balloons",
15
+ Spotlight: "spotlight",
16
+ Echo: "echo",
17
+ Invisible: "invisible",
18
+ Gentle: "gentle",
19
+ Loud: "loud",
20
+ Slam: "slam",
21
+ };
22
+ })(SendMessageRequest || (exports.SendMessageRequest = SendMessageRequest = {}));
@@ -2,10 +2,11 @@
2
2
  * @example
3
3
  * {
4
4
  * message_id: "message_id",
5
- * reaction: "reaction"
5
+ * reaction: "love"
6
6
  * }
7
7
  */
8
8
  export interface SendReactionRequest {
9
9
  message_id: string;
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. */
10
11
  reaction: string;
11
12
  }
@@ -1,2 +1,2 @@
1
- export type { SendMessageRequest } from "./SendMessageRequest.js";
1
+ export { SendMessageRequest } from "./SendMessageRequest.js";
2
2
  export type { SendReactionRequest } from "./SendReactionRequest.js";
@@ -1,2 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SendMessageRequest = void 0;
4
+ var SendMessageRequest_js_1 = require("./SendMessageRequest.js");
5
+ Object.defineProperty(exports, "SendMessageRequest", { enumerable: true, get: function () { return SendMessageRequest_js_1.SendMessageRequest; } });
@@ -27,10 +27,10 @@ export declare class NumbersClient {
27
27
  * Provision a new SMS-enabled phone number.
28
28
  *
29
29
  * 1. Check number limit (lifetime limit)
30
- * 2. Search Twilio for available numbers
30
+ * 2. Search the account's configured SMS provider for available numbers
31
31
  * 3. Purchase the first available one
32
- * 4. Configure webhook URL
33
- * 5. Store in our database
32
+ * 4. Configure messaging and voice routing
33
+ * 5. Store the number in our database
34
34
  *
35
35
  * @param {AgentPhone.CreateNumberRequest} request
36
36
  * @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -63,7 +63,7 @@ export declare class NumbersClient {
63
63
  * Release (delete) a phone number.
64
64
  *
65
65
  * This will:
66
- * 1. Release the number from Twilio (number goes back to Twilio's pool)
66
+ * 1. Release the number from its upstream provider when supported
67
67
  * 2. Mark the number as "released" in the database
68
68
  * 3. Keep all messages and conversation history (for audit purposes)
69
69
  *
@@ -112,10 +112,10 @@ class NumbersClient {
112
112
  * Provision a new SMS-enabled phone number.
113
113
  *
114
114
  * 1. Check number limit (lifetime limit)
115
- * 2. Search Twilio for available numbers
115
+ * 2. Search the account's configured SMS provider for available numbers
116
116
  * 3. Purchase the first available one
117
- * 4. Configure webhook URL
118
- * 5. Store in our database
117
+ * 4. Configure messaging and voice routing
118
+ * 5. Store the number in our database
119
119
  *
120
120
  * @param {AgentPhone.CreateNumberRequest} request
121
121
  * @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -227,7 +227,7 @@ class NumbersClient {
227
227
  * Release (delete) a phone number.
228
228
  *
229
229
  * This will:
230
- * 1. Release the number from Twilio (number goes back to Twilio's pool)
230
+ * 1. Release the number from its upstream provider when supported
231
231
  * 2. Mark the number as "released" in the database
232
232
  * 3. Keep all messages and conversation history (for audit purposes)
233
233
  *
@@ -4,6 +4,7 @@ export interface AgentResponse {
4
4
  name: string;
5
5
  description: string | null;
6
6
  voiceMode: AgentResponse.VoiceMode;
7
+ enableMessaging?: boolean;
7
8
  modelTier?: AgentResponse.ModelTier;
8
9
  systemPrompt?: string | null;
9
10
  beginMessage?: string | null;
@@ -18,6 +19,12 @@ export interface AgentResponse {
18
19
  denoisingMode?: AgentResponse.DenoisingMode;
19
20
  /** Hang up the call after this many milliseconds of caller silence. Range 10000 (10s) to 3600000 (1 hour). Default 600000 (10 min). */
20
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;
21
28
  createdAt: string;
22
29
  numbers?: AgentPhone.AgentNumberResponse[] | null;
23
30
  }
@@ -0,0 +1,6 @@
1
+ export interface ContactCardResponse {
2
+ firstName?: string | null;
3
+ lastName?: string | null;
4
+ displayName?: string | null;
5
+ hasAvatar?: boolean;
6
+ }
@@ -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 });
@@ -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 });
@@ -11,6 +11,7 @@ export * from "./AppRoutesConversationsConversationSummary.js";
11
11
  export * from "./AttachNumberResponse.js";
12
12
  export * from "./CallListResponse.js";
13
13
  export * from "./CallSummary.js";
14
+ export * from "./ContactCardResponse.js";
14
15
  export * from "./ContactListResponse.js";
15
16
  export * from "./ContactResponse.js";
16
17
  export * from "./ConversationDetail.js";
@@ -36,6 +37,7 @@ export * from "./ReactionInConversation.js";
36
37
  export * from "./SendMessageResponse.js";
37
38
  export * from "./SendReactionResponse.js";
38
39
  export * from "./SendTypingResponse.js";
40
+ export * from "./SetBackgroundResponse.js";
39
41
  export * from "./UsageResponse.js";
40
42
  export * from "./UsageStats.js";
41
43
  export * from "./ValidationError.js";