@gpt-core/client 0.1.0-alpha.2 → 0.2.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 +15730 -6926
  2. package/dist/index.d.ts +15730 -6926
  3. package/dist/index.js +2390 -1956
  4. package/dist/index.mjs +2196 -1903
  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,1962 @@ 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
- });
830
- }
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
- });
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
839
1319
  }
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
- });
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
848
1333
  }
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
- });
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
859
1347
  }
860
- /**
861
- * /documents operation on document resource
862
- */
863
- static getDocuments(options) {
864
- return (options?.client ?? client).get({
865
- ...options,
866
- url: "/documents"
867
- });
1348
+ });
1349
+ var deleteThreadsById = (options) => (options.client ?? client).delete({
1350
+ security: [{ scheme: "bearer", type: "http" }],
1351
+ url: "/threads/{id}",
1352
+ ...options
1353
+ });
1354
+ var getThreadsById = (options) => (options.client ?? client).get({
1355
+ security: [{ scheme: "bearer", type: "http" }],
1356
+ url: "/threads/{id}",
1357
+ ...options
1358
+ });
1359
+ var patchThreadsById = (options) => (options.client ?? client).patch({
1360
+ security: [{ scheme: "bearer", type: "http" }],
1361
+ url: "/threads/{id}",
1362
+ ...options,
1363
+ headers: {
1364
+ "Content-Type": "application/vnd.api+json",
1365
+ ...options.headers
868
1366
  }
869
- /**
870
- * /documents operation on document resource
871
- */
872
- static postDocuments(options) {
873
- return (options?.client ?? client).post({
874
- ...options,
875
- url: "/documents"
876
- });
1367
+ });
1368
+ var getLlmAnalytics = (options) => (options.client ?? client).get({
1369
+ security: [{ scheme: "bearer", type: "http" }],
1370
+ url: "/llm_analytics",
1371
+ ...options
1372
+ });
1373
+ var postLlmAnalytics = (options) => (options.client ?? client).post({
1374
+ security: [{ scheme: "bearer", type: "http" }],
1375
+ url: "/llm_analytics",
1376
+ ...options,
1377
+ headers: {
1378
+ "Content-Type": "application/vnd.api+json",
1379
+ ...options.headers
877
1380
  }
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
- });
1381
+ });
1382
+ var postDocumentsByIdReprocess = (options) => (options.client ?? client).post({
1383
+ security: [{ scheme: "bearer", type: "http" }],
1384
+ url: "/documents/{id}/reprocess",
1385
+ ...options,
1386
+ headers: {
1387
+ "Content-Type": "application/vnd.api+json",
1388
+ ...options.headers
886
1389
  }
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
- });
1390
+ });
1391
+ var patchUsersByIdResetPassword = (options) => (options.client ?? client).patch({
1392
+ security: [{ scheme: "bearer", type: "http" }],
1393
+ url: "/users/{id}/reset-password",
1394
+ ...options,
1395
+ headers: {
1396
+ "Content-Type": "application/vnd.api+json",
1397
+ ...options.headers
895
1398
  }
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
- });
1399
+ });
1400
+ var postDocumentsPresignedUpload = (options) => (options.client ?? client).post({
1401
+ security: [{ scheme: "bearer", type: "http" }],
1402
+ url: "/documents/presigned_upload",
1403
+ ...options,
1404
+ headers: {
1405
+ "Content-Type": "application/vnd.api+json",
1406
+ ...options.headers
904
1407
  }
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
- });
1408
+ });
1409
+ var getMessagesSearch = (options) => (options.client ?? client).get({
1410
+ security: [{ scheme: "bearer", type: "http" }],
1411
+ url: "/messages/search",
1412
+ ...options
1413
+ });
1414
+ var deleteWorkspacesById = (options) => (options.client ?? client).delete({
1415
+ security: [{ scheme: "bearer", type: "http" }],
1416
+ url: "/workspaces/{id}",
1417
+ ...options
1418
+ });
1419
+ var getWorkspacesById = (options) => (options.client ?? client).get({
1420
+ security: [{ scheme: "bearer", type: "http" }],
1421
+ url: "/workspaces/{id}",
1422
+ ...options
1423
+ });
1424
+ var patchWorkspacesById = (options) => (options.client ?? client).patch({
1425
+ security: [{ scheme: "bearer", type: "http" }],
1426
+ url: "/workspaces/{id}",
1427
+ ...options,
1428
+ headers: {
1429
+ "Content-Type": "application/vnd.api+json",
1430
+ ...options.headers
913
1431
  }
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
- });
1432
+ });
1433
+ var getTenants = (options) => (options.client ?? client).get({
1434
+ security: [{ scheme: "bearer", type: "http" }],
1435
+ url: "/tenants",
1436
+ ...options
1437
+ });
1438
+ var postTenants = (options) => (options.client ?? client).post({
1439
+ security: [{ scheme: "bearer", type: "http" }],
1440
+ url: "/tenants",
1441
+ ...options,
1442
+ headers: {
1443
+ "Content-Type": "application/vnd.api+json",
1444
+ ...options.headers
922
1445
  }
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
- });
1446
+ });
1447
+ var postTenantsByIdRemoveStorage = (options) => (options.client ?? client).post({
1448
+ security: [{ scheme: "bearer", type: "http" }],
1449
+ url: "/tenants/{id}/remove-storage",
1450
+ ...options,
1451
+ headers: {
1452
+ "Content-Type": "application/vnd.api+json",
1453
+ ...options.headers
931
1454
  }
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
- });
1455
+ });
1456
+ var postDocumentsBulkReprocess = (options) => (options.client ?? client).post({
1457
+ security: [{ scheme: "bearer", type: "http" }],
1458
+ url: "/documents/bulk_reprocess",
1459
+ ...options,
1460
+ headers: {
1461
+ "Content-Type": "application/vnd.api+json",
1462
+ ...options.headers
940
1463
  }
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
- });
1464
+ });
1465
+ var getNotificationLogsById = (options) => (options.client ?? client).get({
1466
+ security: [{ scheme: "bearer", type: "http" }],
1467
+ url: "/notification_logs/{id}",
1468
+ ...options
1469
+ });
1470
+ var getWebhookDeliveriesById = (options) => (options.client ?? client).get({
1471
+ security: [{ scheme: "bearer", type: "http" }],
1472
+ url: "/webhook_deliveries/{id}",
1473
+ ...options
1474
+ });
1475
+ var getAuditLogs = (options) => (options.client ?? client).get({
1476
+ security: [{ scheme: "bearer", type: "http" }],
1477
+ url: "/audit-logs",
1478
+ ...options
1479
+ });
1480
+ var getAiGraphEdges = (options) => (options.client ?? client).get({
1481
+ security: [{ scheme: "bearer", type: "http" }],
1482
+ url: "/ai/graph/edges",
1483
+ ...options
1484
+ });
1485
+ var postAiGraphEdges = (options) => (options.client ?? client).post({
1486
+ security: [{ scheme: "bearer", type: "http" }],
1487
+ url: "/ai/graph/edges",
1488
+ ...options,
1489
+ headers: {
1490
+ "Content-Type": "application/vnd.api+json",
1491
+ ...options.headers
949
1492
  }
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
- });
1493
+ });
1494
+ var postDocumentsExport = (options) => (options.client ?? client).post({
1495
+ security: [{ scheme: "bearer", type: "http" }],
1496
+ url: "/documents/export",
1497
+ ...options
1498
+ });
1499
+ var getTrainingExamples = (options) => (options.client ?? client).get({
1500
+ security: [{ scheme: "bearer", type: "http" }],
1501
+ url: "/training_examples",
1502
+ ...options
1503
+ });
1504
+ var postTrainingExamples = (options) => (options.client ?? client).post({
1505
+ security: [{ scheme: "bearer", type: "http" }],
1506
+ url: "/training_examples",
1507
+ ...options,
1508
+ headers: {
1509
+ "Content-Type": "application/vnd.api+json",
1510
+ ...options.headers
958
1511
  }
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
- });
1512
+ });
1513
+ var getBuckets = (options) => (options.client ?? client).get({
1514
+ security: [{ scheme: "bearer", type: "http" }],
1515
+ url: "/buckets",
1516
+ ...options
1517
+ });
1518
+ var postBuckets = (options) => (options.client ?? client).post({
1519
+ security: [{ scheme: "bearer", type: "http" }],
1520
+ url: "/buckets",
1521
+ ...options,
1522
+ headers: {
1523
+ "Content-Type": "application/vnd.api+json",
1524
+ ...options.headers
969
1525
  }
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
- });
1526
+ });
1527
+ var getPlansById = (options) => (options.client ?? client).get({
1528
+ security: [{ scheme: "bearer", type: "http" }],
1529
+ url: "/plans/{id}",
1530
+ ...options
1531
+ });
1532
+ var patchWalletAddons = (options) => (options.client ?? client).patch({
1533
+ security: [{ scheme: "bearer", type: "http" }],
1534
+ url: "/wallet/addons",
1535
+ ...options,
1536
+ headers: {
1537
+ "Content-Type": "application/vnd.api+json",
1538
+ ...options.headers
978
1539
  }
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
- });
1540
+ });
1541
+ var postUsersAuthMagicLinkLogin = (options) => (options.client ?? client).post({
1542
+ security: [{ scheme: "bearer", type: "http" }],
1543
+ url: "/users/auth/magic_link/login",
1544
+ ...options,
1545
+ headers: {
1546
+ "Content-Type": "application/vnd.api+json",
1547
+ ...options.headers
987
1548
  }
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
- });
1549
+ });
1550
+ var getApiKeys = (options) => (options.client ?? client).get({
1551
+ security: [{ scheme: "bearer", type: "http" }],
1552
+ url: "/api_keys",
1553
+ ...options
1554
+ });
1555
+ var postApiKeys = (options) => (options.client ?? client).post({
1556
+ security: [{ scheme: "bearer", type: "http" }],
1557
+ url: "/api_keys",
1558
+ ...options,
1559
+ headers: {
1560
+ "Content-Type": "application/vnd.api+json",
1561
+ ...options.headers
996
1562
  }
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
- });
1563
+ });
1564
+ var getExtractionResults = (options) => (options.client ?? client).get({
1565
+ security: [{ scheme: "bearer", type: "http" }],
1566
+ url: "/extraction_results",
1567
+ ...options
1568
+ });
1569
+ var deleteAgentsById = (options) => (options.client ?? client).delete({
1570
+ security: [{ scheme: "bearer", type: "http" }],
1571
+ url: "/agents/{id}",
1572
+ ...options
1573
+ });
1574
+ var getAgentsById = (options) => (options.client ?? client).get({
1575
+ security: [{ scheme: "bearer", type: "http" }],
1576
+ url: "/agents/{id}",
1577
+ ...options
1578
+ });
1579
+ var patchAgentsById = (options) => (options.client ?? client).patch({
1580
+ security: [{ scheme: "bearer", type: "http" }],
1581
+ url: "/agents/{id}",
1582
+ ...options,
1583
+ headers: {
1584
+ "Content-Type": "application/vnd.api+json",
1585
+ ...options.headers
1005
1586
  }
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
- });
1587
+ });
1588
+ var postDocumentsImport = (options) => (options.client ?? client).post({
1589
+ security: [{ scheme: "bearer", type: "http" }],
1590
+ url: "/documents/import",
1591
+ ...options,
1592
+ headers: {
1593
+ "Content-Type": "application/vnd.api+json",
1594
+ ...options.headers
1014
1595
  }
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
- });
1596
+ });
1597
+ var deleteApiKeysById = (options) => (options.client ?? client).delete({
1598
+ security: [{ scheme: "bearer", type: "http" }],
1599
+ url: "/api_keys/{id}",
1600
+ ...options
1601
+ });
1602
+ var getApiKeysById = (options) => (options.client ?? client).get({
1603
+ security: [{ scheme: "bearer", type: "http" }],
1604
+ url: "/api_keys/{id}",
1605
+ ...options
1606
+ });
1607
+ var patchApiKeysById = (options) => (options.client ?? client).patch({
1608
+ security: [{ scheme: "bearer", type: "http" }],
1609
+ url: "/api_keys/{id}",
1610
+ ...options,
1611
+ headers: {
1612
+ "Content-Type": "application/vnd.api+json",
1613
+ ...options.headers
1025
1614
  }
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
- });
1615
+ });
1616
+ var postAiSearch = (options) => (options.client ?? client).post({
1617
+ security: [{ scheme: "bearer", type: "http" }],
1618
+ url: "/ai/search",
1619
+ ...options,
1620
+ headers: {
1621
+ "Content-Type": "application/vnd.api+json",
1622
+ ...options.headers
1034
1623
  }
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
- });
1624
+ });
1625
+ var deleteAiGraphNodesById = (options) => (options.client ?? client).delete({
1626
+ security: [{ scheme: "bearer", type: "http" }],
1627
+ url: "/ai/graph/nodes/{id}",
1628
+ ...options
1629
+ });
1630
+ var patchWalletAddonsByAddonSlugCancel = (options) => (options.client ?? client).patch({
1631
+ security: [{ scheme: "bearer", type: "http" }],
1632
+ url: "/wallet/addons/{addon_slug}/cancel",
1633
+ ...options,
1634
+ headers: {
1635
+ "Content-Type": "application/vnd.api+json",
1636
+ ...options.headers
1043
1637
  }
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
- });
1638
+ });
1639
+ var deleteApplicationsById = (options) => (options.client ?? client).delete({
1640
+ security: [{ scheme: "bearer", type: "http" }],
1641
+ url: "/applications/{id}",
1642
+ ...options
1643
+ });
1644
+ var getApplicationsById = (options) => (options.client ?? client).get({
1645
+ security: [{ scheme: "bearer", type: "http" }],
1646
+ url: "/applications/{id}",
1647
+ ...options
1648
+ });
1649
+ var patchApplicationsById = (options) => (options.client ?? client).patch({
1650
+ security: [{ scheme: "bearer", type: "http" }],
1651
+ url: "/applications/{id}",
1652
+ ...options,
1653
+ headers: {
1654
+ "Content-Type": "application/vnd.api+json",
1655
+ ...options.headers
1052
1656
  }
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
- });
1657
+ });
1658
+ var getSearchHealth = (options) => (options.client ?? client).get({
1659
+ security: [{ scheme: "bearer", type: "http" }],
1660
+ url: "/search/health",
1661
+ ...options
1662
+ });
1663
+ var getTransactions = (options) => (options.client ?? client).get({
1664
+ security: [{ scheme: "bearer", type: "http" }],
1665
+ url: "/transactions",
1666
+ ...options
1667
+ });
1668
+ var getUserProfiles = (options) => (options.client ?? client).get({
1669
+ security: [{ scheme: "bearer", type: "http" }],
1670
+ url: "/user_profiles",
1671
+ ...options
1672
+ });
1673
+ var postUserProfiles = (options) => (options.client ?? client).post({
1674
+ security: [{ scheme: "bearer", type: "http" }],
1675
+ url: "/user_profiles",
1676
+ ...options,
1677
+ headers: {
1678
+ "Content-Type": "application/vnd.api+json",
1679
+ ...options.headers
1061
1680
  }
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
- });
1681
+ });
1682
+ var patchUsersByIdConfirmEmail = (options) => (options.client ?? client).patch({
1683
+ security: [{ scheme: "bearer", type: "http" }],
1684
+ url: "/users/{id}/confirm-email",
1685
+ ...options,
1686
+ headers: {
1687
+ "Content-Type": "application/vnd.api+json",
1688
+ ...options.headers
1070
1689
  }
1071
- /**
1072
- * /agents operation on agent resource
1073
- */
1074
- static getAgents(options) {
1075
- return (options?.client ?? client).get({
1076
- ...options,
1077
- url: "/agents"
1078
- });
1690
+ });
1691
+ var getThreadsSearch = (options) => (options.client ?? client).get({
1692
+ security: [{ scheme: "bearer", type: "http" }],
1693
+ url: "/threads/search",
1694
+ ...options
1695
+ });
1696
+ var getDocumentsByIdRelationshipsChunks = (options) => (options.client ?? client).get({
1697
+ security: [{ scheme: "bearer", type: "http" }],
1698
+ url: "/documents/{id}/relationships/chunks",
1699
+ ...options
1700
+ });
1701
+ var patchWalletPlan = (options) => (options.client ?? client).patch({
1702
+ security: [{ scheme: "bearer", type: "http" }],
1703
+ url: "/wallet/plan",
1704
+ ...options,
1705
+ headers: {
1706
+ "Content-Type": "application/vnd.api+json",
1707
+ ...options.headers
1079
1708
  }
1080
- /**
1081
- * /agents operation on agent resource
1082
- */
1083
- static postAgents(options) {
1084
- return (options?.client ?? client).post({
1085
- ...options,
1086
- url: "/agents"
1087
- });
1709
+ });
1710
+ var getPlansSlugBySlug = (options) => (options.client ?? client).get({
1711
+ security: [{ scheme: "bearer", type: "http" }],
1712
+ url: "/plans/slug/{slug}",
1713
+ ...options
1714
+ });
1715
+ var getLlmAnalyticsById = (options) => (options.client ?? client).get({
1716
+ security: [{ scheme: "bearer", type: "http" }],
1717
+ url: "/llm_analytics/{id}",
1718
+ ...options
1719
+ });
1720
+ var getSearchStatus = (options) => (options.client ?? client).get({
1721
+ security: [{ scheme: "bearer", type: "http" }],
1722
+ url: "/search/status",
1723
+ ...options
1724
+ });
1725
+ var patchApiKeysByIdAllocate = (options) => (options.client ?? client).patch({
1726
+ security: [{ scheme: "bearer", type: "http" }],
1727
+ url: "/api_keys/{id}/allocate",
1728
+ ...options,
1729
+ headers: {
1730
+ "Content-Type": "application/vnd.api+json",
1731
+ ...options.headers
1088
1732
  }
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
- });
1733
+ });
1734
+ var postUsersAuthLogin = (options) => (options.client ?? client).post({
1735
+ security: [{ scheme: "bearer", type: "http" }],
1736
+ url: "/users/auth/login",
1737
+ ...options,
1738
+ headers: {
1739
+ "Content-Type": "application/vnd.api+json",
1740
+ ...options.headers
1099
1741
  }
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
- });
1742
+ });
1743
+ var postAiEmbed = (options) => (options.client ?? client).post({
1744
+ security: [{ scheme: "bearer", type: "http" }],
1745
+ url: "/ai/embed",
1746
+ ...options,
1747
+ headers: {
1748
+ "Content-Type": "application/vnd.api+json",
1749
+ ...options.headers
1108
1750
  }
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
- });
1751
+ });
1752
+ var getWorkspacesMine = (options) => (options.client ?? client).get({
1753
+ security: [{ scheme: "bearer", type: "http" }],
1754
+ url: "/workspaces/mine",
1755
+ ...options
1756
+ });
1757
+ var postSearchReindex = (options) => (options.client ?? client).post({
1758
+ security: [{ scheme: "bearer", type: "http" }],
1759
+ url: "/search/reindex",
1760
+ ...options,
1761
+ headers: {
1762
+ "Content-Type": "application/vnd.api+json",
1763
+ ...options.headers
1117
1764
  }
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
- });
1765
+ });
1766
+ var postUsersAuthConfirm = (options) => (options.client ?? client).post({
1767
+ security: [{ scheme: "bearer", type: "http" }],
1768
+ url: "/users/auth/confirm",
1769
+ ...options,
1770
+ headers: {
1771
+ "Content-Type": "application/vnd.api+json",
1772
+ ...options.headers
1128
1773
  }
1129
- /**
1130
- * /applications operation on application resource
1131
- */
1132
- static postApplications(options) {
1133
- return (options?.client ?? client).post({
1134
- ...options,
1135
- url: "/applications"
1136
- });
1774
+ });
1775
+ var getStorageStats = (options) => (options.client ?? client).get({
1776
+ security: [{ scheme: "bearer", type: "http" }],
1777
+ url: "/storage/stats",
1778
+ ...options
1779
+ });
1780
+ var postTenantsByIdBuyStorage = (options) => (options.client ?? client).post({
1781
+ security: [{ scheme: "bearer", type: "http" }],
1782
+ url: "/tenants/{id}/buy-storage",
1783
+ ...options,
1784
+ headers: {
1785
+ "Content-Type": "application/vnd.api+json",
1786
+ ...options.headers
1137
1787
  }
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
- });
1788
+ });
1789
+ var getWorkspaceMemberships = (options) => (options.client ?? client).get({
1790
+ security: [{ scheme: "bearer", type: "http" }],
1791
+ url: "/workspace-memberships",
1792
+ ...options
1793
+ });
1794
+ var postWorkspaceMemberships = (options) => (options.client ?? client).post({
1795
+ security: [{ scheme: "bearer", type: "http" }],
1796
+ url: "/workspace-memberships",
1797
+ ...options,
1798
+ headers: {
1799
+ "Content-Type": "application/vnd.api+json",
1800
+ ...options.headers
1146
1801
  }
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
- });
1802
+ });
1803
+ var postUsersAuthMagicLinkRequest = (options) => (options.client ?? client).post({
1804
+ security: [{ scheme: "bearer", type: "http" }],
1805
+ url: "/users/auth/magic_link/request",
1806
+ ...options,
1807
+ headers: {
1808
+ "Content-Type": "application/vnd.api+json",
1809
+ ...options.headers
1155
1810
  }
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
- });
1811
+ });
1812
+ var postUsersAuthRegister = (options) => (options.client ?? client).post({
1813
+ security: [{ scheme: "bearer", type: "http" }],
1814
+ url: "/users/auth/register",
1815
+ ...options,
1816
+ headers: {
1817
+ "Content-Type": "application/vnd.api+json",
1818
+ ...options.headers
1164
1819
  }
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
- });
1820
+ });
1821
+ var postTrainingExamplesBulk = (options) => (options.client ?? client).post({
1822
+ security: [{ scheme: "bearer", type: "http" }],
1823
+ url: "/training_examples/bulk",
1824
+ ...options,
1825
+ headers: {
1826
+ "Content-Type": "application/vnd.api+json",
1827
+ ...options.headers
1173
1828
  }
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
- });
1829
+ });
1830
+ var deleteBucketsById = (options) => (options.client ?? client).delete({
1831
+ security: [{ scheme: "bearer", type: "http" }],
1832
+ url: "/buckets/{id}",
1833
+ ...options
1834
+ });
1835
+ var getBucketsById = (options) => (options.client ?? client).get({
1836
+ security: [{ scheme: "bearer", type: "http" }],
1837
+ url: "/buckets/{id}",
1838
+ ...options
1839
+ });
1840
+ var patchBucketsById = (options) => (options.client ?? client).patch({
1841
+ security: [{ scheme: "bearer", type: "http" }],
1842
+ url: "/buckets/{id}",
1843
+ ...options,
1844
+ headers: {
1845
+ "Content-Type": "application/vnd.api+json",
1846
+ ...options.headers
1184
1847
  }
1185
- /**
1186
- * /tenants operation on tenant resource
1187
- */
1188
- static postTenants(options) {
1189
- return (options?.client ?? client).post({
1190
- ...options,
1191
- url: "/tenants"
1192
- });
1848
+ });
1849
+ var deleteAiGraphEdgesById = (options) => (options.client ?? client).delete({
1850
+ security: [{ scheme: "bearer", type: "http" }],
1851
+ url: "/ai/graph/edges/{id}",
1852
+ ...options
1853
+ });
1854
+ var deleteTenantsById = (options) => (options.client ?? client).delete({
1855
+ security: [{ scheme: "bearer", type: "http" }],
1856
+ url: "/tenants/{id}",
1857
+ ...options
1858
+ });
1859
+ var getTenantsById = (options) => (options.client ?? client).get({
1860
+ security: [{ scheme: "bearer", type: "http" }],
1861
+ url: "/tenants/{id}",
1862
+ ...options
1863
+ });
1864
+ var patchTenantsById = (options) => (options.client ?? client).patch({
1865
+ security: [{ scheme: "bearer", type: "http" }],
1866
+ url: "/tenants/{id}",
1867
+ ...options,
1868
+ headers: {
1869
+ "Content-Type": "application/vnd.api+json",
1870
+ ...options.headers
1193
1871
  }
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
- });
1872
+ });
1873
+ var getPlans = (options) => (options.client ?? client).get({
1874
+ security: [{ scheme: "bearer", type: "http" }],
1875
+ url: "/plans",
1876
+ ...options
1877
+ });
1878
+ var postAgentsByIdTest = (options) => (options.client ?? client).post({
1879
+ security: [{ scheme: "bearer", type: "http" }],
1880
+ url: "/agents/{id}/test",
1881
+ ...options,
1882
+ headers: {
1883
+ "Content-Type": "application/vnd.api+json",
1884
+ ...options.headers
1202
1885
  }
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
- });
1886
+ });
1887
+ var getDocumentsProcessingQueue = (options) => (options.client ?? client).get({
1888
+ security: [{ scheme: "bearer", type: "http" }],
1889
+ url: "/documents/processing_queue",
1890
+ ...options
1891
+ });
1892
+ var deleteTenantMembershipsByTenantIdByUserId = (options) => (options.client ?? client).delete({
1893
+ security: [{ scheme: "bearer", type: "http" }],
1894
+ url: "/tenant-memberships/{tenant_id}/{user_id}",
1895
+ ...options
1896
+ });
1897
+ var patchTenantMembershipsByTenantIdByUserId = (options) => (options.client ?? client).patch({
1898
+ security: [{ scheme: "bearer", type: "http" }],
1899
+ url: "/tenant-memberships/{tenant_id}/{user_id}",
1900
+ ...options,
1901
+ headers: {
1902
+ "Content-Type": "application/vnd.api+json",
1903
+ ...options.headers
1211
1904
  }
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
- });
1905
+ });
1906
+ var postStorageSignUpload = (options) => (options.client ?? client).post({
1907
+ security: [{ scheme: "bearer", type: "http" }],
1908
+ url: "/storage/sign_upload",
1909
+ ...options,
1910
+ headers: {
1911
+ "Content-Type": "application/vnd.api+json",
1912
+ ...options.headers
1220
1913
  }
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
- });
1914
+ });
1915
+ var postWebhookDeliveriesByIdRetry = (options) => (options.client ?? client).post({
1916
+ security: [{ scheme: "bearer", type: "http" }],
1917
+ url: "/webhook_deliveries/{id}/retry",
1918
+ ...options,
1919
+ headers: {
1920
+ "Content-Type": "application/vnd.api+json",
1921
+ ...options.headers
1229
1922
  }
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
- });
1923
+ });
1924
+ var postThreadsByIdSummarize = (options) => (options.client ?? client).post({
1925
+ security: [{ scheme: "bearer", type: "http" }],
1926
+ url: "/threads/{id}/summarize",
1927
+ ...options,
1928
+ headers: {
1929
+ "Content-Type": "application/vnd.api+json",
1930
+ ...options.headers
1238
1931
  }
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
- });
1932
+ });
1933
+ var patchConfigsByKey = (options) => (options.client ?? client).patch({
1934
+ security: [{ scheme: "bearer", type: "http" }],
1935
+ url: "/configs/{key}",
1936
+ ...options,
1937
+ headers: {
1938
+ "Content-Type": "application/vnd.api+json",
1939
+ ...options.headers
1249
1940
  }
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
- });
1941
+ });
1942
+ var patchApiKeysByIdRotate = (options) => (options.client ?? client).patch({
1943
+ security: [{ scheme: "bearer", type: "http" }],
1944
+ url: "/api_keys/{id}/rotate",
1945
+ ...options,
1946
+ headers: {
1947
+ "Content-Type": "application/vnd.api+json",
1948
+ ...options.headers
1260
1949
  }
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
- });
1950
+ });
1951
+ var postAgentsByIdClone = (options) => (options.client ?? client).post({
1952
+ security: [{ scheme: "bearer", type: "http" }],
1953
+ url: "/agents/{id}/clone",
1954
+ ...options,
1955
+ headers: {
1956
+ "Content-Type": "application/vnd.api+json",
1957
+ ...options.headers
1269
1958
  }
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
- });
1959
+ });
1960
+ var deleteUserProfilesById = (options) => (options.client ?? client).delete({
1961
+ security: [{ scheme: "bearer", type: "http" }],
1962
+ url: "/user_profiles/{id}",
1963
+ ...options
1964
+ });
1965
+ var getUserProfilesById = (options) => (options.client ?? client).get({
1966
+ security: [{ scheme: "bearer", type: "http" }],
1967
+ url: "/user_profiles/{id}",
1968
+ ...options
1969
+ });
1970
+ var patchUserProfilesById = (options) => (options.client ?? client).patch({
1971
+ security: [{ scheme: "bearer", type: "http" }],
1972
+ url: "/user_profiles/{id}",
1973
+ ...options,
1974
+ headers: {
1975
+ "Content-Type": "application/vnd.api+json",
1976
+ ...options.headers
1278
1977
  }
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
- });
1978
+ });
1979
+ var deleteObjectsById = (options) => (options.client ?? client).delete({
1980
+ security: [{ scheme: "bearer", type: "http" }],
1981
+ url: "/objects/{id}",
1982
+ ...options
1983
+ });
1984
+ var getObjectsById = (options) => (options.client ?? client).get({
1985
+ security: [{ scheme: "bearer", type: "http" }],
1986
+ url: "/objects/{id}",
1987
+ ...options
1988
+ });
1989
+ var getWebhookConfigs = (options) => (options.client ?? client).get({
1990
+ security: [{ scheme: "bearer", type: "http" }],
1991
+ url: "/webhook_configs",
1992
+ ...options
1993
+ });
1994
+ var postWebhookConfigs = (options) => (options.client ?? client).post({
1995
+ security: [{ scheme: "bearer", type: "http" }],
1996
+ url: "/webhook_configs",
1997
+ ...options,
1998
+ headers: {
1999
+ "Content-Type": "application/vnd.api+json",
2000
+ ...options.headers
1287
2001
  }
1288
- /**
1289
- * /plans operation on plan resource
1290
- */
1291
- static getPlans(options) {
1292
- return (options?.client ?? client).get({
1293
- ...options,
1294
- url: "/plans"
1295
- });
2002
+ });
2003
+ var postObjectsBulkDestroy = (options) => (options.client ?? client).post({
2004
+ security: [{ scheme: "bearer", type: "http" }],
2005
+ url: "/objects/bulk-destroy",
2006
+ ...options,
2007
+ headers: {
2008
+ "Content-Type": "application/vnd.api+json",
2009
+ ...options.headers
1296
2010
  }
1297
- /**
1298
- * /plans operation on plan resource
1299
- */
1300
- static postPlans(options) {
1301
- return (options?.client ?? client).post({
1302
- ...options,
1303
- url: "/plans"
1304
- });
2011
+ });
2012
+ var getApplicationsBySlugBySlug = (options) => (options.client ?? client).get({
2013
+ security: [{ scheme: "bearer", type: "http" }],
2014
+ url: "/applications/by-slug/{slug}",
2015
+ ...options
2016
+ });
2017
+ var getNotificationLogs = (options) => (options.client ?? client).get({
2018
+ security: [{ scheme: "bearer", type: "http" }],
2019
+ url: "/notification_logs",
2020
+ ...options
2021
+ });
2022
+ var getWallet = (options) => (options.client ?? client).get({
2023
+ security: [{ scheme: "bearer", type: "http" }],
2024
+ url: "/wallet",
2025
+ ...options
2026
+ });
2027
+ var deleteMessagesById = (options) => (options.client ?? client).delete({
2028
+ security: [{ scheme: "bearer", type: "http" }],
2029
+ url: "/messages/{id}",
2030
+ ...options
2031
+ });
2032
+ var getMessagesById = (options) => (options.client ?? client).get({
2033
+ security: [{ scheme: "bearer", type: "http" }],
2034
+ url: "/messages/{id}",
2035
+ ...options
2036
+ });
2037
+ var patchMessagesById = (options) => (options.client ?? client).patch({
2038
+ security: [{ scheme: "bearer", type: "http" }],
2039
+ url: "/messages/{id}",
2040
+ ...options,
2041
+ headers: {
2042
+ "Content-Type": "application/vnd.api+json",
2043
+ ...options.headers
1305
2044
  }
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
- });
2045
+ });
2046
+ var getLlmAnalyticsUsage = (options) => (options.client ?? client).get({
2047
+ security: [{ scheme: "bearer", type: "http" }],
2048
+ url: "/llm_analytics/usage",
2049
+ ...options
2050
+ });
2051
+ var getSearchStats = (options) => (options.client ?? client).get({
2052
+ security: [{ scheme: "bearer", type: "http" }],
2053
+ url: "/search/stats",
2054
+ ...options
2055
+ });
2056
+ var deleteNotificationPreferencesById = (options) => (options.client ?? client).delete({
2057
+ security: [{ scheme: "bearer", type: "http" }],
2058
+ url: "/notification_preferences/{id}",
2059
+ ...options
2060
+ });
2061
+ var getNotificationPreferencesById = (options) => (options.client ?? client).get({
2062
+ security: [{ scheme: "bearer", type: "http" }],
2063
+ url: "/notification_preferences/{id}",
2064
+ ...options
2065
+ });
2066
+ var patchNotificationPreferencesById = (options) => (options.client ?? client).patch({
2067
+ security: [{ scheme: "bearer", type: "http" }],
2068
+ url: "/notification_preferences/{id}",
2069
+ ...options,
2070
+ headers: {
2071
+ "Content-Type": "application/vnd.api+json",
2072
+ ...options.headers
1316
2073
  }
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
- });
2074
+ });
2075
+ var getAiGraphNodes = (options) => (options.client ?? client).get({
2076
+ security: [{ scheme: "bearer", type: "http" }],
2077
+ url: "/ai/graph/nodes",
2078
+ ...options
2079
+ });
2080
+ var postAiGraphNodes = (options) => (options.client ?? client).post({
2081
+ security: [{ scheme: "bearer", type: "http" }],
2082
+ url: "/ai/graph/nodes",
2083
+ ...options,
2084
+ headers: {
2085
+ "Content-Type": "application/vnd.api+json",
2086
+ ...options.headers
1325
2087
  }
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
- });
2088
+ });
2089
+ var getAgents = (options) => (options.client ?? client).get({
2090
+ security: [{ scheme: "bearer", type: "http" }],
2091
+ url: "/agents",
2092
+ ...options
2093
+ });
2094
+ var postAgents = (options) => (options.client ?? client).post({
2095
+ security: [{ scheme: "bearer", type: "http" }],
2096
+ url: "/agents",
2097
+ ...options,
2098
+ headers: {
2099
+ "Content-Type": "application/vnd.api+json",
2100
+ ...options.headers
1334
2101
  }
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
- });
2102
+ });
2103
+ var getDocumentsByIdExtractionResults = (options) => (options.client ?? client).get({
2104
+ security: [{ scheme: "bearer", type: "http" }],
2105
+ url: "/documents/{id}/extraction_results",
2106
+ ...options
2107
+ });
2108
+ var postUsersRegisterIsv = (options) => (options.client ?? client).post({
2109
+ security: [{ scheme: "bearer", type: "http" }],
2110
+ url: "/users/register_isv",
2111
+ ...options,
2112
+ headers: {
2113
+ "Content-Type": "application/vnd.api+json",
2114
+ ...options.headers
1343
2115
  }
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
- });
2116
+ });
2117
+ var deleteWorkspaceMembershipsByWorkspaceIdByUserId = (options) => (options.client ?? client).delete({
2118
+ security: [{ scheme: "bearer", type: "http" }],
2119
+ url: "/workspace-memberships/{workspace_id}/{user_id}",
2120
+ ...options
2121
+ });
2122
+ var patchWorkspaceMembershipsByWorkspaceIdByUserId = (options) => (options.client ?? client).patch({
2123
+ security: [{ scheme: "bearer", type: "http" }],
2124
+ url: "/workspace-memberships/{workspace_id}/{user_id}",
2125
+ ...options,
2126
+ headers: {
2127
+ "Content-Type": "application/vnd.api+json",
2128
+ ...options.headers
1354
2129
  }
1355
- };
2130
+ });
2131
+ var getCreditPackages = (options) => (options.client ?? client).get({
2132
+ security: [{ scheme: "bearer", type: "http" }],
2133
+ url: "/credit-packages",
2134
+ ...options
2135
+ });
2136
+ var getUsers = (options) => (options.client ?? client).get({
2137
+ security: [{ scheme: "bearer", type: "http" }],
2138
+ url: "/users",
2139
+ ...options
2140
+ });
2141
+ var getObjects = (options) => (options.client ?? client).get({
2142
+ security: [{ scheme: "bearer", type: "http" }],
2143
+ url: "/objects",
2144
+ ...options
2145
+ });
1356
2146
 
