@arkstack/driver-h3 0.12.25 → 0.12.27

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.
@@ -0,0 +1,86 @@
1
+ import { n as MiddlewareConfig, t as Middleware$2 } from "./types-yX_T9j5I.js";
2
+ import { ArkstackKitDriver, ArkstackRouteListOptions, PromiseOrValue } from "@arkstack/contract";
3
+ import { H3, H3Event, HTTPError, HTTPResponse } from "h3";
4
+ import { Route } from "clear-router";
5
+ import { Router } from "clear-router/h3";
6
+ import { H3App, Handler, HttpContext, Middleware as Middleware$1 } from "clear-router/types/h3";
7
+
8
+ //#region src/error-handler.d.ts
9
+ declare const defaultErrorHandler: (err: HTTPError | Error | string, event: H3Event) => Promise<HTTPResponse | {
10
+ error: boolean;
11
+ message: string;
12
+ status: "error";
13
+ code: number;
14
+ errors?: unknown;
15
+ stack?: string;
16
+ }>;
17
+ //#endregion
18
+ //#region src/Router.d.ts
19
+ declare class Router$1 extends Router {
20
+ static bind(app: H3): Promise<H3App>;
21
+ static list(_options: ArkstackRouteListOptions | undefined, app: H3): Promise<Route<HttpContext, Middleware$1, Handler>[]>;
22
+ }
23
+ //#endregion
24
+ //#region src/index.d.ts
25
+ type H3Middleware = Middleware$1 | [Middleware$1, Record<string, any>];
26
+ interface H3DriverOptions {
27
+ bindRouter: (app: H3) => PromiseOrValue<void>;
28
+ mountPublicAssets?: (app: H3, publicPath: string) => PromiseOrValue<void>;
29
+ createApp?: () => H3;
30
+ onError?: (err: Error | string, event: H3Event) => unknown;
31
+ }
32
+ declare class H3EventResponse {
33
+ response: Response;
34
+ status: number;
35
+ statusText?: string;
36
+ constructor(response: Response);
37
+ get headers(): Headers;
38
+ }
39
+ /**
40
+ * The H3Driver class implements the ArkstackKitDriver contract for the H3 framework.
41
+ */
42
+ declare class H3Driver extends ArkstackKitDriver<H3, H3Middleware> {
43
+ readonly name = "h3";
44
+ private readonly options;
45
+ /**
46
+ * Creates an instance of H3Driver.
47
+ *
48
+ * @param options
49
+ */
50
+ constructor(options: H3DriverOptions);
51
+ /**
52
+ * Creates an H3 application instance.
53
+ *
54
+ * @returns
55
+ */
56
+ createApp(): H3;
57
+ /**
58
+ * Mounts static assets from the specified public path to the H3 application.
59
+ *
60
+ * @param app
61
+ * @param publicPath
62
+ */
63
+ mountPublicAssets(app: H3, publicPath: string): PromiseOrValue<void>;
64
+ /**
65
+ * Binds the router to the H3 application using the provided bindRouter function.
66
+ *
67
+ * @param app
68
+ */
69
+ bindRouter(app: H3): PromiseOrValue<void>;
70
+ /**
71
+ * Applies middleware to the H3 application.
72
+ *
73
+ * @param app
74
+ * @param middleware
75
+ */
76
+ applyMiddleware(app: H3, middleware: H3Middleware | Middleware$2 | MiddlewareConfig): void;
77
+ /**
78
+ * Starts the H3 server on the specified port.
79
+ *
80
+ * @param app
81
+ * @param port
82
+ */
83
+ start(app: H3, port: number): void;
84
+ }
85
+ //#endregion
86
+ export { Router$1 as a, H3Middleware as i, H3DriverOptions as n, defaultErrorHandler as o, H3EventResponse as r, H3Driver as t };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  /// <reference path="./app.d.ts" />
2
- import { a as Router, i as H3Middleware, n as H3DriverOptions, o as defaultErrorHandler, r as H3EventResponse, t as H3Driver } from "./index-DIJtwwZP.js";
2
+ import { a as Router, i as H3Middleware, n as H3DriverOptions, o as defaultErrorHandler, r as H3EventResponse, t as H3Driver } from "./index-BJ2iafCy.js";
3
3
  export { H3Driver, H3DriverOptions, H3EventResponse, H3Middleware, Router, defaultErrorHandler };
@@ -1,4 +1,4 @@
1
- import { i as H3Middleware } from "../index-DIJtwwZP.js";
1
+ import { i as H3Middleware } from "../index-BJ2iafCy.js";
2
2
  import * as _$h3 from "h3";
3
3
  import { EventHandlerRequest, H3Event } from "h3";
4
4
  import { NextFunction } from "clear-router/types/h3";
@@ -0,0 +1,18 @@
1
+ /// <reference path="./app.d.ts" />
2
+ import { ArkstackKitDriver, ArkstackMiddlewareConfig, ArkstackRouteListOptions, PromiseOrValue } from "@arkstack/contract";
3
+ import { H3, H3Event, HTTPError, HTTPResponse, Middleware } from "h3";
4
+ import { Route } from "clear-router";
5
+ import { Router } from "clear-router/h3";
6
+ import { ClassMiddleware } from "clear-router/types/basic";
7
+ import { H3App, Handler, HttpContext, Middleware as Middleware$1 } from "clear-router/types/h3";
8
+
9
+ //#region dist/index-DIJtwwZP.d.ts
10
+ //#endregion
11
+ //#region src/index.d.ts
12
+ type H3Middleware = Middleware$1 | [Middleware$1, Record<string, any>];
13
+ //#endregion
14
+ //#region src/types.d.ts
15
+ type Middleware$2 = Middleware | ClassMiddleware<Middleware>;
16
+ type MiddlewareConfig = ArkstackMiddlewareConfig<Middleware$2> | ArkstackMiddlewareConfig<H3Middleware>;
17
+ //#endregion
18
+ export { MiddlewareConfig as n, Middleware$2 as t };
package/dist/types.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as MiddlewareConfig, t as Middleware } from "./types-DWUchLdg.js";
1
+ import { n as MiddlewareConfig, t as Middleware } from "./types-yX_T9j5I.js";
2
2
  export { Middleware, MiddlewareConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkstack/driver-h3",
3
- "version": "0.12.25",
3
+ "version": "0.12.27",
4
4
  "type": "module",
5
5
  "description": "H3 driver for Arkstack, providing H3-based runtime integration for the framework.",
6
6
  "homepage": "https://arkstack.toneflix.net",
@@ -40,13 +40,13 @@
40
40
  "clear-router": "^2.8.8",
41
41
  "@resora/plugin-clear-router": "^1.0.52",
42
42
  "resora": "^1.3.17",
43
- "@arkstack/contract": "^0.12.25"
43
+ "@arkstack/contract": "^0.12.27"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "h3": "2.0.1-rc.22",
47
- "@arkstack/auth": "^0.12.25",
48
- "@arkstack/common": "^0.12.25",
49
- "@arkstack/foundry": "^0.12.25"
47
+ "@arkstack/auth": "^0.12.27",
48
+ "@arkstack/common": "^0.12.27",
49
+ "@arkstack/foundry": "^0.12.27"
50
50
  },
51
51
  "peerDependenciesMeta": {
52
52
  "@arkstack/auth": {