@fougere/core 0.5.0-alpha.1 → 0.7.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/boot/Emissions.d.ts +14 -91
- package/dist/boot/Emissions.d.ts.map +1 -1
- package/dist/boot/Emissions.js +21 -118
- package/dist/boot/Emissions.js.map +1 -1
- package/dist/boot/ambient-port.d.ts +3 -24
- package/dist/boot/ambient-port.d.ts.map +1 -1
- package/dist/boot/ambient.als.d.ts.map +1 -1
- package/dist/boot/ambient.als.js +7 -12
- package/dist/boot/ambient.als.js.map +1 -1
- package/dist/boot/ambient.queue.d.ts +2 -5
- package/dist/boot/ambient.queue.d.ts.map +1 -1
- package/dist/boot/ambient.queue.js.map +1 -1
- package/dist/boot/apply.d.ts +1 -13
- package/dist/boot/apply.d.ts.map +1 -1
- package/dist/boot/apply.js +3 -15
- package/dist/boot/apply.js.map +1 -1
- package/dist/boot/auth.d.ts +6 -16
- package/dist/boot/auth.d.ts.map +1 -1
- package/dist/boot/boot.d.ts +5 -18
- package/dist/boot/boot.d.ts.map +1 -1
- package/dist/boot/boot.js +4 -11
- package/dist/boot/boot.js.map +1 -1
- package/dist/boot/bootstrap.d.ts.map +1 -1
- package/dist/boot/bootstrap.js +106 -163
- package/dist/boot/bootstrap.js.map +1 -1
- package/dist/boot/card.d.ts +5 -0
- package/dist/boot/card.d.ts.map +1 -0
- package/dist/boot/card.js +71 -0
- package/dist/boot/card.js.map +1 -0
- package/dist/boot/frame.d.ts +8 -32
- package/dist/boot/frame.d.ts.map +1 -1
- package/dist/boot/frame.js +23 -57
- package/dist/boot/frame.js.map +1 -1
- package/dist/boot/hosted.d.ts +3 -19
- package/dist/boot/hosted.d.ts.map +1 -1
- package/dist/boot/hosted.js +12 -17
- package/dist/boot/hosted.js.map +1 -1
- package/dist/boot/ownership.d.ts +5 -36
- package/dist/boot/ownership.d.ts.map +1 -1
- package/dist/boot/ownership.js +9 -49
- package/dist/boot/ownership.js.map +1 -1
- package/dist/boot/ports.d.ts +2 -15
- package/dist/boot/ports.d.ts.map +1 -1
- package/dist/boot/ports.js +1 -14
- package/dist/boot/ports.js.map +1 -1
- package/dist/boot/remote.d.ts +5 -38
- package/dist/boot/remote.d.ts.map +1 -1
- package/dist/boot/remote.js +8 -41
- package/dist/boot/remote.js.map +1 -1
- package/dist/boot/runner.d.ts +11 -0
- package/dist/boot/runner.d.ts.map +1 -0
- package/dist/boot/runner.js +13 -0
- package/dist/boot/runner.js.map +1 -0
- package/dist/boot/seed.d.ts +5 -32
- package/dist/boot/seed.d.ts.map +1 -1
- package/dist/boot/seed.js +10 -41
- package/dist/boot/seed.js.map +1 -1
- package/dist/boot/statement-drift.d.ts +4 -22
- package/dist/boot/statement-drift.d.ts.map +1 -1
- package/dist/boot/statement-drift.js +4 -9
- package/dist/boot/statement-drift.js.map +1 -1
- package/dist/boot/together.d.ts +8 -12
- package/dist/boot/together.d.ts.map +1 -1
- package/dist/boot/together.js +28 -65
- package/dist/boot/together.js.map +1 -1
- package/dist/boot/types.d.ts +36 -180
- package/dist/boot/types.d.ts.map +1 -1
- package/dist/builtin/config.d.ts +7 -0
- package/dist/builtin/config.d.ts.map +1 -0
- package/dist/builtin/config.js +15 -0
- package/dist/builtin/config.js.map +1 -0
- package/dist/{builtins → builtin}/logger.d.ts +4 -25
- package/dist/builtin/logger.d.ts.map +1 -0
- package/dist/{builtins → builtin}/logger.js +5 -32
- package/dist/builtin/logger.js.map +1 -0
- package/dist/config-loader.d.ts +9 -67
- package/dist/config-loader.d.ts.map +1 -1
- package/dist/config-loader.js +5 -18
- package/dist/config-loader.js.map +1 -1
- package/dist/contract.d.ts +13 -31
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +10 -26
- package/dist/contract.js.map +1 -1
- package/dist/crypto/encoding.d.ts +2 -15
- package/dist/crypto/encoding.d.ts.map +1 -1
- package/dist/crypto/encoding.js +2 -15
- package/dist/crypto/encoding.js.map +1 -1
- package/dist/crypto/node.d.ts.map +1 -1
- package/dist/crypto/node.js +1 -7
- package/dist/crypto/node.js.map +1 -1
- package/dist/crypto/port.d.ts +2 -18
- package/dist/crypto/port.d.ts.map +1 -1
- package/dist/crypto/port.js +1 -17
- package/dist/crypto/port.js.map +1 -1
- package/dist/crypto/webcrypto.d.ts.map +1 -1
- package/dist/crypto/webcrypto.js +1 -12
- package/dist/crypto/webcrypto.js.map +1 -1
- package/dist/declare.d.ts +41 -0
- package/dist/declare.d.ts.map +1 -0
- package/dist/{scan/declare.js → declare.js} +6 -31
- package/dist/declare.js.map +1 -0
- package/dist/define.d.ts +2 -3
- package/dist/define.d.ts.map +1 -1
- package/dist/define.js +2 -3
- package/dist/define.js.map +1 -1
- package/dist/descriptor/Fronds.d.ts +19 -0
- package/dist/descriptor/Fronds.d.ts.map +1 -0
- package/dist/descriptor/Fronds.js +40 -0
- package/dist/descriptor/Fronds.js.map +1 -0
- package/dist/descriptor/frond.d.ts +135 -0
- package/dist/descriptor/frond.d.ts.map +1 -0
- package/dist/{scan → descriptor}/frond.js.map +1 -1
- package/dist/dispatch/ArgumentResolver.d.ts +6 -3
- package/dist/dispatch/ArgumentResolver.d.ts.map +1 -1
- package/dist/dispatch/ArgumentResolver.js +48 -3
- package/dist/dispatch/ArgumentResolver.js.map +1 -1
- package/dist/dispatch/DispatchEvent.d.ts +2 -2
- package/dist/dispatch/DispatchEvent.d.ts.map +1 -1
- package/dist/dispatch/DispatchLifecycle.d.ts +1 -7
- package/dist/dispatch/DispatchLifecycle.d.ts.map +1 -1
- package/dist/dispatch/DispatchLifecycle.js +1 -7
- package/dist/dispatch/DispatchLifecycle.js.map +1 -1
- package/dist/dispatch/DispatchPort.d.ts +1 -1
- package/dist/dispatch/DispatchPort.d.ts.map +1 -1
- package/dist/dispatch/Dispatcher.d.ts +1 -1
- package/dist/dispatch/Dispatcher.d.ts.map +1 -1
- package/dist/dispatch/Dispatcher.js +2 -2
- package/dist/dispatch/Dispatcher.js.map +1 -1
- package/dist/{boot → dispatch}/HandlerFacade.d.ts +25 -38
- package/dist/dispatch/HandlerFacade.d.ts.map +1 -0
- package/dist/{boot → dispatch}/HandlerFacade.js +65 -74
- package/dist/dispatch/HandlerFacade.js.map +1 -0
- package/dist/dispatch/LocalRoutePolicy.d.ts +1 -1
- package/dist/dispatch/LocalRoutePolicy.d.ts.map +1 -1
- package/dist/dispatch/LocalRoutePolicy.js +4 -4
- package/dist/dispatch/LocalRoutePolicy.js.map +1 -1
- package/dist/dispatch/OperationRoute.d.ts +2 -2
- package/dist/dispatch/OperationRoute.d.ts.map +1 -1
- package/dist/dispatch/OutputView.d.ts +3 -2
- package/dist/dispatch/OutputView.d.ts.map +1 -1
- package/dist/dispatch/OutputView.js +19 -1
- package/dist/dispatch/OutputView.js.map +1 -1
- package/dist/dispatch/Route.d.ts +2 -3
- package/dist/dispatch/Route.d.ts.map +1 -1
- package/dist/dispatch/RoutePolicy.d.ts +1 -1
- package/dist/dispatch/RoutePolicy.d.ts.map +1 -1
- package/dist/dispatch/RouteRegistry.d.ts +1 -1
- package/dist/dispatch/RouteRegistry.d.ts.map +1 -1
- package/dist/dispatch/RouteRegistry.js +2 -2
- package/dist/dispatch/RouteRegistry.js.map +1 -1
- package/dist/dispatch/RouteResolver.d.ts +2 -4
- package/dist/dispatch/RouteResolver.d.ts.map +1 -1
- package/dist/dispatch/StorageGuard.d.ts +9 -8
- package/dist/dispatch/StorageGuard.d.ts.map +1 -1
- package/dist/dispatch/StorageGuard.js +66 -23
- package/dist/dispatch/StorageGuard.js.map +1 -1
- package/dist/dispatch/presenterArguments.d.ts +7 -0
- package/dist/dispatch/presenterArguments.d.ts.map +1 -0
- package/dist/dispatch/presenterArguments.js +12 -0
- package/dist/dispatch/presenterArguments.js.map +1 -0
- package/dist/dispatch/remoteRoutes.d.ts +7 -0
- package/dist/dispatch/remoteRoutes.d.ts.map +1 -0
- package/dist/dispatch/{RemoteRouteResolver.js → remoteRoutes.js} +6 -10
- package/dist/dispatch/remoteRoutes.js.map +1 -0
- package/dist/dispatch/routeNotFound.d.ts +9 -0
- package/dist/dispatch/routeNotFound.d.ts.map +1 -0
- package/dist/dispatch/routeNotFound.js +21 -0
- package/dist/dispatch/routeNotFound.js.map +1 -0
- package/dist/dispatch/validateInput.d.ts +5 -0
- package/dist/dispatch/validateInput.d.ts.map +1 -0
- package/dist/dispatch/validateInput.js +20 -0
- package/dist/dispatch/validateInput.js.map +1 -0
- package/dist/effective-operation.d.ts +6 -3
- package/dist/effective-operation.d.ts.map +1 -1
- package/dist/effective-operation.js +49 -27
- package/dist/effective-operation.js.map +1 -1
- package/dist/emit.d.ts +4 -42
- package/dist/emit.d.ts.map +1 -1
- package/dist/emit.js +3 -39
- package/dist/emit.js.map +1 -1
- package/dist/entry/facade.d.ts +8 -0
- package/dist/entry/facade.d.ts.map +1 -0
- package/dist/entry/facade.js +28 -0
- package/dist/entry/facade.js.map +1 -0
- package/dist/entry/transport.d.ts +5 -0
- package/dist/entry/transport.d.ts.map +1 -0
- package/dist/entry/transport.js +11 -0
- package/dist/entry/transport.js.map +1 -0
- package/dist/frond-config.d.ts +8 -71
- package/dist/frond-config.d.ts.map +1 -1
- package/dist/frond-config.js +1 -9
- package/dist/frond-config.js.map +1 -1
- package/dist/graph.d.ts +1 -1
- package/dist/graph.d.ts.map +1 -1
- package/dist/identity-keys.d.ts +2 -5
- package/dist/identity-keys.d.ts.map +1 -1
- package/dist/identity-keys.js +3 -16
- package/dist/identity-keys.js.map +1 -1
- package/dist/identity.d.ts +4 -30
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +11 -73
- package/dist/identity.js.map +1 -1
- package/dist/imports.d.ts +2 -8
- package/dist/imports.d.ts.map +1 -1
- package/dist/imports.js +1 -7
- package/dist/imports.js.map +1 -1
- package/dist/index.d.ts +28 -30
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -22
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +1 -8
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +1 -8
- package/dist/loader.js.map +1 -1
- package/dist/node.d.ts +2 -11
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +2 -11
- package/dist/node.js.map +1 -1
- package/dist/prefab/collector.d.ts +1 -22
- package/dist/prefab/collector.d.ts.map +1 -1
- package/dist/prefab/collector.js +1 -22
- package/dist/prefab/collector.js.map +1 -1
- package/dist/prefab/crud.d.ts +19 -35
- package/dist/prefab/crud.d.ts.map +1 -1
- package/dist/prefab/crud.js +39 -66
- package/dist/prefab/crud.js.map +1 -1
- package/dist/prefab/mirror.d.ts +5 -27
- package/dist/prefab/mirror.d.ts.map +1 -1
- package/dist/prefab/mirror.js +6 -24
- package/dist/prefab/mirror.js.map +1 -1
- package/dist/prefab/prefab.d.ts +1 -7
- package/dist/prefab/prefab.d.ts.map +1 -1
- package/dist/prefab/prefab.js +1 -7
- package/dist/prefab/prefab.js.map +1 -1
- package/dist/prefab/presenter.d.ts +2 -36
- package/dist/prefab/presenter.d.ts.map +1 -1
- package/dist/prefab/presenter.js +2 -36
- package/dist/prefab/presenter.js.map +1 -1
- package/dist/prefab/repository.d.ts +12 -80
- package/dist/prefab/repository.d.ts.map +1 -1
- package/dist/prefab/repository.js +22 -35
- package/dist/prefab/repository.js.map +1 -1
- package/dist/scan/adapters.d.ts +3 -0
- package/dist/scan/adapters.d.ts.map +1 -0
- package/dist/scan/adapters.js +25 -0
- package/dist/scan/adapters.js.map +1 -0
- package/dist/scan/bundling.d.ts +1 -12
- package/dist/scan/bundling.d.ts.map +1 -1
- package/dist/scan/bundling.js +1 -12
- package/dist/scan/bundling.js.map +1 -1
- package/dist/scan/conventions.d.ts +6 -40
- package/dist/scan/conventions.d.ts.map +1 -1
- package/dist/scan/conventions.js +5 -34
- package/dist/scan/conventions.js.map +1 -1
- package/dist/scan/emit.d.ts +2 -6
- package/dist/scan/emit.d.ts.map +1 -1
- package/dist/scan/emit.js +5 -39
- package/dist/scan/emit.js.map +1 -1
- package/dist/scan/handler-parser.d.ts +9 -76
- package/dist/scan/handler-parser.d.ts.map +1 -1
- package/dist/scan/handler-parser.js +28 -85
- package/dist/scan/handler-parser.js.map +1 -1
- package/dist/scan/result.d.ts +28 -0
- package/dist/scan/result.d.ts.map +1 -0
- package/dist/scan/result.js +2 -0
- package/dist/scan/result.js.map +1 -0
- package/dist/scan/scanner.d.ts +3 -28
- package/dist/scan/scanner.d.ts.map +1 -1
- package/dist/scan/scanner.js +36 -135
- package/dist/scan/scanner.js.map +1 -1
- package/dist/scan/statement.d.ts +1 -1
- package/dist/scan/statement.d.ts.map +1 -1
- package/dist/scan/statement.js +4 -30
- package/dist/scan/statement.js.map +1 -1
- package/dist/source.d.ts +41 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +10 -0
- package/dist/source.js.map +1 -0
- package/dist/storage.d.ts +92 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +50 -0
- package/dist/storage.js.map +1 -0
- package/dist/store.d.ts +18 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +146 -0
- package/dist/store.js.map +1 -0
- package/dist/verify.d.ts +6 -39
- package/dist/verify.d.ts.map +1 -1
- package/dist/verify.js +19 -39
- package/dist/verify.js.map +1 -1
- package/dist/wire/CallLog.d.ts +32 -0
- package/dist/wire/CallLog.d.ts.map +1 -0
- package/dist/{contract → wire}/CallLog.js.map +1 -1
- package/dist/wire/Invocation.d.ts +32 -0
- package/dist/wire/Invocation.d.ts.map +1 -0
- package/dist/wire/Invocation.js +66 -0
- package/dist/wire/Invocation.js.map +1 -0
- package/dist/wire/RouteAddress.d.ts +24 -0
- package/dist/wire/RouteAddress.d.ts.map +1 -0
- package/dist/{contract → wire}/RouteAddress.js +7 -0
- package/dist/wire/RouteAddress.js.map +1 -0
- package/dist/wire/binding.d.ts +36 -0
- package/dist/wire/binding.d.ts.map +1 -0
- package/dist/{boot → wire}/binding.js +5 -62
- package/dist/wire/binding.js.map +1 -0
- package/dist/wire/call.d.ts +25 -172
- package/dist/wire/call.d.ts.map +1 -1
- package/dist/wire/call.js +15 -166
- package/dist/wire/call.js.map +1 -1
- package/dist/wire/drift.d.ts +3 -28
- package/dist/wire/drift.d.ts.map +1 -1
- package/dist/wire/drift.js +4 -23
- package/dist/wire/drift.js.map +1 -1
- package/dist/wire/errors.d.ts +4 -24
- package/dist/wire/errors.d.ts.map +1 -1
- package/dist/wire/errors.js +4 -24
- package/dist/wire/errors.js.map +1 -1
- package/dist/wire/http-error.d.ts +2 -13
- package/dist/wire/http-error.d.ts.map +1 -1
- package/dist/wire/http-error.js +5 -19
- package/dist/wire/http-error.js.map +1 -1
- package/dist/wire/loggerMiddleware.d.ts +2 -8
- package/dist/wire/loggerMiddleware.d.ts.map +1 -1
- package/dist/wire/loggerMiddleware.js +1 -7
- package/dist/wire/loggerMiddleware.js.map +1 -1
- package/dist/wire/middleware.d.ts +3 -7
- package/dist/wire/middleware.d.ts.map +1 -1
- package/dist/wire/middleware.js +1 -5
- package/dist/wire/middleware.js.map +1 -1
- package/dist/wire/operation.d.ts +12 -74
- package/dist/wire/operation.d.ts.map +1 -1
- package/dist/wire/operation.js +4 -66
- package/dist/wire/operation.js.map +1 -1
- package/dist/wire/signature.d.ts +37 -0
- package/dist/wire/signature.d.ts.map +1 -0
- package/dist/wire/signature.js +2 -0
- package/dist/wire/signature.js.map +1 -0
- package/package.json +3 -3
- package/src/boot/Emissions.ts +22 -119
- package/src/boot/ambient-port.ts +3 -24
- package/src/boot/ambient.als.ts +7 -12
- package/src/boot/ambient.queue.ts +2 -5
- package/src/boot/apply.ts +3 -15
- package/src/boot/auth.ts +6 -16
- package/src/boot/boot.ts +8 -23
- package/src/boot/bootstrap.ts +117 -173
- package/src/boot/card.ts +84 -0
- package/src/boot/frame.ts +31 -65
- package/src/boot/hosted.ts +15 -40
- package/src/boot/ownership.ts +14 -49
- package/src/boot/ports.ts +2 -15
- package/src/boot/remote.ts +11 -58
- package/src/boot/runner.ts +17 -0
- package/src/boot/seed.ts +11 -42
- package/src/boot/statement-drift.ts +10 -28
- package/src/boot/together.ts +38 -72
- package/src/boot/types.ts +36 -180
- package/src/{builtins → builtin}/config.ts +1 -7
- package/src/{builtins → builtin}/logger.ts +6 -39
- package/src/config-loader.ts +12 -71
- package/src/contract.ts +15 -39
- package/src/crypto/encoding.ts +2 -15
- package/src/crypto/node.ts +1 -7
- package/src/crypto/port.ts +2 -18
- package/src/crypto/webcrypto.ts +1 -12
- package/src/{scan/declare.ts → declare.ts} +11 -42
- package/src/define.ts +2 -3
- package/src/descriptor/Fronds.ts +47 -0
- package/src/descriptor/frond.ts +145 -0
- package/src/dispatch/ArgumentResolver.ts +54 -8
- package/src/dispatch/DispatchEvent.ts +2 -2
- package/src/dispatch/DispatchLifecycle.ts +1 -7
- package/src/dispatch/DispatchPort.ts +1 -1
- package/src/dispatch/Dispatcher.ts +3 -3
- package/src/dispatch/HandlerFacade.ts +231 -0
- package/src/dispatch/LocalRoutePolicy.ts +4 -4
- package/src/dispatch/OperationRoute.ts +2 -2
- package/src/dispatch/OutputView.ts +24 -2
- package/src/dispatch/Route.ts +2 -4
- package/src/dispatch/RoutePolicy.ts +1 -1
- package/src/dispatch/RouteRegistry.ts +2 -2
- package/src/dispatch/RouteResolver.ts +2 -4
- package/src/dispatch/StorageGuard.ts +75 -23
- package/src/dispatch/presenterArguments.ts +25 -0
- package/src/dispatch/{RemoteRouteResolver.ts → remoteRoutes.ts} +7 -9
- package/src/dispatch/routeNotFound.ts +33 -0
- package/src/dispatch/validateInput.ts +28 -0
- package/src/effective-operation.ts +60 -37
- package/src/emit.ts +5 -63
- package/src/entry/facade.ts +44 -0
- package/src/entry/transport.ts +16 -0
- package/src/frond-config.ts +8 -71
- package/src/graph.ts +1 -1
- package/src/identity-keys.ts +3 -16
- package/src/identity.ts +12 -80
- package/src/imports.ts +3 -32
- package/src/index.ts +28 -33
- package/src/loader.ts +2 -16
- package/src/node.ts +2 -11
- package/src/prefab/collector.ts +1 -22
- package/src/prefab/crud.ts +51 -90
- package/src/prefab/mirror.ts +9 -49
- package/src/prefab/prefab.ts +2 -21
- package/src/prefab/presenter.ts +2 -36
- package/src/prefab/repository.ts +32 -108
- package/src/scan/adapters.ts +32 -0
- package/src/scan/bundling.ts +1 -12
- package/src/scan/conventions.ts +6 -40
- package/src/scan/emit.ts +7 -43
- package/src/scan/handler-parser.ts +41 -163
- package/src/scan/result.ts +29 -0
- package/src/scan/scanner.ts +40 -138
- package/src/scan/statement.ts +6 -31
- package/src/source.ts +44 -0
- package/src/storage.ts +141 -0
- package/src/store.ts +152 -0
- package/src/verify.ts +19 -60
- package/src/wire/CallLog.ts +30 -0
- package/src/{contract → wire}/Invocation.ts +24 -17
- package/src/{contract → wire}/RouteAddress.ts +10 -0
- package/src/wire/binding.ts +102 -0
- package/src/wire/call.ts +30 -261
- package/src/wire/drift.ts +5 -30
- package/src/wire/errors.ts +4 -24
- package/src/wire/http-error.ts +5 -19
- package/src/wire/loggerMiddleware.ts +2 -8
- package/src/wire/middleware.ts +3 -7
- package/src/wire/operation.ts +13 -110
- package/src/wire/signature.ts +38 -0
- package/dist/boot/HandlerFacade.d.ts.map +0 -1
- package/dist/boot/HandlerFacade.js.map +0 -1
- package/dist/boot/binding.d.ts +0 -60
- package/dist/boot/binding.d.ts.map +0 -1
- package/dist/boot/binding.js.map +0 -1
- package/dist/builtins/config.d.ts +0 -13
- package/dist/builtins/config.d.ts.map +0 -1
- package/dist/builtins/config.js +0 -21
- package/dist/builtins/config.js.map +0 -1
- package/dist/builtins/logger.d.ts.map +0 -1
- package/dist/builtins/logger.js.map +0 -1
- package/dist/contract/Call.d.ts +0 -10
- package/dist/contract/Call.d.ts.map +0 -1
- package/dist/contract/Call.js +0 -15
- package/dist/contract/Call.js.map +0 -1
- package/dist/contract/CallLog.d.ts +0 -57
- package/dist/contract/CallLog.d.ts.map +0 -1
- package/dist/contract/Invocation.d.ts +0 -27
- package/dist/contract/Invocation.d.ts.map +0 -1
- package/dist/contract/Invocation.js +0 -59
- package/dist/contract/Invocation.js.map +0 -1
- package/dist/contract/RouteAddress.d.ts +0 -17
- package/dist/contract/RouteAddress.d.ts.map +0 -1
- package/dist/contract/RouteAddress.js.map +0 -1
- package/dist/dispatch/InputValidator.d.ts +0 -7
- package/dist/dispatch/InputValidator.d.ts.map +0 -1
- package/dist/dispatch/InputValidator.js +0 -22
- package/dist/dispatch/InputValidator.js.map +0 -1
- package/dist/dispatch/OperationExecutor.d.ts +0 -25
- package/dist/dispatch/OperationExecutor.d.ts.map +0 -1
- package/dist/dispatch/OperationExecutor.js +0 -32
- package/dist/dispatch/OperationExecutor.js.map +0 -1
- package/dist/dispatch/OutputProjector.d.ts +0 -12
- package/dist/dispatch/OutputProjector.d.ts.map +0 -1
- package/dist/dispatch/OutputProjector.js +0 -30
- package/dist/dispatch/OutputProjector.js.map +0 -1
- package/dist/dispatch/PresenterArgumentResolver.d.ts +0 -12
- package/dist/dispatch/PresenterArgumentResolver.d.ts.map +0 -1
- package/dist/dispatch/PresenterArgumentResolver.js +0 -20
- package/dist/dispatch/PresenterArgumentResolver.js.map +0 -1
- package/dist/dispatch/RemoteRouteResolver.d.ts +0 -13
- package/dist/dispatch/RemoteRouteResolver.d.ts.map +0 -1
- package/dist/dispatch/RemoteRouteResolver.js.map +0 -1
- package/dist/dispatch/RouteNotFoundError.d.ts +0 -10
- package/dist/dispatch/RouteNotFoundError.d.ts.map +0 -1
- package/dist/dispatch/RouteNotFoundError.js +0 -24
- package/dist/dispatch/RouteNotFoundError.js.map +0 -1
- package/dist/entry/DynamicFacade.d.ts +0 -10
- package/dist/entry/DynamicFacade.d.ts.map +0 -1
- package/dist/entry/DynamicFacade.js +0 -27
- package/dist/entry/DynamicFacade.js.map +0 -1
- package/dist/entry/FacadeEntry.d.ts +0 -11
- package/dist/entry/FacadeEntry.d.ts.map +0 -1
- package/dist/entry/FacadeEntry.js +0 -26
- package/dist/entry/FacadeEntry.js.map +0 -1
- package/dist/entry/TransportEntry.d.ts +0 -13
- package/dist/entry/TransportEntry.d.ts.map +0 -1
- package/dist/entry/TransportEntry.js +0 -24
- package/dist/entry/TransportEntry.js.map +0 -1
- package/dist/orm.d.ts +0 -207
- package/dist/orm.d.ts.map +0 -1
- package/dist/orm.js +0 -66
- package/dist/orm.js.map +0 -1
- package/dist/scan/Fronds.d.ts +0 -45
- package/dist/scan/Fronds.d.ts.map +0 -1
- package/dist/scan/Fronds.js +0 -66
- package/dist/scan/Fronds.js.map +0 -1
- package/dist/scan/declare.d.ts +0 -71
- package/dist/scan/declare.d.ts.map +0 -1
- package/dist/scan/declare.js.map +0 -1
- package/dist/scan/frond.d.ts +0 -224
- package/dist/scan/frond.d.ts.map +0 -1
- package/src/boot/HandlerFacade.ts +0 -242
- package/src/boot/binding.ts +0 -182
- package/src/contract/Call.ts +0 -18
- package/src/contract/CallLog.ts +0 -55
- package/src/dispatch/InputValidator.ts +0 -28
- package/src/dispatch/OperationExecutor.ts +0 -60
- package/src/dispatch/OutputProjector.ts +0 -32
- package/src/dispatch/PresenterArgumentResolver.ts +0 -25
- package/src/dispatch/RouteNotFoundError.ts +0 -29
- package/src/entry/DynamicFacade.ts +0 -28
- package/src/entry/FacadeEntry.ts +0 -32
- package/src/entry/TransportEntry.ts +0 -30
- package/src/orm.ts +0 -252
- package/src/scan/Fronds.ts +0 -73
- package/src/scan/frond.ts +0 -235
- /package/dist/{scan → descriptor}/frond.js +0 -0
- /package/dist/{contract → wire}/CallLog.js +0 -0
package/dist/boot/together.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type SchemaView } from '@fougere/schema';
|
|
2
2
|
import type { Container } from '@fougere/container';
|
|
3
|
-
import { type
|
|
4
|
-
import type { Logger } from '../
|
|
5
|
-
import type { ProviderEntry } from '../
|
|
3
|
+
import { type StorageFactory } from '../storage.js';
|
|
4
|
+
import type { Logger } from '../builtin/logger.js';
|
|
5
|
+
import type { ProviderEntry } from '../descriptor/frond.js';
|
|
6
6
|
/** Everything the boot knows that a frame needs, gathered once for every frond. */
|
|
7
7
|
export interface FrameWorld {
|
|
8
8
|
/** Every entity of every frond, by registration key. A frame crosses fronds by design. */
|
|
@@ -10,17 +10,13 @@ export interface FrameWorld {
|
|
|
10
10
|
/** Which frond holds an entity — the question `remotes:` turns into a refusal. */
|
|
11
11
|
frondOf: Map<string, string>;
|
|
12
12
|
hostedHere: (frond: string) => boolean;
|
|
13
|
-
|
|
13
|
+
storageFactory?: StorageFactory;
|
|
14
14
|
sourceOf?: (entityName: string) => string;
|
|
15
|
-
|
|
15
|
+
/** Whether that source hands one out — asked before the frame is built, not at the call. */
|
|
16
|
+
transacts?: (source: string) => boolean;
|
|
17
|
+
transacted?: <R>(source: string, fn: (storageFactory: StorageFactory) => Promise<R>) => Promise<R>;
|
|
16
18
|
log: Logger;
|
|
17
19
|
}
|
|
18
|
-
/**
|
|
19
|
-
* Register one frame per key a handler or provider of this frond asked for.
|
|
20
|
-
*
|
|
21
|
-
* Called with the frond's scope, because that is where the asking constructor resolves —
|
|
22
|
-
* while the MEMBERS are looked up app-wide, a frame crossing fronds being the ordinary case
|
|
23
|
-
* rather than the exception (the frond is not the storage boundary; `sources:` is).
|
|
24
|
-
*/
|
|
20
|
+
/** Register one frame per key a handler or provider of this frond asked for. */
|
|
25
21
|
export declare function registerFrames(scope: Container, keys: Iterable<string>, providers: readonly ProviderEntry[], world: FrameWorld): void;
|
|
26
22
|
//# sourceMappingURL=together.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"together.d.ts","sourceRoot":"","sources":["../../src/boot/together.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"together.d.ts","sourceRoot":"","sources":["../../src/boot/together.ts"],"names":[],"mappings":"AAEA,OAAO,EAA0B,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAwE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAC1H,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAI5D,mFAAmF;AACnF,MAAM,WAAW,UAAU;IACzB,0FAA0F;IAC1F,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACtC,kFAAkF;IAClF,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACvC,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1C,4FAA4F;IAC5F,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IACxC,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,cAAc,EAAE,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IACnG,GAAG,EAAE,MAAM,CAAC;CACb;AA6FD,gFAAgF;AAChF,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,EACtB,SAAS,EAAE,SAAS,aAAa,EAAE,EACnC,KAAK,EAAE,UAAU,GAChB,IAAI,CA0DN"}
|
package/dist/boot/together.js
CHANGED
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Building a frame — what a handler asking for `Together<[…]>` receives.
|
|
3
|
-
*
|
|
4
|
-
* The declaration names its members and nothing else; where they live, and therefore
|
|
5
|
-
* which of the two realizations they get, is read HERE and stated at boot. A frame whose
|
|
6
|
-
* members share an engine is a transaction; one whose members are split replays its own
|
|
7
|
-
* inverses (`frame.ts`). Same user code, two guarantees, and the boot says which — the
|
|
8
|
-
* one thing a gradient must never leave to assumption.
|
|
9
|
-
*/
|
|
1
|
+
/** Building a frame — what a handler asking for `Together<[…]>` receives. */
|
|
10
2
|
import { ambient } from '#ambient';
|
|
11
3
|
import { upperFirst, lowerFirst } from '@fougere/schema';
|
|
12
|
-
import { membersOfTogetherKey,
|
|
4
|
+
import { membersOfTogetherKey, storageKeyOf, entityOfStorageKey } from '../storage.js';
|
|
13
5
|
import { StorageGuard } from '../dispatch/StorageGuard.js';
|
|
14
6
|
import { recording, unwind } from './frame.js';
|
|
15
|
-
/**
|
|
16
|
-
* Each declared name, resolved to what it designates.
|
|
17
|
-
*
|
|
18
|
-
* A name that resolves to nothing is refused rather than skipped: `Together<[Account,
|
|
19
|
-
* Ledgre]>` is a typo whose only other symptom is a frame quietly one member short. The
|
|
20
|
-
* two lists are checked against different registries, which is exactly why the declaration
|
|
21
|
-
* separates them — nothing here has to guess what kind a name is.
|
|
22
|
-
*/
|
|
7
|
+
/** Each declared name, resolved to what it designates. */
|
|
23
8
|
function resolve(names, declared, world) {
|
|
24
9
|
const entities = names.entities.map((member) => {
|
|
25
10
|
const name = lowerFirst(member);
|
|
@@ -41,12 +26,7 @@ function resolve(names, declared, world) {
|
|
|
41
26
|
});
|
|
42
27
|
return { entities, providers };
|
|
43
28
|
}
|
|
44
|
-
/**
|
|
45
|
-
* A member that cannot write here at all — its frond is hosted elsewhere.
|
|
46
|
-
*
|
|
47
|
-
* Refused rather than compensated: a compensated frame still writes through a local ORM,
|
|
48
|
-
* and a remote frond registers none. There is nothing to record and nothing to undo.
|
|
49
|
-
*/
|
|
29
|
+
/** A member that cannot write here at all — its frond is hosted elsewhere. */
|
|
50
30
|
function refuseRemote(members, world, key) {
|
|
51
31
|
for (const member of members.entities) {
|
|
52
32
|
const frond = world.frondOf.get(member.name);
|
|
@@ -57,20 +37,13 @@ function refuseRemote(members, world, key) {
|
|
|
57
37
|
}
|
|
58
38
|
}
|
|
59
39
|
}
|
|
60
|
-
/**
|
|
61
|
-
|
|
62
|
-
*
|
|
63
|
-
* The frame does not widen itself to cover it: doing so would pull an entity from another
|
|
64
|
-
* source into the group without anyone writing it down. Named instead, with the one-word fix.
|
|
65
|
-
*/
|
|
66
|
-
function refuseUncoveredWrites(members, key) {
|
|
40
|
+
/** A provider member writing an entity the frame does not name. */
|
|
41
|
+
function refuseUncoveredWrites(members, key, world) {
|
|
67
42
|
const covered = new Set(members.entities.map((member) => member.name));
|
|
68
43
|
for (const provider of members.providers) {
|
|
69
44
|
for (const dep of provider.deps) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const entity = lowerFirst(dep.slice(0, -'Orm'.length));
|
|
73
|
-
if (covered.has(entity))
|
|
45
|
+
const entity = entityOfStorageKey(dep, (name) => world.entityByName.has(name));
|
|
46
|
+
if (!entity || covered.has(entity))
|
|
74
47
|
continue;
|
|
75
48
|
throw new Error(`Together<[…]> (${key}): ${provider.ctor.name} writes ${entity}, which is not in the ` +
|
|
76
49
|
`frame's entity list — its writes would escape the unwind. Add it: ` +
|
|
@@ -78,39 +51,27 @@ function refuseUncoveredWrites(members, key) {
|
|
|
78
51
|
}
|
|
79
52
|
}
|
|
80
53
|
}
|
|
81
|
-
/**
|
|
82
|
-
* Open the block: build every member over `factory`, in a scope of their own.
|
|
83
|
-
*
|
|
84
|
-
* The scope is what makes a provider member work without a locator — its ORM keys are
|
|
85
|
-
* registered here, so the container hands it the framed ones through the ordinary
|
|
86
|
-
* constructor. It is disposed when the block ends, whichever way it ended.
|
|
87
|
-
*/
|
|
54
|
+
/** Open the block. */
|
|
88
55
|
async function inScope(parent, members, factory, wrap, fn) {
|
|
89
56
|
const scope = parent.createScope();
|
|
90
57
|
try {
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
scope.registerValue(
|
|
94
|
-
return
|
|
58
|
+
const storages = members.entities.map((member) => {
|
|
59
|
+
const storage = wrap(factory(member.schema, member.name), member.name, member.schema);
|
|
60
|
+
scope.registerValue(storageKeyOf(member.name), storage);
|
|
61
|
+
return storage;
|
|
95
62
|
});
|
|
96
|
-
// Providers after every
|
|
63
|
+
// Providers after every storage is in place: one may depend on another member's.
|
|
97
64
|
const built = members.providers.map((provider) => {
|
|
98
65
|
scope.register(provider.ctor.name, provider.ctor, { deps: provider.deps });
|
|
99
66
|
return scope.resolve(provider.ctor.name);
|
|
100
67
|
});
|
|
101
|
-
return await fn(
|
|
68
|
+
return await fn(storages, built);
|
|
102
69
|
}
|
|
103
70
|
finally {
|
|
104
71
|
await scope.dispose();
|
|
105
72
|
}
|
|
106
73
|
}
|
|
107
|
-
/**
|
|
108
|
-
* Register one frame per key a handler or provider of this frond asked for.
|
|
109
|
-
*
|
|
110
|
-
* Called with the frond's scope, because that is where the asking constructor resolves —
|
|
111
|
-
* while the MEMBERS are looked up app-wide, a frame crossing fronds being the ordinary case
|
|
112
|
-
* rather than the exception (the frond is not the storage boundary; `sources:` is).
|
|
113
|
-
*/
|
|
74
|
+
/** Register one frame per key a handler or provider of this frond asked for. */
|
|
114
75
|
export function registerFrames(scope, keys, providers, world) {
|
|
115
76
|
let registered = 0;
|
|
116
77
|
for (const key of new Set(keys)) {
|
|
@@ -118,25 +79,27 @@ export function registerFrames(scope, keys, providers, world) {
|
|
|
118
79
|
if (!names)
|
|
119
80
|
continue;
|
|
120
81
|
registered += 1;
|
|
121
|
-
if (!world.
|
|
82
|
+
if (!world.storageFactory) {
|
|
122
83
|
throw new Error(`Together<[${names.entities.join(', ')}]> needs storage, and this boot declares none.`);
|
|
123
84
|
}
|
|
124
85
|
const members = resolve(names, providers, world);
|
|
125
86
|
refuseRemote(members, world, key);
|
|
126
|
-
refuseUncoveredWrites(members, key);
|
|
87
|
+
refuseUncoveredWrites(members, key, world);
|
|
127
88
|
const sources = new Set(members.entities.map((member) => world.sourceOf?.(member.name) ?? 'db'));
|
|
128
|
-
const
|
|
129
|
-
// One engine and a way into it: the engine gives the unwind AND the isolation.
|
|
130
|
-
|
|
131
|
-
|
|
89
|
+
const validator = (storage, name, schema) => new StorageGuard(schema.getFields(), name).guard(storage);
|
|
90
|
+
// One engine and a way into it: the engine gives the unwind AND the isolation. The
|
|
91
|
+
// question goes to the source these members live in — a composition answering for the
|
|
92
|
+
// default one would compensate a frame whose own engine holds transactions.
|
|
93
|
+
const source = sources.size === 1 ? [...sources][0] : undefined;
|
|
94
|
+
if (world.transacted && source !== undefined && (world.transacts?.(source) ?? true)) {
|
|
132
95
|
world.log.info(`${key} — transaction, source '${source}'`);
|
|
133
96
|
scope.registerValue(key, {
|
|
134
|
-
run: (fn) => ambient.enterFrame(key, () => world.transacted(source, (factory) => inScope(scope, members, factory,
|
|
97
|
+
run: (fn) => ambient.enterFrame(key, () => world.transacted(source, (factory) => inScope(scope, members, factory, validator, fn))),
|
|
135
98
|
});
|
|
136
99
|
continue;
|
|
137
100
|
}
|
|
138
101
|
// Split, or an engine that hands out no transaction: the frame keeps the before-image
|
|
139
|
-
// of every write and replays the inverses itself. `
|
|
102
|
+
// of every write and replays the inverses itself. `validator` stays OUTSIDE `recording`, so
|
|
140
103
|
// a write the entity refuses never enters the journal.
|
|
141
104
|
const why = sources.size > 1
|
|
142
105
|
? members.entities.map((m) => `${m.name} in '${world.sourceOf?.(m.name) ?? 'db'}'`).join(', ')
|
|
@@ -145,9 +108,9 @@ export function registerFrames(scope, keys, providers, world) {
|
|
|
145
108
|
scope.registerValue(key, {
|
|
146
109
|
run: (fn) => ambient.enterFrame(key, async () => {
|
|
147
110
|
const journal = [];
|
|
148
|
-
const record = (
|
|
111
|
+
const record = (storage, name, schema) => validator(recording(storage, name, schema, journal), name, schema);
|
|
149
112
|
try {
|
|
150
|
-
return await inScope(scope, members, world.
|
|
113
|
+
return await inScope(scope, members, world.storageFactory, record, fn);
|
|
151
114
|
}
|
|
152
115
|
catch (cause) {
|
|
153
116
|
return unwind(journal, cause, world.log);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"together.js","sourceRoot":"","sources":["../../src/boot/together.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"together.js","sourceRoot":"","sources":["../../src/boot/together.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAmB,MAAM,iBAAiB,CAAC;AAE1E,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,kBAAkB,EAAqC,MAAM,eAAe,CAAC;AAG1H,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,EAAa,MAAM,YAAY,CAAC;AAuB1D,0DAA0D;AAC1D,SAAS,OAAO,CAAC,KAAkD,EAAE,QAAkC,EAAE,KAAiB;IACxH,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC7C,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QAChC,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CACb,cAAc,MAAM,yBAAyB,MAAM,4BAA4B;gBAC/E,0EAA0E,CAC3E,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC/C,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;QACzE,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,K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AAC,GAAG,EAAE,KAAK,IAAI,EAAE;gBAChH,MAAM,OAAO,GAAW,EAAE,CAAC;gBAC3B,MAAM,MAAM,GAAG,CAAC,OAAgB,EAAE,IAAY,EAAE,MAAkB,EAAE,EAAE,CACpE,SAAS,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;gBACrE,IAAI,CAAC;oBACH,OAAO,MAAM,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,cAAe,EAAE,MAAM,EAAE,EAAW,CAAC,CAAC;gBACnF,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;gBAC3C,CAAC;YACH,CAAC,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IACD,IAAI,UAAU,GAAG,CAAC,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACvC,KAAK,CAAC,GAAG,CAAC,IAAI,CACZ,kFAAkF;cAChF,mDAAmD,CACtD,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/boot/types.d.ts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The boot's two ends: what `createApp` takes, and what it hands back.
|
|
3
|
-
*
|
|
4
|
-
* The scan's descriptors moved to `frond.ts` and the auth contract to `auth.ts` — this
|
|
5
|
-
* file was named after a role ("the types"), so everything with nowhere else to be
|
|
6
|
-
* landed in it, seventeen notions deep.
|
|
7
|
-
*/
|
|
1
|
+
/** The boot's two ends. */
|
|
8
2
|
import type { Container } from '@fougere/container';
|
|
9
|
-
import type { Fronds } from '../
|
|
10
|
-
import type { FrondDescriptor
|
|
3
|
+
import type { Fronds } from '../descriptor/Fronds.js';
|
|
4
|
+
import type { FrondDescriptor } from '../descriptor/frond.js';
|
|
5
|
+
import type { ScanResult } from '../scan/result.js';
|
|
11
6
|
import type { SchemaView } from '@fougere/schema';
|
|
12
|
-
import type {
|
|
7
|
+
import type { StorageFactory } from '../storage.js';
|
|
13
8
|
import type { AppMiddleware } from '../wire/middleware.js';
|
|
14
9
|
import type { RpcAnswer, Transport } from '../wire/call.js';
|
|
15
10
|
import type { Extension } from './AppLifecycle.js';
|
|
@@ -21,107 +16,44 @@ import type { DispatchPort } from '../dispatch/DispatchPort.js';
|
|
|
21
16
|
export interface CreateAppOptions {
|
|
22
17
|
/** Factory function to create the container. Required. */
|
|
23
18
|
createContainer: () => Container;
|
|
24
|
-
/** Factory to auto-generate
|
|
25
|
-
|
|
19
|
+
/** Factory to auto-generate Storage for each scanned entity. */
|
|
20
|
+
storageFactory?: StorageFactory;
|
|
26
21
|
/**
|
|
27
22
|
* Which source an entity's rows live in, and how to open a transaction on one — the two
|
|
28
|
-
* questions that decide whether `Together<[…]>` gets the engine's own unwind or replays
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* Optional together, because a host may hand in a bare `ormFactory` and know neither. A
|
|
32
|
-
* frame then compensates: not knowing where the rows are and promising atomicity over
|
|
33
|
-
* them are two different things, and only one of them is honest.
|
|
23
|
+
* questions that decide whether `Together<[…]>` gets the engine's own unwind or replays inverses
|
|
24
|
+
* itself.
|
|
34
25
|
*/
|
|
35
26
|
sourceOf?: (entityName: string) => string;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
*
|
|
40
|
-
* A factory rather than a value, for the same reason `ormFactory` is one: core must
|
|
41
|
-
* not name a storage package, and this one costs 71 MB of downloaded extensions and a
|
|
42
|
-
* native module — nothing a first run that only wanted sqlite should carry. The host
|
|
43
|
-
* decides what backs it; `@fougere/adapter-duckdb` is one answer, not the contract.
|
|
44
|
-
*
|
|
45
|
-
* Called once per frond that asks, with the entity CLASSES its `reads:` named — a
|
|
46
|
-
* name would make the reader resolve the schema a second time.
|
|
47
|
-
*/
|
|
27
|
+
transacts?: (source: string) => boolean;
|
|
28
|
+
transacted?: <R>(source: string, fn: (storageFactory: StorageFactory) => Promise<R>) => Promise<R>;
|
|
29
|
+
/** Builds the cross-source reader a frond gets when it declares `reads:`. */
|
|
48
30
|
sourcesFactory?: (reads: unknown[], frond: string) => Promise<unknown> | unknown;
|
|
49
|
-
/**
|
|
50
|
-
* What this app is built from — required, because producing it is what reads a disk.
|
|
51
|
-
*
|
|
52
|
-
* `scanProject` (`@fougere/core/node`) reads the fronds off the filesystem; a module a
|
|
53
|
-
* build wrote holds the same value with no disk at all. `createApp` cannot tell them
|
|
54
|
-
* apart, and that is the point: it names no builtin, so a runtime without `node:fs`
|
|
55
|
-
* runs it. `root` and `fronds` used to live here — both were arguments to the scan.
|
|
56
|
-
*/
|
|
31
|
+
/** What this app is built from — required, because producing it is what reads a disk. */
|
|
57
32
|
scan?: ScanResult | (() => Promise<ScanResult> | ScanResult);
|
|
58
|
-
/**
|
|
59
|
-
* What this app STATES it hosts — `frond('blog', { entities: [Post] })`.
|
|
60
|
-
*
|
|
61
|
-
* Passing this and not `scan:` is how an app says "do not scan": nothing reads a disk,
|
|
62
|
-
* nothing loads `typescript`, and what was not named does not exist. Passing both fills
|
|
63
|
-
* the members left unnamed from what the scan found — the app's word wins, the way
|
|
64
|
-
* `frond.config.ts` wins over the scan one level down.
|
|
65
|
-
*/
|
|
33
|
+
/** What this app STATES it hosts — `frond('blog', { entities: [Post] })`. */
|
|
66
34
|
fronds?: readonly FrondDescriptor[];
|
|
67
35
|
/**
|
|
68
36
|
* Remote fronds — label → address. What each remote hosts is discovered
|
|
69
37
|
* at the first miss (rpc.discover), never declared here.
|
|
70
38
|
*/
|
|
71
39
|
remotes?: Record<string, string>;
|
|
72
|
-
/**
|
|
73
|
-
* Builds the transport used to reach `remotes` addresses. Wired by
|
|
74
|
-
* layer-2 packages (e.g. @fougere/transport-http); required when
|
|
75
|
-
* `remotes` is non-empty.
|
|
76
|
-
*/
|
|
40
|
+
/** Builds the transport used to reach `remotes` addresses. */
|
|
77
41
|
remoteTransport?: (url: string) => Transport;
|
|
78
42
|
/**
|
|
79
43
|
* Which realization answers which port — see `FougereConfig.ports`. Needed only
|
|
80
44
|
* when two classes extend the same port; one is resolved by convention.
|
|
81
45
|
*/
|
|
82
46
|
ports?: Record<string, string>;
|
|
83
|
-
/**
|
|
84
|
-
* What this app takes on beyond its fronds, each stating what it does and what it undoes.
|
|
85
|
-
*
|
|
86
|
-
* `up` runs before `createApp` returns, in this order; `down` runs inside `dispose()`,
|
|
87
|
-
* in reverse. Three levels release in reverse of construction, which is the container's
|
|
88
|
-
* own rule read one level out: extensions first (built last), then the container, then
|
|
89
|
-
* `onDispose` — a resource opened before any of this existed.
|
|
90
|
-
*
|
|
91
|
-
* A member may be `undefined`, so a host writes a conditional one inline rather than a
|
|
92
|
-
* spread over a ternary. The framework's own two are always declared, `migrate` as an
|
|
93
|
-
* empty slot when nothing migrates: a host filling it later REPLACES that member in
|
|
94
|
-
* place instead of adding one after the seeds.
|
|
95
|
-
*/
|
|
47
|
+
/** What this app takes on beyond its fronds, each stating what it does and what it undoes. */
|
|
96
48
|
extensions?: readonly (Extension | undefined)[];
|
|
97
49
|
/**
|
|
98
|
-
* Released by `app.dispose()` AFTER the container, for a resource handed in rather
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* NOT an extension, and the difference is a time: this was opened BEFORE the container,
|
|
102
|
-
* so it closes after it, while an extension's `up` runs after the container and its
|
|
103
|
-
* `down` therefore runs before. A storage's migration is an extension; its connection
|
|
104
|
-
* is not, and `ResolvedStorage` declares the two beside each other.
|
|
50
|
+
* Released by `app.dispose()` AFTER the container, for a resource handed in rather than built
|
|
51
|
+
* here — a storage connection is the one case today.
|
|
105
52
|
*/
|
|
106
53
|
onDispose?: () => Promise<void> | void;
|
|
107
|
-
/**
|
|
108
|
-
* Which protocol adapters this app serves — see `FougereConfig.adapters`.
|
|
109
|
-
* Carried onto the App so every door reads one answer instead of each host
|
|
110
|
-
* deciding for itself.
|
|
111
|
-
*/
|
|
54
|
+
/** Which protocol adapters this app serves — see `FougereConfig.adapters`. */
|
|
112
55
|
adapters?: Record<string, boolean | undefined>;
|
|
113
|
-
/**
|
|
114
|
-
* Carries an announced fact out of this process — a broker, a queue, a log.
|
|
115
|
-
*
|
|
116
|
-
* Called for every emission, ALONGSIDE the local dispatch and never instead of it: a
|
|
117
|
-
* listener in this process is reached directly, and this is how the others hear.
|
|
118
|
-
*
|
|
119
|
-
* It exists because the local dispatch finds its listeners by having READ their code,
|
|
120
|
-
* which stops at the repository boundary. A carrier hands the fact to a NAME; the far
|
|
121
|
-
* side subscribes to that same name from its own code, and neither ever reads the other.
|
|
122
|
-
*
|
|
123
|
-
* Its failure never reaches the emitter — same rule as a subscriber's.
|
|
124
|
-
*/
|
|
56
|
+
/** Carries an announced fact out of this process — a broker, a queue, a log. */
|
|
125
57
|
onEmit?: (fact: string, payload: unknown) => void | Promise<void>;
|
|
126
58
|
/** Passive observers of every dispatch transition. */
|
|
127
59
|
dispatchObservers?: readonly DispatchObserver[];
|
|
@@ -139,13 +71,7 @@ export interface App extends DispatchPort {
|
|
|
139
71
|
local: DispatchPort;
|
|
140
72
|
/** Root container with builtins + frond scopes. */
|
|
141
73
|
container: Container;
|
|
142
|
-
/**
|
|
143
|
-
* Which protocol adapters this app declared, from `fougere.config.ts`.
|
|
144
|
-
*
|
|
145
|
-
* Read by the doors themselves, so an undeclared adapter serves nothing whatever
|
|
146
|
-
* the host mounted — the route file may exist, the middleware may be installed, and
|
|
147
|
-
* the answer is still "not here".
|
|
148
|
-
*/
|
|
74
|
+
/** Which protocol adapters this app declared, from `fougere.config.ts`. */
|
|
149
75
|
adapters: Record<string, boolean | undefined>;
|
|
150
76
|
/** Where a call goes, as the config declared it — frond name to address. */
|
|
151
77
|
remotes: Readonly<Record<string, string>>;
|
|
@@ -154,113 +80,43 @@ export interface App extends DispatchPort {
|
|
|
154
80
|
/** Resolve from root container (shortcut). */
|
|
155
81
|
resolve<T>(name: string): T;
|
|
156
82
|
/**
|
|
157
|
-
* Resolve an entity's schema — the local `entityClass` when it's hosted or
|
|
158
|
-
*
|
|
159
|
-
* (`rpc.discover` to `Card.toSchema`). The one way to get a live schema for an
|
|
160
|
-
* entity whose class may not be importable at all (another repo, another
|
|
161
|
-
* language) — a card travelled, but until now its `schema` was thrown away.
|
|
83
|
+
* Resolve an entity's schema — the local `entityClass` when it's hosted or scanned here, else
|
|
84
|
+
* reconstructed from the remote's identity card (`rpc.discover` to `Card.toSchema`).
|
|
162
85
|
*/
|
|
163
86
|
schemaFor(entity: string): Promise<SchemaView>;
|
|
164
|
-
/**
|
|
165
|
-
* The door a name exposes to one audience, or `undefined` when it exposes
|
|
166
|
-
* none. A named surface is CLOSED: a name with no door of its own under that
|
|
167
|
-
* surface is not in it — it never falls back to the full one.
|
|
168
|
-
*
|
|
169
|
-
* **Not always a façade**, despite the name: when the owning frond is declared
|
|
170
|
-
* remote, nothing is registered locally (`bootstrap.ts`, `declaredRemotes`) and
|
|
171
|
-
* this resolves to a doublure — a façade-shaped stand-in (`remote.ts`). The
|
|
172
|
-
* caller cannot tell, which is the point; the word here was simply wrong.
|
|
173
|
-
*
|
|
174
|
-
* The one way an adapter reaches that door. It exists so the key format stays
|
|
175
|
-
* inside core (see `facadeKeyOf`), which is what lets a projection package
|
|
176
|
-
* stay structurally typed and depend on nothing.
|
|
177
|
-
*/
|
|
87
|
+
/** The door a name exposes to one audience, or `undefined` when it exposes none. */
|
|
178
88
|
facadeFor(entity: string, surface?: string): Record<string, Function> | undefined;
|
|
179
89
|
/**
|
|
180
|
-
* The canonical contracts served beside a facade, after prefab + scan + config,
|
|
181
|
-
*
|
|
182
|
-
* this table instead of replaying those decisions.
|
|
90
|
+
* The canonical contracts served beside a facade, after prefab + scan + config, binding, kind,
|
|
91
|
+
* topology and surface resolution.
|
|
183
92
|
*/
|
|
184
93
|
operationsFor(entity: string, surface?: string): EffectiveOperationsMap | undefined;
|
|
185
|
-
/**
|
|
186
|
-
* The facts this app has a listener for — what a carrier must subscribe to on its behalf.
|
|
187
|
-
*
|
|
188
|
-
* Derived from the signatures it scanned (`Fact<T>` in an op's parameters), so a process
|
|
189
|
-
* states what it listens to without anyone declaring it twice. The dual of `onEmit`: one
|
|
190
|
-
* says what leaves, this says what should be brought in.
|
|
191
|
-
*/
|
|
94
|
+
/** The facts this app has a listener for — what a carrier must subscribe to on its behalf. */
|
|
192
95
|
listensTo(): string[];
|
|
193
|
-
/**
|
|
194
|
-
* Hand a fact that came from OUTSIDE to the listeners in this process — and stop there.
|
|
195
|
-
*
|
|
196
|
-
* The dual of `onEmit`, and deliberately not the same thing as announcing: resolving the
|
|
197
|
-
* emission value to deliver an inbound fact would carry it straight back out through
|
|
198
|
-
* `onEmit`, so a hub echoed every reading it received to the whole fleet. Receiving and
|
|
199
|
-
* announcing are two operations; only one of them leaves.
|
|
200
|
-
*
|
|
201
|
-
* The local dispatch is identical either way — same judge, same binding, same
|
|
202
|
-
* middlewares — so a fact off a wire is no less checked than one raised next door.
|
|
203
|
-
*
|
|
204
|
-
* **It waits, and it tells** — the opposite of announcing, on purpose. It resolves once
|
|
205
|
-
* every listener here is done, and REJECTS with an `AggregateError` if any refused. A
|
|
206
|
-
* carrier's whole job is to know whether the fact landed: at-least-once is retrying what
|
|
207
|
-
* failed, so a delivery that cannot report makes durability impossible to build above it.
|
|
208
|
-
* "Dispatch is not delivery" protects the EMITTER from a slow subscriber; a carrier is
|
|
209
|
-
* not the emitter, it is the party whose business this is.
|
|
210
|
-
*
|
|
211
|
-
* It still holds nothing. A refused fact is refused, and whether it comes back is the
|
|
212
|
-
* carrier's decision — Fougere puts the channel underneath rather than reimplementing it.
|
|
213
|
-
*/
|
|
96
|
+
/** Hand a fact that came from OUTSIDE to the listeners in this process — and stop there. */
|
|
214
97
|
deliver(fact: string, payload: unknown): Promise<void>;
|
|
215
98
|
/**
|
|
216
|
-
* The storage an entity is backed by, resolved through its owning frond's scope —
|
|
217
|
-
*
|
|
218
|
-
* or when the app booted with no storage at all.
|
|
219
|
-
*
|
|
220
|
-
* `unknown` because the port belongs to whoever wired it: narrowing it to `EntityOrm`
|
|
221
|
-
* is the caller saying which implementation they are standing on.
|
|
222
|
-
*/
|
|
223
|
-
ormFor(entity: string): unknown | undefined;
|
|
224
|
-
/**
|
|
225
|
-
* The presenter of an entity, resolved through its owning frond's scope.
|
|
226
|
-
*
|
|
227
|
-
* Same shape as {@link ormFor}, and it exists so an adapter never spells the container
|
|
228
|
-
* key itself: `schema-graphql` wrote out `${Name}Presenter` by hand, and a key respelled
|
|
229
|
-
* in a second place finds nothing and reports nothing the day the convention moves.
|
|
99
|
+
* The storage an entity is backed by, resolved through its owning frond's scope — the dual of
|
|
100
|
+
* {@link facadeFor}.
|
|
230
101
|
*/
|
|
102
|
+
storageFor(entity: string): unknown | undefined;
|
|
103
|
+
/** The presenter of an entity, resolved through its owning frond's scope. */
|
|
231
104
|
presenterFor(entity: string): unknown | undefined;
|
|
232
105
|
/** Dispose the root container. */
|
|
233
106
|
dispose(): Promise<void>;
|
|
234
|
-
/**
|
|
235
|
-
* Stop taking calls, and resolve once the running ones are done.
|
|
236
|
-
*
|
|
237
|
-
* The step before releasing, when there is work on the app: `dispose()` closes a
|
|
238
|
-
* storage connection the running calls are standing on. Rejects on `timeoutMs`
|
|
239
|
-
* naming how many are left, rather than resolving as if it had succeeded.
|
|
240
|
-
*/
|
|
107
|
+
/** Stop taking calls, and resolve once the running ones are done. */
|
|
241
108
|
drain(timeoutMs?: number): Promise<void>;
|
|
242
109
|
/** How many calls are running right now — one count for all three doors and the wire. */
|
|
243
110
|
inFlight(): number;
|
|
244
|
-
/**
|
|
245
|
-
* The same disposal, spelled so the language does it: `await using app = await
|
|
246
|
-
* createApp(…)`. Twelve of the twenty-six mounts in this repo's own tests never
|
|
247
|
-
* called `dispose()` — a scope that closes itself is the only version of that
|
|
248
|
-
* rule nobody forgets.
|
|
249
|
-
*/
|
|
111
|
+
/** The same disposal, spelled so the language does it: `await using app = await createApp(…)`. */
|
|
250
112
|
[Symbol.asyncDispose](): Promise<void>;
|
|
251
113
|
/**
|
|
252
114
|
* What this app took on, in the order it will release them. The reading of
|
|
253
115
|
* `CreateAppOptions.extensions` after the boot resolved it.
|
|
254
116
|
*/
|
|
255
117
|
extensions(): string[];
|
|
256
|
-
/**
|
|
257
|
-
|
|
258
|
-
*
|
|
259
|
-
* The gesture a package uses to add a reading core does not hold: an app that never
|
|
260
|
-
* installed it never registers it, so the runner's refusal is the whole degradation.
|
|
261
|
-
* A name already declared is refused rather than replaced — `discover` included.
|
|
262
|
-
*/
|
|
263
|
-
serveRpc(op: string, answer: RpcAnswer): void;
|
|
118
|
+
/** Declare one `rpc` op — what the app says about ITSELF, beside the card. */
|
|
119
|
+
serveRpc(operationName: string, answer: RpcAnswer): void;
|
|
264
120
|
/** Register a global app middleware (runs on every operation). */
|
|
265
121
|
/** Watch every dispatch transition; the returned function unsubscribes. */
|
|
266
122
|
observe(observer: DispatchObserver): () => void;
|
package/dist/boot/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/boot/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/boot/types.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC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,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,GAAG,IAAI,CAAC;IACrD,oEAAoE;IACpE,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The process environment, as a service — so a handler asks for it rather than reading it. */
|
|
2
|
+
export declare class Config {
|
|
3
|
+
private readonly env;
|
|
4
|
+
constructor(env?: Record<string, string | undefined>);
|
|
5
|
+
get<T = string>(key: string, fallback?: T): T;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/builtin/config.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,qBAAa,MAAM;IACL,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAkB;IAErF,GAAG,CAAC,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC;CAG9C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** The process environment, as a service — so a handler asks for it rather than reading it. */
|
|
2
|
+
export class Config {
|
|
3
|
+
env;
|
|
4
|
+
constructor(env = envOfProcess()) {
|
|
5
|
+
this.env = env;
|
|
6
|
+
}
|
|
7
|
+
get(key, fallback) {
|
|
8
|
+
return this.env[key] ?? fallback;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function envOfProcess() {
|
|
12
|
+
const proc = globalThis.process;
|
|
13
|
+
return proc?.env ?? {};
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/builtin/config.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,MAAM,OAAO,MAAM;IACY;IAA7B,YAA6B,MAA0C,YAAY,EAAE;QAAxD,QAAG,GAAH,GAAG,CAAqD;IAAG,CAAC;IAEzF,GAAG,CAAa,GAAW,EAAE,QAAY;QACvC,OAAQ,IAAI,CAAC,GAAG,CAAC,GAAG,CAAO,IAAK,QAAc,CAAC;IACjD,CAAC;CACF;AAED,SAAS,YAAY;IACnB,MAAM,IAAI,GAAI,UAAyE,CAAC,OAAO,CAAC;IAChG,OAAO,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC;AACzB,CAAC"}
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fougere Logger — structured, colored, multi-runtime.
|
|
3
|
-
*
|
|
4
|
-
* Works on Node, Bun, Deno, Cloudflare Workers (console-based, no native bindings).
|
|
5
|
-
*/
|
|
1
|
+
/** Fougere Logger — structured, colored, multi-runtime. */
|
|
6
2
|
export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
|
7
|
-
/**
|
|
8
|
-
* One line, before it was formatted for a terminal.
|
|
9
|
-
*
|
|
10
|
-
* The console form is already cooked — ANSI codes, a badge, a timestamp — so anything
|
|
11
|
-
* that wants to FORWARD a log needs it before that. What travels is the structure, and
|
|
12
|
-
* nothing here knows where it goes.
|
|
13
|
-
*/
|
|
3
|
+
/** One line, before it was formatted for a terminal. */
|
|
14
4
|
export interface LogRecord {
|
|
15
5
|
level: Exclude<LogLevel, 'silent'>;
|
|
16
6
|
/** The logger's own name — 'boot:app', 'boot:app:catalog'. */
|
|
@@ -23,20 +13,9 @@ export interface LogRecord {
|
|
|
23
13
|
export type LogSink = (record: LogRecord) => void;
|
|
24
14
|
/** Take every line this process logs. Returns the way to withdraw. */
|
|
25
15
|
export declare function onLog(next: LogSink): () => void;
|
|
26
|
-
/**
|
|
27
|
-
* The level the PROCESS was started with. Read here rather than only at `applyConfig`,
|
|
28
|
-
* which runs after the boot has already said where its root is — an operator asking for
|
|
29
|
-
* `warn` got that line anyway. Guarded: this module runs on Workers, where there is no
|
|
30
|
-
* `process`.
|
|
31
|
-
*/
|
|
16
|
+
/** The level the PROCESS was started with. */
|
|
32
17
|
export declare function envLevel(): LogLevel | undefined;
|
|
33
|
-
/**
|
|
34
|
-
* Set the level for every logger in this process, at once.
|
|
35
|
-
*
|
|
36
|
-
* Refuses a level it does not know rather than storing `undefined` as the threshold:
|
|
37
|
-
* every comparison against it is then `NaN`, so nothing is filtered and `logLevel()`
|
|
38
|
-
* reports its own fallback instead of what is in force.
|
|
39
|
-
*/
|
|
18
|
+
/** Set the level for every logger in this process, at once. */
|
|
40
19
|
export declare function setLogLevel(level: LogLevel): void;
|
|
41
20
|
/** What the level is now — the dual, so a reload can report what it changed. */
|
|
42
21
|
export declare function logLevel(): LogLevel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/builtin/logger.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAE3D,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEtE,wDAAwD;AACxD,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACnC,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,0BAA0B;IAC1B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;AAKlD,sEAAsE;AACtE,wBAAgB,KAAK,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,IAAI,CAM/C;AAOD,8CAA8C;AAC9C,wBAAgB,QAAQ,IAAI,QAAQ,GAAG,SAAS,CAG/C;AAED,+DAA+D;AAC/D,wBAAgB,WAAW,CAAC,KAAK,E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