@classytic/arc 2.37.0 → 2.38.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 (175) hide show
  1. package/dist/{BaseController-B5GZfUBy.mjs → BaseController-CYaDvmOB.mjs} +16 -15
  2. package/dist/{EventTransport-BEVP50ka.d.mts → EventTransport-Cx60_s-6.d.mts} +37 -0
  3. package/dist/{EventTransport-pGNNDQ__.mjs → EventTransport-Gq7JWbWw.mjs} +39 -7
  4. package/dist/{HookSystem-CuhHvcyZ.mjs → HookSystem-C0ikzqQf.mjs} +2 -2
  5. package/dist/{ResourceRegistry-DFOmazXg.mjs → ResourceRegistry-DPcX--zk.mjs} +2 -2
  6. package/dist/{actionPermissions-CQQrR4tu.mjs → actionPermissions-jlFZ1it4.mjs} +6 -6
  7. package/dist/audit/index.d.mts +1 -1
  8. package/dist/audit/index.mjs +2 -2
  9. package/dist/auth/audit.mjs +1 -1
  10. package/dist/auth/index.d.mts +1 -1
  11. package/dist/auth/index.mjs +79 -28
  12. package/dist/auth/redis-session.mjs +1 -1
  13. package/dist/{authorizationDecision-DgyWdav8.mjs → authorizationDecision-BP8GHtjc.mjs} +2 -2
  14. package/dist/{buildHandler-D2DkqtiY.mjs → buildHandler-DjXOqIvX.mjs} +4 -4
  15. package/dist/cache/index.mjs +4 -4
  16. package/dist/{caching-BmC2T-pX.mjs → caching-a3ZEcJJs.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-CUpamQMJ.mjs → constants-BONghE1Y.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-C8GWw-Iu.mjs → core-8She7FgF.mjs} +3 -3
  32. package/dist/{createActionRouter-CwDU_j2S.mjs → createActionRouter-Bqi6Bhhx.mjs} +7 -7
  33. package/dist/{createAggregationRouter-d057xXX1.mjs → createAggregationRouter-BsYO7ktd.mjs} +7 -7
  34. package/dist/{defineAggregation-cCitY2FA.mjs → defineAggregation-0KBvqEEC.mjs} +1 -1
  35. package/dist/{defineResource-WcbE1kJL.mjs → defineResource-BMdyRelW.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-Bc6Gafv9.mjs → elevation-C6woysGC.mjs} +4 -4
  40. package/dist/encryption/index.mjs +3 -3
  41. package/dist/{errorHandler-CB75oY5i.mjs → errorHandler-BdmIWPba.mjs} +4 -4
  42. package/dist/{errors-DsdZc1Xv.mjs → errors-2ExmOgIJ.mjs} +1 -1
  43. package/dist/{eventPlugin-B47sfCJ8.d.mts → eventPlugin-DFvHa4Nf.d.mts} +10 -1
  44. package/dist/{eventPlugin-DEIfV1iC.mjs → eventPlugin-DJwpGMzx.mjs} +6 -6
  45. package/dist/events/index.d.mts +4 -4
  46. package/dist/events/index.mjs +5 -5
  47. package/dist/events/transports/redis-stream-entry.d.mts +1 -1
  48. package/dist/events/transports/redis-stream-entry.mjs +1 -1
  49. package/dist/events/transports/redis.d.mts +1 -1
  50. package/dist/events/transports/redis.mjs +1 -1
  51. package/dist/factory/index.d.mts +4 -4
  52. package/dist/factory/index.mjs +5 -5
  53. package/dist/{fastify-augmentation-CdY8FINU.d.mts → fastify-augmentation-jYA2oHyL.d.mts} +3 -3
  54. package/dist/{fields-DvGz47Ul.mjs → fields-Cha2QCKH.mjs} +37 -2
  55. package/dist/{generate-D7CIIWhS.mjs → generate-BUP4Oydg.mjs} +2 -2
  56. package/dist/{headers-BFu1st_i.mjs → headers-DeXNifVj.mjs} +2 -2
  57. package/dist/{health-Cc_sb94d.mjs → health-Bh0N_FLk.mjs} +1 -1
  58. package/dist/hooks/index.d.mts +1 -1
  59. package/dist/hooks/index.mjs +2 -2
  60. package/dist/idempotency/index.mjs +4 -4
  61. package/dist/idempotency/redis.mjs +1 -1
  62. package/dist/{index-C01wWGJt.d.mts → index-B78WZom8.d.mts} +11 -2
  63. package/dist/{index-du18bJjH.d.mts → index-BRoDtjek.d.mts} +2 -4
  64. package/dist/{index-DCxxRwLC.d.mts → index-D2uIUSQk.d.mts} +1 -1
  65. package/dist/index.d.mts +3 -3
  66. package/dist/index.mjs +11 -11
  67. package/dist/{init-BMgU1wYR.mjs → init-Dg_Am2o_.mjs} +1 -1
  68. package/dist/integrations/event-gateway.d.mts +1 -1
  69. package/dist/integrations/event-gateway.mjs +2 -2
  70. package/dist/integrations/index.d.mts +1 -1
  71. package/dist/integrations/index.mjs +1 -1
  72. package/dist/integrations/jobs/index.mjs +2 -2
  73. package/dist/integrations/mcp/index.d.mts +2 -2
  74. package/dist/integrations/mcp/index.mjs +2 -2
  75. package/dist/integrations/mcp/testing.d.mts +1 -1
  76. package/dist/integrations/mcp/testing.mjs +2 -2
  77. package/dist/integrations/streamline.mjs +3 -3
  78. package/dist/integrations/webhooks.d.mts +2 -2
  79. package/dist/integrations/webhooks.mjs +3 -3
  80. package/dist/integrations/websocket-pushref-redis.mjs +1 -1
  81. package/dist/integrations/websocket-redis.mjs +1 -1
  82. package/dist/integrations/websocket.mjs +1 -1
  83. package/dist/{interface-CaPVHoVJ.mjs → interface-DYPVscCU.mjs} +1 -1
  84. package/dist/{jsonBody-BuzxOZV8.mjs → jsonBody-DVui0uJl.mjs} +2 -2
  85. package/dist/{keys-DoUI9-yP.mjs → keys-BSuxGS-B.mjs} +1 -1
  86. package/dist/{loadResources-CPlRWJCv.mjs → loadResources-CNd1DWnK.mjs} +2 -2
  87. package/dist/{loadResourcesFromEntry-CPCZiX9n.mjs → loadResourcesFromEntry-DNj8cpiY.mjs} +2 -2
  88. package/dist/logger/index.mjs +1 -1
  89. package/dist/{mcpPlugin-dxMxBPIg.mjs → mcpPlugin-KWsezMx7.mjs} +15 -15
  90. package/dist/{memory-BnafVem_.mjs → memory-BiPVaCPg.mjs} +2 -2
  91. package/dist/{metrics-CeAIcVMY.mjs → metrics-CsWaIVTa.mjs} +2 -2
  92. package/dist/middleware/index.d.mts +1 -1
  93. package/dist/middleware/index.mjs +3 -3
  94. package/dist/migrations/index.mjs +2 -2
  95. package/dist/{module-DIvG8qOg.mjs → module-BQXHxMEk.mjs} +1 -1
  96. package/dist/{multipartBody-BVCoaTwu.mjs → multipartBody-u6VrS_iH.mjs} +1 -1
  97. package/dist/{openapi-D_i6CifU.mjs → openapi-Dxc8RLy_.mjs} +6 -6
  98. package/dist/outbox-admin/index.d.mts +1 -1
  99. package/dist/outbox-admin/index.mjs +4 -4
  100. package/dist/{outbox-module-BbdaMyqy.d.mts → outbox-module-CQXu_O6o.d.mts} +2 -2
  101. package/dist/{outbox-module-CKaLL5BH.mjs → outbox-module-DyIqA5vo.mjs} +4 -4
  102. package/dist/permissions/index.mjs +5 -5
  103. package/dist/{permissions-DWkl60hx.mjs → permissions-H7Zcb82Z.mjs} +6 -6
  104. package/dist/{pipe-Dbs3GhOZ.mjs → pipe-SunhEaZ6.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-DgaYX91M.mjs → pluralize-Da7IT_qJ.mjs} +1 -1
  112. package/dist/{preloadResources-BYFfYnjZ.d.mts → preloadResources-BbBkNkqK.d.mts} +6 -6
  113. package/dist/{preloadResources-BUoGKPaS.mjs → preloadResources-DlhH81py.mjs} +21 -21
  114. package/dist/presets/filesUpload.d.mts +1 -1
  115. package/dist/presets/filesUpload.mjs +5 -5
  116. package/dist/presets/index.d.mts +1 -1
  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 +1 -1
  121. package/dist/presets/search.mjs +2 -2
  122. package/dist/{presets-Gbv9mNKD.mjs → presets-CNyfaxGL.mjs} +4 -4
  123. package/dist/{projection-BunxoeON.mjs → projection-DSfEoooA.mjs} +2 -2
  124. package/dist/{queryCachePlugin-BYqmg89O.mjs → queryCachePlugin-oTsmVyEQ.mjs} +5 -5
  125. package/dist/{rateLimitKey-DlqmDHA5.mjs → rateLimitKey-CewdR-m6.mjs} +1 -1
  126. package/dist/{realtime-CiAp2-LH.mjs → realtime-CPmjjgqd.mjs} +9 -9
  127. package/dist/{redis-stream-mwLWlfHG.d.mts → redis-stream-eh0eOtjh.d.mts} +1 -1
  128. package/dist/{registerRoute-dnf-JJf-.mjs → registerRoute-XvcI_3sh.mjs} +10 -6
  129. package/dist/registry/index.d.mts +2 -2
  130. package/dist/registry/index.mjs +3 -3
  131. package/dist/{registry-ByC0UFNS.mjs → registry-UFEJQN8R.mjs} +2 -2
  132. package/dist/{renewingLease-C5Ta_ImD.mjs → renewingLease-DuRGVOMe.mjs} +1 -1
  133. package/dist/{replyHelpers-D1k0wHoO.mjs → replyHelpers-BHebarf0.mjs} +2 -2
  134. package/dist/{requestContext-DGM7EZRI.mjs → requestContext-DpmntRZy.mjs} +1 -1
  135. package/dist/{rolldown-runtime-DrZrabOW.mjs → rolldown-runtime-Add2L50I.mjs} +1 -1
  136. package/dist/{runtimeCapabilities-c4Sc85X-.mjs → runtimeCapabilities-D793Pxci.mjs} +1 -1
  137. package/dist/{schedules-CVtolEa-.mjs → schedules-DthM8Qag.mjs} +3 -3
  138. package/dist/{schemaConverter-C8zbW7tJ.mjs → schemaConverter-Db-MMsH6.mjs} +1 -1
  139. package/dist/{schemaIR-BfI425RH.mjs → schemaIR-CIXShch7.mjs} +2 -2
  140. package/dist/schemas/index.mjs +1 -1
  141. package/dist/scim/index.mjs +2 -2
  142. package/dist/scope/index.mjs +5 -5
  143. package/dist/{scope-DFSOKc4T.mjs → scope-D03sk17n.mjs} +4 -4
  144. package/dist/{simpleEqualityMatcher-Bhp7WrRF.mjs → simpleEqualityMatcher-B7qVjQBv.mjs} +1 -1
  145. package/dist/{sse-vRuwDd6N.mjs → sse-D4MYqkic.mjs} +5 -5
  146. package/dist/{sseStream-cWezGOk1.mjs → sseStream-BuMNPR6r.mjs} +2 -2
  147. package/dist/{store-helpers-bU8H5c-A.mjs → store-helpers-CIF4RG8s.mjs} +1 -1
  148. package/dist/{streaming-weWcFCk4.mjs → streaming-DkpW1HwJ.mjs} +1 -1
  149. package/dist/{subscribe-helpers-BrcG3NlV.mjs → subscribe-helpers-CBZOi6pk.mjs} +2 -2
  150. package/dist/sync/changelog.mjs +1 -1
  151. package/dist/testing/cleanupStoreContract.mjs +1 -1
  152. package/dist/testing/index.d.mts +4 -4
  153. package/dist/testing/index.mjs +10 -10
  154. package/dist/testing/outboxStoreContract.mjs +1 -1
  155. package/dist/testing/storageContract.mjs +1 -1
  156. package/dist/{transactionContext-Ca5peQpc.mjs → transactionContext-DMmvcfdo.mjs} +1 -1
  157. package/dist/{typeGuards-ALWme5WB.mjs → typeGuards-DHTnEs5X.mjs} +1 -1
  158. package/dist/types/index.d.mts +1 -1
  159. package/dist/types/index.mjs +1 -1
  160. package/dist/types/storage.mjs +1 -1
  161. package/dist/{types-BMa2EPtv.d.mts → types-BRU-Kd3t.d.mts} +1 -1
  162. package/dist/{types-lDs9oF4z.mjs → types-BqLyyH0o.mjs} +4 -4
  163. package/dist/{types-BXnTOsXP.d.mts → types-LQFwC37d.d.mts} +1 -1
  164. package/dist/usage/index.mjs +0 -0
  165. package/dist/{userHelpers-DU_Z5OBA.mjs → userHelpers-CXySQFRg.mjs} +1 -1
  166. package/dist/utils/index.d.mts +2 -2
  167. package/dist/utils/index.mjs +11 -11
  168. package/dist/{utils-sXGFLegw.mjs → utils-BbGG8XNT.mjs} +1230 -1230
  169. package/dist/{validate-qK_-7MVk.mjs → validate-CidSeUrx.mjs} +2 -2
  170. package/dist/{versioning-DEs-_hFi.d.mts → versioning-B843jOYX.d.mts} +1 -1
  171. package/dist/{versioning-Dtw0MyX4.mjs → versioning-C2r0eOZ4.mjs} +3 -3
  172. package/package.json +11 -9
  173. package/skills/arc/references/auth.md +5 -2
  174. package/skills/arc/references/production.md +733 -733
  175. package/skills/arc-code-review/references/migration-recipes.md +16 -7
