@classytic/arc 2.37.0 → 2.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BaseController-B5GZfUBy.mjs → BaseController-CYaDvmOB.mjs} +16 -15
- package/dist/{EventTransport-BEVP50ka.d.mts → EventTransport-Cx60_s-6.d.mts} +37 -0
- package/dist/{EventTransport-pGNNDQ__.mjs → EventTransport-Gq7JWbWw.mjs} +39 -7
- package/dist/{HookSystem-CuhHvcyZ.mjs → HookSystem-C0ikzqQf.mjs} +2 -2
- package/dist/{ResourceRegistry-DFOmazXg.mjs → ResourceRegistry-DPcX--zk.mjs} +2 -2
- package/dist/{actionPermissions-CQQrR4tu.mjs → actionPermissions-jlFZ1it4.mjs} +6 -6
- package/dist/audit/index.d.mts +1 -1
- package/dist/audit/index.mjs +2 -2
- package/dist/auth/audit.mjs +1 -1
- package/dist/auth/index.d.mts +1 -1
- package/dist/auth/index.mjs +79 -28
- package/dist/auth/redis-session.mjs +1 -1
- package/dist/{authorizationDecision-DgyWdav8.mjs → authorizationDecision-BP8GHtjc.mjs} +2 -2
- package/dist/{buildHandler-D2DkqtiY.mjs → buildHandler-DjXOqIvX.mjs} +4 -4
- package/dist/cache/index.mjs +4 -4
- package/dist/{caching-BmC2T-pX.mjs → caching-a3ZEcJJs.mjs} +2 -2
- package/dist/cleanup/index.d.mts +2 -2
- package/dist/cleanup/index.mjs +4 -4
- package/dist/cli/commands/describe.d.mts +1 -1
- package/dist/cli/commands/describe.mjs +3 -3
- package/dist/cli/commands/docs.mjs +3 -3
- package/dist/cli/commands/doctor.mjs +1 -1
- package/dist/cli/commands/generate.mjs +2 -2
- package/dist/cli/commands/init.mjs +2 -2
- package/dist/cli/commands/introspect.mjs +2 -2
- package/dist/cli/index.mjs +3 -3
- package/dist/{constants-CUpamQMJ.mjs → constants-BONghE1Y.mjs} +1 -1
- package/dist/context/index.mjs +3 -3
- package/dist/core/index.d.mts +2 -2
- package/dist/core/index.mjs +7 -7
- package/dist/{core-C8GWw-Iu.mjs → core-8She7FgF.mjs} +3 -3
- package/dist/{createActionRouter-CwDU_j2S.mjs → createActionRouter-Bqi6Bhhx.mjs} +7 -7
- package/dist/{createAggregationRouter-d057xXX1.mjs → createAggregationRouter-BsYO7ktd.mjs} +7 -7
- package/dist/{defineAggregation-cCitY2FA.mjs → defineAggregation-0KBvqEEC.mjs} +1 -1
- package/dist/{defineResource-WcbE1kJL.mjs → defineResource-BMdyRelW.mjs} +18 -18
- package/dist/discovery/index.mjs +1 -1
- package/dist/docs/index.d.mts +1 -1
- package/dist/docs/index.mjs +3 -3
- package/dist/{elevation-Bc6Gafv9.mjs → elevation-C6woysGC.mjs} +4 -4
- package/dist/encryption/index.mjs +3 -3
- package/dist/{errorHandler-CB75oY5i.mjs → errorHandler-BdmIWPba.mjs} +4 -4
- package/dist/{errors-DsdZc1Xv.mjs → errors-2ExmOgIJ.mjs} +1 -1
- package/dist/{eventPlugin-B47sfCJ8.d.mts → eventPlugin-DFvHa4Nf.d.mts} +10 -1
- package/dist/{eventPlugin-DEIfV1iC.mjs → eventPlugin-DJwpGMzx.mjs} +6 -6
- package/dist/events/index.d.mts +4 -4
- package/dist/events/index.mjs +5 -5
- package/dist/events/transports/redis-stream-entry.d.mts +1 -1
- package/dist/events/transports/redis-stream-entry.mjs +1 -1
- package/dist/events/transports/redis.d.mts +1 -1
- package/dist/events/transports/redis.mjs +1 -1
- package/dist/factory/index.d.mts +4 -4
- package/dist/factory/index.mjs +5 -5
- package/dist/{fastify-augmentation-CdY8FINU.d.mts → fastify-augmentation-jYA2oHyL.d.mts} +3 -3
- package/dist/{fields-DvGz47Ul.mjs → fields-Cha2QCKH.mjs} +37 -2
- package/dist/{generate-D7CIIWhS.mjs → generate-BUP4Oydg.mjs} +2 -2
- package/dist/{headers-BFu1st_i.mjs → headers-DeXNifVj.mjs} +2 -2
- package/dist/{health-Cc_sb94d.mjs → health-Bh0N_FLk.mjs} +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/idempotency/index.mjs +4 -4
- package/dist/idempotency/redis.mjs +1 -1
- package/dist/{index-C01wWGJt.d.mts → index-B78WZom8.d.mts} +11 -2
- package/dist/{index-du18bJjH.d.mts → index-BRoDtjek.d.mts} +2 -4
- package/dist/{index-DCxxRwLC.d.mts → index-D2uIUSQk.d.mts} +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +11 -11
- package/dist/{init-BMgU1wYR.mjs → init-Dg_Am2o_.mjs} +1 -1
- package/dist/integrations/event-gateway.d.mts +1 -1
- package/dist/integrations/event-gateway.mjs +2 -2
- package/dist/integrations/index.d.mts +1 -1
- package/dist/integrations/index.mjs +1 -1
- package/dist/integrations/jobs/index.mjs +2 -2
- package/dist/integrations/mcp/index.d.mts +2 -2
- package/dist/integrations/mcp/index.mjs +2 -2
- package/dist/integrations/mcp/testing.d.mts +1 -1
- package/dist/integrations/mcp/testing.mjs +2 -2
- package/dist/integrations/streamline.mjs +3 -3
- package/dist/integrations/webhooks.d.mts +2 -2
- package/dist/integrations/webhooks.mjs +3 -3
- package/dist/integrations/websocket-pushref-redis.mjs +1 -1
- package/dist/integrations/websocket-redis.mjs +1 -1
- package/dist/integrations/websocket.mjs +1 -1
- package/dist/{interface-CaPVHoVJ.mjs → interface-DYPVscCU.mjs} +1 -1
- package/dist/{jsonBody-BuzxOZV8.mjs → jsonBody-DVui0uJl.mjs} +2 -2
- package/dist/{keys-DoUI9-yP.mjs → keys-BSuxGS-B.mjs} +1 -1
- package/dist/{loadResources-CPlRWJCv.mjs → loadResources-CNd1DWnK.mjs} +2 -2
- package/dist/{loadResourcesFromEntry-CPCZiX9n.mjs → loadResourcesFromEntry-DNj8cpiY.mjs} +2 -2
- package/dist/logger/index.mjs +1 -1
- package/dist/{mcpPlugin-dxMxBPIg.mjs → mcpPlugin-KWsezMx7.mjs} +15 -15
- package/dist/{memory-BnafVem_.mjs → memory-BiPVaCPg.mjs} +2 -2
- package/dist/{metrics-CeAIcVMY.mjs → metrics-CsWaIVTa.mjs} +2 -2
- package/dist/middleware/index.d.mts +1 -1
- package/dist/middleware/index.mjs +3 -3
- package/dist/migrations/index.mjs +2 -2
- package/dist/{module-DIvG8qOg.mjs → module-BQXHxMEk.mjs} +1 -1
- package/dist/{multipartBody-BVCoaTwu.mjs → multipartBody-u6VrS_iH.mjs} +1 -1
- package/dist/{openapi-D_i6CifU.mjs → openapi-Dxc8RLy_.mjs} +6 -6
- package/dist/outbox-admin/index.d.mts +1 -1
- package/dist/outbox-admin/index.mjs +4 -4
- package/dist/{outbox-module-BbdaMyqy.d.mts → outbox-module-CQXu_O6o.d.mts} +2 -2
- package/dist/{outbox-module-CKaLL5BH.mjs → outbox-module-DyIqA5vo.mjs} +4 -4
- package/dist/permissions/index.mjs +5 -5
- package/dist/{permissions-DWkl60hx.mjs → permissions-H7Zcb82Z.mjs} +6 -6
- package/dist/{pipe-Dbs3GhOZ.mjs → pipe-SunhEaZ6.mjs} +2 -2
- package/dist/pipeline/index.d.mts +1 -1
- package/dist/pipeline/index.mjs +2 -2
- package/dist/plugins/index.d.mts +4 -4
- package/dist/plugins/index.mjs +16 -16
- package/dist/plugins/response-cache.mjs +2 -2
- package/dist/plugins/tracing-entry.mjs +2 -2
- package/dist/{pluralize-DgaYX91M.mjs → pluralize-Da7IT_qJ.mjs} +1 -1
- package/dist/{preloadResources-BYFfYnjZ.d.mts → preloadResources-BbBkNkqK.d.mts} +6 -6
- package/dist/{preloadResources-BUoGKPaS.mjs → preloadResources-DlhH81py.mjs} +21 -21
- package/dist/presets/filesUpload.d.mts +1 -1
- package/dist/presets/filesUpload.mjs +5 -5
- package/dist/presets/index.d.mts +1 -1
- package/dist/presets/index.mjs +2 -2
- package/dist/presets/multiTenant.d.mts +1 -1
- package/dist/presets/multiTenant.mjs +3 -3
- package/dist/presets/search.d.mts +1 -1
- package/dist/presets/search.mjs +2 -2
- package/dist/{presets-Gbv9mNKD.mjs → presets-CNyfaxGL.mjs} +4 -4
- package/dist/{projection-BunxoeON.mjs → projection-DSfEoooA.mjs} +2 -2
- package/dist/{queryCachePlugin-BYqmg89O.mjs → queryCachePlugin-oTsmVyEQ.mjs} +5 -5
- package/dist/{rateLimitKey-DlqmDHA5.mjs → rateLimitKey-CewdR-m6.mjs} +1 -1
- package/dist/{realtime-CiAp2-LH.mjs → realtime-CPmjjgqd.mjs} +9 -9
- package/dist/{redis-stream-mwLWlfHG.d.mts → redis-stream-eh0eOtjh.d.mts} +1 -1
- package/dist/{registerRoute-dnf-JJf-.mjs → registerRoute-XvcI_3sh.mjs} +10 -6
- package/dist/registry/index.d.mts +2 -2
- package/dist/registry/index.mjs +3 -3
- package/dist/{registry-ByC0UFNS.mjs → registry-UFEJQN8R.mjs} +2 -2
- package/dist/{renewingLease-C5Ta_ImD.mjs → renewingLease-DuRGVOMe.mjs} +1 -1
- package/dist/{replyHelpers-D1k0wHoO.mjs → replyHelpers-BHebarf0.mjs} +2 -2
- package/dist/{requestContext-DGM7EZRI.mjs → requestContext-DpmntRZy.mjs} +1 -1
- package/dist/{rolldown-runtime-DrZrabOW.mjs → rolldown-runtime-Add2L50I.mjs} +1 -1
- package/dist/{runtimeCapabilities-c4Sc85X-.mjs → runtimeCapabilities-D793Pxci.mjs} +1 -1
- package/dist/{schedules-CVtolEa-.mjs → schedules-DthM8Qag.mjs} +3 -3
- package/dist/{schemaConverter-C8zbW7tJ.mjs → schemaConverter-Db-MMsH6.mjs} +1 -1
- package/dist/{schemaIR-BfI425RH.mjs → schemaIR-CIXShch7.mjs} +2 -2
- package/dist/schemas/index.mjs +1 -1
- package/dist/scim/index.mjs +2 -2
- package/dist/scope/index.mjs +5 -5
- package/dist/{scope-DFSOKc4T.mjs → scope-D03sk17n.mjs} +4 -4
- package/dist/{simpleEqualityMatcher-Bhp7WrRF.mjs → simpleEqualityMatcher-B7qVjQBv.mjs} +1 -1
- package/dist/{sse-vRuwDd6N.mjs → sse-D4MYqkic.mjs} +5 -5
- package/dist/{sseStream-cWezGOk1.mjs → sseStream-BuMNPR6r.mjs} +2 -2
- package/dist/{store-helpers-bU8H5c-A.mjs → store-helpers-CIF4RG8s.mjs} +1 -1
- package/dist/{streaming-weWcFCk4.mjs → streaming-DkpW1HwJ.mjs} +1 -1
- package/dist/{subscribe-helpers-BrcG3NlV.mjs → subscribe-helpers-CBZOi6pk.mjs} +2 -2
- package/dist/sync/changelog.mjs +1 -1
- package/dist/testing/cleanupStoreContract.mjs +1 -1
- package/dist/testing/index.d.mts +4 -4
- package/dist/testing/index.mjs +10 -10
- package/dist/testing/outboxStoreContract.mjs +1 -1
- package/dist/testing/storageContract.mjs +1 -1
- package/dist/{transactionContext-Ca5peQpc.mjs → transactionContext-DMmvcfdo.mjs} +1 -1
- package/dist/{typeGuards-ALWme5WB.mjs → typeGuards-DHTnEs5X.mjs} +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/types/storage.mjs +1 -1
- package/dist/{types-BMa2EPtv.d.mts → types-BRU-Kd3t.d.mts} +1 -1
- package/dist/{types-lDs9oF4z.mjs → types-BqLyyH0o.mjs} +4 -4
- package/dist/{types-BXnTOsXP.d.mts → types-LQFwC37d.d.mts} +1 -1
- package/dist/usage/index.mjs +0 -0
- package/dist/{userHelpers-DU_Z5OBA.mjs → userHelpers-CXySQFRg.mjs} +1 -1
- package/dist/utils/index.d.mts +2 -2
- package/dist/utils/index.mjs +11 -11
- package/dist/{utils-sXGFLegw.mjs → utils-BbGG8XNT.mjs} +1230 -1230
- package/dist/{validate-qK_-7MVk.mjs → validate-CidSeUrx.mjs} +2 -2
- package/dist/{versioning-DEs-_hFi.d.mts → versioning-B843jOYX.d.mts} +1 -1
- package/dist/{versioning-Dtw0MyX4.mjs → versioning-C2r0eOZ4.mjs} +3 -3
- package/package.json +11 -9
- package/skills/arc/references/auth.md +5 -2
- package/skills/arc/references/production.md +733 -733
- package/skills/arc-code-review/references/migration-recipes.md +16 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
/*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-Add2L50I.mjs";
|
|
3
3
|
//#region src/core/aggregation/normalize.ts
|
|
4
4
|
/**
|
|
5
5
|
* Framework cap on URL-driven aggregation limits when the host opts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
3
|
-
import { d as createDomainError } from "./errors-
|
|
1
|
+
/*! @classytic/arc v2.38.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-Add2L50I.mjs";
|
|
3
|
+
import { d as createDomainError } from "./errors-2ExmOgIJ.mjs";
|
|
4
4
|
import fp from "fastify-plugin";
|
|
5
5
|
//#region src/plugins/versioning.ts
|
|
6
6
|
var versioning_exports = /* @__PURE__ */ __exportAll({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classytic/arc",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.38.0",
|
|
4
4
|
"description": "Resource-oriented backend framework for Fastify - clean, minimal, powerful, tree-shakable",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -343,16 +343,18 @@
|
|
|
343
343
|
"check:peer-skew": "node scripts/check-peer-skew.mjs",
|
|
344
344
|
"check:docs-drift": "node scripts/check-docs-drift.mjs",
|
|
345
345
|
"check:boundaries": "node scripts/check-boundaries.mjs",
|
|
346
|
-
"prepublishOnly": "npm run check:peer-skew && npm run check:docs-drift && npm run check:route-api && npm run check:boundaries && npm run typecheck && npm run lint && npm run build && npm run check:api-surface && npm run check:forgotten-exports && npm run check:package && npm run test:ci && npm run smoke:consumer && npm run smoke:mcp",
|
|
346
|
+
"prepublishOnly": "npm run check:line-endings && npm run check:peer-skew && npm run check:docs-drift && npm run check:route-api && npm run check:boundaries && npm run typecheck && npm run lint && npm run build && npm run check:api-surface && npm run check:forgotten-exports && npm run check:package && npm run test:ci && npm run smoke:consumer && npm run smoke:mcp",
|
|
347
347
|
"check:route-api": "node scripts/check-removed-route-api.mjs",
|
|
348
|
-
"check:forgotten-exports": "node scripts/check-forgotten-exports.mjs"
|
|
348
|
+
"check:forgotten-exports": "node scripts/check-forgotten-exports.mjs",
|
|
349
|
+
"check:line-endings": "node scripts/check-line-endings.mjs",
|
|
350
|
+
"fix:line-endings": "node scripts/check-line-endings.mjs --fix"
|
|
349
351
|
},
|
|
350
352
|
"engines": {
|
|
351
353
|
"node": ">=22"
|
|
352
354
|
},
|
|
353
355
|
"peerDependencies": {
|
|
354
|
-
"@classytic/primitives": ">=0.
|
|
355
|
-
"@classytic/repo-core": ">=0.
|
|
356
|
+
"@classytic/primitives": ">=0.26.4",
|
|
357
|
+
"@classytic/repo-core": ">=0.26.0",
|
|
356
358
|
"@classytic/streamline": ">=2.8.0",
|
|
357
359
|
"@fastify/cors": ">=11.0.0",
|
|
358
360
|
"@fastify/helmet": ">=13.0.0",
|
|
@@ -371,7 +373,7 @@
|
|
|
371
373
|
"@opentelemetry/instrumentation-http": ">=0.50.0",
|
|
372
374
|
"@opentelemetry/instrumentation-mongodb": ">=0.40.0",
|
|
373
375
|
"@opentelemetry/sdk-node": ">=0.50.0",
|
|
374
|
-
"better-auth": ">=1.
|
|
376
|
+
"better-auth": ">=1.7.0",
|
|
375
377
|
"bullmq": ">=5.0.0",
|
|
376
378
|
"fastify": ">=5.12.0",
|
|
377
379
|
"fastify-raw-body": ">=5.0.0",
|
|
@@ -483,8 +485,8 @@
|
|
|
483
485
|
"@classytic/gitkit": ">=0.1.0",
|
|
484
486
|
"@classytic/mongokit": "^3.33.0",
|
|
485
487
|
"@classytic/pgkit": "^0.1.0",
|
|
486
|
-
"@classytic/primitives": "^0.
|
|
487
|
-
"@classytic/repo-core": "^0.
|
|
488
|
+
"@classytic/primitives": "^0.26.4",
|
|
489
|
+
"@classytic/repo-core": "^0.26.0",
|
|
488
490
|
"@classytic/sqlitekit": "^0.9.0",
|
|
489
491
|
"@classytic/streamline": "^2.8.2",
|
|
490
492
|
"@electric-sql/pglite": "^0.5.4",
|
|
@@ -504,7 +506,7 @@
|
|
|
504
506
|
"@types/qs": "^6.15.1",
|
|
505
507
|
"@vitest/coverage-v8": "^4.1.9",
|
|
506
508
|
"ajv": "^8.20.0",
|
|
507
|
-
"better-auth": "^1.
|
|
509
|
+
"better-auth": "^1.7.2",
|
|
508
510
|
"better-sqlite3": "^13.0.3",
|
|
509
511
|
"bullmq": "^6.1.2",
|
|
510
512
|
"dotenv": "^17.4.2",
|
|
@@ -86,7 +86,10 @@ const app2 = await createApp({
|
|
|
86
86
|
2. Reads `session.activeOrganizationId`, or falls back to `x-organization-id` header (needed for API key auth where synthetic sessions have no org context)
|
|
87
87
|
3. Looks up org membership via `auth.api.getActiveMember` (or `getActiveMemberRole` with explicit `organizationId` for header-based resolution)
|
|
88
88
|
4. Splits roles: `"admin,recruiter"` → `['admin', 'recruiter']`
|
|
89
|
-
5.
|
|
89
|
+
5. Resolves `session.activeTeamId` (if set) against `auth.api.listUserTeams` scoped to the ACTIVE org, and binds it only if the team is one the user belongs to AND carries that `organizationId`. Stale or cross-org team state is dropped, not trusted. Requires **better-auth >=1.7.0** — the `organizationId` query param landed in 1.7.0, and without it a self-query returns teams across every org the user belongs to.
|
|
90
|
+
6. Sets `request.scope`: `{ kind: 'member', organizationId, orgRoles: string[], teamId? }`
|
|
91
|
+
|
|
92
|
+
Both `authenticate` and `optionalAuthenticate` run this same flow — an optional-auth route sees the identical scope when a session exists (arc 2.37.1; before that `teamId` was never set on the optional path).
|
|
90
93
|
|
|
91
94
|
**Sessions at scale (BA-native knobs — know these before reaching for arc's):**
|
|
92
95
|
- **Redis sessions**: use BA's `secondaryStorage` (sessions land there INSTEAD of the DB unless `session.storeSessionInDatabase: true`). Arc's `@classytic/arc/auth/redis` (`SessionStore`) is the JWT-strategy store — different layer, don't mix them.
|
|
@@ -240,7 +243,7 @@ The `auth.api.*` direct in-process API map and `auth.$context.tables` schema int
|
|
|
240
243
|
|---|---|---|---|
|
|
241
244
|
| (core) — `emailAndPassword`, OAuth providers | `user`, `session`, `account`, `verification` | both kits + playground | Nothing extra. Optionally overlay `user` as a resource. |
|
|
242
245
|
| `organization()` (built-in) | `organization`, `member`, `invitation` | both kits + playground | `createBetterAuthAdapter({ orgContext: true })`; overlay `organization` / `member` as resources. |
|
|
243
|
-
| `organization({ teams: true })` | + `team`, `teamMember` | mongokit | `requireTeamMembership()` works on `scope.teamId`. |
|
|
246
|
+
| `organization({ teams: true })` | + `team`, `teamMember` | mongokit | `requireTeamMembership()` works on `scope.teamId`. Needs **better-auth >=1.7.0** (see step 5 of the org-context flow). |
|
|
244
247
|
| `twoFactor()` (built-in) | `twoFactor` | both kits | Picked up automatically by overlay; expose `twoFactor` as a resource if needed. |
|
|
245
248
|
| `admin()` (built-in) | (field-only, augments `user`) | both kits | `requireRoles(['admin'])` reads the platform role; no extra plumbing. |
|
|
246
249
|
| `bearer()` (built-in) | (none — header strategy) | CLI scaffold | Token comes via `Authorization: Bearer <session>` instead of cookie — same `auth.api.getSession()` path. Use for SPA / mobile clients. |
|