gemi 0.56.0 → 0.58.0

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 (257) hide show
  1. package/dist/app/index.js +1 -1
  2. package/dist/broadcasting/index.js +1 -1
  3. package/dist/bun/plugin.js +1 -1
  4. package/dist/bun/preload.js +1 -1
  5. package/dist/{chunk-jdj7k3r9.js → chunk-0a2xgcj3.js} +2 -2
  6. package/dist/{chunk-jdj7k3r9.js.map → chunk-0a2xgcj3.js.map} +1 -1
  7. package/dist/{chunk-3e88tyee.js → chunk-3337e5g0.js} +2 -2
  8. package/dist/{chunk-3e88tyee.js.map → chunk-3337e5g0.js.map} +1 -1
  9. package/dist/chunk-3aa287k7.js +6 -0
  10. package/dist/{chunk-cv9w5cmb.js.map → chunk-3aa287k7.js.map} +2 -2
  11. package/dist/{chunk-01am9k5v.js → chunk-3g5bjvdf.js} +2 -2
  12. package/dist/{chunk-01am9k5v.js.map → chunk-3g5bjvdf.js.map} +1 -1
  13. package/dist/{chunk-w9k9s4wh.js → chunk-3xadx444.js} +2 -2
  14. package/dist/{chunk-w9k9s4wh.js.map → chunk-3xadx444.js.map} +1 -1
  15. package/dist/{chunk-npg72mez.js → chunk-3zxwscmf.js} +2 -2
  16. package/dist/{chunk-kgmr9qxx.js.map → chunk-3zxwscmf.js.map} +1 -1
  17. package/dist/{chunk-64s1pzz1.js → chunk-437085pe.js} +2 -2
  18. package/dist/{chunk-64s1pzz1.js.map → chunk-437085pe.js.map} +1 -1
  19. package/dist/{chunk-eqrd31ye.js → chunk-4yt5x8s2.js} +2 -2
  20. package/dist/{chunk-eqrd31ye.js.map → chunk-4yt5x8s2.js.map} +1 -1
  21. package/dist/{chunk-9r0sb4zn.js → chunk-5athahgr.js} +2 -2
  22. package/dist/{chunk-9r0sb4zn.js.map → chunk-5athahgr.js.map} +1 -1
  23. package/dist/{chunk-g30q4n5y.js → chunk-5n2rvfh3.js} +2 -2
  24. package/dist/{chunk-g30q4n5y.js.map → chunk-5n2rvfh3.js.map} +1 -1
  25. package/dist/{chunk-1zfsgffv.js → chunk-6235kb30.js} +3 -3
  26. package/dist/{chunk-1zfsgffv.js.map → chunk-6235kb30.js.map} +1 -1
  27. package/dist/{chunk-javjeayw.js → chunk-7b0x860b.js} +2 -2
  28. package/dist/{chunk-javjeayw.js.map → chunk-7b0x860b.js.map} +1 -1
  29. package/dist/{chunk-4qwwy968.js → chunk-7ef5n8k2.js} +2 -2
  30. package/dist/{chunk-4qwwy968.js.map → chunk-7ef5n8k2.js.map} +1 -1
  31. package/dist/{chunk-q0waxxz5.js → chunk-7j6wbv12.js} +2 -2
  32. package/dist/{chunk-q0waxxz5.js.map → chunk-7j6wbv12.js.map} +1 -1
  33. package/dist/chunk-86jebsm4.js +9 -0
  34. package/dist/{chunk-kry5vwam.js.map → chunk-86jebsm4.js.map} +3 -3
  35. package/dist/chunk-87qab82w.js +5 -0
  36. package/dist/chunk-87qab82w.js.map +37 -0
  37. package/dist/{chunk-36pg61vt.js → chunk-8gew8b9a.js} +2 -2
  38. package/dist/{chunk-36pg61vt.js.map → chunk-8gew8b9a.js.map} +1 -1
  39. package/dist/{chunk-v6v6sem5.js → chunk-9m2tbf3n.js} +2 -2
  40. package/dist/{chunk-v6v6sem5.js.map → chunk-9m2tbf3n.js.map} +1 -1
  41. package/dist/{chunk-gzdf2025.js → chunk-a2sgjpvq.js} +2 -2
  42. package/dist/{chunk-gzdf2025.js.map → chunk-a2sgjpvq.js.map} +1 -1
  43. package/dist/chunk-b35e128b.js +5 -0
  44. package/dist/{chunk-b50zmz3t.js.map → chunk-b35e128b.js.map} +1 -1
  45. package/dist/{chunk-ct274qts.js → chunk-cyaz97p5.js} +2 -2
  46. package/dist/{chunk-ct274qts.js.map → chunk-cyaz97p5.js.map} +1 -1
  47. package/dist/{chunk-v06qcyj5.js → chunk-d125j8t0.js} +3 -3
  48. package/dist/{chunk-v06qcyj5.js.map → chunk-d125j8t0.js.map} +1 -1
  49. package/dist/{chunk-hs5v3eqj.js → chunk-dgsgjg53.js} +2 -2
  50. package/dist/{chunk-hs5v3eqj.js.map → chunk-dgsgjg53.js.map} +1 -1
  51. package/dist/{chunk-xjy5apyr.js → chunk-eejmhtnc.js} +2 -2
  52. package/dist/{chunk-xjy5apyr.js.map → chunk-eejmhtnc.js.map} +1 -1
  53. package/dist/{chunk-3y75q5a2.js → chunk-fjm4y8bn.js} +2 -2
  54. package/dist/{chunk-3y75q5a2.js.map → chunk-fjm4y8bn.js.map} +1 -1
  55. package/dist/{chunk-9c89q2mz.js → chunk-grdahng8.js} +2 -2
  56. package/dist/{chunk-9c89q2mz.js.map → chunk-grdahng8.js.map} +1 -1
  57. package/dist/{chunk-699z6d8y.js → chunk-gw6agevz.js} +3 -3
  58. package/dist/{chunk-699z6d8y.js.map → chunk-gw6agevz.js.map} +1 -1
  59. package/dist/{chunk-62ke19q4.js → chunk-hppagzz4.js} +4 -4
  60. package/dist/{chunk-62ke19q4.js.map → chunk-hppagzz4.js.map} +1 -1
  61. package/dist/chunk-hwa5sqw5.js +19 -0
  62. package/dist/{chunk-tmnhkphv.js.map → chunk-hwa5sqw5.js.map} +12 -6
  63. package/dist/chunk-hxf1re93.js +4 -0
  64. package/dist/{chunk-vkngcrzq.js.map → chunk-hxf1re93.js.map} +6 -5
  65. package/dist/{chunk-d36dfqxw.js → chunk-j0c6ytkj.js} +3 -3
  66. package/dist/{chunk-d36dfqxw.js.map → chunk-j0c6ytkj.js.map} +1 -1
  67. package/dist/{chunk-kgmr9qxx.js → chunk-jhkjz9jr.js} +2 -2
  68. package/dist/{chunk-npg72mez.js.map → chunk-jhkjz9jr.js.map} +1 -1
  69. package/dist/{chunk-62723jyy.js → chunk-k0fvsyeh.js} +1 -1
  70. package/dist/{chunk-31kcf7dq.js → chunk-keehyx51.js} +2 -2
  71. package/dist/{chunk-31kcf7dq.js.map → chunk-keehyx51.js.map} +1 -1
  72. package/dist/{chunk-enhkf60v.js → chunk-m3xy5xyf.js} +2 -2
  73. package/dist/{chunk-enhkf60v.js.map → chunk-m3xy5xyf.js.map} +1 -1
  74. package/dist/{chunk-c75mymmq.js → chunk-mkfpnymy.js} +1 -1
  75. package/dist/{chunk-rgb69nh1.js → chunk-mwpdp09e.js} +2 -2
  76. package/dist/{chunk-rgb69nh1.js.map → chunk-mwpdp09e.js.map} +1 -1
  77. package/dist/chunk-pmhd6zfc.js +37 -0
  78. package/dist/chunk-pmhd6zfc.js.map +20 -0
  79. package/dist/chunk-qb5mv6pj.js +5 -0
  80. package/dist/chunk-qb5mv6pj.js.map +12 -0
  81. package/dist/{chunk-1pwwrpa3.js → chunk-qgxr0g36.js} +2 -2
  82. package/dist/{chunk-1pwwrpa3.js.map → chunk-qgxr0g36.js.map} +1 -1
  83. package/dist/{chunk-4yafsffx.js → chunk-sy7jbdeb.js} +2 -2
  84. package/dist/{chunk-4yafsffx.js.map → chunk-sy7jbdeb.js.map} +1 -1
  85. package/dist/{chunk-gasdfwva.js → chunk-szss069z.js} +2 -2
  86. package/dist/{chunk-gasdfwva.js.map → chunk-szss069z.js.map} +1 -1
  87. package/dist/{chunk-m0ggfy1m.js → chunk-tss5svjr.js} +2 -2
  88. package/dist/{chunk-m0ggfy1m.js.map → chunk-tss5svjr.js.map} +1 -1
  89. package/dist/{chunk-dzzmqv0j.js → chunk-vr90r27j.js} +2 -2
  90. package/dist/{chunk-dzzmqv0j.js.map → chunk-vr90r27j.js.map} +1 -1
  91. package/dist/{chunk-pvdbrt4z.js → chunk-w62m5f0n.js} +3 -3
  92. package/dist/{chunk-pvdbrt4z.js.map → chunk-w62m5f0n.js.map} +1 -1
  93. package/dist/{chunk-cn2r5jfj.js → chunk-w7rf99w6.js} +2 -2
  94. package/dist/{chunk-cn2r5jfj.js.map → chunk-w7rf99w6.js.map} +1 -1
  95. package/dist/{chunk-tja0c815.js → chunk-wbrj0gya.js} +2 -2
  96. package/dist/{chunk-tja0c815.js.map → chunk-wbrj0gya.js.map} +1 -1
  97. package/dist/{chunk-rsdg619q.js → chunk-xdv1b8mr.js} +2 -2
  98. package/dist/{chunk-rsdg619q.js.map → chunk-xdv1b8mr.js.map} +1 -1
  99. package/dist/{chunk-h3mwgbg7.js → chunk-xey9cbap.js} +2 -2
  100. package/dist/{chunk-h3mwgbg7.js.map → chunk-xey9cbap.js.map} +1 -1
  101. package/dist/{chunk-wgpa04jb.js → chunk-xzk827r3.js} +2 -2
  102. package/dist/{chunk-wgpa04jb.js.map → chunk-xzk827r3.js.map} +1 -1
  103. package/dist/{chunk-x14sk95v.js → chunk-y6a8r2bn.js} +3 -3
  104. package/dist/{chunk-x14sk95v.js.map → chunk-y6a8r2bn.js.map} +1 -1
  105. package/dist/{chunk-33wjsw4r.js → chunk-yed5whgs.js} +3 -3
  106. package/dist/{chunk-33wjsw4r.js.map → chunk-yed5whgs.js.map} +1 -1
  107. package/dist/{chunk-02gdzs5t.js → chunk-yf7vz71n.js} +1 -1
  108. package/dist/{chunk-y9fp58bg.js → chunk-yjzs247s.js} +2 -2
  109. package/dist/{chunk-y9fp58bg.js.map → chunk-yjzs247s.js.map} +1 -1
  110. package/dist/{chunk-kgg1eqne.js → chunk-yy0eb9wn.js} +2 -2
  111. package/dist/{chunk-kgg1eqne.js.map → chunk-yy0eb9wn.js.map} +1 -1
  112. package/dist/{chunk-4xx78ba9.js → chunk-zbxgbr12.js} +2 -2
  113. package/dist/{chunk-4xx78ba9.js.map → chunk-zbxgbr12.js.map} +1 -1
  114. package/dist/{chunk-8k1zqrvh.js → chunk-zh2egcyb.js} +2 -2
  115. package/dist/{chunk-8k1zqrvh.js.map → chunk-zh2egcyb.js.map} +1 -1
  116. package/dist/chunks/ThemeProvider-li1J_igh.js.map +1 -1
  117. package/dist/client/ClientRouter.d.ts.map +1 -1
  118. package/dist/client/ProgressManager.d.ts +1 -1
  119. package/dist/client/RouteStateContext.d.ts +9 -0
  120. package/dist/client/RouteStateContext.d.ts.map +1 -1
  121. package/dist/client/ServerDataProvider.d.ts +7 -0
  122. package/dist/client/ServerDataProvider.d.ts.map +1 -1
  123. package/dist/client/index.d.ts +2 -1
  124. package/dist/client/index.d.ts.map +1 -1
  125. package/dist/client/index.js +68 -10
  126. package/dist/client/index.js.map +1 -1
  127. package/dist/client/rpc.d.ts +42 -0
  128. package/dist/client/rpc.d.ts.map +1 -1
  129. package/dist/client/useFeature.d.ts +40 -0
  130. package/dist/client/useFeature.d.ts.map +1 -0
  131. package/dist/config/index.js +1 -1
  132. package/dist/console/run.js +2 -2
  133. package/dist/console/run.js.map +1 -1
  134. package/dist/container/index.js +2 -2
  135. package/dist/container/index.js.map +1 -1
  136. package/dist/database/index.js +2 -2
  137. package/dist/database/index.js.map +1 -1
  138. package/dist/email/index.js +2 -2
  139. package/dist/email/index.js.map +1 -1
  140. package/dist/facades/Features.d.ts +57 -0
  141. package/dist/facades/Features.d.ts.map +1 -0
  142. package/dist/facades/index.d.ts +1 -0
  143. package/dist/facades/index.d.ts.map +1 -1
  144. package/dist/facades/index.js +2 -2
  145. package/dist/facades/index.js.map +1 -1
  146. package/dist/foundation/index.js +2 -2
  147. package/dist/foundation/index.js.map +1 -1
  148. package/dist/gemi.d.ts +13 -5
  149. package/dist/http/ApiRouter.d.ts +3 -2
  150. package/dist/http/ApiRouter.d.ts.map +1 -1
  151. package/dist/http/HttpRequest.d.ts +4 -0
  152. package/dist/http/HttpRequest.d.ts.map +1 -1
  153. package/dist/http/ViewRouter.d.ts +127 -4
  154. package/dist/http/ViewRouter.d.ts.map +1 -1
  155. package/dist/http/index.d.ts +1 -0
  156. package/dist/http/index.d.ts.map +1 -1
  157. package/dist/http/index.js +2 -2
  158. package/dist/http/index.js.map +1 -1
  159. package/dist/http/middlewareList.d.ts +25 -0
  160. package/dist/http/middlewareList.d.ts.map +1 -0
  161. package/dist/http/requestContext.d.ts +57 -0
  162. package/dist/http/requestContext.d.ts.map +1 -1
  163. package/dist/i18n/dictionaryRuntime.js +2 -2
  164. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  165. package/dist/i18n/index.js +2 -2
  166. package/dist/i18n/index.js.map +1 -1
  167. package/dist/ide/typescript-plugin/index.js +1206 -0
  168. package/dist/ide/typescript-plugin/index.js.map +17 -0
  169. package/dist/kernel/index.js +3 -3
  170. package/dist/kernel/index.js.map +3 -3
  171. package/dist/kernel/providers.d.ts +16 -4
  172. package/dist/kernel/providers.d.ts.map +1 -1
  173. package/dist/orm/context.d.ts +65 -0
  174. package/dist/orm/context.d.ts.map +1 -1
  175. package/dist/orm/index.js +2 -2
  176. package/dist/orm/index.js.map +1 -1
  177. package/dist/server/index.js +2 -2
  178. package/dist/server/index.js.map +1 -1
  179. package/dist/services/discovery.d.ts +27 -0
  180. package/dist/services/discovery.d.ts.map +1 -1
  181. package/dist/services/events/Event.d.ts +208 -0
  182. package/dist/services/events/Event.d.ts.map +1 -0
  183. package/dist/services/events/EventManager.d.ts +285 -0
  184. package/dist/services/events/EventManager.d.ts.map +1 -0
  185. package/dist/services/events/EventServiceProvider.d.ts +46 -0
  186. package/dist/services/events/EventServiceProvider.d.ts.map +1 -0
  187. package/dist/services/events/FakeEventManager.d.ts +155 -0
  188. package/dist/services/events/FakeEventManager.d.ts.map +1 -0
  189. package/dist/services/events/FakeEventManager.test-d.d.ts +2 -0
  190. package/dist/services/events/FakeEventManager.test-d.d.ts.map +1 -0
  191. package/dist/services/events/Listener.d.ts +189 -0
  192. package/dist/services/events/Listener.d.ts.map +1 -0
  193. package/dist/services/events/Listener.test-d.d.ts +2 -0
  194. package/dist/services/events/Listener.test-d.d.ts.map +1 -0
  195. package/dist/services/events/config.d.ts +55 -0
  196. package/dist/services/events/config.d.ts.map +1 -0
  197. package/dist/services/events/listenerJob.d.ts +43 -0
  198. package/dist/services/events/listenerJob.d.ts.map +1 -0
  199. package/dist/services/features/FeatureFlagStore.d.ts +60 -0
  200. package/dist/services/features/FeatureFlagStore.d.ts.map +1 -0
  201. package/dist/services/features/FeatureManager.d.ts +82 -0
  202. package/dist/services/features/FeatureManager.d.ts.map +1 -0
  203. package/dist/services/features/FeaturesServiceProvider.d.ts +6 -0
  204. package/dist/services/features/FeaturesServiceProvider.d.ts.map +1 -0
  205. package/dist/services/features/bucket.d.ts +57 -0
  206. package/dist/services/features/bucket.d.ts.map +1 -0
  207. package/dist/services/features/config.d.ts +57 -0
  208. package/dist/services/features/config.d.ts.map +1 -0
  209. package/dist/services/features/context.d.ts +31 -0
  210. package/dist/services/features/context.d.ts.map +1 -0
  211. package/dist/services/features/defineFeature.d.ts +145 -0
  212. package/dist/services/features/defineFeature.d.ts.map +1 -0
  213. package/dist/services/features/evaluate.d.ts +74 -0
  214. package/dist/services/features/evaluate.d.ts.map +1 -0
  215. package/dist/services/features/sources/DatabaseFeatureFlagSource.d.ts +19 -0
  216. package/dist/services/features/sources/DatabaseFeatureFlagSource.d.ts.map +1 -0
  217. package/dist/services/features/sources/FeatureFlagSource.d.ts +30 -0
  218. package/dist/services/features/sources/FeatureFlagSource.d.ts.map +1 -0
  219. package/dist/services/features/sources/StaticFeatureFlagSource.d.ts +24 -0
  220. package/dist/services/features/sources/StaticFeatureFlagSource.d.ts.map +1 -0
  221. package/dist/services/features/types.d.ts +63 -0
  222. package/dist/services/features/types.d.ts.map +1 -0
  223. package/dist/services/index.d.ts +18 -1
  224. package/dist/services/index.d.ts.map +1 -1
  225. package/dist/services/index.js +8 -8
  226. package/dist/services/index.js.map +8 -4
  227. package/dist/services/queue/QueueManager.d.ts +31 -0
  228. package/dist/services/queue/QueueManager.d.ts.map +1 -1
  229. package/dist/services/router/ViewRouteDispatcher.d.ts +8 -0
  230. package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
  231. package/dist/services/router/createFlatViewRoutes.d.ts +14 -0
  232. package/dist/services/router/createFlatViewRoutes.d.ts.map +1 -1
  233. package/dist/services/router/streamQueryInjection.d.ts.map +1 -1
  234. package/dist/support/index.js +2 -2
  235. package/dist/support/index.js.map +1 -1
  236. package/dist/testing/Page.d.ts +12 -0
  237. package/dist/testing/Page.d.ts.map +1 -1
  238. package/dist/testing/index.d.ts +24 -0
  239. package/dist/testing/index.d.ts.map +1 -1
  240. package/dist/testing/index.js +7 -3
  241. package/dist/testing/index.js.map +1 -1
  242. package/ide/typescript-plugin/package.json +5 -0
  243. package/package.json +4 -2
  244. package/dist/chunk-4t80js0n.js +0 -33
  245. package/dist/chunk-4t80js0n.js.map +0 -18
  246. package/dist/chunk-98a576s9.js +0 -5
  247. package/dist/chunk-98a576s9.js.map +0 -30
  248. package/dist/chunk-b50zmz3t.js +0 -5
  249. package/dist/chunk-cv9w5cmb.js +0 -6
  250. package/dist/chunk-f9mfw82d.js +0 -5
  251. package/dist/chunk-f9mfw82d.js.map +0 -12
  252. package/dist/chunk-kry5vwam.js +0 -9
  253. package/dist/chunk-tmnhkphv.js +0 -19
  254. package/dist/chunk-vkngcrzq.js +0 -4
  255. /package/dist/{chunk-62723jyy.js.map → chunk-k0fvsyeh.js.map} +0 -0
  256. /package/dist/{chunk-c75mymmq.js.map → chunk-mkfpnymy.js.map} +0 -0
  257. /package/dist/{chunk-02gdzs5t.js.map → chunk-yf7vz71n.js.map} +0 -0
