typeorm 0.3.18-dev.7a58bbf → 0.3.18-dev.7e9cead

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/browser/decorator/Index.js +0 -1
  2. package/browser/decorator/Index.js.map +1 -1
  3. package/browser/decorator/options/IndexOptions.d.ts +0 -5
  4. package/browser/decorator/options/IndexOptions.js.map +1 -1
  5. package/browser/driver/mongodb/MongoQueryRunner.d.ts +3 -3
  6. package/browser/driver/mongodb/MongoQueryRunner.js.map +1 -1
  7. package/browser/driver/mongodb/typings.d.ts +3 -3
  8. package/browser/driver/mongodb/typings.js.map +1 -1
  9. package/browser/driver/oracle/OracleQueryRunner.js +2 -34
  10. package/browser/driver/oracle/OracleQueryRunner.js.map +1 -1
  11. package/browser/driver/postgres/PostgresQueryRunner.js +15 -26
  12. package/browser/driver/postgres/PostgresQueryRunner.js.map +1 -1
  13. package/browser/driver/sap/SapDriver.d.ts +0 -4
  14. package/browser/driver/sap/SapDriver.js +2 -12
  15. package/browser/driver/sap/SapDriver.js.map +1 -1
  16. package/browser/driver/sap/SapQueryRunner.d.ts +14 -5
  17. package/browser/driver/sap/SapQueryRunner.js +53 -39
  18. package/browser/driver/sap/SapQueryRunner.js.map +1 -1
  19. package/browser/entity-manager/MongoEntityManager.d.ts +3 -3
  20. package/browser/entity-manager/MongoEntityManager.js +2 -1
  21. package/browser/entity-manager/MongoEntityManager.js.map +1 -1
  22. package/browser/metadata/IndexMetadata.d.ts +0 -5
  23. package/browser/metadata/IndexMetadata.js +0 -1
  24. package/browser/metadata/IndexMetadata.js.map +1 -1
  25. package/browser/metadata-args/IndexMetadataArgs.d.ts +0 -5
  26. package/browser/metadata-args/IndexMetadataArgs.js.map +1 -1
  27. package/browser/metadata-builder/EntityMetadataBuilder.js +0 -9
  28. package/browser/metadata-builder/EntityMetadataBuilder.js.map +1 -1
  29. package/browser/persistence/SubjectExecutor.js +1 -1
  30. package/browser/persistence/SubjectExecutor.js.map +1 -1
  31. package/browser/query-builder/SelectQueryBuilder.js +1 -4
  32. package/browser/query-builder/SelectQueryBuilder.js.map +1 -1
  33. package/browser/repository/MongoRepository.d.ts +3 -3
  34. package/browser/repository/MongoRepository.js.map +1 -1
  35. package/browser/schema-builder/options/TableIndexOptions.d.ts +0 -5
  36. package/browser/schema-builder/options/TableIndexOptions.js.map +1 -1
  37. package/browser/schema-builder/table/TableIndex.d.ts +0 -5
  38. package/browser/schema-builder/table/TableIndex.js +0 -3
  39. package/browser/schema-builder/table/TableIndex.js.map +1 -1
  40. package/browser/subscriber/Broadcaster.d.ts +1 -1
  41. package/browser/subscriber/Broadcaster.js +1 -2
  42. package/browser/subscriber/Broadcaster.js.map +1 -1
  43. package/browser/subscriber/event/InsertEvent.d.ts +0 -5
  44. package/browser/subscriber/event/InsertEvent.js.map +1 -1
  45. package/commands/MigrationGenerateCommand.js +1 -3
  46. package/commands/MigrationGenerateCommand.js.map +1 -1
  47. package/decorator/Index.js +0 -1
  48. package/decorator/Index.js.map +1 -1
  49. package/decorator/options/IndexOptions.d.ts +0 -5
  50. package/decorator/options/IndexOptions.js.map +1 -1
  51. package/driver/mongodb/MongoQueryRunner.d.ts +3 -3
  52. package/driver/mongodb/MongoQueryRunner.js.map +1 -1
  53. package/driver/mongodb/typings.d.ts +3 -3
  54. package/driver/mongodb/typings.js.map +1 -1
  55. package/driver/oracle/OracleQueryRunner.js +2 -34
  56. package/driver/oracle/OracleQueryRunner.js.map +1 -1
  57. package/driver/postgres/PostgresQueryRunner.js +15 -26
  58. package/driver/postgres/PostgresQueryRunner.js.map +1 -1
  59. package/driver/sap/SapDriver.d.ts +0 -4
  60. package/driver/sap/SapDriver.js +2 -12
  61. package/driver/sap/SapDriver.js.map +1 -1
  62. package/driver/sap/SapQueryRunner.d.ts +14 -5
  63. package/driver/sap/SapQueryRunner.js +53 -39
  64. package/driver/sap/SapQueryRunner.js.map +1 -1
  65. package/entity-manager/MongoEntityManager.d.ts +3 -3
  66. package/entity-manager/MongoEntityManager.js +2 -1
  67. package/entity-manager/MongoEntityManager.js.map +1 -1
  68. package/metadata/IndexMetadata.d.ts +0 -5
  69. package/metadata/IndexMetadata.js +0 -1
  70. package/metadata/IndexMetadata.js.map +1 -1
  71. package/metadata-args/IndexMetadataArgs.d.ts +0 -5
  72. package/metadata-args/IndexMetadataArgs.js.map +1 -1
  73. package/metadata-builder/EntityMetadataBuilder.js +0 -9
  74. package/metadata-builder/EntityMetadataBuilder.js.map +1 -1
  75. package/package.json +1 -1
  76. package/persistence/SubjectExecutor.js +1 -1
  77. package/persistence/SubjectExecutor.js.map +1 -1
  78. package/query-builder/SelectQueryBuilder.js +1 -4
  79. package/query-builder/SelectQueryBuilder.js.map +1 -1
  80. package/repository/MongoRepository.d.ts +3 -3
  81. package/repository/MongoRepository.js.map +1 -1
  82. package/schema-builder/options/TableIndexOptions.d.ts +0 -5
  83. package/schema-builder/options/TableIndexOptions.js.map +1 -1
  84. package/schema-builder/table/TableIndex.d.ts +0 -5
  85. package/schema-builder/table/TableIndex.js +0 -3
  86. package/schema-builder/table/TableIndex.js.map +1 -1
  87. package/subscriber/Broadcaster.d.ts +1 -1
  88. package/subscriber/Broadcaster.js +1 -2
  89. package/subscriber/Broadcaster.js.map +1 -1
  90. package/subscriber/event/InsertEvent.d.ts +0 -5
  91. package/subscriber/event/InsertEvent.js.map +1 -1
@@ -152,15 +152,15 @@ export declare class MongoRepository<Entity extends ObjectLiteral> extends Repos
152
152
  /**
153
153
  * Find a document and delete it in one atomic operation, requires a write lock for the duration of the operation.
154
154
  */
155
- findOneAndDelete(query: ObjectLiteral, options?: FindOneAndDeleteOptions): Promise<Document | null>;
155
+ findOneAndDelete(query: ObjectLiteral, options?: FindOneAndDeleteOptions): Promise<Document>;
156
156
  /**
157
157
  * Find a document and replace it in one atomic operation, requires a write lock for the duration of the operation.
158
158
  */
