typeorm 0.3.23-dev.04f3d3f → 0.3.23-dev.184f463
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/driver/mysql/MysqlConnectionOptions.d.ts +6 -0
- package/browser/driver/mysql/MysqlConnectionOptions.js.map +1 -1
- package/browser/driver/mysql/MysqlQueryRunner.js +6 -1
- package/browser/driver/mysql/MysqlQueryRunner.js.map +1 -1
- package/browser/metadata/EntityListenerMetadata.js +14 -2
- package/browser/metadata/EntityListenerMetadata.js.map +1 -1
- package/browser/subscriber/event/UpdateEvent.d.ts +4 -0
- package/browser/subscriber/event/UpdateEvent.js.map +1 -1
- package/commands/MigrationCreateCommand.d.ts +3 -1
- package/commands/MigrationCreateCommand.js +17 -3
- package/commands/MigrationCreateCommand.js.map +1 -1
- package/commands/MigrationGenerateCommand.d.ts +3 -1
- package/commands/MigrationGenerateCommand.js +17 -3
- package/commands/MigrationGenerateCommand.js.map +1 -1
- package/driver/mysql/MysqlConnectionOptions.d.ts +6 -0
- package/driver/mysql/MysqlConnectionOptions.js.map +1 -1
- package/driver/mysql/MysqlQueryRunner.js +6 -1
- package/driver/mysql/MysqlQueryRunner.js.map +1 -1
- package/metadata/EntityListenerMetadata.js +14 -2
- package/metadata/EntityListenerMetadata.js.map +1 -1
- package/package.json +1 -1
- package/subscriber/event/UpdateEvent.d.ts +4 -0
- package/subscriber/event/UpdateEvent.js.map +1 -1
|
@@ -32,8 +32,20 @@ class EntityListenerMetadata {
|
|
|
32
32
|
* Executes listener method of the given entity.
|
|
33
33
|
*/
|
|
34
34
|
execute(entity) {
|
|
35
|
-
if
|
|
36
|
-
|
|
35
|
+
// Check if the Embedded Metadata does not exist
|
|
36
|
+
if (!this.embeddedMetadata) {
|
|
37
|
+
// Get the Entity's Method
|
|
38
|
+
const entityMethod = entity[this.propertyName];
|
|
39
|
+
// Check if the Entity Method does not exist
|
|
40
|
+
if (!entityMethod)
|
|
41
|
+
throw new Error(`Entity listener method "${this.propertyName}" does not exist in entity "${entity.constructor.name}".`);
|
|
42
|
+
// Check if the Entity Method is not a function
|
|
43
|
+
if (typeof entityMethod !== "function")
|
|
44
|
+
throw new Error(`Entity listener method "${this.propertyName}" in entity "${entity.constructor.name}" must be a function but got "${typeof entityMethod}".`);
|
|
45
|
+
// Call and return the Entity Method
|
|
46
|
+
return entityMethod.call(entity);
|
|
47
|
+
}
|
|
48
|
+
// Call the Embedded Method
|
|
37
49
|
this.callEntityEmbeddedMethod(entity, this.embeddedMetadata.propertyPath.split("."));
|
|
38
50
|
}
|
|
39
51
|
// ---------------------------------------------------------------------
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/metadata/EntityListenerMetadata.ts"],"names":[],"mappings":";;;AAMA;;GAEG;AACH,MAAa,sBAAsB;IA+B/B,wEAAwE;IACxE,cAAc;IACd,wEAAwE;IAExE,YAAY,OAIX;QACG,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAA;QAC5C,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAA;QAChD,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAA;QACjC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAA;QAC7C,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA;IACjC,CAAC;IAED,wEAAwE;IACxE,iBAAiB;IACjB,wEAAwE;IAExE;;OAEG;IACH,SAAS,CAAC,MAAqB;QAC3B,2DAA2D;QAC3D,OAAO,CACH,IAAI,CAAC,cAAc,CAAC,MAAM,KAAK,MAAM,CAAC,WAAW,IAAI,oIAAoI;YACzL,CAAC,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,KAAK,UAAU;gBAC7C,MAAM,CAAC,WAAW,CAAC,SAAS;oBACxB,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CACtC,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,CAAC;CACJ;AAhID,wDAgIC","file":"EntityListenerMetadata.js","sourcesContent":["import { EventListenerType } from \"./types/EventListenerTypes\"\nimport { EntityListenerMetadataArgs } from \"../metadata-args/EntityListenerMetadataArgs\"\nimport { ObjectLiteral } from \"../common/ObjectLiteral\"\nimport { EntityMetadata } from \"./EntityMetadata\"\nimport { EmbeddedMetadata } from \"./EmbeddedMetadata\"\n\n/**\n * This metadata contains all information about entity's listeners.\n */\nexport class EntityListenerMetadata {\n // ---------------------------------------------------------------------\n // Properties\n // ---------------------------------------------------------------------\n\n /**\n * Entity metadata of the listener.\n */\n entityMetadata: EntityMetadata\n\n /**\n * Embedded metadata of the listener, in the case if listener is in embedded.\n */\n embeddedMetadata?: EmbeddedMetadata\n\n /**\n * Target class to which metadata is applied.\n * This can be different then entityMetadata.target in the case if listener is in the embedded.\n */\n target: Function | string\n\n /**\n * Target's property name to which this metadata is applied.\n */\n propertyName: string\n\n /**\n * The type of the listener.\n */\n type: EventListenerType\n\n // ---------------------------------------------------------------------\n // Constructor\n // ---------------------------------------------------------------------\n\n constructor(options: {\n entityMetadata: EntityMetadata\n embeddedMetadata?: EmbeddedMetadata\n args: EntityListenerMetadataArgs\n }) {\n this.entityMetadata = options.entityMetadata\n this.embeddedMetadata = options.embeddedMetadata\n this.target = options.args.target\n this.propertyName = options.args.propertyName\n this.type = options.args.type\n }\n\n // ---------------------------------------------------------------------\n // Public Methods\n // ---------------------------------------------------------------------\n\n /**\n * Checks if entity listener is allowed to be executed on the given entity.\n */\n isAllowed(entity: ObjectLiteral) {\n // todo: create in entity metadata method like isInherited?\n return (\n this.entityMetadata.target === entity.constructor || // todo: .constructor won't work for entity schemas, but there are no entity listeners in schemas since there are no objects, right?\n (typeof this.entityMetadata.target === \"function\" &&\n entity.constructor.prototype instanceof\n this.entityMetadata.target)\n ) // todo: also need to implement entity schema inheritance\n }\n\n /**\n * Executes listener method of the given entity.\n */\n execute(entity: ObjectLiteral) {\n // Check if the Embedded Metadata does not exist\n if (!this.embeddedMetadata) {\n // Get the Entity's Method\n const entityMethod = entity[this.propertyName]\n\n // Check if the Entity Method does not exist\n if (!entityMethod)\n throw new Error(\n `Entity listener method \"${this.propertyName}\" does not exist in entity \"${entity.constructor.name}\".`,\n )\n\n // Check if the Entity Method is not a function\n if (typeof entityMethod !== \"function\")\n throw new Error(\n `Entity listener method \"${this.propertyName}\" in entity \"${\n entity.constructor.name\n }\" must be a function but got \"${typeof entityMethod}\".`,\n )\n\n // Call and return the Entity Method\n return entityMethod.call(entity)\n }\n\n // Call the Embedded Method\n this.callEntityEmbeddedMethod(\n entity,\n this.embeddedMetadata.propertyPath.split(\".\"),\n )\n }\n\n // ---------------------------------------------------------------------\n // Protected Methods\n // ---------------------------------------------------------------------\n\n /**\n * Calls embedded entity listener method no matter how nested it is.\n */\n protected callEntityEmbeddedMethod(\n entity: ObjectLiteral,\n propertyPaths: string[],\n ): void {\n const propertyPath = propertyPaths.shift()\n if (!propertyPath || !entity[propertyPath]) return\n\n if (propertyPaths.length === 0) {\n if (Array.isArray(entity[propertyPath])) {\n entity[propertyPath].map((embedded: ObjectLiteral) =>\n embedded[this.propertyName](),\n )\n } else {\n entity[propertyPath][this.propertyName]()\n }\n } else {\n if (entity[propertyPath])\n this.callEntityEmbeddedMethod(\n entity[propertyPath],\n propertyPaths,\n )\n }\n }\n}\n"],"sourceRoot":".."}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "name": "typeorm", "version": "0.3.23-dev.
|
|
1
|
+
{ "name": "typeorm", "version": "0.3.23-dev.184f463", "private": false, "description": "Data-Mapper ORM for TypeScript and ES2021+. Supports MySQL/MariaDB, PostgreSQL, MS SQL Server, Oracle, SAP HANA, SQLite, MongoDB databases.", "homepage": "https://typeorm.io", "bugs": { "url": "https://github.com/typeorm/typeorm/issues" }, "repository": { "type": "git", "url": "https://github.com/typeorm/typeorm.git" }, "funding": "https://opencollective.com/typeorm", "license": "MIT", "author": { "name": "Umed Khudoiberdiev", "email": "pleerock.me@gmail.com" }, "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", "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/mongodb/bson.typings.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/typings.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" }, "types": "./index.d.ts", "bin": { "typeorm": "./cli.js", "typeorm-ts-node-commonjs": "./cli-ts-node-commonjs.js", "typeorm-ts-node-esm": "./cli-ts-node-esm.js" }, "scripts": { "changelog": "standard-changelog", "compile": "rimraf ./build && tsc", "format": "prettier --cache --write \"./**/*.ts\"", "format:ci": "prettier --check \"./**/*.ts\"", "lint": "eslint .", "pack": "gulp pack", "package": "gulp package", "test": "npm run compile && npm run test:fast --", "test:ci": "mocha --bail", "test:fast": "mocha", "watch": "tsc --watch" }, "dependencies": { "@sqltools/formatter": "^1.2.5", "ansis": "^3.17.0", "app-root-path": "^3.1.0", "buffer": "^6.0.3", "dayjs": "^1.11.13", "debug": "^4.4.0", "dotenv": "^16.4.7", "glob": "^10.4.5", "sha.js": "^2.4.11", "sql-highlight": "^6.0.0", "tslib": "^2.8.1", "uuid": "^11.1.0", "yargs": "^17.7.2" }, "devDependencies": { "@eslint/js": "^9.22.0", "@sap/hana-client": "^2.24.21", "@tsconfig/node16": "^16.1.3", "@types/chai": "^4.3.20", "@types/chai-as-promised": "^7.1.8", "@types/debug": "^4.1.12", "@types/gulp-rename": "^2.0.6", "@types/gulp-sourcemaps": "^0.0.38", "@types/mocha": "^10.0.10", "@types/node": "^16.18.126", "@types/sha.js": "^2.4.4", "@types/sinon": "^10.0.20", "@types/sinon-chai": "^4.0.0", "@types/source-map-support": "^0.5.10", "@types/yargs": "^17.0.33", "better-sqlite3": "^8.7.0", "chai": "^4.5.0", "chai-as-promised": "^7.1.2", "class-transformer": "^0.5.1", "eslint": "^9.22.0", "globals": "^16.0.0", "gulp": "^4.0.2", "gulp-rename": "^2.0.0", "gulp-replace": "^1.1.4", "gulp-shell": "^0.8.0", "gulp-sourcemaps": "^3.0.0", "gulp-typescript": "^6.0.0-alpha.1", "gulpclass": "^0.2.0", "hdb-pool": "^0.1.6", "mocha": "^10.8.2", "mongodb": "^6.15.0", "mssql": "^11.0.1", "mysql": "^2.18.1", "mysql2": "^3.14.0", "nyc": "^17.1.0", "oracledb": "^6.8.0", "pg": "^8.14.1", "pg-query-stream": "^4.8.1", "prettier": "^2.8.8", "redis": "^4.7.0", "remap-istanbul": "^0.13.0", "rimraf": "^5.0.10", "sinon": "^15.2.0", "sinon-chai": "^3.7.0", "source-map-support": "^0.5.21", "sql.js": "^1.13.0", "sqlite3": "^5.1.7", "standard-changelog": "^6.0.0", "ts-node": "^10.9.2", "typescript": "^5.8.2", "typescript-eslint": "^8.27.0" }, "peerDependencies": { "@google-cloud/spanner": "^5.18.0 || ^6.0.0 || ^7.0.0", "@sap/hana-client": "^2.12.25", "better-sqlite3": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0", "hdb-pool": "^0.1.6", "ioredis": "^5.0.4", "mongodb": "^5.8.0 || ^6.0.0", "mssql": "^9.1.1 || ^10.0.1 || ^11.0.1", "mysql2": "^2.2.5 || ^3.0.1", "oracledb": "^6.3.0", "pg": "^8.5.1", "pg-native": "^3.0.0", "pg-query-stream": "^4.0.0", "redis": "^3.1.1 || ^4.0.0", "reflect-metadata": "^0.1.14 || ^0.2.0", "sql.js": "^1.4.0", "sqlite3": "^5.0.3", "ts-node": "^10.7.0", "typeorm-aurora-data-api-driver": "^2.0.0 || ^3.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 } }, "engines": { "node": ">=16.13.0" }, "collective": { "type": "opencollective", "url": "https://opencollective.com/typeorm", "logo": "https://opencollective.com/opencollective/logo.txt" }, "readmeFilename": "README.md", "tags": [ "orm", "typescript", "typescript-orm", "mariadb", "mariadb-orm", "mysql", "mysql-orm", "oracle", "oracle-orm", "postgresql", "postgresql-orm", "sap-hana", "sap-hana-orm", "spanner", "cloud-spanner", "cloud-spanner-orm", "sqlite", "sqlite-orm", "sql-server", "sql-server-orm" ] }
|
|
@@ -25,6 +25,8 @@ export interface UpdateEvent<Entity> {
|
|
|
25
25
|
manager: EntityManager;
|
|
26
26
|
/**
|
|
27
27
|
* Updating entity.
|
|
28
|
+
*
|
|
29
|
+
* Contains the same data that was passed to the updating method, be it the instance of an entity or the partial entity.
|
|
28
30
|
*/
|
|
29
31
|
entity: ObjectLiteral | undefined;
|
|
30
32
|
/**
|
|
@@ -33,6 +35,8 @@ export interface UpdateEvent<Entity> {
|
|
|
33
35
|
metadata: EntityMetadata;
|
|
34
36
|
/**
|
|
35
37
|
* Updating entity in the database.
|
|
38
|
+
*
|
|
39
|
+
* Is set only when one of the following methods are used: .save(), .remove(), .softRemove(), and .recover()
|
|
36
40
|
*/
|
|
37
41
|
databaseEntity: Entity;
|
|
38
42
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/subscriber/event/UpdateEvent.ts"],"names":[],"mappings":"","file":"UpdateEvent.js","sourcesContent":["import { ColumnMetadata } from \"../../metadata/ColumnMetadata\"\nimport { RelationMetadata } from \"../../metadata/RelationMetadata\"\nimport { EntityManager } from \"../../entity-manager/EntityManager\"\nimport { QueryRunner } from \"../../query-runner/QueryRunner\"\nimport { DataSource } from \"../../data-source/DataSource\"\nimport { EntityMetadata } from \"../../metadata/EntityMetadata\"\nimport { ObjectLiteral } from \"../../common/ObjectLiteral\"\n\n/**\n * UpdateEvent is an object that broadcaster sends to the entity subscriber when entity is being updated in the database.\n */\nexport interface UpdateEvent<Entity> {\n /**\n * Connection used in the event.\n */\n connection: DataSource\n\n /**\n * QueryRunner used in the event transaction.\n * All database operations in the subscribed event listener should be performed using this query runner instance.\n */\n queryRunner: QueryRunner\n\n /**\n * EntityManager used in the event transaction.\n * All database operations in the subscribed event listener should be performed using this entity manager instance.\n */\n manager: EntityManager\n\n /**\n * Updating entity.\n */\n entity: ObjectLiteral | undefined\n\n /**\n * Metadata of the entity.\n */\n metadata: EntityMetadata\n\n /**\n * Updating entity in the database.\n */\n databaseEntity: Entity\n\n /**\n * List of updated columns. In query builder has no affected\n */\n updatedColumns: ColumnMetadata[]\n\n /**\n * List of updated relations. In query builder has no affected\n */\n updatedRelations: RelationMetadata[]\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../../src/subscriber/event/UpdateEvent.ts"],"names":[],"mappings":"","file":"UpdateEvent.js","sourcesContent":["import { ColumnMetadata } from \"../../metadata/ColumnMetadata\"\nimport { RelationMetadata } from \"../../metadata/RelationMetadata\"\nimport { EntityManager } from \"../../entity-manager/EntityManager\"\nimport { QueryRunner } from \"../../query-runner/QueryRunner\"\nimport { DataSource } from \"../../data-source/DataSource\"\nimport { EntityMetadata } from \"../../metadata/EntityMetadata\"\nimport { ObjectLiteral } from \"../../common/ObjectLiteral\"\n\n/**\n * UpdateEvent is an object that broadcaster sends to the entity subscriber when entity is being updated in the database.\n */\nexport interface UpdateEvent<Entity> {\n /**\n * Connection used in the event.\n */\n connection: DataSource\n\n /**\n * QueryRunner used in the event transaction.\n * All database operations in the subscribed event listener should be performed using this query runner instance.\n */\n queryRunner: QueryRunner\n\n /**\n * EntityManager used in the event transaction.\n * All database operations in the subscribed event listener should be performed using this entity manager instance.\n */\n manager: EntityManager\n\n /**\n * Updating entity.\n *\n * Contains the same data that was passed to the updating method, be it the instance of an entity or the partial entity.\n */\n entity: ObjectLiteral | undefined\n\n /**\n * Metadata of the entity.\n */\n metadata: EntityMetadata\n\n /**\n * Updating entity in the database.\n *\n * Is set only when one of the following methods are used: .save(), .remove(), .softRemove(), and .recover()\n */\n databaseEntity: Entity\n\n /**\n * List of updated columns. In query builder has no affected\n */\n updatedColumns: ColumnMetadata[]\n\n /**\n * List of updated relations. In query builder has no affected\n */\n updatedRelations: RelationMetadata[]\n}\n"],"sourceRoot":"../.."}
|