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 { Alepha,
|
|
1
|
+
import { Alepha, z } from "alepha";
|
|
2
2
|
import { describe, expect, it } from "vitest";
|
|
3
3
|
import { $command } from "../primitives/$command.ts";
|
|
4
4
|
import { CliProvider } from "../providers/CliProvider.ts";
|
|
@@ -30,19 +30,12 @@ class TestCliProvider extends CliProvider {
|
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Extract flag definitions from a command's flags schema (for testing printHelp logic).
|
|
33
|
+
*
|
|
34
|
+
* Delegates to the real `extractFlagDefs`, which reads aliases/description from
|
|
35
|
+
* the schema's `.meta()` registry (zod) — under typebox these were direct
|
|
36
|
+
* schema properties, but strict-zod stores them in metadata.
|
|
33
37
|
*/
|
|
34
|
-
public testExtractFlagDefs(
|
|
35
|
-
return Object.entries(flagsSchema.properties).map(([key, value]) => ({
|
|
36
|
-
key,
|
|
37
|
-
schema: value,
|
|
38
|
-
aliases: [
|
|
39
|
-
key,
|
|
40
|
-
...((value as any).aliases ??
|
|
41
|
-
((value as any).alias ? [(value as any).alias] : [])),
|
|
42
|
-
],
|
|
43
|
-
description: (value as any).description,
|
|
44
|
-
}));
|
|
45
|
-
}
|
|
38
|
+
public testExtractFlagDefs = this.extractFlagDefs.bind(this);
|
|
46
39
|
|
|
47
40
|
/**
|
|
48
41
|
* Format aliases array into flag string (e.g., "-t, --target").
|
|
@@ -71,7 +64,7 @@ describe("CliProvider", () => {
|
|
|
71
64
|
it("should parse boolean flags", () => {
|
|
72
65
|
const cli = createTestCli();
|
|
73
66
|
const flagDefs = [
|
|
74
|
-
{ key: "verbose", aliases: ["v", "verbose"], schema:
|
|
67
|
+
{ key: "verbose", aliases: ["v", "verbose"], schema: z.boolean() },
|
|
75
68
|
];
|
|
76
69
|
|
|
77
70
|
const result = cli.testParseFlags(["--verbose"], flagDefs);
|
|
@@ -81,7 +74,7 @@ describe("CliProvider", () => {
|
|
|
81
74
|
it("should parse short boolean flags", () => {
|
|
82
75
|
const cli = createTestCli();
|
|
83
76
|
const flagDefs = [
|
|
84
|
-
{ key: "verbose", aliases: ["v", "verbose"], schema:
|
|
77
|
+
{ key: "verbose", aliases: ["v", "verbose"], schema: z.boolean() },
|
|
85
78
|
];
|
|
86
79
|
|
|
87
80
|
const result = cli.testParseFlags(["-v"], flagDefs);
|
|
@@ -91,7 +84,7 @@ describe("CliProvider", () => {
|
|
|
91
84
|
it("should parse string flags with = syntax", () => {
|
|
92
85
|
const cli = createTestCli();
|
|
93
86
|
const flagDefs = [
|
|
94
|
-
{ key: "name", aliases: ["n", "name"], schema:
|
|
87
|
+
{ key: "name", aliases: ["n", "name"], schema: z.string() },
|
|
95
88
|
];
|
|
96
89
|
|
|
97
90
|
const result = cli.testParseFlags(["--name=hello"], flagDefs);
|
|
@@ -101,7 +94,7 @@ describe("CliProvider", () => {
|
|
|
101
94
|
it("should parse string flags with space syntax", () => {
|
|
102
95
|
const cli = createTestCli();
|
|
103
96
|
const flagDefs = [
|
|
104
|
-
{ key: "name", aliases: ["n", "name"], schema:
|
|
97
|
+
{ key: "name", aliases: ["n", "name"], schema: z.string() },
|
|
105
98
|
];
|
|
106
99
|
|
|
107
100
|
const result = cli.testParseFlags(["--name", "hello"], flagDefs);
|
|
@@ -111,7 +104,7 @@ describe("CliProvider", () => {
|
|
|
111
104
|
it("should parse JSON object flags", () => {
|
|
112
105
|
const cli = createTestCli();
|
|
113
106
|
const flagDefs = [
|
|
114
|
-
{ key: "config", aliases: ["config"], schema:
|
|
107
|
+
{ key: "config", aliases: ["config"], schema: z.object({}) },
|
|
115
108
|
];
|
|
116
109
|
|
|
117
110
|
const result = cli.testParseFlags(
|
|
@@ -124,7 +117,7 @@ describe("CliProvider", () => {
|
|
|
124
117
|
it("should parse JSON array flags", () => {
|
|
125
118
|
const cli = createTestCli();
|
|
126
119
|
const flagDefs = [
|
|
127
|
-
{ key: "items", aliases: ["items"], schema:
|
|
120
|
+
{ key: "items", aliases: ["items"], schema: z.array(z.string()) },
|
|
128
121
|
];
|
|
129
122
|
|
|
130
123
|
const result = cli.testParseFlags(["--items", '["a","b"]'], flagDefs);
|
|
@@ -134,7 +127,7 @@ describe("CliProvider", () => {
|
|
|
134
127
|
it("should throw on unknown flags", () => {
|
|
135
128
|
const cli = createTestCli();
|
|
136
129
|
const flagDefs = [
|
|
137
|
-
{ key: "known", aliases: ["known"], schema:
|
|
130
|
+
{ key: "known", aliases: ["known"], schema: z.boolean() },
|
|
138
131
|
];
|
|
139
132
|
|
|
140
133
|
expect(() =>
|
|
@@ -144,7 +137,7 @@ describe("CliProvider", () => {
|
|
|
144
137
|
|
|
145
138
|
it("should throw on missing required value", () => {
|
|
146
139
|
const cli = createTestCli();
|
|
147
|
-
const flagDefs = [{ key: "name", aliases: ["name"], schema:
|
|
140
|
+
const flagDefs = [{ key: "name", aliases: ["name"], schema: z.string() }];
|
|
148
141
|
|
|
149
142
|
expect(() => cli.testParseFlags(["--name"], flagDefs)).toThrow(
|
|
150
143
|
"requires a value",
|
|
@@ -154,7 +147,7 @@ describe("CliProvider", () => {
|
|
|
154
147
|
it("should throw on invalid JSON", () => {
|
|
155
148
|
const cli = createTestCli();
|
|
156
149
|
const flagDefs = [
|
|
157
|
-
{ key: "config", aliases: ["config"], schema:
|
|
150
|
+
{ key: "config", aliases: ["config"], schema: z.object({}) },
|
|
158
151
|
];
|
|
159
152
|
|
|
160
153
|
expect(() =>
|
|
@@ -168,7 +161,7 @@ describe("CliProvider", () => {
|
|
|
168
161
|
{
|
|
169
162
|
key: "image",
|
|
170
163
|
aliases: ["i", "image"],
|
|
171
|
-
schema:
|
|
164
|
+
schema: z.union([z.boolean(), z.text()]),
|
|
172
165
|
},
|
|
173
166
|
];
|
|
174
167
|
|
|
@@ -182,7 +175,7 @@ describe("CliProvider", () => {
|
|
|
182
175
|
{
|
|
183
176
|
key: "image",
|
|
184
177
|
aliases: ["i", "image"],
|
|
185
|
-
schema:
|
|
178
|
+
schema: z.union([z.boolean(), z.text()]),
|
|
186
179
|
},
|
|
187
180
|
];
|
|
188
181
|
|
|
@@ -196,7 +189,7 @@ describe("CliProvider", () => {
|
|
|
196
189
|
{
|
|
197
190
|
key: "image",
|
|
198
191
|
aliases: ["i", "image"],
|
|
199
|
-
schema:
|
|
192
|
+
schema: z.union([z.boolean(), z.text()]),
|
|
200
193
|
},
|
|
201
194
|
];
|
|
202
195
|
|
|
@@ -210,9 +203,9 @@ describe("CliProvider", () => {
|
|
|
210
203
|
{
|
|
211
204
|
key: "image",
|
|
212
205
|
aliases: ["i", "image"],
|
|
213
|
-
schema:
|
|
206
|
+
schema: z.union([z.boolean(), z.text()]),
|
|
214
207
|
},
|
|
215
|
-
{ key: "verbose", aliases: ["v", "verbose"], schema:
|
|
208
|
+
{ key: "verbose", aliases: ["v", "verbose"], schema: z.boolean() },
|
|
216
209
|
];
|
|
217
210
|
|
|
218
211
|
const result = cli.testParseFlags(["-i", "-v"], flagDefs);
|
|
@@ -226,7 +219,7 @@ describe("CliProvider", () => {
|
|
|
226
219
|
{
|
|
227
220
|
key: "image",
|
|
228
221
|
aliases: ["i", "image"],
|
|
229
|
-
schema:
|
|
222
|
+
schema: z.union([z.boolean(), z.text()]),
|
|
230
223
|
},
|
|
231
224
|
];
|
|
232
225
|
|
|
@@ -240,9 +233,9 @@ describe("CliProvider", () => {
|
|
|
240
233
|
{
|
|
241
234
|
key: "image",
|
|
242
235
|
aliases: ["i", "image"],
|
|
243
|
-
schema:
|
|
236
|
+
schema: z.union([z.boolean(), z.text()]),
|
|
244
237
|
},
|
|
245
|
-
{ key: "verbose", aliases: ["v", "verbose"], schema:
|
|
238
|
+
{ key: "verbose", aliases: ["v", "verbose"], schema: z.boolean() },
|
|
246
239
|
];
|
|
247
240
|
|
|
248
241
|
const result = cli.testParseFlags(["-v", "-i"], flagDefs);
|
|
@@ -256,7 +249,7 @@ describe("CliProvider", () => {
|
|
|
256
249
|
{
|
|
257
250
|
key: "image",
|
|
258
251
|
aliases: ["i", "image"],
|
|
259
|
-
schema:
|
|
252
|
+
schema: z.union([z.boolean(), z.text()]),
|
|
260
253
|
},
|
|
261
254
|
];
|
|
262
255
|
|
|
@@ -273,7 +266,7 @@ describe("CliProvider", () => {
|
|
|
273
266
|
{
|
|
274
267
|
key: "image",
|
|
275
268
|
aliases: ["i", "image"],
|
|
276
|
-
schema:
|
|
269
|
+
schema: z.union([z.boolean(), z.text()]),
|
|
277
270
|
},
|
|
278
271
|
];
|
|
279
272
|
|
|
@@ -292,49 +285,49 @@ describe("CliProvider", () => {
|
|
|
292
285
|
describe("parseArgumentValue", () => {
|
|
293
286
|
it("should parse string values", () => {
|
|
294
287
|
const cli = createTestCli();
|
|
295
|
-
expect(cli.testParseArgumentValue("hello",
|
|
288
|
+
expect(cli.testParseArgumentValue("hello", z.string())).toBe("hello");
|
|
296
289
|
});
|
|
297
290
|
|
|
298
291
|
it("should parse number values", () => {
|
|
299
292
|
const cli = createTestCli();
|
|
300
|
-
expect(cli.testParseArgumentValue("42",
|
|
301
|
-
expect(cli.testParseArgumentValue("3.14",
|
|
293
|
+
expect(cli.testParseArgumentValue("42", z.number())).toBe(42);
|
|
294
|
+
expect(cli.testParseArgumentValue("3.14", z.number())).toBe(3.14);
|
|
302
295
|
});
|
|
303
296
|
|
|
304
297
|
it("should throw on invalid number", () => {
|
|
305
298
|
const cli = createTestCli();
|
|
306
|
-
expect(() => cli.testParseArgumentValue("abc",
|
|
299
|
+
expect(() => cli.testParseArgumentValue("abc", z.number())).toThrow(
|
|
307
300
|
"Expected number",
|
|
308
301
|
);
|
|
309
302
|
});
|
|
310
303
|
|
|
311
304
|
it("should parse integer values", () => {
|
|
312
305
|
const cli = createTestCli();
|
|
313
|
-
expect(cli.testParseArgumentValue("42",
|
|
306
|
+
expect(cli.testParseArgumentValue("42", z.integer())).toBe(42);
|
|
314
307
|
});
|
|
315
308
|
|
|
316
309
|
it("should throw on non-integer for integer schema", () => {
|
|
317
310
|
const cli = createTestCli();
|
|
318
|
-
expect(() => cli.testParseArgumentValue("3.14",
|
|
311
|
+
expect(() => cli.testParseArgumentValue("3.14", z.integer())).toThrow(
|
|
319
312
|
"Expected integer",
|
|
320
313
|
);
|
|
321
314
|
});
|
|
322
315
|
|
|
323
316
|
it("should parse boolean true values", () => {
|
|
324
317
|
const cli = createTestCli();
|
|
325
|
-
expect(cli.testParseArgumentValue("true",
|
|
326
|
-
expect(cli.testParseArgumentValue("1",
|
|
318
|
+
expect(cli.testParseArgumentValue("true", z.boolean())).toBe(true);
|
|
319
|
+
expect(cli.testParseArgumentValue("1", z.boolean())).toBe(true);
|
|
327
320
|
});
|
|
328
321
|
|
|
329
322
|
it("should parse boolean false values", () => {
|
|
330
323
|
const cli = createTestCli();
|
|
331
|
-
expect(cli.testParseArgumentValue("false",
|
|
332
|
-
expect(cli.testParseArgumentValue("0",
|
|
324
|
+
expect(cli.testParseArgumentValue("false", z.boolean())).toBe(false);
|
|
325
|
+
expect(cli.testParseArgumentValue("0", z.boolean())).toBe(false);
|
|
333
326
|
});
|
|
334
327
|
|
|
335
328
|
it("should throw on invalid boolean", () => {
|
|
336
329
|
const cli = createTestCli();
|
|
337
|
-
expect(() => cli.testParseArgumentValue("yes",
|
|
330
|
+
expect(() => cli.testParseArgumentValue("yes", z.boolean())).toThrow(
|
|
338
331
|
"Expected boolean",
|
|
339
332
|
);
|
|
340
333
|
});
|
|
@@ -354,25 +347,25 @@ describe("CliProvider", () => {
|
|
|
354
347
|
|
|
355
348
|
it("should parse optional args when present", () => {
|
|
356
349
|
const cli = createTestCli();
|
|
357
|
-
const schema =
|
|
350
|
+
const schema = z.string().optional();
|
|
358
351
|
expect(cli.testParseCommandArgs(["hello"], schema, true)).toBe("hello");
|
|
359
352
|
});
|
|
360
353
|
|
|
361
354
|
it("should return undefined for optional args when missing", () => {
|
|
362
355
|
const cli = createTestCli();
|
|
363
|
-
const schema =
|
|
356
|
+
const schema = z.string().optional();
|
|
364
357
|
expect(cli.testParseCommandArgs([], schema, true)).toBeUndefined();
|
|
365
358
|
});
|
|
366
359
|
|
|
367
360
|
it("should parse required args", () => {
|
|
368
361
|
const cli = createTestCli();
|
|
369
|
-
const schema =
|
|
362
|
+
const schema = z.string();
|
|
370
363
|
expect(cli.testParseCommandArgs(["hello"], schema, true)).toBe("hello");
|
|
371
364
|
});
|
|
372
365
|
|
|
373
366
|
it("should throw on missing required args", () => {
|
|
374
367
|
const cli = createTestCli();
|
|
375
|
-
const schema =
|
|
368
|
+
const schema = z.string();
|
|
376
369
|
expect(() => cli.testParseCommandArgs([], schema, true)).toThrow(
|
|
377
370
|
"Missing required argument",
|
|
378
371
|
);
|
|
@@ -380,22 +373,22 @@ describe("CliProvider", () => {
|
|
|
380
373
|
|
|
381
374
|
it("should parse tuple args", () => {
|
|
382
375
|
const cli = createTestCli();
|
|
383
|
-
const schema =
|
|
376
|
+
const schema = z.tuple([z.string(), z.number()]);
|
|
384
377
|
const result = cli.testParseCommandArgs(["hello", "42"], schema, true);
|
|
385
378
|
expect(result).toEqual(["hello", 42]);
|
|
386
379
|
});
|
|
387
380
|
|
|
388
381
|
it("should handle optional tuple items", () => {
|
|
389
382
|
const cli = createTestCli();
|
|
390
|
-
const schema =
|
|
383
|
+
const schema = z.tuple([z.string(), z.number().optional()]);
|
|
391
384
|
const result = cli.testParseCommandArgs(["hello"], schema, true);
|
|
392
385
|
expect(result).toEqual(["hello", undefined]);
|
|
393
386
|
});
|
|
394
387
|
|
|
395
388
|
it("should skip flags when parsing args", () => {
|
|
396
389
|
const cli = createTestCli();
|
|
397
|
-
const schema =
|
|
398
|
-
const flags =
|
|
390
|
+
const schema = z.string();
|
|
391
|
+
const flags = z.object({ verbose: z.boolean().optional() });
|
|
399
392
|
const result = cli.testParseCommandArgs(
|
|
400
393
|
["--verbose", "hello"],
|
|
401
394
|
schema,
|
|
@@ -407,8 +400,8 @@ describe("CliProvider", () => {
|
|
|
407
400
|
|
|
408
401
|
it("should skip flag values when parsing args", () => {
|
|
409
402
|
const cli = createTestCli();
|
|
410
|
-
const schema =
|
|
411
|
-
const flags =
|
|
403
|
+
const schema = z.string();
|
|
404
|
+
const flags = z.object({ name: z.string().optional() });
|
|
412
405
|
const result = cli.testParseCommandArgs(
|
|
413
406
|
["--name", "ignored", "actual"],
|
|
414
407
|
schema,
|
|
@@ -482,7 +475,7 @@ describe("CliProvider", () => {
|
|
|
482
475
|
class TestCommands {
|
|
483
476
|
build = $command({
|
|
484
477
|
name: "build",
|
|
485
|
-
flags:
|
|
478
|
+
flags: z.object({}),
|
|
486
479
|
handler: async () => {},
|
|
487
480
|
});
|
|
488
481
|
}
|
|
@@ -499,7 +492,7 @@ describe("CliProvider", () => {
|
|
|
499
492
|
class TestCommands {
|
|
500
493
|
deployVercel = $command({
|
|
501
494
|
name: "deploy:vercel",
|
|
502
|
-
flags:
|
|
495
|
+
flags: z.object({}),
|
|
503
496
|
handler: async () => {},
|
|
504
497
|
});
|
|
505
498
|
}
|
|
@@ -561,7 +554,7 @@ describe("CliProvider", () => {
|
|
|
561
554
|
it("should mark flag indices as consumed", () => {
|
|
562
555
|
const cli = createTestCli();
|
|
563
556
|
const flagDefs = [
|
|
564
|
-
{ key: "verbose", aliases: ["v", "verbose"], schema:
|
|
557
|
+
{ key: "verbose", aliases: ["v", "verbose"], schema: z.boolean() },
|
|
565
558
|
];
|
|
566
559
|
|
|
567
560
|
const result = cli.testGetFlagConsumedIndices(["--verbose"], flagDefs);
|
|
@@ -570,7 +563,7 @@ describe("CliProvider", () => {
|
|
|
570
563
|
|
|
571
564
|
it("should mark flag value indices as consumed", () => {
|
|
572
565
|
const cli = createTestCli();
|
|
573
|
-
const flagDefs = [{ key: "name", aliases: ["name"], schema:
|
|
566
|
+
const flagDefs = [{ key: "name", aliases: ["name"], schema: z.string() }];
|
|
574
567
|
|
|
575
568
|
const result = cli.testGetFlagConsumedIndices(
|
|
576
569
|
["--name", "value", "arg"],
|
|
@@ -583,7 +576,7 @@ describe("CliProvider", () => {
|
|
|
583
576
|
|
|
584
577
|
it("should not consume next arg for --flag=value syntax", () => {
|
|
585
578
|
const cli = createTestCli();
|
|
586
|
-
const flagDefs = [{ key: "name", aliases: ["name"], schema:
|
|
579
|
+
const flagDefs = [{ key: "name", aliases: ["name"], schema: z.string() }];
|
|
587
580
|
|
|
588
581
|
const result = cli.testGetFlagConsumedIndices(
|
|
589
582
|
["--name=value", "arg"],
|
|
@@ -599,7 +592,7 @@ describe("CliProvider", () => {
|
|
|
599
592
|
{
|
|
600
593
|
key: "image",
|
|
601
594
|
aliases: ["i", "image"],
|
|
602
|
-
schema:
|
|
595
|
+
schema: z.union([z.boolean(), z.text()]),
|
|
603
596
|
},
|
|
604
597
|
];
|
|
605
598
|
|
|
@@ -618,9 +611,9 @@ describe("CliProvider", () => {
|
|
|
618
611
|
{
|
|
619
612
|
key: "image",
|
|
620
613
|
aliases: ["i", "image"],
|
|
621
|
-
schema:
|
|
614
|
+
schema: z.union([z.boolean(), z.text()]),
|
|
622
615
|
},
|
|
623
|
-
{ key: "verbose", aliases: ["v", "verbose"], schema:
|
|
616
|
+
{ key: "verbose", aliases: ["v", "verbose"], schema: z.boolean() },
|
|
624
617
|
];
|
|
625
618
|
|
|
626
619
|
const result = cli.testGetFlagConsumedIndices(["-i", "-v"], flagDefs);
|
|
@@ -634,7 +627,7 @@ describe("CliProvider", () => {
|
|
|
634
627
|
{
|
|
635
628
|
key: "image",
|
|
636
629
|
aliases: ["i", "image"],
|
|
637
|
-
schema:
|
|
630
|
+
schema: z.union([z.boolean(), z.text()]),
|
|
638
631
|
},
|
|
639
632
|
];
|
|
640
633
|
|
|
@@ -656,19 +649,19 @@ describe("CliProvider", () => {
|
|
|
656
649
|
|
|
657
650
|
it("should generate optional arg usage", () => {
|
|
658
651
|
const cli = createTestCli();
|
|
659
|
-
const schema =
|
|
652
|
+
const schema = z.string().meta({ title: "path" }).optional();
|
|
660
653
|
expect(cli.testGenerateArgsUsage(schema)).toBe(" [path]");
|
|
661
654
|
});
|
|
662
655
|
|
|
663
656
|
it("should generate required arg usage", () => {
|
|
664
657
|
const cli = createTestCli();
|
|
665
|
-
const schema =
|
|
658
|
+
const schema = z.string().meta({ title: "path" });
|
|
666
659
|
expect(cli.testGenerateArgsUsage(schema)).toBe(" <path>");
|
|
667
660
|
});
|
|
668
661
|
|
|
669
662
|
it("should generate tuple arg usage", () => {
|
|
670
663
|
const cli = createTestCli();
|
|
671
|
-
const schema =
|
|
664
|
+
const schema = z.tuple([z.string(), z.number().optional()]);
|
|
672
665
|
const result = cli.testGenerateArgsUsage(schema);
|
|
673
666
|
expect(result).toContain("<arg1>");
|
|
674
667
|
expect(result).toContain("[arg2");
|
|
@@ -676,19 +669,19 @@ describe("CliProvider", () => {
|
|
|
676
669
|
|
|
677
670
|
it("should include type for numbers", () => {
|
|
678
671
|
const cli = createTestCli();
|
|
679
|
-
const schema =
|
|
672
|
+
const schema = z.number().meta({ title: "count" });
|
|
680
673
|
expect(cli.testGenerateArgsUsage(schema)).toBe(" <count: number>");
|
|
681
674
|
});
|
|
682
675
|
|
|
683
676
|
it("should include type for integers", () => {
|
|
684
677
|
const cli = createTestCli();
|
|
685
|
-
const schema =
|
|
678
|
+
const schema = z.integer().meta({ title: "port" });
|
|
686
679
|
expect(cli.testGenerateArgsUsage(schema)).toBe(" <port: integer>");
|
|
687
680
|
});
|
|
688
681
|
|
|
689
682
|
it("should include type for booleans", () => {
|
|
690
683
|
const cli = createTestCli();
|
|
691
|
-
const schema =
|
|
684
|
+
const schema = z.boolean().meta({ title: "force" });
|
|
692
685
|
expect(cli.testGenerateArgsUsage(schema)).toBe(" <force: boolean>");
|
|
693
686
|
});
|
|
694
687
|
});
|
|
@@ -700,22 +693,22 @@ describe("CliProvider", () => {
|
|
|
700
693
|
describe("getTypeName", () => {
|
|
701
694
|
it("should return empty for string", () => {
|
|
702
695
|
const cli = createTestCli();
|
|
703
|
-
expect(cli.testGetTypeName(
|
|
696
|
+
expect(cli.testGetTypeName(z.string())).toBe("");
|
|
704
697
|
});
|
|
705
698
|
|
|
706
699
|
it("should return ': number' for number", () => {
|
|
707
700
|
const cli = createTestCli();
|
|
708
|
-
expect(cli.testGetTypeName(
|
|
701
|
+
expect(cli.testGetTypeName(z.number())).toBe(": number");
|
|
709
702
|
});
|
|
710
703
|
|
|
711
704
|
it("should return ': integer' for integer", () => {
|
|
712
705
|
const cli = createTestCli();
|
|
713
|
-
expect(cli.testGetTypeName(
|
|
706
|
+
expect(cli.testGetTypeName(z.integer())).toBe(": integer");
|
|
714
707
|
});
|
|
715
708
|
|
|
716
709
|
it("should return ': boolean' for boolean", () => {
|
|
717
710
|
const cli = createTestCli();
|
|
718
|
-
expect(cli.testGetTypeName(
|
|
711
|
+
expect(cli.testGetTypeName(z.boolean())).toBe(": boolean");
|
|
719
712
|
});
|
|
720
713
|
});
|
|
721
714
|
|
|
@@ -731,21 +724,21 @@ describe("CliProvider", () => {
|
|
|
731
724
|
|
|
732
725
|
it("should generate colored optional arg usage", () => {
|
|
733
726
|
const cli = createTestCli();
|
|
734
|
-
const schema =
|
|
727
|
+
const schema = z.string().meta({ title: "path" }).optional();
|
|
735
728
|
const result = cli.testGenerateColoredArgsUsage(schema);
|
|
736
729
|
expect(result).toContain("[path]");
|
|
737
730
|
});
|
|
738
731
|
|
|
739
732
|
it("should generate colored required arg usage", () => {
|
|
740
733
|
const cli = createTestCli();
|
|
741
|
-
const schema =
|
|
734
|
+
const schema = z.string().meta({ title: "path" });
|
|
742
735
|
const result = cli.testGenerateColoredArgsUsage(schema);
|
|
743
736
|
expect(result).toContain("<path>");
|
|
744
737
|
});
|
|
745
738
|
|
|
746
739
|
it("should generate colored tuple arg usage", () => {
|
|
747
740
|
const cli = createTestCli();
|
|
748
|
-
const schema =
|
|
741
|
+
const schema = z.tuple([z.string(), z.number().optional()]);
|
|
749
742
|
const result = cli.testGenerateColoredArgsUsage(schema);
|
|
750
743
|
expect(result).toContain("<arg1>");
|
|
751
744
|
expect(result).toContain("[arg2");
|
|
@@ -766,7 +759,7 @@ describe("CliProvider", () => {
|
|
|
766
759
|
class TestCommands {
|
|
767
760
|
test = $command({
|
|
768
761
|
name: "test",
|
|
769
|
-
flags:
|
|
762
|
+
flags: z.object({}),
|
|
770
763
|
handler: async () => {},
|
|
771
764
|
});
|
|
772
765
|
}
|
|
@@ -782,7 +775,7 @@ describe("CliProvider", () => {
|
|
|
782
775
|
test = $command({
|
|
783
776
|
name: "test",
|
|
784
777
|
aliases: ["t"],
|
|
785
|
-
flags:
|
|
778
|
+
flags: z.object({}),
|
|
786
779
|
handler: async () => {},
|
|
787
780
|
});
|
|
788
781
|
}
|
|
@@ -808,12 +801,12 @@ describe("CliProvider", () => {
|
|
|
808
801
|
class TestCommands {
|
|
809
802
|
preBuild = $command({
|
|
810
803
|
name: "prebuild",
|
|
811
|
-
flags:
|
|
804
|
+
flags: z.object({}),
|
|
812
805
|
handler: async () => {},
|
|
813
806
|
});
|
|
814
807
|
build = $command({
|
|
815
808
|
name: "build",
|
|
816
|
-
flags:
|
|
809
|
+
flags: z.object({}),
|
|
817
810
|
handler: async () => {},
|
|
818
811
|
});
|
|
819
812
|
}
|
|
@@ -835,12 +828,12 @@ describe("CliProvider", () => {
|
|
|
835
828
|
class TestCommands {
|
|
836
829
|
build = $command({
|
|
837
830
|
name: "build",
|
|
838
|
-
flags:
|
|
831
|
+
flags: z.object({}),
|
|
839
832
|
handler: async () => {},
|
|
840
833
|
});
|
|
841
834
|
postBuild = $command({
|
|
842
835
|
name: "postbuild",
|
|
843
|
-
flags:
|
|
836
|
+
flags: z.object({}),
|
|
844
837
|
handler: async () => {},
|
|
845
838
|
});
|
|
846
839
|
}
|
|
@@ -861,12 +854,12 @@ describe("CliProvider", () => {
|
|
|
861
854
|
class TestCommands {
|
|
862
855
|
build = $command({
|
|
863
856
|
name: "build",
|
|
864
|
-
flags:
|
|
857
|
+
flags: z.object({}),
|
|
865
858
|
handler: async () => {},
|
|
866
859
|
});
|
|
867
860
|
test = $command({
|
|
868
861
|
name: "test",
|
|
869
|
-
flags:
|
|
862
|
+
flags: z.object({}),
|
|
870
863
|
handler: async () => {},
|
|
871
864
|
});
|
|
872
865
|
}
|
|
@@ -882,12 +875,12 @@ describe("CliProvider", () => {
|
|
|
882
875
|
class TestCommands {
|
|
883
876
|
deployVercel = $command({
|
|
884
877
|
name: "vercel",
|
|
885
|
-
flags:
|
|
878
|
+
flags: z.object({}),
|
|
886
879
|
handler: async () => {},
|
|
887
880
|
});
|
|
888
881
|
deploy = $command({
|
|
889
882
|
name: "deploy",
|
|
890
|
-
flags:
|
|
883
|
+
flags: z.object({}),
|
|
891
884
|
children: [this.deployVercel],
|
|
892
885
|
handler: async () => {},
|
|
893
886
|
});
|
|
@@ -911,7 +904,7 @@ describe("CliProvider", () => {
|
|
|
911
904
|
class TestCommands {
|
|
912
905
|
build = $command({
|
|
913
906
|
name: "build",
|
|
914
|
-
flags:
|
|
907
|
+
flags: z.object({}),
|
|
915
908
|
handler: async () => {},
|
|
916
909
|
});
|
|
917
910
|
}
|
|
@@ -927,12 +920,12 @@ describe("CliProvider", () => {
|
|
|
927
920
|
class TestCommands {
|
|
928
921
|
deployVercel = $command({
|
|
929
922
|
name: "vercel",
|
|
930
|
-
flags:
|
|
923
|
+
flags: z.object({}),
|
|
931
924
|
handler: async () => {},
|
|
932
925
|
});
|
|
933
926
|
deploy = $command({
|
|
934
927
|
name: "deploy",
|
|
935
|
-
flags:
|
|
928
|
+
flags: z.object({}),
|
|
936
929
|
children: [this.deployVercel],
|
|
937
930
|
handler: async () => {},
|
|
938
931
|
});
|
|
@@ -955,7 +948,7 @@ describe("CliProvider", () => {
|
|
|
955
948
|
class TestCommands {
|
|
956
949
|
build = $command({
|
|
957
950
|
name: "build",
|
|
958
|
-
flags:
|
|
951
|
+
flags: z.object({}),
|
|
959
952
|
handler: async () => {},
|
|
960
953
|
});
|
|
961
954
|
}
|
|
@@ -971,12 +964,12 @@ describe("CliProvider", () => {
|
|
|
971
964
|
class TestCommands {
|
|
972
965
|
deployVercel = $command({
|
|
973
966
|
name: "vercel",
|
|
974
|
-
flags:
|
|
967
|
+
flags: z.object({}),
|
|
975
968
|
handler: async () => {},
|
|
976
969
|
});
|
|
977
970
|
deploy = $command({
|
|
978
971
|
name: "deploy",
|
|
979
|
-
flags:
|
|
972
|
+
flags: z.object({}),
|
|
980
973
|
children: [this.deployVercel],
|
|
981
974
|
handler: async () => {},
|
|
982
975
|
});
|
|
@@ -1000,7 +993,7 @@ describe("CliProvider", () => {
|
|
|
1000
993
|
build = $command({
|
|
1001
994
|
name: "build",
|
|
1002
995
|
description: "Build the project",
|
|
1003
|
-
flags:
|
|
996
|
+
flags: z.object({}),
|
|
1004
997
|
handler: async () => {},
|
|
1005
998
|
});
|
|
1006
999
|
}
|
|
@@ -1017,8 +1010,8 @@ describe("CliProvider", () => {
|
|
|
1017
1010
|
build = $command({
|
|
1018
1011
|
name: "build",
|
|
1019
1012
|
description: "Build the project",
|
|
1020
|
-
flags:
|
|
1021
|
-
watch:
|
|
1013
|
+
flags: z.object({
|
|
1014
|
+
watch: z.boolean().describe("Watch for changes").optional(),
|
|
1022
1015
|
}),
|
|
1023
1016
|
handler: async () => {},
|
|
1024
1017
|
});
|
|
@@ -1036,13 +1029,13 @@ describe("CliProvider", () => {
|
|
|
1036
1029
|
deployVercel = $command({
|
|
1037
1030
|
name: "vercel",
|
|
1038
1031
|
description: "Deploy to Vercel",
|
|
1039
|
-
flags:
|
|
1032
|
+
flags: z.object({}),
|
|
1040
1033
|
handler: async () => {},
|
|
1041
1034
|
});
|
|
1042
1035
|
deploy = $command({
|
|
1043
1036
|
name: "deploy",
|
|
1044
1037
|
description: "Deploy commands",
|
|
1045
|
-
flags:
|
|
1038
|
+
flags: z.object({}),
|
|
1046
1039
|
children: [this.deployVercel],
|
|
1047
1040
|
handler: async () => {},
|
|
1048
1041
|
});
|
|
@@ -1060,10 +1053,10 @@ describe("CliProvider", () => {
|
|
|
1060
1053
|
deploy = $command({
|
|
1061
1054
|
name: "deploy",
|
|
1062
1055
|
description: "Deploy to production",
|
|
1063
|
-
flags:
|
|
1064
|
-
env:
|
|
1065
|
-
API_KEY:
|
|
1066
|
-
REGION:
|
|
1056
|
+
flags: z.object({}),
|
|
1057
|
+
env: z.object({
|
|
1058
|
+
API_KEY: z.string().describe("API key for deployment"),
|
|
1059
|
+
REGION: z.string().describe("Target region").optional(),
|
|
1067
1060
|
}),
|
|
1068
1061
|
handler: async () => {},
|
|
1069
1062
|
});
|
|
@@ -1081,7 +1074,7 @@ describe("CliProvider", () => {
|
|
|
1081
1074
|
build = $command({
|
|
1082
1075
|
name: "build",
|
|
1083
1076
|
description: "Build for environment",
|
|
1084
|
-
flags:
|
|
1077
|
+
flags: z.object({}),
|
|
1085
1078
|
mode: "development",
|
|
1086
1079
|
handler: async () => {},
|
|
1087
1080
|
});
|
|
@@ -1099,8 +1092,8 @@ describe("CliProvider", () => {
|
|
|
1099
1092
|
greet = $command({
|
|
1100
1093
|
name: "greet",
|
|
1101
1094
|
description: "Greet someone",
|
|
1102
|
-
flags:
|
|
1103
|
-
args:
|
|
1095
|
+
flags: z.object({}),
|
|
1096
|
+
args: z.string().meta({ title: "name" }),
|
|
1104
1097
|
handler: async () => {},
|
|
1105
1098
|
});
|
|
1106
1099
|
}
|
|
@@ -1117,14 +1110,14 @@ describe("CliProvider", () => {
|
|
|
1117
1110
|
visible = $command({
|
|
1118
1111
|
name: "visible",
|
|
1119
1112
|
description: "Visible command",
|
|
1120
|
-
flags:
|
|
1113
|
+
flags: z.object({}),
|
|
1121
1114
|
handler: async () => {},
|
|
1122
1115
|
});
|
|
1123
1116
|
hidden = $command({
|
|
1124
1117
|
name: "hidden",
|
|
1125
1118
|
description: "Hidden command",
|
|
1126
1119
|
hide: true,
|
|
1127
|
-
flags:
|
|
1120
|
+
flags: z.object({}),
|
|
1128
1121
|
handler: async () => {},
|
|
1129
1122
|
});
|
|
1130
1123
|
}
|
|
@@ -1139,24 +1132,18 @@ describe("CliProvider", () => {
|
|
|
1139
1132
|
it("should include flag aliases in help output", () => {
|
|
1140
1133
|
const cli = createTestCli();
|
|
1141
1134
|
|
|
1142
|
-
const flagsSchema =
|
|
1143
|
-
target:
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
),
|
|
1155
|
-
verbose: t.optional(
|
|
1156
|
-
t.boolean({
|
|
1157
|
-
description: "Verbose output",
|
|
1158
|
-
}),
|
|
1159
|
-
),
|
|
1135
|
+
const flagsSchema = z.object({
|
|
1136
|
+
target: z
|
|
1137
|
+
.enum(["bare", "docker", "vercel"])
|
|
1138
|
+
.meta({ aliases: ["t"] })
|
|
1139
|
+
.describe("Deployment target")
|
|
1140
|
+
.optional(),
|
|
1141
|
+
runtime: z
|
|
1142
|
+
.enum(["node", "bun"])
|
|
1143
|
+
.meta({ alias: "r" })
|
|
1144
|
+
.describe("JavaScript runtime")
|
|
1145
|
+
.optional(),
|
|
1146
|
+
verbose: z.boolean().describe("Verbose output").optional(),
|
|
1160
1147
|
});
|
|
1161
1148
|
|
|
1162
1149
|
const flagDefs = cli.testExtractFlagDefs(flagsSchema);
|
|
@@ -1185,9 +1172,9 @@ describe("CliProvider", () => {
|
|
|
1185
1172
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
1186
1173
|
|
|
1187
1174
|
describe("getEnumValues", () => {
|
|
1188
|
-
it("should extract values from
|
|
1175
|
+
it("should extract values from z.enum schema", () => {
|
|
1189
1176
|
const cli = createTestCli();
|
|
1190
|
-
const schema =
|
|
1177
|
+
const schema = z.enum(["yarn", "npm", "pnpm", "bun"]);
|
|
1191
1178
|
|
|
1192
1179
|
const values = cli.testGetEnumValues(schema);
|
|
1193
1180
|
|
|
@@ -1197,10 +1184,10 @@ describe("CliProvider", () => {
|
|
|
1197
1184
|
it("should return undefined for non-enum schemas", () => {
|
|
1198
1185
|
const cli = createTestCli();
|
|
1199
1186
|
|
|
1200
|
-
expect(cli.testGetEnumValues(
|
|
1201
|
-
expect(cli.testGetEnumValues(
|
|
1202
|
-
expect(cli.testGetEnumValues(
|
|
1203
|
-
expect(cli.testGetEnumValues(
|
|
1187
|
+
expect(cli.testGetEnumValues(z.string())).toBeUndefined();
|
|
1188
|
+
expect(cli.testGetEnumValues(z.boolean())).toBeUndefined();
|
|
1189
|
+
expect(cli.testGetEnumValues(z.number())).toBeUndefined();
|
|
1190
|
+
expect(cli.testGetEnumValues(z.object({}))).toBeUndefined();
|
|
1204
1191
|
});
|
|
1205
1192
|
|
|
1206
1193
|
it("should return undefined for empty or undefined schema", () => {
|
|
@@ -1217,7 +1204,7 @@ describe("CliProvider", () => {
|
|
|
1217
1204
|
describe("formatFlagDescription", () => {
|
|
1218
1205
|
it("should append enum values to description", () => {
|
|
1219
1206
|
const cli = createTestCli();
|
|
1220
|
-
const schema =
|
|
1207
|
+
const schema = z.enum(["yarn", "npm", "pnpm", "bun"]);
|
|
1221
1208
|
|
|
1222
1209
|
const result = cli.testFormatFlagDescription(
|
|
1223
1210
|
"Package manager to use",
|
|
@@ -1233,7 +1220,7 @@ describe("CliProvider", () => {
|
|
|
1233
1220
|
|
|
1234
1221
|
it("should return only enum values when description is empty", () => {
|
|
1235
1222
|
const cli = createTestCli();
|
|
1236
|
-
const schema =
|
|
1223
|
+
const schema = z.enum(["a", "b", "c"]);
|
|
1237
1224
|
|
|
1238
1225
|
const result = cli.testFormatFlagDescription(undefined, schema);
|
|
1239
1226
|
|
|
@@ -1245,10 +1232,10 @@ describe("CliProvider", () => {
|
|
|
1245
1232
|
it("should return original description for non-enum schemas", () => {
|
|
1246
1233
|
const cli = createTestCli();
|
|
1247
1234
|
|
|
1248
|
-
expect(cli.testFormatFlagDescription("A string flag",
|
|
1235
|
+
expect(cli.testFormatFlagDescription("A string flag", z.string())).toBe(
|
|
1249
1236
|
"A string flag",
|
|
1250
1237
|
);
|
|
1251
|
-
expect(cli.testFormatFlagDescription("A boolean flag",
|
|
1238
|
+
expect(cli.testFormatFlagDescription("A boolean flag", z.boolean())).toBe(
|
|
1252
1239
|
"A boolean flag",
|
|
1253
1240
|
);
|
|
1254
1241
|
});
|
|
@@ -1256,7 +1243,7 @@ describe("CliProvider", () => {
|
|
|
1256
1243
|
it("should return empty string when no description and no enum", () => {
|
|
1257
1244
|
const cli = createTestCli();
|
|
1258
1245
|
|
|
1259
|
-
expect(cli.testFormatFlagDescription(undefined,
|
|
1246
|
+
expect(cli.testFormatFlagDescription(undefined, z.string())).toBe("");
|
|
1260
1247
|
});
|
|
1261
1248
|
});
|
|
1262
1249
|
|
|
@@ -1269,12 +1256,12 @@ describe("CliProvider", () => {
|
|
|
1269
1256
|
class TestCommands {
|
|
1270
1257
|
build = $command({
|
|
1271
1258
|
name: "build",
|
|
1272
|
-
flags:
|
|
1259
|
+
flags: z.object({}),
|
|
1273
1260
|
handler: async () => {},
|
|
1274
1261
|
});
|
|
1275
1262
|
test = $command({
|
|
1276
1263
|
name: "test",
|
|
1277
|
-
flags:
|
|
1264
|
+
flags: z.object({}),
|
|
1278
1265
|
handler: async () => {},
|
|
1279
1266
|
});
|
|
1280
1267
|
}
|
|
@@ -1299,8 +1286,8 @@ describe("CliProvider", () => {
|
|
|
1299
1286
|
describe("parseCommandEnv", () => {
|
|
1300
1287
|
it("should use default value for required field with default when env var is missing", () => {
|
|
1301
1288
|
const cli = createTestCli();
|
|
1302
|
-
const schema =
|
|
1303
|
-
MY_VAR:
|
|
1289
|
+
const schema = z.object({
|
|
1290
|
+
MY_VAR: z.text({ default: "fallback" }),
|
|
1304
1291
|
});
|
|
1305
1292
|
|
|
1306
1293
|
delete process.env.MY_VAR;
|
|
@@ -1310,8 +1297,8 @@ describe("CliProvider", () => {
|
|
|
1310
1297
|
|
|
1311
1298
|
it("should prefer env var over default when both exist", () => {
|
|
1312
1299
|
const cli = createTestCli();
|
|
1313
|
-
const schema =
|
|
1314
|
-
MY_VAR:
|
|
1300
|
+
const schema = z.object({
|
|
1301
|
+
MY_VAR: z.text({ default: "fallback" }),
|
|
1315
1302
|
});
|
|
1316
1303
|
|
|
1317
1304
|
process.env.MY_VAR = "from-env";
|
|
@@ -1325,8 +1312,8 @@ describe("CliProvider", () => {
|
|
|
1325
1312
|
|
|
1326
1313
|
it("should throw for required field without default when env var is missing", () => {
|
|
1327
1314
|
const cli = createTestCli();
|
|
1328
|
-
const schema =
|
|
1329
|
-
MY_VAR:
|
|
1315
|
+
const schema = z.object({
|
|
1316
|
+
MY_VAR: z.text(),
|
|
1330
1317
|
});
|
|
1331
1318
|
|
|
1332
1319
|
delete process.env.MY_VAR;
|
|
@@ -1347,8 +1334,8 @@ describe("CliProvider", () => {
|
|
|
1347
1334
|
class TestCommands {
|
|
1348
1335
|
build = $command({
|
|
1349
1336
|
name: "build",
|
|
1350
|
-
flags:
|
|
1351
|
-
watch:
|
|
1337
|
+
flags: z.object({
|
|
1338
|
+
watch: z.boolean().optional(),
|
|
1352
1339
|
}),
|
|
1353
1340
|
handler: async ({ flags }) => {
|
|
1354
1341
|
capturedFlags = flags;
|
|
@@ -1371,8 +1358,8 @@ describe("CliProvider", () => {
|
|
|
1371
1358
|
class TestCommands {
|
|
1372
1359
|
greet = $command({
|
|
1373
1360
|
name: "greet",
|
|
1374
|
-
flags:
|
|
1375
|
-
name:
|
|
1361
|
+
flags: z.object({
|
|
1362
|
+
name: z.string().optional(),
|
|
1376
1363
|
}),
|
|
1377
1364
|
handler: async ({ flags }) => {
|
|
1378
1365
|
capturedFlags = flags;
|
|
@@ -1395,7 +1382,7 @@ describe("CliProvider", () => {
|
|
|
1395
1382
|
class TestCommands {
|
|
1396
1383
|
init = $command({
|
|
1397
1384
|
name: "init",
|
|
1398
|
-
flags:
|
|
1385
|
+
flags: z.object({}),
|
|
1399
1386
|
handler: async ({ root }) => {
|
|
1400
1387
|
capturedRoot = root;
|
|
1401
1388
|
},
|
|
@@ -1417,8 +1404,8 @@ describe("CliProvider", () => {
|
|
|
1417
1404
|
class TestCommands {
|
|
1418
1405
|
greet = $command({
|
|
1419
1406
|
name: "greet",
|
|
1420
|
-
flags:
|
|
1421
|
-
args:
|
|
1407
|
+
flags: z.object({}),
|
|
1408
|
+
args: z.string(),
|
|
1422
1409
|
handler: async ({ args }) => {
|
|
1423
1410
|
capturedArgs = args;
|
|
1424
1411
|
},
|