@xata.io/client 0.0.0-alpha.vf170c2c → 0.0.0-alpha.vf231460

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.d.ts CHANGED
@@ -3174,7 +3174,8 @@ declare type SchemaPluginResult<Schemas extends Record<string, BaseData>> = {
3174
3174
  declare class SchemaPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
3175
3175
  #private;
3176
3176
  private links?;
3177
- constructor(links?: LinkDictionary | undefined);
3177
+ private tableNames?;
3178
+ constructor(links?: LinkDictionary | undefined, tableNames?: string[] | undefined);
3178
3179
  build(options: XataPluginOptions): SchemaPluginResult<Schemas>;
3179
3180
  }
3180
3181
 
package/dist/index.mjs CHANGED
@@ -1381,9 +1381,10 @@ var __privateAdd$2 = (obj, member, value) => {
1381
1381
  };
1382
1382
  var _tables;
1383
1383
  class SchemaPlugin extends XataPlugin {
1384
- constructor(links) {
1384
+ constructor(links, tableNames) {
1385
1385
  super();
1386
1386
  this.links = links;
1387
+ this.tableNames = tableNames;
1387
1388
  __privateAdd$2(this, _tables, {});
1388
1389
  }
1389
1390
  build(options) {
@@ -1398,6 +1399,9 @@ class SchemaPlugin extends XataPlugin {
1398
1399
  return __privateGet$1(this, _tables)[table];
1399
1400
  }
1400
1401
  });
1402
+ for (const table of this.tableNames ?? []) {
1403
+ db[table] = new RestRepository({ db, getFetchProps, table, links });
1404
+ }
1401
1405
  return db;
1402
1406
  }
1403
1407
  }
@@ -1564,13 +1568,13 @@ var __privateMethod = (obj, member, method) => {
1564
1568
  const buildClient = (plugins) => {
1565
1569
  var _branch, _parseOptions, parseOptions_fn, _getFetchProps, getFetchProps_fn, _evaluateBranch, evaluateBranch_fn, _a;
1566
1570
  return _a = class {
1567
- constructor(options = {}, links) {
1571
+ constructor(options = {}, links, tables) {
1568
1572
  __privateAdd(this, _parseOptions);
1569
1573
  __privateAdd(this, _getFetchProps);
1570
1574
  __privateAdd(this, _evaluateBranch);
1571
1575
  __privateAdd(this, _branch, void 0);
1572
1576
  const safeOptions = __privateMethod(this, _parseOptions, parseOptions_fn).call(this, options);
1573
- const db = new SchemaPlugin(links).build({ getFetchProps: () => __privateMethod(this, _getFetchProps, getFetchProps_fn).call(this, safeOptions) });
1577
+ const db = new SchemaPlugin(links, tables).build({ getFetchProps: () => __privateMethod(this, _getFetchProps, getFetchProps_fn).call(this, safeOptions) });
1574
1578
  const search = new SearchPlugin(db, links ?? {}).build({
1575
1579
  getFetchProps: () => __privateMethod(this, _getFetchProps, getFetchProps_fn).call(this, safeOptions)
1576
1580
  });