@classytic/arc 2.45.2 → 2.46.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 +1 -1
- package/dist/{EventTransport-CiicKz2Z.d.mts → EventTransport-CYEoCJGe.d.mts} +0 -2
- package/dist/{EventTransport-DHb1tpu-.mjs → EventTransport-DNgD9NP4.mjs} +3 -4
- package/dist/{HookSystem-C1u0EUnt.mjs → HookSystem-DRbPzEcP.mjs} +3 -4
- package/dist/{QueryCache--5uAuYPW.d.mts → QueryCache-DdvrGG8Q.d.mts} +1 -3
- package/dist/{ResourceRegistry-D2jXWVN_.mjs → ResourceRegistry-Douk51fa.mjs} +15 -4
- package/dist/{acquire-DTkA8Lme.mjs → acquire-RbtvDg9s.mjs} +2 -3
- package/dist/{actionPermissions-DRVk6m7x.mjs → actionPermissions-De0AJ7hm.mjs} +37 -42
- package/dist/audit/index.d.mts +2 -10
- package/dist/audit/index.mjs +8 -12
- package/dist/auth/audit.d.mts +0 -2
- package/dist/auth/audit.mjs +2 -3
- package/dist/auth/index.d.mts +9 -17
- package/dist/auth/index.mjs +26 -29
- package/dist/auth/redis-session.d.mts +2 -4
- package/dist/auth/redis-session.mjs +2 -3
- package/dist/{authorizationDecision-D48fUJv1.mjs → authorizationDecision-DeZMrHcm.mjs} +5 -6
- package/dist/{base-CZyixEQR.d.mts → base-HXNgPQww.d.mts} +1 -7
- package/dist/{boundedMap-DkKiPifd.mjs → boundedMap-2WBh3gM9.mjs} +2 -3
- package/dist/{buildHandler-BiZ4VATS.mjs → buildHandler-DxVOOBpw.mjs} +5 -6
- package/dist/cache/index.d.mts +4 -10
- package/dist/cache/index.mjs +5 -6
- package/dist/{caching-Cj0as-P1.mjs → caching-BYRwYrUo.mjs} +3 -4
- package/dist/{claimed-ChI13rUR.mjs → claimed-DYlELdnm.mjs} +2 -3
- package/dist/cleanup/index.d.mts +4 -18
- package/dist/cleanup/index.mjs +12 -20
- package/dist/cli/commands/describe.d.mts +1 -3
- package/dist/cli/commands/describe.mjs +4 -5
- package/dist/cli/commands/docs.d.mts +1 -3
- package/dist/cli/commands/docs.mjs +4 -5
- package/dist/cli/commands/doctor.d.mts +1 -3
- package/dist/cli/commands/doctor.mjs +2 -3
- package/dist/cli/commands/generate.d.mts +1 -1
- package/dist/cli/commands/generate.mjs +2 -2
- package/dist/cli/commands/init.d.mts +1 -1
- package/dist/cli/commands/init.mjs +2 -2
- package/dist/cli/commands/introspect.d.mts +1 -3
- package/dist/cli/commands/introspect.mjs +3 -4
- package/dist/cli/index.d.mts +2 -2
- package/dist/cli/index.mjs +3 -3
- package/dist/{constants-D_aiew34.mjs → constants-CHZMUwBW.mjs} +2 -3
- package/dist/context/index.d.mts +0 -8
- package/dist/context/index.mjs +6 -7
- package/dist/core/index.d.mts +3 -3
- package/dist/core/index.mjs +8 -8
- package/dist/{core-QIZ2560Y.mjs → core-D9rS2BxO.mjs} +9 -12
- package/dist/{createActionRouter-CvH84dyx.mjs → createActionRouter-0qkCRzTL.mjs} +7 -8
- package/dist/{createAggregationRouter-DGyK2Hp6.mjs → createAggregationRouter-CUf5Esd9.mjs} +9 -10
- package/dist/{createApp-CKjZpmq9.mjs → createApp-DZIXfDKD.mjs} +49 -62
- package/dist/{createMcpServer-DSztofa9.d.mts → createMcpServer-DeVpqQF-.d.mts} +1 -3
- package/dist/{defineAggregation-BLza7Ca4.mjs → defineAggregation-bmKQ4NmC.mjs} +2 -3
- package/dist/{defineResource-CEo0gDCb.mjs → defineResource-CGmdmGwh.mjs} +78 -29
- package/dist/discovery/index.d.mts +1 -3
- package/dist/discovery/index.mjs +2 -3
- package/dist/docs/index.d.mts +8 -8
- package/dist/docs/index.mjs +4 -5
- package/dist/{elevation-BJTsSnke.mjs → elevation-CzhqAyVN.mjs} +9 -10
- package/dist/{elevation-BW2J3tNj.d.mts → elevation-DPD0hcU-.d.mts} +0 -2
- package/dist/encryption/index.d.mts +1 -7
- package/dist/encryption/index.mjs +8 -13
- package/dist/{errorHandler--4rSMMvq.d.mts → errorHandler-B9r88jZV.d.mts} +8 -3
- package/dist/{errorHandler-2p4SL5zm.mjs → errorHandler-dFyGOEoB.mjs} +16 -6
- package/dist/{errors-grZkIA8N.mjs → errors-BY8vzlP4.mjs} +2 -3
- package/dist/{errors-JYc9vwqE.d.mts → errors-DTo0me1o.d.mts} +0 -2
- package/dist/{eventPlugin-BtmA4-3P.d.mts → eventPlugin-BY38F6yK.d.mts} +1 -7
- package/dist/{eventPlugin-ItcYBGUs.mjs → eventPlugin-eMhAPtQA.mjs} +10 -12
- package/dist/{eventTypes-Ck6fD3ne.mjs → eventTypes-Do2KYeJx.mjs} +5 -8
- package/dist/events/index.d.mts +4 -16
- package/dist/events/index.mjs +8 -9
- package/dist/events/transports/redis-stream-entry.d.mts +1 -1
- package/dist/events/transports/redis-stream-entry.mjs +5 -6
- package/dist/events/transports/redis.d.mts +2 -4
- package/dist/events/transports/redis.mjs +3 -4
- package/dist/{externalPaths-CmGOxOtD.d.mts → externalPaths-BOqdq5wr.d.mts} +0 -2
- package/dist/factory/index.d.mts +4 -14
- package/dist/factory/index.mjs +12 -18
- package/dist/{fastify-augmentation-DRlCIWE9.d.mts → fastify-augmentation-Dtn0IIRn.d.mts} +4 -10
- package/dist/{fields-BBSpf8pS.d.mts → fields-JTkrtO-r.d.mts} +0 -2
- package/dist/{fields-BRX0Krcj.mjs → fields-LnbCcvsw.mjs} +2 -3
- package/dist/{filter-merge-CDc7YMwX.mjs → filter-merge-BAWi019Q.mjs} +2 -3
- package/dist/{generate-DCGuEbqI.d.mts → generate-C-g_KOkV.d.mts} +0 -4
- package/dist/{generate-hvg7V2g1.mjs → generate-oXoDnpJf.mjs} +7 -12
- package/dist/{headers-Cqkg4LzI.mjs → headers-DBd3Qheo.mjs} +3 -4
- package/dist/{health-PVt0VjOx.mjs → health-BlJu9GXS.mjs} +2 -3
- package/dist/{health-DyeP3mTW.mjs → health-Dp-3EC9o.mjs} +4 -7
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/idempotency/index.d.mts +3 -9
- package/dist/idempotency/index.mjs +10 -13
- package/dist/idempotency/redis.d.mts +1 -1
- package/dist/idempotency/redis.mjs +3 -4
- package/dist/{index-Bxriq3so.d.mts → index-B5i9-vuP.d.mts} +4 -26
- package/dist/{index-Chgz3d0i.d.mts → index-BAXDo5eE.d.mts} +1 -7
- package/dist/{index-Beg3aNnK.d.mts → index-BTxzJ_MN.d.mts} +67 -25
- package/dist/{index-CUJvoyw3.d.mts → index-Bqfo8hLz.d.mts} +2 -24
- package/dist/{index-uhkUA5-U.d.mts → index-CUdaoCYt.d.mts} +13 -23
- package/dist/{index-WH7xgvxS.d.mts → index-DyJFTJLA.d.mts} +31 -92
- package/dist/index.d.mts +7 -9
- package/dist/index.mjs +12 -13
- package/dist/{init-jC3rMPzb.mjs → init-BOaNkLYb.mjs} +18 -35
- package/dist/{init-Cscs4lab.d.mts → init-CV2_Fw3H.d.mts} +0 -4
- package/dist/integrations/event-gateway.d.mts +3 -5
- package/dist/integrations/event-gateway.mjs +3 -4
- package/dist/integrations/index.d.mts +3 -3
- package/dist/integrations/index.mjs +1 -1
- package/dist/integrations/jobs/index.d.mts +1 -1
- package/dist/integrations/jobs/index.mjs +7 -11
- package/dist/integrations/mcp/index.d.mts +7 -39
- package/dist/integrations/mcp/index.mjs +8 -14
- package/dist/integrations/mcp/testing.d.mts +3 -5
- package/dist/integrations/mcp/testing.mjs +3 -4
- package/dist/integrations/streamline.d.mts +1 -3
- package/dist/integrations/streamline.mjs +4 -5
- package/dist/integrations/webhooks.d.mts +2 -4
- package/dist/integrations/webhooks.mjs +4 -5
- package/dist/integrations/websocket-pushref-redis.d.mts +2 -4
- package/dist/integrations/websocket-pushref-redis.mjs +2 -3
- package/dist/integrations/websocket-redis.d.mts +2 -4
- package/dist/integrations/websocket-redis.mjs +2 -3
- package/dist/integrations/websocket.d.mts +2 -2
- package/dist/integrations/websocket.mjs +13 -24
- package/dist/{interface-JJzwH4Ro.d.mts → interface-BmExzQRD.d.mts} +0 -2
- package/dist/{interface-BOk3YnTz.d.mts → interface-WR1U0K7t.d.mts} +0 -2
- package/dist/{jsonBody-ptwyzZQ-.mjs → jsonBody-DpRpKR_K.mjs} +3 -4
- package/dist/{keys-C1vFuSbv.mjs → keys-FBz6Ull-.mjs} +2 -3
- package/dist/{loadResources-CHPDyIPn.mjs → loadResources-Bx1sKPnF.mjs} +4 -5
- package/dist/{loadResourcesFromEntry-BkHHTu_B.mjs → loadResourcesFromEntry-b_jcqbxh.mjs} +3 -4
- package/dist/logger/index.d.mts +1 -3
- package/dist/logger/index.mjs +2 -2
- package/dist/{logger-C5bvCiAK.mjs → logger-CbFcIEBZ.mjs} +3 -5
- package/dist/{mcpPlugin-C9qohJCF.mjs → mcpPlugin-yix548XX.mjs} +41 -60
- package/dist/{memory-CxiTwT0j.mjs → memory-Bgw5dn8N.mjs} +4 -5
- package/dist/{metrics-Ckp2zRy-.mjs → metrics-CZDQWVjS.mjs} +4 -5
- package/dist/middleware/index.d.mts +1 -5
- package/dist/middleware/index.mjs +4 -5
- package/dist/migrations/index.d.mts +0 -2
- package/dist/migrations/index.mjs +3 -4
- package/dist/{module-CfnKuIuH.mjs → module-Dsc_nKL5.mjs} +2 -3
- package/dist/{multiTenant-CAtYlW6H.d.mts → multiTenant-XCxAUlru.d.mts} +1 -5
- package/dist/{multipartBody-BFasGtP9.mjs → multipartBody-B85ek8Kj.mjs} +2 -3
- package/dist/observeSend-BK-JN1jK.mjs +20 -0
- package/dist/{openapi-DAPxjYHX.mjs → openapi-Co7hl073.mjs} +18 -28
- package/dist/outbox-admin/index.d.mts +2 -4
- package/dist/outbox-admin/index.mjs +6 -7
- package/dist/{outbox-module-gZCHoE4H.d.mts → outbox-module-XvUThpqn.d.mts} +2 -8
- package/dist/{outbox-module-B4FAkx3A.mjs → outbox-module-mg9kDYkd.mjs} +13 -17
- package/dist/permissions/index.d.mts +4 -4
- package/dist/permissions/index.mjs +7 -7
- package/dist/{permissions-B14c3OMp.mjs → permissions-A1oKtpiC.mjs} +19 -29
- package/dist/{pipe-CQv7PsAK.mjs → pipe-Czpw9U2n.mjs} +3 -4
- package/dist/pipeline/index.d.mts +1 -9
- package/dist/pipeline/index.mjs +5 -8
- package/dist/{plan-CpnTykjb.mjs → plan-KVseuBCL.mjs} +5 -9
- package/dist/{plugin-DXTjVg_Q.mjs → plugin-DTWt_8C3.mjs} +130 -62
- package/dist/plugins/index.d.mts +8 -16
- package/dist/plugins/index.mjs +22 -26
- package/dist/plugins/response-cache.d.mts +2 -4
- package/dist/plugins/response-cache.mjs +10 -10
- package/dist/plugins/tracing-entry.d.mts +1 -1
- package/dist/plugins/tracing-entry.mjs +3 -4
- package/dist/{pluralize-C3VJKRGp.mjs → pluralize-msB9X3yw.mjs} +2 -3
- package/dist/presets/filesUpload.d.mts +4 -6
- package/dist/presets/filesUpload.mjs +6 -7
- package/dist/presets/index.d.mts +3 -19
- package/dist/presets/index.mjs +2 -2
- package/dist/presets/multiTenant.d.mts +1 -1
- package/dist/presets/multiTenant.mjs +7 -7
- package/dist/presets/search.d.mts +3 -5
- package/dist/presets/search.mjs +3 -4
- package/dist/{presets-CquqYJPy.mjs → presets-qKCehiJM.mjs} +11 -18
- package/dist/{projection-CgfSLOSM.mjs → projection-ClBqtsIw.mjs} +3 -4
- package/dist/{pushref-registry-UxCkoA4C.d.mts → pushref-registry-d86QUaSq.d.mts} +0 -6
- package/dist/{queryCachePlugin-D0HUISHJ.mjs → queryCachePlugin-3gJj5Rbz.mjs} +8 -10
- package/dist/{queryCachePlugin-C2lZjTxk.d.mts → queryCachePlugin-DYQUyeJ9.d.mts} +2 -4
- package/dist/{rateLimitKey-AvkBOMkl.mjs → rateLimitKey-Kro---xl.mjs} +2 -3
- package/dist/{realtime-CbWtVbqK.mjs → realtime-Ber8uJN2.mjs} +17 -19
- package/dist/{redis-BDgv9Glw.d.mts → redis-RpDMemdm.d.mts} +2 -4
- package/dist/{redis-stream-BMk-bpQS.d.mts → redis-stream-CS1N9dwM.d.mts} +1 -3
- package/dist/{redisShapes-CQksY67q.d.mts → redisShapes-CqBXTn_s.d.mts} +0 -2
- package/dist/registry/index.d.mts +2 -12
- package/dist/registry/index.mjs +3 -3
- package/dist/{registry-BVwpAuFI.mjs → registry-BA-_vFYk.mjs} +7 -12
- package/dist/{renewingLease-CykpeNcQ.mjs → renewingLease-CMY8YOcc.mjs} +2 -3
- package/dist/{replyHelpers-DA51IZio.mjs → replyHelpers-DK9P_XSz.mjs} +3 -4
- package/dist/{requestContext-DIWHKDtQ.mjs → requestContext-GYO_0gEw.mjs} +2 -3
- package/dist/{requirement-CbiLdQ1n.d.mts → requirement-CTRQjjQx.d.mts} +0 -2
- package/dist/{requirement-Cp_fsMDL.mjs → requirement-DeNjZIH3.mjs} +2 -3
- package/dist/{resourceRateLimit-Wf6d6FL9.d.mts → resourceRateLimit-DCWglD7V.d.mts} +1 -3
- package/dist/{resourceRateLimit-BFuluodF.mjs → resourceRateLimit-tHLbrtWc.mjs} +3 -4
- package/dist/{rolldown-runtime-D_lMdYOd.mjs → rolldown-runtime-Kv1fZdLg.mjs} +2 -3
- package/dist/{routeValidator-DuLonYwr.mjs → routeValidator-C_H5NanI.mjs} +2 -3
- package/dist/{runtimeCapabilities-CydRfm0i.mjs → runtimeCapabilities-DWqbxkyw.mjs} +2 -3
- package/dist/{schedules-B693KXxa.mjs → schedules-eO_RzhCU.mjs} +132 -9
- package/dist/{schemaConverter-DNvZWTV6.mjs → schemaConverter-DBJrPZN4.mjs} +3 -4
- package/dist/{schemaIR-REV2y7Wd.mjs → schemaIR-CEScKT2v.mjs} +3 -4
- package/dist/schemas/index.d.mts +0 -2
- package/dist/schemas/index.mjs +2 -3
- package/dist/scim/index.d.mts +0 -12
- package/dist/scim/index.mjs +10 -18
- package/dist/scope/index.d.mts +2 -6
- package/dist/scope/index.mjs +5 -5
- package/dist/{scope-Bevxy_ST.mjs → scope-B-Sm9m_E.mjs} +5 -6
- package/dist/{sessionManager-qimlKV0P.d.mts → sessionManager-CdvDF04x.d.mts} +2 -4
- package/dist/{shutdown-CfrqPR7A.mjs → shutdown-DzLFbe27.mjs} +2 -3
- package/dist/{simpleEqualityMatcher-BJwfuRKP.mjs → simpleEqualityMatcher-DOJhwQ8g.mjs} +2 -3
- package/dist/{sse-CuNNWr2z.mjs → sse-2972pVwV.mjs} +8 -9
- package/dist/{sseStream-C_2ujAVY.mjs → sseStream-AWLEeNV-.mjs} +3 -4
- package/dist/{storage-Cx9Sz3Ou.d.mts → storage-odC5MNKN.d.mts} +0 -2
- package/dist/{store-helpers-C8uBGCbb.mjs → store-helpers-VzjgVTkM.mjs} +2 -3
- package/dist/{streaming-Bdq_M4d5.mjs → streaming-DvraWW6x.mjs} +2 -3
- package/dist/{subscriberIdentity-B-KpZkdl.mjs → subscriberIdentity-Bya56jsg.mjs} +2 -3
- package/dist/{tenancy-C5PCvm1h.mjs → tenancy-DSa_0hhw.mjs} +3 -4
- package/dist/{tenantPreparation-dYvWrgNa.mjs → tenantPreparation-BrpkQre3.mjs} +5 -6
- package/dist/testing/cleanupStoreContract.d.mts +2 -4
- package/dist/testing/cleanupStoreContract.mjs +2 -3
- package/dist/testing/index.d.mts +6 -32
- package/dist/testing/index.mjs +24 -37
- package/dist/testing/outboxStoreContract.d.mts +1 -3
- package/dist/testing/outboxStoreContract.mjs +3 -4
- package/dist/testing/requiredPorts.d.mts +2 -4
- package/dist/testing/requiredPorts.mjs +3 -4
- package/dist/testing/storageContract.d.mts +2 -4
- package/dist/testing/storageContract.mjs +2 -3
- package/dist/{timing-DCqsezX8.mjs → timing-6rQTuCwg.mjs} +3 -5
- package/dist/{tracing-Dro5eH6j.d.mts → tracing-JSFiBl5r.d.mts} +0 -2
- package/dist/{transactionContext-DrcNyjpv.mjs → transactionContext-DaxYUEgH.mjs} +2 -3
- package/dist/{typeGuards-CEl10KPy.mjs → typeGuards-UKnX8wPX.mjs} +2 -3
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.mjs +1 -1
- package/dist/types/storage.d.mts +1 -1
- package/dist/types/storage.mjs +1 -1
- package/dist/{types-ByHn9rEO.d.mts → types-0Dqlbgn8.d.mts} +0 -2
- package/dist/{types-D3Ixsh00.d.mts → types-BYEb_dLW.d.mts} +2 -4
- package/dist/{types-BJ-2XqVF.d.mts → types-BeEJm-DV.d.mts} +114 -14
- package/dist/{types-DVLddu2q.d.mts → types-C0YJAiL0.d.mts} +0 -2
- package/dist/{types-D9NWjpYc.mjs → types-CuGjhn83.mjs} +5 -6
- package/dist/{types-Ddl9OjmE.d.mts → types-DnkIALZ8.d.mts} +0 -4
- package/dist/usage/index.d.mts +2 -10
- package/dist/usage/index.mjs +8 -12
- package/dist/{userHelpers-BHig1kHq.mjs → userHelpers-oX5_mOVs.mjs} +2 -3
- package/dist/utils/index.d.mts +5 -39
- package/dist/utils/index.mjs +12 -12
- package/dist/{utils-BG5P7_Vb.mjs → utils-CjjGOT4E.mjs} +20 -30
- package/dist/{validate-D_mdOCir.mjs → validate-4RlTKOJb.mjs} +5 -7
- package/dist/{versioning-DBGHjPh7.mjs → versioning-Dk2-19La.mjs} +4 -5
- package/dist/{versioning-Bqm_57Qt.d.mts → versioning-S18y2-0C.d.mts} +1 -15
- package/dist/{websocket-Cs4awVyD.d.mts → websocket-BGuc-WVZ.d.mts} +1 -15
- package/dist/{workScope-DPPfM4m6.mjs → workScope-DoBsoVo4.mjs} +3 -4
- package/llms.txt +37 -30
- package/package.json +9 -8
- package/skills/arc/SKILL.md +65 -844
- package/skills/arc/references/agent-auth.md +82 -193
- package/skills/arc/references/api-reference.md +41 -245
- package/skills/arc/references/auth-api-keys.md +99 -0
- package/skills/arc/references/auth-better-auth-overlay.md +87 -0
- package/skills/arc/references/auth-better-auth.md +78 -0
- package/skills/arc/references/auth-permissions.md +100 -0
- package/skills/arc/references/auth-strategies.md +122 -0
- package/skills/arc/references/boot.md +80 -0
- package/skills/arc/references/enterprise-auth.md +65 -81
- package/skills/arc/references/events-outbox.md +90 -0
- package/skills/arc/references/events.md +75 -440
- package/skills/arc/references/integrations-jobs.md +74 -0
- package/skills/arc/references/integrations-realtime.md +84 -0
- package/skills/arc/references/integrations-webhooks.md +71 -0
- package/skills/arc/references/integrations-workflows.md +47 -0
- package/skills/arc/references/mcp-auth.md +83 -0
- package/skills/arc/references/mcp-custom-tools.md +125 -0
- package/skills/arc/references/mcp-setup.md +115 -0
- package/skills/arc/references/mcp-testing.md +63 -0
- package/skills/arc/references/multi-tenancy.md +56 -230
- package/skills/arc/references/permissions-scope.md +81 -0
- package/skills/arc/references/production-api.md +119 -0
- package/skills/arc/references/production-audit.md +101 -0
- package/skills/arc/references/production-boot.md +91 -0
- package/skills/arc/references/production-caching.md +63 -0
- package/skills/arc/references/production-distributed.md +75 -0
- package/skills/arc/references/production-idempotency.md +83 -0
- package/skills/arc/references/production-observability.md +83 -0
- package/skills/arc/references/production-realtime.md +70 -0
- package/skills/arc/references/production-reliability.md +100 -0
- package/skills/arc/references/production-shutdown.md +43 -0
- package/skills/arc/references/querying.md +76 -0
- package/skills/arc/references/resources.md +97 -0
- package/skills/arc/references/schedules.md +79 -0
- package/skills/arc/references/scim.md +61 -208
- package/skills/arc/references/tenancy-scope-install.md +82 -0
- package/skills/arc/references/testing.md +101 -144
- package/skills/arc/references/usage-cleanup-capabilities.md +45 -0
- package/skills/arc/references/validation.md +91 -0
- package/skills/arc/references/writes-hooks-errors.md +80 -0
- package/skills/arc-code-review/SKILL.md +67 -114
- package/skills/arc-code-review/references/arc-cheatsheet.md +68 -167
- package/skills/arc-code-review/references/mongokit-repositories.md +104 -0
- package/skills/arc-code-review/references/recipe-events-cache-jobs.md +112 -0
- package/skills/arc-code-review/references/recipe-resource.md +100 -0
- package/skills/arc-code-review/references/recipe-schemas-fields.md +93 -0
- package/skills/arc-code-review/references/recipe-scope-permissions.md +82 -0
- package/skills/arc-code-review/references/scaffolding.md +61 -198
- package/skills/arc-code-review/references/severity.md +49 -102
- package/skills/arc-code-review/references/smells-auth-scope.md +80 -0
- package/skills/arc-code-review/references/smells-data-events.md +66 -0
- package/skills/arc-code-review/references/smells-imports-style.md +59 -0
- package/skills/arc-code-review/references/smells-platform.md +89 -0
- package/skills/arc-code-review/references/smells-routes-schemas.md +66 -0
- package/skills/arc-module-publishing/SKILL.md +82 -208
- package/skills/arc-module-publishing/references/action-presets-and-plugins.md +87 -0
- package/skills/arc-module-publishing/references/build-and-types.md +73 -0
- package/skills/arc-module-publishing/references/module-lifecycle.md +101 -0
- package/skills/arc-module-publishing/references/package-manifest.md +34 -122
- package/skills/arc-module-publishing/references/publishing-workflow.md +44 -140
- package/skills/arc-module-publishing/references/resource-assembly.md +102 -0
- package/skills/arc-module-publishing/references/testing-packages.md +82 -0
- package/skills/arc/references/auth.md +0 -729
- package/skills/arc/references/integrations.md +0 -452
- package/skills/arc/references/mcp.md +0 -691
- package/skills/arc/references/production.md +0 -835
- package/skills/arc-code-review/references/anti-patterns.md +0 -1008
- package/skills/arc-code-review/references/migration-recipes.md +0 -649
- package/skills/arc-code-review/references/mongokit-migration.md +0 -360
- package/skills/arc-module-publishing/references/authoring-modules.md +0 -327
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
|
|
2
2
|
import { createEventRouter, matchEventPattern } from "@classytic/primitives/events";
|
|
3
|
-
|
|
3
|
+
// src/factory/module/graph.ts
|
|
4
4
|
/**
|
|
5
5
|
* The module graph — which modules are active, which events each OWNS, which it consumes — and
|
|
6
6
|
* the boot-time checks that keep it honest.
|
|
@@ -288,8 +288,7 @@ function eventTopology(graph, analysis = analyzeModuleGraph(graph)) {
|
|
|
288
288
|
layers: layers.filter(Boolean).map((layer) => layer.sort())
|
|
289
289
|
};
|
|
290
290
|
}
|
|
291
|
-
|
|
292
|
-
//#region src/factory/module/resolve.ts
|
|
291
|
+
// src/factory/module/resolve.ts
|
|
293
292
|
function isLazyBridge(input) {
|
|
294
293
|
return typeof input === "object" && input !== null && !(input instanceof Promise) && typeof input.load === "function";
|
|
295
294
|
}
|
|
@@ -369,8 +368,7 @@ async function resolveModuleArm(module, arm, contribution, fastify) {
|
|
|
369
368
|
if (!Array.isArray(resolved)) throw new TypeError(`[arc] module "${module.name}" ${arm} factory must return an array — received ${resolved === null ? "null" : typeof resolved}.`);
|
|
370
369
|
return resolved;
|
|
371
370
|
}
|
|
372
|
-
|
|
373
|
-
//#region src/factory/module/order.ts
|
|
371
|
+
// src/factory/module/order.ts
|
|
374
372
|
/**
|
|
375
373
|
* Order modules for composition — a STABLE topological sort. Every later phase
|
|
376
374
|
* (bootstrap, resources, afterResources, reverse-order onClose) iterates the
|
|
@@ -462,8 +460,7 @@ function describeModuleCycle(remaining, edges) {
|
|
|
462
460
|
}
|
|
463
461
|
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.`;
|
|
464
462
|
}
|
|
465
|
-
|
|
466
|
-
//#region src/factory/module/plan.ts
|
|
463
|
+
// src/factory/module/plan.ts
|
|
467
464
|
/** A port counts as supplied when it is an own key whose value is neither `undefined` nor `null`. */
|
|
468
465
|
function isSupplied(ports, name) {
|
|
469
466
|
return Object.hasOwn(ports, name) && ports[name] !== void 0 && ports[name] !== null;
|
|
@@ -561,5 +558,4 @@ function resolveModuleClosure(modules, roots) {
|
|
|
561
558
|
for (const m of modules) if (m.kind === "platform") visit(m.name, void 0);
|
|
562
559
|
return modules.filter((m) => included.has(m.name));
|
|
563
560
|
}
|
|
564
|
-
//#endregion
|
|
565
561
|
export { dependentsOf as _, portsForModule as a, verifyEventDurability as b, declareModules as c, resolveModule as d, resolveModuleArm as f, crudEventsOf as g, buildModuleGraph as h, planModules as i, isLazyBridge as l, analyzeModuleGraph as m, composeModules as n, resolveModuleClosure as o, activateBridges as p, compositionProblems as r, orderModules as s, assertComposable as t, resolveContribution as u, eventTopology as v, verifyModuleGraph as x, renderModuleGraph as y };
|
|
@@ -1,29 +1,29 @@
|
|
|
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.46.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-CHZMUwBW.mjs";
|
|
3
|
+
import { t as arcLog } from "./logger-CbFcIEBZ.mjs";
|
|
4
|
+
import { t as conjoinPolicyFilters } from "./filter-merge-BAWi019Q.mjs";
|
|
5
|
+
import { d as createDomainError, f as createError, i as NotFoundError, p as isArcError, r as ForbiddenError, u as ValidationError } from "./errors-BY8vzlP4.mjs";
|
|
6
|
+
import { t as simpleEqualityMatcher } from "./simpleEqualityMatcher-DOJhwQ8g.mjs";
|
|
7
|
+
import { n as requireSingleHeaderValue } from "./headers-DBd3Qheo.mjs";
|
|
8
|
+
import { n as getUserRoles, t as getUserId } from "./userHelpers-oX5_mOVs.mjs";
|
|
9
|
+
import { b as isElevated, c as getOrgId, n as PUBLIC_SCOPE, x as isMember } from "./types-CuGjhn83.mjs";
|
|
10
|
+
import { r as resolveTenancy } from "./tenancy-DSa_0hhw.mjs";
|
|
11
|
+
import { t as buildQueryKey } from "./keys-FBz6Ull-.mjs";
|
|
12
|
+
import { t as transactionContext } from "./transactionContext-DaxYUEgH.mjs";
|
|
13
|
+
import { a as resolveEffectiveRoles, n as applyFieldWritePermissions } from "./fields-LnbCcvsw.mjs";
|
|
14
|
+
import { E as ArcQueryParser, v as getDefaultCrudSchemas } from "./utils-CjjGOT4E.mjs";
|
|
15
|
+
import { n as convertRouteSchema, r as ensureSchemaConverter, t as convertOpenApiSchemas } from "./schemaConverter-DBJrPZN4.mjs";
|
|
16
|
+
import { i as pipeUIMessageStreamToReply, r as isReadableStream } from "./streaming-DvraWW6x.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-De0AJ7hm.mjs";
|
|
18
|
+
import { a as withoutTenantInjection } from "./tenantPreparation-BrpkQre3.mjs";
|
|
19
|
+
import { t as hasEvents } from "./typeGuards-UKnX8wPX.mjs";
|
|
20
|
+
import { n as idempotencyConfigProblem } from "./requirement-DeNjZIH3.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";
|
|
24
24
|
import { scheduleBackground } from "@classytic/repo-core/cache";
|
|
25
25
|
import { isProductionEnv, readEnv } from "@classytic/primitives/environment";
|
|
26
|
-
|
|
26
|
+
// src/core/repositoryFilter.ts
|
|
27
27
|
const NATIVE_FILTER_DIALECT = Symbol.for("@classytic/arc/native-filter-dialect");
|
|
28
28
|
/**
|
|
29
29
|
* Mark a server-owned policy as intentionally adapter-native. This is an
|
|
@@ -96,8 +96,7 @@ function toRepositoryFilter(record) {
|
|
|
96
96
|
return record;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
|
|
100
|
-
//#region src/core/AccessControl.ts
|
|
99
|
+
// src/core/AccessControl.ts
|
|
101
100
|
const log$1 = arcLog("access-control");
|
|
102
101
|
var AccessControl = class {
|
|
103
102
|
tenantField;
|
|
@@ -329,8 +328,7 @@ var AccessControl = class {
|
|
|
329
328
|
return req.metadata;
|
|
330
329
|
}
|
|
331
330
|
};
|
|
332
|
-
|
|
333
|
-
//#region src/core/BodySanitizer.ts
|
|
331
|
+
// src/core/BodySanitizer.ts
|
|
334
332
|
/**
|
|
335
333
|
* BodySanitizer - Composable body sanitization logic extracted from BaseController.
|
|
336
334
|
*
|
|
@@ -390,8 +388,7 @@ var BodySanitizer = class {
|
|
|
390
388
|
return sanitized;
|
|
391
389
|
}
|
|
392
390
|
};
|
|
393
|
-
|
|
394
|
-
//#region src/core/crud/requestPipeline.ts
|
|
391
|
+
// src/core/crud/requestPipeline.ts
|
|
395
392
|
/**
|
|
396
393
|
* Build the canonical repo-options bag from the Fastify request.
|
|
397
394
|
*
|
|
@@ -650,8 +647,7 @@ async function executeAfterHook(ctx, op, data, meta) {
|
|
|
650
647
|
...meta ? { meta } : {}
|
|
651
648
|
});
|
|
652
649
|
}
|
|
653
|
-
|
|
654
|
-
//#region src/utils/repoFeature.ts
|
|
650
|
+
// src/utils/repoFeature.ts
|
|
655
651
|
/**
|
|
656
652
|
* Repository feature-detection helper for arc mixins.
|
|
657
653
|
*
|
|
@@ -689,8 +685,7 @@ async function executeAfterHook(ctx, op, data, meta) {
|
|
|
689
685
|
function withRepoFeatures(repo) {
|
|
690
686
|
return repo;
|
|
691
687
|
}
|
|
692
|
-
|
|
693
|
-
//#region src/core/crud/resourceVerbs.ts
|
|
688
|
+
// src/core/crud/resourceVerbs.ts
|
|
694
689
|
const isTruthyFlag = (value) => value !== void 0 && value !== "" && value !== "false" && value !== false;
|
|
695
690
|
/**
|
|
696
691
|
* Match a request query against the resource-dispatch verbs. Returns
|
|
@@ -745,8 +740,7 @@ async function runExistsVerb(repository, resolveScope) {
|
|
|
745
740
|
const { filter, options } = resolveScope();
|
|
746
741
|
return await repo.exists(filter, options);
|
|
747
742
|
}
|
|
748
|
-
|
|
749
|
-
//#region src/core/fieldRulePredicates.ts
|
|
743
|
+
// src/core/fieldRulePredicates.ts
|
|
750
744
|
/**
|
|
751
745
|
* True when the field is allowed to appear in client-readable surfaces
|
|
752
746
|
* (response payloads, `select=` whitelists, `_distinct` queries).
|
|
@@ -790,8 +784,7 @@ function collectReadBlockedFields(schemaOptions) {
|
|
|
790
784
|
}
|
|
791
785
|
return blocked.size > 0 ? blocked : null;
|
|
792
786
|
}
|
|
793
|
-
|
|
794
|
-
//#region src/core/QueryResolver.ts
|
|
787
|
+
// src/core/QueryResolver.ts
|
|
795
788
|
/**
|
|
796
789
|
* QueryResolver - Composable query resolution logic extracted from BaseController.
|
|
797
790
|
*
|
|
@@ -1142,8 +1135,7 @@ function readKeysetControls(query) {
|
|
|
1142
1135
|
...typeof before === "string" ? { before } : {}
|
|
1143
1136
|
};
|
|
1144
1137
|
}
|
|
1145
|
-
|
|
1146
|
-
//#region src/core/BaseCrudController.ts
|
|
1138
|
+
// src/core/BaseCrudController.ts
|
|
1147
1139
|
/**
|
|
1148
1140
|
* Framework-agnostic CRUD controller implementing IController.
|
|
1149
1141
|
* Composes AccessControl, BodySanitizer, and QueryResolver.
|
|
@@ -1880,8 +1872,7 @@ var BaseCrudController = class {
|
|
|
1880
1872
|
* A duck-typed `configure()` is not proof that `writes` is dispatched.
|
|
1881
1873
|
*/
|
|
1882
1874
|
markWriteVerbCapable(BaseCrudController.prototype);
|
|
1883
|
-
|
|
1884
|
-
//#region src/core/mixins/bulk.ts
|
|
1875
|
+
// src/core/mixins/bulk.ts
|
|
1885
1876
|
/**
|
|
1886
1877
|
* BulkMixin — `bulkCreate` / `bulkUpdate` / `bulkDelete` endpoints.
|
|
1887
1878
|
*
|
|
@@ -2081,8 +2072,7 @@ function BulkMixin(Base) {
|
|
|
2081
2072
|
}
|
|
2082
2073
|
};
|
|
2083
2074
|
}
|
|
2084
|
-
|
|
2085
|
-
//#region src/core/mixins/slug.ts
|
|
2075
|
+
// src/core/mixins/slug.ts
|
|
2086
2076
|
function SlugMixin(Base) {
|
|
2087
2077
|
return class SlugController extends Base {
|
|
2088
2078
|
async getBySlug(req) {
|
|
@@ -2119,8 +2109,7 @@ function SlugMixin(Base) {
|
|
|
2119
2109
|
}
|
|
2120
2110
|
};
|
|
2121
2111
|
}
|
|
2122
|
-
|
|
2123
|
-
//#region src/core/mixins/softDelete.ts
|
|
2112
|
+
// src/core/mixins/softDelete.ts
|
|
2124
2113
|
function SoftDeleteMixin(Base) {
|
|
2125
2114
|
return class SoftDeleteController extends Base {
|
|
2126
2115
|
async getDeleted(req) {
|
|
@@ -2180,8 +2169,7 @@ function SoftDeleteMixin(Base) {
|
|
|
2180
2169
|
}
|
|
2181
2170
|
};
|
|
2182
2171
|
}
|
|
2183
|
-
|
|
2184
|
-
//#region src/core/mixins/tree.ts
|
|
2172
|
+
// src/core/mixins/tree.ts
|
|
2185
2173
|
function TreeMixin(Base) {
|
|
2186
2174
|
return class TreeController extends Base {
|
|
2187
2175
|
async getTree(req) {
|
|
@@ -2206,15 +2194,13 @@ function TreeMixin(Base) {
|
|
|
2206
2194
|
}
|
|
2207
2195
|
};
|
|
2208
2196
|
}
|
|
2209
|
-
|
|
2210
|
-
//#region src/core/BaseController.ts
|
|
2197
|
+
// src/core/BaseController.ts
|
|
2211
2198
|
/**
|
|
2212
2199
|
* Fully-composed controller: `BaseCrudController` + SoftDelete + Tree +
|
|
2213
2200
|
* Slug + Bulk. The companion interface above types every method over `TDoc`.
|
|
2214
2201
|
*/
|
|
2215
2202
|
var BaseController = class extends SoftDeleteMixin(TreeMixin(SlugMixin(BulkMixin(BaseCrudController)))) {};
|
|
2216
|
-
|
|
2217
|
-
//#region src/core/middlewares/fieldWrite.ts
|
|
2203
|
+
// src/core/middlewares/fieldWrite.ts
|
|
2218
2204
|
/**
|
|
2219
2205
|
* Build a preHandler that enforces field-write permissions on the request body.
|
|
2220
2206
|
*
|
|
@@ -2255,8 +2241,7 @@ function methodCarriesBody(method) {
|
|
|
2255
2241
|
const m = method.toUpperCase();
|
|
2256
2242
|
return m === "POST" || m === "PUT" || m === "PATCH";
|
|
2257
2243
|
}
|
|
2258
|
-
|
|
2259
|
-
//#region src/core/createCrudRouter.ts
|
|
2244
|
+
// src/core/createCrudRouter.ts
|
|
2260
2245
|
/**
|
|
2261
2246
|
* Fold a route's host-supplied `config` together with arc's derived one into the
|
|
2262
2247
|
* SINGLE `config` key Fastify reads. Returns arc's object untouched when the host
|
|
@@ -2529,8 +2514,7 @@ function buildCrudHandlers(ctrl, pipeline, resourceName) {
|
|
|
2529
2514
|
function createPermissionMiddleware(permission, resourceName, action) {
|
|
2530
2515
|
return buildCrudPermissionMw(permission, resourceName, action);
|
|
2531
2516
|
}
|
|
2532
|
-
|
|
2533
|
-
//#region src/core/schemaOptions.ts
|
|
2517
|
+
// src/core/schemaOptions.ts
|
|
2534
2518
|
/**
|
|
2535
2519
|
* Inject the tenant-scoping field rule into `schemaOptions.fieldRules`:
|
|
2536
2520
|
*
|
|
@@ -2631,8 +2615,94 @@ function stripSystemManagedFromBodyRequired(schemas, schemaOptions) {
|
|
|
2631
2615
|
if (updateBody !== schemas.updateBody) next.updateBody = updateBody;
|
|
2632
2616
|
return next;
|
|
2633
2617
|
}
|
|
2634
|
-
|
|
2635
|
-
|
|
2618
|
+
// src/core/routeInput.ts
|
|
2619
|
+
function isParseable(schema) {
|
|
2620
|
+
return typeof schema === "object" && schema !== null && typeof schema.safeParse === "function";
|
|
2621
|
+
}
|
|
2622
|
+
/** Parse `value` with `schema`; zod issues become one `ValidationError` (400, `details[]`). */
|
|
2623
|
+
function parseOrThrow(schema, value) {
|
|
2624
|
+
const result = schema.safeParse(value);
|
|
2625
|
+
if (result.success) return result.data;
|
|
2626
|
+
throw new ValidationError("Validation failed", (result.error?.issues ?? []).map((issue) => ({
|
|
2627
|
+
field: issue.path.map(String).join("."),
|
|
2628
|
+
message: issue.message
|
|
2629
|
+
})));
|
|
2630
|
+
}
|
|
2631
|
+
/**
|
|
2632
|
+
* Spread into a route entry: `{ method, path, permissions, ...routeInput({ body }), handler }`.
|
|
2633
|
+
* `preHandler` is empty when no zod body/querystring/params slot is declared.
|
|
2634
|
+
*/
|
|
2635
|
+
function routeInput(slots) {
|
|
2636
|
+
const { body, querystring, params } = slots;
|
|
2637
|
+
const parseBody = isParseable(body) ? body : void 0;
|
|
2638
|
+
const parseQuery = isParseable(querystring) ? querystring : void 0;
|
|
2639
|
+
const parseParams = isParseable(params) ? params : void 0;
|
|
2640
|
+
if (!parseBody && !parseQuery && !parseParams) return {
|
|
2641
|
+
schema: slots,
|
|
2642
|
+
preHandler: []
|
|
2643
|
+
};
|
|
2644
|
+
const parse = async (request) => {
|
|
2645
|
+
if (parseParams) request.params = parseOrThrow(parseParams, request.params ?? {});
|
|
2646
|
+
if (parseQuery) request.query = parseOrThrow(parseQuery, request.query ?? {});
|
|
2647
|
+
if (parseBody) request.body = parseOrThrow(parseBody, request.body ?? {});
|
|
2648
|
+
};
|
|
2649
|
+
return {
|
|
2650
|
+
schema: slots,
|
|
2651
|
+
preHandler: [parse]
|
|
2652
|
+
};
|
|
2653
|
+
}
|
|
2654
|
+
/** The request part {@link routeInput} already parsed with `schema`: typed from it, not parsed again. */
|
|
2655
|
+
function parsed(_schema, value) {
|
|
2656
|
+
return value;
|
|
2657
|
+
}
|
|
2658
|
+
/**
|
|
2659
|
+
* A body that must be empty. As an action `schema` (or route `body`) AJV rejects any stray field,
|
|
2660
|
+
* and the reference states that the verb takes nothing else. Plain JSON Schema, so no zod needed.
|
|
2661
|
+
*/
|
|
2662
|
+
const noPayloadSchema = Object.freeze({
|
|
2663
|
+
type: "object",
|
|
2664
|
+
properties: {},
|
|
2665
|
+
additionalProperties: false
|
|
2666
|
+
});
|
|
2667
|
+
/**
|
|
2668
|
+
* Wire shape of a resource's own CRUD writes. Spread into `defineResource`:
|
|
2669
|
+
* `customSchemas` is what AJV validates (and, for zod, converts input-direction: a `.default()`
|
|
2670
|
+
* stays optional; `z.strictObject` refuses unknown keys); `openApiSchemas` makes the generated
|
|
2671
|
+
* reference describe what the route accepts rather than the stored model.
|
|
2672
|
+
*
|
|
2673
|
+
* `parse: true` also adds a create/update middleware that replaces `request.body` with the zod
|
|
2674
|
+
* OUTPUT (trim, defaults, refinements). It writes `middlewares.create` / `middlewares.update`, so
|
|
2675
|
+
* merge your own: `middlewares: { create: [...mine, ...crud.middlewares.create] }`.
|
|
2676
|
+
*/
|
|
2677
|
+
function crudInput(input) {
|
|
2678
|
+
const { create, update } = input;
|
|
2679
|
+
const parseBody = (schema) => input.parse && isParseable(schema) ? [(async (request) => {
|
|
2680
|
+
request.body = parseOrThrow(schema, request.body ?? {});
|
|
2681
|
+
})] : [];
|
|
2682
|
+
return {
|
|
2683
|
+
customSchemas: {
|
|
2684
|
+
...create ? { create: { body: create } } : {},
|
|
2685
|
+
...update ? { update: { body: update } } : {}
|
|
2686
|
+
},
|
|
2687
|
+
openApiSchemas: {
|
|
2688
|
+
...create ? { createBody: create } : {},
|
|
2689
|
+
...update ? { updateBody: update } : {}
|
|
2690
|
+
},
|
|
2691
|
+
middlewares: {
|
|
2692
|
+
...create && input.parse ? { create: parseBody(create) } : {},
|
|
2693
|
+
...update && input.parse ? { update: parseBody(update) } : {}
|
|
2694
|
+
}
|
|
2695
|
+
};
|
|
2696
|
+
}
|
|
2697
|
+
/**
|
|
2698
|
+
* Wrap an action handler so `data` is the zod schema's OUTPUT. Used by `ActionDefinition.parse`
|
|
2699
|
+
* and `defineAction({ parse: true })`; a non-zod schema returns the handler unchanged.
|
|
2700
|
+
*/
|
|
2701
|
+
function withParsedInput(handler, schema) {
|
|
2702
|
+
if (!isParseable(schema)) return handler;
|
|
2703
|
+
return (id, data, req) => handler(id, parseOrThrow(schema, data), req);
|
|
2704
|
+
}
|
|
2705
|
+
// src/core/defineResource/schemas.ts
|
|
2636
2706
|
/**
|
|
2637
2707
|
* OpenAPI schema resolution — Phase 7 of `defineResource()`.
|
|
2638
2708
|
*
|
|
@@ -2793,8 +2863,7 @@ function mergeUserOpenApiOverrides(openApiSchemas, userOverrides) {
|
|
|
2793
2863
|
...userOverrides
|
|
2794
2864
|
};
|
|
2795
2865
|
}
|
|
2796
|
-
|
|
2797
|
-
//#region src/core/defineResource/plugin.ts
|
|
2866
|
+
// src/core/defineResource/plugin.ts
|
|
2798
2867
|
/**
|
|
2799
2868
|
* Build the CRUD schema map from the adapter's `OpenApiSchemas`, then layer
|
|
2800
2869
|
* `customSchemas` on top per slot (auto-gen always runs, so customising one
|
|
@@ -2949,7 +3018,7 @@ function normalizeActionsToRouterConfig(actions, resourceActionPermissions, tag,
|
|
|
2949
3018
|
if (typeof entry === "function") handlers[name] = entry;
|
|
2950
3019
|
else {
|
|
2951
3020
|
const def = entry;
|
|
2952
|
-
handlers[name] = def.handler;
|
|
3021
|
+
handlers[name] = def.parse ? withParsedInput(def.handler, def.schema) : def.handler;
|
|
2953
3022
|
if (def.schema) schemas[name] = def.schema;
|
|
2954
3023
|
if (def.id === false) idLessActionNames.push(name);
|
|
2955
3024
|
if (def.idempotency?.required === true) idempotentActionNames.push(name);
|
|
@@ -3084,7 +3153,7 @@ function buildResourcePlugin(resource) {
|
|
|
3084
3153
|
extensions: resource.extensions
|
|
3085
3154
|
});
|
|
3086
3155
|
if (resource.actions && Object.keys(resource.actions).length > 0) {
|
|
3087
|
-
const { createActionRouter } = await import("./createActionRouter-
|
|
3156
|
+
const { createActionRouter } = await import("./createActionRouter-0qkCRzTL.mjs").then((n) => n.n);
|
|
3088
3157
|
const actionConfig = normalizeActionsToRouterConfig(resource.actions, resource.actionPermissions, resource.tag, resource.permissions, resource.name, typedInstance.log);
|
|
3089
3158
|
const actionTarget = resolveActionTargetFence(resource, actionConfig);
|
|
3090
3159
|
createActionRouter(typedInstance, {
|
|
@@ -3104,7 +3173,7 @@ function buildResourcePlugin(resource) {
|
|
|
3104
3173
|
});
|
|
3105
3174
|
}
|
|
3106
3175
|
if (resource.aggregations && Object.keys(resource.aggregations).length > 0) {
|
|
3107
|
-
const [{ createAggregationRouter }, { adapterSupportsAggregate, ArcAggregationConfigError }] = await Promise.all([import("./createAggregationRouter-
|
|
3176
|
+
const [{ createAggregationRouter }, { adapterSupportsAggregate, ArcAggregationConfigError }] = await Promise.all([import("./createAggregationRouter-CUf5Esd9.mjs"), import("./validate-4RlTKOJb.mjs").then((n) => n.r)]);
|
|
3108
3177
|
const repoForAgg = resource.controller?.repository ?? resource.repository;
|
|
3109
3178
|
if (!adapterSupportsAggregate(repoForAgg)) {
|
|
3110
3179
|
const undispatchable = Object.entries(resource.aggregations).filter(([, cfg]) => !cfg.materialized).map(([name]) => name);
|
|
@@ -3141,5 +3210,4 @@ function buildResourcePlugin(resource) {
|
|
|
3141
3210
|
} catch {}
|
|
3142
3211
|
};
|
|
3143
3212
|
}
|
|
3144
|
-
|
|
3145
|
-
export { toRepositoryFilter as C, nativePolicyFilter as S, pathTouchesBlocked as _, autoInjectTenantFieldRules as a, BodySanitizer as b, BaseController as c, SlugMixin as d, BulkMixin as f, isFieldReadable as g, collectReadBlockedFields as h, resolveOpenApiSchemas as i, TreeMixin as l, QueryResolver as m, normalizeActionsToRouterConfig as n, createCrudRouter as o, BaseCrudController as p, resolveActionTargetFence as r, createPermissionMiddleware as s, buildResourcePlugin as t, SoftDeleteMixin as u, detectOverriddenWriteSlots as v, AccessControl as x, isWriteVerbCapable as y };
|
|
3213
|
+
export { isWriteVerbCapable as C, toRepositoryFilter as D, nativePolicyFilter as E, detectOverriddenWriteSlots as S, AccessControl as T, BaseCrudController as _, crudInput as a, isFieldReadable as b, routeInput as c, createPermissionMiddleware as d, BaseController as f, BulkMixin as g, SlugMixin as h, resolveOpenApiSchemas as i, autoInjectTenantFieldRules as l, SoftDeleteMixin as m, normalizeActionsToRouterConfig as n, noPayloadSchema as o, TreeMixin as p, resolveActionTargetFence as r, parsed as s, buildResourcePlugin as t, createCrudRouter as u, QueryResolver as v, BodySanitizer as w, pathTouchesBlocked as x, collectReadBlockedFields as y };
|
package/dist/plugins/index.d.mts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
|
|
2
|
-
import { t as AnyRecord } from "../base-
|
|
3
|
-
import { Et as RouteDefinition, J as MiddlewareConfig, U as PresetHook, X as RouteSchemaOptions } from "../index-
|
|
4
|
-
import { i as errorHandlerPlugin, n as ErrorMapper, r as defaultIsDuplicateKeyError, t as ErrorHandlerOptions } from "../errorHandler
|
|
5
|
-
import { C as
|
|
6
|
-
import { i as _default, n as ArcCorePluginOptions, r as PluginMeta, t as ArcCore } from "../fastify-augmentation-
|
|
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-
|
|
8
|
-
import { t as TracingOptions } from "../tracing-
|
|
2
|
+
import { t as AnyRecord } from "../base-HXNgPQww.mjs";
|
|
3
|
+
import { Et as RouteDefinition, J as MiddlewareConfig, U as PresetHook, X as RouteSchemaOptions } from "../index-DyJFTJLA.mjs";
|
|
4
|
+
import { i as errorHandlerPlugin, n as ErrorMapper, r as defaultIsDuplicateKeyError, t as ErrorHandlerOptions } from "../errorHandler-B9r88jZV.mjs";
|
|
5
|
+
import { A as DailyLedger, C as ScheduleStats, D as DailyClock, E as DailyClaimInfo, F as HealthCheck, I as HealthOptions, L as _default$3, M as MemoryDailyLedger, N as createDailyGate, O as DailyGate, P as createMemoryDailyLedger, S as ScheduleRunContext, T as _default$8, b as DailyScheduleOptions, j as DailyRunOutcome, k as DailyGateOptions, w as SchedulesPluginOptions, x as ScheduleDefinition } from "../types-BeEJm-DV.mjs";
|
|
6
|
+
import { i as _default, n as ArcCorePluginOptions, r as PluginMeta, t as ArcCore } from "../fastify-augmentation-Dtn0IIRn.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-S18y2-0C.mjs";
|
|
8
|
+
import { t as TracingOptions } from "../tracing-JSFiBl5r.mjs";
|
|
9
9
|
import { PaginatedResult } from "@classytic/repo-core/pagination";
|
|
10
10
|
import { FastifyInstance, FastifyPluginAsync } from "fastify";
|
|
11
|
-
//#region src/plugins/createPlugin.d.ts
|
|
12
11
|
interface PluginResourceResult {
|
|
13
12
|
/** Additional routes to add to the resource (v2.8 `RouteDefinition` shape) */
|
|
14
13
|
routes?: RouteDefinition[];
|
|
@@ -58,8 +57,6 @@ interface ArcPlugin<TRootOpts extends object = AnyRecord, TResourceOpts extends
|
|
|
58
57
|
* @returns ArcPlugin with forRoot() and forResource() methods
|
|
59
58
|
*/
|
|
60
59
|
export declare function createPlugin<TRootOpts extends object = AnyRecord, TResourceOpts extends object = AnyRecord>(name: string, definition: CreatePluginDefinition<TRootOpts, TResourceOpts>): ArcPlugin<TRootOpts, TResourceOpts>;
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region src/plugins/pressure.d.ts
|
|
63
60
|
/**
|
|
64
61
|
* One measurable source of load, normalised by whoever owns it.
|
|
65
62
|
*
|
|
@@ -147,8 +144,6 @@ declare module "fastify" {
|
|
|
147
144
|
* the raw plugin, matching every other arc plugin entry.
|
|
148
145
|
*/
|
|
149
146
|
declare const _default$5: FastifyPluginAsync<PressureOptions>;
|
|
150
|
-
//#endregion
|
|
151
|
-
//#region src/plugins/replyHelpers.d.ts
|
|
152
147
|
declare module "fastify" {
|
|
153
148
|
interface FastifyReply {
|
|
154
149
|
/**
|
|
@@ -177,8 +172,6 @@ declare module "fastify" {
|
|
|
177
172
|
}
|
|
178
173
|
declare function replyHelpersPluginFn(fastify: FastifyInstance): Promise<void>;
|
|
179
174
|
export declare const replyHelpersPlugin: typeof replyHelpersPluginFn;
|
|
180
|
-
//#endregion
|
|
181
|
-
//#region src/plugins/requestId.d.ts
|
|
182
175
|
interface RequestIdOptions {
|
|
183
176
|
/** Header name to read/write request ID (default: 'x-request-id') */
|
|
184
177
|
header?: string;
|
|
@@ -225,5 +218,4 @@ export declare function createRequestIdGenerator(opts?: Pick<RequestIdOptions, "
|
|
|
225
218
|
headers: Record<string, string | string[] | undefined>;
|
|
226
219
|
}) => string;
|
|
227
220
|
declare const _default$7: FastifyPluginAsync<RequestIdOptions>;
|
|
228
|
-
|
|
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 };
|
|
221
|
+
export { type ArcCore, type ArcCorePluginOptions, type ArcPlugin, type CachingOptions, type CachingRule, type ChangeOperation, type CreatePluginDefinition, type DailyClaimInfo, type DailyClock, type DailyGate, type DailyGateOptions, type DailyLedger, type DailyRunOutcome, type DailyScheduleOptions, type ErrorHandlerOptions, type ErrorMapper, type GracefulShutdownOptions, type HealthCheck, type HealthOptions, type MemoryDailyLedger, 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 ScheduleRunContext, type ScheduleStats, type SchedulesPluginOptions, type ShutdownState, type TracingOptions, type VersioningOptions, _default as arcCorePlugin, _default$1 as cachingPlugin, createDailyGate, createMemoryDailyLedger, 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,23 +1,23 @@
|
|
|
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 {
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import { t as
|
|
16
|
-
import { t as sse_default } from "../sse-
|
|
17
|
-
import { t as versioning_default } from "../versioning-
|
|
1
|
+
/*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
|
|
2
|
+
import { m as MUTATION_OPERATIONS } from "../constants-CHZMUwBW.mjs";
|
|
3
|
+
import { t as arcLog } from "../logger-CbFcIEBZ.mjs";
|
|
4
|
+
import { c as getOrgId } from "../types-CuGjhn83.mjs";
|
|
5
|
+
import { n as requestContext } from "../requestContext-GYO_0gEw.mjs";
|
|
6
|
+
import { t as hasEvents } from "../typeGuards-UKnX8wPX.mjs";
|
|
7
|
+
import { t as HookSystem } from "../HookSystem-DRbPzEcP.mjs";
|
|
8
|
+
import { t as ResourceRegistry } from "../ResourceRegistry-Douk51fa.mjs";
|
|
9
|
+
import { c as createRequestIdGenerator, l as requestId_default, n as health_default, u as sanitizeRequestId } from "../health-Dp-3EC9o.mjs";
|
|
10
|
+
import { t as caching_default } from "../caching-BYRwYrUo.mjs";
|
|
11
|
+
import { i as createMemoryDailyLedger, r as createDailyGate, t as schedules_default } from "../schedules-eO_RzhCU.mjs";
|
|
12
|
+
import { n as errorHandlerPlugin, t as defaultIsDuplicateKeyError } from "../errorHandler-dFyGOEoB.mjs";
|
|
13
|
+
import { t as metrics_default } from "../metrics-CZDQWVjS.mjs";
|
|
14
|
+
import { t as realtime_default } from "../realtime-Ber8uJN2.mjs";
|
|
15
|
+
import { t as replyHelpersPlugin } from "../replyHelpers-DK9P_XSz.mjs";
|
|
16
|
+
import { t as sse_default } from "../sse-2972pVwV.mjs";
|
|
17
|
+
import { t as versioning_default } from "../versioning-Dk2-19La.mjs";
|
|
18
18
|
import fp from "fastify-plugin";
|
|
19
19
|
import { performance as performance$1 } from "node:perf_hooks";
|
|
20
|
-
|
|
20
|
+
// src/core/arcCorePlugin.ts
|
|
21
21
|
const arcCorePlugin = async (fastify, opts = {}) => {
|
|
22
22
|
const { emitEvents = true, hookSystem, registry } = opts;
|
|
23
23
|
const actualHookSystem = hookSystem ?? new HookSystem();
|
|
@@ -121,8 +121,7 @@ var arcCorePlugin_default = fp(arcCorePlugin, {
|
|
|
121
121
|
name: "arc-core",
|
|
122
122
|
fastify: "5.x"
|
|
123
123
|
});
|
|
124
|
-
|
|
125
|
-
//#region src/plugins/createPlugin.ts
|
|
124
|
+
// src/plugins/createPlugin.ts
|
|
126
125
|
/**
|
|
127
126
|
* Create a structured plugin with forRoot (global) and forResource (per-resource) support.
|
|
128
127
|
*
|
|
@@ -152,8 +151,7 @@ function createPlugin(name, definition) {
|
|
|
152
151
|
}
|
|
153
152
|
};
|
|
154
153
|
}
|
|
155
|
-
|
|
156
|
-
//#region src/plugins/gracefulShutdown.ts
|
|
154
|
+
// src/plugins/gracefulShutdown.ts
|
|
157
155
|
const gracefulShutdownPlugin = async (fastify, opts = {}) => {
|
|
158
156
|
const { timeout = 3e4, onShutdown, signals = ["SIGTERM", "SIGINT"], logEvents = true, drainDelayMs = 0, onForceExit = () => process.exit(1) } = opts;
|
|
159
157
|
const state = { draining: false };
|
|
@@ -218,8 +216,7 @@ var gracefulShutdown_default = fp(gracefulShutdownPlugin, {
|
|
|
218
216
|
name: "arc-graceful-shutdown",
|
|
219
217
|
fastify: "5.x"
|
|
220
218
|
});
|
|
221
|
-
|
|
222
|
-
//#region src/plugins/pressure.ts
|
|
219
|
+
// src/plugins/pressure.ts
|
|
223
220
|
/**
|
|
224
221
|
* Admission control — ONE place that decides "are we saturated?".
|
|
225
222
|
*
|
|
@@ -389,5 +386,4 @@ var pressure_default = fp(pressurePlugin, {
|
|
|
389
386
|
name: "arc-pressure",
|
|
390
387
|
fastify: "5.x"
|
|
391
388
|
});
|
|
392
|
-
|
|
393
|
-
export { arcCorePlugin_default as arcCorePlugin, caching_default as cachingPlugin, createPlugin, createRequestIdGenerator, defaultIsDuplicateKeyError, errorHandlerPlugin, gracefulShutdown_default as gracefulShutdownPlugin, health_default as healthPlugin, metrics_default as metricsPlugin, pressure_default as pressurePlugin, realtime_default as realtimePlugin, replyHelpersPlugin, requestId_default as requestIdPlugin, sanitizeRequestId, schedules_default as schedulesPlugin, sse_default as ssePlugin, versioning_default as versioningPlugin };
|
|
389
|
+
export { arcCorePlugin_default as arcCorePlugin, caching_default as cachingPlugin, createDailyGate, createMemoryDailyLedger, createPlugin, createRequestIdGenerator, defaultIsDuplicateKeyError, errorHandlerPlugin, gracefulShutdown_default as gracefulShutdownPlugin, health_default as healthPlugin, metrics_default as metricsPlugin, pressure_default as pressurePlugin, realtime_default as realtimePlugin, replyHelpersPlugin, requestId_default as requestIdPlugin, sanitizeRequestId, schedules_default as schedulesPlugin, sse_default as ssePlugin, versioning_default as versioningPlugin };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
import { FastifyPluginAsync, FastifyRequest } from "fastify";
|
|
3
|
-
//#region src/plugins/response-cache.d.ts
|
|
4
3
|
export interface ResponseCacheRule {
|
|
5
4
|
/** Path prefix to match (e.g., '/api/products') */
|
|
6
5
|
match: string;
|
|
@@ -77,7 +76,7 @@ declare module "fastify" {
|
|
|
77
76
|
* }, handler);
|
|
78
77
|
* ```
|
|
79
78
|
*/
|
|
80
|
-
middleware: (request: FastifyRequest, reply: FastifyReply) => Promise<
|
|
79
|
+
middleware: (request: FastifyRequest, reply: FastifyReply) => Promise<unknown>;
|
|
81
80
|
};
|
|
82
81
|
}
|
|
83
82
|
interface FastifyRequest {
|
|
@@ -85,5 +84,4 @@ declare module "fastify" {
|
|
|
85
84
|
__arcCacheTTL?: number;
|
|
86
85
|
}
|
|
87
86
|
}
|
|
88
|
-
export declare const responseCachePlugin: FastifyPluginAsync<ResponseCacheOptions>;
|
|
89
|
-
//#endregion
|
|
87
|
+
export declare const responseCachePlugin: FastifyPluginAsync<ResponseCacheOptions>;
|
|
@@ -1,9 +1,9 @@
|
|
|
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.46.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as declareRuntimeCapability } from "../runtimeCapabilities-DWqbxkyw.mjs";
|
|
3
|
+
import { t as hasEvents } from "../typeGuards-UKnX8wPX.mjs";
|
|
4
|
+
import { n as evictToSize, r as touch, t as assertCapacity } from "../boundedMap-2WBh3gM9.mjs";
|
|
5
5
|
import fp from "fastify-plugin";
|
|
6
|
-
|
|
6
|
+
// src/plugins/response-cache.ts
|
|
7
7
|
/**
|
|
8
8
|
* Simple LRU cache using Map iteration order.
|
|
9
9
|
* Map in JS preserves insertion order — we re-insert on access to make it LRU.
|
|
@@ -138,16 +138,17 @@ const responseCachePluginImpl = async (fastify, opts = {}) => {
|
|
|
138
138
|
});
|
|
139
139
|
const cacheMiddleware = async (request, reply) => {
|
|
140
140
|
const ttl = request.__arcCacheTTL;
|
|
141
|
-
if (!ttl || ttl <= 0) return;
|
|
142
|
-
if (request.method !== "GET" && request.method !== "HEAD") return;
|
|
141
|
+
if (!ttl || ttl <= 0) return void 0;
|
|
142
|
+
if (request.method !== "GET" && request.method !== "HEAD") return void 0;
|
|
143
143
|
const key = buildKey(request);
|
|
144
|
-
if (!key) return;
|
|
144
|
+
if (!key) return void 0;
|
|
145
145
|
const entry = cache.get(key);
|
|
146
|
-
if (!entry) return;
|
|
146
|
+
if (!entry) return void 0;
|
|
147
147
|
if (xCacheHeader) reply.header("x-cache", "HIT");
|
|
148
148
|
for (const [name, value] of Object.entries(entry.headers)) reply.header(name, value);
|
|
149
149
|
request.__arcCacheTTL = 0;
|
|
150
150
|
reply.code(entry.statusCode).send(entry.body);
|
|
151
|
+
return reply;
|
|
151
152
|
};
|
|
152
153
|
fastify.addHook("preSerialization", async (request, reply, payload) => {
|
|
153
154
|
const ttl = request.__arcCacheTTL;
|
|
@@ -218,5 +219,4 @@ const responseCachePlugin = fp(responseCachePluginImpl, {
|
|
|
218
219
|
name: "arc-response-cache",
|
|
219
220
|
fastify: "5.x"
|
|
220
221
|
});
|
|
221
|
-
//#endregion
|
|
222
222
|
export { responseCachePlugin };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
|
|
2
|
-
import { a as traced, i as isTracingAvailable, n as _default, r as createSpan, t as TracingOptions } from "../tracing-
|
|
2
|
+
import { a as traced, i as isTracingAvailable, n as _default, r as createSpan, t as TracingOptions } from "../tracing-JSFiBl5r.mjs";
|
|
3
3
|
export { type TracingOptions, createSpan, isTracingAvailable, traced, _default as tracingPlugin };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import fp from "fastify-plugin";
|
|
4
|
-
|
|
4
|
+
// src/plugins/tracing.ts
|
|
5
5
|
/**
|
|
6
6
|
* OpenTelemetry Distributed Tracing Plugin
|
|
7
7
|
*
|
|
@@ -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.46.0";
|
|
63
63
|
const exporter = new OTLPTraceExporter({ url: exporterUrl });
|
|
64
64
|
const provider = new NodeTracerProvider({ resource: { attributes: {
|
|
65
65
|
"service.name": serviceName,
|
|
@@ -216,5 +216,4 @@ var tracing_default = fp(tracingPlugin, {
|
|
|
216
216
|
name: "arc-tracing",
|
|
217
217
|
fastify: "5.x"
|
|
218
218
|
});
|
|
219
|
-
//#endregion
|
|
220
219
|
export { createSpan, isTracingAvailable, traced, tracing_default as tracingPlugin };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
|
|
1
|
+
/*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
|
|
2
|
+
// src/utils/pluralize.ts
|
|
3
3
|
/**
|
|
4
4
|
* Lightweight English pluralization for the Arc CLI.
|
|
5
5
|
*
|
|
@@ -83,5 +83,4 @@ function pluralize(word) {
|
|
|
83
83
|
if (lower.endsWith("o") && !/[aeiou]o$/i.test(lower)) return `${word}es`;
|
|
84
84
|
return `${word}s`;
|
|
85
85
|
}
|
|
86
|
-
//#endregion
|
|
87
86
|
export { pluralize as t };
|