@classytic/arc 2.41.0 → 2.43.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 (230) hide show
  1. package/dist/{EventTransport-CbUKDzZZ.d.mts → EventTransport-CiicKz2Z.d.mts} +1 -1
  2. package/dist/{EventTransport-n7qO5Cz3.mjs → EventTransport-tzA7CAB4.mjs} +22 -17
  3. package/dist/{HookSystem-CxvZBo77.mjs → HookSystem-B6UaKRbF.mjs} +2 -2
  4. package/dist/{QueryCache-DFA-QrU9.d.mts → QueryCache--5uAuYPW.d.mts} +7 -3
  5. package/dist/{ResourceRegistry-Cu7uTJp9.mjs → ResourceRegistry-CuCARu2B.mjs} +44 -13
  6. package/dist/actionPermissions-BotX1YOa.mjs +776 -0
  7. package/dist/audit/index.d.mts +43 -5
  8. package/dist/audit/index.mjs +48 -26
  9. package/dist/auth/audit.mjs +1 -1
  10. package/dist/auth/index.d.mts +43 -13
  11. package/dist/auth/index.mjs +130 -155
  12. package/dist/auth/redis-session.mjs +1 -1
  13. package/dist/{authorizationDecision-2YY_Kaj1.mjs → authorizationDecision-DQYrkl5f.mjs} +7 -102
  14. package/dist/{base-CxrV1LmG.d.mts → base-CZyixEQR.d.mts} +27 -5
  15. package/dist/boundedMap-BULzfXYU.mjs +57 -0
  16. package/dist/{buildHandler-CUhjGHGZ.mjs → buildHandler-CRQ8EcX5.mjs} +4 -4
  17. package/dist/cache/index.d.mts +22 -34
  18. package/dist/cache/index.mjs +4 -4
  19. package/dist/{caching-DsWDjIxx.mjs → caching-Cc2M1DwO.mjs} +3 -3
  20. package/dist/claimed-B10RTfkM.mjs +8 -0
  21. package/dist/cleanup/index.d.mts +6 -10
  22. package/dist/cleanup/index.mjs +27 -73
  23. package/dist/cli/commands/describe.d.mts +4 -2
  24. package/dist/cli/commands/describe.mjs +7 -4
  25. package/dist/cli/commands/docs.mjs +3 -3
  26. package/dist/cli/commands/doctor.mjs +1 -1
  27. package/dist/cli/commands/generate.mjs +2 -2
  28. package/dist/cli/commands/init.mjs +2 -2
  29. package/dist/cli/commands/introspect.mjs +2 -2
  30. package/dist/cli/index.mjs +3 -3
  31. package/dist/{constants-BxLgNFF7.mjs → constants-Cu7Mx7_U.mjs} +4 -2
  32. package/dist/context/index.d.mts +2 -5
  33. package/dist/context/index.mjs +18 -38
  34. package/dist/core/index.d.mts +3 -3
  35. package/dist/core/index.mjs +8 -8
  36. package/dist/{core-iNGqYerO.mjs → core-Cb0LjccA.mjs} +5 -4
  37. package/dist/{createActionRouter-BBlbPs3k.mjs → createActionRouter-xjqonMRO.mjs} +87 -39
  38. package/dist/{createAggregationRouter-Dv5SuK2x.mjs → createAggregationRouter-zRYWw_5D.mjs} +11 -8
  39. package/dist/{preloadResources-Bbp4QJ8V.mjs → createApp-D-953ZAq.mjs} +299 -390
  40. package/dist/{createMcpServer-CbDWkZ1T.d.mts → createMcpServer-C9cxS8zt.d.mts} +1 -1
  41. package/dist/{defineAggregation-UyeurGkp.mjs → defineAggregation-Bm8RjMbq.mjs} +1 -1
  42. package/dist/{defineResource-DzGT-2LP.mjs → defineResource-DIC7JZGU.mjs} +118 -1024
  43. package/dist/discovery/index.mjs +1 -1
  44. package/dist/docs/index.d.mts +10 -4
  45. package/dist/docs/index.mjs +4 -4
  46. package/dist/{elevation-BXCfVcNG.d.mts → elevation-BW2J3tNj.d.mts} +1 -2
  47. package/dist/{elevation-BF-vhGxY.mjs → elevation-DG8SrLN-.mjs} +41 -12
  48. package/dist/encryption/index.mjs +3 -3
  49. package/dist/{errorHandler-CIMkCOWm.mjs → errorHandler-BnfDviL1.mjs} +26 -5
  50. package/dist/{errors-C_YhELhe.mjs → errors-CtrywMHP.mjs} +58 -23
  51. package/dist/{errors-BGdVwP25.d.mts → errors-JYc9vwqE.d.mts} +9 -0
  52. package/dist/{eventPlugin-B52abJ8W.d.mts → eventPlugin-BtmA4-3P.d.mts} +65 -9
  53. package/dist/{eventPlugin-CmXaPWLv.mjs → eventPlugin-Q6BhzHzs.mjs} +82 -21
  54. package/dist/{subscribe-helpers-AVYPgqTl.mjs → eventTypes-Cdhm6ZlV.mjs} +151 -17
  55. package/dist/events/index.d.mts +33 -8
  56. package/dist/events/index.mjs +49 -53
  57. package/dist/events/transports/redis-stream-entry.d.mts +1 -1
  58. package/dist/events/transports/redis-stream-entry.mjs +139 -157
  59. package/dist/events/transports/redis.d.mts +1 -1
  60. package/dist/events/transports/redis.mjs +2 -2
  61. package/dist/factory/index.d.mts +32 -17
  62. package/dist/factory/index.mjs +213 -32
  63. package/dist/{fastify-augmentation-Cq2nHVaW.d.mts → fastify-augmentation-DhUJ-mvo.d.mts} +11 -25
  64. package/dist/{fields-I_EeRWND.d.mts → fields-BBSpf8pS.d.mts} +1 -1
  65. package/dist/{fields-BTyPLHK0.mjs → fields-ToPYpMqS.mjs} +1 -1
  66. package/dist/filter-merge-IpGywvym.mjs +99 -0
  67. package/dist/{generate-D_YmiCNf.mjs → generate-DRTkLlIl.mjs} +2 -2
  68. package/dist/{headers-CNECDE6q.mjs → headers-BbkIF6vA.mjs} +2 -2
  69. package/dist/health-D-Ft6JM6.mjs +22 -0
  70. package/dist/{health-CxQzbJmr.mjs → health-DqbsG-_w.mjs} +115 -55
  71. package/dist/hooks/index.d.mts +2 -2
  72. package/dist/hooks/index.mjs +2 -2
  73. package/dist/idempotency/index.d.mts +31 -7
  74. package/dist/idempotency/index.mjs +155 -98
  75. package/dist/idempotency/redis.d.mts +1 -1
  76. package/dist/idempotency/redis.mjs +48 -11
  77. package/dist/{index-BHdZD8zK.d.mts → index-Bxriq3so.d.mts} +84 -21
  78. package/dist/{preloadResources-CjS2OfpU.d.mts → index-C8zVGYsk.d.mts} +37 -38
  79. package/dist/{index-D4u76eQW.d.mts → index-CRoPtISf.d.mts} +23 -73
  80. package/dist/{index-CbJiYrfv.d.mts → index-Chgz3d0i.d.mts} +1 -1
  81. package/dist/index-JdbZAIsm.d.mts +510 -0
  82. package/dist/{index-DHbyPo5j.d.mts → index-mqaqZNpe.d.mts} +253 -254
  83. package/dist/index.d.mts +8 -8
  84. package/dist/index.mjs +11 -11
  85. package/dist/{init-Y2MlSN9n.mjs → init-B_oUYDXI.mjs} +1 -1
  86. package/dist/integrations/event-gateway.d.mts +8 -3
  87. package/dist/integrations/event-gateway.mjs +4 -4
  88. package/dist/integrations/index.d.mts +3 -3
  89. package/dist/integrations/index.mjs +1 -1
  90. package/dist/integrations/jobs/index.d.mts +1 -1
  91. package/dist/integrations/jobs/index.mjs +18 -5
  92. package/dist/integrations/mcp/index.d.mts +72 -59
  93. package/dist/integrations/mcp/index.mjs +19 -4
  94. package/dist/integrations/mcp/testing.d.mts +2 -2
  95. package/dist/integrations/mcp/testing.mjs +2 -2
  96. package/dist/integrations/streamline.d.mts +78 -136
  97. package/dist/integrations/streamline.mjs +116 -54
  98. package/dist/integrations/webhooks.d.mts +60 -120
  99. package/dist/integrations/webhooks.mjs +36 -80
  100. package/dist/integrations/websocket-pushref-redis.d.mts +1 -1
  101. package/dist/integrations/websocket-pushref-redis.mjs +1 -1
  102. package/dist/integrations/websocket-redis.d.mts +1 -1
  103. package/dist/integrations/websocket-redis.mjs +1 -1
  104. package/dist/integrations/websocket.d.mts +3 -3
  105. package/dist/integrations/websocket.mjs +2 -2
  106. package/dist/{interface-DEWNOMza.d.mts → interface-C0395yUN.d.mts} +13 -1
  107. package/dist/{jsonBody-Cq9KYl2Z.mjs → jsonBody-B4YVGcql.mjs} +2 -2
  108. package/dist/{keys-Cmv4cBRa.mjs → keys-B2KtgMLJ.mjs} +7 -18
  109. package/dist/{loadResources-CblF7xt2.mjs → loadResources-Dn4lalw2.mjs} +3 -3
  110. package/dist/{loadResourcesFromEntry-99fIMC3p.mjs → loadResourcesFromEntry-3sLYbuse.mjs} +2 -2
  111. package/dist/logger/index.d.mts +1 -8
  112. package/dist/logger/index.mjs +3 -153
  113. package/dist/logger-DXjfIqjV.mjs +160 -0
  114. package/dist/{mcpPlugin-xF3Gw-HW.mjs → mcpPlugin-C08HalN5.mjs} +433 -170
  115. package/dist/{memory-CpDZ9NPw.mjs → memory-9Cp7611C.mjs} +36 -34
  116. package/dist/{metrics-BaKnq8ag.mjs → metrics-CWI11eRu.mjs} +39 -72
  117. package/dist/middleware/index.d.mts +2 -2
  118. package/dist/middleware/index.mjs +3 -3
  119. package/dist/migrations/index.mjs +2 -2
  120. package/dist/{module-BkQEesNQ.mjs → module-BSvOQC7E.mjs} +8 -8
  121. package/dist/multiTenant-cY0FkDiA.d.mts +104 -0
  122. package/dist/{multipartBody-C92aJ8am.mjs → multipartBody-CXM2a-Dy.mjs} +46 -7
  123. package/dist/{openapi-C3LFRzPq.mjs → openapi-DT_G4VhY.mjs} +48 -10
  124. package/dist/outbox-admin/index.d.mts +3 -3
  125. package/dist/outbox-admin/index.mjs +6 -18
  126. package/dist/{outbox-module-dsCyLxXH.mjs → outbox-module-Bjgzl6tg.mjs} +203 -33
  127. package/dist/{outbox-module-BHdUnuuK.d.mts → outbox-module-gZCHoE4H.d.mts} +79 -6
  128. package/dist/permissions/index.d.mts +5 -4
  129. package/dist/permissions/index.mjs +8 -6
  130. package/dist/{permissions-DiHXy8Ck.mjs → permissions-Cm0uYHvd.mjs} +149 -33
  131. package/dist/{pipe-CBVmUJ-j.mjs → pipe-BqeGT6UO.mjs} +2 -2
  132. package/dist/pipeline/index.d.mts +2 -2
  133. package/dist/pipeline/index.mjs +2 -2
  134. package/dist/plan-FVR6LP59.mjs +565 -0
  135. package/dist/{BaseController-DYJRZ0EJ.mjs → plugin-BccET1tL.mjs} +1256 -344
  136. package/dist/plugins/index.d.mts +14 -11
  137. package/dist/plugins/index.mjs +44 -22
  138. package/dist/plugins/response-cache.mjs +8 -14
  139. package/dist/plugins/tracing-entry.mjs +2 -2
  140. package/dist/{pluralize-2_U6QZQg.mjs → pluralize-CVIOcgMF.mjs} +1 -1
  141. package/dist/presets/filesUpload.d.mts +2 -2
  142. package/dist/presets/filesUpload.mjs +5 -5
  143. package/dist/presets/index.d.mts +26 -31
  144. package/dist/presets/index.mjs +4 -4
  145. package/dist/presets/multiTenant.d.mts +2 -107
  146. package/dist/presets/multiTenant.mjs +22 -162
  147. package/dist/presets/search.d.mts +2 -2
  148. package/dist/presets/search.mjs +2 -2
  149. package/dist/{presets-BdlugYTc.mjs → presets-Cpvj6fGO.mjs} +99 -107
  150. package/dist/{projection-Uvgp-EEj.mjs → projection-Ce4aQhQk.mjs} +2 -2
  151. package/dist/{pushref-registry-Dov9l4qE.d.mts → pushref-registry-UxCkoA4C.d.mts} +1 -1
  152. package/dist/{queryCachePlugin-BzqxconG.d.mts → queryCachePlugin-C2lZjTxk.d.mts} +1 -1
  153. package/dist/{queryCachePlugin-B5F09bYr.mjs → queryCachePlugin-CFWNH8aT.mjs} +12 -14
  154. package/dist/{rateLimitKey-CK-EU2L8.mjs → rateLimitKey-C4O-kPm0.mjs} +1 -1
  155. package/dist/{realtime-FnnD0n3Z.mjs → realtime-DmPE9S54.mjs} +25 -21
  156. package/dist/redis-stream-BMk-bpQS.d.mts +219 -0
  157. package/dist/{redis-Bzi1y3F9.d.mts → redis-vLvtcGy_.d.mts} +13 -24
  158. package/dist/redisShapes-CQksY67q.d.mts +55 -0
  159. package/dist/registry/index.d.mts +9 -4
  160. package/dist/registry/index.mjs +4 -4
  161. package/dist/{registry-D3y8VEJ1.mjs → registry-Bcz9G1bh.mjs} +10 -8
  162. package/dist/{renewingLease-B3VYh5aU.mjs → renewingLease-qODa7KJQ.mjs} +1 -1
  163. package/dist/{replyHelpers-DPHsdw-5.mjs → replyHelpers-CG_VtVgS.mjs} +2 -2
  164. package/dist/{requestContext-cSVKnYPk.mjs → requestContext-Dsu9P1bV.mjs} +1 -1
  165. package/dist/requirement-CbiLdQ1n.d.mts +22 -0
  166. package/dist/requirement-KDdoRcOP.mjs +35 -0
  167. package/dist/resourceRateLimit-Wf6d6FL9.d.mts +30 -0
  168. package/dist/resourceRateLimit-dSjVr1pk.mjs +180 -0
  169. package/dist/{rolldown-runtime-DjDuyglE.mjs → rolldown-runtime-D1w9Y1VJ.mjs} +1 -1
  170. package/dist/routeValidator-D36SW8qt.mjs +70 -0
  171. package/dist/{runtimeCapabilities-DSA_dH1_.mjs → runtimeCapabilities-0tccjRlj.mjs} +1 -1
  172. package/dist/{schedules-BktJb3Y3.mjs → schedules-C-OpmHBq.mjs} +46 -37
  173. package/dist/{schemaConverter-BLCSmNbr.mjs → schemaConverter-BORek3O-.mjs} +2 -2
  174. package/dist/{schemaIR-K16Bb5BX.mjs → schemaIR-C7Vbp71I.mjs} +2 -2
  175. package/dist/schemas/index.d.mts +10 -0
  176. package/dist/schemas/index.mjs +8 -3
  177. package/dist/scim/index.mjs +2 -2
  178. package/dist/scope/index.d.mts +2 -2
  179. package/dist/scope/index.mjs +6 -6
  180. package/dist/{scope-jSxuBTFM.mjs → scope-DQthe88b.mjs} +4 -4
  181. package/dist/shutdown-MqA81z_P.mjs +59 -0
  182. package/dist/{simpleEqualityMatcher-BiOnyflP.mjs → simpleEqualityMatcher-auW8QjXN.mjs} +1 -1
  183. package/dist/{sse-CH7Slxc1.mjs → sse-CYzQBVFe.mjs} +11 -15
  184. package/dist/{sseStream-CN-Lh1Tu.mjs → sseStream-B5_Afiqn.mjs} +2 -2
  185. package/dist/{store-helpers-9DX9-1j_.mjs → store-helpers-BOzk-CuX.mjs} +1 -1
  186. package/dist/{streaming-dvppnxsr.mjs → streaming-DjTQhZrN.mjs} +1 -1
  187. package/dist/subscriberIdentity-CW39uA8G.mjs +28 -0
  188. package/dist/tenancy--ed9eH_z.mjs +43 -0
  189. package/dist/tenantPreparation-BKon6Yox.mjs +67 -0
  190. package/dist/testing/cleanupStoreContract.mjs +1 -1
  191. package/dist/testing/index.d.mts +193 -175
  192. package/dist/testing/index.mjs +286 -212
  193. package/dist/testing/outboxStoreContract.mjs +137 -2
  194. package/dist/testing/requiredPorts.d.mts +17 -0
  195. package/dist/testing/requiredPorts.mjs +65 -0
  196. package/dist/testing/storageContract.mjs +1 -1
  197. package/dist/timing-qczZ0YC-.mjs +46 -0
  198. package/dist/{transactionContext-DCWMI6hV.mjs → transactionContext-DjFkrNG6.mjs} +1 -1
  199. package/dist/{typeGuards-D7tHFdH6.mjs → typeGuards-CySF12G-.mjs} +1 -1
  200. package/dist/types/index.d.mts +4 -4
  201. package/dist/types/index.mjs +1 -1
  202. package/dist/types/storage.mjs +1 -1
  203. package/dist/{types-CWQn9-IC.d.mts → types-B4Aq4Sdj.d.mts} +22 -9
  204. package/dist/{types-DfVDvkdP.d.mts → types-BJ-2XqVF.d.mts} +189 -204
  205. package/dist/{types-CDy3-zw1.mjs → types-Bk9NOgOC.mjs} +4 -4
  206. package/dist/usage/index.d.mts +2 -3
  207. package/dist/usage/index.mjs +5 -5
  208. package/dist/{userHelpers-DDMOZ_Pm.mjs → userHelpers-aklawRaK.mjs} +1 -1
  209. package/dist/utils/index.d.mts +84 -223
  210. package/dist/utils/index.mjs +13 -12
  211. package/dist/{utils-B-zj_b__.mjs → utils-ec1oTo1n.mjs} +315 -404
  212. package/dist/{validate-R0G_JrnK.mjs → validate-9yzHC1e2.mjs} +6 -14
  213. package/dist/{versioning-D6JIK8Tk.d.mts → versioning-Bsb51gGT.d.mts} +28 -13
  214. package/dist/{versioning-DuVWcu-F.mjs → versioning-fhhWHV74.mjs} +4 -4
  215. package/dist/{websocket-BOXVggMf.d.mts → websocket-Cs4awVyD.d.mts} +1 -1
  216. package/dist/{workScope-BhsWde4k.mjs → workScope-zpPyge4t.mjs} +2 -2
  217. package/package.json +578 -574
  218. package/skills/arc/SKILL.md +13 -4
  219. package/skills/arc/references/auth.md +8 -5
  220. package/skills/arc/references/integrations.md +1 -1
  221. package/skills/arc/references/mcp.md +8 -6
  222. package/skills/arc/references/multi-tenancy.md +19 -14
  223. package/skills/arc/references/production.md +27 -10
  224. package/dist/actionPermissions-DPwPWPOV.mjs +0 -350
  225. package/dist/index-CFfLKMH4.d.mts +0 -290
  226. package/dist/interface-BIpgzbZl.mjs +0 -17
  227. package/dist/redis-stream-BPKscsTB.d.mts +0 -260
  228. package/dist/registerRoute-DRsSHPSM.mjs +0 -364
  229. package/dist/sync/changelog.d.mts +0 -3
  230. package/dist/sync/changelog.mjs +0 -3
