@classytic/arc 2.35.0 → 2.37.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 (171) hide show
  1. package/dist/{BaseController-C-pofd0v.mjs → BaseController-B5GZfUBy.mjs} +11 -11
  2. package/dist/{EventTransport-BrPeGUil.mjs → EventTransport-pGNNDQ__.mjs} +1 -1
  3. package/dist/{HookSystem-LlPm3Anm.mjs → HookSystem-CuhHvcyZ.mjs} +2 -2
  4. package/dist/{ResourceRegistry-yuD1Ra53.mjs → ResourceRegistry-DFOmazXg.mjs} +2 -2
  5. package/dist/{actionPermissions-LFuOra7W.mjs → actionPermissions-CQQrR4tu.mjs} +6 -6
  6. package/dist/audit/index.d.mts +2 -2
  7. package/dist/audit/index.mjs +2 -2
  8. package/dist/auth/audit.mjs +1 -1
  9. package/dist/auth/index.d.mts +2 -2
  10. package/dist/auth/index.mjs +6 -6
  11. package/dist/auth/redis-session.mjs +1 -1
  12. package/dist/{authorizationDecision-DYXBBgtg.mjs → authorizationDecision-DgyWdav8.mjs} +2 -2
  13. package/dist/{base-GZU3LlzP.d.mts → base-C-NL2fTi.d.mts} +15 -0
  14. package/dist/{buildHandler-Do9aMIvL.mjs → buildHandler-D2DkqtiY.mjs} +4 -4
  15. package/dist/cache/index.mjs +4 -4
  16. package/dist/{caching-cN5X9VEL.mjs → caching-BmC2T-pX.mjs} +2 -2
  17. package/dist/cleanup/index.d.mts +2 -2
  18. package/dist/cleanup/index.mjs +4 -4
  19. package/dist/cli/commands/describe.d.mts +1 -1
  20. package/dist/cli/commands/describe.mjs +3 -3
  21. package/dist/cli/commands/docs.mjs +3 -3
  22. package/dist/cli/commands/doctor.mjs +1 -1
  23. package/dist/cli/commands/generate.mjs +2 -2
  24. package/dist/cli/commands/init.mjs +2 -2
  25. package/dist/cli/commands/introspect.mjs +2 -2
  26. package/dist/cli/index.mjs +3 -3
  27. package/dist/{constants-BhzLXCfN.mjs → constants-CUpamQMJ.mjs} +1 -1
  28. package/dist/context/index.mjs +3 -3
  29. package/dist/core/index.d.mts +2 -2
  30. package/dist/core/index.mjs +7 -7
  31. package/dist/{core-DdEvmmkY.mjs → core-C8GWw-Iu.mjs} +3 -3
  32. package/dist/{createActionRouter-EYWgd0ly.mjs → createActionRouter-CwDU_j2S.mjs} +7 -7
  33. package/dist/{createAggregationRouter-ByOK9Iev.mjs → createAggregationRouter-d057xXX1.mjs} +7 -7
  34. package/dist/{defineAggregation-DoIijIFq.mjs → defineAggregation-cCitY2FA.mjs} +1 -1
  35. package/dist/{defineResource-BOrGeocE.mjs → defineResource-WcbE1kJL.mjs} +18 -18
  36. package/dist/discovery/index.mjs +1 -1
  37. package/dist/docs/index.d.mts +1 -1
  38. package/dist/docs/index.mjs +3 -3
  39. package/dist/{elevation-tGIAldco.mjs → elevation-Bc6Gafv9.mjs} +4 -4
  40. package/dist/encryption/index.mjs +3 -3
  41. package/dist/{errorHandler-BbQ1nQdk.mjs → errorHandler-CB75oY5i.mjs} +3 -3
  42. package/dist/{errors-CLid6atr.mjs → errors-DsdZc1Xv.mjs} +1 -1
  43. package/dist/{eventPlugin-ClPn5kjn.mjs → eventPlugin-DEIfV1iC.mjs} +5 -5
  44. package/dist/events/index.d.mts +1 -1
  45. package/dist/events/index.mjs +5 -5
  46. package/dist/events/transports/redis-stream-entry.mjs +1 -1
  47. package/dist/events/transports/redis.mjs +1 -1
  48. package/dist/factory/index.d.mts +4 -4
  49. package/dist/factory/index.mjs +5 -5
  50. package/dist/{fastify-augmentation-CMMTL3cj.d.mts → fastify-augmentation-CdY8FINU.d.mts} +3 -3
  51. package/dist/{fields-UtpiJO5R.mjs → fields-DvGz47Ul.mjs} +1 -1
  52. package/dist/{generate-BoAVy3_b.mjs → generate-D7CIIWhS.mjs} +2 -2
  53. package/dist/{headers-DODWf7aC.mjs → headers-BFu1st_i.mjs} +2 -2
  54. package/dist/{health-_Zs3R_Sb.mjs → health-Cc_sb94d.mjs} +1 -1
  55. package/dist/hooks/index.d.mts +1 -1
  56. package/dist/hooks/index.mjs +2 -2
  57. package/dist/idempotency/index.mjs +4 -4
  58. package/dist/idempotency/redis.mjs +1 -1
  59. package/dist/{index-K7auNNW0.d.mts → index-BtYoMip1.d.mts} +20 -2
  60. package/dist/{index-C5K78SXo.d.mts → index-C01wWGJt.d.mts} +1 -1
  61. package/dist/{index-C50BUxKs.d.mts → index-DCxxRwLC.d.mts} +1 -1
  62. package/dist/{index-h-mTgMqy.d.mts → index-du18bJjH.d.mts} +3 -3
  63. package/dist/{index-CJCcbADG.d.mts → index-eyg5WEcy.d.mts} +1 -1
  64. package/dist/index.d.mts +5 -5
  65. package/dist/index.mjs +11 -11
  66. package/dist/{init-Ce4R0ZGK.mjs → init-BMgU1wYR.mjs} +1 -1
  67. package/dist/integrations/event-gateway.mjs +2 -2
  68. package/dist/integrations/index.d.mts +2 -2
  69. package/dist/integrations/index.mjs +1 -1
  70. package/dist/integrations/jobs/index.d.mts +1 -1
  71. package/dist/integrations/jobs/index.mjs +2 -2
  72. package/dist/integrations/mcp/index.d.mts +3 -3
  73. package/dist/integrations/mcp/index.mjs +2 -2
  74. package/dist/integrations/mcp/testing.d.mts +1 -1
  75. package/dist/integrations/mcp/testing.mjs +2 -2
  76. package/dist/integrations/streamline.mjs +3 -3
  77. package/dist/integrations/webhooks.d.mts +4 -2
  78. package/dist/integrations/webhooks.mjs +20 -6
  79. package/dist/integrations/websocket-pushref-redis.mjs +1 -1
  80. package/dist/integrations/websocket-redis.mjs +1 -1
  81. package/dist/integrations/websocket.mjs +1 -1
  82. package/dist/{interface-my7sxjw5.mjs → interface-CaPVHoVJ.mjs} +1 -1
  83. package/dist/{jsonBody-CVKA7C5m.mjs → jsonBody-BuzxOZV8.mjs} +2 -2
  84. package/dist/{keys-GlU7XpmG.mjs → keys-DoUI9-yP.mjs} +1 -1
  85. package/dist/{loadResources-DdQb0qgV.mjs → loadResources-CPlRWJCv.mjs} +2 -2
  86. package/dist/{loadResourcesFromEntry-s6aGs6-0.mjs → loadResourcesFromEntry-CPCZiX9n.mjs} +2 -2
  87. package/dist/logger/index.mjs +1 -1
  88. package/dist/{mcpPlugin-DkzZ7Nfx.mjs → mcpPlugin-dxMxBPIg.mjs} +15 -15
  89. package/dist/{memory-BwedEXau.mjs → memory-BnafVem_.mjs} +2 -2
  90. package/dist/{metrics-5LNPvL3P.mjs → metrics-CeAIcVMY.mjs} +2 -2
  91. package/dist/middleware/index.d.mts +1 -1
  92. package/dist/middleware/index.mjs +3 -3
  93. package/dist/migrations/index.mjs +2 -2
  94. package/dist/{module-Bh5OC7ww.mjs → module-DIvG8qOg.mjs} +1 -1
  95. package/dist/{multipartBody-DjilSDAT.mjs → multipartBody-BVCoaTwu.mjs} +1 -1
  96. package/dist/{openapi-ItLH12_L.mjs → openapi-D_i6CifU.mjs} +6 -6
  97. package/dist/outbox-admin/index.d.mts +2 -2
  98. package/dist/outbox-admin/index.mjs +4 -4
  99. package/dist/{outbox-module-b1TyDGGi.d.mts → outbox-module-BbdaMyqy.d.mts} +1 -1
  100. package/dist/{outbox-module-SGIZz6oS.mjs → outbox-module-CKaLL5BH.mjs} +4 -4
  101. package/dist/permissions/index.d.mts +2 -2
  102. package/dist/permissions/index.mjs +5 -5
  103. package/dist/{permissions-CpSBlFXZ.mjs → permissions-DWkl60hx.mjs} +36 -9
  104. package/dist/{pipe-DNOuCfAs.mjs → pipe-Dbs3GhOZ.mjs} +2 -2
  105. package/dist/pipeline/index.d.mts +1 -1
  106. package/dist/pipeline/index.mjs +2 -2
  107. package/dist/plugins/index.d.mts +4 -4
  108. package/dist/plugins/index.mjs +16 -16
  109. package/dist/plugins/response-cache.mjs +2 -2
  110. package/dist/plugins/tracing-entry.mjs +2 -2
  111. package/dist/{pluralize-DGAQQKL8.mjs → pluralize-DgaYX91M.mjs} +1 -1
  112. package/dist/{preloadResources-DYMzmUk1.mjs → preloadResources-BUoGKPaS.mjs} +79 -24
  113. package/dist/{preloadResources--ZtY9pe9.d.mts → preloadResources-BYFfYnjZ.d.mts} +3 -3
  114. package/dist/presets/filesUpload.d.mts +2 -2
  115. package/dist/presets/filesUpload.mjs +5 -5
  116. package/dist/presets/index.d.mts +2 -2
  117. package/dist/presets/index.mjs +2 -2
  118. package/dist/presets/multiTenant.d.mts +1 -1
  119. package/dist/presets/multiTenant.mjs +3 -3
  120. package/dist/presets/search.d.mts +2 -2
  121. package/dist/presets/search.mjs +2 -2
  122. package/dist/{presets-Bi0Z6Iq8.mjs → presets-Gbv9mNKD.mjs} +4 -4
  123. package/dist/{projection-aevMua7Q.mjs → projection-BunxoeON.mjs} +2 -2
  124. package/dist/{queryCachePlugin-BI7Z88Cx.mjs → queryCachePlugin-BYqmg89O.mjs} +5 -5
  125. package/dist/{rateLimitKey-pyevMUVf.mjs → rateLimitKey-DlqmDHA5.mjs} +1 -1
  126. package/dist/{realtime-Cfl2bVjj.mjs → realtime-CiAp2-LH.mjs} +9 -9
  127. package/dist/{registerRoute-u1opU66a.mjs → registerRoute-dnf-JJf-.mjs} +5 -5
  128. package/dist/registry/index.d.mts +2 -2
  129. package/dist/registry/index.mjs +3 -3
  130. package/dist/{registry-B4sf9Rfm.mjs → registry-ByC0UFNS.mjs} +2 -2
  131. package/dist/{renewingLease-5ESPMxp0.mjs → renewingLease-C5Ta_ImD.mjs} +1 -1
  132. package/dist/{replyHelpers-2jfmMnnV.mjs → replyHelpers-D1k0wHoO.mjs} +2 -2
  133. package/dist/{requestContext-DzOUGNdY.mjs → requestContext-DGM7EZRI.mjs} +1 -1
  134. package/dist/{rolldown-runtime-CEvvVXTC.mjs → rolldown-runtime-DrZrabOW.mjs} +1 -1
  135. package/dist/{runtimeCapabilities-BagWc3TI.mjs → runtimeCapabilities-c4Sc85X-.mjs} +1 -1
  136. package/dist/{schedules-BLpZLWGF.mjs → schedules-CVtolEa-.mjs} +31 -5
  137. package/dist/{schemaConverter-D2_bHGil.mjs → schemaConverter-C8zbW7tJ.mjs} +1 -1
  138. package/dist/{schemaIR-s3-ouZmP.mjs → schemaIR-BfI425RH.mjs} +2 -2
  139. package/dist/schemas/index.mjs +1 -1
  140. package/dist/scim/index.mjs +2 -2
  141. package/dist/scope/index.mjs +5 -5
  142. package/dist/{scope-DgepeCv6.mjs → scope-DFSOKc4T.mjs} +4 -4
  143. package/dist/{simpleEqualityMatcher-BO-sFTQf.mjs → simpleEqualityMatcher-Bhp7WrRF.mjs} +1 -1
  144. package/dist/{sse-DUIP1XH6.mjs → sse-vRuwDd6N.mjs} +5 -5
  145. package/dist/{sseStream-ByFGyIVr.mjs → sseStream-cWezGOk1.mjs} +2 -2
  146. package/dist/{store-helpers-kIJCY0wI.mjs → store-helpers-bU8H5c-A.mjs} +1 -1
  147. package/dist/{streaming-DOpZVht6.mjs → streaming-weWcFCk4.mjs} +1 -1
  148. package/dist/{subscribe-helpers-Dh2BnzJf.mjs → subscribe-helpers-BrcG3NlV.mjs} +11 -5
  149. package/dist/sync/changelog.mjs +1 -1
  150. package/dist/testing/cleanupStoreContract.mjs +1 -1
  151. package/dist/testing/index.d.mts +5 -5
  152. package/dist/testing/index.mjs +10 -10
  153. package/dist/testing/outboxStoreContract.mjs +1 -1
  154. package/dist/testing/storageContract.mjs +1 -1
  155. package/dist/{transactionContext-BTZzEcRo.mjs → transactionContext-Ca5peQpc.mjs} +1 -1
  156. package/dist/{typeGuards-B-_jqaMi.mjs → typeGuards-ALWme5WB.mjs} +1 -1
  157. package/dist/types/index.d.mts +2 -2
  158. package/dist/types/index.mjs +1 -1
  159. package/dist/types/storage.mjs +1 -1
  160. package/dist/{types-DDD5RKTu.d.mts → types-BMa2EPtv.d.mts} +9 -0
  161. package/dist/{types-DSvHH0uR.d.mts → types-BXnTOsXP.d.mts} +1 -1
  162. package/dist/{types-GY4kATJb.mjs → types-lDs9oF4z.mjs} +4 -4
  163. package/dist/usage/index.d.mts +1 -1
  164. package/dist/usage/index.mjs +0 -0
  165. package/dist/{userHelpers-AKcB4V03.mjs → userHelpers-DU_Z5OBA.mjs} +1 -1
  166. package/dist/utils/index.d.mts +2 -2
  167. package/dist/utils/index.mjs +11 -11
  168. package/dist/{utils-CBK9HQOI.mjs → utils-sXGFLegw.mjs} +3 -3
  169. package/dist/{validate-dosAIvQU.mjs → validate-qK_-7MVk.mjs} +2 -2
  170. package/dist/{versioning-BbTs4pwM.mjs → versioning-Dtw0MyX4.mjs} +3 -3
  171. package/package.json +5 -2
