@highstate/backend 0.9.18 → 0.9.20
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-OU5OQBLB.js → chunk-I7BWSAN6.js} +3 -28
- package/dist/{chunk-OU5OQBLB.js.map → chunk-I7BWSAN6.js.map} +1 -1
- package/dist/chunk-RC6Q3XQQ.js +1547 -0
- package/dist/chunk-RC6Q3XQQ.js.map +1 -0
- package/dist/chunk-VB4YL327.js +139 -0
- package/dist/chunk-VB4YL327.js.map +1 -0
- package/dist/database/local/prisma.config.js +26 -0
- package/dist/database/local/prisma.config.js.map +1 -0
- package/dist/highstate.manifest.json +2 -1
- package/dist/index.js +7590 -7289
- package/dist/index.js.map +1 -1
- package/dist/library/package-resolution-worker.js +1 -1
- package/dist/library/package-resolution-worker.js.map +1 -1
- package/dist/library/worker/main.js +35 -29
- package/dist/library/worker/main.js.map +1 -1
- package/dist/shared/index.js +2 -2
- package/package.json +18 -9
- package/prisma/backend/_schema/layout.prisma +7 -0
- package/prisma/backend/_schema/library.prisma +17 -0
- package/prisma/backend/_schema/project.prisma +101 -0
- package/prisma/backend/_schema/pulumi.prisma +17 -0
- package/prisma/backend/postgresql/main.prisma +17 -0
- package/prisma/backend/sqlite/main.prisma +17 -0
- package/prisma/backend/sqlite/migrations/20250817070609_initiial/migration.sql +34 -0
- package/prisma/backend/sqlite/migrations/20250817104948_add_fields/migration.sql +59 -0
- package/prisma/backend/sqlite/migrations/20250818082732_add_models/migration.sql +41 -0
- package/prisma/backend/sqlite/migrations/20250818083106_a/migration.sql +19 -0
- package/prisma/backend/sqlite/migrations/20250818101945_hi/migration.sql +1 -0
- package/prisma/backend/sqlite/migrations/20250819082315_a/migration.sql +5 -0
- package/prisma/backend/sqlite/migrations/migration_lock.toml +3 -0
- package/prisma/project/api-key.prisma +32 -0
- package/prisma/project/artifact.prisma +52 -0
- package/prisma/project/custom-status.prisma +46 -0
- package/prisma/project/evaluation.prisma +45 -0
- package/prisma/project/instance.prisma +157 -0
- package/prisma/project/layout.prisma +23 -0
- package/prisma/project/lock.prisma +18 -0
- package/prisma/project/main.prisma +17 -0
- package/prisma/project/migrations/20250816081310_initial/migration.sql +300 -0
- package/prisma/project/migrations/20250816082523_test/migration.sql +72 -0
- package/prisma/project/migrations/20250818065643_update/migration.sql +42 -0
- package/prisma/project/migrations/20250818070758_a/migration.sql +8 -0
- package/prisma/project/migrations/20250818070913_a/migration.sql +8 -0
- package/prisma/project/migrations/20250818082720_add_motels/migration.sql +11 -0
- package/prisma/project/migrations/20250818112523_hello/migration.sql +35 -0
- package/prisma/project/migrations/20250819082305_a/migration.sql +14 -0
- package/prisma/project/migrations/20250819165004_add_missing_fields/migration.sql +216 -0
- package/prisma/project/migrations/20250819171309_a/migration.sql +22 -0
- package/prisma/project/migrations/20250820113949_a/migration.sql +66 -0
- package/prisma/project/migrations/20250820144256_b/migration.sql +31 -0
- package/prisma/project/migrations/20250820145547_a/migration.sql +24 -0
- package/prisma/project/migrations/20250820182517_b/migration.sql +2 -0
- package/prisma/project/migrations/20250821172324_a/migration.sql +2 -0
- package/prisma/project/migrations/20250822081339_a/migration.sql +219 -0
- package/prisma/project/migrations/20250822083742_b/migration.sql +1 -0
- package/prisma/project/migrations/20250822105134_boom/migration.sql +1 -0
- package/prisma/project/migrations/20250822141028_b/migration.sql +1 -0
- package/prisma/project/migrations/20250822142342_b/migration.sql +16 -0
- package/prisma/project/migrations/20250824072720_a/migration.sql +1 -0
- package/prisma/project/migrations/20250824093656_b/migration.sql +21 -0
- package/prisma/project/migrations/20250825082518_a/migration.sql +1 -0
- package/prisma/project/migrations/20250825085343_b/migration.sql +1 -0
- package/prisma/project/migrations/20250825091312_a/migration.sql +1 -0
- package/prisma/project/migrations/20250903095431_hi/migration.sql +44 -0
- package/prisma/project/migrations/20250903174255_a/migration.sql +24 -0
- package/prisma/project/migrations/20250908095205_hi/migration.sql +18 -0
- package/prisma/project/migrations/20250909155857_hi/migration.sql +15 -0
- package/prisma/project/migrations/migration_lock.toml +3 -0
- package/prisma/project/model.prisma +37 -0
- package/prisma/project/operation.prisma +148 -0
- package/prisma/project/page.prisma +49 -0
- package/prisma/project/secret.prisma +54 -0
- package/prisma/project/service-account.prisma +42 -0
- package/prisma/project/terminal.prisma +107 -0
- package/prisma/project/trigger.prisma +37 -0
- package/prisma/project/unlock-method.prisma +46 -0
- package/prisma/project/worker.prisma +169 -0
- package/src/artifact/abstractions.ts +13 -13
- package/src/artifact/encryption.ts +30 -54
- package/src/artifact/factory.ts +6 -9
- package/src/artifact/local.ts +33 -46
- package/src/business/api-key.ts +24 -36
- package/src/business/artifact.test.ts +978 -0
- package/src/business/artifact.ts +136 -216
- package/src/business/evaluation.ts +328 -0
- package/src/business/index.ts +5 -2
- package/src/business/instance-lock.test.ts +1060 -0
- package/src/business/instance-lock.ts +387 -78
- package/src/business/instance-state.test.ts +735 -0
- package/src/business/instance-state.ts +582 -337
- package/src/business/operation.test.ts +439 -0
- package/src/business/operation.ts +174 -208
- package/src/business/project-model.ts +258 -0
- package/src/business/project-unlock.ts +168 -126
- package/src/business/project.ts +287 -179
- package/src/business/secret.test.ts +469 -130
- package/src/business/secret.ts +177 -217
- package/src/business/settings.test.ts +695 -0
- package/src/business/settings.ts +855 -0
- package/src/business/terminal-session.ts +90 -0
- package/src/business/unit-extra.test.ts +539 -0
- package/src/business/unit-extra.ts +160 -0
- package/src/business/worker.test.ts +356 -579
- package/src/business/worker.ts +238 -339
- package/src/common/codebase.ts +65 -0
- package/src/common/index.ts +3 -5
- package/src/common/logger.ts +5 -0
- package/src/common/utils.ts +4 -3
- package/src/config.ts +10 -11
- package/src/database/_generated/backend/postgresql/client.ts +72 -0
- package/src/database/_generated/backend/postgresql/commonInputTypes.ts +350 -0
- package/src/database/_generated/backend/postgresql/enums.ts +13 -0
- package/src/database/_generated/backend/postgresql/internal/class.ts +320 -0
- package/src/database/_generated/backend/postgresql/internal/prismaNamespace.ts +1238 -0
- package/src/database/_generated/backend/postgresql/models/Library.ts +1263 -0
- package/src/database/_generated/backend/postgresql/models/Project.ts +2175 -0
- package/src/database/_generated/backend/postgresql/models/ProjectModelStorage.ts +1263 -0
- package/src/database/_generated/backend/postgresql/models/ProjectSpace.ts +1602 -0
- package/src/database/_generated/backend/postgresql/models/PulumiBackend.ts +1263 -0
- package/src/database/_generated/backend/postgresql/models/UserWorkspaseLayout.ts +1065 -0
- package/src/database/_generated/backend/postgresql/models.ts +16 -0
- package/src/database/_generated/backend/postgresql/pjtg.ts +182 -0
- package/src/database/_generated/backend/sqlite/client.ts +72 -0
- package/src/database/_generated/backend/sqlite/commonInputTypes.ts +331 -0
- package/src/database/_generated/backend/sqlite/enums.ts +13 -0
- package/src/database/_generated/backend/sqlite/internal/class.ts +318 -0
- package/src/database/_generated/backend/sqlite/internal/prismaNamespace.ts +1207 -0
- package/src/database/_generated/backend/sqlite/models/Library.ts +1261 -0
- package/src/database/_generated/backend/sqlite/models/Project.ts +2169 -0
- package/src/database/_generated/backend/sqlite/models/ProjectModelStorage.ts +1261 -0
- package/src/database/_generated/backend/sqlite/models/ProjectSpace.ts +1599 -0
- package/src/database/_generated/backend/sqlite/models/PulumiBackend.ts +1261 -0
- package/src/database/_generated/backend/sqlite/models/UserWorkspaseLayout.ts +1063 -0
- package/src/database/_generated/backend/sqlite/models.ts +16 -0
- package/src/database/_generated/backend/sqlite/pjtg.ts +182 -0
- package/src/database/_generated/project/client.ts +204 -0
- package/src/database/_generated/project/commonInputTypes.ts +827 -0
- package/src/database/_generated/project/enums.ts +104 -0
- package/src/database/_generated/project/internal/class.ts +479 -0
- package/src/database/_generated/project/internal/prismaNamespace.ts +2974 -0
- package/src/database/_generated/project/models/ApiKey.ts +1506 -0
- package/src/database/_generated/project/models/Artifact.ts +2051 -0
- package/src/database/_generated/project/models/HubModel.ts +1125 -0
- package/src/database/_generated/project/models/InstanceCustomStatus.ts +1713 -0
- package/src/database/_generated/project/models/InstanceEvaluationState.ts +1312 -0
- package/src/database/_generated/project/models/InstanceLock.ts +1268 -0
- package/src/database/_generated/project/models/InstanceModel.ts +1125 -0
- package/src/database/_generated/project/models/InstanceOperationState.ts +1707 -0
- package/src/database/_generated/project/models/InstanceState.ts +4613 -0
- package/src/database/_generated/project/models/Operation.ts +1647 -0
- package/src/database/_generated/project/models/OperationLog.ts +1455 -0
- package/src/database/_generated/project/models/Page.ts +1838 -0
- package/src/database/_generated/project/models/Secret.ts +1692 -0
- package/src/database/_generated/project/models/ServiceAccount.ts +2165 -0
- package/src/database/_generated/project/models/Terminal.ts +2038 -0
- package/src/database/_generated/project/models/TerminalSession.ts +1454 -0
- package/src/database/_generated/project/models/TerminalSessionLog.ts +1280 -0
- package/src/database/_generated/project/models/Trigger.ts +1430 -0
- package/src/database/_generated/project/models/UnlockMethod.ts +1220 -0
- package/src/database/_generated/project/models/UserCompositeViewport.ts +1280 -0
- package/src/database/_generated/project/models/UserProjectViewport.ts +1059 -0
- package/src/database/_generated/project/models/Worker.ts +1459 -0
- package/src/database/_generated/project/models/WorkerUnitRegistration.ts +1524 -0
- package/src/database/_generated/project/models/WorkerVersion.ts +1974 -0
- package/src/database/_generated/project/models/WorkerVersionLog.ts +1318 -0
- package/src/database/_generated/project/models.ts +35 -0
- package/src/database/_generated/project/pjtg.ts +182 -0
- package/src/database/abstractions.ts +19 -0
- package/src/database/factory.ts +37 -0
- package/src/database/index.ts +6 -0
- package/src/database/local/backend.ts +134 -0
- package/src/database/local/index.ts +3 -0
- package/src/database/local/meta.ts +46 -0
- package/src/database/local/prisma.config.ts +25 -0
- package/src/database/local/project.ts +39 -0
- package/src/database/manager.ts +181 -0
- package/src/database/migrate.ts +35 -0
- package/src/database/prisma.ts +56 -0
- package/src/database/well-known.ts +38 -0
- package/src/index.ts +4 -4
- package/src/library/abstractions.ts +3 -5
- package/src/library/factory.ts +1 -1
- package/src/library/local.ts +81 -26
- package/src/library/package-resolution-worker.ts +1 -1
- package/src/library/worker/evaluator.ts +40 -23
- package/src/library/worker/loader.lite.ts +1 -1
- package/src/library/worker/main.ts +3 -10
- package/src/library/worker/protocol.ts +0 -1
- package/src/lock/index.ts +0 -1
- package/src/lock/manager.ts +0 -10
- package/src/orchestrator/manager.ts +190 -104
- package/src/orchestrator/operation-context.ts +357 -0
- package/src/orchestrator/operation-plan.destroy.test.md +357 -0
- package/src/orchestrator/operation-plan.destroy.test.ts +775 -0
- package/src/orchestrator/operation-plan.fixtures.ts +213 -0
- package/src/orchestrator/operation-plan.md +198 -0
- package/src/orchestrator/operation-plan.refresh.test.md +199 -0
- package/src/orchestrator/operation-plan.refresh.test.ts +367 -0
- package/src/orchestrator/operation-plan.ts +709 -0
- package/src/orchestrator/operation-plan.update.test.md +485 -0
- package/src/orchestrator/operation-plan.update.test.ts +1066 -0
- package/src/orchestrator/operation-workset.ts +233 -578
- package/src/orchestrator/operation.ts +440 -948
- package/src/orchestrator/plan-test-builder.ts +267 -0
- package/src/project-model/abstractions.ts +118 -0
- package/src/project-model/backends/codebase.ts +365 -0
- package/src/project-model/backends/database.ts +440 -0
- package/src/project-model/errors.ts +81 -0
- package/src/project-model/factory.ts +24 -0
- package/src/project-model/index.ts +4 -0
- package/src/project-model/utils.test.ts +544 -0
- package/src/project-model/utils.ts +242 -0
- package/src/pubsub/abstractions.ts +10 -1
- package/src/pubsub/factory.ts +4 -4
- package/src/pubsub/index.ts +1 -0
- package/src/pubsub/manager.ts +29 -13
- package/src/pubsub/memory.ts +31 -0
- package/src/runner/abstractions.ts +40 -41
- package/src/runner/artifact-env.ts +19 -8
- package/src/runner/factory.ts +6 -6
- package/src/runner/force-abort.ts +3 -6
- package/src/runner/local.ts +74 -67
- package/src/runner/pulumi.ts +23 -63
- package/src/services.ts +181 -123
- package/src/shared/models/backend/index.ts +3 -1
- package/src/shared/models/backend/library.ts +9 -1
- package/src/shared/models/backend/project.ts +43 -42
- package/src/shared/models/backend/pulumi.ts +14 -0
- package/src/shared/models/backend/unlock-method.ts +1 -1
- package/src/shared/models/backend/well-known.ts +58 -0
- package/src/shared/models/base.ts +40 -26
- package/src/shared/models/errors.ts +82 -1
- package/src/shared/models/index.ts +3 -2
- package/src/shared/models/prisma.ts +36 -0
- package/src/shared/models/project/api-key.ts +37 -59
- package/src/shared/models/project/artifact.ts +16 -76
- package/src/shared/models/project/custom-status.ts +12 -0
- package/src/shared/models/project/index.ts +8 -7
- package/src/shared/models/project/lock.ts +10 -78
- package/src/shared/models/project/model.ts +19 -1
- package/src/shared/models/project/operation.ts +235 -99
- package/src/shared/models/project/page.ts +37 -48
- package/src/shared/models/project/secret.ts +29 -89
- package/src/shared/models/project/service-account.ts +12 -17
- package/src/shared/models/project/state.ts +100 -407
- package/src/shared/models/project/terminal.ts +75 -88
- package/src/shared/models/project/trigger.ts +13 -49
- package/src/shared/models/project/unlock-method.ts +20 -26
- package/src/shared/models/project/worker.ts +89 -90
- package/src/shared/resolvers/graph-resolver.ts +21 -0
- package/src/shared/resolvers/index.ts +1 -1
- package/src/shared/resolvers/input-hash.ts +24 -14
- package/src/shared/resolvers/input.ts +9 -2
- package/src/shared/resolvers/registry.ts +5 -4
- package/src/shared/resolvers/state.ts +12 -1
- package/src/shared/resolvers/validation.ts +7 -3
- package/src/shared/utils/index.ts +1 -2
- package/src/shared/utils/promise-tracker.ts +30 -3
- package/src/terminal/abstractions.ts +1 -1
- package/src/terminal/docker.ts +3 -3
- package/src/terminal/manager.ts +102 -118
- package/src/test-utils/database.ts +119 -0
- package/src/test-utils/index.ts +2 -0
- package/src/test-utils/services.ts +134 -0
- package/src/unlock/abstractions.ts +5 -23
- package/src/unlock/memory.ts +9 -14
- package/src/worker/abstractions.ts +7 -4
- package/src/worker/docker.ts +14 -19
- package/src/worker/manager.ts +366 -97
- package/dist/chunk-NAAIDR4U.js +0 -8499
- package/dist/chunk-NAAIDR4U.js.map +0 -1
- package/dist/chunk-Y7DXREVO.js +0 -1745
- package/dist/chunk-Y7DXREVO.js.map +0 -1
- package/dist/magic-string.es-5ABAC4JN.js +0 -1292
- package/dist/magic-string.es-5ABAC4JN.js.map +0 -1
- package/src/business/__traces__/secret/update-instance-secrets/create-and-delete-secrets-simultaneously.md +0 -356
- package/src/business/__traces__/secret/update-instance-secrets/create-new-secrets-for-instance.md +0 -274
- package/src/business/__traces__/secret/update-instance-secrets/delete-existing-secrets.md +0 -223
- package/src/business/__traces__/secret/update-instance-secrets/no-op-when-no-changes.md +0 -147
- package/src/business/__traces__/secret/update-instance-secrets/update-existing-secrets.md +0 -280
- package/src/business/__traces__/worker/update-unit-registrations/add-new-unit-registration-when-other-exists.md +0 -360
- package/src/business/__traces__/worker/update-unit-registrations/add-new-unit-registration.md +0 -215
- package/src/business/__traces__/worker/update-unit-registrations/create-multiple-workers-with-different-identities.md +0 -427
- package/src/business/__traces__/worker/update-unit-registrations/handle-nonexistent-registration-id-gracefully.md +0 -217
- package/src/business/__traces__/worker/update-unit-registrations/no-op-when-no-changes.md +0 -132
- package/src/business/__traces__/worker/update-unit-registrations/recreate-worker-when-image-changes.md +0 -454
- package/src/business/__traces__/worker/update-unit-registrations/recreate-worker-when-image-version-changes.md +0 -426
- package/src/business/__traces__/worker/update-unit-registrations/recreate-worker-with-same-identity-reuses-service-account.md +0 -372
- package/src/business/__traces__/worker/update-unit-registrations/remove-one-of-multiple-unit-registrations.md +0 -383
- package/src/business/__traces__/worker/update-unit-registrations/remove-unit-registration.md +0 -245
- package/src/business/__traces__/worker/update-unit-registrations/update-existing-unit-registration-when-params-change.md +0 -174
- package/src/business/__traces__/worker/update-unit-registrations/update-params-and-image-simultaneously.md +0 -432
- package/src/business/__traces__/worker/update-unit-registrations/worker-with-multiple-registrations-not-deleted-when-one-removed.md +0 -220
- package/src/business/backend-unlock.ts +0 -10
- package/src/common/clock.ts +0 -18
- package/src/common/performance.ts +0 -44
- package/src/common/random.ts +0 -68
- package/src/common/test/index.ts +0 -2
- package/src/common/test/render.ts +0 -98
- package/src/common/test/tracer.ts +0 -359
- package/src/hotstate/abstractions.ts +0 -48
- package/src/hotstate/factory.ts +0 -17
- package/src/hotstate/index.ts +0 -3
- package/src/hotstate/manager.ts +0 -192
- package/src/hotstate/memory.ts +0 -100
- package/src/hotstate/validation.ts +0 -100
- package/src/lock/test.ts +0 -108
- package/src/project/abstractions.ts +0 -78
- package/src/project/evaluation.ts +0 -248
- package/src/project/factory.ts +0 -11
- package/src/project/index.ts +0 -3
- package/src/project/local.ts +0 -417
- package/src/pubsub/local.ts +0 -36
- package/src/pubsub/validation.ts +0 -33
- package/src/shared/utils/args.ts +0 -25
- package/src/state/abstractions.ts +0 -289
- package/src/state/encryption.ts +0 -98
- package/src/state/factory.ts +0 -20
- package/src/state/index.ts +0 -7
- package/src/state/local/backend.ts +0 -106
- package/src/state/local/collection.ts +0 -361
- package/src/state/local/index.ts +0 -2
- package/src/state/manager.ts +0 -890
- package/src/state/memory/backend.ts +0 -70
- package/src/state/memory/collection.ts +0 -270
- package/src/state/memory/index.ts +0 -2
- package/src/state/repository/index.ts +0 -2
- package/src/state/repository/repository.index.ts +0 -193
- package/src/state/repository/repository.ts +0 -507
- package/src/state/test.ts +0 -457
- /package/src/{state → database/local}/keyring.ts +0 -0
|
@@ -1,139 +1,275 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { objectMetaSchema } from "@highstate/contract"
|
|
1
|
+
import type { Operation, OperationStatus, OperationType } from "../../../database"
|
|
2
|
+
import { instanceIdSchema, objectMetaSchema, z } from "@highstate/contract"
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Phase type for operation execution.
|
|
6
|
+
*/
|
|
7
|
+
export const operationPhaseTypeSchema = z.enum(["destroy", "update", "refresh"])
|
|
5
8
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"failed",
|
|
11
|
-
"cancelled",
|
|
12
|
-
"failing",
|
|
13
|
-
])
|
|
14
|
-
|
|
15
|
-
export const operationOptionsSchema = z.object({
|
|
9
|
+
/**
|
|
10
|
+
* Instance information for operation phase.
|
|
11
|
+
*/
|
|
12
|
+
export const operationPhaseInstanceSchema = z.object({
|
|
16
13
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* Only applicable for `update`, `preview`, `recreate`, and `refresh` operations.
|
|
20
|
-
*
|
|
21
|
-
* By default, `false`.
|
|
14
|
+
* The ID of the instance.
|
|
22
15
|
*/
|
|
23
|
-
|
|
16
|
+
id: instanceIdSchema,
|
|
24
17
|
|
|
25
18
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* Only applicable for `update`, `preview`, `recreate`, and `refresh` operations.
|
|
29
|
-
*
|
|
30
|
-
* By default, `false`.
|
|
19
|
+
* The parent ID of the instance, either from the model or the state.
|
|
31
20
|
*/
|
|
32
|
-
|
|
21
|
+
parentId: z.string().optional(),
|
|
33
22
|
|
|
34
23
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
* By default, `true`.
|
|
40
|
-
*/
|
|
41
|
-
destroyDependentInstances: z.boolean().default(true),
|
|
24
|
+
* Human-readable explanation of the decision.
|
|
25
|
+
* */
|
|
26
|
+
message: z.string(),
|
|
27
|
+
})
|
|
42
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Single phase of operation execution.
|
|
31
|
+
*/
|
|
32
|
+
export const operationPhaseSchema = z.object({
|
|
43
33
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* Only applicable for `destroy`.
|
|
47
|
-
*
|
|
48
|
-
* By default, `true`.
|
|
34
|
+
* Type of phase being executed.
|
|
49
35
|
*/
|
|
50
|
-
|
|
36
|
+
type: operationPhaseTypeSchema,
|
|
51
37
|
|
|
52
38
|
/**
|
|
53
|
-
*
|
|
54
|
-
* This is potentially dangerous and should be used with caution.
|
|
55
|
-
*
|
|
56
|
-
* By default, `false`.
|
|
39
|
+
* List of instances to be processed in this phase.
|
|
57
40
|
*/
|
|
58
|
-
|
|
41
|
+
instances: z.array(operationPhaseInstanceSchema),
|
|
42
|
+
})
|
|
59
43
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
*
|
|
64
|
-
* By default, `false`.
|
|
65
|
-
*/
|
|
66
|
-
forceDeleteState: z.boolean().default(false),
|
|
44
|
+
export type OperationPhase = z.infer<typeof operationPhaseSchema>
|
|
45
|
+
export type OperationPhaseType = z.infer<typeof operationPhaseTypeSchema>
|
|
46
|
+
export type OperationPhaseInstance = z.infer<typeof operationPhaseInstanceSchema>
|
|
67
47
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
48
|
+
export const operationOptionsSchema = z
|
|
49
|
+
.object({
|
|
50
|
+
/**
|
|
51
|
+
* Force update all dependencies regardless of their current state.
|
|
52
|
+
*
|
|
53
|
+
* **Operation Behavior Impact:**
|
|
54
|
+
* - bypasses hash-based change detection for dependency chains;
|
|
55
|
+
* - includes **ALL** dependencies (up-to-date, out-of-date, and error states);
|
|
56
|
+
* - traverses the entire dependency graph from requested instances.
|
|
57
|
+
*
|
|
58
|
+
* **Usage with other options:**
|
|
59
|
+
* - combined with `forceUpdateChildren`: updates entire dependency tree **AND** all composite children;
|
|
60
|
+
* - independent of `allowPartialCompositeInstanceCreation`: affects dependency traversal, not composite logic.
|
|
61
|
+
*/
|
|
62
|
+
forceUpdateDependencies: z.boolean().default(false),
|
|
77
63
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Force update all children of composite instances regardless of their state.
|
|
66
|
+
*
|
|
67
|
+
* **Operation Behavior Impact:**
|
|
68
|
+
* - overrides selective child inclusion logic for composites;
|
|
69
|
+
* - includes **ALL** children of affected composites (up-to-date, out-of-date, and error states);
|
|
70
|
+
* - applied after dependency traversal and parent inclusion.
|
|
71
|
+
*
|
|
72
|
+
* **Usage with other options:**
|
|
73
|
+
* - combined with `forceUpdateDependencies`: creates comprehensive force-update behavior;
|
|
74
|
+
* - overrides `allowPartialCompositeInstanceCreation`: when enabled, **ALL** children are included regardless of existence.
|
|
75
|
+
*/
|
|
76
|
+
forceUpdateChildren: z.boolean().default(false),
|
|
85
77
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
78
|
+
/**
|
|
79
|
+
* Include dependent instances when destroying instances.
|
|
80
|
+
*
|
|
81
|
+
* **Operation Behavior Impact:**
|
|
82
|
+
* - extends destroy operations to include instances that depend on the target;
|
|
83
|
+
* - traverses the dependency graph in reverse (dependents, not dependencies);
|
|
84
|
+
* - prevents orphaned instances that would fail without their dependencies.
|
|
85
|
+
*
|
|
86
|
+
* **Usage with other options:**
|
|
87
|
+
* - works with `invokeDestroyTriggers`: ensures triggers run for all dependents;
|
|
88
|
+
* - independent of update-related options.
|
|
89
|
+
*/
|
|
90
|
+
destroyDependentInstances: z.boolean().default(true),
|
|
92
91
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
/**
|
|
93
|
+
* Execute destroy triggers when destroying instances.
|
|
94
|
+
*
|
|
95
|
+
* **Operation Behavior Impact:**
|
|
96
|
+
* - affects how individual units are destroyed (triggers vs direct deletion);
|
|
97
|
+
* - does not change which instances are selected for destruction;
|
|
98
|
+
* - controls trigger execution during the destruction phase.
|
|
99
|
+
*
|
|
100
|
+
* **Usage with other options:**
|
|
101
|
+
* - used with `destroyDependentInstances`: ensures triggers run for cascade deletions;
|
|
102
|
+
* - independent of update-related options.
|
|
103
|
+
*/
|
|
104
|
+
invokeDestroyTriggers: z.boolean().default(true),
|
|
97
105
|
|
|
98
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Delete Pulumi resources that are no longer referenced in the state.
|
|
108
|
+
*
|
|
109
|
+
* **Operation Behavior Impact:**
|
|
110
|
+
* - does not affect which instances are selected for operations;
|
|
111
|
+
* - deletes orphaned Pulumi resources within individual instances.
|
|
112
|
+
*
|
|
113
|
+
* **Usage with other options:**
|
|
114
|
+
* - independent of instance selection options;
|
|
115
|
+
* - complements destroy-related options for thorough cleanup.
|
|
116
|
+
*/
|
|
117
|
+
deleteUnreachableResources: z.boolean().default(false),
|
|
99
118
|
|
|
100
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Force deletion of instance state even if the destroy operation fails.
|
|
121
|
+
*
|
|
122
|
+
* **Operation Behavior Impact:**
|
|
123
|
+
* - forces state deletion even when destroy operations fail;
|
|
124
|
+
* - does not affect which instances are selected for operations;
|
|
125
|
+
* - bypasses normal destroy procedures as emergency fallback.
|
|
126
|
+
*
|
|
127
|
+
* **Usage with other options:**
|
|
128
|
+
* - used with destroy-related options when normal cleanup fails;
|
|
129
|
+
* - should be used cautiously as it can create state inconsistencies.
|
|
130
|
+
*/
|
|
131
|
+
forceDeleteState: z.boolean().default(false),
|
|
101
132
|
|
|
102
|
-
|
|
133
|
+
/**
|
|
134
|
+
* Allow partial update of composite instances without requiring all outdated children.
|
|
135
|
+
*
|
|
136
|
+
* **Operation Behavior Impact:**
|
|
137
|
+
* - controls whether composite operations must include all outdated children or only necessary ones;
|
|
138
|
+
* - when `false` (default): all outdated children of substantive composites are included in operations;
|
|
139
|
+
* - when `true`: only necessary children are included, allowing partial composite operations;
|
|
140
|
+
* - applied during composite child traversal phase for substantive composites only.
|
|
141
|
+
*
|
|
142
|
+
* **Usage with other options:**
|
|
143
|
+
* - overridden by `forceUpdateChildren`: when force is enabled, **ALL** children are included regardless;
|
|
144
|
+
* - independent of `forceUpdateDependencies`: affects composite logic, not dependency traversal.
|
|
145
|
+
*/
|
|
146
|
+
allowPartialCompositeInstanceUpdate: z.boolean().default(false),
|
|
103
147
|
|
|
104
|
-
|
|
105
|
-
|
|
148
|
+
/**
|
|
149
|
+
* Allow partial destruction of composite instances during cascade operations.
|
|
150
|
+
*
|
|
151
|
+
* **Operation Behavior Impact:**
|
|
152
|
+
* - controls whether cascade destruction must include all children or only necessary ones;
|
|
153
|
+
* - when `false` (default): cascade destruction includes **ALL** children of affected composites;
|
|
154
|
+
* - when `true`: cascade destruction includes only directly dependent children;
|
|
155
|
+
* - does not affect explicit composite destruction (always destroys all children);
|
|
156
|
+
* - does not affect parent propagation when destroying sibling composites.
|
|
157
|
+
*
|
|
158
|
+
* **Usage with other options:**
|
|
159
|
+
* - works with `destroyDependentInstances`: controls completeness of cascade destruction;
|
|
160
|
+
* - independent of update-related options.
|
|
161
|
+
*/
|
|
162
|
+
allowPartialCompositeInstanceDestruction: z.boolean().default(false),
|
|
106
163
|
|
|
107
|
-
|
|
164
|
+
/**
|
|
165
|
+
* Also refresh the state of instances during the operation.
|
|
166
|
+
*
|
|
167
|
+
* **Operation Behavior Impact:**
|
|
168
|
+
* - does not change which instances are selected for operations;
|
|
169
|
+
* - synchronizes state with actual infrastructure during the operation.
|
|
170
|
+
*
|
|
171
|
+
* **Usage with other options:**
|
|
172
|
+
* - additive with dependency resolution options: refreshes all selected instances;
|
|
173
|
+
* - works with both all operation types.
|
|
174
|
+
*/
|
|
175
|
+
refresh: z.boolean().default(false),
|
|
108
176
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
177
|
+
/**
|
|
178
|
+
* Enable debug logging for Pulumi engine and resource providers.
|
|
179
|
+
*
|
|
180
|
+
* **Security Note:**
|
|
181
|
+
* Debug mode may expose sensitive information including credentials in the logs.
|
|
182
|
+
* Use only when absolutely necessary for troubleshooting.
|
|
183
|
+
*
|
|
184
|
+
* **Implementation:**
|
|
185
|
+
* - sets Pulumi's debug option to true;
|
|
186
|
+
* - sets TF_LOG=DEBUG environment variable for Terraform providers.
|
|
187
|
+
*/
|
|
188
|
+
debug: z.boolean().default(false),
|
|
189
|
+
})
|
|
190
|
+
.partial()
|
|
112
191
|
|
|
113
|
-
export
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
192
|
+
export const operationTypeSchema = z.enum([
|
|
193
|
+
"update",
|
|
194
|
+
"preview",
|
|
195
|
+
"destroy",
|
|
196
|
+
"recreate",
|
|
197
|
+
"refresh",
|
|
198
|
+
]) satisfies z.ZodType<OperationType>
|
|
118
199
|
|
|
119
|
-
export
|
|
120
|
-
|
|
121
|
-
|
|
200
|
+
export const operationStatusSchema = z.enum([
|
|
201
|
+
"pending",
|
|
202
|
+
"running",
|
|
203
|
+
"failing",
|
|
204
|
+
"completed",
|
|
205
|
+
"failed",
|
|
206
|
+
"cancelled",
|
|
207
|
+
]) satisfies z.ZodType<OperationStatus>
|
|
122
208
|
|
|
123
|
-
export const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
209
|
+
export const operationMetaSchema = objectMetaSchema.pick({
|
|
210
|
+
title: true,
|
|
211
|
+
description: true,
|
|
212
|
+
})
|
|
213
|
+
|
|
214
|
+
export const operationInputSchema = z.object({
|
|
215
|
+
projectId: z.string(),
|
|
216
|
+
type: operationTypeSchema,
|
|
217
|
+
instanceIds: z.array(instanceIdSchema).min(1),
|
|
218
|
+
options: operationOptionsSchema.partial().optional(),
|
|
219
|
+
meta: operationMetaSchema.optional(),
|
|
220
|
+
plan: operationPhaseSchema.array().optional(),
|
|
221
|
+
})
|
|
127
222
|
|
|
128
|
-
export type
|
|
223
|
+
export type OperationMeta = z.infer<typeof operationMetaSchema>
|
|
224
|
+
export type OperationInput = z.infer<typeof operationInputSchema>
|
|
225
|
+
export type OperationOptions = z.infer<typeof operationOptionsSchema>
|
|
129
226
|
|
|
130
227
|
export const operationEventSchema = z.discriminatedUnion("type", [
|
|
131
228
|
z.object({
|
|
132
229
|
type: z.literal("updated"),
|
|
133
|
-
operation:
|
|
230
|
+
operation: z.custom<Operation>(),
|
|
134
231
|
}),
|
|
135
232
|
z.object({
|
|
136
233
|
type: z.literal("deleted"),
|
|
137
234
|
operationId: z.string(),
|
|
138
235
|
}),
|
|
139
236
|
])
|
|
237
|
+
|
|
238
|
+
export const operationOutputSchema = z.object({
|
|
239
|
+
id: z.cuid2(),
|
|
240
|
+
type: operationTypeSchema,
|
|
241
|
+
status: operationStatusSchema,
|
|
242
|
+
meta: operationMetaSchema,
|
|
243
|
+
startedAt: z.date(),
|
|
244
|
+
updatedAt: z.date(),
|
|
245
|
+
finishedAt: z.date().nullable(),
|
|
246
|
+
})
|
|
247
|
+
|
|
248
|
+
export type OperationOutput = z.infer<typeof operationOutputSchema>
|
|
249
|
+
|
|
250
|
+
export type { Operation, OperationLog, OperationStatus, OperationType } from "../../../database"
|
|
251
|
+
|
|
252
|
+
export const finalOperationStatuses: OperationStatus[] = ["completed", "failed", "cancelled"]
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Checks if an operation status is final (stable).
|
|
256
|
+
*
|
|
257
|
+
* Final statuses are: completed, failed, cancelled
|
|
258
|
+
* Transient statuses are: pending, running, failing
|
|
259
|
+
*
|
|
260
|
+
* @param status The operation status to check
|
|
261
|
+
* @returns True if the status is final
|
|
262
|
+
*/
|
|
263
|
+
export function isFinalOperationStatus(status: OperationStatus): boolean {
|
|
264
|
+
return finalOperationStatuses.includes(status)
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Checks if an operation status exists and is transient (not stable).
|
|
269
|
+
*
|
|
270
|
+
* @param status The operation status to check
|
|
271
|
+
* @returns True if the status is transient
|
|
272
|
+
*/
|
|
273
|
+
export function isTransientOperationStatus(status?: OperationStatus): boolean {
|
|
274
|
+
return !!status && !finalOperationStatuses.includes(status)
|
|
275
|
+
}
|
|
@@ -1,57 +1,46 @@
|
|
|
1
|
+
import type { ServiceAccount } from "../../../database"
|
|
2
|
+
import {
|
|
3
|
+
commonObjectMetaSchema,
|
|
4
|
+
pageBlockSchema,
|
|
5
|
+
serviceAccountMetaSchema,
|
|
6
|
+
} from "@highstate/contract"
|
|
1
7
|
import { z } from "zod"
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
z.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
z.
|
|
13
|
-
type: z.literal("qr"),
|
|
14
|
-
content: z.string(),
|
|
15
|
-
showContent: z.coerce.boolean(),
|
|
16
|
-
language: z.string().optional(),
|
|
17
|
-
}),
|
|
18
|
-
z.object({
|
|
19
|
-
type: z.literal("file"),
|
|
20
|
-
...fileSchema.shape,
|
|
21
|
-
}),
|
|
22
|
-
])
|
|
23
|
-
|
|
24
|
-
export type PageBlock = z.infer<typeof pageBlockSchema>
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Page info for frontend display.
|
|
28
|
-
* Contains only basic information visible to the frontend.
|
|
29
|
-
*/
|
|
30
|
-
export const pageSchema = z.object({
|
|
31
|
-
id: z.string(),
|
|
32
|
-
instanceId: z.string().optional(),
|
|
33
|
-
meta: objectMetaSchema,
|
|
8
|
+
import { collectionQuerySchema } from "../base"
|
|
9
|
+
|
|
10
|
+
export const pageOutputSchema = z.object({
|
|
11
|
+
id: z.cuid2(),
|
|
12
|
+
meta: commonObjectMetaSchema,
|
|
13
|
+
name: z.string().nullable(),
|
|
14
|
+
stateId: z.cuid2().nullable(),
|
|
15
|
+
serviceAccountId: z.cuid2().nullable(),
|
|
16
|
+
serviceAccountMeta: serviceAccountMetaSchema.nullable(),
|
|
17
|
+
createdAt: z.date(),
|
|
18
|
+
updatedAt: z.date(),
|
|
34
19
|
})
|
|
35
20
|
|
|
36
|
-
export type
|
|
21
|
+
export type PageOutput = z.infer<typeof pageOutputSchema>
|
|
37
22
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
id: z.string(),
|
|
43
|
-
content: z.array(pageBlockSchema),
|
|
23
|
+
export const pageQuerySchema = collectionQuerySchema.extend({
|
|
24
|
+
serviceAccountId: z.string().optional(),
|
|
25
|
+
stateId: z.string().optional(),
|
|
26
|
+
artifactId: z.string().optional(),
|
|
44
27
|
})
|
|
45
28
|
|
|
46
|
-
export type
|
|
29
|
+
export type PageQuery = z.infer<typeof pageQuerySchema>
|
|
47
30
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
*/
|
|
52
|
-
export const unitPageSchema = pageContentSchema.omit({ id: true }).extend({
|
|
53
|
-
name: z.string(),
|
|
54
|
-
meta: userObjectMetaSchema,
|
|
31
|
+
export const pageDetailsOutputSchema = z.object({
|
|
32
|
+
...pageOutputSchema.shape,
|
|
33
|
+
content: z.array(pageBlockSchema),
|
|
55
34
|
})
|
|
56
35
|
|
|
57
|
-
export type
|
|
36
|
+
export type PageDetailsOutput = z.infer<typeof pageDetailsOutputSchema>
|
|
37
|
+
|
|
38
|
+
export function toPageOutput(
|
|
39
|
+
page: Omit<PageOutput, "serviceAccountMeta">,
|
|
40
|
+
serviceAccount?: Pick<ServiceAccount, "meta"> | null,
|
|
41
|
+
): PageOutput {
|
|
42
|
+
return {
|
|
43
|
+
...page,
|
|
44
|
+
serviceAccountMeta: serviceAccount?.meta ?? null,
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -1,98 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
z.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Secret info for frontend display.
|
|
18
|
-
* Contains only basic information visible to the frontend without the actual secret value.
|
|
19
|
-
*/
|
|
20
|
-
export const secretSchema = z.object({
|
|
21
|
-
/**
|
|
22
|
-
* The UUIDv7 of the secret generated when the secret is first created.
|
|
23
|
-
*/
|
|
24
|
-
id: z.uuidv7(),
|
|
1
|
+
import type { ServiceAccount } from "../../../database"
|
|
2
|
+
import { globalCommonObjectMetaSchema, serviceAccountMetaSchema, z } from "@highstate/contract"
|
|
3
|
+
import { collectionQuerySchema } from "../base"
|
|
4
|
+
|
|
5
|
+
export const secretOutputSchema = z.object({
|
|
6
|
+
id: z.cuid2(),
|
|
7
|
+
meta: globalCommonObjectMetaSchema,
|
|
8
|
+
name: z.string().nullable(),
|
|
9
|
+
systemName: z.string().nullable(),
|
|
10
|
+
stateId: z.cuid2().nullable(),
|
|
11
|
+
serviceAccountId: z.cuid2().nullable(),
|
|
12
|
+
serviceAccountMeta: serviceAccountMetaSchema.nullable(),
|
|
13
|
+
createdAt: z.date(),
|
|
14
|
+
updatedAt: z.date(),
|
|
15
|
+
})
|
|
25
16
|
|
|
26
|
-
|
|
27
|
-
* The metadata of the secret object.
|
|
28
|
-
*/
|
|
29
|
-
meta: objectMetaSchema,
|
|
17
|
+
export type SecretOutput = z.infer<typeof secretOutputSchema>
|
|
30
18
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* - `instance:<instanceId>:<secretName>`
|
|
35
|
-
*/
|
|
36
|
-
descriptor: secretDescriptorSchema.optional(),
|
|
19
|
+
export const secretQuerySchema = collectionQuerySchema.extend({
|
|
20
|
+
serviceAccountId: z.string().optional(),
|
|
21
|
+
stateId: z.string().optional(),
|
|
37
22
|
})
|
|
38
23
|
|
|
39
|
-
export type
|
|
40
|
-
export type Secret = z.infer<typeof secretSchema>
|
|
24
|
+
export type SecretQuery = z.infer<typeof secretQuerySchema>
|
|
41
25
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
switch (descriptor.type) {
|
|
50
|
-
case "system":
|
|
51
|
-
return `system:${descriptor.secretName}`
|
|
52
|
-
case "instance":
|
|
53
|
-
return `instance:${descriptor.instanceId}:${descriptor.secretName}`
|
|
26
|
+
export function toSecretOutput(
|
|
27
|
+
secret: Omit<SecretOutput, "serviceAccountMeta">,
|
|
28
|
+
serviceAccount?: Pick<ServiceAccount, "meta"> | null,
|
|
29
|
+
): SecretOutput {
|
|
30
|
+
return {
|
|
31
|
+
...secret,
|
|
32
|
+
serviceAccountMeta: serviceAccount?.meta ?? null,
|
|
54
33
|
}
|
|
55
34
|
}
|
|
56
35
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
*
|
|
60
|
-
* @param descriptorString The secret descriptor string to parse.
|
|
61
|
-
* @returns The parsed SecretDescriptor object.
|
|
62
|
-
* @throws Error if the secret descriptor format is invalid.
|
|
63
|
-
*/
|
|
64
|
-
export function parseSecretDescriptor(descriptorString: string): SecretDescriptor {
|
|
65
|
-
const parts = descriptorString.split(":")
|
|
66
|
-
if (parts.length < 2) {
|
|
67
|
-
throw new Error(`Invalid secret descriptor format: ${descriptorString}`)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
switch (parts[0]) {
|
|
71
|
-
case "system": {
|
|
72
|
-
if (parts.length !== 2) {
|
|
73
|
-
throw new Error(`Invalid system secret descriptor: ${descriptorString}`)
|
|
74
|
-
}
|
|
75
|
-
return { type: "system", secretName: parts[1] }
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
case "instance": {
|
|
79
|
-
// instance format is "instance:<instanceId>:<secretName>" where instanceId may contain colons
|
|
80
|
-
const secretName = parts[parts.length - 1]
|
|
81
|
-
const instanceId = parts.slice(1, -1).join(":")
|
|
82
|
-
if (!instanceId || !secretName) {
|
|
83
|
-
throw new Error(`Invalid instance secret descriptor: ${descriptorString}`)
|
|
84
|
-
}
|
|
85
|
-
return { type: "instance", instanceId, secretName }
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
default:
|
|
89
|
-
throw new Error(`Unknown secret descriptor type: ${parts[0]}`)
|
|
90
|
-
}
|
|
36
|
+
export enum SystemSecretNames {
|
|
37
|
+
PulumiPassword = "pulumi-password",
|
|
91
38
|
}
|
|
92
|
-
|
|
93
|
-
export const WellKnownSecretDescriptors = {
|
|
94
|
-
PulumiPassword: {
|
|
95
|
-
type: "system",
|
|
96
|
-
secretName: "pulumi-password",
|
|
97
|
-
},
|
|
98
|
-
} satisfies Record<string, SecretDescriptor>
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
import { z } from "
|
|
2
|
-
import {
|
|
1
|
+
import { serviceAccountMetaSchema, z } from "@highstate/contract"
|
|
2
|
+
import { collectionQuerySchema } from "../base"
|
|
3
3
|
|
|
4
|
-
export const
|
|
5
|
-
id: z.
|
|
4
|
+
export const serviceAccountOutputSchema = z.object({
|
|
5
|
+
id: z.cuid2(),
|
|
6
|
+
meta: serviceAccountMetaSchema,
|
|
7
|
+
createdAt: z.date(),
|
|
8
|
+
updatedAt: z.date(),
|
|
9
|
+
})
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
title: true,
|
|
9
|
-
description: true,
|
|
10
|
-
icon: true,
|
|
11
|
-
iconColor: true,
|
|
12
|
-
createdAt: true,
|
|
13
|
-
updatedAt: true,
|
|
14
|
-
}),
|
|
11
|
+
export type ServiceAccountOutput = z.infer<typeof serviceAccountOutputSchema>
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
19
|
-
avatarArtifactId: z.string().optional(),
|
|
13
|
+
export const serviceAccountQuerySchema = collectionQuerySchema.extend({
|
|
14
|
+
artifactId: z.string().optional(),
|
|
20
15
|
})
|
|
21
16
|
|
|
22
|
-
export type
|
|
17
|
+
export type ServiceAccountQuery = z.infer<typeof serviceAccountQuerySchema>
|