@guren/server 1.0.0-rc.22 → 1.0.0-rc.24
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/{Application-Ol9W1-J2.d.ts → Application-D4_90raL.d.ts} +9 -1
- package/dist/{ConsoleKernel-yeJhrWXb.d.ts → ConsoleKernel-BPYcP-2f.d.ts} +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/broadcasting/index.js +1 -1
- package/dist/{chunk-AFI3A6GB.js → chunk-44F7JQ7I.js} +9 -0
- package/dist/{chunk-BJXAHGDR.js → chunk-F3664MFN.js} +6 -6
- package/dist/{chunk-OLKPSOCR.js → chunk-IM6XKMP5.js} +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +39 -26
- package/dist/lambda/index.d.ts +2 -2
- package/dist/mcp/index.d.ts +1 -1
- package/dist/notifications/index.d.ts +2 -2
- package/dist/queue/index.d.ts +2 -2
- package/dist/runtime/index.d.ts +2 -2
- package/dist/runtime/index.js +1 -1
- package/package.json +3 -3
|
@@ -129,6 +129,14 @@ type SharedPropsDefault = Record<string, unknown>;
|
|
|
129
129
|
type ResolvedSharedInertiaProps = InertiaSharedProps extends Record<string, unknown> ? InertiaSharedProps : SharedPropsDefault;
|
|
130
130
|
type SharedInertiaPropsResolver<Props extends Record<string, unknown> = ResolvedSharedInertiaProps> = (ctx: Context) => Promise<Props> | Props;
|
|
131
131
|
declare function setInertiaSharedProps<Props extends Record<string, unknown> = ResolvedSharedInertiaProps>(resolverFn: SharedInertiaPropsResolver<Props> | null): void;
|
|
132
|
+
declare function getInertiaSharedPropsResolver(): SharedInertiaPropsResolver<ResolvedSharedInertiaProps> | null;
|
|
133
|
+
/**
|
|
134
|
+
* Register additional shared props without replacing resolvers registered
|
|
135
|
+
* earlier — the new resolver's props are merged over the previous ones.
|
|
136
|
+
* Use this from app providers so multiple providers can each contribute
|
|
137
|
+
* shared props (setInertiaSharedProps replaces the resolver wholesale).
|
|
138
|
+
*/
|
|
139
|
+
declare function shareInertiaProps<Props extends Record<string, unknown>>(resolverFn: SharedInertiaPropsResolver<Props>): void;
|
|
132
140
|
|
|
133
141
|
/**
|
|
134
142
|
* Parses the incoming request payload supporting both JSON bodies and form submissions.
|
|
@@ -2169,4 +2177,4 @@ declare class Application {
|
|
|
2169
2177
|
}
|
|
2170
2178
|
declare function createApp(options?: ApplicationOptions): Application;
|
|
2171
2179
|
|
|
2172
|
-
export { type NotificationChannelFactory as $, Application as A, type InertiaSharedProps as B, Container as C, type DevBannerOptions as D, type ErrorResponse as E, type FailedJob as F, GUREN_ASCII_ART as G, type HostAuthorizationOptions as H, type InertiaOptions as I, type InertiaSsrContext as J, type InertiaSsrOptions as K, type InertiaSsrRenderer as L, type InertiaSsrResult as M, NotificationManager as N, type InferInertiaProps as O, type Provider as P, QueueManager as Q, Job as R, ServiceProvider as S, type JobClass as T, type JobFailureHandler as U, type JobHandler as V, type JobOptions as W, type Notifiable as X, Notification as Y, type NotificationAttachment as Z, type NotificationChannel as _, type StartViteDevServerOptions as a,
|
|
2180
|
+
export { type NotificationChannelFactory as $, Application as A, type InertiaSharedProps as B, Container as C, type DevBannerOptions as D, type ErrorResponse as E, type FailedJob as F, GUREN_ASCII_ART as G, type HostAuthorizationOptions as H, type InertiaOptions as I, type InertiaSsrContext as J, type InertiaSsrOptions as K, type InertiaSsrRenderer as L, type InertiaSsrResult as M, NotificationManager as N, type InferInertiaProps as O, type Provider as P, QueueManager as Q, Job as R, ServiceProvider as S, type JobClass as T, type JobFailureHandler as U, type JobHandler as V, type JobOptions as W, type Notifiable as X, Notification as Y, type NotificationAttachment as Z, type NotificationChannel as _, type StartViteDevServerOptions as a, setNotificationManager as a$, type NotificationClass as a0, type NotificationMailMessage as a1, type NotificationManagerOptions as a2, ProviderManager as a3, type QueueConfig as a4, type QueueDriver as a5, type QueueDriverFactory as a6, type QueuedJob as a7, type RendererRegistration as a8, type ResolvedSharedInertiaProps as a9, clearJobRegistry as aA, createApp as aB, createContainer as aC, createCsrfMiddleware as aD, createExceptionHandler as aE, createHostAuthorizationMiddleware as aF, createNotificationManager as aG, createQueueManager as aH, createSecurityHeaders as aI, csrfField as aJ, formatValidationErrors as aK, getContainer as aL, getCsrfToken as aM, getExceptionHandler as aN, getInertiaSharedPropsResolver as aO, getJob as aP, getNotificationManager as aQ, getQueueDriver as aR, getRegisteredJobs as aS, getValidatedData as aT, inertia as aU, parseRequestPayload as aV, registerJob as aW, resolve as aX, setContainer as aY, setExceptionHandler as aZ, setInertiaSharedProps as a_, type ResourceRouteOptions as aa, type RouteBuilder as ab, type RouteContractOptions as ac, type RouteDefinition as ad, type RouteOpenApiMetadata as ae, type ResourceAction as af, Router as ag, type SecurityHeadersOptions as ah, type SentNotification as ai, type ServiceBinding as aj, type ServiceClass as ak, type ServiceFactory as al, type ServiceProviderClass as am, type ServiceProviderConstructor as an, type ServiceProviderOptions as ao, type SharedInertiaPropsResolver as ap, type SlackAttachment as aq, type SlackBlock as ar, type SlackMessage as as, VALIDATED_DATA_KEY as at, type ValidateRequestOptions as au, type ValidationSchema as av, type WorkerOptions as aw, abort as ax, abortIf as ay, abortUnless as az, type StartedViteDevServer as b, setQueueDriver as b0, shareInertiaProps as b1, validate as b2, validateRequest as b3, validateRequestWith as b4, validateSafe as b5, verifyCsrfToken as b6, type ServiceBindings as c, type ApplicationListenOptions as d, type AuthPayload as e, CSRF_FORM_FIELD as f, CSRF_HEADER_NAME as g, CSRF_TOKEN_KEY as h, type ContextualBinding as i, type ContextualBindingBuilder as j, type ContextualNeedsBuilder as k, logDevServerBanner as l, Controller as m, type ControllerInertiaProps as n, type CsrfOptions as o, type DatabaseChannelOptions as p, type DatabaseNotification as q, type ExceptionClass as r, startViteDevServer as s, ExceptionHandler as t, type ExceptionHandlerOptions as u, type ExceptionRenderer as v, type ExceptionReporter as w, type HstsOptions as x, type InertiaPagePayload as y, type InertiaResponse as z };
|
package/dist/auth/index.js
CHANGED
|
@@ -490,6 +490,14 @@ async function parseRequestPayload(ctx) {
|
|
|
490
490
|
}
|
|
491
491
|
return {};
|
|
492
492
|
}
|
|
493
|
+
function flattenRequestQueries(ctx) {
|
|
494
|
+
const queries = ctx.req.queries();
|
|
495
|
+
const flat = {};
|
|
496
|
+
for (const [key, values] of Object.entries(queries)) {
|
|
497
|
+
flat[key] = values.length === 1 ? values[0] : values;
|
|
498
|
+
}
|
|
499
|
+
return flat;
|
|
500
|
+
}
|
|
493
501
|
function formatValidationErrors(error, fallbackMessage = "The provided data is invalid.") {
|
|
494
502
|
const errors = {};
|
|
495
503
|
for (const issue of error.issues ?? []) {
|
|
@@ -927,6 +935,7 @@ function wrapChannel(name, channel) {
|
|
|
927
935
|
|
|
928
936
|
export {
|
|
929
937
|
parseRequestPayload,
|
|
938
|
+
flattenRequestQueries,
|
|
930
939
|
formatValidationErrors,
|
|
931
940
|
Channel,
|
|
932
941
|
PrivateChannel,
|
|
@@ -270,10 +270,10 @@ function getSessionFromContext(ctx) {
|
|
|
270
270
|
|
|
271
271
|
// src/auth/RequestAuthContext.ts
|
|
272
272
|
var RequestAuthContext = class {
|
|
273
|
-
constructor(manager, ctx,
|
|
273
|
+
constructor(manager, ctx, resolveSession, resolveGuard) {
|
|
274
274
|
this.manager = manager;
|
|
275
275
|
this.ctx = ctx;
|
|
276
|
-
this.
|
|
276
|
+
this.resolveSession = resolveSession;
|
|
277
277
|
this.resolveGuard = resolveGuard;
|
|
278
278
|
}
|
|
279
279
|
guardCache = /* @__PURE__ */ new Map();
|
|
@@ -286,7 +286,7 @@ var RequestAuthContext = class {
|
|
|
286
286
|
return this.guardCache.get(key);
|
|
287
287
|
}
|
|
288
288
|
session() {
|
|
289
|
-
return this.
|
|
289
|
+
return this.resolveSession();
|
|
290
290
|
}
|
|
291
291
|
async check() {
|
|
292
292
|
return this.guard().check();
|
|
@@ -705,16 +705,16 @@ var AuthManager = class {
|
|
|
705
705
|
}
|
|
706
706
|
createAuthContext(ctx, options = {}) {
|
|
707
707
|
const guardName = options.guard ?? this.defaultGuard;
|
|
708
|
-
const
|
|
708
|
+
const resolveSession = () => getSessionFromContext(ctx);
|
|
709
709
|
const guardFactory = (name) => {
|
|
710
710
|
const targetName = name ?? guardName;
|
|
711
711
|
return this.createGuard(targetName, {
|
|
712
712
|
ctx,
|
|
713
|
-
session,
|
|
713
|
+
session: resolveSession(),
|
|
714
714
|
manager: this
|
|
715
715
|
});
|
|
716
716
|
};
|
|
717
|
-
return new RequestAuthContext(this, ctx,
|
|
717
|
+
return new RequestAuthContext(this, ctx, resolveSession, guardFactory);
|
|
718
718
|
}
|
|
719
719
|
async attempt(name, ctx, credentials, remember) {
|
|
720
720
|
const guard = this.createAuthContext(ctx, { guard: name }).guard(name);
|
|
@@ -6,7 +6,7 @@ import standard from "figlet/importable-fonts/Standard.js";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@guren/server",
|
|
9
|
-
version: "1.0.0-rc.
|
|
9
|
+
version: "1.0.0-rc.24",
|
|
10
10
|
type: "module",
|
|
11
11
|
license: "MIT",
|
|
12
12
|
repository: {
|
|
@@ -111,8 +111,8 @@ var package_default = {
|
|
|
111
111
|
test: "bun test"
|
|
112
112
|
},
|
|
113
113
|
dependencies: {
|
|
114
|
-
"@guren/inertia-client": "^1.0.0-rc.
|
|
115
|
-
"@guren/orm": "^1.0.0-rc.
|
|
114
|
+
"@guren/inertia-client": "^1.0.0-rc.23",
|
|
115
|
+
"@guren/orm": "^1.0.0-rc.25",
|
|
116
116
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
117
117
|
chalk: "^5.3.0",
|
|
118
118
|
consola: "^3.4.2",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as ErrorResponse, S as ServiceProvider, C as Container, c as ServiceBindings, Q as QueueManager, N as NotificationManager } from './Application-
|
|
2
|
-
export { A as Application, d as ApplicationListenOptions, e as AuthPayload, f as CSRF_FORM_FIELD, g as CSRF_HEADER_NAME, h as CSRF_TOKEN_KEY, P as ContainerProvider, i as ContextualBinding, j as ContextualBindingBuilder, k as ContextualNeedsBuilder, m as Controller, n as ControllerInertiaProps, o as CsrfOptions, p as DatabaseChannelOptions, q as DatabaseNotification, r as ExceptionClass, t as ExceptionHandler, u as ExceptionHandlerOptions, v as ExceptionRenderer, w as ExceptionReporter, F as FailedJob, H as HostAuthorizationOptions, x as HstsOptions, I as InertiaOptions, y as InertiaPagePayload, z as InertiaResponse, B as InertiaSharedProps, J as InertiaSsrContext, K as InertiaSsrOptions, L as InertiaSsrRenderer, M as InertiaSsrResult, O as InferInertiaProps, R as Job, T as JobClass, U as JobFailureHandler, V as JobHandler, W as JobOptions, X as Notifiable, Y as Notification, Z as NotificationAttachment, _ as NotificationChannel, $ as NotificationChannelFactory, a0 as NotificationClass, a1 as NotificationMailMessage, a2 as NotificationManagerOptions, a3 as ProviderManager, a4 as QueueConfig, a5 as QueueDriver, a6 as QueueDriverFactory, a7 as QueuedJob, a8 as RendererRegistration, a9 as ResolvedSharedInertiaProps, aa as ResourceRouteOptions, ab as RouteBuilder, ac as RouteContractOptions, ad as RouteDefinition, ae as RouteOpenApiMetadata, af as RouteResourceAction, ag as Router, ah as SecurityHeadersOptions, ai as SentNotification, aj as ServiceBinding, ak as ServiceClass, al as ServiceFactory, am as ServiceProviderClass, an as ServiceProviderConstructor, ao as ServiceProviderOptions, ap as SharedInertiaPropsResolver, aq as SlackAttachment, ar as SlackBlock, as as SlackMessage, at as VALIDATED_DATA_KEY, au as ValidateRequestOptions, av as ValidationSchema, aw as WorkerOptions, ax as abort, ay as abortIf, az as abortUnless, aA as clearJobRegistry, aB as createApp, aC as createContainer, aD as createCsrfMiddleware, aE as createExceptionHandler, aF as createHostAuthorizationMiddleware, aG as createNotificationManager, aH as createQueueManager, aI as createSecurityHeaders, aJ as csrfField, aK as formatValidationErrors, aL as getContainer, aM as getCsrfToken, aN as getExceptionHandler, aO as
|
|
1
|
+
import { E as ErrorResponse, S as ServiceProvider, C as Container, c as ServiceBindings, Q as QueueManager, N as NotificationManager } from './Application-D4_90raL.js';
|
|
2
|
+
export { A as Application, d as ApplicationListenOptions, e as AuthPayload, f as CSRF_FORM_FIELD, g as CSRF_HEADER_NAME, h as CSRF_TOKEN_KEY, P as ContainerProvider, i as ContextualBinding, j as ContextualBindingBuilder, k as ContextualNeedsBuilder, m as Controller, n as ControllerInertiaProps, o as CsrfOptions, p as DatabaseChannelOptions, q as DatabaseNotification, r as ExceptionClass, t as ExceptionHandler, u as ExceptionHandlerOptions, v as ExceptionRenderer, w as ExceptionReporter, F as FailedJob, H as HostAuthorizationOptions, x as HstsOptions, I as InertiaOptions, y as InertiaPagePayload, z as InertiaResponse, B as InertiaSharedProps, J as InertiaSsrContext, K as InertiaSsrOptions, L as InertiaSsrRenderer, M as InertiaSsrResult, O as InferInertiaProps, R as Job, T as JobClass, U as JobFailureHandler, V as JobHandler, W as JobOptions, X as Notifiable, Y as Notification, Z as NotificationAttachment, _ as NotificationChannel, $ as NotificationChannelFactory, a0 as NotificationClass, a1 as NotificationMailMessage, a2 as NotificationManagerOptions, a3 as ProviderManager, a4 as QueueConfig, a5 as QueueDriver, a6 as QueueDriverFactory, a7 as QueuedJob, a8 as RendererRegistration, a9 as ResolvedSharedInertiaProps, aa as ResourceRouteOptions, ab as RouteBuilder, ac as RouteContractOptions, ad as RouteDefinition, ae as RouteOpenApiMetadata, af as RouteResourceAction, ag as Router, ah as SecurityHeadersOptions, ai as SentNotification, aj as ServiceBinding, ak as ServiceClass, al as ServiceFactory, am as ServiceProviderClass, an as ServiceProviderConstructor, ao as ServiceProviderOptions, ap as SharedInertiaPropsResolver, aq as SlackAttachment, ar as SlackBlock, as as SlackMessage, at as VALIDATED_DATA_KEY, au as ValidateRequestOptions, av as ValidationSchema, aw as WorkerOptions, ax as abort, ay as abortIf, az as abortUnless, aA as clearJobRegistry, aB as createApp, aC as createContainer, aD as createCsrfMiddleware, aE as createExceptionHandler, aF as createHostAuthorizationMiddleware, aG as createNotificationManager, aH as createQueueManager, aI as createSecurityHeaders, aJ as csrfField, aK as formatValidationErrors, aL as getContainer, aM as getCsrfToken, aN as getExceptionHandler, aO as getInertiaSharedPropsResolver, aP as getJob, aQ as getNotificationManager, aR as getQueueDriver, aS as getRegisteredJobs, aT as getValidatedData, aU as inertia, aV as parseRequestPayload, aW as registerJob, aX as resolve, aY as setContainer, aZ as setExceptionHandler, a_ as setInertiaSharedProps, a$ as setNotificationManager, b0 as setQueueDriver, b1 as shareInertiaProps, b2 as validate, b3 as validateRequest, b4 as validateRequestWith, b5 as validateSafe, b6 as verifyCsrfToken } from './Application-D4_90raL.js';
|
|
3
3
|
import * as hono from 'hono';
|
|
4
4
|
import { Context, MiddlewareHandler } from 'hono';
|
|
5
5
|
export { Context } from 'hono';
|
|
@@ -35,8 +35,8 @@ export { DatabaseChannel, MailChannel, MailChannelOptions, MemoryChannel, SlackC
|
|
|
35
35
|
import { B as BroadcastManager } from './BroadcastManager-CGWl9rUO.js';
|
|
36
36
|
export { A as AuthMiddlewareOptions, a as BroadcastDriver, b as BroadcastDriverFactory, c as BroadcastEvent, d as BroadcastManagerOptions, e as BroadcastableEvent, C as Channel, f as ChannelAuthorizer, g as ChannelRegistration, P as PresenceBroadcastDriver, h as PresenceChannel, i as PresenceChannelAuthorizer, j as PresenceMember, k as PrivateChannel, S as SSEClient, l as SSEMiddlewareOptions, W as WebSocketClient, m as createBroadcastManager, n as getBroadcastManager, s as setBroadcastManager } from './BroadcastManager-CGWl9rUO.js';
|
|
37
37
|
export { RedisClient as BroadcastRedisClient, RedisDriverOptions as BroadcastRedisDriverOptions, MemoryDriver as MemoryBroadcastDriver, RedisDriver as RedisBroadcastDriver, createTypedBroadcaster } from './broadcasting/index.js';
|
|
38
|
-
import { I as InputInterface, P as ParsedSignature, O as OptionDefinition, a as CommandInstance, b as OutputInterface } from './ConsoleKernel-
|
|
39
|
-
export { A as ArgumentDefinition, c as CommandClass, C as ConsoleKernel, d as ConsoleKernelOptions, e as ProgressInterface, f as PromptInterface, S as ScheduledCommand, g as createConsoleKernel } from './ConsoleKernel-
|
|
38
|
+
import { I as InputInterface, P as ParsedSignature, O as OptionDefinition, a as CommandInstance, b as OutputInterface } from './ConsoleKernel-BPYcP-2f.js';
|
|
39
|
+
export { A as ArgumentDefinition, c as CommandClass, C as ConsoleKernel, d as ConsoleKernelOptions, e as ProgressInterface, f as PromptInterface, S as ScheduledCommand, g as createConsoleKernel } from './ConsoleKernel-BPYcP-2f.js';
|
|
40
40
|
import * as readline from 'readline';
|
|
41
41
|
export { R as AuthResponse, A as AuthUser, a as AuthorizationResponse, b as AuthorizeOptions, G as Gate, c as GateCallback, d as GateDefinition, e as GateOptions, P as PolicyClass, f as PolicyInterface, g as PolicyMethod, h as PolicyRegistration, i as ResourceAction, j as ResponseBuilder, k as authorizeAbility, l as can, m as cannot, n as createGate, o as defineGate, p as getGate, s as setGate } from './Gate-CynjZCtS.js';
|
|
42
42
|
export { AuthorizedContext, Policy, authorizeAllMiddleware, authorizeMiddleware, authorizeResourceMiddleware, definePolicy, withAuthorization } from './authorization/index.js';
|
package/dist/index.js
CHANGED
|
@@ -102,7 +102,7 @@ import {
|
|
|
102
102
|
logDevServerBanner,
|
|
103
103
|
parseImportMap,
|
|
104
104
|
startViteDevServer
|
|
105
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-IM6XKMP5.js";
|
|
106
106
|
import {
|
|
107
107
|
API_TOKEN_KEY,
|
|
108
108
|
AuthManager,
|
|
@@ -155,7 +155,7 @@ import {
|
|
|
155
155
|
verifyEmailToken,
|
|
156
156
|
verifyOAuthState,
|
|
157
157
|
verifyPasswordResetToken
|
|
158
|
-
} from "./chunk-
|
|
158
|
+
} from "./chunk-F3664MFN.js";
|
|
159
159
|
import {
|
|
160
160
|
Gate,
|
|
161
161
|
Policy,
|
|
@@ -191,14 +191,6 @@ import {
|
|
|
191
191
|
AuthenticationException,
|
|
192
192
|
HttpException
|
|
193
193
|
} from "./chunk-DAQKYKLH.js";
|
|
194
|
-
import {
|
|
195
|
-
CacheManager,
|
|
196
|
-
FileStore,
|
|
197
|
-
MemoryStore,
|
|
198
|
-
RedisStore,
|
|
199
|
-
TaggedCache,
|
|
200
|
-
createCacheManager
|
|
201
|
-
} from "./chunk-EGU5KB7V.js";
|
|
202
194
|
import {
|
|
203
195
|
BroadcastManager,
|
|
204
196
|
Channel,
|
|
@@ -208,11 +200,20 @@ import {
|
|
|
208
200
|
RedisDriver as RedisDriver2,
|
|
209
201
|
createBroadcastManager,
|
|
210
202
|
createTypedBroadcaster,
|
|
203
|
+
flattenRequestQueries,
|
|
211
204
|
formatValidationErrors,
|
|
212
205
|
getBroadcastManager,
|
|
213
206
|
parseRequestPayload,
|
|
214
207
|
setBroadcastManager
|
|
215
|
-
} from "./chunk-
|
|
208
|
+
} from "./chunk-44F7JQ7I.js";
|
|
209
|
+
import {
|
|
210
|
+
CacheManager,
|
|
211
|
+
FileStore,
|
|
212
|
+
MemoryStore,
|
|
213
|
+
RedisStore,
|
|
214
|
+
TaggedCache,
|
|
215
|
+
createCacheManager
|
|
216
|
+
} from "./chunk-EGU5KB7V.js";
|
|
216
217
|
import {
|
|
217
218
|
Encrypter,
|
|
218
219
|
createEncrypter,
|
|
@@ -623,7 +624,7 @@ function createContractHandler(path, options, handler) {
|
|
|
623
624
|
if (params instanceof Response) {
|
|
624
625
|
return params;
|
|
625
626
|
}
|
|
626
|
-
const query = parseRouteSegment(options.query, ctx
|
|
627
|
+
const query = parseRouteSegment(options.query, flattenRequestQueries(ctx), 422);
|
|
627
628
|
if (query instanceof Response) {
|
|
628
629
|
return query;
|
|
629
630
|
}
|
|
@@ -699,10 +700,11 @@ function createContractValidationMiddleware(route) {
|
|
|
699
700
|
}
|
|
700
701
|
}
|
|
701
702
|
if (schemas.query) {
|
|
702
|
-
const
|
|
703
|
+
const query = flattenRequestQueries(c);
|
|
704
|
+
const result = parseRouteSegment(schemas.query, query, 422);
|
|
703
705
|
if (result instanceof Response) {
|
|
704
706
|
throw ValidationException.withMessages(
|
|
705
|
-
formatValidationErrors(schemas.query.safeParse(
|
|
707
|
+
formatValidationErrors(schemas.query.safeParse(query).error)
|
|
706
708
|
);
|
|
707
709
|
}
|
|
708
710
|
}
|
|
@@ -754,7 +756,7 @@ function resolveHandler(action, modelBindings, container, routeBindings, path) {
|
|
|
754
756
|
const resolvedBindings = modelBindings.size > 0 ? await resolveModelBindings(c, modelBindings, path) : [];
|
|
755
757
|
const args = resolvedBindings.length > 0 ? [c, ...resolvedBindings] : [c];
|
|
756
758
|
const result = await method.apply(controller, args);
|
|
757
|
-
return ensureResponse(result);
|
|
759
|
+
return ensureResponse(result, c);
|
|
758
760
|
};
|
|
759
761
|
}
|
|
760
762
|
return async (c, next) => {
|
|
@@ -762,7 +764,7 @@ function resolveHandler(action, modelBindings, container, routeBindings, path) {
|
|
|
762
764
|
if (result === void 0 && c.finalized) {
|
|
763
765
|
return c.res;
|
|
764
766
|
}
|
|
765
|
-
return ensureResponse(result);
|
|
767
|
+
return ensureResponse(result, c);
|
|
766
768
|
};
|
|
767
769
|
}
|
|
768
770
|
async function resolveModelBindings(c, modelBindings, path) {
|
|
@@ -783,7 +785,14 @@ async function resolveModelBindings(c, modelBindings, path) {
|
|
|
783
785
|
}
|
|
784
786
|
return resolved;
|
|
785
787
|
}
|
|
786
|
-
function ensureResponse(result) {
|
|
788
|
+
function ensureResponse(result, c) {
|
|
789
|
+
const response = buildResponse(result);
|
|
790
|
+
if (c) {
|
|
791
|
+
return c.newResponse(response.body, response);
|
|
792
|
+
}
|
|
793
|
+
return response;
|
|
794
|
+
}
|
|
795
|
+
function buildResponse(result) {
|
|
787
796
|
if (result instanceof Response) {
|
|
788
797
|
return result;
|
|
789
798
|
}
|
|
@@ -1786,6 +1795,8 @@ var Application = class {
|
|
|
1786
1795
|
}
|
|
1787
1796
|
if (this.options.auth) {
|
|
1788
1797
|
this.providerManager.register(AuthServiceProvider);
|
|
1798
|
+
} else {
|
|
1799
|
+
this.hono.use("*", attachAuthContext((ctx) => this.authManager.createAuthContext(ctx)));
|
|
1789
1800
|
}
|
|
1790
1801
|
this.providerManager.register(AuthorizationServiceProvider);
|
|
1791
1802
|
const userProviders = Array.isArray(this.options.providers) ? this.options.providers : [];
|
|
@@ -1844,9 +1855,6 @@ var Application = class {
|
|
|
1844
1855
|
async boot() {
|
|
1845
1856
|
this.mountSecurityDefaults();
|
|
1846
1857
|
await this.providerManager.registerAll();
|
|
1847
|
-
if (!this.options.auth) {
|
|
1848
|
-
this.hono.use("*", attachAuthContext((ctx) => this.authManager.createAuthContext(ctx)));
|
|
1849
|
-
}
|
|
1850
1858
|
await this.options.boot?.(this.hono);
|
|
1851
1859
|
await this.mountRoutes();
|
|
1852
1860
|
await this.mountMcpEndpoint();
|
|
@@ -2318,6 +2326,14 @@ function setInertiaSharedProps(resolverFn) {
|
|
|
2318
2326
|
function getInertiaSharedPropsResolver() {
|
|
2319
2327
|
return resolver;
|
|
2320
2328
|
}
|
|
2329
|
+
function shareInertiaProps(resolverFn) {
|
|
2330
|
+
const previous = resolver;
|
|
2331
|
+
resolver = async (ctx) => {
|
|
2332
|
+
const prev = previous ? await previous(ctx) : {};
|
|
2333
|
+
const next = await resolverFn(ctx);
|
|
2334
|
+
return { ...prev, ...next };
|
|
2335
|
+
};
|
|
2336
|
+
}
|
|
2321
2337
|
async function resolveSharedInertiaProps(ctx) {
|
|
2322
2338
|
if (!resolver) return {};
|
|
2323
2339
|
const shared = await resolver(ctx);
|
|
@@ -2627,12 +2643,7 @@ var Controller = class {
|
|
|
2627
2643
|
}
|
|
2628
2644
|
/** Flatten query string arrays to scalar values for cleaner schema usage. */
|
|
2629
2645
|
flattenQueries() {
|
|
2630
|
-
|
|
2631
|
-
const flat = {};
|
|
2632
|
-
for (const [key, values] of Object.entries(queries)) {
|
|
2633
|
-
flat[key] = values.length === 1 ? values[0] : values;
|
|
2634
|
-
}
|
|
2635
|
-
return flat;
|
|
2646
|
+
return flattenRequestQueries(this.ctx);
|
|
2636
2647
|
}
|
|
2637
2648
|
// ─── Validation ─────────────────────────────────────────────────
|
|
2638
2649
|
/**
|
|
@@ -6504,6 +6515,7 @@ export {
|
|
|
6504
6515
|
getExceptionHandler,
|
|
6505
6516
|
getGate,
|
|
6506
6517
|
getI18n,
|
|
6518
|
+
getInertiaSharedPropsResolver,
|
|
6507
6519
|
getJob,
|
|
6508
6520
|
getLogManager,
|
|
6509
6521
|
getMailManager,
|
|
@@ -6604,6 +6616,7 @@ export {
|
|
|
6604
6616
|
setQueueDriver,
|
|
6605
6617
|
sha256,
|
|
6606
6618
|
sha512,
|
|
6619
|
+
shareInertiaProps,
|
|
6607
6620
|
shuffle,
|
|
6608
6621
|
signUrl,
|
|
6609
6622
|
size,
|
package/dist/lambda/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as hono_aws_lambda from 'hono/aws-lambda';
|
|
2
2
|
export { APIGatewayProxyResult, LambdaEvent } from 'hono/aws-lambda';
|
|
3
|
-
import { A as Application } from '../Application-
|
|
3
|
+
import { A as Application } from '../Application-D4_90raL.js';
|
|
4
4
|
import { S as Scheduler } from '../Scheduler-BstvSca7.js';
|
|
5
|
-
import { C as ConsoleKernel } from '../ConsoleKernel-
|
|
5
|
+
import { C as ConsoleKernel } from '../ConsoleKernel-BPYcP-2f.js';
|
|
6
6
|
import 'hono';
|
|
7
7
|
import '../api-token-BGOsfuI9.js';
|
|
8
8
|
import '@guren/orm';
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { S as ServiceProvider } from '../Application-
|
|
2
|
+
import { S as ServiceProvider } from '../Application-D4_90raL.js';
|
|
3
3
|
import 'hono';
|
|
4
4
|
import '../api-token-BGOsfuI9.js';
|
|
5
5
|
import '@guren/orm';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as NotificationChannel, X as Notifiable, Y as Notification, q as DatabaseNotification, p as DatabaseChannelOptions, as as SlackMessage, ai as SentNotification } from '../Application-
|
|
2
|
-
export { Z as NotificationAttachment, $ as NotificationChannelFactory, a0 as NotificationClass, a1 as NotificationMailMessage, N as NotificationManager, a2 as NotificationManagerOptions, aq as SlackAttachment, ar as SlackBlock, aG as createNotificationManager,
|
|
1
|
+
import { _ as NotificationChannel, X as Notifiable, Y as Notification, q as DatabaseNotification, p as DatabaseChannelOptions, as as SlackMessage, ai as SentNotification } from '../Application-D4_90raL.js';
|
|
2
|
+
export { Z as NotificationAttachment, $ as NotificationChannelFactory, a0 as NotificationClass, a1 as NotificationMailMessage, N as NotificationManager, a2 as NotificationManagerOptions, aq as SlackAttachment, ar as SlackBlock, aG as createNotificationManager, aQ as getNotificationManager, a$ as setNotificationManager } from '../Application-D4_90raL.js';
|
|
3
3
|
import { M as MailManager } from '../MailManager-DpMvYiP9.js';
|
|
4
4
|
import 'hono';
|
|
5
5
|
import '../api-token-BGOsfuI9.js';
|
package/dist/queue/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a5 as QueueDriver, a7 as QueuedJob, F as FailedJob, aw as WorkerOptions } from '../Application-
|
|
2
|
-
export { R as Job, T as JobClass, U as JobFailureHandler, V as JobHandler, W as JobOptions, a4 as QueueConfig, a6 as QueueDriverFactory, Q as QueueManager, aA as clearJobRegistry, aH as createQueueManager,
|
|
1
|
+
import { a5 as QueueDriver, a7 as QueuedJob, F as FailedJob, aw as WorkerOptions } from '../Application-D4_90raL.js';
|
|
2
|
+
export { R as Job, T as JobClass, U as JobFailureHandler, V as JobHandler, W as JobOptions, a4 as QueueConfig, a6 as QueueDriverFactory, Q as QueueManager, aA as clearJobRegistry, aH as createQueueManager, aP as getJob, aR as getQueueDriver, aS as getRegisteredJobs, aW as registerJob, b0 as setQueueDriver } from '../Application-D4_90raL.js';
|
|
3
3
|
import { Redis } from 'ioredis';
|
|
4
4
|
import 'hono';
|
|
5
5
|
import '../api-token-BGOsfuI9.js';
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Application } from '../Application-
|
|
2
|
-
export { D as DevBannerOptions, G as GUREN_ASCII_ART, a as StartViteDevServerOptions, b as StartedViteDevServer, l as logDevServerBanner, s as startViteDevServer } from '../Application-
|
|
1
|
+
import { A as Application } from '../Application-D4_90raL.js';
|
|
2
|
+
export { D as DevBannerOptions, G as GUREN_ASCII_ART, a as StartViteDevServerOptions, b as StartedViteDevServer, l as logDevServerBanner, s as startViteDevServer } from '../Application-D4_90raL.js';
|
|
3
3
|
import 'hono';
|
|
4
4
|
import '../api-token-BGOsfuI9.js';
|
|
5
5
|
import '@guren/orm';
|
package/dist/runtime/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guren/server",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.24",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
"test": "bun test"
|
|
106
106
|
},
|
|
107
107
|
"dependencies": {
|
|
108
|
-
"@guren/inertia-client": "^1.0.0-rc.
|
|
109
|
-
"@guren/orm": "^1.0.0-rc.
|
|
108
|
+
"@guren/inertia-client": "^1.0.0-rc.23",
|
|
109
|
+
"@guren/orm": "^1.0.0-rc.25",
|
|
110
110
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
111
111
|
"chalk": "^5.3.0",
|
|
112
112
|
"consola": "^3.4.2",
|