@@ -1,15 +1,15 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
- import { h as SYSTEM_FIELDS, o as DEFAULT_TENANT_FIELD } from "./constants-CUpamQMJ.mjs";
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
+ import { h as SYSTEM_FIELDS, o as DEFAULT_TENANT_FIELD } from "./constants-BONghE1Y.mjs";
3
3
  import { arcLog } from "./logger/index.mjs";
4
- import { a as conjoinPolicyFilters } from "./authorizationDecision-DgyWdav8.mjs";
5
- import { d as createDomainError, f as createError, i as NotFoundError, p as isArcError, r as ForbiddenError } from "./errors-DsdZc1Xv.mjs";
6
- import { n as getUserRoles, t as getUserId } from "./userHelpers-DU_Z5OBA.mjs";
7
- import { b as isElevated, c as getOrgId, n as PUBLIC_SCOPE, x as isMember } from "./types-lDs9oF4z.mjs";
8
- import { t as simpleEqualityMatcher } from "./simpleEqualityMatcher-Bhp7WrRF.mjs";
9
- import { i as resolveEffectiveRoles, n as applyFieldWritePermissions } from "./fields-DvGz47Ul.mjs";
10
- import { g as ArcQueryParser, n as scheduleBackground } from "./utils-sXGFLegw.mjs";
11
- import { t as buildQueryKey } from "./keys-DoUI9-yP.mjs";
12
- import { t as transactionContext } from "./transactionContext-Ca5peQpc.mjs";
4
+ import { a as conjoinPolicyFilters } from "./authorizationDecision-BP8GHtjc.mjs";
5
+ import { d as createDomainError, f as createError, i as NotFoundError, p as isArcError, r as ForbiddenError } from "./errors-2ExmOgIJ.mjs";
6
+ import { n as getUserRoles, t as getUserId } from "./userHelpers-CXySQFRg.mjs";
7
+ import { b as isElevated, c as getOrgId, n as PUBLIC_SCOPE, x as isMember } from "./types-BqLyyH0o.mjs";
8
+ import { t as simpleEqualityMatcher } from "./simpleEqualityMatcher-B7qVjQBv.mjs";
9
+ import { t as buildQueryKey } from "./keys-BSuxGS-B.mjs";
10
+ import { t as transactionContext } from "./transactionContext-DMmvcfdo.mjs";
11
+ import { A as scheduleBackground, E as ArcQueryParser } from "./utils-BbGG8XNT.mjs";
12
+ import { a as resolveEffectiveRoles, n as applyFieldWritePermissions } from "./fields-Cha2QCKH.mjs";
13
13
  import { policyRecordToFilter } from "@classytic/repo-core/filter";
