@xata.io/client
Advanced tools
Comparing version 0.0.0-alpha.c96016f to 0.0.0-alpha.cab0abc
@@ -32,2 +32,3 @@ "use strict"; | ||
exports.XataError = exports.BaseClient = exports.RestRespositoryFactory = exports.RestRepository = exports.Repository = exports.Query = exports.includesAll = exports.includesPattern = exports.includesSubstring = exports.includes = exports.contains = exports.isNot = exports.is = exports.pattern = exports.endsWith = exports.startsWith = exports.notExists = exports.exists = exports.le = exports.lte = exports.lt = exports.gte = exports.ge = exports.gt = void 0; | ||
const errors_1 = require("./util/errors"); | ||
const gt = (value) => ({ $gt: value }); | ||
@@ -271,6 +272,13 @@ exports.gt = gt; | ||
this.client = client; | ||
const fetchImpl = typeof fetch !== 'undefined' ? fetch : this.client.options.fetch; | ||
if (!fetchImpl) | ||
throw new Error('No fetch implementation provided'); | ||
this.fetch = fetchImpl; | ||
const doWeHaveFetch = typeof fetch !== 'undefined'; | ||
const isInjectedFetchProblematic = !this.client.options.fetch; | ||
if (doWeHaveFetch) { | ||
this.fetch = fetch; | ||
} | ||
else if (isInjectedFetchProblematic) { | ||
throw new Error(errors_1.errors.falsyFetchImplementation); | ||
} | ||
else { | ||
this.fetch = this.client.options.fetch; | ||
} | ||
Object.defineProperty(this, 'client', { enumerable: false }); | ||
@@ -284,4 +292,3 @@ Object.defineProperty(this, 'fetch', { enumerable: false }); | ||
const branch = yield this.client.getBranch(); | ||
const fetchImpl = this.fetch; | ||
const resp = yield fetchImpl(`${databaseURL}:${branch}${path}`, { | ||
const resp = yield this.fetch(`${databaseURL}:${branch}${path}`, { | ||
method, | ||
@@ -288,0 +295,0 @@ headers: { |
{ | ||
"name": "@xata.io/client", | ||
"version": "0.0.0-alpha.c96016f", | ||
"version": "0.0.0-alpha.cab0abc", | ||
"description": "Xata.io SDK for TypeScript and JavaScript", | ||
@@ -23,3 +23,3 @@ "main": "./dist/index.js", | ||
"homepage": "https://github.com/xataio/client-ts/blob/main/client/README.md", | ||
"gitHead": "c96016fa843439cb0cb07126d41335c350d97416" | ||
"gitHead": "cab0abc1be6f9b4bb718a79fd627880e33d1b19e" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42347
707