159
- findOneAndReplace(query: ObjectLiteral, replacement: Object, options?: FindOneAndReplaceOptions): Promise<Document | null>;
159
+ findOneAndReplace(query: ObjectLiteral, replacement: Object, options?: FindOneAndReplaceOptions): Promise<Document>;
160
160
  /**
161
161
  * Find a document and update it in one atomic operation, requires a write lock for the duration of the operation.
162
162
  */
163
- findOneAndUpdate(query: ObjectLiteral, update: Object, options?: FindOneAndUpdateOptions): Promise<Document | null>;
163
+ findOneAndUpdate(query: ObjectLiteral, update: Object, options?: FindOneAndUpdateOptions): Promise<Document>;
164
164
  /**
165
165
  * Retrieve all the indexes on the collection.
166
166
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/repository/MongoRepository.ts"],"names":[],"mappings":";;;AACA,6CAAyC;AAKzC,wDAAoD;AA2CpD;;GAEG;AACH,MAAa,eAEX,SAAQ,uBAAkB;IAUxB,4EAA4E;IAC5E,qBAAqB;IACrB,4EAA4E;IAE5E;;;OAGG;IACH,KAAK,CAAC,KAAa,EAAE,UAAkB;QACnC,MAAM,IAAI,2BAAY,CAAC,sCAAsC,CAAC,CAAA;IAClE,CAAC;IAED;;;OAGG;IACH,kBAAkB,CACd,KAAa,EACb,WAAyB;QAEzB,MAAM,IAAI,2BAAY,CAAC,4CAA4C,CAAC,CAAA;IACxE,CAAC;IAED;;OAEG;IACH,IAAI,CACA,OAG6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC3D,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAU;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IAC3D,CAAC;IAED;;;;OAIG;IACH,YAAY,CACR,OAAsC;QAEtC,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACnE,CAAC;IAED;;;;OAIG;IACH,cAAc,CAAC,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AAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IAC/D,CAAC;IAED;;OAEG;IACH,UAAU,CACN,KAAoB,EACpB,MAA8B,EAC9B,OAAuB;QAEvB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC1B,IAAI,CAAC,QAAQ,CAAC,SAAS,EACvB,KAAK,EACL,MAAM,EACN,OAAO,CACV,CAAA;IACL,CAAC;IAED;;OAEG;IACH,SAAS,CACL,KAAoB,EACpB,MAA8B,EAC9B,OAAuB;QAEvB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CACzB,IAAI,CAAC,QAAQ,CAAC,SAAS,EACvB,KAAK,EACL,MAAM,EACN,OAAO,CACV,CAAA;IACL,CAAC;CACJ;AA/eD,0CA+eC","file":"MongoRepository.js","sourcesContent":["import { ObjectLiteral } from \"../common/ObjectLiteral\"\nimport { Repository } from \"./Repository\"\nimport { MongoFindManyOptions } from \"../find-options/mongodb/MongoFindManyOptions\"\nimport { MongoEntityManager } from \"../entity-manager/MongoEntityManager\"\nimport { QueryRunner } from \"../query-runner/QueryRunner\"\nimport { SelectQueryBuilder } from \"../query-builder/SelectQueryBuilder\"\nimport { TypeORMError } from \"../error/TypeORMError\"\nimport { MongoFindOneOptions } from \"../find-options/mongodb/MongoFindOneOptions\"\nimport { FindOneOptions } from \"../find-options/FindOneOptions\"\n\nimport {\n CreateIndexesOptions,\n ObjectId,\n ReplaceOptions,\n //\n AggregateOptions,\n AggregationCursor,\n AnyBulkWriteOperation,\n BulkWriteOptions,\n BulkWriteResult,\n Collection,\n CollStats,\n CollStatsOptions,\n CommandOperationOptions,\n CountOptions,\n DeleteOptions,\n DeleteResult,\n Document,\n Filter,\n FilterOperators,\n FindCursor,\n FindOneAndDeleteOptions,\n FindOneAndReplaceOptions,\n FindOneAndUpdateOptions,\n IndexDescription,\n InsertManyResult,\n InsertOneOptions,\n InsertOneResult,\n ListIndexesCursor,\n ListIndexesOptions,\n OrderedBulkOperation,\n UnorderedBulkOperation,\n UpdateFilter,\n UpdateOptions,\n UpdateResult,\n CountDocumentsOptions,\n} from \"../driver/mongodb/typings\"\nimport { FindManyOptions } from \"../find-options/FindManyOptions\"\n\n/**\n * Repository used to manage mongodb documents of a single entity type.\n */\nexport class MongoRepository<\n Entity extends ObjectLiteral,\n> extends Repository<Entity> {\n // -------------------------------------------------------------------------\n // Public Properties\n // -------------------------------------------------------------------------\n\n /**\n * Entity Manager used by this repository.\n */\n readonly manager: MongoEntityManager\n\n // -------------------------------------------------------------------------\n // Overridden Methods\n // -------------------------------------------------------------------------\n\n /**\n * Raw SQL query execution is not supported by MongoDB.\n * Calling this method will return an error.\n */\n query(query: string, parameters?: any[]): Promise<any> {\n throw new TypeORMError(`Queries aren't supported by MongoDB.`)\n }\n\n /**\n * Using Query Builder with MongoDB is not supported yet.\n * Calling this method will return an error.\n */\n createQueryBuilder(\n alias: string,\n queryRunner?: QueryRunner,\n ): SelectQueryBuilder<Entity> {\n throw new TypeORMError(`Query Builder is not supported by MongoDB.`)\n }\n\n /**\n * Finds entities that match given find options or conditions.\n */\n find(\n options?:\n | FindManyOptions<Entity>\n | Partial<Entity>\n | FilterOperators<Entity>,\n ): Promise<Entity[]> {\n return this.manager.find(this.metadata.target, options)\n }\n\n /**\n * Finds entities that match given find options or conditions.\n */\n findBy(where: any): Promise<Entity[]> {\n return this.manager.findBy(this.metadata.target, where)\n }\n\n /**\n * Finds entities that match given find options or conditions.\n * Also counts all entities that match given conditions,\n * but ignores pagination settings (from and take options).\n */\n findAndCount(\n options?: MongoFindManyOptions<Entity>,\n ): Promise<[Entity[], number]> {\n return this.manager.findAndCount(this.metadata.target, options)\n }\n\n /**\n * Finds entities that match given find options or conditions.\n * Also counts all entities that match given conditions,\n * but ignores pagination settings (from and take options).\n */\n findAndCountBy(where: any): Promise<[Entity[], number]> {\n return this.manager.findAndCountBy(this.metadata.target, where)\n }\n\n /**\n * Finds entities by ids.\n * Optionally find options can be applied.\n *\n * @deprecated use `findBy` method instead in conjunction with `In` operator, for example:\n *\n * .findBy({\n * id: In([1, 2, 3])\n * })\n */\n findByIds(ids: any[], options?: any): Promise<Entity[]> {\n return this.manager.findByIds(this.metadata.target, ids, options)\n }\n\n /**\n * Finds first entity that matches given find options.\n */\n async findOne(\n options: MongoFindOneOptions<Entity>,\n ): Promise<Entity | null> {\n return this.manager.findOne(this.metadata.target, options)\n }\n\n /**\n * Finds first entity that matches given WHERE conditions.\n */\n async findOneBy(where: any): Promise<Entity | null> {\n return this.manager.findOneBy(this.metadata.target, where)\n }\n\n /**\n * Finds entity that matches given id.\n *\n * @deprecated use `findOneBy` method instead in conjunction with `In` operator, for example:\n *\n * .findOneBy({\n * id: 1 // where \"id\" is your primary column name\n * })\n */\n async findOneById(\n id: string | number | Date | ObjectId,\n ): Promise<Entity | null> {\n return this.manager.findOneById(this.metadata.target, id)\n }\n\n /**\n * Finds first entity by a given find options.\n * If entity was not found in the database - rejects with error.\n */\n async findOneOrFail(options: FindOneOptions<Entity>): Promise<Entity> {\n return this.manager.findOneOrFail(this.metadata.target, options)\n }\n\n /**\n * Finds first entity that matches given where condition.\n * If entity was not found in the database - rejects with error.\n */\n async findOneByOrFail(where: any): Promise<Entity> {\n return this.manager.findOneByOrFail(this.metadata.target, where)\n }\n\n /**\n * Creates a cursor for a query that can be used to iterate over results from MongoDB.\n */\n createCursor<T = any>(query?: Filter<Entity>): FindCursor<T> {\n return this.manager.createCursor(this.metadata.target, query)\n }\n\n /**\n * Creates a cursor for a query that can be used to iterate over results from MongoDB.\n * This returns modified version of cursor that transforms each result into Entity model.\n */\n createEntityCursor(query?: Filter<Entity>): FindCursor<Entity> {\n return this.manager.createEntityCursor(this.metadata.target, query)\n }\n\n /**\n * Execute an aggregation framework pipeline against the collection.\n */\n aggregate<R = any>(\n pipeline: ObjectLiteral[],\n options?: AggregateOptions,\n ): AggregationCursor<Entity> {\n return this.manager.aggregate<R>(\n this.metadata.target,\n pipeline,\n options,\n )\n }\n\n /**\n * Execute an aggregation framework pipeline against the collection.\n * This returns modified version of cursor that transforms each result into Entity model.\n */\n aggregateEntity(\n pipeline: ObjectLiteral[],\n options?: AggregateOptions,\n ): AggregationCursor<Entity> {\n return this.manager.aggregateEntity(\n this.metadata.target,\n pipeline,\n options,\n )\n }\n /**\n * Perform a bulkWrite operation without a fluent API.\n */\n bulkWrite(\n operations: AnyBulkWriteOperation[],\n options?: BulkWriteOptions,\n ): Promise<BulkWriteResult> {\n return this.manager.bulkWrite(this.metadata.target, operations, options)\n }\n\n /**\n * Count number of matching documents in the db to a query.\n */\n count(query?: ObjectLiteral, options?: CountOptions): Promise<number> {\n return this.manager.count(this.metadata.target, query || {}, options)\n }\n\n /**\n * Count number of matching documents in the db to a query.\n */\n countDocuments(\n query?: ObjectLiteral,\n options?: CountDocumentsOptions,\n ): Promise<number> {\n return this.manager.countDocuments(\n this.metadata.target,\n query || {},\n options,\n )\n }\n\n /**\n * Count number of matching documents in the db to a query.\n */\n countBy(query?: ObjectLiteral, options?: CountOptions): Promise<number> {\n return this.manager.countBy(this.metadata.target, query, options)\n }\n\n /**\n * Creates an index on the db and collection.\n */\n createCollectionIndex(\n fieldOrSpec: string | any,\n options?: CreateIndexesOptions,\n ): Promise<string> {\n return this.manager.createCollectionIndex(\n this.metadata.target,\n fieldOrSpec,\n options,\n )\n }\n\n /**\n * Creates multiple indexes in the collection, this method is only supported for MongoDB 2.6 or higher.\n * Earlier version of MongoDB will throw a command not supported error.\n * Index specifications are defined at http://docs.mongodb.org/manual/reference/command/createIndexes/.\n */\n createCollectionIndexes(indexSpecs: IndexDescription[]): Promise<string[]> {\n return this.manager.createCollectionIndexes(\n this.metadata.target,\n indexSpecs,\n )\n }\n\n /**\n * Delete multiple documents on MongoDB.\n */\n deleteMany(\n query: ObjectLiteral,\n options?: DeleteOptions,\n ): Promise<DeleteResult> {\n return this.manager.deleteMany(this.metadata.tableName, query, options)\n }\n\n /**\n * Delete a document on MongoDB.\n */\n deleteOne(\n query: ObjectLiteral,\n options?: DeleteOptions,\n ): Promise<DeleteResult> {\n return this.manager.deleteOne(this.metadata.tableName, query, options)\n }\n\n /**\n * The distinct command returns returns a list of distinct values for the given key across a collection.\n */\n distinct(\n key: string,\n query: ObjectLiteral,\n options?: CommandOperationOptions,\n ): Promise<any> {\n return this.manager.distinct(\n this.metadata.tableName,\n key,\n query,\n options,\n )\n }\n\n /**\n * Drops an index from this collection.\n */\n dropCollectionIndex(\n indexName: string,\n options?: CommandOperationOptions,\n ): Promise<any> {\n return this.manager.dropCollectionIndex(\n this.metadata.tableName,\n indexName,\n options,\n )\n }\n\n /**\n * Drops all indexes from the collection.\n */\n dropCollectionIndexes(): Promise<any> {\n return this.manager.dropCollectionIndexes(this.metadata.tableName)\n }\n\n /**\n * Find a document and delete it in one atomic operation, requires a write lock for the duration of the operation.\n */\n findOneAndDelete(\n query: ObjectLiteral,\n options?: FindOneAndDeleteOptions,\n ): Promise<Document | null> {\n return this.manager.findOneAndDelete(\n this.metadata.tableName,\n query,\n options,\n )\n }\n\n /**\n * Find a document and replace it in one atomic operation, requires a write lock for the duration of the operation.\n */\n findOneAndReplace(\n query: ObjectLiteral,\n replacement: Object,\n options?: FindOneAndReplaceOptions,\n ): Promise<Document | null> {\n return this.manager.findOneAndReplace(\n this.metadata.tableName,\n query,\n replacement,\n options,\n )\n }\n\n /**\n * Find a document and update it in one atomic operation, requires a write lock for the duration of the operation.\n */\n findOneAndUpdate(\n query: ObjectLiteral,\n update: Object,\n options?: FindOneAndUpdateOptions,\n ): Promise<Document | null> {\n return this.manager.findOneAndUpdate(\n this.metadata.tableName,\n query,\n update,\n options,\n )\n }\n\n /**\n * Retrieve all the indexes on the collection.\n */\n collectionIndexes(): Promise<any> {\n return this.manager.collectionIndexes(this.metadata.tableName)\n }\n\n /**\n * Retrieve all the indexes on the collection.\n */\n collectionIndexExists(indexes: string | string[]): Promise<boolean> {\n return this.manager.collectionIndexExists(\n this.metadata.tableName,\n indexes,\n )\n }\n\n /**\n * Retrieves this collections index info.\n */\n collectionIndexInformation(options?: { full: boolean }): Promise<any> {\n return this.manager.collectionIndexInformation(\n this.metadata.tableName,\n options,\n )\n }\n\n /**\n * Initiate an In order bulk write operation, operations will be serially executed in the order they are added, creating a new operation for each switch in types.\n */\n initializeOrderedBulkOp(options?: BulkWriteOptions): OrderedBulkOperation {\n return this.manager.initializeOrderedBulkOp(\n this.metadata.tableName,\n options,\n )\n }\n\n /**\n * Initiate a Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order.\n */\n initializeUnorderedBulkOp(\n options?: BulkWriteOptions,\n ): UnorderedBulkOperation {\n return this.manager.initializeUnorderedBulkOp(\n this.metadata.tableName,\n options,\n )\n }\n\n /**\n * Inserts an array of documents into MongoDB.\n */\n insertMany(\n docs: ObjectLiteral[],\n options?: BulkWriteOptions,\n ): Promise<InsertManyResult<Document>> {\n return this.manager.insertMany(this.metadata.tableName, docs, options)\n }\n\n /**\n * Inserts a single document into MongoDB.\n */\n insertOne(\n doc: ObjectLiteral,\n options?: InsertOneOptions,\n ): Promise<InsertOneResult> {\n return this.manager.insertOne(this.metadata.tableName, doc, options)\n }\n\n /**\n * Returns if the collection is a capped collection.\n */\n isCapped(): Promise<any> {\n return this.manager.isCapped(this.metadata.tableName)\n }\n\n /**\n * Get the list of all indexes information for the collection.\n */\n listCollectionIndexes(options?: ListIndexesOptions): ListIndexesCursor {\n return this.manager.listCollectionIndexes(\n this.metadata.tableName,\n options,\n )\n }\n\n /**\n * Reindex all indexes on the collection Warning: reIndex is a blocking operation (indexes are rebuilt in the foreground) and will be slow for large collections.\n */\n rename(\n newName: string,\n options?: { dropTarget?: boolean },\n ): Promise<Collection<Document>> {\n return this.manager.rename(this.metadata.tableName, newName, options)\n }\n\n /**\n * Replace a document on MongoDB.\n */\n replaceOne(\n query: ObjectLiteral,\n doc: ObjectLiteral,\n options?: ReplaceOptions,\n ): Promise<Document | UpdateResult> {\n return this.manager.replaceOne(\n this.metadata.tableName,\n query,\n doc,\n options,\n )\n }\n\n /**\n * Get all the collection statistics.\n */\n stats(options?: CollStatsOptions): Promise<CollStats> {\n return this.manager.stats(this.metadata.tableName, options)\n }\n\n /**\n * Update multiple documents on MongoDB.\n */\n updateMany(\n query: ObjectLiteral,\n update: UpdateFilter<Document>,\n options?: UpdateOptions,\n ): Promise<Document | UpdateResult> {\n return this.manager.updateMany(\n this.metadata.tableName,\n query,\n update,\n options,\n )\n }\n\n /**\n * Update a single document on MongoDB.\n */\n updateOne(\n query: ObjectLiteral,\n update: UpdateFilter<Document>,\n options?: UpdateOptions,\n ): Promise<Document | UpdateResult> {\n return this.manager.updateOne(\n this.metadata.tableName,\n query,\n update,\n options,\n )\n }\n}\n"],"sourceRoot":".."}
1
+ {"version":3,"sources":["../../src/repository/MongoRepository.ts"],"names":[],"mappings":";;;AACA,6CAAyC;AAKzC,wDAAoD;AA2CpD;;GAEG;AACH,MAAa,eAEX,SAAQ,uBAAkB;IAUxB,4EAA4E;IAC5E,qBAAqB;IACrB,4EAA4E;IAE5E;;;OAGG;IACH,KAAK,CAAC,KAAa,EAAE,UAAkB;QACnC,MAAM,IAAI,2BAAY,CAAC,sCAAsC,CAAC,CAAA;IAClE,CAAC;IAED;;;OAGG;IACH,kBAAkB,CACd,KAAa,EACb,WAAyB;QAEzB,MAAM,IAAI,2BAAY,CAAC,4CAA4C,CAAC,CAAA;IACxE,CAAC;IAED;;OAEG;IACH,IAAI,CACA,OAG6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC3D,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAU;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IAC3D,CAAC;IAED;;;;OAIG;IACH,YAAY,CACR,OAAsC;QAEtC,OAAO,IAAI,CAAC,OAAO,CAAC,YA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AAA;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAA0B;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IAC/D,CAAC;IAED;;OAEG;IACH,UAAU,CACN,KAAoB,EACpB,MAA8B,EAC9B,OAAuB;QAEvB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC1B,IAAI,CAAC,QAAQ,CAAC,SAAS,EACvB,KAAK,EACL,MAAM,EACN,OAAO,CACV,CAAA;IACL,CAAC;IAED;;OAEG;IACH,SAAS,CACL,KAAoB,EACpB,MAA8B,EAC9B,OAAuB;QAEvB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CACzB,IAAI,CAAC,QAAQ,CAAC,SAAS,EACvB,KAAK,EACL,MAAM,EACN,OAAO,CACV,CAAA;IACL,CAAC;CACJ;AA/eD,0CA+eC","file":"MongoRepository.js","sourcesContent":["import { ObjectLiteral } from \"../common/ObjectLiteral\"\nimport { Repository } from \"./Repository\"\nimport { MongoFindManyOptions } from \"../find-options/mongodb/MongoFindManyOptions\"\nimport { MongoEntityManager } from \"../entity-manager/MongoEntityManager\"\nimport { QueryRunner } from \"../query-runner/QueryRunner\"\nimport { SelectQueryBuilder } from \"../query-builder/SelectQueryBuilder\"\nimport { TypeORMError } from \"../error/TypeORMError\"\nimport { MongoFindOneOptions } from \"../find-options/mongodb/MongoFindOneOptions\"\nimport { FindOneOptions } from \"../find-options/FindOneOptions\"\n\nimport {\n CreateIndexesOptions,\n ObjectId,\n ReplaceOptions,\n //\n AggregateOptions,\n AggregationCursor,\n AnyBulkWriteOperation,\n BulkWriteOptions,\n BulkWriteResult,\n Collection,\n CollStats,\n CollStatsOptions,\n CommandOperationOptions,\n CountOptions,\n DeleteOptions,\n DeleteResult,\n Document,\n Filter,\n FilterOperators,\n FindCursor,\n FindOneAndDeleteOptions,\n FindOneAndReplaceOptions,\n FindOneAndUpdateOptions,\n IndexDescription,\n InsertManyResult,\n InsertOneOptions,\n InsertOneResult,\n ListIndexesCursor,\n ListIndexesOptions,\n OrderedBulkOperation,\n UnorderedBulkOperation,\n UpdateFilter,\n UpdateOptions,\n UpdateResult,\n CountDocumentsOptions,\n} from \"../driver/mongodb/typings\"\nimport { FindManyOptions } from \"../find-options/FindManyOptions\"\n\n/**\n * Repository used to manage mongodb documents of a single entity type.\n */\nexport class MongoRepository<\n Entity extends ObjectLiteral,\n> extends Repository<Entity> {\n // -------------------------------------------------------------------------\n // Public Properties\n // -------------------------------------------------------------------------\n\n /**\n * Entity Manager used by this repository.\n */\n readonly manager: MongoEntityManager\n\n // -------------------------------------------------------------------------\n // Overridden Methods\n // -------------------------------------------------------------------------\n\n /**\n * Raw SQL query execution is not supported by MongoDB.\n * Calling this method will return an error.\n */\n query(query: string, parameters?: any[]): Promise<any> {\n throw new TypeORMError(`Queries aren't supported by MongoDB.`)\n }\n\n /**\n * Using Query Builder with MongoDB is not supported yet.\n * Calling this method will return an error.\n */\n createQueryBuilder(\n alias: string,\n queryRunner?: QueryRunner,\n ): SelectQueryBuilder<Entity> {\n throw new TypeORMError(`Query Builder is not supported by MongoDB.`)\n }\n\n /**\n * Finds entities that match given find options or conditions.\n */\n find(\n options?:\n | FindManyOptions<Entity>\n | Partial<Entity>\n | FilterOperators<Entity>,\n ): Promise<Entity[]> {\n return this.manager.find(this.metadata.target, options)\n }\n\n /**\n * Finds entities that match given find options or conditions.\n */\n findBy(where: any): Promise<Entity[]> {\n return this.manager.findBy(this.metadata.target, where)\n }\n\n /**\n * Finds entities that match given find options or conditions.\n * Also counts all entities that match given conditions,\n * but ignores pagination settings (from and take options).\n */\n findAndCount(\n options?: MongoFindManyOptions<Entity>,\n ): Promise<[Entity[], number]> {\n return this.manager.findAndCount(this.metadata.target, options)\n }\n\n /**\n * Finds entities that match given find options or conditions.\n * Also counts all entities that match given conditions,\n * but ignores pagination settings (from and take options).\n */\n findAndCountBy(where: any): Promise<[Entity[], number]> {\n return this.manager.findAndCountBy(this.metadata.target, where)\n }\n\n /**\n * Finds entities by ids.\n * Optionally find options can be applied.\n *\n * @deprecated use `findBy` method instead in conjunction with `In` operator, for example:\n *\n * .findBy({\n * id: In([1, 2, 3])\n * })\n */\n findByIds(ids: any[], options?: any): Promise<Entity[]> {\n return this.manager.findByIds(this.metadata.target, ids, options)\n }\n\n /**\n * Finds first entity that matches given find options.\n */\n async findOne(\n options: MongoFindOneOptions<Entity>,\n ): Promise<Entity | null> {\n return this.manager.findOne(this.metadata.target, options)\n }\n\n /**\n * Finds first entity that matches given WHERE conditions.\n */\n async findOneBy(where: any): Promise<Entity | null> {\n return this.manager.findOneBy(this.metadata.target, where)\n }\n\n /**\n * Finds entity that matches given id.\n *\n * @deprecated use `findOneBy` method instead in conjunction with `In` operator, for example:\n *\n * .findOneBy({\n * id: 1 // where \"id\" is your primary column name\n * })\n */\n async findOneById(\n id: string | number | Date | ObjectId,\n ): Promise<Entity | null> {\n return this.manager.findOneById(this.metadata.target, id)\n }\n\n /**\n * Finds first entity by a given find options.\n * If entity was not found in the database - rejects with error.\n */\n async findOneOrFail(options: FindOneOptions<Entity>): Promise<Entity> {\n return this.manager.findOneOrFail(this.metadata.target, options)\n }\n\n /**\n * Finds first entity that matches given where condition.\n * If entity was not found in the database - rejects with error.\n */\n async findOneByOrFail(where: any): Promise<Entity> {\n return this.manager.findOneByOrFail(this.metadata.target, where)\n }\n\n /**\n * Creates a cursor for a query that can be used to iterate over results from MongoDB.\n */\n createCursor<T = any>(query?: Filter<Entity>): FindCursor<T> {\n return this.manager.createCursor(this.metadata.target, query)\n }\n\n /**\n * Creates a cursor for a query that can be used to iterate over results from MongoDB.\n * This returns modified version of cursor that transforms each result into Entity model.\n */\n createEntityCursor(query?: Filter<Entity>): FindCursor<Entity> {\n return this.manager.createEntityCursor(this.metadata.target, query)\n }\n\n /**\n * Execute an aggregation framework pipeline against the collection.\n */\n aggregate<R = any>(\n pipeline: ObjectLiteral[],\n options?: AggregateOptions,\n ): AggregationCursor<Entity> {\n return this.manager.aggregate<R>(\n this.metadata.target,\n pipeline,\n options,\n )\n }\n\n /**\n * Execute an aggregation framework pipeline against the collection.\n * This returns modified version of cursor that transforms each result into Entity model.\n */\n aggregateEntity(\n pipeline: ObjectLiteral[],\n options?: AggregateOptions,\n ): AggregationCursor<Entity> {\n return this.manager.aggregateEntity(\n this.metadata.target,\n pipeline,\n options,\n )\n }\n /**\n * Perform a bulkWrite operation without a fluent API.\n */\n bulkWrite(\n operations: AnyBulkWriteOperation[],\n options?: BulkWriteOptions,\n ): Promise<BulkWriteResult> {\n return this.manager.bulkWrite(this.metadata.target, operations, options)\n }\n\n /**\n * Count number of matching documents in the db to a query.\n */\n count(query?: ObjectLiteral, options?: CountOptions): Promise<number> {\n return this.manager.count(this.metadata.target, query || {}, options)\n }\n\n /**\n * Count number of matching documents in the db to a query.\n */\n countDocuments(\n query?: ObjectLiteral,\n options?: CountDocumentsOptions,\n ): Promise<number> {\n return this.manager.countDocuments(\n this.metadata.target,\n query || {},\n options,\n )\n }\n\n /**\n * Count number of matching documents in the db to a query.\n */\n countBy(query?: ObjectLiteral, options?: CountOptions): Promise<number> {\n return this.manager.countBy(this.metadata.target, query, options)\n }\n\n /**\n * Creates an index on the db and collection.\n */\n createCollectionIndex(\n fieldOrSpec: string | any,\n options?: CreateIndexesOptions,\n ): Promise<string> {\n return this.manager.createCollectionIndex(\n this.metadata.target,\n fieldOrSpec,\n options,\n )\n }\n\n /**\n * Creates multiple indexes in the collection, this method is only supported for MongoDB 2.6 or higher.\n * Earlier version of MongoDB will throw a command not supported error.\n * Index specifications are defined at http://docs.mongodb.org/manual/reference/command/createIndexes/.\n */\n createCollectionIndexes(indexSpecs: IndexDescription[]): Promise<string[]> {\n return this.manager.createCollectionIndexes(\n this.metadata.target,\n indexSpecs,\n )\n }\n\n /**\n * Delete multiple documents on MongoDB.\n */\n deleteMany(\n query: ObjectLiteral,\n options?: DeleteOptions,\n ): Promise<DeleteResult> {\n return this.manager.deleteMany(this.metadata.tableName, query, options)\n }\n\n /**\n * Delete a document on MongoDB.\n */\n deleteOne(\n query: ObjectLiteral,\n options?: DeleteOptions,\n ): Promise<DeleteResult> {\n return this.manager.deleteOne(this.metadata.tableName, query, options)\n }\n\n /**\n * The distinct command returns returns a list of distinct values for the given key across a collection.\n */\n distinct(\n key: string,\n query: ObjectLiteral,\n options?: CommandOperationOptions,\n ): Promise<any> {\n return this.manager.distinct(\n this.metadata.tableName,\n key,\n query,\n options,\n )\n }\n\n /**\n * Drops an index from this collection.\n */\n dropCollectionIndex(\n indexName: string,\n options?: CommandOperationOptions,\n ): Promise<any> {\n return this.manager.dropCollectionIndex(\n this.metadata.tableName,\n indexName,\n options,\n )\n }\n\n /**\n * Drops all indexes from the collection.\n */\n dropCollectionIndexes(): Promise<any> {\n return this.manager.dropCollectionIndexes(this.metadata.tableName)\n }\n\n /**\n * Find a document and delete it in one atomic operation, requires a write lock for the duration of the operation.\n */\n findOneAndDelete(\n query: ObjectLiteral,\n options?: FindOneAndDeleteOptions,\n ): Promise<Document> {\n return this.manager.findOneAndDelete(\n this.metadata.tableName,\n query,\n options,\n )\n }\n\n /**\n * Find a document and replace it in one atomic operation, requires a write lock for the duration of the operation.\n */\n findOneAndReplace(\n query: ObjectLiteral,\n replacement: Object,\n options?: FindOneAndReplaceOptions,\n ): Promise<Document> {\n return this.manager.findOneAndReplace(\n this.metadata.tableName,\n query,\n replacement,\n options,\n )\n }\n\n /**\n * Find a document and update it in one atomic operation, requires a write lock for the duration of the operation.\n */\n findOneAndUpdate(\n query: ObjectLiteral,\n update: Object,\n options?: FindOneAndUpdateOptions,\n ): Promise<Document> {\n return this.manager.findOneAndUpdate(\n this.metadata.tableName,\n query,\n update,\n options,\n )\n }\n\n /**\n * Retrieve all the indexes on the collection.\n */\n collectionIndexes(): Promise<any> {\n return this.manager.collectionIndexes(this.metadata.tableName)\n }\n\n /**\n * Retrieve all the indexes on the collection.\n */\n collectionIndexExists(indexes: string | string[]): Promise<boolean> {\n return this.manager.collectionIndexExists(\n this.metadata.tableName,\n indexes,\n )\n }\n\n /**\n * Retrieves this collections index info.\n */\n collectionIndexInformation(options?: { full: boolean }): Promise<any> {\n return this.manager.collectionIndexInformation(\n this.metadata.tableName,\n options,\n )\n }\n\n /**\n * Initiate an In order bulk write operation, operations will be serially executed in the order they are added, creating a new operation for each switch in types.\n */\n initializeOrderedBulkOp(options?: BulkWriteOptions): OrderedBulkOperation {\n return this.manager.initializeOrderedBulkOp(\n this.metadata.tableName,\n options,\n )\n }\n\n /**\n * Initiate a Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order.\n */\n initializeUnorderedBulkOp(\n options?: BulkWriteOptions,\n ): UnorderedBulkOperation {\n return this.manager.initializeUnorderedBulkOp(\n this.metadata.tableName,\n options,\n )\n }\n\n /**\n * Inserts an array of documents into MongoDB.\n */\n insertMany(\n docs: ObjectLiteral[],\n options?: BulkWriteOptions,\n ): Promise<InsertManyResult<Document>> {\n return this.manager.insertMany(this.metadata.tableName, docs, options)\n }\n\n /**\n * Inserts a single document into MongoDB.\n */\n insertOne(\n doc: ObjectLiteral,\n options?: InsertOneOptions,\n ): Promise<InsertOneResult> {\n return this.manager.insertOne(this.metadata.tableName, doc, options)\n }\n\n /**\n * Returns if the collection is a capped collection.\n */\n isCapped(): Promise<any> {\n return this.manager.isCapped(this.metadata.tableName)\n }\n\n /**\n * Get the list of all indexes information for the collection.\n */\n listCollectionIndexes(options?: ListIndexesOptions): ListIndexesCursor {\n return this.manager.listCollectionIndexes(\n this.metadata.tableName,\n options,\n )\n }\n\n /**\n * Reindex all indexes on the collection Warning: reIndex is a blocking operation (indexes are rebuilt in the foreground) and will be slow for large collections.\n */\n rename(\n newName: string,\n options?: { dropTarget?: boolean },\n ): Promise<Collection<Document>> {\n return this.manager.rename(this.metadata.tableName, newName, options)\n }\n\n /**\n * Replace a document on MongoDB.\n */\n replaceOne(\n query: ObjectLiteral,\n doc: ObjectLiteral,\n options?: ReplaceOptions,\n ): Promise<Document | UpdateResult> {\n return this.manager.replaceOne(\n this.metadata.tableName,\n query,\n doc,\n options,\n )\n }\n\n /**\n * Get all the collection statistics.\n */\n stats(options?: CollStatsOptions): Promise<CollStats> {\n return this.manager.stats(this.metadata.tableName, options)\n }\n\n /**\n * Update multiple documents on MongoDB.\n */\n updateMany(\n query: ObjectLiteral,\n update: UpdateFilter<Document>,\n options?: UpdateOptions,\n ): Promise<Document | UpdateResult> {\n return this.manager.updateMany(\n this.metadata.tableName,\n query,\n update,\n options,\n )\n }\n\n /**\n * Update a single document on MongoDB.\n */\n updateOne(\n query: ObjectLiteral,\n update: UpdateFilter<Document>,\n options?: UpdateOptions,\n ): Promise<Document | UpdateResult> {\n return this.manager.updateOne(\n this.metadata.tableName,\n query,\n update,\n options,\n )\n }\n}\n"],"sourceRoot":".."}
@@ -19,11 +19,6 @@ export interface TableIndexOptions {
19
19
  * Works only in MySQL.
20
20
  */
21
21
  isSpatial?: boolean;
22
- /**
23
- * Builds the index using the concurrently option.
24
- * This options is only supported for postgres database.
25
- */
26
- isConcurrent?: boolean;
27
22
  /**
28
23
  * The FULLTEXT modifier indexes the entire column and does not allow prefixing.
29
24
  * Supported only in MySQL & SAP HANA.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/schema-builder/options/TableIndexOptions.ts"],"names":[],"mappings":"","file":"TableIndexOptions.js","sourcesContent":["/**\n * Database's table index options.\n */\nexport interface TableIndexOptions {\n // -------------------------------------------------------------------------\n // Public Properties\n // -------------------------------------------------------------------------\n\n /**\n * Constraint name.\n */\n name?: string\n\n /**\n * Columns included in this index.\n */\n columnNames: string[]\n\n /**\n * Indicates if this index is unique.\n */\n isUnique?: boolean\n\n /**\n * The SPATIAL modifier indexes the entire column and does not allow indexed columns to contain NULL values.\n * Works only in MySQL.\n */\n isSpatial?: boolean\n\n /**\n * Builds the index using the concurrently option.\n * This options is only supported for postgres database.\n */\n isConcurrent?: boolean\n\n /**\n * The FULLTEXT modifier indexes the entire column and does not allow prefixing.\n * Supported only in MySQL & SAP HANA.\n */\n isFulltext?: boolean\n\n /**\n * NULL_FILTERED indexes are particularly useful for indexing sparse columns, where most rows contain a NULL value.\n * In these cases, the NULL_FILTERED index can be considerably smaller and more efficient to maintain than\n * a normal index that includes NULL values.\n *\n * Works only in Spanner.\n */\n isNullFiltered?: boolean\n\n /**\n * Fulltext parser.\n * Works only in MySQL.\n */\n parser?: string\n\n /**\n * Index filter condition.\n */\n where?: string\n}\n"],"sourceRoot":"../.."}
1
+ {"version":3,"sources":["../../src/schema-builder/options/TableIndexOptions.ts"],"names":[],"mappings":"","file":"TableIndexOptions.js","sourcesContent":["/**\n * Database's table index options.\n */\nexport interface TableIndexOptions {\n // -------------------------------------------------------------------------\n // Public Properties\n // -------------------------------------------------------------------------\n\n /**\n * Constraint name.\n */\n name?: string\n\n /**\n * Columns included in this index.\n */\n columnNames: string[]\n\n /**\n * Indicates if this index is unique.\n */\n isUnique?: boolean\n\n /**\n * The SPATIAL modifier indexes the entire column and does not allow indexed columns to contain NULL values.\n * Works only in MySQL.\n */\n isSpatial?: boolean\n\n /**\n * The FULLTEXT modifier indexes the entire column and does not allow prefixing.\n * Supported only in MySQL & SAP HANA.\n */\n isFulltext?: boolean\n\n /**\n * NULL_FILTERED indexes are particularly useful for indexing sparse columns, where most rows contain a NULL value.\n * In these cases, the NULL_FILTERED index can be considerably smaller and more efficient to maintain than\n * a normal index that includes NULL values.\n *\n * Works only in Spanner.\n */\n isNullFiltered?: boolean\n\n /**\n * Fulltext parser.\n * Works only in MySQL.\n */\n parser?: string\n\n /**\n * Index filter condition.\n */\n where?: string\n}\n"],"sourceRoot":"../.."}
@@ -22,11 +22,6 @@ export declare class TableIndex {
22
22
  * Works only in MySQL.
23
23
  */
24
24
  isSpatial: boolean;
25
- /**
26
- * Create the index using the CONCURRENTLY modifier
27
- * Works only in postgres.
28
- */
29
- isConcurrent: boolean;
30
25
  /**
31
26
  * The FULLTEXT modifier indexes the entire column and does not allow prefixing.
32
27
  * Works only in MySQL.
@@ -18,7 +18,6 @@ class TableIndex {
18
18
  this.columnNames = options.columnNames;
19
19
  this.isUnique = !!options.isUnique;
20
20
  this.isSpatial = !!options.isSpatial;
21
- this.isConcurrent = !!options.isConcurrent;
22
21
  this.isFulltext = !!options.isFulltext;
23
22
  this.isNullFiltered = !!options.isNullFiltered;
24
23
  this.parser = options.parser;
@@ -36,7 +35,6 @@ class TableIndex {
36
35
  columnNames: [...this.columnNames],
37
36
  isUnique: this.isUnique,
38
37
  isSpatial: this.isSpatial,
39
- isConcurrent: this.isConcurrent,
40
38
  isFulltext: this.isFulltext,
41
39
  isNullFiltered: this.isNullFiltered,
42
40
  parser: this.parser,
@@ -55,7 +53,6 @@ class TableIndex {
55
53
  columnNames: indexMetadata.columns.map((column) => column.databaseName),
56
54
  isUnique: indexMetadata.isUnique,
57
55
  isSpatial: indexMetadata.isSpatial,
58
- isConcurrent: indexMetadata.isConcurrent,
59
56
  isFulltext: indexMetadata.isFulltext,
60
57
  isNullFiltered: indexMetadata.isNullFiltered,
61
58
  parser: indexMetadata.parser,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/schema-builder/table/TableIndex.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACH,MAAa,UAAU;IA4DnB,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,YAAY,OAA0B;QA/D7B,mBAAa,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;QAWjD;;WAEG;QACH,gBAAW,GAAa,EAAE,CAAA;QAkDtB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;QACxB,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAA;QACtC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAA;QAClC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAA;QACpC,I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C,UAAU,EAAE,aAAa,CAAC,UAAU;YACpC,cAAc,EAAE,aAAa,CAAC,cAAc;YAC5C,MAAM,EAAE,aAAa,CAAC,MAAM;YAC5B,KAAK,EAAE,aAAa,CAAC,KAAK;SAC7B,CAAC,CAAA;IACN,CAAC;CACJ;AAvHD,gCAuHC","file":"TableIndex.js","sourcesContent":["import { IndexMetadata } from \"../../metadata/IndexMetadata\"\nimport { TableIndexOptions } from \"../options/TableIndexOptions\"\n\n/**\n * Database's table index stored in this class.\n */\nexport class TableIndex {\n readonly \"@instanceof\" = Symbol.for(\"TableIndex\")\n\n // -------------------------------------------------------------------------\n // Public Properties\n // -------------------------------------------------------------------------\n\n /**\n * Index name.\n */\n name?: string\n\n /**\n * Columns included in this index.\n */\n columnNames: string[] = []\n\n /**\n * Indicates if this index is unique.\n */\n isUnique: boolean\n\n /**\n * The SPATIAL modifier indexes the entire column and does not allow indexed columns to contain NULL values.\n * Works only in MySQL.\n */\n isSpatial: boolean\n\n /**\n * Create the index using the CONCURRENTLY modifier\n * Works only in postgres.\n */\n isConcurrent: boolean\n\n /**\n * The FULLTEXT modifier indexes the entire column and does not allow prefixing.\n * Works only in MySQL.\n */\n isFulltext: boolean\n\n /**\n * NULL_FILTERED indexes are particularly useful for indexing sparse columns, where most rows contain a NULL value.\n * In these cases, the NULL_FILTERED index can be considerably smaller and more efficient to maintain than\n * a normal index that includes NULL values.\n *\n * Works only in Spanner.\n */\n isNullFiltered: boolean\n\n /**\n * Fulltext parser.\n * Works only in MySQL.\n */\n parser?: string\n\n /**\n * Index filter condition.\n */\n where: string\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(options: TableIndexOptions) {\n this.name = options.name\n this.columnNames = options.columnNames\n this.isUnique = !!options.isUnique\n this.isSpatial = !!options.isSpatial\n this.isConcurrent = !!options.isConcurrent\n this.isFulltext = !!options.isFulltext\n this.isNullFiltered = !!options.isNullFiltered\n this.parser = options.parser\n this.where = options.where ? options.where : \"\"\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Creates a new copy of this index with exactly same properties.\n */\n clone(): TableIndex {\n return new TableIndex(<TableIndexOptions>{\n name: this.name,\n columnNames: [...this.columnNames],\n isUnique: this.isUnique,\n isSpatial: this.isSpatial,\n isConcurrent: this.isConcurrent,\n isFulltext: this.isFulltext,\n isNullFiltered: this.isNullFiltered,\n parser: this.parser,\n where: this.where,\n })\n }\n\n // -------------------------------------------------------------------------\n // Static Methods\n // -------------------------------------------------------------------------\n\n /**\n * Creates index from the index metadata object.\n */\n static create(indexMetadata: IndexMetadata): TableIndex {\n return new TableIndex(<TableIndexOptions>{\n name: indexMetadata.name,\n columnNames: indexMetadata.columns.map(\n (column) => column.databaseName,\n ),\n isUnique: indexMetadata.isUnique,\n isSpatial: indexMetadata.isSpatial,\n isConcurrent: indexMetadata.isConcurrent,\n isFulltext: indexMetadata.isFulltext,\n isNullFiltered: indexMetadata.isNullFiltered,\n parser: indexMetadata.parser,\n where: indexMetadata.where,\n })\n }\n}\n"],"sourceRoot":"../.."}
1
+ {"version":3,"sources":["../../src/schema-builder/table/TableIndex.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACH,MAAa,UAAU;IAsDnB,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,YAAY,OAA0B;QAzD7B,mBAAa,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;QAWjD;;WAEG;QACH,gBAAW,GAAa,EAAE,CAAA;QA4CtB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;QACxB,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAA;QACtC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAA;QAClC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAA;QACpC,IAAI,CAAC,UAAU,GAAG,CAAC,CA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;CACJ;AA9GD,gCA8GC","file":"TableIndex.js","sourcesContent":["import { IndexMetadata } from \"../../metadata/IndexMetadata\"\nimport { TableIndexOptions } from \"../options/TableIndexOptions\"\n\n/**\n * Database's table index stored in this class.\n */\nexport class TableIndex {\n readonly \"@instanceof\" = Symbol.for(\"TableIndex\")\n\n // -------------------------------------------------------------------------\n // Public Properties\n // -------------------------------------------------------------------------\n\n /**\n * Index name.\n */\n name?: string\n\n /**\n * Columns included in this index.\n */\n columnNames: string[] = []\n\n /**\n * Indicates if this index is unique.\n */\n isUnique: boolean\n\n /**\n * The SPATIAL modifier indexes the entire column and does not allow indexed columns to contain NULL values.\n * Works only in MySQL.\n */\n isSpatial: boolean\n\n /**\n * The FULLTEXT modifier indexes the entire column and does not allow prefixing.\n * Works only in MySQL.\n */\n isFulltext: boolean\n\n /**\n * NULL_FILTERED indexes are particularly useful for indexing sparse columns, where most rows contain a NULL value.\n * In these cases, the NULL_FILTERED index can be considerably smaller and more efficient to maintain than\n * a normal index that includes NULL values.\n *\n * Works only in Spanner.\n */\n isNullFiltered: boolean\n\n /**\n * Fulltext parser.\n * Works only in MySQL.\n */\n parser?: string\n\n /**\n * Index filter condition.\n */\n where: string\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(options: TableIndexOptions) {\n this.name = options.name\n this.columnNames = options.columnNames\n this.isUnique = !!options.isUnique\n this.isSpatial = !!options.isSpatial\n this.isFulltext = !!options.isFulltext\n this.isNullFiltered = !!options.isNullFiltered\n this.parser = options.parser\n this.where = options.where ? options.where : \"\"\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Creates a new copy of this index with exactly same properties.\n */\n clone(): TableIndex {\n return new TableIndex(<TableIndexOptions>{\n name: this.name,\n columnNames: [...this.columnNames],\n isUnique: this.isUnique,\n isSpatial: this.isSpatial,\n isFulltext: this.isFulltext,\n isNullFiltered: this.isNullFiltered,\n parser: this.parser,\n where: this.where,\n })\n }\n\n // -------------------------------------------------------------------------\n // Static Methods\n // -------------------------------------------------------------------------\n\n /**\n * Creates index from the index metadata object.\n */\n static create(indexMetadata: IndexMetadata): TableIndex {\n return new TableIndex(<TableIndexOptions>{\n name: indexMetadata.name,\n columnNames: indexMetadata.columns.map(\n (column) => column.databaseName,\n ),\n isUnique: indexMetadata.isUnique,\n isSpatial: indexMetadata.isSpatial,\n isFulltext: indexMetadata.isFulltext,\n isNullFiltered: indexMetadata.isNullFiltered,\n parser: indexMetadata.parser,\n where: indexMetadata.where,\n })\n }\n}\n"],"sourceRoot":"../.."}
@@ -84,7 +84,7 @@ export declare class Broadcaster {
84
84
  *
85
85
  * Note: this method has a performance-optimized code organization, do not change code structure.
86
86
  */
87
- broadcastAfterInsertEvent(result: BroadcasterResult, metadata: EntityMetadata, entity?: ObjectLiteral, identifier?: ObjectLiteral): void;
87
+ broadcastAfterInsertEvent(result: BroadcasterResult, metadata: EntityMetadata, entity?: ObjectLiteral): void;
88
88
  /**
89
89
  * Broadcasts "BEFORE_TRANSACTION_START" event.
90
90
  */
@@ -228,7 +228,7 @@ class Broadcaster {
228
228
  *
229
229
  * Note: this method has a performance-optimized code organization, do not change code structure.
230
230
  */
231
- broadcastAfterInsertEvent(result, metadata, entity, identifier) {
231
+ broadcastAfterInsertEvent(result, metadata, entity) {
232
232
  if (entity && metadata.afterInsertListeners.length) {
233
233
  metadata.afterInsertListeners.forEach((listener) => {
234
234
  if (listener.isAllowed(entity)) {
@@ -249,7 +249,6 @@ class Broadcaster {
249
249
  manager: this.queryRunner.manager,
250
250
  entity: entity,
251
251
  metadata: metadata,
252
- entityId: metadata.getEntityIdMixedMap(identifier),
253
252
  });
254
253
  if (executionResult instanceof Promise)
255
254
  result.promises.push(executionResult);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/subscriber/Broadcaster.ts"],"names":[],"mappings":";;;AAIA,2DAAuD;AAGvD,qDAAiD;AAsEjD;;GAEG;AACH,MAAa,WAAW;IAC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ACR,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":".."}
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,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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":".."}
@@ -2,7 +2,6 @@ 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";
6
5
  /**
7
6
  * InsertEvent is an object that broadcaster sends to the entity subscriber when entity is inserted to the database.
8
7
  */
@@ -25,10 +24,6 @@ export interface InsertEvent<Entity> {
25
24
  * Inserting event.
26
25
  */
27
26
  entity: Entity;
28
- /**
29
- * Id or ids of the entity being inserted.
30
- */
31
- entityId?: ObjectLiteral;
32
27
  /**
33
28
  * Metadata of the entity.
34
29
  */
@@ -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\"\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":"../.."}
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":"../.."}