@guren/server 1.0.0-rc.20 → 1.0.0-rc.22

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.
@@ -1,13 +1,13 @@
1
1
  import * as hono from 'hono';
2
- import { Context, MiddlewareHandler, Hono, ExecutionContext } from 'hono';
2
+ import { Context, MiddlewareHandler, Hono, Next, ExecutionContext } from 'hono';
3
3
  import { A as AuthManager, O as OAuthManager, a as AuthContext, b as ApiToken, C as CreateSessionMiddlewareOptions } from './api-token-BGOsfuI9.js';
4
4
  import { InlineConfig, ViteDevServer } from 'vite';
5
5
  import { E as EventManager } from './EventManager-CmIoLt7r.js';
6
6
  import { C as CacheManager } from './CacheManager-BkvHEOZX.js';
7
7
  import { M as MailManager } from './MailManager-DpMvYiP9.js';
8
8
  import { L as LogManager } from './LogManager-7mxnkaPM.js';
9
- import { I as I18nManager } from './I18nManager-Dtgzsf5n.js';
10
- import { B as BroadcastManager } from './BroadcastManager-AkIWUGJo.js';
9
+ import { I as I18nManager } from './I18nManager-BiSoczfV.js';
10
+ import { B as BroadcastManager } from './BroadcastManager-CGWl9rUO.js';
11
11
  import { E as Encrypter, A as AppKeyring } from './app-key-CsBfRC_Q.js';
12
12
  import { S as StorageManager } from './StorageManager-oZTHqaza.js';
13
13
  import { H as HealthManager } from './HealthManager-DUyMIzsZ.js';
@@ -1761,8 +1761,10 @@ type ControllerAction<C extends ControllerConstructor = ControllerConstructor> =
1761
1761
  type RouteResult = Response | string | number | boolean | Record<string, unknown> | Array<unknown> | null | void;
1762
1762
  /**
1763
1763
  * Handler for a route - either an inline function or a controller action tuple.
1764
+ * Inline handlers receive `next`, so any Hono middleware (e.g.
1765
+ * `broadcast.sseMiddleware()`) can be mounted directly as a terminal handler.
1764
1766
  */
1765
- type RouteHandler<C extends ControllerConstructor = ControllerConstructor> = ((c: Context) => RouteResult | Promise<RouteResult>) | ControllerAction<C>;
1767
+ type RouteHandler<C extends ControllerConstructor = ControllerConstructor> = ((c: Context, next: Next) => RouteResult | Promise<RouteResult>) | ControllerAction<C>;
1766
1768
  /**
1767
1769
  * Model binding resolver function.
1768
1770
  */
@@ -123,6 +123,11 @@ interface SSEMiddlewareOptions {
123
123
  * Retry delay for SSE reconnection.
124
124
  */
125
125
  retry?: number;
126
+ /**
127
+ * Function to get the user from the request context, used to authorize
128
+ * channels requested via the `?channels=` query parameter.
129
+ */
130
+ getUser?: (ctx: unknown) => unknown | Promise<unknown>;
126
131
  }
127
132
  /**
128
133
  * Auth middleware options.
@@ -1,4 +1,4 @@
1
- import { C as Container } from './Application-C8Gja0FE.js';
1
+ import { C as Container } from './Application-Ol9W1-J2.js';
2
2
 
3
3
  /**
4
4
  * Parsed argument definition.
@@ -71,9 +71,14 @@ interface I18nConfig {
71
71
  */
72
72
  fallbackLocale?: string;
73
73
  /**
74
- * Path to translation files.
74
+ * Path to translation files (constructs a JsonLoader internally).
75
75
  */
76
76
  path?: string;
77
+ /**
78
+ * Custom translation loader (e.g. JsonLoader, MemoryLoader).
79
+ * Takes precedence over `path`.
80
+ */
81
+ loader?: TranslationLoader;
77
82
  /**
78
83
  * Preloaded messages.
79
84
  */
