@noego/forge 0.0.2 → 0.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/dist/client.cjs +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.ts +126 -2
- package/dist/client.mjs +118 -538
- package/dist/client.mjs.map +1 -1
- package/dist/index-D3Pt-y7F.cjs +2 -0
- package/dist/index-D3Pt-y7F.cjs.map +1 -0
- package/dist/index-DFgPI13E.js +96 -0
- package/dist/index-DFgPI13E.js.map +1 -0
- package/dist/page.cjs +1 -1
- package/dist/page.cjs.map +1 -1
- package/dist/page.d.ts +34 -2
- package/dist/page.mjs +41 -3
- package/dist/page.mjs.map +1 -1
- package/dist/shared.cjs +1 -1
- package/dist/shared.d.ts +25 -2
- package/dist/shared.mjs +2 -2
- package/dist-ssr/server.cjs +69 -107
- package/dist-ssr/server.cjs.map +1 -1
- package/dist-ssr/server.d.ts +46 -2
- package/dist-ssr/server.js +67 -88
- package/dist-ssr/server.js.map +1 -1
- package/dist-ssr/shared.cjs +5 -28
- package/dist-ssr/shared.cjs.map +1 -1
- package/dist-ssr/shared.d.ts +25 -2
- package/dist-ssr/shared.js +1 -27
- package/dist-ssr/shared.js.map +1 -1
- package/package.json +13 -1
- package/src/components/RecursiveRender.svelte +35 -0
- package/dist/client/client.d.ts +0 -8
- package/dist/client/client.d.ts.map +0 -1
- package/dist/client/events.d.ts +0 -4
- package/dist/client/events.d.ts.map +0 -1
- package/dist/client/index.d.ts +0 -6
- package/dist/client/index.d.ts.map +0 -1
- package/dist/client/navigation.svelte.d.ts +0 -4
- package/dist/client/navigation.svelte.d.ts.map +0 -1
- package/dist/client/page.svelte.d.ts +0 -4
- package/dist/client/page.svelte.d.ts.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/options/ServerOptions.d.ts +0 -16
- package/dist/options/ServerOptions.d.ts.map +0 -1
- package/dist/page.svelte-C4chAYK2.js +0 -137
- package/dist/page.svelte-C4chAYK2.js.map +0 -1
- package/dist/page.svelte-Dvj7306U.cjs +0 -2
- package/dist/page.svelte-Dvj7306U.cjs.map +0 -1
- package/dist/parser/IRoute.d.ts +0 -31
- package/dist/parser/IRoute.d.ts.map +0 -1
- package/dist/parser/openapi.d.ts +0 -9
- package/dist/parser/openapi.d.ts.map +0 -1
- package/dist/parser/path.d.ts +0 -9
- package/dist/parser/path.d.ts.map +0 -1
- package/dist/routing/base.d.ts +0 -10
- package/dist/routing/base.d.ts.map +0 -1
- package/dist/routing/component_loader/component_loader.d.ts +0 -27
- package/dist/routing/component_loader/component_loader.d.ts.map +0 -1
- package/dist/routing/component_loader/component_manager.d.ts +0 -12
- package/dist/routing/component_loader/component_manager.d.ts.map +0 -1
- package/dist/routing/html_render/html_render.d.ts +0 -20
- package/dist/routing/html_render/html_render.d.ts.map +0 -1
- package/dist/routing/manifest/base.d.ts +0 -11
- package/dist/routing/manifest/base.d.ts.map +0 -1
- package/dist/routing/manifest/store.svelte.d.ts +0 -3
- package/dist/routing/manifest/store.svelte.d.ts.map +0 -1
- package/dist/routing/page.d.ts +0 -7
- package/dist/routing/page.d.ts.map +0 -1
- package/dist/routing/server_adapter/api_adapter.d.ts +0 -23
- package/dist/routing/server_adapter/api_adapter.d.ts.map +0 -1
- package/dist/routing/server_adapter/express_server_adapter.d.ts +0 -20
- package/dist/routing/server_adapter/express_server_adapter.d.ts.map +0 -1
- package/dist/routing/server_adapter/middleware_adapter.d.ts +0 -12
- package/dist/routing/server_adapter/middleware_adapter.d.ts.map +0 -1
- package/dist/routing/server_adapter/server_adapter.d.ts +0 -5
- package/dist/routing/server_adapter/server_adapter.d.ts.map +0 -1
- package/dist/routing/shadow/shadow_route.d.ts +0 -2
- package/dist/routing/shadow/shadow_route.d.ts.map +0 -1
- package/dist/routing/url_parser.d.ts +0 -12
- package/dist/routing/url_parser.d.ts.map +0 -1
- package/dist/server/server.d.ts +0 -5
- package/dist/server/server.d.ts.map +0 -1
- package/dist/shared.d.ts.map +0 -1
- package/dist/types/Callback.d.ts +0 -2
- package/dist/types/Callback.d.ts.map +0 -1
- package/dist/types/FetchMiddleware.d.ts +0 -21
- package/dist/types/FetchMiddleware.d.ts.map +0 -1
- package/dist/vite-env.d.ts +0 -19
- package/dist-ssr/client/client.d.ts +0 -8
- package/dist-ssr/client/client.d.ts.map +0 -1
- package/dist-ssr/client/events.d.ts +0 -4
- package/dist-ssr/client/events.d.ts.map +0 -1
- package/dist-ssr/client/index.d.ts +0 -6
- package/dist-ssr/client/index.d.ts.map +0 -1
- package/dist-ssr/client/navigation.svelte.d.ts +0 -4
- package/dist-ssr/client/navigation.svelte.d.ts.map +0 -1
- package/dist-ssr/client/page.svelte.d.ts +0 -4
- package/dist-ssr/client/page.svelte.d.ts.map +0 -1
- package/dist-ssr/index.d.ts +0 -3
- package/dist-ssr/index.d.ts.map +0 -1
- package/dist-ssr/options/ServerOptions.d.ts +0 -16
- package/dist-ssr/options/ServerOptions.d.ts.map +0 -1
- package/dist-ssr/parser/IRoute.d.ts +0 -31
- package/dist-ssr/parser/IRoute.d.ts.map +0 -1
- package/dist-ssr/parser/openapi.d.ts +0 -9
- package/dist-ssr/parser/openapi.d.ts.map +0 -1
- package/dist-ssr/parser/path.d.ts +0 -9
- package/dist-ssr/parser/path.d.ts.map +0 -1
- package/dist-ssr/path-CyGuWUeq.cjs +0 -68
- package/dist-ssr/path-CyGuWUeq.cjs.map +0 -1
- package/dist-ssr/path-ODk1FhWY.js +0 -69
- package/dist-ssr/path-ODk1FhWY.js.map +0 -1
- package/dist-ssr/routing/base.d.ts +0 -10
- package/dist-ssr/routing/base.d.ts.map +0 -1
- package/dist-ssr/routing/component_loader/component_loader.d.ts +0 -27
- package/dist-ssr/routing/component_loader/component_loader.d.ts.map +0 -1
- package/dist-ssr/routing/component_loader/component_manager.d.ts +0 -12
- package/dist-ssr/routing/component_loader/component_manager.d.ts.map +0 -1
- package/dist-ssr/routing/html_render/html_render.d.ts +0 -20
- package/dist-ssr/routing/html_render/html_render.d.ts.map +0 -1
- package/dist-ssr/routing/manifest/base.d.ts +0 -11
- package/dist-ssr/routing/manifest/base.d.ts.map +0 -1
- package/dist-ssr/routing/manifest/store.svelte.d.ts +0 -3
- package/dist-ssr/routing/manifest/store.svelte.d.ts.map +0 -1
- package/dist-ssr/routing/page.d.ts +0 -7
- package/dist-ssr/routing/page.d.ts.map +0 -1
- package/dist-ssr/routing/server_adapter/api_adapter.d.ts +0 -23
- package/dist-ssr/routing/server_adapter/api_adapter.d.ts.map +0 -1
- package/dist-ssr/routing/server_adapter/express_server_adapter.d.ts +0 -20
- package/dist-ssr/routing/server_adapter/express_server_adapter.d.ts.map +0 -1
- package/dist-ssr/routing/server_adapter/middleware_adapter.d.ts +0 -12
- package/dist-ssr/routing/server_adapter/middleware_adapter.d.ts.map +0 -1
- package/dist-ssr/routing/server_adapter/server_adapter.d.ts +0 -5
- package/dist-ssr/routing/server_adapter/server_adapter.d.ts.map +0 -1
- package/dist-ssr/routing/shadow/shadow_route.d.ts +0 -2
- package/dist-ssr/routing/shadow/shadow_route.d.ts.map +0 -1
- package/dist-ssr/routing/url_parser.d.ts +0 -12
- package/dist-ssr/routing/url_parser.d.ts.map +0 -1
- package/dist-ssr/server/server.d.ts +0 -5
- package/dist-ssr/server/server.d.ts.map +0 -1
- package/dist-ssr/shared.d.ts.map +0 -1
- package/dist-ssr/types/Callback.d.ts +0 -2
- package/dist-ssr/types/Callback.d.ts.map +0 -1
- package/dist-ssr/types/FetchMiddleware.d.ts +0 -21
- package/dist-ssr/types/FetchMiddleware.d.ts.map +0 -1
- package/dist-ssr/vite-env.d.ts +0 -19
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
export let layouts = []
|
|
5
|
+
export let view = null
|
|
6
|
+
export let data = {} as any
|
|
7
|
+
export let params = {}
|
|
8
|
+
export let urlParams = {}
|
|
9
|
+
export let query = {}
|
|
10
|
+
export let page = null
|
|
11
|
+
|
|
12
|
+
console.log('[page]',page);
|
|
13
|
+
|
|
14
|
+
$: [topLayout,...childlayouts] = layouts
|
|
15
|
+
$: [top_data,...other_data] = data.layout || []
|
|
16
|
+
$: view_data = data.view
|
|
17
|
+
$: recursive_child_data = {
|
|
18
|
+
layout:other_data,
|
|
19
|
+
view:data.view
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
{#if childlayouts.length > 0}
|
|
24
|
+
<svelte:component this={topLayout} {...(top_data||{})} params={params} urlParams={urlParams} query={query} page={page}>
|
|
25
|
+
<svelte:self layouts={childlayouts} view={view} data={recursive_child_data} params={params} urlParams={urlParams} query={query} page={page}/>
|
|
26
|
+
</svelte:component>
|
|
27
|
+
{:else if topLayout}
|
|
28
|
+
<svelte:component this={topLayout} {...(top_data||{})} params={params} urlParams={urlParams} query={query} page={page}>
|
|
29
|
+
<svelte:component this={view} {...(view_data||{})} params={params} urlParams={urlParams} query={query} page={page}/>
|
|
30
|
+
</svelte:component>
|
|
31
|
+
{:else}
|
|
32
|
+
<svelte:component this={view} {...(view_data||{})} params={params} urlParams={urlParams} query={query} page={page}/>
|
|
33
|
+
{/if}
|
|
34
|
+
|
|
35
|
+
|
package/dist/client/client.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ServerOptions } from '../options/ServerOptions';
|
|
2
|
-
import { FetchMiddlewareAPI } from '../types/FetchMiddleware';
|
|
3
|
-
export declare const FORGE_LOAD_SYMBOL: unique symbol;
|
|
4
|
-
export declare const fetch: FetchMiddlewareAPI & {
|
|
5
|
-
getMiddlewareCount(): number;
|
|
6
|
-
};
|
|
7
|
-
export declare function createApp<T extends HTMLElement = HTMLElement>(node: T, options: ServerOptions): Promise<void>;
|
|
8
|
-
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAmB,kBAAkB,EAAsD,MAAM,0BAA0B,CAAC;AAGxI,eAAO,MAAM,iBAAiB,eAAgC,CAAC;AA4F/D,eAAO,MAAM,KAAK,EAAE,kBAAkB,GAAG;IAAE,kBAAkB,IAAI,MAAM,CAAA;CAwBtE,CAAC;AAIF,wBAAsB,SAAS,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAC/D,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,aAAa,GACvB,OAAO,CAAC,IAAI,CAAC,CAkCf"}
|
package/dist/client/events.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/client/events.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAQxD,wBAAgB,gBAAgB,CAAC,SAAS,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,QA+JxF"}
|
package/dist/client/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { createApp, fetch } from './client';
|
|
2
|
-
export { loadRoute, updateRoute } from './navigation.svelte';
|
|
3
|
-
export { bootstrap_events } from './events';
|
|
4
|
-
export { updateManifestStore, MANIFEST_STORE } from '../routing/manifest/store.svelte';
|
|
5
|
-
export { page, shadowUrl } from './page.svelte';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { IRoute } from '../parser/IRoute';
|
|
2
|
-
export declare function loadRoute(node: any, base_path: string, route: IRoute, combinedParams: any, urlParams: any, query: any): Promise<void>;
|
|
3
|
-
export declare function updateRoute(url: string, base_path: string, route: IRoute, params: any, urlParams: any, query: any, server_loading?: boolean, update?: boolean): Promise<void>;
|
|
4
|
-
//# sourceMappingURL=navigation.svelte.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.svelte.d.ts","sourceRoot":"","sources":["../../src/client/navigation.svelte.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAiC9C,wBAAsB,SAAS,CAAC,IAAI,EAAC,GAAG,EAAC,SAAS,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,SAAS,EAAC,GAAG,EAAE,KAAK,EAAC,GAAG,iBAwCtH;AAID,wBAAsB,WAAW,CAAC,GAAG,EAAC,MAAM,EAAC,SAAS,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAC,SAAS,EAAC,GAAG,EAAC,KAAK,EAAC,GAAG,EAAC,cAAc,GAAC,OAAe,EAAC,MAAM,UAAO,iBAgE7J"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.svelte.d.ts","sourceRoot":"","sources":["../../src/client/page.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAM7C,eAAO,IAAI,IAAI,OAKJ,CAAC;AAYZ,wBAAgB,SAAS,CAAC,OAAO,EAAC,MAAM,EAAE,GAAG,EAAE,MAAM,OAUpD"}
|
package/dist/index.d.ts
DELETED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { IHTMLRender } from '../routing/html_render/html_render';
|
|
2
|
-
export type htmlRenderer = 'default' | string | IHTMLRender;
|
|
3
|
-
export interface ServerOptions {
|
|
4
|
-
development?: boolean;
|
|
5
|
-
viteOptions?: any;
|
|
6
|
-
component_dir?: string;
|
|
7
|
-
build_dir?: string;
|
|
8
|
-
renderer?: htmlRenderer;
|
|
9
|
-
open_api_path?: string;
|
|
10
|
-
manifest_path?: string;
|
|
11
|
-
manifest_endpoint?: string;
|
|
12
|
-
assets?: Record<string, string[]>;
|
|
13
|
-
}
|
|
14
|
-
export declare const defaultViteOptions: any;
|
|
15
|
-
export declare const defaultOptions: ServerOptions;
|
|
16
|
-
//# sourceMappingURL=ServerOptions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ServerOptions.d.ts","sourceRoot":"","sources":["../../src/options/ServerOptions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAGtE,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,CAAC;AAE5D,MAAM,WAAW,aAAa;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAC,MAAM,EAAE,CAAC,CAAC;CACpC;AAGD,eAAO,MAAM,kBAAkB,EAAC,GAO/B,CAAC;AAGF,eAAO,MAAM,cAAc,EAAE,aAQ5B,CAAC"}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import * as A from "svelte/internal/client";
|
|
2
|
-
function _(o) {
|
|
3
|
-
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
4
|
-
}
|
|
5
|
-
var k, b;
|
|
6
|
-
function j() {
|
|
7
|
-
if (b) return k;
|
|
8
|
-
b = 1, k = s, typeof window < "u" && (window.pathToRegex = s);
|
|
9
|
-
const o = /([$.+*?=!:[\]{}(|)/\\])/g;
|
|
10
|
-
function f(e, t) {
|
|
11
|
-
return typeof e < "u" ? e : t;
|
|
12
|
-
}
|
|
13
|
-
function s(e, t) {
|
|
14
|
-
return this.init(e, t), this;
|
|
15
|
-
}
|
|
16
|
-
return s.prototype.init = function(e = "/", t = {}) {
|
|
17
|
-
this.options = {
|
|
18
|
-
case: typeof t.case == "boolean" ? t.case : !0,
|
|
19
|
-
separators: typeof t.separators == "string" ? t.separators : "/",
|
|
20
|
-
fromStart: typeof t.fromStart == "boolean" ? t.fromStart : !0,
|
|
21
|
-
toEnd: typeof t.toEnd == "boolean" ? t.toEnd : !0
|
|
22
|
-
}, this.options.separator = "[" + this.escape(this.options.separators) + "]", e instanceof RegExp ? this.restructureRegExp(e) : typeof e == "string" && this.restructurePath(e);
|
|
23
|
-
}, s.prototype.restructureRegExp = function(e) {
|
|
24
|
-
e = f(e, /.*/), this.keys = [], this.path = void 0, this.regstr = "" + e, this.regstr = this.regstr.substr(1, this.regstr.length - 2), this.regexp = new RegExp(
|
|
25
|
-
this.regstr,
|
|
26
|
-
this.options.case ? "" : "i"
|
|
27
|
-
);
|
|
28
|
-
}, s.prototype.restructurePath = function(e) {
|
|
29
|
-
e = f(e, "/"), this.keys = [], this.path = e, this.regstr = "";
|
|
30
|
-
const t = this.options.separator, c = "[^" + this.escape(this.options.separators) + "]";
|
|
31
|
-
let i = 0, n = 0;
|
|
32
|
-
if (e = e.replace(new RegExp("^" + t + "*(.*?)" + t + "*$"), "$1"), e.replace(/:([a-z]\w*)(\((.*?)\))?([\?\*\+])?/gi, (r, a, g, u, h, l, q) => {
|
|
33
|
-
n++;
|
|
34
|
-
const y = h === "*" || h === "+", x = !!/^(\[[^\[\]]+\]|\([^\(\)]+\)|\.|\\.)[\+\*]$/.test(u);
|
|
35
|
-
let E = h !== "*" && h !== "?";
|
|
36
|
-
!h && u && /^(\[[^\[\]]+\]|\([^\(\)]+\)|\.|\\.)[\*\?]?$/.test(u) && (E = !1);
|
|
37
|
-
const d = h || "", P = l ? this.separator(e.charAt(l - 1)) : !0, S = l + r.length >= e.length ? !0 : this.separator(e.charAt(l + r.length)), R = P && S;
|
|
38
|
-
if (l > i) {
|
|
39
|
-
const O = e.substring(i, l), T = this.escape(O);
|
|
40
|
-
this.regstr += T;
|
|
41
|
-
}
|
|
42
|
-
R && l && (!y || !E) && u && !x && (this.regstr += "?");
|
|
43
|
-
const p = u || c + "+", v = y ? R ? x ? "((?:" + t + "?" + p + ")" + d + ")" : "((?:" + t + p + ")" + d + ")" : "((?:" + c + "*" + p + ")" + d + ")" : R && x ? "(" + p + "?)" + d : "(" + p + ")" + d;
|
|
44
|
-
this.regstr += v;
|
|
45
|
-
const m = {
|
|
46
|
-
key: a,
|
|
47
|
-
multiple: y,
|
|
48
|
-
required: E,
|
|
49
|
-
index: n,
|
|
50
|
-
pattern: p
|
|
51
|
-
};
|
|
52
|
-
return y && (m.regexp = new RegExp(p, this.options.case ? "g" : "gi")), this.keys.push(m), i = l + r.length, r;
|
|
53
|
-
}), i < e.length - 1) {
|
|
54
|
-
const r = e.substring(i), a = this.escape(r);
|
|
55
|
-
this.regstr += a;
|
|
56
|
-
}
|
|
57
|
-
this.regexp = new RegExp(
|
|
58
|
-
(this.options.fromStart ? "^" : "") + t + "?" + this.regstr + (this.options.toEnd ? t + "?$" : "(" + t + "|" + t + "?$)"),
|
|
59
|
-
this.options.case ? "" : "i"
|
|
60
|
-
);
|
|
61
|
-
}, s.prototype.escape = function(e) {
|
|
62
|
-
return e.replace(o, (t) => "\\" + t);
|
|
63
|
-
}, s.prototype.separator = function(e) {
|
|
64
|
-
return !!(this.options.separators.indexOf(e) + 1);
|
|
65
|
-
}, s.prototype.match = function(e) {
|
|
66
|
-
if (typeof e != "string") return;
|
|
67
|
-
const t = this.options.separator, c = this.options.separators[0];
|
|
68
|
-
e = e.replace(new RegExp("^" + t + "*(.*?)" + t + "*$"), c + "$1" + c);
|
|
69
|
-
const i = e.match(this.regexp);
|
|
70
|
-
if (!i) return;
|
|
71
|
-
const n = {};
|
|
72
|
-
return this.keys.forEach((r) => {
|
|
73
|
-
let a = !1;
|
|
74
|
-
n[r.key] && (a = !0), n[r.key] && !Array.isArray(n[r.key]) && (a = !0, n[r.key] = [n[r.key]]), r.multiple && !n[r.key] && (a = !0, n[r.key] = []);
|
|
75
|
-
let g = i[r.index] ? i[r.index] : void 0;
|
|
76
|
-
if (!a && !r.multiple) {
|
|
77
|
-
n[r.key] = g;
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
if (a && !r.multiple && i[r.index]) {
|
|
81
|
-
n[r.key].push(g);
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
i[r.index] && i[r.index].replace(r.regexp, (u) => {
|
|
85
|
-
u && n[r.key].push(
|
|
86
|
-
u.replace(new RegExp(t + "*$"), "")
|
|
87
|
-
);
|
|
88
|
-
});
|
|
89
|
-
}), n;
|
|
90
|
-
}, k;
|
|
91
|
-
}
|
|
92
|
-
var M = j();
|
|
93
|
-
const U = /* @__PURE__ */ _(M);
|
|
94
|
-
function I(o) {
|
|
95
|
-
let f = "", s = 0;
|
|
96
|
-
for (; s < o.length; )
|
|
97
|
-
if (o[s] === "{") {
|
|
98
|
-
let e = s;
|
|
99
|
-
s++;
|
|
100
|
-
let t = 1;
|
|
101
|
-
for (; s < o.length && t > 0; )
|
|
102
|
-
o[s] === "\\" ? s += 2 : (o[s] === "{" ? t++ : o[s] === "}" && t--, s++);
|
|
103
|
-
if (t !== 0)
|
|
104
|
-
throw new Error(`Unmatched '{' in path: ${o}`);
|
|
105
|
-
const c = o.slice(e + 1, s - 1), i = c.indexOf(":");
|
|
106
|
-
let n, r, a;
|
|
107
|
-
if (i === -1) {
|
|
108
|
-
const g = c.match(/^([^?*+]+)([?*+])?$/);
|
|
109
|
-
if (!g)
|
|
110
|
-
throw new Error(`Invalid parameter segment: {${c}}`);
|
|
111
|
-
[, n, a] = g;
|
|
112
|
-
} else
|
|
113
|
-
n = c.slice(0, i), r = c.slice(i + 1);
|
|
114
|
-
f += `:${n}`, r && (f += `(${r})`), a && (f += a);
|
|
115
|
-
} else
|
|
116
|
-
f += o[s++];
|
|
117
|
-
return f;
|
|
118
|
-
}
|
|
119
|
-
let w = A.proxy({
|
|
120
|
-
url: "",
|
|
121
|
-
pathname: "",
|
|
122
|
-
params: {},
|
|
123
|
-
query: {}
|
|
124
|
-
});
|
|
125
|
-
typeof window < "u" && (w.url = window.location.href, w.pathname = window.location.pathname, Object.assign(w.query, Object.fromEntries(new URLSearchParams(window.location.search))), w.params = {});
|
|
126
|
-
const $ = {};
|
|
127
|
-
function z(o, f) {
|
|
128
|
-
$[o] || ($[o] = new U(I(o)));
|
|
129
|
-
const s = $[o].match(f);
|
|
130
|
-
return s || {};
|
|
131
|
-
}
|
|
132
|
-
export {
|
|
133
|
-
w as a,
|
|
134
|
-
U as p,
|
|
135
|
-
z as s
|
|
136
|
-
};
|
|
137
|
-
//# sourceMappingURL=page.svelte-C4chAYK2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.svelte-C4chAYK2.js","sources":["../node_modules/path-to-regex/index.js","../src/parser/path.ts","../src/client/page.svelte.ts"],"sourcesContent":["module.exports = Regex;\n\nif (typeof window !== 'undefined') {\n\twindow.pathToRegex = Regex;\n}\n\nconst escapeRe = /([$.+*?=!:[\\]{}(|)/\\\\])/g;\n\n/**\n * defaultParam - simplistic polyfill for default function parament\n * @param {any} [obj]\n * @param {any} defaultValue\n * @return {any}\n */\nfunction defaultParam(obj, defaultValue) {\n\treturn typeof obj !== 'undefined' ? obj : defaultValue;\n}\n\n/**\n * Класс Regex [description].\n * @constructor\n * @param {Object} options [description].\n */\nfunction Regex(path, options) {\n\tthis.init(path, options);\n\treturn this;\n}\n\nRegex.prototype.init = function (\n\tpath = \"/\",\n\toptions = {}\n) {\n\tthis.options = {\n\t\tcase: typeof options.case === \"boolean\" ? options.case : true,\n\t\tseparators: typeof options.separators === \"string\" ? options.separators : \"/\",\n\t\tfromStart: typeof options.fromStart === \"boolean\" ? options.fromStart : true,\n\t\ttoEnd: typeof options.toEnd === \"boolean\" ? options.toEnd : true\n\t};\n\tthis.options.separator = \"[\" + this.escape(this.options.separators) + \"]\";\n\n\tif (path instanceof RegExp) {\n\t\tthis.restructureRegExp(path);\n\t} else if (typeof path === \"string\") {\n\t\tthis.restructurePath(path);\n\t}\n};\n\n/**\n * Метод преобразует строку с шаблоном пути, включающим в себя строковое представление регулярных выражений\n * и указадели на идентификаторы ключей в стиле Express.js в регулярное выражение\n * @param {string} path Строка содержащая шаблон пути. Может содержать в себе регулярные выражения и объявление ключей типа :id. Поведение имитирует аналогичный функционал библиотеки Express.js v.5.x\n */\nRegex.prototype.restructureRegExp = function (regexp) {\n\tregexp = defaultParam(regexp, /.*/);\n\tthis.keys = [];\n\tthis.path = undefined;\n\tthis.regstr = (\"\" + regexp);\n\tthis.regstr = this.regstr.substr(1, this.regstr.length - 2);\n\tthis.regexp = new RegExp(\n\t\tthis.regstr,\n\t\tthis.options.case ? \"\" : \"i\"\n\t);\n\n}\n\n/**\n * Метод преобразует строку с шаблоном пути, включающим в себя строковое представление регулярных выражений\n * и указадели на идентификаторы ключей в стиле Express.js в регулярное выражение\n * @param {string} path Строка содержащая шаблон пути. Может содержать в себе регулярные выражения и объявление ключей типа :id. Поведение имитирует аналогичный функционал библиотеки Express.js v.5.x\n */\nRegex.prototype.restructurePath = function (path) {\n\tpath = defaultParam(path, '/');\n\tthis.keys = [];\n\tthis.path = path;\n\tthis.regstr = \"\";\n\n\tconst separator = this.options.separator;\n\tconst notseparator = \"[^\" + this.escape(this.options.separators) + \"]\";\n\n\tlet offset = 0;\n\tlet count = 0;\n\t// 11. REGEXP toEnd[true]: /^[\\/]?foo\\/(.*?)[\\/]?$/\n\t// 11. REGEXP toEnd[false]: /^[\\/]?foo\\/(.*?)([\\/]|[\\/]?$)/i\n\n\tpath = path.replace(new RegExp(\"^\" + separator + \"*(.*?)\" + separator + \"*$\"), \"$1\");\n\t//path += this.options.separators[0];\n\n\tpath.replace(/:([a-z]\\w*)(\\((.*?)\\))?([\\?\\*\\+])?/gi, (str, key, a, pat, quant, index, string) => {\n\t\t// console.log(\"-----------------------------\");\n\t\t// console.log(\"str:\", str);\n\t\t// console.log(\"key:\", key);\n\t\t// console.log(\"a:\", a);\n\t\t// console.log(\"pat:\", pat);\n\t\t// console.log(\"quant:\", quant);\n\t\t// console.log(\"index:\", index);\n\t\t// console.log(\"string:\", string);\n\t\tcount++;\n\n\n\n\t\tconst isMultiple = (quant === \"*\" || quant === \"+\") ? true : false;\n\t\tconst isExtrude = /^(\\[[^\\[\\]]+\\]|\\([^\\(\\)]+\\)|\\.|\\\\.)[\\+\\*]$/.test(pat) ? true : false;\n\n\t\tlet isRequired = (quant !== \"*\" && quant !== \"?\") ? true : false;\n\t\tif (!quant && pat && /^(\\[[^\\[\\]]+\\]|\\([^\\(\\)]+\\)|\\.|\\\\.)[\\*\\?]?$/.test(pat)) isRequired = false;\n\n\t\tconst quantifier = quant ? quant : \"\";\n\t\t// console.log(\"isMultiple\", isMultiple);\n\t\t// console.log(\"isRequired\", isRequired);\n\n\t\t// const startChar = path.charAt(index-1);\n\t\tconst isStarted = (!index) ? true : this.separator(path.charAt(index - 1));\n\t\tconst isStoped = (index + str.length >= path.length) ? true : this.separator(path.charAt(index + str.length));\n\t\tconst isToken = isStarted && isStoped;\n\n\t\tif (index > offset) {\n\t\t\tconst text = path.substring(offset, index);\n\t\t\tconst regstr = this.escape(text);\n\t\t\tthis.regstr += regstr;\n\t\t}\n\n\t\tif (isToken && index) {\n\t\t\tif (!isMultiple || !isRequired) {\n\t\t\t\tif (pat && !isExtrude) {\n\t\t\t\t\tthis.regstr += \"?\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//console.log(\"isStarted\", isStarted);\n\t\t//console.log(\"isStoped\", isStoped);\n\t\t//console.log(\"isToken\", isToken);\n\t\t//console.log(\"this.regstr 1:\", this.regstr);\n\n\t\tconst pattern = (pat ? pat : notseparator + \"+\");\n\n\t\tconst regstr =\n\t\t\tisMultiple ?\n\t\t\t\tisToken ?\n\t\t\t\t\tisExtrude ?\n\t\t\t\t\t\t\"((?:\" + separator + \"?\" + pattern + \")\" + quantifier + \")\" :\n\t\t\t\t\t\t\"((?:\" + separator + \"\" + pattern + \")\" + quantifier + \")\" :\n\t\t\t\t\t\"((?:\" + notseparator + \"*\" + pattern + \")\" + quantifier + \")\" :\n\t\t\t\tisToken ?\n\t\t\t\t\tisExtrude ?\n\t\t\t\t\t\t\"(\" + pattern + \"?)\" + quantifier :\n\t\t\t\t\t\t\"(\" + pattern + \")\" + quantifier :\n\t\t\t\t\t\"(\" + pattern + \")\" + quantifier;\n\n\t\tthis.regstr += regstr;\n\n\t\tconst data = {\n\t\t\tkey: key,\n\t\t\tmultiple: isMultiple,\n\t\t\trequired: isRequired,\n\t\t\tindex: count,\n\t\t\tpattern: pattern\n\t\t};\n\t\tif (isMultiple)\n\t\t\tdata.regexp = new RegExp(pattern, this.options.case ? \"g\" : \"gi\");\n\n\t\tthis.keys.push(data);\n\n\t\toffset = index + str.length;\n\t\treturn str;\n\t});\n\n\tif (offset < path.length - 1) {\n\t\tconst text = path.substring(offset);\n\t\tconst regstr = this.escape(text);\n\t\tthis.regstr += regstr;\n\t}\n\n\tthis.regexp = new RegExp(\n\t\t(this.options.fromStart ? \"^\" : \"\") +\n\t\tseparator + \"?\" +\n\t\tthis.regstr +\n\t\t(this.options.toEnd\n\t\t\t?\n\t\t\tseparator + \"?\" + \"$\"\n\t\t\t:\n\t\t\t\"(\" + separator + \"|\" + separator + \"?\" + \"$\" + \")\"\n\t\t),\n\t\tthis.options.case ? \"\" : \"i\"\n\t);\n}\n\n\n\n/**\n * Метод экранирует все спец символы указанные в глобальной для модуля, переменной escapeRe\n * @param {string} text Любая строка\n * @return {string} Строка text, в которой все символы указанные в переменной escapeRe заэкранированы\n */\nRegex.prototype.escape = function (text) {\n\treturn text.replace(escapeRe, s => {\n\t\treturn \"\\\\\" + s\n\t});\n}\n\n/**\n * Метод проверяет является ли char одним из разделителей указанных в this.options.separators\n * @param {string} char Cтрока содержащая в себе проверяемый символ (длинна строки должна быть равна 1)\n * @return {boolean} Если проверяемый символ является одним из символов указанных в this.options.separators то true иначе false\n */\nRegex.prototype.separator = function (char) {\n\treturn !!(this.options.separators.indexOf(char) + 1);\n}\n\n\n\nRegex.prototype.match = function (path) {\n\t// console.log(\"match 01\");\n\n\tif (typeof path !== \"string\") return;\n\n\tconst reseparator = this.options.separator;\n\tconst separator = this.options.separators[0];\n\tpath = path.replace(new RegExp(\"^\" + reseparator + \"*(.*?)\" + reseparator + \"*$\"), separator + \"$1\" + separator);\n\n\t// console.log(\"match 02\");\n\tconst result = path.match(this.regexp);\n\t// console.log(\"match 03\");\n\n\tif (!result) return;\n\n\t// console.log(\"match 04\");\n\tconst data = {};\n\n\t// console.log(\"match 05\");\n\tthis.keys.forEach(item => {\n\t\t// console.log(\"match foreach 01\");\n\t\tlet isMultiple = false;\n\n\t\tif (data[item.key])\n\t\t\tisMultiple = true;\n\n\n\t\tif (data[item.key] && !Array.isArray(data[item.key])) {\n\t\t\tisMultiple = true;\n\t\t\tdata[item.key] = [data[item.key]];\n\t\t}\n\n\t\tif (item.multiple && !data[item.key]) {\n\t\t\tisMultiple = true;\n\t\t\tdata[item.key] = [];\n\t\t}\n\n\t\tlet value = result[item.index] ? result[item.index] : undefined;\n\n\t\tif (!isMultiple && !item.multiple) {\n\t\t\tdata[item.key] = value;\n\t\t\treturn;\n\t\t}\n\n\t\tif (isMultiple && !item.multiple && result[item.index]) {\n\t\t\tdata[item.key].push(value);\n\t\t\treturn;\n\t\t}\n\n\t\tif (result[item.index])\n\t\t\tresult[item.index].replace(item.regexp, str => {\n\t\t\t\tif (str) data[item.key].push(\n\t\t\t\t\tstr.replace(new RegExp(reseparator + \"*$\"), \"\")\n\t\t\t\t);\n\t\t\t});\n\n\t});\n\t// console.log(\"match 06\");\n\treturn data;\n};\n","import type {IRoute} from \"./IRoute\"\n\n/**\n * Convert OpenAPI‐style `{name[:pattern][modifier]}` into\n * path-to-regexp’s `:name(pattern)?*+` syntax, while\n * allowing literal `{` or `}` inside the regex.\n */\nexport function convertBraces(path: string): string {\n let out = '';\n let i = 0;\n\n while (i < path.length) {\n if (path[i] === '{') {\n // start of a parameter spec\n let start = i;\n i++;\n // find the matching closing '}' that balances this one\n let depth = 1;\n while (i < path.length && depth > 0) {\n if (path[i] === '\\\\') {\n // skip escaped chars\n i += 2;\n } else {\n if (path[i] === '{') depth++;\n else if (path[i] === '}') depth--;\n i++;\n }\n }\n if (depth !== 0) {\n throw new Error(`Unmatched '{' in path: ${path}`);\n }\n const segment = path.slice(start + 1, i - 1);\n // A segment is one of the following forms:\n // 1. \"name\" – simple param, no pattern, no modifier\n // 2. \"name+\" / \"name*\" / \"name?\" – param with modifier only\n // 3. \"name:regex\" – explicit pattern (may itself contain +, *, ?)\n // In the third case we must **not** interpret a trailing +, * or ? as a\n // modifier because it belongs to the user-supplied regex. The original\n // implementation used a single regexp with an optional modifier group,\n // which incorrectly split patterns such as `.*` or `.+` into two parts\n // (`.` as the pattern and `*` or `+` as the modifier). Instead we now\n // split on the first ':'; if a pattern is present we treat the rest of\n // the segment verbatim.\n\n const colonIdx = segment.indexOf(':');\n let name: string;\n let pattern: string | undefined;\n let modifier: string | undefined;\n\n if (colonIdx === -1) {\n // Forms 1 & 2 – no explicit pattern, so a trailing modifier is allowed.\n const m = segment.match(/^([^?*+]+)([?*+])?$/);\n if (!m) {\n throw new Error(`Invalid parameter segment: {${segment}}`);\n }\n [, name, modifier] = m as RegExpMatchArray & [string, string, string?];\n } else {\n // Form 3 – everything after the first ':' is the pattern.\n name = segment.slice(0, colonIdx);\n pattern = segment.slice(colonIdx + 1);\n // No modifier allowed when an explicit pattern is used.\n }\n\n out += `:${name}`;\n if (pattern) out += `(${pattern})`;\n if (modifier) out += modifier;\n } else {\n // ordinary char, copy (also handles escaped chars)\n out += path[i++];\n }\n }\n\n return out;\n}\n\n\nexport function parsePathConfig(path:string,method:string,path_config:any):IRoute {\n const layout = path_config['x-layout']\n const view = path_config['x-view']\n const summary = path_config.summary\n const query = path_config.query\n const body = path_config.body\n const parameters = path_config.parameters\n const responses = path_config.responses\n\n return {\n summary,\n path: convertBraces(path),\n method,\n layout,\n view,\n responses,\n parameters,\n query,\n body\n }\n}\n","import type { IPage } from \"../routing/page\";\nimport path_to_regex from \"path-to-regex\"\nimport {convertBraces} from \"../parser/path\";\n\n\n\nexport let page = $state({\n url: '',\n pathname:'',\n params: {},\n query:{},\n} as IPage);\n\n\nif(typeof window !== 'undefined') {\n page.url = window.location.href\n page.pathname = window.location.pathname\n Object.assign(page.query,Object.fromEntries(new URLSearchParams(window.location.search)))\n page.params = {}\n}\n\n\nconst patterns:Record<string,any> = {}\nexport function shadowUrl(pattern:string, url: string){\n if(!patterns[pattern]) {\n patterns[pattern] = new path_to_regex(convertBraces(pattern))\n }\n const match = patterns[pattern].match(url)\n if(match) {\n return match\n }else{\n return {}\n }\n}\n"],"names":["pathToRegex","Regex","escapeRe","defaultParam","obj","defaultValue","path","options","regexp","separator","notseparator","offset","count","str","key","a","pat","quant","index","string","isMultiple","isExtrude","isRequired","quantifier","isStarted","isStoped","isToken","text","regstr","pattern","data","s","char","reseparator","result","item","value","convertBraces","out","i","start","depth","segment","colonIdx","name","modifier","m","page","patterns","shadowUrl","url","path_to_regex","match"],"mappings":";;;;;;;SAAAA,IAAiBC,GAEb,OAAO,SAAW,QACrB,OAAO,cAAcA;AAGtB,QAAMC,IAAW;AAQjB,WAASC,EAAaC,GAAKC,GAAc;AACxC,WAAO,OAAOD,IAAQ,MAAcA,IAAMC;AAAA,EAC3C;AAOA,WAASJ,EAAMK,GAAMC,GAAS;AAC7B,gBAAK,KAAKD,GAAMC,CAAO,GAChB;AAAA,EACR;AAEA,SAAAN,EAAM,UAAU,OAAO,SACtBK,IAAO,KACPC,IAAU,CAAA,GACT;AACD,SAAK,UAAU;AAAA,MACd,MAAM,OAAOA,EAAQ,QAAS,YAAYA,EAAQ,OAAO;AAAA,MACzD,YAAY,OAAOA,EAAQ,cAAe,WAAWA,EAAQ,aAAa;AAAA,MAC1E,WAAW,OAAOA,EAAQ,aAAc,YAAYA,EAAQ,YAAY;AAAA,MACxE,OAAO,OAAOA,EAAQ,SAAU,YAAYA,EAAQ,QAAQ;AAAA,IAC5D,GACD,KAAK,QAAQ,YAAY,MAAM,KAAK,OAAO,KAAK,QAAQ,UAAU,IAAI,KAElED,aAAgB,SACnB,KAAK,kBAAkBA,CAAI,IACjB,OAAOA,KAAS,YAC1B,KAAK,gBAAgBA,CAAI;AAAA,EAE1B,GAODL,EAAM,UAAU,oBAAoB,SAAUO,GAAQ;AACrD,IAAAA,IAASL,EAAaK,GAAQ,IAAI,GAClC,KAAK,OAAO,CAAE,GACd,KAAK,OAAO,QACZ,KAAK,SAAU,KAAKA,GACpB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AACU,SAAAC,EAAUpB,GAAgBqB,GAAY;EAC9CF,EAASnB,CAAO,MAChBmB,EAASnB,CAAO,IAAA,IAAQsB,EAAcd,EAAcR,CAAO,CAAA;AAEzD,QAAAuB,IAAQJ,EAASnB,CAAO,EAAE,MAAMqB,CAAG;AACtC,SAAAE;AAKP;","x_google_ignoreList":[0]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const T=require("svelte/internal/client");function A(o){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const s in o)if(s!=="default"){const e=Object.getOwnPropertyDescriptor(o,s);Object.defineProperty(a,s,e.get?e:{enumerable:!0,get:()=>o[s]})}}return a.default=o,Object.freeze(a)}const M=A(T);function U(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var k,b;function D(){if(b)return k;b=1,k=s,typeof window<"u"&&(window.pathToRegex=s);const o=/([$.+*?=!:[\]{}(|)/\\])/g;function a(e,t){return typeof e<"u"?e:t}function s(e,t){return this.init(e,t),this}return s.prototype.init=function(e="/",t={}){this.options={case:typeof t.case=="boolean"?t.case:!0,separators:typeof t.separators=="string"?t.separators:"/",fromStart:typeof t.fromStart=="boolean"?t.fromStart:!0,toEnd:typeof t.toEnd=="boolean"?t.toEnd:!0},this.options.separator="["+this.escape(this.options.separators)+"]",e instanceof RegExp?this.restructureRegExp(e):typeof e=="string"&&this.restructurePath(e)},s.prototype.restructureRegExp=function(e){e=a(e,/.*/),this.keys=[],this.path=void 0,this.regstr=""+e,this.regstr=this.regstr.substr(1,this.regstr.length-2),this.regexp=new RegExp(this.regstr,this.options.case?"":"i")},s.prototype.restructurePath=function(e){e=a(e,"/"),this.keys=[],this.path=e,this.regstr="";const t=this.options.separator,f="[^"+this.escape(this.options.separators)+"]";let i=0,n=0;if(e=e.replace(new RegExp("^"+t+"*(.*?)"+t+"*$"),"$1"),e.replace(/:([a-z]\w*)(\((.*?)\))?([\?\*\+])?/gi,(r,c,g,u,h,l,B)=>{n++;const w=h==="*"||h==="+",x=!!/^(\[[^\[\]]+\]|\([^\(\)]+\)|\.|\\.)[\+\*]$/.test(u);let E=h!=="*"&&h!=="?";!h&&u&&/^(\[[^\[\]]+\]|\([^\(\)]+\)|\.|\\.)[\*\?]?$/.test(u)&&(E=!1);const d=h||"",P=l?this.separator(e.charAt(l-1)):!0,S=l+r.length>=e.length?!0:this.separator(e.charAt(l+r.length)),R=P&&S;if(l>i){const j=e.substring(i,l),v=this.escape(j);this.regstr+=v}R&&l&&(!w||!E)&&u&&!x&&(this.regstr+="?");const p=u||f+"+",_=w?R?x?"((?:"+t+"?"+p+")"+d+")":"((?:"+t+p+")"+d+")":"((?:"+f+"*"+p+")"+d+")":R&&x?"("+p+"?)"+d:"("+p+")"+d;this.regstr+=_;const m={key:c,multiple:w,required:E,index:n,pattern:p};return w&&(m.regexp=new RegExp(p,this.options.case?"g":"gi")),this.keys.push(m),i=l+r.length,r}),i<e.length-1){const r=e.substring(i),c=this.escape(r);this.regstr+=c}this.regexp=new RegExp((this.options.fromStart?"^":"")+t+"?"+this.regstr+(this.options.toEnd?t+"?$":"("+t+"|"+t+"?$)"),this.options.case?"":"i")},s.prototype.escape=function(e){return e.replace(o,t=>"\\"+t)},s.prototype.separator=function(e){return!!(this.options.separators.indexOf(e)+1)},s.prototype.match=function(e){if(typeof e!="string")return;const t=this.options.separator,f=this.options.separators[0];e=e.replace(new RegExp("^"+t+"*(.*?)"+t+"*$"),f+"$1"+f);const i=e.match(this.regexp);if(!i)return;const n={};return this.keys.forEach(r=>{let c=!1;n[r.key]&&(c=!0),n[r.key]&&!Array.isArray(n[r.key])&&(c=!0,n[r.key]=[n[r.key]]),r.multiple&&!n[r.key]&&(c=!0,n[r.key]=[]);let g=i[r.index]?i[r.index]:void 0;if(!c&&!r.multiple){n[r.key]=g;return}if(c&&!r.multiple&&i[r.index]){n[r.key].push(g);return}i[r.index]&&i[r.index].replace(r.regexp,u=>{u&&n[r.key].push(u.replace(new RegExp(t+"*$"),""))})}),n},k}var q=D();const O=U(q);function z(o){let a="",s=0;for(;s<o.length;)if(o[s]==="{"){let e=s;s++;let t=1;for(;s<o.length&&t>0;)o[s]==="\\"?s+=2:(o[s]==="{"?t++:o[s]==="}"&&t--,s++);if(t!==0)throw new Error(`Unmatched '{' in path: ${o}`);const f=o.slice(e+1,s-1),i=f.indexOf(":");let n,r,c;if(i===-1){const g=f.match(/^([^?*+]+)([?*+])?$/);if(!g)throw new Error(`Invalid parameter segment: {${f}}`);[,n,c]=g}else n=f.slice(0,i),r=f.slice(i+1);a+=`:${n}`,r&&(a+=`(${r})`),c&&(a+=c)}else a+=o[s++];return a}let y=M.proxy({url:"",pathname:"",params:{},query:{}});typeof window<"u"&&(y.url=window.location.href,y.pathname=window.location.pathname,Object.assign(y.query,Object.fromEntries(new URLSearchParams(window.location.search))),y.params={});const $={};function I(o,a){$[o]||($[o]=new O(z(o)));const s=$[o].match(a);return s||{}}exports.page=y;exports.path_to_regex=O;exports.shadowUrl=I;
|
|
2
|
-
//# sourceMappingURL=page.svelte-Dvj7306U.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.svelte-Dvj7306U.cjs","sources":["../node_modules/path-to-regex/index.js","../src/parser/path.ts","../src/client/page.svelte.ts"],"sourcesContent":["module.exports = Regex;\n\nif (typeof window !== 'undefined') {\n\twindow.pathToRegex = Regex;\n}\n\nconst escapeRe = /([$.+*?=!:[\\]{}(|)/\\\\])/g;\n\n/**\n * defaultParam - simplistic polyfill for default function parament\n * @param {any} [obj]\n * @param {any} defaultValue\n * @return {any}\n */\nfunction defaultParam(obj, defaultValue) {\n\treturn typeof obj !== 'undefined' ? obj : defaultValue;\n}\n\n/**\n * Класс Regex [description].\n * @constructor\n * @param {Object} options [description].\n */\nfunction Regex(path, options) {\n\tthis.init(path, options);\n\treturn this;\n}\n\nRegex.prototype.init = function (\n\tpath = \"/\",\n\toptions = {}\n) {\n\tthis.options = {\n\t\tcase: typeof options.case === \"boolean\" ? options.case : true,\n\t\tseparators: typeof options.separators === \"string\" ? options.separators : \"/\",\n\t\tfromStart: typeof options.fromStart === \"boolean\" ? options.fromStart : true,\n\t\ttoEnd: typeof options.toEnd === \"boolean\" ? options.toEnd : true\n\t};\n\tthis.options.separator = \"[\" + this.escape(this.options.separators) + \"]\";\n\n\tif (path instanceof RegExp) {\n\t\tthis.restructureRegExp(path);\n\t} else if (typeof path === \"string\") {\n\t\tthis.restructurePath(path);\n\t}\n};\n\n/**\n * Метод преобразует строку с шаблоном пути, включающим в себя строковое представление регулярных выражений\n * и указадели на идентификаторы ключей в стиле Express.js в регулярное выражение\n * @param {string} path Строка содержащая шаблон пути. Может содержать в себе регулярные выражения и объявление ключей типа :id. Поведение имитирует аналогичный функционал библиотеки Express.js v.5.x\n */\nRegex.prototype.restructureRegExp = function (regexp) {\n\tregexp = defaultParam(regexp, /.*/);\n\tthis.keys = [];\n\tthis.path = undefined;\n\tthis.regstr = (\"\" + regexp);\n\tthis.regstr = this.regstr.substr(1, this.regstr.length - 2);\n\tthis.regexp = new RegExp(\n\t\tthis.regstr,\n\t\tthis.options.case ? \"\" : \"i\"\n\t);\n\n}\n\n/**\n * Метод преобразует строку с шаблоном пути, включающим в себя строковое представление регулярных выражений\n * и указадели на идентификаторы ключей в стиле Express.js в регулярное выражение\n * @param {string} path Строка содержащая шаблон пути. Может содержать в себе регулярные выражения и объявление ключей типа :id. Поведение имитирует аналогичный функционал библиотеки Express.js v.5.x\n */\nRegex.prototype.restructurePath = function (path) {\n\tpath = defaultParam(path, '/');\n\tthis.keys = [];\n\tthis.path = path;\n\tthis.regstr = \"\";\n\n\tconst separator = this.options.separator;\n\tconst notseparator = \"[^\" + this.escape(this.options.separators) + \"]\";\n\n\tlet offset = 0;\n\tlet count = 0;\n\t// 11. REGEXP toEnd[true]: /^[\\/]?foo\\/(.*?)[\\/]?$/\n\t// 11. REGEXP toEnd[false]: /^[\\/]?foo\\/(.*?)([\\/]|[\\/]?$)/i\n\n\tpath = path.replace(new RegExp(\"^\" + separator + \"*(.*?)\" + separator + \"*$\"), \"$1\");\n\t//path += this.options.separators[0];\n\n\tpath.replace(/:([a-z]\\w*)(\\((.*?)\\))?([\\?\\*\\+])?/gi, (str, key, a, pat, quant, index, string) => {\n\t\t// console.log(\"-----------------------------\");\n\t\t// console.log(\"str:\", str);\n\t\t// console.log(\"key:\", key);\n\t\t// console.log(\"a:\", a);\n\t\t// console.log(\"pat:\", pat);\n\t\t// console.log(\"quant:\", quant);\n\t\t// console.log(\"index:\", index);\n\t\t// console.log(\"string:\", string);\n\t\tcount++;\n\n\n\n\t\tconst isMultiple = (quant === \"*\" || quant === \"+\") ? true : false;\n\t\tconst isExtrude = /^(\\[[^\\[\\]]+\\]|\\([^\\(\\)]+\\)|\\.|\\\\.)[\\+\\*]$/.test(pat) ? true : false;\n\n\t\tlet isRequired = (quant !== \"*\" && quant !== \"?\") ? true : false;\n\t\tif (!quant && pat && /^(\\[[^\\[\\]]+\\]|\\([^\\(\\)]+\\)|\\.|\\\\.)[\\*\\?]?$/.test(pat)) isRequired = false;\n\n\t\tconst quantifier = quant ? quant : \"\";\n\t\t// console.log(\"isMultiple\", isMultiple);\n\t\t// console.log(\"isRequired\", isRequired);\n\n\t\t// const startChar = path.charAt(index-1);\n\t\tconst isStarted = (!index) ? true : this.separator(path.charAt(index - 1));\n\t\tconst isStoped = (index + str.length >= path.length) ? true : this.separator(path.charAt(index + str.length));\n\t\tconst isToken = isStarted && isStoped;\n\n\t\tif (index > offset) {\n\t\t\tconst text = path.substring(offset, index);\n\t\t\tconst regstr = this.escape(text);\n\t\t\tthis.regstr += regstr;\n\t\t}\n\n\t\tif (isToken && index) {\n\t\t\tif (!isMultiple || !isRequired) {\n\t\t\t\tif (pat && !isExtrude) {\n\t\t\t\t\tthis.regstr += \"?\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//console.log(\"isStarted\", isStarted);\n\t\t//console.log(\"isStoped\", isStoped);\n\t\t//console.log(\"isToken\", isToken);\n\t\t//console.log(\"this.regstr 1:\", this.regstr);\n\n\t\tconst pattern = (pat ? pat : notseparator + \"+\");\n\n\t\tconst regstr =\n\t\t\tisMultiple ?\n\t\t\t\tisToken ?\n\t\t\t\t\tisExtrude ?\n\t\t\t\t\t\t\"((?:\" + separator + \"?\" + pattern + \")\" + quantifier + \")\" :\n\t\t\t\t\t\t\"((?:\" + separator + \"\" + pattern + \")\" + quantifier + \")\" :\n\t\t\t\t\t\"((?:\" + notseparator + \"*\" + pattern + \")\" + quantifier + \")\" :\n\t\t\t\tisToken ?\n\t\t\t\t\tisExtrude ?\n\t\t\t\t\t\t\"(\" + pattern + \"?)\" + quantifier :\n\t\t\t\t\t\t\"(\" + pattern + \")\" + quantifier :\n\t\t\t\t\t\"(\" + pattern + \")\" + quantifier;\n\n\t\tthis.regstr += regstr;\n\n\t\tconst data = {\n\t\t\tkey: key,\n\t\t\tmultiple: isMultiple,\n\t\t\trequired: isRequired,\n\t\t\tindex: count,\n\t\t\tpattern: pattern\n\t\t};\n\t\tif (isMultiple)\n\t\t\tdata.regexp = new RegExp(pattern, this.options.case ? \"g\" : \"gi\");\n\n\t\tthis.keys.push(data);\n\n\t\toffset = index + str.length;\n\t\treturn str;\n\t});\n\n\tif (offset < path.length - 1) {\n\t\tconst text = path.substring(offset);\n\t\tconst regstr = this.escape(text);\n\t\tthis.regstr += regstr;\n\t}\n\n\tthis.regexp = new RegExp(\n\t\t(this.options.fromStart ? \"^\" : \"\") +\n\t\tseparator + \"?\" +\n\t\tthis.regstr +\n\t\t(this.options.toEnd\n\t\t\t?\n\t\t\tseparator + \"?\" + \"$\"\n\t\t\t:\n\t\t\t\"(\" + separator + \"|\" + separator + \"?\" + \"$\" + \")\"\n\t\t),\n\t\tthis.options.case ? \"\" : \"i\"\n\t);\n}\n\n\n\n/**\n * Метод экранирует все спец символы указанные в глобальной для модуля, переменной escapeRe\n * @param {string} text Любая строка\n * @return {string} Строка text, в которой все символы указанные в переменной escapeRe заэкранированы\n */\nRegex.prototype.escape = function (text) {\n\treturn text.replace(escapeRe, s => {\n\t\treturn \"\\\\\" + s\n\t});\n}\n\n/**\n * Метод проверяет является ли char одним из разделителей указанных в this.options.separators\n * @param {string} char Cтрока содержащая в себе проверяемый символ (длинна строки должна быть равна 1)\n * @return {boolean} Если проверяемый символ является одним из символов указанных в this.options.separators то true иначе false\n */\nRegex.prototype.separator = function (char) {\n\treturn !!(this.options.separators.indexOf(char) + 1);\n}\n\n\n\nRegex.prototype.match = function (path) {\n\t// console.log(\"match 01\");\n\n\tif (typeof path !== \"string\") return;\n\n\tconst reseparator = this.options.separator;\n\tconst separator = this.options.separators[0];\n\tpath = path.replace(new RegExp(\"^\" + reseparator + \"*(.*?)\" + reseparator + \"*$\"), separator + \"$1\" + separator);\n\n\t// console.log(\"match 02\");\n\tconst result = path.match(this.regexp);\n\t// console.log(\"match 03\");\n\n\tif (!result) return;\n\n\t// console.log(\"match 04\");\n\tconst data = {};\n\n\t// console.log(\"match 05\");\n\tthis.keys.forEach(item => {\n\t\t// console.log(\"match foreach 01\");\n\t\tlet isMultiple = false;\n\n\t\tif (data[item.key])\n\t\t\tisMultiple = true;\n\n\n\t\tif (data[item.key] && !Array.isArray(data[item.key])) {\n\t\t\tisMultiple = true;\n\t\t\tdata[item.key] = [data[item.key]];\n\t\t}\n\n\t\tif (item.multiple && !data[item.key]) {\n\t\t\tisMultiple = true;\n\t\t\tdata[item.key] = [];\n\t\t}\n\n\t\tlet value = result[item.index] ? result[item.index] : undefined;\n\n\t\tif (!isMultiple && !item.multiple) {\n\t\t\tdata[item.key] = value;\n\t\t\treturn;\n\t\t}\n\n\t\tif (isMultiple && !item.multiple && result[item.index]) {\n\t\t\tdata[item.key].push(value);\n\t\t\treturn;\n\t\t}\n\n\t\tif (result[item.index])\n\t\t\tresult[item.index].replace(item.regexp, str => {\n\t\t\t\tif (str) data[item.key].push(\n\t\t\t\t\tstr.replace(new RegExp(reseparator + \"*$\"), \"\")\n\t\t\t\t);\n\t\t\t});\n\n\t});\n\t// console.log(\"match 06\");\n\treturn data;\n};\n","import type {IRoute} from \"./IRoute\"\n\n/**\n * Convert OpenAPI‐style `{name[:pattern][modifier]}` into\n * path-to-regexp’s `:name(pattern)?*+` syntax, while\n * allowing literal `{` or `}` inside the regex.\n */\nexport function convertBraces(path: string): string {\n let out = '';\n let i = 0;\n\n while (i < path.length) {\n if (path[i] === '{') {\n // start of a parameter spec\n let start = i;\n i++;\n // find the matching closing '}' that balances this one\n let depth = 1;\n while (i < path.length && depth > 0) {\n if (path[i] === '\\\\') {\n // skip escaped chars\n i += 2;\n } else {\n if (path[i] === '{') depth++;\n else if (path[i] === '}') depth--;\n i++;\n }\n }\n if (depth !== 0) {\n throw new Error(`Unmatched '{' in path: ${path}`);\n }\n const segment = path.slice(start + 1, i - 1);\n // A segment is one of the following forms:\n // 1. \"name\" – simple param, no pattern, no modifier\n // 2. \"name+\" / \"name*\" / \"name?\" – param with modifier only\n // 3. \"name:regex\" – explicit pattern (may itself contain +, *, ?)\n // In the third case we must **not** interpret a trailing +, * or ? as a\n // modifier because it belongs to the user-supplied regex. The original\n // implementation used a single regexp with an optional modifier group,\n // which incorrectly split patterns such as `.*` or `.+` into two parts\n // (`.` as the pattern and `*` or `+` as the modifier). Instead we now\n // split on the first ':'; if a pattern is present we treat the rest of\n // the segment verbatim.\n\n const colonIdx = segment.indexOf(':');\n let name: string;\n let pattern: string | undefined;\n let modifier: string | undefined;\n\n if (colonIdx === -1) {\n // Forms 1 & 2 – no explicit pattern, so a trailing modifier is allowed.\n const m = segment.match(/^([^?*+]+)([?*+])?$/);\n if (!m) {\n throw new Error(`Invalid parameter segment: {${segment}}`);\n }\n [, name, modifier] = m as RegExpMatchArray & [string, string, string?];\n } else {\n // Form 3 – everything after the first ':' is the pattern.\n name = segment.slice(0, colonIdx);\n pattern = segment.slice(colonIdx + 1);\n // No modifier allowed when an explicit pattern is used.\n }\n\n out += `:${name}`;\n if (pattern) out += `(${pattern})`;\n if (modifier) out += modifier;\n } else {\n // ordinary char, copy (also handles escaped chars)\n out += path[i++];\n }\n }\n\n return out;\n}\n\n\nexport function parsePathConfig(path:string,method:string,path_config:any):IRoute {\n const layout = path_config['x-layout']\n const view = path_config['x-view']\n const summary = path_config.summary\n const query = path_config.query\n const body = path_config.body\n const parameters = path_config.parameters\n const responses = path_config.responses\n\n return {\n summary,\n path: convertBraces(path),\n method,\n layout,\n view,\n responses,\n parameters,\n query,\n body\n }\n}\n","import type { IPage } from \"../routing/page\";\nimport path_to_regex from \"path-to-regex\"\nimport {convertBraces} from \"../parser/path\";\n\n\n\nexport let page = $state({\n url: '',\n pathname:'',\n params: {},\n query:{},\n} as IPage);\n\n\nif(typeof window !== 'undefined') {\n page.url = window.location.href\n page.pathname = window.location.pathname\n Object.assign(page.query,Object.fromEntries(new URLSearchParams(window.location.search)))\n page.params = {}\n}\n\n\nconst patterns:Record<string,any> = {}\nexport function shadowUrl(pattern:string, url: string){\n if(!patterns[pattern]) {\n patterns[pattern] = new path_to_regex(convertBraces(pattern))\n }\n const match = patterns[pattern].match(url)\n if(match) {\n return match\n }else{\n return {}\n }\n}\n"],"names":["pathToRegex","Regex","escapeRe","defaultParam","obj","defaultValue","path","options","regexp","separator","notseparator","offset","count","str","key","a","pat","quant","index","string","isMultiple","isExtrude","isRequired","quantifier","isStarted","isStoped","isToken","text","regstr","pattern","data","s","char","reseparator","result","item","value","convertBraces","out","i","start","depth","segment","colonIdx","name","modifier","m","page","patterns","shadowUrl","url","path_to_regex","match"],"mappings":"4dAAAA,EAAiBC,EAEb,OAAO,OAAW,MACrB,OAAO,YAAcA,GAGtB,MAAMC,EAAW,2BAQjB,SAASC,EAAaC,EAAKC,EAAc,CACxC,OAAO,OAAOD,EAAQ,IAAcA,EAAMC,CAC3C,CAOA,SAASJ,EAAMK,EAAMC,EAAS,CAC7B,YAAK,KAAKD,EAAMC,CAAO,EAChB,IACR,CAEA,OAAAN,EAAM,UAAU,KAA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P,GAAAO,EAAA,MAGrBP,GAAOhC,EAAKiC,GAAG,EAIZ,OAAAD,CACT,KCnEWS,WACP,IAAK,GACL,SAAS,GACT,UACA,kBAIM,OAAW,MACZA,EAAA,IAAM,OAAO,SAAS,KACtBA,EAAA,SAAW,OAAO,SAAS,SACzB,OAAA,OAAOA,EAAK,MAAM,OAAO,gBAAgB,gBAAgB,OAAO,SAAS,MAAM,CAAA,CAAA,EACtFA,EAAK,iBAIHC,KACU,SAAAC,EAAUpB,EAAgBqB,EAAY,CAC9CF,EAASnB,CAAO,IAChBmB,EAASnB,CAAO,EAAA,IAAQsB,EAAcd,EAAcR,CAAO,CAAA,GAEzD,MAAAuB,EAAQJ,EAASnB,CAAO,EAAE,MAAMqB,CAAG,EACtC,OAAAE,KAKP","x_google_ignoreList":[0]}
|
package/dist/parser/IRoute.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export type ResponseData = {
|
|
2
|
-
description: string;
|
|
3
|
-
};
|
|
4
|
-
export type Response = Record<number, ResponseData>;
|
|
5
|
-
type Parameter = any;
|
|
6
|
-
interface Body {
|
|
7
|
-
description: string;
|
|
8
|
-
required?: boolean;
|
|
9
|
-
content: any;
|
|
10
|
-
}
|
|
11
|
-
export interface IRoute {
|
|
12
|
-
path: string;
|
|
13
|
-
summary?: string;
|
|
14
|
-
description?: string;
|
|
15
|
-
method: string;
|
|
16
|
-
layout?: string[];
|
|
17
|
-
view: string;
|
|
18
|
-
responses?: Response;
|
|
19
|
-
parameters?: Parameter[];
|
|
20
|
-
query?: Parameter[];
|
|
21
|
-
body?: Body;
|
|
22
|
-
}
|
|
23
|
-
export interface IServerRoute {
|
|
24
|
-
fallback: {
|
|
25
|
-
layout: string[];
|
|
26
|
-
view: string;
|
|
27
|
-
};
|
|
28
|
-
routes: IRoute[];
|
|
29
|
-
}
|
|
30
|
-
export {};
|
|
31
|
-
//# sourceMappingURL=IRoute.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IRoute.d.ts","sourceRoot":"","sources":["../../src/parser/IRoute.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACvB,WAAW,EAAE,MAAM,CAAC;CACvB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAC,YAAY,CAAC,CAAA;AAGlD,KAAK,SAAS,GAAG,GAAG,CAAA;AAGpB,UAAU,IAAI;IACV,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,GAAG,CAAA;CACf;AAED,MAAM,WAAW,MAAM;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,QAAQ,CAAA;IACpB,UAAU,CAAC,EAAE,SAAS,EAAE,CAAA;IACxB,KAAK,CAAC,EAAE,SAAS,EAAE,CAAA;IACnB,IAAI,CAAC,EAAE,IAAI,CAAA;CACd;AAED,MAAM,WAAW,YAAY;IACzB,QAAQ,EAAC;QACL,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB"}
|
package/dist/parser/openapi.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IRoute, IServerRoute } from './IRoute';
|
|
2
|
-
export declare function parseConfigfile(file_content: string): any;
|
|
3
|
-
export declare function parse_modules(openapi: any): IRoute[] | undefined;
|
|
4
|
-
export declare function parse_paths(openapi: any): IRoute[] | undefined;
|
|
5
|
-
export declare function transform_openapi_spec(openapi_spec: string): string;
|
|
6
|
-
export declare function normalize_openapi_config(openapi_config: any): any;
|
|
7
|
-
export declare function parse_openapi_config(openapi_config_path: string): Promise<IServerRoute>;
|
|
8
|
-
export declare function transform_openapi_config(openapi_config: any): IRoute[];
|
|
9
|
-
//# sourceMappingURL=openapi.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/parser/openapi.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,UAAU,CAAA;AAIlD,wBAAgB,eAAe,CAAC,YAAY,EAAC,MAAM,OAQlD;AAGD,wBAAgB,aAAa,CAAC,OAAO,EAAC,GAAG,wBA0CxC;AAGD,wBAAgB,WAAW,CAAC,OAAO,EAAC,GAAG,wBAiBtC;AAKD,wBAAgB,sBAAsB,CAAC,YAAY,EAAC,MAAM,UAKzD;AAGD,wBAAgB,wBAAwB,CAAC,cAAc,EAAC,GAAG,OA6B1D;AAqBD,wBAAsB,oBAAoB,CAAC,mBAAmB,EAAC,MAAM,GAAE,OAAO,CAAC,YAAY,CAAC,CAsD3F;AAGD,wBAAgB,wBAAwB,CAAC,cAAc,EAAC,GAAG,GAAE,MAAM,EAAE,CAMpE"}
|
package/dist/parser/path.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IRoute } from './IRoute';
|
|
2
|
-
/**
|
|
3
|
-
* Convert OpenAPI‐style `{name[:pattern][modifier]}` into
|
|
4
|
-
* path-to-regexp’s `:name(pattern)?*+` syntax, while
|
|
5
|
-
* allowing literal `{` or `}` inside the regex.
|
|
6
|
-
*/
|
|
7
|
-
export declare function convertBraces(path: string): string;
|
|
8
|
-
export declare function parsePathConfig(path: string, method: string, path_config: any): IRoute;
|
|
9
|
-
//# sourceMappingURL=path.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/parser/path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,UAAU,CAAA;AAEpC;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAkElD;AAGD,wBAAgB,eAAe,CAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,WAAW,EAAC,GAAG,GAAE,MAAM,CAoBhF"}
|
package/dist/routing/base.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type Middleware = (req: any, reply: any, next: any) => void;
|
|
2
|
-
export type SvelteImport<K> = {
|
|
3
|
-
default: K;
|
|
4
|
-
};
|
|
5
|
-
export type SvelteModuleComponent = {
|
|
6
|
-
load?: (data: any) => any;
|
|
7
|
-
middleware?: Middleware[];
|
|
8
|
-
middlewares?: Middleware[];
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/routing/base.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,KAAA,EAAC,KAAK,KAAA,EAAC,IAAI,KAAA,KAAK,IAAI,CAAA;AACjD,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;IAAC,OAAO,EAAE,CAAC,CAAC;CAAC,CAAA;AAG3C,MAAM,MAAM,qBAAqB,GAAG;IAChC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAC,GAAG,KAAK,GAAG,CAAC;IACzB,UAAU,CAAC,EAAC,UAAU,EAAE,CAAC;IACzB,WAAW,CAAC,EAAC,UAAU,EAAE,CAAC;CAC7B,CAAA"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from 'svelte';
|
|
2
|
-
import { ViteDevServer } from 'vite';
|
|
3
|
-
import { SvelteImport, SvelteModuleComponent } from '../base';
|
|
4
|
-
type SvelteResource<K> = SvelteImport<K> & SvelteModuleComponent;
|
|
5
|
-
export interface IComponentLoader {
|
|
6
|
-
load(component: string, options?: any): Promise<SvelteResource<SvelteComponent>>;
|
|
7
|
-
}
|
|
8
|
-
export declare class BasicComponentLoader implements IComponentLoader {
|
|
9
|
-
private basePath;
|
|
10
|
-
constructor(basePath: string);
|
|
11
|
-
load(componentPath: string): Promise<SvelteResource<any>>;
|
|
12
|
-
}
|
|
13
|
-
export declare class ViteComponentLoader implements IComponentLoader {
|
|
14
|
-
private basePath;
|
|
15
|
-
private vite;
|
|
16
|
-
constructor(basePath: string, vite: ViteDevServer);
|
|
17
|
-
load(componentPath: string, options?: {
|
|
18
|
-
use_base_path: boolean;
|
|
19
|
-
}): Promise<SvelteResource<any>>;
|
|
20
|
-
}
|
|
21
|
-
export declare class ProdComponentLoader implements IComponentLoader {
|
|
22
|
-
private base_path;
|
|
23
|
-
constructor(base_path: string);
|
|
24
|
-
load(componentPath: string): Promise<SvelteResource<any>>;
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
27
|
-
//# sourceMappingURL=component_loader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component_loader.d.ts","sourceRoot":"","sources":["../../../src/routing/component_loader/component_loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAQ,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAI3C,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAS9D,KAAK,cAAc,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAA;AAEhE,MAAM,WAAW,gBAAgB;IAC7B,IAAI,CAAC,SAAS,EAAE,MAAM,EAAC,OAAO,CAAC,EAAC,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAA;CAEjF;AAKD,qBAAa,oBAAqB,YAAW,gBAAgB;IAC7C,OAAO,CAAC,QAAQ;gBAAR,QAAQ,EAAC,MAAM;IAE7B,IAAI,CAAC,aAAa,EAAE,MAAM;CAKnC;AAID,qBAAa,mBAAoB,YAAW,gBAAgB;IAC5C,OAAO,CAAC,QAAQ;IAAS,OAAO,CAAC,IAAI;gBAA7B,QAAQ,EAAC,MAAM,EAAU,IAAI,EAAE,aAAa;IAE1D,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO;;KAAuB,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;CAuClG;AAGD,qBAAa,mBAAoB,YAAW,gBAAgB;IAE5C,OAAO,CAAC,SAAS;gBAAT,SAAS,EAAE,MAAM;IAG/B,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;CAOlE"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IRoute } from '../../parser/IRoute';
|
|
2
|
-
import { IComponentLoader } from './component_loader';
|
|
3
|
-
export declare class ComponentManager {
|
|
4
|
-
private componentLoader;
|
|
5
|
-
constructor(componentLoader: IComponentLoader);
|
|
6
|
-
getLayoutComponents(route: IRoute): Promise<(import('../base').SvelteImport<import('svelte').SvelteComponent<Record<string, any>, any, any>> & import('../base').SvelteModuleComponent)[]>;
|
|
7
|
-
getLayouts(route: IRoute): Promise<import('svelte').SvelteComponent<Record<string, any>, any, any>[]>;
|
|
8
|
-
getLayoutLoaders(route: IRoute): Promise<(((data: any) => any) | undefined)[]>;
|
|
9
|
-
getViewComponent(route: IRoute): Promise<import('../base').SvelteImport<import('svelte').SvelteComponent<Record<string, any>, any, any>> & import('../base').SvelteModuleComponent>;
|
|
10
|
-
getView(route: IRoute): Promise<import('svelte').SvelteComponent<Record<string, any>, any, any>>;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=component_manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component_manager.d.ts","sourceRoot":"","sources":["../../../src/routing/component_loader/component_manager.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAM3D,qBAAa,gBAAgB;IAGrB,OAAO,CAAC,eAAe;gBAAf,eAAe,EAAE,gBAAgB;IAKvC,mBAAmB,CAAC,KAAK,EAAC,MAAM;IAQhC,UAAU,CAAC,KAAK,EAAC,MAAM;IAUvB,gBAAgB,CAAC,KAAK,EAAC,MAAM;IAS7B,gBAAgB,CAAC,KAAK,EAAE,MAAM;IAG9B,OAAO,CAAC,KAAK,EAAE,MAAM;CAI9B"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface IHTMLRender {
|
|
2
|
-
renderHTML(data: any): Promise<string>;
|
|
3
|
-
getTemplate(): Promise<string>;
|
|
4
|
-
}
|
|
5
|
-
export declare class BaseHTMLRender implements IHTMLRender {
|
|
6
|
-
private template;
|
|
7
|
-
constructor(template?: string);
|
|
8
|
-
getTemplate(): Promise<string>;
|
|
9
|
-
renderHTML(data: any): Promise<string>;
|
|
10
|
-
}
|
|
11
|
-
export declare class DefaultHTMLRender extends BaseHTMLRender {
|
|
12
|
-
constructor();
|
|
13
|
-
}
|
|
14
|
-
export declare class LiveHTMLRender implements IHTMLRender {
|
|
15
|
-
private html_path;
|
|
16
|
-
constructor(html_path: string);
|
|
17
|
-
renderHTML(data: any): Promise<string>;
|
|
18
|
-
getTemplate(): Promise<string>;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=html_render.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"html_render.d.ts","sourceRoot":"","sources":["../../../src/routing/html_render/html_render.ts"],"names":[],"mappings":"AA2BA,MAAM,WAAW,WAAW;IACxB,UAAU,CAAC,IAAI,EAAC,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IACrC,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;CACjC;AAED,qBAAa,cAAe,YAAW,WAAW;IAClC,OAAO,CAAC,QAAQ;gBAAR,QAAQ,GAAC,MAAyB;IAGlD,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAI5B,UAAU,CAAC,IAAI,EAAC,GAAG;CAI5B;AAED,qBAAa,iBAAkB,SAAQ,cAAc;;CAIpD;AAID,qBAAa,cAAe,YAAW,WAAW;IACpC,OAAO,CAAC,SAAS;gBAAT,SAAS,EAAC,MAAM;IAE9B,UAAU,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IAItC,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;CAIrC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ServerOptions } from '../../options/ServerOptions';
|
|
2
|
-
import { IComponentLoader } from '../component_loader/component_loader';
|
|
3
|
-
export declare class ManifestBuilder {
|
|
4
|
-
private openapi_path;
|
|
5
|
-
private loader;
|
|
6
|
-
private options;
|
|
7
|
-
private full_options;
|
|
8
|
-
constructor(openapi_path: string, loader: IComponentLoader, options: ServerOptions);
|
|
9
|
-
buildManifest(): Promise<Record<string, boolean>>;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/routing/manifest/base.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAIjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAE7E,qBAAa,eAAe;IAGZ,OAAO,CAAC,YAAY;IAAS,OAAO,CAAC,MAAM;IAAoB,OAAO,CAAC,OAAO;IAF1F,OAAO,CAAC,YAAY,CAAe;gBAEf,YAAY,EAAC,MAAM,EAAU,MAAM,EAAE,gBAAgB,EAAU,OAAO,EAAC,aAAa;IAKlG,aAAa;CAqBtB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.svelte.d.ts","sourceRoot":"","sources":["../../../src/routing/manifest/store.svelte.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,IAAa,CAAA;AAIxC,wBAAuB,mBAAmB,kBAUzC"}
|
package/dist/routing/page.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/routing/page.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,KAAK;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;CAC5C"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { IRoute } from '../../parser/IRoute';
|
|
2
|
-
import { ComponentManager } from '../component_loader/component_manager';
|
|
3
|
-
export interface RequestData {
|
|
4
|
-
url: string;
|
|
5
|
-
query: Record<string, any>;
|
|
6
|
-
params?: Partial<Record<string, string | string[]>> | null;
|
|
7
|
-
headers: Record<string, any>;
|
|
8
|
-
body: Record<string, any>;
|
|
9
|
-
context: Record<string, any>;
|
|
10
|
-
}
|
|
11
|
-
export declare class ApiAdapter {
|
|
12
|
-
private manager;
|
|
13
|
-
constructor(manager: ComponentManager);
|
|
14
|
-
getApiData(route: IRoute, request_data: RequestData): Promise<{
|
|
15
|
-
layout: any[];
|
|
16
|
-
view: any;
|
|
17
|
-
}>;
|
|
18
|
-
getFallbackData(route: IRoute, request_data: RequestData): Promise<{
|
|
19
|
-
layout: any[];
|
|
20
|
-
view: any;
|
|
21
|
-
}>;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=api_adapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api_adapter.d.ts","sourceRoot":"","sources":["../../../src/routing/server_adapter/api_adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAGzE,MAAM,WAAW,WAAW;IACxB,GAAG,EAAC,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;IAC3D,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAGD,qBAAa,UAAU;IAGf,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,gBAAgB;IAO/B,UAAU,CAAC,KAAK,EAAC,MAAM,EAAC,YAAY,EAAC,WAAW;;;;IAmChD,eAAe,CAAC,KAAK,EAAC,MAAM,EAAC,YAAY,EAAC,WAAW;;;;CAkC9D"}
|