@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.
Files changed (99) hide show
  1. package/dist/{chunk-GJTMJQUW.js → chunk-QSHSXLO2.js} +18 -9
  2. package/dist/chunk-QSHSXLO2.js.map +1 -0
  3. package/dist/index.js +292 -132
  4. package/dist/index.js.map +1 -1
  5. package/dist/shared/index.js +1 -1
  6. package/package.json +3 -3
  7. package/prisma/backend/_schema/layout.prisma +3 -1
  8. package/prisma/backend/_schema/project.prisma +4 -2
  9. package/prisma/backend/_schema/unlock-method.prisma +19 -0
  10. package/prisma/backend/sqlite/migrations/{20250818082732_add_models → 20250928124105_initial_migration}/migration.sql +48 -16
  11. package/prisma/project/api-key.prisma +3 -1
  12. package/prisma/project/artifact.prisma +2 -2
  13. package/prisma/project/custom-status.prisma +1 -1
  14. package/prisma/project/layout.prisma +4 -0
  15. package/prisma/project/migrations/{20250816081310_initial → 20250928130725_initial_migration}/migration.sql +132 -46
  16. package/prisma/project/terminal.prisma +2 -2
  17. package/prisma/project/unlock-method.prisma +1 -1
  18. package/prisma/project/worker.prisma +1 -1
  19. package/src/business/backend-unlock.test.ts +133 -0
  20. package/src/business/backend-unlock.ts +76 -0
  21. package/src/business/index.ts +1 -0
  22. package/src/business/settings.test.ts +3 -2
  23. package/src/database/_generated/backend/postgresql/client.ts +9 -4
  24. package/src/database/_generated/backend/postgresql/internal/class.ts +147 -168
  25. package/src/database/_generated/backend/postgresql/internal/prismaNamespace.ts +127 -40
  26. package/src/database/_generated/backend/postgresql/models/BackendUnlockMethod.ts +1156 -0
  27. package/src/database/_generated/backend/postgresql/models/Project.ts +2 -2
  28. package/src/database/_generated/backend/postgresql/models/ProjectSpace.ts +7 -1
  29. package/src/database/_generated/backend/postgresql/models/UserWorkspaceLayout.ts +1067 -0
  30. package/src/database/_generated/backend/postgresql/models.ts +2 -1
  31. package/src/database/_generated/backend/sqlite/client.ts +9 -4
  32. package/src/database/_generated/backend/sqlite/internal/class.ts +146 -165
  33. package/src/database/_generated/backend/sqlite/internal/prismaNamespace.ts +127 -40
  34. package/src/database/_generated/backend/sqlite/models/BackendUnlockMethod.ts +1154 -0
  35. package/src/database/_generated/backend/sqlite/models/Project.ts +2 -2
  36. package/src/database/_generated/backend/sqlite/models/ProjectSpace.ts +7 -1
  37. package/src/database/_generated/backend/sqlite/models/UserWorkspaceLayout.ts +1065 -0
  38. package/src/database/_generated/backend/sqlite/models.ts +2 -1
  39. package/src/database/_generated/project/commonInputTypes.ts +26 -26
  40. package/src/database/_generated/project/internal/class.ts +7 -8
  41. package/src/database/_generated/project/internal/prismaNamespace.ts +8 -7
  42. package/src/database/_generated/project/models/ApiKey.ts +2 -0
  43. package/src/database/_generated/project/models/Artifact.ts +2 -2
  44. package/src/database/_generated/project/models/InstanceCustomStatus.ts +1 -1
  45. package/src/database/_generated/project/models/OperationLog.ts +49 -1
  46. package/src/database/_generated/project/models/UnlockMethod.ts +2 -2
  47. package/src/database/_generated/project/models/UserCompositeViewport.ts +16 -14
  48. package/src/database/_generated/project/models/UserProjectViewport.ts +11 -9
  49. package/src/database/_generated/project/models/WorkerVersion.ts +1 -5
  50. package/src/database/abstractions.ts +25 -3
  51. package/src/database/factory.ts +5 -6
  52. package/src/database/local/backend.ts +148 -18
  53. package/src/database/manager.ts +30 -2
  54. package/src/database/prisma.ts +1 -0
  55. package/src/orchestrator/operation-plan.ts +0 -19
  56. package/src/orchestrator/operation.ts +21 -4
  57. package/src/services.ts +12 -3
  58. package/src/shared/models/backend/unlock-method.ts +7 -13
  59. package/src/shared/models/errors.ts +14 -0
  60. package/src/shared/models/prisma.ts +10 -2
  61. package/src/test-utils/database.ts +34 -6
  62. package/dist/chunk-GJTMJQUW.js.map +0 -1
  63. package/prisma/backend/sqlite/migrations/20250817070609_initiial/migration.sql +0 -34
  64. package/prisma/backend/sqlite/migrations/20250817104948_add_fields/migration.sql +0 -59
  65. package/prisma/backend/sqlite/migrations/20250818083106_a/migration.sql +0 -19
  66. package/prisma/backend/sqlite/migrations/20250818101945_hi/migration.sql +0 -1
  67. package/prisma/backend/sqlite/migrations/20250819082315_a/migration.sql +0 -5
  68. package/prisma/project/migrations/20250816082523_test/migration.sql +0 -72
  69. package/prisma/project/migrations/20250818065643_update/migration.sql +0 -42
  70. package/prisma/project/migrations/20250818070758_a/migration.sql +0 -8
  71. package/prisma/project/migrations/20250818070913_a/migration.sql +0 -8
  72. package/prisma/project/migrations/20250818082720_add_motels/migration.sql +0 -11
  73. package/prisma/project/migrations/20250818112523_hello/migration.sql +0 -35
  74. package/prisma/project/migrations/20250819082305_a/migration.sql +0 -14
  75. package/prisma/project/migrations/20250819165004_add_missing_fields/migration.sql +0 -216
  76. package/prisma/project/migrations/20250819171309_a/migration.sql +0 -22
  77. package/prisma/project/migrations/20250820113949_a/migration.sql +0 -66
  78. package/prisma/project/migrations/20250820144256_b/migration.sql +0 -31
  79. package/prisma/project/migrations/20250820145547_a/migration.sql +0 -24
  80. package/prisma/project/migrations/20250820182517_b/migration.sql +0 -2
  81. package/prisma/project/migrations/20250821172324_a/migration.sql +0 -2
  82. package/prisma/project/migrations/20250822081339_a/migration.sql +0 -219
  83. package/prisma/project/migrations/20250822083742_b/migration.sql +0 -1
  84. package/prisma/project/migrations/20250822105134_boom/migration.sql +0 -1
  85. package/prisma/project/migrations/20250822141028_b/migration.sql +0 -1
  86. package/prisma/project/migrations/20250822142342_b/migration.sql +0 -16
  87. package/prisma/project/migrations/20250824072720_a/migration.sql +0 -1
  88. package/prisma/project/migrations/20250824093656_b/migration.sql +0 -21
  89. package/prisma/project/migrations/20250825082518_a/migration.sql +0 -1
  90. package/prisma/project/migrations/20250825085343_b/migration.sql +0 -1
  91. package/prisma/project/migrations/20250825091312_a/migration.sql +0 -1
  92. package/prisma/project/migrations/20250903095431_hi/migration.sql +0 -44
  93. package/prisma/project/migrations/20250903174255_a/migration.sql +0 -24
  94. package/prisma/project/migrations/20250908095205_hi/migration.sql +0 -18
  95. package/prisma/project/migrations/20250909155857_hi/migration.sql +0 -15
  96. package/prisma/project/migrations/20250921092621_b/migration.sql +0 -33
  97. package/prisma/project/migrations/20250921093911_b/migration.sql +0 -1
  98. package/src/database/_generated/backend/postgresql/models/UserWorkspaseLayout.ts +0 -1065
  99. package/src/database/_generated/backend/sqlite/models/UserWorkspaseLayout.ts +0 -1063
