@geekmidas/constructs 10.0.0-alpha.18 → 10.0.0-alpha.181
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 +246 -158
- package/dist/Construct-127M7yrl.d.cts +231 -0
- package/dist/Construct-127M7yrl.d.cts.map +1 -0
- package/dist/Construct-BMk_CRSD.d.mts +231 -0
- package/dist/Construct-BMk_CRSD.d.mts.map +1 -0
- package/dist/{Construct-BeYVu_QF.mjs → Construct-CGuc_Ijk.mjs} +8 -9
- package/dist/Construct-CGuc_Ijk.mjs.map +1 -0
- package/dist/{Construct-DqdlARxq.cjs → Construct-DorKS0Ua.cjs} +8 -9
- package/dist/Construct-DorKS0Ua.cjs.map +1 -0
- package/dist/{Cron-l4Wlz6G9.d.mts → Cron-BcA8F0S-.d.cts} +16 -9
- package/dist/Cron-BcA8F0S-.d.cts.map +1 -0
- package/dist/{Cron-zsoSAwZo.d.cts → Cron-z2CiuQT_.d.mts} +15 -8
- package/dist/Cron-z2CiuQT_.d.mts.map +1 -0
- package/dist/{CronBuilder-D_0HNBTr.mjs → CronBuilder-BJ5LoadF.mjs} +28 -11
- package/dist/CronBuilder-BJ5LoadF.mjs.map +1 -0
- package/dist/CronBuilder-BZvo34X2.d.cts +47 -0
- package/dist/CronBuilder-BZvo34X2.d.cts.map +1 -0
- package/dist/{CronBuilder-BdnI6lxF.cjs → CronBuilder-B_NSP-Y5.cjs} +27 -10
- package/dist/CronBuilder-B_NSP-Y5.cjs.map +1 -0
- package/dist/CronBuilder-BbgKo8OI.d.mts +47 -0
- package/dist/CronBuilder-BbgKo8OI.d.mts.map +1 -0
- package/dist/Endpoint-52z1P0Ue.cjs +581 -0
- package/dist/Endpoint-52z1P0Ue.cjs.map +1 -0
- package/dist/{Endpoint-oS-Fe3d_.d.mts → Endpoint-CIDUreMW.d.mts} +104 -23
- package/dist/Endpoint-CIDUreMW.d.mts.map +1 -0
- package/dist/{Endpoint-DBflWAe4.d.cts → Endpoint-COisi9jw.d.cts} +101 -20
- package/dist/Endpoint-COisi9jw.d.cts.map +1 -0
- package/dist/Endpoint-sUOU7uLx.mjs +552 -0
- package/dist/Endpoint-sUOU7uLx.mjs.map +1 -0
- package/dist/{EndpointFactory-Bm3aKRdV.mjs → EndpointFactory-Bzi9Sl7r.mjs} +269 -53
- package/dist/EndpointFactory-Bzi9Sl7r.mjs.map +1 -0
- package/dist/{index-Cc4kKPag.d.mts → EndpointFactory-CIM80WIK.d.mts} +189 -106
- package/dist/EndpointFactory-CIM80WIK.d.mts.map +1 -0
- package/dist/{index-C1ZwNOOk.d.cts → EndpointFactory-CfBg6jJE.d.cts} +187 -104
- package/dist/EndpointFactory-CfBg6jJE.d.cts.map +1 -0
- package/dist/{EndpointFactory-CLvWuHyt.cjs → EndpointFactory-Cf_Cs1ym.cjs} +309 -51
- package/dist/EndpointFactory-Cf_Cs1ym.cjs.map +1 -0
- package/dist/Function-BIEsY0Hm.d.cts +76 -0
- package/dist/Function-BIEsY0Hm.d.cts.map +1 -0
- package/dist/Function-BKReud5p.d.mts +76 -0
- package/dist/Function-BKReud5p.d.mts.map +1 -0
- package/dist/{HonoEndpointAdaptor-92zavCsV.cjs → HonoEndpointAdaptor-BTbqfSaa.cjs} +115 -41
- package/dist/HonoEndpointAdaptor-BTbqfSaa.cjs.map +1 -0
- package/dist/{HonoEndpointAdaptor-yYaU7jVJ.mjs → HonoEndpointAdaptor-CBVey2cY.mjs} +112 -38
- package/dist/HonoEndpointAdaptor-CBVey2cY.mjs.map +1 -0
- package/dist/ObjectSubscriberBuilder-Ci_Cc-WZ.d.mts +129 -0
- package/dist/ObjectSubscriberBuilder-Ci_Cc-WZ.d.mts.map +1 -0
- package/dist/ObjectSubscriberBuilder-DWtLxfAJ.d.cts +129 -0
- package/dist/ObjectSubscriberBuilder-DWtLxfAJ.d.cts.map +1 -0
- package/dist/ProcessorBuilder-CdLwJK4k.d.mts +216 -0
- package/dist/ProcessorBuilder-CdLwJK4k.d.mts.map +1 -0
- package/dist/ProcessorBuilder-ClD7tmEe.d.cts +216 -0
- package/dist/ProcessorBuilder-ClD7tmEe.d.cts.map +1 -0
- package/dist/Queue-9Hh20ZCk.mjs +104 -0
- package/dist/Queue-9Hh20ZCk.mjs.map +1 -0
- package/dist/{Queue-D9X6OoON.d.mts → Queue-B8HGg439.d.mts} +42 -41
- package/dist/Queue-B8HGg439.d.mts.map +1 -0
- package/dist/{Queue-DYPB2KWL.d.cts → Queue-C4rijiM7.d.cts} +43 -42
- package/dist/Queue-C4rijiM7.d.cts.map +1 -0
- package/dist/Queue-W1wueijP.cjs +109 -0
- package/dist/Queue-W1wueijP.cjs.map +1 -0
- package/dist/QueueBuilder-BDcv9B71.cjs +135 -0
- package/dist/QueueBuilder-BDcv9B71.cjs.map +1 -0
- package/dist/QueueBuilder-CjULiiDN.d.mts +75 -0
- package/dist/QueueBuilder-CjULiiDN.d.mts.map +1 -0
- package/dist/QueueBuilder-CrZL8HHs.mjs +118 -0
- package/dist/QueueBuilder-CrZL8HHs.mjs.map +1 -0
- package/dist/QueueBuilder-Dacm9qAv.d.cts +75 -0
- package/dist/QueueBuilder-Dacm9qAv.d.cts.map +1 -0
- package/dist/Subscriber-5rCX1Nph.d.cts +83 -0
- package/dist/Subscriber-5rCX1Nph.d.cts.map +1 -0
- package/dist/Subscriber-CtQXhcL7.d.mts +83 -0
- package/dist/Subscriber-CtQXhcL7.d.mts.map +1 -0
- package/dist/SubscriberBuilder-CpFhShTJ.mjs +238 -0
- package/dist/SubscriberBuilder-CpFhShTJ.mjs.map +1 -0
- package/dist/SubscriberBuilder-DJEvNRdD.cjs +261 -0
- package/dist/SubscriberBuilder-DJEvNRdD.cjs.map +1 -0
- package/dist/Topic-BGoOeCT6.mjs +99 -0
- package/dist/Topic-BGoOeCT6.mjs.map +1 -0
- package/dist/Topic-DLCZBNwK.cjs +104 -0
- package/dist/Topic-DLCZBNwK.cjs.map +1 -0
- package/dist/adaptors/aws.cjs +147 -168
- package/dist/adaptors/aws.cjs.map +1 -1
- package/dist/adaptors/aws.d.cts +57 -48
- package/dist/adaptors/aws.d.cts.map +1 -1
- package/dist/adaptors/aws.d.mts +58 -49
- package/dist/adaptors/aws.d.mts.map +1 -1
- package/dist/adaptors/aws.mjs +142 -164
- package/dist/adaptors/aws.mjs.map +1 -1
- package/dist/adaptors/awsWebsocket.cjs +354 -0
- package/dist/adaptors/awsWebsocket.cjs.map +1 -0
- package/dist/adaptors/awsWebsocket.d.cts +156 -0
- package/dist/adaptors/awsWebsocket.d.cts.map +1 -0
- package/dist/adaptors/awsWebsocket.d.mts +156 -0
- package/dist/adaptors/awsWebsocket.d.mts.map +1 -0
- package/dist/adaptors/awsWebsocket.mjs +347 -0
- package/dist/adaptors/awsWebsocket.mjs.map +1 -0
- package/dist/adaptors/hono.cjs +1 -1
- package/dist/adaptors/hono.d.cts +8 -7
- package/dist/adaptors/hono.d.cts.map +1 -1
- package/dist/adaptors/hono.d.mts +10 -9
- package/dist/adaptors/hono.d.mts.map +1 -1
- package/dist/adaptors/hono.mjs +1 -1
- package/dist/adaptors/testing.cjs +1174 -41
- package/dist/adaptors/testing.cjs.map +1 -1
- package/dist/adaptors/testing.d.cts +517 -40
- package/dist/adaptors/testing.d.cts.map +1 -1
- package/dist/adaptors/testing.d.mts +517 -40
- package/dist/adaptors/testing.d.mts.map +1 -1
- package/dist/adaptors/testing.mjs +1140 -36
- package/dist/adaptors/testing.mjs.map +1 -1
- package/dist/auth-CutSfNlr.d.mts +274 -0
- package/dist/auth-CutSfNlr.d.mts.map +1 -0
- package/dist/auth-b9ADezz9.d.cts +274 -0
- package/dist/auth-b9ADezz9.d.cts.map +1 -0
- package/dist/auth.cjs +311 -26
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +2 -104
- package/dist/auth.d.mts +2 -104
- package/dist/auth.mjs +307 -28
- package/dist/auth.mjs.map +1 -1
- package/dist/cache-9wLNSy3O.d.cts +44 -0
- package/dist/cache-9wLNSy3O.d.cts.map +1 -0
- package/dist/cache-BFPs_CGs.d.mts +44 -0
- package/dist/cache-BFPs_CGs.d.mts.map +1 -0
- package/dist/cache.cjs +4 -20
- package/dist/cache.cjs.map +1 -1
- package/dist/cache.d.cts +2 -43
- package/dist/cache.d.mts +2 -43
- package/dist/cache.mjs +4 -20
- package/dist/cache.mjs.map +1 -1
- package/dist/cipher-C1lEFX63.mjs +225 -0
- package/dist/cipher-C1lEFX63.mjs.map +1 -0
- package/dist/cipher-CVxfwLjk.cjs +332 -0
- package/dist/cipher-CVxfwLjk.cjs.map +1 -0
- package/dist/cipher-DSDxPRIp.d.cts +106 -0
- package/dist/cipher-DSDxPRIp.d.cts.map +1 -0
- package/dist/cipher-DSDxPRIp.d.mts +106 -0
- package/dist/cipher-DSDxPRIp.d.mts.map +1 -0
- package/dist/{construct-interface-DPlxfpoS.d.mts → construct-interface-CVoejIpo.d.cts} +79 -8
- package/dist/construct-interface-CVoejIpo.d.cts.map +1 -0
- package/dist/{construct-interface-DgXTJcOD.d.cts → construct-interface-Nw5Dt9AC.d.mts} +79 -8
- package/dist/construct-interface-Nw5Dt9AC.d.mts.map +1 -0
- package/dist/construct-interface.cjs +62 -4
- package/dist/construct-interface.cjs.map +1 -1
- package/dist/construct-interface.d.cts +2 -2
- package/dist/construct-interface.d.mts +2 -2
- package/dist/construct-interface.mjs +59 -5
- package/dist/construct-interface.mjs.map +1 -1
- package/dist/credential-B80mOxwT.mjs +222 -0
- package/dist/credential-B80mOxwT.mjs.map +1 -0
- package/dist/credential-RlgbzZAc.cjs +257 -0
- package/dist/credential-RlgbzZAc.cjs.map +1 -0
- package/dist/credential.cjs +7 -129
- package/dist/credential.d.cts +2 -58
- package/dist/credential.d.mts +2 -58
- package/dist/credential.mjs +2 -128
- package/dist/crons/index.cjs +127 -1
- package/dist/crons/index.cjs.map +1 -1
- package/dist/crons/index.d.cts +43 -3
- package/dist/crons/index.d.cts.map +1 -1
- package/dist/crons/index.d.mts +43 -3
- package/dist/crons/index.d.mts.map +1 -1
- package/dist/crons/index.mjs +126 -2
- package/dist/crons/index.mjs.map +1 -1
- package/dist/database/kysely.cjs +3 -194
- package/dist/database/kysely.d.cts +2 -149
- package/dist/database/kysely.d.mts +2 -149
- package/dist/database/kysely.mjs +2 -192
- package/dist/email.cjs +24 -17
- package/dist/email.cjs.map +1 -1
- package/dist/email.d.cts +15 -5
- package/dist/email.d.cts.map +1 -1
- package/dist/email.d.mts +16 -6
- package/dist/email.d.mts.map +1 -1
- package/dist/email.mjs +23 -17
- package/dist/email.mjs.map +1 -1
- package/dist/encryption/kms.cjs +95 -0
- package/dist/encryption/kms.cjs.map +1 -0
- package/dist/encryption/kms.d.cts +7 -0
- package/dist/encryption/kms.d.cts.map +1 -0
- package/dist/encryption/kms.d.mts +7 -0
- package/dist/encryption/kms.d.mts.map +1 -0
- package/dist/encryption/kms.mjs +93 -0
- package/dist/encryption/kms.mjs.map +1 -0
- package/dist/encryption.cjs +116 -0
- package/dist/encryption.cjs.map +1 -0
- package/dist/encryption.d.cts +37 -0
- package/dist/encryption.d.cts.map +1 -0
- package/dist/encryption.d.mts +37 -0
- package/dist/encryption.d.mts.map +1 -0
- package/dist/encryption.mjs +101 -0
- package/dist/encryption.mjs.map +1 -0
- package/dist/endpoints/index.cjs +32 -10
- package/dist/endpoints/index.d.cts +106 -3
- package/dist/endpoints/index.d.cts.map +1 -0
- package/dist/endpoints/index.d.mts +106 -3
- package/dist/endpoints/index.d.mts.map +1 -0
- package/dist/endpoints/index.mjs +6 -4
- package/dist/expire-C586zznE.d.cts +38 -0
- package/dist/expire-C586zznE.d.cts.map +1 -0
- package/dist/expire-C586zznE.d.mts +38 -0
- package/dist/expire-C586zznE.d.mts.map +1 -0
- package/dist/external-api.cjs +106 -0
- package/dist/external-api.cjs.map +1 -0
- package/dist/external-api.d.cts +2 -0
- package/dist/external-api.d.mts +2 -0
- package/dist/external-api.mjs +103 -0
- package/dist/external-api.mjs.map +1 -0
- package/dist/fake-JI5uN1SF.d.cts +201 -0
- package/dist/fake-JI5uN1SF.d.cts.map +1 -0
- package/dist/fake-zpuXpBmY.d.mts +201 -0
- package/dist/fake-zpuXpBmY.d.mts.map +1 -0
- package/dist/file-server.cjs +170 -49
- package/dist/file-server.cjs.map +1 -1
- package/dist/file-server.d.cts +148 -16
- package/dist/file-server.d.cts.map +1 -1
- package/dist/file-server.d.mts +148 -16
- package/dist/file-server.d.mts.map +1 -1
- package/dist/file-server.mjs +168 -51
- package/dist/file-server.mjs.map +1 -1
- package/dist/functions/index.cjs +1 -1
- package/dist/functions/index.d.cts +2 -1
- package/dist/functions/index.d.mts +2 -1
- package/dist/functions/index.mjs +1 -1
- package/dist/{functions-C53GW2eQ.mjs → functions-BvIDQKAA.mjs} +117 -22
- package/dist/functions-BvIDQKAA.mjs.map +1 -0
- package/dist/{functions-B6qCvfmy.cjs → functions-DLF6-IK8.cjs} +122 -18
- package/dist/functions-DLF6-IK8.cjs.map +1 -0
- package/dist/inbox-CXLU7h_8.d.cts +195 -0
- package/dist/inbox-CXLU7h_8.d.cts.map +1 -0
- package/dist/inbox-DYFsLd9A.d.mts +195 -0
- package/dist/inbox-DYFsLd9A.d.mts.map +1 -0
- package/dist/inbox.cjs +291 -0
- package/dist/inbox.cjs.map +1 -0
- package/dist/inbox.d.cts +2 -0
- package/dist/inbox.d.mts +2 -0
- package/dist/inbox.mjs +283 -0
- package/dist/inbox.mjs.map +1 -0
- package/dist/index-BpE9_6l5.d.mts +115 -0
- package/dist/index-BpE9_6l5.d.mts.map +1 -0
- package/dist/{index-CeEtxDmK.d.cts → index-DdRjYhiJ.d.cts} +42 -2
- package/dist/{index-CeEtxDmK.d.cts.map → index-DdRjYhiJ.d.cts.map} +1 -1
- package/dist/{index-CeEtxDmK.d.mts → index-DdRjYhiJ.d.mts} +42 -2
- package/dist/{index-CeEtxDmK.d.mts.map → index-DdRjYhiJ.d.mts.map} +1 -1
- package/dist/index-zRChehJ9.d.cts +115 -0
- package/dist/index-zRChehJ9.d.cts.map +1 -0
- package/dist/index.cjs +4 -1
- package/dist/index.d.cts +26 -3
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +26 -3
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -2
- package/dist/kysely-5PAqFBzo.d.mts +216 -0
- package/dist/kysely-5PAqFBzo.d.mts.map +1 -0
- package/dist/kysely-Bc9xzaik.mjs +371 -0
- package/dist/kysely-Bc9xzaik.mjs.map +1 -0
- package/dist/kysely-D7f6J2lh.cjs +384 -0
- package/dist/kysely-D7f6J2lh.cjs.map +1 -0
- package/dist/kysely-lxNUBSTP.d.cts +216 -0
- package/dist/kysely-lxNUBSTP.d.cts.map +1 -0
- package/dist/{telemetry-DGcFlVpB.d.cts → lambdaTelemetry-8vnmVZQ5.d.cts} +2 -2
- package/dist/lambdaTelemetry-8vnmVZQ5.d.cts.map +1 -0
- package/dist/{telemetry-DGcFlVpB.d.mts → lambdaTelemetry-8vnmVZQ5.d.mts} +2 -2
- package/dist/lambdaTelemetry-8vnmVZQ5.d.mts.map +1 -0
- package/dist/mobile-app.cjs +79 -0
- package/dist/mobile-app.cjs.map +1 -0
- package/dist/mobile-app.d.cts +78 -0
- package/dist/mobile-app.d.cts.map +1 -0
- package/dist/mobile-app.d.mts +78 -0
- package/dist/mobile-app.d.mts.map +1 -0
- package/dist/mobile-app.mjs +78 -0
- package/dist/mobile-app.mjs.map +1 -0
- package/dist/object-storage.cjs +50 -7
- package/dist/object-storage.cjs.map +1 -1
- package/dist/object-storage.d.cts +37 -3
- package/dist/object-storage.d.cts.map +1 -1
- package/dist/object-storage.d.mts +37 -3
- package/dist/object-storage.d.mts.map +1 -1
- package/dist/object-storage.mjs +49 -9
- package/dist/object-storage.mjs.map +1 -1
- package/dist/optionalPeers-D7Wt6dnF.mjs +140 -0
- package/dist/optionalPeers-D7Wt6dnF.mjs.map +1 -0
- package/dist/optionalPeers-DuNQXXe1.cjs +223 -0
- package/dist/optionalPeers-DuNQXXe1.cjs.map +1 -0
- package/dist/origins-BjxYht13.cjs +96 -0
- package/dist/origins-BjxYht13.cjs.map +1 -0
- package/dist/origins-Boc9qbo-.mjs +73 -0
- package/dist/origins-Boc9qbo-.mjs.map +1 -0
- package/dist/pattern-C1CEcglD.mjs +241 -0
- package/dist/pattern-C1CEcglD.mjs.map +1 -0
- package/dist/pattern-QFaUIr77.cjs +288 -0
- package/dist/pattern-QFaUIr77.cjs.map +1 -0
- package/dist/privateAddress-Bg5fUsbp.mjs +21 -0
- package/dist/privateAddress-Bg5fUsbp.mjs.map +1 -0
- package/dist/privateAddress-CqGyuFHn.cjs +26 -0
- package/dist/privateAddress-CqGyuFHn.cjs.map +1 -0
- package/dist/processors/index.cjs +214 -0
- package/dist/processors/index.cjs.map +1 -0
- package/dist/processors/index.d.cts +78 -0
- package/dist/processors/index.d.cts.map +1 -0
- package/dist/processors/index.d.mts +78 -0
- package/dist/processors/index.d.mts.map +1 -0
- package/dist/processors/index.mjs +193 -0
- package/dist/processors/index.mjs.map +1 -0
- package/dist/queue/index.cjs +5 -192
- package/dist/queue/index.d.cts +3 -53
- package/dist/queue/index.d.mts +3 -53
- package/dist/queue/index.mjs +3 -190
- package/dist/random-password.cjs +86 -0
- package/dist/random-password.cjs.map +1 -0
- package/dist/random-password.d.cts +30 -0
- package/dist/random-password.d.cts.map +1 -0
- package/dist/random-password.d.mts +30 -0
- package/dist/random-password.d.mts.map +1 -0
- package/dist/random-password.mjs +84 -0
- package/dist/random-password.mjs.map +1 -0
- package/dist/readOnlyStorage-C7bCe-z5.cjs +101 -0
- package/dist/readOnlyStorage-C7bCe-z5.cjs.map +1 -0
- package/dist/readOnlyStorage-DMCeLuS2.mjs +78 -0
- package/dist/readOnlyStorage-DMCeLuS2.mjs.map +1 -0
- package/dist/readRequestBody-BmKnPl0a.mjs +293 -0
- package/dist/readRequestBody-BmKnPl0a.mjs.map +1 -0
- package/dist/{lazyAccessors-Dx9NLwJZ.cjs → readRequestBody-CN9GVdeE.cjs} +141 -47
- package/dist/readRequestBody-CN9GVdeE.cjs.map +1 -0
- package/dist/{processAudits-D_2W5x8k.cjs → requestLogger-CnoYd-Ah.cjs} +63 -3
- package/dist/requestLogger-CnoYd-Ah.cjs.map +1 -0
- package/dist/{processAudits-BpRlPQMW.mjs → requestLogger-D2JS7pPM.mjs} +51 -3
- package/dist/requestLogger-D2JS7pPM.mjs.map +1 -0
- package/dist/rest-api.cjs +100 -73
- package/dist/rest-api.cjs.map +1 -1
- package/dist/rest-api.d.cts +83 -59
- package/dist/rest-api.d.cts.map +1 -1
- package/dist/rest-api.d.mts +83 -59
- package/dist/rest-api.d.mts.map +1 -1
- package/dist/rest-api.mjs +97 -76
- package/dist/rest-api.mjs.map +1 -1
- package/dist/runSubscriber-HEqXkin1.mjs +117 -0
- package/dist/runSubscriber-HEqXkin1.mjs.map +1 -0
- package/dist/runSubscriber-sVJfLA0-.cjs +134 -0
- package/dist/runSubscriber-sVJfLA0-.cjs.map +1 -0
- package/dist/shutdown-BMJmAhSt.cjs +38 -0
- package/dist/shutdown-BMJmAhSt.cjs.map +1 -0
- package/dist/shutdown-C7xa8x9S.mjs +27 -0
- package/dist/shutdown-C7xa8x9S.mjs.map +1 -0
- package/dist/site.cjs +140 -10
- package/dist/site.cjs.map +1 -1
- package/dist/site.d.cts +156 -3
- package/dist/site.d.cts.map +1 -1
- package/dist/site.d.mts +156 -3
- package/dist/site.d.mts.map +1 -1
- package/dist/site.mjs +120 -13
- package/dist/site.mjs.map +1 -1
- package/dist/stages-DaTaoQei.d.cts +73 -0
- package/dist/stages-DaTaoQei.d.cts.map +1 -0
- package/dist/stages-DaTaoQei.d.mts +73 -0
- package/dist/stages-DaTaoQei.d.mts.map +1 -0
- package/dist/subscribers/index.cjs +134 -1
- package/dist/subscribers/index.cjs.map +1 -0
- package/dist/subscribers/index.d.cts +74 -3
- package/dist/subscribers/index.d.cts.map +1 -0
- package/dist/subscribers/index.d.mts +74 -3
- package/dist/subscribers/index.d.mts.map +1 -0
- package/dist/subscribers/index.mjs +132 -2
- package/dist/subscribers/index.mjs.map +1 -0
- package/dist/telemetry-BbLyS7ln.d.cts +57 -0
- package/dist/telemetry-BbLyS7ln.d.cts.map +1 -0
- package/dist/telemetry-DWX-qKUh.d.mts +57 -0
- package/dist/telemetry-DWX-qKUh.d.mts.map +1 -0
- package/dist/telemetry.cjs +64 -0
- package/dist/telemetry.cjs.map +1 -0
- package/dist/telemetry.d.cts +2 -0
- package/dist/telemetry.d.mts +2 -0
- package/dist/telemetry.mjs +63 -0
- package/dist/telemetry.mjs.map +1 -0
- package/dist/topic/index.cjs +2 -134
- package/dist/topic/index.d.cts +2 -3
- package/dist/topic/index.d.mts +2 -3
- package/dist/topic/index.mjs +2 -132
- package/dist/tracing-Bbj1uoFJ.mjs +127 -0
- package/dist/tracing-Bbj1uoFJ.mjs.map +1 -0
- package/dist/tracing-C0ooU0V2.cjs +150 -0
- package/dist/tracing-C0ooU0V2.cjs.map +1 -0
- package/dist/websocket-api-9ndLBolx.d.cts +1207 -0
- package/dist/websocket-api-9ndLBolx.d.cts.map +1 -0
- package/dist/websocket-api-BPPXF79i.d.mts +1207 -0
- package/dist/websocket-api-BPPXF79i.d.mts.map +1 -0
- package/dist/websocket-api-C6LGg9-D.mjs +1716 -0
- package/dist/websocket-api-C6LGg9-D.mjs.map +1 -0
- package/dist/websocket-api-CoKPJJRl.cjs +1895 -0
- package/dist/websocket-api-CoKPJJRl.cjs.map +1 -0
- package/dist/websocket-api.cjs +42 -0
- package/dist/websocket-api.d.cts +2 -0
- package/dist/websocket-api.d.mts +2 -0
- package/dist/websocket-api.mjs +3 -0
- package/dist/worker.cjs +174 -32
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.d.cts +147 -47
- package/dist/worker.d.cts.map +1 -1
- package/dist/worker.d.mts +147 -47
- package/dist/worker.d.mts.map +1 -1
- package/dist/worker.mjs +175 -33
- package/dist/worker.mjs.map +1 -1
- package/package.json +180 -43
- package/dist/Construct-BeYVu_QF.mjs.map +0 -1
- package/dist/Construct-DfbwIntp.d.cts +0 -115
- package/dist/Construct-DfbwIntp.d.cts.map +0 -1
- package/dist/Construct-DqdlARxq.cjs.map +0 -1
- package/dist/Construct-l5aOn_jv.d.mts +0 -115
- package/dist/Construct-l5aOn_jv.d.mts.map +0 -1
- package/dist/Cron-l4Wlz6G9.d.mts.map +0 -1
- package/dist/Cron-zsoSAwZo.d.cts.map +0 -1
- package/dist/CronBuilder-BdnI6lxF.cjs.map +0 -1
- package/dist/CronBuilder-CyT71Nzg.d.cts +0 -41
- package/dist/CronBuilder-CyT71Nzg.d.cts.map +0 -1
- package/dist/CronBuilder-D_0HNBTr.mjs.map +0 -1
- package/dist/CronBuilder-UoNgFe8S.d.mts +0 -41
- package/dist/CronBuilder-UoNgFe8S.d.mts.map +0 -1
- package/dist/Endpoint-BpZHtJ2W.cjs +0 -1689
- package/dist/Endpoint-BpZHtJ2W.cjs.map +0 -1
- package/dist/Endpoint-DBflWAe4.d.cts.map +0 -1
- package/dist/Endpoint-ONsly_dq.mjs +0 -1671
- package/dist/Endpoint-ONsly_dq.mjs.map +0 -1
- package/dist/Endpoint-oS-Fe3d_.d.mts.map +0 -1
- package/dist/EndpointFactory-Bm3aKRdV.mjs.map +0 -1
- package/dist/EndpointFactory-CLvWuHyt.cjs.map +0 -1
- package/dist/HonoEndpointAdaptor-92zavCsV.cjs.map +0 -1
- package/dist/HonoEndpointAdaptor-yYaU7jVJ.mjs.map +0 -1
- package/dist/Queue-D9X6OoON.d.mts.map +0 -1
- package/dist/Queue-DYPB2KWL.d.cts.map +0 -1
- package/dist/Subscriber-C4heaAyO.d.mts +0 -51
- package/dist/Subscriber-C4heaAyO.d.mts.map +0 -1
- package/dist/Subscriber-CotDUELC.d.cts +0 -51
- package/dist/Subscriber-CotDUELC.d.cts.map +0 -1
- package/dist/SubscriberBuilder-BEv0eoHy.d.cts +0 -59
- package/dist/SubscriberBuilder-BEv0eoHy.d.cts.map +0 -1
- package/dist/SubscriberBuilder-C0ZEtGDI.cjs +0 -125
- package/dist/SubscriberBuilder-C0ZEtGDI.cjs.map +0 -1
- package/dist/SubscriberBuilder-h7B_cHMr.mjs +0 -114
- package/dist/SubscriberBuilder-h7B_cHMr.mjs.map +0 -1
- package/dist/SubscriberBuilder-tyH5yTk5.d.mts +0 -59
- package/dist/SubscriberBuilder-tyH5yTk5.d.mts.map +0 -1
- package/dist/Topic-DEVGo0Dm.d.cts +0 -89
- package/dist/Topic-DEVGo0Dm.d.cts.map +0 -1
- package/dist/Topic-zk_6Gthr.d.mts +0 -89
- package/dist/Topic-zk_6Gthr.d.mts.map +0 -1
- package/dist/auth.d.cts.map +0 -1
- package/dist/auth.d.mts.map +0 -1
- package/dist/cache.d.cts.map +0 -1
- package/dist/cache.d.mts.map +0 -1
- package/dist/construct-interface-DPlxfpoS.d.mts.map +0 -1
- package/dist/construct-interface-DgXTJcOD.d.cts.map +0 -1
- package/dist/credential.cjs.map +0 -1
- package/dist/credential.d.cts.map +0 -1
- package/dist/credential.d.mts.map +0 -1
- package/dist/credential.mjs.map +0 -1
- package/dist/database/kysely.cjs.map +0 -1
- package/dist/database/kysely.d.cts.map +0 -1
- package/dist/database/kysely.d.mts.map +0 -1
- package/dist/database/kysely.mjs.map +0 -1
- package/dist/functions-B6qCvfmy.cjs.map +0 -1
- package/dist/functions-C53GW2eQ.mjs.map +0 -1
- package/dist/index-B2urf3YI.d.cts +0 -26
- package/dist/index-B2urf3YI.d.cts.map +0 -1
- package/dist/index-C1ZwNOOk.d.cts.map +0 -1
- package/dist/index-Cc4kKPag.d.mts.map +0 -1
- package/dist/index-DMCDvnsM.d.mts +0 -26
- package/dist/index-DMCDvnsM.d.mts.map +0 -1
- package/dist/index-D_frT6MP.d.cts +0 -165
- package/dist/index-D_frT6MP.d.cts.map +0 -1
- package/dist/index-DcyIYbDS.d.mts +0 -165
- package/dist/index-DcyIYbDS.d.mts.map +0 -1
- package/dist/lazyAccessors-BHtcqgz2.mjs +0 -211
- package/dist/lazyAccessors-BHtcqgz2.mjs.map +0 -1
- package/dist/lazyAccessors-Dx9NLwJZ.cjs.map +0 -1
- package/dist/processAudits-BpRlPQMW.mjs.map +0 -1
- package/dist/processAudits-D_2W5x8k.cjs.map +0 -1
- package/dist/queue/index.cjs.map +0 -1
- package/dist/queue/index.d.cts.map +0 -1
- package/dist/queue/index.d.mts.map +0 -1
- package/dist/queue/index.mjs.map +0 -1
- package/dist/telemetry-DGcFlVpB.d.cts.map +0 -1
- package/dist/telemetry-DGcFlVpB.d.mts.map +0 -1
- package/dist/topic/index.cjs.map +0 -1
- package/dist/topic/index.mjs.map +0 -1
|
@@ -1,22 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { n as StandardSchemaV1 } from "../index-DdRjYhiJ.mjs";
|
|
2
|
+
import "../Construct-BMk_CRSD.mjs";
|
|
3
|
+
import { n as Function } from "../Function-BKReud5p.mjs";
|
|
3
4
|
import { t as HttpMethod } from "../types-DMuSQeLL.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { t as Queue } from "../Queue-
|
|
6
|
-
import { t as Subscriber } from "../Subscriber-
|
|
5
|
+
import { c as EndpointSchemas, i as Endpoint } from "../Endpoint-CIDUreMW.mjs";
|
|
6
|
+
import { t as Queue } from "../Queue-B8HGg439.mjs";
|
|
7
|
+
import { t as Subscriber } from "../Subscriber-CtQXhcL7.mjs";
|
|
8
|
+
import { J as RecordedBroadcast, R as Connection, Y as RecordedClose, Z as RecordedSend, _t as WebSocketPublisher, gt as WebSocketMessages, it as TestWebSocketPublisher, mt as NoMessages, q as InvalidWebSocketRequest, r as WebSocketApi } from "../websocket-api-BPPXF79i.mjs";
|
|
9
|
+
import { t as KyselyDatabase } from "../kysely-5PAqFBzo.mjs";
|
|
10
|
+
import { t as Fake } from "../fake-zpuXpBmY.mjs";
|
|
11
|
+
import { o as TestStage } from "../stages-DaTaoQei.mjs";
|
|
12
|
+
import { p as Verdicts } from "../inbox-DYFsLd9A.mjs";
|
|
13
|
+
import { InboxAddressing } from "@geekmidas/manifest";
|
|
7
14
|
import { EventPublisher, ExtractPublisherMessage } from "@geekmidas/events";
|
|
8
15
|
import { Service, ServiceDiscovery, ServiceRecord } from "@geekmidas/services";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
16
|
+
import { EnvironmentParser } from "@geekmidas/envkit";
|
|
17
|
+
import { ComposedAttachment } from "@geekmidas/emailkit/inbound";
|
|
18
|
+
import { Kysely } from "kysely";
|
|
19
|
+
import { TEST_CONTEXT_HEADER } from "@geekmidas/testkit/context";
|
|
20
|
+
import { HttpHandler, WebSocketHandler } from "msw";
|
|
21
|
+
import { Browser, BrowserOptions } from "@geekmidas/testkit/browser";
|
|
22
|
+
import { FakerFactory } from "@geekmidas/testkit/faker";
|
|
23
|
+
import { Mailbox } from "@geekmidas/testkit/mailbox";
|
|
11
24
|
import { Logger } from "@geekmidas/logger";
|
|
12
25
|
import { ComposableStandardSchema, InferComposableStandardSchema, InferStandardSchema } from "@geekmidas/schema";
|
|
26
|
+
import { AuditStorage, AuditableAction, Auditor } from "@geekmidas/audit";
|
|
13
27
|
//#region src/endpoints/MswEndpointAdaptor.d.ts
|
|
14
|
-
/**
|
|
15
|
-
* Header used to identify which test context a request belongs to.
|
|
16
|
-
* Each concurrent test registers its own context (services, db transaction, etc.)
|
|
17
|
-
* and the MSW handler looks it up by this header value.
|
|
18
|
-
*/
|
|
19
|
-
export declare const TEST_CONTEXT_HEADER = "x-test-context-id";
|
|
20
28
|
/**
|
|
21
29
|
* Options for creating MSW handlers from endpoint constructs.
|
|
22
30
|
*
|
|
@@ -57,16 +65,16 @@ interface CreateMswHandlersOptions {
|
|
|
57
65
|
}
|
|
58
66
|
/**
|
|
59
67
|
* Options for registering a per-test context.
|
|
60
|
-
* Follows the same pattern as TestRequestAdaptor — services, database
|
|
61
|
-
*
|
|
68
|
+
* Follows the same pattern as TestRequestAdaptor — services, database and
|
|
69
|
+
* auditorStorage are provided explicitly. A topic is a service under its own
|
|
70
|
+
* name, so a recorder in `services` (`{ users: recorder }`) captures what an
|
|
71
|
+
* endpoint publishes to it.
|
|
62
72
|
*/
|
|
63
73
|
interface RegisterContextOptions {
|
|
64
74
|
/** Service instances keyed by serviceName */
|
|
65
75
|
services?: Record<string, unknown>;
|
|
66
76
|
/** Database instance — required when endpoints use .database() */
|
|
67
77
|
database?: unknown;
|
|
68
|
-
/** Event publisher service definition */
|
|
69
|
-
publisher?: Service;
|
|
70
78
|
/** Audit storage instance — required when endpoints use .auditor() */
|
|
71
79
|
auditorStorage?: unknown;
|
|
72
80
|
}
|
|
@@ -102,13 +110,13 @@ type TestHttpResponse<TBody = any> = {
|
|
|
102
110
|
status: number;
|
|
103
111
|
headers: Record<string, string | string[]>;
|
|
104
112
|
};
|
|
105
|
-
export declare class TestEndpointAdaptor<TRoute extends string, TMethod extends HttpMethod, TInput extends EndpointSchemas = {}, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TSession = unknown,
|
|
113
|
+
export declare class TestEndpointAdaptor<TRoute extends string, TMethod extends HttpMethod, TInput extends EndpointSchemas = {}, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TSession = unknown, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>, TDatabase = undefined, TDatabaseServiceName extends string = string> {
|
|
106
114
|
private readonly endpoint;
|
|
107
115
|
private serviceDiscovery;
|
|
108
|
-
static getDefaultServiceDiscover<TRoute extends string, TMethod extends HttpMethod, TInput extends EndpointSchemas = {}, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TSession = unknown,
|
|
109
|
-
constructor(endpoint: Endpoint<TRoute, TMethod, TInput, TOutSchema, TServices, TLogger, TSession,
|
|
110
|
-
fullRequest(ctx: TestRequestAdaptor<TInput, TServices,
|
|
111
|
-
request(ctx: TestRequestAdaptor<TInput, TServices,
|
|
116
|
+
static getDefaultServiceDiscover<TRoute extends string, TMethod extends HttpMethod, TInput extends EndpointSchemas = {}, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TSession = unknown, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>, TDatabase = undefined, TDatabaseServiceName extends string = string>(_endpoint: Endpoint<TRoute, TMethod, TInput, TOutSchema, TServices, TLogger, TSession, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>): any;
|
|
117
|
+
constructor(endpoint: Endpoint<TRoute, TMethod, TInput, TOutSchema, TServices, TLogger, TSession, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>, serviceDiscovery?: ServiceDiscovery<any>);
|
|
118
|
+
fullRequest(ctx: TestRequestAdaptor<TInput, TServices, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>): Promise<TestHttpResponse<InferStandardSchema<TOutSchema>>>;
|
|
119
|
+
request(ctx: TestRequestAdaptor<TInput, TServices, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>): Promise<InferStandardSchema<TOutSchema>>;
|
|
112
120
|
}
|
|
113
121
|
/**
|
|
114
122
|
* Conditional audit storage requirement - required when TAuditStorage is configured
|
|
@@ -124,24 +132,22 @@ type DatabaseRequirement<TDatabase = undefined> = TDatabase extends undefined ?
|
|
|
124
132
|
/** Database instance - required when endpoint uses .database() */
|
|
125
133
|
database: TDatabase;
|
|
126
134
|
};
|
|
127
|
-
type TestRequestAdaptor<TInput extends EndpointSchemas = {}, TServices extends Service[] = [],
|
|
135
|
+
type TestRequestAdaptor<TInput extends EndpointSchemas = {}, TServices extends Service[] = [], TAuditStorage extends AuditStorage | undefined = undefined, _TAuditStorageServiceName extends string = string, TDatabase = undefined, _TDatabaseServiceName extends string = string> = {
|
|
128
136
|
services: ServiceRecord<TServices>;
|
|
129
137
|
headers: Record<string, string>;
|
|
130
|
-
publisher?: Service<TEventPublisherServiceName, TEventPublisher>;
|
|
131
138
|
} & InferComposableStandardSchema<TInput> & AuditStorageRequirement<TAuditStorage> & DatabaseRequirement<TDatabase>;
|
|
132
139
|
//#endregion
|
|
133
140
|
//#region src/functions/TestFunctionAdaptor.d.ts
|
|
134
|
-
export declare class TestFunctionAdaptor<TInput extends ComposableStandardSchema | undefined = undefined, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger,
|
|
141
|
+
export declare class TestFunctionAdaptor<TInput extends ComposableStandardSchema | undefined = undefined, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TDatabase = undefined, TDatabaseServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>> {
|
|
135
142
|
private readonly fn;
|
|
136
143
|
private serviceDiscovery;
|
|
137
|
-
static getDefaultServiceDiscovery<TInput extends ComposableStandardSchema | undefined = undefined, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger,
|
|
138
|
-
constructor(fn: Function<TInput, TServices, TLogger, TOutSchema,
|
|
139
|
-
invoke(ctx: TestFunctionRequest<TInput, TServices,
|
|
144
|
+
static getDefaultServiceDiscovery<TInput extends ComposableStandardSchema | undefined = undefined, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TDatabase = undefined, TDatabaseServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>>(_fn: Function<TInput, TServices, TLogger, TOutSchema, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName, TAuditAction, any>): any;
|
|
145
|
+
constructor(fn: Function<TInput, TServices, TLogger, TOutSchema, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName, TAuditAction, any>, serviceDiscovery?: ServiceDiscovery<any>);
|
|
146
|
+
invoke(ctx: TestFunctionRequest<TInput, TServices, TDatabase, TAuditAction>): Promise<InferStandardSchema<TOutSchema>>;
|
|
140
147
|
}
|
|
141
|
-
type TestFunctionRequest<TInput extends ComposableStandardSchema | undefined = undefined, TServices extends Service[] = [],
|
|
148
|
+
type TestFunctionRequest<TInput extends ComposableStandardSchema | undefined = undefined, TServices extends Service[] = [], TDatabase = undefined, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>> = {
|
|
142
149
|
input: InferComposableStandardSchema<TInput>;
|
|
143
150
|
services: ServiceRecord<TServices>;
|
|
144
|
-
publisher?: Service<TEventPublisherServiceName, TEventPublisher>;
|
|
145
151
|
db?: TDatabase;
|
|
146
152
|
auditor?: Auditor<TAuditAction>;
|
|
147
153
|
} & InferComposableStandardSchema<{
|
|
@@ -152,40 +158,511 @@ type TestFunctionRequest<TInput extends ComposableStandardSchema | undefined = u
|
|
|
152
158
|
/**
|
|
153
159
|
* In-memory test driver for a {@link Queue} worker. Hand it a batch of messages
|
|
154
160
|
* and it registers the queue's services, runs the handler in a request context,
|
|
155
|
-
* and returns the handler result — no SQS/pg-boss required.
|
|
161
|
+
* and returns the handler result — no SQS/pg-boss required. A queue with a
|
|
162
|
+
* database gets `db` registered from it, or the one the request passes.
|
|
156
163
|
*
|
|
157
164
|
* @example
|
|
158
165
|
* const adapter = new TestQueueAdaptor(ordersQueue);
|
|
159
166
|
* await adapter.invoke({ messages: [{ orderId: '123' }] });
|
|
160
167
|
*/
|
|
161
|
-
export declare class TestQueueAdaptor<TName extends string = string, TMessage extends StandardSchemaV1 = StandardSchemaV1, TServices extends Service[] = [], TLogger extends Logger = Logger> {
|
|
168
|
+
export declare class TestQueueAdaptor<TName extends string = string, TMessage extends StandardSchemaV1 = StandardSchemaV1, TServices extends Service[] = [], TLogger extends Logger = Logger, TDatabase = undefined, TDatabaseServiceName extends string = string> {
|
|
162
169
|
private readonly queue;
|
|
163
170
|
private serviceDiscovery;
|
|
164
171
|
static getDefaultServiceDiscovery(): any;
|
|
165
|
-
constructor(queue: Queue<TName, TMessage, TServices, TLogger>, serviceDiscovery?: ServiceDiscovery<any>);
|
|
166
|
-
invoke(request: TestQueueRequest<TMessage, TServices>): Promise<unknown>;
|
|
172
|
+
constructor(queue: Queue<TName, TMessage, TServices, TLogger, TDatabase, TDatabaseServiceName>, serviceDiscovery?: ServiceDiscovery<any>);
|
|
173
|
+
invoke(request: TestQueueRequest<TMessage, TServices, TDatabase>): Promise<unknown>;
|
|
174
|
+
private getDatabase;
|
|
167
175
|
}
|
|
168
|
-
type TestQueueRequest<TMessage extends StandardSchemaV1 = StandardSchemaV1, TServices extends Service[] = []> = {
|
|
176
|
+
type TestQueueRequest<TMessage extends StandardSchemaV1 = StandardSchemaV1, TServices extends Service[] = [], TDatabase = undefined> = {
|
|
169
177
|
messages: InferStandardSchema<TMessage>[];
|
|
170
178
|
services?: ServiceRecord<TServices>;
|
|
179
|
+
/** Stands in for the queue's database — a transaction, say. */
|
|
180
|
+
db?: TDatabase;
|
|
171
181
|
};
|
|
172
182
|
//#endregion
|
|
173
183
|
//#region src/subscribers/TestSubscriberAdaptor.d.ts
|
|
174
184
|
type ExtractEventPayloads<TPublisher extends EventPublisher<any> | undefined, TEventTypes extends any[]> = TPublisher extends EventPublisher<any> ? Extract<ExtractPublisherMessage<TPublisher>, {
|
|
175
185
|
type: TEventTypes[number];
|
|
176
186
|
}> : never;
|
|
177
|
-
export declare class TestSubscriberAdaptor<TServices extends Service[] = [], TLogger extends Logger = Logger, OutSchema extends StandardSchemaV1 | undefined = undefined, TEventPublisher extends EventPublisher<any> | undefined = undefined,
|
|
187
|
+
export declare class TestSubscriberAdaptor<TServices extends Service[] = [], TLogger extends Logger = Logger, OutSchema extends StandardSchemaV1 | undefined = undefined, TEventPublisher extends EventPublisher<any> | undefined = undefined, TSubscribedEvents extends ExtractPublisherMessage<TEventPublisher>['type'][] = ExtractPublisherMessage<TEventPublisher>['type'][], TDatabase = undefined, TDatabaseServiceName extends string = string> {
|
|
178
188
|
private readonly subscriber;
|
|
179
189
|
private serviceDiscovery;
|
|
180
190
|
static getDefaultServiceDiscovery(): any;
|
|
181
|
-
constructor(subscriber: Subscriber<TServices, TLogger, OutSchema, TEventPublisher,
|
|
182
|
-
invoke(request: TestSubscriberRequest<TEventPublisher, TSubscribedEvents, TServices>): Promise<InferStandardSchema<OutSchema>>;
|
|
191
|
+
constructor(subscriber: Subscriber<TServices, TLogger, OutSchema, TEventPublisher, TSubscribedEvents, TDatabase, TDatabaseServiceName>, serviceDiscovery?: ServiceDiscovery<any>);
|
|
192
|
+
invoke(request: TestSubscriberRequest<TEventPublisher, TSubscribedEvents, TServices, TDatabase>): Promise<InferStandardSchema<OutSchema>>;
|
|
193
|
+
private getDatabase;
|
|
183
194
|
private filterEvents;
|
|
184
195
|
}
|
|
185
|
-
type TestSubscriberRequest<TEventPublisher extends EventPublisher<any> | undefined = undefined, TSubscribedEvents extends any[] = [], TServices extends Service[] = []> = {
|
|
196
|
+
type TestSubscriberRequest<TEventPublisher extends EventPublisher<any> | undefined = undefined, TSubscribedEvents extends any[] = [], TServices extends Service[] = [], TDatabase = undefined> = {
|
|
186
197
|
events: ExtractEventPayloads<TEventPublisher, TSubscribedEvents>[];
|
|
187
198
|
services?: ServiceRecord<TServices>;
|
|
199
|
+
/** Stands in for the subscriber's database — a transaction, say. */
|
|
200
|
+
db?: TDatabase;
|
|
188
201
|
};
|
|
189
202
|
//#endregion
|
|
190
|
-
|
|
203
|
+
//#region src/testing/manifest.d.ts
|
|
204
|
+
/** Where an export lives: what an import statement has to say. */
|
|
205
|
+
interface TestManifestSource {
|
|
206
|
+
/** Absolute path to the module. */
|
|
207
|
+
file: string;
|
|
208
|
+
/** The name it is exported as. */
|
|
209
|
+
export: string;
|
|
210
|
+
}
|
|
211
|
+
interface TestManifest {
|
|
212
|
+
/** The stage the environment was resolved for — `test`. */
|
|
213
|
+
stage: TestStage;
|
|
214
|
+
/** Every construct the app declares, by id. */
|
|
215
|
+
constructs: Record<string, {
|
|
216
|
+
kind: string;
|
|
217
|
+
source: TestManifestSource;
|
|
218
|
+
}>;
|
|
219
|
+
/** Every endpoint, and the surface that serves it. */
|
|
220
|
+
endpoints: {
|
|
221
|
+
surface: string;
|
|
222
|
+
source: TestManifestSource;
|
|
223
|
+
}[];
|
|
224
|
+
/**
|
|
225
|
+
* Every topic subscriber — what a topic's events are delivered to. Not a
|
|
226
|
+
* construct, so not in `constructs`: the build finds them, as it finds
|
|
227
|
+
* endpoints.
|
|
228
|
+
*/
|
|
229
|
+
subscribers?: {
|
|
230
|
+
source: TestManifestSource;
|
|
231
|
+
}[];
|
|
232
|
+
/**
|
|
233
|
+
* The test stage's environment — reconcile's output, keyed as the
|
|
234
|
+
* constructs derive their keys.
|
|
235
|
+
*/
|
|
236
|
+
env: Record<string, string>;
|
|
237
|
+
}
|
|
238
|
+
/** The environment variable `gkm test` names the manifest in. */
|
|
239
|
+
export declare const TEST_MANIFEST_ENV = "GKM_TEST_MANIFEST";
|
|
240
|
+
/**
|
|
241
|
+
* Read a test manifest: from a path, a `file:` URL, or — given nothing — the
|
|
242
|
+
* one `gkm test` named in `GKM_TEST_MANIFEST`.
|
|
243
|
+
*/
|
|
244
|
+
export declare function loadTestManifest(from?: string | URL): TestManifest;
|
|
245
|
+
/** A feature test ran without a manifest to build itself from. */
|
|
246
|
+
export declare class NoTestManifest extends Error {
|
|
247
|
+
constructor();
|
|
248
|
+
}
|
|
249
|
+
//#endregion
|
|
250
|
+
//#region src/testing/receive.d.ts
|
|
251
|
+
/** What a test hands `mailbox.receive`. */
|
|
252
|
+
type MailToReceive = ({
|
|
253
|
+
/** The envelope recipient — what routes it. Required. */
|
|
254
|
+
to: string;
|
|
255
|
+
/** The envelope sender, and `From:`. Required without `raw`. */
|
|
256
|
+
from: string;
|
|
257
|
+
raw?: undefined;
|
|
258
|
+
/** `To:` as written, when it should differ from the envelope. */
|
|
259
|
+
headerTo?: string | readonly string[];
|
|
260
|
+
cc?: string | readonly string[];
|
|
261
|
+
replyTo?: string;
|
|
262
|
+
subject?: string;
|
|
263
|
+
text?: string;
|
|
264
|
+
html?: string;
|
|
265
|
+
attachments?: readonly ComposedAttachment[];
|
|
266
|
+
headers?: Readonly<Record<string, string>>;
|
|
267
|
+
} & Judged) | ({
|
|
268
|
+
/** The envelope recipient — what routes it. Required. */
|
|
269
|
+
to: string;
|
|
270
|
+
/** A whole message, as an `.eml` holds it. */
|
|
271
|
+
raw: string | Uint8Array;
|
|
272
|
+
/** The envelope sender; `From:` in the message otherwise. */
|
|
273
|
+
from?: string;
|
|
274
|
+
} & Judged);
|
|
275
|
+
interface Judged {
|
|
276
|
+
/** What the provider judged — `'unavailable'` for any left out. */
|
|
277
|
+
verdicts?: Partial<Verdicts>;
|
|
278
|
+
}
|
|
279
|
+
/** `mailbox.receive` named no recipient. */
|
|
280
|
+
export declare class ReceiveNeedsRecipient extends Error {
|
|
281
|
+
constructor();
|
|
282
|
+
}
|
|
283
|
+
/** `mailbox.receive` was given fields and a raw message, or neither a sender nor raw. */
|
|
284
|
+
export declare class ReceiveFieldsOrRaw extends Error {
|
|
285
|
+
readonly reason: 'both' | 'no-sender';
|
|
286
|
+
constructor(reason: 'both' | 'no-sender');
|
|
287
|
+
}
|
|
288
|
+
/** No declared inbox receives at the address `mailbox.receive` was given. */
|
|
289
|
+
export declare class NoInboxForAddress extends Error {
|
|
290
|
+
readonly address: string;
|
|
291
|
+
readonly inboxes: readonly string[];
|
|
292
|
+
constructor(address: string, inboxes: readonly string[]);
|
|
293
|
+
}
|
|
294
|
+
/** An inbox the test can receive for: no Mailpit to deliver to. */
|
|
295
|
+
export declare class InboxNotLocal extends Error {
|
|
296
|
+
readonly inbox: string;
|
|
297
|
+
constructor(inbox: string);
|
|
298
|
+
}
|
|
299
|
+
//#endregion
|
|
300
|
+
//#region src/testing/featureTest.d.ts
|
|
301
|
+
/** How each database's test factory is built, keyed by its service name. */
|
|
302
|
+
type FactoryBuilders = Record<string, (db: Kysely<any>) => unknown>;
|
|
303
|
+
interface FeatureTestOptions<TBrowser extends Browser, TFactories extends FactoryBuilders = {}> {
|
|
304
|
+
/**
|
|
305
|
+
* What the app declares and the environment its test stage resolved.
|
|
306
|
+
* Defaults to the manifest `gkm test` names in `GKM_TEST_MANIFEST`.
|
|
307
|
+
*/
|
|
308
|
+
manifest?: TestManifest;
|
|
309
|
+
/**
|
|
310
|
+
* The app's modules, already imported, by the absolute path the manifest
|
|
311
|
+
* records for them. The generated harness imports them statically, from
|
|
312
|
+
* inside the app, so they resolve the way the app's own code does — its
|
|
313
|
+
* tsconfig paths included. A module not here is imported by path.
|
|
314
|
+
*/
|
|
315
|
+
modules?: Readonly<Record<string, Record<string, unknown>>>;
|
|
316
|
+
/** The browser each test gets — the generated one, with the app's clients. */
|
|
317
|
+
browser?: new (options?: BrowserOptions) => TBrowser;
|
|
318
|
+
/**
|
|
319
|
+
* Each database's test factory — `createFactory` from
|
|
320
|
+
* `test/factories/<construct>.ts`, which the generated harness imports —
|
|
321
|
+
* keyed by the database's service name. Each is called once per test with
|
|
322
|
+
* that database's transaction, so what a test inserts through it is rolled
|
|
323
|
+
* back with everything else, and seen by the endpoints it calls.
|
|
324
|
+
*/
|
|
325
|
+
factories?: TFactories;
|
|
326
|
+
/**
|
|
327
|
+
* Each external API's fake — the default export of `test/fakes/<id>.ts`,
|
|
328
|
+
* which the generated harness imports — keyed by the API's construct id.
|
|
329
|
+
* An app fake is served at the URL the test stage resolved for it.
|
|
330
|
+
*/
|
|
331
|
+
fakes?: Readonly<Record<string, Fake>>;
|
|
332
|
+
}
|
|
333
|
+
/** Each database's schema, keyed by its service name. */
|
|
334
|
+
type DatabaseSchemas = Record<string, unknown>;
|
|
335
|
+
/** Each construct's client, keyed by its service name — what `services` types. */
|
|
336
|
+
type ServiceClients = Record<string, unknown>;
|
|
337
|
+
/** The client a construct's service registers — what a handler is handed. */
|
|
338
|
+
type ClientOf<C> = C extends {
|
|
339
|
+
service: {
|
|
340
|
+
register: (...args: any[]) => infer TClient;
|
|
341
|
+
};
|
|
342
|
+
} ? Awaited<TClient> : never;
|
|
343
|
+
/**
|
|
344
|
+
* The app's services for this test, by service name — `services.get('shipping')`.
|
|
345
|
+
*
|
|
346
|
+
* What a handler that depends on the construct is handed, resolved the way the
|
|
347
|
+
* test's endpoints resolve it: an external API's client aimed at whatever the
|
|
348
|
+
* test stage resolved (its fake, which the test never sees), a topic or queue's
|
|
349
|
+
* recorder, a database's transaction for this test.
|
|
350
|
+
*/
|
|
351
|
+
interface TestServices<TServices extends ServiceClients> {
|
|
352
|
+
get<K extends keyof TServices & string>(name: K): Promise<TServices[K]>;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* The app's databases for this test, by service name — `db.get('database')`.
|
|
356
|
+
*
|
|
357
|
+
* Each is this test's transaction on that database: opened by whatever reaches
|
|
358
|
+
* it first — the test, a factory, an endpoint — and the same one for all of
|
|
359
|
+
* them, rolled back after the test.
|
|
360
|
+
*/
|
|
361
|
+
interface TestDatabases<TDatabases extends DatabaseSchemas> {
|
|
362
|
+
get<K extends keyof TDatabases & string>(name: K): Promise<Kysely<TDatabases[K]>>;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Each of the app's databases' test factory, by service name —
|
|
366
|
+
* `await factories.get('database')`. Built on first use, on that database's
|
|
367
|
+
* transaction for this test — the one `db.get` returns — and the same factory
|
|
368
|
+
* for the rest of the test.
|
|
369
|
+
*/
|
|
370
|
+
interface TestFactories<TFactories extends FactoryBuilders> {
|
|
371
|
+
get<K extends keyof TFactories & string>(name: K): Promise<ReturnType<TFactories[K]>>;
|
|
372
|
+
}
|
|
373
|
+
interface FeatureContext<TBrowser extends Browser, TDatabases extends DatabaseSchemas = {}, TFactories extends FactoryBuilders = {}, TServices extends ServiceClients = {}> {
|
|
374
|
+
/** This test's browser, already the global `fetch`. */
|
|
375
|
+
browser: TBrowser;
|
|
376
|
+
/**
|
|
377
|
+
* The app's own databases — not a tenant an auth server owns, not a
|
|
378
|
+
* reader — by service name: `await db.get('database')`. The same
|
|
379
|
+
* transaction the test's endpoints and factories use.
|
|
380
|
+
*/
|
|
381
|
+
db: TestDatabases<TDatabases>;
|
|
382
|
+
/**
|
|
383
|
+
* Each of the app's databases' test factory, by service name —
|
|
384
|
+
* `await factories.get('database')` — on the same transaction `db.get`
|
|
385
|
+
* returns.
|
|
386
|
+
*/
|
|
387
|
+
factories: TestFactories<TFactories>;
|
|
388
|
+
/**
|
|
389
|
+
* Testkit's faker — the one factories are handed — seeded from this test's
|
|
390
|
+
* name, so a failing test fails again with the same data, and so a test
|
|
391
|
+
* imports nothing to make some.
|
|
392
|
+
*/
|
|
393
|
+
faker: FakerFactory;
|
|
394
|
+
/**
|
|
395
|
+
* The mail sent to an address during this test, read from Mailpit — and,
|
|
396
|
+
* with `receive`, mail arriving at one of the app's inboxes.
|
|
397
|
+
*/
|
|
398
|
+
mailbox: FeatureMailbox;
|
|
399
|
+
/**
|
|
400
|
+
* What this test published to a topic or enqueued on a queue, in order.
|
|
401
|
+
*
|
|
402
|
+
* Also delivered: once each request the test makes has answered, a queue's
|
|
403
|
+
* messages reach its consumer and a topic's events every subscriber that
|
|
404
|
+
* named them, in this test's transaction — see {@link deliver}.
|
|
405
|
+
*/
|
|
406
|
+
published: (channel: {
|
|
407
|
+
id: string;
|
|
408
|
+
}) => PublishedMessage[];
|
|
409
|
+
/**
|
|
410
|
+
* What this test sent to a `WebSocketApi`'s sockets — through
|
|
411
|
+
* `services.<surface>` in an endpoint, a subscriber, a consumer — recorded
|
|
412
|
+
* rather than delivered: `sockets(realtime).sent`, `.broadcasts`,
|
|
413
|
+
* `.closed`. Each send is checked by the surface's declared messages, as
|
|
414
|
+
* deployed.
|
|
415
|
+
*
|
|
416
|
+
* @throws {UnknownWebSocketApi} when the manifest declares no such surface.
|
|
417
|
+
*/
|
|
418
|
+
sockets: <S extends WebSocketApi<string, any>>(surface: S) => TestWebSocketPublisher<MessagesOf<S>>;
|
|
419
|
+
/**
|
|
420
|
+
* A subscriber, run on its own — handed events rather than delivered them —
|
|
421
|
+
* with this test's services: its databases resolve to this test's
|
|
422
|
+
* transactions, as an endpoint's do.
|
|
423
|
+
*/
|
|
424
|
+
subscriber: <S extends Subscriber<any, any, any, any, any, any, any>>(subscriber: S) => SubscriberAdaptorOf<S>;
|
|
425
|
+
/**
|
|
426
|
+
* The app's services, by service name — `await services.get('shipping')` —
|
|
427
|
+
* as a handler is handed them. Assert on an external API through its own
|
|
428
|
+
* client: the fake behind it stays hidden, and the same assertion holds
|
|
429
|
+
* against the real API.
|
|
430
|
+
*/
|
|
431
|
+
services: TestServices<TServices>;
|
|
432
|
+
/** A queue's worker, run on its own with this test's services. */
|
|
433
|
+
queue: <Q extends Queue<any, any, any, any, any, any>>(queue: Q) => QueueAdaptorOf<Q>;
|
|
434
|
+
/**
|
|
435
|
+
* A bucket's objects, as its subscribers see them change.
|
|
436
|
+
*
|
|
437
|
+
* An upload or delete through the bucket's client — `services.uploads`,
|
|
438
|
+
* in a handler or in the test — is reported to the bucket's subscribers
|
|
439
|
+
* already; `emit` reports what the storage would see and the app's code
|
|
440
|
+
* never does, such as a browser uploading to a presigned URL.
|
|
441
|
+
*/
|
|
442
|
+
objects: (bucket: {
|
|
443
|
+
id: string;
|
|
444
|
+
}) => {
|
|
445
|
+
emit: (...events: EmittedObjectEvent[]) => Promise<void>;
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
/** `mailbox(address)` reads what was sent; `mailbox.receive(…)` sends to an inbox. */
|
|
449
|
+
interface FeatureMailbox {
|
|
450
|
+
(address: string): Mailbox;
|
|
451
|
+
/**
|
|
452
|
+
* Mail arriving at an inbox: delivered to Mailpit with `to` as its envelope
|
|
453
|
+
* recipient, received as `gkm dev` receives it, and handed to each inbox
|
|
454
|
+
* subscriber in this test's transaction. Resolves once they have run.
|
|
455
|
+
*
|
|
456
|
+
* @throws {NoInboxForAddress} when no declared inbox receives at `to`.
|
|
457
|
+
*/
|
|
458
|
+
receive(mail: MailToReceive): Promise<void>;
|
|
459
|
+
}
|
|
460
|
+
/** An object changing, as a test reports it: the bucket is the one emitted on. */
|
|
461
|
+
interface EmittedObjectEvent {
|
|
462
|
+
type: 'object.created' | 'object.deleted';
|
|
463
|
+
key: string;
|
|
464
|
+
size?: number;
|
|
465
|
+
etag?: string;
|
|
466
|
+
versionId?: string;
|
|
467
|
+
}
|
|
468
|
+
type SubscriberAdaptorOf<S> = S extends Subscriber<infer TServices, infer TLogger, infer OutSchema, infer TEventPublisher, infer TSubscribedEvents, infer TDatabase, infer TDatabaseServiceName> ? TestSubscriberAdaptor<TServices, TLogger, OutSchema, TEventPublisher, TSubscribedEvents, TDatabase, TDatabaseServiceName> : never;
|
|
469
|
+
type QueueAdaptorOf<Q> = Q extends Queue<infer TName, infer TMessage, infer TServices, infer TLogger, infer TDatabase, infer TDatabaseServiceName> ? TestQueueAdaptor<TName, TMessage, TServices, TLogger, TDatabase, TDatabaseServiceName> : never;
|
|
470
|
+
/** The messages a WebSocket surface declares — what its recorder is typed by. */
|
|
471
|
+
type MessagesOf<S> = S extends WebSocketApi<string, infer TMessages extends WebSocketMessages> ? TMessages : never;
|
|
472
|
+
/** The schema a database construct was declared with — what `db` is typed by. */
|
|
473
|
+
type DatabaseOf<C> = C extends KyselyDatabase<infer DB, any> ? DB : unknown;
|
|
474
|
+
/** One message as it was published: its type and its payload. */
|
|
475
|
+
interface PublishedMessage {
|
|
476
|
+
type: string;
|
|
477
|
+
payload: unknown;
|
|
478
|
+
}
|
|
479
|
+
type FeatureFn<TBrowser extends Browser, TDatabases extends DatabaseSchemas, TFactories extends FactoryBuilders, TServices extends ServiceClients> = (context: FeatureContext<TBrowser, TDatabases, TFactories, TServices>) => unknown;
|
|
480
|
+
interface FeatureIt<TBrowser extends Browser, TDatabases extends DatabaseSchemas = {}, TFactories extends FactoryBuilders = {}, TServices extends ServiceClients = {}> {
|
|
481
|
+
(name: string, fn: FeatureFn<TBrowser, TDatabases, TFactories, TServices>, timeout?: number): void;
|
|
482
|
+
only(name: string, fn: FeatureFn<TBrowser, TDatabases, TFactories, TServices>, timeout?: number): void;
|
|
483
|
+
skip(name: string, fn: FeatureFn<TBrowser, TDatabases, TFactories, TServices>, timeout?: number): void;
|
|
484
|
+
}
|
|
485
|
+
export declare function featureTest<TBrowser extends Browser = Browser, TDatabases extends DatabaseSchemas = {}, TFactories extends FactoryBuilders = {}, TServices extends ServiceClients = {}>(options?: FeatureTestOptions<TBrowser, TFactories>): FeatureIt<TBrowser, TDatabases, TFactories, TServices>;
|
|
486
|
+
/** `objects(bucket)` named a bucket no subscriber in the app is bound to. */
|
|
487
|
+
/** `sockets(surface)` for a surface the test manifest does not declare. */
|
|
488
|
+
export declare class UnknownWebSocketApi extends Error {
|
|
489
|
+
readonly surface: string;
|
|
490
|
+
readonly declared: readonly string[];
|
|
491
|
+
constructor(surface: string, declared: readonly string[]);
|
|
492
|
+
}
|
|
493
|
+
/** What `signInWithMagicLink` uses of a better-auth client. */
|
|
494
|
+
interface MagicLinkAuthClient<TSession> {
|
|
495
|
+
signIn: {
|
|
496
|
+
magicLink(input: {
|
|
497
|
+
email: string;
|
|
498
|
+
}): Promise<{
|
|
499
|
+
error?: {
|
|
500
|
+
message?: string;
|
|
501
|
+
} | null;
|
|
502
|
+
}>;
|
|
503
|
+
};
|
|
504
|
+
getSession(): Promise<{
|
|
505
|
+
data: TSession | null;
|
|
506
|
+
}>;
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Sign a test's browser in the way a person does: ask the auth server for a
|
|
510
|
+
* magic link, open the email it sent, follow the link.
|
|
511
|
+
*
|
|
512
|
+
* What the generated `browser.signIn(email)` calls. The address's mail is
|
|
513
|
+
* cleared first — so the link is this request's, not one an earlier test left
|
|
514
|
+
* — and cleared again after the test, like any address a test reads. Returns
|
|
515
|
+
* the session the auth server then reports, as better-auth hands it back.
|
|
516
|
+
*/
|
|
517
|
+
export declare function signInWithMagicLink<TSession>(browser: Browser, auth: MagicLinkAuthClient<TSession>, email?: string): Promise<TSession>;
|
|
518
|
+
/** `browser.signIn` finished without a session. */
|
|
519
|
+
export declare class SignInFailed extends Error {
|
|
520
|
+
readonly email: string;
|
|
521
|
+
readonly reason: string;
|
|
522
|
+
constructor(email: string, reason: string);
|
|
523
|
+
}
|
|
524
|
+
/** A request reached an in-process server without a test to belong to. */
|
|
525
|
+
export declare class UnknownTestContext extends Error {
|
|
526
|
+
readonly url: string;
|
|
527
|
+
readonly id: string | undefined;
|
|
528
|
+
constructor(url: string, id: string | undefined);
|
|
529
|
+
}
|
|
530
|
+
/** `mailbox` was used in an app that declares no Email construct. */
|
|
531
|
+
export declare class NoInbox extends Error {
|
|
532
|
+
constructor();
|
|
533
|
+
}
|
|
534
|
+
/** `db.get(name)` named no database the test is handed. */
|
|
535
|
+
export declare class UnknownDatabase extends Error {
|
|
536
|
+
readonly database: string;
|
|
537
|
+
readonly known: readonly string[];
|
|
538
|
+
constructor(database: string, known: readonly string[]);
|
|
539
|
+
}
|
|
540
|
+
/** A factory keyed by a service name no database the app declares has. */
|
|
541
|
+
export declare class UnknownFactory extends Error {
|
|
542
|
+
readonly factory: string;
|
|
543
|
+
readonly known: readonly string[];
|
|
544
|
+
constructor(factory: string, known: readonly string[]);
|
|
545
|
+
}
|
|
546
|
+
/** A published message the consumer's own schema refuses. */
|
|
547
|
+
export declare class MessageRejected extends Error {
|
|
548
|
+
readonly consumer: string;
|
|
549
|
+
readonly published: PublishedMessage;
|
|
550
|
+
readonly issues: ReadonlyArray<StandardSchemaV1.Issue>;
|
|
551
|
+
constructor(consumer: string, published: PublishedMessage, issues: ReadonlyArray<StandardSchemaV1.Issue>);
|
|
552
|
+
}
|
|
553
|
+
/** A consumer that threw while handling what the test published. */
|
|
554
|
+
export declare class DeliveryFailed extends Error {
|
|
555
|
+
readonly consumer: string;
|
|
556
|
+
readonly messages: readonly PublishedMessage[];
|
|
557
|
+
readonly cause: unknown;
|
|
558
|
+
constructor(consumer: string, messages: readonly PublishedMessage[], cause: unknown);
|
|
559
|
+
}
|
|
560
|
+
/** Consumers that kept publishing to each other without settling. */
|
|
561
|
+
export declare class DeliveryDidNotSettle extends Error {
|
|
562
|
+
readonly rounds: number;
|
|
563
|
+
readonly channels: readonly string[];
|
|
564
|
+
constructor(rounds: number, channels: readonly string[]);
|
|
565
|
+
}
|
|
566
|
+
/** `services.get(name)` for a name no construct of the app is served by. */
|
|
567
|
+
export declare class UnknownService extends Error {
|
|
568
|
+
readonly serviceName: string;
|
|
569
|
+
readonly available: readonly string[];
|
|
570
|
+
constructor(serviceName: string, available: readonly string[]);
|
|
571
|
+
}
|
|
572
|
+
//#endregion
|
|
573
|
+
//#region src/testing/peer.d.ts
|
|
574
|
+
/**
|
|
575
|
+
* The TCP peer a test's in-process requests arrive from.
|
|
576
|
+
*
|
|
577
|
+
* A feature test hands a request straight to a surface's Hono app — no
|
|
578
|
+
* socket, no server — so the app's bindings have no peer to read. Deployed,
|
|
579
|
+
* every request has one, and what a surface trusts follows from it: the auth
|
|
580
|
+
* server honours `x-gkm-client-ip` only from an internal caller, a loopback
|
|
581
|
+
* or private peer with no `Origin` and no forwarding header. With no peer at
|
|
582
|
+
* all the header was dropped, and every test's session check became the same
|
|
583
|
+
* client to Better Auth's rate limiter.
|
|
584
|
+
*
|
|
585
|
+
* So an in-process dispatch says where it came from, the way
|
|
586
|
+
* `@hono/node-server` does: its bindings carry `incoming.socket.remoteAddress`.
|
|
587
|
+
* The address is loopback because that is the truth — the request came from
|
|
588
|
+
* this process. A browser's own address still travels in its
|
|
589
|
+
* `x-forwarded-for`, which makes it outside traffic exactly as it would be
|
|
590
|
+
* behind the stack's proxy.
|
|
591
|
+
*
|
|
592
|
+
* Only a test's dispatch passes these. A runtime with no socket of its own
|
|
593
|
+
* (Lambda, Bun) still has no peer, and a request with no peer is still not an
|
|
594
|
+
* internal caller's.
|
|
595
|
+
*/
|
|
596
|
+
/** The address an in-process request presents as its peer. */
|
|
597
|
+
export declare const IN_PROCESS_PEER_ADDRESS = "127.0.0.1";
|
|
598
|
+
/** The part of `@hono/node-server`'s bindings a surface reads its peer from. */
|
|
599
|
+
interface InProcessBindings {
|
|
600
|
+
incoming: {
|
|
601
|
+
socket: {
|
|
602
|
+
remoteAddress: string;
|
|
603
|
+
};
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
/** Bindings for `app.fetch(request, bindings)` from inside this process. */
|
|
607
|
+
export declare function inProcessBindings(): InProcessBindings;
|
|
608
|
+
//#endregion
|
|
609
|
+
//#region src/websocket/msw.d.ts
|
|
610
|
+
/**
|
|
611
|
+
* The query parameter that names a connection's test context. Read and
|
|
612
|
+
* removed before `connect()` sees `query`, so the handler never does.
|
|
613
|
+
*/
|
|
614
|
+
export declare const TEST_CONTEXT_PARAM = "__gkm_test_context";
|
|
615
|
+
/**
|
|
616
|
+
* The close code a refused connection gets: `4000 + status`, so a 401 is
|
|
617
|
+
* 4401. MSW cannot answer an upgrade with a status line, as a server does.
|
|
618
|
+
*/
|
|
619
|
+
export declare const REFUSED_CLOSE_BASE = 4000;
|
|
620
|
+
/** What one test's connections run with. */
|
|
621
|
+
interface MswWebSocketContext {
|
|
622
|
+
/** Instances for the routes' dependencies — the test's transaction. */
|
|
623
|
+
services?: Record<string, unknown>;
|
|
624
|
+
/** Whose connection it is, as `.auth()` would have resolved it. */
|
|
625
|
+
session?: unknown;
|
|
626
|
+
}
|
|
627
|
+
interface CreateMswWebSocketHandlersOptions {
|
|
628
|
+
/** The URL the client opens — what `ws.link()` matches. */
|
|
629
|
+
url: string | RegExp;
|
|
630
|
+
/** What unregistered services are registered with. Default the surface's. */
|
|
631
|
+
envParser?: EnvironmentParser<{}>;
|
|
632
|
+
/**
|
|
633
|
+
* The `memory://` channel sends reach the connections on. Default one of
|
|
634
|
+
* its own, so two adaptors in one process never share sockets.
|
|
635
|
+
*/
|
|
636
|
+
channel?: string;
|
|
637
|
+
}
|
|
638
|
+
interface MswWebSocketHandlers<TMessages extends WebSocketMessages = NoMessages> {
|
|
639
|
+
/** For `setupServer(...)` or `server.use(...)`. */
|
|
640
|
+
handlers: WebSocketHandler[];
|
|
641
|
+
/** Give a test's connections their services and session. */
|
|
642
|
+
registerContext(id: string, context: MswWebSocketContext): void;
|
|
643
|
+
removeContext(id: string): void;
|
|
644
|
+
/**
|
|
645
|
+
* A publisher whose sends reach these connections — hand it to an
|
|
646
|
+
* endpoint as `services.<surface>`.
|
|
647
|
+
*/
|
|
648
|
+
publisher: WebSocketPublisher<TMessages>;
|
|
649
|
+
/**
|
|
650
|
+
* The same channel as a connection string — what
|
|
651
|
+
* `<ID>_PUBLISHER_CONNECTION_STRING` would be for `services.<surface>` to
|
|
652
|
+
* register onto it.
|
|
653
|
+
*/
|
|
654
|
+
connectionString: string;
|
|
655
|
+
/** Every connection open now, in the order they opened. */
|
|
656
|
+
readonly connections: readonly Connection[];
|
|
657
|
+
/** Stop receiving sends on the channel. */
|
|
658
|
+
close(): Promise<void>;
|
|
659
|
+
}
|
|
660
|
+
/** A connection whose query names a context no test registered. */
|
|
661
|
+
export declare class UnknownWebSocketTestContext extends Error {
|
|
662
|
+
readonly id: string;
|
|
663
|
+
constructor(id: string);
|
|
664
|
+
}
|
|
665
|
+
export declare function createMswWebSocketHandlers<TMessages extends WebSocketMessages = NoMessages>(surface: WebSocketApi<string, TMessages>, modules: readonly object[], options: CreateMswWebSocketHandlersOptions): MswWebSocketHandlers<TMessages>;
|
|
666
|
+
//#endregion
|
|
667
|
+
export { type ClientOf, type CreateMswHandlersOptions, type CreateMswHandlersResult, type CreateMswWebSocketHandlersOptions, type DatabaseOf, type DatabaseSchemas, type FactoryBuilders, type FeatureContext, type FeatureIt, type FeatureMailbox, type FeatureTestOptions, type InProcessBindings, InvalidWebSocketRequest, type MagicLinkAuthClient, type MailToReceive, type MswWebSocketContext, type MswWebSocketHandlers, type RecordedBroadcast, type RecordedClose, type RecordedSend, type RegisterContextOptions, type ServiceClients, TEST_CONTEXT_HEADER, type TestDatabases, type TestFactories, type TestManifest, type TestManifestSource, type TestServices, TestWebSocketPublisher };
|
|
191
668
|
//# sourceMappingURL=testing.d.mts.map
|