@openfairygui/backend 0.2.0-alpha.9 → 0.2.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/README.md +29 -8
- package/dist/index.cjs +1633 -27
- package/dist/index.d.cts +516 -4
- package/dist/index.d.mts +516 -4
- package/dist/index.mjs +1629 -23
- package/dist/node.cjs +1603 -9
- package/dist/node.d.cts +507 -2
- package/dist/node.d.mts +507 -2
- package/dist/node.mjs +1601 -6
- package/package.json +7 -6
- package/src/index.ts +18 -17
- package/src/node.ts +24 -8
- package/src/runtime/capabilities.ts +126 -0
- package/src/runtime/contracts.ts +518 -0
- package/src/runtime.ts +49 -623
- package/src/services/authoring-service.ts +242 -99
- package/src/services/cache-service.ts +1 -2
- package/src/services/context.ts +17 -8
- package/src/services/event-service.ts +1 -2
- package/src/services/job-service.ts +4 -5
- package/src/services/read-service.ts +1 -2
- package/src/services/runtime-service.ts +133 -27
- package/src/services/session-project-writer.ts +69 -0
- package/src/services/session-utils.ts +6 -3
- package/src/storage.ts +67 -27
- package/dist/runtime-DFatY9W0.mjs +0 -1417
- package/dist/runtime-GKzsXJdO.cjs +0 -1441
- package/dist/runtime-GyNVxAQ0.d.mts +0 -494
- package/dist/runtime-Jec6FcF5.d.cts +0 -494
- package/src/services/snapshot-utils.ts +0 -43
|
@@ -1,494 +0,0 @@
|
|
|
1
|
-
import { UamProject, UamTransactionOperation } from "@openfairygui/core/uam";
|
|
2
|
-
import { ApplyUamTransactionAppError } from "@openfairygui/functions/uam";
|
|
3
|
-
|
|
4
|
-
//#region src/contracts.d.ts
|
|
5
|
-
declare const BACKEND_CONTRACT_VERSION: "1.1.0-p2";
|
|
6
|
-
declare const BACKEND_CAPABILITY_SCHEMA_VERSION: 2;
|
|
7
|
-
declare const BACKEND_COMPATIBILITY_POLICY: {
|
|
8
|
-
readonly incompatibleChange: "requires contractVersion bump";
|
|
9
|
-
readonly capabilitySchemaChange: "requires capabilitySchemaVersion bump";
|
|
10
|
-
readonly additiveChange: "allowed without breaking existing consumers";
|
|
11
|
-
};
|
|
12
|
-
type BackendStage = 'read' | 'authoring' | 'runtime';
|
|
13
|
-
interface BackendMessage {
|
|
14
|
-
code: string;
|
|
15
|
-
message: string;
|
|
16
|
-
}
|
|
17
|
-
interface BackendDiagnostic {
|
|
18
|
-
code: string;
|
|
19
|
-
message: string;
|
|
20
|
-
severity: 'info' | 'warning' | 'error';
|
|
21
|
-
path?: string;
|
|
22
|
-
nodeKind?: string;
|
|
23
|
-
resourceKind?: string;
|
|
24
|
-
gearKind?: string;
|
|
25
|
-
field?: string;
|
|
26
|
-
operationKind?: string;
|
|
27
|
-
opIndex?: number;
|
|
28
|
-
opId?: string;
|
|
29
|
-
}
|
|
30
|
-
interface BackendResponseMeta {
|
|
31
|
-
requestId: string;
|
|
32
|
-
sessionId?: string;
|
|
33
|
-
revision?: number;
|
|
34
|
-
durationMs: number;
|
|
35
|
-
warnings: BackendMessage[];
|
|
36
|
-
diagnostics: BackendDiagnostic[];
|
|
37
|
-
stage: BackendStage;
|
|
38
|
-
contractVersion: typeof BACKEND_CONTRACT_VERSION;
|
|
39
|
-
capabilitySchemaVersion: typeof BACKEND_CAPABILITY_SCHEMA_VERSION;
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
|
-
//#region src/path-policy.d.ts
|
|
43
|
-
interface PathPolicyViolationError {
|
|
44
|
-
code: 'path_policy_violation';
|
|
45
|
-
message: string;
|
|
46
|
-
policy: 'save_target';
|
|
47
|
-
attemptedPath: string;
|
|
48
|
-
allowedPath: string;
|
|
49
|
-
}
|
|
50
|
-
//#endregion
|
|
51
|
-
//#region src/runtime.d.ts
|
|
52
|
-
interface BackendFileHandle {
|
|
53
|
-
writeFile(content: string): Promise<void>;
|
|
54
|
-
close(): Promise<void>;
|
|
55
|
-
}
|
|
56
|
-
interface BackendFileStat {
|
|
57
|
-
isFile(): boolean;
|
|
58
|
-
isDirectory(): boolean;
|
|
59
|
-
}
|
|
60
|
-
interface BackendFileSystem {
|
|
61
|
-
stat(filePath: string): Promise<BackendFileStat>;
|
|
62
|
-
readdir(dirPath: string): Promise<string[]>;
|
|
63
|
-
readFile(filePath: string): Promise<string>;
|
|
64
|
-
readFileRaw(filePath: string): Promise<Uint8Array>;
|
|
65
|
-
writeFile(filePath: string, content: string): Promise<void>;
|
|
66
|
-
writeFileRaw(filePath: string, data: Uint8Array): Promise<void>;
|
|
67
|
-
mkdir(dirPath: string, options?: {
|
|
68
|
-
recursive?: boolean;
|
|
69
|
-
}): Promise<void>;
|
|
70
|
-
resolvePath(filePath: string): Promise<string>;
|
|
71
|
-
openExclusive(filePath: string): Promise<BackendFileHandle>;
|
|
72
|
-
unlink(filePath: string): Promise<void>;
|
|
73
|
-
join(...paths: string[]): string;
|
|
74
|
-
dirname(filePath: string): string;
|
|
75
|
-
resolve(...paths: string[]): string;
|
|
76
|
-
}
|
|
77
|
-
interface BackendHostAdapter {
|
|
78
|
-
lockMetadata?(input: {
|
|
79
|
-
canonicalPathKey: string;
|
|
80
|
-
canonicalProjectPath: string;
|
|
81
|
-
lockFilePath: string;
|
|
82
|
-
}): unknown;
|
|
83
|
-
}
|
|
84
|
-
interface BackendArtifactBridgeCapability {
|
|
85
|
-
available: false;
|
|
86
|
-
requiredHost: 'node';
|
|
87
|
-
executionBoundary: 'external-bridge';
|
|
88
|
-
bridgeEntrypoint: '@openfairygui/backend/node';
|
|
89
|
-
reason: string;
|
|
90
|
-
}
|
|
91
|
-
interface BackendCapabilityManifest {
|
|
92
|
-
browserSafe: true;
|
|
93
|
-
rootEntrypoint: '@openfairygui/backend';
|
|
94
|
-
nodeEntrypoint: '@openfairygui/backend/node';
|
|
95
|
-
adapters: {
|
|
96
|
-
fileSystem: {
|
|
97
|
-
injected: true;
|
|
98
|
-
requiredFor: readonly ['openSession', 'saveSession', 'materializeSession'];
|
|
99
|
-
};
|
|
100
|
-
projectStorage: {
|
|
101
|
-
injected: true;
|
|
102
|
-
browserSafe: true;
|
|
103
|
-
requiredFor: readonly ['openProjectSession.writeback', 'saveSession', 'materializeSession'];
|
|
104
|
-
adapterFactory: 'createBackendStorageFileSystem';
|
|
105
|
-
};
|
|
106
|
-
host: {
|
|
107
|
-
injected: true;
|
|
108
|
-
requiredFor: readonly ['advisoryLockMetadata'];
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
executionBoundaries: {
|
|
112
|
-
projectSession: 'in-process-browser-safe';
|
|
113
|
-
fileBackedSession: 'adapter-backed';
|
|
114
|
-
artifactPublish: BackendArtifactBridgeCapability;
|
|
115
|
-
artifactRestore: BackendArtifactBridgeCapability;
|
|
116
|
-
};
|
|
117
|
-
diagnostics: {
|
|
118
|
-
stableCodes: true;
|
|
119
|
-
errorDiagnosticMirror: true;
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
interface BackendCapabilities {
|
|
123
|
-
contractVersion: typeof BACKEND_CONTRACT_VERSION;
|
|
124
|
-
capabilitySchemaVersion: typeof BACKEND_CAPABILITY_SCHEMA_VERSION;
|
|
125
|
-
transactionKernelOwner: '@openfairygui/core';
|
|
126
|
-
appSeamOwner: '@openfairygui/functions';
|
|
127
|
-
runtimeOwner: '@openfairygui/backend';
|
|
128
|
-
methods: readonly ['getCapabilities', 'openSession', 'openProjectSession', 'getSession', 'applyTransaction', 'saveSession', 'materializeSession', 'closeSession', 'getEvents', 'getJob', 'listJobs', 'cancelJob', 'getCacheSnapshot', 'refreshCache'];
|
|
129
|
-
read: {
|
|
130
|
-
capabilitySnapshot: true;
|
|
131
|
-
sessionSnapshot: true;
|
|
132
|
-
};
|
|
133
|
-
authoring: {
|
|
134
|
-
applyTransaction: true;
|
|
135
|
-
saveSession: true;
|
|
136
|
-
resourceKinds: readonly string[];
|
|
137
|
-
nodeKinds: readonly string[];
|
|
138
|
-
gearKinds: readonly string[];
|
|
139
|
-
transactionScope: {
|
|
140
|
-
resourceKinds: readonly string[];
|
|
141
|
-
nodeKinds: readonly string[];
|
|
142
|
-
gearKinds: readonly string[];
|
|
143
|
-
};
|
|
144
|
-
unsupported: readonly ['artifact.publish', 'artifact.restore'];
|
|
145
|
-
};
|
|
146
|
-
artifact: {
|
|
147
|
-
publish: false;
|
|
148
|
-
restore: false;
|
|
149
|
-
status: 'bridge-required';
|
|
150
|
-
publishBridge: BackendArtifactBridgeCapability;
|
|
151
|
-
restoreBridge: BackendArtifactBridgeCapability;
|
|
152
|
-
};
|
|
153
|
-
manifest: BackendCapabilityManifest;
|
|
154
|
-
compatibilityPolicy: typeof BACKEND_COMPATIBILITY_POLICY;
|
|
155
|
-
runtime: {
|
|
156
|
-
sessionRuntime: true;
|
|
157
|
-
advisoryLocking: true;
|
|
158
|
-
coordinatedSave: true;
|
|
159
|
-
atomicSave: false;
|
|
160
|
-
staleRevisionProtection: true;
|
|
161
|
-
pathPolicy: {
|
|
162
|
-
canonicalization: 'realpath+normalized-casefold';
|
|
163
|
-
sessionIdentity: 'project-root';
|
|
164
|
-
saveTarget: 'opened-project-only';
|
|
165
|
-
outputTargets: 'deferred';
|
|
166
|
-
workspaceBoundary: 'project-root-only';
|
|
167
|
-
};
|
|
168
|
-
events: {
|
|
169
|
-
polling: true;
|
|
170
|
-
subscriptions: false;
|
|
171
|
-
retentionLimit: 1000;
|
|
172
|
-
sequenceScope: 'runtime';
|
|
173
|
-
};
|
|
174
|
-
jobs: {
|
|
175
|
-
inMemory: true;
|
|
176
|
-
cooperativeCancel: true;
|
|
177
|
-
persistent: false;
|
|
178
|
-
supportedKinds: readonly ['cache.refresh'];
|
|
179
|
-
artifactJobs: false;
|
|
180
|
-
completedRetentionLimit: 100;
|
|
181
|
-
};
|
|
182
|
-
cache: {
|
|
183
|
-
derivedReadOnly: true;
|
|
184
|
-
keyedBy: 'canonicalPathKey';
|
|
185
|
-
sourceOfTruth: false;
|
|
186
|
-
refreshMethod: 'refreshCache';
|
|
187
|
-
};
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
interface BackendSessionSnapshot {
|
|
191
|
-
sessionId: string;
|
|
192
|
-
canonicalProjectPath: string;
|
|
193
|
-
revision: number;
|
|
194
|
-
lastSavedRevision: number;
|
|
195
|
-
dirty: boolean;
|
|
196
|
-
lockHeld: boolean;
|
|
197
|
-
capabilities: BackendCapabilities;
|
|
198
|
-
}
|
|
199
|
-
interface MaterializeSessionSnapshot extends BackendSessionSnapshot {
|
|
200
|
-
mode: 'fullProject';
|
|
201
|
-
reason?: string;
|
|
202
|
-
materializeRevision: number;
|
|
203
|
-
saveRevision: number;
|
|
204
|
-
writtenPaths: string[];
|
|
205
|
-
skippedPaths: string[];
|
|
206
|
-
diagnostics: BackendDiagnostic[];
|
|
207
|
-
}
|
|
208
|
-
interface BackendSuccess<T> {
|
|
209
|
-
ok: true;
|
|
210
|
-
meta: BackendResponseMeta;
|
|
211
|
-
data: T;
|
|
212
|
-
}
|
|
213
|
-
interface BackendFailure<E extends BackendError = BackendError> {
|
|
214
|
-
ok: false;
|
|
215
|
-
meta: BackendResponseMeta;
|
|
216
|
-
error: E;
|
|
217
|
-
session?: BackendSessionSnapshot;
|
|
218
|
-
}
|
|
219
|
-
type BackendResult<T, E extends BackendError = BackendError> = BackendSuccess<T> | BackendFailure<E>;
|
|
220
|
-
interface SessionNotFoundError {
|
|
221
|
-
code: 'session_not_found';
|
|
222
|
-
message: string;
|
|
223
|
-
sessionId: string;
|
|
224
|
-
}
|
|
225
|
-
interface SessionStaleWriteError {
|
|
226
|
-
code: 'stale_write';
|
|
227
|
-
message: string;
|
|
228
|
-
sessionId: string;
|
|
229
|
-
canonicalPathKey: string;
|
|
230
|
-
expectedRevision: number;
|
|
231
|
-
actualRevision: number;
|
|
232
|
-
}
|
|
233
|
-
interface InProcessLockConflictError {
|
|
234
|
-
code: 'lock_conflict';
|
|
235
|
-
kind: 'in_process_session_exists';
|
|
236
|
-
message: string;
|
|
237
|
-
canonicalPathKey: string;
|
|
238
|
-
holderSessionId: string;
|
|
239
|
-
lockFilePath?: string;
|
|
240
|
-
}
|
|
241
|
-
interface AdvisoryLockConflictError {
|
|
242
|
-
code: 'lock_conflict';
|
|
243
|
-
kind: 'advisory_lock_conflict';
|
|
244
|
-
message: string;
|
|
245
|
-
canonicalPathKey: string;
|
|
246
|
-
holderSessionId?: string;
|
|
247
|
-
lockFilePath: string;
|
|
248
|
-
}
|
|
249
|
-
interface SavePartialFailureError {
|
|
250
|
-
code: 'save_partial_failure';
|
|
251
|
-
message: string;
|
|
252
|
-
sessionId: string;
|
|
253
|
-
canonicalPathKey: string;
|
|
254
|
-
attemptedRevision: number;
|
|
255
|
-
lastSavedRevision: number;
|
|
256
|
-
committedPaths: string[];
|
|
257
|
-
failedPaths: string[];
|
|
258
|
-
diskMayBePartiallyUpdated: true;
|
|
259
|
-
}
|
|
260
|
-
interface MaterializeValidationFailedError {
|
|
261
|
-
code: 'materialize_validation_failed';
|
|
262
|
-
message: string;
|
|
263
|
-
sessionId: string;
|
|
264
|
-
canonicalPathKey: string;
|
|
265
|
-
issueCount: number;
|
|
266
|
-
diagnostics: BackendDiagnostic[];
|
|
267
|
-
}
|
|
268
|
-
interface MaterializeWriteFailedError {
|
|
269
|
-
code: 'write_failed';
|
|
270
|
-
message: string;
|
|
271
|
-
sessionId: string;
|
|
272
|
-
canonicalPathKey: string;
|
|
273
|
-
attemptedRevision: number;
|
|
274
|
-
lastSavedRevision: number;
|
|
275
|
-
writtenPaths: string[];
|
|
276
|
-
failedPaths: string[];
|
|
277
|
-
skippedPaths: string[];
|
|
278
|
-
diagnostics: BackendDiagnostic[];
|
|
279
|
-
diskMayBePartiallyUpdated: true;
|
|
280
|
-
}
|
|
281
|
-
type BackendEventKind = 'session.opened' | 'transaction.applied' | 'transaction.rejected' | 'save.started' | 'save.completed' | 'save.failed' | 'session.closeRequested' | 'session.closed' | 'cache.invalidated' | 'cache.updated' | 'job.created' | 'job.started' | 'job.progress' | 'job.cancelRequested' | 'job.cancelled' | 'job.completed' | 'job.failed';
|
|
282
|
-
interface BackendEvent {
|
|
283
|
-
sequence: number;
|
|
284
|
-
kind: BackendEventKind;
|
|
285
|
-
timestamp: string;
|
|
286
|
-
sessionId?: string;
|
|
287
|
-
canonicalPathKey?: string;
|
|
288
|
-
revision?: number;
|
|
289
|
-
cacheRevision?: number;
|
|
290
|
-
jobId?: string;
|
|
291
|
-
diagnostics: BackendDiagnostic[];
|
|
292
|
-
payload?: unknown;
|
|
293
|
-
}
|
|
294
|
-
interface GetEventsInput {
|
|
295
|
-
sessionId: string;
|
|
296
|
-
after?: string;
|
|
297
|
-
limit?: number;
|
|
298
|
-
}
|
|
299
|
-
interface GetEventsSnapshot {
|
|
300
|
-
events: BackendEvent[];
|
|
301
|
-
oldestSequence: number;
|
|
302
|
-
currentSequence: number;
|
|
303
|
-
cursorExpired: boolean;
|
|
304
|
-
}
|
|
305
|
-
interface EventCursorInvalidError {
|
|
306
|
-
code: 'event_cursor_invalid';
|
|
307
|
-
message: string;
|
|
308
|
-
sessionId: string;
|
|
309
|
-
after: string;
|
|
310
|
-
}
|
|
311
|
-
type BackendJobStatus = 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
312
|
-
type BackendJobKind = 'cache.refresh';
|
|
313
|
-
type BackendJobListStatusFilter = BackendJobStatus | 'active' | 'terminal';
|
|
314
|
-
interface BackendJobProgress {
|
|
315
|
-
completed: number;
|
|
316
|
-
total?: number;
|
|
317
|
-
message?: string;
|
|
318
|
-
}
|
|
319
|
-
interface BackendJobSnapshot {
|
|
320
|
-
jobId: string;
|
|
321
|
-
kind: BackendJobKind;
|
|
322
|
-
status: BackendJobStatus;
|
|
323
|
-
createdAt: string;
|
|
324
|
-
startedAt?: string;
|
|
325
|
-
finishedAt?: string;
|
|
326
|
-
sessionId?: string;
|
|
327
|
-
canonicalPathKey?: string;
|
|
328
|
-
revision?: number;
|
|
329
|
-
cacheRevision?: number;
|
|
330
|
-
diagnostics: BackendDiagnostic[];
|
|
331
|
-
progress?: BackendJobProgress;
|
|
332
|
-
result?: unknown;
|
|
333
|
-
error?: BackendError;
|
|
334
|
-
}
|
|
335
|
-
interface BackendJobListSnapshot {
|
|
336
|
-
jobs: BackendJobSnapshot[];
|
|
337
|
-
}
|
|
338
|
-
interface GetJobInput {
|
|
339
|
-
sessionId: string;
|
|
340
|
-
jobId: string;
|
|
341
|
-
}
|
|
342
|
-
interface ListJobsInput {
|
|
343
|
-
sessionId: string;
|
|
344
|
-
status?: BackendJobListStatusFilter;
|
|
345
|
-
kind?: BackendJobKind;
|
|
346
|
-
limit?: number;
|
|
347
|
-
}
|
|
348
|
-
interface CancelJobInput {
|
|
349
|
-
sessionId: string;
|
|
350
|
-
jobId: string;
|
|
351
|
-
}
|
|
352
|
-
interface BackendJobNotFoundError {
|
|
353
|
-
code: 'job_not_found';
|
|
354
|
-
message: string;
|
|
355
|
-
sessionId: string;
|
|
356
|
-
jobId: string;
|
|
357
|
-
}
|
|
358
|
-
interface BackendJobNotCancellableError {
|
|
359
|
-
code: 'job_not_cancellable';
|
|
360
|
-
message: string;
|
|
361
|
-
sessionId: string;
|
|
362
|
-
jobId: string;
|
|
363
|
-
status: 'completed' | 'failed' | 'cancelled';
|
|
364
|
-
}
|
|
365
|
-
interface BackendJobCancelledError {
|
|
366
|
-
code: 'job_cancelled';
|
|
367
|
-
message: string;
|
|
368
|
-
sessionId: string;
|
|
369
|
-
jobId: string;
|
|
370
|
-
}
|
|
371
|
-
interface CacheRefreshFailedError {
|
|
372
|
-
code: 'cache_refresh_failed';
|
|
373
|
-
message: string;
|
|
374
|
-
sessionId: string;
|
|
375
|
-
jobId: string;
|
|
376
|
-
causeCode?: string;
|
|
377
|
-
}
|
|
378
|
-
interface BackendCapabilityUnavailableError {
|
|
379
|
-
code: 'capability_unavailable';
|
|
380
|
-
message: string;
|
|
381
|
-
capability: 'fileSystem' | 'artifact.publish' | 'artifact.restore';
|
|
382
|
-
requiredAdapter?: 'BackendFileSystem';
|
|
383
|
-
requiredHost?: 'node';
|
|
384
|
-
bridgeBoundary?: 'external-bridge';
|
|
385
|
-
}
|
|
386
|
-
type BackendJobErrors = BackendJobNotFoundError | BackendJobNotCancellableError | BackendJobCancelledError | CacheRefreshFailedError;
|
|
387
|
-
interface BackendCacheSnapshot {
|
|
388
|
-
cacheRevision: number;
|
|
389
|
-
entries: BackendCacheEntry[];
|
|
390
|
-
}
|
|
391
|
-
interface BackendCacheEntry {
|
|
392
|
-
canonicalPathKey: string;
|
|
393
|
-
sessionId?: string;
|
|
394
|
-
revision: number;
|
|
395
|
-
lastSavedRevision: number;
|
|
396
|
-
dirty: boolean;
|
|
397
|
-
valid: boolean;
|
|
398
|
-
indexedAt: string;
|
|
399
|
-
summary: {
|
|
400
|
-
resourceCount: number;
|
|
401
|
-
packageCount?: number;
|
|
402
|
-
diagnostics: BackendDiagnostic[];
|
|
403
|
-
};
|
|
404
|
-
}
|
|
405
|
-
interface GetCacheSnapshotInput {
|
|
406
|
-
sessionId: string;
|
|
407
|
-
}
|
|
408
|
-
interface RefreshCacheInput {
|
|
409
|
-
sessionId: string;
|
|
410
|
-
reason?: 'manual' | 'session_open' | 'after_save';
|
|
411
|
-
}
|
|
412
|
-
type BackendError = SessionNotFoundError | SessionStaleWriteError | InProcessLockConflictError | AdvisoryLockConflictError | SavePartialFailureError | MaterializeValidationFailedError | MaterializeWriteFailedError | PathPolicyViolationError | EventCursorInvalidError | BackendJobNotFoundError | BackendJobNotCancellableError | BackendJobCancelledError | CacheRefreshFailedError | BackendCapabilityUnavailableError | ApplyUamTransactionAppError;
|
|
413
|
-
interface ApplySessionTransactionInput {
|
|
414
|
-
sessionId: string;
|
|
415
|
-
expectedRevision: number;
|
|
416
|
-
operations: UamTransactionOperation[];
|
|
417
|
-
}
|
|
418
|
-
interface OpenProjectSessionInput {
|
|
419
|
-
project: UamProject;
|
|
420
|
-
sessionId?: string;
|
|
421
|
-
canonicalProjectPath?: string;
|
|
422
|
-
canonicalPathKey?: string;
|
|
423
|
-
storage?: BackendProjectSessionStorage;
|
|
424
|
-
}
|
|
425
|
-
interface BackendProjectSessionStorage {
|
|
426
|
-
fileSystem: BackendFileSystem;
|
|
427
|
-
fairyPath: string;
|
|
428
|
-
canonicalProjectPath?: string;
|
|
429
|
-
canonicalPathKey?: string;
|
|
430
|
-
}
|
|
431
|
-
interface SaveSessionInput {
|
|
432
|
-
sessionId: string;
|
|
433
|
-
expectedRevision?: number;
|
|
434
|
-
targetPath?: string;
|
|
435
|
-
fileSystem?: BackendFileSystem;
|
|
436
|
-
force?: boolean;
|
|
437
|
-
mode?: 'materializeCleanSession';
|
|
438
|
-
}
|
|
439
|
-
interface MaterializeSessionInput {
|
|
440
|
-
sessionId: string;
|
|
441
|
-
expectedRevision?: number;
|
|
442
|
-
storage?: BackendProjectSessionStorage;
|
|
443
|
-
targetPath?: string;
|
|
444
|
-
fileSystem?: BackendFileSystem;
|
|
445
|
-
mode?: 'fullProject';
|
|
446
|
-
reason?: string;
|
|
447
|
-
}
|
|
448
|
-
interface BackendRuntimeOptions {
|
|
449
|
-
fileSystem?: BackendFileSystem;
|
|
450
|
-
host?: BackendHostAdapter;
|
|
451
|
-
}
|
|
452
|
-
declare class BackendRuntime {
|
|
453
|
-
private readonly fileSystem?;
|
|
454
|
-
private readonly capabilities;
|
|
455
|
-
private readonly sessions;
|
|
456
|
-
private readonly sessionsByPath;
|
|
457
|
-
private readonly eventsBySession;
|
|
458
|
-
private readonly jobsBySession;
|
|
459
|
-
private readonly cacheBySession;
|
|
460
|
-
private eventSequence;
|
|
461
|
-
private readonly context;
|
|
462
|
-
private readonly readService;
|
|
463
|
-
private readonly runtimeService;
|
|
464
|
-
private readonly authoringService;
|
|
465
|
-
private readonly cacheService;
|
|
466
|
-
private readonly eventService;
|
|
467
|
-
private readonly jobService;
|
|
468
|
-
constructor(options?: BackendRuntimeOptions);
|
|
469
|
-
getCapabilities(): BackendSuccess<BackendCapabilities>;
|
|
470
|
-
openSession(input: {
|
|
471
|
-
projectPath: string;
|
|
472
|
-
}): Promise<BackendResult<BackendSessionSnapshot, InProcessLockConflictError | AdvisoryLockConflictError | BackendCapabilityUnavailableError>>;
|
|
473
|
-
openProjectSession(input: OpenProjectSessionInput): BackendResult<BackendSessionSnapshot>;
|
|
474
|
-
getSession(input: {
|
|
475
|
-
sessionId: string;
|
|
476
|
-
}): BackendResult<BackendSessionSnapshot, SessionNotFoundError>;
|
|
477
|
-
applyTransaction(input: ApplySessionTransactionInput): Promise<BackendResult<BackendSessionSnapshot, SessionNotFoundError | SessionStaleWriteError | ApplyUamTransactionAppError>>;
|
|
478
|
-
saveSession(input: SaveSessionInput): Promise<BackendResult<BackendSessionSnapshot | MaterializeSessionSnapshot, SessionNotFoundError | SessionStaleWriteError | SavePartialFailureError | MaterializeValidationFailedError | MaterializeWriteFailedError | PathPolicyViolationError | InProcessLockConflictError | BackendCapabilityUnavailableError>>;
|
|
479
|
-
materializeSession(input: MaterializeSessionInput): Promise<BackendResult<MaterializeSessionSnapshot, SessionNotFoundError | SessionStaleWriteError | MaterializeValidationFailedError | MaterializeWriteFailedError | PathPolicyViolationError | InProcessLockConflictError | BackendCapabilityUnavailableError>>;
|
|
480
|
-
closeSession(input: {
|
|
481
|
-
sessionId: string;
|
|
482
|
-
}): Promise<BackendResult<{
|
|
483
|
-
sessionId: string;
|
|
484
|
-
closed: true;
|
|
485
|
-
}, SessionNotFoundError>>;
|
|
486
|
-
getEvents(input: GetEventsInput): BackendResult<GetEventsSnapshot, SessionNotFoundError | EventCursorInvalidError>;
|
|
487
|
-
getJob(input: GetJobInput): BackendResult<BackendJobSnapshot, SessionNotFoundError | BackendJobNotFoundError>;
|
|
488
|
-
listJobs(input: ListJobsInput): BackendResult<BackendJobListSnapshot, SessionNotFoundError>;
|
|
489
|
-
cancelJob(input: CancelJobInput): BackendResult<BackendJobSnapshot, SessionNotFoundError | BackendJobNotFoundError | BackendJobNotCancellableError>;
|
|
490
|
-
getCacheSnapshot(input: GetCacheSnapshotInput): BackendResult<BackendCacheSnapshot, SessionNotFoundError>;
|
|
491
|
-
refreshCache(input: RefreshCacheInput): BackendResult<BackendJobSnapshot, SessionNotFoundError>;
|
|
492
|
-
}
|
|
493
|
-
//#endregion
|
|
494
|
-
export { BACKEND_CONTRACT_VERSION as $, BackendSessionSnapshot as A, ListJobsInput as B, BackendJobProgress as C, BackendResult as D, BackendProjectSessionStorage as E, GetCacheSnapshotInput as F, OpenProjectSessionInput as G, MaterializeSessionSnapshot as H, GetEventsInput as I, SaveSessionInput as J, RefreshCacheInput as K, GetEventsSnapshot as L, CacheRefreshFailedError as M, CancelJobInput as N, BackendRuntime as O, EventCursorInvalidError as P, BACKEND_COMPATIBILITY_POLICY as Q, GetJobInput as R, BackendJobNotFoundError as S, BackendJobStatus as T, MaterializeValidationFailedError as U, MaterializeSessionInput as V, MaterializeWriteFailedError as W, SessionStaleWriteError as X, SessionNotFoundError as Y, BACKEND_CAPABILITY_SCHEMA_VERSION as Z, BackendJobErrors as _, BackendCacheSnapshot as a, BackendJobListStatusFilter as b, BackendCapabilityUnavailableError as c, BackendEventKind as d, BackendDiagnostic as et, BackendFailure as f, BackendHostAdapter as g, BackendFileSystem as h, BackendCacheEntry as i, BackendSuccess as j, BackendRuntimeOptions as k, BackendError as l, BackendFileStat as m, ApplySessionTransactionInput as n, BackendResponseMeta as nt, BackendCapabilities as o, BackendFileHandle as p, SavePartialFailureError as q, BackendArtifactBridgeCapability as r, BackendStage as rt, BackendCapabilityManifest as s, AdvisoryLockConflictError as t, BackendMessage as tt, BackendEvent as u, BackendJobKind as v, BackendJobSnapshot as w, BackendJobNotCancellableError as x, BackendJobListSnapshot as y, InProcessLockConflictError as z };
|