mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix: Overhaul DataTableRowWithId type and include createdAt, insertedAt in getMany return (no-changelog) (#18787)
This commit is contained in:
@@ -72,9 +72,17 @@ export type AddDataStoreColumnOptions = Pick<DataStoreColumn, 'name' | 'type'> &
|
||||
|
||||
export type DataStoreColumnJsType = string | number | boolean | Date | null;
|
||||
|
||||
export const DATA_TABLE_SYSTEM_COLUMNS = ['id', 'createdAt', 'updatedAt'] as const;
|
||||
|
||||
export type DataStoreRowReturnBase = {
|
||||
id: number;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
};
|
||||
export type DataStoreRow = Record<string, DataStoreColumnJsType>;
|
||||
export type DataStoreRows = DataStoreRow[];
|
||||
export type DataStoreRowWithId = DataStoreRow & { id: number };
|
||||
export type DataStoreRowReturn = DataStoreRow & DataStoreRowReturnBase;
|
||||
export type DataStoreRowsReturn = DataStoreRowReturn[];
|
||||
|
||||
// APIs for a data store service operating on a specific projectId
|
||||
export interface IDataStoreProjectAggregateService {
|
||||
@@ -100,9 +108,11 @@ export interface IDataStoreProjectService {
|
||||
|
||||
getManyRowsAndCount(
|
||||
dto: Partial<ListDataStoreRowsOptions>,
|
||||
): Promise<{ count: number; data: DataStoreRows }>;
|
||||
): Promise<{ count: number; data: DataStoreRowsReturn }>;
|
||||
|
||||
insertRows(rows: DataStoreRows): Promise<Array<{ id: number }>>;
|
||||
insertRows(rows: DataStoreRows): Promise<DataStoreRowReturn[]>;
|
||||
|
||||
upsertRows(options: UpsertDataStoreRowsOptions): Promise<boolean | DataStoreRowWithId[]>;
|
||||
upsertRows(options: UpsertDataStoreRowsOptions): Promise<DataStoreRowReturn[]>;
|
||||
|
||||
deleteRows(ids: number[]): Promise<boolean>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user