@classytic/arc 2.48.0 → 2.49.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 (213) hide show
  1. package/dist/{EventTransport-BWwg5YAU.mjs → EventTransport-DbHZK230.mjs} +2 -2
  2. package/dist/{HookSystem-B9x-Y_k7.mjs → HookSystem-DMoeJ6Do.mjs} +2 -2
  3. package/dist/{QueryCache-DdvrGG8Q.d.mts → QueryCache-BE47tmlO.d.mts} +36 -1
  4. package/dist/{ResourceRegistry-BcvEJoZd.mjs → ResourceRegistry-CP-iTcKy.mjs} +2 -2
  5. package/dist/{acquire-D2yj6Zzl.mjs → acquire-CB0va87C.mjs} +1 -1
  6. package/dist/audit/index.d.mts +1 -1
  7. package/dist/audit/index.mjs +4 -4
  8. package/dist/auth/audit.mjs +1 -1
  9. package/dist/auth/index.d.mts +2 -2
  10. package/dist/auth/index.mjs +53 -15
  11. package/dist/auth/redis-session.mjs +1 -1
  12. package/dist/{authorizationDecision-BZSJcPNE.mjs → authorizationDecision-DHO94aV2.mjs} +4 -4
  13. package/dist/{boundedMap-o2KZDCWy.mjs → boundedMap-C51EUUOm.mjs} +1 -1
  14. package/dist/{buildHandler-G3k59KY2.mjs → buildHandler-9DuwEKvr.mjs} +23 -16
  15. package/dist/cache/index.d.mts +2 -2
  16. package/dist/cache/index.mjs +4 -4
  17. package/dist/{caching-CJIDPZOv.mjs → caching-COTX3sDa.mjs} +3 -6
  18. package/dist/{claimed-D0A43wjT.mjs → claimed-C7T1nHlo.mjs} +1 -1
  19. package/dist/cleanup/index.d.mts +2 -2
  20. package/dist/cleanup/index.mjs +4 -4
  21. package/dist/cli/commands/describe.d.mts +1 -1
  22. package/dist/cli/commands/describe.mjs +3 -3
  23. package/dist/cli/commands/docs.mjs +3 -3
  24. package/dist/cli/commands/doctor.mjs +1 -1
  25. package/dist/cli/commands/generate.mjs +2 -2
  26. package/dist/cli/commands/init.mjs +2 -2
  27. package/dist/cli/commands/introspect.mjs +2 -2
  28. package/dist/cli/index.mjs +3 -3
  29. package/dist/{constants-D-faL5SX.mjs → constants-DOnfMd7i.mjs} +1 -1
  30. package/dist/context/index.mjs +5 -5
  31. package/dist/core/index.d.mts +3 -3
  32. package/dist/core/index.mjs +7 -7
  33. package/dist/{core-NSu1peyq.mjs → core-BoEdFDDw.mjs} +3 -3
  34. package/dist/{createActionRouter-DTSVv1VK.mjs → createActionRouter-CpTn15dm.mjs} +54 -18
  35. package/dist/{createAggregationRouter-zEasm-ax.mjs → createAggregationRouter-CD_Hydp0.mjs} +13 -11
  36. package/dist/{createApp-CjqhkX1x.mjs → createApp-Be6XTGD9.mjs} +332 -40
  37. package/dist/{createMcpServer-hSFeqRUb.d.mts → createMcpServer-CS2KOVP6.d.mts} +1 -1
  38. package/dist/{defineAggregation-DH2L6_v9.mjs → defineAggregation-BI5pRb8c.mjs} +1 -1
  39. package/dist/{defineResource-zYCrhNaN.mjs → defineResource-BAzNu5Um.mjs} +8 -8
  40. package/dist/discovery/index.mjs +1 -1
  41. package/dist/docs/index.d.mts +1 -1
  42. package/dist/docs/index.mjs +3 -3
  43. package/dist/{elevation-z--rFcZ5.mjs → elevation-DupGuM41.mjs} +6 -9
  44. package/dist/encryption/index.mjs +3 -3
  45. package/dist/{errorHandler-3_3oN-Uc.mjs → errorHandler-DA03vRqp.mjs} +4 -7
  46. package/dist/{errors-DyY48oRi.mjs → errors-BpYV859Y.mjs} +1 -1
  47. package/dist/{eventPlugin-Co9sABCg.mjs → eventPlugin-D7LYtYzL.mjs} +9 -13
  48. package/dist/{eventTypes-HmAFyJmJ.mjs → eventTypes-BqA-N-Uz.mjs} +2 -2
  49. package/dist/events/index.d.mts +18 -5
  50. package/dist/events/index.mjs +8 -8
  51. package/dist/events/transports/redis-stream-entry.mjs +4 -4
  52. package/dist/events/transports/redis.d.mts +35 -0
  53. package/dist/events/transports/redis.mjs +87 -11
  54. package/dist/factory/index.d.mts +4 -4
  55. package/dist/factory/index.mjs +6 -6
  56. package/dist/{fastify-augmentation-bzkWPt1f.d.mts → fastify-augmentation-baQc3MaO.d.mts} +2 -2
  57. package/dist/fieldTypes-EFWxCkZ5.mjs +80 -0
  58. package/dist/{fields-rfsl26Ov.mjs → fields-CT1Erg7o.mjs} +1 -1
  59. package/dist/{filter-merge-8glLr7Dk.mjs → filter-merge-B1eJ1pMx.mjs} +1 -1
  60. package/dist/{generate-BOfBueRt.mjs → generate-Cr0ULavs.mjs} +2 -2
  61. package/dist/{headers-CHSOqpcY.mjs → headers-D4bncIOf.mjs} +2 -2
  62. package/dist/{health-ezwTHQh2.mjs → health-BoFxrkJE.mjs} +1 -1
  63. package/dist/{health-DHvAIVmM.mjs → health-DN_pUVMX.mjs} +1 -1
  64. package/dist/hooks/index.d.mts +1 -1
  65. package/dist/hooks/index.mjs +2 -2
  66. package/dist/http-cache/index.d.mts +2 -2
  67. package/dist/http-cache/index.mjs +4 -4
  68. package/dist/http-cache/purgers/cloudflare.mjs +2 -2
  69. package/dist/http-cache/purgers/fastly.mjs +2 -2
  70. package/dist/http-cache/testing/index.mjs +1 -1
  71. package/dist/idempotency/index.d.mts +1 -1
  72. package/dist/idempotency/index.mjs +10 -8
  73. package/dist/idempotency/redis.mjs +2 -2
  74. package/dist/{index-B5i9-vuP.d.mts → index-CMNpMBtW.d.mts} +1 -1
  75. package/dist/{index-BxZS-8So.d.mts → index-DKM2p5w5.d.mts} +48 -23
  76. package/dist/{index-Cy2-QffW.d.mts → index-DLCcLUQT.d.mts} +69 -6
  77. package/dist/{index-DFCCQ9AE.d.mts → index-DexdFs1a.d.mts} +1 -1
  78. package/dist/{index-D1X_C_qz.d.mts → index-Dhrks-hM.d.mts} +60 -10
  79. package/dist/index.d.mts +4 -4
  80. package/dist/index.mjs +11 -11
  81. package/dist/{init-MoE3eZNR.mjs → init-C4a24wD2.mjs} +1 -1
  82. package/dist/integrations/event-gateway.mjs +2 -2
  83. package/dist/integrations/index.d.mts +2 -2
  84. package/dist/integrations/index.mjs +1 -1
  85. package/dist/integrations/jobs/index.mjs +3 -3
  86. package/dist/integrations/mcp/index.d.mts +5 -5
  87. package/dist/integrations/mcp/index.mjs +2 -2
  88. package/dist/integrations/mcp/testing.d.mts +2 -2
  89. package/dist/integrations/mcp/testing.mjs +2 -2
  90. package/dist/integrations/streamline.mjs +3 -3
  91. package/dist/integrations/webhooks.d.mts +1 -1
  92. package/dist/integrations/webhooks.mjs +4 -4
  93. package/dist/integrations/websocket-pushref-redis.mjs +1 -1
  94. package/dist/integrations/websocket-redis.mjs +1 -1
  95. package/dist/integrations/websocket.mjs +2 -2
  96. package/dist/{jsonBody-DZGiCawf.mjs → jsonBody-DoTt5BS6.mjs} +2 -2
  97. package/dist/{keys-CrMOZuk6.mjs → keys--l9n7aOC.mjs} +1 -1
  98. package/dist/{loadResources-CVQvYUhN.mjs → loadResources-rygByIQA.mjs} +3 -3
  99. package/dist/{loadResourcesFromEntry-D0naccV2.mjs → loadResourcesFromEntry-ItNBIQ5w.mjs} +2 -2
  100. package/dist/logger/index.mjs +2 -2
  101. package/dist/{logger-VyMcSmVG.mjs → logger-UbknHqHy.mjs} +1 -1
  102. package/dist/{mcpPlugin-DQACaqVu.mjs → mcpPlugin-CTkk4RP8.mjs} +29 -26
  103. package/dist/{memory-Lpfu8Hga.mjs → memory-C47xVsjX.mjs} +3 -3
  104. package/dist/{metrics-DjVj1sg5.mjs → metrics-TJyAb1Xk.mjs} +4 -7
  105. package/dist/middleware/index.d.mts +1 -1
  106. package/dist/middleware/index.mjs +3 -3
  107. package/dist/migrations/index.mjs +2 -2
  108. package/dist/{module-BqPJpZ_L.mjs → module-CWiqsXnh.mjs} +1 -1
  109. package/dist/{multiTenant-KZj8j1uJ.d.mts → multiTenant-QtDzxx_K.d.mts} +1 -1
  110. package/dist/{multipartBody-BNgNv7r0.mjs → multipartBody-BdG1qbn1.mjs} +1 -1
  111. package/dist/{observeSend-BKJHibJz.mjs → observeSend-DrA3ADFN.mjs} +1 -1
  112. package/dist/{openapi-T90KrPR6.mjs → openapi-D6MAbYpv.mjs} +7 -7
  113. package/dist/outbox-admin/index.d.mts +1 -1
  114. package/dist/outbox-admin/index.mjs +5 -5
  115. package/dist/{outbox-module-C874VgBr.mjs → outbox-module-D5QABFQW.mjs} +197 -28
  116. package/dist/{outbox-module-5Mnwcycy.d.mts → outbox-module-DzW6zwWJ.d.mts} +103 -10
  117. package/dist/permissions/index.d.mts +2 -2
  118. package/dist/permissions/index.mjs +7 -7
  119. package/dist/{permissions-R9T2G1PH.mjs → permissions-CFsmdYUt.mjs} +9 -9
  120. package/dist/{pipe-DzqbsZy-.mjs → pipe-B_05AgGt.mjs} +2 -2
  121. package/dist/pipeline/index.d.mts +1 -1
  122. package/dist/pipeline/index.mjs +2 -2
  123. package/dist/{plan-C0gkeABY.mjs → plan-BnlNJhrj.mjs} +1 -1
  124. package/dist/{plugin-BJcVOX5r.mjs → plugin-CrMPYbdj.mjs} +94 -50
  125. package/dist/plugins/index.d.mts +6 -5
  126. package/dist/plugins/index.mjs +19 -18
  127. package/dist/plugins/response-cache.mjs +4 -4
  128. package/dist/plugins/tracing-entry.mjs +2 -2
  129. package/dist/{pluralize-CrCpyoZs.mjs → pluralize-oVIxJ4CY.mjs} +1 -1
  130. package/dist/presets/filesUpload.d.mts +1 -1
  131. package/dist/presets/filesUpload.mjs +5 -5
  132. package/dist/presets/index.d.mts +2 -2
  133. package/dist/presets/index.mjs +2 -2
  134. package/dist/presets/multiTenant.d.mts +1 -1
  135. package/dist/presets/multiTenant.mjs +5 -5
  136. package/dist/presets/search.d.mts +1 -1
  137. package/dist/presets/search.mjs +2 -2
  138. package/dist/{presets-CNDvNYsz.mjs → presets-CUd3L7v6.mjs} +4 -4
  139. package/dist/{projection-CIUe8b59.mjs → projection-DowJlIto.mjs} +2 -2
  140. package/dist/{purger.types-f83fTzGy.mjs → purger.types-BjKy8869.mjs} +1 -1
  141. package/dist/{queryCachePlugin-B2jpwFcv.mjs → queryCachePlugin-BvB3k_Fh.mjs} +114 -14
  142. package/dist/{queryCachePlugin-DYQUyeJ9.d.mts → queryCachePlugin-DrQNnGws.d.mts} +1 -1
  143. package/dist/{rateLimitKey-BWx-qep0.mjs → rateLimitKey-56nH1cWN.mjs} +1 -1
  144. package/dist/{realtime-D2tqi3d2.mjs → realtime-DXGBPtYK.mjs} +19 -22
  145. package/dist/registry/index.d.mts +2 -2
  146. package/dist/registry/index.mjs +3 -3
  147. package/dist/{registry-Dl0k6UXy.mjs → registry-Biz-6sEZ.mjs} +2 -2
  148. package/dist/{relay-ZYvS4xyW.mjs → relay-DEIoMntZ.mjs} +200 -99
  149. package/dist/{renewingLease-DT4yLb29.mjs → renewingLease-BCJpW9-u.mjs} +1 -1
  150. package/dist/{replyHelpers-BJFN5AW7.mjs → replyHelpers-DliJNb0-.mjs} +2 -2
  151. package/dist/{requestContext-Ct5la-SA.mjs → requestContext-tUgLt9Ky.mjs} +1 -1
  152. package/dist/{requirement-CxDxjB6V.mjs → requirement-0l2DApiQ.mjs} +1 -1
  153. package/dist/{resourceRateLimit-DCWglD7V.d.mts → resourceRateLimit-BPiESPtG.d.mts} +4 -0
  154. package/dist/{resourceRateLimit-D1oH2obv.mjs → resourceRateLimit-iSXF8rLH.mjs} +19 -4
  155. package/dist/{rolldown-runtime-BdTN42uL.mjs → rolldown-runtime-gKJR3o-6.mjs} +1 -1
  156. package/dist/{routeValidator-DclDl5WJ.mjs → routeValidator-xNYA4rr1.mjs} +47 -5
  157. package/dist/{runtimeCapabilities-ClWr60El.mjs → runtimeCapabilities-BQK-GrYe.mjs} +1 -1
  158. package/dist/{schedules-gVkRcs-9.mjs → schedules-D9iMVFhF.mjs} +6 -9
  159. package/dist/{schemaConverter-CIwB5wPO.mjs → schemaConverter-cIh4oX9a.mjs} +2 -2
  160. package/dist/{actionPermissions-Dha8sAz2.mjs → schemaIR-BsY4y9VP.mjs} +184 -16
  161. package/dist/schemas/index.mjs +1 -1
  162. package/dist/scim/index.mjs +2 -2
  163. package/dist/scope/index.d.mts +1 -1
  164. package/dist/scope/index.mjs +5 -5
  165. package/dist/{scope-VMZhdkbT.mjs → scope-QyhM9w8z.mjs} +4 -4
  166. package/dist/{shutdown-Bi19vH0z.mjs → shutdown-BM7Q0h4B.mjs} +1 -1
  167. package/dist/{sse-BqM359f1.mjs → sse-ofvlcTQQ.mjs} +9 -35
  168. package/dist/sseStats-DQqNN385.d.mts +112 -0
  169. package/dist/sseStream-BxQW7hPq.mjs +166 -0
  170. package/dist/{store-helpers-rx-F2ZGR.mjs → store-helpers-_FRhHDyv.mjs} +1 -1
  171. package/dist/{simpleEqualityMatcher-CaCS09fh.mjs → streamFrames-B3ZJfI02.mjs} +19 -2
  172. package/dist/{streaming-CPChx3A7.mjs → streaming-HZr63UiM.mjs} +1 -1
  173. package/dist/{subscriberIdentity-CYNYw8p_.mjs → subscriberIdentity-DSgnoT_D.mjs} +1 -1
  174. package/dist/{tenancy-BoWImS3K.mjs → tenancy-_ukT0oBt.mjs} +2 -2
  175. package/dist/{tenantPreparation-oqKCZQZM.mjs → tenantPreparation-DSlQI53c.mjs} +4 -4
  176. package/dist/testing/cleanupStoreContract.mjs +1 -1
  177. package/dist/testing/index.d.mts +4 -4
  178. package/dist/testing/index.mjs +324 -17
  179. package/dist/testing/outboxStoreContract.mjs +2 -2
  180. package/dist/testing/requiredPorts.mjs +2 -2
  181. package/dist/testing/storageContract.mjs +1 -1
  182. package/dist/{timing-Dsteq59c.mjs → timing-Z8p-Zlw1.mjs} +1 -1
  183. package/dist/{transactionContext-C1OgH-hW.mjs → transactionContext-DBbSTfY3.mjs} +1 -1
  184. package/dist/{typeGuards-DNlpASzd.mjs → typeGuards-_6nNQqgq.mjs} +1 -1
  185. package/dist/types/index.d.mts +1 -1
  186. package/dist/types/index.mjs +1 -1
  187. package/dist/types/storage.mjs +1 -1
  188. package/dist/{types-DduBiYaI.d.mts → types-B4E0sc6D.d.mts} +2 -2
  189. package/dist/{types-HFFSwF_K.mjs → types-CrOlZ4rY.mjs} +4 -4
  190. package/dist/usage/index.d.mts +1 -1
  191. package/dist/usage/index.mjs +7 -7
  192. package/dist/{userHelpers-N-k-8dNF.mjs → userHelpers-CBKx3XJN.mjs} +1 -1
  193. package/dist/utils/index.d.mts +239 -34
  194. package/dist/utils/index.mjs +13 -13
  195. package/dist/{utils-C7w_RVlx.mjs → utils--HE8R8sH.mjs} +761 -8
  196. package/dist/{validate-Brr4b_fH.mjs → validate-BUeE2MLR.mjs} +3 -3
  197. package/dist/{versioning-S18y2-0C.d.mts → versioning-B07RgD27.d.mts} +2 -13
  198. package/dist/{versioning-CE5kdWOY.mjs → versioning-qYgqwOhL.mjs} +4 -7
  199. package/dist/{workScope-A3XBpYTa.mjs → workScope-C-1QHNmV.mjs} +2 -2
  200. package/llms.txt +2 -2
  201. package/package.json +34 -34
  202. package/skills/arc/references/api-reference.md +2 -2
  203. package/skills/arc/references/auth-better-auth.md +1 -0
  204. package/skills/arc/references/events-outbox.md +7 -4
  205. package/skills/arc/references/events.md +2 -2
  206. package/skills/arc/references/production-api.md +4 -0
  207. package/skills/arc/references/production-boot.md +2 -0
  208. package/skills/arc/references/production-idempotency.md +1 -1
  209. package/skills/arc/references/production-realtime.md +28 -2
  210. package/skills/arc/references/validation.md +4 -0
  211. package/skills/arc/references/writes-hooks-errors.md +1 -0
  212. package/dist/schemaIR-A0IoD05P.mjs +0 -108
  213. package/dist/sseStream-qSa-F2Qm.mjs +0 -57
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { n as declareRuntimeCapability } from "../runtimeCapabilities-ClWr60El.mjs";
3
- import { t as hasEvents } from "../typeGuards-DNlpASzd.mjs";
4
- import { n as evictToSize, r as touch, t as assertCapacity } from "../boundedMap-o2KZDCWy.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { n as evictToSize, r as touch, t as assertCapacity } from "../boundedMap-C51EUUOm.mjs";
3
+ import { n as declareRuntimeCapability } from "../runtimeCapabilities-BQK-GrYe.mjs";
4
+ import { t as hasEvents } from "../typeGuards-_6nNQqgq.mjs";
5
5
  import fp from "fastify-plugin";
