typeorm 0.2.42-dev.d6043b7 → 0.2.42-dev.e0adeee

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 (138) hide show
  1. package/browser/decorator/listeners/AfterRecover.d.ts +4 -0
  2. package/browser/decorator/listeners/AfterRecover.js +16 -0
  3. package/browser/decorator/listeners/AfterRecover.js.map +1 -0
  4. package/browser/decorator/listeners/AfterSoftRemove.d.ts +4 -0
  5. package/browser/decorator/listeners/AfterSoftRemove.js +16 -0
  6. package/browser/decorator/listeners/AfterSoftRemove.js.map +1 -0
  7. package/browser/decorator/listeners/BeforeRecover.d.ts +4 -0
  8. package/browser/decorator/listeners/BeforeRecover.js +16 -0
  9. package/browser/decorator/listeners/BeforeRecover.js.map +1 -0
  10. package/browser/decorator/listeners/BeforeSoftRemove.d.ts +4 -0
  11. package/browser/decorator/listeners/BeforeSoftRemove.js +16 -0
  12. package/browser/decorator/listeners/BeforeSoftRemove.js.map +1 -0
  13. package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js +1 -1
  14. package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
  15. package/browser/driver/mongodb/MongoConnectionOptions.d.ts +1 -1
  16. package/browser/driver/mongodb/MongoConnectionOptions.js.map +1 -1
  17. package/browser/entity-manager/MongoEntityManager.d.ts +2 -0
  18. package/browser/entity-manager/MongoEntityManager.js +35 -4
  19. package/browser/entity-manager/MongoEntityManager.js.map +1 -1
  20. package/browser/index.d.ts +4 -0
  21. package/browser/index.js +4 -0
  22. package/browser/index.js.map +1 -1
  23. package/browser/metadata/EntityMetadata.d.ts +16 -0
  24. package/browser/metadata/EntityMetadata.js +16 -0
  25. package/browser/metadata/EntityMetadata.js.map +1 -1
  26. package/browser/metadata/types/EventListenerTypes.d.ts +5 -1
  27. package/browser/metadata/types/EventListenerTypes.js +4 -0
  28. package/browser/metadata/types/EventListenerTypes.js.map +1 -1
  29. package/browser/metadata-builder/EntityMetadataBuilder.js +4 -0
  30. package/browser/metadata-builder/EntityMetadataBuilder.js.map +1 -1
  31. package/browser/persistence/SubjectExecutor.d.ts +2 -2
  32. package/browser/persistence/SubjectExecutor.js +6 -6
  33. package/browser/persistence/SubjectExecutor.js.map +1 -1
  34. package/browser/platform/PlatformTools.d.ts +1 -0
  35. package/browser/platform/PlatformTools.js +5 -0
  36. package/browser/platform/PlatformTools.js.map +1 -1
  37. package/browser/query-builder/InsertQueryBuilder.js +2 -2
  38. package/browser/query-builder/InsertQueryBuilder.js.map +1 -1
  39. package/browser/query-builder/SoftDeleteQueryBuilder.js +44 -30
  40. package/browser/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
  41. package/browser/subscriber/Broadcaster.d.ts +40 -0
  42. package/browser/subscriber/Broadcaster.js +156 -0
  43. package/browser/subscriber/Broadcaster.js.map +1 -1
  44. package/browser/subscriber/EntitySubscriberInterface.d.ts +18 -0
  45. package/browser/subscriber/EntitySubscriberInterface.js.map +1 -1
  46. package/browser/subscriber/event/RecoverEvent.d.ts +6 -0
  47. package/browser/subscriber/event/RecoverEvent.js +3 -0
  48. package/browser/subscriber/event/RecoverEvent.js.map +1 -0
  49. package/browser/subscriber/event/SoftRemoveEvent.d.ts +6 -0
  50. package/browser/subscriber/event/SoftRemoveEvent.js +3 -0
  51. package/browser/subscriber/event/SoftRemoveEvent.js.map +1 -0
  52. package/browser/util/RandomGenerator.d.ts +0 -4
  53. package/browser/util/RandomGenerator.js +0 -9
  54. package/browser/util/RandomGenerator.js.map +1 -1
  55. package/commands/CacheClearCommand.js +3 -3
  56. package/commands/CacheClearCommand.js.map +1 -1
  57. package/commands/EntityCreateCommand.js +2 -2
  58. package/commands/EntityCreateCommand.js.map +1 -1
  59. package/commands/InitCommand.js +2 -2
  60. package/commands/InitCommand.js.map +1 -1
  61. package/commands/MigrationCreateCommand.js +2 -2
  62. package/commands/MigrationCreateCommand.js.map +1 -1
  63. package/commands/MigrationGenerateCommand.js +2 -2
  64. package/commands/MigrationGenerateCommand.js.map +1 -1
  65. package/commands/MigrationRevertCommand.js +2 -3
  66. package/commands/MigrationRevertCommand.js.map +1 -1
  67. package/commands/MigrationRunCommand.js +2 -3
  68. package/commands/MigrationRunCommand.js.map +1 -1
  69. package/commands/MigrationShowCommand.js +5 -7
  70. package/commands/MigrationShowCommand.js.map +1 -1
  71. package/commands/QueryCommand.js +1 -2
  72. package/commands/QueryCommand.js.map +1 -1
  73. package/commands/SchemaDropCommand.js +2 -2
  74. package/commands/SchemaDropCommand.js.map +1 -1
  75. package/commands/SchemaLogCommand.js +2 -2
  76. package/commands/SchemaLogCommand.js.map +1 -1
  77. package/commands/SchemaSyncCommand.js +2 -2
  78. package/commands/SchemaSyncCommand.js.map +1 -1
  79. package/commands/SubscriberCreateCommand.js +3 -3
  80. package/commands/SubscriberCreateCommand.js.map +1 -1
  81. package/decorator/listeners/AfterRecover.d.ts +4 -0
  82. package/decorator/listeners/AfterRecover.js +20 -0
  83. package/decorator/listeners/AfterRecover.js.map +1 -0
  84. package/decorator/listeners/AfterSoftRemove.d.ts +4 -0
  85. package/decorator/listeners/AfterSoftRemove.js +20 -0
  86. package/decorator/listeners/AfterSoftRemove.js.map +1 -0
  87. package/decorator/listeners/BeforeRecover.d.ts +4 -0
  88. package/decorator/listeners/BeforeRecover.js +20 -0
  89. package/decorator/listeners/BeforeRecover.js.map +1 -0
  90. package/decorator/listeners/BeforeSoftRemove.d.ts +4 -0
  91. package/decorator/listeners/BeforeSoftRemove.js +20 -0
  92. package/decorator/listeners/BeforeSoftRemove.js.map +1 -0
  93. package/driver/aurora-data-api/AuroraDataApiQueryRunner.js +1 -1
  94. package/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
  95. package/driver/mongodb/MongoConnectionOptions.d.ts +1 -1
  96. package/driver/mongodb/MongoConnectionOptions.js.map +1 -1
  97. package/entity-manager/MongoEntityManager.d.ts +2 -0
  98. package/entity-manager/MongoEntityManager.js +35 -4
  99. package/entity-manager/MongoEntityManager.js.map +1 -1
  100. package/index.d.ts +4 -0
  101. package/index.js +4 -0
  102. package/index.js.map +1 -1
  103. package/index.mjs +8 -0
  104. package/metadata/EntityMetadata.d.ts +16 -0
  105. package/metadata/EntityMetadata.js +16 -0
  106. package/metadata/EntityMetadata.js.map +1 -1
  107. package/metadata/types/EventListenerTypes.d.ts +5 -1
  108. package/metadata/types/EventListenerTypes.js +4 -0
  109. package/metadata/types/EventListenerTypes.js.map +1 -1
  110. package/metadata-builder/EntityMetadataBuilder.js +4 -0
  111. package/metadata-builder/EntityMetadataBuilder.js.map +1 -1
  112. package/package.json +1 -1
  113. package/persistence/SubjectExecutor.d.ts +2 -2
  114. package/persistence/SubjectExecutor.js +6 -6
  115. package/persistence/SubjectExecutor.js.map +1 -1
  116. package/platform/PlatformTools.d.ts +1 -0
  117. package/platform/PlatformTools.js +5 -0
  118. package/platform/PlatformTools.js.map +1 -1
  119. package/query-builder/InsertQueryBuilder.js +2 -2
  120. package/query-builder/InsertQueryBuilder.js.map +1 -1
  121. package/query-builder/SoftDeleteQueryBuilder.js +44 -30
  122. package/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
  123. package/subscriber/Broadcaster.d.ts +40 -0
  124. package/subscriber/Broadcaster.js +156 -0
  125. package/subscriber/Broadcaster.js.map +1 -1
  126. package/subscriber/EntitySubscriberInterface.d.ts +18 -0
  127. package/subscriber/EntitySubscriberInterface.js.map +1 -1
  128. package/subscriber/event/RecoverEvent.d.ts +6 -0
  129. package/subscriber/event/RecoverEvent.js +4 -0
  130. package/subscriber/event/RecoverEvent.js.map +1 -0
  131. package/subscriber/event/SoftRemoveEvent.d.ts +6 -0
  132. package/subscriber/event/SoftRemoveEvent.js +4 -0
  133. package/subscriber/event/SoftRemoveEvent.js.map +1 -0
  134. package/typeorm-class-transformer-shim.js +20 -0
  135. package/typeorm-model-shim.js +20 -0
  136. package/util/RandomGenerator.d.ts +0 -4
  137. package/util/RandomGenerator.js +0 -9
  138. package/util/RandomGenerator.js.map +1 -1
