@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
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import { F as ResourceDefinition, G as CrudRouteKey, M as ResourceRegistry, N as RouteRow, S as IntrospectionPluginOptions, V as ResolvedTenantPurge, j as RegisterOptions, o as RegistryEntry } from "../index-
|
|
3
|
-
import "../fastify-augmentation-
|
|
2
|
+
import { F as ResourceDefinition, G as CrudRouteKey, M as ResourceRegistry, N as RouteRow, S as IntrospectionPluginOptions, V as ResolvedTenantPurge, j as RegisterOptions, o as RegistryEntry } from "../index-Cy2-QffW.mjs";
|
|
3
|
+
import "../fastify-augmentation-bzkWPt1f.mjs";
|
|
4
4
|
import { TenantPurgeProgress, TenantPurgeStrategy } from "@classytic/repo-core/repository";
|
|
5
5
|
import { FastifyPluginAsync } from "fastify";
|
|
6
|
-
//#region src/registry/assertNoTenantData.d.ts
|
|
7
6
|
interface AssertNoTenantDataOptions {
|
|
8
7
|
readonly organizationId: string;
|
|
9
8
|
/**
|
|
@@ -61,8 +60,6 @@ interface AssertNoTenantDataReport {
|
|
|
61
60
|
* ```
|
|
62
61
|
*/
|
|
63
62
|
export declare function assertNoTenantData(registry: ResourceRegistry, options: AssertNoTenantDataOptions): Promise<AssertNoTenantDataReport>;
|
|
64
|
-
//#endregion
|
|
65
|
-
//#region src/registry/purgeResource.d.ts
|
|
66
63
|
/**
|
|
67
64
|
* Outcome for one resource. Wider than `TenantPurgeResult` because it
|
|
68
65
|
* carries the resource name + tenantField for the aggregate report,
|
|
@@ -90,8 +87,6 @@ interface PurgeResourceOutcome {
|
|
|
90
87
|
};
|
|
91
88
|
readonly durationMs?: number;
|
|
92
89
|
}
|
|
93
|
-
//#endregion
|
|
94
|
-
//#region src/registry/cascadeOrgDelete.d.ts
|
|
95
90
|
/**
|
|
96
91
|
* Per-resource result row. One entry for every resource Arc attempted to
|
|
97
92
|
* cascade-delete for the given org. `deletedCount: -1` means the adapter
|
|
@@ -275,11 +270,7 @@ export declare function getCascadingResourcesWithMetadata(registry: ResourceRegi
|
|
|
275
270
|
* @param options Org id + filters + logger + progress + signal.
|
|
276
271
|
*/
|
|
277
272
|
export declare function cascadeDeleteForOrganization(registry: ResourceRegistry, options: CascadeOptions): Promise<CascadeReport>;
|
|
278
|
-
//#endregion
|
|
279
|
-
//#region src/registry/introspectionPlugin.d.ts
|
|
280
273
|
declare const _default: FastifyPluginAsync<IntrospectionPluginOptions>;
|
|
281
|
-
//#endregion
|
|
282
|
-
//#region src/registry/manifest.d.ts
|
|
283
274
|
/** Mount-point string the FE uses to derive the URL for an action call. */
|
|
284
275
|
type ActionMount = "/:id/action" | "/action";
|
|
285
276
|
/**
|
|
@@ -349,5 +340,4 @@ export declare function buildResourceManifest(resource: ResourceDefinition): Res
|
|
|
349
340
|
* module into the codegen path.
|
|
350
341
|
*/
|
|
351
342
|
export declare function buildResourceManifestFromRegistry(entry: RegistryEntry): ResourceManifest;
|
|
352
|
-
//#endregion
|
|
353
343
|
export { type ActionManifestEntry, type ActionMount, type AggregationManifestEntry, type AssertNoTenantDataOptions, type AssertNoTenantDataReport, type CascadeCheckpoint, type CascadeCheckpointState, type CascadeOptions, type CascadeReport, type CascadeResourceReport, type CustomRouteManifestEntry, type IntrospectionPluginOptions, type RegisterOptions, type ResourceManifest, ResourceRegistry, type RouteRow, type TenantDataLeak, _default as introspectionPlugin };
|
package/dist/registry/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { a as getCascadingResources, i as cascadeDeleteForOrganization, n as buildResourceManifestFromRegistry, o as getCascadingResourcesWithMetadata, r as introspectionPlugin_default, s as assertNoTenantData, t as buildResourceManifest } from "../registry-
|
|
3
|
-
import { t as ResourceRegistry } from "../ResourceRegistry-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { a as getCascadingResources, i as cascadeDeleteForOrganization, n as buildResourceManifestFromRegistry, o as getCascadingResourcesWithMetadata, r as introspectionPlugin_default, s as assertNoTenantData, t as buildResourceManifest } from "../registry-y9ZA-R_J.mjs";
|
|
3
|
+
import { t as ResourceRegistry } from "../ResourceRegistry-23Ml6FNe.mjs";
|
|
4
4
|
export { ResourceRegistry, assertNoTenantData, buildResourceManifest, buildResourceManifestFromRegistry, cascadeDeleteForOrganization, getCascadingResources, getCascadingResourcesWithMetadata, introspectionPlugin_default as introspectionPlugin };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as CRUD_OPERATIONS } from "./constants-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as CRUD_OPERATIONS } from "./constants-Cx7BcnHT.mjs";
|
|
3
3
|
import fp from "fastify-plugin";
|
|
4
|
-
|
|
4
|
+
// src/registry/assertNoTenantData.ts
|
|
5
5
|
/**
|
|
6
6
|
* Walk every cascading resource, run a tenant-scoped count, compare
|
|
7
7
|
* against the strategy's expected outcome.
|
|
@@ -73,8 +73,7 @@ async function assertNoTenantData(registry, options) {
|
|
|
73
73
|
leaks
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
|
|
77
|
-
//#region src/registry/purgeResource.ts
|
|
76
|
+
// src/registry/purgeResource.ts
|
|
78
77
|
/**
|
|
79
78
|
* Run the resolved strategy against one resource's repository.
|
|
80
79
|
*
|
|
@@ -179,8 +178,7 @@ async function purgeResource(resourceName, tenantField, organizationId, resolved
|
|
|
179
178
|
};
|
|
180
179
|
}
|
|
181
180
|
}
|
|
182
|
-
|
|
183
|
-
//#region src/registry/cascadeOrgDelete.ts
|
|
181
|
+
// src/registry/cascadeOrgDelete.ts
|
|
184
182
|
/**
|
|
185
183
|
* Names of resources flagged for cascade — used by audit scripts.
|
|
186
184
|
* A resource is cascading when its resolved strategy isn't `disabled`
|
|
@@ -394,8 +392,7 @@ async function runWithConcurrency(items, concurrency, fn) {
|
|
|
394
392
|
await Promise.all(workers);
|
|
395
393
|
return results;
|
|
396
394
|
}
|
|
397
|
-
|
|
398
|
-
//#region src/registry/introspectionPlugin.ts
|
|
395
|
+
// src/registry/introspectionPlugin.ts
|
|
399
396
|
const introspectionPlugin = async (fastify, opts = {}) => {
|
|
400
397
|
const { prefix = "/_resources", authRoles = ["superadmin"], enabled = true } = opts;
|
|
401
398
|
if (!enabled) {
|
|
@@ -439,8 +436,7 @@ const introspectionPlugin = async (fastify, opts = {}) => {
|
|
|
439
436
|
fastify.log?.debug?.(`Introspection API at ${prefix}`);
|
|
440
437
|
};
|
|
441
438
|
var introspectionPlugin_default = fp(introspectionPlugin, { name: "arc-introspection" });
|
|
442
|
-
|
|
443
|
-
//#region src/registry/manifest.ts
|
|
439
|
+
// src/registry/manifest.ts
|
|
444
440
|
/**
|
|
445
441
|
* Resource metadata for frontend code generators — `{ name, prefix, idField,
|
|
446
442
|
* versionField?, crudOps, actions[] }`, where each action carries its `mount`
|
|
@@ -556,5 +552,4 @@ function buildResourceManifestFromRegistry(entry) {
|
|
|
556
552
|
...entry.versionField !== void 0 ? { versionField: entry.versionField } : {}
|
|
557
553
|
};
|
|
558
554
|
}
|
|
559
|
-
//#endregion
|
|
560
555
|
export { getCascadingResources as a, cascadeDeleteForOrganization as i, buildResourceManifestFromRegistry as n, getCascadingResourcesWithMetadata as o, introspectionPlugin_default as r, assertNoTenantData as s, buildResourceManifest as t };
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
import {
|
|
5
|
-
import { i as resolveEventTransport } from "./EventTransport-DHb1tpu-.mjs";
|
|
6
|
-
import { t as emitObserved } from "./eventPlugin-ItcYBGUs.mjs";
|
|
7
|
-
import { n as canReportHealth, r as readOutboxHealth } from "./health-PVt0VjOx.mjs";
|
|
8
|
-
import { n as createSafeGetOne, t as createIsDuplicateKeyError } from "./store-helpers-C8uBGCbb.mjs";
|
|
9
|
-
import { t as claimedAttempts } from "./claimed-ChI13rUR.mjs";
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as evictToSize, r as touch } from "./boundedMap-CtdzpJ3X.mjs";
|
|
3
|
+
import { n as createSafeGetOne, t as createIsDuplicateKeyError } from "./store-helpers-D-n5cwy5.mjs";
|
|
4
|
+
import { t as claimedAttempts } from "./claimed-BLecr1j3.mjs";
|
|
10
5
|
import { and, anyOf, eq, lte, ne, or } from "@classytic/repo-core/filter";
|
|
11
|
-
import { randomBytes } from "node:crypto";
|
|
12
6
|
import { InvalidOutboxEventError, OutboxConflictError, OutboxOwnershipError, outboxPayloadFingerprint } from "@classytic/primitives/outbox";
|
|
13
7
|
import { update } from "@classytic/repo-core/update";
|
|
14
|
-
|
|
15
|
-
//#region src/events/outbox/backoff.ts
|
|
8
|
+
// src/events/outbox/backoff.ts
|
|
16
9
|
/**
|
|
17
10
|
* Compute a `retryAt` `Date` using exponential backoff with jitter.
|
|
18
11
|
*
|
|
@@ -56,8 +49,7 @@ function exponentialBackoff(options) {
|
|
|
56
49
|
const jittered = jitter > 0 ? capped * (1 + Math.random() * jitter) : capped;
|
|
57
50
|
return new Date(now + jittered);
|
|
58
51
|
}
|
|
59
|
-
|
|
60
|
-
//#region src/events/repository-outbox-adapter.ts
|
|
52
|
+
// src/events/repository-outbox-adapter.ts
|
|
61
53
|
/** A row read back from the repository that carries its event. */
|
|
62
54
|
function isStoredRow(value) {
|
|
63
55
|
if (typeof value !== "object" || value === null) return false;
|
|
@@ -387,8 +379,7 @@ function repositoryAsOutboxStore(repository, options) {
|
|
|
387
379
|
}
|
|
388
380
|
};
|
|
389
381
|
}
|
|
390
|
-
|
|
391
|
-
//#region src/events/outbox/relay.ts
|
|
382
|
+
// src/events/outbox/relay.ts
|
|
392
383
|
/** Default outbox retention — delivered events older than this are eligible for purge */
|
|
393
384
|
const DEFAULT_OUTBOX_RETENTION_MS = 6048e5;
|
|
394
385
|
const DEFAULT_LEASE_MS = 3e4;
|
|
@@ -748,293 +739,4 @@ function normalizeError(err) {
|
|
|
748
739
|
};
|
|
749
740
|
return { message: String(err) };
|
|
750
741
|
}
|
|
751
|
-
|
|
752
|
-
//#region src/events/outbox-module.ts
|
|
753
|
-
/**
|
|
754
|
-
* The OUTBOX as a module — so the store is a SLOT other modules depend on, not a value the host
|
|
755
|
-
* threads by hand.
|
|
756
|
-
*
|
|
757
|
-
* ## The failure this exists to make impossible
|
|
758
|
-
*
|
|
759
|
-
* A durable store passed as a constructor argument to N consumers will eventually miss one, and
|
|
760
|
-
* the miss is silent. Observed in two independent ERP hosts on the same fleet:
|
|
761
|
-
*
|
|
762
|
-
* - one passed an outbox to its revenue-attach seam and **not** to `createOrder`, so
|
|
763
|
-
* `order:created` published fire-and-forget — a failed publish discarded the revenue trigger
|
|
764
|
-
* entirely: no attach, no dead-letter, no log. Cash collected, nothing recorded.
|
|
765
|
-
* - the other had the identical gap, written independently.
|
|
766
|
-
*
|
|
767
|
-
* Six consumers had to be wired by hand in each host (order kernel, revenue kernel, access
|
|
768
|
-
* kernel, revenue-attach durability, line-activation dead letters, promo-commit dead letters).
|
|
769
|
-
* That is not a discipline problem; it is a design problem.
|
|
770
|
-
*
|
|
771
|
-
* As a module the store is registered ONCE and read from the registry. A consumer declares
|
|
772
|
-
* `dependsOn: ['outbox']` and arc refuses to boot without it — the omission becomes a startup
|
|
773
|
-
* failure instead of a quiet data-loss window.
|
|
774
|
-
*
|
|
775
|
-
* ## What this module does NOT do
|
|
776
|
-
*
|
|
777
|
-
* It does not build a store. Store construction is store-specific (a mongo model, a SQL table),
|
|
778
|
-
* and arc is deliberately storage-agnostic — `repositoryAsOutboxStore` already adapts any
|
|
779
|
-
* repository, and kits own their own schema (e.g. `@classytic/mongokit/outbox`). This module owns
|
|
780
|
-
* the three things that are genuinely arc's: the module SLOT, the relay SCHEDULE, and shutdown.
|
|
781
|
-
*/
|
|
782
|
-
/**
|
|
783
|
-
* The store contract is `@classytic/primitives/outbox`'s, not arc's — arc adapts to it rather
|
|
784
|
-
* than owning it, which is why a kit (mongokit) can supply a store with no arc dependency.
|
|
785
|
-
*/
|
|
786
|
-
/** Default relay cadence. Frequent enough that a retry is not a user-visible delay. */
|
|
787
|
-
const DEFAULT_RELAY_EVERY_MS = 5e3;
|
|
788
|
-
/** How long the readiness check reuses a relay-health reading. See `health.probeCacheMs`. */
|
|
789
|
-
const DEFAULT_PROBE_CACHE_MS = 5e3;
|
|
790
|
-
/** How often an unhealthy outbox is logged. See `health.alertEveryMs`. */
|
|
791
|
-
const DEFAULT_HEALTH_ALERT_EVERY_MS = 3e5;
|
|
792
|
-
/**
|
|
793
|
-
* One relay identity per RELAY INSTANCE — `<name>:<hostname>:<pid>:<random>`.
|
|
794
|
-
*
|
|
795
|
-
* A lease identifies an independently executing CLAIMANT, not a crash domain.
|
|
796
|
-
* Arc lets two outbox modules coexist (`name` is the `dependsOn` key), each
|
|
797
|
-
* with its own schedule arm, and nothing stops two of them pointing at the
|
|
798
|
-
* same store: they tick independently, so they are two claimants and must be
|
|
799
|
-
* two identities. Scoping this per-process instead would have made the module
|
|
800
|
-
* WEAKER than the primitive it wraps — `EventOutbox`'s own fallback is already
|
|
801
|
-
* per-instance — and would leave the store unable to tell the two apart after
|
|
802
|
-
* a lease expiry, which is exactly the stale-owner hole this replaced.
|
|
803
|
-
*
|
|
804
|
-
* Every component earns its place: `name` distinguishes co-resident modules,
|
|
805
|
-
* `hostname:pid` makes a lease row legible in ops tooling, and the random
|
|
806
|
-
* suffix breaks the tie a container restart creates — same hostname, often the
|
|
807
|
-
* same pid, and the restarted process must not inherit a predecessor's
|
|
808
|
-
* identity while that predecessor's lease is still live.
|
|
809
|
-
*
|
|
810
|
-
* Called once per `bootstrap()`, so the id is stable across every tick of the
|
|
811
|
-
* relay it belongs to — which the lease depends on.
|
|
812
|
-
*/
|
|
813
|
-
function mintConsumerId(name) {
|
|
814
|
-
return `${name}:${hostname()}:${process.pid}:${randomBytes(4).toString("hex")}`;
|
|
815
|
-
}
|
|
816
|
-
/**
|
|
817
|
-
* Compose the outbox as a module.
|
|
818
|
-
*
|
|
819
|
-
* ```ts
|
|
820
|
-
* // host
|
|
821
|
-
* const model = createOutboxModel(connection, { visibleAtField: 'nextVisibleAt' });
|
|
822
|
-
* createApp({ modules: [
|
|
823
|
-
* createOutboxModule({
|
|
824
|
-
* store: repositoryAsOutboxStore(new Repository(model), { visibleAtField: 'nextVisibleAt' }),
|
|
825
|
-
* onError: (err, ctx) => app.log.error({ err, ...ctx }, 'outbox relay'),
|
|
826
|
-
* }),
|
|
827
|
-
* …
|
|
828
|
-
* ]});
|
|
829
|
-
*
|
|
830
|
-
* // consumer module
|
|
831
|
-
* defineModule({
|
|
832
|
-
* name: 'order',
|
|
833
|
-
* dependsOn: ['outbox'],
|
|
834
|
-
* bootstrap: (f) => createOrder({
|
|
835
|
-
* outbox: getModuleExports<OutboxModuleExports>(f, 'outbox').store,
|
|
836
|
-
* }),
|
|
837
|
-
* });
|
|
838
|
-
* ```
|
|
839
|
-
*
|
|
840
|
-
* `dependsOn` is doing real work there: it both orders the bootstraps and makes a missing outbox a
|
|
841
|
-
* boot error naming the module that needed it.
|
|
842
|
-
*/
|
|
843
|
-
function createOutboxModule(options) {
|
|
844
|
-
const name = options.name ?? "outbox";
|
|
845
|
-
const relayEveryMs = options.relayEveryMs ?? DEFAULT_RELAY_EVERY_MS;
|
|
846
|
-
const lagUnhealthyMs = (options.health === false ? void 0 : options.health?.relayLagUnhealthyMs) ?? 3e5;
|
|
847
|
-
const probeCacheMs = (options.health === false ? void 0 : options.health?.probeCacheMs) ?? DEFAULT_PROBE_CACHE_MS;
|
|
848
|
-
if (!Number.isFinite(probeCacheMs) || probeCacheMs < 0) throw new Error(`Outbox module "${name}": health.probeCacheMs must be a non-negative number, got ${String(probeCacheMs)}.`);
|
|
849
|
-
const alertEveryMs = options.health === false ? 0 : options.health?.alertEveryMs ?? DEFAULT_HEALTH_ALERT_EVERY_MS;
|
|
850
|
-
if (!Number.isFinite(alertEveryMs) || alertEveryMs < 0) throw new Error(`Outbox module "${name}": health.alertEveryMs must be a non-negative number, got ${String(alertEveryMs)}.`);
|
|
851
|
-
let log;
|
|
852
|
-
/** The unmeasurable-store warning is said once, not every alert tick. */
|
|
853
|
-
let warnedUnmeasurable = false;
|
|
854
|
-
/**
|
|
855
|
-
* The readiness probe's reading, reused for `probeCacheMs` and shared by
|
|
856
|
-
* concurrent probes (single-flight). A failed or unmeasurable reading is
|
|
857
|
-
* cached as unhealthy for the same window — retrying a failing store on
|
|
858
|
-
* every probe is load on the thing that is already failing.
|
|
859
|
-
*/
|
|
860
|
-
let probeReading;
|
|
861
|
-
let probeInFlight;
|
|
862
|
-
const probeHealthy = (read) => {
|
|
863
|
-
if (probeReading && Date.now() - probeReading.at < probeCacheMs) return Promise.resolve(probeReading.healthy);
|
|
864
|
-
probeInFlight ??= read().then((h) => h.healthy, () => false).then((healthy) => {
|
|
865
|
-
probeReading = {
|
|
866
|
-
at: Date.now(),
|
|
867
|
-
healthy
|
|
868
|
-
};
|
|
869
|
-
return healthy;
|
|
870
|
-
}).finally(() => {
|
|
871
|
-
probeInFlight = void 0;
|
|
872
|
-
});
|
|
873
|
-
return probeInFlight;
|
|
874
|
-
};
|
|
875
|
-
/**
|
|
876
|
-
* Built at bootstrap and reused by the schedule.
|
|
877
|
-
*
|
|
878
|
-
* Not rebuilt per tick: `EventOutbox` carries the consumer id the lease is keyed on, and a fresh
|
|
879
|
-
* instance per tick would be a fresh claimant every few seconds — which defeats the lease it
|
|
880
|
-
* depends on for exactly-once publishing.
|
|
881
|
-
*/
|
|
882
|
-
let exports;
|
|
883
|
-
/** Passes THIS module started (nudge, schedule) that have not settled — `drain()` waits on them. */
|
|
884
|
-
const inFlightPasses = /* @__PURE__ */ new Set();
|
|
885
|
-
const trackPass = (pass) => {
|
|
886
|
-
inFlightPasses.add(pass);
|
|
887
|
-
const untrack = () => {
|
|
888
|
-
inFlightPasses.delete(pass);
|
|
889
|
-
};
|
|
890
|
-
pass.then(untrack, untrack);
|
|
891
|
-
return pass;
|
|
892
|
-
};
|
|
893
|
-
return {
|
|
894
|
-
name,
|
|
895
|
-
bootstrap: (fastify) => {
|
|
896
|
-
log = fastify.log;
|
|
897
|
-
const store = typeof options.store === "function" ? options.store(fastify) : options.store;
|
|
898
|
-
/**
|
|
899
|
-
* The RAW transport, never `fastify.events`.
|
|
900
|
-
*
|
|
901
|
-
* This read used to be `(fastify as { events?: EventTransport }).events` — a cast across
|
|
902
|
-
* two INCOMPATIBLE shapes. The facade's `publish(type, payload, meta?)` took the relayed
|
|
903
|
-
* `DomainEvent` as its `type` argument and failed the non-empty-string guard, so the
|
|
904
|
-
* documented default path published NOTHING: subscribers saw nothing and every tick
|
|
905
|
-
* reported `publishFailed: 1` until the row dead-lettered. The cast is what let two
|
|
906
|
-
* mismatched signatures typecheck.
|
|
907
|
-
*/
|
|
908
|
-
const transport = options.transport === void 0 ? resolveEventTransport(fastify) : typeof options.transport === "function" ? options.transport(fastify) : options.transport;
|
|
909
|
-
/**
|
|
910
|
-
* No transport is BOOT-FATAL, because the alternative is invisible:
|
|
911
|
-
* `EventOutbox.relayBatch()` returns an empty result when it has none, so the
|
|
912
|
-
* module's schedule would tick forever, publish nothing, and let the store grow —
|
|
913
|
-
* a durable backlog nobody is draining, reported as healthy. The failure this
|
|
914
|
-
* module exists to prevent, arrived at from the other side.
|
|
915
|
-
*/
|
|
916
|
-
if (transport === void 0) throw new Error(`Outbox module "${name}" could not resolve an event transport, so its relay would tick forever without publishing while the store grows. Register arc's events plugin (it is on by default — check \`arcPlugins.events !== false\`), or pass an explicit \`transport\` to \`createOutboxModule\`. Note the outbox needs the RAW EventTransport, not the \`fastify.events\` facade: the facade takes \`(type, payload, meta?)\` and fails open, which would acknowledge rows whose publish actually failed.`);
|
|
917
|
-
const relay = new EventOutbox({
|
|
918
|
-
store,
|
|
919
|
-
transport,
|
|
920
|
-
onPublished: (event) => emitObserved(fastify.events, event),
|
|
921
|
-
...options.batchSize !== void 0 ? { batchSize: options.batchSize } : {},
|
|
922
|
-
...options.leaseMs !== void 0 ? { leaseMs: options.leaseMs } : {},
|
|
923
|
-
consumerId: options.consumerId ?? mintConsumerId(name),
|
|
924
|
-
onError: options.onError ?? ((info) => {
|
|
925
|
-
fastify.log.error({
|
|
926
|
-
err: info.error,
|
|
927
|
-
kind: info.kind,
|
|
928
|
-
...info.event?.meta.id !== void 0 ? { eventId: info.event.meta.id } : {},
|
|
929
|
-
...info.event?.type !== void 0 ? { eventType: info.event.type } : {}
|
|
930
|
-
}, `outbox relay "${name}" failed`);
|
|
931
|
-
}),
|
|
932
|
-
...options.failurePolicy !== void 0 ? { failurePolicy: options.failurePolicy } : {},
|
|
933
|
-
...options.sessionProvider === false ? {} : { sessionProvider: options.sessionProvider ?? (() => transactionContext.get()) }
|
|
934
|
-
});
|
|
935
|
-
/**
|
|
936
|
-
* One pass per burst of requests. `drainQueued` stays true from the
|
|
937
|
-
* first request until the pass STARTS, so a request landing mid-pass
|
|
938
|
-
* schedules the next one — a row written during a pass is never left
|
|
939
|
-
* waiting for the interval.
|
|
940
|
-
*/
|
|
941
|
-
let drainQueued = false;
|
|
942
|
-
const requestDrain = () => {
|
|
943
|
-
if (drainQueued) return;
|
|
944
|
-
drainQueued = true;
|
|
945
|
-
let passDone = () => {};
|
|
946
|
-
trackPass(new Promise((resolve) => passDone = resolve));
|
|
947
|
-
setImmediate(() => {
|
|
948
|
-
drainQueued = false;
|
|
949
|
-
requestContext.storage.exit(() => {
|
|
950
|
-
relay.relayBatch().catch((err) => {
|
|
951
|
-
fastify.log.error({ err }, `outbox relay "${name}" requested drain failed`);
|
|
952
|
-
}).finally(passDone);
|
|
953
|
-
});
|
|
954
|
-
});
|
|
955
|
-
};
|
|
956
|
-
const drain = ({ maxPasses = 100 } = {}) => requestContext.storage.exit(async () => {
|
|
957
|
-
const total = {
|
|
958
|
-
passes: 0,
|
|
959
|
-
relayed: 0,
|
|
960
|
-
publishFailed: 0,
|
|
961
|
-
deadLettered: 0,
|
|
962
|
-
drained: false
|
|
963
|
-
};
|
|
964
|
-
while (total.passes < maxPasses) {
|
|
965
|
-
if (inFlightPasses.size > 0) await Promise.allSettled([...inFlightPasses]);
|
|
966
|
-
const r = await relay.relayBatch();
|
|
967
|
-
total.passes++;
|
|
968
|
-
total.relayed += r.relayed;
|
|
969
|
-
total.publishFailed += r.publishFailed;
|
|
970
|
-
total.deadLettered += r.deadLettered;
|
|
971
|
-
if (r.attempted === 0 && inFlightPasses.size === 0) {
|
|
972
|
-
total.drained = true;
|
|
973
|
-
break;
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
return total;
|
|
977
|
-
});
|
|
978
|
-
const health = async () => {
|
|
979
|
-
if (!canReportHealth(store)) throw new Error(`Outbox module "${name}": relay health needs BOTH countByStatus and oldestPendingAgeMs on the store, and it is missing at least one.`);
|
|
980
|
-
return readOutboxHealth(store, lagUnhealthyMs);
|
|
981
|
-
};
|
|
982
|
-
exports = {
|
|
983
|
-
store,
|
|
984
|
-
relay,
|
|
985
|
-
requestDrain,
|
|
986
|
-
drain,
|
|
987
|
-
health
|
|
988
|
-
};
|
|
989
|
-
return exports;
|
|
990
|
-
},
|
|
991
|
-
...options.health === false ? {} : { healthChecks: [{
|
|
992
|
-
name: `${name}.relay`,
|
|
993
|
-
critical: false,
|
|
994
|
-
check: () => exports ? probeHealthy(exports.health) : Promise.resolve(false)
|
|
995
|
-
}] },
|
|
996
|
-
/**
|
|
997
|
-
* The relay runs on the module's OWN schedule arm, so the host stops owning the tick — and
|
|
998
|
-
* a host that forgets to start one cannot exist.
|
|
999
|
-
*/
|
|
1000
|
-
scheduledJobs: () => [{
|
|
1001
|
-
name: `${name}.relay`,
|
|
1002
|
-
kind: "relay",
|
|
1003
|
-
every: relayEveryMs,
|
|
1004
|
-
runOnStart: options.runOnStart ?? true,
|
|
1005
|
-
handler: async () => {
|
|
1006
|
-
if (exports) await trackPass(exports.relay.relay());
|
|
1007
|
-
}
|
|
1008
|
-
}, ...alertEveryMs > 0 ? [{
|
|
1009
|
-
name: `${name}.health`,
|
|
1010
|
-
kind: "relay",
|
|
1011
|
-
every: alertEveryMs,
|
|
1012
|
-
handler: async () => {
|
|
1013
|
-
if (!exports || !log) return;
|
|
1014
|
-
if (!canReportHealth(exports.store)) {
|
|
1015
|
-
if (!warnedUnmeasurable) {
|
|
1016
|
-
warnedUnmeasurable = true;
|
|
1017
|
-
log.warn({
|
|
1018
|
-
marker: "OUTBOX_HEALTH_UNMEASURABLE",
|
|
1019
|
-
outbox: name
|
|
1020
|
-
}, `outbox "${name}" store lacks countByStatus or oldestPendingAgeMs — relay stalls cannot be alerted on`);
|
|
1021
|
-
}
|
|
1022
|
-
return;
|
|
1023
|
-
}
|
|
1024
|
-
const h = await exports.health();
|
|
1025
|
-
if (h.deadLetter > 0) log.warn({
|
|
1026
|
-
marker: "OUTBOX_DEAD_LETTER",
|
|
1027
|
-
outbox: name,
|
|
1028
|
-
...h
|
|
1029
|
-
}, `outbox "${name}" has dead-lettered events — inspect and replay them`);
|
|
1030
|
-
if (h.relayLagMs !== null && h.relayLagMs >= lagUnhealthyMs) log.error({
|
|
1031
|
-
marker: "OUTBOX_RELAY_LAG",
|
|
1032
|
-
outbox: name,
|
|
1033
|
-
...h
|
|
1034
|
-
}, `outbox "${name}" relay is behind — events are committed but not delivered`);
|
|
1035
|
-
}
|
|
1036
|
-
}] : []]
|
|
1037
|
-
};
|
|
1038
|
-
}
|
|
1039
|
-
//#endregion
|
|
1040
|
-
export { exponentialBackoff as i, EventOutbox as n, repositoryAsOutboxStore as r, createOutboxModule as t };
|
|
742
|
+
export { repositoryAsOutboxStore as n, exponentialBackoff as r, EventOutbox as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
// src/lock/renewingLease.ts
|
|
3
3
|
/**
|
|
4
4
|
* Start renewing an ALREADY-ACQUIRED lease. The caller performed the
|
|
5
5
|
* initial `tryAcquire` (its contention policy differs per consumer); this
|
|
@@ -53,5 +53,4 @@ function startRenewingLease(options) {
|
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
//#endregion
|
|
57
56
|
export { startRenewingLease as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-yH2lHMo_.mjs";
|
|
3
3
|
import { toCanonicalList } from "@classytic/repo-core/pagination";
|
|
4
4
|
import fp from "fastify-plugin";
|
|
5
|
-
|
|
5
|
+
// src/plugins/replyHelpers.ts
|
|
6
6
|
var replyHelpers_exports = /* @__PURE__ */ __exportAll({ replyHelpersPlugin: () => replyHelpersPlugin });
|
|
7
7
|
async function replyHelpersPluginFn(fastify) {
|
|
8
8
|
fastify.decorateReply("sendList", function(input) {
|
|
@@ -19,5 +19,4 @@ const replyHelpersPlugin = fp(replyHelpersPluginFn, {
|
|
|
19
19
|
name: "arc-reply-helpers",
|
|
20
20
|
fastify: "5.x"
|
|
21
21
|
});
|
|
22
|
-
//#endregion
|
|
23
22
|
export { replyHelpers_exports as n, replyHelpersPlugin as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
|
-
|
|
3
|
+
// src/context/requestContext.ts
|
|
4
4
|
/**
|
|
5
5
|
* Request Context via AsyncLocalStorage
|
|
6
6
|
*
|
|
@@ -90,5 +90,4 @@ function getTraceHeaders() {
|
|
|
90
90
|
if (store.tracestate) headers.tracestate = store.tracestate;
|
|
91
91
|
return Object.keys(headers).length > 0 ? headers : void 0;
|
|
92
92
|
}
|
|
93
|
-
//#endregion
|
|
94
93
|
export { requestContext as n, getTraceHeaders as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
// src/idempotency/requirement.ts
|
|
3
3
|
/** What is wrong with a route's idempotency declaration, or `undefined` when it is sound. */
|
|
4
4
|
function idempotencyConfigProblem(config) {
|
|
5
5
|
const idem = config?.idempotency;
|
|
@@ -31,5 +31,4 @@ function requestRequiresIdempotencyKey(request) {
|
|
|
31
31
|
const action = request.body?.action;
|
|
32
32
|
return typeof action === "string" && idem.requiredActions.includes(action);
|
|
33
33
|
}
|
|
34
|
-
//#endregion
|
|
35
34
|
export { requestRequiresIdempotencyKey as i, idempotencyConfigProblem as n, requestDedupedByHandler as r, declaresIdempotencyFence as t };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
import { FastifyRequest } from "fastify";
|
|
3
|
-
//#region src/idempotency/requirement.d.ts
|
|
4
3
|
/** The `config.idempotency` slot of a Fastify route. */
|
|
5
4
|
interface RouteIdempotencyConfig {
|
|
6
5
|
/** Every call needs a key — any method, DELETE included. */
|
|
@@ -18,5 +17,4 @@ interface RouteIdempotencyConfig {
|
|
|
18
17
|
/** Action route only: action name -> owner, for actions in `requiredActions` that dedupe themselves. */
|
|
19
18
|
readonly handlerDedup?: Readonly<Record<string, string>>;
|
|
20
19
|
}
|
|
21
|
-
//#endregion
|
|
22
20
|
export { RouteIdempotencyConfig as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as createTenantKeyGenerator } from "./rateLimitKey-
|
|
3
|
-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as createTenantKeyGenerator } from "./rateLimitKey-CWAjlqcN.mjs";
|
|
3
|
+
// src/permissions/resourceRateLimit.ts
|
|
4
4
|
function decision(allowed, max, remaining, ttlSeconds) {
|
|
5
5
|
const reset = Math.max(1, ttlSeconds);
|
|
6
6
|
return {
|
|
@@ -176,5 +176,4 @@ function resourceRateLimitWindowMs(window) {
|
|
|
176
176
|
if (!Number.isSafeInteger(value) || value <= 0) throw new Error(`rateLimit.timeWindow '${window}' must be a positive duration in milliseconds.`);
|
|
177
177
|
return value;
|
|
178
178
|
}
|
|
179
|
-
//#endregion
|
|
180
179
|
export { resourceRateLimitWindowMs as a, resolveResourceRateLimiter as i, markRateLimitingDisabled as n, recordUnenforcedRateLimit as r, createMemoryResourceRateLimiter as t };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { i as RequestScope } from "./types-
|
|
2
|
+
import { i as RequestScope } from "./types-DnkIALZ8.mjs";
|
|
3
3
|
import { FastifyInstance } from "fastify";
|
|
4
|
-
//#region src/permissions/resourceRateLimit.d.ts
|
|
5
4
|
interface ResourceRateLimitPolicy {
|
|
6
5
|
max: number;
|
|
7
6
|
timeWindow: string;
|
|
@@ -26,5 +25,4 @@ interface ResourceRateLimiter {
|
|
|
26
25
|
declare function resolveResourceRateLimiter(app: FastifyInstance, durability?: ResourceRateLimiter["durability"]): ResourceRateLimiter | undefined;
|
|
27
26
|
/** Standalone tools may use memory; wired distributed apps use the host's shared store. */
|
|
28
27
|
declare function createMemoryResourceRateLimiter(capacity?: number): ResourceRateLimiter;
|
|
29
|
-
//#endregion
|
|
30
28
|
export { createMemoryResourceRateLimiter as a, ResourceRateLimiter as i, ResourceRateLimitDecision as n, resolveResourceRateLimiter as o, ResourceRateLimitPolicy as r, ResourceRateLimitContext as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
2
|
import "node:module";
|
|
3
|
-
|
|
3
|
+
// \0rolldown/runtime.js
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __exportAll = (all, no_symbols) => {
|
|
6
6
|
let target = {};
|
|
@@ -11,5 +11,4 @@ var __exportAll = (all, no_symbols) => {
|
|
|
11
11
|
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
12
12
|
return target;
|
|
13
13
|
};
|
|
14
|
-
//#endregion
|
|
15
14
|
export { __exportAll as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
2
|
import { AjvCompiler } from "@fastify/ajv-compiler";
|
|
3
|
-
|
|
3
|
+
// src/core/routeValidator.ts
|
|
4
4
|
/**
|
|
5
5
|
* Arc's request validator — the AJV settings every route arc builds is validated with, on ANY host.
|
|
6
6
|
*
|
|
@@ -66,5 +66,4 @@ function lowerCaseHeaderSchema(schema) {
|
|
|
66
66
|
function isPlainObject(value) {
|
|
67
67
|
return typeof value === "object" && value !== null && Object.getPrototypeOf(value) === Object.prototype;
|
|
68
68
|
}
|
|
69
|
-
//#endregion
|
|
70
69
|
export { arcRouteValidatorCompiler as n, markArcRootValidator as r, arcAjvCustomOptions as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
// src/utils/runtimeCapabilities.ts
|
|
3
3
|
/**
|
|
4
4
|
* `Symbol.for` so declarations from two arc copies in one dependency graph
|
|
5
5
|
* land in ONE registry — same reasoning as `ARC_EVENT_TRANSPORT`. Not on the
|
|
@@ -71,5 +71,4 @@ function auditRuntimeCapabilities(fastify, runtime) {
|
|
|
71
71
|
throw new Error(`runtime: 'distributed' — ${violations.length} subsystem(s) hold PER-PROCESS state that multi-replica deployment breaks:\n${lines}\nWire a shared store for each, or — where per-process is genuinely intended — have the declarant pass \`accepted: true\` with a reason.`);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
//#endregion
|
|
75
74
|
export { declareRuntimeCapability as n, initRuntimeCapabilityRegistry as r, auditRuntimeCapabilities as t };
|