@vcp-dev/site-edit-engine 0.6.0 → 0.6.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/index.d.ts +0 -2
- package/dist/index.js +7 -7
- package/dist/preview-runtime.d.ts +3 -3
- package/dist/types.d.ts +3 -6
- package/package.json +2 -2
- package/dist/mutation-context-verifier.d.ts +0 -30
|
@@ -218,8 +218,8 @@ export declare class PreviewFileSystemSiteEditEngineRuntime implements PreviewSi
|
|
|
218
218
|
};
|
|
219
219
|
};
|
|
220
220
|
refreshSourceForKey(key: string, routeId?: string): Promise<void>;
|
|
221
|
-
executeOperation(request: Parameters<PreviewSiteEditEngineRuntime["executeOperation"]>[0], mutationContext
|
|
222
|
-
undo(
|
|
221
|
+
executeOperation(request: Parameters<PreviewSiteEditEngineRuntime["executeOperation"]>[0], mutationContext?: SiteEditMutationContext): Promise<SiteEditOperationCommandResult>;
|
|
222
|
+
undo(_mutationContext?: SiteEditMutationContext): Promise<{
|
|
223
223
|
ok: false;
|
|
224
224
|
error: {
|
|
225
225
|
code: "VERSION_STALE" | "RECOVERY_REQUIRED" | "NODE_NOT_FOUND" | "ROUTE_NOT_FOUND" | "CAPABILITY_REJECTED" | "CONSTRAINT_VIOLATED" | "INVALID_PARAMS" | "PLAN_FAILED" | "TRANSACTION_PREFLIGHT_FAILED" | "ROUTE_REBUILD_FAILED" | "HISTORY_COMMIT_FAILED" | "MATERIALIZATION_CONFLICT" | "MATERIALIZATION_REJECTED" | "MUTATION_ASSERTION_REQUIRED" | "MUTATION_ASSERTION_INVALID" | "AST_PARSE_ERROR" | "UNSUPPORTED_OPERATION" | "LOCATOR_FAILED" | "INVALID_TARGET" | "WRITE_IO_ERROR" | "CONCURRENT_MODIFIED" | "ROLLBACK_FAILED" | "RECOVERY_PERSIST_FAILED" | "MUTATION_SESSION_REQUIRED" | "LEASE_ASSERTION_INVALID" | "LEASE_ASSERTION_EXPIRED" | "LEASE_ASSERTION_SCOPE_MISMATCH" | "CROSS_PAGE_MOVE_UNSUPPORTED" | "INTERNAL_ERROR";
|
|
@@ -279,7 +279,7 @@ export declare class PreviewFileSystemSiteEditEngineRuntime implements PreviewSi
|
|
|
279
279
|
};
|
|
280
280
|
error?: undefined;
|
|
281
281
|
}>;
|
|
282
|
-
redo(
|
|
282
|
+
redo(_mutationContext?: SiteEditMutationContext): Promise<{
|
|
283
283
|
ok: false;
|
|
284
284
|
error: {
|
|
285
285
|
code: "VERSION_STALE" | "RECOVERY_REQUIRED" | "NODE_NOT_FOUND" | "ROUTE_NOT_FOUND" | "CAPABILITY_REJECTED" | "CONSTRAINT_VIOLATED" | "INVALID_PARAMS" | "PLAN_FAILED" | "TRANSACTION_PREFLIGHT_FAILED" | "ROUTE_REBUILD_FAILED" | "HISTORY_COMMIT_FAILED" | "MATERIALIZATION_CONFLICT" | "MATERIALIZATION_REJECTED" | "MUTATION_ASSERTION_REQUIRED" | "MUTATION_ASSERTION_INVALID" | "AST_PARSE_ERROR" | "UNSUPPORTED_OPERATION" | "LOCATOR_FAILED" | "INVALID_TARGET" | "WRITE_IO_ERROR" | "CONCURRENT_MODIFIED" | "ROLLBACK_FAILED" | "RECOVERY_PERSIST_FAILED" | "MUTATION_SESSION_REQUIRED" | "LEASE_ASSERTION_INVALID" | "LEASE_ASSERTION_EXPIRED" | "LEASE_ASSERTION_SCOPE_MISMATCH" | "CROSS_PAGE_MOVE_UNSUPPORTED" | "INTERNAL_ERROR";
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { SiteEditCommandSuccess, SiteEditEvent, SiteEditGetClassNameSourceCommandResult, SiteEditGetClassNameSourceResult, SiteEditClassNameSourceStyleContext, SiteEditObjectEditContext, SiteEditOperationCommandResult, SiteEditMutationContext, SiteEditOperationRequest, SiteEditPatchPlan, SiteEditRenderDocument, SiteEditResolveSourceLocationInput, SiteEditSourceFileResponse, SiteEditSourceLocation, SiteEditSourceTreeResponse } from "@vcp-dev/contracts";
|
|
2
2
|
import type { SiteEditProjectFileSystem } from "./public-file-system.js";
|
|
3
3
|
import type { FileHistoryStore } from "./history/file-history-store.js";
|
|
4
|
-
import type { SiteEditMutationContextVerifier } from "./mutation-context-verifier.js";
|
|
5
4
|
export type { SiteEditProjectFileSystem } from "./public-file-system.js";
|
|
6
5
|
export interface SiteEditSnapshotFile {
|
|
7
6
|
path: string;
|
|
@@ -21,7 +20,6 @@ export interface SiteEditEngineRuntimeOptions {
|
|
|
21
20
|
onEvent?: (event: SiteEditEvent) => void;
|
|
22
21
|
dev?: boolean;
|
|
23
22
|
historyStore?: FileHistoryStore;
|
|
24
|
-
mutationContextVerifier?: SiteEditMutationContextVerifier;
|
|
25
23
|
}
|
|
26
24
|
export interface SiteEditPlanOperationResult {
|
|
27
25
|
result: SiteEditOperationCommandResult;
|
|
@@ -59,7 +57,6 @@ export interface PreviewSiteEditEngineRuntimeOptions {
|
|
|
59
57
|
dev?: boolean;
|
|
60
58
|
fileSystem?: SiteEditProjectFileSystem;
|
|
61
59
|
historyStore?: FileHistoryStore;
|
|
62
|
-
mutationContextVerifier?: SiteEditMutationContextVerifier;
|
|
63
60
|
/** Preserves monotonic document versions when a Bridge swaps runtimes. */
|
|
64
61
|
initialDocumentVersion?: number;
|
|
65
62
|
}
|
|
@@ -79,9 +76,9 @@ export interface PreviewSiteEditEngineRuntime {
|
|
|
79
76
|
}): Promise<SiteEditCommandSuccess<SiteEditSourceFileResponse>>;
|
|
80
77
|
resolveSourceLocation(input: SiteEditResolveSourceLocationInput): SiteEditCommandSuccess<SiteEditSourceLocation>;
|
|
81
78
|
refreshSourceForKey(key: string, routeId?: string): Promise<void>;
|
|
82
|
-
executeOperation(request: SiteEditOperationRequest, mutationContext
|
|
83
|
-
undo(mutationContext
|
|
84
|
-
redo(mutationContext
|
|
79
|
+
executeOperation(request: SiteEditOperationRequest, mutationContext?: SiteEditMutationContext): Promise<SiteEditOperationCommandResult>;
|
|
80
|
+
undo(mutationContext?: SiteEditMutationContext): Promise<SiteEditOperationCommandResult>;
|
|
81
|
+
redo(mutationContext?: SiteEditMutationContext): Promise<SiteEditOperationCommandResult>;
|
|
85
82
|
notifyFileChanged(file: string): void;
|
|
86
83
|
subscribe(listener: (event: SiteEditEvent) => void): () => void;
|
|
87
84
|
dispose(): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vcp-dev/site-edit-engine",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@babel/parser": "^7.29.3",
|
|
61
61
|
"@babel/traverse": "^7.29.0",
|
|
62
62
|
"@babel/types": "^7.29.0",
|
|
63
|
-
"@vcp-dev/contracts": "0.6.
|
|
63
|
+
"@vcp-dev/contracts": "0.6.1",
|
|
64
64
|
"yaml": "^2.9.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { type KeyObject } from "node:crypto";
|
|
2
|
-
import type { SiteEditMutationContext, SiteEditOperationErrorCode } from "@vcp-dev/contracts";
|
|
3
|
-
export type SiteEditMutationVerificationFailureCode = Extract<SiteEditOperationErrorCode, "MUTATION_SESSION_REQUIRED" | "LEASE_ASSERTION_INVALID" | "LEASE_ASSERTION_EXPIRED" | "LEASE_ASSERTION_SCOPE_MISMATCH">;
|
|
4
|
-
export type SiteEditMutationVerificationResult = {
|
|
5
|
-
ok: true;
|
|
6
|
-
} | {
|
|
7
|
-
ok: false;
|
|
8
|
-
code: SiteEditMutationVerificationFailureCode;
|
|
9
|
-
message: string;
|
|
10
|
-
};
|
|
11
|
-
export interface SiteEditMutationAssertionExpected {
|
|
12
|
-
tenantId: string;
|
|
13
|
-
siteId: string;
|
|
14
|
-
snapshotId: string;
|
|
15
|
-
editingSessionId: string;
|
|
16
|
-
lockId: string;
|
|
17
|
-
ownerId: string;
|
|
18
|
-
}
|
|
19
|
-
export interface SiteEditMutationContextVerifier {
|
|
20
|
-
verify(context: SiteEditMutationContext, expected: SiteEditMutationAssertionExpected): Promise<SiteEditMutationVerificationResult>;
|
|
21
|
-
}
|
|
22
|
-
export interface Ed25519MutationContextVerifierOptions {
|
|
23
|
-
publicKey: string | KeyObject;
|
|
24
|
-
issuer?: string;
|
|
25
|
-
audience?: string;
|
|
26
|
-
keyId: string;
|
|
27
|
-
now?: () => number;
|
|
28
|
-
clockSkewSeconds?: number;
|
|
29
|
-
}
|
|
30
|
-
export declare function createEd25519MutationContextVerifier(options: Ed25519MutationContextVerifierOptions): SiteEditMutationContextVerifier;
|