@classytic/arc 2.36.0 → 2.37.1

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 (168) hide show
  1. package/dist/{BaseController-CTJKm6Cb.mjs → BaseController-Chkf0Aiw.mjs} +16 -15
  2. package/dist/{EventTransport-D23Uvhg4.mjs → EventTransport-CFdtK25P.mjs} +1 -1
  3. package/dist/{HookSystem-DgwxNZTx.mjs → HookSystem-Csy31WS-.mjs} +2 -2
  4. package/dist/{ResourceRegistry-DNuYVbmv.mjs → ResourceRegistry-OQA13slI.mjs} +2 -2
  5. package/dist/{actionPermissions-D97DniUQ.mjs → actionPermissions-DGGqqSIV.mjs} +6 -6
  6. package/dist/audit/index.d.mts +1 -1
  7. package/dist/audit/index.mjs +2 -2
  8. package/dist/auth/audit.mjs +1 -1
  9. package/dist/auth/index.d.mts +1 -1
  10. package/dist/auth/index.mjs +79 -28
  11. package/dist/auth/redis-session.mjs +1 -1
  12. package/dist/{authorizationDecision-EsiY3nUu.mjs → authorizationDecision-BzZi2bsf.mjs} +2 -2
  13. package/dist/{buildHandler-Dohd2JuY.mjs → buildHandler-CIz0NsGS.mjs} +4 -4
  14. package/dist/cache/index.mjs +4 -4
  15. package/dist/{caching-CP3GLJ7U.mjs → caching-DldVgnC9.mjs} +2 -2
  16. package/dist/cleanup/index.d.mts +2 -2
  17. package/dist/cleanup/index.mjs +4 -4
  18. package/dist/cli/commands/describe.d.mts +1 -1
  19. package/dist/cli/commands/describe.mjs +3 -3
  20. package/dist/cli/commands/docs.mjs +3 -3
  21. package/dist/cli/commands/doctor.mjs +1 -1
  22. package/dist/cli/commands/generate.mjs +2 -2
  23. package/dist/cli/commands/init.mjs +2 -2
  24. package/dist/cli/commands/introspect.mjs +2 -2
  25. package/dist/cli/index.mjs +3 -3
  26. package/dist/{constants-DUoKAGYD.mjs → constants-DDKf25s4.mjs} +1 -1
  27. package/dist/context/index.mjs +3 -3
  28. package/dist/core/index.d.mts +2 -2
  29. package/dist/core/index.mjs +7 -7
  30. package/dist/{core-DTXsiNTJ.mjs → core-uHQonaHf.mjs} +3 -3
  31. package/dist/{createActionRouter-CZz6JO93.mjs → createActionRouter-C22Xn11N.mjs} +7 -7
  32. package/dist/{createAggregationRouter-DKrGv_EC.mjs → createAggregationRouter-DgyksLHH.mjs} +7 -7
  33. package/dist/{defineAggregation-CpQfcM8R.mjs → defineAggregation-B1m-45Fe.mjs} +1 -1
  34. package/dist/{defineResource-DWzjyxb2.mjs → defineResource-DS3Uj2-8.mjs} +18 -18
  35. package/dist/discovery/index.mjs +1 -1
  36. package/dist/docs/index.d.mts +1 -1
  37. package/dist/docs/index.mjs +3 -3
  38. package/dist/{elevation-D_cmo80j.mjs → elevation-9X0lGzTQ.mjs} +4 -4
  39. package/dist/encryption/index.mjs +3 -3
  40. package/dist/{errorHandler-2RT0hLSI.mjs → errorHandler-BmEGKyO9.mjs} +4 -4
  41. package/dist/{errors-DDKni6Tz.mjs → errors-CbxCF9M0.mjs} +1 -1
  42. package/dist/{eventPlugin-c3YwGzz9.mjs → eventPlugin-B1ahehZH.mjs} +5 -5
  43. package/dist/events/index.d.mts +1 -1
  44. package/dist/events/index.mjs +5 -5
  45. package/dist/events/transports/redis-stream-entry.mjs +1 -1
  46. package/dist/events/transports/redis.mjs +1 -1
  47. package/dist/factory/index.d.mts +4 -4
  48. package/dist/factory/index.mjs +5 -5
  49. package/dist/{fastify-augmentation-Bk_9PoiV.d.mts → fastify-augmentation-CRsNNhuo.d.mts} +3 -3
  50. package/dist/{fields-DdP225wt.mjs → fields-f_MdWDl_.mjs} +1 -1
  51. package/dist/{generate-B1bKdcV9.mjs → generate-DxWn-XnM.mjs} +2 -2
  52. package/dist/{headers-DKslnhey.mjs → headers-DivLPMHe.mjs} +2 -2
  53. package/dist/{health-k6NODS8f.mjs → health-W_BjgWf0.mjs} +1 -1
  54. package/dist/hooks/index.d.mts +1 -1
  55. package/dist/hooks/index.mjs +2 -2
  56. package/dist/idempotency/index.mjs +4 -4
  57. package/dist/idempotency/redis.mjs +1 -1
  58. package/dist/{index-C01wWGJt.d.mts → index-BqRfP1kT.d.mts} +10 -1
  59. package/dist/{index-RdpLP71b.d.mts → index-CEmPspAB.d.mts} +2 -4
  60. package/dist/{index-C50BUxKs.d.mts → index-DCxxRwLC.d.mts} +1 -1
  61. package/dist/index.d.mts +3 -3
  62. package/dist/index.mjs +11 -11
  63. package/dist/{init-LuGxIbQ_.mjs → init-BJ6fdYnp.mjs} +1 -1
  64. package/dist/integrations/event-gateway.mjs +2 -2
  65. package/dist/integrations/index.d.mts +1 -1
  66. package/dist/integrations/index.mjs +1 -1
  67. package/dist/integrations/jobs/index.mjs +2 -2
  68. package/dist/integrations/mcp/index.d.mts +2 -2
  69. package/dist/integrations/mcp/index.mjs +2 -2
  70. package/dist/integrations/mcp/testing.d.mts +1 -1
  71. package/dist/integrations/mcp/testing.mjs +2 -2
  72. package/dist/integrations/streamline.mjs +3 -3
  73. package/dist/integrations/webhooks.d.mts +1 -1
  74. package/dist/integrations/webhooks.mjs +3 -3
  75. package/dist/integrations/websocket-pushref-redis.mjs +1 -1
  76. package/dist/integrations/websocket-redis.mjs +1 -1
  77. package/dist/integrations/websocket.mjs +1 -1
  78. package/dist/{interface-B7awDx3b.mjs → interface-DeLndJ8G.mjs} +1 -1
  79. package/dist/{jsonBody-CiHih3ZU.mjs → jsonBody-kApktjTc.mjs} +2 -2
  80. package/dist/{keys-BcNl12HN.mjs → keys-B1MgfDWi.mjs} +1 -1
  81. package/dist/{loadResources-DGlfRQc9.mjs → loadResources-ma-Aaxp1.mjs} +2 -2
  82. package/dist/{loadResourcesFromEntry-VYPGSas8.mjs → loadResourcesFromEntry-xszlyXTs.mjs} +2 -2
  83. package/dist/logger/index.mjs +1 -1
  84. package/dist/{mcpPlugin-NxSlc-Ks.mjs → mcpPlugin-97HuFA46.mjs} +15 -15
  85. package/dist/{memory-BU-C-MV3.mjs → memory-DvASzOn3.mjs} +2 -2
  86. package/dist/{metrics-7_1GbJpl.mjs → metrics-Dx-nkDE5.mjs} +2 -2
  87. package/dist/middleware/index.d.mts +1 -1
  88. package/dist/middleware/index.mjs +3 -3
  89. package/dist/migrations/index.mjs +2 -2
  90. package/dist/{module-CQNHzE7g.mjs → module-CNKk_twm.mjs} +1 -1
  91. package/dist/{multipartBody-Bi5yqW0M.mjs → multipartBody-TDaYOHGZ.mjs} +1 -1
  92. package/dist/{openapi-RpNbPBL-.mjs → openapi-473gZ-8x.mjs} +6 -6
  93. package/dist/outbox-admin/index.d.mts +1 -1
  94. package/dist/outbox-admin/index.mjs +4 -4
  95. package/dist/{outbox-module-b1TyDGGi.d.mts → outbox-module-BbdaMyqy.d.mts} +1 -1
  96. package/dist/{outbox-module-ClcFrq98.mjs → outbox-module-DOAmyXOb.mjs} +4 -4
  97. package/dist/permissions/index.mjs +5 -5
  98. package/dist/{permissions-DgPrZsJh.mjs → permissions-DnAc6zoZ.mjs} +6 -6
  99. package/dist/{pipe-Cjy1UiXX.mjs → pipe-BoV-z4db.mjs} +2 -2
  100. package/dist/pipeline/index.d.mts +1 -1
  101. package/dist/pipeline/index.mjs +2 -2
  102. package/dist/plugins/index.d.mts +3 -3
  103. package/dist/plugins/index.mjs +16 -16
  104. package/dist/plugins/response-cache.mjs +2 -2
  105. package/dist/plugins/tracing-entry.mjs +2 -2
  106. package/dist/{pluralize-B7m0dPm8.mjs → pluralize-BiU5ocWw.mjs} +1 -1
  107. package/dist/{preloadResources-BuutdWgr.d.mts → preloadResources-DHkyk3QN.d.mts} +3 -3
  108. package/dist/{preloadResources-CjnW4iIX.mjs → preloadResources-DJ7Lli0a.mjs} +21 -21
  109. package/dist/presets/filesUpload.d.mts +1 -1
  110. package/dist/presets/filesUpload.mjs +5 -5
  111. package/dist/presets/index.d.mts +1 -1
  112. package/dist/presets/index.mjs +2 -2
  113. package/dist/presets/multiTenant.d.mts +1 -1
  114. package/dist/presets/multiTenant.mjs +3 -3
  115. package/dist/presets/search.d.mts +1 -1
  116. package/dist/presets/search.mjs +2 -2
  117. package/dist/{presets-CsGg8B58.mjs → presets-BMxH-Bb7.mjs} +4 -4
  118. package/dist/{projection-koISNyQo.mjs → projection-CRCM5S9T.mjs} +2 -2
  119. package/dist/{queryCachePlugin-DHueQT9O.mjs → queryCachePlugin-Cl3zLG7g.mjs} +5 -5
  120. package/dist/{rateLimitKey-Bma8VXDO.mjs → rateLimitKey-D4_rjP1K.mjs} +1 -1
  121. package/dist/{realtime-BBoC91Bz.mjs → realtime-BWuHi-UI.mjs} +9 -9
  122. package/dist/{registerRoute-BTgORTlR.mjs → registerRoute-mvm6zY2H.mjs} +5 -5
  123. package/dist/registry/index.d.mts +2 -2
  124. package/dist/registry/index.mjs +3 -3
  125. package/dist/{registry-BzvRCYS6.mjs → registry-3maEt__c.mjs} +2 -2
  126. package/dist/{renewingLease-CgIGh0Ab.mjs → renewingLease-C1-GAUpr.mjs} +1 -1
  127. package/dist/{replyHelpers-BN16KPHr.mjs → replyHelpers-DVcUoled.mjs} +2 -2
  128. package/dist/{requestContext-B93dmpf0.mjs → requestContext-KzIdSmN2.mjs} +1 -1
  129. package/dist/{rolldown-runtime-JJWfp8rp.mjs → rolldown-runtime-NVzJrC-o.mjs} +1 -1
  130. package/dist/{runtimeCapabilities-jK99Ciw_.mjs → runtimeCapabilities-OrGatf7r.mjs} +1 -1
  131. package/dist/{schedules-CKKEL21P.mjs → schedules-DeRI03eo.mjs} +31 -5
  132. package/dist/{schemaConverter-gg0_aUPF.mjs → schemaConverter-cXTayNOW.mjs} +1 -1
  133. package/dist/{schemaIR-CngYvpCF.mjs → schemaIR-Cc9ZPVs2.mjs} +2 -2
  134. package/dist/schemas/index.mjs +1 -1
  135. package/dist/scim/index.mjs +2 -2
  136. package/dist/scope/index.mjs +5 -5
  137. package/dist/{scope-B1RsHdjF.mjs → scope-C2r7_WGs.mjs} +4 -4
  138. package/dist/{simpleEqualityMatcher-_9NAMHUD.mjs → simpleEqualityMatcher-Cr1F8jKZ.mjs} +1 -1
  139. package/dist/{sse-Bxt03Hk5.mjs → sse-BmZCVRGH.mjs} +5 -5
  140. package/dist/{sseStream-BMHTLlhR.mjs → sseStream-nNPqvOeK.mjs} +2 -2
  141. package/dist/{store-helpers-Brt8OxWZ.mjs → store-helpers-C1r3-6M0.mjs} +1 -1
  142. package/dist/{streaming-CiTJW8kZ.mjs → streaming-BxZDlH01.mjs} +1 -1
  143. package/dist/{subscribe-helpers-B4fNHRNc.mjs → subscribe-helpers-Dca7Fcz2.mjs} +2 -2
  144. package/dist/sync/changelog.mjs +1 -1
  145. package/dist/testing/cleanupStoreContract.mjs +1 -1
  146. package/dist/testing/index.d.mts +4 -4
  147. package/dist/testing/index.mjs +10 -10
  148. package/dist/testing/outboxStoreContract.mjs +1 -1
  149. package/dist/testing/storageContract.mjs +1 -1
  150. package/dist/{transactionContext-D2HwJM2z.mjs → transactionContext-6F7Gkbxg.mjs} +1 -1
  151. package/dist/{typeGuards-IE1laMDf.mjs → typeGuards-BrXgbFi-.mjs} +1 -1
  152. package/dist/types/index.d.mts +1 -1
  153. package/dist/types/index.mjs +1 -1
  154. package/dist/types/storage.mjs +1 -1
  155. package/dist/{types-DDD5RKTu.d.mts → types-BMa2EPtv.d.mts} +9 -0
  156. package/dist/{types-B8lwJv9Q.mjs → types-khJmBErP.mjs} +4 -4
  157. package/dist/{types-BXnTOsXP.d.mts → types-rzNprqbE.d.mts} +1 -1
  158. package/dist/usage/index.mjs +0 -0
  159. package/dist/{userHelpers-xQAi5bPF.mjs → userHelpers-Bi97zMEl.mjs} +1 -1
  160. package/dist/utils/index.d.mts +2 -2
  161. package/dist/utils/index.mjs +11 -11
  162. package/dist/{utils-DgNFsJ2c.mjs → utils-WlLDIKuw.mjs} +1230 -1230
  163. package/dist/{validate-DI3L5V9w.mjs → validate-pMke_boy.mjs} +2 -2
  164. package/dist/{versioning-COpAyfpZ.mjs → versioning-CFK3c04-.mjs} +3 -3
  165. package/package.json +11 -6
  166. package/skills/arc/references/auth.md +5 -2
  167. package/skills/arc/references/production.md +733 -733
  168. package/skills/arc-code-review/references/migration-recipes.md +16 -7
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.36.0 | MIT | https://classytic.com */
2
- import { c as getOrgId, f as getScopeContextMap, g as getUserId, m as getTeamId, x as isMember } from "./types-B8lwJv9Q.mjs";
1
+ /*! @classytic/arc v2.37.1 | MIT | https://classytic.com */
2
+ import { c as getOrgId, f as getScopeContextMap, g as getUserId, m as getTeamId, x as isMember } from "./types-khJmBErP.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.36.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-JJWfp8rp.mjs";
3
- import { t as hasEvents } from "./typeGuards-IE1laMDf.mjs";
4
- import { i as versionKey, r as tagVersionKey } from "./keys-BcNl12HN.mjs";
5
- import { t as MemoryCacheStore } from "./memory-BU-C-MV3.mjs";
1
+ /*! @classytic/arc v2.37.1 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-NVzJrC-o.mjs";
3
+ import { i as versionKey, r as tagVersionKey } from "./keys-B1MgfDWi.mjs";
4
+ import { t as hasEvents } from "./typeGuards-BrXgbFi-.mjs";
5
+ import { t as MemoryCacheStore } from "./memory-DvASzOn3.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.36.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.1 | 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.36.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-JJWfp8rp.mjs";
1
+ /*! @classytic/arc v2.37.1 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-NVzJrC-o.mjs";
3
3
  import { arcLog } from "./logger/index.mjs";
4
- import { n as evaluateAndApplyPermission } from "./authorizationDecision-EsiY3nUu.mjs";
5
- import { n as getUserRoles } from "./userHelpers-xQAi5bPF.mjs";
6
- import { c as getOrgId } from "./types-B8lwJv9Q.mjs";
7
- import { t as simpleEqualityMatcher } from "./simpleEqualityMatcher-_9NAMHUD.mjs";
8
- import { t as applyFieldReadPermissions } from "./fields-DdP225wt.mjs";
9
- import { a as promoteStreamTokenToHeader } from "./streaming-CiTJW8kZ.mjs";
10
- import { t as openSseStream } from "./sseStream-BMHTLlhR.mjs";
4
+ import { n as evaluateAndApplyPermission } from "./authorizationDecision-BzZi2bsf.mjs";
5
+ import { n as getUserRoles } from "./userHelpers-Bi97zMEl.mjs";
6
+ import { c as getOrgId } from "./types-khJmBErP.mjs";
7
+ import { t as simpleEqualityMatcher } from "./simpleEqualityMatcher-Cr1F8jKZ.mjs";
8
+ import { t as applyFieldReadPermissions } from "./fields-f_MdWDl_.mjs";
9
+ import { a as promoteStreamTokenToHeader } from "./streaming-BxZDlH01.mjs";
10
+ import { t as openSseStream } from "./sseStream-nNPqvOeK.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.36.0 | MIT | https://classytic.com */
2
- import { n as evaluateAndApplyPermission } from "./authorizationDecision-EsiY3nUu.mjs";
3
- import { f as createError } from "./errors-DDKni6Tz.mjs";
4
- import { u as getRequestScope } from "./types-B8lwJv9Q.mjs";
5
- import { n as requestContext } from "./requestContext-B93dmpf0.mjs";
1
+ /*! @classytic/arc v2.37.1 | MIT | https://classytic.com */
2
+ import { n as evaluateAndApplyPermission } from "./authorizationDecision-BzZi2bsf.mjs";
3
+ import { f as createError } from "./errors-CbxCF9M0.mjs";
4
+ import { u as getRequestScope } from "./types-khJmBErP.mjs";
5
+ import { n as requestContext } from "./requestContext-KzIdSmN2.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-C01wWGJt.mjs";
3
- import "../fastify-augmentation-Bk_9PoiV.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-BqRfP1kT.mjs";
3
+ import "../fastify-augmentation-CRsNNhuo.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.36.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-BzvRCYS6.mjs";
3
- import { t as ResourceRegistry } from "../ResourceRegistry-DNuYVbmv.mjs";
1
+ /*! @classytic/arc v2.37.1 | 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-3maEt__c.mjs";
3
+ import { t as ResourceRegistry } from "../ResourceRegistry-OQA13slI.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.36.0 | MIT | https://classytic.com */
2
- import { t as CRUD_OPERATIONS } from "./constants-DUoKAGYD.mjs";
1
+ /*! @classytic/arc v2.37.1 | MIT | https://classytic.com */
2
+ import { t as CRUD_OPERATIONS } from "./constants-DDKf25s4.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.36.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.1 | 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.36.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-JJWfp8rp.mjs";
1
+ /*! @classytic/arc v2.37.1 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-NVzJrC-o.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.36.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.1 | 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.36.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.1 | 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.36.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.1 | 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.36.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-JJWfp8rp.mjs";
3
- import { t as startRenewingLease } from "./renewingLease-CgIGh0Ab.mjs";
1
+ /*! @classytic/arc v2.37.1 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-NVzJrC-o.mjs";
3
+ import { t as startRenewingLease } from "./renewingLease-C1-GAUpr.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.36.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.1 | 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.36.0 | MIT | https://classytic.com */
2
- import { o as toJsonSchema } from "./schemaConverter-gg0_aUPF.mjs";
1
+ /*! @classytic/arc v2.37.1 | MIT | https://classytic.com */
2
+ import { o as toJsonSchema } from "./schemaConverter-cXTayNOW.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.36.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.1 | 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.36.0 | MIT | https://classytic.com */
2
- import { t as parseJsonBody } from "../jsonBody-CiHih3ZU.mjs";
1
+ /*! @classytic/arc v2.37.1 | MIT | https://classytic.com */
2
+ import { t as parseJsonBody } from "../jsonBody-kApktjTc.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.36.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-B8lwJv9Q.mjs";
3
- import { n as elevation_default, t as elevationPlugin } from "../elevation-D_cmo80j.mjs";
4
- import { t as createTenantKeyGenerator } from "../rateLimitKey-Bma8VXDO.mjs";
5
- import { t as resolveOrgFromHeader } from "../scope-B1RsHdjF.mjs";
1
+ /*! @classytic/arc v2.37.1 | 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-khJmBErP.mjs";
3
+ import { n as elevation_default, t as elevationPlugin } from "../elevation-9X0lGzTQ.mjs";
4
+ import { t as createTenantKeyGenerator } from "../rateLimitKey-D4_rjP1K.mjs";
5
+ import { t as resolveOrgFromHeader } from "../scope-C2r7_WGs.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.36.0 | MIT | https://classytic.com */
2
- import { a as OrgAccessDeniedError, l as UnauthorizedError } from "./errors-DDKni6Tz.mjs";
3
- import { n as requireSingleHeaderValue } from "./headers-DKslnhey.mjs";
4
- import { n as getUserRoles } from "./userHelpers-xQAi5bPF.mjs";
1
+ /*! @classytic/arc v2.37.1 | MIT | https://classytic.com */
2
+ import { a as OrgAccessDeniedError, l as UnauthorizedError } from "./errors-CbxCF9M0.mjs";
3
+ import { n as requireSingleHeaderValue } from "./headers-DivLPMHe.mjs";
4
+ import { n as getUserRoles } from "./userHelpers-Bi97zMEl.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.36.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.1 | 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.36.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-JJWfp8rp.mjs";
1
+ /*! @classytic/arc v2.37.1 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-NVzJrC-o.mjs";
3
3
  import { arcLog } from "./logger/index.mjs";
4
- import { c as getOrgId, n as PUBLIC_SCOPE } from "./types-B8lwJv9Q.mjs";
5
- import { a as promoteStreamTokenToHeader } from "./streaming-CiTJW8kZ.mjs";
6
- import { t as openSseStream } from "./sseStream-BMHTLlhR.mjs";
4
+ import { c as getOrgId, n as PUBLIC_SCOPE } from "./types-khJmBErP.mjs";
5
+ import { a as promoteStreamTokenToHeader } from "./streaming-BxZDlH01.mjs";
6
+ import { t as openSseStream } from "./sseStream-nNPqvOeK.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.36.0 | MIT | https://classytic.com */
2
- import { n as forwardedStreamHeaders } from "./streaming-CiTJW8kZ.mjs";
1
+ /*! @classytic/arc v2.37.1 | MIT | https://classytic.com */
2
+ import { n as forwardedStreamHeaders } from "./streaming-BxZDlH01.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.36.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.1 | 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.36.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.1 | 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.36.0 | MIT | https://classytic.com */
2
- import { r as createEvent } from "./EventTransport-D23Uvhg4.mjs";
1
+ /*! @classytic/arc v2.37.1 | MIT | https://classytic.com */
2
+ import { r as createEvent } from "./EventTransport-CFdtK25P.mjs";
3
3
  //#region src/events/defineEvent.ts