@@ -1,10 +1,10 @@
1
1
 
2
- import { t as AnyRecord } from "../base-CxrV1LmG.mjs";
3
- import { At as RouteDefinition, J as PresetHook, Q as MiddlewareConfig, et as RouteSchemaOptions } from "../index-DHbyPo5j.mjs";
2
+ import { t as AnyRecord } from "../base-CZyixEQR.mjs";
3
+ import { Et as RouteDefinition, J as MiddlewareConfig, U as PresetHook, X as RouteSchemaOptions } from "../index-mqaqZNpe.mjs";
4
4
  import { i as errorHandlerPlugin, n as ErrorMapper, r as defaultIsDuplicateKeyError, t as ErrorHandlerOptions } from "../errorHandler--4rSMMvq.mjs";
5
- import { _ as HealthCheck, b as healthPlugin, f as ScheduleDefinition, g as schedulesPlugin, h as _default$8, m as SchedulesPluginOptions, p as ScheduleStats, v as HealthOptions, y as _default$3 } from "../types-DfVDvkdP.mjs";
6
- import { a as arcCorePlugin, i as _default, n as ArcCorePluginOptions, r as PluginMeta, t as ArcCore } from "../fastify-augmentation-Cq2nHVaW.mjs";
7
- import { C as gracefulShutdownPlugin, S as _default$2, _ as CachingRule, a as MetricsCollector, b as GracefulShutdownOptions, c as metricsPlugin, d as _default$6, f as realtimePlugin, g as CachingOptions, h as ssePlugin, i as MetricEntry, l as ChangeOperation, m as _default$9, n as _default$10, o as MetricsOptions, p as SSEOptions, r as versioningPlugin, s as _default$4, t as VersioningOptions, u as RealtimeOptions, v as _default$1, x as ShutdownState, y as cachingPlugin } from "../versioning-D6JIK8Tk.mjs";
5
+ import { C as _default$8, E as _default$3, S as SchedulesPluginOptions, T as HealthOptions, b as ScheduleDefinition, w as HealthCheck, x as ScheduleStats } from "../types-BJ-2XqVF.mjs";
6
+ import { i as _default, n as ArcCorePluginOptions, r as PluginMeta, t as ArcCore } from "../fastify-augmentation-DhUJ-mvo.mjs";
7
+ import { _ as _default$2, a as MetricsOptions, c as RealtimeOptions, d as _default$9, f as CachingOptions, g as ShutdownState, h as GracefulShutdownOptions, i as MetricsCollector, l as _default$6, m as _default$1, n as _default$10, o as _default$4, p as CachingRule, r as MetricEntry, s as ChangeOperation, t as VersioningOptions, u as SSEOptions } from "../versioning-Bsb51gGT.mjs";
8
8
  import { t as TracingOptions } from "../tracing-Dro5eH6j.mjs";
