@classytic/arc 2.49.0 → 2.51.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 (159) hide show
  1. package/dist/{EventTransport-DbHZK230.mjs → EventTransport-K7Q9WPjm.mjs} +2 -2
  2. package/dist/{HookSystem-DMoeJ6Do.mjs → HookSystem-DBAu9uNT.mjs} +2 -2
  3. package/dist/{ResourceRegistry-CP-iTcKy.mjs → ResourceRegistry-BelzCRMy.mjs} +2 -2
  4. package/dist/{acquire-CB0va87C.mjs → acquire-B0zhfGSm.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-DHO94aV2.mjs → authorizationDecision-Dxj_cy6N.mjs} +4 -4
  13. package/dist/{boundedMap-C51EUUOm.mjs → boundedMap-DOBai-H3.mjs} +1 -1
  14. package/dist/{buildHandler-9DuwEKvr.mjs → buildHandler-Dyl8P9j0.mjs} +5 -5
  15. package/dist/cache/index.mjs +4 -4
  16. package/dist/{caching-COTX3sDa.mjs → caching-CUmaNL8Y.mjs} +2 -2
  17. package/dist/{claimed-C7T1nHlo.mjs → claimed-DJPk4VZr.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-DOnfMd7i.mjs → constants-DH41jnNT.mjs} +1 -1
  27. package/dist/context/index.mjs +5 -5
  28. package/dist/core/index.mjs +7 -7
  29. package/dist/{core-BoEdFDDw.mjs → core-DPmRWlpx.mjs} +3 -3
  30. package/dist/{createActionRouter-CpTn15dm.mjs → createActionRouter-B1xhER6i.mjs} +5 -5
  31. package/dist/{createAggregationRouter-CD_Hydp0.mjs → createAggregationRouter-CNntJL-z.mjs} +7 -7
  32. package/dist/{createApp-Be6XTGD9.mjs → createApp-DpG26bCu.mjs} +29 -29
  33. package/dist/{defineAggregation-BI5pRb8c.mjs → defineAggregation-rI3EbZUg.mjs} +1 -1
  34. package/dist/{defineResource-BAzNu5Um.mjs → defineResource-5DcG_wlI.mjs} +8 -8
  35. package/dist/discovery/index.mjs +1 -1
  36. package/dist/docs/index.mjs +3 -3
  37. package/dist/{elevation-DupGuM41.mjs → elevation-XFu7J3aj.mjs} +5 -5
  38. package/dist/encryption/index.mjs +3 -3
  39. package/dist/{errorHandler-DA03vRqp.mjs → errorHandler-xDVUWOMu.mjs} +3 -3
  40. package/dist/{errors-BpYV859Y.mjs → errors-KBZ3tQk5.mjs} +1 -1
  41. package/dist/{eventPlugin-D7LYtYzL.mjs → eventPlugin-C4lNj2Dw.mjs} +8 -8
  42. package/dist/{eventTypes-BqA-N-Uz.mjs → eventTypes-DZRoUAdk.mjs} +2 -2
  43. package/dist/events/index.mjs +8 -8
  44. package/dist/events/transports/redis-stream-entry.mjs +4 -4
  45. package/dist/events/transports/redis.mjs +2 -2
  46. package/dist/factory/index.mjs +6 -6
  47. package/dist/{fieldTypes-EFWxCkZ5.mjs → fieldTypes-DrXUW1jc.mjs} +2 -2
  48. package/dist/{fields-CT1Erg7o.mjs → fields-C5J8WTd2.mjs} +1 -1
  49. package/dist/{filter-merge-B1eJ1pMx.mjs → filter-merge-DTjYoDrj.mjs} +1 -1
  50. package/dist/{generate-Cr0ULavs.mjs → generate-SA8oMlLB.mjs} +2 -2
  51. package/dist/{headers-D4bncIOf.mjs → headers-D5wrBLOk.mjs} +2 -2
  52. package/dist/{health-DN_pUVMX.mjs → health-BLal039H.mjs} +1 -1
  53. package/dist/{health-BoFxrkJE.mjs → health-vEo3fni4.mjs} +1 -1
  54. package/dist/hooks/index.mjs +2 -2
  55. package/dist/http-cache/index.mjs +4 -4
  56. package/dist/http-cache/purgers/cloudflare.mjs +2 -2
  57. package/dist/http-cache/purgers/fastly.mjs +2 -2
  58. package/dist/http-cache/testing/index.mjs +1 -1
  59. package/dist/idempotency/index.mjs +7 -7
  60. package/dist/idempotency/redis.mjs +2 -2
  61. package/dist/index.mjs +11 -11
  62. package/dist/{init-C4a24wD2.mjs → init-DeKHaNZn.mjs} +22 -22
  63. package/dist/integrations/event-gateway.mjs +2 -2
  64. package/dist/integrations/index.mjs +1 -1
  65. package/dist/integrations/jobs/index.mjs +3 -3
  66. package/dist/integrations/mcp/index.mjs +2 -2
  67. package/dist/integrations/mcp/testing.mjs +2 -2
  68. package/dist/integrations/streamline.mjs +3 -3
  69. package/dist/integrations/webhooks.mjs +4 -4
  70. package/dist/integrations/websocket-pushref-redis.mjs +1 -1
  71. package/dist/integrations/websocket-redis.mjs +1 -1
  72. package/dist/integrations/websocket.mjs +2 -2
  73. package/dist/{jsonBody-DoTt5BS6.mjs → jsonBody-rDPGT5A9.mjs} +2 -2
  74. package/dist/{keys--l9n7aOC.mjs → keys-t7i-lJ2r.mjs} +1 -1
  75. package/dist/{loadResources-rygByIQA.mjs → loadResources-CcupAVJH.mjs} +3 -3
  76. package/dist/{loadResourcesFromEntry-ItNBIQ5w.mjs → loadResourcesFromEntry-BpjYlaoj.mjs} +2 -2
  77. package/dist/logger/index.mjs +2 -2
  78. package/dist/{logger-UbknHqHy.mjs → logger-IL7Btm-N.mjs} +1 -1
  79. package/dist/{mcpPlugin-CTkk4RP8.mjs → mcpPlugin-BsdH7Vot.mjs} +21 -21
  80. package/dist/{memory-C47xVsjX.mjs → memory-Dkp6ZD3F.mjs} +3 -3
  81. package/dist/{metrics-TJyAb1Xk.mjs → metrics-CDPqgdKr.mjs} +3 -3
  82. package/dist/middleware/index.mjs +3 -3
  83. package/dist/migrations/index.mjs +2 -2
  84. package/dist/{module-CWiqsXnh.mjs → module-KFxT1Iuk.mjs} +1 -1
  85. package/dist/{multipartBody-BdG1qbn1.mjs → multipartBody-BHktuarE.mjs} +1 -1
  86. package/dist/{observeSend-DrA3ADFN.mjs → observeSend-CY-sLanc.mjs} +1 -1
  87. package/dist/{openapi-D6MAbYpv.mjs → openapi-DbeXiy2v.mjs} +6 -6
  88. package/dist/outbox-admin/index.mjs +5 -5
  89. package/dist/{outbox-module-D5QABFQW.mjs → outbox-module-BWqkTE8-.mjs} +7 -7
  90. package/dist/permissions/index.mjs +7 -7
  91. package/dist/{permissions-CFsmdYUt.mjs → permissions-e5YMrFbm.mjs} +9 -9
  92. package/dist/{pipe-B_05AgGt.mjs → pipe-CMnKfdF4.mjs} +2 -2
  93. package/dist/pipeline/index.mjs +2 -2
  94. package/dist/{plan-BnlNJhrj.mjs → plan-BvLJGm3U.mjs} +1 -1
  95. package/dist/{plugin-CrMPYbdj.mjs → plugin-DYmu8uT4.mjs} +24 -24
  96. package/dist/plugins/index.mjs +18 -18
  97. package/dist/plugins/response-cache.mjs +4 -4
  98. package/dist/plugins/tracing-entry.mjs +2 -2
  99. package/dist/{pluralize-oVIxJ4CY.mjs → pluralize-ClwfBdIx.mjs} +1 -1
  100. package/dist/presets/filesUpload.mjs +5 -5
  101. package/dist/presets/index.mjs +2 -2
  102. package/dist/presets/multiTenant.mjs +5 -5
  103. package/dist/presets/search.mjs +2 -2
  104. package/dist/{presets-CUd3L7v6.mjs → presets-DX_lPabi.mjs} +4 -4
  105. package/dist/{projection-DowJlIto.mjs → projection-DnZiFPPE.mjs} +2 -2
  106. package/dist/{purger.types-BjKy8869.mjs → purger.types-BEzTVDOU.mjs} +1 -1
  107. package/dist/{queryCachePlugin-BvB3k_Fh.mjs → queryCachePlugin-C57-Nj-g.mjs} +6 -6
  108. package/dist/{rateLimitKey-56nH1cWN.mjs → rateLimitKey-B1RxyGt3.mjs} +1 -1
  109. package/dist/{realtime-DXGBPtYK.mjs → realtime-C-VIoXMg.mjs} +67 -11
  110. package/dist/registry/index.mjs +3 -3
  111. package/dist/{registry-Biz-6sEZ.mjs → registry-DbQvODPH.mjs} +2 -2
  112. package/dist/{relay-DEIoMntZ.mjs → relay-B61seKq1.mjs} +5 -5
  113. package/dist/{renewingLease-BCJpW9-u.mjs → renewingLease-Dp7wmzNN.mjs} +1 -1
  114. package/dist/{replyHelpers-DliJNb0-.mjs → replyHelpers-CHii_jIO.mjs} +2 -2
  115. package/dist/{requestContext-tUgLt9Ky.mjs → requestContext-C_mbAm8o.mjs} +1 -1
  116. package/dist/{requirement-0l2DApiQ.mjs → requirement-C8OsWLYp.mjs} +1 -1
  117. package/dist/{resourceRateLimit-iSXF8rLH.mjs → resourceRateLimit-DhbQZjE2.mjs} +2 -2
  118. package/dist/{rolldown-runtime-gKJR3o-6.mjs → rolldown-runtime-HTi8KV7V.mjs} +1 -1
  119. package/dist/{routeValidator-xNYA4rr1.mjs → routeValidator-DnQ2BGnH.mjs} +1 -1
  120. package/dist/{runtimeCapabilities-BQK-GrYe.mjs → runtimeCapabilities-G9QXHov1.mjs} +1 -1
  121. package/dist/{schedules-D9iMVFhF.mjs → schedules-DAthT5O3.mjs} +5 -5
  122. package/dist/{schemaConverter-cIh4oX9a.mjs → schemaConverter-BOt_ed78.mjs} +2 -2
  123. package/dist/{schemaIR-BsY4y9VP.mjs → schemaIR-MZVVj6Cw.mjs} +14 -14
  124. package/dist/schemas/index.mjs +1 -1
  125. package/dist/scim/index.mjs +2 -2
  126. package/dist/scope/index.mjs +5 -5
  127. package/dist/{scope-QyhM9w8z.mjs → scope-btg-225w.mjs} +4 -4
  128. package/dist/{shutdown-BM7Q0h4B.mjs → shutdown-Dfy8La90.mjs} +1 -1
  129. package/dist/{streamFrames-B3ZJfI02.mjs → simpleEqualityMatcher-D5dOqbbj.mjs} +2 -19
  130. package/dist/{sse-ofvlcTQQ.mjs → sse-DivxX1m6.mjs} +7 -7
  131. package/dist/{sseStream-BxQW7hPq.mjs → sseStream-hQxQjvre.mjs} +2 -2
  132. package/dist/{store-helpers-_FRhHDyv.mjs → store-helpers-DfqfssAw.mjs} +1 -1
  133. package/dist/{streaming-HZr63UiM.mjs → streaming-CQiOktsh.mjs} +1 -1
  134. package/dist/{subscriberIdentity-DSgnoT_D.mjs → subscriberIdentity-Bf8VLqA7.mjs} +1 -1
  135. package/dist/{tenancy-_ukT0oBt.mjs → tenancy-Btmaf1MB.mjs} +2 -2
  136. package/dist/{tenantPreparation-DSlQI53c.mjs → tenantPreparation-4e3qyb6q.mjs} +4 -4
  137. package/dist/testing/cleanupStoreContract.mjs +1 -1
  138. package/dist/testing/index.mjs +11 -11
  139. package/dist/testing/outboxStoreContract.mjs +2 -2
  140. package/dist/testing/requiredPorts.mjs +2 -2
  141. package/dist/testing/storageContract.mjs +1 -1
  142. package/dist/{timing-Z8p-Zlw1.mjs → timing-DXx0IWyi.mjs} +1 -1
  143. package/dist/{transactionContext-DBbSTfY3.mjs → transactionContext-DperjON1.mjs} +1 -1
  144. package/dist/{typeGuards-_6nNQqgq.mjs → typeGuards-eoQLIOh6.mjs} +1 -1
  145. package/dist/types/index.mjs +1 -1
  146. package/dist/types/storage.mjs +1 -1
  147. package/dist/{types-CrOlZ4rY.mjs → types-CcpISJe8.mjs} +4 -4
  148. package/dist/usage/index.mjs +4 -4
  149. package/dist/{userHelpers-CBKx3XJN.mjs → userHelpers-Cp5zqlEN.mjs} +1 -1
  150. package/dist/utils/index.d.mts +2 -48
  151. package/dist/utils/index.mjs +13 -13
  152. package/dist/{utils--HE8R8sH.mjs → utils-dKN-_315.mjs} +7 -7
  153. package/dist/{validate-BUeE2MLR.mjs → validate-BZHaAdgy.mjs} +3 -3
  154. package/dist/{versioning-qYgqwOhL.mjs → versioning-CPLP0VbB.mjs} +3 -3
  155. package/dist/{workScope-C-1QHNmV.mjs → workScope-BI72KXsI.mjs} +2 -2
  156. package/package.json +19 -14
  157. package/skills/arc/references/api-reference.md +1 -1
  158. package/skills/arc/references/auth-better-auth.md +27 -1
  159. package/skills/arc/references/production-realtime.md +1 -1
