@boon4681/giri 0.0.2 → 0.0.3
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/adapters/hono.d.ts +25 -4
- package/dist/adapters/hono.js +171 -8
- package/dist/adapters/hono.js.map +1 -1
- package/dist/cli.js +862 -234
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +24 -4
- package/dist/index.js +649 -122
- package/dist/index.js.map +1 -1
- package/dist/{types-DkrKD1S4.d.ts → types-BvRph0mx.d.ts} +92 -2
- package/dist/validators/valibot.d.ts +1 -1
- package/dist/validators/valibot.js.map +1 -1
- package/dist/validators/zod.d.ts +1 -1
- package/dist/validators/zod.js.map +1 -1
- package/package.json +4 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as Middleware, C as Context, H as HandlerResponse, V as ValidatedInput, S as Services, c as StatusCode, R as ResponseFormat, T as TypedResponse,
|
|
2
|
-
export { G as GiriAdapter,
|
|
1
|
+
import { M as Middleware, C as Context, H as HandlerResponse, V as ValidatedInput, S as Services, c as CookieJarFactory, d as StatusCode, R as ResponseFormat, T as TypedResponse, e as MiddlewareOptions, B as BodyContentType, a as GiriBodySchema, b as GiriInputSchema, i as inputSchemaBrand, f as RouteInput, g as HttpMethod, h as GiriConfig, j as GiriPaths, k as SecurityRequirement } from './types-BvRph0mx.js';
|
|
2
|
+
export { l as CookieJar, m as CookieOptions, n as CookieSink, G as GiriAdapter, o as GiriFetchHandler, p as GiriRequest, q as GiriRouteRegistration, r as GiriServeOptions, s as GiriServer, t as GiriServerInfo, u as Handle, I as Infer, v as InferStackVars, w as InputValidationResult, J as JsonSchema, x as MergeStack, y as MiddlewareOpenApi, z as MiddlewareVarsOf, N as Next, A as RouteInputOf, D as RouteOpenApi, E as RouteOpenApiConfig, F as ValidBody, K as ValidQuery, L as VarsOf } from './types-BvRph0mx.js';
|
|
3
3
|
|
|
4
4
|
interface CreateContextOptions<Params extends Record<string, string> = Record<string, string>, Input extends ValidatedInput = ValidatedInput> {
|
|
5
5
|
request: Request;
|
|
@@ -8,12 +8,21 @@ interface CreateContextOptions<Params extends Record<string, string> = Record<st
|
|
|
8
8
|
app?: Services;
|
|
9
9
|
/** The adapter's native per-request context, stashed for backend-specific bridges. */
|
|
10
10
|
native?: unknown;
|
|
11
|
+
/** Secret for `c.signedCookie` / `c.req.signedCookie` (from `config.cookieSecret`). */
|
|
12
|
+
cookieSecret?: string;
|
|
13
|
+
/** The adapter's cookie jar, built from its runtime's native helpers. */
|
|
14
|
+
cookies?: CookieJarFactory;
|
|
11
15
|
}
|
|
12
16
|
declare function createTypedResponse<T, S extends StatusCode, F extends ResponseFormat>(data: T, status: S, format: F, headers?: HeadersInit): TypedResponse<T, S, F>;
|
|
13
17
|
declare function isTypedResponse(value: unknown): value is TypedResponse<unknown>;
|
|
14
18
|
declare function createContext<Params extends Record<string, string> = Record<string, string>, Input extends ValidatedInput = ValidatedInput>(options: CreateContextOptions<Params, Input>): Context<Params, Input>;
|
|
15
19
|
declare function typedResponseToResponse(response: TypedResponse<unknown>): Response;
|
|
16
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Convert a handler's return value to a real `Response`, then merge any headers set imperatively via
|
|
22
|
+
* `c.header()` (the response's own headers win; pending ones fill the gaps). Pass the `context` so
|
|
23
|
+
* those imperative headers are applied; without it the response is returned unchanged.
|
|
24
|
+
*/
|
|
25
|
+
declare function toResponse(response: HandlerResponse, context?: Context): Response;
|
|
17
26
|
declare function composeMiddleware(middleware: Middleware[], handle: (c: Context) => HandlerResponse | Promise<HandlerResponse>, context: Context): Promise<HandlerResponse>;
|
|
18
27
|
type AnyMiddleware<Vars extends Record<string, unknown>> = Middleware<Record<string, string>, ValidatedInput, Vars>;
|
|
19
28
|
declare function defineMiddleware<Vars extends Record<string, unknown> = {}>(middleware: AnyMiddleware<Vars>): AnyMiddleware<Vars>;
|
|
@@ -71,6 +80,8 @@ declare function scanRoutes(routesDir: string): Promise<ScannedRoute[]>;
|
|
|
71
80
|
interface BuildGiriAppOptions {
|
|
72
81
|
cwd?: string;
|
|
73
82
|
services?: Services;
|
|
83
|
+
/** Files that changed since last build — only these are purged from require.cache before loading. */
|
|
84
|
+
dirty?: Set<string>;
|
|
74
85
|
}
|
|
75
86
|
interface BuiltGiriApp<App> {
|
|
76
87
|
app: App;
|
|
@@ -120,6 +131,14 @@ interface RouteSecurity {
|
|
|
120
131
|
/** Scheme definitions to merge into `components.securitySchemes`. */
|
|
121
132
|
securitySchemes: Record<string, unknown>;
|
|
122
133
|
}
|
|
134
|
+
/** Resolved OpenAPI operation metadata (everything on `openapi` except `hidden`). */
|
|
135
|
+
interface RouteOpenApiMeta {
|
|
136
|
+
tags?: string[];
|
|
137
|
+
summary?: string;
|
|
138
|
+
description?: string;
|
|
139
|
+
deprecated?: boolean;
|
|
140
|
+
operationId?: string;
|
|
141
|
+
}
|
|
123
142
|
|
|
124
143
|
/** The per-route metadata maps feeding `manifest.json` / `openapi.json`. */
|
|
125
144
|
interface SyncData {
|
|
@@ -127,6 +146,7 @@ interface SyncData {
|
|
|
127
146
|
inputsByFile: Map<string, RouteInputSchemas>;
|
|
128
147
|
securityByFile: Map<string, RouteSecurity>;
|
|
129
148
|
hiddenFiles: Set<string>;
|
|
149
|
+
openapiByFile: Map<string, RouteOpenApiMeta>;
|
|
130
150
|
}
|
|
131
151
|
interface SyncResult {
|
|
132
152
|
paths: GiriPaths;
|
|
@@ -163,4 +183,4 @@ declare function runInit(lifecycle: GiriLifecycle): Promise<Services>;
|
|
|
163
183
|
|
|
164
184
|
declare function defineConfig<App>(config: GiriConfig<App>): GiriConfig<App>;
|
|
165
185
|
|
|
166
|
-
export { BodyContentType, Context, GiriBodySchema, GiriConfig, GiriInputSchema, type GiriLifecycle, GiriPaths, HandlerResponse, HttpMethod, Middleware, MiddlewareOptions, RouteInput, SecurityRequirement, Services, StatusCode, TypedResponse, ValidatedInput, buildGiriApp, composeMiddleware, createContext, createTypedResponse, defineBodySchema, defineConfig, defineInputSchema, defineMiddleware, isGiriBodySchema, isGiriInputSchema, isTypedResponse, loadLifecycle, prepareRequestInput, resolveGiriPaths, runInit, scanRoutes, stack, syncProject, toResponse, typedResponseToResponse };
|
|
186
|
+
export { BodyContentType, Context, CookieJarFactory, GiriBodySchema, GiriConfig, GiriInputSchema, type GiriLifecycle, GiriPaths, HandlerResponse, HttpMethod, Middleware, MiddlewareOptions, RouteInput, SecurityRequirement, Services, StatusCode, TypedResponse, ValidatedInput, buildGiriApp, composeMiddleware, createContext, createTypedResponse, defineBodySchema, defineConfig, defineInputSchema, defineMiddleware, isGiriBodySchema, isGiriInputSchema, isTypedResponse, loadLifecycle, prepareRequestInput, resolveGiriPaths, runInit, scanRoutes, stack, syncProject, toResponse, typedResponseToResponse };
|