@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
@@ -0,0 +1,311 @@
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ import { createHash, randomBytes, timingSafeEqual } from "node:crypto";
3
+ import { APIError, createAuthEndpoint, createAuthMiddleware, getOAuthState } from "better-auth/api";
4
+ import { makeSignature } from "better-auth/crypto";
5
+ import { parseUserOutput } from "better-auth/db";
6
+ import { isGoogleHostedDomainAllowed, verifyGoogleIdToken } from "better-auth/social-providers";
7
+ // src/auth/social/providers.ts
8
+ /** Comma list from an env value, trimmed, empties dropped. */
9
+ function list(value) {
10
+ return (value ?? "").split(",").map((item) => item.trim()).filter(Boolean);
11
+ }
12
+ /** An env value, trimmed; `undefined` when unset or blank. */
13
+ function read(env, key) {
14
+ const value = env[key]?.trim();
15
+ return value ? value : void 0;
16
+ }
17
+ /** Google profile → Better Auth user fields. `emailVerified` only on a literal `true`. */
18
+ function mapGoogleProfile(profile) {
19
+ const joined = [profile.given_name, profile.family_name].filter(Boolean).join(" ");
20
+ return {
21
+ name: profile.name || joined,
22
+ image: profile.picture || void 0,
23
+ emailVerified: profile.email_verified === true
24
+ };
25
+ }
26
+ /**
27
+ * Google `getUserInfo` that verifies the id token (signature against Google's JWKS, issuer,
28
+ * audience = every configured client id, expiry, max age 1h, nonce when the flow bound one)
29
+ * before mapping. `null` (sign-in refused) on any failure, as Better Auth's own providers do.
30
+ */
31
+ async function verifiedGoogleUserInfo(token, config) {
32
+ if (!token.idToken) return null;
33
+ const payload = await verifyGoogleIdToken({
34
+ token: token.idToken,
35
+ audience: config.clientId,
36
+ nonce: token.expectedIdTokenNonce
37
+ });
38
+ if (!payload || typeof payload.sub !== "string" || typeof payload.email !== "string") return null;
39
+ if (!isGoogleHostedDomainAllowed(config.hd, payload.hd)) return null;
40
+ const profile = payload;
41
+ const mapped = await config.mapProfileToUser?.(profile);
42
+ return {
43
+ user: {
44
+ email: profile.email,
45
+ ...mapGoogleProfile(profile),
46
+ ...mapped
47
+ },
48
+ data: profile
49
+ };
50
+ }
51
+ const PRESETS = {
52
+ google: {
53
+ name: "Google",
54
+ required: ["GOOGLE_CLIENT_ID", "GOOGLE_CLIENT_SECRET"],
55
+ build: (env) => {
56
+ const audiences = list(read(env, "GOOGLE_ID_TOKEN_AUDIENCES"));
57
+ const clientId = read(env, "GOOGLE_CLIENT_ID");
58
+ return {
59
+ clientId: audiences.length > 0 ? [clientId, ...audiences] : clientId,
60
+ clientSecret: read(env, "GOOGLE_CLIENT_SECRET"),
61
+ disableDefaultScope: true,
62
+ scope: [
63
+ "openid",
64
+ "email",
65
+ "profile"
66
+ ],
67
+ includeGrantedScopes: false,
68
+ prompt: "select_account",
69
+ accessType: "online",
70
+ mapProfileToUser: mapGoogleProfile
71
+ };
72
+ }
73
+ },
74
+ github: {
75
+ name: "GitHub",
76
+ required: ["GITHUB_CLIENT_ID", "GITHUB_CLIENT_SECRET"],
77
+ build: (env) => ({
78
+ clientId: read(env, "GITHUB_CLIENT_ID"),
79
+ clientSecret: read(env, "GITHUB_CLIENT_SECRET")
80
+ })
81
+ },
82
+ apple: {
83
+ name: "Apple",
84
+ required: ["APPLE_CLIENT_ID", "APPLE_CLIENT_SECRET"],
85
+ trustedOrigins: ["https://appleid.apple.com"],
86
+ build: (env) => {
87
+ const bundle = read(env, "APPLE_APP_BUNDLE_IDENTIFIER");
88
+ return {
89
+ clientId: read(env, "APPLE_CLIENT_ID"),
90
+ clientSecret: read(env, "APPLE_CLIENT_SECRET"),
91
+ ...bundle ? { appBundleIdentifier: bundle } : {}
92
+ };
93
+ }
94
+ },
95
+ facebook: {
96
+ name: "Facebook",
97
+ required: ["FACEBOOK_CLIENT_ID", "FACEBOOK_CLIENT_SECRET"],
98
+ build: (env) => ({
99
+ clientId: read(env, "FACEBOOK_CLIENT_ID"),
100
+ clientSecret: read(env, "FACEBOOK_CLIENT_SECRET")
101
+ })
102
+ }
103
+ };
104
+ /** Display name of a preset provider, or `undefined` for an id arc has no preset for. */
105
+ function socialProviderName(id) {
106
+ return Object.hasOwn(PRESETS, id) ? PRESETS[id].name : void 0;
107
+ }
108
+ /**
109
+ * Better Auth `socialProviders`, the client-facing provider list and the extra trusted origins,
110
+ * for the providers `enabled` names. Throws on an unknown id, and on an enabled provider whose
111
+ * credentials are missing (the message names each missing variable).
112
+ *
113
+ * @example
114
+ * const social = defineSocialProviders({ enabled: process.env.SOCIAL_PROVIDERS ?? "" });
115
+ * betterAuth({ socialProviders: social.socialProviders, plugins: [socialAuth({ providers: social.providers })] });
116
+ */
117
+ function defineSocialProviders(options) {
118
+ const env = options.env ?? process.env;
119
+ const ids = [...new Set(typeof options.enabled === "string" ? list(options.enabled) : options.enabled)];
120
+ const unknown = ids.filter((id) => !Object.hasOwn(PRESETS, id));
121
+ if (unknown.length > 0) throw new Error(`defineSocialProviders: unknown provider ${unknown.map((id) => `"${id}"`).join(", ")}. Presets: ${Object.keys(PRESETS).join(", ")}. Configure others in betterAuth({ socialProviders }) directly.`);
122
+ const missing = ids.flatMap((id) => {
123
+ const absent = PRESETS[id].required.filter((key) => !read(env, key));
124
+ return absent.length > 0 ? [`"${id}" needs ${absent.join(", ")}`] : [];
125
+ });
126
+ if (missing.length > 0) throw new Error(`defineSocialProviders: enabled provider is missing credentials: ${missing.join("; ")}.`);
127
+ const socialProviders = {};
128
+ const trustedOrigins = /* @__PURE__ */ new Set();
129
+ for (const id of ids) {
130
+ const preset = PRESETS[id];
131
+ const override = options.overrides?.[id];
132
+ const config = {
133
+ ...preset.build(env),
134
+ ...override
135
+ };
136
+ if (id === "google" && !override?.getUserInfo) config.getUserInfo = (token) => verifiedGoogleUserInfo(token, config);
137
+ socialProviders[id] = config;
138
+ for (const origin of preset.trustedOrigins ?? []) trustedOrigins.add(origin);
139
+ }
140
+ return {
141
+ socialProviders,
142
+ providers: ids.map((id) => ({
143
+ id,
144
+ name: PRESETS[id].name
145
+ })),
146
+ trustedOrigins: [...trustedOrigins]
147
+ };
148
+ }
149
+ // src/auth/social/plugin.ts
150
+ /**
151
+ * `socialAuth()`: a Better Auth plugin that serves social sign-in under the auth catch-all.
152
+ *
153
+ * - `GET /social/providers`: the enabled providers, `{ providers: [{ id, name }] }`.
154
+ * - OAuth bearer handoff: a client that cannot rely on the API's cookie starts
155
+ * `signIn.social({ additionalData: { handoff: challenge } })` with challenge =
156
+ * base64url(SHA-256(verifier)). When the callback creates a NEW session and redirects to an
157
+ * absolute trusted URL, an after hook stores a single-use record (60 s, keyed by a hash of a
158
+ * random code, through Better Auth's verification store, so any database adapter works) and
159
+ * appends `#handoff=<code>` to the redirect. `POST /social/handoff { code, verifier }` consumes
160
+ * it and returns `{ token, user }` (plus `set-auth-token` when `bearer()` is installed).
161
+ * Every refusal is the same 400 `HANDOFF_INVALID`.
162
+ * - One Tap nonce: Better Auth's `/one-tap/callback` ignores a client `nonce`; when one is sent,
163
+ * a before hook verifies the id token with it and refuses a mismatch (400 `ONE_TAP_NONCE_MISMATCH`).
164
+ *
165
+ * Ordering: list `socialAuth()` BEFORE any plugin that strips the session Set-Cookie or rewrites
166
+ * the callback redirect; Better Auth runs plugin hooks in `plugins` order.
167
+ */
168
+ /** Lifetime of a handoff code. */
169
+ const HANDOFF_TTL_MS = 6e4;
170
+ /** base64url of 32 bytes (code) or of a SHA-256 digest (challenge). */
171
+ const B64URL_256 = /^[A-Za-z0-9_-]{43}$/;
172
+ /** PKCE-style verifier: 43 to 128 base64url characters. */
173
+ const VERIFIER = /^[A-Za-z0-9_-]{43,128}$/;
174
+ const sha256 = (value) => createHash("sha256").update(value).digest("base64url");
175
+ const handoffIdentifier = (code) => `social-handoff:${sha256(code)}`;
176
+ function handoffInvalid() {
177
+ return new APIError("BAD_REQUEST", {
178
+ code: "HANDOFF_INVALID",
179
+ message: "Invalid or expired handoff code"
180
+ });
181
+ }
182
+ /** `url` with `handoff=<code>` in its fragment; the query string is untouched. */
183
+ function withHandoffFragment(url, code) {
184
+ const hash = url.indexOf("#");
185
+ if (hash === -1) return `${url}#handoff=${code}`;
186
+ return url.slice(hash + 1) ? `${url}&handoff=${code}` : `${url}handoff=${code}`;
187
+ }
188
+ function isAbsoluteHttpUrl(value) {
189
+ try {
190
+ const { protocol } = new URL(value);
191
+ return protocol === "http:" || protocol === "https:";
192
+ } catch {
193
+ return false;
194
+ }
195
+ }
196
+ /** Equal-length base64url strings compared in constant time. */
197
+ function sameDigest(a, b) {
198
+ const left = Buffer.from(a);
199
+ const right = Buffer.from(b);
200
+ return left.length === right.length && timingSafeEqual(left, right);
201
+ }
202
+ /** Google client ids One Tap tokens may be minted for: the oneTap plugin's, then the provider's. */
203
+ function googleAudiences(options) {
204
+ const oneTap = options.plugins?.find((plugin) => plugin.id === "one-tap")?.options;
205
+ const google = options.socialProviders?.google;
206
+ return [oneTap?.clientId, ...[google?.clientId ?? []].flat()].filter((id) => typeof id === "string" && id.length > 0);
207
+ }
208
+ function socialAuth(options = {}) {
209
+ const names = new Map((options.providers ?? []).map((p) => [p.id, p.name]));
210
+ return {
211
+ id: "social",
212
+ endpoints: {
213
+ listSocialProviders: createAuthEndpoint("/social/providers", {
214
+ method: "GET",
215
+ metadata: { openapi: {
216
+ summary: "Enabled social sign-in providers",
217
+ responses: { 200: { description: "`{ providers: [{ id, name }] }`" } }
218
+ } }
219
+ }, async (ctx) => {
220
+ const providers = (ctx.context.socialProviders ?? []).map((p) => ({
221
+ id: p.id,
222
+ name: names.get(p.id) ?? socialProviderName(p.id) ?? p.name
223
+ }));
224
+ ctx.setHeader("Cache-Control", "public, max-age=300");
225
+ return ctx.json({ providers });
226
+ }),
227
+ exchangeSocialHandoff: createAuthEndpoint("/social/handoff", {
228
+ method: "POST",
229
+ metadata: { openapi: {
230
+ summary: "Exchange an OAuth handoff code for a session token",
231
+ description: "Body `{ code, verifier }`. Single use; 400 `HANDOFF_INVALID` on any refusal.",
232
+ responses: {
233
+ 200: { description: "`{ token, user }`" },
234
+ 400: { description: "`{ code: 'HANDOFF_INVALID' }`" }
235
+ }
236
+ } }
237
+ }, async (ctx) => {
238
+ const { code, verifier } = ctx.body ?? {};
239
+ if (typeof code !== "string" || !B64URL_256.test(code)) throw handoffInvalid();
240
+ if (typeof verifier !== "string" || !VERIFIER.test(verifier)) throw handoffInvalid();
241
+ const record = await ctx.context.internalAdapter.consumeVerificationValue(handoffIdentifier(code));
242
+ if (!record) throw handoffInvalid();
243
+ let stored;
244
+ try {
245
+ stored = JSON.parse(record.value);
246
+ } catch {
247
+ throw handoffInvalid();
248
+ }
249
+ if (typeof stored.sessionToken !== "string" || typeof stored.challenge !== "string") throw handoffInvalid();
250
+ if (!sameDigest(sha256(verifier), stored.challenge)) throw handoffInvalid();
251
+ const found = await ctx.context.internalAdapter.findSession(stored.sessionToken);
252
+ if (!found || new Date(found.session.expiresAt).getTime() <= Date.now()) throw handoffInvalid();
253
+ const token = found.session.token;
254
+ if (ctx.context.hasPlugin("bearer")) {
255
+ ctx.setHeader("set-auth-token", `${token}.${await makeSignature(token, ctx.context.secret)}`);
256
+ ctx.setHeader("Access-Control-Expose-Headers", "set-auth-token");
257
+ }
258
+ return ctx.json({
259
+ token,
260
+ user: parseUserOutput(ctx.context.options, found.user)
261
+ });
262
+ })
263
+ },
264
+ hooks: {
265
+ before: [{
266
+ matcher: (ctx) => ctx.path === "/one-tap/callback",
267
+ handler: createAuthMiddleware(async (ctx) => {
268
+ const body = ctx.body ?? {};
269
+ if (body.nonce === void 0) return;
270
+ const audience = googleAudiences(ctx.context.options);
271
+ if (!(typeof body.nonce === "string" && body.nonce.length > 0 && typeof body.idToken === "string" && audience.length > 0 && await verifyGoogleIdToken({
272
+ token: body.idToken,
273
+ audience,
274
+ nonce: body.nonce
275
+ }))) throw new APIError("BAD_REQUEST", {
276
+ code: "ONE_TAP_NONCE_MISMATCH",
277
+ message: "The id token does not carry the nonce this sign-in sent"
278
+ });
279
+ })
280
+ }],
281
+ after: [{
282
+ matcher: (ctx) => ctx.path === "/callback/:id",
283
+ handler: createAuthMiddleware(async (ctx) => {
284
+ const created = ctx.context.newSession;
285
+ if (!created) return;
286
+ const location = ctx.context.responseHeaders?.get("location");
287
+ if (!location || !isAbsoluteHttpUrl(location)) return;
288
+ if (!ctx.context.isTrustedOrigin(location)) return;
289
+ const challenge = (await getOAuthState())?.handoff;
290
+ if (typeof challenge !== "string" || !B64URL_256.test(challenge)) return;
291
+ const code = randomBytes(32).toString("base64url");
292
+ await ctx.context.internalAdapter.createVerificationValue({
293
+ identifier: handoffIdentifier(code),
294
+ value: JSON.stringify({
295
+ sessionToken: created.session.token,
296
+ challenge
297
+ }),
298
+ expiresAt: new Date(Date.now() + HANDOFF_TTL_MS)
299
+ });
300
+ ctx.setHeader("location", withHandoffFragment(location, code));
301
+ })
302
+ }]
303
+ },
304
+ rateLimit: [{
305
+ window: 60,
306
+ max: 10,
307
+ pathMatcher: (path) => path === "/social/handoff"
308
+ }]
309
+ };
310
+ }
311
+ export { defineSocialProviders, socialAuth };
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
- import { t as arcLog } from "./logger-UbknHqHy.mjs";
3
- import { t as ArcError } from "./errors-BpYV859Y.mjs";
4
- import { t as conjoinPolicyFilters } from "./filter-merge-B1eJ1pMx.mjs";
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ import { t as arcLog } from "./logger-IL7Btm-N.mjs";
3
+ import { t as ArcError } from "./errors-KBZ3tQk5.mjs";
4
+ import { t as conjoinPolicyFilters } from "./filter-merge-DTjYoDrj.mjs";
5
5
  // src/permissions/authorizationDecision.ts
