@bernierllc/contentful-migration-service 1.2.5 → 1.5.0
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/dist/ContentfulMigrationService.js +4 -0
- package/dist/errors.d.ts +11 -0
- package/dist/errors.js +24 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/storage/InMemoryMigrationStorage.js +1 -3
- package/package.json +5 -5
|
@@ -17,6 +17,10 @@ const neverhub_adapter_1 = require("@bernierllc/neverhub-adapter");
|
|
|
17
17
|
* rollback support, and migration history tracking.
|
|
18
18
|
*/
|
|
19
19
|
class ContentfulMigrationService {
|
|
20
|
+
logger;
|
|
21
|
+
cmaClient;
|
|
22
|
+
config;
|
|
23
|
+
neverhub;
|
|
20
24
|
constructor(config) {
|
|
21
25
|
this.config = {
|
|
22
26
|
...config,
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type ContentfulMigrationServiceErrorCode = 'CONTENTFUL_MIGRATION_SERVICE_ERROR' | 'INVALID_INPUT' | 'OPERATION_FAILED';
|
|
2
|
+
export interface ContentfulMigrationServiceErrorOptions {
|
|
3
|
+
cause?: Error;
|
|
4
|
+
code?: ContentfulMigrationServiceErrorCode;
|
|
5
|
+
context?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
export declare class ContentfulMigrationServiceError extends Error {
|
|
8
|
+
readonly code: ContentfulMigrationServiceErrorCode;
|
|
9
|
+
readonly context?: Record<string, unknown>;
|
|
10
|
+
constructor(message: string, options?: ContentfulMigrationServiceErrorOptions);
|
|
11
|
+
}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright (c) 2025 Bernier LLC
|
|
4
|
+
|
|
5
|
+
This file is licensed to the client under a limited-use license.
|
|
6
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.ContentfulMigrationServiceError = void 0;
|
|
11
|
+
class ContentfulMigrationServiceError extends Error {
|
|
12
|
+
code;
|
|
13
|
+
context;
|
|
14
|
+
constructor(message, options) {
|
|
15
|
+
super(message, options?.cause ? { cause: options.cause } : undefined);
|
|
16
|
+
this.name = 'ContentfulMigrationServiceError';
|
|
17
|
+
this.code = options?.code ?? 'CONTENTFUL_MIGRATION_SERVICE_ERROR';
|
|
18
|
+
if (options?.context !== undefined) {
|
|
19
|
+
this.context = options.context;
|
|
20
|
+
}
|
|
21
|
+
Error.captureStackTrace?.(this, this.constructor);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.ContentfulMigrationServiceError = ContentfulMigrationServiceError;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { ContentfulMigrationService } from './ContentfulMigrationService';
|
|
2
|
+
export { ContentfulMigrationServiceError, type ContentfulMigrationServiceErrorCode, type ContentfulMigrationServiceErrorOptions } from './errors';
|
|
2
3
|
export { InMemoryMigrationStorage } from './storage/InMemoryMigrationStorage';
|
|
3
4
|
export type { MigrationRecord, MigrationStorage, MigrationServiceConfig, MigrationOptions, MigrationResult, MigrationFunction, ValidationResult, } from './types';
|
package/dist/index.js
CHANGED
|
@@ -7,8 +7,10 @@ The client may use and modify this code *only within the scope of the project it
|
|
|
7
7
|
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.InMemoryMigrationStorage = exports.ContentfulMigrationService = void 0;
|
|
10
|
+
exports.InMemoryMigrationStorage = exports.ContentfulMigrationServiceError = exports.ContentfulMigrationService = void 0;
|
|
11
11
|
var ContentfulMigrationService_1 = require("./ContentfulMigrationService");
|
|
12
12
|
Object.defineProperty(exports, "ContentfulMigrationService", { enumerable: true, get: function () { return ContentfulMigrationService_1.ContentfulMigrationService; } });
|
|
13
|
+
var errors_1 = require("./errors");
|
|
14
|
+
Object.defineProperty(exports, "ContentfulMigrationServiceError", { enumerable: true, get: function () { return errors_1.ContentfulMigrationServiceError; } });
|
|
13
15
|
var InMemoryMigrationStorage_1 = require("./storage/InMemoryMigrationStorage");
|
|
14
16
|
Object.defineProperty(exports, "InMemoryMigrationStorage", { enumerable: true, get: function () { return InMemoryMigrationStorage_1.InMemoryMigrationStorage; } });
|
|
@@ -12,9 +12,7 @@ exports.InMemoryMigrationStorage = void 0;
|
|
|
12
12
|
* In-memory implementation of MigrationStorage for testing and development
|
|
13
13
|
*/
|
|
14
14
|
class InMemoryMigrationStorage {
|
|
15
|
-
|
|
16
|
-
this.migrations = new Map();
|
|
17
|
-
}
|
|
15
|
+
migrations = new Map();
|
|
18
16
|
async saveMigration(record) {
|
|
19
17
|
this.migrations.set(record.id, { ...record });
|
|
20
18
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bernierllc/contentful-migration-service",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Content model migration management with version control, rollback support, and migration history tracking",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contentful",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"contentful-migration": "^4.0.0",
|
|
24
|
-
"@bernierllc/contentful-cma-client": "1.0
|
|
25
|
-
"@bernierllc/
|
|
26
|
-
"@bernierllc/
|
|
27
|
-
"@bernierllc/neverhub-adapter": "0.
|
|
24
|
+
"@bernierllc/contentful-cma-client": "1.2.0",
|
|
25
|
+
"@bernierllc/contentful-types": "1.4.0",
|
|
26
|
+
"@bernierllc/logger": "1.6.0",
|
|
27
|
+
"@bernierllc/neverhub-adapter": "0.3.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/jest": "^29.5.14",
|