@xata.io/client 0.22.1 → 0.22.3
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/.turbo/turbo-add-version.log +1 -1
- package/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +12 -0
- package/dist/index.cjs +33 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +196 -8
- package/dist/index.mjs +33 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/.turbo/turbo-build.log
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
|
2
|
-
> @xata.io/client@0.22.
|
2
|
+
> @xata.io/client@0.22.3 build /home/runner/work/client-ts/client-ts/packages/client
|
3
3
|
> rimraf dist && rollup -c
|
4
4
|
|
5
5
|
[36m
|
6
6
|
[1msrc/index.ts[22m → [1mdist/index.cjs[22m...[39m
|
7
|
-
[32mcreated [1mdist/index.cjs[22m in [
|
7
|
+
[32mcreated [1mdist/index.cjs[22m in [1m1.7s[22m[39m
|
8
8
|
[36m
|
9
9
|
[1msrc/index.ts[22m → [1mdist/index.mjs[22m...[39m
|
10
|
-
[32mcreated [1mdist/index.mjs[22m in [
|
10
|
+
[32mcreated [1mdist/index.mjs[22m in [1m1.4s[22m[39m
|
11
11
|
[36m
|
12
12
|
[1msrc/index.ts[22m → [1mdist/index.d.ts[22m...[39m
|
13
|
-
[32mcreated [1mdist/index.d.ts[22m in [
|
13
|
+
[32mcreated [1mdist/index.d.ts[22m in [1m7.9s[22m[39m
|
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @xata.io/client
|
2
2
|
|
3
|
+
## 0.22.3
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#917](https://github.com/xataio/client-ts/pull/917) [`4210b8c3`](https://github.com/xataio/client-ts/commit/4210b8c3c4169ba781a56deed7ba09c99788db1f) Thanks [@xata-bot](https://github.com/xata-bot)! - [OpenAPI] Spec updates to add better types to Record input
|
8
|
+
|
9
|
+
## 0.22.2
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- [#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
|
14
|
+
|
3
15
|
## 0.22.1
|
4
16
|
|
5
17
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
@@ -302,7 +302,7 @@ function generateUUID() {
|
|
302
302
|
});
|
303
303
|
}
|
304
304
|
|
305
|
-
const VERSION = "0.22.
|
305
|
+
const VERSION = "0.22.3";
|
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.
|
833
|
-
workspaces: "https://{workspaceId}.
|
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
|
856
|
-
const
|
857
|
-
const
|
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
|