alepha 0.20.1 → 0.20.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/assets/swagger-ui/swagger-ui-bundle.js +1 -1
- package/assets/swagger-ui/swagger-ui.css +1 -1
- package/dist/api/audits/index.browser.js +49 -0
- package/dist/api/audits/index.browser.js.map +1 -1
- package/dist/api/audits/index.d.ts.map +1 -1
- package/dist/api/audits/index.js +49 -0
- package/dist/api/audits/index.js.map +1 -1
- package/dist/api/files/index.d.ts.map +1 -1
- package/dist/api/files/index.js +2 -1
- package/dist/api/files/index.js.map +1 -1
- package/dist/api/jobs/index.browser.js +64 -148
- package/dist/api/jobs/index.browser.js.map +1 -1
- package/dist/api/jobs/index.d.ts +339 -600
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/jobs/index.js +605 -1012
- package/dist/api/jobs/index.js.map +1 -1
- package/dist/api/keys/index.js.map +1 -1
- package/dist/api/notifications/index.d.ts +79 -27
- package/dist/api/notifications/index.d.ts.map +1 -1
- package/dist/api/notifications/index.js +90 -23
- package/dist/api/notifications/index.js.map +1 -1
- package/dist/api/organizations/index.d.ts.map +1 -1
- package/dist/api/parameters/index.browser.js +37 -0
- package/dist/api/parameters/index.browser.js.map +1 -1
- package/dist/api/parameters/index.d.ts +4 -65
- package/dist/api/parameters/index.d.ts.map +1 -1
- package/dist/api/parameters/index.js +37 -0
- package/dist/api/parameters/index.js.map +1 -1
- package/dist/api/payments/index.d.ts +2 -1
- package/dist/api/payments/index.d.ts.map +1 -1
- package/dist/api/payments/index.js +4 -2
- package/dist/api/payments/index.js.map +1 -1
- package/dist/api/users/index.d.ts +225 -5199
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +15 -11
- package/dist/api/users/index.js.map +1 -1
- package/dist/api/verifications/index.d.ts.map +1 -1
- package/dist/api/verifications/index.js +4 -2
- package/dist/api/verifications/index.js.map +1 -1
- package/dist/bucket/index.js +5 -1
- package/dist/bucket/index.js.map +1 -1
- package/dist/bucket/index.workerd.js +5 -1
- package/dist/bucket/index.workerd.js.map +1 -1
- package/dist/cache/core/index.js.map +1 -1
- package/dist/cache/core/index.workerd.js.map +1 -1
- package/dist/captcha/index.js.map +1 -1
- package/dist/cli/core/index.d.ts +225 -11681
- package/dist/cli/core/index.d.ts.map +1 -1
- package/dist/cli/core/index.js +732 -257
- package/dist/cli/core/index.js.map +1 -1
- package/dist/cli/devtools/index.js +7 -1
- package/dist/cli/devtools/index.js.map +1 -1
- package/dist/cli/platform/index.d.ts +65 -63
- package/dist/cli/platform/index.d.ts.map +1 -1
- package/dist/cli/platform/index.js +140 -27
- package/dist/cli/platform/index.js.map +1 -1
- package/dist/cli/vendor/index.js +15 -0
- package/dist/cli/vendor/index.js.map +1 -1
- package/dist/command/index.d.ts +1 -1
- package/dist/command/index.js +1 -1
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +6 -0
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +8 -8
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +6 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +6 -0
- package/dist/core/index.native.js.map +1 -1
- package/dist/core/index.workerd.js +6 -0
- package/dist/core/index.workerd.js.map +1 -1
- package/dist/crypto/index.js.map +1 -1
- package/dist/datetime/index.js.map +1 -1
- package/dist/email/core/index.js.map +1 -1
- package/dist/email/smtp/index.js +2 -10522
- package/dist/email/smtp/index.js.map +1 -1
- package/dist/fake/index.d.ts +4 -8085
- package/dist/fake/index.d.ts.map +1 -1
- package/dist/fake/index.js +3 -33554
- package/dist/fake/index.js.map +1 -1
- package/dist/lock/core/index.js.map +1 -1
- package/dist/lock/redis/index.js.map +1 -1
- package/dist/logger/index.js +32 -1
- package/dist/logger/index.js.map +1 -1
- package/dist/mcp/index.js +5 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/orm/core/index.browser.js +1 -361
- package/dist/orm/core/index.browser.js.map +1 -1
- package/dist/orm/core/index.bun.js +14 -406
- package/dist/orm/core/index.bun.js.map +1 -1
- package/dist/orm/core/index.d.ts +96 -5117
- package/dist/orm/core/index.d.ts.map +1 -1
- package/dist/orm/core/index.js +23 -419
- package/dist/orm/core/index.js.map +1 -1
- package/dist/orm/postgres/index.bun.js +17 -20
- package/dist/orm/postgres/index.bun.js.map +1 -1
- package/dist/orm/postgres/index.d.ts +2 -613
- package/dist/orm/postgres/index.d.ts.map +1 -1
- package/dist/orm/postgres/index.js +17 -20
- package/dist/orm/postgres/index.js.map +1 -1
- package/dist/react/core/index.js.map +1 -1
- package/dist/react/form/index.d.ts +60 -1
- package/dist/react/form/index.d.ts.map +1 -1
- package/dist/react/form/index.js +86 -1
- package/dist/react/form/index.js.map +1 -1
- package/dist/react/head/index.browser.js +16 -1
- package/dist/react/head/index.browser.js.map +1 -1
- package/dist/react/head/index.d.ts +6 -0
- package/dist/react/head/index.d.ts.map +1 -1
- package/dist/react/head/index.js +16 -1
- package/dist/react/head/index.js.map +1 -1
- package/dist/react/i18n/index.js.map +1 -1
- package/dist/react/intro/index.js +22 -17
- package/dist/react/intro/index.js.map +1 -1
- package/dist/react/router/index.browser.js +78 -12
- package/dist/react/router/index.browser.js.map +1 -1
- package/dist/react/router/index.d.ts +57 -13
- package/dist/react/router/index.d.ts.map +1 -1
- package/dist/react/router/index.js +102 -14
- package/dist/react/router/index.js.map +1 -1
- package/dist/react/testing/index.d.ts +1 -411
- package/dist/react/testing/index.d.ts.map +1 -1
- package/dist/react/testing/index.js +13 -12293
- package/dist/react/testing/index.js.map +1 -1
- package/dist/react/ui/index.d.ts +124 -0
- package/dist/react/ui/index.d.ts.map +1 -0
- package/dist/react/ui/index.js +209 -0
- package/dist/react/ui/index.js.map +1 -0
- package/dist/react/websocket/index.js.map +1 -1
- package/dist/redis/index.js.map +1 -1
- package/dist/router/index.d.ts +13 -13
- package/dist/router/index.d.ts.map +1 -1
- package/dist/router/index.js +45 -32
- package/dist/router/index.js.map +1 -1
- package/dist/scheduler/index.d.ts +1 -83
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/index.js +2 -391
- package/dist/scheduler/index.js.map +1 -1
- package/dist/scheduler/index.workerd.js +2 -391
- package/dist/scheduler/index.workerd.js.map +1 -1
- package/dist/security/index.browser.js.map +1 -1
- package/dist/security/index.d.ts +2 -325
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +3 -1362
- package/dist/security/index.js.map +1 -1
- package/dist/server/auth/index.d.ts +1 -1054
- package/dist/server/auth/index.d.ts.map +1 -1
- package/dist/server/auth/index.js +16 -1224
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/cookies/index.js.map +1 -1
- package/dist/server/core/index.browser.js.map +1 -1
- package/dist/server/core/index.d.ts +1 -4
- package/dist/server/core/index.d.ts.map +1 -1
- package/dist/server/core/index.js +19 -4
- package/dist/server/core/index.js.map +1 -1
- package/dist/server/links/index.browser.js.map +1 -1
- package/dist/server/links/index.js.map +1 -1
- package/dist/server/metrics/index.d.ts +1 -514
- package/dist/server/metrics/index.d.ts.map +1 -1
- package/dist/server/metrics/index.js +4 -4356
- package/dist/server/metrics/index.js.map +1 -1
- package/dist/server/rate-limit/index.js.map +1 -1
- package/dist/server/static/index.js.map +1 -1
- package/dist/server/swagger/index.js +1 -1
- package/dist/server/swagger/index.js.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.map +1 -1
- package/dist/system/index.js +1 -0
- package/dist/system/index.js.map +1 -1
- package/dist/system/index.workerd.js.map +1 -1
- package/dist/topic/core/index.js +1 -1
- package/dist/topic/core/index.js.map +1 -1
- package/dist/websocket/index.browser.js +21 -0
- package/dist/websocket/index.browser.js.map +1 -1
- package/dist/websocket/index.js +21 -0
- package/dist/websocket/index.js.map +1 -1
- package/package.json +23 -37
- package/src/api/files/__tests__/FileController.spec.ts +1 -1
- package/src/api/files/jobs/FileJobs.ts +2 -1
- package/src/api/jobs/__tests__/$job.spec.ts +320 -2867
- package/src/api/jobs/controllers/AdminJobController.ts +29 -138
- package/src/api/jobs/entities/jobExecutionEntity.ts +27 -19
- package/src/api/jobs/index.browser.ts +5 -7
- package/src/api/jobs/index.ts +23 -51
- package/src/api/jobs/primitives/$job.ts +66 -58
- package/src/api/jobs/providers/JobProvider.ts +561 -566
- package/src/api/jobs/providers/JobQueueProvider.ts +18 -19
- package/src/api/jobs/schemas/jobConfigAtom.ts +20 -23
- package/src/api/jobs/schemas/jobExecutionQuerySchema.ts +3 -27
- package/src/api/jobs/schemas/jobExecutionResourceSchema.ts +5 -7
- package/src/api/jobs/schemas/jobRegistrationSchema.ts +7 -4
- package/src/api/jobs/schemas/triggerJobSchema.ts +0 -1
- package/src/api/jobs/services/JobService.ts +90 -483
- package/src/api/notifications/controllers/AdminNotificationController.ts +19 -12
- package/src/api/notifications/index.ts +7 -4
- package/src/api/notifications/jobs/NotificationJobs.ts +83 -12
- package/src/api/payments/services/PaymentService.ts +4 -2
- package/src/api/users/__tests__/UserJobs.spec.ts +10 -49
- package/src/api/users/audits/UserAudits.ts +3 -1
- package/src/api/users/buckets/UserBuckets.ts +2 -1
- package/src/api/users/index.ts +1 -4
- package/src/api/users/jobs/UserJobs.ts +5 -4
- package/src/api/users/schemas/userQuerySchema.ts +0 -1
- package/src/api/users/services/UserService.ts +1 -5
- package/src/api/verifications/__tests__/CodeVerification.spec.ts +14 -0
- package/src/api/verifications/__tests__/LinkVerification.spec.ts +14 -0
- package/src/api/verifications/jobs/VerificationJobs.ts +2 -1
- package/src/api/verifications/services/VerificationService.ts +1 -0
- package/src/cli/core/__tests__/init.spec.ts +209 -1
- package/src/cli/core/commands/init.ts +9 -9
- package/src/cli/core/services/PackageManagerUtils.ts +22 -12
- package/src/cli/core/services/ProjectScaffolder.ts +300 -70
- package/src/cli/core/tasks/BuildDockerTask.ts +9 -10
- package/src/cli/core/tasks/BuildServerTask.ts +8 -0
- package/src/cli/core/templates/agentMd.ts +2 -8
- package/src/cli/core/templates/apiIndexTs.ts +22 -14
- package/src/cli/core/templates/componentsJsonTs.ts +39 -0
- package/src/cli/core/templates/mainCss.ts +2 -36
- package/src/cli/core/templates/saasAdminLayoutTsx.ts +77 -0
- package/src/cli/core/templates/saasAdminPagesTsx.ts +26 -0
- package/src/cli/core/templates/saasAuthLayoutTsx.ts +20 -0
- package/src/cli/core/templates/saasAuthPagesTsx.ts +62 -0
- package/src/cli/core/templates/saasRealmProviderTs.ts +46 -0
- package/src/cli/core/templates/vitestConfigTs.ts +17 -0
- package/src/cli/core/templates/webAppRouterTs.ts +102 -82
- package/src/cli/core/templates/webIndexTs.ts +23 -1
- package/src/cli/platform/__tests__/CloudflareAdapter.spec.ts +22 -71
- package/src/cli/platform/__tests__/SecretsCommand.spec.ts +2 -0
- package/src/cli/platform/adapters/CloudflareAdapter.ts +12 -11
- package/src/cli/platform/atoms/platformOptions.ts +9 -0
- package/src/cli/platform/schemas/cloudflare.ts +3 -2
- package/src/cli/platform/services/CloudflareApi.ts +164 -25
- package/src/cli/platform/services/WranglerApi.ts +0 -17
- package/src/command/providers/CliProvider.ts +1 -1
- package/src/core/Alepha.ts +9 -0
- package/src/core/interfaces/Service.ts +3 -1
- package/src/core/providers/TypeProvider.ts +1 -1
- package/src/logger/services/Logger.ts +1 -1
- package/src/mcp/__tests__/$resource.spec.ts +1 -1
- package/src/mcp/__tests__/$tool.spec.ts +1 -1
- package/src/mcp/__tests__/McpServerProvider.spec.ts +1 -1
- package/src/orm/__tests__/$repository-tests.ts +1 -0
- package/src/orm/__tests__/orm-next-tests.ts +2 -67
- package/src/orm/__tests__/orm-next.spec.ts +0 -21
- package/src/orm/core/index.shared.ts +0 -2
- package/src/orm/core/index.ts +1 -2
- package/src/orm/core/primitives/$repository.ts +3 -6
- package/src/orm/core/providers/drivers/DatabaseProvider.ts +0 -5
- package/src/orm/core/providers/drivers/NodeSqliteProvider.ts +11 -13
- package/src/orm/core/services/ModelBuilder.ts +1 -13
- package/src/orm/core/services/Repository.ts +1 -42
- package/src/orm/core/services/SqliteModelBuilder.ts +2 -33
- package/src/orm/postgres/services/PostgresModelBuilder.ts +10 -45
- package/src/react/form/index.ts +2 -0
- package/src/react/form/services/parseField.ts +163 -0
- package/src/react/form/services/prettyName.ts +19 -0
- package/src/react/head/providers/BrowserHeadProvider.ts +31 -10
- package/src/react/intro/components/GettingStartedAuthSlide.tsx +11 -4
- package/src/react/router/__tests__/ReactBrowserProvider.browser.spec.ts +213 -2
- package/src/react/router/primitives/$page.ts +35 -12
- package/src/react/router/providers/ReactBrowserProvider.ts +73 -0
- package/src/react/router/providers/ReactBrowserRouterProvider.ts +1 -1
- package/src/react/router/providers/ReactPreloadProvider.ts +1 -1
- package/src/react/router/providers/ReactServerProvider.ts +1 -0
- package/src/react/ui/atoms/uiAtom.ts +28 -0
- package/src/react/ui/components/ColorScheme.tsx +36 -0
- package/src/react/ui/hooks/useColorMode.ts +49 -0
- package/src/react/ui/hooks/useSidebarState.ts +26 -0
- package/src/react/ui/hooks/useTheme.ts +22 -0
- package/src/react/ui/index.ts +35 -0
- package/src/react/ui/services/UiPersistence.ts +41 -0
- package/src/router/TemplatedPathParser.ts +50 -51
- package/src/router/__tests__/RouterProvider.spec.ts +62 -0
- package/src/router/__tests__/TemplatedPathParser.spec.ts +18 -0
- package/src/router/providers/RouterProvider.ts +10 -5
- package/src/scheduler/providers/CronProvider.ts +1 -1
- package/src/security/primitives/$basicAuth.ts +1 -1
- package/src/server/auth/providers/ServerAuthProvider.ts +5 -1
- package/src/server/core/interfaces/ServerRequest.ts +1 -0
- package/src/server/core/providers/ServerProvider.ts +1 -1
- package/src/server/core/providers/ServerRouterProvider.ts +2 -2
- package/src/server/core/services/HttpClient.ts +1 -1
- package/src/server/swagger/providers/ServerSwaggerProvider.ts +1 -1
- package/src/system/providers/NodeShellProvider.ts +1 -0
- package/src/topic/core/providers/TopicProvider.ts +1 -1
- package/dist/api/invitations/index.d.ts +0 -790
- package/dist/api/invitations/index.d.ts.map +0 -1
- package/dist/api/invitations/index.js +0 -662
- package/dist/api/invitations/index.js.map +0 -1
- package/dist/api/issues/index.d.ts +0 -810
- package/dist/api/issues/index.d.ts.map +0 -1
- package/dist/api/issues/index.js +0 -444
- package/dist/api/issues/index.js.map +0 -1
- package/dist/api/subscriptions/index.d.ts +0 -1692
- package/dist/api/subscriptions/index.d.ts.map +0 -1
- package/dist/api/subscriptions/index.js +0 -1867
- package/dist/api/subscriptions/index.js.map +0 -1
- package/dist/api/workflows/index.browser.js +0 -246
- package/dist/api/workflows/index.browser.js.map +0 -1
- package/dist/api/workflows/index.d.ts +0 -1618
- package/dist/api/workflows/index.d.ts.map +0 -1
- package/dist/api/workflows/index.js +0 -1495
- package/dist/api/workflows/index.js.map +0 -1
- package/dist/react/testing/chunk-DBEY4PJZ.js +0 -16
- package/src/api/invitations/__tests__/InvitationService.spec.ts +0 -439
- package/src/api/invitations/controllers/AdminInvitationController.ts +0 -86
- package/src/api/invitations/controllers/InvitationController.ts +0 -84
- package/src/api/invitations/entities/invitations.ts +0 -33
- package/src/api/invitations/index.ts +0 -58
- package/src/api/invitations/jobs/InvitationJobs.ts +0 -37
- package/src/api/invitations/providers/InvitationProvider.ts +0 -45
- package/src/api/invitations/schemas/createInvitationSchema.ts +0 -12
- package/src/api/invitations/schemas/invitationConfigAtom.ts +0 -20
- package/src/api/invitations/schemas/invitationQuerySchema.ts +0 -15
- package/src/api/invitations/schemas/invitationResourceSchema.ts +0 -6
- package/src/api/invitations/schemas/invitationWithResourceInfoSchema.ts +0 -22
- package/src/api/invitations/schemas/myInvitationsQuerySchema.ts +0 -10
- package/src/api/invitations/services/InvitationService.ts +0 -556
- package/src/api/issues/__tests__/IssueService.spec.ts +0 -263
- package/src/api/issues/controllers/AdminIssueController.ts +0 -149
- package/src/api/issues/controllers/IssueController.ts +0 -44
- package/src/api/issues/entities/issues.ts +0 -49
- package/src/api/issues/index.ts +0 -50
- package/src/api/issues/schemas/createIssueSchema.ts +0 -13
- package/src/api/issues/schemas/issueConfigAtom.ts +0 -13
- package/src/api/issues/schemas/issueQuerySchema.ts +0 -18
- package/src/api/issues/schemas/issueResourceSchema.ts +0 -6
- package/src/api/issues/schemas/myIssueQuerySchema.ts +0 -10
- package/src/api/issues/schemas/updateIssueSchema.ts +0 -13
- package/src/api/issues/services/IssueService.ts +0 -264
- package/src/api/jobs/__tests__/$job-middleware.spec.ts +0 -126
- package/src/api/jobs/__tests__/JobService.spec.ts +0 -31
- package/src/api/jobs/entities/jobExecutionLogEntity.ts +0 -13
- package/src/api/jobs/schemas/jobActivitySchema.ts +0 -15
- package/src/api/jobs/schemas/jobCronInfoSchema.ts +0 -22
- package/src/api/jobs/schemas/jobExecutionDetailResourceSchema.ts +0 -20
- package/src/api/jobs/schemas/jobFailureSchema.ts +0 -9
- package/src/api/jobs/schemas/jobQueueDepthSchema.ts +0 -14
- package/src/api/jobs/schemas/jobStatsSchema.ts +0 -14
- package/src/api/jobs/services/JobService-tests.ts +0 -157
- package/src/api/subscriptions/__tests__/BillingService.spec.ts +0 -218
- package/src/api/subscriptions/__tests__/SubscriptionService.spec.ts +0 -278
- package/src/api/subscriptions/controllers/AdminSubscriptionController.ts +0 -212
- package/src/api/subscriptions/controllers/SubscriptionController.ts +0 -189
- package/src/api/subscriptions/entities/subscriptionEvents.ts +0 -54
- package/src/api/subscriptions/entities/subscriptions.ts +0 -68
- package/src/api/subscriptions/index.ts +0 -133
- package/src/api/subscriptions/jobs/SubscriptionJobs.ts +0 -382
- package/src/api/subscriptions/middleware/$requireLimit.ts +0 -50
- package/src/api/subscriptions/middleware/$requirePlan.ts +0 -49
- package/src/api/subscriptions/notifications/SubscriptionNotifications.ts +0 -110
- package/src/api/subscriptions/schemas/cancelSubscriptionSchema.ts +0 -8
- package/src/api/subscriptions/schemas/changePlanSchema.ts +0 -9
- package/src/api/subscriptions/schemas/createSubscriptionSchema.ts +0 -11
- package/src/api/subscriptions/schemas/entitlementsSchema.ts +0 -21
- package/src/api/subscriptions/schemas/mrrSchema.ts +0 -13
- package/src/api/subscriptions/schemas/planDefinitionSchema.ts +0 -71
- package/src/api/subscriptions/schemas/planResourceSchema.ts +0 -25
- package/src/api/subscriptions/schemas/subscriptionEventResourceSchema.ts +0 -8
- package/src/api/subscriptions/schemas/subscriptionQuerySchema.ts +0 -19
- package/src/api/subscriptions/schemas/subscriptionResourceSchema.ts +0 -6
- package/src/api/subscriptions/schemas/subscriptionSettingsSchema.ts +0 -32
- package/src/api/subscriptions/schemas/subscriptionStatsSchema.ts +0 -23
- package/src/api/subscriptions/services/BillingService.ts +0 -437
- package/src/api/subscriptions/services/SubscriptionConfig.ts +0 -56
- package/src/api/subscriptions/services/SubscriptionService.ts +0 -867
- package/src/api/subscriptions/services/UsageService.ts +0 -118
- package/src/api/workflows/__tests__/$workflow.spec.ts +0 -616
- package/src/api/workflows/controllers/AdminWorkflowController.ts +0 -191
- package/src/api/workflows/entities/workflowExecutions.ts +0 -74
- package/src/api/workflows/entities/workflowStepExecutions.ts +0 -74
- package/src/api/workflows/entities/workflowStepLogs.ts +0 -13
- package/src/api/workflows/index.browser.ts +0 -22
- package/src/api/workflows/index.ts +0 -115
- package/src/api/workflows/jobs/WorkflowJobs.ts +0 -77
- package/src/api/workflows/primitives/$workflow.ts +0 -202
- package/src/api/workflows/providers/WorkflowProvider.ts +0 -1284
- package/src/api/workflows/schemas/workflowActivitySchema.ts +0 -15
- package/src/api/workflows/schemas/workflowConfigAtom.ts +0 -51
- package/src/api/workflows/schemas/workflowExecutionDetailSchema.ts +0 -18
- package/src/api/workflows/schemas/workflowExecutionQuerySchema.ts +0 -26
- package/src/api/workflows/schemas/workflowExecutionResourceSchema.ts +0 -30
- package/src/api/workflows/schemas/workflowRegistrationSchema.ts +0 -26
- package/src/api/workflows/schemas/workflowStatsSchema.ts +0 -16
- package/src/api/workflows/schemas/workflowStepExecutionResourceSchema.ts +0 -15
- package/src/api/workflows/services/WorkflowService.ts +0 -382
- package/src/cli/core/templates/apiAppSecurityTs.ts +0 -43
- package/src/cli/core/templates/webAdminDashboardTsx.ts +0 -17
- package/src/orm/core/__tests__/parseQueryString.spec.ts +0 -196
- package/src/orm/core/helpers/parseQueryString.ts +0 -502
- package/src/orm/core/primitives/$view.ts +0 -88
|
@@ -69,7 +69,7 @@ const cloudflareKVSchema = t.object({
|
|
|
69
69
|
});
|
|
70
70
|
const cloudflareR2Schema = t.object({
|
|
71
71
|
name: t.string(),
|
|
72
|
-
creation_date: t.string()
|
|
72
|
+
creation_date: t.optional(t.string())
|
|
73
73
|
});
|
|
74
74
|
const cloudflareR2ListSchema = t.object({ buckets: t.array(cloudflareR2Schema) });
|
|
75
75
|
const cloudflareQueueSchema = t.object({
|
|
@@ -77,8 +77,9 @@ const cloudflareQueueSchema = t.object({
|
|
|
77
77
|
queue_name: t.string()
|
|
78
78
|
});
|
|
79
79
|
const cloudflareQueueConsumerSchema = t.object({
|
|
80
|
+
consumer_id: t.string(),
|
|
80
81
|
service: t.string(),
|
|
81
|
-
environment: t.string()
|
|
82
|
+
environment: t.optional(t.string())
|
|
82
83
|
});
|
|
83
84
|
const cloudflareHyperdriveOriginSchema = t.object({ host: t.string() });
|
|
84
85
|
const cloudflareHyperdriveSchema = t.object({
|
|
@@ -225,12 +226,6 @@ var WranglerApi = class {
|
|
|
225
226
|
env: { CI: "1" }
|
|
226
227
|
});
|
|
227
228
|
}
|
|
228
|
-
/**
|
|
229
|
-
* Push secrets in bulk to a worker.
|
|
230
|
-
*/
|
|
231
|
-
async secretBulk(secretsPath, workerName) {
|
|
232
|
-
await this.runShell(`wrangler secret bulk ${secretsPath} --name=${workerName}`, { resolve: true });
|
|
233
|
-
}
|
|
234
229
|
};
|
|
235
230
|
//#endregion
|
|
236
231
|
//#region ../../src/cli/platform/services/CloudflareApi.ts
|
|
@@ -260,6 +255,15 @@ var CloudflareApi = class CloudflareApi {
|
|
|
260
255
|
this.jurisdiction = jurisdiction;
|
|
261
256
|
}
|
|
262
257
|
/**
|
|
258
|
+
* Override the Cloudflare account ID (from platform config).
|
|
259
|
+
*
|
|
260
|
+
* When unset, `resolveAccountId` falls back to `CLOUDFLARE_ACCOUNT_ID` env
|
|
261
|
+
* var or the token's single account.
|
|
262
|
+
*/
|
|
263
|
+
setAccountId(accountId) {
|
|
264
|
+
this.accountId = accountId;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
263
267
|
* Obtain the current auth token from wrangler.
|
|
264
268
|
*/
|
|
265
269
|
async resolveToken() {
|
|
@@ -274,24 +278,32 @@ var CloudflareApi = class CloudflareApi {
|
|
|
274
278
|
*/
|
|
275
279
|
async resolveAccountId() {
|
|
276
280
|
if (this.accountId) return this.accountId;
|
|
281
|
+
const fromEnv = process.env.CLOUDFLARE_ACCOUNT_ID;
|
|
282
|
+
if (fromEnv) {
|
|
283
|
+
this.accountId = fromEnv;
|
|
284
|
+
return this.accountId;
|
|
285
|
+
}
|
|
277
286
|
const res = await this.fetch("/accounts", { schema: t.array(cloudflareAccountSchema) });
|
|
278
287
|
if (res.length === 0) throw new AlephaError("No Cloudflare accounts found for this token.");
|
|
288
|
+
if (res.length > 1) {
|
|
289
|
+
const list = res.map((a) => ` - ${a.id} ${a.name}`).join("\n");
|
|
290
|
+
throw new AlephaError(`Cloudflare token has access to ${res.length} accounts; set \`CLOUDFLARE_ACCOUNT_ID\` or the \`accountId\` field in your platform config to pick one:\n${list}`);
|
|
291
|
+
}
|
|
279
292
|
this.accountId = res[0].id;
|
|
280
293
|
return this.accountId;
|
|
281
294
|
}
|
|
282
295
|
async listD1() {
|
|
283
296
|
const accountId = await this.resolveAccountId();
|
|
284
|
-
return await this.
|
|
297
|
+
return await this.paginate(`/accounts/${accountId}/d1/database`, cloudflareD1Schema);
|
|
285
298
|
}
|
|
286
299
|
async createD1(name, location = "weur") {
|
|
287
300
|
const accountId = await this.resolveAccountId();
|
|
301
|
+
const body = { name };
|
|
302
|
+
if (this.jurisdiction) body.jurisdiction = this.jurisdiction;
|
|
303
|
+
else body.primary_location_hint = location;
|
|
288
304
|
return await this.fetch(`/accounts/${accountId}/d1/database`, {
|
|
289
305
|
method: "POST",
|
|
290
|
-
body
|
|
291
|
-
name,
|
|
292
|
-
primary_location_hint: location,
|
|
293
|
-
...this.jurisdiction ? { jurisdiction: this.jurisdiction } : {}
|
|
294
|
-
},
|
|
306
|
+
body,
|
|
295
307
|
bodySchema: createD1BodySchema,
|
|
296
308
|
schema: cloudflareD1Schema
|
|
297
309
|
});
|
|
@@ -302,7 +314,7 @@ var CloudflareApi = class CloudflareApi {
|
|
|
302
314
|
}
|
|
303
315
|
async listKV() {
|
|
304
316
|
const accountId = await this.resolveAccountId();
|
|
305
|
-
return await this.
|
|
317
|
+
return await this.paginate(`/accounts/${accountId}/storage/kv/namespaces`, cloudflareKVSchema, 100);
|
|
306
318
|
}
|
|
307
319
|
async createKV(title) {
|
|
308
320
|
const accountId = await this.resolveAccountId();
|
|
@@ -319,7 +331,7 @@ var CloudflareApi = class CloudflareApi {
|
|
|
319
331
|
}
|
|
320
332
|
async listR2() {
|
|
321
333
|
const accountId = await this.resolveAccountId();
|
|
322
|
-
return
|
|
334
|
+
return await this.paginateCursor(`/accounts/${accountId}/r2/buckets`, "buckets", cloudflareR2Schema);
|
|
323
335
|
}
|
|
324
336
|
async createR2(name) {
|
|
325
337
|
const accountId = await this.resolveAccountId();
|
|
@@ -335,7 +347,7 @@ var CloudflareApi = class CloudflareApi {
|
|
|
335
347
|
}
|
|
336
348
|
async listQueues() {
|
|
337
349
|
const accountId = await this.resolveAccountId();
|
|
338
|
-
return await this.
|
|
350
|
+
return await this.paginate(`/accounts/${accountId}/queues`, cloudflareQueueSchema);
|
|
339
351
|
}
|
|
340
352
|
async createQueue(name) {
|
|
341
353
|
const accountId = await this.resolveAccountId();
|
|
@@ -352,15 +364,17 @@ var CloudflareApi = class CloudflareApi {
|
|
|
352
364
|
}
|
|
353
365
|
async listQueueConsumers(queueId) {
|
|
354
366
|
const accountId = await this.resolveAccountId();
|
|
355
|
-
return await this.
|
|
367
|
+
return await this.paginate(`/accounts/${accountId}/queues/${queueId}/consumers`, cloudflareQueueConsumerSchema);
|
|
356
368
|
}
|
|
357
369
|
async deleteQueueConsumer(queueId, consumerService) {
|
|
358
370
|
const accountId = await this.resolveAccountId();
|
|
359
|
-
await this.
|
|
371
|
+
const consumer = (await this.listQueueConsumers(queueId)).find((c) => c.service === consumerService);
|
|
372
|
+
if (!consumer) return;
|
|
373
|
+
await this.fetch(`/accounts/${accountId}/queues/${queueId}/consumers/${consumer.consumer_id}`, { method: "DELETE" });
|
|
360
374
|
}
|
|
361
375
|
async listHyperdrive() {
|
|
362
376
|
const accountId = await this.resolveAccountId();
|
|
363
|
-
return await this.
|
|
377
|
+
return await this.paginate(`/accounts/${accountId}/hyperdrive/configs`, cloudflareHyperdriveSchema);
|
|
364
378
|
}
|
|
365
379
|
async createHyperdrive(name, connectionString) {
|
|
366
380
|
const accountId = await this.resolveAccountId();
|
|
@@ -395,11 +409,14 @@ var CloudflareApi = class CloudflareApi {
|
|
|
395
409
|
}
|
|
396
410
|
async listDeployments(scriptName) {
|
|
397
411
|
const accountId = await this.resolveAccountId();
|
|
398
|
-
return (await this.fetch(`/accounts/${accountId}/workers/scripts/${scriptName}/deployments`, {
|
|
412
|
+
return (await this.fetch(`/accounts/${accountId}/workers/scripts/${scriptName}/deployments`, {
|
|
413
|
+
schema: cloudflareDeploymentListSchema,
|
|
414
|
+
query: { per_page: "100" }
|
|
415
|
+
})).deployments;
|
|
399
416
|
}
|
|
400
417
|
async listVersions(scriptName) {
|
|
401
418
|
const accountId = await this.resolveAccountId();
|
|
402
|
-
return
|
|
419
|
+
return await this.paginateCursor(`/accounts/${accountId}/workers/scripts/${scriptName}/versions`, "items", cloudflareVersionSchema);
|
|
403
420
|
}
|
|
404
421
|
async listSecrets(scriptName) {
|
|
405
422
|
const accountId = await this.resolveAccountId();
|
|
@@ -442,6 +459,55 @@ var CloudflareApi = class CloudflareApi {
|
|
|
442
459
|
return json.result;
|
|
443
460
|
}
|
|
444
461
|
/**
|
|
462
|
+
* Paginate a page-based list endpoint (`result_info.total_pages`).
|
|
463
|
+
*
|
|
464
|
+
* Cloudflare defaults to `per_page=20`; we push it to 1000 (max on most
|
|
465
|
+
* list endpoints) and loop if more pages exist. Each page is validated
|
|
466
|
+
* against the item schema.
|
|
467
|
+
*/
|
|
468
|
+
async paginate(path, itemSchema, perPage = 1e3) {
|
|
469
|
+
const results = [];
|
|
470
|
+
let page = 1;
|
|
471
|
+
while (true) {
|
|
472
|
+
const token = await this.resolveToken();
|
|
473
|
+
const url = `${CloudflareApi.BASE}${path}?per_page=${perPage}&page=${page}`;
|
|
474
|
+
const headers = { Authorization: `Bearer ${token}` };
|
|
475
|
+
if (this.jurisdiction && /\/r2\//.test(path)) headers["cf-r2-jurisdiction"] = this.jurisdiction;
|
|
476
|
+
const json = await (await globalThis.fetch(url, {
|
|
477
|
+
method: "GET",
|
|
478
|
+
headers
|
|
479
|
+
})).json();
|
|
480
|
+
if (!json.success) throw new AlephaError(`Cloudflare API error (GET ${path}): ${json.errors.map((e) => e.message).join(", ")}`);
|
|
481
|
+
const validated = this.alepha.codec.validate(t.array(itemSchema), json.result);
|
|
482
|
+
results.push(...validated);
|
|
483
|
+
const totalPages = json.result_info?.total_pages;
|
|
484
|
+
if (!totalPages || page >= totalPages || validated.length === 0) break;
|
|
485
|
+
page++;
|
|
486
|
+
}
|
|
487
|
+
return results;
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Paginate a cursor-based list endpoint where `result` is an object
|
|
491
|
+
* containing both the items array and a `cursor` field (R2 buckets,
|
|
492
|
+
* Workers versions). Returns the flattened item array.
|
|
493
|
+
*/
|
|
494
|
+
async paginateCursor(path, itemsKey, itemSchema, perPage = 1e3) {
|
|
495
|
+
const results = [];
|
|
496
|
+
let cursor;
|
|
497
|
+
while (true) {
|
|
498
|
+
const query = { per_page: String(perPage) };
|
|
499
|
+
if (cursor) query.cursor = cursor;
|
|
500
|
+
const res = await this.fetch(path, { query });
|
|
501
|
+
const items = res[itemsKey] ?? [];
|
|
502
|
+
const validated = this.alepha.codec.validate(t.array(itemSchema), items);
|
|
503
|
+
results.push(...validated);
|
|
504
|
+
const nextCursor = res.cursor;
|
|
505
|
+
if (!nextCursor || validated.length === 0) break;
|
|
506
|
+
cursor = nextCursor;
|
|
507
|
+
}
|
|
508
|
+
return results;
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
445
511
|
* Parse a postgres:// connection string into Hyperdrive origin fields.
|
|
446
512
|
*/
|
|
447
513
|
parseConnectionString(connectionString) {
|
|
@@ -496,7 +562,6 @@ var CloudflareAdapter = class CloudflareAdapter extends PlatformAdapter {
|
|
|
496
562
|
log = $logger();
|
|
497
563
|
fs = $inject(FileSystemProvider);
|
|
498
564
|
shell = $inject(ShellProvider);
|
|
499
|
-
utils = $inject(AlephaCliUtils);
|
|
500
565
|
cache = $inject(PlatformCacheProvider);
|
|
501
566
|
alepha = $inject(Alepha);
|
|
502
567
|
envUtils = $inject(EnvUtils);
|
|
@@ -524,6 +589,7 @@ var CloudflareAdapter = class CloudflareAdapter extends PlatformAdapter {
|
|
|
524
589
|
*/
|
|
525
590
|
configureApi(ctx) {
|
|
526
591
|
this.api.setJurisdiction(ctx.envConfig.jurisdiction);
|
|
592
|
+
this.api.setAccountId(ctx.envConfig.accountId);
|
|
527
593
|
}
|
|
528
594
|
async runShell(command, options = {}) {
|
|
529
595
|
const capture = options.capture;
|
|
@@ -634,8 +700,7 @@ var CloudflareAdapter = class CloudflareAdapter extends PlatformAdapter {
|
|
|
634
700
|
await run({
|
|
635
701
|
name: `push secrets to ${workerName}`,
|
|
636
702
|
handler: async () => {
|
|
637
|
-
const
|
|
638
|
-
await this.wrangler.secretBulk(secretsPath, workerName);
|
|
703
|
+
for (const [name, value] of Object.entries(secrets)) await this.api.putSecret(workerName, name, value);
|
|
639
704
|
}
|
|
640
705
|
});
|
|
641
706
|
}
|
|
@@ -1000,7 +1065,7 @@ var CloudflareAdapter = class CloudflareAdapter extends PlatformAdapter {
|
|
|
1000
1065
|
* Get the currently active deployment for a worker.
|
|
1001
1066
|
*/
|
|
1002
1067
|
async getActiveDeployment(workerName) {
|
|
1003
|
-
const latest =
|
|
1068
|
+
const latest = [...await this.api.listDeployments(workerName)].sort((a, b) => b.created_on.localeCompare(a.created_on))[0];
|
|
1004
1069
|
if (!latest?.versions?.[0]) return;
|
|
1005
1070
|
const activeVersionId = latest.versions[0].version_id;
|
|
1006
1071
|
const version = (await this.api.listVersions(workerName)).find((v) => v.id === activeVersionId);
|
|
@@ -1462,17 +1527,65 @@ const platformOptions = $atom({
|
|
|
1462
1527
|
name: "alepha.cli.platform.options",
|
|
1463
1528
|
description: "Platform deployment configuration",
|
|
1464
1529
|
schema: t.optional(t.object({
|
|
1530
|
+
/**
|
|
1531
|
+
* Project name override. Defaults to root package.json "name".
|
|
1532
|
+
*/
|
|
1465
1533
|
name: t.optional(t.text()),
|
|
1534
|
+
/**
|
|
1535
|
+
* Monorepo app paths relative to root. Omit for standalone apps.
|
|
1536
|
+
*/
|
|
1466
1537
|
apps: t.optional(t.array(t.text())),
|
|
1538
|
+
/**
|
|
1539
|
+
* Default environment when --env is omitted.
|
|
1540
|
+
*
|
|
1541
|
+
* @default "production"
|
|
1542
|
+
*/
|
|
1467
1543
|
default: t.optional(t.text()),
|
|
1544
|
+
/**
|
|
1545
|
+
* Secret store configuration for syncing .env secrets
|
|
1546
|
+
* to external providers (e.g. GitHub Actions environments).
|
|
1547
|
+
*/
|
|
1468
1548
|
secrets: t.optional(t.object({
|
|
1549
|
+
/**
|
|
1550
|
+
* Secret store backend.
|
|
1551
|
+
*/
|
|
1469
1552
|
store: t.enum(["github"]),
|
|
1553
|
+
/**
|
|
1554
|
+
* Pattern for resolving environment names in the store.
|
|
1555
|
+
* Placeholders: {project}, {env}.
|
|
1556
|
+
*
|
|
1557
|
+
* @default "{project}-{env}"
|
|
1558
|
+
*/
|
|
1470
1559
|
environmentPattern: t.optional(t.text())
|
|
1471
1560
|
})),
|
|
1561
|
+
/**
|
|
1562
|
+
* Named environments with their adapter and configuration.
|
|
1563
|
+
*/
|
|
1472
1564
|
environments: t.record(t.text({ description: "Environment name (e.g. 'production', 'staging', 'preview'). Used in resource naming and selected via --env." }), t.object({
|
|
1473
1565
|
adapter: t.enum(["cloudflare", "vercel"]),
|
|
1566
|
+
/**
|
|
1567
|
+
* Custom domain for the deployed worker (e.g. "api.example.com").
|
|
1568
|
+
*
|
|
1569
|
+
* On Cloudflare this is attached as a custom-domain route.
|
|
1570
|
+
* Omit to use the adapter's default `*.workers.dev` / preview URL.
|
|
1571
|
+
*/
|
|
1474
1572
|
domain: t.optional(t.text()),
|
|
1475
|
-
|
|
1573
|
+
/**
|
|
1574
|
+
* Cloudflare data jurisdiction for R2 buckets and D1 databases.
|
|
1575
|
+
* - "eu": data stays within the EU
|
|
1576
|
+
* - "fedramp": FedRAMP-authorized regions
|
|
1577
|
+
*
|
|
1578
|
+
* Omit for the default (global) jurisdiction.
|
|
1579
|
+
*/
|
|
1580
|
+
jurisdiction: t.optional(t.enum(["eu", "fedramp"])),
|
|
1581
|
+
/**
|
|
1582
|
+
* Cloudflare account ID to deploy into.
|
|
1583
|
+
*
|
|
1584
|
+
* Falls back to `CLOUDFLARE_ACCOUNT_ID` env var, then to the
|
|
1585
|
+
* token's account when the token is scoped to exactly one.
|
|
1586
|
+
* Required when the token has access to multiple accounts.
|
|
1587
|
+
*/
|
|
1588
|
+
accountId: t.optional(t.text())
|
|
1476
1589
|
}))
|
|
1477
1590
|
}))
|
|
1478
1591
|
});
|