alepha 0.19.3 → 0.19.5
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/dist/api/invitations/index.d.ts +790 -0
- package/dist/api/invitations/index.d.ts.map +1 -0
- package/dist/api/invitations/index.js +665 -0
- package/dist/api/invitations/index.js.map +1 -0
- package/dist/api/issues/index.d.ts +810 -0
- package/dist/api/issues/index.d.ts.map +1 -0
- package/dist/api/issues/index.js +447 -0
- package/dist/api/issues/index.js.map +1 -0
- package/dist/api/jobs/index.browser.js +8 -9
- package/dist/api/jobs/index.browser.js.map +1 -1
- package/dist/api/jobs/index.d.ts +99 -43
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/jobs/index.js +257 -40
- package/dist/api/jobs/index.js.map +1 -1
- package/dist/api/notifications/index.browser.js +0 -1
- package/dist/api/notifications/index.browser.js.map +1 -1
- package/dist/api/notifications/index.d.ts +3 -3
- package/dist/api/notifications/index.d.ts.map +1 -1
- package/dist/api/notifications/index.js +0 -1
- package/dist/api/notifications/index.js.map +1 -1
- package/dist/api/parameters/index.browser.js +112 -1
- package/dist/api/parameters/index.browser.js.map +1 -1
- package/dist/api/parameters/index.d.ts +90 -3
- package/dist/api/parameters/index.d.ts.map +1 -1
- package/dist/api/parameters/index.js +79 -12
- package/dist/api/parameters/index.js.map +1 -1
- package/dist/{billing → api/payments}/index.d.ts +67 -49
- package/dist/api/payments/index.d.ts.map +1 -0
- package/dist/{billing → api/payments}/index.js +108 -74
- package/dist/api/payments/index.js.map +1 -0
- package/dist/api/subscriptions/index.d.ts +1692 -0
- package/dist/api/subscriptions/index.d.ts.map +1 -0
- package/dist/api/subscriptions/index.js +1870 -0
- package/dist/api/subscriptions/index.js.map +1 -0
- package/dist/api/users/index.d.ts +24 -2
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +176 -36
- package/dist/api/users/index.js.map +1 -1
- package/dist/api/verifications/index.d.ts +13 -13
- package/dist/api/workflows/index.browser.js +246 -0
- package/dist/api/workflows/index.browser.js.map +1 -0
- package/dist/api/workflows/index.d.ts +1618 -0
- package/dist/api/workflows/index.d.ts.map +1 -0
- package/dist/api/workflows/index.js +1504 -0
- package/dist/api/workflows/index.js.map +1 -0
- package/dist/captcha/index.d.ts +142 -0
- package/dist/captcha/index.d.ts.map +1 -0
- package/dist/captcha/index.js +177 -0
- package/dist/captcha/index.js.map +1 -0
- package/dist/cli/core/index.d.ts +126 -30
- package/dist/cli/core/index.d.ts.map +1 -1
- package/dist/cli/core/index.js +106 -67
- package/dist/cli/core/index.js.map +1 -1
- package/dist/cli/platform/index.d.ts +84 -10
- package/dist/cli/platform/index.d.ts.map +1 -1
- package/dist/cli/platform/index.js +92 -4
- package/dist/cli/platform/index.js.map +1 -1
- package/dist/cli/vendor/index.d.ts +60 -10
- package/dist/cli/vendor/index.d.ts.map +1 -1
- package/dist/cli/vendor/index.js +177 -45
- package/dist/cli/vendor/index.js.map +1 -1
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +2 -3
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +21 -2
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +33 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +21 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +21 -2
- package/dist/core/index.native.js.map +1 -1
- package/dist/core/index.workerd.js +21 -2
- package/dist/core/index.workerd.js.map +1 -1
- package/dist/email/smtp/index.js +24 -8
- package/dist/email/smtp/index.js.map +1 -1
- package/dist/orm/core/index.browser.js +0 -18
- package/dist/orm/core/index.browser.js.map +1 -1
- package/dist/orm/core/index.bun.js +6 -23
- package/dist/orm/core/index.bun.js.map +1 -1
- package/dist/orm/core/index.d.ts +1 -13
- package/dist/orm/core/index.d.ts.map +1 -1
- package/dist/orm/core/index.js +6 -23
- package/dist/orm/core/index.js.map +1 -1
- package/dist/orm/postgres/index.bun.js +3 -3
- package/dist/orm/postgres/index.bun.js.map +1 -1
- package/dist/orm/postgres/index.d.ts.map +1 -1
- package/dist/orm/postgres/index.js +3 -3
- package/dist/orm/postgres/index.js.map +1 -1
- package/dist/react/i18n/index.d.ts +1 -0
- package/dist/react/i18n/index.d.ts.map +1 -1
- package/dist/react/i18n/index.js +8 -4
- package/dist/react/i18n/index.js.map +1 -1
- package/dist/react/router/index.browser.js +25 -3
- package/dist/react/router/index.browser.js.map +1 -1
- package/dist/react/router/index.d.ts +16 -1
- package/dist/react/router/index.d.ts.map +1 -1
- package/dist/react/router/index.js +25 -3
- package/dist/react/router/index.js.map +1 -1
- package/dist/security/index.d.ts +28 -0
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +28 -0
- package/dist/security/index.js.map +1 -1
- package/dist/server/auth/index.d.ts +145 -2
- package/dist/server/auth/index.d.ts.map +1 -1
- package/dist/server/auth/index.js +364 -63
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/cookies/index.d.ts.map +1 -1
- package/dist/server/cookies/index.js.map +1 -1
- package/dist/websocket/index.d.ts.map +1 -1
- package/dist/websocket/index.js.map +1 -1
- package/package.json +47 -20
- package/src/api/invitations/__tests__/InvitationService.spec.ts +439 -0
- package/src/api/invitations/controllers/AdminInvitationController.ts +86 -0
- package/src/api/invitations/controllers/InvitationController.ts +84 -0
- package/src/api/invitations/entities/invitations.ts +33 -0
- package/src/api/invitations/index.ts +65 -0
- package/src/api/invitations/jobs/InvitationJobs.ts +37 -0
- package/src/api/invitations/providers/InvitationProvider.ts +45 -0
- package/src/api/invitations/schemas/createInvitationSchema.ts +12 -0
- package/src/api/invitations/schemas/invitationConfigAtom.ts +20 -0
- package/src/api/invitations/schemas/invitationQuerySchema.ts +15 -0
- package/src/api/invitations/schemas/invitationResourceSchema.ts +6 -0
- package/src/api/invitations/schemas/invitationWithResourceInfoSchema.ts +22 -0
- package/src/api/invitations/schemas/myInvitationsQuerySchema.ts +10 -0
- package/src/api/invitations/services/InvitationService.ts +556 -0
- package/src/api/issues/__tests__/IssueService.spec.ts +263 -0
- package/src/api/issues/controllers/AdminIssueController.ts +149 -0
- package/src/api/issues/controllers/IssueController.ts +44 -0
- package/src/api/issues/entities/issues.ts +49 -0
- package/src/api/issues/index.ts +53 -0
- package/src/api/issues/schemas/createIssueSchema.ts +13 -0
- package/src/api/issues/schemas/issueConfigAtom.ts +13 -0
- package/src/api/issues/schemas/issueQuerySchema.ts +18 -0
- package/src/api/issues/schemas/issueResourceSchema.ts +6 -0
- package/src/api/issues/schemas/myIssueQuerySchema.ts +10 -0
- package/src/api/issues/schemas/updateIssueSchema.ts +13 -0
- package/src/api/issues/services/IssueService.ts +264 -0
- package/src/api/jobs/__tests__/$job.spec.ts +876 -0
- package/src/api/jobs/controllers/AdminJobController.ts +44 -0
- package/src/api/jobs/entities/jobExecutionEntity.ts +0 -2
- package/src/api/jobs/index.ts +0 -3
- package/src/api/jobs/primitives/$job.ts +22 -11
- package/src/api/jobs/providers/JobProvider.ts +229 -19
- package/src/api/jobs/schemas/jobConfigAtom.ts +4 -0
- package/src/api/jobs/schemas/jobCronInfoSchema.ts +1 -0
- package/src/api/jobs/schemas/jobExecutionQuerySchema.ts +0 -1
- package/src/api/jobs/schemas/jobQueueDepthSchema.ts +1 -0
- package/src/api/jobs/schemas/jobRegistrationSchema.ts +1 -6
- package/src/api/jobs/services/JobService.ts +51 -12
- package/src/api/notifications/schemas/notificationQuerySchema.ts +0 -1
- package/src/api/parameters/__tests__/$parameter.spec.ts +327 -0
- package/src/api/parameters/controllers/AdminParameterController.ts +29 -3
- package/src/api/parameters/index.browser.ts +12 -0
- package/src/api/parameters/primitives/$parameter.ts +20 -3
- package/src/api/parameters/services/ParameterProvider.ts +48 -7
- package/src/{billing → api/payments}/__tests__/PaymentMethodService.spec.ts +32 -6
- package/src/api/payments/__tests__/PaymentService.spec.ts +279 -0
- package/src/{billing/controllers/AdminBillingController.ts → api/payments/controllers/AdminPaymentController.ts} +26 -21
- package/src/{billing/controllers/BillingController.ts → api/payments/controllers/PaymentController.ts} +23 -11
- package/src/{billing → api/payments}/entities/paymentIntents.ts +1 -0
- package/src/{billing/errors/BillingError.ts → api/payments/errors/PaymentError.ts} +1 -1
- package/src/{billing → api/payments}/index.ts +31 -25
- package/src/{billing/providers/MemoryBillingProvider.ts → api/payments/providers/MemoryPaymentProvider.ts} +4 -4
- package/src/{billing/providers/BillingProvider.ts → api/payments/providers/PaymentProvider.ts} +9 -2
- package/src/{billing → api/payments}/services/PaymentMethodService.ts +5 -5
- package/src/{billing/services/BillingService.ts → api/payments/services/PaymentService.ts} +94 -18
- package/src/api/subscriptions/__tests__/BillingService.spec.ts +218 -0
- package/src/api/subscriptions/__tests__/SubscriptionService.spec.ts +278 -0
- package/src/api/subscriptions/controllers/AdminSubscriptionController.ts +212 -0
- package/src/api/subscriptions/controllers/SubscriptionController.ts +189 -0
- package/src/api/subscriptions/entities/subscriptionEvents.ts +54 -0
- package/src/api/subscriptions/entities/subscriptions.ts +68 -0
- package/src/api/subscriptions/index.ts +144 -0
- package/src/api/subscriptions/jobs/SubscriptionJobs.ts +382 -0
- package/src/api/subscriptions/middleware/$requireLimit.ts +50 -0
- package/src/api/subscriptions/middleware/$requirePlan.ts +49 -0
- package/src/api/subscriptions/notifications/SubscriptionNotifications.ts +110 -0
- package/src/api/subscriptions/schemas/cancelSubscriptionSchema.ts +8 -0
- package/src/api/subscriptions/schemas/changePlanSchema.ts +9 -0
- package/src/api/subscriptions/schemas/createSubscriptionSchema.ts +11 -0
- package/src/api/subscriptions/schemas/entitlementsSchema.ts +21 -0
- package/src/api/subscriptions/schemas/mrrSchema.ts +13 -0
- package/src/api/subscriptions/schemas/planDefinitionSchema.ts +71 -0
- package/src/api/subscriptions/schemas/planResourceSchema.ts +25 -0
- package/src/api/subscriptions/schemas/subscriptionEventResourceSchema.ts +8 -0
- package/src/api/subscriptions/schemas/subscriptionQuerySchema.ts +19 -0
- package/src/api/subscriptions/schemas/subscriptionResourceSchema.ts +6 -0
- package/src/api/subscriptions/schemas/subscriptionSettingsSchema.ts +32 -0
- package/src/api/subscriptions/schemas/subscriptionStatsSchema.ts +23 -0
- package/src/api/subscriptions/services/BillingService.ts +437 -0
- package/src/api/subscriptions/services/SubscriptionConfig.ts +56 -0
- package/src/api/subscriptions/services/SubscriptionService.ts +867 -0
- package/src/api/subscriptions/services/UsageService.ts +118 -0
- package/src/api/users/__tests__/AdminUserController.spec.ts +80 -1
- package/src/api/users/__tests__/CredentialService.spec.ts +177 -0
- package/src/api/users/__tests__/EmailVerification.spec.ts +29 -18
- package/src/api/users/__tests__/PasswordReset.spec.ts +3 -0
- package/src/api/users/__tests__/RegistrationService.spec.ts +148 -1
- package/src/api/users/__tests__/SessionService.spec.ts +142 -1
- package/src/api/users/atoms/realmAuthSettingsAtom.ts +10 -1
- package/src/api/users/controllers/UserController.ts +3 -8
- package/src/api/users/notifications/UserNotifications.ts +23 -0
- package/src/api/users/primitives/$realm.ts +24 -0
- package/src/api/users/schemas/loginSchema.ts +1 -1
- package/src/api/users/services/CredentialService.ts +57 -7
- package/src/api/users/services/RegistrationService.ts +50 -11
- package/src/api/users/services/SessionService.ts +64 -9
- package/src/api/users/services/UserService.ts +21 -12
- package/src/api/workflows/__tests__/$workflow.spec.ts +616 -0
- package/src/api/workflows/controllers/AdminWorkflowController.ts +191 -0
- package/src/api/workflows/entities/workflowExecutions.ts +74 -0
- package/src/api/workflows/entities/workflowStepExecutions.ts +74 -0
- package/src/api/workflows/entities/workflowStepLogs.ts +13 -0
- package/src/api/workflows/index.browser.ts +22 -0
- package/src/api/workflows/index.ts +124 -0
- package/src/api/workflows/jobs/WorkflowJobs.ts +77 -0
- package/src/api/workflows/primitives/$workflow.ts +202 -0
- package/src/api/workflows/providers/WorkflowProvider.ts +1284 -0
- package/src/api/workflows/schemas/workflowActivitySchema.ts +15 -0
- package/src/api/workflows/schemas/workflowConfigAtom.ts +51 -0
- package/src/api/workflows/schemas/workflowExecutionDetailSchema.ts +18 -0
- package/src/api/workflows/schemas/workflowExecutionQuerySchema.ts +26 -0
- package/src/api/workflows/schemas/workflowExecutionResourceSchema.ts +30 -0
- package/src/api/workflows/schemas/workflowRegistrationSchema.ts +26 -0
- package/src/api/workflows/schemas/workflowStatsSchema.ts +16 -0
- package/src/api/workflows/schemas/workflowStepExecutionResourceSchema.ts +15 -0
- package/src/api/workflows/services/WorkflowService.ts +382 -0
- package/src/captcha/__tests__/MemoryCaptchaProvider.spec.ts +74 -0
- package/src/captcha/index.ts +33 -0
- package/src/captcha/providers/CaptchaProvider.ts +17 -0
- package/src/captcha/providers/MemoryCaptchaProvider.ts +65 -0
- package/src/captcha/providers/TurnstileCaptchaProvider.ts +125 -0
- package/src/cli/core/atoms/buildOptions.ts +57 -0
- package/src/cli/core/commands/build.ts +2 -0
- package/src/cli/core/providers/ViteDevServerProvider.ts +1 -1
- package/src/cli/core/services/ViteUtils.ts +5 -2
- package/src/cli/core/tasks/BuildClientTask.ts +3 -1
- package/src/cli/core/tasks/BuildCloudflareTask.ts +4 -0
- package/src/cli/core/tasks/BuildPwaTask.ts +81 -0
- package/src/cli/core/templates/webAppRouterTs.ts +5 -58
- package/src/cli/platform/adapters/CloudflareAdapter.ts +24 -0
- package/src/cli/platform/atoms/platformOptions.ts +19 -3
- package/src/cli/platform/hooks/PlatformHook.ts +51 -0
- package/src/cli/platform/index.ts +1 -0
- package/src/cli/platform/services/CloudflareApi.ts +22 -1
- package/src/cli/platform/services/PlatformOrchestrator.ts +67 -2
- package/src/cli/vendor/__tests__/VendorService.spec.ts +322 -178
- package/src/cli/vendor/commands/VendorCommand.ts +41 -38
- package/src/cli/vendor/services/VendorService.ts +234 -31
- package/src/command/__tests__/CliProvider.spec.ts +45 -0
- package/src/command/providers/CliProvider.ts +3 -4
- package/src/core/__tests__/TypeProvider.spec.ts +4 -2
- package/src/core/providers/SchemaValidator.ts +1 -1
- package/src/core/providers/TypeProvider.ts +46 -3
- package/src/orm/__tests__/enums.spec.ts +22 -29
- package/src/orm/__tests__/orm-showcase-tests.ts +430 -0
- package/src/orm/__tests__/orm-showcase.spec.ts +167 -0
- package/src/orm/core/providers/DatabaseTypeProvider.ts +0 -29
- package/src/orm/core/services/Repository.ts +20 -6
- package/src/orm/postgres/services/PostgresModelBuilder.ts +3 -6
- package/src/react/i18n/__tests__/I18nProvider.spec.ts +83 -0
- package/src/react/i18n/providers/I18nProvider.ts +12 -10
- package/src/react/router/__tests__/$page.browser.spec.tsx +157 -0
- package/src/react/router/providers/ReactBrowserProvider.ts +39 -0
- package/src/react/router/providers/ReactBrowserRouterProvider.ts +22 -0
- package/src/security/__tests__/$secure-combinations.spec.ts +945 -0
- package/src/security/primitives/$issuer.ts +3 -1
- package/src/security/primitives/$secure.ts +28 -0
- package/src/server/auth/index.ts +7 -0
- package/src/server/auth/primitives/$auth.ts +37 -3
- package/src/server/auth/primitives/$authApple.ts +114 -4
- package/src/server/auth/primitives/$authFacebook.ts +98 -0
- package/src/server/auth/primitives/$authFranceConnect.ts +105 -0
- package/src/server/auth/primitives/$authGithub.ts +22 -16
- package/src/server/auth/primitives/$authMicrosoft.ts +88 -0
- package/src/server/auth/providers/ServerAuthProvider.ts +197 -72
- package/src/server/cookies/providers/ServerCookiesProvider.ts +3 -0
- package/src/server/core/__tests__/ServerRouterProvider-errorHandler.spec.ts +1 -1
- package/src/websocket/providers/NodeWebSocketServerProvider.ts +3 -1
- package/dist/billing/index.d.ts.map +0 -1
- package/dist/billing/index.js.map +0 -1
- package/src/billing/__tests__/BillingService.spec.ts +0 -136
- /package/src/{billing → api/payments}/entities/paymentMethods.ts +0 -0
- /package/src/{billing → api/payments}/entities/refunds.ts +0 -0
- /package/src/{billing → api/payments}/schemas/intentSchemas.ts +0 -0
- /package/src/{billing → api/payments}/schemas/paymentMethodSchemas.ts +0 -0
- /package/src/{billing → api/payments}/schemas/refundSchemas.ts +0 -0
package/dist/cli/core/index.js
CHANGED
|
@@ -74,6 +74,19 @@ const buildOptions = $atom({
|
|
|
74
74
|
}))
|
|
75
75
|
})),
|
|
76
76
|
static: t.optional(t.object({ domain: t.optional(t.string()) })),
|
|
77
|
+
pwa: t.optional(t.object({
|
|
78
|
+
name: t.string(),
|
|
79
|
+
shortName: t.optional(t.string()),
|
|
80
|
+
themeColor: t.optional(t.string()),
|
|
81
|
+
backgroundColor: t.optional(t.string()),
|
|
82
|
+
display: t.optional(t.enum([
|
|
83
|
+
"standalone",
|
|
84
|
+
"fullscreen",
|
|
85
|
+
"minimal-ui",
|
|
86
|
+
"browser"
|
|
87
|
+
])),
|
|
88
|
+
offline: t.optional(t.boolean())
|
|
89
|
+
})),
|
|
77
90
|
sitemap: t.optional(t.object({ hostname: t.string() }))
|
|
78
91
|
}),
|
|
79
92
|
default: {}
|
|
@@ -408,7 +421,7 @@ var ViteUtils = class {
|
|
|
408
421
|
}
|
|
409
422
|
};
|
|
410
423
|
}
|
|
411
|
-
generateIndexHtml(entry) {
|
|
424
|
+
generateIndexHtml(entry, opts) {
|
|
412
425
|
const style = entry.style;
|
|
413
426
|
const browser = entry.browser ?? entry.server;
|
|
414
427
|
return `
|
|
@@ -417,7 +430,7 @@ var ViteUtils = class {
|
|
|
417
430
|
<head>
|
|
418
431
|
<meta charset="UTF-8" />
|
|
419
432
|
<title>App</title>
|
|
420
|
-
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
433
|
+
<meta name="viewport" content="width=device-width, initial-scale=1"/>${opts?.pwa ? "\n<link rel=\"manifest\" href=\"/manifest.webmanifest\" />" : ""}
|
|
421
434
|
${style ? `<link rel="stylesheet" href="/${style}" />` : ""}
|
|
422
435
|
</head>
|
|
423
436
|
<body>
|
|
@@ -586,30 +599,30 @@ var AlephaCliUtils = class {
|
|
|
586
599
|
//#endregion
|
|
587
600
|
//#region ../../package.json
|
|
588
601
|
var devDependencies = {
|
|
589
|
-
"@biomejs/biome": "^2.4.
|
|
590
|
-
"@electric-sql/pglite": "^0.4.
|
|
602
|
+
"@biomejs/biome": "^2.4.11",
|
|
603
|
+
"@electric-sql/pglite": "^0.4.4",
|
|
591
604
|
"@faker-js/faker": "^10.4.0",
|
|
592
605
|
"@testing-library/dom": "^10.4.1",
|
|
593
606
|
"@testing-library/react": "^16.3.2",
|
|
594
607
|
"@types/bun": "^1.3.11",
|
|
595
|
-
"@types/node": "^25.
|
|
596
|
-
"@types/nodemailer": "^
|
|
608
|
+
"@types/node": "^25.6.0",
|
|
609
|
+
"@types/nodemailer": "^8.0.0",
|
|
597
610
|
"@types/react": "^19.2.14",
|
|
598
611
|
"@types/react-dom": "^19.2.3",
|
|
599
612
|
"@types/ws": "^8.18.1",
|
|
600
613
|
"cron-schedule": "^6.0.0",
|
|
601
614
|
"drizzle-kit": "^0.31.10",
|
|
602
615
|
"jose": "^6.2.2",
|
|
603
|
-
"jsdom": "^29.0.
|
|
604
|
-
"nodemailer": "^8.0.
|
|
616
|
+
"jsdom": "^29.0.2",
|
|
617
|
+
"nodemailer": "^8.0.5",
|
|
605
618
|
"openid-client": "^6.8.2",
|
|
606
619
|
"prom-client": "^15.1.3",
|
|
607
|
-
"react": "^19.2.
|
|
608
|
-
"react-dom": "^19.2.
|
|
609
|
-
"swagger-ui-dist": "^5.32.
|
|
620
|
+
"react": "^19.2.5",
|
|
621
|
+
"react-dom": "^19.2.5",
|
|
622
|
+
"swagger-ui-dist": "^5.32.2",
|
|
610
623
|
"tsdown": "^0.21.7",
|
|
611
|
-
"vite": "^8.0.
|
|
612
|
-
"vitest": "^4.1.
|
|
624
|
+
"vite": "^8.0.8",
|
|
625
|
+
"vitest": "^4.1.4"
|
|
613
626
|
};
|
|
614
627
|
const version = JSON.parse(readFileSync(new URL("../../../package.json", import.meta.url), "utf-8")).version;
|
|
615
628
|
//#endregion
|
|
@@ -1299,15 +1312,8 @@ const webAppRouterTs = (options) => {
|
|
|
1299
1312
|
imports.push("import { $uiAdmin } from \"@alepha/ui/admin\";");
|
|
1300
1313
|
imports.push("import { AdminUserRouter } from \"@alepha/ui/admin-users\";");
|
|
1301
1314
|
imports.push("import { AdminSessionRouter } from \"@alepha/ui/admin-sessions\";");
|
|
1302
|
-
imports.push("import { AdminAuditRouter } from \"@alepha/ui/admin-audits\";");
|
|
1303
|
-
imports.push("import { AdminFileRouter } from \"@alepha/ui/admin-files\";");
|
|
1304
|
-
imports.push("import { AdminParameterRouter } from \"@alepha/ui/admin-parameters\";");
|
|
1305
|
-
imports.push("import { AdminJobRouter } from \"@alepha/ui/admin-jobs\";");
|
|
1306
|
-
imports.push("import { AdminApiKeyRouter } from \"@alepha/ui/admin-keys\";");
|
|
1307
|
-
imports.push("import { AdminNotificationRouter } from \"@alepha/ui/admin-notifications\";");
|
|
1308
|
-
imports.push("import { AdminBillingRouter } from \"@alepha/ui/admin-billing\";");
|
|
1309
1315
|
imports.push("import { $inject } from \"alepha\";");
|
|
1310
|
-
imports.push("import { IconLayoutDashboard
|
|
1316
|
+
imports.push("import { IconLayoutDashboard } from \"@tabler/icons-react\";");
|
|
1311
1317
|
}
|
|
1312
1318
|
imports.push("import { $page } from \"alepha/react/router\";");
|
|
1313
1319
|
if (options.api) {
|
|
@@ -1321,61 +1327,23 @@ const webAppRouterTs = (options) => {
|
|
|
1321
1327
|
if (options.admin) classMembers.push(` // ── Admin Domain Routers ──────────────────────────
|
|
1322
1328
|
protected users = $inject(AdminUserRouter);
|
|
1323
1329
|
protected sessions = $inject(AdminSessionRouter);
|
|
1324
|
-
protected audits = $inject(AdminAuditRouter);
|
|
1325
|
-
protected files = $inject(AdminFileRouter);
|
|
1326
|
-
protected parameters = $inject(AdminParameterRouter);
|
|
1327
|
-
protected jobs = $inject(AdminJobRouter);
|
|
1328
|
-
protected apiKeys = $inject(AdminApiKeyRouter);
|
|
1329
|
-
protected notifications = $inject(AdminNotificationRouter);
|
|
1330
|
-
protected billing = $inject(AdminBillingRouter);
|
|
1331
1330
|
|
|
1332
1331
|
// ── Admin Panel ─────────────────────────────────
|
|
1333
1332
|
admin = $uiAdmin({
|
|
1334
1333
|
pages: [
|
|
1335
1334
|
this.users.adminUsers,
|
|
1335
|
+
this.users.adminUserLayout,
|
|
1336
1336
|
this.sessions.adminSessions,
|
|
1337
|
-
this.audits.adminAudits,
|
|
1338
|
-
this.files.adminFiles,
|
|
1339
|
-
this.parameters.adminParameters,
|
|
1340
|
-
this.jobs.adminJobs,
|
|
1341
|
-
this.apiKeys.adminApiKeys,
|
|
1342
|
-
this.notifications.adminNotifications,
|
|
1343
|
-
this.billing.adminBilling,
|
|
1344
1337
|
],
|
|
1345
1338
|
sidebarItems: [
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
children: [
|
|
1349
|
-
{ label: "Identity", icon: IconLockPassword, children: [
|
|
1350
|
-
this.users.adminUsers,
|
|
1351
|
-
this.sessions.adminSessions,
|
|
1352
|
-
this.apiKeys.adminApiKeys,
|
|
1353
|
-
]},
|
|
1354
|
-
this.audits.adminAudits,
|
|
1355
|
-
],
|
|
1356
|
-
},
|
|
1357
|
-
{
|
|
1358
|
-
label: "System",
|
|
1359
|
-
children: [
|
|
1360
|
-
this.files.adminFiles,
|
|
1361
|
-
this.jobs.adminJobs,
|
|
1362
|
-
this.notifications.adminNotifications,
|
|
1363
|
-
this.parameters.adminParameters,
|
|
1364
|
-
],
|
|
1365
|
-
},
|
|
1366
|
-
{
|
|
1367
|
-
label: "Commerce",
|
|
1368
|
-
icon: IconCreditCard,
|
|
1369
|
-
children: [
|
|
1370
|
-
this.billing.adminBilling,
|
|
1371
|
-
],
|
|
1372
|
-
},
|
|
1339
|
+
this.users.adminUsers,
|
|
1340
|
+
this.sessions.adminSessions,
|
|
1373
1341
|
],
|
|
1374
1342
|
});
|
|
1375
1343
|
|
|
1376
1344
|
// ── Admin Dashboard ─────────────────────────────
|
|
1377
1345
|
adminDashboard = $page({
|
|
1378
|
-
parent: this.admin
|
|
1346
|
+
parent: this.admin,
|
|
1379
1347
|
path: "/",
|
|
1380
1348
|
label: "Dashboard",
|
|
1381
1349
|
icon: IconLayoutDashboard,
|
|
@@ -1782,7 +1750,7 @@ var BuildClientTask = class extends BuildTask {
|
|
|
1782
1750
|
const publicDir = ctx.options.output?.public ?? "public";
|
|
1783
1751
|
const stats = ctx.options.stats ?? false;
|
|
1784
1752
|
const isCI = this.alepha.isCI();
|
|
1785
|
-
const template = this.viteUtils.generateIndexHtml(ctx.entry);
|
|
1753
|
+
const template = this.viteUtils.generateIndexHtml(ctx.entry, { pwa: !!ctx.options.pwa });
|
|
1786
1754
|
await this.fs.mkdir(this.fs.join(ctx.root, "node_modules/.alepha"));
|
|
1787
1755
|
const indexHtmlPath = this.fs.join(ctx.root, "node_modules/.alepha/index.html");
|
|
1788
1756
|
await this.fs.writeFile(indexHtmlPath, template);
|
|
@@ -1942,11 +1910,13 @@ var BuildCloudflareTask = class BuildCloudflareTask extends BuildTask {
|
|
|
1942
1910
|
if (!url?.startsWith("d1:")) return;
|
|
1943
1911
|
const [dbName, id] = url.replace("d1://", "").replace("d1:", "").split(":");
|
|
1944
1912
|
const binding = BuildCloudflareTask.D1_BINDING;
|
|
1913
|
+
const jurisdiction = process.env.CLOUDFLARE_JURISDICTION;
|
|
1945
1914
|
wrangler.d1_databases = wrangler.d1_databases || [];
|
|
1946
1915
|
wrangler.d1_databases.push({
|
|
1947
1916
|
binding,
|
|
1948
1917
|
database_name: dbName,
|
|
1949
|
-
database_id: id
|
|
1918
|
+
database_id: id,
|
|
1919
|
+
...jurisdiction ? { jurisdiction } : {}
|
|
1950
1920
|
});
|
|
1951
1921
|
wrangler.vars ??= {};
|
|
1952
1922
|
wrangler.vars.DATABASE_URL = `d1://${binding}`;
|
|
@@ -1967,10 +1937,12 @@ var BuildCloudflareTask = class BuildCloudflareTask extends BuildTask {
|
|
|
1967
1937
|
enhanceR2(wrangler) {
|
|
1968
1938
|
const bucketName = process.env.R2_BUCKET_NAME;
|
|
1969
1939
|
if (!bucketName) return;
|
|
1940
|
+
const jurisdiction = process.env.CLOUDFLARE_JURISDICTION;
|
|
1970
1941
|
wrangler.r2_buckets = wrangler.r2_buckets || [];
|
|
1971
1942
|
wrangler.r2_buckets.push({
|
|
1972
1943
|
binding: bucketName,
|
|
1973
|
-
bucket_name: bucketName
|
|
1944
|
+
bucket_name: bucketName,
|
|
1945
|
+
...jurisdiction ? { jurisdiction } : {}
|
|
1974
1946
|
});
|
|
1975
1947
|
wrangler.vars ??= {};
|
|
1976
1948
|
wrangler.vars.R2_BUCKET_NAME = bucketName;
|
|
@@ -2265,6 +2237,72 @@ var BuildPrerenderTask = class extends BuildTask {
|
|
|
2265
2237
|
}
|
|
2266
2238
|
};
|
|
2267
2239
|
//#endregion
|
|
2240
|
+
//#region ../../src/cli/core/tasks/BuildPwaTask.ts
|
|
2241
|
+
/**
|
|
2242
|
+
* Generate PWA web app manifest.
|
|
2243
|
+
*
|
|
2244
|
+
* Produces a `manifest.webmanifest` in the public output directory
|
|
2245
|
+
* from the `pwa` section of build options. Detects icons from `public/`.
|
|
2246
|
+
*/
|
|
2247
|
+
var BuildPwaTask = class extends BuildTask {
|
|
2248
|
+
fs = $inject(FileSystemProvider);
|
|
2249
|
+
async run(ctx) {
|
|
2250
|
+
const pwa = ctx.options.pwa;
|
|
2251
|
+
if (!pwa || !ctx.hasClient) return;
|
|
2252
|
+
const distDir = ctx.options.output?.dist ?? "dist";
|
|
2253
|
+
const publicDir = ctx.options.output?.public ?? "public";
|
|
2254
|
+
const outputDir = this.fs.join(ctx.root, distDir, publicDir);
|
|
2255
|
+
await ctx.run({
|
|
2256
|
+
name: "generate pwa manifest",
|
|
2257
|
+
handler: async () => {
|
|
2258
|
+
const icons = await this.detectIcons(outputDir);
|
|
2259
|
+
const manifest = {
|
|
2260
|
+
name: pwa.name,
|
|
2261
|
+
short_name: pwa.shortName ?? pwa.name,
|
|
2262
|
+
start_url: "/",
|
|
2263
|
+
display: pwa.display ?? "standalone",
|
|
2264
|
+
theme_color: pwa.themeColor ?? "#ffffff",
|
|
2265
|
+
background_color: pwa.backgroundColor ?? "#ffffff"
|
|
2266
|
+
};
|
|
2267
|
+
if (icons.length > 0) manifest.icons = icons;
|
|
2268
|
+
const output = this.fs.join(outputDir, "manifest.webmanifest");
|
|
2269
|
+
await this.fs.writeFile(output, JSON.stringify(manifest, null, 2));
|
|
2270
|
+
}
|
|
2271
|
+
});
|
|
2272
|
+
}
|
|
2273
|
+
/**
|
|
2274
|
+
* Detect icon files in the public output directory.
|
|
2275
|
+
*
|
|
2276
|
+
* Looks for common icon filenames and generates
|
|
2277
|
+
* manifest icon entries with appropriate sizes and types.
|
|
2278
|
+
*/
|
|
2279
|
+
async detectIcons(publicDir) {
|
|
2280
|
+
const icons = [];
|
|
2281
|
+
for (const candidate of [
|
|
2282
|
+
{
|
|
2283
|
+
file: "icon-192.png",
|
|
2284
|
+
sizes: "192x192",
|
|
2285
|
+
type: "image/png"
|
|
2286
|
+
},
|
|
2287
|
+
{
|
|
2288
|
+
file: "icon-512.png",
|
|
2289
|
+
sizes: "512x512",
|
|
2290
|
+
type: "image/png"
|
|
2291
|
+
},
|
|
2292
|
+
{
|
|
2293
|
+
file: "icon.svg",
|
|
2294
|
+
sizes: "any",
|
|
2295
|
+
type: "image/svg+xml"
|
|
2296
|
+
}
|
|
2297
|
+
]) if (await this.fs.exists(this.fs.join(publicDir, candidate.file))) icons.push({
|
|
2298
|
+
src: `/${candidate.file}`,
|
|
2299
|
+
sizes: candidate.sizes,
|
|
2300
|
+
type: candidate.type
|
|
2301
|
+
});
|
|
2302
|
+
return icons;
|
|
2303
|
+
}
|
|
2304
|
+
};
|
|
2305
|
+
//#endregion
|
|
2268
2306
|
//#region ../../src/cli/core/tasks/BuildServerTask.ts
|
|
2269
2307
|
/**
|
|
2270
2308
|
* Build server-side SSR bundle with Vite.
|
|
@@ -2724,6 +2762,7 @@ var BuildCommand = class {
|
|
|
2724
2762
|
$inject(BuildServerTask),
|
|
2725
2763
|
$inject(BuildAssetsTask),
|
|
2726
2764
|
$inject(BuildSitemapTask),
|
|
2765
|
+
$inject(BuildPwaTask),
|
|
2727
2766
|
$inject(BuildPrerenderTask),
|
|
2728
2767
|
$inject(BuildVercelTask),
|
|
2729
2768
|
$inject(BuildCloudflareTask),
|
|
@@ -3595,7 +3634,7 @@ if (import.meta.hot) {
|
|
|
3595
3634
|
});
|
|
3596
3635
|
}
|
|
3597
3636
|
<\/script>`);
|
|
3598
|
-
if (style) tags.push(`<
|
|
3637
|
+
if (style) tags.push(`<script type="module">import "/${style}";<\/script>`);
|
|
3599
3638
|
if (browser) tags.push(`<script type="module" src="/${browser}"><\/script>`);
|
|
3600
3639
|
return tags.join("\n");
|
|
3601
3640
|
}
|