@@ -2,6 +2,8 @@ import type { RemoveGroupPrefix } from "../client/types";
2
2
  import type { KeyAndValue, KeyAndValueToObject } from "../internal/type-utils";
3
3
  import type { Controller } from "./Controller";
4
4
  import type { HttpRequest } from "./HttpRequest";
5
+ import type { FeatureKey } from "../client/rpc";
6
+ import { type MiddlewareInput } from "./middlewareList";
5
7
  type ControllerMethods<T extends new () => Controller> = {
6
8
  [K in keyof InstanceType<T>]: InstanceType<T>[K] extends Function ? K : never;
7
9
  }[keyof InstanceType<T>];
@@ -20,10 +22,40 @@ export declare class RedirectRoute<Input, Output, Params> {
20
22
  kind: "redirect";
21
23
  viewPath: string;
22
24
  middlewares: string[];
25
+ featureGates: string[];
23
26
  private handler;
24
27
  constructor(handler?: CallbackHandler<Input, RedirectOutput, Params> | [new () => Controller, ControllerMethods<any>]);
25
28
  run(req: HttpRequest<Input, Params>, path: string): Promise<{}>;
26
- middleware(middlewares: string[]): this;
29
+ middleware(middlewares: MiddlewareInput): this;
30
+ /**
31
+ * Hides this route behind a feature flag.
32
+ *
33
+ * When the flag is off the route behaves as though it does not exist — the
34
+ * application's own `404` view, with a 404 status — rather than returning an
35
+ * error page that confirms something is there.
36
+ *
37
+ * Returns `this`, so the route's type is unchanged and the path keeps its
38
+ * entry in `ViewPaths`: `<Link>` and `Redirect.to` stay typed. That also means
39
+ * the path is still in the route manifest the browser receives, so this gates
40
+ * the *response*, not the route's existence. Declare the feature
41
+ * `defineFeature({ serverOnly: true })` and keep unreleased routes out of the
42
+ * client tree if the name itself is the secret.
43
+ *
44
+ * ## A `rollout` is not access control
45
+ *
46
+ * Gate on `active` — a feature nobody has switched on is unreachable, which is
47
+ * the case this is for — or on a `when` that reads something the visitor
48
+ * cannot choose, like the signed-in user.
49
+ *
50
+ * A `rollout` is neither, for an anonymous visitor. The subject is their
51
+ * `session_id` cookie, which they supply; bucketing is a published pure
52
+ * function of it, so they can compute one that lands inside any percentage and
53
+ * send it. Signing the cookie would not fix this — they can equally well
54
+ * discard it and ask for a fresh one until a signed id happens to land inside,
55
+ * which for a 5% rollout is a couple of dozen requests. Nothing that hands out
56
+ * identities on demand can restrict anything to a fraction of them.
57
+ */
58
+ feature(key: FeatureKey): this;
27
59
  }