@@ -1,13 +1,13 @@
1
1
 
2
- import { It as Authenticator } from "./index-C5K78SXo.mjs";
2
+ import { It as Authenticator } from "./index-C01wWGJt.mjs";
3
3
  import { r as CacheStore } from "./interface-BOk3YnTz.mjs";
4
4
  import { n as ElevationOptions } from "./elevation-BXCfVcNG.mjs";
5
5
  import { a as EventTransport } from "./EventTransport-BEVP50ka.mjs";
6
6
  import { t as ExternalOpenApiPaths } from "./externalPaths-CmGOxOtD.mjs";
7
7
  import { r as QueryCachePluginOptions } from "./queryCachePlugin-BzqxconG.mjs";
8
8
  import { t as ErrorHandlerOptions } from "./errorHandler-DI5AN2b5.mjs";
9
- import { l as ResourceLike, m as SchedulesPluginOptions, n as ArcModuleInput, v as HealthOptions } from "./types-DDD5RKTu.mjs";
10
- import "./index-C50BUxKs.mjs";
9
+ import { l as ResourceLike, m as SchedulesPluginOptions, n as ArcModuleInput, v as HealthOptions } from "./types-BMa2EPtv.mjs";
10
+ import "./index-DCxxRwLC.mjs";
11
11
  import { t as EventPluginOptions } from "./eventPlugin-B47sfCJ8.mjs";
