@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/dist/index.d.ts
CHANGED
@@ -6397,6 +6397,7 @@ type SummarizeResultItem<Record extends XataRecord, Expression extends Dictionar
|
|
6397
6397
|
|
6398
6398
|
type BaseOptions<T extends XataRecord> = {
|
6399
6399
|
columns?: SelectableColumn<T>[];
|
6400
|
+
consistency?: 'strong' | 'eventual';
|
6400
6401
|
cache?: number;
|
6401
6402
|
fetchOptions?: Record<string, unknown>;
|
6402
6403
|
};
|
@@ -7706,6 +7707,7 @@ type BranchResolutionOptions = {
|
|
7706
7707
|
databaseURL?: string;
|
7707
7708
|
apiKey?: string;
|
7708
7709
|
fetchImpl?: FetchImpl;
|
7710
|
+
clientName?: string;
|
7709
7711
|
};
|
7710
7712
|
declare function getCurrentBranchName(options?: BranchResolutionOptions): Promise<string>;
|
7711
7713
|
declare function getCurrentBranchDetails(options?: BranchResolutionOptions): Promise<DBBranch | null>;
|
package/dist/index.mjs
CHANGED
@@ -295,7 +295,7 @@ enqueue_fn = function(task) {
|
|
295
295
|
return promise;
|
296
296
|
};
|
297
297
|
|
298
|
-
const VERSION = "0.21.
|
298
|
+
const VERSION = "0.21.2";
|
299
299
|
|
300
300
|
class ErrorWithCause extends Error {
|
301
301
|
constructor(message, options) {
|
@@ -2048,6 +2048,7 @@ const _Query = class {
|
|
2048
2048
|
__privateGet$5(this, _data).filter.$none = data.filter?.$none ?? parent?.filter?.$none;
|
2049
2049
|
__privateGet$5(this, _data).sort = data.sort ?? parent?.sort;
|
2050
2050
|
__privateGet$5(this, _data).columns = data.columns ?? parent?.columns;
|
2051
|
+
__privateGet$5(this, _data).consistency = data.consistency ?? parent?.consistency;
|
2051
2052
|
__privateGet$5(this, _data).pagination = data.pagination ?? parent?.pagination;
|
2052
2053
|
__privateGet$5(this, _data).cache = data.cache ?? parent?.cache;
|
2053
2054
|
__privateGet$5(this, _data).fetchOptions = data.fetchOptions ?? parent?.fetchOptions;
|
@@ -2608,7 +2609,8 @@ class RestRepository extends Query {
|
|
2608
2609
|
filter: cleanFilter(data.filter),
|
2609
2610
|
sort: data.sort !== void 0 ? buildSortFilter(data.sort) : void 0,
|
2610
2611
|
page: data.pagination,
|
2611
|
-
columns: data.columns ?? ["*"]
|
2612
|
+
columns: data.columns ?? ["*"],
|
2613
|
+
consistency: data.consistency
|
2612
2614
|
},
|
2613
2615
|
fetchOptions: data.fetchOptions,
|
2614
2616
|
...fetchProps
|
@@ -2636,6 +2638,7 @@ class RestRepository extends Query {
|
|
2636
2638
|
filter: cleanFilter(data.filter),
|
2637
2639
|
sort: data.sort !== void 0 ? buildSortFilter(data.sort) : void 0,
|
2638
2640
|
columns: data.columns,
|
2641
|
+
consistency: data.consistency,
|
2639
2642
|
page: data.pagination?.size !== void 0 ? { size: data.pagination?.size } : void 0,
|
2640
2643
|
summaries,
|
2641
2644
|
summariesFilter
|
@@ -3198,12 +3201,8 @@ const isBranchStrategyBuilder = (strategy) => {
|
|
3198
3201
|
|
3199
3202
|
async function getCurrentBranchName(options) {
|
3200
3203
|
const { branch, envBranch } = getEnvironment();
|
3201
|
-
if (branch)
|
3202
|
-
|
3203
|
-
if (details)
|
3204
|
-
return branch;
|
3205
|
-
console.warn(`Branch ${branch} not found in Xata. Ignoring...`);
|
3206
|
-
}
|
3204
|
+
if (branch)
|
3205
|
+
return branch;
|
3207
3206
|
const gitBranch = envBranch || await getGitBranch();
|
3208
3207
|
return resolveXataBranch(gitBranch, options);
|
3209
3208
|
}
|
@@ -3235,7 +3234,8 @@ async function resolveXataBranch(gitBranch, options) {
|
|
3235
3234
|
workspacesApiUrl: `${protocol}//${host}`,
|
3236
3235
|
pathParams: { dbName, workspace, region },
|
3237
3236
|
queryParams: { gitBranch, fallbackBranch },
|
3238
|
-
trace: defaultTrace
|
3237
|
+
trace: defaultTrace,
|
3238
|
+
clientName: options?.clientName
|
3239
3239
|
});
|
3240
3240
|
return branch;
|
3241
3241
|
}
|
@@ -3355,7 +3355,12 @@ const buildClient = (plugins) => {
|
|
3355
3355
|
const cache = options?.cache ?? new SimpleCache({ defaultQueryTTL: 0 });
|
3356
3356
|
const trace = options?.trace ?? defaultTrace;
|
3357
3357
|
const clientName = options?.clientName;
|
3358
|
-
const branch = async () => options?.branch !== void 0 ? await __privateMethod(this, _evaluateBranch, evaluateBranch_fn).call(this, options.branch) : await getCurrentBranchName({
|
3358
|
+
const branch = async () => options?.branch !== void 0 ? await __privateMethod(this, _evaluateBranch, evaluateBranch_fn).call(this, options.branch) : await getCurrentBranchName({
|
3359
|
+
apiKey,
|
3360
|
+
databaseURL,
|
3361
|
+
fetchImpl: options?.fetch,
|
3362
|
+
clientName: options?.clientName
|
3363
|
+
});
|
3359
3364
|
if (!apiKey) {
|
3360
3365
|
throw new Error("Option apiKey is required");
|
3361
3366
|
}
|