@mikro-orm/migrations-mongodb 6.3.14-dev.8 → 6.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Migrator.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type MigrationParams, type RunnableMigration } from 'umzug';
2
- import { type Constructor, type IMigrator, type MikroORM } from '@mikro-orm/core';
2
+ import { type Constructor, type IMigrator, type MikroORM, type MigratorEvent, type MaybePromise } from '@mikro-orm/core';
3
3
  import type { EntityManager } from '@mikro-orm/mongodb';
4
4
  import type { Migration } from './Migration';
5
5
  import { MigrationStorage } from './MigrationStorage';
@@ -28,6 +28,14 @@ export declare class Migrator implements IMigrator {
28
28
  * @inheritDoc
29
29
  */
30
30
  createInitialMigration(path?: string): Promise<MigrationResult>;
31
+ /**
32
+ * @inheritDoc
33
+ */
34
+ on(eventName: MigratorEvent, listener: (event: UmzugMigration) => MaybePromise<void>): this;
35
+ /**
36
+ * @inheritDoc
37
+ */
38
+ off(eventName: MigratorEvent, listener: (event: UmzugMigration) => MaybePromise<void>): this;
31
39
  private createUmzug;
32
40
  /**
33
41
  * @inheritDoc
package/Migrator.js CHANGED
@@ -25,7 +25,7 @@ class Migrator {
25
25
  this.config = this.em.config;
26
26
  this.options = this.config.get('migrations');
27
27
  /* istanbul ignore next */
28
- const key = (this.config.get('tsNode', core_1.Utils.detectTsNode()) && this.options.pathTs) ? 'pathTs' : 'path';
28
+ const key = (this.config.get('preferTs', core_1.Utils.detectTsNode()) && this.options.pathTs) ? 'pathTs' : 'path';
29
29
  this.absolutePath = core_1.Utils.absolutePath(this.options[key], this.config.get('baseDir'));
30
30
  this.createUmzug();
31
31
  }
@@ -57,6 +57,20 @@ class Migrator {
57
57
  async createInitialMigration(path) {
58
58
  return this.createMigration(path);
59
59
  }
60
+ /**
61
+ * @inheritDoc
62
+ */
63
+ on(eventName, listener) {
64
+ this.umzug.on(eventName, listener);
65
+ return this;
66
+ }
67
+ /**
68
+ * @inheritDoc
69
+ */
70
+ off(eventName, listener) {
71
+ this.umzug.off(eventName, listener);
72
+ return this;
73
+ }
60
74
  createUmzug() {
61
75
  this.runner = new MigrationRunner_1.MigrationRunner(this.driver, this.options);
62
76
  this.storage = new MigrationStorage_1.MigrationStorage(this.driver, this.options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/migrations-mongodb",
3
- "version": "6.3.14-dev.8",
3
+ "version": "6.4.0",
4
4
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -58,15 +58,15 @@
58
58
  "access": "public"
59
59
  },
60
60
  "dependencies": {
61
- "@mikro-orm/mongodb": "6.3.14-dev.8",
61
+ "@mikro-orm/mongodb": "6.4.0",
62
62
  "fs-extra": "11.2.0",
63
- "mongodb": "6.9.0",
63
+ "mongodb": "6.10.0",
64
64
  "umzug": "3.8.2"
65
65
  },
66
66
  "devDependencies": {
67
- "@mikro-orm/core": "^6.3.13"
67
+ "@mikro-orm/core": "^6.4.0"
68
68
  },
69
69
  "peerDependencies": {
70
- "@mikro-orm/core": "6.3.14-dev.8"
70
+ "@mikro-orm/core": "^6.0.0"
71
71
  }
72
72
  }