6
6
  const log = arcLog("permissions:enforce");
7
7
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
2
  // src/collections/boundedMap.ts
3
3
  /**
4
4
  * Insertion-order LRU on a plain `Map` — the two moves, written once.
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
- import { t as conjoinPolicyFilters } from "./filter-merge-B1eJ1pMx.mjs";
3
- import { D as toRepositoryFilter } from "./plugin-CrMPYbdj.mjs";
4
- import { i as guessDate, t as coerceByType } from "./fieldTypes-EFWxCkZ5.mjs";
5
- import { i as compileAggRequest, t as adapterSupportsAggregate } from "./validate-BUeE2MLR.mjs";
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ import { t as conjoinPolicyFilters } from "./filter-merge-DTjYoDrj.mjs";
3
+ import { D as toRepositoryFilter } from "./plugin-DYmu8uT4.mjs";
4
+ import { i as guessDate, t as coerceByType } from "./fieldTypes-DrXUW1jc.mjs";
5
+ import { i as compileAggRequest, t as adapterSupportsAggregate } from "./validate-BZHaAdgy.mjs";
6
6
  // src/core/aggregation/buildHandler.ts
7
7
  /**
8
8
  * Framework-agnostic aggregation execution. Runs safety guards,
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
- import { i as versionKey, n as hashParams, r as tagVersionKey, t as buildQueryKey } from "../keys--l9n7aOC.mjs";
3
- import { t as MemoryCacheStore } from "../memory-C47xVsjX.mjs";
4
- import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-BvB3k_Fh.mjs";
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ import { i as versionKey, n as hashParams, r as tagVersionKey, t as buildQueryKey } from "../keys-t7i-lJ2r.mjs";
3
+ import { t as MemoryCacheStore } from "../memory-Dkp6ZD3F.mjs";
4
+ import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-C57-Nj-g.mjs";
5
5
  // src/cache/redis.ts
6
6
  /**
7
7
  * Redis-backed cache store.
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-gKJR3o-6.mjs";
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-HTi8KV7V.mjs";
3
3
  import fp from "fastify-plugin";
4
4
  // src/plugins/caching.ts
5
5
  var caching_exports = /* @__PURE__ */ __exportAll({ default: () => caching_default });
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
2
  // src/events/outbox/claimed.ts