@@ -7,10 +7,11 @@
7
7
  *
8
8
  * 🟢 You can import this file directly.
9
9
  */
10
- export type * from './models/UserWorkspaseLayout.ts'
10
+ export type * from './models/UserWorkspaceLayout.ts'
11
11
  export type * from './models/Library.ts'
12
12
  export type * from './models/Project.ts'
13
13
  export type * from './models/ProjectSpace.ts'
14
14
  export type * from './models/ProjectModelStorage.ts'
15
15
  export type * from './models/PulumiBackend.ts'
16
+ export type * from './models/BackendUnlockMethod.ts'
16
17
  export type * from './commonInputTypes.ts'
@@ -26,8 +26,8 @@ export * as $Enums from './enums.ts'
26
26
  * @example
27
27
  * ```
28
28
  * const prisma = new PrismaClient()
29
- * // Fetch zero or more UserWorkspaseLayouts
30
- * const userWorkspaseLayouts = await prisma.userWorkspaseLayout.findMany()
29
+ * // Fetch zero or more UserWorkspaceLayouts
30
+ * const userWorkspaceLayouts = await prisma.userWorkspaceLayout.findMany()
31
31
  * ```
32
32
  *
33
33
  * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client).
@@ -39,10 +39,10 @@ export { Prisma }
39
39
 
40
40
 
41
41
  /**
42
- * Model UserWorkspaseLayout
42
+ * Model UserWorkspaceLayout
43
43
  *
44
44
  */
45
- export type UserWorkspaseLayout = Prisma.UserWorkspaseLayoutModel
45
+ export type UserWorkspaceLayout = Prisma.UserWorkspaceLayoutModel
46
46
  /**
47
47
  * Model Library
48
48
  *
@@ -68,5 +68,10 @@ export type ProjectModelStorage = Prisma.ProjectModelStorageModel
68
68
  *
69
69
  */
70
70
  export type PulumiBackend = Prisma.PulumiBackendModel
71
+ /**
72
+ * Model BackendUnlockMethod
73
+ * Unlock methods describe trusted identities that can decrypt the backend master key.
74
+ */
75
+ export type BackendUnlockMethod = Prisma.BackendUnlockMethodModel
71
76
 
72
77
 
@@ -1,6 +1,7 @@
1
+
1
2
  /* !!! This is code generated by Prisma. Do not edit directly. !!! */
2
3
  /* eslint-disable */
