@classytic/arc 2.45.2 → 2.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{EventTransport-CiicKz2Z.d.mts → EventTransport-CYEoCJGe.d.mts} +0 -2
- package/dist/{EventTransport-DHb1tpu-.mjs → EventTransport-DNgD9NP4.mjs} +3 -4
- package/dist/{HookSystem-C1u0EUnt.mjs → HookSystem-DRbPzEcP.mjs} +3 -4
- package/dist/{QueryCache--5uAuYPW.d.mts → QueryCache-DdvrGG8Q.d.mts} +1 -3
- package/dist/{ResourceRegistry-D2jXWVN_.mjs → ResourceRegistry-Douk51fa.mjs} +15 -4
- package/dist/{acquire-DTkA8Lme.mjs → acquire-RbtvDg9s.mjs} +2 -3
- package/dist/{actionPermissions-DRVk6m7x.mjs → actionPermissions-De0AJ7hm.mjs} +37 -42
- package/dist/audit/index.d.mts +2 -10
- package/dist/audit/index.mjs +8 -12
- package/dist/auth/audit.d.mts +0 -2
- package/dist/auth/audit.mjs +2 -3
- package/dist/auth/index.d.mts +9 -17
- package/dist/auth/index.mjs +26 -29
- package/dist/auth/redis-session.d.mts +2 -4
- package/dist/auth/redis-session.mjs +2 -3
- package/dist/{authorizationDecision-D48fUJv1.mjs → authorizationDecision-DeZMrHcm.mjs} +5 -6
- package/dist/{base-CZyixEQR.d.mts → base-HXNgPQww.d.mts} +1 -7
- package/dist/{boundedMap-DkKiPifd.mjs → boundedMap-2WBh3gM9.mjs} +2 -3
- package/dist/{buildHandler-BiZ4VATS.mjs → buildHandler-DxVOOBpw.mjs} +5 -6
- package/dist/cache/index.d.mts +4 -10
- package/dist/cache/index.mjs +5 -6
- package/dist/{caching-Cj0as-P1.mjs → caching-BYRwYrUo.mjs} +3 -4
- package/dist/{claimed-ChI13rUR.mjs → claimed-DYlELdnm.mjs} +2 -3
- package/dist/cleanup/index.d.mts +4 -18
- package/dist/cleanup/index.mjs +12 -20
- package/dist/cli/commands/describe.d.mts +1 -3
- package/dist/cli/commands/describe.mjs +4 -5
- package/dist/cli/commands/docs.d.mts +1 -3
- package/dist/cli/commands/docs.mjs +4 -5
- package/dist/cli/commands/doctor.d.mts +1 -3
- package/dist/cli/commands/doctor.mjs +2 -3
- package/dist/cli/commands/generate.d.mts +1 -1
- package/dist/cli/commands/generate.mjs +2 -2
- package/dist/cli/commands/init.d.mts +1 -1
- package/dist/cli/commands/init.mjs +2 -2
- package/dist/cli/commands/introspect.d.mts +1 -3
- package/dist/cli/commands/introspect.mjs +3 -4
- package/dist/cli/index.d.mts +2 -2
- package/dist/cli/index.mjs +3 -3
- package/dist/{constants-D_aiew34.mjs → constants-CHZMUwBW.mjs} +2 -3
- package/dist/context/index.d.mts +0 -8
- package/dist/context/index.mjs +6 -7
- package/dist/core/index.d.mts +3 -3
- package/dist/core/index.mjs +8 -8
- package/dist/{core-QIZ2560Y.mjs → core-D9rS2BxO.mjs} +9 -12
- package/dist/{createActionRouter-CvH84dyx.mjs → createActionRouter-0qkCRzTL.mjs} +7 -8
- package/dist/{createAggregationRouter-DGyK2Hp6.mjs → createAggregationRouter-CUf5Esd9.mjs} +9 -10
- package/dist/{createApp-CKjZpmq9.mjs → createApp-DZIXfDKD.mjs} +49 -62
- package/dist/{createMcpServer-DSztofa9.d.mts → createMcpServer-DeVpqQF-.d.mts} +1 -3
- package/dist/{defineAggregation-BLza7Ca4.mjs → defineAggregation-bmKQ4NmC.mjs} +2 -3
- package/dist/{defineResource-CEo0gDCb.mjs → defineResource-CGmdmGwh.mjs} +78 -29
- package/dist/discovery/index.d.mts +1 -3
- package/dist/discovery/index.mjs +2 -3
- package/dist/docs/index.d.mts +8 -8
- package/dist/docs/index.mjs +4 -5
- package/dist/{elevation-BJTsSnke.mjs → elevation-CzhqAyVN.mjs} +9 -10
- package/dist/{elevation-BW2J3tNj.d.mts → elevation-DPD0hcU-.d.mts} +0 -2
- package/dist/encryption/index.d.mts +1 -7
- package/dist/encryption/index.mjs +8 -13
- package/dist/{errorHandler--4rSMMvq.d.mts → errorHandler-B9r88jZV.d.mts} +8 -3
- package/dist/{errorHandler-2p4SL5zm.mjs → errorHandler-dFyGOEoB.mjs} +16 -6
- package/dist/{errors-grZkIA8N.mjs → errors-BY8vzlP4.mjs} +2 -3
- package/dist/{errors-JYc9vwqE.d.mts → errors-DTo0me1o.d.mts} +0 -2
- package/dist/{eventPlugin-BtmA4-3P.d.mts → eventPlugin-BY38F6yK.d.mts} +1 -7
- package/dist/{eventPlugin-ItcYBGUs.mjs → eventPlugin-eMhAPtQA.mjs} +10 -12
- package/dist/{eventTypes-Ck6fD3ne.mjs → eventTypes-Do2KYeJx.mjs} +5 -8
- package/dist/events/index.d.mts +4 -16
- package/dist/events/index.mjs +8 -9
- package/dist/events/transports/redis-stream-entry.d.mts +1 -1
- package/dist/events/transports/redis-stream-entry.mjs +5 -6
- package/dist/events/transports/redis.d.mts +2 -4
- package/dist/events/transports/redis.mjs +3 -4
- package/dist/{externalPaths-CmGOxOtD.d.mts → externalPaths-BOqdq5wr.d.mts} +0 -2
- package/dist/factory/index.d.mts +4 -14
- package/dist/factory/index.mjs +12 -18
- package/dist/{fastify-augmentation-DRlCIWE9.d.mts → fastify-augmentation-Dtn0IIRn.d.mts} +4 -10
- package/dist/{fields-BBSpf8pS.d.mts → fields-JTkrtO-r.d.mts} +0 -2
- package/dist/{fields-BRX0Krcj.mjs → fields-LnbCcvsw.mjs} +2 -3
- package/dist/{filter-merge-CDc7YMwX.mjs → filter-merge-BAWi019Q.mjs} +2 -3
- package/dist/{generate-DCGuEbqI.d.mts → generate-C-g_KOkV.d.mts} +0 -4
- package/dist/{generate-hvg7V2g1.mjs → generate-oXoDnpJf.mjs} +7 -12
- package/dist/{headers-Cqkg4LzI.mjs → headers-DBd3Qheo.mjs} +3 -4
- package/dist/{health-PVt0VjOx.mjs → health-BlJu9GXS.mjs} +2 -3
- package/dist/{health-DyeP3mTW.mjs → health-Dp-3EC9o.mjs} +4 -7
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/idempotency/index.d.mts +3 -9
- package/dist/idempotency/index.mjs +10 -13
- package/dist/idempotency/redis.d.mts +1 -1
- package/dist/idempotency/redis.mjs +3 -4
- package/dist/{index-Bxriq3so.d.mts → index-B5i9-vuP.d.mts} +4 -26
- package/dist/{index-Chgz3d0i.d.mts → index-BAXDo5eE.d.mts} +1 -7
- package/dist/{index-Beg3aNnK.d.mts → index-BTxzJ_MN.d.mts} +67 -25
- package/dist/{index-CUJvoyw3.d.mts → index-Bqfo8hLz.d.mts} +2 -24
- package/dist/{index-uhkUA5-U.d.mts → index-CUdaoCYt.d.mts} +13 -23
- package/dist/{index-WH7xgvxS.d.mts → index-DyJFTJLA.d.mts} +31 -92
- package/dist/index.d.mts +7 -9
- package/dist/index.mjs +12 -13
- package/dist/{init-jC3rMPzb.mjs → init-BOaNkLYb.mjs} +18 -35
- package/dist/{init-Cscs4lab.d.mts → init-CV2_Fw3H.d.mts} +0 -4
- package/dist/integrations/event-gateway.d.mts +3 -5
- package/dist/integrations/event-gateway.mjs +3 -4
- package/dist/integrations/index.d.mts +3 -3
- package/dist/integrations/index.mjs +1 -1
- package/dist/integrations/jobs/index.d.mts +1 -1
- package/dist/integrations/jobs/index.mjs +7 -11
- package/dist/integrations/mcp/index.d.mts +7 -39
- package/dist/integrations/mcp/index.mjs +8 -14
- package/dist/integrations/mcp/testing.d.mts +3 -5
- package/dist/integrations/mcp/testing.mjs +3 -4
- package/dist/integrations/streamline.d.mts +1 -3
- package/dist/integrations/streamline.mjs +4 -5
- package/dist/integrations/webhooks.d.mts +2 -4
- package/dist/integrations/webhooks.mjs +4 -5
- package/dist/integrations/websocket-pushref-redis.d.mts +2 -4
- package/dist/integrations/websocket-pushref-redis.mjs +2 -3
- package/dist/integrations/websocket-redis.d.mts +2 -4
- package/dist/integrations/websocket-redis.mjs +2 -3
- package/dist/integrations/websocket.d.mts +2 -2
- package/dist/integrations/websocket.mjs +13 -24
- package/dist/{interface-JJzwH4Ro.d.mts → interface-BmExzQRD.d.mts} +0 -2
- package/dist/{interface-BOk3YnTz.d.mts → interface-WR1U0K7t.d.mts} +0 -2
- package/dist/{jsonBody-ptwyzZQ-.mjs → jsonBody-DpRpKR_K.mjs} +3 -4
- package/dist/{keys-C1vFuSbv.mjs → keys-FBz6Ull-.mjs} +2 -3
- package/dist/{loadResources-CHPDyIPn.mjs → loadResources-Bx1sKPnF.mjs} +4 -5
- package/dist/{loadResourcesFromEntry-BkHHTu_B.mjs → loadResourcesFromEntry-b_jcqbxh.mjs} +3 -4
- package/dist/logger/index.d.mts +1 -3
- package/dist/logger/index.mjs +2 -2
- package/dist/{logger-C5bvCiAK.mjs → logger-CbFcIEBZ.mjs} +3 -5
- package/dist/{mcpPlugin-C9qohJCF.mjs → mcpPlugin-yix548XX.mjs} +41 -60
- package/dist/{memory-CxiTwT0j.mjs → memory-Bgw5dn8N.mjs} +4 -5
- package/dist/{metrics-Ckp2zRy-.mjs → metrics-CZDQWVjS.mjs} +4 -5
- package/dist/middleware/index.d.mts +1 -5
- package/dist/middleware/index.mjs +4 -5
- package/dist/migrations/index.d.mts +0 -2
- package/dist/migrations/index.mjs +3 -4
- package/dist/{module-CfnKuIuH.mjs → module-Dsc_nKL5.mjs} +2 -3
- package/dist/{multiTenant-CAtYlW6H.d.mts → multiTenant-XCxAUlru.d.mts} +1 -5
- package/dist/{multipartBody-BFasGtP9.mjs → multipartBody-B85ek8Kj.mjs} +2 -3
- package/dist/observeSend-BK-JN1jK.mjs +20 -0
- package/dist/{openapi-DAPxjYHX.mjs → openapi-Co7hl073.mjs} +18 -28
- package/dist/outbox-admin/index.d.mts +2 -4
- package/dist/outbox-admin/index.mjs +6 -7
- package/dist/{outbox-module-gZCHoE4H.d.mts → outbox-module-XvUThpqn.d.mts} +2 -8
- package/dist/{outbox-module-B4FAkx3A.mjs → outbox-module-mg9kDYkd.mjs} +13 -17
- package/dist/permissions/index.d.mts +4 -4
- package/dist/permissions/index.mjs +7 -7
- package/dist/{permissions-B14c3OMp.mjs → permissions-A1oKtpiC.mjs} +19 -29
- package/dist/{pipe-CQv7PsAK.mjs → pipe-Czpw9U2n.mjs} +3 -4
- package/dist/pipeline/index.d.mts +1 -9
- package/dist/pipeline/index.mjs +5 -8
- package/dist/{plan-CpnTykjb.mjs → plan-KVseuBCL.mjs} +5 -9
- package/dist/{plugin-DXTjVg_Q.mjs → plugin-DTWt_8C3.mjs} +130 -62
- package/dist/plugins/index.d.mts +8 -16
- package/dist/plugins/index.mjs +22 -26
- package/dist/plugins/response-cache.d.mts +2 -4
- package/dist/plugins/response-cache.mjs +10 -10
- package/dist/plugins/tracing-entry.d.mts +1 -1
- package/dist/plugins/tracing-entry.mjs +3 -4
- package/dist/{pluralize-C3VJKRGp.mjs → pluralize-msB9X3yw.mjs} +2 -3
- package/dist/presets/filesUpload.d.mts +4 -6
- package/dist/presets/filesUpload.mjs +6 -7
- package/dist/presets/index.d.mts +3 -19
- package/dist/presets/index.mjs +2 -2
- package/dist/presets/multiTenant.d.mts +1 -1
- package/dist/presets/multiTenant.mjs +7 -7
- package/dist/presets/search.d.mts +3 -5
- package/dist/presets/search.mjs +3 -4
- package/dist/{presets-CquqYJPy.mjs → presets-qKCehiJM.mjs} +11 -18
- package/dist/{projection-CgfSLOSM.mjs → projection-ClBqtsIw.mjs} +3 -4
- package/dist/{pushref-registry-UxCkoA4C.d.mts → pushref-registry-d86QUaSq.d.mts} +0 -6
- package/dist/{queryCachePlugin-D0HUISHJ.mjs → queryCachePlugin-3gJj5Rbz.mjs} +8 -10
- package/dist/{queryCachePlugin-C2lZjTxk.d.mts → queryCachePlugin-DYQUyeJ9.d.mts} +2 -4
- package/dist/{rateLimitKey-AvkBOMkl.mjs → rateLimitKey-Kro---xl.mjs} +2 -3
- package/dist/{realtime-CbWtVbqK.mjs → realtime-Ber8uJN2.mjs} +17 -19
- package/dist/{redis-BDgv9Glw.d.mts → redis-RpDMemdm.d.mts} +2 -4
- package/dist/{redis-stream-BMk-bpQS.d.mts → redis-stream-CS1N9dwM.d.mts} +1 -3
- package/dist/{redisShapes-CQksY67q.d.mts → redisShapes-CqBXTn_s.d.mts} +0 -2
- package/dist/registry/index.d.mts +2 -12
- package/dist/registry/index.mjs +3 -3
- package/dist/{registry-BVwpAuFI.mjs → registry-BA-_vFYk.mjs} +7 -12
- package/dist/{renewingLease-CykpeNcQ.mjs → renewingLease-CMY8YOcc.mjs} +2 -3
- package/dist/{replyHelpers-DA51IZio.mjs → replyHelpers-DK9P_XSz.mjs} +3 -4
- package/dist/{requestContext-DIWHKDtQ.mjs → requestContext-GYO_0gEw.mjs} +2 -3
- package/dist/{requirement-CbiLdQ1n.d.mts → requirement-CTRQjjQx.d.mts} +0 -2
- package/dist/{requirement-Cp_fsMDL.mjs → requirement-DeNjZIH3.mjs} +2 -3
- package/dist/{resourceRateLimit-Wf6d6FL9.d.mts → resourceRateLimit-DCWglD7V.d.mts} +1 -3
- package/dist/{resourceRateLimit-BFuluodF.mjs → resourceRateLimit-tHLbrtWc.mjs} +3 -4
- package/dist/{rolldown-runtime-D_lMdYOd.mjs → rolldown-runtime-Kv1fZdLg.mjs} +2 -3
- package/dist/{routeValidator-DuLonYwr.mjs → routeValidator-C_H5NanI.mjs} +2 -3
- package/dist/{runtimeCapabilities-CydRfm0i.mjs → runtimeCapabilities-DWqbxkyw.mjs} +2 -3
- package/dist/{schedules-B693KXxa.mjs → schedules-eO_RzhCU.mjs} +132 -9
- package/dist/{schemaConverter-DNvZWTV6.mjs → schemaConverter-DBJrPZN4.mjs} +3 -4
- package/dist/{schemaIR-REV2y7Wd.mjs → schemaIR-CEScKT2v.mjs} +3 -4
- package/dist/schemas/index.d.mts +0 -2
- package/dist/schemas/index.mjs +2 -3
- package/dist/scim/index.d.mts +0 -12
- package/dist/scim/index.mjs +10 -18
- package/dist/scope/index.d.mts +2 -6
- package/dist/scope/index.mjs +5 -5
- package/dist/{scope-Bevxy_ST.mjs → scope-B-Sm9m_E.mjs} +5 -6
- package/dist/{sessionManager-qimlKV0P.d.mts → sessionManager-CdvDF04x.d.mts} +2 -4
- package/dist/{shutdown-CfrqPR7A.mjs → shutdown-DzLFbe27.mjs} +2 -3
- package/dist/{simpleEqualityMatcher-BJwfuRKP.mjs → simpleEqualityMatcher-DOJhwQ8g.mjs} +2 -3
- package/dist/{sse-CuNNWr2z.mjs → sse-2972pVwV.mjs} +8 -9
- package/dist/{sseStream-C_2ujAVY.mjs → sseStream-AWLEeNV-.mjs} +3 -4
- package/dist/{storage-Cx9Sz3Ou.d.mts → storage-odC5MNKN.d.mts} +0 -2
- package/dist/{store-helpers-C8uBGCbb.mjs → store-helpers-VzjgVTkM.mjs} +2 -3
- package/dist/{streaming-Bdq_M4d5.mjs → streaming-DvraWW6x.mjs} +2 -3
- package/dist/{subscriberIdentity-B-KpZkdl.mjs → subscriberIdentity-Bya56jsg.mjs} +2 -3
- package/dist/{tenancy-C5PCvm1h.mjs → tenancy-DSa_0hhw.mjs} +3 -4
- package/dist/{tenantPreparation-dYvWrgNa.mjs → tenantPreparation-BrpkQre3.mjs} +5 -6
- package/dist/testing/cleanupStoreContract.d.mts +2 -4
- package/dist/testing/cleanupStoreContract.mjs +2 -3
- package/dist/testing/index.d.mts +6 -32
- package/dist/testing/index.mjs +24 -37
- package/dist/testing/outboxStoreContract.d.mts +1 -3
- package/dist/testing/outboxStoreContract.mjs +3 -4
- package/dist/testing/requiredPorts.d.mts +2 -4
- package/dist/testing/requiredPorts.mjs +3 -4
- package/dist/testing/storageContract.d.mts +2 -4
- package/dist/testing/storageContract.mjs +2 -3
- package/dist/{timing-DCqsezX8.mjs → timing-6rQTuCwg.mjs} +3 -5
- package/dist/{tracing-Dro5eH6j.d.mts → tracing-JSFiBl5r.d.mts} +0 -2
- package/dist/{transactionContext-DrcNyjpv.mjs → transactionContext-DaxYUEgH.mjs} +2 -3
- package/dist/{typeGuards-CEl10KPy.mjs → typeGuards-UKnX8wPX.mjs} +2 -3
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.mjs +1 -1
- package/dist/types/storage.d.mts +1 -1
- package/dist/types/storage.mjs +1 -1
- package/dist/{types-ByHn9rEO.d.mts → types-0Dqlbgn8.d.mts} +0 -2
- package/dist/{types-D3Ixsh00.d.mts → types-BYEb_dLW.d.mts} +2 -4
- package/dist/{types-BJ-2XqVF.d.mts → types-BeEJm-DV.d.mts} +114 -14
- package/dist/{types-DVLddu2q.d.mts → types-C0YJAiL0.d.mts} +0 -2
- package/dist/{types-D9NWjpYc.mjs → types-CuGjhn83.mjs} +5 -6
- package/dist/{types-Ddl9OjmE.d.mts → types-DnkIALZ8.d.mts} +0 -4
- package/dist/usage/index.d.mts +2 -10
- package/dist/usage/index.mjs +8 -12
- package/dist/{userHelpers-BHig1kHq.mjs → userHelpers-oX5_mOVs.mjs} +2 -3
- package/dist/utils/index.d.mts +5 -39
- package/dist/utils/index.mjs +12 -12
- package/dist/{utils-BG5P7_Vb.mjs → utils-CjjGOT4E.mjs} +20 -30
- package/dist/{validate-D_mdOCir.mjs → validate-4RlTKOJb.mjs} +5 -7
- package/dist/{versioning-DBGHjPh7.mjs → versioning-Dk2-19La.mjs} +4 -5
- package/dist/{versioning-Bqm_57Qt.d.mts → versioning-S18y2-0C.d.mts} +1 -15
- package/dist/{websocket-Cs4awVyD.d.mts → websocket-BGuc-WVZ.d.mts} +1 -15
- package/dist/{workScope-DPPfM4m6.mjs → workScope-DoBsoVo4.mjs} +3 -4
- package/llms.txt +37 -30
- package/package.json +9 -8
- package/skills/arc/SKILL.md +65 -844
- package/skills/arc/references/agent-auth.md +82 -193
- package/skills/arc/references/api-reference.md +41 -245
- package/skills/arc/references/auth-api-keys.md +99 -0
- package/skills/arc/references/auth-better-auth-overlay.md +87 -0
- package/skills/arc/references/auth-better-auth.md +78 -0
- package/skills/arc/references/auth-permissions.md +100 -0
- package/skills/arc/references/auth-strategies.md +122 -0
- package/skills/arc/references/boot.md +80 -0
- package/skills/arc/references/enterprise-auth.md +65 -81
- package/skills/arc/references/events-outbox.md +90 -0
- package/skills/arc/references/events.md +75 -440
- package/skills/arc/references/integrations-jobs.md +74 -0
- package/skills/arc/references/integrations-realtime.md +84 -0
- package/skills/arc/references/integrations-webhooks.md +71 -0
- package/skills/arc/references/integrations-workflows.md +47 -0
- package/skills/arc/references/mcp-auth.md +83 -0
- package/skills/arc/references/mcp-custom-tools.md +125 -0
- package/skills/arc/references/mcp-setup.md +115 -0
- package/skills/arc/references/mcp-testing.md +63 -0
- package/skills/arc/references/multi-tenancy.md +56 -230
- package/skills/arc/references/permissions-scope.md +81 -0
- package/skills/arc/references/production-api.md +119 -0
- package/skills/arc/references/production-audit.md +101 -0
- package/skills/arc/references/production-boot.md +91 -0
- package/skills/arc/references/production-caching.md +63 -0
- package/skills/arc/references/production-distributed.md +75 -0
- package/skills/arc/references/production-idempotency.md +83 -0
- package/skills/arc/references/production-observability.md +83 -0
- package/skills/arc/references/production-realtime.md +70 -0
- package/skills/arc/references/production-reliability.md +100 -0
- package/skills/arc/references/production-shutdown.md +43 -0
- package/skills/arc/references/querying.md +76 -0
- package/skills/arc/references/resources.md +97 -0
- package/skills/arc/references/schedules.md +79 -0
- package/skills/arc/references/scim.md +61 -208
- package/skills/arc/references/tenancy-scope-install.md +82 -0
- package/skills/arc/references/testing.md +101 -144
- package/skills/arc/references/usage-cleanup-capabilities.md +45 -0
- package/skills/arc/references/validation.md +91 -0
- package/skills/arc/references/writes-hooks-errors.md +80 -0
- package/skills/arc-code-review/SKILL.md +67 -114
- package/skills/arc-code-review/references/arc-cheatsheet.md +68 -167
- package/skills/arc-code-review/references/mongokit-repositories.md +104 -0
- package/skills/arc-code-review/references/recipe-events-cache-jobs.md +112 -0
- package/skills/arc-code-review/references/recipe-resource.md +100 -0
- package/skills/arc-code-review/references/recipe-schemas-fields.md +93 -0
- package/skills/arc-code-review/references/recipe-scope-permissions.md +82 -0
- package/skills/arc-code-review/references/scaffolding.md +61 -198
- package/skills/arc-code-review/references/severity.md +49 -102
- package/skills/arc-code-review/references/smells-auth-scope.md +80 -0
- package/skills/arc-code-review/references/smells-data-events.md +66 -0
- package/skills/arc-code-review/references/smells-imports-style.md +59 -0
- package/skills/arc-code-review/references/smells-platform.md +89 -0
- package/skills/arc-code-review/references/smells-routes-schemas.md +66 -0
- package/skills/arc-module-publishing/SKILL.md +82 -208
- package/skills/arc-module-publishing/references/action-presets-and-plugins.md +87 -0
- package/skills/arc-module-publishing/references/build-and-types.md +73 -0
- package/skills/arc-module-publishing/references/module-lifecycle.md +101 -0
- package/skills/arc-module-publishing/references/package-manifest.md +34 -122
- package/skills/arc-module-publishing/references/publishing-workflow.md +44 -140
- package/skills/arc-module-publishing/references/resource-assembly.md +102 -0
- package/skills/arc-module-publishing/references/testing-packages.md +82 -0
- package/skills/arc/references/auth.md +0 -729
- package/skills/arc/references/integrations.md +0 -452
- package/skills/arc/references/mcp.md +0 -691
- package/skills/arc/references/production.md +0 -835
- package/skills/arc-code-review/references/anti-patterns.md +0 -1008
- package/skills/arc-code-review/references/migration-recipes.md +0 -649
- package/skills/arc-code-review/references/mongokit-migration.md +0 -360
- package/skills/arc-module-publishing/references/authoring-modules.md +0 -327
|
@@ -1,452 +0,0 @@
|
|
|
1
|
-
# Arc Integrations
|
|
2
|
-
|
|
3
|
-
Pluggable adapters for BullMQ jobs, WebSocket real-time, Streamline workflows, and MCP tools.
|
|
4
|
-
All are separate subpath imports — only loaded when explicitly used.
|
|
5
|
-
|
|
6
|
-
> **MCP** has its own dedicated reference: [mcp.md](mcp.md) — auto-generate tools from resources (including actions, v2.8), custom tools, Better Auth OAuth 2.1.
|
|
7
|
-
|
|
8
|
-
## Job Queue (BullMQ)
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
import { jobsPlugin, defineJob } from '@classytic/arc/integrations/jobs';
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
**Requires:** `bullmq` (peer dependency), Redis
|
|
15
|
-
|
|
16
|
-
### Define Jobs
|
|
17
|
-
|
|
18
|
-
```typescript
|
|
19
|
-
const sendEmail = defineJob({
|
|
20
|
-
name: 'send-email',
|
|
21
|
-
handler: async (data: { to: string; subject: string; body: string }, meta: JobMeta) => {
|
|
22
|
-
await emailService.send(data.to, data.subject, data.body);
|
|
23
|
-
return { sent: true };
|
|
24
|
-
},
|
|
25
|
-
retries: 3,
|
|
26
|
-
backoff: { type: 'exponential', delay: 1000 },
|
|
27
|
-
timeout: 30000,
|
|
28
|
-
concurrency: 5,
|
|
29
|
-
rateLimit: { max: 100, duration: 60000 }, // 100/min
|
|
30
|
-
deadLetterQueue: 'send-email:dead',
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
const processImage = defineJob({
|
|
34
|
-
name: 'process-image',
|
|
35
|
-
handler: async (data: { url: string; width: number }) => {
|
|
36
|
-
return await sharp(data.url).resize(data.width).toBuffer();
|
|
37
|
-
},
|
|
38
|
-
retries: 2,
|
|
39
|
-
timeout: 60000,
|
|
40
|
-
});
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### Register Plugin
|
|
44
|
-
|
|
45
|
-
```typescript
|
|
46
|
-
await fastify.register(jobsPlugin, {
|
|
47
|
-
connection: { host: 'localhost', port: 6379, password: '...' },
|
|
48
|
-
jobs: [sendEmail, processImage],
|
|
49
|
-
prefix: '/jobs', // Stats endpoint: GET /jobs/stats
|
|
50
|
-
bridgeEvents: true, // Emit job.{name}.completed / job.{name}.failed
|
|
51
|
-
defaults: {
|
|
52
|
-
retries: 3,
|
|
53
|
-
backoff: { type: 'exponential', delay: 1000 },
|
|
54
|
-
removeOnComplete: 100, // Keep last 100 completed
|
|
55
|
-
removeOnFail: 500, // Keep last 500 failed
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Dispatch Jobs
|
|
61
|
-
|
|
62
|
-
```typescript
|
|
63
|
-
// Basic dispatch
|
|
64
|
-
await fastify.jobs.dispatch('send-email', { to: 'user@example.com', subject: 'Hi', body: 'Hello' });
|
|
65
|
-
|
|
66
|
-
// With options
|
|
67
|
-
await fastify.jobs.dispatch('process-image', { url: '...', width: 800 }, {
|
|
68
|
-
delay: 5000, // Delay 5s
|
|
69
|
-
priority: 1, // Lower = higher priority
|
|
70
|
-
jobId: 'unique-123', // Deduplication
|
|
71
|
-
removeOnComplete: true,
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
// dispatch returns a JobHandle — the queue is part of the identity because
|
|
75
|
-
// BullMQ ids are queue-LOCAL (two queues can both hold "123").
|
|
76
|
-
const { queue, jobId } = await fastify.jobs.dispatch('send-email', { to: 'a@b.com' });
|
|
77
|
-
const status = await fastify.jobs.getStatus(queue, jobId);
|
|
78
|
-
|
|
79
|
-
// Get stats
|
|
80
|
-
const stats = await fastify.jobs.getStats();
|
|
81
|
-
// { 'send-email': { waiting: 5, active: 2, completed: 100, failed: 3, delayed: 0 } }
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### Management routes (off by default)
|
|
85
|
-
|
|
86
|
-
`GET /jobs/stats` and `GET /jobs/:queue/:id/status` are NOT mounted unless you
|
|
87
|
-
ask for them. A status carries `returnValue` and `failedReason` — your handler's
|
|
88
|
-
own output and error text — so an unauthenticated route turns a job id into a
|
|
89
|
-
read primitive over other tenants' work.
|
|
90
|
-
|
|
91
|
-
```typescript
|
|
92
|
-
jobsPlugin({
|
|
93
|
-
connection,
|
|
94
|
-
jobs,
|
|
95
|
-
managementRoutes: {
|
|
96
|
-
// Must be PLATFORM-only, verified at boot. These routes are global: /stats
|
|
97
|
-
// spans every queue and a job carries no tenant identity, so an org-role
|
|
98
|
-
// gate would let org A's manager read org B's job.
|
|
99
|
-
operatorPermission: requirePlatformRole('platform-ops'),
|
|
100
|
-
exposeResult: false, // default — opt in knowing what your handlers return
|
|
101
|
-
exposeFailureReason: false, // default
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
`requireOrgRole('manager')` and the default `requireRoles(['platform-ops'])` are
|
|
107
|
-
REFUSED at boot: both grant on an organization role and return no policy, so
|
|
108
|
-
nothing at request time can tell them apart from a real operator gate. Use
|
|
109
|
-
`requirePlatformRole`, or `allowUnverifiedOperatorPermission: true` for a custom
|
|
110
|
-
check you have verified yourself.
|
|
111
|
-
|
|
112
|
-
### Timeout & DLQ
|
|
113
|
-
|
|
114
|
-
Job timeout via `Promise.race` (timer always cleaned up). DLQ queues tracked and closed on shutdown:
|
|
115
|
-
|
|
116
|
-
```typescript
|
|
117
|
-
defineJob({ name: 'x', handler, timeout: 60000, deadLetterQueue: 'x:dead', retries: 3 });
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### Event Bridge
|
|
121
|
-
|
|
122
|
-
When `bridgeEvents: true` (default), job events fire-and-forget (never fail the worker):
|
|
123
|
-
- `job.send-email.completed` — `{ jobId, data, result }`
|
|
124
|
-
- `job.send-email.failed` — `{ jobId, data, error, attemptsMade }`
|
|
125
|
-
|
|
126
|
-
### Types
|
|
127
|
-
|
|
128
|
-
```typescript
|
|
129
|
-
interface JobMeta { jobId: string; attemptsMade: number; timestamp: number; }
|
|
130
|
-
interface JobDispatchOptions { delay?; priority?; jobId?; removeOnComplete?; removeOnFail?; }
|
|
131
|
-
interface QueueStats { waiting; active; completed; failed; delayed; }
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
## WebSocket
|
|
137
|
-
|
|
138
|
-
```typescript
|
|
139
|
-
import { websocketPlugin } from '@classytic/arc/integrations/websocket';
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
**Requires:** `@fastify/websocket` (peer dependency), persistent runtime (not serverless)
|
|
143
|
-
|
|
144
|
-
### Setup
|
|
145
|
-
|
|
146
|
-
```typescript
|
|
147
|
-
import fastifyWebsocket from '@fastify/websocket';
|
|
148
|
-
|
|
149
|
-
await fastify.register(fastifyWebsocket);
|
|
150
|
-
await fastify.register(websocketPlugin, {
|
|
151
|
-
path: '/ws',
|
|
152
|
-
auth: true, // Fail-closed: throws if authenticate not registered
|
|
153
|
-
resources: ['product', 'order'], // Auto-broadcast CRUD events
|
|
154
|
-
heartbeatInterval: 30000, // Ping every 30s (0 to disable)
|
|
155
|
-
maxClientsPerRoom: 10000,
|
|
156
|
-
|
|
157
|
-
// Security controls
|
|
158
|
-
roomPolicy: (client, room) => { // Authorize room subscriptions (default: allow all)
|
|
159
|
-
return ['product', 'order'].includes(room);
|
|
160
|
-
},
|
|
161
|
-
maxMessageBytes: 16384, // Max message size from client (default: 16KB)
|
|
162
|
-
maxSubscriptionsPerClient: 100, // Max rooms per client (default: 100)
|
|
163
|
-
exposeStats: 'authenticated', // Stats at /ws/stats (false | true | 'authenticated')
|
|
164
|
-
|
|
165
|
-
// Lifecycle hooks
|
|
166
|
-
authenticate: async (request) => { // Custom auth (optional)
|
|
167
|
-
const { getOrgId } = await import('@classytic/arc/scope');
|
|
168
|
-
return { userId: request.user?.id, organizationId: getOrgId(request.scope) };
|
|
169
|
-
},
|
|
170
|
-
onConnect: async (client) => { console.log('Connected:', client.id); },
|
|
171
|
-
onDisconnect: async (client) => { console.log('Disconnected:', client.id); },
|
|
172
|
-
onMessage: async (client, msg) => { /* custom message handler */ },
|
|
173
|
-
});
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
**Fail-closed auth:** When `auth: true` (default), registration throws if `fastify.authenticate` is not available and no custom `authenticate` function is provided. This prevents accidentally exposing WebSocket without auth.
|
|
177
|
-
|
|
178
|
-
### Client Protocol
|
|
179
|
-
|
|
180
|
-
```javascript
|
|
181
|
-
const ws = new WebSocket('ws://localhost:3000/ws');
|
|
182
|
-
|
|
183
|
-
// Server sends on connect:
|
|
184
|
-
// { type: 'connected', clientId: 'ws_1_...', resources: ['product', 'order'] }
|
|
185
|
-
|
|
186
|
-
// Subscribe to resource events
|
|
187
|
-
ws.send(JSON.stringify({ type: 'subscribe', resource: 'product' }));
|
|
188
|
-
// → { type: 'subscribed', channel: 'product' }
|
|
189
|
-
|
|
190
|
-
// Server pushes CRUD events:
|
|
191
|
-
// { type: 'product.created', data: { ... }, meta: { timestamp, userId, organizationId } }
|
|
192
|
-
|
|
193
|
-
// Unsubscribe
|
|
194
|
-
ws.send(JSON.stringify({ type: 'unsubscribe', resource: 'product' }));
|
|
195
|
-
|
|
196
|
-
// Heartbeat: server sends { type: 'ping' }, client responds { type: 'pong' }
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
### Server-Side Broadcasting
|
|
200
|
-
|
|
201
|
-
```typescript
|
|
202
|
-
// Broadcast to room
|
|
203
|
-
fastify.ws.broadcast('product', { action: 'price-updated', productId: '123' });
|
|
204
|
-
|
|
205
|
-
// Org-scoped broadcast (only clients in same org)
|
|
206
|
-
fastify.ws.broadcastToOrg('org-456', 'product', { ... });
|
|
207
|
-
|
|
208
|
-
// Stats
|
|
209
|
-
fastify.ws.getStats(); // { clients: 150, rooms: 5, subscriptions: { product: 80, order: 70 } }
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
### RoomManager
|
|
213
|
-
|
|
214
|
-
```typescript
|
|
215
|
-
// Access room manager directly
|
|
216
|
-
const rooms = fastify.ws.rooms;
|
|
217
|
-
rooms.subscribe(clientId, 'custom-room');
|
|
218
|
-
rooms.broadcast('custom-room', JSON.stringify({ type: 'custom', data: {} }));
|
|
219
|
-
rooms.broadcastToOrg(orgId, 'custom-room', JSON.stringify({ ... }));
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
### Multi-Tenant Auto-Scoping
|
|
223
|
-
|
|
224
|
-
When Arc events include `organizationId`, WebSocket broadcasts are automatically scoped:
|
|
225
|
-
- Client with `organizationId: 'org-A'` only receives events for org-A
|
|
226
|
-
- No cross-tenant data leakage
|
|
227
|
-
|
|
228
|
-
---
|
|
229
|
-
|
|
230
|
-
## EventGateway (Unified SSE + WebSocket)
|
|
231
|
-
|
|
232
|
-
```typescript
|
|
233
|
-
import { eventGatewayPlugin } from '@classytic/arc/integrations/event-gateway';
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
Single configuration point for both SSE and WebSocket with shared auth, org-scoping, and room policy:
|
|
237
|
-
|
|
238
|
-
```typescript
|
|
239
|
-
await fastify.register(eventGatewayPlugin, {
|
|
240
|
-
auth: true, // Fail-closed for both SSE and WebSocket
|
|
241
|
-
// orgScoped: omitted → SSE's default (true). Set false only for a cross-tenant ops stream.
|
|
242
|
-
roomPolicy: (client, room) => {
|
|
243
|
-
return ['product', 'order', 'invoice'].includes(room);
|
|
244
|
-
},
|
|
245
|
-
maxMessageBytes: 8192, // WS message size cap
|
|
246
|
-
maxSubscriptionsPerClient: 50, // WS subscription limit
|
|
247
|
-
|
|
248
|
-
sse: { // false to disable SSE
|
|
249
|
-
path: '/api/events',
|
|
250
|
-
patterns: ['order.*', 'product.*'],
|
|
251
|
-
},
|
|
252
|
-
ws: { // false to disable WebSocket
|
|
253
|
-
path: '/ws',
|
|
254
|
-
resources: ['product', 'order'],
|
|
255
|
-
exposeStats: 'authenticated',
|
|
256
|
-
},
|
|
257
|
-
});
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
**`@fastify/websocket` auto-registration:** EventGateway auto-registers `@fastify/websocket` if not present. Throws with install instructions if package missing (or use `ws: false`).
|
|
261
|
-
|
|
262
|
-
**When to use:** Prefer EventGateway over separate SSE + WebSocket registration when you want consistent auth, org-scoping, and security policy across both transports.
|
|
263
|
-
|
|
264
|
-
---
|
|
265
|
-
|
|
266
|
-
## Streamline Workflows
|
|
267
|
-
|
|
268
|
-
```typescript
|
|
269
|
-
import { streamlinePlugin } from '@classytic/arc/integrations/streamline';
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
**Requires:** `@classytic/streamline` (peer dependency)
|
|
273
|
-
|
|
274
|
-
### Setup
|
|
275
|
-
|
|
276
|
-
```typescript
|
|
277
|
-
import { createWorkflow } from '@classytic/streamline';
|
|
278
|
-
|
|
279
|
-
const orderWorkflow = createWorkflow({ id: 'order', name: 'Order Processing', steps: { ... } });
|
|
280
|
-
|
|
281
|
-
await fastify.register(streamlinePlugin, {
|
|
282
|
-
workflows: [orderWorkflow],
|
|
283
|
-
prefix: '/api/workflows',
|
|
284
|
-
auth: true, // Require authentication (default, gracefully degrades)
|
|
285
|
-
bridgeEvents: true, // Publish workflow.{id}.started/resumed/cancelled
|
|
286
|
-
permissions: { // Per-operation permissions (all optional, default: allow)
|
|
287
|
-
start: (request) => request.user?.role === 'admin',
|
|
288
|
-
cancel: (request) => request.user?.role === 'admin',
|
|
289
|
-
},
|
|
290
|
-
});
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
### Auto-Generated Routes
|
|
294
|
-
|
|
295
|
-
| Route | Description |
|
|
296
|
-
|-------|-------------|
|
|
297
|
-
| `GET /api/workflows` | List all registered workflows |
|
|
298
|
-
| `POST /api/workflows/:id/start` | Start a new run (`{ input, meta }`) |
|
|
299
|
-
| `GET /api/workflows/:id/runs/:runId` | Get run status |
|
|
300
|
-
| `POST /api/workflows/:id/runs/:runId/resume` | Resume waiting run (`{ payload }`) |
|
|
301
|
-
| `POST /api/workflows/:id/runs/:runId/cancel` | Cancel a run |
|
|
302
|
-
| `POST /api/workflows/:id/runs/:runId/pause` | Pause (if engine supports) |
|
|
303
|
-
| `POST /api/workflows/:id/runs/:runId/rewind` | Rewind to step (`{ stepId }`) |
|
|
304
|
-
|
|
305
|
-
### Fastify Decorators
|
|
306
|
-
|
|
307
|
-
```typescript
|
|
308
|
-
fastify.workflows; // Map<string, WorkflowLike>
|
|
309
|
-
fastify.getWorkflow('order'); // Get specific workflow
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
### Event Bridge
|
|
313
|
-
|
|
314
|
-
- `workflow.order.started` — `{ runId, workflowId, status }`
|
|
315
|
-
- `workflow.order.resumed` — `{ runId, workflowId, status }`
|
|
316
|
-
- `workflow.order.cancelled` — `{ runId, workflowId }`
|
|
317
|
-
|
|
318
|
-
### Auth & Permissions
|
|
319
|
-
|
|
320
|
-
All optional, gracefully degrade:
|
|
321
|
-
- `auth: false` — No authentication required
|
|
322
|
-
- If `fastify.authenticate` is not registered, auth middleware is skipped
|
|
323
|
-
- If no permission check defined for an operation, defaults to allow
|
|
324
|
-
|
|
325
|
-
---
|
|
326
|
-
|
|
327
|
-
## Webhooks (Outbound)
|
|
328
|
-
|
|
329
|
-
```typescript
|
|
330
|
-
import { webhookPlugin } from '@classytic/arc/integrations/webhooks';
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
Fastify plugin that auto-dispatches Arc events to customer webhook endpoints with HMAC-SHA256 signing, delivery logging, bounded concurrency, and pluggable persistence.
|
|
334
|
-
|
|
335
|
-
### Setup
|
|
336
|
-
|
|
337
|
-
```typescript
|
|
338
|
-
await fastify.register(webhookPlugin);
|
|
339
|
-
|
|
340
|
-
// With custom store (MongoDB, Redis, etc.)
|
|
341
|
-
await fastify.register(webhookPlugin, {
|
|
342
|
-
store: myMongoWebhookStore, // implements WebhookStore { getAll, save, remove }
|
|
343
|
-
timeout: 5000, // delivery timeout (default: 10000ms)
|
|
344
|
-
maxLogEntries: 500, // ring buffer cap (default: 1000)
|
|
345
|
-
concurrency: 10, // max parallel deliveries per event (default: 5)
|
|
346
|
-
});
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
**Requires:** `arc-events` plugin (auto-registered by `createApp`).
|
|
350
|
-
|
|
351
|
-
### Register Webhooks
|
|
352
|
-
|
|
353
|
-
```typescript
|
|
354
|
-
await app.webhooks.register({
|
|
355
|
-
id: 'wh-1',
|
|
356
|
-
url: 'https://customer.com/webhook',
|
|
357
|
-
events: ['order.created', 'order.shipped'],
|
|
358
|
-
secret: 'whsec_abc123',
|
|
359
|
-
});
|
|
360
|
-
|
|
361
|
-
// Patterns: exact ('order.created'), prefix ('order.*'), global ('*')
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
### Auto-Dispatch
|
|
365
|
-
|
|
366
|
-
Events published via `fastify.events.publish()` auto-deliver to matching webhooks — no manual wiring:
|
|
367
|
-
|
|
368
|
-
```typescript
|
|
369
|
-
await app.events.publish('order.created', { orderId: '123' });
|
|
370
|
-
// → POST https://customer.com/webhook
|
|
371
|
-
// Headers: x-arc-webhook-signature (v1=<hmac>), x-arc-webhook-timestamp,
|
|
372
|
-
// x-arc-webhook-delivery (= event meta.id, stable across retries)
|
|
373
|
-
// Body: { type, payload, meta }
|
|
374
|
-
```
|
|
375
|
-
|
|
376
|
-
Deliveries run with bounded concurrency (default: 5) — one slow endpoint won't block the rest. Set `concurrency: 1` for sequential delivery.
|
|
377
|
-
|
|
378
|
-
### HMAC Signing & Verification
|
|
379
|
-
|
|
380
|
-
**Outbound** — every delivery is signed with the subscription's secret using the v1 contract (timestamp + delivery id are INSIDE the signed string — replay-bounded, dedup on an authenticated id):
|
|
381
|
-
|
|
382
|
-
```
|
|
383
|
-
x-arc-webhook-signature: v1=a1b2c3...
|
|
384
|
-
x-arc-webhook-timestamp: 1784640000000
|
|
385
|
-
x-arc-webhook-delivery: evt_...
|
|
386
|
-
```
|
|
387
|
-
|
|
388
|
-
**Inbound from arc** — verify with `verifyWebhook()` (signature + tolerance window, typed failure reasons):
|
|
389
|
-
|
|
390
|
-
```typescript
|
|
391
|
-
import { verifyWebhook } from '@classytic/arc/integrations/webhooks';
|
|
392
|
-
|
|
393
|
-
fastify.post('/webhooks/incoming', { config: { rawBody: true } }, async (req, reply) => {
|
|
394
|
-
const result = verifyWebhook({
|
|
395
|
-
body: req.rawBody as string,
|
|
396
|
-
secret,
|
|
397
|
-
signature: req.headers['x-arc-webhook-signature'] as string,
|
|
398
|
-
timestamp: req.headers['x-arc-webhook-timestamp'] as string,
|
|
399
|
-
deliveryId: req.headers['x-arc-webhook-delivery'] as string,
|
|
400
|
-
});
|
|
401
|
-
if (!result.valid) {
|
|
402
|
-
return reply.status(401).send({ error: result.reason });
|
|
403
|
-
}
|
|
404
|
-
// dedup on result.deliveryId, then handle the event
|
|
405
|
-
});
|
|
406
|
-
```
|
|
407
|
-
|
|
408
|
-
Accepts `string | Buffer` body, `string | undefined` signature. Configurable for non-Arc senders:
|
|
409
|
-
|
|
410
|
-
```typescript
|
|
411
|
-
// GitHub (same prefix, same algorithm — works with defaults)
|
|
412
|
-
verifySignature(body, secret, req.headers['x-hub-signature-256']);
|
|
413
|
-
|
|
414
|
-
// Custom algorithm / bare hex
|
|
415
|
-
verifySignature(body, secret, req.headers['x-custom-sig'], {
|
|
416
|
-
prefix: '', // bare hex, no prefix
|
|
417
|
-
algorithm: 'sha512', // non-default algorithm
|
|
418
|
-
});
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
**Note:** `req.rawBody` requires `fastify-raw-body` — JSON re-serialization breaks HMAC since field ordering differs.
|
|
422
|
-
|
|
423
|
-
### Delivery Log
|
|
424
|
-
|
|
425
|
-
```typescript
|
|
426
|
-
const log = app.webhooks.deliveryLog(); // all entries
|
|
427
|
-
const recent = app.webhooks.deliveryLog(10); // last 10
|
|
428
|
-
|
|
429
|
-
// Each entry: { subscriptionId, eventType, success, status?, error?, timestamp }
|
|
430
|
-
```
|
|
431
|
-
|
|
432
|
-
### WebhookStore Interface
|
|
433
|
-
|
|
434
|
-
Implement for persistent subscriptions (default: in-memory):
|
|
435
|
-
|
|
436
|
-
```typescript
|
|
437
|
-
interface WebhookStore {
|
|
438
|
-
readonly name: string;
|
|
439
|
-
getAll(): Promise<WebhookSubscription[]>;
|
|
440
|
-
save(sub: WebhookSubscription): Promise<void>;
|
|
441
|
-
remove(id: string): Promise<void>;
|
|
442
|
-
}
|
|
443
|
-
```
|
|
444
|
-
|
|
445
|
-
### Fastify Decorators
|
|
446
|
-
|
|
447
|
-
```typescript
|
|
448
|
-
app.webhooks.register(sub) // Add/replace subscription
|
|
449
|
-
app.webhooks.unregister(id) // Remove subscription
|
|
450
|
-
app.webhooks.list() // All subscriptions (copy)
|
|
451
|
-
app.webhooks.deliveryLog(n?) // Delivery history (ring buffer)
|
|
452
|
-
```
|