@xata.io/client 0.10.1 → 0.10.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @xata.io/client
2
2
 
3
+ ## 0.10.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#312](https://github.com/xataio/client-ts/pull/312) [`0edf1af`](https://github.com/xataio/client-ts/commit/0edf1af2205c4761d53a02c74ddaab3168d69775) Thanks [@SferaDev](https://github.com/SferaDev)! - Add filtering to search by table
8
+
9
+ * [#312](https://github.com/xataio/client-ts/pull/312) [`66ad7cc`](https://github.com/xataio/client-ts/commit/66ad7cc0365046c5d039c37117feac04428d8373) Thanks [@SferaDev](https://github.com/SferaDev)! - Add new API method for searching in a given table
10
+
3
11
  ## 0.10.1
4
12
 
5
13
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -370,6 +370,11 @@ const queryTable = (variables) => fetch$1({
370
370
  method: "post",
371
371
  ...variables
372
372
  });
373
+ const searchTable = (variables) => fetch$1({
374
+ url: "/db/{dbBranchName}/tables/{tableName}/search",
375
+ method: "post",
376
+ ...variables
377
+ });
373
378
  const searchBranch = (variables) => fetch$1({
374
379
  url: "/db/{dbBranchName}/search",
375
380
  method: "post",
@@ -433,6 +438,7 @@ const operationsByTag = {
433
438
  getRecord,
434
439
  bulkInsertTableRecords,
435
440
  queryTable,
441
+ searchTable,
436
442
  searchBranch
437
443
  }
438
444
  };
@@ -888,6 +894,13 @@ class RecordsApi {
888
894
  ...this.extraProps
889
895
  });
890
896
  }
897
+ searchTable(workspace, database, branch, tableName, query) {
898
+ return operationsByTag.records.searchTable({
899
+ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
900
+ body: query,
901
+ ...this.extraProps
902
+ });
903
+ }
891
904
  searchBranch(workspace, database, branch, query) {
892
905
  return operationsByTag.records.searchBranch({
893
906
  pathParams: { workspace, dbBranchName: `${database}:${branch}` },
@@ -1296,9 +1309,13 @@ class RestRepository extends Query {
1296
1309
  }
1297
1310
  async search(query, options = {}) {
1298
1311
  const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
1299
- const { records } = await searchBranch({
1300
- pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}" },
1301
- body: { tables: [__privateGet$4(this, _table)], query, fuzziness: options.fuzziness },
1312
+ const { records } = await searchTable({
1313
+ pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", tableName: __privateGet$4(this, _table) },
1314
+ body: {
1315
+ query,
1316
+ fuzziness: options.fuzziness,
1317
+ filter: options.filter
1318
+ },
1302
1319
  ...fetchProps
1303
1320
  });
1304
1321
  const schema = await __privateMethod$2(this, _getSchema$1, getSchema_fn$1).call(this);
@@ -2007,6 +2024,7 @@ exports.removeWorkspaceMember = removeWorkspaceMember;
2007
2024
  exports.resendWorkspaceMemberInvite = resendWorkspaceMemberInvite;
2008
2025
  exports.resolveBranch = resolveBranch;
2009
2026
  exports.searchBranch = searchBranch;
2027
+ exports.searchTable = searchTable;
2010
2028
  exports.setTableSchema = setTableSchema;
2011
2029
  exports.startsWith = startsWith;
2012
2030
  exports.updateBranchMetadata = updateBranchMetadata;