3
- // @ts-nocheck
4
+ // @ts-nocheck
4
5
  /**
5
6
  * WARNING: This is an internal file that is subject to change!
6
7
  *
@@ -12,71 +13,72 @@
12
13
  import * as runtime from "@prisma/client/runtime/client"
13
14
  import type * as Prisma from "./prismaNamespace.ts"
14
15
 
16
+
15
17
  const config: runtime.GetPrismaClientConfig = {
16
- generator: {
17
- name: "client",
18
- provider: {
19
- fromEnvVar: null,
20
- value: "prisma-client",
18
+ "generator": {
19
+ "name": "client",
20
+ "provider": {
21
+ "fromEnvVar": null,
22
+ "value": "prisma-client"
21
23
  },
22
- output: {
23
- value:
24
- "/home/exeteres/Projects/personal/highstate/packages/platform/backend/src/database/_generated/backend/sqlite",
25
- fromEnvVar: null,
24
+ "output": {
25
+ "value": "/home/exeteres/Projects/personal/highstate/packages/platform/backend/src/database/_generated/backend/sqlite",
26
+ "fromEnvVar": null
26
27
  },
27
- config: {
28
- importFileExtension: "ts",
29
- moduleFormat: "esm",
30
- generatedFileExtension: "ts",
31
- engineType: "client",
28
+ "config": {
29
+ "moduleFormat": "esm",
30
+ "generatedFileExtension": "ts",
31
+ "importFileExtension": "ts",
32
+ "engineType": "client"
32
33
  },
33
- binaryTargets: [
34
+ "binaryTargets": [
34
35
  {
35
- fromEnvVar: null,
36
- value: "linux-nixos",
37
- native: true,
38
- },
36
+ "fromEnvVar": null,
37
+ "value": "linux-nixos",
38
+ "native": true
39
+ }
39
40
  ],
40
- previewFeatures: ["driverAdapters", "queryCompiler"],
41
- sourceFilePath:
42
- "/home/exeteres/Projects/personal/highstate/packages/platform/backend/prisma/backend/sqlite/main.prisma",
43
- isCustomOutput: true,
41
+ "previewFeatures": [
42
+ "driverAdapters",
43
+ "queryCompiler"
44
+ ],
45
+ "sourceFilePath": "/home/exeteres/Projects/personal/highstate/packages/platform/backend/prisma/backend/sqlite/main.prisma",
46
+ "isCustomOutput": true
44
47
  },
45
- relativePath: "../../../../../prisma/backend/sqlite",
46
- clientVersion: "6.14.0",
47
- engineVersion: "717184b7b35ea05dfa71a3236b7af656013e1e49",
48
- datasourceNames: ["db"],
49
- activeProvider: "sqlite",
50
- postinstall: false,
51
- inlineDatasources: {
52
- db: {
53
- url: {
54
- fromEnvVar: null,
55
- value: "<invalid>",
56
- },
57
- },
48
+ "relativePath": "../../../../../prisma/backend/sqlite",
49
+ "clientVersion": "6.14.0",
50
+ "engineVersion": "717184b7b35ea05dfa71a3236b7af656013e1e49",
51
+ "datasourceNames": [
52
+ "db"
53
+ ],
54
+ "activeProvider": "sqlite",
55
+ "postinstall": false,
56
+ "inlineDatasources": {
57
+ "db": {
58
+ "url": {
59
+ "fromEnvVar": "HIGHSTATE_MIGRATION_DATABASE_URL",
60
+ "value": null
61
+ }
62
+ }
58
63
  },
59
- inlineSchema:
60
- 'model UserWorkspaseLayout {\n /// The opaque ID of the user to which this layout belongs.\n userId String @id\n\n /// The layout of the user workspace managed by the frontend.\n layout Json\n}\n\nmodel Library {\n /// The CUIDv2 of the library.\n id String @id @default(cuid(2))\n\n /// The metadata of the library managed by the backend.\n ///\n /// [CommonObjectMeta]\n meta Json\n\n /// The spec of the library.\n ///\n /// [LibrarySpec]\n spec Json\n\n /// The projects using this library.\n projects Project[]\n}\n\nmodel Project {\n /// The CUIDv2 of the project.\n id String @id @default(cuid(2))\n\n /// Project meta managed by the backend.\n ///\n /// [CommonObjectMeta]\n meta Json\n\n /// The name of the project within the space.\n name String\n\n /// The ID of the project space this project belongs to.\n spaceId String\n\n /// The ID of the project model storage this project uses.\n modelStorageId String\n\n /// The ID of the library used by this project.\n libraryId String\n\n /// The ID of the Pulumi backend used by this project.\n pulumiBackendId String\n\n /// Encrypted project master key in AGE format.\n encryptedMasterKey String\n\n /// The unlock suite for this project.\n ///\n /// [ProjectUnlockSuite]\n unlockSuite Json\n\n /// The current version of the project database.\n /// This is used to determine if the project needs to be migrated.\n databaseVersion Int\n\n /// The date and time when the project was created.\n createdAt DateTime @default(now())\n\n /// The date and time when the project was last updated.\n updatedAt DateTime @updatedAt\n\n /// The project space this project belongs to.\n space ProjectSpace @relation(fields: [spaceId], references: [id])\n\n /// The project model storage this project uses.\n modelStorage ProjectModelStorage @relation(fields: [modelStorageId], references: [id])\n\n /// The library used by this project.\n library Library @relation(fields: [libraryId], references: [id])\n\n /// The Pulumi backend used by this project.\n pulumiBackend PulumiBackend @relation(fields: [pulumiBackendId], references: [id])\n\n @@unique([spaceId, name])\n}\n\nmodel ProjectSpace {\n /// The CUIDv2 of the project space.\n id String @id @default(cuid(2))\n\n /// The name of the project space within the parent space.\n ///\n /// Will be null for the global project space.\n name String?\n\n /// The ID of the parent project space, if any.\n parentId String?\n\n /// The metadata of the project space managed by the backend.\n ///\n /// [CommonObjectMeta]\n meta Json\n\n /// The projects in this project space.\n projects Project[]\n\n /// The parent project space, if any.\n parent ProjectSpace? @relation("ProjectSpaceHierarchy", fields: [parentId], references: [id])\n\n /// The child project spaces, if any.\n children ProjectSpace[] @relation("ProjectSpaceHierarchy")\n}\n\nmodel ProjectModelStorage {\n /// The CUIDv2 of the project model storage.\n id String @id @default(cuid(2))\n\n /// The metadata of the project model storage managed by the backend.\n ///\n /// [CommonObjectMeta]\n meta Json\n\n /// The specification of the project model storage.\n ///\n /// [ProjectModelStorageSpec]\n spec Json\n\n /// The projects using this model storage.\n projects Project[]\n}\n\nmodel PulumiBackend {\n /// The CUIDv2 of the Pulumi backend.\n id String @id @default(cuid(2))\n\n /// The backend meta managed by the backend.\n ///\n /// [CommonObjectMeta]\n meta Json\n\n /// The spec of the Pulumi backend.\n ///\n /// [PulumiBackendSpec]\n spec Json\n\n /// The projects using this backend.\n projects Project[]\n}\n\ndatasource db {\n provider = "sqlite"\n directUrl = env("HIGHSTATE_MIGRATION_DATABASE_URL")\n}\n\ngenerator client {\n provider = "prisma-client"\n previewFeatures = ["queryCompiler", "driverAdapters"]\n output = "../../../src/database/_generated/backend/sqlite"\n moduleFormat = "esm"\n generatedFileExtension = "ts"\n importFileExtension = "ts"\n}\n\ngenerator json {\n provider = "prisma-json-types-generator"\n}\n',
61
- inlineSchemaHash: "5f72ff333e4519a038ec922562f162a877719127538df9de3cc6af3d476a0ef7",
62
- copyEngine: true,
63
- runtimeDataModel: {
64
- models: {},
65
- enums: {},
66
- types: {},
64
+ "inlineSchema": "model UserWorkspaceLayout {\n /// The opaque ID of the user to which this layout belongs.\n userId String @id\n\n /// The layout of the user workspace managed by the frontend.\n ///\n /// ![unknown]\n layout Json\n}\n\nmodel Library {\n /// The CUIDv2 of the library.\n id String @id @default(cuid(2))\n\n /// The metadata of the library managed by the backend.\n ///\n /// [CommonObjectMeta]\n meta Json\n\n /// The spec of the library.\n ///\n /// [LibrarySpec]\n spec Json\n\n /// The projects using this library.\n projects Project[]\n}\n\nmodel Project {\n /// The CUIDv2 of the project.\n id String @id @default(cuid(2))\n\n /// Project meta managed by the backend.\n ///\n /// [CommonObjectMeta]\n meta Json\n\n /// The name of the project within the space.\n name String\n\n /// The ID of the project space this project belongs to.\n spaceId String\n\n /// The ID of the project model storage this project uses.\n modelStorageId String\n\n /// The ID of the library used by this project.\n libraryId String\n\n /// The ID of the Pulumi backend used by this project.\n pulumiBackendId String\n\n /// Encrypted project master key in AGE format.\n encryptedMasterKey String\n\n /// The unlock suite for this project.\n ///\n /// [ProjectUnlockSuite]\n unlockSuite Json\n\n /// The current version of the project database.\n /// This is used to determine if the project needs to be migrated.\n databaseVersion Int\n\n /// The time when the project was created.\n createdAt DateTime @default(now())\n\n /// The time when the project was last updated.\n updatedAt DateTime @updatedAt\n\n /// The project space this project belongs to.\n space ProjectSpace @relation(fields: [spaceId], references: [id])\n\n /// The project model storage this project uses.\n modelStorage ProjectModelStorage @relation(fields: [modelStorageId], references: [id])\n\n /// The library used by this project.\n library Library @relation(fields: [libraryId], references: [id])\n\n /// The Pulumi backend used by this project.\n pulumiBackend PulumiBackend @relation(fields: [pulumiBackendId], references: [id])\n\n @@unique([spaceId, name])\n}\n\nmodel ProjectSpace {\n /// The CUIDv2 of the project space.\n id String @id @default(cuid(2))\n\n /// The name of the project space within the parent space.\n ///\n /// Will be null for the global project space.\n name String?\n\n /// The ID of the parent project space, if any.\n parentId String?\n\n /// The metadata of the project space managed by the backend.\n ///\n /// [CommonObjectMeta]\n meta Json\n\n /// The projects in this project space.\n projects Project[]\n\n /// The parent project space, if any.\n parent ProjectSpace? @relation(\"ProjectSpaceHierarchy\", fields: [parentId], references: [id])\n\n /// The child project spaces, if any.\n children ProjectSpace[] @relation(\"ProjectSpaceHierarchy\")\n\n @@unique([parentId, name])\n}\n\nmodel ProjectModelStorage {\n /// The CUIDv2 of the project model storage.\n id String @id @default(cuid(2))\n\n /// The metadata of the project model storage managed by the backend.\n ///\n /// [CommonObjectMeta]\n meta Json\n\n /// The specification of the project model storage.\n ///\n /// [ProjectModelStorageSpec]\n spec Json\n\n /// The projects using this model storage.\n projects Project[]\n}\n\nmodel PulumiBackend {\n /// The CUIDv2 of the Pulumi backend.\n id String @id @default(cuid(2))\n\n /// The backend meta managed by the backend.\n ///\n /// [CommonObjectMeta]\n meta Json\n\n /// The spec of the Pulumi backend.\n ///\n /// [PulumiBackendSpec]\n spec Json\n\n /// The projects using this backend.\n projects Project[]\n}\n\n/// Unlock methods describe trusted identities that can decrypt the backend master key.\nmodel BackendUnlockMethod {\n /// The CUIDv2 of the unlock method.\n id String @id @default(cuid(2))\n\n /// The metadata of the unlock method managed by the backend.\n /// \n /// [BackendUnlockMethodMeta]\n meta Json\n\n /// The AGE recipient for this unlock method.\n recipient String @unique\n\n /// The time when the unlock method was created.\n createdAt DateTime @default(now())\n\n /// The time when the unlock method was last updated.\n updatedAt DateTime @updatedAt\n}\n\ndatasource db {\n provider = \"sqlite\"\n url = env(\"HIGHSTATE_MIGRATION_DATABASE_URL\")\n}\n\ngenerator client {\n provider = \"prisma-client\"\n previewFeatures = [\"queryCompiler\", \"driverAdapters\"]\n output = \"../../../src/database/_generated/backend/sqlite\"\n moduleFormat = \"esm\"\n generatedFileExtension = \"ts\"\n importFileExtension = \"ts\"\n}\n\ngenerator json {\n provider = \"prisma-json-types-generator\"\n}\n",
65
+ "inlineSchemaHash": "a1ceaf17c7e387f39b598365de3b12cae9e6d31f021d9ab4f958f2c85bb34129",
66
+ "copyEngine": true,
67
+ "runtimeDataModel": {
68
+ "models": {},
69
+ "enums": {},
70
+ "types": {}
67
71
  },
68
- dirname: "",
72
+ "dirname": ""
69
73
  }
70
74
 
71
- config.runtimeDataModel = JSON.parse(
72
- '{"models":{"UserWorkspaseLayout":{"fields":[{"name":"userId","kind":"scalar","type":"String"},{"name":"layout","kind":"scalar","type":"Json"}],"dbName":null},"Library":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"spec","kind":"scalar","type":"Json"},{"name":"projects","kind":"object","type":"Project","relationName":"LibraryToProject"}],"dbName":null},"Project":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"name","kind":"scalar","type":"String"},{"name":"spaceId","kind":"scalar","type":"String"},{"name":"modelStorageId","kind":"scalar","type":"String"},{"name":"libraryId","kind":"scalar","type":"String"},{"name":"pulumiBackendId","kind":"scalar","type":"String"},{"name":"encryptedMasterKey","kind":"scalar","type":"String"},{"name":"unlockSuite","kind":"scalar","type":"Json"},{"name":"databaseVersion","kind":"scalar","type":"Int"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"space","kind":"object","type":"ProjectSpace","relationName":"ProjectToProjectSpace"},{"name":"modelStorage","kind":"object","type":"ProjectModelStorage","relationName":"ProjectToProjectModelStorage"},{"name":"library","kind":"object","type":"Library","relationName":"LibraryToProject"},{"name":"pulumiBackend","kind":"object","type":"PulumiBackend","relationName":"ProjectToPulumiBackend"}],"dbName":null},"ProjectSpace":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"name","kind":"scalar","type":"String"},{"name":"parentId","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"projects","kind":"object","type":"Project","relationName":"ProjectToProjectSpace"},{"name":"parent","kind":"object","type":"ProjectSpace","relationName":"ProjectSpaceHierarchy"},{"name":"children","kind":"object","type":"ProjectSpace","relationName":"ProjectSpaceHierarchy"}],"dbName":null},"ProjectModelStorage":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"spec","kind":"scalar","type":"Json"},{"name":"projects","kind":"object","type":"Project","relationName":"ProjectToProjectModelStorage"}],"dbName":null},"PulumiBackend":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"spec","kind":"scalar","type":"Json"},{"name":"projects","kind":"object","type":"Project","relationName":"ProjectToPulumiBackend"}],"dbName":null}},"enums":{},"types":{}}',
73
- )
75
+ config.runtimeDataModel = JSON.parse("{\"models\":{\"UserWorkspaceLayout\":{\"fields\":[{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"layout\",\"kind\":\"scalar\",\"type\":\"Json\"}],\"dbName\":null},\"Library\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"meta\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"spec\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"projects\",\"kind\":\"object\",\"type\":\"Project\",\"relationName\":\"LibraryToProject\"}],\"dbName\":null},\"Project\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"meta\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"spaceId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"modelStorageId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"libraryId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"pulumiBackendId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"encryptedMasterKey\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"unlockSuite\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"databaseVersion\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"space\",\"kind\":\"object\",\"type\":\"ProjectSpace\",\"relationName\":\"ProjectToProjectSpace\"},{\"name\":\"modelStorage\",\"kind\":\"object\",\"type\":\"ProjectModelStorage\",\"relationName\":\"ProjectToProjectModelStorage\"},{\"name\":\"library\",\"kind\":\"object\",\"type\":\"Library\",\"relationName\":\"LibraryToProject\"},{\"name\":\"pulumiBackend\",\"kind\":\"object\",\"type\":\"PulumiBackend\",\"relationName\":\"ProjectToPulumiBackend\"}],\"dbName\":null},\"ProjectSpace\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"parentId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"meta\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"projects\",\"kind\":\"object\",\"type\":\"Project\",\"relationName\":\"ProjectToProjectSpace\"},{\"name\":\"parent\",\"kind\":\"object\",\"type\":\"ProjectSpace\",\"relationName\":\"ProjectSpaceHierarchy\"},{\"name\":\"children\",\"kind\":\"object\",\"type\":\"ProjectSpace\",\"relationName\":\"ProjectSpaceHierarchy\"}],\"dbName\":null},\"ProjectModelStorage\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"meta\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"spec\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"projects\",\"kind\":\"object\",\"type\":\"Project\",\"relationName\":\"ProjectToProjectModelStorage\"}],\"dbName\":null},\"PulumiBackend\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"meta\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"spec\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"projects\",\"kind\":\"object\",\"type\":\"Project\",\"relationName\":\"ProjectToPulumiBackend\"}],\"dbName\":null},\"BackendUnlockMethod\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"meta\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"recipient\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}")
74
76
  config.engineWasm = undefined
75
77
 
76
78
  async function decodeBase64AsWasm(wasmBase64: string): Promise<WebAssembly.Module> {
77
- const { Buffer } = await import("node:buffer")
78
- const base64Data = wasmBase64.replace("data:application/wasm;base64,", "")
79
- const wasmArray = new Uint8Array(Buffer.from(base64Data, "base64"))
79
+ const { Buffer } = await import('node:buffer')
80
+ const base64Data = wasmBase64.replace('data:application/wasm;base64,', '')
81
+ const wasmArray = new Uint8Array(Buffer.from(base64Data, 'base64'))
80
82
  return new WebAssembly.Module(wasmArray)
81
83
  }
82
84
 
@@ -86,81 +88,72 @@ config.compilerWasm = {
86
88
  getQueryCompilerWasmModule: async () => {
87
89
  const { wasm } = await import("@prisma/client/runtime/query_compiler_bg.sqlite.wasm-base64.mjs")
88
90
  return await decodeBase64AsWasm(wasm)
89
- },
91
+ }
90
92
  }
91
93
 
94
+
95
+
96
+
92
97
  export type LogOptions<ClientOptions extends Prisma.PrismaClientOptions> =
93
- "log" extends keyof ClientOptions
94
- ? ClientOptions["log"] extends Array<Prisma.LogLevel | Prisma.LogDefinition>
95
- ? Prisma.GetEvents<ClientOptions["log"]>
96
- : never
97
- : never
98
+ 'log' extends keyof ClientOptions ? ClientOptions['log'] extends Array<Prisma.LogLevel | Prisma.LogDefinition> ? Prisma.GetEvents<ClientOptions['log']> : never : never
98
99
 
99
100
  export interface PrismaClientConstructor {
100
- /**
101
+ /**
101
102
  * ## Prisma Client
102
- *
103
+ *
103
104
  * Type-safe database client for TypeScript
104
105
  * @example
105
106
  * ```
106
107
  * const prisma = new PrismaClient()
107
- * // Fetch zero or more UserWorkspaseLayouts
108
- * const userWorkspaseLayouts = await prisma.userWorkspaseLayout.findMany()
108
+ * // Fetch zero or more UserWorkspaceLayouts
109
+ * const userWorkspaceLayouts = await prisma.userWorkspaceLayout.findMany()
109
110
  * ```
110
- *
111
+ *
111
112
  * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client).
112
113
  */