@@ -7,8 +7,8 @@ import { a as SSE_DEFAULT_DRAIN_TIMEOUT_MS, c as SseStreamOptions, i as register
7
7
  import { f as getUserId, m as normalizeRoles, p as getUserRoles, t as AnyRecord } from "../base-HXNgPQww.mjs";
8
8
  import { errorContractSchema } from "@classytic/repo-core/errors";
9
9
  import { FilterClause } from "@classytic/repo-core/query-parser";
10
- import { FastifyInstance, FastifyReply, FastifyRequest, RouteHandlerMethod } from "fastify";
11
10
  import { ChangeEntry, ChangeLogStore, ChangesSinceOptions } from "@classytic/repo-core/sync";
11
+ import { FastifyInstance, FastifyReply, FastifyRequest, RouteHandlerMethod } from "fastify";
12
12
  export declare const CircuitState: {
13
13
  readonly CLOSED: "CLOSED";
14
14
  readonly OPEN: "OPEN";
@@ -585,52 +585,6 @@ export declare class ArcQueryParser implements QueryParserInterface {
585
585
  }
586
586
  /** Create a new ArcQueryParser instance. */
587
587
  export declare function createQueryParser(options?: ArcQueryParserOptions): ArcQueryParser;
588
- /**
589
- * SSE control-frame vocabulary shared by every arc stream and `@classytic/arc-next/sse`.
590
- *
591
- * Kept apart from `replayStream.ts` so a feed that only names the frames
592
- * (`realtimePlugin`) does not pull the replay hub, and `node:crypto`, into its chunk.
593
- */
594
- /**
595
- * SSE control frame names. The same literals ship from `@classytic/arc-next/sse`;
596
- * a test in each package pins them.
597
- */
598
- export declare const STREAM_FRAMES: {
599
- readonly READY: "ready";
600
- readonly RESYNC: "resync";
601
- readonly REVOKED: "revoked";
602
- readonly RETRY: "retry";
603
- };
604
- type StreamFrameName = (typeof STREAM_FRAMES)[keyof typeof STREAM_FRAMES];
605
- type ResyncReason = "cursor_expired" | "gap_too_large" | "cursor_invalid";
606
- /**
607
- * `event: ready` (no `id:`). The first frame on every connection. `cursor` is
608
- * present only on a replayable stream (the replay hub always sends it).
609
- * `realtimePlugin` keeps its `resources` and `operations` fields next to these.
610
- */
611
- interface ReadyFrame {
612
- cursor?: string;
613
- resumed: boolean;
614
- }
615
- /** `event: resync` (no `id:`). The gap could not be replayed: reload the snapshot, then continue from `cursor`. */
616
- interface ResyncFrame {
617
- cursor: string;
618
- reason: ResyncReason;
619
- }
620
- /** `event: revoked` (no `id:`). Access ended; the server closes the stream right after this frame. */
621
- interface RevokedFrame {
622
- reason: string;
623
- }
624
- /**
625
- * `event: retry` (no `id:`). NOT final: the server closes right after, and the client
626
- * should reconnect at once (no backoff) with its `Last-Event-ID`, so the stream is
627
- * authorized afresh. Sent by the replay hub's `revalidate` (`{ close: 'retry' }` or
628
- * `maxConsecutiveFailures`). A client that does not know the frame still reconnects
629
- * with its normal backoff, so the frame is safe to send to older clients.
630
- */
631
- interface RetryFrame {
632
- reason: string;
633
- }
634
588
  /**
635
589
  * Identity keys a revoke matches on, e.g. `{ userId }`, `{ sessionId }`, `{ deviceId }`.
636
590
  * Values are compared as strings (`String(value)`), so an ObjectId or a number
@@ -1674,4 +1628,4 @@ interface EventsDecorator {
1674
1628
  export declare function hasEvents(instance: FastifyInstance): instance is FastifyInstance & {
1675
1629
  events: EventsDecorator;
1676
1630
  };
1677
- export { type AnyAsyncFn, ArcError, type ArcHeaders, type ArcQueryParserOptions, type CircuitBreakerOptions, type CircuitBreakerRedisLike, type CircuitBreakerSharedState, type CircuitBreakerStats, type CompensationDefinition, type CompensationError, type CompensationHooks, type CompensationResult, type CompensationStep, ConflictError, type ErrorOptions, type EventsDecorator, type FilterDialect, ForbiddenError, type Guard, type GuardConfig, type JsonSchema, type JsonSchemaTarget, NotFoundError, OrgAccessDeniedError, OrgRequiredError, type PipeUIMessageStreamOptions, RateLimitError, type ReadyFrame, type RedisCircuitBreakerStateOptions, type ReplayCloseVerdict, type ReplayHub, type ReplayHubOptions, type ReplayHubStats, type ReplayHubTimers, type ReplayReadScope, type ReplaySubscription, type ResyncFrame, type ResyncReason, type RetryFrame, type RevokeTarget, type RevokedFrame, type RuntimeCapabilityDeclaration, type SSEStats, SSE_DEFAULT_DRAIN_TIMEOUT_MS, SSE_DEFAULT_MAX_BUFFERED_BYTES, type SchemaIo, ServiceUnavailableError, type ShutdownParticipant, type SseConnectionGauge, type SseStream, type SseStreamOptions, type StateMachine, type StreamFrameName, type TransitionConfig, UnauthorizedError, type UnconvertibleMode, ValidationError, createDomainError, createError, createSseConnectionGauge, errorContractSchema, getHeader, getUserId, getUserRoles, isArcError, normalizeRoles, openSseStream, registerSseStats, requireSingleHeaderValue };
1631
+ export { type AnyAsyncFn, ArcError, type ArcHeaders, type ArcQueryParserOptions, type CircuitBreakerOptions, type CircuitBreakerRedisLike, type CircuitBreakerSharedState, type CircuitBreakerStats, type CompensationDefinition, type CompensationError, type CompensationHooks, type CompensationResult, type CompensationStep, ConflictError, type ErrorOptions, type EventsDecorator, type FilterDialect, ForbiddenError, type Guard, type GuardConfig, type JsonSchema, type JsonSchemaTarget, NotFoundError, OrgAccessDeniedError, OrgRequiredError, type PipeUIMessageStreamOptions, RateLimitError, type RedisCircuitBreakerStateOptions, type ReplayCloseVerdict, type ReplayHub, type ReplayHubOptions, type ReplayHubStats, type ReplayHubTimers, type ReplayReadScope, type ReplaySubscription, type RevokeTarget, type RuntimeCapabilityDeclaration, type SSEStats, SSE_DEFAULT_DRAIN_TIMEOUT_MS, SSE_DEFAULT_MAX_BUFFERED_BYTES, type SchemaIo, ServiceUnavailableError, type ShutdownParticipant, type SseConnectionGauge, type SseStream, type SseStreamOptions, type StateMachine, type TransitionConfig, UnauthorizedError, type UnconvertibleMode, ValidationError, createDomainError, createError, createSseConnectionGauge, errorContractSchema, getHeader, getUserId, getUserRoles, isArcError, normalizeRoles, openSseStream, registerSseStats, requireSingleHeaderValue };
@@ -1,13 +1,13 @@
1
- /*! @classytic/arc v2.49.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-BpYV859Y.mjs";
3
- import { n as simpleEqualityMatcher, t as STREAM_FRAMES } from "../streamFrames-B3ZJfI02.mjs";
4
- import { n as requireSingleHeaderValue, t as getHeader } from "../headers-D4bncIOf.mjs";
5
- import { n as getUserRoles, r as normalizeRoles, t as getUserId } from "../userHelpers-CBKx3XJN.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--HE8R8sH.mjs";
7
- import { a as isZodSchema, i as isJsonSchema, n as convertRouteSchema, o as toJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-cIh4oX9a.mjs";
8
- import { a as promoteStreamTokenToHeader, i as pipeUIMessageStreamToReply, n as forwardedStreamHeaders, r as isReadableStream, t as UI_MESSAGE_STREAM_HEADERS } from "../streaming-HZr63UiM.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-BxQW7hPq.mjs";
10
- import { n as declareRuntimeCapability } from "../runtimeCapabilities-BQK-GrYe.mjs";
11
- import { i as runAdmittedWork, r as registerShutdownParticipant } from "../shutdown-BM7Q0h4B.mjs";
12
- import { t as hasEvents } from "../typeGuards-_6nNQqgq.mjs";
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, STREAM_FRAMES, 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
+ /*! @classytic/arc v2.51.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-KBZ3tQk5.mjs";
3
+ import { t as simpleEqualityMatcher } from "../simpleEqualityMatcher-D5dOqbbj.mjs";
4
+ import { n as requireSingleHeaderValue, t as getHeader } from "../headers-D5wrBLOk.mjs";
5
+ import { n as getUserRoles, r as normalizeRoles, t as getUserId } from "../userHelpers-Cp5zqlEN.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-dKN-_315.mjs";
7
+ import { a as isZodSchema, i as isJsonSchema, n as convertRouteSchema, o as toJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-BOt_ed78.mjs";
8
+ import { a as promoteStreamTokenToHeader, i as pipeUIMessageStreamToReply, n as forwardedStreamHeaders, r as isReadableStream, t as UI_MESSAGE_STREAM_HEADERS } from "../streaming-CQiOktsh.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-hQxQjvre.mjs";
10
+ import { n as declareRuntimeCapability } from "../runtimeCapabilities-G9QXHov1.mjs";
11
+ import { i as runAdmittedWork, r as registerShutdownParticipant } from "../shutdown-Dfy8La90.mjs";
12
+ import { t as hasEvents } from "../typeGuards-eoQLIOh6.mjs";
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,14 +1,14 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
- import { t as ArcError, u as ValidationError } from "./errors-BpYV859Y.mjs";
3
- import { t as runObservingSend } from "./observeSend-DrA3ADFN.mjs";
4
- import { h as RESERVED_QUERY_PARAMS } from "./constants-DOnfMd7i.mjs";
5
- import { t as arcLog } from "./logger-UbknHqHy.mjs";
6
- import { a as registerSseStats } from "./sseStream-BxQW7hPq.mjs";
7
- import { t as STREAM_FRAMES } from "./streamFrames-B3ZJfI02.mjs";
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ import { t as ArcError, u as ValidationError } from "./errors-KBZ3tQk5.mjs";
3
+ import { t as runObservingSend } from "./observeSend-CY-sLanc.mjs";
4
+ import { h as RESERVED_QUERY_PARAMS } from "./constants-DH41jnNT.mjs";
5
+ import { t as arcLog } from "./logger-IL7Btm-N.mjs";
6
+ import { a as registerSseStats } from "./sseStream-hQxQjvre.mjs";
8
7
  import { errorContractSchema as errorContractSchema$1 } from "@classytic/repo-core/errors";
9
8
  import { readEnv } from "@classytic/primitives/environment";
10
9
  import { OPERATOR_DESCRIPTIONS, URL_OPERATORS, escapeRegex, isQueryGrammarError, readFilterClauses, readPageRequest, readSearch, readSelect, readSort } from "@classytic/repo-core/query-parser";
11
10
  import { createCipheriv, createDecipheriv, hkdfSync, randomBytes } from "node:crypto";
11
+ import { STREAM_FRAMES } from "@classytic/repo-core/sync";
12
12
  // src/utils/filter-dialect.ts
13
13
  /**
14
14
  * Filter dialects — what `ArcQueryParser` EMITS. Reading a URL (keys, operators, coercion,
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-gKJR3o-6.mjs";
3
- import { x as pathTouchesBlocked } from "./plugin-CrMPYbdj.mjs";
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-HTi8KV7V.mjs";
3
+ import { x as pathTouchesBlocked } from "./plugin-DYmu8uT4.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.49.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-gKJR3o-6.mjs";
3
- import { d as createDomainError } from "./errors-BpYV859Y.mjs";
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-HTi8KV7V.mjs";
3
+ import { d as createDomainError } from "./errors-KBZ3tQk5.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.49.0 | MIT | https://classytic.com */
2
- import { n as requestContext } from "./requestContext-tUgLt9Ky.mjs";
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ import { n as requestContext } from "./requestContext-C_mbAm8o.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.49.0",
3
+ "version": "2.51.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,8 +383,8 @@
378
383
  "node": ">=22"
379
384
  },
380
385
  "peerDependencies": {
381
- "@classytic/primitives": ">=0.36.0",
382
- "@classytic/repo-core": ">=0.37.0",
386
+ "@classytic/primitives": ">=0.37.0",
387
+ "@classytic/repo-core": ">=0.38.0",
383
388
  "@classytic/streamline": ">=2.12.0",
384
389
  "@fastify/cors": ">=11.0.0",
385
390
  "@fastify/helmet": ">=13.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,15 +513,15 @@
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",
519
- "@classytic/repo-core": "^0.37.0",
523
+ "@classytic/primitives": "^0.37.0",
524
+ "@classytic/repo-core": "^0.38.0",
520
525
  "@classytic/sqlitekit": "^0.13.0",
521
526
  "@classytic/streamline": "^2.12.0",
522
527
  "@electric-sql/pglite": "^0.5.15",
@@ -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",
@@ -25,7 +25,7 @@ Import only from these subpaths (tree-shaken, no deep imports). Authoritative li
25
25
  | `/context`, `/logger` | `requestContext`, `transactionContext`, `runWorkScope`; `arcLog`, `configureArcLogger` |
26
26
  | `/registry`, `/discovery`, `/docs` | `ResourceRegistry`, `introspectionPlugin`; `discoverResources`; `openApiPlugin`, `scalarPlugin`, `buildOpenApiSpec` |
27
27
  | `/schemas` | `Type`, `ArcListResponse`, `ArcErrorResponse`, `ArcPaginationQuery` |
28
- | `/utils` | `createStateMachine`, `CircuitBreaker`, `withCompensation`, `defineGuard`, `declareRuntimeCapability`, `createQueryParser`, `ArcQueryParser`, `createError`, `pipeUIMessageStreamToReply`, `openSseStream`, `createReplayHub`, `lastEventIdOf`, `STREAM_FRAMES`, `registerSseStats`, `createSseConnectionGauge`, `listResponse`, `errorContractSchema`, error classes |
28
+ | `/utils` | `createStateMachine`, `CircuitBreaker`, `withCompensation`, `defineGuard`, `declareRuntimeCapability`, `createQueryParser`, `ArcQueryParser`, `createError`, `pipeUIMessageStreamToReply`, `openSseStream`, `createReplayHub`, `lastEventIdOf`, `registerSseStats`, `createSseConnectionGauge`, `listResponse`, `errorContractSchema`, error classes |
29
29
  | `/migrations` | `defineMigration`, `MigrationRunner`, `MigrationRegistry`, `MongoMigrationStore` |
30
30
  | `/cleanup` | `createDataCleanupModule`, `createCleanupService`, `createCleanupRegistry`, `recipeFromSteps` |
31
31
  | `/encryption` | `encryptionPlugin`, `encryptField`, `decryptField`, `createStaticKeyProvider` |
@@ -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.
@@ -68,7 +68,7 @@ await app.events.subscribe('alert.*', () => hub.notify()); // the bus only WAK
68
68
  await hub.attach(openSseStream(req, reply), ctx, lastEventIdOf(req));
69
69
  ```
70
70
 
71
- - Frames: `ready {cursor, resumed}` first, then the replay or one `resync {cursor, reason}`, then live (`id:` = cursor). `revoked {reason}` then close (final). `retry {reason}` then close (not final: reconnect now). Names: `STREAM_FRAMES`, same literals as `@classytic/arc-next/sse`.
71
+ - Frames: `ready {cursor, resumed}` first, then the replay or one `resync {cursor, reason}`, then live (`id:` = cursor). `revoked {reason}` then close (final). `retry {reason}` then close (not final: reconnect now). Names: `STREAM_FRAMES` from `@classytic/repo-core/sync` (the contract owner; `@classytic/arc-next/sse` reads the same one).
72
72
  - `openSseStream` waits for `drain` (`maxBufferedBytes` 1 MiB, `drainTimeoutMs` 10 s; `0` bytes = old fail-fast); the hub paces a replay on `needsDrain`/`drain()`, so a large resume is not cut.
73
73
  - A live entry the replay already sent goes out once. Entries hidden by `toFrame` are followed by an id-only frame, so the client cursor keeps up.
74
74
  - Gap over `maxReplay` (500) → `gap_too_large`; `CursorExpiredError` → `cursor_expired`; invalid or ahead → `cursor_invalid`. Other store errors close with no frame.