alepha 0.19.2 → 0.19.4
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/audits/index.d.ts +8 -8
- 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/jobs/index.browser.js +8 -9
- package/dist/api/jobs/index.browser.js.map +1 -1
- package/dist/api/jobs/index.d.ts +90 -34
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/jobs/index.js +267 -44
- 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 +27 -21
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +167 -34
- package/dist/api/users/index.js.map +1 -1
- 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/cli/config/index.d.ts +6 -28
- package/dist/cli/config/index.d.ts.map +1 -1
- package/dist/cli/config/index.js +5 -10
- package/dist/cli/config/index.js.map +1 -1
- package/dist/cli/core/index.d.ts +11669 -208
- package/dist/cli/core/index.d.ts.map +1 -1
- package/dist/cli/core/index.js +60 -69
- package/dist/cli/core/index.js.map +1 -1
- package/dist/cli/devtools/index.d.ts +5 -0
- package/dist/cli/devtools/index.d.ts.map +1 -1
- package/dist/cli/devtools/index.js +4 -0
- package/dist/cli/devtools/index.js.map +1 -1
- package/dist/cli/platform/index.d.ts +69 -64
- package/dist/cli/platform/index.d.ts.map +1 -1
- package/dist/cli/platform/index.js +6 -2
- package/dist/cli/platform/index.js.map +1 -1
- package/dist/cli/vendor/index.d.ts +38 -10
- package/dist/cli/vendor/index.d.ts.map +1 -1
- package/dist/cli/vendor/index.js +85 -26
- package/dist/cli/vendor/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 +25 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +25 -2
- package/dist/core/index.native.js.map +1 -1
- package/dist/core/index.workerd.js +25 -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/logger/index.d.ts.map +1 -1
- package/dist/logger/index.js +1 -1
- package/dist/logger/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 +25 -73
- package/dist/orm/core/index.bun.js.map +1 -1
- package/dist/orm/core/index.d.ts +10 -32
- package/dist/orm/core/index.d.ts.map +1 -1
- package/dist/orm/core/index.js +25 -73
- 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 +2 -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/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/package.json +37 -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/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 +239 -25
- 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/schemas/loginSchema.ts +1 -1
- package/src/api/users/services/CredentialService.ts +51 -4
- package/src/api/users/services/RegistrationService.ts +38 -9
- package/src/api/users/services/SessionService.ts +62 -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/cli/config/defineConfig.ts +17 -46
- package/src/cli/core/providers/ViteDevServerProvider.ts +45 -3
- package/src/cli/core/services/PackageManagerUtils.ts +3 -1
- package/src/cli/core/services/ProjectScaffolder.ts +5 -5
- package/src/cli/core/templates/agentMd.ts +14 -5
- package/src/cli/core/templates/webAppRouterTs.ts +5 -58
- package/src/cli/devtools/index.ts +21 -1
- package/src/cli/platform/index.ts +23 -2
- package/src/cli/vendor/__tests__/VendorService.spec.ts +283 -178
- package/src/cli/vendor/index.ts +20 -3
- package/src/cli/vendor/services/VendorService.ts +126 -27
- package/src/core/Alepha.ts +10 -0
- 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/logger/index.ts +6 -1
- 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/providers/DrizzleKitProvider.ts +56 -105
- package/src/orm/postgres/services/PostgresModelBuilder.ts +3 -6
- 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/$secure.ts +28 -0
- package/tsconfig.base.json +0 -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
|
@@ -586,29 +586,30 @@ var AlephaCliUtils = class {
|
|
|
586
586
|
//#endregion
|
|
587
587
|
//#region ../../package.json
|
|
588
588
|
var devDependencies = {
|
|
589
|
-
"@biomejs/biome": "^2.4.
|
|
590
|
-
"@electric-sql/pglite": "^0.4.
|
|
589
|
+
"@biomejs/biome": "^2.4.11",
|
|
590
|
+
"@electric-sql/pglite": "^0.4.4",
|
|
591
591
|
"@faker-js/faker": "^10.4.0",
|
|
592
592
|
"@testing-library/dom": "^10.4.1",
|
|
593
593
|
"@testing-library/react": "^16.3.2",
|
|
594
594
|
"@types/bun": "^1.3.11",
|
|
595
|
-
"@types/node": "^25.
|
|
596
|
-
"@types/nodemailer": "^
|
|
595
|
+
"@types/node": "^25.6.0",
|
|
596
|
+
"@types/nodemailer": "^8.0.0",
|
|
597
597
|
"@types/react": "^19.2.14",
|
|
598
598
|
"@types/react-dom": "^19.2.3",
|
|
599
599
|
"@types/ws": "^8.18.1",
|
|
600
600
|
"cron-schedule": "^6.0.0",
|
|
601
601
|
"drizzle-kit": "^0.31.10",
|
|
602
602
|
"jose": "^6.2.2",
|
|
603
|
-
"jsdom": "^29.0.
|
|
604
|
-
"nodemailer": "^8.0.
|
|
603
|
+
"jsdom": "^29.0.2",
|
|
604
|
+
"nodemailer": "^8.0.5",
|
|
605
605
|
"openid-client": "^6.8.2",
|
|
606
606
|
"prom-client": "^15.1.3",
|
|
607
|
-
"react": "^19.2.
|
|
608
|
-
"react-dom": "^19.2.
|
|
609
|
-
"swagger-ui-dist": "^5.32.
|
|
607
|
+
"react": "^19.2.5",
|
|
608
|
+
"react-dom": "^19.2.5",
|
|
609
|
+
"swagger-ui-dist": "^5.32.2",
|
|
610
610
|
"tsdown": "^0.21.7",
|
|
611
|
-
"
|
|
611
|
+
"vite": "^8.0.8",
|
|
612
|
+
"vitest": "^4.1.4"
|
|
612
613
|
};
|
|
613
614
|
const version = JSON.parse(readFileSync(new URL("../../../package.json", import.meta.url), "utf-8")).version;
|
|
614
615
|
//#endregion
|
|
@@ -861,7 +862,7 @@ var PackageManagerUtils = class {
|
|
|
861
862
|
generatePackageJsonContent(modes) {
|
|
862
863
|
const alephaDeps = devDependencies;
|
|
863
864
|
const dependencies = { alepha: `^${version}` };
|
|
864
|
-
const devDependencies$1 = {};
|
|
865
|
+
const devDependencies$1 = { vite: alephaDeps.vite };
|
|
865
866
|
if (!(modes.react && !modes.ui)) devDependencies$1["drizzle-kit"] = alephaDeps["drizzle-kit"];
|
|
866
867
|
if (!modes.isPackage) {
|
|
867
868
|
devDependencies$1["@biomejs/biome"] = alephaDeps["@biomejs/biome"];
|
|
@@ -905,8 +906,12 @@ var PackageManagerUtils = class {
|
|
|
905
906
|
const cliAssets = { logo: join(join(fileURLToPath(import.meta.url), "../../../.."), "assets/logo.svg") };
|
|
906
907
|
//#endregion
|
|
907
908
|
//#region ../../src/cli/core/templates/agentMd.ts
|
|
908
|
-
const agentMd = (
|
|
909
|
-
|
|
909
|
+
const agentMd = (options) => {
|
|
910
|
+
const header = options.type === "claude" ? `# CLAUDE.md` : `# AGENTS.md`;
|
|
911
|
+
const docs = [`- Framework source: \`node_modules/alepha/src/\``];
|
|
912
|
+
if (options.ui) docs.push(`- UI components: \`node_modules/@alepha/ui/src/\``);
|
|
913
|
+
docs.push(`- Docs: https://alepha.dev/llms.txt`);
|
|
914
|
+
return `${header}
|
|
910
915
|
|
|
911
916
|
This is an **Alepha** project.
|
|
912
917
|
|
|
@@ -928,9 +933,7 @@ alepha build # Build
|
|
|
928
933
|
|
|
929
934
|
## Documentation
|
|
930
935
|
|
|
931
|
-
|
|
932
|
-
- UI components: \`node_modules/@alepha/ui/src/\`
|
|
933
|
-
- Docs: https://alepha.dev/llms.txt
|
|
936
|
+
${docs.join("\n")}
|
|
934
937
|
`.trim();
|
|
935
938
|
};
|
|
936
939
|
//#endregion
|
|
@@ -1296,15 +1299,8 @@ const webAppRouterTs = (options) => {
|
|
|
1296
1299
|
imports.push("import { $uiAdmin } from \"@alepha/ui/admin\";");
|
|
1297
1300
|
imports.push("import { AdminUserRouter } from \"@alepha/ui/admin-users\";");
|
|
1298
1301
|
imports.push("import { AdminSessionRouter } from \"@alepha/ui/admin-sessions\";");
|
|
1299
|
-
imports.push("import { AdminAuditRouter } from \"@alepha/ui/admin-audits\";");
|
|
1300
|
-
imports.push("import { AdminFileRouter } from \"@alepha/ui/admin-files\";");
|
|
1301
|
-
imports.push("import { AdminParameterRouter } from \"@alepha/ui/admin-parameters\";");
|
|
1302
|
-
imports.push("import { AdminJobRouter } from \"@alepha/ui/admin-jobs\";");
|
|
1303
|
-
imports.push("import { AdminApiKeyRouter } from \"@alepha/ui/admin-keys\";");
|
|
1304
|
-
imports.push("import { AdminNotificationRouter } from \"@alepha/ui/admin-notifications\";");
|
|
1305
|
-
imports.push("import { AdminBillingRouter } from \"@alepha/ui/admin-billing\";");
|
|
1306
1302
|
imports.push("import { $inject } from \"alepha\";");
|
|
1307
|
-
imports.push("import { IconLayoutDashboard
|
|
1303
|
+
imports.push("import { IconLayoutDashboard } from \"@tabler/icons-react\";");
|
|
1308
1304
|
}
|
|
1309
1305
|
imports.push("import { $page } from \"alepha/react/router\";");
|
|
1310
1306
|
if (options.api) {
|
|
@@ -1318,61 +1314,23 @@ const webAppRouterTs = (options) => {
|
|
|
1318
1314
|
if (options.admin) classMembers.push(` // ── Admin Domain Routers ──────────────────────────
|
|
1319
1315
|
protected users = $inject(AdminUserRouter);
|
|
1320
1316
|
protected sessions = $inject(AdminSessionRouter);
|
|
1321
|
-
protected audits = $inject(AdminAuditRouter);
|
|
1322
|
-
protected files = $inject(AdminFileRouter);
|
|
1323
|
-
protected parameters = $inject(AdminParameterRouter);
|
|
1324
|
-
protected jobs = $inject(AdminJobRouter);
|
|
1325
|
-
protected apiKeys = $inject(AdminApiKeyRouter);
|
|
1326
|
-
protected notifications = $inject(AdminNotificationRouter);
|
|
1327
|
-
protected billing = $inject(AdminBillingRouter);
|
|
1328
1317
|
|
|
1329
1318
|
// ── Admin Panel ─────────────────────────────────
|
|
1330
1319
|
admin = $uiAdmin({
|
|
1331
1320
|
pages: [
|
|
1332
1321
|
this.users.adminUsers,
|
|
1322
|
+
this.users.adminUserLayout,
|
|
1333
1323
|
this.sessions.adminSessions,
|
|
1334
|
-
this.audits.adminAudits,
|
|
1335
|
-
this.files.adminFiles,
|
|
1336
|
-
this.parameters.adminParameters,
|
|
1337
|
-
this.jobs.adminJobs,
|
|
1338
|
-
this.apiKeys.adminApiKeys,
|
|
1339
|
-
this.notifications.adminNotifications,
|
|
1340
|
-
this.billing.adminBilling,
|
|
1341
1324
|
],
|
|
1342
1325
|
sidebarItems: [
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
children: [
|
|
1346
|
-
{ label: "Identity", icon: IconLockPassword, children: [
|
|
1347
|
-
this.users.adminUsers,
|
|
1348
|
-
this.sessions.adminSessions,
|
|
1349
|
-
this.apiKeys.adminApiKeys,
|
|
1350
|
-
]},
|
|
1351
|
-
this.audits.adminAudits,
|
|
1352
|
-
],
|
|
1353
|
-
},
|
|
1354
|
-
{
|
|
1355
|
-
label: "System",
|
|
1356
|
-
children: [
|
|
1357
|
-
this.files.adminFiles,
|
|
1358
|
-
this.jobs.adminJobs,
|
|
1359
|
-
this.notifications.adminNotifications,
|
|
1360
|
-
this.parameters.adminParameters,
|
|
1361
|
-
],
|
|
1362
|
-
},
|
|
1363
|
-
{
|
|
1364
|
-
label: "Commerce",
|
|
1365
|
-
icon: IconCreditCard,
|
|
1366
|
-
children: [
|
|
1367
|
-
this.billing.adminBilling,
|
|
1368
|
-
],
|
|
1369
|
-
},
|
|
1326
|
+
this.users.adminUsers,
|
|
1327
|
+
this.sessions.adminSessions,
|
|
1370
1328
|
],
|
|
1371
1329
|
});
|
|
1372
1330
|
|
|
1373
1331
|
// ── Admin Dashboard ─────────────────────────────
|
|
1374
1332
|
adminDashboard = $page({
|
|
1375
|
-
parent: this.admin
|
|
1333
|
+
parent: this.admin,
|
|
1376
1334
|
path: "/",
|
|
1377
1335
|
label: "Dashboard",
|
|
1378
1336
|
icon: IconLayoutDashboard,
|
|
@@ -1518,7 +1476,7 @@ var ProjectScaffolder = class {
|
|
|
1518
1476
|
}
|
|
1519
1477
|
async ensureAgentMd(root, options) {
|
|
1520
1478
|
const filename = options.type === "claude" ? "CLAUDE.md" : "AGENTS.md";
|
|
1521
|
-
await this.ensureFile(root, filename, agentMd(options
|
|
1479
|
+
await this.ensureFile(root, filename, agentMd(options), options.force);
|
|
1522
1480
|
}
|
|
1523
1481
|
/**
|
|
1524
1482
|
* Ensure alepha.config.ts exists with documented options.
|
|
@@ -1634,7 +1592,10 @@ var ProjectScaffolder = class {
|
|
|
1634
1592
|
tsconfigJson: !workspace.config.tsconfigJson,
|
|
1635
1593
|
biomeJson: true,
|
|
1636
1594
|
editorconfig: !workspace.config.editorconfig,
|
|
1637
|
-
agentMd: agentType ? {
|
|
1595
|
+
agentMd: agentType ? {
|
|
1596
|
+
type: agentType,
|
|
1597
|
+
ui: !!flags.ui
|
|
1598
|
+
} : false
|
|
1638
1599
|
});
|
|
1639
1600
|
await this.ensureAlephaConfig(root, { force });
|
|
1640
1601
|
await this.ensureMainServerTs(root, {
|
|
@@ -3360,6 +3321,20 @@ var ViteDevServerProvider = class {
|
|
|
3360
3321
|
server.hot.on("connection", () => {
|
|
3361
3322
|
if (this.currentError) setTimeout(() => this.sendErrorOverlay(this.currentError), 50);
|
|
3362
3323
|
});
|
|
3324
|
+
server.middlewares.use(async (req, res, next) => {
|
|
3325
|
+
if (req.url !== "/__alepha/ready") {
|
|
3326
|
+
next();
|
|
3327
|
+
return;
|
|
3328
|
+
}
|
|
3329
|
+
if (this.currentReloadPromise) await this.currentReloadPromise;
|
|
3330
|
+
if (this.alepha?.isReady()) {
|
|
3331
|
+
res.writeHead(200, { "content-type": "text/plain" });
|
|
3332
|
+
res.end("ok");
|
|
3333
|
+
} else {
|
|
3334
|
+
res.writeHead(503, { "content-type": "text/plain" });
|
|
3335
|
+
res.end("not ready");
|
|
3336
|
+
}
|
|
3337
|
+
});
|
|
3363
3338
|
return () => {
|
|
3364
3339
|
server.middlewares.use(async (req, res, next) => {
|
|
3365
3340
|
const url = req.url || "/";
|
|
@@ -3367,6 +3342,7 @@ var ViteDevServerProvider = class {
|
|
|
3367
3342
|
next();
|
|
3368
3343
|
return;
|
|
3369
3344
|
}
|
|
3345
|
+
if (this.currentReloadPromise) await this.currentReloadPromise;
|
|
3370
3346
|
if (this.hasError && !this.alepha) {
|
|
3371
3347
|
if (req.headers.accept?.includes("text/html")) {
|
|
3372
3348
|
res.writeHead(200, { "content-type": "text/html" });
|
|
@@ -3415,9 +3391,10 @@ var ViteDevServerProvider = class {
|
|
|
3415
3391
|
}
|
|
3416
3392
|
/**
|
|
3417
3393
|
* Send full browser reload via Vite's HMR.
|
|
3394
|
+
* Uses a custom event so the client can poll for readiness before reloading.
|
|
3418
3395
|
*/
|
|
3419
3396
|
sendBrowserReload() {
|
|
3420
|
-
this.server.hot.send(
|
|
3397
|
+
this.server.hot.send("alepha:reload", {});
|
|
3421
3398
|
}
|
|
3422
3399
|
/**
|
|
3423
3400
|
* Send error to Vite's native error overlay.
|
|
@@ -3559,6 +3536,20 @@ var ViteDevServerProvider = class {
|
|
|
3559
3536
|
const preamble = (await this.server.transformIndexHtml("/", "<!DOCTYPE html><html><head></head><body></body></html>")).match(/<head>([\s\S]*?)<\/head>/i)?.[1]?.trim() ?? "";
|
|
3560
3537
|
const tags = [];
|
|
3561
3538
|
if (preamble) tags.push(preamble);
|
|
3539
|
+
tags.push(`<script type="module">
|
|
3540
|
+
if (import.meta.hot) {
|
|
3541
|
+
import.meta.hot.on("alepha:reload", async () => {
|
|
3542
|
+
for (let i = 0; i < 50; i++) {
|
|
3543
|
+
try {
|
|
3544
|
+
const res = await fetch("/__alepha/ready");
|
|
3545
|
+
if (res.ok) { window.location.reload(); return; }
|
|
3546
|
+
} catch {}
|
|
3547
|
+
await new Promise(r => setTimeout(r, 200));
|
|
3548
|
+
}
|
|
3549
|
+
window.location.reload();
|
|
3550
|
+
});
|
|
3551
|
+
}
|
|
3552
|
+
<\/script>`);
|
|
3562
3553
|
if (style) tags.push(`<link rel="stylesheet" href="/${style}">`);
|
|
3563
3554
|
if (browser) tags.push(`<script type="module" src="/${browser}"><\/script>`);
|
|
3564
3555
|
return tags.join("\n");
|