@@ -154,6 +154,84 @@ var Broadcaster = /** @class */ (function () {
154
154
  });
155
155
  }
156
156
  };
157
+ /**
158
+ * Broadcasts "BEFORE_SOFT_REMOVE" event.
159
+ * Before soft remove event is executed before entity is being soft removed from the database.
160
+ * All subscribers and entity listeners who listened to this event will be executed at this point.
161
+ * Subscribers and entity listeners can return promises, it will wait until they are resolved.
162
+ *
163
+ * Note: this method has a performance-optimized code organization, do not change code structure.
164
+ */
165
+ Broadcaster.prototype.broadcastBeforeSoftRemoveEvent = function (result, metadata, entity, databaseEntity) {
166
+ var _this = this;
167
+ if (entity && metadata.beforeSoftRemoveListeners.length) {
168
+ metadata.beforeSoftRemoveListeners.forEach(function (listener) {
169
+ if (listener.isAllowed(entity)) {
170
+ var executionResult = listener.execute(entity);
171
+ if (executionResult instanceof Promise)
172
+ result.promises.push(executionResult);
173
+ result.count++;
174
+ }
175
+ });
176
+ }
177
+ if (this.queryRunner.connection.subscribers.length) {
178
+ this.queryRunner.connection.subscribers.forEach(function (subscriber) {
179
+ if (_this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.beforeSoftRemove) {
180
+ var executionResult = subscriber.beforeSoftRemove({
181
+ connection: _this.queryRunner.connection,
182
+ queryRunner: _this.queryRunner,
183
+ manager: _this.queryRunner.manager,
184
+ entity: entity,
185
+ metadata: metadata,
186
+ databaseEntity: databaseEntity,
187
+ entityId: metadata.getEntityIdMixedMap(databaseEntity)
188
+ });
189
+ if (executionResult instanceof Promise)
190
+ result.promises.push(executionResult);
191
+ result.count++;
192
+ }
193
+ });
194
+ }
195
+ };
196
+ /**
197
+ * Broadcasts "BEFORE_RECOVER" event.
198
+ * Before recover event is executed before entity is being recovered in the database.
199
+ * All subscribers and entity listeners who listened to this event will be executed at this point.
200
+ * Subscribers and entity listeners can return promises, it will wait until they are resolved.
201
+ *
202
+ * Note: this method has a performance-optimized code organization, do not change code structure.
203
+ */
204
+ Broadcaster.prototype.broadcastBeforeRecoverEvent = function (result, metadata, entity, databaseEntity) {
205
+ var _this = this;
206
+ if (entity && metadata.beforeRecoverListeners.length) {
207
+ metadata.beforeRecoverListeners.forEach(function (listener) {
208
+ if (listener.isAllowed(entity)) {
209
+ var executionResult = listener.execute(entity);
210
+ if (executionResult instanceof Promise)
211
+ result.promises.push(executionResult);
212
+ result.count++;
213
+ }
214
+ });
215
+ }
216
+ if (this.queryRunner.connection.subscribers.length) {
217
+ this.queryRunner.connection.subscribers.forEach(function (subscriber) {
218
+ if (_this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.beforeRecover) {
219
+ var executionResult = subscriber.beforeRecover({
220
+ connection: _this.queryRunner.connection,
221
+ queryRunner: _this.queryRunner,
222
+ manager: _this.queryRunner.manager,
223
+ entity: entity,
224
+ metadata: metadata,
225
+ databaseEntity: databaseEntity,
226
+ entityId: metadata.getEntityIdMixedMap(databaseEntity)
227
+ });
228
+ if (executionResult instanceof Promise)
229
+ result.promises.push(executionResult);
230
+ result.count++;
231
+ }
232
+ });
233
+ }
234
+ };
157
235
  /**
158
236
  * Broadcasts "AFTER_INSERT" event.
159
237
  * After insert event is executed after entity is being persisted to the database for the first time.
@@ -390,6 +468,84 @@ var Broadcaster = /** @class */ (function () {
390
468
  });
391
469
  }
392
470
  };
