cormo
Advanced tools
Comparing version 0.14.2 to 0.14.3
@@ -17,5 +17,2 @@ module.exports = { | ||
], | ||
rules: { | ||
'@typescript-eslint/interface-name-prefix': ['error', 'always'], | ||
} | ||
}; |
import { Transaction } from '../transaction'; | ||
import * as types from '../types'; | ||
export interface ISchemasColumn { | ||
export interface SchemasColumn { | ||
required: boolean; | ||
type: types.ColumnType | undefined; | ||
} | ||
export interface ISchemasTable { | ||
[column_name: string]: ISchemasColumn; | ||
export interface SchemasTable { | ||
[column_name: string]: SchemasColumn; | ||
} | ||
export interface ISchemasIndex { | ||
export interface SchemasIndex { | ||
[index_name: string]: any; | ||
} | ||
export interface ISchemas { | ||
export interface Schemas { | ||
tables: { | ||
[table_name: string]: ISchemasTable | 'NO SCHEMA'; | ||
[table_name: string]: SchemasTable | 'NO SCHEMA'; | ||
}; | ||
indexes?: { | ||
[table_name: string]: ISchemasIndex; | ||
[table_name: string]: SchemasIndex; | ||
}; | ||
@@ -24,3 +24,3 @@ foreign_keys?: { | ||
} | ||
export interface IAdapterFindOptions { | ||
export interface AdapterFindOptions { | ||
lean: boolean; | ||
@@ -41,3 +41,3 @@ orders: any[]; | ||
} | ||
export interface IAdapterCountOptions { | ||
export interface AdapterCountOptions { | ||
conditions_of_group: any[]; | ||
@@ -44,0 +44,0 @@ group_fields?: any; |
@@ -1,6 +0,6 @@ | ||
export interface IAdapterSettingsMongoDB { | ||
export interface AdapterSettingsMongoDB { | ||
host?: string; | ||
port?: number; | ||
user?: string; | ||
password?: string; | ||
user?: string | Promise<string>; | ||
password?: string | Promise<string>; | ||
database: string; | ||
@@ -7,0 +7,0 @@ } |
@@ -668,9 +668,11 @@ "use strict"; | ||
let url; | ||
if (settings.user || settings.password) { | ||
const host = settings.host || 'localhost'; | ||
const port = settings.port || 27017; | ||
url = `mongodb://${settings.user}:${settings.password}@${host}:${port}/${settings.database}`; | ||
const host = settings.host || 'localhost'; | ||
const port = settings.port || 27017; | ||
const user = await settings.user; | ||
const password = await settings.password; | ||
if (user || password) { | ||
url = `mongodb://${user}:${password}@${host}:${port}/${settings.database}`; | ||
} | ||
else { | ||
url = `mongodb://${settings.host || 'localhost'}:${settings.port || 27017}/${settings.database}`; | ||
url = `mongodb://${host}:${port}/${settings.database}`; | ||
} | ||
@@ -677,0 +679,0 @@ try { |
@@ -1,6 +0,6 @@ | ||
export interface IAdapterSettingsMySQL { | ||
export interface AdapterSettingsMySQL { | ||
host?: string; | ||
port?: number; | ||
user?: string; | ||
password?: string; | ||
user?: string | Promise<string>; | ||
password?: string | Promise<string>; | ||
database: string; | ||
@@ -16,4 +16,4 @@ charset?: string; | ||
port?: number; | ||
user?: string; | ||
password?: string; | ||
user?: string | Promise<string>; | ||
password?: string | Promise<string>; | ||
pool_size?: number; | ||
@@ -20,0 +20,0 @@ }>; |
@@ -504,5 +504,5 @@ "use strict"; | ||
host: settings.host, | ||
password: settings.password, | ||
password: await settings.password, | ||
port: settings.port, | ||
user: settings.user, | ||
user: await settings.user, | ||
}); | ||
@@ -531,5 +531,5 @@ } | ||
host: settings.host, | ||
password: settings.password, | ||
password: await settings.password, | ||
port: settings.port, | ||
user: settings.user, | ||
user: await settings.user, | ||
}); | ||
@@ -551,5 +551,5 @@ this._client._node_id = 'MASTER'; | ||
host: replica.host, | ||
password: replica.password, | ||
password: await replica.password, | ||
port: replica.port, | ||
user: replica.user, | ||
user: await replica.user, | ||
}); | ||
@@ -556,0 +556,0 @@ read_client._node_id = `SLAVE${i + 1}`; |
@@ -1,6 +0,6 @@ | ||
export interface IAdapterSettingsPostgreSQL { | ||
export interface AdapterSettingsPostgreSQL { | ||
host?: string; | ||
port?: number; | ||
user?: string; | ||
password?: string; | ||
user?: string | Promise<string>; | ||
password?: string | Promise<string>; | ||
database: string; | ||
@@ -7,0 +7,0 @@ } |
@@ -440,5 +440,5 @@ "use strict"; | ||
host: settings.host, | ||
password: settings.password, | ||
password: await settings.password, | ||
port: settings.port, | ||
user: settings.user, | ||
user: await settings.user, | ||
}); | ||
@@ -445,0 +445,0 @@ try { |
@@ -1,2 +0,2 @@ | ||
export interface IAdapterSettingsRedis { | ||
export interface AdapterSettingsRedis { | ||
host?: string; | ||
@@ -3,0 +3,0 @@ port?: number; |
@@ -1,2 +0,2 @@ | ||
export interface IAdapterSettingsSQLite3 { | ||
export interface AdapterSettingsSQLite3 { | ||
database: string; | ||
@@ -3,0 +3,0 @@ } |
@@ -5,9 +5,9 @@ /// <reference types="node" /> | ||
import { AdapterBase } from '../adapters/base'; | ||
import { createAdapter as createMongoDBAdapter, IAdapterSettingsMongoDB, MongoDBAdapter } from '../adapters/mongodb'; | ||
import { createAdapter as createMySQLAdapter, IAdapterSettingsMySQL, MySQLAdapter } from '../adapters/mysql'; | ||
import { createAdapter as createPostgreSQLAdapter, IAdapterSettingsPostgreSQL, PostgreSQLAdapter } from '../adapters/postgresql'; | ||
import { createAdapter as createSQLite3Adapter, IAdapterSettingsSQLite3, SQLite3Adapter } from '../adapters/sqlite3'; | ||
import { ILogger } from '../logger'; | ||
import { BaseModel, IModelSchema, ModelColumnNamesWithId, ModelValueObject } from '../model'; | ||
import { IQueryArray, IQuerySingle } from '../query'; | ||
import { createAdapter as createMongoDBAdapter, AdapterSettingsMongoDB, MongoDBAdapter } from '../adapters/mongodb'; | ||
import { createAdapter as createMySQLAdapter, AdapterSettingsMySQL, MySQLAdapter } from '../adapters/mysql'; | ||
import { createAdapter as createPostgreSQLAdapter, AdapterSettingsPostgreSQL, PostgreSQLAdapter } from '../adapters/postgresql'; | ||
import { createAdapter as createSQLite3Adapter, AdapterSettingsSQLite3, SQLite3Adapter } from '../adapters/sqlite3'; | ||
import { Logger } from '../logger'; | ||
import { BaseModel, ModelSchema, ModelColumnNamesWithId, ModelValueObject } from '../model'; | ||
import { QueryArray, QuerySingle } from '../query'; | ||
import { IsolationLevel, Transaction } from '../transaction'; | ||
@@ -18,3 +18,3 @@ import * as types from '../types'; | ||
}; | ||
interface IRedisCacheSettings { | ||
interface RedisCacheSettings { | ||
client?: object; | ||
@@ -25,10 +25,18 @@ host?: string; | ||
} | ||
interface IConnectionSettings { | ||
interface ConnectionSettings { | ||
is_default?: boolean; | ||
redis_cache?: IRedisCacheSettings; | ||
redis_cache?: RedisCacheSettings; | ||
implicit_apply_schemas?: boolean; | ||
logger?: 'console' | 'color-console' | 'empty' | ILogger; | ||
logger?: 'console' | 'color-console' | 'empty' | Logger; | ||
} | ||
export interface MongoDBConnectionSettings extends ConnectionSettings, AdapterSettingsMongoDB { | ||
} | ||
export interface MySQLConnectionSettings extends ConnectionSettings, AdapterSettingsMySQL { | ||
} | ||
export interface PostgreSQLConnectionSettings extends ConnectionSettings, AdapterSettingsPostgreSQL { | ||
} | ||
export interface SQLite3ConnectionSettings extends ConnectionSettings, AdapterSettingsSQLite3 { | ||
} | ||
declare type AssociationIntegrityType = 'ignore' | 'nullify' | 'restrict' | 'delete'; | ||
export interface IAssociationHasManyOptions { | ||
export interface AssociationHasManyOptions { | ||
connection?: Connection; | ||
@@ -40,3 +48,3 @@ type?: string; | ||
} | ||
export interface IAssociationHasOneOptions { | ||
export interface AssociationHasOneOptions { | ||
connection?: Connection; | ||
@@ -48,3 +56,3 @@ type?: string; | ||
} | ||
export interface IAssociationBelongsToOptions { | ||
export interface AssociationBelongsToOptions { | ||
connection?: Connection; | ||
@@ -56,13 +64,13 @@ type?: string; | ||
} | ||
export interface ISchemaChange { | ||
export interface SchemaChange { | ||
message: string; | ||
ignorable?: boolean; | ||
} | ||
interface IAssociation { | ||
interface Association { | ||
type: 'hasMany' | 'hasOne' | 'belongsTo'; | ||
this_model: typeof BaseModel; | ||
target_model_or_column: string | typeof BaseModel; | ||
options?: IAssociationHasManyOptions | IAssociationHasOneOptions | IAssociationBelongsToOptions; | ||
options?: AssociationHasManyOptions | AssociationHasOneOptions | AssociationBelongsToOptions; | ||
} | ||
interface ITxModelClass<M extends BaseModel> { | ||
interface TxModelClass<M extends BaseModel> { | ||
new (data?: object): M; | ||
@@ -74,17 +82,17 @@ create(data?: ModelValueObject<M>): Promise<M>; | ||
delete(condition?: object): Promise<number>; | ||
query(): IQueryArray<M>; | ||
find(id: types.RecordID): IQuerySingle<M>; | ||
find(id: types.RecordID[]): IQueryArray<M>; | ||
findPreserve(ids: types.RecordID[]): IQueryArray<M>; | ||
where(condition?: object): IQueryArray<M>; | ||
select<K extends ModelColumnNamesWithId<M>>(columns: K[]): IQueryArray<M, Pick<M, K>>; | ||
select<K extends ModelColumnNamesWithId<M>>(columns?: string): IQueryArray<M, Pick<M, K>>; | ||
order(orders: string): IQueryArray<M>; | ||
group<G extends ModelColumnNamesWithId<M>, F>(group_by: G | G[], fields?: F): IQueryArray<M, { | ||
query(): QueryArray<M>; | ||
find(id: types.RecordID): QuerySingle<M>; | ||
find(id: types.RecordID[]): QueryArray<M>; | ||
findPreserve(ids: types.RecordID[]): QueryArray<M>; | ||
where(condition?: object): QueryArray<M>; | ||
select<K extends ModelColumnNamesWithId<M>>(columns: K[]): QueryArray<M, Pick<M, K>>; | ||
select<K extends ModelColumnNamesWithId<M>>(columns?: string): QueryArray<M, Pick<M, K>>; | ||
order(orders: string): QueryArray<M>; | ||
group<G extends ModelColumnNamesWithId<M>, F>(group_by: G | G[], fields?: F): QueryArray<M, { | ||
[field in keyof F]: number; | ||
} & Pick<M, G>>; | ||
group<F>(group_by: null, fields?: F): IQueryArray<M, { | ||
group<F>(group_by: null, fields?: F): QueryArray<M, { | ||
[field in keyof F]: number; | ||
}>; | ||
group<U>(group_by: string | null, fields?: object): IQueryArray<M, U>; | ||
group<U>(group_by: string | null, fields?: object): QueryArray<M, U>; | ||
} | ||
@@ -124,11 +132,11 @@ /** | ||
*/ | ||
constructor(adapter: 'mongodb' | typeof createMongoDBAdapter, settings: IConnectionSettings & IAdapterSettingsMongoDB); | ||
constructor(adapter: 'mysql' | typeof createMySQLAdapter, settings: IConnectionSettings & IAdapterSettingsMySQL); | ||
constructor(adapter: 'postgresql' | typeof createPostgreSQLAdapter, settings: IConnectionSettings & IAdapterSettingsPostgreSQL); | ||
constructor(adapter: 'sqlite3' | typeof createSQLite3Adapter, settings: IConnectionSettings & IAdapterSettingsSQLite3); | ||
constructor(adapter: 'sqlite3_memory' | typeof createSQLite3Adapter, settings: IConnectionSettings); | ||
constructor(adapter: 'mongodb' | typeof createMongoDBAdapter, settings: MongoDBConnectionSettings); | ||
constructor(adapter: 'mysql' | typeof createMySQLAdapter, settings: MySQLConnectionSettings); | ||
constructor(adapter: 'postgresql' | typeof createPostgreSQLAdapter, settings: PostgreSQLConnectionSettings); | ||
constructor(adapter: 'sqlite3' | typeof createSQLite3Adapter, settings: SQLite3ConnectionSettings); | ||
constructor(adapter: 'sqlite3_memory' | typeof createSQLite3Adapter, settings: ConnectionSettings); | ||
/** | ||
* Set logger | ||
*/ | ||
setLogger(logger?: 'console' | 'color-console' | 'empty' | ILogger): void; | ||
setLogger(logger?: 'console' | 'color-console' | 'empty' | Logger): void; | ||
/** | ||
@@ -142,3 +150,3 @@ * Closes this connection. | ||
*/ | ||
model(name: string, schema: IModelSchema): typeof BaseModel; | ||
model(name: string, schema: ModelSchema): typeof BaseModel; | ||
/** | ||
@@ -156,3 +164,3 @@ * Applies schemas | ||
*/ | ||
getSchemaChanges(): Promise<ISchemaChange[]>; | ||
getSchemaChanges(): Promise<SchemaChange[]>; | ||
/** | ||
@@ -178,3 +186,3 @@ * Drops all model tables | ||
*/ | ||
addAssociation(association: IAssociation): void; | ||
addAssociation(association: Association): void; | ||
/** | ||
@@ -201,20 +209,20 @@ * Returns inconsistent records against associations | ||
isolation_level?: IsolationLevel; | ||
models: [ITxModelClass<M1>]; | ||
}, block: (m1: ITxModelClass<M1>, transaction: Transaction) => Promise<T>): Promise<T>; | ||
models: [TxModelClass<M1>]; | ||
}, block: (m1: TxModelClass<M1>, transaction: Transaction) => Promise<T>): Promise<T>; | ||
transaction<T, M1 extends BaseModel, M2 extends BaseModel>(options: { | ||
isolation_level?: IsolationLevel; | ||
models: [ITxModelClass<M1>, ITxModelClass<M2>]; | ||
}, block: (m1: ITxModelClass<M1>, m2: ITxModelClass<M2>, transaction: Transaction) => Promise<T>): Promise<T>; | ||
models: [TxModelClass<M1>, TxModelClass<M2>]; | ||
}, block: (m1: TxModelClass<M1>, m2: TxModelClass<M2>, transaction: Transaction) => Promise<T>): Promise<T>; | ||
transaction<T, M1 extends BaseModel, M2 extends BaseModel, M3 extends BaseModel>(options: { | ||
isolation_level?: IsolationLevel; | ||
models: [ITxModelClass<M1>, ITxModelClass<M2>, ITxModelClass<M3>]; | ||
}, block: (m1: ITxModelClass<M1>, m2: ITxModelClass<M2>, m3: ITxModelClass<M3>, transaction: Transaction) => Promise<T>): Promise<T>; | ||
models: [TxModelClass<M1>, TxModelClass<M2>, TxModelClass<M3>]; | ||
}, block: (m1: TxModelClass<M1>, m2: TxModelClass<M2>, m3: TxModelClass<M3>, transaction: Transaction) => Promise<T>): Promise<T>; | ||
transaction<T, M1 extends BaseModel, M2 extends BaseModel, M3 extends BaseModel, M4 extends BaseModel>(options: { | ||
isolation_level?: IsolationLevel; | ||
models: [ITxModelClass<M1>, ITxModelClass<M2>, ITxModelClass<M3>, ITxModelClass<M4>]; | ||
}, block: (m1: ITxModelClass<M1>, m2: ITxModelClass<M2>, m3: ITxModelClass<M3>, m4: ITxModelClass<M4>, transaction: Transaction) => Promise<T>): Promise<T>; | ||
models: [TxModelClass<M1>, TxModelClass<M2>, TxModelClass<M3>, TxModelClass<M4>]; | ||
}, block: (m1: TxModelClass<M1>, m2: TxModelClass<M2>, m3: TxModelClass<M3>, m4: TxModelClass<M4>, transaction: Transaction) => Promise<T>): Promise<T>; | ||
transaction<T, M1 extends BaseModel, M2 extends BaseModel, M3 extends BaseModel, M4 extends BaseModel, M5 extends BaseModel>(options: { | ||
isolation_level?: IsolationLevel; | ||
models: [ITxModelClass<M1>, ITxModelClass<M2>, ITxModelClass<M3>, ITxModelClass<M4>, ITxModelClass<M4>]; | ||
}, block: (m1: ITxModelClass<M1>, m2: ITxModelClass<M2>, m3: ITxModelClass<M3>, m4: ITxModelClass<M4>, m5: ITxModelClass<M5>, transaction: Transaction) => Promise<T>): Promise<T>; | ||
models: [TxModelClass<M1>, TxModelClass<M2>, TxModelClass<M3>, TxModelClass<M4>, TxModelClass<M4>]; | ||
}, block: (m1: TxModelClass<M1>, m2: TxModelClass<M2>, m3: TxModelClass<M3>, m4: TxModelClass<M4>, m5: TxModelClass<M5>, transaction: Transaction) => Promise<T>): Promise<T>; | ||
transaction<T>(options: { | ||
@@ -253,13 +261,13 @@ isolation_level?: IsolationLevel; | ||
export declare class MongoDBConnection extends Connection<MongoDBAdapter> { | ||
constructor(settings: IConnectionSettings & IAdapterSettingsMongoDB); | ||
constructor(settings: ConnectionSettings & AdapterSettingsMongoDB); | ||
} | ||
export declare class MySQLConnection extends Connection<MySQLAdapter> { | ||
constructor(settings: IConnectionSettings & IAdapterSettingsMySQL); | ||
constructor(settings: ConnectionSettings & AdapterSettingsMySQL); | ||
} | ||
export declare class PostgreSQLConnection extends Connection<PostgreSQLAdapter> { | ||
constructor(settings: IConnectionSettings & IAdapterSettingsPostgreSQL); | ||
constructor(settings: ConnectionSettings & AdapterSettingsPostgreSQL); | ||
} | ||
export declare class SQLite3Connection extends Connection<SQLite3Adapter> { | ||
constructor(settings: IConnectionSettings & IAdapterSettingsSQLite3); | ||
constructor(settings: ConnectionSettings & AdapterSettingsSQLite3); | ||
} | ||
export { Connection }; |
@@ -1,3 +0,3 @@ | ||
import { Connection, IAssociationBelongsToOptions, IAssociationHasManyOptions, IAssociationHasOneOptions } from './connection'; | ||
import { BaseModel, IColumnNestedProperty, IColumnProperty } from './model'; | ||
import { Connection, AssociationBelongsToOptions, AssociationHasManyOptions, AssociationHasOneOptions } from './connection'; | ||
import { BaseModel, ColumnNestedProperty, ColumnProperty } from './model'; | ||
import * as types from './types'; | ||
@@ -8,7 +8,7 @@ export declare function Model(options?: { | ||
}): (ctor: typeof BaseModel) => void; | ||
export declare function Column(column_property: types.ColumnType | types.ColumnType[] | IColumnProperty | IColumnNestedProperty): PropertyDecorator; | ||
export declare function Column(column_property: types.ColumnType | types.ColumnType[] | ColumnProperty | ColumnNestedProperty): PropertyDecorator; | ||
export declare function ObjectColumn(partial_model_class: any): PropertyDecorator; | ||
export declare function HasMany(options?: IAssociationHasManyOptions): (target: BaseModel, propertyKey: string) => void; | ||
export declare function HasOne(options?: IAssociationHasOneOptions): (target: BaseModel, propertyKey: string) => void; | ||
export declare function BelongsTo(options?: IAssociationBelongsToOptions): (target: BaseModel, propertyKey: string) => void; | ||
export declare function HasMany(options?: AssociationHasManyOptions): (target: BaseModel, propertyKey: string) => void; | ||
export declare function HasOne(options?: AssociationHasOneOptions): (target: BaseModel, propertyKey: string) => void; | ||
export declare function BelongsTo(options?: AssociationBelongsToOptions): (target: BaseModel, propertyKey: string) => void; | ||
export declare function Index(columns: { | ||
@@ -15,0 +15,0 @@ [column: string]: 1 | -1; |
@@ -9,3 +9,3 @@ /** | ||
*/ | ||
export { Connection, MongoDBConnection, MySQLConnection, PostgreSQLConnection, SQLite3Connection } from './connection'; | ||
export { Connection, MongoDBConnection, MongoDBConnectionSettings, MySQLConnection, MySQLConnectionSettings, PostgreSQLConnection, PostgreSQLConnectionSettings, SQLite3Connection, SQLite3ConnectionSettings, } from './connection'; | ||
/** | ||
@@ -21,3 +21,3 @@ * Exports [[#BaseModel]] class | ||
export { Command } from './command'; | ||
export { IQueryArray, IQuerySingle, Query } from './query'; | ||
export { QueryArray, QuerySingle, Query } from './query'; | ||
export * from './decorators'; | ||
@@ -24,0 +24,0 @@ /** |
@@ -1,4 +0,4 @@ | ||
import { ILogger } from './ILogger'; | ||
export declare class ColorConsoleLogger implements ILogger { | ||
import { Logger } from './Logger'; | ||
export declare class ColorConsoleLogger implements Logger { | ||
logQuery(text: string, values?: any[]): void; | ||
} |
@@ -1,4 +0,4 @@ | ||
import { ILogger } from './ILogger'; | ||
export declare class ConsoleLogger implements ILogger { | ||
import { Logger } from './Logger'; | ||
export declare class ConsoleLogger implements Logger { | ||
logQuery(text: string, values?: any[]): void; | ||
} |
@@ -1,4 +0,4 @@ | ||
import { ILogger } from './ILogger'; | ||
export declare class EmptyLogger implements ILogger { | ||
import { Logger } from './Logger'; | ||
export declare class EmptyLogger implements Logger { | ||
logQuery(text: string, values?: any[]): void; | ||
} |
export * from './ColorConsoleLogger'; | ||
export * from './ConsoleLogger'; | ||
export * from './EmptyLogger'; | ||
export * from './ILogger'; | ||
export * from './Logger'; |
/// <reference types="node" /> | ||
import { inspect } from 'util'; | ||
import { AdapterBase } from '../adapters/base'; | ||
import { Connection, IAssociationBelongsToOptions, IAssociationHasManyOptions, IAssociationHasOneOptions } from '../connection'; | ||
import { IQueryArray, IQuerySingle } from '../query'; | ||
import { Connection, AssociationBelongsToOptions, AssociationHasManyOptions, AssociationHasOneOptions } from '../connection'; | ||
import { QueryArray, QuerySingle } from '../query'; | ||
import { Transaction } from '../transaction'; | ||
@@ -13,3 +13,3 @@ import * as types from '../types'; | ||
export declare type ModelValueObjectWithId<M> = Pick<M, ModelColumnNamesWithId<M>>; | ||
export interface IColumnProperty { | ||
export interface ColumnProperty { | ||
type: types.ColumnType | types.ColumnType[]; | ||
@@ -24,3 +24,3 @@ array?: boolean; | ||
} | ||
export interface IColumnPropertyInternal extends IColumnProperty { | ||
export interface ColumnPropertyInternal extends ColumnProperty { | ||
type: types.ColumnTypeInternal; | ||
@@ -35,10 +35,10 @@ record_id?: boolean; | ||
} | ||
export interface IColumnNestedProperty { | ||
[subcolumn: string]: types.ColumnType | types.ColumnType[] | IColumnProperty | IColumnNestedProperty; | ||
export interface ColumnNestedProperty { | ||
[subcolumn: string]: types.ColumnType | types.ColumnType[] | ColumnProperty | ColumnNestedProperty; | ||
} | ||
export interface IModelSchema { | ||
[path: string]: types.ColumnType | types.ColumnType[] | IColumnProperty | IColumnNestedProperty; | ||
export interface ModelSchema { | ||
[path: string]: types.ColumnType | types.ColumnType[] | ColumnProperty | ColumnNestedProperty; | ||
} | ||
export interface IModelSchemaInternal { | ||
[path: string]: IColumnPropertyInternal; | ||
export interface ModelSchemaInternal { | ||
[path: string]: ColumnPropertyInternal; | ||
} | ||
@@ -71,3 +71,3 @@ /** | ||
static _name: string; | ||
static _schema: IModelSchemaInternal; | ||
static _schema: ModelSchemaInternal; | ||
static _object_column_classes: Array<{ | ||
@@ -88,3 +88,3 @@ column: string; | ||
*/ | ||
static newModel(connection: Connection, name: string, schema: IModelSchema): typeof BaseModel; | ||
static newModel(connection: Connection, name: string, schema: ModelSchema): typeof BaseModel; | ||
/** | ||
@@ -101,3 +101,3 @@ * Sets a connection of this model | ||
*/ | ||
static column(path: string, type_or_property: types.ColumnType | types.ColumnType[] | IColumnProperty | IColumnNestedProperty): void; | ||
static column(path: string, type_or_property: types.ColumnType | types.ColumnType[] | ColumnProperty | ColumnNestedProperty): void; | ||
/** | ||
@@ -129,11 +129,11 @@ * Adds an index to this model | ||
*/ | ||
static hasMany(target_model_or_column: string | typeof BaseModel, options?: IAssociationHasManyOptions): void; | ||
static hasMany(target_model_or_column: string | typeof BaseModel, options?: AssociationHasManyOptions): void; | ||
/** | ||
* Adds a has-one association | ||
*/ | ||
static hasOne(target_model_or_column: string | typeof BaseModel, options?: IAssociationHasOneOptions): void; | ||
static hasOne(target_model_or_column: string | typeof BaseModel, options?: AssociationHasOneOptions): void; | ||
/** | ||
* Adds a belongs-to association | ||
*/ | ||
static belongsTo(target_model_or_column: string | typeof BaseModel, options?: IAssociationBelongsToOptions): void; | ||
static belongsTo(target_model_or_column: string | typeof BaseModel, options?: AssociationBelongsToOptions): void; | ||
static [inspect.custom](depth: number): string; | ||
@@ -215,3 +215,3 @@ static _getKeyType(target_connection?: Connection<AdapterBase>): any; | ||
transaction?: Transaction; | ||
}): IQueryArray<M>; | ||
}): QueryArray<M>; | ||
/** | ||
@@ -223,6 +223,6 @@ * Finds a record by id | ||
transaction?: Transaction; | ||
}): IQuerySingle<M>; | ||
}): QuerySingle<M>; | ||
static find<M extends BaseModel>(this: (new (data?: any) => M) & typeof BaseModel, id: types.RecordID[], options?: { | ||
transaction?: Transaction; | ||
}): IQueryArray<M>; | ||
}): QueryArray<M>; | ||
/** | ||
@@ -234,3 +234,3 @@ * Finds records by ids while preserving order. | ||
transaction?: Transaction; | ||
}): IQueryArray<M>; | ||
}): QueryArray<M>; | ||
/** | ||
@@ -241,3 +241,3 @@ * Finds records by conditions | ||
transaction?: Transaction; | ||
}): IQueryArray<M>; | ||
}): QueryArray<M>; | ||
/** | ||
@@ -248,6 +248,6 @@ * Selects columns for result | ||
transaction?: Transaction; | ||
}): IQueryArray<M, Pick<M, K>>; | ||
}): QueryArray<M, Pick<M, K>>; | ||
static select<M extends BaseModel, K extends ModelColumnNamesWithId<M>>(this: (new (data?: any) => M) & typeof BaseModel, columns?: string, options?: { | ||
transaction?: Transaction; | ||
}): IQueryArray<M, Pick<M, K>>; | ||
}): QueryArray<M, Pick<M, K>>; | ||
/** | ||
@@ -258,3 +258,3 @@ * Specifies orders of result | ||
transaction?: Transaction; | ||
}): IQueryArray<M>; | ||
}): QueryArray<M>; | ||
/** | ||
@@ -265,3 +265,3 @@ * Groups result records | ||
transaction?: Transaction; | ||
}): IQueryArray<M, { | ||
}): QueryArray<M, { | ||
[field in keyof F]: number; | ||
@@ -271,3 +271,3 @@ } & Pick<M, G>>; | ||
transaction?: Transaction; | ||
}): IQueryArray<M, { | ||
}): QueryArray<M, { | ||
[field in keyof F]: number; | ||
@@ -277,3 +277,3 @@ }>; | ||
transaction?: Transaction; | ||
}): IQueryArray<M, U>; | ||
}): QueryArray<M, U>; | ||
/** | ||
@@ -306,4 +306,4 @@ * Counts records by conditions | ||
static addValidator(validator: any): void; | ||
static _buildSaveDataColumn(data: any, model: any, column: string, property: IColumnPropertyInternal, allow_null?: boolean): void; | ||
static _validateColumn(data: any, column: string, property: IColumnPropertyInternal, for_update?: boolean): void; | ||
static _buildSaveDataColumn(data: any, model: any, column: string, property: ColumnPropertyInternal, allow_null?: boolean): void; | ||
static _validateColumn(data: any, column: string, property: ColumnPropertyInternal, for_update?: boolean): void; | ||
private static _validators; | ||
@@ -310,0 +310,0 @@ private static _callbacks_map; |
@@ -6,3 +6,3 @@ /// <reference types="node" /> | ||
import { RecordID } from './types'; | ||
interface IQueryOptions { | ||
interface QueryOptions { | ||
lean: boolean; | ||
@@ -29,31 +29,31 @@ orders?: string; | ||
} | ||
export interface IQuerySingle<M extends BaseModel, T = M> extends PromiseLike<T> { | ||
clone(): IQuerySingle<M, T>; | ||
find(id: RecordID): IQuerySingle<M, T>; | ||
find(id: RecordID[]): IQueryArray<M, T>; | ||
findPreserve(id: RecordID[]): IQueryArray<M, T>; | ||
near(target: object): IQuerySingle<M, T>; | ||
where(condition?: object): IQuerySingle<M, T>; | ||
select<K extends ModelColumnNamesWithId<M>>(columns: K[]): IQuerySingle<M, Pick<M, K>>; | ||
select<K extends ModelColumnNamesWithId<M>>(columns?: string): IQuerySingle<M, Pick<M, K>>; | ||
selectSingle<K extends ModelColumnNamesWithId<M>>(column: K): IQuerySingle<M, M[K]>; | ||
order(orders?: string): IQuerySingle<M, T>; | ||
group<G extends ModelColumnNamesWithId<M>, F>(group_by: G | G[], fields?: F): IQuerySingle<M, { | ||
export interface QuerySingle<M extends BaseModel, T = M> extends PromiseLike<T> { | ||
clone(): QuerySingle<M, T>; | ||
find(id: RecordID): QuerySingle<M, T>; | ||
find(id: RecordID[]): QueryArray<M, T>; | ||
findPreserve(id: RecordID[]): QueryArray<M, T>; | ||
near(target: object): QuerySingle<M, T>; | ||
where(condition?: object): QuerySingle<M, T>; | ||
select<K extends ModelColumnNamesWithId<M>>(columns: K[]): QuerySingle<M, Pick<M, K>>; | ||
select<K extends ModelColumnNamesWithId<M>>(columns?: string): QuerySingle<M, Pick<M, K>>; | ||
selectSingle<K extends ModelColumnNamesWithId<M>>(column: K): QuerySingle<M, M[K]>; | ||
order(orders?: string): QuerySingle<M, T>; | ||
group<G extends ModelColumnNamesWithId<M>, F>(group_by: G | G[], fields?: F): QuerySingle<M, { | ||
[field in keyof F]: number; | ||
} & Pick<M, G>>; | ||
group<F>(group_by: null, fields?: F): IQuerySingle<M, { | ||
group<F>(group_by: null, fields?: F): QuerySingle<M, { | ||
[field in keyof F]: number; | ||
}>; | ||
group<U>(group_by: string | null, fields?: object): IQuerySingle<M, U>; | ||
one(): IQuerySingleNull<M, T>; | ||
limit(limit?: number): IQuerySingle<M, T>; | ||
skip(skip?: number): IQuerySingle<M, T>; | ||
lean(lean?: boolean): IQuerySingle<M, T>; | ||
if(condition: boolean): IQuerySingle<M, T>; | ||
endif(): IQuerySingle<M, T>; | ||
cache(options: IQueryOptions['cache']): IQuerySingle<M, T>; | ||
include(column: string, select?: string): IQuerySingle<M, T>; | ||
transaction(transaction?: Transaction): IQuerySingle<M, T>; | ||
using(node: 'master' | 'read'): IQuerySingle<M, T>; | ||
index_hint(hint: string): IQuerySingle<M, T>; | ||
group<U>(group_by: string | null, fields?: object): QuerySingle<M, U>; | ||
one(): QuerySingleNull<M, T>; | ||
limit(limit?: number): QuerySingle<M, T>; | ||
skip(skip?: number): QuerySingle<M, T>; | ||
lean(lean?: boolean): QuerySingle<M, T>; | ||
if(condition: boolean): QuerySingle<M, T>; | ||
endif(): QuerySingle<M, T>; | ||
cache(options: QueryOptions['cache']): QuerySingle<M, T>; | ||
include(column: string, select?: string): QuerySingle<M, T>; | ||
transaction(transaction?: Transaction): QuerySingle<M, T>; | ||
using(node: 'master' | 'read'): QuerySingle<M, T>; | ||
index_hint(hint: string): QuerySingle<M, T>; | ||
exec(options?: { | ||
@@ -69,31 +69,31 @@ skip_log?: boolean; | ||
} | ||
interface IQuerySingleNull<M extends BaseModel, T = M> extends PromiseLike<T | null> { | ||
clone(): IQuerySingleNull<M, T>; | ||
find(id: RecordID): IQuerySingle<M, T>; | ||
find(id: RecordID[]): IQueryArray<M, T>; | ||
findPreserve(id: RecordID[]): IQueryArray<M, T>; | ||
near(target: object): IQuerySingleNull<M, T>; | ||
where(condition?: object): IQuerySingleNull<M, T>; | ||
select<K extends ModelColumnNamesWithId<M>>(columns: K[]): IQuerySingleNull<M, Pick<M, K>>; | ||
select<K extends ModelColumnNamesWithId<M>>(columns?: string): IQuerySingleNull<M, Pick<M, K>>; | ||
selectSingle<K extends ModelColumnNamesWithId<M>>(column: K): IQuerySingleNull<M, M[K]>; | ||
order(orders?: string): IQuerySingleNull<M, T>; | ||
group<G extends ModelColumnNamesWithId<M>, F>(group_by: G | G[], fields?: F): IQuerySingleNull<M, { | ||
interface QuerySingleNull<M extends BaseModel, T = M> extends PromiseLike<T | null> { | ||
clone(): QuerySingleNull<M, T>; | ||
find(id: RecordID): QuerySingle<M, T>; | ||
find(id: RecordID[]): QueryArray<M, T>; | ||
findPreserve(id: RecordID[]): QueryArray<M, T>; | ||
near(target: object): QuerySingleNull<M, T>; | ||
where(condition?: object): QuerySingleNull<M, T>; | ||
select<K extends ModelColumnNamesWithId<M>>(columns: K[]): QuerySingleNull<M, Pick<M, K>>; | ||
select<K extends ModelColumnNamesWithId<M>>(columns?: string): QuerySingleNull<M, Pick<M, K>>; | ||
selectSingle<K extends ModelColumnNamesWithId<M>>(column: K): QuerySingleNull<M, M[K]>; | ||
order(orders?: string): QuerySingleNull<M, T>; | ||
group<G extends ModelColumnNamesWithId<M>, F>(group_by: G | G[], fields?: F): QuerySingleNull<M, { | ||
[field in keyof F]: number; | ||
} & Pick<M, G>>; | ||
group<F>(group_by: null, fields?: F): IQuerySingleNull<M, { | ||
group<F>(group_by: null, fields?: F): QuerySingleNull<M, { | ||
[field in keyof F]: number; | ||
}>; | ||
group<U>(group_by: string | null, fields?: object): IQuerySingleNull<M, U>; | ||
one(): IQuerySingleNull<M, T>; | ||
limit(limit?: number): IQuerySingleNull<M, T>; | ||
skip(skip?: number): IQuerySingleNull<M, T>; | ||
lean(lean?: boolean): IQuerySingleNull<M, T>; | ||
if(condition: boolean): IQuerySingleNull<M, T>; | ||
endif(): IQuerySingleNull<M, T>; | ||
cache(options: IQueryOptions['cache']): IQuerySingleNull<M, T>; | ||
include(column: string, select?: string): IQuerySingleNull<M, T>; | ||
transaction(transaction?: Transaction): IQuerySingleNull<M, T>; | ||
using(node: 'master' | 'read'): IQuerySingleNull<M, T>; | ||
index_hint(hint: string): IQuerySingleNull<M, T>; | ||
group<U>(group_by: string | null, fields?: object): QuerySingleNull<M, U>; | ||
one(): QuerySingleNull<M, T>; | ||
limit(limit?: number): QuerySingleNull<M, T>; | ||
skip(skip?: number): QuerySingleNull<M, T>; | ||
lean(lean?: boolean): QuerySingleNull<M, T>; | ||
if(condition: boolean): QuerySingleNull<M, T>; | ||
endif(): QuerySingleNull<M, T>; | ||
cache(options: QueryOptions['cache']): QuerySingleNull<M, T>; | ||
include(column: string, select?: string): QuerySingleNull<M, T>; | ||
transaction(transaction?: Transaction): QuerySingleNull<M, T>; | ||
using(node: 'master' | 'read'): QuerySingleNull<M, T>; | ||
index_hint(hint: string): QuerySingleNull<M, T>; | ||
exec(options?: { | ||
@@ -109,31 +109,31 @@ skip_log?: boolean; | ||
} | ||
export interface IQueryArray<M extends BaseModel, T = M> extends PromiseLike<T[]> { | ||
clone(): IQueryArray<M, T>; | ||
find(id: RecordID): IQuerySingle<M, T>; | ||
find(id: RecordID[]): IQueryArray<M, T>; | ||
findPreserve(id: RecordID[]): IQueryArray<M, T>; | ||
near(target: object): IQueryArray<M, T>; | ||
where(condition?: object): IQueryArray<M, T>; | ||
select<K extends ModelColumnNamesWithId<M>>(columns: K[]): IQueryArray<M, Pick<M, K>>; | ||
select<K extends ModelColumnNamesWithId<M>>(columns?: string): IQueryArray<M, Pick<M, K>>; | ||
selectSingle<K extends ModelColumnNamesWithId<M>>(column: K): IQueryArray<M, M[K]>; | ||
order(orders?: string): IQueryArray<M, T>; | ||
group<G extends ModelColumnNamesWithId<M>, F>(group_by: G | G[], fields?: F): IQueryArray<M, { | ||
export interface QueryArray<M extends BaseModel, T = M> extends PromiseLike<T[]> { | ||
clone(): QueryArray<M, T>; | ||
find(id: RecordID): QuerySingle<M, T>; | ||
find(id: RecordID[]): QueryArray<M, T>; | ||
findPreserve(id: RecordID[]): QueryArray<M, T>; | ||
near(target: object): QueryArray<M, T>; | ||
where(condition?: object): QueryArray<M, T>; | ||
select<K extends ModelColumnNamesWithId<M>>(columns: K[]): QueryArray<M, Pick<M, K>>; | ||
select<K extends ModelColumnNamesWithId<M>>(columns?: string): QueryArray<M, Pick<M, K>>; | ||
selectSingle<K extends ModelColumnNamesWithId<M>>(column: K): QueryArray<M, M[K]>; | ||
order(orders?: string): QueryArray<M, T>; | ||
group<G extends ModelColumnNamesWithId<M>, F>(group_by: G | G[], fields?: F): QueryArray<M, { | ||
[field in keyof F]: number; | ||
} & Pick<M, G>>; | ||
group<F>(group_by: null, fields?: F): IQueryArray<M, { | ||
group<F>(group_by: null, fields?: F): QueryArray<M, { | ||
[field in keyof F]: number; | ||
}>; | ||
group<U>(group_by: string | null, fields?: object): IQueryArray<M, U>; | ||
one(): IQuerySingleNull<M, T>; | ||
limit(limit?: number): IQueryArray<M, T>; | ||
skip(skip?: number): IQueryArray<M, T>; | ||
lean(lean?: boolean): IQueryArray<M, T>; | ||
if(condition: boolean): IQueryArray<M, T>; | ||
endif(): IQueryArray<M, T>; | ||
cache(options: IQueryOptions['cache']): IQueryArray<M, T>; | ||
include(column: string, select?: string): IQueryArray<M, T>; | ||
transaction(transaction?: Transaction): IQueryArray<M, T>; | ||
using(node: 'master' | 'read'): IQueryArray<M, T>; | ||
index_hint(hint: string): IQueryArray<M, T>; | ||
group<U>(group_by: string | null, fields?: object): QueryArray<M, U>; | ||
one(): QuerySingleNull<M, T>; | ||
limit(limit?: number): QueryArray<M, T>; | ||
skip(skip?: number): QueryArray<M, T>; | ||
lean(lean?: boolean): QueryArray<M, T>; | ||
if(condition: boolean): QueryArray<M, T>; | ||
endif(): QueryArray<M, T>; | ||
cache(options: QueryOptions['cache']): QueryArray<M, T>; | ||
include(column: string, select?: string): QueryArray<M, T>; | ||
transaction(transaction?: Transaction): QueryArray<M, T>; | ||
using(node: 'master' | 'read'): QueryArray<M, T>; | ||
index_hint(hint: string): QueryArray<M, T>; | ||
exec(options?: { | ||
@@ -152,3 +152,3 @@ skip_log?: boolean; | ||
*/ | ||
declare class Query<M extends BaseModel, T = M> implements IQuerySingle<M, T>, IQueryArray<M, T> { | ||
declare class Query<M extends BaseModel, T = M> implements QuerySingle<M, T>, QueryArray<M, T> { | ||
private _model; | ||
@@ -175,8 +175,8 @@ private _name; | ||
*/ | ||
find(id: RecordID): IQuerySingle<M, T>; | ||
find(id: RecordID[]): IQueryArray<M, T>; | ||
find(id: RecordID): QuerySingle<M, T>; | ||
find(id: RecordID[]): QueryArray<M, T>; | ||
/** | ||
* Finds records by ids while preserving order. | ||
*/ | ||
findPreserve(ids: RecordID[]): IQueryArray<M, T>; | ||
findPreserve(ids: RecordID[]): QueryArray<M, T>; | ||
/** | ||
@@ -193,6 +193,6 @@ * Finds records near target | ||
*/ | ||
select<K extends ModelColumnNamesWithId<M>>(columns?: string | string[]): IQuerySingle<M, Pick<M, K>>; | ||
select<K extends ModelColumnNamesWithId<M>>(columns?: string | string[]): IQueryArray<M, Pick<M, K>>; | ||
selectSingle<K extends ModelColumnNamesWithId<M>>(column: K): IQuerySingle<M, M[K]>; | ||
selectSingle<K extends ModelColumnNamesWithId<M>>(column: K): IQueryArray<M, M[K]>; | ||
select<K extends ModelColumnNamesWithId<M>>(columns?: string | string[]): QuerySingle<M, Pick<M, K>>; | ||
select<K extends ModelColumnNamesWithId<M>>(columns?: string | string[]): QueryArray<M, Pick<M, K>>; | ||
selectSingle<K extends ModelColumnNamesWithId<M>>(column: K): QuerySingle<M, M[K]>; | ||
selectSingle<K extends ModelColumnNamesWithId<M>>(column: K): QueryArray<M, M[K]>; | ||
/** | ||
@@ -205,4 +205,4 @@ * Specifies orders of result | ||
*/ | ||
group<U>(group_by: string | string[] | null, fields?: object): IQuerySingle<M, U>; | ||
group<U>(group_by: string | string[] | null, fields?: object): IQueryArray<M, U>; | ||
group<U>(group_by: string | string[] | null, fields?: object): QuerySingle<M, U>; | ||
group<U>(group_by: string | string[] | null, fields?: object): QueryArray<M, U>; | ||
/** | ||
@@ -246,3 +246,3 @@ * Returns only one record (or null if does not exists). | ||
*/ | ||
cache(options: IQueryOptions['cache']): this; | ||
cache(options: QueryOptions['cache']): this; | ||
/** | ||
@@ -249,0 +249,0 @@ * Returns associated objects also |
@@ -11,11 +11,11 @@ /** | ||
*/ | ||
export interface ICormoTypesString { | ||
export interface CormoTypesString { | ||
_type: 'string'; | ||
length?: number; | ||
} | ||
interface ICormoTypesStringConstructor { | ||
new (length?: number): ICormoTypesString; | ||
(length?: number): ICormoTypesString; | ||
interface CormoTypesStringConstructor { | ||
new (length?: number): CormoTypesString; | ||
(length?: number): CormoTypesString; | ||
} | ||
declare const CormoTypesString: ICormoTypesStringConstructor; | ||
declare const CormoTypesString: CormoTypesStringConstructor; | ||
/** | ||
@@ -26,10 +26,10 @@ * Represents a double-precision floating-point, used in model schemas. | ||
*/ | ||
export interface ICormoTypesNumber { | ||
export interface CormoTypesNumber { | ||
_type: 'number'; | ||
} | ||
interface ICormoTypesNumberConstructor { | ||
new (): ICormoTypesNumber; | ||
(): ICormoTypesNumber; | ||
interface CormoTypesNumberConstructor { | ||
new (): CormoTypesNumber; | ||
(): CormoTypesNumber; | ||
} | ||
declare const CormoTypesNumber: ICormoTypesNumberConstructor; | ||
declare const CormoTypesNumber: CormoTypesNumberConstructor; | ||
/** | ||
@@ -40,10 +40,10 @@ * Represents a boolean, used in model schemas. | ||
*/ | ||
export interface ICormoTypesBoolean { | ||
export interface CormoTypesBoolean { | ||
_type: 'boolean'; | ||
} | ||
interface ICormoTypesBooleanConstructor { | ||
new (): ICormoTypesBoolean; | ||
(): ICormoTypesBoolean; | ||
interface CormoTypesBooleanConstructor { | ||
new (): CormoTypesBoolean; | ||
(): CormoTypesBoolean; | ||
} | ||
declare const CormoTypesBoolean: ICormoTypesBooleanConstructor; | ||
declare const CormoTypesBoolean: CormoTypesBooleanConstructor; | ||
/** | ||
@@ -54,10 +54,10 @@ * Represents a 32bit integer, used in model schemas. | ||
*/ | ||
export interface ICormoTypesInteger { | ||
export interface CormoTypesInteger { | ||
_type: 'integer'; | ||
} | ||
interface ICormoTypesIntegerConstructor { | ||
new (): ICormoTypesInteger; | ||
(): ICormoTypesInteger; | ||
interface CormoTypesIntegerConstructor { | ||
new (): CormoTypesInteger; | ||
(): CormoTypesInteger; | ||
} | ||
declare const CormoTypesInteger: ICormoTypesIntegerConstructor; | ||
declare const CormoTypesInteger: CormoTypesIntegerConstructor; | ||
/** | ||
@@ -70,10 +70,10 @@ * Represents a two-dimensional point, used in model schemas. | ||
*/ | ||
export interface ICormoTypesGeoPoint { | ||
export interface CormoTypesGeoPoint { | ||
_type: 'geopoint'; | ||
} | ||
interface ICormoTypesGeoPointConstructor { | ||
new (): ICormoTypesGeoPoint; | ||
(): ICormoTypesGeoPoint; | ||
interface CormoTypesGeoPointConstructor { | ||
new (): CormoTypesGeoPoint; | ||
(): CormoTypesGeoPoint; | ||
} | ||
declare const CormoTypesGeoPoint: ICormoTypesGeoPointConstructor; | ||
declare const CormoTypesGeoPoint: CormoTypesGeoPointConstructor; | ||
/** | ||
@@ -84,10 +84,10 @@ * Represents a date, used in model schemas. | ||
*/ | ||
export interface ICormoTypesDate { | ||
export interface CormoTypesDate { | ||
_type: 'date'; | ||
} | ||
interface ICormoTypesDateConstructor { | ||
new (): ICormoTypesDate; | ||
(): ICormoTypesDate; | ||
interface CormoTypesDateConstructor { | ||
new (): CormoTypesDate; | ||
(): CormoTypesDate; | ||
} | ||
declare const CormoTypesDate: ICormoTypesDateConstructor; | ||
declare const CormoTypesDate: CormoTypesDateConstructor; | ||
/** | ||
@@ -101,10 +101,10 @@ * Represents a general object, used in model schemas. | ||
*/ | ||
export interface ICormoTypesObject { | ||
export interface CormoTypesObject { | ||
_type: 'object'; | ||
} | ||
interface ICormoTypesObjectConstructor { | ||
new (): ICormoTypesObject; | ||
(): ICormoTypesObject; | ||
interface CormoTypesObjectConstructor { | ||
new (): CormoTypesObject; | ||
(): CormoTypesObject; | ||
} | ||
declare const CormoTypesObject: ICormoTypesObjectConstructor; | ||
declare const CormoTypesObject: CormoTypesObjectConstructor; | ||
/** | ||
@@ -115,10 +115,10 @@ * Represents a record id, used in model schemas. | ||
*/ | ||
export interface ICormoTypesRecordID { | ||
export interface CormoTypesRecordID { | ||
_type: 'recordid'; | ||
} | ||
interface ICormoTypesRecordIDConstructor { | ||
new (): ICormoTypesRecordID; | ||
(): ICormoTypesRecordID; | ||
interface CormoTypesRecordIDConstructor { | ||
new (): CormoTypesRecordID; | ||
(): CormoTypesRecordID; | ||
} | ||
declare const CormoTypesRecordID: ICormoTypesRecordIDConstructor; | ||
declare const CormoTypesRecordID: CormoTypesRecordIDConstructor; | ||
/** | ||
@@ -129,12 +129,12 @@ * Represents a text, used in model schemas. | ||
*/ | ||
export interface ICormoTypesText { | ||
export interface CormoTypesText { | ||
_type: 'text'; | ||
} | ||
interface ICormoTypesTextConstructor { | ||
new (): ICormoTypesText; | ||
(): ICormoTypesText; | ||
interface CormoTypesTextConstructor { | ||
new (): CormoTypesText; | ||
(): CormoTypesText; | ||
} | ||
declare const CormoTypesText: ICormoTypesTextConstructor; | ||
export declare type ColumnTypeInternal = ICormoTypesString | ICormoTypesNumber | ICormoTypesBoolean | ICormoTypesDate | ICormoTypesObject | ICormoTypesInteger | ICormoTypesGeoPoint | ICormoTypesRecordID | ICormoTypesText; | ||
export declare type ColumnTypeInternalConstructor = ICormoTypesStringConstructor | ICormoTypesNumberConstructor | ICormoTypesBooleanConstructor | ICormoTypesDateConstructor | ICormoTypesObjectConstructor | ICormoTypesIntegerConstructor | ICormoTypesGeoPointConstructor | ICormoTypesRecordIDConstructor | ICormoTypesTextConstructor; | ||
declare const CormoTypesText: CormoTypesTextConstructor; | ||
export declare type ColumnTypeInternal = CormoTypesString | CormoTypesNumber | CormoTypesBoolean | CormoTypesDate | CormoTypesObject | CormoTypesInteger | CormoTypesGeoPoint | CormoTypesRecordID | CormoTypesText; | ||
export declare type ColumnTypeInternalConstructor = CormoTypesStringConstructor | CormoTypesNumberConstructor | CormoTypesBooleanConstructor | CormoTypesDateConstructor | CormoTypesObjectConstructor | CormoTypesIntegerConstructor | CormoTypesGeoPointConstructor | CormoTypesRecordIDConstructor | CormoTypesTextConstructor; | ||
declare type ColumnTypeNativeConstructor = StringConstructor | NumberConstructor | BooleanConstructor | DateConstructor | ObjectConstructor; | ||
@@ -141,0 +141,0 @@ declare type ColumnTypeString = 'string' | 'number' | 'boolean' | 'date' | 'object' | 'integer' | 'geopoint' | 'recordid' | 'text'; |
{ | ||
"name": "cormo", | ||
"description": "ORM framework for Node.js", | ||
"version": "0.14.2", | ||
"version": "0.14.3", | ||
"keywords": [ | ||
@@ -71,3 +71,3 @@ "orm", | ||
}, | ||
"gitHead": "f989d52181aee9df572c44c7577e5e914bc4bacf" | ||
"gitHead": "3c16d92a0676d0a07d22ee25f26499b6c9249ca3" | ||
} |
324351
8818