@classytic/arc 2.35.0 → 2.37.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-C-pofd0v.mjs → BaseController-B5GZfUBy.mjs} +11 -11
- package/dist/{EventTransport-BrPeGUil.mjs → EventTransport-pGNNDQ__.mjs} +1 -1
- package/dist/{HookSystem-LlPm3Anm.mjs → HookSystem-CuhHvcyZ.mjs} +2 -2
- package/dist/{ResourceRegistry-yuD1Ra53.mjs → ResourceRegistry-DFOmazXg.mjs} +2 -2
- package/dist/{actionPermissions-LFuOra7W.mjs → actionPermissions-CQQrR4tu.mjs} +6 -6
- package/dist/audit/index.d.mts +2 -2
- package/dist/audit/index.mjs +2 -2
- package/dist/auth/audit.mjs +1 -1
- package/dist/auth/index.d.mts +2 -2
- package/dist/auth/index.mjs +6 -6
- package/dist/auth/redis-session.mjs +1 -1
- package/dist/{authorizationDecision-DYXBBgtg.mjs → authorizationDecision-DgyWdav8.mjs} +2 -2
- package/dist/{base-GZU3LlzP.d.mts → base-C-NL2fTi.d.mts} +15 -0
- package/dist/{buildHandler-Do9aMIvL.mjs → buildHandler-D2DkqtiY.mjs} +4 -4
- package/dist/cache/index.mjs +4 -4
- package/dist/{caching-cN5X9VEL.mjs → caching-BmC2T-pX.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-BhzLXCfN.mjs → constants-CUpamQMJ.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-DdEvmmkY.mjs → core-C8GWw-Iu.mjs} +3 -3
- package/dist/{createActionRouter-EYWgd0ly.mjs → createActionRouter-CwDU_j2S.mjs} +7 -7
- package/dist/{createAggregationRouter-ByOK9Iev.mjs → createAggregationRouter-d057xXX1.mjs} +7 -7
- package/dist/{defineAggregation-DoIijIFq.mjs → defineAggregation-cCitY2FA.mjs} +1 -1
- package/dist/{defineResource-BOrGeocE.mjs → defineResource-WcbE1kJL.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-tGIAldco.mjs → elevation-Bc6Gafv9.mjs} +4 -4
- package/dist/encryption/index.mjs +3 -3
- package/dist/{errorHandler-BbQ1nQdk.mjs → errorHandler-CB75oY5i.mjs} +3 -3
- package/dist/{errors-CLid6atr.mjs → errors-DsdZc1Xv.mjs} +1 -1
- package/dist/{eventPlugin-ClPn5kjn.mjs → eventPlugin-DEIfV1iC.mjs} +5 -5
- package/dist/events/index.d.mts +1 -1
- package/dist/events/index.mjs +5 -5
- package/dist/events/transports/redis-stream-entry.mjs +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-CMMTL3cj.d.mts → fastify-augmentation-CdY8FINU.d.mts} +3 -3
- package/dist/{fields-UtpiJO5R.mjs → fields-DvGz47Ul.mjs} +1 -1
- package/dist/{generate-BoAVy3_b.mjs → generate-D7CIIWhS.mjs} +2 -2
- package/dist/{headers-DODWf7aC.mjs → headers-BFu1st_i.mjs} +2 -2
- package/dist/{health-_Zs3R_Sb.mjs → health-Cc_sb94d.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-K7auNNW0.d.mts → index-BtYoMip1.d.mts} +20 -2
- package/dist/{index-C5K78SXo.d.mts → index-C01wWGJt.d.mts} +1 -1
- package/dist/{index-C50BUxKs.d.mts → index-DCxxRwLC.d.mts} +1 -1
- package/dist/{index-h-mTgMqy.d.mts → index-du18bJjH.d.mts} +3 -3
- package/dist/{index-CJCcbADG.d.mts → index-eyg5WEcy.d.mts} +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +11 -11
- package/dist/{init-Ce4R0ZGK.mjs → init-BMgU1wYR.mjs} +1 -1
- package/dist/integrations/event-gateway.mjs +2 -2
- package/dist/integrations/index.d.mts +2 -2
- package/dist/integrations/index.mjs +1 -1
- package/dist/integrations/jobs/index.d.mts +1 -1
- package/dist/integrations/jobs/index.mjs +2 -2
- package/dist/integrations/mcp/index.d.mts +3 -3
- 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 +4 -2
- package/dist/integrations/webhooks.mjs +20 -6
- 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-my7sxjw5.mjs → interface-CaPVHoVJ.mjs} +1 -1
- package/dist/{jsonBody-CVKA7C5m.mjs → jsonBody-BuzxOZV8.mjs} +2 -2
- package/dist/{keys-GlU7XpmG.mjs → keys-DoUI9-yP.mjs} +1 -1
- package/dist/{loadResources-DdQb0qgV.mjs → loadResources-CPlRWJCv.mjs} +2 -2
- package/dist/{loadResourcesFromEntry-s6aGs6-0.mjs → loadResourcesFromEntry-CPCZiX9n.mjs} +2 -2
- package/dist/logger/index.mjs +1 -1
- package/dist/{mcpPlugin-DkzZ7Nfx.mjs → mcpPlugin-dxMxBPIg.mjs} +15 -15
- package/dist/{memory-BwedEXau.mjs → memory-BnafVem_.mjs} +2 -2
- package/dist/{metrics-5LNPvL3P.mjs → metrics-CeAIcVMY.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-Bh5OC7ww.mjs → module-DIvG8qOg.mjs} +1 -1
- package/dist/{multipartBody-DjilSDAT.mjs → multipartBody-BVCoaTwu.mjs} +1 -1
- package/dist/{openapi-ItLH12_L.mjs → openapi-D_i6CifU.mjs} +6 -6
- package/dist/outbox-admin/index.d.mts +2 -2
- package/dist/outbox-admin/index.mjs +4 -4
- package/dist/{outbox-module-b1TyDGGi.d.mts → outbox-module-BbdaMyqy.d.mts} +1 -1
- package/dist/{outbox-module-SGIZz6oS.mjs → outbox-module-CKaLL5BH.mjs} +4 -4
- package/dist/permissions/index.d.mts +2 -2
- package/dist/permissions/index.mjs +5 -5
- package/dist/{permissions-CpSBlFXZ.mjs → permissions-DWkl60hx.mjs} +36 -9
- package/dist/{pipe-DNOuCfAs.mjs → pipe-Dbs3GhOZ.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-DGAQQKL8.mjs → pluralize-DgaYX91M.mjs} +1 -1
- package/dist/{preloadResources-DYMzmUk1.mjs → preloadResources-BUoGKPaS.mjs} +79 -24
- package/dist/{preloadResources--ZtY9pe9.d.mts → preloadResources-BYFfYnjZ.d.mts} +3 -3
- package/dist/presets/filesUpload.d.mts +2 -2
- package/dist/presets/filesUpload.mjs +5 -5
- package/dist/presets/index.d.mts +2 -2
- 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 +2 -2
- package/dist/presets/search.mjs +2 -2
- package/dist/{presets-Bi0Z6Iq8.mjs → presets-Gbv9mNKD.mjs} +4 -4
- package/dist/{projection-aevMua7Q.mjs → projection-BunxoeON.mjs} +2 -2
- package/dist/{queryCachePlugin-BI7Z88Cx.mjs → queryCachePlugin-BYqmg89O.mjs} +5 -5
- package/dist/{rateLimitKey-pyevMUVf.mjs → rateLimitKey-DlqmDHA5.mjs} +1 -1
- package/dist/{realtime-Cfl2bVjj.mjs → realtime-CiAp2-LH.mjs} +9 -9
- package/dist/{registerRoute-u1opU66a.mjs → registerRoute-dnf-JJf-.mjs} +5 -5
- package/dist/registry/index.d.mts +2 -2
- package/dist/registry/index.mjs +3 -3
- package/dist/{registry-B4sf9Rfm.mjs → registry-ByC0UFNS.mjs} +2 -2
- package/dist/{renewingLease-5ESPMxp0.mjs → renewingLease-C5Ta_ImD.mjs} +1 -1
- package/dist/{replyHelpers-2jfmMnnV.mjs → replyHelpers-D1k0wHoO.mjs} +2 -2
- package/dist/{requestContext-DzOUGNdY.mjs → requestContext-DGM7EZRI.mjs} +1 -1
- package/dist/{rolldown-runtime-CEvvVXTC.mjs → rolldown-runtime-DrZrabOW.mjs} +1 -1
- package/dist/{runtimeCapabilities-BagWc3TI.mjs → runtimeCapabilities-c4Sc85X-.mjs} +1 -1
- package/dist/{schedules-BLpZLWGF.mjs → schedules-CVtolEa-.mjs} +31 -5
- package/dist/{schemaConverter-D2_bHGil.mjs → schemaConverter-C8zbW7tJ.mjs} +1 -1
- package/dist/{schemaIR-s3-ouZmP.mjs → schemaIR-BfI425RH.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-DgepeCv6.mjs → scope-DFSOKc4T.mjs} +4 -4
- package/dist/{simpleEqualityMatcher-BO-sFTQf.mjs → simpleEqualityMatcher-Bhp7WrRF.mjs} +1 -1
- package/dist/{sse-DUIP1XH6.mjs → sse-vRuwDd6N.mjs} +5 -5
- package/dist/{sseStream-ByFGyIVr.mjs → sseStream-cWezGOk1.mjs} +2 -2
- package/dist/{store-helpers-kIJCY0wI.mjs → store-helpers-bU8H5c-A.mjs} +1 -1
- package/dist/{streaming-DOpZVht6.mjs → streaming-weWcFCk4.mjs} +1 -1
- package/dist/{subscribe-helpers-Dh2BnzJf.mjs → subscribe-helpers-BrcG3NlV.mjs} +11 -5
- package/dist/sync/changelog.mjs +1 -1
- package/dist/testing/cleanupStoreContract.mjs +1 -1
- package/dist/testing/index.d.mts +5 -5
- package/dist/testing/index.mjs +10 -10
- package/dist/testing/outboxStoreContract.mjs +1 -1
- package/dist/testing/storageContract.mjs +1 -1
- package/dist/{transactionContext-BTZzEcRo.mjs → transactionContext-Ca5peQpc.mjs} +1 -1
- package/dist/{typeGuards-B-_jqaMi.mjs → typeGuards-ALWme5WB.mjs} +1 -1
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.mjs +1 -1
- package/dist/types/storage.mjs +1 -1
- package/dist/{types-DDD5RKTu.d.mts → types-BMa2EPtv.d.mts} +9 -0
- package/dist/{types-DSvHH0uR.d.mts → types-BXnTOsXP.d.mts} +1 -1
- package/dist/{types-GY4kATJb.mjs → types-lDs9oF4z.mjs} +4 -4
- package/dist/usage/index.d.mts +1 -1
- package/dist/usage/index.mjs +0 -0
- package/dist/{userHelpers-AKcB4V03.mjs → userHelpers-DU_Z5OBA.mjs} +1 -1
- package/dist/utils/index.d.mts +2 -2
- package/dist/utils/index.mjs +11 -11
- package/dist/{utils-CBK9HQOI.mjs → utils-sXGFLegw.mjs} +3 -3
- package/dist/{validate-dosAIvQU.mjs → validate-qK_-7MVk.mjs} +2 -2
- package/dist/{versioning-BbTs4pwM.mjs → versioning-Dtw0MyX4.mjs} +3 -3
- package/package.json +5 -2
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { r as evaluatePermissionDecision } from "./authorizationDecision-
|
|
3
|
-
import { p as isArcError, t as ArcError } from "./errors-
|
|
4
|
-
import { n as requireSingleHeaderValue } from "./headers-
|
|
5
|
-
import { b as isElevated, c as getOrgId, g as getUserId, x as isMember } from "./types-
|
|
6
|
-
import { t as BaseController } from "./BaseController-
|
|
7
|
-
import { i as resolveEffectiveRoles, t as applyFieldReadPermissions } from "./fields-
|
|
8
|
-
import { t as executePipeline } from "./pipe-
|
|
9
|
-
import { t as buildRequestScopeProjection } from "./projection-
|
|
10
|
-
import { i as resolvePipelineSteps, t as resolveActionPermission } from "./actionPermissions-
|
|
11
|
-
import { n as validateAggregations } from "./validate-
|
|
12
|
-
import { n as executeAggregation } from "./buildHandler-
|
|
13
|
-
import { t as pluralize } from "./pluralize-
|
|
14
|
-
import { t as createIdempotencyResult } from "./interface-
|
|
15
|
-
import { r as shouldRejectAdditionalProperties, t as normalizeSchemaIR } from "./schemaIR-
|
|
1
|
+
/*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
|
|
2
|
+
import { r as evaluatePermissionDecision } from "./authorizationDecision-DgyWdav8.mjs";
|
|
3
|
+
import { p as isArcError, t as ArcError } from "./errors-DsdZc1Xv.mjs";
|
|
4
|
+
import { n as requireSingleHeaderValue } from "./headers-BFu1st_i.mjs";
|
|
5
|
+
import { b as isElevated, c as getOrgId, g as getUserId, x as isMember } from "./types-lDs9oF4z.mjs";
|
|
6
|
+
import { t as BaseController } from "./BaseController-B5GZfUBy.mjs";
|
|
7
|
+
import { i as resolveEffectiveRoles, t as applyFieldReadPermissions } from "./fields-DvGz47Ul.mjs";
|
|
8
|
+
import { t as executePipeline } from "./pipe-Dbs3GhOZ.mjs";
|
|
9
|
+
import { t as buildRequestScopeProjection } from "./projection-BunxoeON.mjs";
|
|
10
|
+
import { i as resolvePipelineSteps, t as resolveActionPermission } from "./actionPermissions-CQQrR4tu.mjs";
|
|
11
|
+
import { n as validateAggregations } from "./validate-qK_-7MVk.mjs";
|
|
12
|
+
import { n as executeAggregation } from "./buildHandler-D2DkqtiY.mjs";
|
|
13
|
+
import { t as pluralize } from "./pluralize-DgaYX91M.mjs";
|
|
14
|
+
import { t as createIdempotencyResult } from "./interface-CaPVHoVJ.mjs";
|
|
15
|
+
import { r as shouldRejectAdditionalProperties, t as normalizeSchemaIR } from "./schemaIR-BfI425RH.mjs";
|
|
16
16
|
import { isHttpError, toErrorContract } from "@classytic/repo-core/errors";
|
|
17
17
|
import { createHash, randomUUID } from "node:crypto";
|
|
18
18
|
import fp from "fastify-plugin";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
/*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-DrZrabOW.mjs";
|
|
3
3
|
//#region src/cache/memory.ts
|
|
4
4
|
var memory_exports = /* @__PURE__ */ __exportAll({ MemoryCacheStore: () => MemoryCacheStore });
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
/*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-DrZrabOW.mjs";
|
|
3
3
|
import fp from "fastify-plugin";
|
|
4
4
|
//#region src/plugins/metrics.ts
|
|
5
5
|
var metrics_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { I as MiddlewareHandler, L as RequestWithExtras, Q as MiddlewareConfig } from "../index-
|
|
2
|
+
import { I as MiddlewareHandler, L as RequestWithExtras, Q as MiddlewareConfig } from "../index-C01wWGJt.mjs";
|
|
3
3
|
import { RouteHandlerMethod } from "fastify";
|
|
4
4
|
//#region src/middleware/middleware.d.ts
|
|
5
5
|
interface NamedMiddleware {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as CRUD_OPERATIONS } from "../constants-
|
|
3
|
-
import { t as multipartBody } from "../multipartBody-
|
|
1
|
+
/*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as CRUD_OPERATIONS } from "../constants-CUpamQMJ.mjs";
|
|
3
|
+
import { t as multipartBody } from "../multipartBody-BVCoaTwu.mjs";
|
|
4
4
|
//#region src/middleware/middleware.ts
|
|
5
5
|
/**
|
|
6
6
|
* Named Middleware — Priority-based, conditional middleware execution.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as startRenewingLease } from "../renewingLease-
|
|
1
|
+
/*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as startRenewingLease } from "../renewingLease-C5Ta_ImD.mjs";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
//#region src/migrations/index.ts
|
|
5
5
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { n as getUserRoles } from "./userHelpers-
|
|
3
|
-
import { n as convertRouteSchema } from "./schemaConverter-
|
|
4
|
-
import { t as resolveActionPermission } from "./actionPermissions-
|
|
5
|
-
import { t as pluralize } from "./pluralize-
|
|
6
|
-
import { t as buildActionBodySchema } from "./createActionRouter-
|
|
1
|
+
/*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as getUserRoles } from "./userHelpers-DU_Z5OBA.mjs";
|
|
3
|
+
import { n as convertRouteSchema } from "./schemaConverter-C8zbW7tJ.mjs";
|
|
4
|
+
import { t as resolveActionPermission } from "./actionPermissions-CQQrR4tu.mjs";
|
|
5
|
+
import { t as pluralize } from "./pluralize-DgaYX91M.mjs";
|
|
6
|
+
import { t as buildActionBodySchema } from "./createActionRouter-CwDU_j2S.mjs";
|
|
7
7
|
import fp from "fastify-plugin";
|
|
8
8
|
//#region src/docs/openapi/canonical-schemas.ts
|
|
9
9
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { l as PermissionCheck } from "../base-
|
|
3
|
-
import { t as ArcModule } from "../types-
|
|
2
|
+
import { l as PermissionCheck } from "../base-C-NL2fTi.mjs";
|
|
3
|
+
import { t as ArcModule } from "../types-BMa2EPtv.mjs";
|
|
4
4
|
import { OutboxStore } from "@classytic/primitives/outbox";
|
|
5
5
|
//#region src/outbox-admin/module.d.ts
|
|
6
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { i as NotFoundError, u as ValidationError } from "../errors-
|
|
3
|
-
import { t as defineResource } from "../defineResource-
|
|
4
|
-
import { n as getModuleExports, t as defineModule } from "../module-
|
|
1
|
+
/*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
|
|
2
|
+
import { i as NotFoundError, u as ValidationError } from "../errors-DsdZc1Xv.mjs";
|
|
3
|
+
import { t as defineResource } from "../defineResource-WcbE1kJL.mjs";
|
|
4
|
+
import { n as getModuleExports, t as defineModule } from "../module-DIvG8qOg.mjs";
|
|
5
5
|
//#region src/outbox-admin/module.ts
|
|
6
6
|
/**
|
|
7
7
|
* Strip the domain payload and the stack unless explicitly opted in.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { a as EventTransport, n as DomainEvent, t as DeadLetteredEvent } from "./EventTransport-BEVP50ka.mjs";
|
|
3
|
-
import { t as ArcModule } from "./types-
|
|
3
|
+
import { t as ArcModule } from "./types-BMa2EPtv.mjs";
|
|
4
4
|
import { FastifyInstance } from "fastify";
|
|
5
5
|
import { MemoryOutboxStore } from "@classytic/primitives/memory-outbox";
|
|
6
6
|
import { OutboxFailurePolicy, OutboxStore, OutboxWriteOptions } from "@classytic/primitives/outbox";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as transactionContext } from "./transactionContext-
|
|
3
|
-
import { i as resolveEventTransport } from "./EventTransport-
|
|
4
|
-
import { n as createSafeGetOne, t as createIsDuplicateKeyError } from "./store-helpers-
|
|
1
|
+
/*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as transactionContext } from "./transactionContext-Ca5peQpc.mjs";
|
|
3
|
+
import { i as resolveEventTransport } from "./EventTransport-pGNNDQ__.mjs";
|
|
4
|
+
import { n as createSafeGetOne, t as createIsDuplicateKeyError } from "./store-helpers-bU8H5c-A.mjs";
|
|
5
5
|
import { and, anyOf, eq, lte, ne, or } from "@classytic/repo-core/filter";
|
|
6
6
|
import { randomBytes } from "node:crypto";
|
|
7
7
|
import { InvalidOutboxEventError, OutboxOwnershipError } from "@classytic/primitives/outbox";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { c as DataPolicy, d as UserBase, l as PermissionCheck, m as normalizeRoles, p as getUserRoles, s as AuthorizationDecision, u as PermissionContext } from "../base-
|
|
2
|
+
import { c as DataPolicy, d as UserBase, l as PermissionCheck, m as normalizeRoles, p as getUserRoles, s as AuthorizationDecision, u as PermissionContext } from "../base-C-NL2fTi.mjs";
|
|
3
3
|
import { a as applyFieldWritePermissions, i as applyFieldReadPermissions, n as FieldPermissionMap, o as fields, r as FieldPermissionType, s as resolveEffectiveRoles, t as FieldPermission } from "../fields-I_EeRWND.mjs";
|
|
4
|
-
import { $ as requireAuth, A as RequireGrantOptions, B as ConnectEventsOptions, C as requireServiceScope, D as GRANT_MODES, E as createRoleHierarchy, F as PermissionRequirement, G as createOrgPermissions, H as DynamicPermissionMatrixConfig, I as collectPublicSurface, J as allowPublic, K as allOf, L as describePermission, M as requireGrant, N as conjoinPolicyFilters, O as GrantMode, P as AccessExplanation, Q as not, R as describePermissionMap, S as requireScopeContext, T as RoleHierarchy, U as PermissionEventBus, V as DynamicPermissionMatrix, W as createDynamicPermissionMatrix, X as deny, Y as anyOf, Z as denyAll, _ as publicReadAdminWrite, a as PermissionMatrixRegistry, at as scopeOf, b as requireOrgMembership, c as introspectModule, ct as evaluatePermissionDecision, d as authenticated, dt as RequireMandateOptions, et as requireOwnership, f as fullPublic, ft as requireAgentScope, g as publicRead, h as presets_d_exports, i as PermissionMatrixOptions, it as when, j as modeSatisfies, k as GrantResolution, l as introspectRegistry, lt as normalizeToDecision, m as permissionMatrix, mt as requireMandate, n as PermissionEntryType, nt as requireRoles, o as buildPermissionMatrix, ot as PermissionCheckReturn, p as ownerWithAdminBypass, pt as requireDPoP, q as allow, r as PermissionMatrix, rt as roles, s as introspectCheck, st as applyAuthorizationDecision, t as PermissionEntry, tt as requirePlatformRole, u as adminOnly, ut as RequireAgentScopeOptions, v as readOnly, w as requireTeamMembership, x as requireOrgRole, y as requireOrgInScope, z as explainAccess } from "../index-
|
|
4
|
+
import { $ as requireAuth, A as RequireGrantOptions, B as ConnectEventsOptions, C as requireServiceScope, D as GRANT_MODES, E as createRoleHierarchy, F as PermissionRequirement, G as createOrgPermissions, H as DynamicPermissionMatrixConfig, I as collectPublicSurface, J as allowPublic, K as allOf, L as describePermission, M as requireGrant, N as conjoinPolicyFilters, O as GrantMode, P as AccessExplanation, Q as not, R as describePermissionMap, S as requireScopeContext, T as RoleHierarchy, U as PermissionEventBus, V as DynamicPermissionMatrix, W as createDynamicPermissionMatrix, X as deny, Y as anyOf, Z as denyAll, _ as publicReadAdminWrite, a as PermissionMatrixRegistry, at as scopeOf, b as requireOrgMembership, c as introspectModule, ct as evaluatePermissionDecision, d as authenticated, dt as RequireMandateOptions, et as requireOwnership, f as fullPublic, ft as requireAgentScope, g as publicRead, h as presets_d_exports, i as PermissionMatrixOptions, it as when, j as modeSatisfies, k as GrantResolution, l as introspectRegistry, lt as normalizeToDecision, m as permissionMatrix, mt as requireMandate, n as PermissionEntryType, nt as requireRoles, o as buildPermissionMatrix, ot as PermissionCheckReturn, p as ownerWithAdminBypass, pt as requireDPoP, q as allow, r as PermissionMatrix, rt as roles, s as introspectCheck, st as applyAuthorizationDecision, t as PermissionEntry, tt as requirePlatformRole, u as adminOnly, ut as RequireAgentScopeOptions, v as readOnly, w as requireTeamMembership, x as requireOrgRole, y as requireOrgInScope, z as explainAccess } from "../index-BtYoMip1.mjs";
|
|
5
5
|
export { type AccessExplanation, type AuthorizationDecision, type ConnectEventsOptions, type DataPolicy, type DynamicPermissionMatrix, type DynamicPermissionMatrixConfig, type FieldPermission, type FieldPermissionMap, type FieldPermissionType, GRANT_MODES, type GrantMode, type GrantResolution, type PermissionCheck, type PermissionCheckReturn, type PermissionContext, type PermissionEntry, type PermissionEntryType, type PermissionEventBus, type PermissionMatrix, type PermissionMatrixOptions, type PermissionMatrixRegistry, type PermissionRequirement, type RequireAgentScopeOptions, type RequireGrantOptions, type RequireMandateOptions, type RoleHierarchy, type UserBase, adminOnly, allOf, allow, allowPublic, anyOf, applyAuthorizationDecision, applyFieldReadPermissions, applyFieldWritePermissions, authenticated, buildPermissionMatrix, collectPublicSurface, conjoinPolicyFilters, createDynamicPermissionMatrix, createOrgPermissions, createRoleHierarchy, deny, denyAll, describePermission, describePermissionMap, evaluatePermissionDecision, explainAccess, fields, fullPublic, getUserRoles, introspectCheck, introspectModule, introspectRegistry, modeSatisfies, normalizeRoles, normalizeToDecision, not, ownerWithAdminBypass, permissionMatrix, presets_d_exports as permissions, publicRead, publicReadAdminWrite, readOnly, requireAgentScope, requireAuth, requireDPoP, requireGrant, requireMandate, requireOrgInScope, requireOrgMembership, requireOrgRole, requireOwnership, requirePlatformRole, requireRoles, requireScopeContext, requireServiceScope, requireTeamMembership, resolveEffectiveRoles, roles, scopeOf, when };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { a as conjoinPolicyFilters, i as normalizeToDecision, r as evaluatePermissionDecision, t as applyAuthorizationDecision } from "../authorizationDecision-
|
|
3
|
-
import { n as getUserRoles, r as normalizeRoles } from "../userHelpers-
|
|
4
|
-
import { i as resolveEffectiveRoles, n as applyFieldWritePermissions, r as fields, t as applyFieldReadPermissions } from "../fields-
|
|
5
|
-
import { A as requireAgentScope, B as requireAuth, C as createOrgPermissions, D as requireScopeContext, E as requireOrgRole, F as allowPublic, G as when, H as requirePlatformRole, I as anyOf, K as scopeOf, L as deny, M as requireMandate, N as allOf, O as requireServiceScope, P as allow, R as denyAll, S as createDynamicPermissionMatrix, T as requireOrgMembership, U as requireRoles, V as requireOwnership, W as roles, _ as requireGrant, a as adminOnly, b as describePermissionMap, c as ownerWithAdminBypass, d as publicRead, f as publicReadAdminWrite, g as modeSatisfies, h as GRANT_MODES, i as introspectRegistry, j as requireDPoP, k as requireTeamMembership, l as permissionMatrix, m as createRoleHierarchy, n as introspectCheck, o as authenticated, p as readOnly, r as introspectModule, s as fullPublic, t as buildPermissionMatrix, u as presets_exports, v as collectPublicSurface, w as requireOrgInScope, x as explainAccess, y as describePermission, z as not } from "../permissions-
|
|
1
|
+
/*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
|
|
2
|
+
import { a as conjoinPolicyFilters, i as normalizeToDecision, r as evaluatePermissionDecision, t as applyAuthorizationDecision } from "../authorizationDecision-DgyWdav8.mjs";
|
|
3
|
+
import { n as getUserRoles, r as normalizeRoles } from "../userHelpers-DU_Z5OBA.mjs";
|
|
4
|
+
import { i as resolveEffectiveRoles, n as applyFieldWritePermissions, r as fields, t as applyFieldReadPermissions } from "../fields-DvGz47Ul.mjs";
|
|
5
|
+
import { A as requireAgentScope, B as requireAuth, C as createOrgPermissions, D as requireScopeContext, E as requireOrgRole, F as allowPublic, G as when, H as requirePlatformRole, I as anyOf, K as scopeOf, L as deny, M as requireMandate, N as allOf, O as requireServiceScope, P as allow, R as denyAll, S as createDynamicPermissionMatrix, T as requireOrgMembership, U as requireRoles, V as requireOwnership, W as roles, _ as requireGrant, a as adminOnly, b as describePermissionMap, c as ownerWithAdminBypass, d as publicRead, f as publicReadAdminWrite, g as modeSatisfies, h as GRANT_MODES, i as introspectRegistry, j as requireDPoP, k as requireTeamMembership, l as permissionMatrix, m as createRoleHierarchy, n as introspectCheck, o as authenticated, p as readOnly, r as introspectModule, s as fullPublic, t as buildPermissionMatrix, u as presets_exports, v as collectPublicSurface, w as requireOrgInScope, x as explainAccess, y as describePermission, z as not } from "../permissions-DWkl60hx.mjs";
|
|
6
6
|
export { GRANT_MODES, adminOnly, allOf, allow, allowPublic, anyOf, applyAuthorizationDecision, applyFieldReadPermissions, applyFieldWritePermissions, authenticated, buildPermissionMatrix, collectPublicSurface, conjoinPolicyFilters, createDynamicPermissionMatrix, createOrgPermissions, createRoleHierarchy, deny, denyAll, describePermission, describePermissionMap, evaluatePermissionDecision, explainAccess, fields, fullPublic, getUserRoles, introspectCheck, introspectModule, introspectRegistry, modeSatisfies, normalizeRoles, normalizeToDecision, not, ownerWithAdminBypass, permissionMatrix, presets_exports as permissions, publicRead, publicReadAdminWrite, readOnly, requireAgentScope, requireAuth, requireDPoP, requireGrant, requireMandate, requireOrgInScope, requireOrgMembership, requireOrgRole, requireOwnership, requirePlatformRole, requireRoles, requireScopeContext, requireServiceScope, requireTeamMembership, resolveEffectiveRoles, roles, scopeOf, when };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
/*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-DrZrabOW.mjs";
|
|
3
3
|
import { arcLog } from "./logger/index.mjs";
|
|
4
|
-
import { a as conjoinPolicyFilters, i as normalizeToDecision } from "./authorizationDecision-
|
|
5
|
-
import { n as getUserRoles } from "./userHelpers-
|
|
6
|
-
import { C as isService, S as isOrgInScope, a as getDPoPJkt, b as isElevated, d as getScopeContext, f as getScopeContextMap, g as getUserId, m as getTeamId, n as PUBLIC_SCOPE, o as getMandate, p as getServiceScopes, u as getRequestScope, v as hasOrgAccess, x as isMember } from "./types-
|
|
7
|
-
import { t as MemoryCacheStore } from "./memory-
|
|
4
|
+
import { a as conjoinPolicyFilters, i as normalizeToDecision } from "./authorizationDecision-DgyWdav8.mjs";
|
|
5
|
+
import { n as getUserRoles } from "./userHelpers-DU_Z5OBA.mjs";
|
|
6
|
+
import { C as isService, S as isOrgInScope, a as getDPoPJkt, b as isElevated, d as getScopeContext, f as getScopeContextMap, g as getUserId, m as getTeamId, n as PUBLIC_SCOPE, o as getMandate, p as getServiceScopes, u as getRequestScope, v as hasOrgAccess, x as isMember } from "./types-lDs9oF4z.mjs";
|
|
7
|
+
import { t as MemoryCacheStore } from "./memory-BnafVem_.mjs";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
9
|
//#region src/permissions/context.ts
|
|
10
10
|
/**
|
|
@@ -260,7 +260,8 @@ function allOf(...checks) {
|
|
|
260
260
|
});
|
|
261
261
|
};
|
|
262
262
|
const roleBranches = checks.filter((c) => (c._roles?.length ?? 0) > 0 || (c._orgRoles?.length ?? 0) > 0);
|
|
263
|
-
if (checks.
|
|
263
|
+
if (checks.some((c) => c._isDenied)) check._isDenied = true;
|
|
264
|
+
else if (checks.length > 0 && checks.every((c) => c._isPublic)) check._isPublic = true;
|
|
264
265
|
else if (roleBranches.length === 1) {
|
|
265
266
|
const [rb] = roleBranches;
|
|
266
267
|
if (rb?._roles?.length) check._roles = [...rb._roles];
|
|
@@ -300,7 +301,8 @@ function anyOf(...checks) {
|
|
|
300
301
|
}
|
|
301
302
|
return deny(reasons.join("; "));
|
|
302
303
|
};
|
|
303
|
-
if (checks.
|
|
304
|
+
if (checks.length > 0 && checks.every((c) => c._isDenied)) check._isDenied = true;
|
|
305
|
+
else if (checks.some((c) => c._isPublic)) check._isPublic = true;
|
|
304
306
|
else if (checks.every((c) => (c._roles?.length ?? 0) > 0 || (c._orgRoles?.length ?? 0) > 0)) {
|
|
305
307
|
const roles = /* @__PURE__ */ new Set();
|
|
306
308
|
const orgRoles = /* @__PURE__ */ new Set();
|
|
@@ -344,7 +346,16 @@ function not(check, reason = "Access denied") {
|
|
|
344
346
|
* ```
|
|
345
347
|
*/
|
|
346
348
|
function denyAll(reason = "Access denied") {
|
|
347
|
-
|
|
349
|
+
const check = () => deny(reason);
|
|
350
|
+
/**
|
|
351
|
+
* MARKED, not bare. Introspection (`describePermission`) reads metadata, and a
|
|
352
|
+
* closure with none fell through to `{ kind: "authenticated" }` — publishing
|
|
353
|
+
* the library's most restrictive gate as "any signed-in user may do this".
|
|
354
|
+
* Enforcement was never wrong; the description was, in the direction that
|
|
355
|
+
* makes a UI offer an action nobody can perform.
|
|
356
|
+
*/
|
|
357
|
+
check._isDenied = true;
|
|
358
|
+
return check;
|
|
348
359
|
}
|
|
349
360
|
/**
|
|
350
361
|
* Dynamic permission based on a condition function.
|
|
@@ -1068,6 +1079,7 @@ function createDynamicPermissionMatrix(config) {
|
|
|
1068
1079
|
* fully captured statically carries `conditional: true` (see `_conditional`).
|
|
1069
1080
|
*/
|
|
1070
1081
|
function describePermission(check) {
|
|
1082
|
+
if (check._isDenied) return { kind: "denied" };
|
|
1071
1083
|
if (check._isPublic) return { kind: "public" };
|
|
1072
1084
|
const roles = [...check._roles ?? [], ...check._orgRoles ?? []];
|
|
1073
1085
|
const scope = check._scopeContext;
|
|
@@ -1100,6 +1112,17 @@ function describePermission(check) {
|
|
|
1100
1112
|
*/
|
|
1101
1113
|
function explainAccess(check, principal) {
|
|
1102
1114
|
const requirement = describePermission(check);
|
|
1115
|
+
/**
|
|
1116
|
+
* DEFINITIVE, and checked before everything else. `denyAll()` is the one gate
|
|
1117
|
+
* whose answer needs no principal and no request — reporting it as
|
|
1118
|
+
* `conditional` (which "authenticated" does) tells a UI to render the action
|
|
1119
|
+
* and find out later, and later is a 403 the user cannot act on.
|
|
1120
|
+
*/
|
|
1121
|
+
if (requirement.kind === "denied") return {
|
|
1122
|
+
decision: "deny",
|
|
1123
|
+
reason: "denied to everyone",
|
|
1124
|
+
requirement
|
|
1125
|
+
};
|
|
1103
1126
|
if (requirement.kind === "public") return {
|
|
1104
1127
|
decision: "allow",
|
|
1105
1128
|
reason: "public — no authentication required",
|
|
@@ -1594,6 +1617,10 @@ function introspectCheck(check) {
|
|
|
1594
1617
|
roles: req.roles ? [...req.roles] : [],
|
|
1595
1618
|
scope: { ...req.scope }
|
|
1596
1619
|
};
|
|
1620
|
+
if (req.kind === "denied") return {
|
|
1621
|
+
type: "denied",
|
|
1622
|
+
roles: []
|
|
1623
|
+
};
|
|
1597
1624
|
return {
|
|
1598
1625
|
type: "authenticated",
|
|
1599
1626
|
roles: []
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { r as ForbiddenError } from "./errors-
|
|
1
|
+
/*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
|
|
2
|
+
import { r as ForbiddenError } from "./errors-DsdZc1Xv.mjs";
|
|
3
3
|
//#region src/pipeline/pipe.ts
|
|
4
4
|
/**
|
|
5
5
|
* Compose pipeline steps into an ordered array.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { Ct as PipelineStep, Fn as IControllerResponse, St as PipelineContext, _t as Guard, bt as OperationFilter, vt as Interceptor, wt as Transform, xt as PipelineConfig, yt as NextFunction } from "../index-
|
|
2
|
+
import { Ct as PipelineStep, Fn as IControllerResponse, St as PipelineContext, _t as Guard, bt as OperationFilter, vt as Interceptor, wt as Transform, xt as PipelineConfig, yt as NextFunction } from "../index-C01wWGJt.mjs";
|
|
3
3
|
//#region src/pipeline/guard.d.ts
|
|
4
4
|
interface GuardOptions {
|
|
5
5
|
operations?: OperationFilter;
|
package/dist/pipeline/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { n as pipe, t as executePipeline } from "../pipe-
|
|
1
|
+
/*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as pipe, t as executePipeline } from "../pipe-Dbs3GhOZ.mjs";
|
|
3
3
|
//#region src/pipeline/guard.ts
|
|
4
4
|
/**
|
|
5
5
|
* Create a named guard.
|
package/dist/plugins/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
import { t as AnyRecord } from "../base-
|
|
3
|
-
import { At as RouteDefinition, J as PresetHook, Q as MiddlewareConfig, et as RouteSchemaOptions } from "../index-
|
|
2
|
+
import { t as AnyRecord } from "../base-C-NL2fTi.mjs";
|
|
3
|
+
import { At as RouteDefinition, J as PresetHook, Q as MiddlewareConfig, et as RouteSchemaOptions } from "../index-C01wWGJt.mjs";
|
|
4
4
|
import { i as errorHandlerPlugin, n as ErrorMapper, r as defaultIsDuplicateKeyError, t as ErrorHandlerOptions } from "../errorHandler-DI5AN2b5.mjs";
|
|
5
|
-
import { _ as HealthCheck, b as healthPlugin, f as ScheduleDefinition, g as schedulesPlugin, h as _default$8, m as SchedulesPluginOptions, p as ScheduleStats, v as HealthOptions, y as _default$3 } from "../types-
|
|
6
|
-
import { a as arcCorePlugin, i as _default, n as ArcCorePluginOptions, r as PluginMeta, t as ArcCore } from "../fastify-augmentation-
|
|
5
|
+
import { _ as HealthCheck, b as healthPlugin, f as ScheduleDefinition, g as schedulesPlugin, h as _default$8, m as SchedulesPluginOptions, p as ScheduleStats, v as HealthOptions, y as _default$3 } from "../types-BMa2EPtv.mjs";
|
|
6
|
+
import { a as arcCorePlugin, i as _default, n as ArcCorePluginOptions, r as PluginMeta, t as ArcCore } from "../fastify-augmentation-CdY8FINU.mjs";
|
|
7
7
|
import { _ as CachingRule, a as MetricsCollector, c as metricsPlugin, d as _default$6, f as realtimePlugin, g as CachingOptions, h as ssePlugin, i as MetricEntry, l as ChangeOperation, m as _default$9, n as _default$10, o as MetricsOptions, p as SSEOptions, r as versioningPlugin, s as _default$4, t as VersioningOptions, u as RealtimeOptions, v as _default$1, y as cachingPlugin } from "../versioning-DEs-_hFi.mjs";
|
|
8
8
|
import { t as TracingOptions } from "../tracing-Dro5eH6j.mjs";
|
|
9
9
|
import { PaginatedResult } from "@classytic/repo-core/pagination";
|
package/dist/plugins/index.mjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { p as MUTATION_OPERATIONS } from "../constants-
|
|
1
|
+
/*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
|
|
2
|
+
import { p as MUTATION_OPERATIONS } from "../constants-CUpamQMJ.mjs";
|
|
3
3
|
import { arcLog } from "../logger/index.mjs";
|
|
4
|
-
import { c as getOrgId } from "../types-
|
|
5
|
-
import { n as requestContext } from "../requestContext-
|
|
6
|
-
import { t as hasEvents } from "../typeGuards-
|
|
7
|
-
import { t as HookSystem } from "../HookSystem-
|
|
8
|
-
import { t as ResourceRegistry } from "../ResourceRegistry-
|
|
9
|
-
import { a as requestIdPlugin, i as createRequestIdGenerator, n as health_default, o as requestId_default, s as sanitizeRequestId, t as healthPlugin } from "../health-
|
|
10
|
-
import { n as caching_default, t as cachingPlugin } from "../caching-
|
|
11
|
-
import { n as errorHandlerPlugin, t as defaultIsDuplicateKeyError } from "../errorHandler-
|
|
12
|
-
import { n as metrics_default, t as metricsPlugin } from "../metrics-
|
|
13
|
-
import { n as realtime_default, t as realtimePlugin } from "../realtime-
|
|
14
|
-
import { t as replyHelpersPlugin } from "../replyHelpers-
|
|
15
|
-
import { n as schedules_default, t as schedulesPlugin } from "../schedules-
|
|
16
|
-
import { n as sse_default, t as ssePlugin } from "../sse-
|
|
17
|
-
import { n as versioning_default, t as versioningPlugin } from "../versioning-
|
|
4
|
+
import { c as getOrgId } from "../types-lDs9oF4z.mjs";
|
|
5
|
+
import { n as requestContext } from "../requestContext-DGM7EZRI.mjs";
|
|
6
|
+
import { t as hasEvents } from "../typeGuards-ALWme5WB.mjs";
|
|
7
|
+
import { t as HookSystem } from "../HookSystem-CuhHvcyZ.mjs";
|
|
8
|
+
import { t as ResourceRegistry } from "../ResourceRegistry-DFOmazXg.mjs";
|
|
9
|
+
import { a as requestIdPlugin, i as createRequestIdGenerator, n as health_default, o as requestId_default, s as sanitizeRequestId, t as healthPlugin } from "../health-Cc_sb94d.mjs";
|
|
10
|
+
import { n as caching_default, t as cachingPlugin } from "../caching-BmC2T-pX.mjs";
|
|
11
|
+
import { n as errorHandlerPlugin, t as defaultIsDuplicateKeyError } from "../errorHandler-CB75oY5i.mjs";
|
|
12
|
+
import { n as metrics_default, t as metricsPlugin } from "../metrics-CeAIcVMY.mjs";
|
|
13
|
+
import { n as realtime_default, t as realtimePlugin } from "../realtime-CiAp2-LH.mjs";
|
|
14
|
+
import { t as replyHelpersPlugin } from "../replyHelpers-D1k0wHoO.mjs";
|
|
15
|
+
import { n as schedules_default, t as schedulesPlugin } from "../schedules-CVtolEa-.mjs";
|
|
16
|
+
import { n as sse_default, t as ssePlugin } from "../sse-vRuwDd6N.mjs";
|
|
17
|
+
import { n as versioning_default, t as versioningPlugin } from "../versioning-Dtw0MyX4.mjs";
|
|
18
18
|
import fp from "fastify-plugin";
|
|
19
19
|
import { performance as performance$1 } from "node:perf_hooks";
|
|
20
20
|
//#region src/core/arcCorePlugin.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as hasEvents } from "../typeGuards-
|
|
1
|
+
/*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as hasEvents } from "../typeGuards-ALWme5WB.mjs";
|
|
3
3
|
import fp from "fastify-plugin";
|
|
4
4
|
//#region src/plugins/response-cache.ts
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import fp from "fastify-plugin";
|
|
4
4
|
//#region src/plugins/tracing.ts
|
|
@@ -59,7 +59,7 @@ try {
|
|
|
59
59
|
function createTracerProvider(options) {
|
|
60
60
|
if (!isAvailable || !NodeTracerProvider || !BatchSpanProcessor || !OTLPTraceExporter) return null;
|
|
61
61
|
const { serviceName = "@classytic/arc", serviceVersion, exporterUrl = "http://localhost:4318/v1/traces" } = options;
|
|
62
|
-
const resolvedVersion = serviceVersion ?? "2.
|
|
62
|
+
const resolvedVersion = serviceVersion ?? "2.37.0";
|
|
63
63
|
const exporter = new OTLPTraceExporter({ url: exporterUrl });
|
|
64
64
|
const provider = new NodeTracerProvider({ resource: { attributes: {
|
|
65
65
|
"service.name": serviceName,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
/*! @classytic/arc v2.37.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-DrZrabOW.mjs";
|
|
3
3
|
import { arcLog, configureArcLogger, createPinoWriter, enterArcLoggerScope, runWithArcLogger } from "./logger/index.mjs";
|
|
4
|
-
import { n as PUBLIC_SCOPE } from "./types-
|
|
5
|
-
import { t as auditRuntimeCapabilities } from "./runtimeCapabilities-
|
|
6
|
-
import { t as createTenantKeyGenerator } from "./rateLimitKey-
|
|
7
|
-
import { i as createRequestIdGenerator, r as mergeHealthChecks } from "./health-
|
|
8
|
-
import { t as parseJsonBody } from "./jsonBody-
|
|
9
|
-
import { r as wrapWithBoundary } from "./subscribe-helpers-
|
|
4
|
+
import { n as PUBLIC_SCOPE } from "./types-lDs9oF4z.mjs";
|
|
5
|
+
import { t as auditRuntimeCapabilities } from "./runtimeCapabilities-c4Sc85X-.mjs";
|
|
6
|
+
import { t as createTenantKeyGenerator } from "./rateLimitKey-DlqmDHA5.mjs";
|
|
7
|
+
import { i as createRequestIdGenerator, r as mergeHealthChecks } from "./health-Cc_sb94d.mjs";
|
|
8
|
+
import { t as parseJsonBody } from "./jsonBody-BuzxOZV8.mjs";
|
|
9
|
+
import { r as wrapWithBoundary } from "./subscribe-helpers-BrcG3NlV.mjs";
|
|
10
10
|
import { isProductionEnv } from "@classytic/primitives/environment";
|
|
11
11
|
import Fastify from "fastify";
|
|
12
12
|
import qs from "qs";
|
|
@@ -48,6 +48,56 @@ const PLUGIN_REGISTRY = {
|
|
|
48
48
|
optional: true
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
+
/**
|
|
52
|
+
* Fail ONCE with every missing package, before any plugin registers.
|
|
53
|
+
*
|
|
54
|
+
* Without this the first absent package throws and the operator installs it,
|
|
55
|
+
* restarts, hits the next one, and repeats — six restarts to discover a peer
|
|
56
|
+
* set that was pruned as a unit. These are OPTIONAL peers of arc, so nothing
|
|
57
|
+
* at install or build time says they are gone; the first signal is a boot
|
|
58
|
+
* crash naming exactly one of them.
|
|
59
|
+
*
|
|
60
|
+
* Required-ness is read from `PLUGIN_REGISTRY` (`!optional`), never a second
|
|
61
|
+
* list — a hand-maintained copy is what goes stale the day a plugin is added.
|
|
62
|
+
* Optional plugins are deliberately NOT preflighted: their absence is a
|
|
63
|
+
* supported configuration, and `loadPlugin` already warns and skips.
|
|
64
|
+
*
|
|
65
|
+
* A plugin the host disabled (`{ helmet: false }`) is not checked — refusing to
|
|
66
|
+
* boot over a package for a plugin nobody asked for would be the opposite of
|
|
67
|
+
* helpful.
|
|
68
|
+
*/
|
|
69
|
+
async function preflightPlugins(config, options = {}) {
|
|
70
|
+
const { load } = options;
|
|
71
|
+
const required = Object.entries(PLUGIN_REGISTRY).filter(([name, entry]) => !entry.optional && config[name] !== false);
|
|
72
|
+
const results = await Promise.allSettled(required.map(([name, entry]) => load ? load(name) : entry.loader()));
|
|
73
|
+
const missing = [];
|
|
74
|
+
for (const [i, result] of results.entries()) {
|
|
75
|
+
if (result.status === "fulfilled") continue;
|
|
76
|
+
const [name, entry] = required[i];
|
|
77
|
+
if (!isModuleNotFound(result.reason)) throw new Error(`Failed to load plugin '${name}': ${result.reason.message}`);
|
|
78
|
+
missing.push({
|
|
79
|
+
name,
|
|
80
|
+
package: entry.package
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
if (missing.length === 0) return;
|
|
84
|
+
const packages = missing.map((m) => m.package);
|
|
85
|
+
throw new Error(`arc cannot start: ${missing.length} required plugin package(s) are not installed.\n` + missing.map((m) => ` - ${m.package} (plugin '${m.name}')`).join("\n") + `\n\nInstall all of them:\n npm install ${packages.join(" ")}\n\nOr disable the plugins you do not need in createApp options: ` + missing.map((m) => `${m.name}: false`).join(", "));
|
|
86
|
+
}
|
|
87
|
+
/** Shared by the preflight and the per-plugin loader so they agree on what "missing" means. */
|
|
88
|
+
function isModuleNotFound(err) {
|
|
89
|
+
/**
|
|
90
|
+
* CODE first, message second. Node sets `ERR_MODULE_NOT_FOUND` (ESM) or
|
|
91
|
+
* `MODULE_NOT_FOUND` (CJS) on a real resolution failure; the message text
|
|
92
|
+
* varies by Node version, loader and bundler, so matching it alone is a
|
|
93
|
+
* predicate that silently stops matching after an upgrade — and this one
|
|
94
|
+
* decides between "install a package" and "your plugin crashed".
|
|
95
|
+
*/
|
|
96
|
+
const code = err?.code;
|
|
97
|
+
if (code === "ERR_MODULE_NOT_FOUND" || code === "MODULE_NOT_FOUND") return true;
|
|
98
|
+
const m = err?.message ?? "";
|
|
99
|
+
return m.includes("Cannot find module") || m.includes("Cannot find package") || m.includes("MODULE_NOT_FOUND") || m.includes("Could not resolve");
|
|
100
|
+
}
|
|
51
101
|
async function loadPlugin(name, logger) {
|
|
52
102
|
const entry = PLUGIN_REGISTRY[name];
|
|
53
103
|
if (!entry) throw new Error(`Unknown plugin: ${name}`);
|
|
@@ -55,12 +105,12 @@ async function loadPlugin(name, logger) {
|
|
|
55
105
|
return await entry.loader();
|
|
56
106
|
} catch (error) {
|
|
57
107
|
const err = error;
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
108
|
+
const notFound = isModuleNotFound(err);
|
|
109
|
+
if (notFound && entry.optional) {
|
|
60
110
|
logger?.warn(`Optional plugin '${name}' skipped (${entry.package} not installed)`);
|
|
61
111
|
return null;
|
|
62
112
|
}
|
|
63
|
-
if (
|
|
113
|
+
if (notFound) throw new Error(`Plugin '${name}' requires package '${entry.package}' which is not installed.\nInstall it with: npm install ${entry.package}\nOr disable this plugin by setting ${name}: false in createApp options.`);
|
|
64
114
|
throw new Error(`Failed to load plugin '${name}': ${err.message}`);
|
|
65
115
|
}
|
|
66
116
|
}
|
|
@@ -801,7 +851,7 @@ async function registerArcCore(fastify, config, trackPlugin) {
|
|
|
801
851
|
await fastify.register(arcCorePlugin, { emitEvents: config.arcPlugins?.emitEvents !== false });
|
|
802
852
|
trackPlugin("arc-core");
|
|
803
853
|
if (config.arcPlugins?.events !== false) {
|
|
804
|
-
const { default: eventPlugin } = await import("./eventPlugin-
|
|
854
|
+
const { default: eventPlugin } = await import("./eventPlugin-DEIfV1iC.mjs").then((n) => n.n);
|
|
805
855
|
const eventOpts = typeof config.arcPlugins?.events === "object" ? config.arcPlugins.events : {};
|
|
806
856
|
await fastify.register(eventPlugin, {
|
|
807
857
|
/**
|
|
@@ -860,15 +910,15 @@ async function registerArcPlugins(fastify, config, trackPlugin, modules, moduleH
|
|
|
860
910
|
trackPlugin("arc-graceful-shutdown");
|
|
861
911
|
}
|
|
862
912
|
if (config.arcPlugins?.caching) {
|
|
863
|
-
const { default: cachingPlugin } = await import("./caching-
|
|
913
|
+
const { default: cachingPlugin } = await import("./caching-BmC2T-pX.mjs").then((n) => n.r);
|
|
864
914
|
const opts = config.arcPlugins.caching === true ? {} : config.arcPlugins.caching;
|
|
865
915
|
await fastify.register(cachingPlugin, opts);
|
|
866
916
|
trackPlugin("arc-caching", opts);
|
|
867
917
|
}
|
|
868
918
|
if (config.arcPlugins?.queryCache) {
|
|
869
|
-
const { queryCachePlugin } = await import("./queryCachePlugin-
|
|
919
|
+
const { queryCachePlugin } = await import("./queryCachePlugin-BYqmg89O.mjs").then((n) => n.n);
|
|
870
920
|
const opts = config.arcPlugins.queryCache === true ? {} : config.arcPlugins.queryCache;
|
|
871
|
-
const store = config.stores?.queryCache ?? new (await (import("./memory-
|
|
921
|
+
const store = config.stores?.queryCache ?? new (await (import("./memory-BnafVem_.mjs").then((n) => n.n))).MemoryCacheStore();
|
|
872
922
|
await fastify.register(queryCachePlugin, {
|
|
873
923
|
store,
|
|
874
924
|
...opts
|
|
@@ -878,7 +928,7 @@ async function registerArcPlugins(fastify, config, trackPlugin, modules, moduleH
|
|
|
878
928
|
if (config.arcPlugins?.sse) {
|
|
879
929
|
if (config.arcPlugins?.events === false) fastify.log.warn("SSE plugin requires events plugin (arcPlugins.events). SSE disabled.");
|
|
880
930
|
else {
|
|
881
|
-
const { default: ssePlugin } = await import("./sse-
|
|
931
|
+
const { default: ssePlugin } = await import("./sse-vRuwDd6N.mjs").then((n) => n.r);
|
|
882
932
|
const opts = config.arcPlugins.sse === true ? {} : config.arcPlugins.sse;
|
|
883
933
|
await fastify.register(ssePlugin, opts);
|
|
884
934
|
trackPlugin("arc-sse", opts);
|
|
@@ -887,20 +937,20 @@ async function registerArcPlugins(fastify, config, trackPlugin, modules, moduleH
|
|
|
887
937
|
if (config.arcPlugins?.realtime) {
|
|
888
938
|
if (config.arcPlugins?.events === false) fastify.log.warn("Realtime plugin requires events plugin (arcPlugins.events). Realtime disabled.");
|
|
889
939
|
else {
|
|
890
|
-
const { default: realtimePlugin } = await import("./realtime-
|
|
940
|
+
const { default: realtimePlugin } = await import("./realtime-CiAp2-LH.mjs").then((n) => n.r);
|
|
891
941
|
const opts = config.arcPlugins.realtime === true ? {} : config.arcPlugins.realtime;
|
|
892
942
|
await fastify.register(realtimePlugin, opts);
|
|
893
943
|
trackPlugin("arc-realtime", opts);
|
|
894
944
|
}
|
|
895
945
|
}
|
|
896
946
|
if (config.arcPlugins?.metrics) {
|
|
897
|
-
const { default: metricsPlugin } = await import("./metrics-
|
|
947
|
+
const { default: metricsPlugin } = await import("./metrics-CeAIcVMY.mjs").then((n) => n.r);
|
|
898
948
|
const opts = config.arcPlugins.metrics === true ? {} : config.arcPlugins.metrics;
|
|
899
949
|
await fastify.register(metricsPlugin, opts);
|
|
900
950
|
trackPlugin("arc-metrics", opts);
|
|
901
951
|
}
|
|
902
952
|
if (config.arcPlugins?.versioning) {
|
|
903
|
-
const { default: versioningPlugin } = await import("./versioning-
|
|
953
|
+
const { default: versioningPlugin } = await import("./versioning-Dtw0MyX4.mjs").then((n) => n.r);
|
|
904
954
|
await fastify.register(versioningPlugin, config.arcPlugins.versioning);
|
|
905
955
|
trackPlugin("arc-versioning", config.arcPlugins.versioning);
|
|
906
956
|
}
|
|
@@ -977,7 +1027,7 @@ async function registerAuth(fastify, config, trackPlugin) {
|
|
|
977
1027
|
*/
|
|
978
1028
|
async function registerElevation(fastify, config, trackPlugin) {
|
|
979
1029
|
if (!config.elevation) return;
|
|
980
|
-
const { elevationPlugin } = await import("./elevation-
|
|
1030
|
+
const { elevationPlugin } = await import("./elevation-Bc6Gafv9.mjs").then((n) => n.r);
|
|
981
1031
|
await fastify.register(elevationPlugin, config.elevation);
|
|
982
1032
|
trackPlugin("arc-elevation", config.elevation);
|
|
983
1033
|
fastify.log.debug("Elevation plugin enabled");
|
|
@@ -992,7 +1042,7 @@ async function registerElevation(fastify, config, trackPlugin) {
|
|
|
992
1042
|
*/
|
|
993
1043
|
async function registerErrorHandler(fastify, config, trackPlugin, moduleErrorMappers) {
|
|
994
1044
|
if (config.errorHandler === false) return;
|
|
995
|
-
const { errorHandlerPlugin } = await import("./errorHandler-
|
|
1045
|
+
const { errorHandlerPlugin } = await import("./errorHandler-CB75oY5i.mjs").then((n) => n.r);
|
|
996
1046
|
/**
|
|
997
1047
|
* DISCLOSURE DEFAULTS MERGE — they used to be REPLACED, and that was two bugs.
|
|
998
1048
|
*
|
|
@@ -1216,7 +1266,7 @@ async function registerResources(fastify, config, preResolvedModules) {
|
|
|
1216
1266
|
let discoveryPath;
|
|
1217
1267
|
let discoveryYieldedZero = false;
|
|
1218
1268
|
if (resolvedResources === void 0 && config.resourceDir) {
|
|
1219
|
-
const { loadResources } = await import("./loadResources-
|
|
1269
|
+
const { loadResources } = await import("./loadResources-CPlRWJCv.mjs").then((n) => n.n);
|
|
1220
1270
|
const { resolve, dirname } = await import("node:path");
|
|
1221
1271
|
const { fileURLToPath } = await import("node:url");
|
|
1222
1272
|
const rawDir = config.resourceDir;
|
|
@@ -1342,7 +1392,7 @@ Resources supplied by "${m.name}": ${provided}.`);
|
|
|
1342
1392
|
if (fastify.hasDecorator("getScheduleStats")) throw new Error("[arc] modules declare scheduledJobs but schedulesPlugin was already registered manually. Configure their runner through arcPlugins.schedules so Arc can compose one schedule table.");
|
|
1343
1393
|
const frozenJobs = Object.freeze(scheduledJobs.map((job) => Object.freeze({ ...job })));
|
|
1344
1394
|
const scheduleOptions = typeof config.arcPlugins?.schedules === "object" ? config.arcPlugins.schedules : {};
|
|
1345
|
-
const { default: schedulesPlugin } = await import("./schedules-
|
|
1395
|
+
const { default: schedulesPlugin } = await import("./schedules-CVtolEa-.mjs").then((n) => n.r);
|
|
1346
1396
|
await fastify.register(schedulesPlugin, {
|
|
1347
1397
|
...scheduleOptions,
|
|
1348
1398
|
schedules: frozenJobs
|
|
@@ -1552,6 +1602,11 @@ function compilePathMatcher(patterns) {
|
|
|
1552
1602
|
* All enabled by default — set to `false` to opt out.
|
|
1553
1603
|
*/
|
|
1554
1604
|
async function registerSecurityPlugins(fastify, config) {
|
|
1605
|
+
/**
|
|
1606
|
+
* Resolve every enabled plugin's package FIRST, so a pruned peer set is one
|
|
1607
|
+
* error listing all of them rather than one restart per package.
|
|
1608
|
+
*/
|
|
1609
|
+
await preflightPlugins(config);
|
|
1555
1610
|
if (config.helmet !== false) {
|
|
1556
1611
|
const helmet = await loadPlugin("helmet");
|
|
1557
1612
|
await fastify.register(helmet, config.helmet ?? {});
|
|
@@ -1944,7 +1999,7 @@ async function buildApp(options, loggerScope, onInstance) {
|
|
|
1944
1999
|
await registerErrorHandler(fastify, config, trackPlugin, moduleErrorMappers);
|
|
1945
2000
|
await registerResources(fastify, config, resolvedModules);
|
|
1946
2001
|
if (config.replyHelpers) {
|
|
1947
|
-
const { replyHelpersPlugin } = await import("./replyHelpers-
|
|
2002
|
+
const { replyHelpersPlugin } = await import("./replyHelpers-D1k0wHoO.mjs").then((n) => n.n);
|
|
1948
2003
|
await fastify.register(replyHelpersPlugin);
|
|
1949
2004
|
}
|
|
1950
2005
|
if (config.serializeBigInt) {
|