@noego/forge 0.0.1

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.
Files changed (145) hide show
  1. package/README.md +620 -0
  2. package/dist/client/client.d.ts +8 -0
  3. package/dist/client/client.d.ts.map +1 -0
  4. package/dist/client/events.d.ts +4 -0
  5. package/dist/client/events.d.ts.map +1 -0
  6. package/dist/client/index.d.ts +6 -0
  7. package/dist/client/index.d.ts.map +1 -0
  8. package/dist/client/navigation.svelte.d.ts +4 -0
  9. package/dist/client/navigation.svelte.d.ts.map +1 -0
  10. package/dist/client/page.svelte.d.ts +4 -0
  11. package/dist/client/page.svelte.d.ts.map +1 -0
  12. package/dist/client.cjs +2 -0
  13. package/dist/client.cjs.map +1 -0
  14. package/dist/client.d.ts +2 -0
  15. package/dist/client.mjs +605 -0
  16. package/dist/client.mjs.map +1 -0
  17. package/dist/index.d.ts +3 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/options/ServerOptions.d.ts +16 -0
  20. package/dist/options/ServerOptions.d.ts.map +1 -0
  21. package/dist/page.cjs +2 -0
  22. package/dist/page.cjs.map +1 -0
  23. package/dist/page.d.ts +2 -0
  24. package/dist/page.mjs +7 -0
  25. package/dist/page.mjs.map +1 -0
  26. package/dist/page.svelte-C4chAYK2.js +137 -0
  27. package/dist/page.svelte-C4chAYK2.js.map +1 -0
  28. package/dist/page.svelte-Dvj7306U.cjs +2 -0
  29. package/dist/page.svelte-Dvj7306U.cjs.map +1 -0
  30. package/dist/parser/IRoute.d.ts +31 -0
  31. package/dist/parser/IRoute.d.ts.map +1 -0
  32. package/dist/parser/openapi.d.ts +9 -0
  33. package/dist/parser/openapi.d.ts.map +1 -0
  34. package/dist/parser/path.d.ts +9 -0
  35. package/dist/parser/path.d.ts.map +1 -0
  36. package/dist/routing/base.d.ts +10 -0
  37. package/dist/routing/base.d.ts.map +1 -0
  38. package/dist/routing/component_loader/component_loader.d.ts +27 -0
  39. package/dist/routing/component_loader/component_loader.d.ts.map +1 -0
  40. package/dist/routing/component_loader/component_manager.d.ts +12 -0
  41. package/dist/routing/component_loader/component_manager.d.ts.map +1 -0
  42. package/dist/routing/html_render/html_render.d.ts +20 -0
  43. package/dist/routing/html_render/html_render.d.ts.map +1 -0
  44. package/dist/routing/manifest/base.d.ts +11 -0
  45. package/dist/routing/manifest/base.d.ts.map +1 -0
  46. package/dist/routing/manifest/store.svelte.d.ts +3 -0
  47. package/dist/routing/manifest/store.svelte.d.ts.map +1 -0
  48. package/dist/routing/page.d.ts +7 -0
  49. package/dist/routing/page.d.ts.map +1 -0
  50. package/dist/routing/server_adapter/api_adapter.d.ts +23 -0
  51. package/dist/routing/server_adapter/api_adapter.d.ts.map +1 -0
  52. package/dist/routing/server_adapter/express_server_adapter.d.ts +20 -0
  53. package/dist/routing/server_adapter/express_server_adapter.d.ts.map +1 -0
  54. package/dist/routing/server_adapter/middleware_adapter.d.ts +12 -0
  55. package/dist/routing/server_adapter/middleware_adapter.d.ts.map +1 -0
  56. package/dist/routing/server_adapter/server_adapter.d.ts +5 -0
  57. package/dist/routing/server_adapter/server_adapter.d.ts.map +1 -0
  58. package/dist/routing/shadow/shadow_route.d.ts +2 -0
  59. package/dist/routing/shadow/shadow_route.d.ts.map +1 -0
  60. package/dist/routing/url_parser.d.ts +12 -0
  61. package/dist/routing/url_parser.d.ts.map +1 -0
  62. package/dist/server/server.d.ts +5 -0
  63. package/dist/server/server.d.ts.map +1 -0
  64. package/dist/shared.cjs +2 -0
  65. package/dist/shared.cjs.map +1 -0
  66. package/dist/shared.d.ts +2 -0
  67. package/dist/shared.d.ts.map +1 -0
  68. package/dist/shared.mjs +5 -0
  69. package/dist/shared.mjs.map +1 -0
  70. package/dist/types/Callback.d.ts +2 -0
  71. package/dist/types/Callback.d.ts.map +1 -0
  72. package/dist/types/FetchMiddleware.d.ts +21 -0
  73. package/dist/types/FetchMiddleware.d.ts.map +1 -0
  74. package/dist/vite-env.d.ts +19 -0
  75. package/dist-ssr/client/client.d.ts +8 -0
  76. package/dist-ssr/client/client.d.ts.map +1 -0
  77. package/dist-ssr/client/events.d.ts +4 -0
  78. package/dist-ssr/client/events.d.ts.map +1 -0
  79. package/dist-ssr/client/index.d.ts +6 -0
  80. package/dist-ssr/client/index.d.ts.map +1 -0
  81. package/dist-ssr/client/navigation.svelte.d.ts +4 -0
  82. package/dist-ssr/client/navigation.svelte.d.ts.map +1 -0
  83. package/dist-ssr/client/page.svelte.d.ts +4 -0
  84. package/dist-ssr/client/page.svelte.d.ts.map +1 -0
  85. package/dist-ssr/index.d.ts +3 -0
  86. package/dist-ssr/index.d.ts.map +1 -0
  87. package/dist-ssr/options/ServerOptions.d.ts +16 -0
  88. package/dist-ssr/options/ServerOptions.d.ts.map +1 -0
  89. package/dist-ssr/parser/IRoute.d.ts +31 -0
  90. package/dist-ssr/parser/IRoute.d.ts.map +1 -0
  91. package/dist-ssr/parser/openapi.d.ts +9 -0
  92. package/dist-ssr/parser/openapi.d.ts.map +1 -0
  93. package/dist-ssr/parser/path.d.ts +9 -0
  94. package/dist-ssr/parser/path.d.ts.map +1 -0
  95. package/dist-ssr/path-CyGuWUeq.cjs +68 -0
  96. package/dist-ssr/path-CyGuWUeq.cjs.map +1 -0
  97. package/dist-ssr/path-ODk1FhWY.js +69 -0
  98. package/dist-ssr/path-ODk1FhWY.js.map +1 -0
  99. package/dist-ssr/routing/base.d.ts +10 -0
  100. package/dist-ssr/routing/base.d.ts.map +1 -0
  101. package/dist-ssr/routing/component_loader/component_loader.d.ts +27 -0
  102. package/dist-ssr/routing/component_loader/component_loader.d.ts.map +1 -0
  103. package/dist-ssr/routing/component_loader/component_manager.d.ts +12 -0
  104. package/dist-ssr/routing/component_loader/component_manager.d.ts.map +1 -0
  105. package/dist-ssr/routing/html_render/html_render.d.ts +20 -0
  106. package/dist-ssr/routing/html_render/html_render.d.ts.map +1 -0
  107. package/dist-ssr/routing/manifest/base.d.ts +11 -0
  108. package/dist-ssr/routing/manifest/base.d.ts.map +1 -0
  109. package/dist-ssr/routing/manifest/store.svelte.d.ts +3 -0
  110. package/dist-ssr/routing/manifest/store.svelte.d.ts.map +1 -0
  111. package/dist-ssr/routing/page.d.ts +7 -0
  112. package/dist-ssr/routing/page.d.ts.map +1 -0
  113. package/dist-ssr/routing/server_adapter/api_adapter.d.ts +23 -0
  114. package/dist-ssr/routing/server_adapter/api_adapter.d.ts.map +1 -0
  115. package/dist-ssr/routing/server_adapter/express_server_adapter.d.ts +20 -0
  116. package/dist-ssr/routing/server_adapter/express_server_adapter.d.ts.map +1 -0
  117. package/dist-ssr/routing/server_adapter/middleware_adapter.d.ts +12 -0
  118. package/dist-ssr/routing/server_adapter/middleware_adapter.d.ts.map +1 -0
  119. package/dist-ssr/routing/server_adapter/server_adapter.d.ts +5 -0
  120. package/dist-ssr/routing/server_adapter/server_adapter.d.ts.map +1 -0
  121. package/dist-ssr/routing/shadow/shadow_route.d.ts +2 -0
  122. package/dist-ssr/routing/shadow/shadow_route.d.ts.map +1 -0
  123. package/dist-ssr/routing/url_parser.d.ts +12 -0
  124. package/dist-ssr/routing/url_parser.d.ts.map +1 -0
  125. package/dist-ssr/server/server.d.ts +5 -0
  126. package/dist-ssr/server/server.d.ts.map +1 -0
  127. package/dist-ssr/server.cjs +876 -0
  128. package/dist-ssr/server.cjs.map +1 -0
  129. package/dist-ssr/server.d.ts +2 -0
  130. package/dist-ssr/server.js +838 -0
  131. package/dist-ssr/server.js.map +1 -0
  132. package/dist-ssr/shared.cjs +31 -0
  133. package/dist-ssr/shared.cjs.map +1 -0
  134. package/dist-ssr/shared.d.ts +2 -0
  135. package/dist-ssr/shared.d.ts.map +1 -0
  136. package/dist-ssr/shared.js +31 -0
  137. package/dist-ssr/shared.js.map +1 -0
  138. package/dist-ssr/types/Callback.d.ts +2 -0
  139. package/dist-ssr/types/Callback.d.ts.map +1 -0
  140. package/dist-ssr/types/FetchMiddleware.d.ts +21 -0
  141. package/dist-ssr/types/FetchMiddleware.d.ts.map +1 -0
  142. package/dist-ssr/vite-env.d.ts +19 -0
  143. package/loaders/loader.mjs +20 -0
  144. package/package.json +121 -0
  145. package/schema.json +333 -0
