gemi 0.45.0 → 0.50.0-rc.2
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/dist/app/App.d.ts +1 -1
- package/dist/app/App.d.ts.map +1 -1
- package/dist/app/index.js +2 -2
- package/dist/app/index.js.map +1 -1
- package/dist/auth/AuthController.d.ts +107 -0
- package/dist/auth/AuthController.d.ts.map +1 -0
- package/dist/auth/{AuthenticationServiceContainer.d.ts → AuthManager.d.ts} +12 -7
- package/dist/auth/AuthManager.d.ts.map +1 -0
- package/dist/auth/AuthServiceProvider.d.ts +5 -0
- package/dist/auth/AuthServiceProvider.d.ts.map +1 -0
- package/dist/auth/config.d.ts +32 -0
- package/dist/auth/config.d.ts.map +1 -0
- package/dist/auth/requests.d.ts +24 -0
- package/dist/auth/requests.d.ts.map +1 -0
- package/dist/auth/{AuthenticationServiceProvider.d.ts → routes.d.ts} +3 -33
- package/dist/auth/routes.d.ts.map +1 -0
- package/dist/bin/gemi.js +19631 -51226
- package/dist/bin/gemi.js.map +10 -74
- package/dist/bin/migrate/classBody.d.ts +31 -0
- package/dist/bin/migrate/classBody.d.ts.map +1 -0
- package/dist/bin/migrate/imports.d.ts +37 -0
- package/dist/bin/migrate/imports.d.ts.map +1 -0
- package/dist/bin/migrate/index.d.ts +6 -0
- package/dist/bin/migrate/index.d.ts.map +1 -0
- package/dist/bin/migrate/lex.d.ts +23 -0
- package/dist/bin/migrate/lex.d.ts.map +1 -0
- package/dist/bin/migrate/tables.d.ts +38 -0
- package/dist/bin/migrate/tables.d.ts.map +1 -0
- package/dist/broadcasting/index.js +1 -1
- package/dist/bun/plugin.js +2 -2
- package/dist/bun/plugin.js.map +1 -1
- package/dist/bun/preload.js +2 -2
- package/dist/bun/preload.js.map +1 -1
- package/dist/chunk-01gbjyc5.js +4 -0
- package/dist/{chunk-tyjhatbq.js.map → chunk-01gbjyc5.js.map} +2 -2
- package/dist/chunk-0e8313cy.js +5 -0
- package/dist/{chunk-b0ca3dzf.js.map → chunk-0e8313cy.js.map} +2 -2
- package/dist/chunk-0g7fds80.js +4 -0
- package/dist/{chunk-8jns0zmx.js.map → chunk-0g7fds80.js.map} +2 -2
- package/dist/{chunk-snp18f2m.js → chunk-0j1vfxj7.js} +3 -3
- package/dist/{chunk-snp18f2m.js.map → chunk-0j1vfxj7.js.map} +1 -1
- package/dist/chunk-0j8rgg32.js +4 -0
- package/dist/{chunk-atv6nybp.js.map → chunk-0j8rgg32.js.map} +16 -8
- package/dist/chunk-1jzj2t3t.js +5 -0
- package/dist/chunk-1jzj2t3t.js.map +10 -0
- package/dist/{chunk-4k7p344e.js → chunk-2mza564z.js} +2 -2
- package/dist/{chunk-4k7p344e.js.map → chunk-2mza564z.js.map} +1 -1
- package/dist/{chunk-n4wrg0sn.js → chunk-4a47a3tt.js} +3 -3
- package/dist/{chunk-f18weffa.js.map → chunk-4a47a3tt.js.map} +1 -1
- package/dist/chunk-4b8kjq68.js +5 -0
- package/dist/chunk-4b8kjq68.js.map +10 -0
- package/dist/chunk-4y8vkbtw.js +34 -0
- package/dist/chunk-4y8vkbtw.js.map +242 -0
- package/dist/chunk-563jg281.js +5 -0
- package/dist/chunk-563jg281.js.map +11 -0
- package/dist/chunk-5em8db18.js +5 -0
- package/dist/chunk-5em8db18.js.map +10 -0
- package/dist/{chunk-1nkxmecw.js → chunk-5f88sbt2.js} +3 -3
- package/dist/{chunk-1nkxmecw.js.map → chunk-5f88sbt2.js.map} +1 -1
- package/dist/{chunk-6av6dnxx.js → chunk-64smn3fn.js} +2 -2
- package/dist/{chunk-6av6dnxx.js.map → chunk-64smn3fn.js.map} +2 -2
- package/dist/{chunk-w54fj10r.js → chunk-6q2xys8x.js} +1 -1
- package/dist/chunk-7hh953xm.js +5 -0
- package/dist/chunk-7hh953xm.js.map +10 -0
- package/dist/chunk-7w6qsfm3.js +5 -0
- package/dist/chunk-7w6qsfm3.js.map +10 -0
- package/dist/{chunk-a3bmbfn3.js → chunk-9eg4q6hm.js} +2 -2
- package/dist/{chunk-a3bmbfn3.js.map → chunk-9eg4q6hm.js.map} +1 -1
- package/dist/{chunk-2a4ze3n3.js → chunk-a0hk8r8n.js} +3 -3
- package/dist/{chunk-2a4ze3n3.js.map → chunk-a0hk8r8n.js.map} +1 -1
- package/dist/{chunk-jrnbyhgq.js → chunk-ctffrrx4.js} +4 -4
- package/dist/{chunk-jrnbyhgq.js.map → chunk-ctffrrx4.js.map} +1 -1
- package/dist/{chunk-vpqq7v9e.js → chunk-eq02jfj2.js} +2 -2
- package/dist/{chunk-vpqq7v9e.js.map → chunk-eq02jfj2.js.map} +1 -1
- package/dist/chunk-g250akbq.js +4 -0
- package/dist/chunk-g250akbq.js.map +13 -0
- package/dist/{chunk-wtydwxgg.js → chunk-g7tytfm9.js} +3 -3
- package/dist/{chunk-wtydwxgg.js.map → chunk-g7tytfm9.js.map} +1 -1
- package/dist/chunk-h3b5b2rm.js +4 -0
- package/dist/{chunk-wed042aw.js.map → chunk-h3b5b2rm.js.map} +2 -2
- package/dist/{chunk-2cew23ww.js → chunk-jek07yr8.js} +3 -3
- package/dist/{chunk-2cew23ww.js.map → chunk-jek07yr8.js.map} +1 -1
- package/dist/chunk-jzqeb93s.js +4 -0
- package/dist/{chunk-2pazt3hc.js.map → chunk-jzqeb93s.js.map} +2 -2
- package/dist/chunk-k0rg0bh0.js +5 -0
- package/dist/chunk-k0rg0bh0.js.map +10 -0
- package/dist/chunk-k1xs9cjj.js +5 -0
- package/dist/chunk-k1xs9cjj.js.map +12 -0
- package/dist/{chunk-396qq8ge.js → chunk-kpzrdjqs.js} +2 -2
- package/dist/{chunk-396qq8ge.js.map → chunk-kpzrdjqs.js.map} +3 -3
- package/dist/{chunk-sv4v623e.js → chunk-ktdrrvqm.js} +3 -3
- package/dist/{chunk-sv4v623e.js.map → chunk-ktdrrvqm.js.map} +1 -1
- package/dist/chunk-m4nm4zy6.js +5 -0
- package/dist/{chunk-7bggj8g7.js.map → chunk-m4nm4zy6.js.map} +2 -2
- package/dist/{chunk-f18weffa.js → chunk-n5q0gwd9.js} +2 -2
- package/dist/{chunk-n4wrg0sn.js.map → chunk-n5q0gwd9.js.map} +1 -1
- package/dist/chunk-pda081kg.js +4 -0
- package/dist/{chunk-y4q11zr2.js.map → chunk-pda081kg.js.map} +2 -2
- package/dist/chunk-qb70bkja.js +4 -0
- package/dist/{chunk-vh6dnbty.js.map → chunk-qb70bkja.js.map} +2 -2
- package/dist/chunk-qwy7b1v6.js +5 -0
- package/dist/{chunk-tjzbw6eg.js.map → chunk-qwy7b1v6.js.map} +2 -2
- package/dist/chunk-sqafdycr.js +23 -0
- package/dist/chunk-sqafdycr.js.map +33 -0
- package/dist/{chunk-0r110r6m.js → chunk-t9ydh7x3.js} +3 -3
- package/dist/{chunk-0r110r6m.js.map → chunk-t9ydh7x3.js.map} +1 -1
- package/dist/chunk-vvp2dr94.js +5 -0
- package/dist/chunk-vvp2dr94.js.map +12 -0
- package/dist/{chunk-mped4eh6.js → chunk-w7kvrp0q.js} +4 -4
- package/dist/{chunk-mped4eh6.js.map → chunk-w7kvrp0q.js.map} +1 -1
- package/dist/{chunk-wjhh4pf0.js → chunk-wqzg9229.js} +3 -3
- package/dist/{chunk-wjhh4pf0.js.map → chunk-wqzg9229.js.map} +1 -1
- package/dist/{chunk-27tkdqp6.js → chunk-xdsjdz4a.js} +4 -4
- package/dist/{chunk-27tkdqp6.js.map → chunk-xdsjdz4a.js.map} +2 -2
- package/dist/chunk-xvfy2e73.js +4 -0
- package/dist/{chunk-ww5vyb4s.js.map → chunk-xvfy2e73.js.map} +2 -2
- package/dist/chunk-xvr6bezx.js +6 -0
- package/dist/{chunk-tvp3xgfq.js.map → chunk-xvr6bezx.js.map} +2 -2
- package/dist/{chunk-cmnhs4mh.js → chunk-y1h1tf4f.js} +3 -3
- package/dist/{chunk-cmnhs4mh.js.map → chunk-y1h1tf4f.js.map} +1 -1
- package/dist/chunk-ya4rt5nk.js +79 -0
- package/dist/{chunk-jxpwexpz.js.map → chunk-ya4rt5nk.js.map} +33 -24
- package/dist/chunk-ye31dsgf.js +5 -0
- package/dist/chunk-ye31dsgf.js.map +11 -0
- package/dist/chunk-z78ksnx2.js +5 -0
- package/dist/chunk-z78ksnx2.js.map +10 -0
- package/dist/chunk-zx3ypgvw.js +4 -0
- package/dist/{chunk-yyn0qk1w.js.map → chunk-zx3ypgvw.js.map} +1 -1
- package/dist/client/rpc.d.ts +1 -1
- package/dist/client/rpc.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/container/Container.d.ts +33 -0
- package/dist/container/Container.d.ts.map +1 -0
- package/dist/container/index.d.ts +2 -0
- package/dist/container/index.d.ts.map +1 -0
- package/dist/container/index.js +4 -0
- package/dist/container/index.js.map +9 -0
- package/dist/database/DatabaseManager.d.ts +14 -0
- package/dist/database/DatabaseManager.d.ts.map +1 -0
- package/dist/database/DatabaseServiceProvider.d.ts +5 -0
- package/dist/database/DatabaseServiceProvider.d.ts.map +1 -0
- package/dist/database/config.d.ts +11 -0
- package/dist/database/config.d.ts.map +1 -0
- package/dist/database/dialect.d.ts +11 -0
- package/dist/database/dialect.d.ts.map +1 -0
- package/dist/database/index.d.ts +5 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/index.js +4 -0
- package/dist/database/index.js.map +9 -0
- package/dist/email/Email.d.ts.map +1 -1
- package/dist/email/index.js +3 -3
- package/dist/email/index.js.map +3 -3
- package/dist/facades/Auth.d.ts +4 -1
- package/dist/facades/Auth.d.ts.map +1 -1
- package/dist/facades/Broadcast.d.ts +4 -1
- package/dist/facades/Broadcast.d.ts.map +1 -1
- package/dist/facades/DB.d.ts +12 -0
- package/dist/facades/DB.d.ts.map +1 -0
- package/dist/facades/Facade.d.ts +29 -0
- package/dist/facades/Facade.d.ts.map +1 -0
- package/dist/facades/Lang.d.ts +10 -0
- package/dist/facades/Lang.d.ts.map +1 -0
- package/dist/facades/Log.d.ts +4 -1
- package/dist/facades/Log.d.ts.map +1 -1
- package/dist/facades/Prefetch.d.ts +4 -1
- package/dist/facades/Prefetch.d.ts.map +1 -1
- package/dist/facades/RateLimiter.d.ts +4 -2
- package/dist/facades/RateLimiter.d.ts.map +1 -1
- package/dist/facades/Redis.d.ts +4 -1
- package/dist/facades/Redis.d.ts.map +1 -1
- package/dist/facades/{FileStorage.d.ts → Storage.d.ts} +5 -2
- package/dist/facades/Storage.d.ts.map +1 -0
- package/dist/facades/index.d.ts +4 -2
- package/dist/facades/index.d.ts.map +1 -1
- package/dist/facades/index.js +2 -2
- package/dist/facades/index.js.map +1 -1
- package/dist/foundation/Application.d.ts +44 -0
- package/dist/foundation/Application.d.ts.map +1 -0
- package/dist/foundation/app.d.ts +15 -0
- package/dist/foundation/app.d.ts.map +1 -0
- package/dist/foundation/index.d.ts +3 -0
- package/dist/foundation/index.d.ts.map +1 -0
- package/dist/foundation/index.js +4 -0
- package/dist/foundation/index.js.map +9 -0
- package/dist/http/AuthenticationMiddlware.d.ts.map +1 -1
- package/dist/http/RateLimitMiddleware.d.ts.map +1 -1
- package/dist/http/index.d.ts +1 -1
- package/dist/http/index.d.ts.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/http/middleware-config.d.ts +8 -0
- package/dist/http/middleware-config.d.ts.map +1 -0
- package/dist/i18n/I18nRouter.d.ts.map +1 -1
- package/dist/i18n/TranslationServiceProvider.d.ts +5 -0
- package/dist/i18n/TranslationServiceProvider.d.ts.map +1 -0
- package/dist/i18n/Translator.d.ts +17 -0
- package/dist/i18n/Translator.d.ts.map +1 -0
- package/dist/i18n/config.d.ts +13 -0
- package/dist/i18n/config.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +3 -1
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +3 -3
- package/dist/kernel/Kernel.d.ts +46 -33
- package/dist/kernel/Kernel.d.ts.map +1 -1
- package/dist/kernel/KernelContext.d.ts.map +1 -1
- package/dist/kernel/index.d.ts +1 -1
- package/dist/kernel/index.d.ts.map +1 -1
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +5 -7
- package/dist/kernel/providers.d.ts +11 -0
- package/dist/kernel/providers.d.ts.map +1 -0
- package/dist/server/Server.d.ts.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +3 -3
- package/dist/services/cron/ScheduleServiceProvider.d.ts +12 -0
- package/dist/services/cron/ScheduleServiceProvider.d.ts.map +1 -0
- package/dist/services/cron/Scheduler.d.ts +22 -0
- package/dist/services/cron/Scheduler.d.ts.map +1 -0
- package/dist/services/cron/config.d.ts +7 -0
- package/dist/services/cron/config.d.ts.map +1 -0
- package/dist/services/email/MailManager.d.ts +13 -0
- package/dist/services/email/MailManager.d.ts.map +1 -0
- package/dist/services/email/MailServiceProvider.d.ts +5 -0
- package/dist/services/email/MailServiceProvider.d.ts.map +1 -0
- package/dist/services/email/config.d.ts +9 -0
- package/dist/services/email/config.d.ts.map +1 -0
- package/dist/services/file-storage/FilesystemManager.d.ts +8 -0
- package/dist/services/file-storage/FilesystemManager.d.ts.map +1 -0
- package/dist/services/file-storage/FilesystemServiceProvider.d.ts +5 -0
- package/dist/services/file-storage/FilesystemServiceProvider.d.ts.map +1 -0
- package/dist/services/file-storage/config.d.ts +7 -0
- package/dist/services/file-storage/config.d.ts.map +1 -0
- package/dist/services/image-optimization/ImageManager.d.ts +16 -0
- package/dist/services/image-optimization/ImageManager.d.ts.map +1 -0
- package/dist/services/image-optimization/ImageServiceProvider.d.ts +5 -0
- package/dist/services/image-optimization/ImageServiceProvider.d.ts.map +1 -0
- package/dist/services/image-optimization/config.d.ts +7 -0
- package/dist/services/image-optimization/config.d.ts.map +1 -0
- package/dist/services/index.d.ts +37 -10
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +44 -2
- package/dist/services/index.js.map +159 -3
- package/dist/services/kernel-id/KernelId.d.ts +11 -0
- package/dist/services/kernel-id/KernelId.d.ts.map +1 -0
- package/dist/services/kernel-id/KernelIdServiceProvider.d.ts +2 -3
- package/dist/services/kernel-id/KernelIdServiceProvider.d.ts.map +1 -1
- package/dist/services/logging/LogManager.d.ts +28 -0
- package/dist/services/logging/LogManager.d.ts.map +1 -0
- package/dist/services/logging/LogServiceProvider.d.ts +13 -0
- package/dist/services/logging/LogServiceProvider.d.ts.map +1 -0
- package/dist/services/logging/LoggingRouter.d.ts.map +1 -1
- package/dist/services/logging/config.d.ts +9 -0
- package/dist/services/logging/config.d.ts.map +1 -0
- package/dist/services/middleware/MiddlewareRegistry.d.ts +11 -0
- package/dist/services/middleware/MiddlewareRegistry.d.ts.map +1 -0
- package/dist/services/middleware/MiddlewareServiceProvider.d.ts +5 -0
- package/dist/services/middleware/MiddlewareServiceProvider.d.ts.map +1 -0
- package/dist/services/pubsub/{BroadcastingServiceContainer.d.ts → BroadcastManager.d.ts} +7 -7
- package/dist/services/pubsub/BroadcastManager.d.ts.map +1 -0
- package/dist/services/pubsub/BroadcastServiceProvider.d.ts +5 -0
- package/dist/services/pubsub/BroadcastServiceProvider.d.ts.map +1 -0
- package/dist/services/pubsub/config.d.ts +7 -0
- package/dist/services/pubsub/config.d.ts.map +1 -0
- package/dist/services/queue/Job.d.ts.map +1 -1
- package/dist/services/queue/{QueueServiceContainer.d.ts → QueueManager.d.ts} +6 -7
- package/dist/services/queue/QueueManager.d.ts.map +1 -0
- package/dist/services/queue/QueueServiceProvider.d.ts +2 -5
- package/dist/services/queue/QueueServiceProvider.d.ts.map +1 -1
- package/dist/services/queue/config.d.ts +8 -0
- package/dist/services/queue/config.d.ts.map +1 -0
- package/dist/services/rate-limiter/{RateLimiterServiceContainer.d.ts → RateLimiter.d.ts} +10 -9
- package/dist/services/rate-limiter/RateLimiter.d.ts.map +1 -0
- package/dist/services/rate-limiter/RateLimiterServiceProvider.d.ts +2 -12
- package/dist/services/rate-limiter/RateLimiterServiceProvider.d.ts.map +1 -1
- package/dist/services/rate-limiter/config.d.ts +15 -0
- package/dist/services/rate-limiter/config.d.ts.map +1 -0
- package/dist/services/rate-limiter/drivers/RedisRateLimiterDriver.d.ts +6 -4
- package/dist/services/rate-limiter/drivers/RedisRateLimiterDriver.d.ts.map +1 -1
- package/dist/services/redis/RedisManager.d.ts +9 -0
- package/dist/services/redis/RedisManager.d.ts.map +1 -0
- package/dist/services/redis/RedisServiceProvider.d.ts +2 -5
- package/dist/services/redis/RedisServiceProvider.d.ts.map +1 -1
- package/dist/services/redis/config.d.ts +8 -0
- package/dist/services/redis/config.d.ts.map +1 -0
- package/dist/services/router/{ApiRouterServiceContainer.d.ts → ApiRouteDispatcher.d.ts} +8 -7
- package/dist/services/router/ApiRouteDispatcher.d.ts.map +1 -0
- package/dist/services/router/RouteServiceProvider.d.ts +18 -0
- package/dist/services/router/RouteServiceProvider.d.ts.map +1 -0
- package/dist/services/router/{ViewRouterServiceContainer.d.ts → ViewRouteDispatcher.d.ts} +6 -8
- package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -0
- package/dist/services/router/config.d.ts +25 -0
- package/dist/services/router/config.d.ts.map +1 -0
- package/dist/support/Repository.d.ts +15 -0
- package/dist/support/Repository.d.ts.map +1 -0
- package/dist/support/ServiceProvider.d.ts +13 -0
- package/dist/support/ServiceProvider.d.ts.map +1 -0
- package/dist/support/index.d.ts +5 -0
- package/dist/support/index.d.ts.map +1 -0
- package/dist/support/index.js +4 -0
- package/dist/support/index.js.map +10 -0
- package/dist/support/loadConfig.d.ts +4 -0
- package/dist/support/loadConfig.d.ts.map +1 -0
- package/dist/support/withDefaults.d.ts +13 -0
- package/dist/support/withDefaults.d.ts.map +1 -0
- package/package.json +5 -1
- package/dist/auth/AuthenticationServiceContainer.d.ts.map +0 -1
- package/dist/auth/AuthenticationServiceProvider.d.ts.map +0 -1
- package/dist/chunk-2pazt3hc.js +0 -4
- package/dist/chunk-4z53shav.js +0 -5
- package/dist/chunk-4z53shav.js.map +0 -15
- package/dist/chunk-63gmzy5r.js +0 -5
- package/dist/chunk-63gmzy5r.js.map +0 -12
- package/dist/chunk-7bggj8g7.js +0 -5
- package/dist/chunk-8jns0zmx.js +0 -4
- package/dist/chunk-atv6nybp.js +0 -4
- package/dist/chunk-b0ca3dzf.js +0 -5
- package/dist/chunk-jxpwexpz.js +0 -79
- package/dist/chunk-m0earq80.js +0 -5
- package/dist/chunk-m0earq80.js.map +0 -11
- package/dist/chunk-p5r0t9jh.js +0 -5
- package/dist/chunk-p5r0t9jh.js.map +0 -10
- package/dist/chunk-pf4r36w2.js +0 -5
- package/dist/chunk-pf4r36w2.js.map +0 -10
- package/dist/chunk-ppn0j67g.js +0 -4
- package/dist/chunk-ppn0j67g.js.map +0 -13
- package/dist/chunk-tjzbw6eg.js +0 -5
- package/dist/chunk-tvp3xgfq.js +0 -6
- package/dist/chunk-tyjhatbq.js +0 -4
- package/dist/chunk-v0qh5dqv.js +0 -75
- package/dist/chunk-v0qh5dqv.js.map +0 -416
- package/dist/chunk-vh6dnbty.js +0 -4
- package/dist/chunk-wed042aw.js +0 -4
- package/dist/chunk-ww5vyb4s.js +0 -4
- package/dist/chunk-xdk6y558.js +0 -5
- package/dist/chunk-xdk6y558.js.map +0 -10
- package/dist/chunk-xkrthw08.js +0 -23
- package/dist/chunk-xkrthw08.js.map +0 -10
- package/dist/chunk-y4q11zr2.js +0 -4
- package/dist/chunk-yyn0qk1w.js +0 -4
- package/dist/facades/FileStorage.d.ts.map +0 -1
- package/dist/facades/I18n.d.ts +0 -7
- package/dist/facades/I18n.d.ts.map +0 -1
- package/dist/http/MiddlewareServiceProvider.d.ts +0 -8
- package/dist/http/MiddlewareServiceProvider.d.ts.map +0 -1
- package/dist/i18n/I18nServiceContainer.d.ts +0 -13
- package/dist/i18n/I18nServiceContainer.d.ts.map +0 -1
- package/dist/i18n/I18nServiceProvider.d.ts +0 -13
- package/dist/i18n/I18nServiceProvider.d.ts.map +0 -1
- package/dist/services/ServiceContainer.d.ts +0 -7
- package/dist/services/ServiceContainer.d.ts.map +0 -1
- package/dist/services/ServiceProvider.d.ts +0 -4
- package/dist/services/ServiceProvider.d.ts.map +0 -1
- package/dist/services/Singleton.d.ts +0 -4
- package/dist/services/Singleton.d.ts.map +0 -1
- package/dist/services/cron/CronServiceContainer.d.ts +0 -13
- package/dist/services/cron/CronServiceContainer.d.ts.map +0 -1
- package/dist/services/cron/CronServiceProvider.d.ts +0 -10
- package/dist/services/cron/CronServiceProvider.d.ts.map +0 -1
- package/dist/services/email/EmailServiceContainer.d.ts +0 -8
- package/dist/services/email/EmailServiceContainer.d.ts.map +0 -1
- package/dist/services/email/EmailServiceProvider.d.ts +0 -9
- package/dist/services/email/EmailServiceProvider.d.ts.map +0 -1
- package/dist/services/file-storage/FileStorageServiceContainer.d.ts +0 -8
- package/dist/services/file-storage/FileStorageServiceContainer.d.ts.map +0 -1
- package/dist/services/file-storage/FileStorageServiceProvider.d.ts +0 -7
- package/dist/services/file-storage/FileStorageServiceProvider.d.ts.map +0 -1
- package/dist/services/image-optimization/ImageOptimizationServiceContainer.d.ts +0 -14
- package/dist/services/image-optimization/ImageOptimizationServiceContainer.d.ts.map +0 -1
- package/dist/services/image-optimization/ImageOptimizationServiceProvider.d.ts +0 -7
- package/dist/services/image-optimization/ImageOptimizationServiceProvider.d.ts.map +0 -1
- package/dist/services/kernel-id/KernelIdServiceContainer.d.ts +0 -8
- package/dist/services/kernel-id/KernelIdServiceContainer.d.ts.map +0 -1
- package/dist/services/logging/LoggingServiceContainer.d.ts +0 -22
- package/dist/services/logging/LoggingServiceContainer.d.ts.map +0 -1
- package/dist/services/logging/LoggingServiceProvider.d.ts +0 -9
- package/dist/services/logging/LoggingServiceProvider.d.ts.map +0 -1
- package/dist/services/middleware/MiddlewareServiceContainer.d.ts +0 -10
- package/dist/services/middleware/MiddlewareServiceContainer.d.ts.map +0 -1
- package/dist/services/pubsub/BroadcastingServiceContainer.d.ts.map +0 -1
- package/dist/services/pubsub/BroadcastingServiceProvider.d.ts +0 -7
- package/dist/services/pubsub/BroadcastingServiceProvider.d.ts.map +0 -1
- package/dist/services/queue/QueueServiceContainer.d.ts.map +0 -1
- package/dist/services/rate-limiter/RateLimiterServiceContainer.d.ts.map +0 -1
- package/dist/services/redis/RedisServiceContainer.d.ts +0 -10
- package/dist/services/redis/RedisServiceContainer.d.ts.map +0 -1
- package/dist/services/router/ApiRouterServiceContainer.d.ts.map +0 -1
- package/dist/services/router/ApiRouterServiceProvider.d.ts +0 -11
- package/dist/services/router/ApiRouterServiceProvider.d.ts.map +0 -1
- package/dist/services/router/ViewRouterServiceContainer.d.ts.map +0 -1
- package/dist/services/router/ViewRouterServiceProvider.d.ts +0 -13
- package/dist/services/router/ViewRouterServiceProvider.d.ts.map +0 -1
- package/dist/services/singleton/SingletonServiceContainer.d.ts +0 -8
- package/dist/services/singleton/SingletonServiceContainer.d.ts.map +0 -1
- package/dist/services/singleton/SingletonServiceProvider.d.ts +0 -7
- package/dist/services/singleton/SingletonServiceProvider.d.ts.map +0 -1
- /package/dist/{chunk-w54fj10r.js.map → chunk-6q2xys8x.js.map} +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../services/cron/Scheduler.ts", "../services/queue/config.ts", "../services/queue/QueueManager.ts", "../auth/AuthServiceProvider.ts", "../services/cron/config.ts", "../services/cron/ScheduleServiceProvider.ts", "../services/email/MailServiceProvider.ts", "../services/file-storage/FilesystemServiceProvider.ts", "../services/image-optimization/ImageServiceProvider.ts", "../services/kernel-id/KernelIdServiceProvider.ts", "../services/logging/config.ts", "../services/logging/LogServiceProvider.ts", "../services/middleware/MiddlewareServiceProvider.ts", "../services/pubsub/config.ts", "../services/pubsub/BroadcastServiceProvider.ts", "../services/queue/QueueServiceProvider.ts", "../services/rate-limiter/drivers/RateLimiterDriver.ts", "../services/rate-limiter/slidingWindow.ts", "../services/rate-limiter/drivers/InMemoryRateLimiterDriver.ts", "../services/rate-limiter/config.ts", "../services/rate-limiter/RateLimiterServiceProvider.ts", "../services/redis/config.ts", "../services/redis/RedisServiceProvider.ts", "../services/router/RouteServiceProvider.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type { ScheduleConfig } from \"./config\";\n\n// The handle the in-process `Bun.cron(schedule, callback)` overload returns\n// (has `.stop()`). `ReturnType<typeof Bun.cron>` can't be used — it resolves to\n// the module-path overload's `Promise<void>` instead.\ntype BunCronHandle = Bun.CronJob;\n\n// Runs a tick inside whatever async context the framework needs, so a job body\n// can resolve services exactly like a request handler can.\nexport type ScheduleRunner = <T>(cb: () => T | Promise<T>) => Promise<T> | T;\n\ndeclare global {\n // Registered cron jobs keyed by name, kept on `globalThis` so it survives\n // `bun --hot` reloads. Re-registering a name stops the previous schedule\n // first, so a reload *updates* the job in place instead of stacking a\n // duplicate. (Bun also stops all in-process cron jobs before re-evaluating on\n // hot reload; this makes the intent explicit and covers any re-construction.)\n var __gemiCronJobs: Map<string, BunCronHandle> | undefined;\n}\n\nexport class Scheduler {\n static token = \"scheduler\";\n\n private handles: BunCronHandle[] = [];\n\n constructor(private config: Required<ScheduleConfig>) {}\n\n /**\n * Schedules every configured job. Called from `ScheduleServiceProvider.boot()`\n * — never from the constructor — so a job body may resolve any service the\n * container holds by the time it first ticks. That ordering is what replaced\n * the old `kernel.waitForBoot()` handshake.\n */\n start(run: ScheduleRunner = (cb) => cb()) {\n if (this.config.jobs.length === 0) {\n return;\n }\n\n const registry = (globalThis.__gemiCronJobs ??= new Map());\n\n for (const Job of this.config.jobs) {\n const job = new Job();\n if (!job.name) {\n console.error(`Cron job must have a name. Job: ${JSON.stringify(job)}`);\n continue;\n }\n if (!job.cron) {\n console.error(`Cron job must have an expression. Job: ${job.name}`);\n continue;\n }\n\n // Update in place: stop any schedule previously registered under this name\n // before re-registering, so a hot reload replaces rather than duplicates.\n registry.get(job.name)?.stop();\n\n const handle = Bun.cron(job.cron, () =>\n run(async () => {\n try {\n await job.onTick.call(job);\n } catch (error) {\n console.error(`Error executing cron job ${job.name}:`, error);\n }\n try {\n await job.callback.call(job);\n } catch (error) {\n console.error(`Error in cron job ${job.name}:`, error);\n }\n try {\n await job.onComplete.call(job);\n } catch (error) {\n console.error(`Error completing cron job ${job.name}:`, error);\n }\n }),\n );\n\n registry.set(job.name, handle);\n this.handles.push(handle);\n }\n }\n\n stop() {\n for (const handle of this.handles) {\n handle.stop();\n }\n this.handles = [];\n }\n}\n",
|
|
6
|
+
"import type { Job } from \"./Job\";\n\n// Config key: `queue`. Derived from `QueueServiceProvider`.\nexport interface QueueConfig {\n jobs?: Array<new () => Job>;\n concurrency?: number;\n}\n\nexport function defineQueueConfig(config: QueueConfig): QueueConfig {\n return config;\n}\n\nexport function queueConfigDefaults(): Required<QueueConfig> {\n return {\n jobs: [],\n concurrency: 1,\n };\n}\n",
|
|
7
|
+
"import { Job } from \"./Job\";\nimport { queueConfigDefaults, type QueueConfig } from \"./config\";\nimport { withDefaults } from \"../../support/withDefaults\";\n\nfunction createWorker() {\n const APP_DIR = process.env.APP_DIR;\n const ROOT_DIR = process.env.ROOT_DIR;\n\n const appPath =\n process.env.NODE_ENV === \"production\"\n ? `${ROOT_DIR}/dist/server/bootstrap.mjs`\n : `${APP_DIR}/bootstrap.ts`;\n\n const file = new File(\n [\n `\n import { app } from \"${appPath}\"\n self.onmessage = async (event) => {\n const clone = app.clone()\n let result = null;\n let error = null;\n try {\n result = clone.dispatchJob(event.data.jobName, event.data.args)\n } catch (err) {\n error = err\n }\n clone.destroy()\n if(error) {\n self.postMessage({error});\n } else {\n self.postMessage({result});\n }\n };\n `,\n ],\n \"worker.ts\",\n );\n const url = URL.createObjectURL(file);\n return new Worker(url);\n}\n\n// TODO: terminate worker after the job is done\nasync function runInWorker(jobName: string, args: string) {\n const worker = createWorker();\n worker.postMessage({ jobName, args });\n return await new Promise((resolve, reject) => {\n worker.onmessage = (e) => {\n const data = e.data;\n if (\"error\" in data) {\n reject(data.error);\n } else {\n resolve(data.result);\n }\n };\n });\n}\n\ntype JobDefinition = {\n class: string;\n args: string;\n createdAt: number;\n retries: number;\n};\n\nexport class QueueManager {\n static token = \"queue\";\n\n queue: Set<JobDefinition> = new Set();\n activeRunningJobsCount = 0;\n isRunning = false;\n jobs: Record<string, new () => Job> = {};\n\n readonly config: Required<QueueConfig>;\n\n constructor(config: QueueConfig = {}) {\n this.config = withDefaults(queueConfigDefaults(), config);\n this.jobs = Object.fromEntries(\n this.config.jobs.map((job) => [job.name, job]),\n );\n }\n\n dispatchJob(jobName: string, args: string) {\n if (this.jobs[jobName]) {\n const job = new this.jobs[jobName]();\n return job.run(JSON.parse(args));\n }\n }\n\n async next() {\n if (!this.isRunning) {\n this.isRunning = true;\n }\n\n if (this.activeRunningJobsCount >= this.config.concurrency) {\n await new Promise((resolve) => setTimeout(resolve, 1000));\n return this.next();\n }\n\n const jobDefinition = this.queue.values().next().value as JobDefinition;\n\n if (this.jobs[jobDefinition?.class]) {\n const { value } = this.queue.values().next();\n if (value) {\n this.queue.delete(value);\n }\n\n this.run(jobDefinition);\n }\n\n if (this.queue.size === 0) {\n this.isRunning = false;\n return;\n }\n\n await this.next();\n }\n\n private async run(jobDefinition: JobDefinition) {\n const Job = this.jobs[jobDefinition.class];\n const jobInstance = new Job();\n const args: any[] = JSON.parse(jobDefinition.args);\n\n this.activeRunningJobsCount++;\n\n try {\n const result = await (jobInstance.worker\n ? runInWorker(jobDefinition.class, jobDefinition.args)\n : jobInstance.run(...args));\n\n jobInstance.onSuccess(result, ...args);\n } catch (err) {\n jobInstance.onFail(err, ...args);\n if (jobDefinition.retries >= jobInstance.maxAttempts - 1) {\n jobInstance.onDeadletter(err, ...args);\n } else {\n this.push(Job, jobDefinition.args, jobDefinition.retries + 1);\n }\n }\n\n this.activeRunningJobsCount--;\n }\n\n push(job: new () => Job, args: string, retries = 0) {\n this.queue.add({\n class: job.name,\n args,\n createdAt: Date.now(),\n retries,\n });\n if (!this.isRunning) {\n this.next();\n }\n }\n}\n",
|
|
8
|
+
"import { ServiceProvider } from \"../support/ServiceProvider\";\nimport type { AuthConfig } from \"./config\";\nimport { AuthManager } from \"./AuthManager\";\n\nexport class AuthServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n AuthManager,\n () => new AuthManager(this.app.config.get<AuthConfig>(\"auth\", {})),\n );\n }\n}\n",
|
|
9
|
+
"import type { CronJob } from \"./CronJob\";\n\n// Config key: `schedule`. Consumed by `ScheduleServiceProvider`.\nexport interface ScheduleConfig {\n jobs?: Array<new () => CronJob>;\n}\n\nexport function defineScheduleConfig(config: ScheduleConfig): ScheduleConfig {\n return config;\n}\n\nexport function scheduleConfigDefaults(): Required<ScheduleConfig> {\n return {\n jobs: [],\n };\n}\n",
|
|
10
|
+
"import { kernelContext } from \"../../kernel/context\";\nimport { ServiceProvider } from \"../../support/ServiceProvider\";\nimport { withDefaults } from \"../../support/withDefaults\";\nimport { scheduleConfigDefaults, type ScheduleConfig } from \"./config\";\nimport { Scheduler } from \"./Scheduler\";\n\nexport class ScheduleServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n Scheduler,\n () =>\n new Scheduler(\n withDefaults(\n scheduleConfigDefaults(),\n this.app.config.get<ScheduleConfig>(\"schedule\", {}),\n ),\n ),\n );\n }\n\n /**\n * Cron jobs are scheduled in phase two, not in `register()`: a job body is\n * free to resolve any service, and by the time `boot()` runs every provider\n * has registered. Each tick re-enters the application context so the job sees\n * the same container a request handler would.\n */\n boot() {\n const app = this.app;\n this.app.make(Scheduler).start((cb) => kernelContext.run(app, cb));\n }\n}\n",
|
|
11
|
+
"import { ServiceProvider } from \"../../support/ServiceProvider\";\nimport type { MailConfig } from \"./config\";\nimport { MailManager } from \"./MailManager\";\n\nexport class MailServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n MailManager,\n () => new MailManager(this.app.config.get<MailConfig>(\"mail\", {})),\n );\n }\n}\n",
|
|
12
|
+
"import { ServiceProvider } from \"../../support/ServiceProvider\";\nimport type { FilesystemConfig } from \"./config\";\nimport { FilesystemManager } from \"./FilesystemManager\";\n\nexport class FilesystemServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n FilesystemManager,\n () =>\n new FilesystemManager(\n this.app.config.get<FilesystemConfig>(\"filesystem\", {}),\n ),\n );\n }\n}\n",
|
|
13
|
+
"import { ServiceProvider } from \"../../support/ServiceProvider\";\nimport type { ImageConfig } from \"./config\";\nimport { ImageManager } from \"./ImageManager\";\n\nexport class ImageServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n ImageManager,\n () => new ImageManager(this.app.config.get<ImageConfig>(\"image\", {})),\n );\n }\n}\n",
|
|
14
|
+
"import { ServiceProvider } from \"../../support/ServiceProvider\";\nimport { KernelId } from \"./KernelId\";\n\n// Config-less by nature: the id is generated per process, never declared.\nexport class KernelIdServiceProvider extends ServiceProvider {\n register() {\n this.app.instance(KernelId, new KernelId());\n }\n}\n",
|
|
15
|
+
"import type { LogEntry } from \"./types\";\n\n// Config key: `log`. Derived from `LoggingServiceProvider`.\nexport interface LogConfig {\n maxFileSize?: number;\n\n onLogFileClosed?: (file: File) => void | Promise<void>;\n onLogCreated?: (logEntry: LogEntry) => void | Promise<void>;\n}\n\nexport function defineLogConfig(config: LogConfig): LogConfig {\n return config;\n}\n\nexport function logConfigDefaults(): Required<LogConfig> {\n return {\n maxFileSize: 1024 * 1024 * 10, // 10MB\n onLogFileClosed: () => {},\n onLogCreated: () => {},\n };\n}\n",
|
|
16
|
+
"import { ServiceProvider } from \"../../support/ServiceProvider\";\nimport { withDefaults } from \"../../support/withDefaults\";\nimport { LogManager } from \"./LogManager\";\nimport { logConfigDefaults, type LogConfig } from \"./config\";\n\nexport class LogServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n LogManager,\n () =>\n new LogManager(\n withDefaults(\n logConfigDefaults(),\n this.app.config.get<LogConfig>(\"log\", {}),\n ),\n ),\n );\n }\n\n /**\n * The log directory is created once at kernel boot rather than on the first\n * `Log.info()`, which is what the old eagerly-constructed container did.\n * Resolving here is deliberate: it is the one service whose readiness is a\n * boot-time side effect, and paying for it lazily mid-request would add file\n * IO to whichever handler happened to log first.\n */\n async boot() {\n await this.app.make(LogManager).boot();\n }\n}\n",
|
|
17
|
+
"import {\n middlewareConfigDefaults,\n type MiddlewareConfig,\n} from \"../../http/middleware-config\";\nimport { ServiceProvider } from \"../../support/ServiceProvider\";\nimport { withDefaults } from \"../../support/withDefaults\";\nimport { MiddlewareRegistry } from \"./MiddlewareRegistry\";\n\nexport class MiddlewareServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n MiddlewareRegistry,\n () =>\n new MiddlewareRegistry(\n withDefaults(\n middlewareConfigDefaults(),\n this.app.config.get<MiddlewareConfig>(\"middleware\", {}),\n ),\n ),\n );\n }\n}\n",
|
|
18
|
+
"import type { BroadcastingChannel } from \"../../broadcasting/BroadcastingChannel\";\n\n// Config key: `broadcast`. Derived from `BroadcastingServiceProvider`.\nexport interface BroadcastConfig {\n channels?: Record<string, new () => BroadcastingChannel>;\n}\n\nexport function defineBroadcastConfig(\n config: BroadcastConfig,\n): BroadcastConfig {\n return config;\n}\n\nexport function broadcastConfigDefaults(): Required<BroadcastConfig> {\n return {\n channels: {},\n };\n}\n",
|
|
19
|
+
"import { ServiceProvider } from \"../../support/ServiceProvider\";\nimport { withDefaults } from \"../../support/withDefaults\";\nimport { BroadcastManager } from \"./BroadcastManager\";\nimport { broadcastConfigDefaults, type BroadcastConfig } from \"./config\";\n\nexport class BroadcastServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n BroadcastManager,\n () =>\n new BroadcastManager(\n withDefaults(\n broadcastConfigDefaults(),\n this.app.config.get<BroadcastConfig>(\"broadcast\", {}),\n ),\n ),\n );\n }\n}\n",
|
|
20
|
+
"import { ServiceProvider } from \"../../support/ServiceProvider\";\nimport type { QueueConfig } from \"./config\";\nimport { QueueManager } from \"./QueueManager\";\n\nexport class QueueServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n QueueManager,\n () => new QueueManager(this.app.config.get<QueueConfig>(\"queue\", {})),\n );\n }\n}\n",
|
|
21
|
+
"import type { ConsumeParams, RateLimitResult } from \"../types\";\n\nexport abstract class RateLimiterDriver {\n /**\n * Records one request against `params.key` and reports whether it fits.\n *\n * Implementations must decide *and* record atomically — two concurrent calls\n * for the same key may never both be told they were the last one that fit.\n *\n * May be sync or async: the in-memory driver answers immediately, a network\n * backed driver returns a promise. Callers always `await` the result.\n */\n abstract consume(\n params: ConsumeParams,\n ): Promise<RateLimitResult> | RateLimitResult;\n}\n",
|
|
22
|
+
"import type { RateLimitResult } from \"./types\";\n\n/**\n * The sliding-window-counter algorithm, shared by every driver.\n *\n * A fixed window is cheap but lets a client spend its whole budget at the end\n * of one window and again at the start of the next — twice the limit across a\n * window's worth of time. A true sliding log fixes that but has to keep a\n * timestamp per request.\n *\n * The counter variant keeps two integers per key (this window and the one\n * before it) and estimates usage by weighting the previous window by how much\n * of it still overlaps the trailing window:\n *\n * usage = previous * (window - elapsed) / window + current\n *\n * That is a ~0.003% error on real traffic and costs two integers per key, so\n * it is what the in-memory and Redis drivers both implement.\n */\n\n/** Epoch ms of the start of the window `now` falls into. */\nexport function windowStartFor(now: number, window: number) {\n return Math.floor(now / window) * window;\n}\n\n/** Weight of the previous window's count, from `1` down to `0`. */\nexport function previousWeight(elapsed: number, window: number) {\n if (window <= 0) return 0;\n return Math.min(1, Math.max(0, (window - elapsed) / window));\n}\n\n/** Estimated usage of the trailing `window` ending at `now`. */\nexport function estimateUsage(\n current: number,\n previous: number,\n elapsed: number,\n window: number,\n) {\n return previous * previousWeight(elapsed, window) + current;\n}\n\n/**\n * How long until a request costing `cost` would be admitted, in milliseconds.\n *\n * Solves the usage equation for `elapsed` instead of guessing: the caller gets\n * a `Retry-After` that lands the moment capacity actually frees up rather than\n * at the end of the window, which for a sliding window is usually far too late.\n */\nexport function timeUntilAllowed(params: {\n current: number;\n previous: number;\n elapsed: number;\n window: number;\n limit: number;\n cost: number;\n}) {\n const { current, previous, elapsed, window, limit, cost } = params;\n // Usage the bucket may sit at for this request to still fit.\n const budget = limit - cost;\n\n // The request can never fit, no matter how long the caller waits. Report a\n // full window rather than `Infinity` so a `Retry-After` header stays usable.\n if (budget < 0) return window;\n\n const remainingWindow = Math.max(0, window - elapsed);\n\n // Phase 1 — capacity frees up inside the current window as `previous` decays.\n if (previous > 0) {\n // previous * (window - e) / window + current = budget => solve for e\n const target = window * (1 - (budget - current) / previous);\n if (target <= window) {\n return Math.max(0, Math.ceil(target - elapsed));\n }\n }\n\n // Phase 2 — `current` alone is already over budget, so nothing frees up until\n // the window rolls and `current` becomes the decaying `previous`.\n if (current <= budget) return remainingWindow;\n if (current <= 0) return remainingWindow;\n\n const target = window * (1 - budget / current);\n return remainingWindow + Math.max(0, Math.ceil(target));\n}\n\n/**\n * Turns a driver's post-operation counters into the result the caller sees.\n * `current` and `previous` are the counts *after* an allowed request has been\n * recorded, so every driver reports the same numbers for the same state.\n */\nexport function buildResult(params: {\n allowed: boolean;\n current: number;\n previous: number;\n now: number;\n elapsed: number;\n window: number;\n limit: number;\n cost: number;\n}): RateLimitResult {\n const { allowed, current, previous, now, elapsed, window, limit, cost } =\n params;\n\n if (allowed) {\n const usage = estimateUsage(current, previous, elapsed, window);\n return {\n allowed: true,\n limit,\n remaining: Math.max(0, Math.floor(limit - usage)),\n resetAt: now - elapsed + window,\n retryAfter: 0,\n };\n }\n\n const retryAfter = timeUntilAllowed({\n current,\n previous,\n elapsed,\n window,\n limit,\n cost,\n });\n\n return {\n allowed: false,\n limit,\n remaining: 0,\n resetAt: now + retryAfter,\n retryAfter,\n };\n}\n",
|
|
23
|
+
"import { buildResult, estimateUsage, windowStartFor } from \"../slidingWindow\";\nimport type { ConsumeParams, RateLimitResult } from \"../types\";\nimport { RateLimiterDriver } from \"./RateLimiterDriver\";\n\ninterface Bucket {\n /** Window length this bucket was counted with, so config changes reset it. */\n window: number;\n windowStart: number;\n current: number;\n previous: number;\n}\n\nexport interface InMemoryRateLimiterOptions {\n /**\n * Hard cap on tracked keys. Reached only by traffic that never repeats a key\n * (spoofed `x-forwarded-for`, for instance); the map is swept of dead buckets\n * first and only then evicts live ones, oldest touched first.\n *\n * Defaults to 100k keys — a few MB, and far more than a single instance\n * legitimately sees inside one window.\n */\n maxKeys?: number;\n}\n\n/**\n * Per-process rate limiter. The default driver, and the right one for a single\n * instance or for development.\n *\n * State lives in this process only: with N instances behind a load balancer the\n * effective limit is N × the configured limit, and it resets on deploy. Point\n * the service provider at `RedisRateLimiter` once you run more than one.\n */\nexport class InMemoryRateLimiter extends RateLimiterDriver {\n private buckets = new Map<string, Bucket>();\n private maxKeys: number;\n\n constructor(options: InMemoryRateLimiterOptions = {}) {\n super();\n this.maxKeys = Math.max(1, options.maxKeys ?? 100_000);\n }\n\n consume(params: ConsumeParams): RateLimitResult {\n const { key, limit, window } = params;\n const cost = params.cost ?? 1;\n const now = Date.now();\n const windowStart = windowStartFor(now, window);\n const elapsed = now - windowStart;\n\n const bucket = this.roll(key, window, windowStart);\n const usage = estimateUsage(\n bucket.current,\n bucket.previous,\n elapsed,\n window,\n );\n const allowed = usage + cost <= limit;\n\n if (allowed) {\n bucket.current += cost;\n }\n\n // Re-inserting moves the key to the end of the iteration order, which is\n // what makes eviction least-recently-used rather than arbitrary.\n this.buckets.delete(key);\n this.buckets.set(key, bucket);\n if (this.buckets.size > this.maxKeys) {\n this.evict(now);\n }\n\n return buildResult({\n allowed,\n current: bucket.current,\n previous: bucket.previous,\n now,\n elapsed,\n window,\n limit,\n cost,\n });\n }\n\n /** Drops all counters. Mainly useful in tests. */\n clear() {\n this.buckets.clear();\n }\n\n /** Number of tracked keys. Exposed for tests and diagnostics. */\n get size() {\n return this.buckets.size;\n }\n\n /** Advances a bucket to `windowStart`, creating it when absent or stale. */\n private roll(key: string, window: number, windowStart: number): Bucket {\n const bucket = this.buckets.get(key);\n\n if (!bucket || bucket.window !== window) {\n return { window, windowStart, current: 0, previous: 0 };\n }\n\n if (bucket.windowStart === windowStart) {\n return bucket;\n }\n\n if (bucket.windowStart + window === windowStart) {\n bucket.previous = bucket.current;\n bucket.current = 0;\n bucket.windowStart = windowStart;\n return bucket;\n }\n\n // Idle for more than a full window: everything it held has decayed away.\n bucket.previous = 0;\n bucket.current = 0;\n bucket.windowStart = windowStart;\n return bucket;\n }\n\n private evict(now: number) {\n for (const [key, bucket] of this.buckets) {\n // Fully decayed — it would be reset on the next read anyway.\n if (now - bucket.windowStart >= bucket.window * 2) {\n this.buckets.delete(key);\n }\n }\n\n // Still over the cap, so the traffic is live rather than stale. Drop the\n // least recently touched keys; the worst case is that a client whose bucket\n // was dropped gets a fresh budget, which beats growing without bound.\n for (const key of this.buckets.keys()) {\n if (this.buckets.size <= this.maxKeys) break;\n this.buckets.delete(key);\n }\n }\n}\n",
|
|
24
|
+
"import { InMemoryRateLimiter } from \"./drivers/InMemoryRateLimiterDriver\";\nimport type { RateLimiterDriver } from \"./drivers/RateLimiterDriver\";\n\n// Config key: `ratelimiter`. Derived from `RateLimiterServiceProvider`.\nexport interface RateLimiterConfig {\n /**\n * Where counters live. In-process by default; swap in `RedisRateLimiter` once\n * the app runs on more than one instance.\n */\n driver?: RateLimiterDriver;\n\n /** Requests allowed per window when the `rate-limit` DSL omits a limit. */\n limit?: number;\n\n /** Window length in **seconds** when the `rate-limit` DSL omits one. */\n window?: number;\n}\n\nexport function defineRateLimiterConfig(\n config: RateLimiterConfig,\n): RateLimiterConfig {\n return config;\n}\n\nexport function rateLimiterConfigDefaults(): Required<RateLimiterConfig> {\n return {\n driver: new InMemoryRateLimiter(),\n limit: 1000,\n window: 60,\n };\n}\n",
|
|
25
|
+
"import { ServiceProvider } from \"../../support/ServiceProvider\";\nimport { withDefaults } from \"../../support/withDefaults\";\nimport { RateLimiter } from \"./RateLimiter\";\nimport { rateLimiterConfigDefaults, type RateLimiterConfig } from \"./config\";\n\nexport class RateLimiterServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n RateLimiter,\n () =>\n new RateLimiter(\n withDefaults(\n rateLimiterConfigDefaults(),\n this.app.config.get<RateLimiterConfig>(\"ratelimiter\", {}),\n ),\n ),\n );\n }\n}\n",
|
|
26
|
+
"import type { RedisOptions } from \"bun\";\n\n// Config key: `redis`. Derived from `RedisServiceProvider`.\nexport interface RedisConfig {\n // Connection URL for Bun's Redis client. Defaults to the `REDIS_URL`\n // environment variable (Bun itself falls back to `redis://localhost:6379`\n // when unset).\n url?: string;\n\n // Optional Bun Redis client options (TLS, timeouts, auto-reconnect, ...).\n options?: RedisOptions;\n}\n\nexport function defineRedisConfig(config: RedisConfig): RedisConfig {\n return config;\n}\n\nexport function redisConfigDefaults(): RedisConfig {\n return {\n url: process.env.REDIS_URL,\n options: undefined,\n };\n}\n",
|
|
27
|
+
"import { ServiceProvider } from \"../../support/ServiceProvider\";\nimport { withDefaults } from \"../../support/withDefaults\";\nimport { redisConfigDefaults, type RedisConfig } from \"./config\";\nimport { RedisManager } from \"./RedisManager\";\n\nexport class RedisServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n RedisManager,\n () =>\n new RedisManager(\n withDefaults(\n redisConfigDefaults(),\n this.app.config.get<RedisConfig>(\"redis\", {}),\n ),\n ),\n );\n }\n}\n",
|
|
28
|
+
"import { ServiceProvider } from \"../../support/ServiceProvider\";\nimport { ApiRouteDispatcher } from \"./ApiRouteDispatcher\";\nimport { ViewRouteDispatcher } from \"./ViewRouteDispatcher\";\nimport type { ApiRouteConfig, ViewRouteConfig } from \"./config\";\nimport type { Repository } from \"../../support/Repository\";\n\nfunction readConfig<T>(config: Repository, key: string): T {\n const slice = config.get<T>(key);\n if (!slice) {\n throw new Error(\n `Missing \"${key}\" configuration. Route dispatching needs a root router — declare it in \"app/config/route.ts\".`,\n );\n }\n return slice;\n}\n\n/**\n * Owns both route dispatchers. Laravel ships a single RouteServiceProvider for\n * every route file it loads; the api/view split is a config slice, not a\n * separate provider.\n */\nexport class RouteServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n ApiRouteDispatcher,\n () =>\n new ApiRouteDispatcher(\n readConfig<ApiRouteConfig>(this.app.config, \"route.api\"),\n ),\n );\n\n this.app.singleton(\n ViewRouteDispatcher,\n () =>\n new ViewRouteDispatcher(\n readConfig<ViewRouteConfig>(this.app.config, \"route.view\"),\n ),\n );\n }\n\n /**\n * The two dispatchers are the one pair of services that must not be built\n * lazily: constructing them flattens the route tables and runs\n * `assertNoReservedRoutePaths`, so a missing `route` config or a route under\n * a reserved prefix has to fail the boot rather than the first request that\n * happens to hit it.\n */\n boot() {\n this.app.make(ApiRouteDispatcher);\n this.app.make(ViewRouteDispatcher);\n }\n}\n"
|
|
29
|
+
],
|
|
30
|
+
"mappings": ";oWAoBO,AAAM,LAAU,LAKD,OAJb,CAAQ,YAEP,QAA2B,CAAC,EAEpC,WAAW,CAAS,EAAkC,CAAlC,cAQpB,KAAK,CAAC,EAAsB,CAAC,IAAO,EAAG,EAAG,CACxC,GAAI,KAAK,OAAO,KAAK,SAAW,EAC9B,OAGF,IAAM,EAAY,WAAW,iBAAmB,IAAI,IAEpD,QAAW,KAAO,KAAK,OAAO,KAAM,CAClC,IAAM,EAAM,IAAI,EAChB,GAAI,CAAC,EAAI,KAAM,CACb,QAAQ,MAAM,mCAAmC,KAAK,UAAU,CAAG,GAAG,EACtE,SAEF,GAAI,CAAC,EAAI,KAAM,CACb,QAAQ,MAAM,0CAA0C,EAAI,MAAM,EAClE,SAKF,EAAS,IAAI,EAAI,IAAI,GAAG,KAAK,EAE7B,IAAM,EAAS,IAAI,KAAK,EAAI,KAAM,IAChC,EAAI,SAAY,CACd,GAAI,CACF,MAAM,EAAI,OAAO,KAAK,CAAG,EACzB,MAAO,EAAO,CACd,QAAQ,MAAM,4BAA4B,EAAI,QAAS,CAAK,EAE9D,GAAI,CACF,MAAM,EAAI,SAAS,KAAK,CAAG,EAC3B,MAAO,EAAO,CACd,QAAQ,MAAM,qBAAqB,EAAI,QAAS,CAAK,EAEvD,GAAI,CACF,MAAM,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AQ,IAAI,EACZ,MAAO,KACP,OAAQ,EACV,ECxBK,MAAM,WAAmC,CAAgB,CAC9D,QAAQ,EAAG,CACT,KAAK,IAAI,UACP,EACA,IACE,IAAI,EACF,EACE,EAA0B,EAC1B,KAAK,IAAI,OAAO,IAAuB,cAAe,CAAC,CAAC,CAC1D,CACF,CACJ,EAEJ,CCLO,SAAS,EAAiB,CAAC,EAAkC,CAClE,OAAO,EAGF,SAAS,CAAmB,EAAgB,CACjD,MAAO,CACL,IAAK,QAAQ,IAAI,UACjB,QAAS,MACX,EChBK,MAAM,WAA6B,CAAgB,CACxD,QAAQ,EAAG,CACT,KAAK,IAAI,UACP,EACA,IACE,IAAI,EACF,EACE,EAAoB,EACpB,KAAK,IAAI,OAAO,IAAiB,QAAS,CAAC,CAAC,CAC9C,CACF,CACJ,EAEJ,CCZA,SAAS,CAAa,CAAC,EAAoB,EAAgB,CACzD,IAAM,EAAQ,EAAO,IAAO,CAAG,EAC/B,GAAI,CAAC,EACH,MAAU,MACR,YAAY,qGACd,EAEF,OAAO,EAQF,MAAM,WAA6B,CAAgB,CACxD,QAAQ,EAAG,CACT,KAAK,IAAI,UACP,EACA,IACE,IAAI,EACF,EAA2B,KAAK,IAAI,OAAQ,WAAW,CACzD,CACJ,EAEA,KAAK,IAAI,UACP,EACA,IACE,IAAI,EACF,EAA4B,KAAK,IAAI,OAAQ,YAAY,CAC3D,CACJ,EAUF,IAAI,EAAG,CACL,KAAK,IAAI,KAAK,CAAkB,EAChC,KAAK,IAAI,KAAK,CAAmB,EAErC",
|
|
31
|
+
"debugId": "E448D6A3149FB4B164756E2164756E21",
|
|
32
|
+
"names": []
|
|
33
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{A as
|
|
2
|
+
import{Qc as h}from"./chunk-n5q0gwd9.js";var A=h((f)=>{f.HttpAuthLocation=void 0;(function(t){t.HEADER="header",t.QUERY="query"})(f.HttpAuthLocation||(f.HttpAuthLocation={}));f.HttpApiKeyAuthLocation=void 0;(function(t){t.HEADER="header",t.QUERY="query"})(f.HttpApiKeyAuthLocation||(f.HttpApiKeyAuthLocation={}));f.EndpointURLScheme=void 0;(function(t){t.HTTP="http",t.HTTPS="https"})(f.EndpointURLScheme||(f.EndpointURLScheme={}));f.AlgorithmId=void 0;(function(t){t.MD5="md5",t.CRC32="crc32",t.CRC32C="crc32c",t.SHA1="sha1",t.SHA256="sha256"})(f.AlgorithmId||(f.AlgorithmId={}));var x=(t)=>{let o=[];if(t.sha256!==void 0)o.push({algorithmId:()=>f.AlgorithmId.SHA256,checksumConstructor:()=>t.sha256});if(t.md5!=null)o.push({algorithmId:()=>f.AlgorithmId.MD5,checksumConstructor:()=>t.md5});return{addChecksumAlgorithm(s){o.push(s)},checksumAlgorithms(){return o}}},d=(t)=>{let o={};return t.checksumAlgorithms().forEach((s)=>{o[s.algorithmId()]=s.checksumConstructor()}),o},a=(t)=>{return x(t)},E=(t)=>{return d(t)};f.FieldPosition=void 0;(function(t){t[t.HEADER=0]="HEADER",t[t.TRAILER=1]="TRAILER"})(f.FieldPosition||(f.FieldPosition={}));var m="__smithy_context";f.IniSectionType=void 0;(function(t){t.PROFILE="profile",t.SSO_SESSION="sso-session",t.SERVICES="services"})(f.IniSectionType||(f.IniSectionType={}));f.RequestHandlerProtocol=void 0;(function(t){t.HTTP_0_9="http/0.9",t.HTTP_1_0="http/1.0",t.TDS_8_0="tds/8.0"})(f.RequestHandlerProtocol||(f.RequestHandlerProtocol={}));f.SMITHY_CONTEXT_KEY=m;f.getDefaultClientConfiguration=a;f.resolveDefaultRuntimeConfig=E});
|
|
3
|
+
export{A as oa};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=F9D33E8F776169DC64756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"'use strict';\n\nexports.HttpAuthLocation = void 0;\n(function (HttpAuthLocation) {\n HttpAuthLocation[\"HEADER\"] = \"header\";\n HttpAuthLocation[\"QUERY\"] = \"query\";\n})(exports.HttpAuthLocation || (exports.HttpAuthLocation = {}));\n\nexports.HttpApiKeyAuthLocation = void 0;\n(function (HttpApiKeyAuthLocation) {\n HttpApiKeyAuthLocation[\"HEADER\"] = \"header\";\n HttpApiKeyAuthLocation[\"QUERY\"] = \"query\";\n})(exports.HttpApiKeyAuthLocation || (exports.HttpApiKeyAuthLocation = {}));\n\nexports.EndpointURLScheme = void 0;\n(function (EndpointURLScheme) {\n EndpointURLScheme[\"HTTP\"] = \"http\";\n EndpointURLScheme[\"HTTPS\"] = \"https\";\n})(exports.EndpointURLScheme || (exports.EndpointURLScheme = {}));\n\nexports.AlgorithmId = void 0;\n(function (AlgorithmId) {\n AlgorithmId[\"MD5\"] = \"md5\";\n AlgorithmId[\"CRC32\"] = \"crc32\";\n AlgorithmId[\"CRC32C\"] = \"crc32c\";\n AlgorithmId[\"SHA1\"] = \"sha1\";\n AlgorithmId[\"SHA256\"] = \"sha256\";\n})(exports.AlgorithmId || (exports.AlgorithmId = {}));\nconst getChecksumConfiguration = (runtimeConfig) => {\n const checksumAlgorithms = [];\n if (runtimeConfig.sha256 !== undefined) {\n checksumAlgorithms.push({\n algorithmId: () => exports.AlgorithmId.SHA256,\n checksumConstructor: () => runtimeConfig.sha256,\n });\n }\n if (runtimeConfig.md5 != undefined) {\n checksumAlgorithms.push({\n algorithmId: () => exports.AlgorithmId.MD5,\n checksumConstructor: () => runtimeConfig.md5,\n });\n }\n return {\n addChecksumAlgorithm(algo) {\n checksumAlgorithms.push(algo);\n },\n checksumAlgorithms() {\n return checksumAlgorithms;\n },\n };\n};\nconst resolveChecksumRuntimeConfig = (clientConfig) => {\n const runtimeConfig = {};\n clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => {\n runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor();\n });\n return runtimeConfig;\n};\n\nconst getDefaultClientConfiguration = (runtimeConfig) => {\n return getChecksumConfiguration(runtimeConfig);\n};\nconst resolveDefaultRuntimeConfig = (config) => {\n return resolveChecksumRuntimeConfig(config);\n};\n\nexports.FieldPosition = void 0;\n(function (FieldPosition) {\n FieldPosition[FieldPosition[\"HEADER\"] = 0] = \"HEADER\";\n FieldPosition[FieldPosition[\"TRAILER\"] = 1] = \"TRAILER\";\n})(exports.FieldPosition || (exports.FieldPosition = {}));\n\nconst SMITHY_CONTEXT_KEY = \"__smithy_context\";\n\nexports.IniSectionType = void 0;\n(function (IniSectionType) {\n IniSectionType[\"PROFILE\"] = \"profile\";\n IniSectionType[\"SSO_SESSION\"] = \"sso-session\";\n IniSectionType[\"SERVICES\"] = \"services\";\n})(exports.IniSectionType || (exports.IniSectionType = {}));\n\nexports.RequestHandlerProtocol = void 0;\n(function (RequestHandlerProtocol) {\n RequestHandlerProtocol[\"HTTP_0_9\"] = \"http/0.9\";\n RequestHandlerProtocol[\"HTTP_1_0\"] = \"http/1.0\";\n RequestHandlerProtocol[\"TDS_8_0\"] = \"tds/8.0\";\n})(exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {}));\n\nexports.SMITHY_CONTEXT_KEY = SMITHY_CONTEXT_KEY;\nexports.getDefaultClientConfiguration = getDefaultClientConfiguration;\nexports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig;\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";uDAEQ,mBAAwB,QAC/B,QAAS,CAAC,EAAkB,CACzB,EAAiB,OAAY,SAC7B,EAAiB,MAAW,UACrB,qBAA6B,mBAAmB,CAAC,EAAE,EAEtD,yBAA8B,QACrC,QAAS,CAAC,EAAwB,CAC/B,EAAuB,OAAY,SACnC,EAAuB,MAAW,UAC3B,2BAAmC,yBAAyB,CAAC,EAAE,EAElE,oBAAyB,QAChC,QAAS,CAAC,EAAmB,CAC1B,EAAkB,KAAU,OAC5B,EAAkB,MAAW,UACtB,sBAA8B,oBAAoB,CAAC,EAAE,EAExD,cAAmB,QAC1B,QAAS,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gC,EAChC,8BAA8B",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "F9D33E8F776169DC64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Nc as M}from"./chunk-z78ksnx2.js";import{Oc as H}from"./chunk-5em8db18.js";var J=Symbol.for("gemi.foundation.Application");class G extends M{[J]=!0;static isApplication(j){return typeof j==="object"&&j!==null&&J in j}config;providers=[];booted=!1;constructor(j=new H){super();this.config=j,this.instance(H,j)}static currentInstance;static getInstance(){return G.currentInstance}static setInstance(j){return G.currentInstance=j,j}register(j){let z=this.providers.find((U)=>U instanceof j);if(z)return z;let F=new j(this);return F.register(),this.providers.push(F),F}registerMany(j){for(let z of j)this.register(z)}getProviders(){return[...this.providers]}isBooted(){return this.booted}async boot(){if(this.booted)return;for(let j of this.providers)await j.boot();this.booted=!0}flush(){super.flush(),this.instance(H,this.config),this.providers=[],this.booted=!1}}import{AsyncLocalStorage as V}from"async_hooks";var Q=new V;function S(j){let z=Q.getStore(),F=G.isApplication(z)?z:G.getInstance();if(!F)throw Error("No Application instance is available. Boot a Kernel before resolving services.");return j?F.make(j):F}
|
|
3
|
+
export{Q as Jc,G as Kc,S as Lc};
|
|
4
|
+
|
|
5
|
+
//# debugId=CA040CB0EFA1443E64756E2164756E21
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../foundation/Application.ts", "../kernel/context.ts", "../foundation/app.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { Container } from \"../container/Container\";\nimport { Repository } from \"../support/Repository\";\nimport type { ServiceProvider } from \"../support/ServiceProvider\";\n\nexport type ServiceProviderConstructor = new (\n app: Application,\n) => ServiceProvider;\n\n/**\n * Cross-copy brand. `dist/bin/gemi.js` bundles its own gemi while the app\n * resolves `gemi/*` to source, so `instanceof Application` is false for an\n * Application built by the other copy. `Symbol.for` is registry-global and\n * survives that boundary — the same reason services key off a `static token`\n * string rather than the constructor object.\n */\nconst APPLICATION_BRAND = Symbol.for(\"gemi.foundation.Application\");\n\nexport class Application extends Container {\n readonly [APPLICATION_BRAND] = true;\n\n static isApplication(value: unknown): value is Application {\n return (\n typeof value === \"object\" && value !== null && APPLICATION_BRAND in value\n );\n }\n\n /**\n * Runtime configuration (`app/config/*.ts`). Also bound in the container, so\n * `app.make(Repository)` and `app.config` are the same object.\n */\n readonly config: Repository;\n\n private providers: ServiceProvider[] = [];\n private booted = false;\n\n constructor(config: Repository = new Repository()) {\n super();\n this.config = config;\n this.instance(Repository, config);\n }\n\n private static currentInstance: Application | undefined;\n\n static getInstance(): Application | undefined {\n return Application.currentInstance;\n }\n\n static setInstance(app: Application | undefined) {\n Application.currentInstance = app;\n return app;\n }\n\n /**\n * Instantiates the provider and runs its `register()` immediately, exactly as\n * Laravel does. Registration is therefore synchronous — only `boot()` is\n * async, which is what lets `new App({ kernel })` stay a sync constructor.\n */\n register(Provider: ServiceProviderConstructor): ServiceProvider {\n const existing = this.providers.find((p) => p instanceof Provider);\n if (existing) {\n return existing;\n }\n\n const provider = new Provider(this);\n provider.register();\n this.providers.push(provider);\n return provider;\n }\n\n registerMany(providers: ServiceProviderConstructor[]) {\n for (const Provider of providers) {\n this.register(Provider);\n }\n }\n\n getProviders(): ServiceProvider[] {\n return [...this.providers];\n }\n\n isBooted(): boolean {\n return this.booted;\n }\n\n /**\n * Phase two. Every provider has already registered by the time any of these\n * run, so a provider's `boot()` may resolve services owned by any other.\n */\n async boot(): Promise<void> {\n if (this.booted) {\n return;\n }\n for (const provider of this.providers) {\n await provider.boot();\n }\n this.booted = true;\n }\n\n flush() {\n super.flush();\n this.instance(Repository, this.config);\n this.providers = [];\n this.booted = false;\n }\n}\n",
|
|
6
|
+
"import { AsyncLocalStorage } from \"async_hooks\";\n\nexport const kernelContext = new AsyncLocalStorage();\n",
|
|
7
|
+
"import type { ServiceToken } from \"../container/Container\";\nimport { kernelContext } from \"../kernel/context\";\nimport { Application } from \"./Application\";\n\n/**\n * Resolves the Application for the current async context. Reads the kernel\n * AsyncLocalStorage — there is exactly one ALS in the framework, and\n * `Kernel.run()` stores the Application in it, so this is the primary path for\n * anything running inside a request, a websocket message or a cron tick.\n *\n * The static instance (Laravel's `Container::setInstance`, set by\n * `Kernel.boot()`) is the fallback for code that runs outside any `run()`\n * scope — build-time tooling, module top level, a stray `setTimeout`.\n */\nexport function app(): Application;\nexport function app<T>(token: ServiceToken<T>): T;\nexport function app<T>(token?: ServiceToken<T>): Application | T {\n const store = kernelContext.getStore();\n const instance = Application.isApplication(store)\n ? store\n : Application.getInstance();\n\n if (!instance) {\n throw new Error(\n \"No Application instance is available. Boot a Kernel before resolving services.\",\n );\n }\n\n return token ? instance.make(token) : instance;\n}\n"
|
|
8
|
+
],
|
|
9
|
+
"mappings": ";wFAeA,FAAM,EAAoB,OAAO,IAAI,6BAA6B,EAE3D,MAAM,UAAoB,CAAU,EAC/B,GAAqB,SAExB,cAAa,CAAC,EAAsC,CACzD,OACE,OAAO,IAAU,UAAY,IAAU,MAAQ,KAAqB,EAQ/D,OAED,UAA+B,CAAC,EAChC,OAAS,GAEjB,WAAW,CAAC,EAAqB,IAAI,EAAc,CACjD,MAAM,EACN,KAAK,OAAS,EACd,KAAK,SAAS,EAAY,CAAM,QAGnB,uBAER,YAAW,EAA4B,CAC5C,OAAO,EAAY,sBAGd,YAAW,CAAC,EAA8B,CAE/C,OADA,EAAY,gBAAkB,EACvB,EAQT,QAAQ,CAAC,EAAuD,CAC9D,IAAM,EAAW,KAAK,UAAU,KAAK,CAAC,IAAM,aAAa,CAAQ,EACjE,GAAI,EACF,OAAO,EAGT,IAAM,EAAW,IAAI,EAAS,IAAI,EAGlC,OAFA,EAAS,SAAS,EAClB,KAAK,UAAU,KAAK,CAAQ,EACrB,EAGT,YAAY,CAAC,EAAyC,CACpD,QAAW,KAAY,EACrB,KAAK,SAAS,CAA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