alepha 0.18.2 → 0.18.3
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/assets/devtools-ui/200.html +2 -2
- package/assets/devtools-ui/200.html.br +0 -0
- package/assets/devtools-ui/404.html +2 -2
- package/assets/devtools-ui/404.html.br +0 -0
- package/assets/devtools-ui/{asset.BfSBZ5Dd.css → asset.hG_f8HuK.css} +1 -1
- package/assets/devtools-ui/asset.hG_f8HuK.css.br +0 -0
- package/assets/devtools-ui/chunk.B3au4Lhg.js +1 -0
- package/assets/devtools-ui/chunk.B3au4Lhg.js.br +0 -0
- package/assets/devtools-ui/chunk.BLOrlnMB.js +1 -0
- package/assets/devtools-ui/chunk.BLOrlnMB.js.br +0 -0
- package/assets/devtools-ui/chunk.BLR01ljW.js +1 -0
- package/assets/devtools-ui/chunk.BLR01ljW.js.br +0 -0
- package/assets/devtools-ui/chunk.BTXaIUlA.js +1 -0
- package/assets/devtools-ui/chunk.BTXaIUlA.js.br +0 -0
- package/assets/devtools-ui/{chunk.lJL-lgnW.js → chunk.BhJaxmm8.js} +1 -1
- package/assets/devtools-ui/chunk.BhJaxmm8.js.br +0 -0
- package/assets/devtools-ui/chunk.BtoNxFuL.js +1 -0
- package/assets/devtools-ui/chunk.BtoNxFuL.js.br +0 -0
- package/assets/devtools-ui/chunk.C8YUV2Wd.js +1 -0
- package/assets/devtools-ui/chunk.C8YUV2Wd.js.br +0 -0
- package/assets/devtools-ui/{chunk.M6wyKO_3.js → chunk.CBbIgDzE.js} +2 -2
- package/assets/devtools-ui/chunk.CBbIgDzE.js.br +0 -0
- package/assets/devtools-ui/chunk.CFqIniwA.js +1 -0
- package/assets/devtools-ui/chunk.CFqIniwA.js.br +0 -0
- package/assets/devtools-ui/chunk.CLFF7f7-.js +1 -0
- package/assets/devtools-ui/chunk.CLFF7f7-.js.br +0 -0
- package/assets/devtools-ui/chunk.CRsBbA10.js +1 -0
- package/assets/devtools-ui/chunk.CRsBbA10.js.br +0 -0
- package/assets/devtools-ui/{chunk.DbEH1oOB.js → chunk.CZPo6v95.js} +1 -1
- package/assets/devtools-ui/chunk.CZPo6v95.js.br +0 -0
- package/assets/devtools-ui/chunk.D0fWgNos.js +1 -0
- package/assets/devtools-ui/chunk.D0fWgNos.js.br +1 -0
- package/assets/devtools-ui/chunk.D7-0ziQ6.js +1 -0
- package/assets/devtools-ui/chunk.D7-0ziQ6.js.br +0 -0
- package/assets/devtools-ui/chunk.DAewe0vm.js +1 -0
- package/assets/devtools-ui/chunk.DAewe0vm.js.br +0 -0
- package/assets/devtools-ui/chunk.DJRQEYqK.js +1 -0
- package/assets/devtools-ui/chunk.DJRQEYqK.js.br +0 -0
- package/assets/devtools-ui/{chunk.CZl6J9DF.js → chunk.DMAxv14p.js} +1 -1
- package/assets/devtools-ui/chunk.DMAxv14p.js.br +0 -0
- package/assets/devtools-ui/{chunk.BT2IiBkZ.js → chunk.DMImnNjU.js} +1 -1
- package/assets/devtools-ui/chunk.DMImnNjU.js.br +0 -0
- package/assets/devtools-ui/chunk.DeeQsidk.js +9 -0
- package/assets/devtools-ui/chunk.DeeQsidk.js.br +0 -0
- package/assets/devtools-ui/chunk.DqEwn9Vj.js +7 -0
- package/assets/devtools-ui/chunk.DqEwn9Vj.js.br +0 -0
- package/assets/devtools-ui/chunk.Dt8OsQey.js +1 -0
- package/assets/devtools-ui/chunk.Dt8OsQey.js.br +0 -0
- package/assets/devtools-ui/{chunk.B9pX3zit.js → chunk.Dtp8oa_f.js} +1 -1
- package/assets/devtools-ui/chunk.Dtp8oa_f.js.br +0 -0
- package/assets/devtools-ui/chunk.Dx3JzAYM.js +1 -0
- package/assets/devtools-ui/chunk.Dx3JzAYM.js.br +0 -0
- package/assets/devtools-ui/chunk.GCOj1-5E.js +1 -0
- package/assets/devtools-ui/chunk.GCOj1-5E.js.br +0 -0
- package/assets/devtools-ui/chunk.IC1LD8BH.js +1 -0
- package/assets/devtools-ui/chunk.IC1LD8BH.js.br +0 -0
- package/assets/devtools-ui/chunk.IwuB_TqW.js +1 -0
- package/assets/devtools-ui/chunk.IwuB_TqW.js.br +0 -0
- package/assets/devtools-ui/chunk.Qqapj2zq.js +1 -0
- package/assets/devtools-ui/chunk.Qqapj2zq.js.br +0 -0
- package/assets/devtools-ui/{chunk.C79YouPp.js → chunk.TKKKndOy.js} +1 -1
- package/assets/devtools-ui/chunk.TKKKndOy.js.br +0 -0
- package/assets/devtools-ui/chunk.YHTVhFQT.js +1 -0
- package/assets/devtools-ui/chunk.YHTVhFQT.js.br +0 -0
- package/assets/devtools-ui/chunk.fnod6uEi.js +1 -0
- package/assets/devtools-ui/chunk.fnod6uEi.js.br +0 -0
- package/assets/devtools-ui/chunk.mOCRmXjo.js +1 -0
- package/assets/devtools-ui/chunk.mOCRmXjo.js.br +0 -0
- package/assets/devtools-ui/chunk.qZTNEAK0.js +1 -0
- package/assets/devtools-ui/chunk.qZTNEAK0.js.br +0 -0
- package/assets/devtools-ui/chunk.rc9m0y4-.js +1 -0
- package/assets/devtools-ui/chunk.rc9m0y4-.js.br +0 -0
- package/assets/devtools-ui/entry.Cxc5QLCU.js +80 -0
- package/assets/devtools-ui/entry.Cxc5QLCU.js.br +0 -0
- package/assets/devtools-ui/index.html +2 -2
- package/assets/devtools-ui/index.html.br +0 -0
- package/assets/swagger-ui/swagger-ui-bundle.js +1 -1
- package/assets/swagger-ui/swagger-ui.css +1 -1
- package/dist/api/audits/index.d.ts +61 -5
- package/dist/api/audits/index.d.ts.map +1 -1
- package/dist/api/files/index.d.ts +61 -5
- package/dist/api/files/index.d.ts.map +1 -1
- package/dist/api/jobs/index.d.ts +61 -5
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/jobs/index.js +4 -2
- package/dist/api/jobs/index.js.map +1 -1
- package/dist/api/keys/index.d.ts +5 -5
- package/dist/api/notifications/index.browser.js +44 -1
- package/dist/api/notifications/index.browser.js.map +1 -1
- package/dist/api/notifications/index.d.ts +187 -2
- package/dist/api/notifications/index.d.ts.map +1 -1
- package/dist/api/notifications/index.js +143 -8
- package/dist/api/notifications/index.js.map +1 -1
- package/dist/api/parameters/index.d.ts +61 -5
- package/dist/api/parameters/index.d.ts.map +1 -1
- package/dist/api/users/index.d.ts +330 -93
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +27 -36
- package/dist/api/users/index.js.map +1 -1
- package/dist/cli/config/index.d.ts +46 -0
- package/dist/cli/config/index.d.ts.map +1 -0
- package/dist/cli/config/index.js +20 -0
- package/dist/cli/config/index.js.map +1 -0
- package/dist/cli/core/index.d.ts +69 -66
- package/dist/cli/core/index.d.ts.map +1 -1
- package/dist/cli/core/index.js +329 -196
- package/dist/cli/core/index.js.map +1 -1
- package/dist/cli/platform/index.d.ts +302 -63
- package/dist/cli/platform/index.d.ts.map +1 -1
- package/dist/cli/platform/index.js +455 -25
- package/dist/cli/platform/index.js.map +1 -1
- package/dist/core/index.browser.js +125 -87
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +62 -53
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +125 -87
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +125 -87
- package/dist/core/index.native.js.map +1 -1
- package/dist/core/index.workerd.js +125 -87
- package/dist/core/index.workerd.js.map +1 -1
- package/dist/crypto/index.d.ts +18 -1
- package/dist/crypto/index.d.ts.map +1 -1
- package/dist/crypto/index.js +29 -3
- package/dist/crypto/index.js.map +1 -1
- package/dist/devtools/index.js +3 -12
- package/dist/devtools/index.js.map +1 -1
- package/dist/logger/index.d.ts +10 -1
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/logger/index.js +19 -9
- package/dist/logger/index.js.map +1 -1
- package/dist/orm/core/index.browser.js +57 -1
- package/dist/orm/core/index.browser.js.map +1 -1
- package/dist/orm/core/index.bun.js +378 -19
- package/dist/orm/core/index.bun.js.map +1 -1
- package/dist/orm/core/index.d.ts +328 -9
- package/dist/orm/core/index.d.ts.map +1 -1
- package/dist/orm/core/index.js +384 -21
- package/dist/orm/core/index.js.map +1 -1
- package/dist/orm/postgres/index.bun.js +49 -17
- package/dist/orm/postgres/index.bun.js.map +1 -1
- package/dist/orm/postgres/index.d.ts +47 -21
- package/dist/orm/postgres/index.d.ts.map +1 -1
- package/dist/orm/postgres/index.js +52 -17
- package/dist/orm/postgres/index.js.map +1 -1
- package/dist/react/core/index.d.ts +1 -1
- package/dist/react/core/index.d.ts.map +1 -1
- package/dist/react/core/index.js +6 -1
- package/dist/react/core/index.js.map +1 -1
- package/dist/react/form/index.d.ts +28 -18
- package/dist/react/form/index.d.ts.map +1 -1
- package/dist/react/form/index.js +92 -56
- package/dist/react/form/index.js.map +1 -1
- package/dist/react/router/index.browser.js +448 -116
- package/dist/react/router/index.browser.js.map +1 -1
- package/dist/react/router/index.d.ts +102 -40
- package/dist/react/router/index.d.ts.map +1 -1
- package/dist/react/router/index.js +453 -92
- package/dist/react/router/index.js.map +1 -1
- package/dist/security/index.d.ts +3 -11
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +6 -11
- package/dist/security/index.js.map +1 -1
- package/dist/server/auth/index.d.ts +22 -24
- package/dist/server/auth/index.d.ts.map +1 -1
- package/dist/server/auth/index.js +102 -82
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/cookies/index.d.ts +7 -4
- package/dist/server/cookies/index.d.ts.map +1 -1
- package/dist/server/cookies/index.js +13 -12
- package/dist/server/cookies/index.js.map +1 -1
- package/dist/server/core/index.d.ts +288 -4
- package/dist/server/core/index.d.ts.map +1 -1
- package/dist/server/core/index.js +375 -2
- package/dist/server/core/index.js.map +1 -1
- package/dist/server/links/index.browser.js +10 -71
- package/dist/server/links/index.browser.js.map +1 -1
- package/dist/server/links/index.d.ts +32 -49
- package/dist/server/links/index.d.ts.map +1 -1
- package/dist/server/links/index.js +73 -100
- package/dist/server/links/index.js.map +1 -1
- package/dist/system/index.browser.js +221 -2
- package/dist/system/index.browser.js.map +1 -1
- package/dist/system/index.d.ts +63 -1
- package/dist/system/index.d.ts.map +1 -1
- package/dist/system/index.js +221 -1
- package/dist/system/index.js.map +1 -1
- package/dist/system/index.workerd.js +224 -4
- package/dist/system/index.workerd.js.map +1 -1
- package/package.json +10 -5
- package/src/api/jobs/providers/JobProvider.ts +6 -3
- package/src/api/notifications/controllers/AdminNotificationController.ts +83 -0
- package/src/api/notifications/index.browser.ts +3 -0
- package/src/api/notifications/index.ts +14 -2
- package/src/api/notifications/jobs/NotificationJobs.ts +11 -2
- package/src/api/notifications/schemas/notificationDetailResourceSchema.ts +20 -0
- package/src/api/notifications/schemas/notificationQuerySchema.ts +19 -0
- package/src/api/notifications/schemas/notificationResourceSchema.ts +18 -0
- package/src/api/notifications/services/NotificationSenderService.ts +15 -2
- package/src/api/users/atoms/realmAuthSettingsAtom.ts +28 -32
- package/src/api/users/buckets/UserBuckets.ts +1 -1
- package/src/api/users/jobs/UserJobs.ts +1 -1
- package/src/api/users/primitives/$realm.ts +8 -49
- package/src/api/users/providers/RealmProvider.ts +2 -3
- package/src/api/users/services/RegistrationService.spec.ts +7 -7
- package/src/api/users/services/RegistrationService.ts +3 -3
- package/src/api/users/services/SessionService.spec.ts +4 -4
- package/src/api/users/services/SessionService.ts +3 -3
- package/src/cli/{core → config}/defineConfig.ts +14 -20
- package/src/cli/config/index.ts +1 -0
- package/src/cli/core/commands/db.ts +65 -1
- package/src/cli/core/commands/dev.ts +1 -0
- package/src/cli/core/commands/init.ts +2 -192
- package/src/cli/core/index.ts +34 -11
- package/src/cli/core/providers/ViteDevServerProvider.ts +52 -13
- package/src/cli/core/services/PackageManagerUtils.ts +43 -21
- package/src/cli/core/services/ProjectScaffolder.ts +214 -2
- package/src/cli/core/services/ViteUtils.ts +57 -0
- package/src/cli/core/tasks/BuildClientTask.ts +7 -2
- package/src/cli/core/tasks/BuildCloudflareTask.ts +4 -12
- package/src/cli/core/tasks/BuildServerTask.ts +2 -0
- package/src/cli/core/tasks/BuildVercelTask.ts +165 -168
- package/src/cli/core/templates/alephaConfigTs.ts +1 -1
- package/src/cli/core/templates/apiAppSecurityTs.ts +5 -8
- package/src/cli/core/templates/tsconfigJson.ts +6 -1
- package/src/cli/platform/adapters/CloudflareAdapter.spec.ts +1 -1
- package/src/cli/platform/adapters/CloudflareAdapter.ts +30 -29
- package/src/cli/platform/atoms/platformOptions.ts +21 -0
- package/src/cli/platform/commands/SecretsCommand.spec.ts +298 -0
- package/src/cli/platform/commands/SecretsCommand.ts +283 -0
- package/src/cli/platform/commands/platform.ts +12 -0
- package/src/cli/platform/index.ts +14 -28
- package/src/cli/platform/providers/GitHubSecretStore.spec.ts +153 -0
- package/src/cli/platform/providers/GitHubSecretStore.ts +112 -0
- package/src/cli/platform/providers/MemorySecretStore.ts +114 -0
- package/src/cli/platform/providers/SecretStoreProvider.ts +39 -0
- package/src/cli/platform/schemas/cloudflare.ts +2 -0
- package/src/cli/platform/services/CloudflareApi.ts +5 -2
- package/src/cli/platform/services/DockerComposeGenerator.spec.ts +115 -0
- package/src/cli/platform/services/DockerComposeGenerator.ts +46 -1
- package/src/cli/platform/services/SecretFilterService.spec.ts +111 -0
- package/src/cli/platform/services/SecretFilterService.ts +54 -0
- package/src/core/Alepha.ts +94 -25
- package/src/core/__tests__/Alepha-parseEnv.spec.ts +20 -0
- package/src/core/primitives/$memoize.ts +38 -26
- package/src/core/providers/AlsProvider.ts +2 -0
- package/src/core/providers/EventManager.ts +4 -0
- package/src/core/providers/KeylessJsonSchemaCodec.spec.ts +1 -4
- package/src/core/providers/KeylessJsonSchemaCodec.ts +19 -125
- package/src/core/providers/SchemaValidator.spec.ts +36 -0
- package/src/core/providers/SchemaValidator.ts +9 -0
- package/src/crypto/index.ts +6 -1
- package/src/crypto/providers/SecretProvider.ts +36 -0
- package/src/devtools/providers/DevToolsProvider.ts +3 -12
- package/src/logger/index.ts +33 -6
- package/src/logger/providers/PrettyFormatterProvider.ts +5 -3
- package/src/orm/__tests__/orm-next-tests.ts +492 -0
- package/src/orm/__tests__/orm-next.spec.ts +140 -0
- package/src/orm/core/constants/PG_SYMBOLS.ts +17 -0
- package/src/orm/core/index.bun.ts +3 -6
- package/src/orm/core/index.shared-server.ts +2 -0
- package/src/orm/core/index.shared.ts +2 -0
- package/src/orm/core/index.ts +5 -7
- package/src/orm/core/interfaces/AggregateQuery.ts +103 -0
- package/src/orm/core/interfaces/PgQueryWhere.ts +7 -0
- package/src/orm/core/primitives/$entity.ts +8 -0
- package/src/orm/core/primitives/$repository.ts +6 -3
- package/src/orm/core/primitives/$view.ts +88 -0
- package/src/orm/core/providers/DbCacheProvider.ts +66 -0
- package/src/orm/core/providers/DrizzleKitProvider.ts +42 -0
- package/src/orm/core/providers/drivers/BunSqliteProvider.ts +2 -3
- package/src/orm/core/providers/drivers/CloudflareD1Provider.ts +12 -0
- package/src/orm/core/providers/drivers/DatabaseProvider.ts +39 -0
- package/src/orm/core/providers/drivers/NodeSqliteProvider.ts +2 -3
- package/src/orm/core/schemas/databaseEnvSchema.ts +31 -0
- package/src/orm/core/schemas/insertSchema.ts +13 -3
- package/src/orm/core/schemas/updateSchema.ts +14 -3
- package/src/orm/core/services/ModelBuilder.ts +26 -14
- package/src/orm/core/services/QueryManager.ts +13 -0
- package/src/orm/core/services/Repository.ts +307 -5
- package/src/orm/core/services/SqliteModelBuilder.ts +38 -0
- package/src/orm/postgres/index.bun.ts +4 -7
- package/src/orm/postgres/index.ts +4 -7
- package/src/orm/postgres/providers/BunPostgresProvider.ts +12 -2
- package/src/orm/postgres/providers/NodePostgresProvider.ts +7 -0
- package/src/orm/postgres/providers/PglitePostgresProvider.ts +10 -17
- package/src/orm/postgres/providers/PostgresProvider.ts +7 -36
- package/src/orm/postgres/schemas/postgresEnvSchema.ts +32 -0
- package/src/orm/postgres/services/PostgresModelBuilder.ts +40 -0
- package/src/react/core/components/ErrorBoundary.tsx +5 -2
- package/src/react/form/hooks/useFieldValue.ts +34 -0
- package/src/react/form/hooks/useForm.browser.spec.tsx +94 -9
- package/src/react/form/hooks/useForm.ts +14 -2
- package/src/react/form/hooks/useFormState.ts +10 -10
- package/src/react/form/hooks/useFormValues.ts +29 -0
- package/src/react/form/index.ts +3 -1
- package/src/react/form/services/FormModel.ts +53 -122
- package/src/react/router/components/ErrorViewer.tsx +333 -34
- package/src/react/router/components/NestedView.tsx +10 -3
- package/src/react/router/primitives/$page.browser.spec.tsx +34 -0
- package/src/react/router/primitives/$page.spec.tsx +20 -0
- package/src/react/router/primitives/$page.ts +24 -0
- package/src/react/router/providers/ReactBrowserRouterProvider.ts +14 -2
- package/src/react/router/providers/ReactPageProvider.ts +156 -73
- package/src/react/router/providers/ReactServerProvider.ts +40 -2
- package/src/react/router/providers/ReactServerTemplateProvider.ts +13 -1
- package/src/security/providers/SecurityProvider.ts +5 -27
- package/src/server/auth/primitives/$auth.ts +52 -19
- package/src/server/auth/providers/ServerAuthProvider.ts +145 -139
- package/src/server/cookies/providers/ServerCookiesProvider.ts +12 -24
- package/src/server/core/index.ts +3 -1
- package/src/server/core/primitives/$sse.spec.ts +315 -0
- package/src/server/core/primitives/$sse.ts +715 -0
- package/src/server/links/index.browser.ts +1 -3
- package/src/server/links/index.ts +0 -3
- package/src/server/links/providers/LinkProvider.spec.ts +12 -21
- package/src/server/links/providers/LinkProvider.ts +20 -52
- package/src/server/links/providers/ServerLinksProvider.spec.ts +106 -0
- package/src/server/links/providers/ServerLinksProvider.ts +113 -73
- package/src/server/links/schemas/apiLinksResponseSchema.ts +4 -21
- package/src/server/links/services/BatchCollector.ts +5 -3
- package/src/system/index.browser.ts +1 -0
- package/src/system/index.ts +3 -0
- package/src/system/index.workerd.ts +39 -1
- package/src/system/providers/WorkerdFileSystemProvider.ts +365 -0
- package/assets/devtools-ui/asset.BfSBZ5Dd.css.br +0 -0
- package/assets/devtools-ui/chunk.2NYaoqWt.js +0 -1
- package/assets/devtools-ui/chunk.2NYaoqWt.js.br +0 -0
- package/assets/devtools-ui/chunk.B052Z_xQ.js +0 -1
- package/assets/devtools-ui/chunk.B052Z_xQ.js.br +0 -0
- package/assets/devtools-ui/chunk.B4kVY90C.js +0 -1
- package/assets/devtools-ui/chunk.B4kVY90C.js.br +0 -0
- package/assets/devtools-ui/chunk.B7QJXctB.js +0 -1
- package/assets/devtools-ui/chunk.B7QJXctB.js.br +0 -0
- package/assets/devtools-ui/chunk.B9pX3zit.js.br +0 -0
- package/assets/devtools-ui/chunk.BKF9JxIo.js +0 -1
- package/assets/devtools-ui/chunk.BKF9JxIo.js.br +0 -0
- package/assets/devtools-ui/chunk.BOHgdTP-.js +0 -1
- package/assets/devtools-ui/chunk.BOHgdTP-.js.br +0 -0
- package/assets/devtools-ui/chunk.BOVFxkYC.js +0 -1
- package/assets/devtools-ui/chunk.BOVFxkYC.js.br +0 -0
- package/assets/devtools-ui/chunk.BR842zj5.js +0 -1
- package/assets/devtools-ui/chunk.BR842zj5.js.br +0 -0
- package/assets/devtools-ui/chunk.BT2IiBkZ.js.br +0 -0
- package/assets/devtools-ui/chunk.C79YouPp.js.br +0 -0
- package/assets/devtools-ui/chunk.C8mlBrjW.js +0 -9
- package/assets/devtools-ui/chunk.C8mlBrjW.js.br +0 -0
- package/assets/devtools-ui/chunk.CK0ow3AZ.js +0 -1
- package/assets/devtools-ui/chunk.CK0ow3AZ.js.br +0 -0
- package/assets/devtools-ui/chunk.CZl6J9DF.js.br +0 -0
- package/assets/devtools-ui/chunk.CdNr0YzS.js +0 -1
- package/assets/devtools-ui/chunk.CdNr0YzS.js.br +0 -0
- package/assets/devtools-ui/chunk.Ce6_6iIF.js +0 -1
- package/assets/devtools-ui/chunk.Ce6_6iIF.js.br +0 -0
- package/assets/devtools-ui/chunk.CpyDMr6O.js +0 -1
- package/assets/devtools-ui/chunk.CpyDMr6O.js.br +0 -0
- package/assets/devtools-ui/chunk.CyPmvPnY.js +0 -1
- package/assets/devtools-ui/chunk.CyPmvPnY.js.br +0 -0
- package/assets/devtools-ui/chunk.DTI_geWu.js +0 -1
- package/assets/devtools-ui/chunk.DTI_geWu.js.br +0 -0
- package/assets/devtools-ui/chunk.DbEH1oOB.js.br +0 -0
- package/assets/devtools-ui/chunk.Ddeqj5gv.js +0 -1
- package/assets/devtools-ui/chunk.Ddeqj5gv.js.br +0 -0
- package/assets/devtools-ui/chunk.DpRnB4vJ.js +0 -1
- package/assets/devtools-ui/chunk.DpRnB4vJ.js.br +0 -0
- package/assets/devtools-ui/chunk.DxPGTlsg.js +0 -1
- package/assets/devtools-ui/chunk.DxPGTlsg.js.br +0 -0
- package/assets/devtools-ui/chunk.G7_MMBJS.js +0 -1
- package/assets/devtools-ui/chunk.G7_MMBJS.js.br +0 -0
- package/assets/devtools-ui/chunk.M6wyKO_3.js.br +0 -0
- package/assets/devtools-ui/chunk.OUxNGmQ6.js +0 -1
- package/assets/devtools-ui/chunk.OUxNGmQ6.js.br +0 -0
- package/assets/devtools-ui/chunk.T1kle-fF.js +0 -1
- package/assets/devtools-ui/chunk.T1kle-fF.js.br +0 -0
- package/assets/devtools-ui/chunk.WjpsbQAv.js +0 -1
- package/assets/devtools-ui/chunk.WjpsbQAv.js.br +0 -0
- package/assets/devtools-ui/chunk.c6YgVx86.js +0 -1
- package/assets/devtools-ui/chunk.c6YgVx86.js.br +0 -0
- package/assets/devtools-ui/chunk.dwU3E_MU.js +0 -1
- package/assets/devtools-ui/chunk.dwU3E_MU.js.br +0 -0
- package/assets/devtools-ui/chunk.lJL-lgnW.js.br +0 -0
- package/assets/devtools-ui/chunk.lPWRmvA-.js +0 -7
- package/assets/devtools-ui/chunk.lPWRmvA-.js.br +0 -0
- package/assets/devtools-ui/chunk.p3HJvugM.js +0 -1
- package/assets/devtools-ui/chunk.p3HJvugM.js.br +0 -0
- package/assets/devtools-ui/chunk.r_Xoa_CI.js +0 -1
- package/assets/devtools-ui/chunk.r_Xoa_CI.js.br +0 -0
- package/assets/devtools-ui/chunk.sRNuTYXb.js +0 -1
- package/assets/devtools-ui/chunk.sRNuTYXb.js.br +0 -0
- package/assets/devtools-ui/chunk.tUjcyX5C.js +0 -1
- package/assets/devtools-ui/chunk.tUjcyX5C.js.br +0 -0
- package/assets/devtools-ui/chunk.thjBxvCA.js +0 -1
- package/assets/devtools-ui/chunk.thjBxvCA.js.br +0 -0
- package/assets/devtools-ui/entry.GYhBVRpC.js +0 -78
- package/assets/devtools-ui/entry.GYhBVRpC.js.br +0 -0
- package/src/server/links/services/DefinitionsPool.spec.ts +0 -86
- package/src/server/links/services/DefinitionsPool.ts +0 -43
package/dist/orm/core/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ declare const PG_VERSION: unique symbol;
|
|
|
32
32
|
declare const PG_IDENTITY: unique symbol;
|
|
33
33
|
declare const PG_ENUM: unique symbol;
|
|
34
34
|
declare const PG_REF: unique symbol;
|
|
35
|
+
declare const PG_GENERATED: unique symbol;
|
|
35
36
|
/**
|
|
36
37
|
* @deprecated Use `PG_IDENTITY` instead.
|
|
37
38
|
*/
|
|
@@ -49,6 +50,7 @@ type PgSymbols = {
|
|
|
49
50
|
[PG_IDENTITY]: PgIdentityOptions;
|
|
50
51
|
[PG_REF]: PgRefOptions;
|
|
51
52
|
[PG_ENUM]: PgEnumOptions;
|
|
53
|
+
[PG_GENERATED]: PgGeneratedOptions;
|
|
52
54
|
/**
|
|
53
55
|
* @deprecated Use `PG_IDENTITY` instead.
|
|
54
56
|
*/
|
|
@@ -64,6 +66,18 @@ interface PgEnumOptions {
|
|
|
64
66
|
name?: string;
|
|
65
67
|
description?: string;
|
|
66
68
|
}
|
|
69
|
+
interface PgGeneratedOptions {
|
|
70
|
+
/**
|
|
71
|
+
* SQL expression for the generated column.
|
|
72
|
+
*/
|
|
73
|
+
expression: SQL;
|
|
74
|
+
/**
|
|
75
|
+
* Storage mode for the generated column.
|
|
76
|
+
* - `"stored"` — value is computed on write and stored on disk (default for PostgreSQL).
|
|
77
|
+
* - `"virtual"` — value is computed on read (default for SQLite).
|
|
78
|
+
*/
|
|
79
|
+
mode?: "stored" | "virtual";
|
|
80
|
+
}
|
|
67
81
|
interface PgRefOptions {
|
|
68
82
|
ref: () => {
|
|
69
83
|
name: string;
|
|
@@ -79,12 +93,15 @@ interface PgRefOptions {
|
|
|
79
93
|
/**
|
|
80
94
|
* Transforms a TObject schema for insert operations.
|
|
81
95
|
* All default properties at the root level are made optional.
|
|
96
|
+
* Generated columns are excluded entirely.
|
|
82
97
|
*
|
|
83
98
|
* @example
|
|
84
|
-
* Before: { name: string; age: number(default=0); }
|
|
99
|
+
* Before: { name: string; age: number(default=0); fullName: generated }
|
|
85
100
|
* After: { name: string; age?: number; }
|
|
86
101
|
*/
|
|
87
|
-
type TObjectInsert<T extends TObject> = TObject<{ [K in keyof T["properties"]
|
|
102
|
+
type TObjectInsert<T extends TObject> = TObject<{ [K in keyof T["properties"] as T["properties"][K] extends {
|
|
103
|
+
[PG_GENERATED]: any;
|
|
104
|
+
} ? never : K]: T["properties"][K] extends {
|
|
88
105
|
[PG_DEFAULT]: any;
|
|
89
106
|
} | {
|
|
90
107
|
"~optional": true;
|
|
@@ -95,13 +112,15 @@ declare const insertSchema: <T extends TObject>(obj: T) => TObjectInsert<T>;
|
|
|
95
112
|
/**
|
|
96
113
|
* Transforms a TObject schema for update operations.
|
|
97
114
|
* All optional properties at the root level are made nullable (i.e., `T | null`).
|
|
98
|
-
*
|
|
115
|
+
* Generated columns are excluded entirely.
|
|
99
116
|
*
|
|
100
117
|
* @example
|
|
101
|
-
* Before: { name?: string; age: number; }
|
|
118
|
+
* Before: { name?: string; age: number; fullName: generated }
|
|
102
119
|
* After: { name?: string | null; age: number; }
|
|
103
120
|
*/
|
|
104
|
-
type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["properties"]
|
|
121
|
+
type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["properties"] as T["properties"][K] extends {
|
|
122
|
+
[PG_GENERATED]: any;
|
|
123
|
+
} ? never : K]: T["properties"][K] extends TOptional<infer U> ? TOptional<TUnion<[U, TNull]>> : T["properties"][K] }>;
|
|
105
124
|
declare const updateSchema: <T extends TObject>(schema: T) => TObjectUpdate<T>;
|
|
106
125
|
//#endregion
|
|
107
126
|
//#region ../../src/orm/core/primitives/$entity.d.ts
|
|
@@ -153,6 +172,10 @@ interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
|
|
|
153
172
|
* Custom name for the index. If not provided, generates name automatically.
|
|
154
173
|
*/
|
|
155
174
|
name?: string;
|
|
175
|
+
/**
|
|
176
|
+
* Partial index condition. Only rows matching this SQL expression are indexed.
|
|
177
|
+
*/
|
|
178
|
+
where?: SQL;
|
|
156
179
|
} | {
|
|
157
180
|
/**
|
|
158
181
|
* Multiple columns for composite index (order matters for query optimization).
|
|
@@ -166,6 +189,10 @@ interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
|
|
|
166
189
|
* Custom name for the index. If not provided, generates name automatically.
|
|
167
190
|
*/
|
|
168
191
|
name?: string;
|
|
192
|
+
/**
|
|
193
|
+
* Partial index condition. Only rows matching this SQL expression are indexed.
|
|
194
|
+
*/
|
|
195
|
+
where?: SQL;
|
|
169
196
|
})[];
|
|
170
197
|
/**
|
|
171
198
|
* Foreign key constraints to maintain referential integrity.
|
|
@@ -265,6 +292,69 @@ type EntityColumn<T extends TObject> = {
|
|
|
265
292
|
};
|
|
266
293
|
type EntityColumns<T extends TObject> = { [key in keyof T["properties"]]: EntityColumn<T> };
|
|
267
294
|
//#endregion
|
|
295
|
+
//#region ../../src/orm/core/primitives/$view.d.ts
|
|
296
|
+
/**
|
|
297
|
+
* Creates a database view primitive from a TypeBox schema and SQL query.
|
|
298
|
+
*
|
|
299
|
+
* Views are read-only: Repository blocks all write operations.
|
|
300
|
+
*
|
|
301
|
+
* @example
|
|
302
|
+
* ```ts
|
|
303
|
+
* import { t } from "alepha";
|
|
304
|
+
* import { $view } from "alepha/orm";
|
|
305
|
+
* import { sql } from "drizzle-orm";
|
|
306
|
+
*
|
|
307
|
+
* const userSummary = $view({
|
|
308
|
+
* name: "user_summary",
|
|
309
|
+
* schema: t.object({
|
|
310
|
+
* id: t.uuid(),
|
|
311
|
+
* fullName: t.text(),
|
|
312
|
+
* orderCount: t.integer(),
|
|
313
|
+
* }),
|
|
314
|
+
* query: sql`SELECT u.id, u.first_name || ' ' || u.last_name AS full_name, COUNT(o.id) AS order_count FROM users u LEFT JOIN orders o ON o.user_id = u.id GROUP BY u.id`,
|
|
315
|
+
* });
|
|
316
|
+
*
|
|
317
|
+
* // Materialized view (PostgreSQL only)
|
|
318
|
+
* const monthlyStats = $view({
|
|
319
|
+
* name: "monthly_stats",
|
|
320
|
+
* schema: t.object({ ... }),
|
|
321
|
+
* query: sql`...`,
|
|
322
|
+
* materialized: true,
|
|
323
|
+
* });
|
|
324
|
+
* ```
|
|
325
|
+
*/
|
|
326
|
+
declare const $view: {
|
|
327
|
+
<TSchema extends TObject>(options: ViewPrimitiveOptions<TSchema>): ViewPrimitive<TSchema>;
|
|
328
|
+
[KIND]: typeof ViewPrimitive;
|
|
329
|
+
};
|
|
330
|
+
interface ViewPrimitiveOptions<T extends TObject> {
|
|
331
|
+
/**
|
|
332
|
+
* The database view name.
|
|
333
|
+
*/
|
|
334
|
+
name: string;
|
|
335
|
+
/**
|
|
336
|
+
* TypeBox schema defining the view's columns.
|
|
337
|
+
*/
|
|
338
|
+
schema: T;
|
|
339
|
+
/**
|
|
340
|
+
* SQL query that defines the view.
|
|
341
|
+
*/
|
|
342
|
+
query: SQL;
|
|
343
|
+
/**
|
|
344
|
+
* Whether this is a materialized view (PostgreSQL only).
|
|
345
|
+
* Materialized views store results on disk and can be refreshed.
|
|
346
|
+
*/
|
|
347
|
+
materialized?: boolean;
|
|
348
|
+
}
|
|
349
|
+
declare class ViewPrimitive<T extends TObject = TObject> {
|
|
350
|
+
readonly options: ViewPrimitiveOptions<T>;
|
|
351
|
+
readonly isView = true;
|
|
352
|
+
constructor(options: ViewPrimitiveOptions<T>);
|
|
353
|
+
get name(): string;
|
|
354
|
+
get schema(): T;
|
|
355
|
+
get materialized(): boolean;
|
|
356
|
+
}
|
|
357
|
+
//#endregion
|
|
268
358
|
//#region ../../src/orm/core/services/ModelBuilder.d.ts
|
|
269
359
|
/**
|
|
270
360
|
* Database-specific table configuration functions
|
|
@@ -300,6 +390,13 @@ declare abstract class ModelBuilder {
|
|
|
300
390
|
schemas: Map<string, unknown>;
|
|
301
391
|
schema: string;
|
|
302
392
|
}): void;
|
|
393
|
+
/**
|
|
394
|
+
* Build a view from a view primitive.
|
|
395
|
+
*/
|
|
396
|
+
abstract buildView(view: ViewPrimitive, options: {
|
|
397
|
+
tables: Map<string, unknown>;
|
|
398
|
+
schema: string;
|
|
399
|
+
}): void;
|
|
303
400
|
/**
|
|
304
401
|
* Build a sequence from a sequence primitive.
|
|
305
402
|
*/
|
|
@@ -5166,6 +5263,17 @@ declare class DrizzleKitProvider {
|
|
|
5166
5263
|
* The actual schema is applied at migration execution time via `search_path`.
|
|
5167
5264
|
*/
|
|
5168
5265
|
getModelsWithoutSchema(provider: DatabaseProvider): Record<string, unknown>;
|
|
5266
|
+
/**
|
|
5267
|
+
* Preview schema push without executing any statements.
|
|
5268
|
+
*
|
|
5269
|
+
* Returns the SQL statements that would be executed, warnings, and
|
|
5270
|
+
* whether data loss would occur. Does NOT execute any SQL.
|
|
5271
|
+
*/
|
|
5272
|
+
dryRunPush(provider: DatabaseProvider): Promise<{
|
|
5273
|
+
statements: string[];
|
|
5274
|
+
warnings: string[];
|
|
5275
|
+
hasDataLoss: boolean;
|
|
5276
|
+
}>;
|
|
5169
5277
|
protected pushSqlite(kit: typeof api_d_exports, models: Record<string, unknown>, provider: DatabaseProvider): Promise<void>;
|
|
5170
5278
|
/**
|
|
5171
5279
|
* Push schema changes to PostgreSQL using Drizzle Kit's pushSchema with schema filters.
|
|
@@ -5226,6 +5334,12 @@ declare abstract class DatabaseProvider {
|
|
|
5226
5334
|
protected readonly sequencePrimitives: SequencePrimitive[];
|
|
5227
5335
|
get name(): string;
|
|
5228
5336
|
get driver(): string;
|
|
5337
|
+
/**
|
|
5338
|
+
* Whether this driver supports SQL-level transactions (BEGIN/COMMIT/ROLLBACK).
|
|
5339
|
+
*
|
|
5340
|
+
* Drivers that do not (e.g. PGlite, Cloudflare D1) should override to `false`.
|
|
5341
|
+
*/
|
|
5342
|
+
get supportsTransactions(): boolean;
|
|
5229
5343
|
/**
|
|
5230
5344
|
* Raw database connection handle (e.g. DatabaseSync, bun:sqlite Database).
|
|
5231
5345
|
* Override in providers that expose native connections for introspection.
|
|
@@ -5247,6 +5361,7 @@ declare abstract class DatabaseProvider {
|
|
|
5247
5361
|
protected parseOperation(sql: string): string;
|
|
5248
5362
|
table<T extends TObject>(entity: EntityPrimitive<T>): PgTableWithColumns<SchemaToTableConfig<T>>;
|
|
5249
5363
|
registerEntity(entity: EntityPrimitive): void;
|
|
5364
|
+
registerView(view: ViewPrimitive): void;
|
|
5250
5365
|
registerSequence(sequence: SequencePrimitive): void;
|
|
5251
5366
|
/**
|
|
5252
5367
|
* Rebuild all models into fresh maps using a different schema.
|
|
@@ -5331,6 +5446,10 @@ declare class SqliteModelBuilder extends ModelBuilder {
|
|
|
5331
5446
|
schemas: Map<string, unknown>;
|
|
5332
5447
|
schema: string;
|
|
5333
5448
|
}): void;
|
|
5449
|
+
buildView(view: ViewPrimitive, options: {
|
|
5450
|
+
tables: Map<string, unknown>;
|
|
5451
|
+
schema: string;
|
|
5452
|
+
}): void;
|
|
5334
5453
|
buildSequence(sequence: SequencePrimitive, options: {
|
|
5335
5454
|
sequences: Map<string, unknown>;
|
|
5336
5455
|
schema: string;
|
|
@@ -5504,6 +5623,7 @@ declare module "alepha" {
|
|
|
5504
5623
|
declare class NodeSqliteProvider extends DatabaseProvider {
|
|
5505
5624
|
protected readonly env: {
|
|
5506
5625
|
DATABASE_URL?: string | undefined;
|
|
5626
|
+
DATABASE_SYNC?: boolean | undefined;
|
|
5507
5627
|
};
|
|
5508
5628
|
protected readonly builder: SqliteModelBuilder;
|
|
5509
5629
|
protected readonly options: Readonly<{
|
|
@@ -6299,6 +6419,12 @@ type PgQueryWhereConditions<T extends TObject, Relations extends PgRelationMap<T
|
|
|
6299
6419
|
* @see notExists for the inverse of this test
|
|
6300
6420
|
*/
|
|
6301
6421
|
exists?: SQLWrapper;
|
|
6422
|
+
/**
|
|
6423
|
+
* Test whether a subquery evaluates to have no rows.
|
|
6424
|
+
*
|
|
6425
|
+
* @see exists for the inverse of this test
|
|
6426
|
+
*/
|
|
6427
|
+
notExists?: SQLWrapper;
|
|
6302
6428
|
};
|
|
6303
6429
|
type PgQueryWhereRelations<Relations extends PgRelationMap<TObject> | undefined = undefined> = Relations extends PgRelationMap<TObject> ? { [K in keyof Relations]?: PgQueryWhere<Relations[K]["join"]["schema"], Relations[K]["with"]> } : {};
|
|
6304
6430
|
//#endregion
|
|
@@ -6402,6 +6528,77 @@ interface PgAttrField {
|
|
|
6402
6528
|
one?: boolean;
|
|
6403
6529
|
}
|
|
6404
6530
|
//#endregion
|
|
6531
|
+
//#region ../../src/orm/core/interfaces/AggregateQuery.d.ts
|
|
6532
|
+
type AggregateOp = "count" | "sum" | "avg" | "min" | "max";
|
|
6533
|
+
/**
|
|
6534
|
+
* Select definition for aggregate queries.
|
|
6535
|
+
* - `true` means select the column value as-is (used for groupBy columns).
|
|
6536
|
+
* - `{ sum: true, avg: true, ... }` means compute those aggregations.
|
|
6537
|
+
*/
|
|
6538
|
+
type AggregateColumnSelect = true | Partial<Record<AggregateOp, true>>;
|
|
6539
|
+
type AggregateSelect<T extends TObject> = { [K in keyof Static<T>]?: AggregateColumnSelect };
|
|
6540
|
+
/**
|
|
6541
|
+
* Maps a single column's select definition to its result type.
|
|
6542
|
+
* - `true` → original column type
|
|
6543
|
+
* - `{ sum: true, avg: true }` → `{ sum: number; avg: number }`
|
|
6544
|
+
*/
|
|
6545
|
+
type AggregateColumnResult<TValue, TSelect> = TSelect extends true ? TValue : { [Op in AggregateOp as TSelect extends Record<Op, true> ? Op : never]: number };
|
|
6546
|
+
/**
|
|
6547
|
+
* Result type for an aggregate query.
|
|
6548
|
+
*/
|
|
6549
|
+
type AggregateResult<T extends TObject, S extends AggregateSelect<T>> = { [K in keyof S & keyof Static<T>]: AggregateColumnResult<Static<T>[K], NonNullable<S[K]>> };
|
|
6550
|
+
/**
|
|
6551
|
+
* HAVING clause for aggregate queries.
|
|
6552
|
+
* Only applies to columns with aggregate operations (not `true`).
|
|
6553
|
+
*/
|
|
6554
|
+
type AggregateHaving<T extends TObject, S extends AggregateSelect<T>> = { [K in keyof S & keyof Static<T>]?: S[K] extends true ? never : { [Op in AggregateOp as S[K] extends Record<Op, true> ? Op : never]?: {
|
|
6555
|
+
gt?: number;
|
|
6556
|
+
gte?: number;
|
|
6557
|
+
lt?: number;
|
|
6558
|
+
lte?: number;
|
|
6559
|
+
eq?: number;
|
|
6560
|
+
ne?: number;
|
|
6561
|
+
} } };
|
|
6562
|
+
/**
|
|
6563
|
+
* Full aggregate query definition.
|
|
6564
|
+
*/
|
|
6565
|
+
interface AggregateQuery<T extends TObject, S extends AggregateSelect<T>> {
|
|
6566
|
+
/**
|
|
6567
|
+
* Columns and aggregate operations to select.
|
|
6568
|
+
*/
|
|
6569
|
+
select: S;
|
|
6570
|
+
/**
|
|
6571
|
+
* WHERE clause to filter rows before aggregation.
|
|
6572
|
+
*/
|
|
6573
|
+
where?: PgQueryWhereOrSQL<T>;
|
|
6574
|
+
/**
|
|
6575
|
+
* Columns to group by.
|
|
6576
|
+
*/
|
|
6577
|
+
groupBy?: (keyof Static<T>)[];
|
|
6578
|
+
/**
|
|
6579
|
+
* HAVING clause to filter groups after aggregation.
|
|
6580
|
+
*/
|
|
6581
|
+
having?: AggregateHaving<T, S>;
|
|
6582
|
+
/**
|
|
6583
|
+
* Order results. Supports dot notation for aggregate columns (e.g. "amount.sum").
|
|
6584
|
+
*/
|
|
6585
|
+
orderBy?: string | {
|
|
6586
|
+
column: string;
|
|
6587
|
+
direction: "asc" | "desc";
|
|
6588
|
+
} | Array<{
|
|
6589
|
+
column: string;
|
|
6590
|
+
direction: "asc" | "desc";
|
|
6591
|
+
}>;
|
|
6592
|
+
/**
|
|
6593
|
+
* Limit the number of results.
|
|
6594
|
+
*/
|
|
6595
|
+
limit?: number;
|
|
6596
|
+
/**
|
|
6597
|
+
* Offset for pagination.
|
|
6598
|
+
*/
|
|
6599
|
+
offset?: number;
|
|
6600
|
+
}
|
|
6601
|
+
//#endregion
|
|
6405
6602
|
//#region ../../src/orm/core/providers/DatabaseTypeProvider.d.ts
|
|
6406
6603
|
declare class DatabaseTypeProvider {
|
|
6407
6604
|
readonly attr: <T extends TSchema, Attr extends PgSymbolKeys>(type: T, attr: Attr, value?: PgSymbols[Attr]) => PgAttr<T, Attr>;
|
|
@@ -6508,6 +6705,36 @@ declare const db: DatabaseTypeProvider;
|
|
|
6508
6705
|
*/
|
|
6509
6706
|
declare const legacyIdSchema: PgAttr<PgAttr<PgAttr<alepha.TInteger, typeof PG_PRIMARY_KEY>, typeof PG_SERIAL>, typeof PG_DEFAULT>;
|
|
6510
6707
|
//#endregion
|
|
6708
|
+
//#region ../../src/orm/core/providers/DbCacheProvider.d.ts
|
|
6709
|
+
/**
|
|
6710
|
+
* Database query cache using a simple in-memory Map.
|
|
6711
|
+
*
|
|
6712
|
+
* Uses `{tableName}:{cacheKey}` as the storage key.
|
|
6713
|
+
* Provides per-table invalidation for write-through cache busting.
|
|
6714
|
+
*
|
|
6715
|
+
* This is intentionally self-contained (no external cache dependencies)
|
|
6716
|
+
* so the ORM module does not force `AlephaCache` on all consumers.
|
|
6717
|
+
*/
|
|
6718
|
+
declare class DbCacheProvider {
|
|
6719
|
+
protected readonly store: Map<string, {
|
|
6720
|
+
value: unknown;
|
|
6721
|
+
expiresAt?: number;
|
|
6722
|
+
}>;
|
|
6723
|
+
protected storeKey(tableName: string, cacheKey: string): string;
|
|
6724
|
+
/**
|
|
6725
|
+
* Get a cached query result.
|
|
6726
|
+
*/
|
|
6727
|
+
get<T>(tableName: string, cacheKey: string): Promise<T | undefined>;
|
|
6728
|
+
/**
|
|
6729
|
+
* Store a query result in the cache.
|
|
6730
|
+
*/
|
|
6731
|
+
set<T>(tableName: string, cacheKey: string, value: T, ttl?: number): Promise<void>;
|
|
6732
|
+
/**
|
|
6733
|
+
* Invalidate all cached queries for a table.
|
|
6734
|
+
*/
|
|
6735
|
+
invalidateTable(tableName: string): Promise<void>;
|
|
6736
|
+
}
|
|
6737
|
+
//#endregion
|
|
6511
6738
|
//#region ../../src/orm/core/services/QueryManager.d.ts
|
|
6512
6739
|
declare class QueryManager {
|
|
6513
6740
|
protected readonly alepha: Alepha;
|
|
@@ -6610,6 +6837,7 @@ declare abstract class Repository<T extends TObject> {
|
|
|
6610
6837
|
protected readonly relationManager: PgRelationManager;
|
|
6611
6838
|
protected readonly queryManager: QueryManager;
|
|
6612
6839
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
6840
|
+
protected readonly dbCache: DbCacheProvider;
|
|
6613
6841
|
protected readonly alepha: Alepha;
|
|
6614
6842
|
static of<T extends TObject>(entity: EntityPrimitive<T>, provider?: typeof DatabaseProvider): new () => Repository<T>;
|
|
6615
6843
|
constructor(entity: EntityPrimitive<T>, provider?: typeof DatabaseProvider);
|
|
@@ -6633,6 +6861,10 @@ declare abstract class Repository<T extends TObject> {
|
|
|
6633
6861
|
* Get SQL table name. (from Drizzle table object)
|
|
6634
6862
|
*/
|
|
6635
6863
|
get tableName(): string;
|
|
6864
|
+
/**
|
|
6865
|
+
* Whether this repository is backed by a view (read-only).
|
|
6866
|
+
*/
|
|
6867
|
+
get isReadOnly(): boolean;
|
|
6636
6868
|
/**
|
|
6637
6869
|
* Getter for the database connection from the database provider.
|
|
6638
6870
|
*
|
|
@@ -6864,6 +7096,21 @@ declare abstract class Repository<T extends TObject> {
|
|
|
6864
7096
|
* Count entities.
|
|
6865
7097
|
*/
|
|
6866
7098
|
count(where?: PgQueryWhereOrSQL<T>, opts?: StatementOptions): Promise<number>;
|
|
7099
|
+
/**
|
|
7100
|
+
* Execute an aggregate query with type-safe select, groupBy, and having.
|
|
7101
|
+
*
|
|
7102
|
+
* @example
|
|
7103
|
+
* ```ts
|
|
7104
|
+
* const result = await repo.aggregate({
|
|
7105
|
+
* select: { category: true, amount: { sum: true, avg: true } },
|
|
7106
|
+
* groupBy: ["category"],
|
|
7107
|
+
* having: { amount: { sum: { gt: 100 } } },
|
|
7108
|
+
* orderBy: { column: "amount.sum", direction: "desc" },
|
|
7109
|
+
* });
|
|
7110
|
+
* // result: Array<{ category: string; amount: { sum: number; avg: number } }>
|
|
7111
|
+
* ```
|
|
7112
|
+
*/
|
|
7113
|
+
aggregate<S extends AggregateSelect<T>>(query: AggregateQuery<T, S>, opts?: StatementOptions): Promise<AggregateResult<T, S>[]>;
|
|
6867
7114
|
protected errorPatterns: {
|
|
6868
7115
|
conflict: string[];
|
|
6869
7116
|
foreignKey: string[];
|
|
@@ -6889,6 +7136,18 @@ declare abstract class Repository<T extends TObject> {
|
|
|
6889
7136
|
* Clean a row with joins recursively
|
|
6890
7137
|
*/
|
|
6891
7138
|
protected cleanWithJoins<T extends TObject>(row: Record<string, unknown>, schema: T, joins: PgJoin[], parentPath?: string): Static<T>;
|
|
7139
|
+
/**
|
|
7140
|
+
* Throw if this repository is read-only (backed by a view).
|
|
7141
|
+
*/
|
|
7142
|
+
protected assertWritable(): void;
|
|
7143
|
+
/**
|
|
7144
|
+
* Refresh a materialized view. PostgreSQL only.
|
|
7145
|
+
*/
|
|
7146
|
+
refresh(): Promise<void>;
|
|
7147
|
+
/**
|
|
7148
|
+
* Build a cache key from method name and query parameters.
|
|
7149
|
+
*/
|
|
7150
|
+
protected buildCacheKey(method: string, query: any): string;
|
|
6892
7151
|
/**
|
|
6893
7152
|
* Convert a where clause to SQL.
|
|
6894
7153
|
*/
|
|
@@ -6936,14 +7195,35 @@ interface StatementOptions {
|
|
|
6936
7195
|
* Force the current time.
|
|
6937
7196
|
*/
|
|
6938
7197
|
now?: DateTime | string;
|
|
7198
|
+
/**
|
|
7199
|
+
* Cache configuration for query results.
|
|
7200
|
+
*
|
|
7201
|
+
* When set, results are stored in an in-memory cache keyed by query parameters.
|
|
7202
|
+
* Any write to this table automatically invalidates all cached queries.
|
|
7203
|
+
*
|
|
7204
|
+
* @example
|
|
7205
|
+
* ```ts
|
|
7206
|
+
* await repo.findMany(query, { cache: { ttl: 60_000 } });
|
|
7207
|
+
* ```
|
|
7208
|
+
*/
|
|
7209
|
+
cache?: {
|
|
7210
|
+
/**
|
|
7211
|
+
* Time-to-live in milliseconds.
|
|
7212
|
+
*/
|
|
7213
|
+
ttl?: number;
|
|
7214
|
+
/**
|
|
7215
|
+
* Custom cache key. If not provided, a key is derived from the query.
|
|
7216
|
+
*/
|
|
7217
|
+
key?: string;
|
|
7218
|
+
};
|
|
6939
7219
|
}
|
|
6940
7220
|
type WithSQL<T> = { [P in keyof T]?: T[P] | SQL };
|
|
6941
7221
|
//#endregion
|
|
6942
7222
|
//#region ../../src/orm/core/primitives/$repository.d.ts
|
|
6943
7223
|
/**
|
|
6944
|
-
* Get the repository for the given entity.
|
|
7224
|
+
* Get the repository for the given entity or view.
|
|
6945
7225
|
*/
|
|
6946
|
-
declare const $repository: <T extends TObject>(entity: EntityPrimitive<T>) => Repository<T>;
|
|
7226
|
+
declare const $repository: <T extends TObject>(entity: EntityPrimitive<T> | ViewPrimitive<T>) => Repository<T>;
|
|
6947
7227
|
//#endregion
|
|
6948
7228
|
//#region ../../src/orm/core/primitives/$seed.d.ts
|
|
6949
7229
|
interface SeedOptions {
|
|
@@ -7068,6 +7348,15 @@ declare class CloudflareD1Provider extends DatabaseProvider {
|
|
|
7068
7348
|
get url(): string;
|
|
7069
7349
|
get db(): PgDatabase<any>;
|
|
7070
7350
|
execute(query: SQLLike): Promise<Array<Record<string, unknown>>>;
|
|
7351
|
+
/**
|
|
7352
|
+
* D1 does not support SQL-level transactions (BEGIN/COMMIT/ROLLBACK).
|
|
7353
|
+
* It rejects these statements and requires the JS `batch()` API for atomic
|
|
7354
|
+
* multi-statement operations instead.
|
|
7355
|
+
*
|
|
7356
|
+
* @see https://developers.cloudflare.com/d1/worker-api/d1-database/#batch-statements
|
|
7357
|
+
* @see https://github.com/drizzle-team/drizzle-orm/issues/2463
|
|
7358
|
+
*/
|
|
7359
|
+
get supportsTransactions(): boolean;
|
|
7071
7360
|
protected readonly onStart: alepha.HookPrimitive<"start">;
|
|
7072
7361
|
protected executeMigrations(migrationsFolder: string): Promise<void>;
|
|
7073
7362
|
/**
|
|
@@ -7086,6 +7375,35 @@ declare class RepositoryProvider {
|
|
|
7086
7375
|
createClassRepository<T extends TObject>(entity: EntityPrimitive<T>): Service<Repository<T>>;
|
|
7087
7376
|
}
|
|
7088
7377
|
//#endregion
|
|
7378
|
+
//#region ../../src/orm/core/schemas/databaseEnvSchema.d.ts
|
|
7379
|
+
/**
|
|
7380
|
+
* Base database environment schema.
|
|
7381
|
+
*
|
|
7382
|
+
* Defines the `DATABASE_URL` connection string used by all ORM providers
|
|
7383
|
+
* to determine the database driver and connection target.
|
|
7384
|
+
*
|
|
7385
|
+
* Supported URL formats:
|
|
7386
|
+
* - `sqlite://:memory:` or `sqlite://./path/to/db` — SQLite (Node.js or Bun)
|
|
7387
|
+
* - `postgres://user:password@host:port/database` — PostgreSQL (Node.js or Bun)
|
|
7388
|
+
* - `pglite://:memory:` or `pglite://./path` — PGlite (embedded Postgres)
|
|
7389
|
+
* - `d1://BINDING_NAME` — Cloudflare D1
|
|
7390
|
+
* - `hyperdrive://BINDING_NAME` — Cloudflare Hyperdrive
|
|
7391
|
+
*/
|
|
7392
|
+
declare const databaseEnvSchema: alepha.TObject<{
|
|
7393
|
+
DATABASE_URL: alepha.TOptional<alepha.TString>;
|
|
7394
|
+
/**
|
|
7395
|
+
* Enable or disable push-based schema synchronization (drizzle-kit push).
|
|
7396
|
+
*
|
|
7397
|
+
* Defaults to `true` in development and test, `false` in production.
|
|
7398
|
+
* Set to `false` in development to skip automatic schema sync
|
|
7399
|
+
* (e.g. when managing migrations manually).
|
|
7400
|
+
*/
|
|
7401
|
+
DATABASE_SYNC: alepha.TOptional<alepha.TBoolean>;
|
|
7402
|
+
}>;
|
|
7403
|
+
declare module "alepha" {
|
|
7404
|
+
interface Env extends Partial<Static<typeof databaseEnvSchema>> {}
|
|
7405
|
+
} //# sourceMappingURL=databaseEnvSchema.d.ts.map
|
|
7406
|
+
//#endregion
|
|
7089
7407
|
//#region ../../src/orm/core/types/schema.d.ts
|
|
7090
7408
|
/**
|
|
7091
7409
|
* Postgres schema type.
|
|
@@ -7160,6 +7478,7 @@ declare module "alepha" {
|
|
|
7160
7478
|
declare class BunSqliteProvider extends DatabaseProvider {
|
|
7161
7479
|
protected readonly env: {
|
|
7162
7480
|
DATABASE_URL?: string | undefined;
|
|
7481
|
+
DATABASE_SYNC?: boolean | undefined;
|
|
7163
7482
|
};
|
|
7164
7483
|
protected readonly builder: SqliteModelBuilder;
|
|
7165
7484
|
protected readonly options: Readonly<{
|
|
@@ -7178,7 +7497,7 @@ declare class BunSqliteProvider extends DatabaseProvider {
|
|
|
7178
7497
|
protected executeMigrations(migrationsFolder: string): Promise<void>;
|
|
7179
7498
|
}
|
|
7180
7499
|
declare namespace index_d_exports {
|
|
7181
|
-
export { $entity, $repository, $seed, $sequence, $transactional, AlephaOrm, BunSqliteProvider, BunSqliteProviderOptions, CloudflareD1Provider, D1Database$1 as D1Database, D1ExecResult, D1PreparedStatement, D1Result, DatabaseProvider, DatabaseTypeProvider, DbColumnNotFoundError, DbConflictError, DbConnectionError, DbDeadlockError, DbEntityNotFoundError, DbError, DbForeignKeyError, DbMigrationError, DbMigrationMode, DbNotNullError, DbTableNotFoundError, DbVersionMismatchError, DrizzleKitProvider, EntityColumn, EntityColumns, EntityPrimitive, EntityPrimitiveOptions, FilterOperators, FromSchema, ModelBuilder, NodeSqliteProvider, NodeSqliteProviderOptions, OrderBy, OrderByClause, OrderDirection, PG_CREATED_AT, PG_DEFAULT, PG_DELETED_AT, PG_ENUM, PG_IDENTITY, PG_PRIMARY_KEY, PG_REF, PG_SERIAL, PG_UPDATED_AT, PG_VERSION, Page, PageQuery, PgAttr, PgAttrField, PgDefault, PgEnumOptions, PgIdentityOptions, PgPrimaryKey, PgQuery, PgQueryRelations, PgQueryWhere, PgQueryWhereOrSQL, PgRef, PgRefOptions, PgRelation, PgRelationMap, PgStatic, PgSymbolKeys, PgSymbols, Repository, RepositoryProvider, SQLLike, SchemaToTableConfig, SeedOptions, SequencePrimitive, SequencePrimitiveOptions, SqliteProvider, StatementOptions, TObjectInsert, TObjectUpdate, TableConfigBuilders, TransactionalOptions, buildQueryString, bunSqliteOptions, db, drizzle_orm0 as drizzle, getAttrFields, insertSchema, legacyIdSchema, nodeSqliteOptions, pageQuerySchema, pageSchema, parseQueryString, pgAttr, schema, sql, updateSchema };
|
|
7500
|
+
export { $entity, $repository, $seed, $sequence, $transactional, $view, AggregateColumnResult, AggregateColumnSelect, AggregateHaving, AggregateOp, AggregateQuery, AggregateResult, AggregateSelect, AlephaOrm, BunSqliteProvider, BunSqliteProviderOptions, CloudflareD1Provider, D1Database$1 as D1Database, D1ExecResult, D1PreparedStatement, D1Result, DatabaseProvider, DatabaseTypeProvider, DbCacheProvider, DbColumnNotFoundError, DbConflictError, DbConnectionError, DbDeadlockError, DbEntityNotFoundError, DbError, DbForeignKeyError, DbMigrationError, DbMigrationMode, DbNotNullError, DbTableNotFoundError, DbVersionMismatchError, DrizzleKitProvider, EntityColumn, EntityColumns, EntityPrimitive, EntityPrimitiveOptions, FilterOperators, FromSchema, ModelBuilder, NodeSqliteProvider, NodeSqliteProviderOptions, OrderBy, OrderByClause, OrderDirection, PG_CREATED_AT, PG_DEFAULT, PG_DELETED_AT, PG_ENUM, PG_GENERATED, PG_IDENTITY, PG_PRIMARY_KEY, PG_REF, PG_SERIAL, PG_UPDATED_AT, PG_VERSION, Page, PageQuery, PgAttr, PgAttrField, PgDefault, PgEnumOptions, PgGeneratedOptions, PgIdentityOptions, PgPrimaryKey, PgQuery, PgQueryRelations, PgQueryWhere, PgQueryWhereOrSQL, PgRef, PgRefOptions, PgRelation, PgRelationMap, PgStatic, PgSymbolKeys, PgSymbols, Repository, RepositoryProvider, SQLLike, SchemaToTableConfig, SeedOptions, SequencePrimitive, SequencePrimitiveOptions, SqliteProvider, StatementOptions, TObjectInsert, TObjectUpdate, TableConfigBuilders, TransactionalOptions, ViewPrimitive, ViewPrimitiveOptions, buildQueryString, bunSqliteOptions, databaseEnvSchema, db, drizzle_orm0 as drizzle, getAttrFields, insertSchema, legacyIdSchema, nodeSqliteOptions, pageQuerySchema, pageSchema, parseQueryString, pgAttr, schema, sql, updateSchema };
|
|
7182
7501
|
}
|
|
7183
7502
|
declare module "alepha" {
|
|
7184
7503
|
interface State {
|
|
@@ -7252,5 +7571,5 @@ declare module "alepha" {
|
|
|
7252
7571
|
declare const SqliteProvider: typeof NodeSqliteProvider;
|
|
7253
7572
|
declare const AlephaOrm: alepha.Service<alepha.Module>;
|
|
7254
7573
|
//#endregion
|
|
7255
|
-
export { $entity, $repository, $seed, $sequence, $transactional, AlephaOrm, BunSqliteProvider, BunSqliteProviderOptions, CloudflareD1Provider, D1Database$1 as D1Database, D1ExecResult, D1PreparedStatement, D1Result, DatabaseProvider, DatabaseTypeProvider, DbColumnNotFoundError, DbConflictError, DbConnectionError, DbDeadlockError, DbEntityNotFoundError, DbError, DbForeignKeyError, DbMigrationError, DbMigrationMode, DbNotNullError, DbTableNotFoundError, DbVersionMismatchError, DrizzleKitProvider, EntityColumn, EntityColumns, EntityPrimitive, EntityPrimitiveOptions, FilterOperators, FromSchema, ModelBuilder, NodeSqliteProvider, NodeSqliteProviderOptions, OrderBy, OrderByClause, OrderDirection, PG_CREATED_AT, PG_DEFAULT, PG_DELETED_AT, PG_ENUM, PG_IDENTITY, PG_PRIMARY_KEY, PG_REF, PG_SERIAL, PG_UPDATED_AT, PG_VERSION, type Page, type PageQuery, PgAttr, PgAttrField, PgDefault, PgEnumOptions, PgIdentityOptions, PgPrimaryKey, PgQuery, PgQueryRelations, PgQueryWhere, PgQueryWhereOrSQL, PgRef, PgRefOptions, PgRelation, PgRelationMap, PgStatic, PgSymbolKeys, PgSymbols, Repository, RepositoryProvider, SQLLike, SchemaToTableConfig, SeedOptions, SequencePrimitive, SequencePrimitiveOptions, SqliteProvider, StatementOptions, TObjectInsert, TObjectUpdate, TableConfigBuilders, TransactionalOptions, buildQueryString, bunSqliteOptions, db, drizzle_orm0 as drizzle, getAttrFields, insertSchema, legacyIdSchema, nodeSqliteOptions, pageQuerySchema, pageSchema, parseQueryString, pgAttr, schema, sql, updateSchema };
|
|
7574
|
+
export { $entity, $repository, $seed, $sequence, $transactional, $view, AggregateColumnResult, AggregateColumnSelect, AggregateHaving, AggregateOp, AggregateQuery, AggregateResult, AggregateSelect, AlephaOrm, BunSqliteProvider, BunSqliteProviderOptions, CloudflareD1Provider, D1Database$1 as D1Database, D1ExecResult, D1PreparedStatement, D1Result, DatabaseProvider, DatabaseTypeProvider, DbCacheProvider, DbColumnNotFoundError, DbConflictError, DbConnectionError, DbDeadlockError, DbEntityNotFoundError, DbError, DbForeignKeyError, DbMigrationError, DbMigrationMode, DbNotNullError, DbTableNotFoundError, DbVersionMismatchError, DrizzleKitProvider, EntityColumn, EntityColumns, EntityPrimitive, EntityPrimitiveOptions, FilterOperators, FromSchema, ModelBuilder, NodeSqliteProvider, NodeSqliteProviderOptions, OrderBy, OrderByClause, OrderDirection, PG_CREATED_AT, PG_DEFAULT, PG_DELETED_AT, PG_ENUM, PG_GENERATED, PG_IDENTITY, PG_PRIMARY_KEY, PG_REF, PG_SERIAL, PG_UPDATED_AT, PG_VERSION, type Page, type PageQuery, PgAttr, PgAttrField, PgDefault, PgEnumOptions, PgGeneratedOptions, PgIdentityOptions, PgPrimaryKey, PgQuery, PgQueryRelations, PgQueryWhere, PgQueryWhereOrSQL, PgRef, PgRefOptions, PgRelation, PgRelationMap, PgStatic, PgSymbolKeys, PgSymbols, Repository, RepositoryProvider, SQLLike, SchemaToTableConfig, SeedOptions, SequencePrimitive, SequencePrimitiveOptions, SqliteProvider, StatementOptions, TObjectInsert, TObjectUpdate, TableConfigBuilders, TransactionalOptions, ViewPrimitive, ViewPrimitiveOptions, buildQueryString, bunSqliteOptions, databaseEnvSchema, db, drizzle_orm0 as drizzle, getAttrFields, insertSchema, legacyIdSchema, nodeSqliteOptions, pageQuerySchema, pageSchema, parseQueryString, pgAttr, schema, sql, updateSchema };
|
|
7256
7575
|
//# sourceMappingURL=index.d.ts.map
|