@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/ownership.js
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { lowerFirst } from '@fougere/schema';
|
|
2
|
+
import { inheritsCrud } from '../prefab/crud.js';
|
|
2
3
|
import { targetOf } from '../prefab/prefab.js';
|
|
3
4
|
import { ownedBy, repositoryKeyOf } from '../prefab/repository.js';
|
|
4
|
-
import {
|
|
5
|
-
/**
|
|
6
|
-
* Who owns an entity's storage.
|
|
7
|
-
*
|
|
8
|
-
* `Repository(Commande, Stock)` states it — an aggregate is the only thing that claims
|
|
9
|
-
* entities it is not named after, and the arity is what says so. A repository of ONE owns
|
|
10
|
-
* nothing: a boundary between one thing and nothing is not a boundary, and the judge is
|
|
11
|
-
* already on that entity's rows.
|
|
12
|
-
*/
|
|
5
|
+
import { entityOfStorageKey } from '../storage.js';
|
|
6
|
+
/** Who owns an entity's storage. */
|
|
13
7
|
export function ownersOf(providers) {
|
|
14
8
|
const owners = new Map();
|
|
15
9
|
for (const provider of providers) {
|
|
@@ -33,7 +27,7 @@ export function ownersOf(providers) {
|
|
|
33
27
|
}
|
|
34
28
|
/**
|
|
35
29
|
* The entities a class was BUILT ON — what a prefab may legitimately be handed the storage
|
|
36
|
-
* of. Empty for a plain service, which is why one cannot ask for
|
|
30
|
+
* of. Empty for a plain service, which is why one cannot ask for a storage at all.
|
|
37
31
|
*/
|
|
38
32
|
function builtOn(ctor) {
|
|
39
33
|
const owned = ownedBy(ctor);
|
|
@@ -42,20 +36,8 @@ function builtOn(ctor) {
|
|
|
42
36
|
const target = targetOf(ctor);
|
|
43
37
|
return target?.name ? [lowerFirst(target.name)] : [];
|
|
44
38
|
}
|
|
45
|
-
/**
|
|
46
|
-
|
|
47
|
-
*
|
|
48
|
-
* A door judges and projects; a HOLDER keeps the storage. So the rule is not about which
|
|
49
|
-
* directory a file sits in but about which of the two a class is: a handler, a presenter and
|
|
50
|
-
* a collector may never name an ORM, and a provider may name only the ORM of what its prefab
|
|
51
|
-
* was built on — which is `Repository` and `Mirror`, without either being named here.
|
|
52
|
-
*
|
|
53
|
-
* What it buys beyond one word instead of two: an entity that becomes owned later needs no
|
|
54
|
-
* call site to move, because none of them ever spelled the storage.
|
|
55
|
-
*
|
|
56
|
-
* Refused at boot rather than reported by `verify`, which nothing calls at startup.
|
|
57
|
-
*/
|
|
58
|
-
export function refuseOrmInUserCode(frond, owners) {
|
|
39
|
+
/** `Storage<E>` is not a word of the user's vocabulary — `<E>Repository` is the one way in. */
|
|
40
|
+
export function refuseStorageInUserCode(frond, owners, known) {
|
|
59
41
|
const doors = [
|
|
60
42
|
...frond.handlers.map((h) => ({ ...h, kind: 'handler' })),
|
|
61
43
|
...frond.presenters.map((p) => ({ ...p, kind: 'presenter' })),
|
|
@@ -65,7 +47,7 @@ export function refuseOrmInUserCode(frond, owners) {
|
|
|
65
47
|
for (const decl of [...doors, ...holders]) {
|
|
66
48
|
const allowed = decl.kind === 'provider' ? builtOn(decl.ctor) : [];
|
|
67
49
|
for (const dep of decl.deps) {
|
|
68
|
-
const entity =
|
|
50
|
+
const entity = entityOfStorageKey(dep, known);
|
|
69
51
|
if (!entity)
|
|
70
52
|
continue;
|
|
71
53
|
const owner = owners.get(entity);
|
|
@@ -87,26 +69,11 @@ export function refuseOrmInUserCode(frond, owners) {
|
|
|
87
69
|
}
|
|
88
70
|
}
|
|
89
71
|
}
|
|
90
|
-
/**
|
|
91
|
-
* An owned entity has no automatic CRUD — said at boot, not at the first request.
|
|
92
|
-
*
|
|
93
|
-
* `HandlerFacade.deps()` asks for `<E>Repository` when a handler inherits the five gestures
|
|
94
|
-
* and declares no constructor of its own, and an owned entity has no such key. That alone
|
|
95
|
-
* refuses — but LAZILY, at the first call, on the container's own sentence: measured, the app
|
|
96
|
-
* booted clean and answered every request with `'LedgerRepository' is not registered`. A
|
|
97
|
-
* receiver that starts and then rejects everything is found in production, which is the
|
|
98
|
-
* reason `serve()` checks its address at boot rather than per call.
|
|
99
|
-
*
|
|
100
|
-
* Recognized by FORM, like the façade recognizes it: a prototype carrying `list` and
|
|
101
|
-
* `findById` needs storage of its own, whether `Crud()` put them there or an author did.
|
|
102
|
-
*/
|
|
72
|
+
/** An owned entity has no automatic CRUD — said at boot, not at the first request. */
|
|
103
73
|
export function refuseCrudOnOwned(frond, owners) {
|
|
104
74
|
for (const handler of frond.handlers) {
|
|
105
75
|
const owner = owners.get(handler.address);
|
|
106
|
-
if (!owner || handler.deps.length > 0)
|
|
107
|
-
continue;
|
|
108
|
-
const proto = handler.ctor.prototype;
|
|
109
|
-
if (typeof proto?.list !== 'function' || typeof proto?.findById !== 'function')
|
|
76
|
+
if (!owner || handler.deps.length > 0 || !inheritsCrud(handler.ctor))
|
|
110
77
|
continue;
|
|
111
78
|
throw new Error(`[aggregate] ${handler.ctor.name} takes the five gestures on ${handler.address}, `
|
|
112
79
|
+ `which ${owner} owns.\n`
|
|
@@ -117,11 +84,4 @@ export function refuseCrudOnOwned(frond, owners) {
|
|
|
117
84
|
+ ` ${handler.filePath}`);
|
|
118
85
|
}
|
|
119
86
|
}
|
|
120
|
-
/** `'PostOrm'` → `'post'`, and nothing for a key that is not one. */
|
|
121
|
-
function entityOfOrmKey(dep) {
|
|
122
|
-
if (!dep.endsWith('Orm') || dep === 'Orm')
|
|
123
|
-
return undefined;
|
|
124
|
-
const entity = lowerFirst(dep.slice(0, -'Orm'.length));
|
|
125
|
-
return ormKeyOf(entity) === dep ? entity : undefined;
|
|
126
|
-
}
|
|
127
87
|
//# sourceMappingURL=ownership.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ownership.js","sourceRoot":"","sources":["../../src/boot/ownership.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ownership.js","sourceRoot":"","sources":["../../src/boot/ownership.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,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ACrF,uCAAuC;cACvC,4BAA4B,KAAK,mBAAmB;cACpD,2BAA2B,OAAO,CAAC,OAAO,KAAK,KAAK,QAAQ;cAC5D,KAAK,OAAO,CAAC,QAAQ,EAAE,CAC1B,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/boot/ports.d.ts
CHANGED
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
import type { ProviderEntry } from '../
|
|
2
|
-
/**
|
|
3
|
-
* A port is a class something already answers under. Nothing declares one — the
|
|
4
|
-
* prototype chain states it, so `class StripePayment extends Payment` IS the whole
|
|
5
|
-
* registration, and so is `class MyLogger extends Logger` over a builtin.
|
|
6
|
-
*
|
|
7
|
-
* This is the fourth reading of the rule the other three already apply: the type
|
|
8
|
-
* names the SUBJECT (`EntityOrm<E>`, `Emit<F>`, `Facade<H>`) and the container
|
|
9
|
-
* holds the realization. Providers were the one case where the type named the
|
|
10
|
-
* realization instead, so `constructor(private payment: Payment)` resolved to the
|
|
11
|
-
* base class and a handler got an object whose method did not exist.
|
|
12
|
-
*
|
|
13
|
-
* Only the DIRECT base binds. A deeper chain binds each link to its own child, and
|
|
14
|
-
* a case that wants otherwise states it in `ports:` — which wins over all of this.
|
|
15
|
-
*/
|
|
1
|
+
import type { ProviderEntry } from '../descriptor/frond.js';
|
|
2
|
+
/** A port is a class something already answers under. */
|
|
16
3
|
export declare function portBindings(providers: ProviderEntry[], answers: (name: string) => boolean, chosen: Record<string, string> | undefined): Map<string, ProviderEntry>;
|
|
17
4
|
//# sourceMappingURL=ports.d.ts.map
|
package/dist/boot/ports.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ports.d.ts","sourceRoot":"","sources":["../../src/boot/ports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ports.d.ts","sourceRoot":"","sources":["../../src/boot/ports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,yDAAyD;AACzD,wBAAgB,YAAY,CAC1B,SAAS,EAAE,aAAa,EAAE,EAC1B,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,EAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GACzC,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CA6C5B"}
|
package/dist/boot/ports.js
CHANGED
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A port is a class something already answers under. Nothing declares one — the
|
|
3
|
-
* prototype chain states it, so `class StripePayment extends Payment` IS the whole
|
|
4
|
-
* registration, and so is `class MyLogger extends Logger` over a builtin.
|
|
5
|
-
*
|
|
6
|
-
* This is the fourth reading of the rule the other three already apply: the type
|
|
7
|
-
* names the SUBJECT (`EntityOrm<E>`, `Emit<F>`, `Facade<H>`) and the container
|
|
8
|
-
* holds the realization. Providers were the one case where the type named the
|
|
9
|
-
* realization instead, so `constructor(private payment: Payment)` resolved to the
|
|
10
|
-
* base class and a handler got an object whose method did not exist.
|
|
11
|
-
*
|
|
12
|
-
* Only the DIRECT base binds. A deeper chain binds each link to its own child, and
|
|
13
|
-
* a case that wants otherwise states it in `ports:` — which wins over all of this.
|
|
14
|
-
*/
|
|
1
|
+
/** A port is a class something already answers under. */
|
|
15
2
|
export function portBindings(providers, answers, chosen) {
|
|
16
3
|
// port class name → the classes that extend it, in scan order.
|
|
17
4
|
const candidates = new Map();
|
package/dist/boot/ports.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ports.js","sourceRoot":"","sources":["../../src/boot/ports.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"ports.js","sourceRoot":"","sources":["../../src/boot/ports.ts"],"names":[],"mappings":"AAEA,yDAAyD;AACzD,MAAM,UAAU,YAAY,CAC1B,SAA0B,EAC1B,OAAkC,EAClC,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AI,CAAC,CAAC;YACtB,SAAS;QACX,CAAC;QACD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,gFAAgF;YAChF,gFAAgF;YAChF,4CAA4C;YAC5C,MAAM,IAAI,KAAK,CACb,WAAW,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,IAAI,IAAI;kBAC5E,gFAAgF;kBAChF,kDAAkD,IAAI,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,MAAM;kBACpF,uBAAuB,CAC1B,CAAC;QACJ,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/boot/remote.d.ts
CHANGED
|
@@ -1,28 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Remote façade — what resolve() falls back to.
|
|
3
|
-
*
|
|
4
|
-
* When a handler isn't hosted locally and remotes are declared, resolve()
|
|
5
|
-
* returns a façade-shaped stand-in: same call surface as a local facade,
|
|
6
|
-
* every operation executed through a Transport. Routing is lazy — on the
|
|
7
|
-
* first miss, each declared remote is asked what it hosts (rpc.discover)
|
|
8
|
-
* and the answer is cached. A remote that can't be reached stays pending
|
|
9
|
-
* and is retried on the next miss instead of being cached as absent.
|
|
10
|
-
*/
|
|
1
|
+
/** Remote façade — what resolve() falls back to. */
|
|
11
2
|
import type { Transport } from '../wire/call.js';
|
|
12
3
|
import { type AppMiddleware } from '../wire/middleware.js';
|
|
13
|
-
import { type InvocationContext } from '../
|
|
4
|
+
import { type InvocationContext } from '../wire/Invocation.js';
|
|
14
5
|
import { type SchemaView } from '@fougere/schema';
|
|
15
6
|
interface Route {
|
|
16
7
|
frond: string;
|
|
17
8
|
transport: Transport;
|
|
18
9
|
/**
|
|
19
|
-
* The entity's schema, rebuilt from the identity card — the same
|
|
20
|
-
* `
|
|
21
|
-
* included. Reconstructed once per entity, at discovery time.
|
|
22
|
-
*
|
|
23
|
-
* **Absent when the door stores nothing.** A handler may carry no entity, so the card
|
|
24
|
-
* publishes it with ops and no shape; there is nothing to rebuild and pretending
|
|
25
|
-
* otherwise would hand callers an empty schema that validates everything.
|
|
10
|
+
* The entity's schema, rebuilt from the identity card — the same `SchemaConstructor` shape
|
|
11
|
+
* `entity({...})` produces, live validation included.
|
|
26
12
|
*/
|
|
27
13
|
schema?: SchemaView;
|
|
28
14
|
}
|
|
@@ -31,26 +17,7 @@ export interface RemoteRouter {
|
|
|
31
17
|
}
|
|
32
18
|
export declare function createRemoteRouter(remotes: Record<string, string>, makeTransport: (url: string) => Transport): RemoteRouter;
|
|
33
19
|
type Facade = Record<string, (invocation?: InvocationContext) => Promise<unknown>>;
|
|
34
|
-
/**
|
|
35
|
-
* Façade-shaped stand-in — the consumer can't tell it from a local facade.
|
|
36
|
-
*
|
|
37
|
-
* Every trap answers the same question, and that is the point: the runner asks
|
|
38
|
-
* `Object.hasOwn(facade, op)` before calling, so a proxy that only trapped `get`
|
|
39
|
-
* reported *no* operations and every split call came back `Unknown operation` —
|
|
40
|
-
* `get` said yes, `hasOwn` said no, and the runner believed `hasOwn`.
|
|
41
|
-
*
|
|
42
|
-
* The stand-in claims every legal op name because it cannot know better: routing is
|
|
43
|
-
* lazy on purpose (the card is fetched at the first miss), and the remote is the
|
|
44
|
-
* authority on its own surface anyway. An op it does not serve comes back as its
|
|
45
|
-
* NOT_FOUND — judged where it is owned, which is the same answer a local façade gives.
|
|
46
|
-
*
|
|
47
|
-
* It runs the app's middlewares, like `HandlerFacade` does, because "the consumer can't
|
|
48
|
-
* tell it from a local facade" was false of the one thing a consumer installs: measured,
|
|
49
|
-
* `runMiddlewares` had a single caller, so a frond that moved lost every middleware on
|
|
50
|
-
* the calling side — no log, no retry, no cache — from a `remotes:` line alone.
|
|
51
|
-
* The invocation the transport sends is the one the chain leaves behind, so a middleware
|
|
52
|
-
* can still put something on the wire.
|
|
53
|
-
*/
|
|
20
|
+
/** Façade-shaped stand-in — the consumer can't tell it from a local facade. */
|
|
54
21
|
export declare function createRemoteFacade(entity: string, router: RemoteRouter, middlewaresFor: (address: string) => AppMiddleware[]): Facade;
|
|
55
22
|
export {};
|
|
56
23
|
//# sourceMappingURL=remote.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/boot/remote.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/boot/remote.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,KAAK,EAAa,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAAkB,KAAK,aAAa,EAAyB,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEjF,OAAO,EAAQ,KAAK,UAAU,EAAyB,MAAM,iBAAiB,CAAC;AAG/E,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CACvC;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,GACxC,YAAY,CAoFd;AAED,KAAK,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,EAAE,iBAAiB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AAEnF,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,YAAY,EACpB,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,aAAa,EAAE,GACnD,MAAM,CAYR"}
|
package/dist/boot/remote.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { assertIdentityCard, RPC_ENTITY } from '../wire/call.js';
|
|
2
2
|
import { runMiddlewares } from '../wire/middleware.js';
|
|
3
|
-
import { EMPTY_INVOCATION } from '../
|
|
3
|
+
import { EMPTY_INVOCATION } from '../wire/Invocation.js';
|
|
4
4
|
import { FougereError, ErrorCode } from '../wire/errors.js';
|
|
5
5
|
import { Card } from '@fougere/schema';
|
|
6
|
-
import {
|
|
6
|
+
import { dynamicOperations } from '../entry/facade.js';
|
|
7
7
|
export function createRemoteRouter(remotes, makeTransport) {
|
|
8
8
|
const byEntity = new Map();
|
|
9
9
|
// The remotes config key is a label for the address — the identity card is
|
|
@@ -41,26 +41,12 @@ export function createRemoteRouter(remotes, makeTransport) {
|
|
|
41
41
|
// adding one here would answer a call with a transport to a door that
|
|
42
42
|
// does not exist.
|
|
43
43
|
for (const door of frond.doors) {
|
|
44
|
-
const
|
|
45
|
-
/**
|
|
46
|
-
|
|
47
|
-
*
|
|
48
|
-
* `byEntity` is keyed by the door name alone, so the second claim used to be
|
|
49
|
-
* dropped with `if (!byEntity.has(...))` — no warning, and the winner was
|
|
50
|
-
* whichever remote answered first. The local boot already refuses the same
|
|
51
|
-
* collision (`assertOneOwnerPerKey`) and it refused the OTHER duplicate: in
|
|
52
|
-
* process the last frond loaded won, here the first discovered did. One
|
|
53
|
-
* application, two topologies, two different handlers answering — which is
|
|
54
|
-
* precisely the gradient not holding.
|
|
55
|
-
*
|
|
56
|
-
* Refusing is the honest answer while a call names an entity and not a frond.
|
|
57
|
-
* `FrondCall` already carries an optional `frond`; the day it is required, this
|
|
58
|
-
* becomes a disambiguation instead of a refusal.
|
|
59
|
-
*/
|
|
60
|
-
if (held !== undefined && held !== label) {
|
|
44
|
+
const first = claimedBy.get(door.name);
|
|
45
|
+
/** Two remotes claiming one name is refused, not silently arbitrated. */
|
|
46
|
+
if (first !== undefined && first !== label) {
|
|
61
47
|
throw new FougereError({
|
|
62
48
|
code: ErrorCode.INTERNAL_ERROR,
|
|
63
|
-
message: `Two remotes serve '${door.name}': '${
|
|
49
|
+
message: `Two remotes serve '${door.name}': '${first}' and '${label}'.\n`
|
|
64
50
|
+ ` A call names an entity, not a frond, so nothing could choose between them.\n`
|
|
65
51
|
+ ` - Keep one of the two out of \`remotes:\`, or\n`
|
|
66
52
|
+ ` - expose one of them under a different entity name.`,
|
|
@@ -99,26 +85,7 @@ export function createRemoteRouter(remotes, makeTransport) {
|
|
|
99
85
|
},
|
|
100
86
|
};
|
|
101
87
|
}
|
|
102
|
-
/**
|
|
103
|
-
* Façade-shaped stand-in — the consumer can't tell it from a local facade.
|
|
104
|
-
*
|
|
105
|
-
* Every trap answers the same question, and that is the point: the runner asks
|
|
106
|
-
* `Object.hasOwn(facade, op)` before calling, so a proxy that only trapped `get`
|
|
107
|
-
* reported *no* operations and every split call came back `Unknown operation` —
|
|
108
|
-
* `get` said yes, `hasOwn` said no, and the runner believed `hasOwn`.
|
|
109
|
-
*
|
|
110
|
-
* The stand-in claims every legal op name because it cannot know better: routing is
|
|
111
|
-
* lazy on purpose (the card is fetched at the first miss), and the remote is the
|
|
112
|
-
* authority on its own surface anyway. An op it does not serve comes back as its
|
|
113
|
-
* NOT_FOUND — judged where it is owned, which is the same answer a local façade gives.
|
|
114
|
-
*
|
|
115
|
-
* It runs the app's middlewares, like `HandlerFacade` does, because "the consumer can't
|
|
116
|
-
* tell it from a local facade" was false of the one thing a consumer installs: measured,
|
|
117
|
-
* `runMiddlewares` had a single caller, so a frond that moved lost every middleware on
|
|
118
|
-
* the calling side — no log, no retry, no cache — from a `remotes:` line alone.
|
|
119
|
-
* The invocation the transport sends is the one the chain leaves behind, so a middleware
|
|
120
|
-
* can still put something on the wire.
|
|
121
|
-
*/
|
|
88
|
+
/** Façade-shaped stand-in — the consumer can't tell it from a local facade. */
|
|
122
89
|
export function createRemoteFacade(entity, router, middlewaresFor) {
|
|
123
90
|
const opFn = (op) => async (invocation = EMPTY_INVOCATION) => {
|
|
124
91
|
const { frond, transport } = await router.route(entity);
|
|
@@ -128,6 +95,6 @@ export function createRemoteFacade(entity, router, middlewaresFor) {
|
|
|
128
95
|
};
|
|
129
96
|
return runMiddlewares(middlewaresFor(entity), ctx, () => transport(call, ctx.invocation ?? invocation));
|
|
130
97
|
};
|
|
131
|
-
return
|
|
98
|
+
return dynamicOperations(opFn);
|
|
132
99
|
}
|
|
133
100
|
//# sourceMappingURL=remote.js.map
|
package/dist/boot/remote.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../src/boot/remote.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../src/boot/remote.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,cAAc,EAA6C,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAA0B,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAA0C,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAgBvD,MAAM,UAAU,kBAAkB,CAChC,OAA+B,EAC/B,aAAyC;IAEzC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAiB,CAAC;IAC1C,2EAA2E;IAC3E,8CAA8C;IAC9C,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CA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|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** A Transport built from an app — the two ways a call enters this process. */
|
|
2
|
+
import type { App } from './types.js';
|
|
3
|
+
import type { Transport } from '../wire/call.js';
|
|
4
|
+
/** Build the local runner — the reference realization of Transport. */
|
|
5
|
+
export declare function createLocalRunner(app: App, surface?: string): Transport;
|
|
6
|
+
/**
|
|
7
|
+
* Build the app runner — same verdict, but resolution follows the app's topology: local façades
|
|
8
|
+
* and remote doublures alike.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createAppRunner(app: App, surface?: string): Transport;
|
|
11
|
+
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/boot/runner.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGjD,uEAAuE;AACvE,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAEvE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAErE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createTransportEntry } from '../entry/transport.js';
|
|
2
|
+
/** Build the local runner — the reference realization of Transport. */
|
|
3
|
+
export function createLocalRunner(app, surface) {
|
|
4
|
+
return createTransportEntry(app.local, surface);
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Build the app runner — same verdict, but resolution follows the app's topology: local façades
|
|
8
|
+
* and remote doublures alike.
|
|
9
|
+
*/
|
|
10
|
+
export function createAppRunner(app, surface) {
|
|
11
|
+
return createTransportEntry(app, surface);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/boot/runner.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE7D,uEAAuE;AACvE,MAAM,UAAU,iBAAiB,CAAC,GAAQ,EAAE,OAAgB;IAC1D,OAAO,oBAAoB,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAClD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,GAAQ,EAAE,OAAgB;IACxD,OAAO,oBAAoB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC"}
|
package/dist/boot/seed.d.ts
CHANGED
|
@@ -1,40 +1,13 @@
|
|
|
1
|
-
import type { FrondDescriptor, SeedEntry } from '../
|
|
1
|
+
import type { FrondDescriptor, SeedEntry } from '../descriptor/frond.js';
|
|
2
2
|
import type { App } from './types.js';
|
|
3
3
|
import type { Extension } from './AppLifecycle.js';
|
|
4
|
-
/**
|
|
5
|
-
* Seeds in dependency order — a `ref()` target is planted before its referrer.
|
|
6
|
-
*
|
|
7
|
-
* The order is a fact about the entity graph, not about the surface running the seeds,
|
|
8
|
-
* so it is stated once here. The Nuxt module read it off a pairwise comparator (which
|
|
9
|
-
* `Array.sort` cannot make transitive: `a` before `b` and `b` before `c` never implies
|
|
10
|
-
* `a` before `c`), and `boot()` had no order at all — the same fact, told twice and
|
|
11
|
-
* wrong both times. A list seeded before its owner failed on the foreign key, and the
|
|
12
|
-
* driver's error named neither the entity nor the file.
|
|
13
|
-
*
|
|
14
|
-
* Kahn, like `orderTables` in `@fougere/adapter-sql` — the same shape one level up: there
|
|
15
|
-
* the nodes are tables and the edges FK columns, here they are seeds and the edges the
|
|
16
|
-
* `one` relations of the entities they target. A cycle cannot be satisfied by ordering,
|
|
17
|
-
* so its remaining seeds keep their scan order and land last: the driver refuses what is
|
|
18
|
-
* genuinely impossible, and everything acyclic around it still gets planted.
|
|
19
|
-
*/
|
|
4
|
+
/** Seeds in dependency order — a `ref()` target is planted before its referrer. */
|
|
20
5
|
export declare function orderSeeds(fronds: FrondDescriptor[]): SeedEntry[];
|
|
21
|
-
/**
|
|
22
|
-
* Plant a set of seeds, in the order given. Reports what it did, one line per entity.
|
|
23
|
-
*
|
|
24
|
-
* The one seeding loop. `boot()` had one and the Nuxt module generated a second into its
|
|
25
|
-
* Nitro plugin, which had drifted: no ORM fallback, so an entity with no façade was
|
|
26
|
-
* skipped there and planted here. Two answers to "how does a row get in at boot" is one
|
|
27
|
-
* too many, and the second was the one running in the browser.
|
|
28
|
-
*/
|
|
6
|
+
/** Plant a set of seeds, in the order given. */
|
|
29
7
|
export declare function runSeeds(app: App, seeds: SeedEntry[], report?: (message: string) => void): Promise<void>;
|
|
30
8
|
/**
|
|
31
|
-
* The framework's own ascent for rows, named — so a host can REPLACE it rather than take
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* That is what Nuxt's Nitro plugin had to do: a bundler needs its seed modules spelled out
|
|
35
|
-
* as static imports, so the plugin claimed everything after the boot and its copy of the
|
|
36
|
-
* loop drifted. It now declares an extension under this same name instead, and the delta
|
|
37
|
-
* is one member of a list.
|
|
9
|
+
* The framework's own ascent for rows, named — so a host can REPLACE it rather than take over the
|
|
10
|
+
* whole post-boot to get its own.
|
|
38
11
|
*/
|
|
39
12
|
export declare function seeding(report?: (message: string) => void): Extension;
|
|
40
13
|
//# sourceMappingURL=seed.d.ts.map
|
package/dist/boot/seed.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../src/boot/seed.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAe,MAAM,
|
|
1
|
+
{"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../src/boot/seed.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAe,MAAM,wBAAwB,CAAC;AACtF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,SAAS,EAAE,CAyCjE;AAQD,gDAAgD;AAChD,wBAAsB,QAAQ,CAC5B,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,SAAS,EAAE,EAClB,MAAM,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAe,GAC3C,OAAO,CAAC,IAAI,CAAC,CA+Bf;AAsBD;;;GAGG;AACH,wBAAgB,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,SAAS,CAQrE"}
|
package/dist/boot/seed.js
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
import { Role } from '@fougere/schema';
|
|
2
2
|
import { facadeKeyOf } from '../wire/call.js';
|
|
3
|
-
/**
|
|
4
|
-
* Seeds in dependency order — a `ref()` target is planted before its referrer.
|
|
5
|
-
*
|
|
6
|
-
* The order is a fact about the entity graph, not about the surface running the seeds,
|
|
7
|
-
* so it is stated once here. The Nuxt module read it off a pairwise comparator (which
|
|
8
|
-
* `Array.sort` cannot make transitive: `a` before `b` and `b` before `c` never implies
|
|
9
|
-
* `a` before `c`), and `boot()` had no order at all — the same fact, told twice and
|
|
10
|
-
* wrong both times. A list seeded before its owner failed on the foreign key, and the
|
|
11
|
-
* driver's error named neither the entity nor the file.
|
|
12
|
-
*
|
|
13
|
-
* Kahn, like `orderTables` in `@fougere/adapter-sql` — the same shape one level up: there
|
|
14
|
-
* the nodes are tables and the edges FK columns, here they are seeds and the edges the
|
|
15
|
-
* `one` relations of the entities they target. A cycle cannot be satisfied by ordering,
|
|
16
|
-
* so its remaining seeds keep their scan order and land last: the driver refuses what is
|
|
17
|
-
* genuinely impossible, and everything acyclic around it still gets planted.
|
|
18
|
-
*/
|
|
3
|
+
/** Seeds in dependency order — a `ref()` target is planted before its referrer. */
|
|
19
4
|
export function orderSeeds(fronds) {
|
|
20
5
|
const refs = new Map();
|
|
21
6
|
for (const frond of fronds) {
|
|
@@ -52,21 +37,14 @@ export function orderSeeds(fronds) {
|
|
|
52
37
|
}
|
|
53
38
|
return [...ordered, ...waiting.keys()];
|
|
54
39
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Plant a set of seeds, in the order given. Reports what it did, one line per entity.
|
|
57
|
-
*
|
|
58
|
-
* The one seeding loop. `boot()` had one and the Nuxt module generated a second into its
|
|
59
|
-
* Nitro plugin, which had drifted: no ORM fallback, so an entity with no façade was
|
|
60
|
-
* skipped there and planted here. Two answers to "how does a row get in at boot" is one
|
|
61
|
-
* too many, and the second was the one running in the browser.
|
|
62
|
-
*/
|
|
40
|
+
/** Plant a set of seeds, in the order given. */
|
|
63
41
|
export async function runSeeds(app, seeds, report = () => { }) {
|
|
64
42
|
for (const seed of seeds) {
|
|
65
43
|
const resolve = (name) => app.resolve(name + 'Handler');
|
|
66
44
|
const data = typeof seed.data === 'function' ? await seed.data(resolve) : seed.data;
|
|
67
45
|
const door = doorFor(app, seed.entityName);
|
|
68
46
|
if (!door) {
|
|
69
|
-
report(` ${seed.entityName}: no handler façade nor
|
|
47
|
+
report(` ${seed.entityName}: no handler façade nor storage — skipping seed`);
|
|
70
48
|
continue;
|
|
71
49
|
}
|
|
72
50
|
const existing = await door.list();
|
|
@@ -87,11 +65,7 @@ export async function runSeeds(app, seeds, report = () => { }) {
|
|
|
87
65
|
report(` ${seed.entityName}: ${data.length} records`);
|
|
88
66
|
}
|
|
89
67
|
}
|
|
90
|
-
/**
|
|
91
|
-
* A seed is not a client: it writes at boot, from inside. The façade is used when the
|
|
92
|
-
* entity declares one (its judge catches a bad seed early), the storage when it does
|
|
93
|
-
* not — an entity that exposes nothing is still an entity whose reference rows must land.
|
|
94
|
-
*/
|
|
68
|
+
/** A seed is not a client. */
|
|
95
69
|
function doorFor(app, entityName) {
|
|
96
70
|
let handler;
|
|
97
71
|
try {
|
|
@@ -101,22 +75,17 @@ function doorFor(app, entityName) {
|
|
|
101
75
|
if (typeof handler?.list === 'function' && typeof handler.create === 'function') {
|
|
102
76
|
return {
|
|
103
77
|
list: () => handler.list(),
|
|
104
|
-
write: (item) => handler.create({ params: {}, query: {},
|
|
78
|
+
write: (item) => handler.create({ params: {}, query: {}, input: item, state: {} }),
|
|
105
79
|
};
|
|
106
80
|
}
|
|
107
|
-
const
|
|
108
|
-
if (!
|
|
81
|
+
const storage = app.storageFor(entityName);
|
|
82
|
+
if (!storage)
|
|
109
83
|
return undefined;
|
|
110
|
-
return { list: () =>
|
|
84
|
+
return { list: () => storage.list(), write: (item) => storage.create(item) };
|
|
111
85
|
}
|
|
112
86
|
/**
|
|
113
|
-
* The framework's own ascent for rows, named — so a host can REPLACE it rather than take
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* That is what Nuxt's Nitro plugin had to do: a bundler needs its seed modules spelled out
|
|
117
|
-
* as static imports, so the plugin claimed everything after the boot and its copy of the
|
|
118
|
-
* loop drifted. It now declares an extension under this same name instead, and the delta
|
|
119
|
-
* is one member of a list.
|
|
87
|
+
* The framework's own ascent for rows, named — so a host can REPLACE it rather than take over the
|
|
88
|
+
* whole post-boot to get its own.
|
|
120
89
|
*/
|
|
121
90
|
export function seeding(report) {
|
|
122
91
|
return {
|
package/dist/boot/seed.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed.js","sourceRoot":"","sources":["../../src/boot/seed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAK9C
|
|
1
|
+
{"version":3,"file":"seed.js","sourceRoot":"","sources":["../../src/boot/seed.ts"],"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M,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAC3D,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,24 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* deliberate, and it is the only answer for a method inherited from an installed base class
|
|
6
|
-
* the workspace scan cannot see. But winning silently is how a statement made about
|
|
7
|
-
* `publish(id: string)` keeps applying after the parameter was renamed to `postId`: the
|
|
8
|
-
* façade binds what the config said, the method receives `undefined`, and nothing anywhere
|
|
9
|
-
* says the two disagree.
|
|
10
|
-
*
|
|
11
|
-
* So this compares, and only where BOTH exist — a statement about a signature the scan
|
|
12
|
-
* never read is not drift, it is the case config was built for. It is a `warning` and not
|
|
13
|
-
* a refusal: the statement is still the author's word, and a boot that ran yesterday must
|
|
14
|
-
* not stop running because a parameter moved. What it must not do is stay quiet.
|
|
15
|
-
*/
|
|
16
|
-
import type { FrondDescriptor, HandlerEntry, ScanDiagnostic } from '../scan/frond.js';
|
|
17
|
-
/**
|
|
18
|
-
* What a frond's stated contracts no longer match.
|
|
19
|
-
*
|
|
20
|
-
* Read by `resolveEffectiveOperations`, so the same answer reaches `fougere check` and a
|
|
21
|
-
* boot — one comparison, two readers, no second opinion to drift on its own.
|
|
22
|
-
*/
|
|
1
|
+
/** Where a STATED contract and the signature it is about have stopped agreeing. */
|
|
2
|
+
import type { FrondDescriptor, HandlerEntry } from '../descriptor/frond.js';
|
|
3
|
+
import type { ScanDiagnostic } from '../scan/result.js';
|
|
4
|
+
/** What a frond's stated contracts no longer match. */
|
|
23
5
|
export declare function statementDrift(frond: FrondDescriptor, handler: HandlerEntry): ScanDiagnostic[];
|
|
24
6
|
//# sourceMappingURL=statement-drift.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statement-drift.d.ts","sourceRoot":"","sources":["../../src/boot/statement-drift.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"statement-drift.d.ts","sourceRoot":"","sources":["../../src/boot/statement-drift.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAWxD,uDAAuD;AACvD,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,GAAG,cAAc,EAAE,CA2B9F"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
/** The parameters a
|
|
2
|
-
function namesDisagreeing(
|
|
1
|
+
/** The parameters a binding plan names, against the ones the method declares. */
|
|
2
|
+
function namesDisagreeing(plan, signature) {
|
|
3
3
|
const declared = new Set(signature.params.map((p) => p.name));
|
|
4
|
-
return
|
|
4
|
+
return plan.map((b) => b.name).filter((name) => !declared.has(name));
|
|
5
5
|
}
|
|
6
|
-
/**
|
|
7
|
-
* What a frond's stated contracts no longer match.
|
|
8
|
-
*
|
|
9
|
-
* Read by `resolveEffectiveOperations`, so the same answer reaches `fougere check` and a
|
|
10
|
-
* boot — one comparison, two readers, no second opinion to drift on its own.
|
|
11
|
-
*/
|
|
6
|
+
/** What a frond's stated contracts no longer match. */
|
|
12
7
|
export function statementDrift(frond, handler) {
|
|
13
8
|
const found = [];
|
|
14
9
|
for (const [name, override] of Object.entries(frond.operationsOverrides ?? {})) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statement-drift.js","sourceRoot":"","sources":["../../src/boot/statement-drift.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"statement-drift.js","sourceRoot":"","sources":["../../src/boot/statement-drift.ts"],"names":[],"mappings":"AAMA,iFAAiF;AACjF,SAAS,gBAAgB,CAAC,IAAiB,EAAE,SAAoB;IAC/D,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,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