113
114
 
114
115
  new <
115
116
  Options extends Prisma.PrismaClientOptions,
116
117
  LogOpts extends LogOptions<Options>,
117
- OmitOpts extends Prisma.PrismaClientOptions["omit"] = Options extends { omit: infer U }
118
- ? U
119
- : Prisma.PrismaClientOptions["omit"],
120
- ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs,
121
- >(
122
- options?: Prisma.Subset<Options, Prisma.PrismaClientOptions>,
123
- ): PrismaClient<LogOpts, OmitOpts, ExtArgs>
118
+ OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'],
119
+ ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
120
+ >(options?: Prisma.Subset<Options, Prisma.PrismaClientOptions> ): PrismaClient<LogOpts, OmitOpts, ExtArgs>
124
121
  }
125
122
 
126
123
  /**
127
124
  * ## Prisma Client
128
- *
125
+ *
129
126
  * Type-safe database client for TypeScript
130
127
  * @example
131
128
  * ```
132
129
  * const prisma = new PrismaClient()
133
- * // Fetch zero or more UserWorkspaseLayouts
134
- * const userWorkspaseLayouts = await prisma.userWorkspaseLayout.findMany()
130
+ * // Fetch zero or more UserWorkspaceLayouts
131
+ * const userWorkspaceLayouts = await prisma.userWorkspaceLayout.findMany()
135
132
  * ```
136
- *
133
+ *
137
134
  * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client).
138
135
  */
