@gpt-core/client 1.0.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.
package/dist/index.js ADDED
@@ -0,0 +1,2064 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
21
+
22
+ // src/index.ts
23
+ var index_exports = {};
24
+ __export(index_exports, {
25
+ GptClient: () => GptClient,
26
+ eq: () => eq,
27
+ eq2: () => eq2,
28
+ eq3: () => eq3,
29
+ eq4: () => eq4,
30
+ eq5: () => eq5,
31
+ eq6: () => eq6,
32
+ eq7: () => eq7,
33
+ eq8: () => eq8,
34
+ format: () => format,
35
+ greater_than: () => greater_than,
36
+ greater_than2: () => greater_than2,
37
+ greater_than3: () => greater_than3,
38
+ greater_than4: () => greater_than4,
39
+ greater_than5: () => greater_than5,
40
+ greater_than6: () => greater_than6,
41
+ greater_than7: () => greater_than7,
42
+ greater_than8: () => greater_than8,
43
+ greater_than_or_equal: () => greater_than_or_equal,
44
+ greater_than_or_equal2: () => greater_than_or_equal2,
45
+ greater_than_or_equal3: () => greater_than_or_equal3,
46
+ greater_than_or_equal4: () => greater_than_or_equal4,
47
+ greater_than_or_equal5: () => greater_than_or_equal5,
48
+ greater_than_or_equal6: () => greater_than_or_equal6,
49
+ greater_than_or_equal7: () => greater_than_or_equal7,
50
+ greater_than_or_equal8: () => greater_than_or_equal8,
51
+ less_than: () => less_than,
52
+ less_than2: () => less_than2,
53
+ less_than3: () => less_than3,
54
+ less_than4: () => less_than4,
55
+ less_than5: () => less_than5,
56
+ less_than6: () => less_than6,
57
+ less_than7: () => less_than7,
58
+ less_than8: () => less_than8,
59
+ less_than_or_equal: () => less_than_or_equal,
60
+ less_than_or_equal2: () => less_than_or_equal2,
61
+ less_than_or_equal3: () => less_than_or_equal3,
62
+ less_than_or_equal4: () => less_than_or_equal4,
63
+ less_than_or_equal5: () => less_than_or_equal5,
64
+ less_than_or_equal6: () => less_than_or_equal6,
65
+ less_than_or_equal7: () => less_than_or_equal7,
66
+ less_than_or_equal8: () => less_than_or_equal8,
67
+ not_eq: () => not_eq,
68
+ not_eq2: () => not_eq2,
69
+ not_eq3: () => not_eq3,
70
+ not_eq4: () => not_eq4,
71
+ not_eq5: () => not_eq5,
72
+ not_eq6: () => not_eq6,
73
+ not_eq7: () => not_eq7,
74
+ not_eq8: () => not_eq8,
75
+ role: () => role,
76
+ status: () => status,
77
+ status2: () => status2,
78
+ type: () => type
79
+ });
80
+ module.exports = __toCommonJS(index_exports);
81
+
82
+ // ../../node_modules/@hey-api/client-fetch/dist/index.js
83
+ var A = async (s, r) => {
84
+ let e = typeof r == "function" ? await r(s) : r;
85
+ if (e) return s.scheme === "bearer" ? `Bearer ${e}` : s.scheme === "basic" ? `Basic ${btoa(e)}` : e;
86
+ };
87
+ var O = { bodySerializer: (s) => JSON.stringify(s, (r, e) => typeof e == "bigint" ? e.toString() : e) };
88
+ var U = { $body_: "body", $headers_: "headers", $path_: "path", $query_: "query" };
89
+ var D = Object.entries(U);
90
+ var B = (s) => {
91
+ switch (s) {
92
+ case "label":
93
+ return ".";
94
+ case "matrix":
95
+ return ";";
96
+ case "simple":
97
+ return ",";
98
+ default:
99
+ return "&";
100
+ }
101
+ };
102
+ var N = (s) => {
103
+ switch (s) {
104
+ case "form":
105
+ return ",";
106
+ case "pipeDelimited":
107
+ return "|";
108
+ case "spaceDelimited":
109
+ return "%20";
110
+ default:
111
+ return ",";
112
+ }
113
+ };
114
+ var Q = (s) => {
115
+ switch (s) {
116
+ case "label":
117
+ return ".";
118
+ case "matrix":
119
+ return ";";
120
+ case "simple":
121
+ return ",";
122
+ default:
123
+ return "&";
124
+ }
125
+ };
126
+ var S = ({ allowReserved: s, explode: r, name: e, style: a, value: i }) => {
127
+ if (!r) {
128
+ let t = (s ? i : i.map((l) => encodeURIComponent(l))).join(N(a));
129
+ switch (a) {
130
+ case "label":
131
+ return `.${t}`;
132
+ case "matrix":
133
+ return `;${e}=${t}`;
134
+ case "simple":
135
+ return t;
136
+ default:
137
+ return `${e}=${t}`;
138
+ }
139
+ }
140
+ 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);
141
+ return a === "label" || a === "matrix" ? o + n : n;
142
+ };
143
+ var m = ({ allowReserved: s, name: r, value: e }) => {
144
+ if (e == null) return "";
145
+ if (typeof e == "object") throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");
146
+ return `${r}=${s ? e : encodeURIComponent(e)}`;
147
+ };
148
+ var q = ({ allowReserved: s, explode: r, name: e, style: a, value: i, valueOnly: o }) => {
149
+ if (i instanceof Date) return o ? i.toISOString() : `${e}=${i.toISOString()}`;
150
+ if (a !== "deepObject" && !r) {
151
+ let l = [];
152
+ Object.entries(i).forEach(([p, d]) => {
153
+ l = [...l, p, s ? d : encodeURIComponent(d)];
154
+ });
155
+ let u = l.join(",");
156
+ switch (a) {
157
+ case "form":
158
+ return `${e}=${u}`;
159
+ case "label":
160
+ return `.${u}`;
161
+ case "matrix":
162
+ return `;${e}=${u}`;
163
+ default:
164
+ return u;
165
+ }
166
+ }
167
+ let n = Q(a), t = Object.entries(i).map(([l, u]) => m({ allowReserved: s, name: a === "deepObject" ? `${e}[${l}]` : l, value: u })).join(n);
168
+ return a === "label" || a === "matrix" ? n + t : t;
169
+ };
170
+ var J = /\{[^{}]+\}/g;
171
+ var M = ({ path: s, url: r }) => {
172
+ let e = r, a = r.match(J);
173
+ if (a) for (let i of a) {
174
+ let o = false, n = i.substring(1, i.length - 1), t = "simple";
175
+ 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");
176
+ let l = s[n];
177
+ if (l == null) continue;
178
+ if (Array.isArray(l)) {
179
+ e = e.replace(i, S({ explode: o, name: n, style: t, value: l }));
180
+ continue;
181
+ }
182
+ if (typeof l == "object") {
183
+ e = e.replace(i, q({ explode: o, name: n, style: t, value: l, valueOnly: true }));
184
+ continue;
185
+ }
186
+ if (t === "matrix") {
187
+ e = e.replace(i, `;${m({ name: n, value: l })}`);
188
+ continue;
189
+ }
190
+ let u = encodeURIComponent(t === "label" ? `.${l}` : l);
191
+ e = e.replace(i, u);
192
+ }
193
+ return e;
194
+ };
195
+ var k = ({ allowReserved: s, array: r, object: e } = {}) => (i) => {
196
+ let o = [];
197
+ if (i && typeof i == "object") for (let n in i) {
198
+ let t = i[n];
199
+ if (t != null) if (Array.isArray(t)) {
200
+ let l = S({ allowReserved: s, explode: true, name: n, style: "form", value: t, ...r });
201
+ l && o.push(l);
202
+ } else if (typeof t == "object") {
203
+ let l = q({ allowReserved: s, explode: true, name: n, style: "deepObject", value: t, ...e });
204
+ l && o.push(l);
205
+ } else {
206
+ let l = m({ allowReserved: s, name: n, value: t });
207
+ l && o.push(l);
208
+ }
209
+ }
210
+ return o.join("&");
211
+ };
212
+ var E = (s) => {
213
+ if (!s) return "stream";
214
+ let r = s.split(";")[0]?.trim();
215
+ if (r) {
216
+ if (r.startsWith("application/json") || r.endsWith("+json")) return "json";
217
+ if (r === "multipart/form-data") return "formData";
218
+ if (["application/", "audio/", "image/", "video/"].some((e) => r.startsWith(e))) return "blob";
219
+ if (r.startsWith("text/")) return "text";
220
+ }
221
+ };
222
+ var $ = async ({ security: s, ...r }) => {
223
+ for (let e of s) {
224
+ let a = await A(e, r.auth);
225
+ if (!a) continue;
226
+ let i = e.name ?? "Authorization";
227
+ switch (e.in) {
228
+ case "query":
229
+ r.query || (r.query = {}), r.query[i] = a;
230
+ break;
231
+ case "cookie":
232
+ r.headers.append("Cookie", `${i}=${a}`);
233
+ break;
234
+ case "header":
235
+ default:
236
+ r.headers.set(i, a);
237
+ break;
238
+ }
239
+ return;
240
+ }
241
+ };
242
+ 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 });
243
+ var L = ({ baseUrl: s, path: r, query: e, querySerializer: a, url: i }) => {
244
+ let o = i.startsWith("/") ? i : `/${i}`, n = (s ?? "") + o;
245
+ r && (n = M({ path: r, url: n }));
246
+ let t = e ? a(e) : "";
247
+ return t.startsWith("?") && (t = t.substring(1)), t && (n += `?${t}`), n;
248
+ };
249
+ var x = (s, r) => {
250
+ let e = { ...s, ...r };
251
+ return e.baseUrl?.endsWith("/") && (e.baseUrl = e.baseUrl.substring(0, e.baseUrl.length - 1)), e.headers = j(s.headers, r.headers), e;
252
+ };
253
+ var j = (...s) => {
254
+ let r = new Headers();
255
+ for (let e of s) {
256
+ if (!e || typeof e != "object") continue;
257
+ let a = e instanceof Headers ? e.entries() : Object.entries(e);
258
+ for (let [i, o] of a) if (o === null) r.delete(i);
259
+ else if (Array.isArray(o)) for (let n of o) r.append(i, n);
260
+ else o !== void 0 && r.set(i, typeof o == "object" ? JSON.stringify(o) : o);
261
+ }
262
+ return r;
263
+ };
264
+ var g = class {
265
+ constructor() {
266
+ __publicField(this, "_fns");
267
+ this._fns = [];
268
+ }
269
+ clear() {
270
+ this._fns = [];
271
+ }
272
+ getInterceptorIndex(r) {
273
+ return typeof r == "number" ? this._fns[r] ? r : -1 : this._fns.indexOf(r);
274
+ }
275
+ exists(r) {
276
+ let e = this.getInterceptorIndex(r);
277
+ return !!this._fns[e];
278
+ }
279
+ eject(r) {
280
+ let e = this.getInterceptorIndex(r);
281
+ this._fns[e] && (this._fns[e] = null);
282
+ }
283
+ update(r, e) {
284
+ let a = this.getInterceptorIndex(r);
285
+ return this._fns[a] ? (this._fns[a] = e, r) : false;
286
+ }
287
+ use(r) {
288
+ return this._fns = [...this._fns, r], this._fns.length - 1;
289
+ }
290
+ };
291
+ var v = () => ({ error: new g(), request: new g(), response: new g() });
292
+ var V = k({ allowReserved: false, array: { explode: true, style: "form" }, object: { explode: true, style: "deepObject" } });
293
+ var F = { "Content-Type": "application/json" };
294
+ var w = (s = {}) => ({ ...O, headers: F, parseAs: "auto", querySerializer: V, ...s });
295
+ var G = (s = {}) => {
296
+ let r = x(w(), s), e = () => ({ ...r }), a = (n) => (r = x(r, n), e()), i = v(), o = async (n) => {
297
+ let t = { ...r, ...n, fetch: n.fetch ?? r.fetch ?? globalThis.fetch, headers: j(r.headers, n.headers) };
298
+ 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");
299
+ let l = C(t), u = { redirect: "follow", ...t }, p = new Request(l, u);
300
+ for (let f of i.request._fns) f && (p = await f(p, t));
301
+ let d = t.fetch, c = await d(p);
302
+ for (let f of i.response._fns) f && (c = await f(c, p, t));
303
+ let b = { request: p, response: c };
304
+ if (c.ok) {
305
+ if (c.status === 204 || c.headers.get("Content-Length") === "0") return t.responseStyle === "data" ? {} : { data: {}, ...b };
306
+ let f = (t.parseAs === "auto" ? E(c.headers.get("Content-Type")) : t.parseAs) ?? "json";
307
+ if (f === "stream") return t.responseStyle === "data" ? c.body : { data: c.body, ...b };
308
+ let h = await c[f]();
309
+ return f === "json" && (t.responseValidator && await t.responseValidator(h), t.responseTransformer && (h = await t.responseTransformer(h))), t.responseStyle === "data" ? h : { data: h, ...b };
310
+ }
311
+ let R = await c.text();
312
+ try {
313
+ R = JSON.parse(R);
314
+ } catch {
315
+ }
316
+ let y = R;
317
+ for (let f of i.error._fns) f && (y = await f(R, c, p, t));
318
+ if (y = y || {}, t.throwOnError) throw y;
319
+ return t.responseStyle === "data" ? void 0 : { error: y, ...b };
320
+ };
321
+ 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" }) };
322
+ };
323
+
324
+ // src/_internal/services.gen.ts
325
+ var client = G(w());
326
+ var SearchService = class {
327
+ /**
328
+ * /ai/search/advanced operation on search resource
329
+ */
330
+ static postAiSearchAdvanced(options) {
331
+ return (options?.client ?? client).post({
332
+ ...options,
333
+ url: "/ai/search/advanced"
334
+ });
335
+ }
336
+ /**
337
+ * /search/indexes operation on search resource
338
+ */
339
+ static getSearchIndexes(options) {
340
+ return (options?.client ?? client).get({
341
+ ...options,
342
+ url: "/search/indexes"
343
+ });
344
+ }
345
+ /**
346
+ * /search operation on search resource
347
+ */
348
+ static getSearch(options) {
349
+ return (options?.client ?? client).get({
350
+ ...options,
351
+ url: "/search"
352
+ });
353
+ }
354
+ /**
355
+ * /search/semantic operation on search resource
356
+ */
357
+ static getSearchSemantic(options) {
358
+ return (options?.client ?? client).get({
359
+ ...options,
360
+ url: "/search/semantic"
361
+ });
362
+ }
363
+ /**
364
+ * /ai/search operation on search resource
365
+ */
366
+ static postAiSearch(options) {
367
+ return (options?.client ?? client).post({
368
+ ...options,
369
+ url: "/ai/search"
370
+ });
371
+ }
372
+ /**
373
+ * /search/health operation on search resource
374
+ */
375
+ static getSearchHealth(options) {
376
+ return (options?.client ?? client).get({
377
+ ...options,
378
+ url: "/search/health"
379
+ });
380
+ }
381
+ /**
382
+ * /search/status operation on search resource
383
+ */
384
+ static getSearchStatus(options) {
385
+ return (options?.client ?? client).get({
386
+ ...options,
387
+ url: "/search/status"
388
+ });
389
+ }
390
+ /**
391
+ * /search/reindex operation on search resource
392
+ */
393
+ static postSearchReindex(options) {
394
+ return (options?.client ?? client).post({
395
+ ...options,
396
+ url: "/search/reindex"
397
+ });
398
+ }
399
+ /**
400
+ * /search/stats operation on search resource
401
+ */
402
+ static getSearchStats(options) {
403
+ return (options?.client ?? client).get({
404
+ ...options,
405
+ url: "/search/stats"
406
+ });
407
+ }
408
+ };
409
+ var ThreadService = class {
410
+ /**
411
+ * /threads operation on thread resource
412
+ */
413
+ static getThreads(options) {
414
+ return (options?.client ?? client).get({
415
+ ...options,
416
+ url: "/threads"
417
+ });
418
+ }
419
+ /**
420
+ * /threads operation on thread resource
421
+ */
422
+ static postThreads(options) {
423
+ return (options?.client ?? client).post({
424
+ ...options,
425
+ url: "/threads"
426
+ });
427
+ }
428
+ /**
429
+ * /threads/active operation on thread resource
430
+ */
431
+ static postThreadsActive(options) {
432
+ return (options?.client ?? client).post({
433
+ ...options,
434
+ url: "/threads/active"
435
+ });
436
+ }
437
+ /**
438
+ * /threads/:id/messages operation on thread resource
439
+ */
440
+ static postThreadsByIdMessages(options) {
441
+ return (options?.client ?? client).post({
442
+ ...options,
443
+ url: "/threads/{id}/messages"
444
+ });
445
+ }
446
+ /**
447
+ * /threads/:id operation on thread resource
448
+ */
449
+ static deleteThreadsById(options) {
450
+ return (options?.client ?? client).delete({
451
+ ...options,
452
+ url: "/threads/{id}"
453
+ });
454
+ }
455
+ /**
456
+ * /threads/:id operation on thread resource
457
+ */
458
+ static getThreadsById(options) {
459
+ return (options?.client ?? client).get({
460
+ ...options,
461
+ url: "/threads/{id}"
462
+ });
463
+ }
464
+ /**
465
+ * /threads/:id operation on thread resource
466
+ */
467
+ static patchThreadsById(options) {
468
+ return (options?.client ?? client).patch({
469
+ ...options,
470
+ url: "/threads/{id}"
471
+ });
472
+ }
473
+ /**
474
+ * /threads/search operation on thread resource
475
+ */
476
+ static getThreadsSearch(options) {
477
+ return (options?.client ?? client).get({
478
+ ...options,
479
+ url: "/threads/search"
480
+ });
481
+ }
482
+ /**
483
+ * /threads/:id/summarize operation on thread resource
484
+ */
485
+ static postThreadsByIdSummarize(options) {
486
+ return (options?.client ?? client).post({
487
+ ...options,
488
+ url: "/threads/{id}/summarize"
489
+ });
490
+ }
491
+ };
492
+ var ExtractionResultService = class {
493
+ /**
494
+ * /extraction_results/:id operation on extraction_result resource
495
+ */
496
+ static deleteExtractionResultsById(options) {
497
+ return (options?.client ?? client).delete({
498
+ ...options,
499
+ url: "/extraction_results/{id}"
500
+ });
501
+ }
502
+ /**
503
+ * /extraction_results/:id operation on extraction_result resource
504
+ */
505
+ static getExtractionResultsById(options) {
506
+ return (options?.client ?? client).get({
507
+ ...options,
508
+ url: "/extraction_results/{id}"
509
+ });
510
+ }
511
+ /**
512
+ * /extraction_results/:id operation on extraction_result resource
513
+ */
514
+ static patchExtractionResultsById(options) {
515
+ return (options?.client ?? client).patch({
516
+ ...options,
517
+ url: "/extraction_results/{id}"
518
+ });
519
+ }
520
+ /**
521
+ * /extraction_results operation on extraction_result resource
522
+ */
523
+ static getExtractionResults(options) {
524
+ return (options?.client ?? client).get({
525
+ ...options,
526
+ url: "/extraction_results"
527
+ });
528
+ }
529
+ /**
530
+ * /documents/:id/extraction_results operation on extraction_result resource
531
+ */
532
+ static getDocumentsByIdExtractionResults(options) {
533
+ return (options?.client ?? client).get({
534
+ ...options,
535
+ url: "/documents/{id}/extraction_results"
536
+ });
537
+ }
538
+ };
539
+ var WorkspaceService = class {
540
+ /**
541
+ * /workspaces operation on workspace resource
542
+ */
543
+ static getWorkspaces(options) {
544
+ return (options?.client ?? client).get({
545
+ ...options,
546
+ url: "/workspaces"
547
+ });
548
+ }
549
+ /**
550
+ * /workspaces operation on workspace resource
551
+ */
552
+ static postWorkspaces(options) {
553
+ return (options?.client ?? client).post({
554
+ ...options,
555
+ url: "/workspaces"
556
+ });
557
+ }
558
+ /**
559
+ * /workspaces/:id/allocate operation on workspace resource
560
+ */
561
+ static patchWorkspacesByIdAllocate(options) {
562
+ return (options?.client ?? client).patch({
563
+ ...options,
564
+ url: "/workspaces/{id}/allocate"
565
+ });
566
+ }
567
+ /**
568
+ * /workspaces/:id operation on workspace resource
569
+ */
570
+ static deleteWorkspacesById(options) {
571
+ return (options?.client ?? client).delete({
572
+ ...options,
573
+ url: "/workspaces/{id}"
574
+ });
575
+ }
576
+ /**
577
+ * /workspaces/:id operation on workspace resource
578
+ */
579
+ static getWorkspacesById(options) {
580
+ return (options?.client ?? client).get({
581
+ ...options,
582
+ url: "/workspaces/{id}"
583
+ });
584
+ }
585
+ /**
586
+ * /workspaces/:id operation on workspace resource
587
+ */
588
+ static patchWorkspacesById(options) {
589
+ return (options?.client ?? client).patch({
590
+ ...options,
591
+ url: "/workspaces/{id}"
592
+ });
593
+ }
594
+ /**
595
+ * /workspaces/mine operation on workspace resource
596
+ */
597
+ static getWorkspacesMine(options) {
598
+ return (options?.client ?? client).get({
599
+ ...options,
600
+ url: "/workspaces/mine"
601
+ });
602
+ }
603
+ };
604
+ var ApiKeyService = class {
605
+ /**
606
+ * /api_keys/:id/revoke operation on api_key resource
607
+ */
608
+ static patchApiKeysByIdRevoke(options) {
609
+ return (options?.client ?? client).patch({
610
+ ...options,
611
+ url: "/api_keys/{id}/revoke"
612
+ });
613
+ }
614
+ /**
615
+ * /api_keys operation on api_key resource
616
+ */
617
+ static getApiKeys(options) {
618
+ return (options?.client ?? client).get({
619
+ ...options,
620
+ url: "/api_keys"
621
+ });
622
+ }
623
+ /**
624
+ * /api_keys operation on api_key resource
625
+ */
626
+ static postApiKeys(options) {
627
+ return (options?.client ?? client).post({
628
+ ...options,
629
+ url: "/api_keys"
630
+ });
631
+ }
632
+ /**
633
+ * /api_keys/:id operation on api_key resource
634
+ */
635
+ static deleteApiKeysById(options) {
636
+ return (options?.client ?? client).delete({
637
+ ...options,
638
+ url: "/api_keys/{id}"
639
+ });
640
+ }
641
+ /**
642
+ * /api_keys/:id operation on api_key resource
643
+ */
644
+ static getApiKeysById(options) {
645
+ return (options?.client ?? client).get({
646
+ ...options,
647
+ url: "/api_keys/{id}"
648
+ });
649
+ }
650
+ /**
651
+ * /api_keys/:id operation on api_key resource
652
+ */
653
+ static patchApiKeysById(options) {
654
+ return (options?.client ?? client).patch({
655
+ ...options,
656
+ url: "/api_keys/{id}"
657
+ });
658
+ }
659
+ /**
660
+ * Allocate credits to the account associated with this API Key
661
+ */
662
+ static patchApiKeysByIdAllocate(options) {
663
+ return (options?.client ?? client).patch({
664
+ ...options,
665
+ url: "/api_keys/{id}/allocate"
666
+ });
667
+ }
668
+ /**
669
+ * /api_keys/:id/rotate operation on api_key resource
670
+ */
671
+ static patchApiKeysByIdRotate(options) {
672
+ return (options?.client ?? client).patch({
673
+ ...options,
674
+ url: "/api_keys/{id}/rotate"
675
+ });
676
+ }
677
+ };
678
+ var InvitationService = class {
679
+ /**
680
+ * /invitations/consume/:token operation on invitation resource
681
+ */
682
+ static getInvitationsConsumeByToken(options) {
683
+ return (options?.client ?? client).get({
684
+ ...options,
685
+ url: "/invitations/consume/{token}"
686
+ });
687
+ }
688
+ /**
689
+ * /invitations/:id/revoke operation on invitation resource
690
+ */
691
+ static patchInvitationsByIdRevoke(options) {
692
+ return (options?.client ?? client).patch({
693
+ ...options,
694
+ url: "/invitations/{id}/revoke"
695
+ });
696
+ }
697
+ /**
698
+ * /invitations/:id/resend operation on invitation resource
699
+ */
700
+ static patchInvitationsByIdResend(options) {
701
+ return (options?.client ?? client).patch({
702
+ ...options,
703
+ url: "/invitations/{id}/resend"
704
+ });
705
+ }
706
+ /**
707
+ * /invitations/invite operation on invitation resource
708
+ */
709
+ static postInvitationsInvite(options) {
710
+ return (options?.client ?? client).post({
711
+ ...options,
712
+ url: "/invitations/invite"
713
+ });
714
+ }
715
+ /**
716
+ * Accept an invitation using only the token
717
+ */
718
+ static postInvitationsAcceptByToken(options) {
719
+ return (options?.client ?? client).post({
720
+ ...options,
721
+ url: "/invitations/accept_by_token"
722
+ });
723
+ }
724
+ /**
725
+ * /invitations/:id/accept operation on invitation resource
726
+ */
727
+ static patchInvitationsByIdAccept(options) {
728
+ return (options?.client ?? client).patch({
729
+ ...options,
730
+ url: "/invitations/{id}/accept"
731
+ });
732
+ }
733
+ /**
734
+ * /invitations operation on invitation resource
735
+ */
736
+ static getInvitations(options) {
737
+ return (options?.client ?? client).get({
738
+ ...options,
739
+ url: "/invitations"
740
+ });
741
+ }
742
+ };
743
+ var UserService = class {
744
+ /**
745
+ * Reset password using admin-issued reset token
746
+ */
747
+ static patchUsersAuthResetPassword(options) {
748
+ return (options?.client ?? client).patch({
749
+ ...options,
750
+ url: "/users/auth/reset-password"
751
+ });
752
+ }
753
+ /**
754
+ * /users/:id operation on user resource
755
+ */
756
+ static getUsersById(options) {
757
+ return (options?.client ?? client).get({
758
+ ...options,
759
+ url: "/users/{id}"
760
+ });
761
+ }
762
+ /**
763
+ * Admin-only user management (platform admins) - promotes/demotes admin status
764
+ */
765
+ static patchUsersById(options) {
766
+ return (options?.client ?? client).patch({
767
+ ...options,
768
+ url: "/users/{id}"
769
+ });
770
+ }
771
+ /**
772
+ * Get the currently authenticated user
773
+ */
774
+ static getUsersMe(options) {
775
+ return (options?.client ?? client).get({
776
+ ...options,
777
+ url: "/users/me"
778
+ });
779
+ }
780
+ /**
781
+ * /users/auth/register_with_oidc operation on user resource
782
+ */
783
+ static postUsersAuthRegisterWithOidc(options) {
784
+ return (options?.client ?? client).post({
785
+ ...options,
786
+ url: "/users/auth/register_with_oidc"
787
+ });
788
+ }
789
+ /**
790
+ * Admin triggers password reset email for user
791
+ */
792
+ static patchUsersByIdResetPassword(options) {
793
+ return (options?.client ?? client).patch({
794
+ ...options,
795
+ url: "/users/{id}/reset-password"
796
+ });
797
+ }
798
+ /**
799
+ * /users/auth/magic_link/login operation on user resource
800
+ */
801
+ static postUsersAuthMagicLinkLogin(options) {
802
+ return (options?.client ?? client).post({
803
+ ...options,
804
+ url: "/users/auth/magic_link/login"
805
+ });
806
+ }
807
+ /**
808
+ * Admin manually confirms user's email
809
+ */
810
+ static patchUsersByIdConfirmEmail(options) {
811
+ return (options?.client ?? client).patch({
812
+ ...options,
813
+ url: "/users/{id}/confirm-email"
814
+ });
815
+ }
816
+ /**
817
+ * Attempt to sign in using a username and password.
818
+ */
819
+ static postUsersAuthLogin(options) {
820
+ return (options?.client ?? client).post({
821
+ ...options,
822
+ url: "/users/auth/login"
823
+ });
824
+ }
825
+ /**
826
+ * /users/auth/confirm operation on user resource
827
+ */
828
+ static postUsersAuthConfirm(options) {
829
+ return (options?.client ?? client).post({
830
+ ...options,
831
+ url: "/users/auth/confirm"
832
+ });
833
+ }
834
+ /**
835
+ * /users/auth/magic_link/request operation on user resource
836
+ */
837
+ static postUsersAuthMagicLinkRequest(options) {
838
+ return (options?.client ?? client).post({
839
+ ...options,
840
+ url: "/users/auth/magic_link/request"
841
+ });
842
+ }
843
+ /**
844
+ * /users/auth/register operation on user resource
845
+ */
846
+ static postUsersAuthRegister(options) {
847
+ return (options?.client ?? client).post({
848
+ ...options,
849
+ url: "/users/auth/register"
850
+ });
851
+ }
852
+ /**
853
+ * Platform Admin action to register a new ISV (User + Tenant + App)
854
+ */
855
+ static postUsersRegisterIsv(options) {
856
+ return (options?.client ?? client).post({
857
+ ...options,
858
+ url: "/users/register_isv"
859
+ });
860
+ }
861
+ /**
862
+ * /users operation on user resource
863
+ */
864
+ static getUsers(options) {
865
+ return (options?.client ?? client).get({
866
+ ...options,
867
+ url: "/users"
868
+ });
869
+ }
870
+ };
871
+ var BucketService = class {
872
+ /**
873
+ * /buckets/:id/stats operation on bucket resource
874
+ */
875
+ static getBucketsByIdStats(options) {
876
+ return (options?.client ?? client).get({
877
+ ...options,
878
+ url: "/buckets/{id}/stats"
879
+ });
880
+ }
881
+ /**
882
+ * /buckets operation on bucket resource
883
+ */
884
+ static getBuckets(options) {
885
+ return (options?.client ?? client).get({
886
+ ...options,
887
+ url: "/buckets"
888
+ });
889
+ }
890
+ /**
891
+ * /buckets operation on bucket resource
892
+ */
893
+ static postBuckets(options) {
894
+ return (options?.client ?? client).post({
895
+ ...options,
896
+ url: "/buckets"
897
+ });
898
+ }
899
+ /**
900
+ * /buckets/:id operation on bucket resource
901
+ */
902
+ static deleteBucketsById(options) {
903
+ return (options?.client ?? client).delete({
904
+ ...options,
905
+ url: "/buckets/{id}"
906
+ });
907
+ }
908
+ /**
909
+ * /buckets/:id operation on bucket resource
910
+ */
911
+ static getBucketsById(options) {
912
+ return (options?.client ?? client).get({
913
+ ...options,
914
+ url: "/buckets/{id}"
915
+ });
916
+ }
917
+ /**
918
+ * /buckets/:id operation on bucket resource
919
+ */
920
+ static patchBucketsById(options) {
921
+ return (options?.client ?? client).patch({
922
+ ...options,
923
+ url: "/buckets/{id}"
924
+ });
925
+ }
926
+ };
927
+ var DocumentService = class {
928
+ /**
929
+ * /documents/search operation on document resource
930
+ */
931
+ static getDocumentsSearch(options) {
932
+ return (options?.client ?? client).get({
933
+ ...options,
934
+ url: "/documents/search"
935
+ });
936
+ }
937
+ /**
938
+ * /documents operation on document resource
939
+ */
940
+ static getDocuments(options) {
941
+ return (options?.client ?? client).get({
942
+ ...options,
943
+ url: "/documents"
944
+ });
945
+ }
946
+ /**
947
+ * /documents operation on document resource
948
+ */
949
+ static postDocuments(options) {
950
+ return (options?.client ?? client).post({
951
+ ...options,
952
+ url: "/documents"
953
+ });
954
+ }
955
+ /**
956
+ * /documents/:id operation on document resource
957
+ */
958
+ static deleteDocumentsById(options) {
959
+ return (options?.client ?? client).delete({
960
+ ...options,
961
+ url: "/documents/{id}"
962
+ });
963
+ }
964
+ /**
965
+ * /documents/:id operation on document resource
966
+ */
967
+ static getDocumentsById(options) {
968
+ return (options?.client ?? client).get({
969
+ ...options,
970
+ url: "/documents/{id}"
971
+ });
972
+ }
973
+ /**
974
+ * /documents/:id operation on document resource
975
+ */
976
+ static patchDocumentsById(options) {
977
+ return (options?.client ?? client).patch({
978
+ ...options,
979
+ url: "/documents/{id}"
980
+ });
981
+ }
982
+ /**
983
+ * /documents/:id/analyze operation on document resource
984
+ */
985
+ static postDocumentsByIdAnalyze(options) {
986
+ return (options?.client ?? client).post({
987
+ ...options,
988
+ url: "/documents/{id}/analyze"
989
+ });
990
+ }
991
+ /**
992
+ * /documents/:id/reprocess operation on document resource
993
+ */
994
+ static postDocumentsByIdReprocess(options) {
995
+ return (options?.client ?? client).post({
996
+ ...options,
997
+ url: "/documents/{id}/reprocess"
998
+ });
999
+ }
1000
+ /**
1001
+ * /documents/bulk_reprocess operation on document resource
1002
+ */
1003
+ static postDocumentsBulkReprocess(options) {
1004
+ return (options?.client ?? client).post({
1005
+ ...options,
1006
+ url: "/documents/bulk_reprocess"
1007
+ });
1008
+ }
1009
+ /**
1010
+ * Export documents (placeholder - returns mock url)
1011
+ */
1012
+ static postDocumentsExport(options) {
1013
+ return (options?.client ?? client).post({
1014
+ ...options,
1015
+ url: "/documents/export"
1016
+ });
1017
+ }
1018
+ /**
1019
+ * Import documents from external URL
1020
+ */
1021
+ static postDocumentsImport(options) {
1022
+ return (options?.client ?? client).post({
1023
+ ...options,
1024
+ url: "/documents/import"
1025
+ });
1026
+ }
1027
+ /**
1028
+ * Returns documents with pending or processing status
1029
+ */
1030
+ static getDocumentsProcessingQueue(options) {
1031
+ return (options?.client ?? client).get({
1032
+ ...options,
1033
+ url: "/documents/processing_queue"
1034
+ });
1035
+ }
1036
+ };
1037
+ var UserProfileService = class {
1038
+ /**
1039
+ * Get the current user's profile
1040
+ */
1041
+ static getUserProfilesMe(options) {
1042
+ return (options?.client ?? client).get({
1043
+ ...options,
1044
+ url: "/user_profiles/me"
1045
+ });
1046
+ }
1047
+ /**
1048
+ * /user_profiles operation on user_profile resource
1049
+ */
1050
+ static getUserProfiles(options) {
1051
+ return (options?.client ?? client).get({
1052
+ ...options,
1053
+ url: "/user_profiles"
1054
+ });
1055
+ }
1056
+ /**
1057
+ * /user_profiles operation on user_profile resource
1058
+ */
1059
+ static postUserProfiles(options) {
1060
+ return (options?.client ?? client).post({
1061
+ ...options,
1062
+ url: "/user_profiles"
1063
+ });
1064
+ }
1065
+ /**
1066
+ * /user_profiles/:id operation on user_profile resource
1067
+ */
1068
+ static deleteUserProfilesById(options) {
1069
+ return (options?.client ?? client).delete({
1070
+ ...options,
1071
+ url: "/user_profiles/{id}"
1072
+ });
1073
+ }
1074
+ /**
1075
+ * /user_profiles/:id operation on user_profile resource
1076
+ */
1077
+ static getUserProfilesById(options) {
1078
+ return (options?.client ?? client).get({
1079
+ ...options,
1080
+ url: "/user_profiles/{id}"
1081
+ });
1082
+ }
1083
+ /**
1084
+ * /user_profiles/:id operation on user_profile resource
1085
+ */
1086
+ static patchUserProfilesById(options) {
1087
+ return (options?.client ?? client).patch({
1088
+ ...options,
1089
+ url: "/user_profiles/{id}"
1090
+ });
1091
+ }
1092
+ };
1093
+ var AgentService = class {
1094
+ /**
1095
+ * Validate sample output against agent schema
1096
+ */
1097
+ static postAgentsByIdValidate(options) {
1098
+ return (options?.client ?? client).post({
1099
+ ...options,
1100
+ url: "/agents/{id}/validate"
1101
+ });
1102
+ }
1103
+ /**
1104
+ * /agents/:id operation on agent resource
1105
+ */
1106
+ static deleteAgentsById(options) {
1107
+ return (options?.client ?? client).delete({
1108
+ ...options,
1109
+ url: "/agents/{id}"
1110
+ });
1111
+ }
1112
+ /**
1113
+ * /agents/:id operation on agent resource
1114
+ */
1115
+ static getAgentsById(options) {
1116
+ return (options?.client ?? client).get({
1117
+ ...options,
1118
+ url: "/agents/{id}"
1119
+ });
1120
+ }
1121
+ /**
1122
+ * /agents/:id operation on agent resource
1123
+ */
1124
+ static patchAgentsById(options) {
1125
+ return (options?.client ?? client).patch({
1126
+ ...options,
1127
+ url: "/agents/{id}"
1128
+ });
1129
+ }
1130
+ /**
1131
+ * Run the agent against sample input
1132
+ */
1133
+ static postAgentsByIdTest(options) {
1134
+ return (options?.client ?? client).post({
1135
+ ...options,
1136
+ url: "/agents/{id}/test"
1137
+ });
1138
+ }
1139
+ /**
1140
+ * Clone the agent to a new one with a new name
1141
+ */
1142
+ static postAgentsByIdClone(options) {
1143
+ return (options?.client ?? client).post({
1144
+ ...options,
1145
+ url: "/agents/{id}/clone"
1146
+ });
1147
+ }
1148
+ /**
1149
+ * /agents operation on agent resource
1150
+ */
1151
+ static getAgents(options) {
1152
+ return (options?.client ?? client).get({
1153
+ ...options,
1154
+ url: "/agents"
1155
+ });
1156
+ }
1157
+ /**
1158
+ * /agents operation on agent resource
1159
+ */
1160
+ static postAgents(options) {
1161
+ return (options?.client ?? client).post({
1162
+ ...options,
1163
+ url: "/agents"
1164
+ });
1165
+ }
1166
+ };
1167
+ var PresignedUrlService = class {
1168
+ /**
1169
+ * /storage/sign_download operation on presigned_url resource
1170
+ */
1171
+ static postStorageSignDownload(options) {
1172
+ return (options?.client ?? client).post({
1173
+ ...options,
1174
+ url: "/storage/sign_download"
1175
+ });
1176
+ }
1177
+ /**
1178
+ * /documents/presigned_upload operation on presigned_url resource
1179
+ */
1180
+ static postDocumentsPresignedUpload(options) {
1181
+ return (options?.client ?? client).post({
1182
+ ...options,
1183
+ url: "/documents/presigned_upload"
1184
+ });
1185
+ }
1186
+ /**
1187
+ * /storage/sign_upload operation on presigned_url resource
1188
+ */
1189
+ static postStorageSignUpload(options) {
1190
+ return (options?.client ?? client).post({
1191
+ ...options,
1192
+ url: "/storage/sign_upload"
1193
+ });
1194
+ }
1195
+ };
1196
+ var ApplicationService = class {
1197
+ /**
1198
+ * /applications operation on application resource
1199
+ */
1200
+ static getApplications(options) {
1201
+ return (options?.client ?? client).get({
1202
+ ...options,
1203
+ url: "/applications"
1204
+ });
1205
+ }
1206
+ /**
1207
+ * /applications operation on application resource
1208
+ */
1209
+ static postApplications(options) {
1210
+ return (options?.client ?? client).post({
1211
+ ...options,
1212
+ url: "/applications"
1213
+ });
1214
+ }
1215
+ /**
1216
+ * /applications/:id operation on application resource
1217
+ */
1218
+ static deleteApplicationsById(options) {
1219
+ return (options?.client ?? client).delete({
1220
+ ...options,
1221
+ url: "/applications/{id}"
1222
+ });
1223
+ }
1224
+ /**
1225
+ * /applications/:id operation on application resource
1226
+ */
1227
+ static getApplicationsById(options) {
1228
+ return (options?.client ?? client).get({
1229
+ ...options,
1230
+ url: "/applications/{id}"
1231
+ });
1232
+ }
1233
+ /**
1234
+ * /applications/:id operation on application resource
1235
+ */
1236
+ static patchApplicationsById(options) {
1237
+ return (options?.client ?? client).patch({
1238
+ ...options,
1239
+ url: "/applications/{id}"
1240
+ });
1241
+ }
1242
+ /**
1243
+ * /applications/by-slug/:slug operation on application resource
1244
+ */
1245
+ static getApplicationsBySlugBySlug(options) {
1246
+ return (options?.client ?? client).get({
1247
+ ...options,
1248
+ url: "/applications/by-slug/{slug}"
1249
+ });
1250
+ }
1251
+ };
1252
+ var TenantService = class {
1253
+ /**
1254
+ * /tenants operation on tenant resource
1255
+ */
1256
+ static getTenants(options) {
1257
+ return (options?.client ?? client).get({
1258
+ ...options,
1259
+ url: "/tenants"
1260
+ });
1261
+ }
1262
+ /**
1263
+ * /tenants operation on tenant resource
1264
+ */
1265
+ static postTenants(options) {
1266
+ return (options?.client ?? client).post({
1267
+ ...options,
1268
+ url: "/tenants"
1269
+ });
1270
+ }
1271
+ /**
1272
+ * /tenants/:id/remove-storage operation on tenant resource
1273
+ */
1274
+ static postTenantsByIdRemoveStorage(options) {
1275
+ return (options?.client ?? client).post({
1276
+ ...options,
1277
+ url: "/tenants/{id}/remove-storage"
1278
+ });
1279
+ }
1280
+ /**
1281
+ * /tenants/:id/buy-storage operation on tenant resource
1282
+ */
1283
+ static postTenantsByIdBuyStorage(options) {
1284
+ return (options?.client ?? client).post({
1285
+ ...options,
1286
+ url: "/tenants/{id}/buy-storage"
1287
+ });
1288
+ }
1289
+ /**
1290
+ * /tenants/:id operation on tenant resource
1291
+ */
1292
+ static deleteTenantsById(options) {
1293
+ return (options?.client ?? client).delete({
1294
+ ...options,
1295
+ url: "/tenants/{id}"
1296
+ });
1297
+ }
1298
+ /**
1299
+ * /tenants/:id operation on tenant resource
1300
+ */
1301
+ static getTenantsById(options) {
1302
+ return (options?.client ?? client).get({
1303
+ ...options,
1304
+ url: "/tenants/{id}"
1305
+ });
1306
+ }
1307
+ /**
1308
+ * /tenants/:id operation on tenant resource
1309
+ */
1310
+ static patchTenantsById(options) {
1311
+ return (options?.client ?? client).patch({
1312
+ ...options,
1313
+ url: "/tenants/{id}"
1314
+ });
1315
+ }
1316
+ };
1317
+ var AuditLogService = class {
1318
+ /**
1319
+ * /audit-logs operation on audit-log resource
1320
+ */
1321
+ static getAuditLogs(options) {
1322
+ return (options?.client ?? client).get({
1323
+ ...options,
1324
+ url: "/audit-logs"
1325
+ });
1326
+ }
1327
+ };
1328
+ var PlanService = class {
1329
+ /**
1330
+ * /plans/:id operation on plan resource
1331
+ */
1332
+ static deletePlansById(options) {
1333
+ return (options?.client ?? client).delete({
1334
+ ...options,
1335
+ url: "/plans/{id}"
1336
+ });
1337
+ }
1338
+ /**
1339
+ * /plans/:id operation on plan resource
1340
+ */
1341
+ static getPlansById(options) {
1342
+ return (options?.client ?? client).get({
1343
+ ...options,
1344
+ url: "/plans/{id}"
1345
+ });
1346
+ }
1347
+ /**
1348
+ * /plans/:id operation on plan resource
1349
+ */
1350
+ static patchPlansById(options) {
1351
+ return (options?.client ?? client).patch({
1352
+ ...options,
1353
+ url: "/plans/{id}"
1354
+ });
1355
+ }
1356
+ /**
1357
+ * /plans/slug/:slug operation on plan resource
1358
+ */
1359
+ static getPlansSlugBySlug(options) {
1360
+ return (options?.client ?? client).get({
1361
+ ...options,
1362
+ url: "/plans/slug/{slug}"
1363
+ });
1364
+ }
1365
+ /**
1366
+ * /plans operation on plan resource
1367
+ */
1368
+ static getPlans(options) {
1369
+ return (options?.client ?? client).get({
1370
+ ...options,
1371
+ url: "/plans"
1372
+ });
1373
+ }
1374
+ /**
1375
+ * /plans operation on plan resource
1376
+ */
1377
+ static postPlans(options) {
1378
+ return (options?.client ?? client).post({
1379
+ ...options,
1380
+ url: "/plans"
1381
+ });
1382
+ }
1383
+ };
1384
+ var WalletService = class {
1385
+ /**
1386
+ * Purchase an add-on for the wallet
1387
+ */
1388
+ static patchWalletAddons(options) {
1389
+ return (options?.client ?? client).patch({
1390
+ ...options,
1391
+ url: "/wallet/addons"
1392
+ });
1393
+ }
1394
+ /**
1395
+ * /wallet/addons/:addon_slug/cancel operation on wallet resource
1396
+ */
1397
+ static patchWalletAddonsByAddonSlugCancel(options) {
1398
+ return (options?.client ?? client).patch({
1399
+ ...options,
1400
+ url: "/wallet/addons/{addon_slug}/cancel"
1401
+ });
1402
+ }
1403
+ /**
1404
+ * Change the main plan for the wallet
1405
+ */
1406
+ static patchWalletPlan(options) {
1407
+ return (options?.client ?? client).patch({
1408
+ ...options,
1409
+ url: "/wallet/plan"
1410
+ });
1411
+ }
1412
+ /**
1413
+ * Reads the wallet for the current tenant
1414
+ */
1415
+ static getWallet(options) {
1416
+ return (options?.client ?? client).get({
1417
+ ...options,
1418
+ url: "/wallet"
1419
+ });
1420
+ }
1421
+ };
1422
+ var EmbeddingService = class {
1423
+ /**
1424
+ * /ai/embed operation on embedding resource
1425
+ */
1426
+ static postAiEmbed(options) {
1427
+ return (options?.client ?? client).post({
1428
+ ...options,
1429
+ url: "/ai/embed"
1430
+ });
1431
+ }
1432
+ };
1433
+
1434
+ // src/base-client.ts
1435
+ var BaseClient = class {
1436
+ constructor(config = {}) {
1437
+ if (config.baseUrl) {
1438
+ client.setConfig({ baseUrl: config.baseUrl });
1439
+ }
1440
+ client.interceptors.request.use((req) => {
1441
+ req.headers.set("Accept", "application/vnd.api+json");
1442
+ req.headers.set("Content-Type", "application/vnd.api+json");
1443
+ if (config.apiKey) {
1444
+ req.headers.set("x-application-key", config.apiKey);
1445
+ }
1446
+ if (config.token) {
1447
+ req.headers.set("Authorization", `Bearer ${config.token}`);
1448
+ }
1449
+ return req;
1450
+ });
1451
+ }
1452
+ unwrap(resource) {
1453
+ if (!resource) return null;
1454
+ if (resource.data && !resource.id && !resource.type) {
1455
+ return resource.data;
1456
+ }
1457
+ return resource;
1458
+ }
1459
+ };
1460
+
1461
+ // src/gpt-client.ts
1462
+ var GptClient = class extends BaseClient {
1463
+ constructor(config) {
1464
+ super(config);
1465
+ this.identity = {
1466
+ login: async (email, password) => {
1467
+ const { data, error } = await UserService.postUsersAuthLogin({
1468
+ body: { data: { type: "user", attributes: { email, password } } }
1469
+ });
1470
+ if (error) throw error;
1471
+ return {
1472
+ user: this.unwrap(data?.data),
1473
+ token: data?.meta?.token
1474
+ };
1475
+ },
1476
+ register: async (email, password, password_confirmation) => {
1477
+ const { data, error } = await UserService.postUsersAuthRegister({
1478
+ body: {
1479
+ data: {
1480
+ type: "user",
1481
+ attributes: { email, password, password_confirmation }
1482
+ }
1483
+ }
1484
+ });
1485
+ if (error) throw error;
1486
+ return this.unwrap(data?.data);
1487
+ },
1488
+ me: async () => {
1489
+ const { data, error } = await UserService.getUsersMe();
1490
+ if (error) throw error;
1491
+ return this.unwrap(data?.data);
1492
+ },
1493
+ profile: async () => {
1494
+ const { data, error } = await UserProfileService.getUserProfilesMe();
1495
+ if (error) throw error;
1496
+ return this.unwrap(data?.data);
1497
+ },
1498
+ apiKeys: {
1499
+ list: async () => {
1500
+ const { data, error } = await ApiKeyService.getApiKeys();
1501
+ if (error) throw error;
1502
+ return this.unwrap(data?.data);
1503
+ },
1504
+ create: async (name) => {
1505
+ const { data, error } = await ApiKeyService.postApiKeys({
1506
+ body: { data: { type: "api_key", attributes: { name } } }
1507
+ });
1508
+ if (error) throw error;
1509
+ return this.unwrap(data?.data);
1510
+ },
1511
+ allocate: async (id, amount, description) => {
1512
+ const { error } = await ApiKeyService.patchApiKeysByIdAllocate({
1513
+ path: { id },
1514
+ body: { data: { type: "api_key", id, attributes: { amount, description } } }
1515
+ });
1516
+ if (error) throw error;
1517
+ return true;
1518
+ }
1519
+ }
1520
+ };
1521
+ this.platform = {
1522
+ applications: {
1523
+ list: async () => {
1524
+ const { data, error } = await ApplicationService.getApplications();
1525
+ if (error) throw error;
1526
+ return this.unwrap(data?.data);
1527
+ },
1528
+ create: async (attributes) => {
1529
+ const { data, error } = await ApplicationService.postApplications({
1530
+ body: { data: { type: "application", attributes } }
1531
+ });
1532
+ if (error) throw error;
1533
+ return this.unwrap(data?.data);
1534
+ },
1535
+ getBySlug: async (slug) => {
1536
+ const { data, error } = await ApplicationService.getApplicationsBySlugBySlug({
1537
+ path: { slug }
1538
+ });
1539
+ if (error) throw error;
1540
+ return this.unwrap(data?.data);
1541
+ }
1542
+ },
1543
+ workspaces: {
1544
+ list: async () => {
1545
+ const { data, error } = await WorkspaceService.getWorkspaces();
1546
+ if (error) throw error;
1547
+ return this.unwrap(data?.data);
1548
+ },
1549
+ mine: async () => {
1550
+ const { data, error } = await WorkspaceService.getWorkspacesMine();
1551
+ if (error) throw error;
1552
+ return this.unwrap(data?.data);
1553
+ },
1554
+ create: async (name, slug) => {
1555
+ const { data, error } = await WorkspaceService.postWorkspaces({
1556
+ body: { data: { type: "workspace", attributes: { name, slug } } }
1557
+ });
1558
+ if (error) throw error;
1559
+ return this.unwrap(data?.data);
1560
+ }
1561
+ },
1562
+ tenants: {
1563
+ list: async () => {
1564
+ const { data, error } = await TenantService.getTenants();
1565
+ if (error) throw error;
1566
+ return this.unwrap(data?.data);
1567
+ }
1568
+ },
1569
+ invitations: {
1570
+ list: async () => {
1571
+ const { data, error } = await InvitationService.getInvitations();
1572
+ if (error) throw error;
1573
+ return this.unwrap(data?.data);
1574
+ },
1575
+ invite: async (email, role2, scopeType, scopeId) => {
1576
+ const { error } = await InvitationService.postInvitationsInvite({
1577
+ body: { email, role: role2, scope_type: scopeType, scope_id: scopeId }
1578
+ });
1579
+ if (error) throw error;
1580
+ return true;
1581
+ }
1582
+ },
1583
+ auditLogs: {
1584
+ list: async () => {
1585
+ const { data, error } = await AuditLogService.getAuditLogs();
1586
+ if (error) throw error;
1587
+ return this.unwrap(data?.data);
1588
+ }
1589
+ }
1590
+ };
1591
+ this.ai = {
1592
+ agents: {
1593
+ list: async () => {
1594
+ const { data, error } = await AgentService.getAgents();
1595
+ if (error) throw error;
1596
+ return this.unwrap(data?.data);
1597
+ },
1598
+ create: async (name, promptTemplate) => {
1599
+ const { data, error } = await AgentService.postAgents({
1600
+ body: { data: { type: "agent", attributes: { name, prompt_template: promptTemplate } } }
1601
+ });
1602
+ if (error) throw error;
1603
+ return this.unwrap(data?.data);
1604
+ }
1605
+ },
1606
+ threads: {
1607
+ list: async () => {
1608
+ const { data, error } = await ThreadService.getThreads();
1609
+ if (error) throw error;
1610
+ return this.unwrap(data?.data);
1611
+ },
1612
+ create: async (title) => {
1613
+ const { data, error } = await ThreadService.postThreads({
1614
+ body: { data: { type: "thread", attributes: { title } } }
1615
+ });
1616
+ if (error) throw error;
1617
+ return this.unwrap(data?.data);
1618
+ },
1619
+ sendMessage: async (threadId, content) => {
1620
+ const { data, error } = await ThreadService.postThreadsByIdMessages({
1621
+ path: { id: threadId },
1622
+ body: { data: { attributes: { content } } }
1623
+ });
1624
+ if (error) throw error;
1625
+ return this.unwrap(data);
1626
+ }
1627
+ },
1628
+ search: async (query, top_k = 5) => {
1629
+ const { data, error } = await SearchService.postAiSearch({
1630
+ body: { query, top_k }
1631
+ });
1632
+ if (error) throw error;
1633
+ return this.unwrap(data);
1634
+ },
1635
+ embed: async (text, workspaceId) => {
1636
+ const { data, error } = await EmbeddingService.postAiEmbed({
1637
+ body: { text, workspace_id: workspaceId }
1638
+ });
1639
+ if (error) throw error;
1640
+ return this.unwrap(data);
1641
+ }
1642
+ };
1643
+ this.extraction = {
1644
+ documents: {
1645
+ list: async () => {
1646
+ const { data, error } = await DocumentService.getDocuments();
1647
+ if (error) throw error;
1648
+ return this.unwrap(data?.data);
1649
+ },
1650
+ upload: async (_file, _filename) => {
1651
+ throw new Error("Use uploadBase64 for now");
1652
+ },
1653
+ uploadBase64: async (filename, base64Content) => {
1654
+ const { data, error } = await DocumentService.postDocuments({
1655
+ body: { data: { type: "document", attributes: { filename, content: base64Content } } }
1656
+ });
1657
+ if (error) throw error;
1658
+ return this.unwrap(data?.data);
1659
+ },
1660
+ get: async (id) => {
1661
+ const { data, error } = await DocumentService.getDocumentsById({ path: { id } });
1662
+ if (error) throw error;
1663
+ return this.unwrap(data?.data);
1664
+ },
1665
+ delete: async (id) => {
1666
+ const { error } = await DocumentService.deleteDocumentsById({ path: { id } });
1667
+ if (error) throw error;
1668
+ return true;
1669
+ },
1670
+ analyze: async (id) => {
1671
+ const { error } = await DocumentService.postDocumentsByIdAnalyze({ path: { id }, body: {} });
1672
+ if (error) throw error;
1673
+ return true;
1674
+ }
1675
+ },
1676
+ results: {
1677
+ list: async () => {
1678
+ const { data, error } = await ExtractionResultService.getExtractionResults();
1679
+ if (error) throw error;
1680
+ return this.unwrap(data?.data);
1681
+ }
1682
+ }
1683
+ };
1684
+ this.storage = {
1685
+ buckets: {
1686
+ list: async () => {
1687
+ const { data, error } = await BucketService.getBuckets();
1688
+ if (error) throw error;
1689
+ return this.unwrap(data?.data);
1690
+ },
1691
+ create: async (name, isPublic = false) => {
1692
+ const { data, error } = await BucketService.postBuckets({
1693
+ body: { data: { type: "bucket", attributes: { name, type: isPublic ? "public" : "private" } } }
1694
+ });
1695
+ if (error) throw error;
1696
+ return this.unwrap(data?.data);
1697
+ }
1698
+ },
1699
+ presigned: {
1700
+ upload: async (filename, contentType) => {
1701
+ const { data, error } = await PresignedUrlService.postStorageSignUpload({
1702
+ body: { filename, content_type: contentType }
1703
+ });
1704
+ if (error) throw error;
1705
+ return this.unwrap(data);
1706
+ },
1707
+ download: async (fileId) => {
1708
+ const { data, error } = await PresignedUrlService.postStorageSignDownload({
1709
+ body: { file_id: fileId }
1710
+ });
1711
+ if (error) throw error;
1712
+ return this.unwrap(data);
1713
+ }
1714
+ }
1715
+ };
1716
+ this.billing = {
1717
+ wallet: {
1718
+ get: async () => {
1719
+ const { data, error } = await WalletService.getWallet();
1720
+ if (error) throw error;
1721
+ return this.unwrap(data?.data);
1722
+ }
1723
+ },
1724
+ plans: {
1725
+ list: async () => {
1726
+ const { data, error } = await PlanService.getPlans();
1727
+ if (error) throw error;
1728
+ return this.unwrap(data?.data);
1729
+ }
1730
+ }
1731
+ };
1732
+ }
1733
+ };
1734
+
1735
+ // src/_internal/types.gen.ts
1736
+ var eq = {
1737
+ KEYWORD: "keyword",
1738
+ SEMANTIC: "semantic"
1739
+ };
1740
+ var greater_than = {
1741
+ KEYWORD: "keyword",
1742
+ SEMANTIC: "semantic"
1743
+ };
1744
+ var greater_than_or_equal = {
1745
+ KEYWORD: "keyword",
1746
+ SEMANTIC: "semantic"
1747
+ };
1748
+ var less_than = {
1749
+ KEYWORD: "keyword",
1750
+ SEMANTIC: "semantic"
1751
+ };
1752
+ var less_than_or_equal = {
1753
+ KEYWORD: "keyword",
1754
+ SEMANTIC: "semantic"
1755
+ };
1756
+ var not_eq = {
1757
+ KEYWORD: "keyword",
1758
+ SEMANTIC: "semantic"
1759
+ };
1760
+ var eq2 = {
1761
+ PENDING: "pending",
1762
+ PROCESSING: "processing",
1763
+ COMPLETED: "completed",
1764
+ FAILED: "failed"
1765
+ };
1766
+ var greater_than2 = {
1767
+ PENDING: "pending",
1768
+ PROCESSING: "processing",
1769
+ COMPLETED: "completed",
1770
+ FAILED: "failed"
1771
+ };
1772
+ var greater_than_or_equal2 = {
1773
+ PENDING: "pending",
1774
+ PROCESSING: "processing",
1775
+ COMPLETED: "completed",
1776
+ FAILED: "failed"
1777
+ };
1778
+ var less_than2 = {
1779
+ PENDING: "pending",
1780
+ PROCESSING: "processing",
1781
+ COMPLETED: "completed",
1782
+ FAILED: "failed"
1783
+ };
1784
+ var less_than_or_equal2 = {
1785
+ PENDING: "pending",
1786
+ PROCESSING: "processing",
1787
+ COMPLETED: "completed",
1788
+ FAILED: "failed"
1789
+ };
1790
+ var not_eq2 = {
1791
+ PENDING: "pending",
1792
+ PROCESSING: "processing",
1793
+ COMPLETED: "completed",
1794
+ FAILED: "failed"
1795
+ };
1796
+ var status = {
1797
+ PENDING: "pending",
1798
+ PROCESSING: "processing",
1799
+ COMPLETED: "completed",
1800
+ FAILED: "failed"
1801
+ };
1802
+ var eq3 = {
1803
+ ACTIVE: "active",
1804
+ REVOKED: "revoked",
1805
+ EXPIRED: "expired"
1806
+ };
1807
+ var greater_than3 = {
1808
+ ACTIVE: "active",
1809
+ REVOKED: "revoked",
1810
+ EXPIRED: "expired"
1811
+ };
1812
+ var greater_than_or_equal3 = {
1813
+ ACTIVE: "active",
1814
+ REVOKED: "revoked",
1815
+ EXPIRED: "expired"
1816
+ };
1817
+ var less_than3 = {
1818
+ ACTIVE: "active",
1819
+ REVOKED: "revoked",
1820
+ EXPIRED: "expired"
1821
+ };
1822
+ var less_than_or_equal3 = {
1823
+ ACTIVE: "active",
1824
+ REVOKED: "revoked",
1825
+ EXPIRED: "expired"
1826
+ };
1827
+ var not_eq3 = {
1828
+ ACTIVE: "active",
1829
+ REVOKED: "revoked",
1830
+ EXPIRED: "expired"
1831
+ };
1832
+ var eq4 = {
1833
+ PENDING: "pending",
1834
+ SUCCESS: "success",
1835
+ FAILED: "failed",
1836
+ REFUNDED: "refunded",
1837
+ VOIDED: "voided"
1838
+ };
1839
+ var greater_than4 = {
1840
+ PENDING: "pending",
1841
+ SUCCESS: "success",
1842
+ FAILED: "failed",
1843
+ REFUNDED: "refunded",
1844
+ VOIDED: "voided"
1845
+ };
1846
+ var greater_than_or_equal4 = {
1847
+ PENDING: "pending",
1848
+ SUCCESS: "success",
1849
+ FAILED: "failed",
1850
+ REFUNDED: "refunded",
1851
+ VOIDED: "voided"
1852
+ };
1853
+ var less_than4 = {
1854
+ PENDING: "pending",
1855
+ SUCCESS: "success",
1856
+ FAILED: "failed",
1857
+ REFUNDED: "refunded",
1858
+ VOIDED: "voided"
1859
+ };
1860
+ var less_than_or_equal4 = {
1861
+ PENDING: "pending",
1862
+ SUCCESS: "success",
1863
+ FAILED: "failed",
1864
+ REFUNDED: "refunded",
1865
+ VOIDED: "voided"
1866
+ };
1867
+ var not_eq4 = {
1868
+ PENDING: "pending",
1869
+ SUCCESS: "success",
1870
+ FAILED: "failed",
1871
+ REFUNDED: "refunded",
1872
+ VOIDED: "voided"
1873
+ };
1874
+ var status2 = {
1875
+ ACTIVE: "active",
1876
+ REVOKED: "revoked",
1877
+ EXPIRED: "expired"
1878
+ };
1879
+ var format = {
1880
+ ENTITY: "entity",
1881
+ TABULAR: "tabular",
1882
+ GRAPH: "graph",
1883
+ COMPOSITE: "composite"
1884
+ };
1885
+ var eq5 = {
1886
+ OWNER: "owner",
1887
+ ADMIN: "admin",
1888
+ MEMBER: "member"
1889
+ };
1890
+ var greater_than5 = {
1891
+ OWNER: "owner",
1892
+ ADMIN: "admin",
1893
+ MEMBER: "member"
1894
+ };
1895
+ var greater_than_or_equal5 = {
1896
+ OWNER: "owner",
1897
+ ADMIN: "admin",
1898
+ MEMBER: "member"
1899
+ };
1900
+ var less_than5 = {
1901
+ OWNER: "owner",
1902
+ ADMIN: "admin",
1903
+ MEMBER: "member"
1904
+ };
1905
+ var less_than_or_equal5 = {
1906
+ OWNER: "owner",
1907
+ ADMIN: "admin",
1908
+ MEMBER: "member"
1909
+ };
1910
+ var not_eq5 = {
1911
+ OWNER: "owner",
1912
+ ADMIN: "admin",
1913
+ MEMBER: "member"
1914
+ };
1915
+ var eq6 = {
1916
+ PLAN: "plan",
1917
+ ADDON: "addon"
1918
+ };
1919
+ var greater_than6 = {
1920
+ PLAN: "plan",
1921
+ ADDON: "addon"
1922
+ };
1923
+ var greater_than_or_equal6 = {
1924
+ PLAN: "plan",
1925
+ ADDON: "addon"
1926
+ };
1927
+ var less_than6 = {
1928
+ PLAN: "plan",
1929
+ ADDON: "addon"
1930
+ };
1931
+ var less_than_or_equal6 = {
1932
+ PLAN: "plan",
1933
+ ADDON: "addon"
1934
+ };
1935
+ var not_eq6 = {
1936
+ PLAN: "plan",
1937
+ ADDON: "addon"
1938
+ };
1939
+ var role = {
1940
+ OWNER: "owner",
1941
+ ADMIN: "admin",
1942
+ MEMBER: "member"
1943
+ };
1944
+ var eq7 = {
1945
+ PUBLIC: "public",
1946
+ PRIVATE: "private"
1947
+ };
1948
+ var greater_than7 = {
1949
+ PUBLIC: "public",
1950
+ PRIVATE: "private"
1951
+ };
1952
+ var greater_than_or_equal7 = {
1953
+ PUBLIC: "public",
1954
+ PRIVATE: "private"
1955
+ };
1956
+ var less_than7 = {
1957
+ PUBLIC: "public",
1958
+ PRIVATE: "private"
1959
+ };
1960
+ var less_than_or_equal7 = {
1961
+ PUBLIC: "public",
1962
+ PRIVATE: "private"
1963
+ };
1964
+ var not_eq7 = {
1965
+ PUBLIC: "public",
1966
+ PRIVATE: "private"
1967
+ };
1968
+ var eq8 = {
1969
+ SALE: "sale",
1970
+ AUTH: "auth",
1971
+ REFUND: "refund",
1972
+ VOID: "void"
1973
+ };
1974
+ var greater_than8 = {
1975
+ SALE: "sale",
1976
+ AUTH: "auth",
1977
+ REFUND: "refund",
1978
+ VOID: "void"
1979
+ };
1980
+ var greater_than_or_equal8 = {
1981
+ SALE: "sale",
1982
+ AUTH: "auth",
1983
+ REFUND: "refund",
1984
+ VOID: "void"
1985
+ };
1986
+ var less_than8 = {
1987
+ SALE: "sale",
1988
+ AUTH: "auth",
1989
+ REFUND: "refund",
1990
+ VOID: "void"
1991
+ };
1992
+ var less_than_or_equal8 = {
1993
+ SALE: "sale",
1994
+ AUTH: "auth",
1995
+ REFUND: "refund",
1996
+ VOID: "void"
1997
+ };
1998
+ var not_eq8 = {
1999
+ SALE: "sale",
2000
+ AUTH: "auth",
2001
+ REFUND: "refund",
2002
+ VOID: "void"
2003
+ };
2004
+ var type = {
2005
+ PUBLIC: "public",
2006
+ PRIVATE: "private"
2007
+ };
2008
+ // Annotate the CommonJS export names for ESM import in node:
2009
+ 0 && (module.exports = {
2010
+ GptClient,
2011
+ eq,
2012
+ eq2,
2013
+ eq3,
2014
+ eq4,
2015
+ eq5,
2016
+ eq6,
2017
+ eq7,
2018
+ eq8,
2019
+ format,
2020
+ greater_than,
2021
+ greater_than2,
2022
+ greater_than3,
2023
+ greater_than4,
2024
+ greater_than5,
2025
+ greater_than6,
2026
+ greater_than7,
2027
+ greater_than8,
2028
+ greater_than_or_equal,
2029
+ greater_than_or_equal2,
2030
+ greater_than_or_equal3,
2031
+ greater_than_or_equal4,
2032
+ greater_than_or_equal5,
2033
+ greater_than_or_equal6,
2034
+ greater_than_or_equal7,
2035
+ greater_than_or_equal8,
2036
+ less_than,
2037
+ less_than2,
2038
+ less_than3,
2039
+ less_than4,
2040
+ less_than5,
2041
+ less_than6,
2042
+ less_than7,
2043
+ less_than8,
2044
+ less_than_or_equal,
2045
+ less_than_or_equal2,
2046
+ less_than_or_equal3,
2047
+ less_than_or_equal4,
2048
+ less_than_or_equal5,
2049
+ less_than_or_equal6,
2050
+ less_than_or_equal7,
2051
+ less_than_or_equal8,
2052
+ not_eq,
2053
+ not_eq2,
2054
+ not_eq3,
2055
+ not_eq4,
2056
+ not_eq5,
2057
+ not_eq6,
2058
+ not_eq7,
2059
+ not_eq8,
2060
+ role,
2061
+ status,
2062
+ status2,
2063
+ type
2064
+ });