@webiny/data-migration 0.0.0-unstable.e3f4727c56 → 0.0.0-unstable.eb196ccd2f
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/MigrationRunner.d.ts +16 -9
- package/MigrationRunner.js +243 -62
- package/MigrationRunner.js.map +1 -1
- package/cli/CliMigrationRunReporter.d.ts +10 -0
- package/cli/CliMigrationRunReporter.js +55 -0
- package/cli/CliMigrationRunReporter.js.map +1 -0
- package/cli/InteractiveCliStatusReporter.d.ts +11 -0
- package/cli/InteractiveCliStatusReporter.js +74 -0
- package/cli/InteractiveCliStatusReporter.js.map +1 -0
- package/cli/LogReporter.d.ts +10 -0
- package/cli/LogReporter.js +43 -0
- package/cli/LogReporter.js.map +1 -0
- package/cli/LogStream.d.ts +10 -0
- package/cli/LogStream.js +58 -0
- package/cli/LogStream.js.map +1 -0
- package/cli/MigrationRunReporter.d.ts +4 -0
- package/cli/MigrationRunReporter.js +7 -0
- package/cli/MigrationRunReporter.js.map +1 -0
- package/cli/MigrationRunner.d.ts +45 -0
- package/cli/MigrationRunner.js +136 -0
- package/cli/MigrationRunner.js.map +1 -0
- package/cli/MigrationStatusReporter.d.ts +4 -0
- package/cli/MigrationStatusReporter.js +7 -0
- package/cli/MigrationStatusReporter.js.map +1 -0
- package/cli/NonInteractiveCliStatusReporter.d.ts +9 -0
- package/cli/NonInteractiveCliStatusReporter.js +42 -0
- package/cli/NonInteractiveCliStatusReporter.js.map +1 -0
- package/cli/VoidStatusReporter.d.ts +4 -0
- package/cli/VoidStatusReporter.js +14 -0
- package/cli/VoidStatusReporter.js.map +1 -0
- package/cli/getDuration.d.ts +5 -0
- package/cli/getDuration.js +23 -0
- package/cli/getDuration.js.map +1 -0
- package/cli/index.d.ts +10 -0
- package/cli/index.js +117 -0
- package/cli/index.js.map +1 -0
- package/createPinoLogger.d.ts +4 -7
- package/createPinoLogger.js +7 -3
- package/createPinoLogger.js.map +1 -1
- package/createTable.d.ts +4 -4
- package/createTable.js +8 -4
- package/createTable.js.map +1 -1
- package/handlers/createDdbEsProjectMigration.d.ts +9 -8
- package/handlers/createDdbEsProjectMigration.js +24 -7
- package/handlers/createDdbEsProjectMigration.js.map +1 -1
- package/handlers/createDdbProjectMigration.d.ts +7 -6
- package/handlers/createDdbProjectMigration.js +24 -7
- package/handlers/createDdbProjectMigration.js.map +1 -1
- package/handlers/createPatternMatcher.d.ts +1 -1
- package/handlers/createPatternMatcher.js +3 -1
- package/handlers/createPatternMatcher.js.map +1 -1
- package/handlers/devVersionErrorResponse.js +3 -1
- package/handlers/devVersionErrorResponse.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +3 -12
- package/index.js.map +1 -1
- package/package.json +21 -30
- package/repository/createStandardEntity.d.ts +52 -0
- package/repository/{migrations.entity.js → createStandardEntity.js} +10 -7
- package/repository/createStandardEntity.js.map +1 -0
- package/repository/migrations.repository.d.ts +11 -4
- package/repository/migrations.repository.js +87 -15
- package/repository/migrations.repository.js.map +1 -1
- package/symbols.d.ts +1 -0
- package/symbols.js +10 -13
- package/symbols.js.map +1 -1
- package/types.d.ts +59 -33
- package/types.js +2 -7
- package/types.js.map +1 -1
- package/repository/migrations.entity.d.ts +0 -4
- package/repository/migrations.entity.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/data-migration",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.eb196ccd2f",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "types.ts",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,46 +11,37 @@
|
|
|
11
11
|
"description": "Tools to author and execute data migrations.",
|
|
12
12
|
"author": "Webiny Ltd.",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@babel/runtime": "7.20.13",
|
|
15
14
|
"@elastic/elasticsearch": "7.12.0",
|
|
16
|
-
"@
|
|
17
|
-
"@webiny/
|
|
18
|
-
"@webiny/
|
|
19
|
-
"@webiny/
|
|
15
|
+
"@webiny/aws-sdk": "0.0.0-unstable.eb196ccd2f",
|
|
16
|
+
"@webiny/cli": "0.0.0-unstable.eb196ccd2f",
|
|
17
|
+
"@webiny/db-dynamodb": "0.0.0-unstable.eb196ccd2f",
|
|
18
|
+
"@webiny/handler-aws": "0.0.0-unstable.eb196ccd2f",
|
|
19
|
+
"@webiny/ioc": "0.0.0-unstable.eb196ccd2f",
|
|
20
|
+
"@webiny/logger": "0.0.0-unstable.eb196ccd2f",
|
|
21
|
+
"@webiny/utils": "0.0.0-unstable.eb196ccd2f",
|
|
22
|
+
"center-align": "1.0.1",
|
|
20
23
|
"chalk": "4.1.2",
|
|
21
|
-
"dynamodb-toolbox": "0.3.5",
|
|
22
24
|
"minimatch": "5.1.6",
|
|
23
|
-
"pino": "8.11.0",
|
|
24
25
|
"pino-pretty": "9.4.0",
|
|
25
|
-
"semver": "6.3
|
|
26
|
+
"semver": "7.6.3"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"jest-mock-console": "^1.0.0",
|
|
37
|
-
"rimraf": "^3.0.2",
|
|
38
|
-
"typescript": "4.7.4"
|
|
29
|
+
"@types/center-align": "1.0.0",
|
|
30
|
+
"@types/semver": "7.3.13",
|
|
31
|
+
"@webiny/project-utils": "0.0.0-unstable.eb196ccd2f",
|
|
32
|
+
"jest": "29.7.0",
|
|
33
|
+
"jest-dynalite": "3.6.1",
|
|
34
|
+
"jest-mock-console": "2.0.0",
|
|
35
|
+
"rimraf": "6.0.1",
|
|
36
|
+
"typescript": "5.3.3"
|
|
39
37
|
},
|
|
40
38
|
"publishConfig": {
|
|
41
39
|
"access": "public",
|
|
42
40
|
"directory": "dist"
|
|
43
41
|
},
|
|
44
42
|
"scripts": {
|
|
45
|
-
"build": "
|
|
46
|
-
"watch": "
|
|
43
|
+
"build": "node ../cli/bin.js run build",
|
|
44
|
+
"watch": "node ../cli/bin.js run watch"
|
|
47
45
|
},
|
|
48
|
-
"
|
|
49
|
-
"ignore": {
|
|
50
|
-
"dependencies": [
|
|
51
|
-
"@types/pino"
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
"gitHead": "e3f4727c567484dc53e1efceacfb37dbacd7f4de"
|
|
46
|
+
"gitHead": "eb196ccd2f32296e10f7add6dd7220d4e3abece4"
|
|
56
47
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
import { Entity } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
+
export declare const createStandardEntity: ({ table, name }: {
|
|
4
|
+
table: Table<string, string, string>;
|
|
5
|
+
name: string;
|
|
6
|
+
}) => Entity<string, import("dynamodb-toolbox/dist/cjs/classes/Entity").Overlay, import("dynamodb-toolbox/dist/cjs/classes/Entity").Overlay, Table<string, string, string>, boolean, boolean, boolean, string, string, string, boolean, {
|
|
7
|
+
PK: {
|
|
8
|
+
partitionKey: true;
|
|
9
|
+
};
|
|
10
|
+
SK: {
|
|
11
|
+
sortKey: true;
|
|
12
|
+
};
|
|
13
|
+
GSI1_PK: {
|
|
14
|
+
type: "string";
|
|
15
|
+
};
|
|
16
|
+
GSI1_SK: {
|
|
17
|
+
type: "string";
|
|
18
|
+
};
|
|
19
|
+
TYPE: {
|
|
20
|
+
type: "string";
|
|
21
|
+
};
|
|
22
|
+
data: {
|
|
23
|
+
type: "map";
|
|
24
|
+
};
|
|
25
|
+
}, {
|
|
26
|
+
PK: {
|
|
27
|
+
partitionKey: true;
|
|
28
|
+
};
|
|
29
|
+
SK: {
|
|
30
|
+
sortKey: true;
|
|
31
|
+
};
|
|
32
|
+
GSI1_PK: {
|
|
33
|
+
type: "string";
|
|
34
|
+
};
|
|
35
|
+
GSI1_SK: {
|
|
36
|
+
type: "string";
|
|
37
|
+
};
|
|
38
|
+
TYPE: {
|
|
39
|
+
type: "string";
|
|
40
|
+
};
|
|
41
|
+
data: {
|
|
42
|
+
type: "map";
|
|
43
|
+
};
|
|
44
|
+
}, import("dynamodb-toolbox/dist/cjs/classes/Entity").ParsedAttributes<import("ts-toolbelt/out/Any/Key").Key>, any, {
|
|
45
|
+
[x: string]: any;
|
|
46
|
+
[x: number]: any;
|
|
47
|
+
[x: symbol]: any;
|
|
48
|
+
}, {
|
|
49
|
+
[x: string]: any;
|
|
50
|
+
[x: number]: any;
|
|
51
|
+
[x: symbol]: any;
|
|
52
|
+
}>;
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
8
|
-
const
|
|
9
|
-
table
|
|
6
|
+
exports.createStandardEntity = void 0;
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
8
|
+
const createStandardEntity = ({
|
|
9
|
+
table,
|
|
10
|
+
name
|
|
10
11
|
}) => {
|
|
11
|
-
return new
|
|
12
|
-
name
|
|
12
|
+
return new _toolbox.Entity({
|
|
13
|
+
name,
|
|
13
14
|
table,
|
|
14
15
|
attributes: {
|
|
15
16
|
PK: {
|
|
@@ -33,4 +34,6 @@ const createMigrationsEntity = ({
|
|
|
33
34
|
}
|
|
34
35
|
});
|
|
35
36
|
};
|
|
36
|
-
exports.
|
|
37
|
+
exports.createStandardEntity = createStandardEntity;
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=createStandardEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createStandardEntity","table","name","Entity","attributes","PK","partitionKey","SK","sortKey","GSI1_PK","type","GSI1_SK","TYPE","data","exports"],"sources":["createStandardEntity.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\n\nexport const createStandardEntity = ({\n table,\n name\n}: {\n table: Table<string, string, string>;\n name: string;\n}) => {\n return new Entity({\n name,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n GSI1_PK: {\n type: \"string\"\n },\n GSI1_SK: {\n type: \"string\"\n },\n TYPE: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n }\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEO,MAAMC,oBAAoB,GAAGA,CAAC;EACjCC,KAAK;EACLC;AAIJ,CAAC,KAAK;EACF,OAAO,IAAIC,eAAM,CAAC;IACdD,IAAI;IACJD,KAAK;IACLG,UAAU,EAAE;MACRC,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV,CAAC;MACDC,OAAO,EAAE;QACLD,IAAI,EAAE;MACV,CAAC;MACDE,IAAI,EAAE;QACFF,IAAI,EAAE;MACV,CAAC;MACDG,IAAI,EAAE;QACFH,IAAI,EAAE;MACV;IACJ;EACJ,CAAC,CAAC;AACN,CAAC;AAACI,OAAA,CAAAd,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import { Table } from "dynamodb
|
|
2
|
-
import { MigrationItem, MigrationRepository } from "../types";
|
|
1
|
+
import type { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
import type { MigrationItem, MigrationRepository, MigrationRun } from "../types";
|
|
3
3
|
export declare class MigrationRepositoryImpl implements MigrationRepository {
|
|
4
|
-
private readonly
|
|
5
|
-
|
|
4
|
+
private readonly run;
|
|
5
|
+
private readonly migration;
|
|
6
|
+
private readonly checkpoint;
|
|
7
|
+
constructor(table: Table<string, string, string>);
|
|
8
|
+
getLastRun(): Promise<MigrationRun | null>;
|
|
9
|
+
saveRun(run: MigrationRun): Promise<void>;
|
|
6
10
|
listMigrations(params?: {
|
|
7
11
|
limit: number;
|
|
8
12
|
}): Promise<MigrationItem[]>;
|
|
9
13
|
logMigration(migration: MigrationItem): Promise<void>;
|
|
14
|
+
createCheckpoint(id: string, data: unknown): Promise<void>;
|
|
15
|
+
deleteCheckpoint(id: string): Promise<void>;
|
|
16
|
+
getCheckpoint(id: string): Promise<unknown | null>;
|
|
10
17
|
}
|
|
@@ -1,20 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.MigrationRepositoryImpl = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
7
|
var _query = require("@webiny/db-dynamodb/utils/query");
|
|
10
|
-
var _migrations = require("./migrations.entity");
|
|
11
8
|
var _ioc = require("@webiny/ioc");
|
|
12
9
|
var _symbols = require("../symbols");
|
|
10
|
+
var _createStandardEntity = require("./createStandardEntity");
|
|
11
|
+
var _dbDynamodb = require("@webiny/db-dynamodb");
|
|
13
12
|
class MigrationRepositoryImpl {
|
|
14
13
|
constructor(table) {
|
|
15
|
-
(0,
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
this.run = (0, _createStandardEntity.createStandardEntity)({
|
|
15
|
+
table,
|
|
16
|
+
name: "MigrationRun"
|
|
17
|
+
});
|
|
18
|
+
this.migration = (0, _createStandardEntity.createStandardEntity)({
|
|
19
|
+
table,
|
|
20
|
+
name: "Migration"
|
|
21
|
+
});
|
|
22
|
+
this.checkpoint = (0, _createStandardEntity.createStandardEntity)({
|
|
23
|
+
table,
|
|
24
|
+
name: "MigrationCheckpoint"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
async getLastRun() {
|
|
28
|
+
const result = await (0, _query.queryOne)({
|
|
29
|
+
entity: this.run,
|
|
30
|
+
partitionKey: "MIGRATION_RUNS",
|
|
31
|
+
options: {
|
|
32
|
+
index: "GSI1",
|
|
33
|
+
gt: " ",
|
|
34
|
+
reverse: true
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return result ? result.data : null;
|
|
38
|
+
}
|
|
39
|
+
async saveRun(run) {
|
|
40
|
+
await (0, _dbDynamodb.put)({
|
|
41
|
+
entity: this.run,
|
|
42
|
+
item: {
|
|
43
|
+
PK: `MIGRATION_RUN#${run.id}`,
|
|
44
|
+
SK: "A",
|
|
45
|
+
TYPE: "migration.run",
|
|
46
|
+
GSI1_PK: "MIGRATION_RUNS",
|
|
47
|
+
GSI1_SK: run.id,
|
|
48
|
+
data: run
|
|
49
|
+
}
|
|
18
50
|
});
|
|
19
51
|
}
|
|
20
52
|
async listMigrations(params) {
|
|
@@ -22,7 +54,7 @@ class MigrationRepositoryImpl {
|
|
|
22
54
|
limit
|
|
23
55
|
} = params || {};
|
|
24
56
|
const result = await (0, _query.queryAll)({
|
|
25
|
-
entity: this.
|
|
57
|
+
entity: this.migration,
|
|
26
58
|
partitionKey: "MIGRATIONS",
|
|
27
59
|
options: {
|
|
28
60
|
index: "GSI1",
|
|
@@ -35,15 +67,55 @@ class MigrationRepositoryImpl {
|
|
|
35
67
|
return result.map(item => item.data);
|
|
36
68
|
}
|
|
37
69
|
async logMigration(migration) {
|
|
38
|
-
await
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
70
|
+
await (0, _dbDynamodb.put)({
|
|
71
|
+
entity: this.migration,
|
|
72
|
+
item: {
|
|
73
|
+
PK: `MIGRATION#${migration.id}`,
|
|
74
|
+
SK: "A",
|
|
75
|
+
TYPE: "migration",
|
|
76
|
+
GSI1_PK: "MIGRATIONS",
|
|
77
|
+
GSI1_SK: migration.id,
|
|
78
|
+
data: migration
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
async createCheckpoint(id, data) {
|
|
83
|
+
await (0, _dbDynamodb.put)({
|
|
84
|
+
entity: this.checkpoint,
|
|
85
|
+
item: {
|
|
86
|
+
PK: `MIGRATION_CHECKPOINT#${id}`,
|
|
87
|
+
SK: "A",
|
|
88
|
+
TYPE: "migration.checkpoint",
|
|
89
|
+
GSI1_PK: "MIGRATION_CHECKPOINTS",
|
|
90
|
+
GSI1_SK: id,
|
|
91
|
+
data
|
|
92
|
+
}
|
|
45
93
|
});
|
|
46
94
|
}
|
|
95
|
+
async deleteCheckpoint(id) {
|
|
96
|
+
await (0, _dbDynamodb.deleteItem)({
|
|
97
|
+
entity: this.checkpoint,
|
|
98
|
+
keys: {
|
|
99
|
+
PK: `MIGRATION_CHECKPOINT#${id}`,
|
|
100
|
+
SK: "A"
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
async getCheckpoint(id) {
|
|
105
|
+
const record = await (0, _dbDynamodb.get)({
|
|
106
|
+
entity: this.checkpoint,
|
|
107
|
+
keys: {
|
|
108
|
+
PK: `MIGRATION_CHECKPOINT#${id}`,
|
|
109
|
+
SK: "A"
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
if (!record) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
return record.data;
|
|
116
|
+
}
|
|
47
117
|
}
|
|
48
118
|
exports.MigrationRepositoryImpl = MigrationRepositoryImpl;
|
|
49
|
-
(0, _ioc.makeInjectable)(MigrationRepositoryImpl, [(0, _ioc.inject)(_symbols.PrimaryDynamoTableSymbol)]);
|
|
119
|
+
(0, _ioc.makeInjectable)(MigrationRepositoryImpl, [(0, _ioc.inject)(_symbols.PrimaryDynamoTableSymbol)]);
|
|
120
|
+
|
|
121
|
+
//# sourceMappingURL=migrations.repository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MigrationRepositoryImpl","constructor","table","
|
|
1
|
+
{"version":3,"names":["_query","require","_ioc","_symbols","_createStandardEntity","_dbDynamodb","MigrationRepositoryImpl","constructor","table","run","createStandardEntity","name","migration","checkpoint","getLastRun","result","queryOne","entity","partitionKey","options","index","gt","reverse","data","saveRun","put","item","PK","id","SK","TYPE","GSI1_PK","GSI1_SK","listMigrations","params","limit","queryAll","map","logMigration","createCheckpoint","deleteCheckpoint","deleteItem","keys","getCheckpoint","record","get","exports","makeInjectable","inject","PrimaryDynamoTableSymbol"],"sources":["migrations.repository.ts"],"sourcesContent":["import type { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { queryAll, queryOne } from \"@webiny/db-dynamodb/utils/query\";\nimport type { MigrationItem, MigrationRepository, MigrationRun } from \"~/types\";\nimport { inject, makeInjectable } from \"@webiny/ioc\";\nimport { PrimaryDynamoTableSymbol } from \"~/symbols\";\nimport { createStandardEntity } from \"./createStandardEntity\";\nimport { deleteItem, get, put } from \"@webiny/db-dynamodb\";\n\ninterface MigrationCheckpoint {\n data: unknown;\n}\n\nexport class MigrationRepositoryImpl implements MigrationRepository {\n private readonly run: Entity<any>;\n private readonly migration: Entity<any>;\n private readonly checkpoint: Entity<any>;\n\n constructor(table: Table<string, string, string>) {\n this.run = createStandardEntity({ table, name: \"MigrationRun\" });\n this.migration = createStandardEntity({ table, name: \"Migration\" });\n this.checkpoint = createStandardEntity({ table, name: \"MigrationCheckpoint\" });\n }\n\n async getLastRun(): Promise<MigrationRun | null> {\n const result = await queryOne<{ data: MigrationRun }>({\n entity: this.run,\n partitionKey: \"MIGRATION_RUNS\",\n options: {\n index: \"GSI1\",\n gt: \" \",\n reverse: true\n }\n });\n\n return result ? result.data : null;\n }\n\n async saveRun(run: MigrationRun): Promise<void> {\n await put({\n entity: this.run,\n item: {\n PK: `MIGRATION_RUN#${run.id}`,\n SK: \"A\",\n TYPE: \"migration.run\",\n GSI1_PK: \"MIGRATION_RUNS\",\n GSI1_SK: run.id,\n data: run\n }\n });\n }\n\n async listMigrations(params?: { limit: number }): Promise<MigrationItem[]> {\n const { limit } = params || {};\n const result = await queryAll<{ data: MigrationItem }>({\n entity: this.migration,\n partitionKey: \"MIGRATIONS\",\n options: {\n index: \"GSI1\",\n gt: \" \",\n limit,\n // Sort by GSI1_SK in descending order.\n reverse: true\n }\n });\n\n return result.map(item => item.data);\n }\n\n async logMigration(migration: MigrationItem): Promise<void> {\n await put({\n entity: this.migration,\n item: {\n PK: `MIGRATION#${migration.id}`,\n SK: \"A\",\n TYPE: \"migration\",\n GSI1_PK: \"MIGRATIONS\",\n GSI1_SK: migration.id,\n data: migration\n }\n });\n }\n\n async createCheckpoint(id: string, data: unknown): Promise<void> {\n await put({\n entity: this.checkpoint,\n item: {\n PK: `MIGRATION_CHECKPOINT#${id}`,\n SK: \"A\",\n TYPE: \"migration.checkpoint\",\n GSI1_PK: \"MIGRATION_CHECKPOINTS\",\n GSI1_SK: id,\n data\n }\n });\n }\n\n async deleteCheckpoint(id: string): Promise<void> {\n await deleteItem({\n entity: this.checkpoint,\n keys: {\n PK: `MIGRATION_CHECKPOINT#${id}`,\n SK: \"A\"\n }\n });\n }\n\n async getCheckpoint(id: string): Promise<unknown | null> {\n const record = await get<MigrationCheckpoint>({\n entity: this.checkpoint,\n keys: {\n PK: `MIGRATION_CHECKPOINT#${id}`,\n SK: \"A\"\n }\n });\n\n if (!record) {\n return null;\n }\n return record.data;\n }\n}\n\nmakeInjectable(MigrationRepositoryImpl, [inject(PrimaryDynamoTableSymbol)]);\n"],"mappings":"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","ignoreList":[]}
|
package/symbols.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export declare const MigrationRepositorySymbol: unique symbol;
|
|
|
4
4
|
export declare const ElasticsearchClientSymbol: unique symbol;
|
|
5
5
|
export declare const PrimaryDynamoTableSymbol: unique symbol;
|
|
6
6
|
export declare const ElasticsearchDynamoTableSymbol: unique symbol;
|
|
7
|
+
export declare const ExecutionTimeLimiterSymbol: unique symbol;
|
package/symbols.js
CHANGED
|
@@ -3,16 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.PrimaryDynamoTableSymbol = exports.MigrationSymbol = exports.MigrationRepositorySymbol = exports.LoggerSymbol = exports.ElasticsearchDynamoTableSymbol = exports.ElasticsearchClientSymbol = void 0;
|
|
7
|
-
const LoggerSymbol = Symbol.for("PinoLogger");
|
|
8
|
-
exports.
|
|
9
|
-
const
|
|
10
|
-
exports.
|
|
11
|
-
const
|
|
12
|
-
exports.
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
exports.PrimaryDynamoTableSymbol = PrimaryDynamoTableSymbol;
|
|
17
|
-
const ElasticsearchDynamoTableSymbol = Symbol.for("ElasticsearchDynamoTable");
|
|
18
|
-
exports.ElasticsearchDynamoTableSymbol = ElasticsearchDynamoTableSymbol;
|
|
6
|
+
exports.PrimaryDynamoTableSymbol = exports.MigrationSymbol = exports.MigrationRepositorySymbol = exports.LoggerSymbol = exports.ExecutionTimeLimiterSymbol = exports.ElasticsearchDynamoTableSymbol = exports.ElasticsearchClientSymbol = void 0;
|
|
7
|
+
const LoggerSymbol = exports.LoggerSymbol = Symbol.for("PinoLogger");
|
|
8
|
+
const MigrationSymbol = exports.MigrationSymbol = Symbol.for("Migration");
|
|
9
|
+
const MigrationRepositorySymbol = exports.MigrationRepositorySymbol = Symbol.for("MigrationRepository");
|
|
10
|
+
const ElasticsearchClientSymbol = exports.ElasticsearchClientSymbol = Symbol.for("ElasticsearchClient");
|
|
11
|
+
const PrimaryDynamoTableSymbol = exports.PrimaryDynamoTableSymbol = Symbol.for("PrimaryDynamoTable");
|
|
12
|
+
const ElasticsearchDynamoTableSymbol = exports.ElasticsearchDynamoTableSymbol = Symbol.for("ElasticsearchDynamoTable");
|
|
13
|
+
const ExecutionTimeLimiterSymbol = exports.ExecutionTimeLimiterSymbol = Symbol.for("ExecutionTimeLimiter");
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=symbols.js.map
|
package/symbols.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LoggerSymbol","Symbol","for","MigrationSymbol","MigrationRepositorySymbol","ElasticsearchClientSymbol","PrimaryDynamoTableSymbol","ElasticsearchDynamoTableSymbol"],"sources":["symbols.ts"],"sourcesContent":["export const LoggerSymbol = Symbol.for(\"PinoLogger\");\nexport const MigrationSymbol = Symbol.for(\"Migration\");\nexport const MigrationRepositorySymbol = Symbol.for(\"MigrationRepository\");\nexport const ElasticsearchClientSymbol = Symbol.for(\"ElasticsearchClient\");\nexport const PrimaryDynamoTableSymbol = Symbol.for(\"PrimaryDynamoTable\");\nexport const ElasticsearchDynamoTableSymbol = Symbol.for(\"ElasticsearchDynamoTable\");\n"],"mappings":";;;;;;AAAO,MAAMA,YAAY,
|
|
1
|
+
{"version":3,"names":["LoggerSymbol","exports","Symbol","for","MigrationSymbol","MigrationRepositorySymbol","ElasticsearchClientSymbol","PrimaryDynamoTableSymbol","ElasticsearchDynamoTableSymbol","ExecutionTimeLimiterSymbol"],"sources":["symbols.ts"],"sourcesContent":["export const LoggerSymbol = Symbol.for(\"PinoLogger\");\nexport const MigrationSymbol = Symbol.for(\"Migration\");\nexport const MigrationRepositorySymbol = Symbol.for(\"MigrationRepository\");\nexport const ElasticsearchClientSymbol = Symbol.for(\"ElasticsearchClient\");\nexport const PrimaryDynamoTableSymbol = Symbol.for(\"PrimaryDynamoTable\");\nexport const ElasticsearchDynamoTableSymbol = Symbol.for(\"ElasticsearchDynamoTable\");\nexport const ExecutionTimeLimiterSymbol = Symbol.for(\"ExecutionTimeLimiter\");\n"],"mappings":";;;;;;AAAO,MAAMA,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAGE,MAAM,CAACC,GAAG,CAAC,YAAY,CAAC;AAC7C,MAAMC,eAAe,GAAAH,OAAA,CAAAG,eAAA,GAAGF,MAAM,CAACC,GAAG,CAAC,WAAW,CAAC;AAC/C,MAAME,yBAAyB,GAAAJ,OAAA,CAAAI,yBAAA,GAAGH,MAAM,CAACC,GAAG,CAAC,qBAAqB,CAAC;AACnE,MAAMG,yBAAyB,GAAAL,OAAA,CAAAK,yBAAA,GAAGJ,MAAM,CAACC,GAAG,CAAC,qBAAqB,CAAC;AACnE,MAAMI,wBAAwB,GAAAN,OAAA,CAAAM,wBAAA,GAAGL,MAAM,CAACC,GAAG,CAAC,oBAAoB,CAAC;AACjE,MAAMK,8BAA8B,GAAAP,OAAA,CAAAO,8BAAA,GAAGN,MAAM,CAACC,GAAG,CAAC,0BAA0B,CAAC;AAC7E,MAAMM,0BAA0B,GAAAR,OAAA,CAAAQ,0BAAA,GAAGP,MAAM,CAACC,GAAG,CAAC,sBAAsB,CAAC","ignoreList":[]}
|
package/types.d.ts
CHANGED
|
@@ -1,57 +1,83 @@
|
|
|
1
|
-
import { Logger
|
|
2
|
-
export { Logger };
|
|
1
|
+
import type { Logger } from "@webiny/logger";
|
|
2
|
+
export type { Logger };
|
|
3
3
|
export interface MigrationItem {
|
|
4
4
|
id: string;
|
|
5
5
|
description: string;
|
|
6
|
-
createdOn: string;
|
|
7
|
-
duration: number;
|
|
8
6
|
reason: string;
|
|
7
|
+
startedOn?: string;
|
|
8
|
+
finishedOn?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface MigrationRun {
|
|
11
|
+
id: string;
|
|
12
|
+
startedOn: string;
|
|
13
|
+
finishedOn: string;
|
|
14
|
+
status: "init" | "running" | "pending" | "done" | "error";
|
|
15
|
+
migrations: MigrationRunItem[];
|
|
16
|
+
context?: Record<string, any>;
|
|
17
|
+
error?: {
|
|
18
|
+
message: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
code?: string;
|
|
21
|
+
data?: Record<string, any>;
|
|
22
|
+
stack?: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface MigrationRunItem {
|
|
26
|
+
id: string;
|
|
27
|
+
status: "done" | "running" | "skipped" | "pending" | "not-applicable" | "error";
|
|
28
|
+
startedOn?: string;
|
|
29
|
+
finishedOn?: string;
|
|
9
30
|
}
|
|
10
31
|
export interface MigrationRepository {
|
|
32
|
+
getLastRun(): Promise<MigrationRun | null>;
|
|
33
|
+
saveRun(run: MigrationRun): Promise<void>;
|
|
11
34
|
listMigrations(params?: {
|
|
12
35
|
limit: number;
|
|
13
36
|
}): Promise<MigrationItem[]>;
|
|
14
37
|
logMigration(migration: MigrationItem): Promise<void>;
|
|
38
|
+
createCheckpoint(id: string, data: unknown): Promise<void>;
|
|
39
|
+
getCheckpoint(id: string): Promise<unknown>;
|
|
40
|
+
deleteCheckpoint(id: string): Promise<void>;
|
|
15
41
|
}
|
|
16
|
-
export interface DataMigrationContext {
|
|
42
|
+
export interface DataMigrationContext<TCheckpoint = any> {
|
|
17
43
|
projectVersion: string;
|
|
18
44
|
logger: Logger;
|
|
45
|
+
checkpoint?: TCheckpoint;
|
|
46
|
+
forceExecute: boolean;
|
|
47
|
+
runningOutOfTime: () => boolean;
|
|
48
|
+
createCheckpoint: (data: TCheckpoint) => Promise<void>;
|
|
49
|
+
createCheckpointAndExit: (data: TCheckpoint) => Promise<void>;
|
|
19
50
|
}
|
|
20
|
-
export interface DataMigration {
|
|
51
|
+
export interface DataMigration<TCheckpoint = any> {
|
|
21
52
|
getId(): string;
|
|
22
53
|
getDescription(): string;
|
|
23
|
-
shouldExecute(context: DataMigrationContext): Promise<boolean>;
|
|
24
|
-
execute(context: DataMigrationContext): Promise<void>;
|
|
25
|
-
}
|
|
26
|
-
export interface MigrationResult {
|
|
27
|
-
success: boolean;
|
|
28
|
-
logs: LogEvent[];
|
|
29
|
-
duration: number;
|
|
30
|
-
}
|
|
31
|
-
export interface ExecutedMigrationResponse {
|
|
32
|
-
id: string;
|
|
33
|
-
description: string;
|
|
34
|
-
result: MigrationResult;
|
|
35
|
-
}
|
|
36
|
-
export interface SkippedMigrationResponse {
|
|
37
|
-
id: string;
|
|
38
|
-
description: string;
|
|
39
|
-
reason: string;
|
|
54
|
+
shouldExecute(context: DataMigrationContext<TCheckpoint>): Promise<boolean>;
|
|
55
|
+
execute(context: DataMigrationContext<TCheckpoint>): Promise<void>;
|
|
40
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Migration execution time limiter (in milliseconds).
|
|
59
|
+
*/
|
|
60
|
+
export type ExecutionTimeLimiter = () => number;
|
|
41
61
|
export interface MigrationEventPayload {
|
|
62
|
+
command: "status" | "execute";
|
|
42
63
|
version?: string;
|
|
43
64
|
pattern?: string;
|
|
65
|
+
force?: boolean;
|
|
44
66
|
}
|
|
45
|
-
export
|
|
67
|
+
export type MigrationEventHandlerResponse = undefined | MigrationStatusResponse | MigrationInvocationErrorResponse;
|
|
68
|
+
export interface MigrationInvocationErrorResponse {
|
|
46
69
|
error: {
|
|
47
70
|
message: string;
|
|
48
71
|
};
|
|
49
|
-
data?:
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
72
|
+
data?: undefined;
|
|
73
|
+
}
|
|
74
|
+
export interface MigrationStatusRunItem extends MigrationRunItem {
|
|
75
|
+
description: string;
|
|
76
|
+
}
|
|
77
|
+
export interface MigrationStatus extends MigrationRun {
|
|
78
|
+
migrations: MigrationStatusRunItem[];
|
|
79
|
+
}
|
|
80
|
+
export interface MigrationStatusResponse {
|
|
81
|
+
data: MigrationStatus;
|
|
82
|
+
error?: undefined;
|
|
83
|
+
}
|
package/types.js
CHANGED
|
@@ -3,10 +3,5 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
get: function () {
|
|
9
|
-
return _pino.Logger;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _pino = require("pino");
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=types.js.map
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { Logger
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { Logger } from \"@webiny/logger\";\n\nexport type { Logger };\n\nexport interface MigrationItem {\n id: string;\n description: string;\n reason: string;\n startedOn?: string;\n finishedOn?: string;\n}\n\nexport interface MigrationRun {\n id: string;\n startedOn: string;\n finishedOn: string;\n status: \"init\" | \"running\" | \"pending\" | \"done\" | \"error\";\n migrations: MigrationRunItem[];\n context?: Record<string, any>;\n error?: {\n message: string;\n name?: string;\n code?: string;\n data?: Record<string, any>;\n stack?: string;\n };\n}\n\nexport interface MigrationRunItem {\n id: string;\n status: \"done\" | \"running\" | \"skipped\" | \"pending\" | \"not-applicable\" | \"error\";\n startedOn?: string;\n finishedOn?: string;\n}\n\nexport interface MigrationRepository {\n getLastRun(): Promise<MigrationRun | null>;\n saveRun(run: MigrationRun): Promise<void>;\n listMigrations(params?: { limit: number }): Promise<MigrationItem[]>;\n logMigration(migration: MigrationItem): Promise<void>;\n createCheckpoint(id: string, data: unknown): Promise<void>;\n getCheckpoint(id: string): Promise<unknown>;\n deleteCheckpoint(id: string): Promise<void>;\n}\n\nexport interface DataMigrationContext<TCheckpoint = any> {\n projectVersion: string;\n logger: Logger;\n checkpoint?: TCheckpoint;\n forceExecute: boolean;\n runningOutOfTime: () => boolean;\n createCheckpoint: (data: TCheckpoint) => Promise<void>;\n createCheckpointAndExit: (data: TCheckpoint) => Promise<void>;\n}\n\nexport interface DataMigration<TCheckpoint = any> {\n getId(): string;\n getDescription(): string;\n // This function should check of the migration needs to apply some changes to the system.\n // Returning `false` means \"everything is ok, mark this migration as executed\".\n shouldExecute(context: DataMigrationContext<TCheckpoint>): Promise<boolean>;\n execute(context: DataMigrationContext<TCheckpoint>): Promise<void>;\n}\n\n/**\n * Migration execution time limiter (in milliseconds).\n */\nexport type ExecutionTimeLimiter = () => number;\n\nexport interface MigrationEventPayload {\n command: \"status\" | \"execute\";\n version?: string;\n pattern?: string;\n force?: boolean;\n}\n\nexport type MigrationEventHandlerResponse =\n // When migration is triggered (via `Event` invocation type), it simply gets invoked, and returns nothing.\n | undefined\n // Last migration run state.\n | MigrationStatusResponse\n // If an unhandled error is thrown, return the error object.\n | MigrationInvocationErrorResponse;\n\nexport interface MigrationInvocationErrorResponse {\n error: { message: string };\n data?: undefined;\n}\n\nexport interface MigrationStatusRunItem extends MigrationRunItem {\n description: string;\n}\n\nexport interface MigrationStatus extends MigrationRun {\n migrations: MigrationStatusRunItem[];\n}\n\nexport interface MigrationStatusResponse {\n data: MigrationStatus;\n error?: undefined;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createMigrationsEntity","table","Entity","name","attributes","PK","partitionKey","SK","sortKey","GSI1_PK","type","GSI1_SK","TYPE","data"],"sources":["migrations.entity.ts"],"sourcesContent":["import { Table, Entity } from \"dynamodb-toolbox\";\n\nexport const createMigrationsEntity = ({ table }: { table: Table }) => {\n return new Entity({\n name: \"Migrations\",\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n GSI1_PK: {\n type: \"string\"\n },\n GSI1_SK: {\n type: \"string\"\n },\n TYPE: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n }\n }\n });\n};\n"],"mappings":";;;;;;AAAA;AAEO,MAAMA,sBAAsB,GAAG,CAAC;EAAEC;AAAwB,CAAC,KAAK;EACnE,OAAO,IAAIC,uBAAM,CAAC;IACdC,IAAI,EAAE,YAAY;IAClBF,KAAK;IACLG,UAAU,EAAE;MACRC,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV,CAAC;MACDC,OAAO,EAAE;QACLD,IAAI,EAAE;MACV,CAAC;MACDE,IAAI,EAAE;QACFF,IAAI,EAAE;MACV,CAAC;MACDG,IAAI,EAAE;QACFH,IAAI,EAAE;MACV;IACJ;EACJ,CAAC,CAAC;AACN,CAAC;AAAC"}
|