9
9
  import { PaginatedResult } from "@classytic/repo-core/pagination";
10
10
  import { FastifyInstance, FastifyPluginAsync } from "fastify";
@@ -19,7 +19,7 @@ interface PluginResourceResult {
19
19
  /** Schema options to merge */
20
20
  schemaOptions?: RouteSchemaOptions;
21
21
  }
22
- interface CreatePluginDefinition<TRootOpts extends AnyRecord = AnyRecord, TResourceOpts extends AnyRecord = AnyRecord> {
22
+ interface CreatePluginDefinition<TRootOpts extends object = AnyRecord, TResourceOpts extends object = AnyRecord> {
23
23
  /**
24
24
  * Global setup function. Called once when the plugin is registered on the Fastify instance.
25
25
  * Use this for database connections, decorators, shared state, etc.
@@ -36,7 +36,7 @@ interface CreatePluginDefinition<TRootOpts extends AnyRecord = AnyRecord, TResou
36
36
  */
37
37
  forResource?: (opts: TResourceOpts) => PluginResourceResult;
38
38
  }
39
- interface ArcPlugin<TRootOpts extends AnyRecord = AnyRecord, TResourceOpts extends AnyRecord = AnyRecord> {
39
+ interface ArcPlugin<TRootOpts extends object = AnyRecord, TResourceOpts extends object = AnyRecord> {
40
40
  /** Plugin name */
41
41
  readonly name: string;
42
42
  /**
@@ -57,7 +57,7 @@ interface ArcPlugin<TRootOpts extends AnyRecord = AnyRecord, TResourceOpts exten
57
57
  * @param definition - Plugin setup functions
58
58
  * @returns ArcPlugin with forRoot() and forResource() methods
59
59
  */
60
- declare function createPlugin<TRootOpts extends AnyRecord = AnyRecord, TResourceOpts extends AnyRecord = AnyRecord>(name: string, definition: CreatePluginDefinition<TRootOpts, TResourceOpts>): ArcPlugin<TRootOpts, TResourceOpts>;
60
+ declare function createPlugin<TRootOpts extends object = AnyRecord, TResourceOpts extends object = AnyRecord>(name: string, definition: CreatePluginDefinition<TRootOpts, TResourceOpts>): ArcPlugin<TRootOpts, TResourceOpts>;
61
61
  //#endregion
62
62
  //#region src/plugins/pressure.d.ts
63
63
  /**
@@ -95,6 +95,11 @@ interface PressureOptions {
95
95
  thresholds?: PressureThresholds;
96
96
  /** Sampling cadence in ms. Default 1000. */
97
97
  intervalMs?: number;
98
+ /**
99
+ * How long one signal read may take before it counts as "cannot measure" (reported as 0, like a
100
+ * throwing reader). A stuck read is never restarted while pending. Default: `intervalMs`.
101
+ */
102
+ readTimeoutMs?: number;
98
103
  /** Include the built-in event-loop-utilisation signal. Default true. */
99
104
  eventLoopUtilization?: boolean;
100
105
  /** Fired when the state CHANGES — not on every sample. */
@@ -136,7 +141,6 @@ declare module "fastify" {
136
141
  pressure: PressureApi;
137
142
  }
138
143
  }
139
- declare const pressurePlugin: FastifyPluginAsync<PressureOptions>;
140
144
  /**
141
145
  * `fp()`-wrapped so `fastify.pressure` is visible to the whole app rather than
142
146
  * trapped in this plugin's encapsulation context — the named export above is
@@ -220,7 +224,6 @@ declare function sanitizeRequestId(value: unknown): string | undefined;
220
224
  declare function createRequestIdGenerator(opts?: Pick<RequestIdOptions, "header" | "generator">): (req: {
221
225
  headers: Record<string, string | string[] | undefined>;
222
226
  }) => string;
223
- declare const requestIdPlugin: FastifyPluginAsync<RequestIdOptions>;
224
227
  declare const _default$7: FastifyPluginAsync<RequestIdOptions>;
225
228
  //#endregion
226
- export { type ArcCore, type ArcCorePluginOptions, type ArcPlugin, type CachingOptions, type CachingRule, type ChangeOperation, type CreatePluginDefinition, type ErrorHandlerOptions, type ErrorMapper, type GracefulShutdownOptions, type HealthCheck, type HealthOptions, type MetricEntry, type MetricsCollector, type MetricsOptions, type PluginMeta, type PluginResourceResult, type PressureApi, type PressureOptions, type PressureSignal, type PressureSnapshot, type PressureState, type PressureThresholds, type RealtimeOptions, type RequestIdOptions, type SSEOptions, type ScheduleDefinition, type ScheduleStats, type SchedulesPluginOptions, type ShutdownState, type TracingOptions, type VersioningOptions, _default as arcCorePlugin, arcCorePlugin as arcCorePluginFn, _default$1 as cachingPlugin, cachingPlugin as cachingPluginFn, createPlugin, createRequestIdGenerator, defaultIsDuplicateKeyError, errorHandlerPlugin, errorHandlerPlugin as errorHandlerPluginFn, _default$2 as gracefulShutdownPlugin, gracefulShutdownPlugin as gracefulShutdownPluginFn, _default$3 as healthPlugin, healthPlugin as healthPluginFn, _default$4 as metricsPlugin, metricsPlugin as metricsPluginFn, _default$5 as pressurePlugin, pressurePlugin as pressurePluginFn, _default$6 as realtimePlugin, realtimePlugin as realtimePluginFn, replyHelpersPlugin, _default$7 as requestIdPlugin, requestIdPlugin as requestIdPluginFn, sanitizeRequestId, _default$8 as schedulesPlugin, schedulesPlugin as schedulesPluginFn, _default$9 as ssePlugin, ssePlugin as ssePluginFn, _default$10 as versioningPlugin, versioningPlugin as versioningPluginFn };
229
+ export { type ArcCore, type ArcCorePluginOptions, type ArcPlugin, type CachingOptions, type CachingRule, type ChangeOperation, type CreatePluginDefinition, type ErrorHandlerOptions, type ErrorMapper, type GracefulShutdownOptions, type HealthCheck, type HealthOptions, type MetricEntry, type MetricsCollector, type MetricsOptions, type PluginMeta, type PluginResourceResult, type PressureApi, type PressureOptions, type PressureSignal, type PressureSnapshot, type PressureState, type PressureThresholds, type RealtimeOptions, type RequestIdOptions, type SSEOptions, type ScheduleDefinition, type ScheduleStats, type SchedulesPluginOptions, type ShutdownState, type TracingOptions, type VersioningOptions, _default as arcCorePlugin, _default$1 as cachingPlugin, createPlugin, createRequestIdGenerator, defaultIsDuplicateKeyError, errorHandlerPlugin, _default$2 as gracefulShutdownPlugin, _default$3 as healthPlugin, _default$4 as metricsPlugin, _default$5 as pressurePlugin, _default$6 as realtimePlugin, replyHelpersPlugin, _default$7 as requestIdPlugin, sanitizeRequestId, _default$8 as schedulesPlugin, _default$9 as ssePlugin, _default$10 as versioningPlugin };
@@ -1,20 +1,20 @@
1
- /*! @classytic/arc v2.41.0 | MIT | https://classytic.com */
2
- import { p as MUTATION_OPERATIONS } from "../constants-BxLgNFF7.mjs";
3
- import { arcLog } from "../logger/index.mjs";
4
- import { c as getOrgId } from "../types-CDy3-zw1.mjs";
5
- import { n as requestContext } from "../requestContext-cSVKnYPk.mjs";
6
- import { t as hasEvents } from "../typeGuards-D7tHFdH6.mjs";
7
- import { t as HookSystem } from "../HookSystem-CxvZBo77.mjs";
8
- import { t as ResourceRegistry } from "../ResourceRegistry-Cu7uTJp9.mjs";
9
- import { a as requestIdPlugin, i as createRequestIdGenerator, n as health_default, o as requestId_default, s as sanitizeRequestId, t as healthPlugin } from "../health-CxQzbJmr.mjs";
10
- import { n as caching_default, t as cachingPlugin } from "../caching-DsWDjIxx.mjs";
11
- import { n as errorHandlerPlugin, t as defaultIsDuplicateKeyError } from "../errorHandler-CIMkCOWm.mjs";
12
- import { n as metrics_default, t as metricsPlugin } from "../metrics-BaKnq8ag.mjs";
13
- import { n as realtime_default, t as realtimePlugin } from "../realtime-FnnD0n3Z.mjs";
14
- import { t as replyHelpersPlugin } from "../replyHelpers-DPHsdw-5.mjs";
15
- import { n as schedules_default, t as schedulesPlugin } from "../schedules-BktJb3Y3.mjs";
16
- import { n as sse_default, t as ssePlugin } from "../sse-CH7Slxc1.mjs";
17
- import { n as versioning_default, t as versioningPlugin } from "../versioning-DuVWcu-F.mjs";
1
+ /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
+ import { m as MUTATION_OPERATIONS } from "../constants-Cu7Mx7_U.mjs";
3
+ import { t as arcLog } from "../logger-DXjfIqjV.mjs";
4
+ import { c as getOrgId } from "../types-Bk9NOgOC.mjs";
5
+ import { n as requestContext } from "../requestContext-Dsu9P1bV.mjs";
6
+ import { t as hasEvents } from "../typeGuards-CySF12G-.mjs";
7
+ import { t as HookSystem } from "../HookSystem-B6UaKRbF.mjs";
8
+ import { t as ResourceRegistry } from "../ResourceRegistry-CuCARu2B.mjs";
9
+ import { c as createRequestIdGenerator, l as requestId_default, n as health_default, u as sanitizeRequestId } from "../health-DqbsG-_w.mjs";
10
+ import { t as caching_default } from "../caching-Cc2M1DwO.mjs";
11
+ import { n as errorHandlerPlugin, t as defaultIsDuplicateKeyError } from "../errorHandler-BnfDviL1.mjs";
12
+ import { t as metrics_default } from "../metrics-CWI11eRu.mjs";
13
+ import { t as realtime_default } from "../realtime-DmPE9S54.mjs";
14
+ import { t as replyHelpersPlugin } from "../replyHelpers-CG_VtVgS.mjs";
15
+ import { t as schedules_default } from "../schedules-C-OpmHBq.mjs";
16
+ import { t as sse_default } from "../sse-CYzQBVFe.mjs";
17
+ import { t as versioning_default } from "../versioning-fhhWHV74.mjs";
18
18
  import fp from "fastify-plugin";
19
19
  import { performance as performance$1 } from "node:perf_hooks";
20
20
  //#region src/core/arcCorePlugin.ts
@@ -106,7 +106,7 @@ const arcCorePlugin = async (fastify, opts = {}) => {
106
106
  });
107
107
  fastify.addHook("onClose", async () => {
108
108
  actualHookSystem.clear();
109
- actualRegistry._clear();
109
+ actualRegistry.reset();
110
110
  });
111
111
  fastify.log?.debug?.("Arc core plugin enabled (instance-scoped hooks & registry)");
112
112
  };
