@xata.io/client 0.22.1 → 0.22.2

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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @xata.io/client@0.22.1 add-version /home/runner/work/client-ts/client-ts/packages/client
2
+ > @xata.io/client@0.22.2 add-version /home/runner/work/client-ts/client-ts/packages/client
3
3
  > node ../../scripts/add-version-file.mjs
4
4
 
@@ -1,13 +1,13 @@
1
1
 
2
- > @xata.io/client@0.22.1 build /home/runner/work/client-ts/client-ts/packages/client
2
+ > @xata.io/client@0.22.2 build /home/runner/work/client-ts/client-ts/packages/client
3
3
  > rimraf dist && rollup -c
4
4
 
5
5
  
6
6
  src/index.ts → dist/index.cjs...
7
- created dist/index.cjs in 1s
7
+ created dist/index.cjs in 1.2s
8
8
  
9
9
  src/index.ts → dist/index.mjs...
10
- created dist/index.mjs in 947ms
10
+ created dist/index.mjs in 1.1s
11
11
  
12
12
  src/index.ts → dist/index.d.ts...
13
- created dist/index.d.ts in 6.6s
13
+ created dist/index.d.ts in 6.9s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @xata.io/client
2
2
 
3
+ ## 0.22.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#898](https://github.com/xataio/client-ts/pull/898) [`72e13bf9`](https://github.com/xataio/client-ts/commit/72e13bf99d0ebefef91c984a995a28b0e8ca2a8f) Thanks [@SferaDev](https://github.com/SferaDev)! - Add methods for vector type
8
+
3
9
  ## 0.22.1
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -302,7 +302,7 @@ function generateUUID() {
302
302
  });
303
303
  }
304
304
 
305
- const VERSION = "0.22.1";
305
+ const VERSION = "0.22.2";
306
306
 
307
307
  class ErrorWithCause extends Error {
308
308
  constructor(message, options) {
@@ -613,6 +613,7 @@ const searchTable = (variables, signal) => dataPlaneFetch({
613
613
  ...variables,
614
614
  signal
615
615
  });
616
+ const vectorSearchTable = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/vectorSearch", method: "post", ...variables, signal });
616
617
  const summarizeTable = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/summarize", method: "post", ...variables, signal });
617
618
  const aggregateTable = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/aggregate", method: "post", ...variables, signal });
618
619
  const operationsByTag$2 = {
@@ -672,7 +673,7 @@ const operationsByTag$2 = {
672
673
  deleteRecord,
673
674
  bulkInsertTableRecords
674
675
  },
675
- searchAndFilter: { queryTable, searchBranch, searchTable, summarizeTable, aggregateTable }
676
+ searchAndFilter: { queryTable, searchBranch, searchTable, vectorSearchTable, summarizeTable, aggregateTable }
676
677
  };
677
678
 
678
679
  const controlPlaneFetch = async (options) => fetch$1({ ...options, endpoint: "controlPlane" });
@@ -829,8 +830,8 @@ const providers = {
829
830
  workspaces: "https://{workspaceId}.{region}.xata.sh"
830
831
  },
831
832
  staging: {
832
- main: "https://staging.xatabase.co",
833
- workspaces: "https://{workspaceId}.staging.{region}.xatabase.co"
833
+ main: "https://api.staging-xata.dev",
834
+ workspaces: "https://{workspaceId}.{region}.staging-xata.dev"
834
835
  }
835
836
  };
836
837
  function isHostProviderAlias(alias) {
@@ -852,9 +853,10 @@ function parseWorkspacesUrlParts(url) {
852
853
  if (!isString(url))
853
854
  return null;
854
855
  const regex = /(?:https:\/\/)?([^.]+)(?:\.([^.]+))\.xata\.sh.*/;
855
- const regexStaging = /(?:https:\/\/)?([^.]+)\.staging(?:\.([^.]+))\.xatabase\.co.*/;
856
- const regexDev = /(?:https:\/\/)?([^.]+)\.staging(?:\.([^.]+))\.xata\.tech.*/;
857
- const match = url.match(regex) || url.match(regexStaging) || url.match(regexDev);
856
+ const regexDev = /(?:https:\/\/)?([^.]+)(?:\.([^.]+))\.dev-xata\.dev.*/;
857
+ const regexStaging = /(?:https:\/\/)?([^.]+)(?:\.([^.]+))\.staging-xata\.dev.*/;
858
+ const regexProdTesting = /(?:https:\/\/)?([^.]+)(?:\.([^.]+))\.xata\.tech.*/;
859
+ const match = url.match(regex) || url.match(regexDev) || url.match(regexStaging) || url.match(regexProdTesting);
858
860
  if (!match)
859
861
  return null;
860
862
  return { workspace: match[1], region: match[2] };
@@ -2615,6 +2617,29 @@ class RestRepository extends Query {
2615
2617
  return records.map((item) => initObject(__privateGet$4(this, _db), schemaTables, __privateGet$4(this, _table), item, ["*"]));
2616
2618
  });
2617
2619
  }
2620
+ async vectorSearch(column, query, options) {
2621
+ return __privateGet$4(this, _trace).call(this, "vectorSearch", async () => {
2622
+ const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
2623
+ const { records } = await vectorSearchTable({
2624
+ pathParams: {
2625
+ workspace: "{workspaceId}",
2626
+ dbBranchName: "{dbBranch}",
2627
+ region: "{region}",
2628
+ tableName: __privateGet$4(this, _table)
2629
+ },
2630
+ body: {
2631
+ column,
2632
+ queryVector: query,
2633
+ similarityFunction: options?.similarityFunction,
2634
+ size: options?.size,
2635
+ filter: options?.filter
2636
+ },
2637
+ ...fetchProps
2638
+ });
2639
+ const schemaTables = await __privateMethod$2(this, _getSchemaTables$1, getSchemaTables_fn$1).call(this);
2640
+ return records.map((item) => initObject(__privateGet$4(this, _db), schemaTables, __privateGet$4(this, _table), item, ["*"]));
2641
+ });
2642
+ }
2618
2643
  async aggregate(aggs, filter) {
2619
2644
  return __privateGet$4(this, _trace).call(this, "aggregate", async () => {
2620
2645
  const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
@@ -3707,4 +3732,5 @@ exports.updateWorkspace = updateWorkspace;
3707
3732
  exports.updateWorkspaceMemberInvite = updateWorkspaceMemberInvite;
3708
3733
  exports.updateWorkspaceMemberRole = updateWorkspaceMemberRole;
3709
3734
  exports.upsertRecordWithID = upsertRecordWithID;
3735
+ exports.vectorSearchTable = vectorSearchTable;
3710
3736
  //# sourceMappingURL=index.cjs.map