hysteria-orm 10.3.8 → 10.4.0
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/lib/cli.cjs +41 -29
- package/lib/cli.cjs.map +1 -1
- package/lib/cli.js +41 -29
- package/lib/cli.js.map +1 -1
- package/lib/index.cjs +21 -21
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +42 -1
- package/lib/index.d.ts +42 -1
- package/lib/index.js +21 -21
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.d.cts
CHANGED
|
@@ -1153,6 +1153,21 @@ type MigrationConfigWithTransactional = MigrationConfigBase & {
|
|
|
1153
1153
|
* @description Adds transactional option only for PostgreSQL and CockroachDB
|
|
1154
1154
|
*/
|
|
1155
1155
|
type MigrationConfig<D extends SqlDataSourceType = SqlDataSourceType> = D extends "postgres" | "cockroachdb" ? MigrationConfigWithTransactional : MigrationConfigBase;
|
|
1156
|
+
/**
|
|
1157
|
+
* @description Seeder configuration options
|
|
1158
|
+
*/
|
|
1159
|
+
type SeederConfig = {
|
|
1160
|
+
/**
|
|
1161
|
+
* @description The path to the seeders folder
|
|
1162
|
+
* @default "database/seeders"
|
|
1163
|
+
*/
|
|
1164
|
+
path?: string;
|
|
1165
|
+
/**
|
|
1166
|
+
* @description Path to the tsconfig.json file for TypeScript seeder files
|
|
1167
|
+
* @default "./tsconfig.json"
|
|
1168
|
+
*/
|
|
1169
|
+
tsconfig?: string;
|
|
1170
|
+
};
|
|
1156
1171
|
/**
|
|
1157
1172
|
* @description Common input properties shared across all SqlDataSource types
|
|
1158
1173
|
*/
|
|
@@ -1178,6 +1193,10 @@ type SqlDataSourceInputBase<T extends Record<string, SqlDataSourceModel> = {}, C
|
|
|
1178
1193
|
* @description Migration configuration for the sql data source
|
|
1179
1194
|
*/
|
|
1180
1195
|
migrations?: MigrationConfig<D>;
|
|
1196
|
+
/**
|
|
1197
|
+
* @description Seeder configuration for the sql data source
|
|
1198
|
+
*/
|
|
1199
|
+
seeders?: SeederConfig;
|
|
1181
1200
|
/**
|
|
1182
1201
|
* @description The cache strategy to use for the sql data source, it's used to configure the cache strategy for the sql data source
|
|
1183
1202
|
*/
|
|
@@ -3837,6 +3856,13 @@ declare class SqlDataSource<D extends SqlDataSourceType = SqlDataSourceType, T e
|
|
|
3837
3856
|
transactional: boolean;
|
|
3838
3857
|
lockTimeout?: number;
|
|
3839
3858
|
};
|
|
3859
|
+
/**
|
|
3860
|
+
* @description Seeder configuration for the sql data source
|
|
3861
|
+
*/
|
|
3862
|
+
seederConfig: {
|
|
3863
|
+
path: string;
|
|
3864
|
+
tsconfig?: string;
|
|
3865
|
+
};
|
|
3840
3866
|
/**
|
|
3841
3867
|
* @description AdminJS configuration options
|
|
3842
3868
|
*/
|
|
@@ -6081,6 +6107,21 @@ declare class HysteriaLogger {
|
|
|
6081
6107
|
static warn(message: string): void;
|
|
6082
6108
|
}
|
|
6083
6109
|
|
|
6110
|
+
/**
|
|
6111
|
+
* @description Base class for all seeders
|
|
6112
|
+
* @description Provides access to the SqlDataSource instance
|
|
6113
|
+
*/
|
|
6114
|
+
declare abstract class BaseSeeder {
|
|
6115
|
+
protected sqlDataSource: SqlDataSource;
|
|
6116
|
+
readonly logger: typeof HysteriaLogger;
|
|
6117
|
+
constructor(sqlDataSource: SqlDataSource);
|
|
6118
|
+
/**
|
|
6119
|
+
* @description Run the seeder
|
|
6120
|
+
* @description This method should be implemented by all seeders
|
|
6121
|
+
*/
|
|
6122
|
+
abstract run(): Promise<void>;
|
|
6123
|
+
}
|
|
6124
|
+
|
|
6084
6125
|
type WithPerformanceResult<R = any> = [string, R];
|
|
6085
6126
|
/**
|
|
6086
6127
|
* @description executes the async function with a timer to check how long it took
|
|
@@ -6115,4 +6156,4 @@ declare const generateOpenApiModelWithMetadata: <T extends new () => Model>(mode
|
|
|
6115
6156
|
$id?: string;
|
|
6116
6157
|
}>;
|
|
6117
6158
|
|
|
6118
|
-
export { type AdminJsActionOptions, type AdminJsAssets, type AdminJsBranding, type AdminJsInstance, type AdminJsLocale, type AdminJsOptions, type AdminJsPage, type AdminJsPropertyOptions, type AdminJsResourceOptions, type AdminJsSettings, type AnnotatedModel, type AsymmetricEncryptionOptions, AutogeneratedModel, type BaseModelMethodOptions, type BaseModelRelationType, type CacheAdapter, type CacheKeys, ClientMigrator, Collection, type ColumnDataTypeOption, type ColumnDataTypeOptionSimple, type ColumnDataTypeOptionWithBinary, type ColumnDataTypeOptionWithDatePrecision, type ColumnDataTypeOptionWithEnum, type ColumnDataTypeOptionWithLength, type ColumnDataTypeOptionWithPrecision, type ColumnDataTypeOptionWithScaleAndPrecision, type ColumnDataTypeOptionWithText, type ColumnOptions, type ColumnType, type CommonDataSourceInput, type CommonSqlMethodReturnType, type ConnectionPolicies, type DataSourceInput, type DataSourceType, type DateColumnOptions, DryModelQueryBuilder, DryQueryBuilder, type FetchHooks, type GetConnectionReturnType, HysteriaError, InMemoryAdapter, type IndexType, type LazyRelationType, type ManyOptions, type ManyToManyOptions, type ManyToManyStringOptions, Migration, type MigrationConfig, type MigrationConfigBase, Model, type ModelInstanceType, ModelQueryBuilder, type ModelWithoutRelations, MongoDataSource, type MongoDataSourceInput$1 as MongoDataSourceInput, type MssqlConnectionInstance, type MssqlDataSourceInput, type MssqlPoolInstance, type MysqlConnectionInstance, type MysqlSqlDataSourceInput, type NotNullableMysqlSqlDataSourceInput, type NotNullableOracleDBDataSourceInput, type NotNullableOracleMssqlDataSourceInput, type NotNullablePostgresSqlDataSourceInput, type NotNullableSqliteDataSourceInput, type NumberModelKey, type OneOptions, type OracleDBDataSourceInput, type OracleDBPoolInstance, type PgPoolClientInstance, type PostgresSqlDataSourceInput, QueryBuilder, type RawModelOptions, RawNode, type RawQueryOptions, RedisCacheAdapter, type RedisFetchable, type RedisStorable, type RelatedInstance, type RelationQueryBuilderType, type ReplicationType, type SlaveAlgorithm, type SlaveContext, type SqlCloneOptions, SqlDataSource, type SqlDataSourceInput, type SqlDataSourceModel, type SqlDataSourceType, type SqlDriverSpecificOptions, type SqlPoolType, type Sqlite3ConnectionOptions, type SqliteConnectionInstance, type SqliteDataSourceInput, type StartTransactionOptions, type SymmetricEncryptionOptions, type TableFormat, type ThroughModel, TimestampedModel, Transaction, type TransactionExecutionOptions, type UniqueType, type UseCacheReturnType, type UseConnectionInput, UserMixin, UuidModel, belongsTo, column, createModelFactory, defineMigrator, generateOpenApiModel, generateOpenApiModelSchema, generateOpenApiModelWithMetadata, getCollectionProperties, getIndexes, getModelColumns, type getPoolReturnType, getPrimaryKey, getRelations, getRelationsMetadata, getUniques, hasMany, hasOne, index, HysteriaLogger as logger, manyToMany, property, RedisDataSource as redis, unique, view, withPerformance };
|
|
6159
|
+
export { type AdminJsActionOptions, type AdminJsAssets, type AdminJsBranding, type AdminJsInstance, type AdminJsLocale, type AdminJsOptions, type AdminJsPage, type AdminJsPropertyOptions, type AdminJsResourceOptions, type AdminJsSettings, type AnnotatedModel, type AsymmetricEncryptionOptions, AutogeneratedModel, type BaseModelMethodOptions, type BaseModelRelationType, BaseSeeder, type CacheAdapter, type CacheKeys, ClientMigrator, Collection, type ColumnDataTypeOption, type ColumnDataTypeOptionSimple, type ColumnDataTypeOptionWithBinary, type ColumnDataTypeOptionWithDatePrecision, type ColumnDataTypeOptionWithEnum, type ColumnDataTypeOptionWithLength, type ColumnDataTypeOptionWithPrecision, type ColumnDataTypeOptionWithScaleAndPrecision, type ColumnDataTypeOptionWithText, type ColumnOptions, type ColumnType, type CommonDataSourceInput, type CommonSqlMethodReturnType, type ConnectionPolicies, type DataSourceInput, type DataSourceType, type DateColumnOptions, DryModelQueryBuilder, DryQueryBuilder, type FetchHooks, type GetConnectionReturnType, HysteriaError, InMemoryAdapter, type IndexType, type LazyRelationType, type ManyOptions, type ManyToManyOptions, type ManyToManyStringOptions, Migration, type MigrationConfig, type MigrationConfigBase, Model, type ModelInstanceType, ModelQueryBuilder, type ModelWithoutRelations, MongoDataSource, type MongoDataSourceInput$1 as MongoDataSourceInput, type MssqlConnectionInstance, type MssqlDataSourceInput, type MssqlPoolInstance, type MysqlConnectionInstance, type MysqlSqlDataSourceInput, type NotNullableMysqlSqlDataSourceInput, type NotNullableOracleDBDataSourceInput, type NotNullableOracleMssqlDataSourceInput, type NotNullablePostgresSqlDataSourceInput, type NotNullableSqliteDataSourceInput, type NumberModelKey, type OneOptions, type OracleDBDataSourceInput, type OracleDBPoolInstance, type PgPoolClientInstance, type PostgresSqlDataSourceInput, QueryBuilder, type RawModelOptions, RawNode, type RawQueryOptions, RedisCacheAdapter, type RedisFetchable, type RedisStorable, type RelatedInstance, type RelationQueryBuilderType, type ReplicationType, type SeederConfig, type SlaveAlgorithm, type SlaveContext, type SqlCloneOptions, SqlDataSource, type SqlDataSourceInput, type SqlDataSourceModel, type SqlDataSourceType, type SqlDriverSpecificOptions, type SqlPoolType, type Sqlite3ConnectionOptions, type SqliteConnectionInstance, type SqliteDataSourceInput, type StartTransactionOptions, type SymmetricEncryptionOptions, type TableFormat, type ThroughModel, TimestampedModel, Transaction, type TransactionExecutionOptions, type UniqueType, type UseCacheReturnType, type UseConnectionInput, UserMixin, UuidModel, belongsTo, column, createModelFactory, defineMigrator, generateOpenApiModel, generateOpenApiModelSchema, generateOpenApiModelWithMetadata, getCollectionProperties, getIndexes, getModelColumns, type getPoolReturnType, getPrimaryKey, getRelations, getRelationsMetadata, getUniques, hasMany, hasOne, index, HysteriaLogger as logger, manyToMany, property, RedisDataSource as redis, unique, view, withPerformance };
|
package/lib/index.d.ts
CHANGED
|
@@ -1153,6 +1153,21 @@ type MigrationConfigWithTransactional = MigrationConfigBase & {
|
|
|
1153
1153
|
* @description Adds transactional option only for PostgreSQL and CockroachDB
|
|
1154
1154
|
*/
|
|
1155
1155
|
type MigrationConfig<D extends SqlDataSourceType = SqlDataSourceType> = D extends "postgres" | "cockroachdb" ? MigrationConfigWithTransactional : MigrationConfigBase;
|
|
1156
|
+
/**
|
|
1157
|
+
* @description Seeder configuration options
|
|
1158
|
+
*/
|
|
1159
|
+
type SeederConfig = {
|
|
1160
|
+
/**
|
|
1161
|
+
* @description The path to the seeders folder
|
|
1162
|
+
* @default "database/seeders"
|
|
1163
|
+
*/
|
|
1164
|
+
path?: string;
|
|
1165
|
+
/**
|
|
1166
|
+
* @description Path to the tsconfig.json file for TypeScript seeder files
|
|
1167
|
+
* @default "./tsconfig.json"
|
|
1168
|
+
*/
|
|
1169
|
+
tsconfig?: string;
|
|
1170
|
+
};
|
|
1156
1171
|
/**
|
|
1157
1172
|
* @description Common input properties shared across all SqlDataSource types
|
|
1158
1173
|
*/
|
|
@@ -1178,6 +1193,10 @@ type SqlDataSourceInputBase<T extends Record<string, SqlDataSourceModel> = {}, C
|
|
|
1178
1193
|
* @description Migration configuration for the sql data source
|
|
1179
1194
|
*/
|
|
1180
1195
|
migrations?: MigrationConfig<D>;
|
|
1196
|
+
/**
|
|
1197
|
+
* @description Seeder configuration for the sql data source
|
|
1198
|
+
*/
|
|
1199
|
+
seeders?: SeederConfig;
|
|
1181
1200
|
/**
|
|
1182
1201
|
* @description The cache strategy to use for the sql data source, it's used to configure the cache strategy for the sql data source
|
|
1183
1202
|
*/
|
|
@@ -3837,6 +3856,13 @@ declare class SqlDataSource<D extends SqlDataSourceType = SqlDataSourceType, T e
|
|
|
3837
3856
|
transactional: boolean;
|
|
3838
3857
|
lockTimeout?: number;
|
|
3839
3858
|
};
|
|
3859
|
+
/**
|
|
3860
|
+
* @description Seeder configuration for the sql data source
|
|
3861
|
+
*/
|
|
3862
|
+
seederConfig: {
|
|
3863
|
+
path: string;
|
|
3864
|
+
tsconfig?: string;
|
|
3865
|
+
};
|
|
3840
3866
|
/**
|
|
3841
3867
|
* @description AdminJS configuration options
|
|
3842
3868
|
*/
|
|
@@ -6081,6 +6107,21 @@ declare class HysteriaLogger {
|
|
|
6081
6107
|
static warn(message: string): void;
|
|
6082
6108
|
}
|
|
6083
6109
|
|
|
6110
|
+
/**
|
|
6111
|
+
* @description Base class for all seeders
|
|
6112
|
+
* @description Provides access to the SqlDataSource instance
|
|
6113
|
+
*/
|
|
6114
|
+
declare abstract class BaseSeeder {
|
|
6115
|
+
protected sqlDataSource: SqlDataSource;
|
|
6116
|
+
readonly logger: typeof HysteriaLogger;
|
|
6117
|
+
constructor(sqlDataSource: SqlDataSource);
|
|
6118
|
+
/**
|
|
6119
|
+
* @description Run the seeder
|
|
6120
|
+
* @description This method should be implemented by all seeders
|
|
6121
|
+
*/
|
|
6122
|
+
abstract run(): Promise<void>;
|
|
6123
|
+
}
|
|
6124
|
+
|
|
6084
6125
|
type WithPerformanceResult<R = any> = [string, R];
|
|
6085
6126
|
/**
|
|
6086
6127
|
* @description executes the async function with a timer to check how long it took
|
|
@@ -6115,4 +6156,4 @@ declare const generateOpenApiModelWithMetadata: <T extends new () => Model>(mode
|
|
|
6115
6156
|
$id?: string;
|
|
6116
6157
|
}>;
|
|
6117
6158
|
|
|
6118
|
-
export { type AdminJsActionOptions, type AdminJsAssets, type AdminJsBranding, type AdminJsInstance, type AdminJsLocale, type AdminJsOptions, type AdminJsPage, type AdminJsPropertyOptions, type AdminJsResourceOptions, type AdminJsSettings, type AnnotatedModel, type AsymmetricEncryptionOptions, AutogeneratedModel, type BaseModelMethodOptions, type BaseModelRelationType, type CacheAdapter, type CacheKeys, ClientMigrator, Collection, type ColumnDataTypeOption, type ColumnDataTypeOptionSimple, type ColumnDataTypeOptionWithBinary, type ColumnDataTypeOptionWithDatePrecision, type ColumnDataTypeOptionWithEnum, type ColumnDataTypeOptionWithLength, type ColumnDataTypeOptionWithPrecision, type ColumnDataTypeOptionWithScaleAndPrecision, type ColumnDataTypeOptionWithText, type ColumnOptions, type ColumnType, type CommonDataSourceInput, type CommonSqlMethodReturnType, type ConnectionPolicies, type DataSourceInput, type DataSourceType, type DateColumnOptions, DryModelQueryBuilder, DryQueryBuilder, type FetchHooks, type GetConnectionReturnType, HysteriaError, InMemoryAdapter, type IndexType, type LazyRelationType, type ManyOptions, type ManyToManyOptions, type ManyToManyStringOptions, Migration, type MigrationConfig, type MigrationConfigBase, Model, type ModelInstanceType, ModelQueryBuilder, type ModelWithoutRelations, MongoDataSource, type MongoDataSourceInput$1 as MongoDataSourceInput, type MssqlConnectionInstance, type MssqlDataSourceInput, type MssqlPoolInstance, type MysqlConnectionInstance, type MysqlSqlDataSourceInput, type NotNullableMysqlSqlDataSourceInput, type NotNullableOracleDBDataSourceInput, type NotNullableOracleMssqlDataSourceInput, type NotNullablePostgresSqlDataSourceInput, type NotNullableSqliteDataSourceInput, type NumberModelKey, type OneOptions, type OracleDBDataSourceInput, type OracleDBPoolInstance, type PgPoolClientInstance, type PostgresSqlDataSourceInput, QueryBuilder, type RawModelOptions, RawNode, type RawQueryOptions, RedisCacheAdapter, type RedisFetchable, type RedisStorable, type RelatedInstance, type RelationQueryBuilderType, type ReplicationType, type SlaveAlgorithm, type SlaveContext, type SqlCloneOptions, SqlDataSource, type SqlDataSourceInput, type SqlDataSourceModel, type SqlDataSourceType, type SqlDriverSpecificOptions, type SqlPoolType, type Sqlite3ConnectionOptions, type SqliteConnectionInstance, type SqliteDataSourceInput, type StartTransactionOptions, type SymmetricEncryptionOptions, type TableFormat, type ThroughModel, TimestampedModel, Transaction, type TransactionExecutionOptions, type UniqueType, type UseCacheReturnType, type UseConnectionInput, UserMixin, UuidModel, belongsTo, column, createModelFactory, defineMigrator, generateOpenApiModel, generateOpenApiModelSchema, generateOpenApiModelWithMetadata, getCollectionProperties, getIndexes, getModelColumns, type getPoolReturnType, getPrimaryKey, getRelations, getRelationsMetadata, getUniques, hasMany, hasOne, index, HysteriaLogger as logger, manyToMany, property, RedisDataSource as redis, unique, view, withPerformance };
|
|
6159
|
+
export { type AdminJsActionOptions, type AdminJsAssets, type AdminJsBranding, type AdminJsInstance, type AdminJsLocale, type AdminJsOptions, type AdminJsPage, type AdminJsPropertyOptions, type AdminJsResourceOptions, type AdminJsSettings, type AnnotatedModel, type AsymmetricEncryptionOptions, AutogeneratedModel, type BaseModelMethodOptions, type BaseModelRelationType, BaseSeeder, type CacheAdapter, type CacheKeys, ClientMigrator, Collection, type ColumnDataTypeOption, type ColumnDataTypeOptionSimple, type ColumnDataTypeOptionWithBinary, type ColumnDataTypeOptionWithDatePrecision, type ColumnDataTypeOptionWithEnum, type ColumnDataTypeOptionWithLength, type ColumnDataTypeOptionWithPrecision, type ColumnDataTypeOptionWithScaleAndPrecision, type ColumnDataTypeOptionWithText, type ColumnOptions, type ColumnType, type CommonDataSourceInput, type CommonSqlMethodReturnType, type ConnectionPolicies, type DataSourceInput, type DataSourceType, type DateColumnOptions, DryModelQueryBuilder, DryQueryBuilder, type FetchHooks, type GetConnectionReturnType, HysteriaError, InMemoryAdapter, type IndexType, type LazyRelationType, type ManyOptions, type ManyToManyOptions, type ManyToManyStringOptions, Migration, type MigrationConfig, type MigrationConfigBase, Model, type ModelInstanceType, ModelQueryBuilder, type ModelWithoutRelations, MongoDataSource, type MongoDataSourceInput$1 as MongoDataSourceInput, type MssqlConnectionInstance, type MssqlDataSourceInput, type MssqlPoolInstance, type MysqlConnectionInstance, type MysqlSqlDataSourceInput, type NotNullableMysqlSqlDataSourceInput, type NotNullableOracleDBDataSourceInput, type NotNullableOracleMssqlDataSourceInput, type NotNullablePostgresSqlDataSourceInput, type NotNullableSqliteDataSourceInput, type NumberModelKey, type OneOptions, type OracleDBDataSourceInput, type OracleDBPoolInstance, type PgPoolClientInstance, type PostgresSqlDataSourceInput, QueryBuilder, type RawModelOptions, RawNode, type RawQueryOptions, RedisCacheAdapter, type RedisFetchable, type RedisStorable, type RelatedInstance, type RelationQueryBuilderType, type ReplicationType, type SeederConfig, type SlaveAlgorithm, type SlaveContext, type SqlCloneOptions, SqlDataSource, type SqlDataSourceInput, type SqlDataSourceModel, type SqlDataSourceType, type SqlDriverSpecificOptions, type SqlPoolType, type Sqlite3ConnectionOptions, type SqliteConnectionInstance, type SqliteDataSourceInput, type StartTransactionOptions, type SymmetricEncryptionOptions, type TableFormat, type ThroughModel, TimestampedModel, Transaction, type TransactionExecutionOptions, type UniqueType, type UseCacheReturnType, type UseConnectionInput, UserMixin, UuidModel, belongsTo, column, createModelFactory, defineMigrator, generateOpenApiModel, generateOpenApiModelSchema, generateOpenApiModelWithMetadata, getCollectionProperties, getIndexes, getModelColumns, type getPoolReturnType, getPrimaryKey, getRelations, getRelationsMetadata, getUniques, hasMany, hasOne, index, HysteriaLogger as logger, manyToMany, property, RedisDataSource as redis, unique, view, withPerformance };
|