28
60
  export type FileBody = Blob | ReadableStream | ArrayBuffer | ArrayBufferView | string;
29
61
  export type FileOutput = Blob | Response | {
@@ -42,16 +74,47 @@ export declare class FileRoute<Input, Params> {
42
74
  kind: "file";
43
75
  viewPath: string;
44
76
  middlewares: string[];
77
+ featureGates: string[];
45
78
  private handler;
46
79
  constructor(handler?: CallbackHandler<Input, FileOutput, Params> | [new () => Controller, ControllerMethods<any>]);
47
80
  run(req: HttpRequest<Input, Params>, path: string): Promise<{
48
81
  FILE: FileOutput;
49
82
  }>;
50
- middleware(middlewares: string[]): this;
83
+ middleware(middlewares: MiddlewareInput): this;
84
+ /**
85
+ * Hides this route behind a feature flag.
86
+ *
87
+ * When the flag is off the route behaves as though it does not exist — the
88
+ * application's own `404` view, with a 404 status — rather than returning an
89
+ * error page that confirms something is there.
90
+ *
91
+ * Returns `this`, so the route's type is unchanged and the path keeps its
92
+ * entry in `ViewPaths`: `<Link>` and `Redirect.to` stay typed. That also means
93
+ * the path is still in the route manifest the browser receives, so this gates
94
+ * the *response*, not the route's existence. Declare the feature
95
+ * `defineFeature({ serverOnly: true })` and keep unreleased routes out of the
96
+ * client tree if the name itself is the secret.
97
+ *
98
+ * ## A `rollout` is not access control
99
+ *
100
+ * Gate on `active` — a feature nobody has switched on is unreachable, which is
101
+ * the case this is for — or on a `when` that reads something the visitor
102
+ * cannot choose, like the signed-in user.
103
+ *
104
+ * A `rollout` is neither, for an anonymous visitor. The subject is their
105
+ * `session_id` cookie, which they supply; bucketing is a published pure
106
+ * function of it, so they can compute one that lands inside any percentage and
107
+ * send it. Signing the cookie would not fix this — they can equally well
108
+ * discard it and ask for a fresh one until a signed id happens to land inside,
109
+ * which for a 5% rollout is a couple of dozen requests. Nothing that hands out
110
+ * identities on demand can restrict anything to a fraction of them.
111
+ */
112
+ feature(key: FeatureKey): this;
51
113
  }
52
114
  export declare class ViewRoute<Input, Output, Params> {
53
115
  viewPath: string;
54
116
  middlewares: string[];
117
+ featureGates: string[];
55
118
  private handler;
56
119
  constructor(viewPath: string, handler?: CallbackHandler<Input, Output, Params> | [new () => Controller, ControllerMethods<any>]);
57
120
  run(req: HttpRequest<Input, Params>, path: string): Promise<{
@@ -62,12 +125,42 @@ export declare class ViewRoute<Input, Output, Params> {
62
125
  };
63
126
  };
64
127
  }>;
65
- middleware(middlewares: string[]): this;
128
+ middleware(middlewares: MiddlewareInput): this;
129
+ /**
130
+ * Hides this route behind a feature flag.
131
+ *
132
+ * When the flag is off the route behaves as though it does not exist — the
133
+ * application's own `404` view, with a 404 status — rather than returning an
134
+ * error page that confirms something is there.
135
+ *
136
+ * Returns `this`, so the route's type is unchanged and the path keeps its
137
+ * entry in `ViewPaths`: `<Link>` and `Redirect.to` stay typed. That also means
138
+ * the path is still in the route manifest the browser receives, so this gates
139
+ * the *response*, not the route's existence. Declare the feature
140
+ * `defineFeature({ serverOnly: true })` and keep unreleased routes out of the
141
+ * client tree if the name itself is the secret.
142
+ *
143
+ * ## A `rollout` is not access control
144
+ *
145
+ * Gate on `active` — a feature nobody has switched on is unreachable, which is
146
+ * the case this is for — or on a `when` that reads something the visitor
147
+ * cannot choose, like the signed-in user.
148
+ *
149
+ * A `rollout` is neither, for an anonymous visitor. The subject is their
150
+ * `session_id` cookie, which they supply; bucketing is a published pure
151
+ * function of it, so they can compute one that lands inside any percentage and
152
+ * send it. Signing the cookie would not fix this — they can equally well
153
+ * discard it and ask for a fresh one until a signed id happens to land inside,
154
+ * which for a 5% rollout is a couple of dozen requests. Nothing that hands out
155
+ * identities on demand can restrict anything to a fraction of them.
156
+ */
157
+ feature(key: FeatureKey): this;
66
158
  }