14
14
  import { retryingTransaction } from "@classytic/repo-core/repository";
15
15
  import { isProductionEnv } from "@classytic/primitives/environment";
@@ -944,26 +944,27 @@ var QueryResolver = class {
944
944
  * Mongoose uses space-separated strings, SQL adapters may use arrays.
945
945
  */
946
946
  sanitizeSelectAny(select, schemaOptions) {
947
- if (!select) return void 0;
948
947
  const blockedFields = this.getBlockedFields(schemaOptions);
949
948
  if (blockedFields.length === 0) return select;
949
+ const exclusion = () => Object.fromEntries(blockedFields.map((field) => [field, 0]));
950
+ if (!select) return exclusion();
950
951
  if (typeof select === "object" && !Array.isArray(select)) {
951
952
  const sanitized = {};
952
953
  for (const [field, val] of Object.entries(select)) if (!blockedFields.includes(field)) sanitized[field] = val;
953
- return Object.keys(sanitized).length > 0 ? sanitized : void 0;
954
+ return Object.keys(sanitized).length > 0 ? sanitized : exclusion();
954
955
  }
955
956
  if (Array.isArray(select)) {
956
957
  const sanitized = select.filter((f) => {
957
958
  const fieldName = f.replace(/^-/, "");
958
959
  return !blockedFields.includes(fieldName);
959
960
  });
960
- return sanitized.length > 0 ? sanitized : void 0;
961
+ return sanitized.length > 0 ? sanitized : exclusion();
961
962
  }
962
963
  const sanitized = select.split(/[\s,]+/).filter(Boolean).filter((f) => {
963
964
  const fieldName = f.replace(/^-/, "");
964
965
  return !blockedFields.includes(fieldName);
965
966
  });
966
- return sanitized.length > 0 ? sanitized.join(" ") : void 0;
967
+ return sanitized.length > 0 ? sanitized.join(" ") : exclusion();
967
968
  }
968
969
  /** Sanitize populate fields */
969
970
  sanitizePopulate(populate, schemaOptions) {
@@ -19,6 +19,41 @@ interface MemoryEventTransportOptions {
19
19
  * handlers must be idempotent. Every handler runs before the rejection.
20
20
  */
21
21
  onHandlerError?: "log" | "throw";
22
+ /**
23
+ * Whether independent subscribers run one at a time or together.
24
+ *
25
+ * - `'sequential'` (default) — handler N+1 starts after handler N settles.
26
+ * - `'parallel'` — all matching handlers start together; `publish()` resolves
27
+ * when the last settles.
28
+ *
29
+ * Same delivery and the same failure semantics either way: every handler
30
+ * still receives the event, every failure is still collected, and `'throw'`
31
+ * still rejects with one `AggregateError` after all of them have run.
32
+ *
33
+ * **Opting in requires an AUDIT, not an assumption.** Every other transport
34
+ * in this package runs matching handlers sequentially in registration order
35
+ * (`redis-stream.ts` states it outright; `redis.ts` implements it), so an app
36
+ * relying on that order is relying on documented behaviour — switching this
37
+ * on is what breaks it, and swapping to a broker would not have surfaced it.
38
+ * Confirm no subscriber reads another subscriber's write before enabling.
39
+ *
40
+ * Measured on one order placement: 6 subscribers, each spending most of its
41
+ * time on its own round trips, cost 2.8s sequentially — the length of the
42
+ * QUEUE, not of the work.
43
+ */
44
+ handlerDispatch?: "sequential" | "parallel";
45
+ /**
46
+ * Cap on handlers running at once under `'parallel'`. Default: unlimited.
47
+ *
48
+ * Sequential dispatch was an accidental per-publish rate limiter on whatever
49
+ * pool the handlers share; removing it converts a latency problem into a
50
+ * saturation one when several publishes overlap. `RedisStreamTransport`
51
+ * exposes `processingConcurrency` for the same reason — this is its peer, so
52
+ * an operator has a dial rather than only "queued" or "all at once".
53
+ *
54
+ * Ignored under `'sequential'`, which is already a concurrency of 1.
55
+ */
56
+ handlerConcurrency?: number;
22
57
  }
23
58
  /**
24
59
  * In-memory event transport (default).
@@ -32,6 +67,8 @@ declare class MemoryEventTransport implements EventTransport {
32
67
  private handlers;
33
68
  private logger;
34
69
  private onHandlerError;
70
+ private handlerDispatch;
71
+ private handlerConcurrency;
35
72
  constructor(options?: MemoryEventTransportOptions);
36
73
  publish(event: DomainEvent): Promise<void>;
37
74
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
2
  import { createEvent, matchEventPattern } from "@classytic/primitives/events";
3
3
  //#region src/events/EventTransport.ts
4
4
  /**
@@ -79,20 +79,52 @@ var MemoryEventTransport = class {
79
79
  handlers = /* @__PURE__ */ new Map();
80
80
  logger;
81
81
  onHandlerError;
82
+ handlerDispatch;
83
+ handlerConcurrency;
82
84
  constructor(options) {
83
85
  this.logger = options?.logger ?? console;
84
86
  this.onHandlerError = options?.onHandlerError ?? "log";
87
+ this.handlerDispatch = options?.handlerDispatch ?? "sequential";
88
+ const cap = options?.handlerConcurrency;
89
+ if (cap !== void 0 && (!Number.isInteger(cap) || cap < 1)) throw new TypeError(`MemoryEventTransport: handlerConcurrency must be a positive integer, received ${String(cap)}`);
90
+ this.handlerConcurrency = cap ?? Number.POSITIVE_INFINITY;
85
91
  }
86
92
  async publish(event) {
87
93
  const allHandlers = /* @__PURE__ */ new Set();
88
94
  for (const [pattern, handlers] of this.handlers) if (matchEventPattern(pattern, event.type)) for (const h of handlers) allHandlers.add(h);
89
95
  const failures = [];
90
- for (const handler of allHandlers) try {
91
- await handler(event);
92
- } catch (err) {
93
- this.logger.error(`[EventTransport] Handler error for ${event.type}:`, err);
94
- failures.push(err);
95
- }
96
+ const run = async (handler) => {
97
+ try {
98
+ await handler(event);
99
+ } catch (err) {
100
+ failures.push(err);
101
+ try {
102
+ this.logger.error(`[EventTransport] Handler error for ${event.type}:`, err);
103
+ } catch {}
104
+ }
105
+ };
106
+ if (this.handlerDispatch === "parallel") {
107
+ /**
108
+ * `allSettled`, not `all`. Correctness must not rest on `run` never
109
+ * rejecting: `all` short-circuits on the first rejection and resolves
110
+ * `publish()` while the other handlers are still in flight — detached
111
+ * work racing the outbox relay's redelivery of the same event. `run` is
112
+ * written not to reject, and `allSettled` means the next person to add a
113
+ * timeout or a metric to it cannot silently break that.
114
+ */
115
+ const pending = [...allHandlers];
116
+ if (this.handlerConcurrency >= pending.length) await Promise.allSettled(pending.map(run));
117
+ else {
118
+ let next = 0;
119
+ const worker = async () => {
120
+ while (next < pending.length) {
121
+ const handler = pending[next++];
122
+ if (handler) await run(handler);
123
+ }
124
+ };
125
+ await Promise.allSettled(Array.from({ length: this.handlerConcurrency }, worker));
126
+ }
127
+ } else for (const handler of allHandlers) await run(handler);
96
128
  /**
97
129
  * Rejecting is what lets an OUTBOX see the failure. With this transport,
98
130
  * `publish()` IS the handling — synchronous and in-process — so resolving
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
- import { t as buildRequestScopeProjection } from "./projection-BunxoeON.mjs";
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
+ import { t as buildRequestScopeProjection } from "./projection-DSfEoooA.mjs";
3
3
  //#region src/hooks/HookSystem.ts
4
4
  /**
5
5
  * Hook System
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
- import "./constants-CUpamQMJ.mjs";
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
+ import "./constants-BONghE1Y.mjs";
3
3
  //#region src/registry/ResourceRegistry.ts
4
4
  /**
5
5
  * Resource Registry
@@ -1,9 +1,9 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
- import { n as getUserRoles } from "./userHelpers-DU_Z5OBA.mjs";
3
- import { b as isElevated, n as PUBLIC_SCOPE, x as isMember } from "./types-lDs9oF4z.mjs";
4
- import { i as resolveEffectiveRoles, t as applyFieldReadPermissions } from "./fields-DvGz47Ul.mjs";
5
- import { t as executePipeline } from "./pipe-Dbs3GhOZ.mjs";
6
- import { t as buildRequestScopeProjection } from "./projection-BunxoeON.mjs";
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
+ import { n as getUserRoles } from "./userHelpers-CXySQFRg.mjs";
3
+ import { b as isElevated, n as PUBLIC_SCOPE, x as isMember } from "./types-BqLyyH0o.mjs";
4
+ import { a as resolveEffectiveRoles, t as applyFieldReadPermissions } from "./fields-Cha2QCKH.mjs";
5
+ import { t as buildRequestScopeProjection } from "./projection-DSfEoooA.mjs";
6
+ import { t as executePipeline } from "./pipe-SunhEaZ6.mjs";
7
7
  import { isPaginatedResult, toCanonicalList } from "@classytic/repo-core/pagination";
8
8
  //#region src/core/fastifyAdapter.ts
9
9
  /** Type guard for Mongoose-like documents with toObject() */
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { d as UserBase } from "../base-C-NL2fTi.mjs";
3
- import "../index-C01wWGJt.mjs";
3
+ import "../index-B78WZom8.mjs";
4
4
  import { FastifyPluginAsync } from "fastify";
5
5
  import { RepositoryLike } from "@classytic/repo-core/adapter";
6
6
  //#region src/audit/stores/interface.d.ts
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
- import { t as transactionContext } from "../transactionContext-Ca5peQpc.mjs";
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
+ import { t as transactionContext } from "../transactionContext-DMmvcfdo.mjs";
3
3
  import { and, anyOf, eq, gte, lt, lte } from "@classytic/repo-core/filter";
4
4
  import fp from "fastify-plugin";
5
5
  //#region src/audit/repository-audit-adapter.ts
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
2
  //#region src/auth/audit.ts
3
3
  function compileGlobs(patterns) {
4
4
  if (patterns.length === 0) return () => false;
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { l as PermissionCheck } from "../base-C-NL2fTi.mjs";
3
- import { Ft as AuthPluginOptions, Pt as AuthHelpers } from "../index-C01wWGJt.mjs";
3
+ import { Ft as AuthPluginOptions, Pt as AuthHelpers } from "../index-B78WZom8.mjs";
4
4
  import { t as ExternalOpenApiPaths } from "../externalPaths-CmGOxOtD.mjs";
5
5
  import { a as SessionManagerOptions, c as createSessionManager, i as SessionData, n as MemorySessionStoreOptions, o as SessionManagerResult, r as SessionCookieOptions, s as SessionStore, t as MemorySessionStore } from "../sessionManager-qimlKV0P.mjs";
6
6
  import { FastifyPluginAsync, FastifyReply as FastifyReply$1, FastifyRequest } from "fastify";
@@ -1,9 +1,9 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
- import { d as createDomainError, l as UnauthorizedError, p as isArcError, t as ArcError } from "../errors-DsdZc1Xv.mjs";
3
- import { n as requireSingleHeaderValue } from "../headers-BFu1st_i.mjs";
4
- import { n as getUserRoles, r as normalizeRoles } from "../userHelpers-DU_Z5OBA.mjs";
5
- import { o as toJsonSchema } from "../schemaConverter-C8zbW7tJ.mjs";
6
- import { E as requireOrgRole, T as requireOrgMembership, k as requireTeamMembership } from "../permissions-DWkl60hx.mjs";
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
+ import { d as createDomainError, l as UnauthorizedError, p as isArcError, t as ArcError } from "../errors-2ExmOgIJ.mjs";
3
+ import { n as requireSingleHeaderValue } from "../headers-DeXNifVj.mjs";
4
+ import { n as getUserRoles, r as normalizeRoles } from "../userHelpers-CXySQFRg.mjs";
5
+ import { o as toJsonSchema } from "../schemaConverter-Db-MMsH6.mjs";
6
+ import { E as requireOrgRole, T as requireOrgMembership, k as requireTeamMembership } from "../permissions-H7Zcb82Z.mjs";
7
7
  import { isProductionEnv } from "@classytic/primitives/environment";
8
8
  import { createHmac, randomUUID, timingSafeEqual } from "node:crypto";
9
9
  import fp from "fastify-plugin";
@@ -668,19 +668,30 @@ async function getMemberRolesByOrg(auth, headers, organizationId) {
668
668
  }
669
669
  }
670
670
  /**
671
- * List teams the current user is a member of. Used to validate
672
- * `activeTeamId` against the membership set before binding it to scope.
671
+ * Teams the current user is a MEMBER of, scoped to one organization. Used to
672
+ * validate `activeTeamId` before binding it to scope.
673
673
  *
674
- * Better Auth 1.6+ exposes this as `auth.api.listUserTeams` (path:
675
- * `/organization/list-user-teams`). Older 1.5.x exposed
676
- * `auth.api.listTeams` — kept as a fallback so stubs/older versions still
677
- * work.
674
+ * `auth.api.listUserTeams` (`/organization/list-user-teams`) is the only name
675
+ * probed. A `listTeams` fallback lived here for "older 1.5.x" and was removed:
676
+ * Better Auth exposes `listUserTeams` and `listOrganizationTeams` on `auth.api`
677
+ * and has never exposed a bare `listTeams` — that is the CLIENT name
678
+ * (`authClient.organization.listTeams`). It could only ever resolve against a
679
+ * test double, which is exactly what it was doing.
680
+ *
681
+ * Do not "restore" it as `listOrganizationTeams`: that endpoint lists every team
682
+ * in the organization, while this one lists the teams the USER belongs to.
683
+ * Validating `activeTeamId` against the org-wide list would admit a team the
684
+ * user is not a member of — the organization check below constrains the org, not
685
+ * membership.
678
686
  */
679
- async function listTeamsDirect(auth, headers) {
680
- const fn = pickApiMethod(auth, "listUserTeams", "organization") ?? pickApiMethod(auth, "listTeams", "organization");
687
+ async function listTeamsDirect(auth, headers, organizationId) {
688
+ const fn = pickApiMethod(auth, "listUserTeams", "organization");
681
689
  if (!fn) return null;
682
690
  try {
683
- const result = await fn({ headers });
691
+ const result = await fn({
692
+ headers,
693
+ query: { organizationId }
694
+ });
684
695
  const teams = Array.isArray(result) ? result : result?.teams;
685
696
  return Array.isArray(teams) ? teams : null;
686
697
  } catch {
@@ -720,6 +731,11 @@ function extractRolesFromMembership(membership) {
720
731
  }
721
732
  return [];
722
733
  }
734
+ async function resolveActiveTeamId(input) {
735
+ const activeTeamId = normalizeId(input.session?.activeTeamId);
736
+ if (!activeTeamId) return void 0;
737
+ return (await listTeamsDirect(input.auth, input.headers, input.activeOrgId))?.find((team) => normalizeId(team.id ?? team._id) === activeTeamId && normalizeId(team.organizationId) === input.activeOrgId) ? activeTeamId : void 0;
738
+ }
723
739
  /**
724
740
  * Create a Better Auth adapter for Arc/Fastify.
725
741
  *
@@ -786,7 +802,18 @@ function createBetterAuthAdapter(options) {
786
802
  const requestedOrgId = requireSingleHeaderValue(request.headers, "x-organization-id");
787
803
  const activeOrgId = session?.activeOrganizationId || requestedOrgId;
788
804
  if (activeOrgId) {
789
- let orgRoles = await getActiveMemberRoles(auth, headers);
805
+ /**
806
+ * `getActiveMember` resolves the member for the SESSION's active
807
+ * organization, so with no `activeOrganizationId` it cannot succeed —
808
+ * it throws `No active organization`, which the helper swallows into
809
+ * `null` after paying the full endpoint round trip.
810
+ *
811
+ * A bearer-only deployment never calls `setActive`, so that was every
812
+ * request: ~440ms spent to learn what the session already said, before
813
+ * the ~870ms header-based lookup that actually answers. Ask the
814
+ * session first; it is already in hand.
815
+ */
816
+ let orgRoles = session?.activeOrganizationId ? await getActiveMemberRoles(auth, headers) : null;
790
817
  if (!orgRoles) orgRoles = await getMemberRolesByOrg(auth, headers, activeOrgId);
791
818
  if (orgRoles) {
792
819
  const scope = {
@@ -796,10 +823,13 @@ function createBetterAuthAdapter(options) {
796
823
  organizationId: activeOrgId,
797
824
  orgRoles
798
825
  };
799
- const activeTeamId = session?.activeTeamId;
800
- if (activeTeamId) {
801
- if ((await listTeamsDirect(auth, headers))?.some((t) => normalizeId(t.id) === activeTeamId)) scope.teamId = activeTeamId;
802
- }
826
+ const activeTeamId = await resolveActiveTeamId({
827
+ auth,
828
+ headers,
829
+ session,
830
+ activeOrgId
831
+ });
832
+ if (activeTeamId) scope.teamId = activeTeamId;
803
833
  req.scope = scope;
804
834
  }
805
835
  }
@@ -843,15 +873,36 @@ function createBetterAuthAdapter(options) {
843
873
  const requestedOrgId = requireSingleHeaderValue(request.headers, "x-organization-id");
844
874
  const activeOrgId = session?.activeOrganizationId || requestedOrgId;
845
875
  if (activeOrgId) {
846
- let orgRoles = await getActiveMemberRoles(auth, headers);
876
+ /**
877
+ * `getActiveMember` resolves the member for the SESSION's active
878
+ * organization, so with no `activeOrganizationId` it cannot succeed —
879
+ * it throws `No active organization`, which the helper swallows into
880
+ * `null` after paying the full endpoint round trip.
881
+ *
882
+ * A bearer-only deployment never calls `setActive`, so that was every
883
+ * request: ~440ms spent to learn what the session already said, before
884
+ * the ~870ms header-based lookup that actually answers. Ask the
885
+ * session first; it is already in hand.
886
+ */
887
+ let orgRoles = session?.activeOrganizationId ? await getActiveMemberRoles(auth, headers) : null;
847
888
  if (!orgRoles) orgRoles = await getMemberRolesByOrg(auth, headers, activeOrgId);
848
- if (orgRoles) req.scope = {
849
- kind: "member",
850
- userId: optUserId,
851
- userRoles: optUserRoles,
852
- organizationId: activeOrgId,
853
- orgRoles
854
- };
889
+ if (orgRoles) {
890
+ const scope = {
891
+ kind: "member",
892
+ userId: optUserId,
893
+ userRoles: optUserRoles,
894
+ organizationId: activeOrgId,
895
+ orgRoles
896
+ };
897
+ const activeTeamId = await resolveActiveTeamId({
898
+ auth,
899
+ headers,
900
+ session,
901
+ activeOrgId
902
+ });
903
+ if (activeTeamId) scope.teamId = activeTeamId;
904
+ req.scope = scope;
905
+ }
855
906
  }
856
907
  }
857
908
  } catch (err) {
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
2
  import sjson from "secure-json-parse";
3
3
  //#region src/auth/redis-session.ts
4
4
  /**
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
2
  import { arcLog } from "./logger/index.mjs";
3
- import { t as ArcError } from "./errors-DsdZc1Xv.mjs";
3
+ import { t as ArcError } from "./errors-2ExmOgIJ.mjs";
4
4
  //#region src/permissions/filter-merge.ts
5
5
  /**
6
6
  * Policy-filter composition — logical AND, never last-writer-wins.
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
- import { a as conjoinPolicyFilters } from "./authorizationDecision-DgyWdav8.mjs";
3
- import { g as toRepositoryFilter } from "./BaseController-B5GZfUBy.mjs";
4
- import { i as compileAggRequest, t as adapterSupportsAggregate } from "./validate-qK_-7MVk.mjs";
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
+ import { a as conjoinPolicyFilters } from "./authorizationDecision-BP8GHtjc.mjs";
3
+ import { g as toRepositoryFilter } from "./BaseController-CYaDvmOB.mjs";
4
+ import { i as compileAggRequest, t as adapterSupportsAggregate } from "./validate-CidSeUrx.mjs";
5
5
  //#region src/core/aggregation/buildHandler.ts
6
6
  /**
7
7
  * Framework-agnostic aggregation execution. Runs safety guards,
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
- import { i as versionKey, n as hashParams, r as tagVersionKey, t as buildQueryKey } from "../keys-DoUI9-yP.mjs";
3
- import { t as MemoryCacheStore } from "../memory-BnafVem_.mjs";
4
- import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-BYqmg89O.mjs";
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
+ import { i as versionKey, n as hashParams, r as tagVersionKey, t as buildQueryKey } from "../keys-BSuxGS-B.mjs";
3
+ import { t as MemoryCacheStore } from "../memory-BiPVaCPg.mjs";
4
+ import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-oTsmVyEQ.mjs";
5
5
  //#region src/cache/redis.ts
6
6
  /**
7
7
  * Redis-backed cache store.
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-DrZrabOW.mjs";
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-Add2L50I.mjs";
3
3
  import fp from "fastify-plugin";
4
4
  //#region src/plugins/caching.ts
5
5
  var caching_exports = /* @__PURE__ */ __exportAll({
@@ -1,7 +1,7 @@
1
1
 
2
- import { L as RequestWithExtras } from "../index-C01wWGJt.mjs";
2
+ import { L as RequestWithExtras } from "../index-B78WZom8.mjs";
3
3
  import { A as CleanupStepResult, B as VerificationResult, C as CleanupResult, D as CleanupRunStore, E as CleanupRunStatus, F as PurgeEvidence, I as PurgeResourceResult, L as PurgeStrategyKind, M as CleanupWriteFence, N as DEFAULT_CLEANUP_LIMITS, O as CleanupRunTransitionPatch, P as PurgeActor, R as PurgeVerificationSummary, S as CleanupRecipe, T as CleanupRunCreateResult, _ as CleanupPermissions, a as CleanupEvidenceStore, b as CleanupPlanItem, c as CleanupInput, d as CleanupLease, f as CleanupLimits, g as CleanupPermissionCheck, h as CleanupOutcomeStatus, i as CleanupContext, j as CleanupStepRunStatus, k as CleanupStepProgress, l as CleanupJob, m as CleanupManifest, n as CLEANUP_TERMINAL_STATUSES, o as CleanupExecutionContext, p as CleanupLogger, r as CleanupCancelRequest, s as CleanupFinalizationPayload, t as Availability, u as CleanupJobQueue, v as CleanupPlan, w as CleanupRun, x as CleanupProgressSummary, y as CleanupPlanDraft, z as VerificationCheck } from "../types-DVLddu2q.mjs";
4
- import { t as ArcModule } from "../types-BMa2EPtv.mjs";
4
+ import { t as ArcModule } from "../types-BRU-Kd3t.mjs";
5
5
  import { PurgeStrategyKind as PurgeStrategyKind$1 } from "@classytic/primitives/retention";
6
6
  import { canonicalJson } from "@classytic/primitives/canonical";
7
7
  import { CleanupStep } from "@classytic/repo-core/cleanup";
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
- import { g as getUserId } from "../types-lDs9oF4z.mjs";
3
- import { t as defineResource } from "../defineResource-WcbE1kJL.mjs";
4
- import { t as defineModule } from "../module-DIvG8qOg.mjs";
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
+ import { g as getUserId } from "../types-BqLyyH0o.mjs";
3
+ import { t as defineResource } from "../defineResource-BMdyRelW.mjs";
4
+ import { t as defineModule } from "../module-BQXHxMEk.mjs";
5
5
  import { createPurgeEvidence } from "@classytic/primitives/retention";
6
6
  import { canonicalJson, sha256Hex } from "@classytic/primitives/canonical";
7
7
  //#region src/cleanup/errors.ts
@@ -1,5 +1,5 @@
1
1
 
2
- import { Nt as RateLimitConfig, V as ResourceDefinition, et as RouteSchemaOptions } from "../../index-C01wWGJt.mjs";
2
+ import { Nt as RateLimitConfig, V as ResourceDefinition, et as RouteSchemaOptions } from "../../index-B78WZom8.mjs";
3
3
  //#region src/cli/commands/describe.d.ts
4
4
  interface DescribedResource {
5
5
  name: string;
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
- import { t as CRUD_OPERATIONS } from "../../constants-CUpamQMJ.mjs";
3
- import { n as stringifyMeasureMap } from "../../ResourceRegistry-DFOmazXg.mjs";
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
+ import { t as CRUD_OPERATIONS } from "../../constants-BONghE1Y.mjs";
3
+ import { n as stringifyMeasureMap } from "../../ResourceRegistry-DPcX--zk.mjs";
4
4
  import { resolve } from "node:path";
5
5
  import { pathToFileURL } from "node:url";
6
6
  //#region src/cli/commands/describe.ts
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
- import { t as buildOpenApiSpec } from "../../openapi-D_i6CifU.mjs";
3
- import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-CPCZiX9n.mjs";
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
+ import { t as buildOpenApiSpec } from "../../openapi-Dxc8RLy_.mjs";
3
+ import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-DNj8cpiY.mjs";
4
4
  import { dirname, resolve } from "node:path";
5
5
  import { mkdirSync, writeFileSync } from "node:fs";
6
6
  //#region src/cli/commands/docs.ts
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
2
  import { dirname, join, parse, resolve } from "node:path";
3
3
  import { existsSync, readFileSync } from "node:fs";
4
4
  //#region src/cli/commands/doctor.ts
@@ -1,3 +1,3 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
- import { t as generate } from "../../generate-D7CIIWhS.mjs";
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
+ import { t as generate } from "../../generate-BUP4Oydg.mjs";
3
3
  export { generate };
@@ -1,3 +1,3 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
- import { t as init } from "../../init-BMgU1wYR.mjs";
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
+ import { t as init } from "../../init-Dg_Am2o_.mjs";
3
3
  export { init };
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
- import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-CPCZiX9n.mjs";
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
+ import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-DNj8cpiY.mjs";
3
3
  //#region src/cli/commands/introspect.ts
4
4
  function describePermission(value) {
5
5
  if (!value) return "none";
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
2
  import { describe } from "./commands/describe.mjs";
3
3
  import { exportDocs } from "./commands/docs.mjs";
4
4
  import { doctor } from "./commands/doctor.mjs";
5
- import { t as generate } from "../generate-D7CIIWhS.mjs";
6
- import { t as init } from "../init-BMgU1wYR.mjs";
5
+ import { t as generate } from "../generate-BUP4Oydg.mjs";
6
+ import { t as init } from "../init-Dg_Am2o_.mjs";
7
7
  import { introspect } from "./commands/introspect.mjs";
8
8
  export { describe, doctor, exportDocs, generate, init, introspect };
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
2
  //#region src/constants.ts
3
3
  /**
4
4
  * Arc Framework Constants — Single Source of Truth
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
- import { n as requestContext, t as getTraceHeaders } from "../requestContext-DGM7EZRI.mjs";
3
- import { t as transactionContext } from "../transactionContext-Ca5peQpc.mjs";
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
+ import { t as transactionContext } from "../transactionContext-DMmvcfdo.mjs";
3
+ import { n as requestContext, t as getTraceHeaders } from "../requestContext-DpmntRZy.mjs";
4
4
  //#region src/context/requestScopedCache.ts
5
5
  /**
6
6
  * The slot the per-request store hangs off. Underscore-prefixed to sit apart
@@ -1,4 +1,4 @@
1
1
 
2
- import { $t as AccessControlConfig, B as defineResource, Bt as BaseController, Cn as ControllerConstructionOptions, En as BodySanitizerConfig, Gt as SlugExt, Ht as SoftDeleteMixin, Jt as BulkMixin, Kt as SlugMixin, Qt as AccessControl, Sn as ControllerConfigurableOptions, Tn as BodySanitizer, Ut as TreeExt, V as ResourceDefinition, Vt as SoftDeleteExt, Wt as TreeMixin, Xt as QueryResolver, Yt as BaseCrudController, Zt as QueryResolverConfig, ct as AggMeasureShorthand, dt as AggregationDateRangeRequirement, ft as AggregationIndexHint, gt as AggregationsMap, ht as AggregationRateLimit, lt as AggregationCacheConfig, mt as AggregationMaterializedResult, pt as AggregationMaterializedContext, qt as BulkExt, st as AggMeasureInput, ut as AggregationConfig, wn as ListResult, xn as BaseControllerOptions } from "../index-C01wWGJt.mjs";
3
- import { A as CRUD_OPERATIONS, B as HookOperation, C as SeamedResourceConfig, D as createCrudRouter, E as defineAction, F as DEFAULT_SORT, G as MUTATION_OPERATIONS, H as MAX_FILTER_DEPTH, I as DEFAULT_TENANT_FIELD, J as SYSTEM_FIELDS, K as MutationOperation, L as DEFAULT_UPDATE_METHOD, M as DEFAULT_ID_FIELD, N as DEFAULT_LIMIT, O as createPermissionMiddleware, P as DEFAULT_MAX_LIMIT, R as HOOK_OPERATIONS, S as ResourceSeams, T as DefineActionConfig, U as MAX_REGEX_LENGTH, V as HookPhase, W as MAX_SEARCH_LENGTH, _ as getEntityId, a as formatValidationErrors, b as defineResourceVariants, c as nativePolicyFilter, d as createCrudHandlers, f as createFastifyHandler, g as sendControllerResponse, h as getControllerScope, i as assertValidConfig, j as CrudOperation, k as defineAggregation, l as collectReadBlockedFields, m as getControllerContext, n as ValidateOptions, o as validateResourceConfig, p as createRequestContext, q as RESERVED_QUERY_PARAMS, r as ValidationResult, s as NativePolicyFilter, t as ConfigError, u as isFieldReadable, v as getEntityIdField, w as mergeResourceConfig, x as AdapterLike, y as getEntityQuery, z as HOOK_PHASES } from "../index-du18bJjH.mjs";
2
+ import { $t as AccessControlConfig, B as defineResource, Bt as BaseController, Cn as ControllerConstructionOptions, En as BodySanitizerConfig, Gt as SlugExt, Ht as SoftDeleteMixin, Jt as BulkMixin, Kt as SlugMixin, Qt as AccessControl, Sn as ControllerConfigurableOptions, Tn as BodySanitizer, Ut as TreeExt, V as ResourceDefinition, Vt as SoftDeleteExt, Wt as TreeMixin, Xt as QueryResolver, Yt as BaseCrudController, Zt as QueryResolverConfig, ct as AggMeasureShorthand, dt as AggregationDateRangeRequirement, ft as AggregationIndexHint, gt as AggregationsMap, ht as AggregationRateLimit, lt as AggregationCacheConfig, mt as AggregationMaterializedResult, pt as AggregationMaterializedContext, qt as BulkExt, st as AggMeasureInput, ut as AggregationConfig, wn as ListResult, xn as BaseControllerOptions } from "../index-B78WZom8.mjs";
3
+ import { A as CRUD_OPERATIONS, B as HookOperation, C as SeamedResourceConfig, D as createCrudRouter, E as defineAction, F as DEFAULT_SORT, G as MUTATION_OPERATIONS, H as MAX_FILTER_DEPTH, I as DEFAULT_TENANT_FIELD, J as SYSTEM_FIELDS, K as MutationOperation, L as DEFAULT_UPDATE_METHOD, M as DEFAULT_ID_FIELD, N as DEFAULT_LIMIT, O as createPermissionMiddleware, P as DEFAULT_MAX_LIMIT, R as HOOK_OPERATIONS, S as ResourceSeams, T as DefineActionConfig, U as MAX_REGEX_LENGTH, V as HookPhase, W as MAX_SEARCH_LENGTH, _ as getEntityId, a as formatValidationErrors, b as defineResourceVariants, c as nativePolicyFilter, d as createCrudHandlers, f as createFastifyHandler, g as sendControllerResponse, h as getControllerScope, i as assertValidConfig, j as CrudOperation, k as defineAggregation, l as collectReadBlockedFields, m as getControllerContext, n as ValidateOptions, o as validateResourceConfig, p as createRequestContext, q as RESERVED_QUERY_PARAMS, r as ValidationResult, s as NativePolicyFilter, t as ConfigError, u as isFieldReadable, v as getEntityIdField, w as mergeResourceConfig, x as AdapterLike, y as getEntityQuery, z as HOOK_PHASES } from "../index-BRoDtjek.mjs";
4
4
  export { AccessControl, type AccessControlConfig, type AdapterLike, type AggMeasureInput, type AggMeasureShorthand, type AggregationCacheConfig, type AggregationConfig, type AggregationDateRangeRequirement, type AggregationIndexHint, type AggregationMaterializedContext, type AggregationMaterializedResult, type AggregationRateLimit, type AggregationsMap, BaseController, type BaseControllerOptions, BaseCrudController, BodySanitizer, type BodySanitizerConfig, type BulkExt, BulkMixin, CRUD_OPERATIONS, type ConfigError, type ControllerConfigurableOptions, type ControllerConstructionOptions, CrudOperation, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, type DefineActionConfig, HOOK_OPERATIONS, HOOK_PHASES, HookOperation, HookPhase, type ListResult, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, MutationOperation, type NativePolicyFilter, QueryResolver, type QueryResolverConfig, RESERVED_QUERY_PARAMS, ResourceDefinition, type ResourceSeams, SYSTEM_FIELDS, type SeamedResourceConfig, type SlugExt, SlugMixin, type SoftDeleteExt, SoftDeleteMixin, type TreeExt, TreeMixin, type ValidateOptions, type ValidationResult, assertValidConfig, collectReadBlockedFields, createCrudHandlers, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAction, defineAggregation, defineResource, defineResourceVariants, formatValidationErrors, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, mergeResourceConfig, nativePolicyFilter, sendControllerResponse, validateResourceConfig };
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
2
- import { a as DEFAULT_SORT, c as HOOK_OPERATIONS, d as MAX_REGEX_LENGTH, f as MAX_SEARCH_LENGTH, h as SYSTEM_FIELDS, i as DEFAULT_MAX_LIMIT, l as HOOK_PHASES, m as RESERVED_QUERY_PARAMS, n as DEFAULT_ID_FIELD, o as DEFAULT_TENANT_FIELD, p as MUTATION_OPERATIONS, r as DEFAULT_LIMIT, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS, u as MAX_FILTER_DEPTH } from "../constants-CUpamQMJ.mjs";
3
- import { a as BulkMixin, c as collectReadBlockedFields, f as BodySanitizer, h as nativePolicyFilter, i as SlugMixin, l as isFieldReadable, m as AccessControl, n as TreeMixin, o as BaseCrudController, r as SoftDeleteMixin, s as QueryResolver, t as BaseController } from "../BaseController-B5GZfUBy.mjs";
4
- import { a as ResourceDefinition, i as validateResourceConfig, n as assertValidConfig, o as createCrudRouter, r as formatValidationErrors, s as createPermissionMiddleware, t as defineResource } from "../defineResource-WcbE1kJL.mjs";
5
- import { a as createCrudHandlers, c as getControllerContext, l as getControllerScope, o as createFastifyHandler, s as createRequestContext, u as sendControllerResponse } from "../actionPermissions-CQQrR4tu.mjs";
6
- import { t as defineAggregation } from "../defineAggregation-cCitY2FA.mjs";
7
- import { a as mergeResourceConfig, i as defineResourceVariants, n as getEntityIdField, o as defineAction, r as getEntityQuery, t as getEntityId } from "../core-C8GWw-Iu.mjs";
1
+ /*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
2
+ import { a as DEFAULT_SORT, c as HOOK_OPERATIONS, d as MAX_REGEX_LENGTH, f as MAX_SEARCH_LENGTH, h as SYSTEM_FIELDS, i as DEFAULT_MAX_LIMIT, l as HOOK_PHASES, m as RESERVED_QUERY_PARAMS, n as DEFAULT_ID_FIELD, o as DEFAULT_TENANT_FIELD, p as MUTATION_OPERATIONS, r as DEFAULT_LIMIT, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS, u as MAX_FILTER_DEPTH } from "../constants-BONghE1Y.mjs";
3
+ import { a as BulkMixin, c as collectReadBlockedFields, f as BodySanitizer, h as nativePolicyFilter, i as SlugMixin, l as isFieldReadable, m as AccessControl, n as TreeMixin, o as BaseCrudController, r as SoftDeleteMixin, s as QueryResolver, t as BaseController } from "../BaseController-CYaDvmOB.mjs";
4
+ import { t as defineAggregation } from "../defineAggregation-0KBvqEEC.mjs";
5
+ import { a as createCrudHandlers, c as getControllerContext, l as getControllerScope, o as createFastifyHandler, s as createRequestContext, u as sendControllerResponse } from "../actionPermissions-jlFZ1it4.mjs";
6
+ import { a as ResourceDefinition, i as validateResourceConfig, n as assertValidConfig, o as createCrudRouter, r as formatValidationErrors, s as createPermissionMiddleware, t as defineResource } from "../defineResource-BMdyRelW.mjs";
7
+ import { a as mergeResourceConfig, i as defineResourceVariants, n as getEntityIdField, o as defineAction, r as getEntityQuery, t as getEntityId } from "../core-8She7FgF.mjs";
8
8
  export { AccessControl, BaseController, BaseCrudController, BodySanitizer, BulkMixin, CRUD_OPERATIONS, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, HOOK_OPERATIONS, HOOK_PHASES, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, QueryResolver, RESERVED_QUERY_PARAMS, ResourceDefinition, SYSTEM_FIELDS, SlugMixin, SoftDeleteMixin, TreeMixin, assertValidConfig, collectReadBlockedFields, createCrudHandlers, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAction, defineAggregation, defineResource, defineResourceVariants, formatValidationErrors, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, mergeResourceConfig, nativePolicyFilter, sendControllerResponse, validateResourceConfig };