@depup/typeorm-extension 3.9.0-depup.0 → 4.0.0-depup.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.
Files changed (132) hide show
  1. package/README.MD +268 -134
  2. package/README.md +4 -6
  3. package/bin/cli.mjs +538 -267
  4. package/bin/cli.mjs.map +1 -0
  5. package/changes.json +3 -11
  6. package/dist/index.d.mts +1456 -0
  7. package/dist/index.mjs +3123 -2972
  8. package/dist/index.mjs.map +1 -1
  9. package/package.json +50 -56
  10. package/bin/cli.cjs +0 -275
  11. package/dist/cli/commands/database/create.d.ts +0 -27
  12. package/dist/cli/commands/database/drop.d.ts +0 -23
  13. package/dist/cli/commands/database/index.d.ts +0 -2
  14. package/dist/cli/commands/index.d.ts +0 -2
  15. package/dist/cli/commands/seed/create.d.ts +0 -21
  16. package/dist/cli/commands/seed/index.d.ts +0 -2
  17. package/dist/cli/commands/seed/run.d.ts +0 -24
  18. package/dist/cli/index.d.ts +0 -2
  19. package/dist/data-source/find/index.d.ts +0 -2
  20. package/dist/data-source/find/module.d.ts +0 -3
  21. package/dist/data-source/find/type.d.ts +0 -22
  22. package/dist/data-source/index.d.ts +0 -4
  23. package/dist/data-source/options/index.d.ts +0 -4
  24. package/dist/data-source/options/module.d.ts +0 -8
  25. package/dist/data-source/options/singleton.d.ts +0 -4
  26. package/dist/data-source/options/type.d.ts +0 -26
  27. package/dist/data-source/options/utils/env.d.ts +0 -4
  28. package/dist/data-source/options/utils/index.d.ts +0 -2
  29. package/dist/data-source/options/utils/merge.d.ts +0 -2
  30. package/dist/data-source/singleton.d.ts +0 -5
  31. package/dist/data-source/type.d.ts +0 -2
  32. package/dist/database/driver/cockroachdb.d.ts +0 -4
  33. package/dist/database/driver/index.d.ts +0 -9
  34. package/dist/database/driver/mongodb.d.ts +0 -6
  35. package/dist/database/driver/mssql.d.ts +0 -6
  36. package/dist/database/driver/mysql.d.ts +0 -7
  37. package/dist/database/driver/oracle.d.ts +0 -6
  38. package/dist/database/driver/postgres.d.ts +0 -8
  39. package/dist/database/driver/sqlite.d.ts +0 -3
  40. package/dist/database/driver/types.d.ts +0 -20
  41. package/dist/database/driver/utils/build.d.ts +0 -3
  42. package/dist/database/driver/utils/character-set.d.ts +0 -2
  43. package/dist/database/driver/utils/charset.d.ts +0 -2
  44. package/dist/database/driver/utils/create.d.ts +0 -2
  45. package/dist/database/driver/utils/index.d.ts +0 -4
  46. package/dist/database/index.d.ts +0 -3
  47. package/dist/database/methods/check/index.d.ts +0 -2
  48. package/dist/database/methods/check/module.d.ts +0 -7
  49. package/dist/database/methods/check/types.d.ts +0 -51
  50. package/dist/database/methods/create/index.d.ts +0 -1
  51. package/dist/database/methods/create/module.d.ts +0 -10
  52. package/dist/database/methods/drop/index.d.ts +0 -1
  53. package/dist/database/methods/drop/module.d.ts +0 -10
  54. package/dist/database/methods/index.d.ts +0 -4
  55. package/dist/database/methods/type.d.ts +0 -43
  56. package/dist/database/utils/context.d.ts +0 -3
  57. package/dist/database/utils/index.d.ts +0 -5
  58. package/dist/database/utils/migration.d.ts +0 -2
  59. package/dist/database/utils/query.d.ts +0 -3
  60. package/dist/database/utils/schema.d.ts +0 -3
  61. package/dist/database/utils/type.d.ts +0 -32
  62. package/dist/env/constants.d.ts +0 -68
  63. package/dist/env/index.d.ts +0 -3
  64. package/dist/env/module.d.ts +0 -4
  65. package/dist/env/type.d.ts +0 -36
  66. package/dist/env/utils.d.ts +0 -3
  67. package/dist/errors/base.d.ts +0 -2
  68. package/dist/errors/driver.d.ts +0 -6
  69. package/dist/errors/index.d.ts +0 -3
  70. package/dist/errors/options.d.ts +0 -7
  71. package/dist/helpers/entity/error.d.ts +0 -20
  72. package/dist/helpers/entity/index.d.ts +0 -5
  73. package/dist/helpers/entity/join-columns.d.ts +0 -16
  74. package/dist/helpers/entity/metadata.d.ts +0 -10
  75. package/dist/helpers/entity/property-names.d.ts +0 -11
  76. package/dist/helpers/entity/uniqueness.d.ts +0 -28
  77. package/dist/helpers/index.d.ts +0 -1
  78. package/dist/index.cjs +0 -3258
  79. package/dist/index.cjs.map +0 -1
  80. package/dist/index.d.ts +0 -9
  81. package/dist/query/index.d.ts +0 -4
  82. package/dist/query/module.d.ts +0 -5
  83. package/dist/query/parameter/fields/index.d.ts +0 -2
  84. package/dist/query/parameter/fields/module.d.ts +0 -25
  85. package/dist/query/parameter/fields/type.d.ts +0 -6
  86. package/dist/query/parameter/filters/index.d.ts +0 -2
  87. package/dist/query/parameter/filters/module.d.ts +0 -35
  88. package/dist/query/parameter/filters/type.d.ts +0 -12
  89. package/dist/query/parameter/index.d.ts +0 -5
  90. package/dist/query/parameter/pagination/index.d.ts +0 -2
  91. package/dist/query/parameter/pagination/module.d.ts +0 -26
  92. package/dist/query/parameter/pagination/type.d.ts +0 -3
  93. package/dist/query/parameter/relations/index.d.ts +0 -2
  94. package/dist/query/parameter/relations/module.d.ts +0 -27
  95. package/dist/query/parameter/relations/type.d.ts +0 -8
  96. package/dist/query/parameter/sort/index.d.ts +0 -2
  97. package/dist/query/parameter/sort/module.d.ts +0 -26
  98. package/dist/query/parameter/sort/type.d.ts +0 -6
  99. package/dist/query/type.d.ts +0 -16
  100. package/dist/query/utils/alias.d.ts +0 -2
  101. package/dist/query/utils/index.d.ts +0 -3
  102. package/dist/query/utils/key.d.ts +0 -1
  103. package/dist/query/utils/option.d.ts +0 -1
  104. package/dist/seeder/entity.d.ts +0 -42
  105. package/dist/seeder/executor.d.ts +0 -24
  106. package/dist/seeder/factory/index.d.ts +0 -4
  107. package/dist/seeder/factory/manager.d.ts +0 -8
  108. package/dist/seeder/factory/module.d.ts +0 -17
  109. package/dist/seeder/factory/type.d.ts +0 -12
  110. package/dist/seeder/factory/utils.d.ts +0 -7
  111. package/dist/seeder/index.d.ts +0 -6
  112. package/dist/seeder/module.d.ts +0 -5
  113. package/dist/seeder/type.d.ts +0 -44
  114. package/dist/seeder/utils/file-path.d.ts +0 -7
  115. package/dist/seeder/utils/index.d.ts +0 -3
  116. package/dist/seeder/utils/prepare.d.ts +0 -2
  117. package/dist/seeder/utils/template.d.ts +0 -1
  118. package/dist/utils/code-transformation/constants.d.ts +0 -4
  119. package/dist/utils/code-transformation/index.d.ts +0 -2
  120. package/dist/utils/code-transformation/module.d.ts +0 -3
  121. package/dist/utils/entity.d.ts +0 -2
  122. package/dist/utils/file-path.d.ts +0 -9
  123. package/dist/utils/file-system.d.ts +0 -1
  124. package/dist/utils/has-property.d.ts +0 -2
  125. package/dist/utils/index.d.ts +0 -10
  126. package/dist/utils/object.d.ts +0 -2
  127. package/dist/utils/promise.d.ts +0 -1
  128. package/dist/utils/separator.d.ts +0 -3
  129. package/dist/utils/slash.d.ts +0 -2
  130. package/dist/utils/tsconfig/index.d.ts +0 -2
  131. package/dist/utils/tsconfig/module.d.ts +0 -2
  132. package/dist/utils/tsconfig/type.d.ts +0 -13
