@xata.io/client 0.0.0-alpha.f75afb4 → 0.0.0-beta.09892c4
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 +6 -0
- package/dist/api/client.d.ts +1 -1
- package/dist/api/client.js +4 -3
- package/dist/schema/repository.js +4 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/api/client.d.ts
CHANGED
package/dist/api/client.js
CHANGED
@@ -17,14 +17,15 @@ const components_1 = require("./components");
|
|
17
17
|
const providers_1 = require("./providers");
|
18
18
|
class XataApiClient {
|
19
19
|
constructor(options) {
|
20
|
-
var _a;
|
20
|
+
var _a, _b;
|
21
21
|
_XataApiClient_extraProps.set(this, void 0);
|
22
|
-
const
|
22
|
+
const globalFetch = typeof fetch !== 'undefined' ? fetch : undefined;
|
23
|
+
const fetchImpl = (_a = options.fetch) !== null && _a !== void 0 ? _a : globalFetch;
|
23
24
|
if (!fetchImpl) {
|
24
25
|
/** @todo add a link after docs exist */
|
25
26
|
throw new Error(`The \`fetch\` option passed to the Xata client is resolving to a falsy value and may not be correctly imported.`);
|
26
27
|
}
|
27
|
-
const provider = (
|
28
|
+
const provider = (_b = options.host) !== null && _b !== void 0 ? _b : 'production';
|
28
29
|
__classPrivateFieldSet(this, _XataApiClient_extraProps, {
|
29
30
|
apiUrl: (0, providers_1.getHostUrl)(provider, 'main'),
|
30
31
|
workspacesApiUrl: (0, providers_1.getHostUrl)(provider, 'workspaces'),
|
@@ -41,6 +41,7 @@ class Repository extends query_1.Query {
|
|
41
41
|
exports.Repository = Repository;
|
42
42
|
class RestRepository extends Repository {
|
43
43
|
constructor(client, table) {
|
44
|
+
var _a;
|
44
45
|
super(null, table, {});
|
45
46
|
_RestRepository_instances.add(this);
|
46
47
|
_RestRepository_client.set(this, void 0);
|
@@ -49,8 +50,10 @@ class RestRepository extends Repository {
|
|
49
50
|
__classPrivateFieldSet(this, _RestRepository_client, client, "f");
|
50
51
|
__classPrivateFieldSet(this, _RestRepository_table, table, "f");
|
51
52
|
// TODO: Remove when integrating with API client
|
52
|
-
const
|
53
|
+
const globalFetch = typeof fetch !== 'undefined' ? fetch : undefined;
|
54
|
+
const fetchImpl = (_a = __classPrivateFieldGet(this, _RestRepository_client, "f").options.fetch) !== null && _a !== void 0 ? _a : globalFetch;
|
53
55
|
if (!fetchImpl) {
|
56
|
+
/** @todo add a link after docs exist */
|
54
57
|
throw new Error(`The \`fetch\` option passed to the Xata client is resolving to a falsy value and may not be correctly imported.`);
|
55
58
|
}
|
56
59
|
__classPrivateFieldSet(this, _RestRepository_fetch, fetchImpl, "f");
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@xata.io/client",
|
3
|
-
"version": "0.0.0-
|
3
|
+
"version": "0.0.0-beta.09892c4",
|
4
4
|
"description": "Xata.io SDK for TypeScript and JavaScript",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"types": "./dist/index.d.ts",
|
@@ -20,5 +20,5 @@
|
|
20
20
|
"url": "https://github.com/xataio/client-ts/issues"
|
21
21
|
},
|
22
22
|
"homepage": "https://github.com/xataio/client-ts/blob/main/client/README.md",
|
23
|
-
"gitHead": "
|
23
|
+
"gitHead": "09892c40a01ece59c802844310aac17aba7a281c"
|
24
24
|
}
|