@xata.io/client 0.0.0-alpha.vea30e82 → 0.0.0-alpha.vf71bb14

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,20 @@
1
1
  # @xata.io/client
2
2
 
3
+ ## 0.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 3d81e7a: Make db model references stable
8
+
9
+ ## 0.8.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 5110261: Fix execution from the browser
14
+ - aa3d7e7: Allow sending sort as in the API
15
+ - 0047193: Add new plugin system for the SDK
16
+ - 43856a5: Add discriminated union search
17
+
3
18
  ## 0.8.0
4
19
 
5
20
  ### Patch Changes
@@ -10,7 +10,7 @@ export interface XataApiClientOptions {
10
10
  }
11
11
  export declare class XataApiClient {
12
12
  #private;
13
- constructor(options?: XataApiClientOptions);
13
+ constructor(options: XataApiClientOptions);
14
14
  get user(): UserApi;
15
15
  get workspaces(): WorkspaceApi;
16
16
  get databases(): DatabaseApi;
@@ -18,7 +18,7 @@ const fetch_1 = require("../util/fetch");
18
18
  const components_1 = require("./components");
19
19
  const providers_1 = require("./providers");
20
20
  class XataApiClient {
21
- constructor(options = {}) {
21
+ constructor(options) {
22
22
  var _a, _b;
23
23
  _XataApiClient_extraProps.set(this, void 0);
24
24
  _XataApiClient_namespaces.set(this, {});
@@ -5,6 +5,7 @@ import type * as Responses from './responses';
5
5
  import type * as Schemas from './schemas';
6
6
  export * from './client';
7
7
  export * from './components';
8
+ export type { FetcherExtraProps, FetchImpl } from './fetcher';
8
9
  export { operationsByTag as Operations };
9
10
  export type { Responses, Schemas };
10
11
  export declare class XataApiPlugin implements XataPlugin {
@@ -17,6 +17,7 @@ export declare type SchemaPluginResult<Schemas extends Record<string, BaseData>>
17
17
  [Key in keyof Schemas]: Repository<Schemas[Key]>;
18
18
  };
19
19
  export declare class SchemaPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
20
+ #private;
20
21
  private links?;
21
22
  constructor(links?: LinkDictionary | undefined);
22
23
  build(options: XataPluginOptions): SchemaPluginResult<Schemas>;
@@ -13,6 +13,12 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
17
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
18
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
19
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
20
+ };
21
+ var _SchemaPlugin_tables;
16
22
  Object.defineProperty(exports, "__esModule", { value: true });
17
23
  exports.SchemaPlugin = exports.RestRepository = exports.Repository = exports.isXataRecord = exports.isIdentifiable = exports.Query = void 0;
18
24
  const plugins_1 = require("../plugins");
@@ -33,6 +39,7 @@ class SchemaPlugin extends plugins_1.XataPlugin {
33
39
  constructor(links) {
34
40
  super();
35
41
  this.links = links;
42
+ _SchemaPlugin_tables.set(this, {});
36
43
  }
37
44
  build(options) {
38
45
  const { getFetchProps } = options;
@@ -41,10 +48,13 @@ class SchemaPlugin extends plugins_1.XataPlugin {
41
48
  get: (_target, table) => {
42
49
  if (!(0, lang_1.isString)(table))
43
50
  throw new Error('Invalid table name');
44
- return new repository_1.RestRepository({ db, getFetchProps, table, links });
51
+ if (!__classPrivateFieldGet(this, _SchemaPlugin_tables, "f")[table])
52
+ __classPrivateFieldGet(this, _SchemaPlugin_tables, "f")[table] = new repository_1.RestRepository({ db, getFetchProps, table, links });
53
+ return __classPrivateFieldGet(this, _SchemaPlugin_tables, "f")[table];
45
54
  }
46
55
  });
47
56
  return db;
48
57
  }
49
58
  }
50
59
  exports.SchemaPlugin = SchemaPlugin;
60
+ _SchemaPlugin_tables = new WeakMap();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xata.io/client",
3
- "version": "0.0.0-alpha.vea30e82",
3
+ "version": "0.0.0-alpha.vf71bb14",
4
4
  "description": "Xata.io SDK for TypeScript and JavaScript",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -23,5 +23,5 @@
23
23
  "url": "https://github.com/xataio/client-ts/issues"
24
24
  },
25
25
  "homepage": "https://github.com/xataio/client-ts/blob/main/client/README.md",
26
- "gitHead": "ea30e82a7fa5bbecbdb38b6dac6854cd926c2db1"
26
+ "gitHead": "f71bb140519b0fbfb4229bc807d34595114188ce"
27
27
  }