1357
2147
  // src/errors/index.ts
1358
2148
  var GptCoreError = class extends Error {
@@ -1469,78 +2259,6 @@ function handleApiError(error) {
1469
2259
  }
1470
2260
  }
1471
2261
 
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
2262
  // src/schemas/requests.ts
1545
2263
  import { z } from "zod";
1546
2264
  var LoginRequestSchema = z.object({
@@ -1612,599 +2330,6 @@ var PresignedDownloadSchema = z.object({
1612
2330
  file_id: z.string().uuid()
1613
2331
  });
1614
2332
 
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
2333
  // src/utils/retry.ts
2209
2334
  var DEFAULT_RETRY_CONFIG = {
2210
2335
  maxRetries: 3,
@@ -2261,6 +2386,35 @@ function withRetry(fn, config) {
2261
2386
  };
2262
2387
  }
2263
2388
 
2389
+ // src/pagination.ts
2390
+ async function* paginateAll(fetcher, options = {}) {
2391
+ const pageSize = options.pageSize || 20;
2392
+ const limit = options.limit;
2393
+ let page = 1;
2394
+ let totalYielded = 0;
2395
+ while (true) {
2396
+ const response = await fetcher(page, pageSize);
2397
+ for (const item of response.data) {
2398
+ yield item;
2399
+ totalYielded++;
2400
+ if (limit && totalYielded >= limit) {
2401
+ return;
2402
+ }
2403
+ }
2404
+ if (!response.links?.next || response.data.length === 0) {
2405
+ break;
2406
+ }
2407
+ page++;
2408
+ }
2409
+ }
2410
+ async function paginateToArray(fetcher, options = {}) {
2411
+ const results = [];
2412
+ for await (const item of paginateAll(fetcher, options)) {
2413
+ results.push(item);
2414
+ }
2415
+ return results;
2416
+ }
2417
+
2264
2418
  // src/streaming.ts
2265
2419
  async function* streamSSE(response, options = {}) {
2266
2420
  if (!response.body) {
@@ -2336,7 +2490,6 @@ export {
2336
2490
  DEFAULT_RETRY_CONFIG,
2337
2491
  DocumentUploadBase64Schema,
2338
2492
  EmbedRequestSchema,
2339
- GptClient,
2340
2493
  GptCoreError,
2341
2494
  InvitationCreateSchema,
2342
2495
  LoginRequestSchema,
@@ -2354,67 +2507,207 @@ export {
2354
2507
  ValidationError,
2355
2508
  WorkspaceCreateSchema,
2356
2509
  calculateBackoff,
2510
+ client,
2357
2511
  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,
2512
+ deleteAgentsById,
2513
+ deleteAiGraphEdgesById,
2514
+ deleteAiGraphNodesById,
2515
+ deleteApiKeysById,
2516
+ deleteApplicationsById,
2517
+ deleteBucketsById,
2518
+ deleteDocumentsById,
2519
+ deleteExtractionResultsById,
2520
+ deleteMessagesById,
2521
+ deleteNotificationPreferencesById,
2522
+ deleteObjectsById,
2523
+ deleteSearchSavedById,
2524
+ deleteTenantMembershipsByTenantIdByUserId,
2525
+ deleteTenantsById,
2526
+ deleteThreadsById,
2527
+ deleteTrainingExamplesById,
2528
+ deleteUserProfilesById,
2529
+ deleteWebhookConfigsById,
2530
+ deleteWorkspaceMembershipsByWorkspaceIdByUserId,
2531
+ deleteWorkspacesById,
2532
+ getAgents,
2533
+ getAgentsById,
2534
+ getAiChunksDocumentByDocumentId,
2535
+ getAiGraphEdges,
2536
+ getAiGraphNodes,
2537
+ getApiKeys,
2538
+ getApiKeysById,
2539
+ getApplications,
2540
+ getApplicationsById,
2541
+ getApplicationsBySlugBySlug,
2542
+ getAuditLogs,
2543
+ getBuckets,
2544
+ getBucketsById,
2545
+ getBucketsByIdObjects,
2546
+ getBucketsByIdStats,
2547
+ getConfigs,
2548
+ getCreditPackages,
2549
+ getCreditPackagesById,
2550
+ getCreditPackagesSlugBySlug,
2551
+ getDocuments,
2552
+ getDocumentsById,
2553
+ getDocumentsByIdExtractionResults,
2554
+ getDocumentsByIdRelationshipsChunks,
2555
+ getDocumentsProcessingQueue,
2556
+ getDocumentsSearch,
2557
+ getDocumentsStats,
2558
+ getExtractionResults,
2559
+ getExtractionResultsById,
2560
+ getInvitations,
2561
+ getInvitationsConsumeByToken,
2562
+ getLlmAnalytics,
2563
+ getLlmAnalyticsById,
2564
+ getLlmAnalyticsCosts,
2565
+ getLlmAnalyticsPlatform,
2566
+ getLlmAnalyticsSummary,
2567
+ getLlmAnalyticsUsage,
2568
+ getLlmAnalyticsWorkspace,
2569
+ getMessages,
2570
+ getMessagesById,
2571
+ getMessagesSearch,
2572
+ getNotificationLogs,
2573
+ getNotificationLogsById,
2574
+ getNotificationPreferences,
2575
+ getNotificationPreferencesById,
2576
+ getObjects,
2577
+ getObjectsById,
2578
+ getPlans,
2579
+ getPlansById,
2580
+ getPlansSlugBySlug,
2581
+ getSearch,
2582
+ getSearchHealth,
2583
+ getSearchIndexes,
2584
+ getSearchSaved,
2585
+ getSearchSemantic,
2586
+ getSearchStats,
2587
+ getSearchStatus,
2588
+ getStorageStats,
2589
+ getTenantMemberships,
2590
+ getTenants,
2591
+ getTenantsById,
2592
+ getThreads,
2593
+ getThreadsById,
2594
+ getThreadsSearch,
2595
+ getTrainingExamples,
2596
+ getTrainingExamplesById,
2597
+ getTransactions,
2598
+ getTransactionsById,
2599
+ getUserProfiles,
2600
+ getUserProfilesById,
2601
+ getUserProfilesMe,
2602
+ getUsers,
2603
+ getUsersById,
2604
+ getUsersMe,
2605
+ getWallet,
2606
+ getWebhookConfigs,
2607
+ getWebhookConfigsById,
2608
+ getWebhookDeliveries,
2609
+ getWebhookDeliveriesById,
2610
+ getWorkspaceMemberships,
2611
+ getWorkspaces,
2612
+ getWorkspacesById,
2613
+ getWorkspacesMine,
2383
2614
  handleApiError,
2384
2615
  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
2616
  paginateAll,
2410
2617
  paginateToArray,
2618
+ patchAgentsById,
2619
+ patchApiKeysById,
2620
+ patchApiKeysByIdAllocate,
2621
+ patchApiKeysByIdRevoke,
2622
+ patchApiKeysByIdRotate,
2623
+ patchApplicationsById,
2624
+ patchBucketsById,
2625
+ patchConfigsByKey,
2626
+ patchDocumentsById,
2627
+ patchExtractionResultsById,
2628
+ patchInvitationsByIdAccept,
2629
+ patchInvitationsByIdResend,
2630
+ patchInvitationsByIdRevoke,
2631
+ patchMessagesById,
2632
+ patchNotificationPreferencesById,
2633
+ patchTenantMembershipsByTenantIdByUserId,
2634
+ patchTenantsById,
2635
+ patchThreadsById,
2636
+ patchTrainingExamplesById,
2637
+ patchUserProfilesById,
2638
+ patchUsersAuthResetPassword,
2639
+ patchUsersById,
2640
+ patchUsersByIdConfirmEmail,
2641
+ patchUsersByIdResetPassword,
2642
+ patchWalletAddons,
2643
+ patchWalletAddonsByAddonSlugCancel,
2644
+ patchWalletPlan,
2645
+ patchWebhookConfigsById,
2646
+ patchWorkspaceMembershipsByWorkspaceIdByUserId,
2647
+ patchWorkspacesById,
2648
+ patchWorkspacesByIdAllocate,
2649
+ postAgents,
2650
+ postAgentsByIdClone,
2651
+ postAgentsByIdTest,
2652
+ postAgentsByIdValidate,
2653
+ postAiChunksSearch,
2654
+ postAiEmbed,
2655
+ postAiGraphEdges,
2656
+ postAiGraphNodes,
2657
+ postAiSearch,
2658
+ postAiSearchAdvanced,
2659
+ postApiKeys,
2660
+ postApplications,
2661
+ postBuckets,
2662
+ postConfigs,
2663
+ postDocuments,
2664
+ postDocumentsBulkDelete,
2665
+ postDocumentsBulkReprocess,
2666
+ postDocumentsByIdAnalyze,
2667
+ postDocumentsByIdReprocess,
2668
+ postDocumentsExport,
2669
+ postDocumentsImport,
2670
+ postDocumentsPresignedUpload,
2671
+ postInvitationsAcceptByToken,
2672
+ postInvitationsInvite,
2673
+ postLlmAnalytics,
2674
+ postMessages,
2675
+ postNotificationPreferences,
2676
+ postObjectsBulkDestroy,
2677
+ postObjectsRegister,
2678
+ postPayments,
2679
+ postSearchReindex,
2680
+ postSearchSaved,
2681
+ postStorageSignDownload,
2682
+ postStorageSignUpload,
2683
+ postTenantMemberships,
2684
+ postTenants,
2685
+ postTenantsByIdBuyStorage,
2686
+ postTenantsByIdRemoveStorage,
2687
+ postThreads,
2688
+ postThreadsActive,
2689
+ postThreadsByIdMessages,
2690
+ postThreadsByIdSummarize,
2691
+ postTokens,
2692
+ postTrainingExamples,
2693
+ postTrainingExamplesBulk,
2694
+ postTrainingExamplesBulkDelete,
2695
+ postUserProfiles,
2696
+ postUsersAuthConfirm,
2697
+ postUsersAuthLogin,
2698
+ postUsersAuthMagicLinkLogin,
2699
+ postUsersAuthMagicLinkRequest,
2700
+ postUsersAuthRegister,
2701
+ postUsersAuthRegisterWithOidc,
2702
+ postUsersRegisterIsv,
2703
+ postWebhookConfigs,
2704
+ postWebhookConfigsByIdTest,
2705
+ postWebhookDeliveriesByIdRetry,
2706
+ postWorkspaceMemberships,
2707
+ postWorkspaces,
2411
2708
  retryWithBackoff,
2412
- role,
2413
2709
  sleep,
2414
- status,
2415
- status2,
2416
2710
  streamMessage,
2417
2711
  streamSSE,
2418
- type,
2419
2712
  withRetry
2420
2713
  };