471
+ /**
472
+ * Broadcasts "AFTER_SOFT_REMOVE" event.
473
+ * After soft remove event is executed after entity is being soft removed from the database.
474
+ * All subscribers and entity listeners who listened to this event will be executed at this point.
475
+ * Subscribers and entity listeners can return promises, it will wait until they are resolved.
476
+ *
477
+ * Note: this method has a performance-optimized code organization, do not change code structure.
478
+ */
479
+ Broadcaster.prototype.broadcastAfterSoftRemoveEvent = function (result, metadata, entity, databaseEntity) {
480
+ var _this = this;
481
+ if (entity && metadata.afterSoftRemoveListeners.length) {
482
+ metadata.afterSoftRemoveListeners.forEach(function (listener) {
483
+ if (listener.isAllowed(entity)) {
484
+ var executionResult = listener.execute(entity);
485
+ if (executionResult instanceof Promise)
486
+ result.promises.push(executionResult);
487
+ result.count++;
488
+ }
489
+ });
490
+ }
491
+ if (this.queryRunner.connection.subscribers.length) {
492
+ this.queryRunner.connection.subscribers.forEach(function (subscriber) {
493
+ if (_this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.afterSoftRemove) {
494
+ var executionResult = subscriber.afterSoftRemove({
495
+ connection: _this.queryRunner.connection,
496
+ queryRunner: _this.queryRunner,
497
+ manager: _this.queryRunner.manager,
498
+ entity: entity,
499
+ metadata: metadata,
500
+ databaseEntity: databaseEntity,
501
+ entityId: metadata.getEntityIdMixedMap(databaseEntity)
502
+ });
503
+ if (executionResult instanceof Promise)
504
+ result.promises.push(executionResult);
505
+ result.count++;
506
+ }
507
+ });
508
+ }
509
+ };
510
+ /**
511
+ * Broadcasts "AFTER_RECOVER" event.
512
+ * After recover event is executed after entity is being recovered in the database.
513
+ * All subscribers and entity listeners who listened to this event will be executed at this point.
514
+ * Subscribers and entity listeners can return promises, it will wait until they are resolved.
515
+ *
516
+ * Note: this method has a performance-optimized code organization, do not change code structure.
517
+ */
518
+ Broadcaster.prototype.broadcastAfterRecoverEvent = function (result, metadata, entity, databaseEntity) {
519
+ var _this = this;
520
+ if (entity && metadata.afterRecoverListeners.length) {
521
+ metadata.afterRecoverListeners.forEach(function (listener) {
522
+ if (listener.isAllowed(entity)) {
523
+ var executionResult = listener.execute(entity);
524
+ if (executionResult instanceof Promise)
525
+ result.promises.push(executionResult);
526
+ result.count++;
527
+ }
528
+ });
529
+ }
530
+ if (this.queryRunner.connection.subscribers.length) {
531
+ this.queryRunner.connection.subscribers.forEach(function (subscriber) {
532
+ if (_this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.afterRecover) {
533
+ var executionResult = subscriber.afterRecover({
534
+ connection: _this.queryRunner.connection,
535
+ queryRunner: _this.queryRunner,
536
+ manager: _this.queryRunner.manager,
537
+ entity: entity,
538
+ metadata: metadata,
539
+ databaseEntity: databaseEntity,
540
+ entityId: metadata.getEntityIdMixedMap(databaseEntity)
541
+ });
542
+ if (executionResult instanceof Promise)
543
+ result.promises.push(executionResult);
544
+ result.count++;
545
+ }
546
+ });
547
+ }
548
+ };
393
549
  /**
394
550
  * @deprecated Use `broadcastLoadForAllEvent`
395
551
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["../browser/src/subscriber/Broadcaster.ts"],"names":[],"mappings":";AAIA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAyBtD;;GAEG;AACH;IAEI,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,qBAAoB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAC5C,CAAC;IAED,4EAA4E;IAC5E,iBAAiB;IACjB,4EAA4E;IAEtE,+BAAS,GAAf,UAAmD,KAAQ;QAAE,cAAyC;aAAzC,UAAyC,EAAzC,qBAAyC,EAAzC,IAAyC;YAAzC,6BAAyC;;;;;;;;wBAC5F,MAAM,GAAG,IAAI,iBAAiB,EAAE,CAAC;wBAEjC,iBAAiB,GAAG,IAAI,CAAC,cAAY,KAAK,UAAqB,CAAC,CAAC;wBAEvE,IAAI,OAAO,iBAAiB,KAAK,UAAU,EAAE;4BACzC,CAAA,KAAC,iBAAyB,CAAA,CAAC,IAAI,0BAC3B,IAAI;gCACJ,MAAM,UACH,IAAI,WACT;yBACL;wBAED,qBAAM,MAAM,CAAC,IAAI,EAAE,EAAA;;wBAAnB,SAAmB,CAAC;;;;;KACvB;IAED;;;;;;;OAOG;IACH,gDAA0B,GAA1B,UAA2B,MAAyB,EAAE,QAAwB,EAAE,MAAiC;QAAjH,iBA6BC;QA3BG,IAAI,MAAM,IAAI,QAAQ,CAAC,qBAAqB,CAAC,MAAM,EAAE;YACjD,QAAQ,CAAC,qBAAqB,CAAC,OAAO,CAAC,UAAA,QAAQ;gBAC3C,IAAI,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;oBAC5B,IAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;o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AAE,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IACpD,CAAC;IAEL,kBAAC;AAAD,CAvdA,AAudC,IAAA","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\";\n\ninterface BroadcasterEvents {\n \"BeforeTransactionCommit\": () => void;\n \"AfterTransactionCommit\": () => void;\n \"BeforeTransactionStart\": () => void;\n \"AfterTransactionStart\": () => void;\n \"BeforeTransactionRollback\": () => void;\n \"AfterTransactionRollback\": () => void;\n\n \"BeforeUpdate\": (metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral, updatedColumns?: ColumnMetadata[], updatedRelations?: RelationMetadata[]) => void;\n \"AfterUpdate\": (metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral, updatedColumns?: ColumnMetadata[], updatedRelations?: RelationMetadata[]) => void;\n\n \"BeforeInsert\": (metadata: EntityMetadata, entity: ObjectLiteral | undefined) => void;\n \"AfterInsert\": (metadata: EntityMetadata, entity: ObjectLiteral | undefined) => void;\n\n \"BeforeRemove\": (metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral) => void;\n \"AfterRemove\": (metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral) => void;\n\n \"Load\": (metadata: EntityMetadata, entities: ObjectLiteral[]) => void;\n}\n\n\n/**\n * Broadcaster provides a helper methods to broadcast events to the subscribers.\n */\nexport class Broadcaster {\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(private queryRunner: QueryRunner) {\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n async broadcast<U extends keyof BroadcasterEvents>(event: U, ...args: Parameters<BroadcasterEvents[U]>): 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(\n this,\n result,\n ...args\n );\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(result: BroadcasterResult, metadata: EntityMetadata, entity: undefined | ObjectLiteral): void {\n\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 (this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.beforeInsert) {\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(result: BroadcasterResult, metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral, updatedColumns?: ColumnMetadata[], updatedRelations?: RelationMetadata[]): void { // 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 (this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.beforeUpdate) {\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(result: BroadcasterResult, metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral): 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 (this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.beforeRemove) {\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(databaseEntity)\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(result: BroadcasterResult, metadata: EntityMetadata, entity?: ObjectLiteral): void {\n\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 (this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.afterInsert) {\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 = 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 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_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(result: BroadcasterResult, metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral, updatedColumns?: ColumnMetadata[], updatedRelations?: RelationMetadata[]): void {\n\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 (this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.afterUpdate) {\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(result: BroadcasterResult, metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral): void {\n\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 (this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.afterRemove) {\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(databaseEntity)\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(result: BroadcasterResult, metadata: EntityMetadata, entities: ObjectLiteral[]): 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(result: BroadcasterResult, metadata: EntityMetadata, entities: ObjectLiteral[]): void {\n entities.forEach(entity => {\n if (entity instanceof Promise) // todo: check why need this?\n return;\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\n // in lazy relations we cannot simply access to entity property because it will cause a getter and a database query\n if (relation.isLazy && !entity.hasOwnProperty(relation.propertyName))\n return;\n\n const value = relation.getEntityValue(entity);\n if (value instanceof Object)\n this.broadcastLoadEvent(result, relation.inverseEntityMetadata, Array.isArray(value) ? value : [value]);\n });\n }\n\n if (metadata.afterLoadListeners.length) {\n metadata.afterLoadListeners.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 (this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.afterLoad) {\n const executionResult = subscriber.afterLoad!(entity, {\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 // -------------------------------------------------------------------------\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(subscriber: EntitySubscriberInterface<any>, target: Function|string): boolean {\n return !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":["../browser/src/subscriber/Broadcaster.ts"],"names":[],"mappings":";AAIA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AA+BtD;;GAEG;AACH;IAEI,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,qBAAoB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAC5C,CAAC;IAED,4EAA4E;IAC5E,iBAAiB;IACjB,4EAA4E;IAEtE,+BAAS,GAAf,UAAmD,KAAQ;QAAE,cAAyC;aAAzC,UAAyC,EAAzC,qBAAyC,EAAzC,IAAyC;YAAzC,6BAAyC;;;;;;;;wBAC5F,MAAM,GAAG,IAAI,iBAAiB,EAAE,CAAC;wBAEjC,iBAAiB,GAAG,IAAI,CAAC,cAAY,KAAK,UAAqB,CAAC,CAAC;wBA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AI,CAAC,mBAAmB,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,SAAS,EAAE;wBAC/E,IAAM,eAAe,GAAG,UAAU,CAAC,SAAU,CAAC,MAAM,EAAE;4BAClD,UAAU,EAAE,KAAI,CAAC,WAAW,CAAC,UAAU;4BACvC,WAAW,EAAE,KAAI,CAAC,WAAW;4BAC7B,OAAO,EAAE,KAAI,CAAC,WAAW,CAAC,OAAO;4BACjC,MAAM,EAAE,MAAM;4BACd,QAAQ,EAAE,QAAQ;yBACrB,CAAC,CAAC;wBACH,IAAI,eAAe,YAAY,OAAO;4BAClC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;wBAC1C,MAAM,CAAC,KAAK,EAAE,CAAC;qBAClB;gBACL,CAAC,CAAC,CAAC;aACN;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAED,4EAA4E;IAC5E,oBAAoB;IACpB,4EAA4E;IAE5E;;;OAGG;IACO,yCAAmB,GAA7B,UAA8B,UAA0C,EAAE,MAAuB;QAC7F,OAAQ,CAAC,UAAU,CAAC,QAAQ;YACxB,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,CAAC;IACpD,CAAC;IAEL,kBAAC;AAAD,CAznBA,AAynBC,IAAA","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\";\n\ninterface BroadcasterEvents {\n \"BeforeTransactionCommit\": () => void;\n \"AfterTransactionCommit\": () => void;\n \"BeforeTransactionStart\": () => void;\n \"AfterTransactionStart\": () => void;\n \"BeforeTransactionRollback\": () => void;\n \"AfterTransactionRollback\": () => void;\n\n \"BeforeUpdate\": (metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral, updatedColumns?: ColumnMetadata[], updatedRelations?: RelationMetadata[]) => void;\n \"AfterUpdate\": (metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral, updatedColumns?: ColumnMetadata[], updatedRelations?: RelationMetadata[]) => void;\n\n \"BeforeInsert\": (metadata: EntityMetadata, entity: ObjectLiteral | undefined) => void;\n \"AfterInsert\": (metadata: EntityMetadata, entity: ObjectLiteral | undefined) => void;\n\n \"BeforeRemove\": (metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral) => void;\n \"AfterRemove\": (metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral) => void;\n\n \"BeforeSoftRemove\": (metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral) => void;\n \"AfterSoftRemove\": (metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral) => void;\n\n \"BeforeRecover\": (metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral) => void;\n \"AfterRecover\": (metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral) => void;\n\n \"Load\": (metadata: EntityMetadata, entities: ObjectLiteral[]) => void;\n}\n\n\n/**\n * Broadcaster provides a helper methods to broadcast events to the subscribers.\n */\nexport class Broadcaster {\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(private queryRunner: QueryRunner) {\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n async broadcast<U extends keyof BroadcasterEvents>(event: U, ...args: Parameters<BroadcasterEvents[U]>): 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(\n this,\n result,\n ...args\n );\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(result: BroadcasterResult, metadata: EntityMetadata, entity: undefined | ObjectLiteral): void {\n\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 (this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.beforeInsert) {\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(result: BroadcasterResult, metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral, updatedColumns?: ColumnMetadata[], updatedRelations?: RelationMetadata[]): void { // 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 (this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.beforeUpdate) {\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(result: BroadcasterResult, metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral): 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 (this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.beforeRemove) {\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(databaseEntity)\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(result: BroadcasterResult, metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral): 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 (this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.beforeSoftRemove) {\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(databaseEntity)\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(result: BroadcasterResult, metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral): 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 (this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.beforeRecover) {\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(databaseEntity)\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(result: BroadcasterResult, metadata: EntityMetadata, entity?: ObjectLiteral): void {\n\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 (this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.afterInsert) {\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 = 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 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_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(result: BroadcasterResult, metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral, updatedColumns?: ColumnMetadata[], updatedRelations?: RelationMetadata[]): void {\n\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 (this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.afterUpdate) {\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(result: BroadcasterResult, metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral): void {\n\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 (this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.afterRemove) {\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(databaseEntity)\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(result: BroadcasterResult, metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral): void {\n\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 (this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.afterSoftRemove) {\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(databaseEntity)\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(result: BroadcasterResult, metadata: EntityMetadata, entity?: ObjectLiteral, databaseEntity?: ObjectLiteral): void {\n\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 (this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.afterRecover) {\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(databaseEntity)\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(result: BroadcasterResult, metadata: EntityMetadata, entities: ObjectLiteral[]): 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(result: BroadcasterResult, metadata: EntityMetadata, entities: ObjectLiteral[]): void {\n entities.forEach(entity => {\n if (entity instanceof Promise) // todo: check why need this?\n return;\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\n // in lazy relations we cannot simply access to entity property because it will cause a getter and a database query\n if (relation.isLazy && !entity.hasOwnProperty(relation.propertyName))\n return;\n\n const value = relation.getEntityValue(entity);\n if (value instanceof Object)\n this.broadcastLoadEvent(result, relation.inverseEntityMetadata, Array.isArray(value) ? value : [value]);\n });\n }\n\n if (metadata.afterLoadListeners.length) {\n metadata.afterLoadListeners.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 (this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.afterLoad) {\n const executionResult = subscriber.afterLoad!(entity, {\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 // -------------------------------------------------------------------------\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(subscriber: EntitySubscriberInterface<any>, target: Function|string): boolean {\n return !subscriber.listenTo ||\n !subscriber.listenTo() ||\n subscriber.listenTo() === Object ||\n subscriber.listenTo() === target ||\n subscriber.listenTo().isPrototypeOf(target);\n }\n\n}\n"],"sourceRoot":".."}
@@ -5,6 +5,8 @@ import { UpdateEvent } from "./event/UpdateEvent";
5
5
  import { RemoveEvent } from "./event/RemoveEvent";
6
6
  import { InsertEvent } from "./event/InsertEvent";
7
7
  import { LoadEvent } from "./event/LoadEvent";
8
+ import { SoftRemoveEvent } from "./event/SoftRemoveEvent";
9
+ import { RecoverEvent } from "./event/RecoverEvent";
8
10
  /**
9
11
  * Classes that implement this interface are subscribers that subscribe for the specific events in the ORM.
10
12
  */
@@ -43,10 +45,26 @@ export interface EntitySubscriberInterface<Entity = any> {
43
45
  * Called before entity is removed from the database.
44
46
  */
45
47
  beforeRemove?(event: RemoveEvent<Entity>): Promise<any> | void;
48
+ /**
49
+ * Called before entity is soft removed from the database.
50
+ */
51
+ beforeSoftRemove?(event: SoftRemoveEvent<Entity>): Promise<any> | void;
52
+ /**
53
+ * Called before entity is recovered in the database.
54
+ */
55
+ beforeRecover?(event: RecoverEvent<Entity>): Promise<any> | void;
46
56
  /**
47
57
  * Called after entity is removed from the database.
48
58
  */
49
59
  afterRemove?(event: RemoveEvent<Entity>): Promise<any> | void;
60
+ /**
61
+ * Called after entity is soft removed from the database.
62
+ */
63
+ afterSoftRemove?(event: SoftRemoveEvent<Entity>): Promise<any> | void;
64
+ /**
65
+ * Called after entity is recovered in the database.
66
+ */
67
+ afterRecover?(event: RecoverEvent<Entity>): Promise<any> | void;
50
68
  /**
51
69
  * Called before transaction is started.
52
70
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["../browser/src/subscriber/EntitySubscriberInterface.ts"],"names":[],"mappings":"","file":"EntitySubscriberInterface.js","sourcesContent":["import { TransactionCommitEvent } from \"./event/TransactionCommitEvent\";\nimport { TransactionRollbackEvent } from \"./event/TransactionRollbackEvent\";\nimport { TransactionStartEvent } from \"./event/TransactionStartEvent\";\nimport {UpdateEvent} from \"./event/UpdateEvent\";\nimport {RemoveEvent} from \"./event/RemoveEvent\";\nimport {InsertEvent} from \"./event/InsertEvent\";\nimport {LoadEvent} from \"./event/LoadEvent\";\n\n/**\n * Classes that implement this interface are subscribers that subscribe for the specific events in the ORM.\n */\nexport interface EntitySubscriberInterface<Entity = any> {\n\n /**\n * Returns the class of the entity to which events will listen.\n * If this method is omitted, then subscriber will listen to events of all entities.\n */\n listenTo?(): Function | string;\n\n /**\n * Called after entity is loaded from the database.\n *\n * For backward compatibility this signature is slightly different from the\n * others. `event` was added later but is always provided (it is only\n * optional in the signature so that its introduction does not break\n * compilation for existing subscribers).\n */\n afterLoad?(entity: Entity, event?: LoadEvent<Entity>): Promise<any>|void;\n\n /**\n * Called before entity is inserted to the database.\n */\n beforeInsert?(event: InsertEvent<Entity>): Promise<any>|void;\n\n /**\n * Called after entity is inserted to the database.\n */\n afterInsert?(event: InsertEvent<Entity>): Promise<any>|void;\n\n /**\n * Called before entity is updated in the database.\n */\n beforeUpdate?(event: UpdateEvent<Entity>): Promise<any>|void;\n\n /**\n * Called after entity is updated in the database.\n */\n afterUpdate?(event: UpdateEvent<Entity>): Promise<any>|void;\n\n /**\n * Called before entity is removed from the database.\n */\n beforeRemove?(event: RemoveEvent<Entity>): Promise<any>|void;\n\n /**\n * Called after entity is removed from the database.\n */\n afterRemove?(event: RemoveEvent<Entity>): Promise<any>|void;\n\n /**\n * Called before transaction is started.\n */\n beforeTransactionStart?(event: TransactionStartEvent): Promise<any>|void;\n\n /**\n * Called after transaction is started.\n */\n afterTransactionStart?(event: TransactionStartEvent): Promise<any>|void;\n\n /**\n * Called before transaction is committed.\n */\n beforeTransactionCommit?(event: TransactionCommitEvent): Promise<any>|void;\n\n /**\n * Called after transaction is committed.\n */\n afterTransactionCommit?(event: TransactionCommitEvent): Promise<any>|void;\n\n /**\n * Called before transaction rollback.\n */\n beforeTransactionRollback?(event: TransactionRollbackEvent): Promise<any>|void;\n\n /**\n * Called after transaction rollback.\n */\n afterTransactionRollback?(event: TransactionRollbackEvent): Promise<any>|void;\n\n}\n"],"sourceRoot":".."}
1
+ {"version":3,"sources":["../browser/src/subscriber/EntitySubscriberInterface.ts"],"names":[],"mappings":"","file":"EntitySubscriberInterface.js","sourcesContent":["import { TransactionCommitEvent } from \"./event/TransactionCommitEvent\";\nimport { TransactionRollbackEvent } from \"./event/TransactionRollbackEvent\";\nimport { TransactionStartEvent } from \"./event/TransactionStartEvent\";\nimport {UpdateEvent} from \"./event/UpdateEvent\";\nimport {RemoveEvent} from \"./event/RemoveEvent\";\nimport {InsertEvent} from \"./event/InsertEvent\";\nimport {LoadEvent} from \"./event/LoadEvent\";\nimport { SoftRemoveEvent } from \"./event/SoftRemoveEvent\";\nimport { RecoverEvent } from \"./event/RecoverEvent\";\n\n/**\n * Classes that implement this interface are subscribers that subscribe for the specific events in the ORM.\n */\nexport interface EntitySubscriberInterface<Entity = any> {\n\n /**\n * Returns the class of the entity to which events will listen.\n * If this method is omitted, then subscriber will listen to events of all entities.\n */\n listenTo?(): Function | string;\n\n /**\n * Called after entity is loaded from the database.\n *\n * For backward compatibility this signature is slightly different from the\n * others. `event` was added later but is always provided (it is only\n * optional in the signature so that its introduction does not break\n * compilation for existing subscribers).\n */\n afterLoad?(entity: Entity, event?: LoadEvent<Entity>): Promise<any>|void;\n\n /**\n * Called before entity is inserted to the database.\n */\n beforeInsert?(event: InsertEvent<Entity>): Promise<any>|void;\n\n /**\n * Called after entity is inserted to the database.\n */\n afterInsert?(event: InsertEvent<Entity>): Promise<any>|void;\n\n /**\n * Called before entity is updated in the database.\n */\n beforeUpdate?(event: UpdateEvent<Entity>): Promise<any>|void;\n\n /**\n * Called after entity is updated in the database.\n */\n afterUpdate?(event: UpdateEvent<Entity>): Promise<any>|void;\n\n /**\n * Called before entity is removed from the database.\n */\n beforeRemove?(event: RemoveEvent<Entity>): Promise<any>|void;\n\n /**\n * Called before entity is soft removed from the database.\n */\n beforeSoftRemove?(event: SoftRemoveEvent<Entity>): Promise<any>|void;\n\n /**\n * Called before entity is recovered in the database.\n */\n beforeRecover?(event: RecoverEvent<Entity>): Promise<any>|void;\n\n /**\n * Called after entity is removed from the database.\n */\n afterRemove?(event: RemoveEvent<Entity>): Promise<any>|void;\n\n /**\n * Called after entity is soft removed from the database.\n */\n afterSoftRemove?(event: SoftRemoveEvent<Entity>): Promise<any>|void;\n\n /**\n * Called after entity is recovered in the database.\n */\n afterRecover?(event: RecoverEvent<Entity>): Promise<any>|void;\n\n /**\n * Called before transaction is started.\n */\n beforeTransactionStart?(event: TransactionStartEvent): Promise<any>|void;\n\n /**\n * Called after transaction is started.\n */\n afterTransactionStart?(event: TransactionStartEvent): Promise<any>|void;\n\n /**\n * Called before transaction is committed.\n */\n beforeTransactionCommit?(event: TransactionCommitEvent): Promise<any>|void;\n\n /**\n * Called after transaction is committed.\n */\n afterTransactionCommit?(event: TransactionCommitEvent): Promise<any>|void;\n\n /**\n * Called before transaction rollback.\n */\n beforeTransactionRollback?(event: TransactionRollbackEvent): Promise<any>|void;\n\n /**\n * Called after transaction rollback.\n */\n afterTransactionRollback?(event: TransactionRollbackEvent): Promise<any>|void;\n\n}\n"],"sourceRoot":".."}
@@ -0,0 +1,6 @@
1
+ import { RemoveEvent } from "./RemoveEvent";
2
+ /**
3
+ * RecoverEvent is an object that broadcaster sends to the entity subscriber when entity is being recovered in the database.
4
+ */
5
+ export interface RecoverEvent<Entity> extends RemoveEvent<Entity> {
6
+ }
@@ -0,0 +1,3 @@
1
+ export {};
2
+
3
+ //# sourceMappingURL=RecoverEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../browser/src/subscriber/event/RecoverEvent.ts"],"names":[],"mappings":"","file":"RecoverEvent.js","sourcesContent":["import { RemoveEvent } from \"./RemoveEvent\";\n\n/**\n * RecoverEvent is an object that broadcaster sends to the entity subscriber when entity is being recovered in the database.\n */\nexport interface RecoverEvent<Entity> extends RemoveEvent<Entity> {}\n"],"sourceRoot":"../.."}
@@ -0,0 +1,6 @@
1
+ import { RemoveEvent } from "./RemoveEvent";
2
+ /**
3
+ * SoftRemoveEvent is an object that broadcaster sends to the entity subscriber when entity is being soft removed to the database.
4
+ */
5
+ export interface SoftRemoveEvent<Entity> extends RemoveEvent<Entity> {
6
+ }
@@ -0,0 +1,3 @@
1
+ export {};
2
+
3
+ //# sourceMappingURL=SoftRemoveEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../browser/src/subscriber/event/SoftRemoveEvent.ts"],"names":[],"mappings":"","file":"SoftRemoveEvent.js","sourcesContent":["import { RemoveEvent } from \"./RemoveEvent\";\n\n/**\n * SoftRemoveEvent is an object that broadcaster sends to the entity subscriber when entity is being soft removed to the database.\n */\nexport interface SoftRemoveEvent<Entity> extends RemoveEvent<Entity> {}\n"],"sourceRoot":"../.."}
@@ -12,8 +12,4 @@ export declare class RandomGenerator {
12
12
  * returns 1: '54916d2e62f65b3afa6e192e6a601cdbe5cb5897'
13
13
  */
14
14
  static sha1(str: string): string;
15
- /**
16
- * RFC4122 compliant UUID v4 generator.
17
- */
18
- static uuid4(): string;
19
15
  }
@@ -125,15 +125,6 @@ var RandomGenerator = /** @class */ (function () {
125
125
  temp = _cvtHex(H0) + _cvtHex(H1) + _cvtHex(H2) + _cvtHex(H3) + _cvtHex(H4);
126
126
  return temp.toLowerCase();
127
127
  };
128
- /**
129
- * RFC4122 compliant UUID v4 generator.
130
- */
131
- RandomGenerator.uuid4 = function () {
132
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
133
- var r = Math.random() * 16 | 0, v = c === "x" ? r : (r & 0x3 | 0x8);
134
- return v.toString(16);
135
- });
136
- };
137
128
  return RandomGenerator;
138
129
  }());
139
130
  export { RandomGenerator };
@@ -1 +1 @@
1
- {"version":3,"sources":["../browser/src/util/RandomGenerator.ts"],"names":[],"mappings":"AAAA;IAAA;IA2JA,CAAC;IAzJG;;;;;;;;;;;OAWG;IACI,oBAAI,GAAX,UAAY,GAAW;QAEnB,IAAI,QAAQ,GAAG,UAAS,CAAM,EAAE,CAAM;YAClC,IAAI,EAAE,GAAG,CAAC,CAA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IAAA","file":"RandomGenerator.js","sourcesContent":["export class RandomGenerator {\n\n /**\n * discuss at: http://locutus.io/php/sha1/\n * original by: Webtoolkit.info (http://www.webtoolkit.info/)\n * improved by: Michael White (http://getsprink.com)\n * improved by: Kevin van Zonneveld (http://kvz.io)\n * input by: Brett Zamir (http://brett-zamir.me)\n * note 1: Keep in mind that in accordance with PHP, the whole string is buffered and then\n * note 1: hashed. If available, we'd recommend using Node's native crypto modules directly\n * note 1: in a steaming fashion for faster and more efficient hashing\n * example 1: sha1('Kevin van Zonneveld')\n * returns 1: '54916d2e62f65b3afa6e192e6a601cdbe5cb5897'\n */\n static sha1(str: string) {\n\n let _rotLeft = function(n: any, s: any) {\n let t4 = (n << s) | (n >>> (32 - s));\n return t4;\n };\n\n let _cvtHex = function(val: any) {\n let str = \"\";\n let i;\n let v;\n\n for (i = 7; i >= 0; i--) {\n v = (val >>> (i * 4)) & 0x0f;\n str += v.toString(16);\n }\n return str;\n };\n\n let blockstart;\n let i, j;\n let W = new Array(80);\n let H0 = 0x67452301;\n let H1 = 0xEFCDAB89;\n let H2 = 0x98BADCFE;\n let H3 = 0x10325476;\n let H4 = 0xC3D2E1F0;\n let A, B, C, D, E;\n let temp;\n\n // utf8_encode\n str = /*unescape*/(encodeURIComponent(str));\n let strLen = str.length;\n\n let wordArray = [];\n for (i = 0; i < strLen - 3; i += 4) {\n j = str.charCodeAt(i) << 24 |\n str.charCodeAt(i + 1) << 16 |\n str.charCodeAt(i + 2) << 8 |\n str.charCodeAt(i + 3);\n wordArray.push(j);\n }\n\n switch (strLen % 4) {\n case 0:\n i = 0x080000000;\n break;\n case 1:\n i = str.charCodeAt(strLen - 1) << 24 | 0x0800000;\n break;\n case 2:\n i = str.charCodeAt(strLen - 2) << 24 | str.charCodeAt(strLen - 1) << 16 | 0x08000;\n break;\n case 3:\n i = str.charCodeAt(strLen - 3) << 24 |\n str.charCodeAt(strLen - 2) << 16 |\n str.charCodeAt(strLen - 1) <<\n 8 | 0x80;\n break;\n }\n\n wordArray.push(i);\n\n while ((wordArray.length % 16) !== 14) {\n wordArray.push(0);\n }\n\n wordArray.push(strLen >>> 29);\n wordArray.push((strLen << 3) & 0x0ffffffff);\n\n for (blockstart = 0; blockstart < wordArray.length; blockstart += 16) {\n for (i = 0; i < 16; i++) {\n W[i] = wordArray[blockstart + i];\n }\n for (i = 16; i <= 79; i++) {\n W[i] = _rotLeft(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\n }\n\n A = H0;\n B = H1;\n C = H2;\n D = H3;\n E = H4;\n\n for (i = 0; i <= 19; i++) {\n temp = (_rotLeft(A, 5) + ((B & C) | (~B & D)) + E + W[i] + 0x5A827999) & 0x0ffffffff;\n E = D;\n D = C;\n C = _rotLeft(B, 30);\n B = A;\n A = temp;\n }\n\n for (i = 20; i <= 39; i++) {\n temp = (_rotLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0x6ED9EBA1) & 0x0ffffffff;\n E = D;\n D = C;\n C = _rotLeft(B, 30);\n B = A;\n A = temp;\n }\n\n for (i = 40; i <= 59; i++) {\n temp = (_rotLeft(A, 5) + ((B & C) | (B & D) | (C & D)) + E + W[i] + 0x8F1BBCDC) & 0x0ffffffff;\n E = D;\n D = C;\n C = _rotLeft(B, 30);\n B = A;\n A = temp;\n }\n\n for (i = 60; i <= 79; i++) {\n temp = (_rotLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0xCA62C1D6) & 0x0ffffffff;\n E = D;\n D = C;\n C = _rotLeft(B, 30);\n B = A;\n A = temp;\n }\n\n H0 = (H0 + A) & 0x0ffffffff;\n H1 = (H1 + B) & 0x0ffffffff;\n H2 = (H2 + C) & 0x0ffffffff;\n H3 = (H3 + D) & 0x0ffffffff;\n H4 = (H4 + E) & 0x0ffffffff;\n }\n\n temp = _cvtHex(H0) + _cvtHex(H1) + _cvtHex(H2) + _cvtHex(H3) + _cvtHex(H4);\n return temp.toLowerCase();\n }\n\n /**\n * RFC4122 compliant UUID v4 generator.\n */\n static uuid4(): string {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, (c) => {\n const r = Math.random() * 16 | 0, v = c === \"x\" ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }\n\n}"],"sourceRoot":".."}
1
+ {"version":3,"sources":["../browser/src/util/RandomGenerator.ts"],"names":[],"mappings":"AAAA;IAAA;IAgJA,CAAC;IA9IG;;;;;;;;;;;OAWG;IACI,oBAAI,GAAX,UAAY,GAAW;QAEnB,IAAI,QAAQ,GAAG,UAAS,CAAM,EAAE,CAAM;YAClC,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;YACrC,OAAO,EAAE,CAAC;QACd,CAAC,CAAC;QAEF,IAAI,OAAO,GAAG,UAAS,GAAQ;YAC3B,IAAI,GAAG,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,CAAC;YACN,IAAI,CAAC,CAAC;YAEN,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;gBACrB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;gBAC7B,GAAG,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;aACzB;YACD,OAAO,GAAG,CAAC;QACf,CAAC,CAAC;QAEF,IAAI,UAAU,CAAC;QACf,IAAI,CAAC,EAAE,CAAC,CAAC;QACT,IAAI,CAAC,GAAG,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC;QACtB,IAAI,EAAE,GAAG,UAAU,CAAC;QACpB,IAAI,EAAE,GAAG,UAAU,CAAC;QACpB,IAAI,EAAE,GAAG,UAAU,CAAC;QACpB,IAAI,EAAE,GAAG,UAAU,CAAC;QACpB,IAAI,EAAE,GAAG,UAAU,CAA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AC;AAAD,CAhJA,AAgJC,IAAA","file":"RandomGenerator.js","sourcesContent":["export class RandomGenerator {\n\n /**\n * discuss at: http://locutus.io/php/sha1/\n * original by: Webtoolkit.info (http://www.webtoolkit.info/)\n * improved by: Michael White (http://getsprink.com)\n * improved by: Kevin van Zonneveld (http://kvz.io)\n * input by: Brett Zamir (http://brett-zamir.me)\n * note 1: Keep in mind that in accordance with PHP, the whole string is buffered and then\n * note 1: hashed. If available, we'd recommend using Node's native crypto modules directly\n * note 1: in a steaming fashion for faster and more efficient hashing\n * example 1: sha1('Kevin van Zonneveld')\n * returns 1: '54916d2e62f65b3afa6e192e6a601cdbe5cb5897'\n */\n static sha1(str: string) {\n\n let _rotLeft = function(n: any, s: any) {\n let t4 = (n << s) | (n >>> (32 - s));\n return t4;\n };\n\n let _cvtHex = function(val: any) {\n let str = \"\";\n let i;\n let v;\n\n for (i = 7; i >= 0; i--) {\n v = (val >>> (i * 4)) & 0x0f;\n str += v.toString(16);\n }\n return str;\n };\n\n let blockstart;\n let i, j;\n let W = new Array(80);\n let H0 = 0x67452301;\n let H1 = 0xEFCDAB89;\n let H2 = 0x98BADCFE;\n let H3 = 0x10325476;\n let H4 = 0xC3D2E1F0;\n let A, B, C, D, E;\n let temp;\n\n // utf8_encode\n str = /*unescape*/(encodeURIComponent(str));\n let strLen = str.length;\n\n let wordArray = [];\n for (i = 0; i < strLen - 3; i += 4) {\n j = str.charCodeAt(i) << 24 |\n str.charCodeAt(i + 1) << 16 |\n str.charCodeAt(i + 2) << 8 |\n str.charCodeAt(i + 3);\n wordArray.push(j);\n }\n\n switch (strLen % 4) {\n case 0:\n i = 0x080000000;\n break;\n case 1:\n i = str.charCodeAt(strLen - 1) << 24 | 0x0800000;\n break;\n case 2:\n i = str.charCodeAt(strLen - 2) << 24 | str.charCodeAt(strLen - 1) << 16 | 0x08000;\n break;\n case 3:\n i = str.charCodeAt(strLen - 3) << 24 |\n str.charCodeAt(strLen - 2) << 16 |\n str.charCodeAt(strLen - 1) <<\n 8 | 0x80;\n break;\n }\n\n wordArray.push(i);\n\n while ((wordArray.length % 16) !== 14) {\n wordArray.push(0);\n }\n\n wordArray.push(strLen >>> 29);\n wordArray.push((strLen << 3) & 0x0ffffffff);\n\n for (blockstart = 0; blockstart < wordArray.length; blockstart += 16) {\n for (i = 0; i < 16; i++) {\n W[i] = wordArray[blockstart + i];\n }\n for (i = 16; i <= 79; i++) {\n W[i] = _rotLeft(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\n }\n\n A = H0;\n B = H1;\n C = H2;\n D = H3;\n E = H4;\n\n for (i = 0; i <= 19; i++) {\n temp = (_rotLeft(A, 5) + ((B & C) | (~B & D)) + E + W[i] + 0x5A827999) & 0x0ffffffff;\n E = D;\n D = C;\n C = _rotLeft(B, 30);\n B = A;\n A = temp;\n }\n\n for (i = 20; i <= 39; i++) {\n temp = (_rotLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0x6ED9EBA1) & 0x0ffffffff;\n E = D;\n D = C;\n C = _rotLeft(B, 30);\n B = A;\n A = temp;\n }\n\n for (i = 40; i <= 59; i++) {\n temp = (_rotLeft(A, 5) + ((B & C) | (B & D) | (C & D)) + E + W[i] + 0x8F1BBCDC) & 0x0ffffffff;\n E = D;\n D = C;\n C = _rotLeft(B, 30);\n B = A;\n A = temp;\n }\n\n for (i = 60; i <= 79; i++) {\n temp = (_rotLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0xCA62C1D6) & 0x0ffffffff;\n E = D;\n D = C;\n C = _rotLeft(B, 30);\n B = A;\n A = temp;\n }\n\n H0 = (H0 + A) & 0x0ffffffff;\n H1 = (H1 + B) & 0x0ffffffff;\n H2 = (H2 + C) & 0x0ffffffff;\n H3 = (H3 + D) & 0x0ffffffff;\n H4 = (H4 + E) & 0x0ffffffff;\n }\n\n temp = _cvtHex(H0) + _cvtHex(H1) + _cvtHex(H2) + _cvtHex(H3) + _cvtHex(H4);\n return temp.toLowerCase();\n }\n}\n"],"sourceRoot":".."}
@@ -5,6 +5,7 @@ var tslib_1 = require("tslib");
5
5
  var globals_1 = require("../globals");
6
6
  var ConnectionOptionsReader_1 = require("../connection/ConnectionOptionsReader");
7
7
  var chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
8
+ var PlatformTools_1 = require("../platform/PlatformTools");
8
9
  /**
9
10
  * Clear cache command.
10
11
  */
@@ -54,7 +55,7 @@ var CacheClearCommand = /** @class */ (function () {
54
55
  case 3:
55
56
  connection = _a.sent();
56
57
  if (!connection.queryResultCache) {
57
- console.log(chalk_1.default.black.bgRed("Cache is not enabled. To use cache enable it in connection configuration."));
58
+ PlatformTools_1.PlatformTools.logCmdErr("Cache is not enabled. To use cache enable it in connection configuration.");
58
59
  return [2 /*return*/];
59
60
  }
60
61
  return [4 /*yield*/, connection.queryResultCache.clear()];
@@ -75,8 +76,7 @@ var CacheClearCommand = /** @class */ (function () {
75
76
  _a.sent();
76
77
  _a.label = 9;
77
78
  case 9:
78
- console.log(chalk_1.default.black.bgRed("Error during cache clear:"));
79
- console.error(err_1);
79
+ PlatformTools_1.PlatformTools.logCmdErr("Error during cache clear.", err_1);
80
80
  process.exit(1);
81
81
  return [3 /*break*/, 10];
82
82
  case 10: return [2 /*return*/];
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/commands/CacheClearCommand.ts"],"names":[],"mappings":";;;;AAAA,sCAA4C;AAC5C,iFAA8E;AAG9E,6DAA0B;AAE1B;;GAEG;AACH;IAAA;QAEI,YAAO,GAAG,aAAa,CAAC;QACxB,aAAQ,GAAG,+CAA+C,CAAC;IAqD/D,CAAC;IAnDG,mCAAO,GAAP,UAAQ,IAAgB;QACpB,OAAO,IAAI;aACN,MAAM,CAAC,YAAY,EAAE;YAClB,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,SAAS;YAClB,QAAQ,EAAE,8CAA8C;SAC3D,CAAC;aACD,MAAM,CAAC,QAAQ,EAAE;YACd,KAAK,EAAE,GAAG;YACV,OAAO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,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC;wBAC5D,OAAO,CAAC,KAAK,CAAC,KAAG,CAAC,CAAC;wBACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;;;;;KAEvB;IAEL,wBAAC;AAAD,CAxDA,AAwDC,IAAA;AAxDY,8CAAiB","file":"CacheClearCommand.js","sourcesContent":["import {createConnection} from \"../globals\";\nimport {ConnectionOptionsReader} from \"../connection/ConnectionOptionsReader\";\nimport {Connection} from \"../connection/Connection\";\nimport * as yargs from \"yargs\";\nimport chalk from \"chalk\";\n\n/**\n * Clear cache command.\n */\nexport class CacheClearCommand implements yargs.CommandModule {\n\n command = \"cache:clear\";\n describe = \"Clears all data stored in query runner cache.\";\n\n builder(args: yargs.Argv) {\n return args\n .option(\"connection\", {\n alias: \"c\",\n default: \"default\",\n describe: \"Name of the connection on which run a query.\"\n })\n .option(\"config\", {\n alias: \"f\",\n default: \"ormconfig\",\n describe: \"Name of the file with connection configuration.\"\n });\n }\n\n async handler(args: yargs.Arguments) {\n\n let connection: Connection|undefined = undefined;\n try {\n const connectionOptionsReader = new ConnectionOptionsReader({\n root: process.cwd(),\n configName: args.config as any\n });\n const connectionOptions = await connectionOptionsReader.get(args.connection as any);\n Object.assign(connectionOptions, {\n subscribers: [],\n synchronize: false,\n migrationsRun: false,\n dropSchema: false,\n logging: [\"schema\"]\n });\n connection = await createConnection(connectionOptions);\n\n if (!connection.queryResultCache) {\n console.log(chalk.black.bgRed(\"Cache is not enabled. To use cache enable it in connection configuration.\"));\n return;\n }\n\n await connection.queryResultCache.clear();\n console.log(chalk.green(\"Cache was successfully cleared\"));\n\n if (connection) await connection.close();\n\n } catch (err) {\n if (connection) await (connection as Connection).close();\n\n console.log(chalk.black.bgRed(\"Error during cache clear:\"));\n console.error(err);\n process.exit(1);\n }\n }\n\n}\n"],"sourceRoot":".."}
1
+ {"version":3,"sources":["../../src/commands/CacheCl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;wBAED,qBAAM,UAAU,CAAC,gBAAgB,CAAC,KAAK,EAAE,EAAA;;wBAAzC,SAAyC,CAAC;wBAC1C,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC,CAAC;6BAEvD,UAAU,EAAV,wBAAU;wBAAE,qBAAM,UAAU,CAAC,KAAK,EAAE,EAAA;;wBAAxB,SAAwB,CAAC;;;;;6BAGrC,UAAU,EAAV,wBAAU;wBAAE,qBAAO,UAAyB,CAAC,KAAK,EAAE,EAAA;;wBAAxC,SAAwC,CAAC;;;wBAEzD,6BAAa,CAAC,SAAS,CAAC,2BAA2B,EAAE,KAAG,CAAC,CAAC;wBAE1D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;;;;;KAEvB;IAEL,wBAAC;AAAD,CAxDA,AAwDC,IAAA;AAxDY,8CAAiB","file":"CacheClearCommand.js","sourcesContent":["import {createConnection} from \"../globals\";\nimport {ConnectionOptionsReader} from \"../connection/ConnectionOptionsReader\";\nimport {Connection} from \"../connection/Connection\";\nimport * as yargs from \"yargs\";\nimport chalk from \"chalk\";\nimport { PlatformTools } from \"../platform/PlatformTools\";\n\n/**\n * Clear cache command.\n */\nexport class CacheClearCommand implements yargs.CommandModule {\n\n command = \"cache:clear\";\n describe = \"Clears all data stored in query runner cache.\";\n\n builder(args: yargs.Argv) {\n return args\n .option(\"connection\", {\n alias: \"c\",\n default: \"default\",\n describe: \"Name of the connection on which run a query.\"\n })\n .option(\"config\", {\n alias: \"f\",\n default: \"ormconfig\",\n describe: \"Name of the file with connection configuration.\"\n });\n }\n\n async handler(args: yargs.Arguments) {\n\n let connection: Connection|undefined = undefined;\n try {\n const connectionOptionsReader = new ConnectionOptionsReader({\n root: process.cwd(),\n configName: args.config as any\n });\n const connectionOptions = await connectionOptionsReader.get(args.connection as any);\n Object.assign(connectionOptions, {\n subscribers: [],\n synchronize: false,\n migrationsRun: false,\n dropSchema: false,\n logging: [\"schema\"]\n });\n connection = await createConnection(connectionOptions);\n\n if (!connection.queryResultCache) {\n PlatformTools.logCmdErr(\"Cache is not enabled. To use cache enable it in connection configuration.\");\n return;\n }\n\n await connection.queryResultCache.clear();\n console.log(chalk.green(\"Cache was successfully cleared\"));\n\n if (connection) await connection.close();\n\n } catch (err) {\n if (connection) await (connection as Connection).close();\n\n PlatformTools.logCmdErr(\"Error during cache clear.\", err);\n\n process.exit(1);\n }\n }\n\n}\n"],"sourceRoot":".."}
@@ -5,6 +5,7 @@ var tslib_1 = require("tslib");
5
5
  var ConnectionOptionsReader_1 = require("../connection/ConnectionOptionsReader");
6
6
  var CommandUtils_1 = require("./CommandUtils");
7
7
  var chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
8
+ var PlatformTools_1 = require("../platform/PlatformTools");
8
9
  /**
9
10
  * Generates a new entity.
10
11
  */
@@ -79,8 +80,7 @@ var EntityCreateCommand = /** @class */ (function () {
79
80
  return [3 /*break*/, 8];
80
81
  case 7:
81
82
  err_2 = _a.sent();
82
- console.log(chalk_1.default.black.bgRed("Error during entity creation:"));
83
- console.error(err_2);
83
+ PlatformTools_1.PlatformTools.logCmdErr("Error during entity creation:", err_2);
84
84
  process.exit(1);
85
85
  return [3 /*break*/, 8];
86
86
  case 8: return [2 /*return*/];