@classytic/arc 2.45.1 → 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-4b0noGwa.mjs → EventTransport-DNgD9NP4.mjs} +3 -4
- package/dist/{HookSystem-4pABQnGn.mjs → HookSystem-DRbPzEcP.mjs} +3 -4
- package/dist/{QueryCache--5uAuYPW.d.mts → QueryCache-DdvrGG8Q.d.mts} +1 -3
- package/dist/{ResourceRegistry-BBaN_Ne-.mjs → ResourceRegistry-Douk51fa.mjs} +15 -4
- package/dist/{acquire-kiZzy5bX.mjs → acquire-RbtvDg9s.mjs} +2 -3
- package/dist/{actionPermissions-BLnbDA6g.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-CVlaTjAX.mjs → authorizationDecision-DeZMrHcm.mjs} +5 -6
- package/dist/{base-CZyixEQR.d.mts → base-HXNgPQww.d.mts} +1 -7
- package/dist/{boundedMap-DSy7KkeX.mjs → boundedMap-2WBh3gM9.mjs} +2 -3
- package/dist/{buildHandler-B4IhILv9.mjs → buildHandler-DxVOOBpw.mjs} +5 -6
- package/dist/cache/index.d.mts +4 -10
- package/dist/cache/index.mjs +5 -6
- package/dist/{caching-DqakP2vY.mjs → caching-BYRwYrUo.mjs} +3 -4
- package/dist/{claimed-XoiVrWZ2.mjs → claimed-DYlELdnm.mjs} +2 -3
- package/dist/cleanup/index.d.mts +9 -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-CtWkmWn3.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-Cro2v5a7.mjs → core-D9rS2BxO.mjs} +9 -12
- package/dist/{createActionRouter-k-gwiPv6.mjs → createActionRouter-0qkCRzTL.mjs} +7 -8
- package/dist/{createAggregationRouter-BqWqhAPG.mjs → createAggregationRouter-CUf5Esd9.mjs} +9 -10
- package/dist/{createApp-Dw7L72Hz.mjs → createApp-DZIXfDKD.mjs} +49 -62
- package/dist/{createMcpServer-DSztofa9.d.mts → createMcpServer-DeVpqQF-.d.mts} +1 -3
- package/dist/{defineAggregation-pxbd7BBK.mjs → defineAggregation-bmKQ4NmC.mjs} +2 -3
- package/dist/{defineResource-DwgEjLCO.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-B9wF2Z1F.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-Dr2nG0Ui.mjs → errorHandler-dFyGOEoB.mjs} +16 -6
- package/dist/{errors-BtHzrSA6.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-Dvs7OBw8.mjs → eventPlugin-eMhAPtQA.mjs} +10 -12
- package/dist/{eventTypes-BVoCTG5c.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-C1e_7Fwi.mjs → fields-LnbCcvsw.mjs} +2 -3
- package/dist/{filter-merge-xaiEKtz8.mjs → filter-merge-BAWi019Q.mjs} +2 -3
- package/dist/{generate-DCGuEbqI.d.mts → generate-C-g_KOkV.d.mts} +0 -4
- package/dist/{generate-DJiJMaXN.mjs → generate-oXoDnpJf.mjs} +7 -12
- package/dist/{headers-Dr-wt6Tr.mjs → headers-DBd3Qheo.mjs} +3 -4
- package/dist/{health-DkkWbJtQ.mjs → health-BlJu9GXS.mjs} +2 -3
- package/dist/{health-BLYn_Hds.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-CW3kJqNW.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-DPU8yYwA.mjs → jsonBody-DpRpKR_K.mjs} +3 -4
- package/dist/{keys-Dgn6OYhl.mjs → keys-FBz6Ull-.mjs} +2 -3
- package/dist/{loadResources-BtKj6P1P.mjs → loadResources-Bx1sKPnF.mjs} +4 -5
- package/dist/{loadResourcesFromEntry-Bmq6TnB7.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-qQNLlOAU.mjs → logger-CbFcIEBZ.mjs} +3 -5
- package/dist/{mcpPlugin-DDfe8jAP.mjs → mcpPlugin-yix548XX.mjs} +41 -60
- package/dist/{memory-C0Blueoh.mjs → memory-Bgw5dn8N.mjs} +4 -5
- package/dist/{metrics-DYka72iN.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-BszSyWbd.mjs → module-Dsc_nKL5.mjs} +2 -3
- package/dist/{multiTenant-CAtYlW6H.d.mts → multiTenant-XCxAUlru.d.mts} +1 -5
- package/dist/{multipartBody-RHvIkNmc.mjs → multipartBody-B85ek8Kj.mjs} +2 -3
- package/dist/observeSend-BK-JN1jK.mjs +20 -0
- package/dist/{openapi-BrFPc3Ny.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-DF4Bu_Qa.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-DN1CWH56.mjs → permissions-A1oKtpiC.mjs} +19 -29
- package/dist/{pipe-B8uq865o.mjs → pipe-Czpw9U2n.mjs} +3 -4
- package/dist/pipeline/index.d.mts +1 -9
- package/dist/pipeline/index.mjs +5 -8
- package/dist/{plan-DUGfynNg.mjs → plan-KVseuBCL.mjs} +5 -9
- package/dist/{plugin-ByU3h-bR.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-Cdya8zYt.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-CCOlKTZw.mjs → presets-qKCehiJM.mjs} +11 -18
- package/dist/{projection-BGty6ie4.mjs → projection-ClBqtsIw.mjs} +3 -4
- package/dist/{pushref-registry-UxCkoA4C.d.mts → pushref-registry-d86QUaSq.d.mts} +0 -6
- package/dist/{queryCachePlugin-B7itTkWu.mjs → queryCachePlugin-3gJj5Rbz.mjs} +8 -10
- package/dist/{queryCachePlugin-C2lZjTxk.d.mts → queryCachePlugin-DYQUyeJ9.d.mts} +2 -4
- package/dist/{rateLimitKey-DBWO59H9.mjs → rateLimitKey-Kro---xl.mjs} +2 -3
- package/dist/{realtime-_59Rlje8.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-uG4wr541.mjs → registry-BA-_vFYk.mjs} +7 -12
- package/dist/{renewingLease-CiU3ZynH.mjs → renewingLease-CMY8YOcc.mjs} +2 -3
- package/dist/{replyHelpers-Dr2pnXZg.mjs → replyHelpers-DK9P_XSz.mjs} +3 -4
- package/dist/{requestContext-DBKIdmDi.mjs → requestContext-GYO_0gEw.mjs} +2 -3
- package/dist/{requirement-CbiLdQ1n.d.mts → requirement-CTRQjjQx.d.mts} +0 -2
- package/dist/{requirement-DxOaghWD.mjs → requirement-DeNjZIH3.mjs} +2 -3
- package/dist/{resourceRateLimit-Wf6d6FL9.d.mts → resourceRateLimit-DCWglD7V.d.mts} +1 -3
- package/dist/{resourceRateLimit-BBdj5yRq.mjs → resourceRateLimit-tHLbrtWc.mjs} +3 -4
- package/dist/{rolldown-runtime-DpVPUeXF.mjs → rolldown-runtime-Kv1fZdLg.mjs} +2 -3
- package/dist/{routeValidator-BNTqM1Eh.mjs → routeValidator-C_H5NanI.mjs} +2 -3
- package/dist/{runtimeCapabilities-D_3eUO6V.mjs → runtimeCapabilities-DWqbxkyw.mjs} +2 -3
- package/dist/{schedules-CVS7c1nv.mjs → schedules-eO_RzhCU.mjs} +132 -9
- package/dist/{schemaConverter-BQbg7loK.mjs → schemaConverter-DBJrPZN4.mjs} +3 -4
- package/dist/{schemaIR-CUI3hPQR.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-DFXngazv.mjs → scope-B-Sm9m_E.mjs} +5 -6
- package/dist/{sessionManager-qimlKV0P.d.mts → sessionManager-CdvDF04x.d.mts} +2 -4
- package/dist/{shutdown-BCXCwghd.mjs → shutdown-DzLFbe27.mjs} +2 -3
- package/dist/{simpleEqualityMatcher-5jOzYQ_L.mjs → simpleEqualityMatcher-DOJhwQ8g.mjs} +2 -3
- package/dist/{sse-BilBz766.mjs → sse-2972pVwV.mjs} +8 -9
- package/dist/{sseStream-BG_uJL6J.mjs → sseStream-AWLEeNV-.mjs} +3 -4
- package/dist/{storage-Cx9Sz3Ou.d.mts → storage-odC5MNKN.d.mts} +0 -2
- package/dist/{store-helpers-CzLZdVa1.mjs → store-helpers-VzjgVTkM.mjs} +2 -3
- package/dist/{streaming-DgUvMWlv.mjs → streaming-DvraWW6x.mjs} +2 -3
- package/dist/{subscriberIdentity-EWnIZ-U8.mjs → subscriberIdentity-Bya56jsg.mjs} +2 -3
- package/dist/{tenancy-CVMvO5DH.mjs → tenancy-DSa_0hhw.mjs} +3 -4
- package/dist/{tenantPreparation-DIH-GX4g.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-q9NITK04.mjs → timing-6rQTuCwg.mjs} +3 -5
- package/dist/{tracing-Dro5eH6j.d.mts → tracing-JSFiBl5r.d.mts} +0 -2
- package/dist/{transactionContext-NHmhDIOF.mjs → transactionContext-DaxYUEgH.mjs} +2 -3
- package/dist/{typeGuards-CPYR9RCg.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-BI4sbUJ3.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-oBTU3a_k.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-BmE8zRrh.mjs → utils-CjjGOT4E.mjs} +20 -30
- package/dist/{validate-Dby08LhR.mjs → validate-4RlTKOJb.mjs} +5 -7
- package/dist/{versioning-P6JMNcJr.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-BcMLKa3G.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,12 +1,12 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
3
|
-
import { t as arcLog } from "./logger-
|
|
4
|
-
import { g as getUserId, n as PUBLIC_SCOPE } from "./types-
|
|
5
|
-
import { n as isEventVisible, t as eventAudienceOf } from "./tenancy-
|
|
6
|
-
import { a as promoteStreamTokenToHeader } from "./streaming-
|
|
7
|
-
import { t as openSseStream } from "./sseStream-
|
|
1
|
+
/*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-Kv1fZdLg.mjs";
|
|
3
|
+
import { t as arcLog } from "./logger-CbFcIEBZ.mjs";
|
|
4
|
+
import { g as getUserId, n as PUBLIC_SCOPE } from "./types-CuGjhn83.mjs";
|
|
5
|
+
import { n as isEventVisible, t as eventAudienceOf } from "./tenancy-DSa_0hhw.mjs";
|
|
6
|
+
import { a as promoteStreamTokenToHeader } from "./streaming-DvraWW6x.mjs";
|
|
7
|
+
import { t as openSseStream } from "./sseStream-AWLEeNV-.mjs";
|
|
8
8
|
import fp from "fastify-plugin";
|
|
9
|
-
|
|
9
|
+
// src/plugins/sse.ts
|
|
10
10
|
var sse_exports = /* @__PURE__ */ __exportAll({
|
|
11
11
|
default: () => sse_default,
|
|
12
12
|
ssePlugin: () => ssePlugin
|
|
@@ -208,5 +208,4 @@ var sse_default = fp(ssePlugin, {
|
|
|
208
208
|
fastify: "5.x",
|
|
209
209
|
dependencies: ["arc-events"]
|
|
210
210
|
});
|
|
211
|
-
//#endregion
|
|
212
211
|
export { sse_exports as n, sse_default as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { n as forwardedStreamHeaders } from "./streaming-
|
|
3
|
-
|
|
1
|
+
/*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as forwardedStreamHeaders } from "./streaming-DvraWW6x.mjs";
|
|
3
|
+
// src/utils/sseStream.ts
|
|
4
4
|
/**
|
|
5
5
|
* Take over the reply socket and open an SSE stream. Call ONLY after every
|
|
6
6
|
* gate (auth, permissions, validation) has passed — after `hijack()` no
|
|
@@ -54,5 +54,4 @@ function openSseStream(request, reply, options = {}) {
|
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
//#endregion
|
|
58
57
|
export { openSseStream as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
//#region src/types/storage.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Arc's minimal backend-agnostic storage contract.
|
|
5
4
|
*
|
|
@@ -147,5 +146,4 @@ interface Storage {
|
|
|
147
146
|
*/
|
|
148
147
|
resolveUrl?(id: string, ctx: StorageContext): Promise<string>;
|
|
149
148
|
}
|
|
150
|
-
//#endregion
|
|
151
149
|
export { StorageReadResult as a, StorageReadRange as i, StorageContext as n, StorageUploadInput as o, StorageFile as r, Storage as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
|
|
1
|
+
/*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
|
|
2
|
+
// src/utils/store-helpers.ts
|
|
3
3
|
/**
|
|
4
4
|
* Classify an error thrown by `getOne` / `getById` / `update` as a
|
|
5
5
|
* "document not found" miss. Mongokit uses `status: 404`, Prisma uses
|
|
@@ -58,5 +58,4 @@ function createIsDuplicateKeyError(repository) {
|
|
|
58
58
|
return e.code === 11e3 || e.codeName === "DuplicateKey";
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
//#endregion
|
|
62
61
|
export { createSafeGetOne as n, createIsDuplicateKeyError as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
|
|
2
2
|
import { Readable } from "node:stream";
|
|
3
|
-
|
|
3
|
+
// src/utils/streaming.ts
|
|
4
4
|
/**
|
|
5
5
|
* Streaming helpers — adapters between Web `ReadableStream` producers
|
|
6
6
|
* (Vercel AI SDK, OpenAI SDK, `fetch().body`, hand-built `TransformStream`s)
|
|
@@ -159,5 +159,4 @@ function isReadableStream(value) {
|
|
|
159
159
|
const obj = value;
|
|
160
160
|
return typeof obj.getReader === "function" && typeof obj.cancel === "function" && typeof obj.locked === "boolean";
|
|
161
161
|
}
|
|
162
|
-
//#endregion
|
|
163
162
|
export { promoteStreamTokenToHeader as a, pipeUIMessageStreamToReply as i, forwardedStreamHeaders as n, isReadableStream as r, UI_MESSAGE_STREAM_HEADERS as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
|
|
1
|
+
/*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
|
|
2
|
+
// src/events/subscriberIdentity.ts
|
|
3
3
|
const SUBSCRIBER_ID = Symbol.for("@classytic/arc/subscriber-id");
|
|
4
4
|
/** Assign a deployment-stable identity for durable per-handler progress; never use an index. */
|
|
5
5
|
function withSubscriberId(id, handler) {
|
|
@@ -24,5 +24,4 @@ function preserveSubscriberIdentity(original, wrapper) {
|
|
|
24
24
|
});
|
|
25
25
|
return wrapper;
|
|
26
26
|
}
|
|
27
|
-
//#endregion
|
|
28
27
|
export { preserveSubscriberIdentity as n, withSubscriberId as r, getSubscriberId as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { b as isElevated, c as getOrgId } from "./types-
|
|
3
|
-
|
|
1
|
+
/*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
|
|
2
|
+
import { b as isElevated, c as getOrgId } from "./types-CuGjhn83.mjs";
|
|
3
|
+
// src/core/tenancy.ts
|
|
4
4
|
function eventAudienceOf(scope) {
|
|
5
5
|
const tenancy = resolveTenancy({ _scope: scope }, "organizationId");
|
|
6
6
|
return tenancy.mode === "scoped" ? {
|
|
@@ -39,5 +39,4 @@ function resolveTenancy(input, tenantField) {
|
|
|
39
39
|
reason: scope && isElevated(scope) ? "platform" : "no-org"
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
//#endregion
|
|
43
42
|
export { isEventVisible as n, resolveTenancy as r, eventAudienceOf as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as conjoinPolicyFilters } from "./filter-merge-
|
|
3
|
-
import { d as createDomainError } from "./errors-
|
|
4
|
-
import { b as isElevated, c as getOrgId, d as getScopeContext, m as getTeamId, v as hasOrgAccess } from "./types-
|
|
5
|
-
|
|
1
|
+
/*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as conjoinPolicyFilters } from "./filter-merge-BAWi019Q.mjs";
|
|
3
|
+
import { d as createDomainError } from "./errors-BY8vzlP4.mjs";
|
|
4
|
+
import { b as isElevated, c as getOrgId, d as getScopeContext, m as getTeamId, v as hasOrgAccess } from "./types-CuGjhn83.mjs";
|
|
5
|
+
// src/permissions/tenantPreparation.ts
|
|
6
6
|
/** Tenant preparation shared by HTTP middleware and direct transport invocation. */
|
|
7
7
|
const PREPARATION = Symbol.for("arc.tenantPreparation");
|
|
8
8
|
function tagTenantPreparation(middleware, preparation) {
|
|
@@ -63,5 +63,4 @@ function prepareTenantContext(ctx, middlewares) {
|
|
|
63
63
|
if (meta._tenantFields) ctx._tenantFields = meta._tenantFields;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
//#endregion
|
|
67
66
|
export { withoutTenantInjection as a, tagTenantPreparation as i, isTenantPreparation as n, prepareTenantContext as r, applyTenantPreparation as t };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import { D as CleanupRunStore } from "../types-
|
|
3
|
-
//#region src/testing/cleanupStoreContract.d.ts
|
|
2
|
+
import { D as CleanupRunStore } from "../types-C0YJAiL0.mjs";
|
|
4
3
|
export interface CleanupRunStoreContractSetupResult {
|
|
5
4
|
store: CleanupRunStore;
|
|
6
5
|
teardown?: () => Promise<void>;
|
|
7
6
|
}
|
|
8
7
|
export type CleanupRunStoreContractSetup = () => Promise<CleanupRunStoreContractSetupResult>;
|
|
9
|
-
export declare function runCleanupRunStoreContract(name: string, setup: CleanupRunStoreContractSetup): void;
|
|
10
|
-
//#endregion
|
|
8
|
+
export declare function runCleanupRunStoreContract(name: string, setup: CleanupRunStoreContractSetup): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
|
|
2
2
|
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
3
|
-
|
|
3
|
+
// src/testing/cleanupStoreContract.ts
|
|
4
4
|
/**
|
|
5
5
|
* Cleanup Run-Store Contract Suite
|
|
6
6
|
*
|
|
@@ -378,5 +378,4 @@ function runCleanupRunStoreContract(name, setup) {
|
|
|
378
378
|
});
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
|
-
//#endregion
|
|
382
381
|
export { runCleanupRunStoreContract };
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
import { i as RequestScope } from "../types-
|
|
3
|
-
import { l as PermissionCheck, t as AnyRecord } from "../base-
|
|
4
|
-
import { F as ResourceDefinition } from "../index-
|
|
5
|
-
import { h as ModuleSetupContext, m as ModuleDisposer, o as ArcPorts, p as PortName, r as ArcModuleInput, u as ModuleName } from "../types-
|
|
6
|
-
import "../index-
|
|
7
|
-
import { n as CreateAppOptions } from "../index-
|
|
2
|
+
import { i as RequestScope } from "../types-DnkIALZ8.mjs";
|
|
3
|
+
import { l as PermissionCheck, t as AnyRecord } from "../base-HXNgPQww.mjs";
|
|
4
|
+
import { F as ResourceDefinition } from "../index-DyJFTJLA.mjs";
|
|
5
|
+
import { h as ModuleSetupContext, m as ModuleDisposer, o as ArcPorts, p as PortName, r as ArcModuleInput, u as ModuleName } from "../types-BeEJm-DV.mjs";
|
|
6
|
+
import "../index-Bqfo8hLz.mjs";
|
|
7
|
+
import { n as CreateAppOptions } from "../index-CUdaoCYt.mjs";
|
|
8
8
|
import { StorageContractSetup, StorageContractSetupResult, runStorageContract } from "./storageContract.mjs";
|
|
9
9
|
import { StandardRepo } from "@classytic/repo-core/repository";
|
|
10
10
|
import { FastifyInstance, FastifyServerOptions } from "fastify";
|
|
11
11
|
import { Mock } from "vitest";
|
|
12
|
-
//#region src/testing/assertions.d.ts
|
|
13
12
|
/**
|
|
14
13
|
* expectArc — Arc-specific response assertions
|
|
15
14
|
*
|
|
@@ -73,8 +72,6 @@ interface ArcAssertion {
|
|
|
73
72
|
hasMeta(key: string, value?: unknown): ArcAssertion;
|
|
74
73
|
}
|
|
75
74
|
export declare function expectArc(response: ArcResponseLike): ArcAssertion;
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region src/testing/testActor.d.ts
|
|
78
75
|
/** The header the testing harness uses to carry a request's actor. */
|
|
79
76
|
export declare const TEST_ACTOR_HEADER = "x-test-actor";
|
|
80
77
|
/**
|
|
@@ -148,8 +145,6 @@ export declare function testActorAuth(defaultActor?: TestActor): {
|
|
|
148
145
|
type: "authenticator";
|
|
149
146
|
authenticate: (request: unknown) => Promise<void>;
|
|
150
147
|
};
|
|
151
|
-
//#endregion
|
|
152
|
-
//#region src/testing/bootModuleApp.d.ts
|
|
153
148
|
/** Handed to a modules factory — the in-memory DB is live at call time. */
|
|
154
149
|
/**
|
|
155
150
|
* A provisioned test database — what the `database` seam yields. Arc
|
|
@@ -234,8 +229,6 @@ export declare function mongoMemoryDatabase(opts: {
|
|
|
234
229
|
replset?: boolean;
|
|
235
230
|
}): Promise<TestDatabase<unknown>>;
|
|
236
231
|
export declare function bootModuleApp<TConn = unknown>(modules: BootModulesInput<TConn>, options?: BootModuleAppOptions<TConn>): Promise<ModuleTestApp<TConn>>;
|
|
237
|
-
//#endregion
|
|
238
|
-
//#region src/testing/assertModuleBootsAlone.d.ts
|
|
239
232
|
interface ModuleBootsAloneOptions<TConn = unknown> extends BootModuleAppOptions<TConn> {
|
|
240
233
|
/** Runs against the booted closure before it closes — drive the module's cross-module ports. */
|
|
241
234
|
probe?: (t: ModuleTestApp<TConn>) => void | Promise<void>;
|
|
@@ -247,8 +240,6 @@ interface ModuleBootsAloneResult {
|
|
|
247
240
|
export declare function assertModuleBootsAlone<TConn = unknown>(modules: BootModulesInput<TConn>,
|
|
248
241
|
/** The module — or several roots booted together, when a deployment rule pairs them. */
|
|
249
242
|
name: ModuleName | readonly ModuleName[], options?: ModuleBootsAloneOptions<TConn>): Promise<ModuleBootsAloneResult>;
|
|
250
|
-
//#endregion
|
|
251
|
-
//#region src/testing/authorizationConformance.d.ts
|
|
252
243
|
/** One surface's observed enforcement: the HTTP status + the filter arc passed the repo. */
|
|
253
244
|
interface SurfaceObservation {
|
|
254
245
|
/** HTTP status the surface returned (200 = allowed, 401/403 = denied). */
|
|
@@ -287,8 +278,6 @@ export declare function runAuthorizationConformance(opts: {
|
|
|
287
278
|
/** Rows the mock repo returns for list (aggregation returns a count). */
|
|
288
279
|
rows?: AnyRecord[];
|
|
289
280
|
}): Promise<AuthorizationConformance>;
|
|
290
|
-
//#endregion
|
|
291
|
-
//#region src/testing/authSession.d.ts
|
|
292
281
|
/**
|
|
293
282
|
* A concrete auth session — headers ready to drop into `app.inject`.
|
|
294
283
|
*
|
|
@@ -357,8 +346,6 @@ export declare function createBetterAuthProvider(opts?: {
|
|
|
357
346
|
export declare function createCustomAuthProvider(mintToken: (role: string, config: RoleConfig) => string, opts?: {
|
|
358
347
|
defaultOrgId?: string;
|
|
359
348
|
}): TestAuthProvider;
|
|
360
|
-
//#endregion
|
|
361
|
-
//#region src/testing/betterAuth.d.ts
|
|
362
349
|
interface BetterAuthTestHelpersOptions {
|
|
363
350
|
/** Base path where Better Auth is mounted (default: '/api/auth'). */
|
|
364
351
|
basePath?: string;
|
|
@@ -514,8 +501,6 @@ export declare function createBetterAuthTestHelpers(options?: BetterAuthTestHelp
|
|
|
514
501
|
* runtime one).
|
|
515
502
|
*/
|
|
516
503
|
export declare function setupBetterAuthTestApp(input: SetupBetterAuthTestAppInput): Promise<SetupBetterAuthTestAppResult>;
|
|
517
|
-
//#endregion
|
|
518
|
-
//#region src/testing/fixtures.d.ts
|
|
519
504
|
type FixtureFactory<T extends object = AnyRecord> = (data: Partial<T>) => Promise<T>;
|
|
520
505
|
/** Delete hook invoked by `clear()` for records that were created through a factory. */
|
|
521
506
|
type FixtureDestroyer<T extends object = AnyRecord> = (record: T) => Promise<void>;
|
|
@@ -544,8 +529,6 @@ interface TestFixtures {
|
|
|
544
529
|
readonly names: readonly string[];
|
|
545
530
|
}
|
|
546
531
|
export declare function createTestFixtures(): TestFixtures;
|
|
547
|
-
//#endregion
|
|
548
|
-
//#region src/testing/HttpTestHarness.d.ts
|
|
549
532
|
interface HttpTestHarnessOptions<T = unknown> {
|
|
550
533
|
/** Fastify app (must be ready). */
|
|
551
534
|
app: FastifyInstance;
|
|
@@ -582,8 +565,6 @@ export declare class HttpTestHarness<T = unknown> {
|
|
|
582
565
|
* (for eager app setup) or a getter function (for async `beforeAll` apps).
|
|
583
566
|
*/
|
|
584
567
|
export declare function createHttpTestHarness<T = unknown>(resource: ResourceDefinition<unknown>, optionsOrGetter: HttpTestHarnessOptions<T> | (() => HttpTestHarnessOptions<T>)): HttpTestHarness<T>;
|
|
585
|
-
//#endregion
|
|
586
|
-
//#region src/testing/mocks.d.ts
|
|
587
568
|
/**
|
|
588
569
|
* Extended repository interface for testing (includes optional preset methods)
|
|
589
570
|
*/
|
|
@@ -706,8 +687,6 @@ export declare function createTestTimer(): {
|
|
|
706
687
|
set: (timestamp: number) => void;
|
|
707
688
|
reset: () => void;
|
|
708
689
|
};
|
|
709
|
-
//#endregion
|
|
710
|
-
//#region src/testing/moduleSetup.d.ts
|
|
711
690
|
interface TestModuleSetup {
|
|
712
691
|
/** Pass this as the second argument to `bootstrap` / `plugins` / `afterResources`. */
|
|
713
692
|
readonly context: ModuleSetupContext<PortName, PortName>;
|
|
@@ -731,8 +710,6 @@ export declare function createTestModuleSetup(options?: {
|
|
|
731
710
|
/** The `context.ports` the phases see — supply what the module declares. */
|
|
732
711
|
readonly ports?: ArcPorts;
|
|
733
712
|
}): TestModuleSetup;
|
|
734
|
-
//#endregion
|
|
735
|
-
//#region src/testing/scopeRoleGate.d.ts
|
|
736
713
|
/**
|
|
737
714
|
* Grants iff the caller is an org member holding one of `allowed` as an ORG role.
|
|
738
715
|
*
|
|
@@ -756,8 +733,6 @@ export declare function createTestModuleSetup(options?: {
|
|
|
756
733
|
* green test reads another org's rows.
|
|
757
734
|
*/
|
|
758
735
|
export declare function scopeRoleGate(...allowed: string[]): PermissionCheck;
|
|
759
|
-
//#endregion
|
|
760
|
-
//#region src/testing/testApp.d.ts
|
|
761
736
|
type DbMode = "in-memory" | {
|
|
762
737
|
uri: string;
|
|
763
738
|
} | false;
|
|
@@ -833,5 +808,4 @@ export declare function createTestApp(options?: CreateTestAppOptions): Promise<T
|
|
|
833
808
|
* dependencies).
|
|
834
809
|
*/
|
|
835
810
|
export declare function createMinimalTestApp(options?: FastifyServerOptions): FastifyInstance;
|
|
836
|
-
//#endregion
|
|
837
811
|
export { type ArcAssertion, type ArcResponseLike, type AuthMode, type AuthResponse, type AuthorizationConformance, type BetterAuthTestHelpers, type BetterAuthTestHelpersOptions, type BetterAuthTestUser, type BootModuleAppOptions, type BootModulesInput, type CreateOrgInput, type CreateTestAppOptions, type DbMode, type FixtureDestroyer, type FixtureFactory, type FixtureRegistration, type HttpTestHarnessOptions, type MockRepository, type ModuleBootsAloneOptions, type ModuleBootsAloneResult, type ModuleTestApp, type OrgResponse, type RoleConfig, type SetupBetterAuthTestAppInput, type SetupBetterAuthTestAppResult, type SignInInput, type SignUpInput, type StorageContractSetup, type StorageContractSetupResult, type SurfaceObservation, type TestActor, type TestAppContext, type TestAuthProvider, type TestAuthSession, type TestDatabase, type TestDatabaseFactory, type TestFixtures, type TestModuleSetup, type TestkitContext, runStorageContract };
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as CRUD_OPERATIONS } from "../constants-
|
|
3
|
-
import {
|
|
4
|
-
import { g as getUserId } from "../types-
|
|
5
|
-
import { t as defineAggregation } from "../defineAggregation-
|
|
6
|
-
import { t as defineResource } from "../defineResource-
|
|
7
|
-
import { E as requireOrgRole } from "../permissions-
|
|
8
|
-
import { h as asModulePorts, r as createApp } from "../createApp-
|
|
9
|
-
import { d as resolveModule, l as isLazyBridge, o as resolveModuleClosure } from "../plan-
|
|
10
|
-
import { n as getModuleExports } from "../module-
|
|
1
|
+
/*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as CRUD_OPERATIONS } from "../constants-CHZMUwBW.mjs";
|
|
3
|
+
import { f as BaseController } from "../plugin-DTWt_8C3.mjs";
|
|
4
|
+
import { g as getUserId } from "../types-CuGjhn83.mjs";
|
|
5
|
+
import { t as defineAggregation } from "../defineAggregation-bmKQ4NmC.mjs";
|
|
6
|
+
import { t as defineResource } from "../defineResource-CGmdmGwh.mjs";
|
|
7
|
+
import { E as requireOrgRole } from "../permissions-A1oKtpiC.mjs";
|
|
8
|
+
import { h as asModulePorts, r as createApp } from "../createApp-DZIXfDKD.mjs";
|
|
9
|
+
import { d as resolveModule, l as isLazyBridge, o as resolveModuleClosure } from "../plan-KVseuBCL.mjs";
|
|
10
|
+
import { n as getModuleExports } from "../module-Dsc_nKL5.mjs";
|
|
11
11
|
import { runStorageContract } from "./storageContract.mjs";
|
|
12
12
|
import Fastify from "fastify";
|
|
13
13
|
import { afterAll, describe, expect, it, vi } from "vitest";
|
|
14
|
-
|
|
14
|
+
// src/testing/assertions.ts
|
|
15
15
|
/**
|
|
16
16
|
* expectArc — Arc-specific response assertions
|
|
17
17
|
*
|
|
@@ -134,8 +134,7 @@ function expectArc(response) {
|
|
|
134
134
|
};
|
|
135
135
|
return assertion;
|
|
136
136
|
}
|
|
137
|
-
|
|
138
|
-
//#region src/testing/testActor.ts
|
|
137
|
+
// src/testing/testActor.ts
|
|
139
138
|
/**
|
|
140
139
|
* Test-only actor installation — how a package's HTTP tests say "run this
|
|
141
140
|
* request as a manager in org X".
|
|
@@ -255,8 +254,7 @@ function testActorAuth(defaultActor) {
|
|
|
255
254
|
authenticate
|
|
256
255
|
};
|
|
257
256
|
}
|
|
258
|
-
|
|
259
|
-
//#region src/testing/bootModuleApp.ts
|
|
257
|
+
// src/testing/bootModuleApp.ts
|
|
260
258
|
/**
|
|
261
259
|
* The built-in DB factory: in-memory MongoDB via lazy devDep imports.
|
|
262
260
|
* Everything Mongo-specific about the harness lives HERE — the harness
|
|
@@ -331,8 +329,7 @@ async function bootModuleApp(modules, options = {}) {
|
|
|
331
329
|
}
|
|
332
330
|
};
|
|
333
331
|
}
|
|
334
|
-
|
|
335
|
-
//#region src/testing/assertModuleBootsAlone.ts
|
|
332
|
+
// src/testing/assertModuleBootsAlone.ts
|
|
336
333
|
/**
|
|
337
334
|
* Boot a module inside its closure — `resolveModuleClosure` (its `dependsOn` and
|
|
338
335
|
* `requires.modules`, transitively, plus every platform module) and every bridge in the list,
|
|
@@ -371,8 +368,7 @@ async function assertModuleBootsAlone(modules, name, options = {}) {
|
|
|
371
368
|
function isInputList(value) {
|
|
372
369
|
return Array.isArray(value);
|
|
373
370
|
}
|
|
374
|
-
|
|
375
|
-
//#region src/testing/mocks.ts
|
|
371
|
+
// src/testing/mocks.ts
|
|
376
372
|
/**
|
|
377
373
|
* Create a mock repository for testing
|
|
378
374
|
*
|
|
@@ -603,8 +599,7 @@ function createTestTimer() {
|
|
|
603
599
|
}
|
|
604
600
|
};
|
|
605
601
|
}
|
|
606
|
-
|
|
607
|
-
//#region src/testing/authorizationConformance.ts
|
|
602
|
+
// src/testing/authorizationConformance.ts
|
|
608
603
|
/**
|
|
609
604
|
* Cross-surface authorization conformance (arc 2.30).
|
|
610
605
|
*
|
|
@@ -731,8 +726,7 @@ async function runAuthorizationConformance(opts) {
|
|
|
731
726
|
close: () => app.close()
|
|
732
727
|
};
|
|
733
728
|
}
|
|
734
|
-
|
|
735
|
-
//#region src/testing/authSession.ts
|
|
729
|
+
// src/testing/authSession.ts
|
|
736
730
|
function buildHeaders(token, orgId, extra) {
|
|
737
731
|
const headers = { authorization: `Bearer ${token}` };
|
|
738
732
|
if (orgId) headers["x-organization-id"] = orgId;
|
|
@@ -849,8 +843,7 @@ function createCustomAuthProvider(mintToken, opts = {}) {
|
|
|
849
843
|
mintToken
|
|
850
844
|
});
|
|
851
845
|
}
|
|
852
|
-
|
|
853
|
-
//#region src/testing/betterAuth.ts
|
|
846
|
+
// src/testing/betterAuth.ts
|
|
854
847
|
const DEFAULT_BASE_PATH = "/api/auth";
|
|
855
848
|
/**
|
|
856
849
|
* Parse a JSON body safely. Returns null when empty or malformed — Better
|
|
@@ -1070,8 +1063,7 @@ async function setupBetterAuthTestApp(input) {
|
|
|
1070
1063
|
}
|
|
1071
1064
|
};
|
|
1072
1065
|
}
|
|
1073
|
-
|
|
1074
|
-
//#region src/testing/fixtures.ts
|
|
1066
|
+
// src/testing/fixtures.ts
|
|
1075
1067
|
function createTestFixtures() {
|
|
1076
1068
|
const registry = /* @__PURE__ */ new Map();
|
|
1077
1069
|
const tracked = [];
|
|
@@ -1116,8 +1108,7 @@ function createTestFixtures() {
|
|
|
1116
1108
|
}
|
|
1117
1109
|
};
|
|
1118
1110
|
}
|
|
1119
|
-
|
|
1120
|
-
//#region src/testing/HttpTestHarness.ts
|
|
1111
|
+
// src/testing/HttpTestHarness.ts
|
|
1121
1112
|
/**
|
|
1122
1113
|
* An op is "protected" (should 401 without a token) unless the resource
|
|
1123
1114
|
* explicitly wired `allowPublic()` — that's the same rule arc's router uses
|
|
@@ -1396,8 +1387,7 @@ var HttpTestHarness = class {
|
|
|
1396
1387
|
function createHttpTestHarness(resource, optionsOrGetter) {
|
|
1397
1388
|
return new HttpTestHarness(resource, optionsOrGetter);
|
|
1398
1389
|
}
|
|
1399
|
-
|
|
1400
|
-
//#region src/testing/moduleSetup.ts
|
|
1390
|
+
// src/testing/moduleSetup.ts
|
|
1401
1391
|
/**
|
|
1402
1392
|
* A real `ModuleSetupContext` for tests that invoke a module's setup phases
|
|
1403
1393
|
* DIRECTLY — `mod.bootstrap(app, ctx)`, `mod.plugins(app, ctx)` — instead of
|
|
@@ -1455,8 +1445,7 @@ function createTestModuleSetup(options = {}) {
|
|
|
1455
1445
|
}
|
|
1456
1446
|
};
|
|
1457
1447
|
}
|
|
1458
|
-
|
|
1459
|
-
//#region src/testing/scopeRoleGate.ts
|
|
1448
|
+
// src/testing/scopeRoleGate.ts
|
|
1460
1449
|
/**
|
|
1461
1450
|
* `scopeRoleGate` — the ONE role gate for package tests.
|
|
1462
1451
|
*
|
|
@@ -1512,8 +1501,7 @@ function createTestModuleSetup(options = {}) {
|
|
|
1512
1501
|
function scopeRoleGate(...allowed) {
|
|
1513
1502
|
return requireOrgRole(...allowed);
|
|
1514
1503
|
}
|
|
1515
|
-
|
|
1516
|
-
//#region src/testing/testApp.ts
|
|
1504
|
+
// src/testing/testApp.ts
|
|
1517
1505
|
/**
|
|
1518
1506
|
* createTestApp — test app factory for arc
|
|
1519
1507
|
*
|
|
@@ -1578,7 +1566,7 @@ function pickDefaultAuth(authMode, callerAuth) {
|
|
|
1578
1566
|
};
|
|
1579
1567
|
}
|
|
1580
1568
|
async function createTestApp(options = {}) {
|
|
1581
|
-
const { createApp } = await import("../createApp-
|
|
1569
|
+
const { createApp } = await import("../createApp-DZIXfDKD.mjs").then((n) => n.i);
|
|
1582
1570
|
const { resources = [], db = "in-memory", connectMongoose = false, authMode = "jwt", defaultOrgId, plugins, auth: callerAuth, ...appOptions } = options;
|
|
1583
1571
|
let dbHandle;
|
|
1584
1572
|
let dbUri;
|
|
@@ -1647,5 +1635,4 @@ function createMinimalTestApp(options = {}) {
|
|
|
1647
1635
|
...options
|
|
1648
1636
|
});
|
|
1649
1637
|
}
|
|
1650
|
-
//#endregion
|
|
1651
1638
|
export { HttpTestHarness, TEST_ACTOR_HEADER, assertModuleBootsAlone, bootModuleApp, createBetterAuthProvider, createBetterAuthTestHelpers, createCustomAuthProvider, createDataFactory, createHttpTestHarness, createJwtAuthProvider, createMinimalTestApp, createMockController, createMockReply, createMockRepository, createMockRequest, createMockUser, createSpy, createTestApp, createTestFixtures, createTestModuleSetup, createTestTimer, expectArc, mongoMemoryDatabase, runAuthorizationConformance, runStorageContract, safeParseBody, scopeFromTestActor, scopeRoleGate, setupBetterAuthTestApp, testActorAuth, testActorHeaders, waitFor };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
import { OutboxStore } from "@classytic/primitives/outbox";
|
|
3
|
-
//#region src/testing/outboxStoreContract.d.ts
|
|
4
3
|
export interface OutboxStoreContractSetupResult {
|
|
5
4
|
store: OutboxStore;
|
|
6
5
|
/** Called once after the suite. */
|
|
@@ -18,5 +17,4 @@ export interface OutboxStoreContractSetupResult {
|
|
|
18
17
|
reset: () => Promise<void>;
|
|
19
18
|
}
|
|
20
19
|
export type OutboxStoreContractSetup = () => Promise<OutboxStoreContractSetupResult>;
|
|
21
|
-
export declare function runOutboxStoreContract(name: string, setup: OutboxStoreContractSetup): void;
|
|
22
|
-
//#endregion
|
|
20
|
+
export declare function runOutboxStoreContract(name: string, setup: OutboxStoreContractSetup): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as claimedAttempts } from "../claimed-
|
|
1
|
+
/*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as claimedAttempts } from "../claimed-DYlELdnm.mjs";
|
|
3
3
|
import { OutboxConflictError, OutboxOwnershipError } from "@classytic/primitives/outbox";
|
|
4
4
|
import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
5
|
-
|
|
5
|
+
// src/testing/outboxStoreContract.ts
|
|
6
6
|
let seq = 0;
|
|
7
7
|
/**
|
|
8
8
|
* A minimal well-formed event. Ids are unique per call.
|
|
@@ -479,5 +479,4 @@ function runOutboxStoreContract(name, setup) {
|
|
|
479
479
|
});
|
|
480
480
|
});
|
|
481
481
|
}
|
|
482
|
-
//#endregion
|
|
483
482
|
export { runOutboxStoreContract };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { r as ArcModuleInput } from "../types-
|
|
3
|
-
//#region src/testing/requiredPorts.d.ts
|
|
2
|
+
import { r as ArcModuleInput } from "../types-BeEJm-DV.mjs";
|
|
4
3
|
export interface RequiredPortsOptions {
|
|
5
4
|
/** Modules composed alongside — the peers the module `dependsOn` or `requires.modules`. */
|
|
6
5
|
readonly with?: readonly ArcModuleInput[];
|
|
@@ -12,5 +11,4 @@ export interface RequiredPortsResult {
|
|
|
12
11
|
/** The required ports, in declared order. */
|
|
13
12
|
readonly ports: readonly string[];
|
|
14
13
|
}
|
|
15
|
-
export declare function assertRequiresPorts(module: ArcModuleInput, ports: readonly string[], options?: RequiredPortsOptions): Promise<RequiredPortsResult>;
|
|
16
|
-
//#endregion
|
|
14
|
+
export declare function assertRequiresPorts(module: ArcModuleInput, ports: readonly string[], options?: RequiredPortsOptions): Promise<RequiredPortsResult>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { c as declareModules, d as resolveModule, i as planModules, r as compositionProblems } from "../plan-
|
|
3
|
-
|
|
1
|
+
/*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
|
|
2
|
+
import { c as declareModules, d as resolveModule, i as planModules, r as compositionProblems } from "../plan-KVseuBCL.mjs";
|
|
3
|
+
// src/testing/requiredPorts.ts
|
|
4
4
|
/**
|
|
5
5
|
* Assert a module declares EXACTLY `ports` as required, and that composing it without any one of
|
|
6
6
|
* them fails naming the module and that port — alone, and all together in one error. `[]` asserts
|
|
@@ -61,5 +61,4 @@ async function assertRequiresPorts(module, ports, options = {}) {
|
|
|
61
61
|
function sameList(a, b) {
|
|
62
62
|
return a.length === b.length && a.every((x, i) => x === b[i]);
|
|
63
63
|
}
|
|
64
|
-
//#endregion
|
|
65
64
|
export { assertRequiresPorts };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { t as Storage } from "../storage-
|
|
3
|
-
//#region src/testing/storageContract.d.ts
|
|
2
|
+
import { t as Storage } from "../storage-odC5MNKN.mjs";
|
|
4
3
|
export interface StorageContractSetupResult {
|
|
5
4
|
storage: Storage;
|
|
6
5
|
teardown: () => Promise<void>;
|
|
@@ -21,5 +20,4 @@ export type StorageContractSetup = () => Promise<StorageContractSetupResult>;
|
|
|
21
20
|
* 9. Both `kind: "stream"` and `kind: "buffer"` read results deliver correct bytes
|
|
22
21
|
* 10. Ranged reads (if adapter supports them) slice correctly
|
|
23
22
|
*/
|
|
24
|
-
export declare function runStorageContract(name: string, setup: StorageContractSetup): void;
|
|
25
|
-
//#endregion
|
|
23
|
+
export declare function runStorageContract(name: string, setup: StorageContractSetup): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
|
|
2
2
|
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
3
|
-
|
|
3
|
+
// src/testing/storageContract.ts
|
|
4
4
|
/**
|
|
5
5
|
* Storage Contract Suite
|
|
6
6
|
*
|
|
@@ -218,5 +218,4 @@ function runStorageContract(name, setup) {
|
|
|
218
218
|
});
|
|
219
219
|
});
|
|
220
220
|
}
|
|
221
|
-
//#endregion
|
|
222
221
|
export { runStorageContract };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
|
-
|
|
3
|
+
// src/utils/operationIdentity.ts
|
|
4
4
|
/** Security context included in idempotency identities across transports. */
|
|
5
5
|
function operationIdentity(operation, scope, fallbackPrincipal, namespace) {
|
|
6
6
|
const principal = scope?.kind === "service" ? scope.clientId : scope?.kind === "public" ? fallbackPrincipal : scope?.userId ?? fallbackPrincipal;
|
|
@@ -18,8 +18,7 @@ function operationIdentity(operation, scope, fallbackPrincipal, namespace) {
|
|
|
18
18
|
]);
|
|
19
19
|
return createHash("sha256").update(identity).digest("hex");
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
//#region src/idempotency/stores/interface.ts
|
|
21
|
+
// src/idempotency/stores/interface.ts
|
|
23
22
|
/**
|
|
24
23
|
* Helper to create a result object
|
|
25
24
|
*/
|
|
@@ -42,5 +41,4 @@ function resolveIdempotencyTiming(ttlMs, lockTimeoutMs) {
|
|
|
42
41
|
for (const [name, value] of Object.entries(timing)) if (!Number.isFinite(value) || value <= 0) throw new Error(`[arc idempotency] ${name} must be a positive finite duration in milliseconds.`);
|
|
43
42
|
return timing;
|
|
44
43
|
}
|
|
45
|
-
//#endregion
|
|
46
44
|
export { createIdempotencyResult as n, operationIdentity as r, resolveIdempotencyTiming as t };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { FastifyInstance, FastifyRequest } from "fastify";
|
|
3
3
|
import { Span, Tracer } from "@opentelemetry/api";
|
|
4
|
-
//#region src/plugins/tracing.d.ts
|
|
5
4
|
interface TracingOptions {
|
|
6
5
|
/**
|
|
7
6
|
* Service name for traces
|
|
@@ -76,5 +75,4 @@ declare function traced(spanName?: string): (target: {
|
|
|
76
75
|
*/
|
|
77
76
|
declare function isTracingAvailable(): boolean;
|
|
78
77
|
declare const _default: typeof tracingPlugin;
|
|
79
|
-
//#endregion
|
|
80
78
|
export { traced as a, isTracingAvailable as i, _default as n, createSpan as r, TracingOptions as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
|
-
|
|
3
|
+
// src/context/transactionContext.ts
|
|
4
4
|
/**
|
|
5
5
|
* Transaction Context via AsyncLocalStorage
|
|
6
6
|
*
|
|
@@ -61,5 +61,4 @@ const transactionContext = {
|
|
|
61
61
|
/** The underlying AsyncLocalStorage instance. Exposed for advanced integrations. */
|
|
62
62
|
storage
|
|
63
63
|
};
|
|
64
|
-
//#endregion
|
|
65
64
|
export { transactionContext as t };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
|
|
1
|
+
/*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
|
|
2
|
+
// src/utils/typeGuards.ts
|
|
3
3
|
/** Check if fastify has the events plugin registered */
|
|
4
4
|
function hasEvents(instance) {
|
|
5
5
|
const inst = instance;
|
|
6
6
|
return inst.events != null && typeof inst.events.publish === "function";
|
|
7
7
|
}
|
|
8
|
-
//#endregion
|
|
9
8
|
export { hasEvents as t };
|