@classytic/arc 2.50.0 → 2.52.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 (167) hide show
  1. package/dist/{EventTransport-B18mcj_M.mjs → EventTransport-DeNze_-C.mjs} +2 -2
  2. package/dist/{HookSystem-FUBaLTRm.mjs → HookSystem-DTffXM1X.mjs} +2 -2
  3. package/dist/{ResourceRegistry-C5NM07fZ.mjs → ResourceRegistry-tlqXSZoK.mjs} +2 -2
  4. package/dist/{acquire-MHCnbDtH.mjs → acquire-7JKEkKnN.mjs} +1 -1
  5. package/dist/audit/index.mjs +4 -4
  6. package/dist/auth/audit.mjs +1 -1
  7. package/dist/auth/index.d.mts +30 -0
  8. package/dist/auth/index.mjs +172 -32
  9. package/dist/auth/redis-session.mjs +1 -1
  10. package/dist/auth/social/index.d.mts +42 -0
  11. package/dist/auth/social/index.mjs +311 -0
  12. package/dist/{authorizationDecision-BD8K4jdQ.mjs → authorizationDecision-DKmH4tZ-.mjs} +9 -7
  13. package/dist/{boundedMap-CuCwos_X.mjs → boundedMap-zxGBpXX0.mjs} +1 -1
  14. package/dist/{buildHandler-BttjNkTM.mjs → buildHandler-ZDV6LRZ_.mjs} +5 -5
  15. package/dist/cache/index.mjs +4 -4
  16. package/dist/{caching-CxUQLHfR.mjs → caching-DceUN9Xk.mjs} +2 -2
  17. package/dist/{claimed-CQ4ZpD8K.mjs → claimed-DsP5Hi_f.mjs} +1 -1
  18. package/dist/cleanup/index.mjs +4 -4
  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-BZFsZwJh.mjs → constants-Ca2IQFy2.mjs} +1 -1
  27. package/dist/context/index.mjs +5 -5
  28. package/dist/core/index.d.mts +1 -1
  29. package/dist/core/index.mjs +7 -7
  30. package/dist/{core-DWA1-5IE.mjs → core-M18RhMqi.mjs} +3 -3
  31. package/dist/{createActionRouter-fP3l2xVF.mjs → createActionRouter-zXlrwWVs.mjs} +5 -5
  32. package/dist/{createAggregationRouter-BJZeOmBa.mjs → createAggregationRouter-CN0Da9nC.mjs} +7 -7
  33. package/dist/{createApp-Db9JRumw.mjs → createApp-BC67ACu4.mjs} +29 -29
  34. package/dist/{defineAggregation-BskqRz8M.mjs → defineAggregation-DqAGb5oI.mjs} +1 -1
  35. package/dist/{defineResource-B2vTvKzW.mjs → defineResource-DC5UqkQv.mjs} +8 -8
  36. package/dist/discovery/index.mjs +1 -1
  37. package/dist/docs/index.mjs +3 -3
  38. package/dist/{elevation-XoY0C73T.mjs → elevation-DiXVg98q.mjs} +5 -5
  39. package/dist/encryption/index.d.mts +26 -1
  40. package/dist/encryption/index.mjs +56 -6
  41. package/dist/{errorHandler-BYI-JQMm.mjs → errorHandler-BUTm9P_f.mjs} +3 -3
  42. package/dist/{errors-3xaK0i9n.mjs → errors-DxpHZBlW.mjs} +1 -1
  43. package/dist/{eventPlugin-CVQ9ddnL.mjs → eventPlugin-ZsIQPRso.mjs} +8 -8
  44. package/dist/{eventTypes-UPYg7gW1.mjs → eventTypes-D-pFtqT1.mjs} +2 -2
  45. package/dist/events/index.mjs +8 -8
  46. package/dist/events/transports/redis-stream-entry.mjs +4 -4
  47. package/dist/events/transports/redis.mjs +2 -2
  48. package/dist/factory/index.d.mts +4 -4
  49. package/dist/factory/index.mjs +7 -7
  50. package/dist/{fastify-augmentation-baQc3MaO.d.mts → fastify-augmentation-CPReFhZ1.d.mts} +1 -1
  51. package/dist/{fieldTypes-CxRvCaaZ.mjs → fieldTypes-f-3TZgR3.mjs} +2 -2
  52. package/dist/{fields-DLFcJiDe.mjs → fields-kCbIDTjA.mjs} +1 -1
  53. package/dist/{filter-merge-Bvjk_8dV.mjs → filter-merge-UJCgjbZR.mjs} +1 -1
  54. package/dist/{generate-0OpCUjUv.mjs → generate-CLpmzbJ_.mjs} +2 -2
  55. package/dist/{headers-BROW65-r.mjs → headers-Bh47h0XH.mjs} +2 -2
  56. package/dist/{health-Cy6aOg1i.mjs → health-CEpgVAl7.mjs} +1 -1
  57. package/dist/{health-Cfh-kYI_.mjs → health-W4S2yFBL.mjs} +1 -1
  58. package/dist/hooks/index.mjs +2 -2
  59. package/dist/http-cache/index.mjs +4 -4
  60. package/dist/http-cache/purgers/cloudflare.mjs +2 -2
  61. package/dist/http-cache/purgers/fastly.mjs +2 -2
  62. package/dist/http-cache/testing/index.mjs +1 -1
  63. package/dist/idempotency/index.mjs +7 -7
  64. package/dist/idempotency/redis.mjs +2 -2
  65. package/dist/{index-DexdFs1a.d.mts → index-CSbDhif4.d.mts} +19 -1
  66. package/dist/{index-DKM2p5w5.d.mts → index-DCH08eqQ.d.mts} +1 -1
  67. package/dist/{index-Dhrks-hM.d.mts → index-yXXCsKl7.d.mts} +1 -1
  68. package/dist/index.d.mts +2 -2
  69. package/dist/index.mjs +11 -11
  70. package/dist/{init-D7PQcvvL.mjs → init-B43DXBpc.mjs} +22 -22
  71. package/dist/integrations/event-gateway.mjs +2 -2
  72. package/dist/integrations/index.mjs +1 -1
  73. package/dist/integrations/jobs/index.mjs +3 -3
  74. package/dist/integrations/mcp/index.mjs +2 -2
  75. package/dist/integrations/mcp/testing.mjs +2 -2
  76. package/dist/integrations/streamline.mjs +3 -3
  77. package/dist/integrations/webhooks.mjs +4 -4
  78. package/dist/integrations/websocket-pushref-redis.mjs +1 -1
  79. package/dist/integrations/websocket-redis.mjs +1 -1
  80. package/dist/integrations/websocket.mjs +2 -2
  81. package/dist/{jsonBody-C0oREwUc.mjs → jsonBody-CkKs6dA_.mjs} +2 -2
  82. package/dist/{keys-CGlPoVSn.mjs → keys-DHrHnT0f.mjs} +1 -1
  83. package/dist/{loadResources-Oi47dogA.mjs → loadResources-CFdzAWQZ.mjs} +3 -3
  84. package/dist/{loadResourcesFromEntry-BW-LexBz.mjs → loadResourcesFromEntry-DkoSiJsI.mjs} +2 -2
  85. package/dist/logger/index.mjs +2 -2
  86. package/dist/{logger-BagW7_YA.mjs → logger-DJwz_-Pl.mjs} +1 -1
  87. package/dist/{mcpPlugin-C6-wFsOX.mjs → mcpPlugin-CA_MDFlS.mjs} +21 -21
  88. package/dist/{memory-Bl7kv6TS.mjs → memory-B9CFHbA_.mjs} +3 -3
  89. package/dist/{metrics-CqnMJKrJ.mjs → metrics-DSKv-T9K.mjs} +3 -3
  90. package/dist/middleware/index.mjs +3 -3
  91. package/dist/migrations/index.mjs +2 -2
  92. package/dist/{module-lbEbHUfI.mjs → module-C0JCsnO7.mjs} +17 -2
  93. package/dist/{multipartBody-CqNezaB3.mjs → multipartBody-Bxz-q6hI.mjs} +1 -1
  94. package/dist/{observeSend-BjilzlYl.mjs → observeSend-DfNkdGww.mjs} +1 -1
  95. package/dist/{openapi-DXNbadgd.mjs → openapi-Dmp7Ipsi.mjs} +6 -6
  96. package/dist/outbox-admin/index.mjs +5 -5
  97. package/dist/{outbox-module-k5rIszQ4.mjs → outbox-module-vT6PaThj.mjs} +7 -7
  98. package/dist/permissions/index.mjs +7 -7
  99. package/dist/{permissions-BJylQopQ.mjs → permissions-Cga6KBOX.mjs} +9 -9
  100. package/dist/{pipe-D1cq8hET.mjs → pipe-CqPweKdL.mjs} +2 -2
  101. package/dist/pipeline/index.mjs +2 -2
  102. package/dist/{plan-iEgaS5_H.mjs → plan-CbDTFbTj.mjs} +1 -1
  103. package/dist/{plugin-DsLr6L4O.mjs → plugin-8Z1khbAI.mjs} +24 -24
  104. package/dist/plugins/index.d.mts +1 -1
  105. package/dist/plugins/index.mjs +18 -18
  106. package/dist/plugins/response-cache.mjs +4 -4
  107. package/dist/plugins/tracing-entry.mjs +2 -2
  108. package/dist/{pluralize-CX4ZvwCa.mjs → pluralize-D4vcPLVs.mjs} +1 -1
  109. package/dist/presets/filesUpload.mjs +5 -5
  110. package/dist/presets/index.mjs +2 -2
  111. package/dist/presets/multiTenant.mjs +5 -5
  112. package/dist/presets/search.mjs +2 -2
  113. package/dist/{presets-D_suT4OY.mjs → presets-D28IABZe.mjs} +4 -4
  114. package/dist/{projection-CmjGjFih.mjs → projection-aHCtDQQ9.mjs} +2 -2
  115. package/dist/{purger.types-CZwkTZ7B.mjs → purger.types-CNFmEtFu.mjs} +1 -1
  116. package/dist/{queryCachePlugin-BDOPEAmH.mjs → queryCachePlugin-CwpEjCwz.mjs} +6 -6
  117. package/dist/{rateLimitKey-igF1x64n.mjs → rateLimitKey-D9dl3FQn.mjs} +1 -1
  118. package/dist/{realtime-Cq_ugiWw.mjs → realtime-Dvu8ES2z.mjs} +11 -11
  119. package/dist/registry/index.d.mts +1 -1
  120. package/dist/registry/index.mjs +3 -3
  121. package/dist/{registry-DmF9Akvn.mjs → registry-DmxbzW7-.mjs} +2 -2
  122. package/dist/{relay-DA89IhFt.mjs → relay-CEaCmUfG.mjs} +5 -5
  123. package/dist/{renewingLease-DBtGUt8T.mjs → renewingLease-g2FjB3im.mjs} +1 -1
  124. package/dist/{replyHelpers-CUbeUc5q.mjs → replyHelpers-CSByAX_Z.mjs} +2 -2
  125. package/dist/{requestContext-DO9Qv0gw.mjs → requestContext-yc7MSgmq.mjs} +1 -1
  126. package/dist/{requirement-C3GaQmkR.mjs → requirement-Dm8njSoC.mjs} +1 -1
  127. package/dist/{resourceRateLimit-KKn-sFhb.mjs → resourceRateLimit-PQaY3HW1.mjs} +2 -2
  128. package/dist/{rolldown-runtime-Ck1Tj4Ax.mjs → rolldown-runtime-BBBkGgwA.mjs} +1 -1
  129. package/dist/{routeValidator-BF7n34xV.mjs → routeValidator-fuG51bQA.mjs} +1 -1
  130. package/dist/{runtimeCapabilities-D0A4kkrC.mjs → runtimeCapabilities-B8IT7xiQ.mjs} +1 -1
  131. package/dist/{schedules-CLrQRSTt.mjs → schedules-0-aS4jDV.mjs} +5 -5
  132. package/dist/{schemaConverter-JEmU21fu.mjs → schemaConverter-Cs3SwP4R.mjs} +2 -2
  133. package/dist/{schemaIR-wOffQlbq.mjs → schemaIR-By8XiNeE.mjs} +14 -14
  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-CcTMRd7s.mjs → scope-BWNAlBj0.mjs} +4 -4
  138. package/dist/{shutdown-BIR-QBYM.mjs → shutdown-Cf-27xsS.mjs} +1 -1
  139. package/dist/{simpleEqualityMatcher-DqqJqovq.mjs → simpleEqualityMatcher-e-dgJcUO.mjs} +1 -1
  140. package/dist/{sse-OEuPpgss.mjs → sse-C3bj5qWi.mjs} +7 -7
  141. package/dist/{sseStream-DknHE2K5.mjs → sseStream-BYZbpFDa.mjs} +2 -2
  142. package/dist/{store-helpers-D4vtEXt2.mjs → store-helpers-B9HierHY.mjs} +1 -1
  143. package/dist/{streaming-CcIpcx02.mjs → streaming-EN8NJWxr.mjs} +1 -1
  144. package/dist/{subscriberIdentity-PO6kimAl.mjs → subscriberIdentity-DSqCh38x.mjs} +1 -1
  145. package/dist/{tenancy-CH2Kuksc.mjs → tenancy-CAqjGQcQ.mjs} +2 -2
  146. package/dist/{tenantPreparation-BTGpblQW.mjs → tenantPreparation-CVBWarqs.mjs} +4 -4
  147. package/dist/testing/cleanupStoreContract.mjs +1 -1
  148. package/dist/testing/index.d.mts +2 -2
  149. package/dist/testing/index.mjs +11 -11
  150. package/dist/testing/outboxStoreContract.mjs +2 -2
  151. package/dist/testing/requiredPorts.mjs +2 -2
  152. package/dist/testing/storageContract.mjs +1 -1
  153. package/dist/{timing-Dii5X7AP.mjs → timing-CKI_Oyub.mjs} +1 -1
  154. package/dist/{transactionContext-DMPhYEOt.mjs → transactionContext-D0UZFoSy.mjs} +1 -1
  155. package/dist/{typeGuards-C1o_XEyp.mjs → typeGuards-CLYkmBLT.mjs} +1 -1
  156. package/dist/types/index.mjs +1 -1
  157. package/dist/types/storage.mjs +1 -1
  158. package/dist/{types-BuV_cFqT.mjs → types-Cunc4shv.mjs} +4 -4
  159. package/dist/usage/index.mjs +4 -4
  160. package/dist/{userHelpers-D4m_pLSC.mjs → userHelpers-cT5j1kgp.mjs} +1 -1
  161. package/dist/utils/index.mjs +12 -12
  162. package/dist/{utils-CxLMXGn5.mjs → utils-DlNkm1dI.mjs} +6 -6
  163. package/dist/{validate-CZ975J8N.mjs → validate-63QThRoS.mjs} +3 -3
  164. package/dist/{versioning-B2_8SBZo.mjs → versioning-f2YGmh4i.mjs} +3 -3
  165. package/dist/{workScope-B3W3r35s.mjs → workScope-DwspXz70.mjs} +2 -2
  166. package/package.json +17 -12
  167. package/skills/arc/references/auth-better-auth.md +27 -1
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
- import { n as forwardedStreamHeaders } from "./streaming-CcIpcx02.mjs";
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
+ import { n as forwardedStreamHeaders } from "./streaming-EN8NJWxr.mjs";
3
3
  // src/utils/sseStats.ts
