@craft-ts/core 0.7.0-beta.13
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/LICENSE +21 -0
- package/package.json +58 -0
- package/src/index.d.ts +148 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +150 -0
- package/src/index.js.map +1 -0
- package/src/lib/after-recomputation.d.ts +327 -0
- package/src/lib/after-recomputation.d.ts.map +1 -0
- package/src/lib/after-recomputation.js +25 -0
- package/src/lib/after-recomputation.js.map +1 -0
- package/src/lib/app-checked-di.d.ts +82 -0
- package/src/lib/app-checked-di.d.ts.map +1 -0
- package/src/lib/app-checked-di.js +1 -0
- package/src/lib/app-checked-di.js.map +1 -0
- package/src/lib/async-process.d.ts +411 -0
- package/src/lib/async-process.d.ts.map +1 -0
- package/src/lib/async-process.js +702 -0
- package/src/lib/async-process.js.map +1 -0
- package/src/lib/branded-component/branded-component.d.ts +129 -0
- package/src/lib/branded-component/branded-component.d.ts.map +1 -0
- package/src/lib/branded-component/branded-component.js +7 -0
- package/src/lib/branded-component/branded-component.js.map +1 -0
- package/src/lib/browser-boundaries.d.ts +165 -0
- package/src/lib/browser-boundaries.d.ts.map +1 -0
- package/src/lib/browser-boundaries.js +550 -0
- package/src/lib/browser-boundaries.js.map +1 -0
- package/src/lib/client-di-requirement.d.ts +28 -0
- package/src/lib/client-di-requirement.d.ts.map +1 -0
- package/src/lib/client-di-requirement.js +11 -0
- package/src/lib/client-di-requirement.js.map +1 -0
- package/src/lib/client-function-middleware.d.ts +130 -0
- package/src/lib/client-function-middleware.d.ts.map +1 -0
- package/src/lib/client-function-middleware.js +144 -0
- package/src/lib/client-function-middleware.js.map +1 -0
- package/src/lib/component-monitoring.d.ts +7 -0
- package/src/lib/component-monitoring.d.ts.map +1 -0
- package/src/lib/component-monitoring.js +28 -0
- package/src/lib/component-monitoring.js.map +1 -0
- package/src/lib/component-register.d.ts +12 -0
- package/src/lib/component-register.d.ts.map +1 -0
- package/src/lib/component-register.js +13 -0
- package/src/lib/component-register.js.map +1 -0
- package/src/lib/computed-source.d.ts +303 -0
- package/src/lib/computed-source.d.ts.map +1 -0
- package/src/lib/computed-source.js +319 -0
- package/src/lib/computed-source.js.map +1 -0
- package/src/lib/correlation-id-plugin.d.ts +3 -0
- package/src/lib/correlation-id-plugin.d.ts.map +1 -0
- package/src/lib/correlation-id-plugin.js +73 -0
- package/src/lib/correlation-id-plugin.js.map +1 -0
- package/src/lib/correlation-id.d.ts +30 -0
- package/src/lib/correlation-id.d.ts.map +1 -0
- package/src/lib/correlation-id.js +86 -0
- package/src/lib/correlation-id.js.map +1 -0
- package/src/lib/craft-a11y.d.ts +22 -0
- package/src/lib/craft-a11y.d.ts.map +1 -0
- package/src/lib/craft-a11y.js +32 -0
- package/src/lib/craft-a11y.js.map +1 -0
- package/src/lib/craft-activated-route.d.ts +21 -0
- package/src/lib/craft-activated-route.d.ts.map +1 -0
- package/src/lib/craft-activated-route.js +20 -0
- package/src/lib/craft-activated-route.js.map +1 -0
- package/src/lib/craft-app-config.d.ts +91 -0
- package/src/lib/craft-app-config.d.ts.map +1 -0
- package/src/lib/craft-app-config.js +64 -0
- package/src/lib/craft-app-config.js.map +1 -0
- package/src/lib/craft-codec.d.ts +16 -0
- package/src/lib/craft-codec.d.ts.map +1 -0
- package/src/lib/craft-codec.js +1 -0
- package/src/lib/craft-codec.js.map +1 -0
- package/src/lib/craft-computed.d.ts +31 -0
- package/src/lib/craft-computed.d.ts.map +1 -0
- package/src/lib/craft-computed.js +81 -0
- package/src/lib/craft-computed.js.map +1 -0
- package/src/lib/craft-control-flow.d.ts +14 -0
- package/src/lib/craft-control-flow.d.ts.map +1 -0
- package/src/lib/craft-control-flow.js +18 -0
- package/src/lib/craft-control-flow.js.map +1 -0
- package/src/lib/craft-effect.d.ts +13 -0
- package/src/lib/craft-effect.d.ts.map +1 -0
- package/src/lib/craft-effect.js +93 -0
- package/src/lib/craft-effect.js.map +1 -0
- package/src/lib/craft-exception.d.ts +40 -0
- package/src/lib/craft-exception.d.ts.map +1 -0
- package/src/lib/craft-exception.js +16 -0
- package/src/lib/craft-exception.js.map +1 -0
- package/src/lib/craft-gen.d.ts +123 -0
- package/src/lib/craft-gen.d.ts.map +1 -0
- package/src/lib/craft-gen.js +90 -0
- package/src/lib/craft-gen.js.map +1 -0
- package/src/lib/craft-generator-runtime.d.ts +110 -0
- package/src/lib/craft-generator-runtime.d.ts.map +1 -0
- package/src/lib/craft-generator-runtime.js +191 -0
- package/src/lib/craft-generator-runtime.js.map +1 -0
- package/src/lib/craft-guard-runtime.d.ts +70 -0
- package/src/lib/craft-guard-runtime.d.ts.map +1 -0
- package/src/lib/craft-guard-runtime.js +195 -0
- package/src/lib/craft-guard-runtime.js.map +1 -0
- package/src/lib/craft-handshake.d.ts +35 -0
- package/src/lib/craft-handshake.d.ts.map +1 -0
- package/src/lib/craft-handshake.js +34 -0
- package/src/lib/craft-handshake.js.map +1 -0
- package/src/lib/craft-http-client.d.ts +236 -0
- package/src/lib/craft-http-client.d.ts.map +1 -0
- package/src/lib/craft-http-client.js +437 -0
- package/src/lib/craft-http-client.js.map +1 -0
- package/src/lib/craft-http-trace.d.ts +12 -0
- package/src/lib/craft-http-trace.d.ts.map +1 -0
- package/src/lib/craft-http-trace.js +28 -0
- package/src/lib/craft-http-trace.js.map +1 -0
- package/src/lib/craft-lazy.d.ts +42 -0
- package/src/lib/craft-lazy.d.ts.map +1 -0
- package/src/lib/craft-lazy.js +83 -0
- package/src/lib/craft-lazy.js.map +1 -0
- package/src/lib/craft-load-retry.d.ts +76 -0
- package/src/lib/craft-load-retry.d.ts.map +1 -0
- package/src/lib/craft-load-retry.js +160 -0
- package/src/lib/craft-load-retry.js.map +1 -0
- package/src/lib/craft-machine-history.d.ts +145 -0
- package/src/lib/craft-machine-history.d.ts.map +1 -0
- package/src/lib/craft-machine-history.js +276 -0
- package/src/lib/craft-machine-history.js.map +1 -0
- package/src/lib/craft-match.d.ts +49 -0
- package/src/lib/craft-match.d.ts.map +1 -0
- package/src/lib/craft-match.js +58 -0
- package/src/lib/craft-match.js.map +1 -0
- package/src/lib/craft-method.d.ts +28 -0
- package/src/lib/craft-method.d.ts.map +1 -0
- package/src/lib/craft-method.js +45 -0
- package/src/lib/craft-method.js.map +1 -0
- package/src/lib/craft-node-directive.d.ts +32 -0
- package/src/lib/craft-node-directive.d.ts.map +1 -0
- package/src/lib/craft-node-directive.js +22 -0
- package/src/lib/craft-node-directive.js.map +1 -0
- package/src/lib/craft-pending.d.ts +115 -0
- package/src/lib/craft-pending.d.ts.map +1 -0
- package/src/lib/craft-pending.js +187 -0
- package/src/lib/craft-pending.js.map +1 -0
- package/src/lib/craft-pipe.d.ts +63 -0
- package/src/lib/craft-pipe.d.ts.map +1 -0
- package/src/lib/craft-pipe.js +57 -0
- package/src/lib/craft-pipe.js.map +1 -0
- package/src/lib/craft-platform.d.ts +50 -0
- package/src/lib/craft-platform.d.ts.map +1 -0
- package/src/lib/craft-platform.js +175 -0
- package/src/lib/craft-platform.js.map +1 -0
- package/src/lib/craft-primitive-gen.d.ts +137 -0
- package/src/lib/craft-primitive-gen.d.ts.map +1 -0
- package/src/lib/craft-primitive-gen.js +76 -0
- package/src/lib/craft-primitive-gen.js.map +1 -0
- package/src/lib/craft-primitive-registry.d.ts +113 -0
- package/src/lib/craft-primitive-registry.d.ts.map +1 -0
- package/src/lib/craft-primitive-registry.js +159 -0
- package/src/lib/craft-primitive-registry.js.map +1 -0
- package/src/lib/craft-program-operators.d.ts +101 -0
- package/src/lib/craft-program-operators.d.ts.map +1 -0
- package/src/lib/craft-program-operators.js +116 -0
- package/src/lib/craft-program-operators.js.map +1 -0
- package/src/lib/craft-program-runtime.d.ts +80 -0
- package/src/lib/craft-program-runtime.d.ts.map +1 -0
- package/src/lib/craft-program-runtime.js +166 -0
- package/src/lib/craft-program-runtime.js.map +1 -0
- package/src/lib/craft-register-for-runtime.d.ts +39 -0
- package/src/lib/craft-register-for-runtime.d.ts.map +1 -0
- package/src/lib/craft-register-for-runtime.js +96 -0
- package/src/lib/craft-register-for-runtime.js.map +1 -0
- package/src/lib/craft-register-for.d.ts +57 -0
- package/src/lib/craft-register-for.d.ts.map +1 -0
- package/src/lib/craft-register-for.js +200 -0
- package/src/lib/craft-register-for.js.map +1 -0
- package/src/lib/craft-render-identity.d.ts +19 -0
- package/src/lib/craft-render-identity.d.ts.map +1 -0
- package/src/lib/craft-render-identity.js +23 -0
- package/src/lib/craft-render-identity.js.map +1 -0
- package/src/lib/craft-replay.d.ts +5 -0
- package/src/lib/craft-replay.d.ts.map +1 -0
- package/src/lib/craft-replay.js +28 -0
- package/src/lib/craft-replay.js.map +1 -0
- package/src/lib/craft-resolve.d.ts +39 -0
- package/src/lib/craft-resolve.d.ts.map +1 -0
- package/src/lib/craft-resolve.js +9 -0
- package/src/lib/craft-resolve.js.map +1 -0
- package/src/lib/craft-resource.d.ts +11 -0
- package/src/lib/craft-resource.d.ts.map +1 -0
- package/src/lib/craft-resource.js +264 -0
- package/src/lib/craft-resource.js.map +1 -0
- package/src/lib/craft-route-exceptions.d.ts +785 -0
- package/src/lib/craft-route-exceptions.d.ts.map +1 -0
- package/src/lib/craft-route-exceptions.js +86 -0
- package/src/lib/craft-route-exceptions.js.map +1 -0
- package/src/lib/craft-route-load-error.d.ts +1145 -0
- package/src/lib/craft-route-load-error.d.ts.map +1 -0
- package/src/lib/craft-route-load-error.js +173 -0
- package/src/lib/craft-route-load-error.js.map +1 -0
- package/src/lib/craft-route-meta.d.ts +52 -0
- package/src/lib/craft-route-meta.d.ts.map +1 -0
- package/src/lib/craft-route-meta.js +16 -0
- package/src/lib/craft-route-meta.js.map +1 -0
- package/src/lib/craft-route-target.d.ts +27 -0
- package/src/lib/craft-route-target.d.ts.map +1 -0
- package/src/lib/craft-route-target.js +22 -0
- package/src/lib/craft-route-target.js.map +1 -0
- package/src/lib/craft-router-outlet.d.ts +105 -0
- package/src/lib/craft-router-outlet.d.ts.map +1 -0
- package/src/lib/craft-router-outlet.js +735 -0
- package/src/lib/craft-router-outlet.js.map +1 -0
- package/src/lib/craft-router-tokens.d.ts +49 -0
- package/src/lib/craft-router-tokens.d.ts.map +1 -0
- package/src/lib/craft-router-tokens.js +15 -0
- package/src/lib/craft-router-tokens.js.map +1 -0
- package/src/lib/craft-router-trace.d.ts +18 -0
- package/src/lib/craft-router-trace.d.ts.map +1 -0
- package/src/lib/craft-router-trace.js +54 -0
- package/src/lib/craft-router-trace.js.map +1 -0
- package/src/lib/craft-router.d.ts +248 -0
- package/src/lib/craft-router.d.ts.map +1 -0
- package/src/lib/craft-router.js +559 -0
- package/src/lib/craft-router.js.map +1 -0
- package/src/lib/craft-routes.d.ts +755 -0
- package/src/lib/craft-routes.d.ts.map +1 -0
- package/src/lib/craft-routes.js +510 -0
- package/src/lib/craft-routes.js.map +1 -0
- package/src/lib/craft-service.d.ts +1034 -0
- package/src/lib/craft-service.d.ts.map +1 -0
- package/src/lib/craft-service.js +1072 -0
- package/src/lib/craft-service.js.map +1 -0
- package/src/lib/craft-service.shared.d.ts +35 -0
- package/src/lib/craft-service.shared.d.ts.map +1 -0
- package/src/lib/craft-service.shared.js +4 -0
- package/src/lib/craft-service.shared.js.map +1 -0
- package/src/lib/craft-settled.d.ts +171 -0
- package/src/lib/craft-settled.d.ts.map +1 -0
- package/src/lib/craft-settled.js +130 -0
- package/src/lib/craft-settled.js.map +1 -0
- package/src/lib/craft-ssr.d.ts +29 -0
- package/src/lib/craft-ssr.d.ts.map +1 -0
- package/src/lib/craft-ssr.js +27 -0
- package/src/lib/craft-ssr.js.map +1 -0
- package/src/lib/craft-state-machine-runtime.d.ts +88 -0
- package/src/lib/craft-state-machine-runtime.d.ts.map +1 -0
- package/src/lib/craft-state-machine-runtime.js +167 -0
- package/src/lib/craft-state-machine-runtime.js.map +1 -0
- package/src/lib/craft-state-machine.d.ts +233 -0
- package/src/lib/craft-state-machine.d.ts.map +1 -0
- package/src/lib/craft-state-machine.js +254 -0
- package/src/lib/craft-state-machine.js.map +1 -0
- package/src/lib/craft-target-runtime.d.ts +20 -0
- package/src/lib/craft-target-runtime.d.ts.map +1 -0
- package/src/lib/craft-target-runtime.js +42 -0
- package/src/lib/craft-target-runtime.js.map +1 -0
- package/src/lib/craft-transfer-snapshot.d.ts +19 -0
- package/src/lib/craft-transfer-snapshot.d.ts.map +1 -0
- package/src/lib/craft-transfer-snapshot.js +90 -0
- package/src/lib/craft-transfer-snapshot.js.map +1 -0
- package/src/lib/craft-unique.d.ts +7 -0
- package/src/lib/craft-unique.d.ts.map +1 -0
- package/src/lib/craft-unique.js +16 -0
- package/src/lib/craft-unique.js.map +1 -0
- package/src/lib/craft-until-settled.d.ts +99 -0
- package/src/lib/craft-until-settled.d.ts.map +1 -0
- package/src/lib/craft-until-settled.js +81 -0
- package/src/lib/craft-until-settled.js.map +1 -0
- package/src/lib/craft-use.d.ts +26 -0
- package/src/lib/craft-use.d.ts.map +1 -0
- package/src/lib/craft-use.js +37 -0
- package/src/lib/craft-use.js.map +1 -0
- package/src/lib/craft-view-transition.d.ts +102 -0
- package/src/lib/craft-view-transition.d.ts.map +1 -0
- package/src/lib/craft-view-transition.js +130 -0
- package/src/lib/craft-view-transition.js.map +1 -0
- package/src/lib/dom-event-hook.d.ts +30 -0
- package/src/lib/dom-event-hook.d.ts.map +1 -0
- package/src/lib/dom-event-hook.js +16 -0
- package/src/lib/dom-event-hook.js.map +1 -0
- package/src/lib/fn-wrapper.d.ts +13 -0
- package/src/lib/fn-wrapper.d.ts.map +1 -0
- package/src/lib/fn-wrapper.js +66 -0
- package/src/lib/fn-wrapper.js.map +1 -0
- package/src/lib/form/craft-field.d.ts +155 -0
- package/src/lib/form/craft-field.d.ts.map +1 -0
- package/src/lib/form/craft-field.directive.d.ts +70 -0
- package/src/lib/form/craft-field.directive.d.ts.map +1 -0
- package/src/lib/form/craft-field.directive.js +549 -0
- package/src/lib/form/craft-field.directive.js.map +1 -0
- package/src/lib/form/craft-field.js +586 -0
- package/src/lib/form/craft-field.js.map +1 -0
- package/src/lib/form/field-exception.d.ts +62 -0
- package/src/lib/form/field-exception.d.ts.map +1 -0
- package/src/lib/form/field-exception.js +37 -0
- package/src/lib/form/field-exception.js.map +1 -0
- package/src/lib/form/field-lens.d.ts +29 -0
- package/src/lib/form/field-lens.d.ts.map +1 -0
- package/src/lib/form/field-lens.js +32 -0
- package/src/lib/form/field-lens.js.map +1 -0
- package/src/lib/form/insert-form-attributes.d.ts +69 -0
- package/src/lib/form/insert-form-attributes.d.ts.map +1 -0
- package/src/lib/form/insert-form-attributes.js +163 -0
- package/src/lib/form/insert-form-attributes.js.map +1 -0
- package/src/lib/form/insert-form-internals.d.ts +110 -0
- package/src/lib/form/insert-form-internals.d.ts.map +1 -0
- package/src/lib/form/insert-form-internals.js +276 -0
- package/src/lib/form/insert-form-internals.js.map +1 -0
- package/src/lib/form/insert-form-schema.d.ts +10 -0
- package/src/lib/form/insert-form-schema.d.ts.map +1 -0
- package/src/lib/form/insert-form-schema.js +62 -0
- package/src/lib/form/insert-form-schema.js.map +1 -0
- package/src/lib/form/insert-form-submit.d.ts +79 -0
- package/src/lib/form/insert-form-submit.d.ts.map +1 -0
- package/src/lib/form/insert-form-submit.js +126 -0
- package/src/lib/form/insert-form-submit.js.map +1 -0
- package/src/lib/form/insert-form.d.ts +39 -0
- package/src/lib/form/insert-form.d.ts.map +1 -0
- package/src/lib/form/insert-form.js +255 -0
- package/src/lib/form/insert-form.js.map +1 -0
- package/src/lib/form/insert-select-form-tree.d.ts +33 -0
- package/src/lib/form/insert-select-form-tree.d.ts.map +1 -0
- package/src/lib/form/insert-select-form-tree.js +144 -0
- package/src/lib/form/insert-select-form-tree.js.map +1 -0
- package/src/lib/form/insert-sub-form-field.d.ts +17 -0
- package/src/lib/form/insert-sub-form-field.d.ts.map +1 -0
- package/src/lib/form/insert-sub-form-field.js +41 -0
- package/src/lib/form/insert-sub-form-field.js.map +1 -0
- package/src/lib/form/make-form-tree-insert.d.ts +22 -0
- package/src/lib/form/make-form-tree-insert.d.ts.map +1 -0
- package/src/lib/form/make-form-tree-insert.js +43 -0
- package/src/lib/form/make-form-tree-insert.js.map +1 -0
- package/src/lib/form/target-form-field.d.ts +11 -0
- package/src/lib/form/target-form-field.d.ts.map +1 -0
- package/src/lib/form/target-form-field.js +1 -0
- package/src/lib/form/target-form-field.js.map +1 -0
- package/src/lib/form/validator.d.ts +174 -0
- package/src/lib/form/validator.d.ts.map +1 -0
- package/src/lib/form/validator.js +465 -0
- package/src/lib/form/validator.js.map +1 -0
- package/src/lib/from-event-to-source$.d.ts +210 -0
- package/src/lib/from-event-to-source$.d.ts.map +1 -0
- package/src/lib/from-event-to-source$.js +29 -0
- package/src/lib/from-event-to-source$.js.map +1 -0
- package/src/lib/global-persister-handler.service.d.ts +10 -0
- package/src/lib/global-persister-handler.service.d.ts.map +1 -0
- package/src/lib/global-persister-handler.service.js +40 -0
- package/src/lib/global-persister-handler.service.js.map +1 -0
- package/src/lib/host/craft-compat.d.ts +242 -0
- package/src/lib/host/craft-compat.d.ts.map +1 -0
- package/src/lib/host/craft-compat.js +444 -0
- package/src/lib/host/craft-compat.js.map +1 -0
- package/src/lib/host/craft-dom.d.ts +16 -0
- package/src/lib/host/craft-dom.d.ts.map +1 -0
- package/src/lib/host/craft-dom.js +24 -0
- package/src/lib/host/craft-dom.js.map +1 -0
- package/src/lib/host/craft-http.d.ts +22 -0
- package/src/lib/host/craft-http.d.ts.map +1 -0
- package/src/lib/host/craft-http.js +80 -0
- package/src/lib/host/craft-http.js.map +1 -0
- package/src/lib/host/craft-injector-host.d.ts +3 -0
- package/src/lib/host/craft-injector-host.d.ts.map +1 -0
- package/src/lib/host/craft-injector-host.js +2 -0
- package/src/lib/host/craft-injector-host.js.map +1 -0
- package/src/lib/host/craft-injector.d.ts +40 -0
- package/src/lib/host/craft-injector.d.ts.map +1 -0
- package/src/lib/host/craft-injector.js +318 -0
- package/src/lib/host/craft-injector.js.map +1 -0
- package/src/lib/host/craft-linked-signal.d.ts +17 -0
- package/src/lib/host/craft-linked-signal.d.ts.map +1 -0
- package/src/lib/host/craft-linked-signal.js +86 -0
- package/src/lib/host/craft-linked-signal.js.map +1 -0
- package/src/lib/host/craft-router-runtime.d.ts +61 -0
- package/src/lib/host/craft-router-runtime.d.ts.map +1 -0
- package/src/lib/host/craft-router-runtime.js +456 -0
- package/src/lib/host/craft-router-runtime.js.map +1 -0
- package/src/lib/host/craft-router-types.d.ts +84 -0
- package/src/lib/host/craft-router-types.d.ts.map +1 -0
- package/src/lib/host/craft-router-types.js +35 -0
- package/src/lib/host/craft-router-types.js.map +1 -0
- package/src/lib/host/craft-signal.d.ts +45 -0
- package/src/lib/host/craft-signal.d.ts.map +1 -0
- package/src/lib/host/craft-signal.js +161 -0
- package/src/lib/host/craft-signal.js.map +1 -0
- package/src/lib/host/craft-test-bed.d.ts +63 -0
- package/src/lib/host/craft-test-bed.d.ts.map +1 -0
- package/src/lib/host/craft-test-bed.js +114 -0
- package/src/lib/host/craft-test-bed.js.map +1 -0
- package/src/lib/host-tag.d.ts +2 -0
- package/src/lib/host-tag.d.ts.map +1 -0
- package/src/lib/host-tag.js +2 -0
- package/src/lib/host-tag.js.map +1 -0
- package/src/lib/insert-entities.d.ts +131 -0
- package/src/lib/insert-entities.d.ts.map +1 -0
- package/src/lib/insert-entities.js +159 -0
- package/src/lib/insert-entities.js.map +1 -0
- package/src/lib/insert-noop-typing-anchor.d.ts +15 -0
- package/src/lib/insert-noop-typing-anchor.d.ts.map +1 -0
- package/src/lib/insert-noop-typing-anchor.js +16 -0
- package/src/lib/insert-noop-typing-anchor.js.map +1 -0
- package/src/lib/insert-pagination-placeholder-data.d.ts +122 -0
- package/src/lib/insert-pagination-placeholder-data.d.ts.map +1 -0
- package/src/lib/insert-pagination-placeholder-data.js +244 -0
- package/src/lib/insert-pagination-placeholder-data.js.map +1 -0
- package/src/lib/insert-react-on-mutation.d.ts +261 -0
- package/src/lib/insert-react-on-mutation.d.ts.map +1 -0
- package/src/lib/insert-react-on-mutation.js +227 -0
- package/src/lib/insert-react-on-mutation.js.map +1 -0
- package/src/lib/insert-select-resource.d.ts +31 -0
- package/src/lib/insert-select-resource.d.ts.map +1 -0
- package/src/lib/insert-select-resource.js +27 -0
- package/src/lib/insert-select-resource.js.map +1 -0
- package/src/lib/insert-select.d.ts +126 -0
- package/src/lib/insert-select.d.ts.map +1 -0
- package/src/lib/insert-select.js +535 -0
- package/src/lib/insert-select.js.map +1 -0
- package/src/lib/insert-storage-persister.d.ts +27 -0
- package/src/lib/insert-storage-persister.d.ts.map +1 -0
- package/src/lib/insert-storage-persister.js +65 -0
- package/src/lib/insert-storage-persister.js.map +1 -0
- package/src/lib/insert-typed-pipes.d.ts +64 -0
- package/src/lib/insert-typed-pipes.d.ts.map +1 -0
- package/src/lib/insert-typed-pipes.js +32 -0
- package/src/lib/insert-typed-pipes.js.map +1 -0
- package/src/lib/linked-source.d.ts +8 -0
- package/src/lib/linked-source.d.ts.map +1 -0
- package/src/lib/linked-source.js +24 -0
- package/src/lib/linked-source.js.map +1 -0
- package/src/lib/local-storage-persister.d.ts +4 -0
- package/src/lib/local-storage-persister.d.ts.map +1 -0
- package/src/lib/local-storage-persister.js +342 -0
- package/src/lib/local-storage-persister.js.map +1 -0
- package/src/lib/middleware-schema-shared.d.ts +67 -0
- package/src/lib/middleware-schema-shared.d.ts.map +1 -0
- package/src/lib/middleware-schema-shared.js +34 -0
- package/src/lib/middleware-schema-shared.js.map +1 -0
- package/src/lib/mock-http-request-for-route.d.ts +173 -0
- package/src/lib/mock-http-request-for-route.d.ts.map +1 -0
- package/src/lib/mock-http-request-for-route.js +127 -0
- package/src/lib/mock-http-request-for-route.js.map +1 -0
- package/src/lib/mutation.d.ts +332 -0
- package/src/lib/mutation.d.ts.map +1 -0
- package/src/lib/mutation.js +923 -0
- package/src/lib/mutation.js.map +1 -0
- package/src/lib/on$.d.ts +26 -0
- package/src/lib/on$.d.ts.map +1 -0
- package/src/lib/on$.js +19 -0
- package/src/lib/on$.js.map +1 -0
- package/src/lib/portable-server-function.d.ts +68 -0
- package/src/lib/portable-server-function.d.ts.map +1 -0
- package/src/lib/portable-server-function.js +97 -0
- package/src/lib/portable-server-function.js.map +1 -0
- package/src/lib/preserved-resource.d.ts +4 -0
- package/src/lib/preserved-resource.d.ts.map +1 -0
- package/src/lib/preserved-resource.js +60 -0
- package/src/lib/preserved-resource.js.map +1 -0
- package/src/lib/primitive-method-runtime-context.d.ts +28 -0
- package/src/lib/primitive-method-runtime-context.d.ts.map +1 -0
- package/src/lib/primitive-method-runtime-context.js +38 -0
- package/src/lib/primitive-method-runtime-context.js.map +1 -0
- package/src/lib/primitive-resource-runtime-context.d.ts +46 -0
- package/src/lib/primitive-resource-runtime-context.d.ts.map +1 -0
- package/src/lib/primitive-resource-runtime-context.js +102 -0
- package/src/lib/primitive-resource-runtime-context.js.map +1 -0
- package/src/lib/query-params.d.ts +216 -0
- package/src/lib/query-params.d.ts.map +1 -0
- package/src/lib/query-params.js +324 -0
- package/src/lib/query-params.js.map +1 -0
- package/src/lib/query.core.d.ts +214 -0
- package/src/lib/query.core.d.ts.map +1 -0
- package/src/lib/query.core.js +210 -0
- package/src/lib/query.core.js.map +1 -0
- package/src/lib/query.d.ts +324 -0
- package/src/lib/query.d.ts.map +1 -0
- package/src/lib/query.js +971 -0
- package/src/lib/query.js.map +1 -0
- package/src/lib/reactive-read.d.ts +162 -0
- package/src/lib/reactive-read.d.ts.map +1 -0
- package/src/lib/reactive-read.js +389 -0
- package/src/lib/reactive-read.js.map +1 -0
- package/src/lib/resource-by-id.d.ts +71 -0
- package/src/lib/resource-by-id.d.ts.map +1 -0
- package/src/lib/resource-by-id.js +294 -0
- package/src/lib/resource-by-id.js.map +1 -0
- package/src/lib/resource-exception.d.ts +30 -0
- package/src/lib/resource-exception.d.ts.map +1 -0
- package/src/lib/resource-exception.js +86 -0
- package/src/lib/resource-exception.js.map +1 -0
- package/src/lib/route-checked-di.d.ts +229 -0
- package/src/lib/route-checked-di.d.ts.map +1 -0
- package/src/lib/route-checked-di.js +1 -0
- package/src/lib/route-checked-di.js.map +1 -0
- package/src/lib/schema-validation.d.ts +89 -0
- package/src/lib/schema-validation.d.ts.map +1 -0
- package/src/lib/schema-validation.js +110 -0
- package/src/lib/schema-validation.js.map +1 -0
- package/src/lib/send-context-to-ai.d.ts +20 -0
- package/src/lib/send-context-to-ai.d.ts.map +1 -0
- package/src/lib/send-context-to-ai.js +18 -0
- package/src/lib/send-context-to-ai.js.map +1 -0
- package/src/lib/send-context-to-ai.tokens.d.ts +12 -0
- package/src/lib/send-context-to-ai.tokens.d.ts.map +1 -0
- package/src/lib/send-context-to-ai.tokens.js +1 -0
- package/src/lib/send-context-to-ai.tokens.js.map +1 -0
- package/src/lib/server-function-client.d.ts +102 -0
- package/src/lib/server-function-client.d.ts.map +1 -0
- package/src/lib/server-function-client.js +106 -0
- package/src/lib/server-function-client.js.map +1 -0
- package/src/lib/server-function-contract.d.ts +42 -0
- package/src/lib/server-function-contract.d.ts.map +1 -0
- package/src/lib/server-function-contract.js +23 -0
- package/src/lib/server-function-contract.js.map +1 -0
- package/src/lib/server-function-middleware.d.ts +222 -0
- package/src/lib/server-function-middleware.d.ts.map +1 -0
- package/src/lib/server-function-middleware.js +189 -0
- package/src/lib/server-function-middleware.js.map +1 -0
- package/src/lib/server-function.d.ts +114 -0
- package/src/lib/server-function.d.ts.map +1 -0
- package/src/lib/server-function.js +80 -0
- package/src/lib/server-function.js.map +1 -0
- package/src/lib/server-layer.d.ts +185 -0
- package/src/lib/server-layer.d.ts.map +1 -0
- package/src/lib/server-layer.js +121 -0
- package/src/lib/server-layer.js.map +1 -0
- package/src/lib/server.d.ts +83 -0
- package/src/lib/server.d.ts.map +1 -0
- package/src/lib/server.js +266 -0
- package/src/lib/server.js.map +1 -0
- package/src/lib/setup-craft-service-test.d.ts +90 -0
- package/src/lib/setup-craft-service-test.d.ts.map +1 -0
- package/src/lib/setup-craft-service-test.js +193 -0
- package/src/lib/setup-craft-service-test.js.map +1 -0
- package/src/lib/setup-craft-service-testing-by-register.d.ts +245 -0
- package/src/lib/setup-craft-service-testing-by-register.d.ts.map +1 -0
- package/src/lib/setup-craft-service-testing-by-register.js +316 -0
- package/src/lib/setup-craft-service-testing-by-register.js.map +1 -0
- package/src/lib/signal-proxy.d.ts +21 -0
- package/src/lib/signal-proxy.d.ts.map +1 -0
- package/src/lib/signal-proxy.js +79 -0
- package/src/lib/signal-proxy.js.map +1 -0
- package/src/lib/signal-source.d.ts +392 -0
- package/src/lib/signal-source.d.ts.map +1 -0
- package/src/lib/signal-source.js +433 -0
- package/src/lib/signal-source.js.map +1 -0
- package/src/lib/source$.d.ts +121 -0
- package/src/lib/source$.d.ts.map +1 -0
- package/src/lib/source$.js +171 -0
- package/src/lib/source$.js.map +1 -0
- package/src/lib/source-from-event.d.ts +350 -0
- package/src/lib/source-from-event.d.ts.map +1 -0
- package/src/lib/source-from-event.js +26 -0
- package/src/lib/source-from-event.js.map +1 -0
- package/src/lib/stacked-source.d.ts +6 -0
- package/src/lib/stacked-source.d.ts.map +1 -0
- package/src/lib/stacked-source.js +29 -0
- package/src/lib/stacked-source.js.map +1 -0
- package/src/lib/standard-schema.d.ts +43 -0
- package/src/lib/standard-schema.d.ts.map +1 -0
- package/src/lib/standard-schema.js +1 -0
- package/src/lib/standard-schema.js.map +1 -0
- package/src/lib/state-method-runtime-context.d.ts +13 -0
- package/src/lib/state-method-runtime-context.d.ts.map +1 -0
- package/src/lib/state-method-runtime-context.js +11 -0
- package/src/lib/state-method-runtime-context.js.map +1 -0
- package/src/lib/state.d.ts +158 -0
- package/src/lib/state.d.ts.map +1 -0
- package/src/lib/state.js +388 -0
- package/src/lib/state.js.map +1 -0
- package/src/lib/storage-persister.service.d.ts +25 -0
- package/src/lib/storage-persister.service.d.ts.map +1 -0
- package/src/lib/storage-persister.service.js +27 -0
- package/src/lib/storage-persister.service.js.map +1 -0
- package/src/lib/take-app-snapshot.d.ts +31 -0
- package/src/lib/take-app-snapshot.d.ts.map +1 -0
- package/src/lib/take-app-snapshot.js +93 -0
- package/src/lib/take-app-snapshot.js.map +1 -0
- package/src/lib/template-trace.d.ts +37 -0
- package/src/lib/template-trace.d.ts.map +1 -0
- package/src/lib/template-trace.js +37 -0
- package/src/lib/template-trace.js.map +1 -0
- package/src/lib/temporal-runtime.d.ts +146 -0
- package/src/lib/temporal-runtime.d.ts.map +1 -0
- package/src/lib/temporal-runtime.js +375 -0
- package/src/lib/temporal-runtime.js.map +1 -0
- package/src/lib/to-source.d.ts +335 -0
- package/src/lib/to-source.d.ts.map +1 -0
- package/src/lib/to-source.js +359 -0
- package/src/lib/to-source.js.map +1 -0
- package/src/lib/util/craft-resource-ref.d.ts +29 -0
- package/src/lib/util/craft-resource-ref.d.ts.map +1 -0
- package/src/lib/util/craft-resource-ref.js +1 -0
- package/src/lib/util/craft-resource-ref.js.map +1 -0
- package/src/lib/util/craft-resource-status.d.ts +17 -0
- package/src/lib/util/craft-resource-status.d.ts.map +1 -0
- package/src/lib/util/craft-resource-status.js +14 -0
- package/src/lib/util/craft-resource-status.js.map +1 -0
- package/src/lib/util/entities-util.d.ts +340 -0
- package/src/lib/util/entities-util.d.ts.map +1 -0
- package/src/lib/util/entities-util.js +136 -0
- package/src/lib/util/entities-util.js.map +1 -0
- package/src/lib/util/explicit-effect.d.ts +42 -0
- package/src/lib/util/explicit-effect.d.ts.map +1 -0
- package/src/lib/util/explicit-effect.js +37 -0
- package/src/lib/util/explicit-effect.js.map +1 -0
- package/src/lib/util/extract-signal-props-and-methods.d.ts +20 -0
- package/src/lib/util/extract-signal-props-and-methods.d.ts.map +1 -0
- package/src/lib/util/extract-signal-props-and-methods.js +1 -0
- package/src/lib/util/extract-signal-props-and-methods.js.map +1 -0
- package/src/lib/util/method-trigger-nonce.d.ts +45 -0
- package/src/lib/util/method-trigger-nonce.d.ts.map +1 -0
- package/src/lib/util/method-trigger-nonce.js +58 -0
- package/src/lib/util/method-trigger-nonce.js.map +1 -0
- package/src/lib/util/persister.type.d.ts +37 -0
- package/src/lib/util/persister.type.d.ts.map +1 -0
- package/src/lib/util/persister.type.js +1 -0
- package/src/lib/util/persister.type.js.map +1 -0
- package/src/lib/util/persister.util.d.ts +8 -0
- package/src/lib/util/persister.util.d.ts.map +1 -0
- package/src/lib/util/persister.util.js +71 -0
- package/src/lib/util/persister.util.js.map +1 -0
- package/src/lib/util/react-on-mutation-effect.d.ts +16 -0
- package/src/lib/util/react-on-mutation-effect.d.ts.map +1 -0
- package/src/lib/util/react-on-mutation-effect.js +148 -0
- package/src/lib/util/react-on-mutation-effect.js.map +1 -0
- package/src/lib/util/resource-by-id-changes-tracker.util.d.ts +27 -0
- package/src/lib/util/resource-by-id-changes-tracker.util.d.ts.map +1 -0
- package/src/lib/util/resource-by-id-changes-tracker.util.js +97 -0
- package/src/lib/util/resource-by-id-changes-tracker.util.js.map +1 -0
- package/src/lib/util/source.type.d.ts +6 -0
- package/src/lib/util/source.type.d.ts.map +1 -0
- package/src/lib/util/source.type.js +1 -0
- package/src/lib/util/source.type.js.map +1 -0
- package/src/lib/util/types/access-type-object-property-by-dotted-path.type.d.ts +4 -0
- package/src/lib/util/types/access-type-object-property-by-dotted-path.type.d.ts.map +1 -0
- package/src/lib/util/types/access-type-object-property-by-dotted-path.type.js +1 -0
- package/src/lib/util/types/access-type-object-property-by-dotted-path.type.js.map +1 -0
- package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.d.ts +27 -0
- package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.d.ts.map +1 -0
- package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.js +1 -0
- package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.js.map +1 -0
- package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.d.ts +24 -0
- package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.d.ts.map +1 -0
- package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.js +1 -0
- package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.js.map +1 -0
- package/src/lib/util/types/brand.d.ts +7 -0
- package/src/lib/util/types/brand.d.ts.map +1 -0
- package/src/lib/util/types/brand.js +9 -0
- package/src/lib/util/types/brand.js.map +1 -0
- package/src/lib/util/types/object-deep-path-mapper.type.d.ts +13 -0
- package/src/lib/util/types/object-deep-path-mapper.type.d.ts.map +1 -0
- package/src/lib/util/types/object-deep-path-mapper.type.js +1 -0
- package/src/lib/util/types/object-deep-path-mapper.type.js.map +1 -0
- package/src/lib/util/types/resource-by-id-config.type.d.ts +115 -0
- package/src/lib/util/types/resource-by-id-config.type.d.ts.map +1 -0
- package/src/lib/util/types/resource-by-id-config.type.js +1 -0
- package/src/lib/util/types/resource-by-id-config.type.js.map +1 -0
- package/src/lib/util/types/resource-with-params-or-params-fn.type.d.ts +52 -0
- package/src/lib/util/types/resource-with-params-or-params-fn.type.d.ts.map +1 -0
- package/src/lib/util/types/resource-with-params-or-params-fn.type.js +1 -0
- package/src/lib/util/types/resource-with-params-or-params-fn.type.js.map +1 -0
- package/src/lib/util/types/shared.type.d.ts +66 -0
- package/src/lib/util/types/shared.type.d.ts.map +1 -0
- package/src/lib/util/types/shared.type.js +1 -0
- package/src/lib/util/types/shared.type.js.map +1 -0
- package/src/lib/util/types/util.d.ts +16 -0
- package/src/lib/util/types/util.d.ts.map +1 -0
- package/src/lib/util/types/util.js +60 -0
- package/src/lib/util/types/util.js.map +1 -0
- package/src/lib/util/types/util.type.d.ts +67 -0
- package/src/lib/util/types/util.type.d.ts.map +1 -0
- package/src/lib/util/types/util.type.js +5 -0
- package/src/lib/util/types/util.type.js.map +1 -0
- package/src/lib/util/update-state.util.d.ts +10 -0
- package/src/lib/util/update-state.util.d.ts.map +1 -0
- package/src/lib/util/update-state.util.js +31 -0
- package/src/lib/util/update-state.util.js.map +1 -0
- package/src/lib/util/util.d.ts +19 -0
- package/src/lib/util/util.d.ts.map +1 -0
- package/src/lib/util/util.js +50 -0
- package/src/lib/util/util.js.map +1 -0
- package/src/lib/util/util.type.d.ts +107 -0
- package/src/lib/util/util.type.d.ts.map +1 -0
- package/src/lib/util/util.type.js +9 -0
- package/src/lib/util/util.type.js.map +1 -0
- package/src/lib/yieldable.d.ts +94 -0
- package/src/lib/yieldable.d.ts.map +1 -0
- package/src/lib/yieldable.js +109 -0
- package/src/lib/yieldable.js.map +1 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { DestroyRef, inject, InjectionToken, } from './host/craft-compat';
|
|
2
|
+
import { ɵHOST_TAG_LIST } from './craft-service';
|
|
3
|
+
export class CraftPrimitiveRegistry {
|
|
4
|
+
entries = new Map();
|
|
5
|
+
occurrences = new Map();
|
|
6
|
+
primedValues = new Map();
|
|
7
|
+
/** Public primitive ref → address, so a caller can name what it holds. */
|
|
8
|
+
addresses = new WeakMap();
|
|
9
|
+
/** Associates the ref an application holds with its registered address. */
|
|
10
|
+
link(ref, address) {
|
|
11
|
+
if (ref !== null &&
|
|
12
|
+
(typeof ref === 'object' || typeof ref === 'function')) {
|
|
13
|
+
this.addresses.set(ref, address);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The address of a primitive from the ref an application holds — how a
|
|
18
|
+
* feature names a primitive declared outside the host it is scoped to.
|
|
19
|
+
*/
|
|
20
|
+
addressOf(ref) {
|
|
21
|
+
return ref !== null &&
|
|
22
|
+
(typeof ref === 'object' || typeof ref === 'function')
|
|
23
|
+
? this.addresses.get(ref)
|
|
24
|
+
: undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Registers one instance under `base`, suffixed with an occurrence number.
|
|
28
|
+
*
|
|
29
|
+
* The counter only ever grows: an address is never handed out twice, even
|
|
30
|
+
* after the instance holding it is destroyed. A snapshot captured against
|
|
31
|
+
* `…#2` can therefore never be restored into a different primitive that
|
|
32
|
+
* happened to take the freed slot — it simply finds nothing.
|
|
33
|
+
*/
|
|
34
|
+
register(base, entry) {
|
|
35
|
+
const occurrence = (this.occurrences.get(base) ?? 0) + 1;
|
|
36
|
+
this.occurrences.set(base, occurrence);
|
|
37
|
+
const address = `${base}#${occurrence}`;
|
|
38
|
+
const registered = { ...entry, address };
|
|
39
|
+
this.entries.set(address, registered);
|
|
40
|
+
if (this.primedValues.has(address)) {
|
|
41
|
+
registered.write(this.primedValues.get(address));
|
|
42
|
+
this.primedValues.delete(address);
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
address,
|
|
46
|
+
release: () => {
|
|
47
|
+
if (this.entries.get(address) === registered) {
|
|
48
|
+
this.entries.delete(address);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
list() {
|
|
54
|
+
return [...this.entries.values()];
|
|
55
|
+
}
|
|
56
|
+
get(address) {
|
|
57
|
+
return this.entries.get(address);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Every entry whose host-tag chain starts with `hostTags` — the primitives a
|
|
61
|
+
* given host owns, transitively. An empty prefix matches the whole app.
|
|
62
|
+
*/
|
|
63
|
+
under(hostTags) {
|
|
64
|
+
return this.list().filter((entry) => hostTags.every((tag, index) => entry.hostTags[index] === tag));
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Reads the current value of the given entries. A primitive that throws on
|
|
68
|
+
* read (a suspended resource, a computation in error) contributes nothing
|
|
69
|
+
* rather than failing the whole capture.
|
|
70
|
+
*/
|
|
71
|
+
capture(entries = this.list()) {
|
|
72
|
+
const snapshot = {};
|
|
73
|
+
for (const entry of entries) {
|
|
74
|
+
try {
|
|
75
|
+
snapshot[entry.address] = entry.read();
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
// A value that cannot be read cannot be restored either.
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return snapshot;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Writes a captured snapshot back. Addresses the registry no longer knows
|
|
85
|
+
* are skipped: a row that has been destroyed since the capture has nothing
|
|
86
|
+
* to restore into.
|
|
87
|
+
*/
|
|
88
|
+
restore(snapshot) {
|
|
89
|
+
for (const [address, value] of Object.entries(snapshot)) {
|
|
90
|
+
this.entries.get(address)?.write(value);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Restores current entries and remembers future ones. Used by hydration,
|
|
95
|
+
* where primitives are constructed during the first component render.
|
|
96
|
+
*/
|
|
97
|
+
prime(snapshot) {
|
|
98
|
+
for (const [address, value] of Object.entries(snapshot)) {
|
|
99
|
+
const entry = this.entries.get(address);
|
|
100
|
+
if (entry) {
|
|
101
|
+
entry.write(value);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
this.primedValues.set(address, value);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
export const CRAFT_PRIMITIVE_REGISTRY = new InjectionToken('CRAFT_PRIMITIVE_REGISTRY', {
|
|
110
|
+
providedIn: 'root',
|
|
111
|
+
factory: () => new CraftPrimitiveRegistry(),
|
|
112
|
+
});
|
|
113
|
+
/** Builds the address of a primitive from its host chain and its own name. */
|
|
114
|
+
export function ɵcraftPrimitiveAddress(hostTags, kind, name) {
|
|
115
|
+
return [...hostTags, `${kind}:${name}`].join(' / ');
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Registers a primitive instance so tooling can read and write it by address.
|
|
119
|
+
* Called by the primitives themselves at creation; a no-op when no injection
|
|
120
|
+
* context is available, so a primitive built outside one keeps working.
|
|
121
|
+
*/
|
|
122
|
+
export function ɵregisterCraftPrimitive(options) {
|
|
123
|
+
const resolve = (token, fallback) => {
|
|
124
|
+
try {
|
|
125
|
+
return options.injector
|
|
126
|
+
? (options.injector.get(token, fallback) ?? fallback)
|
|
127
|
+
: (inject(token, { optional: true }) ?? fallback);
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
return fallback;
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
const registry = resolve(CRAFT_PRIMITIVE_REGISTRY, null);
|
|
134
|
+
if (!registry)
|
|
135
|
+
return { link: () => undefined };
|
|
136
|
+
const hostTags = resolve(ɵHOST_TAG_LIST, []);
|
|
137
|
+
const { address, release } = registry.register(ɵcraftPrimitiveAddress(hostTags, options.kind, options.name), {
|
|
138
|
+
kind: options.kind,
|
|
139
|
+
name: options.name,
|
|
140
|
+
hostTags,
|
|
141
|
+
read: options.read,
|
|
142
|
+
write: options.write,
|
|
143
|
+
...(options.reload ? { reload: options.reload } : {}),
|
|
144
|
+
...(options.status ? { status: options.status } : {}),
|
|
145
|
+
...(options.error ? { error: options.error } : {}),
|
|
146
|
+
});
|
|
147
|
+
let destroyRef = null;
|
|
148
|
+
try {
|
|
149
|
+
destroyRef = options.injector
|
|
150
|
+
? options.injector.get(DestroyRef, null)
|
|
151
|
+
: (inject(DestroyRef, { optional: true }) ?? null);
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
destroyRef = null;
|
|
155
|
+
}
|
|
156
|
+
destroyRef?.onDestroy(release);
|
|
157
|
+
return { link: (ref) => registry.link(ref, address) };
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=craft-primitive-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"craft-primitive-registry.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/craft-primitive-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,MAAM,EACN,cAAc,GAEf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AA6CjD,MAAM,OAAO,sBAAsB;IAChB,OAAO,GAAG,IAAI,GAAG,EAA+B,CAAC;IACjD,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,YAAY,GAAG,IAAI,GAAG,EAAmB,CAAC;IAC3D,0EAA0E;IACzD,SAAS,GAAG,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xC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC;IACvD,CAAC;IAAC,MAAM,CAAC;QACP,UAAU,GAAG,IAAI,CAAC;IACpB,CAAC;IACD,UAAU,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAE/B,OAAO,EAAE,IAAI,EAAE,CAAC,GAAY,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC;AACjE,CAAC","sourcesContent":["import {\n DestroyRef,\n inject,\n InjectionToken,\n type Injector,\n} from './host/craft-compat';\nimport { ɵHOST_TAG_LIST } from './craft-service';\n\n/**\n * Primitives that hold a value the registry can read back and write into.\n * `source$` is deliberately absent: an event stream has no state to restore.\n */\nexport type CraftPrimitiveKind =\n | 'state'\n | 'query'\n | 'mutation'\n | 'asyncProcess'\n | 'queryParams';\n\n/**\n * One addressable primitive instance.\n *\n * The address is the host-tag chain plus the primitive's own name, which is\n * already unique per INSTANCE: `provideHostName` stamps a creation ordinal on\n * every component tag, so two rows of the same list read as\n * `component:Row#1 / …` and `component:Row#2 / …`.\n *\n * That ordinal is stable for the lifetime of a session but not across reloads,\n * and a row destroyed and re-created takes a new one. It is enough to replay a\n * machine inside one session; it is not a persistence key.\n */\nexport type CraftPrimitiveEntry = Readonly<{\n address: string;\n kind: CraftPrimitiveKind;\n name: string;\n hostTags: readonly string[];\n read(): unknown;\n write(value: unknown): void;\n status?(): string;\n error?(): unknown;\n /**\n * Re-runs the primitive's loader, when it has one. A resource the snapshot\n * does not cover is reloaded rather than left showing data that belongs to\n * another parameter.\n */\n reload?(): boolean;\n}>;\n\n/** A value snapshot of part of the registry, keyed by address. */\nexport type CraftPrimitiveSnapshot = Readonly<Record<string, unknown>>;\n\nexport class CraftPrimitiveRegistry {\n private readonly entries = new Map<string, CraftPrimitiveEntry>();\n private readonly occurrences = new Map<string, number>();\n private readonly primedValues = new Map<string, unknown>();\n /** Public primitive ref → address, so a caller can name what it holds. */\n private readonly addresses = new WeakMap<object, string>();\n\n /** Associates the ref an application holds with its registered address. */\n link(ref: unknown, address: string): void {\n if (\n ref !== null &&\n (typeof ref === 'object' || typeof ref === 'function')\n ) {\n this.addresses.set(ref as object, address);\n }\n }\n\n /**\n * The address of a primitive from the ref an application holds — how a\n * feature names a primitive declared outside the host it is scoped to.\n */\n addressOf(ref: unknown): string | undefined {\n return ref !== null &&\n (typeof ref === 'object' || typeof ref === 'function')\n ? this.addresses.get(ref as object)\n : undefined;\n }\n\n /**\n * Registers one instance under `base`, suffixed with an occurrence number.\n *\n * The counter only ever grows: an address is never handed out twice, even\n * after the instance holding it is destroyed. A snapshot captured against\n * `…#2` can therefore never be restored into a different primitive that\n * happened to take the freed slot — it simply finds nothing.\n */\n register(\n base: string,\n entry: Omit<CraftPrimitiveEntry, 'address'>,\n ): {\n readonly address: string;\n readonly release: () => void;\n } {\n const occurrence = (this.occurrences.get(base) ?? 0) + 1;\n this.occurrences.set(base, occurrence);\n const address = `${base}#${occurrence}`;\n const registered: CraftPrimitiveEntry = { ...entry, address };\n this.entries.set(address, registered);\n if (this.primedValues.has(address)) {\n registered.write(this.primedValues.get(address));\n this.primedValues.delete(address);\n }\n\n return {\n address,\n release: () => {\n if (this.entries.get(address) === registered) {\n this.entries.delete(address);\n }\n },\n };\n }\n\n list(): readonly CraftPrimitiveEntry[] {\n return [...this.entries.values()];\n }\n\n get(address: string): CraftPrimitiveEntry | undefined {\n return this.entries.get(address);\n }\n\n /**\n * Every entry whose host-tag chain starts with `hostTags` — the primitives a\n * given host owns, transitively. An empty prefix matches the whole app.\n */\n under(hostTags: readonly string[]): readonly CraftPrimitiveEntry[] {\n return this.list().filter((entry) =>\n hostTags.every((tag, index) => entry.hostTags[index] === tag),\n );\n }\n\n /**\n * Reads the current value of the given entries. A primitive that throws on\n * read (a suspended resource, a computation in error) contributes nothing\n * rather than failing the whole capture.\n */\n capture(\n entries: readonly CraftPrimitiveEntry[] = this.list(),\n ): CraftPrimitiveSnapshot {\n const snapshot: Record<string, unknown> = {};\n for (const entry of entries) {\n try {\n snapshot[entry.address] = entry.read();\n } catch {\n // A value that cannot be read cannot be restored either.\n }\n }\n return snapshot;\n }\n\n /**\n * Writes a captured snapshot back. Addresses the registry no longer knows\n * are skipped: a row that has been destroyed since the capture has nothing\n * to restore into.\n */\n restore(snapshot: CraftPrimitiveSnapshot): void {\n for (const [address, value] of Object.entries(snapshot)) {\n this.entries.get(address)?.write(value);\n }\n }\n\n /**\n * Restores current entries and remembers future ones. Used by hydration,\n * where primitives are constructed during the first component render.\n */\n prime(snapshot: CraftPrimitiveSnapshot): void {\n for (const [address, value] of Object.entries(snapshot)) {\n const entry = this.entries.get(address);\n if (entry) {\n entry.write(value);\n } else {\n this.primedValues.set(address, value);\n }\n }\n }\n}\n\nexport const CRAFT_PRIMITIVE_REGISTRY =\n new InjectionToken<CraftPrimitiveRegistry>('CRAFT_PRIMITIVE_REGISTRY', {\n providedIn: 'root',\n factory: () => new CraftPrimitiveRegistry(),\n });\n\n/** Builds the address of a primitive from its host chain and its own name. */\nexport function ɵcraftPrimitiveAddress(\n hostTags: readonly string[],\n kind: CraftPrimitiveKind,\n name: string,\n): string {\n return [...hostTags, `${kind}:${name}`].join(' / ');\n}\n\ntype RegisterOptions = Readonly<{\n kind: CraftPrimitiveKind;\n name: string;\n read(): unknown;\n write(value: unknown): void;\n reload?(): boolean;\n status?(): string;\n error?(): unknown;\n /** Resolved from the ambient injection context when omitted. */\n injector?: Injector;\n}>;\n\n/** What a primitive gets back from registering itself. */\nexport type CraftPrimitiveRegistration = Readonly<{\n /** Associates the public ref with this registration. */\n link(ref: unknown): void;\n}>;\n\n/**\n * Registers a primitive instance so tooling can read and write it by address.\n * Called by the primitives themselves at creation; a no-op when no injection\n * context is available, so a primitive built outside one keeps working.\n */\nexport function ɵregisterCraftPrimitive(\n options: RegisterOptions,\n): CraftPrimitiveRegistration {\n const resolve = <T>(token: InjectionToken<T>, fallback: T): T => {\n try {\n return options.injector\n ? (options.injector.get(token, fallback) ?? fallback)\n : (inject(token, { optional: true }) ?? fallback);\n } catch {\n return fallback;\n }\n };\n\n const registry = resolve(\n CRAFT_PRIMITIVE_REGISTRY,\n null as never,\n ) as CraftPrimitiveRegistry | null;\n if (!registry) return { link: () => undefined };\n\n const hostTags = resolve(\n ɵHOST_TAG_LIST as unknown as InjectionToken<readonly string[]>,\n [] as readonly string[],\n );\n\n const { address, release } = registry.register(\n ɵcraftPrimitiveAddress(hostTags, options.kind, options.name),\n {\n kind: options.kind,\n name: options.name,\n hostTags,\n read: options.read,\n write: options.write,\n ...(options.reload ? { reload: options.reload } : {}),\n ...(options.status ? { status: options.status } : {}),\n ...(options.error ? { error: options.error } : {}),\n },\n );\n\n let destroyRef: DestroyRef | null = null;\n try {\n destroyRef = options.injector\n ? options.injector.get(DestroyRef, null)\n : (inject(DestroyRef, { optional: true }) ?? null);\n } catch {\n destroyRef = null;\n }\n destroyRef?.onDestroy(release);\n\n return { link: (ref: unknown) => registry.link(ref, address) };\n}\n"]}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type AnyCraftException, type ExcludeByCode, type ExtractCraftException, type StripCraftException } from './craft-exception';
|
|
2
|
+
import { type CraftGenExceptionMarker, type ExtractCraftGenExceptions } from './craft-gen';
|
|
3
|
+
import { type CraftTemporalSchedule, type RuntimeTemporalAwaitRequest } from './temporal-runtime';
|
|
4
|
+
/**
|
|
5
|
+
* A program operator: takes the piped program and returns the derived one.
|
|
6
|
+
* `YIn`/`AIn` are the source program's yields (markers included) and success
|
|
7
|
+
* value; `YOut`/`AOut` the derived program's. Use it to type custom operators:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* const swallowAll: CraftProgramOperator<Y, A, Y, A | undefined> = (program) => ...
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export type CraftProgramOperator<YIn, AIn, YOut, AOut> = (program: Generator<YIn, AIn, unknown>) => Generator<YOut, AOut, unknown>;
|
|
14
|
+
/** `Yielded` with the phantom exception markers removed (real runtime yields). */
|
|
15
|
+
type StripGenExceptionMarkers<Yielded> = Exclude<Yielded, CraftGenExceptionMarker<any>>;
|
|
16
|
+
/** Rebuilds a marker for `Exception`, or `never` when nothing remains to advertise. */
|
|
17
|
+
type MarkerFor<Exception> = [Exception] extends [never] ? never : CraftGenExceptionMarker<Exception>;
|
|
18
|
+
type HandlerGen = (exception: any) => Generator<any, any, unknown>;
|
|
19
|
+
type HandlerYielded<Handler> = Handler extends (...args: any[]) => Generator<infer Yielded, any, any> ? Yielded : never;
|
|
20
|
+
type HandlerOutput<Handler> = Handler extends (...args: any[]) => Generator<any, infer Output, any> ? Output : never;
|
|
21
|
+
/** The exceptions a handler may itself produce (nested programs + returned exceptions). */
|
|
22
|
+
type HandlerExceptions<HYielded, HOutput> = Extract<ExtractCraftGenExceptions<HYielded> | ExtractCraftException<HOutput>, AnyCraftException>;
|
|
23
|
+
/**
|
|
24
|
+
* Compile-time exhaustiveness of a `catchTag.exhaustive` map, checked at the
|
|
25
|
+
* `.pipe` application site (the program's exception union is only known
|
|
26
|
+
* there): every reachable code needs a handler, and no handler may target an
|
|
27
|
+
* unreachable code. On violation the operator's program parameter collapses to
|
|
28
|
+
* an impossible intersection whose property name spells out the problem.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Shared exact-code check used by program and component catchTag adapters.
|
|
32
|
+
*
|
|
33
|
+
* The handler value is intentionally not part of this type: each consumer
|
|
34
|
+
* has a different handler contract (generators for programs, template
|
|
35
|
+
* children for components), but the reachable-code rules are identical.
|
|
36
|
+
*/
|
|
37
|
+
export type CatchTagExhaustiveCodesCheck<Codes extends PropertyKey, Handlers> = [Exclude<Codes, keyof Handlers>] extends [never] ? [Exclude<keyof Handlers, Codes>] extends [never] ? unknown : {
|
|
38
|
+
'catchTag.exhaustive has handlers for unreachable codes': Exclude<keyof Handlers, Codes>;
|
|
39
|
+
} : {
|
|
40
|
+
'catchTag.exhaustive is missing handlers for codes': Exclude<Codes, keyof Handlers>;
|
|
41
|
+
};
|
|
42
|
+
export type CatchTagExhaustiveHandlersCheck<Exception extends AnyCraftException, Handlers> = CatchTagExhaustiveCodesCheck<Exception['_tag'], Handlers>;
|
|
43
|
+
type ExhaustiveHandlersYielded<Handlers> = {
|
|
44
|
+
[K in keyof Handlers]: HandlerYielded<Handlers[K]>;
|
|
45
|
+
}[keyof Handlers];
|
|
46
|
+
type ExhaustiveHandlersOutput<Handlers> = {
|
|
47
|
+
[K in keyof Handlers]: HandlerOutput<Handlers[K]>;
|
|
48
|
+
}[keyof Handlers];
|
|
49
|
+
type ExhaustiveHandlersExceptions<Handlers> = {
|
|
50
|
+
[K in keyof Handlers]: HandlerExceptions<HandlerYielded<Handlers[K]>, HandlerOutput<Handlers[K]>>;
|
|
51
|
+
}[keyof Handlers];
|
|
52
|
+
interface CatchTagOperator {
|
|
53
|
+
/**
|
|
54
|
+
* Catches the program's `craftException` of `code`: the handler generator
|
|
55
|
+
* runs in its place (its yields — craft services, nested programs,
|
|
56
|
+
* `craftUntilSettled` — are relayed to the driver, so its dependencies stay
|
|
57
|
+
* tracked) and its success value widens the program's. `code` is removed
|
|
58
|
+
* from the program's exception union; exceptions the handler itself
|
|
59
|
+
* produces are added to it.
|
|
60
|
+
*/
|
|
61
|
+
<const Code extends string, HYielded, HOutput>(code: Code, handler: (exception: AnyCraftException & {
|
|
62
|
+
code: Code;
|
|
63
|
+
}) => Generator<HYielded, HOutput, unknown>): <YIn, AIn>(program: Generator<YIn, AIn, unknown>) => Generator<StripGenExceptionMarkers<YIn> | StripGenExceptionMarkers<HYielded> | MarkerFor<Extract<ExcludeByCode<ExtractCraftGenExceptions<YIn>, Code>, AnyCraftException> | HandlerExceptions<HYielded, HOutput>>, AIn | StripCraftException<HOutput>, unknown>;
|
|
64
|
+
/**
|
|
65
|
+
* Catches **every** reachable `craftException` of the program through a
|
|
66
|
+
* handler map covering exactly its exception union — a missing code or a
|
|
67
|
+
* handler for an unreachable code is a compile error at the `.pipe`
|
|
68
|
+
* application site. Afterwards the program's exception union is `never`
|
|
69
|
+
* (plus whatever the handlers themselves may produce).
|
|
70
|
+
*/
|
|
71
|
+
exhaustive: <Handlers extends Record<string, HandlerGen>>(handlers: Handlers) => <YIn, AIn>(program: Generator<YIn, AIn, unknown> & CatchTagExhaustiveHandlersCheck<Extract<ExtractCraftGenExceptions<YIn>, AnyCraftException>, Handlers>) => Generator<StripGenExceptionMarkers<YIn> | StripGenExceptionMarkers<ExhaustiveHandlersYielded<Handlers>> | MarkerFor<Extract<ExhaustiveHandlersExceptions<Handlers>, AnyCraftException>>, AIn | StripCraftException<ExhaustiveHandlersOutput<Handlers>>, unknown>;
|
|
72
|
+
}
|
|
73
|
+
export declare const catchTag: CatchTagOperator;
|
|
74
|
+
/**
|
|
75
|
+
* Retry policy for {@link retry}:
|
|
76
|
+
* - `times` — maximum number of *re*-executions after the initial attempt;
|
|
77
|
+
* - `while` — only retry these exception codes (all when omitted);
|
|
78
|
+
* - `backoff`/`delayMs` — wait between attempts: `delayMs` flat (`'none'`,
|
|
79
|
+
* the default), `delayMs * attempt` (`'linear'`) or `delayMs * 2^(attempt-1)`
|
|
80
|
+
* (`'exponential'`). No wait when `delayMs` is omitted.
|
|
81
|
+
*/
|
|
82
|
+
export type CraftRetryPolicy = {
|
|
83
|
+
times: number;
|
|
84
|
+
while?: string[];
|
|
85
|
+
backoff?: 'none' | 'linear' | 'exponential';
|
|
86
|
+
delayMs?: number;
|
|
87
|
+
schedule?: CraftTemporalSchedule;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Re-executes the program when it fails with a matched `craftException`, up to
|
|
91
|
+
* `policy.times` extra attempts, then rethrows. Each re-execution replays the
|
|
92
|
+
* whole upstream `.pipe` chain from the source invocation.
|
|
93
|
+
*
|
|
94
|
+
* A non-zero backoff suspends between attempts through an await-request, so it
|
|
95
|
+
* needs an async driver (a route chain or a primitive loader) — in a purely
|
|
96
|
+
* synchronous context (`craftUse`, live guard re-check) the suspension raises
|
|
97
|
+
* the driver's usual await-not-supported/pending behaviour.
|
|
98
|
+
*/
|
|
99
|
+
export declare function retry(policy: CraftRetryPolicy): <YIn, AIn>(program: Generator<YIn, AIn, unknown>) => Generator<YIn | RuntimeTemporalAwaitRequest, AIn, unknown>;
|
|
100
|
+
export {};
|
|
101
|
+
//# sourceMappingURL=craft-program-operators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"craft-program-operators.d.ts","sourceRoot":"","sources":["../../../../../libs/core/src/lib/craft-program-operators.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAIL,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC/B,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EACjC,MAAM,oBAAoB,CAAC;AA2B5B;;;;;;;;GAQG;AACH,MAAM,MAAM,oBAAoB,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,IAAI,CACvD,OAAO,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,KAClC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAEpC,kFAAkF;AAClF,KAAK,wBAAwB,CAAC,OAAO,IAAI,OAAO,CAC9C,OAAO,EACP,uBAAuB,CAAC,GAAG,CAAC,CAC7B,CAAC;AAEF,uFAAuF;AACvF,KAAK,SAAS,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,GACnD,KAAK,GACL,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAEvC,KAAK,UAAU,GA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AAE,UAAU,CAAC,EACtD,QAAQ,EAAE,QAAQ,KACf,CAAC,GAAG,EAAE,GAAG,EACZ,OAAO,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,GACnC,+BAA+B,CAC7B,OAAO,CAAC,yBAAyB,CAAC,GAAG,CAAC,EAAE,iBAAiB,CAAC,EAC1D,QAAQ,CACT,KACA,SAAS,CACV,wBAAwB,CAAC,GAAG,CAAC,GAC7B,wBAAwB,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CAAC,GAC7D,SAAS,CACP,OAAO,CAAC,4BAA4B,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC,CACnE,EACH,GAAG,GAAG,mBAAmB,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC,EAC7D,OAAO,CACR,CAAC;CACH;AAyBD,eAAO,MAAM,QAAQ,EAAE,gBAKF,CAAC;AAEtB;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,aAAa,CAAC;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC,CAAC;AA2BF;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CACnB,MAAM,EAAE,gBAAgB,GACvB,CAAC,GAAG,EAAE,GAAG,EACV,OAAO,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,KAClC,SAAS,CAAC,GAAG,GAAG,2BAA2B,EAAE,GAAG,EAAE,OAAO,CAAC,CA+C9D"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { isCraftException, } from './craft-exception';
|
|
2
|
+
import { CraftGenShortCircuit, isCraftGenShortCircuit, ɵgetCraftProgramRecreate, } from './craft-gen';
|
|
3
|
+
import { createTemporalSleepRequest, exponentialTemporalSchedule, } from './temporal-runtime';
|
|
4
|
+
import { GUARD_AWAIT_REQUEST_MARKER, isGenerator, } from './craft-generator-runtime';
|
|
5
|
+
const RETRY_REQUIRES_PROGRAM_ERROR_MESSAGE = 'retry(...) needs a re-invocable craft program (a craftGen invocation or a .pipe stage); a bare generator cannot be replayed.';
|
|
6
|
+
function runHandlerOutput(output) {
|
|
7
|
+
if (isCraftException(output)) {
|
|
8
|
+
// A handler that resolves to a `craftException` re-enters the exception
|
|
9
|
+
// channel (mirrors craftGen's own return contract).
|
|
10
|
+
throw new CraftGenShortCircuit(output);
|
|
11
|
+
}
|
|
12
|
+
return output;
|
|
13
|
+
}
|
|
14
|
+
function* catchWithLookup(program, lookupHandler) {
|
|
15
|
+
try {
|
|
16
|
+
return yield* program;
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
if (!isCraftGenShortCircuit(error)) {
|
|
20
|
+
throw error;
|
|
21
|
+
}
|
|
22
|
+
const handler = lookupHandler(error.exception._tag);
|
|
23
|
+
if (!handler) {
|
|
24
|
+
throw error;
|
|
25
|
+
}
|
|
26
|
+
const result = handler(error.exception);
|
|
27
|
+
const output = isGenerator(result) ? yield* result : result;
|
|
28
|
+
return runHandlerOutput(output);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function catchTagImpl(code, handler) {
|
|
32
|
+
return (program) => catchWithLookup(program, (thrownCode) => thrownCode === code ? handler : undefined);
|
|
33
|
+
}
|
|
34
|
+
function catchTagExhaustiveImpl(handlers) {
|
|
35
|
+
return (program) =>
|
|
36
|
+
// An unknown code (outside the typed union) finds no handler and is
|
|
37
|
+
// rethrown — the safety net for exceptions that escaped the types.
|
|
38
|
+
catchWithLookup(program, (thrownCode) => handlers[thrownCode]);
|
|
39
|
+
}
|
|
40
|
+
export const catchTag = Object.assign(catchTagImpl, {
|
|
41
|
+
exhaustive: catchTagExhaustiveImpl,
|
|
42
|
+
});
|
|
43
|
+
function retrySchedule(policy) {
|
|
44
|
+
if (policy.schedule)
|
|
45
|
+
return policy.schedule;
|
|
46
|
+
const base = policy.delayMs ?? 0;
|
|
47
|
+
if (policy.backoff === 'exponential') {
|
|
48
|
+
return exponentialTemporalSchedule(base, { maxAttempts: policy.times });
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
next: ({ attempt }) => attempt > policy.times
|
|
52
|
+
? { done: true }
|
|
53
|
+
: {
|
|
54
|
+
done: false,
|
|
55
|
+
delayMs: policy.backoff === 'linear' ? base * attempt : base,
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function delayAwaitRequest(delayMs) {
|
|
60
|
+
return Object.assign(createTemporalSleepRequest(delayMs), {
|
|
61
|
+
[GUARD_AWAIT_REQUEST_MARKER]: true,
|
|
62
|
+
kind: 'promise',
|
|
63
|
+
value: Promise.resolve(),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Re-executes the program when it fails with a matched `craftException`, up to
|
|
68
|
+
* `policy.times` extra attempts, then rethrows. Each re-execution replays the
|
|
69
|
+
* whole upstream `.pipe` chain from the source invocation.
|
|
70
|
+
*
|
|
71
|
+
* A non-zero backoff suspends between attempts through an await-request, so it
|
|
72
|
+
* needs an async driver (a route chain or a primitive loader) — in a purely
|
|
73
|
+
* synchronous context (`craftUse`, live guard re-check) the suspension raises
|
|
74
|
+
* the driver's usual await-not-supported/pending behaviour.
|
|
75
|
+
*/
|
|
76
|
+
export function retry(policy) {
|
|
77
|
+
return (program) => (function* () {
|
|
78
|
+
let attempt = 0;
|
|
79
|
+
const schedule = retrySchedule(policy);
|
|
80
|
+
let current = program;
|
|
81
|
+
for (;;) {
|
|
82
|
+
try {
|
|
83
|
+
return yield* current;
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
if (!isCraftGenShortCircuit(error)) {
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
if (policy.while && !policy.while.includes(error.exception._tag)) {
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
92
|
+
if (attempt >= policy.times) {
|
|
93
|
+
throw error;
|
|
94
|
+
}
|
|
95
|
+
const recreate = ɵgetCraftProgramRecreate(program);
|
|
96
|
+
if (!recreate) {
|
|
97
|
+
throw new Error(RETRY_REQUIRES_PROGRAM_ERROR_MESSAGE);
|
|
98
|
+
}
|
|
99
|
+
attempt += 1;
|
|
100
|
+
const decision = schedule.next({
|
|
101
|
+
attempt,
|
|
102
|
+
elapsedMs: 0,
|
|
103
|
+
error: error.exception,
|
|
104
|
+
});
|
|
105
|
+
if (decision.done)
|
|
106
|
+
throw error;
|
|
107
|
+
const delayMs = decision.delayMs;
|
|
108
|
+
if (delayMs > 0) {
|
|
109
|
+
yield delayAwaitRequest(delayMs);
|
|
110
|
+
}
|
|
111
|
+
current = recreate();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
})();
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=craft-program-operators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"craft-program-operators.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/craft-program-operators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,GAKjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,GAGzB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,GAG5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,0BAA0B,EAC1B,WAAW,GAEZ,MAAM,2BAA2B,CAAC;AAkEnC,MAAM,oCAAoC,GACxC,8HAA8H,CAAC;AAEjI,SAAS,gBAAgB,CAAC,MAAe;IACvC,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7B,wEAAwE;QACxE,oDAAoD;QACpD,MAAM,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAAC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OAAO,CAAC;YACxB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,EAAE,CAAC;oBACnC,MAAM,KAAK,CAAC;gBACd,CAAC;gBAED,IAAI,MAAM,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;oBACjE,MAAM,KAAK,CAAC;gBACd,CAAC;gBAED,IAAI,OAAO,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;oBAC5B,MAAM,KAAK,CAAC;gBACd,CAAC;gBAED,MAAM,QAAQ,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;gBAEnD,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACd,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;gBACxD,CAAC;gBAED,OAAO,IAAI,CAAC,CAAC;gBAEb,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC;oBAC7B,OAAO;oBACP,SAAS,EAAE,CAAC;oBACZ,KAAK,EAAE,KAAK,CAAC,SAAS;iBACvB,CAAC,CAAC;gBACH,IAAI,QAAQ,CAAC,IAAI;oBAAE,MAAM,KAAK,CAAC;gBAC/B,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;gBAEjC,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;oBAChB,MAAM,iBAAiB,CAAC,OAAO,CAAU,CAAC;gBAC5C,CAAC;gBAED,OAAO,GAAG,QAAQ,EAAkC,CAAC;YACvD,CAAC;QACH,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;AACT,CAAC","sourcesContent":["import {\n isCraftException,\n type AnyCraftException,\n type ExcludeByCode,\n type ExtractCraftException,\n type StripCraftException,\n} from './craft-exception';\nimport {\n CraftGenShortCircuit,\n isCraftGenShortCircuit,\n ɵgetCraftProgramRecreate,\n type CraftGenExceptionMarker,\n type ExtractCraftGenExceptions,\n} from './craft-gen';\nimport {\n createTemporalSleepRequest,\n exponentialTemporalSchedule,\n type CraftTemporalSchedule,\n type RuntimeTemporalAwaitRequest,\n} from './temporal-runtime';\nimport {\n GUARD_AWAIT_REQUEST_MARKER,\n isGenerator,\n type RuntimeGuardAwaitRequest,\n} from './craft-generator-runtime';\n\n// ---------------------------------------------------------------------------\n// Program operators, composed through a craft program's `.pipe(...)`:\n//\n// ```ts\n// const user = yield* loadUser(id).pipe(\n// catchTag('NOT_FOUND', function* () { return GUEST; }),\n// retry({ times: 3, backoff: 'exponential', delayMs: 200 }),\n// );\n// ```\n//\n// The exception union `E` of a program travels exclusively at the type level\n// (the `CraftGenExceptionMarker` in its `Yielded`); at runtime an exception is\n// a thrown `CraftGenShortCircuit`, so operators are plain generator wrappers\n// and no driver has to know about them.\n//\n// Operators are written *generator-first*: the factory (`catchTag(...)`)\n// captures only its own inputs and returns a **generic** operator, so the\n// program's `Yielded`/`Return` are inferred at the `.pipe` application site.\n// ---------------------------------------------------------------------------\n\n/**\n * A program operator: takes the piped program and returns the derived one.\n * `YIn`/`AIn` are the source program's yields (markers included) and success\n * value; `YOut`/`AOut` the derived program's. Use it to type custom operators:\n *\n * ```ts\n * const swallowAll: CraftProgramOperator<Y, A, Y, A | undefined> = (program) => ...\n * ```\n */\nexport type CraftProgramOperator<YIn, AIn, YOut, AOut> = (\n program: Generator<YIn, AIn, unknown>,\n) => Generator<YOut, AOut, unknown>;\n\n/** `Yielded` with the phantom exception markers removed (real runtime yields). */\ntype StripGenExceptionMarkers<Yielded> = Exclude<\n Yielded,\n CraftGenExceptionMarker<any>\n>;\n\n/** Rebuilds a marker for `Exception`, or `never` when nothing remains to advertise. */\ntype MarkerFor<Exception> = [Exception] extends [never]\n ? never\n : CraftGenExceptionMarker<Exception>;\n\ntype HandlerGen = (exception: any) => Generator<any, any, unknown>;\n\ntype HandlerYielded<Handler> = Handler extends (\n ...args: any[]\n) => Generator<infer Yielded, any, any>\n ? Yielded\n : never;\n\ntype HandlerOutput<Handler> = Handler extends (\n ...args: any[]\n) => Generator<any, infer Output, any>\n ? Output\n : never;\n\n/** The exceptions a handler may itself produce (nested programs + returned exceptions). */\ntype HandlerExceptions<HYielded, HOutput> = Extract<\n ExtractCraftGenExceptions<HYielded> | ExtractCraftException<HOutput>,\n AnyCraftException\n>;\n\nconst RETRY_REQUIRES_PROGRAM_ERROR_MESSAGE =\n 'retry(...) needs a re-invocable craft program (a craftGen invocation or a .pipe stage); a bare generator cannot be replayed.';\n\nfunction runHandlerOutput(output: unknown): unknown {\n if (isCraftException(output)) {\n // A handler that resolves to a `craftException` re-enters the exception\n // channel (mirrors craftGen's own return contract).\n throw new CraftGenShortCircuit(output);\n }\n\n return output;\n}\n\nfunction* catchWithLookup(\n program: Generator<unknown, unknown, unknown>,\n lookupHandler: (code: string) => HandlerGen | undefined,\n): Generator<unknown, unknown, unknown> {\n try {\n return yield* program;\n } catch (error) {\n if (!isCraftGenShortCircuit(error)) {\n throw error;\n }\n\n const handler = lookupHandler(error.exception._tag);\n\n if (!handler) {\n throw error;\n }\n\n const result = handler(error.exception);\n const output: unknown = isGenerator(result) ? yield* result : result;\n\n return runHandlerOutput(output);\n }\n}\n\n/**\n * Compile-time exhaustiveness of a `catchTag.exhaustive` map, checked at the\n * `.pipe` application site (the program's exception union is only known\n * there): every reachable code needs a handler, and no handler may target an\n * unreachable code. On violation the operator's program parameter collapses to\n * an impossible intersection whose property name spells out the problem.\n */\n/**\n * Shared exact-code check used by program and component catchTag adapters.\n *\n * The handler value is intentionally not part of this type: each consumer\n * has a different handler contract (generators for programs, template\n * children for components), but the reachable-code rules are identical.\n */\nexport type CatchTagExhaustiveCodesCheck<\n Codes extends PropertyKey,\n Handlers,\n> = [Exclude<Codes, keyof Handlers>] extends [never]\n ? [Exclude<keyof Handlers, Codes>] extends [never]\n ? unknown\n : {\n 'catchTag.exhaustive has handlers for unreachable codes': Exclude<\n keyof Handlers,\n Codes\n >;\n }\n : {\n 'catchTag.exhaustive is missing handlers for codes': Exclude<\n Codes,\n keyof Handlers\n >;\n };\n\nexport type CatchTagExhaustiveHandlersCheck<\n Exception extends AnyCraftException,\n Handlers,\n> = CatchTagExhaustiveCodesCheck<Exception['_tag'], Handlers>;\n\ntype ExhaustiveHandlersYielded<Handlers> = {\n [K in keyof Handlers]: HandlerYielded<Handlers[K]>;\n}[keyof Handlers];\n\ntype ExhaustiveHandlersOutput<Handlers> = {\n [K in keyof Handlers]: HandlerOutput<Handlers[K]>;\n}[keyof Handlers];\n\ntype ExhaustiveHandlersExceptions<Handlers> = {\n [K in keyof Handlers]: HandlerExceptions<\n HandlerYielded<Handlers[K]>,\n HandlerOutput<Handlers[K]>\n >;\n}[keyof Handlers];\n\ninterface CatchTagOperator {\n /**\n * Catches the program's `craftException` of `code`: the handler generator\n * runs in its place (its yields — craft services, nested programs,\n * `craftUntilSettled` — are relayed to the driver, so its dependencies stay\n * tracked) and its success value widens the program's. `code` is removed\n * from the program's exception union; exceptions the handler itself\n * produces are added to it.\n */\n <const Code extends string, HYielded, HOutput>(\n code: Code,\n handler: (\n exception: AnyCraftException & { code: Code },\n ) => Generator<HYielded, HOutput, unknown>,\n ): <YIn, AIn>(\n program: Generator<YIn, AIn, unknown>,\n ) => Generator<\n | StripGenExceptionMarkers<YIn>\n | StripGenExceptionMarkers<HYielded>\n | MarkerFor<\n | Extract<\n ExcludeByCode<ExtractCraftGenExceptions<YIn>, Code>,\n AnyCraftException\n >\n | HandlerExceptions<HYielded, HOutput>\n >,\n AIn | StripCraftException<HOutput>,\n unknown\n >;\n\n /**\n * Catches **every** reachable `craftException` of the program through a\n * handler map covering exactly its exception union — a missing code or a\n * handler for an unreachable code is a compile error at the `.pipe`\n * application site. Afterwards the program's exception union is `never`\n * (plus whatever the handlers themselves may produce).\n */\n exhaustive: <Handlers extends Record<string, HandlerGen>>(\n handlers: Handlers,\n ) => <YIn, AIn>(\n program: Generator<YIn, AIn, unknown> &\n CatchTagExhaustiveHandlersCheck<\n Extract<ExtractCraftGenExceptions<YIn>, AnyCraftException>,\n Handlers\n >,\n ) => Generator<\n | StripGenExceptionMarkers<YIn>\n | StripGenExceptionMarkers<ExhaustiveHandlersYielded<Handlers>>\n | MarkerFor<\n Extract<ExhaustiveHandlersExceptions<Handlers>, AnyCraftException>\n >,\n AIn | StripCraftException<ExhaustiveHandlersOutput<Handlers>>,\n unknown\n >;\n}\n\nfunction catchTagImpl(\n code: string,\n handler: HandlerGen,\n): (\n program: Generator<unknown, unknown, unknown>,\n) => Generator<unknown, unknown, unknown> {\n return (program) =>\n catchWithLookup(program, (thrownCode) =>\n thrownCode === code ? handler : undefined,\n );\n}\n\nfunction catchTagExhaustiveImpl(\n handlers: Record<string, HandlerGen>,\n): (\n program: Generator<unknown, unknown, unknown>,\n) => Generator<unknown, unknown, unknown> {\n return (program) =>\n // An unknown code (outside the typed union) finds no handler and is\n // rethrown — the safety net for exceptions that escaped the types.\n catchWithLookup(program, (thrownCode) => handlers[thrownCode]);\n}\n\nexport const catchTag: CatchTagOperator = Object.assign(\n catchTagImpl as unknown as CatchTagOperator,\n {\n exhaustive: catchTagExhaustiveImpl,\n },\n) as CatchTagOperator;\n\n/**\n * Retry policy for {@link retry}:\n * - `times` — maximum number of *re*-executions after the initial attempt;\n * - `while` — only retry these exception codes (all when omitted);\n * - `backoff`/`delayMs` — wait between attempts: `delayMs` flat (`'none'`,\n * the default), `delayMs * attempt` (`'linear'`) or `delayMs * 2^(attempt-1)`\n * (`'exponential'`). No wait when `delayMs` is omitted.\n */\nexport type CraftRetryPolicy = {\n times: number;\n while?: string[];\n backoff?: 'none' | 'linear' | 'exponential';\n delayMs?: number;\n schedule?: CraftTemporalSchedule;\n};\n\nfunction retrySchedule(policy: CraftRetryPolicy): CraftTemporalSchedule {\n if (policy.schedule) return policy.schedule;\n const base = policy.delayMs ?? 0;\n if (policy.backoff === 'exponential') {\n return exponentialTemporalSchedule(base, { maxAttempts: policy.times });\n }\n return {\n next: ({ attempt }) =>\n attempt > policy.times\n ? { done: true }\n : {\n done: false,\n delayMs: policy.backoff === 'linear' ? base * attempt : base,\n },\n };\n}\n\nfunction delayAwaitRequest(delayMs: number): RuntimeTemporalAwaitRequest {\n return Object.assign(createTemporalSleepRequest(delayMs), {\n [GUARD_AWAIT_REQUEST_MARKER]: true,\n kind: 'promise' as const,\n value: Promise.resolve(),\n }) as unknown as RuntimeTemporalAwaitRequest & RuntimeGuardAwaitRequest;\n}\n\n/**\n * Re-executes the program when it fails with a matched `craftException`, up to\n * `policy.times` extra attempts, then rethrows. Each re-execution replays the\n * whole upstream `.pipe` chain from the source invocation.\n *\n * A non-zero backoff suspends between attempts through an await-request, so it\n * needs an async driver (a route chain or a primitive loader) — in a purely\n * synchronous context (`craftUse`, live guard re-check) the suspension raises\n * the driver's usual await-not-supported/pending behaviour.\n */\nexport function retry(\n policy: CraftRetryPolicy,\n): <YIn, AIn>(\n program: Generator<YIn, AIn, unknown>,\n) => Generator<YIn | RuntimeTemporalAwaitRequest, AIn, unknown> {\n return <YIn, AIn>(program: Generator<YIn, AIn, unknown>) =>\n (function* (): Generator<YIn | RuntimeTemporalAwaitRequest, AIn, unknown> {\n let attempt = 0;\n const schedule = retrySchedule(policy);\n let current: Generator<YIn, AIn, unknown> = program;\n\n for (;;) {\n try {\n return yield* current;\n } catch (error) {\n if (!isCraftGenShortCircuit(error)) {\n throw error;\n }\n\n if (policy.while && !policy.while.includes(error.exception._tag)) {\n throw error;\n }\n\n if (attempt >= policy.times) {\n throw error;\n }\n\n const recreate = ɵgetCraftProgramRecreate(program);\n\n if (!recreate) {\n throw new Error(RETRY_REQUIRES_PROGRAM_ERROR_MESSAGE);\n }\n\n attempt += 1;\n\n const decision = schedule.next({\n attempt,\n elapsedMs: 0,\n error: error.exception,\n });\n if (decision.done) throw error;\n const delayMs = decision.delayMs;\n\n if (delayMs > 0) {\n yield delayAwaitRequest(delayMs) as never;\n }\n\n current = recreate() as Generator<YIn, AIn, unknown>;\n }\n }\n })();\n}\n"]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Injector } from './host/craft-compat';
|
|
2
|
+
import type { AnyCraftException } from './craft-exception';
|
|
3
|
+
import { type RuntimeAwaitRequest } from './craft-generator-runtime';
|
|
4
|
+
/** What a foreign yield settled to, once its bridge resolved it. */
|
|
5
|
+
export type ForeignYieldOutcome = {
|
|
6
|
+
kind: 'value';
|
|
7
|
+
value: unknown;
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'exception';
|
|
10
|
+
exception: AnyCraftException;
|
|
11
|
+
};
|
|
12
|
+
/** The context a bridge needs in order to resolve and run a foreign yield. */
|
|
13
|
+
export type ForeignYieldContext = {
|
|
14
|
+
/**
|
|
15
|
+
* The injector of the program that yielded. A bridge resolves its runtime
|
|
16
|
+
* from here, which is what makes per-route runtimes and their inheritance
|
|
17
|
+
* possible at all.
|
|
18
|
+
*/
|
|
19
|
+
readonly injector: Injector;
|
|
20
|
+
/** Aborted when the owning program is superseded or destroyed. */
|
|
21
|
+
readonly abortSignal?: AbortSignal;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Returns a promise for yields it recognises, `undefined` for everything else
|
|
25
|
+
* (which then falls through to the usual invalid-yield error).
|
|
26
|
+
*/
|
|
27
|
+
export type ForeignYieldBridge = (yielded: unknown, context: ForeignYieldContext) => PromiseLike<ForeignYieldOutcome> | undefined;
|
|
28
|
+
/** Registers the bridge; returns a disposer restoring the previous one. */
|
|
29
|
+
export declare function setForeignYieldBridge(bridge: ForeignYieldBridge): () => void;
|
|
30
|
+
/** @deprecated Prototype spelling, kept for the wave-0 fixtures. */
|
|
31
|
+
export declare const ɵsetForeignYieldBridge: typeof setForeignYieldBridge;
|
|
32
|
+
/** A program's driver step: settled (`done`/`shortCircuit`) or suspended on an await. */
|
|
33
|
+
export type CraftProgramStep = {
|
|
34
|
+
kind: 'done';
|
|
35
|
+
value: unknown;
|
|
36
|
+
} | {
|
|
37
|
+
kind: 'await';
|
|
38
|
+
request: RuntimeAwaitRequest;
|
|
39
|
+
} | {
|
|
40
|
+
kind: 'shortCircuit';
|
|
41
|
+
exception: AnyCraftException;
|
|
42
|
+
};
|
|
43
|
+
/** A settled program step (the `await` suspension already driven through). */
|
|
44
|
+
export type CraftProgramSettledStep = Exclude<CraftProgramStep, {
|
|
45
|
+
kind: 'await';
|
|
46
|
+
}>;
|
|
47
|
+
export type CraftProgramPumpOptions = {
|
|
48
|
+
/** Error raised when the program yields something the driver cannot resolve. */
|
|
49
|
+
invalidYieldErrorMessage: string;
|
|
50
|
+
/**
|
|
51
|
+
* When set, an `onAppStart(...)` yield raises this dedicated error instead of
|
|
52
|
+
* the generic invalid-yield one (primitive loaders keep their historical
|
|
53
|
+
* message); when omitted, an app-start yield falls through to
|
|
54
|
+
* `invalidYieldErrorMessage` (route guards).
|
|
55
|
+
*/
|
|
56
|
+
appStartNotSupportedErrorMessage?: string;
|
|
57
|
+
/** Abort signal for temporal awaits owned by the current async program. */
|
|
58
|
+
abortSignal?: AbortSignal;
|
|
59
|
+
};
|
|
60
|
+
export declare function pumpCraftProgramSync(iterator: Generator<unknown, unknown, unknown>, injector: Injector, options: CraftProgramPumpOptions, resumeValue?: unknown): CraftProgramStep;
|
|
61
|
+
export declare function awaitCraftProgramRequest(request: RuntimeAwaitRequest, injector: Injector, abortSignal?: AbortSignal): Promise<unknown>;
|
|
62
|
+
export declare function driveCraftProgramAsync(iterator: Generator<unknown, unknown, unknown>, injector: Injector, step: CraftProgramStep, options: CraftProgramPumpOptions): Promise<CraftProgramSettledStep>;
|
|
63
|
+
/**
|
|
64
|
+
* Async counterpart of `executeGeneratorCompatibleFactory`: same contract (a
|
|
65
|
+
* factory that returns either a plain value or a craft generator), but the
|
|
66
|
+
* generator path is driven by the async program pump — `craftUntilSettled` /
|
|
67
|
+
* `craftUntilDefined` awaits suspend instead of erroring, and a
|
|
68
|
+
* `CraftGenShortCircuit` settles as a `shortCircuit` step instead of throwing.
|
|
69
|
+
* The `done` value is awaited (generator loaders may return a bare promise).
|
|
70
|
+
*/
|
|
71
|
+
export declare function executeGeneratorCompatibleFactoryAsync<This, Args extends unknown[], Result>({ factory, thisArg, getInjector, args, invalidYieldErrorMessage, appStartNotSupportedErrorMessage, abortSignal, }: {
|
|
72
|
+
factory: (this: This, ...args: Args) => Result;
|
|
73
|
+
thisArg: This;
|
|
74
|
+
getInjector: () => Injector | object;
|
|
75
|
+
args: Args;
|
|
76
|
+
invalidYieldErrorMessage: string;
|
|
77
|
+
appStartNotSupportedErrorMessage?: string;
|
|
78
|
+
abortSignal?: AbortSignal;
|
|
79
|
+
}): Promise<CraftProgramSettledStep>;
|
|
80
|
+
//# sourceMappingURL=craft-program-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"craft-program-runtime.d.ts","sourceRoot":"","sources":["../../../../../libs/core/src/lib/craft-program-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,QAAQ,EAET,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAOL,KAAK,mBAAmB,EACzB,MAAM,2BAA2B,CAAC;AAqCnC,oEAAoE;AACpE,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,SAAS,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAgBxD,8EAA8E;AAC9E,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,kEAAkE;IAClE,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;CACpC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,mBAAmB,KAC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