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