4
4
  /**
5
5
  * Typed event declarations, a registry for introspection, and `.create()` to
@@ -1,3 +1,3 @@
1
- /*! @classytic/arc v2.36.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.1 | 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.36.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.1 | 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
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-DDD5RKTu.mjs";
6
- import "../index-C50BUxKs.mjs";
7
- import { n as preloadResourcesAsync, r as CreateAppOptions, t as preloadResources } from "../preloadResources-BuutdWgr.mjs";
4
+ import { V as ResourceDefinition } from "../index-BqRfP1kT.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-DHkyk3QN.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.36.0 | MIT | https://classytic.com */
2
- import { t as CRUD_OPERATIONS } from "../constants-DUoKAGYD.mjs";
3
- import { g as getUserId } from "../types-B8lwJv9Q.mjs";
4
- import { t as BaseController } from "../BaseController-CTJKm6Cb.mjs";
5
- import { t as defineResource } from "../defineResource-DWzjyxb2.mjs";
6
- import { t as defineAggregation } from "../defineAggregation-CpQfcM8R.mjs";
7
- import { E as requireOrgRole } from "../permissions-DgPrZsJh.mjs";
8
- import { a as createApp, n as preloadResourcesAsync, t as preloadResources } from "../preloadResources-CjnW4iIX.mjs";
9
- import { n as getModuleExports } from "../module-CQNHzE7g.mjs";
1
+ /*! @classytic/arc v2.37.1 | MIT | https://classytic.com */
2
+ import { t as CRUD_OPERATIONS } from "../constants-DDKf25s4.mjs";
3
+ import { g as getUserId } from "../types-khJmBErP.mjs";
4
+ import { t as BaseController } from "../BaseController-Chkf0Aiw.mjs";
5
+ import { t as defineAggregation } from "../defineAggregation-B1m-45Fe.mjs";
6
+ import { t as defineResource } from "../defineResource-DS3Uj2-8.mjs";
7
+ import { E as requireOrgRole } from "../permissions-DnAc6zoZ.mjs";
8
+ import { a as createApp, n as preloadResourcesAsync, t as preloadResources } from "../preloadResources-DJ7Lli0a.mjs";
9
+ import { n as getModuleExports } from "../module-CNKk_twm.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-CjnW4iIX.mjs").then((n) => n.o);
1507
+ const { createApp } = await import("../preloadResources-DJ7Lli0a.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.36.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.1 | 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.36.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.1 | 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.36.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.1 | 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.36.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.1 | 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
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";
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-BqRfP1kT.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.36.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.1 | MIT | https://classytic.com */
2
2
  export {};
@@ -1,2 +1,2 @@
1
- /*! @classytic/arc v2.36.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.1 | 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 {
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.36.0 | MIT | https://classytic.com */
2
- import { l as UnauthorizedError, o as OrgRequiredError } from "./errors-DDKni6Tz.mjs";
3
- import { n as requireSingleHeaderValue } from "./headers-DKslnhey.mjs";
4
- import { t as getUserId$1 } from "./userHelpers-xQAi5bPF.mjs";
1
+ /*! @classytic/arc v2.37.1 | MIT | https://classytic.com */
2
+ import { l as UnauthorizedError, o as OrgRequiredError } from "./errors-CbxCF9M0.mjs";
3
+ import { n as requireSingleHeaderValue } from "./headers-DivLPMHe.mjs";
4
+ import { t as getUserId$1 } from "./userHelpers-Bi97zMEl.mjs";
5
5
  //#region src/scope/types.ts
6
6
  /**
7
7
  * Request Scope — The One Standard
@@ -1,5 +1,5 @@
1
1
 
2
- import { V as ResourceDefinition } from "./index-C01wWGJt.mjs";
2
+ import { V as ResourceDefinition } from "./index-BqRfP1kT.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/integrations/mcp/types.d.ts
5
5
  /** Behavioral hints for MCP clients (tool annotations per MCP spec) */
Binary file
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.36.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.37.1 | MIT | https://classytic.com */
2
2
  //#region src/utils/userHelpers.ts
3
3
  /**
4
4
  * Extract a user ID from a user object. Accepts `id` or `_id` — returns
@@ -1,11 +1,11 @@
1
1
 
2
2
  import { F as getHeader, I as requireSingleHeaderValue, P as ArcHeaders } from "../types-Ddl9OjmE.mjs";
3
3
  import { f as getUserId, m as normalizeRoles, p as getUserRoles, t as AnyRecord } from "../base-C-NL2fTi.mjs";
4
- import { $ as OpenApiSchemas, S as QueryParserInterface, b as ParsedQuery } from "../index-C01wWGJt.mjs";
4
+ import { $ as OpenApiSchemas, S as QueryParserInterface, b as ParsedQuery } from "../index-BqRfP1kT.mjs";
5
5
  import { n as ErrorMapper } from "../errorHandler-DI5AN2b5.mjs";
6
6
  import { a as NotFoundError, c as RateLimitError, d as ValidationError, f as createDomainError, i as ForbiddenError, l as ServiceUnavailableError, m as isArcError, n as ConflictError, o as OrgAccessDeniedError, p as createError, r as ErrorOptions, s as OrgRequiredError, t as ArcError, u as UnauthorizedError } from "../errors-BGdVwP25.mjs";
7
- import { errorContractSchema, errorDetailSchema } from "@classytic/repo-core/errors";
8
7
  import { scheduleBackground } from "@classytic/repo-core/cache";
8
+ import { errorContractSchema, errorDetailSchema } from "@classytic/repo-core/errors";
9
9
  import { FastifyInstance, FastifyReply, FastifyRequest, RouteHandlerMethod } from "fastify";
10
10
  //#region src/utils/circuitBreaker.d.ts
11
11
  /**
@@ -1,12 +1,12 @@
1
- /*! @classytic/arc v2.36.0 | MIT | https://classytic.com */
2
- import { a as OrgAccessDeniedError, c as ServiceUnavailableError, d as createDomainError, f as createError, i as NotFoundError, l as UnauthorizedError, n as ConflictError, o as OrgRequiredError, p as isArcError, r as ForbiddenError, s as RateLimitError, t as ArcError, u as ValidationError } from "../errors-DDKni6Tz.mjs";
3
- import { n as requireSingleHeaderValue, t as getHeader } from "../headers-DKslnhey.mjs";
4
- import { n as getUserRoles, r as normalizeRoles, t as getUserId } from "../userHelpers-xQAi5bPF.mjs";
5
- import { t as simpleEqualityMatcher } from "../simpleEqualityMatcher-_9NAMHUD.mjs";
6
- import { A as createCircuitBreakerRegistry, C as defineCompensation, D as CircuitBreakerRegistry, E as CircuitBreakerError, O as CircuitState, S as defineErrorMapper, T as CircuitBreaker, _ as createQueryParser, a as deleteResponse, b as NEUTRAL_DIALECT, c as getDefaultCrudSchemas, d as listResponse, f as offsetListResponse, g as ArcQueryParser, h as responses, i as bareListResponse, k as createCircuitBreaker, l as getListQueryParams, m as queryParams, n as scheduleBackground, o as errorContractSchema, p as paginationSchema, r as aggregateListResponse, s as errorDetailSchema, t as createStateMachine, u as keysetListResponse, v as handleRaw, w as withCompensation, x as defineGuard, y as MONGO_DIALECT } from "../utils-DgNFsJ2c.mjs";
7
- import { n as declareRuntimeCapability } from "../runtimeCapabilities-jK99Ciw_.mjs";
8
- import { a as isZodSchema, i as isJsonSchema, n as convertRouteSchema, o as toJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-gg0_aUPF.mjs";
9
- import { a as promoteStreamTokenToHeader, i as pipeUIMessageStreamToReply, n as forwardedStreamHeaders, r as isReadableStream, t as UI_MESSAGE_STREAM_HEADERS } from "../streaming-CiTJW8kZ.mjs";
10
- import { t as openSseStream } from "../sseStream-BMHTLlhR.mjs";
11
- import { t as hasEvents } from "../typeGuards-IE1laMDf.mjs";
1
+ /*! @classytic/arc v2.37.1 | MIT | https://classytic.com */
2
+ import { a as OrgAccessDeniedError, c as ServiceUnavailableError, d as createDomainError, f as createError, i as NotFoundError, l as UnauthorizedError, n as ConflictError, o as OrgRequiredError, p as isArcError, r as ForbiddenError, s as RateLimitError, t as ArcError, u as ValidationError } from "../errors-CbxCF9M0.mjs";
3
+ import { n as requireSingleHeaderValue, t as getHeader } from "../headers-DivLPMHe.mjs";
4
+ import { n as getUserRoles, r as normalizeRoles, t as getUserId } from "../userHelpers-Bi97zMEl.mjs";
5
+ import { t as simpleEqualityMatcher } from "../simpleEqualityMatcher-Cr1F8jKZ.mjs";
6
+ import { A as scheduleBackground, C as paginationSchema, D as createQueryParser, E as ArcQueryParser, O as MONGO_DIALECT, S as offsetListResponse, T as responses, _ as errorDetailSchema, a as defineCompensation, b as keysetListResponse, c as CircuitBreakerError, d as createCircuitBreaker, f as createCircuitBreakerRegistry, g as errorContractSchema, h as deleteResponse, i as defineErrorMapper, k as NEUTRAL_DIALECT, l as CircuitBreakerRegistry, m as bareListResponse, n as handleRaw, o as withCompensation, p as aggregateListResponse, r as defineGuard, s as CircuitBreaker, t as createStateMachine, u as CircuitState, v as getDefaultCrudSchemas, w as queryParams, x as listResponse, y as getListQueryParams } from "../utils-WlLDIKuw.mjs";
7
+ import { a as isZodSchema, i as isJsonSchema, n as convertRouteSchema, o as toJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-cXTayNOW.mjs";
8
+ import { a as promoteStreamTokenToHeader, i as pipeUIMessageStreamToReply, n as forwardedStreamHeaders, r as isReadableStream, t as UI_MESSAGE_STREAM_HEADERS } from "../streaming-BxZDlH01.mjs";
9
+ import { n as declareRuntimeCapability } from "../runtimeCapabilities-OrGatf7r.mjs";
10
+ import { t as openSseStream } from "../sseStream-nNPqvOeK.mjs";
11
+ import { t as hasEvents } from "../typeGuards-BrXgbFi-.mjs";
12
12
  export { ArcError, ArcQueryParser, CircuitBreaker, CircuitBreakerError, CircuitBreakerRegistry, CircuitState, ConflictError, ForbiddenError, MONGO_DIALECT, NEUTRAL_DIALECT, NotFoundError, OrgAccessDeniedError, OrgRequiredError, RateLimitError, ServiceUnavailableError, UI_MESSAGE_STREAM_HEADERS, UnauthorizedError, ValidationError, aggregateListResponse, bareListResponse, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createDomainError, createError, createQueryParser, createStateMachine, declareRuntimeCapability, defineCompensation, defineErrorMapper, defineGuard, deleteResponse, errorContractSchema, errorDetailSchema, forwardedStreamHeaders, getDefaultCrudSchemas, getHeader, getListQueryParams, getUserId, getUserRoles, handleRaw, hasEvents, isArcError, isJsonSchema, isReadableStream, isZodSchema, keysetListResponse, listResponse, normalizeRoles, offsetListResponse, openSseStream, paginationSchema, pipeUIMessageStreamToReply, promoteStreamTokenToHeader, queryParams, requireSingleHeaderValue, responses, scheduleBackground, simpleEqualityMatcher, toJsonSchema, withCompensation };