@webiny/data-migration 5.38.0-beta.1 → 5.38.0-beta.3

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/data-migration",
3
- "version": "5.38.0-beta.1",
3
+ "version": "5.38.0-beta.3",
4
4
  "main": "index.js",
5
5
  "types": "types.ts",
6
6
  "license": "MIT",
@@ -14,11 +14,11 @@
14
14
  "@babel/runtime": "7.22.6",
15
15
  "@elastic/elasticsearch": "7.12.0",
16
16
  "@types/pino": "7.0.5",
17
- "@webiny/db-dynamodb": "5.38.0-beta.1",
18
- "@webiny/handler-aws": "5.38.0-beta.1",
19
- "@webiny/ioc": "5.38.0-beta.1",
20
- "@webiny/logger": "5.38.0-beta.1",
21
- "@webiny/utils": "5.38.0-beta.1",
17
+ "@webiny/db-dynamodb": "5.38.0-beta.3",
18
+ "@webiny/handler-aws": "5.38.0-beta.3",
19
+ "@webiny/ioc": "5.38.0-beta.3",
20
+ "@webiny/logger": "5.38.0-beta.3",
21
+ "@webiny/utils": "5.38.0-beta.3",
22
22
  "center-align": "1.0.1",
23
23
  "chalk": "4.1.2",
24
24
  "dynamodb-toolbox": "0.3.5",
@@ -32,8 +32,8 @@
32
32
  "@babel/preset-env": "7.22.7",
33
33
  "@types/center-align": "1.0.0",
34
34
  "@types/semver": "7.3.13",
35
- "@webiny/cli": "5.38.0-beta.1",
36
- "@webiny/project-utils": "5.38.0-beta.1",
35
+ "@webiny/cli": "5.38.0-beta.3",
36
+ "@webiny/project-utils": "5.38.0-beta.3",
37
37
  "jest": "29.5.0",
38
38
  "jest-dynalite": "3.6.1",
39
39
  "jest-mock-console": "1.3.0",
@@ -55,5 +55,5 @@
55
55
  ]
56
56
  }
57
57
  },
58
- "gitHead": "6daf38d3ed0c029a8fea005c2b6246e5b325a09c"
58
+ "gitHead": "fa1befb07e92cfe36928481333308d88c3348d6b"
59
59
  }
package/types.d.ts CHANGED
@@ -45,8 +45,8 @@ export interface DataMigrationContext<TCheckpoint = any> {
45
45
  checkpoint?: TCheckpoint;
46
46
  forceExecute: boolean;
47
47
  runningOutOfTime: () => boolean;
48
- createCheckpoint: (data: TCheckpoint) => void;
49
- createCheckpointAndExit: (data: TCheckpoint) => void;
48
+ createCheckpoint: (data: TCheckpoint) => Promise<void>;
49
+ createCheckpointAndExit: (data: TCheckpoint) => Promise<void>;
50
50
  }
51
51
  export interface DataMigration<TCheckpoint = any> {
52
52
  getId(): string;
package/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { 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) => void;\n createCheckpointAndExit: (data: TCheckpoint) => 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}\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":""}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { 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}\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":""}