@xata.io/client 0.24.0 → 0.24.1
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/.turbo/turbo-add-version.log +1 -1
- package/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +6 -0
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +24 -6
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -1714,7 +1714,7 @@ type TransactionError = {
|
|
1714
1714
|
message: string;
|
1715
1715
|
};
|
1716
1716
|
/**
|
1717
|
-
* An array of errors, with
|
1717
|
+
* An array of errors, with indices, from the transaction.
|
1718
1718
|
*/
|
1719
1719
|
type TransactionFailure = {
|
1720
1720
|
/**
|
@@ -1948,7 +1948,7 @@ type DateBooster$1 = {
|
|
1948
1948
|
*/
|
1949
1949
|
origin?: string;
|
1950
1950
|
/**
|
1951
|
-
* The duration at which distance from origin the score is decayed with factor, using an exponential function. It is
|
1951
|
+
* The duration at which distance from origin the score is decayed with factor, using an exponential function. It is formatted as number + units, for example: `5d`, `20m`, `10s`.
|
1952
1952
|
*
|
1953
1953
|
* @pattern ^(\d+)(d|h|m|s|ms)$
|
1954
1954
|
*/
|
@@ -1983,7 +1983,7 @@ type BoosterExpression = {
|
|
1983
1983
|
/**
|
1984
1984
|
* Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
|
1985
1985
|
* distance is the number of one character changes needed to make two strings equal. The default is 1, meaning that single
|
1986
|
-
* character typos per word are
|
1986
|
+
* character typos per word are tolerated by search. You can set it to 0 to remove the typo tolerance or set it to 2
|
1987
1987
|
* to allow two typos in a word.
|
1988
1988
|
*
|
1989
1989
|
* @default 1
|
@@ -2136,7 +2136,7 @@ type UniqueCountAgg = {
|
|
2136
2136
|
column: string;
|
2137
2137
|
/**
|
2138
2138
|
* The threshold under which the unique count is exact. If the number of unique
|
2139
|
-
* values in the column is higher than this threshold, the results are
|
2139
|
+
* values in the column is higher than this threshold, the results are approximate.
|
2140
2140
|
* Maximum value is 40,000, default value is 3000.
|
2141
2141
|
*/
|
2142
2142
|
precisionThreshold?: number;
|
@@ -2159,7 +2159,7 @@ type DateHistogramAgg = {
|
|
2159
2159
|
column: string;
|
2160
2160
|
/**
|
2161
2161
|
* The fixed interval to use when bucketing.
|
2162
|
-
* It is
|
2162
|
+
* It is formatted as number + units, for example: `5d`, `20m`, `10s`.
|
2163
2163
|
*
|
2164
2164
|
* @pattern ^(\d+)(d|h|m|s|ms)$
|
2165
2165
|
*/
|
@@ -2214,7 +2214,7 @@ type NumericHistogramAgg = {
|
|
2214
2214
|
interval: number;
|
2215
2215
|
/**
|
2216
2216
|
* By default the bucket keys start with 0 and then continue in `interval` steps. The bucket
|
2217
|
-
* boundaries can be
|
2217
|
+
* boundaries can be shifted by using the offset option. For example, if the `interval` is 100,
|
2218
2218
|
* but you prefer the bucket boundaries to be `[50, 150), [150, 250), etc.`, you can set `offset`
|
2219
2219
|
* to 50.
|
2220
2220
|
*
|
@@ -2337,6 +2337,10 @@ type QueryResponse = {
|
|
2337
2337
|
records: XataRecord$1[];
|
2338
2338
|
meta: RecordsMetadata;
|
2339
2339
|
};
|
2340
|
+
type ServiceUnavailableError = {
|
2341
|
+
id?: string;
|
2342
|
+
message: string;
|
2343
|
+
};
|
2340
2344
|
type SearchResponse = {
|
2341
2345
|
records: XataRecord$1[];
|
2342
2346
|
warning?: string;
|
@@ -4346,6 +4350,9 @@ type QueryTableError = ErrorWrapper<{
|
|
4346
4350
|
} | {
|
4347
4351
|
status: 404;
|
4348
4352
|
payload: SimpleError;
|
4353
|
+
} | {
|
4354
|
+
status: 503;
|
4355
|
+
payload: ServiceUnavailableError;
|
4349
4356
|
}>;
|
4350
4357
|
type QueryTableRequestBody = {
|
4351
4358
|
filter?: FilterExpression;
|
@@ -5180,6 +5187,9 @@ type SearchBranchError = ErrorWrapper<{
|
|
5180
5187
|
} | {
|
5181
5188
|
status: 404;
|
5182
5189
|
payload: SimpleError;
|
5190
|
+
} | {
|
5191
|
+
status: 503;
|
5192
|
+
payload: ServiceUnavailableError;
|
5183
5193
|
}>;
|
5184
5194
|
type SearchBranchRequestBody = {
|
5185
5195
|
/**
|
@@ -5279,6 +5289,9 @@ type SqlQueryError = ErrorWrapper<{
|
|
5279
5289
|
} | {
|
5280
5290
|
status: 404;
|
5281
5291
|
payload: SimpleError;
|
5292
|
+
} | {
|
5293
|
+
status: 503;
|
5294
|
+
payload: ServiceUnavailableError;
|
5282
5295
|
}>;
|
5283
5296
|
type SqlQueryRequestBody = {
|
5284
5297
|
/**
|
@@ -5386,6 +5399,9 @@ type AskTableError = ErrorWrapper<{
|
|
5386
5399
|
} | {
|
5387
5400
|
status: 429;
|
5388
5401
|
payload: RateLimitError;
|
5402
|
+
} | {
|
5403
|
+
status: 503;
|
5404
|
+
payload: ServiceUnavailableError;
|
5389
5405
|
}>;
|
5390
5406
|
type AskTableResponse = {
|
5391
5407
|
/**
|
@@ -5785,6 +5801,7 @@ type responses_SQLResponse = SQLResponse;
|
|
5785
5801
|
type responses_SchemaCompareResponse = SchemaCompareResponse;
|
5786
5802
|
type responses_SchemaUpdateResponse = SchemaUpdateResponse;
|
5787
5803
|
type responses_SearchResponse = SearchResponse;
|
5804
|
+
type responses_ServiceUnavailableError = ServiceUnavailableError;
|
5788
5805
|
type responses_SimpleError = SimpleError;
|
5789
5806
|
type responses_SummarizeResponse = SummarizeResponse;
|
5790
5807
|
declare namespace responses {
|
@@ -5804,6 +5821,7 @@ declare namespace responses {
|
|
5804
5821
|
responses_SchemaCompareResponse as SchemaCompareResponse,
|
5805
5822
|
responses_SchemaUpdateResponse as SchemaUpdateResponse,
|
5806
5823
|
responses_SearchResponse as SearchResponse,
|
5824
|
+
responses_ServiceUnavailableError as ServiceUnavailableError,
|
5807
5825
|
responses_SimpleError as SimpleError,
|
5808
5826
|
responses_SummarizeResponse as SummarizeResponse,
|
5809
5827
|
};
|
package/dist/index.mjs
CHANGED
@@ -490,7 +490,7 @@ function defaultOnOpen(response) {
|
|
490
490
|
}
|
491
491
|
}
|
492
492
|
|
493
|
-
const VERSION = "0.24.
|
493
|
+
const VERSION = "0.24.1";
|
494
494
|
|
495
495
|
class ErrorWithCause extends Error {
|
496
496
|
constructor(message, options) {
|
@@ -3691,9 +3691,9 @@ const initObject = (db, schemaTables, table, object, selectedColumns) => {
|
|
3691
3691
|
record.delete = function() {
|
3692
3692
|
return db[table].delete(record["id"]);
|
3693
3693
|
};
|
3694
|
-
record.xata = metadata;
|
3694
|
+
record.xata = Object.freeze(metadata);
|
3695
3695
|
record.getMetadata = function() {
|
3696
|
-
return
|
3696
|
+
return record.xata;
|
3697
3697
|
};
|
3698
3698
|
record.toSerializable = function() {
|
3699
3699
|
return JSON.parse(JSON.stringify(serializable));
|
@@ -3701,7 +3701,7 @@ const initObject = (db, schemaTables, table, object, selectedColumns) => {
|
|
3701
3701
|
record.toString = function() {
|
3702
3702
|
return JSON.stringify(transformObjectLinks(serializable));
|
3703
3703
|
};
|
3704
|
-
for (const prop of ["read", "update", "replace", "delete", "
|
3704
|
+
for (const prop of ["read", "update", "replace", "delete", "getMetadata", "toSerializable", "toString"]) {
|
3705
3705
|
Object.defineProperty(record, prop, { enumerable: false });
|
3706
3706
|
}
|
3707
3707
|
Object.freeze(record);
|