@@ -1,5 +1,5 @@
1
- import { B as BroadcastManager, P as PresenceBroadcastDriver, c as BroadcastEvent, j as PresenceMember } from '../BroadcastManager-AkIWUGJo.js';
2
- export { A as AuthMiddlewareOptions, a as BroadcastDriver, b as BroadcastDriverFactory, d as BroadcastManagerOptions, e as BroadcastableEvent, C as Channel, f as ChannelAuthorizer, g as ChannelRegistration, h as PresenceChannel, i as PresenceChannelAuthorizer, k as PrivateChannel, S as SSEClient, l as SSEMiddlewareOptions, W as WebSocketClient, m as createBroadcastManager, n as getBroadcastManager, s as setBroadcastManager } from '../BroadcastManager-AkIWUGJo.js';
1
+ import { B as BroadcastManager, P as PresenceBroadcastDriver, c as BroadcastEvent, j as PresenceMember } from '../BroadcastManager-CGWl9rUO.js';
2
+ export { A as AuthMiddlewareOptions, a as BroadcastDriver, b as BroadcastDriverFactory, d as BroadcastManagerOptions, e as BroadcastableEvent, C as Channel, f as ChannelAuthorizer, g as ChannelRegistration, h as PresenceChannel, i as PresenceChannelAuthorizer, 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';
3
3
  import '../index-9_Jzj5jo.js';
4
4
  import 'hono';
5
5
 
@@ -9,7 +9,7 @@ import {
9
9
  createTypedBroadcaster,
10
10
  getBroadcastManager,
11
11
  setBroadcastManager
12
- } from "../chunk-2IP4LFVT.js";
12
+ } from "../chunk-AFI3A6GB.js";
13
13
  export {
14
14
  BroadcastManager,
15
15
  Channel,
@@ -363,7 +363,7 @@ var I18nManager = class {
363
363
  loadedLocales = /* @__PURE__ */ new Set();
364
364
  constructor(config) {
365
365
  this.config = config;
366
- this.loader = config.path ? new JsonLoader(config.path) : null;
366
+ this.loader = config.loader ?? (config.path ? new JsonLoader(config.path) : null);
367
367
  this.translator = new Translator({
368
368
  locale: config.locale,
369
369
  fallbackLocale: config.fallbackLocale,
@@ -630,7 +630,7 @@ var BroadcastManager = class {
630
630
  async authorize(channelName, user) {
631
631
  const registration = this.findChannelRegistration(channelName);
632
632
  if (!registration) {
633
- return true;
633
+ return !(channelName.startsWith("private-") || channelName.startsWith("presence-"));
634
634
  }
635
635
  if (registration.type === "presence") {
636
636
  const presenceAuth = registration.authorizer;
@@ -664,6 +664,15 @@ var BroadcastManager = class {
664
664
  const clientId = this.generateClientId();
665
665
  const encoder = new TextEncoder();
666
666
  const manager = this;
667
+ const requestedChannels = (ctx.req.query("channels") ?? "").split(",").map((value) => value.trim()).filter(Boolean);
668
+ const user = options.getUser ? await options.getUser(ctx) : void 0;
669
+ const authorizedChannels = [];
670
+ for (const channelName of requestedChannels) {
671
+ const authResult = await this.authorize(channelName, user);
672
+ if (authResult !== false && authResult !== null) {
673
+ authorizedChannels.push(channelName);
674
+ }
675
+ }
667
676
  let controller = null;
668
677
  let client = null;
669
678
  let pingTimer = null;
@@ -708,6 +717,10 @@ data: ${JSON.stringify(data)}
708
717
  sendRaw(`retry: ${retry}
709
718
 
710
719
  `);
720
+ client.send("connected", { clientId, channels: authorizedChannels });
721
+ for (const channelName of authorizedChannels) {
722
+ manager.subscribeClient(clientId, channelName);
723
+ }
711
724
  pingTimer = setInterval(() => {
712
725
  try {
713
726
  client?.send("ping", { time: Date.now() });
@@ -743,16 +756,21 @@ data: ${JSON.stringify(data)}
743
756
  if (channels.length === 0) {
744
757
  return ctx.json({ error: "No channel specified" }, 400);
745
758
  }
759
+ const clientId = typeof payload.clientId === "string" ? payload.clientId : void 0;
746
760
  const results = {};
747
761
  for (const ch of channels) {
748
762
  const authResult = await this.authorize(ch, user);
749
763
  if (authResult === false || authResult === null) {
750
764
  results[ch] = { authorized: false };
751
- } else if (authResult === true) {
752
- results[ch] = { authorized: true };
765
+ continue;
766
+ }
767
+ const subscribed = clientId ? this.subscribeClient(clientId, ch) : false;
768
+ if (authResult === true) {
769
+ results[ch] = { authorized: true, subscribed };
753
770
  } else {
754
771
  results[ch] = {
755
772
  authorized: true,
773
+ subscribed,
756
774
  member: authResult
757
775
  };
758
776
  }
@@ -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.20",
9
+ version: "1.0.0-rc.22",
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.19",
115
- "@guren/orm": "^1.0.0-rc.21",
114
+ "@guren/inertia-client": "^1.0.0-rc.21",
115
+ "@guren/orm": "^1.0.0-rc.23",
116
116
  "@modelcontextprotocol/sdk": "^1.27.1",
117
117
  chalk: "^5.3.0",
118
118
  consola: "^3.4.2",
@@ -1,5 +1,5 @@
1
- import { P as PluralizationRule, T as TranslationLoader, c as TranslationMessages } from '../I18nManager-Dtgzsf5n.js';
2
- export { a as I18nConfig, I as I18nManager, R as ReplacementValues, b as TranslationLoaderFactory, d as Translator, e as TranslatorOptions, f as createI18n, g as getI18n, s as setI18n, t, h as tc } from '../I18nManager-Dtgzsf5n.js';
1
+ import { P as PluralizationRule, T as TranslationLoader, c as TranslationMessages } from '../I18nManager-BiSoczfV.js';
2
+ export { a as I18nConfig, I as I18nManager, R as ReplacementValues, b as TranslationLoaderFactory, d as Translator, e as TranslatorOptions, f as createI18n, g as getI18n, s as setI18n, t, h as tc } from '../I18nManager-BiSoczfV.js';
3
3
 
4
4
  /**
5
5
  * Default pluralization rules for common languages.
@@ -11,7 +11,7 @@ import {
11
11
  setI18n,
12
12
  t,
13
13
  tc
14
- } from "../chunk-A2AZXY4M.js";
14
+ } from "../chunk-A3ISJVEV.js";
15
15
  export {
16
16
  I18nManager,
17
17
  JsonLoader,
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-C8Gja0FE.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 getJob, aP as getNotificationManager, aQ as getQueueDriver, aR as getRegisteredJobs, aS as getValidatedData, aT as inertia, aU as parseRequestPayload, aV as registerJob, aW as resolve, aX as setContainer, aY as setExceptionHandler, aZ as setInertiaSharedProps, a_ as setNotificationManager, a$ as setQueueDriver, b0 as validate, b1 as validateRequest, b2 as validateRequestWith, b3 as validateSafe, b4 as verifyCsrfToken } from './Application-C8Gja0FE.js';
1
+ import { E as ErrorResponse, S as ServiceProvider, C as Container, c as ServiceBindings, Q as QueueManager, N as NotificationManager } from './Application-Ol9W1-J2.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 getJob, aP as getNotificationManager, aQ as getQueueDriver, aR as getRegisteredJobs, aS as getValidatedData, aT as inertia, aU as parseRequestPayload, aV as registerJob, aW as resolve, aX as setContainer, aY as setExceptionHandler, aZ as setInertiaSharedProps, a_ as setNotificationManager, a$ as setQueueDriver, b0 as validate, b1 as validateRequest, b2 as validateRequestWith, b3 as validateSafe, b4 as verifyCsrfToken } from './Application-Ol9W1-J2.js';
3
3
  import * as hono from 'hono';
4
4
  import { Context, MiddlewareHandler } from 'hono';
5
5
  export { Context } from 'hono';
@@ -26,17 +26,17 @@ export { getNextOccurrence, getNextOccurrences, isDue, isDueInTimezone, matchesC
26
26
  import { L as LogManager } from './LogManager-7mxnkaPM.js';
27
27
  export { C as ConsoleChannelConfig, D as DailyFileChannelConfig, F as FileChannelConfig, a as LOG_LEVEL_PRIORITY, b as LogChannel, c as LogChannelConfig, d as LogChannelFactory, e as LogConfig, f as LogContext, g as LogEntry, h as LogFormatter, i as LogLevel, j as Logger, k as LoggerOptions, S as StackChannelConfig, l as createLogManager, m as filterSensitiveData, n as getLogManager, s as setLogManager } from './LogManager-7mxnkaPM.js';
28
28
  export { ConsoleChannel, DailyFileChannel, FileChannel } from './logging/index.js';
29
- import { I as I18nManager } from './I18nManager-Dtgzsf5n.js';
30
- export { a as I18nConfig, P as PluralizationRule, R as ReplacementValues, T as TranslationLoader, b as TranslationLoaderFactory, c as TranslationMessages, d as Translator, e as TranslatorOptions, f as createI18n, g as getI18n, s as setI18n, t, h as tc } from './I18nManager-Dtgzsf5n.js';
29
+ import { I as I18nManager } from './I18nManager-BiSoczfV.js';
30
+ export { a as I18nConfig, P as PluralizationRule, R as ReplacementValues, T as TranslationLoader, b as TranslationLoaderFactory, c as TranslationMessages, d as Translator, e as TranslatorOptions, f as createI18n, g as getI18n, s as setI18n, t, h as tc } from './I18nManager-BiSoczfV.js';
31
31
  export { JsonLoader, MemoryLoader, getPluralizationRule, pluralizationRules, selectPluralForm } from './i18n/index.js';
32
32
  export { C as CheckResult, a as HealthCheck, b as HealthCheckOptions, H as HealthManager, c as HealthMiddlewareOptions, d as HealthReport, e as HealthStatus, f as createHealthManager } from './HealthManager-DUyMIzsZ.js';
33
33
  export { CacheCheck, CacheCheckOptions, CacheStoreInterface, CustomCheck, CustomCheckCallback, DatabaseCheck, DatabaseCheckOptions, DatabaseConnection, MemoryCheck, MemoryCheckOptions, RedisCheck, RedisCheckOptions, RedisClient, StorageCheck, StorageCheckOptions, StorageDriverInterface, customCheck } from './health/index.js';
34
34
  export { DatabaseChannel, MailChannel, MailChannelOptions, MemoryChannel, SlackChannel, SlackChannelOptions } from './notifications/index.js';
35
- import { B as BroadcastManager } from './BroadcastManager-AkIWUGJo.js';
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-AkIWUGJo.js';
35
+ import { B as BroadcastManager } from './BroadcastManager-CGWl9rUO.js';
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-JELd-SXr.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-JELd-SXr.js';
38
+ import { I as InputInterface, P as ParsedSignature, O as OptionDefinition, a as CommandInstance, b as OutputInterface } from './ConsoleKernel-yeJhrWXb.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-yeJhrWXb.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
@@ -32,7 +32,7 @@ import {
32
32
  setI18n,
33
33
  t,
34
34
  tc
35
- } from "./chunk-A2AZXY4M.js";
35
+ } from "./chunk-A3ISJVEV.js";
36
36
  import {
37
37
  ConsoleChannel,
38
38
  DailyFileChannel,
@@ -102,7 +102,7 @@ import {
102
102
  logDevServerBanner,
103
103
  parseImportMap,
104
104
  startViteDevServer
105
- } from "./chunk-TGQLJOB5.js";
105
+ } from "./chunk-OLKPSOCR.js";
106
106
  import {
107
107
  API_TOKEN_KEY,
108
108
  AuthManager,
@@ -191,6 +191,14 @@ 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";
194
202
  import {
195
203
  BroadcastManager,
196
204
  Channel,
@@ -204,15 +212,7 @@ import {
204
212
  getBroadcastManager,
205
213
  parseRequestPayload,
206
214
  setBroadcastManager
207
- } from "./chunk-2IP4LFVT.js";
208
- import {
209
- CacheManager,
210
- FileStore,
211
- MemoryStore,
212
- RedisStore,
213
- TaggedCache,
214
- createCacheManager
215
- } from "./chunk-EGU5KB7V.js";
215
+ } from "./chunk-AFI3A6GB.js";
216
216
  import {
217
217
  Encrypter,
218
218
  createEncrypter,
@@ -757,8 +757,11 @@ function resolveHandler(action, modelBindings, container, routeBindings, path) {
757
757
  return ensureResponse(result);
758
758
  };
759
759
  }
760
- return async (c) => {
761
- const result = await action(c);
760
+ return async (c, next) => {
761
+ const result = await action(c, next);
762
+ if (result === void 0 && c.finalized) {
763
+ return c.res;
764
+ }
762
765
  return ensureResponse(result);
763
766
  };
764
767
  }
@@ -957,7 +960,8 @@ function setXsrfCookie(ctx, token, options = {}) {
957
960
  const { path = "/", secure = DEFAULT_COOKIE_SECURE, sameSite = "Lax" } = options;
958
961
  ctx.header(
959
962
  "Set-Cookie",
960
- `${XSRF_COOKIE_NAME}=${encodeURIComponent(token)}; Path=${path}; SameSite=${sameSite}${secure ? "; Secure" : ""}`
963
+ `${XSRF_COOKIE_NAME}=${encodeURIComponent(token)}; Path=${path}; SameSite=${sameSite}${secure ? "; Secure" : ""}`,
964
+ { append: true }
961
965
  );
962
966
  }
963
967
 
@@ -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-C8Gja0FE.js';
3
+ import { A as Application } from '../Application-Ol9W1-J2.js';
4
4
  import { S as Scheduler } from '../Scheduler-BstvSca7.js';
5
- import { C as ConsoleKernel } from '../ConsoleKernel-JELd-SXr.js';
5
+ import { C as ConsoleKernel } from '../ConsoleKernel-yeJhrWXb.js';
6
6
  import 'hono';
7
7
  import '../api-token-BGOsfuI9.js';
8
8
  import '@guren/orm';
@@ -11,8 +11,8 @@ import '../EventManager-CmIoLt7r.js';
11
11
  import '../CacheManager-BkvHEOZX.js';
12
12
  import '../MailManager-DpMvYiP9.js';
13
13
  import '../LogManager-7mxnkaPM.js';
14
- import '../I18nManager-Dtgzsf5n.js';
15
- import '../BroadcastManager-AkIWUGJo.js';
14
+ import '../I18nManager-BiSoczfV.js';
15
+ import '../BroadcastManager-CGWl9rUO.js';
16
16
  import '../index-9_Jzj5jo.js';
17
17
  import '../app-key-CsBfRC_Q.js';
18
18
  import '../StorageManager-oZTHqaza.js';
@@ -1,5 +1,5 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import { S as ServiceProvider } from '../Application-C8Gja0FE.js';
2
+ import { S as ServiceProvider } from '../Application-Ol9W1-J2.js';
3
3
  import 'hono';
4
4
  import '../api-token-BGOsfuI9.js';
5
5
  import '@guren/orm';
@@ -8,8 +8,8 @@ import '../EventManager-CmIoLt7r.js';
8
8
  import '../CacheManager-BkvHEOZX.js';
9
9
  import '../MailManager-DpMvYiP9.js';
10
10
  import '../LogManager-7mxnkaPM.js';
11
- import '../I18nManager-Dtgzsf5n.js';
12
- import '../BroadcastManager-AkIWUGJo.js';
11
+ import '../I18nManager-BiSoczfV.js';
12
+ import '../BroadcastManager-CGWl9rUO.js';
13
13
  import '../index-9_Jzj5jo.js';
14
14
  import '../app-key-CsBfRC_Q.js';
15
15
  import '../StorageManager-oZTHqaza.js';
@@ -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-C8Gja0FE.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, aP as getNotificationManager, a_ as setNotificationManager } from '../Application-C8Gja0FE.js';
1
+ import { _ as NotificationChannel, X as Notifiable, Y as Notification, q as DatabaseNotification, p as DatabaseChannelOptions, as as SlackMessage, ai as SentNotification } from '../Application-Ol9W1-J2.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, aP as getNotificationManager, a_ as setNotificationManager } from '../Application-Ol9W1-J2.js';
3
3
  import { M as MailManager } from '../MailManager-DpMvYiP9.js';
4
4
  import 'hono';
5
5
  import '../api-token-BGOsfuI9.js';
@@ -8,8 +8,8 @@ import 'vite';
8
8
  import '../EventManager-CmIoLt7r.js';
9
9
  import '../CacheManager-BkvHEOZX.js';
10
10
  import '../LogManager-7mxnkaPM.js';
11
- import '../I18nManager-Dtgzsf5n.js';
12
- import '../BroadcastManager-AkIWUGJo.js';
11
+ import '../I18nManager-BiSoczfV.js';
12
+ import '../BroadcastManager-CGWl9rUO.js';
13
13
  import '../index-9_Jzj5jo.js';
14
14
  import '../app-key-CsBfRC_Q.js';
15
15
  import '../StorageManager-oZTHqaza.js';
@@ -1,5 +1,5 @@
1
- import { a5 as QueueDriver, a7 as QueuedJob, F as FailedJob, aw as WorkerOptions } from '../Application-C8Gja0FE.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, aO as getJob, aQ as getQueueDriver, aR as getRegisteredJobs, aV as registerJob, a$ as setQueueDriver } from '../Application-C8Gja0FE.js';
1
+ import { a5 as QueueDriver, a7 as QueuedJob, F as FailedJob, aw as WorkerOptions } from '../Application-Ol9W1-J2.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, aO as getJob, aQ as getQueueDriver, aR as getRegisteredJobs, aV as registerJob, a$ as setQueueDriver } from '../Application-Ol9W1-J2.js';
3
3
  import { Redis } from 'ioredis';
4
4
  import 'hono';
5
5
  import '../api-token-BGOsfuI9.js';
@@ -9,8 +9,8 @@ import '../EventManager-CmIoLt7r.js';
9
9
  import '../CacheManager-BkvHEOZX.js';
10
10
  import '../MailManager-DpMvYiP9.js';
11
11
  import '../LogManager-7mxnkaPM.js';
12
- import '../I18nManager-Dtgzsf5n.js';
13
- import '../BroadcastManager-AkIWUGJo.js';
12
+ import '../I18nManager-BiSoczfV.js';
13
+ import '../BroadcastManager-CGWl9rUO.js';
14
14
  import '../index-9_Jzj5jo.js';
15
15
  import '../app-key-CsBfRC_Q.js';
16
16
  import '../StorageManager-oZTHqaza.js';
@@ -1,5 +1,5 @@
1
- import { A as Application } from '../Application-C8Gja0FE.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-C8Gja0FE.js';
1
+ import { A as Application } from '../Application-Ol9W1-J2.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-Ol9W1-J2.js';
3
3
  import 'hono';
4
4
  import '../api-token-BGOsfuI9.js';
5
5
  import '@guren/orm';
@@ -8,8 +8,8 @@ import '../EventManager-CmIoLt7r.js';
8
8
  import '../CacheManager-BkvHEOZX.js';
9
9
  import '../MailManager-DpMvYiP9.js';
10
10
  import '../LogManager-7mxnkaPM.js';
11
- import '../I18nManager-Dtgzsf5n.js';
12
- import '../BroadcastManager-AkIWUGJo.js';
11
+ import '../I18nManager-BiSoczfV.js';
12
+ import '../BroadcastManager-CGWl9rUO.js';
13
13
  import '../index-9_Jzj5jo.js';
14
14
  import '../app-key-CsBfRC_Q.js';
15
15
  import '../StorageManager-oZTHqaza.js';
@@ -3,7 +3,7 @@ import {
3
3
  logDevServerBanner,
4
4
  parseImportMap,
5
5
  startViteDevServer
6
- } from "../chunk-TGQLJOB5.js";
6
+ } from "../chunk-OLKPSOCR.js";
7
7
  import {
8
8
  hash
9
9
  } from "../chunk-QQKTH5KX.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guren/server",
3
- "version": "1.0.0-rc.20",
3
+ "version": "1.0.0-rc.22",
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.19",
109
- "@guren/orm": "^1.0.0-rc.21",
108
+ "@guren/inertia-client": "^1.0.0-rc.21",
109
+ "@guren/orm": "^1.0.0-rc.23",
110
110
  "@modelcontextprotocol/sdk": "^1.27.1",
111
111
  "chalk": "^5.3.0",
112
112
  "consola": "^3.4.2",