@classytic/arc 2.43.0 → 2.45.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/{EventTransport-tzA7CAB4.mjs → EventTransport-Ci6hGO1Y.mjs} +2 -2
- package/dist/{HookSystem-B6UaKRbF.mjs → HookSystem-CtnnYHME.mjs} +2 -2
- package/dist/{ResourceRegistry-CuCARu2B.mjs → ResourceRegistry-BNoHOx-D.mjs} +2 -2
- package/dist/acquire-BW_2Dt60.mjs +35 -0
- package/dist/{actionPermissions-BotX1YOa.mjs → actionPermissions-TAc_6LCw.mjs} +13 -17
- package/dist/audit/index.d.mts +6 -6
- package/dist/audit/index.mjs +4 -4
- package/dist/auth/audit.d.mts +8 -8
- package/dist/auth/audit.mjs +1 -1
- package/dist/auth/index.d.mts +5 -5
- package/dist/auth/index.mjs +14 -12
- package/dist/auth/redis-session.d.mts +4 -5
- package/dist/auth/redis-session.mjs +1 -1
- package/dist/{authorizationDecision-DQYrkl5f.mjs → authorizationDecision-BixzgirP.mjs} +4 -4
- package/dist/{boundedMap-BULzfXYU.mjs → boundedMap-DQfXgxMo.mjs} +1 -1
- package/dist/{buildHandler-CRQ8EcX5.mjs → buildHandler-mEUmO2_u.mjs} +4 -4
- package/dist/cache/index.d.mts +9 -9
- package/dist/cache/index.mjs +4 -4
- package/dist/{caching-Cc2M1DwO.mjs → caching-TQfW2QX7.mjs} +2 -2
- package/dist/{claimed-B10RTfkM.mjs → claimed-CnEEOHuL.mjs} +1 -1
- package/dist/cleanup/index.d.mts +14 -14
- package/dist/cleanup/index.mjs +4 -4
- package/dist/cli/commands/describe.d.mts +5 -5
- package/dist/cli/commands/describe.mjs +3 -3
- package/dist/cli/commands/docs.d.mts +2 -3
- package/dist/cli/commands/docs.mjs +3 -3
- package/dist/cli/commands/doctor.d.mts +2 -3
- package/dist/cli/commands/doctor.mjs +1 -1
- package/dist/cli/commands/generate.mjs +2 -3
- package/dist/cli/commands/init.mjs +2 -3
- package/dist/cli/commands/introspect.d.mts +2 -3
- package/dist/cli/commands/introspect.mjs +2 -2
- package/dist/cli/index.mjs +3 -3
- package/dist/{constants-Cu7Mx7_U.mjs → constants-B90SnSQn.mjs} +1 -1
- package/dist/context/index.d.mts +9 -9
- package/dist/context/index.mjs +5 -5
- package/dist/core/index.d.mts +3 -3
- package/dist/core/index.mjs +8 -8
- package/dist/{core-Cb0LjccA.mjs → core-DV9PSXtr.mjs} +13 -4
- package/dist/{createActionRouter-xjqonMRO.mjs → createActionRouter-BgPCYU2U.mjs} +18 -8
- package/dist/{createAggregationRouter-zRYWw_5D.mjs → createAggregationRouter-lNCkDwKe.mjs} +7 -7
- package/dist/{createApp-D-953ZAq.mjs → createApp-BSBPntOQ.mjs} +34 -32
- package/dist/{createMcpServer-C9cxS8zt.d.mts → createMcpServer-DSztofa9.d.mts} +1 -1
- package/dist/{defineAggregation-Bm8RjMbq.mjs → defineAggregation-CwD8_XNd.mjs} +1 -1
- package/dist/{defineResource-DIC7JZGU.mjs → defineResource-CRkhRRSj.mjs} +7 -7
- package/dist/discovery/index.d.mts +6 -7
- package/dist/discovery/index.mjs +1 -1
- package/dist/docs/index.d.mts +3 -3
- package/dist/docs/index.mjs +3 -3
- package/dist/{elevation-DG8SrLN-.mjs → elevation-BAfsnnO0.mjs} +5 -5
- package/dist/encryption/index.d.mts +5 -5
- package/dist/encryption/index.mjs +3 -3
- package/dist/{errorHandler-BnfDviL1.mjs → errorHandler-DbHGwrQM.mjs} +3 -3
- package/dist/{errors-CtrywMHP.mjs → errors-C9G4A8cN.mjs} +1 -1
- package/dist/{eventPlugin-Q6BhzHzs.mjs → eventPlugin-Dghr7iL5.mjs} +8 -8
- package/dist/{eventTypes-Cdhm6ZlV.mjs → eventTypes-DDy7BMAn.mjs} +2 -2
- package/dist/events/index.d.mts +14 -14
- package/dist/events/index.mjs +7 -7
- package/dist/events/transports/redis-stream-entry.mjs +4 -4
- package/dist/events/transports/redis.d.mts +4 -5
- package/dist/events/transports/redis.mjs +2 -2
- package/dist/factory/index.d.mts +16 -16
- package/dist/factory/index.mjs +6 -6
- package/dist/{fastify-augmentation-DhUJ-mvo.d.mts → fastify-augmentation-DRlCIWE9.d.mts} +2 -2
- package/dist/{fields-ToPYpMqS.mjs → fields-Da--1DNS.mjs} +1 -1
- package/dist/{filter-merge-IpGywvym.mjs → filter-merge-BYKBa9b2.mjs} +1 -1
- package/dist/{generate-DRTkLlIl.mjs → generate-Cm5Ct81v.mjs} +2 -2
- package/dist/{headers-BbkIF6vA.mjs → headers-B6DRXXzT.mjs} +2 -2
- package/dist/{health-D-Ft6JM6.mjs → health-hRGgxnOC.mjs} +1 -1
- package/dist/{health-DqbsG-_w.mjs → health-pLbfckGB.mjs} +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +2 -3
- package/dist/idempotency/index.d.mts +8 -6
- package/dist/idempotency/index.mjs +108 -46
- package/dist/idempotency/redis.d.mts +1 -1
- package/dist/idempotency/redis.mjs +30 -2
- package/dist/{index-CRoPtISf.d.mts → index-Beg3aNnK.d.mts} +3 -31
- package/dist/{index-JdbZAIsm.d.mts → index-CUJvoyw3.d.mts} +1 -1
- package/dist/{index-mqaqZNpe.d.mts → index-WH7xgvxS.d.mts} +52 -1
- package/dist/{index-C8zVGYsk.d.mts → index-uhkUA5-U.d.mts} +4 -4
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +11 -11
- package/dist/{init-B_oUYDXI.mjs → init-lpaUB-Ph.mjs} +1 -1
- package/dist/integrations/event-gateway.d.mts +3 -4
- 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 +3 -3
- package/dist/integrations/mcp/index.d.mts +36 -36
- package/dist/integrations/mcp/index.mjs +2 -2
- package/dist/integrations/mcp/testing.d.mts +8 -9
- package/dist/integrations/mcp/testing.mjs +2 -2
- package/dist/integrations/streamline.d.mts +12 -13
- package/dist/integrations/streamline.mjs +18 -4
- package/dist/integrations/webhooks.d.mts +23 -23
- package/dist/integrations/webhooks.mjs +3 -3
- package/dist/integrations/websocket-pushref-redis.d.mts +4 -5
- package/dist/integrations/websocket-pushref-redis.mjs +1 -1
- package/dist/integrations/websocket-redis.d.mts +4 -5
- package/dist/integrations/websocket-redis.mjs +1 -1
- package/dist/integrations/websocket.mjs +2 -2
- package/dist/{interface-C0395yUN.d.mts → interface-JJzwH4Ro.d.mts} +22 -2
- package/dist/{jsonBody-B4YVGcql.mjs → jsonBody-CzKHE-Fg.mjs} +2 -2
- package/dist/{keys-B2KtgMLJ.mjs → keys-BoZKnBel.mjs} +1 -1
- package/dist/{loadResources-Dn4lalw2.mjs → loadResources-BEKG6bP9.mjs} +3 -3
- package/dist/{loadResourcesFromEntry-3sLYbuse.mjs → loadResourcesFromEntry-BEPA0ptL.mjs} +2 -2
- package/dist/logger/index.d.mts +9 -10
- package/dist/logger/index.mjs +2 -3
- package/dist/{logger-DXjfIqjV.mjs → logger-vxu0DXf_.mjs} +1 -1
- package/dist/{mcpPlugin-C08HalN5.mjs → mcpPlugin-DP_UB0LK.mjs} +42 -29
- package/dist/{memory-9Cp7611C.mjs → memory-DJN6kyC8.mjs} +3 -3
- package/dist/{metrics-CWI11eRu.mjs → metrics-wfr7XFE7.mjs} +3 -3
- package/dist/middleware/index.d.mts +5 -5
- package/dist/middleware/index.mjs +3 -3
- package/dist/migrations/index.d.mts +13 -13
- package/dist/migrations/index.mjs +2 -2
- package/dist/{module-BSvOQC7E.mjs → module-BtdcGn_E.mjs} +1 -1
- package/dist/mongodb-memory-server-Cn57YIsc.mjs +35539 -0
- package/dist/mongoose-DzFjTtBN.mjs +67451 -0
- package/dist/{multiTenant-cY0FkDiA.d.mts → multiTenant-CAtYlW6H.d.mts} +1 -1
- package/dist/{multipartBody-CXM2a-Dy.mjs → multipartBody-NHGOuUnG.mjs} +1 -1
- package/dist/node-C0HB_V6E.mjs +41236 -0
- package/dist/{openapi-DT_G4VhY.mjs → openapi-BCOaGAgE.mjs} +6 -6
- package/dist/outbox-admin/index.d.mts +2 -2
- package/dist/outbox-admin/index.mjs +5 -5
- package/dist/{outbox-module-Bjgzl6tg.mjs → outbox-module-BVDiMwXb.mjs} +9 -9
- package/dist/permissions/index.mjs +7 -7
- package/dist/{permissions-Cm0uYHvd.mjs → permissions-IdHJ0_5V.mjs} +9 -9
- package/dist/{pipe-BqeGT6UO.mjs → pipe-BPJPifhi.mjs} +2 -2
- package/dist/pipeline/index.d.mts +7 -7
- package/dist/pipeline/index.mjs +2 -2
- package/dist/{plan-FVR6LP59.mjs → plan-CEedaMlr.mjs} +1 -1
- package/dist/{plugin-BccET1tL.mjs → plugin-BDBOS3-c.mjs} +39 -27
- package/dist/plugins/index.d.mts +8 -8
- package/dist/plugins/index.mjs +17 -17
- package/dist/plugins/response-cache.d.mts +5 -6
- package/dist/plugins/response-cache.mjs +4 -4
- package/dist/plugins/tracing-entry.mjs +2 -2
- package/dist/{pluralize-CVIOcgMF.mjs → pluralize-B4FcZEyI.mjs} +1 -1
- package/dist/presets/filesUpload.d.mts +7 -7
- package/dist/presets/filesUpload.mjs +5 -5
- package/dist/presets/index.d.mts +14 -14
- package/dist/presets/index.mjs +2 -2
- package/dist/presets/multiTenant.d.mts +1 -1
- package/dist/presets/multiTenant.mjs +5 -5
- package/dist/presets/search.d.mts +8 -9
- package/dist/presets/search.mjs +2 -2
- package/dist/{presets-Cpvj6fGO.mjs → presets-BPjNc-Np.mjs} +4 -4
- package/dist/{projection-Ce4aQhQk.mjs → projection-BXUOYosj.mjs} +2 -2
- package/dist/{queryCachePlugin-CFWNH8aT.mjs → queryCachePlugin-s4pBvjFF.mjs} +6 -6
- package/dist/{rateLimitKey-C4O-kPm0.mjs → rateLimitKey-C4mkCwQ-.mjs} +1 -1
- package/dist/{realtime-DmPE9S54.mjs → realtime-MPj6eIoV.mjs} +11 -11
- package/dist/{redis-vLvtcGy_.d.mts → redis-BDgv9Glw.d.mts} +5 -1
- package/dist/registry/index.d.mts +9 -9
- package/dist/registry/index.mjs +3 -3
- package/dist/{registry-Bcz9G1bh.mjs → registry-DIdh6mWE.mjs} +5 -4
- package/dist/{renewingLease-qODa7KJQ.mjs → renewingLease-boGRXWCr.mjs} +1 -1
- package/dist/{replyHelpers-CG_VtVgS.mjs → replyHelpers-BW_p67QD.mjs} +2 -2
- package/dist/{requestContext-Dsu9P1bV.mjs → requestContext-B8JKbeb7.mjs} +1 -1
- package/dist/{requirement-KDdoRcOP.mjs → requirement-tXpcD56f.mjs} +1 -1
- package/dist/{resourceRateLimit-dSjVr1pk.mjs → resourceRateLimit-DWob9nQ8.mjs} +2 -2
- package/dist/rolldown-runtime-AD16t29l.mjs +45 -0
- package/dist/{routeValidator-D36SW8qt.mjs → routeValidator-CnmenC4Y.mjs} +1 -1
- package/dist/{runtimeCapabilities-0tccjRlj.mjs → runtimeCapabilities-C7gAbIxC.mjs} +1 -1
- package/dist/{schedules-C-OpmHBq.mjs → schedules-Dr9gNFzx.mjs} +5 -5
- package/dist/{schemaConverter-BORek3O-.mjs → schemaConverter-rzBovk00.mjs} +2 -2
- package/dist/{schemaIR-C7Vbp71I.mjs → schemaIR-GrOK1JO4.mjs} +2 -2
- package/dist/schemas/index.d.mts +10 -10
- package/dist/schemas/index.mjs +1 -1
- package/dist/scim/index.d.mts +13 -13
- package/dist/scim/index.mjs +2 -2
- package/dist/scope/index.d.mts +3 -3
- package/dist/scope/index.mjs +5 -5
- package/dist/{scope-DQthe88b.mjs → scope-DpOpxyHT.mjs} +4 -4
- package/dist/{shutdown-MqA81z_P.mjs → shutdown-BW8qwgpx.mjs} +1 -1
- package/dist/{simpleEqualityMatcher-auW8QjXN.mjs → simpleEqualityMatcher-WdZw6GOt.mjs} +1 -1
- package/dist/sse-D8AgoUN3.mjs +212 -0
- package/dist/{sseStream-B5_Afiqn.mjs → sseStream-B7rPhIQw.mjs} +2 -2
- package/dist/{store-helpers-BOzk-CuX.mjs → store-helpers-Bxk7TDgG.mjs} +1 -1
- package/dist/{streaming-DjTQhZrN.mjs → streaming-BLg1buwL.mjs} +1 -1
- package/dist/{subscriberIdentity-CW39uA8G.mjs → subscriberIdentity-Cxp19Ked.mjs} +1 -1
- package/dist/{tenancy--ed9eH_z.mjs → tenancy-D7jo78AP.mjs} +2 -2
- package/dist/{tenantPreparation-BKon6Yox.mjs → tenantPreparation-DqJnokDW.mjs} +4 -4
- package/dist/testing/cleanupStoreContract.d.mts +4 -5
- package/dist/testing/cleanupStoreContract.mjs +1 -1
- package/dist/testing/index.d.mts +35 -35
- package/dist/testing/index.mjs +16 -15
- package/dist/testing/outboxStoreContract.d.mts +4 -5
- package/dist/testing/outboxStoreContract.mjs +2 -2
- package/dist/testing/requiredPorts.d.mts +4 -5
- package/dist/testing/requiredPorts.mjs +2 -2
- package/dist/testing/storageContract.d.mts +4 -5
- package/dist/testing/storageContract.mjs +1 -1
- package/dist/{timing-qczZ0YC-.mjs → timing-Y6_ZpoYG.mjs} +1 -1
- package/dist/{transactionContext-DjFkrNG6.mjs → transactionContext-BWp0MBGL.mjs} +1 -1
- package/dist/{typeGuards-CySF12G-.mjs → typeGuards-CtZJypJO.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-Bk9NOgOC.mjs → types-4JKkSvds.mjs} +4 -4
- package/dist/{types-B4Aq4Sdj.d.mts → types-D3Ixsh00.d.mts} +1 -1
- package/dist/usage/index.d.mts +4 -4
- package/dist/usage/index.mjs +4 -4
- package/dist/{userHelpers-aklawRaK.mjs → userHelpers-Nc5ePCsf.mjs} +1 -1
- package/dist/utils/index.d.mts +47 -47
- package/dist/utils/index.mjs +12 -12
- package/dist/{utils-ec1oTo1n.mjs → utils-QWSIKqAk.mjs} +4 -4
- package/dist/{validate-9yzHC1e2.mjs → validate-CT4umNhp.mjs} +3 -3
- package/dist/{versioning-Bsb51gGT.d.mts → versioning-Bqm_57Qt.d.mts} +23 -1
- package/dist/{versioning-fhhWHV74.mjs → versioning-JIqxO64K.mjs} +3 -3
- package/dist/{workScope-zpPyge4t.mjs → workScope-BDjGXwU9.mjs} +2 -2
- package/package.json +47 -52
- package/dist/rolldown-runtime-D1w9Y1VJ.mjs +0 -15
- package/dist/sse-CYzQBVFe.mjs +0 -89
|
@@ -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.45.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as getUserRoles } from "./userHelpers-Nc5ePCsf.mjs";
|
|
3
|
+
import { n as convertRouteSchema } from "./schemaConverter-rzBovk00.mjs";
|
|
4
|
+
import { t as resolveActionPermission } from "./actionPermissions-TAc_6LCw.mjs";
|
|
5
|
+
import { t as pluralize } from "./pluralize-B4FcZEyI.mjs";
|
|
6
|
+
import { t as buildActionBodySchema } from "./createActionRouter-BgPCYU2U.mjs";
|
|
7
7
|
import fp from "fastify-plugin";
|
|
8
8
|
//#region src/docs/openapi/canonical-schemas.ts
|
|
9
9
|
/**
|
|
@@ -80,6 +80,6 @@ interface OutboxAdminModuleDeps {
|
|
|
80
80
|
*/
|
|
81
81
|
relayLagUnhealthyMs?: number;
|
|
82
82
|
}
|
|
83
|
-
declare function createOutboxAdminModule(deps: OutboxAdminModuleDeps): ArcModule<void>;
|
|
83
|
+
export declare function createOutboxAdminModule(deps: OutboxAdminModuleDeps): ArcModule<void>;
|
|
84
84
|
//#endregion
|
|
85
|
-
export {
|
|
85
|
+
export type { OutboxAdminModuleDeps, OutboxAdminPermissions, OutboxAdminStore };
|
|
@@ -1,8 +1,8 @@
|
|
|
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-
|
|
5
|
-
import { r as readOutboxHealth } from "../health-
|
|
1
|
+
/*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
|
|
2
|
+
import { i as NotFoundError, u as ValidationError } from "../errors-C9G4A8cN.mjs";
|
|
3
|
+
import { t as defineResource } from "../defineResource-CRkhRRSj.mjs";
|
|
4
|
+
import { n as getModuleExports, t as defineModule } from "../module-BtdcGn_E.mjs";
|
|
5
|
+
import { r as readOutboxHealth } from "../health-hRGgxnOC.mjs";
|
|
6
6
|
//#region src/outbox-admin/module.ts
|
|
7
7
|
/**
|
|
8
8
|
* Strip the domain payload and the stack unless explicitly opted in.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as transactionContext } from "./transactionContext-
|
|
3
|
-
import { n as requestContext } from "./requestContext-
|
|
4
|
-
import { n as evictToSize, r as touch } from "./boundedMap-
|
|
5
|
-
import { i as resolveEventTransport } from "./EventTransport-
|
|
6
|
-
import { t as emitObserved } from "./eventPlugin-
|
|
7
|
-
import { n as canReportHealth, r as readOutboxHealth } from "./health-
|
|
8
|
-
import { n as createSafeGetOne, t as createIsDuplicateKeyError } from "./store-helpers-
|
|
9
|
-
import { t as claimedAttempts } from "./claimed-
|
|
1
|
+
/*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as transactionContext } from "./transactionContext-BWp0MBGL.mjs";
|
|
3
|
+
import { n as requestContext } from "./requestContext-B8JKbeb7.mjs";
|
|
4
|
+
import { n as evictToSize, r as touch } from "./boundedMap-DQfXgxMo.mjs";
|
|
5
|
+
import { i as resolveEventTransport } from "./EventTransport-Ci6hGO1Y.mjs";
|
|
6
|
+
import { t as emitObserved } from "./eventPlugin-Dghr7iL5.mjs";
|
|
7
|
+
import { n as canReportHealth, r as readOutboxHealth } from "./health-hRGgxnOC.mjs";
|
|
8
|
+
import { n as createSafeGetOne, t as createIsDuplicateKeyError } from "./store-helpers-Bxk7TDgG.mjs";
|
|
9
|
+
import { t as claimedAttempts } from "./claimed-CnEEOHuL.mjs";
|
|
10
10
|
import { and, anyOf, eq, lte, ne, or } from "@classytic/repo-core/filter";
|
|
11
11
|
import { randomBytes } from "node:crypto";
|
|
12
12
|
import { InvalidOutboxEventError, OutboxConflictError, OutboxOwnershipError, outboxPayloadFingerprint } from "@classytic/primitives/outbox";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as conjoinPolicyFilters } from "../filter-merge-
|
|
3
|
-
import { n as getUserRoles, r as normalizeRoles } from "../userHelpers-
|
|
4
|
-
import { a as resolveEffectiveRoles, i as fields, n as applyFieldWritePermissions, t as applyFieldReadPermissions } from "../fields-
|
|
5
|
-
import { i as normalizeToDecision, r as evaluatePermissionDecision, t as applyAuthorizationDecision } from "../authorizationDecision-
|
|
6
|
-
import { i as resolveResourceRateLimiter, t as createMemoryResourceRateLimiter } from "../resourceRateLimit-
|
|
7
|
-
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.45.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as conjoinPolicyFilters } from "../filter-merge-BYKBa9b2.mjs";
|
|
3
|
+
import { n as getUserRoles, r as normalizeRoles } from "../userHelpers-Nc5ePCsf.mjs";
|
|
4
|
+
import { a as resolveEffectiveRoles, i as fields, n as applyFieldWritePermissions, t as applyFieldReadPermissions } from "../fields-Da--1DNS.mjs";
|
|
5
|
+
import { i as normalizeToDecision, r as evaluatePermissionDecision, t as applyAuthorizationDecision } from "../authorizationDecision-BixzgirP.mjs";
|
|
6
|
+
import { i as resolveResourceRateLimiter, t as createMemoryResourceRateLimiter } from "../resourceRateLimit-DWob9nQ8.mjs";
|
|
7
|
+
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-IdHJ0_5V.mjs";
|
|
8
8
|
export { GRANT_MODES, adminOnly, allOf, allow, allowPublic, anyOf, applyAuthorizationDecision, applyFieldReadPermissions, applyFieldWritePermissions, authenticated, buildPermissionMatrix, collectPublicSurface, conjoinPolicyFilters, createDynamicPermissionMatrix, createMemoryResourceRateLimiter, 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, resolveResourceRateLimiter, roles, scopeOf, when };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import {
|
|
3
|
-
import { t as arcLog } from "./logger-
|
|
4
|
-
import { t as conjoinPolicyFilters } from "./filter-merge-
|
|
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 { i as normalizeToDecision } from "./authorizationDecision-
|
|
8
|
-
import { n as declareRuntimeCapability } from "./runtimeCapabilities-
|
|
9
|
-
import { t as MemoryCacheStore } from "./memory-
|
|
1
|
+
/*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
|
|
2
|
+
import { r as __exportAll } from "./rolldown-runtime-AD16t29l.mjs";
|
|
3
|
+
import { t as arcLog } from "./logger-vxu0DXf_.mjs";
|
|
4
|
+
import { t as conjoinPolicyFilters } from "./filter-merge-BYKBa9b2.mjs";
|
|
5
|
+
import { n as getUserRoles } from "./userHelpers-Nc5ePCsf.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-4JKkSvds.mjs";
|
|
7
|
+
import { i as normalizeToDecision } from "./authorizationDecision-BixzgirP.mjs";
|
|
8
|
+
import { n as declareRuntimeCapability } from "./runtimeCapabilities-C7gAbIxC.mjs";
|
|
9
|
+
import { t as MemoryCacheStore } from "./memory-DJN6kyC8.mjs";
|
|
10
10
|
import { randomUUID } from "node:crypto";
|
|
11
11
|
//#region src/permissions/context.ts
|
|
12
12
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { r as ForbiddenError } from "./errors-
|
|
1
|
+
/*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
|
|
2
|
+
import { r as ForbiddenError } from "./errors-C9G4A8cN.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 {
|
|
2
|
+
import { Vn as IControllerResponse, _t as PipelineConfig, bt as Transform, gt as OperationFilter, ht as NextFunction, mt as Interceptor, pt as Guard, vt as PipelineContext, yt as PipelineStep } from "../index-WH7xgvxS.mjs";
|
|
3
3
|
//#region src/pipeline/guard.d.ts
|
|
4
4
|
interface GuardOptions {
|
|
5
5
|
operations?: OperationFilter;
|
|
@@ -11,7 +11,7 @@ interface GuardOptions {
|
|
|
11
11
|
* @param name - Guard name (for debugging/introspection)
|
|
12
12
|
* @param handlerOrOptions - Handler function or options object
|
|
13
13
|
*/
|
|
14
|
-
declare function guard(name: string, handlerOrOptions: ((ctx: PipelineContext) => boolean | Promise<boolean>) | GuardOptions): Guard;
|
|
14
|
+
export declare function guard(name: string, handlerOrOptions: ((ctx: PipelineContext) => boolean | Promise<boolean>) | GuardOptions): Guard;
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/pipeline/intercept.d.ts
|
|
17
17
|
interface InterceptOptions {
|
|
@@ -24,14 +24,14 @@ interface InterceptOptions {
|
|
|
24
24
|
* @param name - Interceptor name (for debugging/introspection)
|
|
25
25
|
* @param handlerOrOptions - Handler function or options object
|
|
26
26
|
*/
|
|
27
|
-
declare function intercept(name: string, handlerOrOptions: ((ctx: PipelineContext, next: NextFunction) => Promise<IControllerResponse<unknown>>) | InterceptOptions): Interceptor;
|
|
27
|
+
export declare function intercept(name: string, handlerOrOptions: ((ctx: PipelineContext, next: NextFunction) => Promise<IControllerResponse<unknown>>) | InterceptOptions): Interceptor;
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region src/pipeline/pipe.d.ts
|
|
30
30
|
/**
|
|
31
31
|
* Compose pipeline steps into an ordered array.
|
|
32
32
|
* Accepts guards, transforms, and interceptors in any order.
|
|
33
33
|
*/
|
|
34
|
-
declare function pipe(...steps: PipelineStep[]): PipelineStep[];
|
|
34
|
+
export declare function pipe(...steps: PipelineStep[]): PipelineStep[];
|
|
35
35
|
/**
|
|
36
36
|
* Execute a pipeline against a request context.
|
|
37
37
|
*
|
|
@@ -44,7 +44,7 @@ declare function pipe(...steps: PipelineStep[]): PipelineStep[];
|
|
|
44
44
|
* @param operation - The CRUD operation name
|
|
45
45
|
* @returns The controller response (possibly modified by interceptors)
|
|
46
46
|
*/
|
|
47
|
-
declare function executePipeline(steps: PipelineStep[], ctx: PipelineContext, handler: (ctx: PipelineContext) => Promise<IControllerResponse<unknown>>, operation: string): Promise<IControllerResponse<unknown>>;
|
|
47
|
+
export declare function executePipeline(steps: PipelineStep[], ctx: PipelineContext, handler: (ctx: PipelineContext) => Promise<IControllerResponse<unknown>>, operation: string): Promise<IControllerResponse<unknown>>;
|
|
48
48
|
//#endregion
|
|
49
49
|
//#region src/pipeline/transform.d.ts
|
|
50
50
|
interface TransformOptions {
|
|
@@ -57,6 +57,6 @@ interface TransformOptions {
|
|
|
57
57
|
* @param name - Transform name (for debugging/introspection)
|
|
58
58
|
* @param handlerOrOptions - Handler function or options object
|
|
59
59
|
*/
|
|
60
|
-
declare function transform(name: string, handlerOrOptions: ((ctx: PipelineContext) => PipelineContext | undefined | Promise<PipelineContext | undefined>) | TransformOptions): Transform;
|
|
60
|
+
export declare function transform(name: string, handlerOrOptions: ((ctx: PipelineContext) => PipelineContext | undefined | Promise<PipelineContext | undefined>) | TransformOptions): Transform;
|
|
61
61
|
//#endregion
|
|
62
|
-
export {
|
|
62
|
+
export type { Guard, GuardOptions, InterceptOptions, Interceptor, NextFunction, OperationFilter, PipelineConfig, PipelineContext, PipelineStep, Transform, TransformOptions };
|
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.45.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as pipe, t as executePipeline } from "../pipe-BPJPifhi.mjs";
|
|
3
3
|
//#region src/pipeline/guard.ts
|
|
4
4
|
/**
|
|
5
5
|
* Create a named guard.
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { g as SYSTEM_FIELDS, o as DEFAULT_TENANT_FIELD, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS } from "./constants-
|
|
3
|
-
import { t as arcLog } from "./logger-
|
|
4
|
-
import { t as conjoinPolicyFilters } from "./filter-merge-
|
|
5
|
-
import { d as createDomainError, f as createError, i as NotFoundError, p as isArcError, r as ForbiddenError, u as ValidationError } from "./errors-
|
|
6
|
-
import { t as simpleEqualityMatcher } from "./simpleEqualityMatcher-
|
|
7
|
-
import { n as requireSingleHeaderValue } from "./headers-
|
|
8
|
-
import { n as getUserRoles, t as getUserId } from "./userHelpers-
|
|
9
|
-
import { b as isElevated, c as getOrgId, n as PUBLIC_SCOPE, x as isMember } from "./types-
|
|
10
|
-
import { r as resolveTenancy } from "./tenancy
|
|
11
|
-
import { t as buildQueryKey } from "./keys-
|
|
12
|
-
import { t as transactionContext } from "./transactionContext-
|
|
13
|
-
import { a as resolveEffectiveRoles, n as applyFieldWritePermissions } from "./fields-
|
|
14
|
-
import { E as ArcQueryParser, v as getDefaultCrudSchemas } from "./utils-
|
|
15
|
-
import { n as convertRouteSchema, r as ensureSchemaConverter, t as convertOpenApiSchemas } from "./schemaConverter-
|
|
16
|
-
import { i as pipeUIMessageStreamToReply, r as isReadableStream } from "./streaming-
|
|
17
|
-
import { _ as buildArcDecorator, a as resolveRouterPluginMw, b as createRequestContext, c as buildPipelineHandler, d as buildCrudPermissionMw, f as buildRouteHooks, h as buildAuthMiddleware, i as buildRouteConfig, l as resolvePipelineSteps, m as routeHookOptions, n as tryRegisterRoute, o as selectPluginMw, p as resolveRoutePreHandlers, r as buildRateLimitConfig, t as resolveActionPermission, v as createCrudHandlers, y as createFastifyHandler } from "./actionPermissions-
|
|
18
|
-
import { a as withoutTenantInjection } from "./tenantPreparation-
|
|
19
|
-
import { t as hasEvents } from "./typeGuards-
|
|
20
|
-
import { n as idempotencyConfigProblem } from "./requirement-
|
|
1
|
+
/*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
|
|
2
|
+
import { g as SYSTEM_FIELDS, o as DEFAULT_TENANT_FIELD, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS } from "./constants-B90SnSQn.mjs";
|
|
3
|
+
import { t as arcLog } from "./logger-vxu0DXf_.mjs";
|
|
4
|
+
import { t as conjoinPolicyFilters } from "./filter-merge-BYKBa9b2.mjs";
|
|
5
|
+
import { d as createDomainError, f as createError, i as NotFoundError, p as isArcError, r as ForbiddenError, u as ValidationError } from "./errors-C9G4A8cN.mjs";
|
|
6
|
+
import { t as simpleEqualityMatcher } from "./simpleEqualityMatcher-WdZw6GOt.mjs";
|
|
7
|
+
import { n as requireSingleHeaderValue } from "./headers-B6DRXXzT.mjs";
|
|
8
|
+
import { n as getUserRoles, t as getUserId } from "./userHelpers-Nc5ePCsf.mjs";
|
|
9
|
+
import { b as isElevated, c as getOrgId, n as PUBLIC_SCOPE, x as isMember } from "./types-4JKkSvds.mjs";
|
|
10
|
+
import { r as resolveTenancy } from "./tenancy-D7jo78AP.mjs";
|
|
11
|
+
import { t as buildQueryKey } from "./keys-BoZKnBel.mjs";
|
|
12
|
+
import { t as transactionContext } from "./transactionContext-BWp0MBGL.mjs";
|
|
13
|
+
import { a as resolveEffectiveRoles, n as applyFieldWritePermissions } from "./fields-Da--1DNS.mjs";
|
|
14
|
+
import { E as ArcQueryParser, v as getDefaultCrudSchemas } from "./utils-QWSIKqAk.mjs";
|
|
15
|
+
import { n as convertRouteSchema, r as ensureSchemaConverter, t as convertOpenApiSchemas } from "./schemaConverter-rzBovk00.mjs";
|
|
16
|
+
import { i as pipeUIMessageStreamToReply, r as isReadableStream } from "./streaming-BLg1buwL.mjs";
|
|
17
|
+
import { _ as buildArcDecorator, a as resolveRouterPluginMw, b as createRequestContext, c as buildPipelineHandler, d as buildCrudPermissionMw, f as buildRouteHooks, h as buildAuthMiddleware, i as buildRouteConfig, l as resolvePipelineSteps, m as routeHookOptions, n as tryRegisterRoute, o as selectPluginMw, p as resolveRoutePreHandlers, r as buildRateLimitConfig, t as resolveActionPermission, v as createCrudHandlers, y as createFastifyHandler } from "./actionPermissions-TAc_6LCw.mjs";
|
|
18
|
+
import { a as withoutTenantInjection } from "./tenantPreparation-DqJnokDW.mjs";
|
|
19
|
+
import { t as hasEvents } from "./typeGuards-CtZJypJO.mjs";
|
|
20
|
+
import { n as idempotencyConfigProblem } from "./requirement-tXpcD56f.mjs";
|
|
21
21
|
import { ARC_ERROR_CODES } from "@classytic/repo-core/errors";
|
|
22
22
|
import { policyRecordToFilter } from "@classytic/repo-core/filter";
|
|
23
23
|
import { retryingTransaction } from "@classytic/repo-core/repository";
|
|
@@ -1431,12 +1431,22 @@ var BaseCrudController = class {
|
|
|
1431
1431
|
return this.repository !== void 0 && this.repository !== null;
|
|
1432
1432
|
}
|
|
1433
1433
|
async isActionTargetVisible(req, id) {
|
|
1434
|
+
return (await this.loadActionTarget(req, id)).visible;
|
|
1435
|
+
}
|
|
1436
|
+
/**
|
|
1437
|
+
* The fence's answer plus the row it read (absent when the resource has no row scope, so
|
|
1438
|
+
* nothing was read). The router hands the row to the handler as `getActionTarget(req)`.
|
|
1439
|
+
*/
|
|
1440
|
+
async loadActionTarget(req, id) {
|
|
1434
1441
|
const meta = this.meta(req);
|
|
1435
1442
|
const scoped = resolveTenancy(meta, this.tenantField).mode === "scoped";
|
|
1436
1443
|
const policy = meta?._policyFilters;
|
|
1437
|
-
if (!scoped && (!policy || Object.keys(policy).length === 0)) return true;
|
|
1444
|
+
if (!scoped && (!policy || Object.keys(policy).length === 0)) return { visible: true };
|
|
1438
1445
|
const { doc } = await this.fetchByAnyKey(id, req, this.tenantRepoOptions(req));
|
|
1439
|
-
return doc
|
|
1446
|
+
return doc === null || doc === void 0 ? { visible: false } : {
|
|
1447
|
+
visible: true,
|
|
1448
|
+
doc
|
|
1449
|
+
};
|
|
1440
1450
|
}
|
|
1441
1451
|
/** `ETag: "<version>"` for a versioned document under optimistic concurrency. */
|
|
1442
1452
|
etagHeaders(doc) {
|
|
@@ -1565,7 +1575,7 @@ var BaseCrudController = class {
|
|
|
1565
1575
|
inFlightCacheFills = /* @__PURE__ */ new Map();
|
|
1566
1576
|
cacheSingleFlight(key, fill) {
|
|
1567
1577
|
const existing = this.inFlightCacheFills.get(key);
|
|
1568
|
-
if (existing) return existing;
|
|
1578
|
+
if (existing !== void 0) return existing;
|
|
1569
1579
|
const flight = fill().finally(() => {
|
|
1570
1580
|
this.inFlightCacheFills.delete(key);
|
|
1571
1581
|
});
|
|
@@ -2992,7 +3002,9 @@ function resolveActionTargetFence(resource, actionConfig) {
|
|
|
2992
3002
|
if (typeof resource.tenantField === "string" || ctrl !== void 0 && resource.tenantField !== false) throw new Error(`[Arc] Resource '${resource.name}' is tenant-scoped (tenantField '${resource.tenantField === void 0 ? "organizationId (default)" : resource.tenantField}') and declares id-bound actions [${fenced.join(", ")}], but its controller cannot authorize an action target. Use a BaseController with a repository, declare \`tenantField: false\`, or declare \`target: { scope: 'handler', reason }\` on each action.`);
|
|
2993
3003
|
return;
|
|
2994
3004
|
}
|
|
2995
|
-
|
|
3005
|
+
const load = ctrl?.loadActionTarget;
|
|
3006
|
+
if (typeof load === "function") return (id, ctx) => load.call(ctrl, ctx, id);
|
|
3007
|
+
return async (id, ctx) => ({ visible: await check.call(ctrl, ctx, id) });
|
|
2996
3008
|
}
|
|
2997
3009
|
/**
|
|
2998
3010
|
* Build the FastifyPluginAsync that materialises a `ResourceDefinition` into
|
|
@@ -3072,12 +3084,12 @@ function buildResourcePlugin(resource) {
|
|
|
3072
3084
|
extensions: resource.extensions
|
|
3073
3085
|
});
|
|
3074
3086
|
if (resource.actions && Object.keys(resource.actions).length > 0) {
|
|
3075
|
-
const { createActionRouter } = await import("./createActionRouter-
|
|
3087
|
+
const { createActionRouter } = await import("./createActionRouter-BgPCYU2U.mjs").then((n) => n.n);
|
|
3076
3088
|
const actionConfig = normalizeActionsToRouterConfig(resource.actions, resource.actionPermissions, resource.tag, resource.permissions, resource.name, typedInstance.log);
|
|
3077
3089
|
const actionTarget = resolveActionTargetFence(resource, actionConfig);
|
|
3078
3090
|
createActionRouter(typedInstance, {
|
|
3079
3091
|
...actionConfig,
|
|
3080
|
-
...actionTarget ? {
|
|
3092
|
+
...actionTarget ? { loadTarget: (id, req) => actionTarget(id, createRequestContext(req)) } : {},
|
|
3081
3093
|
auditActions: Boolean(resource.audit),
|
|
3082
3094
|
resourceName: resource.name,
|
|
3083
3095
|
fields: resource.fields,
|
|
@@ -3092,7 +3104,7 @@ function buildResourcePlugin(resource) {
|
|
|
3092
3104
|
});
|
|
3093
3105
|
}
|
|
3094
3106
|
if (resource.aggregations && Object.keys(resource.aggregations).length > 0) {
|
|
3095
|
-
const [{ createAggregationRouter }, { adapterSupportsAggregate, ArcAggregationConfigError }] = await Promise.all([import("./createAggregationRouter-
|
|
3107
|
+
const [{ createAggregationRouter }, { adapterSupportsAggregate, ArcAggregationConfigError }] = await Promise.all([import("./createAggregationRouter-lNCkDwKe.mjs"), import("./validate-CT4umNhp.mjs").then((n) => n.r)]);
|
|
3096
3108
|
const repoForAgg = resource.controller?.repository ?? resource.repository;
|
|
3097
3109
|
if (!adapterSupportsAggregate(repoForAgg)) {
|
|
3098
3110
|
const undispatchable = Object.entries(resource.aggregations).filter(([, cfg]) => !cfg.materialized).map(([name]) => name);
|
package/dist/plugins/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
import { t as AnyRecord } from "../base-CZyixEQR.mjs";
|
|
3
|
-
import { Et as RouteDefinition, J as MiddlewareConfig, U as PresetHook, X as RouteSchemaOptions } from "../index-
|
|
3
|
+
import { Et as RouteDefinition, J as MiddlewareConfig, U as PresetHook, X as RouteSchemaOptions } from "../index-WH7xgvxS.mjs";
|
|
4
4
|
import { i as errorHandlerPlugin, n as ErrorMapper, r as defaultIsDuplicateKeyError, t as ErrorHandlerOptions } from "../errorHandler--4rSMMvq.mjs";
|
|
5
5
|
import { C as _default$8, E as _default$3, S as SchedulesPluginOptions, T as HealthOptions, b as ScheduleDefinition, w as HealthCheck, x as ScheduleStats } from "../types-BJ-2XqVF.mjs";
|
|
6
|
-
import { i as _default, n as ArcCorePluginOptions, r as PluginMeta, t as ArcCore } from "../fastify-augmentation-
|
|
7
|
-
import { _ as
|
|
6
|
+
import { i as _default, n as ArcCorePluginOptions, r as PluginMeta, t as ArcCore } from "../fastify-augmentation-DRlCIWE9.mjs";
|
|
7
|
+
import { _ as ShutdownState, a as MetricsOptions, c as RealtimeOptions, d as SSEStats, f as _default$9, g as GracefulShutdownOptions, h as _default$1, i as MetricsCollector, l as _default$6, m as CachingRule, n as _default$10, o as _default$4, p as CachingOptions, r as MetricEntry, s as ChangeOperation, t as VersioningOptions, u as SSEOptions, v as _default$2 } from "../versioning-Bqm_57Qt.mjs";
|
|
8
8
|
import { t as TracingOptions } from "../tracing-Dro5eH6j.mjs";
|
|
9
9
|
import { PaginatedResult } from "@classytic/repo-core/pagination";
|
|
10
10
|
import { FastifyInstance, FastifyPluginAsync } from "fastify";
|
|
@@ -57,7 +57,7 @@ interface ArcPlugin<TRootOpts extends object = AnyRecord, TResourceOpts extends
|
|
|
57
57
|
* @param definition - Plugin setup functions
|
|
58
58
|
* @returns ArcPlugin with forRoot() and forResource() methods
|
|
59
59
|
*/
|
|
60
|
-
declare function createPlugin<TRootOpts extends object = AnyRecord, TResourceOpts extends object = AnyRecord>(name: string, definition: CreatePluginDefinition<TRootOpts, TResourceOpts>): ArcPlugin<TRootOpts, TResourceOpts>;
|
|
60
|
+
export declare function createPlugin<TRootOpts extends object = AnyRecord, TResourceOpts extends object = AnyRecord>(name: string, definition: CreatePluginDefinition<TRootOpts, TResourceOpts>): ArcPlugin<TRootOpts, TResourceOpts>;
|
|
61
61
|
//#endregion
|
|
62
62
|
//#region src/plugins/pressure.d.ts
|
|
63
63
|
/**
|
|
@@ -176,7 +176,7 @@ declare module "fastify" {
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
declare function replyHelpersPluginFn(fastify: FastifyInstance): Promise<void>;
|
|
179
|
-
declare const replyHelpersPlugin: typeof replyHelpersPluginFn;
|
|
179
|
+
export declare const replyHelpersPlugin: typeof replyHelpersPluginFn;
|
|
180
180
|
//#endregion
|
|
181
181
|
//#region src/plugins/requestId.d.ts
|
|
182
182
|
interface RequestIdOptions {
|
|
@@ -214,16 +214,16 @@ declare module "fastify" {
|
|
|
214
214
|
* (repeated headers) are rejected outright — a client sending multiple
|
|
215
215
|
* request-id headers is not tracing in good faith.
|
|
216
216
|
*/
|
|
217
|
-
declare function sanitizeRequestId(value: unknown): string | undefined;
|
|
217
|
+
export declare function sanitizeRequestId(value: unknown): string | undefined;
|
|
218
218
|
/**
|
|
219
219
|
* Build a Fastify `genReqId` function: adopt a sanitized incoming request-id
|
|
220
220
|
* header, or generate one. Wire this into the `Fastify()` constructor so
|
|
221
221
|
* `request.id`, `request.log`'s `reqId` binding, and the echoed response
|
|
222
222
|
* header all agree — `createApp` does this automatically.
|
|
223
223
|
*/
|
|
224
|
-
declare function createRequestIdGenerator(opts?: Pick<RequestIdOptions, "header" | "generator">): (req: {
|
|
224
|
+
export declare function createRequestIdGenerator(opts?: Pick<RequestIdOptions, "header" | "generator">): (req: {
|
|
225
225
|
headers: Record<string, string | string[] | undefined>;
|
|
226
226
|
}) => string;
|
|
227
227
|
declare const _default$7: FastifyPluginAsync<RequestIdOptions>;
|
|
228
228
|
//#endregion
|
|
229
|
-
export { type ArcCore, type ArcCorePluginOptions, type ArcPlugin, type CachingOptions, type CachingRule, type ChangeOperation, type CreatePluginDefinition, type ErrorHandlerOptions, type ErrorMapper, type GracefulShutdownOptions, type HealthCheck, type HealthOptions, type MetricEntry, type MetricsCollector, type MetricsOptions, type PluginMeta, type PluginResourceResult, type PressureApi, type PressureOptions, type PressureSignal, type PressureSnapshot, type PressureState, type PressureThresholds, type RealtimeOptions, type RequestIdOptions, type SSEOptions, type ScheduleDefinition, type ScheduleStats, type SchedulesPluginOptions, type ShutdownState, type TracingOptions, type VersioningOptions, _default as arcCorePlugin, _default$1 as cachingPlugin,
|
|
229
|
+
export { type ArcCore, type ArcCorePluginOptions, type ArcPlugin, type CachingOptions, type CachingRule, type ChangeOperation, type CreatePluginDefinition, type ErrorHandlerOptions, type ErrorMapper, type GracefulShutdownOptions, type HealthCheck, type HealthOptions, type MetricEntry, type MetricsCollector, type MetricsOptions, type PluginMeta, type PluginResourceResult, type PressureApi, type PressureOptions, type PressureSignal, type PressureSnapshot, type PressureState, type PressureThresholds, type RealtimeOptions, type RequestIdOptions, type SSEOptions, type SSEStats, type ScheduleDefinition, type ScheduleStats, type SchedulesPluginOptions, type ShutdownState, type TracingOptions, type VersioningOptions, _default as arcCorePlugin, _default$1 as cachingPlugin, defaultIsDuplicateKeyError, errorHandlerPlugin, _default$2 as gracefulShutdownPlugin, _default$3 as healthPlugin, _default$4 as metricsPlugin, _default$5 as pressurePlugin, _default$6 as realtimePlugin, _default$7 as requestIdPlugin, _default$8 as schedulesPlugin, _default$9 as ssePlugin, _default$10 as versioningPlugin };
|
package/dist/plugins/index.mjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { m as MUTATION_OPERATIONS } from "../constants-
|
|
3
|
-
import { t as arcLog } from "../logger-
|
|
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 { c as createRequestIdGenerator, l as requestId_default, n as health_default, u as sanitizeRequestId } from "../health-
|
|
10
|
-
import { t as caching_default } from "../caching-
|
|
11
|
-
import { n as errorHandlerPlugin, t as defaultIsDuplicateKeyError } from "../errorHandler-
|
|
12
|
-
import { t as metrics_default } from "../metrics-
|
|
13
|
-
import { t as realtime_default } from "../realtime-
|
|
14
|
-
import { t as replyHelpersPlugin } from "../replyHelpers-
|
|
15
|
-
import { t as schedules_default } from "../schedules-
|
|
16
|
-
import { t as sse_default } from "../sse-
|
|
17
|
-
import { t as versioning_default } from "../versioning-
|
|
1
|
+
/*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
|
|
2
|
+
import { m as MUTATION_OPERATIONS } from "../constants-B90SnSQn.mjs";
|
|
3
|
+
import { t as arcLog } from "../logger-vxu0DXf_.mjs";
|
|
4
|
+
import { c as getOrgId } from "../types-4JKkSvds.mjs";
|
|
5
|
+
import { n as requestContext } from "../requestContext-B8JKbeb7.mjs";
|
|
6
|
+
import { t as hasEvents } from "../typeGuards-CtZJypJO.mjs";
|
|
7
|
+
import { t as HookSystem } from "../HookSystem-CtnnYHME.mjs";
|
|
8
|
+
import { t as ResourceRegistry } from "../ResourceRegistry-BNoHOx-D.mjs";
|
|
9
|
+
import { c as createRequestIdGenerator, l as requestId_default, n as health_default, u as sanitizeRequestId } from "../health-pLbfckGB.mjs";
|
|
10
|
+
import { t as caching_default } from "../caching-TQfW2QX7.mjs";
|
|
11
|
+
import { n as errorHandlerPlugin, t as defaultIsDuplicateKeyError } from "../errorHandler-DbHGwrQM.mjs";
|
|
12
|
+
import { t as metrics_default } from "../metrics-wfr7XFE7.mjs";
|
|
13
|
+
import { t as realtime_default } from "../realtime-MPj6eIoV.mjs";
|
|
14
|
+
import { t as replyHelpersPlugin } from "../replyHelpers-BW_p67QD.mjs";
|
|
15
|
+
import { t as schedules_default } from "../schedules-Dr9gNFzx.mjs";
|
|
16
|
+
import { t as sse_default } from "../sse-D8AgoUN3.mjs";
|
|
17
|
+
import { t as versioning_default } from "../versioning-JIqxO64K.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,13 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
import { FastifyPluginAsync, FastifyRequest } from "fastify";
|
|
3
3
|
//#region src/plugins/response-cache.d.ts
|
|
4
|
-
interface ResponseCacheRule {
|
|
4
|
+
export interface ResponseCacheRule {
|
|
5
5
|
/** Path prefix to match (e.g., '/api/products') */
|
|
6
6
|
match: string;
|
|
7
7
|
/** TTL in seconds for this path (0 = don't cache) */
|
|
8
8
|
ttl: number;
|
|
9
9
|
}
|
|
10
|
-
interface ResponseCacheOptions {
|
|
10
|
+
export interface ResponseCacheOptions {
|
|
11
11
|
/** Maximum number of cached entries (default: 500). LRU eviction when exceeded. */
|
|
12
12
|
maxEntries?: number;
|
|
13
13
|
/** Default TTL in seconds (default: 30). Set to 0 to require explicit rules. */
|
|
@@ -46,7 +46,7 @@ interface ResponseCacheOptions {
|
|
|
46
46
|
patterns?: Record<string, string[]>;
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
interface ResponseCacheStats {
|
|
49
|
+
export interface ResponseCacheStats {
|
|
50
50
|
entries: number;
|
|
51
51
|
maxEntries: number;
|
|
52
52
|
hits: number;
|
|
@@ -85,6 +85,5 @@ declare module "fastify" {
|
|
|
85
85
|
__arcCacheTTL?: number;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
declare const responseCachePlugin: FastifyPluginAsync<ResponseCacheOptions>;
|
|
89
|
-
//#endregion
|
|
90
|
-
export { ResponseCacheOptions, ResponseCacheRule, ResponseCacheStats, responseCachePlugin };
|
|
88
|
+
export declare const responseCachePlugin: FastifyPluginAsync<ResponseCacheOptions>;
|
|
89
|
+
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { n as declareRuntimeCapability } from "../runtimeCapabilities-
|
|
3
|
-
import { t as hasEvents } from "../typeGuards-
|
|
4
|
-
import { n as evictToSize, r as touch, t as assertCapacity } from "../boundedMap-
|
|
1
|
+
/*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as declareRuntimeCapability } from "../runtimeCapabilities-C7gAbIxC.mjs";
|
|
3
|
+
import { t as hasEvents } from "../typeGuards-CtZJypJO.mjs";
|
|
4
|
+
import { n as evictToSize, r as touch, t as assertCapacity } from "../boundedMap-DQfXgxMo.mjs";
|
|
5
5
|
import fp from "fastify-plugin";
|
|
6
6
|
//#region src/plugins/response-cache.ts
|
|
7
7
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.45.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.45.0";
|
|
63
63
|
const exporter = new OTLPTraceExporter({ url: exporterUrl });
|
|
64
64
|
const provider = new NodeTracerProvider({ resource: { attributes: {
|
|
65
65
|
"service.name": serviceName,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
|
|
2
2
|
import { i as RequestScope } from "../types-Ddl9OjmE.mjs";
|
|
3
3
|
import { l as PermissionCheck } from "../base-CZyixEQR.mjs";
|
|
4
|
-
import { W as PresetResult } from "../index-
|
|
4
|
+
import { W as PresetResult } from "../index-WH7xgvxS.mjs";
|
|
5
5
|
import { a as StorageReadResult, i as StorageReadRange, n as StorageContext, o as StorageUploadInput, r as StorageFile, t as Storage } from "../storage-Cx9Sz3Ou.mjs";
|
|
6
6
|
//#region src/presets/filesUpload.d.ts
|
|
7
|
-
interface FilesUploadPresetRoutes {
|
|
7
|
+
export interface FilesUploadPresetRoutes {
|
|
8
8
|
upload?: boolean;
|
|
9
9
|
read?: boolean;
|
|
10
10
|
delete?: boolean;
|
|
11
11
|
}
|
|
12
|
-
interface FilesUploadPresetPermissions {
|
|
12
|
+
export interface FilesUploadPresetPermissions {
|
|
13
13
|
upload?: PermissionCheck;
|
|
14
14
|
read?: PermissionCheck;
|
|
15
15
|
delete?: PermissionCheck;
|
|
@@ -27,8 +27,8 @@ interface FilesUploadPresetPermissions {
|
|
|
27
27
|
* - function: custom policy. Return a string to *transform* the filename,
|
|
28
28
|
* `false` to reject (triggers `ValidationError`), or `true`/`void` to accept.
|
|
29
29
|
*/
|
|
30
|
-
type FilenamePolicy = boolean | "*" | ((filename: string) => string | boolean | undefined);
|
|
31
|
-
interface FilesUploadPresetOptions {
|
|
30
|
+
export type FilenamePolicy = boolean | "*" | ((filename: string) => string | boolean | undefined);
|
|
31
|
+
export interface FilesUploadPresetOptions {
|
|
32
32
|
/** Any implementation of the `Storage` interface. App owns it. */
|
|
33
33
|
storage: Storage;
|
|
34
34
|
/** Multipart form field name. Default: `'file'`. */
|
|
@@ -66,6 +66,6 @@ interface FilesUploadPresetOptions {
|
|
|
66
66
|
* envelope. Upload still returns the standard `{ success: true, data }`
|
|
67
67
|
* envelope manually because the response is structured metadata, not bytes.
|
|
68
68
|
*/
|
|
69
|
-
declare function filesUploadPreset(options: FilesUploadPresetOptions): PresetResult;
|
|
69
|
+
export declare function filesUploadPreset(options: FilesUploadPresetOptions): PresetResult;
|
|
70
70
|
//#endregion
|
|
71
|
-
export {
|
|
71
|
+
export type { Storage, StorageContext, StorageFile, StorageReadRange, StorageReadResult, StorageUploadInput };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { i as NotFoundError, u as ValidationError } from "../errors-
|
|
3
|
-
import { c as getOrgId, g as getUserId } from "../types-
|
|
4
|
-
import { B as requireAuth, F as allowPublic } from "../permissions-
|
|
5
|
-
import { t as multipartBody } from "../multipartBody-
|
|
1
|
+
/*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
|
|
2
|
+
import { i as NotFoundError, u as ValidationError } from "../errors-C9G4A8cN.mjs";
|
|
3
|
+
import { c as getOrgId, g as getUserId } from "../types-4JKkSvds.mjs";
|
|
4
|
+
import { B as requireAuth, F as allowPublic } from "../permissions-IdHJ0_5V.mjs";
|
|
5
|
+
import { t as multipartBody } from "../multipartBody-NHGOuUnG.mjs";
|
|
6
6
|
//#region src/presets/filesUpload.ts
|
|
7
7
|
const DEFAULT_FIELD_NAME = "file";
|
|
8
8
|
const DEFAULT_MAX_FILE_SIZE = 10485760;
|