typeorm 0.3.7 → 0.3.8-dev.15f90e0
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/browser/cli-ts-node-commonjs.js +0 -0
- package/browser/cli-ts-node-esm.js +0 -0
- package/browser/driver/oracle/OracleConnectionOptions.d.ts +1 -1
- package/browser/driver/oracle/OracleConnectionOptions.js.map +1 -1
- package/browser/driver/postgres/PostgresConnectionOptions.d.ts +1 -1
- package/browser/driver/postgres/PostgresConnectionOptions.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerConnectionOptions.d.ts +1 -1
- package/browser/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
- package/browser/find-options/FindOptionsOrder.d.ts +1 -1
- package/browser/find-options/FindOptionsOrder.js.map +1 -1
- package/browser/find-options/FindOptionsRelations.d.ts +1 -1
- package/browser/find-options/FindOptionsRelations.js.map +1 -1
- package/browser/find-options/FindOptionsSelect.d.ts +1 -1
- package/browser/find-options/FindOptionsSelect.js.map +1 -1
- package/browser/find-options/FindOptionsWhere.d.ts +1 -1
- package/browser/find-options/FindOptionsWhere.js.map +1 -1
- package/cli-ts-node-commonjs.js +0 -0
- package/cli-ts-node-esm.js +0 -0
- package/cli.js +0 -0
- package/commands/CommandUtils.js +6 -3
- package/commands/CommandUtils.js.map +1 -1
- package/commands/InitCommand.js +1 -1
- package/commands/InitCommand.js.map +1 -1
- package/driver/oracle/OracleConnectionOptions.d.ts +1 -1
- package/driver/oracle/OracleConnectionOptions.js.map +1 -1
- package/driver/postgres/PostgresConnectionOptions.d.ts +1 -1
- package/driver/postgres/PostgresConnectionOptions.js.map +1 -1
- package/driver/sqlserver/SqlServerConnectionOptions.d.ts +1 -1
- package/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
- package/find-options/FindOptionsOrder.d.ts +1 -1
- package/find-options/FindOptionsOrder.js.map +1 -1
- package/find-options/FindOptionsRelations.d.ts +1 -1
- package/find-options/FindOptionsRelations.js.map +1 -1
- package/find-options/FindOptionsSelect.d.ts +1 -1
- package/find-options/FindOptionsSelect.js.map +1 -1
- package/find-options/FindOptionsWhere.d.ts +1 -1
- package/find-options/FindOptionsWhere.js.map +1 -1
- package/package.json +1 -274
|
File without changes
|
|
File without changes
|
|
@@ -18,7 +18,7 @@ export interface OracleConnectionOptions extends BaseDataSourceOptions, OracleCo
|
|
|
18
18
|
*/
|
|
19
19
|
readonly driver?: any;
|
|
20
20
|
/**
|
|
21
|
-
* A boolean determining whether to pass time values in UTC or local time. (default:
|
|
21
|
+
* A boolean determining whether to pass time values in UTC or local time. (default: false).
|
|
22
22
|
*/
|
|
23
23
|
readonly useUTC?: boolean;
|
|
24
24
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/driver/oracle/OracleConnectionOptions.ts"],"names":[],"mappings":"","file":"OracleConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { OracleConnectionCredentialsOptions } from \"./OracleConnectionCredentialsOptions\"\n\n/**\n * Oracle-specific connection options.\n */\nexport interface OracleConnectionOptions\n extends BaseDataSourceOptions,\n OracleConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"oracle\"\n\n /**\n * Schema name. By default is \"public\".\n */\n readonly schema?: string\n\n /**\n * The driver object\n * This defaults to require(\"oracledb\")\n */\n readonly driver?: any\n\n /**\n * A boolean determining whether to pass time values in UTC or local time. (default:
|
|
1
|
+
{"version":3,"sources":["../browser/src/driver/oracle/OracleConnectionOptions.ts"],"names":[],"mappings":"","file":"OracleConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { OracleConnectionCredentialsOptions } from \"./OracleConnectionCredentialsOptions\"\n\n/**\n * Oracle-specific connection options.\n */\nexport interface OracleConnectionOptions\n extends BaseDataSourceOptions,\n OracleConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"oracle\"\n\n /**\n * Schema name. By default is \"public\".\n */\n readonly schema?: string\n\n /**\n * The driver object\n * This defaults to require(\"oracledb\")\n */\n readonly driver?: any\n\n /**\n * A boolean determining whether to pass time values in UTC or local time. (default: false).\n */\n readonly useUTC?: boolean\n\n /**\n * Replication setup.\n */\n readonly replication?: {\n /**\n * Master server used by orm to perform writes.\n */\n readonly master: OracleConnectionCredentialsOptions\n\n /**\n * List of read-from severs (slaves).\n */\n readonly slaves: OracleConnectionCredentialsOptions[]\n }\n}\n"],"sourceRoot":"../.."}
|
|
@@ -23,7 +23,7 @@ export interface PostgresConnectionOptions extends BaseDataSourceOptions, Postgr
|
|
|
23
23
|
*/
|
|
24
24
|
readonly nativeDriver?: any;
|
|
25
25
|
/**
|
|
26
|
-
* A boolean determining whether to pass time values in UTC or local time. (default:
|
|
26
|
+
* A boolean determining whether to pass time values in UTC or local time. (default: false).
|
|
27
27
|
*/
|
|
28
28
|
readonly useUTC?: boolean;
|
|
29
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/driver/postgres/PostgresConnectionOptions.ts"],"names":[],"mappings":"","file":"PostgresConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { PostgresConnectionCredentialsOptions } from \"./PostgresConnectionCredentialsOptions\"\n\n/**\n * Postgres-specific connection options.\n */\nexport interface PostgresConnectionOptions\n extends BaseDataSourceOptions,\n PostgresConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"postgres\"\n\n /**\n * Schema name.\n */\n readonly schema?: string\n\n /**\n * The driver object\n * This defaults to `require(\"pg\")`.\n */\n readonly driver?: any\n\n /**\n * The driver object\n * This defaults to `require(\"pg-native\")`.\n */\n readonly nativeDriver?: any\n\n /**\n * A boolean determining whether to pass time values in UTC or local time. (default:
|
|
1
|
+
{"version":3,"sources":["../browser/src/driver/postgres/PostgresConnectionOptions.ts"],"names":[],"mappings":"","file":"PostgresConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { PostgresConnectionCredentialsOptions } from \"./PostgresConnectionCredentialsOptions\"\n\n/**\n * Postgres-specific connection options.\n */\nexport interface PostgresConnectionOptions\n extends BaseDataSourceOptions,\n PostgresConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"postgres\"\n\n /**\n * Schema name.\n */\n readonly schema?: string\n\n /**\n * The driver object\n * This defaults to `require(\"pg\")`.\n */\n readonly driver?: any\n\n /**\n * The driver object\n * This defaults to `require(\"pg-native\")`.\n */\n readonly nativeDriver?: any\n\n /**\n * A boolean determining whether to pass time values in UTC or local time. (default: false).\n */\n readonly useUTC?: boolean\n\n /**\n * Replication setup.\n */\n readonly replication?: {\n /**\n * Master server used by orm to perform writes.\n */\n readonly master: PostgresConnectionCredentialsOptions\n\n /**\n * List of read-from severs (slaves).\n */\n readonly slaves: PostgresConnectionCredentialsOptions[]\n }\n\n /**\n * The milliseconds before a timeout occurs during the initial connection to the postgres\n * server. If undefined, or set to 0, there is no timeout. Defaults to undefined.\n */\n readonly connectTimeoutMS?: number\n\n /**\n * The Postgres extension to use to generate UUID columns. Defaults to uuid-ossp.\n * If pgcrypto is selected, TypeORM will use the gen_random_uuid() function from this extension.\n * If uuid-ossp is selected, TypeORM will use the uuid_generate_v4() function from this extension.\n */\n readonly uuidExtension?: \"pgcrypto\" | \"uuid-ossp\"\n\n /*\n * Function handling errors thrown by drivers pool.\n * Defaults to logging error with `warn` level.\n */\n readonly poolErrorHandler?: (err: any) => any\n\n /**\n * Include notification messages from Postgres server in client logs\n */\n readonly logNotifications?: boolean\n\n /**\n * Automatically install postgres extensions\n */\n readonly installExtensions?: boolean\n\n /**\n * sets the application_name var to help db administrators identify\n * the service using this connection. Defaults to 'undefined'\n */\n readonly applicationName?: string\n}\n"],"sourceRoot":"../.."}
|
|
@@ -118,7 +118,7 @@ export interface SqlServerConnectionOptions extends BaseDataSourceOptions, SqlSe
|
|
|
118
118
|
*/
|
|
119
119
|
readonly packetSize?: number;
|
|
120
120
|
/**
|
|
121
|
-
* A boolean determining whether to pass time values in UTC or local time. (default:
|
|
121
|
+
* A boolean determining whether to pass time values in UTC or local time. (default: false).
|
|
122
122
|
*/
|
|
123
123
|
readonly useUTC?: boolean;
|
|
124
124
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/driver/sqlserver/SqlServerConnectionOptions.ts"],"names":[],"mappings":"","file":"SqlServerConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { SqlServerConnectionCredentialsOptions } from \"./SqlServerConnectionCredentialsOptions\"\n\n/**\n * Microsoft Sql Server specific connection options.\n */\nexport interface SqlServerConnectionOptions\n extends BaseDataSourceOptions,\n SqlServerConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"mssql\"\n\n /**\n * Connection timeout in ms (default: 15000).\n */\n readonly connectionTimeout?: number\n\n /**\n * Request timeout in ms (default: 15000). NOTE: msnodesqlv8 driver doesn't support timeouts < 1 second.\n */\n readonly requestTimeout?: number\n\n /**\n * Stream recordsets/rows instead of returning them all at once as an argument of callback (default: false).\n * You can also enable streaming for each request independently (request.stream = true).\n * Always set to true if you plan to work with large amount of rows.\n */\n readonly stream?: boolean\n\n /**\n * Database schema.\n */\n readonly schema?: string\n\n /**\n * The driver object\n * This defaults to `require(\"mssql\")`\n */\n readonly driver?: any\n\n /**\n * An optional object/dictionary with the any of the properties\n */\n readonly pool?: {\n /**\n * Maximum number of resources to create at any given time. (default=1)\n */\n readonly max?: number\n\n /**\n * Minimum number of resources to keep in pool at any given time. If this is set >= max, the pool will silently\n * set the min to equal max. (default=0)\n */\n readonly min?: number\n\n /**\n * Maximum number of queued requests allowed, additional acquire calls will be callback with an err in a future\n * cycle of the event loop.\n */\n readonly maxWaitingClients?: number\n\n /**\n * Should the pool validate resources before giving them to clients. Requires that either factory.validate or\n * factory.validateAsync to be specified\n */\n readonly testOnBorrow?: boolean\n\n /**\n * Max milliseconds an acquire call will wait for a resource before timing out. (default no limit), if supplied should non-zero positive integer.\n */\n readonly acquireTimeoutMillis?: number\n\n /**\n * If true the oldest resources will be first to be allocated. If false the most recently released resources will\n * be the first to be allocated. This in effect turns the pool's behaviour from a queue into a stack. boolean,\n * (default true)\n */\n readonly fifo?: boolean\n\n /**\n * Int between 1 and x - if set, borrowers can specify their relative priority in the queue if no resources\n * are available. see example. (default 1)\n */\n readonly priorityRange?: number\n\n /**\n * How often to run eviction checks. Default: 0 (does not run).\n */\n readonly evictionRunIntervalMillis?: number\n\n /**\n * Number of resources to check each eviction run. Default: 3.\n */\n readonly numTestsPerRun?: number\n\n /**\n * Amount of time an object may sit idle in the pool before it is eligible for eviction by the idle object\n * evictor (if any), with the extra condition that at least \"min idle\" object instances remain in the pool.\n * Default -1 (nothing can get evicted)\n */\n readonly softIdleTimeoutMillis?: number\n\n /**\n * The minimum amount of time that an object may sit idle in the pool before it is eligible for eviction due\n * to idle time. Supercedes softIdleTimeoutMillis Default: 30000\n */\n readonly idleTimeoutMillis?: number\n\n /*\n * Function handling errors thrown by drivers pool.\n * Defaults to logging error with `warn` level.\n */\n readonly errorHandler?: (err: any) => any\n }\n\n /**\n * Extra options\n */\n readonly options?: {\n /**\n * By default, if the database requestion by options.database cannot be accessed, the connection will fail with\n * an error. However, if options.fallbackToDefaultDb is set to true, then the user's default database will\n * be used instead (Default: false).\n */\n readonly fallbackToDefaultDb?: boolean\n\n /**\n * If true, SET ANSI_NULL_DFLT_ON ON will be set in the initial sql. This means new columns will be nullable by\n * default. See the T-SQL documentation for more details. (Default: true).\n */\n readonly enableAnsiNullDefault?: boolean\n\n /**\n * The number of milliseconds before the attempt to connect is considered failed (default: 15000).\n */\n readonly connectTimeout?: number\n\n /**\n * The number of milliseconds before the cancel (abort) of a request is considered failed (default: 5000).\n */\n readonly cancelTimeout?: number\n\n /**\n * The size of TDS packets (subject to negotiation with the server). Should be a power of 2. (default: 4096).\n */\n readonly packetSize?: number\n\n /**\n * A boolean determining whether to pass time values in UTC or local time. (default: true).\n */\n readonly useUTC?: boolean\n\n /**\n * A boolean determining whether to rollback a transaction automatically if any error is encountered during\n * the given transaction's execution. This sets the value for SET XACT_ABORT during the initial SQL phase\n * of a connection (documentation).\n */\n readonly abortTransactionOnError?: boolean\n\n /**\n * A string indicating which network interface (ip address) to use when connecting to SQL Server.\n */\n readonly localAddress?: string\n\n /**\n * A boolean determining whether to return rows as arrays or key-value collections. (default: false).\n */\n readonly useColumnNames?: boolean\n\n /**\n * A boolean, controlling whether the column names returned will have the first letter converted to lower case\n * (true) or not. This value is ignored if you provide a columnNameReplacer. (default: false).\n */\n readonly camelCaseColumns?: boolean\n\n /**\n * A boolean, controlling whatever to disable RETURNING / OUTPUT statements.\n */\n readonly disableOutputReturning?: boolean\n\n /**\n * Debug options\n */\n readonly debug?: {\n /**\n * A boolean, controlling whether debug events will be emitted with text describing packet details\n * (default: false).\n */\n readonly packet?: boolean\n\n /**\n * A boolean, controlling whether debug events will be emitted with text describing packet data details\n * (default: false).\n */\n readonly data?: boolean\n\n /**\n * A boolean, controlling whether debug events will be emitted with text describing packet payload details\n * (default: false).\n */\n readonly payload?: boolean\n\n /**\n * A boolean, controlling whether debug events will be emitted with text describing token stream tokens\n * (default: false).\n */\n readonly token?: boolean\n }\n\n /**\n * The default isolation level that transactions will be run with. The isolation levels are available\n * from require('tedious').ISOLATION_LEVEL. (default: READ_COMMITTED).\n */\n readonly isolation?:\n | \"READ_UNCOMMITTED\"\n | \"READ_COMMITTED\"\n | \"REPEATABLE_READ\"\n | \"SERIALIZABLE\"\n | \"SNAPSHOT\"\n\n /**\n * The default isolation level for new connections. All out-of-transaction queries are executed with this\n * setting. The isolation levels are available from require('tedious').ISOLATION_LEVEL .\n */\n readonly connectionIsolationLevel?:\n | \"READ_UNCOMMITTED\"\n | \"READ_COMMITTED\"\n | \"REPEATABLE_READ\"\n | \"SERIALIZABLE\"\n | \"SNAPSHOT\"\n\n /**\n * A boolean, determining whether the connection will request read only access from a SQL Server\n * Availability Group. For more information, see here. (default: false).\n */\n readonly readOnlyIntent?: boolean\n\n /**\n * A boolean determining whether or not the connection will be encrypted. Set to true if you're on\n * Windows Azure. (default: false).\n */\n readonly encrypt?: boolean\n\n /**\n * When encryption is used, an object may be supplied that will be used for the first argument when calling\n * tls.createSecurePair (default: {}).\n */\n readonly cryptoCredentialsDetails?: any\n\n /**\n * A boolean, that when true will expose received rows in Requests' done* events. See done, doneInProc and\n * doneProc. (default: false)\n * Caution: If many row are received, enabling this option could result in excessive memory usage.\n */\n readonly rowCollectionOnDone?: boolean\n\n /**\n * A boolean, that when true will expose received rows in Requests' completion callback. See new Request. (default: false)\n * Caution: If many row are received, enabling this option could result in excessive memory usage.\n */\n readonly rowCollectionOnRequestCompletion?: boolean\n\n /**\n * The version of TDS to use. If server doesn't support specified version, negotiated version is used instead.\n * The versions are available from require('tedious').TDS_VERSION. (default: 7_4).\n */\n readonly tdsVersion?: string\n\n /**\n * A boolean, that when true will abort a query when an overflow or divide-by-zero error occurs during query execution.\n */\n readonly enableArithAbort?: boolean\n }\n\n /**\n * Replication setup.\n */\n readonly replication?: {\n /**\n * Master server used by orm to perform writes.\n */\n readonly master: SqlServerConnectionCredentialsOptions\n\n /**\n * List of read-from severs (slaves).\n */\n readonly slaves: SqlServerConnectionCredentialsOptions[]\n }\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../browser/src/driver/sqlserver/SqlServerConnectionOptions.ts"],"names":[],"mappings":"","file":"SqlServerConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { SqlServerConnectionCredentialsOptions } from \"./SqlServerConnectionCredentialsOptions\"\n\n/**\n * Microsoft Sql Server specific connection options.\n */\nexport interface SqlServerConnectionOptions\n extends BaseDataSourceOptions,\n SqlServerConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"mssql\"\n\n /**\n * Connection timeout in ms (default: 15000).\n */\n readonly connectionTimeout?: number\n\n /**\n * Request timeout in ms (default: 15000). NOTE: msnodesqlv8 driver doesn't support timeouts < 1 second.\n */\n readonly requestTimeout?: number\n\n /**\n * Stream recordsets/rows instead of returning them all at once as an argument of callback (default: false).\n * You can also enable streaming for each request independently (request.stream = true).\n * Always set to true if you plan to work with large amount of rows.\n */\n readonly stream?: boolean\n\n /**\n * Database schema.\n */\n readonly schema?: string\n\n /**\n * The driver object\n * This defaults to `require(\"mssql\")`\n */\n readonly driver?: any\n\n /**\n * An optional object/dictionary with the any of the properties\n */\n readonly pool?: {\n /**\n * Maximum number of resources to create at any given time. (default=1)\n */\n readonly max?: number\n\n /**\n * Minimum number of resources to keep in pool at any given time. If this is set >= max, the pool will silently\n * set the min to equal max. (default=0)\n */\n readonly min?: number\n\n /**\n * Maximum number of queued requests allowed, additional acquire calls will be callback with an err in a future\n * cycle of the event loop.\n */\n readonly maxWaitingClients?: number\n\n /**\n * Should the pool validate resources before giving them to clients. Requires that either factory.validate or\n * factory.validateAsync to be specified\n */\n readonly testOnBorrow?: boolean\n\n /**\n * Max milliseconds an acquire call will wait for a resource before timing out. (default no limit), if supplied should non-zero positive integer.\n */\n readonly acquireTimeoutMillis?: number\n\n /**\n * If true the oldest resources will be first to be allocated. If false the most recently released resources will\n * be the first to be allocated. This in effect turns the pool's behaviour from a queue into a stack. boolean,\n * (default true)\n */\n readonly fifo?: boolean\n\n /**\n * Int between 1 and x - if set, borrowers can specify their relative priority in the queue if no resources\n * are available. see example. (default 1)\n */\n readonly priorityRange?: number\n\n /**\n * How often to run eviction checks. Default: 0 (does not run).\n */\n readonly evictionRunIntervalMillis?: number\n\n /**\n * Number of resources to check each eviction run. Default: 3.\n */\n readonly numTestsPerRun?: number\n\n /**\n * Amount of time an object may sit idle in the pool before it is eligible for eviction by the idle object\n * evictor (if any), with the extra condition that at least \"min idle\" object instances remain in the pool.\n * Default -1 (nothing can get evicted)\n */\n readonly softIdleTimeoutMillis?: number\n\n /**\n * The minimum amount of time that an object may sit idle in the pool before it is eligible for eviction due\n * to idle time. Supercedes softIdleTimeoutMillis Default: 30000\n */\n readonly idleTimeoutMillis?: number\n\n /*\n * Function handling errors thrown by drivers pool.\n * Defaults to logging error with `warn` level.\n */\n readonly errorHandler?: (err: any) => any\n }\n\n /**\n * Extra options\n */\n readonly options?: {\n /**\n * By default, if the database requestion by options.database cannot be accessed, the connection will fail with\n * an error. However, if options.fallbackToDefaultDb is set to true, then the user's default database will\n * be used instead (Default: false).\n */\n readonly fallbackToDefaultDb?: boolean\n\n /**\n * If true, SET ANSI_NULL_DFLT_ON ON will be set in the initial sql. This means new columns will be nullable by\n * default. See the T-SQL documentation for more details. (Default: true).\n */\n readonly enableAnsiNullDefault?: boolean\n\n /**\n * The number of milliseconds before the attempt to connect is considered failed (default: 15000).\n */\n readonly connectTimeout?: number\n\n /**\n * The number of milliseconds before the cancel (abort) of a request is considered failed (default: 5000).\n */\n readonly cancelTimeout?: number\n\n /**\n * The size of TDS packets (subject to negotiation with the server). Should be a power of 2. (default: 4096).\n */\n readonly packetSize?: number\n\n /**\n * A boolean determining whether to pass time values in UTC or local time. (default: false).\n */\n readonly useUTC?: boolean\n\n /**\n * A boolean determining whether to rollback a transaction automatically if any error is encountered during\n * the given transaction's execution. This sets the value for SET XACT_ABORT during the initial SQL phase\n * of a connection (documentation).\n */\n readonly abortTransactionOnError?: boolean\n\n /**\n * A string indicating which network interface (ip address) to use when connecting to SQL Server.\n */\n readonly localAddress?: string\n\n /**\n * A boolean determining whether to return rows as arrays or key-value collections. (default: false).\n */\n readonly useColumnNames?: boolean\n\n /**\n * A boolean, controlling whether the column names returned will have the first letter converted to lower case\n * (true) or not. This value is ignored if you provide a columnNameReplacer. (default: false).\n */\n readonly camelCaseColumns?: boolean\n\n /**\n * A boolean, controlling whatever to disable RETURNING / OUTPUT statements.\n */\n readonly disableOutputReturning?: boolean\n\n /**\n * Debug options\n */\n readonly debug?: {\n /**\n * A boolean, controlling whether debug events will be emitted with text describing packet details\n * (default: false).\n */\n readonly packet?: boolean\n\n /**\n * A boolean, controlling whether debug events will be emitted with text describing packet data details\n * (default: false).\n */\n readonly data?: boolean\n\n /**\n * A boolean, controlling whether debug events will be emitted with text describing packet payload details\n * (default: false).\n */\n readonly payload?: boolean\n\n /**\n * A boolean, controlling whether debug events will be emitted with text describing token stream tokens\n * (default: false).\n */\n readonly token?: boolean\n }\n\n /**\n * The default isolation level that transactions will be run with. The isolation levels are available\n * from require('tedious').ISOLATION_LEVEL. (default: READ_COMMITTED).\n */\n readonly isolation?:\n | \"READ_UNCOMMITTED\"\n | \"READ_COMMITTED\"\n | \"REPEATABLE_READ\"\n | \"SERIALIZABLE\"\n | \"SNAPSHOT\"\n\n /**\n * The default isolation level for new connections. All out-of-transaction queries are executed with this\n * setting. The isolation levels are available from require('tedious').ISOLATION_LEVEL .\n */\n readonly connectionIsolationLevel?:\n | \"READ_UNCOMMITTED\"\n | \"READ_COMMITTED\"\n | \"REPEATABLE_READ\"\n | \"SERIALIZABLE\"\n | \"SNAPSHOT\"\n\n /**\n * A boolean, determining whether the connection will request read only access from a SQL Server\n * Availability Group. For more information, see here. (default: false).\n */\n readonly readOnlyIntent?: boolean\n\n /**\n * A boolean determining whether or not the connection will be encrypted. Set to true if you're on\n * Windows Azure. (default: false).\n */\n readonly encrypt?: boolean\n\n /**\n * When encryption is used, an object may be supplied that will be used for the first argument when calling\n * tls.createSecurePair (default: {}).\n */\n readonly cryptoCredentialsDetails?: any\n\n /**\n * A boolean, that when true will expose received rows in Requests' done* events. See done, doneInProc and\n * doneProc. (default: false)\n * Caution: If many row are received, enabling this option could result in excessive memory usage.\n */\n readonly rowCollectionOnDone?: boolean\n\n /**\n * A boolean, that when true will expose received rows in Requests' completion callback. See new Request. (default: false)\n * Caution: If many row are received, enabling this option could result in excessive memory usage.\n */\n readonly rowCollectionOnRequestCompletion?: boolean\n\n /**\n * The version of TDS to use. If server doesn't support specified version, negotiated version is used instead.\n * The versions are available from require('tedious').TDS_VERSION. (default: 7_4).\n */\n readonly tdsVersion?: string\n\n /**\n * A boolean, that when true will abort a query when an overflow or divide-by-zero error occurs during query execution.\n */\n readonly enableArithAbort?: boolean\n }\n\n /**\n * Replication setup.\n */\n readonly replication?: {\n /**\n * Master server used by orm to perform writes.\n */\n readonly master: SqlServerConnectionCredentialsOptions\n\n /**\n * List of read-from severs (slaves).\n */\n readonly slaves: SqlServerConnectionCredentialsOptions[]\n }\n}\n"],"sourceRoot":"../.."}
|
|
@@ -8,7 +8,7 @@ export declare type FindOptionsOrderProperty<Property> = Property extends Promis
|
|
|
8
8
|
* Order by find options.
|
|
9
9
|
*/
|
|
10
10
|
export declare type FindOptionsOrder<Entity> = {
|
|
11
|
-
[P in keyof Entity]?: FindOptionsOrderProperty<NonNullable<Entity[P]>>;
|
|
11
|
+
[P in keyof Entity]?: P extends "toString" ? unknown : FindOptionsOrderProperty<NonNullable<Entity[P]>>;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* Value of order by in find options.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/find-options/FindOptionsOrder.ts"],"names":[],"mappings":"","file":"FindOptionsOrder.js","sourcesContent":["import { ObjectID } from \"../driver/mongodb/typings\"\n\n/**\n * A single property handler for FindOptionsOrder.\n */\nexport type FindOptionsOrderProperty<Property> = Property extends Promise<\n infer I\n>\n ? FindOptionsOrderProperty<NonNullable<I>>\n : Property extends Array<infer I>\n ? FindOptionsOrderProperty<NonNullable<I>>\n : Property extends Function\n ? never\n : Property extends Buffer\n ? FindOptionsOrderValue\n : Property extends Date\n ? FindOptionsOrderValue\n : Property extends ObjectID\n ? FindOptionsOrderValue\n : Property extends object\n ? FindOptionsOrder<Property>\n : FindOptionsOrderValue\n\n/**\n * Order by find options.\n */\nexport type FindOptionsOrder<Entity> = {\n [P in keyof Entity]?: FindOptionsOrderProperty<NonNullable<Entity[P]>>\n}\n\n/**\n * Value of order by in find options.\n */\nexport type FindOptionsOrderValue =\n | \"ASC\"\n | \"DESC\"\n | \"asc\"\n | \"desc\"\n | 1\n | -1\n | {\n direction?: \"asc\" | \"desc\" | \"ASC\" | \"DESC\"\n nulls?: \"first\" | \"last\" | \"FIRST\" | \"LAST\"\n }\n"],"sourceRoot":".."}
|
|
1
|
+
{"version":3,"sources":["../browser/src/find-options/FindOptionsOrder.ts"],"names":[],"mappings":"","file":"FindOptionsOrder.js","sourcesContent":["import { ObjectID } from \"../driver/mongodb/typings\"\n\n/**\n * A single property handler for FindOptionsOrder.\n */\nexport type FindOptionsOrderProperty<Property> = Property extends Promise<\n infer I\n>\n ? FindOptionsOrderProperty<NonNullable<I>>\n : Property extends Array<infer I>\n ? FindOptionsOrderProperty<NonNullable<I>>\n : Property extends Function\n ? never\n : Property extends Buffer\n ? FindOptionsOrderValue\n : Property extends Date\n ? FindOptionsOrderValue\n : Property extends ObjectID\n ? FindOptionsOrderValue\n : Property extends object\n ? FindOptionsOrder<Property>\n : FindOptionsOrderValue\n\n/**\n * Order by find options.\n */\nexport type FindOptionsOrder<Entity> = {\n [P in keyof Entity]?: P extends \"toString\"\n ? unknown\n : FindOptionsOrderProperty<NonNullable<Entity[P]>>\n}\n\n/**\n * Value of order by in find options.\n */\nexport type FindOptionsOrderValue =\n | \"ASC\"\n | \"DESC\"\n | \"asc\"\n | \"desc\"\n | 1\n | -1\n | {\n direction?: \"asc\" | \"desc\" | \"ASC\" | \"DESC\"\n nulls?: \"first\" | \"last\" | \"FIRST\" | \"LAST\"\n }\n"],"sourceRoot":".."}
|
|
@@ -8,7 +8,7 @@ export declare type FindOptionsRelationsProperty<Property> = Property extends Pr
|
|
|
8
8
|
* Relations find options.
|
|
9
9
|
*/
|
|
10
10
|
export declare type FindOptionsRelations<Entity> = {
|
|
11
|
-
[P in keyof Entity]?: FindOptionsRelationsProperty<NonNullable<Entity[P]>>;
|
|
11
|
+
[P in keyof Entity]?: P extends "toString" ? unknown : FindOptionsRelationsProperty<NonNullable<Entity[P]>>;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* Relation names to be selected by "relation" defined as string.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/find-options/FindOptionsRelations.ts"],"names":[],"mappings":"","file":"FindOptionsRelations.js","sourcesContent":["import { ObjectID } from \"../driver/mongodb/typings\"\n\n/**\n * A single property handler for FindOptionsRelations.\n */\nexport type FindOptionsRelationsProperty<Property> = Property extends Promise<\n infer I\n>\n ? FindOptionsRelationsProperty<NonNullable<I>> | boolean\n : Property extends Array<infer I>\n ? FindOptionsRelationsProperty<NonNullable<I>> | boolean\n : Property extends Function\n ? never\n : Property extends Buffer\n ? never\n : Property extends Date\n ? never\n : Property extends ObjectID\n ? never\n : Property extends object\n ? FindOptionsRelations<Property> | boolean\n : boolean\n\n/**\n * Relations find options.\n */\nexport type FindOptionsRelations<Entity> = {\n [P in keyof Entity]?: FindOptionsRelationsProperty<NonNullable<Entity[P]>>\n}\n\n/**\n * Relation names to be selected by \"relation\" defined as string.\n * Old relation mechanism in TypeORM.\n *\n * @deprecated will be removed in the next version, use FindOptionsRelation type notation instead\n */\nexport type FindOptionsRelationByString = string[]\n"],"sourceRoot":".."}
|
|
1
|
+
{"version":3,"sources":["../browser/src/find-options/FindOptionsRelations.ts"],"names":[],"mappings":"","file":"FindOptionsRelations.js","sourcesContent":["import { ObjectID } from \"../driver/mongodb/typings\"\n\n/**\n * A single property handler for FindOptionsRelations.\n */\nexport type FindOptionsRelationsProperty<Property> = Property extends Promise<\n infer I\n>\n ? FindOptionsRelationsProperty<NonNullable<I>> | boolean\n : Property extends Array<infer I>\n ? FindOptionsRelationsProperty<NonNullable<I>> | boolean\n : Property extends Function\n ? never\n : Property extends Buffer\n ? never\n : Property extends Date\n ? never\n : Property extends ObjectID\n ? never\n : Property extends object\n ? FindOptionsRelations<Property> | boolean\n : boolean\n\n/**\n * Relations find options.\n */\nexport type FindOptionsRelations<Entity> = {\n [P in keyof Entity]?: P extends \"toString\"\n ? unknown\n : FindOptionsRelationsProperty<NonNullable<Entity[P]>>\n}\n\n/**\n * Relation names to be selected by \"relation\" defined as string.\n * Old relation mechanism in TypeORM.\n *\n * @deprecated will be removed in the next version, use FindOptionsRelation type notation instead\n */\nexport type FindOptionsRelationByString = string[]\n"],"sourceRoot":".."}
|
|
@@ -8,7 +8,7 @@ export declare type FindOptionsSelectProperty<Property> = Property extends Promi
|
|
|
8
8
|
* Select find options.
|
|
9
9
|
*/
|
|
10
10
|
export declare type FindOptionsSelect<Entity> = {
|
|
11
|
-
[P in keyof Entity]?: FindOptionsSelectProperty<NonNullable<Entity[P]>>;
|
|
11
|
+
[P in keyof Entity]?: P extends "toString" ? unknown : FindOptionsSelectProperty<NonNullable<Entity[P]>>;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* Property paths (column names) to be selected by "find" defined as string.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/find-options/FindOptionsSelect.ts"],"names":[],"mappings":"","file":"FindOptionsSelect.js","sourcesContent":["import { ObjectID } from \"../driver/mongodb/typings\"\n\n/**\n * A single property handler for FindOptionsSelect.\n */\nexport type FindOptionsSelectProperty<Property> = Property extends Promise<\n infer I\n>\n ? FindOptionsSelectProperty<I> | boolean\n : Property extends Array<infer I>\n ? FindOptionsSelectProperty<I> | boolean\n : Property extends Function\n ? never\n : Property extends Buffer\n ? boolean\n : Property extends Date\n ? boolean\n : Property extends ObjectID\n ? boolean\n : Property extends object\n ? FindOptionsSelect<Property>\n : boolean\n\n/**\n * Select find options.\n */\nexport type FindOptionsSelect<Entity> = {\n [P in keyof Entity]?: FindOptionsSelectProperty<NonNullable<Entity[P]>>\n}\n\n/**\n * Property paths (column names) to be selected by \"find\" defined as string.\n * Old selection mechanism in TypeORM.\n *\n * @deprecated will be removed in the next version, use FindOptionsSelect type notation instead\n */\nexport type FindOptionsSelectByString<Entity> = (keyof Entity)[]\n"],"sourceRoot":".."}
|
|
1
|
+
{"version":3,"sources":["../browser/src/find-options/FindOptionsSelect.ts"],"names":[],"mappings":"","file":"FindOptionsSelect.js","sourcesContent":["import { ObjectID } from \"../driver/mongodb/typings\"\n\n/**\n * A single property handler for FindOptionsSelect.\n */\nexport type FindOptionsSelectProperty<Property> = Property extends Promise<\n infer I\n>\n ? FindOptionsSelectProperty<I> | boolean\n : Property extends Array<infer I>\n ? FindOptionsSelectProperty<I> | boolean\n : Property extends Function\n ? never\n : Property extends Buffer\n ? boolean\n : Property extends Date\n ? boolean\n : Property extends ObjectID\n ? boolean\n : Property extends object\n ? FindOptionsSelect<Property>\n : boolean\n\n/**\n * Select find options.\n */\nexport type FindOptionsSelect<Entity> = {\n [P in keyof Entity]?: P extends \"toString\"\n ? unknown\n : FindOptionsSelectProperty<NonNullable<Entity[P]>>\n}\n\n/**\n * Property paths (column names) to be selected by \"find\" defined as string.\n * Old selection mechanism in TypeORM.\n *\n * @deprecated will be removed in the next version, use FindOptionsSelect type notation instead\n */\nexport type FindOptionsSelectByString<Entity> = (keyof Entity)[]\n"],"sourceRoot":".."}
|
|
@@ -10,5 +10,5 @@ export declare type FindOptionsWhereProperty<Property> = Property extends Promis
|
|
|
10
10
|
* Used for find operations.
|
|
11
11
|
*/
|
|
12
12
|
export declare type FindOptionsWhere<Entity> = {
|
|
13
|
-
[P in keyof Entity]?: FindOptionsWhereProperty<NonNullable<Entity[P]>>;
|
|
13
|
+
[P in keyof Entity]?: P extends "toString" ? unknown : FindOptionsWhereProperty<NonNullable<Entity[P]>>;
|
|
14
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/find-options/FindOptionsWhere.ts"],"names":[],"mappings":"","file":"FindOptionsWhere.js","sourcesContent":["import { FindOperator } from \"./FindOperator\"\nimport { ObjectID } from \"../driver/mongodb/typings\"\nimport { EqualOperator } from \"./EqualOperator\"\n\n/**\n * A single property handler for FindOptionsWhere.\n */\nexport type FindOptionsWhereProperty<Property> = Property extends Promise<\n infer I\n>\n ? FindOptionsWhereProperty<NonNullable<I>>\n : Property extends Array<infer I>\n ? FindOptionsWhereProperty<NonNullable<I>>\n : Property extends Function\n ? never\n : Property extends Buffer\n ? Property | FindOperator<Property>\n : Property extends Date\n ? Property | FindOperator<Property>\n : Property extends ObjectID\n ? Property | FindOperator<Property>\n : Property extends object\n ?\n | FindOptionsWhere<Property>\n | FindOptionsWhere<Property>[]\n | EqualOperator<Property>\n | FindOperator<any>\n | boolean\n : Property | FindOperator<Property>\n\n/** :\n * Used for find operations.\n */\nexport type FindOptionsWhere<Entity> = {\n [P in keyof Entity]?: FindOptionsWhereProperty<NonNullable<Entity[P]>>\n}\n"],"sourceRoot":".."}
|
|
1
|
+
{"version":3,"sources":["../browser/src/find-options/FindOptionsWhere.ts"],"names":[],"mappings":"","file":"FindOptionsWhere.js","sourcesContent":["import { FindOperator } from \"./FindOperator\"\nimport { ObjectID } from \"../driver/mongodb/typings\"\nimport { EqualOperator } from \"./EqualOperator\"\n\n/**\n * A single property handler for FindOptionsWhere.\n */\nexport type FindOptionsWhereProperty<Property> = Property extends Promise<\n infer I\n>\n ? FindOptionsWhereProperty<NonNullable<I>>\n : Property extends Array<infer I>\n ? FindOptionsWhereProperty<NonNullable<I>>\n : Property extends Function\n ? never\n : Property extends Buffer\n ? Property | FindOperator<Property>\n : Property extends Date\n ? Property | FindOperator<Property>\n : Property extends ObjectID\n ? Property | FindOperator<Property>\n : Property extends object\n ?\n | FindOptionsWhere<Property>\n | FindOptionsWhere<Property>[]\n | EqualOperator<Property>\n | FindOperator<any>\n | boolean\n : Property | FindOperator<Property>\n\n/** :\n * Used for find operations.\n */\nexport type FindOptionsWhere<Entity> = {\n [P in keyof Entity]?: P extends \"toString\"\n ? unknown\n : FindOptionsWhereProperty<NonNullable<Entity[P]>>\n}\n"],"sourceRoot":".."}
|
package/cli-ts-node-commonjs.js
CHANGED
|
File without changes
|
package/cli-ts-node-esm.js
CHANGED
|
File without changes
|
package/cli.js
CHANGED
|
File without changes
|
package/commands/CommandUtils.js
CHANGED
|
@@ -26,9 +26,12 @@ class CommandUtils {
|
|
|
26
26
|
throw new Error(`Given data source file must contain export of a DataSource instance`);
|
|
27
27
|
}
|
|
28
28
|
const dataSourceExports = [];
|
|
29
|
-
for (
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
for (const fileExport of dataSourceFileExports) {
|
|
30
|
+
// It is necessary to await here in case of the exported async value (Promise<DataSource>).
|
|
31
|
+
// e.g. the DataSource is instantiated with an async factory in the source file
|
|
32
|
+
const awaitedFileExport = fileExport instanceof Promise ? await fileExport : fileExport;
|
|
33
|
+
if (InstanceChecker_1.InstanceChecker.isDataSource(awaitedFileExport)) {
|
|
34
|
+
dataSourceExports.push(awaitedFileExport);
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
37
|
if (dataSourceExports.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/CommandUtils.ts"],"names":[],"mappings":";;;;AAAA,+CAAwB;AACxB,mDAA4B;AAC5B,4DAA2B;AAC3B,oCAAuC;AAEvC,6DAAyD;AACzD,qDAAyD;AAEzD;;GAEG;AACH,MAAa,YAAY;IACrB,MAAM,CAAC,KAAK,CAAC,cAAc,CACvB,kBAA0B;QAE1B,IAAI,qBAAqB,CAAA;QACzB,IAAI;YACA,CAAC;YAAA,CAAC,qBAAqB,CAAC,GAAG,MAAM,IAAA,iCAAmB,EAChD,kBAAkB,CACrB,CAAA;SACJ;QAAC,OAAO,GAAG,EAAE;YACV,MAAM,IAAI,KAAK,CACX,yBAAyB,kBAAkB,MAAM,GAAG,CAAC,OAAO,EAAE,CACjE,CAAA;SACJ;QAED,IACI,CAAC,qBAAqB;YACtB,OAAO,qBAAqB,KAAK,QAAQ,EAC3C;YACE,MAAM,IAAI,KAAK,CACX,qEAAqE,CACxE,CAAA;SACJ;QAED,MAAM,iBAAiB,GAAG,EAA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B;QAC5C,IACI,uBAAuB;YACvB,CAAC,KAAK,CAAC,uBAAuB,CAAC,IAAI,uBAAuB,GAAG,CAAC,CAAC,EACjE;YACE,MAAM,IAAI,oBAAY,CAClB,+DAA+D,uBAAuB,EAAE,CAC3F,CAAA;SACJ;QACD,OAAO,uBAAuB;YAC1B,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,OAAO,EAAE;YACrD,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAA;IACpB,CAAC;CACJ;AAtGD,oCAsGC","file":"CommandUtils.js","sourcesContent":["import * as fs from \"fs\"\nimport * as path from \"path\"\nimport mkdirp from \"mkdirp\"\nimport { TypeORMError } from \"../error\"\nimport { DataSource } from \"../data-source\"\nimport { InstanceChecker } from \"../util/InstanceChecker\"\nimport { importOrRequireFile } from \"../util/ImportUtils\"\n\n/**\n * Command line utils functions.\n */\nexport class CommandUtils {\n static async loadDataSource(\n dataSourceFilePath: string,\n ): Promise<DataSource> {\n let dataSourceFileExports\n try {\n ;[dataSourceFileExports] = await importOrRequireFile(\n dataSourceFilePath,\n )\n } catch (err) {\n throw new Error(\n `Unable to open file: \"${dataSourceFilePath}\". ${err.message}`,\n )\n }\n\n if (\n !dataSourceFileExports ||\n typeof dataSourceFileExports !== \"object\"\n ) {\n throw new Error(\n `Given data source file must contain export of a DataSource instance`,\n )\n }\n\n const dataSourceExports = []\n for (const fileExport of dataSourceFileExports) {\n // It is necessary to await here in case of the exported async value (Promise<DataSource>).\n // e.g. the DataSource is instantiated with an async factory in the source file\n const awaitedFileExport =\n fileExport instanceof Promise ? await fileExport : fileExport\n if (InstanceChecker.isDataSource(awaitedFileExport)) {\n dataSourceExports.push(awaitedFileExport)\n }\n }\n\n if (dataSourceExports.length === 0) {\n throw new Error(\n `Given data source file must contain export of a DataSource instance`,\n )\n }\n if (dataSourceExports.length > 1) {\n throw new Error(\n `Given data source file must contain only one export of DataSource instance`,\n )\n }\n return dataSourceExports[0]\n }\n\n /**\n * Creates directories recursively.\n */\n static createDirectories(directory: string) {\n return mkdirp(directory)\n }\n\n /**\n * Creates a file with the given content in the given path.\n */\n static async createFile(\n filePath: string,\n content: string,\n override: boolean = true,\n ): Promise<void> {\n await CommandUtils.createDirectories(path.dirname(filePath))\n return new Promise<void>((ok, fail) => {\n if (override === false && fs.existsSync(filePath)) return ok()\n\n fs.writeFile(filePath, content, (err) => (err ? fail(err) : ok()))\n })\n }\n\n /**\n * Reads everything from a given file and returns its content as a string.\n */\n static async readFile(filePath: string): Promise<string> {\n return new Promise<string>((ok, fail) => {\n fs.readFile(filePath, (err, data) =>\n err ? fail(err) : ok(data.toString()),\n )\n })\n }\n\n static async fileExists(filePath: string) {\n return fs.existsSync(filePath)\n }\n\n /**\n * Gets migration timestamp and validates argument (if sent)\n */\n static getTimestamp(timestampOptionArgument: any): number {\n if (\n timestampOptionArgument &&\n (isNaN(timestampOptionArgument) || timestampOptionArgument < 0)\n ) {\n throw new TypeORMError(\n `timestamp option should be a non-negative number. received: ${timestampOptionArgument}`,\n )\n }\n return timestampOptionArgument\n ? new Date(Number(timestampOptionArgument)).getTime()\n : Date.now()\n }\n}\n"],"sourceRoot":".."}
|
package/commands/InitCommand.js
CHANGED
|
@@ -588,7 +588,7 @@ Steps to run this project:
|
|
|
588
588
|
packageJson.dependencies["oracledb"] = "^5.1.0";
|
|
589
589
|
break;
|
|
590
590
|
case "mssql":
|
|
591
|
-
packageJson.dependencies["mssql"] = "^
|
|
591
|
+
packageJson.dependencies["mssql"] = "^7.3.0";
|
|
592
592
|
break;
|
|
593
593
|
case "mongodb":
|
|
594
594
|
packageJson.dependencies["mongodb"] = "^3.0.8";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/InitCommand.ts"],"names":[],"mappings":";;;;AAAA,iDAA6C;AAC7C,mDAA4B;AAE5B,0DAAyB;AACzB,iDAAoC;AACpC,oCAAuC;AACvC,6DAAyD;AAEzD;;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AAC;CACJ;AAxsBD,kCAwsBC","file":"InitCommand.js","sourcesContent":["import { CommandUtils } from \"./CommandUtils\"\nimport * as path from \"path\"\nimport * as yargs from \"yargs\"\nimport chalk from \"chalk\"\nimport { exec } from \"child_process\"\nimport { TypeORMError } from \"../error\"\nimport { PlatformTools } from \"../platform/PlatformTools\"\n\n/**\n * Generates a new project with TypeORM.\n */\nexport class InitCommand implements yargs.CommandModule {\n command = \"init\"\n describe =\n \"Generates initial TypeORM project structure. \" +\n \"If name specified then creates files inside directory called as name. \" +\n \"If its not specified then creates files inside current directory.\"\n\n builder(args: yargs.Argv) {\n return args\n .option(\"n\", {\n alias: \"name\",\n describe: \"Name of the project directory.\",\n })\n .option(\"db\", {\n alias: \"database\",\n describe: \"Database type you'll use in your project.\",\n })\n .option(\"express\", {\n describe:\n \"Indicates if express server sample code should be included in the project. False by default.\",\n })\n .option(\"docker\", {\n describe:\n \"Set to true if docker-compose must be generated as well. False by default.\",\n })\n .option(\"pm\", {\n alias: \"manager\",\n choices: [\"npm\", \"yarn\"],\n default: \"npm\",\n describe: \"Install packages, expected values are npm or yarn.\",\n })\n .option(\"ms\", {\n alias: \"module\",\n choices: [\"commonjs\", \"esm\"],\n default: \"commonjs\",\n describe:\n \"Module system to use for project, expected values are commonjs or esm.\",\n })\n }\n\n async handler(args: yargs.Arguments) {\n try {\n const database: string = (args.database as any) || \"postgres\"\n const isExpress = args.express !== undefined ? true : false\n const isDocker = args.docker !== undefined ? true : false\n const basePath = process.cwd() + (args.name ? \"/\" + args.name : \"\")\n const projectName = args.name\n ? path.basename(args.name as any)\n : undefined\n const installNpm = args.pm === \"yarn\" ? false : true\n const projectIsEsm = args.ms === \"esm\"\n await CommandUtils.createFile(\n basePath + \"/package.json\",\n InitCommand.getPackageJsonTemplate(projectName, projectIsEsm),\n false,\n )\n if (isDocker)\n await CommandUtils.createFile(\n basePath + \"/docker-compose.yml\",\n InitCommand.getDockerComposeTemplate(database),\n false,\n )\n await CommandUtils.createFile(\n basePath + \"/.gitignore\",\n InitCommand.getGitIgnoreFile(),\n )\n await CommandUtils.createFile(\n basePath + \"/README.md\",\n InitCommand.getReadmeTemplate({ docker: isDocker }),\n false,\n )\n await CommandUtils.createFile(\n basePath + \"/tsconfig.json\",\n InitCommand.getTsConfigTemplate(projectIsEsm),\n )\n await CommandUtils.createFile(\n basePath + \"/src/entity/User.ts\",\n InitCommand.getUserEntityTemplate(database),\n )\n await CommandUtils.createFile(\n basePath + \"/src/data-source.ts\",\n InitCommand.getAppDataSourceTemplate(projectIsEsm, database),\n )\n await CommandUtils.createFile(\n basePath + \"/src/index.ts\",\n InitCommand.getAppIndexTemplate(isExpress, projectIsEsm),\n )\n await CommandUtils.createDirectories(basePath + \"/src/migration\")\n\n // generate extra files for express application\n if (isExpress) {\n await CommandUtils.createFile(\n basePath + \"/src/routes.ts\",\n InitCommand.getRoutesTemplate(projectIsEsm),\n )\n await CommandUtils.createFile(\n basePath + \"/src/controller/UserController.ts\",\n InitCommand.getControllerTemplate(projectIsEsm),\n )\n }\n\n const packageJsonContents = await CommandUtils.readFile(\n basePath + \"/package.json\",\n )\n await CommandUtils.createFile(\n basePath + \"/package.json\",\n InitCommand.appendPackageJson(\n packageJsonContents,\n database,\n isExpress,\n projectIsEsm,\n ),\n )\n\n if (args.name) {\n console.log(\n chalk.green(\n `Project created inside ${chalk.blue(\n basePath,\n )} directory.`,\n ),\n )\n } else {\n console.log(\n chalk.green(`Project created inside current directory.`),\n )\n }\n\n console.log(chalk.green(`Please wait, installing dependencies...`))\n if (args.pm && installNpm) {\n await InitCommand.executeCommand(\"npm install\", basePath)\n } else {\n await InitCommand.executeCommand(\"yarn install\", basePath)\n }\n\n console.log(chalk.green(`Done! Start playing with a new project!`))\n } catch (err) {\n PlatformTools.logCmdErr(\"Error during project initialization:\", err)\n process.exit(1)\n }\n }\n\n // -------------------------------------------------------------------------\n // Protected Static Methods\n // -------------------------------------------------------------------------\n\n protected static executeCommand(command: string, cwd: string) {\n return new Promise<string>((ok, fail) => {\n exec(command, { cwd }, (error: any, stdout: any, stderr: any) => {\n if (stdout) return ok(stdout)\n if (stderr) return fail(stderr)\n if (error) return fail(error)\n ok(\"\")\n })\n })\n }\n\n /**\n * Gets contents of the ormconfig file.\n */\n protected static getAppDataSourceTemplate(\n isEsm: boolean,\n database: string,\n ): string {\n let dbSettings = \"\"\n switch (database) {\n case \"mysql\":\n dbSettings = `type: \"mysql\",\n host: \"localhost\",\n port: 3306,\n username: \"test\",\n password: \"test\",\n database: \"test\",`\n break\n case \"mariadb\":\n dbSettings = `type: \"mariadb\",\n host: \"localhost\",\n port: 3306,\n username: \"test\",\n password: \"test\",\n database: \"test\",`\n break\n case \"sqlite\":\n dbSettings = `type: \"sqlite\",\n database: \"database.sqlite\",`\n break\n case \"better-sqlite3\":\n dbSettings = `type: \"better-sqlite3\",\n database: \"database.sqlite\",`\n break\n case \"postgres\":\n dbSettings = `type: \"postgres\",\n host: \"localhost\",\n port: 5432,\n username: \"test\",\n password: \"test\",\n database: \"test\",`\n break\n case \"cockroachdb\":\n dbSettings = `type: \"cockroachdb\",\n host: \"localhost\",\n port: 26257,\n username: \"root\",\n password: \"\",\n database: \"defaultdb\",`\n break\n case \"mssql\":\n dbSettings = `type: \"mssql\",\n host: \"localhost\",\n username: \"sa\",\n password: \"Admin12345\",\n database: \"tempdb\",`\n break\n case \"oracle\":\n dbSettings = `type: \"oracle\",\nhost: \"localhost\",\nusername: \"system\",\npassword: \"oracle\",\nport: 1521,\nsid: \"xe.oracle.docker\",`\n break\n case \"mongodb\":\n dbSettings = `type: \"mongodb\",\n database: \"test\",`\n break\n case \"spanner\":\n dbSettings = `type: \"spanner\",\n projectId: \"test\",\n instanceId: \"test\",\n databaseId: \"test\",`\n break\n }\n return `import \"reflect-metadata\"\nimport { DataSource } from \"typeorm\"\nimport { User } from \"./entity/User${isEsm ? \".js\" : \"\"}\"\n\nexport const AppDataSource = new DataSource({\n ${dbSettings}\n synchronize: true,\n logging: false,\n entities: [User],\n migrations: [],\n subscribers: [],\n})\n`\n }\n\n /**\n * Gets contents of the ormconfig file.\n */\n protected static getTsConfigTemplate(esmModule: boolean): string {\n if (esmModule)\n return JSON.stringify(\n {\n compilerOptions: {\n lib: [\"es2021\"],\n target: \"es2021\",\n module: \"es2022\",\n moduleResolution: \"node\",\n allowSyntheticDefaultImports: true,\n outDir: \"./build\",\n emitDecoratorMetadata: true,\n experimentalDecorators: true,\n sourceMap: true,\n },\n },\n undefined,\n 3,\n )\n else\n return JSON.stringify(\n {\n compilerOptions: {\n lib: [\"es5\", \"es6\"],\n target: \"es5\",\n module: \"commonjs\",\n moduleResolution: \"node\",\n outDir: \"./build\",\n emitDecoratorMetadata: true,\n experimentalDecorators: true,\n sourceMap: true,\n },\n },\n undefined,\n 3,\n )\n }\n\n /**\n * Gets contents of the .gitignore file.\n */\n protected static getGitIgnoreFile(): string {\n return `.idea/\n.vscode/\nnode_modules/\nbuild/\ntmp/\ntemp/`\n }\n\n /**\n * Gets contents of the user entity.\n */\n protected static getUserEntityTemplate(database: string): string {\n return `import { Entity, ${\n database === \"mongodb\"\n ? \"ObjectIdColumn, ObjectID\"\n : \"PrimaryGeneratedColumn\"\n }, Column } from \"typeorm\"\n\n@Entity()\nexport class User {\n\n ${\n database === \"mongodb\"\n ? \"@ObjectIdColumn()\"\n : \"@PrimaryGeneratedColumn()\"\n }\n id: ${database === \"mongodb\" ? \"ObjectID\" : \"number\"}\n\n @Column()\n firstName: string\n\n @Column()\n lastName: string\n\n @Column()\n age: number\n\n}\n`\n }\n\n /**\n * Gets contents of the route file (used when express is enabled).\n */\n protected static getRoutesTemplate(isEsm: boolean): string {\n return `import { UserController } from \"./controller/UserController${\n isEsm ? \".js\" : \"\"\n }\"\n\nexport const Routes = [{\n method: \"get\",\n route: \"/users\",\n controller: UserController,\n action: \"all\"\n}, {\n method: \"get\",\n route: \"/users/:id\",\n controller: UserController,\n action: \"one\"\n}, {\n method: \"post\",\n route: \"/users\",\n controller: UserController,\n action: \"save\"\n}, {\n method: \"delete\",\n route: \"/users/:id\",\n controller: UserController,\n action: \"remove\"\n}]`\n }\n\n /**\n * Gets contents of the user controller file (used when express is enabled).\n */\n protected static getControllerTemplate(isEsm: boolean): string {\n return `import { getRepository } from \"typeorm\"\nimport { NextFunction, Request, Response } from \"express\"\nimport { User } from \"../entity/User${isEsm ? \".js\" : \"\"}\"\n\nexport class UserController {\n\n private userRepository = getRepository(User)\n\n async all(request: Request, response: Response, next: NextFunction) {\n return this.userRepository.find()\n }\n\n async one(request: Request, response: Response, next: NextFunction) {\n return this.userRepository.findOne(request.params.id)\n }\n\n async save(request: Request, response: Response, next: NextFunction) {\n return this.userRepository.save(request.body)\n }\n\n async remove(request: Request, response: Response, next: NextFunction) {\n let userToRemove = await this.userRepository.findOneBy({ id: request.params.id })\n await this.userRepository.remove(userToRemove)\n }\n\n}`\n }\n\n /**\n * Gets contents of the main (index) application file.\n */\n protected static getAppIndexTemplate(\n express: boolean,\n isEsm: boolean,\n ): string {\n if (express) {\n return `import ${!isEsm ? \"* as \" : \"\"}express from \"express\"\nimport ${!isEsm ? \"* as \" : \"\"}bodyParser from \"body-parser\"\nimport { Request, Response } from \"express\"\nimport { AppDataSource } from \"./data-source${isEsm ? \".js\" : \"\"}\"\nimport { Routes } from \"./routes${isEsm ? \".js\" : \"\"}\"\nimport { User } from \"./entity/User${isEsm ? \".js\" : \"\"}\"\n\nAppDataSource.initialize().then(async () => {\n\n // create express app\n const app = express()\n app.use(bodyParser.json())\n\n // register express routes from defined application routes\n Routes.forEach(route => {\n (app as any)[route.method](route.route, (req: Request, res: Response, next: Function) => {\n const result = (new (route.controller as any))[route.action](req, res, next)\n if (result instanceof Promise) {\n result.then(result => result !== null && result !== undefined ? res.send(result) : undefined)\n\n } else if (result !== null && result !== undefined) {\n res.json(result)\n }\n })\n })\n\n // setup express app here\n // ...\n\n // start express server\n app.listen(3000)\n\n // insert new users for test\n await AppDataSource.manager.save(\n AppDataSource.manager.create(User, {\n firstName: \"Timber\",\n lastName: \"Saw\",\n age: 27\n })\n )\n\n await AppDataSource.manager.save(\n AppDataSource.manager.create(User, {\n firstName: \"Phantom\",\n lastName: \"Assassin\",\n age: 24\n })\n )\n\n console.log(\"Express server has started on port 3000. Open http://localhost:3000/users to see results\")\n\n}).catch(error => console.log(error))\n`\n } else {\n return `import { AppDataSource } from \"./data-source${\n isEsm ? \".js\" : \"\"\n }\"\nimport { User } from \"./entity/User${isEsm ? \".js\" : \"\"}\"\n\nAppDataSource.initialize().then(async () => {\n\n console.log(\"Inserting a new user into the database...\")\n const user = new User()\n user.firstName = \"Timber\"\n user.lastName = \"Saw\"\n user.age = 25\n await AppDataSource.manager.save(user)\n console.log(\"Saved a new user with id: \" + user.id)\n\n console.log(\"Loading users from the database...\")\n const users = await AppDataSource.manager.find(User)\n console.log(\"Loaded users: \", users)\n\n console.log(\"Here you can setup and run express / fastify / any other framework.\")\n\n}).catch(error => console.log(error))\n`\n }\n }\n\n /**\n * Gets contents of the new package.json file.\n */\n protected static getPackageJsonTemplate(\n projectName?: string,\n projectIsEsm?: boolean,\n ): string {\n return JSON.stringify(\n {\n name: projectName || \"typeorm-sample\",\n version: \"0.0.1\",\n description: \"Awesome project developed with TypeORM.\",\n type: projectIsEsm ? \"module\" : \"commonjs\",\n devDependencies: {},\n dependencies: {},\n scripts: {},\n },\n undefined,\n 3,\n )\n }\n\n /**\n * Gets contents of the new docker-compose.yml file.\n */\n protected static getDockerComposeTemplate(database: string): string {\n switch (database) {\n case \"mysql\":\n return `version: '3'\nservices:\n\n mysql:\n image: \"mysql:5.7.10\"\n ports:\n - \"3306:3306\"\n environment:\n MYSQL_ROOT_PASSWORD: \"admin\"\n MYSQL_USER: \"test\"\n MYSQL_PASSWORD: \"test\"\n MYSQL_DATABASE: \"test\"\n\n`\n case \"mariadb\":\n return `version: '3'\nservices:\n\n mariadb:\n image: \"mariadb:10.1.16\"\n ports:\n - \"3306:3306\"\n environment:\n MYSQL_ROOT_PASSWORD: \"admin\"\n MYSQL_USER: \"test\"\n MYSQL_PASSWORD: \"test\"\n MYSQL_DATABASE: \"test\"\n\n`\n case \"postgres\":\n return `version: '3'\nservices:\n\n postgres:\n image: \"postgres:9.6.1\"\n ports:\n - \"5432:5432\"\n environment:\n POSTGRES_USER: \"test\"\n POSTGRES_PASSWORD: \"test\"\n POSTGRES_DB: \"test\"\n\n`\n case \"cockroachdb\":\n return `version: '3'\nservices:\n\n cockroachdb:\n image: \"cockroachdb/cockroach:v2.1.4\"\n command: start --insecure\n ports:\n - \"26257:26257\"\n\n`\n case \"sqlite\":\n case \"better-sqlite3\":\n return `version: '3'\nservices:\n`\n case \"oracle\":\n throw new TypeORMError(\n `You cannot initialize a project with docker for Oracle driver yet.`,\n ) // todo: implement for oracle as well\n\n case \"mssql\":\n return `version: '3'\nservices:\n\n mssql:\n image: \"microsoft/mssql-server-linux:rc2\"\n ports:\n - \"1433:1433\"\n environment:\n SA_PASSWORD: \"Admin12345\"\n ACCEPT_EULA: \"Y\"\n\n`\n case \"mongodb\":\n return `version: '3'\nservices:\n\n mongodb:\n image: \"mongo:4.0.6\"\n container_name: \"typeorm-mongodb\"\n ports:\n - \"27017:27017\"\n\n`\n case \"spanner\":\n return `version: '3'\nservices:\n\n spanner:\n image: gcr.io/cloud-spanner-emulator/emulator:1.4.1\n ports:\n - \"9010:9010\"\n - \"9020:9020\"\n\n`\n }\n return \"\"\n }\n\n /**\n * Gets contents of the new readme.md file.\n */\n protected static getReadmeTemplate(options: { docker: boolean }): string {\n let template = `# Awesome Project Build with TypeORM\n\nSteps to run this project:\n\n1. Run \\`npm i\\` command\n`\n\n if (options.docker) {\n template += `2. Run \\`docker-compose up\\` command\n`\n } else {\n template += `2. Setup database settings inside \\`data-source.ts\\` file\n`\n }\n\n template += `3. Run \\`npm start\\` command\n`\n return template\n }\n\n /**\n * Appends to a given package.json template everything needed.\n */\n protected static appendPackageJson(\n packageJsonContents: string,\n database: string,\n express: boolean,\n projectIsEsm: boolean /*, docker: boolean*/,\n ): string {\n const packageJson = JSON.parse(packageJsonContents)\n\n if (!packageJson.devDependencies) packageJson.devDependencies = {}\n Object.assign(packageJson.devDependencies, {\n \"ts-node\": \"10.7.0\",\n \"@types/node\": \"^16.11.10\",\n typescript: \"4.5.2\",\n })\n\n if (!packageJson.dependencies) packageJson.dependencies = {}\n Object.assign(packageJson.dependencies, {\n typeorm: require(\"../package.json\").version,\n \"reflect-metadata\": \"^0.1.13\",\n })\n\n switch (database) {\n case \"mysql\":\n case \"mariadb\":\n packageJson.dependencies[\"mysql\"] = \"^2.14.1\"\n break\n case \"postgres\":\n case \"cockroachdb\":\n packageJson.dependencies[\"pg\"] = \"^8.4.0\"\n break\n case \"sqlite\":\n packageJson.dependencies[\"sqlite3\"] = \"^5.0.2\"\n break\n case \"better-sqlite3\":\n packageJson.dependencies[\"better-sqlite3\"] = \"^7.0.0\"\n break\n case \"oracle\":\n packageJson.dependencies[\"oracledb\"] = \"^5.1.0\"\n break\n case \"mssql\":\n packageJson.dependencies[\"mssql\"] = \"^6.3.0\"\n break\n case \"mongodb\":\n packageJson.dependencies[\"mongodb\"] = \"^3.0.8\"\n break\n case \"spanner\":\n packageJson.dependencies[\"@google-cloud/spanner\"] = \"^5.18.0\"\n break\n }\n\n if (express) {\n packageJson.dependencies[\"express\"] = \"^4.17.2\"\n packageJson.dependencies[\"body-parser\"] = \"^1.19.1\"\n }\n\n if (!packageJson.scripts) packageJson.scripts = {}\n\n if (projectIsEsm)\n Object.assign(packageJson.scripts, {\n start: /*(docker ? \"docker-compose up && \" : \"\") + */ \"node --loader ts-node/esm src/index.ts\",\n typeorm: \"typeorm-ts-node-esm\",\n })\n else\n Object.assign(packageJson.scripts, {\n start: /*(docker ? \"docker-compose up && \" : \"\") + */ \"ts-node src/index.ts\",\n typeorm: \"typeorm-ts-node-commonjs\",\n })\n\n return JSON.stringify(packageJson, undefined, 3)\n }\n}\n"],"sourceRoot":".."}
|
|
1
|
+
{"version":3,"sources":["../../src/commands/InitC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AAO,EAAE,0BAA0B;aACtC,CAAC,CAAA;QAEN,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,EAAE,CAAC,CAAC,CAAA;IACpD,CAAC;CACJ;AAxsBD,kCAwsBC","file":"InitCommand.js","sourcesContent":["import { CommandUtils } from \"./CommandUtils\"\nimport * as path from \"path\"\nimport * as yargs from \"yargs\"\nimport chalk from \"chalk\"\nimport { exec } from \"child_process\"\nimport { TypeORMError } from \"../error\"\nimport { PlatformTools } from \"../platform/PlatformTools\"\n\n/**\n * Generates a new project with TypeORM.\n */\nexport class InitCommand implements yargs.CommandModule {\n command = \"init\"\n describe =\n \"Generates initial TypeORM project structure. \" +\n \"If name specified then creates files inside directory called as name. \" +\n \"If its not specified then creates files inside current directory.\"\n\n builder(args: yargs.Argv) {\n return args\n .option(\"n\", {\n alias: \"name\",\n describe: \"Name of the project directory.\",\n })\n .option(\"db\", {\n alias: \"database\",\n describe: \"Database type you'll use in your project.\",\n })\n .option(\"express\", {\n describe:\n \"Indicates if express server sample code should be included in the project. False by default.\",\n })\n .option(\"docker\", {\n describe:\n \"Set to true if docker-compose must be generated as well. False by default.\",\n })\n .option(\"pm\", {\n alias: \"manager\",\n choices: [\"npm\", \"yarn\"],\n default: \"npm\",\n describe: \"Install packages, expected values are npm or yarn.\",\n })\n .option(\"ms\", {\n alias: \"module\",\n choices: [\"commonjs\", \"esm\"],\n default: \"commonjs\",\n describe:\n \"Module system to use for project, expected values are commonjs or esm.\",\n })\n }\n\n async handler(args: yargs.Arguments) {\n try {\n const database: string = (args.database as any) || \"postgres\"\n const isExpress = args.express !== undefined ? true : false\n const isDocker = args.docker !== undefined ? true : false\n const basePath = process.cwd() + (args.name ? \"/\" + args.name : \"\")\n const projectName = args.name\n ? path.basename(args.name as any)\n : undefined\n const installNpm = args.pm === \"yarn\" ? false : true\n const projectIsEsm = args.ms === \"esm\"\n await CommandUtils.createFile(\n basePath + \"/package.json\",\n InitCommand.getPackageJsonTemplate(projectName, projectIsEsm),\n false,\n )\n if (isDocker)\n await CommandUtils.createFile(\n basePath + \"/docker-compose.yml\",\n InitCommand.getDockerComposeTemplate(database),\n false,\n )\n await CommandUtils.createFile(\n basePath + \"/.gitignore\",\n InitCommand.getGitIgnoreFile(),\n )\n await CommandUtils.createFile(\n basePath + \"/README.md\",\n InitCommand.getReadmeTemplate({ docker: isDocker }),\n false,\n )\n await CommandUtils.createFile(\n basePath + \"/tsconfig.json\",\n InitCommand.getTsConfigTemplate(projectIsEsm),\n )\n await CommandUtils.createFile(\n basePath + \"/src/entity/User.ts\",\n InitCommand.getUserEntityTemplate(database),\n )\n await CommandUtils.createFile(\n basePath + \"/src/data-source.ts\",\n InitCommand.getAppDataSourceTemplate(projectIsEsm, database),\n )\n await CommandUtils.createFile(\n basePath + \"/src/index.ts\",\n InitCommand.getAppIndexTemplate(isExpress, projectIsEsm),\n )\n await CommandUtils.createDirectories(basePath + \"/src/migration\")\n\n // generate extra files for express application\n if (isExpress) {\n await CommandUtils.createFile(\n basePath + \"/src/routes.ts\",\n InitCommand.getRoutesTemplate(projectIsEsm),\n )\n await CommandUtils.createFile(\n basePath + \"/src/controller/UserController.ts\",\n InitCommand.getControllerTemplate(projectIsEsm),\n )\n }\n\n const packageJsonContents = await CommandUtils.readFile(\n basePath + \"/package.json\",\n )\n await CommandUtils.createFile(\n basePath + \"/package.json\",\n InitCommand.appendPackageJson(\n packageJsonContents,\n database,\n isExpress,\n projectIsEsm,\n ),\n )\n\n if (args.name) {\n console.log(\n chalk.green(\n `Project created inside ${chalk.blue(\n basePath,\n )} directory.`,\n ),\n )\n } else {\n console.log(\n chalk.green(`Project created inside current directory.`),\n )\n }\n\n console.log(chalk.green(`Please wait, installing dependencies...`))\n if (args.pm && installNpm) {\n await InitCommand.executeCommand(\"npm install\", basePath)\n } else {\n await InitCommand.executeCommand(\"yarn install\", basePath)\n }\n\n console.log(chalk.green(`Done! Start playing with a new project!`))\n } catch (err) {\n PlatformTools.logCmdErr(\"Error during project initialization:\", err)\n process.exit(1)\n }\n }\n\n // -------------------------------------------------------------------------\n // Protected Static Methods\n // -------------------------------------------------------------------------\n\n protected static executeCommand(command: string, cwd: string) {\n return new Promise<string>((ok, fail) => {\n exec(command, { cwd }, (error: any, stdout: any, stderr: any) => {\n if (stdout) return ok(stdout)\n if (stderr) return fail(stderr)\n if (error) return fail(error)\n ok(\"\")\n })\n })\n }\n\n /**\n * Gets contents of the ormconfig file.\n */\n protected static getAppDataSourceTemplate(\n isEsm: boolean,\n database: string,\n ): string {\n let dbSettings = \"\"\n switch (database) {\n case \"mysql\":\n dbSettings = `type: \"mysql\",\n host: \"localhost\",\n port: 3306,\n username: \"test\",\n password: \"test\",\n database: \"test\",`\n break\n case \"mariadb\":\n dbSettings = `type: \"mariadb\",\n host: \"localhost\",\n port: 3306,\n username: \"test\",\n password: \"test\",\n database: \"test\",`\n break\n case \"sqlite\":\n dbSettings = `type: \"sqlite\",\n database: \"database.sqlite\",`\n break\n case \"better-sqlite3\":\n dbSettings = `type: \"better-sqlite3\",\n database: \"database.sqlite\",`\n break\n case \"postgres\":\n dbSettings = `type: \"postgres\",\n host: \"localhost\",\n port: 5432,\n username: \"test\",\n password: \"test\",\n database: \"test\",`\n break\n case \"cockroachdb\":\n dbSettings = `type: \"cockroachdb\",\n host: \"localhost\",\n port: 26257,\n username: \"root\",\n password: \"\",\n database: \"defaultdb\",`\n break\n case \"mssql\":\n dbSettings = `type: \"mssql\",\n host: \"localhost\",\n username: \"sa\",\n password: \"Admin12345\",\n database: \"tempdb\",`\n break\n case \"oracle\":\n dbSettings = `type: \"oracle\",\nhost: \"localhost\",\nusername: \"system\",\npassword: \"oracle\",\nport: 1521,\nsid: \"xe.oracle.docker\",`\n break\n case \"mongodb\":\n dbSettings = `type: \"mongodb\",\n database: \"test\",`\n break\n case \"spanner\":\n dbSettings = `type: \"spanner\",\n projectId: \"test\",\n instanceId: \"test\",\n databaseId: \"test\",`\n break\n }\n return `import \"reflect-metadata\"\nimport { DataSource } from \"typeorm\"\nimport { User } from \"./entity/User${isEsm ? \".js\" : \"\"}\"\n\nexport const AppDataSource = new DataSource({\n ${dbSettings}\n synchronize: true,\n logging: false,\n entities: [User],\n migrations: [],\n subscribers: [],\n})\n`\n }\n\n /**\n * Gets contents of the ormconfig file.\n */\n protected static getTsConfigTemplate(esmModule: boolean): string {\n if (esmModule)\n return JSON.stringify(\n {\n compilerOptions: {\n lib: [\"es2021\"],\n target: \"es2021\",\n module: \"es2022\",\n moduleResolution: \"node\",\n allowSyntheticDefaultImports: true,\n outDir: \"./build\",\n emitDecoratorMetadata: true,\n experimentalDecorators: true,\n sourceMap: true,\n },\n },\n undefined,\n 3,\n )\n else\n return JSON.stringify(\n {\n compilerOptions: {\n lib: [\"es5\", \"es6\"],\n target: \"es5\",\n module: \"commonjs\",\n moduleResolution: \"node\",\n outDir: \"./build\",\n emitDecoratorMetadata: true,\n experimentalDecorators: true,\n sourceMap: true,\n },\n },\n undefined,\n 3,\n )\n }\n\n /**\n * Gets contents of the .gitignore file.\n */\n protected static getGitIgnoreFile(): string {\n return `.idea/\n.vscode/\nnode_modules/\nbuild/\ntmp/\ntemp/`\n }\n\n /**\n * Gets contents of the user entity.\n */\n protected static getUserEntityTemplate(database: string): string {\n return `import { Entity, ${\n database === \"mongodb\"\n ? \"ObjectIdColumn, ObjectID\"\n : \"PrimaryGeneratedColumn\"\n }, Column } from \"typeorm\"\n\n@Entity()\nexport class User {\n\n ${\n database === \"mongodb\"\n ? \"@ObjectIdColumn()\"\n : \"@PrimaryGeneratedColumn()\"\n }\n id: ${database === \"mongodb\" ? \"ObjectID\" : \"number\"}\n\n @Column()\n firstName: string\n\n @Column()\n lastName: string\n\n @Column()\n age: number\n\n}\n`\n }\n\n /**\n * Gets contents of the route file (used when express is enabled).\n */\n protected static getRoutesTemplate(isEsm: boolean): string {\n return `import { UserController } from \"./controller/UserController${\n isEsm ? \".js\" : \"\"\n }\"\n\nexport const Routes = [{\n method: \"get\",\n route: \"/users\",\n controller: UserController,\n action: \"all\"\n}, {\n method: \"get\",\n route: \"/users/:id\",\n controller: UserController,\n action: \"one\"\n}, {\n method: \"post\",\n route: \"/users\",\n controller: UserController,\n action: \"save\"\n}, {\n method: \"delete\",\n route: \"/users/:id\",\n controller: UserController,\n action: \"remove\"\n}]`\n }\n\n /**\n * Gets contents of the user controller file (used when express is enabled).\n */\n protected static getControllerTemplate(isEsm: boolean): string {\n return `import { getRepository } from \"typeorm\"\nimport { NextFunction, Request, Response } from \"express\"\nimport { User } from \"../entity/User${isEsm ? \".js\" : \"\"}\"\n\nexport class UserController {\n\n private userRepository = getRepository(User)\n\n async all(request: Request, response: Response, next: NextFunction) {\n return this.userRepository.find()\n }\n\n async one(request: Request, response: Response, next: NextFunction) {\n return this.userRepository.findOne(request.params.id)\n }\n\n async save(request: Request, response: Response, next: NextFunction) {\n return this.userRepository.save(request.body)\n }\n\n async remove(request: Request, response: Response, next: NextFunction) {\n let userToRemove = await this.userRepository.findOneBy({ id: request.params.id })\n await this.userRepository.remove(userToRemove)\n }\n\n}`\n }\n\n /**\n * Gets contents of the main (index) application file.\n */\n protected static getAppIndexTemplate(\n express: boolean,\n isEsm: boolean,\n ): string {\n if (express) {\n return `import ${!isEsm ? \"* as \" : \"\"}express from \"express\"\nimport ${!isEsm ? \"* as \" : \"\"}bodyParser from \"body-parser\"\nimport { Request, Response } from \"express\"\nimport { AppDataSource } from \"./data-source${isEsm ? \".js\" : \"\"}\"\nimport { Routes } from \"./routes${isEsm ? \".js\" : \"\"}\"\nimport { User } from \"./entity/User${isEsm ? \".js\" : \"\"}\"\n\nAppDataSource.initialize().then(async () => {\n\n // create express app\n const app = express()\n app.use(bodyParser.json())\n\n // register express routes from defined application routes\n Routes.forEach(route => {\n (app as any)[route.method](route.route, (req: Request, res: Response, next: Function) => {\n const result = (new (route.controller as any))[route.action](req, res, next)\n if (result instanceof Promise) {\n result.then(result => result !== null && result !== undefined ? res.send(result) : undefined)\n\n } else if (result !== null && result !== undefined) {\n res.json(result)\n }\n })\n })\n\n // setup express app here\n // ...\n\n // start express server\n app.listen(3000)\n\n // insert new users for test\n await AppDataSource.manager.save(\n AppDataSource.manager.create(User, {\n firstName: \"Timber\",\n lastName: \"Saw\",\n age: 27\n })\n )\n\n await AppDataSource.manager.save(\n AppDataSource.manager.create(User, {\n firstName: \"Phantom\",\n lastName: \"Assassin\",\n age: 24\n })\n )\n\n console.log(\"Express server has started on port 3000. Open http://localhost:3000/users to see results\")\n\n}).catch(error => console.log(error))\n`\n } else {\n return `import { AppDataSource } from \"./data-source${\n isEsm ? \".js\" : \"\"\n }\"\nimport { User } from \"./entity/User${isEsm ? \".js\" : \"\"}\"\n\nAppDataSource.initialize().then(async () => {\n\n console.log(\"Inserting a new user into the database...\")\n const user = new User()\n user.firstName = \"Timber\"\n user.lastName = \"Saw\"\n user.age = 25\n await AppDataSource.manager.save(user)\n console.log(\"Saved a new user with id: \" + user.id)\n\n console.log(\"Loading users from the database...\")\n const users = await AppDataSource.manager.find(User)\n console.log(\"Loaded users: \", users)\n\n console.log(\"Here you can setup and run express / fastify / any other framework.\")\n\n}).catch(error => console.log(error))\n`\n }\n }\n\n /**\n * Gets contents of the new package.json file.\n */\n protected static getPackageJsonTemplate(\n projectName?: string,\n projectIsEsm?: boolean,\n ): string {\n return JSON.stringify(\n {\n name: projectName || \"typeorm-sample\",\n version: \"0.0.1\",\n description: \"Awesome project developed with TypeORM.\",\n type: projectIsEsm ? \"module\" : \"commonjs\",\n devDependencies: {},\n dependencies: {},\n scripts: {},\n },\n undefined,\n 3,\n )\n }\n\n /**\n * Gets contents of the new docker-compose.yml file.\n */\n protected static getDockerComposeTemplate(database: string): string {\n switch (database) {\n case \"mysql\":\n return `version: '3'\nservices:\n\n mysql:\n image: \"mysql:5.7.10\"\n ports:\n - \"3306:3306\"\n environment:\n MYSQL_ROOT_PASSWORD: \"admin\"\n MYSQL_USER: \"test\"\n MYSQL_PASSWORD: \"test\"\n MYSQL_DATABASE: \"test\"\n\n`\n case \"mariadb\":\n return `version: '3'\nservices:\n\n mariadb:\n image: \"mariadb:10.1.16\"\n ports:\n - \"3306:3306\"\n environment:\n MYSQL_ROOT_PASSWORD: \"admin\"\n MYSQL_USER: \"test\"\n MYSQL_PASSWORD: \"test\"\n MYSQL_DATABASE: \"test\"\n\n`\n case \"postgres\":\n return `version: '3'\nservices:\n\n postgres:\n image: \"postgres:9.6.1\"\n ports:\n - \"5432:5432\"\n environment:\n POSTGRES_USER: \"test\"\n POSTGRES_PASSWORD: \"test\"\n POSTGRES_DB: \"test\"\n\n`\n case \"cockroachdb\":\n return `version: '3'\nservices:\n\n cockroachdb:\n image: \"cockroachdb/cockroach:v2.1.4\"\n command: start --insecure\n ports:\n - \"26257:26257\"\n\n`\n case \"sqlite\":\n case \"better-sqlite3\":\n return `version: '3'\nservices:\n`\n case \"oracle\":\n throw new TypeORMError(\n `You cannot initialize a project with docker for Oracle driver yet.`,\n ) // todo: implement for oracle as well\n\n case \"mssql\":\n return `version: '3'\nservices:\n\n mssql:\n image: \"microsoft/mssql-server-linux:rc2\"\n ports:\n - \"1433:1433\"\n environment:\n SA_PASSWORD: \"Admin12345\"\n ACCEPT_EULA: \"Y\"\n\n`\n case \"mongodb\":\n return `version: '3'\nservices:\n\n mongodb:\n image: \"mongo:4.0.6\"\n container_name: \"typeorm-mongodb\"\n ports:\n - \"27017:27017\"\n\n`\n case \"spanner\":\n return `version: '3'\nservices:\n\n spanner:\n image: gcr.io/cloud-spanner-emulator/emulator:1.4.1\n ports:\n - \"9010:9010\"\n - \"9020:9020\"\n\n`\n }\n return \"\"\n }\n\n /**\n * Gets contents of the new readme.md file.\n */\n protected static getReadmeTemplate(options: { docker: boolean }): string {\n let template = `# Awesome Project Build with TypeORM\n\nSteps to run this project:\n\n1. Run \\`npm i\\` command\n`\n\n if (options.docker) {\n template += `2. Run \\`docker-compose up\\` command\n`\n } else {\n template += `2. Setup database settings inside \\`data-source.ts\\` file\n`\n }\n\n template += `3. Run \\`npm start\\` command\n`\n return template\n }\n\n /**\n * Appends to a given package.json template everything needed.\n */\n protected static appendPackageJson(\n packageJsonContents: string,\n database: string,\n express: boolean,\n projectIsEsm: boolean /*, docker: boolean*/,\n ): string {\n const packageJson = JSON.parse(packageJsonContents)\n\n if (!packageJson.devDependencies) packageJson.devDependencies = {}\n Object.assign(packageJson.devDependencies, {\n \"ts-node\": \"10.7.0\",\n \"@types/node\": \"^16.11.10\",\n typescript: \"4.5.2\",\n })\n\n if (!packageJson.dependencies) packageJson.dependencies = {}\n Object.assign(packageJson.dependencies, {\n typeorm: require(\"../package.json\").version,\n \"reflect-metadata\": \"^0.1.13\",\n })\n\n switch (database) {\n case \"mysql\":\n case \"mariadb\":\n packageJson.dependencies[\"mysql\"] = \"^2.14.1\"\n break\n case \"postgres\":\n case \"cockroachdb\":\n packageJson.dependencies[\"pg\"] = \"^8.4.0\"\n break\n case \"sqlite\":\n packageJson.dependencies[\"sqlite3\"] = \"^5.0.2\"\n break\n case \"better-sqlite3\":\n packageJson.dependencies[\"better-sqlite3\"] = \"^7.0.0\"\n break\n case \"oracle\":\n packageJson.dependencies[\"oracledb\"] = \"^5.1.0\"\n break\n case \"mssql\":\n packageJson.dependencies[\"mssql\"] = \"^7.3.0\"\n break\n case \"mongodb\":\n packageJson.dependencies[\"mongodb\"] = \"^3.0.8\"\n break\n case \"spanner\":\n packageJson.dependencies[\"@google-cloud/spanner\"] = \"^5.18.0\"\n break\n }\n\n if (express) {\n packageJson.dependencies[\"express\"] = \"^4.17.2\"\n packageJson.dependencies[\"body-parser\"] = \"^1.19.1\"\n }\n\n if (!packageJson.scripts) packageJson.scripts = {}\n\n if (projectIsEsm)\n Object.assign(packageJson.scripts, {\n start: /*(docker ? \"docker-compose up && \" : \"\") + */ \"node --loader ts-node/esm src/index.ts\",\n typeorm: \"typeorm-ts-node-esm\",\n })\n else\n Object.assign(packageJson.scripts, {\n start: /*(docker ? \"docker-compose up && \" : \"\") + */ \"ts-node src/index.ts\",\n typeorm: \"typeorm-ts-node-commonjs\",\n })\n\n return JSON.stringify(packageJson, undefined, 3)\n }\n}\n"],"sourceRoot":".."}
|
|
@@ -18,7 +18,7 @@ export interface OracleConnectionOptions extends BaseDataSourceOptions, OracleCo
|
|
|
18
18
|
*/
|
|
19
19
|
readonly driver?: any;
|
|
20
20
|
/**
|
|
21
|
-
* A boolean determining whether to pass time values in UTC or local time. (default:
|
|
21
|
+
* A boolean determining whether to pass time values in UTC or local time. (default: false).
|
|
22
22
|
*/
|
|
23
23
|
readonly useUTC?: boolean;
|
|
24
24
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/driver/oracle/OracleConnectionOptions.ts"],"names":[],"mappings":"","file":"OracleConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { OracleConnectionCredentialsOptions } from \"./OracleConnectionCredentialsOptions\"\n\n/**\n * Oracle-specific connection options.\n */\nexport interface OracleConnectionOptions\n extends BaseDataSourceOptions,\n OracleConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"oracle\"\n\n /**\n * Schema name. By default is \"public\".\n */\n readonly schema?: string\n\n /**\n * The driver object\n * This defaults to require(\"oracledb\")\n */\n readonly driver?: any\n\n /**\n * A boolean determining whether to pass time values in UTC or local time. (default:
|
|
1
|
+
{"version":3,"sources":["../../src/driver/oracle/OracleConnectionOptions.ts"],"names":[],"mappings":"","file":"OracleConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { OracleConnectionCredentialsOptions } from \"./OracleConnectionCredentialsOptions\"\n\n/**\n * Oracle-specific connection options.\n */\nexport interface OracleConnectionOptions\n extends BaseDataSourceOptions,\n OracleConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"oracle\"\n\n /**\n * Schema name. By default is \"public\".\n */\n readonly schema?: string\n\n /**\n * The driver object\n * This defaults to require(\"oracledb\")\n */\n readonly driver?: any\n\n /**\n * A boolean determining whether to pass time values in UTC or local time. (default: false).\n */\n readonly useUTC?: boolean\n\n /**\n * Replication setup.\n */\n readonly replication?: {\n /**\n * Master server used by orm to perform writes.\n */\n readonly master: OracleConnectionCredentialsOptions\n\n /**\n * List of read-from severs (slaves).\n */\n readonly slaves: OracleConnectionCredentialsOptions[]\n }\n}\n"],"sourceRoot":"../.."}
|
|
@@ -23,7 +23,7 @@ export interface PostgresConnectionOptions extends BaseDataSourceOptions, Postgr
|
|
|
23
23
|
*/
|
|
24
24
|
readonly nativeDriver?: any;
|
|
25
25
|
/**
|
|
26
|
-
* A boolean determining whether to pass time values in UTC or local time. (default:
|
|
26
|
+
* A boolean determining whether to pass time values in UTC or local time. (default: false).
|
|
27
27
|
*/
|
|
28
28
|
readonly useUTC?: boolean;
|
|
29
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/driver/postgres/PostgresConnectionOptions.ts"],"names":[],"mappings":"","file":"PostgresConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { PostgresConnectionCredentialsOptions } from \"./PostgresConnectionCredentialsOptions\"\n\n/**\n * Postgres-specific connection options.\n */\nexport interface PostgresConnectionOptions\n extends BaseDataSourceOptions,\n PostgresConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"postgres\"\n\n /**\n * Schema name.\n */\n readonly schema?: string\n\n /**\n * The driver object\n * This defaults to `require(\"pg\")`.\n */\n readonly driver?: any\n\n /**\n * The driver object\n * This defaults to `require(\"pg-native\")`.\n */\n readonly nativeDriver?: any\n\n /**\n * A boolean determining whether to pass time values in UTC or local time. (default:
|
|
1
|
+
{"version":3,"sources":["../../src/driver/postgres/PostgresConnectionOptions.ts"],"names":[],"mappings":"","file":"PostgresConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { PostgresConnectionCredentialsOptions } from \"./PostgresConnectionCredentialsOptions\"\n\n/**\n * Postgres-specific connection options.\n */\nexport interface PostgresConnectionOptions\n extends BaseDataSourceOptions,\n PostgresConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"postgres\"\n\n /**\n * Schema name.\n */\n readonly schema?: string\n\n /**\n * The driver object\n * This defaults to `require(\"pg\")`.\n */\n readonly driver?: any\n\n /**\n * The driver object\n * This defaults to `require(\"pg-native\")`.\n */\n readonly nativeDriver?: any\n\n /**\n * A boolean determining whether to pass time values in UTC or local time. (default: false).\n */\n readonly useUTC?: boolean\n\n /**\n * Replication setup.\n */\n readonly replication?: {\n /**\n * Master server used by orm to perform writes.\n */\n readonly master: PostgresConnectionCredentialsOptions\n\n /**\n * List of read-from severs (slaves).\n */\n readonly slaves: PostgresConnectionCredentialsOptions[]\n }\n\n /**\n * The milliseconds before a timeout occurs during the initial connection to the postgres\n * server. If undefined, or set to 0, there is no timeout. Defaults to undefined.\n */\n readonly connectTimeoutMS?: number\n\n /**\n * The Postgres extension to use to generate UUID columns. Defaults to uuid-ossp.\n * If pgcrypto is selected, TypeORM will use the gen_random_uuid() function from this extension.\n * If uuid-ossp is selected, TypeORM will use the uuid_generate_v4() function from this extension.\n */\n readonly uuidExtension?: \"pgcrypto\" | \"uuid-ossp\"\n\n /*\n * Function handling errors thrown by drivers pool.\n * Defaults to logging error with `warn` level.\n */\n readonly poolErrorHandler?: (err: any) => any\n\n /**\n * Include notification messages from Postgres server in client logs\n */\n readonly logNotifications?: boolean\n\n /**\n * Automatically install postgres extensions\n */\n readonly installExtensions?: boolean\n\n /**\n * sets the application_name var to help db administrators identify\n * the service using this connection. Defaults to 'undefined'\n */\n readonly applicationName?: string\n}\n"],"sourceRoot":"../.."}
|
|
@@ -118,7 +118,7 @@ export interface SqlServerConnectionOptions extends BaseDataSourceOptions, SqlSe
|
|
|
118
118
|
*/
|
|
119
119
|
readonly packetSize?: number;
|
|
120
120
|
/**
|
|
121
|
-
* A boolean determining whether to pass time values in UTC or local time. (default:
|
|
121
|
+
* A boolean determining whether to pass time values in UTC or local time. (default: false).
|
|
122
122
|
*/
|
|
123
123
|
readonly useUTC?: boolean;
|
|
124
124
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/driver/sqlserver/SqlServerConnectionOptions.ts"],"names":[],"mappings":"","file":"SqlServerConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { SqlServerConnectionCredentialsOptions } from \"./SqlServerConnectionCredentialsOptions\"\n\n/**\n * Microsoft Sql Server specific connection options.\n */\nexport interface SqlServerConnectionOptions\n extends BaseDataSourceOptions,\n SqlServerConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"mssql\"\n\n /**\n * Connection timeout in ms (default: 15000).\n */\n readonly connectionTimeout?: number\n\n /**\n * Request timeout in ms (default: 15000). NOTE: msnodesqlv8 driver doesn't support timeouts < 1 second.\n */\n readonly requestTimeout?: number\n\n /**\n * Stream recordsets/rows instead of returning them all at once as an argument of callback (default: false).\n * You can also enable streaming for each request independently (request.stream = true).\n * Always set to true if you plan to work with large amount of rows.\n */\n readonly stream?: boolean\n\n /**\n * Database schema.\n */\n readonly schema?: string\n\n /**\n * The driver object\n * This defaults to `require(\"mssql\")`\n */\n readonly driver?: any\n\n /**\n * An optional object/dictionary with the any of the properties\n */\n readonly pool?: {\n /**\n * Maximum number of resources to create at any given time. (default=1)\n */\n readonly max?: number\n\n /**\n * Minimum number of resources to keep in pool at any given time. If this is set >= max, the pool will silently\n * set the min to equal max. (default=0)\n */\n readonly min?: number\n\n /**\n * Maximum number of queued requests allowed, additional acquire calls will be callback with an err in a future\n * cycle of the event loop.\n */\n readonly maxWaitingClients?: number\n\n /**\n * Should the pool validate resources before giving them to clients. Requires that either factory.validate or\n * factory.validateAsync to be specified\n */\n readonly testOnBorrow?: boolean\n\n /**\n * Max milliseconds an acquire call will wait for a resource before timing out. (default no limit), if supplied should non-zero positive integer.\n */\n readonly acquireTimeoutMillis?: number\n\n /**\n * If true the oldest resources will be first to be allocated. If false the most recently released resources will\n * be the first to be allocated. This in effect turns the pool's behaviour from a queue into a stack. boolean,\n * (default true)\n */\n readonly fifo?: boolean\n\n /**\n * Int between 1 and x - if set, borrowers can specify their relative priority in the queue if no resources\n * are available. see example. (default 1)\n */\n readonly priorityRange?: number\n\n /**\n * How often to run eviction checks. Default: 0 (does not run).\n */\n readonly evictionRunIntervalMillis?: number\n\n /**\n * Number of resources to check each eviction run. Default: 3.\n */\n readonly numTestsPerRun?: number\n\n /**\n * Amount of time an object may sit idle in the pool before it is eligible for eviction by the idle object\n * evictor (if any), with the extra condition that at least \"min idle\" object instances remain in the pool.\n * Default -1 (nothing can get evicted)\n */\n readonly softIdleTimeoutMillis?: number\n\n /**\n * The minimum amount of time that an object may sit idle in the pool before it is eligible for eviction due\n * to idle time. Supercedes softIdleTimeoutMillis Default: 30000\n */\n readonly idleTimeoutMillis?: number\n\n /*\n * Function handling errors thrown by drivers pool.\n * Defaults to logging error with `warn` level.\n */\n readonly errorHandler?: (err: any) => any\n }\n\n /**\n * Extra options\n */\n readonly options?: {\n /**\n * By default, if the database requestion by options.database cannot be accessed, the connection will fail with\n * an error. However, if options.fallbackToDefaultDb is set to true, then the user's default database will\n * be used instead (Default: false).\n */\n readonly fallbackToDefaultDb?: boolean\n\n /**\n * If true, SET ANSI_NULL_DFLT_ON ON will be set in the initial sql. This means new columns will be nullable by\n * default. See the T-SQL documentation for more details. (Default: true).\n */\n readonly enableAnsiNullDefault?: boolean\n\n /**\n * The number of milliseconds before the attempt to connect is considered failed (default: 15000).\n */\n readonly connectTimeout?: number\n\n /**\n * The number of milliseconds before the cancel (abort) of a request is considered failed (default: 5000).\n */\n readonly cancelTimeout?: number\n\n /**\n * The size of TDS packets (subject to negotiation with the server). Should be a power of 2. (default: 4096).\n */\n readonly packetSize?: number\n\n /**\n * A boolean determining whether to pass time values in UTC or local time. (default: true).\n */\n readonly useUTC?: boolean\n\n /**\n * A boolean determining whether to rollback a transaction automatically if any error is encountered during\n * the given transaction's execution. This sets the value for SET XACT_ABORT during the initial SQL phase\n * of a connection (documentation).\n */\n readonly abortTransactionOnError?: boolean\n\n /**\n * A string indicating which network interface (ip address) to use when connecting to SQL Server.\n */\n readonly localAddress?: string\n\n /**\n * A boolean determining whether to return rows as arrays or key-value collections. (default: false).\n */\n readonly useColumnNames?: boolean\n\n /**\n * A boolean, controlling whether the column names returned will have the first letter converted to lower case\n * (true) or not. This value is ignored if you provide a columnNameReplacer. (default: false).\n */\n readonly camelCaseColumns?: boolean\n\n /**\n * A boolean, controlling whatever to disable RETURNING / OUTPUT statements.\n */\n readonly disableOutputReturning?: boolean\n\n /**\n * Debug options\n */\n readonly debug?: {\n /**\n * A boolean, controlling whether debug events will be emitted with text describing packet details\n * (default: false).\n */\n readonly packet?: boolean\n\n /**\n * A boolean, controlling whether debug events will be emitted with text describing packet data details\n * (default: false).\n */\n readonly data?: boolean\n\n /**\n * A boolean, controlling whether debug events will be emitted with text describing packet payload details\n * (default: false).\n */\n readonly payload?: boolean\n\n /**\n * A boolean, controlling whether debug events will be emitted with text describing token stream tokens\n * (default: false).\n */\n readonly token?: boolean\n }\n\n /**\n * The default isolation level that transactions will be run with. The isolation levels are available\n * from require('tedious').ISOLATION_LEVEL. (default: READ_COMMITTED).\n */\n readonly isolation?:\n | \"READ_UNCOMMITTED\"\n | \"READ_COMMITTED\"\n | \"REPEATABLE_READ\"\n | \"SERIALIZABLE\"\n | \"SNAPSHOT\"\n\n /**\n * The default isolation level for new connections. All out-of-transaction queries are executed with this\n * setting. The isolation levels are available from require('tedious').ISOLATION_LEVEL .\n */\n readonly connectionIsolationLevel?:\n | \"READ_UNCOMMITTED\"\n | \"READ_COMMITTED\"\n | \"REPEATABLE_READ\"\n | \"SERIALIZABLE\"\n | \"SNAPSHOT\"\n\n /**\n * A boolean, determining whether the connection will request read only access from a SQL Server\n * Availability Group. For more information, see here. (default: false).\n */\n readonly readOnlyIntent?: boolean\n\n /**\n * A boolean determining whether or not the connection will be encrypted. Set to true if you're on\n * Windows Azure. (default: false).\n */\n readonly encrypt?: boolean\n\n /**\n * When encryption is used, an object may be supplied that will be used for the first argument when calling\n * tls.createSecurePair (default: {}).\n */\n readonly cryptoCredentialsDetails?: any\n\n /**\n * A boolean, that when true will expose received rows in Requests' done* events. See done, doneInProc and\n * doneProc. (default: false)\n * Caution: If many row are received, enabling this option could result in excessive memory usage.\n */\n readonly rowCollectionOnDone?: boolean\n\n /**\n * A boolean, that when true will expose received rows in Requests' completion callback. See new Request. (default: false)\n * Caution: If many row are received, enabling this option could result in excessive memory usage.\n */\n readonly rowCollectionOnRequestCompletion?: boolean\n\n /**\n * The version of TDS to use. If server doesn't support specified version, negotiated version is used instead.\n * The versions are available from require('tedious').TDS_VERSION. (default: 7_4).\n */\n readonly tdsVersion?: string\n\n /**\n * A boolean, that when true will abort a query when an overflow or divide-by-zero error occurs during query execution.\n */\n readonly enableArithAbort?: boolean\n }\n\n /**\n * Replication setup.\n */\n readonly replication?: {\n /**\n * Master server used by orm to perform writes.\n */\n readonly master: SqlServerConnectionCredentialsOptions\n\n /**\n * List of read-from severs (slaves).\n */\n readonly slaves: SqlServerConnectionCredentialsOptions[]\n }\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../../src/driver/sqlserver/SqlServerConnectionOptions.ts"],"names":[],"mappings":"","file":"SqlServerConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { SqlServerConnectionCredentialsOptions } from \"./SqlServerConnectionCredentialsOptions\"\n\n/**\n * Microsoft Sql Server specific connection options.\n */\nexport interface SqlServerConnectionOptions\n extends BaseDataSourceOptions,\n SqlServerConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"mssql\"\n\n /**\n * Connection timeout in ms (default: 15000).\n */\n readonly connectionTimeout?: number\n\n /**\n * Request timeout in ms (default: 15000). NOTE: msnodesqlv8 driver doesn't support timeouts < 1 second.\n */\n readonly requestTimeout?: number\n\n /**\n * Stream recordsets/rows instead of returning them all at once as an argument of callback (default: false).\n * You can also enable streaming for each request independently (request.stream = true).\n * Always set to true if you plan to work with large amount of rows.\n */\n readonly stream?: boolean\n\n /**\n * Database schema.\n */\n readonly schema?: string\n\n /**\n * The driver object\n * This defaults to `require(\"mssql\")`\n */\n readonly driver?: any\n\n /**\n * An optional object/dictionary with the any of the properties\n */\n readonly pool?: {\n /**\n * Maximum number of resources to create at any given time. (default=1)\n */\n readonly max?: number\n\n /**\n * Minimum number of resources to keep in pool at any given time. If this is set >= max, the pool will silently\n * set the min to equal max. (default=0)\n */\n readonly min?: number\n\n /**\n * Maximum number of queued requests allowed, additional acquire calls will be callback with an err in a future\n * cycle of the event loop.\n */\n readonly maxWaitingClients?: number\n\n /**\n * Should the pool validate resources before giving them to clients. Requires that either factory.validate or\n * factory.validateAsync to be specified\n */\n readonly testOnBorrow?: boolean\n\n /**\n * Max milliseconds an acquire call will wait for a resource before timing out. (default no limit), if supplied should non-zero positive integer.\n */\n readonly acquireTimeoutMillis?: number\n\n /**\n * If true the oldest resources will be first to be allocated. If false the most recently released resources will\n * be the first to be allocated. This in effect turns the pool's behaviour from a queue into a stack. boolean,\n * (default true)\n */\n readonly fifo?: boolean\n\n /**\n * Int between 1 and x - if set, borrowers can specify their relative priority in the queue if no resources\n * are available. see example. (default 1)\n */\n readonly priorityRange?: number\n\n /**\n * How often to run eviction checks. Default: 0 (does not run).\n */\n readonly evictionRunIntervalMillis?: number\n\n /**\n * Number of resources to check each eviction run. Default: 3.\n */\n readonly numTestsPerRun?: number\n\n /**\n * Amount of time an object may sit idle in the pool before it is eligible for eviction by the idle object\n * evictor (if any), with the extra condition that at least \"min idle\" object instances remain in the pool.\n * Default -1 (nothing can get evicted)\n */\n readonly softIdleTimeoutMillis?: number\n\n /**\n * The minimum amount of time that an object may sit idle in the pool before it is eligible for eviction due\n * to idle time. Supercedes softIdleTimeoutMillis Default: 30000\n */\n readonly idleTimeoutMillis?: number\n\n /*\n * Function handling errors thrown by drivers pool.\n * Defaults to logging error with `warn` level.\n */\n readonly errorHandler?: (err: any) => any\n }\n\n /**\n * Extra options\n */\n readonly options?: {\n /**\n * By default, if the database requestion by options.database cannot be accessed, the connection will fail with\n * an error. However, if options.fallbackToDefaultDb is set to true, then the user's default database will\n * be used instead (Default: false).\n */\n readonly fallbackToDefaultDb?: boolean\n\n /**\n * If true, SET ANSI_NULL_DFLT_ON ON will be set in the initial sql. This means new columns will be nullable by\n * default. See the T-SQL documentation for more details. (Default: true).\n */\n readonly enableAnsiNullDefault?: boolean\n\n /**\n * The number of milliseconds before the attempt to connect is considered failed (default: 15000).\n */\n readonly connectTimeout?: number\n\n /**\n * The number of milliseconds before the cancel (abort) of a request is considered failed (default: 5000).\n */\n readonly cancelTimeout?: number\n\n /**\n * The size of TDS packets (subject to negotiation with the server). Should be a power of 2. (default: 4096).\n */\n readonly packetSize?: number\n\n /**\n * A boolean determining whether to pass time values in UTC or local time. (default: false).\n */\n readonly useUTC?: boolean\n\n /**\n * A boolean determining whether to rollback a transaction automatically if any error is encountered during\n * the given transaction's execution. This sets the value for SET XACT_ABORT during the initial SQL phase\n * of a connection (documentation).\n */\n readonly abortTransactionOnError?: boolean\n\n /**\n * A string indicating which network interface (ip address) to use when connecting to SQL Server.\n */\n readonly localAddress?: string\n\n /**\n * A boolean determining whether to return rows as arrays or key-value collections. (default: false).\n */\n readonly useColumnNames?: boolean\n\n /**\n * A boolean, controlling whether the column names returned will have the first letter converted to lower case\n * (true) or not. This value is ignored if you provide a columnNameReplacer. (default: false).\n */\n readonly camelCaseColumns?: boolean\n\n /**\n * A boolean, controlling whatever to disable RETURNING / OUTPUT statements.\n */\n readonly disableOutputReturning?: boolean\n\n /**\n * Debug options\n */\n readonly debug?: {\n /**\n * A boolean, controlling whether debug events will be emitted with text describing packet details\n * (default: false).\n */\n readonly packet?: boolean\n\n /**\n * A boolean, controlling whether debug events will be emitted with text describing packet data details\n * (default: false).\n */\n readonly data?: boolean\n\n /**\n * A boolean, controlling whether debug events will be emitted with text describing packet payload details\n * (default: false).\n */\n readonly payload?: boolean\n\n /**\n * A boolean, controlling whether debug events will be emitted with text describing token stream tokens\n * (default: false).\n */\n readonly token?: boolean\n }\n\n /**\n * The default isolation level that transactions will be run with. The isolation levels are available\n * from require('tedious').ISOLATION_LEVEL. (default: READ_COMMITTED).\n */\n readonly isolation?:\n | \"READ_UNCOMMITTED\"\n | \"READ_COMMITTED\"\n | \"REPEATABLE_READ\"\n | \"SERIALIZABLE\"\n | \"SNAPSHOT\"\n\n /**\n * The default isolation level for new connections. All out-of-transaction queries are executed with this\n * setting. The isolation levels are available from require('tedious').ISOLATION_LEVEL .\n */\n readonly connectionIsolationLevel?:\n | \"READ_UNCOMMITTED\"\n | \"READ_COMMITTED\"\n | \"REPEATABLE_READ\"\n | \"SERIALIZABLE\"\n | \"SNAPSHOT\"\n\n /**\n * A boolean, determining whether the connection will request read only access from a SQL Server\n * Availability Group. For more information, see here. (default: false).\n */\n readonly readOnlyIntent?: boolean\n\n /**\n * A boolean determining whether or not the connection will be encrypted. Set to true if you're on\n * Windows Azure. (default: false).\n */\n readonly encrypt?: boolean\n\n /**\n * When encryption is used, an object may be supplied that will be used for the first argument when calling\n * tls.createSecurePair (default: {}).\n */\n readonly cryptoCredentialsDetails?: any\n\n /**\n * A boolean, that when true will expose received rows in Requests' done* events. See done, doneInProc and\n * doneProc. (default: false)\n * Caution: If many row are received, enabling this option could result in excessive memory usage.\n */\n readonly rowCollectionOnDone?: boolean\n\n /**\n * A boolean, that when true will expose received rows in Requests' completion callback. See new Request. (default: false)\n * Caution: If many row are received, enabling this option could result in excessive memory usage.\n */\n readonly rowCollectionOnRequestCompletion?: boolean\n\n /**\n * The version of TDS to use. If server doesn't support specified version, negotiated version is used instead.\n * The versions are available from require('tedious').TDS_VERSION. (default: 7_4).\n */\n readonly tdsVersion?: string\n\n /**\n * A boolean, that when true will abort a query when an overflow or divide-by-zero error occurs during query execution.\n */\n readonly enableArithAbort?: boolean\n }\n\n /**\n * Replication setup.\n */\n readonly replication?: {\n /**\n * Master server used by orm to perform writes.\n */\n readonly master: SqlServerConnectionCredentialsOptions\n\n /**\n * List of read-from severs (slaves).\n */\n readonly slaves: SqlServerConnectionCredentialsOptions[]\n }\n}\n"],"sourceRoot":"../.."}
|
|
@@ -8,7 +8,7 @@ export declare type FindOptionsOrderProperty<Property> = Property extends Promis
|
|
|
8
8
|
* Order by find options.
|
|
9
9
|
*/
|
|
10
10
|
export declare type FindOptionsOrder<Entity> = {
|
|
11
|
-
[P in keyof Entity]?: FindOptionsOrderProperty<NonNullable<Entity[P]>>;
|
|
11
|
+
[P in keyof Entity]?: P extends "toString" ? unknown : FindOptionsOrderProperty<NonNullable<Entity[P]>>;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* Value of order by in find options.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/find-options/FindOptionsOrder.ts"],"names":[],"mappings":"","file":"FindOptionsOrder.js","sourcesContent":["import { ObjectID } from \"../driver/mongodb/typings\"\n\n/**\n * A single property handler for FindOptionsOrder.\n */\nexport type FindOptionsOrderProperty<Property> = Property extends Promise<\n infer I\n>\n ? FindOptionsOrderProperty<NonNullable<I>>\n : Property extends Array<infer I>\n ? FindOptionsOrderProperty<NonNullable<I>>\n : Property extends Function\n ? never\n : Property extends Buffer\n ? FindOptionsOrderValue\n : Property extends Date\n ? FindOptionsOrderValue\n : Property extends ObjectID\n ? FindOptionsOrderValue\n : Property extends object\n ? FindOptionsOrder<Property>\n : FindOptionsOrderValue\n\n/**\n * Order by find options.\n */\nexport type FindOptionsOrder<Entity> = {\n [P in keyof Entity]?: FindOptionsOrderProperty<NonNullable<Entity[P]>>\n}\n\n/**\n * Value of order by in find options.\n */\nexport type FindOptionsOrderValue =\n | \"ASC\"\n | \"DESC\"\n | \"asc\"\n | \"desc\"\n | 1\n | -1\n | {\n direction?: \"asc\" | \"desc\" | \"ASC\" | \"DESC\"\n nulls?: \"first\" | \"last\" | \"FIRST\" | \"LAST\"\n }\n"],"sourceRoot":".."}
|
|
1
|
+
{"version":3,"sources":["../../src/find-options/FindOptionsOrder.ts"],"names":[],"mappings":"","file":"FindOptionsOrder.js","sourcesContent":["import { ObjectID } from \"../driver/mongodb/typings\"\n\n/**\n * A single property handler for FindOptionsOrder.\n */\nexport type FindOptionsOrderProperty<Property> = Property extends Promise<\n infer I\n>\n ? FindOptionsOrderProperty<NonNullable<I>>\n : Property extends Array<infer I>\n ? FindOptionsOrderProperty<NonNullable<I>>\n : Property extends Function\n ? never\n : Property extends Buffer\n ? FindOptionsOrderValue\n : Property extends Date\n ? FindOptionsOrderValue\n : Property extends ObjectID\n ? FindOptionsOrderValue\n : Property extends object\n ? FindOptionsOrder<Property>\n : FindOptionsOrderValue\n\n/**\n * Order by find options.\n */\nexport type FindOptionsOrder<Entity> = {\n [P in keyof Entity]?: P extends \"toString\"\n ? unknown\n : FindOptionsOrderProperty<NonNullable<Entity[P]>>\n}\n\n/**\n * Value of order by in find options.\n */\nexport type FindOptionsOrderValue =\n | \"ASC\"\n | \"DESC\"\n | \"asc\"\n | \"desc\"\n | 1\n | -1\n | {\n direction?: \"asc\" | \"desc\" | \"ASC\" | \"DESC\"\n nulls?: \"first\" | \"last\" | \"FIRST\" | \"LAST\"\n }\n"],"sourceRoot":".."}
|
|
@@ -8,7 +8,7 @@ export declare type FindOptionsRelationsProperty<Property> = Property extends Pr
|
|
|
8
8
|
* Relations find options.
|
|
9
9
|
*/
|
|
10
10
|
export declare type FindOptionsRelations<Entity> = {
|
|
11
|
-
[P in keyof Entity]?: FindOptionsRelationsProperty<NonNullable<Entity[P]>>;
|
|
11
|
+
[P in keyof Entity]?: P extends "toString" ? unknown : FindOptionsRelationsProperty<NonNullable<Entity[P]>>;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* Relation names to be selected by "relation" defined as string.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/find-options/FindOptionsRelations.ts"],"names":[],"mappings":"","file":"FindOptionsRelations.js","sourcesContent":["import { ObjectID } from \"../driver/mongodb/typings\"\n\n/**\n * A single property handler for FindOptionsRelations.\n */\nexport type FindOptionsRelationsProperty<Property> = Property extends Promise<\n infer I\n>\n ? FindOptionsRelationsProperty<NonNullable<I>> | boolean\n : Property extends Array<infer I>\n ? FindOptionsRelationsProperty<NonNullable<I>> | boolean\n : Property extends Function\n ? never\n : Property extends Buffer\n ? never\n : Property extends Date\n ? never\n : Property extends ObjectID\n ? never\n : Property extends object\n ? FindOptionsRelations<Property> | boolean\n : boolean\n\n/**\n * Relations find options.\n */\nexport type FindOptionsRelations<Entity> = {\n [P in keyof Entity]?: FindOptionsRelationsProperty<NonNullable<Entity[P]>>\n}\n\n/**\n * Relation names to be selected by \"relation\" defined as string.\n * Old relation mechanism in TypeORM.\n *\n * @deprecated will be removed in the next version, use FindOptionsRelation type notation instead\n */\nexport type FindOptionsRelationByString = string[]\n"],"sourceRoot":".."}
|
|
1
|
+
{"version":3,"sources":["../../src/find-options/FindOptionsRelations.ts"],"names":[],"mappings":"","file":"FindOptionsRelations.js","sourcesContent":["import { ObjectID } from \"../driver/mongodb/typings\"\n\n/**\n * A single property handler for FindOptionsRelations.\n */\nexport type FindOptionsRelationsProperty<Property> = Property extends Promise<\n infer I\n>\n ? FindOptionsRelationsProperty<NonNullable<I>> | boolean\n : Property extends Array<infer I>\n ? FindOptionsRelationsProperty<NonNullable<I>> | boolean\n : Property extends Function\n ? never\n : Property extends Buffer\n ? never\n : Property extends Date\n ? never\n : Property extends ObjectID\n ? never\n : Property extends object\n ? FindOptionsRelations<Property> | boolean\n : boolean\n\n/**\n * Relations find options.\n */\nexport type FindOptionsRelations<Entity> = {\n [P in keyof Entity]?: P extends \"toString\"\n ? unknown\n : FindOptionsRelationsProperty<NonNullable<Entity[P]>>\n}\n\n/**\n * Relation names to be selected by \"relation\" defined as string.\n * Old relation mechanism in TypeORM.\n *\n * @deprecated will be removed in the next version, use FindOptionsRelation type notation instead\n */\nexport type FindOptionsRelationByString = string[]\n"],"sourceRoot":".."}
|
|
@@ -8,7 +8,7 @@ export declare type FindOptionsSelectProperty<Property> = Property extends Promi
|
|
|
8
8
|
* Select find options.
|
|
9
9
|
*/
|
|
10
10
|
export declare type FindOptionsSelect<Entity> = {
|
|
11
|
-
[P in keyof Entity]?: FindOptionsSelectProperty<NonNullable<Entity[P]>>;
|
|
11
|
+
[P in keyof Entity]?: P extends "toString" ? unknown : FindOptionsSelectProperty<NonNullable<Entity[P]>>;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* Property paths (column names) to be selected by "find" defined as string.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/find-options/FindOptionsSelect.ts"],"names":[],"mappings":"","file":"FindOptionsSelect.js","sourcesContent":["import { ObjectID } from \"../driver/mongodb/typings\"\n\n/**\n * A single property handler for FindOptionsSelect.\n */\nexport type FindOptionsSelectProperty<Property> = Property extends Promise<\n infer I\n>\n ? FindOptionsSelectProperty<I> | boolean\n : Property extends Array<infer I>\n ? FindOptionsSelectProperty<I> | boolean\n : Property extends Function\n ? never\n : Property extends Buffer\n ? boolean\n : Property extends Date\n ? boolean\n : Property extends ObjectID\n ? boolean\n : Property extends object\n ? FindOptionsSelect<Property>\n : boolean\n\n/**\n * Select find options.\n */\nexport type FindOptionsSelect<Entity> = {\n [P in keyof Entity]?: FindOptionsSelectProperty<NonNullable<Entity[P]>>\n}\n\n/**\n * Property paths (column names) to be selected by \"find\" defined as string.\n * Old selection mechanism in TypeORM.\n *\n * @deprecated will be removed in the next version, use FindOptionsSelect type notation instead\n */\nexport type FindOptionsSelectByString<Entity> = (keyof Entity)[]\n"],"sourceRoot":".."}
|
|
1
|
+
{"version":3,"sources":["../../src/find-options/FindOptionsSelect.ts"],"names":[],"mappings":"","file":"FindOptionsSelect.js","sourcesContent":["import { ObjectID } from \"../driver/mongodb/typings\"\n\n/**\n * A single property handler for FindOptionsSelect.\n */\nexport type FindOptionsSelectProperty<Property> = Property extends Promise<\n infer I\n>\n ? FindOptionsSelectProperty<I> | boolean\n : Property extends Array<infer I>\n ? FindOptionsSelectProperty<I> | boolean\n : Property extends Function\n ? never\n : Property extends Buffer\n ? boolean\n : Property extends Date\n ? boolean\n : Property extends ObjectID\n ? boolean\n : Property extends object\n ? FindOptionsSelect<Property>\n : boolean\n\n/**\n * Select find options.\n */\nexport type FindOptionsSelect<Entity> = {\n [P in keyof Entity]?: P extends \"toString\"\n ? unknown\n : FindOptionsSelectProperty<NonNullable<Entity[P]>>\n}\n\n/**\n * Property paths (column names) to be selected by \"find\" defined as string.\n * Old selection mechanism in TypeORM.\n *\n * @deprecated will be removed in the next version, use FindOptionsSelect type notation instead\n */\nexport type FindOptionsSelectByString<Entity> = (keyof Entity)[]\n"],"sourceRoot":".."}
|
|
@@ -10,5 +10,5 @@ export declare type FindOptionsWhereProperty<Property> = Property extends Promis
|
|
|
10
10
|
* Used for find operations.
|
|
11
11
|
*/
|
|
12
12
|
export declare type FindOptionsWhere<Entity> = {
|
|
13
|
-
[P in keyof Entity]?: FindOptionsWhereProperty<NonNullable<Entity[P]>>;
|
|
13
|
+
[P in keyof Entity]?: P extends "toString" ? unknown : FindOptionsWhereProperty<NonNullable<Entity[P]>>;
|
|
14
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/find-options/FindOptionsWhere.ts"],"names":[],"mappings":"","file":"FindOptionsWhere.js","sourcesContent":["import { FindOperator } from \"./FindOperator\"\nimport { ObjectID } from \"../driver/mongodb/typings\"\nimport { EqualOperator } from \"./EqualOperator\"\n\n/**\n * A single property handler for FindOptionsWhere.\n */\nexport type FindOptionsWhereProperty<Property> = Property extends Promise<\n infer I\n>\n ? FindOptionsWhereProperty<NonNullable<I>>\n : Property extends Array<infer I>\n ? FindOptionsWhereProperty<NonNullable<I>>\n : Property extends Function\n ? never\n : Property extends Buffer\n ? Property | FindOperator<Property>\n : Property extends Date\n ? Property | FindOperator<Property>\n : Property extends ObjectID\n ? Property | FindOperator<Property>\n : Property extends object\n ?\n | FindOptionsWhere<Property>\n | FindOptionsWhere<Property>[]\n | EqualOperator<Property>\n | FindOperator<any>\n | boolean\n : Property | FindOperator<Property>\n\n/** :\n * Used for find operations.\n */\nexport type FindOptionsWhere<Entity> = {\n [P in keyof Entity]?: FindOptionsWhereProperty<NonNullable<Entity[P]>>\n}\n"],"sourceRoot":".."}
|
|
1
|
+
{"version":3,"sources":["../../src/find-options/FindOptionsWhere.ts"],"names":[],"mappings":"","file":"FindOptionsWhere.js","sourcesContent":["import { FindOperator } from \"./FindOperator\"\nimport { ObjectID } from \"../driver/mongodb/typings\"\nimport { EqualOperator } from \"./EqualOperator\"\n\n/**\n * A single property handler for FindOptionsWhere.\n */\nexport type FindOptionsWhereProperty<Property> = Property extends Promise<\n infer I\n>\n ? FindOptionsWhereProperty<NonNullable<I>>\n : Property extends Array<infer I>\n ? FindOptionsWhereProperty<NonNullable<I>>\n : Property extends Function\n ? never\n : Property extends Buffer\n ? Property | FindOperator<Property>\n : Property extends Date\n ? Property | FindOperator<Property>\n : Property extends ObjectID\n ? Property | FindOperator<Property>\n : Property extends object\n ?\n | FindOptionsWhere<Property>\n | FindOptionsWhere<Property>[]\n | EqualOperator<Property>\n | FindOperator<any>\n | boolean\n : Property | FindOperator<Property>\n\n/** :\n * Used for find operations.\n */\nexport type FindOptionsWhere<Entity> = {\n [P in keyof Entity]?: P extends \"toString\"\n ? unknown\n : FindOptionsWhereProperty<NonNullable<Entity[P]>>\n}\n"],"sourceRoot":".."}
|
package/package.json
CHANGED
|
@@ -1,274 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "typeorm",
|
|
3
|
-
"private": false,
|
|
4
|
-
"version": "0.3.7",
|
|
5
|
-
"description": "Data-Mapper ORM for TypeScript, ES7, ES6, ES5. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, MongoDB databases.",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"readmeFilename": "README.md",
|
|
8
|
-
"author": {
|
|
9
|
-
"name": "Umed Khudoiberdiev",
|
|
10
|
-
"email": "pleerock.me@gmail.com"
|
|
11
|
-
},
|
|
12
|
-
"engines": {
|
|
13
|
-
"node": ">= 12.9.0"
|
|
14
|
-
},
|
|
15
|
-
"exports": {
|
|
16
|
-
".": {
|
|
17
|
-
"types": "./index.d.ts",
|
|
18
|
-
"node": {
|
|
19
|
-
"import": "./index.mjs",
|
|
20
|
-
"require": "./index.js",
|
|
21
|
-
"types": "./index.d.ts"
|
|
22
|
-
},
|
|
23
|
-
"browser": {
|
|
24
|
-
"require": "./index.js",
|
|
25
|
-
"import": "./browser/index.js",
|
|
26
|
-
"default": "./index.js"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
"./browser": {
|
|
30
|
-
"types": "./index.d.ts",
|
|
31
|
-
"default": "./browser/index.js"
|
|
32
|
-
},
|
|
33
|
-
"./*.js": "./*.js",
|
|
34
|
-
"./*": {
|
|
35
|
-
"require": "./*.js",
|
|
36
|
-
"import": "./*"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
"main": "./index.js",
|
|
40
|
-
"module": "./index.mjs",
|
|
41
|
-
"types": "./index.d.ts",
|
|
42
|
-
"browser": {
|
|
43
|
-
"./browser/connection/ConnectionOptionsReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js",
|
|
44
|
-
"./browser/connection/options-reader/ConnectionOptionsXmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js",
|
|
45
|
-
"./browser/connection/options-reader/ConnectionOptionsYmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js",
|
|
46
|
-
"./browser/driver/aurora-data-api/AuroraDataApiDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js",
|
|
47
|
-
"./browser/driver/better-sqlite3/BetterSqlite3Driver.js": "./browser/platform/BrowserDisabledDriversDummy.js",
|
|
48
|
-
"./browser/driver/cockroachdb/CockroachDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js",
|
|
49
|
-
"./browser/driver/mongodb/MongoDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js",
|
|
50
|
-
"./browser/driver/mongodb/MongoQueryRunner.js": "./browser/platform/BrowserDisabledDriversDummy.js",
|
|
51
|
-
"./browser/driver/mysql/MysqlDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js",
|
|
52
|
-
"./browser/driver/oracle/OracleDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js",
|
|
53
|
-
"./browser/driver/postgres/PostgresDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js",
|
|
54
|
-
"./browser/driver/sap/SapDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js",
|
|
55
|
-
"./browser/driver/sqlite/SqliteDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js",
|
|
56
|
-
"./browser/driver/sqlserver/SqlServerDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js",
|
|
57
|
-
"./browser/entity-manager/MongoEntityManager.js": "./browser/platform/BrowserDisabledDriversDummy.js",
|
|
58
|
-
"./browser/logger/FileLogger.js": "./browser/platform/BrowserFileLoggerDummy.js",
|
|
59
|
-
"./browser/platform/PlatformTools.js": "./browser/platform/BrowserPlatformTools.js",
|
|
60
|
-
"./browser/repository/MongoRepository.js": "./browser/platform/BrowserDisabledDriversDummy.js",
|
|
61
|
-
"./browser/util/DirectoryExportedClassesLoader.js": "./browser/platform/BrowserDirectoryExportedClassesLoader.js",
|
|
62
|
-
"./index.js": "./browser/index.js",
|
|
63
|
-
"./index.mjs": "./browser/index.js"
|
|
64
|
-
},
|
|
65
|
-
"repository": {
|
|
66
|
-
"type": "git",
|
|
67
|
-
"url": "https://github.com/typeorm/typeorm.git"
|
|
68
|
-
},
|
|
69
|
-
"bugs": {
|
|
70
|
-
"url": "https://github.com/typeorm/typeorm/issues"
|
|
71
|
-
},
|
|
72
|
-
"homepage": "https://typeorm.io",
|
|
73
|
-
"tags": [
|
|
74
|
-
"orm",
|
|
75
|
-
"typescript",
|
|
76
|
-
"typescript-orm",
|
|
77
|
-
"mysql",
|
|
78
|
-
"mysql-orm",
|
|
79
|
-
"postgresql",
|
|
80
|
-
"postgresql-orm",
|
|
81
|
-
"mariadb",
|
|
82
|
-
"mariadb-orm",
|
|
83
|
-
"spanner",
|
|
84
|
-
"sqlite",
|
|
85
|
-
"sqlite-orm",
|
|
86
|
-
"sql-server",
|
|
87
|
-
"sql-server-orm",
|
|
88
|
-
"oracle",
|
|
89
|
-
"oracle-orm",
|
|
90
|
-
"cloud-spanner",
|
|
91
|
-
"cloud-spanner-orm"
|
|
92
|
-
],
|
|
93
|
-
"devDependencies": {
|
|
94
|
-
"@types/app-root-path": "^1.2.4",
|
|
95
|
-
"@types/chai": "^4.2.15",
|
|
96
|
-
"@types/chai-as-promised": "^7.1.3",
|
|
97
|
-
"@types/debug": "^4.1.5",
|
|
98
|
-
"@types/js-yaml": "^4.0.0",
|
|
99
|
-
"@types/mkdirp": "^1.0.1",
|
|
100
|
-
"@types/mocha": "^8.2.1",
|
|
101
|
-
"@types/node": "^14.14.31",
|
|
102
|
-
"@types/rimraf": "^3.0.0",
|
|
103
|
-
"@types/sha.js": "^2.4.0",
|
|
104
|
-
"@types/sinon": "^9.0.10",
|
|
105
|
-
"@types/source-map-support": "^0.5.3",
|
|
106
|
-
"@types/uuid": "^8.3.4",
|
|
107
|
-
"@types/xml2js": "^0.4.8",
|
|
108
|
-
"@types/yargs": "^17.0.2",
|
|
109
|
-
"better-sqlite3": "^7.1.2",
|
|
110
|
-
"chai": "^4.3.0",
|
|
111
|
-
"chai-as-promised": "^7.1.1",
|
|
112
|
-
"class-transformer": "^0.4.0",
|
|
113
|
-
"conventional-changelog-angular": "^5.0.12",
|
|
114
|
-
"conventional-changelog-cli": "^2.1.1",
|
|
115
|
-
"del": "^6.0.0",
|
|
116
|
-
"gulp": "^4.0.2",
|
|
117
|
-
"gulp-istanbul": "^1.1.3",
|
|
118
|
-
"gulp-mocha": "^8.0.0",
|
|
119
|
-
"gulp-rename": "^2.0.0",
|
|
120
|
-
"gulp-replace": "^1.0.0",
|
|
121
|
-
"gulp-shell": "^0.8.0",
|
|
122
|
-
"gulp-sourcemaps": "^3.0.0",
|
|
123
|
-
"gulp-typescript": "^6.0.0-alpha.1",
|
|
124
|
-
"gulpclass": "^0.2.0",
|
|
125
|
-
"husky": "^5.1.1",
|
|
126
|
-
"mocha": "^8.3.0",
|
|
127
|
-
"mongodb": "^3.6.4",
|
|
128
|
-
"mssql": "^7.3.0",
|
|
129
|
-
"mysql": "^2.18.1",
|
|
130
|
-
"mysql2": "^2.2.5",
|
|
131
|
-
"pg": "^8.5.1",
|
|
132
|
-
"pg-query-stream": "^4.0.0",
|
|
133
|
-
"prettier": "^2.5.1",
|
|
134
|
-
"redis": "^3.1.1",
|
|
135
|
-
"remap-istanbul": "^0.13.0",
|
|
136
|
-
"rimraf": "^3.0.2",
|
|
137
|
-
"sinon": "^9.2.4",
|
|
138
|
-
"sinon-chai": "^3.5.0",
|
|
139
|
-
"source-map-support": "^0.5.19",
|
|
140
|
-
"sql.js": "^1.4.0",
|
|
141
|
-
"sqlite3": "^5.0.3",
|
|
142
|
-
"ts-node": "^10.7.0",
|
|
143
|
-
"typeorm-aurora-data-api-driver": "^2.0.0",
|
|
144
|
-
"typescript": "^4.6.2"
|
|
145
|
-
},
|
|
146
|
-
"peerDependencies": {
|
|
147
|
-
"@google-cloud/spanner": "^5.18.0",
|
|
148
|
-
"@sap/hana-client": "^2.12.25",
|
|
149
|
-
"better-sqlite3": "^7.1.2",
|
|
150
|
-
"hdb-pool": "^0.1.6",
|
|
151
|
-
"ioredis": "^5.0.4",
|
|
152
|
-
"mongodb": "^3.6.0",
|
|
153
|
-
"mssql": "^7.3.0",
|
|
154
|
-
"mysql2": "^2.2.5",
|
|
155
|
-
"oracledb": "^5.1.0",
|
|
156
|
-
"pg": "^8.5.1",
|
|
157
|
-
"pg-native": "^3.0.0",
|
|
158
|
-
"pg-query-stream": "^4.0.0",
|
|
159
|
-
"redis": "^3.1.1 || ^4.0.0",
|
|
160
|
-
"sql.js": "^1.4.0",
|
|
161
|
-
"sqlite3": "^5.0.3",
|
|
162
|
-
"ts-node": "^10.7.0",
|
|
163
|
-
"typeorm-aurora-data-api-driver": "^2.0.0"
|
|
164
|
-
},
|
|
165
|
-
"peerDependenciesMeta": {
|
|
166
|
-
"@google-cloud/spanner": {
|
|
167
|
-
"optional": true
|
|
168
|
-
},
|
|
169
|
-
"@sap/hana-client": {
|
|
170
|
-
"optional": true
|
|
171
|
-
},
|
|
172
|
-
"better-sqlite3": {
|
|
173
|
-
"optional": true
|
|
174
|
-
},
|
|
175
|
-
"hdb-pool": {
|
|
176
|
-
"optional": true
|
|
177
|
-
},
|
|
178
|
-
"ioredis": {
|
|
179
|
-
"optional": true
|
|
180
|
-
},
|
|
181
|
-
"mongodb": {
|
|
182
|
-
"optional": true
|
|
183
|
-
},
|
|
184
|
-
"mssql": {
|
|
185
|
-
"optional": true
|
|
186
|
-
},
|
|
187
|
-
"mysql2": {
|
|
188
|
-
"optional": true
|
|
189
|
-
},
|
|
190
|
-
"oracledb": {
|
|
191
|
-
"optional": true
|
|
192
|
-
},
|
|
193
|
-
"pg": {
|
|
194
|
-
"optional": true
|
|
195
|
-
},
|
|
196
|
-
"pg-native": {
|
|
197
|
-
"optional": true
|
|
198
|
-
},
|
|
199
|
-
"pg-query-stream": {
|
|
200
|
-
"optional": true
|
|
201
|
-
},
|
|
202
|
-
"redis": {
|
|
203
|
-
"optional": true
|
|
204
|
-
},
|
|
205
|
-
"sql.js": {
|
|
206
|
-
"optional": true
|
|
207
|
-
},
|
|
208
|
-
"sqlite3": {
|
|
209
|
-
"optional": true
|
|
210
|
-
},
|
|
211
|
-
"ts-node": {
|
|
212
|
-
"optional": true
|
|
213
|
-
},
|
|
214
|
-
"typeorm-aurora-data-api-driver": {
|
|
215
|
-
"optional": true
|
|
216
|
-
}
|
|
217
|
-
},
|
|
218
|
-
"dependencies": {
|
|
219
|
-
"@sqltools/formatter": "^1.2.2",
|
|
220
|
-
"app-root-path": "^3.0.0",
|
|
221
|
-
"buffer": "^6.0.3",
|
|
222
|
-
"chalk": "^4.1.0",
|
|
223
|
-
"cli-highlight": "^2.1.11",
|
|
224
|
-
"date-fns": "^2.28.0",
|
|
225
|
-
"debug": "^4.3.3",
|
|
226
|
-
"dotenv": "^16.0.0",
|
|
227
|
-
"glob": "^7.2.0",
|
|
228
|
-
"js-yaml": "^4.1.0",
|
|
229
|
-
"mkdirp": "^1.0.4",
|
|
230
|
-
"reflect-metadata": "^0.1.13",
|
|
231
|
-
"sha.js": "^2.4.11",
|
|
232
|
-
"tslib": "^2.3.1",
|
|
233
|
-
"uuid": "^8.3.2",
|
|
234
|
-
"xml2js": "^0.4.23",
|
|
235
|
-
"yargs": "^17.3.1"
|
|
236
|
-
},
|
|
237
|
-
"scripts": {
|
|
238
|
-
"test": "rimraf ./build && tsc && mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 60000 ./build/compiled/test",
|
|
239
|
-
"test-fast": "mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 60000 ./build/compiled/test",
|
|
240
|
-
"compile": "rimraf ./build && tsc",
|
|
241
|
-
"watch": "./node_modules/.bin/tsc -w",
|
|
242
|
-
"package": "gulp package",
|
|
243
|
-
"pack": "gulp pack",
|
|
244
|
-
"lint": "prettier --check \"./src/**/*.ts\" \"./test/**/*.ts\" \"./sample/**/*.ts\"",
|
|
245
|
-
"format": "prettier --write \"./src/**/*.ts\" \"./test/**/*.ts\" \"./sample/**/*.ts\"",
|
|
246
|
-
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 2"
|
|
247
|
-
},
|
|
248
|
-
"bin": {
|
|
249
|
-
"typeorm": "./cli.js",
|
|
250
|
-
"typeorm-ts-node-commonjs": "./cli-ts-node-commonjs.js",
|
|
251
|
-
"typeorm-ts-node-esm": "./cli-ts-node-esm.js"
|
|
252
|
-
},
|
|
253
|
-
"funding": "https://opencollective.com/typeorm",
|
|
254
|
-
"collective": {
|
|
255
|
-
"type": "opencollective",
|
|
256
|
-
"url": "https://opencollective.com/typeorm",
|
|
257
|
-
"logo": "https://opencollective.com/opencollective/logo.txt"
|
|
258
|
-
},
|
|
259
|
-
"nyc": {
|
|
260
|
-
"all": true,
|
|
261
|
-
"cache": false,
|
|
262
|
-
"exclude": [
|
|
263
|
-
"**/*.d.ts"
|
|
264
|
-
],
|
|
265
|
-
"extension": [
|
|
266
|
-
".ts"
|
|
267
|
-
],
|
|
268
|
-
"include": [
|
|
269
|
-
"build/compiled/src/**",
|
|
270
|
-
"src/**"
|
|
271
|
-
],
|
|
272
|
-
"reporter": "json"
|
|
273
|
-
}
|
|
274
|
-
}
|
|
1
|
+
{ "name": "typeorm", "private": false, "version": "0.3.8-dev.15f90e0", "description": "Data-Mapper ORM for TypeScript, ES7, ES6, ES5. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, MongoDB databases.", "license": "MIT", "readmeFilename": "README.md", "author": { "name": "Umed Khudoiberdiev", "email": "pleerock.me@gmail.com" }, "engines": { "node": ">= 12.9.0" }, "exports": { ".": { "types": "./index.d.ts", "node": { "import": "./index.mjs", "require": "./index.js", "types": "./index.d.ts" }, "browser": { "require": "./index.js", "import": "./browser/index.js", "default": "./index.js" } }, "./browser": { "types": "./index.d.ts", "default": "./browser/index.js" }, "./*.js": "./*.js", "./*": { "require": "./*.js", "import": "./*" } }, "main": "./index.js", "module": "./index.mjs", "types": "./index.d.ts", "browser": { "./browser/connection/ConnectionOptionsReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/connection/options-reader/ConnectionOptionsXmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/connection/options-reader/ConnectionOptionsYmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/driver/aurora-data-api/AuroraDataApiDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/better-sqlite3/BetterSqlite3Driver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/cockroachdb/CockroachDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/MongoDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/MongoQueryRunner.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mysql/MysqlDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/oracle/OracleDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/postgres/PostgresDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sap/SapDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sqlite/SqliteDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sqlserver/SqlServerDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/entity-manager/MongoEntityManager.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/logger/FileLogger.js": "./browser/platform/BrowserFileLoggerDummy.js", "./browser/platform/PlatformTools.js": "./browser/platform/BrowserPlatformTools.js", "./browser/repository/MongoRepository.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/util/DirectoryExportedClassesLoader.js": "./browser/platform/BrowserDirectoryExportedClassesLoader.js", "./index.js": "./browser/index.js", "./index.mjs": "./browser/index.js" }, "repository": { "type": "git", "url": "https://github.com/typeorm/typeorm.git" }, "bugs": { "url": "https://github.com/typeorm/typeorm/issues" }, "homepage": "https://typeorm.io", "tags": [ "orm", "typescript", "typescript-orm", "mysql", "mysql-orm", "postgresql", "postgresql-orm", "mariadb", "mariadb-orm", "spanner", "sqlite", "sqlite-orm", "sql-server", "sql-server-orm", "oracle", "oracle-orm", "cloud-spanner", "cloud-spanner-orm" ], "devDependencies": { "@types/app-root-path": "^1.2.4", "@types/chai": "^4.2.15", "@types/chai-as-promised": "^7.1.3", "@types/debug": "^4.1.5", "@types/js-yaml": "^4.0.0", "@types/mkdirp": "^1.0.1", "@types/mocha": "^8.2.1", "@types/node": "^14.14.31", "@types/rimraf": "^3.0.0", "@types/sha.js": "^2.4.0", "@types/sinon": "^9.0.10", "@types/source-map-support": "^0.5.3", "@types/uuid": "^8.3.4", "@types/xml2js": "^0.4.8", "@types/yargs": "^17.0.2", "better-sqlite3": "^7.1.2", "chai": "^4.3.0", "chai-as-promised": "^7.1.1", "class-transformer": "^0.4.0", "conventional-changelog-angular": "^5.0.12", "conventional-changelog-cli": "^2.1.1", "del": "^6.0.0", "gulp": "^4.0.2", "gulp-istanbul": "^1.1.3", "gulp-mocha": "^8.0.0", "gulp-rename": "^2.0.0", "gulp-replace": "^1.0.0", "gulp-shell": "^0.8.0", "gulp-sourcemaps": "^3.0.0", "gulp-typescript": "^6.0.0-alpha.1", "gulpclass": "^0.2.0", "husky": "^5.1.1", "mocha": "^8.3.0", "mongodb": "^3.6.4", "mssql": "^7.3.0", "mysql": "^2.18.1", "mysql2": "^2.2.5", "pg": "^8.5.1", "pg-query-stream": "^4.0.0", "prettier": "^2.5.1", "redis": "^3.1.1", "remap-istanbul": "^0.13.0", "rimraf": "^3.0.2", "sinon": "^9.2.4", "sinon-chai": "^3.5.0", "source-map-support": "^0.5.19", "sql.js": "^1.4.0", "sqlite3": "^5.0.3", "ts-node": "^10.7.0", "typeorm-aurora-data-api-driver": "^2.0.0", "typescript": "^4.6.2" }, "peerDependencies": { "@google-cloud/spanner": "^5.18.0", "@sap/hana-client": "^2.12.25", "better-sqlite3": "^7.1.2", "hdb-pool": "^0.1.6", "ioredis": "^5.0.4", "mongodb": "^3.6.0", "mssql": "^7.3.0", "mysql2": "^2.2.5", "oracledb": "^5.1.0", "pg": "^8.5.1", "pg-native": "^3.0.0", "pg-query-stream": "^4.0.0", "redis": "^3.1.1 || ^4.0.0", "sql.js": "^1.4.0", "sqlite3": "^5.0.3", "ts-node": "^10.7.0", "typeorm-aurora-data-api-driver": "^2.0.0" }, "peerDependenciesMeta": { "@google-cloud/spanner": { "optional": true }, "@sap/hana-client": { "optional": true }, "better-sqlite3": { "optional": true }, "hdb-pool": { "optional": true }, "ioredis": { "optional": true }, "mongodb": { "optional": true }, "mssql": { "optional": true }, "mysql2": { "optional": true }, "oracledb": { "optional": true }, "pg": { "optional": true }, "pg-native": { "optional": true }, "pg-query-stream": { "optional": true }, "redis": { "optional": true }, "sql.js": { "optional": true }, "sqlite3": { "optional": true }, "ts-node": { "optional": true }, "typeorm-aurora-data-api-driver": { "optional": true } }, "dependencies": { "@sqltools/formatter": "^1.2.2", "app-root-path": "^3.0.0", "buffer": "^6.0.3", "chalk": "^4.1.0", "cli-highlight": "^2.1.11", "date-fns": "^2.28.0", "debug": "^4.3.3", "dotenv": "^16.0.0", "glob": "^7.2.0", "js-yaml": "^4.1.0", "mkdirp": "^1.0.4", "reflect-metadata": "^0.1.13", "sha.js": "^2.4.11", "tslib": "^2.3.1", "uuid": "^8.3.2", "xml2js": "^0.4.23", "yargs": "^17.3.1" }, "scripts": { "test": "rimraf ./build && tsc && mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 60000 ./build/compiled/test", "test-fast": "mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 60000 ./build/compiled/test", "compile": "rimraf ./build && tsc", "watch": "./node_modules/.bin/tsc -w", "package": "gulp package", "pack": "gulp pack", "lint": "prettier --check \"./src/**/*.ts\" \"./test/**/*.ts\" \"./sample/**/*.ts\"", "format": "prettier --write \"./src/**/*.ts\" \"./test/**/*.ts\" \"./sample/**/*.ts\"", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 2" }, "bin": { "typeorm": "./cli.js", "typeorm-ts-node-commonjs": "./cli-ts-node-commonjs.js", "typeorm-ts-node-esm": "./cli-ts-node-esm.js" }, "funding": "https://opencollective.com/typeorm", "collective": { "type": "opencollective", "url": "https://opencollective.com/typeorm", "logo": "https://opencollective.com/opencollective/logo.txt" }, "nyc": { "all": true, "cache": false, "exclude": [ "**/*.d.ts" ], "extension": [ ".ts" ], "include": [ "build/compiled/src/**", "src/**" ], "reporter": "json" } }
|