@powerhousedao/reactor 5.2.0-staging.9 → 6.0.0-dev.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/dist/src/actions/index.d.ts +24 -0
- package/dist/src/actions/index.d.ts.map +1 -0
- package/dist/src/actions/index.js +76 -0
- package/dist/src/actions/index.js.map +1 -0
- package/dist/src/cache/document-meta-cache.d.ts.map +1 -1
- package/dist/src/cache/document-meta-cache.js +2 -1
- package/dist/src/cache/document-meta-cache.js.map +1 -1
- package/dist/src/cache/kysely-operation-index.d.ts.map +1 -1
- package/dist/src/cache/kysely-operation-index.js +14 -25
- package/dist/src/cache/kysely-operation-index.js.map +1 -1
- package/dist/src/cache/kysely-write-cache.d.ts.map +1 -1
- package/dist/src/cache/kysely-write-cache.js +18 -5
- package/dist/src/cache/kysely-write-cache.js.map +1 -1
- package/dist/src/cache/operation-index-types.d.ts +1 -1
- package/dist/src/client/reactor-client.d.ts +16 -4
- package/dist/src/client/reactor-client.d.ts.map +1 -1
- package/dist/src/client/reactor-client.js +100 -3
- package/dist/src/client/reactor-client.js.map +1 -1
- package/dist/src/client/types.d.ts +22 -3
- package/dist/src/client/types.d.ts.map +1 -1
- package/dist/src/core/reactor-builder.d.ts +10 -9
- package/dist/src/core/reactor-builder.d.ts.map +1 -1
- package/dist/src/core/reactor-builder.js +52 -14
- package/dist/src/core/reactor-builder.js.map +1 -1
- package/dist/src/core/reactor-client-builder.d.ts +10 -1
- package/dist/src/core/reactor-client-builder.d.ts.map +1 -1
- package/dist/src/core/reactor-client-builder.js +16 -1
- package/dist/src/core/reactor-client-builder.js.map +1 -1
- package/dist/src/core/reactor.d.ts +9 -8
- package/dist/src/core/reactor.d.ts.map +1 -1
- package/dist/src/core/reactor.js +64 -74
- package/dist/src/core/reactor.js.map +1 -1
- package/dist/src/core/types.d.ts +22 -7
- package/dist/src/core/types.d.ts.map +1 -1
- package/dist/src/core/utils.d.ts +1 -2
- package/dist/src/core/utils.d.ts.map +1 -1
- package/dist/src/core/utils.js +1 -1
- package/dist/src/core/utils.js.map +1 -1
- package/dist/src/events/types.d.ts +1 -0
- package/dist/src/events/types.d.ts.map +1 -1
- package/dist/src/executor/simple-job-executor-manager.d.ts +3 -1
- package/dist/src/executor/simple-job-executor-manager.d.ts.map +1 -1
- package/dist/src/executor/simple-job-executor-manager.js +10 -8
- package/dist/src/executor/simple-job-executor-manager.js.map +1 -1
- package/dist/src/executor/simple-job-executor.d.ts +15 -3
- package/dist/src/executor/simple-job-executor.d.ts.map +1 -1
- package/dist/src/executor/simple-job-executor.js +327 -230
- package/dist/src/executor/simple-job-executor.js.map +1 -1
- package/dist/src/executor/types.d.ts +2 -0
- package/dist/src/executor/types.d.ts.map +1 -1
- package/dist/src/executor/types.js.map +1 -1
- package/dist/src/executor/util.d.ts +14 -5
- package/dist/src/executor/util.d.ts.map +1 -1
- package/dist/src/executor/util.js +39 -9
- package/dist/src/executor/util.js.map +1 -1
- package/dist/src/index.d.ts +6 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +7 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/logging/console.d.ts +11 -1
- package/dist/src/logging/console.d.ts.map +1 -1
- package/dist/src/logging/console.js +45 -14
- package/dist/src/logging/console.js.map +1 -1
- package/dist/src/logging/types.d.ts +1 -0
- package/dist/src/logging/types.d.ts.map +1 -1
- package/dist/src/processors/index.d.ts +3 -0
- package/dist/src/processors/index.d.ts.map +1 -0
- package/dist/src/processors/index.js +2 -0
- package/dist/src/processors/index.js.map +1 -0
- package/dist/src/processors/processor-manager.d.ts +38 -0
- package/dist/src/processors/processor-manager.d.ts.map +1 -0
- package/dist/src/processors/processor-manager.js +165 -0
- package/dist/src/processors/processor-manager.js.map +1 -0
- package/dist/src/processors/types.d.ts +63 -0
- package/dist/src/processors/types.d.ts.map +1 -0
- package/dist/src/processors/types.js +2 -0
- package/dist/src/processors/types.js.map +1 -0
- package/dist/src/processors/utils.d.ts +10 -0
- package/dist/src/processors/utils.d.ts.map +1 -0
- package/dist/src/processors/utils.js +58 -0
- package/dist/src/processors/utils.js.map +1 -0
- package/dist/src/queue/types.d.ts +2 -0
- package/dist/src/queue/types.d.ts.map +1 -1
- package/dist/src/queue/types.js.map +1 -1
- package/dist/src/read-models/coordinator.d.ts +3 -2
- package/dist/src/read-models/coordinator.d.ts.map +1 -1
- package/dist/src/read-models/coordinator.js +12 -13
- package/dist/src/read-models/coordinator.js.map +1 -1
- package/dist/src/read-models/document-view.d.ts.map +1 -1
- package/dist/src/read-models/document-view.js +2 -0
- package/dist/src/read-models/document-view.js.map +1 -1
- package/dist/src/registry/implementation.d.ts +42 -34
- package/dist/src/registry/implementation.d.ts.map +1 -1
- package/dist/src/registry/implementation.js +168 -48
- package/dist/src/registry/implementation.js.map +1 -1
- package/dist/src/registry/interfaces.d.ts +69 -8
- package/dist/src/registry/interfaces.d.ts.map +1 -1
- package/dist/src/shared/errors.d.ts +16 -0
- package/dist/src/shared/errors.d.ts.map +1 -1
- package/dist/src/shared/errors.js +28 -0
- package/dist/src/shared/errors.js.map +1 -1
- package/dist/src/shared/types.d.ts +4 -0
- package/dist/src/shared/types.d.ts.map +1 -1
- package/dist/src/shared/types.js.map +1 -1
- package/dist/src/signer/passthrough-signer.d.ts +9 -3
- package/dist/src/signer/passthrough-signer.d.ts.map +1 -1
- package/dist/src/signer/passthrough-signer.js +13 -0
- package/dist/src/signer/passthrough-signer.js.map +1 -1
- package/dist/src/signer/types.d.ts +2 -22
- package/dist/src/signer/types.d.ts.map +1 -1
- package/dist/src/storage/interfaces.d.ts +13 -1
- package/dist/src/storage/interfaces.d.ts.map +1 -1
- package/dist/src/storage/interfaces.js +2 -2
- package/dist/src/storage/interfaces.js.map +1 -1
- package/dist/src/storage/kysely/store.d.ts +1 -0
- package/dist/src/storage/kysely/store.d.ts.map +1 -1
- package/dist/src/storage/kysely/store.js +40 -4
- package/dist/src/storage/kysely/store.js.map +1 -1
- package/dist/src/storage/kysely/sync-cursor-storage.js +2 -2
- package/dist/src/storage/kysely/sync-cursor-storage.js.map +1 -1
- package/dist/src/storage/kysely/sync-remote-storage.js +8 -8
- package/dist/src/storage/kysely/sync-remote-storage.js.map +1 -1
- package/dist/src/storage/kysely/types.d.ts +6 -6
- package/dist/src/storage/migrations/001_create_operation_table.d.ts.map +1 -1
- package/dist/src/storage/migrations/001_create_operation_table.js +2 -1
- package/dist/src/storage/migrations/001_create_operation_table.js.map +1 -1
- package/dist/src/storage/migrations/009_create_operation_index_tables.js +1 -1
- package/dist/src/storage/migrations/009_create_operation_index_tables.js.map +1 -1
- package/dist/src/storage/migrations/010_create_sync_tables.js +5 -5
- package/dist/src/storage/migrations/010_create_sync_tables.js.map +1 -1
- package/dist/src/storage/migrations/migrator.d.ts +3 -2
- package/dist/src/storage/migrations/migrator.d.ts.map +1 -1
- package/dist/src/storage/migrations/migrator.js +29 -6
- package/dist/src/storage/migrations/migrator.js.map +1 -1
- package/dist/src/storage/txn.d.ts.map +1 -1
- package/dist/src/storage/txn.js +2 -3
- package/dist/src/storage/txn.js.map +1 -1
- package/dist/src/subs/subscription-notification-read-model.d.ts +17 -0
- package/dist/src/subs/subscription-notification-read-model.d.ts.map +1 -0
- package/dist/src/subs/subscription-notification-read-model.js +62 -0
- package/dist/src/subs/subscription-notification-read-model.js.map +1 -0
- package/dist/src/sync/channels/composite-channel-factory.d.ts +3 -0
- package/dist/src/sync/channels/composite-channel-factory.d.ts.map +1 -1
- package/dist/src/sync/channels/composite-channel-factory.js +5 -1
- package/dist/src/sync/channels/composite-channel-factory.js.map +1 -1
- package/dist/src/sync/channels/gql-channel-factory.d.ts +3 -0
- package/dist/src/sync/channels/gql-channel-factory.d.ts.map +1 -1
- package/dist/src/sync/channels/gql-channel-factory.js +5 -1
- package/dist/src/sync/channels/gql-channel-factory.js.map +1 -1
- package/dist/src/sync/channels/gql-channel.d.ts +15 -1
- package/dist/src/sync/channels/gql-channel.d.ts.map +1 -1
- package/dist/src/sync/channels/gql-channel.js +77 -16
- package/dist/src/sync/channels/gql-channel.js.map +1 -1
- package/dist/src/sync/channels/polling-channel.d.ts.map +1 -1
- package/dist/src/sync/channels/polling-channel.js +7 -5
- package/dist/src/sync/channels/polling-channel.js.map +1 -1
- package/dist/src/sync/channels/utils.d.ts +17 -2
- package/dist/src/sync/channels/utils.d.ts.map +1 -1
- package/dist/src/sync/channels/utils.js +76 -6
- package/dist/src/sync/channels/utils.js.map +1 -1
- package/dist/src/sync/sync-builder.d.ts +3 -2
- package/dist/src/sync/sync-builder.d.ts.map +1 -1
- package/dist/src/sync/sync-builder.js +4 -4
- package/dist/src/sync/sync-builder.js.map +1 -1
- package/dist/src/sync/sync-manager.d.ts +3 -2
- package/dist/src/sync/sync-manager.d.ts.map +1 -1
- package/dist/src/sync/sync-manager.js +17 -13
- package/dist/src/sync/sync-manager.js.map +1 -1
- package/dist/src/sync/utils.d.ts +19 -0
- package/dist/src/sync/utils.d.ts.map +1 -1
- package/dist/src/sync/utils.js +44 -0
- package/dist/src/sync/utils.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { DocumentModelModule } from "document-model";
|
|
1
|
+
import type { DocumentModelModule, UpgradeManifest, UpgradeReducer, UpgradeTransition } from "document-model";
|
|
2
2
|
import type { IDocumentModelRegistry } from "./interfaces.js";
|
|
3
3
|
/**
|
|
4
4
|
* Error thrown when a document model module is not found in the registry.
|
|
5
5
|
*/
|
|
6
6
|
export declare class ModuleNotFoundError extends Error {
|
|
7
|
-
constructor(documentType: string);
|
|
7
|
+
constructor(documentType: string, version?: number);
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* Error thrown when attempting to register a module that already exists.
|
|
11
11
|
*/
|
|
12
12
|
export declare class DuplicateModuleError extends Error {
|
|
13
|
-
constructor(documentType: string);
|
|
13
|
+
constructor(documentType: string, version?: number);
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Error thrown when a module is invalid or malformed.
|
|
@@ -18,45 +18,53 @@ export declare class DuplicateModuleError extends Error {
|
|
|
18
18
|
export declare class InvalidModuleError extends Error {
|
|
19
19
|
constructor(message: string);
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Error thrown when attempting to register an upgrade manifest that already exists.
|
|
23
|
+
*/
|
|
24
|
+
export declare class DuplicateManifestError extends Error {
|
|
25
|
+
constructor(documentType: string);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Error thrown when an upgrade manifest is not found.
|
|
29
|
+
*/
|
|
30
|
+
export declare class ManifestNotFoundError extends Error {
|
|
31
|
+
constructor(documentType: string);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Error thrown when attempting a downgrade operation.
|
|
35
|
+
*/
|
|
36
|
+
export declare class DowngradeNotSupportedError extends Error {
|
|
37
|
+
constructor(documentType: string, fromVersion: number, toVersion: number);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Error thrown when a required upgrade transition is missing from the manifest.
|
|
41
|
+
*/
|
|
42
|
+
export declare class MissingUpgradeTransitionError extends Error {
|
|
43
|
+
constructor(documentType: string, fromVersion: number, toVersion: number);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Error thrown when getUpgradeReducer is called with a non-single-step version increment.
|
|
47
|
+
*/
|
|
48
|
+
export declare class InvalidUpgradeStepError extends Error {
|
|
49
|
+
constructor(documentType: string, fromVersion: number, toVersion: number);
|
|
50
|
+
}
|
|
21
51
|
/**
|
|
22
52
|
* In-memory implementation of the IDocumentModelRegistry interface.
|
|
23
|
-
* Manages document model modules
|
|
53
|
+
* Manages document model modules with version-aware storage and upgrade manifest support.
|
|
24
54
|
*/
|
|
25
55
|
export declare class DocumentModelRegistry implements IDocumentModelRegistry {
|
|
26
56
|
private modules;
|
|
27
|
-
|
|
28
|
-
* Register multiple modules at once.
|
|
29
|
-
*
|
|
30
|
-
* @param modules Document model modules to register
|
|
31
|
-
* @throws DuplicateModuleError if a module with the same document type is already registered
|
|
32
|
-
* @throws InvalidModuleError if a module is malformed
|
|
33
|
-
*/
|
|
57
|
+
private manifests;
|
|
34
58
|
registerModules(...modules: DocumentModelModule<any>[]): void;
|
|
35
|
-
/**
|
|
36
|
-
* Unregister multiple document model modules at once.
|
|
37
|
-
*
|
|
38
|
-
* @param documentTypes The document types to unregister
|
|
39
|
-
* @returns true if all modules were unregistered, false if any were not found
|
|
40
|
-
*/
|
|
41
59
|
unregisterModules(...documentTypes: string[]): boolean;
|
|
42
|
-
|
|
43
|
-
* Get a specific document model module by document type.
|
|
44
|
-
*
|
|
45
|
-
* @param documentType The document type identifier
|
|
46
|
-
* @returns The document model module
|
|
47
|
-
* @throws ModuleNotFoundError if the document type is not registered
|
|
48
|
-
*/
|
|
49
|
-
getModule(documentType: string): DocumentModelModule<any>;
|
|
50
|
-
/**
|
|
51
|
-
* Get all registered document model modules.
|
|
52
|
-
* Note: This only returns loaded modules, not lazy-loaded ones.
|
|
53
|
-
*
|
|
54
|
-
* @returns Array of all registered modules
|
|
55
|
-
*/
|
|
60
|
+
getModule(documentType: string, version?: number): DocumentModelModule<any>;
|
|
56
61
|
getAllModules(): DocumentModelModule<any>[];
|
|
57
|
-
/**
|
|
58
|
-
* Clear all registered modules
|
|
59
|
-
*/
|
|
60
62
|
clear(): void;
|
|
63
|
+
getSupportedVersions(documentType: string): number[];
|
|
64
|
+
getLatestVersion(documentType: string): number;
|
|
65
|
+
registerUpgradeManifests(...manifests: UpgradeManifest<readonly number[]>[]): void;
|
|
66
|
+
getUpgradeManifest(documentType: string): UpgradeManifest<readonly number[]>;
|
|
67
|
+
computeUpgradePath(documentType: string, fromVersion: number, toVersion: number): UpgradeTransition[];
|
|
68
|
+
getUpgradeReducer(documentType: string, fromVersion: number, toVersion: number): UpgradeReducer<any, any>;
|
|
61
69
|
}
|
|
62
70
|
//# sourceMappingURL=implementation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/registry/implementation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/registry/implementation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE9D;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;CAOnD;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;CAOnD;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,OAAO,EAAE,MAAM;CAI5B;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;gBACnC,YAAY,EAAE,MAAM;CAIjC;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,YAAY,EAAE,MAAM;CAIjC;AAED;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;gBACvC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAMzE;AAED;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,KAAK;gBAC1C,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAMzE;AAED;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAMzE;AAED;;;GAGG;AACH,qBAAa,qBAAsB,YAAW,sBAAsB;IAClE,OAAO,CAAC,OAAO,CAAkC;IACjD,OAAO,CAAC,SAAS,CAA4C;IAE7D,eAAe,CAAC,GAAG,OAAO,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI;IAmB7D,iBAAiB,CAAC,GAAG,aAAa,EAAE,MAAM,EAAE,GAAG,OAAO;IAoBtD,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAAC,GAAG,CAAC;IA4B3E,aAAa,IAAI,mBAAmB,CAAC,GAAG,CAAC,EAAE;IAI3C,KAAK,IAAI,IAAI;IAKb,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE;IAgBpD,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAqB9C,wBAAwB,CACtB,GAAG,SAAS,EAAE,eAAe,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,GACjD,IAAI;IAWP,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,eAAe,CAAC,SAAS,MAAM,EAAE,CAAC;IAS5E,kBAAkB,CAChB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,iBAAiB,EAAE;IA+BtB,iBAAiB,CACf,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC;CAoB5B"}
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* Error thrown when a document model module is not found in the registry.
|
|
3
3
|
*/
|
|
4
4
|
export class ModuleNotFoundError extends Error {
|
|
5
|
-
constructor(documentType) {
|
|
6
|
-
|
|
5
|
+
constructor(documentType, version) {
|
|
6
|
+
const versionSuffix = version !== undefined ? ` version ${version}` : "";
|
|
7
|
+
super(`Document model module not found for type: ${documentType}${versionSuffix}`);
|
|
7
8
|
this.name = "ModuleNotFoundError";
|
|
8
9
|
}
|
|
9
10
|
}
|
|
@@ -11,8 +12,9 @@ export class ModuleNotFoundError extends Error {
|
|
|
11
12
|
* Error thrown when attempting to register a module that already exists.
|
|
12
13
|
*/
|
|
13
14
|
export class DuplicateModuleError extends Error {
|
|
14
|
-
constructor(documentType) {
|
|
15
|
-
|
|
15
|
+
constructor(documentType, version) {
|
|
16
|
+
const versionSuffix = version !== undefined ? ` (version ${version})` : "";
|
|
17
|
+
super(`Document model module already registered for type: ${documentType}${versionSuffix}`);
|
|
16
18
|
this.name = "DuplicateModuleError";
|
|
17
19
|
}
|
|
18
20
|
}
|
|
@@ -25,72 +27,190 @@ export class InvalidModuleError extends Error {
|
|
|
25
27
|
this.name = "InvalidModuleError";
|
|
26
28
|
}
|
|
27
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Error thrown when attempting to register an upgrade manifest that already exists.
|
|
32
|
+
*/
|
|
33
|
+
export class DuplicateManifestError extends Error {
|
|
34
|
+
constructor(documentType) {
|
|
35
|
+
super(`Upgrade manifest already registered for type: ${documentType}`);
|
|
36
|
+
this.name = "DuplicateManifestError";
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Error thrown when an upgrade manifest is not found.
|
|
41
|
+
*/
|
|
42
|
+
export class ManifestNotFoundError extends Error {
|
|
43
|
+
constructor(documentType) {
|
|
44
|
+
super(`Upgrade manifest not found for type: ${documentType}`);
|
|
45
|
+
this.name = "ManifestNotFoundError";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Error thrown when attempting a downgrade operation.
|
|
50
|
+
*/
|
|
51
|
+
export class DowngradeNotSupportedError extends Error {
|
|
52
|
+
constructor(documentType, fromVersion, toVersion) {
|
|
53
|
+
super(`Downgrade not supported for ${documentType}: cannot go from version ${fromVersion} to ${toVersion}`);
|
|
54
|
+
this.name = "DowngradeNotSupportedError";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Error thrown when a required upgrade transition is missing from the manifest.
|
|
59
|
+
*/
|
|
60
|
+
export class MissingUpgradeTransitionError extends Error {
|
|
61
|
+
constructor(documentType, fromVersion, toVersion) {
|
|
62
|
+
super(`Missing upgrade transition for ${documentType}: v${fromVersion} to v${toVersion}`);
|
|
63
|
+
this.name = "MissingUpgradeTransitionError";
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Error thrown when getUpgradeReducer is called with a non-single-step version increment.
|
|
68
|
+
*/
|
|
69
|
+
export class InvalidUpgradeStepError extends Error {
|
|
70
|
+
constructor(documentType, fromVersion, toVersion) {
|
|
71
|
+
super(`Invalid upgrade step for ${documentType}: must be single version increment, got v${fromVersion} to v${toVersion}`);
|
|
72
|
+
this.name = "InvalidUpgradeStepError";
|
|
73
|
+
}
|
|
74
|
+
}
|
|
28
75
|
/**
|
|
29
76
|
* In-memory implementation of the IDocumentModelRegistry interface.
|
|
30
|
-
* Manages document model modules
|
|
77
|
+
* Manages document model modules with version-aware storage and upgrade manifest support.
|
|
31
78
|
*/
|
|
32
79
|
export class DocumentModelRegistry {
|
|
33
|
-
modules =
|
|
34
|
-
|
|
35
|
-
* Register multiple modules at once.
|
|
36
|
-
*
|
|
37
|
-
* @param modules Document model modules to register
|
|
38
|
-
* @throws DuplicateModuleError if a module with the same document type is already registered
|
|
39
|
-
* @throws InvalidModuleError if a module is malformed
|
|
40
|
-
*/
|
|
80
|
+
modules = [];
|
|
81
|
+
manifests = [];
|
|
41
82
|
registerModules(...modules) {
|
|
42
83
|
for (const module of modules) {
|
|
43
84
|
const documentType = module.documentModel.global.id;
|
|
44
|
-
|
|
45
|
-
|
|
85
|
+
const version = module.version ?? 1;
|
|
86
|
+
for (let i = 0; i < this.modules.length; i++) {
|
|
87
|
+
const existing = this.modules[i];
|
|
88
|
+
const existingType = existing.documentModel.global.id;
|
|
89
|
+
const existingVersion = existing.version ?? 1;
|
|
90
|
+
if (existingType === documentType && existingVersion === version) {
|
|
91
|
+
throw new DuplicateModuleError(documentType, version);
|
|
92
|
+
}
|
|
46
93
|
}
|
|
47
|
-
this.modules.
|
|
94
|
+
this.modules.push(module);
|
|
48
95
|
}
|
|
49
96
|
}
|
|
50
|
-
/**
|
|
51
|
-
* Unregister multiple document model modules at once.
|
|
52
|
-
*
|
|
53
|
-
* @param documentTypes The document types to unregister
|
|
54
|
-
* @returns true if all modules were unregistered, false if any were not found
|
|
55
|
-
*/
|
|
56
97
|
unregisterModules(...documentTypes) {
|
|
57
98
|
let allFound = true;
|
|
58
99
|
for (const documentType of documentTypes) {
|
|
59
|
-
const
|
|
60
|
-
if (!
|
|
100
|
+
const hasModule = this.modules.some((m) => m.documentModel.global.id === documentType);
|
|
101
|
+
if (!hasModule) {
|
|
61
102
|
allFound = false;
|
|
62
103
|
}
|
|
104
|
+
this.modules = this.modules.filter((m) => m.documentModel.global.id !== documentType);
|
|
63
105
|
}
|
|
64
106
|
return allFound;
|
|
65
107
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
108
|
+
getModule(documentType, version) {
|
|
109
|
+
let latestModule;
|
|
110
|
+
let latestVersion = -1;
|
|
111
|
+
for (let i = 0; i < this.modules.length; i++) {
|
|
112
|
+
const module = this.modules[i];
|
|
113
|
+
const moduleType = module.documentModel.global.id;
|
|
114
|
+
const moduleVersion = module.version ?? 1;
|
|
115
|
+
if (moduleType === documentType) {
|
|
116
|
+
if (version !== undefined && moduleVersion === version) {
|
|
117
|
+
return module;
|
|
118
|
+
}
|
|
119
|
+
if (moduleVersion > latestVersion) {
|
|
120
|
+
latestModule = module;
|
|
121
|
+
latestVersion = moduleVersion;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
77
124
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
*
|
|
84
|
-
* @returns Array of all registered modules
|
|
85
|
-
*/
|
|
125
|
+
if (version === undefined && latestModule !== undefined) {
|
|
126
|
+
return latestModule;
|
|
127
|
+
}
|
|
128
|
+
throw new ModuleNotFoundError(documentType, version);
|
|
129
|
+
}
|
|
86
130
|
getAllModules() {
|
|
87
|
-
return
|
|
131
|
+
return [...this.modules];
|
|
88
132
|
}
|
|
89
|
-
/**
|
|
90
|
-
* Clear all registered modules
|
|
91
|
-
*/
|
|
92
133
|
clear() {
|
|
93
|
-
this.modules
|
|
134
|
+
this.modules = [];
|
|
135
|
+
this.manifests = [];
|
|
136
|
+
}
|
|
137
|
+
getSupportedVersions(documentType) {
|
|
138
|
+
const versions = [];
|
|
139
|
+
for (const module of this.modules) {
|
|
140
|
+
if (module.documentModel.global.id === documentType) {
|
|
141
|
+
versions.push(module.version ?? 1);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (versions.length === 0) {
|
|
145
|
+
throw new ModuleNotFoundError(documentType);
|
|
146
|
+
}
|
|
147
|
+
return versions.sort((a, b) => a - b);
|
|
148
|
+
}
|
|
149
|
+
getLatestVersion(documentType) {
|
|
150
|
+
let latest = -1;
|
|
151
|
+
let found = false;
|
|
152
|
+
for (const module of this.modules) {
|
|
153
|
+
if (module.documentModel.global.id === documentType) {
|
|
154
|
+
found = true;
|
|
155
|
+
const version = module.version ?? 1;
|
|
156
|
+
if (version > latest) {
|
|
157
|
+
latest = version;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (!found) {
|
|
162
|
+
throw new ModuleNotFoundError(documentType);
|
|
163
|
+
}
|
|
164
|
+
return latest;
|
|
165
|
+
}
|
|
166
|
+
registerUpgradeManifests(...manifests) {
|
|
167
|
+
for (const manifest of manifests) {
|
|
168
|
+
for (let i = 0; i < this.manifests.length; i++) {
|
|
169
|
+
if (this.manifests[i].documentType === manifest.documentType) {
|
|
170
|
+
throw new DuplicateManifestError(manifest.documentType);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
this.manifests.push(manifest);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
getUpgradeManifest(documentType) {
|
|
177
|
+
for (let i = 0; i < this.manifests.length; i++) {
|
|
178
|
+
if (this.manifests[i].documentType === documentType) {
|
|
179
|
+
return this.manifests[i];
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
throw new ManifestNotFoundError(documentType);
|
|
183
|
+
}
|
|
184
|
+
computeUpgradePath(documentType, fromVersion, toVersion) {
|
|
185
|
+
if (fromVersion === toVersion) {
|
|
186
|
+
return [];
|
|
187
|
+
}
|
|
188
|
+
if (toVersion < fromVersion) {
|
|
189
|
+
throw new DowngradeNotSupportedError(documentType, fromVersion, toVersion);
|
|
190
|
+
}
|
|
191
|
+
const manifest = this.getUpgradeManifest(documentType);
|
|
192
|
+
const path = [];
|
|
193
|
+
for (let v = fromVersion + 1; v <= toVersion; v++) {
|
|
194
|
+
const key = `v${v}`;
|
|
195
|
+
if (!(key in manifest.upgrades)) {
|
|
196
|
+
throw new MissingUpgradeTransitionError(documentType, v - 1, v);
|
|
197
|
+
}
|
|
198
|
+
const transition = manifest.upgrades[key];
|
|
199
|
+
path.push(transition);
|
|
200
|
+
}
|
|
201
|
+
return path;
|
|
202
|
+
}
|
|
203
|
+
getUpgradeReducer(documentType, fromVersion, toVersion) {
|
|
204
|
+
if (toVersion !== fromVersion + 1) {
|
|
205
|
+
throw new InvalidUpgradeStepError(documentType, fromVersion, toVersion);
|
|
206
|
+
}
|
|
207
|
+
const manifest = this.getUpgradeManifest(documentType);
|
|
208
|
+
const key = `v${toVersion}`;
|
|
209
|
+
if (!(key in manifest.upgrades)) {
|
|
210
|
+
throw new MissingUpgradeTransitionError(documentType, fromVersion, toVersion);
|
|
211
|
+
}
|
|
212
|
+
const transition = manifest.upgrades[key];
|
|
213
|
+
return transition.upgradeReducer;
|
|
94
214
|
}
|
|
95
215
|
}
|
|
96
216
|
//# sourceMappingURL=implementation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../../src/registry/implementation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../../src/registry/implementation.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,YAAoB,EAAE,OAAgB;QAChD,MAAM,aAAa,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzE,KAAK,CACH,6CAA6C,YAAY,GAAG,aAAa,EAAE,CAC5E,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,YAAoB,EAAE,OAAgB;QAChD,MAAM,aAAa,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,aAAa,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3E,KAAK,CACH,sDAAsD,YAAY,GAAG,aAAa,EAAE,CACrF,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,OAAe;QACzB,KAAK,CAAC,kCAAkC,OAAO,EAAE,CAAC,CAAC;QACnD,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C,YAAY,YAAoB;QAC9B,KAAK,CAAC,iDAAiD,YAAY,EAAE,CAAC,CAAC;QACvE,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC9C,YAA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,YAAoB,EACpB,WAAmB,EACnB,SAAiB;QAEjB,IAAI,SAAS,KAAK,WAAW,GAAG,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,uBAAuB,CAAC,YAAY,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;QAC1E,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;QAEvD,MAAM,GAAG,GAAG,IAAI,SAAS,EAAE,CAAC;QAE5B,IAAI,CAAC,CAAC,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,6BAA6B,CACrC,YAAY,EACZ,WAAW,EACX,SAAS,CACV,CAAC;QACJ,CAAC;QAED,MAAM,UAAU,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAqC,CAAC,CAAC;QAC5E,OAAO,UAAU,CAAC,cAAc,CAAC;IACnC,CAAC;CACF"}
|
|
@@ -1,39 +1,100 @@
|
|
|
1
|
-
import type { DocumentModelModule } from "document-model";
|
|
1
|
+
import type { DocumentModelModule, UpgradeManifest, UpgradeReducer, UpgradeTransition } from "document-model";
|
|
2
2
|
/**
|
|
3
3
|
* Registry for managing document model modules.
|
|
4
4
|
* Provides centralized access to document models' reducers, utils, and specifications.
|
|
5
|
+
* Supports version-aware module storage and upgrade manifest management.
|
|
5
6
|
*/
|
|
6
7
|
export interface IDocumentModelRegistry {
|
|
7
8
|
/**
|
|
8
9
|
* Register multiple modules at once.
|
|
10
|
+
* Modules without a version field default to version 1.
|
|
9
11
|
*
|
|
10
12
|
* @param modules Document model modules to register
|
|
11
|
-
* @throws
|
|
13
|
+
* @throws DuplicateModuleError if a module with the same document type and version is already registered
|
|
12
14
|
*/
|
|
13
15
|
registerModules(...modules: DocumentModelModule<any>[]): void;
|
|
14
16
|
/**
|
|
15
|
-
* Unregister
|
|
17
|
+
* Unregister all versions of the specified document types.
|
|
16
18
|
*
|
|
17
19
|
* @param documentTypes The document types to unregister
|
|
18
20
|
* @returns true if all modules were unregistered, false if any were not found
|
|
19
21
|
*/
|
|
20
22
|
unregisterModules(...documentTypes: string[]): boolean;
|
|
21
23
|
/**
|
|
22
|
-
* Get a specific document model module by document type.
|
|
24
|
+
* Get a specific document model module by document type and optional version.
|
|
25
|
+
* If version is not specified, returns the latest version.
|
|
23
26
|
*
|
|
24
27
|
* @param documentType The document type identifier
|
|
28
|
+
* @param version Optional version number to retrieve
|
|
25
29
|
* @returns The document model module
|
|
26
|
-
* @throws
|
|
30
|
+
* @throws ModuleNotFoundError if the document type or version is not registered
|
|
27
31
|
*/
|
|
28
|
-
getModule(documentType: string): DocumentModelModule<any>;
|
|
32
|
+
getModule(documentType: string, version?: number): DocumentModelModule<any>;
|
|
29
33
|
/**
|
|
30
|
-
* Get all registered document model modules
|
|
34
|
+
* Get all registered document model modules.
|
|
35
|
+
*
|
|
31
36
|
* @returns Array of all registered modules
|
|
32
37
|
*/
|
|
33
38
|
getAllModules(): DocumentModelModule<any>[];
|
|
34
39
|
/**
|
|
35
|
-
* Clear all registered modules
|
|
40
|
+
* Clear all registered modules and upgrade manifests.
|
|
36
41
|
*/
|
|
37
42
|
clear(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Get all supported versions for a document type, sorted in ascending order.
|
|
45
|
+
*
|
|
46
|
+
* @param documentType The document type identifier
|
|
47
|
+
* @returns Array of version numbers sorted ascending
|
|
48
|
+
* @throws ModuleNotFoundError if no modules are registered for the document type
|
|
49
|
+
*/
|
|
50
|
+
getSupportedVersions(documentType: string): number[];
|
|
51
|
+
/**
|
|
52
|
+
* Get the latest (highest) version number for a document type.
|
|
53
|
+
*
|
|
54
|
+
* @param documentType The document type identifier
|
|
55
|
+
* @returns The highest version number registered for this document type
|
|
56
|
+
* @throws ModuleNotFoundError if no modules are registered for the document type
|
|
57
|
+
*/
|
|
58
|
+
getLatestVersion(documentType: string): number;
|
|
59
|
+
/**
|
|
60
|
+
* Register upgrade manifests that define upgrade paths between versions.
|
|
61
|
+
*
|
|
62
|
+
* @param manifests Upgrade manifests to register
|
|
63
|
+
* @throws DuplicateManifestError if a manifest for the same document type is already registered
|
|
64
|
+
*/
|
|
65
|
+
registerUpgradeManifests(...manifests: UpgradeManifest<readonly number[]>[]): void;
|
|
66
|
+
/**
|
|
67
|
+
* Get the upgrade manifest for a document type.
|
|
68
|
+
*
|
|
69
|
+
* @param documentType The document type identifier
|
|
70
|
+
* @returns The upgrade manifest
|
|
71
|
+
* @throws ManifestNotFoundError if no manifest is registered for the document type
|
|
72
|
+
*/
|
|
73
|
+
getUpgradeManifest(documentType: string): UpgradeManifest<readonly number[]>;
|
|
74
|
+
/**
|
|
75
|
+
* Compute the upgrade path from one version to another.
|
|
76
|
+
* Returns the sequence of upgrade transitions needed.
|
|
77
|
+
*
|
|
78
|
+
* @param documentType The document type identifier
|
|
79
|
+
* @param fromVersion The starting version
|
|
80
|
+
* @param toVersion The target version
|
|
81
|
+
* @returns Array of upgrade transitions in order
|
|
82
|
+
* @throws DowngradeNotSupportedError if toVersion is less than fromVersion
|
|
83
|
+
* @throws ManifestNotFoundError if no upgrade manifest is registered
|
|
84
|
+
* @throws MissingUpgradeTransitionError if any transition in the path is missing
|
|
85
|
+
*/
|
|
86
|
+
computeUpgradePath(documentType: string, fromVersion: number, toVersion: number): UpgradeTransition[];
|
|
87
|
+
/**
|
|
88
|
+
* Get the upgrade reducer for a single-step version transition.
|
|
89
|
+
*
|
|
90
|
+
* @param documentType The document type identifier
|
|
91
|
+
* @param fromVersion The starting version
|
|
92
|
+
* @param toVersion The target version (must be fromVersion + 1)
|
|
93
|
+
* @returns The upgrade reducer function
|
|
94
|
+
* @throws InvalidUpgradeStepError if toVersion is not fromVersion + 1
|
|
95
|
+
* @throws ManifestNotFoundError if no upgrade manifest is registered
|
|
96
|
+
* @throws MissingUpgradeTransitionError if the transition is not found
|
|
97
|
+
*/
|
|
98
|
+
getUpgradeReducer(documentType: string, fromVersion: number, toVersion: number): UpgradeReducer<any, any>;
|
|
38
99
|
}
|
|
39
100
|
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/registry/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/registry/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AAExB;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;;OAMG;IACH,eAAe,CAAC,GAAG,OAAO,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC;IAE9D;;;;;OAKG;IACH,iBAAiB,CAAC,GAAG,aAAa,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAEvD;;;;;;;;OAQG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;IAE5E;;;;OAIG;IACH,aAAa,IAAI,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC;IAE5C;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;IAEd;;;;;;OAMG;IACH,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAErD;;;;;;OAMG;IACH,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAE/C;;;;;OAKG;IACH,wBAAwB,CACtB,GAAG,SAAS,EAAE,eAAe,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,GACjD,IAAI,CAAC;IAER;;;;;;OAMG;IACH,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,eAAe,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;IAE7E;;;;;;;;;;;OAWG;IACH,kBAAkB,CAChB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,iBAAiB,EAAE,CAAC;IAEvB;;;;;;;;;;OAUG;IACH,iBAAiB,CACf,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;CAC7B"}
|
|
@@ -22,4 +22,20 @@ export declare class InvalidSignatureError extends Error {
|
|
|
22
22
|
readonly reason: string;
|
|
23
23
|
constructor(documentId: string, reason: string);
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Error thrown when attempting to downgrade a document version.
|
|
27
|
+
*/
|
|
28
|
+
export declare class DowngradeNotSupportedError extends Error {
|
|
29
|
+
readonly documentType: string;
|
|
30
|
+
readonly fromVersion: number;
|
|
31
|
+
readonly toVersion: number;
|
|
32
|
+
constructor(documentType: string, fromVersion: number, toVersion: number);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Error thrown when an upgrade manifest is required but not registered.
|
|
36
|
+
*/
|
|
37
|
+
export declare class UpgradeManifestNotFoundError extends Error {
|
|
38
|
+
readonly documentType: string;
|
|
39
|
+
constructor(documentType: string);
|
|
40
|
+
}
|
|
25
41
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/shared/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;gBAEnC,UAAU,EAAE,MAAM,EAAE,eAAe,GAAE,MAAM,GAAG,IAAW;CAYtE;AAED;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;IACpD,SAAgB,UAAU,EAAE,MAAM,CAAC;IACn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CAAC;gBAEzB,YAAY,EAAE,MAAM;CAOjC"}
|
|
@@ -44,4 +44,32 @@ export class InvalidSignatureError extends Error {
|
|
|
44
44
|
Error.captureStackTrace(this, InvalidSignatureError);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Error thrown when attempting to downgrade a document version.
|
|
49
|
+
*/
|
|
50
|
+
export class DowngradeNotSupportedError extends Error {
|
|
51
|
+
documentType;
|
|
52
|
+
fromVersion;
|
|
53
|
+
toVersion;
|
|
54
|
+
constructor(documentType, fromVersion, toVersion) {
|
|
55
|
+
super(`Downgrade not supported for ${documentType}: cannot upgrade from version ${fromVersion} to ${toVersion}`);
|
|
56
|
+
this.name = "DowngradeNotSupportedError";
|
|
57
|
+
this.documentType = documentType;
|
|
58
|
+
this.fromVersion = fromVersion;
|
|
59
|
+
this.toVersion = toVersion;
|
|
60
|
+
Error.captureStackTrace(this, DowngradeNotSupportedError);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Error thrown when an upgrade manifest is required but not registered.
|
|
65
|
+
*/
|
|
66
|
+
export class UpgradeManifestNotFoundError extends Error {
|
|
67
|
+
documentType;
|
|
68
|
+
constructor(documentType) {
|
|
69
|
+
super(`No upgrade manifest registered for document type: ${documentType}`);
|
|
70
|
+
this.name = "UpgradeManifestNotFoundError";
|
|
71
|
+
this.documentType = documentType;
|
|
72
|
+
Error.captureStackTrace(this, UpgradeManifestNotFoundError);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
47
75
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/shared/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7B,UAAU,CAAS;IACnB,eAAe,CAAgB;IAE/C,YAAY,UAAkB,EAAE,kBAAiC,IAAI;QACnE,MAAM,OAAO,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AAG,UAAU,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;IACvD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IACnC,YAAY,CAAS;IACrB,WAAW,CAAS;IACpB,SAAS,CAAS;IAElC,YAAY,YAAoB,EAAE,WAAmB,EAAE,SAAiB;QACtE,KAAK,CACH,+BAA+B,YAAY,iCAAiC,WAAW,OAAO,SAAS,EAAE,CAC1G,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;QACzC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAE3B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,0BAA0B,CAAC,CAAC;IAC5D,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,4BAA6B,SAAQ,KAAK;IACrC,YAAY,CAAS;IAErC,YAAY,YAAoB;QAC9B,KAAK,CAAC,qDAAqD,YAAY,EAAE,CAAC,CAAC;QAC3E,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;QAC3C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QAEjC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,4BAA4B,CAAC,CAAC;IAC9D,CAAC;CACF"}
|
|
@@ -54,6 +54,10 @@ export type JobInfo = {
|
|
|
54
54
|
* A token for coordinating reads, only valid once a job reaches COMPLETED.
|
|
55
55
|
*/
|
|
56
56
|
consistencyToken: ConsistencyToken;
|
|
57
|
+
/**
|
|
58
|
+
* Optional metadata that flows through the job lifecycle.
|
|
59
|
+
*/
|
|
60
|
+
meta?: Record<string, unknown>;
|
|
57
61
|
};
|
|
58
62
|
/**
|
|
59
63
|
* Job execution statuses
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/shared/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,kBAAkB,yCAAyC,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;;;;;;;OAQG;IACH,IAAI,UAAU,IAAI,OAAO,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,oBAAY,eAAe;IACzB,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,sBAAsB;IAChC,KAAK,UAAU;IACf,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,GAAG,CAAC;IAEb;;OAEG;IACH,gBAAgB,EAAE,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/shared/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,kBAAkB,yCAAyC,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;;;;;;;OAQG;IACH,IAAI,UAAU,IAAI,OAAO,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,oBAAY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AAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;IAC5B,OAAO,EAAE,CAAC,EAAE,CAAC;IACb,OAAO,EAAE,aAAa,CAAC;IAEvB,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,CAAC,CAAC;IACX,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,qBAAqB,EAAE,CAAC;CACtC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/shared/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,sCAAsC,CAAC;AA0BzE;;GAEG;AACH,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,sCAAmB,CAAA;AACrB,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,yCAAe,CAAA;IACf,6CAAmB,CAAA;AACrB,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,QAGjC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/shared/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,sCAAsC,CAAC;AA0BzE;;GAEG;AACH,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,sCAAmB,CAAA;AACrB,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,yCAAe,CAAA;IACf,6CAAmB,CAAA;AACrB,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,QAGjC;AAyBD;;GAEG;AACH,MAAM,CAAN,IAAY,SAWX;AAXD,WAAY,SAAS;IACnB,wCAAwC;IACxC,gCAAmB,CAAA;IACnB,sCAAsC;IACtC,gCAAmB,CAAA;IACnB,oFAAoF;IACpF,gDAAmC,CAAA;IACnC,6EAA6E;IAC7E,oDAAuC,CAAA;IACvC,kCAAkC;IAClC,8BAAiB,CAAA;AACnB,CAAC,EAXW,SAAS,KAAT,SAAS,QAWpB"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import type { Signature } from "document-model";
|
|
2
|
-
|
|
1
|
+
import type { ISigner, Signature } from "document-model";
|
|
2
|
+
/**
|
|
3
|
+
* A no-op signer that returns empty values for all methods.
|
|
4
|
+
* Used when signing is not required.
|
|
5
|
+
*/
|
|
3
6
|
export declare class PassthroughSigner implements ISigner {
|
|
4
|
-
|
|
7
|
+
publicKey(): Promise<JsonWebKey>;
|
|
8
|
+
sign(): Promise<Uint8Array>;
|
|
9
|
+
verify(): Promise<void>;
|
|
10
|
+
signAction(): Promise<Signature>;
|
|
5
11
|
}
|
|
6
12
|
//# sourceMappingURL=passthrough-signer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passthrough-signer.d.ts","sourceRoot":"","sources":["../../../src/signer/passthrough-signer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"passthrough-signer.d.ts","sourceRoot":"","sources":["../../../src/signer/passthrough-signer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEzD;;;GAGG;AACH,qBAAa,iBAAkB,YAAW,OAAO;IAC/C,SAAS,IAAI,OAAO,CAAC,UAAU,CAAC;IAIhC,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;IAI3B,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvB,UAAU,IAAI,OAAO,CAAC,SAAS,CAAC;CAGjC"}
|