@@ -277,13 +277,30 @@ const pressurePlugin = async (fastify, options) => {
277
277
  worst: void 0,
278
278
  signals: {}
279
279
  };
280
+ const intervalMs = options.intervalMs ?? 1e3;
281
+ const readTimeoutMs = options.readTimeoutMs ?? intervalMs;
282
+ /** A signal whose read has not settled is not read again — the next sample waits on the same read. */
283
+ const pendingReads = /* @__PURE__ */ new Map();
284
+ const readSignal = (signal) => {
285
+ let read = pendingReads.get(signal.name);
286
+ if (!read) {
287
+ read = Promise.resolve().then(() => signal.read()).finally(() => pendingReads.delete(signal.name));
288
+ pendingReads.set(signal.name, read);
289
+ }
290
+ let timer;
291
+ const timeout = new Promise((_, reject) => {
292
+ timer = setTimeout(() => reject(/* @__PURE__ */ new Error(`read exceeded ${readTimeoutMs}ms`)), readTimeoutMs);
293
+ timer.unref?.();
294
+ });
295
+ return Promise.race([read, timeout]).finally(() => clearTimeout(timer));
296
+ };
280
297
  async function sample() {
281
298
  const values = {};
282
299
  let worst;
283
300
  for (const signal of signals) {
284
301
  let value = 0;
285
302
  try {
286
- value = clamp(await signal.read());
303
+ value = clamp(await readSignal(signal));
287
304
  broken.delete(signal.name);
288
305
  } catch (error) {
289
306
  if (!broken.has(signal.name)) {
@@ -317,9 +334,14 @@ const pressurePlugin = async (fastify, options) => {
317
334
  options.onStateChange?.(next, snapshot);
318
335
  }
319
336
  }
337
+ let sampling = false;
320
338
  const timer = setInterval(() => {
321
- sample();
322
- }, options.intervalMs ?? 1e3);
339
+ if (sampling) return;
340
+ sampling = true;
341
+ sample().finally(() => {
342
+ sampling = false;
343
+ });
344
+ }, intervalMs);
323
345
  timer.unref?.();
324
346
  fastify.addHook("onClose", async () => clearInterval(timer));
325
347
  fastify.decorate("pressure", {
@@ -368,4 +390,4 @@ var pressure_default = fp(pressurePlugin, {
368
390
  fastify: "5.x"
369
391
  });
370
392
  //#endregion
371
- export { arcCorePlugin_default as arcCorePlugin, arcCorePlugin as arcCorePluginFn, caching_default as cachingPlugin, cachingPlugin as cachingPluginFn, createPlugin, createRequestIdGenerator, defaultIsDuplicateKeyError, errorHandlerPlugin, errorHandlerPlugin as errorHandlerPluginFn, gracefulShutdown_default as gracefulShutdownPlugin, gracefulShutdownPlugin as gracefulShutdownPluginFn, health_default as healthPlugin, healthPlugin as healthPluginFn, metrics_default as metricsPlugin, metricsPlugin as metricsPluginFn, pressure_default as pressurePlugin, pressurePlugin as pressurePluginFn, realtime_default as realtimePlugin, realtimePlugin as realtimePluginFn, replyHelpersPlugin, requestId_default as requestIdPlugin, requestIdPlugin as requestIdPluginFn, sanitizeRequestId, schedules_default as schedulesPlugin, schedulesPlugin as schedulesPluginFn, sse_default as ssePlugin, ssePlugin as ssePluginFn, versioning_default as versioningPlugin, versioningPlugin as versioningPluginFn };
393
+ export { arcCorePlugin_default as arcCorePlugin, caching_default as cachingPlugin, createPlugin, createRequestIdGenerator, defaultIsDuplicateKeyError, errorHandlerPlugin, gracefulShutdown_default as gracefulShutdownPlugin, health_default as healthPlugin, metrics_default as metricsPlugin, pressure_default as pressurePlugin, realtime_default as realtimePlugin, replyHelpersPlugin, requestId_default as requestIdPlugin, sanitizeRequestId, schedules_default as schedulesPlugin, sse_default as ssePlugin, versioning_default as versioningPlugin };
@@ -1,6 +1,7 @@
1
- /*! @classytic/arc v2.41.0 | MIT | https://classytic.com */
2
- import { n as declareRuntimeCapability } from "../runtimeCapabilities-DSA_dH1_.mjs";
3
- import { t as hasEvents } from "../typeGuards-D7tHFdH6.mjs";
1
+ /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
+ import { n as declareRuntimeCapability } from "../runtimeCapabilities-0tccjRlj.mjs";
3
+ import { t as hasEvents } from "../typeGuards-CySF12G-.mjs";
4
+ import { n as evictToSize, r as touch, t as assertCapacity } from "../boundedMap-BULzfXYU.mjs";
4
5
  import fp from "fastify-plugin";
5
6
  //#region src/plugins/response-cache.ts
6
7
  /**
@@ -28,22 +29,14 @@ var LRUCache = class {
28
29
  this.misses++;
29
30
  return null;
30
31
  }
31
- this.cache.delete(key);
32
- this.cache.set(key, entry);
32
+ touch(this.cache, key, entry);
33
33
  this.hits++;
34
34
  return entry;
35
35
  }
36
36
  set(key, entry) {
37
37
  if (this.isPrefixLocked(key)) return;
38
- if (this.cache.has(key)) this.cache.delete(key);
39
- while (this.cache.size >= this.maxEntries) {
40
- const firstKey = this.cache.keys().next().value;
41
- if (firstKey !== void 0) {
42
- this.cache.delete(firstKey);
43
- this.evictions++;
44
- }
45
- }
46
- this.cache.set(key, entry);
38
+ touch(this.cache, key, entry);
39
+ this.evictions += evictToSize(this.cache, this.maxEntries);
47
40
  }
48
41
  /** Invalidate entries matching a path prefix and lock it from caching to allow DB replicas to catch up */
49
42
  invalidatePrefix(prefix, jitterMs = 1500) {
@@ -95,6 +88,7 @@ const responseCachePluginImpl = async (fastify, opts = {}) => {
95
88
  "DELETE"
96
89
  ], xCacheHeader = true, statsPath = null, keyFn } = opts;
97
90
  if (maxEntries > 5e3) fastify.log.warn(`[arc] responseCache maxEntries=${maxEntries}: prefix invalidation scans all entries synchronously on every mutating request — expect event-loop pauses at this size. This cache is an instance-local micro-cache; for large shared caching use the queryCache with a Redis store instead.`);
91
+ assertCapacity("responseCache maxEntries", maxEntries);
98
92
  const cache = new LRUCache(maxEntries);
99
93
  const invalidateMethods = new Set(invalidateOn.map((m) => m.toUpperCase()));
100
94
  declareRuntimeCapability(fastify, {
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.41.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
2
  import { createRequire } from "node:module";
3
3
  import fp from "fastify-plugin";
4
4
  //#region src/plugins/tracing.ts
@@ -59,7 +59,7 @@ try {
59
59
  function createTracerProvider(options) {
60
60
  if (!isAvailable || !NodeTracerProvider || !BatchSpanProcessor || !OTLPTraceExporter) return null;
61
61
  const { serviceName = "@classytic/arc", serviceVersion, exporterUrl = "http://localhost:4318/v1/traces" } = options;
62
- const resolvedVersion = serviceVersion ?? "2.41.0";
62
+ const resolvedVersion = serviceVersion ?? "2.43.0";
63
63
  const exporter = new OTLPTraceExporter({ url: exporterUrl });
64
64
  const provider = new NodeTracerProvider({ resource: { attributes: {
65
65
  "service.name": serviceName,
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.41.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
2
  //#region src/utils/pluralize.ts
3
3
  /**
4
4
  * Lightweight English pluralization for the Arc CLI.
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { i as RequestScope } from "../types-Ddl9OjmE.mjs";
3
- import { l as PermissionCheck } from "../base-CxrV1LmG.mjs";
4
- import { Y as PresetResult } from "../index-DHbyPo5j.mjs";
3
+ import { l as PermissionCheck } from "../base-CZyixEQR.mjs";
4
+ import { W as PresetResult } from "../index-mqaqZNpe.mjs";
5
5
  import { a as StorageReadResult, i as StorageReadRange, n as StorageContext, o as StorageUploadInput, r as StorageFile, t as Storage } from "../storage-Cx9Sz3Ou.mjs";
6
6
  //#region src/presets/filesUpload.d.ts
7
7
  interface FilesUploadPresetRoutes {
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.41.0 | MIT | https://classytic.com */
2
- import { i as NotFoundError, u as ValidationError } from "../errors-C_YhELhe.mjs";
3
- import { c as getOrgId, g as getUserId } from "../types-CDy3-zw1.mjs";
4
- import { B as requireAuth, F as allowPublic } from "../permissions-DiHXy8Ck.mjs";
5
- import { t as multipartBody } from "../multipartBody-C92aJ8am.mjs";
1
+ /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
+ import { i as NotFoundError, u as ValidationError } from "../errors-CtrywMHP.mjs";
3
+ import { c as getOrgId, g as getUserId } from "../types-Bk9NOgOC.mjs";
4
+ import { B as requireAuth, F as allowPublic } from "../permissions-Cm0uYHvd.mjs";
5
+ import { t as multipartBody } from "../multipartBody-CXM2a-Dy.mjs";
6
6
  //#region src/presets/filesUpload.ts
7
7
  const DEFAULT_FIELD_NAME = "file";
8
8
  const DEFAULT_MAX_FILE_SIZE = 10485760;
@@ -1,9 +1,31 @@
1
1
 
2
- import { t as AnyRecord } from "../base-CxrV1LmG.mjs";
3
- import { Fn as IControllerResponse, In as IRequestContext, U as ResourceConfig, Y as PresetResult, d as PaginationResult } from "../index-DHbyPo5j.mjs";
2
+ import { t as AnyRecord } from "../base-CZyixEQR.mjs";
3
+ import { In as IControllerResponse, L as ResourceConfig, Ln as IRequestContext, W as PresetResult, i as PaginationResult } from "../index-mqaqZNpe.mjs";
4
4
  import { FilesUploadPresetOptions, FilesUploadPresetPermissions, FilesUploadPresetRoutes, filesUploadPreset } from "./filesUpload.mjs";
5
- import { MultiTenantOptions, TenantFieldSpec, multiTenantPreset } from "./multiTenant.mjs";
5
+ import { n as multiTenantPreset, r as TenantFieldSpec, t as MultiTenantOptions } from "../multiTenant-cY0FkDiA.mjs";
6
6
  import { SearchHandler, SearchPresetOptions, SearchRouteConfig, searchPreset } from "./search.mjs";
7
+ //#region src/presets/audited.d.ts
8
+ interface AuditedPresetOptions {
9
+ /** Field name for creator (default: 'createdBy') */
10
+ createdByField?: string;
11
+ /** Field name for updater (default: 'updatedBy') */
12
+ updatedByField?: string;
13
+ }
14
+ /**
15
+ * Audited preset - adds createdBy/updatedBy tracking
16
+ */
17
+ declare function auditedPreset(options?: AuditedPresetOptions): PresetResult;
18
+ //#endregion
19
+ //#region src/presets/bulk.d.ts
20
+ type BulkOperation = "createMany" | "updateMany" | "deleteMany";
21
+ interface BulkPresetOptions {
22
+ /** Which bulk operations to enable (default: all three) */
23
+ operations?: BulkOperation[];
24
+ /** Max items per bulk create (default: 1000) */
25
+ maxCreateItems?: number;
26
+ }
27
+ declare function bulkPreset(opts?: BulkPresetOptions): PresetResult;
28
+ //#endregion
7
29
  //#region src/presets/ownedByUser.d.ts
8
30
  interface OwnedByUserOptions {
9
31
  ownerField?: string;
@@ -31,28 +53,6 @@ declare function slugLookupPreset(options?: SlugLookupOptions): PresetResult;
31
53
  //#region src/presets/softDelete.d.ts
32
54
  declare function softDeletePreset(): PresetResult;
33
55
  //#endregion
34
- //#region src/presets/audited.d.ts
35
- interface AuditedPresetOptions {
36
- /** Field name for creator (default: 'createdBy') */
37
- createdByField?: string;
38
- /** Field name for updater (default: 'updatedBy') */
39
- updatedByField?: string;
40
- }
41
- /**
42
- * Audited preset - adds createdBy/updatedBy tracking
43
- */
44
- declare function auditedPreset(options?: AuditedPresetOptions): PresetResult;
45
- //#endregion
46
- //#region src/presets/bulk.d.ts
47
- type BulkOperation = "createMany" | "updateMany" | "deleteMany";
48
- interface BulkPresetOptions {
49
- /** Which bulk operations to enable (default: all three) */
50
- operations?: BulkOperation[];
51
- /** Max items per bulk create (default: 1000) */
52
- maxCreateItems?: number;
53
- }
54
- declare function bulkPreset(opts?: BulkPresetOptions): PresetResult;
55
- //#endregion
56
56
  //#region src/presets/tree.d.ts
57
57
  interface TreeOptions {
58
58
  parentField?: string;
@@ -267,11 +267,6 @@ type UnionToIntersection<U> = (U extends unknown ? (x: U) => void : never) exten
267
267
  type IPresetController<TDoc = unknown, TPresets extends keyof PresetControllerContracts<TDoc> = never> = UnionToIntersection<PresetControllerContracts<TDoc>[TPresets]>;
268
268
  //#endregion
269
269
  //#region src/presets/index.d.ts
270
- /**
271
- * Convenience alias for multiTenantPreset with public list/get routes
272
- * Equivalent to: multiTenantPreset({ allowPublic: ['list', 'get'] })
273
- */
274
- declare const flexibleMultiTenantPreset: (options?: Omit<MultiTenantOptions, "allowPublic">) => PresetResult;
275
270
  type PresetFactory = (options?: AnyRecord) => PresetResult;
276
271
  /**
277
272
  * Get preset by name with options
@@ -300,4 +295,4 @@ type PresetInput = string | PresetResult | {
300
295
  */
301
296
  declare function applyPresets<TDoc = AnyRecord>(config: ResourceConfig<TDoc>, presets?: PresetInput[]): ResourceConfig<TDoc>;
302
297
  //#endregion
303
- export { type AuditedPresetOptions, type BulkOperation, type BulkPresetOptions, type FilesUploadPresetOptions, type FilesUploadPresetPermissions, type FilesUploadPresetRoutes, type IAuditedPreset, type IMultiTenantPreset, type IOwnedByUserPreset, type IPresetController, type ISlugLookupController, type ISoftDeleteController, type ITreeController, type MultiTenantOptions, type OwnedByUserOptions, type SearchHandler, type SearchPresetOptions, type SearchRouteConfig, type SlugLookupOptions, type TenantFieldSpec, type TreeOptions, applyPresets, auditedPreset, bulkPreset, filesUploadPreset, flexibleMultiTenantPreset, getAvailablePresets, getPreset, multiTenantPreset, ownedByUserPreset, registerPreset, searchPreset, slugLookupPreset, softDeletePreset, treePreset };
298
+ export { type AuditedPresetOptions, type BulkOperation, type BulkPresetOptions, type FilesUploadPresetOptions, type FilesUploadPresetPermissions, type FilesUploadPresetRoutes, type IAuditedPreset, type IMultiTenantPreset, type IOwnedByUserPreset, type IPresetController, type ISlugLookupController, type ISoftDeleteController, type ITreeController, type MultiTenantOptions, type OwnedByUserOptions, PresetInput, type SearchHandler, type SearchPresetOptions, type SearchRouteConfig, type SlugLookupOptions, type TenantFieldSpec, type TreeOptions, applyPresets, auditedPreset, bulkPreset, filesUploadPreset, getAvailablePresets, getPreset, multiTenantPreset, ownedByUserPreset, registerPreset, searchPreset, slugLookupPreset, softDeletePreset, treePreset };
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.41.0 | MIT | https://classytic.com */
2
- import { multiTenantPreset } from "./multiTenant.mjs";
3
- import { a as registerPreset, c as auditedPreset, d as ownedByUserPreset, i as getPreset, l as softDeletePreset, n as flexibleMultiTenantPreset, o as treePreset, r as getAvailablePresets, s as bulkPreset, t as applyPresets, u as slugLookupPreset } from "../presets-BdlugYTc.mjs";
1
+ /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
+ import { a as treePreset, c as ownedByUserPreset, i as registerPreset, l as bulkPreset, n as getAvailablePresets, o as softDeletePreset, r as getPreset, s as slugLookupPreset, t as applyPresets, u as auditedPreset } from "../presets-Cpvj6fGO.mjs";
4
3
  import { filesUploadPreset } from "./filesUpload.mjs";
4
+ import { multiTenantPreset } from "./multiTenant.mjs";
5
5
  import { searchPreset } from "./search.mjs";
6
- export { applyPresets, auditedPreset, bulkPreset, filesUploadPreset, flexibleMultiTenantPreset, getAvailablePresets, getPreset, multiTenantPreset, ownedByUserPreset, registerPreset, searchPreset, slugLookupPreset, softDeletePreset, treePreset };
6
+ export { applyPresets, auditedPreset, bulkPreset, filesUploadPreset, getAvailablePresets, getPreset, multiTenantPreset, ownedByUserPreset, registerPreset, searchPreset, slugLookupPreset, softDeletePreset, treePreset };
@@ -1,108 +1,3 @@
1
1
 
2
- import { X as CrudRouteKey, Y as PresetResult } from "../index-DHbyPo5j.mjs";
3
- //#region src/presets/multiTenant.d.ts
4
- /**
5
- * One tenant dimension for multi-field filtering. Discriminated by source:
6
- * - `type: 'org'` → reads `getOrgId(scope)`
7
- * - `type: 'team'` → reads `getTeamId(scope)`
8
- * - `contextKey` → reads `getScopeContext(scope, contextKey)` (any custom dimension)
9
- */
10
- type TenantFieldSpec = {
11
- field: string;
12
- type: "org";
13
- } | {
14
- field: string;
15
- type: "team";
16
- } | {
17
- field: string;
18
- contextKey: string;
19
- };
20
- interface MultiTenantOptions {
21
- /**
22
- * Single-field form: name of the database field to filter by.
23
- * Reads `getOrgId(scope)` as the value source.
24
- *
25
- * Mutually exclusive with `tenantFields` — pass one or the other, not both.
26
- *
27
- * @default 'organizationId'
28
- */
29
- tenantField?: string;
30
- /**
31
- * Multi-field form (2.7.1+): list of tenant dimensions to filter by in
32
- * lockstep. Use this when a resource is scoped by more than just
33
- * organization — e.g. organization + branch, organization + project,
34
- * or organization + team + workspace.
35
- *
36
- * Each entry is a discriminated `TenantFieldSpec` declaring where the
37
- * value comes from. Use `type: 'org'` / `type: 'team'` for built-in scope
38
- * fields, or `contextKey: '...'` to read from `scope.context` (set by
39
- * your auth function).
40
- *
41
- * Fail-closed: if any required dimension is missing, the request is
42
- * rejected. Elevated scopes apply whatever resolves and skip the rest.
43
- *
44
- * Mutually exclusive with `tenantField`.
45
- *
46
- * @example
47
- * ```typescript
48
- * multiTenantPreset({
49
- * tenantFields: [
50
- * { field: 'organizationId', type: 'org' },
51
- * { field: 'branchId', contextKey: 'branchId' },
52
- * ],
53
- * })
54
- * ```
55
- */
56
- tenantFields?: readonly TenantFieldSpec[];
57
- /**
58
- * Routes that allow public access (no auth required)
59
- * When a route is in this array:
60
- * - If no org context: allow through without filtering (public data)
61
- * - If org context present: require auth and apply filter
62
- *
63
- * @default [] (strict mode - all routes require auth)
64
- * @example
65
- * multiTenantPreset({ allowPublic: ['list', 'get'] })
66
- */
67
- allowPublic?: CrudRouteKey[];
68
- /**
69
- * Reads that are NOT scoped to a tenant at all — a marketplace listing.
70
- *
71
- * `allowPublic` answers "may an anonymous caller reach this route?". That is a different
72
- * question from "is this listing scoped to a tenant?", and until this option there was no way
73
- * to answer the second one with "no". An `allowPublic` route still filters by the caller's
74
- * organization whenever they have one, and a signed-in user of a multi-org product ALWAYS has
75
- * one, because choosing an organization writes it onto the session. So a cross-tenant catalog
76
- * silently became single-tenant the moment one of its own sellers browsed it: the same URL,
77
- * with no header and no query parameter to explain the difference, returned a different world
78
- * depending on who was asking.
79
- *
80
- * The only escape was to drop this preset from the resource entirely, which also drops tenant
81
- * INJECTION on create/update — the thing that stops a member moving a document into another
82
- * organization. Trading a write guarantee for a read behaviour is not a real choice.
83
- *
84
- * Listed routes get no tenant middleware: no filter, and nothing stashed for the repo layer.
85
- * Everything else keeps its filter, so writes are unaffected.
86
- *
87
- * READS ONLY, by type. A cross-tenant `create` or `update` is not a listing, it is an escape
88
- * from tenancy, and it should never be one option away by accident.
89
- *
90
- * THIS DOES NOT AUTHORIZE ANYTHING. Removing the tenant filter widens what the query can
91
- * return, so the resource owes a row-level `policy` from its permission check saying what a
92
- * stranger may see (`{ status: 'active' }`, `{ visibility: 'public' }`). Declaring this without
93
- * one publishes every row in every tenant.
94
- *
95
- * @default []
96
- * @example
97
- * // A public catalog: anyone may browse every seller's LIVE products,
98
- * // while create/update/delete stay pinned to the caller's own shop.
99
- * multiTenantPreset({
100
- * allowPublic: ['list', 'get'],
101
- * crossTenant: ['list', 'get'],
102
- * })
103
- */
104
- crossTenant?: readonly Extract<CrudRouteKey, "list" | "get">[];
105
- }
106
- declare function multiTenantPreset(options?: MultiTenantOptions): PresetResult;
107
- //#endregion
108
- export { MultiTenantOptions, TenantFieldSpec, multiTenantPreset };
2
+ import { n as multiTenantPreset, r as TenantFieldSpec, t as MultiTenantOptions } from "../multiTenant-cY0FkDiA.mjs";
3
+ export { MultiTenantOptions, type TenantFieldSpec, multiTenantPreset };