@orion-js/migrations 3.11.9 → 4.0.0-alpha.2

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/package.json CHANGED
@@ -1,44 +1,49 @@
1
1
  {
2
2
  "name": "@orion-js/migrations",
3
- "version": "3.11.9",
4
- "main": "lib/index.js",
5
- "types": "lib/index.d.ts",
3
+ "version": "4.0.0-alpha.2",
4
+ "main": "./dist/index.cjs",
5
+ "types": "./dist/index.d.ts",
6
6
  "files": [
7
- "/lib"
7
+ "dist"
8
8
  ],
9
9
  "author": "nicolaslopezj",
10
10
  "license": "MIT",
11
11
  "scripts": {
12
- "test": "jest",
12
+ "test": "bun test",
13
13
  "prepare": "yarn run build",
14
- "clean": "rm -rf ./lib",
15
- "build": "yarn run clean && tsc",
14
+ "clean": "rm -rf ./dist",
15
+ "build": "bun run build.ts",
16
16
  "watch": "tsc -w",
17
- "upgrade-interactive": "yarn upgrade-interactive"
17
+ "upgrade-interactive": "yarn upgrade-interactive",
18
+ "dev": "bun --watch src/index.ts"
18
19
  },
19
20
  "dependencies": {
20
- "@orion-js/dogs": "^3.11.9",
21
- "@orion-js/helpers": "^3.11.8",
22
- "@orion-js/mongodb": "^3.11.8",
23
- "@orion-js/services": "^3.11.8",
24
- "@orion-js/typed-model": "^3.11.8"
21
+ "@orion-js/dogs": "^4.0.0-alpha.2",
22
+ "@orion-js/helpers": "^4.0.0-alpha.2",
23
+ "@orion-js/mongodb": "^4.0.0-alpha.2",
24
+ "@orion-js/services": "^4.0.0-alpha.2",
25
+ "@orion-js/typed-model": "^4.0.0-alpha.2"
25
26
  },
26
27
  "peerDependencies": {
27
28
  "@orion-js/logger": "*"
28
29
  },
29
30
  "devDependencies": {
30
- "@orion-js/logger": "^3.11.8",
31
- "@shelf/jest-mongodb": "^4.3.2",
32
- "@types/jest": "^29.5.12",
31
+ "@orion-js/logger": "^4.0.0-alpha.2",
33
32
  "@types/lodash": "4.14.195",
34
33
  "@types/node": "20.4.2",
35
- "jest": "29.7.0",
36
34
  "reflect-metadata": "^0.1.13",
37
- "ts-jest": "29.1.2",
38
- "typescript": "^5.1.6"
35
+ "typescript": "^5.4.5",
36
+ "@types/bun": "^1.2.4"
39
37
  },
40
38
  "publishConfig": {
41
39
  "access": "public"
42
40
  },
43
- "gitHead": "ff4915cc731d0d18bcb386da1845615f0aa9fd4e"
44
- }
41
+ "gitHead": "9fd28b6f6b348cebc9f0dc207805647969277372",
42
+ "type": "module",
43
+ "module": "./dist/index.js",
44
+ "exports": {
45
+ "types": "./dist/index.d.ts",
46
+ "import": "./dist/index.js",
47
+ "require": "./dist/index.cjs"
48
+ }
49
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Orionjs Team
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,9 +0,0 @@
1
- import { MigrationExecutable } from './service';
2
- import { ExecutionContext } from '@orion-js/dogs';
3
- export declare class MigrationsService {
4
- private migrationsRepo;
5
- getNextMigration(migrationsList: MigrationExecutable[]): Promise<MigrationExecutable>;
6
- runMigrations(migrationsList: MigrationExecutable[], context: ExecutionContext): Promise<void>;
7
- runMigration(func: (context: ExecutionContext) => Promise<void>, context: ExecutionContext): Promise<void>;
8
- runAsTransaction(func: (context: ExecutionContext) => Promise<void>, context: ExecutionContext): Promise<void>;
9
- }
@@ -1,70 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.MigrationsService = void 0;
13
- const services_1 = require("@orion-js/services");
14
- const Repo_1 = require("./Repo");
15
- const logger_1 = require("@orion-js/logger");
16
- let MigrationsService = exports.MigrationsService = class MigrationsService {
17
- async getNextMigration(migrationsList) {
18
- const completedNames = await this.migrationsRepo.getCompletedMigrationNames();
19
- for (const migrationExecutable of migrationsList) {
20
- if (completedNames.includes(migrationExecutable.name))
21
- continue;
22
- return migrationExecutable;
23
- }
24
- }
25
- async runMigrations(migrationsList, context) {
26
- const next = await this.getNextMigration(migrationsList);
27
- if (!next)
28
- return;
29
- logger_1.logger.info('[orionjs/migrations] Running migration...', { name: next.name });
30
- if (next.useMongoTransactions) {
31
- await this.runAsTransaction(next.runMigration, context);
32
- }
33
- else {
34
- await this.runMigration(next.runMigration, context);
35
- }
36
- logger_1.logger.info('[orionjs/migrations] Migration executed correctly', { name: next.name });
37
- await this.migrationsRepo.saveCompletedMigration(next.name);
38
- await this.runMigrations(migrationsList, context);
39
- }
40
- async runMigration(func, context) {
41
- try {
42
- await func(context);
43
- }
44
- catch (error) {
45
- logger_1.logger.error('[orionjs/migrations] Error running migration', error);
46
- throw error;
47
- }
48
- }
49
- async runAsTransaction(func, context) {
50
- const { client } = this.migrationsRepo.collection.client;
51
- const session = client.startSession();
52
- await session.withTransaction(async () => {
53
- try {
54
- await func(context);
55
- }
56
- catch (error) {
57
- logger_1.logger.error('[orionjs/migrations] Error running migration, will abort transaction', error);
58
- throw error;
59
- }
60
- });
61
- session.endSession();
62
- }
63
- };
64
- __decorate([
65
- (0, services_1.Inject)(),
66
- __metadata("design:type", Repo_1.MigrationsRepo)
67
- ], MigrationsService.prototype, "migrationsRepo", void 0);
68
- exports.MigrationsService = MigrationsService = __decorate([
69
- (0, services_1.Service)()
70
- ], MigrationsService);
package/lib/Repo.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import { Collection } from '@orion-js/mongodb';
2
- import { MigrationSchema } from './Schema';
3
- export declare class MigrationsRepo {
4
- collection: Collection<MigrationSchema>;
5
- getCompletedMigrationNames(): Promise<string[]>;
6
- saveCompletedMigration(name: string): Promise<void>;
7
- }
package/lib/Repo.js DELETED
@@ -1,35 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.MigrationsRepo = void 0;
13
- const mongodb_1 = require("@orion-js/mongodb");
14
- const Schema_1 = require("./Schema");
15
- let MigrationsRepo = exports.MigrationsRepo = class MigrationsRepo {
16
- async getCompletedMigrationNames() {
17
- const migrations = await this.collection.find().toArray();
18
- return migrations.map(m => m.name);
19
- }
20
- async saveCompletedMigration(name) {
21
- await this.collection.insertOne({ name, completedAt: new Date() });
22
- }
23
- };
24
- __decorate([
25
- (0, mongodb_1.MongoCollection)({
26
- name: 'orionjs.migrations',
27
- schema: Schema_1.MigrationSchema,
28
- idPrefix: 'scnmg-',
29
- indexes: []
30
- }),
31
- __metadata("design:type", Object)
32
- ], MigrationsRepo.prototype, "collection", void 0);
33
- exports.MigrationsRepo = MigrationsRepo = __decorate([
34
- (0, mongodb_1.Repository)()
35
- ], MigrationsRepo);
package/lib/Schema.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export type MigrationId = `scnmg-${string}`;
2
- export declare class MigrationSchema {
3
- _id: MigrationId;
4
- name: string;
5
- completedAt: Date;
6
- }
package/lib/Schema.js DELETED
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.MigrationSchema = void 0;
13
- const typed_model_1 = require("@orion-js/typed-model");
14
- let MigrationSchema = exports.MigrationSchema = class MigrationSchema {
15
- };
16
- __decorate([
17
- (0, typed_model_1.Prop)(),
18
- __metadata("design:type", String)
19
- ], MigrationSchema.prototype, "_id", void 0);
20
- __decorate([
21
- (0, typed_model_1.Prop)(),
22
- __metadata("design:type", String)
23
- ], MigrationSchema.prototype, "name", void 0);
24
- __decorate([
25
- (0, typed_model_1.Prop)(),
26
- __metadata("design:type", Date)
27
- ], MigrationSchema.prototype, "completedAt", void 0);
28
- exports.MigrationSchema = MigrationSchema = __decorate([
29
- (0, typed_model_1.TypedSchema)()
30
- ], MigrationSchema);
package/lib/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export * from './loadMigrations';
2
- export * from './service';
3
- export * from './MigrationsService';
4
- export * from './Repo';
5
- export * from './Schema';
package/lib/index.js DELETED
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./loadMigrations"), exports);
18
- __exportStar(require("./service"), exports);
19
- __exportStar(require("./MigrationsService"), exports);
20
- __exportStar(require("./Repo"), exports);
21
- __exportStar(require("./Schema"), exports);
@@ -1 +0,0 @@
1
- export {};
package/lib/index.test.js DELETED
@@ -1,96 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const services_1 = require("@orion-js/services");
10
- const loadMigrations_1 = require("./loadMigrations");
11
- const service_1 = require("./service");
12
- const MigrationsService_1 = require("./MigrationsService");
13
- const lib_1 = require("../../helpers/lib");
14
- const Repo_1 = require("./Repo");
15
- describe('Migrations end to end', () => {
16
- it('should create a migration service', async () => {
17
- let executions = 0;
18
- let MoveUsersMigrationService = class MoveUsersMigrationService {
19
- async runMigration() {
20
- executions++;
21
- }
22
- };
23
- MoveUsersMigrationService = __decorate([
24
- (0, service_1.MigrationService)({
25
- name: (0, lib_1.generateId)(),
26
- useMongoTransactions: false
27
- })
28
- ], MoveUsersMigrationService);
29
- const migrationExecutables = (0, loadMigrations_1.loadMigrations)([MoveUsersMigrationService], { omitJob: true });
30
- const instance = (0, services_1.getInstance)(MigrationsService_1.MigrationsService);
31
- const context = {};
32
- await instance.runMigrations(migrationExecutables, context);
33
- await instance.runMigrations(migrationExecutables, context);
34
- await instance.runMigrations(migrationExecutables, context);
35
- await instance.runMigrations(migrationExecutables, context);
36
- await instance.runMigrations(migrationExecutables, context);
37
- expect(executions).toBe(1);
38
- });
39
- it('should not set a migration completed if it fails', async () => {
40
- const migrationName = (0, lib_1.generateId)();
41
- let MoveUsersMigrationService = class MoveUsersMigrationService {
42
- async runMigration() {
43
- throw new Error('test');
44
- }
45
- };
46
- MoveUsersMigrationService = __decorate([
47
- (0, service_1.MigrationService)({
48
- name: migrationName,
49
- useMongoTransactions: false
50
- })
51
- ], MoveUsersMigrationService);
52
- const migrationExecutables = (0, loadMigrations_1.loadMigrations)([MoveUsersMigrationService], { omitJob: true });
53
- const instance = (0, services_1.getInstance)(MigrationsService_1.MigrationsService);
54
- const context = {};
55
- try {
56
- await instance.runMigrations(migrationExecutables, context);
57
- }
58
- catch { }
59
- const migrationsRepo = (0, services_1.getInstance)(Repo_1.MigrationsRepo);
60
- const completedNames = await migrationsRepo.getCompletedMigrationNames();
61
- expect(completedNames.includes(migrationName)).toBe(false);
62
- });
63
- // it('should revert changes if an error is thrown', async () => {
64
- // expect.assertions(2)
65
- // @Repository()
66
- // class TestRepo {
67
- // @MongoCollection({
68
- // name: 'testMigration'
69
- // })
70
- // collection: Collection
71
- // }
72
- // @MigrationService({
73
- // name: generateId(),
74
- // useMongoTransactions: true
75
- // })
76
- // class TestTransactionMigrationService {
77
- // @Inject()
78
- // private testRepo: TestRepo
79
- // async runMigration() {
80
- // await this.testRepo.collection.insertOne({test: true})
81
- // const count = await this.testRepo.collection.countDocuments({})
82
- // expect(count).toBe(1)
83
- // console.log({count})
84
- // throw new Error('test')
85
- // }
86
- // }
87
- // const migrationExecutables = loadMigrations([TestTransactionMigrationService], {omitJob: true})
88
- // const instance = getInstance(MigrationsService)
89
- // try {
90
- // await instance.runMigrations(migrationExecutables)
91
- // } catch {}
92
- // const testRepo = getInstance(TestRepo)
93
- // const count = await testRepo.collection.countDocuments({})
94
- // expect(count).toBe(0)
95
- // })
96
- });
@@ -1,5 +0,0 @@
1
- export interface Options {
2
- lockTime?: number;
3
- omitJob?: boolean;
4
- }
5
- export declare function loadMigrations(migrationServices: any[], options?: Options): import("../service").MigrationExecutable[];
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loadMigrations = void 0;
4
- const dogs_1 = require("@orion-js/dogs");
5
- const service_1 = require("../service");
6
- const services_1 = require("@orion-js/services");
7
- const MigrationsService_1 = require("../MigrationsService");
8
- function loadMigrations(migrationServices, options) {
9
- const migrations = (0, service_1.getMigrationsFromServices)(migrationServices);
10
- if (options?.omitJob)
11
- return migrations;
12
- (0, dogs_1.startWorkers)({
13
- cooldownPeriod: 1000,
14
- lockTime: 1000 * 60 * 20,
15
- workersCount: 1,
16
- pollInterval: 10 * 1000,
17
- jobs: {
18
- orionjsRunMigrations: (0, dogs_1.defineJob)({
19
- type: 'recurrent',
20
- runEvery: 30 * 1000,
21
- async resolve(params, context) {
22
- const instance = (0, services_1.getInstance)(MigrationsService_1.MigrationsService);
23
- await instance.runMigrations(migrations, context);
24
- }
25
- })
26
- }
27
- });
28
- return migrations;
29
- }
30
- exports.loadMigrations = loadMigrations;
@@ -1,10 +0,0 @@
1
- import { ExecutionContext } from '@orion-js/dogs';
2
- export interface MigrationServiceOptions {
3
- name: string;
4
- useMongoTransactions: false;
5
- }
6
- export declare function MigrationService(options: MigrationServiceOptions): ClassDecorator;
7
- export type MigrationExecutable = {
8
- runMigration(context: ExecutionContext): Promise<void>;
9
- } & MigrationServiceOptions;
10
- export declare function getMigrationsFromServices(services: any[]): MigrationExecutable[];
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getMigrationsFromServices = exports.MigrationService = void 0;
4
- const services_1 = require("@orion-js/services");
5
- const services_2 = require("@orion-js/services");
6
- function MigrationService(options) {
7
- return function (target) {
8
- (0, services_2.Service)()(target);
9
- target.prototype.service = target;
10
- target.prototype.options = options;
11
- target.prototype.serviceType = 'migration';
12
- };
13
- }
14
- exports.MigrationService = MigrationService;
15
- function getMigrationsFromServices(services) {
16
- return services
17
- .filter(service => service.prototype.serviceType === 'migration')
18
- .map(service => {
19
- const options = service.prototype.options;
20
- return {
21
- ...options,
22
- runMigration: async (context) => {
23
- const instance = (0, services_1.getInstance)(service);
24
- return await instance.runMigration(context);
25
- }
26
- };
27
- });
28
- }
29
- exports.getMigrationsFromServices = getMigrationsFromServices;
@@ -1 +0,0 @@
1
- export {};
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const _1 = require(".");
10
- describe('Migration as IOC', () => {
11
- it('should create a migration service', async () => {
12
- let didRun = false;
13
- let didExtend = false;
14
- let MoveUsersMigrationService = class MoveUsersMigrationService {
15
- async runMigration(context) {
16
- didRun = true;
17
- context.extendLockTime(1000);
18
- }
19
- };
20
- MoveUsersMigrationService = __decorate([
21
- (0, _1.MigrationService)({
22
- name: 'moveUsers',
23
- useMongoTransactions: false
24
- })
25
- ], MoveUsersMigrationService);
26
- const migrations = (0, _1.getMigrationsFromServices)([MoveUsersMigrationService]);
27
- let lastName = null;
28
- for (const { runMigration, name } of migrations) {
29
- lastName = name;
30
- await runMigration({
31
- extendLockTime: time => {
32
- didExtend = true;
33
- }
34
- });
35
- }
36
- expect(lastName).toBe('moveUsers');
37
- expect(didRun).toBe(true);
38
- expect(didExtend).toBe(true);
39
- });
40
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mongodb_1 = require("@orion-js/mongodb");
4
- const url = `${global.__MONGO_URI__}`;
5
- process.env.MONGO_URL = url;
6
- beforeAll(async () => {
7
- const connection = (0, mongodb_1.getMongoConnection)({ name: 'main' });
8
- await connection.connectionPromise;
9
- });
10
- afterAll(async () => {
11
- /**
12
- * We need to wait on indexes promises to be resolved to close all the handlers
13
- */
14
- await Promise.all(mongodb_1.createIndexesPromises);
15
- for (const connectionName in mongodb_1.connections) {
16
- const connection = mongodb_1.connections[connectionName];
17
- await connection.client.close();
18
- }
19
- });