4
4
  /** Per-instance stats providers behind one `sseStats` decorator. */
5
5
  const statsProviders = /* @__PURE__ */ new WeakMap();
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
2
  // 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.50.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
2
  import { Readable } from "node:stream";
3
3
  // src/utils/streaming.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
2
  // src/events/subscriberIdentity.ts
3
3
  const SUBSCRIBER_ID = Symbol.for("@classytic/arc/subscriber-id");
4
4
  /** Assign a deployment-stable identity for durable per-handler progress; never use an index. */
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
- import { b as isElevated, c as getOrgId } from "./types-BuV_cFqT.mjs";
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
+ import { b as isElevated, c as getOrgId } from "./types-Cunc4shv.mjs";
3
3
  // src/core/tenancy.ts
4
4
  function eventAudienceOf(scope) {
5
5
  const tenancy = resolveTenancy({ _scope: scope }, "organizationId");
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
- import { t as conjoinPolicyFilters } from "./filter-merge-Bvjk_8dV.mjs";
3
- import { b as isElevated, c as getOrgId, d as getScopeContext, m as getTeamId, v as hasOrgAccess } from "./types-BuV_cFqT.mjs";
4
- import { d as createDomainError } from "./errors-3xaK0i9n.mjs";
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
+ import { t as conjoinPolicyFilters } from "./filter-merge-UJCgjbZR.mjs";
3
+ import { b as isElevated, c as getOrgId, d as getScopeContext, m as getTeamId, v as hasOrgAccess } from "./types-Cunc4shv.mjs";
4
+ import { d as createDomainError } from "./errors-DxpHZBlW.mjs";
5
5
  // src/permissions/tenantPreparation.ts
6
6
  /** Tenant preparation shared by HTTP middleware and direct transport invocation. */
7
7
  const PREPARATION = Symbol.for("arc.tenantPreparation");
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
2
  import { afterAll, beforeAll, describe, expect, it } from "vitest";
3
3
  // src/testing/cleanupStoreContract.ts
4
4
  /**
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { h as ModuleSetupContext, m as ModuleDisposer, o as ArcPorts, p as PortName, r as ArcModuleInput, u as ModuleName } from "../types-BeEJm-DV.mjs";
3
- import "../index-DexdFs1a.mjs";
4
- import { r as CreateAppOptions } from "../index-Dhrks-hM.mjs";
3
+ import "../index-CSbDhif4.mjs";
4
+ import { r as CreateAppOptions } from "../index-yXXCsKl7.mjs";
5
5
  import { i as RequestScope } from "../types-DnkIALZ8.mjs";
6
6
  import { l as PermissionCheck, t as AnyRecord } from "../base-HXNgPQww.mjs";
7
7
  import { F as ResourceDefinition } from "../index-DLCcLUQT.mjs";
@@ -1,13 +1,13 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
- import { d as resolveModule, l as isLazyBridge, o as resolveModuleClosure } from "../plan-iEgaS5_H.mjs";
3
- import { h as asModulePorts, r as createApp } from "../createApp-Db9JRumw.mjs";
4
- import { n as getModuleExports } from "../module-lbEbHUfI.mjs";
5
- import { g as getUserId } from "../types-BuV_cFqT.mjs";
6
- import { t as defineAggregation } from "../defineAggregation-BskqRz8M.mjs";
7
- import { f as BaseController } from "../plugin-DsLr6L4O.mjs";
8
- import { t as defineResource } from "../defineResource-B2vTvKzW.mjs";
9
- import { t as CRUD_OPERATIONS } from "../constants-BZFsZwJh.mjs";
10
- import { E as requireOrgRole } from "../permissions-BJylQopQ.mjs";
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
+ import { d as resolveModule, l as isLazyBridge, o as resolveModuleClosure } from "../plan-CbDTFbTj.mjs";
3
+ import { h as asModulePorts, r as createApp } from "../createApp-BC67ACu4.mjs";
4
+ import { n as getModuleExports } from "../module-C0JCsnO7.mjs";
5
+ import { g as getUserId } from "../types-Cunc4shv.mjs";
6
+ import { t as defineAggregation } from "../defineAggregation-DqAGb5oI.mjs";
7
+ import { f as BaseController } from "../plugin-8Z1khbAI.mjs";
8
+ import { t as defineResource } from "../defineResource-DC5UqkQv.mjs";
9
+ import { t as CRUD_OPERATIONS } from "../constants-Ca2IQFy2.mjs";
10
+ import { E as requireOrgRole } from "../permissions-Cga6KBOX.mjs";
11
11
  import { runStorageContract } from "./storageContract.mjs";
12
12
  import Fastify from "fastify";
13
13
  import { mkdir, mkdtemp, readFile, readdir, rm, stat } from "node:fs/promises";
@@ -1873,7 +1873,7 @@ function pickDefaultAuth(authMode, callerAuth) {
1873
1873
  };
1874
1874
  }
1875
1875
  async function createTestApp(options = {}) {
1876
- const { createApp } = await import("../createApp-Db9JRumw.mjs").then((n) => n.i);
1876
+ const { createApp } = await import("../createApp-BC67ACu4.mjs").then((n) => n.i);
1877
1877
  const { resources = [], db = "in-memory", connectMongoose = false, authMode = "jwt", defaultOrgId, plugins, auth: callerAuth, ...appOptions } = options;
1878
1878
  let dbHandle;
1879
1879
  let dbUri;
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
- import { t as claimedAttempts } from "../claimed-CQ4ZpD8K.mjs";
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
+ import { t as claimedAttempts } from "../claimed-DsP5Hi_f.mjs";
3
3
  import { OutboxConflictError, OutboxOwnershipError } from "@classytic/primitives/outbox";
4
4
  import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest";
5
5
  // src/testing/outboxStoreContract.ts
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
- import { c as declareModules, d as resolveModule, i as planModules, r as compositionProblems } from "../plan-iEgaS5_H.mjs";
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
+ import { c as declareModules, d as resolveModule, i as planModules, r as compositionProblems } from "../plan-CbDTFbTj.mjs";
3
3
  // src/testing/requiredPorts.ts
4
4
  /**
5
5
  * Assert a module declares EXACTLY `ports` as required, and that composing it without any one of
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
2
  import { afterAll, beforeAll, describe, expect, it } from "vitest";
3
3
  // src/testing/storageContract.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
2
  import { createHash } from "node:crypto";
3
3
  // src/utils/operationIdentity.ts
4
4
  /** Security context included in idempotency identities across transports. */
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  // src/context/transactionContext.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
2
  // src/utils/typeGuards.ts
3
3
  /** Check if fastify has the events plugin registered */
4
4
  function hasEvents(instance) {
@@ -1,2 +1,2 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
2
  export {};
@@ -1,2 +1,2 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
2
  export {};
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
- import { l as UnauthorizedError, o as OrgRequiredError } from "./errors-3xaK0i9n.mjs";
3
- import { n as requireSingleHeaderValue } from "./headers-BROW65-r.mjs";
4
- import { t as getUserId$1 } from "./userHelpers-D4m_pLSC.mjs";
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
+ import { l as UnauthorizedError, o as OrgRequiredError } from "./errors-DxpHZBlW.mjs";
3
+ import { n as requireSingleHeaderValue } from "./headers-Bh47h0XH.mjs";
4
+ import { t as getUserId$1 } from "./userHelpers-cT5j1kgp.mjs";
5
5
  // src/scope/types.ts
6
6
  /**
7
7
  * Request Scope — The One Standard
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
- import { t as ArcError } from "../errors-3xaK0i9n.mjs";
3
- import { c as getOrgId, g as getUserId, i as getClientId } from "../types-BuV_cFqT.mjs";
4
- import { n as declareRuntimeCapability } from "../runtimeCapabilities-D0A4kkrC.mjs";
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
+ import { t as ArcError } from "../errors-DxpHZBlW.mjs";
3
+ import { c as getOrgId, g as getUserId, i as getClientId } from "../types-Cunc4shv.mjs";
4
+ import { n as declareRuntimeCapability } from "../runtimeCapabilities-B8IT7xiQ.mjs";
5
5
  import { usagePeriod } from "@classytic/repo-core/usage";
6
6
  import fp from "fastify-plugin";
7
7
  // src/usage/requireQuota.ts
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
2
  // src/utils/userHelpers.ts
3
3
  /**
4
4
  * Extract a user ID from a user object. Accepts `id` or `_id` — returns
@@ -1,13 +1,13 @@
1
- /*! @classytic/arc v2.50.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-3xaK0i9n.mjs";
3
- import { t as simpleEqualityMatcher } from "../simpleEqualityMatcher-DqqJqovq.mjs";
4
- import { n as requireSingleHeaderValue, t as getHeader } from "../headers-BROW65-r.mjs";
5
- import { n as getUserRoles, r as normalizeRoles, t as getUserId } from "../userHelpers-D4m_pLSC.mjs";
6
- import { A as MONGO_DIALECT, C as listResponse, D as responses, E as queryParams, O as ArcQueryParser, S as keysetListResponse, T as paginationSchema, _ as bareListResponse, a as defineGuard, b as getDefaultCrudSchemas, c as withCompensation, d as CircuitBreakerError, f as CircuitBreakerRegistry, g as aggregateListResponse, h as createCircuitBreakerRegistry, i as handleRaw, j as NEUTRAL_DIALECT, k as createQueryParser, l as RedisCircuitBreakerState, m as createCircuitBreaker, n as createReplayHub, o as defineErrorMapper, p as CircuitState, r as lastEventIdOf, s as defineCompensation, t as createStateMachine, u as CircuitBreaker, v as deleteResponse, w as offsetListResponse, x as getListQueryParams, y as errorContractSchema } from "../utils-CxLMXGn5.mjs";
7
- import { a as isZodSchema, i as isJsonSchema, n as convertRouteSchema, o as toJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-JEmU21fu.mjs";
8
- import { a as promoteStreamTokenToHeader, i as pipeUIMessageStreamToReply, n as forwardedStreamHeaders, r as isReadableStream, t as UI_MESSAGE_STREAM_HEADERS } from "../streaming-CcIpcx02.mjs";
9
- import { a as registerSseStats, i as createSseConnectionGauge, n as SSE_DEFAULT_MAX_BUFFERED_BYTES, r as openSseStream, t as SSE_DEFAULT_DRAIN_TIMEOUT_MS } from "../sseStream-DknHE2K5.mjs";
10
- import { n as declareRuntimeCapability } from "../runtimeCapabilities-D0A4kkrC.mjs";
11
- import { i as runAdmittedWork, r as registerShutdownParticipant } from "../shutdown-BIR-QBYM.mjs";
12
- import { t as hasEvents } from "../typeGuards-C1o_XEyp.mjs";
1
+ /*! @classytic/arc v2.52.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-DxpHZBlW.mjs";
3
+ import { t as simpleEqualityMatcher } from "../simpleEqualityMatcher-e-dgJcUO.mjs";
4
+ import { n as requireSingleHeaderValue, t as getHeader } from "../headers-Bh47h0XH.mjs";
5
+ import { n as getUserRoles, r as normalizeRoles, t as getUserId } from "../userHelpers-cT5j1kgp.mjs";
6
+ import { A as MONGO_DIALECT, C as listResponse, D as responses, E as queryParams, O as ArcQueryParser, S as keysetListResponse, T as paginationSchema, _ as bareListResponse, a as defineGuard, b as getDefaultCrudSchemas, c as withCompensation, d as CircuitBreakerError, f as CircuitBreakerRegistry, g as aggregateListResponse, h as createCircuitBreakerRegistry, i as handleRaw, j as NEUTRAL_DIALECT, k as createQueryParser, l as RedisCircuitBreakerState, m as createCircuitBreaker, n as createReplayHub, o as defineErrorMapper, p as CircuitState, r as lastEventIdOf, s as defineCompensation, t as createStateMachine, u as CircuitBreaker, v as deleteResponse, w as offsetListResponse, x as getListQueryParams, y as errorContractSchema } from "../utils-DlNkm1dI.mjs";
7
+ import { a as isZodSchema, i as isJsonSchema, n as convertRouteSchema, o as toJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-Cs3SwP4R.mjs";
8
+ import { a as promoteStreamTokenToHeader, i as pipeUIMessageStreamToReply, n as forwardedStreamHeaders, r as isReadableStream, t as UI_MESSAGE_STREAM_HEADERS } from "../streaming-EN8NJWxr.mjs";
9
+ import { a as registerSseStats, i as createSseConnectionGauge, n as SSE_DEFAULT_MAX_BUFFERED_BYTES, r as openSseStream, t as SSE_DEFAULT_DRAIN_TIMEOUT_MS } from "../sseStream-BYZbpFDa.mjs";
10
+ import { n as declareRuntimeCapability } from "../runtimeCapabilities-B8IT7xiQ.mjs";
11
+ import { i as runAdmittedWork, r as registerShutdownParticipant } from "../shutdown-Cf-27xsS.mjs";
12
+ import { t as hasEvents } from "../typeGuards-CLYkmBLT.mjs";
13
13
  export { ArcError, ArcQueryParser, CircuitBreaker, CircuitBreakerError, CircuitBreakerRegistry, CircuitState, ConflictError, ForbiddenError, MONGO_DIALECT, NEUTRAL_DIALECT, NotFoundError, OrgAccessDeniedError, OrgRequiredError, RateLimitError, RedisCircuitBreakerState, SSE_DEFAULT_DRAIN_TIMEOUT_MS, SSE_DEFAULT_MAX_BUFFERED_BYTES, ServiceUnavailableError, UI_MESSAGE_STREAM_HEADERS, UnauthorizedError, ValidationError, aggregateListResponse, bareListResponse, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createDomainError, createError, createQueryParser, createReplayHub, createSseConnectionGauge, createStateMachine, declareRuntimeCapability, defineCompensation, defineErrorMapper, defineGuard, deleteResponse, errorContractSchema, forwardedStreamHeaders, getDefaultCrudSchemas, getHeader, getListQueryParams, getUserId, getUserRoles, handleRaw, hasEvents, isArcError, isJsonSchema, isReadableStream, isZodSchema, keysetListResponse, lastEventIdOf, listResponse, normalizeRoles, offsetListResponse, openSseStream, paginationSchema, pipeUIMessageStreamToReply, promoteStreamTokenToHeader, queryParams, registerShutdownParticipant, registerSseStats, requireSingleHeaderValue, responses, runAdmittedWork, simpleEqualityMatcher, toJsonSchema, withCompensation };
@@ -1,9 +1,9 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
- import { t as ArcError, u as ValidationError } from "./errors-3xaK0i9n.mjs";
3
- import { t as runObservingSend } from "./observeSend-BjilzlYl.mjs";
4
- import { h as RESERVED_QUERY_PARAMS } from "./constants-BZFsZwJh.mjs";
5
- import { t as arcLog } from "./logger-BagW7_YA.mjs";
6
- import { a as registerSseStats } from "./sseStream-DknHE2K5.mjs";
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
+ import { t as ArcError, u as ValidationError } from "./errors-DxpHZBlW.mjs";
3
+ import { t as runObservingSend } from "./observeSend-DfNkdGww.mjs";
4
+ import { h as RESERVED_QUERY_PARAMS } from "./constants-Ca2IQFy2.mjs";
5
+ import { t as arcLog } from "./logger-DJwz_-Pl.mjs";
6
+ import { a as registerSseStats } from "./sseStream-BYZbpFDa.mjs";
7
7
  import { errorContractSchema as errorContractSchema$1 } from "@classytic/repo-core/errors";
8
8
  import { readEnv } from "@classytic/primitives/environment";
9
9
  import { OPERATOR_DESCRIPTIONS, URL_OPERATORS, escapeRegex, isQueryGrammarError, readFilterClauses, readPageRequest, readSearch, readSelect, readSort } from "@classytic/repo-core/query-parser";
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-Ck1Tj4Ax.mjs";
3
- import { x as pathTouchesBlocked } from "./plugin-DsLr6L4O.mjs";
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-BBBkGgwA.mjs";
3
+ import { x as pathTouchesBlocked } from "./plugin-8Z1khbAI.mjs";
4
4
  // src/core/aggregation/normalize.ts
5
5
  /**
6
6
  * Framework cap on URL-driven aggregation limits when the host opts
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-Ck1Tj4Ax.mjs";
3
- import { d as createDomainError } from "./errors-3xaK0i9n.mjs";
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-BBBkGgwA.mjs";
3
+ import { d as createDomainError } from "./errors-DxpHZBlW.mjs";
4
4
  import fp from "fastify-plugin";
5
5
  // src/plugins/versioning.ts
6
6
  var versioning_exports = /* @__PURE__ */ __exportAll({ default: () => versioning_default });
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
- import { n as requestContext } from "./requestContext-DO9Qv0gw.mjs";
1
+ /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
+ import { n as requestContext } from "./requestContext-yc7MSgmq.mjs";
3
3
  // src/context/workScope.ts
4
4
  /** Enter a scope for `fn`, or run it inside the active one. */
5
5
  function runWorkScope(seed, fn) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classytic/arc",
3
- "version": "2.50.0",
3
+ "version": "2.52.0",
4
4
  "description": "Resource-oriented backend framework for Fastify - clean, minimal, powerful, tree-shakable",
5
5
  "type": "module",
6
6
  "exports": {
@@ -224,6 +224,10 @@
224
224
  "types": "./dist/auth/audit.d.mts",
225
225
  "default": "./dist/auth/audit.mjs"
226
226
  },
227
+ "./auth/social": {
228
+ "types": "./dist/auth/social/index.d.mts",
229
+ "default": "./dist/auth/social/index.mjs"
230
+ },
227
231
  "./usage": {
228
232
  "types": "./dist/usage/index.d.mts",
229
233
  "default": "./dist/usage/index.mjs"
@@ -312,6 +316,7 @@
312
316
  "./mcp/testing": "stable",
313
317
  "./scim": "stable",
314
318
  "./auth/audit": "stable",
319
+ "./auth/social": "stable",
315
320
  "./usage": "experimental",
316
321
  "./testing/outbox": "stable",
317
322
  "./testing/ports": "stable",
@@ -378,7 +383,7 @@
378
383
  "node": ">=22"
379
384
  },
380
385
  "peerDependencies": {
381
- "@classytic/primitives": ">=0.36.0",
386
+ "@classytic/primitives": ">=0.37.0",
382
387
  "@classytic/repo-core": ">=0.38.0",
383
388
  "@classytic/streamline": ">=2.12.0",
384
389
  "@fastify/cors": ">=11.0.0",
@@ -400,8 +405,8 @@
400
405
  "@opentelemetry/instrumentation-http": ">=0.50.0",
401
406
  "@opentelemetry/instrumentation-mongodb": ">=0.40.0",
402
407
  "@opentelemetry/sdk-node": ">=0.50.0",
403
- "better-auth": ">=1.7.15",
404
- "bullmq": ">=6.5.4",
408
+ "better-auth": ">=1.7.18",
409
+ "bullmq": ">=6.7.2",
405
410
  "fastify": ">=5.12.8",
406
411
  "fastify-raw-body": ">=6.0.3",
407
412
  "h3-js": ">=4.0.0",
@@ -508,14 +513,14 @@
508
513
  },
509
514
  "devDependencies": {
510
515
  "@arethetypeswrong/cli": "^0.18.5",
511
- "@better-auth/drizzle-adapter": "^1.7.15",
512
- "@better-auth/mongo-adapter": "^1.7.15",
516
+ "@better-auth/drizzle-adapter": "^1.7.18",
517
+ "@better-auth/mongo-adapter": "^1.7.18",
513
518
  "@biomejs/biome": "^2.6.4",
514
519
  "@classytic/dev-tools": "^0.2.1",
515
520
  "@classytic/gitkit": ">=0.3.0",
516
- "@classytic/mongokit": "^3.44.0",
521
+ "@classytic/mongokit": "^3.45.0",
517
522
  "@classytic/pgkit": "^0.1.1",
518
- "@classytic/primitives": "^0.36.0",
523
+ "@classytic/primitives": "^0.37.0",
519
524
  "@classytic/repo-core": "^0.38.0",
520
525
  "@classytic/sqlitekit": "^0.13.0",
521
526
  "@classytic/streamline": "^2.12.0",
@@ -538,9 +543,9 @@
538
543
  "@types/qs": "^6.15.1",
539
544
  "@vitest/coverage-v8": "^5.1.0",
540
545
  "ajv": "^8.20.0",
541
- "better-auth": "^1.7.15",
546
+ "better-auth": "^1.7.18",
542
547
  "better-sqlite3": "^13.0.3",
543
- "bullmq": "^6.5.4",
548
+ "bullmq": "^6.7.2",
544
549
  "dotenv": "^18.0.9",
545
550
  "drizzle-orm": "^0.45.4",
546
551
  "fast-check": "^4.10.2",
@@ -551,9 +556,9 @@
551
556
  "jose": "^6.2.15",
552
557
  "jsonwebtoken": "^9.0.3",
553
558
  "knip": "^6.44.1",
554
- "mongodb": "~7.7.0",
559
+ "mongodb": "~7.8.0",
555
560
  "mongodb-memory-server": "^11.3.0",
556
- "mongoose": "^9.11.4",
561
+ "mongoose": "^9.12.0",
557
562
  "publint": "^0.3.25",
558
563
  "tsdown": "^0.23.4",
559
564
  "typebox": "^1.4.3",
@@ -24,7 +24,7 @@ const app = await createApp({
24
24
  });
25
25
  ```
26
26
 
27
- Result also exposes `plugin`, `authenticate`, `optionalAuthenticate`, `permissions` (`requireOrgRole`, `requireOrgMembership`, `requireTeamMembership`), `openapi`.
27
+ Result also exposes `plugin`, `authenticate`, `optionalAuthenticate`, `requireSensitiveSession`, `permissions` (`requireOrgRole`, `requireOrgMembership`, `requireTeamMembership`), `openapi`.
28
28
 
29
29
  ## Options
30
30
 
@@ -38,6 +38,7 @@ Result also exposes `plugin`, `authenticate`, `optionalAuthenticate`, `permissio
38
38
  | `openapi` | `true` (default) extracts from `auth.api`; `false`; or a manual spec |
39
39
  | `userFields` | Extra user fields merged into OpenAPI schemas |
40
40
  | `exposeAuthErrors` | Show detail in 401 (debug only) |
41
+ | `sensitivePaths: ['/admin', ...]` | Route prefixes that skip the cookie cache (see below) |
41
42
 
42
43
  ```typescript
43
44
  createBetterAuthAdapter({
@@ -48,6 +49,31 @@ createBetterAuthAdapter({
48
49
 
49
50
  Gate `credentials` routes with `requireServiceScope(...)`.
50
51
 
52
+ ## Auth routes
53
+
54
+ `${basePath}/*` answers GET and POST, plus any verb a plugin endpoint in `auth.api` declares (SCIM, OAuth provider). Never TRACE or QUERY. OPTIONS preflight is `@fastify/cors`'s; set BA `trustedOrigins` to your CORS origins (`mirrorTrustedOriginsFromCors`).
55
+
56
+ BA rate-limits by `X-Forwarded-For`, which clients can forge. Arc sets `x-arc-client-ip` from `request.ip` (honors `trustProxy`); use it:
57
+
58
+ ```typescript
59
+ import { BETTER_AUTH_CLIENT_IP_HEADER } from '@classytic/arc/auth';
60
+ betterAuth({ advanced: { ipAddress: { ipAddressHeaders: [BETTER_AUTH_CLIENT_IP_HEADER] } } });
61
+ ```
62
+
63
+ ## Sensitive routes (revoked or banned sessions)
64
+
65
+ With BA `session.cookieCache`, a revoked session or a newly banned user still passes `authenticate` until the cache `maxAge` lapses. Default; unchanged. For account and security settings, admin and money-moving routes, opt in to BA's own sensitive-route read (`getSession` with `disableCookieCache`):
66
+
67
+ ```typescript
68
+ const ba = createBetterAuthAdapter({ auth, sensitivePaths: ['/admin', '/api/billing'] });
69
+ defineResource({ name: 'payout', routeGuards: [ba.requireSensitiveSession], /* ... */ });
70
+ fastify.post('/me/email', { preHandler: [fastify.authenticate, ba.requireSensitiveSession] }, h);
71
+ // A recent sign-in (Better Auth `session.freshAge`, default 1 day; 403 when stale):
72
+ fastify.post('/me/password', { preHandler: [fastify.authenticate, ba.requireFreshSession] }, h);
73
+ ```
74
+
75
+ Revoked or expired → 401; admin-plugin ban in force → 403. Cookie and bearer alike. Cost: one session-store read per request (bearer sessions already read the store, so the preHandler makes it two; `sensitivePaths` never adds one). Not BA's `freshAge` (recent sign-in).
76
+
51
77
  ## Org context flow (`orgContext: true`)
52
78
 
53
79
  1. `auth.api.getSession()` in-process.