@biorate/migrations 1.164.0 → 1.165.1
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/.nyc_output/5dd7a2aa-147b-4304-84bf-effac0f982fd.json +1 -0
- package/.nyc_output/8ed41da4-40ec-49dc-8dbc-0ebaa3847e76.json +1 -0
- package/.nyc_output/f0726e72-3148-4051-b1f5-0768a33e5118.json +1 -0
- package/.nyc_output/processinfo/5dd7a2aa-147b-4304-84bf-effac0f982fd.json +1 -0
- package/.nyc_output/processinfo/8ed41da4-40ec-49dc-8dbc-0ebaa3847e76.json +1 -0
- package/.nyc_output/processinfo/f0726e72-3148-4051-b1f5-0768a33e5118.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -0
- package/CHANGELOG.md +14 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +242 -0
- package/coverage/coverage-final.json +20 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +206 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +210 -0
- package/coverage/src/errors.ts.html +112 -0
- package/coverage/src/index.html +131 -0
- package/coverage/src/root.ts.html +385 -0
- package/coverage/src/types/amqp.ts.html +223 -0
- package/coverage/src/types/clickhouse.ts.html +271 -0
- package/coverage/src/types/index.html +236 -0
- package/coverage/src/types/index.ts.html +106 -0
- package/coverage/src/types/kafka.ts.html +190 -0
- package/coverage/src/types/migration.ts.html +361 -0
- package/coverage/src/types/minio.ts.html +202 -0
- package/coverage/src/types/mongodb.ts.html +193 -0
- package/coverage/src/types/schema-registry.ts.html +250 -0
- package/coverage/src/types/sequelize.ts.html +229 -0
- package/coverage/tests/__mocks__/index.html +116 -0
- package/coverage/tests/__mocks__/index.ts.html +439 -0
- package/coverage/tests/migrations/amqp/test/00001_create-test.js.html +94 -0
- package/coverage/tests/migrations/amqp/test/00002_delete-test.js.html +94 -0
- package/coverage/tests/migrations/amqp/test/index.html +131 -0
- package/coverage/tests/migrations/kafka/admin/00001_create-test.js.html +109 -0
- package/coverage/tests/migrations/kafka/admin/00002_delete-test.js.html +100 -0
- package/coverage/tests/migrations/kafka/admin/index.html +131 -0
- package/coverage/tests/migrations/minio/minio/00001_create-test.js.html +91 -0
- package/coverage/tests/migrations/minio/minio/00002_delete-test.js.html +94 -0
- package/coverage/tests/migrations/minio/minio/index.html +131 -0
- package/coverage/tests/migrations/mongodb/mongodb/00001_create-index-test.js.html +91 -0
- package/coverage/tests/migrations/mongodb/mongodb/index.html +116 -0
- package/dist/src/root.js +28 -4
- package/dist/src/root.js.map +1 -1
- package/dist/src/types/mongodb.js +1 -1
- package/dist/src/types/mongodb.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +21 -21
- package/src/root.ts +8 -4
- package/src/types/mongodb.ts +5 -5
- package/.reporters.json +0 -6
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@biorate/migrations",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.165.1",
|
|
4
4
|
"description": "Migrations tools",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "npx tsc -p ./tsconfig.build.json --outDir ./dist",
|
|
8
|
-
"test": "npx
|
|
8
|
+
"test": "npx vitest run --coverage",
|
|
9
9
|
"prepublishOnly": "pnpm run build"
|
|
10
10
|
},
|
|
11
11
|
"repository": {
|
|
@@ -23,24 +23,24 @@
|
|
|
23
23
|
"author": "llevkin",
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@biorate/amqp": "1.
|
|
27
|
-
"@biorate/clickhouse": "1.
|
|
28
|
-
"@biorate/config": "2.
|
|
29
|
-
"@biorate/config-loader": "1.
|
|
30
|
-
"@biorate/config-loader-env": "1.
|
|
31
|
-
"@biorate/config-loader-fs": "1.
|
|
32
|
-
"@biorate/config-loader-vault": "1.
|
|
33
|
-
"@biorate/connector": "2.
|
|
34
|
-
"@biorate/errors": "2.
|
|
35
|
-
"@biorate/inversion": "2.
|
|
36
|
-
"@biorate/kafkajs": "1.
|
|
37
|
-
"@biorate/minio": "1.
|
|
38
|
-
"@biorate/mongodb": "1.
|
|
39
|
-
"@biorate/proxy": "1.
|
|
40
|
-
"@biorate/schema-registry": "2.
|
|
41
|
-
"@biorate/sequelize": "1.
|
|
42
|
-
"@biorate/tools": "2.
|
|
43
|
-
"@biorate/vault": "1.
|
|
26
|
+
"@biorate/amqp": "1.158.0",
|
|
27
|
+
"@biorate/clickhouse": "1.158.0",
|
|
28
|
+
"@biorate/config": "2.1.0",
|
|
29
|
+
"@biorate/config-loader": "1.158.0",
|
|
30
|
+
"@biorate/config-loader-env": "1.160.0",
|
|
31
|
+
"@biorate/config-loader-fs": "1.158.0",
|
|
32
|
+
"@biorate/config-loader-vault": "1.158.0",
|
|
33
|
+
"@biorate/connector": "2.1.0",
|
|
34
|
+
"@biorate/errors": "2.1.0",
|
|
35
|
+
"@biorate/inversion": "2.1.0",
|
|
36
|
+
"@biorate/kafkajs": "1.158.0",
|
|
37
|
+
"@biorate/minio": "1.158.0",
|
|
38
|
+
"@biorate/mongodb": "1.158.0",
|
|
39
|
+
"@biorate/proxy": "1.158.0",
|
|
40
|
+
"@biorate/schema-registry": "2.1.0",
|
|
41
|
+
"@biorate/sequelize": "1.158.0",
|
|
42
|
+
"@biorate/tools": "2.1.0",
|
|
43
|
+
"@biorate/vault": "1.158.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "be0fe72898f2ed41db65ed7da1bdeb315fa38b67"
|
|
46
46
|
}
|
package/src/root.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
1
2
|
import { init, injectable, inject, Types, Core, container } from '@biorate/inversion';
|
|
2
3
|
import { Config, IConfig } from '@biorate/config';
|
|
3
4
|
import { ConfigLoader } from '@biorate/config-loader';
|
|
@@ -13,10 +14,13 @@ import { IMongoDBConnector, MongoDBConnector } from '@biorate/mongodb';
|
|
|
13
14
|
import { ClickhouseConnector, IClickhouseConnector } from '@biorate/clickhouse';
|
|
14
15
|
import { AmqpConnector, IAmqpConnector } from '@biorate/amqp';
|
|
15
16
|
import { IKafkaJSAdminConnector, KafkaJSAdminConnector } from '@biorate/kafkajs';
|
|
16
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
ISchemaRegistryConnector,
|
|
19
|
+
SchemaRegistryConnector,
|
|
20
|
+
} from '@biorate/schema-registry';
|
|
17
21
|
|
|
18
22
|
@injectable()
|
|
19
|
-
export class Root extends Core() {
|
|
23
|
+
export class Root extends Core(EventEmitter) {
|
|
20
24
|
@inject(Types.Config) public readonly config: IConfig;
|
|
21
25
|
|
|
22
26
|
@inject(Types.ConfigLoaderEnv) public readonly configLoaderEnv: ConfigLoader;
|
|
@@ -45,7 +49,7 @@ export class Root extends Core() {
|
|
|
45
49
|
public readonly schemaRegistry: Migrations.SchemaRegistry;
|
|
46
50
|
|
|
47
51
|
@init() protected async initialize() {
|
|
48
|
-
process.exit();
|
|
52
|
+
process.exit(0);
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
55
|
|
|
@@ -93,4 +97,4 @@ container
|
|
|
93
97
|
.bind<Migrations.SchemaRegistry>(Migrations.SchemaRegistry)
|
|
94
98
|
.toSelf()
|
|
95
99
|
.inSingletonScope();
|
|
96
|
-
container.bind<Root>(Root).
|
|
100
|
+
container.bind<Root>(Root).to(Root).inSingletonScope();
|
package/src/types/mongodb.ts
CHANGED
|
@@ -16,11 +16,6 @@ export class Mongodb extends Migration {
|
|
|
16
16
|
async (config, connection, paths) =>
|
|
17
17
|
await this.forEachPath(paths, async (file, name) => {
|
|
18
18
|
try {
|
|
19
|
-
await connection
|
|
20
|
-
.collection<{ _id: string }>(
|
|
21
|
-
this.config.get<string>('migrations.tableName', 'migrations'),
|
|
22
|
-
)
|
|
23
|
-
.insertOne({ _id: name });
|
|
24
19
|
await (
|
|
25
20
|
require(file) as (
|
|
26
21
|
connection: IMongoDBConnection,
|
|
@@ -28,6 +23,11 @@ export class Mongodb extends Migration {
|
|
|
28
23
|
globalConfig: IConfig,
|
|
29
24
|
) => Promise<void>
|
|
30
25
|
)(connection, config, this.config);
|
|
26
|
+
await connection
|
|
27
|
+
.collection<{ _id: string }>(
|
|
28
|
+
this.config.get<string>('migrations.tableName', 'migrations'),
|
|
29
|
+
)
|
|
30
|
+
.insertOne({ _id: name });
|
|
31
31
|
this.log(config.name, name);
|
|
32
32
|
} catch (e) {}
|
|
33
33
|
}),
|