67
159
  export declare class LayoutRoute<T extends ViewRoutes, Input, Output, Params> {
68
160
  viewPath: string;
69
161
  children: new () => ViewRouter;
70
162
  middlewares: string[];
163
+ featureGates: string[];
71
164
  /** @internal Set by `alwaysRun()`. */
72
165
  alwaysRuns: boolean;
73
166
  private handler;
@@ -90,10 +183,40 @@ export declare class LayoutRoute<T extends ViewRoutes, Input, Output, Params> {
90
183
  * on every request regardless.
91
184
  */
92
185
  alwaysRun(): this;
93
- middleware(middlewares: string[]): this;
186
+ middleware(middlewares: MiddlewareInput): this;
187
+ /**
188
+ * Hides this route behind a feature flag.
189
+ *
190
+ * When the flag is off the route behaves as though it does not exist — the
191
+ * application's own `404` view, with a 404 status — rather than returning an
192
+ * error page that confirms something is there.
193
+ *
194
+ * Returns `this`, so the route's type is unchanged and the path keeps its
195
+ * entry in `ViewPaths`: `<Link>` and `Redirect.to` stay typed. That also means
196
+ * the path is still in the route manifest the browser receives, so this gates
197
+ * the *response*, not the route's existence. Declare the feature
198
+ * `defineFeature({ serverOnly: true })` and keep unreleased routes out of the
199
+ * client tree if the name itself is the secret.
200
+ *
201
+ * ## A `rollout` is not access control
202
+ *
203
+ * Gate on `active` — a feature nobody has switched on is unreachable, which is
204
+ * the case this is for — or on a `when` that reads something the visitor
205
+ * cannot choose, like the signed-in user.
206
+ *
207
+ * A `rollout` is neither, for an anonymous visitor. The subject is their
208
+ * `session_id` cookie, which they supply; bucketing is a published pure
209
+ * function of it, so they can compute one that lands inside any percentage and
210
+ * send it. Signing the cookie would not fix this — they can equally well
211
+ * discard it and ask for a fresh one until a signed id happens to land inside,
212
+ * which for a 5% rollout is a couple of dozen requests. Nothing that hands out
213
+ * identities on demand can restrict anything to a fraction of them.
214
+ */
215
+ feature(key: FeatureKey): this;
94
216
  }
95
217
  export declare class ViewRouter {
96
218
  middlewares: string[];
219
+ featureGates: string[];
97
220
  routes: ViewRoutes;
98
221
  view<C extends new () => Controller, M extends ControllerMethods<C>>(viewPath: string, handler?: [C, M]): ParseViewControllerHandler<C, M>;
99
222
  view<Input, Output, Params>(viewPath: string, handler?: ViewHandler<Input, Output, Params>): ViewRoute<Input, Output, Params>;
@@ -1 +1 @@
1
- {"version":3,"file":"ViewRouter.d.ts","sourceRoot":"","sources":["../../http/ViewRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,KAAK,iBAAiB,CAAC,CAAC,SAAS,UAAU,UAAU,IAAI;KACtD,CAAC,IAAI,MAAM,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,QAAQ,GAAG,CAAC,GAAG,KAAK;CAC9E,CAAC,MAAM,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AS,UAAU,UAAU,GAC/B,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GACxD,CAAC,CAAC,CAAC,CAAC,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAC1C,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GACrD,CAAC,CAAC,CAAC,CAAC,SAAS,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,GAC9B,KAAK,GACL,CAAC,CAAC,CAAC,CAAC,SAAS,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GACnC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GACnD,KAAK,GACb,KAAK,CAAC;AAEV,MAAM,MAAM,aAAa,CACvB,CAAC,SAAS,UAAU,EACpB,MAAM,SAAS,WAAW,GAAG,EAAE,IAC7B,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  export { Controller, ResourceController } from "./Controller";
2
2
  export { ApiRouter, type CreateRPC } from "./ApiRouter";
3
3
  export { createFileResponse, ViewRouter, type CreateViewRPC, type FileOutput, type ViewHandler, } from "./ViewRouter";
4
+ export { toMiddlewareList, type MiddlewareInput } from "./middlewareList";
4
5
  export { createStreamResponse, createUnsatisfiableResponse, type StreamOutput, type StreamDescriptor, } from "./createStreamResponse";
5
6
  export { formatContentRange, formatUnsatisfiedContentRange, parseContentRange, parseRangeHeader, resolveRange, toRangeHeaderValue, type ByteRange, type ContentRange, type ResolvedRange, } from "./range";
6
7
  export { ValidationError } from "./Router";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../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,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,QAAQ,EACR,KAAK,yBAAyB,GAC/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,UAAU,CAAC"}
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{$d as w,Bd as a,Cd as b,Ed as c,Fd as d,Gd as e,Hd as f,Id as g,Jd as h,Ld as i,Md as j,Nd as k,Od as l,Pd as m,Qd as n,Rd as o,Sd as p,Td as q,Ud as r,Vd as s,Yd as t,Zd as u,_d as v,ae as x,be as y,he as z,ie as A,je as B,le as C,me as D,ne as E,oe as F,pe as G,qe as H}from"../chunk-vkngcrzq.js";import"../chunk-f9mfw82d.js";import"../chunk-01am9k5v.js";import"../chunk-4yafsffx.js";import"../chunk-v06qcyj5.js";import"../chunk-hs5v3eqj.js";import"../chunk-kgmr9qxx.js";export{e as toRangeHeaderValue,d as resolveRange,c as parseRangeHeader,f as parseContentRange,y as middlewareConfigDefaults,w as getCookies,h as formatUnsatisfiedContentRange,g as formatContentRange,x as defineMiddlewareConfig,l as createUnsatisfiableResponse,m as createStreamResponse,t as createFileResponse,E as clientIp,u as ViewRouter,j as ValidationError,b as ResourceController,i as RequestBreakerError,D as RateLimitMiddleware,C as RateLimitExceededError,p as RangeNotSatisfiableError,G as PoliciesServiceProvider,H as Policies,v as Middleware,o as InsufficientPermissionsError,k as HttpRequest,q as FileNotFoundError,B as CorsMiddleware,a as Controller,A as CacheMiddleware,F as CSRFMiddleware,n as AuthorizationError,z as AuthenticationMiddleware,r as AuthenticationError,s as ApiRouter};
2
+ import{$d as d,Ee as A,Fe as B,Ge as C,Ie as D,Je as E,Ke as F,Le as G,Me as H,Ne as I,Xd as a,Yd as b,_d as c,ae as e,be as f,ce as g,de as h,fe as i,ge as j,he as k,ie as l,je as m,ke as n,le as o,me as p,ne as q,oe as r,pe as s,qe as t,te as u,ue as v,ve as w,we as x,xe as y,ye as z}from"../chunk-hxf1re93.js";import"../chunk-qb5mv6pj.js";import"../chunk-3g5bjvdf.js";import"../chunk-sy7jbdeb.js";import"../chunk-d125j8t0.js";import"../chunk-dgsgjg53.js";import"../chunk-jhkjz9jr.js";export{e as toRangeHeaderValue,l as toMiddlewareList,d as resolveRange,c as parseRangeHeader,f as parseContentRange,z as middlewareConfigDefaults,x as getCookies,h as formatUnsatisfiedContentRange,g as formatContentRange,y as defineMiddlewareConfig,m as createUnsatisfiableResponse,n as createStreamResponse,u as createFileResponse,F as clientIp,v as ViewRouter,j as ValidationError,b as ResourceController,i as RequestBreakerError,E as RateLimitMiddleware,D as RateLimitExceededError,q as RangeNotSatisfiableError,H as PoliciesServiceProvider,I as Policies,w as Middleware,p as InsufficientPermissionsError,k as HttpRequest,r as FileNotFoundError,C as CorsMiddleware,a as Controller,B as CacheMiddleware,G as CSRFMiddleware,o as AuthorizationError,A as AuthenticationMiddleware,s as AuthenticationError,t as ApiRouter};
3
3
 
4
- //# debugId=D041EB72BC1507D464756E2164756E21
4
+ //# debugId=C628C1CDCF93D8C264756E2164756E21
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "D041EB72BC1507D464756E2164756E21",
7
+ "debugId": "C628C1CDCF93D8C264756E2164756E21",
8
8
  "names": []
9
9
  }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * What a route's `.middleware()` accepts.
3
+ *
4
+ * A bare string is allowed because it is what people write — `"auth"` reads
5
+ * better than `["auth"]` for the overwhelmingly common single-middleware case,
6
+ * and the array form was accepted silently wrong for long enough that the
7
+ * starter template itself does it (`.middleware("cache:private")`).
8
+ */
9
+ export type MiddlewareInput = string | string[];
10
+ /**
11
+ * Normalizes `.middleware()`'s argument to the array the registry expects.
12
+ *
13
+ * Without this, a bare string was assigned straight to `middlewares`, and
14
+ * `transformMiddleware` iterates its input — so a string was iterated one
15
+ * **character** at a time. Each character became an alias lookup that resolved
16
+ * to nothing and was dropped by the trailing `.filter(Boolean)`, which means the
17
+ * middleware did not run and nothing anywhere said so. A route that looked
18
+ * authenticated was public.
19
+ *
20
+ * The type said `string[]`, so this was a type error at every call site — but
21
+ * only for a project whose `tsc` is clean, and the failure at runtime is silent
22
+ * either way. Accepting both shapes removes the trap rather than documenting it.
23
+ */
24
+ export declare function toMiddlewareList(input: MiddlewareInput): string[];
25
+ //# sourceMappingURL=middlewareList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"middlewareList.d.ts","sourceRoot":"","sources":["../../http/middlewareList.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AAEhD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,EAAE,CAEjE"}
@@ -37,6 +37,30 @@ declare class Store {
37
37
  * silently returning partial bytes.
38
38
  */
39
39
  rangeRequest: ByteRange | null;
40
+ /**
41
+ * This request's `session_id`, once read or minted.
42
+ *
43
+ * The cookie itself cannot answer for it. `setCookie` appends a *serialized*
44
+ * `Set-Cookie` string to `cookies`, so a value written during this request is
45
+ * not readable back out of it, and `req.cookies` still holds only what the
46
+ * browser sent. Anything needing the id in the same request that mints it —
47
+ * feature-flag bucketing, most obviously — has to read it from here.
48
+ */
49
+ sessionId: string | null;
50
+ /**
51
+ * This request's feature-flag evaluations, computed once.
52
+ *
53
+ * One map per request is what keeps a handler and the SSR payload from
54
+ * disagreeing: a percentage rollout evaluated twice would be consistent
55
+ * anyway — the bucketing is deterministic — but an attribute hook reading a
56
+ * clock, or a `now`-based rule, would not be. Anything the page renders and
57
+ * anything the server branched on have to be the same answer.
58
+ */
59
+ featureEvaluations: Map<string, unknown> | null;
60
+ /** The context those evaluations were made against, built at most once. */
61
+ featureContext: unknown;
62
+ /** Bucket memo, shared across every flag evaluated for this request. */
63
+ featureBuckets: Map<string, number> | null;
40
64
  constructor(req: HttpRequest);
41
65
  setLocale(locale: string): void;
42
66
  renderMeta(): {
@@ -52,6 +76,39 @@ declare class Store {
52
76
  setRequest(req: HttpRequest<any, any>): void;
53
77
  destroy(): void;
54
78
  }
79
+ export declare const SESSION_ID_COOKIE = "session_id";
80
+ /**
81
+ * The `session_id` the browser sent, or the one minted earlier in this request.
82
+ * Never mints one, so it is safe on an api request, where a `Set-Cookie` nobody
83
+ * asked for would be a surprise.
84
+ *
85
+ * `null` outside a request, and for an anonymous visitor whose first request is
86
+ * not a view — both meaning "no stable subject", which callers must handle
87
+ * rather than paper over with a random value. A per-call random id would give
88
+ * every request its own bucket, which is worse than no bucketing at all: a
89
+ * percentage rollout would reshuffle on every page load.
90
+ *
91
+ * ## It is client-supplied, and unauthenticated
92
+ *
93
+ * Whatever the browser sent, unvalidated. It is a bucketing subject, not a
94
+ * credential — never authenticate or authorize on it. A visitor can pick a value
95
+ * that lands them in any percentage rollout, and signing it would not change
96
+ * that: they can discard the cookie and collect fresh ones until one does. Load
97
+ * bearing enough to state, because `.feature()` route gating is built on top of
98
+ * evaluation — see its documentation for what may safely gate a route.
99
+ */
100
+ export declare function sessionId(): string | null;
101
+ /**
102
+ * The same, but mints and sets the cookie when the browser sent none.
103
+ *
104
+ * Call this once per **view** request, early enough that everything downstream —
105
+ * flag evaluation included — sees the same id the browser is about to be given.
106
+ * It used to live inline in `ViewRouteDispatcher.onRequestEnd`, which ran only
107
+ * on the document path and only after the response was decided, so a client-side
108
+ * navigation minted nothing and a first-ever visitor had no id at the point
109
+ * flags were evaluated.
110
+ */
111
+ export declare function ensureSessionId(): string | null;
55
112
  export declare class RequestContext {
56
113
  static getStore(): Store;
57
114
  static setRequest(req: HttpRequest<any, any>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"requestContext.d.ts","sourceRoot":"","sources":["../../http/requestContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,mBAAwB,UAelC;AAID,cAAM,KAAK;IAwBU,GAAG,EAAE,WAAW;IAvBnC,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAa;IACjC,OAAO,EAAE,OAAO,CAAiB;IACjC;;;;OAIG;IACH,aAAa,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IAC9C,IAAI,EAAE,GAAG,CAAQ;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC/B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC7B,QAAQ,WAAkB;IAC1B;;;;;;;;OAQG;IACH,YAAY,EAAE,SAAS,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,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAItC,OAAO,CAAC,IAAI,EAAE,GAAG;IAIjB,UAAU,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC;IAIrC,OAAO;CAUR;AAED,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,IAAI,MAAM,GAAG,IAAI,CAazC;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CA0B/C;AAED,qBAAa,cAAc;IACzB,MAAM,CAAC,QAAQ;IAIf,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC;IAI5C,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;IAIvD;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;CAGhD"}
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{aa as y,ba as p}from"../chunk-wgpa04jb.js";import{ka as c,la as d,na as l}from"../chunk-5ad8era8.js";import{Ad as s,sd as e,td as i,vd as t,wd as r,xd as o,yd as n,zd as a}from"../chunk-q0waxxz5.js";import"../chunk-kgmr9qxx.js";export{o as setActiveLocale,r as seedDictionaries,t as preloadDictionaries,d as localeStrings,i as loadDictionary,n as getActiveLocale,e as dictionaryRegistrationMark,c as dictionaryLocales,l as dictionaryId,y as defineDictionary,s as createDictionarySink,a as __resetDictionaryRegistry,p as __gemi_dict__};
2
+ import{aa as y,ba as p}from"../chunk-xzk827r3.js";import{ka as c,la as d,na as l}from"../chunk-5ad8era8.js";import{Od as e,Pd as i,Rd as t,Sd as r,Td as o,Ud as n,Vd as a,Wd as s}from"../chunk-7j6wbv12.js";import"../chunk-jhkjz9jr.js";export{o as setActiveLocale,r as seedDictionaries,t as preloadDictionaries,d as localeStrings,i as loadDictionary,n as getActiveLocale,e as dictionaryRegistrationMark,c as dictionaryLocales,l as dictionaryId,y as defineDictionary,s as createDictionarySink,a as __resetDictionaryRegistry,p as __gemi_dict__};
3
3
 
4
- //# debugId=E2762ABCF1547F4B64756E2164756E21
4
+ //# debugId=26339FF3A7438E2764756E2164756E21
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "E2762ABCF1547F4B64756E2164756E21",
7
+ "debugId": "26339FF3A7438E2764756E2164756E21",
8
8
  "names": []
9
9
  }
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{aa as R}from"../chunk-wgpa04jb.js";import"../chunk-5ad8era8.js";import{Qa as L}from"../chunk-b50zmz3t.js";import{Kb as E,Lb as V}from"../chunk-64s1pzz1.js";import"../chunk-eqrd31ye.js";import{Rb as j}from"../chunk-tmnhkphv.js";import"../chunk-kry5vwam.js";import"../chunk-x14sk95v.js";import"../chunk-q0waxxz5.js";import"../chunk-vkngcrzq.js";import"../chunk-f9mfw82d.js";import"../chunk-01am9k5v.js";import"../chunk-4yafsffx.js";import{Ze as X}from"../chunk-ct274qts.js";import"../chunk-v06qcyj5.js";import"../chunk-hs5v3eqj.js";import"../chunk-kgmr9qxx.js";import{createElement as J,Fragment as M,isValidElement as U}from"react";function $(q,B){let G=Object.values(B).some((z)=>typeof z==="function"&&U(z(""))),Q=/{{([^{}]+?)(?::([^{}\[\]]+?))?(?:\[(.*?)\])?}}/g;if(!G)return q.replace(Q,(W,O,_,Z)=>{let C=O.includes(":")?O.split(":")[0]:O,H=B[C];if(H===void 0)return W;if(typeof H==="function"){let K=H(Z!==void 0?Z:"");if(U(K))throw Error("JSX returned in string context");return String(K)}if(_)switch(_.toLowerCase()){case"number":return Number(H).toString();case"string":return String(H);case"boolean":return Boolean(H).toString();default:return String(H)}return String(H)});else{let z=[],W=0,O=null;while((O=Q.exec(q))!==null){let[_,Z,C,H]=O,F=O.index,K=Z.includes(":")?Z.split(":")[0]:Z;if(F>W)z.push(q.substring(W,F));let Y=B[K];if(Y===void 0)z.push(_);else if(typeof Y==="function"){let A=Y(H!==void 0?H:"");z.push(A)}else if(C)switch(C.toLowerCase()){case"number":z.push(Number(Y).toString());break;case"string":z.push(String(Y));break;case"boolean":z.push(Boolean(Y).toString());break;default:z.push(String(Y))}else z.push(String(Y));W=F+_.length}if(W<q.length)z.push(q.substring(W));return J(M,{},...z)}}class P{name;dictionary;constructor(q,B){this.name=q;this.dictionary=B}reference(q){if(typeof window<"u")throw Error("Cannot use reference in the browser");if(!this.dictionary?.[q])throw Error(`Translation not found for ${String(q)}`);return this.dictionary[q]}render(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B[0]};if(typeof window<"u")throw Error("Cannot use render in the browser");if(!this.dictionary?.[q]?.[G])throw Error(`Translation not found for ${String(q)} in ${String(G)}`);return $(this.dictionary[q][G],Q??{})}static create(q,B){return new P(q,B)}static text(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B?.[0]};if(!q?.[G])throw Error(`Translation not found for ${String(G)}`);return $(q[G],Q??{})}}async function N(q,B,...G){let{locale:Q=j.locale(),params:z}={params:{},...G[0]},O=(await q.load(String(Q)))[B];if(typeof O!=="string")throw Error(`Translation not found for "${B}" in "${String(Q)}" (dictionary ${q.id})`);return $(O,z??{})}export{V as translationConfigDefaults,N as translate,E as defineTranslationConfig,R as defineDictionary,X as Translator,L as TranslationServiceProvider,P as Dictionary};
2
+ import{aa as R}from"../chunk-xzk827r3.js";import"../chunk-5ad8era8.js";import{Qa as L}from"../chunk-b35e128b.js";import{Wb as E,Xb as V}from"../chunk-437085pe.js";import"../chunk-4yt5x8s2.js";import{bc as j}from"../chunk-hwa5sqw5.js";import"../chunk-86jebsm4.js";import"../chunk-y6a8r2bn.js";import"../chunk-7j6wbv12.js";import"../chunk-hxf1re93.js";import"../chunk-qb5mv6pj.js";import"../chunk-3g5bjvdf.js";import"../chunk-sy7jbdeb.js";import{wf as X}from"../chunk-cyaz97p5.js";import"../chunk-d125j8t0.js";import"../chunk-dgsgjg53.js";import"../chunk-jhkjz9jr.js";import{createElement as J,Fragment as M,isValidElement as U}from"react";function $(q,B){let G=Object.values(B).some((z)=>typeof z==="function"&&U(z(""))),Q=/{{([^{}]+?)(?::([^{}\[\]]+?))?(?:\[(.*?)\])?}}/g;if(!G)return q.replace(Q,(W,O,_,Z)=>{let C=O.includes(":")?O.split(":")[0]:O,H=B[C];if(H===void 0)return W;if(typeof H==="function"){let K=H(Z!==void 0?Z:"");if(U(K))throw Error("JSX returned in string context");return String(K)}if(_)switch(_.toLowerCase()){case"number":return Number(H).toString();case"string":return String(H);case"boolean":return Boolean(H).toString();default:return String(H)}return String(H)});else{let z=[],W=0,O=null;while((O=Q.exec(q))!==null){let[_,Z,C,H]=O,F=O.index,K=Z.includes(":")?Z.split(":")[0]:Z;if(F>W)z.push(q.substring(W,F));let Y=B[K];if(Y===void 0)z.push(_);else if(typeof Y==="function"){let A=Y(H!==void 0?H:"");z.push(A)}else if(C)switch(C.toLowerCase()){case"number":z.push(Number(Y).toString());break;case"string":z.push(String(Y));break;case"boolean":z.push(Boolean(Y).toString());break;default:z.push(String(Y))}else z.push(String(Y));W=F+_.length}if(W<q.length)z.push(q.substring(W));return J(M,{},...z)}}class P{name;dictionary;constructor(q,B){this.name=q;this.dictionary=B}reference(q){if(typeof window<"u")throw Error("Cannot use reference in the browser");if(!this.dictionary?.[q])throw Error(`Translation not found for ${String(q)}`);return this.dictionary[q]}render(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B[0]};if(typeof window<"u")throw Error("Cannot use render in the browser");if(!this.dictionary?.[q]?.[G])throw Error(`Translation not found for ${String(q)} in ${String(G)}`);return $(this.dictionary[q][G],Q??{})}static create(q,B){return new P(q,B)}static text(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B?.[0]};if(!q?.[G])throw Error(`Translation not found for ${String(G)}`);return $(q[G],Q??{})}}async function N(q,B,...G){let{locale:Q=j.locale(),params:z}={params:{},...G[0]},O=(await q.load(String(Q)))[B];if(typeof O!=="string")throw Error(`Translation not found for "${B}" in "${String(Q)}" (dictionary ${q.id})`);return $(O,z??{})}export{V as translationConfigDefaults,N as translate,E as defineTranslationConfig,R as defineDictionary,X as Translator,L as TranslationServiceProvider,P as Dictionary};
3
3
 
4
- //# debugId=9CA9B94EC734C98C64756E2164756E21
4
+ //# debugId=162E452EFA9ACE8564756E2164756E21
@@ -7,6 +7,6 @@
7
7
  "import { Lang } from \"../facades\";\nimport { parseTranslation } from \"../utils/parseTranslation\";\nimport type { ParseTranslationParamsServer, Prettify } from \"../utils/type\";\nimport type { DictionaryHandle } from \"./defineDictionary\";\nimport type { DictionaryTranslations } from \"./dictionaryShape\";\n\n/**\n * Read one string from a `defineDictionary` dictionary outside React — a\n * controller, a job, an email template.\n *\n * Async because a bundled dictionary loads its locale on demand. Server code\n * does not go through the bundler, so in practice this resolves without ever\n * yielding; the `await` is what makes the same call work either way.\n *\n * Kept out of `defineDictionary.ts` on purpose: that module is imported by\n * components and has to stay free of the server facades this one needs.\n */\nexport async function translate<\n T extends DictionaryTranslations,\n K extends keyof T & string,\n U extends keyof T[K],\n R = Prettify<ParseTranslationParamsServer<T[K][U] & string>>,\n>(\n dictionary: DictionaryHandle<T>,\n key: K,\n ...args: R extends Record<string, never>\n ? [args?: { locale?: U | (string & {}) }]\n : [args: { locale?: U | (string & {}); params: R }]\n): Promise<string> {\n const { locale = Lang.locale(), params } = { params: {}, ...args[0] };\n const strings = await dictionary.load(String(locale));\n const template = strings[key];\n\n if (typeof template !== \"string\") {\n throw new Error(\n `Translation not found for \"${key}\" in \"${String(locale)}\" (dictionary ${dictionary.id})`,\n );\n }\n\n return parseTranslation(template, (params ?? {}) as any) as string;\n}\n"
8
8
  ],
9
9
  "mappings": ";soBAAA,mBAAS,SAAe,eAA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