12
12
  import { g as CachingOptions, o as MetricsOptions, p as SSEOptions, t as VersioningOptions, u as RealtimeOptions } from "./versioning-DEs-_hFi.mjs";
13
13
  import { r as IdempotencyStore } from "./interface-DEWNOMza.mjs";
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { i as RequestScope } from "../types-Ddl9OjmE.mjs";
3
- import { l as PermissionCheck } from "../base-GZU3LlzP.mjs";
4
- import { Y as PresetResult } from "../index-C5K78SXo.mjs";
3
+ import { l as PermissionCheck } from "../base-C-NL2fTi.mjs";
4
+ import { Y as PresetResult } from "../index-C01wWGJt.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.35.0 | MIT | https://classytic.com */
2
- import { i as NotFoundError, u as ValidationError } from "../errors-CLid6atr.mjs";
3
- import { c as getOrgId, g as getUserId } from "../types-GY4kATJb.mjs";
4
- import { B as requireAuth, F as allowPublic } from "../permissions-CpSBlFXZ.mjs";
5
- import { t as multipartBody } from "../multipartBody-DjilSDAT.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import { i as NotFoundError, u as ValidationError } from "../errors-DsdZc1Xv.mjs";
3
+ import { c as getOrgId, g as getUserId } from "../types-lDs9oF4z.mjs";
4
+ import { B as requireAuth, F as allowPublic } from "../permissions-DWkl60hx.mjs";
5
+ import { t as multipartBody } from "../multipartBody-BVCoaTwu.mjs";
6
6
  //#region src/presets/filesUpload.ts
7
7
  const DEFAULT_FIELD_NAME = "file";
8
8
  const DEFAULT_MAX_FILE_SIZE = 10485760;
@@ -1,6 +1,6 @@
1
1
 
2
- import { t as AnyRecord } from "../base-GZU3LlzP.mjs";
3
- import { Fn as IControllerResponse, In as IRequestContext, U as ResourceConfig, Y as PresetResult, d as PaginationResult } from "../index-C5K78SXo.mjs";
2
+ import { t as AnyRecord } from "../base-C-NL2fTi.mjs";
3
+ import { Fn as IControllerResponse, In as IRequestContext, U as ResourceConfig, Y as PresetResult, d as PaginationResult } from "../index-C01wWGJt.mjs";
4
4
  import { FilesUploadPresetOptions, FilesUploadPresetPermissions, FilesUploadPresetRoutes, filesUploadPreset } from "./filesUpload.mjs";
5
5
  import { MultiTenantOptions, TenantFieldSpec, multiTenantPreset } from "./multiTenant.mjs";
6
6
  import { SearchHandler, SearchPresetOptions, SearchRouteConfig, searchPreset } from "./search.mjs";
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
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-Bi0Z6Iq8.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-Gbv9mNKD.mjs";
4
4
  import { filesUploadPreset } from "./filesUpload.mjs";
5
5
  import { searchPreset } from "./search.mjs";
6
6
  export { applyPresets, auditedPreset, bulkPreset, filesUploadPreset, flexibleMultiTenantPreset, getAvailablePresets, getPreset, multiTenantPreset, ownedByUserPreset, registerPreset, searchPreset, slugLookupPreset, softDeletePreset, treePreset };
@@ -1,5 +1,5 @@
1
1
 
