@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/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/boot/auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/boot/auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE7D,0DAA0D;AAC1D,MAAM,WAAW,UAAU;IACzB,0FAA0F;IAC1F,MAAM,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC7D;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACvC;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,iFAAiF;IACjF,EAAE,EAAE,OAAO,CAAC;IACZ,gFAAgF;IAChF,cAAc,EAAE,cAAc,CAAC;CAChC;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACrC,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,4DAA4D;IAC5D,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjD,2EAA2E;IAC3E,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7B,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
package/dist/boot/boot.d.ts
CHANGED
|
@@ -19,24 +19,16 @@ interface BootOptions {
|
|
|
19
19
|
remotes?: Record<string, string>;
|
|
20
20
|
/** Builds the transport to reach `remotes`. Supplied by a layer-2 package. */
|
|
21
21
|
remoteTransport?: (url: string) => Transport;
|
|
22
|
-
/**
|
|
23
|
-
* Carries an announced fact out of this process. Forwarded rather than dropped: a
|
|
24
|
-
* caller handing one in has no other way to reach the emitter, and this path silently
|
|
25
|
-
* kept it to itself.
|
|
26
|
-
*/
|
|
22
|
+
/** Carries an announced fact out of this process. */
|
|
27
23
|
onEmit?: CreateAppOptions['onEmit'];
|
|
28
24
|
/**
|
|
29
|
-
*
|
|
25
|
+
* storage setup — returns the storage handle (db), an storageFactory, and its two halves.
|
|
30
26
|
* The `db` value is forwarded to the auth provider via AuthContext when `auth` is set.
|
|
31
27
|
*/
|
|
32
28
|
db?: (config: FougereConfig) => {
|
|
33
29
|
db?: unknown;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Bring the schema up to date — an extension's `up`, because it runs after the
|
|
37
|
-
* container. It used to be called `afterBoot`, a word that also meant the host's
|
|
38
|
-
* post-boot and was read in four places under two senses.
|
|
39
|
-
*/
|
|
30
|
+
storageFactory: CreateAppOptions['storageFactory'];
|
|
31
|
+
/** Bring the schema up to date — an extension's `up`, because it runs after the container. */
|
|
40
32
|
migrate?: (app: App) => Promise<void> | void;
|
|
41
33
|
/** Closes what the factory opened — `boot()` called it, so `boot()` releases it. */
|
|
42
34
|
close?: () => Promise<void>;
|
|
@@ -47,12 +39,7 @@ interface BootOptions {
|
|
|
47
39
|
*/
|
|
48
40
|
extensions?: readonly (Extension | undefined)[];
|
|
49
41
|
}
|
|
50
|
-
/**
|
|
51
|
-
* Boot a Fougere app from fougere.config.ts.
|
|
52
|
-
*
|
|
53
|
-
* Handles: config loading, container creation, DB setup, seeding.
|
|
54
|
-
* Works for any surface (Nuxt, GraphQL standalone, CLI, tests).
|
|
55
|
-
*/
|
|
42
|
+
/** Boot a Fougere app from fougere.config.ts. */
|
|
56
43
|
export declare function boot(options: BootOptions): Promise<App>;
|
|
57
44
|
export {};
|
|
58
45
|
//# sourceMappingURL=boot.d.ts.map
|
package/dist/boot/boot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../src/boot/boot.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGrE,OAAO,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,UAAU,WAAW;IACnB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAChC,mCAAmC;IACnC,eAAe,EAAE,MAAM,SAAS,CAAC;IACjC,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,8EAA8E;IAC9E,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,CAAC;IAC7C
|
|
1
|
+
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../src/boot/boot.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGrE,OAAO,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,UAAU,WAAW;IACnB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAChC,mCAAmC;IACnC,eAAe,EAAE,MAAM,SAAS,CAAC;IACjC,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,8EAA8E;IAC9E,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,CAAC;IAC7C,qDAAqD;IACrD,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACpC;;;OAGG;IACH,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK;QAC9B,EAAE,CAAC,EAAE,OAAO,CAAC;QACb,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;QACnD,8FAA8F;QAC9F,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;QAC7C,oFAAoF;QACpF,KAAK,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;KAC7B,CAAC;IACF;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,EAAE,CAAC;CACjD;AAED,iDAAiD;AACjD,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CA4D7D"}
|
package/dist/boot/boot.js
CHANGED
|
@@ -2,15 +2,10 @@ import { createApp } from './bootstrap.js';
|
|
|
2
2
|
import { seeding } from './seed.js';
|
|
3
3
|
import { scanProject } from '../scan/scanner.js';
|
|
4
4
|
import { loadConfig } from '../config-loader.js';
|
|
5
|
-
import { Logger } from '../
|
|
5
|
+
import { Logger } from '../builtin/logger.js';
|
|
6
6
|
import { applyConfig } from './apply.js';
|
|
7
7
|
import { migrating } from './AppLifecycle.js';
|
|
8
|
-
/**
|
|
9
|
-
* Boot a Fougere app from fougere.config.ts.
|
|
10
|
-
*
|
|
11
|
-
* Handles: config loading, container creation, DB setup, seeding.
|
|
12
|
-
* Works for any surface (Nuxt, GraphQL standalone, CLI, tests).
|
|
13
|
-
*/
|
|
8
|
+
/** Boot a Fougere app from fougere.config.ts. */
|
|
14
9
|
export async function boot(options) {
|
|
15
10
|
const bootStart = performance.now();
|
|
16
11
|
const log = new Logger('boot');
|
|
@@ -35,7 +30,7 @@ export async function boot(options) {
|
|
|
35
30
|
// handed the answer and reaches for nothing.
|
|
36
31
|
scan: await scanProject(root, options.fronds, config.conventions),
|
|
37
32
|
createContainer: options.createContainer,
|
|
38
|
-
|
|
33
|
+
storageFactory: dbSetup?.storageFactory,
|
|
39
34
|
db: dbSetup?.db,
|
|
40
35
|
auth: config.auth,
|
|
41
36
|
remotes: options.remotes,
|
|
@@ -50,9 +45,7 @@ export async function boot(options) {
|
|
|
50
45
|
// it was opened before the container existed, so it closes after the container goes.
|
|
51
46
|
onDispose: dbSetup?.close,
|
|
52
47
|
/**
|
|
53
|
-
* The whole ascent, in one ordered list — tables, then rows, then whatever the host
|
|
54
|
-
* takes on. It was four call sites under the name `afterBoot`, two of which meant
|
|
55
|
-
* different things and one of which was generated into a Nitro plugin.
|
|
48
|
+
* The whole ascent, in one ordered list — tables, then rows, then whatever the host takes on.
|
|
56
49
|
*/
|
|
57
50
|
extensions: [
|
|
58
51
|
migrating(dbSetup?.migrate),
|
package/dist/boot/boot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../../src/boot/boot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAsB,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../../src/boot/boot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAsB,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAkB,MAAM,mBAAmB,CAAC;AAyC9D,iDAAiD;AACjD,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,OAAoB;IAC7C,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IACpC,MAAM,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;IAE/B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAC3C,GAAG,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;IAE1B,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC5B,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAkB,EAAE,GAAG,UAAU,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IACnE,qFAAqF;IACrF,kFAAkF;IAClF,WAAW,CAAC,MAAM,CAAC,CAAC;IACpB,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAE1B,IAAI,OAA+D,CAAC;IACpE,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;QACf,GAAG,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;QACnC,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;QAC7B,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACnC,CAAC;IAED,GAAG,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;IAC7C,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC;QAC1B,mFAAmF;QACnF,6CAA6C;QAC7C,IAAI,EAAE,MAAM,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC;QACjE,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,cAAc,EAAE,OAAO,EAAE,cAAc;QACvC,EAAE,EAAE,OAAO,EAAE,EAAE;QACf,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,qFAAqF;QACrF,0EAA0E;QAC1E,iFAAiF;QACjF,iFAAiF;QACjF,8CAA8C;QAC9C,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,sFAAsF;QACtF,qFAAqF;QACrF,SAAS,EAAE,OAAO,EAAE,KAAK;QACzB;;WAEG;QACH,UAAU,EAAE;YACV,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC;YAC3B,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACxC,GAAG,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC;SAC9B;QACD,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,eAAe,EAAE,OAAO,CAAC,eAAe;KACzC,CAAC,CAAC;IAEH,GAAG,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,kBAAkB,EAAE,CAAC,CAAC;IAE1E,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACtD,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,CAAC,MAAM,CAAC,MAAM,WAAW,CAAC,CAAC;IAE7D,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/boot/bootstrap.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/boot/bootstrap.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAsExD,uCAAuC;AACvC,wBAAsB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,CA0sBvE"}
|
package/dist/boot/bootstrap.js
CHANGED
|
@@ -1,64 +1,45 @@
|
|
|
1
1
|
import { lowerFirst } from '@fougere/schema';
|
|
2
2
|
import { hostedBy } from './hosted.js';
|
|
3
|
-
import { Logger } from '../
|
|
4
|
-
import { Config } from '../
|
|
3
|
+
import { Logger } from '../builtin/logger.js';
|
|
4
|
+
import { Config } from '../builtin/config.js';
|
|
5
5
|
import { createRemoteRouter, createRemoteFacade } from './remote.js';
|
|
6
6
|
import { registerFrames } from './together.js';
|
|
7
7
|
import { Emissions } from './Emissions.js';
|
|
8
|
-
import { HandlerFacade } from '
|
|
8
|
+
import { HandlerFacade } from '../dispatch/HandlerFacade.js';
|
|
9
9
|
import { targetOf } from '../prefab/prefab.js';
|
|
10
|
-
import { ownersOf,
|
|
10
|
+
import { ownersOf, refuseStorageInUserCode, refuseCrudOnOwned } from './ownership.js';
|
|
11
11
|
import { resolveEffectiveOperations, } from '../effective-operation.js';
|
|
12
12
|
import { StorageGuard } from '../dispatch/StorageGuard.js';
|
|
13
13
|
import { portBindings } from './ports.js';
|
|
14
14
|
import { InFlight } from '../dispatch/InFlight.js';
|
|
15
15
|
// The keys, each read from where its concept is declared — never respelled here.
|
|
16
|
-
import { facadeKeyOf, contractsKeyOf
|
|
16
|
+
import { facadeKeyOf, contractsKeyOf } from '../wire/call.js';
|
|
17
|
+
import { identityCardOf } from './card.js';
|
|
17
18
|
import { AppLifecycle } from './AppLifecycle.js';
|
|
19
|
+
import { inheritsCrud, subjectOf } from '../prefab/crud.js';
|
|
18
20
|
import { repositoryKeyOf } from '../prefab/repository.js';
|
|
19
|
-
import {
|
|
21
|
+
import { storageKeyOf } from '../storage.js';
|
|
20
22
|
import { presenterKeyOf } from '../prefab/presenter.js';
|
|
21
23
|
import { collectorKeyOf } from '../prefab/collector.js';
|
|
22
|
-
import { RouteAddress } from '../
|
|
24
|
+
import { RouteAddress } from '../wire/RouteAddress.js';
|
|
23
25
|
import { DispatchLifecycle } from '../dispatch/DispatchLifecycle.js';
|
|
24
26
|
import { Dispatcher } from '../dispatch/Dispatcher.js';
|
|
25
27
|
import { LocalRoutePolicy } from '../dispatch/LocalRoutePolicy.js';
|
|
26
28
|
import { OperationRoute } from '../dispatch/OperationRoute.js';
|
|
27
|
-
import {
|
|
29
|
+
import { remoteRoutes } from '../dispatch/remoteRoutes.js';
|
|
28
30
|
import { RouteRegistry } from '../dispatch/RouteRegistry.js';
|
|
29
|
-
import {
|
|
30
|
-
/**
|
|
31
|
-
* The one wording for "nobody hosts this here", with both ways out. Said twice, and the
|
|
32
|
-
* second copy (`schemaFor`) had lost the two remedies — the same dead end, strictly less
|
|
33
|
-
* useful, for no reason.
|
|
34
|
-
*/
|
|
31
|
+
import { facadeOperations } from '../entry/facade.js';
|
|
32
|
+
/** The one wording for "nobody hosts this here", with both ways out. */
|
|
35
33
|
const notLoaded = (entity) => `Frond for '${entity}' is not loaded.\n` +
|
|
36
34
|
` - Add '${entity}' to --fronds flag\n` +
|
|
37
35
|
` - Or declare a remote: remotes: { ${entity}: 'http://...' }`;
|
|
38
|
-
/**
|
|
39
|
-
* Two fronds cannot claim one name — said at boot, because nothing else says it.
|
|
40
|
-
*
|
|
41
|
-
* A door lands on the ROOT container under `facadeKeyOf(address)`, and that key carries
|
|
42
|
-
* no frond; a presenter lands there too. `registerValue` is a `Map.set`, so the second
|
|
43
|
-
* frond loaded simply replaced the first and every call meant for one went to the other.
|
|
44
|
-
* Silent in-process, and worse than silent under a split: `createRemoteRouter` guards its
|
|
45
|
-
* index with `if (!byEntity.has(...))`, so THERE the first frond discovered wins. The same
|
|
46
|
-
* application answered differently depending on how it was deployed.
|
|
47
|
-
*
|
|
48
|
-
* Refusing is the honest answer while a key cannot say which frond owns it. It is not the
|
|
49
|
-
* last word: qualify the key and this boot can accept both. ORMs and repositories are not
|
|
50
|
-
* checked because they are registered in the frond's own scope, where two fronds do not meet.
|
|
51
|
-
*
|
|
52
|
-
* A frond declared remote registers nothing locally, so it cannot collide here. Two REMOTE
|
|
53
|
-
* fronds publishing one entity still shadow each other inside the router — a hole this
|
|
54
|
-
* check does not reach.
|
|
55
|
-
*/
|
|
36
|
+
/** Two fronds cannot claim one name — said at boot, because nothing else says it. */
|
|
56
37
|
function assertOneOwnerPerKey(fronds, remotes) {
|
|
57
38
|
const owner = new Map();
|
|
58
39
|
const claim = (key, frond, what) => {
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
throw new Error(`Two fronds claim the key '${key}': '${
|
|
40
|
+
const first = owner.get(key);
|
|
41
|
+
if (first !== undefined && first !== frond) {
|
|
42
|
+
throw new Error(`Two fronds claim the key '${key}': '${first}' and '${frond}'.\n`
|
|
62
43
|
+ ` A ${what} is registered under a key that names no frond, so one would silently replace the other.\n`
|
|
63
44
|
+ ` - Rename one of the two classes, or\n`
|
|
64
45
|
+ ` - keep one of the two fronds out of this process (--fronds), or declare it in remotes:`);
|
|
@@ -92,6 +73,14 @@ export async function createApp(options) {
|
|
|
92
73
|
// no builtin and a Worker can run what it builds.
|
|
93
74
|
const scanStart = performance.now();
|
|
94
75
|
const { fronds, diagnostics } = await hostedBy(options);
|
|
76
|
+
// An app that states nothing AND scans nothing is a mistake — unless something else it
|
|
77
|
+
// declares brings its own entities, which an auth provider does. Refused here and not in
|
|
78
|
+
// `hostedBy`, which is handed the frond sources and cannot see the rest of the app. The
|
|
79
|
+
// condition is the KEYS, not the count: a scan that found nothing is an ordinary answer.
|
|
80
|
+
if (!options.fronds && !options.scan && !options.auth) {
|
|
81
|
+
throw new Error('createApp needs `fronds:` (what this app states) or `scan:` (what a scanner found). '
|
|
82
|
+
+ 'Neither was given, and nothing else declares entities of its own.');
|
|
83
|
+
}
|
|
95
84
|
const operationModel = resolveEffectiveOperations(fronds, {
|
|
96
85
|
diagnostics,
|
|
97
86
|
remotes: options.remotes,
|
|
@@ -101,24 +90,13 @@ export async function createApp(options) {
|
|
|
101
90
|
const blocking = diagnostics.filter((d) => d.severity === 'blocking');
|
|
102
91
|
log.info(`read ${fronds.length} frond(s) in ${scanMs}ms`
|
|
103
92
|
+ (diagnostics.length ? ` — ${diagnostics.length} thing(s) the scan could not do` : ''));
|
|
104
|
-
/**
|
|
105
|
-
* Say what could not be read, at the one line everyone already watches.
|
|
106
|
-
*
|
|
107
|
-
* Not a refusal: an app whose `presenters/` is unreadable still serves its
|
|
108
|
-
* entities, and stopping the boot would trade a partial app for none. But it is
|
|
109
|
-
* an ERROR, not a debug line — the app now serves less than its source declares,
|
|
110
|
-
* and nothing downstream can tell that from a source that declares less.
|
|
111
|
-
*/
|
|
93
|
+
/** Say what could not be read, at the one line everyone already watches. */
|
|
112
94
|
for (const d of blocking)
|
|
113
95
|
log.error(`[${d.code}] ${d.message}`, d.cause);
|
|
114
96
|
for (const d of diagnostics)
|
|
115
97
|
if (d.severity === 'warning')
|
|
116
98
|
log.warn(`[${d.code}] ${d.message}`);
|
|
117
|
-
/**
|
|
118
|
-
* An ambiguous convention is not a partial scan. Every relevant declaration was read,
|
|
119
|
-
* but more than one executable contract can be built from it. Refuse before auth,
|
|
120
|
-
* storage, migrations or seeds make the boot observable.
|
|
121
|
-
*/
|
|
99
|
+
/** An ambiguous convention is not a partial scan. */
|
|
122
100
|
const invalidOperations = operationModel.resolutionDiagnostics
|
|
123
101
|
.filter((diagnostic) => diagnostic.severity === 'blocking');
|
|
124
102
|
if (invalidOperations.length > 0) {
|
|
@@ -128,11 +106,11 @@ export async function createApp(options) {
|
|
|
128
106
|
}
|
|
129
107
|
// Auth runtime — built once from the lazy AuthConfig produced by a provider factory
|
|
130
108
|
// (e.g. betterAuth({...})) in fougere.config.ts. The provider receives our db +
|
|
131
|
-
//
|
|
109
|
+
// storageFactory so all auth writes flow through Storage.
|
|
132
110
|
let authRuntime;
|
|
133
111
|
if (options.auth) {
|
|
134
|
-
if (!options.
|
|
135
|
-
throw new Error('createApp: `auth` is set but `
|
|
112
|
+
if (!options.storageFactory) {
|
|
113
|
+
throw new Error('createApp: `auth` is set but `storageFactory` is missing — auth providers need it to back their adapter.');
|
|
136
114
|
}
|
|
137
115
|
if (options.db === undefined) {
|
|
138
116
|
throw new Error('createApp: `auth` is set but `db` is missing — pass the storage handle through CreateAppOptions.db.');
|
|
@@ -140,11 +118,11 @@ export async function createApp(options) {
|
|
|
140
118
|
log.info('initializing auth runtime');
|
|
141
119
|
authRuntime = await options.auth.create({
|
|
142
120
|
db: options.db,
|
|
143
|
-
|
|
121
|
+
storageFactory: options.storageFactory,
|
|
144
122
|
});
|
|
145
123
|
log.info(`auth ready — mounted at ${authRuntime.basePath}`);
|
|
146
124
|
}
|
|
147
|
-
// Remote routing —
|
|
125
|
+
// Remote routing — validated at boot: declaring remotes without a transport is a config error.
|
|
148
126
|
// A remote declaration wins over local presence: `remotes: { blog: url }` IS
|
|
149
127
|
// the topology statement — the frond's code may sit in fronds/**, it runs elsewhere.
|
|
150
128
|
const declaredRemotes = Object.entries(options.remotes ?? {});
|
|
@@ -171,7 +149,7 @@ export async function createApp(options) {
|
|
|
171
149
|
return [...globalMiddlewares, ...scoped];
|
|
172
150
|
}
|
|
173
151
|
assertOneOwnerPerKey(fronds, options.remotes);
|
|
174
|
-
// Every entity of every frond, by name — so a fact can be
|
|
152
|
+
// Every entity of every frond, by name — so a fact can be validated where it LANDS, and
|
|
175
153
|
// so a `reads:` clause can name a neighbour's.
|
|
176
154
|
const entityByName = fronds.schemas();
|
|
177
155
|
// Which frond holds an entity — what turns "a member is remote" into a refusal that
|
|
@@ -204,13 +182,13 @@ export async function createApp(options) {
|
|
|
204
182
|
// `reads:` is what makes a cross-source reader exist here, and the list IS its
|
|
205
183
|
// environment — a source holding none of these is never opened. Registered under
|
|
206
184
|
// the type's own name, which is the key `depKeyOf` already derives for a plain
|
|
207
|
-
// parameter: `constructor(private
|
|
185
|
+
// parameter: `constructor(private reads: Reads)` and nothing else to say.
|
|
208
186
|
// Declaring `reads:` with nothing to build the reader is a boot that ignores a
|
|
209
|
-
// clause: the handler asking for `
|
|
187
|
+
// clause: the handler asking for `Reads` then dies at its first call, on a
|
|
210
188
|
// container message that names neither the clause nor what is missing.
|
|
211
189
|
if (frond.reads?.length && !options.sourcesFactory) {
|
|
212
190
|
frondLog.warn(`[reads] ${frond.reads.join(', ')} — declared in frond.config.ts, but this boot passes no `
|
|
213
|
-
+ '`sourcesFactory`, so no reader is registered and a handler asking for `
|
|
191
|
+
+ '`sourcesFactory`, so no reader is registered and a handler asking for `Reads` will fail '
|
|
214
192
|
+ 'at its first call. Pass one (`@fougere/adapter-duckdb`), or drop the clause.');
|
|
215
193
|
}
|
|
216
194
|
if (frond.reads?.length && options.sourcesFactory) {
|
|
@@ -226,13 +204,13 @@ export async function createApp(options) {
|
|
|
226
204
|
frondLog.warn(`[reads] ${missing.join(', ')} — named in frond.config.ts but scanned nowhere in this app, `
|
|
227
205
|
+ 'so a query naming one would find no table. Check the spelling, or the entity file.');
|
|
228
206
|
}
|
|
229
|
-
scope.registerValue('
|
|
207
|
+
scope.registerValue('Reads', await options.sourcesFactory(named, frond.name));
|
|
230
208
|
frondLog.debug(`cross-source reader over ${named.length} entit(ies)`);
|
|
231
209
|
}
|
|
232
210
|
// Who owns what, and the rule that makes owning mean something. Before anything is
|
|
233
211
|
// registered, so a bad line is named by this refusal rather than by the container's.
|
|
234
212
|
const owners = ownersOf(frond.providers);
|
|
235
|
-
|
|
213
|
+
refuseStorageInUserCode(frond, owners, (entity) => entityByName.has(entity));
|
|
236
214
|
refuseCrudOnOwned(frond, owners);
|
|
237
215
|
for (const provider of frond.providers) {
|
|
238
216
|
scope.register(provider.ctor.name, provider.ctor, { deps: provider.deps });
|
|
@@ -249,25 +227,25 @@ export async function createApp(options) {
|
|
|
249
227
|
if (frond.providers.length > 0) {
|
|
250
228
|
frondLog.debug(`${frond.providers.length} provider(s): ${frond.providers.map((p) => p.ctor.name).join(', ')}`);
|
|
251
229
|
}
|
|
252
|
-
// Register
|
|
253
|
-
// When a handler declares Crud(Entity, Output), scope the
|
|
254
|
-
if (options.
|
|
230
|
+
// Register Storage for each entity — PascalCase type name (e.g. 'PostStorage')
|
|
231
|
+
// When a handler declares Crud(Entity, Output), scope the storage via .output(Output)
|
|
232
|
+
if (options.storageFactory) {
|
|
255
233
|
for (const entity of frond.entities) {
|
|
256
|
-
const
|
|
257
|
-
const
|
|
234
|
+
const key = storageKeyOf(entity.name);
|
|
235
|
+
const baseStorage = options.storageFactory(entity.entityClass, entity.name);
|
|
258
236
|
// Check if the default handler (no surface) declares an output override
|
|
259
237
|
const defaultHandler = frond.handlers.find((h) => h.address === entity.name && !h.surface);
|
|
260
238
|
const outputSchema = defaultHandler?.outputOverride ?? defaultHandler?.ctor?.__output;
|
|
261
239
|
const scoped = outputSchema && outputSchema !== entity.entityClass
|
|
262
|
-
?
|
|
263
|
-
:
|
|
240
|
+
? baseStorage.output(outputSchema)
|
|
241
|
+
: baseStorage;
|
|
264
242
|
// Storage is a way out like the client surface — see `StorageGuard`.
|
|
265
243
|
const guarded = new StorageGuard(entity.entityClass.getFields(), entity.name).guard(scoped);
|
|
266
|
-
scope.registerValue(
|
|
244
|
+
scope.registerValue(key, guarded);
|
|
267
245
|
// The default repository IS the guarded port — it already answers every gesture a
|
|
268
246
|
// declared one forwards, so the two forms have the same shape and a handler reads
|
|
269
|
-
// `repo.list()` either way. The wrapper that used to sit here (`{
|
|
270
|
-
// existed to make `repo.
|
|
247
|
+
// `repo.list()` either way. The wrapper that used to sit here (`{ storage: guarded }`)
|
|
248
|
+
// existed to make `repo.storage` true in both, back when `.storage` was the way in.
|
|
271
249
|
//
|
|
272
250
|
// Not registered for an OWNED entity: an aggregate's members are reached through it
|
|
273
251
|
// and nowhere else, and the default would be a second door under a name a handler
|
|
@@ -283,7 +261,7 @@ export async function createApp(options) {
|
|
|
283
261
|
}
|
|
284
262
|
}
|
|
285
263
|
if (frond.entities.length > 0) {
|
|
286
|
-
frondLog.debug(`${frond.entities.length} entity
|
|
264
|
+
frondLog.debug(`${frond.entities.length} entity storage(s): ${frond.entities.map((e) => e.name).join(', ')}`);
|
|
287
265
|
}
|
|
288
266
|
}
|
|
289
267
|
// Frames, after the ORMs and before anything that may ask for one. A frame is read
|
|
@@ -293,8 +271,9 @@ export async function createApp(options) {
|
|
|
293
271
|
entityByName,
|
|
294
272
|
frondOf,
|
|
295
273
|
hostedHere: (name) => !(options.remotes && name in options.remotes),
|
|
296
|
-
|
|
274
|
+
storageFactory: options.storageFactory,
|
|
297
275
|
sourceOf: options.sourceOf,
|
|
276
|
+
transacts: options.transacts,
|
|
298
277
|
transacted: options.transacted,
|
|
299
278
|
log: frondLog,
|
|
300
279
|
});
|
|
@@ -321,22 +300,24 @@ export async function createApp(options) {
|
|
|
321
300
|
const defaultHandlerMap = new Map(defaultHandlers.map((h) => [h.address, h]));
|
|
322
301
|
/** Build the door of a handler and register it under the audience it serves. */
|
|
323
302
|
const buildFacade = (entity, handler, targetScope, facadeKey) => {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
303
|
+
if (inheritsCrud(handler.ctor) && !entity) {
|
|
304
|
+
// An installed Crud subject may be absent from the local scan.
|
|
305
|
+
frondLog.debug(`${handler.ctor.name} extends Crud() and no scanned entity is named `
|
|
306
|
+
+ `'${subjectOf(handler.ctor, handler.address)}' — installed entity, or a missing `
|
|
307
|
+
+ `one: no storage will be injected`);
|
|
308
|
+
}
|
|
309
|
+
const facade = new HandlerFacade(handler, targetScope, {
|
|
329
310
|
key: facadeKey,
|
|
330
|
-
operations: operationModel.forHandler(handler),
|
|
331
|
-
}, {
|
|
332
311
|
frond: frond.name,
|
|
333
|
-
|
|
334
|
-
|
|
312
|
+
handlers: frond.handlers,
|
|
313
|
+
operations: operationModel.forHandler(handler),
|
|
335
314
|
collectors: collectorTypeNames,
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
315
|
+
presenter: presenterMap.get(handler.address),
|
|
316
|
+
presenterScope: scope,
|
|
317
|
+
middlewares: () => getMiddlewares(handler.address),
|
|
339
318
|
});
|
|
319
|
+
// Emissions use the same contracts and execution path as direct calls.
|
|
320
|
+
emissions.note(facade.contracts, facadeKey);
|
|
340
321
|
// The terms alongside the door, under the same audience — a surface that serves
|
|
341
322
|
// fewer ops describes fewer ops.
|
|
342
323
|
container.registerValue(contractsKeyOf(handler.address, handler.surface), facade.contracts);
|
|
@@ -357,11 +338,11 @@ export async function createApp(options) {
|
|
|
357
338
|
operation,
|
|
358
339
|
...(surface !== undefined ? { surface } : {}),
|
|
359
340
|
});
|
|
360
|
-
routeRegistry.register(new OperationRoute('local', address, (call) => facade.
|
|
341
|
+
routeRegistry.register(new OperationRoute('local', address, (call) => facade.execute(operation, call.invocation)));
|
|
361
342
|
}
|
|
362
343
|
}
|
|
363
|
-
const
|
|
364
|
-
container.registerValue(facadeKey,
|
|
344
|
+
const operations = facadeOperations(handler.surface ? localDispatcher : dispatcher, handler.address, routeRegistry.operationNames(handler.address, handler.surface), handler.surface);
|
|
345
|
+
container.registerValue(facadeKey, operations);
|
|
365
346
|
};
|
|
366
347
|
// A presenter is about an entity — computed fields sit on a shape — so this walks
|
|
367
348
|
// entities. Exposing the instance lazily; the bridge resolves it on first access.
|
|
@@ -395,7 +376,7 @@ export async function createApp(options) {
|
|
|
395
376
|
const facadeKey = facadeKeyOf(handler.address);
|
|
396
377
|
buildFacade(entity, handler, scope, facadeKey);
|
|
397
378
|
frondLog.debug(`${facadeKey} [${Object.keys(container.resolve(facadeKey)).join(', ')}]`
|
|
398
|
-
+ (entity ? '' : ' — no entity of that name: no
|
|
379
|
+
+ (entity ? '' : ' — no entity of that name: no storage, no projection, no presenter'));
|
|
399
380
|
}
|
|
400
381
|
// The dual, and it stays: a shape that declares no operation answers nothing. Said
|
|
401
382
|
// once per entity rather than deduced from a silence.
|
|
@@ -404,7 +385,7 @@ export async function createApp(options) {
|
|
|
404
385
|
frondLog.debug(`${entity.name} — entity only, no handler: exposes nothing`);
|
|
405
386
|
}
|
|
406
387
|
}
|
|
407
|
-
// Surface handlers — create sub-scope per surface handler with scoped
|
|
388
|
+
// Surface handlers — create sub-scope per surface handler with scoped storage
|
|
408
389
|
//
|
|
409
390
|
// Pointing at nothing is legal HERE TOO. This loop used to `continue` when no entity
|
|
410
391
|
// carried the handler's name, so `handlers/public/SearchHandler.ts` with no `Search`
|
|
@@ -413,24 +394,24 @@ export async function createApp(options) {
|
|
|
413
394
|
for (const handler of surfaceHandlers) {
|
|
414
395
|
const entity = frond.entities.find((e) => e.name === handler.address);
|
|
415
396
|
const surfaceScope = scope.createScope();
|
|
416
|
-
// Register scoped
|
|
397
|
+
// Register scoped storage if output override differs from entity — under the REPOSITORY
|
|
417
398
|
// key, which is what a Crud handler asks for, and under the port's own for a holder
|
|
418
399
|
// that legitimately names it. Registering only the latter left a named surface with
|
|
419
400
|
// no door at all once the façade stopped spelling the storage.
|
|
420
|
-
if (entity && options.
|
|
421
|
-
const
|
|
401
|
+
if (entity && options.storageFactory) {
|
|
402
|
+
const baseStorage = options.storageFactory(entity.entityClass, entity.name);
|
|
422
403
|
const outputSchema = handler.outputOverride ?? handler.ctor.__output;
|
|
423
404
|
const scoped = outputSchema && outputSchema !== entity.entityClass
|
|
424
|
-
?
|
|
425
|
-
:
|
|
405
|
+
? baseStorage.output(outputSchema)
|
|
406
|
+
: baseStorage;
|
|
426
407
|
const guarded = new StorageGuard(entity.entityClass.getFields(), entity.name).guard(scoped);
|
|
427
|
-
surfaceScope.registerValue(
|
|
408
|
+
surfaceScope.registerValue(storageKeyOf(entity.name), guarded);
|
|
428
409
|
surfaceScope.registerValue(repositoryKeyOf(entity.name), guarded);
|
|
429
410
|
}
|
|
430
411
|
const facadeKey = facadeKeyOf(handler.address, handler.surface);
|
|
431
412
|
buildFacade(entity, handler, surfaceScope, facadeKey);
|
|
432
413
|
frondLog.debug(`${facadeKey} [${Object.keys(container.resolve(facadeKey)).join(', ')}]`
|
|
433
|
-
+ (entity ? '' : ' — no entity of that name: no
|
|
414
|
+
+ (entity ? '' : ' — no entity of that name: no storage, no projection, no presenter'));
|
|
434
415
|
}
|
|
435
416
|
// A named surface is closed, so what it contains is a fact worth stating.
|
|
436
417
|
// Saying it at boot is the difference between a rule and a rule you can
|
|
@@ -459,17 +440,7 @@ export async function createApp(options) {
|
|
|
459
440
|
}
|
|
460
441
|
// Once every door exists: what is announced here and what is listened to are both known.
|
|
461
442
|
emissions.register();
|
|
462
|
-
/**
|
|
463
|
-
* The last resort, held by the container so every resolution path shares it.
|
|
464
|
-
*
|
|
465
|
-
* It used to live on `app.resolve` alone, which meant the runner found a remote façade
|
|
466
|
-
* and dependency injection did not — a handler asking for a neighbour that had moved
|
|
467
|
-
* got `is not registered` while the very same call over the wire worked. One door now.
|
|
468
|
-
*
|
|
469
|
-
* Surface-scoped keys ('admin:productHandler') stay local: a named surface resolves in
|
|
470
|
-
* this container only, so fabricating one for a remote frond would answer NOT_FOUND on
|
|
471
|
-
* everything (see Known issues).
|
|
472
|
-
*/
|
|
443
|
+
/** The last resort, held by the container so every resolution path shares it. */
|
|
473
444
|
container.setFallback?.((name) => {
|
|
474
445
|
if (!remoteRouter)
|
|
475
446
|
return undefined;
|
|
@@ -479,15 +450,11 @@ export async function createApp(options) {
|
|
|
479
450
|
// `lowerFirst` because a DEPENDENCY names the type as written — `ProductHandler`,
|
|
480
451
|
// PascalCase — while a card declares `product`, so the raw strip asked the router for
|
|
481
452
|
// 'Product' and every by-type dependency on a remote handler answered NOT_FOUND.
|
|
482
|
-
return
|
|
453
|
+
return facadeOperations(dispatcher, lowerFirst(name.replace(/Handler$/, '')));
|
|
483
454
|
});
|
|
484
455
|
/**
|
|
485
|
-
* Everything this app holds, let go in reverse of how it was taken: what an extension
|
|
486
|
-
*
|
|
487
|
-
*
|
|
488
|
-
* It does NOT wait for running calls — `drain()` is that, and it is a separate gesture
|
|
489
|
-
* because waiting and releasing do not have the same owner: a test releases at once, a
|
|
490
|
-
* host turning the ring wants the work finished first.
|
|
456
|
+
* Everything this app holds, let go in reverse of how it was taken: what an extension took on
|
|
457
|
+
* last, then the container's own, then whoever handed a resource in.
|
|
491
458
|
*/
|
|
492
459
|
const release = async () => {
|
|
493
460
|
// Every level is told to close even when one refuses, and the refusals leave together —
|
|
@@ -512,13 +479,7 @@ export async function createApp(options) {
|
|
|
512
479
|
throw new AggregateError(refused, `${refused.length} refusal(s) while releasing the app`);
|
|
513
480
|
}
|
|
514
481
|
};
|
|
515
|
-
/**
|
|
516
|
-
* Stop taking calls, and resolve once the ones already running are done.
|
|
517
|
-
*
|
|
518
|
-
* Refuses on `timeoutMs` rather than resolving anyway: a drain that gives up quietly
|
|
519
|
-
* reads exactly like a drain that succeeded, and the caller — who is about to release
|
|
520
|
-
* a storage connection under whatever is left — is the one who must decide.
|
|
521
|
-
*/
|
|
482
|
+
/** Stop taking calls, and resolve once the ones already running are done. */
|
|
522
483
|
const drain = async (timeoutMs) => {
|
|
523
484
|
inflight.close();
|
|
524
485
|
if (timeoutMs === undefined)
|
|
@@ -568,28 +529,7 @@ export async function createApp(options) {
|
|
|
568
529
|
return undefined;
|
|
569
530
|
}
|
|
570
531
|
};
|
|
571
|
-
/**
|
|
572
|
-
* THE membership rule, stated once — every projection reads this and nothing
|
|
573
|
-
* else. It used to live twice, verbatim, in the REST and GraphQL adapters,
|
|
574
|
-
* and two other readers invented their own answer.
|
|
575
|
-
*
|
|
576
|
-
* Naming an audience closes it. Two ways to name an entity into a surface,
|
|
577
|
-
* in precedence order:
|
|
578
|
-
* - `surfaces:` in frond.config.ts — when the list exists, it IS the list;
|
|
579
|
-
* - a handler under `handlers/<surface>/` — which also restricts the façade.
|
|
580
|
-
* `@expose` is a THIRD way and this rule does not read it: the scan sets a
|
|
581
|
-
* boolean, read by the two adapters and by `exposedAdapters` — never here.
|
|
582
|
-
* What neither of the two names is not served. It used to be the reverse: no
|
|
583
|
-
* `public:categoryHandler` meant the FULL CategoryHandler rode the public
|
|
584
|
-
* door, create/update/delete included (measured on demos/nuxt-blog).
|
|
585
|
-
*
|
|
586
|
-
* A named entity with no façade of its own falls back to the default one —
|
|
587
|
-
* that is not the old widening, it is the author saying "this one, as it is".
|
|
588
|
-
* The leak was exposure with no statement behind it.
|
|
589
|
-
*
|
|
590
|
-
* A surface key stays local: a doublure serves whatever the remote's own door
|
|
591
|
-
* serves, which is the remote's business and not ours to re-audience.
|
|
592
|
-
*/
|
|
532
|
+
/** THE membership rule, stated once — every projection reads this and nothing else. */
|
|
593
533
|
const facadeFor = (entity, surface) => {
|
|
594
534
|
if (!surface)
|
|
595
535
|
return facadeAt(facadeKeyOf(entity), true);
|
|
@@ -603,12 +543,12 @@ export async function createApp(options) {
|
|
|
603
543
|
return own;
|
|
604
544
|
const fallback = facadeAt(facadeKeyOf(entity), false);
|
|
605
545
|
return fallback
|
|
606
|
-
?
|
|
546
|
+
? facadeOperations(localDispatcher, entity, routeRegistry.operationNames(entity, surface), surface)
|
|
607
547
|
: undefined;
|
|
608
548
|
};
|
|
609
549
|
if (remoteRouter) {
|
|
610
550
|
const remoteFacades = new Map();
|
|
611
|
-
routeRegistry.addResolver(
|
|
551
|
+
routeRegistry.addResolver(remoteRoutes((entity) => {
|
|
612
552
|
const known = remoteFacades.get(entity);
|
|
613
553
|
if (known)
|
|
614
554
|
return known;
|
|
@@ -630,19 +570,14 @@ export async function createApp(options) {
|
|
|
630
570
|
: undefined;
|
|
631
571
|
};
|
|
632
572
|
/**
|
|
633
|
-
* The storage an entity is backed by — the dual of `facadeFor`, which serves its
|
|
634
|
-
*
|
|
635
|
-
*
|
|
636
|
-
* It resolves through the owning frond's scope, because that is where entity ORMs live:
|
|
637
|
-
* `resolve('UserOrm')` reads the ROOT container and never finds one, so callers outside
|
|
638
|
-
* the frond concluded there was no storage. The seed loop did exactly that, and skipped
|
|
639
|
-
* every entity with no façade — the one case its own fallback existed for.
|
|
573
|
+
* The storage an entity is backed by — the dual of `facadeFor`, which serves its client-facing
|
|
574
|
+
* door.
|
|
640
575
|
*/
|
|
641
|
-
const
|
|
576
|
+
const storageFor = (entity) => {
|
|
642
577
|
const owner = fronds.owner(entity);
|
|
643
578
|
if (!owner)
|
|
644
579
|
return undefined;
|
|
645
|
-
const key =
|
|
580
|
+
const key = storageKeyOf(entity);
|
|
646
581
|
try {
|
|
647
582
|
return container.resolve(`frond:${owner.name}`).resolve(key);
|
|
648
583
|
}
|
|
@@ -650,14 +585,7 @@ export async function createApp(options) {
|
|
|
650
585
|
return undefined;
|
|
651
586
|
}
|
|
652
587
|
};
|
|
653
|
-
/**
|
|
654
|
-
* The presenter of an entity, resolved through its owning frond's scope.
|
|
655
|
-
*
|
|
656
|
-
* Same shape as `ormFor`, and it exists for the same reason: without it an adapter
|
|
657
|
-
* has to spell the container key itself. `schema-graphql` did — a hand-written
|
|
658
|
-
* `${Name}Presenter` — and a key respelled elsewhere finds nothing and says nothing
|
|
659
|
-
* the day the convention moves, which is exactly the failure `verify.ts` refuses.
|
|
660
|
-
*/
|
|
588
|
+
/** The presenter of an entity, resolved through its owning frond's scope. */
|
|
661
589
|
const presenterFor = (entity) => {
|
|
662
590
|
const owner = fronds.owner(entity);
|
|
663
591
|
if (!owner)
|
|
@@ -687,7 +615,7 @@ export async function createApp(options) {
|
|
|
687
615
|
operationsFor,
|
|
688
616
|
listensTo: () => emissions.listensTo(),
|
|
689
617
|
deliver: (fact, payload) => emissions.deliver(fact, payload),
|
|
690
|
-
|
|
618
|
+
storageFor,
|
|
691
619
|
presenterFor,
|
|
692
620
|
dispose: release,
|
|
693
621
|
drain,
|
|
@@ -724,7 +652,22 @@ export async function createApp(options) {
|
|
|
724
652
|
app.serveRpc('discover', (_invocation, surface) => identityCardOf(app, surface));
|
|
725
653
|
// The last thing the boot does, and the first thing a release undoes. An extension may
|
|
726
654
|
// await here — which is what a provider needing to OPEN something could never do.
|
|
727
|
-
|
|
655
|
+
//
|
|
656
|
+
// A refusal here has to release what the boot took, because the caller cannot: it handed
|
|
657
|
+
// `onDispose` over BEFORE this line and never receives the app that would carry it back.
|
|
658
|
+
// Whoever opened a connection to give it to us would otherwise leak it on every failed boot.
|
|
659
|
+
try {
|
|
660
|
+
await appLifecycle.up(app);
|
|
661
|
+
}
|
|
662
|
+
catch (cause) {
|
|
663
|
+
try {
|
|
664
|
+
await release();
|
|
665
|
+
}
|
|
666
|
+
catch (refused) {
|
|
667
|
+
throw new AggregateError([cause, ...(refused instanceof AggregateError ? refused.errors : [refused])], `The boot failed and could not release everything it had taken: ${cause?.message ?? String(cause)}`);
|
|
668
|
+
}
|
|
669
|
+
throw cause;
|
|
670
|
+
}
|
|
728
671
|
return app;
|
|
729
672
|
}
|
|
730
673
|
//# sourceMappingURL=bootstrap.js.map
|