139
136
 
140
137
  export interface PrismaClient<
141
138
  in LogOpts extends Prisma.LogLevel = never,
142
- in out OmitOpts extends Prisma.PrismaClientOptions["omit"] = Prisma.PrismaClientOptions["omit"],
143
- in out ExtArgs extends
144
- runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs,
139
+ in out OmitOpts extends Prisma.PrismaClientOptions['omit'] = Prisma.PrismaClientOptions['omit'],
140
+ in out ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
145
141
  > {
146
- [K: symbol]: { types: Prisma.TypeMap<ExtArgs>["other"] }
142
+ [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['other'] }
147
143
 
148
- $on<V extends LogOpts>(
149
- eventType: V,
150
- callback: (event: V extends "query" ? Prisma.QueryEvent : Prisma.LogEvent) => void,
151
- ): PrismaClient
144
+ $on<V extends LogOpts>(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): PrismaClient;
152
145
 
153
146
  /**
154
147
  * Connect with the database
155
148
  */
156
- $connect(): runtime.Types.Utils.JsPromise<void>
149
+ $connect(): runtime.Types.Utils.JsPromise<void>;
157
150
 
158
151
  /**
159
152
  * Disconnect from the database
160
153
  */
161
- $disconnect(): runtime.Types.Utils.JsPromise<void>
154
+ $disconnect(): runtime.Types.Utils.JsPromise<void>;
162
155
 
163
- /**
156
+ /**
164
157
  * Executes a prepared raw query and returns the number of affected rows.
165
158
  * @example
166
159
  * ```
@@ -169,10 +162,7 @@ export interface PrismaClient<
169
162
  *
170
163
  * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
171
164
  */
172
- $executeRaw<T = unknown>(
173
- query: TemplateStringsArray | Prisma.Sql,
174
- ...values: any[]
175
- ): Prisma.PrismaPromise<number>
165
+ $executeRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<number>;
176
166
 
177
167
  /**
178
168
  * Executes a raw query and returns the number of affected rows.
@@ -184,7 +174,7 @@ export interface PrismaClient<
184
174
  *
185
175
  * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
186
176
  */
187
- $executeRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<number>
177
+ $executeRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<number>;
188
178
 
189
179
  /**
190
180
  * Performs a prepared raw query and returns the `SELECT` data.
@@ -195,10 +185,7 @@ export interface PrismaClient<
195
185
  *
196
186
  * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
197
187
  */
198
- $queryRaw<T = unknown>(
199
- query: TemplateStringsArray | Prisma.Sql,
200
- ...values: any[]
201
- ): Prisma.PrismaPromise<T>
188
+ $queryRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<T>;
202
189
 
203
190
  /**
204
191
  * Performs a raw query and returns the `SELECT` data.
@@ -210,7 +197,8 @@ export interface PrismaClient<
210
197
  *
211
198
  * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
212
199
  */
213
- $queryRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<T>
200
+ $queryRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<T>;
201
+
214
202
 
215
203
  /**
216
204
  * Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole.
@@ -222,94 +210,87 @@ export interface PrismaClient<
222
210
  * prisma.user.create({ data: { name: 'Alice' } }),
223
211
  * ])
224
212
  * ```
225
- *
213
+ *
226
214
  * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client/transactions).
227
215
  */
228
- $transaction<P extends Prisma.PrismaPromise<any>[]>(
229
- arg: [...P],
230
- options?: { isolationLevel?: Prisma.TransactionIsolationLevel },
231
- ): runtime.Types.Utils.JsPromise<runtime.Types.Utils.UnwrapTuple<P>>
232
-
233
- $transaction<R>(
234
- fn: (prisma: Omit<PrismaClient, runtime.ITXClientDenyList>) => runtime.Types.Utils.JsPromise<R>,
235
- options?: {
236
- maxWait?: number
237
- timeout?: number
238
- isolationLevel?: Prisma.TransactionIsolationLevel
239
- },
240
- ): runtime.Types.Utils.JsPromise<R>
241
-
242
- $extends: runtime.Types.Extensions.ExtendsHook<
243
- "extends",
244
- Prisma.TypeMapCb<OmitOpts>,
245
- ExtArgs,
246
- runtime.Types.Utils.Call<
247
- Prisma.TypeMapCb<OmitOpts>,
248
- {
249
- extArgs: ExtArgs
250
- }
251
- >
252
- >
216
+ $transaction<P extends Prisma.PrismaPromise<any>[]>(arg: [...P], options?: { isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise<runtime.Types.Utils.UnwrapTuple<P>>
253
217
 
254
- /**
255
- * `prisma.userWorkspaseLayout`: Exposes CRUD operations for the **UserWorkspaseLayout** model.
256
- * Example usage:
257
- * ```ts
258
- * // Fetch zero or more UserWorkspaseLayouts
259
- * const userWorkspaseLayouts = await prisma.userWorkspaseLayout.findMany()
260
- * ```
261
- */
262
- get userWorkspaseLayout(): Prisma.UserWorkspaseLayoutDelegate<ExtArgs, { omit: OmitOpts }>
218
+ $transaction<R>(fn: (prisma: Omit<PrismaClient, runtime.ITXClientDenyList>) => runtime.Types.Utils.JsPromise<R>, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise<R>
219
+
220
+
221
+ $extends: runtime.Types.Extensions.ExtendsHook<"extends", Prisma.TypeMapCb<OmitOpts>, ExtArgs, runtime.Types.Utils.Call<Prisma.TypeMapCb<OmitOpts>, {
222
+ extArgs: ExtArgs
223
+ }>>
224
+
225
+ /**
226
+ * `prisma.userWorkspaceLayout`: Exposes CRUD operations for the **UserWorkspaceLayout** model.
227
+ * Example usage:
228
+ * ```ts
229
+ * // Fetch zero or more UserWorkspaceLayouts
230
+ * const userWorkspaceLayouts = await prisma.userWorkspaceLayout.findMany()
231
+ * ```
232
+ */
233
+ get userWorkspaceLayout(): Prisma.UserWorkspaceLayoutDelegate<ExtArgs, { omit: OmitOpts }>;
263
234
 
264
235
  /**
265
236
  * `prisma.library`: Exposes CRUD operations for the **Library** model.
266
- * Example usage:
267
- * ```ts
268
- * // Fetch zero or more Libraries
269
- * const libraries = await prisma.library.findMany()
270
- * ```
271
- */
272
- get library(): Prisma.LibraryDelegate<ExtArgs, { omit: OmitOpts }>
237
+ * Example usage:
238
+ * ```ts
239
+ * // Fetch zero or more Libraries
240
+ * const libraries = await prisma.library.findMany()
241
+ * ```
242
+ */
243
+ get library(): Prisma.LibraryDelegate<ExtArgs, { omit: OmitOpts }>;
273
244
 
274
245
  /**
275
246
  * `prisma.project`: Exposes CRUD operations for the **Project** model.
276
- * Example usage:
277
- * ```ts
278
- * // Fetch zero or more Projects
279
- * const projects = await prisma.project.findMany()
280
- * ```
281
- */
282
- get project(): Prisma.ProjectDelegate<ExtArgs, { omit: OmitOpts }>
247
+ * Example usage:
248
+ * ```ts
249
+ * // Fetch zero or more Projects
250
+ * const projects = await prisma.project.findMany()
251
+ * ```
252
+ */
253
+ get project(): Prisma.ProjectDelegate<ExtArgs, { omit: OmitOpts }>;
283
254
 
284
255
  /**
285
256
  * `prisma.projectSpace`: Exposes CRUD operations for the **ProjectSpace** model.
286
- * Example usage:
287
- * ```ts
288
- * // Fetch zero or more ProjectSpaces
289
- * const projectSpaces = await prisma.projectSpace.findMany()
290
- * ```
291
- */
292
- get projectSpace(): Prisma.ProjectSpaceDelegate<ExtArgs, { omit: OmitOpts }>
257
+ * Example usage:
258
+ * ```ts
259
+ * // Fetch zero or more ProjectSpaces
260
+ * const projectSpaces = await prisma.projectSpace.findMany()
261
+ * ```
262
+ */
263
+ get projectSpace(): Prisma.ProjectSpaceDelegate<ExtArgs, { omit: OmitOpts }>;
293
264
 
294
265
  /**
295
266
  * `prisma.projectModelStorage`: Exposes CRUD operations for the **ProjectModelStorage** model.
296
- * Example usage:
297
- * ```ts
298
- * // Fetch zero or more ProjectModelStorages
299
- * const projectModelStorages = await prisma.projectModelStorage.findMany()
300
- * ```
301
- */
302
- get projectModelStorage(): Prisma.ProjectModelStorageDelegate<ExtArgs, { omit: OmitOpts }>
267
+ * Example usage:
268
+ * ```ts
269
+ * // Fetch zero or more ProjectModelStorages
270
+ * const projectModelStorages = await prisma.projectModelStorage.findMany()
271
+ * ```
272
+ */
273
+ get projectModelStorage(): Prisma.ProjectModelStorageDelegate<ExtArgs, { omit: OmitOpts }>;
303
274
 
304
275
  /**
305
276
  * `prisma.pulumiBackend`: Exposes CRUD operations for the **PulumiBackend** model.
306
- * Example usage:
307
- * ```ts
308
- * // Fetch zero or more PulumiBackends
309
- * const pulumiBackends = await prisma.pulumiBackend.findMany()
310
- * ```
311
- */
312
- get pulumiBackend(): Prisma.PulumiBackendDelegate<ExtArgs, { omit: OmitOpts }>
277
+ * Example usage:
278
+ * ```ts
279
+ * // Fetch zero or more PulumiBackends
280
+ * const pulumiBackends = await prisma.pulumiBackend.findMany()
281
+ * ```
282
+ */
283
+ get pulumiBackend(): Prisma.PulumiBackendDelegate<ExtArgs, { omit: OmitOpts }>;
284
+
285
+ /**
286
+ * `prisma.backendUnlockMethod`: Exposes CRUD operations for the **BackendUnlockMethod** model.
287
+ * Example usage:
288
+ * ```ts
289
+ * // Fetch zero or more BackendUnlockMethods
290
+ * const backendUnlockMethods = await prisma.backendUnlockMethod.findMany()
291
+ * ```
292
+ */
293
+ get backendUnlockMethod(): Prisma.BackendUnlockMethodDelegate<ExtArgs, { omit: OmitOpts }>;
313
294
  }
314
295
 
315
296
  export function getPrismaClientClass(dirname: string): PrismaClientConstructor {