@geekmidas/constructs 10.0.0-alpha.14 → 10.0.0-alpha.140
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 +222 -158
- package/dist/Construct-127M7yrl.d.cts +231 -0
- package/dist/Construct-127M7yrl.d.cts.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/Construct-DySlwh8o.d.mts +231 -0
- package/dist/Construct-DySlwh8o.d.mts.map +1 -0
- package/dist/{Cron-DKqnnTdH.d.cts → Cron-CFkpEys6.d.cts} +14 -7
- package/dist/Cron-CFkpEys6.d.cts.map +1 -0
- package/dist/{Cron-SyqS5oWJ.d.mts → Cron-CQoDSu-n.d.mts} +14 -7
- package/dist/Cron-CQoDSu-n.d.mts.map +1 -0
- package/dist/CronBuilder-1W-G_i15.d.mts +47 -0
- package/dist/CronBuilder-1W-G_i15.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-BdnI6lxF.cjs → CronBuilder-B_NSP-Y5.cjs} +27 -10
- package/dist/CronBuilder-B_NSP-Y5.cjs.map +1 -0
- package/dist/CronBuilder-OaCRRFVk.d.cts +47 -0
- package/dist/CronBuilder-OaCRRFVk.d.cts.map +1 -0
- package/dist/{Endpoint-C6yyHpRS.d.cts → Endpoint-BEh-jW-f.d.cts} +122 -41
- package/dist/Endpoint-BEh-jW-f.d.cts.map +1 -0
- package/dist/Endpoint-BcUorcBa.cjs +576 -0
- package/dist/Endpoint-BcUorcBa.cjs.map +1 -0
- package/dist/Endpoint-BgvG36NO.mjs +547 -0
- package/dist/Endpoint-BgvG36NO.mjs.map +1 -0
- package/dist/{Endpoint-DuT4TEEq.d.mts → Endpoint-DTXDggNl.d.mts} +124 -43
- package/dist/Endpoint-DTXDggNl.d.mts.map +1 -0
- package/dist/{index-BPSZ_Lp_.d.cts → EndpointFactory-B2dCS9dy.d.cts} +187 -104
- package/dist/EndpointFactory-B2dCS9dy.d.cts.map +1 -0
- package/dist/{EndpointFactory-Bm3aKRdV.mjs → EndpointFactory-C1NlpCAS.mjs} +269 -53
- package/dist/EndpointFactory-C1NlpCAS.mjs.map +1 -0
- package/dist/{index-BoZ-iisU.d.mts → EndpointFactory-D2HXcUrJ.d.mts} +188 -105
- package/dist/EndpointFactory-D2HXcUrJ.d.mts.map +1 -0
- package/dist/{EndpointFactory-CLvWuHyt.cjs → EndpointFactory-gqmIRVWg.cjs} +309 -51
- package/dist/EndpointFactory-gqmIRVWg.cjs.map +1 -0
- package/dist/Function-BIEsY0Hm.d.cts +76 -0
- package/dist/Function-BIEsY0Hm.d.cts.map +1 -0
- package/dist/Function-DfMzTGS4.d.mts +76 -0
- package/dist/Function-DfMzTGS4.d.mts.map +1 -0
- package/dist/{HonoEndpointAdaptor-92zavCsV.cjs → HonoEndpointAdaptor-BJlj20fQ.cjs} +79 -31
- package/dist/HonoEndpointAdaptor-BJlj20fQ.cjs.map +1 -0
- package/dist/{HonoEndpointAdaptor-yYaU7jVJ.mjs → HonoEndpointAdaptor-BlbkUDNo.mjs} +76 -28
- package/dist/HonoEndpointAdaptor-BlbkUDNo.mjs.map +1 -0
- package/dist/ObjectSubscriberBuilder-BuuaYcrm.d.cts +129 -0
- package/dist/ObjectSubscriberBuilder-BuuaYcrm.d.cts.map +1 -0
- package/dist/ObjectSubscriberBuilder-CzgYmOUH.d.mts +129 -0
- package/dist/ObjectSubscriberBuilder-CzgYmOUH.d.mts.map +1 -0
- package/dist/ProcessorBuilder-B2_stA8f.d.mts +216 -0
- package/dist/ProcessorBuilder-B2_stA8f.d.mts.map +1 -0
- package/dist/ProcessorBuilder-C62bIOwj.d.cts +216 -0
- package/dist/ProcessorBuilder-C62bIOwj.d.cts.map +1 -0
- package/dist/{Queue-D9X6OoON.d.mts → Queue-BnK3UH8r.d.mts} +42 -41
- package/dist/Queue-BnK3UH8r.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-D4Iaidrs.cjs +109 -0
- package/dist/Queue-D4Iaidrs.cjs.map +1 -0
- package/dist/Queue-u8w8_HpE.mjs +104 -0
- package/dist/Queue-u8w8_HpE.mjs.map +1 -0
- package/dist/QueueBuilder-2wP5lEC8.mjs +118 -0
- package/dist/QueueBuilder-2wP5lEC8.mjs.map +1 -0
- package/dist/QueueBuilder-B3vL1ED2.d.mts +75 -0
- package/dist/QueueBuilder-B3vL1ED2.d.mts.map +1 -0
- package/dist/QueueBuilder-BcPBQSSX.d.cts +75 -0
- package/dist/QueueBuilder-BcPBQSSX.d.cts.map +1 -0
- package/dist/QueueBuilder-BxsZ9o5z.cjs +135 -0
- package/dist/QueueBuilder-BxsZ9o5z.cjs.map +1 -0
- package/dist/Subscriber-5rCX1Nph.d.cts +83 -0
- package/dist/Subscriber-5rCX1Nph.d.cts.map +1 -0
- package/dist/Subscriber-CW_Dl-YR.d.mts +83 -0
- package/dist/Subscriber-CW_Dl-YR.d.mts.map +1 -0
- package/dist/SubscriberBuilder-BL_GTcwh.mjs +237 -0
- package/dist/SubscriberBuilder-BL_GTcwh.mjs.map +1 -0
- package/dist/SubscriberBuilder-CWzKwX1p.cjs +260 -0
- package/dist/SubscriberBuilder-CWzKwX1p.cjs.map +1 -0
- package/dist/Topic-DN2gYJ-p.mjs +99 -0
- package/dist/Topic-DN2gYJ-p.mjs.map +1 -0
- package/dist/Topic-Dp9Q7Lj2.cjs +104 -0
- package/dist/Topic-Dp9Q7Lj2.cjs.map +1 -0
- package/dist/adaptors/aws.cjs +134 -160
- 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 +130 -157
- package/dist/adaptors/aws.mjs.map +1 -1
- package/dist/adaptors/hono.cjs +1 -1
- package/dist/adaptors/hono.d.cts +5 -6
- package/dist/adaptors/hono.d.cts.map +1 -1
- package/dist/adaptors/hono.d.mts +6 -7
- package/dist/adaptors/hono.d.mts.map +1 -1
- package/dist/adaptors/hono.mjs +1 -1
- package/dist/adaptors/testing.cjs +955 -38
- package/dist/adaptors/testing.cjs.map +1 -1
- package/dist/adaptors/testing.d.cts +437 -39
- package/dist/adaptors/testing.d.cts.map +1 -1
- package/dist/adaptors/testing.d.mts +436 -38
- package/dist/adaptors/testing.d.mts.map +1 -1
- package/dist/adaptors/testing.mjs +929 -34
- package/dist/adaptors/testing.mjs.map +1 -1
- package/dist/auth-BMCJN30Y.d.cts +268 -0
- package/dist/auth-BMCJN30Y.d.cts.map +1 -0
- package/dist/auth-D_0788uW.d.mts +268 -0
- package/dist/auth-D_0788uW.d.mts.map +1 -0
- package/dist/auth.cjs +290 -46
- 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 +286 -48
- package/dist/auth.mjs.map +1 -1
- package/dist/cache-5QZzh5Er.d.mts +44 -0
- package/dist/cache-5QZzh5Er.d.mts.map +1 -0
- package/dist/cache-DnGDGly3.d.cts +44 -0
- package/dist/cache-DnGDGly3.d.cts.map +1 -0
- package/dist/cache.d.cts +2 -43
- package/dist/cache.d.mts +2 -43
- 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-B1AfqRl4.d.cts} +42 -8
- package/dist/construct-interface-B1AfqRl4.d.cts.map +1 -0
- package/dist/{construct-interface-DgXTJcOD.d.cts → construct-interface-ZvYQbivO.d.mts} +42 -8
- package/dist/construct-interface-ZvYQbivO.d.mts.map +1 -0
- package/dist/construct-interface.cjs +30 -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 +30 -5
- package/dist/construct-interface.mjs.map +1 -1
- package/dist/credential-DYymbp_7.cjs +257 -0
- package/dist/credential-DYymbp_7.cjs.map +1 -0
- package/dist/credential-DfSAOOdY.mjs +222 -0
- package/dist/credential-DfSAOOdY.mjs.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 +126 -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 +125 -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.d.cts +1 -1
- package/dist/email.d.cts.map +1 -1
- package/dist/email.d.mts +2 -2
- package/dist/email.d.mts.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/expire-CieftS01.cjs +67 -0
- package/dist/expire-CieftS01.cjs.map +1 -0
- package/dist/expire-CpzUAfr9.mjs +50 -0
- package/dist/expire-CpzUAfr9.mjs.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-BUgcX2Dk.d.cts +201 -0
- package/dist/fake-BUgcX2Dk.d.cts.map +1 -0
- package/dist/fake-D472nkKb.d.mts +201 -0
- package/dist/fake-D472nkKb.d.mts.map +1 -0
- package/dist/file-server.cjs +123 -30
- package/dist/file-server.cjs.map +1 -1
- package/dist/file-server.d.cts +115 -1
- package/dist/file-server.d.cts.map +1 -1
- package/dist/file-server.d.mts +115 -1
- package/dist/file-server.d.mts.map +1 -1
- package/dist/file-server.mjs +122 -32
- 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-DZdICa8F.d.mts +195 -0
- package/dist/inbox-DZdICa8F.d.mts.map +1 -0
- package/dist/inbox-DqaxrpEk.d.cts +195 -0
- package/dist/inbox-DqaxrpEk.d.cts.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-BtzMzhMA.d.cts +115 -0
- package/dist/index-BtzMzhMA.d.cts.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-DuriFjYD.d.mts +115 -0
- package/dist/index-DuriFjYD.d.mts.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-BHYV-WC-.d.cts +216 -0
- package/dist/kysely-BHYV-WC-.d.cts.map +1 -0
- package/dist/kysely-CAW3QSqp.d.mts +216 -0
- package/dist/kysely-CAW3QSqp.d.mts.map +1 -0
- package/dist/kysely-Cs4uPO8k.mjs +371 -0
- package/dist/kysely-Cs4uPO8k.mjs.map +1 -0
- package/dist/kysely-CukArHJ0.cjs +384 -0
- package/dist/kysely-CukArHJ0.cjs.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 +74 -0
- package/dist/mobile-app.cjs.map +1 -0
- package/dist/mobile-app.d.cts +73 -0
- package/dist/mobile-app.d.cts.map +1 -0
- package/dist/mobile-app.d.mts +73 -0
- package/dist/mobile-app.d.mts.map +1 -0
- package/dist/mobile-app.mjs +73 -0
- package/dist/mobile-app.mjs.map +1 -0
- package/dist/object-storage.cjs +8 -1
- package/dist/object-storage.cjs.map +1 -1
- package/dist/object-storage.d.cts +10 -1
- package/dist/object-storage.d.cts.map +1 -1
- package/dist/object-storage.d.mts +10 -1
- package/dist/object-storage.d.mts.map +1 -1
- package/dist/object-storage.mjs +7 -2
- package/dist/object-storage.mjs.map +1 -1
- 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/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/{lazyAccessors-BHtcqgz2.mjs → readRequestBody-BTIl3k-D.mjs} +99 -39
- package/dist/readRequestBody-BTIl3k-D.mjs.map +1 -0
- package/dist/{lazyAccessors-Dx9NLwJZ.cjs → readRequestBody-Dej_L3c4.cjs} +118 -46
- package/dist/readRequestBody-Dej_L3c4.cjs.map +1 -0
- package/dist/requestLogger-BZcXwdBs.cjs +207 -0
- package/dist/requestLogger-BZcXwdBs.cjs.map +1 -0
- package/dist/requestLogger-pA4gi3E1.mjs +178 -0
- package/dist/requestLogger-pA4gi3E1.mjs.map +1 -0
- package/dist/rest-api.cjs +74 -70
- package/dist/rest-api.cjs.map +1 -1
- package/dist/rest-api.d.cts +69 -58
- package/dist/rest-api.d.cts.map +1 -1
- package/dist/rest-api.d.mts +69 -58
- package/dist/rest-api.d.mts.map +1 -1
- package/dist/rest-api.mjs +74 -70
- package/dist/rest-api.mjs.map +1 -1
- package/dist/runSubscriber-CC_2C9F2.cjs +133 -0
- package/dist/runSubscriber-CC_2C9F2.cjs.map +1 -0
- package/dist/runSubscriber-DyHWp_Lf.mjs +116 -0
- package/dist/runSubscriber-DyHWp_Lf.mjs.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 +64 -4
- package/dist/site.cjs.map +1 -1
- package/dist/site.d.cts +90 -1
- package/dist/site.d.cts.map +1 -1
- package/dist/site.d.mts +90 -1
- package/dist/site.d.mts.map +1 -1
- package/dist/site.mjs +62 -6
- 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-B48RLjyk.d.cts +40 -0
- package/dist/telemetry-B48RLjyk.d.cts.map +1 -0
- package/dist/telemetry-BEoBn6GO.d.mts +40 -0
- package/dist/telemetry-BEoBn6GO.d.mts.map +1 -0
- package/dist/telemetry.cjs +56 -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 +55 -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.cjs +762 -0
- package/dist/websocket-api.cjs.map +1 -0
- package/dist/websocket-api.d.cts +443 -0
- package/dist/websocket-api.d.cts.map +1 -0
- package/dist/websocket-api.d.mts +443 -0
- package/dist/websocket-api.d.mts.map +1 -0
- package/dist/websocket-api.mjs +748 -0
- package/dist/websocket-api.mjs.map +1 -0
- package/dist/worker.cjs +140 -32
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.d.cts +139 -47
- package/dist/worker.d.cts.map +1 -1
- package/dist/worker.d.mts +139 -47
- package/dist/worker.d.mts.map +1 -1
- package/dist/worker.mjs +141 -33
- package/dist/worker.mjs.map +1 -1
- package/package.json +155 -44
- 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-DKqnnTdH.d.cts.map +0 -1
- package/dist/Cron-SyqS5oWJ.d.mts.map +0 -1
- package/dist/CronBuilder-BdnI6lxF.cjs.map +0 -1
- package/dist/CronBuilder-CRGnDfTq.d.mts +0 -41
- package/dist/CronBuilder-CRGnDfTq.d.mts.map +0 -1
- package/dist/CronBuilder-D_0HNBTr.mjs.map +0 -1
- package/dist/CronBuilder-Df1q9PNy.d.cts +0 -41
- package/dist/CronBuilder-Df1q9PNy.d.cts.map +0 -1
- package/dist/Endpoint-BpZHtJ2W.cjs +0 -1689
- package/dist/Endpoint-BpZHtJ2W.cjs.map +0 -1
- package/dist/Endpoint-C6yyHpRS.d.cts.map +0 -1
- package/dist/Endpoint-DuT4TEEq.d.mts.map +0 -1
- package/dist/Endpoint-ONsly_dq.mjs +0 -1671
- package/dist/Endpoint-ONsly_dq.mjs.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-BPSZ_Lp_.d.cts.map +0 -1
- package/dist/index-BoZ-iisU.d.mts.map +0 -1
- package/dist/index-CdaU--_B.d.cts +0 -165
- package/dist/index-CdaU--_B.d.cts.map +0 -1
- package/dist/index-DMCDvnsM.d.mts +0 -26
- package/dist/index-DMCDvnsM.d.mts.map +0 -1
- package/dist/index-PQRWOQj4.d.mts +0 -165
- package/dist/index-PQRWOQj4.d.mts.map +0 -1
- package/dist/lazyAccessors-BHtcqgz2.mjs.map +0 -1
- package/dist/lazyAccessors-Dx9NLwJZ.cjs.map +0 -1
- package/dist/processAudits-BpRlPQMW.mjs +0 -77
- package/dist/processAudits-BpRlPQMW.mjs.map +0 -1
- package/dist/processAudits-D_2W5x8k.cjs +0 -88
- 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
package/dist/worker.mjs
CHANGED
|
@@ -1,10 +1,61 @@
|
|
|
1
1
|
import { edgeTo } from "./construct-interface.mjs";
|
|
2
|
-
import { t as FunctionBuilder } from "./functions-
|
|
2
|
+
import { t as FunctionBuilder } from "./functions-BvIDQKAA.mjs";
|
|
3
3
|
import { n as envParserFor } from "./surfaceEnv-wMT5QzgZ.mjs";
|
|
4
|
-
import { t as CronBuilder } from "./CronBuilder-
|
|
5
|
-
import { t as
|
|
6
|
-
import {
|
|
4
|
+
import { t as CronBuilder } from "./CronBuilder-BJ5LoadF.mjs";
|
|
5
|
+
import { t as QueueBuilder } from "./QueueBuilder-2wP5lEC8.mjs";
|
|
6
|
+
import { r as ObjectSubscriberBuilder, t as SubscriberBuilder } from "./SubscriberBuilder-BL_GTcwh.mjs";
|
|
7
|
+
import { INBOX_EVENT, canonicalId, serviceKey } from "@geekmidas/manifest";
|
|
7
8
|
import { DEFAULT_LOGGER } from "@geekmidas/logger/console";
|
|
9
|
+
//#region src/subscribers/InboxSubscriberBuilder.ts
|
|
10
|
+
var InboxSubscriberBuilder = class InboxSubscriberBuilder {
|
|
11
|
+
inner;
|
|
12
|
+
inbox;
|
|
13
|
+
constructor(inner, inbox) {
|
|
14
|
+
this.inner = inner;
|
|
15
|
+
this.inbox = inbox;
|
|
16
|
+
}
|
|
17
|
+
dependsOn(constructs) {
|
|
18
|
+
return this.with(this.inner.dependsOn(constructs));
|
|
19
|
+
}
|
|
20
|
+
services(services) {
|
|
21
|
+
return this.with(this.inner.services(services));
|
|
22
|
+
}
|
|
23
|
+
database(source) {
|
|
24
|
+
return this.with(this.inner.database(source));
|
|
25
|
+
}
|
|
26
|
+
timeout(timeout) {
|
|
27
|
+
return this.with(this.inner.timeout(timeout));
|
|
28
|
+
}
|
|
29
|
+
output(schema) {
|
|
30
|
+
return this.with(this.inner.output(schema));
|
|
31
|
+
}
|
|
32
|
+
logger(logger) {
|
|
33
|
+
return this.with(this.inner.logger(logger));
|
|
34
|
+
}
|
|
35
|
+
handle(fn) {
|
|
36
|
+
const key = serviceKey(this.inbox.id);
|
|
37
|
+
const handler = async (ctx) => {
|
|
38
|
+
const inbox = ctx.services[key];
|
|
39
|
+
const notifications = ctx.events.filter((event) => event?.type === INBOX_EVENT);
|
|
40
|
+
const messages = [];
|
|
41
|
+
for (const { payload } of notifications) messages.push(...await inbox.messages(payload));
|
|
42
|
+
if (messages.length === 0) return void 0;
|
|
43
|
+
return fn({
|
|
44
|
+
...ctx,
|
|
45
|
+
messages,
|
|
46
|
+
inbox
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
const subscriber = this.inner.subscribe([INBOX_EVENT]).handle(handler);
|
|
50
|
+
subscriber.inboxName = this.inbox.id;
|
|
51
|
+
subscriber.inboxAddressing = this.inbox.addressing;
|
|
52
|
+
return subscriber;
|
|
53
|
+
}
|
|
54
|
+
with(inner) {
|
|
55
|
+
return new InboxSubscriberBuilder(inner, this.inbox);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
//#endregion
|
|
8
59
|
//#region src/worker.ts
|
|
9
60
|
var Worker = class Worker {
|
|
10
61
|
config;
|
|
@@ -16,7 +67,8 @@ var Worker = class Worker {
|
|
|
16
67
|
envParser;
|
|
17
68
|
/**
|
|
18
69
|
* Where this worker's schedules live, when it has crons and a server runs
|
|
19
|
-
* them
|
|
70
|
+
* them — and the database everything built from it receives as `db`.
|
|
71
|
+
* `undefined` until `.database(…)` says.
|
|
20
72
|
*/
|
|
21
73
|
scheduleStore;
|
|
22
74
|
constructor(id, config = {}, dependencies = [], scheduleStore) {
|
|
@@ -32,7 +84,10 @@ var Worker = class Worker {
|
|
|
32
84
|
this.scheduleStore = scheduleStore;
|
|
33
85
|
}
|
|
34
86
|
/**
|
|
35
|
-
* The database this worker keeps its schedules in
|
|
87
|
+
* The database this worker keeps its schedules in, and the one everything
|
|
88
|
+
* built from it — crons, queues, subscribers, functions — receives as `db`.
|
|
89
|
+
* One of them that works against another database names it with its own
|
|
90
|
+
* `.database(other)`, which replaces this one for that runnable alone.
|
|
36
91
|
*
|
|
37
92
|
* Only a server target uses it. On AWS a cron is an EventBridge rule
|
|
38
93
|
* invoking a Lambda and nothing here is consulted — but a server has nothing
|
|
@@ -49,6 +104,10 @@ var Worker = class Worker {
|
|
|
49
104
|
* @example
|
|
50
105
|
* ```ts
|
|
51
106
|
* export const jobs = new Worker('Jobs', { logger }).database(database);
|
|
107
|
+
*
|
|
108
|
+
* export const sweep = jobs
|
|
109
|
+
* .cron('rate(1 hour)')
|
|
110
|
+
* .handle(async ({ db }) => db.deleteFrom('sessions').execute());
|
|
52
111
|
* ```
|
|
53
112
|
*/
|
|
54
113
|
database(source) {
|
|
@@ -63,12 +122,72 @@ var Worker = class Worker {
|
|
|
63
122
|
return this.own(new CronBuilder().logger(this.logger)).schedule(schedule);
|
|
64
123
|
}
|
|
65
124
|
/**
|
|
125
|
+
* A queue and its one consumer, run by this worker.
|
|
126
|
+
*
|
|
127
|
+
* One construct, because a queue has exactly one consumer: nothing else can
|
|
128
|
+
* attach a second, or forget to attach the first. Producers send to it by
|
|
129
|
+
* depending on it — `.dependsOn([emails])` makes `services.emails` the
|
|
130
|
+
* publisher.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```ts
|
|
134
|
+
* export const emails = worker
|
|
135
|
+
* .queue('Emails')
|
|
136
|
+
* .message(z.object({ userId: z.uuid(), template: z.string() }))
|
|
137
|
+
* .handle(async ({ messages, services }) => { … });
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
queue(name) {
|
|
141
|
+
return this.own(new QueueBuilder().logger(this.logger)).queue(name);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* A runnable that reacts to a bucket's objects changing.
|
|
145
|
+
*
|
|
146
|
+
* A bucket is a topic whose publisher is the storage: the binding is the
|
|
147
|
+
* same as {@link Worker.topic}'s, and so is everything after it — the
|
|
148
|
+
* services, the database, how it is delivered. The handler is handed the
|
|
149
|
+
* objects; reading one still means depending on the bucket,
|
|
150
|
+
* `.dependsOn([uploads])`.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```ts
|
|
154
|
+
* export const onAvatar = worker
|
|
155
|
+
* .objects(uploads)
|
|
156
|
+
* .on(['object.created'], { prefix: 'avatars/', suffix: '.png' })
|
|
157
|
+
* .handle(async ({ objects }) => { … });
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
objects(bucket) {
|
|
161
|
+
const inner = this.own(new SubscriberBuilder().logger(this.logger));
|
|
162
|
+
return new ObjectSubscriberBuilder(inner, bucket.id);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* A runnable handed the mail an {@link Inbox} receives.
|
|
166
|
+
*
|
|
167
|
+
* Bound, as a topic subscriber is: the inbox's topic is what it consumes,
|
|
168
|
+
* and what it is handed is the messages on it, parsed — one per envelope
|
|
169
|
+
* recipient the inbox receives at. It reads its inbox's raw messages
|
|
170
|
+
* without depending on it; anything else it uses it names, as ever.
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```ts
|
|
174
|
+
* export const onRequest = worker
|
|
175
|
+
* .inbox(requests)
|
|
176
|
+
* .handle(async ({ messages, db }) => {
|
|
177
|
+
* for (const message of messages) message.recipient.subdomain;
|
|
178
|
+
* });
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
inbox(inbox) {
|
|
182
|
+
return new InboxSubscriberBuilder(this.own(new SubscriberBuilder().logger(this.logger)).topic(inbox.topic).dependsOn([inbox]), inbox);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
66
185
|
* A runnable that consumes a topic.
|
|
67
186
|
*
|
|
68
187
|
* Binding is not publishing: a consumer is handed the topic's event types
|
|
69
|
-
* and no connection string it could publish with.
|
|
70
|
-
*
|
|
71
|
-
* one.
|
|
188
|
+
* and no connection string it could publish with. A handler that emits
|
|
189
|
+
* follow-up events depends on the topic it emits to —
|
|
190
|
+
* `.dependsOn([orders])` — which is the only reason it would need one.
|
|
72
191
|
*
|
|
73
192
|
* @example `worker.topic(users).subscribe(['user.created']).handle(…)`
|
|
74
193
|
*/
|
|
@@ -76,17 +195,6 @@ var Worker = class Worker {
|
|
|
76
195
|
return this.own(new SubscriberBuilder().logger(this.logger)).topic(topic);
|
|
77
196
|
}
|
|
78
197
|
/**
|
|
79
|
-
* A runnable that consumes events typed from a publisher service.
|
|
80
|
-
*
|
|
81
|
-
* The older of the two ways to bind a subscriber, kept for a project whose
|
|
82
|
-
* events come from a hand-written publisher rather than a `Topic`
|
|
83
|
-
* construct. `topic()` is the one to reach for: it types the events the same
|
|
84
|
-
* way and hands the consumer no connection string it could publish with.
|
|
85
|
-
*/
|
|
86
|
-
publisher(service) {
|
|
87
|
-
return this.own(new SubscriberBuilder().logger(this.logger)).publisher(service);
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
198
|
* Everything below builds a function — the runnable with no schedule and no
|
|
91
199
|
* topic, invoked by something else.
|
|
92
200
|
*
|
|
@@ -132,28 +240,28 @@ var Worker = class Worker {
|
|
|
132
240
|
return this.own(new FunctionBuilder().logger(this.logger));
|
|
133
241
|
}
|
|
134
242
|
/**
|
|
135
|
-
* Resources and surfaces this worker calls.
|
|
136
|
-
*
|
|
137
|
-
* Not `.dependsOn()`: this records the edge that derives the worker's
|
|
138
|
-
* environment and its access, the same distinction `RestApi.calls()` draws.
|
|
139
|
-
*/
|
|
140
|
-
calls(constructs) {
|
|
141
|
-
return new Worker(this.id, this.config, [...this.dependencies, ...constructs.map(edgeTo)], this.scheduleStore);
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
243
|
* Stamps this worker's id onto a builder, so everything built from it says
|
|
145
|
-
* which process runs it.
|
|
244
|
+
* which process runs it — and hands it the worker's database.
|
|
245
|
+
*
|
|
246
|
+
* The database goes through the builder's own `.database()` rather than
|
|
247
|
+
* being written into its fields, so the default is recorded exactly as an
|
|
248
|
+
* explicit one would be: the client the handler gets, and the edge the
|
|
249
|
+
* manifest reads. That is also what lets a later `.database(other)` replace
|
|
250
|
+
* it outright. The builder arrives already typed with this worker's
|
|
251
|
+
* database; this is the runtime half of that.
|
|
146
252
|
*/
|
|
147
253
|
own(builder) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
254
|
+
const owned = this.scheduleStore ? builder.database(this.scheduleStore) : builder;
|
|
255
|
+
owned._owner = this.id;
|
|
256
|
+
owned._scheduleStore = this.scheduleStore;
|
|
257
|
+
return owned;
|
|
151
258
|
}
|
|
152
259
|
declare() {
|
|
153
260
|
return [{
|
|
154
261
|
kind: "worker",
|
|
155
262
|
id: this.id,
|
|
156
263
|
...this.dependencies.length ? { dependencies: this.dependencies } : {},
|
|
264
|
+
...this.config.telemetry ? { telemetry: this.config.telemetry.id } : {},
|
|
157
265
|
provides: []
|
|
158
266
|
}];
|
|
159
267
|
}
|
package/dist/worker.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.mjs","names":[],"sources":["../src/worker.ts"],"sourcesContent":["/**\n * A process with no port.\n *\n * `RestApi` is the process that answers HTTP. This is the one that does not —\n * the thing that runs a schedule, drains a queue, consumes a topic. Until it\n * existed, those had nowhere to say they belonged: a cron declared a schedule\n * and nothing else, and which container ran it was decided by the directory the\n * file sat in. A glob owned it.\n *\n * The cost of that shows up in the scaffolds. `gkm init --template worker` —\n * a project that is background jobs and nothing else — declared\n * `new RestApi('Api', { defaultAuthorizer: 'none', logger })`: an HTTP surface\n * with no HTTP on it, written because it was the only construct that made an\n * app exist and the only way to get a logger into the generated runtime.\n *\n * It takes no authorizer, and that is the tell that these are two constructs\n * rather than one with a flag: a `RestApi` needs one because an HTTP surface\n * can ship open by omission, and nothing reaches a worker from outside.\n *\n * ## Crons on a server target need a database\n *\n * A cron becomes an EventBridge rule on AWS and nothing here is consulted. A\n * server has nothing firing its crons but itself, and a process that schedules\n * in memory fires every job once per replica while reporting success — so the\n * schedule is kept in Postgres, and the worker says which one with\n * `.database(db)`.\n *\n * A worker with crons and no `.database(…)` schedules nothing on a server\n * target and says so at startup. That is a limitation of workers today rather\n * than a design: the store could be a cache, or something the target\n * provisions, and Postgres is what exists.\n *\n * It is not an app. A worker names the process that runs its crons and\n * subscribers, and that process is the app's server — the same one the\n * endpoints run in, minus the HTTP surface. Giving a worker a container of its\n * own made a second thing to build, deploy and keep alive for work that was\n * always going to run somewhere already. Declare as many as the shape of the\n * work wants: they are groupings, not deployments.\n *\n * @example\n * ```ts\n * // constructs/worker.ts\n * import { Worker } from '@geekmidas/constructs/worker';\n * import { logger } from './logger.js';\n *\n * export const worker = new Worker('Worker', { logger }).calls([database]);\n *\n * // crons/cleanup.ts\n * import { worker } from '@acme/constructs/worker.js';\n *\n * export const cleanup = worker\n * .cron('rate(1 day)')\n * .handle(async ({ logger }) => { … });\n * ```\n */\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport type { EventPublisher } from '@geekmidas/events';\nimport type { Logger } from '@geekmidas/logger';\nimport { DEFAULT_LOGGER } from '@geekmidas/logger/console';\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\ttype Dependency,\n} from '@geekmidas/manifest';\nimport type { ComposableStandardSchema } from '@geekmidas/schema';\nimport type { Service } from '@geekmidas/services';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport {\n\ttype Consumable,\n\ttype Declarable,\n\tedgeTo,\n} from './construct-interface';\nimport type { ScheduleExpression } from './crons/Cron';\nimport { CronBuilder } from './crons/CronBuilder';\nimport { envParserFor } from './endpoints/surfaceEnv';\nimport { FunctionBuilder } from './functions/FunctionBuilder';\nimport { SubscriberBuilder } from './subscribers/SubscriberBuilder';\nimport type { Topic, TopicEvents } from './topic/Topic';\n\nexport interface WorkerConfig {\n\t/**\n\t * The logger everything built from this worker runs with.\n\t *\n\t * The actual logger, not a path to one — the same reason `RestApi` takes\n\t * one. Every cron and subscriber in a scaffolded project used to open with\n\t * `import { logger } from '…/constructs/logger.js'`, which is the line this\n\t * removes.\n\t */\n\tlogger?: Logger;\n\t/**\n\t * The environment parser everything built from this worker runs with.\n\t *\n\t * Defaults to `process.env` merged with the credentials `gkm dev` injected,\n\t * which is what an application's own `config/env.ts` always was.\n\t */\n\tenvParser?: EnvironmentParser<{}>;\n}\n\nexport class Worker<TName extends string = string>\n\timplements Declarable<TName>\n{\n\treadonly id: TName;\n\n\t/** Always defined — the worker's own, or the console logger. */\n\treadonly logger: Logger;\n\n\t/** Always defined, and normally the default. */\n\treadonly envParser: EnvironmentParser<{}>;\n\n\t/**\n\t * Where this worker's schedules live, when it has crons and a server runs\n\t * them. `undefined` until `.database(…)` says.\n\t */\n\treadonly scheduleStore?: Consumable<string, unknown>;\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly config: WorkerConfig = {},\n\t\t/** Internal: how `.calls()` carries edges into the copy it returns. */\n\t\tprivate readonly dependencies: readonly Dependency[] = [],\n\t\tscheduleStore?: Consumable<string, unknown>,\n\t) {\n\t\tconst canonical = canonicalId(id as string);\n\n\t\tthis.id = canonical as TName;\n\t\tthis.logger = config.logger ?? DEFAULT_LOGGER;\n\t\tthis.envParser = envParserFor(\n\t\t\tconfig.envParser\n\t\t\t\t? { id: canonical, envParser: config.envParser }\n\t\t\t\t: undefined,\n\t\t);\n\t\tthis.scheduleStore = scheduleStore;\n\t}\n\n\t/**\n\t * The database this worker keeps its schedules in.\n\t *\n\t * Only a server target uses it. On AWS a cron is an EventBridge rule\n\t * invoking a Lambda and nothing here is consulted — but a server has nothing\n\t * firing its crons except itself, and a process that schedules in memory\n\t * fires every job once per replica while reporting that all is well.\n\t *\n\t * So the store is declared rather than discovered. It could have been\n\t * inferred — from a database the app happens to declare, or from the events\n\t * backend when that backend is pg-boss — and both would work until an app\n\t * had two databases, or moved its events to SNS, at which point the\n\t * schedules would quietly move or stop. Naming it is one line and cannot\n\t * drift.\n\t *\n\t * @example\n\t * ```ts\n\t * export const jobs = new Worker('Jobs', { logger }).database(database);\n\t * ```\n\t */\n\tdatabase<T, TDbName extends string>(\n\t\tsource: Consumable<TDbName, T>,\n\t): Worker<TName> {\n\t\treturn new Worker<TName>(\n\t\t\tthis.id as ConstructName<TName>,\n\t\t\tthis.config,\n\t\t\t[...this.dependencies, edgeTo(source)],\n\t\t\tsource as unknown as Consumable<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * A scheduled runnable.\n\t *\n\t * @example `worker.cron('rate(1 day)').handle(async ({ logger }) => { … })`\n\t */\n\tcron(schedule: ScheduleExpression) {\n\t\treturn this.own(new CronBuilder().logger(this.logger)).schedule(schedule);\n\t}\n\n\t/**\n\t * A runnable that consumes a topic.\n\t *\n\t * Binding is not publishing: a consumer is handed the topic's event types\n\t * and no connection string it could publish with. Chain `.publishes(…)` when\n\t * the handler emits follow-up events, which is the only reason it would need\n\t * one.\n\t *\n\t * @example `worker.topic(users).subscribe(['user.created']).handle(…)`\n\t */\n\ttopic<TTopicName extends string, TEvents extends TopicEvents>(\n\t\ttopic: Topic<TTopicName, TEvents>,\n\t) {\n\t\treturn this.own(new SubscriberBuilder().logger(this.logger)).topic(topic);\n\t}\n\n\t/**\n\t * A runnable that consumes events typed from a publisher service.\n\t *\n\t * The older of the two ways to bind a subscriber, kept for a project whose\n\t * events come from a hand-written publisher rather than a `Topic`\n\t * construct. `topic()` is the one to reach for: it types the events the same\n\t * way and hands the consumer no connection string it could publish with.\n\t */\n\tpublisher<T extends EventPublisher<any>, TPubName extends string>(\n\t\tservice: Service<TPubName, T> | Consumable<TPubName, T>,\n\t) {\n\t\treturn this.own(new SubscriberBuilder().logger(this.logger)).publisher(\n\t\t\tservice as never,\n\t\t);\n\t}\n\n\t/**\n\t * Everything below builds a function — the runnable with no schedule and no\n\t * topic, invoked by something else.\n\t *\n\t * These sit on the worker rather than behind a `functions` namespace because\n\t * the namespace was a hop that said nothing: `worker.functions.input(…)`\n\t * names a collection to reach one member of it. What kind of runnable is\n\t * being built is decided by which of these is called first — a schedule\n\t * makes a cron, a topic makes a subscriber, and anything else makes a\n\t * function.\n\t */\n\tinput<T extends ComposableStandardSchema>(schema: T) {\n\t\treturn this.functions.input(schema);\n\t}\n\n\toutput<T extends StandardSchemaV1>(schema: T) {\n\t\treturn this.functions.output(schema);\n\t}\n\n\ttimeout(ms: number) {\n\t\treturn this.functions.timeout(ms);\n\t}\n\n\tmemorySize(mb: number) {\n\t\treturn this.functions.memorySize(mb);\n\t}\n\n\tdependsOn<const T extends readonly Consumable[]>(constructs: T) {\n\t\treturn this.functions.dependsOn(constructs);\n\t}\n\n\tservices<T extends Service[]>(services: T) {\n\t\treturn this.functions.services(services);\n\t}\n\n\t/**\n\t * A function with no input schema — the shortest runnable there is.\n\t *\n\t * @example `worker.handle(async ({ logger }) => { … })`\n\t */\n\thandle(\n\t\t...args: Parameters<\n\t\t\tReturnType<Worker<TName>['schemalessFunction']>['handle']\n\t\t>\n\t) {\n\t\treturn this.schemalessFunction().handle(...args);\n\t}\n\n\t/** The builder `handle` delegates to, named so its type can be referred to. */\n\tprivate schemalessFunction() {\n\t\treturn this.functions;\n\t}\n\n\t/** The function builder the delegating methods above are built on. */\n\tprivate get functions() {\n\t\treturn this.own(new FunctionBuilder().logger(this.logger));\n\t}\n\n\t/**\n\t * Resources and surfaces this worker calls.\n\t *\n\t * Not `.dependsOn()`: this records the edge that derives the worker's\n\t * environment and its access, the same distinction `RestApi.calls()` draws.\n\t */\n\tcalls(constructs: readonly Declarable[]): Worker<TName> {\n\t\treturn new Worker<TName>(\n\t\t\tthis.id as ConstructName<TName>,\n\t\t\tthis.config,\n\t\t\t[...this.dependencies, ...constructs.map(edgeTo)],\n\t\t\tthis.scheduleStore,\n\t\t);\n\t}\n\n\t/**\n\t * Stamps this worker's id onto a builder, so everything built from it says\n\t * which process runs it.\n\t */\n\tprivate own<T extends { _owner?: string; _scheduleStore?: unknown }>(\n\t\tbuilder: T,\n\t): T {\n\t\tbuilder._owner = this.id;\n\t\tbuilder._scheduleStore = this.scheduleStore;\n\n\t\treturn builder;\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'worker',\n\t\t\t\tid: this.id,\n\t\t\t\t...(this.dependencies.length\n\t\t\t\t\t? { dependencies: this.dependencies }\n\t\t\t\t\t: {}),\n\t\t\t\t// Nothing calls a worker, so it publishes no address.\n\t\t\t\tprovides: [],\n\t\t\t},\n\t\t];\n\t}\n}\n"],"mappings":";;;;;;;;AAoGA,IAAa,SAAb,MAAa,OAEb;CAiBmB;CAEA;CAlBlB;;CAGA;;CAGA;;;;;CAMA;CAEA,YACC,IACA,SAAwC,CAAC,GAEzC,eAAuD,CAAC,GACxD,eACC;EAJgB,KAAA,SAAA;EAEA,KAAA,eAAA;EAGjB,MAAM,YAAY,YAAY,EAAY;EAE1C,KAAK,KAAK;EACV,KAAK,SAAS,OAAO,UAAU;EAC/B,KAAK,YAAY,aAChB,OAAO,YACJ;GAAE,IAAI;GAAW,WAAW,OAAO;EAAU,IAC7C,KAAA,CACJ;EACA,KAAK,gBAAgB;CACtB;;;;;;;;;;;;;;;;;;;;;CAsBA,SACC,QACgB;EAChB,OAAO,IAAI,OACV,KAAK,IACL,KAAK,QACL,CAAC,GAAG,KAAK,cAAc,OAAO,MAAM,CAAC,GACrC,MACD;CACD;;;;;;CAOA,KAAK,UAA8B;EAClC,OAAO,KAAK,IAAI,IAAI,YAAY,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,QAAQ;CACzE;;;;;;;;;;;CAYA,MACC,OACC;EACD,OAAO,KAAK,IAAI,IAAI,kBAAkB,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,KAAK;CACzE;;;;;;;;;CAUA,UACC,SACC;EACD,OAAO,KAAK,IAAI,IAAI,kBAAkB,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,UAC5D,OACD;CACD;;;;;;;;;;;;CAaA,MAA0C,QAAW;EACpD,OAAO,KAAK,UAAU,MAAM,MAAM;CACnC;CAEA,OAAmC,QAAW;EAC7C,OAAO,KAAK,UAAU,OAAO,MAAM;CACpC;CAEA,QAAQ,IAAY;EACnB,OAAO,KAAK,UAAU,QAAQ,EAAE;CACjC;CAEA,WAAW,IAAY;EACtB,OAAO,KAAK,UAAU,WAAW,EAAE;CACpC;CAEA,UAAiD,YAAe;EAC/D,OAAO,KAAK,UAAU,UAAU,UAAU;CAC3C;CAEA,SAA8B,UAAa;EAC1C,OAAO,KAAK,UAAU,SAAS,QAAQ;CACxC;;;;;;CAOA,OACC,GAAG,MAGF;EACD,OAAO,KAAK,mBAAmB,CAAC,CAAC,OAAO,GAAG,IAAI;CAChD;;CAGA,qBAA6B;EAC5B,OAAO,KAAK;CACb;;CAGA,IAAY,YAAY;EACvB,OAAO,KAAK,IAAI,IAAI,gBAAgB,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC;CAC1D;;;;;;;CAQA,MAAM,YAAkD;EACvD,OAAO,IAAI,OACV,KAAK,IACL,KAAK,QACL,CAAC,GAAG,KAAK,cAAc,GAAG,WAAW,IAAI,MAAM,CAAC,GAChD,KAAK,aACN;CACD;;;;;CAMA,IACC,SACI;EACJ,QAAQ,SAAS,KAAK;EACtB,QAAQ,iBAAiB,KAAK;EAE9B,OAAO;CACR;CAEA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,GAAI,KAAK,aAAa,SACnB,EAAE,cAAc,KAAK,aAAa,IAClC,CAAC;GAEJ,UAAU,CAAC;EACZ,CACD;CACD;AACD"}
|
|
1
|
+
{"version":3,"file":"worker.mjs","names":[],"sources":["../src/subscribers/InboxSubscriberBuilder.ts","../src/worker.ts"],"sourcesContent":["/**\n * A subscriber bound to an inbox: a topic subscriber whose topic the inbox\n * declares and the provider publishes to, so it runs through the same adaptors\n * — Lambda, SNS push, a polled broker, a feature test.\n *\n * What it is delivered is a receipt notification; what its handler is handed\n * is the messages, parsed, one per envelope recipient the inbox receives at.\n * The inbox's own client does that, which is also why the handler can read\n * its inbox's raw messages without naming it in `.dependsOn`.\n */\n\nimport type { EventPublisher } from '@geekmidas/events';\nimport type { Logger } from '@geekmidas/logger';\nimport { INBOX_EVENT, serviceKey } from '@geekmidas/manifest';\nimport type { InferStandardSchema } from '@geekmidas/schema';\nimport type { Service, ServiceRecord } from '@geekmidas/services';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport type { Consumable, ServicesOf } from '../construct-interface';\nimport type { DatabaseContext } from '../functions/Function';\nimport type {\n\tInbox,\n\tInboxClient,\n\tInboxMessage,\n\tReceiptNotification,\n} from '../inbox';\nimport type { Subscriber } from './Subscriber';\nimport type { SubscriberBuilder } from './SubscriberBuilder';\n\nexport type InboxSubscriber<\n\tTServices extends Service[] = [],\n\tTLogger extends Logger = Logger,\n\tOutSchema extends StandardSchemaV1 | undefined = undefined,\n\tTDatabase = undefined,\n\tTDatabaseServiceName extends string = string,\n> = Subscriber<\n\tTServices,\n\tTLogger,\n\tOutSchema,\n\tEventPublisher<{ type: typeof INBOX_EVENT; payload: ReceiptNotification }>,\n\t[typeof INBOX_EVENT],\n\tTDatabase,\n\tTDatabaseServiceName\n>;\n\nexport type InboxSubscriberContext<\n\tTServices extends Service[] = [],\n\tTLogger extends Logger = Logger,\n\tTDatabase = undefined,\n> = {\n\t/** The messages received, one per envelope recipient the inbox takes. */\n\tmessages: InboxMessage[];\n\t/** The inbox, under its own id too: its domain and its raw messages. */\n\tinbox: InboxClient;\n\tservices: ServiceRecord<TServices>;\n\tlogger: TLogger;\n} & DatabaseContext<TDatabase>;\n\nexport type InboxSubscriberHandler<\n\tTServices extends Service[] = [],\n\tTLogger extends Logger = Logger,\n\tOutSchema extends StandardSchemaV1 | undefined = undefined,\n\tTDatabase = undefined,\n> = (\n\tctx: InboxSubscriberContext<TServices, TLogger, TDatabase>,\n) => OutSchema extends StandardSchemaV1\n\t? InferStandardSchema<OutSchema> | Promise<InferStandardSchema<OutSchema>>\n\t: any | Promise<any>;\n\nexport class InboxSubscriberBuilder<\n\tTServices extends Service[] = [],\n\tTLogger extends Logger = Logger,\n\tOutSchema extends StandardSchemaV1 | undefined = undefined,\n\tTDatabase = undefined,\n\tTDatabaseServiceName extends string = string,\n> {\n\tconstructor(\n\t\tprivate readonly inner: SubscriberBuilder<\n\t\t\tany,\n\t\t\tany,\n\t\t\tany,\n\t\t\tany,\n\t\t\tany,\n\t\t\tany,\n\t\t\tany\n\t\t>,\n\t\tprivate readonly inbox: Inbox<string>,\n\t) {}\n\n\tdependsOn<const T extends readonly Consumable[]>(\n\t\tconstructs: T,\n\t): InboxSubscriberBuilder<\n\t\t[...TServices, ...ServicesOf<T>],\n\t\tTLogger,\n\t\tOutSchema,\n\t\tTDatabase,\n\t\tTDatabaseServiceName\n\t> {\n\t\treturn this.with(this.inner.dependsOn(constructs));\n\t}\n\n\tservices<T extends Service[]>(\n\t\tservices: T,\n\t): InboxSubscriberBuilder<\n\t\t[...TServices, ...T],\n\t\tTLogger,\n\t\tOutSchema,\n\t\tTDatabase,\n\t\tTDatabaseServiceName\n\t> {\n\t\treturn this.with(this.inner.services(services));\n\t}\n\n\tdatabase<T, TDbName extends string>(\n\t\tsource: Consumable<TDbName, T> | Service<TDbName, T>,\n\t): InboxSubscriberBuilder<TServices, TLogger, OutSchema, T, TDbName> {\n\t\treturn this.with(this.inner.database(source));\n\t}\n\n\ttimeout(timeout: number): this {\n\t\treturn this.with(this.inner.timeout(timeout)) as this;\n\t}\n\n\toutput<T extends StandardSchemaV1>(\n\t\tschema: T,\n\t): InboxSubscriberBuilder<\n\t\tTServices,\n\t\tTLogger,\n\t\tT,\n\t\tTDatabase,\n\t\tTDatabaseServiceName\n\t> {\n\t\treturn this.with(this.inner.output(schema));\n\t}\n\n\tlogger<T extends Logger>(\n\t\tlogger: T,\n\t): InboxSubscriberBuilder<\n\t\tTServices,\n\t\tT,\n\t\tOutSchema,\n\t\tTDatabase,\n\t\tTDatabaseServiceName\n\t> {\n\t\treturn this.with(this.inner.logger(logger));\n\t}\n\n\thandle(\n\t\tfn: InboxSubscriberHandler<TServices, TLogger, OutSchema, TDatabase>,\n\t): InboxSubscriber<\n\t\tTServices,\n\t\tTLogger,\n\t\tOutSchema,\n\t\tTDatabase,\n\t\tTDatabaseServiceName\n\t> {\n\t\tconst key = serviceKey(this.inbox.id);\n\n\t\t// Every adaptor hands the handler `{ type, payload }` messages; each\n\t\t// payload here is a receipt notification, and the inbox's client turns\n\t\t// it into the messages for the recipients it receives at.\n\t\tconst handler = async (ctx: Record<string, any>) => {\n\t\t\tconst inbox = ctx.services[key] as InboxClient;\n\t\t\tconst notifications = (ctx.events as unknown[]).filter(\n\t\t\t\t(event): event is { type: string; payload: ReceiptNotification } =>\n\t\t\t\t\t(event as { type?: string })?.type === INBOX_EVENT,\n\t\t\t);\n\t\t\tconst messages: InboxMessage[] = [];\n\t\t\tfor (const { payload } of notifications) {\n\t\t\t\tmessages.push(...(await inbox.messages(payload)));\n\t\t\t}\n\t\t\tif (messages.length === 0) return undefined;\n\t\t\treturn fn({\n\t\t\t\t...ctx,\n\t\t\t\tmessages,\n\t\t\t\tinbox,\n\t\t\t} as unknown as InboxSubscriberContext<TServices, TLogger, TDatabase>);\n\t\t};\n\n\t\tconst subscriber = this.inner\n\t\t\t.subscribe([INBOX_EVENT] as never)\n\t\t\t.handle(handler as never) as unknown as InboxSubscriber<\n\t\t\tTServices,\n\t\t\tTLogger,\n\t\t\tOutSchema,\n\t\t\tTDatabase,\n\t\t\tTDatabaseServiceName\n\t\t>;\n\t\tsubscriber.inboxName = this.inbox.id;\n\t\tsubscriber.inboxAddressing = this.inbox.addressing;\n\t\treturn subscriber;\n\t}\n\n\tprivate with(inner: SubscriberBuilder<any, any, any, any, any, any, any>) {\n\t\treturn new InboxSubscriberBuilder<any, any, any, any, any>(\n\t\t\tinner,\n\t\t\tthis.inbox,\n\t\t);\n\t}\n}\n","/**\n * A process with no port.\n *\n * `RestApi` is the process that answers HTTP. This is the one that does not —\n * the thing that runs a schedule, drains a queue, consumes a topic. Until it\n * existed, those had nowhere to say they belonged: a cron declared a schedule\n * and nothing else, and which container ran it was decided by the directory the\n * file sat in. A glob owned it.\n *\n * The cost of that shows up in the scaffolds. `gkm init --template worker` —\n * a project that is background jobs and nothing else — declared\n * `new RestApi('Api', { defaultAuthorizer: 'none', logger })`: an HTTP surface\n * with no HTTP on it, written because it was the only construct that made an\n * app exist and the only way to get a logger into the generated runtime.\n *\n * It takes no authorizer, and that is the tell that these are two constructs\n * rather than one with a flag: a `RestApi` needs one because an HTTP surface\n * can ship open by omission, and nothing reaches a worker from outside.\n *\n * ## Crons on a server target need a database\n *\n * A cron becomes an EventBridge rule on AWS and nothing here is consulted. A\n * server has nothing firing its crons but itself, and a process that schedules\n * in memory fires every job once per replica while reporting success — so the\n * schedule is kept in Postgres, and the worker says which one with\n * `.database(db)`.\n *\n * A worker with crons and no `.database(…)` schedules nothing on a server\n * target and says so at startup. That is a limitation of workers today rather\n * than a design: the store could be a cache, or something the target\n * provisions, and Postgres is what exists.\n *\n * ## The database is everything's default\n *\n * The same `.database(db)` is the database every cron, queue, subscriber and\n * function built from the worker receives as `db`. The work a worker groups is\n * usually work against one database, and naming it per handler was a line\n * repeated in every file that could drift in any one of them. A runnable that\n * works against another names its own with `.database(other)`, which replaces\n * the worker's — client and manifest edge both — rather than adding to it.\n *\n * It is not an app: it declares no path, and its code lives in an app's\n * directory. But it is a process of its own. On a server target each worker\n * with work to do is built — from the app that holds that work — into an image\n * that runs its crons, consumers and subscribers and answers only a health\n * check, so a slow queue never shares a process with the requests an API\n * serves. `gkm dev` still runs everything in one process. Declare as many as\n * the shape of the work wants: each is one container.\n *\n * @example\n * ```ts\n * // constructs/worker.ts\n * import { Worker } from '@geekmidas/constructs/worker';\n * import { logger } from './logger.js';\n *\n * export const worker = new Worker('Worker', { logger }).database(database);\n *\n * // crons/cleanup.ts\n * import { worker } from '@acme/constructs/worker.js';\n *\n * export const cleanup = worker\n * .cron('rate(1 day)')\n * .handle(async ({ db, logger }) => { … });\n *\n * // queues/reports.ts — against another database than the worker's\n * export const reports = worker\n * .queue('Reports')\n * .database(analytics)\n * .message(z.object({ id: z.uuid() }))\n * .handle(async ({ messages, db }) => { … });\n * ```\n */\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport type { Logger } from '@geekmidas/logger';\nimport { DEFAULT_LOGGER } from '@geekmidas/logger/console';\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\ttype Dependency,\n} from '@geekmidas/manifest';\nimport type { ComposableStandardSchema } from '@geekmidas/schema';\nimport type { Service } from '@geekmidas/services';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport {\n\ttype Consumable,\n\ttype Declarable,\n\tedgeTo,\n} from './construct-interface';\nimport type { ScheduleExpression } from './crons/Cron';\nimport { CronBuilder } from './crons/CronBuilder';\nimport { envParserFor } from './endpoints/surfaceEnv';\nimport { FunctionBuilder } from './functions/FunctionBuilder';\nimport type { Inbox } from './inbox';\nimport type { ObjectStorage } from './object-storage';\nimport { QueueBuilder } from './queue/QueueBuilder';\nimport { InboxSubscriberBuilder } from './subscribers/InboxSubscriberBuilder';\nimport { ObjectSubscriberBuilder } from './subscribers/ObjectSubscriberBuilder';\nimport { SubscriberBuilder } from './subscribers/SubscriberBuilder';\nimport type { Telemetry } from './telemetry';\nimport type { Topic, TopicEvents } from './topic/Topic';\n\nexport interface WorkerConfig {\n\t/**\n\t * The logger everything built from this worker runs with.\n\t *\n\t * The actual logger, not a path to one — the same reason `RestApi` takes\n\t * one. Every cron and subscriber in a scaffolded project used to open with\n\t * `import { logger } from '…/constructs/logger.js'`, which is the line this\n\t * removes.\n\t */\n\tlogger?: Logger;\n\t/**\n\t * The environment parser everything built from this worker runs with.\n\t *\n\t * Defaults to `process.env` merged with the credentials `gkm dev` injected,\n\t * which is what an application's own `config/env.ts` always was.\n\t */\n\tenvParser?: EnvironmentParser<{}>;\n\t/**\n\t * What the worker's process emits — the `Telemetry` construct, passed like\n\t * the logger. An edge to the node: the deploy hands the process the\n\t * `OTEL_*` keys its stage resolves.\n\t */\n\ttelemetry?: Telemetry;\n}\n\nexport class Worker<\n\tTName extends string = string,\n\tTDatabase = undefined,\n\tTDatabaseServiceName extends string = string,\n> implements Declarable<TName>\n{\n\treadonly id: TName;\n\n\t/** Always defined — the worker's own, or the console logger. */\n\treadonly logger: Logger;\n\n\t/** Always defined, and normally the default. */\n\treadonly envParser: EnvironmentParser<{}>;\n\n\t/**\n\t * Where this worker's schedules live, when it has crons and a server runs\n\t * them — and the database everything built from it receives as `db`.\n\t * `undefined` until `.database(…)` says.\n\t */\n\treadonly scheduleStore?: Consumable<string, unknown>;\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly config: WorkerConfig = {},\n\t\t/** Internal: how `.database()` carries its edge into the copy it returns. */\n\t\tprivate readonly dependencies: readonly Dependency[] = [],\n\t\tscheduleStore?: Consumable<string, unknown>,\n\t) {\n\t\tconst canonical = canonicalId(id as string);\n\n\t\tthis.id = canonical as TName;\n\t\tthis.logger = config.logger ?? DEFAULT_LOGGER;\n\t\tthis.envParser = envParserFor(\n\t\t\tconfig.envParser\n\t\t\t\t? { id: canonical, envParser: config.envParser }\n\t\t\t\t: undefined,\n\t\t);\n\t\tthis.scheduleStore = scheduleStore;\n\t}\n\n\t/**\n\t * The database this worker keeps its schedules in, and the one everything\n\t * built from it — crons, queues, subscribers, functions — receives as `db`.\n\t * One of them that works against another database names it with its own\n\t * `.database(other)`, which replaces this one for that runnable alone.\n\t *\n\t * Only a server target uses it. On AWS a cron is an EventBridge rule\n\t * invoking a Lambda and nothing here is consulted — but a server has nothing\n\t * firing its crons except itself, and a process that schedules in memory\n\t * fires every job once per replica while reporting that all is well.\n\t *\n\t * So the store is declared rather than discovered. It could have been\n\t * inferred — from a database the app happens to declare, or from the events\n\t * backend when that backend is pg-boss — and both would work until an app\n\t * had two databases, or moved its events to SNS, at which point the\n\t * schedules would quietly move or stop. Naming it is one line and cannot\n\t * drift.\n\t *\n\t * @example\n\t * ```ts\n\t * export const jobs = new Worker('Jobs', { logger }).database(database);\n\t *\n\t * export const sweep = jobs\n\t * .cron('rate(1 hour)')\n\t * .handle(async ({ db }) => db.deleteFrom('sessions').execute());\n\t * ```\n\t */\n\tdatabase<T, TDbName extends string>(\n\t\tsource: Consumable<TDbName, T>,\n\t): Worker<TName, T, TDbName> {\n\t\treturn new Worker<TName, T, TDbName>(\n\t\t\tthis.id as ConstructName<TName>,\n\t\t\tthis.config,\n\t\t\t[...this.dependencies, edgeTo(source)],\n\t\t\tsource as unknown as Consumable<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * A scheduled runnable.\n\t *\n\t * @example `worker.cron('rate(1 day)').handle(async ({ logger }) => { … })`\n\t */\n\tcron(schedule: ScheduleExpression) {\n\t\treturn this.own(\n\t\t\tnew CronBuilder<\n\t\t\t\tComposableStandardSchema,\n\t\t\t\tService[],\n\t\t\t\tLogger,\n\t\t\t\tundefined,\n\t\t\t\tTDatabase,\n\t\t\t\tTDatabaseServiceName\n\t\t\t>().logger(this.logger),\n\t\t).schedule(schedule);\n\t}\n\n\t/**\n\t * A queue and its one consumer, run by this worker.\n\t *\n\t * One construct, because a queue has exactly one consumer: nothing else can\n\t * attach a second, or forget to attach the first. Producers send to it by\n\t * depending on it — `.dependsOn([emails])` makes `services.emails` the\n\t * publisher.\n\t *\n\t * @example\n\t * ```ts\n\t * export const emails = worker\n\t * .queue('Emails')\n\t * .message(z.object({ userId: z.uuid(), template: z.string() }))\n\t * .handle(async ({ messages, services }) => { … });\n\t * ```\n\t */\n\tqueue<TQueueName extends string>(name: TQueueName) {\n\t\treturn this.own(\n\t\t\tnew QueueBuilder<\n\t\t\t\tstring,\n\t\t\t\tundefined,\n\t\t\t\t[],\n\t\t\t\tLogger,\n\t\t\t\tTDatabase,\n\t\t\t\tTDatabaseServiceName\n\t\t\t>().logger(this.logger),\n\t\t).queue(name);\n\t}\n\n\t/**\n\t * A runnable that reacts to a bucket's objects changing.\n\t *\n\t * A bucket is a topic whose publisher is the storage: the binding is the\n\t * same as {@link Worker.topic}'s, and so is everything after it — the\n\t * services, the database, how it is delivered. The handler is handed the\n\t * objects; reading one still means depending on the bucket,\n\t * `.dependsOn([uploads])`.\n\t *\n\t * @example\n\t * ```ts\n\t * export const onAvatar = worker\n\t * .objects(uploads)\n\t * .on(['object.created'], { prefix: 'avatars/', suffix: '.png' })\n\t * .handle(async ({ objects }) => { … });\n\t * ```\n\t */\n\tobjects<TBucketName extends string>(bucket: ObjectStorage<TBucketName>) {\n\t\tconst inner = this.own(\n\t\t\tnew SubscriberBuilder<\n\t\t\t\t[],\n\t\t\t\tLogger,\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t\t[],\n\t\t\t\tTDatabase,\n\t\t\t\tTDatabaseServiceName\n\t\t\t>().logger(this.logger),\n\t\t);\n\t\treturn new ObjectSubscriberBuilder<\n\t\t\t[],\n\t\t\tLogger,\n\t\t\tundefined,\n\t\t\t[],\n\t\t\tTDatabase,\n\t\t\tTDatabaseServiceName\n\t\t>(inner, bucket.id);\n\t}\n\n\t/**\n\t * A runnable handed the mail an {@link Inbox} receives.\n\t *\n\t * Bound, as a topic subscriber is: the inbox's topic is what it consumes,\n\t * and what it is handed is the messages on it, parsed — one per envelope\n\t * recipient the inbox receives at. It reads its inbox's raw messages\n\t * without depending on it; anything else it uses it names, as ever.\n\t *\n\t * @example\n\t * ```ts\n\t * export const onRequest = worker\n\t * .inbox(requests)\n\t * .handle(async ({ messages, db }) => {\n\t * for (const message of messages) message.recipient.subdomain;\n\t * });\n\t * ```\n\t */\n\tinbox<TInboxName extends string>(inbox: Inbox<TInboxName>) {\n\t\tconst inner = this.own(\n\t\t\tnew SubscriberBuilder<\n\t\t\t\t[],\n\t\t\t\tLogger,\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t\t[],\n\t\t\t\tTDatabase,\n\t\t\t\tTDatabaseServiceName\n\t\t\t>().logger(this.logger),\n\t\t)\n\t\t\t.topic(inbox.topic)\n\t\t\t// The inbox itself: its client reads the raw messages from the\n\t\t\t// inbox's own bucket, which is what the edge grants — and nothing\n\t\t\t// the handler did not name besides.\n\t\t\t.dependsOn([inbox]);\n\t\treturn new InboxSubscriberBuilder<\n\t\t\t[],\n\t\t\tLogger,\n\t\t\tundefined,\n\t\t\tTDatabase,\n\t\t\tTDatabaseServiceName\n\t\t>(inner, inbox);\n\t}\n\n\t/**\n\t * A runnable that consumes a topic.\n\t *\n\t * Binding is not publishing: a consumer is handed the topic's event types\n\t * and no connection string it could publish with. A handler that emits\n\t * follow-up events depends on the topic it emits to —\n\t * `.dependsOn([orders])` — which is the only reason it would need one.\n\t *\n\t * @example `worker.topic(users).subscribe(['user.created']).handle(…)`\n\t */\n\ttopic<TTopicName extends string, TEvents extends TopicEvents>(\n\t\ttopic: Topic<TTopicName, TEvents>,\n\t) {\n\t\treturn this.own(\n\t\t\tnew SubscriberBuilder<\n\t\t\t\t[],\n\t\t\t\tLogger,\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t\t[],\n\t\t\t\tTDatabase,\n\t\t\t\tTDatabaseServiceName\n\t\t\t>().logger(this.logger),\n\t\t).topic(topic);\n\t}\n\n\t/**\n\t * Everything below builds a function — the runnable with no schedule and no\n\t * topic, invoked by something else.\n\t *\n\t * These sit on the worker rather than behind a `functions` namespace because\n\t * the namespace was a hop that said nothing: `worker.functions.input(…)`\n\t * names a collection to reach one member of it. What kind of runnable is\n\t * being built is decided by which of these is called first — a schedule\n\t * makes a cron, a topic makes a subscriber, and anything else makes a\n\t * function.\n\t */\n\tinput<T extends ComposableStandardSchema>(schema: T) {\n\t\treturn this.functions.input(schema);\n\t}\n\n\toutput<T extends StandardSchemaV1>(schema: T) {\n\t\treturn this.functions.output(schema);\n\t}\n\n\ttimeout(ms: number) {\n\t\treturn this.functions.timeout(ms);\n\t}\n\n\tmemorySize(mb: number) {\n\t\treturn this.functions.memorySize(mb);\n\t}\n\n\tdependsOn<const T extends readonly Consumable[]>(constructs: T) {\n\t\treturn this.functions.dependsOn(constructs);\n\t}\n\n\tservices<T extends Service[]>(services: T) {\n\t\treturn this.functions.services(services);\n\t}\n\n\t/**\n\t * A function with no input schema — the shortest runnable there is.\n\t *\n\t * @example `worker.handle(async ({ logger }) => { … })`\n\t */\n\thandle(\n\t\t...args: Parameters<\n\t\t\tReturnType<\n\t\t\t\tWorker<TName, TDatabase, TDatabaseServiceName>['schemalessFunction']\n\t\t\t>['handle']\n\t\t>\n\t) {\n\t\treturn this.schemalessFunction().handle(...args);\n\t}\n\n\t/** The builder `handle` delegates to, named so its type can be referred to. */\n\tprivate schemalessFunction() {\n\t\treturn this.functions;\n\t}\n\n\t/** The function builder the delegating methods above are built on. */\n\tprivate get functions() {\n\t\treturn this.own(\n\t\t\tnew FunctionBuilder<\n\t\t\t\tany,\n\t\t\t\tundefined,\n\t\t\t\t[],\n\t\t\t\tLogger,\n\t\t\t\tundefined,\n\t\t\t\tstring,\n\t\t\t\tTDatabase,\n\t\t\t\tTDatabaseServiceName\n\t\t\t>().logger(this.logger),\n\t\t);\n\t}\n\n\t/**\n\t * Stamps this worker's id onto a builder, so everything built from it says\n\t * which process runs it — and hands it the worker's database.\n\t *\n\t * The database goes through the builder's own `.database()` rather than\n\t * being written into its fields, so the default is recorded exactly as an\n\t * explicit one would be: the client the handler gets, and the edge the\n\t * manifest reads. That is also what lets a later `.database(other)` replace\n\t * it outright. The builder arrives already typed with this worker's\n\t * database; this is the runtime half of that.\n\t */\n\tprivate own<\n\t\tT extends {\n\t\t\t_owner?: string;\n\t\t\t_scheduleStore?: unknown;\n\t\t\tdatabase(source: Consumable<string, unknown>): unknown;\n\t\t},\n\t>(builder: T): T {\n\t\tconst owned = this.scheduleStore\n\t\t\t? (builder.database(this.scheduleStore) as T)\n\t\t\t: builder;\n\n\t\towned._owner = this.id;\n\t\towned._scheduleStore = this.scheduleStore;\n\n\t\treturn owned;\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'worker',\n\t\t\t\tid: this.id,\n\t\t\t\t...(this.dependencies.length\n\t\t\t\t\t? { dependencies: this.dependencies }\n\t\t\t\t\t: {}),\n\t\t\t\t...(this.config.telemetry\n\t\t\t\t\t? { telemetry: this.config.telemetry.id }\n\t\t\t\t\t: {}),\n\t\t\t\t// Nothing calls a worker, so it publishes no address.\n\t\t\t\tprovides: [],\n\t\t\t},\n\t\t];\n\t}\n}\n"],"mappings":";;;;;;;;;AAoEA,IAAa,yBAAb,MAAa,uBAMX;CAEiB;CASA;CAVlB,YACC,OASA,OACC;EAVgB,KAAA,QAAA;EASA,KAAA,QAAA;CACf;CAEH,UACC,YAOC;EACD,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,UAAU,CAAC;CAClD;CAEA,SACC,UAOC;EACD,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,QAAQ,CAAC;CAC/C;CAEA,SACC,QACoE;EACpE,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,MAAM,CAAC;CAC7C;CAEA,QAAQ,SAAuB;EAC9B,OAAO,KAAK,KAAK,KAAK,MAAM,QAAQ,OAAO,CAAC;CAC7C;CAEA,OACC,QAOC;EACD,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,MAAM,CAAC;CAC3C;CAEA,OACC,QAOC;EACD,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,MAAM,CAAC;CAC3C;CAEA,OACC,IAOC;EACD,MAAM,MAAM,WAAW,KAAK,MAAM,EAAE;EAKpC,MAAM,UAAU,OAAO,QAA6B;GACnD,MAAM,QAAQ,IAAI,SAAS;GAC3B,MAAM,gBAAiB,IAAI,OAAqB,QAC9C,UACC,OAA6B,SAAS,WACzC;GACA,MAAM,WAA2B,CAAC;GAClC,KAAK,MAAM,EAAE,aAAa,eACzB,SAAS,KAAK,GAAI,MAAM,MAAM,SAAS,OAAO,CAAE;GAEjD,IAAI,SAAS,WAAW,GAAG,OAAO,KAAA;GAClC,OAAO,GAAG;IACT,GAAG;IACH;IACA;GACD,CAAqE;EACtE;EAEA,MAAM,aAAa,KAAK,MACtB,UAAU,CAAC,WAAW,CAAU,CAAC,CACjC,OAAO,OAAgB;EAOzB,WAAW,YAAY,KAAK,MAAM;EAClC,WAAW,kBAAkB,KAAK,MAAM;EACxC,OAAO;CACR;CAEA,KAAa,OAA6D;EACzE,OAAO,IAAI,uBACV,OACA,KAAK,KACN;CACD;AACD;;;ACtEA,IAAa,SAAb,MAAa,OAKb;CAkBmB;CAEA;CAnBlB;;CAGA;;CAGA;;;;;;CAOA;CAEA,YACC,IACA,SAAwC,CAAC,GAEzC,eAAuD,CAAC,GACxD,eACC;EAJgB,KAAA,SAAA;EAEA,KAAA,eAAA;EAGjB,MAAM,YAAY,YAAY,EAAY;EAE1C,KAAK,KAAK;EACV,KAAK,SAAS,OAAO,UAAU;EAC/B,KAAK,YAAY,aAChB,OAAO,YACJ;GAAE,IAAI;GAAW,WAAW,OAAO;EAAU,IAC7C,KAAA,CACJ;EACA,KAAK,gBAAgB;CACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BA,SACC,QAC4B;EAC5B,OAAO,IAAI,OACV,KAAK,IACL,KAAK,QACL,CAAC,GAAG,KAAK,cAAc,OAAO,MAAM,CAAC,GACrC,MACD;CACD;;;;;;CAOA,KAAK,UAA8B;EAClC,OAAO,KAAK,IACX,IAAI,YAOF,CAAC,CAAC,OAAO,KAAK,MAAM,CACvB,CAAC,CAAC,SAAS,QAAQ;CACpB;;;;;;;;;;;;;;;;;CAkBA,MAAiC,MAAkB;EAClD,OAAO,KAAK,IACX,IAAI,aAOF,CAAC,CAAC,OAAO,KAAK,MAAM,CACvB,CAAC,CAAC,MAAM,IAAI;CACb;;;;;;;;;;;;;;;;;;CAmBA,QAAoC,QAAoC;EACvE,MAAM,QAAQ,KAAK,IAClB,IAAI,kBAQF,CAAC,CAAC,OAAO,KAAK,MAAM,CACvB;EACA,OAAO,IAAI,wBAOT,OAAO,OAAO,EAAE;CACnB;;;;;;;;;;;;;;;;;;CAmBA,MAAiC,OAA0B;EAiB1D,OAAO,IAAI,uBAhBG,KAAK,IAClB,IAAI,kBAQF,CAAC,CAAC,OAAO,KAAK,MAAM,CACvB,CAAC,CACC,MAAM,MAAM,KAAK,CAAC,CAIlB,UAAU,CAAC,KAAK,CAOhB,GAAO,KAAK;CACf;;;;;;;;;;;CAYA,MACC,OACC;EACD,OAAO,KAAK,IACX,IAAI,kBAQF,CAAC,CAAC,OAAO,KAAK,MAAM,CACvB,CAAC,CAAC,MAAM,KAAK;CACd;;;;;;;;;;;;CAaA,MAA0C,QAAW;EACpD,OAAO,KAAK,UAAU,MAAM,MAAM;CACnC;CAEA,OAAmC,QAAW;EAC7C,OAAO,KAAK,UAAU,OAAO,MAAM;CACpC;CAEA,QAAQ,IAAY;EACnB,OAAO,KAAK,UAAU,QAAQ,EAAE;CACjC;CAEA,WAAW,IAAY;EACtB,OAAO,KAAK,UAAU,WAAW,EAAE;CACpC;CAEA,UAAiD,YAAe;EAC/D,OAAO,KAAK,UAAU,UAAU,UAAU;CAC3C;CAEA,SAA8B,UAAa;EAC1C,OAAO,KAAK,UAAU,SAAS,QAAQ;CACxC;;;;;;CAOA,OACC,GAAG,MAKF;EACD,OAAO,KAAK,mBAAmB,CAAC,CAAC,OAAO,GAAG,IAAI;CAChD;;CAGA,qBAA6B;EAC5B,OAAO,KAAK;CACb;;CAGA,IAAY,YAAY;EACvB,OAAO,KAAK,IACX,IAAI,gBASF,CAAC,CAAC,OAAO,KAAK,MAAM,CACvB;CACD;;;;;;;;;;;;CAaA,IAME,SAAe;EAChB,MAAM,QAAQ,KAAK,gBACf,QAAQ,SAAS,KAAK,aAAa,IACpC;EAEH,MAAM,SAAS,KAAK;EACpB,MAAM,iBAAiB,KAAK;EAE5B,OAAO;CACR;CAEA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,GAAI,KAAK,aAAa,SACnB,EAAE,cAAc,KAAK,aAAa,IAClC,CAAC;GACJ,GAAI,KAAK,OAAO,YACb,EAAE,WAAW,KAAK,OAAO,UAAU,GAAG,IACtC,CAAC;GAEJ,UAAU,CAAC;EACZ,CACD;CACD;AACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geekmidas/constructs",
|
|
3
|
-
"version": "10.0.0-alpha.
|
|
3
|
+
"version": "10.0.0-alpha.140",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -144,6 +144,16 @@
|
|
|
144
144
|
"default": "./dist/file-server.cjs"
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
|
+
"./processors": {
|
|
148
|
+
"import": {
|
|
149
|
+
"types": "./dist/processors/index.d.mts",
|
|
150
|
+
"default": "./dist/processors/index.mjs"
|
|
151
|
+
},
|
|
152
|
+
"require": {
|
|
153
|
+
"types": "./dist/processors/index.d.cts",
|
|
154
|
+
"default": "./dist/processors/index.cjs"
|
|
155
|
+
}
|
|
156
|
+
},
|
|
147
157
|
"./email": {
|
|
148
158
|
"import": {
|
|
149
159
|
"types": "./dist/email.d.mts",
|
|
@@ -154,6 +164,16 @@
|
|
|
154
164
|
"default": "./dist/email.cjs"
|
|
155
165
|
}
|
|
156
166
|
},
|
|
167
|
+
"./inbox": {
|
|
168
|
+
"import": {
|
|
169
|
+
"types": "./dist/inbox.d.mts",
|
|
170
|
+
"default": "./dist/inbox.mjs"
|
|
171
|
+
},
|
|
172
|
+
"require": {
|
|
173
|
+
"types": "./dist/inbox.d.cts",
|
|
174
|
+
"default": "./dist/inbox.cjs"
|
|
175
|
+
}
|
|
176
|
+
},
|
|
157
177
|
"./cache": {
|
|
158
178
|
"import": {
|
|
159
179
|
"types": "./dist/cache.d.mts",
|
|
@@ -164,6 +184,36 @@
|
|
|
164
184
|
"default": "./dist/cache.cjs"
|
|
165
185
|
}
|
|
166
186
|
},
|
|
187
|
+
"./encryption": {
|
|
188
|
+
"import": {
|
|
189
|
+
"types": "./dist/encryption.d.mts",
|
|
190
|
+
"default": "./dist/encryption.mjs"
|
|
191
|
+
},
|
|
192
|
+
"require": {
|
|
193
|
+
"types": "./dist/encryption.d.cts",
|
|
194
|
+
"default": "./dist/encryption.cjs"
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
"./encryption/kms": {
|
|
198
|
+
"import": {
|
|
199
|
+
"types": "./dist/encryption/kms.d.mts",
|
|
200
|
+
"default": "./dist/encryption/kms.mjs"
|
|
201
|
+
},
|
|
202
|
+
"require": {
|
|
203
|
+
"types": "./dist/encryption/kms.d.cts",
|
|
204
|
+
"default": "./dist/encryption/kms.cjs"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"./random-password": {
|
|
208
|
+
"import": {
|
|
209
|
+
"types": "./dist/random-password.d.mts",
|
|
210
|
+
"default": "./dist/random-password.mjs"
|
|
211
|
+
},
|
|
212
|
+
"require": {
|
|
213
|
+
"types": "./dist/random-password.d.cts",
|
|
214
|
+
"default": "./dist/random-password.cjs"
|
|
215
|
+
}
|
|
216
|
+
},
|
|
167
217
|
"./credential": {
|
|
168
218
|
"import": {
|
|
169
219
|
"types": "./dist/credential.d.mts",
|
|
@@ -174,6 +224,16 @@
|
|
|
174
224
|
"default": "./dist/credential.cjs"
|
|
175
225
|
}
|
|
176
226
|
},
|
|
227
|
+
"./external-api": {
|
|
228
|
+
"import": {
|
|
229
|
+
"types": "./dist/external-api.d.mts",
|
|
230
|
+
"default": "./dist/external-api.mjs"
|
|
231
|
+
},
|
|
232
|
+
"require": {
|
|
233
|
+
"types": "./dist/external-api.d.cts",
|
|
234
|
+
"default": "./dist/external-api.cjs"
|
|
235
|
+
}
|
|
236
|
+
},
|
|
177
237
|
"./auth": {
|
|
178
238
|
"import": {
|
|
179
239
|
"types": "./dist/auth.d.mts",
|
|
@@ -194,6 +254,16 @@
|
|
|
194
254
|
"default": "./dist/rest-api.cjs"
|
|
195
255
|
}
|
|
196
256
|
},
|
|
257
|
+
"./websocket-api": {
|
|
258
|
+
"import": {
|
|
259
|
+
"types": "./dist/websocket-api.d.mts",
|
|
260
|
+
"default": "./dist/websocket-api.mjs"
|
|
261
|
+
},
|
|
262
|
+
"require": {
|
|
263
|
+
"types": "./dist/websocket-api.d.cts",
|
|
264
|
+
"default": "./dist/websocket-api.cjs"
|
|
265
|
+
}
|
|
266
|
+
},
|
|
197
267
|
"./site": {
|
|
198
268
|
"import": {
|
|
199
269
|
"types": "./dist/site.d.mts",
|
|
@@ -204,6 +274,16 @@
|
|
|
204
274
|
"default": "./dist/site.cjs"
|
|
205
275
|
}
|
|
206
276
|
},
|
|
277
|
+
"./mobile-app": {
|
|
278
|
+
"import": {
|
|
279
|
+
"types": "./dist/mobile-app.d.mts",
|
|
280
|
+
"default": "./dist/mobile-app.mjs"
|
|
281
|
+
},
|
|
282
|
+
"require": {
|
|
283
|
+
"types": "./dist/mobile-app.d.cts",
|
|
284
|
+
"default": "./dist/mobile-app.cjs"
|
|
285
|
+
}
|
|
286
|
+
},
|
|
207
287
|
"./worker": {
|
|
208
288
|
"import": {
|
|
209
289
|
"types": "./dist/worker.d.mts",
|
|
@@ -214,6 +294,16 @@
|
|
|
214
294
|
"default": "./dist/worker.cjs"
|
|
215
295
|
}
|
|
216
296
|
},
|
|
297
|
+
"./telemetry": {
|
|
298
|
+
"import": {
|
|
299
|
+
"types": "./dist/telemetry.d.mts",
|
|
300
|
+
"default": "./dist/telemetry.mjs"
|
|
301
|
+
},
|
|
302
|
+
"require": {
|
|
303
|
+
"types": "./dist/telemetry.d.cts",
|
|
304
|
+
"default": "./dist/telemetry.cjs"
|
|
305
|
+
}
|
|
306
|
+
},
|
|
217
307
|
"./database/kysely": {
|
|
218
308
|
"import": {
|
|
219
309
|
"types": "./dist/database/kysely.d.mts",
|
|
@@ -237,68 +327,79 @@
|
|
|
237
327
|
"access": "public"
|
|
238
328
|
},
|
|
239
329
|
"dependencies": {
|
|
330
|
+
"@opentelemetry/api": "~1.9.1",
|
|
331
|
+
"cron-parser": "~5.10.1",
|
|
240
332
|
"fast-glob": "~3.3.3",
|
|
241
333
|
"lodash.compact": "~3.0.1",
|
|
242
334
|
"lodash.get": "~4.4.2",
|
|
243
|
-
"lodash.pick": "~4.4.0",
|
|
244
|
-
"lodash.set": "~4.3.2",
|
|
245
335
|
"lodash.uniqby": "~4.7.0",
|
|
246
336
|
"openapi-types": "~12.1.3",
|
|
247
337
|
"qs": "~6.16.0",
|
|
248
|
-
"@geekmidas/envkit": "^10.0.0-alpha.
|
|
249
|
-
"@geekmidas/errors": "^10.0.0-alpha.
|
|
250
|
-
"@geekmidas/events": "^10.0.0-alpha.
|
|
251
|
-
"@geekmidas/logger": "^10.0.0-alpha.
|
|
252
|
-
"@geekmidas/manifest": "^10.0.0-alpha.
|
|
253
|
-
"@geekmidas/schema": "^10.0.0-alpha.
|
|
254
|
-
"@geekmidas/services": "^10.0.0-alpha.
|
|
338
|
+
"@geekmidas/envkit": "^10.0.0-alpha.140",
|
|
339
|
+
"@geekmidas/errors": "^10.0.0-alpha.140",
|
|
340
|
+
"@geekmidas/events": "^10.0.0-alpha.140",
|
|
341
|
+
"@geekmidas/logger": "^10.0.0-alpha.140",
|
|
342
|
+
"@geekmidas/manifest": "^10.0.0-alpha.140",
|
|
343
|
+
"@geekmidas/schema": "^10.0.0-alpha.140",
|
|
344
|
+
"@geekmidas/services": "^10.0.0-alpha.140"
|
|
255
345
|
},
|
|
256
346
|
"devDependencies": {
|
|
347
|
+
"@aws-sdk/client-kms": "~3.1136.0",
|
|
348
|
+
"@better-auth/expo": "~1.7.6",
|
|
349
|
+
"@opentelemetry/sdk-trace-node": "~2.11.0",
|
|
257
350
|
"@types/lodash.compact": "~3.0.9",
|
|
258
351
|
"@types/lodash.get": "~4.4.9",
|
|
259
|
-
"@types/lodash.pick": "~4.4.9",
|
|
260
|
-
"@types/lodash.set": "~4.3.9",
|
|
261
352
|
"@types/lodash.uniqby": "~4.7.9",
|
|
262
353
|
"@types/pg": "~8.23.1",
|
|
263
354
|
"@types/qs": "~6.15.1",
|
|
355
|
+
"@types/ws": "~8.18.1",
|
|
264
356
|
"better-auth": "~1.7.6",
|
|
357
|
+
"ioredis": "~6.0.0",
|
|
265
358
|
"kysely": "~0.29.6",
|
|
266
359
|
"msw": "~2.15.0",
|
|
267
360
|
"pg": "~8.23.0",
|
|
361
|
+
"ws": "~8.22.0",
|
|
268
362
|
"zod": "~4.6.5",
|
|
269
|
-
"@geekmidas/audit": "^10.0.0-alpha.
|
|
270
|
-
"@geekmidas/auth": "10.0.0-alpha.
|
|
271
|
-
"@geekmidas/cache": "^10.0.0-alpha.
|
|
272
|
-
"@geekmidas/db": "^10.0.0-alpha.
|
|
273
|
-
"@geekmidas/emailkit": "^10.0.0-alpha.
|
|
274
|
-
"@geekmidas/envkit": "^10.0.0-alpha.
|
|
275
|
-
"@geekmidas/errors": "^10.0.0-alpha.
|
|
276
|
-
"@geekmidas/events": "^10.0.0-alpha.
|
|
277
|
-
"@geekmidas/logger": "^10.0.0-alpha.
|
|
278
|
-
"@geekmidas/rate-limit": "^10.0.0-alpha.
|
|
279
|
-
"@geekmidas/schema": "^10.0.0-alpha.
|
|
280
|
-
"@geekmidas/services": "^10.0.0-alpha.
|
|
281
|
-
"@geekmidas/telescope": "10.0.0-alpha.
|
|
282
|
-
"@geekmidas/testkit": "^10.0.0-alpha.
|
|
363
|
+
"@geekmidas/audit": "^10.0.0-alpha.140",
|
|
364
|
+
"@geekmidas/auth": "10.0.0-alpha.140",
|
|
365
|
+
"@geekmidas/cache": "^10.0.0-alpha.140",
|
|
366
|
+
"@geekmidas/db": "^10.0.0-alpha.140",
|
|
367
|
+
"@geekmidas/emailkit": "^10.0.0-alpha.140",
|
|
368
|
+
"@geekmidas/envkit": "^10.0.0-alpha.140",
|
|
369
|
+
"@geekmidas/errors": "^10.0.0-alpha.140",
|
|
370
|
+
"@geekmidas/events": "^10.0.0-alpha.140",
|
|
371
|
+
"@geekmidas/logger": "^10.0.0-alpha.140",
|
|
372
|
+
"@geekmidas/rate-limit": "^10.0.0-alpha.140",
|
|
373
|
+
"@geekmidas/schema": "^10.0.0-alpha.140",
|
|
374
|
+
"@geekmidas/services": "^10.0.0-alpha.140",
|
|
375
|
+
"@geekmidas/telescope": "10.0.0-alpha.140",
|
|
376
|
+
"@geekmidas/testkit": "^10.0.0-alpha.140"
|
|
283
377
|
},
|
|
284
378
|
"peerDependencies": {
|
|
379
|
+
"@aws-sdk/client-kms": ">=3.1136.0",
|
|
285
380
|
"@middy/core": ">=7.9.2",
|
|
286
381
|
"@types/aws-lambda": ">=8.10.163",
|
|
287
382
|
"better-auth": ">=1.7.5",
|
|
288
383
|
"hono": ">=4.13.8",
|
|
384
|
+
"ioredis": ">=6.0.0",
|
|
289
385
|
"kysely": "~0.29.6",
|
|
290
386
|
"msw": ">=2.15.0",
|
|
291
387
|
"pg": ">=8.23.0",
|
|
292
|
-
"
|
|
293
|
-
"@geekmidas/
|
|
294
|
-
"@geekmidas/
|
|
295
|
-
"@geekmidas/
|
|
296
|
-
"@geekmidas/
|
|
297
|
-
"@geekmidas/
|
|
298
|
-
"@geekmidas/
|
|
299
|
-
"@geekmidas/
|
|
388
|
+
"ws": ">=8.22.0",
|
|
389
|
+
"@geekmidas/audit": "^10.0.0-alpha.140",
|
|
390
|
+
"@geekmidas/auth": "10.0.0-alpha.140",
|
|
391
|
+
"@geekmidas/cache": "^10.0.0-alpha.140",
|
|
392
|
+
"@geekmidas/db": "^10.0.0-alpha.140",
|
|
393
|
+
"@geekmidas/emailkit": "^10.0.0-alpha.140",
|
|
394
|
+
"@geekmidas/rate-limit": "^10.0.0-alpha.140",
|
|
395
|
+
"@geekmidas/storage": "^10.0.0-alpha.140",
|
|
396
|
+
"@geekmidas/telescope": "10.0.0-alpha.140",
|
|
397
|
+
"@geekmidas/testkit": "^10.0.0-alpha.140"
|
|
300
398
|
},
|
|
301
399
|
"peerDependenciesMeta": {
|
|
400
|
+
"@aws-sdk/client-kms": {
|
|
401
|
+
"optional": true
|
|
402
|
+
},
|
|
302
403
|
"@geekmidas/audit": {
|
|
303
404
|
"optional": true
|
|
304
405
|
},
|
|
@@ -308,41 +409,51 @@
|
|
|
308
409
|
"@geekmidas/db": {
|
|
309
410
|
"optional": true
|
|
310
411
|
},
|
|
412
|
+
"@geekmidas/emailkit": {
|
|
413
|
+
"optional": true
|
|
414
|
+
},
|
|
311
415
|
"@geekmidas/rate-limit": {
|
|
312
416
|
"optional": true
|
|
313
417
|
},
|
|
418
|
+
"@geekmidas/storage": {
|
|
419
|
+
"optional": true
|
|
420
|
+
},
|
|
421
|
+
"@geekmidas/telescope": {
|
|
422
|
+
"optional": true
|
|
423
|
+
},
|
|
424
|
+
"@geekmidas/testkit": {
|
|
425
|
+
"optional": true
|
|
426
|
+
},
|
|
314
427
|
"@middy/core": {
|
|
315
428
|
"optional": true
|
|
316
429
|
},
|
|
317
430
|
"@types/aws-lambda": {
|
|
318
431
|
"optional": true
|
|
319
432
|
},
|
|
320
|
-
"
|
|
433
|
+
"better-auth": {
|
|
321
434
|
"optional": true
|
|
322
435
|
},
|
|
323
|
-
"
|
|
436
|
+
"hono": {
|
|
324
437
|
"optional": true
|
|
325
438
|
},
|
|
326
|
-
"
|
|
439
|
+
"ioredis": {
|
|
327
440
|
"optional": true
|
|
328
441
|
},
|
|
329
442
|
"kysely": {
|
|
330
443
|
"optional": true
|
|
331
444
|
},
|
|
332
|
-
"
|
|
333
|
-
"optional": true
|
|
334
|
-
},
|
|
335
|
-
"@geekmidas/emailkit": {
|
|
445
|
+
"msw": {
|
|
336
446
|
"optional": true
|
|
337
447
|
},
|
|
338
|
-
"
|
|
448
|
+
"pg": {
|
|
339
449
|
"optional": true
|
|
340
450
|
},
|
|
341
|
-
"
|
|
451
|
+
"ws": {
|
|
342
452
|
"optional": true
|
|
343
453
|
}
|
|
344
454
|
},
|
|
345
455
|
"scripts": {
|
|
346
|
-
"ts": "tsc --noEmit --skipLibCheck src/**/*.ts"
|
|
456
|
+
"ts": "tsc --noEmit --skipLibCheck src/**/*.ts",
|
|
457
|
+
"build": "tsdown --config ../../tsdown.config.ts --filter ."
|
|
347
458
|
}
|
|
348
459
|
}
|