@xata.io/client 0.26.4 → 0.26.6
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 +14 -0
- package/dist/index.cjs +30 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +34 -3
- package/dist/index.mjs +30 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -2363,6 +2363,16 @@ type AverageAgg = {
|
|
2363
2363
|
*/
|
2364
2364
|
column: string;
|
2365
2365
|
};
|
2366
|
+
/**
|
2367
|
+
* Calculate given percentiles of the numeric values in a particular column.
|
2368
|
+
*/
|
2369
|
+
type PercentilesAgg = {
|
2370
|
+
/**
|
2371
|
+
* The column on which to compute the average. Must be a numeric type.
|
2372
|
+
*/
|
2373
|
+
column: string;
|
2374
|
+
percentiles: number[];
|
2375
|
+
};
|
2366
2376
|
/**
|
2367
2377
|
* Count the number of distinct values in a particular column.
|
2368
2378
|
*/
|
@@ -2477,6 +2487,8 @@ type AggExpression = {
|
|
2477
2487
|
min?: MinAgg;
|
2478
2488
|
} | {
|
2479
2489
|
average?: AverageAgg;
|
2490
|
+
} | {
|
2491
|
+
percentiles?: PercentilesAgg;
|
2480
2492
|
} | {
|
2481
2493
|
uniqueCount?: UniqueCountAgg;
|
2482
2494
|
} | {
|
@@ -2492,7 +2504,9 @@ type AggResponse$1 = (number | null) | {
|
|
2492
2504
|
$count: number;
|
2493
2505
|
} & {
|
2494
2506
|
[key: string]: AggResponse$1;
|
2495
|
-
})[]
|
2507
|
+
})[] | {
|
2508
|
+
[key: string]: number;
|
2509
|
+
};
|
2496
2510
|
};
|
2497
2511
|
/**
|
2498
2512
|
* File identifier in access URLs
|
@@ -6212,6 +6226,7 @@ type schemas_OAuthResponseType = OAuthResponseType;
|
|
6212
6226
|
type schemas_OAuthScope = OAuthScope;
|
6213
6227
|
type schemas_ObjectValue = ObjectValue;
|
6214
6228
|
type schemas_PageConfig = PageConfig;
|
6229
|
+
type schemas_PercentilesAgg = PercentilesAgg;
|
6215
6230
|
type schemas_PrefixExpression = PrefixExpression;
|
6216
6231
|
type schemas_ProjectionConfig = ProjectionConfig;
|
6217
6232
|
type schemas_QueryColumnsProjection = QueryColumnsProjection;
|
@@ -6263,7 +6278,7 @@ type schemas_WorkspaceMember = WorkspaceMember;
|
|
6263
6278
|
type schemas_WorkspaceMembers = WorkspaceMembers;
|
6264
6279
|
type schemas_WorkspaceMeta = WorkspaceMeta;
|
6265
6280
|
declare namespace schemas {
|
6266
|
-
export type { schemas_APIKeyName as APIKeyName, schemas_AccessToken as AccessToken, schemas_AggExpression as AggExpression, schemas_AggExpressionMap as AggExpressionMap, AggResponse$1 as AggResponse, schemas_AuthorizationCodeRequest as AuthorizationCodeRequest, schemas_AuthorizationCodeResponse as AuthorizationCodeResponse, schemas_AverageAgg as AverageAgg, schemas_BoosterExpression as BoosterExpression, schemas_Branch as Branch, schemas_BranchMetadata as BranchMetadata, schemas_BranchMigration as BranchMigration, schemas_BranchName as BranchName, schemas_BranchOp as BranchOp, schemas_BranchWithCopyID as BranchWithCopyID, schemas_Column as Column, schemas_ColumnFile as ColumnFile, schemas_ColumnLink as ColumnLink, schemas_ColumnMigration as ColumnMigration, schemas_ColumnName as ColumnName, schemas_ColumnOpAdd as ColumnOpAdd, schemas_ColumnOpRemove as ColumnOpRemove, schemas_ColumnOpRename as ColumnOpRename, schemas_ColumnVector as ColumnVector, schemas_ColumnsProjection as ColumnsProjection, schemas_Commit as Commit, schemas_CountAgg as CountAgg, schemas_DBBranch as DBBranch, schemas_DBBranchName as DBBranchName, schemas_DBName as DBName, schemas_DataInputRecord as DataInputRecord, schemas_DatabaseGithubSettings as DatabaseGithubSettings, schemas_DatabaseMetadata as DatabaseMetadata, DateBooster$1 as DateBooster, schemas_DateHistogramAgg as DateHistogramAgg, schemas_DateTime as DateTime, schemas_FileAccessID as FileAccessID, schemas_FileItemID as FileItemID, schemas_FileName as FileName, schemas_FileResponse as FileResponse, schemas_FileSignature as FileSignature, schemas_FilterColumn as FilterColumn, schemas_FilterColumnIncludes as FilterColumnIncludes, schemas_FilterExpression as FilterExpression, schemas_FilterList as FilterList, schemas_FilterPredicate as FilterPredicate, schemas_FilterPredicateOp as FilterPredicateOp, schemas_FilterPredicateRangeOp as FilterPredicateRangeOp, schemas_FilterRangeValue as FilterRangeValue, schemas_FilterValue as FilterValue, schemas_FuzzinessExpression as FuzzinessExpression, schemas_HighlightExpression as HighlightExpression, schemas_InputFile as InputFile, schemas_InputFileArray as InputFileArray, schemas_InputFileEntry as InputFileEntry, schemas_InviteID as InviteID, schemas_InviteKey as InviteKey, schemas_ListBranchesResponse as ListBranchesResponse, schemas_ListDatabasesResponse as ListDatabasesResponse, schemas_ListGitBranchesResponse as ListGitBranchesResponse, schemas_ListRegionsResponse as ListRegionsResponse, schemas_MaxAgg as MaxAgg, schemas_MediaType as MediaType, schemas_MetricsDatapoint as MetricsDatapoint, schemas_MetricsLatency as MetricsLatency, schemas_Migration as Migration, schemas_MigrationColumnOp as MigrationColumnOp, schemas_MigrationObject as MigrationObject, schemas_MigrationOp as MigrationOp, schemas_MigrationRequest as MigrationRequest, schemas_MigrationRequestNumber as MigrationRequestNumber, schemas_MigrationStatus as MigrationStatus, schemas_MigrationTableOp as MigrationTableOp, schemas_MinAgg as MinAgg, NumericBooster$1 as NumericBooster, schemas_NumericHistogramAgg as NumericHistogramAgg, schemas_OAuthAccessToken as OAuthAccessToken, schemas_OAuthClientID as OAuthClientID, schemas_OAuthClientPublicDetails as OAuthClientPublicDetails, schemas_OAuthResponseType as OAuthResponseType, schemas_OAuthScope as OAuthScope, schemas_ObjectValue as ObjectValue, schemas_PageConfig as PageConfig, schemas_PrefixExpression as PrefixExpression, schemas_ProjectionConfig as ProjectionConfig, schemas_QueryColumnsProjection as QueryColumnsProjection, schemas_RecordID as RecordID, schemas_RecordMeta as RecordMeta, schemas_RecordsMetadata as RecordsMetadata, schemas_Region as Region, schemas_RevLink as RevLink, schemas_Role as Role, schemas_SQLRecord as SQLRecord, schemas_Schema as Schema, schemas_SchemaEditScript as SchemaEditScript, schemas_SearchPageConfig as SearchPageConfig, schemas_SortExpression as SortExpression, schemas_SortOrder as SortOrder, schemas_StartedFromMetadata as StartedFromMetadata, schemas_SumAgg as SumAgg, schemas_SummaryExpression as SummaryExpression, schemas_SummaryExpressionList as SummaryExpressionList, schemas_Table as Table, schemas_TableMigration as TableMigration, schemas_TableName as TableName, schemas_TableOpAdd as TableOpAdd, schemas_TableOpRemove as TableOpRemove, schemas_TableOpRename as TableOpRename, schemas_TableRename as TableRename, schemas_TargetExpression as TargetExpression, schemas_TopValuesAgg as TopValuesAgg, schemas_TransactionDeleteOp as TransactionDeleteOp, schemas_TransactionError as TransactionError, schemas_TransactionFailure as TransactionFailure, schemas_TransactionGetOp as TransactionGetOp, schemas_TransactionInsertOp as TransactionInsertOp, TransactionOperation$1 as TransactionOperation, schemas_TransactionResultColumns as TransactionResultColumns, schemas_TransactionResultDelete as TransactionResultDelete, schemas_TransactionResultGet as TransactionResultGet, schemas_TransactionResultInsert as TransactionResultInsert, schemas_TransactionResultUpdate as TransactionResultUpdate, schemas_TransactionSuccess as TransactionSuccess, schemas_TransactionUpdateOp as TransactionUpdateOp, schemas_UniqueCountAgg as UniqueCountAgg, schemas_User as User, schemas_UserID as UserID, schemas_UserWithID as UserWithID, ValueBooster$1 as ValueBooster, schemas_Workspace as Workspace, schemas_WorkspaceID as WorkspaceID, schemas_WorkspaceInvite as WorkspaceInvite, schemas_WorkspaceMember as WorkspaceMember, schemas_WorkspaceMembers as WorkspaceMembers, schemas_WorkspaceMeta as WorkspaceMeta, XataRecord$1 as XataRecord };
|
6281
|
+
export type { schemas_APIKeyName as APIKeyName, schemas_AccessToken as AccessToken, schemas_AggExpression as AggExpression, schemas_AggExpressionMap as AggExpressionMap, AggResponse$1 as AggResponse, schemas_AuthorizationCodeRequest as AuthorizationCodeRequest, schemas_AuthorizationCodeResponse as AuthorizationCodeResponse, schemas_AverageAgg as AverageAgg, schemas_BoosterExpression as BoosterExpression, schemas_Branch as Branch, schemas_BranchMetadata as BranchMetadata, schemas_BranchMigration as BranchMigration, schemas_BranchName as BranchName, schemas_BranchOp as BranchOp, schemas_BranchWithCopyID as BranchWithCopyID, schemas_Column as Column, schemas_ColumnFile as ColumnFile, schemas_ColumnLink as ColumnLink, schemas_ColumnMigration as ColumnMigration, schemas_ColumnName as ColumnName, schemas_ColumnOpAdd as ColumnOpAdd, schemas_ColumnOpRemove as ColumnOpRemove, schemas_ColumnOpRename as ColumnOpRename, schemas_ColumnVector as ColumnVector, schemas_ColumnsProjection as ColumnsProjection, schemas_Commit as Commit, schemas_CountAgg as CountAgg, schemas_DBBranch as DBBranch, schemas_DBBranchName as DBBranchName, schemas_DBName as DBName, schemas_DataInputRecord as DataInputRecord, schemas_DatabaseGithubSettings as DatabaseGithubSettings, schemas_DatabaseMetadata as DatabaseMetadata, DateBooster$1 as DateBooster, schemas_DateHistogramAgg as DateHistogramAgg, schemas_DateTime as DateTime, schemas_FileAccessID as FileAccessID, schemas_FileItemID as FileItemID, schemas_FileName as FileName, schemas_FileResponse as FileResponse, schemas_FileSignature as FileSignature, schemas_FilterColumn as FilterColumn, schemas_FilterColumnIncludes as FilterColumnIncludes, schemas_FilterExpression as FilterExpression, schemas_FilterList as FilterList, schemas_FilterPredicate as FilterPredicate, schemas_FilterPredicateOp as FilterPredicateOp, schemas_FilterPredicateRangeOp as FilterPredicateRangeOp, schemas_FilterRangeValue as FilterRangeValue, schemas_FilterValue as FilterValue, schemas_FuzzinessExpression as FuzzinessExpression, schemas_HighlightExpression as HighlightExpression, schemas_InputFile as InputFile, schemas_InputFileArray as InputFileArray, schemas_InputFileEntry as InputFileEntry, schemas_InviteID as InviteID, schemas_InviteKey as InviteKey, schemas_ListBranchesResponse as ListBranchesResponse, schemas_ListDatabasesResponse as ListDatabasesResponse, schemas_ListGitBranchesResponse as ListGitBranchesResponse, schemas_ListRegionsResponse as ListRegionsResponse, schemas_MaxAgg as MaxAgg, schemas_MediaType as MediaType, schemas_MetricsDatapoint as MetricsDatapoint, schemas_MetricsLatency as MetricsLatency, schemas_Migration as Migration, schemas_MigrationColumnOp as MigrationColumnOp, schemas_MigrationObject as MigrationObject, schemas_MigrationOp as MigrationOp, schemas_MigrationRequest as MigrationRequest, schemas_MigrationRequestNumber as MigrationRequestNumber, schemas_MigrationStatus as MigrationStatus, schemas_MigrationTableOp as MigrationTableOp, schemas_MinAgg as MinAgg, NumericBooster$1 as NumericBooster, schemas_NumericHistogramAgg as NumericHistogramAgg, schemas_OAuthAccessToken as OAuthAccessToken, schemas_OAuthClientID as OAuthClientID, schemas_OAuthClientPublicDetails as OAuthClientPublicDetails, schemas_OAuthResponseType as OAuthResponseType, schemas_OAuthScope as OAuthScope, schemas_ObjectValue as ObjectValue, schemas_PageConfig as PageConfig, schemas_PercentilesAgg as PercentilesAgg, schemas_PrefixExpression as PrefixExpression, schemas_ProjectionConfig as ProjectionConfig, schemas_QueryColumnsProjection as QueryColumnsProjection, schemas_RecordID as RecordID, schemas_RecordMeta as RecordMeta, schemas_RecordsMetadata as RecordsMetadata, schemas_Region as Region, schemas_RevLink as RevLink, schemas_Role as Role, schemas_SQLRecord as SQLRecord, schemas_Schema as Schema, schemas_SchemaEditScript as SchemaEditScript, schemas_SearchPageConfig as SearchPageConfig, schemas_SortExpression as SortExpression, schemas_SortOrder as SortOrder, schemas_StartedFromMetadata as StartedFromMetadata, schemas_SumAgg as SumAgg, schemas_SummaryExpression as SummaryExpression, schemas_SummaryExpressionList as SummaryExpressionList, schemas_Table as Table, schemas_TableMigration as TableMigration, schemas_TableName as TableName, schemas_TableOpAdd as TableOpAdd, schemas_TableOpRemove as TableOpRemove, schemas_TableOpRename as TableOpRename, schemas_TableRename as TableRename, schemas_TargetExpression as TargetExpression, schemas_TopValuesAgg as TopValuesAgg, schemas_TransactionDeleteOp as TransactionDeleteOp, schemas_TransactionError as TransactionError, schemas_TransactionFailure as TransactionFailure, schemas_TransactionGetOp as TransactionGetOp, schemas_TransactionInsertOp as TransactionInsertOp, TransactionOperation$1 as TransactionOperation, schemas_TransactionResultColumns as TransactionResultColumns, schemas_TransactionResultDelete as TransactionResultDelete, schemas_TransactionResultGet as TransactionResultGet, schemas_TransactionResultInsert as TransactionResultInsert, schemas_TransactionResultUpdate as TransactionResultUpdate, schemas_TransactionSuccess as TransactionSuccess, schemas_TransactionUpdateOp as TransactionUpdateOp, schemas_UniqueCountAgg as UniqueCountAgg, schemas_User as User, schemas_UserID as UserID, schemas_UserWithID as UserWithID, ValueBooster$1 as ValueBooster, schemas_Workspace as Workspace, schemas_WorkspaceID as WorkspaceID, schemas_WorkspaceInvite as WorkspaceInvite, schemas_WorkspaceMember as WorkspaceMember, schemas_WorkspaceMembers as WorkspaceMembers, schemas_WorkspaceMeta as WorkspaceMeta, XataRecord$1 as XataRecord };
|
6267
6282
|
}
|
6268
6283
|
|
6269
6284
|
type ApiExtraProps = Omit<FetcherExtraProps, 'endpoint'>;
|
@@ -7430,7 +7445,7 @@ type EditableData<O extends XataRecord> = Identifiable & Partial<Omit<{
|
|
7430
7445
|
type JSONDataFile = {
|
7431
7446
|
[K in keyof XataFile]: XataFile[K] extends Function ? never : XataFile[K];
|
7432
7447
|
};
|
7433
|
-
type JSONDataFields<T> = T extends XataFile ? JSONDataFile : NonNullable<T> extends XataFile ? JSONDataFile | null | undefined : T extends XataRecord ?
|
7448
|
+
type JSONDataFields<T> = T extends XataFile ? JSONDataFile : NonNullable<T> extends XataFile ? JSONDataFile | null | undefined : T extends XataRecord ? JSONData<T> : NonNullable<T> extends XataRecord ? JSONData<T> | null | undefined : T extends Date ? string : NonNullable<T> extends Date ? string | null | undefined : T;
|
7434
7449
|
type JSONDataBase = Identifiable & {
|
7435
7450
|
/**
|
7436
7451
|
* Metadata about the record.
|
@@ -7713,6 +7728,7 @@ type AggregationExpression<O extends XataRecord> = ExactlyOne<{
|
|
7713
7728
|
max: MaxAggregation<O>;
|
7714
7729
|
min: MinAggregation<O>;
|
7715
7730
|
average: AverageAggregation<O>;
|
7731
|
+
percentiles: PercentilesAggregation<O>;
|
7716
7732
|
uniqueCount: UniqueCountAggregation<O>;
|
7717
7733
|
dateHistogram: DateHistogramAggregation<O>;
|
7718
7734
|
topValues: TopValuesAggregation<O>;
|
@@ -7767,6 +7783,16 @@ type AverageAggregation<O extends XataRecord> = {
|
|
7767
7783
|
*/
|
7768
7784
|
column: ColumnsByValue<O, number>;
|
7769
7785
|
};
|
7786
|
+
/**
|
7787
|
+
* Calculate given percentiles of the numeric values in a particular column.
|
7788
|
+
*/
|
7789
|
+
type PercentilesAggregation<O extends XataRecord> = {
|
7790
|
+
/**
|
7791
|
+
* The column on which to compute the average. Must be a numeric type.
|
7792
|
+
*/
|
7793
|
+
column: ColumnsByValue<O, number>;
|
7794
|
+
percentiles: number[];
|
7795
|
+
};
|
7770
7796
|
/**
|
7771
7797
|
* Count the number of distinct values in a particular column.
|
7772
7798
|
*/
|
@@ -7862,6 +7888,11 @@ type AggregationExpressionResultTypes = {
|
|
7862
7888
|
max: number | null;
|
7863
7889
|
min: number | null;
|
7864
7890
|
average: number | null;
|
7891
|
+
percentiles: {
|
7892
|
+
values: {
|
7893
|
+
[key: string]: number;
|
7894
|
+
};
|
7895
|
+
};
|
7865
7896
|
uniqueCount: number;
|
7866
7897
|
dateHistogram: ComplexAggregationResult;
|
7867
7898
|
topValues: ComplexAggregationResult;
|
package/dist/index.mjs
CHANGED
@@ -18,7 +18,8 @@ const TraceAttributes = {
|
|
18
18
|
HTTP_METHOD: "http.method",
|
19
19
|
HTTP_URL: "http.url",
|
20
20
|
HTTP_ROUTE: "http.route",
|
21
|
-
HTTP_TARGET: "http.target"
|
21
|
+
HTTP_TARGET: "http.target",
|
22
|
+
CLOUDFLARE_RAY_ID: "cf.ray"
|
22
23
|
};
|
23
24
|
|
24
25
|
function notEmpty(value) {
|
@@ -30,8 +31,15 @@ function compact(arr) {
|
|
30
31
|
function compactObject(obj) {
|
31
32
|
return Object.fromEntries(Object.entries(obj).filter(([, value]) => notEmpty(value)));
|
32
33
|
}
|
34
|
+
function isBlob(value) {
|
35
|
+
try {
|
36
|
+
return value instanceof Blob;
|
37
|
+
} catch (error) {
|
38
|
+
return false;
|
39
|
+
}
|
40
|
+
}
|
33
41
|
function isObject(value) {
|
34
|
-
return Boolean(value) && typeof value === "object" && !Array.isArray(value) && !(value instanceof Date) && !(value
|
42
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value) && !(value instanceof Date) && !isBlob(value);
|
35
43
|
}
|
36
44
|
function isDefined(value) {
|
37
45
|
return value !== null && value !== void 0;
|
@@ -263,14 +271,13 @@ var __privateMethod$4 = (obj, member, method) => {
|
|
263
271
|
return method;
|
264
272
|
};
|
265
273
|
var _fetch, _queue, _concurrency, _enqueue, enqueue_fn;
|
266
|
-
const REQUEST_TIMEOUT =
|
274
|
+
const REQUEST_TIMEOUT = 5 * 60 * 1e3;
|
267
275
|
function getFetchImplementation(userFetch) {
|
268
276
|
const globalFetch = typeof fetch !== "undefined" ? fetch : void 0;
|
269
|
-
const
|
277
|
+
const globalThisFetch = typeof globalThis !== "undefined" ? globalThis.fetch : void 0;
|
278
|
+
const fetchImpl = userFetch ?? globalFetch ?? globalThisFetch;
|
270
279
|
if (!fetchImpl) {
|
271
|
-
throw new Error(
|
272
|
-
`Couldn't find \`fetch\`. Install a fetch implementation such as \`node-fetch\` and pass it explicitly.`
|
273
|
-
);
|
280
|
+
throw new Error(`Couldn't find a global \`fetch\`. Pass a fetch implementation explicitly.`);
|
274
281
|
}
|
275
282
|
return fetchImpl;
|
276
283
|
}
|
@@ -527,7 +534,7 @@ function defaultOnOpen(response) {
|
|
527
534
|
}
|
528
535
|
}
|
529
536
|
|
530
|
-
const VERSION = "0.26.
|
537
|
+
const VERSION = "0.26.6";
|
531
538
|
|
532
539
|
var __defProp$7 = Object.defineProperty;
|
533
540
|
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
@@ -616,7 +623,7 @@ function hostHeader(url) {
|
|
616
623
|
async function parseBody(body, headers) {
|
617
624
|
if (!isDefined(body))
|
618
625
|
return void 0;
|
619
|
-
if (body
|
626
|
+
if (isBlob(body) || typeof body.text === "function") {
|
620
627
|
return body;
|
621
628
|
}
|
622
629
|
const { "Content-Type": contentType } = headers ?? {};
|
@@ -688,7 +695,8 @@ async function fetch$1({
|
|
688
695
|
[TraceAttributes.HTTP_REQUEST_ID]: requestId,
|
689
696
|
[TraceAttributes.HTTP_STATUS_CODE]: response.status,
|
690
697
|
[TraceAttributes.HTTP_HOST]: host,
|
691
|
-
[TraceAttributes.HTTP_SCHEME]: protocol?.replace(":", "")
|
698
|
+
[TraceAttributes.HTTP_SCHEME]: protocol?.replace(":", ""),
|
699
|
+
[TraceAttributes.CLOUDFLARE_RAY_ID]: response.headers?.get("cf-ray") ?? void 0
|
692
700
|
});
|
693
701
|
const message = response.headers?.get("x-xata-message");
|
694
702
|
if (message)
|
@@ -2671,7 +2679,7 @@ function getContentType(file) {
|
|
2671
2679
|
if (typeof file === "string") {
|
2672
2680
|
return "text/plain";
|
2673
2681
|
}
|
2674
|
-
if (file
|
2682
|
+
if (isBlob(file)) {
|
2675
2683
|
return file.type;
|
2676
2684
|
}
|
2677
2685
|
try {
|
@@ -2862,7 +2870,15 @@ const parseInputFileEntry = async (entry) => {
|
|
2862
2870
|
if (!isDefined(entry))
|
2863
2871
|
return null;
|
2864
2872
|
const { id, name, mediaType, base64Content, enablePublicUrl, signedUrlTimeout } = await entry;
|
2865
|
-
return compactObject({
|
2873
|
+
return compactObject({
|
2874
|
+
id,
|
2875
|
+
// Name cannot be an empty string in our API
|
2876
|
+
name: name ? name : void 0,
|
2877
|
+
mediaType,
|
2878
|
+
base64Content,
|
2879
|
+
enablePublicUrl,
|
2880
|
+
signedUrlTimeout
|
2881
|
+
});
|
2866
2882
|
};
|
2867
2883
|
|
2868
2884
|
function cleanFilter(filter) {
|
@@ -4158,13 +4174,6 @@ transformObjectToApi_fn = async function(object) {
|
|
4158
4174
|
}
|
4159
4175
|
return result;
|
4160
4176
|
};
|
4161
|
-
const removeLinksFromObject = (object) => {
|
4162
|
-
return Object.entries(object).reduce((acc, [key, value]) => {
|
4163
|
-
if (key === "xata")
|
4164
|
-
return acc;
|
4165
|
-
return { ...acc, [key]: isIdentifiable(value) ? value.id : value };
|
4166
|
-
}, {});
|
4167
|
-
};
|
4168
4177
|
const initObject = (db, schemaTables, table, object, selectedColumns) => {
|
4169
4178
|
const data = {};
|
4170
4179
|
const { xata, ...rest } = object ?? {};
|
@@ -4231,7 +4240,6 @@ const initObject = (db, schemaTables, table, object, selectedColumns) => {
|
|
4231
4240
|
}
|
4232
4241
|
}
|
4233
4242
|
const record = { ...data };
|
4234
|
-
const serializable = { xata, ...removeLinksFromObject(data) };
|
4235
4243
|
const metadata = xata !== void 0 ? { ...xata, createdAt: new Date(xata.createdAt), updatedAt: new Date(xata.updatedAt) } : void 0;
|
4236
4244
|
record.read = function(columns2) {
|
4237
4245
|
return db[table].read(record["id"], columns2);
|
@@ -4254,10 +4262,10 @@ const initObject = (db, schemaTables, table, object, selectedColumns) => {
|
|
4254
4262
|
return record.xata;
|
4255
4263
|
};
|
4256
4264
|
record.toSerializable = function() {
|
4257
|
-
return JSON.parse(JSON.stringify(
|
4265
|
+
return JSON.parse(JSON.stringify(record));
|
4258
4266
|
};
|
4259
4267
|
record.toString = function() {
|
4260
|
-
return JSON.stringify(
|
4268
|
+
return JSON.stringify(record);
|
4261
4269
|
};
|
4262
4270
|
for (const prop of ["read", "update", "replace", "delete", "getMetadata", "toSerializable", "toString"]) {
|
4263
4271
|
Object.defineProperty(record, prop, { enumerable: false });
|