@highstate/backend 0.9.26 → 0.9.28
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/{chunk-GJTMJQUW.js → chunk-QSHSXLO2.js} +18 -9
- package/dist/chunk-QSHSXLO2.js.map +1 -0
- package/dist/index.js +292 -132
- package/dist/index.js.map +1 -1
- package/dist/shared/index.js +1 -1
- package/package.json +3 -3
- package/prisma/backend/_schema/layout.prisma +3 -1
- package/prisma/backend/_schema/project.prisma +4 -2
- package/prisma/backend/_schema/unlock-method.prisma +19 -0
- package/prisma/backend/sqlite/migrations/{20250818082732_add_models → 20250928124105_initial_migration}/migration.sql +48 -16
- package/prisma/project/api-key.prisma +3 -1
- package/prisma/project/artifact.prisma +2 -2
- package/prisma/project/custom-status.prisma +1 -1
- package/prisma/project/layout.prisma +4 -0
- package/prisma/project/migrations/{20250816081310_initial → 20250928130725_initial_migration}/migration.sql +132 -46
- package/prisma/project/terminal.prisma +2 -2
- package/prisma/project/unlock-method.prisma +1 -1
- package/prisma/project/worker.prisma +1 -1
- package/src/business/backend-unlock.test.ts +133 -0
- package/src/business/backend-unlock.ts +76 -0
- package/src/business/index.ts +1 -0
- package/src/business/settings.test.ts +3 -2
- package/src/database/_generated/backend/postgresql/client.ts +9 -4
- package/src/database/_generated/backend/postgresql/internal/class.ts +147 -168
- package/src/database/_generated/backend/postgresql/internal/prismaNamespace.ts +127 -40
- package/src/database/_generated/backend/postgresql/models/BackendUnlockMethod.ts +1156 -0
- package/src/database/_generated/backend/postgresql/models/Project.ts +2 -2
- package/src/database/_generated/backend/postgresql/models/ProjectSpace.ts +7 -1
- package/src/database/_generated/backend/postgresql/models/UserWorkspaceLayout.ts +1067 -0
- package/src/database/_generated/backend/postgresql/models.ts +2 -1
- package/src/database/_generated/backend/sqlite/client.ts +9 -4
- package/src/database/_generated/backend/sqlite/internal/class.ts +146 -165
- package/src/database/_generated/backend/sqlite/internal/prismaNamespace.ts +127 -40
- package/src/database/_generated/backend/sqlite/models/BackendUnlockMethod.ts +1154 -0
- package/src/database/_generated/backend/sqlite/models/Project.ts +2 -2
- package/src/database/_generated/backend/sqlite/models/ProjectSpace.ts +7 -1
- package/src/database/_generated/backend/sqlite/models/UserWorkspaceLayout.ts +1065 -0
- package/src/database/_generated/backend/sqlite/models.ts +2 -1
- package/src/database/_generated/project/commonInputTypes.ts +26 -26
- package/src/database/_generated/project/internal/class.ts +7 -8
- package/src/database/_generated/project/internal/prismaNamespace.ts +8 -7
- package/src/database/_generated/project/models/ApiKey.ts +2 -0
- package/src/database/_generated/project/models/Artifact.ts +2 -2
- package/src/database/_generated/project/models/InstanceCustomStatus.ts +1 -1
- package/src/database/_generated/project/models/OperationLog.ts +49 -1
- package/src/database/_generated/project/models/UnlockMethod.ts +2 -2
- package/src/database/_generated/project/models/UserCompositeViewport.ts +16 -14
- package/src/database/_generated/project/models/UserProjectViewport.ts +11 -9
- package/src/database/_generated/project/models/WorkerVersion.ts +1 -5
- package/src/database/abstractions.ts +25 -3
- package/src/database/factory.ts +5 -6
- package/src/database/local/backend.ts +148 -18
- package/src/database/manager.ts +30 -2
- package/src/database/prisma.ts +1 -0
- package/src/orchestrator/operation-plan.ts +0 -19
- package/src/orchestrator/operation.ts +21 -4
- package/src/services.ts +12 -3
- package/src/shared/models/backend/unlock-method.ts +7 -13
- package/src/shared/models/errors.ts +14 -0
- package/src/shared/models/prisma.ts +10 -2
- package/src/test-utils/database.ts +34 -6
- package/dist/chunk-GJTMJQUW.js.map +0 -1
- package/prisma/backend/sqlite/migrations/20250817070609_initiial/migration.sql +0 -34
- package/prisma/backend/sqlite/migrations/20250817104948_add_fields/migration.sql +0 -59
- package/prisma/backend/sqlite/migrations/20250818083106_a/migration.sql +0 -19
- package/prisma/backend/sqlite/migrations/20250818101945_hi/migration.sql +0 -1
- package/prisma/backend/sqlite/migrations/20250819082315_a/migration.sql +0 -5
- package/prisma/project/migrations/20250816082523_test/migration.sql +0 -72
- package/prisma/project/migrations/20250818065643_update/migration.sql +0 -42
- package/prisma/project/migrations/20250818070758_a/migration.sql +0 -8
- package/prisma/project/migrations/20250818070913_a/migration.sql +0 -8
- package/prisma/project/migrations/20250818082720_add_motels/migration.sql +0 -11
- package/prisma/project/migrations/20250818112523_hello/migration.sql +0 -35
- package/prisma/project/migrations/20250819082305_a/migration.sql +0 -14
- package/prisma/project/migrations/20250819165004_add_missing_fields/migration.sql +0 -216
- package/prisma/project/migrations/20250819171309_a/migration.sql +0 -22
- package/prisma/project/migrations/20250820113949_a/migration.sql +0 -66
- package/prisma/project/migrations/20250820144256_b/migration.sql +0 -31
- package/prisma/project/migrations/20250820145547_a/migration.sql +0 -24
- package/prisma/project/migrations/20250820182517_b/migration.sql +0 -2
- package/prisma/project/migrations/20250821172324_a/migration.sql +0 -2
- package/prisma/project/migrations/20250822081339_a/migration.sql +0 -219
- package/prisma/project/migrations/20250822083742_b/migration.sql +0 -1
- package/prisma/project/migrations/20250822105134_boom/migration.sql +0 -1
- package/prisma/project/migrations/20250822141028_b/migration.sql +0 -1
- package/prisma/project/migrations/20250822142342_b/migration.sql +0 -16
- package/prisma/project/migrations/20250824072720_a/migration.sql +0 -1
- package/prisma/project/migrations/20250824093656_b/migration.sql +0 -21
- package/prisma/project/migrations/20250825082518_a/migration.sql +0 -1
- package/prisma/project/migrations/20250825085343_b/migration.sql +0 -1
- package/prisma/project/migrations/20250825091312_a/migration.sql +0 -1
- package/prisma/project/migrations/20250903095431_hi/migration.sql +0 -44
- package/prisma/project/migrations/20250903174255_a/migration.sql +0 -24
- package/prisma/project/migrations/20250908095205_hi/migration.sql +0 -18
- package/prisma/project/migrations/20250909155857_hi/migration.sql +0 -15
- package/prisma/project/migrations/20250921092621_b/migration.sql +0 -33
- package/prisma/project/migrations/20250921093911_b/migration.sql +0 -1
- package/src/database/_generated/backend/postgresql/models/UserWorkspaseLayout.ts +0 -1065
- package/src/database/_generated/backend/sqlite/models/UserWorkspaseLayout.ts +0 -1063
|
@@ -29,6 +29,7 @@ export type OperationLogMinAggregateOutputType = {
|
|
|
29
29
|
id: string | null
|
|
30
30
|
operationId: string | null
|
|
31
31
|
stateId: string | null
|
|
32
|
+
isSystem: boolean | null
|
|
32
33
|
content: string | null
|
|
33
34
|
}
|
|
34
35
|
|
|
@@ -36,6 +37,7 @@ export type OperationLogMaxAggregateOutputType = {
|
|
|
36
37
|
id: string | null
|
|
37
38
|
operationId: string | null
|
|
38
39
|
stateId: string | null
|
|
40
|
+
isSystem: boolean | null
|
|
39
41
|
content: string | null
|
|
40
42
|
}
|
|
41
43
|
|
|
@@ -43,6 +45,7 @@ export type OperationLogCountAggregateOutputType = {
|
|
|
43
45
|
id: number
|
|
44
46
|
operationId: number
|
|
45
47
|
stateId: number
|
|
48
|
+
isSystem: number
|
|
46
49
|
content: number
|
|
47
50
|
_all: number
|
|
48
51
|
}
|
|
@@ -52,6 +55,7 @@ export type OperationLogMinAggregateInputType = {
|
|
|
52
55
|
id?: true
|
|
53
56
|
operationId?: true
|
|
54
57
|
stateId?: true
|
|
58
|
+
isSystem?: true
|
|
55
59
|
content?: true
|
|
56
60
|
}
|
|
57
61
|
|
|
@@ -59,6 +63,7 @@ export type OperationLogMaxAggregateInputType = {
|
|
|
59
63
|
id?: true
|
|
60
64
|
operationId?: true
|
|
61
65
|
stateId?: true
|
|
66
|
+
isSystem?: true
|
|
62
67
|
content?: true
|
|
63
68
|
}
|
|
64
69
|
|
|
@@ -66,6 +71,7 @@ export type OperationLogCountAggregateInputType = {
|
|
|
66
71
|
id?: true
|
|
67
72
|
operationId?: true
|
|
68
73
|
stateId?: true
|
|
74
|
+
isSystem?: true
|
|
69
75
|
content?: true
|
|
70
76
|
_all?: true
|
|
71
77
|
}
|
|
@@ -146,6 +152,7 @@ export type OperationLogGroupByOutputType = {
|
|
|
146
152
|
id: string
|
|
147
153
|
operationId: string
|
|
148
154
|
stateId: string | null
|
|
155
|
+
isSystem: boolean
|
|
149
156
|
content: string
|
|
150
157
|
_count: OperationLogCountAggregateOutputType | null
|
|
151
158
|
_min: OperationLogMinAggregateOutputType | null
|
|
@@ -174,6 +181,7 @@ export type OperationLogWhereInput = {
|
|
|
174
181
|
id?: Prisma.StringFilter<"OperationLog"> | string
|
|
175
182
|
operationId?: Prisma.StringFilter<"OperationLog"> | string
|
|
176
183
|
stateId?: Prisma.StringNullableFilter<"OperationLog"> | string | null
|
|
184
|
+
isSystem?: Prisma.BoolFilter<"OperationLog"> | boolean
|
|
177
185
|
content?: Prisma.StringFilter<"OperationLog"> | string
|
|
178
186
|
operation?: Prisma.XOR<Prisma.OperationScalarRelationFilter, Prisma.OperationWhereInput>
|
|
179
187
|
state?: Prisma.XOR<Prisma.InstanceStateNullableScalarRelationFilter, Prisma.InstanceStateWhereInput> | null
|
|
@@ -183,6 +191,7 @@ export type OperationLogOrderByWithRelationInput = {
|
|
|
183
191
|
id?: Prisma.SortOrder
|
|
184
192
|
operationId?: Prisma.SortOrder
|
|
185
193
|
stateId?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
194
|
+
isSystem?: Prisma.SortOrder
|
|
186
195
|
content?: Prisma.SortOrder
|
|
187
196
|
operation?: Prisma.OperationOrderByWithRelationInput
|
|
188
197
|
state?: Prisma.InstanceStateOrderByWithRelationInput
|
|
@@ -195,6 +204,7 @@ export type OperationLogWhereUniqueInput = Prisma.AtLeast<{
|
|
|
195
204
|
NOT?: Prisma.OperationLogWhereInput | Prisma.OperationLogWhereInput[]
|
|
196
205
|
operationId?: Prisma.StringFilter<"OperationLog"> | string
|
|
197
206
|
stateId?: Prisma.StringNullableFilter<"OperationLog"> | string | null
|
|
207
|
+
isSystem?: Prisma.BoolFilter<"OperationLog"> | boolean
|
|
198
208
|
content?: Prisma.StringFilter<"OperationLog"> | string
|
|
199
209
|
operation?: Prisma.XOR<Prisma.OperationScalarRelationFilter, Prisma.OperationWhereInput>
|
|
200
210
|
state?: Prisma.XOR<Prisma.InstanceStateNullableScalarRelationFilter, Prisma.InstanceStateWhereInput> | null
|
|
@@ -204,6 +214,7 @@ export type OperationLogOrderByWithAggregationInput = {
|
|
|
204
214
|
id?: Prisma.SortOrder
|
|
205
215
|
operationId?: Prisma.SortOrder
|
|
206
216
|
stateId?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
217
|
+
isSystem?: Prisma.SortOrder
|
|
207
218
|
content?: Prisma.SortOrder
|
|
208
219
|
_count?: Prisma.OperationLogCountOrderByAggregateInput
|
|
209
220
|
_max?: Prisma.OperationLogMaxOrderByAggregateInput
|
|
@@ -217,11 +228,13 @@ export type OperationLogScalarWhereWithAggregatesInput = {
|
|
|
217
228
|
id?: Prisma.StringWithAggregatesFilter<"OperationLog"> | string
|
|
218
229
|
operationId?: Prisma.StringWithAggregatesFilter<"OperationLog"> | string
|
|
219
230
|
stateId?: Prisma.StringNullableWithAggregatesFilter<"OperationLog"> | string | null
|
|
231
|
+
isSystem?: Prisma.BoolWithAggregatesFilter<"OperationLog"> | boolean
|
|
220
232
|
content?: Prisma.StringWithAggregatesFilter<"OperationLog"> | string
|
|
221
233
|
}
|
|
222
234
|
|
|
223
235
|
export type OperationLogCreateInput = {
|
|
224
236
|
id: string
|
|
237
|
+
isSystem?: boolean
|
|
225
238
|
content: string
|
|
226
239
|
operation: Prisma.OperationCreateNestedOneWithoutLogsInput
|
|
227
240
|
state?: Prisma.InstanceStateCreateNestedOneWithoutOperationLogsInput
|
|
@@ -231,11 +244,13 @@ export type OperationLogUncheckedCreateInput = {
|
|
|
231
244
|
id: string
|
|
232
245
|
operationId: string
|
|
233
246
|
stateId?: string | null
|
|
247
|
+
isSystem?: boolean
|
|
234
248
|
content: string
|
|
235
249
|
}
|
|
236
250
|
|
|
237
251
|
export type OperationLogUpdateInput = {
|
|
238
252
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
253
|
+
isSystem?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
239
254
|
content?: Prisma.StringFieldUpdateOperationsInput | string
|
|
240
255
|
operation?: Prisma.OperationUpdateOneRequiredWithoutLogsNestedInput
|
|
241
256
|
state?: Prisma.InstanceStateUpdateOneWithoutOperationLogsNestedInput
|
|
@@ -245,6 +260,7 @@ export type OperationLogUncheckedUpdateInput = {
|
|
|
245
260
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
246
261
|
operationId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
247
262
|
stateId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
263
|
+
isSystem?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
248
264
|
content?: Prisma.StringFieldUpdateOperationsInput | string
|
|
249
265
|
}
|
|
250
266
|
|
|
@@ -252,11 +268,13 @@ export type OperationLogCreateManyInput = {
|
|
|
252
268
|
id: string
|
|
253
269
|
operationId: string
|
|
254
270
|
stateId?: string | null
|
|
271
|
+
isSystem?: boolean
|
|
255
272
|
content: string
|
|
256
273
|
}
|
|
257
274
|
|
|
258
275
|
export type OperationLogUpdateManyMutationInput = {
|
|
259
276
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
277
|
+
isSystem?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
260
278
|
content?: Prisma.StringFieldUpdateOperationsInput | string
|
|
261
279
|
}
|
|
262
280
|
|
|
@@ -264,6 +282,7 @@ export type OperationLogUncheckedUpdateManyInput = {
|
|
|
264
282
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
265
283
|
operationId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
266
284
|
stateId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
285
|
+
isSystem?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
267
286
|
content?: Prisma.StringFieldUpdateOperationsInput | string
|
|
268
287
|
}
|
|
269
288
|
|
|
@@ -281,6 +300,7 @@ export type OperationLogCountOrderByAggregateInput = {
|
|
|
281
300
|
id?: Prisma.SortOrder
|
|
282
301
|
operationId?: Prisma.SortOrder
|
|
283
302
|
stateId?: Prisma.SortOrder
|
|
303
|
+
isSystem?: Prisma.SortOrder
|
|
284
304
|
content?: Prisma.SortOrder
|
|
285
305
|
}
|
|
286
306
|
|
|
@@ -288,6 +308,7 @@ export type OperationLogMaxOrderByAggregateInput = {
|
|
|
288
308
|
id?: Prisma.SortOrder
|
|
289
309
|
operationId?: Prisma.SortOrder
|
|
290
310
|
stateId?: Prisma.SortOrder
|
|
311
|
+
isSystem?: Prisma.SortOrder
|
|
291
312
|
content?: Prisma.SortOrder
|
|
292
313
|
}
|
|
293
314
|
|
|
@@ -295,6 +316,7 @@ export type OperationLogMinOrderByAggregateInput = {
|
|
|
295
316
|
id?: Prisma.SortOrder
|
|
296
317
|
operationId?: Prisma.SortOrder
|
|
297
318
|
stateId?: Prisma.SortOrder
|
|
319
|
+
isSystem?: Prisma.SortOrder
|
|
298
320
|
content?: Prisma.SortOrder
|
|
299
321
|
}
|
|
300
322
|
|
|
@@ -382,8 +404,13 @@ export type OperationLogUncheckedUpdateManyWithoutOperationNestedInput = {
|
|
|
382
404
|
deleteMany?: Prisma.OperationLogScalarWhereInput | Prisma.OperationLogScalarWhereInput[]
|
|
383
405
|
}
|
|
384
406
|
|
|
407
|
+
export type BoolFieldUpdateOperationsInput = {
|
|
408
|
+
set?: boolean
|
|
409
|
+
}
|
|
410
|
+
|
|
385
411
|
export type OperationLogCreateWithoutStateInput = {
|
|
386
412
|
id: string
|
|
413
|
+
isSystem?: boolean
|
|
387
414
|
content: string
|
|
388
415
|
operation: Prisma.OperationCreateNestedOneWithoutLogsInput
|
|
389
416
|
}
|
|
@@ -391,6 +418,7 @@ export type OperationLogCreateWithoutStateInput = {
|
|
|
391
418
|
export type OperationLogUncheckedCreateWithoutStateInput = {
|
|
392
419
|
id: string
|
|
393
420
|
operationId: string
|
|
421
|
+
isSystem?: boolean
|
|
394
422
|
content: string
|
|
395
423
|
}
|
|
396
424
|
|
|
@@ -426,11 +454,13 @@ export type OperationLogScalarWhereInput = {
|
|
|
426
454
|
id?: Prisma.StringFilter<"OperationLog"> | string
|
|
427
455
|
operationId?: Prisma.StringFilter<"OperationLog"> | string
|
|
428
456
|
stateId?: Prisma.StringNullableFilter<"OperationLog"> | string | null
|
|
457
|
+
isSystem?: Prisma.BoolFilter<"OperationLog"> | boolean
|
|
429
458
|
content?: Prisma.StringFilter<"OperationLog"> | string
|
|
430
459
|
}
|
|
431
460
|
|
|
432
461
|
export type OperationLogCreateWithoutOperationInput = {
|
|
433
462
|
id: string
|
|
463
|
+
isSystem?: boolean
|
|
434
464
|
content: string
|
|
435
465
|
state?: Prisma.InstanceStateCreateNestedOneWithoutOperationLogsInput
|
|
436
466
|
}
|
|
@@ -438,6 +468,7 @@ export type OperationLogCreateWithoutOperationInput = {
|
|
|
438
468
|
export type OperationLogUncheckedCreateWithoutOperationInput = {
|
|
439
469
|
id: string
|
|
440
470
|
stateId?: string | null
|
|
471
|
+
isSystem?: boolean
|
|
441
472
|
content: string
|
|
442
473
|
}
|
|
443
474
|
|
|
@@ -469,11 +500,13 @@ export type OperationLogUpdateManyWithWhereWithoutOperationInput = {
|
|
|
469
500
|
export type OperationLogCreateManyStateInput = {
|
|
470
501
|
id: string
|
|
471
502
|
operationId: string
|
|
503
|
+
isSystem?: boolean
|
|
472
504
|
content: string
|
|
473
505
|
}
|
|
474
506
|
|
|
475
507
|
export type OperationLogUpdateWithoutStateInput = {
|
|
476
508
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
509
|
+
isSystem?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
477
510
|
content?: Prisma.StringFieldUpdateOperationsInput | string
|
|
478
511
|
operation?: Prisma.OperationUpdateOneRequiredWithoutLogsNestedInput
|
|
479
512
|
}
|
|
@@ -481,23 +514,27 @@ export type OperationLogUpdateWithoutStateInput = {
|
|
|
481
514
|
export type OperationLogUncheckedUpdateWithoutStateInput = {
|
|
482
515
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
483
516
|
operationId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
517
|
+
isSystem?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
484
518
|
content?: Prisma.StringFieldUpdateOperationsInput | string
|
|
485
519
|
}
|
|
486
520
|
|
|
487
521
|
export type OperationLogUncheckedUpdateManyWithoutStateInput = {
|
|
488
522
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
489
523
|
operationId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
524
|
+
isSystem?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
490
525
|
content?: Prisma.StringFieldUpdateOperationsInput | string
|
|
491
526
|
}
|
|
492
527
|
|
|
493
528
|
export type OperationLogCreateManyOperationInput = {
|
|
494
529
|
id: string
|
|
495
530
|
stateId?: string | null
|
|
531
|
+
isSystem?: boolean
|
|
496
532
|
content: string
|
|
497
533
|
}
|
|
498
534
|
|
|
499
535
|
export type OperationLogUpdateWithoutOperationInput = {
|
|
500
536
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
537
|
+
isSystem?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
501
538
|
content?: Prisma.StringFieldUpdateOperationsInput | string
|
|
502
539
|
state?: Prisma.InstanceStateUpdateOneWithoutOperationLogsNestedInput
|
|
503
540
|
}
|
|
@@ -505,12 +542,14 @@ export type OperationLogUpdateWithoutOperationInput = {
|
|
|
505
542
|
export type OperationLogUncheckedUpdateWithoutOperationInput = {
|
|
506
543
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
507
544
|
stateId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
545
|
+
isSystem?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
508
546
|
content?: Prisma.StringFieldUpdateOperationsInput | string
|
|
509
547
|
}
|
|
510
548
|
|
|
511
549
|
export type OperationLogUncheckedUpdateManyWithoutOperationInput = {
|
|
512
550
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
513
551
|
stateId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
552
|
+
isSystem?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
514
553
|
content?: Prisma.StringFieldUpdateOperationsInput | string
|
|
515
554
|
}
|
|
516
555
|
|
|
@@ -520,6 +559,7 @@ export type OperationLogSelect<ExtArgs extends runtime.Types.Extensions.Internal
|
|
|
520
559
|
id?: boolean
|
|
521
560
|
operationId?: boolean
|
|
522
561
|
stateId?: boolean
|
|
562
|
+
isSystem?: boolean
|
|
523
563
|
content?: boolean
|
|
524
564
|
operation?: boolean | Prisma.OperationDefaultArgs<ExtArgs>
|
|
525
565
|
state?: boolean | Prisma.OperationLog$stateArgs<ExtArgs>
|
|
@@ -529,6 +569,7 @@ export type OperationLogSelectCreateManyAndReturn<ExtArgs extends runtime.Types.
|
|
|
529
569
|
id?: boolean
|
|
530
570
|
operationId?: boolean
|
|
531
571
|
stateId?: boolean
|
|
572
|
+
isSystem?: boolean
|
|
532
573
|
content?: boolean
|
|
533
574
|
operation?: boolean | Prisma.OperationDefaultArgs<ExtArgs>
|
|
534
575
|
state?: boolean | Prisma.OperationLog$stateArgs<ExtArgs>
|
|
@@ -538,6 +579,7 @@ export type OperationLogSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.
|
|
|
538
579
|
id?: boolean
|
|
539
580
|
operationId?: boolean
|
|
540
581
|
stateId?: boolean
|
|
582
|
+
isSystem?: boolean
|
|
541
583
|
content?: boolean
|
|
542
584
|
operation?: boolean | Prisma.OperationDefaultArgs<ExtArgs>
|
|
543
585
|
state?: boolean | Prisma.OperationLog$stateArgs<ExtArgs>
|
|
@@ -547,10 +589,11 @@ export type OperationLogSelectScalar = {
|
|
|
547
589
|
id?: boolean
|
|
548
590
|
operationId?: boolean
|
|
549
591
|
stateId?: boolean
|
|
592
|
+
isSystem?: boolean
|
|
550
593
|
content?: boolean
|
|
551
594
|
}
|
|
552
595
|
|
|
553
|
-
export type OperationLogOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "operationId" | "stateId" | "content", ExtArgs["result"]["operationLog"]>
|
|
596
|
+
export type OperationLogOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "operationId" | "stateId" | "isSystem" | "content", ExtArgs["result"]["operationLog"]>
|
|
554
597
|
export type OperationLogInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
|
555
598
|
operation?: boolean | Prisma.OperationDefaultArgs<ExtArgs>
|
|
556
599
|
state?: boolean | Prisma.OperationLog$stateArgs<ExtArgs>
|
|
@@ -591,6 +634,10 @@ export type $OperationLogPayload<ExtArgs extends runtime.Types.Extensions.Intern
|
|
|
591
634
|
* Can be `null` if the log is not associated with any instance.
|
|
592
635
|
*/
|
|
593
636
|
stateId: string | null
|
|
637
|
+
/**
|
|
638
|
+
* Whether this log is a system/runtime message (vs unit output).
|
|
639
|
+
*/
|
|
640
|
+
isSystem: boolean
|
|
594
641
|
/**
|
|
595
642
|
* The content of the log.
|
|
596
643
|
*/
|
|
@@ -1023,6 +1070,7 @@ export interface OperationLogFieldRefs {
|
|
|
1023
1070
|
readonly id: Prisma.FieldRef<"OperationLog", 'String'>
|
|
1024
1071
|
readonly operationId: Prisma.FieldRef<"OperationLog", 'String'>
|
|
1025
1072
|
readonly stateId: Prisma.FieldRef<"OperationLog", 'String'>
|
|
1073
|
+
readonly isSystem: Prisma.FieldRef<"OperationLog", 'Boolean'>
|
|
1026
1074
|
readonly content: Prisma.FieldRef<"OperationLog", 'String'>
|
|
1027
1075
|
}
|
|
1028
1076
|
|
|
@@ -221,16 +221,16 @@ export type UnlockMethodOrderByWithRelationInput = {
|
|
|
221
221
|
|
|
222
222
|
export type UnlockMethodWhereUniqueInput = Prisma.AtLeast<{
|
|
223
223
|
id?: string
|
|
224
|
+
recipient?: string
|
|
224
225
|
AND?: Prisma.UnlockMethodWhereInput | Prisma.UnlockMethodWhereInput[]
|
|
225
226
|
OR?: Prisma.UnlockMethodWhereInput[]
|
|
226
227
|
NOT?: Prisma.UnlockMethodWhereInput | Prisma.UnlockMethodWhereInput[]
|
|
227
228
|
meta?: Prisma.JsonFilter<"UnlockMethod">
|
|
228
229
|
type?: Prisma.EnumUnlockMethodTypeFilter<"UnlockMethod"> | $Enums.UnlockMethodType
|
|
229
230
|
encryptedIdentity?: Prisma.StringFilter<"UnlockMethod"> | string
|
|
230
|
-
recipient?: Prisma.StringFilter<"UnlockMethod"> | string
|
|
231
231
|
createdAt?: Prisma.DateTimeFilter<"UnlockMethod"> | Date | string
|
|
232
232
|
updatedAt?: Prisma.DateTimeFilter<"UnlockMethod"> | Date | string
|
|
233
|
-
}, "id">
|
|
233
|
+
}, "id" | "recipient">
|
|
234
234
|
|
|
235
235
|
export type UnlockMethodOrderByWithAggregationInput = {
|
|
236
236
|
id?: Prisma.SortOrder
|
|
@@ -135,7 +135,7 @@ export type UserCompositeViewportGroupByArgs<ExtArgs extends runtime.Types.Exten
|
|
|
135
135
|
export type UserCompositeViewportGroupByOutputType = {
|
|
136
136
|
userId: string
|
|
137
137
|
stateId: string
|
|
138
|
-
viewport: unknown
|
|
138
|
+
viewport: (unknown)
|
|
139
139
|
_count: UserCompositeViewportCountAggregateOutputType | null
|
|
140
140
|
_min: UserCompositeViewportMinAggregateOutputType | null
|
|
141
141
|
_max: UserCompositeViewportMaxAggregateOutputType | null
|
|
@@ -204,43 +204,43 @@ export type UserCompositeViewportScalarWhereWithAggregatesInput = {
|
|
|
204
204
|
|
|
205
205
|
export type UserCompositeViewportCreateInput = {
|
|
206
206
|
userId: string
|
|
207
|
-
viewport: unknown
|
|
207
|
+
viewport: (unknown)
|
|
208
208
|
state: Prisma.InstanceStateCreateNestedOneWithoutUserViewportsInput
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
export type UserCompositeViewportUncheckedCreateInput = {
|
|
212
212
|
userId: string
|
|
213
213
|
stateId: string
|
|
214
|
-
viewport: unknown
|
|
214
|
+
viewport: (unknown)
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
export type UserCompositeViewportUpdateInput = {
|
|
218
218
|
userId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
219
|
-
viewport?: unknown
|
|
219
|
+
viewport?: (unknown)
|
|
220
220
|
state?: Prisma.InstanceStateUpdateOneRequiredWithoutUserViewportsNestedInput
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
export type UserCompositeViewportUncheckedUpdateInput = {
|
|
224
224
|
userId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
225
225
|
stateId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
226
|
-
viewport?: unknown
|
|
226
|
+
viewport?: (unknown)
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
export type UserCompositeViewportCreateManyInput = {
|
|
230
230
|
userId: string
|
|
231
231
|
stateId: string
|
|
232
|
-
viewport: unknown
|
|
232
|
+
viewport: (unknown)
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
export type UserCompositeViewportUpdateManyMutationInput = {
|
|
236
236
|
userId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
237
|
-
viewport?: unknown
|
|
237
|
+
viewport?: (unknown)
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
export type UserCompositeViewportUncheckedUpdateManyInput = {
|
|
241
241
|
userId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
242
242
|
stateId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
243
|
-
viewport?: unknown
|
|
243
|
+
viewport?: (unknown)
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
export type UserCompositeViewportListRelationFilter = {
|
|
@@ -318,12 +318,12 @@ export type UserCompositeViewportUncheckedUpdateManyWithoutStateNestedInput = {
|
|
|
318
318
|
|
|
319
319
|
export type UserCompositeViewportCreateWithoutStateInput = {
|
|
320
320
|
userId: string
|
|
321
|
-
viewport: unknown
|
|
321
|
+
viewport: (unknown)
|
|
322
322
|
}
|
|
323
323
|
|
|
324
324
|
export type UserCompositeViewportUncheckedCreateWithoutStateInput = {
|
|
325
325
|
userId: string
|
|
326
|
-
viewport: unknown
|
|
326
|
+
viewport: (unknown)
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
export type UserCompositeViewportCreateOrConnectWithoutStateInput = {
|
|
@@ -362,17 +362,17 @@ export type UserCompositeViewportScalarWhereInput = {
|
|
|
362
362
|
|
|
363
363
|
export type UserCompositeViewportCreateManyStateInput = {
|
|
364
364
|
userId: string
|
|
365
|
-
viewport: unknown
|
|
365
|
+
viewport: (unknown)
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
export type UserCompositeViewportUpdateWithoutStateInput = {
|
|
369
369
|
userId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
370
|
-
viewport?: unknown
|
|
370
|
+
viewport?: (unknown)
|
|
371
371
|
}
|
|
372
372
|
|
|
373
373
|
export type UserCompositeViewportUncheckedUpdateWithoutStateInput = {
|
|
374
374
|
userId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
375
|
-
viewport?: unknown
|
|
375
|
+
viewport?: (unknown)
|
|
376
376
|
}
|
|
377
377
|
|
|
378
378
|
export type UserCompositeViewportUncheckedUpdateManyWithoutStateInput = {
|
|
@@ -439,8 +439,10 @@ export type $UserCompositeViewportPayload<ExtArgs extends runtime.Types.Extensio
|
|
|
439
439
|
stateId: string
|
|
440
440
|
/**
|
|
441
441
|
* The viewport of the user composite instance managed by the frontend.
|
|
442
|
+
*
|
|
443
|
+
* ![unknown]
|
|
442
444
|
*/
|
|
443
|
-
viewport: unknown
|
|
445
|
+
viewport: (unknown)
|
|
444
446
|
}, ExtArgs["result"]["userCompositeViewport"]>
|
|
445
447
|
composites: {}
|
|
446
448
|
}
|
|
@@ -128,7 +128,7 @@ export type UserProjectViewportGroupByArgs<ExtArgs extends runtime.Types.Extensi
|
|
|
128
128
|
|
|
129
129
|
export type UserProjectViewportGroupByOutputType = {
|
|
130
130
|
userId: string
|
|
131
|
-
viewport: unknown
|
|
131
|
+
viewport: (unknown)
|
|
132
132
|
_count: UserProjectViewportCountAggregateOutputType | null
|
|
133
133
|
_min: UserProjectViewportMinAggregateOutputType | null
|
|
134
134
|
_max: UserProjectViewportMaxAggregateOutputType | null
|
|
@@ -188,37 +188,37 @@ export type UserProjectViewportScalarWhereWithAggregatesInput = {
|
|
|
188
188
|
|
|
189
189
|
export type UserProjectViewportCreateInput = {
|
|
190
190
|
userId: string
|
|
191
|
-
viewport: unknown
|
|
191
|
+
viewport: (unknown)
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
export type UserProjectViewportUncheckedCreateInput = {
|
|
195
195
|
userId: string
|
|
196
|
-
viewport: unknown
|
|
196
|
+
viewport: (unknown)
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
export type UserProjectViewportUpdateInput = {
|
|
200
200
|
userId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
201
|
-
viewport?: unknown
|
|
201
|
+
viewport?: (unknown)
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
export type UserProjectViewportUncheckedUpdateInput = {
|
|
205
205
|
userId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
206
|
-
viewport?: unknown
|
|
206
|
+
viewport?: (unknown)
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
export type UserProjectViewportCreateManyInput = {
|
|
210
210
|
userId: string
|
|
211
|
-
viewport: unknown
|
|
211
|
+
viewport: (unknown)
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
export type UserProjectViewportUpdateManyMutationInput = {
|
|
215
215
|
userId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
216
|
-
viewport?: unknown
|
|
216
|
+
viewport?: (unknown)
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
export type UserProjectViewportUncheckedUpdateManyInput = {
|
|
220
220
|
userId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
221
|
-
viewport?: unknown
|
|
221
|
+
viewport?: (unknown)
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
export type UserProjectViewportCountOrderByAggregateInput = {
|
|
@@ -268,8 +268,10 @@ export type $UserProjectViewportPayload<ExtArgs extends runtime.Types.Extensions
|
|
|
268
268
|
userId: string
|
|
269
269
|
/**
|
|
270
270
|
* The viewport of the user project managed by the frontend.
|
|
271
|
+
*
|
|
272
|
+
* ![unknown]
|
|
271
273
|
*/
|
|
272
|
-
viewport: unknown
|
|
274
|
+
viewport: (unknown)
|
|
273
275
|
}, ExtArgs["result"]["userProjectViewport"]>
|
|
274
276
|
composites: {}
|
|
275
277
|
}
|
|
@@ -534,10 +534,6 @@ export type EnumWorkerVersionStatusFieldUpdateOperationsInput = {
|
|
|
534
534
|
set?: $Enums.WorkerVersionStatus
|
|
535
535
|
}
|
|
536
536
|
|
|
537
|
-
export type BoolFieldUpdateOperationsInput = {
|
|
538
|
-
set?: boolean
|
|
539
|
-
}
|
|
540
|
-
|
|
541
537
|
export type WorkerVersionCreateNestedOneWithoutUnitRegistrationsInput = {
|
|
542
538
|
create?: Prisma.XOR<Prisma.WorkerVersionCreateWithoutUnitRegistrationsInput, Prisma.WorkerVersionUncheckedCreateWithoutUnitRegistrationsInput>
|
|
543
539
|
connectOrCreate?: Prisma.WorkerVersionCreateOrConnectWithoutUnitRegistrationsInput
|
|
@@ -1070,7 +1066,7 @@ export type $WorkerVersionPayload<ExtArgs extends runtime.Types.Extensions.Inter
|
|
|
1070
1066
|
workerId: string
|
|
1071
1067
|
/**
|
|
1072
1068
|
* The digest of the worker version used to identify it.
|
|
1073
|
-
* The format is raw SHA256 digest without the `sha256:` prefix.
|
|
1069
|
+
* The format is raw SHA256 digest without the `sha256:` prefix in lowercase hex.
|
|
1074
1070
|
*/
|
|
1075
1071
|
digest: string
|
|
1076
1072
|
/**
|
|
@@ -1,4 +1,26 @@
|
|
|
1
|
-
import type { ProjectDatabase } from "./prisma"
|
|
1
|
+
import type { BackendDatabase, ProjectDatabase } from "./prisma"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Provides access to the backend database client and encryption helpers.
|
|
5
|
+
*/
|
|
6
|
+
export interface BackendDatabaseBackend {
|
|
7
|
+
/**
|
|
8
|
+
* The database client for the backend database.
|
|
9
|
+
*/
|
|
10
|
+
readonly database: BackendDatabase
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Whether the backend database is encrypted.
|
|
14
|
+
*/
|
|
15
|
+
readonly isEncryptionEnabled: boolean
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Re-encrypts the backend master key for the supplied recipients.
|
|
19
|
+
*
|
|
20
|
+
* @param recipients AGE recipients that must be able to decrypt the backend master key.
|
|
21
|
+
*/
|
|
22
|
+
reencryptMasterKey(recipients: string[]): Promise<void>
|
|
23
|
+
}
|
|
2
24
|
|
|
3
25
|
export interface ProjectDatabaseBackend {
|
|
4
26
|
/**
|
|
@@ -15,5 +37,5 @@ export interface ProjectDatabaseBackend {
|
|
|
15
37
|
): Promise<[database: ProjectDatabase, url: string]>
|
|
16
38
|
}
|
|
17
39
|
|
|
18
|
-
export const backendDatabaseVersion =
|
|
19
|
-
export const projectDatabaseVersion =
|
|
40
|
+
export const backendDatabaseVersion = 1
|
|
41
|
+
export const projectDatabaseVersion = 1
|
package/src/database/factory.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { Logger } from "pino"
|
|
2
|
-
import type { ProjectDatabaseBackend } from "./abstractions"
|
|
3
|
-
import type { BackendDatabase } from "./prisma"
|
|
2
|
+
import type { BackendDatabaseBackend, ProjectDatabaseBackend } from "./abstractions"
|
|
4
3
|
import { z } from "zod"
|
|
5
4
|
import {
|
|
6
|
-
|
|
5
|
+
createLocalBackendDatabaseBackend,
|
|
7
6
|
LocalProjectDatabaseBackend,
|
|
8
7
|
localBackendDatabaseConfig,
|
|
9
8
|
} from "./local"
|
|
@@ -16,13 +15,13 @@ export const databaseConfig = z.object({
|
|
|
16
15
|
...databaseManagerConfig.shape,
|
|
17
16
|
})
|
|
18
17
|
|
|
19
|
-
export function
|
|
18
|
+
export function createBackendDatabaseBackend(
|
|
20
19
|
config: z.infer<typeof databaseConfig>,
|
|
21
20
|
logger: Logger,
|
|
22
|
-
): Promise<
|
|
21
|
+
): Promise<BackendDatabaseBackend> {
|
|
23
22
|
switch (config.HIGHSTATE_BACKEND_DATABASE_TYPE) {
|
|
24
23
|
case "local":
|
|
25
|
-
return
|
|
24
|
+
return createLocalBackendDatabaseBackend(config, logger)
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
|