@powerhousedao/reactor 4.1.0-dev.7 → 4.1.0-dev.71
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/client/reactor-client.d.ts +103 -0
- package/dist/src/client/reactor-client.d.ts.map +1 -0
- package/dist/src/client/reactor-client.js +184 -0
- package/dist/src/client/reactor-client.js.map +1 -0
- package/dist/src/client/types.d.ts +213 -0
- package/dist/src/client/types.d.ts.map +1 -0
- package/dist/src/client/types.js +14 -0
- package/dist/src/client/types.js.map +1 -0
- package/dist/src/core/builder.d.ts +20 -0
- package/dist/src/core/builder.d.ts.map +1 -0
- package/dist/src/core/builder.js +47 -0
- package/dist/src/core/builder.js.map +1 -0
- package/dist/src/core/reactor.d.ts +98 -0
- package/dist/src/core/reactor.d.ts.map +1 -0
- package/dist/src/core/reactor.js +630 -0
- package/dist/src/core/reactor.js.map +1 -0
- package/dist/src/core/types.d.ts +121 -0
- package/dist/src/core/types.d.ts.map +1 -0
- package/dist/src/core/types.js +2 -0
- package/dist/src/core/types.js.map +1 -0
- package/dist/src/core/utils.d.ts +11 -0
- package/dist/src/core/utils.d.ts.map +1 -0
- package/dist/src/core/utils.js +31 -0
- package/dist/src/core/utils.js.map +1 -0
- package/dist/src/events/event-bus.d.ts +3 -3
- package/dist/src/events/event-bus.d.ts.map +1 -1
- package/dist/src/events/event-bus.js.map +1 -1
- package/dist/src/events/interfaces.d.ts +1 -1
- package/dist/src/events/interfaces.d.ts.map +1 -1
- package/dist/src/events/types.d.ts +1 -1
- package/dist/src/events/types.d.ts.map +1 -1
- package/dist/src/events/types.js.map +1 -1
- package/dist/src/executor/interfaces.d.ts +31 -54
- package/dist/src/executor/interfaces.d.ts.map +1 -1
- package/dist/src/executor/simple-job-executor-manager.d.ts +27 -0
- package/dist/src/executor/simple-job-executor-manager.d.ts.map +1 -0
- package/dist/src/executor/simple-job-executor-manager.js +128 -0
- package/dist/src/executor/simple-job-executor-manager.js.map +1 -0
- package/dist/src/executor/simple-job-executor.d.ts +29 -0
- package/dist/src/executor/simple-job-executor.d.ts.map +1 -0
- package/dist/src/executor/simple-job-executor.js +154 -0
- package/dist/src/executor/simple-job-executor.js.map +1 -0
- package/dist/src/executor/types.d.ts +23 -8
- package/dist/src/executor/types.d.ts.map +1 -1
- package/dist/src/executor/types.js.map +1 -1
- package/dist/src/index.d.ts +19 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +25 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/queue/interfaces.d.ts +45 -5
- package/dist/src/queue/interfaces.d.ts.map +1 -1
- package/dist/src/queue/job-execution-handle.d.ts +24 -0
- package/dist/src/queue/job-execution-handle.d.ts.map +1 -0
- package/dist/src/queue/job-execution-handle.js +62 -0
- package/dist/src/queue/job-execution-handle.js.map +1 -0
- package/dist/src/queue/queue.d.ts +54 -5
- package/dist/src/queue/queue.d.ts.map +1 -1
- package/dist/src/queue/queue.js +265 -36
- package/dist/src/queue/queue.js.map +1 -1
- package/dist/src/queue/types.d.ts +26 -1
- package/dist/src/queue/types.d.ts.map +1 -1
- package/dist/src/queue/types.js +12 -0
- package/dist/src/queue/types.js.map +1 -1
- package/dist/src/read-models/document-view.d.ts +21 -0
- package/dist/src/read-models/document-view.d.ts.map +1 -0
- package/dist/src/read-models/document-view.js +285 -0
- package/dist/src/read-models/document-view.js.map +1 -0
- package/dist/src/read-models/types.d.ts +46 -0
- package/dist/src/read-models/types.d.ts.map +1 -0
- package/dist/src/read-models/types.js +2 -0
- package/dist/src/read-models/types.js.map +1 -0
- package/dist/src/registry/implementation.d.ts +62 -0
- package/dist/src/registry/implementation.d.ts.map +1 -0
- package/dist/src/registry/implementation.js +96 -0
- package/dist/src/registry/implementation.js.map +1 -0
- package/dist/src/registry/index.d.ts +3 -0
- package/dist/src/registry/index.d.ts.map +1 -0
- package/dist/src/registry/index.js +2 -0
- package/dist/src/registry/index.js.map +1 -0
- package/dist/src/registry/interfaces.d.ts +39 -0
- package/dist/src/registry/interfaces.d.ts.map +1 -0
- package/dist/src/registry/interfaces.js +2 -0
- package/dist/src/registry/interfaces.js.map +1 -0
- package/dist/src/shared/awaiter.d.ts +32 -0
- package/dist/src/shared/awaiter.d.ts.map +1 -0
- package/dist/src/shared/awaiter.js +132 -0
- package/dist/src/shared/awaiter.js.map +1 -0
- package/dist/src/shared/errors.d.ts +9 -0
- package/dist/src/shared/errors.d.ts.map +1 -0
- package/dist/src/shared/errors.js +18 -0
- package/dist/src/shared/errors.js.map +1 -0
- package/dist/src/shared/factories.d.ts +16 -0
- package/dist/src/shared/factories.d.ts.map +1 -0
- package/dist/src/shared/factories.js +33 -0
- package/dist/src/shared/factories.js.map +1 -0
- package/dist/src/shared/types.d.ts +91 -19
- package/dist/src/shared/types.d.ts.map +1 -1
- package/dist/src/shared/types.js +35 -1
- package/dist/src/shared/types.js.map +1 -1
- package/dist/src/shared/utils.d.ts +3 -0
- package/dist/src/shared/utils.d.ts.map +1 -0
- package/dist/src/shared/utils.js +8 -0
- package/dist/src/shared/utils.js.map +1 -0
- package/dist/src/signer/passthrough-signer.d.ts +6 -0
- package/dist/src/signer/passthrough-signer.d.ts.map +1 -0
- package/dist/src/signer/passthrough-signer.js +6 -0
- package/dist/src/signer/passthrough-signer.js.map +1 -0
- package/dist/src/signer/types.d.ts +15 -0
- package/dist/src/signer/types.d.ts.map +1 -0
- package/dist/src/signer/types.js +2 -0
- package/dist/src/signer/types.js.map +1 -0
- package/dist/src/storage/interfaces.d.ts +125 -0
- package/dist/src/storage/interfaces.d.ts.map +1 -0
- package/dist/src/storage/interfaces.js +19 -0
- package/dist/src/storage/interfaces.js.map +1 -0
- package/dist/src/storage/kysely/store.d.ts +15 -0
- package/dist/src/storage/kysely/store.d.ts.map +1 -0
- package/dist/src/storage/kysely/store.js +173 -0
- package/dist/src/storage/kysely/store.js.map +1 -0
- package/dist/src/storage/kysely/types.d.ts +26 -0
- package/dist/src/storage/kysely/types.d.ts.map +1 -0
- package/dist/src/storage/kysely/types.js +2 -0
- package/dist/src/storage/kysely/types.js.map +1 -0
- package/dist/src/storage/txn.d.ts +15 -0
- package/dist/src/storage/txn.d.ts.map +1 -0
- package/dist/src/storage/txn.js +42 -0
- package/dist/src/storage/txn.js.map +1 -0
- package/dist/src/subs/default-error-handler.d.ts +13 -0
- package/dist/src/subs/default-error-handler.d.ts.map +1 -0
- package/dist/src/subs/default-error-handler.js +27 -0
- package/dist/src/subs/default-error-handler.js.map +1 -0
- package/dist/src/subs/react-subscription-manager.d.ts +45 -0
- package/dist/src/subs/react-subscription-manager.d.ts.map +1 -0
- package/dist/src/subs/react-subscription-manager.js +185 -0
- package/dist/src/subs/react-subscription-manager.js.map +1 -0
- package/dist/src/subs/types.d.ts +64 -0
- package/dist/src/subs/types.d.ts.map +1 -0
- package/dist/src/subs/types.js +2 -0
- package/dist/src/subs/types.js.map +1 -0
- package/package.json +13 -5
- package/dist/bench/end-to-end-flow.bench.d.ts +0 -2
- package/dist/bench/end-to-end-flow.bench.d.ts.map +0 -1
- package/dist/bench/end-to-end-flow.bench.js +0 -256
- package/dist/bench/end-to-end-flow.bench.js.map +0 -1
- package/dist/bench/event-bus.bench.d.ts +0 -2
- package/dist/bench/event-bus.bench.d.ts.map +0 -1
- package/dist/bench/event-bus.bench.js +0 -238
- package/dist/bench/event-bus.bench.js.map +0 -1
- package/dist/bench/queue-only.bench.d.ts +0 -2
- package/dist/bench/queue-only.bench.d.ts.map +0 -1
- package/dist/bench/queue-only.bench.js +0 -40
- package/dist/bench/queue-only.bench.js.map +0 -1
- package/dist/bench/reactor-throughput.bench.d.ts +0 -2
- package/dist/bench/reactor-throughput.bench.d.ts.map +0 -1
- package/dist/bench/reactor-throughput.bench.js +0 -137
- package/dist/bench/reactor-throughput.bench.js.map +0 -1
- package/dist/src/executor/job-executor.d.ts +0 -62
- package/dist/src/executor/job-executor.d.ts.map +0 -1
- package/dist/src/executor/job-executor.js +0 -325
- package/dist/src/executor/job-executor.js.map +0 -1
- package/dist/test/event-bus.test.d.ts +0 -2
- package/dist/test/event-bus.test.d.ts.map +0 -1
- package/dist/test/event-bus.test.js +0 -532
- package/dist/test/event-bus.test.js.map +0 -1
- package/dist/test/job-executor.test.d.ts +0 -2
- package/dist/test/job-executor.test.d.ts.map +0 -1
- package/dist/test/job-executor.test.js +0 -581
- package/dist/test/job-executor.test.js.map +0 -1
- package/dist/test/queue.test.d.ts +0 -2
- package/dist/test/queue.test.d.ts.map +0 -1
- package/dist/test/queue.test.js +0 -396
- package/dist/test/queue.test.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
import { AbortError } from "document-drive";
|
|
2
|
+
import { v4 as uuidv4 } from "uuid";
|
|
3
|
+
import { createMutableShutdownStatus } from "../shared/factories.js";
|
|
4
|
+
import { JobStatus, SYSTEM_DOCUMENT_ID } from "../shared/types.js";
|
|
5
|
+
import { matchesScope } from "../shared/utils.js";
|
|
6
|
+
import { filterByParentId, filterByType } from "./utils.js";
|
|
7
|
+
/**
|
|
8
|
+
* The Reactor facade implementation.
|
|
9
|
+
*
|
|
10
|
+
* This class implements the IReactor interface and serves as the main entry point
|
|
11
|
+
* for the new Reactor architecture. In Phase 2 of the refactoring plan, it acts
|
|
12
|
+
* as a facade over the existing BaseDocumentDriveServer while we incrementally
|
|
13
|
+
* migrate to the new architecture.
|
|
14
|
+
*
|
|
15
|
+
* The facade pattern allows us to:
|
|
16
|
+
* 1. Present the new IReactor API to clients immediately
|
|
17
|
+
* 2. Internally delegate to the refactored BaseDocumentDriveServer (post Phase 1)
|
|
18
|
+
* 3. Incrementally replace internal implementations without breaking clients
|
|
19
|
+
* 4. Validate the new architecture alongside the existing system
|
|
20
|
+
*/
|
|
21
|
+
export class Reactor {
|
|
22
|
+
driveServer;
|
|
23
|
+
documentStorage;
|
|
24
|
+
shutdownStatus;
|
|
25
|
+
setShutdown;
|
|
26
|
+
queue;
|
|
27
|
+
constructor(driveServer, documentStorage, queue) {
|
|
28
|
+
// Store required dependencies
|
|
29
|
+
this.driveServer = driveServer;
|
|
30
|
+
this.documentStorage = documentStorage;
|
|
31
|
+
this.queue = queue;
|
|
32
|
+
// Create mutable shutdown status using factory method
|
|
33
|
+
const [status, setter] = createMutableShutdownStatus(false);
|
|
34
|
+
this.shutdownStatus = status;
|
|
35
|
+
this.setShutdown = setter;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Signals that the reactor should shutdown.
|
|
39
|
+
*/
|
|
40
|
+
kill() {
|
|
41
|
+
// Mark the reactor as shutdown
|
|
42
|
+
this.setShutdown(true);
|
|
43
|
+
// TODO: Phase 3+ - Implement graceful shutdown for queue, executors, etc.
|
|
44
|
+
// For now, we just mark as shutdown and return status
|
|
45
|
+
return this.shutdownStatus;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Retrieves a list of document model specifications
|
|
49
|
+
*/
|
|
50
|
+
getDocumentModels(namespace, paging, signal) {
|
|
51
|
+
// Get document model modules from the drive server + filter
|
|
52
|
+
const modules = this.driveServer.getDocumentModelModules();
|
|
53
|
+
const filteredModels = modules.filter((module) => !namespace || module.documentModel.global.name.startsWith(namespace));
|
|
54
|
+
// Apply paging
|
|
55
|
+
const startIndex = paging ? parseInt(paging.cursor) || 0 : 0;
|
|
56
|
+
const limit = paging?.limit || filteredModels.length;
|
|
57
|
+
const pagedModels = filteredModels.slice(startIndex, startIndex + limit);
|
|
58
|
+
// Create paged results
|
|
59
|
+
const hasMore = startIndex + limit < filteredModels.length;
|
|
60
|
+
const nextCursor = hasMore ? String(startIndex + limit) : undefined;
|
|
61
|
+
// even thought this is currently synchronous, they could have passed in an already-aborted signal
|
|
62
|
+
if (signal?.aborted) {
|
|
63
|
+
throw new AbortError();
|
|
64
|
+
}
|
|
65
|
+
return Promise.resolve({
|
|
66
|
+
results: pagedModels,
|
|
67
|
+
options: paging || { cursor: "0", limit: filteredModels.length },
|
|
68
|
+
nextCursor,
|
|
69
|
+
next: hasMore
|
|
70
|
+
? () => this.getDocumentModels(namespace, { cursor: nextCursor, limit }, signal)
|
|
71
|
+
: undefined,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Retrieves a specific PHDocument by id
|
|
76
|
+
*/
|
|
77
|
+
async get(id, view, signal) {
|
|
78
|
+
const document = await this.documentStorage.get(id);
|
|
79
|
+
if (signal?.aborted) {
|
|
80
|
+
throw new AbortError();
|
|
81
|
+
}
|
|
82
|
+
const childIds = await this.documentStorage.getChildren(id);
|
|
83
|
+
if (signal?.aborted) {
|
|
84
|
+
throw new AbortError();
|
|
85
|
+
}
|
|
86
|
+
// Apply view filter - This will be removed when we pass the viewfilter along
|
|
87
|
+
// to the underlying store, but is here now for the interface.
|
|
88
|
+
for (const scope in document.state) {
|
|
89
|
+
if (!matchesScope(view, scope)) {
|
|
90
|
+
delete document.state[scope];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
document,
|
|
95
|
+
childIds,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Retrieves a specific PHDocument by slug
|
|
100
|
+
*/
|
|
101
|
+
async getBySlug(slug, view, signal) {
|
|
102
|
+
// Use the storage layer to resolve slug to ID
|
|
103
|
+
let ids;
|
|
104
|
+
try {
|
|
105
|
+
ids = await this.documentStorage.resolveIds([slug], signal);
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
// If the error is from resolveIds (document not found), wrap it with our message
|
|
109
|
+
if (error instanceof Error && error.message.includes("not found")) {
|
|
110
|
+
throw new Error(`Document not found with slug: ${slug}`);
|
|
111
|
+
}
|
|
112
|
+
throw error;
|
|
113
|
+
}
|
|
114
|
+
if (ids.length === 0 || !ids[0]) {
|
|
115
|
+
throw new Error(`Document not found with slug: ${slug}`);
|
|
116
|
+
}
|
|
117
|
+
// Now get the document by its resolved ID
|
|
118
|
+
return await this.get(ids[0], view, signal);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Retrieves the operations for a document
|
|
122
|
+
*/
|
|
123
|
+
async getOperations(documentId, view, paging, signal) {
|
|
124
|
+
// Use storage directly to get the document
|
|
125
|
+
const document = await this.documentStorage.get(documentId);
|
|
126
|
+
if (signal?.aborted) {
|
|
127
|
+
throw new AbortError();
|
|
128
|
+
}
|
|
129
|
+
const operations = document.operations;
|
|
130
|
+
const result = {};
|
|
131
|
+
// apply view filter, per scope -- this will be removed when we pass the viewfilter along
|
|
132
|
+
// to the underlying store, but is here now for the interface.
|
|
133
|
+
for (const scope in operations) {
|
|
134
|
+
if (matchesScope(view, scope)) {
|
|
135
|
+
const scopeOperations = operations[scope];
|
|
136
|
+
// apply paging too
|
|
137
|
+
const startIndex = paging ? parseInt(paging.cursor) || 0 : 0;
|
|
138
|
+
const limit = paging?.limit || scopeOperations.length;
|
|
139
|
+
const pagedOperations = scopeOperations.slice(startIndex, startIndex + limit);
|
|
140
|
+
result[scope] = {
|
|
141
|
+
results: pagedOperations,
|
|
142
|
+
options: { cursor: String(startIndex + limit), limit },
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return Promise.resolve(result);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Filters documents by criteria and returns a list of them
|
|
150
|
+
*/
|
|
151
|
+
async find(search, view, paging, signal) {
|
|
152
|
+
let results;
|
|
153
|
+
if (search.ids) {
|
|
154
|
+
if (search.slugs && search.slugs.length > 0) {
|
|
155
|
+
throw new Error("Cannot use both ids and slugs in the same search");
|
|
156
|
+
}
|
|
157
|
+
results = await this.findByIds(search.ids, view, paging, signal);
|
|
158
|
+
if (search.parentId) {
|
|
159
|
+
results = filterByParentId(results, search.parentId);
|
|
160
|
+
}
|
|
161
|
+
if (search.type) {
|
|
162
|
+
results = filterByType(results, search.type);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
else if (search.slugs) {
|
|
166
|
+
results = await this.findBySlugs(search.slugs, view, paging, signal);
|
|
167
|
+
if (search.parentId) {
|
|
168
|
+
results = filterByParentId(results, search.parentId);
|
|
169
|
+
}
|
|
170
|
+
if (search.type) {
|
|
171
|
+
results = filterByType(results, search.type);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
else if (search.parentId) {
|
|
175
|
+
results = await this.findByParentId(search.parentId, view, paging, signal);
|
|
176
|
+
if (search.type) {
|
|
177
|
+
results = filterByType(results, search.type);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
else if (search.type) {
|
|
181
|
+
results = await this.findByType(search.type, view, paging, signal);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
throw new Error("No search criteria provided");
|
|
185
|
+
}
|
|
186
|
+
if (signal?.aborted) {
|
|
187
|
+
throw new AbortError();
|
|
188
|
+
}
|
|
189
|
+
return results;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Creates a document
|
|
193
|
+
*/
|
|
194
|
+
async create(document, signal) {
|
|
195
|
+
const createdAtUtcIso = new Date().toISOString();
|
|
196
|
+
if (signal?.aborted) {
|
|
197
|
+
throw new AbortError();
|
|
198
|
+
}
|
|
199
|
+
// Create a CREATE_DOCUMENT action
|
|
200
|
+
const action = {
|
|
201
|
+
id: `${document.header.id}-create`,
|
|
202
|
+
type: "CREATE_DOCUMENT",
|
|
203
|
+
scope: "system",
|
|
204
|
+
timestampUtcMs: String(Date.now()),
|
|
205
|
+
input: {
|
|
206
|
+
document,
|
|
207
|
+
},
|
|
208
|
+
};
|
|
209
|
+
// Create a job for the CREATE_DOCUMENT action
|
|
210
|
+
const job = {
|
|
211
|
+
id: uuidv4(),
|
|
212
|
+
documentId: SYSTEM_DOCUMENT_ID,
|
|
213
|
+
scope: "system",
|
|
214
|
+
branch: "main",
|
|
215
|
+
operation: {
|
|
216
|
+
index: 0,
|
|
217
|
+
timestampUtcMs: String(Date.now()),
|
|
218
|
+
hash: "",
|
|
219
|
+
skip: 0,
|
|
220
|
+
action: action,
|
|
221
|
+
},
|
|
222
|
+
createdAt: new Date().toISOString(),
|
|
223
|
+
queueHint: [],
|
|
224
|
+
maxRetries: 3,
|
|
225
|
+
};
|
|
226
|
+
// Enqueue the job
|
|
227
|
+
await this.queue.enqueue(job);
|
|
228
|
+
// Return pending job status
|
|
229
|
+
return {
|
|
230
|
+
id: job.id,
|
|
231
|
+
status: JobStatus.PENDING,
|
|
232
|
+
createdAtUtcIso,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Deletes a document
|
|
237
|
+
*/
|
|
238
|
+
async deleteDocument(id, propagate, signal) {
|
|
239
|
+
const createdAtUtcIso = new Date().toISOString();
|
|
240
|
+
if (signal?.aborted) {
|
|
241
|
+
throw new AbortError();
|
|
242
|
+
}
|
|
243
|
+
// Create a DELETE_DOCUMENT action
|
|
244
|
+
const deleteInput = {
|
|
245
|
+
documentId: id,
|
|
246
|
+
propagate,
|
|
247
|
+
};
|
|
248
|
+
const action = {
|
|
249
|
+
id: `${id}-delete`,
|
|
250
|
+
type: "DELETE_DOCUMENT",
|
|
251
|
+
scope: "system",
|
|
252
|
+
timestampUtcMs: String(Date.now()),
|
|
253
|
+
input: deleteInput,
|
|
254
|
+
};
|
|
255
|
+
// Create a job for the DELETE_DOCUMENT action
|
|
256
|
+
const job = {
|
|
257
|
+
id: uuidv4(),
|
|
258
|
+
documentId: SYSTEM_DOCUMENT_ID,
|
|
259
|
+
scope: "system",
|
|
260
|
+
branch: "main",
|
|
261
|
+
operation: {
|
|
262
|
+
index: 0,
|
|
263
|
+
timestampUtcMs: String(Date.now()),
|
|
264
|
+
hash: "",
|
|
265
|
+
skip: 0,
|
|
266
|
+
action: action,
|
|
267
|
+
},
|
|
268
|
+
createdAt: new Date().toISOString(),
|
|
269
|
+
queueHint: [],
|
|
270
|
+
maxRetries: 3,
|
|
271
|
+
};
|
|
272
|
+
// Enqueue the job
|
|
273
|
+
await this.queue.enqueue(job);
|
|
274
|
+
// Return pending job status
|
|
275
|
+
return {
|
|
276
|
+
id: job.id,
|
|
277
|
+
status: JobStatus.PENDING,
|
|
278
|
+
createdAtUtcIso,
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Applies a list of actions to a document
|
|
283
|
+
*/
|
|
284
|
+
async mutate(id, actions) {
|
|
285
|
+
const createdAtUtcIso = new Date().toISOString();
|
|
286
|
+
// Create jobs for each action/operation
|
|
287
|
+
const jobs = actions.map((action, index) => ({
|
|
288
|
+
id: uuidv4(),
|
|
289
|
+
documentId: id,
|
|
290
|
+
scope: action.scope || "global",
|
|
291
|
+
branch: "main", // Default to main branch
|
|
292
|
+
operation: {
|
|
293
|
+
index: index,
|
|
294
|
+
timestampUtcMs: String(action.timestampUtcMs || Date.now()),
|
|
295
|
+
hash: "", // Will be computed by the executor
|
|
296
|
+
skip: 0,
|
|
297
|
+
action: action,
|
|
298
|
+
},
|
|
299
|
+
createdAt: new Date().toISOString(),
|
|
300
|
+
queueHint: [],
|
|
301
|
+
maxRetries: 3,
|
|
302
|
+
}));
|
|
303
|
+
// Enqueue all jobs
|
|
304
|
+
for (const job of jobs) {
|
|
305
|
+
await this.queue.enqueue(job);
|
|
306
|
+
}
|
|
307
|
+
// Return job info for the batch (using the first job's ID as the batch ID)
|
|
308
|
+
// TODO: we need proper support for batch jobs
|
|
309
|
+
const batchJobId = jobs.length > 0 ? jobs[0].id : uuidv4();
|
|
310
|
+
return {
|
|
311
|
+
id: batchJobId,
|
|
312
|
+
status: JobStatus.PENDING,
|
|
313
|
+
createdAtUtcIso,
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Adds multiple documents as children to another
|
|
318
|
+
*/
|
|
319
|
+
async addChildren(parentId, documentIds, view, signal) {
|
|
320
|
+
const createdAtUtcIso = new Date().toISOString();
|
|
321
|
+
const jobId = uuidv4();
|
|
322
|
+
// Check abort signal before starting
|
|
323
|
+
if (signal?.aborted) {
|
|
324
|
+
throw new AbortError();
|
|
325
|
+
}
|
|
326
|
+
// TODO: Implement when drive server supports hierarchical documents
|
|
327
|
+
// For now, this is a placeholder implementation
|
|
328
|
+
// Verify parent exists
|
|
329
|
+
try {
|
|
330
|
+
await this.driveServer.getDocument(parentId);
|
|
331
|
+
}
|
|
332
|
+
catch (error) {
|
|
333
|
+
return {
|
|
334
|
+
id: jobId,
|
|
335
|
+
status: JobStatus.FAILED,
|
|
336
|
+
createdAtUtcIso,
|
|
337
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
// Check abort signal after parent verification
|
|
341
|
+
if (signal?.aborted) {
|
|
342
|
+
throw new AbortError();
|
|
343
|
+
}
|
|
344
|
+
// Verify all children exist
|
|
345
|
+
for (const childId of documentIds) {
|
|
346
|
+
try {
|
|
347
|
+
await this.driveServer.getDocument(childId);
|
|
348
|
+
}
|
|
349
|
+
catch (error) {
|
|
350
|
+
return {
|
|
351
|
+
id: jobId,
|
|
352
|
+
status: JobStatus.FAILED,
|
|
353
|
+
createdAtUtcIso,
|
|
354
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
// Check abort signal after each child verification
|
|
358
|
+
if (signal?.aborted) {
|
|
359
|
+
throw new AbortError();
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
// TODO: Actually establish parent-child relationships
|
|
363
|
+
// Return success job info
|
|
364
|
+
return {
|
|
365
|
+
id: jobId,
|
|
366
|
+
status: JobStatus.COMPLETED,
|
|
367
|
+
createdAtUtcIso,
|
|
368
|
+
completedAtUtcIso: new Date().toISOString(),
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Removes multiple documents as children from another
|
|
373
|
+
*/
|
|
374
|
+
async removeChildren(parentId, documentIds, view, signal) {
|
|
375
|
+
const createdAtUtcIso = new Date().toISOString();
|
|
376
|
+
const jobId = uuidv4();
|
|
377
|
+
// Check abort signal before starting
|
|
378
|
+
if (signal?.aborted) {
|
|
379
|
+
throw new AbortError();
|
|
380
|
+
}
|
|
381
|
+
// TODO: Implement when drive server supports hierarchical documents
|
|
382
|
+
// For now, this is a placeholder implementation
|
|
383
|
+
// Verify parent exists
|
|
384
|
+
try {
|
|
385
|
+
await this.driveServer.getDocument(parentId);
|
|
386
|
+
}
|
|
387
|
+
catch (error) {
|
|
388
|
+
return {
|
|
389
|
+
id: jobId,
|
|
390
|
+
status: JobStatus.FAILED,
|
|
391
|
+
createdAtUtcIso,
|
|
392
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
// Check abort signal after parent verification
|
|
396
|
+
if (signal?.aborted) {
|
|
397
|
+
throw new AbortError();
|
|
398
|
+
}
|
|
399
|
+
// TODO: Actually remove parent-child relationships
|
|
400
|
+
// Return success job info
|
|
401
|
+
return {
|
|
402
|
+
id: jobId,
|
|
403
|
+
status: JobStatus.COMPLETED,
|
|
404
|
+
createdAtUtcIso,
|
|
405
|
+
completedAtUtcIso: new Date().toISOString(),
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Retrieves the status of a job
|
|
410
|
+
*/
|
|
411
|
+
getJobStatus(jobId, signal) {
|
|
412
|
+
const createdAtUtcIso = new Date().toISOString();
|
|
413
|
+
if (signal?.aborted) {
|
|
414
|
+
throw new AbortError();
|
|
415
|
+
}
|
|
416
|
+
// TODO: Phase 3 - Implement once IQueue and job tracking is in place
|
|
417
|
+
// For now, return a not found status
|
|
418
|
+
return Promise.resolve({
|
|
419
|
+
id: jobId,
|
|
420
|
+
status: JobStatus.FAILED,
|
|
421
|
+
createdAtUtcIso,
|
|
422
|
+
completedAtUtcIso: new Date().toISOString(),
|
|
423
|
+
error: "Job tracking not yet implemented",
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Finds documents by their IDs
|
|
428
|
+
*/
|
|
429
|
+
async findByIds(ids, view, paging, signal) {
|
|
430
|
+
const documents = [];
|
|
431
|
+
// Fetch each document by ID using storage directly
|
|
432
|
+
for (const id of ids) {
|
|
433
|
+
if (signal?.aborted) {
|
|
434
|
+
throw new AbortError();
|
|
435
|
+
}
|
|
436
|
+
let document;
|
|
437
|
+
try {
|
|
438
|
+
document = await this.documentStorage.get(id);
|
|
439
|
+
}
|
|
440
|
+
catch {
|
|
441
|
+
// Skip documents that don't exist or can't be accessed
|
|
442
|
+
// This matches the behavior expected from a search operation
|
|
443
|
+
continue;
|
|
444
|
+
}
|
|
445
|
+
// Apply view filter - This will be removed when we pass the viewfilter along
|
|
446
|
+
// to the underlying store, but is here now for the interface.
|
|
447
|
+
for (const scope in document.state) {
|
|
448
|
+
if (!matchesScope(view, scope)) {
|
|
449
|
+
delete document.state[scope];
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
documents.push(document);
|
|
453
|
+
}
|
|
454
|
+
if (signal?.aborted) {
|
|
455
|
+
throw new AbortError();
|
|
456
|
+
}
|
|
457
|
+
// Apply paging
|
|
458
|
+
const startIndex = paging ? parseInt(paging.cursor) || 0 : 0;
|
|
459
|
+
const limit = paging?.limit || documents.length;
|
|
460
|
+
const pagedDocuments = documents.slice(startIndex, startIndex + limit);
|
|
461
|
+
// Create paged results
|
|
462
|
+
const hasMore = startIndex + limit < documents.length;
|
|
463
|
+
const nextCursor = hasMore ? String(startIndex + limit) : undefined;
|
|
464
|
+
return {
|
|
465
|
+
results: pagedDocuments,
|
|
466
|
+
options: paging || { cursor: "0", limit: documents.length },
|
|
467
|
+
nextCursor,
|
|
468
|
+
next: hasMore
|
|
469
|
+
? () => this.findByIds(ids, view, { cursor: nextCursor, limit }, signal)
|
|
470
|
+
: undefined,
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Finds documents by their slugs
|
|
475
|
+
*/
|
|
476
|
+
async findBySlugs(slugs, view, paging, signal) {
|
|
477
|
+
const documents = [];
|
|
478
|
+
// Use storage to resolve slugs to IDs
|
|
479
|
+
let ids;
|
|
480
|
+
try {
|
|
481
|
+
ids = await this.documentStorage.resolveIds(slugs, signal);
|
|
482
|
+
}
|
|
483
|
+
catch {
|
|
484
|
+
// If slug resolution fails, return empty results
|
|
485
|
+
// This matches the behavior expected from a search operation
|
|
486
|
+
ids = [];
|
|
487
|
+
}
|
|
488
|
+
// Fetch each document by resolved ID
|
|
489
|
+
for (const id of ids) {
|
|
490
|
+
if (signal?.aborted) {
|
|
491
|
+
throw new AbortError();
|
|
492
|
+
}
|
|
493
|
+
let document;
|
|
494
|
+
try {
|
|
495
|
+
document = await this.documentStorage.get(id);
|
|
496
|
+
}
|
|
497
|
+
catch {
|
|
498
|
+
// Skip documents that don't exist or can't be accessed
|
|
499
|
+
continue;
|
|
500
|
+
}
|
|
501
|
+
// Apply view filter - This will be removed when we pass the viewfilter along
|
|
502
|
+
// to the underlying store, but is here now for the interface.
|
|
503
|
+
for (const scope in document.state) {
|
|
504
|
+
if (!matchesScope(view, scope)) {
|
|
505
|
+
delete document.state[scope];
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
documents.push(document);
|
|
509
|
+
}
|
|
510
|
+
if (signal?.aborted) {
|
|
511
|
+
throw new AbortError();
|
|
512
|
+
}
|
|
513
|
+
// Apply paging - this will be removed when we pass the paging along
|
|
514
|
+
// to the underlying store, but is here now for the interface.
|
|
515
|
+
const startIndex = paging ? parseInt(paging.cursor) || 0 : 0;
|
|
516
|
+
const limit = paging?.limit || documents.length;
|
|
517
|
+
const pagedDocuments = documents.slice(startIndex, startIndex + limit);
|
|
518
|
+
// Create paged results
|
|
519
|
+
const hasMore = startIndex + limit < documents.length;
|
|
520
|
+
const nextCursor = hasMore ? String(startIndex + limit) : undefined;
|
|
521
|
+
return {
|
|
522
|
+
results: pagedDocuments,
|
|
523
|
+
options: paging || { cursor: "0", limit: documents.length },
|
|
524
|
+
nextCursor,
|
|
525
|
+
next: hasMore
|
|
526
|
+
? () => this.findBySlugs(slugs, view, { cursor: nextCursor, limit }, signal)
|
|
527
|
+
: undefined,
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Finds documents by parent ID
|
|
532
|
+
*/
|
|
533
|
+
async findByParentId(parentId, view, paging, signal) {
|
|
534
|
+
// Get child document IDs from storage
|
|
535
|
+
const childIds = await this.documentStorage.getChildren(parentId);
|
|
536
|
+
if (signal?.aborted) {
|
|
537
|
+
throw new AbortError();
|
|
538
|
+
}
|
|
539
|
+
const documents = [];
|
|
540
|
+
// Fetch each child document
|
|
541
|
+
for (const childId of childIds) {
|
|
542
|
+
if (signal?.aborted) {
|
|
543
|
+
throw new AbortError();
|
|
544
|
+
}
|
|
545
|
+
let document;
|
|
546
|
+
try {
|
|
547
|
+
document = await this.documentStorage.get(childId);
|
|
548
|
+
}
|
|
549
|
+
catch {
|
|
550
|
+
// Skip documents that don't exist or can't be accessed
|
|
551
|
+
// This matches the behavior expected from a search operation
|
|
552
|
+
continue;
|
|
553
|
+
}
|
|
554
|
+
// Apply view filter - This will be removed when we pass the viewfilter along
|
|
555
|
+
// to the underlying store, but is here now for the interface.
|
|
556
|
+
for (const scope in document.state) {
|
|
557
|
+
if (!matchesScope(view, scope)) {
|
|
558
|
+
delete document.state[scope];
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
documents.push(document);
|
|
562
|
+
}
|
|
563
|
+
if (signal?.aborted) {
|
|
564
|
+
throw new AbortError();
|
|
565
|
+
}
|
|
566
|
+
// Apply paging
|
|
567
|
+
const startIndex = paging ? parseInt(paging.cursor) || 0 : 0;
|
|
568
|
+
const limit = paging?.limit || documents.length;
|
|
569
|
+
const pagedDocuments = documents.slice(startIndex, startIndex + limit);
|
|
570
|
+
// Create paged results
|
|
571
|
+
const hasMore = startIndex + limit < documents.length;
|
|
572
|
+
const nextCursor = hasMore ? String(startIndex + limit) : undefined;
|
|
573
|
+
return {
|
|
574
|
+
results: pagedDocuments,
|
|
575
|
+
options: paging || { cursor: "0", limit: documents.length },
|
|
576
|
+
nextCursor,
|
|
577
|
+
next: hasMore
|
|
578
|
+
? () => this.findByParentId(parentId, view, { cursor: nextCursor, limit }, signal)
|
|
579
|
+
: undefined,
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Finds documents by type
|
|
584
|
+
*/
|
|
585
|
+
async findByType(type, view, paging, signal) {
|
|
586
|
+
const documents = [];
|
|
587
|
+
// Use storage's findByType method directly
|
|
588
|
+
const cursor = paging?.cursor;
|
|
589
|
+
const limit = paging?.limit || 100;
|
|
590
|
+
// Get document IDs of the specified type
|
|
591
|
+
const { documents: documentIds, nextCursor } = await this.documentStorage.findByType(type, limit, cursor);
|
|
592
|
+
if (signal?.aborted) {
|
|
593
|
+
throw new AbortError();
|
|
594
|
+
}
|
|
595
|
+
// Fetch each document by its ID
|
|
596
|
+
for (const documentId of documentIds) {
|
|
597
|
+
if (signal?.aborted) {
|
|
598
|
+
throw new AbortError();
|
|
599
|
+
}
|
|
600
|
+
let document;
|
|
601
|
+
try {
|
|
602
|
+
document = await this.documentStorage.get(documentId);
|
|
603
|
+
}
|
|
604
|
+
catch {
|
|
605
|
+
// Skip documents that can't be retrieved
|
|
606
|
+
continue;
|
|
607
|
+
}
|
|
608
|
+
// Apply view filter
|
|
609
|
+
for (const scope in document.state) {
|
|
610
|
+
if (!matchesScope(view, scope)) {
|
|
611
|
+
delete document.state[scope];
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
documents.push(document);
|
|
615
|
+
}
|
|
616
|
+
if (signal?.aborted) {
|
|
617
|
+
throw new AbortError();
|
|
618
|
+
}
|
|
619
|
+
// Results are already paged from the storage layer
|
|
620
|
+
return {
|
|
621
|
+
results: documents,
|
|
622
|
+
options: paging || { cursor: cursor || "0", limit },
|
|
623
|
+
nextCursor,
|
|
624
|
+
next: nextCursor
|
|
625
|
+
? async () => this.findByType(type, view, { cursor: nextCursor, limit }, signal)
|
|
626
|
+
: undefined,
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
//# sourceMappingURL=reactor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactor.js","sourceRoot":"","sources":["../../../src/core/reactor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAS5C,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAGpC,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAUrE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE5D;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,OAAO;IACV,WAAW,CAA0B;IACrC,eAAe,CAAmB;IAClC,cAAc,CAAiB;IAC/B,WAAW,CAA2B;IACtC,KAAK,CAAS;IAEtB,YACE,WAAoC,EACpC,eAAiC,EACjC,KAAa;QAEb,8BAA8B;QAC9B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,sDAAsD;QACtD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,2BAA2B,CAAC,KAAK,CAAC,CAAC;QAC5D,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAI;QACF,+BAA+B;QAC/B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAEvB,0EAA0E;QAC1E,sDAAs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