@@ -0,0 +1,20 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,11 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,3 @@
1
+ export declare const MANIFEST_STORE: {};
2
+ export declare function updateManifestStore(): Promise<void>;
3
+ //# sourceMappingURL=store.svelte.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,7 @@
1
+ export interface IPage {
2
+ url: string;
3
+ pathname: string;
4
+ params: Record<string, string>;
5
+ query: Record<string, string | string[]>;
6
+ }
7
+ //# sourceMappingURL=page.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,23 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,20 @@
1
+ import { IRoute, IServerRoute } from '../../parser/IRoute';
2
+ import { ComponentManager } from '../component_loader/component_manager';
3
+ import { IHTMLRender } from '../html_render/html_render';
4
+ import { UrlMatcher } from '../url_parser';
5
+ import { ApiAdapter } from './api_adapter';
6
+ import { MiddlewareAdapter } from './middleware_adapter';
7
+ import { ServerAdapter } from './server_adapter';
8
+ import { default as express, Request, Response } from 'express';
9
+ export declare class ExpressServerAdapter extends ServerAdapter {
10
+ private server;
11
+ private manager;
12
+ private htmlRender;
13
+ private api_adapter;
14
+ private middleware_adapter;
15
+ constructor(server: ReturnType<typeof express>, manager: ComponentManager, htmlRender: IHTMLRender, api_adapter: ApiAdapter, middleware_adapter: MiddlewareAdapter);
16
+ handleRoutes(routes: IRoute[], manifest: any): Promise<void>;
17
+ protected handleResponse(url: string, matcher: UrlMatcher, route: IRoute, routes: IRoute[], manifest: any, req: Request, res: Response): Promise<void>;
18
+ protected handleFallback(req: Request, res: Response, server_config: IServerRoute): Promise<void>;
19
+ }
20
+ //# sourceMappingURL=express_server_adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"express_server_adapter.d.ts","sourceRoot":"","sources":["../../../src/routing/server_adapter/express_server_adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,KAAK,EAAC,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAA;AAK7C,qBAAa,oBAAqB,SAAQ,aAAa;IAG/C,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,kBAAkB;gBAJlB,MAAM,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,EAClC,OAAO,EAAE,gBAAgB,EACzB,UAAU,EAAE,WAAW,EACvB,WAAW,EAAE,UAAU,EACvB,kBAAkB,EAAE,iBAAiB;IAK3C,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,EAAC,QAAQ,EAAC,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;cA2ChD,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAC,MAAM,EAAE,MAAM,EAAE,EAAC,QAAQ,KAAA,EAAE,GAAG,EAAC,OAAO,EAAE,GAAG,EAAC,QAAQ;cAgKnH,cAAc,CAAC,GAAG,EAAC,OAAO,EAAE,GAAG,EAAC,QAAQ,EAAE,aAAa,EAAE,YAAY;CAkGxF"}
@@ -0,0 +1,12 @@
1
+ import { IRoute } from '../../parser/IRoute';
2
+ import { Callback } from '../../types/Callback';
3
+ import { ComponentManager } from '../component_loader/component_manager';
4
+ import { RequestData } from './api_adapter';
5
+ export declare class MiddlewareAdapter {
6
+ private manager;
7
+ constructor(manager: ComponentManager);
8
+ handleMiddleware(req: any, reply: any, route: IRoute, request_data: RequestData, callback: Callback): Promise<any>;
9
+ private runMiddleware;
10
+ private dedupe;
11
+ }
12
+ //# sourceMappingURL=middleware_adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"middleware_adapter.d.ts","sourceRoot":"","sources":["../../../src/routing/server_adapter/middleware_adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAOjD,qBAAa,iBAAiB;IAEtB,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,gBAAgB;IAM/B,gBAAgB,CAAC,GAAG,EAAC,GAAG,EAAC,KAAK,EAAC,GAAG,EAAC,KAAK,EAAC,MAAM,EAAC,YAAY,EAAC,WAAW,EAAC,QAAQ,EAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAiC/G,OAAO,CAAC,aAAa;IA4BrB,OAAO,CAAC,MAAM;CAGjB"}
@@ -0,0 +1,5 @@
1
+ import { IRoute, IServerRoute } from '../../parser/IRoute';
2
+ export declare abstract class ServerAdapter {
3
+ abstract handleRoutes(routes: IRoute[], server_routes: IServerRoute): Promise<void>;
4
+ }
5
+ //# sourceMappingURL=server_adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server_adapter.d.ts","sourceRoot":"","sources":["../../../src/routing/server_adapter/server_adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAO/D,8BAAsB,aAAa;IAC/B,QAAQ,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;CACtF"}
@@ -0,0 +1,2 @@
1
+ export declare function shadowRoute(pattern: string, url: string): Record<string, string>;
2
+ //# sourceMappingURL=shadow_route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shadow_route.d.ts","sourceRoot":"","sources":["../../../src/routing/shadow/shadow_route.ts"],"names":[],"mappings":"AAOA,wBAAgB,WAAW,CAAC,OAAO,EAAC,MAAM,EAAE,GAAG,EAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAuB9E"}
@@ -0,0 +1,12 @@
1
+ import { IRoute } from '../parser/IRoute';
2
+ export declare function makeUrlParser(pattern: string): (pathname: string) => any;
3
+ export type UrlMatcher = {
4
+ pattern: string;
5
+ parser: ReturnType<typeof makeUrlParser>;
6
+ };
7
+ export declare function findRoute(pathname: string, routes: UrlMatcher[]): {
8
+ pattern: string;
9
+ params: any;
10
+ } | null;
11
+ export declare function initialize_route_matchers(routes: IRoute[]): UrlMatcher[];
12
+ //# sourceMappingURL=url_parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url_parser.d.ts","sourceRoot":"","sources":["../../src/routing/url_parser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAI/C,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,cAEzB,MAAM,SAIzB;AAGD,MAAM,MAAM,UAAU,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAA;CAC5C,CAAA;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE;;;SAQ9D;AAMD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,CAMxE"}
@@ -0,0 +1,5 @@
1
+ import { default as express } from 'express';
2
+ import { ServerOptions } from '../options/ServerOptions';
3
+ export type { ServerOptions } from '../options/ServerOptions';
4
+ export declare function createServer(app: express.Express, options?: ServerOptions): Promise<express.Express>;
5
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server/server.ts"],"names":[],"mappings":"AAEA,OAAO,OAAO,MAAM,SAAS,CAAC;AAY9B,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAM5E,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG9D,wBAAsB,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CA2F1G"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./page.svelte-Dvj7306U.cjs");exports.shadowUrl=e.shadowUrl;
2
+ //# sourceMappingURL=shared.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export { shadowUrl } from './client/page.svelte';
2
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { s } from "./page.svelte-C4chAYK2.js";
2
+ export {
3
+ s as shadowUrl
4
+ };
5
+ //# sourceMappingURL=shared.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,2 @@
1
+ export type Callback = () => void;
2
+ //# sourceMappingURL=Callback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Callback.d.ts","sourceRoot":"","sources":["../../src/types/Callback.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC"}
@@ -0,0 +1,21 @@
1
+ export type HeadersObject = Record<string, string>;
2
+ export type NextFunction = (error?: any) => void;
3
+ export type AsyncMiddleware = (headers: HeadersObject) => Promise<void> | void;
4
+ export type CallbackMiddleware = (headers: HeadersObject, next: NextFunction) => void;
5
+ export type FetchMiddleware = ((headers: HeadersObject) => Promise<void> | void) | ((headers: HeadersObject, next: NextFunction) => void);
6
+ export interface FetchMiddlewareAPI {
7
+ /**
8
+ * Add a new middleware to the fetch chain
9
+ * @param middleware - Function to modify headers before fetch
10
+ */
11
+ configUpdate(middleware: FetchMiddleware): void;
12
+ /**
13
+ * Reset all middleware and restore original fetch
14
+ */
15
+ reset(): void;
16
+ /**
17
+ * Get the current number of middleware in the chain (for debugging)
18
+ */
19
+ getMiddlewareCount?(): number;
20
+ }
21
+ //# sourceMappingURL=FetchMiddleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FetchMiddleware.d.ts","sourceRoot":"","sources":["../../src/types/FetchMiddleware.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEnD,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;AAGjD,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAG/E,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;AAGtF,MAAM,MAAM,eAAe,GACvB,CAAC,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAClD,CAAC,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC,CAAC;AAG3D,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,YAAY,CAAC,UAAU,EAAE,eAAe,GAAG,IAAI,CAAC;IAEhD;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;IAEd;;OAEG;IACH,kBAAkB,CAAC,IAAI,MAAM,CAAC;CAC/B"}
@@ -0,0 +1,19 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ declare module '@noego/stitch/browser' {
4
+ export function stitchFromViteImports(modules: Record<string, string>): Promise<{
5
+ success: boolean;
6
+ data?: any;
7
+ error?: string;
8
+ }>;
9
+ }
10
+
11
+ declare module '@noego/stitch' {
12
+ export class StitchEngine {
13
+ buildSync(filePath: string, options?: { format?: string }): {
14
+ success: boolean;
15
+ data?: any;
16
+ error?: string;
17
+ };
18
+ }
19
+ }
@@ -0,0 +1,8 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,4 @@
1
+ import { IRoute } from '../parser/IRoute';
2
+ import { UrlMatcher } from '../routing/url_parser';
3
+ export declare function bootstrap_events(base_path: string, routes: IRoute[], matchers: UrlMatcher[]): void;
4
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,6 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,4 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,4 @@
1
+ import { IPage } from '../routing/page';
2
+ export declare let page: IPage;
3
+ export declare function shadowUrl(pattern: string, url: string): any;
4
+ //# sourceMappingURL=page.svelte.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,3 @@
1
+ export { createServer } from './server/server';
2
+ export type { ServerOptions, htmlRenderer } from './options/ServerOptions';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,16 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,31 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,9 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,9 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ function convertBraces(path) {
3
+ let out = "";
4
+ let i = 0;
5
+ while (i < path.length) {
6
+ if (path[i] === "{") {
7
+ let start = i;
8
+ i++;
9
+ let depth = 1;
10
+ while (i < path.length && depth > 0) {
11
+ if (path[i] === "\\") {
12
+ i += 2;
13
+ } else {
14
+ if (path[i] === "{") depth++;
15
+ else if (path[i] === "}") depth--;
16
+ i++;
17
+ }
18
+ }
19
+ if (depth !== 0) {
20
+ throw new Error(`Unmatched '{' in path: ${path}`);
21
+ }
22
+ const segment = path.slice(start + 1, i - 1);
23
+ const colonIdx = segment.indexOf(":");
24
+ let name;
25
+ let pattern;
26
+ let modifier;
27
+ if (colonIdx === -1) {
28
+ const m = segment.match(/^([^?*+]+)([?*+])?$/);
29
+ if (!m) {
30
+ throw new Error(`Invalid parameter segment: {${segment}}`);
31
+ }
32
+ [, name, modifier] = m;
33
+ } else {
34
+ name = segment.slice(0, colonIdx);
35
+ pattern = segment.slice(colonIdx + 1);
36
+ }
37
+ out += `:${name}`;
38
+ if (pattern) out += `(${pattern})`;
39
+ if (modifier) out += modifier;
40
+ } else {
41
+ out += path[i++];
42
+ }
43
+ }
44
+ return out;
45
+ }
46
+ function parsePathConfig(path, method, path_config) {
47
+ const layout = path_config["x-layout"];
48
+ const view = path_config["x-view"];
49
+ const summary = path_config.summary;
50
+ const query = path_config.query;
51
+ const body = path_config.body;
52
+ const parameters = path_config.parameters;
53
+ const responses = path_config.responses;
54
+ return {
55
+ summary,
56
+ path: convertBraces(path),
57
+ method,
58
+ layout,
59
+ view,
60
+ responses,
61
+ parameters,
62
+ query,
63
+ body
64
+ };
65
+ }
66
+ exports.convertBraces = convertBraces;
67
+ exports.parsePathConfig = parsePathConfig;
68
+ //# sourceMappingURL=path-CyGuWUeq.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-CyGuWUeq.cjs","sources":["../src/parser/path.ts"],"sourcesContent":["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"],"names":[],"mappings":";AAOO,SAAS,cAAc,MAAsB;AAClD,MAAI,MAAM;AACV,MAAI,IAAI;AAED,SAAA,IAAI,KAAK,QAAQ;AAClB,QAAA,KAAK,CAAC,MAAM,KAAK;AAEnB,UAAI,QAAQ;AACZ;AAEA,UAAI,QAAQ;AACZ,aAAO,IAAI,KAAK,UAAU,QAAQ,GAAG;AAC/B,YAAA,KAAK,CAAC,MAAM,MAAM;AAEf,eAAA;AAAA,QAAA,OACA;AACD,cAAA,KAAK,CAAC,MAAM,IAAK;AAAA,mBACZ,KAAK,CAAC,MAAM,IAAK;AAC1B;AAAA,QAAA;AAAA,MACF;AAEF,UAAI,UAAU,GAAG;AACf,cAAM,IAAI,MAAM,0BAA0B,IAAI,EAAE;AAAA,MAAA;AAElD,YAAM,UAAU,KAAK,MAAM,QAAQ,GAAG,IAAI,CAAC;AAarC,YAAA,WAAW,QAAQ,QAAQ,GAAG;AAChC,UAAA;AACA,UAAA;AACA,UAAA;AAEJ,UAAI,aAAa,IAAI;AAEb,cAAA,IAAI,QAAQ,MAAM,qBAAqB;AAC7C,YAAI,CAAC,GAAG;AACN,gBAAM,IAAI,MAAM,+BAA+B,OAAO,GAAG;AAAA,QAAA;AAE1D,WAAE,MAAM,QAAQ,IAAI;AAAA,MAAA,OAChB;AAEK,eAAA,QAAQ,MAAM,GAAG,QAAQ;AACzB,kBAAA,QAAQ,MAAM,WAAW,CAAC;AAAA,MAAA;AAItC,aAAO,IAAI,IAAI;AACX,UAAA,QAAiB,QAAA,IAAI,OAAO;AAChC,UAAI,SAAiB,QAAA;AAAA,IAAA,OAChB;AAEL,aAAO,KAAK,GAAG;AAAA,IAAA;AAAA,EACjB;AAGK,SAAA;AACT;AAGgB,SAAA,gBAAgB,MAAY,QAAc,aAAwB;AACxE,QAAA,SAAS,YAAY,UAAU;AAC/B,QAAA,OAAO,YAAY,QAAQ;AACjC,QAAM,UAAU,YAAY;AAC5B,QAAM,QAAQ,YAAY;AAC1B,QAAM,OAAO,YAAY;AACzB,QAAM,aAAa,YAAY;AAC/B,QAAM,YAAY,YAAY;AAEvB,SAAA;AAAA,IACH;AAAA,IACA,MAAM,cAAc,IAAI;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AACJ;;;"}
@@ -0,0 +1,69 @@
1
+ function convertBraces(path) {
2
+ let out = "";
3
+ let i = 0;
4
+ while (i < path.length) {
5
+ if (path[i] === "{") {
6
+ let start = i;
7
+ i++;
8
+ let depth = 1;
9
+ while (i < path.length && depth > 0) {
10
+ if (path[i] === "\\") {
11
+ i += 2;
12
+ } else {
13
+ if (path[i] === "{") depth++;
14
+ else if (path[i] === "}") depth--;
15
+ i++;
16
+ }
17
+ }
18
+ if (depth !== 0) {
19
+ throw new Error(`Unmatched '{' in path: ${path}`);
20
+ }
21
+ const segment = path.slice(start + 1, i - 1);
22
+ const colonIdx = segment.indexOf(":");
23
+ let name;
24
+ let pattern;
25
+ let modifier;
26
+ if (colonIdx === -1) {
27
+ const m = segment.match(/^([^?*+]+)([?*+])?$/);
28
+ if (!m) {
29
+ throw new Error(`Invalid parameter segment: {${segment}}`);
30
+ }
31
+ [, name, modifier] = m;
32
+ } else {
33
+ name = segment.slice(0, colonIdx);
34
+ pattern = segment.slice(colonIdx + 1);
35
+ }
36
+ out += `:${name}`;
37
+ if (pattern) out += `(${pattern})`;
38
+ if (modifier) out += modifier;
39
+ } else {
40
+ out += path[i++];
41
+ }
42
+ }
43
+ return out;
44
+ }
45
+ function parsePathConfig(path, method, path_config) {
46
+ const layout = path_config["x-layout"];
47
+ const view = path_config["x-view"];
48
+ const summary = path_config.summary;
49
+ const query = path_config.query;
50
+ const body = path_config.body;
51
+ const parameters = path_config.parameters;
52
+ const responses = path_config.responses;
53
+ return {
54
+ summary,
55
+ path: convertBraces(path),
56
+ method,
57
+ layout,
58
+ view,
59
+ responses,
60
+ parameters,
61
+ query,
62
+ body
63
+ };
64
+ }
65
+ export {
66
+ convertBraces as c,
67
+ parsePathConfig as p
68
+ };
69
+ //# sourceMappingURL=path-ODk1FhWY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-ODk1FhWY.js","sources":["../src/parser/path.ts"],"sourcesContent":["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"],"names":[],"mappings":"AAOO,SAAS,cAAc,MAAsB;AAClD,MAAI,MAAM;AACV,MAAI,IAAI;AAED,SAAA,IAAI,KAAK,QAAQ;AAClB,QAAA,KAAK,CAAC,MAAM,KAAK;AAEnB,UAAI,QAAQ;AACZ;AAEA,UAAI,QAAQ;AACZ,aAAO,IAAI,KAAK,UAAU,QAAQ,GAAG;AAC/B,YAAA,KAAK,CAAC,MAAM,MAAM;AAEf,eAAA;AAAA,QAAA,OACA;AACD,cAAA,KAAK,CAAC,MAAM,IAAK;AAAA,mBACZ,KAAK,CAAC,MAAM,IAAK;AAC1B;AAAA,QAAA;AAAA,MACF;AAEF,UAAI,UAAU,GAAG;AACf,cAAM,IAAI,MAAM,0BAA0B,IAAI,EAAE;AAAA,MAAA;AAElD,YAAM,UAAU,KAAK,MAAM,QAAQ,GAAG,IAAI,CAAC;AAarC,YAAA,WAAW,QAAQ,QAAQ,GAAG;AAChC,UAAA;AACA,UAAA;AACA,UAAA;AAEJ,UAAI,aAAa,IAAI;AAEb,cAAA,IAAI,QAAQ,MAAM,qBAAqB;AAC7C,YAAI,CAAC,GAAG;AACN,gBAAM,IAAI,MAAM,+BAA+B,OAAO,GAAG;AAAA,QAAA;AAE1D,WAAE,MAAM,QAAQ,IAAI;AAAA,MAAA,OAChB;AAEK,eAAA,QAAQ,MAAM,GAAG,QAAQ;AACzB,kBAAA,QAAQ,MAAM,WAAW,CAAC;AAAA,MAAA;AAItC,aAAO,IAAI,IAAI;AACX,UAAA,QAAiB,QAAA,IAAI,OAAO;AAChC,UAAI,SAAiB,QAAA;AAAA,IAAA,OAChB;AAEL,aAAO,KAAK,GAAG;AAAA,IAAA;AAAA,EACjB;AAGK,SAAA;AACT;AAGgB,SAAA,gBAAgB,MAAY,QAAc,aAAwB;AACxE,QAAA,SAAS,YAAY,UAAU;AAC/B,QAAA,OAAO,YAAY,QAAQ;AACjC,QAAM,UAAU,YAAY;AAC5B,QAAM,QAAQ,YAAY;AAC1B,QAAM,OAAO,YAAY;AACzB,QAAM,aAAa,YAAY;AAC/B,QAAM,YAAY,YAAY;AAEvB,SAAA;AAAA,IACH;AAAA,IACA,MAAM,cAAc,IAAI;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AACJ;"}
@@ -0,0 +1,10 @@
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
@@ -0,0 +1 @@
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"}