typeorm 0.2.42-dev.a855b90 → 0.2.42-dev.d10484e
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/README.md +38 -0
- package/browser/common/RelationType.d.ts +14 -0
- package/browser/common/RelationType.js +3 -0
- package/browser/common/RelationType.js.map +1 -0
- package/browser/connection/Connection.d.ts +1 -1
- package/browser/connection/Connection.js +45 -30
- package/browser/connection/Connection.js.map +1 -1
- package/browser/connection/ConnectionMetadataBuilder.d.ts +3 -3
- package/browser/connection/ConnectionMetadataBuilder.js +54 -22
- package/browser/connection/ConnectionMetadataBuilder.js.map +1 -1
- package/browser/connection/ConnectionOptionsReader.js +33 -28
- package/browser/connection/ConnectionOptionsReader.js.map +1 -1
- package/browser/find-options/operator/Like.d.ts +1 -1
- package/browser/find-options/operator/Like.js +1 -1
- package/browser/find-options/operator/Like.js.map +1 -1
- package/browser/globals.js +34 -7
- package/browser/globals.js.map +1 -1
- package/browser/index.d.ts +1 -0
- package/browser/index.js +1 -0
- package/browser/index.js.map +1 -1
- package/browser/migration/MigrationExecutor.js +1 -1
- package/browser/migration/MigrationExecutor.js.map +1 -1
- package/browser/util/DirectoryExportedClassesLoader.d.ts +1 -1
- package/browser/util/DirectoryExportedClassesLoader.js +55 -31
- package/browser/util/DirectoryExportedClassesLoader.js.map +1 -1
- package/browser/util/ImportUtils.d.ts +1 -0
- package/browser/util/ImportUtils.js +90 -0
- package/browser/util/ImportUtils.js.map +1 -0
- package/commands/InitCommand.d.ts +9 -7
- package/commands/InitCommand.js +72 -43
- package/commands/InitCommand.js.map +1 -1
- package/common/RelationType.d.ts +14 -0
- package/common/RelationType.js +4 -0
- package/common/RelationType.js.map +1 -0
- package/connection/Connection.d.ts +1 -1
- package/connection/Connection.js +45 -30
- package/connection/Connection.js.map +1 -1
- package/connection/ConnectionMetadataBuilder.d.ts +3 -3
- package/connection/ConnectionMetadataBuilder.js +53 -21
- package/connection/ConnectionMetadataBuilder.js.map +1 -1
- package/connection/ConnectionOptionsReader.js +32 -27
- package/connection/ConnectionOptionsReader.js.map +1 -1
- package/find-options/operator/Like.d.ts +1 -1
- package/find-options/operator/Like.js +1 -1
- package/find-options/operator/Like.js.map +1 -1
- package/globals.js +33 -6
- package/globals.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/index.mjs +352 -0
- package/migration/MigrationExecutor.js +1 -1
- package/migration/MigrationExecutor.js.map +1 -1
- package/package.json +1 -1
- package/util/DirectoryExportedClassesLoader.d.ts +1 -1
- package/util/DirectoryExportedClassesLoader.js +54 -31
- package/util/DirectoryExportedClassesLoader.js.map +1 -1
- package/util/ImportUtils.d.ts +1 -0
- package/util/ImportUtils.js +94 -0
- package/util/ImportUtils.js.map +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __awaiter, __generator } from "tslib";
|
|
1
|
+
import { __awaiter, __generator, __read } from "tslib";
|
|
2
2
|
import appRootPath from "app-root-path";
|
|
3
3
|
import path from "path";
|
|
4
4
|
import { PlatformTools } from "../platform/PlatformTools";
|
|
@@ -6,6 +6,7 @@ import { ConnectionOptionsEnvReader } from "./options-reader/ConnectionOptionsEn
|
|
|
6
6
|
import { ConnectionOptionsYmlReader } from "./options-reader/ConnectionOptionsYmlReader";
|
|
7
7
|
import { ConnectionOptionsXmlReader } from "./options-reader/ConnectionOptionsXmlReader";
|
|
8
8
|
import { TypeORMError } from "../error";
|
|
9
|
+
import { importOrRequireFile } from "../util/ImportUtils";
|
|
9
10
|
/**
|
|
10
11
|
* Reads connection options from the ormconfig.
|
|
11
12
|
* Can read from multiple file extensions including env, json, js, xml and yml.
|
|
@@ -87,13 +88,13 @@ var ConnectionOptionsReader = /** @class */ (function () {
|
|
|
87
88
|
*/
|
|
88
89
|
ConnectionOptionsReader.prototype.load = function () {
|
|
89
90
|
return __awaiter(this, void 0, void 0, function () {
|
|
90
|
-
var connectionOptions, fileFormats, possibleExtension, fileExtension, foundFileFormat, configFile, configModule;
|
|
91
|
+
var connectionOptions, fileFormats, possibleExtension, fileExtension, foundFileFormat, configFile, _a, importOrRequireResult, moduleSystem, configModule;
|
|
91
92
|
var _this = this;
|
|
92
|
-
return __generator(this, function (
|
|
93
|
-
switch (
|
|
93
|
+
return __generator(this, function (_b) {
|
|
94
|
+
switch (_b.label) {
|
|
94
95
|
case 0:
|
|
95
96
|
connectionOptions = undefined;
|
|
96
|
-
fileFormats = ["env", "js", "cjs", "ts", "json", "yml", "yaml", "xml"];
|
|
97
|
+
fileFormats = ["env", "js", "mjs", "cjs", "ts", "mts", "cts", "json", "yml", "yaml", "xml"];
|
|
97
98
|
possibleExtension = this.baseFilePath.substr(this.baseFilePath.lastIndexOf("."));
|
|
98
99
|
fileExtension = fileFormats.find(function (extension) { return "." + extension === possibleExtension; });
|
|
99
100
|
foundFileFormat = fileExtension || fileFormats.find(function (format) {
|
|
@@ -110,43 +111,47 @@ var ConnectionOptionsReader = /** @class */ (function () {
|
|
|
110
111
|
if (!(PlatformTools.getEnvVariable("TYPEORM_CONNECTION") || PlatformTools.getEnvVariable("TYPEORM_URL"))) return [3 /*break*/, 2];
|
|
111
112
|
return [4 /*yield*/, new ConnectionOptionsEnvReader().read()];
|
|
112
113
|
case 1:
|
|
113
|
-
connectionOptions =
|
|
114
|
-
return [3 /*break*/,
|
|
114
|
+
connectionOptions = _b.sent();
|
|
115
|
+
return [3 /*break*/, 12];
|
|
115
116
|
case 2:
|
|
116
|
-
if (!(foundFileFormat === "js" || foundFileFormat === "
|
|
117
|
-
|
|
117
|
+
if (!(foundFileFormat === "js" || foundFileFormat === "mjs" || foundFileFormat === "cjs" ||
|
|
118
|
+
foundFileFormat === "ts" || foundFileFormat === "mts" || foundFileFormat === "cts")) return [3 /*break*/, 5];
|
|
119
|
+
return [4 /*yield*/, importOrRequireFile(configFile)];
|
|
118
120
|
case 3:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
+
_a = __read.apply(void 0, [_b.sent(), 2]), importOrRequireResult = _a[0], moduleSystem = _a[1];
|
|
122
|
+
return [4 /*yield*/, importOrRequireResult];
|
|
123
|
+
case 4:
|
|
124
|
+
configModule = _b.sent();
|
|
125
|
+
if (moduleSystem === "esm" || (configModule && "__esModule" in configModule && "default" in configModule)) {
|
|
121
126
|
connectionOptions = configModule.default;
|
|
122
127
|
}
|
|
123
128
|
else {
|
|
124
129
|
connectionOptions = configModule;
|
|
125
130
|
}
|
|
126
|
-
return [3 /*break*/,
|
|
127
|
-
case 4:
|
|
128
|
-
if (!(foundFileFormat === "json")) return [3 /*break*/, 5];
|
|
129
|
-
connectionOptions = require(configFile);
|
|
130
|
-
return [3 /*break*/, 11];
|
|
131
|
+
return [3 /*break*/, 12];
|
|
131
132
|
case 5:
|
|
132
|
-
if (!(foundFileFormat === "
|
|
133
|
-
|
|
133
|
+
if (!(foundFileFormat === "json")) return [3 /*break*/, 6];
|
|
134
|
+
connectionOptions = require(configFile);
|
|
135
|
+
return [3 /*break*/, 12];
|
|
134
136
|
case 6:
|
|
135
|
-
|
|
136
|
-
return [3 /*break*/, 11];
|
|
137
|
-
case 7:
|
|
138
|
-
if (!(foundFileFormat === "yaml")) return [3 /*break*/, 9];
|
|
137
|
+
if (!(foundFileFormat === "yml")) return [3 /*break*/, 8];
|
|
139
138
|
return [4 /*yield*/, new ConnectionOptionsYmlReader().read(configFile)];
|
|
139
|
+
case 7:
|
|
140
|
+
connectionOptions = _b.sent();
|
|
141
|
+
return [3 /*break*/, 12];
|
|
140
142
|
case 8:
|
|
141
|
-
|
|
142
|
-
return [
|
|
143
|
+
if (!(foundFileFormat === "yaml")) return [3 /*break*/, 10];
|
|
144
|
+
return [4 /*yield*/, new ConnectionOptionsYmlReader().read(configFile)];
|
|
143
145
|
case 9:
|
|
144
|
-
|
|
145
|
-
return [
|
|
146
|
+
connectionOptions = _b.sent();
|
|
147
|
+
return [3 /*break*/, 12];
|
|
146
148
|
case 10:
|
|
147
|
-
|
|
148
|
-
|
|
149
|
+
if (!(foundFileFormat === "xml")) return [3 /*break*/, 12];
|
|
150
|
+
return [4 /*yield*/, new ConnectionOptionsXmlReader().read(configFile)];
|
|
149
151
|
case 11:
|
|
152
|
+
connectionOptions = _b.sent();
|
|
153
|
+
_b.label = 12;
|
|
154
|
+
case 12:
|
|
150
155
|
// normalize and return connection options
|
|
151
156
|
if (connectionOptions) {
|
|
152
157
|
return [2 /*return*/, this.normalizeConnectionOptions(connectionOptions)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/connection/ConnectionOptionsReader.ts"],"names":[],"mappings":";AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAC,0BAA0B,EAAC,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAC,0BAA0B,EAAC,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAC,0BAA0B,EAAC,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC;;;GAGG;AACH;IAEI,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,iCAAsB,OAWrB;QAXqB,YAAO,GAAP,OAAO,CAW5B;IACD,CAAC;IAED,4EAA4E;IAC5E,iBAAiB;IACjB,4EAA4E;IAE5E;;OAEG;IACG,qCAAG,GAAT;;;;;4BACoB,qBAAM,IAAI,CAAC,IAAI,EAAE,EAAA;;wBAA3B,OAAO,GAAG,SAAiB;wBACjC,IAAI,CAAC,OAAO;4BACR,MAAM,IAAI,YAAY,CAAC,kEAAkE,CAAC,CAAC;wBAE/F,sBAAO,OAAO,EAAC;;;;KAClB;IAED;;;OAGG;IACG,qCAAG,GAAT,UAAU,IAAY;;;;;4BACC,qBAAM,IAAI,CAAC,GAAG,EAAE,EAAA;;wBAA7B,UAAU,GAAG,SAAgB;wBAC7B,a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AK,KAAK,IAAI,mBAAmB;oBAC9D,OAAO,CAAC,QAAQ,KAAK,UAAU,EAAE;oBACjC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;wBACnB,QAAQ,EAAE,KAAI,CAAC,aAAa,GAAG,GAAG,GAAG,OAAO,CAAC,QAAQ;qBACxD,CAAC,CAAC;iBACN;aACJ;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,iBAAiB,CAAC;IAC7B,CAAC;IAKD,sBAAc,iDAAY;QAH1B;;WAEG;aACH;YACI,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QACjE,CAAC;;;OAAA;IAKD,sBAAc,kDAAa;QAH3B;;WAEG;aACH;YACI,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI;gBACjC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YAE7B,OAAO,WAAW,CAAC,IAAI,CAAC;QAC5B,CAAC;;;OAAA;IAKD,sBAAc,mDAAc;QAH5B;;WAEG;aACH;YACI,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU;gBACvC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;YAEnC,OAAO,WAAW,CAAC;QACvB,CAAC;;;OAAA;IAEL,8BAAC;AAAD,CA9MA,AA8MC,IAAA","file":"ConnectionOptionsReader.js","sourcesContent":["import appRootPath from \"app-root-path\";\nimport path from \"path\";\nimport {ConnectionOptions} from \"./ConnectionOptions\";\nimport {PlatformTools} from \"../platform/PlatformTools\";\nimport {ConnectionOptionsEnvReader} from \"./options-reader/ConnectionOptionsEnvReader\";\nimport {ConnectionOptionsYmlReader} from \"./options-reader/ConnectionOptionsYmlReader\";\nimport {ConnectionOptionsXmlReader} from \"./options-reader/ConnectionOptionsXmlReader\";\nimport { TypeORMError } from \"../error\";\n\n/**\n * Reads connection options from the ormconfig.\n * Can read from multiple file extensions including env, json, js, xml and yml.\n */\nexport class ConnectionOptionsReader {\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(protected options?: {\n /**\n * Directory where ormconfig should be read from.\n * By default its your application root (where your app package.json is located).\n */\n root?: string,\n\n /**\n * Filename of the ormconfig configuration. By default its equal to \"ormconfig\".\n */\n configName?: string\n }) {\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Returns all connection options read from the ormconfig.\n */\n async all(): Promise<ConnectionOptions[]> {\n const options = await this.load();\n if (!options)\n throw new TypeORMError(`No connection options were found in any orm configuration files.`);\n\n return options;\n }\n\n /**\n * Gets a connection with a given name read from ormconfig.\n * If connection with such name would not be found then it throw error.\n */\n async get(name: string): Promise<ConnectionOptions> {\n const allOptions = await this.all();\n const targetOptions = allOptions.find(options => options.name === name || (name === \"default\" && !options.name));\n if (!targetOptions)\n throw new TypeORMError(`Cannot find connection ${name} because its not defined in any orm configuration files.`);\n\n return targetOptions;\n }\n\n /**\n * Checks if there is a TypeORM configuration file.\n */\n async has(name: string): Promise<boolean> {\n const allOptions = await this.load();\n if (!allOptions)\n return false;\n\n const targetOptions = allOptions.find(options => options.name === name || (name === \"default\" && !options.name));\n return !!targetOptions;\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Loads all connection options from a configuration file.\n *\n * todo: get in count NODE_ENV somehow\n */\n protected async load(): Promise<ConnectionOptions[]|undefined> {\n let connectionOptions: ConnectionOptions|ConnectionOptions[]|undefined = undefined;\n\n const fileFormats = [\"env\", \"js\", \"cjs\", \"ts\", \"json\", \"yml\", \"yaml\", \"xml\"];\n\n // Detect if baseFilePath contains file extension\n const possibleExtension = this.baseFilePath.substr(this.baseFilePath.lastIndexOf(\".\"));\n const fileExtension = fileFormats.find(extension => `.${extension}` === possibleExtension);\n\n // try to find any of following configuration formats\n const foundFileFormat = fileExtension || fileFormats.find(format => {\n return PlatformTools.fileExist(this.baseFilePath + \".\" + format);\n });\n\n // Determine config file name\n const configFile = fileExtension ? this.baseFilePath : this.baseFilePath + \".\" + foundFileFormat;\n\n // if .env file found then load all its variables into process.env using dotenv package\n if (foundFileFormat === \"env\") {\n PlatformTools.dotenv(configFile);\n } else if (PlatformTools.fileExist(this.baseDirectory + \"/.env\")) {\n PlatformTools.dotenv(this.baseDirectory + \"/.env\");\n }\n\n // try to find connection options from any of available sources of configuration\n if (PlatformTools.getEnvVariable(\"TYPEORM_CONNECTION\") || PlatformTools.getEnvVariable(\"TYPEORM_URL\")) {\n connectionOptions = await new ConnectionOptionsEnvReader().read();\n\n } else if (foundFileFormat === \"js\" || foundFileFormat === \"cjs\" || foundFileFormat === \"ts\") {\n const configModule = await require(configFile);\n\n if (configModule && \"__esModule\" in configModule && \"default\" in configModule) {\n connectionOptions = configModule.default;\n } else {\n connectionOptions = configModule;\n }\n\n } else if (foundFileFormat === \"json\") {\n connectionOptions = require(configFile);\n\n } else if (foundFileFormat === \"yml\") {\n connectionOptions = await new ConnectionOptionsYmlReader().read(configFile);\n\n } else if (foundFileFormat === \"yaml\") {\n connectionOptions = await new ConnectionOptionsYmlReader().read(configFile);\n\n } else if (foundFileFormat === \"xml\") {\n connectionOptions = await new ConnectionOptionsXmlReader().read(configFile);\n }\n\n // normalize and return connection options\n if (connectionOptions) {\n return this.normalizeConnectionOptions(connectionOptions);\n }\n\n return undefined;\n }\n\n /**\n * Normalize connection options.\n */\n protected normalizeConnectionOptions(connectionOptions: ConnectionOptions|ConnectionOptions[]): ConnectionOptions[] {\n if (!(Array.isArray(connectionOptions)))\n connectionOptions = [connectionOptions];\n\n connectionOptions.forEach(options => {\n if (options.entities) {\n const entities = (options.entities as any[]).map(entity => {\n if (typeof entity === \"string\" && entity.substr(0, 1) !== \"/\")\n return this.baseDirectory + \"/\" + entity;\n\n return entity;\n });\n Object.assign(connectionOptions, { entities: entities });\n }\n if (options.subscribers) {\n const subscribers = (options.subscribers as any[]).map(subscriber => {\n if (typeof subscriber === \"string\" && subscriber.substr(0, 1) !== \"/\")\n return this.baseDirectory + \"/\" + subscriber;\n\n return subscriber;\n });\n Object.assign(connectionOptions, { subscribers: subscribers });\n }\n if (options.migrations) {\n const migrations = (options.migrations as any[]).map(migration => {\n if (typeof migration === \"string\" && migration.substr(0, 1) !== \"/\")\n return this.baseDirectory + \"/\" + migration;\n\n return migration;\n });\n Object.assign(connectionOptions, { migrations: migrations });\n }\n\n // make database path file in sqlite relative to package.json\n if (options.type === \"sqlite\" || options.type === \"better-sqlite3\") {\n if (typeof options.database === \"string\" &&\n options.database.substr(0, 1) !== \"/\" && // unix absolute\n options.database.substr(1, 2) !== \":\\\\\" && // windows absolute\n options.database !== \":memory:\") {\n Object.assign(options, {\n database: this.baseDirectory + \"/\" + options.database\n });\n }\n }\n });\n\n return connectionOptions;\n }\n\n /**\n * Gets directory where configuration file should be located and configuration file name.\n */\n protected get baseFilePath(): string {\n return path.resolve(this.baseDirectory, this.baseConfigName);\n }\n\n /**\n * Gets directory where configuration file should be located.\n */\n protected get baseDirectory(): string {\n if (this.options && this.options.root)\n return this.options.root;\n\n return appRootPath.path;\n }\n\n /**\n * Gets configuration file name.\n */\n protected get baseConfigName(): string {\n if (this.options && this.options.configName)\n return this.options.configName;\n\n return \"ormconfig\";\n }\n\n}\n"],"sourceRoot":".."}
|
|
1
|
+
{"version":3,"sources":["../browser/src/connection/ConnectionOptionsReader.ts"],"names":[],"mappings":";AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAC,0BAA0B,EAAC,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAC,0BAA0B,EAAC,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAC,0BAA0B,EAAC,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,YAAY,EAA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AI,CAAC,cAAc,CAAC,CAAC;QACjE,CAAC;;;OAAA;IAKD,sBAAc,kDAAa;QAH3B;;WAEG;aACH;YACI,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI;gBACjC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YAE7B,OAAO,WAAW,CAAC,IAAI,CAAC;QAC5B,CAAC;;;OAAA;IAKD,sBAAc,mDAAc;QAH5B;;WAEG;aACH;YACI,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU;gBACvC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;YAEnC,OAAO,WAAW,CAAC;QACvB,CAAC;;;OAAA;IAEL,8BAAC;AAAD,CAlNA,AAkNC,IAAA","file":"ConnectionOptionsReader.js","sourcesContent":["import appRootPath from \"app-root-path\";\nimport path from \"path\";\nimport {ConnectionOptions} from \"./ConnectionOptions\";\nimport {PlatformTools} from \"../platform/PlatformTools\";\nimport {ConnectionOptionsEnvReader} from \"./options-reader/ConnectionOptionsEnvReader\";\nimport {ConnectionOptionsYmlReader} from \"./options-reader/ConnectionOptionsYmlReader\";\nimport {ConnectionOptionsXmlReader} from \"./options-reader/ConnectionOptionsXmlReader\";\nimport { TypeORMError } from \"../error\";\nimport {importOrRequireFile} from \"../util/ImportUtils\";\n\n/**\n * Reads connection options from the ormconfig.\n * Can read from multiple file extensions including env, json, js, xml and yml.\n */\nexport class ConnectionOptionsReader {\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(protected options?: {\n /**\n * Directory where ormconfig should be read from.\n * By default its your application root (where your app package.json is located).\n */\n root?: string,\n\n /**\n * Filename of the ormconfig configuration. By default its equal to \"ormconfig\".\n */\n configName?: string\n }) {\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Returns all connection options read from the ormconfig.\n */\n async all(): Promise<ConnectionOptions[]> {\n const options = await this.load();\n if (!options)\n throw new TypeORMError(`No connection options were found in any orm configuration files.`);\n\n return options;\n }\n\n /**\n * Gets a connection with a given name read from ormconfig.\n * If connection with such name would not be found then it throw error.\n */\n async get(name: string): Promise<ConnectionOptions> {\n const allOptions = await this.all();\n const targetOptions = allOptions.find(options => options.name === name || (name === \"default\" && !options.name));\n if (!targetOptions)\n throw new TypeORMError(`Cannot find connection ${name} because its not defined in any orm configuration files.`);\n\n return targetOptions;\n }\n\n /**\n * Checks if there is a TypeORM configuration file.\n */\n async has(name: string): Promise<boolean> {\n const allOptions = await this.load();\n if (!allOptions)\n return false;\n\n const targetOptions = allOptions.find(options => options.name === name || (name === \"default\" && !options.name));\n return !!targetOptions;\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Loads all connection options from a configuration file.\n *\n * todo: get in count NODE_ENV somehow\n */\n protected async load(): Promise<ConnectionOptions[]|undefined> {\n let connectionOptions: ConnectionOptions|ConnectionOptions[]|undefined = undefined;\n\n const fileFormats = [\"env\", \"js\", \"mjs\", \"cjs\", \"ts\", \"mts\", \"cts\", \"json\", \"yml\", \"yaml\", \"xml\"];\n\n // Detect if baseFilePath contains file extension\n const possibleExtension = this.baseFilePath.substr(this.baseFilePath.lastIndexOf(\".\"));\n const fileExtension = fileFormats.find(extension => `.${extension}` === possibleExtension);\n\n // try to find any of following configuration formats\n const foundFileFormat = fileExtension || fileFormats.find(format => {\n return PlatformTools.fileExist(this.baseFilePath + \".\" + format);\n });\n\n // Determine config file name\n const configFile = fileExtension ? this.baseFilePath : this.baseFilePath + \".\" + foundFileFormat;\n\n // if .env file found then load all its variables into process.env using dotenv package\n if (foundFileFormat === \"env\") {\n PlatformTools.dotenv(configFile);\n } else if (PlatformTools.fileExist(this.baseDirectory + \"/.env\")) {\n PlatformTools.dotenv(this.baseDirectory + \"/.env\");\n }\n\n // try to find connection options from any of available sources of configuration\n if (PlatformTools.getEnvVariable(\"TYPEORM_CONNECTION\") || PlatformTools.getEnvVariable(\"TYPEORM_URL\")) {\n connectionOptions = await new ConnectionOptionsEnvReader().read();\n\n } else if (\n foundFileFormat === \"js\" || foundFileFormat === \"mjs\" || foundFileFormat === \"cjs\" ||\n foundFileFormat === \"ts\" || foundFileFormat === \"mts\" || foundFileFormat === \"cts\"\n ) {\n const [importOrRequireResult, moduleSystem] = await importOrRequireFile(configFile);\n const configModule = await importOrRequireResult;\n\n if (moduleSystem === \"esm\" || (configModule && \"__esModule\" in configModule && \"default\" in configModule)) {\n connectionOptions = configModule.default;\n } else {\n connectionOptions = configModule;\n }\n\n } else if (foundFileFormat === \"json\") {\n connectionOptions = require(configFile);\n\n } else if (foundFileFormat === \"yml\") {\n connectionOptions = await new ConnectionOptionsYmlReader().read(configFile);\n\n } else if (foundFileFormat === \"yaml\") {\n connectionOptions = await new ConnectionOptionsYmlReader().read(configFile);\n\n } else if (foundFileFormat === \"xml\") {\n connectionOptions = await new ConnectionOptionsXmlReader().read(configFile);\n }\n\n // normalize and return connection options\n if (connectionOptions) {\n return this.normalizeConnectionOptions(connectionOptions);\n }\n\n return undefined;\n }\n\n /**\n * Normalize connection options.\n */\n protected normalizeConnectionOptions(connectionOptions: ConnectionOptions|ConnectionOptions[]): ConnectionOptions[] {\n if (!(Array.isArray(connectionOptions)))\n connectionOptions = [connectionOptions];\n\n connectionOptions.forEach(options => {\n if (options.entities) {\n const entities = (options.entities as any[]).map(entity => {\n if (typeof entity === \"string\" && entity.substr(0, 1) !== \"/\")\n return this.baseDirectory + \"/\" + entity;\n\n return entity;\n });\n Object.assign(connectionOptions, { entities: entities });\n }\n if (options.subscribers) {\n const subscribers = (options.subscribers as any[]).map(subscriber => {\n if (typeof subscriber === \"string\" && subscriber.substr(0, 1) !== \"/\")\n return this.baseDirectory + \"/\" + subscriber;\n\n return subscriber;\n });\n Object.assign(connectionOptions, { subscribers: subscribers });\n }\n if (options.migrations) {\n const migrations = (options.migrations as any[]).map(migration => {\n if (typeof migration === \"string\" && migration.substr(0, 1) !== \"/\")\n return this.baseDirectory + \"/\" + migration;\n\n return migration;\n });\n Object.assign(connectionOptions, { migrations: migrations });\n }\n\n // make database path file in sqlite relative to package.json\n if (options.type === \"sqlite\" || options.type === \"better-sqlite3\") {\n if (typeof options.database === \"string\" &&\n options.database.substr(0, 1) !== \"/\" && // unix absolute\n options.database.substr(1, 2) !== \":\\\\\" && // windows absolute\n options.database !== \":memory:\") {\n Object.assign(options, {\n database: this.baseDirectory + \"/\" + options.database\n });\n }\n }\n });\n\n return connectionOptions;\n }\n\n /**\n * Gets directory where configuration file should be located and configuration file name.\n */\n protected get baseFilePath(): string {\n return path.resolve(this.baseDirectory, this.baseConfigName);\n }\n\n /**\n * Gets directory where configuration file should be located.\n */\n protected get baseDirectory(): string {\n if (this.options && this.options.root)\n return this.options.root;\n\n return appRootPath.path;\n }\n\n /**\n * Gets configuration file name.\n */\n protected get baseConfigName(): string {\n if (this.options && this.options.configName)\n return this.options.configName;\n\n return \"ormconfig\";\n }\n\n}\n"],"sourceRoot":".."}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/find-options/operator/Like.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAI,KAAwB;IAC5C,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAC3C,CAAC","file":"Like.js","sourcesContent":["import {FindOperator} from \"../FindOperator\";\n\n/**\n * Find Options Operator.\n * Example: { someField: Like(\"%some
|
|
1
|
+
{"version":3,"sources":["../browser/src/find-options/operator/Like.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAI,KAAwB;IAC5C,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAC3C,CAAC","file":"Like.js","sourcesContent":["import {FindOperator} from \"../FindOperator\";\n\n/**\n * Find Options Operator.\n * Example: { someField: Like(\"%some string%\") }\n */\nexport function Like<T>(value: T|FindOperator<T>) {\n return new FindOperator(\"like\", value);\n}\n"],"sourceRoot":"../.."}
|
package/browser/globals.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __awaiter, __generator } from "tslib";
|
|
1
|
+
import { __awaiter, __generator, __values } from "tslib";
|
|
2
2
|
import { MetadataArgsStorage } from "./metadata-args/MetadataArgsStorage";
|
|
3
3
|
import { PlatformTools } from "./platform/PlatformTools";
|
|
4
4
|
import { ConnectionOptionsReader } from "./connection/ConnectionOptionsReader";
|
|
@@ -75,18 +75,45 @@ export function createConnection(optionsOrName) {
|
|
|
75
75
|
*/
|
|
76
76
|
export function createConnections(options) {
|
|
77
77
|
return __awaiter(this, void 0, void 0, function () {
|
|
78
|
-
var connections;
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
var connections, connections_1, connections_1_1, connection, e_1_1;
|
|
79
|
+
var e_1, _a;
|
|
80
|
+
return __generator(this, function (_b) {
|
|
81
|
+
switch (_b.label) {
|
|
81
82
|
case 0:
|
|
82
83
|
if (!!options) return [3 /*break*/, 2];
|
|
83
84
|
return [4 /*yield*/, new ConnectionOptionsReader().all()];
|
|
84
85
|
case 1:
|
|
85
|
-
options =
|
|
86
|
-
|
|
86
|
+
options = _b.sent();
|
|
87
|
+
_b.label = 2;
|
|
87
88
|
case 2:
|
|
88
89
|
connections = options.map(function (options) { return getConnectionManager().create(options); });
|
|
89
|
-
|
|
90
|
+
_b.label = 3;
|
|
91
|
+
case 3:
|
|
92
|
+
_b.trys.push([3, 8, 9, 10]);
|
|
93
|
+
connections_1 = __values(connections), connections_1_1 = connections_1.next();
|
|
94
|
+
_b.label = 4;
|
|
95
|
+
case 4:
|
|
96
|
+
if (!!connections_1_1.done) return [3 /*break*/, 7];
|
|
97
|
+
connection = connections_1_1.value;
|
|
98
|
+
return [4 /*yield*/, connection.connect()];
|
|
99
|
+
case 5:
|
|
100
|
+
_b.sent();
|
|
101
|
+
_b.label = 6;
|
|
102
|
+
case 6:
|
|
103
|
+
connections_1_1 = connections_1.next();
|
|
104
|
+
return [3 /*break*/, 4];
|
|
105
|
+
case 7: return [3 /*break*/, 10];
|
|
106
|
+
case 8:
|
|
107
|
+
e_1_1 = _b.sent();
|
|
108
|
+
e_1 = { error: e_1_1 };
|
|
109
|
+
return [3 /*break*/, 10];
|
|
110
|
+
case 9:
|
|
111
|
+
try {
|
|
112
|
+
if (connections_1_1 && !connections_1_1.done && (_a = connections_1.return)) _a.call(connections_1);
|
|
113
|
+
}
|
|
114
|
+
finally { if (e_1) throw e_1.error; }
|
|
115
|
+
return [7 /*endfinally*/];
|
|
116
|
+
case 10: return [2 /*return*/, connections];
|
|
90
117
|
}
|
|
91
118
|
});
|
|
92
119
|
});
|
package/browser/globals.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/globals.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAY/C;;GAEG;AACH,MAAM,UAAU,sBAAsB;IAClC,8FAA8F;IAC9F,qGAAqG;IACrG,mGAAmG;IACnG,8EAA8E;IAC9E,6FAA6F;IAC7F,8FAA8F;IAC9F,iFAAiF;IACjF,4FAA4F;IAC5F,IAAM,WAAW,GAAG,aAAa,CAAC,iBAAiB,EAAE,CAAC;IACtD,IAAI,CAAC,WAAW,CAAC,0BAA0B;QACvC,WAAW,CAAC,0BAA0B,GAAG,IAAI,mBAAmB,E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AC,gBAAgB,CAAC,CAAC;AAC5F,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAS,WAAiC,EAAE,cAAkC;IAAlC,+BAAA,EAAA,0BAAkC;IAC5G,OAAO,oBAAoB,EAAE,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,kBAAkB,CAAS,WAAW,CAAC,CAAC;AAC9F,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAS,WAAkC,EAAE,KAAc,EAAE,cAAkC;IAAlC,+BAAA,EAAA,0BAAkC;IAC7H,IAAI,WAAW,EAAE;QACb,OAAO,aAAa,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;KAC/E;IAED,OAAO,aAAa,CAAC,cAAc,CAAC,CAAC,kBAAkB,EAAE,CAAC;AAC9D,CAAC","file":"globals.js","sourcesContent":["import { MetadataArgsStorage } from \"./metadata-args/MetadataArgsStorage\";\nimport { PlatformTools } from \"./platform/PlatformTools\";\nimport { ConnectionOptions } from \"./connection/ConnectionOptions\";\nimport { ConnectionOptionsReader } from \"./connection/ConnectionOptionsReader\";\nimport { ConnectionManager } from \"./connection/ConnectionManager\";\nimport { getFromContainer } from \"./container\";\nimport { Connection } from \"./connection/Connection\";\nimport { EntityManager } from \"./entity-manager/EntityManager\";\nimport { MongoEntityManager } from \"./entity-manager/MongoEntityManager\";\nimport { SqljsEntityManager } from \"./entity-manager/SqljsEntityManager\";\nimport { EntityTarget } from \"./common/EntityTarget\";\nimport { Repository } from \"./repository/Repository\";\nimport { TreeRepository } from \"./repository/TreeRepository\";\nimport { ObjectType } from \"./common/ObjectType\";\nimport { MongoRepository } from \"./repository/MongoRepository\";\nimport { SelectQueryBuilder } from \"./query-builder/SelectQueryBuilder\";\n\n/**\n * Gets metadata args storage.\n */\nexport function getMetadataArgsStorage(): MetadataArgsStorage {\n // we should store metadata storage in a global variable otherwise it brings too much problems\n // one of the problem is that if any entity (or any other) will be imported before consumer will call\n // useContainer method with his own container implementation, that entity will be registered in the\n // old old container (default one post probably) and consumer will his entity.\n // calling useContainer before he imports any entity (or any other) is not always convenient.\n // another reason is that when we run migrations typeorm is being called from a global package\n // and it may load entities which register decorators in typeorm of local package\n // this leads to impossibility of usage of entities in migrations and cli related operations\n const globalScope = PlatformTools.getGlobalVariable();\n if (!globalScope.typeormMetadataArgsStorage)\n globalScope.typeormMetadataArgsStorage = new MetadataArgsStorage();\n\n return globalScope.typeormMetadataArgsStorage;\n}\n\n/**\n * Reads connection options stored in ormconfig configuration file.\n */\nexport async function getConnectionOptions(connectionName: string = \"default\"): Promise<ConnectionOptions> {\n return new ConnectionOptionsReader().get(connectionName);\n}\n\n/**\n * Gets a ConnectionManager which creates connections.\n */\nexport function getConnectionManager(): ConnectionManager {\n return getFromContainer(ConnectionManager);\n}\n\n/**\n * Creates a new connection and registers it in the manager.\n * Only one connection from ormconfig will be created (name \"default\" or connection without name).\n */\nexport async function createConnection(): Promise<Connection>;\n\n/**\n * Creates a new connection from the ormconfig file with a given name.\n */\nexport async function createConnection(name: string): Promise<Connection>;\n\n/**\n * Creates a new connection and registers it in the manager.\n */\nexport async function createConnection(options: ConnectionOptions): Promise<Connection>;\n\n/**\n * Creates a new connection and registers it in the manager.\n *\n * If connection options were not specified, then it will try to create connection automatically,\n * based on content of ormconfig (json/js/yml/xml/env) file or environment variables.\n * Only one connection from ormconfig will be created (name \"default\" or connection without name).\n */\nexport async function createConnection(optionsOrName?: any): Promise<Connection> {\n const connectionName = typeof optionsOrName === \"string\" ? optionsOrName : \"default\";\n const options = optionsOrName instanceof Object ? optionsOrName : await getConnectionOptions(connectionName);\n return getConnectionManager().create(options).connect();\n}\n\n/**\n * Creates new connections and registers them in the manager.\n *\n * If connection options were not specified, then it will try to create connection automatically,\n * based on content of ormconfig (json/js/yml/xml/env) file or environment variables.\n * All connections from the ormconfig will be created.\n */\nexport async function createConnections(options?: ConnectionOptions[]): Promise<Connection[]> {\n if (!options)\n options = await new ConnectionOptionsReader().all();\n const connections = options.map(options => getConnectionManager().create(options));\n return Promise.all(connections.map(connection => connection.connect()));\n}\n\n/**\n * Gets connection from the connection manager.\n * If connection name wasn't specified, then \"default\" connection will be retrieved.\n */\nexport function getConnection(connectionName: string = \"default\"): Connection {\n return getConnectionManager().get(connectionName);\n}\n\n/**\n * Gets entity manager from the connection.\n * If connection name wasn't specified, then \"default\" connection will be retrieved.\n */\nexport function getManager(connectionName: string = \"default\"): EntityManager {\n return getConnectionManager().get(connectionName).manager;\n}\n\n/**\n * Gets MongoDB entity manager from the connection.\n * If connection name wasn't specified, then \"default\" connection will be retrieved.\n */\nexport function getMongoManager(connectionName: string = \"default\"): MongoEntityManager {\n return getConnectionManager().get(connectionName).manager as MongoEntityManager;\n}\n\n/**\n * Gets Sqljs entity manager from connection name.\n * \"default\" connection is used, when no name is specified.\n * Only works when Sqljs driver is used.\n */\nexport function getSqljsManager(connectionName: string = \"default\"): SqljsEntityManager {\n return getConnectionManager().get(connectionName).manager as SqljsEntityManager;\n}\n\n/**\n * Gets repository for the given entity class.\n */\nexport function getRepository<Entity>(entityClass: EntityTarget<Entity>, connectionName: string = \"default\"): Repository<Entity> {\n return getConnectionManager().get(connectionName).getRepository<Entity>(entityClass);\n}\n\n/**\n * Gets tree repository for the given entity class.\n */\nexport function getTreeRepository<Entity>(entityClass: EntityTarget<Entity>, connectionName: string = \"default\"): TreeRepository<Entity> {\n return getConnectionManager().get(connectionName).getTreeRepository<Entity>(entityClass);\n}\n\n/**\n * Gets tree repository for the given entity class.\n */\nexport function getCustomRepository<T>(customRepository: ObjectType<T>, connectionName: string = \"default\"): T {\n return getConnectionManager().get(connectionName).getCustomRepository(customRepository);\n}\n\n/**\n * Gets mongodb repository for the given entity class or name.\n */\nexport function getMongoRepository<Entity>(entityClass: EntityTarget<Entity>, connectionName: string = \"default\"): MongoRepository<Entity> {\n return getConnectionManager().get(connectionName).getMongoRepository<Entity>(entityClass);\n}\n\n/**\n * Creates a new query builder.\n */\nexport function createQueryBuilder<Entity>(entityClass?: EntityTarget<Entity>, alias?: string, connectionName: string = \"default\"): SelectQueryBuilder<Entity> {\n if (entityClass) {\n return getRepository(entityClass, connectionName).createQueryBuilder(alias);\n }\n\n return getConnection(connectionName).createQueryBuilder();\n}\n"],"sourceRoot":"."}
|
|
1
|
+
{"version":3,"sources":["../browser/src/globals.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAY/C;;GAEG;AACH,MAAM,UAAU,sBAAsB;IAClC,8FAA8F;IAC9F,qGAAqG;IACrG,mGAAmG;IACnG,8EAA8E;IAC9E,6FAA6F;IAC7F,8FAA8F;IAC9F,iFAAiF;IACjF,4FAA4F;IAC5F,IAAM,WAAW,GAAG,aAAa,CAAC,iBAAiB,EAAE,CAAC;IACtD,IAAI,CAAC,WAAW,CAAC,0BAA0B;QACvC,WAAW,CAAC,0BAA0B,GAAG,IAAI,mBAAmB,EAAE,CAAC;IAEvE,OAAO,WAAW,CAAC,0BAA0B,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,MAAM,UAAgB,oBAAoB,CAAC,cAAkC;IAAlC,+BAAA,EAAA,0BAAkC;;;YACzE,sBAAO,IAAI,uBAAuB,EAAE,CAAC,GAAG,CAAC,cAAc,CAAC,EAAC;;;CAC5D;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAChC,OAAO,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;AAC/C,CAAC;AAkBD;;;;;;GAMG;AACH,MAAM,UAAgB,gBAAgB,CAAC,aAAmB;;;;;;oBAChD,cAAc,GAAG,OAAO,aAAa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,WAAW,EAAE,cAAc,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;KAC/E;IAED,OAAO,aAAa,CAAC,cAAc,CAAC,CAAC,kBAAkB,EAAE,CAAC;AAC9D,CAAC","file":"globals.js","sourcesContent":["import { MetadataArgsStorage } from \"./metadata-args/MetadataArgsStorage\";\nimport { PlatformTools } from \"./platform/PlatformTools\";\nimport { ConnectionOptions } from \"./connection/ConnectionOptions\";\nimport { ConnectionOptionsReader } from \"./connection/ConnectionOptionsReader\";\nimport { ConnectionManager } from \"./connection/ConnectionManager\";\nimport { getFromContainer } from \"./container\";\nimport { Connection } from \"./connection/Connection\";\nimport { EntityManager } from \"./entity-manager/EntityManager\";\nimport { MongoEntityManager } from \"./entity-manager/MongoEntityManager\";\nimport { SqljsEntityManager } from \"./entity-manager/SqljsEntityManager\";\nimport { EntityTarget } from \"./common/EntityTarget\";\nimport { Repository } from \"./repository/Repository\";\nimport { TreeRepository } from \"./repository/TreeRepository\";\nimport { ObjectType } from \"./common/ObjectType\";\nimport { MongoRepository } from \"./repository/MongoRepository\";\nimport { SelectQueryBuilder } from \"./query-builder/SelectQueryBuilder\";\n\n/**\n * Gets metadata args storage.\n */\nexport function getMetadataArgsStorage(): MetadataArgsStorage {\n // we should store metadata storage in a global variable otherwise it brings too much problems\n // one of the problem is that if any entity (or any other) will be imported before consumer will call\n // useContainer method with his own container implementation, that entity will be registered in the\n // old old container (default one post probably) and consumer will his entity.\n // calling useContainer before he imports any entity (or any other) is not always convenient.\n // another reason is that when we run migrations typeorm is being called from a global package\n // and it may load entities which register decorators in typeorm of local package\n // this leads to impossibility of usage of entities in migrations and cli related operations\n const globalScope = PlatformTools.getGlobalVariable();\n if (!globalScope.typeormMetadataArgsStorage)\n globalScope.typeormMetadataArgsStorage = new MetadataArgsStorage();\n\n return globalScope.typeormMetadataArgsStorage;\n}\n\n/**\n * Reads connection options stored in ormconfig configuration file.\n */\nexport async function getConnectionOptions(connectionName: string = \"default\"): Promise<ConnectionOptions> {\n return new ConnectionOptionsReader().get(connectionName);\n}\n\n/**\n * Gets a ConnectionManager which creates connections.\n */\nexport function getConnectionManager(): ConnectionManager {\n return getFromContainer(ConnectionManager);\n}\n\n/**\n * Creates a new connection and registers it in the manager.\n * Only one connection from ormconfig will be created (name \"default\" or connection without name).\n */\nexport async function createConnection(): Promise<Connection>;\n\n/**\n * Creates a new connection from the ormconfig file with a given name.\n */\nexport async function createConnection(name: string): Promise<Connection>;\n\n/**\n * Creates a new connection and registers it in the manager.\n */\nexport async function createConnection(options: ConnectionOptions): Promise<Connection>;\n\n/**\n * Creates a new connection and registers it in the manager.\n *\n * If connection options were not specified, then it will try to create connection automatically,\n * based on content of ormconfig (json/js/yml/xml/env) file or environment variables.\n * Only one connection from ormconfig will be created (name \"default\" or connection without name).\n */\nexport async function createConnection(optionsOrName?: any): Promise<Connection> {\n const connectionName = typeof optionsOrName === \"string\" ? optionsOrName : \"default\";\n const options = optionsOrName instanceof Object ? optionsOrName : await getConnectionOptions(connectionName);\n return getConnectionManager().create(options).connect();\n}\n\n/**\n * Creates new connections and registers them in the manager.\n *\n * If connection options were not specified, then it will try to create connection automatically,\n * based on content of ormconfig (json/js/yml/xml/env) file or environment variables.\n * All connections from the ormconfig will be created.\n */\nexport async function createConnections(options?: ConnectionOptions[]): Promise<Connection[]> {\n if (!options)\n options = await new ConnectionOptionsReader().all();\n const connections = options.map(options => getConnectionManager().create(options));\n // Do not use Promise.all or test 8522 will produce a dangling sqlite connection\n for (const connection of connections) {\n await connection.connect()\n }\n return connections;\n}\n\n/**\n * Gets connection from the connection manager.\n * If connection name wasn't specified, then \"default\" connection will be retrieved.\n */\nexport function getConnection(connectionName: string = \"default\"): Connection {\n return getConnectionManager().get(connectionName);\n}\n\n/**\n * Gets entity manager from the connection.\n * If connection name wasn't specified, then \"default\" connection will be retrieved.\n */\nexport function getManager(connectionName: string = \"default\"): EntityManager {\n return getConnectionManager().get(connectionName).manager;\n}\n\n/**\n * Gets MongoDB entity manager from the connection.\n * If connection name wasn't specified, then \"default\" connection will be retrieved.\n */\nexport function getMongoManager(connectionName: string = \"default\"): MongoEntityManager {\n return getConnectionManager().get(connectionName).manager as MongoEntityManager;\n}\n\n/**\n * Gets Sqljs entity manager from connection name.\n * \"default\" connection is used, when no name is specified.\n * Only works when Sqljs driver is used.\n */\nexport function getSqljsManager(connectionName: string = \"default\"): SqljsEntityManager {\n return getConnectionManager().get(connectionName).manager as SqljsEntityManager;\n}\n\n/**\n * Gets repository for the given entity class.\n */\nexport function getRepository<Entity>(entityClass: EntityTarget<Entity>, connectionName: string = \"default\"): Repository<Entity> {\n return getConnectionManager().get(connectionName).getRepository<Entity>(entityClass);\n}\n\n/**\n * Gets tree repository for the given entity class.\n */\nexport function getTreeRepository<Entity>(entityClass: EntityTarget<Entity>, connectionName: string = \"default\"): TreeRepository<Entity> {\n return getConnectionManager().get(connectionName).getTreeRepository<Entity>(entityClass);\n}\n\n/**\n * Gets tree repository for the given entity class.\n */\nexport function getCustomRepository<T>(customRepository: ObjectType<T>, connectionName: string = \"default\"): T {\n return getConnectionManager().get(connectionName).getCustomRepository(customRepository);\n}\n\n/**\n * Gets mongodb repository for the given entity class or name.\n */\nexport function getMongoRepository<Entity>(entityClass: EntityTarget<Entity>, connectionName: string = \"default\"): MongoRepository<Entity> {\n return getConnectionManager().get(connectionName).getMongoRepository<Entity>(entityClass);\n}\n\n/**\n * Creates a new query builder.\n */\nexport function createQueryBuilder<Entity>(entityClass?: EntityTarget<Entity>, alias?: string, connectionName: string = \"default\"): SelectQueryBuilder<Entity> {\n if (entityClass) {\n return getRepository(entityClass, connectionName).createQueryBuilder(alias);\n }\n\n return getConnection(connectionName).createQueryBuilder();\n}\n"],"sourceRoot":"."}
|
package/browser/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from "./common/EntityTarget";
|
|
|
7
7
|
export * from "./common/ObjectType";
|
|
8
8
|
export * from "./common/ObjectLiteral";
|
|
9
9
|
export * from "./common/DeepPartial";
|
|
10
|
+
export * from "./common/RelationType";
|
|
10
11
|
export * from "./error";
|
|
11
12
|
export * from "./decorator/columns/Column";
|
|
12
13
|
export * from "./decorator/columns/CreateDateColumn";
|
package/browser/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export * from "./common/EntityTarget";
|
|
|
10
10
|
export * from "./common/ObjectType";
|
|
11
11
|
export * from "./common/ObjectLiteral";
|
|
12
12
|
export * from "./common/DeepPartial";
|
|
13
|
+
export * from "./common/RelationType";
|
|
13
14
|
export * from "./error";
|
|
14
15
|
export * from "./decorator/columns/Column";
|
|
15
16
|
export * from "./decorator/columns/CreateDateColumn";
|
package/browser/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/index.ts"],"names":[],"mappings":"AAAA;GACG;AACH,OAAO,kBAAkB,CAAC;AAE1B,4EAA4E;AAC5E,wBAAwB;AACxB,4EAA4E;AAE5E,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,mCAAmC,CAA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O,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAC,kBAAkB,EAAC,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAC,kBAAkB,EAAC,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAC,kBAAkB,EAAC,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAC,kBAAkB,EAAC,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAC,WAAW,EAAC,MAAM,6BAA6B,CAAC;AAGxD,OAAO,EAAC,YAAY,EAAC,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAC,YAAY,EAAC,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAC,YAAY,EAAC,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AAEvD,OAAO,EAAC,kBAAkB,EAAC,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAC,qBAAqB,EAAC,MAAM,yCAAyC,CAAC;AAY9E,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC","file":"index.js","sourcesContent":["/*!\n */\nimport \"reflect-metadata\";\n\n// -------------------------------------------------------------------------\n// Commonly Used exports\n// -------------------------------------------------------------------------\n\nexport * from \"./globals\";\nexport * from \"./container\";\nexport * from \"./common/EntityTarget\";\nexport * from \"./common/ObjectType\";\nexport * from \"./common/ObjectLiteral\";\nexport * from \"./common/DeepPartial\";\nexport * from \"./error\";\nexport * from \"./decorator/columns/Column\";\nexport * from \"./decorator/columns/CreateDateColumn\";\nexport * from \"./decorator/columns/DeleteDateColumn\";\nexport * from \"./decorator/columns/PrimaryGeneratedColumn\";\nexport * from \"./decorator/columns/PrimaryColumn\";\nexport * from \"./decorator/columns/UpdateDateColumn\";\nexport * from \"./decorator/columns/VersionColumn\";\nexport * from \"./decorator/columns/ViewColumn\";\nexport * from \"./decorator/columns/ObjectIdColumn\";\nexport * from \"./decorator/listeners/AfterInsert\";\nexport * from \"./decorator/listeners/AfterLoad\";\nexport * from \"./decorator/listeners/AfterRemove\";\nexport * from \"./decorator/listeners/AfterUpdate\";\nexport * from \"./decorator/listeners/BeforeInsert\";\nexport * from \"./decorator/listeners/BeforeRemove\";\nexport * from \"./decorator/listeners/BeforeUpdate\";\nexport * from \"./decorator/listeners/EventSubscriber\";\nexport * from \"./decorator/options/ColumnOptions\";\nexport * from \"./decorator/options/IndexOptions\";\nexport * from \"./decorator/options/JoinColumnOptions\";\nexport * from \"./decorator/options/JoinTableOptions\";\nexport * from \"./decorator/options/RelationOptions\";\nexport * from \"./decorator/options/EntityOptions\";\nexport * from \"./decorator/options/ValueTransformer\";\nexport * from \"./decorator/relations/JoinColumn\";\nexport * from \"./decorator/relations/JoinTable\";\nexport * from \"./decorator/relations/ManyToMany\";\nexport * from \"./decorator/relations/ManyToOne\";\nexport * from \"./decorator/relations/OneToMany\";\nexport * from \"./decorator/relations/OneToOne\";\nexport * from \"./decorator/relations/RelationCount\";\nexport * from \"./decorator/relations/RelationId\";\nexport * from \"./decorator/entity/Entity\";\nexport * from \"./decorator/entity/ChildEntity\";\nexport * from \"./decorator/entity/TableInheritance\";\nexport * from \"./decorator/entity-view/ViewEntity\";\nexport * from \"./decorator/transaction/Transaction\";\nexport * from \"./decorator/transaction/TransactionManager\";\nexport * from \"./decorator/transaction/TransactionRepository\";\nexport * from \"./decorator/tree/TreeLevelColumn\";\nexport * from \"./decorator/tree/TreeParent\";\nexport * from \"./decorator/tree/TreeChildren\";\nexport * from \"./decorator/tree/Tree\";\nexport * from \"./decorator/Index\";\nexport * from \"./decorator/Unique\";\nexport * from \"./decorator/Check\";\nexport * from \"./decorator/Exclusion\";\nexport * from \"./decorator/Generated\";\nexport * from \"./decorator/EntityRepository\";\nexport * from \"./find-options/operator/Any\";\nexport * from \"./find-options/operator/Between\";\nexport * from \"./find-options/operator/Equal\";\nexport * from \"./find-options/operator/In\";\nexport * from \"./find-options/operator/IsNull\";\nexport * from \"./find-options/operator/LessThan\";\nexport * from \"./find-options/operator/LessThanOrEqual\";\nexport * from \"./find-options/operator/ILike\";\nexport * from \"./find-options/operator/Like\";\nexport * from \"./find-options/operator/MoreThan\";\nexport * from \"./find-options/operator/MoreThanOrEqual\";\nexport * from \"./find-options/operator/Not\";\nexport * from \"./find-options/operator/Raw\";\nexport * from \"./find-options/FindConditions\";\nexport * from \"./find-options/FindManyOptions\";\nexport * from \"./find-options/FindOneOptions\";\nexport * from \"./find-options/FindOperator\";\nexport * from \"./find-options/FindOperatorType\";\nexport * from \"./find-options/JoinOptions\";\nexport * from \"./find-options/OrderByCondition\";\nexport * from \"./find-options/FindOptionsUtils\";\nexport * from \"./logger/Logger\";\nexport * from \"./logger/LoggerOptions\";\nexport * from \"./logger/AdvancedConsoleLogger\";\nexport * from \"./logger/SimpleConsoleLogger\";\nexport * from \"./logger/FileLogger\";\nexport * from \"./metadata/EntityMetadata\";\nexport * from \"./entity-manager/EntityManager\";\nexport * from \"./repository/AbstractRepository\";\nexport * from \"./repository/Repository\";\nexport * from \"./repository/BaseEntity\";\nexport * from \"./repository/TreeRepository\";\nexport * from \"./repository/MongoRepository\";\nexport * from \"./repository/RemoveOptions\";\nexport * from \"./repository/SaveOptions\";\nexport * from \"./schema-builder/table/TableCheck\";\nexport * from \"./schema-builder/table/TableColumn\";\nexport * from \"./schema-builder/table/TableExclusion\";\nexport * from \"./schema-builder/table/TableForeignKey\";\nexport * from \"./schema-builder/table/TableIndex\";\nexport * from \"./schema-builder/table/TableUnique\";\nexport * from \"./schema-builder/table/Table\";\nexport * from \"./schema-builder/options/TableCheckOptions\";\nexport * from \"./schema-builder/options/TableColumnOptions\";\nexport * from \"./schema-builder/options/TableExclusionOptions\";\nexport * from \"./schema-builder/options/TableForeignKeyOptions\";\nexport * from \"./schema-builder/options/TableIndexOptions\";\nexport * from \"./schema-builder/options/TableOptions\";\nexport * from \"./schema-builder/options/TableUniqueOptions\";\nexport * from \"./schema-builder/options/ViewOptions\";\nexport * from \"./driver/mongodb/typings\";\nexport * from \"./driver/types/DatabaseType\";\nexport * from \"./driver/types/ReplicationMode\";\nexport * from \"./driver/sqlserver/MssqlParameter\";\n\nexport {ConnectionOptionsReader} from \"./connection/ConnectionOptionsReader\";\nexport {Connection} from \"./connection/Connection\";\nexport {ConnectionManager} from \"./connection/ConnectionManager\";\nexport {ConnectionOptions} from \"./connection/ConnectionOptions\";\nexport {Driver} from \"./driver/Driver\";\nexport {QueryBuilder} from \"./query-builder/QueryBuilder\";\nexport {SelectQueryBuilder} from \"./query-builder/SelectQueryBuilder\";\nexport {DeleteQueryBuilder} from \"./query-builder/DeleteQueryBuilder\";\nexport {InsertQueryBuilder} from \"./query-builder/InsertQueryBuilder\";\nexport {UpdateQueryBuilder} from \"./query-builder/UpdateQueryBuilder\";\nexport {RelationQueryBuilder} from \"./query-builder/RelationQueryBuilder\";\nexport {Brackets} from \"./query-builder/Brackets\";\nexport {NotBrackets} from \"./query-builder/NotBrackets\";\nexport {WhereExpressionBuilder} from \"./query-builder/WhereExpressionBuilder\";\nexport {WhereExpression} from \"./query-builder/WhereExpressionBuilder\";\nexport {InsertResult} from \"./query-builder/result/InsertResult\";\nexport {UpdateResult} from \"./query-builder/result/UpdateResult\";\nexport {DeleteResult} from \"./query-builder/result/DeleteResult\";\nexport {QueryResult} from \"./query-runner/QueryResult\";\nexport {QueryRunner} from \"./query-runner/QueryRunner\";\nexport {MongoEntityManager} from \"./entity-manager/MongoEntityManager\";\nexport {Migration} from \"./migration/Migration\";\nexport {MigrationExecutor} from \"./migration/MigrationExecutor\";\nexport {MigrationInterface} from \"./migration/MigrationInterface\";\nexport {DefaultNamingStrategy} from \"./naming-strategy/DefaultNamingStrategy\";\nexport {NamingStrategyInterface} from \"./naming-strategy/NamingStrategyInterface\";\nexport {FindOneOptions} from \"./find-options/FindOneOptions\";\nexport {FindManyOptions} from \"./find-options/FindManyOptions\";\nexport {InsertEvent} from \"./subscriber/event/InsertEvent\";\nexport {LoadEvent} from \"./subscriber/event/LoadEvent\";\nexport {UpdateEvent} from \"./subscriber/event/UpdateEvent\";\nexport {RemoveEvent} from \"./subscriber/event/RemoveEvent\";\nexport {TransactionCommitEvent} from \"./subscriber/event/TransactionCommitEvent\";\nexport {TransactionRollbackEvent} from \"./subscriber/event/TransactionRollbackEvent\";\nexport {TransactionStartEvent} from \"./subscriber/event/TransactionStartEvent\";\nexport {EntitySubscriberInterface} from \"./subscriber/EntitySubscriberInterface\";\nexport {EntitySchema} from \"./entity-schema/EntitySchema\";\nexport {EntitySchemaColumnOptions} from \"./entity-schema/EntitySchemaColumnOptions\";\nexport {EntitySchemaIndexOptions} from \"./entity-schema/EntitySchemaIndexOptions\";\nexport {EntitySchemaRelationOptions} from \"./entity-schema/EntitySchemaRelationOptions\";\nexport {ColumnType} from \"./driver/types/ColumnTypes\";\n"],"sourceRoot":"."}
|
|
1
|
+
{"version":3,"sources":["../browser/src/index.ts"],"names":[],"mappings":"AAAA;GACG;AACH,OAAO,kBAAkB,CAAC;AAE1B,4EAA4E;AAC5E,wBAAwB;AACxB,4EAA4E;AAE5E,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AAC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\";\n\n// -------------------------------------------------------------------------\n// Commonly Used exports\n// -------------------------------------------------------------------------\n\nexport * from \"./globals\";\nexport * from \"./container\";\nexport * from \"./common/EntityTarget\";\nexport * from \"./common/ObjectType\";\nexport * from \"./common/ObjectLiteral\";\nexport * from \"./common/DeepPartial\";\nexport * from \"./common/RelationType\";\nexport * from \"./error\";\nexport * from \"./decorator/columns/Column\";\nexport * from \"./decorator/columns/CreateDateColumn\";\nexport * from \"./decorator/columns/DeleteDateColumn\";\nexport * from \"./decorator/columns/PrimaryGeneratedColumn\";\nexport * from \"./decorator/columns/PrimaryColumn\";\nexport * from \"./decorator/columns/UpdateDateColumn\";\nexport * from \"./decorator/columns/VersionColumn\";\nexport * from \"./decorator/columns/ViewColumn\";\nexport * from \"./decorator/columns/ObjectIdColumn\";\nexport * from \"./decorator/listeners/AfterInsert\";\nexport * from \"./decorator/listeners/AfterLoad\";\nexport * from \"./decorator/listeners/AfterRemove\";\nexport * from \"./decorator/listeners/AfterUpdate\";\nexport * from \"./decorator/listeners/BeforeInsert\";\nexport * from \"./decorator/listeners/BeforeRemove\";\nexport * from \"./decorator/listeners/BeforeUpdate\";\nexport * from \"./decorator/listeners/EventSubscriber\";\nexport * from \"./decorator/options/ColumnOptions\";\nexport * from \"./decorator/options/IndexOptions\";\nexport * from \"./decorator/options/JoinColumnOptions\";\nexport * from \"./decorator/options/JoinTableOptions\";\nexport * from \"./decorator/options/RelationOptions\";\nexport * from \"./decorator/options/EntityOptions\";\nexport * from \"./decorator/options/ValueTransformer\";\nexport * from \"./decorator/relations/JoinColumn\";\nexport * from \"./decorator/relations/JoinTable\";\nexport * from \"./decorator/relations/ManyToMany\";\nexport * from \"./decorator/relations/ManyToOne\";\nexport * from \"./decorator/relations/OneToMany\";\nexport * from \"./decorator/relations/OneToOne\";\nexport * from \"./decorator/relations/RelationCount\";\nexport * from \"./decorator/relations/RelationId\";\nexport * from \"./decorator/entity/Entity\";\nexport * from \"./decorator/entity/ChildEntity\";\nexport * from \"./decorator/entity/TableInheritance\";\nexport * from \"./decorator/entity-view/ViewEntity\";\nexport * from \"./decorator/transaction/Transaction\";\nexport * from \"./decorator/transaction/TransactionManager\";\nexport * from \"./decorator/transaction/TransactionRepository\";\nexport * from \"./decorator/tree/TreeLevelColumn\";\nexport * from \"./decorator/tree/TreeParent\";\nexport * from \"./decorator/tree/TreeChildren\";\nexport * from \"./decorator/tree/Tree\";\nexport * from \"./decorator/Index\";\nexport * from \"./decorator/Unique\";\nexport * from \"./decorator/Check\";\nexport * from \"./decorator/Exclusion\";\nexport * from \"./decorator/Generated\";\nexport * from \"./decorator/EntityRepository\";\nexport * from \"./find-options/operator/Any\";\nexport * from \"./find-options/operator/Between\";\nexport * from \"./find-options/operator/Equal\";\nexport * from \"./find-options/operator/In\";\nexport * from \"./find-options/operator/IsNull\";\nexport * from \"./find-options/operator/LessThan\";\nexport * from \"./find-options/operator/LessThanOrEqual\";\nexport * from \"./find-options/operator/ILike\";\nexport * from \"./find-options/operator/Like\";\nexport * from \"./find-options/operator/MoreThan\";\nexport * from \"./find-options/operator/MoreThanOrEqual\";\nexport * from \"./find-options/operator/Not\";\nexport * from \"./find-options/operator/Raw\";\nexport * from \"./find-options/FindConditions\";\nexport * from \"./find-options/FindManyOptions\";\nexport * from \"./find-options/FindOneOptions\";\nexport * from \"./find-options/FindOperator\";\nexport * from \"./find-options/FindOperatorType\";\nexport * from \"./find-options/JoinOptions\";\nexport * from \"./find-options/OrderByCondition\";\nexport * from \"./find-options/FindOptionsUtils\";\nexport * from \"./logger/Logger\";\nexport * from \"./logger/LoggerOptions\";\nexport * from \"./logger/AdvancedConsoleLogger\";\nexport * from \"./logger/SimpleConsoleLogger\";\nexport * from \"./logger/FileLogger\";\nexport * from \"./metadata/EntityMetadata\";\nexport * from \"./entity-manager/EntityManager\";\nexport * from \"./repository/AbstractRepository\";\nexport * from \"./repository/Repository\";\nexport * from \"./repository/BaseEntity\";\nexport * from \"./repository/TreeRepository\";\nexport * from \"./repository/MongoRepository\";\nexport * from \"./repository/RemoveOptions\";\nexport * from \"./repository/SaveOptions\";\nexport * from \"./schema-builder/table/TableCheck\";\nexport * from \"./schema-builder/table/TableColumn\";\nexport * from \"./schema-builder/table/TableExclusion\";\nexport * from \"./schema-builder/table/TableForeignKey\";\nexport * from \"./schema-builder/table/TableIndex\";\nexport * from \"./schema-builder/table/TableUnique\";\nexport * from \"./schema-builder/table/Table\";\nexport * from \"./schema-builder/options/TableCheckOptions\";\nexport * from \"./schema-builder/options/TableColumnOptions\";\nexport * from \"./schema-builder/options/TableExclusionOptions\";\nexport * from \"./schema-builder/options/TableForeignKeyOptions\";\nexport * from \"./schema-builder/options/TableIndexOptions\";\nexport * from \"./schema-builder/options/TableOptions\";\nexport * from \"./schema-builder/options/TableUniqueOptions\";\nexport * from \"./schema-builder/options/ViewOptions\";\nexport * from \"./driver/mongodb/typings\";\nexport * from \"./driver/types/DatabaseType\";\nexport * from \"./driver/types/ReplicationMode\";\nexport * from \"./driver/sqlserver/MssqlParameter\";\n\nexport {ConnectionOptionsReader} from \"./connection/ConnectionOptionsReader\";\nexport {Connection} from \"./connection/Connection\";\nexport {ConnectionManager} from \"./connection/ConnectionManager\";\nexport {ConnectionOptions} from \"./connection/ConnectionOptions\";\nexport {Driver} from \"./driver/Driver\";\nexport {QueryBuilder} from \"./query-builder/QueryBuilder\";\nexport {SelectQueryBuilder} from \"./query-builder/SelectQueryBuilder\";\nexport {DeleteQueryBuilder} from \"./query-builder/DeleteQueryBuilder\";\nexport {InsertQueryBuilder} from \"./query-builder/InsertQueryBuilder\";\nexport {UpdateQueryBuilder} from \"./query-builder/UpdateQueryBuilder\";\nexport {RelationQueryBuilder} from \"./query-builder/RelationQueryBuilder\";\nexport {Brackets} from \"./query-builder/Brackets\";\nexport {NotBrackets} from \"./query-builder/NotBrackets\";\nexport {WhereExpressionBuilder} from \"./query-builder/WhereExpressionBuilder\";\nexport {WhereExpression} from \"./query-builder/WhereExpressionBuilder\";\nexport {InsertResult} from \"./query-builder/result/InsertResult\";\nexport {UpdateResult} from \"./query-builder/result/UpdateResult\";\nexport {DeleteResult} from \"./query-builder/result/DeleteResult\";\nexport {QueryResult} from \"./query-runner/QueryResult\";\nexport {QueryRunner} from \"./query-runner/QueryRunner\";\nexport {MongoEntityManager} from \"./entity-manager/MongoEntityManager\";\nexport {Migration} from \"./migration/Migration\";\nexport {MigrationExecutor} from \"./migration/MigrationExecutor\";\nexport {MigrationInterface} from \"./migration/MigrationInterface\";\nexport {DefaultNamingStrategy} from \"./naming-strategy/DefaultNamingStrategy\";\nexport {NamingStrategyInterface} from \"./naming-strategy/NamingStrategyInterface\";\nexport {FindOneOptions} from \"./find-options/FindOneOptions\";\nexport {FindManyOptions} from \"./find-options/FindManyOptions\";\nexport {InsertEvent} from \"./subscriber/event/InsertEvent\";\nexport {LoadEvent} from \"./subscriber/event/LoadEvent\";\nexport {UpdateEvent} from \"./subscriber/event/UpdateEvent\";\nexport {RemoveEvent} from \"./subscriber/event/RemoveEvent\";\nexport {TransactionCommitEvent} from \"./subscriber/event/TransactionCommitEvent\";\nexport {TransactionRollbackEvent} from \"./subscriber/event/TransactionRollbackEvent\";\nexport {TransactionStartEvent} from \"./subscriber/event/TransactionStartEvent\";\nexport {EntitySubscriberInterface} from \"./subscriber/EntitySubscriberInterface\";\nexport {EntitySchema} from \"./entity-schema/EntitySchema\";\nexport {EntitySchemaColumnOptions} from \"./entity-schema/EntitySchemaColumnOptions\";\nexport {EntitySchemaIndexOptions} from \"./entity-schema/EntitySchemaIndexOptions\";\nexport {EntitySchemaRelationOptions} from \"./entity-schema/EntitySchemaRelationOptions\";\nexport {ColumnType} from \"./driver/types/ColumnTypes\";\n"],"sourceRoot":"."}
|
|
@@ -263,7 +263,7 @@ var MigrationExecutor = /** @class */ (function () {
|
|
|
263
263
|
_c.label = 2;
|
|
264
264
|
case 2: return [4 /*yield*/, migration.instance.up(queryRunner)
|
|
265
265
|
.catch(function (error) {
|
|
266
|
-
_this.connection.logger.logMigration("Migration \"" + migration.name + "\"
|
|
266
|
+
_this.connection.logger.logMigration("Migration \"" + migration.name + "\" failed, error: " + (error === null || error === void 0 ? void 0 : error.message));
|
|
267
267
|
throw error;
|
|
268
268
|
})
|
|
269
269
|
.then(function () { return __awaiter(_this, void 0, void 0, function () {
|