@xata.io/client 0.21.1 → 0.21.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 +8 -0
- package/dist/index.cjs +15 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +15 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# @xata.io/client
|
2
2
|
|
3
|
+
## 0.21.2
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#787](https://github.com/xataio/client-ts/pull/787) [`93f5beed`](https://github.com/xataio/client-ts/commit/93f5beed77785b03409c614f5e2c3eca4c69c574) Thanks [@SferaDev](https://github.com/SferaDev)! - Expose consistency options
|
8
|
+
|
9
|
+
- [#784](https://github.com/xataio/client-ts/pull/784) [`cbe0609e`](https://github.com/xataio/client-ts/commit/cbe0609ec9d6650030efbda712a1eb243287525d) Thanks [@SferaDev](https://github.com/SferaDev)! - Update resolveBranch behaviour
|
10
|
+
|
3
11
|
## 0.21.1
|
4
12
|
|
5
13
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
@@ -297,7 +297,7 @@ enqueue_fn = function(task) {
|
|
297
297
|
return promise;
|
298
298
|
};
|
299
299
|
|
300
|
-
const VERSION = "0.21.
|
300
|
+
const VERSION = "0.21.2";
|
301
301
|
|
302
302
|
class ErrorWithCause extends Error {
|
303
303
|
constructor(message, options) {
|
@@ -2050,6 +2050,7 @@ const _Query = class {
|
|
2050
2050
|
__privateGet$5(this, _data).filter.$none = data.filter?.$none ?? parent?.filter?.$none;
|
2051
2051
|
__privateGet$5(this, _data).sort = data.sort ?? parent?.sort;
|
2052
2052
|
__privateGet$5(this, _data).columns = data.columns ?? parent?.columns;
|
2053
|
+
__privateGet$5(this, _data).consistency = data.consistency ?? parent?.consistency;
|
2053
2054
|
__privateGet$5(this, _data).pagination = data.pagination ?? parent?.pagination;
|
2054
2055
|
__privateGet$5(this, _data).cache = data.cache ?? parent?.cache;
|
2055
2056
|
__privateGet$5(this, _data).fetchOptions = data.fetchOptions ?? parent?.fetchOptions;
|
@@ -2610,7 +2611,8 @@ class RestRepository extends Query {
|
|
2610
2611
|
filter: cleanFilter(data.filter),
|
2611
2612
|
sort: data.sort !== void 0 ? buildSortFilter(data.sort) : void 0,
|
2612
2613
|
page: data.pagination,
|
2613
|
-
columns: data.columns ?? ["*"]
|
2614
|
+
columns: data.columns ?? ["*"],
|
2615
|
+
consistency: data.consistency
|
2614
2616
|
},
|
2615
2617
|
fetchOptions: data.fetchOptions,
|
2616
2618
|
...fetchProps
|
@@ -2638,6 +2640,7 @@ class RestRepository extends Query {
|
|
2638
2640
|
filter: cleanFilter(data.filter),
|
2639
2641
|
sort: data.sort !== void 0 ? buildSortFilter(data.sort) : void 0,
|
2640
2642
|
columns: data.columns,
|
2643
|
+
consistency: data.consistency,
|
2641
2644
|
page: data.pagination?.size !== void 0 ? { size: data.pagination?.size } : void 0,
|
2642
2645
|
summaries,
|
2643
2646
|
summariesFilter
|
@@ -3200,12 +3203,8 @@ const isBranchStrategyBuilder = (strategy) => {
|
|
3200
3203
|
|
3201
3204
|
async function getCurrentBranchName(options) {
|
3202
3205
|
const { branch, envBranch } = getEnvironment();
|
3203
|
-
if (branch)
|
3204
|
-
|
3205
|
-
if (details)
|
3206
|
-
return branch;
|
3207
|
-
console.warn(`Branch ${branch} not found in Xata. Ignoring...`);
|
3208
|
-
}
|
3206
|
+
if (branch)
|
3207
|
+
return branch;
|
3209
3208
|
const gitBranch = envBranch || await getGitBranch();
|
3210
3209
|
return resolveXataBranch(gitBranch, options);
|
3211
3210
|
}
|
@@ -3237,7 +3236,8 @@ async function resolveXataBranch(gitBranch, options) {
|
|
3237
3236
|
workspacesApiUrl: `${protocol}//${host}`,
|
3238
3237
|
pathParams: { dbName, workspace, region },
|
3239
3238
|
queryParams: { gitBranch, fallbackBranch },
|
3240
|
-
trace: defaultTrace
|
3239
|
+
trace: defaultTrace,
|
3240
|
+
clientName: options?.clientName
|
3241
3241
|
});
|
3242
3242
|
return branch;
|
3243
3243
|
}
|
@@ -3357,7 +3357,12 @@ const buildClient = (plugins) => {
|
|
3357
3357
|
const cache = options?.cache ?? new SimpleCache({ defaultQueryTTL: 0 });
|
3358
3358
|
const trace = options?.trace ?? defaultTrace;
|
3359
3359
|
const clientName = options?.clientName;
|
3360
|
-
const branch = async () => options?.branch !== void 0 ? await __privateMethod(this, _evaluateBranch, evaluateBranch_fn).call(this, options.branch) : await getCurrentBranchName({
|
3360
|
+
const branch = async () => options?.branch !== void 0 ? await __privateMethod(this, _evaluateBranch, evaluateBranch_fn).call(this, options.branch) : await getCurrentBranchName({
|
3361
|
+
apiKey,
|
3362
|
+
databaseURL,
|
3363
|
+
fetchImpl: options?.fetch,
|
3364
|
+
clientName: options?.clientName
|
3365
|
+
});
|
3361
3366
|
if (!apiKey) {
|
3362
3367
|
throw new Error("Option apiKey is required");
|
3363
3368
|
}
|