@@ -1,2 +0,0 @@
1
- import type { DataSourceOptions } from 'typeorm';
2
- export type DataSourceCacheOption = DataSourceOptions['cache'];
@@ -1,4 +0,0 @@
1
- import type { DatabaseCreateContextInput, DatabaseDropContextInput } from '../methods';
2
- export declare function executeSimpleCockroachDBQuery(connection: any, query: string, endConnection?: boolean): Promise<unknown>;
3
- export declare function createCockroachDBDatabase(input?: DatabaseCreateContextInput): Promise<unknown>;
4
- export declare function dropCockroachDBDatabase(input?: DatabaseDropContextInput): Promise<unknown>;
@@ -1,9 +0,0 @@
1
- export * from './cockroachdb';
2
- export * from './mongodb';
3
- export * from './mssql';
4
- export * from './mysql';
5
- export * from './oracle';
6
- export * from './postgres';
7
- export * from './sqlite';
8
- export * from './types';
9
- export * from './utils';
@@ -1,6 +0,0 @@
1
- import type { MongoDriver } from 'typeorm/driver/mongodb/MongoDriver';
2
- import type { DatabaseCreateContextInput, DatabaseDropContextInput } from '../methods';
3
- import type { DriverOptions } from './types';
4
- export declare function createSimpleMongoDBConnection(driver: MongoDriver, options: DriverOptions): Promise<any>;
5
- export declare function createMongoDBDatabase(input?: DatabaseCreateContextInput): Promise<void>;
6
- export declare function dropMongoDBDatabase(input?: DatabaseDropContextInput): Promise<any>;
@@ -1,6 +0,0 @@
1
- import type { SqlServerDriver } from 'typeorm/driver/sqlserver/SqlServerDriver';
2
- import type { DatabaseCreateContextInput, DatabaseDropContextInput } from '../methods';
3
- import type { DriverOptions } from './types';
4
- export declare function createSimpleMsSQLConnection(driver: SqlServerDriver, options: DriverOptions): Promise<any>;
5
- export declare function createMsSQLDatabase(input?: DatabaseCreateContextInput): Promise<any>;
6
- export declare function dropMsSQLDatabase(input?: DatabaseDropContextInput): Promise<any>;
@@ -1,7 +0,0 @@
1
- import type { MysqlDriver } from 'typeorm/driver/mysql/MysqlDriver';
2
- import type { DatabaseCreateContextInput, DatabaseDropContextInput } from '../methods';
3
- import type { DriverOptions } from './types';
4
- export declare function createSimpleMySQLConnection(driver: MysqlDriver, options: DriverOptions): Promise<any>;
5
- export declare function executeSimpleMysqlQuery(connection: any, query: string, endConnection?: boolean): Promise<unknown>;
6
- export declare function createMySQLDatabase(input?: DatabaseCreateContextInput): Promise<unknown>;
7
- export declare function dropMySQLDatabase(input?: DatabaseDropContextInput): Promise<unknown>;
@@ -1,6 +0,0 @@
1
- import type { OracleDriver } from 'typeorm/driver/oracle/OracleDriver';
2
- import type { DatabaseCreateContextInput, DatabaseDropContextInput } from '../methods';
3
- import type { DriverOptions } from './types';
4
- export declare function createSimpleOracleConnection(driver: OracleDriver, options: DriverOptions): any;
5
- export declare function createOracleDatabase(input?: DatabaseCreateContextInput): Promise<any>;
6
- export declare function dropOracleDatabase(_context?: DatabaseDropContextInput): Promise<void>;
@@ -1,8 +0,0 @@
1
- import type { PostgresDriver } from 'typeorm/driver/postgres/PostgresDriver';
2
- import type { CockroachDriver } from 'typeorm/driver/cockroachdb/CockroachDriver';
3
- import type { DatabaseBaseContext, DatabaseCreateContextInput, DatabaseDropContextInput } from '../methods';
4
- import type { DriverOptions } from './types';
5
- export declare function createSimplePostgresConnection(driver: PostgresDriver | CockroachDriver, options: DriverOptions, operationContext: DatabaseBaseContext): Promise<any>;
6
- export declare function executeSimplePostgresQuery(connection: any, query: string, endConnection?: boolean): Promise<unknown>;
7
- export declare function createPostgresDatabase(input?: DatabaseCreateContextInput): Promise<unknown>;
8
- export declare function dropPostgresDatabase(input?: DatabaseDropContextInput): Promise<unknown>;
@@ -1,3 +0,0 @@
1
- import type { DatabaseCreateContextInput, DatabaseDropContextInput } from '../methods';
2
- export declare function createSQLiteDatabase(input?: DatabaseCreateContextInput): Promise<void>;
3
- export declare function dropSQLiteDatabase(input?: DatabaseDropContextInput): Promise<void>;
@@ -1,20 +0,0 @@
1
- export type DriverOptions = {
2
- database?: string;
3
- host?: string;
4
- user?: string;
5
- password?: string;
6
- port?: number;
7
- ssl?: any;
8
- url?: string;
9
- connectString?: string;
10
- sid?: string | number;
11
- serviceName?: string;
12
- domain?: string;
13
- charset?: string;
14
- characterSet?: string;
15
- schema?: string;
16
- template?: string;
17
- extra?: {
18
- [key: string]: any;
19
- };
20
- };
@@ -1,3 +0,0 @@
1
- import type { DataSourceOptions } from 'typeorm';
2
- import type { DriverOptions } from '../types';
3
- export declare function buildDriverOptions(options: DataSourceOptions): DriverOptions;
@@ -1,2 +0,0 @@
1
- import type { DataSourceOptions } from 'typeorm';
2
- export declare function getCharacterSetFromDataSourceOptions(options: DataSourceOptions): string | undefined;
@@ -1,2 +0,0 @@
1
- import type { DataSourceOptions } from 'typeorm';
2
- export declare function getCharsetFromDataSourceOptions(options: DataSourceOptions): string | undefined;
@@ -1,2 +0,0 @@
1
- import type { DataSourceOptions } from 'typeorm';
2
- export declare function createDriver(connectionOptions: DataSourceOptions): import("typeorm").Driver;
@@ -1,4 +0,0 @@
1
- export * from './build';
2
- export * from './character-set';
3
- export * from './charset';
4
- export * from './create';
@@ -1,3 +0,0 @@
1
- export * from './methods';
2
- export * from './driver';
3
- export * from './utils';
@@ -1,2 +0,0 @@
1
- export * from './module';
2
- export * from './types';
@@ -1,7 +0,0 @@
1
- import type { DatabaseCheckContext, DatabaseCheckResult } from './types';
2
- /**
3
- * Check database setup progress.
4
- *
5
- * @param context
6
- */
7
- export declare function checkDatabase(context?: DatabaseCheckContext): Promise<DatabaseCheckResult>;
@@ -1,51 +0,0 @@
1
- import type { DataSource, DataSourceOptions, Migration } from 'typeorm';
2
- export type DatabaseCheckContext = {
3
- /**
4
- * Options for finding the typeorm DataSource.
5
- *
6
- * Default: undefined
7
- */
8
- options?: DataSourceOptions;
9
- /**
10
- * Use alias to access already registered DataSource / DataSourceOptions.
11
- *
12
- * default: undefined
13
- */
14
- alias?: string;
15
- /**
16
- * Indicates whether to destroy the data-source
17
- * afterward or not.
18
- * If a datasource previously existed, this option will be ignored.
19
- *
20
- * default: true
21
- */
22
- dataSourceCleanup?: boolean;
23
- /**
24
- * Use predefined data-source for checks.
25
- *
26
- * default: undefined
27
- */
28
- dataSource?: DataSource;
29
- };
30
- export type DatabaseCheckResult = {
31
- /**
32
- * Indicates whether the database
33
- * has already been created or not.
34
- *
35
- * default: false
36
- */
37
- exists: boolean;
38
- /**
39
- * Indicates whether the database's schema
40
- * is up-to-date.
41
- *
42
- * default: false
43
- */
44
- schema: boolean;
45
- /**
46
- * Array of un applied migrations.
47
- *
48
- * default: []
49
- */
50
- migrationsPending: Migration[];
51
- };
@@ -1 +0,0 @@
1
- export * from './module';
@@ -1,10 +0,0 @@
1
- import type { DatabaseCreateContextInput } from '../type';
2
- /**
3
- * Create database for specified driver in ConnectionOptions.
4
- *
5
- * @throws DriverError
6
- * @throws OptionsError
7
- *
8
- * @param input
9
- */
10
- export declare function createDatabase(input?: DatabaseCreateContextInput): Promise<unknown>;
@@ -1 +0,0 @@
1
- export * from './module';
@@ -1,10 +0,0 @@
1
- import type { DatabaseDropContextInput } from '../type';
2
- /**
3
- * Drop database for specified driver in ConnectionOptions.
4
- *
5
- * @throws DriverError
6
- * @throws OptionsError
7
- *
8
- * @param input
9
- */
10
- export declare function dropDatabase(input?: DatabaseDropContextInput): Promise<unknown>;
@@ -1,4 +0,0 @@
1
- export * from './check';
2
- export * from './create';
3
- export * from './drop';
4
- export * from './type';
@@ -1,43 +0,0 @@
1
- import type { DataSourceOptions } from 'typeorm';
2
- import type { DataSourceFindOptions } from '../../data-source';
3
- export type DatabaseBaseContext = {
4
- /**
5
- * Options for finding the typeorm DataSource.
6
- */
7
- options: DataSourceOptions;
8
- /**
9
- * Options for the find method, where to look for the data-source file.
10
- */
11
- findOptions?: DataSourceFindOptions;
12
- /**
13
- * Initial database to connect.
14
- *
15
- * default: undefined
16
- */
17
- initialDatabase?: string;
18
- };
19
- export type DatabaseBaseContextInput = Partial<DatabaseBaseContext>;
20
- export type DatabaseCreateContext = Omit<DatabaseBaseContext, 'findOptions'> & {
21
- /**
22
- * Only create database if not already exist.
23
- *
24
- * default: true
25
- */
26
- ifNotExist: boolean;
27
- /**
28
- * Synchronize or migrate the database scheme.
29
- *
30
- * default: true
31
- */
32
- synchronize: boolean;
33
- };
34
- export type DatabaseCreateContextInput = Partial<DatabaseCreateContext>;
35
- export type DatabaseDropContext = Omit<DatabaseBaseContext, 'findOptions'> & {
36
- /**
37
- * Only drop database if existed.
38
- *
39
- * Default: true
40
- */
41
- ifExist?: boolean;
42
- };
43
- export type DatabaseDropContextInput = Partial<DatabaseDropContext>;
@@ -1,3 +0,0 @@
1
- import type { DatabaseCreateContext, DatabaseCreateContextInput, DatabaseDropContext, DatabaseDropContextInput } from '../methods';
2
- export declare function buildDatabaseCreateContext(input?: DatabaseCreateContextInput): Promise<DatabaseCreateContext>;
3
- export declare function buildDatabaseDropContext(input?: DatabaseDropContextInput): Promise<DatabaseDropContext>;
@@ -1,5 +0,0 @@
1
- export * from './context';
2
- export * from './migration';
3
- export * from './query';
4
- export * from './schema';
5
- export * from './type';
@@ -1,2 +0,0 @@
1
- import type { MigrationGenerateCommandContext, MigrationGenerateResult } from './type';
2
- export declare function generateMigration(context: MigrationGenerateCommandContext): Promise<MigrationGenerateResult>;
@@ -1,3 +0,0 @@
1
- import type { ObjectLiteral } from 'rapiq';
2
- import type { SelectQueryBuilder } from 'typeorm';
3
- export declare function existsQuery<T extends ObjectLiteral = ObjectLiteral>(builder: SelectQueryBuilder<T>, inverse?: boolean): string;
@@ -1,3 +0,0 @@
1
- import type { DataSourceOptions, Migration } from 'typeorm';
2
- import { DataSource } from 'typeorm';
3
- export declare function synchronizeDatabaseSchema(input: DataSource | DataSourceOptions): Promise<Migration[]>;
@@ -1,32 +0,0 @@
1
- import type { DataSource } from 'typeorm';
2
- export type MigrationGenerateResult = {
3
- up: string[];
4
- down: string[];
5
- content?: string;
6
- };
7
- export type MigrationGenerateCommandContext = {
8
- /**
9
- * Directory where the migration(s) should be stored.
10
- */
11
- directoryPath?: string;
12
- /**
13
- * Name of the migration class.
14
- */
15
- name?: string;
16
- /**
17
- * DataSource used for reference of existing schema.
18
- */
19
- dataSource: DataSource;
20
- /**
21
- * Timestamp in milliseconds.
22
- */
23
- timestamp?: number;
24
- /**
25
- * Prettify sql statements.
26
- */
27
- prettify?: boolean;
28
- /**
29
- * Only return up- & down-statements instead of backing up the migration to the file system.
30
- */
31
- preview?: boolean;
32
- };
@@ -1,68 +0,0 @@
1
- export declare enum EnvironmentName {
2
- DEVELOPMENT = "development",
3
- PRODUCTION = "production",
4
- TEST = "test"
5
- }
6
- export declare enum EnvironmentVariableName {
7
- ENV = "NODE_ENV",
8
- SEEDS = "DB_SEEDS",
9
- SEEDS_ALT = "TYPEORM_SEEDING_SEEDS",
10
- FACTORIES = "DB_FACTORIES",
11
- FACTORIES_ALT = "TYPEORM_SEEDING_FACTORIES",
12
- TYPE = "DB_TYPE",
13
- TYPE_ALT = "TYPEORM_CONNECTION",
14
- URL = "DB_URL",
15
- URL_ALT = "TYPEORM_URL",
16
- HOST = "DB_HOST",
17
- HOST_ALT = "TYPEORM_HOST",
18
- PORT = "DB_PORT",
19
- PORT_ALT = "TYPEORM_PORT",
20
- USERNAME = "DB_USERNAME",
21
- USERNAME_ALT = "TYPEORM_USERNAME",
22
- PASSWORD = "DB_PASSWORD",
23
- PASSWORD_ALT = "TYPEORM_PASSWORD",
24
- DATABASE = "DB_DATABASE",
25
- DATABASE_ALT = "TYPEORM_DATABASE",
26
- SID = "DB_SID",
27
- SID_ALT = "TYPEORM_SID",
28
- SCHEMA = "DB_SCHEMA",
29
- SCHEMA_ALT = "TYPEORM_SCHEMA",
30
- SCHEMA_DROP = "DB_DROP_SCHEMA",
31
- SCHEMA_DROP_ALT = "TYPEORM_DROP_SCHEMA",
32
- DRIVER_EXTRA = "DB_DRIVER_EXTRA",
33
- DRIVER_EXTRA_ALT = "TYPEORM_DRIVER_EXTRA",
34
- SYNCHRONIZE = "DB_SYNCHRONIZE",
35
- SYNCHRONIZE_ALT = "TYPEORM_SYNCHRONIZE",
36
- MIGRATIONS = "DB_MIGRATIONS",
37
- MIGRATIONS_ALT = "TYPEORM_MIGRATIONS",
38
- MIGRATIONS_RUN = "DB_MIGRATIONS_RUN",
39
- MIGRATIONS_RUN_ALT = "TYPEORM_MIGRATIONS_RUN",
40
- MIGRATIONS_TABLE_NAME = "DB_MIGRATIONS_TABLE_NAME",
41
- MIGRATIONS_TABLE_NAME_ALT = "TYPEORM_MIGRATIONS_TABLE_NAME",
42
- ENTITIES = "DB_ENTITIES",
43
- ENTITIES_ALT = "TYPEORM_ENTITIES",
44
- ENTITY_PREFIX = "DB_ENTITY_PREFIX",
45
- ENTITY_PREFIX_ALT = "TYPEORM_ENTITY_PREFIX",
46
- METADATA_TABLE_NAME = "DB_METADATA_TABLE_NAME",
47
- METADATA_TABLE_NAME_ALT = "TYPEORM_METADATA_TABLE_NAME",
48
- SUBSCRIBERS = "DB_SUBSCRIBERS",
49
- SUBSCRIBERS_ALT = "TYPEORM_SUBSCRIBERS",
50
- LOGGING = "DB_LOGGING",
51
- LOGGING_ALT = "TYPEORM_LOGGING",
52
- LOGGER = "DB_LOGGER",
53
- LOGGER_ALT = "TYPEORM_LOGGER",
54
- MAX_QUERY_EXECUTION_TIME = "DB_MAX_QUERY_EXECUTION_TIME",
55
- MAX_QUERY_EXECUTION_TIME_ALT = "TYPEORM_MAX_QUERY_EXECUTION_TIME",
56
- DEBUG = "DB_DEBUG",
57
- DEBUG_ALT = "TYPEORM_DEBUG",
58
- UUID_EXTENSION = "DB_UUID_EXTENSION",
59
- UUID_EXTENSION_ALT = "TYPEORM_UUID_EXTENSION",
60
- CACHE = "DB_CACHE",
61
- CACHE_ALT = "TYPEORM_CACHE",
62
- CACHE_ALWAYS_ENABLED = "DB_CACHE_ALWAYS_ENABLED",
63
- CACHE_ALWAYS_ENABLED_ALT = "TYPEORM_CACHE_ALWAYS_ENABLED",
64
- CACHE_OPTIONS = "DB_CACHE_OPTIONS",
65
- CACHE_OPTIONS_ALT = "TYPEORM_CACHE_OPTIONS",
66
- CACHE_DURATION = "DB_CACHE_DURATION",
67
- CACHE_DURATION_ALT = "TYPEORM_CACHE_DURATION"
68
- }
@@ -1,3 +0,0 @@
1
- export * from './constants';
2
- export * from './module';
3
- export * from './type';
@@ -1,4 +0,0 @@
1
- import type { Environment } from './type';
2
- export declare function useEnv(): Environment;
3
- export declare function useEnv<K extends keyof Environment>(key: K): Environment[K];
4
- export declare function resetEnv(): void;
@@ -1,36 +0,0 @@
1
- import type { DatabaseType } from 'typeorm/driver/types/DatabaseType';
2
- import type { DataSourceCacheOption } from '../data-source';
3
- import type { EnvironmentName } from './constants';
4
- export interface Environment {
5
- env: `${EnvironmentName}`;
6
- seeds: string[];
7
- factories: string[];
8
- type?: DatabaseType;
9
- url?: string;
10
- host?: string;
11
- port?: number;
12
- username?: string;
13
- password?: string;
14
- database?: string;
15
- sid?: string;
16
- schema?: string;
17
- /**
18
- * dropSchema
19
- */
20
- schemaDrop?: boolean;
21
- extra?: any;
22
- synchronize?: boolean;
23
- migrations: string[];
24
- migrationsRun?: boolean;
25
- migrationsTableName?: string;
26
- entities: string[];
27
- entityPrefix?: string;
28
- metadataTableName?: string;
29
- subscribers: string[];
30
- logging: string[] | boolean | string;
31
- logger?: string;
32
- maxQueryExecutionTime?: number;
33
- debug?: string;
34
- cache?: DataSourceCacheOption;
35
- uuidExtension?: string;
36
- }
@@ -1,3 +0,0 @@
1
- import type { DataSourceCacheOption } from '../data-source';
2
- export declare function transformLogging(input?: string): boolean | string | string[];
3
- export declare function transformCache(input?: string): DataSourceCacheOption | undefined;
@@ -1,2 +0,0 @@
1
- export declare class TypeormExtensionError extends Error {
2
- }
@@ -1,6 +0,0 @@
1
- import { TypeormExtensionError } from './base';
2
- export declare class DriverError extends TypeormExtensionError {
3
- constructor(message?: string);
4
- static undeterminable(): DriverError;
5
- static notSupported(driverName: string): DriverError;
6
- }
@@ -1,3 +0,0 @@
1
- export * from './base';
2
- export * from './driver';
3
- export * from './options';
@@ -1,7 +0,0 @@
1
- import { TypeormExtensionError } from './base';
2
- export declare class OptionsError extends TypeormExtensionError {
3
- constructor(message?: string);
4
- static undeterminable(): OptionsError;
5
- static notFound(): OptionsError;
6
- static databaseNotDefined(): OptionsError;
7
- }
@@ -1,20 +0,0 @@
1
- import { TypeormExtensionError } from '../../errors';
2
- type TypeormRelationLookupErrorOptions = {
3
- message: string;
4
- relation: string;
5
- columns: string[];
6
- };
7
- export declare class EntityRelationLookupError extends TypeormExtensionError {
8
- /**
9
- * The property name of the relation.
10
- */
11
- relation: string;
12
- /**
13
- * The property names of the join columns.
14
- */
15
- columns: string[];
16
- constructor(options: TypeormRelationLookupErrorOptions);
17
- static notReferenced(relation: string, columns: string[]): EntityRelationLookupError;
18
- static notFound(relation: string, columns: string[]): EntityRelationLookupError;
19
- }
20
- export {};
@@ -1,5 +0,0 @@
1
- export * from './error';
2
- export * from './property-names';
3
- export * from './metadata';
4
- export * from './join-columns';
5
- export * from './uniqueness';
@@ -1,16 +0,0 @@
1
- import type { ObjectLiteral } from 'rapiq';
2
- import type { DataSource, EntityTarget } from 'typeorm';
3
- type EntityRelationColumnsValidateOptions<T> = {
4
- dataSource?: DataSource;
5
- entityTarget: EntityTarget<T>;
6
- };
7
- /**
8
- * Validate join columns of a given entity.
9
- * It will look up and append the referenced entities to the input entity.
10
- *
11
- * @experimental
12
- * @param entity
13
- * @param options
14
- */
15
- export declare function validateEntityJoinColumns<T extends ObjectLiteral>(entity: Partial<T>, options: EntityRelationColumnsValidateOptions<T>): Promise<Partial<T>>;
16
- export {};
@@ -1,10 +0,0 @@
1
- import { Repository } from 'typeorm';
2
- import type { DataSource, EntityMetadata, EntityTarget, ObjectLiteral } from 'typeorm';
3
- /**
4
- * Receive metadata for a given repository or entity-target.
5
- *
6
- * @experimental
7
- * @param input
8
- * @param dataSource
9
- */
10
- export declare function getEntityMetadata<T extends ObjectLiteral>(input: Repository<T> | EntityTarget<T>, dataSource?: DataSource): Promise<EntityMetadata>;
@@ -1,11 +0,0 @@
1
- import type { ObjectLiteral } from 'rapiq';
2
- import { Repository } from 'typeorm';
3
- import type { DataSource, EntityTarget } from 'typeorm';
4
- /**
5
- * Get (relation-) property names of a given entity.
6
- *
7
- * @experimental
8
- * @param input
9
- * @param dataSource
10
- */
11
- export declare function getEntityPropertyNames<T extends ObjectLiteral>(input: EntityTarget<T> | Repository<T>, dataSource?: DataSource): Promise<string[]>;
@@ -1,28 +0,0 @@
1
- import type { DataSource, EntityTarget, ObjectLiteral } from 'typeorm';
2
- type EntityUniquenessCheckOptions<T> = {
3
- /**
4
- * Repository entity class.
5
- */
6
- entityTarget: EntityTarget<T>;
7
- /**
8
- * Entity to insert/update.
9
- */
10
- entity: Partial<T>;
11
- /**
12
- * Entity found.
13
- */
14
- entityExisting?: Partial<T> | null;
15
- /**
16
- * DataSource to use
17
- */
18
- dataSource?: DataSource;
19
- };
20
- /**
21
- * Check if a given entity does not already exist.
22
- * Composite unique keys on a null column can only be present once.
23
- *
24
- * @experimental
25
- * @param options
26
- */
27
- export declare function isEntityUnique<T extends ObjectLiteral>(options: EntityUniquenessCheckOptions<T>): Promise<boolean>;
28
- export {};
@@ -1 +0,0 @@
1
- export * from './entity';