2
- import { X as CrudRouteKey, Y as PresetResult } from "../index-C5K78SXo.mjs";
2
+ import { X as CrudRouteKey, Y as PresetResult } from "../index-C01wWGJt.mjs";
3
3
  //#region src/presets/multiTenant.d.ts
4
4
  /**
5
5
  * One tenant dimension for multi-field filtering. Discriminated by source:
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
- import "../constants-BhzLXCfN.mjs";
3
- import { b as isElevated, c as getOrgId, d as getScopeContext, m as getTeamId, u as getRequestScope, v as hasOrgAccess } from "../types-GY4kATJb.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import "../constants-CUpamQMJ.mjs";
3
+ import { b as isElevated, c as getOrgId, d as getScopeContext, m as getTeamId, u as getRequestScope, v as hasOrgAccess } from "../types-lDs9oF4z.mjs";
4
4
  //#region src/presets/multiTenant.ts
5
5
  /**
6
6
  * Resolve a single TenantFieldSpec against the current scope.
@@ -1,6 +1,6 @@
1
1
 
2
- import { l as PermissionCheck } from "../base-GZU3LlzP.mjs";
3
- import { At as RouteDefinition, Y as PresetResult, jn as ControllerHandler, jt as RouteMcpConfig } from "../index-C5K78SXo.mjs";
2
+ import { l as PermissionCheck } from "../base-C-NL2fTi.mjs";
3
+ import { At as RouteDefinition, Y as PresetResult, jn as ControllerHandler, jt as RouteMcpConfig } from "../index-C01wWGJt.mjs";
4
4
  //#region src/presets/search.d.ts
5
5
  /**
6
6
  * Search Preset — backend-agnostic search / vector / embed routes
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
- import { B as requireAuth, F as allowPublic } from "../permissions-CpSBlFXZ.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import { B as requireAuth, F as allowPublic } from "../permissions-DWkl60hx.mjs";
3
3
  //#region src/presets/search.ts
4
4
  const BUILTINS = [
5
5
  {
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
- import { l as UnauthorizedError } from "./errors-CLid6atr.mjs";
3
- import { b as isElevated, n as PUBLIC_SCOPE } from "./types-GY4kATJb.mjs";
4
- import { B as requireAuth, F as allowPublic, U as requireRoles } from "./permissions-CpSBlFXZ.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import { l as UnauthorizedError } from "./errors-DsdZc1Xv.mjs";
3
+ import { b as isElevated, n as PUBLIC_SCOPE } from "./types-lDs9oF4z.mjs";
4
+ import { B as requireAuth, F as allowPublic, U as requireRoles } from "./permissions-DWkl60hx.mjs";
5
5
  import { multiTenantPreset } from "./presets/multiTenant.mjs";
6
6
  //#region src/presets/ownedByUser.ts
7
7
  /**
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
- import { c as getOrgId, f as getScopeContextMap, g as getUserId, m as getTeamId, x as isMember } from "./types-GY4kATJb.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import { c as getOrgId, f as getScopeContextMap, g as getUserId, m as getTeamId, x as isMember } from "./types-lDs9oF4z.mjs";
3
3
  //#region src/scope/projection.ts
4
4
  /**
5
5
  * Compute the request-scope projection. Returns `undefined` when no
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-CEvvVXTC.mjs";
3
- import { t as hasEvents } from "./typeGuards-B-_jqaMi.mjs";
4
- import { i as versionKey, r as tagVersionKey } from "./keys-GlU7XpmG.mjs";
5
- import { t as MemoryCacheStore } from "./memory-BwedEXau.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-DrZrabOW.mjs";
3
+ import { t as hasEvents } from "./typeGuards-ALWme5WB.mjs";
4
+ import { i as versionKey, r as tagVersionKey } from "./keys-DoUI9-yP.mjs";
5
+ import { t as MemoryCacheStore } from "./memory-BnafVem_.mjs";
6
6
  import fp from "fastify-plugin";
7
7
  //#region src/cache/QueryCache.ts
8
8
  var QueryCache = class {
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
2
  //#region src/scope/rateLimitKey.ts
3
3
  function createTenantKeyGenerator(opts) {
4
4
  if (opts?.strategy) return opts.strategy;
@@ -1,13 +1,13 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-CEvvVXTC.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-DrZrabOW.mjs";
3
3
  import { arcLog } from "./logger/index.mjs";
4
- import { n as evaluateAndApplyPermission } from "./authorizationDecision-DYXBBgtg.mjs";
5
- import { n as getUserRoles } from "./userHelpers-AKcB4V03.mjs";
6
- import { c as getOrgId } from "./types-GY4kATJb.mjs";
7
- import { t as simpleEqualityMatcher } from "./simpleEqualityMatcher-BO-sFTQf.mjs";
8
- import { t as applyFieldReadPermissions } from "./fields-UtpiJO5R.mjs";
9
- import { a as promoteStreamTokenToHeader } from "./streaming-DOpZVht6.mjs";
10
- import { t as openSseStream } from "./sseStream-ByFGyIVr.mjs";
4
+ import { n as evaluateAndApplyPermission } from "./authorizationDecision-DgyWdav8.mjs";
5
+ import { n as getUserRoles } from "./userHelpers-DU_Z5OBA.mjs";
6
+ import { c as getOrgId } from "./types-lDs9oF4z.mjs";
7
+ import { t as simpleEqualityMatcher } from "./simpleEqualityMatcher-Bhp7WrRF.mjs";
8
+ import { t as applyFieldReadPermissions } from "./fields-DvGz47Ul.mjs";
9
+ import { a as promoteStreamTokenToHeader } from "./streaming-weWcFCk4.mjs";
10
+ import { t as openSseStream } from "./sseStream-cWezGOk1.mjs";
11
11
  import fp from "fastify-plugin";
12
12
  //#region src/plugins/realtime.ts
13
13
  var realtime_exports = /* @__PURE__ */ __exportAll({
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
- import { n as evaluateAndApplyPermission } from "./authorizationDecision-DYXBBgtg.mjs";
3
- import { f as createError } from "./errors-CLid6atr.mjs";
4
- import { u as getRequestScope } from "./types-GY4kATJb.mjs";
5
- import { n as requestContext } from "./requestContext-DzOUGNdY.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import { n as evaluateAndApplyPermission } from "./authorizationDecision-DgyWdav8.mjs";
3
+ import { f as createError } from "./errors-DsdZc1Xv.mjs";
4
+ import { u as getRequestScope } from "./types-lDs9oF4z.mjs";
5
+ import { n as requestContext } from "./requestContext-DGM7EZRI.mjs";
6
6
  //#region src/core/middlewares/arcDecorator.ts
7
7
  /**
8
8
  * Build the `arcDecorator` preHandler for a resource.
@@ -1,6 +1,6 @@
1
1
 
2
- import { K as ResolvedTenantPurge, R as RegisterOptions, V as ResourceDefinition, X as CrudRouteKey, k as IntrospectionPluginOptions, p as RegistryEntry, z as ResourceRegistry } from "../index-C5K78SXo.mjs";
3
- import "../fastify-augmentation-CMMTL3cj.mjs";
2
+ import { K as ResolvedTenantPurge, R as RegisterOptions, V as ResourceDefinition, X as CrudRouteKey, k as IntrospectionPluginOptions, p as RegistryEntry, z as ResourceRegistry } from "../index-C01wWGJt.mjs";
3
+ import "../fastify-augmentation-CdY8FINU.mjs";
4
4
  import { TenantPurgeProgress, TenantPurgeStrategy } from "@classytic/repo-core/repository";
5
5
  import { FastifyPluginAsync } from "fastify";
6
6
  //#region src/registry/assertNoTenantData.d.ts
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
- import { a as cascadeDeleteForOrganization, c as assertNoTenantData, i as introspectionPlugin_default, n as buildResourceManifestFromRegistry, o as getCascadingResources, r as introspectionPlugin, s as getCascadingResourcesWithMetadata, t as buildResourceManifest } from "../registry-B4sf9Rfm.mjs";
3
- import { t as ResourceRegistry } from "../ResourceRegistry-yuD1Ra53.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import { a as cascadeDeleteForOrganization, c as assertNoTenantData, i as introspectionPlugin_default, n as buildResourceManifestFromRegistry, o as getCascadingResources, r as introspectionPlugin, s as getCascadingResourcesWithMetadata, t as buildResourceManifest } from "../registry-ByC0UFNS.mjs";
3
+ import { t as ResourceRegistry } from "../ResourceRegistry-DFOmazXg.mjs";
4
4
  export { ResourceRegistry, assertNoTenantData, buildResourceManifest, buildResourceManifestFromRegistry, cascadeDeleteForOrganization, getCascadingResources, getCascadingResourcesWithMetadata, introspectionPlugin_default as introspectionPlugin, introspectionPlugin as introspectionPluginFn };
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
- import { t as CRUD_OPERATIONS } from "./constants-BhzLXCfN.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import { t as CRUD_OPERATIONS } from "./constants-CUpamQMJ.mjs";
3
3
  import fp from "fastify-plugin";
4
4
  //#region src/registry/assertNoTenantData.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
2
  //#region src/lock/renewingLease.ts
3
3
  /**
4
4
  * Start renewing an ALREADY-ACQUIRED lease. The caller performed the
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-CEvvVXTC.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-DrZrabOW.mjs";
3
3
  import { toCanonicalList } from "@classytic/repo-core/pagination";
4
4
  import fp from "fastify-plugin";
5
5
  //#region src/plugins/replyHelpers.ts
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  //#region src/context/requestContext.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
2
  import "node:module";
3
3
  //#region \0rolldown/runtime.js
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
2
  //#region src/utils/runtimeCapabilities.ts
3
3
  /**
4
4
  * `Symbol.for` so declarations from two arc copies in one dependency graph
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-CEvvVXTC.mjs";
3
- import { t as startRenewingLease } from "./renewingLease-5ESPMxp0.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-DrZrabOW.mjs";
3
+ import { t as startRenewingLease } from "./renewingLease-C5Ta_ImD.mjs";
4
4
  import fp from "fastify-plugin";
5
5
  //#region src/plugins/schedules.ts
6
6
  var schedules_exports = /* @__PURE__ */ __exportAll({
@@ -10,7 +10,7 @@ var schedules_exports = /* @__PURE__ */ __exportAll({
10
10
  const MIN_SAFE_INTERVAL_MS = 1e3;
11
11
  const MAX_DEFAULT_LEASE_MS = 3e5;
12
12
  const schedulesPlugin = async (fastify, opts) => {
13
- const { schedules, lock, enabled = true } = opts;
13
+ const { schedules, lock, enabled = true, drainTimeoutMs = 5e3 } = opts;
14
14
  const holderId = opts.holderId ?? `arc-${process.pid}-${Math.random().toString(36).slice(2, 10)}`;
15
15
  const stats = /* @__PURE__ */ new Map();
16
16
  fastify.decorate("getScheduleStats", () => [...stats.values()].map((s) => ({ ...s })));
@@ -105,7 +105,33 @@ const schedulesPlugin = async (fastify, opts) => {
105
105
  closing = true;
106
106
  for (const timer of timers.values()) clearTimeout(timer);
107
107
  timers.clear();
108
- await Promise.allSettled([...inFlight.values()]);
108
+ /**
109
+ * Let in-flight runs settle so shutdown never truncates a sweep mid-write —
110
+ * but BOUNDED, because a tick has no cancellation contract and its duration
111
+ * is not this plugin's to predict. An outbox relay whose subscriber retries
112
+ * on a backoff ladder holds one tick for minutes, and an unbounded await
113
+ * here contradicts the `unref` two functions up: pending scheduled work is
114
+ * already declared as something that must not hold the process.
115
+ *
116
+ * Waiting longer than the orchestrator's grace period buys nothing anyway —
117
+ * SIGKILL truncates the same write, without the log line naming what was
118
+ * still running.
119
+ */
120
+ const pending = [...inFlight.entries()];
121
+ if (pending.length === 0) return;
122
+ let timeout;
123
+ const expired = Symbol("drain-timeout");
124
+ const budget = new Promise((resolve) => {
125
+ timeout = setTimeout(() => resolve(expired), drainTimeoutMs);
126
+ timeout.unref?.();
127
+ });
128
+ const settled = Promise.allSettled(pending.map(([, run]) => run)).then(() => void 0);
129
+ const outcome = await Promise.race([settled, budget]);
130
+ if (timeout) clearTimeout(timeout);
131
+ if (outcome === expired) fastify.log.warn({
132
+ schedules: pending.map(([name]) => name),
133
+ drainTimeoutMs
134
+ }, "[arc-schedules] shutdown drain budget exceeded — abandoning in-flight run(s). Durable work (outbox rows, leased sweeps) is retried on the next boot; raise `drainTimeoutMs` only if a listed job is genuinely non-resumable.");
109
135
  });
110
136
  };
111
137
  var schedules_default = fp(schedulesPlugin, {
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
2
  import { arcLog } from "./logger/index.mjs";
3
3
  //#region src/utils/schemaConverter.ts
4
4
  /**
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
- import { o as toJsonSchema } from "./schemaConverter-D2_bHGil.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import { o as toJsonSchema } from "./schemaConverter-C8zbW7tJ.mjs";
3
3
  //#region src/core/schemaIR.ts
4
4
  /**
5
5
  * Schema IR — one canonical representation, two adapters.
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
2
  import { errorContractSchema, errorDetailSchema } from "@classytic/repo-core/errors";
3
3
  import { Type, Type as Type$1 } from "typebox";
4
4
  //#region src/schemas/index.ts
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
- import { t as parseJsonBody } from "../jsonBody-CVKA7C5m.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import { t as parseJsonBody } from "../jsonBody-BuzxOZV8.mjs";
3
3
  import fp from "fastify-plugin";
4
4
  //#region src/scim/errors.ts
5
5
  var ScimError = class extends Error {
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
- import { C as isService, D as requireUserId, E as requireTeamId, O as scopeFirstCtx, S as isOrgInScope, T as requireOrgId, _ as getUserRoles, a as getDPoPJkt, b as isElevated, c as getOrgId, d as getScopeContext, f as getScopeContextMap, g as getUserId, h as getTenantFromRequest, i as getClientId, l as getOrgRoles, m as getTeamId, n as PUBLIC_SCOPE, o as getMandate, p as getServiceScopes, r as getAncestorOrgIds, s as getOrgContext, t as AUTHENTICATED_SCOPE, u as getRequestScope, v as hasOrgAccess, w as requireClientId, x as isMember, y as isAuthenticated } from "../types-GY4kATJb.mjs";
3
- import { n as elevation_default, t as elevationPlugin } from "../elevation-tGIAldco.mjs";
4
- import { t as createTenantKeyGenerator } from "../rateLimitKey-pyevMUVf.mjs";
5
- import { t as resolveOrgFromHeader } from "../scope-DgepeCv6.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import { C as isService, D as requireUserId, E as requireTeamId, O as scopeFirstCtx, S as isOrgInScope, T as requireOrgId, _ as getUserRoles, a as getDPoPJkt, b as isElevated, c as getOrgId, d as getScopeContext, f as getScopeContextMap, g as getUserId, h as getTenantFromRequest, i as getClientId, l as getOrgRoles, m as getTeamId, n as PUBLIC_SCOPE, o as getMandate, p as getServiceScopes, r as getAncestorOrgIds, s as getOrgContext, t as AUTHENTICATED_SCOPE, u as getRequestScope, v as hasOrgAccess, w as requireClientId, x as isMember, y as isAuthenticated } from "../types-lDs9oF4z.mjs";
3
+ import { n as elevation_default, t as elevationPlugin } from "../elevation-Bc6Gafv9.mjs";
4
+ import { t as createTenantKeyGenerator } from "../rateLimitKey-DlqmDHA5.mjs";
5
+ import { t as resolveOrgFromHeader } from "../scope-DFSOKc4T.mjs";
6
6
  export { AUTHENTICATED_SCOPE, PUBLIC_SCOPE, createTenantKeyGenerator, elevation_default as elevationPlugin, elevationPlugin as elevationPluginFn, getAncestorOrgIds, getClientId, getDPoPJkt, getMandate, getOrgContext, getOrgId, getOrgRoles, getRequestScope, getScopeContext, getScopeContextMap, getServiceScopes, getTeamId, getTenantFromRequest, getUserId, getUserRoles, hasOrgAccess, isAuthenticated, isElevated, isMember, isOrgInScope, isService, requireClientId, requireOrgId, requireTeamId, requireUserId, resolveOrgFromHeader, scopeFirstCtx };
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
- import { a as OrgAccessDeniedError, l as UnauthorizedError } from "./errors-CLid6atr.mjs";
3
- import { n as requireSingleHeaderValue } from "./headers-DODWf7aC.mjs";
4
- import { n as getUserRoles } from "./userHelpers-AKcB4V03.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import { a as OrgAccessDeniedError, l as UnauthorizedError } from "./errors-DsdZc1Xv.mjs";
3
+ import { n as requireSingleHeaderValue } from "./headers-BFu1st_i.mjs";
4
+ import { n as getUserRoles } from "./userHelpers-DU_Z5OBA.mjs";
5
5
  //#region src/scope/resolveOrgFromHeader.ts
6
6
  /**
7
7
  * Create a preHandler hook that resolves org scope from a header.
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
2
  //#region src/utils/simpleEqualityMatcher.ts
3
3
  /**
4
4
  * `simpleEqualityMatcher` — a minimal, dialect-agnostic flat-key equality
@@ -1,9 +1,9 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-CEvvVXTC.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-DrZrabOW.mjs";
3
3
  import { arcLog } from "./logger/index.mjs";
4
- import { c as getOrgId, n as PUBLIC_SCOPE } from "./types-GY4kATJb.mjs";
5
- import { a as promoteStreamTokenToHeader } from "./streaming-DOpZVht6.mjs";
6
- import { t as openSseStream } from "./sseStream-ByFGyIVr.mjs";
4
+ import { c as getOrgId, n as PUBLIC_SCOPE } from "./types-lDs9oF4z.mjs";
5
+ import { a as promoteStreamTokenToHeader } from "./streaming-weWcFCk4.mjs";
6
+ import { t as openSseStream } from "./sseStream-cWezGOk1.mjs";
7
7
  import fp from "fastify-plugin";
8
8
  //#region src/plugins/sse.ts
9
9
  var sse_exports = /* @__PURE__ */ __exportAll({
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
- import { n as forwardedStreamHeaders } from "./streaming-DOpZVht6.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import { n as forwardedStreamHeaders } from "./streaming-weWcFCk4.mjs";
3
3
  //#region src/utils/sseStream.ts
4
4
  /**
5
5
  * Take over the reply socket and open an SSE stream. Call ONLY after every
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
2
  //#region src/utils/store-helpers.ts
3
3
  /**
4
4
  * Classify an error thrown by `getOne` / `getById` / `update` as a
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
2
  import { Readable } from "node:stream";
3
3
  //#region src/utils/streaming.ts
4
4
  /**
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
- import { r as createEvent } from "./EventTransport-BrPeGUil.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import { r as createEvent } from "./EventTransport-pGNNDQ__.mjs";
3
3
  //#region src/events/defineEvent.ts
4
4
  /**
5
5
  * Typed event declarations, a registry for introspection, and `.create()` to
@@ -137,9 +137,15 @@ function validatePayload(payload, schema) {
137
137
  if (expectedType) {
138
138
  const value = record[key];
139
139
  const actualType = Array.isArray(value) ? "array" : typeof value;
140
- if (expectedType === "integer") {
141
- if (actualType !== "number" || !Number.isInteger(value)) errors.push(`Field '${key}': expected integer, got ${actualType}`);
142
- } else if (expectedType !== actualType) errors.push(`Field '${key}': expected ${expectedType}, got ${actualType}`);
140
+ /**
141
+ * `type` may be a UNION (`['string','null']`) — that is how every
142
+ * nullable field compiles. Comparing the array to a `typeof` string
143
+ * is never equal, so a union-typed field failed for EVERY value it
144
+ * allows, and the array stringified into the message as the
145
+ * self-contradictory "expected string,null, got string".
146
+ */
147
+ const allowed = Array.isArray(expectedType) ? expectedType : [expectedType];
148
+ if (!allowed.some((t) => t === "integer" ? actualType === "number" && Number.isInteger(value) : t === actualType)) errors.push(`Field '${key}': expected ${allowed.join(" | ")}, got ${actualType}`);
143
149
  }
144
150
  }
145
151
  }
@@ -1,3 +1,3 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
2
  import { CursorExpiredError, MemoryChangeLogStore } from "@classytic/repo-core/sync";
3
3
  export { CursorExpiredError, MemoryChangeLogStore };
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
2
  import { afterAll, beforeAll, describe, expect, it } from "vitest";
3
3
  //#region src/testing/cleanupStoreContract.ts
4
4
  /**
@@ -1,10 +1,10 @@
1
1
 
2
2
  import { i as RequestScope } from "../types-Ddl9OjmE.mjs";
3
- import { l as PermissionCheck, t as AnyRecord } from "../base-GZU3LlzP.mjs";
4
- import { V as ResourceDefinition } from "../index-C5K78SXo.mjs";
5
- import { n as ArcModuleInput, o as ModuleDisposer, s as ModuleSetupContext } from "../types-DDD5RKTu.mjs";
6
- import "../index-C50BUxKs.mjs";
7
- import { n as preloadResourcesAsync, r as CreateAppOptions, t as preloadResources } from "../preloadResources--ZtY9pe9.mjs";
3
+ import { l as PermissionCheck, t as AnyRecord } from "../base-C-NL2fTi.mjs";
4
+ import { V as ResourceDefinition } from "../index-C01wWGJt.mjs";
5
+ import { n as ArcModuleInput, o as ModuleDisposer, s as ModuleSetupContext } from "../types-BMa2EPtv.mjs";
6
+ import "../index-DCxxRwLC.mjs";
7
+ import { n as preloadResourcesAsync, r as CreateAppOptions, t as preloadResources } from "../preloadResources-BYFfYnjZ.mjs";
8
8
  import { StorageContractSetup, StorageContractSetupResult, runStorageContract } from "./storageContract.mjs";
9
9
  import { StandardRepo } from "@classytic/repo-core/repository";
10
10
  import { FastifyInstance, FastifyServerOptions } from "fastify";
@@ -1,12 +1,12 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
- import { t as CRUD_OPERATIONS } from "../constants-BhzLXCfN.mjs";
3
- import { g as getUserId } from "../types-GY4kATJb.mjs";
4
- import { t as BaseController } from "../BaseController-C-pofd0v.mjs";
5
- import { t as defineResource } from "../defineResource-BOrGeocE.mjs";
6
- import { t as defineAggregation } from "../defineAggregation-DoIijIFq.mjs";
7
- import { E as requireOrgRole } from "../permissions-CpSBlFXZ.mjs";
8
- import { a as createApp, n as preloadResourcesAsync, t as preloadResources } from "../preloadResources-DYMzmUk1.mjs";
9
- import { n as getModuleExports } from "../module-Bh5OC7ww.mjs";
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
+ import { t as CRUD_OPERATIONS } from "../constants-CUpamQMJ.mjs";
3
+ import { g as getUserId } from "../types-lDs9oF4z.mjs";
4
+ import { t as BaseController } from "../BaseController-B5GZfUBy.mjs";
5
+ import { t as defineResource } from "../defineResource-WcbE1kJL.mjs";
6
+ import { t as defineAggregation } from "../defineAggregation-cCitY2FA.mjs";
7
+ import { E as requireOrgRole } from "../permissions-DWkl60hx.mjs";
8
+ import { a as createApp, n as preloadResourcesAsync, t as preloadResources } from "../preloadResources-BUoGKPaS.mjs";
9
+ import { n as getModuleExports } from "../module-DIvG8qOg.mjs";
10
10
  import { runStorageContract } from "./storageContract.mjs";
11
11
  import Fastify from "fastify";
12
12
  import { afterAll, describe, expect, it, vi } from "vitest";
@@ -1504,7 +1504,7 @@ function pickDefaultAuth(authMode, callerAuth) {
1504
1504
  };
1505
1505
  }
1506
1506
  async function createTestApp(options = {}) {
1507
- const { createApp } = await import("../preloadResources-DYMzmUk1.mjs").then((n) => n.o);
1507
+ const { createApp } = await import("../preloadResources-BUoGKPaS.mjs").then((n) => n.o);
1508
1508
  const { resources = [], db = "in-memory", connectMongoose = false, authMode = "jwt", defaultOrgId, plugins, auth: callerAuth, ...appOptions } = options;
1509
1509
  let dbHandle;
1510
1510
  let dbUri;
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
2
  import { OutboxOwnershipError } from "@classytic/primitives/outbox";
3
3
  import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest";
4
4
  //#region src/testing/outboxStoreContract.ts
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
2
  import { afterAll, beforeAll, describe, expect, it } from "vitest";
3
3
  //#region src/testing/storageContract.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  //#region src/context/transactionContext.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
2
  //#region src/utils/typeGuards.ts
3
3
  /** Check if fastify has the events plugin registered */
4
4
  function hasEvents(instance) {
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { i as RequestScope } from "../types-Ddl9OjmE.mjs";
3
- import { a as UserLike, c as DataPolicy, d as UserBase, i as ObjectId, l as PermissionCheck, n as ArcRequest, o as UserOrganization, r as JWTPayload, s as AuthorizationDecision, t as AnyRecord, u as PermissionContext } from "../base-GZU3LlzP.mjs";
4
- import { $ as OpenApiSchemas, A as RequestIdOptions, An as WriteVerbKey, At as RouteDefinition, C as RequestContext, D as HealthCheck, Dn as MutationWriteContext, Dt as ActionEntry, E as GracefulShutdownOptions, Et as ActionDefinition, F as FastifyWithDecorators, Fn as IControllerResponse, Ft as AuthPluginOptions, G as OnTenantDeleteConfig, H as CrudController, I as MiddlewareHandler, In as IRequestContext, It as Authenticator, J as PresetHook, K as ResolvedTenantPurge, L as RequestWithExtras, Ln as RawRouteHandler, Lt as AuthenticatorContext, M as EventsDecorator, Mn as ControllerLike, Mt as RouteMethod, N as FastifyRequestExtras, Nn as FastifyHandler, Nt as RateLimitConfig, O as HealthOptions, On as ResourceWrites, Ot as ActionHandlerFn, P as FastifyWithAuth, Pn as IController, Pt as AuthHelpers, Q as MiddlewareConfig, Rn as RouteHandler, Rt as JwtContext, S as QueryParserInterface, T as CrudRouterOptions, Tt as ResourceCacheConfig, U as ResourceConfig, W as ResourcePermissions, X as CrudRouteKey, Y as PresetResult, Z as CrudSchemas, _ as ControllerQueryOptions, a as InferAdapterDoc, at as ResourceExtensions, b as ParsedQuery, c as TypedController, d as PaginationResult, et as RouteSchemaOptions, f as IntrospectionData, g as ArcInternalMetadata, h as ResourceMetadata, i as ValidationResult, it as ResourceHooks, j as ArcDecorator, jn as ControllerHandler, jt as RouteMcpConfig, k as IntrospectionPluginOptions, kn as WriteContext, kt as ActionsMap, l as TypedRepository, m as RegistryStats, n as ConfigError, nt as FieldRule, o as InferDocType, ot as EventDefinition, p as RegistryEntry, q as PresetFunction, r as ValidateOptions, rt as ResourceHookContext, s as InferResourceDoc, t as RouteHandlerMethod, tt as ArcFieldRule, u as TypedResourceConfig, v as LookupOption, w as ServiceContext, x as PopulateOption, xn as BaseControllerOptions, y as OwnershipCheck, zt as TokenPair } from "../index-C5K78SXo.mjs";
3
+ import { a as UserLike, c as DataPolicy, d as UserBase, i as ObjectId, l as PermissionCheck, n as ArcRequest, o as UserOrganization, r as JWTPayload, s as AuthorizationDecision, t as AnyRecord, u as PermissionContext } from "../base-C-NL2fTi.mjs";
4
+ import { $ as OpenApiSchemas, A as RequestIdOptions, An as WriteVerbKey, At as RouteDefinition, C as RequestContext, D as HealthCheck, Dn as MutationWriteContext, Dt as ActionEntry, E as GracefulShutdownOptions, Et as ActionDefinition, F as FastifyWithDecorators, Fn as IControllerResponse, Ft as AuthPluginOptions, G as OnTenantDeleteConfig, H as CrudController, I as MiddlewareHandler, In as IRequestContext, It as Authenticator, J as PresetHook, K as ResolvedTenantPurge, L as RequestWithExtras, Ln as RawRouteHandler, Lt as AuthenticatorContext, M as EventsDecorator, Mn as ControllerLike, Mt as RouteMethod, N as FastifyRequestExtras, Nn as FastifyHandler, Nt as RateLimitConfig, O as HealthOptions, On as ResourceWrites, Ot as ActionHandlerFn, P as FastifyWithAuth, Pn as IController, Pt as AuthHelpers, Q as MiddlewareConfig, Rn as RouteHandler, Rt as JwtContext, S as QueryParserInterface, T as CrudRouterOptions, Tt as ResourceCacheConfig, U as ResourceConfig, W as ResourcePermissions, X as CrudRouteKey, Y as PresetResult, Z as CrudSchemas, _ as ControllerQueryOptions, a as InferAdapterDoc, at as ResourceExtensions, b as ParsedQuery, c as TypedController, d as PaginationResult, et as RouteSchemaOptions, f as IntrospectionData, g as ArcInternalMetadata, h as ResourceMetadata, i as ValidationResult, it as ResourceHooks, j as ArcDecorator, jn as ControllerHandler, jt as RouteMcpConfig, k as IntrospectionPluginOptions, kn as WriteContext, kt as ActionsMap, l as TypedRepository, m as RegistryStats, n as ConfigError, nt as FieldRule, o as InferDocType, ot as EventDefinition, p as RegistryEntry, q as PresetFunction, r as ValidateOptions, rt as ResourceHookContext, s as InferResourceDoc, t as RouteHandlerMethod, tt as ArcFieldRule, u as TypedResourceConfig, v as LookupOption, w as ServiceContext, x as PopulateOption, xn as BaseControllerOptions, y as OwnershipCheck, zt as TokenPair } from "../index-C01wWGJt.mjs";
5
5
  import { n as ElevationOptions, t as ElevationEvent } from "../elevation-BXCfVcNG.mjs";
6
6
  export type { ActionDefinition, ActionEntry, ActionHandlerFn, ActionsMap, AnyRecord, ArcDecorator, ArcFieldRule, ArcInternalMetadata, ArcRequest, AuthHelpers, AuthPluginOptions, Authenticator, AuthenticatorContext, AuthorizationDecision, BaseControllerOptions, ConfigError, ControllerHandler, ControllerLike, ControllerQueryOptions, CrudController, CrudRouteKey, CrudRouterOptions, CrudSchemas, DataPolicy, ElevationEvent, ElevationOptions, EventDefinition, EventsDecorator, FastifyHandler, FastifyRequestExtras, FastifyWithAuth, FastifyWithDecorators, FieldRule, GracefulShutdownOptions, HealthCheck, HealthOptions, IController, IControllerResponse, IRequestContext, InferAdapterDoc, InferDocType, InferResourceDoc, IntrospectionData, IntrospectionPluginOptions, JWTPayload, JwtContext, LookupOption, MiddlewareConfig, MiddlewareHandler, MutationWriteContext, ObjectId, OnTenantDeleteConfig, OpenApiSchemas, OwnershipCheck, PaginationResult, ParsedQuery, PermissionCheck, PermissionContext, PopulateOption, PresetFunction, PresetHook, PresetResult, QueryParserInterface, RateLimitConfig, RawRouteHandler, RegistryEntry, RegistryStats, RequestContext, RequestIdOptions, RequestScope, RequestWithExtras, ResolvedTenantPurge, ResourceCacheConfig, ResourceConfig, ResourceExtensions, ResourceHookContext, ResourceHooks, ResourceMetadata, ResourcePermissions, ResourceWrites, RouteDefinition, RouteHandler, RouteHandlerMethod, RouteMcpConfig, RouteMethod, RouteSchemaOptions, ServiceContext, TokenPair, TypedController, TypedRepository, TypedResourceConfig, UserBase, UserLike, UserOrganization, ValidateOptions, ValidationResult, WriteContext, WriteVerbKey };
@@ -1,2 +1,2 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
2
  export {};
@@ -1,2 +1,2 @@
1
- /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
2
  export {};
@@ -90,6 +90,15 @@ interface SchedulesPluginOptions {
90
90
  * environments), same pattern as `idempotencyPlugin`.
91
91
  */
92
92
  enabled?: boolean;
93
+ /**
94
+ * How long `onClose` waits for in-flight runs before abandoning them.
95
+ * Default: 5000.
96
+ *
97
+ * A tick cannot be cancelled, so this is the only lever. Keep it below the
98
+ * orchestrator's termination grace period — past that the process is killed
99
+ * and the wait bought nothing.
100
+ */
101
+ drainTimeoutMs?: number;
93
102
  }
94
103
  /** Per-schedule runtime counters, readable via `fastify.getScheduleStats()`. */
95
104
  interface ScheduleStats {