@xata.io/client 0.26.5 → 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 +8 -0
- package/dist/index.cjs +3 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +34 -3
- package/dist/index.mjs +3 -11
- 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
@@ -534,7 +534,7 @@ function defaultOnOpen(response) {
|
|
534
534
|
}
|
535
535
|
}
|
536
536
|
|
537
|
-
const VERSION = "0.26.
|
537
|
+
const VERSION = "0.26.6";
|
538
538
|
|
539
539
|
var __defProp$7 = Object.defineProperty;
|
540
540
|
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
@@ -4174,13 +4174,6 @@ transformObjectToApi_fn = async function(object) {
|
|
4174
4174
|
}
|
4175
4175
|
return result;
|
4176
4176
|
};
|
4177
|
-
const removeLinksFromObject = (object) => {
|
4178
|
-
return Object.entries(object).reduce((acc, [key, value]) => {
|
4179
|
-
if (key === "xata")
|
4180
|
-
return acc;
|
4181
|
-
return { ...acc, [key]: isIdentifiable(value) ? value.id : value };
|
4182
|
-
}, {});
|
4183
|
-
};
|
4184
4177
|
const initObject = (db, schemaTables, table, object, selectedColumns) => {
|
4185
4178
|
const data = {};
|
4186
4179
|
const { xata, ...rest } = object ?? {};
|
@@ -4247,7 +4240,6 @@ const initObject = (db, schemaTables, table, object, selectedColumns) => {
|
|
4247
4240
|
}
|
4248
4241
|
}
|
4249
4242
|
const record = { ...data };
|
4250
|
-
const serializable = { xata, ...removeLinksFromObject(data) };
|
4251
4243
|
const metadata = xata !== void 0 ? { ...xata, createdAt: new Date(xata.createdAt), updatedAt: new Date(xata.updatedAt) } : void 0;
|
4252
4244
|
record.read = function(columns2) {
|
4253
4245
|
return db[table].read(record["id"], columns2);
|
@@ -4270,10 +4262,10 @@ const initObject = (db, schemaTables, table, object, selectedColumns) => {
|
|
4270
4262
|
return record.xata;
|
4271
4263
|
};
|
4272
4264
|
record.toSerializable = function() {
|
4273
|
-
return JSON.parse(JSON.stringify(
|
4265
|
+
return JSON.parse(JSON.stringify(record));
|
4274
4266
|
};
|
4275
4267
|
record.toString = function() {
|
4276
|
-
return JSON.stringify(
|
4268
|
+
return JSON.stringify(record);
|
4277
4269
|
};
|
4278
4270
|
for (const prop of ["read", "update", "replace", "delete", "getMetadata", "toSerializable", "toString"]) {
|
4279
4271
|
Object.defineProperty(record, prop, { enumerable: false });
|