typeorm 0.3.18-dev.a909d5b → 0.3.18-dev.aa8d24c
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 +23 -23
- package/browser/driver/DriverUtils.js +2 -5
- package/browser/driver/DriverUtils.js.map +1 -1
- package/browser/driver/mongodb/MongoQueryRunner.d.ts +3 -3
- package/browser/driver/mongodb/MongoQueryRunner.js.map +1 -1
- package/browser/driver/mongodb/typings.d.ts +3 -3
- package/browser/driver/mongodb/typings.js.map +1 -1
- package/browser/driver/oracle/OracleQueryRunner.js +34 -2
- package/browser/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/browser/driver/postgres/PostgresQueryRunner.js +20 -12
- package/browser/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/browser/driver/sap/SapDriver.d.ts +8 -0
- package/browser/driver/sap/SapDriver.js +14 -3
- package/browser/driver/sap/SapDriver.js.map +1 -1
- package/browser/driver/sap/SapQueryRunner.d.ts +5 -14
- package/browser/driver/sap/SapQueryRunner.js +53 -55
- package/browser/driver/sap/SapQueryRunner.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerConnectionCredentialsOptions.d.ts +2 -1
- package/browser/driver/sqlserver/SqlServerConnectionCredentialsOptions.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerConnectionOptions.d.ts +5 -0
- package/browser/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerQueryRunner.js +13 -0
- package/browser/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
- package/browser/driver/sqlserver/authentication/AzureActiveDirectoryDefaultAuthentication.d.ts +12 -0
- package/browser/driver/sqlserver/authentication/AzureActiveDirectoryDefaultAuthentication.js +3 -0
- package/browser/driver/sqlserver/authentication/AzureActiveDirectoryDefaultAuthentication.js.map +1 -0
- package/browser/entity-manager/EntityManager.js +5 -1
- package/browser/entity-manager/EntityManager.js.map +1 -1
- package/browser/entity-manager/MongoEntityManager.d.ts +8 -4
- package/browser/entity-manager/MongoEntityManager.js +7 -0
- package/browser/entity-manager/MongoEntityManager.js.map +1 -1
- package/browser/entity-schema/EntitySchemaOptions.d.ts +4 -0
- package/browser/entity-schema/EntitySchemaOptions.js.map +1 -1
- package/browser/entity-schema/EntitySchemaTransformer.js +7 -0
- package/browser/entity-schema/EntitySchemaTransformer.js.map +1 -1
- package/browser/error/QueryFailedError.d.ts +3 -3
- package/browser/error/QueryFailedError.js.map +1 -1
- package/browser/find-options/FindOptionsUtils.js +1 -1
- package/browser/find-options/FindOptionsUtils.js.map +1 -1
- package/browser/find-options/FindOptionsWhere.d.ts +1 -1
- package/browser/find-options/FindOptionsWhere.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/metadata-builder/EntityMetadataBuilder.js +13 -0
- package/browser/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/browser/naming-strategy/DefaultNamingStrategy.d.ts +0 -1
- package/browser/naming-strategy/DefaultNamingStrategy.js +0 -3
- package/browser/naming-strategy/DefaultNamingStrategy.js.map +1 -1
- package/browser/naming-strategy/NamingStrategyInterface.d.ts +0 -4
- package/browser/naming-strategy/NamingStrategyInterface.js.map +1 -1
- package/browser/persistence/Subject.js +2 -1
- package/browser/persistence/Subject.js.map +1 -1
- package/browser/persistence/SubjectExecutor.js +1 -1
- package/browser/persistence/SubjectExecutor.js.map +1 -1
- package/browser/persistence/subject-builder/ManyToManySubjectBuilder.js +6 -2
- package/browser/persistence/subject-builder/ManyToManySubjectBuilder.js.map +1 -1
- package/browser/platform/PlatformTools.js +2 -0
- package/browser/platform/PlatformTools.js.map +1 -1
- package/browser/query-builder/QueryBuilder.js +1 -1
- package/browser/query-builder/QueryBuilder.js.map +1 -1
- package/browser/query-builder/SelectQueryBuilder.js +4 -1
- package/browser/query-builder/SelectQueryBuilder.js.map +1 -1
- package/browser/repository/MongoRepository.d.ts +8 -4
- package/browser/repository/MongoRepository.js +6 -0
- package/browser/repository/MongoRepository.js.map +1 -1
- package/browser/repository/Repository.d.ts +1 -1
- package/browser/repository/Repository.js +9 -5
- package/browser/repository/Repository.js.map +1 -1
- package/browser/subscriber/Broadcaster.d.ts +1 -1
- package/browser/subscriber/Broadcaster.js +2 -1
- package/browser/subscriber/Broadcaster.js.map +1 -1
- package/browser/subscriber/event/InsertEvent.d.ts +5 -0
- package/browser/subscriber/event/InsertEvent.js.map +1 -1
- package/commands/CommandUtils.js +6 -1
- package/commands/CommandUtils.js.map +1 -1
- package/commands/EntityCreateCommand.d.ts +3 -0
- package/commands/EntityCreateCommand.js +7 -0
- package/commands/EntityCreateCommand.js.map +1 -1
- package/commands/InitCommand.js +1 -1
- package/commands/InitCommand.js.map +1 -1
- package/commands/MigrationCreateCommand.d.ts +5 -1
- package/commands/MigrationCreateCommand.js +6 -1
- package/commands/MigrationCreateCommand.js.map +1 -1
- package/commands/MigrationGenerateCommand.d.ts +5 -1
- package/commands/MigrationGenerateCommand.js +8 -1
- package/commands/MigrationGenerateCommand.js.map +1 -1
- package/commands/SubscriberCreateCommand.d.ts +3 -0
- package/commands/SubscriberCreateCommand.js +7 -0
- package/commands/SubscriberCreateCommand.js.map +1 -1
- package/driver/DriverUtils.js +2 -5
- package/driver/DriverUtils.js.map +1 -1
- package/driver/mongodb/MongoQueryRunner.d.ts +3 -3
- package/driver/mongodb/MongoQueryRunner.js.map +1 -1
- package/driver/mongodb/typings.d.ts +3 -3
- package/driver/mongodb/typings.js.map +1 -1
- package/driver/oracle/OracleQueryRunner.js +34 -2
- package/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/driver/postgres/PostgresQueryRunner.js +20 -12
- package/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/driver/sap/SapDriver.d.ts +8 -0
- package/driver/sap/SapDriver.js +15 -4
- package/driver/sap/SapDriver.js.map +1 -1
- package/driver/sap/SapQueryRunner.d.ts +5 -14
- package/driver/sap/SapQueryRunner.js +53 -55
- package/driver/sap/SapQueryRunner.js.map +1 -1
- package/driver/sqlserver/SqlServerConnectionCredentialsOptions.d.ts +2 -1
- package/driver/sqlserver/SqlServerConnectionCredentialsOptions.js.map +1 -1
- package/driver/sqlserver/SqlServerConnectionOptions.d.ts +5 -0
- package/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
- package/driver/sqlserver/SqlServerQueryRunner.js +13 -0
- package/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
- package/driver/sqlserver/authentication/AzureActiveDirectoryDefaultAuthentication.d.ts +12 -0
- package/driver/sqlserver/authentication/AzureActiveDirectoryDefaultAuthentication.js +4 -0
- package/driver/sqlserver/authentication/AzureActiveDirectoryDefaultAuthentication.js.map +1 -0
- package/entity-manager/EntityManager.js +5 -1
- package/entity-manager/EntityManager.js.map +1 -1
- package/entity-manager/MongoEntityManager.d.ts +8 -4
- package/entity-manager/MongoEntityManager.js +7 -0
- package/entity-manager/MongoEntityManager.js.map +1 -1
- package/entity-schema/EntitySchemaOptions.d.ts +4 -0
- package/entity-schema/EntitySchemaOptions.js.map +1 -1
- package/entity-schema/EntitySchemaTransformer.js +7 -0
- package/entity-schema/EntitySchemaTransformer.js.map +1 -1
- package/error/QueryFailedError.d.ts +3 -3
- package/error/QueryFailedError.js.map +1 -1
- package/find-options/FindOptionsUtils.js +1 -1
- package/find-options/FindOptionsUtils.js.map +1 -1
- package/find-options/FindOptionsWhere.d.ts +1 -1
- package/find-options/FindOptionsWhere.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/index.mjs +2 -0
- package/metadata-builder/EntityMetadataBuilder.js +13 -0
- package/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/naming-strategy/DefaultNamingStrategy.d.ts +0 -1
- package/naming-strategy/DefaultNamingStrategy.js +0 -3
- package/naming-strategy/DefaultNamingStrategy.js.map +1 -1
- package/naming-strategy/NamingStrategyInterface.d.ts +0 -4
- package/naming-strategy/NamingStrategyInterface.js.map +1 -1
- package/package.json +1 -1
- package/persistence/Subject.js +2 -1
- package/persistence/Subject.js.map +1 -1
- package/persistence/SubjectExecutor.js +1 -1
- package/persistence/SubjectExecutor.js.map +1 -1
- package/persistence/subject-builder/ManyToManySubjectBuilder.js +6 -2
- package/persistence/subject-builder/ManyToManySubjectBuilder.js.map +1 -1
- package/platform/PlatformTools.js +2 -0
- package/platform/PlatformTools.js.map +1 -1
- package/query-builder/QueryBuilder.js +1 -1
- package/query-builder/QueryBuilder.js.map +1 -1
- package/query-builder/SelectQueryBuilder.js +4 -1
- package/query-builder/SelectQueryBuilder.js.map +1 -1
- package/repository/MongoRepository.d.ts +8 -4
- package/repository/MongoRepository.js +6 -0
- package/repository/MongoRepository.js.map +1 -1
- package/repository/Repository.d.ts +1 -1
- package/repository/Repository.js +9 -5
- package/repository/Repository.js.map +1 -1
- package/subscriber/Broadcaster.d.ts +1 -1
- package/subscriber/Broadcaster.js +2 -1
- package/subscriber/Broadcaster.js.map +1 -1
- package/subscriber/event/InsertEvent.d.ts +5 -0
- package/subscriber/event/InsertEvent.js.map +1 -1
- package/typeorm-model-shim.js +61 -53
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/subscriber/Broadcaster.ts"],"names":[],"mappings":";;;AAIA,2DAAuD;AAGvD,qDAAiD;AAsEjD;;GAEG;AACH,MAAa,WAAW;IACpB,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,YAAoB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAEhD,4EAA4E;IAC5E,iBAAiB;IACjB,4EAA4E;IAE5E,KAAK,CAAC,SAAS,CACX,KAAQ,EACR,GAAG,IAAsC;QAEzC,MAAM,MAAM,GAAG,IAAI,qCAAiB,EAAE,CAAA;QAEtC,MAAM,iBAAiB,GAAG,IAAI,CAAC,YAAY,KAAK,OAAqB,CAAC,CAAA;QAEtE,IAAI,OAAO,iBAAiB,KAAK,UAAU,EAAE;Y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EzB,OAAO,CACH,CAAC,UAAU,CAAC,QAAQ;YACpB,CAAC,UAAU,CAAC,QAAQ,EAAE;YACtB,UAAU,CAAC,QAAQ,EAAE,KAAK,MAAM;YAChC,UAAU,CAAC,QAAQ,EAAE,KAAK,MAAM;YAChC,UAAU,CAAC,QAAQ,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,CAC9C,CAAA;IACL,CAAC;CACJ;AA1vBD,kCA0vBC","file":"Broadcaster.js","sourcesContent":["import { EntitySubscriberInterface } from \"./EntitySubscriberInterface\"\nimport { ObjectLiteral } from \"../common/ObjectLiteral\"\nimport { QueryRunner } from \"../query-runner/QueryRunner\"\nimport { EntityMetadata } from \"../metadata/EntityMetadata\"\nimport { BroadcasterResult } from \"./BroadcasterResult\"\nimport { ColumnMetadata } from \"../metadata/ColumnMetadata\"\nimport { RelationMetadata } from \"../metadata/RelationMetadata\"\nimport { ObjectUtils } from \"../util/ObjectUtils\"\n\ninterface BroadcasterEvents {\n BeforeTransactionCommit: () => void\n AfterTransactionCommit: () => void\n BeforeTransactionStart: () => void\n AfterTransactionStart: () => void\n BeforeTransactionRollback: () => void\n AfterTransactionRollback: () => void\n\n BeforeUpdate: (\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n updatedColumns?: ColumnMetadata[],\n updatedRelations?: RelationMetadata[],\n ) => void\n AfterUpdate: (\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n updatedColumns?: ColumnMetadata[],\n updatedRelations?: RelationMetadata[],\n ) => void\n\n BeforeInsert: (\n metadata: EntityMetadata,\n entity: ObjectLiteral | undefined,\n ) => void\n AfterInsert: (\n metadata: EntityMetadata,\n entity: ObjectLiteral | undefined,\n ) => void\n\n BeforeRemove: (\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n ) => void\n AfterRemove: (\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n ) => void\n\n BeforeSoftRemove: (\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n ) => void\n AfterSoftRemove: (\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n ) => void\n\n BeforeRecover: (\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n ) => void\n AfterRecover: (\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n ) => void\n\n Load: (metadata: EntityMetadata, entities: ObjectLiteral[]) => void\n}\n\n/**\n * Broadcaster provides a helper methods to broadcast events to the subscribers.\n */\nexport class Broadcaster {\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(private queryRunner: QueryRunner) {}\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n async broadcast<U extends keyof BroadcasterEvents>(\n event: U,\n ...args: Parameters<BroadcasterEvents[U]>\n ): Promise<void> {\n const result = new BroadcasterResult()\n\n const broadcastFunction = this[`broadcast${event}Event` as keyof this]\n\n if (typeof broadcastFunction === \"function\") {\n ;(broadcastFunction as any).call(this, result, ...args)\n }\n\n await result.wait()\n }\n\n /**\n * Broadcasts \"BEFORE_INSERT\" event.\n * Before insert event is executed before entity is being inserted to the database for the first time.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastBeforeInsertEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity: undefined | ObjectLiteral,\n ): void {\n if (entity && metadata.beforeInsertListeners.length) {\n metadata.beforeInsertListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.beforeInsert\n ) {\n const executionResult = subscriber.beforeInsert({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"BEFORE_UPDATE\" event.\n * Before update event is executed before entity is being updated in the database.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastBeforeUpdateEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n updatedColumns?: ColumnMetadata[],\n updatedRelations?: RelationMetadata[],\n ): void {\n // todo: send relations too?\n if (entity && metadata.beforeUpdateListeners.length) {\n metadata.beforeUpdateListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.beforeUpdate\n ) {\n const executionResult = subscriber.beforeUpdate({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n databaseEntity: databaseEntity,\n updatedColumns: updatedColumns || [],\n updatedRelations: updatedRelations || [],\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"BEFORE_REMOVE\" event.\n * Before remove event is executed before entity is being removed from the database.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastBeforeRemoveEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n identifier?: ObjectLiteral,\n ): void {\n if (entity && metadata.beforeRemoveListeners.length) {\n metadata.beforeRemoveListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.beforeRemove\n ) {\n const executionResult = subscriber.beforeRemove({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n databaseEntity: databaseEntity,\n entityId: metadata.getEntityIdMixedMap(\n databaseEntity ?? identifier,\n ),\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"BEFORE_SOFT_REMOVE\" event.\n * Before soft remove event is executed before entity is being soft removed from the database.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastBeforeSoftRemoveEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n identifier?: ObjectLiteral,\n ): void {\n if (entity && metadata.beforeSoftRemoveListeners.length) {\n metadata.beforeSoftRemoveListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.beforeSoftRemove\n ) {\n const executionResult = subscriber.beforeSoftRemove({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n databaseEntity: databaseEntity,\n entityId: metadata.getEntityIdMixedMap(\n databaseEntity ?? identifier,\n ),\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"BEFORE_RECOVER\" event.\n * Before recover event is executed before entity is being recovered in the database.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastBeforeRecoverEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n identifier?: ObjectLiteral,\n ): void {\n if (entity && metadata.beforeRecoverListeners.length) {\n metadata.beforeRecoverListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.beforeRecover\n ) {\n const executionResult = subscriber.beforeRecover({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n databaseEntity: databaseEntity,\n entityId: metadata.getEntityIdMixedMap(\n databaseEntity ?? identifier,\n ),\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"AFTER_INSERT\" event.\n * After insert event is executed after entity is being persisted to the database for the first time.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastAfterInsertEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n ): void {\n if (entity && metadata.afterInsertListeners.length) {\n metadata.afterInsertListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.afterInsert\n ) {\n const executionResult = subscriber.afterInsert({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"BEFORE_TRANSACTION_START\" event.\n */\n broadcastBeforeTransactionStartEvent(result: BroadcasterResult): void {\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (subscriber.beforeTransactionStart) {\n const executionResult = subscriber.beforeTransactionStart({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"AFTER_TRANSACTION_START\" event.\n */\n broadcastAfterTransactionStartEvent(result: BroadcasterResult): void {\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (subscriber.afterTransactionStart) {\n const executionResult = subscriber.afterTransactionStart({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"BEFORE_TRANSACTION_COMMIT\" event.\n */\n broadcastBeforeTransactionCommitEvent(result: BroadcasterResult): void {\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (subscriber.beforeTransactionCommit) {\n const executionResult = subscriber.beforeTransactionCommit({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"AFTER_TRANSACTION_COMMIT\" event.\n */\n broadcastAfterTransactionCommitEvent(result: BroadcasterResult): void {\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (subscriber.afterTransactionCommit) {\n const executionResult = subscriber.afterTransactionCommit({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"BEFORE_TRANSACTION_ROLLBACK\" event.\n */\n broadcastBeforeTransactionRollbackEvent(result: BroadcasterResult): void {\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (subscriber.beforeTransactionRollback) {\n const executionResult =\n subscriber.beforeTransactionRollback({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"AFTER_TRANSACTION_ROLLBACK\" event.\n */\n broadcastAfterTransactionRollbackEvent(result: BroadcasterResult): void {\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (subscriber.afterTransactionRollback) {\n const executionResult = subscriber.afterTransactionRollback(\n {\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n },\n )\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"AFTER_UPDATE\" event.\n * After update event is executed after entity is being updated in the database.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastAfterUpdateEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n updatedColumns?: ColumnMetadata[],\n updatedRelations?: RelationMetadata[],\n ): void {\n if (entity && metadata.afterUpdateListeners.length) {\n metadata.afterUpdateListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.afterUpdate\n ) {\n const executionResult = subscriber.afterUpdate({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n databaseEntity: databaseEntity,\n updatedColumns: updatedColumns || [],\n updatedRelations: updatedRelations || [],\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"AFTER_REMOVE\" event.\n * After remove event is executed after entity is being removed from the database.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastAfterRemoveEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n identifier?: ObjectLiteral,\n ): void {\n if (entity && metadata.afterRemoveListeners.length) {\n metadata.afterRemoveListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.afterRemove\n ) {\n const executionResult = subscriber.afterRemove({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n databaseEntity: databaseEntity,\n entityId: metadata.getEntityIdMixedMap(\n databaseEntity ?? identifier,\n ),\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"AFTER_SOFT_REMOVE\" event.\n * After soft remove event is executed after entity is being soft removed from the database.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastAfterSoftRemoveEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n identifier?: ObjectLiteral,\n ): void {\n if (entity && metadata.afterSoftRemoveListeners.length) {\n metadata.afterSoftRemoveListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.afterSoftRemove\n ) {\n const executionResult = subscriber.afterSoftRemove({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n databaseEntity: databaseEntity,\n entityId: metadata.getEntityIdMixedMap(\n databaseEntity ?? identifier,\n ),\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"AFTER_RECOVER\" event.\n * After recover event is executed after entity is being recovered in the database.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastAfterRecoverEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n identifier?: ObjectLiteral,\n ): void {\n if (entity && metadata.afterRecoverListeners.length) {\n metadata.afterRecoverListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.afterRecover\n ) {\n const executionResult = subscriber.afterRecover({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n databaseEntity: databaseEntity,\n entityId: metadata.getEntityIdMixedMap(\n databaseEntity ?? identifier,\n ),\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * @deprecated Use `broadcastLoadForAllEvent`\n */\n broadcastLoadEventsForAll(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entities: ObjectLiteral[],\n ): void {\n return this.broadcastLoadEvent(result, metadata, entities)\n }\n\n /**\n * Broadcasts \"AFTER_LOAD\" event for all given entities, and their sub-entities.\n * After load event is executed after entity has been loaded from the database.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastLoadEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entities: ObjectLiteral[],\n ): void {\n // Calculate which subscribers are fitting for the given entity type\n const fittingSubscribers =\n this.queryRunner.connection.subscribers.filter(\n (subscriber) =>\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.afterLoad,\n )\n\n if (\n metadata.relations.length ||\n metadata.afterLoadListeners.length ||\n fittingSubscribers.length\n ) {\n // todo: check why need this?\n const nonPromiseEntities = entities.filter(\n (entity) => !(entity instanceof Promise),\n )\n\n // collect load events for all children entities that were loaded with the main entity\n if (metadata.relations.length) {\n metadata.relations.forEach((relation) => {\n nonPromiseEntities.forEach((entity) => {\n // in lazy relations we cannot simply access to entity property because it will cause a getter and a database query\n if (\n relation.isLazy &&\n !entity.hasOwnProperty(relation.propertyName)\n )\n return\n\n const value = relation.getEntityValue(entity)\n if (ObjectUtils.isObject(value))\n this.broadcastLoadEvent(\n result,\n relation.inverseEntityMetadata,\n Array.isArray(value) ? value : [value],\n )\n })\n })\n }\n\n if (metadata.afterLoadListeners.length) {\n metadata.afterLoadListeners.forEach((listener) => {\n nonPromiseEntities.forEach((entity) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n })\n }\n\n fittingSubscribers.forEach((subscriber) => {\n nonPromiseEntities.forEach((entity) => {\n const executionResult = subscriber.afterLoad!(entity, {\n entity,\n metadata,\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n })\n })\n }\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Checks if subscriber's methods can be executed by checking if its don't listen to the particular entity,\n * or listens our entity.\n */\n protected isAllowedSubscriber(\n subscriber: EntitySubscriberInterface<any>,\n target: Function | string,\n ): boolean {\n return (\n !subscriber.listenTo ||\n !subscriber.listenTo() ||\n subscriber.listenTo() === Object ||\n subscriber.listenTo() === target ||\n subscriber.listenTo().isPrototypeOf(target)\n )\n }\n}\n"],"sourceRoot":".."}
|
|
1
|
+
{"version":3,"sources":["../../src/subscriber/Broadcaster.ts"],"names":[],"mappings":";;;AAIA,2DAAuD;AAGvD,qDAAiD;AAsEjD;;GAEG;AACH,MAAa,WAAW;IACpB,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,YAAoB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAEhD,4EAA4E;IAC5E,iBAAiB;IACjB,4EAA4E;IAE5E,KAAK,CAAC,SAAS,CACX,KAAQ,EACR,GAAG,IAAsC;QAEzC,MAAM,MAAM,GAAG,IAAI,qCAAiB,EAAE,CAAA;QAEtC,MAAM,iBAAiB,GAAG,IAAI,CAAC,YAAY,KAAK,OAAqB,CAAC,CAAA;QAEtE,IAAI,OAAO,iBAAiB,KAAK,UAAU,EAAE;YACzC,CAAC;YAAC,iBAAyB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,CAAA;SAC1D;QAED,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;IACvB,CAAC;IAED;;;;;;;OAOG;IACH,0BAA0B,CACtB,MAAyB,EACzB,QAAwB,EACxB,MAAiC;QAEjC,IAAI,MAAM,IAAI,QAAQ,CAAC,qBAAqB,CAAC,MAAM,EAAE;YACjD,QAAQ,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;gBAChD,IAAI,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;oBAC5B,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;oBAChD,IAAI,eAAe,YAAY,OAAO;wBAClC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;oBACzC,MAAM,CAAC,KAAK,EAAE,CAAA;iBACjB;YAC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BACN,CAAC,CAAC,CAAA;aACL;YAED,kBAAkB,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;gBACtC,kBAAkB,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;oBAClC,MAAM,eAAe,GAAG,UAAU,CAAC,SAAU,CAAC,MAAM,EAAE;wBAClD,MAAM;wBACN,QAAQ;wBACR,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,UAAU;wBACvC,WAAW,EAAE,IAAI,CAAC,WAAW;wBAC7B,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,OAAO;qBACpC,CAAC,CAAA;oBACF,IAAI,eAAe,YAAY,OAAO;wBAClC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;oBACzC,MAAM,CAAC,KAAK,EAAE,CAAA;gBAClB,CAAC,CAAC,CAAA;YACN,CAAC,CAAC,CAAA;SACL;IACL,CAAC;IAED,4EAA4E;IAC5E,oBAAoB;IACpB,4EAA4E;IAE5E;;;OAGG;IACO,mBAAmB,CACzB,UAA0C,EAC1C,MAAyB;QAEzB,OAAO,CACH,CAAC,UAAU,CAAC,QAAQ;YACpB,CAAC,UAAU,CAAC,QAAQ,EAAE;YACtB,UAAU,CAAC,QAAQ,EAAE,KAAK,MAAM;YAChC,UAAU,CAAC,QAAQ,EAAE,KAAK,MAAM;YAChC,UAAU,CAAC,QAAQ,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,CAC9C,CAAA;IACL,CAAC;CACJ;AA5vBD,kCA4vBC","file":"Broadcaster.js","sourcesContent":["import { EntitySubscriberInterface } from \"./EntitySubscriberInterface\"\nimport { ObjectLiteral } from \"../common/ObjectLiteral\"\nimport { QueryRunner } from \"../query-runner/QueryRunner\"\nimport { EntityMetadata } from \"../metadata/EntityMetadata\"\nimport { BroadcasterResult } from \"./BroadcasterResult\"\nimport { ColumnMetadata } from \"../metadata/ColumnMetadata\"\nimport { RelationMetadata } from \"../metadata/RelationMetadata\"\nimport { ObjectUtils } from \"../util/ObjectUtils\"\n\ninterface BroadcasterEvents {\n BeforeTransactionCommit: () => void\n AfterTransactionCommit: () => void\n BeforeTransactionStart: () => void\n AfterTransactionStart: () => void\n BeforeTransactionRollback: () => void\n AfterTransactionRollback: () => void\n\n BeforeUpdate: (\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n updatedColumns?: ColumnMetadata[],\n updatedRelations?: RelationMetadata[],\n ) => void\n AfterUpdate: (\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n updatedColumns?: ColumnMetadata[],\n updatedRelations?: RelationMetadata[],\n ) => void\n\n BeforeInsert: (\n metadata: EntityMetadata,\n entity: ObjectLiteral | undefined,\n ) => void\n AfterInsert: (\n metadata: EntityMetadata,\n entity: ObjectLiteral | undefined,\n ) => void\n\n BeforeRemove: (\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n ) => void\n AfterRemove: (\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n ) => void\n\n BeforeSoftRemove: (\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n ) => void\n AfterSoftRemove: (\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n ) => void\n\n BeforeRecover: (\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n ) => void\n AfterRecover: (\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n ) => void\n\n Load: (metadata: EntityMetadata, entities: ObjectLiteral[]) => void\n}\n\n/**\n * Broadcaster provides a helper methods to broadcast events to the subscribers.\n */\nexport class Broadcaster {\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(private queryRunner: QueryRunner) {}\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n async broadcast<U extends keyof BroadcasterEvents>(\n event: U,\n ...args: Parameters<BroadcasterEvents[U]>\n ): Promise<void> {\n const result = new BroadcasterResult()\n\n const broadcastFunction = this[`broadcast${event}Event` as keyof this]\n\n if (typeof broadcastFunction === \"function\") {\n ;(broadcastFunction as any).call(this, result, ...args)\n }\n\n await result.wait()\n }\n\n /**\n * Broadcasts \"BEFORE_INSERT\" event.\n * Before insert event is executed before entity is being inserted to the database for the first time.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastBeforeInsertEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity: undefined | ObjectLiteral,\n ): void {\n if (entity && metadata.beforeInsertListeners.length) {\n metadata.beforeInsertListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.beforeInsert\n ) {\n const executionResult = subscriber.beforeInsert({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"BEFORE_UPDATE\" event.\n * Before update event is executed before entity is being updated in the database.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastBeforeUpdateEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n updatedColumns?: ColumnMetadata[],\n updatedRelations?: RelationMetadata[],\n ): void {\n // todo: send relations too?\n if (entity && metadata.beforeUpdateListeners.length) {\n metadata.beforeUpdateListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.beforeUpdate\n ) {\n const executionResult = subscriber.beforeUpdate({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n databaseEntity: databaseEntity,\n updatedColumns: updatedColumns || [],\n updatedRelations: updatedRelations || [],\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"BEFORE_REMOVE\" event.\n * Before remove event is executed before entity is being removed from the database.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastBeforeRemoveEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n identifier?: ObjectLiteral,\n ): void {\n if (entity && metadata.beforeRemoveListeners.length) {\n metadata.beforeRemoveListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.beforeRemove\n ) {\n const executionResult = subscriber.beforeRemove({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n databaseEntity: databaseEntity,\n entityId: metadata.getEntityIdMixedMap(\n databaseEntity ?? identifier,\n ),\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"BEFORE_SOFT_REMOVE\" event.\n * Before soft remove event is executed before entity is being soft removed from the database.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastBeforeSoftRemoveEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n identifier?: ObjectLiteral,\n ): void {\n if (entity && metadata.beforeSoftRemoveListeners.length) {\n metadata.beforeSoftRemoveListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.beforeSoftRemove\n ) {\n const executionResult = subscriber.beforeSoftRemove({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n databaseEntity: databaseEntity,\n entityId: metadata.getEntityIdMixedMap(\n databaseEntity ?? identifier,\n ),\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"BEFORE_RECOVER\" event.\n * Before recover event is executed before entity is being recovered in the database.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastBeforeRecoverEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n identifier?: ObjectLiteral,\n ): void {\n if (entity && metadata.beforeRecoverListeners.length) {\n metadata.beforeRecoverListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.beforeRecover\n ) {\n const executionResult = subscriber.beforeRecover({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n databaseEntity: databaseEntity,\n entityId: metadata.getEntityIdMixedMap(\n databaseEntity ?? identifier,\n ),\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"AFTER_INSERT\" event.\n * After insert event is executed after entity is being persisted to the database for the first time.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastAfterInsertEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n identifier?: ObjectLiteral,\n ): void {\n if (entity && metadata.afterInsertListeners.length) {\n metadata.afterInsertListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.afterInsert\n ) {\n const executionResult = subscriber.afterInsert({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n entityId: metadata.getEntityIdMixedMap(identifier),\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"BEFORE_TRANSACTION_START\" event.\n */\n broadcastBeforeTransactionStartEvent(result: BroadcasterResult): void {\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (subscriber.beforeTransactionStart) {\n const executionResult = subscriber.beforeTransactionStart({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"AFTER_TRANSACTION_START\" event.\n */\n broadcastAfterTransactionStartEvent(result: BroadcasterResult): void {\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (subscriber.afterTransactionStart) {\n const executionResult = subscriber.afterTransactionStart({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"BEFORE_TRANSACTION_COMMIT\" event.\n */\n broadcastBeforeTransactionCommitEvent(result: BroadcasterResult): void {\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (subscriber.beforeTransactionCommit) {\n const executionResult = subscriber.beforeTransactionCommit({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"AFTER_TRANSACTION_COMMIT\" event.\n */\n broadcastAfterTransactionCommitEvent(result: BroadcasterResult): void {\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (subscriber.afterTransactionCommit) {\n const executionResult = subscriber.afterTransactionCommit({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"BEFORE_TRANSACTION_ROLLBACK\" event.\n */\n broadcastBeforeTransactionRollbackEvent(result: BroadcasterResult): void {\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (subscriber.beforeTransactionRollback) {\n const executionResult =\n subscriber.beforeTransactionRollback({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"AFTER_TRANSACTION_ROLLBACK\" event.\n */\n broadcastAfterTransactionRollbackEvent(result: BroadcasterResult): void {\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (subscriber.afterTransactionRollback) {\n const executionResult = subscriber.afterTransactionRollback(\n {\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n },\n )\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"AFTER_UPDATE\" event.\n * After update event is executed after entity is being updated in the database.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastAfterUpdateEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n updatedColumns?: ColumnMetadata[],\n updatedRelations?: RelationMetadata[],\n ): void {\n if (entity && metadata.afterUpdateListeners.length) {\n metadata.afterUpdateListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.afterUpdate\n ) {\n const executionResult = subscriber.afterUpdate({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n databaseEntity: databaseEntity,\n updatedColumns: updatedColumns || [],\n updatedRelations: updatedRelations || [],\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"AFTER_REMOVE\" event.\n * After remove event is executed after entity is being removed from the database.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastAfterRemoveEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n identifier?: ObjectLiteral,\n ): void {\n if (entity && metadata.afterRemoveListeners.length) {\n metadata.afterRemoveListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.afterRemove\n ) {\n const executionResult = subscriber.afterRemove({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n databaseEntity: databaseEntity,\n entityId: metadata.getEntityIdMixedMap(\n databaseEntity ?? identifier,\n ),\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"AFTER_SOFT_REMOVE\" event.\n * After soft remove event is executed after entity is being soft removed from the database.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastAfterSoftRemoveEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n identifier?: ObjectLiteral,\n ): void {\n if (entity && metadata.afterSoftRemoveListeners.length) {\n metadata.afterSoftRemoveListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.afterSoftRemove\n ) {\n const executionResult = subscriber.afterSoftRemove({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n databaseEntity: databaseEntity,\n entityId: metadata.getEntityIdMixedMap(\n databaseEntity ?? identifier,\n ),\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * Broadcasts \"AFTER_RECOVER\" event.\n * After recover event is executed after entity is being recovered in the database.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastAfterRecoverEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entity?: ObjectLiteral,\n databaseEntity?: ObjectLiteral,\n identifier?: ObjectLiteral,\n ): void {\n if (entity && metadata.afterRecoverListeners.length) {\n metadata.afterRecoverListeners.forEach((listener) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n\n if (this.queryRunner.connection.subscribers.length) {\n this.queryRunner.connection.subscribers.forEach((subscriber) => {\n if (\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.afterRecover\n ) {\n const executionResult = subscriber.afterRecover({\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n entity: entity,\n metadata: metadata,\n databaseEntity: databaseEntity,\n entityId: metadata.getEntityIdMixedMap(\n databaseEntity ?? identifier,\n ),\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n }\n }\n\n /**\n * @deprecated Use `broadcastLoadForAllEvent`\n */\n broadcastLoadEventsForAll(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entities: ObjectLiteral[],\n ): void {\n return this.broadcastLoadEvent(result, metadata, entities)\n }\n\n /**\n * Broadcasts \"AFTER_LOAD\" event for all given entities, and their sub-entities.\n * After load event is executed after entity has been loaded from the database.\n * All subscribers and entity listeners who listened to this event will be executed at this point.\n * Subscribers and entity listeners can return promises, it will wait until they are resolved.\n *\n * Note: this method has a performance-optimized code organization, do not change code structure.\n */\n broadcastLoadEvent(\n result: BroadcasterResult,\n metadata: EntityMetadata,\n entities: ObjectLiteral[],\n ): void {\n // Calculate which subscribers are fitting for the given entity type\n const fittingSubscribers =\n this.queryRunner.connection.subscribers.filter(\n (subscriber) =>\n this.isAllowedSubscriber(subscriber, metadata.target) &&\n subscriber.afterLoad,\n )\n\n if (\n metadata.relations.length ||\n metadata.afterLoadListeners.length ||\n fittingSubscribers.length\n ) {\n // todo: check why need this?\n const nonPromiseEntities = entities.filter(\n (entity) => !(entity instanceof Promise),\n )\n\n // collect load events for all children entities that were loaded with the main entity\n if (metadata.relations.length) {\n metadata.relations.forEach((relation) => {\n nonPromiseEntities.forEach((entity) => {\n // in lazy relations we cannot simply access to entity property because it will cause a getter and a database query\n if (\n relation.isLazy &&\n !entity.hasOwnProperty(relation.propertyName)\n )\n return\n\n const value = relation.getEntityValue(entity)\n if (ObjectUtils.isObject(value))\n this.broadcastLoadEvent(\n result,\n relation.inverseEntityMetadata,\n Array.isArray(value) ? value : [value],\n )\n })\n })\n }\n\n if (metadata.afterLoadListeners.length) {\n metadata.afterLoadListeners.forEach((listener) => {\n nonPromiseEntities.forEach((entity) => {\n if (listener.isAllowed(entity)) {\n const executionResult = listener.execute(entity)\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n }\n })\n })\n }\n\n fittingSubscribers.forEach((subscriber) => {\n nonPromiseEntities.forEach((entity) => {\n const executionResult = subscriber.afterLoad!(entity, {\n entity,\n metadata,\n connection: this.queryRunner.connection,\n queryRunner: this.queryRunner,\n manager: this.queryRunner.manager,\n })\n if (executionResult instanceof Promise)\n result.promises.push(executionResult)\n result.count++\n })\n })\n }\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Checks if subscriber's methods can be executed by checking if its don't listen to the particular entity,\n * or listens our entity.\n */\n protected isAllowedSubscriber(\n subscriber: EntitySubscriberInterface<any>,\n target: Function | string,\n ): boolean {\n return (\n !subscriber.listenTo ||\n !subscriber.listenTo() ||\n subscriber.listenTo() === Object ||\n subscriber.listenTo() === target ||\n subscriber.listenTo().isPrototypeOf(target)\n )\n }\n}\n"],"sourceRoot":".."}
|
|
@@ -2,6 +2,7 @@ import { EntityManager } from "../../entity-manager/EntityManager";
|
|
|
2
2
|
import { DataSource } from "../../data-source/DataSource";
|
|
3
3
|
import { QueryRunner } from "../../query-runner/QueryRunner";
|
|
4
4
|
import { EntityMetadata } from "../../metadata/EntityMetadata";
|
|
5
|
+
import { ObjectLiteral } from "../../common/ObjectLiteral";
|
|
5
6
|
/**
|
|
6
7
|
* InsertEvent is an object that broadcaster sends to the entity subscriber when entity is inserted to the database.
|
|
7
8
|
*/
|
|
@@ -24,6 +25,10 @@ export interface InsertEvent<Entity> {
|
|
|
24
25
|
* Inserting event.
|
|
25
26
|
*/
|
|
26
27
|
entity: Entity;
|
|
28
|
+
/**
|
|
29
|
+
* Id or ids of the entity being inserted.
|
|
30
|
+
*/
|
|
31
|
+
entityId?: ObjectLiteral;
|
|
27
32
|
/**
|
|
28
33
|
* Metadata of the entity.
|
|
29
34
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/subscriber/event/InsertEvent.ts"],"names":[],"mappings":"","file":"InsertEvent.js","sourcesContent":["import { EntityManager } from \"../../entity-manager/EntityManager\"\nimport { DataSource } from \"../../data-source/DataSource\"\nimport { QueryRunner } from \"../../query-runner/QueryRunner\"\nimport { EntityMetadata } from \"../../metadata/EntityMetadata\"\n\n/**\n * InsertEvent is an object that broadcaster sends to the entity subscriber when entity is inserted to the database.\n */\nexport interface InsertEvent<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 * Inserting event.\n */\n entity: Entity\n\n /**\n * Metadata of the entity.\n */\n metadata: EntityMetadata\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../../src/subscriber/event/InsertEvent.ts"],"names":[],"mappings":"","file":"InsertEvent.js","sourcesContent":["import { EntityManager } from \"../../entity-manager/EntityManager\"\nimport { DataSource } from \"../../data-source/DataSource\"\nimport { QueryRunner } from \"../../query-runner/QueryRunner\"\nimport { EntityMetadata } from \"../../metadata/EntityMetadata\"\nimport { ObjectLiteral } from \"../../common/ObjectLiteral\"\n\n/**\n * InsertEvent is an object that broadcaster sends to the entity subscriber when entity is inserted to the database.\n */\nexport interface InsertEvent<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 * Inserting event.\n */\n entity: Entity\n\n /**\n * Id or ids of the entity being inserted.\n */\n entityId?: ObjectLiteral\n\n /**\n * Metadata of the entity.\n */\n metadata: EntityMetadata\n}\n"],"sourceRoot":"../.."}
|
package/typeorm-model-shim.js
CHANGED
|
@@ -20,268 +20,276 @@
|
|
|
20
20
|
// }
|
|
21
21
|
// }
|
|
22
22
|
|
|
23
|
+
function noop() {}
|
|
24
|
+
|
|
25
|
+
/* export */
|
|
26
|
+
class BaseEntity {}
|
|
27
|
+
|
|
28
|
+
exports.BaseEntity = BaseEntity
|
|
23
29
|
|
|
24
30
|
/* export */ function Column() {
|
|
25
|
-
return
|
|
31
|
+
return noop
|
|
26
32
|
}
|
|
27
33
|
exports.Column = Column;
|
|
28
34
|
|
|
29
35
|
/* export */ function CreateDateColumn() {
|
|
30
|
-
return
|
|
36
|
+
return noop
|
|
31
37
|
}
|
|
32
38
|
exports.CreateDateColumn = CreateDateColumn;
|
|
33
39
|
|
|
34
40
|
/* export */ function DeleteDateColumn() {
|
|
35
|
-
return
|
|
41
|
+
return noop
|
|
36
42
|
}
|
|
37
43
|
exports.DeleteDateColumn = DeleteDateColumn;
|
|
38
44
|
|
|
39
45
|
/* export */ function PrimaryGeneratedColumn() {
|
|
40
|
-
return
|
|
46
|
+
return noop
|
|
41
47
|
}
|
|
42
48
|
exports.PrimaryGeneratedColumn = PrimaryGeneratedColumn;
|
|
43
49
|
|
|
44
50
|
/* export */ function PrimaryColumn() {
|
|
45
|
-
return
|
|
51
|
+
return noop
|
|
46
52
|
}
|
|
47
53
|
exports.PrimaryColumn = PrimaryColumn;
|
|
48
54
|
|
|
49
55
|
/* export */ function UpdateDateColumn() {
|
|
50
|
-
return
|
|
56
|
+
return noop
|
|
51
57
|
}
|
|
52
58
|
exports.UpdateDateColumn = UpdateDateColumn;
|
|
53
59
|
|
|
54
60
|
/* export */ function VersionColumn() {
|
|
55
|
-
return
|
|
61
|
+
return noop
|
|
56
62
|
}
|
|
57
63
|
exports.VersionColumn = VersionColumn;
|
|
58
64
|
|
|
59
65
|
/* export */ function ViewColumn() {
|
|
60
|
-
return
|
|
66
|
+
return noop
|
|
61
67
|
}
|
|
62
68
|
exports.ViewColumn = ViewColumn;
|
|
63
69
|
|
|
64
70
|
/* export */ function ObjectIdColumn() {
|
|
65
|
-
return
|
|
71
|
+
return noop
|
|
66
72
|
}
|
|
67
73
|
exports.ObjectIdColumn = ObjectIdColumn;
|
|
68
74
|
|
|
69
75
|
/* export */ function AfterInsert() {
|
|
70
|
-
return
|
|
76
|
+
return noop
|
|
71
77
|
}
|
|
72
78
|
exports.AfterInsert = AfterInsert;
|
|
73
79
|
|
|
74
80
|
/* export */ function AfterLoad() {
|
|
75
|
-
return
|
|
81
|
+
return noop
|
|
76
82
|
}
|
|
77
83
|
exports.AfterLoad = AfterLoad;
|
|
78
84
|
|
|
79
85
|
/* export */ function AfterSoftRemove() {
|
|
80
|
-
return
|
|
86
|
+
return noop
|
|
81
87
|
}
|
|
82
88
|
exports.AfterSoftRemove = AfterSoftRemove;
|
|
83
89
|
|
|
84
90
|
/* export */ function AfterRecover() {
|
|
85
|
-
return
|
|
91
|
+
return noop
|
|
86
92
|
}
|
|
87
93
|
exports.AfterRecover = AfterRecover;
|
|
88
94
|
|
|
89
95
|
/* export */ function AfterRemove() {
|
|
90
|
-
return
|
|
96
|
+
return noop
|
|
91
97
|
}
|
|
92
98
|
exports.AfterRemove = AfterRemove;
|
|
93
99
|
|
|
94
100
|
/* export */ function AfterUpdate() {
|
|
95
|
-
return
|
|
101
|
+
return noop
|
|
96
102
|
}
|
|
97
103
|
exports.AfterUpdate = AfterUpdate;
|
|
98
104
|
|
|
99
105
|
/* export */ function BeforeInsert() {
|
|
100
|
-
return
|
|
106
|
+
return noop
|
|
101
107
|
}
|
|
102
108
|
exports.BeforeInsert = BeforeInsert;
|
|
103
109
|
|
|
104
110
|
/* export */ function BeforeSoftRemove() {
|
|
105
|
-
return
|
|
111
|
+
return noop
|
|
106
112
|
}
|
|
107
113
|
exports.BeforeSoftRemove = BeforeSoftRemove;
|
|
108
114
|
|
|
109
115
|
/* export */ function BeforeRecover() {
|
|
110
|
-
return
|
|
116
|
+
return noop
|
|
111
117
|
}
|
|
112
118
|
exports.BeforeRecover = BeforeRecover;
|
|
113
119
|
|
|
114
120
|
/* export */ function BeforeRemove() {
|
|
115
|
-
return
|
|
121
|
+
return noop
|
|
116
122
|
}
|
|
117
123
|
exports.BeforeRemove = BeforeRemove;
|
|
118
124
|
|
|
119
125
|
/* export */ function BeforeUpdate() {
|
|
120
|
-
return
|
|
126
|
+
return noop
|
|
121
127
|
}
|
|
122
128
|
exports.BeforeUpdate = BeforeUpdate;
|
|
123
129
|
|
|
124
130
|
/* export */ function EventSubscriber() {
|
|
125
|
-
return
|
|
131
|
+
return noop
|
|
126
132
|
}
|
|
127
133
|
exports.EventSubscriber = EventSubscriber;
|
|
128
134
|
|
|
129
135
|
/* export */ function ColumnOptions() {
|
|
130
|
-
return
|
|
136
|
+
return noop
|
|
131
137
|
}
|
|
132
138
|
exports.ColumnOptions = ColumnOptions;
|
|
133
139
|
|
|
134
140
|
/* export */ function IndexOptions() {
|
|
135
|
-
return
|
|
141
|
+
return noop
|
|
136
142
|
}
|
|
137
143
|
exports.IndexOptions = IndexOptions;
|
|
138
144
|
|
|
139
145
|
/* export */ function JoinColumnOptions() {
|
|
140
|
-
return
|
|
146
|
+
return noop
|
|
141
147
|
}
|
|
142
148
|
exports.JoinColumnOptions = JoinColumnOptions;
|
|
143
149
|
|
|
144
150
|
/* export */ function JoinTableOptions() {
|
|
145
|
-
return
|
|
151
|
+
return noop
|
|
146
152
|
}
|
|
147
153
|
exports.JoinTableOptions = JoinTableOptions;
|
|
148
154
|
|
|
149
155
|
/* export */ function RelationOptions() {
|
|
150
|
-
return
|
|
156
|
+
return noop
|
|
151
157
|
}
|
|
152
158
|
exports.RelationOptions = RelationOptions;
|
|
153
159
|
|
|
154
160
|
/* export */ function EntityOptions() {
|
|
155
|
-
return
|
|
161
|
+
return noop
|
|
156
162
|
}
|
|
157
163
|
exports.EntityOptions = EntityOptions;
|
|
158
164
|
|
|
159
165
|
/* export */ function ValueTransformer() {
|
|
160
|
-
return
|
|
166
|
+
return noop
|
|
161
167
|
}
|
|
162
168
|
exports.ValueTransformer = ValueTransformer;
|
|
163
169
|
|
|
164
170
|
/* export */ function JoinColumn() {
|
|
165
|
-
return
|
|
171
|
+
return noop
|
|
166
172
|
}
|
|
167
173
|
exports.JoinColumn = JoinColumn;
|
|
168
174
|
|
|
169
175
|
/* export */ function JoinTable() {
|
|
170
|
-
return
|
|
176
|
+
return noop
|
|
171
177
|
}
|
|
172
178
|
exports.JoinTable = JoinTable;
|
|
173
179
|
|
|
174
180
|
/* export */ function ManyToMany() {
|
|
175
|
-
return
|
|
181
|
+
return noop
|
|
176
182
|
}
|
|
177
183
|
exports.ManyToMany = ManyToMany;
|
|
178
184
|
|
|
179
185
|
/* export */ function ManyToOne() {
|
|
180
|
-
return
|
|
186
|
+
return noop
|
|
181
187
|
}
|
|
182
188
|
exports.ManyToOne = ManyToOne;
|
|
183
189
|
|
|
184
190
|
/* export */ function OneToMany() {
|
|
185
|
-
return
|
|
191
|
+
return noop
|
|
186
192
|
}
|
|
187
193
|
exports.OneToMany = OneToMany;
|
|
188
194
|
|
|
189
195
|
/* export */ function OneToOne() {
|
|
190
|
-
return
|
|
196
|
+
return noop
|
|
191
197
|
}
|
|
192
198
|
exports.OneToOne = OneToOne;
|
|
193
199
|
|
|
194
200
|
/* export */ function RelationCount() {
|
|
195
|
-
return
|
|
201
|
+
return noop
|
|
196
202
|
}
|
|
197
203
|
exports.RelationCount = RelationCount;
|
|
198
204
|
|
|
199
205
|
/* export */ function RelationId() {
|
|
200
|
-
return
|
|
206
|
+
return noop
|
|
201
207
|
}
|
|
202
208
|
exports.RelationId = RelationId;
|
|
203
209
|
|
|
204
210
|
/* export */ function Entity() {
|
|
205
|
-
return
|
|
211
|
+
return noop
|
|
206
212
|
}
|
|
207
213
|
exports.Entity = Entity;
|
|
208
214
|
|
|
209
215
|
/* export */ function ChildEntity() {
|
|
210
|
-
return
|
|
216
|
+
return noop
|
|
211
217
|
}
|
|
212
218
|
exports.ChildEntity = ChildEntity;
|
|
213
219
|
|
|
214
220
|
/* export */ function TableInheritance() {
|
|
215
|
-
return
|
|
221
|
+
return noop
|
|
216
222
|
}
|
|
217
223
|
exports.TableInheritance = TableInheritance;
|
|
218
224
|
|
|
219
225
|
/* export */ function ViewEntity() {
|
|
220
|
-
return
|
|
226
|
+
return noop
|
|
221
227
|
}
|
|
222
228
|
exports.ViewEntity = ViewEntity;
|
|
223
229
|
|
|
224
230
|
/* export */ function Transaction() {
|
|
225
|
-
return
|
|
231
|
+
return noop
|
|
226
232
|
}
|
|
227
233
|
exports.Transaction = Transaction;
|
|
228
234
|
|
|
229
235
|
/* export */ function TransactionManager() {
|
|
230
|
-
return
|
|
236
|
+
return noop
|
|
231
237
|
}
|
|
232
238
|
exports.TransactionManager = TransactionManager;
|
|
233
239
|
|
|
234
240
|
/* export */ function TransactionRepository() {
|
|
235
|
-
return
|
|
241
|
+
return noop
|
|
236
242
|
}
|
|
237
243
|
exports.TransactionRepository = TransactionRepository;
|
|
238
244
|
|
|
239
245
|
/* export */ function TreeLevelColumn() {
|
|
240
|
-
return
|
|
246
|
+
return noop
|
|
241
247
|
}
|
|
242
248
|
exports.TreeLevelColumn = TreeLevelColumn;
|
|
243
249
|
|
|
244
250
|
/* export */ function TreeParent() {
|
|
245
|
-
return
|
|
251
|
+
return noop
|
|
246
252
|
}
|
|
247
253
|
exports.TreeParent = TreeParent;
|
|
248
254
|
|
|
249
255
|
/* export */ function TreeChildren() {
|
|
250
|
-
return
|
|
256
|
+
return noop
|
|
251
257
|
}
|
|
252
258
|
exports.TreeChildren = TreeChildren;
|
|
253
259
|
|
|
254
260
|
/* export */ function Tree() {
|
|
255
|
-
return
|
|
261
|
+
return noop
|
|
256
262
|
}
|
|
257
263
|
exports.Tree = Tree;
|
|
258
264
|
|
|
259
265
|
/* export */ function Index() {
|
|
260
|
-
return
|
|
266
|
+
return noop
|
|
261
267
|
}
|
|
262
268
|
exports.Index = Index;
|
|
263
269
|
|
|
264
270
|
/* export */ function Unique() {
|
|
265
|
-
return
|
|
271
|
+
return noop
|
|
266
272
|
}
|
|
267
273
|
exports.Unique = Unique;
|
|
268
274
|
|
|
269
275
|
/* export */ function Check() {
|
|
270
|
-
return
|
|
276
|
+
return noop
|
|
271
277
|
}
|
|
272
278
|
exports.Check = Check;
|
|
273
279
|
|
|
274
280
|
/* export */ function Exclusion() {
|
|
275
|
-
return
|
|
281
|
+
return noop
|
|
276
282
|
}
|
|
277
283
|
exports.Exclusion = Exclusion;
|
|
278
284
|
|
|
279
285
|
/* export */ function Generated() {
|
|
280
|
-
return
|
|
286
|
+
return noop
|
|
281
287
|
}
|
|
282
288
|
exports.Generated = Generated;
|
|
283
289
|
|
|
284
290
|
/* export */ function EntityRepository() {
|
|
285
|
-
return
|
|
291
|
+
return noop
|
|
286
292
|
}
|
|
287
293
|
exports.EntityRepository = EntityRepository;
|
|
294
|
+
|
|
295
|
+
|