3
3
  function claimedAttempts(claimed) {
4
4
  const value = claimed.attempts;
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
- import { t as defineResource } from "../defineResource-BAzNu5Um.mjs";
3
- import { t as defineModule } from "../module-CWiqsXnh.mjs";
4
- import { g as getUserId } from "../types-CrOlZ4rY.mjs";
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ import { t as defineResource } from "../defineResource-5DcG_wlI.mjs";
3
+ import { t as defineModule } from "../module-KFxT1Iuk.mjs";
4
+ import { g as getUserId } from "../types-CcpISJe8.mjs";
5
5
  import { createPurgeEvidence } from "@classytic/primitives/retention";
6
6
  import { canonicalJson, sha256Hex } from "@classytic/primitives/canonical";
7
7
  // src/cleanup/errors.ts
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
- import { t as CRUD_OPERATIONS } from "../../constants-DOnfMd7i.mjs";
3
- import { n as stringifyMeasureMap } from "../../ResourceRegistry-CP-iTcKy.mjs";
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ import { t as CRUD_OPERATIONS } from "../../constants-DH41jnNT.mjs";
3
+ import { n as stringifyMeasureMap } from "../../ResourceRegistry-BelzCRMy.mjs";
4
4
  import { resolve } from "node:path";
5
5
  import { pathToFileURL } from "node:url";
6
6
  // src/cli/commands/describe.ts
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
- import { t as buildOpenApiSpec } from "../../openapi-D6MAbYpv.mjs";
3
- import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-ItNBIQ5w.mjs";
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ import { t as buildOpenApiSpec } from "../../openapi-DbeXiy2v.mjs";
3
+ import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-BpjYlaoj.mjs";
4
4
  import { dirname, resolve } from "node:path";
5
5
  import { mkdirSync, writeFileSync } from "node:fs";
6
6
  // src/cli/commands/docs.ts
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.51.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
  // src/cli/commands/doctor.ts
@@ -1,2 +1,2 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
- export { t as generate } from "../../generate-Cr0ULavs.mjs";
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ export { t as generate } from "../../generate-SA8oMlLB.mjs";
@@ -1,2 +1,2 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
- export { t as init } from "../../init-C4a24wD2.mjs";
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ export { t as init } from "../../init-DeKHaNZn.mjs";
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
- import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-ItNBIQ5w.mjs";
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-BpjYlaoj.mjs";
3
3
  // src/cli/commands/introspect.ts
4
4
  function describePermission(value) {
5
5
  if (!value) return "none";
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.51.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-Cr0ULavs.mjs";
6
- import { t as init } from "../init-C4a24wD2.mjs";
5
+ import { t as generate } from "../generate-SA8oMlLB.mjs";
6
+ import { t as init } from "../init-DeKHaNZn.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.49.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
2
  // src/constants.ts
3
3
  /**
4
4
  * Arc Framework Constants — Single Source of Truth
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
- import { n as requestContext, t as getTraceHeaders } from "../requestContext-tUgLt9Ky.mjs";
3
- import { n as evictToSize, r as touch } from "../boundedMap-C51EUUOm.mjs";
4
- import { n as scopedValue, r as workSeedFromEvent, t as runWorkScope } from "../workScope-C-1QHNmV.mjs";
5
- import { t as transactionContext } from "../transactionContext-DBbSTfY3.mjs";
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ import { n as requestContext, t as getTraceHeaders } from "../requestContext-C_mbAm8o.mjs";
3
+ import { n as evictToSize, r as touch } from "../boundedMap-DOBai-H3.mjs";
4
+ import { n as scopedValue, r as workSeedFromEvent, t as runWorkScope } from "../workScope-BI72KXsI.mjs";
5
+ import { t as transactionContext } from "../transactionContext-DperjON1.mjs";
6
6
  // src/context/requestScopedCache.ts
7
7
  /** The memo slot the per-scope store hangs off. */
8
8
  const SLOT = Symbol.for("arc.requestScopedCache");
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
- import { a as DEFAULT_SORT, c as DEFAULT_VERSION_FIELD, d as MAX_FILTER_DEPTH, f as MAX_REGEX_LENGTH, g as SYSTEM_FIELDS, h as RESERVED_QUERY_PARAMS, i as DEFAULT_MAX_LIMIT, l as HOOK_OPERATIONS, m as MUTATION_OPERATIONS, n as DEFAULT_ID_FIELD, o as DEFAULT_TENANT_FIELD, p as MAX_SEARCH_LENGTH, r as DEFAULT_LIMIT, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS, u as HOOK_PHASES } from "../constants-DOnfMd7i.mjs";
3
- import { E as nativePolicyFilter, T as AccessControl, _ as BaseCrudController, a as crudInput, b as isFieldReadable, c as routeInput, d as createPermissionMiddleware, f as BaseController, g as BulkMixin, h as SlugMixin, m as SoftDeleteMixin, o as noPayloadSchema, p as TreeMixin, s as parsed, u as createCrudRouter, v as QueryResolver, w as BodySanitizer, y as collectReadBlockedFields } from "../plugin-CrMPYbdj.mjs";
4
- import { t as defineAggregation } from "../defineAggregation-BI5pRb8c.mjs";
5
- import { C as createFastifyHandler, D as sendControllerResponse, E as getControllerScope, T as getControllerContext, w as createRequestContext } from "../schemaIR-BsY4y9VP.mjs";
6
- import { a as defineResourceVariants, i as getEntityQuery, n as getEntityId, o as mergeResourceConfig, r as getEntityIdField, s as defineAction, t as getActionTarget } from "../core-BoEdFDDw.mjs";
7
- import { a as ResourceDefinition, i as validateResourceConfig, n as assertValidConfig, r as formatValidationErrors, t as defineResource } from "../defineResource-BAzNu5Um.mjs";
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ import { a as DEFAULT_SORT, c as DEFAULT_VERSION_FIELD, d as MAX_FILTER_DEPTH, f as MAX_REGEX_LENGTH, g as SYSTEM_FIELDS, h as RESERVED_QUERY_PARAMS, i as DEFAULT_MAX_LIMIT, l as HOOK_OPERATIONS, m as MUTATION_OPERATIONS, n as DEFAULT_ID_FIELD, o as DEFAULT_TENANT_FIELD, p as MAX_SEARCH_LENGTH, r as DEFAULT_LIMIT, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS, u as HOOK_PHASES } from "../constants-DH41jnNT.mjs";
3
+ import { E as nativePolicyFilter, T as AccessControl, _ as BaseCrudController, a as crudInput, b as isFieldReadable, c as routeInput, d as createPermissionMiddleware, f as BaseController, g as BulkMixin, h as SlugMixin, m as SoftDeleteMixin, o as noPayloadSchema, p as TreeMixin, s as parsed, u as createCrudRouter, v as QueryResolver, w as BodySanitizer, y as collectReadBlockedFields } from "../plugin-DYmu8uT4.mjs";
4
+ import { t as defineAggregation } from "../defineAggregation-rI3EbZUg.mjs";
5
+ import { C as createFastifyHandler, D as sendControllerResponse, E as getControllerScope, T as getControllerContext, w as createRequestContext } from "../schemaIR-MZVVj6Cw.mjs";
6
+ import { a as defineResourceVariants, i as getEntityQuery, n as getEntityId, o as mergeResourceConfig, r as getEntityIdField, s as defineAction, t as getActionTarget } from "../core-DPmRWlpx.mjs";
7
+ import { a as ResourceDefinition, i as validateResourceConfig, n as assertValidConfig, r as formatValidationErrors, t as defineResource } from "../defineResource-5DcG_wlI.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, DEFAULT_VERSION_FIELD, 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, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, crudInput, defineAction, defineAggregation, defineResource, defineResourceVariants, formatValidationErrors, getActionTarget, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, mergeResourceConfig, nativePolicyFilter, noPayloadSchema, parsed, routeInput, sendControllerResponse, validateResourceConfig };
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
- import "./constants-DOnfMd7i.mjs";
3
- import { t as defineResource } from "./defineResource-BAzNu5Um.mjs";
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ import "./constants-DH41jnNT.mjs";
3
+ import { t as defineResource } from "./defineResource-5DcG_wlI.mjs";
4
4
  // src/core/defineAction.ts
5
5
  /**
6
6
  * Build an `ActionDefinition` with a typed handler. The literal schema
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-gKJR3o-6.mjs";
3
- import "./constants-DOnfMd7i.mjs";
4
- import { f as createError, i as NotFoundError, u as ValidationError } from "./errors-BpYV859Y.mjs";
5
- import { D as sendControllerResponse, b as buildAuthMiddlewareForPermissions, c as buildRouteConfig, d as buildActionPipelineHandler, g as buildRouteHooks, l as resolveRouterPluginMw, m as buildActionPermissionMw, o as tryRegisterRoute, p as resolvePipelineSteps, r as schemaIRToJsonSchemaBranch, s as buildRateLimitConfig, t as actionSchemaIR, u as selectPluginMw, v as routeHookOptions, x as buildArcDecorator } from "./schemaIR-BsY4y9VP.mjs";
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-HTi8KV7V.mjs";
3
+ import "./constants-DH41jnNT.mjs";
4
+ import { f as createError, i as NotFoundError, u as ValidationError } from "./errors-KBZ3tQk5.mjs";
5
+ import { D as sendControllerResponse, b as buildAuthMiddlewareForPermissions, c as buildRouteConfig, d as buildActionPipelineHandler, g as buildRouteHooks, l as resolveRouterPluginMw, m as buildActionPermissionMw, o as tryRegisterRoute, p as resolvePipelineSteps, r as schemaIRToJsonSchemaBranch, s as buildRateLimitConfig, t as actionSchemaIR, u as selectPluginMw, v as routeHookOptions, x as buildArcDecorator } from "./schemaIR-MZVVj6Cw.mjs";
6
6
  // src/core/createActionRouter.ts
7
7
  var createActionRouter_exports = /* @__PURE__ */ __exportAll({ createActionRouter: () => createActionRouter });
8
8
  /**
@@ -1,10 +1,10 @@
1
- /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
- import { n as evaluateAndApplyPermission } from "./authorizationDecision-DHO94aV2.mjs";
3
- import { u as getRequestScope } from "./types-CrOlZ4rY.mjs";
4
- import { f as createError } from "./errors-BpYV859Y.mjs";
5
- import { g as buildRouteHooks, l as resolveRouterPluginMw, o as tryRegisterRoute, s as buildRateLimitConfig, u as selectPluginMw, v as routeHookOptions, x as buildArcDecorator, y as buildAuthMiddleware } from "./schemaIR-BsY4y9VP.mjs";
6
- import { t as buildAggregationHandler } from "./buildHandler-9DuwEKvr.mjs";
7
- import { n as validateAggregations } from "./validate-BUeE2MLR.mjs";
1
+ /*! @classytic/arc v2.51.0 | MIT | https://classytic.com */
2
+ import { n as evaluateAndApplyPermission } from "./authorizationDecision-Dxj_cy6N.mjs";
3
+ import { u as getRequestScope } from "./types-CcpISJe8.mjs";
4
+ import { f as createError } from "./errors-KBZ3tQk5.mjs";
5
+ import { g as buildRouteHooks, l as resolveRouterPluginMw, o as tryRegisterRoute, s as buildRateLimitConfig, u as selectPluginMw, v as routeHookOptions, x as buildArcDecorator, y as buildAuthMiddleware } from "./schemaIR-MZVVj6Cw.mjs";
6
+ import { t as buildAggregationHandler } from "./buildHandler-Dyl8P9j0.mjs";
7
+ import { n as validateAggregations } from "./validate-BZHaAdgy.mjs";
8
8
  // src/core/aggregation/createAggregationRouter.ts
9
9
  /**
10
10
  * Register one Fastify route per aggregation. No-op when the map is