@classytic/arc 2.45.2 → 2.47.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-DHb1tpu-.mjs → EventTransport-BHKy4_Bi.mjs} +5 -6
- package/dist/{EventTransport-CiicKz2Z.d.mts → EventTransport-CYEoCJGe.d.mts} +0 -2
- package/dist/{HookSystem-C1u0EUnt.mjs → HookSystem-CAIDVoKC.mjs} +3 -4
- package/dist/{QueryCache--5uAuYPW.d.mts → QueryCache-DdvrGG8Q.d.mts} +1 -3
- package/dist/{ResourceRegistry-D2jXWVN_.mjs → ResourceRegistry-23Ml6FNe.mjs} +15 -4
- package/dist/{acquire-DTkA8Lme.mjs → acquire-DoFX06fm.mjs} +2 -3
- package/dist/{actionPermissions-DRVk6m7x.mjs → actionPermissions-DXrlWHHK.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-DYiubkYw.mjs} +5 -6
- package/dist/{base-CZyixEQR.d.mts → base-HXNgPQww.d.mts} +1 -7
- package/dist/{boundedMap-DkKiPifd.mjs → boundedMap-CtdzpJ3X.mjs} +2 -3
- package/dist/{buildHandler-BiZ4VATS.mjs → buildHandler-CARdmPNo.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-QRiryDLs.mjs} +3 -4
- package/dist/{claimed-ChI13rUR.mjs → claimed-BLecr1j3.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-Cx7BcnHT.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-0WyMuo0f.mjs} +9 -12
- package/dist/{createActionRouter-CvH84dyx.mjs → createActionRouter-mLAGbpDV.mjs} +7 -8
- package/dist/{createAggregationRouter-DGyK2Hp6.mjs → createAggregationRouter-BEAjn3dA.mjs} +9 -10
- package/dist/{createApp-CKjZpmq9.mjs → createApp-QDP4vYWH.mjs} +49 -62
- package/dist/{createMcpServer-DSztofa9.d.mts → createMcpServer-DzXHX0SO.d.mts} +1 -3
- package/dist/{defineAggregation-BLza7Ca4.mjs → defineAggregation-CFNfvz-C.mjs} +2 -3
- package/dist/{defineResource-CEo0gDCb.mjs → defineResource-BROJmhzJ.mjs} +80 -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-BW2J3tNj.d.mts → elevation-DPD0hcU-.d.mts} +0 -2
- package/dist/{elevation-BJTsSnke.mjs → elevation-DrXeEWWk.mjs} +9 -10
- 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-BiBXtxj4.mjs} +16 -6
- package/dist/{errors-JYc9vwqE.d.mts → errors-DTo0me1o.d.mts} +0 -2
- package/dist/{errors-grZkIA8N.mjs → errors-DnrUChAy.mjs} +2 -3
- package/dist/{eventPlugin-BtmA4-3P.d.mts → eventPlugin-BY38F6yK.d.mts} +1 -7
- package/dist/{eventPlugin-ItcYBGUs.mjs → eventPlugin-BhKLUe7H.mjs} +10 -12
- package/dist/{eventTypes-Ck6fD3ne.mjs → eventTypes-CCIRGakw.mjs} +5 -8
- package/dist/events/index.d.mts +5 -17
- package/dist/events/index.mjs +9 -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-bzkWPt1f.d.mts} +4 -10
- package/dist/{fields-BRX0Krcj.mjs → fields-CYdpcV73.mjs} +2 -3
- package/dist/{fields-BBSpf8pS.d.mts → fields-JTkrtO-r.d.mts} +0 -2
- package/dist/{filter-merge-CDc7YMwX.mjs → filter-merge-6kasezRH.mjs} +2 -3
- package/dist/{generate-DCGuEbqI.d.mts → generate-C-g_KOkV.d.mts} +0 -4
- package/dist/{generate-hvg7V2g1.mjs → generate-DUkcbc4r.mjs} +7 -12
- package/dist/{headers-Cqkg4LzI.mjs → headers-KxhrKevA.mjs} +3 -4
- package/dist/{health-PVt0VjOx.mjs → health-CRJg3IIq.mjs} +2 -3
- package/dist/{health-DyeP3mTW.mjs → health-jkYNdobJ.mjs} +4 -7
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/http-cache/index.d.mts +211 -0
- package/dist/http-cache/index.mjs +605 -0
- package/dist/http-cache/purgers/cloudflare.d.mts +13 -0
- package/dist/http-cache/purgers/cloudflare.mjs +46 -0
- package/dist/http-cache/purgers/fastly.d.mts +12 -0
- package/dist/http-cache/purgers/fastly.mjs +47 -0
- package/dist/http-cache/testing/index.d.mts +68 -0
- package/dist/http-cache/testing/index.mjs +168 -0
- package/dist/idempotency/index.d.mts +3 -9
- package/dist/idempotency/index.mjs +11 -14
- 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-BxZS-8So.d.mts} +67 -25
- package/dist/{index-WH7xgvxS.d.mts → index-Cy2-QffW.d.mts} +40 -92
- package/dist/{index-uhkUA5-U.d.mts → index-D1X_C_qz.d.mts} +13 -23
- package/dist/{index-CUJvoyw3.d.mts → index-DFCCQ9AE.d.mts} +2 -24
- package/dist/index.d.mts +7 -9
- package/dist/index.mjs +12 -13
- package/dist/{init-jC3rMPzb.mjs → init-CACwpktI.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 +5 -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-CzDBkCme.mjs} +3 -4
- package/dist/{keys-C1vFuSbv.mjs → keys-Cbwf6r1B.mjs} +2 -3
- package/dist/{loadResources-CHPDyIPn.mjs → loadResources-Kr6vuljv.mjs} +4 -5
- package/dist/{loadResourcesFromEntry-BkHHTu_B.mjs → loadResourcesFromEntry-D2e0qoDR.mjs} +3 -4
- package/dist/logger/index.d.mts +1 -3
- package/dist/logger/index.mjs +2 -2
- package/dist/{logger-C5bvCiAK.mjs → logger-C110X5Yz.mjs} +3 -5
- package/dist/{mcpPlugin-C9qohJCF.mjs → mcpPlugin-4lIPr9OJ.mjs} +41 -60
- package/dist/{memory-CxiTwT0j.mjs → memory-D9qkhXiB.mjs} +4 -5
- package/dist/{metrics-Ckp2zRy-.mjs → metrics-B-qrrWfI.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-BD8xHgrz.mjs} +2 -3
- package/dist/{multiTenant-CAtYlW6H.d.mts → multiTenant-KZj8j1uJ.d.mts} +1 -5
- package/dist/{multipartBody-BFasGtP9.mjs → multipartBody-qU7KCn1l.mjs} +2 -3
- package/dist/observeSend-BnPtTotW.mjs +20 -0
- package/dist/{openapi-DAPxjYHX.mjs → openapi-DoVa5SVP.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-5Mnwcycy.d.mts} +3 -9
- package/dist/outbox-module-DyITEIop.mjs +297 -0
- package/dist/permissions/index.d.mts +4 -4
- package/dist/permissions/index.mjs +7 -7
- package/dist/{permissions-B14c3OMp.mjs → permissions-BBy4bOGi.mjs} +19 -29
- package/dist/{pipe-CQv7PsAK.mjs → pipe-BOm2o4UA.mjs} +3 -4
- package/dist/pipeline/index.d.mts +1 -9
- package/dist/pipeline/index.mjs +5 -8
- package/dist/{plan-CpnTykjb.mjs → plan-DDIGwuxr.mjs} +5 -9
- package/dist/{plugin-DXTjVg_Q.mjs → plugin-Bn4D_0XK.mjs} +156 -64
- 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-ClEjcKlG.mjs} +2 -3
- package/dist/policy.types-DPqToKG1.d.mts +50 -0
- 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-DK2jh5YR.mjs} +11 -18
- package/dist/{projection-CgfSLOSM.mjs → projection-BHH-sXyS.mjs} +3 -4
- package/dist/purger.types-2wNJK_89.mjs +24 -0
- package/dist/purger.types-DvPp4-yd.d.mts +26 -0
- package/dist/{pushref-registry-UxCkoA4C.d.mts → pushref-registry-d86QUaSq.d.mts} +0 -6
- package/dist/{queryCachePlugin-D0HUISHJ.mjs → queryCachePlugin-Ckqe98AM.mjs} +8 -10
- package/dist/{queryCachePlugin-C2lZjTxk.d.mts → queryCachePlugin-DYQUyeJ9.d.mts} +2 -4
- package/dist/{rateLimitKey-AvkBOMkl.mjs → rateLimitKey-CWAjlqcN.mjs} +2 -3
- package/dist/{realtime-CbWtVbqK.mjs → realtime-BIJi9USY.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-y9ZA-R_J.mjs} +7 -12
- package/dist/{outbox-module-B4FAkx3A.mjs → relay-BNrC1CEP.mjs} +8 -306
- package/dist/{renewingLease-CykpeNcQ.mjs → renewingLease-CS43br5E.mjs} +2 -3
- package/dist/{replyHelpers-DA51IZio.mjs → replyHelpers-oZDzakGb.mjs} +3 -4
- package/dist/{requestContext-DIWHKDtQ.mjs → requestContext-fWb_YaV2.mjs} +2 -3
- package/dist/{requirement-Cp_fsMDL.mjs → requirement--2hWyyHi.mjs} +2 -3
- package/dist/{requirement-CbiLdQ1n.d.mts → requirement-CTRQjjQx.d.mts} +0 -2
- package/dist/{resourceRateLimit-BFuluodF.mjs → resourceRateLimit-1WbcyMZY.mjs} +3 -4
- package/dist/{resourceRateLimit-Wf6d6FL9.d.mts → resourceRateLimit-DCWglD7V.d.mts} +1 -3
- package/dist/{rolldown-runtime-D_lMdYOd.mjs → rolldown-runtime-yH2lHMo_.mjs} +2 -3
- package/dist/{routeValidator-DuLonYwr.mjs → routeValidator-BSlRIA5c.mjs} +2 -3
- package/dist/{runtimeCapabilities-CydRfm0i.mjs → runtimeCapabilities-CYCEtU1W.mjs} +2 -3
- package/dist/{schedules-B693KXxa.mjs → schedules-B5WGlYIT.mjs} +132 -9
- package/dist/{schemaConverter-DNvZWTV6.mjs → schemaConverter-DtNvts-6.mjs} +3 -4
- package/dist/{schemaIR-REV2y7Wd.mjs → schemaIR-uS_RHqa3.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-BwVLSyNG.mjs} +5 -6
- package/dist/{sessionManager-qimlKV0P.d.mts → sessionManager-CdvDF04x.d.mts} +2 -4
- package/dist/{shutdown-CfrqPR7A.mjs → shutdown-BJiJN7FT.mjs} +2 -3
- package/dist/{simpleEqualityMatcher-BJwfuRKP.mjs → simpleEqualityMatcher-DGRLq-1k.mjs} +2 -3
- package/dist/{sse-CuNNWr2z.mjs → sse-B_50llZu.mjs} +8 -9
- package/dist/{sseStream-C_2ujAVY.mjs → sseStream-BjSo9Ult.mjs} +3 -4
- package/dist/{storage-Cx9Sz3Ou.d.mts → storage-odC5MNKN.d.mts} +0 -2
- package/dist/{store-helpers-C8uBGCbb.mjs → store-helpers-D-n5cwy5.mjs} +2 -3
- package/dist/{streaming-Bdq_M4d5.mjs → streaming-Dcgqa-hH.mjs} +2 -3
- package/dist/{subscriberIdentity-B-KpZkdl.mjs → subscriberIdentity-C9KhIXTF.mjs} +2 -3
- package/dist/{tenancy-C5PCvm1h.mjs → tenancy-COrhjPRZ.mjs} +3 -4
- package/dist/{tenantPreparation-dYvWrgNa.mjs → tenantPreparation-BElWHytd.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-CaxKbRk_.mjs} +3 -5
- package/dist/{tracing-Dro5eH6j.d.mts → tracing-JSFiBl5r.d.mts} +0 -2
- package/dist/{transactionContext-DrcNyjpv.mjs → transactionContext-8qKON0Nk.mjs} +2 -3
- package/dist/{typeGuards-CEl10KPy.mjs → typeGuards-DVjVSsXO.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-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-DZHqOuJE.mjs} +5 -6
- package/dist/{types-D3Ixsh00.d.mts → types-DeLiuaNv.d.mts} +2 -4
- 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-_eGj6kf0.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-Dd6MWpye.mjs} +20 -30
- package/dist/{validate-D_mdOCir.mjs → validate-BaF5wd0x.mjs} +5 -7
- package/dist/{versioning-DBGHjPh7.mjs → versioning-DyV7mwtK.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-CmCBUmPR.mjs} +3 -4
- package/llms.txt +37 -30
- package/package.json +51 -22
- 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
package/dist/factory/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { r as mergeHealthChecks, t as healthPlugin } from "../health-
|
|
3
|
-
import { a as developmentPreset, c as productionPreset, d as getModuleResources, f as getModuleState, g as collectModuleWorkflows, l as testingPreset, m as subscribeModuleEventHandlers, n as DEFAULT_LOGGER_REDACT_PATHS, o as edgePreset, p as hasModule, r as createApp, s as getPreset, t as ArcFactory, u as workerPreset } from "../createApp-
|
|
4
|
-
import { _ as dependentsOf, b as verifyEventDurability, d as resolveModule, g as crudEventsOf, h as buildModuleGraph, i as planModules, m as analyzeModuleGraph, o as resolveModuleClosure, p as activateBridges, r as compositionProblems, s as orderModules, t as assertComposable, u as resolveContribution, v as eventTopology, x as verifyModuleGraph, y as renderModuleGraph } from "../plan-
|
|
5
|
-
import { a as lazyModuleExports, i as hasModuleExports, n as getModuleExports, o as lazyRequiredModuleExports, r as getOptionalModuleExports, t as defineModule } from "../module-
|
|
6
|
-
import { t as loadResources } from "../loadResources-
|
|
7
|
-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { r as mergeHealthChecks, t as healthPlugin } from "../health-jkYNdobJ.mjs";
|
|
3
|
+
import { a as developmentPreset, c as productionPreset, d as getModuleResources, f as getModuleState, g as collectModuleWorkflows, l as testingPreset, m as subscribeModuleEventHandlers, n as DEFAULT_LOGGER_REDACT_PATHS, o as edgePreset, p as hasModule, r as createApp, s as getPreset, t as ArcFactory, u as workerPreset } from "../createApp-QDP4vYWH.mjs";
|
|
4
|
+
import { _ as dependentsOf, b as verifyEventDurability, d as resolveModule, g as crudEventsOf, h as buildModuleGraph, i as planModules, m as analyzeModuleGraph, o as resolveModuleClosure, p as activateBridges, r as compositionProblems, s as orderModules, t as assertComposable, u as resolveContribution, v as eventTopology, x as verifyModuleGraph, y as renderModuleGraph } from "../plan-DDIGwuxr.mjs";
|
|
5
|
+
import { a as lazyModuleExports, i as hasModuleExports, n as getModuleExports, o as lazyRequiredModuleExports, r as getOptionalModuleExports, t as defineModule } from "../module-BD8xHgrz.mjs";
|
|
6
|
+
import { t as loadResources } from "../loadResources-Kr6vuljv.mjs";
|
|
7
|
+
// src/factory/module/asyncapi.ts
|
|
8
8
|
/**
|
|
9
9
|
* The module graph as an AsyncAPI 3.0 document — one channel per event (addressed by the event
|
|
10
10
|
* name, payload from the event registry), a `send` operation for its owner and a `receive` for
|
|
@@ -58,8 +58,7 @@ function toAsyncApi(graph, catalog, info, analysis = analyzeModuleGraph(graph))
|
|
|
58
58
|
components: { messages }
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
|
|
62
|
-
//#region src/factory/module/extend.ts
|
|
61
|
+
// src/factory/module/extend.ts
|
|
63
62
|
/** Concatenate two contributions, resolving factories only when arc asks. */
|
|
64
63
|
function mergeContribution(own, extra) {
|
|
65
64
|
if (own === void 0) return extra;
|
|
@@ -200,8 +199,7 @@ function extendModule(mod, extension) {
|
|
|
200
199
|
if (extension.bootstrap) out.bootstrap = extension.bootstrap(mod.bootstrap);
|
|
201
200
|
return out;
|
|
202
201
|
}
|
|
203
|
-
|
|
204
|
-
//#region src/factory/module/relay-nudge.ts
|
|
202
|
+
// src/factory/module/relay-nudge.ts
|
|
205
203
|
function isRelayFromModule(relay) {
|
|
206
204
|
return typeof relay === "object" && relay !== null && "fromModule" in relay;
|
|
207
205
|
}
|
|
@@ -252,8 +250,7 @@ function createRelayNudge(label, relay) {
|
|
|
252
250
|
}
|
|
253
251
|
};
|
|
254
252
|
}
|
|
255
|
-
|
|
256
|
-
//#region src/factory/createWorker.ts
|
|
253
|
+
// src/factory/createWorker.ts
|
|
257
254
|
async function createWorker(options, workerOptions = {}) {
|
|
258
255
|
const { auth: _auth, helmet: _helmet, cors: _cors, rateLimit: _rateLimit, multipart: _multipart, rawBody: _rawBody, sensible: _sensible, underPressure: _underPressure, replyHelpers: _replyHelpers, ...runtimeOptions } = options;
|
|
259
256
|
const sharedHealth = typeof runtimeOptions.arcPlugins?.health === "object" && runtimeOptions.arcPlugins.health !== null ? runtimeOptions.arcPlugins.health : {};
|
|
@@ -313,8 +310,7 @@ async function createWorker(options, workerOptions = {}) {
|
|
|
313
310
|
}
|
|
314
311
|
};
|
|
315
312
|
}
|
|
316
|
-
|
|
317
|
-
//#region src/factory/edge.ts
|
|
313
|
+
// src/factory/edge.ts
|
|
318
314
|
/**
|
|
319
315
|
* Convert a Fastify app into a Web Standards fetch handler.
|
|
320
316
|
*
|
|
@@ -379,8 +375,7 @@ function payloadTooLarge(limit) {
|
|
|
379
375
|
headers: { "content-type": "application/json" }
|
|
380
376
|
});
|
|
381
377
|
}
|
|
382
|
-
|
|
383
|
-
//#region src/factory/preloadResources.ts
|
|
378
|
+
// src/factory/preloadResources.ts
|
|
384
379
|
/**
|
|
385
380
|
* Normalize an eager `import.meta.glob` result into a `ResourceLike[]`.
|
|
386
381
|
*
|
|
@@ -423,5 +418,4 @@ function pickResource(value) {
|
|
|
423
418
|
];
|
|
424
419
|
for (const c of candidates) if (c && typeof c === "object" && typeof c.toPlugin === "function") return c;
|
|
425
420
|
}
|
|
426
|
-
//#endregion
|
|
427
421
|
export { ArcFactory, DEFAULT_LOGGER_REDACT_PATHS, activateBridges, analyzeModuleGraph, assertComposable, buildModuleGraph, collectModuleWorkflows, compositionProblems, createApp, createRelayNudge, createWorker, crudEventsOf, defineModule, dependentsOf, developmentPreset, edgePreset, eventTopology, extendModule, getModuleExports, getModuleResources, getModuleState, getOptionalModuleExports, getPreset, hasModule, hasModuleExports, lazyModuleExports, lazyRequiredModuleExports, loadResources, orderModules, planModules, preloadResources, preloadResourcesAsync, productionPreset, renderModuleGraph, resolveContribution, resolveModule, resolveModuleClosure, subscribeModuleEventHandlers, testingPreset, toAsyncApi, toFetchHandler, verifyEventDurability, verifyModuleGraph, withRelayNudge };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
import { M as ResourceRegistry, dn as HookSystem } from "./index-
|
|
3
|
-
import { t as ExternalOpenApiPaths } from "./externalPaths-
|
|
4
|
-
import {
|
|
5
|
-
import { L as ModuleGraph, s as ModuleState } from "./index-
|
|
2
|
+
import { M as ResourceRegistry, dn as HookSystem } from "./index-Cy2-QffW.mjs";
|
|
3
|
+
import { t as ExternalOpenApiPaths } from "./externalPaths-BOqdq5wr.mjs";
|
|
4
|
+
import { F as HealthCheck, i as ArcModuleRegistry, n as ArcModule, x as ScheduleDefinition } from "./types-BeEJm-DV.mjs";
|
|
5
|
+
import { L as ModuleGraph, s as ModuleState } from "./index-DFCCQ9AE.mjs";
|
|
6
6
|
import { FastifyPluginAsync } from "fastify";
|
|
7
|
-
//#region src/factory/module/descriptor.d.ts
|
|
8
7
|
/**
|
|
9
8
|
* Resolved module introspection — what a module ACTUALLY composed to.
|
|
10
9
|
*
|
|
@@ -65,8 +64,6 @@ interface ResolvedModuleDescriptor {
|
|
|
65
64
|
readonly owns: readonly string[];
|
|
66
65
|
readonly lifecycle: ResolvedModuleLifecycle;
|
|
67
66
|
}
|
|
68
|
-
//#endregion
|
|
69
|
-
//#region src/core/arcCorePlugin.d.ts
|
|
70
67
|
interface ArcCorePluginOptions {
|
|
71
68
|
/** Enable event emission for CRUD operations (requires eventPlugin) */
|
|
72
69
|
emitEvents?: boolean;
|
|
@@ -154,12 +151,9 @@ interface ArcCore {
|
|
|
154
151
|
scheduledJobs?: readonly Readonly<ScheduleDefinition>[];
|
|
155
152
|
}
|
|
156
153
|
declare const _default: FastifyPluginAsync<ArcCorePluginOptions>;
|
|
157
|
-
//#endregion
|
|
158
|
-
//#region src/types/fastify-augmentation.d.ts
|
|
159
154
|
declare module "fastify" {
|
|
160
155
|
interface FastifyInstance {
|
|
161
156
|
arc?: ArcCore;
|
|
162
157
|
}
|
|
163
158
|
}
|
|
164
|
-
//#endregion
|
|
165
159
|
export { ResolvedModuleDescriptor as a, _default as i, ArcCorePluginOptions as n, ResolvedModuleLifecycle as o, PluginMeta as r, ResolvedResourceDescriptor as s, ArcCore as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
// src/permissions/fields.ts
|
|
3
3
|
/**
|
|
4
4
|
* Field-Level Permissions
|
|
5
5
|
*
|
|
@@ -195,5 +195,4 @@ function resolveEffectiveRoles(userRoles, orgRoles) {
|
|
|
195
195
|
if (userRoles.length === 0) return [...orgRoles];
|
|
196
196
|
return [.../* @__PURE__ */ new Set([...userRoles, ...orgRoles])];
|
|
197
197
|
}
|
|
198
|
-
//#endregion
|
|
199
198
|
export { resolveEffectiveRoles as a, fields as i, applyFieldWritePermissions as n, deriveHiddenFieldPermissions as r, applyFieldReadPermissions as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
//#region src/permissions/fields.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Field-Level Permissions
|
|
5
4
|
*
|
|
@@ -118,5 +117,4 @@ declare function applyFieldWritePermissions<T extends Record<string, unknown>>(b
|
|
|
118
117
|
* When no org context exists, returns global roles only — backward compatible.
|
|
119
118
|
*/
|
|
120
119
|
declare function resolveEffectiveRoles(userRoles: readonly string[], orgRoles: readonly string[]): string[];
|
|
121
|
-
//#endregion
|
|
122
120
|
export { applyFieldReadPermissions as a, resolveEffectiveRoles as c, FieldWritePermissionResult as i, FieldPermissionMap as n, applyFieldWritePermissions as o, FieldPermissionType as r, fields as s, FieldPermission as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
// src/permissions/filter-merge.ts
|
|
3
3
|
/**
|
|
4
4
|
* Policy-filter composition — logical AND, never last-writer-wins.
|
|
5
5
|
*
|
|
@@ -95,5 +95,4 @@ function conjoinPolicyFilters(base, incoming) {
|
|
|
95
95
|
}
|
|
96
96
|
return result;
|
|
97
97
|
}
|
|
98
|
-
//#endregion
|
|
99
98
|
export { conjoinPolicyFilters as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
//#region src/cli/commands/generate/index.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* `arc generate` orchestrator.
|
|
5
4
|
*
|
|
@@ -19,8 +18,6 @@
|
|
|
19
18
|
* no network, no DB, no global state.
|
|
20
19
|
*/
|
|
21
20
|
declare function generate(type: string | undefined, args: string[]): Promise<void>;
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region src/cli/commands/generate/types.d.ts
|
|
24
21
|
/**
|
|
25
22
|
* Shared types for the `arc generate` scaffolder.
|
|
26
23
|
*
|
|
@@ -35,5 +32,4 @@ interface ArcProjectConfig {
|
|
|
35
32
|
typescript?: boolean;
|
|
36
33
|
mcp?: boolean;
|
|
37
34
|
}
|
|
38
|
-
//#endregion
|
|
39
35
|
export { generate as n, ArcProjectConfig as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as pluralize } from "./pluralize-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as pluralize } from "./pluralize-ClEjcKlG.mjs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
|
-
|
|
5
|
+
// src/cli/commands/generate/name-helpers.ts
|
|
6
6
|
/**
|
|
7
7
|
* Case conversion for resource-name normalisation.
|
|
8
8
|
*
|
|
@@ -21,8 +21,7 @@ function toPascalCase(name) {
|
|
|
21
21
|
function toCamelCase(pascalName) {
|
|
22
22
|
return pascalName.charAt(0).toLowerCase() + pascalName.slice(1);
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
//#region src/cli/commands/generate/project-config.ts
|
|
24
|
+
// src/cli/commands/generate/project-config.ts
|
|
26
25
|
/**
|
|
27
26
|
* Read the host project's `.arcrc` (written at scaffold time by `arc init`)
|
|
28
27
|
* and detect whether it's a TypeScript project via the presence of
|
|
@@ -42,8 +41,7 @@ function readProjectConfig() {
|
|
|
42
41
|
function isTypeScriptProject() {
|
|
43
42
|
return existsSync(join(process.cwd(), "tsconfig.json"));
|
|
44
43
|
}
|
|
45
|
-
|
|
46
|
-
//#region src/cli/commands/generate/file-writer.ts
|
|
44
|
+
// src/cli/commands/generate/file-writer.ts
|
|
47
45
|
/**
|
|
48
46
|
* Scaffolding I/O for `arc generate`.
|
|
49
47
|
*
|
|
@@ -134,8 +132,7 @@ async function generateFile(name, lowerName, resourcePath, fileType, template, e
|
|
|
134
132
|
writeFileSync(filepath, template(name, lowerName));
|
|
135
133
|
console.log(` + Created: ${filename}`);
|
|
136
134
|
}
|
|
137
|
-
|
|
138
|
-
//#region src/cli/commands/generate/templates.ts
|
|
135
|
+
// src/cli/commands/generate/templates.ts
|
|
139
136
|
/**
|
|
140
137
|
* Template factory for `arc generate`.
|
|
141
138
|
*
|
|
@@ -579,8 +576,7 @@ describe('${name} Resource', () => {
|
|
|
579
576
|
}
|
|
580
577
|
};
|
|
581
578
|
}
|
|
582
|
-
|
|
583
|
-
//#region src/cli/commands/generate/index.ts
|
|
579
|
+
// src/cli/commands/generate/index.ts
|
|
584
580
|
/**
|
|
585
581
|
* `arc generate` orchestrator.
|
|
586
582
|
*
|
|
@@ -653,5 +649,4 @@ async function generate(type, args) {
|
|
|
653
649
|
default: throw new Error(`Unknown type: ${type}\nAvailable types: resource, controller, model, repository, schemas, mcp`);
|
|
654
650
|
}
|
|
655
651
|
}
|
|
656
|
-
//#endregion
|
|
657
652
|
export { generate as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { u as ValidationError } from "./errors-
|
|
3
|
-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { u as ValidationError } from "./errors-DnrUChAy.mjs";
|
|
3
|
+
// src/utils/headers.ts
|
|
4
4
|
/**
|
|
5
5
|
* Canonical header typing + accessor.
|
|
6
6
|
*
|
|
@@ -42,5 +42,4 @@ function requireSingleHeaderValue(headers, name) {
|
|
|
42
42
|
if (Array.isArray(value)) throw new ValidationError(`Duplicate '${name}' header`);
|
|
43
43
|
return value;
|
|
44
44
|
}
|
|
45
|
-
//#endregion
|
|
46
45
|
export { requireSingleHeaderValue as n, getHeader as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
// src/events/outbox/health.ts
|
|
3
3
|
/** Pending age past which the relay counts as stalled. */
|
|
4
4
|
const DEFAULT_RELAY_LAG_UNHEALTHY_MS = 3e5;
|
|
5
5
|
function canReportHealth(store) {
|
|
@@ -18,5 +18,4 @@ async function readOutboxHealth(store, relayLagUnhealthyMs = DEFAULT_RELAY_LAG_U
|
|
|
18
18
|
healthy: deadLetter === 0 && (relayLagMs === null || relayLagMs < relayLagUnhealthyMs)
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
//#endregion
|
|
22
21
|
export { canReportHealth as n, readOutboxHealth as r, DEFAULT_RELAY_LAG_UNHEALTHY_MS as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import fp from "fastify-plugin";
|
|
4
|
-
|
|
4
|
+
// src/plugins/requestId.ts
|
|
5
5
|
/**
|
|
6
6
|
* Request ID Plugin
|
|
7
7
|
*
|
|
@@ -110,8 +110,7 @@ var requestId_default = fp(requestIdPlugin, {
|
|
|
110
110
|
name: "arc-request-id",
|
|
111
111
|
fastify: "5.x"
|
|
112
112
|
});
|
|
113
|
-
|
|
114
|
-
//#region src/utils/metricSeries.ts
|
|
113
|
+
// src/utils/metricSeries.ts
|
|
115
114
|
/** Retains a fixed number of label sets; excess observations share one overflow series. */
|
|
116
115
|
var MetricSeries = class {
|
|
117
116
|
data = /* @__PURE__ */ new Map();
|
|
@@ -219,8 +218,7 @@ function renderMetricSample(name, sample) {
|
|
|
219
218
|
const labels = Object.entries(sample.labels).map(([key, value]) => `${key}="${value.replaceAll("\\", "\\\\").replaceAll("\n", "\\n").replaceAll("\"", "\\\"")}"`).join(",");
|
|
220
219
|
return `${name}${sample.suffix ?? ""}${labels ? `{${labels}}` : ""} ${sample.value}`;
|
|
221
220
|
}
|
|
222
|
-
|
|
223
|
-
//#region src/plugins/health.ts
|
|
221
|
+
// src/plugins/health.ts
|
|
224
222
|
/**
|
|
225
223
|
* Merge health checks without losing ownership information.
|
|
226
224
|
*
|
|
@@ -442,5 +440,4 @@ var health_default = fp(healthPlugin, {
|
|
|
442
440
|
name: "arc-health",
|
|
443
441
|
fastify: "5.x"
|
|
444
442
|
});
|
|
445
|
-
//#endregion
|
|
446
443
|
export { MetricHistogram as a, createRequestIdGenerator as c, DURATION_BUCKETS_SECONDS as i, requestId_default as l, health_default as n, MetricSeries as o, mergeHealthChecks as r, renderMetricSample as s, healthPlugin as t, sanitizeRequestId as u };
|
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
|
|
2
|
-
import { _n as beforeDelete, an as DefineHookOptions, bn as defineHook, cn as HookOperation, dn as HookSystem, fn as HookSystemOptions, gn as beforeCreate, hn as afterUpdate, in as AroundHookHandler, ln as HookPhase, mn as afterDelete, on as HookContext, pn as afterCreate, sn as HookHandler, un as HookRegistration, vn as beforeUpdate, yn as createHookSystem } from "../index-
|
|
2
|
+
import { _n as beforeDelete, an as DefineHookOptions, bn as defineHook, cn as HookOperation, dn as HookSystem, fn as HookSystemOptions, gn as beforeCreate, hn as afterUpdate, in as AroundHookHandler, ln as HookPhase, mn as afterDelete, on as HookContext, pn as afterCreate, sn as HookHandler, un as HookRegistration, vn as beforeUpdate, yn as createHookSystem } from "../index-Cy2-QffW.mjs";
|
|
3
3
|
export { type AroundHookHandler, type DefineHookOptions, type HookContext, type HookHandler, type HookOperation, type HookPhase, type HookRegistration, HookSystem, type HookSystemOptions, afterCreate, afterDelete, afterUpdate, beforeCreate, beforeDelete, beforeUpdate, createHookSystem, defineHook };
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
export { t as HookSystem, n as afterCreate, r as afterDelete, i as afterUpdate, a as beforeCreate, o as beforeDelete, s as beforeUpdate, c as createHookSystem, l as defineHook } from "../HookSystem-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
export { t as HookSystem, n as afterCreate, r as afterDelete, i as afterUpdate, a as beforeCreate, o as beforeDelete, s as beforeUpdate, c as createHookSystem, l as defineHook } from "../HookSystem-CAIDVoKC.mjs";
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
|
|
2
|
+
import { a as PrivacyDecision, c as RouteHttpCacheConfig, i as NonCacheableReason, l as TagSpec, n as HttpCachePolicy, o as PrivacyReason, r as HttpCacheRule, s as ResourceHttpCacheConfig, t as DocumentTags } from "../policy.types-DPqToKG1.mjs";
|
|
3
|
+
import { n as DomainEvent } from "../EventTransport-CYEoCJGe.mjs";
|
|
4
|
+
import { i as PurgerCapabilities, n as CachePurger, r as PurgeMode, t as CachePurgeError } from "../purger.types-DvPp4-yd.mjs";
|
|
5
|
+
import { FastifyInstance, FastifyPluginAsync, FastifyRequest } from "fastify";
|
|
6
|
+
import { OutboxStore } from "@classytic/primitives/outbox";
|
|
7
|
+
interface InvalidationBatch {
|
|
8
|
+
tags: readonly string[];
|
|
9
|
+
mode: PurgeMode;
|
|
10
|
+
}
|
|
11
|
+
interface DeliveryContext {
|
|
12
|
+
purger: CachePurger;
|
|
13
|
+
/** Report the outcome of a purge the delivery performed itself (durable relay). */
|
|
14
|
+
report(batch: InvalidationBatch, outcome: "sent" | "failed", durationMs: number, error?: unknown): void;
|
|
15
|
+
log: {
|
|
16
|
+
warn(obj: unknown, msg: string): void;
|
|
17
|
+
error(obj: unknown, msg: string): void;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* How a batch reaches the purger. `batched` calls it in-process; `durable` persists the batch and a relay
|
|
22
|
+
* delivers it with retry, so a CDN outage or a crash after the write does not leave content stale.
|
|
23
|
+
*/
|
|
24
|
+
interface InvalidationDelivery {
|
|
25
|
+
readonly kind: "batched" | "durable";
|
|
26
|
+
start(ctx: DeliveryContext): void | Promise<void>;
|
|
27
|
+
/** Resolve once the batch is delivered (batched) or safely persisted (durable). Reject on failure. */
|
|
28
|
+
deliver(batch: InvalidationBatch): Promise<void>;
|
|
29
|
+
/** Drain whatever can be drained now (tests, shutdown). */
|
|
30
|
+
drain(): Promise<void>;
|
|
31
|
+
stop(): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
/** In-process delivery: one purger call per batch. A failure is reported and the batch is dropped. */
|
|
34
|
+
export declare function batchedDelivery(): InvalidationDelivery;
|
|
35
|
+
/** Event pattern -> tags (purged hard), or `{ tags, mode }` to choose the mode. */
|
|
36
|
+
type PurgeOn = Readonly<Record<string, (event: DomainEvent<unknown>) => readonly string[] | {
|
|
37
|
+
tags: readonly string[];
|
|
38
|
+
mode: PurgeMode;
|
|
39
|
+
} | undefined>>;
|
|
40
|
+
/**
|
|
41
|
+
* The tags a CRUD event invalidates for a cached resource: `<resource>` (its lists) and `<resource>:<id>`,
|
|
42
|
+
* plus the resource's extra tags for the document. Updates and creates purge soft (stale copy served while
|
|
43
|
+
* one request refreshes); deletes purge hard.
|
|
44
|
+
*/
|
|
45
|
+
export declare function tagsForCrudEvent(event: DomainEvent<unknown>, resources: ReadonlyMap<string, {
|
|
46
|
+
extra?: DocumentTags;
|
|
47
|
+
}>): {
|
|
48
|
+
tags: string[];
|
|
49
|
+
mode: PurgeMode;
|
|
50
|
+
} | undefined;
|
|
51
|
+
/** Bounded reason kinds: a metric label never carries a cookie name or header value. */
|
|
52
|
+
type ReasonKind = "header" | "cookie" | "scope" | "classifier" | "status" | "set-cookie";
|
|
53
|
+
interface PurgeEvent {
|
|
54
|
+
tags: readonly string[];
|
|
55
|
+
mode: PurgeMode;
|
|
56
|
+
delivery: "batched" | "durable";
|
|
57
|
+
/** `enqueued`: written to the durable store; `sent`: the purger accepted it; `failed`: it threw. */
|
|
58
|
+
outcome: "enqueued" | "sent" | "failed";
|
|
59
|
+
durationMs: number;
|
|
60
|
+
error?: unknown;
|
|
61
|
+
}
|
|
62
|
+
/** Hooks for metrics/tracing. Called synchronously; never throw from them. */
|
|
63
|
+
interface HttpCacheObserver {
|
|
64
|
+
onDecision?(event: {
|
|
65
|
+
url: string;
|
|
66
|
+
cacheable: boolean;
|
|
67
|
+
reason?: NonCacheableReason;
|
|
68
|
+
}): void;
|
|
69
|
+
onPurge?(event: PurgeEvent): void;
|
|
70
|
+
}
|
|
71
|
+
interface HttpCacheStats {
|
|
72
|
+
responses: {
|
|
73
|
+
public: number;
|
|
74
|
+
private: Record<ReasonKind, number>;
|
|
75
|
+
};
|
|
76
|
+
purges: {
|
|
77
|
+
enqueued: number;
|
|
78
|
+
sent: number;
|
|
79
|
+
failed: number;
|
|
80
|
+
tags: number;
|
|
81
|
+
};
|
|
82
|
+
pending: number;
|
|
83
|
+
}
|
|
84
|
+
/** Query parameters that never change a response: marketing and click identifiers. */
|
|
85
|
+
export declare const DEFAULT_IGNORED_QUERY: readonly ["utm_*", "fbclid", "gclid", "msclkid", "mc_cid", "mc_eid", "_ga"];
|
|
86
|
+
interface CanonicalQueryOptions {
|
|
87
|
+
/** Parameter names to drop; a trailing `*` matches a prefix. Default {@link DEFAULT_IGNORED_QUERY}. */
|
|
88
|
+
ignore?: readonly string[];
|
|
89
|
+
/** Sort the remaining parameters by name (stable for repeats). Default true. */
|
|
90
|
+
sort?: boolean;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The one URL a response is cached under: tracking parameters dropped, the rest sorted. Equal content,
|
|
94
|
+
* equal key, so a CDN stores one copy instead of one per campaign link.
|
|
95
|
+
*/
|
|
96
|
+
export declare function canonicalUrl(url: string, opts?: CanonicalQueryOptions): string;
|
|
97
|
+
interface DirectiveOptions {
|
|
98
|
+
/** Emit RFC 9213 `CDN-Cache-Control`: the CDN TTL no browser or proxy sees. Default true. */
|
|
99
|
+
cdnCacheControl?: boolean;
|
|
100
|
+
/** Also put `s-maxage` in `Cache-Control`, for CDNs that do not read RFC 9213. Default true. */
|
|
101
|
+
sMaxAge?: boolean;
|
|
102
|
+
}
|
|
103
|
+
type CacheHeaders = Readonly<Record<string, string>>;
|
|
104
|
+
/** Headers for a reply a shared cache may store. One function, so every tier reads one decision. */
|
|
105
|
+
export declare function publicHeaders(policy: HttpCachePolicy, opts?: DirectiveOptions): CacheHeaders;
|
|
106
|
+
/** Headers for a reply no shared cache may store. */
|
|
107
|
+
export declare function privateHeaders(reason: NonCacheableReason): CacheHeaders;
|
|
108
|
+
export declare const DEFAULT_PRIVATE_HEADERS: readonly ["authorization", "x-api-key", "x-organization-id"];
|
|
109
|
+
interface PrivacyOptions {
|
|
110
|
+
/** Request headers that make a request private. Default {@link DEFAULT_PRIVATE_HEADERS}. */
|
|
111
|
+
privateHeaders?: readonly string[];
|
|
112
|
+
/** Cookie names that do NOT make a request private (analytics, consent). Any other cookie does. */
|
|
113
|
+
publicCookies?: readonly string[];
|
|
114
|
+
/** Extra check, AND-ed with the built-in one: return false to make a request private. Never makes one public. */
|
|
115
|
+
classify?: (request: FastifyRequest) => boolean;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Private when ANY signal of a caller is present: a credential header, a cookie outside the allowlist, a
|
|
119
|
+
* non-public arc scope, or the host's classifier. Reasons name the signal, never its value.
|
|
120
|
+
*/
|
|
121
|
+
export declare function classifyPrivacy(request: FastifyRequest, opts?: PrivacyOptions): PrivacyDecision;
|
|
122
|
+
interface HttpCacheOptions {
|
|
123
|
+
/** Where invalidations go. Default: a no-op. Combine tiers with `composePurgers`. */
|
|
124
|
+
purger?: CachePurger;
|
|
125
|
+
/** `batchedDelivery()` (default) or `durableDelivery({ store })` for production. */
|
|
126
|
+
delivery?: InvalidationDelivery;
|
|
127
|
+
/** Collect invalidations this long before one delivery. Default 100 ms. */
|
|
128
|
+
batchWindowMs?: number;
|
|
129
|
+
/** Who counts as a caller. A host `classify` can only add privacy. */
|
|
130
|
+
privacy?: PrivacyOptions;
|
|
131
|
+
/** Path-prefix policies, for routes that cannot carry `config`. A route's own policy wins. */
|
|
132
|
+
rules?: readonly HttpCacheRule[];
|
|
133
|
+
/** Tag header. Default `{ name: 'Cache-Tag', separator: ',' }`; Fastly: `{ name: 'Surrogate-Key', separator: ' ' }`. */
|
|
134
|
+
tagHeader?: {
|
|
135
|
+
name: string;
|
|
136
|
+
separator: string;
|
|
137
|
+
};
|
|
138
|
+
/** Which TTL headers to emit. Default: both `CDN-Cache-Control` and `s-maxage`. */
|
|
139
|
+
headers?: DirectiveOptions;
|
|
140
|
+
/** CDNs that ignore `Vary: Origin` need one fixed allowed origin on cacheable replies, and no credentials header. */
|
|
141
|
+
cors?: {
|
|
142
|
+
origin: string;
|
|
143
|
+
};
|
|
144
|
+
/** Redirect (301) an opted-in GET whose query is not canonical (tracking params, unsorted). Off by default. */
|
|
145
|
+
canonicalQuery?: CanonicalQueryOptions & {
|
|
146
|
+
redirect: true;
|
|
147
|
+
};
|
|
148
|
+
/** Purge resources automatically from their CRUD events. Default true. */
|
|
149
|
+
autoPurge?: boolean;
|
|
150
|
+
/** Explicit event pattern -> tags. Requires the events plugin. */
|
|
151
|
+
purgeOn?: PurgeOn;
|
|
152
|
+
observer?: HttpCacheObserver;
|
|
153
|
+
}
|
|
154
|
+
interface HttpCacheDecorator {
|
|
155
|
+
/** Queue tags. Never throws, never waits for the CDN. Soft falls back to hard where unsupported. */
|
|
156
|
+
invalidate(tags: readonly string[] | string, options?: {
|
|
157
|
+
mode?: PurgeMode;
|
|
158
|
+
}): void;
|
|
159
|
+
/** Deliver the queued batch now (scripts, shutdown, tests). */
|
|
160
|
+
flush(): Promise<void>;
|
|
161
|
+
/** Tags queued and not yet delivered. */
|
|
162
|
+
pending(): readonly string[];
|
|
163
|
+
stats(): HttpCacheStats;
|
|
164
|
+
}
|
|
165
|
+
declare module "fastify" {
|
|
166
|
+
interface FastifyInstance {
|
|
167
|
+
httpCache: HttpCacheDecorator;
|
|
168
|
+
}
|
|
169
|
+
interface FastifyContextConfig {
|
|
170
|
+
httpCache?: RouteHttpCacheConfig;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
export declare const httpCachePlugin: FastifyPluginAsync<HttpCacheOptions>;
|
|
174
|
+
export declare const INVALIDATE_EVENT = "arc.http-cache.invalidate";
|
|
175
|
+
interface DurableDeliveryOptions {
|
|
176
|
+
/** Where batches wait for delivery. A repository-backed store on the app database in production. */
|
|
177
|
+
store: OutboxStore;
|
|
178
|
+
/** Relay interval. Default 1,000 ms. */
|
|
179
|
+
pollMs?: number;
|
|
180
|
+
/** Attempts before a batch is dead-lettered. Default 8. */
|
|
181
|
+
maxAttempts?: number;
|
|
182
|
+
/** Delay before retry `attempt` (1-based). Default: arc's exponential backoff with jitter. */
|
|
183
|
+
retryDelayMs?: (attempt: number) => number;
|
|
184
|
+
/** Batches per relay pass. Default 50. */
|
|
185
|
+
batchSize?: number;
|
|
186
|
+
/** Lease per claimed batch. Default 30,000 ms. */
|
|
187
|
+
leaseMs?: number;
|
|
188
|
+
/** Identifies this replica's relay. Default `arc-http-cache`. */
|
|
189
|
+
consumerId?: string;
|
|
190
|
+
}
|
|
191
|
+
export declare function durableDelivery(options: DurableDeliveryOptions): InvalidationDelivery;
|
|
192
|
+
/** A tag every major CDN accepts: printable ASCII, no space or comma, at most 1,024 characters; de-duplicated. */
|
|
193
|
+
export declare function normalizeTags(tags: readonly unknown[] | undefined): string[];
|
|
194
|
+
/** `<resource>` and `<resource>:<id>`: the convention responses carry and purges target. */
|
|
195
|
+
export declare function resourceTags(resource: string, id?: unknown): string[];
|
|
196
|
+
/** Purges nothing: the default for development and tests. */
|
|
197
|
+
export declare const noopPurger: CachePurger;
|
|
198
|
+
/** Records every call: assert purges in tests without a CDN. */
|
|
199
|
+
export declare function createMemoryPurger(capabilities?: CachePurger["capabilities"]): {
|
|
200
|
+
purger: CachePurger;
|
|
201
|
+
calls: {
|
|
202
|
+
tags: string[];
|
|
203
|
+
mode: PurgeMode;
|
|
204
|
+
}[];
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Purge several tiers at once (CDN + in-process + a second CDN). Each child gets its own chunking and
|
|
208
|
+
* soft-purge support; all are attempted, and any failure rejects with every error.
|
|
209
|
+
*/
|
|
210
|
+
export declare function composePurgers(...purgers: readonly CachePurger[]): CachePurger;
|
|
211
|
+
export { type CacheHeaders, CachePurgeError, type CachePurger, type CanonicalQueryOptions, type DirectiveOptions, type DocumentTags, type DurableDeliveryOptions, type HttpCacheDecorator, type HttpCacheObserver, type HttpCacheOptions, type HttpCachePolicy, type HttpCacheRule, type HttpCacheStats, type InvalidationBatch, type InvalidationDelivery, type NonCacheableReason, type PrivacyDecision, type PrivacyOptions, type PrivacyReason, type PurgeEvent, type PurgeMode, type PurgeOn, type PurgerCapabilities, type ReasonKind, type ResourceHttpCacheConfig, type RouteHttpCacheConfig, type TagSpec };
|