@gpt-core/client 0.1.0-alpha.2 → 0.3.0

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 (5) hide show
  1. package/dist/index.d.mts +16542 -7037
  2. package/dist/index.d.ts +16542 -7037
  3. package/dist/index.js +2421 -1955
  4. package/dist/index.mjs +2223 -1902
  5. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3,7 +3,6 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
6
  var __export = (target, all) => {
8
7
  for (var name in all)
9
8
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -17,7 +16,6 @@ var __copyProps = (to, from, except, desc) => {
17
16
  return to;
18
17
  };
19
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
21
19
 
22
20
  // src/index.ts
23
21
  var index_exports = {};
@@ -32,7 +30,6 @@ __export(index_exports, {
32
30
  DEFAULT_RETRY_CONFIG: () => DEFAULT_RETRY_CONFIG,
33
31
  DocumentUploadBase64Schema: () => DocumentUploadBase64Schema,
34
32
  EmbedRequestSchema: () => EmbedRequestSchema,
35
- GptClient: () => GptClient,
36
33
  GptCoreError: () => GptCoreError,
37
34
  InvitationCreateSchema: () => InvitationCreateSchema,
38
35
  LoginRequestSchema: () => LoginRequestSchema,
@@ -50,82 +47,371 @@ __export(index_exports, {
50
47
  ValidationError: () => ValidationError,
51
48
  WorkspaceCreateSchema: () => WorkspaceCreateSchema,
52
49
  calculateBackoff: () => calculateBackoff,
50
+ client: () => client,
53
51
  collectStreamedMessage: () => collectStreamedMessage,
54
- eq: () => eq,
55
- eq2: () => eq2,
56
- eq3: () => eq3,
57
- eq4: () => eq4,
58
- eq5: () => eq5,
59
- eq6: () => eq6,
60
- eq7: () => eq7,
61
- eq8: () => eq8,
62
- format: () => format,
63
- greater_than: () => greater_than,
64
- greater_than2: () => greater_than2,
65
- greater_than3: () => greater_than3,
66
- greater_than4: () => greater_than4,
67
- greater_than5: () => greater_than5,
68
- greater_than6: () => greater_than6,
69
- greater_than7: () => greater_than7,
70
- greater_than8: () => greater_than8,
71
- greater_than_or_equal: () => greater_than_or_equal,
72
- greater_than_or_equal2: () => greater_than_or_equal2,
73
- greater_than_or_equal3: () => greater_than_or_equal3,
74
- greater_than_or_equal4: () => greater_than_or_equal4,
75
- greater_than_or_equal5: () => greater_than_or_equal5,
76
- greater_than_or_equal6: () => greater_than_or_equal6,
77
- greater_than_or_equal7: () => greater_than_or_equal7,
78
- greater_than_or_equal8: () => greater_than_or_equal8,
52
+ deleteAiConversationsById: () => deleteAiConversationsById,
53
+ deleteAiGraphEdgesById: () => deleteAiGraphEdgesById,
54
+ deleteAiGraphNodesById: () => deleteAiGraphNodesById,
55
+ deleteApiKeysById: () => deleteApiKeysById,
56
+ deleteApplicationsById: () => deleteApplicationsById,
57
+ deleteBucketsById: () => deleteBucketsById,
58
+ deleteDocumentsById: () => deleteDocumentsById,
59
+ deleteExtractionResultsById: () => deleteExtractionResultsById,
60
+ deleteMessagesById: () => deleteMessagesById,
61
+ deleteNotificationPreferencesById: () => deleteNotificationPreferencesById,
62
+ deleteObjectsById: () => deleteObjectsById,
63
+ deleteSearchSavedById: () => deleteSearchSavedById,
64
+ deleteTenantMembershipsByTenantIdByUserId: () => deleteTenantMembershipsByTenantIdByUserId,
65
+ deleteTenantsById: () => deleteTenantsById,
66
+ deleteThreadsById: () => deleteThreadsById,
67
+ deleteTrainingExamplesById: () => deleteTrainingExamplesById,
68
+ deleteUserProfilesById: () => deleteUserProfilesById,
69
+ deleteWebhookConfigsById: () => deleteWebhookConfigsById,
70
+ deleteWorkspaceMembershipsByWorkspaceIdByUserId: () => deleteWorkspaceMembershipsByWorkspaceIdByUserId,
71
+ deleteWorkspacesById: () => deleteWorkspacesById,
72
+ getAgents: () => getAgents,
73
+ getAgentsById: () => getAgentsById,
74
+ getAiChunksDocumentByDocumentId: () => getAiChunksDocumentByDocumentId,
75
+ getAiConversations: () => getAiConversations,
76
+ getAiConversationsById: () => getAiConversationsById,
77
+ getAiGraphEdges: () => getAiGraphEdges,
78
+ getAiGraphNodes: () => getAiGraphNodes,
79
+ getAiMessages: () => getAiMessages,
80
+ getApiKeys: () => getApiKeys,
81
+ getApiKeysById: () => getApiKeysById,
82
+ getApplications: () => getApplications,
83
+ getApplicationsById: () => getApplicationsById,
84
+ getApplicationsBySlugBySlug: () => getApplicationsBySlugBySlug,
85
+ getAuditLogs: () => getAuditLogs,
86
+ getBuckets: () => getBuckets,
87
+ getBucketsById: () => getBucketsById,
88
+ getBucketsByIdObjects: () => getBucketsByIdObjects,
89
+ getBucketsByIdStats: () => getBucketsByIdStats,
90
+ getConfigs: () => getConfigs,
91
+ getCreditPackages: () => getCreditPackages,
92
+ getCreditPackagesById: () => getCreditPackagesById,
93
+ getCreditPackagesSlugBySlug: () => getCreditPackagesSlugBySlug,
94
+ getDocuments: () => getDocuments,
95
+ getDocumentsById: () => getDocumentsById,
96
+ getDocumentsByIdExtractionResults: () => getDocumentsByIdExtractionResults,
97
+ getDocumentsByIdRelationshipsChunks: () => getDocumentsByIdRelationshipsChunks,
98
+ getDocumentsProcessingQueue: () => getDocumentsProcessingQueue,
99
+ getDocumentsSearch: () => getDocumentsSearch,
100
+ getDocumentsStats: () => getDocumentsStats,
101
+ getExtractionResults: () => getExtractionResults,
102
+ getExtractionResultsById: () => getExtractionResultsById,
103
+ getInvitations: () => getInvitations,
104
+ getInvitationsConsumeByToken: () => getInvitationsConsumeByToken,
105
+ getLlmAnalytics: () => getLlmAnalytics,
106
+ getLlmAnalyticsById: () => getLlmAnalyticsById,
107
+ getLlmAnalyticsCosts: () => getLlmAnalyticsCosts,
108
+ getLlmAnalyticsPlatform: () => getLlmAnalyticsPlatform,
109
+ getLlmAnalyticsSummary: () => getLlmAnalyticsSummary,
110
+ getLlmAnalyticsUsage: () => getLlmAnalyticsUsage,
111
+ getLlmAnalyticsWorkspace: () => getLlmAnalyticsWorkspace,
112
+ getMessages: () => getMessages,
113
+ getMessagesById: () => getMessagesById,
114
+ getMessagesSearch: () => getMessagesSearch,
115
+ getNotificationLogs: () => getNotificationLogs,
116
+ getNotificationLogsById: () => getNotificationLogsById,
117
+ getNotificationPreferences: () => getNotificationPreferences,
118
+ getNotificationPreferencesById: () => getNotificationPreferencesById,
119
+ getObjects: () => getObjects,
120
+ getObjectsById: () => getObjectsById,
121
+ getPlans: () => getPlans,
122
+ getPlansById: () => getPlansById,
123
+ getPlansSlugBySlug: () => getPlansSlugBySlug,
124
+ getSearch: () => getSearch,
125
+ getSearchHealth: () => getSearchHealth,
126
+ getSearchIndexes: () => getSearchIndexes,
127
+ getSearchSaved: () => getSearchSaved,
128
+ getSearchSemantic: () => getSearchSemantic,
129
+ getSearchStats: () => getSearchStats,
130
+ getSearchStatus: () => getSearchStatus,
131
+ getStorageStats: () => getStorageStats,
132
+ getTenantMemberships: () => getTenantMemberships,
133
+ getTenants: () => getTenants,
134
+ getTenantsById: () => getTenantsById,
135
+ getThreads: () => getThreads,
136
+ getThreadsById: () => getThreadsById,
137
+ getThreadsSearch: () => getThreadsSearch,
138
+ getTrainingExamples: () => getTrainingExamples,
139
+ getTrainingExamplesById: () => getTrainingExamplesById,
140
+ getTransactions: () => getTransactions,
141
+ getTransactionsById: () => getTransactionsById,
142
+ getUserProfiles: () => getUserProfiles,
143
+ getUserProfilesById: () => getUserProfilesById,
144
+ getUserProfilesMe: () => getUserProfilesMe,
145
+ getUsers: () => getUsers,
146
+ getUsersById: () => getUsersById,
147
+ getUsersMe: () => getUsersMe,
148
+ getWallet: () => getWallet,
149
+ getWebhookConfigs: () => getWebhookConfigs,
150
+ getWebhookConfigsById: () => getWebhookConfigsById,
151
+ getWebhookDeliveries: () => getWebhookDeliveries,
152
+ getWebhookDeliveriesById: () => getWebhookDeliveriesById,
153
+ getWorkspaceMemberships: () => getWorkspaceMemberships,
154
+ getWorkspaces: () => getWorkspaces,
155
+ getWorkspacesById: () => getWorkspacesById,
156
+ getWorkspacesMine: () => getWorkspacesMine,
79
157
  handleApiError: () => handleApiError,
80
158
  isRetryableError: () => isRetryableError,
81
- less_than: () => less_than,
82
- less_than2: () => less_than2,
83
- less_than3: () => less_than3,
84
- less_than4: () => less_than4,
85
- less_than5: () => less_than5,
86
- less_than6: () => less_than6,
87
- less_than7: () => less_than7,
88
- less_than8: () => less_than8,
89
- less_than_or_equal: () => less_than_or_equal,
90
- less_than_or_equal2: () => less_than_or_equal2,
91
- less_than_or_equal3: () => less_than_or_equal3,
92
- less_than_or_equal4: () => less_than_or_equal4,
93
- less_than_or_equal5: () => less_than_or_equal5,
94
- less_than_or_equal6: () => less_than_or_equal6,
95
- less_than_or_equal7: () => less_than_or_equal7,
96
- less_than_or_equal8: () => less_than_or_equal8,
97
- not_eq: () => not_eq,
98
- not_eq2: () => not_eq2,
99
- not_eq3: () => not_eq3,
100
- not_eq4: () => not_eq4,
101
- not_eq5: () => not_eq5,
102
- not_eq6: () => not_eq6,
103
- not_eq7: () => not_eq7,
104
- not_eq8: () => not_eq8,
105
159
  paginateAll: () => paginateAll,
106
160
  paginateToArray: () => paginateToArray,
161
+ patchApiKeysById: () => patchApiKeysById,
162
+ patchApiKeysByIdAllocate: () => patchApiKeysByIdAllocate,
163
+ patchApiKeysByIdRevoke: () => patchApiKeysByIdRevoke,
164
+ patchApiKeysByIdRotate: () => patchApiKeysByIdRotate,
165
+ patchApplicationsById: () => patchApplicationsById,
166
+ patchBucketsById: () => patchBucketsById,
167
+ patchConfigsByKey: () => patchConfigsByKey,
168
+ patchDocumentsById: () => patchDocumentsById,
169
+ patchExtractionResultsById: () => patchExtractionResultsById,
170
+ patchInvitationsByIdAccept: () => patchInvitationsByIdAccept,
171
+ patchInvitationsByIdResend: () => patchInvitationsByIdResend,
172
+ patchInvitationsByIdRevoke: () => patchInvitationsByIdRevoke,
173
+ patchMessagesById: () => patchMessagesById,
174
+ patchNotificationPreferencesById: () => patchNotificationPreferencesById,
175
+ patchTenantMembershipsByTenantIdByUserId: () => patchTenantMembershipsByTenantIdByUserId,
176
+ patchTenantsById: () => patchTenantsById,
177
+ patchThreadsById: () => patchThreadsById,
178
+ patchTrainingExamplesById: () => patchTrainingExamplesById,
179
+ patchUserProfilesById: () => patchUserProfilesById,
180
+ patchUsersAuthResetPassword: () => patchUsersAuthResetPassword,
181
+ patchUsersById: () => patchUsersById,
182
+ patchUsersByIdConfirmEmail: () => patchUsersByIdConfirmEmail,
183
+ patchUsersByIdResetPassword: () => patchUsersByIdResetPassword,
184
+ patchWalletAddons: () => patchWalletAddons,
185
+ patchWalletAddonsByAddonSlugCancel: () => patchWalletAddonsByAddonSlugCancel,
186
+ patchWalletPlan: () => patchWalletPlan,
187
+ patchWebhookConfigsById: () => patchWebhookConfigsById,
188
+ patchWorkspaceMembershipsByWorkspaceIdByUserId: () => patchWorkspaceMembershipsByWorkspaceIdByUserId,
189
+ patchWorkspacesById: () => patchWorkspacesById,
190
+ patchWorkspacesByIdAllocate: () => patchWorkspacesByIdAllocate,
191
+ postAgentsByIdClone: () => postAgentsByIdClone,
192
+ postAgentsByIdTest: () => postAgentsByIdTest,
193
+ postAgentsByIdValidate: () => postAgentsByIdValidate,
194
+ postAgentsPredict: () => postAgentsPredict,
195
+ postAiChunksSearch: () => postAiChunksSearch,
196
+ postAiConversations: () => postAiConversations,
197
+ postAiEmbed: () => postAiEmbed,
198
+ postAiGraphEdges: () => postAiGraphEdges,
199
+ postAiGraphNodes: () => postAiGraphNodes,
200
+ postAiMessages: () => postAiMessages,
201
+ postAiSearch: () => postAiSearch,
202
+ postAiSearchAdvanced: () => postAiSearchAdvanced,
203
+ postApiKeys: () => postApiKeys,
204
+ postApplications: () => postApplications,
205
+ postBuckets: () => postBuckets,
206
+ postConfigs: () => postConfigs,
207
+ postDocuments: () => postDocuments,
208
+ postDocumentsBulkDelete: () => postDocumentsBulkDelete,
209
+ postDocumentsBulkReprocess: () => postDocumentsBulkReprocess,
210
+ postDocumentsByIdAnalyze: () => postDocumentsByIdAnalyze,
211
+ postDocumentsByIdReprocess: () => postDocumentsByIdReprocess,
212
+ postDocumentsExport: () => postDocumentsExport,
213
+ postDocumentsImport: () => postDocumentsImport,
214
+ postDocumentsPresignedUpload: () => postDocumentsPresignedUpload,
215
+ postInvitationsAcceptByToken: () => postInvitationsAcceptByToken,
216
+ postInvitationsInvite: () => postInvitationsInvite,
217
+ postLlmAnalytics: () => postLlmAnalytics,
218
+ postMessages: () => postMessages,
219
+ postNotificationPreferences: () => postNotificationPreferences,
220
+ postObjectsBulkDestroy: () => postObjectsBulkDestroy,
221
+ postObjectsRegister: () => postObjectsRegister,
222
+ postPayments: () => postPayments,
223
+ postSearchReindex: () => postSearchReindex,
224
+ postSearchSaved: () => postSearchSaved,
225
+ postStorageSignDownload: () => postStorageSignDownload,
226
+ postStorageSignUpload: () => postStorageSignUpload,
227
+ postTenantMemberships: () => postTenantMemberships,
228
+ postTenants: () => postTenants,
229
+ postTenantsByIdBuyStorage: () => postTenantsByIdBuyStorage,
230
+ postTenantsByIdRemoveStorage: () => postTenantsByIdRemoveStorage,
231
+ postThreads: () => postThreads,
232
+ postThreadsActive: () => postThreadsActive,
233
+ postThreadsByIdMessages: () => postThreadsByIdMessages,
234
+ postThreadsByIdSummarize: () => postThreadsByIdSummarize,
235
+ postTokens: () => postTokens,
236
+ postTrainingExamples: () => postTrainingExamples,
237
+ postTrainingExamplesBulk: () => postTrainingExamplesBulk,
238
+ postTrainingExamplesBulkDelete: () => postTrainingExamplesBulkDelete,
239
+ postUserProfiles: () => postUserProfiles,
240
+ postUsersAuthConfirm: () => postUsersAuthConfirm,
241
+ postUsersAuthLogin: () => postUsersAuthLogin,
242
+ postUsersAuthMagicLinkLogin: () => postUsersAuthMagicLinkLogin,
243
+ postUsersAuthMagicLinkRequest: () => postUsersAuthMagicLinkRequest,
244
+ postUsersAuthRegister: () => postUsersAuthRegister,
245
+ postUsersAuthRegisterWithOidc: () => postUsersAuthRegisterWithOidc,
246
+ postUsersRegisterIsv: () => postUsersRegisterIsv,
247
+ postWebhookConfigs: () => postWebhookConfigs,
248
+ postWebhookConfigsByIdTest: () => postWebhookConfigsByIdTest,
249
+ postWebhookDeliveriesByIdRetry: () => postWebhookDeliveriesByIdRetry,
250
+ postWorkspaceMemberships: () => postWorkspaceMemberships,
251
+ postWorkspaces: () => postWorkspaces,
107
252
  retryWithBackoff: () => retryWithBackoff,
108
- role: () => role,
109
253
  sleep: () => sleep,
110
- status: () => status,
111
- status2: () => status2,
112
254
  streamMessage: () => streamMessage,
113
255
  streamSSE: () => streamSSE,
114
- type: () => type,
115
256
  withRetry: () => withRetry
116
257
  });
117
258
  module.exports = __toCommonJS(index_exports);
118
259
 
119
- // ../../node_modules/@hey-api/client-fetch/dist/index.js
120
- var A = async (s, r) => {
121
- let e = typeof r == "function" ? await r(s) : r;
122
- if (e) return s.scheme === "bearer" ? `Bearer ${e}` : s.scheme === "basic" ? `Basic ${btoa(e)}` : e;
260
+ // src/_internal/core/bodySerializer.gen.ts
261
+ var jsonBodySerializer = {
262
+ bodySerializer: (body) => JSON.stringify(
263
+ body,
264
+ (_key, value) => typeof value === "bigint" ? value.toString() : value
265
+ )
266
+ };
267
+
268
+ // src/_internal/core/params.gen.ts
269
+ var extraPrefixesMap = {
270
+ $body_: "body",
271
+ $headers_: "headers",
272
+ $path_: "path",
273
+ $query_: "query"
274
+ };
275
+ var extraPrefixes = Object.entries(extraPrefixesMap);
276
+
277
+ // src/_internal/core/serverSentEvents.gen.ts
278
+ var createSseClient = ({
279
+ onRequest,
280
+ onSseError,
281
+ onSseEvent,
282
+ responseTransformer,
283
+ responseValidator,
284
+ sseDefaultRetryDelay,
285
+ sseMaxRetryAttempts,
286
+ sseMaxRetryDelay,
287
+ sseSleepFn,
288
+ url,
289
+ ...options
290
+ }) => {
291
+ let lastEventId;
292
+ const sleep2 = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
293
+ const createStream = async function* () {
294
+ let retryDelay = sseDefaultRetryDelay ?? 3e3;
295
+ let attempt = 0;
296
+ const signal = options.signal ?? new AbortController().signal;
297
+ while (true) {
298
+ if (signal.aborted) break;
299
+ attempt++;
300
+ const headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
301
+ if (lastEventId !== void 0) {
302
+ headers.set("Last-Event-ID", lastEventId);
303
+ }
304
+ try {
305
+ const requestInit = {
306
+ redirect: "follow",
307
+ ...options,
308
+ body: options.serializedBody,
309
+ headers,
310
+ signal
311
+ };
312
+ let request = new Request(url, requestInit);
313
+ if (onRequest) {
314
+ request = await onRequest(url, requestInit);
315
+ }
316
+ const _fetch = options.fetch ?? globalThis.fetch;
317
+ const response = await _fetch(request);
318
+ if (!response.ok)
319
+ throw new Error(
320
+ `SSE failed: ${response.status} ${response.statusText}`
321
+ );
322
+ if (!response.body) throw new Error("No body in SSE response");
323
+ const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
324
+ let buffer = "";
325
+ const abortHandler = () => {
326
+ try {
327
+ reader.cancel();
328
+ } catch {
329
+ }
330
+ };
331
+ signal.addEventListener("abort", abortHandler);
332
+ try {
333
+ while (true) {
334
+ const { done, value } = await reader.read();
335
+ if (done) break;
336
+ buffer += value;
337
+ const chunks = buffer.split("\n\n");
338
+ buffer = chunks.pop() ?? "";
339
+ for (const chunk of chunks) {
340
+ const lines = chunk.split("\n");
341
+ const dataLines = [];
342
+ let eventName;
343
+ for (const line of lines) {
344
+ if (line.startsWith("data:")) {
345
+ dataLines.push(line.replace(/^data:\s*/, ""));
346
+ } else if (line.startsWith("event:")) {
347
+ eventName = line.replace(/^event:\s*/, "");
348
+ } else if (line.startsWith("id:")) {
349
+ lastEventId = line.replace(/^id:\s*/, "");
350
+ } else if (line.startsWith("retry:")) {
351
+ const parsed = Number.parseInt(
352
+ line.replace(/^retry:\s*/, ""),
353
+ 10
354
+ );
355
+ if (!Number.isNaN(parsed)) {
356
+ retryDelay = parsed;
357
+ }
358
+ }
359
+ }
360
+ let data;
361
+ let parsedJson = false;
362
+ if (dataLines.length) {
363
+ const rawData = dataLines.join("\n");
364
+ try {
365
+ data = JSON.parse(rawData);
366
+ parsedJson = true;
367
+ } catch {
368
+ data = rawData;
369
+ }
370
+ }
371
+ if (parsedJson) {
372
+ if (responseValidator) {
373
+ await responseValidator(data);
374
+ }
375
+ if (responseTransformer) {
376
+ data = await responseTransformer(data);
377
+ }
378
+ }
379
+ onSseEvent?.({
380
+ data,
381
+ event: eventName,
382
+ id: lastEventId,
383
+ retry: retryDelay
384
+ });
385
+ if (dataLines.length) {
386
+ yield data;
387
+ }
388
+ }
389
+ }
390
+ } finally {
391
+ signal.removeEventListener("abort", abortHandler);
392
+ reader.releaseLock();
393
+ }
394
+ break;
395
+ } catch (error) {
396
+ onSseError?.(error);
397
+ if (sseMaxRetryAttempts !== void 0 && attempt >= sseMaxRetryAttempts) {
398
+ break;
399
+ }
400
+ const backoff = Math.min(
401
+ retryDelay * 2 ** (attempt - 1),
402
+ sseMaxRetryDelay ?? 3e4
403
+ );
404
+ await sleep2(backoff);
405
+ }
406
+ }
407
+ };
408
+ const stream = createStream();
409
+ return { stream };
123
410
  };
124
- var O = { bodySerializer: (s) => JSON.stringify(s, (r, e) => typeof e == "bigint" ? e.toString() : e) };
125
- var U = { $body_: "body", $headers_: "headers", $path_: "path", $query_: "query" };
126
- var D = Object.entries(U);
127
- var B = (s) => {
128
- switch (s) {
411
+
412
+ // src/_internal/core/pathSerializer.gen.ts
413
+ var separatorArrayExplode = (style) => {
414
+ switch (style) {
129
415
  case "label":
130
416
  return ".";
131
417
  case "matrix":
@@ -136,8 +422,8 @@ var B = (s) => {
136
422
  return "&";
137
423
  }
138
424
  };
139
- var N = (s) => {
140
- switch (s) {
425
+ var separatorArrayNoExplode = (style) => {
426
+ switch (style) {
141
427
  case "form":
142
428
  return ",";
143
429
  case "pipeDelimited":
@@ -148,8 +434,8 @@ var N = (s) => {
148
434
  return ",";
149
435
  }
150
436
  };
151
- var Q = (s) => {
152
- switch (s) {
437
+ var separatorObjectExplode = (style) => {
438
+ switch (style) {
153
439
  case "label":
154
440
  return ".";
155
441
  case "matrix":
@@ -160,1313 +446,1986 @@ var Q = (s) => {
160
446
  return "&";
161
447
  }
162
448
  };
163
- var S = ({ allowReserved: s, explode: r, name: e, style: a, value: i }) => {
164
- if (!r) {
165
- let t = (s ? i : i.map((l) => encodeURIComponent(l))).join(N(a));
166
- switch (a) {
449
+ var serializeArrayParam = ({
450
+ allowReserved,
451
+ explode,
452
+ name,
453
+ style,
454
+ value
455
+ }) => {
456
+ if (!explode) {
457
+ const joinedValues2 = (allowReserved ? value : value.map((v) => encodeURIComponent(v))).join(separatorArrayNoExplode(style));
458
+ switch (style) {
167
459
  case "label":
168
- return `.${t}`;
460
+ return `.${joinedValues2}`;
169
461
  case "matrix":
170
- return `;${e}=${t}`;
462
+ return `;${name}=${joinedValues2}`;
171
463
  case "simple":
172
- return t;
464
+ return joinedValues2;
173
465
  default:
174
- return `${e}=${t}`;
466
+ return `${name}=${joinedValues2}`;
175
467
  }
176
468
  }
177
- let o = B(a), n = i.map((t) => a === "label" || a === "simple" ? s ? t : encodeURIComponent(t) : m({ allowReserved: s, name: e, value: t })).join(o);
178
- return a === "label" || a === "matrix" ? o + n : n;
179
- };
180
- var m = ({ allowReserved: s, name: r, value: e }) => {
181
- if (e == null) return "";
182
- if (typeof e == "object") throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");
183
- return `${r}=${s ? e : encodeURIComponent(e)}`;
184
- };
185
- var q = ({ allowReserved: s, explode: r, name: e, style: a, value: i, valueOnly: o }) => {
186
- if (i instanceof Date) return o ? i.toISOString() : `${e}=${i.toISOString()}`;
187
- if (a !== "deepObject" && !r) {
188
- let l = [];
189
- Object.entries(i).forEach(([p, d]) => {
190
- l = [...l, p, s ? d : encodeURIComponent(d)];
191
- });
192
- let u = l.join(",");
193
- switch (a) {
469
+ const separator = separatorArrayExplode(style);
470
+ const joinedValues = value.map((v) => {
471
+ if (style === "label" || style === "simple") {
472
+ return allowReserved ? v : encodeURIComponent(v);
473
+ }
474
+ return serializePrimitiveParam({
475
+ allowReserved,
476
+ name,
477
+ value: v
478
+ });
479
+ }).join(separator);
480
+ return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
481
+ };
482
+ var serializePrimitiveParam = ({
483
+ allowReserved,
484
+ name,
485
+ value
486
+ }) => {
487
+ if (value === void 0 || value === null) {
488
+ return "";
489
+ }
490
+ if (typeof value === "object") {
491
+ throw new Error(
492
+ "Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these."
493
+ );
494
+ }
495
+ return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;
496
+ };
497
+ var serializeObjectParam = ({
498
+ allowReserved,
499
+ explode,
500
+ name,
501
+ style,
502
+ value,
503
+ valueOnly
504
+ }) => {
505
+ if (value instanceof Date) {
506
+ return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;
507
+ }
508
+ if (style !== "deepObject" && !explode) {
509
+ let values = [];
510
+ Object.entries(value).forEach(([key, v]) => {
511
+ values = [
512
+ ...values,
513
+ key,
514
+ allowReserved ? v : encodeURIComponent(v)
515
+ ];
516
+ });
517
+ const joinedValues2 = values.join(",");
518
+ switch (style) {
194
519
  case "form":
195
- return `${e}=${u}`;
520
+ return `${name}=${joinedValues2}`;
196
521
  case "label":
197
- return `.${u}`;
522
+ return `.${joinedValues2}`;
198
523
  case "matrix":
199
- return `;${e}=${u}`;
524
+ return `;${name}=${joinedValues2}`;
200
525
  default:
201
- return u;
526
+ return joinedValues2;
202
527
  }
203
528
  }
204
- let n = Q(a), t = Object.entries(i).map(([l, u]) => m({ allowReserved: s, name: a === "deepObject" ? `${e}[${l}]` : l, value: u })).join(n);
205
- return a === "label" || a === "matrix" ? n + t : t;
529
+ const separator = separatorObjectExplode(style);
530
+ const joinedValues = Object.entries(value).map(
531
+ ([key, v]) => serializePrimitiveParam({
532
+ allowReserved,
533
+ name: style === "deepObject" ? `${name}[${key}]` : key,
534
+ value: v
535
+ })
536
+ ).join(separator);
537
+ return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
206
538
  };
207
- var J = /\{[^{}]+\}/g;
208
- var M = ({ path: s, url: r }) => {
209
- let e = r, a = r.match(J);
210
- if (a) for (let i of a) {
211
- let o = false, n = i.substring(1, i.length - 1), t = "simple";
212
- n.endsWith("*") && (o = true, n = n.substring(0, n.length - 1)), n.startsWith(".") ? (n = n.substring(1), t = "label") : n.startsWith(";") && (n = n.substring(1), t = "matrix");
213
- let l = s[n];
214
- if (l == null) continue;
215
- if (Array.isArray(l)) {
216
- e = e.replace(i, S({ explode: o, name: n, style: t, value: l }));
217
- continue;
218
- }
219
- if (typeof l == "object") {
220
- e = e.replace(i, q({ explode: o, name: n, style: t, value: l, valueOnly: true }));
221
- continue;
539
+
540
+ // src/_internal/core/utils.gen.ts
541
+ var PATH_PARAM_RE = /\{[^{}]+\}/g;
542
+ var defaultPathSerializer = ({ path, url: _url }) => {
543
+ let url = _url;
544
+ const matches = _url.match(PATH_PARAM_RE);
545
+ if (matches) {
546
+ for (const match of matches) {
547
+ let explode = false;
548
+ let name = match.substring(1, match.length - 1);
549
+ let style = "simple";
550
+ if (name.endsWith("*")) {
551
+ explode = true;
552
+ name = name.substring(0, name.length - 1);
553
+ }
554
+ if (name.startsWith(".")) {
555
+ name = name.substring(1);
556
+ style = "label";
557
+ } else if (name.startsWith(";")) {
558
+ name = name.substring(1);
559
+ style = "matrix";
560
+ }
561
+ const value = path[name];
562
+ if (value === void 0 || value === null) {
563
+ continue;
564
+ }
565
+ if (Array.isArray(value)) {
566
+ url = url.replace(
567
+ match,
568
+ serializeArrayParam({ explode, name, style, value })
569
+ );
570
+ continue;
571
+ }
572
+ if (typeof value === "object") {
573
+ url = url.replace(
574
+ match,
575
+ serializeObjectParam({
576
+ explode,
577
+ name,
578
+ style,
579
+ value,
580
+ valueOnly: true
581
+ })
582
+ );
583
+ continue;
584
+ }
585
+ if (style === "matrix") {
586
+ url = url.replace(
587
+ match,
588
+ `;${serializePrimitiveParam({
589
+ name,
590
+ value
591
+ })}`
592
+ );
593
+ continue;
594
+ }
595
+ const replaceValue = encodeURIComponent(
596
+ style === "label" ? `.${value}` : value
597
+ );
598
+ url = url.replace(match, replaceValue);
222
599
  }
223
- if (t === "matrix") {
224
- e = e.replace(i, `;${m({ name: n, value: l })}`);
225
- continue;
600
+ }
601
+ return url;
602
+ };
603
+ var getUrl = ({
604
+ baseUrl,
605
+ path,
606
+ query,
607
+ querySerializer,
608
+ url: _url
609
+ }) => {
610
+ const pathUrl = _url.startsWith("/") ? _url : `/${_url}`;
611
+ let url = (baseUrl ?? "") + pathUrl;
612
+ if (path) {
613
+ url = defaultPathSerializer({ path, url });
614
+ }
615
+ let search = query ? querySerializer(query) : "";
616
+ if (search.startsWith("?")) {
617
+ search = search.substring(1);
618
+ }
619
+ if (search) {
620
+ url += `?${search}`;
621
+ }
622
+ return url;
623
+ };
624
+ function getValidRequestBody(options) {
625
+ const hasBody = options.body !== void 0;
626
+ const isSerializedBody = hasBody && options.bodySerializer;
627
+ if (isSerializedBody) {
628
+ if ("serializedBody" in options) {
629
+ const hasSerializedBody = options.serializedBody !== void 0 && options.serializedBody !== "";
630
+ return hasSerializedBody ? options.serializedBody : null;
226
631
  }
227
- let u = encodeURIComponent(t === "label" ? `.${l}` : l);
228
- e = e.replace(i, u);
632
+ return options.body !== "" ? options.body : null;
633
+ }
634
+ if (hasBody) {
635
+ return options.body;
636
+ }
637
+ return void 0;
638
+ }
639
+
640
+ // src/_internal/core/auth.gen.ts
641
+ var getAuthToken = async (auth, callback) => {
642
+ const token = typeof callback === "function" ? await callback(auth) : callback;
643
+ if (!token) {
644
+ return;
645
+ }
646
+ if (auth.scheme === "bearer") {
647
+ return `Bearer ${token}`;
648
+ }
649
+ if (auth.scheme === "basic") {
650
+ return `Basic ${btoa(token)}`;
229
651
  }
230
- return e;
652
+ return token;
231
653
  };
232
- var k = ({ allowReserved: s, array: r, object: e } = {}) => (i) => {
233
- let o = [];
234
- if (i && typeof i == "object") for (let n in i) {
235
- let t = i[n];
236
- if (t != null) if (Array.isArray(t)) {
237
- let l = S({ allowReserved: s, explode: true, name: n, style: "form", value: t, ...r });
238
- l && o.push(l);
239
- } else if (typeof t == "object") {
240
- let l = q({ allowReserved: s, explode: true, name: n, style: "deepObject", value: t, ...e });
241
- l && o.push(l);
242
- } else {
243
- let l = m({ allowReserved: s, name: n, value: t });
244
- l && o.push(l);
654
+
655
+ // src/_internal/client/utils.gen.ts
656
+ var createQuerySerializer = ({
657
+ parameters = {},
658
+ ...args
659
+ } = {}) => {
660
+ const querySerializer = (queryParams) => {
661
+ const search = [];
662
+ if (queryParams && typeof queryParams === "object") {
663
+ for (const name in queryParams) {
664
+ const value = queryParams[name];
665
+ if (value === void 0 || value === null) {
666
+ continue;
667
+ }
668
+ const options = parameters[name] || args;
669
+ if (Array.isArray(value)) {
670
+ const serializedArray = serializeArrayParam({
671
+ allowReserved: options.allowReserved,
672
+ explode: true,
673
+ name,
674
+ style: "form",
675
+ value,
676
+ ...options.array
677
+ });
678
+ if (serializedArray) search.push(serializedArray);
679
+ } else if (typeof value === "object") {
680
+ const serializedObject = serializeObjectParam({
681
+ allowReserved: options.allowReserved,
682
+ explode: true,
683
+ name,
684
+ style: "deepObject",
685
+ value,
686
+ ...options.object
687
+ });
688
+ if (serializedObject) search.push(serializedObject);
689
+ } else {
690
+ const serializedPrimitive = serializePrimitiveParam({
691
+ allowReserved: options.allowReserved,
692
+ name,
693
+ value
694
+ });
695
+ if (serializedPrimitive) search.push(serializedPrimitive);
696
+ }
697
+ }
245
698
  }
699
+ return search.join("&");
700
+ };
701
+ return querySerializer;
702
+ };
703
+ var getParseAs = (contentType) => {
704
+ if (!contentType) {
705
+ return "stream";
706
+ }
707
+ const cleanContent = contentType.split(";")[0]?.trim();
708
+ if (!cleanContent) {
709
+ return;
710
+ }
711
+ if (cleanContent.startsWith("application/json") || cleanContent.endsWith("+json")) {
712
+ return "json";
246
713
  }
247
- return o.join("&");
714
+ if (cleanContent === "multipart/form-data") {
715
+ return "formData";
716
+ }
717
+ if (["application/", "audio/", "image/", "video/"].some(
718
+ (type) => cleanContent.startsWith(type)
719
+ )) {
720
+ return "blob";
721
+ }
722
+ if (cleanContent.startsWith("text/")) {
723
+ return "text";
724
+ }
725
+ return;
248
726
  };
249
- var E = (s) => {
250
- if (!s) return "stream";
251
- let r = s.split(";")[0]?.trim();
252
- if (r) {
253
- if (r.startsWith("application/json") || r.endsWith("+json")) return "json";
254
- if (r === "multipart/form-data") return "formData";
255
- if (["application/", "audio/", "image/", "video/"].some((e) => r.startsWith(e))) return "blob";
256
- if (r.startsWith("text/")) return "text";
727
+ var checkForExistence = (options, name) => {
728
+ if (!name) {
729
+ return false;
730
+ }
731
+ if (options.headers.has(name) || options.query?.[name] || options.headers.get("Cookie")?.includes(`${name}=`)) {
732
+ return true;
257
733
  }
734
+ return false;
258
735
  };
259
- var $ = async ({ security: s, ...r }) => {
260
- for (let e of s) {
261
- let a = await A(e, r.auth);
262
- if (!a) continue;
263
- let i = e.name ?? "Authorization";
264
- switch (e.in) {
736
+ var setAuthParams = async ({
737
+ security,
738
+ ...options
739
+ }) => {
740
+ for (const auth of security) {
741
+ if (checkForExistence(options, auth.name)) {
742
+ continue;
743
+ }
744
+ const token = await getAuthToken(auth, options.auth);
745
+ if (!token) {
746
+ continue;
747
+ }
748
+ const name = auth.name ?? "Authorization";
749
+ switch (auth.in) {
265
750
  case "query":
266
- r.query || (r.query = {}), r.query[i] = a;
751
+ if (!options.query) {
752
+ options.query = {};
753
+ }
754
+ options.query[name] = token;
267
755
  break;
268
756
  case "cookie":
269
- r.headers.append("Cookie", `${i}=${a}`);
757
+ options.headers.append("Cookie", `${name}=${token}`);
270
758
  break;
271
759
  case "header":
272
760
  default:
273
- r.headers.set(i, a);
761
+ options.headers.set(name, token);
274
762
  break;
275
763
  }
276
- return;
277
764
  }
278
765
  };
279
- var C = (s) => L({ baseUrl: s.baseUrl, path: s.path, query: s.query, querySerializer: typeof s.querySerializer == "function" ? s.querySerializer : k(s.querySerializer), url: s.url });
280
- var L = ({ baseUrl: s, path: r, query: e, querySerializer: a, url: i }) => {
281
- let o = i.startsWith("/") ? i : `/${i}`, n = (s ?? "") + o;
282
- r && (n = M({ path: r, url: n }));
283
- let t = e ? a(e) : "";
284
- return t.startsWith("?") && (t = t.substring(1)), t && (n += `?${t}`), n;
285
- };
286
- var x = (s, r) => {
287
- let e = { ...s, ...r };
288
- return e.baseUrl?.endsWith("/") && (e.baseUrl = e.baseUrl.substring(0, e.baseUrl.length - 1)), e.headers = j(s.headers, r.headers), e;
289
- };
290
- var j = (...s) => {
291
- let r = new Headers();
292
- for (let e of s) {
293
- if (!e || typeof e != "object") continue;
294
- let a = e instanceof Headers ? e.entries() : Object.entries(e);
295
- for (let [i, o] of a) if (o === null) r.delete(i);
296
- else if (Array.isArray(o)) for (let n of o) r.append(i, n);
297
- else o !== void 0 && r.set(i, typeof o == "object" ? JSON.stringify(o) : o);
298
- }
299
- return r;
766
+ var buildUrl = (options) => getUrl({
767
+ baseUrl: options.baseUrl,
768
+ path: options.path,
769
+ query: options.query,
770
+ querySerializer: typeof options.querySerializer === "function" ? options.querySerializer : createQuerySerializer(options.querySerializer),
771
+ url: options.url
772
+ });
773
+ var mergeConfigs = (a, b) => {
774
+ const config = { ...a, ...b };
775
+ if (config.baseUrl?.endsWith("/")) {
776
+ config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1);
777
+ }
778
+ config.headers = mergeHeaders(a.headers, b.headers);
779
+ return config;
780
+ };
781
+ var headersEntries = (headers) => {
782
+ const entries = [];
783
+ headers.forEach((value, key) => {
784
+ entries.push([key, value]);
785
+ });
786
+ return entries;
787
+ };
788
+ var mergeHeaders = (...headers) => {
789
+ const mergedHeaders = new Headers();
790
+ for (const header of headers) {
791
+ if (!header) {
792
+ continue;
793
+ }
794
+ const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);
795
+ for (const [key, value] of iterator) {
796
+ if (value === null) {
797
+ mergedHeaders.delete(key);
798
+ } else if (Array.isArray(value)) {
799
+ for (const v of value) {
800
+ mergedHeaders.append(key, v);
801
+ }
802
+ } else if (value !== void 0) {
803
+ mergedHeaders.set(
804
+ key,
805
+ typeof value === "object" ? JSON.stringify(value) : value
806
+ );
807
+ }
808
+ }
809
+ }
810
+ return mergedHeaders;
300
811
  };
301
- var g = class {
812
+ var Interceptors = class {
302
813
  constructor() {
303
- __publicField(this, "_fns");
304
- this._fns = [];
814
+ this.fns = [];
305
815
  }
306
816
  clear() {
307
- this._fns = [];
817
+ this.fns = [];
308
818
  }
309
- getInterceptorIndex(r) {
310
- return typeof r == "number" ? this._fns[r] ? r : -1 : this._fns.indexOf(r);
819
+ eject(id) {
820
+ const index = this.getInterceptorIndex(id);
821
+ if (this.fns[index]) {
822
+ this.fns[index] = null;
823
+ }
311
824
  }
312
- exists(r) {
313
- let e = this.getInterceptorIndex(r);
314
- return !!this._fns[e];
825
+ exists(id) {
826
+ const index = this.getInterceptorIndex(id);
827
+ return Boolean(this.fns[index]);
315
828
  }
316
- eject(r) {
317
- let e = this.getInterceptorIndex(r);
318
- this._fns[e] && (this._fns[e] = null);
829
+ getInterceptorIndex(id) {
830
+ if (typeof id === "number") {
831
+ return this.fns[id] ? id : -1;
832
+ }
833
+ return this.fns.indexOf(id);
319
834
  }
320
- update(r, e) {
321
- let a = this.getInterceptorIndex(r);
322
- return this._fns[a] ? (this._fns[a] = e, r) : false;
835
+ update(id, fn) {
836
+ const index = this.getInterceptorIndex(id);
837
+ if (this.fns[index]) {
838
+ this.fns[index] = fn;
839
+ return id;
840
+ }
841
+ return false;
323
842
  }
324
- use(r) {
325
- return this._fns = [...this._fns, r], this._fns.length - 1;
843
+ use(fn) {
844
+ this.fns.push(fn);
845
+ return this.fns.length - 1;
326
846
  }
327
847
  };
328
- var v = () => ({ error: new g(), request: new g(), response: new g() });
329
- var V = k({ allowReserved: false, array: { explode: true, style: "form" }, object: { explode: true, style: "deepObject" } });
330
- var F = { "Content-Type": "application/json" };
331
- var w = (s = {}) => ({ ...O, headers: F, parseAs: "auto", querySerializer: V, ...s });
332
- var G = (s = {}) => {
333
- let r = x(w(), s), e = () => ({ ...r }), a = (n) => (r = x(r, n), e()), i = v(), o = async (n) => {
334
- let t = { ...r, ...n, fetch: n.fetch ?? r.fetch ?? globalThis.fetch, headers: j(r.headers, n.headers) };
335
- t.security && await $({ ...t, security: t.security }), t.body && t.bodySerializer && (t.body = t.bodySerializer(t.body)), (t.body === void 0 || t.body === "") && t.headers.delete("Content-Type");
336
- let l = C(t), u = { redirect: "follow", ...t }, p = new Request(l, u);
337
- for (let f of i.request._fns) f && (p = await f(p, t));
338
- let d = t.fetch, c = await d(p);
339
- for (let f of i.response._fns) f && (c = await f(c, p, t));
340
- let b = { request: p, response: c };
341
- if (c.ok) {
342
- if (c.status === 204 || c.headers.get("Content-Length") === "0") return t.responseStyle === "data" ? {} : { data: {}, ...b };
343
- let f = (t.parseAs === "auto" ? E(c.headers.get("Content-Type")) : t.parseAs) ?? "json";
344
- if (f === "stream") return t.responseStyle === "data" ? c.body : { data: c.body, ...b };
345
- let h = await c[f]();
346
- return f === "json" && (t.responseValidator && await t.responseValidator(h), t.responseTransformer && (h = await t.responseTransformer(h))), t.responseStyle === "data" ? h : { data: h, ...b };
848
+ var createInterceptors = () => ({
849
+ error: new Interceptors(),
850
+ request: new Interceptors(),
851
+ response: new Interceptors()
852
+ });
853
+ var defaultQuerySerializer = createQuerySerializer({
854
+ allowReserved: false,
855
+ array: {
856
+ explode: true,
857
+ style: "form"
858
+ },
859
+ object: {
860
+ explode: true,
861
+ style: "deepObject"
862
+ }
863
+ });
864
+ var defaultHeaders = {
865
+ "Content-Type": "application/json"
866
+ };
867
+ var createConfig = (override = {}) => ({
868
+ ...jsonBodySerializer,
869
+ headers: defaultHeaders,
870
+ parseAs: "auto",
871
+ querySerializer: defaultQuerySerializer,
872
+ ...override
873
+ });
874
+
875
+ // src/_internal/client/client.gen.ts
876
+ var createClient = (config = {}) => {
877
+ let _config = mergeConfigs(createConfig(), config);
878
+ const getConfig = () => ({ ..._config });
879
+ const setConfig = (config2) => {
880
+ _config = mergeConfigs(_config, config2);
881
+ return getConfig();
882
+ };
883
+ const interceptors = createInterceptors();
884
+ const beforeRequest = async (options) => {
885
+ const opts = {
886
+ ..._config,
887
+ ...options,
888
+ fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
889
+ headers: mergeHeaders(_config.headers, options.headers),
890
+ serializedBody: void 0
891
+ };
892
+ if (opts.security) {
893
+ await setAuthParams({
894
+ ...opts,
895
+ security: opts.security
896
+ });
897
+ }
898
+ if (opts.requestValidator) {
899
+ await opts.requestValidator(opts);
900
+ }
901
+ if (opts.body !== void 0 && opts.bodySerializer) {
902
+ opts.serializedBody = opts.bodySerializer(opts.body);
903
+ }
904
+ if (opts.body === void 0 || opts.serializedBody === "") {
905
+ opts.headers.delete("Content-Type");
906
+ }
907
+ const url = buildUrl(opts);
908
+ return { opts, url };
909
+ };
910
+ const request = async (options) => {
911
+ const { opts, url } = await beforeRequest(options);
912
+ const requestInit = {
913
+ redirect: "follow",
914
+ ...opts,
915
+ body: getValidRequestBody(opts)
916
+ };
917
+ let request2 = new Request(url, requestInit);
918
+ for (const fn of interceptors.request.fns) {
919
+ if (fn) {
920
+ request2 = await fn(request2, opts);
921
+ }
922
+ }
923
+ const _fetch = opts.fetch;
924
+ let response;
925
+ try {
926
+ response = await _fetch(request2);
927
+ } catch (error2) {
928
+ let finalError2 = error2;
929
+ for (const fn of interceptors.error.fns) {
930
+ if (fn) {
931
+ finalError2 = await fn(
932
+ error2,
933
+ void 0,
934
+ request2,
935
+ opts
936
+ );
937
+ }
938
+ }
939
+ finalError2 = finalError2 || {};
940
+ if (opts.throwOnError) {
941
+ throw finalError2;
942
+ }
943
+ return opts.responseStyle === "data" ? void 0 : {
944
+ error: finalError2,
945
+ request: request2,
946
+ response: void 0
947
+ };
948
+ }
949
+ for (const fn of interceptors.response.fns) {
950
+ if (fn) {
951
+ response = await fn(response, request2, opts);
952
+ }
953
+ }
954
+ const result = {
955
+ request: request2,
956
+ response
957
+ };
958
+ if (response.ok) {
959
+ const parseAs = (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json";
960
+ if (response.status === 204 || response.headers.get("Content-Length") === "0") {
961
+ let emptyData;
962
+ switch (parseAs) {
963
+ case "arrayBuffer":
964
+ case "blob":
965
+ case "text":
966
+ emptyData = await response[parseAs]();
967
+ break;
968
+ case "formData":
969
+ emptyData = new FormData();
970
+ break;
971
+ case "stream":
972
+ emptyData = response.body;
973
+ break;
974
+ case "json":
975
+ default:
976
+ emptyData = {};
977
+ break;
978
+ }
979
+ return opts.responseStyle === "data" ? emptyData : {
980
+ data: emptyData,
981
+ ...result
982
+ };
983
+ }
984
+ let data;
985
+ switch (parseAs) {
986
+ case "arrayBuffer":
987
+ case "blob":
988
+ case "formData":
989
+ case "json":
990
+ case "text":
991
+ data = await response[parseAs]();
992
+ break;
993
+ case "stream":
994
+ return opts.responseStyle === "data" ? response.body : {
995
+ data: response.body,
996
+ ...result
997
+ };
998
+ }
999
+ if (parseAs === "json") {
1000
+ if (opts.responseValidator) {
1001
+ await opts.responseValidator(data);
1002
+ }
1003
+ if (opts.responseTransformer) {
1004
+ data = await opts.responseTransformer(data);
1005
+ }
1006
+ }
1007
+ return opts.responseStyle === "data" ? data : {
1008
+ data,
1009
+ ...result
1010
+ };
347
1011
  }
348
- let R = await c.text();
1012
+ const textError = await response.text();
1013
+ let jsonError;
349
1014
  try {
350
- R = JSON.parse(R);
1015
+ jsonError = JSON.parse(textError);
351
1016
  } catch {
352
1017
  }
353
- let y = R;
354
- for (let f of i.error._fns) f && (y = await f(R, c, p, t));
355
- if (y = y || {}, t.throwOnError) throw y;
356
- return t.responseStyle === "data" ? void 0 : { error: y, ...b };
1018
+ const error = jsonError ?? textError;
1019
+ let finalError = error;
1020
+ for (const fn of interceptors.error.fns) {
1021
+ if (fn) {
1022
+ finalError = await fn(error, response, request2, opts);
1023
+ }
1024
+ }
1025
+ finalError = finalError || {};
1026
+ if (opts.throwOnError) {
1027
+ throw finalError;
1028
+ }
1029
+ return opts.responseStyle === "data" ? void 0 : {
1030
+ error: finalError,
1031
+ ...result
1032
+ };
1033
+ };
1034
+ const makeMethodFn = (method) => (options) => request({ ...options, method });
1035
+ const makeSseFn = (method) => async (options) => {
1036
+ const { opts, url } = await beforeRequest(options);
1037
+ return createSseClient({
1038
+ ...opts,
1039
+ body: opts.body,
1040
+ headers: opts.headers,
1041
+ method,
1042
+ onRequest: async (url2, init) => {
1043
+ let request2 = new Request(url2, init);
1044
+ for (const fn of interceptors.request.fns) {
1045
+ if (fn) {
1046
+ request2 = await fn(request2, opts);
1047
+ }
1048
+ }
1049
+ return request2;
1050
+ },
1051
+ url
1052
+ });
1053
+ };
1054
+ return {
1055
+ buildUrl,
1056
+ connect: makeMethodFn("CONNECT"),
1057
+ delete: makeMethodFn("DELETE"),
1058
+ get: makeMethodFn("GET"),
1059
+ getConfig,
1060
+ head: makeMethodFn("HEAD"),
1061
+ interceptors,
1062
+ options: makeMethodFn("OPTIONS"),
1063
+ patch: makeMethodFn("PATCH"),
1064
+ post: makeMethodFn("POST"),
1065
+ put: makeMethodFn("PUT"),
1066
+ request,
1067
+ setConfig,
1068
+ sse: {
1069
+ connect: makeSseFn("CONNECT"),
1070
+ delete: makeSseFn("DELETE"),
1071
+ get: makeSseFn("GET"),
1072
+ head: makeSseFn("HEAD"),
1073
+ options: makeSseFn("OPTIONS"),
1074
+ patch: makeSseFn("PATCH"),
1075
+ post: makeSseFn("POST"),
1076
+ put: makeSseFn("PUT"),
1077
+ trace: makeSseFn("TRACE")
1078
+ },
1079
+ trace: makeMethodFn("TRACE")
357
1080
  };
358
- return { buildUrl: C, connect: (n) => o({ ...n, method: "CONNECT" }), delete: (n) => o({ ...n, method: "DELETE" }), get: (n) => o({ ...n, method: "GET" }), getConfig: e, head: (n) => o({ ...n, method: "HEAD" }), interceptors: i, options: (n) => o({ ...n, method: "OPTIONS" }), patch: (n) => o({ ...n, method: "PATCH" }), post: (n) => o({ ...n, method: "POST" }), put: (n) => o({ ...n, method: "PUT" }), request: o, setConfig: a, trace: (n) => o({ ...n, method: "TRACE" }) };
359
1081
  };
360
1082
 
361
- // src/_internal/services.gen.ts
362
- var client = G(w());
363
- var SearchService = class {
364
- /**
365
- * /ai/search/advanced operation on search resource
366
- */
367
- static postAiSearchAdvanced(options) {
368
- return (options?.client ?? client).post({
369
- ...options,
370
- url: "/ai/search/advanced"
371
- });
1083
+ // src/_internal/client.gen.ts
1084
+ var client = createClient(
1085
+ createConfig({ baseUrl: "http://localhost:22222" })
1086
+ );
1087
+
1088
+ // src/_internal/sdk.gen.ts
1089
+ var postAiSearchAdvanced = (options) => (options.client ?? client).post({
1090
+ security: [{ scheme: "bearer", type: "http" }],
1091
+ url: "/ai/search/advanced",
1092
+ ...options,
1093
+ headers: {
1094
+ "Content-Type": "application/vnd.api+json",
1095
+ ...options.headers
372
1096
  }
373
- /**
374
- * /search/indexes operation on search resource
375
- */
376
- static getSearchIndexes(options) {
377
- return (options?.client ?? client).get({
378
- ...options,
379
- url: "/search/indexes"
380
- });
1097
+ });
1098
+ var getThreads = (options) => (options.client ?? client).get({
1099
+ security: [{ scheme: "bearer", type: "http" }],
1100
+ url: "/threads",
1101
+ ...options
1102
+ });
1103
+ var postThreads = (options) => (options.client ?? client).post({
1104
+ security: [{ scheme: "bearer", type: "http" }],
1105
+ url: "/threads",
1106
+ ...options,
1107
+ headers: {
1108
+ "Content-Type": "application/vnd.api+json",
1109
+ ...options.headers
381
1110
  }
382
- /**
383
- * /search operation on search resource
384
- */
385
- static getSearch(options) {
386
- return (options?.client ?? client).get({
387
- ...options,
388
- url: "/search"
389
- });
1111
+ });
1112
+ var getLlmAnalyticsCosts = (options) => (options.client ?? client).get({
1113
+ security: [{ scheme: "bearer", type: "http" }],
1114
+ url: "/llm_analytics/costs",
1115
+ ...options
1116
+ });
1117
+ var getAiChunksDocumentByDocumentId = (options) => (options.client ?? client).get({
1118
+ security: [{ scheme: "bearer", type: "http" }],
1119
+ url: "/ai/chunks/document/{document_id}",
1120
+ ...options
1121
+ });
1122
+ var deleteExtractionResultsById = (options) => (options.client ?? client).delete({
1123
+ security: [{ scheme: "bearer", type: "http" }],
1124
+ url: "/extraction_results/{id}",
1125
+ ...options
1126
+ });
1127
+ var getExtractionResultsById = (options) => (options.client ?? client).get({
1128
+ security: [{ scheme: "bearer", type: "http" }],
1129
+ url: "/extraction_results/{id}",
1130
+ ...options
1131
+ });
1132
+ var patchExtractionResultsById = (options) => (options.client ?? client).patch({
1133
+ security: [{ scheme: "bearer", type: "http" }],
1134
+ url: "/extraction_results/{id}",
1135
+ ...options,
1136
+ headers: {
1137
+ "Content-Type": "application/vnd.api+json",
1138
+ ...options.headers
390
1139
  }
391
- /**
392
- * /search/semantic operation on search resource
393
- */
394
- static getSearchSemantic(options) {
395
- return (options?.client ?? client).get({
396
- ...options,
397
- url: "/search/semantic"
398
- });
1140
+ });
1141
+ var getWorkspaces = (options) => (options.client ?? client).get({
1142
+ security: [{ scheme: "bearer", type: "http" }],
1143
+ url: "/workspaces",
1144
+ ...options
1145
+ });
1146
+ var postWorkspaces = (options) => (options.client ?? client).post({
1147
+ security: [{ scheme: "bearer", type: "http" }],
1148
+ url: "/workspaces",
1149
+ ...options,
1150
+ headers: {
1151
+ "Content-Type": "application/vnd.api+json",
1152
+ ...options.headers
399
1153
  }
400
- /**
401
- * /ai/search operation on search resource
402
- */
403
- static postAiSearch(options) {
404
- return (options?.client ?? client).post({
405
- ...options,
406
- url: "/ai/search"
407
- });
1154
+ });
1155
+ var getDocumentsStats = (options) => (options.client ?? client).get({
1156
+ security: [{ scheme: "bearer", type: "http" }],
1157
+ url: "/documents/stats",
1158
+ ...options
1159
+ });
1160
+ var postObjectsRegister = (options) => (options.client ?? client).post({
1161
+ security: [{ scheme: "bearer", type: "http" }],
1162
+ url: "/objects/register",
1163
+ ...options,
1164
+ headers: {
1165
+ "Content-Type": "application/vnd.api+json",
1166
+ ...options.headers
408
1167
  }
409
- /**
410
- * /search/health operation on search resource
411
- */
412
- static getSearchHealth(options) {
413
- return (options?.client ?? client).get({
414
- ...options,
415
- url: "/search/health"
416
- });
1168
+ });
1169
+ var getLlmAnalyticsWorkspace = (options) => (options.client ?? client).get({
1170
+ security: [{ scheme: "bearer", type: "http" }],
1171
+ url: "/llm_analytics/workspace",
1172
+ ...options
1173
+ });
1174
+ var getSearchIndexes = (options) => (options.client ?? client).get({
1175
+ security: [{ scheme: "bearer", type: "http" }],
1176
+ url: "/search/indexes",
1177
+ ...options
1178
+ });
1179
+ var getCreditPackagesSlugBySlug = (options) => (options.client ?? client).get({
1180
+ security: [{ scheme: "bearer", type: "http" }],
1181
+ url: "/credit-packages/slug/{slug}",
1182
+ ...options
1183
+ });
1184
+ var getLlmAnalyticsPlatform = (options) => (options.client ?? client).get({
1185
+ security: [{ scheme: "bearer", type: "http" }],
1186
+ url: "/llm_analytics/platform",
1187
+ ...options
1188
+ });
1189
+ var postPayments = (options) => (options.client ?? client).post({
1190
+ security: [{ scheme: "bearer", type: "http" }],
1191
+ url: "/payments",
1192
+ ...options,
1193
+ headers: {
1194
+ "Content-Type": "application/vnd.api+json",
1195
+ ...options.headers
417
1196
  }
418
- /**
419
- * /search/status operation on search resource
420
- */
421
- static getSearchStatus(options) {
422
- return (options?.client ?? client).get({
423
- ...options,
424
- url: "/search/status"
425
- });
1197
+ });
1198
+ var patchApiKeysByIdRevoke = (options) => (options.client ?? client).patch({
1199
+ security: [{ scheme: "bearer", type: "http" }],
1200
+ url: "/api_keys/{id}/revoke",
1201
+ ...options,
1202
+ headers: {
1203
+ "Content-Type": "application/vnd.api+json",
1204
+ ...options.headers
426
1205
  }
427
- /**
428
- * /search/reindex operation on search resource
429
- */
430
- static postSearchReindex(options) {
431
- return (options?.client ?? client).post({
432
- ...options,
433
- url: "/search/reindex"
434
- });
1206
+ });
1207
+ var getInvitationsConsumeByToken = (options) => (options.client ?? client).get({
1208
+ security: [{ scheme: "bearer", type: "http" }],
1209
+ url: "/invitations/consume/{token}",
1210
+ ...options
1211
+ });
1212
+ var patchWorkspacesByIdAllocate = (options) => (options.client ?? client).patch({
1213
+ security: [{ scheme: "bearer", type: "http" }],
1214
+ url: "/workspaces/{id}/allocate",
1215
+ ...options,
1216
+ headers: {
1217
+ "Content-Type": "application/vnd.api+json",
1218
+ ...options.headers
435
1219
  }
436
- /**
437
- * /search/stats operation on search resource
438
- */
439
- static getSearchStats(options) {
440
- return (options?.client ?? client).get({
441
- ...options,
442
- url: "/search/stats"
443
- });
1220
+ });
1221
+ var postThreadsActive = (options) => (options.client ?? client).post({
1222
+ security: [{ scheme: "bearer", type: "http" }],
1223
+ url: "/threads/active",
1224
+ ...options,
1225
+ headers: {
1226
+ "Content-Type": "application/vnd.api+json",
1227
+ ...options.headers
444
1228
  }
445
- };
446
- var ThreadService = class {
447
- /**
448
- * /threads operation on thread resource
449
- */
450
- static getThreads(options) {
451
- return (options?.client ?? client).get({
452
- ...options,
453
- url: "/threads"
454
- });
1229
+ });
1230
+ var patchInvitationsByIdRevoke = (options) => (options.client ?? client).patch({
1231
+ security: [{ scheme: "bearer", type: "http" }],
1232
+ url: "/invitations/{id}/revoke",
1233
+ ...options,
1234
+ headers: {
1235
+ "Content-Type": "application/vnd.api+json",
1236
+ ...options.headers
455
1237
  }
456
- /**
457
- * /threads operation on thread resource
458
- */
459
- static postThreads(options) {
460
- return (options?.client ?? client).post({
461
- ...options,
462
- url: "/threads"
463
- });
1238
+ });
1239
+ var getConfigs = (options) => (options.client ?? client).get({
1240
+ security: [{ scheme: "bearer", type: "http" }],
1241
+ url: "/configs",
1242
+ ...options
1243
+ });
1244
+ var postConfigs = (options) => (options.client ?? client).post({
1245
+ security: [{ scheme: "bearer", type: "http" }],
1246
+ url: "/configs",
1247
+ ...options,
1248
+ headers: {
1249
+ "Content-Type": "application/vnd.api+json",
1250
+ ...options.headers
464
1251
  }
465
- /**
466
- * /threads/active operation on thread resource
467
- */
468
- static postThreadsActive(options) {
469
- return (options?.client ?? client).post({
470
- ...options,
471
- url: "/threads/active"
472
- });
1252
+ });
1253
+ var postTokens = (options) => (options.client ?? client).post({
1254
+ security: [{ scheme: "bearer", type: "http" }],
1255
+ url: "/tokens",
1256
+ ...options,
1257
+ headers: {
1258
+ "Content-Type": "application/vnd.api+json",
1259
+ ...options.headers
473
1260
  }
474
- /**
475
- * /threads/:id/messages operation on thread resource
476
- */
477
- static postThreadsByIdMessages(options) {
478
- return (options?.client ?? client).post({
479
- ...options,
480
- url: "/threads/{id}/messages"
481
- });
1261
+ });
1262
+ var deleteTrainingExamplesById = (options) => (options.client ?? client).delete({
1263
+ security: [{ scheme: "bearer", type: "http" }],
1264
+ url: "/training_examples/{id}",
1265
+ ...options
1266
+ });
1267
+ var getTrainingExamplesById = (options) => (options.client ?? client).get({
1268
+ security: [{ scheme: "bearer", type: "http" }],
1269
+ url: "/training_examples/{id}",
1270
+ ...options
1271
+ });
1272
+ var patchTrainingExamplesById = (options) => (options.client ?? client).patch({
1273
+ security: [{ scheme: "bearer", type: "http" }],
1274
+ url: "/training_examples/{id}",
1275
+ ...options,
1276
+ headers: {
1277
+ "Content-Type": "application/vnd.api+json",
1278
+ ...options.headers
482
1279
  }
483
- /**
484
- * /threads/:id operation on thread resource
485
- */
486
- static deleteThreadsById(options) {
487
- return (options?.client ?? client).delete({
488
- ...options,
489
- url: "/threads/{id}"
490
- });
1280
+ });
1281
+ var deleteSearchSavedById = (options) => (options.client ?? client).delete({
1282
+ security: [{ scheme: "bearer", type: "http" }],
1283
+ url: "/search/saved/{id}",
1284
+ ...options
1285
+ });
1286
+ var patchUsersAuthResetPassword = (options) => (options.client ?? client).patch({
1287
+ security: [{ scheme: "bearer", type: "http" }],
1288
+ url: "/users/auth/reset-password",
1289
+ ...options,
1290
+ headers: {
1291
+ "Content-Type": "application/vnd.api+json",
1292
+ ...options.headers
491
1293
  }
492
- /**
493
- * /threads/:id operation on thread resource
494
- */
495
- static getThreadsById(options) {
496
- return (options?.client ?? client).get({
497
- ...options,
498
- url: "/threads/{id}"
499
- });
1294
+ });
1295
+ var getBucketsByIdStats = (options) => (options.client ?? client).get({
1296
+ security: [{ scheme: "bearer", type: "http" }],
1297
+ url: "/buckets/{id}/stats",
1298
+ ...options
1299
+ });
1300
+ var getDocumentsSearch = (options) => (options.client ?? client).get({
1301
+ security: [{ scheme: "bearer", type: "http" }],
1302
+ url: "/documents/search",
1303
+ ...options
1304
+ });
1305
+ var getBucketsByIdObjects = (options) => (options.client ?? client).get({
1306
+ security: [{ scheme: "bearer", type: "http" }],
1307
+ url: "/buckets/{id}/objects",
1308
+ ...options
1309
+ });
1310
+ var patchInvitationsByIdResend = (options) => (options.client ?? client).patch({
1311
+ security: [{ scheme: "bearer", type: "http" }],
1312
+ url: "/invitations/{id}/resend",
1313
+ ...options,
1314
+ headers: {
1315
+ "Content-Type": "application/vnd.api+json",
1316
+ ...options.headers
500
1317
  }
501
- /**
502
- * /threads/:id operation on thread resource
503
- */
504
- static patchThreadsById(options) {
505
- return (options?.client ?? client).patch({
506
- ...options,
507
- url: "/threads/{id}"
508
- });
1318
+ });
1319
+ var getSearchSaved = (options) => (options.client ?? client).get({
1320
+ security: [{ scheme: "bearer", type: "http" }],
1321
+ url: "/search/saved",
1322
+ ...options
1323
+ });
1324
+ var postSearchSaved = (options) => (options.client ?? client).post({
1325
+ security: [{ scheme: "bearer", type: "http" }],
1326
+ url: "/search/saved",
1327
+ ...options,
1328
+ headers: {
1329
+ "Content-Type": "application/vnd.api+json",
1330
+ ...options.headers
509
1331
  }
510
- /**
511
- * /threads/search operation on thread resource
512
- */
513
- static getThreadsSearch(options) {
514
- return (options?.client ?? client).get({
515
- ...options,
516
- url: "/threads/search"
517
- });
1332
+ });
1333
+ var getUserProfilesMe = (options) => (options.client ?? client).get({
1334
+ security: [{ scheme: "bearer", type: "http" }],
1335
+ url: "/user_profiles/me",
1336
+ ...options
1337
+ });
1338
+ var postInvitationsInvite = (options) => (options.client ?? client).post({
1339
+ security: [{ scheme: "bearer", type: "http" }],
1340
+ url: "/invitations/invite",
1341
+ ...options,
1342
+ headers: {
1343
+ "Content-Type": "application/vnd.api+json",
1344
+ ...options.headers
518
1345
  }
519
- /**
520
- * /threads/:id/summarize operation on thread resource
521
- */
522
- static postThreadsByIdSummarize(options) {
523
- return (options?.client ?? client).post({
524
- ...options,
525
- url: "/threads/{id}/summarize"
526
- });
1346
+ });
1347
+ var deleteWebhookConfigsById = (options) => (options.client ?? client).delete({
1348
+ security: [{ scheme: "bearer", type: "http" }],
1349
+ url: "/webhook_configs/{id}",
1350
+ ...options
1351
+ });
1352
+ var getWebhookConfigsById = (options) => (options.client ?? client).get({
1353
+ security: [{ scheme: "bearer", type: "http" }],
1354
+ url: "/webhook_configs/{id}",
1355
+ ...options
1356
+ });
1357
+ var patchWebhookConfigsById = (options) => (options.client ?? client).patch({
1358
+ security: [{ scheme: "bearer", type: "http" }],
1359
+ url: "/webhook_configs/{id}",
1360
+ ...options,
1361
+ headers: {
1362
+ "Content-Type": "application/vnd.api+json",
1363
+ ...options.headers
527
1364
  }
528
- };
529
- var ExtractionResultService = class {
530
- /**
531
- * /extraction_results/:id operation on extraction_result resource
532
- */
533
- static deleteExtractionResultsById(options) {
534
- return (options?.client ?? client).delete({
535
- ...options,
536
- url: "/extraction_results/{id}"
537
- });
1365
+ });
1366
+ var postInvitationsAcceptByToken = (options) => (options.client ?? client).post({
1367
+ security: [{ scheme: "bearer", type: "http" }],
1368
+ url: "/invitations/accept_by_token",
1369
+ ...options,
1370
+ headers: {
1371
+ "Content-Type": "application/vnd.api+json",
1372
+ ...options.headers
538
1373
  }
539
- /**
540
- * /extraction_results/:id operation on extraction_result resource
541
- */
542
- static getExtractionResultsById(options) {
543
- return (options?.client ?? client).get({
544
- ...options,
545
- url: "/extraction_results/{id}"
546
- });
1374
+ });
1375
+ var postDocumentsBulkDelete = (options) => (options.client ?? client).post({
1376
+ security: [{ scheme: "bearer", type: "http" }],
1377
+ url: "/documents/bulk_delete",
1378
+ ...options,
1379
+ headers: {
1380
+ "Content-Type": "application/vnd.api+json",
1381
+ ...options.headers
547
1382
  }
548
- /**
549
- * /extraction_results/:id operation on extraction_result resource
550
- */
551
- static patchExtractionResultsById(options) {
552
- return (options?.client ?? client).patch({
553
- ...options,
554
- url: "/extraction_results/{id}"
555
- });
1383
+ });
1384
+ var postAiChunksSearch = (options) => (options.client ?? client).post({
1385
+ security: [{ scheme: "bearer", type: "http" }],
1386
+ url: "/ai/chunks/search",
1387
+ ...options,
1388
+ headers: {
1389
+ "Content-Type": "application/vnd.api+json",
1390
+ ...options.headers
556
1391
  }
557
- /**
558
- * /extraction_results operation on extraction_result resource
559
- */
560
- static getExtractionResults(options) {
561
- return (options?.client ?? client).get({
562
- ...options,
563
- url: "/extraction_results"
564
- });
1392
+ });
1393
+ var postThreadsByIdMessages = (options) => (options.client ?? client).post({
1394
+ security: [{ scheme: "bearer", type: "http" }],
1395
+ url: "/threads/{id}/messages",
1396
+ ...options,
1397
+ headers: {
1398
+ "Content-Type": "application/vnd.api+json",
1399
+ ...options.headers
565
1400
  }
566
- /**
567
- * /documents/:id/extraction_results operation on extraction_result resource
568
- */
569
- static getDocumentsByIdExtractionResults(options) {
570
- return (options?.client ?? client).get({
571
- ...options,
572
- url: "/documents/{id}/extraction_results"
573
- });
1401
+ });
1402
+ var patchInvitationsByIdAccept = (options) => (options.client ?? client).patch({
1403
+ security: [{ scheme: "bearer", type: "http" }],
1404
+ url: "/invitations/{id}/accept",
1405
+ ...options,
1406
+ headers: {
1407
+ "Content-Type": "application/vnd.api+json",
1408
+ ...options.headers
574
1409
  }
575
- };
576
- var WorkspaceService = class {
577
- /**
578
- * /workspaces operation on workspace resource
579
- */
580
- static getWorkspaces(options) {
581
- return (options?.client ?? client).get({
582
- ...options,
583
- url: "/workspaces"
584
- });
1410
+ });
1411
+ var getCreditPackagesById = (options) => (options.client ?? client).get({
1412
+ security: [{ scheme: "bearer", type: "http" }],
1413
+ url: "/credit-packages/{id}",
1414
+ ...options
1415
+ });
1416
+ var getUsersById = (options) => (options.client ?? client).get({
1417
+ security: [{ scheme: "bearer", type: "http" }],
1418
+ url: "/users/{id}",
1419
+ ...options
1420
+ });
1421
+ var patchUsersById = (options) => (options.client ?? client).patch({
1422
+ security: [{ scheme: "bearer", type: "http" }],
1423
+ url: "/users/{id}",
1424
+ ...options,
1425
+ headers: {
1426
+ "Content-Type": "application/vnd.api+json",
1427
+ ...options.headers
585
1428
  }
586
- /**
587
- * /workspaces operation on workspace resource
588
- */
589
- static postWorkspaces(options) {
590
- return (options?.client ?? client).post({
591
- ...options,
592
- url: "/workspaces"
593
- });
1429
+ });
1430
+ var postAgentsByIdValidate = (options) => (options.client ?? client).post({
1431
+ security: [{ scheme: "bearer", type: "http" }],
1432
+ url: "/agents/{id}/validate",
1433
+ ...options,
1434
+ headers: {
1435
+ "Content-Type": "application/vnd.api+json",
1436
+ ...options.headers
594
1437
  }
595
- /**
596
- * /workspaces/:id/allocate operation on workspace resource
597
- */
598
- static patchWorkspacesByIdAllocate(options) {
599
- return (options?.client ?? client).patch({
600
- ...options,
601
- url: "/workspaces/{id}/allocate"
602
- });
1438
+ });
1439
+ var postWebhookConfigsByIdTest = (options) => (options.client ?? client).post({
1440
+ security: [{ scheme: "bearer", type: "http" }],
1441
+ url: "/webhook_configs/{id}/test",
1442
+ ...options,
1443
+ headers: {
1444
+ "Content-Type": "application/vnd.api+json",
1445
+ ...options.headers
603
1446
  }
604
- /**
605
- * /workspaces/:id operation on workspace resource
606
- */
607
- static deleteWorkspacesById(options) {
608
- return (options?.client ?? client).delete({
609
- ...options,
610
- url: "/workspaces/{id}"
611
- });
1447
+ });
1448
+ var getUsersMe = (options) => (options.client ?? client).get({
1449
+ security: [{ scheme: "bearer", type: "http" }],
1450
+ url: "/users/me",
1451
+ ...options
1452
+ });
1453
+ var postUsersAuthRegisterWithOidc = (options) => (options.client ?? client).post({
1454
+ security: [{ scheme: "bearer", type: "http" }],
1455
+ url: "/users/auth/register_with_oidc",
1456
+ ...options,
1457
+ headers: {
1458
+ "Content-Type": "application/vnd.api+json",
1459
+ ...options.headers
612
1460
  }
613
- /**
614
- * /workspaces/:id operation on workspace resource
615
- */
616
- static getWorkspacesById(options) {
617
- return (options?.client ?? client).get({
618
- ...options,
619
- url: "/workspaces/{id}"
620
- });
1461
+ });
1462
+ var getTransactionsById = (options) => (options.client ?? client).get({
1463
+ security: [{ scheme: "bearer", type: "http" }],
1464
+ url: "/transactions/{id}",
1465
+ ...options
1466
+ });
1467
+ var getTenantMemberships = (options) => (options.client ?? client).get({
1468
+ security: [{ scheme: "bearer", type: "http" }],
1469
+ url: "/tenant-memberships",
1470
+ ...options
1471
+ });
1472
+ var postTenantMemberships = (options) => (options.client ?? client).post({
1473
+ security: [{ scheme: "bearer", type: "http" }],
1474
+ url: "/tenant-memberships",
1475
+ ...options,
1476
+ headers: {
1477
+ "Content-Type": "application/vnd.api+json",
1478
+ ...options.headers
621
1479
  }
622
- /**
623
- * /workspaces/:id operation on workspace resource
624
- */
625
- static patchWorkspacesById(options) {
626
- return (options?.client ?? client).patch({
627
- ...options,
628
- url: "/workspaces/{id}"
629
- });
1480
+ });
1481
+ var getDocuments = (options) => (options.client ?? client).get({
1482
+ security: [{ scheme: "bearer", type: "http" }],
1483
+ url: "/documents",
1484
+ ...options
1485
+ });
1486
+ var postDocuments = (options) => (options.client ?? client).post({
1487
+ security: [{ scheme: "bearer", type: "http" }],
1488
+ url: "/documents",
1489
+ ...options,
1490
+ headers: {
1491
+ "Content-Type": "application/vnd.api+json",
1492
+ ...options.headers
630
1493
  }
631
- /**
632
- * /workspaces/mine operation on workspace resource
633
- */
634
- static getWorkspacesMine(options) {
635
- return (options?.client ?? client).get({
636
- ...options,
637
- url: "/workspaces/mine"
638
- });
1494
+ });
1495
+ var postTrainingExamplesBulkDelete = (options) => (options.client ?? client).post({
1496
+ security: [{ scheme: "bearer", type: "http" }],
1497
+ url: "/training_examples/bulk_delete",
1498
+ ...options,
1499
+ headers: {
1500
+ "Content-Type": "application/vnd.api+json",
1501
+ ...options.headers
639
1502
  }
640
- };
641
- var ApiKeyService = class {
642
- /**
643
- * /api_keys/:id/revoke operation on api_key resource
644
- */
645
- static patchApiKeysByIdRevoke(options) {
646
- return (options?.client ?? client).patch({
647
- ...options,
648
- url: "/api_keys/{id}/revoke"
649
- });
1503
+ });
1504
+ var getLlmAnalyticsSummary = (options) => (options.client ?? client).get({
1505
+ security: [{ scheme: "bearer", type: "http" }],
1506
+ url: "/llm_analytics/summary",
1507
+ ...options
1508
+ });
1509
+ var postStorageSignDownload = (options) => (options.client ?? client).post({
1510
+ security: [{ scheme: "bearer", type: "http" }],
1511
+ url: "/storage/sign_download",
1512
+ ...options,
1513
+ headers: {
1514
+ "Content-Type": "application/vnd.api+json",
1515
+ ...options.headers
650
1516
  }
651
- /**
652
- * /api_keys operation on api_key resource
653
- */
654
- static getApiKeys(options) {
655
- return (options?.client ?? client).get({
656
- ...options,
657
- url: "/api_keys"
658
- });
1517
+ });
1518
+ var getWebhookDeliveries = (options) => (options.client ?? client).get({
1519
+ security: [{ scheme: "bearer", type: "http" }],
1520
+ url: "/webhook_deliveries",
1521
+ ...options
1522
+ });
1523
+ var deleteDocumentsById = (options) => (options.client ?? client).delete({
1524
+ security: [{ scheme: "bearer", type: "http" }],
1525
+ url: "/documents/{id}",
1526
+ ...options
1527
+ });
1528
+ var getDocumentsById = (options) => (options.client ?? client).get({
1529
+ security: [{ scheme: "bearer", type: "http" }],
1530
+ url: "/documents/{id}",
1531
+ ...options
1532
+ });
1533
+ var patchDocumentsById = (options) => (options.client ?? client).patch({
1534
+ security: [{ scheme: "bearer", type: "http" }],
1535
+ url: "/documents/{id}",
1536
+ ...options,
1537
+ headers: {
1538
+ "Content-Type": "application/vnd.api+json",
1539
+ ...options.headers
659
1540
  }
660
- /**
661
- * /api_keys operation on api_key resource
662
- */
663
- static postApiKeys(options) {
664
- return (options?.client ?? client).post({
665
- ...options,
666
- url: "/api_keys"
667
- });
1541
+ });
1542
+ var getSearch = (options) => (options.client ?? client).get({
1543
+ security: [{ scheme: "bearer", type: "http" }],
1544
+ url: "/search",
1545
+ ...options
1546
+ });
1547
+ var getInvitations = (options) => (options.client ?? client).get({
1548
+ security: [{ scheme: "bearer", type: "http" }],
1549
+ url: "/invitations",
1550
+ ...options
1551
+ });
1552
+ var postDocumentsByIdAnalyze = (options) => (options.client ?? client).post({
1553
+ security: [{ scheme: "bearer", type: "http" }],
1554
+ url: "/documents/{id}/analyze",
1555
+ ...options,
1556
+ headers: {
1557
+ "Content-Type": "application/vnd.api+json",
1558
+ ...options.headers
668
1559
  }
669
- /**
670
- * /api_keys/:id operation on api_key resource
671
- */
672
- static deleteApiKeysById(options) {
673
- return (options?.client ?? client).delete({
674
- ...options,
675
- url: "/api_keys/{id}"
676
- });
677
- }
678
- /**
679
- * /api_keys/:id operation on api_key resource
680
- */
681
- static getApiKeysById(options) {
682
- return (options?.client ?? client).get({
683
- ...options,
684
- url: "/api_keys/{id}"
685
- });
686
- }
687
- /**
688
- * /api_keys/:id operation on api_key resource
689
- */
690
- static patchApiKeysById(options) {
691
- return (options?.client ?? client).patch({
692
- ...options,
693
- url: "/api_keys/{id}"
694
- });
695
- }
696
- /**
697
- * Allocate credits to the account associated with this API Key
698
- */
699
- static patchApiKeysByIdAllocate(options) {
700
- return (options?.client ?? client).patch({
701
- ...options,
702
- url: "/api_keys/{id}/allocate"
703
- });
704
- }
705
- /**
706
- * /api_keys/:id/rotate operation on api_key resource
707
- */
708
- static patchApiKeysByIdRotate(options) {
709
- return (options?.client ?? client).patch({
710
- ...options,
711
- url: "/api_keys/{id}/rotate"
712
- });
713
- }
714
- };
715
- var InvitationService = class {
716
- /**
717
- * /invitations/consume/:token operation on invitation resource
718
- */
719
- static getInvitationsConsumeByToken(options) {
720
- return (options?.client ?? client).get({
721
- ...options,
722
- url: "/invitations/consume/{token}"
723
- });
724
- }
725
- /**
726
- * /invitations/:id/revoke operation on invitation resource
727
- */
728
- static patchInvitationsByIdRevoke(options) {
729
- return (options?.client ?? client).patch({
730
- ...options,
731
- url: "/invitations/{id}/revoke"
732
- });
733
- }
734
- /**
735
- * /invitations/:id/resend operation on invitation resource
736
- */
737
- static patchInvitationsByIdResend(options) {
738
- return (options?.client ?? client).patch({
739
- ...options,
740
- url: "/invitations/{id}/resend"
741
- });
742
- }
743
- /**
744
- * /invitations/invite operation on invitation resource
745
- */
746
- static postInvitationsInvite(options) {
747
- return (options?.client ?? client).post({
748
- ...options,
749
- url: "/invitations/invite"
750
- });
751
- }
752
- /**
753
- * Accept an invitation using only the token
754
- */
755
- static postInvitationsAcceptByToken(options) {
756
- return (options?.client ?? client).post({
757
- ...options,
758
- url: "/invitations/accept_by_token"
759
- });
760
- }
761
- /**
762
- * /invitations/:id/accept operation on invitation resource
763
- */
764
- static patchInvitationsByIdAccept(options) {
765
- return (options?.client ?? client).patch({
766
- ...options,
767
- url: "/invitations/{id}/accept"
768
- });
769
- }
770
- /**
771
- * /invitations operation on invitation resource
772
- */
773
- static getInvitations(options) {
774
- return (options?.client ?? client).get({
775
- ...options,
776
- url: "/invitations"
777
- });
778
- }
779
- };
780
- var UserService = class {
781
- /**
782
- * Reset password using admin-issued reset token
783
- */
784
- static patchUsersAuthResetPassword(options) {
785
- return (options?.client ?? client).patch({
786
- ...options,
787
- url: "/users/auth/reset-password"
788
- });
789
- }
790
- /**
791
- * /users/:id operation on user resource
792
- */
793
- static getUsersById(options) {
794
- return (options?.client ?? client).get({
795
- ...options,
796
- url: "/users/{id}"
797
- });
798
- }
799
- /**
800
- * Admin-only user management (platform admins) - promotes/demotes admin status
801
- */
802
- static patchUsersById(options) {
803
- return (options?.client ?? client).patch({
804
- ...options,
805
- url: "/users/{id}"
806
- });
807
- }
808
- /**
809
- * Get the currently authenticated user
810
- */
811
- static getUsersMe(options) {
812
- return (options?.client ?? client).get({
813
- ...options,
814
- url: "/users/me"
815
- });
816
- }
817
- /**
818
- * /users/auth/register_with_oidc operation on user resource
819
- */
820
- static postUsersAuthRegisterWithOidc(options) {
821
- return (options?.client ?? client).post({
822
- ...options,
823
- url: "/users/auth/register_with_oidc"
824
- });
825
- }
826
- /**
827
- * Admin triggers password reset email for user
828
- */
829
- static patchUsersByIdResetPassword(options) {
830
- return (options?.client ?? client).patch({
831
- ...options,
832
- url: "/users/{id}/reset-password"
833
- });
834
- }
835
- /**
836
- * /users/auth/magic_link/login operation on user resource
837
- */
838
- static postUsersAuthMagicLinkLogin(options) {
839
- return (options?.client ?? client).post({
840
- ...options,
841
- url: "/users/auth/magic_link/login"
842
- });
843
- }
844
- /**
845
- * Admin manually confirms user's email
846
- */
847
- static patchUsersByIdConfirmEmail(options) {
848
- return (options?.client ?? client).patch({
849
- ...options,
850
- url: "/users/{id}/confirm-email"
851
- });
852
- }
853
- /**
854
- * Attempt to sign in using a username and password.
855
- */
856
- static postUsersAuthLogin(options) {
857
- return (options?.client ?? client).post({
858
- ...options,
859
- url: "/users/auth/login"
860
- });
861
- }
862
- /**
863
- * /users/auth/confirm operation on user resource
864
- */
865
- static postUsersAuthConfirm(options) {
866
- return (options?.client ?? client).post({
867
- ...options,
868
- url: "/users/auth/confirm"
869
- });
870
- }
871
- /**
872
- * /users/auth/magic_link/request operation on user resource
873
- */
874
- static postUsersAuthMagicLinkRequest(options) {
875
- return (options?.client ?? client).post({
876
- ...options,
877
- url: "/users/auth/magic_link/request"
878
- });
879
- }
880
- /**
881
- * /users/auth/register operation on user resource
882
- */
883
- static postUsersAuthRegister(options) {
884
- return (options?.client ?? client).post({
885
- ...options,
886
- url: "/users/auth/register"
887
- });
888
- }
889
- /**
890
- * Platform Admin action to register a new ISV (User + Tenant + App)
891
- */
892
- static postUsersRegisterIsv(options) {
893
- return (options?.client ?? client).post({
894
- ...options,
895
- url: "/users/register_isv"
896
- });
897
- }
898
- /**
899
- * /users operation on user resource
900
- */
901
- static getUsers(options) {
902
- return (options?.client ?? client).get({
903
- ...options,
904
- url: "/users"
905
- });
906
- }
907
- };
908
- var BucketService = class {
909
- /**
910
- * /buckets/:id/stats operation on bucket resource
911
- */
912
- static getBucketsByIdStats(options) {
913
- return (options?.client ?? client).get({
914
- ...options,
915
- url: "/buckets/{id}/stats"
916
- });
917
- }
918
- /**
919
- * /buckets operation on bucket resource
920
- */
921
- static getBuckets(options) {
922
- return (options?.client ?? client).get({
923
- ...options,
924
- url: "/buckets"
925
- });
926
- }
927
- /**
928
- * /buckets operation on bucket resource
929
- */
930
- static postBuckets(options) {
931
- return (options?.client ?? client).post({
932
- ...options,
933
- url: "/buckets"
934
- });
935
- }
936
- /**
937
- * /buckets/:id operation on bucket resource
938
- */
939
- static deleteBucketsById(options) {
940
- return (options?.client ?? client).delete({
941
- ...options,
942
- url: "/buckets/{id}"
943
- });
1560
+ });
1561
+ var getSearchSemantic = (options) => (options.client ?? client).get({
1562
+ security: [{ scheme: "bearer", type: "http" }],
1563
+ url: "/search/semantic",
1564
+ ...options
1565
+ });
1566
+ var getMessages = (options) => (options.client ?? client).get({
1567
+ security: [{ scheme: "bearer", type: "http" }],
1568
+ url: "/messages",
1569
+ ...options
1570
+ });
1571
+ var postMessages = (options) => (options.client ?? client).post({
1572
+ security: [{ scheme: "bearer", type: "http" }],
1573
+ url: "/messages",
1574
+ ...options,
1575
+ headers: {
1576
+ "Content-Type": "application/vnd.api+json",
1577
+ ...options.headers
944
1578
  }
945
- /**
946
- * /buckets/:id operation on bucket resource
947
- */
948
- static getBucketsById(options) {
949
- return (options?.client ?? client).get({
950
- ...options,
951
- url: "/buckets/{id}"
952
- });
1579
+ });
1580
+ var getNotificationPreferences = (options) => (options.client ?? client).get({
1581
+ security: [{ scheme: "bearer", type: "http" }],
1582
+ url: "/notification_preferences",
1583
+ ...options
1584
+ });
1585
+ var postNotificationPreferences = (options) => (options.client ?? client).post({
1586
+ security: [{ scheme: "bearer", type: "http" }],
1587
+ url: "/notification_preferences",
1588
+ ...options,
1589
+ headers: {
1590
+ "Content-Type": "application/vnd.api+json",
1591
+ ...options.headers
953
1592
  }
954
- /**
955
- * /buckets/:id operation on bucket resource
956
- */
957
- static patchBucketsById(options) {
958
- return (options?.client ?? client).patch({
959
- ...options,
960
- url: "/buckets/{id}"
961
- });
1593
+ });
1594
+ var getApplications = (options) => (options.client ?? client).get({
1595
+ security: [{ scheme: "bearer", type: "http" }],
1596
+ url: "/applications",
1597
+ ...options
1598
+ });
1599
+ var postApplications = (options) => (options.client ?? client).post({
1600
+ security: [{ scheme: "bearer", type: "http" }],
1601
+ url: "/applications",
1602
+ ...options,
1603
+ headers: {
1604
+ "Content-Type": "application/vnd.api+json",
1605
+ ...options.headers
962
1606
  }
963
- };
964
- var DocumentService = class {
965
- /**
966
- * /documents/search operation on document resource
967
- */
968
- static getDocumentsSearch(options) {
969
- return (options?.client ?? client).get({
970
- ...options,
971
- url: "/documents/search"
972
- });
1607
+ });
1608
+ var postAgentsPredict = (options) => (options.client ?? client).post({
1609
+ security: [{ scheme: "bearer", type: "http" }],
1610
+ url: "/agents/predict",
1611
+ ...options,
1612
+ headers: {
1613
+ "Content-Type": "application/vnd.api+json",
1614
+ ...options.headers
973
1615
  }
974
- /**
975
- * /documents operation on document resource
976
- */
977
- static getDocuments(options) {
978
- return (options?.client ?? client).get({
979
- ...options,
980
- url: "/documents"
981
- });
1616
+ });
1617
+ var deleteThreadsById = (options) => (options.client ?? client).delete({
1618
+ security: [{ scheme: "bearer", type: "http" }],
1619
+ url: "/threads/{id}",
1620
+ ...options
1621
+ });
1622
+ var getThreadsById = (options) => (options.client ?? client).get({
1623
+ security: [{ scheme: "bearer", type: "http" }],
1624
+ url: "/threads/{id}",
1625
+ ...options
1626
+ });
1627
+ var patchThreadsById = (options) => (options.client ?? client).patch({
1628
+ security: [{ scheme: "bearer", type: "http" }],
1629
+ url: "/threads/{id}",
1630
+ ...options,
1631
+ headers: {
1632
+ "Content-Type": "application/vnd.api+json",
1633
+ ...options.headers
982
1634
  }
983
- /**
984
- * /documents operation on document resource
985
- */
986
- static postDocuments(options) {
987
- return (options?.client ?? client).post({
988
- ...options,
989
- url: "/documents"
990
- });
1635
+ });
1636
+ var getLlmAnalytics = (options) => (options.client ?? client).get({
1637
+ security: [{ scheme: "bearer", type: "http" }],
1638
+ url: "/llm_analytics",
1639
+ ...options
1640
+ });
1641
+ var postLlmAnalytics = (options) => (options.client ?? client).post({
1642
+ security: [{ scheme: "bearer", type: "http" }],
1643
+ url: "/llm_analytics",
1644
+ ...options,
1645
+ headers: {
1646
+ "Content-Type": "application/vnd.api+json",
1647
+ ...options.headers
991
1648
  }
992
- /**
993
- * /documents/:id operation on document resource
994
- */
995
- static deleteDocumentsById(options) {
996
- return (options?.client ?? client).delete({
997
- ...options,
998
- url: "/documents/{id}"
999
- });
1649
+ });
1650
+ var postDocumentsByIdReprocess = (options) => (options.client ?? client).post({
1651
+ security: [{ scheme: "bearer", type: "http" }],
1652
+ url: "/documents/{id}/reprocess",
1653
+ ...options,
1654
+ headers: {
1655
+ "Content-Type": "application/vnd.api+json",
1656
+ ...options.headers
1000
1657
  }
1001
- /**
1002
- * /documents/:id operation on document resource
1003
- */
1004
- static getDocumentsById(options) {
1005
- return (options?.client ?? client).get({
1006
- ...options,
1007
- url: "/documents/{id}"
1008
- });
1658
+ });
1659
+ var patchUsersByIdResetPassword = (options) => (options.client ?? client).patch({
1660
+ security: [{ scheme: "bearer", type: "http" }],
1661
+ url: "/users/{id}/reset-password",
1662
+ ...options,
1663
+ headers: {
1664
+ "Content-Type": "application/vnd.api+json",
1665
+ ...options.headers
1009
1666
  }
1010
- /**
1011
- * /documents/:id operation on document resource
1012
- */
1013
- static patchDocumentsById(options) {
1014
- return (options?.client ?? client).patch({
1015
- ...options,
1016
- url: "/documents/{id}"
1017
- });
1667
+ });
1668
+ var postDocumentsPresignedUpload = (options) => (options.client ?? client).post({
1669
+ security: [{ scheme: "bearer", type: "http" }],
1670
+ url: "/documents/presigned_upload",
1671
+ ...options,
1672
+ headers: {
1673
+ "Content-Type": "application/vnd.api+json",
1674
+ ...options.headers
1018
1675
  }
1019
- /**
1020
- * /documents/:id/analyze operation on document resource
1021
- */
1022
- static postDocumentsByIdAnalyze(options) {
1023
- return (options?.client ?? client).post({
1024
- ...options,
1025
- url: "/documents/{id}/analyze"
1026
- });
1676
+ });
1677
+ var getMessagesSearch = (options) => (options.client ?? client).get({
1678
+ security: [{ scheme: "bearer", type: "http" }],
1679
+ url: "/messages/search",
1680
+ ...options
1681
+ });
1682
+ var deleteWorkspacesById = (options) => (options.client ?? client).delete({
1683
+ security: [{ scheme: "bearer", type: "http" }],
1684
+ url: "/workspaces/{id}",
1685
+ ...options
1686
+ });
1687
+ var getWorkspacesById = (options) => (options.client ?? client).get({
1688
+ security: [{ scheme: "bearer", type: "http" }],
1689
+ url: "/workspaces/{id}",
1690
+ ...options
1691
+ });
1692
+ var patchWorkspacesById = (options) => (options.client ?? client).patch({
1693
+ security: [{ scheme: "bearer", type: "http" }],
1694
+ url: "/workspaces/{id}",
1695
+ ...options,
1696
+ headers: {
1697
+ "Content-Type": "application/vnd.api+json",
1698
+ ...options.headers
1027
1699
  }
1028
- /**
1029
- * /documents/:id/reprocess operation on document resource
1030
- */
1031
- static postDocumentsByIdReprocess(options) {
1032
- return (options?.client ?? client).post({
1033
- ...options,
1034
- url: "/documents/{id}/reprocess"
1035
- });
1700
+ });
1701
+ var getTenants = (options) => (options.client ?? client).get({
1702
+ security: [{ scheme: "bearer", type: "http" }],
1703
+ url: "/tenants",
1704
+ ...options
1705
+ });
1706
+ var postTenants = (options) => (options.client ?? client).post({
1707
+ security: [{ scheme: "bearer", type: "http" }],
1708
+ url: "/tenants",
1709
+ ...options,
1710
+ headers: {
1711
+ "Content-Type": "application/vnd.api+json",
1712
+ ...options.headers
1036
1713
  }
1037
- /**
1038
- * /documents/bulk_reprocess operation on document resource
1039
- */
1040
- static postDocumentsBulkReprocess(options) {
1041
- return (options?.client ?? client).post({
1042
- ...options,
1043
- url: "/documents/bulk_reprocess"
1044
- });
1714
+ });
1715
+ var postTenantsByIdRemoveStorage = (options) => (options.client ?? client).post({
1716
+ security: [{ scheme: "bearer", type: "http" }],
1717
+ url: "/tenants/{id}/remove-storage",
1718
+ ...options,
1719
+ headers: {
1720
+ "Content-Type": "application/vnd.api+json",
1721
+ ...options.headers
1045
1722
  }
1046
- /**
1047
- * Export documents (placeholder - returns mock url)
1048
- */
1049
- static postDocumentsExport(options) {
1050
- return (options?.client ?? client).post({
1051
- ...options,
1052
- url: "/documents/export"
1053
- });
1723
+ });
1724
+ var postDocumentsBulkReprocess = (options) => (options.client ?? client).post({
1725
+ security: [{ scheme: "bearer", type: "http" }],
1726
+ url: "/documents/bulk_reprocess",
1727
+ ...options,
1728
+ headers: {
1729
+ "Content-Type": "application/vnd.api+json",
1730
+ ...options.headers
1054
1731
  }
1055
- /**
1056
- * Import documents from external URL
1057
- */
1058
- static postDocumentsImport(options) {
1059
- return (options?.client ?? client).post({
1060
- ...options,
1061
- url: "/documents/import"
1062
- });
1732
+ });
1733
+ var getNotificationLogsById = (options) => (options.client ?? client).get({
1734
+ security: [{ scheme: "bearer", type: "http" }],
1735
+ url: "/notification_logs/{id}",
1736
+ ...options
1737
+ });
1738
+ var getWebhookDeliveriesById = (options) => (options.client ?? client).get({
1739
+ security: [{ scheme: "bearer", type: "http" }],
1740
+ url: "/webhook_deliveries/{id}",
1741
+ ...options
1742
+ });
1743
+ var getAuditLogs = (options) => (options.client ?? client).get({
1744
+ security: [{ scheme: "bearer", type: "http" }],
1745
+ url: "/audit-logs",
1746
+ ...options
1747
+ });
1748
+ var getAiGraphEdges = (options) => (options.client ?? client).get({
1749
+ security: [{ scheme: "bearer", type: "http" }],
1750
+ url: "/ai/graph/edges",
1751
+ ...options
1752
+ });
1753
+ var postAiGraphEdges = (options) => (options.client ?? client).post({
1754
+ security: [{ scheme: "bearer", type: "http" }],
1755
+ url: "/ai/graph/edges",
1756
+ ...options,
1757
+ headers: {
1758
+ "Content-Type": "application/vnd.api+json",
1759
+ ...options.headers
1063
1760
  }
1064
- /**
1065
- * Returns documents with pending or processing status
1066
- */
1067
- static getDocumentsProcessingQueue(options) {
1068
- return (options?.client ?? client).get({
1069
- ...options,
1070
- url: "/documents/processing_queue"
1071
- });
1761
+ });
1762
+ var postDocumentsExport = (options) => (options.client ?? client).post({
1763
+ security: [{ scheme: "bearer", type: "http" }],
1764
+ url: "/documents/export",
1765
+ ...options
1766
+ });
1767
+ var getTrainingExamples = (options) => (options.client ?? client).get({
1768
+ security: [{ scheme: "bearer", type: "http" }],
1769
+ url: "/training_examples",
1770
+ ...options
1771
+ });
1772
+ var postTrainingExamples = (options) => (options.client ?? client).post({
1773
+ security: [{ scheme: "bearer", type: "http" }],
1774
+ url: "/training_examples",
1775
+ ...options,
1776
+ headers: {
1777
+ "Content-Type": "application/vnd.api+json",
1778
+ ...options.headers
1072
1779
  }
1073
- };
1074
- var UserProfileService = class {
1075
- /**
1076
- * Get the current user's profile
1077
- */
1078
- static getUserProfilesMe(options) {
1079
- return (options?.client ?? client).get({
1080
- ...options,
1081
- url: "/user_profiles/me"
1082
- });
1780
+ });
1781
+ var getBuckets = (options) => (options.client ?? client).get({
1782
+ security: [{ scheme: "bearer", type: "http" }],
1783
+ url: "/buckets",
1784
+ ...options
1785
+ });
1786
+ var postBuckets = (options) => (options.client ?? client).post({
1787
+ security: [{ scheme: "bearer", type: "http" }],
1788
+ url: "/buckets",
1789
+ ...options,
1790
+ headers: {
1791
+ "Content-Type": "application/vnd.api+json",
1792
+ ...options.headers
1083
1793
  }
1084
- /**
1085
- * /user_profiles operation on user_profile resource
1086
- */
1087
- static getUserProfiles(options) {
1088
- return (options?.client ?? client).get({
1089
- ...options,
1090
- url: "/user_profiles"
1091
- });
1794
+ });
1795
+ var getPlansById = (options) => (options.client ?? client).get({
1796
+ security: [{ scheme: "bearer", type: "http" }],
1797
+ url: "/plans/{id}",
1798
+ ...options
1799
+ });
1800
+ var patchWalletAddons = (options) => (options.client ?? client).patch({
1801
+ security: [{ scheme: "bearer", type: "http" }],
1802
+ url: "/wallet/addons",
1803
+ ...options,
1804
+ headers: {
1805
+ "Content-Type": "application/vnd.api+json",
1806
+ ...options.headers
1092
1807
  }
1093
- /**
1094
- * /user_profiles operation on user_profile resource
1095
- */
1096
- static postUserProfiles(options) {
1097
- return (options?.client ?? client).post({
1098
- ...options,
1099
- url: "/user_profiles"
1100
- });
1808
+ });
1809
+ var postUsersAuthMagicLinkLogin = (options) => (options.client ?? client).post({
1810
+ security: [{ scheme: "bearer", type: "http" }],
1811
+ url: "/users/auth/magic_link/login",
1812
+ ...options,
1813
+ headers: {
1814
+ "Content-Type": "application/vnd.api+json",
1815
+ ...options.headers
1101
1816
  }
1102
- /**
1103
- * /user_profiles/:id operation on user_profile resource
1104
- */
1105
- static deleteUserProfilesById(options) {
1106
- return (options?.client ?? client).delete({
1107
- ...options,
1108
- url: "/user_profiles/{id}"
1109
- });
1817
+ });
1818
+ var getApiKeys = (options) => (options.client ?? client).get({
1819
+ security: [{ scheme: "bearer", type: "http" }],
1820
+ url: "/api_keys",
1821
+ ...options
1822
+ });
1823
+ var postApiKeys = (options) => (options.client ?? client).post({
1824
+ security: [{ scheme: "bearer", type: "http" }],
1825
+ url: "/api_keys",
1826
+ ...options,
1827
+ headers: {
1828
+ "Content-Type": "application/vnd.api+json",
1829
+ ...options.headers
1110
1830
  }
1111
- /**
1112
- * /user_profiles/:id operation on user_profile resource
1113
- */
1114
- static getUserProfilesById(options) {
1115
- return (options?.client ?? client).get({
1116
- ...options,
1117
- url: "/user_profiles/{id}"
1118
- });
1831
+ });
1832
+ var getExtractionResults = (options) => (options.client ?? client).get({
1833
+ security: [{ scheme: "bearer", type: "http" }],
1834
+ url: "/extraction_results",
1835
+ ...options
1836
+ });
1837
+ var getAgentsById = (options) => (options.client ?? client).get({
1838
+ security: [{ scheme: "bearer", type: "http" }],
1839
+ url: "/agents/{id}",
1840
+ ...options
1841
+ });
1842
+ var postDocumentsImport = (options) => (options.client ?? client).post({
1843
+ security: [{ scheme: "bearer", type: "http" }],
1844
+ url: "/documents/import",
1845
+ ...options,
1846
+ headers: {
1847
+ "Content-Type": "application/vnd.api+json",
1848
+ ...options.headers
1119
1849
  }
1120
- /**
1121
- * /user_profiles/:id operation on user_profile resource
1122
- */
1123
- static patchUserProfilesById(options) {
1124
- return (options?.client ?? client).patch({
1125
- ...options,
1126
- url: "/user_profiles/{id}"
1127
- });
1850
+ });
1851
+ var deleteApiKeysById = (options) => (options.client ?? client).delete({
1852
+ security: [{ scheme: "bearer", type: "http" }],
1853
+ url: "/api_keys/{id}",
1854
+ ...options
1855
+ });
1856
+ var getApiKeysById = (options) => (options.client ?? client).get({
1857
+ security: [{ scheme: "bearer", type: "http" }],
1858
+ url: "/api_keys/{id}",
1859
+ ...options
1860
+ });
1861
+ var patchApiKeysById = (options) => (options.client ?? client).patch({
1862
+ security: [{ scheme: "bearer", type: "http" }],
1863
+ url: "/api_keys/{id}",
1864
+ ...options,
1865
+ headers: {
1866
+ "Content-Type": "application/vnd.api+json",
1867
+ ...options.headers
1128
1868
  }
1129
- };
1130
- var AgentService = class {
1131
- /**
1132
- * Validate sample output against agent schema
1133
- */
1134
- static postAgentsByIdValidate(options) {
1135
- return (options?.client ?? client).post({
1136
- ...options,
1137
- url: "/agents/{id}/validate"
1138
- });
1869
+ });
1870
+ var getAiConversations = (options) => (options.client ?? client).get({
1871
+ security: [{ scheme: "bearer", type: "http" }],
1872
+ url: "/ai/conversations",
1873
+ ...options
1874
+ });
1875
+ var postAiConversations = (options) => (options.client ?? client).post({
1876
+ security: [{ scheme: "bearer", type: "http" }],
1877
+ url: "/ai/conversations",
1878
+ ...options,
1879
+ headers: {
1880
+ "Content-Type": "application/vnd.api+json",
1881
+ ...options.headers
1139
1882
  }
1140
- /**
1141
- * /agents/:id operation on agent resource
1142
- */
1143
- static deleteAgentsById(options) {
1144
- return (options?.client ?? client).delete({
1145
- ...options,
1146
- url: "/agents/{id}"
1147
- });
1883
+ });
1884
+ var postAiSearch = (options) => (options.client ?? client).post({
1885
+ security: [{ scheme: "bearer", type: "http" }],
1886
+ url: "/ai/search",
1887
+ ...options,
1888
+ headers: {
1889
+ "Content-Type": "application/vnd.api+json",
1890
+ ...options.headers
1148
1891
  }
1149
- /**
1150
- * /agents/:id operation on agent resource
1151
- */
1152
- static getAgentsById(options) {
1153
- return (options?.client ?? client).get({
1154
- ...options,
1155
- url: "/agents/{id}"
1156
- });
1892
+ });
1893
+ var deleteAiGraphNodesById = (options) => (options.client ?? client).delete({
1894
+ security: [{ scheme: "bearer", type: "http" }],
1895
+ url: "/ai/graph/nodes/{id}",
1896
+ ...options
1897
+ });
1898
+ var patchWalletAddonsByAddonSlugCancel = (options) => (options.client ?? client).patch({
1899
+ security: [{ scheme: "bearer", type: "http" }],
1900
+ url: "/wallet/addons/{addon_slug}/cancel",
1901
+ ...options,
1902
+ headers: {
1903
+ "Content-Type": "application/vnd.api+json",
1904
+ ...options.headers
1157
1905
  }
1158
- /**
1159
- * /agents/:id operation on agent resource
1160
- */
1161
- static patchAgentsById(options) {
1162
- return (options?.client ?? client).patch({
1163
- ...options,
1164
- url: "/agents/{id}"
1165
- });
1906
+ });
1907
+ var deleteApplicationsById = (options) => (options.client ?? client).delete({
1908
+ security: [{ scheme: "bearer", type: "http" }],
1909
+ url: "/applications/{id}",
1910
+ ...options
1911
+ });
1912
+ var getApplicationsById = (options) => (options.client ?? client).get({
1913
+ security: [{ scheme: "bearer", type: "http" }],
1914
+ url: "/applications/{id}",
1915
+ ...options
1916
+ });
1917
+ var patchApplicationsById = (options) => (options.client ?? client).patch({
1918
+ security: [{ scheme: "bearer", type: "http" }],
1919
+ url: "/applications/{id}",
1920
+ ...options,
1921
+ headers: {
1922
+ "Content-Type": "application/vnd.api+json",
1923
+ ...options.headers
1166
1924
  }
1167
- /**
1168
- * Run the agent against sample input
1169
- */
1170
- static postAgentsByIdTest(options) {
1171
- return (options?.client ?? client).post({
1172
- ...options,
1173
- url: "/agents/{id}/test"
1174
- });
1925
+ });
1926
+ var getSearchHealth = (options) => (options.client ?? client).get({
1927
+ security: [{ scheme: "bearer", type: "http" }],
1928
+ url: "/search/health",
1929
+ ...options
1930
+ });
1931
+ var getTransactions = (options) => (options.client ?? client).get({
1932
+ security: [{ scheme: "bearer", type: "http" }],
1933
+ url: "/transactions",
1934
+ ...options
1935
+ });
1936
+ var getUserProfiles = (options) => (options.client ?? client).get({
1937
+ security: [{ scheme: "bearer", type: "http" }],
1938
+ url: "/user_profiles",
1939
+ ...options
1940
+ });
1941
+ var postUserProfiles = (options) => (options.client ?? client).post({
1942
+ security: [{ scheme: "bearer", type: "http" }],
1943
+ url: "/user_profiles",
1944
+ ...options,
1945
+ headers: {
1946
+ "Content-Type": "application/vnd.api+json",
1947
+ ...options.headers
1175
1948
  }
1176
- /**
1177
- * Clone the agent to a new one with a new name
1178
- */
1179
- static postAgentsByIdClone(options) {
1180
- return (options?.client ?? client).post({
1181
- ...options,
1182
- url: "/agents/{id}/clone"
1183
- });
1949
+ });
1950
+ var patchUsersByIdConfirmEmail = (options) => (options.client ?? client).patch({
1951
+ security: [{ scheme: "bearer", type: "http" }],
1952
+ url: "/users/{id}/confirm-email",
1953
+ ...options,
1954
+ headers: {
1955
+ "Content-Type": "application/vnd.api+json",
1956
+ ...options.headers
1184
1957
  }
1185
- /**
1186
- * /agents operation on agent resource
1187
- */
1188
- static getAgents(options) {
1189
- return (options?.client ?? client).get({
1190
- ...options,
1191
- url: "/agents"
1192
- });
1958
+ });
1959
+ var getThreadsSearch = (options) => (options.client ?? client).get({
1960
+ security: [{ scheme: "bearer", type: "http" }],
1961
+ url: "/threads/search",
1962
+ ...options
1963
+ });
1964
+ var getDocumentsByIdRelationshipsChunks = (options) => (options.client ?? client).get({
1965
+ security: [{ scheme: "bearer", type: "http" }],
1966
+ url: "/documents/{id}/relationships/chunks",
1967
+ ...options
1968
+ });
1969
+ var patchWalletPlan = (options) => (options.client ?? client).patch({
1970
+ security: [{ scheme: "bearer", type: "http" }],
1971
+ url: "/wallet/plan",
1972
+ ...options,
1973
+ headers: {
1974
+ "Content-Type": "application/vnd.api+json",
1975
+ ...options.headers
1193
1976
  }
1194
- /**
1195
- * /agents operation on agent resource
1196
- */
1197
- static postAgents(options) {
1198
- return (options?.client ?? client).post({
1199
- ...options,
1200
- url: "/agents"
1201
- });
1977
+ });
1978
+ var getPlansSlugBySlug = (options) => (options.client ?? client).get({
1979
+ security: [{ scheme: "bearer", type: "http" }],
1980
+ url: "/plans/slug/{slug}",
1981
+ ...options
1982
+ });
1983
+ var getLlmAnalyticsById = (options) => (options.client ?? client).get({
1984
+ security: [{ scheme: "bearer", type: "http" }],
1985
+ url: "/llm_analytics/{id}",
1986
+ ...options
1987
+ });
1988
+ var getSearchStatus = (options) => (options.client ?? client).get({
1989
+ security: [{ scheme: "bearer", type: "http" }],
1990
+ url: "/search/status",
1991
+ ...options
1992
+ });
1993
+ var patchApiKeysByIdAllocate = (options) => (options.client ?? client).patch({
1994
+ security: [{ scheme: "bearer", type: "http" }],
1995
+ url: "/api_keys/{id}/allocate",
1996
+ ...options,
1997
+ headers: {
1998
+ "Content-Type": "application/vnd.api+json",
1999
+ ...options.headers
1202
2000
  }
1203
- };
1204
- var PresignedUrlService = class {
1205
- /**
1206
- * /storage/sign_download operation on presigned_url resource
1207
- */
1208
- static postStorageSignDownload(options) {
1209
- return (options?.client ?? client).post({
1210
- ...options,
1211
- url: "/storage/sign_download"
1212
- });
2001
+ });
2002
+ var postUsersAuthLogin = (options) => (options.client ?? client).post({
2003
+ security: [{ scheme: "bearer", type: "http" }],
2004
+ url: "/users/auth/login",
2005
+ ...options,
2006
+ headers: {
2007
+ "Content-Type": "application/vnd.api+json",
2008
+ ...options.headers
1213
2009
  }
1214
- /**
1215
- * /documents/presigned_upload operation on presigned_url resource
1216
- */
1217
- static postDocumentsPresignedUpload(options) {
1218
- return (options?.client ?? client).post({
1219
- ...options,
1220
- url: "/documents/presigned_upload"
1221
- });
2010
+ });
2011
+ var postAiEmbed = (options) => (options.client ?? client).post({
2012
+ security: [{ scheme: "bearer", type: "http" }],
2013
+ url: "/ai/embed",
2014
+ ...options,
2015
+ headers: {
2016
+ "Content-Type": "application/vnd.api+json",
2017
+ ...options.headers
1222
2018
  }
1223
- /**
1224
- * /storage/sign_upload operation on presigned_url resource
1225
- */
1226
- static postStorageSignUpload(options) {
1227
- return (options?.client ?? client).post({
1228
- ...options,
1229
- url: "/storage/sign_upload"
1230
- });
2019
+ });
2020
+ var getWorkspacesMine = (options) => (options.client ?? client).get({
2021
+ security: [{ scheme: "bearer", type: "http" }],
2022
+ url: "/workspaces/mine",
2023
+ ...options
2024
+ });
2025
+ var postSearchReindex = (options) => (options.client ?? client).post({
2026
+ security: [{ scheme: "bearer", type: "http" }],
2027
+ url: "/search/reindex",
2028
+ ...options,
2029
+ headers: {
2030
+ "Content-Type": "application/vnd.api+json",
2031
+ ...options.headers
1231
2032
  }
1232
- };
1233
- var ApplicationService = class {
1234
- /**
1235
- * /applications operation on application resource
1236
- */
1237
- static getApplications(options) {
1238
- return (options?.client ?? client).get({
1239
- ...options,
1240
- url: "/applications"
1241
- });
2033
+ });
2034
+ var postUsersAuthConfirm = (options) => (options.client ?? client).post({
2035
+ security: [{ scheme: "bearer", type: "http" }],
2036
+ url: "/users/auth/confirm",
2037
+ ...options,
2038
+ headers: {
2039
+ "Content-Type": "application/vnd.api+json",
2040
+ ...options.headers
1242
2041
  }
1243
- /**
1244
- * /applications operation on application resource
1245
- */
1246
- static postApplications(options) {
1247
- return (options?.client ?? client).post({
1248
- ...options,
1249
- url: "/applications"
1250
- });
2042
+ });
2043
+ var getStorageStats = (options) => (options.client ?? client).get({
2044
+ security: [{ scheme: "bearer", type: "http" }],
2045
+ url: "/storage/stats",
2046
+ ...options
2047
+ });
2048
+ var postTenantsByIdBuyStorage = (options) => (options.client ?? client).post({
2049
+ security: [{ scheme: "bearer", type: "http" }],
2050
+ url: "/tenants/{id}/buy-storage",
2051
+ ...options,
2052
+ headers: {
2053
+ "Content-Type": "application/vnd.api+json",
2054
+ ...options.headers
1251
2055
  }
1252
- /**
1253
- * /applications/:id operation on application resource
1254
- */
1255
- static deleteApplicationsById(options) {
1256
- return (options?.client ?? client).delete({
1257
- ...options,
1258
- url: "/applications/{id}"
1259
- });
2056
+ });
2057
+ var getWorkspaceMemberships = (options) => (options.client ?? client).get({
2058
+ security: [{ scheme: "bearer", type: "http" }],
2059
+ url: "/workspace-memberships",
2060
+ ...options
2061
+ });
2062
+ var postWorkspaceMemberships = (options) => (options.client ?? client).post({
2063
+ security: [{ scheme: "bearer", type: "http" }],
2064
+ url: "/workspace-memberships",
2065
+ ...options,
2066
+ headers: {
2067
+ "Content-Type": "application/vnd.api+json",
2068
+ ...options.headers
1260
2069
  }
1261
- /**
1262
- * /applications/:id operation on application resource
1263
- */
1264
- static getApplicationsById(options) {
1265
- return (options?.client ?? client).get({
1266
- ...options,
1267
- url: "/applications/{id}"
1268
- });
2070
+ });
2071
+ var postUsersAuthMagicLinkRequest = (options) => (options.client ?? client).post({
2072
+ security: [{ scheme: "bearer", type: "http" }],
2073
+ url: "/users/auth/magic_link/request",
2074
+ ...options,
2075
+ headers: {
2076
+ "Content-Type": "application/vnd.api+json",
2077
+ ...options.headers
1269
2078
  }
1270
- /**
1271
- * /applications/:id operation on application resource
1272
- */
1273
- static patchApplicationsById(options) {
1274
- return (options?.client ?? client).patch({
1275
- ...options,
1276
- url: "/applications/{id}"
1277
- });
2079
+ });
2080
+ var postUsersAuthRegister = (options) => (options.client ?? client).post({
2081
+ security: [{ scheme: "bearer", type: "http" }],
2082
+ url: "/users/auth/register",
2083
+ ...options,
2084
+ headers: {
2085
+ "Content-Type": "application/vnd.api+json",
2086
+ ...options.headers
1278
2087
  }
1279
- /**
1280
- * /applications/by-slug/:slug operation on application resource
1281
- */
1282
- static getApplicationsBySlugBySlug(options) {
1283
- return (options?.client ?? client).get({
1284
- ...options,
1285
- url: "/applications/by-slug/{slug}"
1286
- });
2088
+ });
2089
+ var postTrainingExamplesBulk = (options) => (options.client ?? client).post({
2090
+ security: [{ scheme: "bearer", type: "http" }],
2091
+ url: "/training_examples/bulk",
2092
+ ...options,
2093
+ headers: {
2094
+ "Content-Type": "application/vnd.api+json",
2095
+ ...options.headers
1287
2096
  }
1288
- };
1289
- var TenantService = class {
1290
- /**
1291
- * /tenants operation on tenant resource
1292
- */
1293
- static getTenants(options) {
1294
- return (options?.client ?? client).get({
1295
- ...options,
1296
- url: "/tenants"
1297
- });
2097
+ });
2098
+ var deleteBucketsById = (options) => (options.client ?? client).delete({
2099
+ security: [{ scheme: "bearer", type: "http" }],
2100
+ url: "/buckets/{id}",
2101
+ ...options
2102
+ });
2103
+ var getBucketsById = (options) => (options.client ?? client).get({
2104
+ security: [{ scheme: "bearer", type: "http" }],
2105
+ url: "/buckets/{id}",
2106
+ ...options
2107
+ });
2108
+ var patchBucketsById = (options) => (options.client ?? client).patch({
2109
+ security: [{ scheme: "bearer", type: "http" }],
2110
+ url: "/buckets/{id}",
2111
+ ...options,
2112
+ headers: {
2113
+ "Content-Type": "application/vnd.api+json",
2114
+ ...options.headers
1298
2115
  }
1299
- /**
1300
- * /tenants operation on tenant resource
1301
- */
1302
- static postTenants(options) {
1303
- return (options?.client ?? client).post({
1304
- ...options,
1305
- url: "/tenants"
1306
- });
2116
+ });
2117
+ var deleteAiGraphEdgesById = (options) => (options.client ?? client).delete({
2118
+ security: [{ scheme: "bearer", type: "http" }],
2119
+ url: "/ai/graph/edges/{id}",
2120
+ ...options
2121
+ });
2122
+ var deleteTenantsById = (options) => (options.client ?? client).delete({
2123
+ security: [{ scheme: "bearer", type: "http" }],
2124
+ url: "/tenants/{id}",
2125
+ ...options
2126
+ });
2127
+ var getTenantsById = (options) => (options.client ?? client).get({
2128
+ security: [{ scheme: "bearer", type: "http" }],
2129
+ url: "/tenants/{id}",
2130
+ ...options
2131
+ });
2132
+ var patchTenantsById = (options) => (options.client ?? client).patch({
2133
+ security: [{ scheme: "bearer", type: "http" }],
2134
+ url: "/tenants/{id}",
2135
+ ...options,
2136
+ headers: {
2137
+ "Content-Type": "application/vnd.api+json",
2138
+ ...options.headers
1307
2139
  }
1308
- /**
1309
- * /tenants/:id/remove-storage operation on tenant resource
1310
- */
1311
- static postTenantsByIdRemoveStorage(options) {
1312
- return (options?.client ?? client).post({
1313
- ...options,
1314
- url: "/tenants/{id}/remove-storage"
1315
- });
2140
+ });
2141
+ var getPlans = (options) => (options.client ?? client).get({
2142
+ security: [{ scheme: "bearer", type: "http" }],
2143
+ url: "/plans",
2144
+ ...options
2145
+ });
2146
+ var postAgentsByIdTest = (options) => (options.client ?? client).post({
2147
+ security: [{ scheme: "bearer", type: "http" }],
2148
+ url: "/agents/{id}/test",
2149
+ ...options,
2150
+ headers: {
2151
+ "Content-Type": "application/vnd.api+json",
2152
+ ...options.headers
1316
2153
  }
1317
- /**
1318
- * /tenants/:id/buy-storage operation on tenant resource
1319
- */
1320
- static postTenantsByIdBuyStorage(options) {
1321
- return (options?.client ?? client).post({
1322
- ...options,
1323
- url: "/tenants/{id}/buy-storage"
1324
- });
2154
+ });
2155
+ var getDocumentsProcessingQueue = (options) => (options.client ?? client).get({
2156
+ security: [{ scheme: "bearer", type: "http" }],
2157
+ url: "/documents/processing_queue",
2158
+ ...options
2159
+ });
2160
+ var deleteTenantMembershipsByTenantIdByUserId = (options) => (options.client ?? client).delete({
2161
+ security: [{ scheme: "bearer", type: "http" }],
2162
+ url: "/tenant-memberships/{tenant_id}/{user_id}",
2163
+ ...options
2164
+ });
2165
+ var patchTenantMembershipsByTenantIdByUserId = (options) => (options.client ?? client).patch({
2166
+ security: [{ scheme: "bearer", type: "http" }],
2167
+ url: "/tenant-memberships/{tenant_id}/{user_id}",
2168
+ ...options,
2169
+ headers: {
2170
+ "Content-Type": "application/vnd.api+json",
2171
+ ...options.headers
1325
2172
  }
1326
- /**
1327
- * /tenants/:id operation on tenant resource
1328
- */
1329
- static deleteTenantsById(options) {
1330
- return (options?.client ?? client).delete({
1331
- ...options,
1332
- url: "/tenants/{id}"
1333
- });
2173
+ });
2174
+ var getAiMessages = (options) => (options.client ?? client).get({
2175
+ security: [{ scheme: "bearer", type: "http" }],
2176
+ url: "/ai/messages",
2177
+ ...options
2178
+ });
2179
+ var postAiMessages = (options) => (options.client ?? client).post({
2180
+ security: [{ scheme: "bearer", type: "http" }],
2181
+ url: "/ai/messages",
2182
+ ...options,
2183
+ headers: {
2184
+ "Content-Type": "application/vnd.api+json",
2185
+ ...options.headers
1334
2186
  }
1335
- /**
1336
- * /tenants/:id operation on tenant resource
1337
- */
1338
- static getTenantsById(options) {
1339
- return (options?.client ?? client).get({
1340
- ...options,
1341
- url: "/tenants/{id}"
1342
- });
2187
+ });
2188
+ var postStorageSignUpload = (options) => (options.client ?? client).post({
2189
+ security: [{ scheme: "bearer", type: "http" }],
2190
+ url: "/storage/sign_upload",
2191
+ ...options,
2192
+ headers: {
2193
+ "Content-Type": "application/vnd.api+json",
2194
+ ...options.headers
1343
2195
  }
1344
- /**
1345
- * /tenants/:id operation on tenant resource
1346
- */
1347
- static patchTenantsById(options) {
1348
- return (options?.client ?? client).patch({
1349
- ...options,
1350
- url: "/tenants/{id}"
1351
- });
2196
+ });
2197
+ var postWebhookDeliveriesByIdRetry = (options) => (options.client ?? client).post({
2198
+ security: [{ scheme: "bearer", type: "http" }],
2199
+ url: "/webhook_deliveries/{id}/retry",
2200
+ ...options,
2201
+ headers: {
2202
+ "Content-Type": "application/vnd.api+json",
2203
+ ...options.headers
1352
2204
  }
1353
- };
1354
- var AuditLogService = class {
1355
- /**
1356
- * /audit-logs operation on audit-log resource
1357
- */
1358
- static getAuditLogs(options) {
1359
- return (options?.client ?? client).get({
1360
- ...options,
1361
- url: "/audit-logs"
1362
- });
2205
+ });
2206
+ var postThreadsByIdSummarize = (options) => (options.client ?? client).post({
2207
+ security: [{ scheme: "bearer", type: "http" }],
2208
+ url: "/threads/{id}/summarize",
2209
+ ...options,
2210
+ headers: {
2211
+ "Content-Type": "application/vnd.api+json",
2212
+ ...options.headers
1363
2213
  }
1364
- };
1365
- var PlanService = class {
1366
- /**
1367
- * /plans/:id operation on plan resource
1368
- */
1369
- static deletePlansById(options) {
1370
- return (options?.client ?? client).delete({
1371
- ...options,
1372
- url: "/plans/{id}"
1373
- });
2214
+ });
2215
+ var patchConfigsByKey = (options) => (options.client ?? client).patch({
2216
+ security: [{ scheme: "bearer", type: "http" }],
2217
+ url: "/configs/{key}",
2218
+ ...options,
2219
+ headers: {
2220
+ "Content-Type": "application/vnd.api+json",
2221
+ ...options.headers
1374
2222
  }
1375
- /**
1376
- * /plans/:id operation on plan resource
1377
- */
1378
- static getPlansById(options) {
1379
- return (options?.client ?? client).get({
1380
- ...options,
1381
- url: "/plans/{id}"
1382
- });
2223
+ });
2224
+ var patchApiKeysByIdRotate = (options) => (options.client ?? client).patch({
2225
+ security: [{ scheme: "bearer", type: "http" }],
2226
+ url: "/api_keys/{id}/rotate",
2227
+ ...options,
2228
+ headers: {
2229
+ "Content-Type": "application/vnd.api+json",
2230
+ ...options.headers
1383
2231
  }
1384
- /**
1385
- * /plans/:id operation on plan resource
1386
- */
1387
- static patchPlansById(options) {
1388
- return (options?.client ?? client).patch({
1389
- ...options,
1390
- url: "/plans/{id}"
1391
- });
2232
+ });
2233
+ var postAgentsByIdClone = (options) => (options.client ?? client).post({
2234
+ security: [{ scheme: "bearer", type: "http" }],
2235
+ url: "/agents/{id}/clone",
2236
+ ...options,
2237
+ headers: {
2238
+ "Content-Type": "application/vnd.api+json",
2239
+ ...options.headers
1392
2240
  }
1393
- /**
1394
- * /plans/slug/:slug operation on plan resource
1395
- */
1396
- static getPlansSlugBySlug(options) {
1397
- return (options?.client ?? client).get({
1398
- ...options,
1399
- url: "/plans/slug/{slug}"
1400
- });
2241
+ });
2242
+ var deleteAiConversationsById = (options) => (options.client ?? client).delete({
2243
+ security: [{ scheme: "bearer", type: "http" }],
2244
+ url: "/ai/conversations/{id}",
2245
+ ...options
2246
+ });
2247
+ var getAiConversationsById = (options) => (options.client ?? client).get({
2248
+ security: [{ scheme: "bearer", type: "http" }],
2249
+ url: "/ai/conversations/{id}",
2250
+ ...options
2251
+ });
2252
+ var deleteUserProfilesById = (options) => (options.client ?? client).delete({
2253
+ security: [{ scheme: "bearer", type: "http" }],
2254
+ url: "/user_profiles/{id}",
2255
+ ...options
2256
+ });
2257
+ var getUserProfilesById = (options) => (options.client ?? client).get({
2258
+ security: [{ scheme: "bearer", type: "http" }],
2259
+ url: "/user_profiles/{id}",
2260
+ ...options
2261
+ });
2262
+ var patchUserProfilesById = (options) => (options.client ?? client).patch({
2263
+ security: [{ scheme: "bearer", type: "http" }],
2264
+ url: "/user_profiles/{id}",
2265
+ ...options,
2266
+ headers: {
2267
+ "Content-Type": "application/vnd.api+json",
2268
+ ...options.headers
1401
2269
  }
1402
- /**
1403
- * /plans operation on plan resource
1404
- */
1405
- static getPlans(options) {
1406
- return (options?.client ?? client).get({
1407
- ...options,
1408
- url: "/plans"
1409
- });
2270
+ });
2271
+ var deleteObjectsById = (options) => (options.client ?? client).delete({
2272
+ security: [{ scheme: "bearer", type: "http" }],
2273
+ url: "/objects/{id}",
2274
+ ...options
2275
+ });
2276
+ var getObjectsById = (options) => (options.client ?? client).get({
2277
+ security: [{ scheme: "bearer", type: "http" }],
2278
+ url: "/objects/{id}",
2279
+ ...options
2280
+ });
2281
+ var getWebhookConfigs = (options) => (options.client ?? client).get({
2282
+ security: [{ scheme: "bearer", type: "http" }],
2283
+ url: "/webhook_configs",
2284
+ ...options
2285
+ });
2286
+ var postWebhookConfigs = (options) => (options.client ?? client).post({
2287
+ security: [{ scheme: "bearer", type: "http" }],
2288
+ url: "/webhook_configs",
2289
+ ...options,
2290
+ headers: {
2291
+ "Content-Type": "application/vnd.api+json",
2292
+ ...options.headers
1410
2293
  }
1411
- /**
1412
- * /plans operation on plan resource
1413
- */
1414
- static postPlans(options) {
1415
- return (options?.client ?? client).post({
1416
- ...options,
1417
- url: "/plans"
1418
- });
2294
+ });
2295
+ var postObjectsBulkDestroy = (options) => (options.client ?? client).post({
2296
+ security: [{ scheme: "bearer", type: "http" }],
2297
+ url: "/objects/bulk-destroy",
2298
+ ...options,
2299
+ headers: {
2300
+ "Content-Type": "application/vnd.api+json",
2301
+ ...options.headers
1419
2302
  }
1420
- };
1421
- var WalletService = class {
1422
- /**
1423
- * Purchase an add-on for the wallet
1424
- */
1425
- static patchWalletAddons(options) {
1426
- return (options?.client ?? client).patch({
1427
- ...options,
1428
- url: "/wallet/addons"
1429
- });
2303
+ });
2304
+ var getApplicationsBySlugBySlug = (options) => (options.client ?? client).get({
2305
+ security: [{ scheme: "bearer", type: "http" }],
2306
+ url: "/applications/by-slug/{slug}",
2307
+ ...options
2308
+ });
2309
+ var getNotificationLogs = (options) => (options.client ?? client).get({
2310
+ security: [{ scheme: "bearer", type: "http" }],
2311
+ url: "/notification_logs",
2312
+ ...options
2313
+ });
2314
+ var getWallet = (options) => (options.client ?? client).get({
2315
+ security: [{ scheme: "bearer", type: "http" }],
2316
+ url: "/wallet",
2317
+ ...options
2318
+ });
2319
+ var deleteMessagesById = (options) => (options.client ?? client).delete({
2320
+ security: [{ scheme: "bearer", type: "http" }],
2321
+ url: "/messages/{id}",
2322
+ ...options
2323
+ });
2324
+ var getMessagesById = (options) => (options.client ?? client).get({
2325
+ security: [{ scheme: "bearer", type: "http" }],
2326
+ url: "/messages/{id}",
2327
+ ...options
2328
+ });
2329
+ var patchMessagesById = (options) => (options.client ?? client).patch({
2330
+ security: [{ scheme: "bearer", type: "http" }],
2331
+ url: "/messages/{id}",
2332
+ ...options,
2333
+ headers: {
2334
+ "Content-Type": "application/vnd.api+json",
2335
+ ...options.headers
1430
2336
  }
1431
- /**
1432
- * /wallet/addons/:addon_slug/cancel operation on wallet resource
1433
- */
1434
- static patchWalletAddonsByAddonSlugCancel(options) {
1435
- return (options?.client ?? client).patch({
1436
- ...options,
1437
- url: "/wallet/addons/{addon_slug}/cancel"
1438
- });
2337
+ });
2338
+ var getLlmAnalyticsUsage = (options) => (options.client ?? client).get({
2339
+ security: [{ scheme: "bearer", type: "http" }],
2340
+ url: "/llm_analytics/usage",
2341
+ ...options
2342
+ });
2343
+ var getSearchStats = (options) => (options.client ?? client).get({
2344
+ security: [{ scheme: "bearer", type: "http" }],
2345
+ url: "/search/stats",
2346
+ ...options
2347
+ });
2348
+ var deleteNotificationPreferencesById = (options) => (options.client ?? client).delete({
2349
+ security: [{ scheme: "bearer", type: "http" }],
2350
+ url: "/notification_preferences/{id}",
2351
+ ...options
2352
+ });
2353
+ var getNotificationPreferencesById = (options) => (options.client ?? client).get({
2354
+ security: [{ scheme: "bearer", type: "http" }],
2355
+ url: "/notification_preferences/{id}",
2356
+ ...options
2357
+ });
2358
+ var patchNotificationPreferencesById = (options) => (options.client ?? client).patch({
2359
+ security: [{ scheme: "bearer", type: "http" }],
2360
+ url: "/notification_preferences/{id}",
2361
+ ...options,
2362
+ headers: {
2363
+ "Content-Type": "application/vnd.api+json",
2364
+ ...options.headers
1439
2365
  }
1440
- /**
1441
- * Change the main plan for the wallet
1442
- */
1443
- static patchWalletPlan(options) {
1444
- return (options?.client ?? client).patch({
1445
- ...options,
1446
- url: "/wallet/plan"
1447
- });
2366
+ });
2367
+ var getAiGraphNodes = (options) => (options.client ?? client).get({
2368
+ security: [{ scheme: "bearer", type: "http" }],
2369
+ url: "/ai/graph/nodes",
2370
+ ...options
2371
+ });
2372
+ var postAiGraphNodes = (options) => (options.client ?? client).post({
2373
+ security: [{ scheme: "bearer", type: "http" }],
2374
+ url: "/ai/graph/nodes",
2375
+ ...options,
2376
+ headers: {
2377
+ "Content-Type": "application/vnd.api+json",
2378
+ ...options.headers
1448
2379
  }
1449
- /**
1450
- * Reads the wallet for the current tenant
1451
- */
1452
- static getWallet(options) {
1453
- return (options?.client ?? client).get({
1454
- ...options,
1455
- url: "/wallet"
1456
- });
2380
+ });
2381
+ var getAgents = (options) => (options.client ?? client).get({
2382
+ security: [{ scheme: "bearer", type: "http" }],
2383
+ url: "/agents",
2384
+ ...options
2385
+ });
2386
+ var getDocumentsByIdExtractionResults = (options) => (options.client ?? client).get({
2387
+ security: [{ scheme: "bearer", type: "http" }],
2388
+ url: "/documents/{id}/extraction_results",
2389
+ ...options
2390
+ });
2391
+ var postUsersRegisterIsv = (options) => (options.client ?? client).post({
2392
+ security: [{ scheme: "bearer", type: "http" }],
2393
+ url: "/users/register_isv",
2394
+ ...options,
2395
+ headers: {
2396
+ "Content-Type": "application/vnd.api+json",
2397
+ ...options.headers
1457
2398
  }
1458
- };
1459
- var EmbeddingService = class {
1460
- /**
1461
- * /ai/embed operation on embedding resource
1462
- */
1463
- static postAiEmbed(options) {
1464
- return (options?.client ?? client).post({
1465
- ...options,
1466
- url: "/ai/embed"
1467
- });
2399
+ });
2400
+ var deleteWorkspaceMembershipsByWorkspaceIdByUserId = (options) => (options.client ?? client).delete({
2401
+ security: [{ scheme: "bearer", type: "http" }],
2402
+ url: "/workspace-memberships/{workspace_id}/{user_id}",
2403
+ ...options
2404
+ });
2405
+ var patchWorkspaceMembershipsByWorkspaceIdByUserId = (options) => (options.client ?? client).patch({
2406
+ security: [{ scheme: "bearer", type: "http" }],
2407
+ url: "/workspace-memberships/{workspace_id}/{user_id}",
2408
+ ...options,
2409
+ headers: {
2410
+ "Content-Type": "application/vnd.api+json",
2411
+ ...options.headers
1468
2412
  }
1469
- };
2413
+ });
2414
+ var getCreditPackages = (options) => (options.client ?? client).get({
2415
+ security: [{ scheme: "bearer", type: "http" }],
2416
+ url: "/credit-packages",
2417
+ ...options
2418
+ });
2419
+ var getUsers = (options) => (options.client ?? client).get({
2420
+ security: [{ scheme: "bearer", type: "http" }],
2421
+ url: "/users",
2422
+ ...options
2423
+ });
2424
+ var getObjects = (options) => (options.client ?? client).get({
2425
+ security: [{ scheme: "bearer", type: "http" }],
2426
+ url: "/objects",
2427
+ ...options
2428
+ });
1470
2429
 
1471
2430
  // src/errors/index.ts
1472
2431
  var GptCoreError = class extends Error {
@@ -1583,78 +2542,6 @@ function handleApiError(error) {
1583
2542
  }
1584
2543
  }
1585
2544
 
1586
- // src/base-client.ts
1587
- var BaseClient = class {
1588
- constructor(config = {}) {
1589
- this.config = config;
1590
- this.retryConfig = config.retry !== void 0 ? config.retry : {
1591
- maxRetries: 3,
1592
- initialDelay: 1e3,
1593
- maxDelay: 32e3,
1594
- retryableStatusCodes: [429, 500, 502, 503, 504]
1595
- };
1596
- if (config.baseUrl) {
1597
- client.setConfig({ baseUrl: config.baseUrl });
1598
- }
1599
- client.interceptors.request.use((req) => {
1600
- req.headers.set("Accept", "application/vnd.api+json");
1601
- req.headers.set("Content-Type", "application/vnd.api+json");
1602
- if (config.apiKey) {
1603
- req.headers.set("x-application-key", config.apiKey);
1604
- }
1605
- if (config.token) {
1606
- req.headers.set("Authorization", `Bearer ${config.token}`);
1607
- }
1608
- return req;
1609
- });
1610
- client.interceptors.response.use((response) => {
1611
- if (response.error) {
1612
- handleApiError(response.error);
1613
- }
1614
- return response;
1615
- });
1616
- }
1617
- unwrap(resource) {
1618
- if (!resource) return null;
1619
- if (resource.data && !resource.id && !resource.type) {
1620
- return resource.data;
1621
- }
1622
- return resource;
1623
- }
1624
- handleError(error) {
1625
- return handleApiError(error);
1626
- }
1627
- };
1628
-
1629
- // src/pagination.ts
1630
- async function* paginateAll(fetcher, options = {}) {
1631
- const pageSize = options.pageSize || 20;
1632
- const limit = options.limit;
1633
- let page = 1;
1634
- let totalYielded = 0;
1635
- while (true) {
1636
- const response = await fetcher(page, pageSize);
1637
- for (const item of response.data) {
1638
- yield item;
1639
- totalYielded++;
1640
- if (limit && totalYielded >= limit) {
1641
- return;
1642
- }
1643
- }
1644
- if (!response.links?.next || response.data.length === 0) {
1645
- break;
1646
- }
1647
- page++;
1648
- }
1649
- }
1650
- async function paginateToArray(fetcher, options = {}) {
1651
- const results = [];
1652
- for await (const item of paginateAll(fetcher, options)) {
1653
- results.push(item);
1654
- }
1655
- return results;
1656
- }
1657
-
1658
2545
  // src/schemas/requests.ts
1659
2546
  var import_zod = require("zod");
1660
2547
  var LoginRequestSchema = import_zod.z.object({
@@ -1726,599 +2613,6 @@ var PresignedDownloadSchema = import_zod.z.object({
1726
2613
  file_id: import_zod.z.string().uuid()
1727
2614
  });
1728
2615
 
1729
- // src/gpt-client.ts
1730
- var GptClient = class extends BaseClient {
1731
- constructor(config) {
1732
- super(config);
1733
- this.identity = {
1734
- login: async (email, password) => {
1735
- const validated = LoginRequestSchema.parse({ email, password });
1736
- const { data, error } = await UserService.postUsersAuthLogin({
1737
- body: {
1738
- data: {
1739
- type: "user",
1740
- attributes: validated
1741
- }
1742
- }
1743
- });
1744
- if (error) this.handleError(error);
1745
- return {
1746
- user: this.unwrap(data?.data),
1747
- token: data?.meta?.token
1748
- };
1749
- },
1750
- register: async (email, password, password_confirmation) => {
1751
- const validated = RegisterRequestSchema.parse({ email, password, password_confirmation });
1752
- const { data, error } = await UserService.postUsersAuthRegister({
1753
- body: {
1754
- data: {
1755
- type: "user",
1756
- attributes: validated
1757
- }
1758
- }
1759
- });
1760
- if (error) this.handleError(error);
1761
- return this.unwrap(data?.data);
1762
- },
1763
- me: async () => {
1764
- const { data, error } = await UserService.getUsersMe();
1765
- if (error) this.handleError(error);
1766
- return this.unwrap(data?.data);
1767
- },
1768
- profile: async () => {
1769
- const { data, error } = await UserProfileService.getUserProfilesMe();
1770
- if (error) this.handleError(error);
1771
- return this.unwrap(data?.data);
1772
- },
1773
- apiKeys: {
1774
- list: async () => {
1775
- const { data, error } = await ApiKeyService.getApiKeys();
1776
- if (error) this.handleError(error);
1777
- return this.unwrap(data?.data);
1778
- },
1779
- create: async (name) => {
1780
- const validated = ApiKeyCreateSchema.parse({ name });
1781
- const { data, error } = await ApiKeyService.postApiKeys({
1782
- body: { data: { type: "api_key", attributes: validated } }
1783
- });
1784
- if (error) this.handleError(error);
1785
- return this.unwrap(data?.data);
1786
- },
1787
- allocate: async (id, amount, description) => {
1788
- const validated = ApiKeyAllocateSchema.parse({ amount, description });
1789
- const { error } = await ApiKeyService.patchApiKeysByIdAllocate({
1790
- path: { id },
1791
- body: { data: { type: "api_key", id, attributes: validated } }
1792
- });
1793
- if (error) this.handleError(error);
1794
- return true;
1795
- }
1796
- }
1797
- };
1798
- this.platform = {
1799
- applications: {
1800
- list: async () => {
1801
- const { data, error } = await ApplicationService.getApplications();
1802
- if (error) this.handleError(error);
1803
- return this.unwrap(data?.data);
1804
- },
1805
- create: async (attributes) => {
1806
- const validated = ApplicationCreateSchema.parse(attributes);
1807
- const { data, error } = await ApplicationService.postApplications({
1808
- body: { data: { type: "application", attributes: validated } }
1809
- });
1810
- if (error) this.handleError(error);
1811
- return this.unwrap(data?.data);
1812
- },
1813
- getBySlug: async (slug) => {
1814
- const { data, error } = await ApplicationService.getApplicationsBySlugBySlug({
1815
- path: { slug }
1816
- });
1817
- if (error) this.handleError(error);
1818
- return this.unwrap(data?.data);
1819
- }
1820
- },
1821
- workspaces: {
1822
- list: async () => {
1823
- const { data, error } = await WorkspaceService.getWorkspaces();
1824
- if (error) this.handleError(error);
1825
- return this.unwrap(data?.data);
1826
- },
1827
- mine: async () => {
1828
- const { data, error } = await WorkspaceService.getWorkspacesMine();
1829
- if (error) this.handleError(error);
1830
- return this.unwrap(data?.data);
1831
- },
1832
- create: async (name, slug) => {
1833
- const validated = WorkspaceCreateSchema.parse({ name, slug });
1834
- const { data, error } = await WorkspaceService.postWorkspaces({
1835
- body: { data: { type: "workspace", attributes: validated } }
1836
- });
1837
- if (error) this.handleError(error);
1838
- return this.unwrap(data?.data);
1839
- }
1840
- },
1841
- tenants: {
1842
- list: async () => {
1843
- const { data, error } = await TenantService.getTenants();
1844
- if (error) this.handleError(error);
1845
- return this.unwrap(data?.data);
1846
- }
1847
- },
1848
- invitations: {
1849
- list: async () => {
1850
- const { data, error } = await InvitationService.getInvitations();
1851
- if (error) this.handleError(error);
1852
- return this.unwrap(data?.data);
1853
- },
1854
- invite: async (email, role2, scopeType, scopeId) => {
1855
- const validated = InvitationCreateSchema.parse({
1856
- email,
1857
- role: role2,
1858
- scope_type: scopeType,
1859
- scope_id: scopeId
1860
- });
1861
- const { error } = await InvitationService.postInvitationsInvite({
1862
- body: validated
1863
- });
1864
- if (error) this.handleError(error);
1865
- return true;
1866
- }
1867
- },
1868
- auditLogs: {
1869
- list: async () => {
1870
- const { data, error } = await AuditLogService.getAuditLogs();
1871
- if (error) this.handleError(error);
1872
- return this.unwrap(data?.data);
1873
- }
1874
- }
1875
- };
1876
- this.ai = {
1877
- agents: {
1878
- list: async () => {
1879
- const { data, error } = await AgentService.getAgents();
1880
- if (error) this.handleError(error);
1881
- return this.unwrap(data?.data);
1882
- },
1883
- create: async (name, promptTemplate) => {
1884
- const validated = AgentCreateSchema.parse({ name, prompt_template: promptTemplate });
1885
- const { data, error } = await AgentService.postAgents({
1886
- body: { data: { type: "agent", attributes: validated } }
1887
- });
1888
- if (error) this.handleError(error);
1889
- return this.unwrap(data?.data);
1890
- }
1891
- },
1892
- threads: {
1893
- list: async () => {
1894
- const { data, error } = await ThreadService.getThreads();
1895
- if (error) this.handleError(error);
1896
- return this.unwrap(data?.data);
1897
- },
1898
- create: async (title) => {
1899
- const validated = ThreadCreateSchema.parse({ title });
1900
- const { data, error } = await ThreadService.postThreads({
1901
- body: { data: { type: "thread", attributes: validated } }
1902
- });
1903
- if (error) this.handleError(error);
1904
- return this.unwrap(data?.data);
1905
- },
1906
- sendMessage: async (threadId, content) => {
1907
- const validated = MessageSendSchema.parse({ content });
1908
- const { data, error } = await ThreadService.postThreadsByIdMessages({
1909
- path: { id: threadId },
1910
- body: { data: { attributes: validated } }
1911
- });
1912
- if (error) this.handleError(error);
1913
- return this.unwrap(data);
1914
- }
1915
- /**
1916
- * Note: For streaming message responses, use the streaming utilities:
1917
- *
1918
- * ```typescript
1919
- * import { streamMessage } from '@gpt-core/client';
1920
- *
1921
- * // Make streaming request to backend
1922
- * const response = await fetch(`${baseUrl}/threads/${threadId}/messages/stream`, {
1923
- * method: 'POST',
1924
- * headers: { 'Accept': 'text/event-stream' },
1925
- * body: JSON.stringify({ content: 'Hello' })
1926
- * });
1927
- *
1928
- * // Stream the response
1929
- * for await (const chunk of streamMessage(response)) {
1930
- * console.log(chunk.content);
1931
- * }
1932
- * ```
1933
- */
1934
- },
1935
- search: async (query, top_k = 5) => {
1936
- const validated = SearchRequestSchema.parse({ query, top_k });
1937
- const { data, error } = await SearchService.postAiSearch({
1938
- body: validated
1939
- });
1940
- if (error) this.handleError(error);
1941
- return this.unwrap(data);
1942
- },
1943
- embed: async (text, workspaceId) => {
1944
- const validated = EmbedRequestSchema.parse({ text, workspace_id: workspaceId });
1945
- const { data, error } = await EmbeddingService.postAiEmbed({
1946
- body: validated
1947
- });
1948
- if (error) this.handleError(error);
1949
- return this.unwrap(data);
1950
- }
1951
- };
1952
- this.extraction = {
1953
- documents: {
1954
- list: async () => {
1955
- const { data, error } = await DocumentService.getDocuments();
1956
- if (error) this.handleError(error);
1957
- return this.unwrap(data?.data);
1958
- },
1959
- upload: async (_file, _filename) => {
1960
- throw new Error("Use uploadBase64 for now");
1961
- },
1962
- uploadBase64: async (filename, base64Content) => {
1963
- const validated = DocumentUploadBase64Schema.parse({ filename, content: base64Content });
1964
- const { data, error } = await DocumentService.postDocuments({
1965
- body: { data: { type: "document", attributes: validated } }
1966
- });
1967
- if (error) this.handleError(error);
1968
- return this.unwrap(data?.data);
1969
- },
1970
- get: async (id) => {
1971
- const { data, error } = await DocumentService.getDocumentsById({ path: { id } });
1972
- if (error) this.handleError(error);
1973
- return this.unwrap(data?.data);
1974
- },
1975
- delete: async (id) => {
1976
- const { error } = await DocumentService.deleteDocumentsById({ path: { id } });
1977
- if (error) this.handleError(error);
1978
- return true;
1979
- },
1980
- analyze: async (id) => {
1981
- const { error } = await DocumentService.postDocumentsByIdAnalyze({ path: { id }, body: {} });
1982
- if (error) this.handleError(error);
1983
- return true;
1984
- }
1985
- },
1986
- results: {
1987
- list: async () => {
1988
- const { data, error } = await ExtractionResultService.getExtractionResults();
1989
- if (error) this.handleError(error);
1990
- return this.unwrap(data?.data);
1991
- }
1992
- }
1993
- };
1994
- this.storage = {
1995
- buckets: {
1996
- list: async () => {
1997
- const { data, error } = await BucketService.getBuckets();
1998
- if (error) this.handleError(error);
1999
- return this.unwrap(data?.data);
2000
- },
2001
- create: async (name, isPublic = false) => {
2002
- const validated = BucketCreateSchema.parse({ name, type: isPublic ? "public" : "private" });
2003
- const { data, error } = await BucketService.postBuckets({
2004
- body: { data: { type: "bucket", attributes: validated } }
2005
- });
2006
- if (error) this.handleError(error);
2007
- return this.unwrap(data?.data);
2008
- }
2009
- },
2010
- presigned: {
2011
- upload: async (filename, contentType) => {
2012
- const validated = PresignedUploadSchema.parse({ filename, content_type: contentType });
2013
- const { data, error } = await PresignedUrlService.postStorageSignUpload({
2014
- body: validated
2015
- });
2016
- if (error) this.handleError(error);
2017
- return this.unwrap(data);
2018
- },
2019
- download: async (fileId) => {
2020
- const validated = PresignedDownloadSchema.parse({ file_id: fileId });
2021
- const { data, error } = await PresignedUrlService.postStorageSignDownload({
2022
- body: validated
2023
- });
2024
- if (error) this.handleError(error);
2025
- return this.unwrap(data);
2026
- }
2027
- }
2028
- };
2029
- this.billing = {
2030
- wallet: {
2031
- get: async () => {
2032
- const { data, error } = await WalletService.getWallet();
2033
- if (error) this.handleError(error);
2034
- return this.unwrap(data?.data);
2035
- }
2036
- },
2037
- plans: {
2038
- list: async () => {
2039
- const { data, error } = await PlanService.getPlans();
2040
- if (error) this.handleError(error);
2041
- return this.unwrap(data?.data);
2042
- }
2043
- }
2044
- };
2045
- }
2046
- };
2047
-
2048
- // src/_internal/types.gen.ts
2049
- var eq = {
2050
- KEYWORD: "keyword",
2051
- SEMANTIC: "semantic"
2052
- };
2053
- var greater_than = {
2054
- KEYWORD: "keyword",
2055
- SEMANTIC: "semantic"
2056
- };
2057
- var greater_than_or_equal = {
2058
- KEYWORD: "keyword",
2059
- SEMANTIC: "semantic"
2060
- };
2061
- var less_than = {
2062
- KEYWORD: "keyword",
2063
- SEMANTIC: "semantic"
2064
- };
2065
- var less_than_or_equal = {
2066
- KEYWORD: "keyword",
2067
- SEMANTIC: "semantic"
2068
- };
2069
- var not_eq = {
2070
- KEYWORD: "keyword",
2071
- SEMANTIC: "semantic"
2072
- };
2073
- var eq2 = {
2074
- PENDING: "pending",
2075
- PROCESSING: "processing",
2076
- COMPLETED: "completed",
2077
- FAILED: "failed"
2078
- };
2079
- var greater_than2 = {
2080
- PENDING: "pending",
2081
- PROCESSING: "processing",
2082
- COMPLETED: "completed",
2083
- FAILED: "failed"
2084
- };
2085
- var greater_than_or_equal2 = {
2086
- PENDING: "pending",
2087
- PROCESSING: "processing",
2088
- COMPLETED: "completed",
2089
- FAILED: "failed"
2090
- };
2091
- var less_than2 = {
2092
- PENDING: "pending",
2093
- PROCESSING: "processing",
2094
- COMPLETED: "completed",
2095
- FAILED: "failed"
2096
- };
2097
- var less_than_or_equal2 = {
2098
- PENDING: "pending",
2099
- PROCESSING: "processing",
2100
- COMPLETED: "completed",
2101
- FAILED: "failed"
2102
- };
2103
- var not_eq2 = {
2104
- PENDING: "pending",
2105
- PROCESSING: "processing",
2106
- COMPLETED: "completed",
2107
- FAILED: "failed"
2108
- };
2109
- var status = {
2110
- PENDING: "pending",
2111
- PROCESSING: "processing",
2112
- COMPLETED: "completed",
2113
- FAILED: "failed"
2114
- };
2115
- var eq3 = {
2116
- ACTIVE: "active",
2117
- REVOKED: "revoked",
2118
- EXPIRED: "expired"
2119
- };
2120
- var greater_than3 = {
2121
- ACTIVE: "active",
2122
- REVOKED: "revoked",
2123
- EXPIRED: "expired"
2124
- };
2125
- var greater_than_or_equal3 = {
2126
- ACTIVE: "active",
2127
- REVOKED: "revoked",
2128
- EXPIRED: "expired"
2129
- };
2130
- var less_than3 = {
2131
- ACTIVE: "active",
2132
- REVOKED: "revoked",
2133
- EXPIRED: "expired"
2134
- };
2135
- var less_than_or_equal3 = {
2136
- ACTIVE: "active",
2137
- REVOKED: "revoked",
2138
- EXPIRED: "expired"
2139
- };
2140
- var not_eq3 = {
2141
- ACTIVE: "active",
2142
- REVOKED: "revoked",
2143
- EXPIRED: "expired"
2144
- };
2145
- var eq4 = {
2146
- PENDING: "pending",
2147
- SUCCESS: "success",
2148
- FAILED: "failed",
2149
- REFUNDED: "refunded",
2150
- VOIDED: "voided"
2151
- };
2152
- var greater_than4 = {
2153
- PENDING: "pending",
2154
- SUCCESS: "success",
2155
- FAILED: "failed",
2156
- REFUNDED: "refunded",
2157
- VOIDED: "voided"
2158
- };
2159
- var greater_than_or_equal4 = {
2160
- PENDING: "pending",
2161
- SUCCESS: "success",
2162
- FAILED: "failed",
2163
- REFUNDED: "refunded",
2164
- VOIDED: "voided"
2165
- };
2166
- var less_than4 = {
2167
- PENDING: "pending",
2168
- SUCCESS: "success",
2169
- FAILED: "failed",
2170
- REFUNDED: "refunded",
2171
- VOIDED: "voided"
2172
- };
2173
- var less_than_or_equal4 = {
2174
- PENDING: "pending",
2175
- SUCCESS: "success",
2176
- FAILED: "failed",
2177
- REFUNDED: "refunded",
2178
- VOIDED: "voided"
2179
- };
2180
- var not_eq4 = {
2181
- PENDING: "pending",
2182
- SUCCESS: "success",
2183
- FAILED: "failed",
2184
- REFUNDED: "refunded",
2185
- VOIDED: "voided"
2186
- };
2187
- var status2 = {
2188
- ACTIVE: "active",
2189
- REVOKED: "revoked",
2190
- EXPIRED: "expired"
2191
- };
2192
- var format = {
2193
- ENTITY: "entity",
2194
- TABULAR: "tabular",
2195
- GRAPH: "graph",
2196
- COMPOSITE: "composite"
2197
- };
2198
- var eq5 = {
2199
- OWNER: "owner",
2200
- ADMIN: "admin",
2201
- MEMBER: "member"
2202
- };
2203
- var greater_than5 = {
2204
- OWNER: "owner",
2205
- ADMIN: "admin",
2206
- MEMBER: "member"
2207
- };
2208
- var greater_than_or_equal5 = {
2209
- OWNER: "owner",
2210
- ADMIN: "admin",
2211
- MEMBER: "member"
2212
- };
2213
- var less_than5 = {
2214
- OWNER: "owner",
2215
- ADMIN: "admin",
2216
- MEMBER: "member"
2217
- };
2218
- var less_than_or_equal5 = {
2219
- OWNER: "owner",
2220
- ADMIN: "admin",
2221
- MEMBER: "member"
2222
- };
2223
- var not_eq5 = {
2224
- OWNER: "owner",
2225
- ADMIN: "admin",
2226
- MEMBER: "member"
2227
- };
2228
- var eq6 = {
2229
- PLAN: "plan",
2230
- ADDON: "addon"
2231
- };
2232
- var greater_than6 = {
2233
- PLAN: "plan",
2234
- ADDON: "addon"
2235
- };
2236
- var greater_than_or_equal6 = {
2237
- PLAN: "plan",
2238
- ADDON: "addon"
2239
- };
2240
- var less_than6 = {
2241
- PLAN: "plan",
2242
- ADDON: "addon"
2243
- };
2244
- var less_than_or_equal6 = {
2245
- PLAN: "plan",
2246
- ADDON: "addon"
2247
- };
2248
- var not_eq6 = {
2249
- PLAN: "plan",
2250
- ADDON: "addon"
2251
- };
2252
- var role = {
2253
- OWNER: "owner",
2254
- ADMIN: "admin",
2255
- MEMBER: "member"
2256
- };
2257
- var eq7 = {
2258
- PUBLIC: "public",
2259
- PRIVATE: "private"
2260
- };
2261
- var greater_than7 = {
2262
- PUBLIC: "public",
2263
- PRIVATE: "private"
2264
- };
2265
- var greater_than_or_equal7 = {
2266
- PUBLIC: "public",
2267
- PRIVATE: "private"
2268
- };
2269
- var less_than7 = {
2270
- PUBLIC: "public",
2271
- PRIVATE: "private"
2272
- };
2273
- var less_than_or_equal7 = {
2274
- PUBLIC: "public",
2275
- PRIVATE: "private"
2276
- };
2277
- var not_eq7 = {
2278
- PUBLIC: "public",
2279
- PRIVATE: "private"
2280
- };
2281
- var eq8 = {
2282
- SALE: "sale",
2283
- AUTH: "auth",
2284
- REFUND: "refund",
2285
- VOID: "void"
2286
- };
2287
- var greater_than8 = {
2288
- SALE: "sale",
2289
- AUTH: "auth",
2290
- REFUND: "refund",
2291
- VOID: "void"
2292
- };
2293
- var greater_than_or_equal8 = {
2294
- SALE: "sale",
2295
- AUTH: "auth",
2296
- REFUND: "refund",
2297
- VOID: "void"
2298
- };
2299
- var less_than8 = {
2300
- SALE: "sale",
2301
- AUTH: "auth",
2302
- REFUND: "refund",
2303
- VOID: "void"
2304
- };
2305
- var less_than_or_equal8 = {
2306
- SALE: "sale",
2307
- AUTH: "auth",
2308
- REFUND: "refund",
2309
- VOID: "void"
2310
- };
2311
- var not_eq8 = {
2312
- SALE: "sale",
2313
- AUTH: "auth",
2314
- REFUND: "refund",
2315
- VOID: "void"
2316
- };
2317
- var type = {
2318
- PUBLIC: "public",
2319
- PRIVATE: "private"
2320
- };
2321
-
2322
2616
  // src/utils/retry.ts
2323
2617
  var DEFAULT_RETRY_CONFIG = {
2324
2618
  maxRetries: 3,
@@ -2375,6 +2669,35 @@ function withRetry(fn, config) {
2375
2669
  };
2376
2670
  }
2377
2671
 
2672
+ // src/pagination.ts
2673
+ async function* paginateAll(fetcher, options = {}) {
2674
+ const pageSize = options.pageSize || 20;
2675
+ const limit = options.limit;
2676
+ let page = 1;
2677
+ let totalYielded = 0;
2678
+ while (true) {
2679
+ const response = await fetcher(page, pageSize);
2680
+ for (const item of response.data) {
2681
+ yield item;
2682
+ totalYielded++;
2683
+ if (limit && totalYielded >= limit) {
2684
+ return;
2685
+ }
2686
+ }
2687
+ if (!response.links?.next || response.data.length === 0) {
2688
+ break;
2689
+ }
2690
+ page++;
2691
+ }
2692
+ }
2693
+ async function paginateToArray(fetcher, options = {}) {
2694
+ const results = [];
2695
+ for await (const item of paginateAll(fetcher, options)) {
2696
+ results.push(item);
2697
+ }
2698
+ return results;
2699
+ }
2700
+
2378
2701
  // src/streaming.ts
2379
2702
  async function* streamSSE(response, options = {}) {
2380
2703
  if (!response.body) {
@@ -2451,7 +2774,6 @@ async function collectStreamedMessage(stream) {
2451
2774
  DEFAULT_RETRY_CONFIG,
2452
2775
  DocumentUploadBase64Schema,
2453
2776
  EmbedRequestSchema,
2454
- GptClient,
2455
2777
  GptCoreError,
2456
2778
  InvitationCreateSchema,
2457
2779
  LoginRequestSchema,
@@ -2469,67 +2791,211 @@ async function collectStreamedMessage(stream) {
2469
2791
  ValidationError,
2470
2792
  WorkspaceCreateSchema,
2471
2793
  calculateBackoff,
2794
+ client,
2472
2795
  collectStreamedMessage,
2473
- eq,
2474
- eq2,
2475
- eq3,
2476
- eq4,
2477
- eq5,
2478
- eq6,
2479
- eq7,
2480
- eq8,
2481
- format,
2482
- greater_than,
2483
- greater_than2,
2484
- greater_than3,
2485
- greater_than4,
2486
- greater_than5,
2487
- greater_than6,
2488
- greater_than7,
2489
- greater_than8,
2490
- greater_than_or_equal,
2491
- greater_than_or_equal2,
2492
- greater_than_or_equal3,
2493
- greater_than_or_equal4,
2494
- greater_than_or_equal5,
2495
- greater_than_or_equal6,
2496
- greater_than_or_equal7,
2497
- greater_than_or_equal8,
2796
+ deleteAiConversationsById,
2797
+ deleteAiGraphEdgesById,
2798
+ deleteAiGraphNodesById,
2799
+ deleteApiKeysById,
2800
+ deleteApplicationsById,
2801
+ deleteBucketsById,
2802
+ deleteDocumentsById,
2803
+ deleteExtractionResultsById,
2804
+ deleteMessagesById,
2805
+ deleteNotificationPreferencesById,
2806
+ deleteObjectsById,
2807
+ deleteSearchSavedById,
2808
+ deleteTenantMembershipsByTenantIdByUserId,
2809
+ deleteTenantsById,
2810
+ deleteThreadsById,
2811
+ deleteTrainingExamplesById,
2812
+ deleteUserProfilesById,
2813
+ deleteWebhookConfigsById,
2814
+ deleteWorkspaceMembershipsByWorkspaceIdByUserId,
2815
+ deleteWorkspacesById,
2816
+ getAgents,
2817
+ getAgentsById,
2818
+ getAiChunksDocumentByDocumentId,
2819
+ getAiConversations,
2820
+ getAiConversationsById,
2821
+ getAiGraphEdges,
2822
+ getAiGraphNodes,
2823
+ getAiMessages,
2824
+ getApiKeys,
2825
+ getApiKeysById,
2826
+ getApplications,
2827
+ getApplicationsById,
2828
+ getApplicationsBySlugBySlug,
2829
+ getAuditLogs,
2830
+ getBuckets,
2831
+ getBucketsById,
2832
+ getBucketsByIdObjects,
2833
+ getBucketsByIdStats,
2834
+ getConfigs,
2835
+ getCreditPackages,
2836
+ getCreditPackagesById,
2837
+ getCreditPackagesSlugBySlug,
2838
+ getDocuments,
2839
+ getDocumentsById,
2840
+ getDocumentsByIdExtractionResults,
2841
+ getDocumentsByIdRelationshipsChunks,
2842
+ getDocumentsProcessingQueue,
2843
+ getDocumentsSearch,
2844
+ getDocumentsStats,
2845
+ getExtractionResults,
2846
+ getExtractionResultsById,
2847
+ getInvitations,
2848
+ getInvitationsConsumeByToken,
2849
+ getLlmAnalytics,
2850
+ getLlmAnalyticsById,
2851
+ getLlmAnalyticsCosts,
2852
+ getLlmAnalyticsPlatform,
2853
+ getLlmAnalyticsSummary,
2854
+ getLlmAnalyticsUsage,
2855
+ getLlmAnalyticsWorkspace,
2856
+ getMessages,
2857
+ getMessagesById,
2858
+ getMessagesSearch,
2859
+ getNotificationLogs,
2860
+ getNotificationLogsById,
2861
+ getNotificationPreferences,
2862
+ getNotificationPreferencesById,
2863
+ getObjects,
2864
+ getObjectsById,
2865
+ getPlans,
2866
+ getPlansById,
2867
+ getPlansSlugBySlug,
2868
+ getSearch,
2869
+ getSearchHealth,
2870
+ getSearchIndexes,
2871
+ getSearchSaved,
2872
+ getSearchSemantic,
2873
+ getSearchStats,
2874
+ getSearchStatus,
2875
+ getStorageStats,
2876
+ getTenantMemberships,
2877
+ getTenants,
2878
+ getTenantsById,
2879
+ getThreads,
2880
+ getThreadsById,
2881
+ getThreadsSearch,
2882
+ getTrainingExamples,
2883
+ getTrainingExamplesById,
2884
+ getTransactions,
2885
+ getTransactionsById,
2886
+ getUserProfiles,
2887
+ getUserProfilesById,
2888
+ getUserProfilesMe,
2889
+ getUsers,
2890
+ getUsersById,
2891
+ getUsersMe,
2892
+ getWallet,
2893
+ getWebhookConfigs,
2894
+ getWebhookConfigsById,
2895
+ getWebhookDeliveries,
2896
+ getWebhookDeliveriesById,
2897
+ getWorkspaceMemberships,
2898
+ getWorkspaces,
2899
+ getWorkspacesById,
2900
+ getWorkspacesMine,
2498
2901
  handleApiError,
2499
2902
  isRetryableError,
2500
- less_than,
2501
- less_than2,
2502
- less_than3,
2503
- less_than4,
2504
- less_than5,
2505
- less_than6,
2506
- less_than7,
2507
- less_than8,
2508
- less_than_or_equal,
2509
- less_than_or_equal2,
2510
- less_than_or_equal3,
2511
- less_than_or_equal4,
2512
- less_than_or_equal5,
2513
- less_than_or_equal6,
2514
- less_than_or_equal7,
2515
- less_than_or_equal8,
2516
- not_eq,
2517
- not_eq2,
2518
- not_eq3,
2519
- not_eq4,
2520
- not_eq5,
2521
- not_eq6,
2522
- not_eq7,
2523
- not_eq8,
2524
2903
  paginateAll,
2525
2904
  paginateToArray,
2905
+ patchApiKeysById,
2906
+ patchApiKeysByIdAllocate,
2907
+ patchApiKeysByIdRevoke,
2908
+ patchApiKeysByIdRotate,
2909
+ patchApplicationsById,
2910
+ patchBucketsById,
2911
+ patchConfigsByKey,
2912
+ patchDocumentsById,
2913
+ patchExtractionResultsById,
2914
+ patchInvitationsByIdAccept,
2915
+ patchInvitationsByIdResend,
2916
+ patchInvitationsByIdRevoke,
2917
+ patchMessagesById,
2918
+ patchNotificationPreferencesById,
2919
+ patchTenantMembershipsByTenantIdByUserId,
2920
+ patchTenantsById,
2921
+ patchThreadsById,
2922
+ patchTrainingExamplesById,
2923
+ patchUserProfilesById,
2924
+ patchUsersAuthResetPassword,
2925
+ patchUsersById,
2926
+ patchUsersByIdConfirmEmail,
2927
+ patchUsersByIdResetPassword,
2928
+ patchWalletAddons,
2929
+ patchWalletAddonsByAddonSlugCancel,
2930
+ patchWalletPlan,
2931
+ patchWebhookConfigsById,
2932
+ patchWorkspaceMembershipsByWorkspaceIdByUserId,
2933
+ patchWorkspacesById,
2934
+ patchWorkspacesByIdAllocate,
2935
+ postAgentsByIdClone,
2936
+ postAgentsByIdTest,
2937
+ postAgentsByIdValidate,
2938
+ postAgentsPredict,
2939
+ postAiChunksSearch,
2940
+ postAiConversations,
2941
+ postAiEmbed,
2942
+ postAiGraphEdges,
2943
+ postAiGraphNodes,
2944
+ postAiMessages,
2945
+ postAiSearch,
2946
+ postAiSearchAdvanced,
2947
+ postApiKeys,
2948
+ postApplications,
2949
+ postBuckets,
2950
+ postConfigs,
2951
+ postDocuments,
2952
+ postDocumentsBulkDelete,
2953
+ postDocumentsBulkReprocess,
2954
+ postDocumentsByIdAnalyze,
2955
+ postDocumentsByIdReprocess,
2956
+ postDocumentsExport,
2957
+ postDocumentsImport,
2958
+ postDocumentsPresignedUpload,
2959
+ postInvitationsAcceptByToken,
2960
+ postInvitationsInvite,
2961
+ postLlmAnalytics,
2962
+ postMessages,
2963
+ postNotificationPreferences,
2964
+ postObjectsBulkDestroy,
2965
+ postObjectsRegister,
2966
+ postPayments,
2967
+ postSearchReindex,
2968
+ postSearchSaved,
2969
+ postStorageSignDownload,
2970
+ postStorageSignUpload,
2971
+ postTenantMemberships,
2972
+ postTenants,
2973
+ postTenantsByIdBuyStorage,
2974
+ postTenantsByIdRemoveStorage,
2975
+ postThreads,
2976
+ postThreadsActive,
2977
+ postThreadsByIdMessages,
2978
+ postThreadsByIdSummarize,
2979
+ postTokens,
2980
+ postTrainingExamples,
2981
+ postTrainingExamplesBulk,
2982
+ postTrainingExamplesBulkDelete,
2983
+ postUserProfiles,
2984
+ postUsersAuthConfirm,
2985
+ postUsersAuthLogin,
2986
+ postUsersAuthMagicLinkLogin,
2987
+ postUsersAuthMagicLinkRequest,
2988
+ postUsersAuthRegister,
2989
+ postUsersAuthRegisterWithOidc,
2990
+ postUsersRegisterIsv,
2991
+ postWebhookConfigs,
2992
+ postWebhookConfigsByIdTest,
2993
+ postWebhookDeliveriesByIdRetry,
2994
+ postWorkspaceMemberships,
2995
+ postWorkspaces,
2526
2996
  retryWithBackoff,
2527
- role,
2528
2997
  sleep,
2529
- status,
2530
- status2,
2531
2998
  streamMessage,
2532
2999
  streamSSE,
2533
- type,
2534
3000
  withRetry
2535
3001
  });