fragment-ts 2.0.2 → 2.0.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/API.md +1 -8
- package/DOCS.md +1 -5
- package/README.md +2 -11
- package/SETUP.md +4 -14
- package/USAGE.md +11 -4
- package/dist/core/decorators/middleware.decorator.d.ts +10 -1
- package/dist/core/decorators/middleware.decorator.d.ts.map +1 -1
- package/dist/core/decorators/middleware.decorator.js +35 -7
- package/dist/core/decorators/middleware.decorator.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/platform/cli/commands/install/command.d.ts +14 -0
- package/dist/platform/cli/commands/install/command.d.ts.map +1 -0
- package/dist/platform/cli/commands/install/command.js +145 -0
- package/dist/platform/cli/commands/install/command.js.map +1 -0
- package/dist/platform/cli/commands/register.d.ts.map +1 -1
- package/dist/platform/cli/commands/register.js +39 -32
- package/dist/platform/cli/commands/register.js.map +1 -1
- package/dist/platform/cli/commands/serve/command.d.ts.map +1 -1
- package/dist/platform/cli/commands/serve/command.js +9 -3
- package/dist/platform/cli/commands/serve/command.js.map +1 -1
- package/dist/platform/cli/index.js +77 -10
- package/dist/platform/cli/index.js.map +1 -1
- package/dist/platform/cli/scaffold/generate/component-generator.js +1 -1
- package/dist/platform/cli/scaffold/init/init.scaffold.d.ts.map +1 -1
- package/dist/platform/cli/scaffold/init/init.scaffold.js +1 -8
- package/dist/platform/cli/scaffold/init/init.scaffold.js.map +1 -1
- package/dist/platform/cli/web/commands/create/feature.d.ts +11 -0
- package/dist/platform/cli/web/commands/create/feature.d.ts.map +1 -0
- package/dist/platform/cli/web/commands/create/feature.js +43 -0
- package/dist/platform/cli/web/commands/create/feature.js.map +1 -0
- package/dist/platform/cli/web/commands/create/module.d.ts +11 -0
- package/dist/platform/cli/web/commands/create/module.d.ts.map +1 -0
- package/dist/platform/cli/web/commands/create/module.js +44 -0
- package/dist/platform/cli/web/commands/create/module.js.map +1 -0
- package/dist/platform/cli/web/commands/create/mvvm.d.ts +11 -0
- package/dist/platform/cli/web/commands/create/mvvm.d.ts.map +1 -0
- package/dist/platform/cli/web/commands/create/mvvm.js +43 -0
- package/dist/platform/cli/web/commands/create/mvvm.js.map +1 -0
- package/dist/platform/cli/web/commands/init-fullstack.d.ts +12 -0
- package/dist/platform/cli/web/commands/init-fullstack.d.ts.map +1 -0
- package/dist/platform/cli/web/commands/init-fullstack.js +42 -0
- package/dist/platform/cli/web/commands/init-fullstack.js.map +1 -0
- package/dist/platform/cli/web/commands/init-web.d.ts +12 -0
- package/dist/platform/cli/web/commands/init-web.d.ts.map +1 -0
- package/dist/platform/cli/web/commands/init-web.js +70 -0
- package/dist/platform/cli/web/commands/init-web.js.map +1 -0
- package/dist/platform/cli/web/commands/install-api.d.ts +11 -0
- package/dist/platform/cli/web/commands/install-api.d.ts.map +1 -0
- package/dist/platform/cli/web/commands/install-api.js +92 -0
- package/dist/platform/cli/web/commands/install-api.js.map +1 -0
- package/dist/platform/cli/web/commands/install-web.d.ts +13 -0
- package/dist/platform/cli/web/commands/install-web.d.ts.map +1 -0
- package/dist/platform/cli/web/commands/install-web.js +102 -0
- package/dist/platform/cli/web/commands/install-web.js.map +1 -0
- package/dist/platform/cli/web/commands/install.d.ts +3 -0
- package/dist/platform/cli/web/commands/install.d.ts.map +1 -0
- package/dist/platform/cli/web/commands/install.js +23 -0
- package/dist/platform/cli/web/commands/install.js.map +1 -0
- package/dist/platform/cli/web/commands/make/component.d.ts +16 -0
- package/dist/platform/cli/web/commands/make/component.d.ts.map +1 -0
- package/dist/platform/cli/web/commands/make/component.js +73 -0
- package/dist/platform/cli/web/commands/make/component.js.map +1 -0
- package/dist/platform/cli/web/commands/make/guard.d.ts +13 -0
- package/dist/platform/cli/web/commands/make/guard.d.ts.map +1 -0
- package/dist/platform/cli/web/commands/make/guard.js +46 -0
- package/dist/platform/cli/web/commands/make/guard.js.map +1 -0
- package/dist/platform/cli/web/commands/make/layout.d.ts +12 -0
- package/dist/platform/cli/web/commands/make/layout.d.ts.map +1 -0
- package/dist/platform/cli/web/commands/make/layout.js +44 -0
- package/dist/platform/cli/web/commands/make/layout.js.map +1 -0
- package/dist/platform/cli/web/commands/make/page.d.ts +17 -0
- package/dist/platform/cli/web/commands/make/page.d.ts.map +1 -0
- package/dist/platform/cli/web/commands/make/page.js +66 -0
- package/dist/platform/cli/web/commands/make/page.js.map +1 -0
- package/dist/platform/cli/web/commands/make/resource.d.ts +17 -0
- package/dist/platform/cli/web/commands/make/resource.d.ts.map +1 -0
- package/dist/platform/cli/web/commands/make/resource.js +37 -0
- package/dist/platform/cli/web/commands/make/resource.js.map +1 -0
- package/dist/platform/cli/web/commands/make/service.d.ts +16 -0
- package/dist/platform/cli/web/commands/make/service.d.ts.map +1 -0
- package/dist/platform/cli/web/commands/make/service.js +137 -0
- package/dist/platform/cli/web/commands/make/service.js.map +1 -0
- package/dist/platform/cli/web/commands/make/store.d.ts +16 -0
- package/dist/platform/cli/web/commands/make/store.d.ts.map +1 -0
- package/dist/platform/cli/web/commands/make/store.js +72 -0
- package/dist/platform/cli/web/commands/make/store.js.map +1 -0
- package/dist/platform/cli/web/commands/web-sync.d.ts +10 -0
- package/dist/platform/cli/web/commands/web-sync.d.ts.map +1 -0
- package/dist/platform/cli/web/commands/web-sync.js +307 -0
- package/dist/platform/cli/web/commands/web-sync.js.map +1 -0
- package/dist/platform/cli/web/index.d.ts +3 -0
- package/dist/platform/cli/web/index.d.ts.map +1 -0
- package/dist/platform/cli/web/index.js +40 -0
- package/dist/platform/cli/web/index.js.map +1 -0
- package/dist/platform/cli/web/utils/config.d.ts +52 -0
- package/dist/platform/cli/web/utils/config.d.ts.map +1 -0
- package/dist/platform/cli/web/utils/config.js +89 -0
- package/dist/platform/cli/web/utils/config.js.map +1 -0
- package/dist/platform/cli/web/utils/format.d.ts +2 -0
- package/dist/platform/cli/web/utils/format.d.ts.map +1 -0
- package/dist/platform/cli/web/utils/format.js +28 -0
- package/dist/platform/cli/web/utils/format.js.map +1 -0
- package/dist/platform/cli/web/utils/header.d.ts +3 -0
- package/dist/platform/cli/web/utils/header.d.ts.map +1 -0
- package/dist/platform/cli/web/utils/header.js +11 -0
- package/dist/platform/cli/web/utils/header.js.map +1 -0
- package/dist/platform/cli/web/utils/logger.d.ts +10 -0
- package/dist/platform/cli/web/utils/logger.d.ts.map +1 -0
- package/dist/platform/cli/web/utils/logger.js +47 -0
- package/dist/platform/cli/web/utils/logger.js.map +1 -0
- package/dist/platform/cli/web/utils/names.d.ts +7 -0
- package/dist/platform/cli/web/utils/names.d.ts.map +1 -0
- package/dist/platform/cli/web/utils/names.js +43 -0
- package/dist/platform/cli/web/utils/names.js.map +1 -0
- package/dist/platform/cli/web/utils/resolve-paths.d.ts +10 -0
- package/dist/platform/cli/web/utils/resolve-paths.d.ts.map +1 -0
- package/dist/platform/cli/web/utils/resolve-paths.js +87 -0
- package/dist/platform/cli/web/utils/resolve-paths.js.map +1 -0
- package/dist/platform/cli/web/utils/write-file.d.ts +7 -0
- package/dist/platform/cli/web/utils/write-file.d.ts.map +1 -0
- package/dist/platform/cli/web/utils/write-file.js +31 -0
- package/dist/platform/cli/web/utils/write-file.js.map +1 -0
- package/dist/platform/web/application.d.ts.map +1 -1
- package/dist/platform/web/application.js +2 -0
- package/dist/platform/web/application.js.map +1 -1
- package/dist/platform/web/bootstrap/RouteRegistrar.d.ts +2 -0
- package/dist/platform/web/bootstrap/RouteRegistrar.d.ts.map +1 -1
- package/dist/platform/web/bootstrap/RouteRegistrar.js +33 -4
- package/dist/platform/web/bootstrap/RouteRegistrar.js.map +1 -1
- package/dist/shared/config.utils.d.ts +1 -0
- package/dist/shared/config.utils.d.ts.map +1 -1
- package/dist/shared/config.utils.js +36 -11
- package/dist/shared/config.utils.js.map +1 -1
- package/dist/shared/env.utils.d.ts +6 -1
- package/dist/shared/env.utils.d.ts.map +1 -1
- package/dist/shared/env.utils.js +92 -9
- package/dist/shared/env.utils.js.map +1 -1
- package/dist/shared/runtime.resolver.d.ts +1 -0
- package/dist/shared/runtime.resolver.d.ts.map +1 -1
- package/dist/shared/runtime.resolver.js +27 -6
- package/dist/shared/runtime.resolver.js.map +1 -1
- package/dist/web/cli/commands/create/feature.d.ts +11 -0
- package/dist/web/cli/commands/create/feature.d.ts.map +1 -0
- package/dist/web/cli/commands/create/feature.js +43 -0
- package/dist/web/cli/commands/create/feature.js.map +1 -0
- package/dist/web/cli/commands/create/module.d.ts +11 -0
- package/dist/web/cli/commands/create/module.d.ts.map +1 -0
- package/dist/web/cli/commands/create/module.js +44 -0
- package/dist/web/cli/commands/create/module.js.map +1 -0
- package/dist/web/cli/commands/create/mvvm.d.ts +11 -0
- package/dist/web/cli/commands/create/mvvm.d.ts.map +1 -0
- package/dist/web/cli/commands/create/mvvm.js +43 -0
- package/dist/web/cli/commands/create/mvvm.js.map +1 -0
- package/dist/web/cli/commands/init-fullstack.d.ts +12 -0
- package/dist/web/cli/commands/init-fullstack.d.ts.map +1 -0
- package/dist/web/cli/commands/init-fullstack.js +42 -0
- package/dist/web/cli/commands/init-fullstack.js.map +1 -0
- package/dist/web/cli/commands/init-web.d.ts +12 -0
- package/dist/web/cli/commands/init-web.d.ts.map +1 -0
- package/dist/web/cli/commands/init-web.js +70 -0
- package/dist/web/cli/commands/init-web.js.map +1 -0
- package/dist/web/cli/commands/install-api.d.ts +10 -0
- package/dist/web/cli/commands/install-api.d.ts.map +1 -0
- package/dist/web/cli/commands/install-api.js +91 -0
- package/dist/web/cli/commands/install-api.js.map +1 -0
- package/dist/web/cli/commands/install-web.d.ts +12 -0
- package/dist/web/cli/commands/install-web.d.ts.map +1 -0
- package/dist/web/cli/commands/install-web.js +101 -0
- package/dist/web/cli/commands/install-web.js.map +1 -0
- package/dist/web/cli/commands/make/component.d.ts +13 -0
- package/dist/web/cli/commands/make/component.d.ts.map +1 -0
- package/dist/web/cli/commands/make/component.js +40 -0
- package/dist/web/cli/commands/make/component.js.map +1 -0
- package/dist/web/cli/commands/make/guard.d.ts +11 -0
- package/dist/web/cli/commands/make/guard.d.ts.map +1 -0
- package/dist/web/cli/commands/make/guard.js +37 -0
- package/dist/web/cli/commands/make/guard.js.map +1 -0
- package/dist/web/cli/commands/make/layout.d.ts +11 -0
- package/dist/web/cli/commands/make/layout.d.ts.map +1 -0
- package/dist/web/cli/commands/make/layout.js +37 -0
- package/dist/web/cli/commands/make/layout.js.map +1 -0
- package/dist/web/cli/commands/make/page.d.ts +14 -0
- package/dist/web/cli/commands/make/page.d.ts.map +1 -0
- package/dist/web/cli/commands/make/page.js +42 -0
- package/dist/web/cli/commands/make/page.js.map +1 -0
- package/dist/web/cli/commands/make/resource.d.ts +13 -0
- package/dist/web/cli/commands/make/resource.d.ts.map +1 -0
- package/dist/web/cli/commands/make/resource.js +33 -0
- package/dist/web/cli/commands/make/resource.js.map +1 -0
- package/dist/web/cli/commands/make/service.d.ts +14 -0
- package/dist/web/cli/commands/make/service.d.ts.map +1 -0
- package/dist/web/cli/commands/make/service.js +56 -0
- package/dist/web/cli/commands/make/service.js.map +1 -0
- package/dist/web/cli/commands/make/store.d.ts +14 -0
- package/dist/web/cli/commands/make/store.d.ts.map +1 -0
- package/dist/web/cli/commands/make/store.js +47 -0
- package/dist/web/cli/commands/make/store.js.map +1 -0
- package/dist/web/cli/commands/web-sync.d.ts +10 -0
- package/dist/web/cli/commands/web-sync.d.ts.map +1 -0
- package/dist/web/cli/commands/web-sync.js +48 -0
- package/dist/web/cli/commands/web-sync.js.map +1 -0
- package/dist/web/cli/index.d.mts +5 -0
- package/dist/web/cli/index.d.ts +5 -0
- package/dist/web/cli/index.d.ts.map +1 -0
- package/dist/web/cli/index.js +36 -0
- package/dist/web/cli/index.js.map +1 -0
- package/dist/web/cli/index.mjs +984 -0
- package/dist/web/cli/utils/config.d.ts +52 -0
- package/dist/web/cli/utils/config.d.ts.map +1 -0
- package/dist/web/cli/utils/config.js +89 -0
- package/dist/web/cli/utils/config.js.map +1 -0
- package/dist/web/cli/utils/format.d.ts +2 -0
- package/dist/web/cli/utils/format.d.ts.map +1 -0
- package/dist/web/cli/utils/format.js +28 -0
- package/dist/web/cli/utils/format.js.map +1 -0
- package/dist/web/cli/utils/logger.d.ts +10 -0
- package/dist/web/cli/utils/logger.d.ts.map +1 -0
- package/dist/web/cli/utils/logger.js +34 -0
- package/dist/web/cli/utils/logger.js.map +1 -0
- package/dist/web/cli/utils/names.d.ts +7 -0
- package/dist/web/cli/utils/names.d.ts.map +1 -0
- package/dist/web/cli/utils/names.js +43 -0
- package/dist/web/cli/utils/names.js.map +1 -0
- package/dist/web/cli/utils/resolve-paths.d.ts +10 -0
- package/dist/web/cli/utils/resolve-paths.d.ts.map +1 -0
- package/dist/web/cli/utils/resolve-paths.js +87 -0
- package/dist/web/cli/utils/resolve-paths.js.map +1 -0
- package/dist/web/cli/utils/write-file.d.ts +7 -0
- package/dist/web/cli/utils/write-file.d.ts.map +1 -0
- package/dist/web/cli/utils/write-file.js +31 -0
- package/dist/web/cli/utils/write-file.js.map +1 -0
- package/dist/web/platform/cli/web/index.d.mts +5 -0
- package/dist/web/platform/cli/web/index.d.ts +5 -0
- package/dist/web/platform/cli/web/index.js +2035 -0
- package/dist/web/platform/cli/web/index.mjs +1998 -0
- package/dist/web/src/adapters/jotai.d.ts +2 -0
- package/dist/web/src/adapters/jotai.d.ts.map +1 -0
- package/dist/web/src/adapters/jotai.js +7 -0
- package/dist/web/src/adapters/jotai.js.map +1 -0
- package/dist/web/src/adapters/mobx.d.ts +2 -0
- package/dist/web/src/adapters/mobx.d.ts.map +1 -0
- package/dist/web/src/adapters/mobx.js +7 -0
- package/dist/web/src/adapters/mobx.js.map +1 -0
- package/dist/web/src/adapters/redux.d.ts +2 -0
- package/dist/web/src/adapters/redux.d.ts.map +1 -0
- package/dist/web/src/adapters/redux.js +7 -0
- package/dist/web/src/adapters/redux.js.map +1 -0
- package/dist/web/src/adapters/zustand.d.ts +2 -0
- package/dist/web/src/adapters/zustand.d.ts.map +1 -0
- package/dist/web/src/adapters/zustand.js +7 -0
- package/dist/web/src/adapters/zustand.js.map +1 -0
- package/dist/web/src/config/web-config.d.ts +34 -0
- package/dist/web/src/config/web-config.d.ts.map +1 -0
- package/dist/web/src/config/web-config.js +73 -0
- package/dist/web/src/config/web-config.js.map +1 -0
- package/dist/web/src/core/application.d.ts +8 -0
- package/dist/web/src/core/application.d.ts.map +1 -0
- package/dist/web/src/core/application.js +45 -0
- package/dist/web/src/core/application.js.map +1 -0
- package/dist/web/src/core/decorators/component.d.ts +20 -0
- package/dist/web/src/core/decorators/component.d.ts.map +1 -0
- package/dist/web/src/core/decorators/component.js +83 -0
- package/dist/web/src/core/decorators/component.js.map +1 -0
- package/dist/web/src/core/decorators/page.d.ts +27 -0
- package/dist/web/src/core/decorators/page.d.ts.map +1 -0
- package/dist/web/src/core/decorators/page.js +58 -0
- package/dist/web/src/core/decorators/page.js.map +1 -0
- package/dist/web/src/core/di/container.d.ts +8 -0
- package/dist/web/src/core/di/container.d.ts.map +1 -0
- package/dist/web/src/core/di/container.js +26 -0
- package/dist/web/src/core/di/container.js.map +1 -0
- package/dist/web/src/core/runtime.d.ts +3 -0
- package/dist/web/src/core/runtime.d.ts.map +1 -0
- package/dist/web/src/core/runtime.js +15 -0
- package/dist/web/src/core/runtime.js.map +1 -0
- package/dist/web/src/http/fragment-fetch.d.ts +55 -0
- package/dist/web/src/http/fragment-fetch.d.ts.map +1 -0
- package/dist/web/src/http/fragment-fetch.js +290 -0
- package/dist/web/src/http/fragment-fetch.js.map +1 -0
- package/dist/web/src/index.d.mts +137 -0
- package/dist/web/src/index.d.ts +7 -0
- package/dist/web/src/index.d.ts.map +1 -0
- package/dist/web/src/index.js +31 -0
- package/dist/web/src/index.js.map +1 -0
- package/dist/web/src/index.mjs +643 -0
- package/dist/web/src/router/fragment-router.d.ts +14 -0
- package/dist/web/src/router/fragment-router.d.ts.map +1 -0
- package/dist/web/src/router/fragment-router.js +94 -0
- package/dist/web/src/router/fragment-router.js.map +1 -0
- package/dist/web/web/src/index.d.mts +137 -0
- package/dist/web/web/src/index.d.ts +137 -0
- package/dist/web/web/src/index.js +702 -0
- package/dist/web/web/src/index.mjs +644 -0
- package/package.json +15 -3
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RouterInternals = void 0;
|
|
4
|
+
exports.FragmentRouter = FragmentRouter;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const react_router_dom_1 = require("react-router-dom");
|
|
8
|
+
const page_1 = require("../core/decorators/page");
|
|
9
|
+
const fragment_fetch_1 = require("../http/fragment-fetch");
|
|
10
|
+
const runtime_1 = require("../core/runtime");
|
|
11
|
+
function prefixMatch(route, pathname) {
|
|
12
|
+
if (route === "/")
|
|
13
|
+
return pathname === "/";
|
|
14
|
+
return pathname === route || pathname.startsWith(`${route}/`);
|
|
15
|
+
}
|
|
16
|
+
async function resolveSession(config) {
|
|
17
|
+
if (config.fetch.tokenTransport === "cookie") {
|
|
18
|
+
try {
|
|
19
|
+
await fragment_fetch_1.FragmentFetch.get("/auth/me", { skipAuth: true });
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return Boolean(fragment_fetch_1.FragmentFetch.getToken());
|
|
27
|
+
}
|
|
28
|
+
function routeNeedsAuth(path, config) {
|
|
29
|
+
return config.authenticatedRoutes.some((route) => prefixMatch(route, path));
|
|
30
|
+
}
|
|
31
|
+
function routeIsPublic(path, config) {
|
|
32
|
+
return config.publicRoutes.some((route) => prefixMatch(route, path));
|
|
33
|
+
}
|
|
34
|
+
function extractRedirectPath(mode, fallback = "/login") {
|
|
35
|
+
if (!mode)
|
|
36
|
+
return fallback;
|
|
37
|
+
if (mode.startsWith("redirect:"))
|
|
38
|
+
return mode.slice("redirect:".length);
|
|
39
|
+
return fallback;
|
|
40
|
+
}
|
|
41
|
+
function PageRoute({ page, config }) {
|
|
42
|
+
const [checking, setChecking] = (0, react_1.useState)(true);
|
|
43
|
+
const [authenticated, setAuthenticated] = (0, react_1.useState)(false);
|
|
44
|
+
const [guardAllowed, setGuardAllowed] = (0, react_1.useState)(true);
|
|
45
|
+
(0, react_1.useEffect)(() => {
|
|
46
|
+
let cancelled = false;
|
|
47
|
+
(async () => {
|
|
48
|
+
const isAuthed = await resolveSession(config);
|
|
49
|
+
if (cancelled)
|
|
50
|
+
return;
|
|
51
|
+
setAuthenticated(isAuthed);
|
|
52
|
+
if (page.guard) {
|
|
53
|
+
const guard = new page.guard();
|
|
54
|
+
if (typeof guard.canActivate === "function") {
|
|
55
|
+
const result = await Promise.resolve(guard.canActivate());
|
|
56
|
+
if (!cancelled) {
|
|
57
|
+
setGuardAllowed(result !== false);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (!cancelled) {
|
|
62
|
+
setChecking(false);
|
|
63
|
+
}
|
|
64
|
+
})();
|
|
65
|
+
return () => {
|
|
66
|
+
cancelled = true;
|
|
67
|
+
};
|
|
68
|
+
}, [config]);
|
|
69
|
+
if (checking) {
|
|
70
|
+
return (0, jsx_runtime_1.jsx)("div", { children: "Loading..." });
|
|
71
|
+
}
|
|
72
|
+
const needsAuth = routeNeedsAuth(page.path, config);
|
|
73
|
+
const isPublic = routeIsPublic(page.path, config) || !needsAuth;
|
|
74
|
+
if (needsAuth && !authenticated) {
|
|
75
|
+
return (0, jsx_runtime_1.jsx)(react_router_dom_1.Navigate, { to: extractRedirectPath(config.fetch.onUnauthorized, "/login"), replace: true });
|
|
76
|
+
}
|
|
77
|
+
if (isPublic && page.redirectIfAuthenticated && authenticated) {
|
|
78
|
+
return (0, jsx_runtime_1.jsx)(react_router_dom_1.Navigate, { to: page.redirectIfAuthenticated, replace: true });
|
|
79
|
+
}
|
|
80
|
+
if (!guardAllowed) {
|
|
81
|
+
return (0, jsx_runtime_1.jsx)(react_router_dom_1.Navigate, { to: extractRedirectPath(config.fetch.onForbidden, "/403"), replace: true });
|
|
82
|
+
}
|
|
83
|
+
return (0, runtime_1.renderPageInstance)(page.target);
|
|
84
|
+
}
|
|
85
|
+
function FragmentRouter({ config }) {
|
|
86
|
+
const pages = (0, react_1.useMemo)(() => (0, page_1.getPages)(), []);
|
|
87
|
+
return ((0, jsx_runtime_1.jsx)(react_router_dom_1.BrowserRouter, { basename: config.webRoot, children: (0, jsx_runtime_1.jsx)(react_router_dom_1.Routes, { children: pages.map((page) => ((0, jsx_runtime_1.jsx)(react_router_dom_1.Route, { path: page.path, element: (0, jsx_runtime_1.jsx)(PageRoute, { page: page, config: config }) }, page.path))) }) }));
|
|
88
|
+
}
|
|
89
|
+
exports.RouterInternals = {
|
|
90
|
+
prefixMatch,
|
|
91
|
+
routeNeedsAuth,
|
|
92
|
+
routeIsPublic,
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=fragment-router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fragment-router.js","sourceRoot":"","sources":["../../../../src/web/src/router/fragment-router.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
interface FragmentFetchConfig {
|
|
2
|
+
baseUrl: string;
|
|
3
|
+
timeout?: number;
|
|
4
|
+
retries?: number;
|
|
5
|
+
retryDelay?: number;
|
|
6
|
+
headers?: Record<string, string>;
|
|
7
|
+
tokenTransport?: "cookie" | "localStorage" | "memory";
|
|
8
|
+
tokenKey?: string;
|
|
9
|
+
onUnauthorized?: "throw" | `redirect:${string}` | "silent";
|
|
10
|
+
onForbidden?: "throw" | `redirect:${string}` | "silent";
|
|
11
|
+
onError?: (err: FragmentHttpError) => void;
|
|
12
|
+
}
|
|
13
|
+
interface RequestOptions {
|
|
14
|
+
headers?: Record<string, string>;
|
|
15
|
+
params?: Record<string, string | number | boolean | Array<string | number | boolean>>;
|
|
16
|
+
timeout?: number;
|
|
17
|
+
retries?: number;
|
|
18
|
+
skipAuth?: boolean;
|
|
19
|
+
signal?: AbortSignal;
|
|
20
|
+
}
|
|
21
|
+
declare class FragmentHttpError extends Error {
|
|
22
|
+
status: number;
|
|
23
|
+
statusText: string;
|
|
24
|
+
body: unknown;
|
|
25
|
+
request: Request;
|
|
26
|
+
response: Response;
|
|
27
|
+
constructor(message: string, init: {
|
|
28
|
+
status: number;
|
|
29
|
+
statusText: string;
|
|
30
|
+
body: unknown;
|
|
31
|
+
request: Request;
|
|
32
|
+
response: Response;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
type RequestInterceptor = (request: Request) => Promise<Request> | Request;
|
|
36
|
+
type ResponseInterceptor = (response: Response, context: {
|
|
37
|
+
request: Request;
|
|
38
|
+
error?: FragmentHttpError;
|
|
39
|
+
}) => Promise<Response> | Response;
|
|
40
|
+
declare const FragmentFetch: {
|
|
41
|
+
configure(config: FragmentFetchConfig): void;
|
|
42
|
+
get<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
43
|
+
post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
|
|
44
|
+
put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
|
|
45
|
+
patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
|
|
46
|
+
delete<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
47
|
+
request<T>(path: string, init?: RequestInit, options?: RequestOptions): Promise<T>;
|
|
48
|
+
setToken(token: string): void;
|
|
49
|
+
clearToken(): void;
|
|
50
|
+
getToken(): string | null;
|
|
51
|
+
addRequestInterceptor(fn: RequestInterceptor): () => void;
|
|
52
|
+
addResponseInterceptor(fn: ResponseInterceptor): () => void;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
declare function FragmentWebApplication(options: {
|
|
56
|
+
rootElement: string;
|
|
57
|
+
strict?: boolean;
|
|
58
|
+
}): ClassDecorator;
|
|
59
|
+
declare class FragmentWebUIApplication {
|
|
60
|
+
bootstrap(applicationClass: new () => unknown): Promise<void>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare function Component(options?: {
|
|
64
|
+
tag?: string;
|
|
65
|
+
memo?: boolean;
|
|
66
|
+
displayName?: string;
|
|
67
|
+
}): ClassDecorator;
|
|
68
|
+
declare function State(initial: unknown): PropertyDecorator;
|
|
69
|
+
declare function Computed(deps?: string[]): MethodDecorator;
|
|
70
|
+
declare function Effect(options: {
|
|
71
|
+
on: "mount" | "update" | "unmount";
|
|
72
|
+
deps?: string[];
|
|
73
|
+
}): MethodDecorator;
|
|
74
|
+
declare function Watch(key: string): MethodDecorator;
|
|
75
|
+
declare function Store(store: unknown, selector?: (state: any) => unknown): PropertyDecorator;
|
|
76
|
+
declare function Prop(defaultValue?: unknown): PropertyDecorator;
|
|
77
|
+
declare function Ref(): PropertyDecorator;
|
|
78
|
+
declare function Inject(token: unknown): PropertyDecorator;
|
|
79
|
+
declare function FragmentService(): ClassDecorator;
|
|
80
|
+
declare function Injectable(_scope?: "singleton" | "transient"): ClassDecorator;
|
|
81
|
+
|
|
82
|
+
declare function Page(options: {
|
|
83
|
+
path: string;
|
|
84
|
+
title?: string;
|
|
85
|
+
layout?: string;
|
|
86
|
+
}): ClassDecorator;
|
|
87
|
+
declare function Layout(options: {
|
|
88
|
+
name: string;
|
|
89
|
+
}): ClassDecorator;
|
|
90
|
+
declare function Guard(guardClass: new (...args: any[]) => {
|
|
91
|
+
canActivate?: () => boolean | Promise<boolean>;
|
|
92
|
+
}): ClassDecorator;
|
|
93
|
+
declare function Param(_name: string): PropertyDecorator;
|
|
94
|
+
declare function Query(_name: string, _defaultValue?: string): PropertyDecorator;
|
|
95
|
+
declare function RedirectIfAuthenticated(to?: string): ClassDecorator;
|
|
96
|
+
|
|
97
|
+
type Token<T = unknown> = string | symbol | (new (...args: any[]) => T);
|
|
98
|
+
declare class DIContainer {
|
|
99
|
+
private static providers;
|
|
100
|
+
static register<T>(token: Token<T>, value: T): void;
|
|
101
|
+
static resolve<T>(token: Token<T>): T;
|
|
102
|
+
static clear(): void;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
type StructureMode = "layered" | "module" | "feature" | "mvvm";
|
|
106
|
+
type StoreAdapter = "zustand" | "jotai" | "redux" | "mobx";
|
|
107
|
+
interface FragmentWebConfig {
|
|
108
|
+
webRoot: string;
|
|
109
|
+
serverRoot: string;
|
|
110
|
+
publicRoutes: string[];
|
|
111
|
+
authenticatedRoutes: string[];
|
|
112
|
+
app: {
|
|
113
|
+
name: string;
|
|
114
|
+
rootElement: string;
|
|
115
|
+
strict: boolean;
|
|
116
|
+
router: "react-router";
|
|
117
|
+
stateAdapter: StoreAdapter;
|
|
118
|
+
};
|
|
119
|
+
fetch: {
|
|
120
|
+
baseUrl: string;
|
|
121
|
+
timeout?: number;
|
|
122
|
+
retries?: number;
|
|
123
|
+
retryDelay?: number;
|
|
124
|
+
headers?: Record<string, string>;
|
|
125
|
+
tokenTransport?: "cookie" | "localStorage" | "memory";
|
|
126
|
+
tokenKey?: string;
|
|
127
|
+
onUnauthorized?: "throw" | `redirect:${string}` | "silent";
|
|
128
|
+
onForbidden?: "throw" | `redirect:${string}` | "silent";
|
|
129
|
+
};
|
|
130
|
+
structure: StructureMode;
|
|
131
|
+
di: {
|
|
132
|
+
autoScan: boolean;
|
|
133
|
+
scanPaths: string[];
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export { Component, Computed, DIContainer, Effect, FragmentFetch, FragmentHttpError, FragmentService, FragmentWebApplication, type FragmentWebConfig, FragmentWebUIApplication, Guard, Inject, Injectable, Layout, Page, Param, Prop, Query, RedirectIfAuthenticated, Ref, State, Store, Watch };
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
interface FragmentFetchConfig {
|
|
2
|
+
baseUrl: string;
|
|
3
|
+
timeout?: number;
|
|
4
|
+
retries?: number;
|
|
5
|
+
retryDelay?: number;
|
|
6
|
+
headers?: Record<string, string>;
|
|
7
|
+
tokenTransport?: "cookie" | "localStorage" | "memory";
|
|
8
|
+
tokenKey?: string;
|
|
9
|
+
onUnauthorized?: "throw" | `redirect:${string}` | "silent";
|
|
10
|
+
onForbidden?: "throw" | `redirect:${string}` | "silent";
|
|
11
|
+
onError?: (err: FragmentHttpError) => void;
|
|
12
|
+
}
|
|
13
|
+
interface RequestOptions {
|
|
14
|
+
headers?: Record<string, string>;
|
|
15
|
+
params?: Record<string, string | number | boolean | Array<string | number | boolean>>;
|
|
16
|
+
timeout?: number;
|
|
17
|
+
retries?: number;
|
|
18
|
+
skipAuth?: boolean;
|
|
19
|
+
signal?: AbortSignal;
|
|
20
|
+
}
|
|
21
|
+
declare class FragmentHttpError extends Error {
|
|
22
|
+
status: number;
|
|
23
|
+
statusText: string;
|
|
24
|
+
body: unknown;
|
|
25
|
+
request: Request;
|
|
26
|
+
response: Response;
|
|
27
|
+
constructor(message: string, init: {
|
|
28
|
+
status: number;
|
|
29
|
+
statusText: string;
|
|
30
|
+
body: unknown;
|
|
31
|
+
request: Request;
|
|
32
|
+
response: Response;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
type RequestInterceptor = (request: Request) => Promise<Request> | Request;
|
|
36
|
+
type ResponseInterceptor = (response: Response, context: {
|
|
37
|
+
request: Request;
|
|
38
|
+
error?: FragmentHttpError;
|
|
39
|
+
}) => Promise<Response> | Response;
|
|
40
|
+
declare const FragmentFetch: {
|
|
41
|
+
configure(config: FragmentFetchConfig): void;
|
|
42
|
+
get<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
43
|
+
post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
|
|
44
|
+
put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
|
|
45
|
+
patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
|
|
46
|
+
delete<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
47
|
+
request<T>(path: string, init?: RequestInit, options?: RequestOptions): Promise<T>;
|
|
48
|
+
setToken(token: string): void;
|
|
49
|
+
clearToken(): void;
|
|
50
|
+
getToken(): string | null;
|
|
51
|
+
addRequestInterceptor(fn: RequestInterceptor): () => void;
|
|
52
|
+
addResponseInterceptor(fn: ResponseInterceptor): () => void;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
declare function FragmentWebApplication(options: {
|
|
56
|
+
rootElement: string;
|
|
57
|
+
strict?: boolean;
|
|
58
|
+
}): ClassDecorator;
|
|
59
|
+
declare class FragmentWebUIApplication {
|
|
60
|
+
bootstrap(applicationClass: new () => unknown): Promise<void>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare function Component(options?: {
|
|
64
|
+
tag?: string;
|
|
65
|
+
memo?: boolean;
|
|
66
|
+
displayName?: string;
|
|
67
|
+
}): ClassDecorator;
|
|
68
|
+
declare function State(initial: unknown): PropertyDecorator;
|
|
69
|
+
declare function Computed(deps?: string[]): MethodDecorator;
|
|
70
|
+
declare function Effect(options: {
|
|
71
|
+
on: "mount" | "update" | "unmount";
|
|
72
|
+
deps?: string[];
|
|
73
|
+
}): MethodDecorator;
|
|
74
|
+
declare function Watch(key: string): MethodDecorator;
|
|
75
|
+
declare function Store(store: unknown, selector?: (state: any) => unknown): PropertyDecorator;
|
|
76
|
+
declare function Prop(defaultValue?: unknown): PropertyDecorator;
|
|
77
|
+
declare function Ref(): PropertyDecorator;
|
|
78
|
+
declare function Inject(token: unknown): PropertyDecorator;
|
|
79
|
+
declare function FragmentService(): ClassDecorator;
|
|
80
|
+
declare function Injectable(_scope?: "singleton" | "transient"): ClassDecorator;
|
|
81
|
+
|
|
82
|
+
declare function Page(options: {
|
|
83
|
+
path: string;
|
|
84
|
+
title?: string;
|
|
85
|
+
layout?: string;
|
|
86
|
+
}): ClassDecorator;
|
|
87
|
+
declare function Layout(options: {
|
|
88
|
+
name: string;
|
|
89
|
+
}): ClassDecorator;
|
|
90
|
+
declare function Guard(guardClass: new (...args: any[]) => {
|
|
91
|
+
canActivate?: () => boolean | Promise<boolean>;
|
|
92
|
+
}): ClassDecorator;
|
|
93
|
+
declare function Param(_name: string): PropertyDecorator;
|
|
94
|
+
declare function Query(_name: string, _defaultValue?: string): PropertyDecorator;
|
|
95
|
+
declare function RedirectIfAuthenticated(to?: string): ClassDecorator;
|
|
96
|
+
|
|
97
|
+
type Token<T = unknown> = string | symbol | (new (...args: any[]) => T);
|
|
98
|
+
declare class DIContainer {
|
|
99
|
+
private static providers;
|
|
100
|
+
static register<T>(token: Token<T>, value: T): void;
|
|
101
|
+
static resolve<T>(token: Token<T>): T;
|
|
102
|
+
static clear(): void;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
type StructureMode = "layered" | "module" | "feature" | "mvvm";
|
|
106
|
+
type StoreAdapter = "zustand" | "jotai" | "redux" | "mobx";
|
|
107
|
+
interface FragmentWebConfig {
|
|
108
|
+
webRoot: string;
|
|
109
|
+
serverRoot: string;
|
|
110
|
+
publicRoutes: string[];
|
|
111
|
+
authenticatedRoutes: string[];
|
|
112
|
+
app: {
|
|
113
|
+
name: string;
|
|
114
|
+
rootElement: string;
|
|
115
|
+
strict: boolean;
|
|
116
|
+
router: "react-router";
|
|
117
|
+
stateAdapter: StoreAdapter;
|
|
118
|
+
};
|
|
119
|
+
fetch: {
|
|
120
|
+
baseUrl: string;
|
|
121
|
+
timeout?: number;
|
|
122
|
+
retries?: number;
|
|
123
|
+
retryDelay?: number;
|
|
124
|
+
headers?: Record<string, string>;
|
|
125
|
+
tokenTransport?: "cookie" | "localStorage" | "memory";
|
|
126
|
+
tokenKey?: string;
|
|
127
|
+
onUnauthorized?: "throw" | `redirect:${string}` | "silent";
|
|
128
|
+
onForbidden?: "throw" | `redirect:${string}` | "silent";
|
|
129
|
+
};
|
|
130
|
+
structure: StructureMode;
|
|
131
|
+
di: {
|
|
132
|
+
autoScan: boolean;
|
|
133
|
+
scanPaths: string[];
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export { Component, Computed, DIContainer, Effect, FragmentFetch, FragmentHttpError, FragmentService, FragmentWebApplication, type FragmentWebConfig, FragmentWebUIApplication, Guard, Inject, Injectable, Layout, Page, Param, Prop, Query, RedirectIfAuthenticated, Ref, State, Store, Watch };
|