@webiny/data-migration 0.0.0-unstable.ecd8734205 → 0.0.0-unstable.f6dc066313
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 +250 -76
- package/MigrationRunner.js.map +1 -1
- package/README.md +9 -4
- package/cli/CliMigrationRunReporter.d.ts +13 -0
- package/cli/CliMigrationRunReporter.js +50 -0
- package/cli/CliMigrationRunReporter.js.map +1 -0
- package/cli/InteractiveCliStatusReporter.d.ts +11 -0
- package/cli/InteractiveCliStatusReporter.js +66 -0
- package/cli/InteractiveCliStatusReporter.js.map +1 -0
- package/cli/LogReporter.d.ts +10 -0
- package/cli/LogReporter.js +36 -0
- package/cli/LogReporter.js.map +1 -0
- package/cli/LogStream.d.ts +10 -0
- package/cli/LogStream.js +51 -0
- package/cli/LogStream.js.map +1 -0
- package/cli/MigrationRunReporter.d.ts +4 -0
- package/cli/MigrationRunReporter.js +3 -0
- package/cli/MigrationRunReporter.js.map +1 -0
- package/cli/MigrationRunner.d.ts +45 -0
- package/cli/MigrationRunner.js +128 -0
- package/cli/MigrationRunner.js.map +1 -0
- package/cli/MigrationStatusReporter.d.ts +4 -0
- package/cli/MigrationStatusReporter.js +3 -0
- package/cli/MigrationStatusReporter.js.map +1 -0
- package/cli/NonInteractiveCliStatusReporter.d.ts +9 -0
- package/cli/NonInteractiveCliStatusReporter.js +35 -0
- package/cli/NonInteractiveCliStatusReporter.js.map +1 -0
- package/cli/VoidStatusReporter.d.ts +4 -0
- package/cli/VoidStatusReporter.js +7 -0
- package/cli/VoidStatusReporter.js.map +1 -0
- package/cli/getDuration.d.ts +5 -0
- package/cli/getDuration.js +16 -0
- package/cli/getDuration.js.map +1 -0
- package/cli/index.d.ts +10 -0
- package/cli/index.js +12 -0
- package/cli/index.js.map +1 -0
- package/createPinoLogger.d.ts +4 -7
- package/createPinoLogger.js +11 -16
- package/createPinoLogger.js.map +1 -1
- package/createTable.d.ts +4 -4
- package/createTable.js +8 -11
- package/createTable.js.map +1 -1
- package/handlers/createDdbEsProjectMigration.d.ts +9 -8
- package/handlers/createDdbEsProjectMigration.js +41 -31
- package/handlers/createDdbEsProjectMigration.js.map +1 -1
- package/handlers/createDdbProjectMigration.d.ts +7 -6
- package/handlers/createDdbProjectMigration.js +39 -29
- package/handlers/createDdbProjectMigration.js.map +1 -1
- package/handlers/createPatternMatcher.d.ts +1 -1
- package/handlers/createPatternMatcher.js +5 -11
- package/handlers/createPatternMatcher.js.map +1 -1
- package/handlers/devVersionErrorResponse.js +3 -8
- package/handlers/devVersionErrorResponse.js.map +1 -1
- package/index.d.ts +6 -6
- package/index.js +7 -70
- package/index.js.map +1 -1
- package/package.json +22 -35
- package/repository/migrations.repository.d.ts +11 -4
- package/repository/migrations.repository.js +67 -21
- package/repository/migrations.repository.js.map +1 -1
- package/symbols.d.ts +1 -0
- package/symbols.js +8 -17
- package/symbols.js.map +1 -1
- package/types.d.ts +59 -33
- package/types.js +2 -11
- package/types.js.map +1 -1
- package/repository/migrations.entity.d.ts +0 -4
- package/repository/migrations.entity.js +0 -36
- package/repository/migrations.entity.js.map +0 -1
package/createPinoLogger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createPinoLogger","
|
|
1
|
+
{"version":3,"names":["chalk","pinoPretty","createPinoLogger","baseCreatePinoLogger","getLogLevel","level","process","env","MIGRATIONS_LOG_LEVEL","ignore","getChildLogger","logger","migration","child","msgPrefix","blueBright","getId"],"sources":["createPinoLogger.ts"],"sourcesContent":["import chalk from \"chalk\";\nimport pinoPretty from \"pino-pretty\";\nimport type { DataMigration } from \"~/types.js\";\nimport type { Logger } from \"@webiny/logger\";\nimport { createPinoLogger as baseCreatePinoLogger, getLogLevel } from \"@webiny/logger\";\n\nexport const createPinoLogger = () => {\n return baseCreatePinoLogger(\n {\n level: getLogLevel(process.env.MIGRATIONS_LOG_LEVEL, \"trace\")\n },\n pinoPretty({\n ignore: \"pid,hostname\"\n })\n );\n};\n\nexport const getChildLogger = (logger: Logger, migration: DataMigration) => {\n return logger.child({}, { msgPrefix: chalk.blueBright(`[${migration.getId()}]`) + \" \" });\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,aAAa;AAGpC,SAASC,gBAAgB,IAAIC,oBAAoB,EAAEC,WAAW,QAAQ,gBAAgB;AAEtF,OAAO,MAAMF,gBAAgB,GAAGA,CAAA,KAAM;EAClC,OAAOC,oBAAoB,CACvB;IACIE,KAAK,EAAED,WAAW,CAACE,OAAO,CAACC,GAAG,CAACC,oBAAoB,EAAE,OAAO;EAChE,CAAC,EACDP,UAAU,CAAC;IACPQ,MAAM,EAAE;EACZ,CAAC,CACL,CAAC;AACL,CAAC;AAED,OAAO,MAAMC,cAAc,GAAGA,CAACC,MAAc,EAAEC,SAAwB,KAAK;EACxE,OAAOD,MAAM,CAACE,KAAK,CAAC,CAAC,CAAC,EAAE;IAAEC,SAAS,EAAEd,KAAK,CAACe,UAAU,CAAC,IAAIH,SAAS,CAACI,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG;EAAI,CAAC,CAAC;AAC5F,CAAC","ignoreList":[]}
|
package/createTable.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Table } from "dynamodb
|
|
1
|
+
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
2
|
+
import { Table } from "@webiny/db-dynamodb/toolbox.js";
|
|
3
3
|
export interface CreateTableParams {
|
|
4
4
|
name: string;
|
|
5
|
-
documentClient:
|
|
5
|
+
documentClient: DynamoDBDocument;
|
|
6
6
|
}
|
|
7
|
-
export declare const createTable: ({ name, documentClient }: CreateTableParams) => Table
|
|
7
|
+
export declare const createTable: ({ name, documentClient }: CreateTableParams) => Table<string, "PK", "SK">;
|
package/createTable.js
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createTable = void 0;
|
|
7
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
8
|
-
const createTable = ({
|
|
1
|
+
import { Table } from "@webiny/db-dynamodb/toolbox.js";
|
|
2
|
+
export const createTable = ({
|
|
9
3
|
name,
|
|
10
4
|
documentClient
|
|
11
5
|
}) => {
|
|
12
|
-
return new
|
|
6
|
+
return new Table({
|
|
13
7
|
name,
|
|
14
8
|
partitionKey: "PK",
|
|
15
9
|
sortKey: "SK",
|
|
@@ -23,7 +17,10 @@ const createTable = ({
|
|
|
23
17
|
// partitionKey: "GSI2_PK",
|
|
24
18
|
// sortKey: "GSI2_SK"
|
|
25
19
|
// }
|
|
26
|
-
}
|
|
20
|
+
},
|
|
21
|
+
autoExecute: true,
|
|
22
|
+
autoParse: true
|
|
27
23
|
});
|
|
28
24
|
};
|
|
29
|
-
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=createTable.js.map
|
package/createTable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createTable","name","documentClient","
|
|
1
|
+
{"version":3,"names":["Table","createTable","name","documentClient","partitionKey","sortKey","DocumentClient","indexes","GSI1","autoExecute","autoParse"],"sources":["createTable.ts"],"sourcesContent":["import type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { Table } from \"@webiny/db-dynamodb/toolbox.js\";\n\nexport interface CreateTableParams {\n name: string;\n documentClient: DynamoDBDocument;\n}\n\nexport const createTable = ({ name, documentClient }: CreateTableParams) => {\n return new Table({\n name,\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient,\n indexes: {\n GSI1: {\n partitionKey: \"GSI1_PK\",\n sortKey: \"GSI1_SK\"\n }\n // GSI2: {\n // partitionKey: \"GSI2_PK\",\n // sortKey: \"GSI2_SK\"\n // }\n },\n autoExecute: true,\n autoParse: true\n });\n};\n"],"mappings":"AACA,SAASA,KAAK,QAAQ,gCAAgC;AAOtD,OAAO,MAAMC,WAAW,GAAGA,CAAC;EAAEC,IAAI;EAAEC;AAAkC,CAAC,KAAK;EACxE,OAAO,IAAIH,KAAK,CAAC;IACbE,IAAI;IACJE,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAEH,cAAc;IAC9BI,OAAO,EAAE;MACLC,IAAI,EAAE;QACFJ,YAAY,EAAE,SAAS;QACvBC,OAAO,EAAE;MACb;MACA;MACA;MACA;MACA;IACJ,CAAC;IACDI,WAAW,EAAE,IAAI;IACjBC,SAAS,EAAE;EACf,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { Client as ElasticsearchClient } from "@elastic/elasticsearch";
|
|
2
|
-
import { Table } from "dynamodb
|
|
3
|
-
import { Constructor } from "@webiny/ioc";
|
|
4
|
-
import { DataMigration, MigrationEventHandlerResponse, MigrationEventPayload, MigrationRepository } from "../types";
|
|
5
|
-
import { IsMigrationApplicable } from "../MigrationRunner";
|
|
1
|
+
import type { Client as ElasticsearchClient } from "@elastic/elasticsearch";
|
|
2
|
+
import type { Table } from "@webiny/db-dynamodb/toolbox.js";
|
|
3
|
+
import type { Constructor } from "@webiny/ioc";
|
|
4
|
+
import type { DataMigration, ExecutionTimeLimiter, MigrationEventHandlerResponse, MigrationEventPayload, MigrationRepository } from "../types.js";
|
|
5
|
+
import type { IsMigrationApplicable } from "../MigrationRunner.js";
|
|
6
6
|
interface CreateDdbEsDataMigrationConfig {
|
|
7
7
|
elasticsearchClient: ElasticsearchClient;
|
|
8
|
-
primaryTable: Table
|
|
9
|
-
dynamoToEsTable: Table
|
|
8
|
+
primaryTable: Table<string, string, string>;
|
|
9
|
+
dynamoToEsTable: Table<string, string, string>;
|
|
10
10
|
migrations: Constructor<DataMigration>[];
|
|
11
11
|
isMigrationApplicable?: IsMigrationApplicable;
|
|
12
12
|
repository?: MigrationRepository;
|
|
13
|
+
timeLimiter?: ExecutionTimeLimiter;
|
|
13
14
|
}
|
|
14
|
-
export declare const createDdbEsProjectMigration: ({ migrations, elasticsearchClient, primaryTable, dynamoToEsTable, isMigrationApplicable, repository }: CreateDdbEsDataMigrationConfig) => import("@webiny/handler-aws").RawEventHandler<MigrationEventPayload, any, MigrationEventHandlerResponse>;
|
|
15
|
+
export declare const createDdbEsProjectMigration: ({ migrations, elasticsearchClient, primaryTable, dynamoToEsTable, isMigrationApplicable, repository, ...config }: CreateDdbEsDataMigrationConfig) => import("@webiny/handler-aws").RawEventHandler<MigrationEventPayload, any, MigrationEventHandlerResponse>;
|
|
15
16
|
export {};
|
|
@@ -1,59 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _MigrationRunner = require("../MigrationRunner");
|
|
11
|
-
var _migrations = require("../repository/migrations.repository");
|
|
12
|
-
var _devVersionErrorResponse = require("./devVersionErrorResponse");
|
|
13
|
-
var _createPatternMatcher = require("./createPatternMatcher");
|
|
14
|
-
const createDdbEsProjectMigration = ({
|
|
1
|
+
import { createRawEventHandler } from "@webiny/handler-aws";
|
|
2
|
+
import { createContainer } from "@webiny/ioc";
|
|
3
|
+
import { ElasticsearchClientSymbol, ElasticsearchDynamoTableSymbol, ExecutionTimeLimiterSymbol, MigrationRepositorySymbol, MigrationSymbol, PrimaryDynamoTableSymbol } from "../symbols.js";
|
|
4
|
+
import { MigrationRunner } from "../MigrationRunner.js";
|
|
5
|
+
import { MigrationRepositoryImpl } from "../repository/migrations.repository.js";
|
|
6
|
+
import { devVersionErrorResponse } from "./devVersionErrorResponse.js";
|
|
7
|
+
import { createPatternMatcher } from "./createPatternMatcher.js";
|
|
8
|
+
import { coerce as semverCoerce } from "semver";
|
|
9
|
+
export const createDdbEsProjectMigration = ({
|
|
15
10
|
migrations,
|
|
16
11
|
elasticsearchClient,
|
|
17
12
|
primaryTable,
|
|
18
13
|
dynamoToEsTable,
|
|
19
14
|
isMigrationApplicable = undefined,
|
|
20
|
-
repository = undefined
|
|
15
|
+
repository = undefined,
|
|
16
|
+
...config
|
|
21
17
|
}) => {
|
|
22
|
-
return
|
|
23
|
-
payload
|
|
18
|
+
return createRawEventHandler(async ({
|
|
19
|
+
payload,
|
|
20
|
+
lambdaContext
|
|
24
21
|
}) => {
|
|
25
|
-
const projectVersion = String(
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
const projectVersion = String(payload?.version || process.env.WEBINY_VERSION);
|
|
23
|
+
const forceExecute = payload.force === true;
|
|
24
|
+
const version = semverCoerce(projectVersion);
|
|
25
|
+
if (version?.version === "0.0.0") {
|
|
26
|
+
return devVersionErrorResponse();
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
// COMPOSITION ROOT
|
|
31
|
-
const container =
|
|
32
|
-
container.bind(
|
|
33
|
-
container.bind(
|
|
34
|
-
container.bind(
|
|
30
|
+
const container = createContainer();
|
|
31
|
+
container.bind(PrimaryDynamoTableSymbol).toConstantValue(primaryTable);
|
|
32
|
+
container.bind(ElasticsearchDynamoTableSymbol).toConstantValue(dynamoToEsTable);
|
|
33
|
+
container.bind(ElasticsearchClientSymbol).toConstantValue(elasticsearchClient);
|
|
34
|
+
const timeLimiter = config.timeLimiter || lambdaContext?.getRemainingTimeInMillis || (() => 0);
|
|
35
|
+
container.bind(ExecutionTimeLimiterSymbol).toConstantValue(timeLimiter);
|
|
35
36
|
if (repository) {
|
|
36
37
|
// Repository implementation provided by the user.
|
|
37
|
-
container.bind(
|
|
38
|
+
container.bind(MigrationRepositorySymbol).toConstantValue(repository);
|
|
38
39
|
} else {
|
|
39
40
|
// Default repository implementation.
|
|
40
|
-
container.bind(
|
|
41
|
+
container.bind(MigrationRepositorySymbol).to(MigrationRepositoryImpl);
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
// Bind the provided migrations.
|
|
44
|
-
migrations.forEach(migration => container.bind(
|
|
45
|
+
migrations.forEach(migration => container.bind(MigrationSymbol).to(migration));
|
|
45
46
|
|
|
46
47
|
// If handler was invoked with a `pattern`, filter migrations that match the pattern only.
|
|
47
48
|
let patternMatcher;
|
|
48
49
|
if (payload.pattern) {
|
|
49
|
-
patternMatcher =
|
|
50
|
+
patternMatcher = createPatternMatcher(payload.pattern);
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
// Inject dependencies and execute.
|
|
53
54
|
try {
|
|
54
|
-
const
|
|
55
|
+
const runner = await container.resolve(MigrationRunner);
|
|
56
|
+
runner.setContext({
|
|
57
|
+
logGroupName: process.env.AWS_LAMBDA_LOG_GROUP_NAME,
|
|
58
|
+
logStreamName: process.env.AWS_LAMBDA_LOG_STREAM_NAME
|
|
59
|
+
});
|
|
60
|
+
if (payload.command === "execute") {
|
|
61
|
+
await runner.execute(projectVersion, patternMatcher || isMigrationApplicable, forceExecute);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
55
64
|
return {
|
|
56
|
-
data
|
|
65
|
+
data: await runner.getStatus()
|
|
57
66
|
};
|
|
58
67
|
} catch (err) {
|
|
59
68
|
return {
|
|
@@ -64,4 +73,5 @@ const createDdbEsProjectMigration = ({
|
|
|
64
73
|
}
|
|
65
74
|
});
|
|
66
75
|
};
|
|
67
|
-
|
|
76
|
+
|
|
77
|
+
//# sourceMappingURL=createDdbEsProjectMigration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createDdbEsProjectMigration","migrations","elasticsearchClient","primaryTable","dynamoToEsTable","isMigrationApplicable","undefined","repository","
|
|
1
|
+
{"version":3,"names":["createRawEventHandler","createContainer","ElasticsearchClientSymbol","ElasticsearchDynamoTableSymbol","ExecutionTimeLimiterSymbol","MigrationRepositorySymbol","MigrationSymbol","PrimaryDynamoTableSymbol","MigrationRunner","MigrationRepositoryImpl","devVersionErrorResponse","createPatternMatcher","coerce","semverCoerce","createDdbEsProjectMigration","migrations","elasticsearchClient","primaryTable","dynamoToEsTable","isMigrationApplicable","undefined","repository","config","payload","lambdaContext","projectVersion","String","version","process","env","WEBINY_VERSION","forceExecute","force","container","bind","toConstantValue","timeLimiter","getRemainingTimeInMillis","to","forEach","migration","patternMatcher","pattern","runner","resolve","setContext","logGroupName","AWS_LAMBDA_LOG_GROUP_NAME","logStreamName","AWS_LAMBDA_LOG_STREAM_NAME","command","execute","data","getStatus","err","error","message"],"sources":["createDdbEsProjectMigration.ts"],"sourcesContent":["import type { Client as ElasticsearchClient } from \"@elastic/elasticsearch\";\nimport type { Table } from \"@webiny/db-dynamodb/toolbox.js\";\nimport { createRawEventHandler } from \"@webiny/handler-aws\";\nimport type { Constructor } from \"@webiny/ioc\";\nimport { createContainer } from \"@webiny/ioc\";\nimport type {\n DataMigration,\n ExecutionTimeLimiter,\n MigrationEventHandlerResponse,\n MigrationEventPayload,\n MigrationRepository\n} from \"~/types.js\";\nimport {\n ElasticsearchClientSymbol,\n ElasticsearchDynamoTableSymbol,\n ExecutionTimeLimiterSymbol,\n MigrationRepositorySymbol,\n MigrationSymbol,\n PrimaryDynamoTableSymbol\n} from \"~/symbols.js\";\nimport type { IsMigrationApplicable } from \"~/MigrationRunner.js\";\nimport { MigrationRunner } from \"~/MigrationRunner.js\";\nimport { MigrationRepositoryImpl } from \"~/repository/migrations.repository.js\";\nimport { devVersionErrorResponse } from \"~/handlers/devVersionErrorResponse.js\";\nimport { createPatternMatcher } from \"~/handlers/createPatternMatcher.js\";\nimport { coerce as semverCoerce } from \"semver\";\n\ninterface CreateDdbEsDataMigrationConfig {\n elasticsearchClient: ElasticsearchClient;\n primaryTable: Table<string, string, string>;\n dynamoToEsTable: Table<string, string, string>;\n migrations: Constructor<DataMigration>[];\n isMigrationApplicable?: IsMigrationApplicable;\n repository?: MigrationRepository;\n timeLimiter?: ExecutionTimeLimiter;\n}\n\nexport const createDdbEsProjectMigration = ({\n migrations,\n elasticsearchClient,\n primaryTable,\n dynamoToEsTable,\n isMigrationApplicable = undefined,\n repository = undefined,\n ...config\n}: CreateDdbEsDataMigrationConfig) => {\n return createRawEventHandler<MigrationEventPayload, any, MigrationEventHandlerResponse>(\n async ({ payload, lambdaContext }) => {\n const projectVersion = String(payload?.version || process.env.WEBINY_VERSION);\n const forceExecute = payload.force === true;\n\n const version = semverCoerce(projectVersion);\n if (version?.version === \"0.0.0\") {\n return devVersionErrorResponse();\n }\n\n // COMPOSITION ROOT\n const container = createContainer();\n container.bind(PrimaryDynamoTableSymbol).toConstantValue(primaryTable);\n container.bind(ElasticsearchDynamoTableSymbol).toConstantValue(dynamoToEsTable);\n container.bind(ElasticsearchClientSymbol).toConstantValue(elasticsearchClient);\n\n const timeLimiter: ExecutionTimeLimiter =\n config.timeLimiter || lambdaContext?.getRemainingTimeInMillis || (() => 0);\n container.bind(ExecutionTimeLimiterSymbol).toConstantValue(timeLimiter);\n\n if (repository) {\n // Repository implementation provided by the user.\n container.bind(MigrationRepositorySymbol).toConstantValue(repository);\n } else {\n // Default repository implementation.\n container.bind(MigrationRepositorySymbol).to(MigrationRepositoryImpl);\n }\n\n // Bind the provided migrations.\n migrations.forEach(migration => container.bind(MigrationSymbol).to(migration));\n\n // If handler was invoked with a `pattern`, filter migrations that match the pattern only.\n let patternMatcher;\n if (payload.pattern) {\n patternMatcher = createPatternMatcher(payload.pattern);\n }\n\n // Inject dependencies and execute.\n try {\n const runner = await container.resolve(MigrationRunner);\n runner.setContext({\n logGroupName: process.env.AWS_LAMBDA_LOG_GROUP_NAME,\n logStreamName: process.env.AWS_LAMBDA_LOG_STREAM_NAME\n });\n\n if (payload.command === \"execute\") {\n await runner.execute(\n projectVersion,\n patternMatcher || isMigrationApplicable,\n forceExecute\n );\n return;\n }\n\n return { data: await runner.getStatus() };\n } catch (err) {\n return { error: { message: err.message } };\n }\n }\n );\n};\n"],"mappings":"AAEA,SAASA,qBAAqB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 +1,13 @@
|
|
|
1
|
-
import { Table } from "dynamodb
|
|
2
|
-
import { Constructor } from "@webiny/ioc";
|
|
3
|
-
import { IsMigrationApplicable } from "../MigrationRunner";
|
|
4
|
-
import { DataMigration, MigrationEventHandlerResponse, MigrationEventPayload, MigrationRepository } from "../types";
|
|
1
|
+
import type { Table } from "@webiny/db-dynamodb/toolbox.js";
|
|
2
|
+
import type { Constructor } from "@webiny/ioc";
|
|
3
|
+
import type { IsMigrationApplicable } from "../MigrationRunner.js";
|
|
4
|
+
import type { DataMigration, ExecutionTimeLimiter, MigrationEventHandlerResponse, MigrationEventPayload, MigrationRepository } from "../types.js";
|
|
5
5
|
interface CreateDdbDataMigrationConfig {
|
|
6
6
|
migrations: Constructor<DataMigration>[];
|
|
7
|
-
primaryTable: Table
|
|
7
|
+
primaryTable: Table<string, string, string>;
|
|
8
8
|
repository?: MigrationRepository;
|
|
9
9
|
isMigrationApplicable?: IsMigrationApplicable;
|
|
10
|
+
timeLimiter?: ExecutionTimeLimiter;
|
|
10
11
|
}
|
|
11
|
-
export declare const createDdbProjectMigration: ({ migrations, primaryTable, isMigrationApplicable, repository }: CreateDdbDataMigrationConfig) => import("@webiny/handler-aws").RawEventHandler<MigrationEventPayload, any, MigrationEventHandlerResponse>;
|
|
12
|
+
export declare const createDdbProjectMigration: ({ migrations, primaryTable, isMigrationApplicable, repository, ...config }: CreateDdbDataMigrationConfig) => import("@webiny/handler-aws").RawEventHandler<MigrationEventPayload, any, MigrationEventHandlerResponse>;
|
|
12
13
|
export {};
|
|
@@ -1,55 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _symbols = require("../symbols");
|
|
11
|
-
var _migrations = require("../repository/migrations.repository");
|
|
12
|
-
var _devVersionErrorResponse = require("./devVersionErrorResponse");
|
|
13
|
-
var _createPatternMatcher = require("./createPatternMatcher");
|
|
14
|
-
const createDdbProjectMigration = ({
|
|
1
|
+
import { createRawEventHandler } from "@webiny/handler-aws";
|
|
2
|
+
import { createContainer } from "@webiny/ioc";
|
|
3
|
+
import { MigrationRunner } from "../MigrationRunner.js";
|
|
4
|
+
import { ExecutionTimeLimiterSymbol, MigrationRepositorySymbol, MigrationSymbol, PrimaryDynamoTableSymbol } from "../symbols.js";
|
|
5
|
+
import { MigrationRepositoryImpl } from "../repository/migrations.repository.js";
|
|
6
|
+
import { devVersionErrorResponse } from "./devVersionErrorResponse.js";
|
|
7
|
+
import { createPatternMatcher } from "./createPatternMatcher.js";
|
|
8
|
+
import { coerce as semverCoerce } from "semver";
|
|
9
|
+
export const createDdbProjectMigration = ({
|
|
15
10
|
migrations,
|
|
16
11
|
primaryTable,
|
|
17
12
|
isMigrationApplicable = undefined,
|
|
18
|
-
repository = undefined
|
|
13
|
+
repository = undefined,
|
|
14
|
+
...config
|
|
19
15
|
}) => {
|
|
20
|
-
return
|
|
21
|
-
payload
|
|
16
|
+
return createRawEventHandler(async ({
|
|
17
|
+
payload,
|
|
18
|
+
lambdaContext
|
|
22
19
|
}) => {
|
|
23
|
-
const projectVersion = String(
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
const projectVersion = String(payload?.version || process.env.WEBINY_VERSION);
|
|
21
|
+
const forceExecute = payload.force === true;
|
|
22
|
+
const version = semverCoerce(projectVersion);
|
|
23
|
+
if (version?.version === "0.0.0") {
|
|
24
|
+
return devVersionErrorResponse();
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
// COMPOSITION ROOT
|
|
29
|
-
const container =
|
|
30
|
-
container.bind(
|
|
28
|
+
const container = createContainer();
|
|
29
|
+
container.bind(PrimaryDynamoTableSymbol).toConstantValue(primaryTable);
|
|
30
|
+
const timeLimiter = config.timeLimiter || lambdaContext?.getRemainingTimeInMillis || (() => 0);
|
|
31
|
+
container.bind(ExecutionTimeLimiterSymbol).toConstantValue(timeLimiter);
|
|
31
32
|
if (repository) {
|
|
32
33
|
// Repository implementation provided by the user.
|
|
33
|
-
container.bind(
|
|
34
|
+
container.bind(MigrationRepositorySymbol).toConstantValue(repository);
|
|
34
35
|
} else {
|
|
35
36
|
// Default repository implementation.
|
|
36
|
-
container.bind(
|
|
37
|
+
container.bind(MigrationRepositorySymbol).to(MigrationRepositoryImpl);
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
// Bind the provided migrations.
|
|
40
|
-
migrations.forEach(migration => container.bind(
|
|
41
|
+
migrations.forEach(migration => container.bind(MigrationSymbol).to(migration));
|
|
41
42
|
|
|
42
43
|
// If handler was invoked with a `pattern`, filter migrations that match the pattern only.
|
|
43
44
|
let patternMatcher;
|
|
44
45
|
if (payload.pattern) {
|
|
45
|
-
patternMatcher =
|
|
46
|
+
patternMatcher = createPatternMatcher(payload.pattern);
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
// Inject dependencies and execute.
|
|
49
50
|
try {
|
|
50
|
-
const
|
|
51
|
+
const runner = await container.resolve(MigrationRunner);
|
|
52
|
+
runner.setContext({
|
|
53
|
+
logGroupName: process.env.AWS_LAMBDA_LOG_GROUP_NAME,
|
|
54
|
+
logStreamName: process.env.AWS_LAMBDA_LOG_STREAM_NAME
|
|
55
|
+
});
|
|
56
|
+
if (payload.command === "execute") {
|
|
57
|
+
await runner.execute(projectVersion, patternMatcher || isMigrationApplicable, forceExecute);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
51
60
|
return {
|
|
52
|
-
data
|
|
61
|
+
data: await runner.getStatus()
|
|
53
62
|
};
|
|
54
63
|
} catch (err) {
|
|
55
64
|
return {
|
|
@@ -60,4 +69,5 @@ const createDdbProjectMigration = ({
|
|
|
60
69
|
}
|
|
61
70
|
});
|
|
62
71
|
};
|
|
63
|
-
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=createDdbProjectMigration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createDdbProjectMigration","migrations","primaryTable","isMigrationApplicable","undefined","repository","
|
|
1
|
+
{"version":3,"names":["createRawEventHandler","createContainer","MigrationRunner","ExecutionTimeLimiterSymbol","MigrationRepositorySymbol","MigrationSymbol","PrimaryDynamoTableSymbol","MigrationRepositoryImpl","devVersionErrorResponse","createPatternMatcher","coerce","semverCoerce","createDdbProjectMigration","migrations","primaryTable","isMigrationApplicable","undefined","repository","config","payload","lambdaContext","projectVersion","String","version","process","env","WEBINY_VERSION","forceExecute","force","container","bind","toConstantValue","timeLimiter","getRemainingTimeInMillis","to","forEach","migration","patternMatcher","pattern","runner","resolve","setContext","logGroupName","AWS_LAMBDA_LOG_GROUP_NAME","logStreamName","AWS_LAMBDA_LOG_STREAM_NAME","command","execute","data","getStatus","err","error","message"],"sources":["createDdbProjectMigration.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox.js\";\nimport { createRawEventHandler } from \"@webiny/handler-aws\";\nimport type { Constructor } from \"@webiny/ioc\";\nimport { createContainer } from \"@webiny/ioc\";\nimport type { IsMigrationApplicable } from \"~/MigrationRunner.js\";\nimport { MigrationRunner } from \"~/MigrationRunner.js\";\nimport {\n ExecutionTimeLimiterSymbol,\n MigrationRepositorySymbol,\n MigrationSymbol,\n PrimaryDynamoTableSymbol\n} from \"~/symbols.js\";\nimport { MigrationRepositoryImpl } from \"~/repository/migrations.repository.js\";\nimport { devVersionErrorResponse } from \"./devVersionErrorResponse.js\";\nimport { createPatternMatcher } from \"./createPatternMatcher.js\";\nimport type {\n DataMigration,\n ExecutionTimeLimiter,\n MigrationEventHandlerResponse,\n MigrationEventPayload,\n MigrationRepository\n} from \"~/types.js\";\nimport { coerce as semverCoerce } from \"semver\";\n\ninterface CreateDdbDataMigrationConfig {\n migrations: Constructor<DataMigration>[];\n primaryTable: Table<string, string, string>;\n repository?: MigrationRepository;\n isMigrationApplicable?: IsMigrationApplicable;\n timeLimiter?: ExecutionTimeLimiter;\n}\n\nexport const createDdbProjectMigration = ({\n migrations,\n primaryTable,\n isMigrationApplicable = undefined,\n repository = undefined,\n ...config\n}: CreateDdbDataMigrationConfig) => {\n return createRawEventHandler<MigrationEventPayload, any, MigrationEventHandlerResponse>(\n async ({ payload, lambdaContext }) => {\n const projectVersion = String(payload?.version || process.env.WEBINY_VERSION);\n const forceExecute = payload.force === true;\n\n const version = semverCoerce(projectVersion);\n if (version?.version === \"0.0.0\") {\n return devVersionErrorResponse();\n }\n\n // COMPOSITION ROOT\n const container = createContainer();\n container.bind(PrimaryDynamoTableSymbol).toConstantValue(primaryTable);\n\n const timeLimiter: ExecutionTimeLimiter =\n config.timeLimiter || lambdaContext?.getRemainingTimeInMillis || (() => 0);\n container.bind(ExecutionTimeLimiterSymbol).toConstantValue(timeLimiter);\n\n if (repository) {\n // Repository implementation provided by the user.\n container.bind(MigrationRepositorySymbol).toConstantValue(repository);\n } else {\n // Default repository implementation.\n container.bind(MigrationRepositorySymbol).to(MigrationRepositoryImpl);\n }\n\n // Bind the provided migrations.\n migrations.forEach(migration => container.bind(MigrationSymbol).to(migration));\n\n // If handler was invoked with a `pattern`, filter migrations that match the pattern only.\n let patternMatcher;\n if (payload.pattern) {\n patternMatcher = createPatternMatcher(payload.pattern);\n }\n\n // Inject dependencies and execute.\n try {\n const runner = await container.resolve(MigrationRunner);\n runner.setContext({\n logGroupName: process.env.AWS_LAMBDA_LOG_GROUP_NAME,\n logStreamName: process.env.AWS_LAMBDA_LOG_STREAM_NAME\n });\n\n if (payload.command === \"execute\") {\n await runner.execute(\n projectVersion,\n patternMatcher || isMigrationApplicable,\n forceExecute\n );\n return;\n }\n\n return {\n data: await runner.getStatus()\n };\n } catch (err) {\n return { error: { message: err.message } };\n }\n }\n );\n};\n"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,qBAAqB;AAE3D,SAASC,eAAe,QAAQ,aAAa;AAE7C,SAASC,eAAe;AACxB,SACIC,0BAA0B,EAC1BC,yBAAyB,EACzBC,eAAe,EACfC,wBAAwB;AAE5B,SAASC,uBAAuB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I,CAACzB,eAAe,CAAC,CAAC6B,EAAE,CAACE,SAAS,CAAC,CAAC;;IAE9E;IACA,IAAIC,cAAc;IAClB,IAAIlB,OAAO,CAACmB,OAAO,EAAE;MACjBD,cAAc,GAAG5B,oBAAoB,CAACU,OAAO,CAACmB,OAAO,CAAC;IAC1D;;IAEA;IACA,IAAI;MACA,MAAMC,MAAM,GAAG,MAAMV,SAAS,CAACW,OAAO,CAACtC,eAAe,CAAC;MACvDqC,MAAM,CAACE,UAAU,CAAC;QACdC,YAAY,EAAElB,OAAO,CAACC,GAAG,CAACkB,yBAAyB;QACnDC,aAAa,EAAEpB,OAAO,CAACC,GAAG,CAACoB;MAC/B,CAAC,CAAC;MAEF,IAAI1B,OAAO,CAAC2B,OAAO,KAAK,SAAS,EAAE;QAC/B,MAAMP,MAAM,CAACQ,OAAO,CAChB1B,cAAc,EACdgB,cAAc,IAAItB,qBAAqB,EACvCY,YACJ,CAAC;QACD;MACJ;MAEA,OAAO;QACHqB,IAAI,EAAE,MAAMT,MAAM,CAACU,SAAS,CAAC;MACjC,CAAC;IACL,CAAC,CAAC,OAAOC,GAAG,EAAE;MACV,OAAO;QAAEC,KAAK,EAAE;UAAEC,OAAO,EAAEF,GAAG,CAACE;QAAQ;MAAE,CAAC;IAC9C;EACJ,CACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IsMigrationApplicable } from "../MigrationRunner";
|
|
1
|
+
import type { IsMigrationApplicable } from "../MigrationRunner.js";
|
|
2
2
|
export declare const createPatternMatcher: (pattern: string) => IsMigrationApplicable;
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.createPatternMatcher = void 0;
|
|
8
|
-
var _minimatch = _interopRequireDefault(require("minimatch"));
|
|
9
|
-
const createPatternMatcher = pattern => {
|
|
1
|
+
import { minimatch } from "minimatch";
|
|
2
|
+
export const createPatternMatcher = pattern => {
|
|
10
3
|
return migration => {
|
|
11
4
|
if (pattern.includes("*")) {
|
|
12
|
-
return (
|
|
5
|
+
return minimatch(migration.getId(), pattern);
|
|
13
6
|
}
|
|
14
7
|
return migration.getId() === pattern;
|
|
15
8
|
};
|
|
16
9
|
};
|
|
17
|
-
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=createPatternMatcher.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createPatternMatcher","pattern","migration","includes","
|
|
1
|
+
{"version":3,"names":["minimatch","createPatternMatcher","pattern","migration","includes","getId"],"sources":["createPatternMatcher.ts"],"sourcesContent":["import { minimatch } from \"minimatch\";\nimport type { IsMigrationApplicable } from \"~/MigrationRunner.js\";\n\nexport const createPatternMatcher = (pattern: string): IsMigrationApplicable => {\n return migration => {\n if (pattern.includes(\"*\")) {\n return minimatch(migration.getId(), pattern);\n }\n return migration.getId() === pattern;\n };\n};\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,WAAW;AAGrC,OAAO,MAAMC,oBAAoB,GAAIC,OAAe,IAA4B;EAC5E,OAAOC,SAAS,IAAI;IAChB,IAAID,OAAO,CAACE,QAAQ,CAAC,GAAG,CAAC,EAAE;MACvB,OAAOJ,SAAS,CAACG,SAAS,CAACE,KAAK,CAAC,CAAC,EAAEH,OAAO,CAAC;IAChD;IACA,OAAOC,SAAS,CAACE,KAAK,CAAC,CAAC,KAAKH,OAAO;EACxC,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.devVersionErrorResponse = void 0;
|
|
7
|
-
const devVersionErrorResponse = () => {
|
|
1
|
+
export const devVersionErrorResponse = () => {
|
|
8
2
|
return {
|
|
9
3
|
error: {
|
|
10
4
|
message: [`This project is using a development version 0.0.0!`, `Migrations cannot be executed using version 0.0.0, as that makes them all eligible for execution.`, `To trigger a particular set of migrations, set a WEBINY_VERSION variable in the .env file.`].join(" ")
|
|
11
5
|
}
|
|
12
6
|
};
|
|
13
7
|
};
|
|
14
|
-
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=devVersionErrorResponse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["devVersionErrorResponse","error","message","join"],"sources":["devVersionErrorResponse.ts"],"sourcesContent":["export const devVersionErrorResponse = () => {\n return {\n error: {\n message: [\n `This project is using a development version 0.0.0!`,\n `Migrations cannot be executed using version 0.0.0, as that makes them all eligible for execution.`,\n `To trigger a particular set of migrations, set a WEBINY_VERSION variable in the .env file.`\n ].join(\" \")\n }\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["devVersionErrorResponse","error","message","join"],"sources":["devVersionErrorResponse.ts"],"sourcesContent":["export const devVersionErrorResponse = () => {\n return {\n error: {\n message: [\n `This project is using a development version 0.0.0!`,\n `Migrations cannot be executed using version 0.0.0, as that makes them all eligible for execution.`,\n `To trigger a particular set of migrations, set a WEBINY_VERSION variable in the .env file.`\n ].join(\" \")\n }\n };\n};\n"],"mappings":"AAAA,OAAO,MAAMA,uBAAuB,GAAGA,CAAA,KAAM;EACzC,OAAO;IACHC,KAAK,EAAE;MACHC,OAAO,EAAE,CACL,oDAAoD,EACpD,mGAAmG,EACnG,4FAA4F,CAC/F,CAACC,IAAI,CAAC,GAAG;IACd;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from "./handlers/createDdbProjectMigration";
|
|
2
|
-
export * from "./handlers/createDdbEsProjectMigration";
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./createPinoLogger";
|
|
1
|
+
export * from "./handlers/createDdbProjectMigration.js";
|
|
2
|
+
export * from "./handlers/createDdbEsProjectMigration.js";
|
|
3
|
+
export * from "./types.js";
|
|
4
|
+
export * from "./createTable.js";
|
|
5
|
+
export * from "./createPinoLogger.js";
|
|
6
|
+
export * from "./createPinoLogger.js";
|
package/index.js
CHANGED
|
@@ -1,71 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
export * from "./handlers/createDdbProjectMigration.js";
|
|
2
|
+
export * from "./handlers/createDdbEsProjectMigration.js";
|
|
3
|
+
export * from "./types.js";
|
|
4
|
+
export * from "./createTable.js";
|
|
5
|
+
export * from "./createPinoLogger.js";
|
|
6
|
+
export * from "./createPinoLogger.js";
|
|
2
7
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _createDdbProjectMigration = require("./handlers/createDdbProjectMigration");
|
|
7
|
-
Object.keys(_createDdbProjectMigration).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _createDdbProjectMigration[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _createDdbProjectMigration[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _createDdbEsProjectMigration = require("./handlers/createDdbEsProjectMigration");
|
|
18
|
-
Object.keys(_createDdbEsProjectMigration).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _createDdbEsProjectMigration[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _createDdbEsProjectMigration[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _symbols = require("./symbols");
|
|
29
|
-
Object.keys(_symbols).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _symbols[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _symbols[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _types = require("./types");
|
|
40
|
-
Object.keys(_types).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _types[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _types[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
var _createTable = require("./createTable");
|
|
51
|
-
Object.keys(_createTable).forEach(function (key) {
|
|
52
|
-
if (key === "default" || key === "__esModule") return;
|
|
53
|
-
if (key in exports && exports[key] === _createTable[key]) return;
|
|
54
|
-
Object.defineProperty(exports, key, {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _createTable[key];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
var _createPinoLogger = require("./createPinoLogger");
|
|
62
|
-
Object.keys(_createPinoLogger).forEach(function (key) {
|
|
63
|
-
if (key === "default" || key === "__esModule") return;
|
|
64
|
-
if (key in exports && exports[key] === _createPinoLogger[key]) return;
|
|
65
|
-
Object.defineProperty(exports, key, {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function () {
|
|
68
|
-
return _createPinoLogger[key];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./handlers/createDdbProjectMigration\";\nexport * from \"./handlers/createDdbEsProjectMigration\";\nexport * from \"./
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./handlers/createDdbProjectMigration.js\";\nexport * from \"./handlers/createDdbEsProjectMigration.js\";\nexport * from \"./types.js\";\nexport * from \"./createTable.js\";\nexport * from \"./createPinoLogger.js\";\nexport * from \"./createPinoLogger.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|