@xata.io/client 0.24.3 → 0.25.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.mjs CHANGED
@@ -27,8 +27,11 @@ function notEmpty(value) {
27
27
  function compact(arr) {
28
28
  return arr.filter(notEmpty);
29
29
  }
30
+ function compactObject(obj) {
31
+ return Object.fromEntries(Object.entries(obj).filter(([, value]) => notEmpty(value)));
32
+ }
30
33
  function isObject(value) {
31
- return Boolean(value) && typeof value === "object" && !Array.isArray(value);
34
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value) && !(value instanceof Date);
32
35
  }
33
36
  function isDefined(value) {
34
37
  return value !== null && value !== void 0;
@@ -83,6 +86,15 @@ function chunk(array, chunkSize) {
83
86
  async function timeout(ms) {
84
87
  return new Promise((resolve) => setTimeout(resolve, ms));
85
88
  }
89
+ function promiseMap(inputValues, mapper) {
90
+ const reducer = (acc$, inputValue) => acc$.then(
91
+ (acc) => mapper(inputValue).then((result) => {
92
+ acc.push(result);
93
+ return acc;
94
+ })
95
+ );
96
+ return inputValues.reduce(reducer, Promise.resolve([]));
97
+ }
86
98
 
87
99
  function getEnvironment() {
88
100
  try {
@@ -210,6 +222,12 @@ function getPreviewBranch() {
210
222
  }
211
223
  }
212
224
 
225
+ var __defProp$8 = Object.defineProperty;
226
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
227
+ var __publicField$8 = (obj, key, value) => {
228
+ __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
229
+ return value;
230
+ };
213
231
  var __accessCheck$8 = (obj, member, msg) => {
214
232
  if (!member.has(obj))
215
233
  throw TypeError("Cannot " + msg);
@@ -233,6 +251,7 @@ var __privateMethod$4 = (obj, member, method) => {
233
251
  return method;
234
252
  };
235
253
  var _fetch, _queue, _concurrency, _enqueue, enqueue_fn;
254
+ const REQUEST_TIMEOUT = 3e4;
236
255
  function getFetchImplementation(userFetch) {
237
256
  const globalFetch = typeof fetch !== "undefined" ? fetch : void 0;
238
257
  const fetchImpl = userFetch ?? globalFetch;
@@ -249,6 +268,8 @@ class ApiRequestPool {
249
268
  __privateAdd$8(this, _fetch, void 0);
250
269
  __privateAdd$8(this, _queue, void 0);
251
270
  __privateAdd$8(this, _concurrency, void 0);
271
+ __publicField$8(this, "running");
272
+ __publicField$8(this, "started");
252
273
  __privateSet$8(this, _queue, []);
253
274
  __privateSet$8(this, _concurrency, concurrency);
254
275
  this.running = 0;
@@ -265,9 +286,12 @@ class ApiRequestPool {
265
286
  }
266
287
  request(url, options) {
267
288
  const start = /* @__PURE__ */ new Date();
268
- const fetch2 = this.getFetch();
289
+ const fetchImpl = this.getFetch();
269
290
  const runRequest = async (stalled = false) => {
270
- const response = await fetch2(url, options);
291
+ const response = await Promise.race([fetchImpl(url, options), timeout(REQUEST_TIMEOUT).then(() => null)]);
292
+ if (!response) {
293
+ throw new Error("Request timed out");
294
+ }
271
295
  if (response.status === 429) {
272
296
  const rateLimitReset = parseNumber(response.headers?.get("x-ratelimit-reset")) ?? 1;
273
297
  await timeout(rateLimitReset * 1e3);
@@ -490,16 +514,26 @@ function defaultOnOpen(response) {
490
514
  }
491
515
  }
492
516
 
493
- const VERSION = "0.24.3";
517
+ const VERSION = "0.25.0";
494
518
 
519
+ var __defProp$7 = Object.defineProperty;
520
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
521
+ var __publicField$7 = (obj, key, value) => {
522
+ __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
523
+ return value;
524
+ };
495
525
  class ErrorWithCause extends Error {
496
526
  constructor(message, options) {
497
527
  super(message, options);
528
+ __publicField$7(this, "cause");
498
529
  }
499
530
  }
500
531
  class FetcherError extends ErrorWithCause {
501
532
  constructor(status, data, requestId) {
502
533
  super(getMessage(data));
534
+ __publicField$7(this, "status");
535
+ __publicField$7(this, "requestId");
536
+ __publicField$7(this, "errors");
503
537
  this.status = status;
504
538
  this.errors = isBulkError(data) ? data.errors : [{ message: getMessage(data), status }];
505
539
  this.requestId = requestId;
@@ -566,6 +600,15 @@ function hostHeader(url) {
566
600
  const { groups } = pattern.exec(url) ?? {};
567
601
  return groups?.host ? { Host: groups.host } : {};
568
602
  }
603
+ function parseBody(body, headers) {
604
+ if (!isDefined(body))
605
+ return void 0;
606
+ const { "Content-Type": contentType } = headers ?? {};
607
+ if (String(contentType).toLowerCase() === "application/json") {
608
+ return JSON.stringify(body);
609
+ }
610
+ return body;
611
+ }
569
612
  const defaultClientID = generateUUID();
570
613
  async function fetch$1({
571
614
  url: path,
@@ -585,7 +628,8 @@ async function fetch$1({
585
628
  sessionID,
586
629
  clientName,
587
630
  xataAgentExtra,
588
- fetchOptions = {}
631
+ fetchOptions = {},
632
+ rawResponse = false
589
633
  }) {
590
634
  pool.setFetch(fetch2);
591
635
  return await trace(
@@ -604,7 +648,7 @@ async function fetch$1({
604
648
  isDefined(clientName) ? ["service", clientName] : void 0,
605
649
  ...Object.entries(xataAgentExtra ?? {})
606
650
  ]).map(([key, value]) => `${key}=${value}`).join("; ");
607
- const headers = {
651
+ const headers = compactObject({
608
652
  "Accept-Encoding": "identity",
609
653
  "Content-Type": "application/json",
610
654
  "X-Xata-Client-ID": clientID ?? defaultClientID,
@@ -613,11 +657,11 @@ async function fetch$1({
613
657
  ...customHeaders,
614
658
  ...hostHeader(fullUrl),
615
659
  Authorization: `Bearer ${apiKey}`
616
- };
660
+ });
617
661
  const response = await pool.request(url, {
618
662
  ...fetchOptions,
619
663
  method: method.toUpperCase(),
620
- body: body ? JSON.stringify(body) : void 0,
664
+ body: parseBody(body, headers),
621
665
  headers,
622
666
  signal
623
667
  });
@@ -630,6 +674,9 @@ async function fetch$1({
630
674
  [TraceAttributes.HTTP_HOST]: host,
631
675
  [TraceAttributes.HTTP_SCHEME]: protocol?.replace(":", "")
632
676
  });
677
+ const message = response.headers?.get("x-xata-message");
678
+ if (message)
679
+ console.warn(message);
633
680
  if (response.status === 204) {
634
681
  return {};
635
682
  }
@@ -637,7 +684,7 @@ async function fetch$1({
637
684
  throw new FetcherError(response.status, "Rate limit exceeded", requestId);
638
685
  }
639
686
  try {
640
- const jsonResponse = await response.json();
687
+ const jsonResponse = rawResponse ? await response.blob() : await response.json();
641
688
  if (response.ok) {
642
689
  return jsonResponse;
643
690
  }
@@ -910,6 +957,7 @@ const askTable = (variables, signal) => dataPlaneFetch({
910
957
  ...variables,
911
958
  signal
912
959
  });
960
+ const askTableSession = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/ask/{sessionId}", method: "post", ...variables, signal });
913
961
  const summarizeTable = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/summarize", method: "post", ...variables, signal });
914
962
  const aggregateTable = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/aggregate", method: "post", ...variables, signal });
915
963
  const fileAccess = (variables, signal) => dataPlaneFetch({
@@ -985,6 +1033,7 @@ const operationsByTag$2 = {
985
1033
  sqlQuery,
986
1034
  vectorSearchTable,
987
1035
  askTable,
1036
+ askTableSession,
988
1037
  summarizeTable,
989
1038
  aggregateTable
990
1039
  }
@@ -992,6 +1041,13 @@ const operationsByTag$2 = {
992
1041
 
993
1042
  const controlPlaneFetch = async (options) => fetch$1({ ...options, endpoint: "controlPlane" });
994
1043
 
1044
+ const grantAuthorizationCode = (variables, signal) => controlPlaneFetch({ url: "/oauth/authorize", method: "post", ...variables, signal });
1045
+ const generateAccessToken = (variables, signal) => controlPlaneFetch({
1046
+ url: "/oauth/token",
1047
+ method: "post",
1048
+ ...variables,
1049
+ signal
1050
+ });
995
1051
  const getUser = (variables, signal) => controlPlaneFetch({
996
1052
  url: "/user",
997
1053
  method: "get",
@@ -1097,6 +1153,7 @@ const listRegions = (variables, signal) => controlPlaneFetch({
1097
1153
  signal
1098
1154
  });
1099
1155
  const operationsByTag$1 = {
1156
+ authOther: { grantAuthorizationCode, generateAccessToken },
1100
1157
  users: { getUser, updateUser, deleteUser },
1101
1158
  authentication: { getUserAPIKeys, createUserAPIKey, deleteUserAPIKey },
1102
1159
  workspaces: {
@@ -2109,6 +2166,21 @@ class SearchAndFilterApi {
2109
2166
  ...this.extraProps
2110
2167
  });
2111
2168
  }
2169
+ askTableSession({
2170
+ workspace,
2171
+ region,
2172
+ database,
2173
+ branch,
2174
+ table,
2175
+ sessionId,
2176
+ message
2177
+ }) {
2178
+ return operationsByTag.searchAndFilter.askTableSession({
2179
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, sessionId },
2180
+ body: { message },
2181
+ ...this.extraProps
2182
+ });
2183
+ }
2112
2184
  summarizeTable({
2113
2185
  workspace,
2114
2186
  region,
@@ -2400,11 +2472,13 @@ class DatabaseApi {
2400
2472
  createDatabase({
2401
2473
  workspace,
2402
2474
  database,
2403
- data
2475
+ data,
2476
+ headers
2404
2477
  }) {
2405
2478
  return operationsByTag.databases.createDatabase({
2406
2479
  pathParams: { workspaceId: workspace, dbName: database },
2407
2480
  body: data,
2481
+ headers,
2408
2482
  ...this.extraProps
2409
2483
  });
2410
2484
  }
@@ -2494,13 +2568,261 @@ class XataApiPlugin {
2494
2568
  class XataPlugin {
2495
2569
  }
2496
2570
 
2571
+ class FilesPlugin extends XataPlugin {
2572
+ build(pluginOptions) {
2573
+ return {
2574
+ download: async (location) => {
2575
+ const { table, record, column, fileId = "" } = location ?? {};
2576
+ return await getFileItem({
2577
+ pathParams: {
2578
+ workspace: "{workspaceId}",
2579
+ dbBranchName: "{dbBranch}",
2580
+ region: "{region}",
2581
+ tableName: table ?? "",
2582
+ recordId: record ?? "",
2583
+ columnName: column ?? "",
2584
+ fileId
2585
+ },
2586
+ ...pluginOptions,
2587
+ rawResponse: true
2588
+ });
2589
+ },
2590
+ upload: async (location, file) => {
2591
+ const { table, record, column, fileId = "" } = location ?? {};
2592
+ return await putFileItem({
2593
+ pathParams: {
2594
+ workspace: "{workspaceId}",
2595
+ dbBranchName: "{dbBranch}",
2596
+ region: "{region}",
2597
+ tableName: table ?? "",
2598
+ recordId: record ?? "",
2599
+ columnName: column ?? "",
2600
+ fileId
2601
+ },
2602
+ body: file,
2603
+ ...pluginOptions
2604
+ });
2605
+ },
2606
+ delete: async (location) => {
2607
+ const { table, record, column, fileId = "" } = location ?? {};
2608
+ return await deleteFileItem({
2609
+ pathParams: {
2610
+ workspace: "{workspaceId}",
2611
+ dbBranchName: "{dbBranch}",
2612
+ region: "{region}",
2613
+ tableName: table ?? "",
2614
+ recordId: record ?? "",
2615
+ columnName: column ?? "",
2616
+ fileId
2617
+ },
2618
+ ...pluginOptions
2619
+ });
2620
+ }
2621
+ };
2622
+ }
2623
+ }
2624
+
2625
+ function buildTransformString(transformations) {
2626
+ return transformations.flatMap(
2627
+ (t) => Object.entries(t).map(([key, value]) => {
2628
+ if (key === "trim") {
2629
+ const { left = 0, top = 0, right = 0, bottom = 0 } = value;
2630
+ return `${key}=${[top, right, bottom, left].join(";")}`;
2631
+ }
2632
+ if (key === "gravity" && typeof value === "object") {
2633
+ const { x = 0.5, y = 0.5 } = value;
2634
+ return `${key}=${[x, y].join("x")}`;
2635
+ }
2636
+ return `${key}=${value}`;
2637
+ })
2638
+ ).join(",");
2639
+ }
2640
+ function transformImage(url, transformations) {
2641
+ if (!isDefined(url))
2642
+ return void 0;
2643
+ const transformationsString = buildTransformString(transformations);
2644
+ const { hostname, pathname, search } = new URL(url);
2645
+ return `https://${hostname}/transform/${transformationsString}${pathname}${search}`;
2646
+ }
2647
+
2648
+ var __defProp$6 = Object.defineProperty;
2649
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2650
+ var __publicField$6 = (obj, key, value) => {
2651
+ __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
2652
+ return value;
2653
+ };
2654
+ class XataFile {
2655
+ constructor(file) {
2656
+ /**
2657
+ * Name of this file.
2658
+ */
2659
+ __publicField$6(this, "name");
2660
+ /**
2661
+ * Media type of this file.
2662
+ */
2663
+ __publicField$6(this, "mediaType");
2664
+ /**
2665
+ * Base64 encoded content of this file.
2666
+ */
2667
+ __publicField$6(this, "base64Content");
2668
+ /**
2669
+ * Whether to enable public url for this file.
2670
+ */
2671
+ __publicField$6(this, "enablePublicUrl");
2672
+ /**
2673
+ * Timeout for the signed url.
2674
+ */
2675
+ __publicField$6(this, "signedUrlTimeout");
2676
+ /**
2677
+ * Size of this file.
2678
+ */
2679
+ __publicField$6(this, "size");
2680
+ /**
2681
+ * Version of this file.
2682
+ */
2683
+ __publicField$6(this, "version");
2684
+ /**
2685
+ * Url of this file.
2686
+ */
2687
+ __publicField$6(this, "url");
2688
+ /**
2689
+ * Signed url of this file.
2690
+ */
2691
+ __publicField$6(this, "signedUrl");
2692
+ /**
2693
+ * Attributes of this file.
2694
+ */
2695
+ __publicField$6(this, "attributes");
2696
+ this.name = file.name;
2697
+ this.mediaType = file.mediaType || "application/octet-stream";
2698
+ this.base64Content = file.base64Content;
2699
+ this.enablePublicUrl = file.enablePublicUrl;
2700
+ this.signedUrlTimeout = file.signedUrlTimeout;
2701
+ this.size = file.size;
2702
+ this.version = file.version;
2703
+ this.url = file.url;
2704
+ this.signedUrl = file.signedUrl;
2705
+ this.attributes = file.attributes;
2706
+ }
2707
+ static fromBuffer(buffer, options = {}) {
2708
+ const base64Content = buffer.toString("base64");
2709
+ return new XataFile({ ...options, base64Content });
2710
+ }
2711
+ toBuffer() {
2712
+ if (!this.base64Content) {
2713
+ throw new Error(`File content is not available, please select property "base64Content" when querying the file`);
2714
+ }
2715
+ return Buffer.from(this.base64Content, "base64");
2716
+ }
2717
+ static fromArrayBuffer(arrayBuffer, options = {}) {
2718
+ const uint8Array = new Uint8Array(arrayBuffer);
2719
+ return this.fromUint8Array(uint8Array, options);
2720
+ }
2721
+ toArrayBuffer() {
2722
+ if (!this.base64Content) {
2723
+ throw new Error(`File content is not available, please select property "base64Content" when querying the file`);
2724
+ }
2725
+ const binary = atob(this.base64Content);
2726
+ return new ArrayBuffer(binary.length);
2727
+ }
2728
+ static fromUint8Array(uint8Array, options = {}) {
2729
+ let binary = "";
2730
+ for (let i = 0; i < uint8Array.byteLength; i++) {
2731
+ binary += String.fromCharCode(uint8Array[i]);
2732
+ }
2733
+ const base64Content = btoa(binary);
2734
+ return new XataFile({ ...options, base64Content });
2735
+ }
2736
+ toUint8Array() {
2737
+ if (!this.base64Content) {
2738
+ throw new Error(`File content is not available, please select property "base64Content" when querying the file`);
2739
+ }
2740
+ const binary = atob(this.base64Content);
2741
+ const uint8Array = new Uint8Array(binary.length);
2742
+ for (let i = 0; i < binary.length; i++) {
2743
+ uint8Array[i] = binary.charCodeAt(i);
2744
+ }
2745
+ return uint8Array;
2746
+ }
2747
+ static async fromBlob(file, options = {}) {
2748
+ const name = options.name ?? file.name;
2749
+ const mediaType = file.type;
2750
+ const arrayBuffer = await file.arrayBuffer();
2751
+ return this.fromArrayBuffer(arrayBuffer, { ...options, name, mediaType });
2752
+ }
2753
+ toBlob() {
2754
+ if (!this.base64Content) {
2755
+ throw new Error(`File content is not available, please select property "base64Content" when querying the file`);
2756
+ }
2757
+ const arrayBuffer = this.toArrayBuffer();
2758
+ return new Blob([arrayBuffer], { type: this.mediaType });
2759
+ }
2760
+ static fromString(string, options = {}) {
2761
+ const base64Content = btoa(string);
2762
+ return new XataFile({ ...options, base64Content });
2763
+ }
2764
+ toString() {
2765
+ if (!this.base64Content) {
2766
+ throw new Error(`File content is not available, please select property "base64Content" when querying the file`);
2767
+ }
2768
+ return atob(this.base64Content);
2769
+ }
2770
+ static fromBase64(base64Content, options = {}) {
2771
+ return new XataFile({ ...options, base64Content });
2772
+ }
2773
+ toBase64() {
2774
+ if (!this.base64Content) {
2775
+ throw new Error(`File content is not available, please select property "base64Content" when querying the file`);
2776
+ }
2777
+ return this.base64Content;
2778
+ }
2779
+ transform(...options) {
2780
+ return {
2781
+ url: transformImage(this.url, options),
2782
+ signedUrl: transformImage(this.signedUrl, options)
2783
+ };
2784
+ }
2785
+ }
2786
+ const parseInputFileEntry = async (entry) => {
2787
+ if (!isDefined(entry))
2788
+ return null;
2789
+ const { id, name, mediaType, base64Content, enablePublicUrl, signedUrlTimeout } = await entry;
2790
+ return compactObject({ id, name, mediaType, base64Content, enablePublicUrl, signedUrlTimeout });
2791
+ };
2792
+
2497
2793
  function cleanFilter(filter) {
2498
- if (!filter)
2794
+ if (!isDefined(filter))
2499
2795
  return void 0;
2500
- const values = Object.values(filter).filter(Boolean).filter((value) => Array.isArray(value) ? value.length > 0 : true);
2501
- return values.length > 0 ? filter : void 0;
2796
+ if (!isObject(filter))
2797
+ return filter;
2798
+ const values = Object.fromEntries(
2799
+ Object.entries(filter).reduce((acc, [key, value]) => {
2800
+ if (!isDefined(value))
2801
+ return acc;
2802
+ if (Array.isArray(value)) {
2803
+ const clean = value.map((item) => cleanFilter(item)).filter((item) => isDefined(item));
2804
+ if (clean.length === 0)
2805
+ return acc;
2806
+ return [...acc, [key, clean]];
2807
+ }
2808
+ if (isObject(value)) {
2809
+ const clean = cleanFilter(value);
2810
+ if (!isDefined(clean))
2811
+ return acc;
2812
+ return [...acc, [key, clean]];
2813
+ }
2814
+ return [...acc, [key, value]];
2815
+ }, [])
2816
+ );
2817
+ return Object.keys(values).length > 0 ? values : void 0;
2502
2818
  }
2503
2819
 
2820
+ var __defProp$5 = Object.defineProperty;
2821
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2822
+ var __publicField$5 = (obj, key, value) => {
2823
+ __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
2824
+ return value;
2825
+ };
2504
2826
  var __accessCheck$6 = (obj, member, msg) => {
2505
2827
  if (!member.has(obj))
2506
2828
  throw TypeError("Cannot " + msg);
@@ -2523,6 +2845,14 @@ var _query, _page;
2523
2845
  class Page {
2524
2846
  constructor(query, meta, records = []) {
2525
2847
  __privateAdd$6(this, _query, void 0);
2848
+ /**
2849
+ * Page metadata, required to retrieve additional records.
2850
+ */
2851
+ __publicField$5(this, "meta");
2852
+ /**
2853
+ * The set of results for this page.
2854
+ */
2855
+ __publicField$5(this, "records");
2526
2856
  __privateSet$6(this, _query, query);
2527
2857
  this.meta = meta;
2528
2858
  this.records = new RecordArray(this, records);
@@ -2579,7 +2909,7 @@ const PAGINATION_DEFAULT_OFFSET = 0;
2579
2909
  function isCursorPaginationOptions(options) {
2580
2910
  return isDefined(options) && (isDefined(options.start) || isDefined(options.end) || isDefined(options.after) || isDefined(options.before));
2581
2911
  }
2582
- const _RecordArray = class extends Array {
2912
+ const _RecordArray = class _RecordArray extends Array {
2583
2913
  constructor(...args) {
2584
2914
  super(..._RecordArray.parseConstructorParams(...args));
2585
2915
  __privateAdd$6(this, _page, void 0);
@@ -2650,9 +2980,15 @@ const _RecordArray = class extends Array {
2650
2980
  return __privateGet$6(this, _page).meta.page.more;
2651
2981
  }
2652
2982
  };
2653
- let RecordArray = _RecordArray;
2654
2983
  _page = new WeakMap();
2984
+ let RecordArray = _RecordArray;
2655
2985
 
2986
+ var __defProp$4 = Object.defineProperty;
2987
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2988
+ var __publicField$4 = (obj, key, value) => {
2989
+ __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
2990
+ return value;
2991
+ };
2656
2992
  var __accessCheck$5 = (obj, member, msg) => {
2657
2993
  if (!member.has(obj))
2658
2994
  throw TypeError("Cannot " + msg);
@@ -2676,15 +3012,15 @@ var __privateMethod$3 = (obj, member, method) => {
2676
3012
  return method;
2677
3013
  };
2678
3014
  var _table$1, _repository, _data, _cleanFilterConstraint, cleanFilterConstraint_fn;
2679
- const _Query = class {
3015
+ const _Query = class _Query {
2680
3016
  constructor(repository, table, data, rawParent) {
2681
3017
  __privateAdd$5(this, _cleanFilterConstraint);
2682
3018
  __privateAdd$5(this, _table$1, void 0);
2683
3019
  __privateAdd$5(this, _repository, void 0);
2684
3020
  __privateAdd$5(this, _data, { filter: {} });
2685
3021
  // Implements pagination
2686
- this.meta = { page: { cursor: "start", more: true, size: PAGINATION_DEFAULT_SIZE } };
2687
- this.records = new RecordArray(this, []);
3022
+ __publicField$4(this, "meta", { page: { cursor: "start", more: true, size: PAGINATION_DEFAULT_SIZE } });
3023
+ __publicField$4(this, "records", new RecordArray(this, []));
2688
3024
  __privateSet$5(this, _table$1, table);
2689
3025
  if (repository) {
2690
3026
  __privateSet$5(this, _repository, repository);
@@ -2904,7 +3240,6 @@ const _Query = class {
2904
3240
  return this.meta.page.more;
2905
3241
  }
2906
3242
  };
2907
- let Query = _Query;
2908
3243
  _table$1 = new WeakMap();
2909
3244
  _repository = new WeakMap();
2910
3245
  _data = new WeakMap();
@@ -2919,6 +3254,7 @@ cleanFilterConstraint_fn = function(column, value) {
2919
3254
  }
2920
3255
  return value;
2921
3256
  };
3257
+ let Query = _Query;
2922
3258
  function cleanParent(data, parent) {
2923
3259
  if (isCursorPaginationOptions(data.pagination)) {
2924
3260
  return { ...parent, sort: void 0, filter: void 0 };
@@ -2926,6 +3262,21 @@ function cleanParent(data, parent) {
2926
3262
  return parent;
2927
3263
  }
2928
3264
 
3265
+ const RecordColumnTypes = [
3266
+ "bool",
3267
+ "int",
3268
+ "float",
3269
+ "string",
3270
+ "text",
3271
+ "email",
3272
+ "multiple",
3273
+ "link",
3274
+ "object",
3275
+ "datetime",
3276
+ "vector",
3277
+ "file[]",
3278
+ "file"
3279
+ ];
2929
3280
  function isIdentifiable(x) {
2930
3281
  return isObject(x) && isString(x?.id);
2931
3282
  }
@@ -2984,7 +3335,7 @@ var __privateMethod$2 = (obj, member, method) => {
2984
3335
  __accessCheck$4(obj, member, "access private method");
2985
3336
  return method;
2986
3337
  };
2987
- var _table, _getFetchProps, _db, _cache, _schemaTables$2, _trace, _insertRecordWithoutId, insertRecordWithoutId_fn, _insertRecordWithId, insertRecordWithId_fn, _insertRecords, insertRecords_fn, _updateRecordWithID, updateRecordWithID_fn, _updateRecords, updateRecords_fn, _upsertRecordWithID, upsertRecordWithID_fn, _deleteRecord, deleteRecord_fn, _deleteRecords, deleteRecords_fn, _setCacheQuery, setCacheQuery_fn, _getCacheQuery, getCacheQuery_fn, _getSchemaTables$1, getSchemaTables_fn$1;
3338
+ var _table, _getFetchProps, _db, _cache, _schemaTables$2, _trace, _insertRecordWithoutId, insertRecordWithoutId_fn, _insertRecordWithId, insertRecordWithId_fn, _insertRecords, insertRecords_fn, _updateRecordWithID, updateRecordWithID_fn, _updateRecords, updateRecords_fn, _upsertRecordWithID, upsertRecordWithID_fn, _deleteRecord, deleteRecord_fn, _deleteRecords, deleteRecords_fn, _setCacheQuery, setCacheQuery_fn, _getCacheQuery, getCacheQuery_fn, _getSchemaTables$1, getSchemaTables_fn$1, _transformObjectToApi, transformObjectToApi_fn;
2988
3339
  const BULK_OPERATION_MAX_SIZE = 1e3;
2989
3340
  class Repository extends Query {
2990
3341
  }
@@ -3006,6 +3357,7 @@ class RestRepository extends Query {
3006
3357
  __privateAdd$4(this, _setCacheQuery);
3007
3358
  __privateAdd$4(this, _getCacheQuery);
3008
3359
  __privateAdd$4(this, _getSchemaTables$1);
3360
+ __privateAdd$4(this, _transformObjectToApi);
3009
3361
  __privateAdd$4(this, _table, void 0);
3010
3362
  __privateAdd$4(this, _getFetchProps, void 0);
3011
3363
  __privateAdd$4(this, _db, void 0);
@@ -3397,23 +3749,28 @@ class RestRepository extends Query {
3397
3749
  });
3398
3750
  }
3399
3751
  ask(question, options) {
3752
+ const questionParam = options?.sessionId ? { message: question } : { question };
3400
3753
  const params = {
3401
3754
  pathParams: {
3402
3755
  workspace: "{workspaceId}",
3403
3756
  dbBranchName: "{dbBranch}",
3404
3757
  region: "{region}",
3405
- tableName: __privateGet$4(this, _table)
3758
+ tableName: __privateGet$4(this, _table),
3759
+ sessionId: options?.sessionId
3406
3760
  },
3407
3761
  body: {
3408
- question,
3409
- ...options
3762
+ ...questionParam,
3763
+ rules: options?.rules,
3764
+ searchType: options?.searchType,
3765
+ search: options?.searchType === "keyword" ? options?.search : void 0,
3766
+ vectorSearch: options?.searchType === "vector" ? options?.vectorSearch : void 0
3410
3767
  },
3411
3768
  ...__privateGet$4(this, _getFetchProps).call(this)
3412
3769
  };
3413
3770
  if (options?.onMessage) {
3414
3771
  fetchSSERequest({
3415
3772
  endpoint: "dataPlane",
3416
- url: "/db/{dbBranchName}/tables/{tableName}/ask",
3773
+ url: "/db/{dbBranchName}/tables/{tableName}/ask/{sessionId}",
3417
3774
  method: "POST",
3418
3775
  onMessage: (message) => {
3419
3776
  options.onMessage?.({ answer: message.text, records: message.records });
@@ -3421,7 +3778,7 @@ class RestRepository extends Query {
3421
3778
  ...params
3422
3779
  });
3423
3780
  } else {
3424
- return askTable(params);
3781
+ return askTableSession(params);
3425
3782
  }
3426
3783
  }
3427
3784
  }
@@ -3433,7 +3790,7 @@ _schemaTables$2 = new WeakMap();
3433
3790
  _trace = new WeakMap();
3434
3791
  _insertRecordWithoutId = new WeakSet();
3435
3792
  insertRecordWithoutId_fn = async function(object, columns = ["*"]) {
3436
- const record = transformObjectLinks(object);
3793
+ const record = await __privateMethod$2(this, _transformObjectToApi, transformObjectToApi_fn).call(this, object);
3437
3794
  const response = await insertRecord({
3438
3795
  pathParams: {
3439
3796
  workspace: "{workspaceId}",
@@ -3452,7 +3809,7 @@ _insertRecordWithId = new WeakSet();
3452
3809
  insertRecordWithId_fn = async function(recordId, object, columns = ["*"], { createOnly, ifVersion }) {
3453
3810
  if (!recordId)
3454
3811
  return null;
3455
- const record = transformObjectLinks(object);
3812
+ const record = await __privateMethod$2(this, _transformObjectToApi, transformObjectToApi_fn).call(this, object);
3456
3813
  const response = await insertRecordWithID({
3457
3814
  pathParams: {
3458
3815
  workspace: "{workspaceId}",
@@ -3470,21 +3827,20 @@ insertRecordWithId_fn = async function(recordId, object, columns = ["*"], { crea
3470
3827
  };
3471
3828
  _insertRecords = new WeakSet();
3472
3829
  insertRecords_fn = async function(objects, { createOnly, ifVersion }) {
3473
- const chunkedOperations = chunk(
3474
- objects.map((object) => ({
3475
- insert: { table: __privateGet$4(this, _table), record: transformObjectLinks(object), createOnly, ifVersion }
3476
- })),
3477
- BULK_OPERATION_MAX_SIZE
3478
- );
3830
+ const operations = await promiseMap(objects, async (object) => {
3831
+ const record = await __privateMethod$2(this, _transformObjectToApi, transformObjectToApi_fn).call(this, object);
3832
+ return { insert: { table: __privateGet$4(this, _table), record, createOnly, ifVersion } };
3833
+ });
3834
+ const chunkedOperations = chunk(operations, BULK_OPERATION_MAX_SIZE);
3479
3835
  const ids = [];
3480
- for (const operations of chunkedOperations) {
3836
+ for (const operations2 of chunkedOperations) {
3481
3837
  const { results } = await branchTransaction({
3482
3838
  pathParams: {
3483
3839
  workspace: "{workspaceId}",
3484
3840
  dbBranchName: "{dbBranch}",
3485
3841
  region: "{region}"
3486
3842
  },
3487
- body: { operations },
3843
+ body: { operations: operations2 },
3488
3844
  ...__privateGet$4(this, _getFetchProps).call(this)
3489
3845
  });
3490
3846
  for (const result of results) {
@@ -3501,7 +3857,7 @@ _updateRecordWithID = new WeakSet();
3501
3857
  updateRecordWithID_fn = async function(recordId, object, columns = ["*"], { ifVersion }) {
3502
3858
  if (!recordId)
3503
3859
  return null;
3504
- const { id: _id, ...record } = transformObjectLinks(object);
3860
+ const { id: _id, ...record } = await __privateMethod$2(this, _transformObjectToApi, transformObjectToApi_fn).call(this, object);
3505
3861
  try {
3506
3862
  const response = await updateRecordWithID({
3507
3863
  pathParams: {
@@ -3526,21 +3882,20 @@ updateRecordWithID_fn = async function(recordId, object, columns = ["*"], { ifVe
3526
3882
  };
3527
3883
  _updateRecords = new WeakSet();
3528
3884
  updateRecords_fn = async function(objects, { ifVersion, upsert }) {
3529
- const chunkedOperations = chunk(
3530
- objects.map(({ id, ...object }) => ({
3531
- update: { table: __privateGet$4(this, _table), id, ifVersion, upsert, fields: transformObjectLinks(object) }
3532
- })),
3533
- BULK_OPERATION_MAX_SIZE
3534
- );
3885
+ const operations = await promiseMap(objects, async ({ id, ...object }) => {
3886
+ const fields = await __privateMethod$2(this, _transformObjectToApi, transformObjectToApi_fn).call(this, object);
3887
+ return { update: { table: __privateGet$4(this, _table), id, ifVersion, upsert, fields } };
3888
+ });
3889
+ const chunkedOperations = chunk(operations, BULK_OPERATION_MAX_SIZE);
3535
3890
  const ids = [];
3536
- for (const operations of chunkedOperations) {
3891
+ for (const operations2 of chunkedOperations) {
3537
3892
  const { results } = await branchTransaction({
3538
3893
  pathParams: {
3539
3894
  workspace: "{workspaceId}",
3540
3895
  dbBranchName: "{dbBranch}",
3541
3896
  region: "{region}"
3542
3897
  },
3543
- body: { operations },
3898
+ body: { operations: operations2 },
3544
3899
  ...__privateGet$4(this, _getFetchProps).call(this)
3545
3900
  });
3546
3901
  for (const result of results) {
@@ -3643,7 +3998,39 @@ getSchemaTables_fn$1 = async function() {
3643
3998
  __privateSet$4(this, _schemaTables$2, schema.tables);
3644
3999
  return schema.tables;
3645
4000
  };
3646
- const transformObjectLinks = (object) => {
4001
+ _transformObjectToApi = new WeakSet();
4002
+ transformObjectToApi_fn = async function(object) {
4003
+ const schemaTables = await __privateMethod$2(this, _getSchemaTables$1, getSchemaTables_fn$1).call(this);
4004
+ const schema = schemaTables.find((table) => table.name === __privateGet$4(this, _table));
4005
+ if (!schema)
4006
+ throw new Error(`Table ${__privateGet$4(this, _table)} not found in schema`);
4007
+ const result = {};
4008
+ for (const [key, value] of Object.entries(object)) {
4009
+ if (key === "xata")
4010
+ continue;
4011
+ const type = schema.columns.find((column) => column.name === key)?.type;
4012
+ switch (type) {
4013
+ case "link": {
4014
+ result[key] = isIdentifiable(value) ? value.id : value;
4015
+ break;
4016
+ }
4017
+ case "datetime": {
4018
+ result[key] = value instanceof Date ? value.toISOString() : value;
4019
+ break;
4020
+ }
4021
+ case `file`:
4022
+ result[key] = await parseInputFileEntry(value);
4023
+ break;
4024
+ case "file[]":
4025
+ result[key] = await promiseMap(value, (item) => parseInputFileEntry(item));
4026
+ break;
4027
+ default:
4028
+ result[key] = value;
4029
+ }
4030
+ }
4031
+ return result;
4032
+ };
4033
+ const removeLinksFromObject = (object) => {
3647
4034
  return Object.entries(object).reduce((acc, [key, value]) => {
3648
4035
  if (key === "xata")
3649
4036
  return acc;
@@ -3692,6 +4079,12 @@ const initObject = (db, schemaTables, table, object, selectedColumns) => {
3692
4079
  }
3693
4080
  break;
3694
4081
  }
4082
+ case "file":
4083
+ data[column.name] = isDefined(value) ? new XataFile(value) : null;
4084
+ break;
4085
+ case "file[]":
4086
+ data[column.name] = value?.map((item) => new XataFile(item)) ?? null;
4087
+ break;
3695
4088
  default:
3696
4089
  data[column.name] = value ?? null;
3697
4090
  if (column.notNull === true && value === null) {
@@ -3701,7 +4094,7 @@ const initObject = (db, schemaTables, table, object, selectedColumns) => {
3701
4094
  }
3702
4095
  }
3703
4096
  const record = { ...data };
3704
- const serializable = { xata, ...transformObjectLinks(data) };
4097
+ const serializable = { xata, ...removeLinksFromObject(data) };
3705
4098
  const metadata = xata !== void 0 ? { ...xata, createdAt: new Date(xata.createdAt), updatedAt: new Date(xata.updatedAt) } : void 0;
3706
4099
  record.read = function(columns2) {
3707
4100
  return db[table].read(record["id"], columns2);
@@ -3727,7 +4120,7 @@ const initObject = (db, schemaTables, table, object, selectedColumns) => {
3727
4120
  return JSON.parse(JSON.stringify(serializable));
3728
4121
  };
3729
4122
  record.toString = function() {
3730
- return JSON.stringify(transformObjectLinks(serializable));
4123
+ return JSON.stringify(serializable);
3731
4124
  };
3732
4125
  for (const prop of ["read", "update", "replace", "delete", "getMetadata", "toSerializable", "toString"]) {
3733
4126
  Object.defineProperty(record, prop, { enumerable: false });
@@ -3745,11 +4138,7 @@ function extractId(value) {
3745
4138
  function isValidColumn(columns, column) {
3746
4139
  if (columns.includes("*"))
3747
4140
  return true;
3748
- if (column.type === "link") {
3749
- const linkColumns = columns.filter((item) => item.startsWith(column.name));
3750
- return linkColumns.length > 0;
3751
- }
3752
- return columns.includes(column.name);
4141
+ return columns.filter((item) => item.startsWith(column.name)).length > 0;
3753
4142
  }
3754
4143
  function parseIfVersion(...args) {
3755
4144
  for (const arg of args) {
@@ -3760,6 +4149,12 @@ function parseIfVersion(...args) {
3760
4149
  return void 0;
3761
4150
  }
3762
4151
 
4152
+ var __defProp$3 = Object.defineProperty;
4153
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4154
+ var __publicField$3 = (obj, key, value) => {
4155
+ __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
4156
+ return value;
4157
+ };
3763
4158
  var __accessCheck$3 = (obj, member, msg) => {
3764
4159
  if (!member.has(obj))
3765
4160
  throw TypeError("Cannot " + msg);
@@ -3782,6 +4177,8 @@ var _map;
3782
4177
  class SimpleCache {
3783
4178
  constructor(options = {}) {
3784
4179
  __privateAdd$3(this, _map, void 0);
4180
+ __publicField$3(this, "capacity");
4181
+ __publicField$3(this, "defaultQueryTTL");
3785
4182
  __privateSet$3(this, _map, /* @__PURE__ */ new Map());
3786
4183
  this.capacity = options.max ?? 500;
3787
4184
  this.defaultQueryTTL = options.defaultQueryTTL ?? 60 * 1e3;
@@ -3979,6 +4376,12 @@ class TransactionPlugin extends XataPlugin {
3979
4376
  }
3980
4377
  }
3981
4378
 
4379
+ var __defProp$2 = Object.defineProperty;
4380
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4381
+ var __publicField$2 = (obj, key, value) => {
4382
+ __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
4383
+ return value;
4384
+ };
3982
4385
  var __accessCheck = (obj, member, msg) => {
3983
4386
  if (!member.has(obj))
3984
4387
  throw TypeError("Cannot " + msg);
@@ -4008,6 +4411,10 @@ const buildClient = (plugins) => {
4008
4411
  __privateAdd(this, _parseOptions);
4009
4412
  __privateAdd(this, _getFetchProps);
4010
4413
  __privateAdd(this, _options, void 0);
4414
+ __publicField$2(this, "db");
4415
+ __publicField$2(this, "search");
4416
+ __publicField$2(this, "transactions");
4417
+ __publicField$2(this, "files");
4011
4418
  const safeOptions = __privateMethod(this, _parseOptions, parseOptions_fn).call(this, options);
4012
4419
  __privateSet(this, _options, safeOptions);
4013
4420
  const pluginOptions = {
@@ -4018,9 +4425,11 @@ const buildClient = (plugins) => {
4018
4425
  const db = new SchemaPlugin(schemaTables).build(pluginOptions);
4019
4426
  const search = new SearchPlugin(db, schemaTables).build(pluginOptions);
4020
4427
  const transactions = new TransactionPlugin().build(pluginOptions);
4428
+ const files = new FilesPlugin().build(pluginOptions);
4021
4429
  this.db = db;
4022
4430
  this.search = search;
4023
4431
  this.transactions = transactions;
4432
+ this.files = files;
4024
4433
  for (const [key, namespace] of Object.entries(plugins ?? {})) {
4025
4434
  if (namespace === void 0)
4026
4435
  continue;
@@ -4117,11 +4526,17 @@ const buildClient = (plugins) => {
4117
4526
  class BaseClient extends buildClient() {
4118
4527
  }
4119
4528
 
4529
+ var __defProp$1 = Object.defineProperty;
4530
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4531
+ var __publicField$1 = (obj, key, value) => {
4532
+ __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
4533
+ return value;
4534
+ };
4120
4535
  const META = "__";
4121
4536
  const VALUE = "___";
4122
4537
  class Serializer {
4123
4538
  constructor() {
4124
- this.classes = {};
4539
+ __publicField$1(this, "classes", {});
4125
4540
  }
4126
4541
  add(clazz) {
4127
4542
  this.classes[clazz.name] = clazz;
@@ -4199,12 +4614,19 @@ function buildWorkerRunner(config) {
4199
4614
  };
4200
4615
  }
4201
4616
 
4617
+ var __defProp = Object.defineProperty;
4618
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4619
+ var __publicField = (obj, key, value) => {
4620
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4621
+ return value;
4622
+ };
4202
4623
  class XataError extends Error {
4203
4624
  constructor(message, status) {
4204
4625
  super(message);
4626
+ __publicField(this, "status");
4205
4627
  this.status = status;
4206
4628
  }
4207
4629
  }
4208
4630
 
4209
- export { BaseClient, FetcherError, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Query, RecordArray, Repository, RestRepository, SchemaPlugin, SearchPlugin, Serializer, SimpleCache, XataApiClient, XataApiPlugin, XataError, XataPlugin, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, aggregateTable, applyBranchSchemaEdit, askTable, branchTransaction, buildClient, buildPreviewBranchName, buildProviderString, buildWorkerRunner, bulkInsertTableRecords, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, copyBranch, createBranch, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteDatabaseGithubSettings, deleteFile, deleteFileItem, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, fileAccess, ge, getAPIKey, getBranch, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getColumn, getDatabaseGithubSettings, getDatabaseList, getDatabaseMetadata, getDatabaseURL, getFile, getFileItem, getGitBranchesMapping, getHostUrl, getMigrationRequest, getMigrationRequestIsMerged, getPreviewBranch, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, greaterEquals, greaterThan, greaterThanEquals, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isHostProviderAlias, isHostProviderBuilder, isIdentifiable, isNot, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listMigrationRequestsCommits, listRegions, lt, lte, mergeMigrationRequest, notExists, operationsByTag, parseProviderString, parseWorkspacesUrlParts, pattern, previewBranchSchemaEdit, pushBranchMigrations, putFile, putFileItem, queryMigrationRequests, queryTable, removeGitBranchesEntry, removeWorkspaceMember, renameDatabase, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, sqlQuery, startsWith, summarizeTable, updateBranchMetadata, updateBranchSchema, updateColumn, updateDatabaseGithubSettings, updateDatabaseMetadata, updateMigrationRequest, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID, vectorSearchTable };
4631
+ export { BaseClient, FetcherError, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Query, RecordArray, RecordColumnTypes, Repository, RestRepository, SchemaPlugin, SearchPlugin, Serializer, SimpleCache, XataApiClient, XataApiPlugin, XataError, XataFile, XataPlugin, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, aggregateTable, applyBranchSchemaEdit, askTable, askTableSession, branchTransaction, buildClient, buildPreviewBranchName, buildProviderString, buildWorkerRunner, bulkInsertTableRecords, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, copyBranch, createBranch, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteDatabaseGithubSettings, deleteFile, deleteFileItem, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, fileAccess, ge, generateAccessToken, getAPIKey, getBranch, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getColumn, getDatabaseGithubSettings, getDatabaseList, getDatabaseMetadata, getDatabaseURL, getFile, getFileItem, getGitBranchesMapping, getHostUrl, getMigrationRequest, getMigrationRequestIsMerged, getPreviewBranch, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, grantAuthorizationCode, greaterEquals, greaterThan, greaterThanEquals, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isHostProviderAlias, isHostProviderBuilder, isIdentifiable, isNot, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listMigrationRequestsCommits, listRegions, lt, lte, mergeMigrationRequest, notExists, operationsByTag, parseProviderString, parseWorkspacesUrlParts, pattern, previewBranchSchemaEdit, pushBranchMigrations, putFile, putFileItem, queryMigrationRequests, queryTable, removeGitBranchesEntry, removeWorkspaceMember, renameDatabase, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, sqlQuery, startsWith, summarizeTable, updateBranchMetadata, updateBranchSchema, updateColumn, updateDatabaseGithubSettings, updateDatabaseMetadata, updateMigrationRequest, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID, vectorSearchTable };
4210
4632
  //# sourceMappingURL=index.mjs.map