@fougere/core 0.6.0-alpha.0 → 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 +13 -90
- 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 +2 -12
- package/dist/boot/auth.d.ts.map +1 -1
- package/dist/boot/boot.d.ts +3 -16
- package/dist/boot/boot.d.ts.map +1 -1
- package/dist/boot/boot.js +3 -10
- package/dist/boot/boot.js.map +1 -1
- package/dist/boot/bootstrap.d.ts.map +1 -1
- package/dist/boot/bootstrap.js +61 -127
- package/dist/boot/bootstrap.js.map +1 -1
- package/dist/boot/card.d.ts +1 -17
- package/dist/boot/card.d.ts.map +1 -1
- package/dist/boot/card.js +3 -32
- package/dist/boot/card.js.map +1 -1
- package/dist/boot/frame.d.ts +8 -32
- package/dist/boot/frame.d.ts.map +1 -1
- package/dist/boot/frame.js +20 -54
- package/dist/boot/frame.js.map +1 -1
- package/dist/boot/hosted.d.ts +2 -24
- package/dist/boot/hosted.d.ts.map +1 -1
- package/dist/boot/hosted.js +10 -15
- package/dist/boot/hosted.js.map +1 -1
- package/dist/boot/ownership.d.ts +3 -36
- package/dist/boot/ownership.d.ts.map +1 -1
- package/dist/boot/ownership.js +5 -40
- package/dist/boot/ownership.js.map +1 -1
- package/dist/boot/ports.d.ts +1 -14
- 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 +4 -21
- package/dist/boot/runner.d.ts.map +1 -1
- package/dist/boot/runner.js +4 -17
- package/dist/boot/runner.js.map +1 -1
- package/dist/boot/seed.d.ts +4 -31
- package/dist/boot/seed.d.ts.map +1 -1
- package/dist/boot/seed.js +6 -37
- package/dist/boot/seed.js.map +1 -1
- package/dist/boot/statement-drift.d.ts +2 -21
- 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 +4 -8
- package/dist/boot/together.d.ts.map +1 -1
- package/dist/boot/together.js +15 -50
- package/dist/boot/together.js.map +1 -1
- package/dist/boot/types.d.ts +28 -173
- 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 +6 -36
- package/dist/declare.d.ts.map +1 -1
- package/dist/declare.js +4 -29
- package/dist/declare.js.map +1 -1
- 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 +3 -28
- package/dist/descriptor/Fronds.d.ts.map +1 -1
- package/dist/descriptor/Fronds.js +6 -31
- package/dist/descriptor/Fronds.js.map +1 -1
- package/dist/descriptor/frond.d.ts +14 -63
- package/dist/descriptor/frond.d.ts.map +1 -1
- package/dist/dispatch/ArgumentResolver.d.ts +1 -1
- package/dist/dispatch/ArgumentResolver.d.ts.map +1 -1
- package/dist/dispatch/ArgumentResolver.js +5 -5
- 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 -2
- 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 +8 -7
- package/dist/dispatch/StorageGuard.d.ts.map +1 -1
- package/dist/dispatch/StorageGuard.js +61 -18
- 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 +1 -24
- package/dist/effective-operation.d.ts.map +1 -1
- package/dist/effective-operation.js +21 -50
- 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 +7 -70
- 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/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 +1 -7
- 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 +17 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -18
- 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 +16 -32
- package/dist/prefab/crud.d.ts.map +1 -1
- package/dist/prefab/crud.js +31 -58
- package/dist/prefab/crud.js.map +1 -1
- package/dist/prefab/mirror.d.ts +2 -24
- package/dist/prefab/mirror.d.ts.map +1 -1
- package/dist/prefab/mirror.js +2 -20
- 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 +5 -73
- package/dist/prefab/repository.d.ts.map +1 -1
- package/dist/prefab/repository.js +3 -16
- 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 +1 -5
- package/dist/scan/emit.d.ts.map +1 -1
- package/dist/scan/emit.js +4 -38
- package/dist/scan/emit.js.map +1 -1
- package/dist/scan/handler-parser.d.ts +4 -26
- package/dist/scan/handler-parser.d.ts.map +1 -1
- package/dist/scan/handler-parser.js +26 -83
- package/dist/scan/handler-parser.js.map +1 -1
- package/dist/scan/result.d.ts +3 -16
- package/dist/scan/result.d.ts.map +1 -1
- package/dist/scan/scanner.d.ts +2 -27
- package/dist/scan/scanner.d.ts.map +1 -1
- package/dist/scan/scanner.js +28 -127
- package/dist/scan/scanner.js.map +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 +13 -210
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +4 -68
- package/dist/storage.js.map +1 -1
- 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 +5 -38
- package/dist/verify.d.ts.map +1 -1
- package/dist/verify.js +17 -37
- 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/{contract → wire}/RouteAddress.d.ts +5 -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 +5 -21
- package/dist/wire/binding.d.ts.map +1 -1
- package/dist/wire/binding.js +5 -10
- package/dist/wire/binding.js.map +1 -1
- package/dist/wire/call.d.ts +24 -133
- package/dist/wire/call.d.ts.map +1 -1
- package/dist/wire/call.js +15 -41
- 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 +7 -43
- package/dist/wire/operation.d.ts.map +1 -1
- package/dist/wire/operation.js +4 -15
- package/dist/wire/operation.js.map +1 -1
- package/dist/wire/signature.d.ts +4 -25
- package/dist/wire/signature.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/boot/Emissions.ts +21 -118
- 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 +2 -12
- package/src/boot/boot.ts +5 -20
- package/src/boot/bootstrap.ts +69 -136
- package/src/boot/card.ts +4 -33
- package/src/boot/frame.ts +28 -62
- package/src/boot/hosted.ts +12 -34
- package/src/boot/ownership.ts +5 -39
- package/src/boot/ports.ts +1 -14
- package/src/boot/remote.ts +11 -58
- package/src/boot/runner.ts +5 -22
- package/src/boot/seed.ts +6 -37
- package/src/boot/statement-drift.ts +5 -24
- package/src/boot/together.ts +18 -51
- package/src/boot/types.ts +28 -173
- 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/declare.ts +8 -39
- package/src/define.ts +2 -3
- package/src/descriptor/Fronds.ts +6 -31
- package/src/descriptor/frond.ts +14 -63
- package/src/dispatch/ArgumentResolver.ts +6 -6
- 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 -2
- 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 +70 -18
- 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 +21 -50
- 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 +7 -70
- package/src/identity-keys.ts +3 -16
- package/src/identity.ts +12 -80
- package/src/imports.ts +2 -31
- package/src/index.ts +17 -24
- package/src/loader.ts +2 -16
- package/src/node.ts +2 -11
- package/src/prefab/collector.ts +1 -22
- package/src/prefab/crud.ts +37 -76
- package/src/prefab/mirror.ts +4 -44
- package/src/prefab/prefab.ts +2 -21
- package/src/prefab/presenter.ts +2 -36
- package/src/prefab/repository.ts +7 -83
- 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 +4 -38
- package/src/scan/handler-parser.ts +27 -96
- package/src/scan/result.ts +3 -16
- package/src/scan/scanner.ts +27 -126
- package/src/scan/statement.ts +4 -30
- package/src/source.ts +44 -0
- package/src/storage.ts +14 -234
- package/src/store.ts +152 -0
- package/src/verify.ts +16 -57
- package/src/wire/CallLog.ts +30 -0
- package/src/{contract → wire}/Invocation.ts +24 -17
- package/src/{contract → wire}/RouteAddress.ts +7 -0
- package/src/wire/binding.ts +9 -25
- package/src/wire/call.ts +30 -133
- 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 +8 -48
- package/src/wire/signature.ts +4 -25
- package/dist/boot/HandlerFacade.d.ts.map +0 -1
- package/dist/boot/HandlerFacade.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.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/rows.d.ts +0 -40
- package/dist/rows.d.ts.map +0 -1
- package/dist/rows.js +0 -146
- package/dist/rows.js.map +0 -1
- package/src/boot/HandlerFacade.ts +0 -242
- 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/rows.ts +0 -155
- /package/dist/{contract → wire}/CallLog.js +0 -0
package/dist/index.js
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What a consumer writes, and nothing else.
|
|
3
|
-
*
|
|
4
|
-
* `exports` publishes this barrel and `./contract`, so an import that is not here
|
|
5
|
-
* cannot be reached from outside the package at all — which is what makes this file
|
|
6
|
-
* the contract rather than a convenience. The machinery the boot uses to keep its own
|
|
7
|
-
* promises stays inside: container keys, the binding plan, the mixin's runtime
|
|
8
|
-
* accessors, the config merge. Measured on 2026-08-16, none of them had a single
|
|
9
|
-
* importer anywhere in the workspace.
|
|
10
|
-
*/
|
|
1
|
+
/** What a consumer writes, and nothing else. */
|
|
11
2
|
export { createApp } from './boot/bootstrap.js';
|
|
12
3
|
export { orderSeeds, runSeeds, seeding } from './boot/seed.js';
|
|
13
|
-
export { AppLifecycle,
|
|
4
|
+
export { AppLifecycle, migrating } from './boot/AppLifecycle.js';
|
|
14
5
|
export { defineFougere } from './define.js';
|
|
15
6
|
export { buildGraph, clusterEntities, suggestSplit } from './graph.js';
|
|
16
7
|
export { Crud } from './prefab/crud.js';
|
|
@@ -18,9 +9,9 @@ export { Mirror } from './prefab/mirror.js';
|
|
|
18
9
|
export { Presenter } from './prefab/presenter.js';
|
|
19
10
|
export { Collector } from './prefab/collector.js';
|
|
20
11
|
export { Repository } from './prefab/repository.js';
|
|
21
|
-
export { Invocation, canonicalInvocation, EMPTY_INVOCATION } from './
|
|
22
|
-
export { Call } from './
|
|
23
|
-
export { RouteAddress } from './
|
|
12
|
+
export { Invocation, canonicalInvocation, EMPTY_INVOCATION } from './wire/Invocation.js';
|
|
13
|
+
export { Call } from './wire/call.js';
|
|
14
|
+
export { RouteAddress } from './wire/RouteAddress.js';
|
|
24
15
|
export { DispatchLifecycle } from './dispatch/DispatchLifecycle.js';
|
|
25
16
|
export { Dispatcher } from './dispatch/Dispatcher.js';
|
|
26
17
|
// The class and not only its type: an observer RECEIVES these, so a package that folds
|
|
@@ -43,12 +34,13 @@ export { identityCardOf } from './boot/card.js';
|
|
|
43
34
|
export { callValueOf } from './contract.js';
|
|
44
35
|
export { toHttpError, toPublicError } from './wire/http-error.js';
|
|
45
36
|
export { loggerMiddleware } from './wire/loggerMiddleware.js';
|
|
46
|
-
export { Logger, setLogLevel, logLevel, envLevel, onLog } from './
|
|
37
|
+
export { Logger, setLogLevel, logLevel, envLevel, onLog } from './builtin/logger.js';
|
|
47
38
|
// What a re-read config changes in a running process — and what it cannot.
|
|
48
39
|
export { applyConfig } from './boot/apply.js';
|
|
49
|
-
export { Config } from './
|
|
50
|
-
export {
|
|
51
|
-
export {
|
|
40
|
+
export { Config } from './builtin/config.js';
|
|
41
|
+
export { togetherKeyOf, membersOfTogetherKey } from './storage.js';
|
|
42
|
+
export { Sources } from './source.js';
|
|
43
|
+
export { storageOver } from './store.js';
|
|
52
44
|
export { Fronds } from './descriptor/Fronds.js';
|
|
53
45
|
export { verify, assertSplittable } from './verify.js';
|
|
54
46
|
// Who is calling, established rather than accepted — the proof beside `state`'s claim.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OA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MAAM,kBAAkB,CAAC;AAEtE,yFAAyF;AACzF,mFAAmF;AACnF,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,0FAA0F;AAC1F,wFAAwF;AACxF,yDAAyD;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAMhD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAErF,2EAA2E;AAC3E,OAAO,EAAE,WAAW,EAA0B,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEnE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAiBzC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAkB,MAAM,aAAa,CAAC;AAGvE,uFAAuF;AACvF,sFAAsF;AACtF,mFAAmF;AACnF,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/loader.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Module loader — can be swapped (e.g. jiti for TS files in Nuxt context).
|
|
3
|
-
*
|
|
4
|
-
* `fresh` asks for a file that may have changed since it was last read. Every loader
|
|
5
|
-
* caches, so without it a second read of an EDITED file hands back the first one —
|
|
6
|
-
* which is what re-reading a config is for. A loader that cannot honour it may ignore
|
|
7
|
-
* the flag; it then answers with what it already had.
|
|
8
|
-
*/
|
|
1
|
+
/** Module loader — can be swapped (e.g. */
|
|
9
2
|
export type ModuleLoader = (filePath: string, options?: {
|
|
10
3
|
fresh?: boolean;
|
|
11
4
|
}) => Promise<Record<string, unknown>>;
|
package/dist/loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAGA,2CAA2C;AAC3C,MAAM,MAAM,YAAY,GAAG,CACzB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,KAC1B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAWtC,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAE1D;AAED,oFAAoF;AACpF,wBAAgB,eAAe,IAAI,YAAY,CAE9C"}
|
package/dist/loader.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* How a source file becomes a module — one registry, two readers.
|
|
3
|
-
*
|
|
4
|
-
* The scanner loads fronds and `config-loader` loads a config, and both must use the
|
|
5
|
-
* loader the host installed: a TS file needs jiti under Nuxt and plain `import` under
|
|
6
|
-
* tsx. It lived in `scan/scanner.ts`, so reading a config dragged the scanner, its AST
|
|
7
|
-
* parser and the TypeScript compiler behind it.
|
|
8
|
-
*/
|
|
1
|
+
/** How a source file becomes a module — one registry, two readers. */
|
|
9
2
|
import { pathToFileURL } from 'node:url';
|
|
10
3
|
const defaultLoader = async (filePath, options) => {
|
|
11
4
|
// On the URL, never on the path: `pathToFileURL` percent-encodes a `?` into the
|
package/dist/loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAQzC,MAAM,aAAa,GAAiB,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IAC9D,gFAAgF;IAChF,8EAA8E;IAC9E,MAAM,GAAG,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC;IACzC,OAAO,MAAM,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,MAAM,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACvE,CAAC,CAAC;AAEF,IAAI,YAAY,GAAiB,aAAa,CAAC;AAE/C,kFAAkF;AAClF,MAAM,UAAU,eAAe,CAAC,MAAoB;IAClD,YAAY,GAAG,MAAM,CAAC;AACxB,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,eAAe;IAC7B,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
package/dist/node.d.ts
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What Fougere does with a filesystem — the half of core that a Worker cannot run.
|
|
3
|
-
*
|
|
4
|
-
* The line is not "build vs runtime": `boot()` and `loadConfig` run in production, on a
|
|
5
|
-
* server, every time. It is whether the thing reaches for a disk. Everything here does,
|
|
6
|
-
* transitively, and nothing on the main entry does — which is what lets a bundler for a
|
|
7
|
-
* runtime without `node:fs` trace the main entry and find no builtin at all.
|
|
8
|
-
*
|
|
9
|
-
* The third entry, `@fougere/core/contract`, answers a different question: what crosses a
|
|
10
|
-
* process boundary. A foreign frond reads it without reading our boot.
|
|
11
|
-
*/
|
|
1
|
+
/** What Fougere does with a filesystem — the half of core that a Worker cannot run. */
|
|
12
2
|
export { boot } from './boot/boot.js';
|
|
13
3
|
export { scanProject, frondAliases, watchPathsOf } from './scan/scanner.js';
|
|
14
4
|
export { type Conventions, type ConventionsInput, DEFAULT_CONVENTIONS, resolveConventions, frondPackage, frondDirsOf, providerDirsOf, } from './scan/conventions.js';
|
|
@@ -19,5 +9,6 @@ export { setModuleLoader, getModuleLoader } from './loader.js';
|
|
|
19
9
|
export { loadConfig, loadCascadedConfig } from './config-loader.js';
|
|
20
10
|
export { defineFrond } from './frond-config.js';
|
|
21
11
|
export { crossFrondImports } from './imports.js';
|
|
12
|
+
export { adaptersOf } from './scan/adapters.js';
|
|
22
13
|
export { generateKeyPair, issueGrant } from './identity-keys.js';
|
|
23
14
|
//# sourceMappingURL=node.d.ts.map
|
package/dist/node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EACL,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,mBAAmB,EAC5D,kBAAkB,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,GAC9D,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKhD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/node.js
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What Fougere does with a filesystem — the half of core that a Worker cannot run.
|
|
3
|
-
*
|
|
4
|
-
* The line is not "build vs runtime": `boot()` and `loadConfig` run in production, on a
|
|
5
|
-
* server, every time. It is whether the thing reaches for a disk. Everything here does,
|
|
6
|
-
* transitively, and nothing on the main entry does — which is what lets a bundler for a
|
|
7
|
-
* runtime without `node:fs` trace the main entry and find no builtin at all.
|
|
8
|
-
*
|
|
9
|
-
* The third entry, `@fougere/core/contract`, answers a different question: what crosses a
|
|
10
|
-
* process boundary. A foreign frond reads it without reading our boot.
|
|
11
|
-
*/
|
|
1
|
+
/** What Fougere does with a filesystem — the half of core that a Worker cannot run. */
|
|
12
2
|
export { boot } from './boot/boot.js';
|
|
13
3
|
export { scanProject, frondAliases, watchPathsOf } from './scan/scanner.js';
|
|
14
4
|
export { DEFAULT_CONVENTIONS, resolveConventions, frondPackage, frondDirsOf, providerDirsOf, } from './scan/conventions.js';
|
|
@@ -19,6 +9,7 @@ export { setModuleLoader, getModuleLoader } from './loader.js';
|
|
|
19
9
|
export { loadConfig, loadCascadedConfig } from './config-loader.js';
|
|
20
10
|
export { defineFrond } from './frond-config.js';
|
|
21
11
|
export { crossFrondImports } from './imports.js';
|
|
12
|
+
export { adaptersOf } from './scan/adapters.js';
|
|
22
13
|
// Making a key and binding a name to it happen once, at a deployment, on a machine with
|
|
23
14
|
// a filesystem — the CLI speaking. Verifying happens per call, everywhere, and stays on
|
|
24
15
|
// the main entry behind `#crypto`.
|
package/dist/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EACoC,mBAAmB,EAC5D,kBAAkB,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,GAC9D,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAoB,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,wFAAwF;AACxF,wFAAwF;AACxF,mCAAmC;AACnC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,25 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Collector(Type) — resolves one handler input parameter from the invocation context.
|
|
3
|
-
*
|
|
4
|
-
* The target is a NAME matched against the parameter's type, never a schema: nothing
|
|
5
|
-
* here nor in the scan reads its fields. So `Ability`, built per call from state, sits
|
|
6
|
-
* beside `User`, loaded from a row.
|
|
7
|
-
*
|
|
8
|
-
* The dual of Presenter only in direction. A presenter's subject is a ROW — it adds
|
|
9
|
-
* computed fields to one, so its target must be an entity. A collector's subject is a
|
|
10
|
-
* PARAMETER.
|
|
11
|
-
*
|
|
12
|
-
* Usage:
|
|
13
|
-
* ```ts
|
|
14
|
-
* export default class UserCollector extends Collector(User) {
|
|
15
|
-
* constructor(private userStorage: UserStorage) { super(); }
|
|
16
|
-
*
|
|
17
|
-
* async collect(ctx: InvocationContext) {
|
|
18
|
-
* return this.userStorage.findById(ctx.state.userId as string);
|
|
19
|
-
* }
|
|
20
|
-
* }
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
1
|
+
/** Collector(Type) — resolves one handler input parameter from the invocation context. */
|
|
23
2
|
export declare function Collector<T extends abstract new (...args: any[]) => any>(target: T): {
|
|
24
3
|
new (): {};
|
|
25
4
|
readonly __entity: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../src/prefab/collector.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../src/prefab/collector.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAI1F,wBAAgB,SAAS,CAAC,CAAC,SAAS,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAAE,MAAM,EAAE,CAAC;;;EAKlF;AAED,+FAA+F;AAC/F,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD"}
|
package/dist/prefab/collector.js
CHANGED
|
@@ -1,25 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Collector(Type) — resolves one handler input parameter from the invocation context.
|
|
3
|
-
*
|
|
4
|
-
* The target is a NAME matched against the parameter's type, never a schema: nothing
|
|
5
|
-
* here nor in the scan reads its fields. So `Ability`, built per call from state, sits
|
|
6
|
-
* beside `User`, loaded from a row.
|
|
7
|
-
*
|
|
8
|
-
* The dual of Presenter only in direction. A presenter's subject is a ROW — it adds
|
|
9
|
-
* computed fields to one, so its target must be an entity. A collector's subject is a
|
|
10
|
-
* PARAMETER.
|
|
11
|
-
*
|
|
12
|
-
* Usage:
|
|
13
|
-
* ```ts
|
|
14
|
-
* export default class UserCollector extends Collector(User) {
|
|
15
|
-
* constructor(private userStorage: UserStorage) { super(); }
|
|
16
|
-
*
|
|
17
|
-
* async collect(ctx: InvocationContext) {
|
|
18
|
-
* return this.userStorage.findById(ctx.state.userId as string);
|
|
19
|
-
* }
|
|
20
|
-
* }
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
1
|
+
/** Collector(Type) — resolves one handler input parameter from the invocation context. */
|
|
23
2
|
import { upperFirst } from '@fougere/schema';
|
|
24
3
|
export function Collector(target) {
|
|
25
4
|
class CollectorBase {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector.js","sourceRoot":"","sources":["../../src/prefab/collector.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"collector.js","sourceRoot":"","sources":["../../src/prefab/collector.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAE1F,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,UAAU,SAAS,CAAiD,MAAS;IACjF,MAAM,aAAa;QACjB,MAAM,CAAU,QAAQ,GAAG,MAAM,CAAC;;IAEpC,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC;AACxC,CAAC"}
|
package/dist/prefab/crud.d.ts
CHANGED
|
@@ -1,30 +1,27 @@
|
|
|
1
|
+
import { type EntityConstructor } from '@fougere/schema';
|
|
1
2
|
import type { Storage, ListOptions, ListResult } from '../storage.js';
|
|
2
3
|
import type { OperationContract } from '../wire/operation.js';
|
|
3
|
-
|
|
4
|
+
/**
|
|
5
|
+
* So a class is recognized by what it ANSWERS, since the mixin leaves no other trace.
|
|
6
|
+
* FR : pour qu'une classe se reconnaisse à ce qu'elle répond, le mixin ne laissant rien d'autre.
|
|
7
|
+
* `inheritsCrud(class PostHandler extends Crud(Post) {})` → `true`
|
|
8
|
+
*/
|
|
9
|
+
export declare function inheritsCrud(ctor: unknown): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* So storage follows the shape the handler was built on, which may differ from its address.
|
|
12
|
+
* FR : pour que le stockage suive la forme sur laquelle le handler est bâti.
|
|
13
|
+
* `subjectOf(class Draft extends Crud(Post) {}, 'draft')` → `'post'`
|
|
14
|
+
*/
|
|
15
|
+
export declare function subjectOf(ctor: unknown, address: string): string;
|
|
4
16
|
/** The five ops the mixin fabricates. */
|
|
5
17
|
export type CrudOpName = 'list' | 'findById' | 'create' | 'update' | 'delete';
|
|
6
18
|
/** Which view each op speaks — omitted ops speak the entity, the trivial view. */
|
|
7
19
|
export type CrudViews = Partial<Record<CrudOpName, EntityConstructor>>;
|
|
8
|
-
/**
|
|
9
|
-
* The view an op emits, fabricated: the one declared for it, the single view when the
|
|
10
|
-
* whole handler declares one, the entity otherwise. `PostCard` is not a hand-written
|
|
11
|
-
* type — `Post.pick(...)` derives it field by field, so an op's return is a projection
|
|
12
|
-
* of the entity exactly like the entity is the projection that keeps everything.
|
|
13
|
-
*/
|
|
20
|
+
/** The view an op emits, fabricated. */
|
|
14
21
|
type OutOf<V, K extends CrudOpName, T> = [
|
|
15
22
|
V
|
|
16
23
|
] extends [EntityConstructor] ? InstanceType<V & EntityConstructor> : K extends keyof V ? (V[K] extends EntityConstructor ? InstanceType<V[K]> : T) : T;
|
|
17
|
-
/**
|
|
18
|
-
* The five ops, typed from the entity and its views.
|
|
19
|
-
*
|
|
20
|
-
* Two things the mixin declares but does not own. The **output** is the view the
|
|
21
|
-
* handler names (`Crud(Post, { list: PostCard })`) — fabricated, so a redefinition
|
|
22
|
-
* that returns cards stays assignable. The **trailing parameters** are resolved by
|
|
23
|
-
* type from the container (`delete(id, user?: User)` gets its user from a
|
|
24
|
-
* collector): the mixin cannot know them, they belong to the app, so it declares that
|
|
25
|
-
* a tail exists and that it supplies none — which is what `never` says, and what keeps
|
|
26
|
-
* a judged redefinition assignable.
|
|
27
|
-
*/
|
|
24
|
+
/** The five ops, typed from the entity and its views. */
|
|
28
25
|
export interface CrudOps<T, V = {}> {
|
|
29
26
|
storage: Storage<T>;
|
|
30
27
|
list(options?: ListOptions, ...collected: never[]): Promise<ListResult<OutOf<V, 'list', T>>>;
|
|
@@ -41,20 +38,7 @@ export interface CrudConstructor<T, V = {}> {
|
|
|
41
38
|
readonly __opOutputs?: CrudViews;
|
|
42
39
|
readonly __ops: Record<string, OperationContract>;
|
|
43
40
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Mixin — extends Crud(Entity) to get all 5 typed CRUD methods.
|
|
46
|
-
*
|
|
47
|
-
* The second argument (optional) names the view the ops emit, and comes in two
|
|
48
|
-
* spellings of one idea — a view per op, or one view for all five:
|
|
49
|
-
*
|
|
50
|
-
* Crud(Post) → every op emits Post
|
|
51
|
-
* Crud(Post, { list: PostCard }) → list emits cards, the rest emit Post. Declaration
|
|
52
|
-
* only: the handler keeps its full-row storage, so a
|
|
53
|
-
* judge can still read `body`.
|
|
54
|
-
* Crud(Post, PostPublic) → every op emits PostPublic, and the bootstrap
|
|
55
|
-
* scopes the injected storage via .output(PostPublic) —
|
|
56
|
-
* the whole handler speaks the restricted view.
|
|
57
|
-
*/
|
|
41
|
+
/** Mixin — extends Crud(Entity) to get all 5 typed CRUD methods. */
|
|
58
42
|
export declare function Crud<E extends EntityConstructor, V extends CrudViews | EntityConstructor = {}>(entity: E, output?: V): CrudConstructor<InstanceType<E>, V>;
|
|
59
43
|
export {};
|
|
60
44
|
//# sourceMappingURL=crud.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crud.d.ts","sourceRoot":"","sources":["../../src/prefab/crud.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK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,CAAC;CACnD;AAED,oEAAoE;AACpE,wBAAgB,IAAI,CAAC,CAAC,SAAS,iBAAiB,EAAE,CAAC,SAAS,SAAS,GAAG,iBAAiB,GAAG,EAAE,EAC5F,MAAM,EAAE,CAAC,EACT,MAAM,CAAC,EAAE,CAAC,GACT,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CA8BrC"}
|
package/dist/prefab/crud.js
CHANGED
|
@@ -1,41 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { lowerFirst } from '@fougere/schema';
|
|
2
|
+
import { targetOf } from './prefab.js';
|
|
3
|
+
/**
|
|
4
|
+
* So a class is recognized by what it ANSWERS, since the mixin leaves no other trace.
|
|
5
|
+
* FR : pour qu'une classe se reconnaisse à ce qu'elle répond, le mixin ne laissant rien d'autre.
|
|
6
|
+
* `inheritsCrud(class PostHandler extends Crud(Post) {})` → `true`
|
|
7
|
+
*/
|
|
8
|
+
export function inheritsCrud(ctor) {
|
|
9
|
+
const proto = ctor?.prototype;
|
|
10
|
+
return typeof proto?.list === 'function' && typeof proto?.findById === 'function';
|
|
11
|
+
}
|
|
4
12
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `
|
|
8
|
-
* GraphQL argument needs the type. So a producer that fills only `binding` leaves
|
|
9
|
-
* `adapter/graphql` with nothing to declare — it drops the op (`registerOperations`,
|
|
10
|
-
* `if (!sig) continue`) and four of the five CRUD ops vanish from the schema while
|
|
11
|
-
* the façade and REST still serve them. Measured on an installed app: 16 handlers,
|
|
12
|
-
* 14 with unresolvable heritage, zero `createX` in the schema.
|
|
13
|
+
* So storage follows the shape the handler was built on, which may differ from its address.
|
|
14
|
+
* FR : pour que le stockage suive la forme sur laquelle le handler est bâti.
|
|
15
|
+
* `subjectOf(class Draft extends Crud(Post) {}, 'draft')` → `'post'`
|
|
13
16
|
*/
|
|
17
|
+
export function subjectOf(ctor, address) {
|
|
18
|
+
const target = targetOf(ctor);
|
|
19
|
+
return target?.name ? lowerFirst(target.name) : address;
|
|
20
|
+
}
|
|
21
|
+
/** The id of the row an op acts on — a route segment, or a query fallback. */
|
|
22
|
+
const byId = { name: 'id', source: { kind: 'param', name: 'id' }, optional: false };
|
|
23
|
+
const fromBody = { name: 'input', source: { kind: 'input' }, optional: false };
|
|
24
|
+
/** The same five, written as the scan would have written them. */
|
|
14
25
|
const idParam = { name: 'id', type: { raw: 'string', name: 'string' } };
|
|
15
26
|
const inputParam = (entity) => ({ name: 'input', type: { raw: `Partial<${entity}>`, name: entity } });
|
|
16
27
|
const returns = (raw, name, extra) => ({ raw, name, ...extra });
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
*
|
|
20
|
-
* The mixin built them, so it alone knows their contract in full: what judges
|
|
21
|
-
* their input, where each argument comes from. It says so on the class, at
|
|
22
|
-
* runtime — which is what makes the guarantee independent of the AST scan (an
|
|
23
|
-
* installed app cannot resolve this file, and never needs to).
|
|
24
|
-
*/
|
|
25
|
-
/**
|
|
26
|
-
* `output` says the entity, and saying it costs nothing at runtime.
|
|
27
|
-
*
|
|
28
|
-
* The façade already projected onto the entity when nothing else was named, so this
|
|
29
|
-
* changes no result: `outputFieldsFor` reads `contractOutput` and falls back to the
|
|
30
|
-
* entity, and both are the same shape here. What changes is that the sentence now
|
|
31
|
-
* EXISTS — the identity card publishes `output` per op, and a card was measured
|
|
32
|
-
* carrying none at all (2026-08-06, ten ops, zero outputs), which typed every remote
|
|
33
|
-
* return as `unknown` for anyone building on it.
|
|
34
|
-
*
|
|
35
|
-
* It does not close the view: only an explicit `__opOutputs` does (`closed: perOp !==
|
|
36
|
-
* undefined`), so a named view still wins and a presenter's computed fields still ride
|
|
37
|
-
* out. `delete` names none — a boolean is not a shape.
|
|
38
|
-
*/
|
|
28
|
+
/** The five ops a Crud handler brings, declared rather than discovered. */
|
|
29
|
+
/** `output` says the entity, and saying it costs nothing at runtime. */
|
|
39
30
|
function crudOps(entity) {
|
|
40
31
|
const name = entity.name ?? 'Entity';
|
|
41
32
|
const input = inputParam(name);
|
|
@@ -68,42 +59,24 @@ function crudOps(entity) {
|
|
|
68
59
|
},
|
|
69
60
|
};
|
|
70
61
|
}
|
|
71
|
-
/**
|
|
72
|
-
* The mixin's single "trust me" point — the twin of `asSchemaConstructor` in @fougere/schema.
|
|
73
|
-
*
|
|
74
|
-
* The implementation returns whatever the storage hands back; the declaration names the view
|
|
75
|
-
* each op emits at the port. TypeScript cannot connect the two (the view is a runtime
|
|
76
|
-
* argument, the type is a generic), so one assertion states that the mixin honours what it
|
|
77
|
-
* declared — and the façade makes it true, projecting each op's result onto its view
|
|
78
|
-
* (`outputFieldsFor` in `bootstrap.ts`).
|
|
79
|
-
*/
|
|
62
|
+
/** The mixin's single "trust me" point — the twin of `asSchemaConstructor` in @fougere/schema. */
|
|
80
63
|
function asCrudConstructor(impl) {
|
|
81
64
|
return impl;
|
|
82
65
|
}
|
|
83
|
-
/**
|
|
84
|
-
* Mixin — extends Crud(Entity) to get all 5 typed CRUD methods.
|
|
85
|
-
*
|
|
86
|
-
* The second argument (optional) names the view the ops emit, and comes in two
|
|
87
|
-
* spellings of one idea — a view per op, or one view for all five:
|
|
88
|
-
*
|
|
89
|
-
* Crud(Post) → every op emits Post
|
|
90
|
-
* Crud(Post, { list: PostCard }) → list emits cards, the rest emit Post. Declaration
|
|
91
|
-
* only: the handler keeps its full-row storage, so a
|
|
92
|
-
* judge can still read `body`.
|
|
93
|
-
* Crud(Post, PostPublic) → every op emits PostPublic, and the bootstrap
|
|
94
|
-
* scopes the injected storage via .output(PostPublic) —
|
|
95
|
-
* the whole handler speaks the restricted view.
|
|
96
|
-
*/
|
|
66
|
+
/** Mixin — extends Crud(Entity) to get all 5 typed CRUD methods. */
|
|
97
67
|
export function Crud(entity, output) {
|
|
98
68
|
// A view is a class (it carries fields) ; a map of views is a plain object.
|
|
99
69
|
const perOp = typeof output === 'object' && output !== null ? output : undefined;
|
|
100
70
|
const wholeHandler = typeof output === 'function' ? output : undefined;
|
|
101
71
|
return asCrudConstructor(class CrudHandler {
|
|
102
72
|
static __entity = entity;
|
|
103
|
-
/** Handler-wide view only — a per-op map must NOT scope the storage the
|
|
73
|
+
/** Handler-wide view only — a per-op map must NOT scope the storage the validators read. */
|
|
104
74
|
static __output = wholeHandler ?? entity;
|
|
105
75
|
static __opOutputs = perOp;
|
|
106
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* What this prefab handler declares — read by the façade, merged under the author's own
|
|
78
|
+
* methods.
|
|
79
|
+
*/
|
|
107
80
|
static __ops = crudOps(entity);
|
|
108
81
|
storage;
|
|
109
82
|
constructor(storage) {
|
package/dist/prefab/crud.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crud.js","sourceRoot":"","sources":["../../src/prefab/crud.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"crud.js","sourceRoot":"","sources":["../../src/prefab/crud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,iBAAiB,CAAC;AAGtF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,IAAa;IACxC,MAAM,KAAK,GAAI,IAA4D,EAAE,SAAS,CAAC;IAEvF,OAAO,OAAO,KAAK,EAAE,IAAI,KAAK,UAAU,IAAI,OAAO,KAAK,EAAE,QAAQ,KAAK,UAAU,CAAC;AACpF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,IAAa,EAAE,OAAe;IACtD,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE9B,OAAO,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AAC1D,CAAC;AAED,8EAA8E;AAC9E,MAAM,IAAI,GAAG,EAAE,IAAI,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AAK,CAAC,MAAM,CAAC,EAAU,EAAE,KAAiB,IAAgB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;QAClG,KAAK,CAAC,MAAM,CAAC,EAAU,IAAsB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KAC/E,CAAC,CAAC;AACL,CAAC"}
|
package/dist/prefab/mirror.d.ts
CHANGED
|
@@ -1,31 +1,9 @@
|
|
|
1
1
|
import { type EntityConstructor } from '@fougere/schema';
|
|
2
2
|
import type { Storage } from '../storage.js';
|
|
3
|
-
/**
|
|
4
|
-
* A paginated local copy of a source that cannot be queried directly.
|
|
5
|
-
*
|
|
6
|
-
* The shape must contain an `updated()` field used as a high-water mark. Subclasses
|
|
7
|
-
* implement `pull`; `refresh` validates and upserts each returned page.
|
|
8
|
-
*
|
|
9
|
-
* ```ts
|
|
10
|
-
* export default class PartnerCatalog extends Mirror(BookCard) {
|
|
11
|
-
* constructor(storage: Storage<BookCard>, private catalog: Facade<CatalogHandler>) {
|
|
12
|
-
* super(storage);
|
|
13
|
-
* }
|
|
14
|
-
*
|
|
15
|
-
* async *pull(since?: Date) {
|
|
16
|
-
* for (let page = 0; page !== null;) {
|
|
17
|
-
* const body = await fetch(`${api}?page=${page}&since=${since?.toISOString() ?? ''}`);
|
|
18
|
-
* const { items, next } = await body.json();
|
|
19
|
-
* yield items.map(toCard);
|
|
20
|
-
* page = next;
|
|
21
|
-
* }
|
|
22
|
-
* }
|
|
23
|
-
* }
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
3
|
+
/** A paginated local copy of a source that cannot be queried directly. */
|
|
26
4
|
/** What one refresh did — enough to log it, and to decide whether to run again. */
|
|
27
5
|
export interface Refreshed {
|
|
28
|
-
/**
|
|
6
|
+
/** Instances written, counting a replaced one once. */
|
|
29
7
|
written: number;
|
|
30
8
|
/** The age the pull was asked to start from — absent on the first ever run. */
|
|
31
9
|
since?: Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mirror.d.ts","sourceRoot":"","sources":["../../src/prefab/mirror.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"mirror.d.ts","sourceRoot":"","sources":["../../src/prefab/mirror.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,iBAAiB,EAAe,MAAM,iBAAiB,CAAC;AACjF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,0EAA0E;AAC1E,mFAAmF;AACnF,MAAM,WAAW,SAAS;IACxB,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,mDAAmD;IACnD,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,QAAQ,CAAC,CAAC;IACzB,8EAA8E;IAC9E,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,wEAAwE;IACxE,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAChD,gFAAgF;IAChF,OAAO,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;IAC9B,oFAAoF;IACpF,SAAS,IAAI,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,KAAK,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,MAAM,CAAC,CAAC,SAAS,iBAAiB,EAAE,KAAK,EAAE,CAAC,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAyChG;AAED,qDAAqD;AACrD,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAO7D"}
|
package/dist/prefab/mirror.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Lifecycle } from '@fougere/schema';
|
|
2
2
|
export function Mirror(shape) {
|
|
3
3
|
// Refuse an undated copy before it can be used as if it held live rows.
|
|
4
4
|
const declared = ageFieldOf(shape);
|
|
@@ -27,7 +27,7 @@ export function Mirror(shape) {
|
|
|
27
27
|
for await (const page of this.pull(since)) {
|
|
28
28
|
if (page.length === 0)
|
|
29
29
|
continue;
|
|
30
|
-
written += await this.storage.upsertAll(
|
|
30
|
+
written += await this.storage.upsertAll(page);
|
|
31
31
|
}
|
|
32
32
|
return { written, since, ms: Date.now() - started };
|
|
33
33
|
}
|
|
@@ -45,22 +45,4 @@ export function ageFieldOf(shape) {
|
|
|
45
45
|
}
|
|
46
46
|
return undefined;
|
|
47
47
|
}
|
|
48
|
-
/** Validate and decode a page, naming a refused row by its declared primary field. */
|
|
49
|
-
function judgePage(shape, page) {
|
|
50
|
-
const judge = shape.validate;
|
|
51
|
-
if (typeof judge !== 'function')
|
|
52
|
-
return page;
|
|
53
|
-
const name = shape.name ?? 'mirror';
|
|
54
|
-
const fields = shape.getFields?.();
|
|
55
|
-
const primary = fields ? FieldSet.of(fields).primary : undefined;
|
|
56
|
-
return page.map((row, index) => {
|
|
57
|
-
const verdict = judge.call(shape, row);
|
|
58
|
-
if (verdict.success)
|
|
59
|
-
return verdict.data;
|
|
60
|
-
const key = primary === undefined ? undefined : row[primary];
|
|
61
|
-
const where = key !== undefined ? `row ${primary} ${JSON.stringify(key)}` : `row ${index} of this page`;
|
|
62
|
-
const why = verdict.errors.map((e) => `${e.path}: ${e.message}`).join(', ');
|
|
63
|
-
throw new Error(`${name} mirror refused ${where} — ${why}`);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
48
|
//# sourceMappingURL=mirror.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mirror.js","sourceRoot":"","sources":["../../src/prefab/mirror.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"mirror.js","sourceRoot":"","sources":["../../src/prefab/mirror.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAuC,MAAM,iBAAiB,CAAC;AA8BjF,MAAM,UAAU,MAAM,CAA8B,KAAQ;IAG1D,wEAAwE;IACxE,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IACnC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CACb,UAAW,KAA2B,CAAC,IAAI,IAAI,GAAG,gDAAgD;YAClG,qGAAqG,CACtG,CAAC;IACJ,CAAC;IACD,MAAM,GAAG,GAAW,QAAQ,CAAC;IAE7B,MAAe,UAAU;QAGJ;QAFnB,MAAM,CAAU,QAAQ,GAAG,KAAK,CAAC;QAEjC,YAAmB,OAAmB;YAAnB,YAAO,GAAP,OAAO,CAAY;QAAG,CAAC;QAI1C,8EAA8E;QAC9E,KAAK,CAAC,SAAS;YACb,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;YACpF,MAAM,KAAK,GAAI,MAA8C,EAAE,CAAC,GAAG,CAAC,CAAC;YACrE,OAAO,KAAK,YAAY,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;QACnD,CAAC;QAED,KAAK,CAAC,OAAO;YACX,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAC3B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;YACrC,IAAI,OAAO,GAAG,CAAC,CAAC;YAChB,sEAAsE;YACtE,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC1C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;oBAAE,SAAS;gBAChC,OAAO,IAAI,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAChD,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;QACtD,CAAC;;IAGH,OAAO,UAA6C,CAAC;AACvD,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,MAAM,MAAM,GAAI,KAAsC,CAAC,SAAS,EAAE,EAAE,CAAC;IACrE,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACnD,IAAI,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,eAAe;YAAE,OAAO,IAAI,CAAC;IACvD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/prefab/prefab.d.ts
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import type { EntityConstructor } from '@fougere/schema';
|
|
2
2
|
import type { PresenterViews } from './presenter.js';
|
|
3
|
-
/**
|
|
4
|
-
* The shape a prefab was built on, or `undefined` when the class is not one.
|
|
5
|
-
*
|
|
6
|
-
* A plain property read: JavaScript walks a constructor's own prototype chain, so a
|
|
7
|
-
* subclass of a prefab answers what its base recorded. Three of the five accessors this
|
|
8
|
-
* replaces walked that chain by hand, and two did not — one question, two mechanisms.
|
|
9
|
-
*/
|
|
3
|
+
/** The shape a prefab was built on, or `undefined` when the class is not one. */
|
|
10
4
|
export declare function targetOf(ctor: unknown): EntityConstructor | undefined;
|
|
11
5
|
/** The views a prefab declares, same rule. */
|
|
12
6
|
export declare function viewsOf(ctor: unknown): PresenterViews | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefab.d.ts","sourceRoot":"","sources":["../../src/prefab/prefab.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"prefab.d.ts","sourceRoot":"","sources":["../../src/prefab/prefab.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAYrD,iFAAiF;AACjF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,iBAAiB,GAAG,SAAS,CAErE;AAED,8CAA8C;AAC9C,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,GAAG,SAAS,CAEjE;AAED,0DAA0D;AAC1D,wBAAgB,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,iBAAiB,GAAG,SAAS,CAErE"}
|
package/dist/prefab/prefab.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The shape a prefab was built on, or `undefined` when the class is not one.
|
|
3
|
-
*
|
|
4
|
-
* A plain property read: JavaScript walks a constructor's own prototype chain, so a
|
|
5
|
-
* subclass of a prefab answers what its base recorded. Three of the five accessors this
|
|
6
|
-
* replaces walked that chain by hand, and two did not — one question, two mechanisms.
|
|
7
|
-
*/
|
|
1
|
+
/** The shape a prefab was built on, or `undefined` when the class is not one. */
|
|
8
2
|
export function targetOf(ctor) {
|
|
9
3
|
return ctor?.__entity;
|
|
10
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefab.js","sourceRoot":"","sources":["../../src/prefab/prefab.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prefab.js","sourceRoot":"","sources":["../../src/prefab/prefab.ts"],"names":[],"mappings":"AAaA,iFAAiF;AACjF,MAAM,UAAU,QAAQ,CAAC,IAAa;IACpC,OAAQ,IAA2B,EAAE,QAAQ,CAAC;AAChD,CAAC;AAED,8CAA8C;AAC9C,MAAM,UAAU,OAAO,CAAC,IAAa;IACnC,OAAQ,IAA2B,EAAE,OAAO,CAAC;AAC/C,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,QAAQ,CAAC,IAAa;IACpC,OAAQ,IAA2B,EAAE,QAAQ,CAAC;AAChD,CAAC"}
|