@classytic/arc 2.52.0 → 2.53.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/README.md +2 -1
- package/dist/{EventTransport-DeNze_-C.mjs → EventTransport-B3jTKMQH.mjs} +2 -2
- package/dist/{HookSystem-DTffXM1X.mjs → HookSystem-DNwxV463.mjs} +2 -2
- package/dist/{ResourceRegistry-tlqXSZoK.mjs → ResourceRegistry-Ck7RFodL.mjs} +2 -2
- package/dist/{acquire-7JKEkKnN.mjs → acquire-DkLruwhL.mjs} +1 -1
- package/dist/audit/index.d.mts +1 -1
- package/dist/audit/index.mjs +4 -4
- package/dist/auth/audit.mjs +1 -1
- package/dist/auth/index.d.mts +1 -1
- package/dist/auth/index.mjs +7 -7
- package/dist/auth/redis-session.mjs +1 -1
- package/dist/auth/social/index.mjs +1 -1
- package/dist/{authorizationDecision-DKmH4tZ-.mjs → authorizationDecision-gB5-bHDp.mjs} +5 -5
- package/dist/bootError-BT3z3cvX.mjs +38 -0
- package/dist/{boundedMap-zxGBpXX0.mjs → boundedMap-Ddw2yGb2.mjs} +1 -1
- package/dist/{buildHandler-ZDV6LRZ_.mjs → buildHandler-B8IDGmhD.mjs} +5 -5
- package/dist/cache/index.mjs +4 -4
- package/dist/{caching-DceUN9Xk.mjs → caching-BitJDAY0.mjs} +2 -2
- package/dist/{claimed-DsP5Hi_f.mjs → claimed-CM_-lFHX.mjs} +1 -1
- package/dist/cleanup/index.d.mts +2 -2
- package/dist/cleanup/index.mjs +4 -4
- package/dist/cli/commands/describe.d.mts +18 -1
- package/dist/cli/commands/describe.mjs +39 -7
- package/dist/cli/commands/docs.mjs +3 -3
- package/dist/cli/commands/doctor.d.mts +3 -1
- package/dist/cli/commands/doctor.mjs +135 -22
- 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-Ca2IQFy2.mjs → constants-D9EiaO5s.mjs} +1 -1
- package/dist/context/index.d.mts +5 -2
- package/dist/context/index.mjs +5 -5
- package/dist/core/index.d.mts +2 -2
- package/dist/core/index.mjs +7 -7
- package/dist/{core-M18RhMqi.mjs → core-B_06Fcn0.mjs} +3 -3
- package/dist/{createActionRouter-zXlrwWVs.mjs → createActionRouter-DtxUXOCI.mjs} +5 -5
- package/dist/{createAggregationRouter-CN0Da9nC.mjs → createAggregationRouter-BMiKyDoW.mjs} +7 -7
- package/dist/{createApp-BC67ACu4.mjs → createApp-CEdGZtkP.mjs} +207 -44
- package/dist/{createMcpServer-CS2KOVP6.d.mts → createMcpServer-Bk3ls5jS.d.mts} +1 -1
- package/dist/{defineAggregation-DqAGb5oI.mjs → defineAggregation-DUsrGcsm.mjs} +1 -1
- package/dist/{defineResource-DC5UqkQv.mjs → defineResource-q8TsJpOm.mjs} +92 -36
- package/dist/deprecation-DX625dth.mjs +27 -0
- 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-DiXVg98q.mjs → elevation-NJ3908pJ.mjs} +5 -5
- package/dist/encryption/index.mjs +3 -3
- package/dist/{errorHandler-BUTm9P_f.mjs → errorHandler-Ke6PGvF7.mjs} +7 -4
- package/dist/{errors-DxpHZBlW.mjs → errors-Ukhmfmmx.mjs} +1 -1
- package/dist/{eventPlugin-BY38F6yK.d.mts → eventPlugin-BeJasppx.d.mts} +7 -18
- package/dist/{eventPlugin-ZsIQPRso.mjs → eventPlugin-DTKAgSvb.mjs} +10 -8
- package/dist/{eventTypes-D-pFtqT1.mjs → eventTypes-DpDQtyR6.mjs} +2 -2
- package/dist/events/index.d.mts +2 -2
- package/dist/events/index.mjs +8 -8
- package/dist/events/transports/redis-stream-entry.mjs +4 -4
- package/dist/events/transports/redis.mjs +2 -2
- package/dist/factory/index.d.mts +28 -5
- package/dist/factory/index.mjs +12 -7
- package/dist/{fastify-augmentation-CPReFhZ1.d.mts → fastify-augmentation-DjxuSRG4.d.mts} +4 -3
- package/dist/{fieldTypes-f-3TZgR3.mjs → fieldTypes-BtFpQO6I.mjs} +2 -2
- package/dist/{fields-kCbIDTjA.mjs → fields-B7fuROWK.mjs} +1 -1
- package/dist/{filter-merge-UJCgjbZR.mjs → filter-merge-BuzZ-r9z.mjs} +1 -1
- package/dist/{generate-CLpmzbJ_.mjs → generate-c4F39pk1.mjs} +4 -4
- package/dist/{headers-Bh47h0XH.mjs → headers-Ib7BDgRI.mjs} +2 -2
- package/dist/{health-CEpgVAl7.mjs → health-22T82HAa.mjs} +1 -1
- package/dist/health-skjSwNaC.d.mts +36 -0
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/http-cache/index.mjs +4 -4
- package/dist/http-cache/purgers/cloudflare.mjs +2 -2
- package/dist/http-cache/purgers/fastly.mjs +2 -2
- package/dist/http-cache/testing/index.mjs +1 -1
- package/dist/idempotency/index.d.mts +7 -1
- package/dist/idempotency/index.mjs +9 -7
- package/dist/idempotency/redis.mjs +2 -2
- package/dist/{index-CMNpMBtW.d.mts → index-BzUyno-u.d.mts} +14 -5
- package/dist/{index-yXXCsKl7.d.mts → index-CXqYFGoH.d.mts} +13 -4
- package/dist/{index-CSbDhif4.d.mts → index-CaBFPmnu.d.mts} +10 -6
- package/dist/{index-DCH08eqQ.d.mts → index-DWn0o4U7.d.mts} +2 -2
- package/dist/{index-DLCcLUQT.d.mts → index-DtHACefu.d.mts} +109 -116
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +12 -12
- package/dist/{init-B43DXBpc.mjs → init-XY5slyuS.mjs} +3 -3
- 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 +9 -4
- package/dist/integrations/mcp/index.mjs +2 -2
- package/dist/integrations/mcp/testing.d.mts +2 -2
- package/dist/integrations/mcp/testing.mjs +2 -2
- package/dist/integrations/streamline.mjs +3 -3
- package/dist/integrations/webhooks.d.mts +1 -1
- package/dist/integrations/webhooks.mjs +4 -4
- package/dist/integrations/websocket-pushref-redis.mjs +1 -1
- package/dist/integrations/websocket-redis.mjs +1 -1
- package/dist/integrations/websocket.mjs +2 -2
- package/dist/invariants-COekUeoh.mjs +120 -0
- package/dist/{jsonBody-CkKs6dA_.mjs → jsonBody-BNlcGUnb.mjs} +2 -2
- package/dist/{keys-DHrHnT0f.mjs → keys-DwvXJwUX.mjs} +1 -1
- package/dist/{loadResources-CFdzAWQZ.mjs → loadResources-izEeQLO_.mjs} +3 -3
- package/dist/{loadResourcesFromEntry-DkoSiJsI.mjs → loadResourcesFromEntry-CijqjbHE.mjs} +2 -2
- package/dist/logger/index.mjs +2 -2
- package/dist/{logger-DJwz_-Pl.mjs → logger-DdMS0XC_.mjs} +1 -1
- package/dist/{mcpPlugin-CA_MDFlS.mjs → mcpPlugin-D0tSZqKk.mjs} +24 -22
- package/dist/{memory-B9CFHbA_.mjs → memory-Ay0haw9n.mjs} +3 -3
- package/dist/{metrics-DSKv-T9K.mjs → metrics-Bpgf4UL6.mjs} +3 -3
- 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-C0JCsnO7.mjs → module-BLrTmMyk.mjs} +1 -1
- package/dist/{multiTenant-QtDzxx_K.d.mts → multiTenant-Cf0Ye-Wu.d.mts} +1 -1
- package/dist/{multipartBody-Bxz-q6hI.mjs → multipartBody-L2gr96df.mjs} +1 -1
- package/dist/{observeSend-DfNkdGww.mjs → observeSend-B7FEdk_g.mjs} +1 -1
- package/dist/{openapi-Dmp7Ipsi.mjs → openapi-COrL_33P.mjs} +6 -6
- package/dist/outbox-admin/index.d.mts +1 -1
- package/dist/outbox-admin/index.mjs +6 -6
- package/dist/{outbox-module-vT6PaThj.mjs → outbox-module-BY2HtnjU.mjs} +7 -7
- package/dist/{outbox-module-DzW6zwWJ.d.mts → outbox-module-C1QWMloZ.d.mts} +5 -8
- package/dist/permissions/index.d.mts +2 -2
- package/dist/permissions/index.mjs +8 -8
- package/dist/{permissions-Cga6KBOX.mjs → permissions-CEyeDHtT.mjs} +36 -17
- package/dist/{pipe-CqPweKdL.mjs → pipe-DIAr91at.mjs} +2 -2
- package/dist/pipeline/index.d.mts +1 -1
- package/dist/pipeline/index.mjs +2 -2
- package/dist/{plan-CbDTFbTj.mjs → plan-BhKHIkFl.mjs} +75 -20
- package/dist/{plugin-8Z1khbAI.mjs → plugin-D6hrdx-j.mjs} +72 -38
- package/dist/plugins/index.d.mts +4 -3
- package/dist/plugins/index.mjs +18 -18
- package/dist/plugins/response-cache.mjs +4 -4
- package/dist/plugins/tracing-entry.mjs +177 -85
- package/dist/{pluralize-D4vcPLVs.mjs → pluralize-CJKgYkVc.mjs} +1 -1
- package/dist/presetPermission-2pcRVYRG.mjs +23 -0
- package/dist/presets/filesUpload.d.mts +4 -2
- package/dist/presets/filesUpload.mjs +11 -6
- package/dist/presets/index.d.mts +6 -4
- 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 +2 -2
- package/dist/presets/search.mjs +54 -38
- package/dist/{presets-D28IABZe.mjs → presets-st11ePNn.mjs} +150 -41
- package/dist/{projection-aHCtDQQ9.mjs → projection-B4rqiJTi.mjs} +2 -2
- package/dist/{purger.types-CNFmEtFu.mjs → purger.types-BcHeAhY_.mjs} +1 -1
- package/dist/{queryCachePlugin-CwpEjCwz.mjs → queryCachePlugin-BgSc2bga.mjs} +6 -6
- package/dist/rateLimitKey-DLGdeFd2.mjs +138 -0
- package/dist/{realtime-Dvu8ES2z.mjs → realtime-CpYpIFsm.mjs} +11 -11
- package/dist/registry/index.d.mts +2 -2
- package/dist/registry/index.mjs +3 -3
- package/dist/{registry-DmxbzW7-.mjs → registry-BQsdAlZ_.mjs} +2 -2
- package/dist/{relay-CEaCmUfG.mjs → relay-CmT3gtkP.mjs} +11 -12
- package/dist/{renewingLease-g2FjB3im.mjs → renewingLease-DaoP0K-e.mjs} +1 -1
- package/dist/{replyHelpers-CSByAX_Z.mjs → replyHelpers-SiLr1wK4.mjs} +2 -2
- package/dist/{requestContext-yc7MSgmq.mjs → requestContext-B-TjFpWt.mjs} +8 -3
- package/dist/{health-W4S2yFBL.mjs → requestId-ClcKoWLq.mjs} +154 -116
- package/dist/{requirement-Dm8njSoC.mjs → requirement-BygDzjDS.mjs} +1 -1
- package/dist/{resourceRateLimit-PQaY3HW1.mjs → resourceRateLimit-DdIYis3m.mjs} +2 -2
- package/dist/{rolldown-runtime-BBBkGgwA.mjs → rolldown-runtime-Cy6j0m8_.mjs} +1 -1
- package/dist/{routeValidator-fuG51bQA.mjs → routeValidator-Bn-x2gaJ.mjs} +1 -1
- package/dist/{runtimeCapabilities-B8IT7xiQ.mjs → runtimeCapabilities-DY20Pibh.mjs} +7 -2
- package/dist/{schedules-0-aS4jDV.mjs → schedules-CwqC0Mp0.mjs} +5 -5
- package/dist/{schemaConverter-Cs3SwP4R.mjs → schemaConverter-XoLKVpzG.mjs} +2 -2
- package/dist/{schemaIR-By8XiNeE.mjs → schemaIR-DP7mMj7c.mjs} +16 -16
- package/dist/schemas/index.mjs +1 -1
- package/dist/scim/index.mjs +2 -2
- package/dist/scope/index.d.mts +6 -2
- package/dist/scope/index.mjs +5 -5
- package/dist/{scope-BWNAlBj0.mjs → scope-B0vgM2Zw.mjs} +4 -4
- package/dist/{shutdown-Cf-27xsS.mjs → shutdown-C76Hn-Th.mjs} +1 -1
- package/dist/{simpleEqualityMatcher-e-dgJcUO.mjs → simpleEqualityMatcher-Qbl-11cE.mjs} +1 -1
- package/dist/{sse-C3bj5qWi.mjs → sse-eyb8lNuI.mjs} +7 -7
- package/dist/{sseStream-BYZbpFDa.mjs → sseStream-BsBesrfw.mjs} +2 -2
- package/dist/{store-helpers-B9HierHY.mjs → store-helpers-D1yIVa91.mjs} +1 -1
- package/dist/{streaming-EN8NJWxr.mjs → streaming-DKziqs1Z.mjs} +1 -1
- package/dist/{subscriberIdentity-DSqCh38x.mjs → subscriberIdentity-DpdSQMQq.mjs} +1 -1
- package/dist/{tenancy-CAqjGQcQ.mjs → tenancy-YuRYsOPr.mjs} +2 -2
- package/dist/{tenantPreparation-CVBWarqs.mjs → tenantPreparation-Bk8ouRB3.mjs} +17 -5
- package/dist/testing/cleanupStoreContract.mjs +1 -1
- package/dist/testing/index.d.mts +4 -4
- package/dist/testing/index.mjs +11 -11
- package/dist/testing/outboxStoreContract.mjs +2 -2
- package/dist/testing/requiredPorts.d.mts +1 -1
- package/dist/testing/requiredPorts.mjs +2 -2
- package/dist/testing/storageContract.mjs +1 -1
- package/dist/{timing-CKI_Oyub.mjs → timing-BtIDIdQz.mjs} +1 -1
- package/dist/{transactionContext-D0UZFoSy.mjs → transactionContext-BsQ5ortM.mjs} +1 -1
- package/dist/{typeGuards-CLYkmBLT.mjs → typeGuards-Cr2_zEW0.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-BeEJm-DV.d.mts → types-CQhHTZXs.d.mts} +48 -35
- package/dist/{types-B4E0sc6D.d.mts → types-DWFgq8EP.d.mts} +1 -1
- package/dist/{types-Cunc4shv.mjs → types-ZvdR7MVa.mjs} +4 -4
- package/dist/usage/index.mjs +4 -4
- package/dist/{userHelpers-cT5j1kgp.mjs → userHelpers-CwpEK36a.mjs} +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.mjs +12 -12
- package/dist/{utils-DlNkm1dI.mjs → utils-CnrfcYMq.mjs} +6 -6
- package/dist/{validate-63QThRoS.mjs → validate-BTQBh-Dr.mjs} +3 -3
- package/dist/{versioning-f2YGmh4i.mjs → versioning-DiLykI6U.mjs} +3 -3
- package/dist/{workScope-DwspXz70.mjs → workScope-C3tPz_Gt.mjs} +2 -2
- package/package.json +34 -9
- package/skills/arc/SKILL.md +5 -5
- package/skills/arc/references/api-reference.md +1 -1
- package/skills/arc/references/boot.md +17 -2
- package/skills/arc/references/events.md +0 -1
- package/skills/arc/references/mcp-setup.md +3 -2
- package/skills/arc/references/multi-tenancy.md +1 -1
- package/skills/arc/references/production-api.md +19 -12
- package/skills/arc/references/production-audit.md +1 -1
- package/skills/arc/references/production-boot.md +3 -3
- package/skills/arc/references/production-idempotency.md +2 -2
- package/skills/arc/references/production-observability.md +14 -2
- package/skills/arc/references/production-reliability.md +1 -1
- package/skills/arc/references/querying.md +1 -2
- package/skills/arc/references/resources.md +8 -6
- package/skills/arc/references/testing.md +1 -1
- package/skills/arc-code-review/references/arc-cheatsheet.md +1 -1
- package/skills/arc-code-review/references/recipe-scope-permissions.md +1 -1
- package/skills/arc-module-publishing/references/resource-assembly.md +2 -2
- package/dist/rateLimitKey-D9dl3FQn.mjs +0 -40
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { Ct as Transform, St as PipelineStep, Wn as IControllerResponse, _t as Interceptor, bt as PipelineConfig, gt as Guard, vt as NextFunction, xt as PipelineContext, yt as OperationFilter } from "../index-DtHACefu.mjs";
|
|
3
3
|
interface GuardOptions {
|
|
4
4
|
operations?: OperationFilter;
|
|
5
5
|
handler: (ctx: PipelineContext) => boolean | Promise<boolean>;
|
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.53.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as pipe, t as executePipeline } from "../pipe-DIAr91at.mjs";
|
|
3
3
|
// src/pipeline/guard.ts
|
|
4
4
|
/**
|
|
5
5
|
* Create a named guard.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as bootError, t as ArcBootError } from "./bootError-BT3z3cvX.mjs";
|
|
3
|
+
import { t as assertModuleInvariants } from "./invariants-COekUeoh.mjs";
|
|
2
4
|
import { createEventRouter, matchEventPattern } from "@classytic/primitives/events";
|
|
3
5
|
// src/factory/module/graph.ts
|
|
4
6
|
/**
|
|
@@ -320,7 +322,12 @@ async function declareModules(inputs) {
|
|
|
320
322
|
async function loadLazyBridge(lazy) {
|
|
321
323
|
const m = await resolveModule(lazy.load);
|
|
322
324
|
const deps = [...m.dependsOn ?? []].sort().join(",");
|
|
323
|
-
if (m.name !== lazy.name || m.kind !== "bridge" || deps !== [...lazy.dependsOn].sort().join(",") || portsKey(m.requires) !== portsKey(lazy.requires)) throw
|
|
325
|
+
if (m.name !== lazy.name || m.kind !== "bridge" || deps !== [...lazy.dependsOn].sort().join(",") || portsKey(m.requires) !== portsKey(lazy.requires)) throw bootError({
|
|
326
|
+
code: "lazy-bridge-mismatch",
|
|
327
|
+
module: lazy.name,
|
|
328
|
+
message: `[arc] lazy bridge "${lazy.name}" loaded a module that does not match its declaration (got name "${m.name}", kind "${m.kind ?? "domain"}", dependsOn [${deps}], requires ${portsKey(m.requires)}). Activation and the requirement check were decided on the declared name + dependsOn + requires, so they must be identical.`,
|
|
329
|
+
fix: "make the lazy bridge's name, dependsOn and requires equal the loaded module's"
|
|
330
|
+
});
|
|
324
331
|
return m;
|
|
325
332
|
}
|
|
326
333
|
/** A stable fingerprint of a `requires` declaration, for the declared-vs-loaded comparison. */
|
|
@@ -336,8 +343,16 @@ function portsKey(requires) {
|
|
|
336
343
|
async function resolveModule(input) {
|
|
337
344
|
if (isLazyBridge(input)) return loadLazyBridge(input);
|
|
338
345
|
const resolved = typeof input === "function" ? await input() : await input;
|
|
339
|
-
if (!resolved || typeof resolved !== "object" || typeof resolved.name !== "string") throw
|
|
340
|
-
|
|
346
|
+
if (!resolved || typeof resolved !== "object" || typeof resolved.name !== "string") throw bootError({
|
|
347
|
+
code: "module-not-arc-module",
|
|
348
|
+
message: "[arc] a `modules` entry resolved to something that is not an ArcModule (expected an object with a string `name`). Check dynamic-import thunks return `createXModule(deps)` (or the module object), not the namespace.",
|
|
349
|
+
fix: "return the module object (createXModule(deps)) from the thunk, not the import namespace"
|
|
350
|
+
});
|
|
351
|
+
if (resolved.name.trim().length === 0) throw bootError({
|
|
352
|
+
code: "module-empty-name",
|
|
353
|
+
message: "[arc] a `modules` entry has an empty (or whitespace-only) `name`. A module's name is its graph key, its `arc.modules` export key, its `dependsOn` target, and its label in every boot diagnostic — give it a stable, non-empty identifier.",
|
|
354
|
+
fix: "give the module a stable, non-empty name"
|
|
355
|
+
});
|
|
341
356
|
return resolved;
|
|
342
357
|
}
|
|
343
358
|
/** Resolve a `ModuleContribution` to a concrete array (array passthrough or factory call). */
|
|
@@ -370,6 +385,10 @@ async function resolveModuleArm(module, arm, contribution, fastify) {
|
|
|
370
385
|
}
|
|
371
386
|
// src/factory/module/order.ts
|
|
372
387
|
/**
|
|
388
|
+
* `dependsOn` composition ordering — stable topological sort with fail-fast
|
|
389
|
+
* validation and concrete cycle reporting.
|
|
390
|
+
*/
|
|
391
|
+
/**
|
|
373
392
|
* Order modules for composition — a STABLE topological sort. Every later phase
|
|
374
393
|
* (bootstrap, resources, afterResources, reverse-order onClose) iterates the
|
|
375
394
|
* returned list, so a module's dependencies are always composed before it.
|
|
@@ -385,12 +404,27 @@ async function resolveModuleArm(module, arm, contribution, fastify) {
|
|
|
385
404
|
function orderModules(modules) {
|
|
386
405
|
const byName = /* @__PURE__ */ new Map();
|
|
387
406
|
for (const m of modules) {
|
|
388
|
-
if (byName.has(m.name)) throw
|
|
407
|
+
if (byName.has(m.name)) throw bootError({
|
|
408
|
+
code: "duplicate-module",
|
|
409
|
+
module: m.name,
|
|
410
|
+
message: `[arc] Duplicate module name "${m.name}" — composed twice; check your modules array.`,
|
|
411
|
+
fix: "remove the duplicate from createApp({ modules })"
|
|
412
|
+
});
|
|
389
413
|
byName.set(m.name, m);
|
|
390
414
|
}
|
|
391
415
|
for (const m of modules) for (const dep of m.dependsOn ?? []) {
|
|
392
|
-
if (dep === m.name) throw
|
|
393
|
-
|
|
416
|
+
if (dep === m.name) throw bootError({
|
|
417
|
+
code: "self-dependency",
|
|
418
|
+
module: m.name,
|
|
419
|
+
message: `[arc] module "${m.name}" dependsOn itself — remove the self-reference.`,
|
|
420
|
+
fix: "remove the self-reference"
|
|
421
|
+
});
|
|
422
|
+
if (!byName.has(dep)) throw bootError({
|
|
423
|
+
code: "missing-dependency",
|
|
424
|
+
module: m.name,
|
|
425
|
+
message: `[arc] module "${m.name}" dependsOn "${dep}", which is not composed. Add the "${dep}" module to createApp({ modules }) (before this one is fine — arc orders them), or drop the dependency. Composed modules: ${[...byName.keys()].join(", ") || "(none)"}.`,
|
|
426
|
+
fix: `add the "${dep}" module to createApp({ modules }), or drop the dependency`
|
|
427
|
+
});
|
|
394
428
|
}
|
|
395
429
|
const edges = effectiveEdges(modules);
|
|
396
430
|
const originalIndex = /* @__PURE__ */ new Map();
|
|
@@ -419,7 +453,11 @@ function orderModules(modules) {
|
|
|
419
453
|
pickRank = r;
|
|
420
454
|
}
|
|
421
455
|
}
|
|
422
|
-
if (pick === void 0) throw
|
|
456
|
+
if (pick === void 0) throw bootError({
|
|
457
|
+
code: "module-cycle",
|
|
458
|
+
message: describeModuleCycle(remaining, edges),
|
|
459
|
+
fix: "break the cycle with a shared module, `requires.modules`, or an event/port"
|
|
460
|
+
});
|
|
423
461
|
ordered.push(pick);
|
|
424
462
|
remaining.delete(pick.name);
|
|
425
463
|
for (const dependent of dependents.get(pick.name) ?? []) pendingDeps.set(dependent, (pendingDeps.get(dependent) ?? 1) - 1);
|
|
@@ -461,6 +499,12 @@ function describeModuleCycle(remaining, edges) {
|
|
|
461
499
|
return `[arc] module dependency cycle: ${cycle ? cycle.join(" → ") : [...remaining].join(", ")}. Modules cannot dependsOn each other circularly — break it with a shared module both point at, declare the softer direction as \`requires.modules\` (presence only, no ordering edge), or wire it through an event/port. A module that dependsOn a \`kind: 'aggregator'\` module is always a cycle.`;
|
|
462
500
|
}
|
|
463
501
|
// src/factory/module/plan.ts
|
|
502
|
+
/**
|
|
503
|
+
* Composition planning — the composability check, the dry-run plan, and module closures.
|
|
504
|
+
*
|
|
505
|
+
* `createApp` and `planModules` run the SAME steps (`declareModules` → `assertComposable` →
|
|
506
|
+
* `orderModules`), so a plan cannot disagree with a boot.
|
|
507
|
+
*/
|
|
464
508
|
/** A port counts as supplied when it is an own key whose value is neither `undefined` nor `null`. */
|
|
465
509
|
function isSupplied(ports, name) {
|
|
466
510
|
return Object.hasOwn(ports, name) && ports[name] !== void 0 && ports[name] !== null;
|
|
@@ -474,29 +518,36 @@ function compositionProblems(modules, ports = {}) {
|
|
|
474
518
|
const supplied = ports;
|
|
475
519
|
const composed = /* @__PURE__ */ new Set();
|
|
476
520
|
const problems = [];
|
|
477
|
-
|
|
521
|
+
/** `message` is `<what> — <fix>`; both halves are kept for the boot report. */
|
|
522
|
+
const add = (code, module, target, what, fix) => problems.push({
|
|
478
523
|
code,
|
|
479
524
|
module,
|
|
480
525
|
target,
|
|
481
|
-
message
|
|
526
|
+
message: `${what} — ${fix}`,
|
|
527
|
+
fix
|
|
482
528
|
});
|
|
483
529
|
for (const m of modules) {
|
|
484
|
-
if (composed.has(m.name)) add("duplicate-module", m.name, m.name, `Duplicate module name "${m.name}"
|
|
530
|
+
if (composed.has(m.name)) add("duplicate-module", m.name, m.name, `Duplicate module name "${m.name}"`, "it is composed twice; remove the duplicate from createApp({ modules })");
|
|
485
531
|
composed.add(m.name);
|
|
486
532
|
}
|
|
487
533
|
for (const m of modules) {
|
|
488
|
-
for (const dep of m.dependsOn ?? []) if (dep === m.name) add("self-dependency", m.name, dep, `module "${m.name}" dependsOn itself
|
|
489
|
-
else if (!composed.has(dep)) add("missing-dependency", m.name, dep, `module "${m.name}" dependsOn "${dep}", which is not composed
|
|
490
|
-
for (const dep of m.requires?.modules ?? []) if (!composed.has(dep)) add("missing-module", m.name, dep, `module "${m.name}" requires "${dep}" to be composed
|
|
491
|
-
for (const port of m.requires?.ports ?? []) if (!isSupplied(supplied, port)) add("missing-port", m.name, port, `module "${m.name}" requires port "${port}"
|
|
534
|
+
for (const dep of m.dependsOn ?? []) if (dep === m.name) add("self-dependency", m.name, dep, `module "${m.name}" dependsOn itself`, "remove the self-reference");
|
|
535
|
+
else if (!composed.has(dep)) add("missing-dependency", m.name, dep, `module "${m.name}" dependsOn "${dep}", which is not composed`, `add the "${dep}" module to createApp({ modules }), or drop the dependency`);
|
|
536
|
+
for (const dep of m.requires?.modules ?? []) if (!composed.has(dep)) add("missing-module", m.name, dep, `module "${m.name}" requires "${dep}" to be composed`, `add the "${dep}" module to createApp({ modules })`);
|
|
537
|
+
for (const port of m.requires?.ports ?? []) if (!isSupplied(supplied, port)) add("missing-port", m.name, port, `module "${m.name}" requires port "${port}"`, `supply createApp({ ports: { ${port} } })`);
|
|
492
538
|
}
|
|
493
539
|
return problems;
|
|
494
540
|
}
|
|
495
|
-
/** Throw ONE
|
|
541
|
+
/** Throw ONE `ArcBootError` listing every composition problem, or return. */
|
|
496
542
|
function assertComposable(modules, ports) {
|
|
497
543
|
const problems = compositionProblems(modules, ports);
|
|
498
544
|
if (problems.length === 0) return;
|
|
499
|
-
throw new
|
|
545
|
+
throw new ArcBootError(`[arc] cannot compose the module graph — nothing was booted (${problems.length} problem${problems.length === 1 ? "" : "s"}):\n` + problems.map((p) => ` - ${p.message}`).join("\n"), problems.map((p) => ({
|
|
546
|
+
code: p.code,
|
|
547
|
+
module: p.module,
|
|
548
|
+
message: p.message,
|
|
549
|
+
fix: p.fix
|
|
550
|
+
})));
|
|
500
551
|
}
|
|
501
552
|
/** The ports handed to one module's setup phases — only those it declared, frozen. */
|
|
502
553
|
function portsForModule(module, ports = {}) {
|
|
@@ -506,8 +557,9 @@ function portsForModule(module, ports = {}) {
|
|
|
506
557
|
return Object.freeze(own);
|
|
507
558
|
}
|
|
508
559
|
/**
|
|
509
|
-
* Dry-run a composition: resolve inputs, activate bridges, order, check requirements
|
|
510
|
-
* functions `createApp` calls, so the plan fails where boot would and
|
|
560
|
+
* Dry-run a composition: resolve inputs, activate bridges, order, check requirements and module
|
|
561
|
+
* invariants — the same functions `createApp` calls, so the plan fails where boot would and
|
|
562
|
+
* orders as boot would.
|
|
511
563
|
*
|
|
512
564
|
* Thunks ARE invoked (their result is the module); a `LazyBridge` is decided on its declaration
|
|
513
565
|
* and never loaded.
|
|
@@ -516,6 +568,7 @@ async function planModules(inputs, options = {}) {
|
|
|
516
568
|
const { active, skipped } = await declareModules(inputs);
|
|
517
569
|
assertComposable(active, options.ports);
|
|
518
570
|
const ordered = orderModules(active);
|
|
571
|
+
assertModuleInvariants(ordered);
|
|
519
572
|
return Object.freeze({
|
|
520
573
|
order: Object.freeze(ordered.map((m) => m.name)),
|
|
521
574
|
activeBridges: Object.freeze(ordered.filter((m) => m.kind === "bridge").map((m) => m.name)),
|
|
@@ -526,8 +579,10 @@ async function planModules(inputs, options = {}) {
|
|
|
526
579
|
async function composeModules(inputs, ports) {
|
|
527
580
|
const { active, skipped, lazyByName } = await declareModules(inputs);
|
|
528
581
|
assertComposable(active, ports);
|
|
582
|
+
const modules = orderModules(await loadActiveBridges(active, lazyByName));
|
|
583
|
+
assertModuleInvariants(modules);
|
|
529
584
|
return {
|
|
530
|
-
modules
|
|
585
|
+
modules,
|
|
531
586
|
skipped
|
|
532
587
|
};
|
|
533
588
|
}
|
|
@@ -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 { O as ArcQueryParser, b as getDefaultCrudSchemas } from "./utils-
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { a as
|
|
19
|
-
import { t as hasEvents } from "./typeGuards-
|
|
20
|
-
import { n as idempotencyConfigProblem } from "./requirement-
|
|
1
|
+
/*! @classytic/arc v2.53.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-D9EiaO5s.mjs";
|
|
3
|
+
import { t as arcLog } from "./logger-DdMS0XC_.mjs";
|
|
4
|
+
import { t as conjoinPolicyFilters } from "./filter-merge-BuzZ-r9z.mjs";
|
|
5
|
+
import { d as createDomainError, f as createError, i as NotFoundError, p as isArcError, r as ForbiddenError, u as ValidationError } from "./errors-Ukhmfmmx.mjs";
|
|
6
|
+
import { t as simpleEqualityMatcher } from "./simpleEqualityMatcher-Qbl-11cE.mjs";
|
|
7
|
+
import { n as requireSingleHeaderValue } from "./headers-Ib7BDgRI.mjs";
|
|
8
|
+
import { n as getUserRoles, t as getUserId } from "./userHelpers-CwpEK36a.mjs";
|
|
9
|
+
import { b as isElevated, c as getOrgId, n as PUBLIC_SCOPE, x as isMember } from "./types-ZvdR7MVa.mjs";
|
|
10
|
+
import { r as resolveTenancy } from "./tenancy-YuRYsOPr.mjs";
|
|
11
|
+
import { t as buildQueryKey } from "./keys-DwvXJwUX.mjs";
|
|
12
|
+
import { t as transactionContext } from "./transactionContext-BsQ5ortM.mjs";
|
|
13
|
+
import { a as resolveEffectiveRoles, n as applyFieldWritePermissions } from "./fields-B7fuROWK.mjs";
|
|
14
|
+
import { O as ArcQueryParser, b as getDefaultCrudSchemas } from "./utils-CnrfcYMq.mjs";
|
|
15
|
+
import { i as routeTenantMiddlewares, o as withoutTenantInjection } from "./tenantPreparation-Bk8ouRB3.mjs";
|
|
16
|
+
import { n as convertRouteSchema, r as ensureSchemaConverter, t as convertOpenApiSchemas } from "./schemaConverter-XoLKVpzG.mjs";
|
|
17
|
+
import { i as pipeUIMessageStreamToReply, r as isReadableStream } from "./streaming-DKziqs1Z.mjs";
|
|
18
|
+
import { C as createFastifyHandler, S as createCrudHandlers, _ as resolveRoutePreHandlers, a as resolveActionPermission, c as buildRouteConfig, f as buildPipelineHandler, g as buildRouteHooks, h as buildCrudPermissionMw, l as resolveRouterPluginMw, n as normalizeSchemaIR, o as tryRegisterRoute, p as resolvePipelineSteps, s as buildRateLimitConfig, u as selectPluginMw, v as routeHookOptions, w as createRequestContext, x as buildArcDecorator, y as buildAuthMiddleware } from "./schemaIR-DP7mMj7c.mjs";
|
|
19
|
+
import { t as hasEvents } from "./typeGuards-Cr2_zEW0.mjs";
|
|
20
|
+
import { n as idempotencyConfigProblem } from "./requirement-BygDzjDS.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";
|
|
@@ -895,6 +895,19 @@ var QueryResolver = class {
|
|
|
895
895
|
return sort.split(",").map((s) => s.trim().replace(/^-/, "")).filter(Boolean).every((f) => allowed.includes(f)) ? sort : void 0;
|
|
896
896
|
}
|
|
897
897
|
/**
|
|
898
|
+
* The row scope a list read applies, in the record dialect: `base` AND the permission
|
|
899
|
+
* layer's `_policyFilters` AND the tenant filter `resolveTenancy` decides. `resolve`
|
|
900
|
+
* builds every list filter from it; reads that cannot take the parsed query (search) use
|
|
901
|
+
* it alone.
|
|
902
|
+
*/
|
|
903
|
+
scopeFilter(arcContext, base) {
|
|
904
|
+
const policyFilters = arcContext?._policyFilters;
|
|
905
|
+
let filters = conjoinPolicyFilters(base, policyFilters);
|
|
906
|
+
const tenancy = resolveTenancy(arcContext, this.tenantField);
|
|
907
|
+
if (tenancy.mode === "scoped" && !policyFilters?.[tenancy.field]) filters = conjoinPolicyFilters(filters, { [tenancy.field]: tenancy.orgId });
|
|
908
|
+
return filters;
|
|
909
|
+
}
|
|
910
|
+
/**
|
|
898
911
|
* Resolve a request into parsed query options -- ONE parse per request.
|
|
899
912
|
* Combines what was previously _buildContext + _parseQueryOptions + _applyFilters.
|
|
900
913
|
*/
|
|
@@ -951,11 +964,7 @@ var QueryResolver = class {
|
|
|
951
964
|
const page = keysetMode ? void 0 : parsed.page ? Math.max(1, parsed.page) : 1;
|
|
952
965
|
const sortString = parsed.sort ? Object.entries(parsed.sort).map(([k, v]) => v === -1 ? `-${k}` : k).join(",") : this.permittedDefaultSort();
|
|
953
966
|
const rawSelect = parsed.select ?? req.query?.select;
|
|
954
|
-
const
|
|
955
|
-
let filters = conjoinPolicyFilters(parsed.filters, policyFilters);
|
|
956
|
-
const tenancy = resolveTenancy(arcContext, this.tenantField);
|
|
957
|
-
if (tenancy.mode === "scoped" && !policyFilters?.[tenancy.field]) filters = conjoinPolicyFilters(filters, { [tenancy.field]: tenancy.orgId });
|
|
958
|
-
const portableFilters = toRepositoryFilter(filters);
|
|
967
|
+
const portableFilters = toRepositoryFilter(this.scopeFilter(arcContext, parsed.filters));
|
|
959
968
|
return {
|
|
960
969
|
page,
|
|
961
970
|
limit,
|
|
@@ -1681,6 +1690,26 @@ var BaseCrudController = class {
|
|
|
1681
1690
|
if (verb.kind === "distinct") return this.dispatchDistinct(req, verb.field);
|
|
1682
1691
|
return this.dispatchExists(req);
|
|
1683
1692
|
}
|
|
1693
|
+
/**
|
|
1694
|
+
* The row scope `list` applies, for reads that bypass `getAll` (the search preset):
|
|
1695
|
+
* `filter` (record dialect: permission filters AND tenant), the repository `options`
|
|
1696
|
+
* `list` passes (tenant context; the tenant key and `bypassTenant` are always present so
|
|
1697
|
+
* spreading them last overrides a caller-supplied value), and `allows(doc)`, the
|
|
1698
|
+
* post-fetch check `getBySlug` uses, for repositories that cannot take a filter.
|
|
1699
|
+
*/
|
|
1700
|
+
listScope(req) {
|
|
1701
|
+
const meta = this.meta(req);
|
|
1702
|
+
const tenantKeys = { bypassTenant: void 0 };
|
|
1703
|
+
if (this.tenantField) tenantKeys[this.tenantField] = void 0;
|
|
1704
|
+
return {
|
|
1705
|
+
filter: this.queryResolver.scopeFilter(meta),
|
|
1706
|
+
options: {
|
|
1707
|
+
...tenantKeys,
|
|
1708
|
+
...this.tenantRepoOptions(req)
|
|
1709
|
+
},
|
|
1710
|
+
allows: (doc) => doc !== null && typeof doc === "object" && this.accessControl.validateItemAccess(doc, req)
|
|
1711
|
+
};
|
|
1712
|
+
}
|
|
1684
1713
|
/** Resolve filter + tenant/audit options for a dispatch verb. */
|
|
1685
1714
|
resolveDispatchScope(req) {
|
|
1686
1715
|
return {
|
|
@@ -2184,7 +2213,10 @@ function TreeMixin(Base) {
|
|
|
2184
2213
|
async getTree(req) {
|
|
2185
2214
|
const repo = withRepoFeatures(this.repository);
|
|
2186
2215
|
if (!repo.getTree) throw createError(501, "Tree structure not implemented");
|
|
2187
|
-
const options =
|
|
2216
|
+
const options = {
|
|
2217
|
+
...this.queryResolver.resolve(req, this.meta(req)),
|
|
2218
|
+
...this.tenantRepoOptions(req)
|
|
2219
|
+
};
|
|
2188
2220
|
return {
|
|
2189
2221
|
data: await repo.getTree(options),
|
|
2190
2222
|
status: 200
|
|
@@ -2195,7 +2227,10 @@ function TreeMixin(Base) {
|
|
|
2195
2227
|
if (!repo.getChildren) throw createError(501, "Tree structure not implemented");
|
|
2196
2228
|
const parentField = this._presetFields.parentField ?? "parent";
|
|
2197
2229
|
const parentId = req.params[parentField] ?? req.params.parent ?? req.params.id;
|
|
2198
|
-
const options =
|
|
2230
|
+
const options = {
|
|
2231
|
+
...this.queryResolver.resolve(req, this.meta(req)),
|
|
2232
|
+
...this.tenantRepoOptions(req)
|
|
2233
|
+
};
|
|
2199
2234
|
return {
|
|
2200
2235
|
data: await repo.getChildren(parentId, options),
|
|
2201
2236
|
status: 200
|
|
@@ -2310,14 +2345,14 @@ function keepRawReply(raw) {
|
|
|
2310
2345
|
}
|
|
2311
2346
|
/** Mount custom routes (from presets or user-defined `routes`) on Fastify. */
|
|
2312
2347
|
function createCustomRoutes(fastify, routes, controller, options) {
|
|
2313
|
-
const { tag, resourceName, arcDecorator, rateLimitConfig, pluginMw, pipeline, routeGuards,
|
|
2348
|
+
const { tag, resourceName, arcDecorator, rateLimitConfig, pluginMw, pipeline, routeGuards, middlewares, fieldPermissions, onFieldWriteDenied, extensions } = options;
|
|
2314
2349
|
for (const route of routes) {
|
|
2315
2350
|
if ("raw" in route) throw new Error(`Route ${route.method} ${route.path}: \`raw\` was removed in arc 2.31 — the FIELD now carries the intent. Move the function to \`rawHandler\` (Fastify-native \`(request, reply)\`) or leave it in \`handler\` (arc pipeline, \`(ctx)\`), and delete the flag. If this route comes from a dependency, that package needs a release built against arc >=2.31.`);
|
|
2316
2351
|
const routeWithRefs = route;
|
|
2317
2352
|
const hasHandler = route.handler !== void 0 || route.rawHandler !== void 0;
|
|
2318
2353
|
const hasControllerMethod = typeof routeWithRefs.controllerMethod === "function";
|
|
2319
|
-
if (hasHandler && hasControllerMethod) throw new Error(`Route ${route.method} ${route.path}: pass either \`handler\` or \`controllerMethod\`, not both. Prefer \`
|
|
2320
|
-
if (!hasHandler && !hasControllerMethod) throw new Error(`Route ${route.method} ${route.path}: must declare
|
|
2354
|
+
if (hasHandler && hasControllerMethod) throw new Error(`Route ${route.method} ${route.path}: pass either \`handler\` or \`controllerMethod\`, not both. Prefer a function \`handler: (ctx) => controller.method(ctx)\`; \`controllerMethod\` is deprecated.`);
|
|
2355
|
+
if (!hasHandler && !hasControllerMethod) throw new Error(`Route ${route.method} ${route.path}: must declare a function \`handler\` (arc pipeline) or a function \`rawHandler\` (Fastify-native).`);
|
|
2321
2356
|
let resolvedHandler;
|
|
2322
2357
|
if (hasControllerMethod) {
|
|
2323
2358
|
if (!controller) throw new Error(`Route ${route.method} ${route.path}: \`controllerMethod\` requires a controller. Provide one via \`defineResource({ controller, … })\`, or use \`defineResource\` with an \`adapter\` so arc auto-creates a BaseController.`);
|
|
@@ -2355,9 +2390,9 @@ function createCustomRoutes(fastify, routes, controller, options) {
|
|
|
2355
2390
|
};
|
|
2356
2391
|
const customPreHandlers = resolveRoutePreHandlers(route.preHandler, fastify, `${route.method} ${route.path}`);
|
|
2357
2392
|
if (route.tenantScope === true) {
|
|
2358
|
-
if (!
|
|
2359
|
-
customPreHandlers.unshift(...tenantScopeMw);
|
|
2393
|
+
if (!middlewares.tenantScope?.length) throw new Error(`Route ${route.method} ${route.path}: \`tenantScope: true\` requires a multi-tenant preset. Add \`multiTenantPreset()\` to the resource's \`presets\`, or remove the \`tenantScope\` flag from this route.`);
|
|
2360
2394
|
}
|
|
2395
|
+
customPreHandlers.unshift(...routeTenantMiddlewares(route, middlewares));
|
|
2361
2396
|
if (!isRaw && route.fieldWrite !== false && methodCarriesBody(route.method)) {
|
|
2362
2397
|
const fieldWriteMw = buildFieldWritePreHandler(fieldPermissions, onFieldWriteDenied);
|
|
2363
2398
|
if (fieldWriteMw) customPreHandlers.push(fieldWriteMw);
|
|
@@ -2429,7 +2464,6 @@ function createCrudRouter(fastify, controller, options = {}) {
|
|
|
2429
2464
|
update: middlewares.update ?? [],
|
|
2430
2465
|
delete: middlewares.delete ?? []
|
|
2431
2466
|
};
|
|
2432
|
-
const tenantScopeMw = middlewares.tenantScope;
|
|
2433
2467
|
const idParamsSchema = {
|
|
2434
2468
|
type: "object",
|
|
2435
2469
|
properties: { id: { type: "string" } },
|
|
@@ -2521,7 +2555,7 @@ function createCrudRouter(fastify, controller, options = {}) {
|
|
|
2521
2555
|
pluginMw,
|
|
2522
2556
|
pipeline,
|
|
2523
2557
|
routeGuards,
|
|
2524
|
-
|
|
2558
|
+
middlewares,
|
|
2525
2559
|
fieldPermissions,
|
|
2526
2560
|
onFieldWriteDenied,
|
|
2527
2561
|
extensions
|
|
@@ -3216,7 +3250,7 @@ function buildResourcePlugin(resource) {
|
|
|
3216
3250
|
extensions: resource.extensions
|
|
3217
3251
|
});
|
|
3218
3252
|
if (resource.actions && Object.keys(resource.actions).length > 0) {
|
|
3219
|
-
const { createActionRouter } = await import("./createActionRouter-
|
|
3253
|
+
const { createActionRouter } = await import("./createActionRouter-DtxUXOCI.mjs").then((n) => n.n);
|
|
3220
3254
|
const actionConfig = normalizeActionsToRouterConfig(resource.actions, resource.actionPermissions, resource.tag, resource.permissions, resource.name, typedInstance.log);
|
|
3221
3255
|
const actionTarget = resolveActionTargetFence(resource, actionConfig);
|
|
3222
3256
|
createActionRouter(typedInstance, {
|
|
@@ -3237,9 +3271,9 @@ function buildResourcePlugin(resource) {
|
|
|
3237
3271
|
}
|
|
3238
3272
|
if (resource.aggregations && Object.keys(resource.aggregations).length > 0) {
|
|
3239
3273
|
const [{ createAggregationRouter }, { adapterSupportsAggregate, ArcAggregationConfigError }, { fieldTypesFromOpenApiSchemas }] = await Promise.all([
|
|
3240
|
-
import("./createAggregationRouter-
|
|
3241
|
-
import("./validate-
|
|
3242
|
-
import("./fieldTypes-
|
|
3274
|
+
import("./createAggregationRouter-BMiKyDoW.mjs"),
|
|
3275
|
+
import("./validate-BTQBh-Dr.mjs").then((n) => n.r),
|
|
3276
|
+
import("./fieldTypes-BtFpQO6I.mjs").then((n) => n.r)
|
|
3243
3277
|
]);
|
|
3244
3278
|
const repoForAgg = resource.controller?.repository ?? resource.repository;
|
|
3245
3279
|
if (!adapterSupportsAggregate(repoForAgg)) {
|
package/dist/plugins/index.d.mts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
import { t as AnyRecord } from "../base-HXNgPQww.mjs";
|
|
3
|
-
import { i as _default, n as ArcCorePluginOptions, r as PluginMeta, t as ArcCore } from "../fastify-augmentation-
|
|
3
|
+
import { i as _default, n as ArcCorePluginOptions, r as PluginMeta, t as ArcCore } from "../fastify-augmentation-DjxuSRG4.mjs";
|
|
4
4
|
import { i as registerSseStats, n as SseConnectionGauge, r as createSseConnectionGauge, t as SSEStats } from "../sseStats-DQqNN385.mjs";
|
|
5
5
|
import { _ as _default$2, a as MetricsOptions, c as RealtimeOptions, d as _default$9, f as CachingOptions, g as ShutdownState, h as GracefulShutdownOptions, i as MetricsCollector, l as _default$6, m as _default$1, n as _default$10, o as _default$4, p as CachingRule, r as MetricEntry, s as ChangeOperation, t as VersioningOptions, u as SSEOptions } from "../versioning-B07RgD27.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import { A as
|
|
6
|
+
import { W as PresetHook, Y as MiddlewareConfig, Z as RouteSchemaOptions, kt as RouteDefinition } from "../index-DtHACefu.mjs";
|
|
7
|
+
import { A as DailyClock, C as DailyScheduleOptions, D as SchedulesPluginOptions, E as ScheduleStats, F as MemoryDailyLedger, I as createDailyGate, L as createMemoryDailyLedger, M as DailyGateOptions, N as DailyLedger, O as _default$8, P as DailyRunOutcome, T as ScheduleRunContext, j as DailyGate, k as DailyClaimInfo, w as ScheduleDefinition } from "../types-CQhHTZXs.mjs";
|
|
8
8
|
import { i as errorHandlerPlugin, n as ErrorMapper, r as defaultIsDuplicateKeyError, t as ErrorHandlerOptions } from "../errorHandler-B9r88jZV.mjs";
|
|
9
|
+
import { n as HealthOptions, r as _default$3, t as HealthCheck } from "../health-skjSwNaC.mjs";
|
|
9
10
|
import { t as TracingOptions } from "../tracing-JSFiBl5r.mjs";
|
|
10
11
|
import { PaginatedResult } from "@classytic/repo-core/pagination";
|
|
11
12
|
import { FastifyInstance, FastifyPluginAsync } from "fastify";
|
package/dist/plugins/index.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { m as MUTATION_OPERATIONS } from "../constants-
|
|
3
|
-
import { n as requestContext } from "../requestContext-
|
|
4
|
-
import { t as HookSystem } from "../HookSystem-
|
|
5
|
-
import { t as ResourceRegistry } from "../ResourceRegistry-
|
|
6
|
-
import { c as getOrgId } from "../types-
|
|
7
|
-
import { t as hasEvents } from "../typeGuards-
|
|
8
|
-
import { a as registerSseStats, i as createSseConnectionGauge } from "../sseStream-
|
|
9
|
-
import { t as caching_default } from "../caching-
|
|
10
|
-
import { i as createMemoryDailyLedger, r as createDailyGate, t as schedules_default } from "../schedules-
|
|
11
|
-
import { n as errorHandlerPlugin, t as defaultIsDuplicateKeyError } from "../errorHandler-
|
|
12
|
-
import {
|
|
13
|
-
import { t as metrics_default } from "../metrics-
|
|
14
|
-
import { t as arcLog } from "../logger-
|
|
15
|
-
import { t as realtime_default } from "../realtime-
|
|
16
|
-
import { t as replyHelpersPlugin } from "../replyHelpers-
|
|
17
|
-
import { t as sse_default } from "../sse-
|
|
18
|
-
import { t as versioning_default } from "../versioning-
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
|
+
import { m as MUTATION_OPERATIONS } from "../constants-D9EiaO5s.mjs";
|
|
3
|
+
import { n as requestContext } from "../requestContext-B-TjFpWt.mjs";
|
|
4
|
+
import { t as HookSystem } from "../HookSystem-DNwxV463.mjs";
|
|
5
|
+
import { t as ResourceRegistry } from "../ResourceRegistry-Ck7RFodL.mjs";
|
|
6
|
+
import { c as getOrgId } from "../types-ZvdR7MVa.mjs";
|
|
7
|
+
import { t as hasEvents } from "../typeGuards-Cr2_zEW0.mjs";
|
|
8
|
+
import { a as registerSseStats, i as createSseConnectionGauge } from "../sseStream-BsBesrfw.mjs";
|
|
9
|
+
import { t as caching_default } from "../caching-BitJDAY0.mjs";
|
|
10
|
+
import { i as createMemoryDailyLedger, r as createDailyGate, t as schedules_default } from "../schedules-CwqC0Mp0.mjs";
|
|
11
|
+
import { n as errorHandlerPlugin, t as defaultIsDuplicateKeyError } from "../errorHandler-Ke6PGvF7.mjs";
|
|
12
|
+
import { a as health_default, n as requestId_default, r as sanitizeRequestId, t as createRequestIdGenerator } from "../requestId-ClcKoWLq.mjs";
|
|
13
|
+
import { t as metrics_default } from "../metrics-Bpgf4UL6.mjs";
|
|
14
|
+
import { t as arcLog } from "../logger-DdMS0XC_.mjs";
|
|
15
|
+
import { t as realtime_default } from "../realtime-CpYpIFsm.mjs";
|
|
16
|
+
import { t as replyHelpersPlugin } from "../replyHelpers-SiLr1wK4.mjs";
|
|
17
|
+
import { t as sse_default } from "../sse-eyb8lNuI.mjs";
|
|
18
|
+
import { t as versioning_default } from "../versioning-DiLykI6U.mjs";
|
|
19
19
|
import fp from "fastify-plugin";
|
|
20
20
|
import { performance as performance$1 } from "node:perf_hooks";
|
|
21
21
|
// src/core/arcCorePlugin.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { n as evictToSize, r as touch, t as assertCapacity } from "../boundedMap-
|
|
3
|
-
import { n as declareRuntimeCapability } from "../runtimeCapabilities-
|
|
4
|
-
import { t as hasEvents } from "../typeGuards-
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as evictToSize, r as touch, t as assertCapacity } from "../boundedMap-Ddw2yGb2.mjs";
|
|
3
|
+
import { n as declareRuntimeCapability } from "../runtimeCapabilities-DY20Pibh.mjs";
|
|
4
|
+
import { t as hasEvents } from "../typeGuards-Cr2_zEW0.mjs";
|
|
5
5
|
import fp from "fastify-plugin";
|
|
6
6
|
// src/plugins/response-cache.ts
|
|
7
7
|
/**
|