alepha 0.23.0 → 0.24.0
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/swagger-ui/swagger-ui-bundle.js +1 -1
- package/assets/swagger-ui/swagger-ui-standalone-preset.js +1 -1
- package/dist/api/audits/index.browser.js +49 -52
- package/dist/api/audits/index.browser.js.map +1 -1
- package/dist/api/audits/index.d.ts +629 -565
- package/dist/api/audits/index.d.ts.map +1 -1
- package/dist/api/audits/index.js +206 -98
- package/dist/api/audits/index.js.map +1 -1
- package/dist/api/files/index.browser.js +44 -44
- package/dist/api/files/index.browser.js.map +1 -1
- package/dist/api/files/index.d.ts +292 -293
- package/dist/api/files/index.d.ts.map +1 -1
- package/dist/api/files/index.js +61 -64
- package/dist/api/files/index.js.map +1 -1
- package/dist/api/jobs/index.browser.js +61 -59
- package/dist/api/jobs/index.browser.js.map +1 -1
- package/dist/api/jobs/index.d.ts +546 -347
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/jobs/index.js +165 -86
- package/dist/api/jobs/index.js.map +1 -1
- package/dist/api/keys/index.d.ts +247 -235
- package/dist/api/keys/index.d.ts.map +1 -1
- package/dist/api/keys/index.js +63 -66
- package/dist/api/keys/index.js.map +1 -1
- package/dist/api/notifications/index.browser.js +40 -38
- package/dist/api/notifications/index.browser.js.map +1 -1
- package/dist/api/notifications/index.d.ts +339 -209
- package/dist/api/notifications/index.d.ts.map +1 -1
- package/dist/api/notifications/index.js +108 -60
- package/dist/api/notifications/index.js.map +1 -1
- package/dist/api/oauth/index.d.ts +190 -78
- package/dist/api/oauth/index.d.ts.map +1 -1
- package/dist/api/oauth/index.js +290 -68
- package/dist/api/oauth/index.js.map +1 -1
- package/dist/api/organizations/index.browser.js +14 -14
- package/dist/api/organizations/index.browser.js.map +1 -1
- package/dist/api/organizations/index.d.ts +158 -134
- package/dist/api/organizations/index.d.ts.map +1 -1
- package/dist/api/organizations/index.js +18 -18
- package/dist/api/organizations/index.js.map +1 -1
- package/dist/api/parameters/index.browser.js +74 -53
- package/dist/api/parameters/index.browser.js.map +1 -1
- package/dist/api/parameters/index.d.ts +607 -513
- package/dist/api/parameters/index.d.ts.map +1 -1
- package/dist/api/parameters/index.js +205 -127
- package/dist/api/parameters/index.js.map +1 -1
- package/dist/api/payments/index.d.ts +652 -449
- package/dist/api/payments/index.d.ts.map +1 -1
- package/dist/api/payments/index.js +159 -93
- package/dist/api/payments/index.js.map +1 -1
- package/dist/api/subscriptions/index.d.ts +1032 -762
- package/dist/api/subscriptions/index.d.ts.map +1 -1
- package/dist/api/subscriptions/index.js +166 -185
- package/dist/api/subscriptions/index.js.map +1 -1
- package/dist/api/users/index.browser.js +48 -71
- package/dist/api/users/index.browser.js.map +1 -1
- package/dist/api/users/index.d.ts +1297 -1143
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +456 -392
- package/dist/api/users/index.js.map +1 -1
- package/dist/api/verifications/index.browser.js +17 -17
- package/dist/api/verifications/index.browser.js.map +1 -1
- package/dist/api/verifications/index.d.ts +167 -155
- package/dist/api/verifications/index.d.ts.map +1 -1
- package/dist/api/verifications/index.js +47 -95
- package/dist/api/verifications/index.js.map +1 -1
- package/dist/background/index.d.ts +0 -1
- package/dist/background/index.d.ts.map +1 -1
- package/dist/background/index.js.map +1 -1
- package/dist/background/index.workerd.js.map +1 -1
- package/dist/batch/index.d.ts +0 -1
- package/dist/batch/index.d.ts.map +1 -1
- package/dist/batch/index.js.map +1 -1
- package/dist/bin/index.js +1 -1
- package/dist/bin/index.js.map +1 -1
- package/dist/bucket/index.d.ts +27 -32
- package/dist/bucket/index.d.ts.map +1 -1
- package/dist/bucket/index.js +56 -26
- package/dist/bucket/index.js.map +1 -1
- package/dist/bucket/index.workerd.js +52 -24
- package/dist/bucket/index.workerd.js.map +1 -1
- package/dist/cache/core/index.d.ts +4 -6
- package/dist/cache/core/index.d.ts.map +1 -1
- package/dist/cache/core/index.js +4 -10
- package/dist/cache/core/index.js.map +1 -1
- package/dist/cache/core/index.workerd.js +4 -10
- package/dist/cache/core/index.workerd.js.map +1 -1
- package/dist/cache/database/index.d.ts +22 -23
- package/dist/cache/database/index.d.ts.map +1 -1
- package/dist/cache/database/index.js +11 -20
- package/dist/cache/database/index.js.map +1 -1
- package/dist/cache/redis/index.d.ts +3 -4
- package/dist/cache/redis/index.d.ts.map +1 -1
- package/dist/cache/redis/index.js +2 -2
- package/dist/cache/redis/index.js.map +1 -1
- package/dist/captcha/index.d.ts.map +1 -1
- package/dist/captcha/index.js +4 -4
- package/dist/captcha/index.js.map +1 -1
- package/dist/cli/config/index.d.ts +0 -1
- package/dist/cli/config/index.d.ts.map +1 -1
- package/dist/cli/core/index.d.ts +205 -442
- package/dist/cli/core/index.d.ts.map +1 -1
- package/dist/cli/core/index.js +259 -284
- package/dist/cli/core/index.js.map +1 -1
- package/dist/cli/devtools/index.d.ts +3 -9
- package/dist/cli/devtools/index.d.ts.map +1 -1
- package/dist/cli/devtools/index.js +3 -3
- package/dist/cli/devtools/index.js.map +1 -1
- package/dist/cli/i18n/index.d.ts +8 -34
- package/dist/cli/i18n/index.d.ts.map +1 -1
- package/dist/cli/i18n/index.js +6 -6
- package/dist/cli/i18n/index.js.map +1 -1
- package/dist/cli/platform/index.d.ts +89 -82
- package/dist/cli/platform/index.d.ts.map +1 -1
- package/dist/cli/platform/index.js +27 -33
- package/dist/cli/platform/index.js.map +1 -1
- package/dist/cli/platform-lib/index.d.ts +351 -404
- package/dist/cli/platform-lib/index.d.ts.map +1 -1
- package/dist/cli/platform-lib/index.js +218 -239
- package/dist/cli/platform-lib/index.js.map +1 -1
- package/dist/cli/vendor/index.d.ts +17 -41
- package/dist/cli/vendor/index.d.ts.map +1 -1
- package/dist/cli/vendor/index.js +10 -13
- package/dist/cli/vendor/index.js.map +1 -1
- package/dist/command/index.d.ts +83 -195
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +160 -563
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +845 -859
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +787 -527
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +845 -859
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +845 -859
- package/dist/core/index.native.js.map +1 -1
- package/dist/core/index.workerd.js +845 -859
- package/dist/core/index.workerd.js.map +1 -1
- package/dist/crypto/index.browser.js +1 -1
- package/dist/crypto/index.browser.js.map +1 -1
- package/dist/crypto/index.d.ts +3 -4
- package/dist/crypto/index.d.ts.map +1 -1
- package/dist/crypto/index.js +6 -3
- package/dist/crypto/index.js.map +1 -1
- package/dist/datetime/index.d.ts +12 -2
- package/dist/datetime/index.d.ts.map +1 -1
- package/dist/datetime/index.js +6 -1
- package/dist/datetime/index.js.map +1 -1
- package/dist/email/brevo/index.d.ts +0 -1
- package/dist/email/brevo/index.d.ts.map +1 -1
- package/dist/email/brevo/index.js +4 -4
- package/dist/email/brevo/index.js.map +1 -1
- package/dist/email/cloudflare/index.d.ts +0 -1
- package/dist/email/cloudflare/index.d.ts.map +1 -1
- package/dist/email/cloudflare/index.js +2 -2
- package/dist/email/cloudflare/index.js.map +1 -1
- package/dist/email/core/index.d.ts +15 -7
- package/dist/email/core/index.d.ts.map +1 -1
- package/dist/email/core/index.js +14 -5
- package/dist/email/core/index.js.map +1 -1
- package/dist/email/core/index.workerd.js +5 -1
- package/dist/email/core/index.workerd.js.map +1 -1
- package/dist/email/smtp/index.d.ts +8 -9
- package/dist/email/smtp/index.d.ts.map +1 -1
- package/dist/email/smtp/index.js +702 -479
- package/dist/email/smtp/index.js.map +1 -1
- package/dist/fake/index.d.ts +1580 -1238
- package/dist/fake/index.d.ts.map +1 -1
- package/dist/fake/index.js +11728 -32131
- package/dist/fake/index.js.map +1 -1
- package/dist/lock/core/index.d.ts +13 -9
- package/dist/lock/core/index.d.ts.map +1 -1
- package/dist/lock/core/index.js +5 -5
- package/dist/lock/core/index.js.map +1 -1
- package/dist/lock/redis/index.d.ts +0 -1
- package/dist/lock/redis/index.d.ts.map +1 -1
- package/dist/lock/redis/index.js.map +1 -1
- package/dist/logger/index.d.ts +81 -69
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/logger/index.js +123 -56
- package/dist/logger/index.js.map +1 -1
- package/dist/mcp/index.d.ts +27 -90
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +42 -70
- package/dist/mcp/index.js.map +1 -1
- package/dist/orm/core/index.browser.js +54 -40
- package/dist/orm/core/index.browser.js.map +1 -1
- package/dist/orm/core/index.bun.js +140 -106
- package/dist/orm/core/index.bun.js.map +1 -1
- package/dist/orm/core/index.d.ts +145 -150
- package/dist/orm/core/index.d.ts.map +1 -1
- package/dist/orm/core/index.js +144 -109
- package/dist/orm/core/index.js.map +1 -1
- package/dist/orm/postgres/index.bun.js +64 -54
- package/dist/orm/postgres/index.bun.js.map +1 -1
- package/dist/orm/postgres/index.d.ts +36 -76
- package/dist/orm/postgres/index.d.ts.map +1 -1
- package/dist/orm/postgres/index.js +67 -57
- package/dist/orm/postgres/index.js.map +1 -1
- package/dist/queue/core/index.d.ts +62 -75
- package/dist/queue/core/index.d.ts.map +1 -1
- package/dist/queue/core/index.js +48 -71
- package/dist/queue/core/index.js.map +1 -1
- package/dist/queue/core/index.workerd.js +48 -71
- package/dist/queue/core/index.workerd.js.map +1 -1
- package/dist/queue/redis/index.d.ts +3 -4
- package/dist/queue/redis/index.d.ts.map +1 -1
- package/dist/queue/redis/index.js +2 -2
- package/dist/queue/redis/index.js.map +1 -1
- package/dist/react/auth/index.browser.js.map +1 -1
- package/dist/react/auth/index.d.ts +7 -4
- package/dist/react/auth/index.d.ts.map +1 -1
- package/dist/react/auth/index.js.map +1 -1
- package/dist/react/core/index.d.ts +87 -5
- package/dist/react/core/index.d.ts.map +1 -1
- package/dist/react/core/index.js +170 -23
- package/dist/react/core/index.js.map +1 -1
- package/dist/react/form/index.d.ts +4 -5
- package/dist/react/form/index.d.ts.map +1 -1
- package/dist/react/form/index.js +91 -56
- package/dist/react/form/index.js.map +1 -1
- package/dist/react/head/index.browser.js.map +1 -1
- package/dist/react/head/index.d.ts +0 -1
- package/dist/react/head/index.d.ts.map +1 -1
- package/dist/react/head/index.js.map +1 -1
- package/dist/react/i18n/index.d.ts +4 -5
- package/dist/react/i18n/index.d.ts.map +1 -1
- package/dist/react/i18n/index.js +2 -2
- package/dist/react/i18n/index.js.map +1 -1
- package/dist/react/intro/index.d.ts +1 -4
- package/dist/react/intro/index.d.ts.map +1 -1
- package/dist/react/intro/index.js.map +1 -1
- package/dist/react/router/index.browser.js +60 -24
- package/dist/react/router/index.browser.js.map +1 -1
- package/dist/react/router/index.d.ts +378 -377
- package/dist/react/router/index.d.ts.map +1 -1
- package/dist/react/router/index.js +77 -41
- package/dist/react/router/index.js.map +1 -1
- package/dist/react/sitemap/index.d.ts +0 -1
- package/dist/react/sitemap/index.d.ts.map +1 -1
- package/dist/react/sitemap/index.js.map +1 -1
- package/dist/react/testing/index.d.ts +4 -5
- package/dist/react/testing/index.d.ts.map +1 -1
- package/dist/react/testing/index.js +41 -15
- package/dist/react/testing/index.js.map +1 -1
- package/dist/react/testing/{chunk-BpyX8vjI.js → rolldown-runtime-Bl3dcgcQ.js} +1 -1
- package/dist/react/ui/index.d.ts +35 -34
- package/dist/react/ui/index.d.ts.map +1 -1
- package/dist/react/ui/index.js +12 -17
- package/dist/react/ui/index.js.map +1 -1
- package/dist/redis/index.bun.js +5 -5
- package/dist/redis/index.bun.js.map +1 -1
- package/dist/redis/index.d.ts +6 -7
- package/dist/redis/index.d.ts.map +1 -1
- package/dist/redis/index.js +6 -6
- package/dist/redis/index.js.map +1 -1
- package/dist/retry/index.d.ts +0 -1
- package/dist/retry/index.d.ts.map +1 -1
- package/dist/retry/index.js.map +1 -1
- package/dist/router/index.d.ts.map +1 -1
- package/dist/router/index.js.map +1 -1
- package/dist/scheduler/index.d.ts +4 -12
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/index.js +9 -4
- package/dist/scheduler/index.js.map +1 -1
- package/dist/scheduler/index.workerd.js +9 -4
- package/dist/scheduler/index.workerd.js.map +1 -1
- package/dist/security/index.browser.js +30 -28
- package/dist/security/index.browser.js.map +1 -1
- package/dist/security/index.d.ts +113 -44
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +452 -37
- package/dist/security/index.js.map +1 -1
- package/dist/server/auth/index.browser.js +19 -19
- package/dist/server/auth/index.browser.js.map +1 -1
- package/dist/server/auth/index.d.ts +198 -274
- package/dist/server/auth/index.d.ts.map +1 -1
- package/dist/server/auth/index.js +83 -621
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/cookies/index.browser.js +103 -5
- package/dist/server/cookies/index.browser.js.map +1 -1
- package/dist/server/cookies/index.d.ts +72 -5
- package/dist/server/cookies/index.d.ts.map +1 -1
- package/dist/server/cookies/index.js +103 -9
- package/dist/server/cookies/index.js.map +1 -1
- package/dist/server/core/index.browser.js +22 -27
- package/dist/server/core/index.browser.js.map +1 -1
- package/dist/server/core/index.d.ts +116 -85
- package/dist/server/core/index.d.ts.map +1 -1
- package/dist/server/core/index.js +105 -118
- package/dist/server/core/index.js.map +1 -1
- package/dist/server/cors/index.d.ts +9 -10
- package/dist/server/cors/index.d.ts.map +1 -1
- package/dist/server/cors/index.js +14 -26
- package/dist/server/cors/index.js.map +1 -1
- package/dist/server/etag/index.d.ts +2 -3
- package/dist/server/etag/index.d.ts.map +1 -1
- package/dist/server/etag/index.js.map +1 -1
- package/dist/server/health/index.d.ts +18 -19
- package/dist/server/health/index.d.ts.map +1 -1
- package/dist/server/health/index.js +6 -6
- package/dist/server/health/index.js.map +1 -1
- package/dist/server/links/index.browser.js +15 -18
- package/dist/server/links/index.browser.js.map +1 -1
- package/dist/server/links/index.d.ts +66 -67
- package/dist/server/links/index.d.ts.map +1 -1
- package/dist/server/links/index.js +29 -32
- package/dist/server/links/index.js.map +1 -1
- package/dist/server/metrics/index.d.ts +0 -1
- package/dist/server/metrics/index.d.ts.map +1 -1
- package/dist/server/metrics/index.js +10 -3
- package/dist/server/metrics/index.js.map +1 -1
- package/dist/server/proxy/index.d.ts +0 -1
- package/dist/server/proxy/index.d.ts.map +1 -1
- package/dist/server/proxy/index.js.map +1 -1
- package/dist/server/rate-limit/index.d.ts +8 -9
- package/dist/server/rate-limit/index.d.ts.map +1 -1
- package/dist/server/rate-limit/index.js +6 -12
- package/dist/server/rate-limit/index.js.map +1 -1
- package/dist/server/static/index.d.ts +0 -1
- package/dist/server/static/index.d.ts.map +1 -1
- package/dist/server/static/index.js.map +1 -1
- package/dist/server/swagger/index.d.ts +4 -4
- package/dist/server/swagger/index.d.ts.map +1 -1
- package/dist/server/swagger/index.js +37 -25
- package/dist/server/swagger/index.js.map +1 -1
- package/dist/sms/index.d.ts +0 -1
- package/dist/sms/index.d.ts.map +1 -1
- package/dist/sms/index.js.map +1 -1
- package/dist/system/index.browser.js.map +1 -1
- package/dist/system/index.d.ts +0 -1
- package/dist/system/index.d.ts.map +1 -1
- package/dist/system/index.js +2 -1
- package/dist/system/index.js.map +1 -1
- package/dist/system/index.workerd.js.map +1 -1
- package/dist/topic/core/index.d.ts +19 -20
- package/dist/topic/core/index.d.ts.map +1 -1
- package/dist/topic/core/index.js +8 -8
- package/dist/topic/core/index.js.map +1 -1
- package/dist/topic/redis/index.d.ts +3 -4
- package/dist/topic/redis/index.d.ts.map +1 -1
- package/dist/topic/redis/index.js +2 -2
- package/dist/topic/redis/index.js.map +1 -1
- package/package.json +22 -35
- package/src/api/audits/__tests__/AuditJobs.spec.ts +83 -0
- package/src/api/audits/__tests__/AuditService.spec.ts +139 -1
- package/src/api/audits/controllers/AdminAuditController.ts +41 -41
- package/src/api/audits/entities/audits.ts +22 -22
- package/src/api/audits/index.ts +6 -1
- package/src/api/audits/jobs/AuditJobs.ts +29 -0
- package/src/api/audits/parameters/AuditParameters.ts +51 -0
- package/src/api/audits/primitives/$audit.ts +24 -0
- package/src/api/audits/schemas/auditQuerySchema.ts +13 -13
- package/src/api/audits/schemas/createAuditSchema.ts +18 -18
- package/src/api/audits/services/AuditService.ts +79 -7
- package/src/api/files/__tests__/FileController.spec.ts +5 -5
- package/src/api/files/__tests__/FileJobs.spec.ts +6 -0
- package/src/api/files/controllers/FileController.ts +25 -25
- package/src/api/files/entities/files.ts +15 -15
- package/src/api/files/schemas/fileCreatorSummarySchema.ts +7 -7
- package/src/api/files/schemas/fileQuerySchema.ts +9 -9
- package/src/api/files/schemas/fileResourceSchema.ts +7 -9
- package/src/api/files/schemas/storageStatsSchema.ts +13 -13
- package/src/api/jobs/__tests__/$job-hardening.spec.ts +289 -0
- package/src/api/jobs/__tests__/$job.spec.ts +18 -18
- package/src/api/jobs/controllers/AdminJobController.ts +8 -8
- package/src/api/jobs/entities/jobExecutionEntity.ts +29 -19
- package/src/api/jobs/providers/JobProvider.ts +128 -12
- package/src/api/jobs/providers/JobQueueProvider.ts +2 -2
- package/src/api/jobs/schemas/jobConfigAtom.ts +22 -22
- package/src/api/jobs/schemas/jobExecutionQuerySchema.ts +6 -6
- package/src/api/jobs/schemas/jobExecutionResourceSchema.ts +11 -15
- package/src/api/jobs/schemas/jobRegistrationSchema.ts +20 -19
- package/src/api/jobs/schemas/triggerJobSchema.ts +3 -3
- package/src/api/jobs/services/JobService.ts +6 -6
- package/src/api/keys/__tests__/ApiKeyService.spec.ts +2 -2
- package/src/api/keys/controllers/AdminApiKeyController.ts +10 -10
- package/src/api/keys/entities/apiKeyEntity.ts +15 -15
- package/src/api/keys/schemas/adminApiKeyQuerySchema.ts +4 -4
- package/src/api/keys/schemas/adminApiKeyResourceSchema.ts +15 -15
- package/src/api/keys/schemas/createApiKeyBodySchema.ts +5 -5
- package/src/api/keys/schemas/createApiKeyResponseSchema.ts +9 -9
- package/src/api/keys/schemas/listApiKeyResponseSchema.ts +13 -13
- package/src/api/keys/schemas/revokeApiKeyParamsSchema.ts +3 -3
- package/src/api/keys/schemas/revokeApiKeyResponseSchema.ts +3 -3
- package/src/api/notifications/__tests__/AlephaApiNotifications.spec.ts +2 -2
- package/src/api/notifications/controllers/AdminNotificationController.ts +38 -14
- package/src/api/notifications/jobs/NotificationJobs.ts +7 -6
- package/src/api/notifications/primitives/$notification.ts +43 -4
- package/src/api/notifications/schemas/notificationContactPreferencesSchema.ts +4 -4
- package/src/api/notifications/schemas/notificationContactSchema.ts +7 -7
- package/src/api/notifications/schemas/notificationDetailResourceSchema.ts +9 -11
- package/src/api/notifications/schemas/notificationPayloadSchema.ts +11 -9
- package/src/api/notifications/schemas/notificationQuerySchema.ts +6 -6
- package/src/api/notifications/schemas/notificationResourceSchema.ts +14 -14
- package/src/api/notifications/services/NotificationSenderService.ts +38 -2
- package/src/api/oauth/__tests__/OAuthClientService.spec.ts +42 -0
- package/src/api/oauth/__tests__/OAuthController.spec.ts +128 -0
- package/src/api/oauth/controllers/OAuthController.ts +132 -12
- package/src/api/oauth/entities/oauthClientEntity.ts +29 -12
- package/src/api/oauth/helpers/oauthMetadata.ts +1 -0
- package/src/api/oauth/helpers/oidcMetadata.ts +19 -0
- package/src/api/oauth/index.ts +1 -0
- package/src/api/oauth/schemas/authorizeDecisionBodySchema.ts +12 -11
- package/src/api/oauth/schemas/authorizeQuerySchema.ts +12 -10
- package/src/api/oauth/schemas/registerClientBodySchema.ts +10 -11
- package/src/api/oauth/schemas/tokenRequestBodySchema.ts +9 -8
- package/src/api/oauth/services/OAuthClientService.ts +228 -15
- package/src/api/organizations/controllers/AdminOrganizationController.ts +8 -8
- package/src/api/organizations/entities/organizations.ts +6 -6
- package/src/api/organizations/schemas/createOrganizationSchema.ts +5 -5
- package/src/api/organizations/schemas/organizationQuerySchema.ts +4 -4
- package/src/api/organizations/schemas/updateOrganizationSchema.ts +1 -2
- package/src/api/parameters/__tests__/$parameter.spec.ts +229 -50
- package/src/api/parameters/controllers/AdminParameterController.ts +9 -12
- package/src/api/parameters/entities/parameters.ts +29 -16
- package/src/api/parameters/primitives/$parameter.ts +3 -3
- package/src/api/parameters/schemas/activateParameterBodySchema.ts +4 -4
- package/src/api/parameters/schemas/createParameterVersionBodySchema.ts +15 -15
- package/src/api/parameters/schemas/parameterCreatorSummarySchema.ts +7 -7
- package/src/api/parameters/schemas/parameterCurrentResponseSchema.ts +7 -7
- package/src/api/parameters/schemas/parameterHistoryResponseSchema.ts +3 -3
- package/src/api/parameters/schemas/parameterNameParamSchema.ts +2 -3
- package/src/api/parameters/schemas/parameterNamesResponseSchema.ts +3 -3
- package/src/api/parameters/schemas/parameterResponseSchema.ts +3 -3
- package/src/api/parameters/schemas/parameterStatusSchema.ts +2 -2
- package/src/api/parameters/schemas/parameterTreeNodeSchema.ts +6 -6
- package/src/api/parameters/schemas/parameterVersionParamSchema.ts +5 -6
- package/src/api/parameters/schemas/parameterVersionResponseSchema.ts +3 -3
- package/src/api/parameters/schemas/rollbackParameterBodySchema.ts +6 -9
- package/src/api/parameters/services/ParameterProvider.ts +152 -65
- package/src/api/payments/controllers/AdminPaymentController.ts +7 -7
- package/src/api/payments/controllers/MockCheckoutController.ts +79 -28
- package/src/api/payments/controllers/PaymentController.ts +4 -4
- package/src/api/payments/entities/paymentIntents.ts +11 -11
- package/src/api/payments/entities/paymentMethods.ts +11 -11
- package/src/api/payments/entities/refunds.ts +9 -9
- package/src/api/payments/providers/PaymentProvider.ts +18 -0
- package/src/api/payments/schemas/intentSchemas.ts +25 -25
- package/src/api/payments/schemas/paymentMethodSchemas.ts +3 -3
- package/src/api/payments/services/PaymentService.ts +60 -3
- package/src/api/subscriptions/__tests__/SubscriptionService.spec.ts +14 -0
- package/src/api/subscriptions/controllers/AdminSubscriptionController.ts +11 -11
- package/src/api/subscriptions/controllers/SubscriptionController.ts +5 -4
- package/src/api/subscriptions/entities/subscriptionEvents.ts +15 -15
- package/src/api/subscriptions/entities/subscriptions.ts +22 -22
- package/src/api/subscriptions/notifications/SubscriptionNotifications.ts +22 -22
- package/src/api/subscriptions/schemas/cancelSubscriptionSchema.ts +4 -4
- package/src/api/subscriptions/schemas/changePlanSchema.ts +5 -5
- package/src/api/subscriptions/schemas/createSubscriptionSchema.ts +14 -7
- package/src/api/subscriptions/schemas/entitlementsSchema.ts +10 -10
- package/src/api/subscriptions/schemas/mrrSchema.ts +9 -9
- package/src/api/subscriptions/schemas/planDefinitionSchema.ts +21 -21
- package/src/api/subscriptions/schemas/planResourceSchema.ts +19 -19
- package/src/api/subscriptions/schemas/subscriptionQuerySchema.ts +8 -8
- package/src/api/subscriptions/schemas/subscriptionSettingsSchema.ts +7 -7
- package/src/api/subscriptions/schemas/subscriptionStatsSchema.ts +17 -17
- package/src/api/subscriptions/services/SubscriptionConfig.ts +2 -2
- package/src/api/users/__tests__/ApiKeys-integration.spec.ts +11 -11
- package/src/api/users/atoms/realmAuthSettingsAtom.ts +111 -119
- package/src/api/users/controllers/AdminIdentityController.ts +29 -19
- package/src/api/users/controllers/AdminSessionController.ts +37 -27
- package/src/api/users/controllers/AdminUserController.ts +75 -53
- package/src/api/users/controllers/MySessionController.ts +125 -0
- package/src/api/users/controllers/RealmController.ts +9 -10
- package/src/api/users/controllers/UserController.ts +55 -55
- package/src/api/users/entities/identities.ts +8 -8
- package/src/api/users/entities/sessions.ts +17 -17
- package/src/api/users/entities/users.ts +17 -17
- package/src/api/users/index.ts +3 -0
- package/src/api/users/notifications/UserNotifications.ts +76 -24
- package/src/api/users/primitives/$realm.ts +12 -26
- package/src/api/users/providers/RealmProvider.ts +0 -15
- package/src/api/users/schemas/completePasswordResetRequestSchema.ts +8 -12
- package/src/api/users/schemas/completeRegistrationRequestSchema.ts +17 -20
- package/src/api/users/schemas/createUserSchema.ts +2 -2
- package/src/api/users/schemas/identityQuerySchema.ts +4 -4
- package/src/api/users/schemas/identityResourceSchema.ts +3 -2
- package/src/api/users/schemas/loginSchema.ts +4 -4
- package/src/api/users/schemas/passwordResetIntentResponseSchema.ts +6 -8
- package/src/api/users/schemas/realmConfigSchema.ts +10 -24
- package/src/api/users/schemas/registerQuerySchema.ts +6 -6
- package/src/api/users/schemas/registerRequestSchema.ts +21 -43
- package/src/api/users/schemas/registerResponseSchema.ts +2 -2
- package/src/api/users/schemas/registerSchema.ts +13 -31
- package/src/api/users/schemas/registrationIntentResponseSchema.ts +19 -23
- package/src/api/users/schemas/resetPasswordSchema.ts +10 -17
- package/src/api/users/schemas/sessionQuerySchema.ts +3 -3
- package/src/api/users/schemas/sessionResourceSchema.ts +25 -25
- package/src/api/users/schemas/updateUserSchema.ts +3 -4
- package/src/api/users/schemas/userQuerySchema.ts +7 -7
- package/src/api/users/services/RegistrationService.ts +25 -11
- package/src/api/users/services/UserService.ts +12 -6
- package/src/api/verifications/__tests__/CodeVerification.spec.ts +63 -101
- package/src/api/verifications/__tests__/LinkVerification.spec.ts +23 -92
- package/src/api/verifications/controllers/VerificationController.ts +13 -27
- package/src/api/verifications/entities/verifications.ts +13 -14
- package/src/api/verifications/schemas/requestVerificationCodeResponseSchema.ts +17 -14
- package/src/api/verifications/schemas/validateVerificationCodeResponseSchema.ts +9 -10
- package/src/api/verifications/schemas/verificationSettingsSchema.ts +65 -66
- package/src/api/verifications/schemas/verificationTypeEnumSchema.ts +2 -2
- package/src/api/verifications/services/VerificationService.ts +12 -0
- package/src/background/__tests__/BackgroundTaskProvider.spec.ts +36 -0
- package/src/batch/__tests__/$batch.spec.ts +22 -22
- package/src/batch/__tests__/startup-buffering.spec.ts +9 -9
- package/src/bin/index.ts +1 -1
- package/src/bucket/__tests__/TenantScopedBucket.spec.ts +60 -0
- package/src/bucket/providers/LocalFileStorageProvider.ts +14 -6
- package/src/bucket/providers/MemoryFileStorageProvider.ts +18 -7
- package/src/bucket/providers/R2FileStorageProvider.ts +14 -6
- package/src/bucket/providers/S3FileStorageProvider.ts +31 -15
- package/src/cache/core/primitives/$cache.ts +7 -10
- package/src/cache/database/entities/cacheEntries.ts +16 -27
- package/src/cache/database/providers/DatabaseCacheProvider.ts +15 -13
- package/src/cache/redis/providers/RedisCacheProvider.ts +6 -6
- package/src/captcha/providers/TurnstileCaptchaProvider.ts +4 -4
- package/src/cli/core/__tests__/BuildCloudflareTask.spec.ts +178 -0
- package/src/cli/core/__tests__/BuildDockerTask.spec.ts +0 -2
- package/src/cli/core/__tests__/DbCommand.spec.ts +108 -0
- package/src/cli/core/atoms/appEntryOptions.ts +5 -5
- package/src/cli/core/atoms/buildOptions.ts +76 -76
- package/src/cli/core/atoms/changelogOptions.ts +3 -3
- package/src/cli/core/atoms/devOptions.ts +3 -3
- package/src/cli/core/commands/build.ts +36 -39
- package/src/cli/core/commands/db.ts +171 -83
- package/src/cli/core/commands/dev.ts +8 -8
- package/src/cli/core/commands/gen/changelog.ts +12 -14
- package/src/cli/core/commands/gen/env.ts +6 -6
- package/src/cli/core/commands/gen/openapi.ts +6 -6
- package/src/cli/core/commands/init.ts +28 -33
- package/src/cli/core/commands/pack.ts +10 -10
- package/src/cli/core/commands/root.ts +7 -8
- package/src/cli/core/commands/test.ts +17 -20
- package/src/cli/core/tasks/BuildCloudflareTask.ts +103 -230
- package/src/cli/core/templates/apiHelloResponseSchemaTs.ts +4 -4
- package/src/cli/devtools/atoms/devtoolsOptions.ts +6 -6
- package/src/cli/i18n/atoms/i18nOptions.ts +8 -8
- package/src/cli/platform/commands/SecretsCommand.ts +24 -25
- package/src/cli/platform/commands/platform.ts +40 -46
- package/src/cli/platform/index.ts +1 -1
- package/src/cli/platform-lib/__tests__/CloudflareAdapter.spec.ts +0 -4
- package/src/cli/platform-lib/__tests__/PlatformInspector.spec.ts +10 -3
- package/src/cli/platform-lib/__tests__/VercelAdapter.spec.ts +0 -2
- package/src/cli/platform-lib/adapters/CloudflareAdapter.ts +13 -14
- package/src/cli/platform-lib/adapters/VercelAdapter.ts +6 -11
- package/src/cli/platform-lib/atoms/platformOptions.ts +46 -25
- package/src/cli/platform-lib/schemas/cloudflare.ts +87 -87
- package/src/cli/platform-lib/schemas/platform.ts +51 -51
- package/src/cli/platform-lib/schemas/vercel.ts +28 -28
- package/src/cli/platform-lib/services/CloudflareApi.ts +5 -5
- package/src/cli/platform-lib/services/VercelApi.ts +4 -4
- package/src/cli/platform-lib/services/VercelCli.ts +6 -15
- package/src/cli/platform-lib/services/WranglerApi.ts +6 -15
- package/src/cli/vendor/atoms/vendorOptions.ts +9 -9
- package/src/cli/vendor/commands/VendorCommand.ts +11 -12
- package/src/command/__tests__/$command.spec.ts +82 -83
- package/src/command/__tests__/Asker.spec.ts +6 -13
- package/src/command/__tests__/CliProvider.spec.ts +136 -149
- package/src/command/__tests__/Runner.spec.ts +86 -110
- package/src/command/helpers/Asker.ts +23 -58
- package/src/command/helpers/Runner.ts +34 -110
- package/src/command/index.ts +4 -9
- package/src/command/primitives/$command.ts +10 -10
- package/src/command/providers/CliProvider.ts +183 -161
- package/src/core/Alepha.ts +62 -13
- package/src/core/__tests__/$atom.spec.ts +52 -3
- package/src/core/__tests__/$computed.spec.ts +129 -0
- package/src/core/__tests__/$env.spec.ts +13 -13
- package/src/core/__tests__/$inject.spec.ts +4 -4
- package/src/core/__tests__/$module.spec.ts +1 -1
- package/src/core/__tests__/Alepha-graph.spec.ts +1 -1
- package/src/core/__tests__/Alepha-parseEnv.spec.ts +32 -32
- package/src/core/__tests__/Alepha-start.spec.ts +3 -3
- package/src/core/__tests__/CodecManager.spec.ts +113 -94
- package/src/core/__tests__/KeylessJsonSchemaCodec.spec.ts +138 -138
- package/src/core/__tests__/SchemaValidator.spec.ts +43 -44
- package/src/core/__tests__/StateManager.persist.browser.spec.ts +87 -0
- package/src/core/__tests__/StateManager.spec.ts +423 -0
- package/src/core/__tests__/TypeBox-usecases.spec.ts +8 -8
- package/src/core/__tests__/TypeProvider.spec.ts +314 -309
- package/src/core/__tests__/dump.spec.ts +6 -6
- package/src/core/__tests__/pagination.spec.ts +4 -4
- package/src/core/__tests__/scoped-after-start.spec.ts +43 -0
- package/src/core/errors/TypeBoxError.ts +10 -4
- package/src/core/helpers/FileLike.ts +5 -5
- package/src/core/helpers/coerceStrings.ts +70 -0
- package/src/core/helpers/jsonSchemaToZod.ts +112 -0
- package/src/core/index.shared.ts +4 -1
- package/src/core/primitives/$atom.ts +95 -27
- package/src/core/primitives/$computed.ts +148 -0
- package/src/core/primitives/$env.ts +5 -5
- package/src/core/primitives/$state.ts +1 -1
- package/src/core/providers/AlsProvider.ts +26 -0
- package/src/core/providers/CodecManager.ts +1 -2
- package/src/core/providers/JsonSchemaCodec.ts +1 -2
- package/src/core/providers/KeylessJsonSchemaCodec.ts +82 -57
- package/src/core/providers/SchemaValidator.ts +48 -158
- package/src/core/providers/StateManager.ts +383 -9
- package/src/core/providers/TypeProvider.ts +80 -734
- package/src/core/providers/ZodProvider.ts +380 -0
- package/src/core/providers/zodAugment.ts +69 -0
- package/src/core/schemas/pageQuerySchema.ts +19 -21
- package/src/core/schemas/pageSchema.ts +47 -57
- package/src/crypto/__tests__/SecretProvider.spec.ts +31 -0
- package/src/crypto/providers/SecretProvider.ts +16 -10
- package/src/datetime/primitives/$throttle.ts +6 -1
- package/src/email/brevo/providers/BrevoEmailProvider.ts +4 -4
- package/src/email/cloudflare/providers/CloudflareEmailProvider.ts +6 -6
- package/src/email/core/index.ts +7 -2
- package/src/email/core/primitives/$email.ts +5 -1
- package/src/email/core/providers/LocalEmailProvider.ts +5 -5
- package/src/email/smtp/providers/NodemailerEmailProvider.ts +41 -52
- package/src/fake/__tests__/FakeProvider.spec.ts +110 -110
- package/src/fake/__tests__/keyName.example.ts +21 -21
- package/src/fake/__tests__/keyName.spec.ts +41 -41
- package/src/fake/__tests__/module.example.ts +8 -8
- package/src/fake/providers/FakeProvider.ts +122 -121
- package/src/lock/core/__tests__/lock-mutual-exclusion.spec.ts +44 -0
- package/src/lock/core/index.ts +1 -0
- package/src/lock/core/primitives/$lock.ts +13 -6
- package/src/logger/__tests__/CliFormatterProvider.spec.ts +76 -0
- package/src/logger/__tests__/Logger.spec.ts +49 -0
- package/src/logger/index.ts +25 -18
- package/src/logger/providers/CliFormatterProvider.ts +75 -0
- package/src/logger/schemas/logEntrySchema.ts +10 -10
- package/src/logger/services/Logger.ts +18 -0
- package/src/mcp/__tests__/$prompt.spec.ts +21 -23
- package/src/mcp/__tests__/$tool.spec.ts +22 -22
- package/src/mcp/__tests__/McpServerProvider.spec.ts +11 -11
- package/src/mcp/__tests__/StreamableHttpMcpTransport.spec.ts +2 -2
- package/src/mcp/__tests__/integration.spec.ts +33 -33
- package/src/mcp/primitives/$prompt.ts +11 -9
- package/src/mcp/primitives/$tool.ts +27 -86
- package/src/mcp/transports/StreamableHttpMcpTransport.ts +7 -7
- package/src/orm/__tests__/$repository-tests.ts +133 -27
- package/src/orm/__tests__/$repository.spec.ts +23 -0
- package/src/orm/__tests__/$transactional-tests.ts +4 -4
- package/src/orm/__tests__/ModelBuilder-tests.ts +28 -28
- package/src/orm/__tests__/ModelBuilder.spec.ts +124 -106
- package/src/orm/__tests__/QueryManager.spec.ts +5 -5
- package/src/orm/__tests__/delete-returning-tests.ts +11 -11
- package/src/orm/__tests__/deletedAt-tests.ts +3 -3
- package/src/orm/__tests__/enums.spec.ts +29 -25
- package/src/orm/__tests__/execute-tests.ts +8 -8
- package/src/orm/__tests__/fixtures/bigEntitySchema.ts +48 -48
- package/src/orm/__tests__/fixtures/userEntitySchema.ts +6 -6
- package/src/orm/__tests__/joins-tests.ts +30 -30
- package/src/orm/__tests__/organization-tests.ts +105 -3
- package/src/orm/__tests__/organization.spec.ts +46 -0
- package/src/orm/__tests__/orm-errors.spec.ts +10 -10
- package/src/orm/__tests__/orm-next-tests.ts +29 -29
- package/src/orm/__tests__/orm-showcase-tests.ts +9 -9
- package/src/orm/__tests__/primaryKey.spec.ts +4 -4
- package/src/orm/__tests__/query-date-encoding-tests.ts +17 -17
- package/src/orm/__tests__/ref-auto-onDelete.spec.ts +14 -14
- package/src/orm/__tests__/references.spec.ts +7 -7
- package/src/orm/__tests__/security.spec.ts +17 -17
- package/src/orm/__tests__/string-operators-tests.ts +5 -5
- package/src/orm/__tests__/timestamps-tests.ts +14 -14
- package/src/orm/__tests__/validation-tests.ts +5 -5
- package/src/orm/core/__tests__/BunSqliteProvider.bun.spec.ts +8 -8
- package/src/orm/core/constants/PG_SYMBOLS.ts +13 -1
- package/src/orm/core/entities/alephaSequences.ts +8 -8
- package/src/orm/core/helpers/pgAttr.ts +4 -4
- package/src/orm/core/primitives/$entity.ts +10 -6
- package/src/orm/core/providers/DatabaseTypeProvider.ts +46 -53
- package/src/orm/core/providers/drivers/BunSqliteProvider.ts +8 -8
- package/src/orm/core/providers/drivers/CloudflareD1Provider.ts +3 -5
- package/src/orm/core/providers/drivers/NodeSqliteProvider.ts +8 -8
- package/src/orm/core/schemas/databaseEnvSchema.ts +4 -4
- package/src/orm/core/schemas/insertSchema.ts +14 -18
- package/src/orm/core/schemas/legacyIdSchema.ts +2 -2
- package/src/orm/core/schemas/updateSchema.ts +10 -16
- package/src/orm/core/services/PgRelationManager.ts +2 -2
- package/src/orm/core/services/QueryManager.ts +13 -2
- package/src/orm/core/services/Repository.ts +88 -33
- package/src/orm/core/services/SqliteModelBuilder.ts +38 -45
- package/src/orm/postgres/__tests__/BunPostgresProvider.bun.spec.ts +4 -4
- package/src/orm/postgres/providers/CloudflareHyperdriveProvider.ts +4 -6
- package/src/orm/postgres/schemas/postgresEnvSchema.ts +6 -6
- package/src/orm/postgres/services/PostgresModelBuilder.ts +127 -114
- package/src/queue/core/__tests__/$consumer.spec.ts +4 -4
- package/src/queue/core/__tests__/WorkerProvider.spec.ts +4 -4
- package/src/queue/core/__tests__/shared.ts +6 -6
- package/src/queue/core/primitives/$consumer.ts +5 -5
- package/src/queue/core/primitives/$queue.ts +44 -61
- package/src/queue/core/providers/CloudflareQueueProvider.ts +6 -0
- package/src/queue/core/providers/WorkerProvider.ts +17 -14
- package/src/queue/redis/providers/RedisQueueProvider.ts +3 -3
- package/src/react/core/__tests__/ErrorBoundary.browser.spec.tsx +92 -0
- package/src/react/core/__tests__/Router.spec.tsx +4 -4
- package/src/react/core/__tests__/useComputed.browser.spec.tsx +192 -0
- package/src/react/core/__tests__/useQuery.browser.spec.tsx +48 -0
- package/src/react/core/__tests__/useSelector.browser.spec.tsx +105 -0
- package/src/react/core/__tests__/useStore.browser.spec.tsx +113 -0
- package/src/react/core/components/ErrorBoundary.tsx +42 -0
- package/src/react/core/hooks/useAction.ts +56 -19
- package/src/react/core/hooks/useComputed.ts +91 -0
- package/src/react/core/hooks/useSelector.ts +67 -0
- package/src/react/core/hooks/useStore.ts +36 -17
- package/src/react/core/index.ts +3 -0
- package/src/react/core/utils/shallowEqual.ts +36 -0
- package/src/react/form/__tests__/FormModel-submit-loading.spec.ts +2 -2
- package/src/react/form/__tests__/form-submitting-reactive.browser.spec.tsx +5 -5
- package/src/react/form/__tests__/useForm.browser.spec.tsx +54 -54
- package/src/react/form/errors/FormValidationError.ts +0 -2
- package/src/react/form/hooks/useForm.ts +19 -4
- package/src/react/form/hooks/useFormQuerySync.ts +0 -0
- package/src/react/form/services/FormModel.ts +67 -47
- package/src/react/form/services/parseField.ts +66 -27
- package/src/react/i18n/__tests__/Localize.spec.tsx +1 -1
- package/src/react/i18n/providers/I18nProvider.ts +2 -2
- package/src/react/router/__tests__/$page.browser.spec.tsx +19 -19
- package/src/react/router/__tests__/$page.spec.tsx +21 -21
- package/src/react/router/__tests__/ReactBrowserProvider.browser.spec.ts +87 -1
- package/src/react/router/atoms/ssrManifestAtom.ts +16 -16
- package/src/react/router/components/NestedView.tsx +11 -3
- package/src/react/router/hooks/useQueryParams.ts +1 -1
- package/src/react/router/primitives/$page.ts +2 -2
- package/src/react/router/providers/ReactBrowserProvider.ts +64 -13
- package/src/react/router/providers/ReactPageProvider.ts +26 -12
- package/src/react/router/providers/ReactServerProvider.ts +13 -15
- package/src/react/sitemap/__tests__/$sitemap.spec.ts +2 -2
- package/src/react/ui/atoms/uiAtom.ts +6 -6
- package/src/react/ui/atoms/uiThemeListAtom.ts +7 -7
- package/src/react/ui/hooks/useColorMode.ts +11 -4
- package/src/react/ui/services/SchemaControl.ts +4 -4
- package/src/redis/providers/BunRedisProvider.ts +19 -11
- package/src/redis/providers/NodeRedisProvider.ts +3 -3
- package/src/scheduler/primitives/$scheduler.ts +21 -8
- package/src/security/__tests__/assertRealmScope.spec.ts +29 -0
- package/src/security/atoms/currentTenantAtom.ts +6 -6
- package/src/security/atoms/currentUserAtom.ts +2 -2
- package/src/security/primitives/$issuer.ts +24 -2
- package/src/security/providers/JwtProvider.ts +100 -0
- package/src/security/providers/SecurityProvider.ts +43 -2
- package/src/security/schemas/permissionSchema.ts +19 -19
- package/src/security/schemas/roleSchema.ts +22 -28
- package/src/security/schemas/userAccountInfoSchema.ts +47 -37
- package/src/server/auth/index.ts +0 -3
- package/src/server/auth/primitives/$auth.ts +6 -6
- package/src/server/auth/primitives/$authApple.ts +10 -10
- package/src/server/auth/primitives/$authFacebook.ts +10 -10
- package/src/server/auth/primitives/$authFranceConnect.ts +10 -10
- package/src/server/auth/primitives/$authGithub.ts +10 -10
- package/src/server/auth/primitives/$authGoogle.ts +10 -10
- package/src/server/auth/primitives/$authMicrosoft.ts +14 -14
- package/src/server/auth/providers/ServerAuthProvider.ts +49 -48
- package/src/server/auth/schemas/authenticationProviderSchema.ts +9 -12
- package/src/server/auth/schemas/tokenResponseSchema.ts +2 -2
- package/src/server/auth/schemas/tokensSchema.ts +16 -16
- package/src/server/auth/schemas/userinfoResponseSchema.ts +3 -3
- package/src/server/cookies/__tests__/AtomCookieBinding.spec.ts +80 -0
- package/src/server/cookies/__tests__/AtomCookiePersistence.browser.spec.ts +169 -0
- package/src/server/cookies/__tests__/AtomCookiePersistence.spec.ts +294 -0
- package/src/server/cookies/__tests__/ServerCookiesProvider.spec.ts +14 -14
- package/src/server/cookies/index.browser.ts +4 -1
- package/src/server/cookies/index.ts +8 -1
- package/src/server/cookies/primitives/$cookie.browser.ts +1 -1
- package/src/server/cookies/primitives/$cookie.ts +16 -0
- package/src/server/cookies/providers/AtomCookiePersistence.browser.ts +133 -0
- package/src/server/cookies/providers/AtomCookiePersistence.ts +148 -0
- package/src/server/cookies/providers/ServerCookiesProvider.ts +13 -5
- package/src/server/cookies/services/CookieParser.ts +6 -1
- package/src/server/core/__tests__/$action.spec.ts +13 -13
- package/src/server/core/__tests__/$middleware.spec.ts +10 -10
- package/src/server/core/__tests__/$route.spec.ts +9 -9
- package/src/server/core/__tests__/$sse.spec.ts +26 -26
- package/src/server/core/__tests__/BunHttpServerProvider.bun.spec.ts +6 -6
- package/src/server/core/__tests__/HttpClient.spec.ts +2 -2
- package/src/server/core/__tests__/NodeHttpServerProvider.spec.ts +15 -3
- package/src/server/core/__tests__/ServerBodyParserProvider.spec.ts +14 -14
- package/src/server/core/__tests__/ServerMultipartProvider.spec.ts +33 -33
- package/src/server/core/__tests__/ServerRouterProvider-errorHandler.spec.ts +5 -1
- package/src/server/core/__tests__/ServerRouterProvider-getRoutes.spec.ts +25 -25
- package/src/server/core/__tests__/ServerRouterProvider-serializationError.spec.ts +9 -5
- package/src/server/core/__tests__/ServerRouterProvider-validationError.spec.ts +56 -24
- package/src/server/core/errors/ValidationError.ts +6 -3
- package/src/server/core/helpers/isMultipart.ts +2 -1
- package/src/server/core/index.ts +5 -2
- package/src/server/core/interfaces/ServerRequest.ts +6 -14
- package/src/server/core/primitives/$action.ts +26 -36
- package/src/server/core/primitives/$sse.ts +3 -3
- package/src/server/core/providers/BunHttpServerProvider.ts +8 -9
- package/src/server/core/providers/NodeHttpServerProvider.ts +8 -9
- package/src/server/core/providers/ServerBodyParserProvider.ts +20 -12
- package/src/server/core/providers/ServerCompressProvider.ts +9 -10
- package/src/server/core/providers/ServerHelmetProvider.ts +26 -27
- package/src/server/core/providers/ServerMultipartProvider.ts +19 -19
- package/src/server/core/providers/ServerRouterProvider.ts +44 -15
- package/src/server/core/schemas/errorSchema.ts +20 -25
- package/src/server/core/schemas/okSchema.ts +9 -14
- package/src/server/core/services/HttpClient.ts +13 -1
- package/src/server/core/services/ServerRequestParser.ts +6 -6
- package/src/server/cors/providers/ServerCorsProvider.ts +26 -28
- package/src/server/health/schemas/healthSchema.ts +6 -6
- package/src/server/links/__tests__/$remote.spec.ts +3 -3
- package/src/server/links/__tests__/BatchEndpoint.spec.ts +9 -9
- package/src/server/links/__tests__/LinkProvider.spec.ts +9 -9
- package/src/server/links/__tests__/ServerLinksProvider.spec.ts +23 -23
- package/src/server/links/__tests__/fixtures/CrudApp.ts +21 -21
- package/src/server/links/atoms/apiLinksAtom.ts +2 -2
- package/src/server/links/atoms/linkOptionsAtom.ts +6 -6
- package/src/server/links/primitives/$remote.ts +3 -3
- package/src/server/links/providers/LinkProvider.ts +3 -3
- package/src/server/links/providers/ServerLinksProvider.ts +20 -20
- package/src/server/links/schemas/apiLinksResponseSchema.ts +23 -23
- package/src/server/proxy/__tests__/$proxy.spec.ts +9 -9
- package/src/server/proxy/providers/ServerProxyProvider.ts +5 -0
- package/src/server/rate-limit/providers/ServerRateLimitProvider.ts +18 -20
- package/src/server/swagger/__tests__/$swagger.spec.ts +91 -94
- package/src/server/swagger/__tests__/ui.spec.ts +3 -3
- package/src/server/swagger/providers/ServerSwaggerProvider.ts +66 -43
- package/src/system/__tests__/NodeShellProvider.spec.ts +46 -0
- package/src/system/providers/NodeShellProvider.ts +4 -1
- package/src/topic/core/__tests__/$subscriber.spec.ts +4 -4
- package/src/topic/core/__tests__/shared.ts +8 -8
- package/src/topic/core/primitives/$subscriber.ts +5 -5
- package/src/topic/core/primitives/$topic.ts +14 -14
- package/src/topic/redis/providers/RedisTopicProvider.ts +3 -3
- package/dist/container/core/index.d.ts +0 -236
- package/dist/container/core/index.d.ts.map +0 -1
- package/dist/container/core/index.js +0 -231
- package/dist/container/core/index.js.map +0 -1
- package/dist/container/core/index.workerd.js +0 -192
- package/dist/container/core/index.workerd.js.map +0 -1
- package/src/command/helpers/PrettyAsker.ts +0 -256
- package/src/command/helpers/PrettyPrint.ts +0 -332
- package/src/container/core/__tests__/$container.spec.ts +0 -83
- package/src/container/core/index.ts +0 -50
- package/src/container/core/index.workerd.ts +0 -53
- package/src/container/core/interfaces/ContainerOptions.ts +0 -69
- package/src/container/core/primitives/$container.ts +0 -100
- package/src/container/core/providers/CloudflareContainerProvider.ts +0 -70
- package/src/container/core/providers/ContainerProvider.ts +0 -92
- package/src/container/core/providers/MockContainerProvider.ts +0 -62
- package/src/container/core/providers/NodeContainerProvider.ts +0 -53
- package/src/core/__tests__/jsonSchemaToTypeBox.spec.ts +0 -771
- package/src/core/helpers/jsonSchemaToTypeBox.ts +0 -359
- package/src/server/auth/__tests__/authFederationClient.spec.ts +0 -40
- package/src/server/auth/__tests__/federationAssertion.spec.ts +0 -146
- package/src/server/auth/helpers/federationAssertion.ts +0 -74
- package/src/server/auth/primitives/$authFederationBroker.ts +0 -273
- package/src/server/auth/primitives/$authFederationClient.ts +0 -89
- /package/dist/orm/core/{chunk-B4FMCO8f.js → rolldown-runtime-B4FMCO8f.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $atom, $inject, $module, $state, Alepha, AlephaError,
|
|
1
|
+
import { $atom, $inject, $module, $state, Alepha, AlephaError, z } from "alepha";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
import { join } from "node:path";
|
|
@@ -19,17 +19,17 @@ import { homedir, platform } from "node:os";
|
|
|
19
19
|
const platformOptions = $atom({
|
|
20
20
|
name: "alepha.cli.platform.options",
|
|
21
21
|
description: "Platform deployment configuration",
|
|
22
|
-
schema:
|
|
22
|
+
schema: z.object({
|
|
23
23
|
/**
|
|
24
24
|
* Project name override. Defaults to root package.json "name".
|
|
25
25
|
*/
|
|
26
|
-
name:
|
|
26
|
+
name: z.text().optional(),
|
|
27
27
|
/**
|
|
28
28
|
* Default environment when --env is omitted.
|
|
29
29
|
*
|
|
30
30
|
* @default "production"
|
|
31
31
|
*/
|
|
32
|
-
default:
|
|
32
|
+
default: z.text().optional(),
|
|
33
33
|
/**
|
|
34
34
|
* Multi-tenancy mode — controls whether `--tenant <slug>` is
|
|
35
35
|
* accepted/required and how it shapes resource names + the domain.
|
|
@@ -43,16 +43,16 @@ const platformOptions = $atom({
|
|
|
43
43
|
*
|
|
44
44
|
* @default "none"
|
|
45
45
|
*/
|
|
46
|
-
tenancy:
|
|
46
|
+
tenancy: z.enum([
|
|
47
47
|
"none",
|
|
48
48
|
"optional",
|
|
49
49
|
"required"
|
|
50
|
-
])),
|
|
50
|
+
]).optional(),
|
|
51
51
|
/**
|
|
52
52
|
* Secret store configuration for syncing .env secrets
|
|
53
53
|
* to external providers (e.g. GitHub Actions environments).
|
|
54
54
|
*/
|
|
55
|
-
secrets:
|
|
55
|
+
secrets: z.object({
|
|
56
56
|
/**
|
|
57
57
|
* Explicit override of the worker secret-key allowlist.
|
|
58
58
|
*
|
|
@@ -69,24 +69,24 @@ const platformOptions = $atom({
|
|
|
69
69
|
* neither this nor a manifest is present, the `.env.<env>` file is
|
|
70
70
|
* itself the allowlist (legacy fallback).
|
|
71
71
|
*/
|
|
72
|
-
keys:
|
|
72
|
+
keys: z.array(z.text()).optional(),
|
|
73
73
|
/**
|
|
74
74
|
* Secret store backend.
|
|
75
75
|
*/
|
|
76
|
-
store:
|
|
76
|
+
store: z.enum(["github"]).optional(),
|
|
77
77
|
/**
|
|
78
78
|
* Pattern for resolving environment names in the store.
|
|
79
79
|
* Placeholders: {project}, {env}.
|
|
80
80
|
*
|
|
81
81
|
* @default "{project}-{env}"
|
|
82
82
|
*/
|
|
83
|
-
environmentPattern:
|
|
84
|
-
})),
|
|
83
|
+
environmentPattern: z.text().optional()
|
|
84
|
+
}).optional(),
|
|
85
85
|
/**
|
|
86
86
|
* Named environments with their adapter and configuration.
|
|
87
87
|
*/
|
|
88
|
-
environments:
|
|
89
|
-
adapter:
|
|
88
|
+
environments: z.record(z.text({ description: "Environment name (e.g. 'production', 'staging', 'preview'). Used in resource naming and selected via --env." }), z.object({
|
|
89
|
+
adapter: z.enum(["cloudflare", "vercel"]),
|
|
90
90
|
/**
|
|
91
91
|
* Custom domain for the deployed worker (e.g. "api.example.com").
|
|
92
92
|
*
|
|
@@ -98,14 +98,30 @@ const platformOptions = $atom({
|
|
|
98
98
|
* Wildcard patterns require `zone` to be set, and the wildcard DNS
|
|
99
99
|
* record must already exist (proxied) in the Cloudflare zone.
|
|
100
100
|
*/
|
|
101
|
-
domain:
|
|
101
|
+
domain: z.text().optional(),
|
|
102
102
|
/**
|
|
103
103
|
* Cloudflare zone name (e.g. "alepha.dev") that owns `domain`.
|
|
104
104
|
*
|
|
105
|
-
* Required when `domain` contains a wildcard (`*`).
|
|
106
|
-
*
|
|
105
|
+
* Required when `domain` contains a wildcard (`*`). For a plain
|
|
106
|
+
* host, setting `zone` switches the binding from a Custom Domain to
|
|
107
|
+
* a zone *Route* (`domain/*`) — needed when another Worker holds a
|
|
108
|
+
* wildcard route covering the host (routes win by specificity,
|
|
109
|
+
* while a Custom Domain would lose to the wildcard route).
|
|
107
110
|
*/
|
|
108
|
-
zone:
|
|
111
|
+
zone: z.text().optional(),
|
|
112
|
+
/**
|
|
113
|
+
* Worker-to-worker service bindings, e.g.
|
|
114
|
+
* `[{ binding: "CLUB", service: "club-staging" }]`.
|
|
115
|
+
*
|
|
116
|
+
* Exposed on the runtime `env` (Alepha store key `cloudflare.env`).
|
|
117
|
+
* Use a binding to fetch() a sibling Worker on the same zone —
|
|
118
|
+
* plain subrequests to a host served by a same-zone Worker route
|
|
119
|
+
* bypass the route and 522.
|
|
120
|
+
*/
|
|
121
|
+
services: z.array(z.object({
|
|
122
|
+
binding: z.text(),
|
|
123
|
+
service: z.text()
|
|
124
|
+
})).optional(),
|
|
109
125
|
/**
|
|
110
126
|
* Cloudflare data jurisdiction for R2 buckets and D1 databases.
|
|
111
127
|
* - "eu": data stays within the EU
|
|
@@ -113,7 +129,7 @@ const platformOptions = $atom({
|
|
|
113
129
|
*
|
|
114
130
|
* Omit for the default (global) jurisdiction.
|
|
115
131
|
*/
|
|
116
|
-
jurisdiction:
|
|
132
|
+
jurisdiction: z.enum(["eu", "fedramp"]).optional(),
|
|
117
133
|
/**
|
|
118
134
|
* Cloudflare account ID to deploy into.
|
|
119
135
|
*
|
|
@@ -121,9 +137,9 @@ const platformOptions = $atom({
|
|
|
121
137
|
* token's account when the token is scoped to exactly one.
|
|
122
138
|
* Required when the token has access to multiple accounts.
|
|
123
139
|
*/
|
|
124
|
-
accountId:
|
|
140
|
+
accountId: z.text().optional()
|
|
125
141
|
}))
|
|
126
|
-
}))
|
|
142
|
+
}).optional()
|
|
127
143
|
});
|
|
128
144
|
//#endregion
|
|
129
145
|
//#region ../../src/cli/platform-lib/providers/PlatformCacheProvider.ts
|
|
@@ -174,104 +190,104 @@ var PlatformCacheProvider = class PlatformCacheProvider {
|
|
|
174
190
|
};
|
|
175
191
|
//#endregion
|
|
176
192
|
//#region ../../src/cli/platform-lib/schemas/cloudflare.ts
|
|
177
|
-
const cloudflareAccountSchema =
|
|
178
|
-
id:
|
|
179
|
-
name:
|
|
193
|
+
const cloudflareAccountSchema = z.object({
|
|
194
|
+
id: z.string(),
|
|
195
|
+
name: z.string()
|
|
180
196
|
});
|
|
181
|
-
const cloudflareD1Schema =
|
|
182
|
-
uuid:
|
|
183
|
-
name:
|
|
197
|
+
const cloudflareD1Schema = z.object({
|
|
198
|
+
uuid: z.string(),
|
|
199
|
+
name: z.string()
|
|
184
200
|
});
|
|
185
|
-
const cloudflareKVSchema =
|
|
186
|
-
id:
|
|
187
|
-
title:
|
|
201
|
+
const cloudflareKVSchema = z.object({
|
|
202
|
+
id: z.string(),
|
|
203
|
+
title: z.string()
|
|
188
204
|
});
|
|
189
|
-
const cloudflareR2Schema =
|
|
190
|
-
name:
|
|
191
|
-
creation_date:
|
|
205
|
+
const cloudflareR2Schema = z.object({
|
|
206
|
+
name: z.string(),
|
|
207
|
+
creation_date: z.string().optional()
|
|
192
208
|
});
|
|
193
|
-
const cloudflareR2ListSchema =
|
|
194
|
-
const cloudflareQueueSchema =
|
|
195
|
-
queue_id:
|
|
196
|
-
queue_name:
|
|
209
|
+
const cloudflareR2ListSchema = z.object({ buckets: z.array(cloudflareR2Schema) });
|
|
210
|
+
const cloudflareQueueSchema = z.object({
|
|
211
|
+
queue_id: z.string(),
|
|
212
|
+
queue_name: z.string()
|
|
197
213
|
});
|
|
198
|
-
const cloudflareQueueConsumerSchema =
|
|
199
|
-
consumer_id:
|
|
200
|
-
service:
|
|
201
|
-
environment:
|
|
214
|
+
const cloudflareQueueConsumerSchema = z.object({
|
|
215
|
+
consumer_id: z.string(),
|
|
216
|
+
service: z.string(),
|
|
217
|
+
environment: z.string().optional()
|
|
202
218
|
});
|
|
203
|
-
const cloudflareHyperdriveOriginSchema =
|
|
204
|
-
const cloudflareHyperdriveSchema =
|
|
205
|
-
id:
|
|
206
|
-
name:
|
|
219
|
+
const cloudflareHyperdriveOriginSchema = z.object({ host: z.string() });
|
|
220
|
+
const cloudflareHyperdriveSchema = z.object({
|
|
221
|
+
id: z.string(),
|
|
222
|
+
name: z.string(),
|
|
207
223
|
origin: cloudflareHyperdriveOriginSchema
|
|
208
224
|
});
|
|
209
|
-
const cloudflareWorkerSchema =
|
|
210
|
-
id:
|
|
211
|
-
created_on:
|
|
212
|
-
modified_on:
|
|
225
|
+
const cloudflareWorkerSchema = z.object({
|
|
226
|
+
id: z.string(),
|
|
227
|
+
created_on: z.string(),
|
|
228
|
+
modified_on: z.string()
|
|
213
229
|
});
|
|
214
|
-
const cloudflareDeploymentVersionSchema =
|
|
215
|
-
version_id:
|
|
216
|
-
percentage:
|
|
230
|
+
const cloudflareDeploymentVersionSchema = z.object({
|
|
231
|
+
version_id: z.string(),
|
|
232
|
+
percentage: z.number()
|
|
217
233
|
});
|
|
218
|
-
const cloudflareDeploymentSchema =
|
|
219
|
-
id:
|
|
220
|
-
versions:
|
|
221
|
-
created_on:
|
|
234
|
+
const cloudflareDeploymentSchema = z.object({
|
|
235
|
+
id: z.string(),
|
|
236
|
+
versions: z.array(cloudflareDeploymentVersionSchema),
|
|
237
|
+
created_on: z.string()
|
|
222
238
|
});
|
|
223
|
-
const cloudflareDeploymentListSchema =
|
|
224
|
-
const cloudflareVersionSchema =
|
|
225
|
-
id:
|
|
226
|
-
metadata:
|
|
227
|
-
annotations:
|
|
239
|
+
const cloudflareDeploymentListSchema = z.object({ deployments: z.array(cloudflareDeploymentSchema) });
|
|
240
|
+
const cloudflareVersionSchema = z.object({
|
|
241
|
+
id: z.string(),
|
|
242
|
+
metadata: z.object({ created_on: z.string() }),
|
|
243
|
+
annotations: z.record(z.string(), z.string()).optional()
|
|
228
244
|
});
|
|
229
|
-
const cloudflareVersionListSchema =
|
|
230
|
-
const cloudflareSecretSchema =
|
|
231
|
-
name:
|
|
232
|
-
type:
|
|
245
|
+
const cloudflareVersionListSchema = z.object({ items: z.array(cloudflareVersionSchema) });
|
|
246
|
+
const cloudflareSecretSchema = z.object({
|
|
247
|
+
name: z.string(),
|
|
248
|
+
type: z.string()
|
|
233
249
|
});
|
|
234
|
-
const createD1BodySchema =
|
|
235
|
-
name:
|
|
236
|
-
primary_location_hint:
|
|
237
|
-
jurisdiction:
|
|
250
|
+
const createD1BodySchema = z.object({
|
|
251
|
+
name: z.string(),
|
|
252
|
+
primary_location_hint: z.string().optional(),
|
|
253
|
+
jurisdiction: z.string().optional()
|
|
238
254
|
});
|
|
239
|
-
const createKVBodySchema =
|
|
240
|
-
const createR2BodySchema =
|
|
241
|
-
const cloudflareR2TokenSchema =
|
|
242
|
-
id:
|
|
243
|
-
accessKeyId:
|
|
244
|
-
secretAccessKey:
|
|
255
|
+
const createKVBodySchema = z.object({ title: z.string() });
|
|
256
|
+
const createR2BodySchema = z.object({ name: z.string() });
|
|
257
|
+
const cloudflareR2TokenSchema = z.object({
|
|
258
|
+
id: z.string(),
|
|
259
|
+
accessKeyId: z.string(),
|
|
260
|
+
secretAccessKey: z.string()
|
|
245
261
|
});
|
|
246
|
-
const createR2TokenBodySchema =
|
|
247
|
-
name:
|
|
248
|
-
policies:
|
|
249
|
-
effect:
|
|
250
|
-
permissions:
|
|
251
|
-
buckets:
|
|
262
|
+
const createR2TokenBodySchema = z.object({
|
|
263
|
+
name: z.string(),
|
|
264
|
+
policies: z.array(z.object({
|
|
265
|
+
effect: z.string(),
|
|
266
|
+
permissions: z.array(z.string()),
|
|
267
|
+
buckets: z.array(z.string()).optional()
|
|
252
268
|
}))
|
|
253
269
|
});
|
|
254
|
-
const createQueueBodySchema =
|
|
255
|
-
const createHyperdriveOriginSchema =
|
|
256
|
-
scheme:
|
|
257
|
-
host:
|
|
258
|
-
port:
|
|
259
|
-
database:
|
|
260
|
-
user:
|
|
261
|
-
password:
|
|
270
|
+
const createQueueBodySchema = z.object({ queue_name: z.string() });
|
|
271
|
+
const createHyperdriveOriginSchema = z.object({
|
|
272
|
+
scheme: z.string(),
|
|
273
|
+
host: z.string(),
|
|
274
|
+
port: z.number(),
|
|
275
|
+
database: z.string(),
|
|
276
|
+
user: z.string(),
|
|
277
|
+
password: z.string()
|
|
262
278
|
});
|
|
263
|
-
const createHyperdriveBodySchema =
|
|
264
|
-
name:
|
|
279
|
+
const createHyperdriveBodySchema = z.object({
|
|
280
|
+
name: z.string(),
|
|
265
281
|
origin: createHyperdriveOriginSchema
|
|
266
282
|
});
|
|
267
|
-
const putSecretBodySchema =
|
|
268
|
-
name:
|
|
269
|
-
text:
|
|
270
|
-
type:
|
|
283
|
+
const putSecretBodySchema = z.object({
|
|
284
|
+
name: z.string(),
|
|
285
|
+
text: z.string(),
|
|
286
|
+
type: z.string()
|
|
271
287
|
});
|
|
272
|
-
const cloudflareApiErrorSchema =
|
|
273
|
-
code:
|
|
274
|
-
message:
|
|
288
|
+
const cloudflareApiErrorSchema = z.object({
|
|
289
|
+
code: z.number(),
|
|
290
|
+
message: z.string()
|
|
275
291
|
});
|
|
276
292
|
//#endregion
|
|
277
293
|
//#region ../../src/cli/platform-lib/services/WranglerApi.ts
|
|
@@ -287,29 +303,19 @@ var WranglerApi = class {
|
|
|
287
303
|
shell = $inject(ShellProvider);
|
|
288
304
|
utils = $inject(AlephaCliUtils);
|
|
289
305
|
pm = $inject(PackageManagerUtils);
|
|
290
|
-
runner = $inject(Runner);
|
|
291
306
|
async runShell(command, options = {}) {
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
...options,
|
|
295
|
-
capture: capture ?? this.runner.useDynamicLogger
|
|
296
|
-
});
|
|
297
|
-
if (capture && !this.runner.useDynamicLogger) this.log.info(output);
|
|
307
|
+
const output = await this.shell.run(command, options);
|
|
308
|
+
if (options.capture) this.log.info(output);
|
|
298
309
|
return output;
|
|
299
310
|
}
|
|
300
311
|
/**
|
|
301
312
|
* Ensure wrangler is installed in the project.
|
|
302
313
|
*/
|
|
303
|
-
async ensureInstalled(root
|
|
314
|
+
async ensureInstalled(root) {
|
|
304
315
|
await this.pm.ensureDependency(root, "wrangler", {
|
|
305
316
|
dev: true,
|
|
306
317
|
exec: async (cmd, opts) => {
|
|
307
|
-
|
|
308
|
-
try {
|
|
309
|
-
await this.utils.exec(cmd, opts);
|
|
310
|
-
} finally {
|
|
311
|
-
run.resume();
|
|
312
|
-
}
|
|
318
|
+
await this.utils.exec(cmd, opts);
|
|
313
319
|
}
|
|
314
320
|
});
|
|
315
321
|
}
|
|
@@ -417,7 +423,7 @@ var CloudflareApi = class CloudflareApi {
|
|
|
417
423
|
this.accountId = fromEnv;
|
|
418
424
|
return this.accountId;
|
|
419
425
|
}
|
|
420
|
-
const res = await this.fetch("/accounts", { schema:
|
|
426
|
+
const res = await this.fetch("/accounts", { schema: z.array(cloudflareAccountSchema) });
|
|
421
427
|
if (res.length === 0) throw new AlephaError("No Cloudflare accounts found for this token.");
|
|
422
428
|
if (res.length > 1) {
|
|
423
429
|
const list = res.map((a) => ` - ${a.id} ${a.name}`).join("\n");
|
|
@@ -582,7 +588,7 @@ var CloudflareApi = class CloudflareApi {
|
|
|
582
588
|
}
|
|
583
589
|
async listSecrets(scriptName) {
|
|
584
590
|
const accountId = await this.resolveAccountId();
|
|
585
|
-
return await this.fetch(`/accounts/${accountId}/workers/scripts/${scriptName}/secrets`, { schema:
|
|
591
|
+
return await this.fetch(`/accounts/${accountId}/workers/scripts/${scriptName}/secrets`, { schema: z.array(cloudflareSecretSchema) });
|
|
586
592
|
}
|
|
587
593
|
async putSecret(scriptName, name, value) {
|
|
588
594
|
const accountId = await this.resolveAccountId();
|
|
@@ -681,7 +687,7 @@ var CloudflareApi = class CloudflareApi {
|
|
|
681
687
|
headers
|
|
682
688
|
})).json();
|
|
683
689
|
if (!json.success) throw new AlephaError(`Cloudflare API error (GET ${path}): ${json.errors.map((e) => e.message).join(", ")}`);
|
|
684
|
-
const validated = this.alepha.codec.validate(
|
|
690
|
+
const validated = this.alepha.codec.validate(z.array(itemSchema), json.result);
|
|
685
691
|
results.push(...validated);
|
|
686
692
|
const totalPages = json.result_info?.total_pages;
|
|
687
693
|
if (!totalPages || page >= totalPages || validated.length === 0) break;
|
|
@@ -702,7 +708,7 @@ var CloudflareApi = class CloudflareApi {
|
|
|
702
708
|
if (cursor) query.cursor = cursor;
|
|
703
709
|
const res = await this.fetch(path, { query });
|
|
704
710
|
const items = res[itemsKey] ?? [];
|
|
705
|
-
const validated = this.alepha.codec.validate(
|
|
711
|
+
const validated = this.alepha.codec.validate(z.array(itemSchema), items);
|
|
706
712
|
results.push(...validated);
|
|
707
713
|
const nextCursor = res.cursor;
|
|
708
714
|
if (!nextCursor || validated.length === 0) break;
|
|
@@ -882,12 +888,8 @@ var CloudflareAdapter = class CloudflareAdapter extends PlatformAdapter {
|
|
|
882
888
|
this.api.setAccountId(ctx.envConfig.accountId);
|
|
883
889
|
}
|
|
884
890
|
async runShell(command, options = {}) {
|
|
885
|
-
const
|
|
886
|
-
|
|
887
|
-
...options,
|
|
888
|
-
capture: capture ?? this.runner.useDynamicLogger
|
|
889
|
-
});
|
|
890
|
-
if (capture && !this.runner.useDynamicLogger) this.log.info(output);
|
|
891
|
+
const output = await this.shell.run(command, options);
|
|
892
|
+
if (options.capture) this.log.info(output);
|
|
891
893
|
return output;
|
|
892
894
|
}
|
|
893
895
|
async authenticate(ctx, run) {
|
|
@@ -895,18 +897,14 @@ var CloudflareAdapter = class CloudflareAdapter extends PlatformAdapter {
|
|
|
895
897
|
await run({
|
|
896
898
|
name: "authenticate",
|
|
897
899
|
handler: async () => {
|
|
898
|
-
await this.wrangler.ensureInstalled(ctx.root
|
|
900
|
+
await this.wrangler.ensureInstalled(ctx.root);
|
|
899
901
|
let needsLogin = false;
|
|
900
902
|
try {
|
|
901
903
|
await this.wrangler.getAuthToken();
|
|
902
904
|
} catch {
|
|
903
905
|
needsLogin = true;
|
|
904
906
|
}
|
|
905
|
-
if (needsLogin)
|
|
906
|
-
run.pause();
|
|
907
|
-
await this.wrangler.login();
|
|
908
|
-
run.resume();
|
|
909
|
-
}
|
|
907
|
+
if (needsLogin) await this.wrangler.login();
|
|
910
908
|
if (await this.cache.isLoginFresh(ctx.root, "cloudflare")) return;
|
|
911
909
|
try {
|
|
912
910
|
const accountId = await this.api.resolveAccountId();
|
|
@@ -938,11 +936,11 @@ var CloudflareAdapter = class CloudflareAdapter extends PlatformAdapter {
|
|
|
938
936
|
if (ctx.resources.hasQueue) env.CLOUDFLARE_QUEUE_NAME = ctx.naming.queue();
|
|
939
937
|
const host = tenantDomain(ctx.envConfig.domain, ctx.tenant);
|
|
940
938
|
if (host) {
|
|
941
|
-
if (host.includes("*") && !ctx.envConfig.zone) throw new AlephaError(`Wildcard domain "${host}" requires "zone" to be set in the environment config (the Cloudflare zone name, e.g. "alepha.dev").`);
|
|
942
939
|
env.CLOUDFLARE_DOMAIN = host;
|
|
943
940
|
if (ctx.envConfig.zone) env.CLOUDFLARE_ZONE = ctx.envConfig.zone;
|
|
944
941
|
}
|
|
945
942
|
if (ctx.envConfig.jurisdiction) env.CLOUDFLARE_JURISDICTION = ctx.envConfig.jurisdiction;
|
|
943
|
+
if (ctx.envConfig.services?.length) env.CLOUDFLARE_SERVICES = JSON.stringify(ctx.envConfig.services);
|
|
946
944
|
if (ctx.prebuilt) {
|
|
947
945
|
await run({
|
|
948
946
|
name: "alepha build -t cloudflare --prebuilt (in-process)",
|
|
@@ -1033,7 +1031,7 @@ var CloudflareAdapter = class CloudflareAdapter extends PlatformAdapter {
|
|
|
1033
1031
|
* Vars that are handled by wrangler bindings or build config.
|
|
1034
1032
|
* These should not be pushed as secrets.
|
|
1035
1033
|
*/
|
|
1036
|
-
static EXCLUDED_SECRET_KEYS = new Set([
|
|
1034
|
+
static EXCLUDED_SECRET_KEYS = /* @__PURE__ */ new Set([
|
|
1037
1035
|
"DATABASE_URL",
|
|
1038
1036
|
"R2_BUCKET_NAME",
|
|
1039
1037
|
"CLOUDFLARE_DOMAIN",
|
|
@@ -1071,7 +1069,7 @@ var CloudflareAdapter = class CloudflareAdapter extends PlatformAdapter {
|
|
|
1071
1069
|
const declaredKeys = this.options?.secrets?.keys;
|
|
1072
1070
|
const manifestKeys = await this.readManifestEnvKeys(ctx.root);
|
|
1073
1071
|
const localKeys = Object.keys(await this.envUtils.parseEnv(ctx.root, [`.env.${ctx.env}.local`]));
|
|
1074
|
-
const keys = declaredKeys ?? Array.from(new Set([...manifestKeys ?? Object.keys(envVars), ...localKeys]));
|
|
1072
|
+
const keys = declaredKeys ?? Array.from(/* @__PURE__ */ new Set([...manifestKeys ?? Object.keys(envVars), ...localKeys]));
|
|
1075
1073
|
const secrets = {};
|
|
1076
1074
|
for (const key of keys) {
|
|
1077
1075
|
if (CloudflareAdapter.EXCLUDED_SECRET_KEYS.has(key)) continue;
|
|
@@ -1672,37 +1670,37 @@ function computeSecretsHash(secrets) {
|
|
|
1672
1670
|
}
|
|
1673
1671
|
//#endregion
|
|
1674
1672
|
//#region ../../src/cli/platform-lib/schemas/vercel.ts
|
|
1675
|
-
const vercelProjectSchema =
|
|
1676
|
-
id:
|
|
1677
|
-
name:
|
|
1678
|
-
accountId:
|
|
1673
|
+
const vercelProjectSchema = z.object({
|
|
1674
|
+
id: z.string(),
|
|
1675
|
+
name: z.string(),
|
|
1676
|
+
accountId: z.string()
|
|
1679
1677
|
});
|
|
1680
|
-
const createProjectBodySchema =
|
|
1681
|
-
name:
|
|
1682
|
-
framework:
|
|
1678
|
+
const createProjectBodySchema = z.object({
|
|
1679
|
+
name: z.string(),
|
|
1680
|
+
framework: z.null().optional()
|
|
1683
1681
|
});
|
|
1684
|
-
const vercelDeploymentSchema =
|
|
1685
|
-
uid:
|
|
1686
|
-
name:
|
|
1687
|
-
url:
|
|
1688
|
-
state:
|
|
1689
|
-
readyState:
|
|
1690
|
-
created:
|
|
1691
|
-
target:
|
|
1692
|
-
alias:
|
|
1682
|
+
const vercelDeploymentSchema = z.object({
|
|
1683
|
+
uid: z.string(),
|
|
1684
|
+
name: z.string(),
|
|
1685
|
+
url: z.string(),
|
|
1686
|
+
state: z.string().optional(),
|
|
1687
|
+
readyState: z.string().optional(),
|
|
1688
|
+
created: z.number().optional(),
|
|
1689
|
+
target: z.string().optional(),
|
|
1690
|
+
alias: z.array(z.string()).optional()
|
|
1693
1691
|
});
|
|
1694
|
-
const vercelEnvVarSchema =
|
|
1695
|
-
id:
|
|
1696
|
-
key:
|
|
1697
|
-
value:
|
|
1698
|
-
type:
|
|
1699
|
-
target:
|
|
1692
|
+
const vercelEnvVarSchema = z.object({
|
|
1693
|
+
id: z.string(),
|
|
1694
|
+
key: z.string(),
|
|
1695
|
+
value: z.string().optional(),
|
|
1696
|
+
type: z.string(),
|
|
1697
|
+
target: z.array(z.string())
|
|
1700
1698
|
});
|
|
1701
|
-
const createEnvVarBodySchema =
|
|
1702
|
-
key:
|
|
1703
|
-
value:
|
|
1704
|
-
type:
|
|
1705
|
-
target:
|
|
1699
|
+
const createEnvVarBodySchema = z.object({
|
|
1700
|
+
key: z.string(),
|
|
1701
|
+
value: z.string(),
|
|
1702
|
+
type: z.string(),
|
|
1703
|
+
target: z.array(z.string())
|
|
1706
1704
|
});
|
|
1707
1705
|
//#endregion
|
|
1708
1706
|
//#region ../../src/cli/platform-lib/services/VercelCli.ts
|
|
@@ -1718,29 +1716,19 @@ var VercelCli = class {
|
|
|
1718
1716
|
fs = $inject(FileSystemProvider);
|
|
1719
1717
|
utils = $inject(AlephaCliUtils);
|
|
1720
1718
|
pm = $inject(PackageManagerUtils);
|
|
1721
|
-
runner = $inject(Runner);
|
|
1722
1719
|
async runShell(command, options = {}) {
|
|
1723
|
-
const
|
|
1724
|
-
|
|
1725
|
-
...options,
|
|
1726
|
-
capture: capture ?? this.runner.useDynamicLogger
|
|
1727
|
-
});
|
|
1728
|
-
if (capture && !this.runner.useDynamicLogger) this.log.info(output);
|
|
1720
|
+
const output = await this.shell.run(command, options);
|
|
1721
|
+
if (options.capture) this.log.info(output);
|
|
1729
1722
|
return output;
|
|
1730
1723
|
}
|
|
1731
1724
|
/**
|
|
1732
1725
|
* Ensure vercel CLI is installed in the project.
|
|
1733
1726
|
*/
|
|
1734
|
-
async ensureInstalled(root
|
|
1727
|
+
async ensureInstalled(root) {
|
|
1735
1728
|
await this.pm.ensureDependency(root, "vercel", {
|
|
1736
1729
|
dev: true,
|
|
1737
1730
|
exec: async (cmd, opts) => {
|
|
1738
|
-
|
|
1739
|
-
try {
|
|
1740
|
-
await this.utils.exec(cmd, opts);
|
|
1741
|
-
} finally {
|
|
1742
|
-
run.resume();
|
|
1743
|
-
}
|
|
1731
|
+
await this.utils.exec(cmd, opts);
|
|
1744
1732
|
}
|
|
1745
1733
|
});
|
|
1746
1734
|
}
|
|
@@ -1827,7 +1815,7 @@ var VercelApi = class VercelApi {
|
|
|
1827
1815
|
return this.token;
|
|
1828
1816
|
}
|
|
1829
1817
|
async listProjects() {
|
|
1830
|
-
return (await this.fetch("/v10/projects", { schema:
|
|
1818
|
+
return (await this.fetch("/v10/projects", { schema: z.object({ projects: z.array(vercelProjectSchema) }) })).projects;
|
|
1831
1819
|
}
|
|
1832
1820
|
async getProject(nameOrId) {
|
|
1833
1821
|
try {
|
|
@@ -1862,13 +1850,13 @@ var VercelApi = class VercelApi {
|
|
|
1862
1850
|
if (options?.target) query.target = options.target;
|
|
1863
1851
|
return (await this.fetch("/v6/deployments", {
|
|
1864
1852
|
query,
|
|
1865
|
-
schema:
|
|
1853
|
+
schema: z.object({ deployments: z.array(vercelDeploymentSchema) })
|
|
1866
1854
|
})).deployments;
|
|
1867
1855
|
}
|
|
1868
1856
|
async listEnvVars(projectId) {
|
|
1869
1857
|
return (await this.fetch(`/v10/projects/${encodeURIComponent(projectId)}/env`, {
|
|
1870
1858
|
query: { decrypt: "true" },
|
|
1871
|
-
schema:
|
|
1859
|
+
schema: z.object({ envs: z.array(vercelEnvVarSchema) })
|
|
1872
1860
|
})).envs;
|
|
1873
1861
|
}
|
|
1874
1862
|
async upsertEnvVars(projectId, vars) {
|
|
@@ -1934,26 +1922,21 @@ var VercelAdapter = class VercelAdapter extends PlatformAdapter {
|
|
|
1934
1922
|
envUtils = $inject(EnvUtils);
|
|
1935
1923
|
api = $inject(VercelApi);
|
|
1936
1924
|
vercelCli = $inject(VercelCli);
|
|
1937
|
-
runner = $inject(Runner);
|
|
1938
1925
|
/**
|
|
1939
1926
|
* Vars that should not be pushed as env vars.
|
|
1940
1927
|
* These are either handled by the build or are internal.
|
|
1941
1928
|
*/
|
|
1942
|
-
static EXCLUDED_SECRET_KEYS = new Set(["NODE_ENV"]);
|
|
1929
|
+
static EXCLUDED_SECRET_KEYS = /* @__PURE__ */ new Set(["NODE_ENV"]);
|
|
1943
1930
|
async runShell(command, options = {}) {
|
|
1944
|
-
const
|
|
1945
|
-
|
|
1946
|
-
...options,
|
|
1947
|
-
capture: capture ?? this.runner.useDynamicLogger
|
|
1948
|
-
});
|
|
1949
|
-
if (capture && !this.runner.useDynamicLogger) this.log.info(output);
|
|
1931
|
+
const output = await this.shell.run(command, options);
|
|
1932
|
+
if (options.capture) this.log.info(output);
|
|
1950
1933
|
return output;
|
|
1951
1934
|
}
|
|
1952
1935
|
async authenticate(ctx, run) {
|
|
1953
1936
|
await run({
|
|
1954
1937
|
name: "authenticate",
|
|
1955
1938
|
handler: async () => {
|
|
1956
|
-
await this.vercelCli.ensureInstalled(ctx.root
|
|
1939
|
+
await this.vercelCli.ensureInstalled(ctx.root);
|
|
1957
1940
|
let needsLogin = false;
|
|
1958
1941
|
try {
|
|
1959
1942
|
await this.vercelCli.getAuthToken();
|
|
@@ -1961,11 +1944,7 @@ var VercelAdapter = class VercelAdapter extends PlatformAdapter {
|
|
|
1961
1944
|
} catch {
|
|
1962
1945
|
needsLogin = true;
|
|
1963
1946
|
}
|
|
1964
|
-
if (needsLogin)
|
|
1965
|
-
run.pause();
|
|
1966
|
-
await this.vercelCli.login();
|
|
1967
|
-
run.resume();
|
|
1968
|
-
}
|
|
1947
|
+
if (needsLogin) await this.vercelCli.login();
|
|
1969
1948
|
if (await this.cache.isLoginFresh(ctx.root, "vercel")) return;
|
|
1970
1949
|
await this.cache.recordLogin(ctx.root, "vercel");
|
|
1971
1950
|
}
|
|
@@ -2516,7 +2495,7 @@ var PlatformOrchestrator = class {
|
|
|
2516
2495
|
* secret names starting with GITHUB_.
|
|
2517
2496
|
*/
|
|
2518
2497
|
var SecretFilterService = class SecretFilterService {
|
|
2519
|
-
static EXCLUDED_KEYS = new Set(["NODE_ENV"]);
|
|
2498
|
+
static EXCLUDED_KEYS = /* @__PURE__ */ new Set(["NODE_ENV"]);
|
|
2520
2499
|
static GITHUB_PREFIX = "GITHUB_";
|
|
2521
2500
|
static REMOTE_PREFIX = "APP_GITHUB_";
|
|
2522
2501
|
/**
|
|
@@ -2560,65 +2539,65 @@ var SecretFilterService = class SecretFilterService {
|
|
|
2560
2539
|
var SecretStoreProvider = class {};
|
|
2561
2540
|
//#endregion
|
|
2562
2541
|
//#region ../../src/cli/platform-lib/schemas/platform.ts
|
|
2563
|
-
const platformStatusWorkerSchema =
|
|
2564
|
-
name:
|
|
2565
|
-
exists:
|
|
2566
|
-
id:
|
|
2567
|
-
detail:
|
|
2568
|
-
version:
|
|
2569
|
-
tag:
|
|
2570
|
-
createdAt:
|
|
2542
|
+
const platformStatusWorkerSchema = z.object({
|
|
2543
|
+
name: z.string(),
|
|
2544
|
+
exists: z.boolean(),
|
|
2545
|
+
id: z.string().optional(),
|
|
2546
|
+
detail: z.string().optional(),
|
|
2547
|
+
version: z.string().optional(),
|
|
2548
|
+
tag: z.string().optional(),
|
|
2549
|
+
createdAt: z.string().optional()
|
|
2571
2550
|
});
|
|
2572
|
-
const platformStatusResourceSchema =
|
|
2573
|
-
name:
|
|
2574
|
-
exists:
|
|
2575
|
-
id:
|
|
2576
|
-
detail:
|
|
2551
|
+
const platformStatusResourceSchema = z.object({
|
|
2552
|
+
name: z.string(),
|
|
2553
|
+
exists: z.boolean(),
|
|
2554
|
+
id: z.string().optional(),
|
|
2555
|
+
detail: z.string().optional()
|
|
2577
2556
|
});
|
|
2578
|
-
const platformStatusSecretSchema =
|
|
2579
|
-
name:
|
|
2580
|
-
deployed:
|
|
2557
|
+
const platformStatusSecretSchema = z.object({
|
|
2558
|
+
name: z.string(),
|
|
2559
|
+
deployed: z.boolean()
|
|
2581
2560
|
});
|
|
2582
|
-
const platformStatusSchema =
|
|
2583
|
-
project:
|
|
2584
|
-
env:
|
|
2585
|
-
adapter:
|
|
2586
|
-
workers:
|
|
2587
|
-
databases:
|
|
2588
|
-
buckets:
|
|
2589
|
-
kvNamespaces:
|
|
2590
|
-
queues:
|
|
2591
|
-
secrets:
|
|
2561
|
+
const platformStatusSchema = z.object({
|
|
2562
|
+
project: z.string(),
|
|
2563
|
+
env: z.string(),
|
|
2564
|
+
adapter: z.string(),
|
|
2565
|
+
workers: z.array(platformStatusWorkerSchema),
|
|
2566
|
+
databases: z.array(platformStatusResourceSchema),
|
|
2567
|
+
buckets: z.array(platformStatusResourceSchema),
|
|
2568
|
+
kvNamespaces: z.array(platformStatusResourceSchema),
|
|
2569
|
+
queues: z.array(platformStatusResourceSchema),
|
|
2570
|
+
secrets: z.array(platformStatusSecretSchema)
|
|
2592
2571
|
});
|
|
2593
|
-
const platformPlanAppResourcesSchema =
|
|
2594
|
-
hasDatabase:
|
|
2595
|
-
hasBucket:
|
|
2596
|
-
hasKV:
|
|
2597
|
-
hasQueue:
|
|
2598
|
-
hasCron:
|
|
2572
|
+
const platformPlanAppResourcesSchema = z.object({
|
|
2573
|
+
hasDatabase: z.boolean(),
|
|
2574
|
+
hasBucket: z.boolean(),
|
|
2575
|
+
hasKV: z.boolean(),
|
|
2576
|
+
hasQueue: z.boolean(),
|
|
2577
|
+
hasCron: z.boolean()
|
|
2599
2578
|
});
|
|
2600
|
-
const platformPlanAppSchema =
|
|
2601
|
-
name:
|
|
2602
|
-
path:
|
|
2579
|
+
const platformPlanAppSchema = z.object({
|
|
2580
|
+
name: z.string(),
|
|
2581
|
+
path: z.string(),
|
|
2603
2582
|
resources: platformPlanAppResourcesSchema
|
|
2604
2583
|
});
|
|
2605
|
-
const platformPlanEnvironmentSchema =
|
|
2606
|
-
adapter:
|
|
2607
|
-
domain:
|
|
2608
|
-
zone:
|
|
2584
|
+
const platformPlanEnvironmentSchema = z.object({
|
|
2585
|
+
adapter: z.string(),
|
|
2586
|
+
domain: z.string().optional(),
|
|
2587
|
+
zone: z.string().optional()
|
|
2609
2588
|
});
|
|
2610
|
-
const platformPlanResourceSchema =
|
|
2611
|
-
label:
|
|
2612
|
-
value:
|
|
2589
|
+
const platformPlanResourceSchema = z.object({
|
|
2590
|
+
label: z.string(),
|
|
2591
|
+
value: z.string()
|
|
2613
2592
|
});
|
|
2614
|
-
const platformPlanSchema =
|
|
2615
|
-
project:
|
|
2616
|
-
env:
|
|
2617
|
-
mode:
|
|
2618
|
-
apps:
|
|
2619
|
-
environments:
|
|
2620
|
-
resources:
|
|
2621
|
-
secretCount:
|
|
2593
|
+
const platformPlanSchema = z.object({
|
|
2594
|
+
project: z.string(),
|
|
2595
|
+
env: z.string(),
|
|
2596
|
+
mode: z.enum(["monorepo", "standalone"]),
|
|
2597
|
+
apps: z.array(platformPlanAppSchema),
|
|
2598
|
+
environments: z.record(z.string(), platformPlanEnvironmentSchema),
|
|
2599
|
+
resources: z.array(platformPlanResourceSchema),
|
|
2600
|
+
secretCount: z.number()
|
|
2622
2601
|
});
|
|
2623
2602
|
//#endregion
|
|
2624
2603
|
//#region ../../src/cli/platform-lib/index.ts
|