6
6
  // src/plugins/response-cache.ts
7
7
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
2
  import { createRequire } from "node:module";
3
3
  import fp from "fastify-plugin";
4
4
  // 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.48.0";
62
+ const resolvedVersion = serviceVersion ?? "2.49.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.48.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
2
  // 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-DnkIALZ8.mjs";
3
3
  import { l as PermissionCheck } from "../base-HXNgPQww.mjs";
4
- import { W as PresetResult } from "../index-Cy2-QffW.mjs";
4
+ import { W as PresetResult } from "../index-DLCcLUQT.mjs";
5
5
  import { a as StorageReadResult, i as StorageReadRange, n as StorageContext, o as StorageUploadInput, r as StorageFile, t as Storage } from "../storage-odC5MNKN.mjs";
6
6
  export interface FilesUploadPresetRoutes {
7
7
  upload?: boolean;
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { i as NotFoundError, u as ValidationError } from "../errors-DyY48oRi.mjs";
3
- import { c as getOrgId, g as getUserId } from "../types-HFFSwF_K.mjs";
4
- import { B as requireAuth, F as allowPublic } from "../permissions-R9T2G1PH.mjs";
5
- import { t as multipartBody } from "../multipartBody-BNgNv7r0.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { t as multipartBody } from "../multipartBody-BdG1qbn1.mjs";
3
+ import { B as requireAuth, F as allowPublic } from "../permissions-CFsmdYUt.mjs";
4
+ import { c as getOrgId, g as getUserId } from "../types-CrOlZ4rY.mjs";
5
+ import { i as NotFoundError, u as ValidationError } from "../errors-BpYV859Y.mjs";
6
6
  // src/presets/filesUpload.ts
7
7
  const DEFAULT_FIELD_NAME = "file";
8
8
  const DEFAULT_MAX_FILE_SIZE = 10485760;
@@ -1,8 +1,8 @@
1
1
 
2
2
  import { t as AnyRecord } from "../base-HXNgPQww.mjs";
3
- import { Hn as IRequestContext, L as ResourceConfig, Vn as IControllerResponse, W as PresetResult, i as PaginationResult } from "../index-Cy2-QffW.mjs";
3
+ import { L as ResourceConfig, Un as IControllerResponse, W as PresetResult, Wn as IRequestContext, i as PaginationResult } from "../index-DLCcLUQT.mjs";
4
4
  import { FilesUploadPresetOptions, FilesUploadPresetPermissions, FilesUploadPresetRoutes, filesUploadPreset } from "./filesUpload.mjs";
5
- import { n as multiTenantPreset, r as TenantFieldSpec, t as MultiTenantOptions } from "../multiTenant-KZj8j1uJ.mjs";
5
+ import { n as multiTenantPreset, r as TenantFieldSpec, t as MultiTenantOptions } from "../multiTenant-QtDzxx_K.mjs";
6
6
  import { SearchHandler, SearchPresetOptions, SearchRouteConfig, searchPreset } from "./search.mjs";
7
7
  interface AuditedPresetOptions {
8
8
  /** Field name for creator (default: 'createdBy') */
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.48.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-CNDvNYsz.mjs";
1
+ /*! @classytic/arc v2.49.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-CUd3L7v6.mjs";
3
3
  import { filesUploadPreset } from "./filesUpload.mjs";
4
4
  import { multiTenantPreset } from "./multiTenant.mjs";
5
5
  import { searchPreset } from "./search.mjs";
@@ -1,3 +1,3 @@
1
1
 
2
- import { n as multiTenantPreset, r as TenantFieldSpec, t as MultiTenantOptions } from "../multiTenant-KZj8j1uJ.mjs";
2
+ import { n as multiTenantPreset, r as TenantFieldSpec, t as MultiTenantOptions } from "../multiTenant-QtDzxx_K.mjs";
3
3
  export { MultiTenantOptions, type TenantFieldSpec, multiTenantPreset };
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import "../constants-D-faL5SX.mjs";
3
- import { t as ArcError } from "../errors-DyY48oRi.mjs";
4
- import { u as getRequestScope } from "../types-HFFSwF_K.mjs";
5
- import { i as tagTenantPreparation, t as applyTenantPreparation } from "../tenantPreparation-oqKCZQZM.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import "../constants-DOnfMd7i.mjs";
3
+ import { i as tagTenantPreparation, t as applyTenantPreparation } from "../tenantPreparation-DSlQI53c.mjs";
4
+ import { u as getRequestScope } from "../types-CrOlZ4rY.mjs";
5
+ import { t as ArcError } from "../errors-BpYV859Y.mjs";
6
6
  // src/presets/multiTenant.ts
7
7
  function createTenantMiddleware(specs, mode) {
8
8
  const preparation = {
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { l as PermissionCheck } from "../base-HXNgPQww.mjs";
3
- import { Dt as RouteMcpConfig, Et as RouteDefinition, Ln as ControllerHandler, W as PresetResult } from "../index-Cy2-QffW.mjs";
3
+ import { Ot as RouteDefinition, W as PresetResult, kt as RouteMcpConfig, zn as ControllerHandler } from "../index-DLCcLUQT.mjs";
4
4
  /**
5
5
  * Search Preset — backend-agnostic search / vector / embed routes
6
6
  *
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { B as requireAuth, F as allowPublic } from "../permissions-R9T2G1PH.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { B as requireAuth, F as allowPublic } from "../permissions-CFsmdYUt.mjs";
3
3
  // src/presets/search.ts
4
4
  const BUILTINS = [
5
5
  {
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { l as UnauthorizedError } from "./errors-DyY48oRi.mjs";
3
- import { b as isElevated, n as PUBLIC_SCOPE } from "./types-HFFSwF_K.mjs";
4
- import { B as requireAuth, F as allowPublic, U as requireRoles } from "./permissions-R9T2G1PH.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { B as requireAuth, F as allowPublic, U as requireRoles } from "./permissions-CFsmdYUt.mjs";
5
3
  import { multiTenantPreset } from "./presets/multiTenant.mjs";
4
+ import { b as isElevated, n as PUBLIC_SCOPE } from "./types-CrOlZ4rY.mjs";
5
+ import { l as UnauthorizedError } from "./errors-BpYV859Y.mjs";
6
6
  // src/presets/audited.ts
7
7
  /**
8
8
  * Audited preset - adds createdBy/updatedBy tracking
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { c as getOrgId, f as getScopeContextMap, g as getUserId, m as getTeamId, x as isMember } from "./types-HFFSwF_K.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { c as getOrgId, f as getScopeContextMap, g as getUserId, m as getTeamId, x as isMember } from "./types-CrOlZ4rY.mjs";
3
3
  // src/scope/projection.ts
4
4
  /**
5
5
  * Compute the request-scope projection. Returns `undefined` when no
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
2
  // src/http-cache/purgers/purger.types.ts
3
3
  /** A purge the CDN refused or never answered: a closed code plus the provider's own codes, never a credential. */
4
4
  var CachePurgeError = class extends Error {
@@ -1,9 +1,9 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-BdTN42uL.mjs";
3
- import { i as versionKey, r as tagVersionKey } from "./keys-CrMOZuk6.mjs";
4
- import { n as declareRuntimeCapability } from "./runtimeCapabilities-ClWr60El.mjs";
5
- import { t as hasEvents } from "./typeGuards-DNlpASzd.mjs";
6
- import { t as MemoryCacheStore } from "./memory-Lpfu8Hga.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-gKJR3o-6.mjs";
3
+ import { n as declareRuntimeCapability } from "./runtimeCapabilities-BQK-GrYe.mjs";
4
+ import { t as hasEvents } from "./typeGuards-_6nNQqgq.mjs";
5
+ import { t as MemoryCacheStore } from "./memory-C47xVsjX.mjs";
6
+ import { i as versionKey, r as tagVersionKey } from "./keys--l9n7aOC.mjs";
7
7
  import fp from "fastify-plugin";
8
8
  // src/cache/QueryCache.ts
9
9
  const MISS = Object.freeze({
@@ -12,15 +12,31 @@ const MISS = Object.freeze({
12
12
  });
13
13
  var QueryCache = class {
14
14
  store;
15
- constructor(store) {
15
+ onStoreError;
16
+ /** Entry deletes the store refused: read as a miss here until replayed. */
17
+ pendingDeletes = /* @__PURE__ */ new Set();
18
+ /** Version keys whose bump the store refused: bumped once each when it answers again. */
19
+ pendingBumps = /* @__PURE__ */ new Set();
20
+ failing = false;
21
+ flushing;
22
+ constructor(store, options = {}) {
16
23
  this.store = store;
24
+ this.onStoreError = options.onStoreError;
17
25
  }
18
26
  async get(key) {
19
- const envelope = await this.store.get(key);
27
+ if (!await this.recovered() || this.pendingDeletes.has(key)) return MISS;
28
+ let envelope;
29
+ try {
30
+ envelope = await this.store.get(key);
31
+ this.ok();
32
+ } catch (err) {
33
+ this.failed(err, "get");
34
+ return MISS;
35
+ }
20
36
  if (!envelope?.createdAt) return MISS;
21
37
  const now = Date.now();
22
38
  if (now >= envelope.expiresAt) {
23
- await this.store.delete(key);
39
+ await this.invalidate(key);
24
40
  return MISS;
25
41
  }
26
42
  if (now < envelope.staleAfter) return {
@@ -45,14 +61,27 @@ var QueryCache = class {
45
61
  expiresAt: now + totalTtlSec * 1e3,
46
62
  tags: config.tags ?? []
47
63
  };
48
- await this.store.set(key, envelope, totalTtlSec);
64
+ try {
65
+ await this.store.set(key, envelope, totalTtlSec);
66
+ this.pendingDeletes.delete(key);
67
+ this.ok();
68
+ } catch (err) {
69
+ this.failed(err, "set");
70
+ }
49
71
  }
50
72
  async invalidate(key) {
51
- await this.store.delete(key);
73
+ try {
74
+ await this.store.delete(key);
75
+ this.pendingDeletes.delete(key);
76
+ this.ok();
77
+ } catch (err) {
78
+ this.pendingDeletes.add(key);
79
+ this.failed(err, "invalidate");
80
+ }
52
81
  }
53
82
  /** Get current version for a resource (defaults to 0 if not set) */
54
83
  async getResourceVersion(resource) {
55
- return await this.store.get(versionKey(resource)) ?? 0;
84
+ return this.readVersion(versionKey(resource));
56
85
  }
57
86
  /** Bump resource version — orphans all cached queries for this resource */
58
87
  async bumpResourceVersion(resource) {
@@ -60,12 +89,32 @@ var QueryCache = class {
60
89
  }
61
90
  /** Get current version for a tag */
62
91
  async getTagVersion(tag) {
63
- return await this.store.get(tagVersionKey(tag)) ?? 0;
92
+ return this.readVersion(tagVersionKey(tag));
64
93
  }
65
94
  /** Bump tag version — orphans all cached queries tagged with this tag */
66
95
  async bumpTagVersion(tag) {
67
96
  await this.bumpVersion(tagVersionKey(tag));
68
97
  }
98
+ /** The store is failing, or holds invalidations it refused: reads go to the source. */
99
+ get degraded() {
100
+ return this.failing || this.pendingDeletes.size > 0 || this.pendingBumps.size > 0;
101
+ }
102
+ /**
103
+ * A version the store cannot give is 0: entries are not read while it fails either, and
104
+ * a version bump it refused is replayed before any version is read again (`recovered`),
105
+ * so an entry cached before the outage is never served past an invalidation.
106
+ */
107
+ async readVersion(key) {
108
+ if (!await this.recovered()) return 0;
109
+ try {
110
+ const ver = await this.store.get(key);
111
+ this.ok();
112
+ return ver ?? 0;
113
+ } catch (err) {
114
+ this.failed(err, "version");
115
+ return 0;
116
+ }
117
+ }
69
118
  /**
70
119
  * Version-bump semantics:
71
120
  *
@@ -87,8 +136,20 @@ var QueryCache = class {
87
136
  * outlive that reset and entry TTLs are minutes-scale (staleTime +
88
137
  * gcTime). The read-modify-write fallback uses plain `set`, which
89
138
  * refreshes the TTL per bump — strictly longer-lived, equally safe.
139
+ *
140
+ * A bump the store refuses is remembered and replayed once it answers.
90
141
  */
91
142
  async bumpVersion(key) {
143
+ try {
144
+ await this.rawBump(key);
145
+ this.pendingBumps.delete(key);
146
+ this.ok();
147
+ } catch (err) {
148
+ this.pendingBumps.add(key);
149
+ this.failed(err, "bump");
150
+ }
151
+ }
152
+ async rawBump(key) {
92
153
  if (typeof this.store.increment === "function") {
93
154
  await this.store.increment(key, 1, VERSION_TTL_SECONDS);
94
155
  return;
@@ -97,6 +158,42 @@ var QueryCache = class {
97
158
  const next = Math.max(Date.now(), (current ?? 0) + 1);
98
159
  await this.store.set(key, next, VERSION_TTL_SECONDS);
99
160
  }
161
+ /**
162
+ * Replay refused invalidations before a read; `false` while the store still refuses a
163
+ * version bump (the caller then answers from the source). One replay at a time.
164
+ */
165
+ async recovered() {
166
+ if (this.pendingBumps.size === 0 && this.pendingDeletes.size === 0) return true;
167
+ this.flushing ??= this.flush().finally(() => {
168
+ this.flushing = void 0;
169
+ });
170
+ await this.flushing;
171
+ return this.pendingBumps.size === 0;
172
+ }
173
+ async flush() {
174
+ try {
175
+ for (const key of [...this.pendingBumps]) {
176
+ await this.rawBump(key);
177
+ this.pendingBumps.delete(key);
178
+ }
179
+ for (const key of [...this.pendingDeletes]) {
180
+ await this.store.delete(key);
181
+ this.pendingDeletes.delete(key);
182
+ }
183
+ this.ok();
184
+ } catch (err) {
185
+ this.failed(err, "replay");
186
+ }
187
+ }
188
+ ok() {
189
+ this.failing = false;
190
+ }
191
+ failed(err, operation) {
192
+ if (!this.failing) try {
193
+ this.onStoreError?.(err, operation);
194
+ } catch {}
195
+ this.failing = true;
196
+ }
100
197
  };
101
198
  /** See `bumpVersion` — effectively non-expiring, refreshed on every bump. */
102
199
  const VERSION_TTL_SECONDS = 31536e3;
@@ -110,7 +207,10 @@ const CRUD_SUFFIXES = /* @__PURE__ */ new Set([
110
207
  const queryCachePluginImpl = async (fastify, opts = {}) => {
111
208
  const ownsStore = opts.store === void 0;
112
209
  const store = opts.store ?? new MemoryCacheStore();
113
- const queryCache = new QueryCache(store);
210
+ const queryCache = new QueryCache(store, { onStoreError: (err, operation) => fastify.log.warn({
211
+ err: err instanceof Error ? err.message : String(err),
212
+ operation
213
+ }, "[arc] query cache store unavailable: reading from the source until it answers again") });
114
214
  declareRuntimeCapability(fastify, {
115
215
  subsystem: "cache.query",
116
216
  durability: store instanceof MemoryCacheStore ? "memory" : "shared",
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { r as CacheStore } from "./interface-WR1U0K7t.mjs";
3
- import { i as QueryCache } from "./QueryCache-DdvrGG8Q.mjs";
3
+ import { i as QueryCache } from "./QueryCache-BE47tmlO.mjs";
4
4
  import { FastifyPluginAsync } from "fastify";
5
5
  interface QueryCachePluginOptions {
6
6
  /** CacheStore instance. Default: MemoryCacheStore with default options. */
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
2
  // src/scope/rateLimitKey.ts
3
3
  /**
4
4
  * Marks a key generator as SCOPE-AWARE, so `buildRateLimitOpts` can place the rate-limit
@@ -1,25 +1,17 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-BdTN42uL.mjs";
3
- import { t as arcLog } from "./logger-VyMcSmVG.mjs";
4
- import { t as simpleEqualityMatcher } from "./simpleEqualityMatcher-CaCS09fh.mjs";
5
- import { n as getUserRoles } from "./userHelpers-N-k-8dNF.mjs";
6
- import { n as isEventVisible, t as eventAudienceOf } from "./tenancy-BoWImS3K.mjs";
7
- import { t as applyFieldReadPermissions } from "./fields-rfsl26Ov.mjs";
8
- import { a as promoteStreamTokenToHeader } from "./streaming-CPChx3A7.mjs";
9
- import { n as evaluateAndApplyPermission } from "./authorizationDecision-BZSJcPNE.mjs";
10
- import { t as openSseStream } from "./sseStream-qSa-F2Qm.mjs";
11
- import { n as arcRouteValidatorCompiler } from "./routeValidator-DclDl5WJ.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-gKJR3o-6.mjs";
3
+ import { n as arcRouteValidatorCompiler } from "./routeValidator-xNYA4rr1.mjs";
4
+ import { n as isEventVisible, t as eventAudienceOf } from "./tenancy-_ukT0oBt.mjs";
5
+ import { t as arcLog } from "./logger-UbknHqHy.mjs";
6
+ import { n as evaluateAndApplyPermission } from "./authorizationDecision-DHO94aV2.mjs";
7
+ import { t as applyFieldReadPermissions } from "./fields-CT1Erg7o.mjs";
8
+ import { n as getUserRoles } from "./userHelpers-CBKx3XJN.mjs";
9
+ import { n as simpleEqualityMatcher, t as STREAM_FRAMES } from "./streamFrames-B3ZJfI02.mjs";
10
+ import { a as registerSseStats, r as openSseStream } from "./sseStream-BxQW7hPq.mjs";
11
+ import { a as promoteStreamTokenToHeader } from "./streaming-HZr63UiM.mjs";
12
12
  import fp from "fastify-plugin";
13
13
  // src/plugins/realtime.ts
14
- var realtime_exports = /* @__PURE__ */ __exportAll({
15
- DEFAULT_MAX_CONNECTION_MS: () => DEFAULT_MAX_CONNECTION_MS,
16
- buildChangeFrame: () => buildChangeFrame,
17
- connectionDeadlineMs: () => connectionDeadlineMs,
18
- default: () => realtime_default,
19
- realtimePlugin: () => realtimePlugin,
20
- resolveDelivery: () => resolveDelivery,
21
- resolveRowMatcher: () => resolveRowMatcher
22
- });
14
+ var realtime_exports = /* @__PURE__ */ __exportAll({ default: () => realtime_default });
23
15
  const log = arcLog("realtime");
24
16
  const CHANGE_OPERATIONS = [
25
17
  "created",
@@ -166,6 +158,10 @@ const realtimePlugin = async (fastify, opts = {}) => {
166
158
  }
167
159
  if (!path.includes(":resource")) throw new Error(`[arc-realtime] path must contain ':resource' (got '${path}')`);
168
160
  const activeConnections = /* @__PURE__ */ new Set();
161
+ registerSseStats(fastify, () => ({
162
+ connections: activeConnections.size,
163
+ keys: 0
164
+ }));
169
165
  const isProtected = (entry) => {
170
166
  const listCheck = entry.permissions?.list;
171
167
  return typeof listCheck === "function" && listCheck._isPublic !== true;
@@ -291,9 +287,10 @@ const realtimePlugin = async (fastify, opts = {}) => {
291
287
  stream.onCleanup(unsub);
292
288
  }
293
289
  }
294
- stream.write("ready", JSON.stringify({
290
+ stream.write(STREAM_FRAMES.READY, JSON.stringify({
295
291
  resources: subscriptions.map((s) => s.name),
296
- operations: [...operations]
292
+ operations: [...operations],
293
+ resumed: false
297
294
  }));
298
295
  };
299
296
  const lookupEntry = (name) => {
@@ -1,6 +1,6 @@
1
1
 
2
- import { F as ResourceDefinition, G as CrudRouteKey, M as ResourceRegistry, N as RouteRow, S as IntrospectionPluginOptions, V as ResolvedTenantPurge, j as RegisterOptions, o as RegistryEntry } from "../index-Cy2-QffW.mjs";
3
- import "../fastify-augmentation-bzkWPt1f.mjs";
2
+ import "../fastify-augmentation-baQc3MaO.mjs";
3
+ import { F as ResourceDefinition, G as CrudRouteKey, M as ResourceRegistry, N as RouteRow, S as IntrospectionPluginOptions, V as ResolvedTenantPurge, j as RegisterOptions, o as RegistryEntry } from "../index-DLCcLUQT.mjs";
4
4
  import { TenantPurgeProgress, TenantPurgeStrategy } from "@classytic/repo-core/repository";
5
5
  import { FastifyPluginAsync } from "fastify";
6
6
  interface AssertNoTenantDataOptions {
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { a as getCascadingResources, i as cascadeDeleteForOrganization, n as buildResourceManifestFromRegistry, o as getCascadingResourcesWithMetadata, r as introspectionPlugin_default, s as assertNoTenantData, t as buildResourceManifest } from "../registry-Dl0k6UXy.mjs";
3
- import { t as ResourceRegistry } from "../ResourceRegistry-BcvEJoZd.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { a as getCascadingResources, i as cascadeDeleteForOrganization, n as buildResourceManifestFromRegistry, o as getCascadingResourcesWithMetadata, r as introspectionPlugin_default, s as assertNoTenantData, t as buildResourceManifest } from "../registry-Biz-6sEZ.mjs";
3
+ import { t as ResourceRegistry } from "../ResourceRegistry-CP-iTcKy.mjs";
4
4
  export { ResourceRegistry, assertNoTenantData, buildResourceManifest, buildResourceManifestFromRegistry, cascadeDeleteForOrganization, getCascadingResources, getCascadingResourcesWithMetadata, introspectionPlugin_default as introspectionPlugin };
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { t as CRUD_OPERATIONS } from "./constants-D-faL5SX.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { t as CRUD_OPERATIONS } from "./constants-DOnfMd7i.mjs";
3
3
  import fp from "fastify-plugin";
4
4
  // src/registry/assertNoTenantData.ts
5
5
  /**