@craft-ts/core 0.7.0-beta.13 → 0.7.0-beta.16
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/package.json +10 -2
- package/src/index.d.ts +156 -148
- package/src/index.js +153 -142
- package/src/lib/after-recomputation.d.ts +3 -4
- package/src/lib/after-recomputation.js +3 -4
- package/src/lib/app-checked-di.d.ts +3 -4
- package/src/lib/app-checked-di.js +0 -1
- package/src/lib/async-process.d.ts +18 -19
- package/src/lib/async-process.js +24 -25
- package/src/lib/branded-component/branded-component.d.ts +3 -4
- package/src/lib/branded-component/branded-component.js +0 -1
- package/src/lib/browser-boundaries.d.ts +6 -7
- package/src/lib/browser-boundaries.js +5 -6
- package/src/lib/client-di-requirement.d.ts +1 -2
- package/src/lib/client-di-requirement.js +0 -1
- package/src/lib/client-function-middleware.d.ts +8 -92
- package/src/lib/client-function-middleware.js +89 -90
- package/src/lib/component-monitoring.d.ts +1 -2
- package/src/lib/component-monitoring.js +2 -3
- package/src/lib/component-register.d.ts +1 -2
- package/src/lib/component-register.js +1 -2
- package/src/lib/computed-source.d.ts +3 -4
- package/src/lib/computed-source.js +2 -3
- package/src/lib/correlation-id-plugin.d.ts +1 -2
- package/src/lib/correlation-id-plugin.js +6 -7
- package/src/lib/correlation-id.d.ts +4 -5
- package/src/lib/correlation-id.js +3 -4
- package/src/lib/craft-a11y.d.ts +3 -4
- package/src/lib/craft-a11y.js +5 -6
- package/src/lib/craft-activated-route.d.ts +2 -3
- package/src/lib/craft-activated-route.js +2 -3
- package/src/lib/craft-app-config.d.ts +4 -5
- package/src/lib/craft-app-config.js +3 -4
- package/src/lib/craft-codec.d.ts +0 -1
- package/src/lib/craft-codec.js +0 -1
- package/src/lib/craft-computed.d.ts +6 -7
- package/src/lib/craft-computed.js +7 -8
- package/src/lib/craft-control-flow.d.ts +0 -1
- package/src/lib/craft-control-flow.js +2 -3
- package/src/lib/craft-effect.d.ts +2 -3
- package/src/lib/craft-effect.js +7 -8
- package/src/lib/craft-exception.d.ts +0 -1
- package/src/lib/craft-exception.js +0 -1
- package/src/lib/craft-gen.d.ts +1 -2
- package/src/lib/craft-gen.js +2 -3
- package/src/lib/craft-generator-runtime.d.ts +21 -5
- package/src/lib/craft-generator-runtime.js +28 -6
- package/src/lib/craft-guard-runtime.d.ts +4 -5
- package/src/lib/craft-guard-runtime.js +6 -7
- package/src/lib/craft-handshake.d.ts +1 -2
- package/src/lib/craft-handshake.js +0 -1
- package/src/lib/craft-http-client.d.ts +3 -4
- package/src/lib/craft-http-client.js +4 -5
- package/src/lib/craft-http-trace.d.ts +1 -2
- package/src/lib/craft-http-trace.js +5 -2
- package/src/lib/craft-hydration.d.ts +11 -0
- package/src/lib/craft-hydration.js +2 -0
- package/src/lib/craft-lazy.d.ts +3 -4
- package/src/lib/craft-lazy.js +5 -6
- package/src/lib/craft-load-retry.d.ts +2 -3
- package/src/lib/craft-load-retry.js +11 -4
- package/src/lib/craft-machine-history.d.ts +6 -7
- package/src/lib/craft-machine-history.js +6 -7
- package/src/lib/craft-match.d.ts +0 -1
- package/src/lib/craft-match.js +0 -1
- package/src/lib/craft-method.d.ts +3 -4
- package/src/lib/craft-method.js +5 -6
- package/src/lib/craft-node-directive.d.ts +3 -4
- package/src/lib/craft-node-directive.js +2 -3
- package/src/lib/craft-pending.d.ts +3 -4
- package/src/lib/craft-pending.js +2 -3
- package/src/lib/craft-pipe.d.ts +1 -2
- package/src/lib/craft-pipe.js +7 -8
- package/src/lib/craft-platform.d.ts +2 -3
- package/src/lib/craft-platform.js +2 -3
- package/src/lib/craft-primitive-gen.d.ts +7 -8
- package/src/lib/craft-primitive-gen.js +4 -5
- package/src/lib/craft-primitive-registry.d.ts +4 -2
- package/src/lib/craft-primitive-registry.js +5 -3
- package/src/lib/craft-program-operators.d.ts +3 -4
- package/src/lib/craft-program-operators.js +4 -5
- package/src/lib/craft-program-runtime.d.ts +3 -4
- package/src/lib/craft-program-runtime.js +7 -8
- package/src/lib/craft-register-for-runtime.d.ts +2 -3
- package/src/lib/craft-register-for-runtime.js +2 -3
- package/src/lib/craft-register-for.d.ts +3 -4
- package/src/lib/craft-register-for.js +6 -7
- package/src/lib/craft-render-identity.d.ts +0 -1
- package/src/lib/craft-render-identity.js +1 -2
- package/src/lib/craft-replay.d.ts +0 -1
- package/src/lib/craft-replay.js +0 -1
- package/src/lib/craft-request-context.d.ts +15 -0
- package/src/lib/craft-request-context.js +40 -0
- package/src/lib/craft-resolve.d.ts +2 -3
- package/src/lib/craft-resolve.js +0 -1
- package/src/lib/craft-resource.d.ts +2 -3
- package/src/lib/craft-resource.js +14 -6
- package/src/lib/craft-route-exceptions.d.ts +27 -28
- package/src/lib/craft-route-exceptions.js +3 -4
- package/src/lib/craft-route-load-error.d.ts +92 -93
- package/src/lib/craft-route-load-error.js +6 -7
- package/src/lib/craft-route-meta.d.ts +4 -5
- package/src/lib/craft-route-meta.js +0 -1
- package/src/lib/craft-route-target.d.ts +1 -2
- package/src/lib/craft-route-target.js +1 -2
- package/src/lib/craft-router-outlet.d.ts +7 -7
- package/src/lib/craft-router-outlet.js +24 -18
- package/src/lib/craft-router-tokens.d.ts +3 -4
- package/src/lib/craft-router-tokens.js +2 -3
- package/src/lib/craft-router-trace.d.ts +3 -4
- package/src/lib/craft-router-trace.js +9 -3
- package/src/lib/craft-router.d.ts +16 -17
- package/src/lib/craft-router.js +75 -74
- package/src/lib/craft-routes.d.ts +20 -15
- package/src/lib/craft-routes.js +13 -12
- package/src/lib/craft-runtime-mode.d.ts +13 -0
- package/src/lib/craft-runtime-mode.js +21 -0
- package/src/lib/craft-security.d.ts +87 -0
- package/src/lib/craft-security.js +117 -0
- package/src/lib/craft-service.d.ts +12 -13
- package/src/lib/craft-service.js +11 -12
- package/src/lib/craft-service.shared.d.ts +0 -1
- package/src/lib/craft-service.shared.js +0 -1
- package/src/lib/craft-settled.d.ts +23 -16
- package/src/lib/craft-settled.js +9 -10
- package/src/lib/craft-ssr.d.ts +2 -3
- package/src/lib/craft-ssr.js +4 -5
- package/src/lib/craft-state-machine-runtime.d.ts +2 -3
- package/src/lib/craft-state-machine-runtime.js +3 -4
- package/src/lib/craft-state-machine.d.ts +5 -6
- package/src/lib/craft-state-machine.js +9 -10
- package/src/lib/craft-target-runtime.d.ts +1 -2
- package/src/lib/craft-target-runtime.js +2 -3
- package/src/lib/craft-transfer-snapshot.d.ts +10 -5
- package/src/lib/craft-transfer-snapshot.js +139 -14
- package/src/lib/craft-unique.d.ts +0 -1
- package/src/lib/craft-unique.js +0 -1
- package/src/lib/craft-until-settled.d.ts +5 -6
- package/src/lib/craft-until-settled.js +4 -5
- package/src/lib/craft-use.d.ts +0 -1
- package/src/lib/craft-use.js +2 -3
- package/src/lib/craft-view-transition.d.ts +2 -3
- package/src/lib/craft-view-transition.js +2 -3
- package/src/lib/dev-tools.d.ts +7 -0
- package/src/lib/dev-tools.js +244 -0
- package/src/lib/dom-event-hook.d.ts +1 -2
- package/src/lib/dom-event-hook.js +1 -2
- package/src/lib/fn-wrapper.d.ts +2 -3
- package/src/lib/fn-wrapper.js +3 -4
- package/src/lib/form/craft-field.d.ts +2 -3
- package/src/lib/form/craft-field.directive.d.ts +6 -7
- package/src/lib/form/craft-field.directive.js +5 -6
- package/src/lib/form/craft-field.js +1 -2
- package/src/lib/form/field-exception.d.ts +4 -5
- package/src/lib/form/field-exception.js +1 -2
- package/src/lib/form/field-lens.d.ts +0 -1
- package/src/lib/form/field-lens.js +0 -1
- package/src/lib/form/insert-form-attributes.d.ts +6 -7
- package/src/lib/form/insert-form-attributes.js +5 -6
- package/src/lib/form/insert-form-internals.d.ts +11 -12
- package/src/lib/form/insert-form-internals.js +9 -10
- package/src/lib/form/insert-form-schema.d.ts +3 -4
- package/src/lib/form/insert-form-schema.js +4 -5
- package/src/lib/form/insert-form-submit.d.ts +7 -8
- package/src/lib/form/insert-form-submit.js +3 -4
- package/src/lib/form/insert-form.d.ts +6 -7
- package/src/lib/form/insert-form.js +8 -9
- package/src/lib/form/insert-select-form-tree.d.ts +2 -3
- package/src/lib/form/insert-select-form-tree.js +5 -6
- package/src/lib/form/insert-sub-form-field.d.ts +3 -4
- package/src/lib/form/insert-sub-form-field.js +6 -7
- package/src/lib/form/make-form-tree-insert.d.ts +1 -2
- package/src/lib/form/make-form-tree-insert.js +3 -4
- package/src/lib/form/target-form-field.d.ts +0 -1
- package/src/lib/form/target-form-field.js +0 -1
- package/src/lib/form/validator.d.ts +5 -6
- package/src/lib/form/validator.js +3 -4
- package/src/lib/from-event-to-source$.d.ts +2 -3
- package/src/lib/from-event-to-source$.js +3 -4
- package/src/lib/global-persister-handler.service.d.ts +1 -2
- package/src/lib/global-persister-handler.service.js +2 -3
- package/src/lib/host/craft-compat.d.ts +2 -3
- package/src/lib/host/craft-compat.js +2 -3
- package/src/lib/host/craft-dom.d.ts +0 -1
- package/src/lib/host/craft-dom.js +0 -1
- package/src/lib/host/craft-http.d.ts +0 -1
- package/src/lib/host/craft-http.js +0 -1
- package/src/lib/host/craft-injector-host.d.ts +2 -3
- package/src/lib/host/craft-injector-host.js +1 -2
- package/src/lib/host/craft-injector.d.ts +0 -1
- package/src/lib/host/craft-injector.js +0 -1
- package/src/lib/host/craft-linked-signal.d.ts +1 -2
- package/src/lib/host/craft-linked-signal.js +2 -3
- package/src/lib/host/craft-router-runtime.d.ts +0 -1
- package/src/lib/host/craft-router-runtime.js +0 -1
- package/src/lib/host/craft-router-types.d.ts +1 -2
- package/src/lib/host/craft-router-types.js +1 -2
- package/src/lib/host/craft-signal.d.ts +0 -1
- package/src/lib/host/craft-signal.js +1 -2
- package/src/lib/host/craft-test-bed.d.ts +2 -3
- package/src/lib/host/craft-test-bed.js +2 -3
- package/src/lib/host-tag.d.ts +1 -2
- package/src/lib/host-tag.js +1 -2
- package/src/lib/http-server.d.ts +156 -0
- package/src/lib/http-server.js +590 -0
- package/src/lib/insert-entities.d.ts +5 -6
- package/src/lib/insert-entities.js +1 -2
- package/src/lib/insert-noop-typing-anchor.d.ts +1 -2
- package/src/lib/insert-noop-typing-anchor.js +0 -1
- package/src/lib/insert-pagination-placeholder-data.d.ts +5 -6
- package/src/lib/insert-pagination-placeholder-data.js +5 -6
- package/src/lib/insert-react-on-mutation.d.ts +5 -6
- package/src/lib/insert-react-on-mutation.js +2 -3
- package/src/lib/insert-select-resource.d.ts +2 -3
- package/src/lib/insert-select-resource.js +1 -2
- package/src/lib/insert-select.d.ts +5 -6
- package/src/lib/insert-select.js +18 -19
- package/src/lib/insert-storage-persister.d.ts +4 -5
- package/src/lib/insert-storage-persister.js +2 -3
- package/src/lib/insert-typed-pipes.d.ts +3 -4
- package/src/lib/insert-typed-pipes.js +2 -3
- package/src/lib/lambda-adapter.d.ts +52 -0
- package/src/lib/lambda-adapter.js +101 -0
- package/src/lib/linked-source.d.ts +3 -4
- package/src/lib/linked-source.js +2 -3
- package/src/lib/local-storage-persister.d.ts +2 -3
- package/src/lib/local-storage-persister.js +3 -4
- package/src/lib/middleware-schema-shared.d.ts +9 -21
- package/src/lib/middleware-schema-shared.js +6 -1
- package/src/lib/mock-http-request-for-route.d.ts +3 -4
- package/src/lib/mock-http-request-for-route.js +0 -1
- package/src/lib/mutation.d.ts +18 -19
- package/src/lib/mutation.js +23 -24
- package/src/lib/on$.d.ts +6 -7
- package/src/lib/on$.js +4 -5
- package/src/lib/portable-server-function.d.ts +8 -9
- package/src/lib/portable-server-function.js +12 -5
- package/src/lib/preserved-resource.d.ts +2 -3
- package/src/lib/preserved-resource.js +4 -5
- package/src/lib/primitive-method-runtime-context.d.ts +1 -2
- package/src/lib/primitive-method-runtime-context.js +2 -3
- package/src/lib/primitive-resource-runtime-context.d.ts +1 -2
- package/src/lib/primitive-resource-runtime-context.js +2 -3
- package/src/lib/query-params.d.ts +12 -13
- package/src/lib/query-params.js +15 -16
- package/src/lib/query.core.d.ts +15 -14
- package/src/lib/query.core.js +1 -2
- package/src/lib/query.d.ts +19 -20
- package/src/lib/query.js +23 -24
- package/src/lib/reactive-read.d.ts +2 -3
- package/src/lib/reactive-read.js +2 -3
- package/src/lib/render/channels.d.ts +130 -0
- package/src/lib/render/channels.js +0 -0
- package/src/lib/resource-by-id.d.ts +4 -5
- package/src/lib/resource-by-id.js +4 -5
- package/src/lib/resource-exception.d.ts +2 -3
- package/src/lib/resource-exception.js +1 -2
- package/src/lib/route-checked-di.d.ts +4 -5
- package/src/lib/route-checked-di.js +0 -1
- package/src/lib/schema-validation.d.ts +4 -5
- package/src/lib/schema-validation.js +2 -3
- package/src/lib/send-context-to-ai.d.ts +3 -4
- package/src/lib/send-context-to-ai.js +1 -2
- package/src/lib/send-context-to-ai.tokens.d.ts +1 -2
- package/src/lib/send-context-to-ai.tokens.js +0 -1
- package/src/lib/server-function-client.d.ts +18 -7
- package/src/lib/server-function-client.js +31 -9
- package/src/lib/server-function-contract.d.ts +1 -2
- package/src/lib/server-function-contract.js +0 -1
- package/src/lib/server-function-middleware.d.ts +49 -132
- package/src/lib/server-function-middleware.js +83 -103
- package/src/lib/server-function.d.ts +58 -8
- package/src/lib/server-function.js +20 -6
- package/src/lib/server-layer.d.ts +3 -4
- package/src/lib/server-layer.js +1 -2
- package/src/lib/server.d.ts +39 -6
- package/src/lib/server.js +259 -27
- package/src/lib/setup-craft-service-test.d.ts +3 -4
- package/src/lib/setup-craft-service-test.js +6 -7
- package/src/lib/setup-craft-service-testing-by-register.d.ts +4 -5
- package/src/lib/setup-craft-service-testing-by-register.js +4 -5
- package/src/lib/signal-proxy.d.ts +2 -3
- package/src/lib/signal-proxy.js +1 -2
- package/src/lib/signal-source.d.ts +3 -4
- package/src/lib/signal-source.js +7 -8
- package/src/lib/source$.d.ts +3 -4
- package/src/lib/source$.js +7 -8
- package/src/lib/source-from-event.d.ts +2 -3
- package/src/lib/source-from-event.js +2 -3
- package/src/lib/stacked-source.d.ts +1 -2
- package/src/lib/stacked-source.js +1 -2
- package/src/lib/standard-schema.d.ts +0 -1
- package/src/lib/standard-schema.js +0 -1
- package/src/lib/state-method-runtime-context.d.ts +2 -3
- package/src/lib/state-method-runtime-context.js +1 -2
- package/src/lib/state.d.ts +13 -14
- package/src/lib/state.js +17 -18
- package/src/lib/storage-persister.service.d.ts +3 -4
- package/src/lib/storage-persister.service.js +3 -4
- package/src/lib/take-app-snapshot.d.ts +1 -2
- package/src/lib/take-app-snapshot.js +10 -4
- package/src/lib/template-trace.d.ts +1 -2
- package/src/lib/template-trace.js +5 -2
- package/src/lib/temporal-runtime.d.ts +1 -2
- package/src/lib/temporal-runtime.js +1 -2
- package/src/lib/to-source.d.ts +3 -4
- package/src/lib/to-source.js +2 -3
- package/src/lib/util/craft-resource-ref.d.ts +2 -3
- package/src/lib/util/craft-resource-ref.js +0 -1
- package/src/lib/util/craft-resource-status.d.ts +1 -2
- package/src/lib/util/craft-resource-status.js +0 -1
- package/src/lib/util/entities-util.d.ts +0 -1
- package/src/lib/util/entities-util.js +0 -1
- package/src/lib/util/explicit-effect.d.ts +1 -2
- package/src/lib/util/explicit-effect.js +1 -2
- package/src/lib/util/extract-signal-props-and-methods.d.ts +2 -3
- package/src/lib/util/extract-signal-props-and-methods.js +0 -1
- package/src/lib/util/method-trigger-nonce.d.ts +1 -2
- package/src/lib/util/method-trigger-nonce.js +0 -1
- package/src/lib/util/persister.type.d.ts +2 -3
- package/src/lib/util/persister.type.js +0 -1
- package/src/lib/util/persister.util.d.ts +0 -1
- package/src/lib/util/persister.util.js +0 -1
- package/src/lib/util/react-on-mutation-effect.d.ts +5 -6
- package/src/lib/util/react-on-mutation-effect.js +4 -5
- package/src/lib/util/resource-by-id-changes-tracker.util.d.ts +2 -3
- package/src/lib/util/resource-by-id-changes-tracker.util.js +2 -3
- package/src/lib/util/source.type.d.ts +2 -3
- package/src/lib/util/source.type.js +0 -1
- package/src/lib/util/types/access-type-object-property-by-dotted-path.type.d.ts +1 -2
- package/src/lib/util/types/access-type-object-property-by-dotted-path.type.js +0 -1
- package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.d.ts +4 -5
- package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.js +0 -1
- package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.d.ts +3 -4
- package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.js +0 -1
- package/src/lib/util/types/brand.d.ts +0 -1
- package/src/lib/util/types/brand.js +0 -1
- package/src/lib/util/types/object-deep-path-mapper.type.d.ts +1 -2
- package/src/lib/util/types/object-deep-path-mapper.type.js +0 -1
- package/src/lib/util/types/resource-by-id-config.type.d.ts +3 -4
- package/src/lib/util/types/resource-by-id-config.type.js +0 -1
- package/src/lib/util/types/resource-with-params-or-params-fn.type.d.ts +2 -3
- package/src/lib/util/types/resource-with-params-or-params-fn.type.js +0 -1
- package/src/lib/util/types/shared.type.d.ts +6 -7
- package/src/lib/util/types/shared.type.js +0 -1
- package/src/lib/util/types/util.d.ts +2 -3
- package/src/lib/util/types/util.js +3 -3
- package/src/lib/util/types/util.type.d.ts +3 -4
- package/src/lib/util/types/util.type.js +0 -1
- package/src/lib/util/update-state.util.d.ts +0 -1
- package/src/lib/util/update-state.util.js +0 -1
- package/src/lib/util/util.d.ts +2 -3
- package/src/lib/util/util.js +1 -2
- package/src/lib/util/util.type.d.ts +5 -6
- package/src/lib/util/util.type.js +0 -1
- package/src/lib/worker-adapter.d.ts +8 -0
- package/src/lib/worker-adapter.js +8 -0
- package/src/lib/yieldable.d.ts +4 -5
- package/src/lib/yieldable.js +4 -5
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/after-recomputation.d.ts.map +0 -1
- package/src/lib/after-recomputation.js.map +0 -1
- package/src/lib/app-checked-di.d.ts.map +0 -1
- package/src/lib/app-checked-di.js.map +0 -1
- package/src/lib/async-process.d.ts.map +0 -1
- package/src/lib/async-process.js.map +0 -1
- package/src/lib/branded-component/branded-component.d.ts.map +0 -1
- package/src/lib/branded-component/branded-component.js.map +0 -1
- package/src/lib/browser-boundaries.d.ts.map +0 -1
- package/src/lib/browser-boundaries.js.map +0 -1
- package/src/lib/client-di-requirement.d.ts.map +0 -1
- package/src/lib/client-di-requirement.js.map +0 -1
- package/src/lib/client-function-middleware.d.ts.map +0 -1
- package/src/lib/client-function-middleware.js.map +0 -1
- package/src/lib/component-monitoring.d.ts.map +0 -1
- package/src/lib/component-monitoring.js.map +0 -1
- package/src/lib/component-register.d.ts.map +0 -1
- package/src/lib/component-register.js.map +0 -1
- package/src/lib/computed-source.d.ts.map +0 -1
- package/src/lib/computed-source.js.map +0 -1
- package/src/lib/correlation-id-plugin.d.ts.map +0 -1
- package/src/lib/correlation-id-plugin.js.map +0 -1
- package/src/lib/correlation-id.d.ts.map +0 -1
- package/src/lib/correlation-id.js.map +0 -1
- package/src/lib/craft-a11y.d.ts.map +0 -1
- package/src/lib/craft-a11y.js.map +0 -1
- package/src/lib/craft-activated-route.d.ts.map +0 -1
- package/src/lib/craft-activated-route.js.map +0 -1
- package/src/lib/craft-app-config.d.ts.map +0 -1
- package/src/lib/craft-app-config.js.map +0 -1
- package/src/lib/craft-codec.d.ts.map +0 -1
- package/src/lib/craft-codec.js.map +0 -1
- package/src/lib/craft-computed.d.ts.map +0 -1
- package/src/lib/craft-computed.js.map +0 -1
- package/src/lib/craft-control-flow.d.ts.map +0 -1
- package/src/lib/craft-control-flow.js.map +0 -1
- package/src/lib/craft-effect.d.ts.map +0 -1
- package/src/lib/craft-effect.js.map +0 -1
- package/src/lib/craft-exception.d.ts.map +0 -1
- package/src/lib/craft-exception.js.map +0 -1
- package/src/lib/craft-gen.d.ts.map +0 -1
- package/src/lib/craft-gen.js.map +0 -1
- package/src/lib/craft-generator-runtime.d.ts.map +0 -1
- package/src/lib/craft-generator-runtime.js.map +0 -1
- package/src/lib/craft-guard-runtime.d.ts.map +0 -1
- package/src/lib/craft-guard-runtime.js.map +0 -1
- package/src/lib/craft-handshake.d.ts.map +0 -1
- package/src/lib/craft-handshake.js.map +0 -1
- package/src/lib/craft-http-client.d.ts.map +0 -1
- package/src/lib/craft-http-client.js.map +0 -1
- package/src/lib/craft-http-trace.d.ts.map +0 -1
- package/src/lib/craft-http-trace.js.map +0 -1
- package/src/lib/craft-lazy.d.ts.map +0 -1
- package/src/lib/craft-lazy.js.map +0 -1
- package/src/lib/craft-load-retry.d.ts.map +0 -1
- package/src/lib/craft-load-retry.js.map +0 -1
- package/src/lib/craft-machine-history.d.ts.map +0 -1
- package/src/lib/craft-machine-history.js.map +0 -1
- package/src/lib/craft-match.d.ts.map +0 -1
- package/src/lib/craft-match.js.map +0 -1
- package/src/lib/craft-method.d.ts.map +0 -1
- package/src/lib/craft-method.js.map +0 -1
- package/src/lib/craft-node-directive.d.ts.map +0 -1
- package/src/lib/craft-node-directive.js.map +0 -1
- package/src/lib/craft-pending.d.ts.map +0 -1
- package/src/lib/craft-pending.js.map +0 -1
- package/src/lib/craft-pipe.d.ts.map +0 -1
- package/src/lib/craft-pipe.js.map +0 -1
- package/src/lib/craft-platform.d.ts.map +0 -1
- package/src/lib/craft-platform.js.map +0 -1
- package/src/lib/craft-primitive-gen.d.ts.map +0 -1
- package/src/lib/craft-primitive-gen.js.map +0 -1
- package/src/lib/craft-primitive-registry.d.ts.map +0 -1
- package/src/lib/craft-primitive-registry.js.map +0 -1
- package/src/lib/craft-program-operators.d.ts.map +0 -1
- package/src/lib/craft-program-operators.js.map +0 -1
- package/src/lib/craft-program-runtime.d.ts.map +0 -1
- package/src/lib/craft-program-runtime.js.map +0 -1
- package/src/lib/craft-register-for-runtime.d.ts.map +0 -1
- package/src/lib/craft-register-for-runtime.js.map +0 -1
- package/src/lib/craft-register-for.d.ts.map +0 -1
- package/src/lib/craft-register-for.js.map +0 -1
- package/src/lib/craft-render-identity.d.ts.map +0 -1
- package/src/lib/craft-render-identity.js.map +0 -1
- package/src/lib/craft-replay.d.ts.map +0 -1
- package/src/lib/craft-replay.js.map +0 -1
- package/src/lib/craft-resolve.d.ts.map +0 -1
- package/src/lib/craft-resolve.js.map +0 -1
- package/src/lib/craft-resource.d.ts.map +0 -1
- package/src/lib/craft-resource.js.map +0 -1
- package/src/lib/craft-route-exceptions.d.ts.map +0 -1
- package/src/lib/craft-route-exceptions.js.map +0 -1
- package/src/lib/craft-route-load-error.d.ts.map +0 -1
- package/src/lib/craft-route-load-error.js.map +0 -1
- package/src/lib/craft-route-meta.d.ts.map +0 -1
- package/src/lib/craft-route-meta.js.map +0 -1
- package/src/lib/craft-route-target.d.ts.map +0 -1
- package/src/lib/craft-route-target.js.map +0 -1
- package/src/lib/craft-router-outlet.d.ts.map +0 -1
- package/src/lib/craft-router-outlet.js.map +0 -1
- package/src/lib/craft-router-tokens.d.ts.map +0 -1
- package/src/lib/craft-router-tokens.js.map +0 -1
- package/src/lib/craft-router-trace.d.ts.map +0 -1
- package/src/lib/craft-router-trace.js.map +0 -1
- package/src/lib/craft-router.d.ts.map +0 -1
- package/src/lib/craft-router.js.map +0 -1
- package/src/lib/craft-routes.d.ts.map +0 -1
- package/src/lib/craft-routes.js.map +0 -1
- package/src/lib/craft-service.d.ts.map +0 -1
- package/src/lib/craft-service.js.map +0 -1
- package/src/lib/craft-service.shared.d.ts.map +0 -1
- package/src/lib/craft-service.shared.js.map +0 -1
- package/src/lib/craft-settled.d.ts.map +0 -1
- package/src/lib/craft-settled.js.map +0 -1
- package/src/lib/craft-ssr.d.ts.map +0 -1
- package/src/lib/craft-ssr.js.map +0 -1
- package/src/lib/craft-state-machine-runtime.d.ts.map +0 -1
- package/src/lib/craft-state-machine-runtime.js.map +0 -1
- package/src/lib/craft-state-machine.d.ts.map +0 -1
- package/src/lib/craft-state-machine.js.map +0 -1
- package/src/lib/craft-target-runtime.d.ts.map +0 -1
- package/src/lib/craft-target-runtime.js.map +0 -1
- package/src/lib/craft-transfer-snapshot.d.ts.map +0 -1
- package/src/lib/craft-transfer-snapshot.js.map +0 -1
- package/src/lib/craft-unique.d.ts.map +0 -1
- package/src/lib/craft-unique.js.map +0 -1
- package/src/lib/craft-until-settled.d.ts.map +0 -1
- package/src/lib/craft-until-settled.js.map +0 -1
- package/src/lib/craft-use.d.ts.map +0 -1
- package/src/lib/craft-use.js.map +0 -1
- package/src/lib/craft-view-transition.d.ts.map +0 -1
- package/src/lib/craft-view-transition.js.map +0 -1
- package/src/lib/dom-event-hook.d.ts.map +0 -1
- package/src/lib/dom-event-hook.js.map +0 -1
- package/src/lib/fn-wrapper.d.ts.map +0 -1
- package/src/lib/fn-wrapper.js.map +0 -1
- package/src/lib/form/craft-field.d.ts.map +0 -1
- package/src/lib/form/craft-field.directive.d.ts.map +0 -1
- package/src/lib/form/craft-field.directive.js.map +0 -1
- package/src/lib/form/craft-field.js.map +0 -1
- package/src/lib/form/field-exception.d.ts.map +0 -1
- package/src/lib/form/field-exception.js.map +0 -1
- package/src/lib/form/field-lens.d.ts.map +0 -1
- package/src/lib/form/field-lens.js.map +0 -1
- package/src/lib/form/insert-form-attributes.d.ts.map +0 -1
- package/src/lib/form/insert-form-attributes.js.map +0 -1
- package/src/lib/form/insert-form-internals.d.ts.map +0 -1
- package/src/lib/form/insert-form-internals.js.map +0 -1
- package/src/lib/form/insert-form-schema.d.ts.map +0 -1
- package/src/lib/form/insert-form-schema.js.map +0 -1
- package/src/lib/form/insert-form-submit.d.ts.map +0 -1
- package/src/lib/form/insert-form-submit.js.map +0 -1
- package/src/lib/form/insert-form.d.ts.map +0 -1
- package/src/lib/form/insert-form.js.map +0 -1
- package/src/lib/form/insert-select-form-tree.d.ts.map +0 -1
- package/src/lib/form/insert-select-form-tree.js.map +0 -1
- package/src/lib/form/insert-sub-form-field.d.ts.map +0 -1
- package/src/lib/form/insert-sub-form-field.js.map +0 -1
- package/src/lib/form/make-form-tree-insert.d.ts.map +0 -1
- package/src/lib/form/make-form-tree-insert.js.map +0 -1
- package/src/lib/form/target-form-field.d.ts.map +0 -1
- package/src/lib/form/target-form-field.js.map +0 -1
- package/src/lib/form/validator.d.ts.map +0 -1
- package/src/lib/form/validator.js.map +0 -1
- package/src/lib/from-event-to-source$.d.ts.map +0 -1
- package/src/lib/from-event-to-source$.js.map +0 -1
- package/src/lib/global-persister-handler.service.d.ts.map +0 -1
- package/src/lib/global-persister-handler.service.js.map +0 -1
- package/src/lib/host/craft-compat.d.ts.map +0 -1
- package/src/lib/host/craft-compat.js.map +0 -1
- package/src/lib/host/craft-dom.d.ts.map +0 -1
- package/src/lib/host/craft-dom.js.map +0 -1
- package/src/lib/host/craft-http.d.ts.map +0 -1
- package/src/lib/host/craft-http.js.map +0 -1
- package/src/lib/host/craft-injector-host.d.ts.map +0 -1
- package/src/lib/host/craft-injector-host.js.map +0 -1
- package/src/lib/host/craft-injector.d.ts.map +0 -1
- package/src/lib/host/craft-injector.js.map +0 -1
- package/src/lib/host/craft-linked-signal.d.ts.map +0 -1
- package/src/lib/host/craft-linked-signal.js.map +0 -1
- package/src/lib/host/craft-router-runtime.d.ts.map +0 -1
- package/src/lib/host/craft-router-runtime.js.map +0 -1
- package/src/lib/host/craft-router-types.d.ts.map +0 -1
- package/src/lib/host/craft-router-types.js.map +0 -1
- package/src/lib/host/craft-signal.d.ts.map +0 -1
- package/src/lib/host/craft-signal.js.map +0 -1
- package/src/lib/host/craft-test-bed.d.ts.map +0 -1
- package/src/lib/host/craft-test-bed.js.map +0 -1
- package/src/lib/host-tag.d.ts.map +0 -1
- package/src/lib/host-tag.js.map +0 -1
- package/src/lib/insert-entities.d.ts.map +0 -1
- package/src/lib/insert-entities.js.map +0 -1
- package/src/lib/insert-noop-typing-anchor.d.ts.map +0 -1
- package/src/lib/insert-noop-typing-anchor.js.map +0 -1
- package/src/lib/insert-pagination-placeholder-data.d.ts.map +0 -1
- package/src/lib/insert-pagination-placeholder-data.js.map +0 -1
- package/src/lib/insert-react-on-mutation.d.ts.map +0 -1
- package/src/lib/insert-react-on-mutation.js.map +0 -1
- package/src/lib/insert-select-resource.d.ts.map +0 -1
- package/src/lib/insert-select-resource.js.map +0 -1
- package/src/lib/insert-select.d.ts.map +0 -1
- package/src/lib/insert-select.js.map +0 -1
- package/src/lib/insert-storage-persister.d.ts.map +0 -1
- package/src/lib/insert-storage-persister.js.map +0 -1
- package/src/lib/insert-typed-pipes.d.ts.map +0 -1
- package/src/lib/insert-typed-pipes.js.map +0 -1
- package/src/lib/linked-source.d.ts.map +0 -1
- package/src/lib/linked-source.js.map +0 -1
- package/src/lib/local-storage-persister.d.ts.map +0 -1
- package/src/lib/local-storage-persister.js.map +0 -1
- package/src/lib/middleware-schema-shared.d.ts.map +0 -1
- package/src/lib/middleware-schema-shared.js.map +0 -1
- package/src/lib/mock-http-request-for-route.d.ts.map +0 -1
- package/src/lib/mock-http-request-for-route.js.map +0 -1
- package/src/lib/mutation.d.ts.map +0 -1
- package/src/lib/mutation.js.map +0 -1
- package/src/lib/on$.d.ts.map +0 -1
- package/src/lib/on$.js.map +0 -1
- package/src/lib/portable-server-function.d.ts.map +0 -1
- package/src/lib/portable-server-function.js.map +0 -1
- package/src/lib/preserved-resource.d.ts.map +0 -1
- package/src/lib/preserved-resource.js.map +0 -1
- package/src/lib/primitive-method-runtime-context.d.ts.map +0 -1
- package/src/lib/primitive-method-runtime-context.js.map +0 -1
- package/src/lib/primitive-resource-runtime-context.d.ts.map +0 -1
- package/src/lib/primitive-resource-runtime-context.js.map +0 -1
- package/src/lib/query-params.d.ts.map +0 -1
- package/src/lib/query-params.js.map +0 -1
- package/src/lib/query.core.d.ts.map +0 -1
- package/src/lib/query.core.js.map +0 -1
- package/src/lib/query.d.ts.map +0 -1
- package/src/lib/query.js.map +0 -1
- package/src/lib/reactive-read.d.ts.map +0 -1
- package/src/lib/reactive-read.js.map +0 -1
- package/src/lib/resource-by-id.d.ts.map +0 -1
- package/src/lib/resource-by-id.js.map +0 -1
- package/src/lib/resource-exception.d.ts.map +0 -1
- package/src/lib/resource-exception.js.map +0 -1
- package/src/lib/route-checked-di.d.ts.map +0 -1
- package/src/lib/route-checked-di.js.map +0 -1
- package/src/lib/schema-validation.d.ts.map +0 -1
- package/src/lib/schema-validation.js.map +0 -1
- package/src/lib/send-context-to-ai.d.ts.map +0 -1
- package/src/lib/send-context-to-ai.js.map +0 -1
- package/src/lib/send-context-to-ai.tokens.d.ts.map +0 -1
- package/src/lib/send-context-to-ai.tokens.js.map +0 -1
- package/src/lib/server-function-client.d.ts.map +0 -1
- package/src/lib/server-function-client.js.map +0 -1
- package/src/lib/server-function-contract.d.ts.map +0 -1
- package/src/lib/server-function-contract.js.map +0 -1
- package/src/lib/server-function-middleware.d.ts.map +0 -1
- package/src/lib/server-function-middleware.js.map +0 -1
- package/src/lib/server-function.d.ts.map +0 -1
- package/src/lib/server-function.js.map +0 -1
- package/src/lib/server-layer.d.ts.map +0 -1
- package/src/lib/server-layer.js.map +0 -1
- package/src/lib/server.d.ts.map +0 -1
- package/src/lib/server.js.map +0 -1
- package/src/lib/setup-craft-service-test.d.ts.map +0 -1
- package/src/lib/setup-craft-service-test.js.map +0 -1
- package/src/lib/setup-craft-service-testing-by-register.d.ts.map +0 -1
- package/src/lib/setup-craft-service-testing-by-register.js.map +0 -1
- package/src/lib/signal-proxy.d.ts.map +0 -1
- package/src/lib/signal-proxy.js.map +0 -1
- package/src/lib/signal-source.d.ts.map +0 -1
- package/src/lib/signal-source.js.map +0 -1
- package/src/lib/source$.d.ts.map +0 -1
- package/src/lib/source$.js.map +0 -1
- package/src/lib/source-from-event.d.ts.map +0 -1
- package/src/lib/source-from-event.js.map +0 -1
- package/src/lib/stacked-source.d.ts.map +0 -1
- package/src/lib/stacked-source.js.map +0 -1
- package/src/lib/standard-schema.d.ts.map +0 -1
- package/src/lib/standard-schema.js.map +0 -1
- package/src/lib/state-method-runtime-context.d.ts.map +0 -1
- package/src/lib/state-method-runtime-context.js.map +0 -1
- package/src/lib/state.d.ts.map +0 -1
- package/src/lib/state.js.map +0 -1
- package/src/lib/storage-persister.service.d.ts.map +0 -1
- package/src/lib/storage-persister.service.js.map +0 -1
- package/src/lib/take-app-snapshot.d.ts.map +0 -1
- package/src/lib/take-app-snapshot.js.map +0 -1
- package/src/lib/template-trace.d.ts.map +0 -1
- package/src/lib/template-trace.js.map +0 -1
- package/src/lib/temporal-runtime.d.ts.map +0 -1
- package/src/lib/temporal-runtime.js.map +0 -1
- package/src/lib/to-source.d.ts.map +0 -1
- package/src/lib/to-source.js.map +0 -1
- package/src/lib/util/craft-resource-ref.d.ts.map +0 -1
- package/src/lib/util/craft-resource-ref.js.map +0 -1
- package/src/lib/util/craft-resource-status.d.ts.map +0 -1
- package/src/lib/util/craft-resource-status.js.map +0 -1
- package/src/lib/util/entities-util.d.ts.map +0 -1
- package/src/lib/util/entities-util.js.map +0 -1
- package/src/lib/util/explicit-effect.d.ts.map +0 -1
- package/src/lib/util/explicit-effect.js.map +0 -1
- package/src/lib/util/extract-signal-props-and-methods.d.ts.map +0 -1
- package/src/lib/util/extract-signal-props-and-methods.js.map +0 -1
- package/src/lib/util/method-trigger-nonce.d.ts.map +0 -1
- package/src/lib/util/method-trigger-nonce.js.map +0 -1
- package/src/lib/util/persister.type.d.ts.map +0 -1
- package/src/lib/util/persister.type.js.map +0 -1
- package/src/lib/util/persister.util.d.ts.map +0 -1
- package/src/lib/util/persister.util.js.map +0 -1
- package/src/lib/util/react-on-mutation-effect.d.ts.map +0 -1
- package/src/lib/util/react-on-mutation-effect.js.map +0 -1
- package/src/lib/util/resource-by-id-changes-tracker.util.d.ts.map +0 -1
- package/src/lib/util/resource-by-id-changes-tracker.util.js.map +0 -1
- package/src/lib/util/source.type.d.ts.map +0 -1
- package/src/lib/util/source.type.js.map +0 -1
- package/src/lib/util/types/access-type-object-property-by-dotted-path.type.d.ts.map +0 -1
- package/src/lib/util/types/access-type-object-property-by-dotted-path.type.js.map +0 -1
- package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.d.ts.map +0 -1
- package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.js.map +0 -1
- package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.d.ts.map +0 -1
- package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.js.map +0 -1
- package/src/lib/util/types/brand.d.ts.map +0 -1
- package/src/lib/util/types/brand.js.map +0 -1
- package/src/lib/util/types/object-deep-path-mapper.type.d.ts.map +0 -1
- package/src/lib/util/types/object-deep-path-mapper.type.js.map +0 -1
- package/src/lib/util/types/resource-by-id-config.type.d.ts.map +0 -1
- package/src/lib/util/types/resource-by-id-config.type.js.map +0 -1
- package/src/lib/util/types/resource-with-params-or-params-fn.type.d.ts.map +0 -1
- package/src/lib/util/types/resource-with-params-or-params-fn.type.js.map +0 -1
- package/src/lib/util/types/shared.type.d.ts.map +0 -1
- package/src/lib/util/types/shared.type.js.map +0 -1
- package/src/lib/util/types/util.d.ts.map +0 -1
- package/src/lib/util/types/util.js.map +0 -1
- package/src/lib/util/types/util.type.d.ts.map +0 -1
- package/src/lib/util/types/util.type.js.map +0 -1
- package/src/lib/util/update-state.util.d.ts.map +0 -1
- package/src/lib/util/update-state.util.js.map +0 -1
- package/src/lib/util/util.d.ts.map +0 -1
- package/src/lib/util/util.js.map +0 -1
- package/src/lib/util/util.type.d.ts.map +0 -1
- package/src/lib/util/util.type.js.map +0 -1
- package/src/lib/yieldable.d.ts.map +0 -1
- package/src/lib/yieldable.js.map +0 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type CraftProvider } from './host/craft-injector.js';
|
|
2
|
+
export type CraftTransferPolicy = Readonly<{
|
|
3
|
+
/**
|
|
4
|
+
* `deny` ne transfère rien, `allowlist` transfère les adresses déclarées,
|
|
5
|
+
* `legacy` transfère tout ce qui est sérialisable — uniquement pour migrer
|
|
6
|
+
* une application existante, et signalé par `craft security check`.
|
|
7
|
+
*/
|
|
8
|
+
mode: 'allowlist' | 'deny' | 'legacy';
|
|
9
|
+
allow?: readonly string[];
|
|
10
|
+
redact?: (address: string, value: unknown) => unknown;
|
|
11
|
+
maxBytes?: number;
|
|
12
|
+
maxDepth?: number;
|
|
13
|
+
}>;
|
|
14
|
+
export type CraftSecurityPolicy = Readonly<{
|
|
15
|
+
ssr: Readonly<{
|
|
16
|
+
timeoutMs: number;
|
|
17
|
+
maxHtmlBytes: number;
|
|
18
|
+
sourceTimeoutMs: number;
|
|
19
|
+
}>;
|
|
20
|
+
dom: Readonly<{
|
|
21
|
+
allowUnsafeHtml: boolean;
|
|
22
|
+
allowStyleValues: boolean;
|
|
23
|
+
/** Origins a resource URL (src, poster, srcset…) may point to. */
|
|
24
|
+
allowedResourceOrigins: readonly string[];
|
|
25
|
+
/** Schemes accepted for navigation URLs, beyond relative ones. */
|
|
26
|
+
allowedUrlSchemes: readonly string[];
|
|
27
|
+
}>;
|
|
28
|
+
transport: Readonly<{
|
|
29
|
+
maxBodyBytes: number;
|
|
30
|
+
maxOutputBytes: number;
|
|
31
|
+
timeoutMs: number;
|
|
32
|
+
}>;
|
|
33
|
+
transfer: CraftTransferPolicy;
|
|
34
|
+
}>;
|
|
35
|
+
export type CraftSecurityPolicyInput = Readonly<{
|
|
36
|
+
ssr?: Partial<CraftSecurityPolicy['ssr']>;
|
|
37
|
+
dom?: Partial<CraftSecurityPolicy['dom']>;
|
|
38
|
+
transport?: Partial<CraftSecurityPolicy['transport']>;
|
|
39
|
+
transfer?: Partial<CraftTransferPolicy>;
|
|
40
|
+
}>;
|
|
41
|
+
export declare const DEFAULT_CRAFT_SECURITY_POLICY: CraftSecurityPolicy;
|
|
42
|
+
/**
|
|
43
|
+
* Merges an app policy without mutating either the defaults or the input.
|
|
44
|
+
* Missing values intentionally retain the restrictive defaults.
|
|
45
|
+
*/
|
|
46
|
+
export declare function createCraftSecurityPolicy(input?: CraftSecurityPolicyInput): CraftSecurityPolicy;
|
|
47
|
+
export declare function validateCraftSecurityPolicy(policy: CraftSecurityPolicy): void;
|
|
48
|
+
export declare const CRAFT_SECURITY_POLICY: import("..").CraftToken<Readonly<{
|
|
49
|
+
ssr: Readonly<{
|
|
50
|
+
timeoutMs: number;
|
|
51
|
+
maxHtmlBytes: number;
|
|
52
|
+
sourceTimeoutMs: number;
|
|
53
|
+
}>;
|
|
54
|
+
dom: Readonly<{
|
|
55
|
+
allowUnsafeHtml: boolean;
|
|
56
|
+
allowStyleValues: boolean;
|
|
57
|
+
/** Origins a resource URL (src, poster, srcset…) may point to. */
|
|
58
|
+
allowedResourceOrigins: readonly string[];
|
|
59
|
+
/** Schemes accepted for navigation URLs, beyond relative ones. */
|
|
60
|
+
allowedUrlSchemes: readonly string[];
|
|
61
|
+
}>;
|
|
62
|
+
transport: Readonly<{
|
|
63
|
+
maxBodyBytes: number;
|
|
64
|
+
maxOutputBytes: number;
|
|
65
|
+
timeoutMs: number;
|
|
66
|
+
}>;
|
|
67
|
+
transfer: CraftTransferPolicy;
|
|
68
|
+
}>>;
|
|
69
|
+
export declare function provideCraftSecurityPolicy(input: CraftSecurityPolicyInput): CraftProvider<CraftSecurityPolicy>;
|
|
70
|
+
export declare const CraftCspNonce: import("..").CraftToken<string>;
|
|
71
|
+
export declare function assertCraftCspNonce(nonce: string): string;
|
|
72
|
+
export declare function provideCraftCspNonce(nonce: string): CraftProvider<string>;
|
|
73
|
+
export type CraftSecurityException = Readonly<{
|
|
74
|
+
owner: string;
|
|
75
|
+
reason: string;
|
|
76
|
+
risk: string;
|
|
77
|
+
expires: string;
|
|
78
|
+
ticket?: string;
|
|
79
|
+
}>;
|
|
80
|
+
export declare function allowUnsafe(capability: string, exception: CraftSecurityException): CraftSecurityException & {
|
|
81
|
+
readonly capability: string;
|
|
82
|
+
};
|
|
83
|
+
export declare function isCraftSecurityExceptionExpired(exception: CraftSecurityException, now?: Date): boolean;
|
|
84
|
+
export declare class CraftSecurityError extends Error {
|
|
85
|
+
readonly code: string;
|
|
86
|
+
constructor(code: string, message: string);
|
|
87
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { craftToken } from './host/craft-injector.js';
|
|
2
|
+
export const DEFAULT_CRAFT_SECURITY_POLICY = Object.freeze({
|
|
3
|
+
ssr: Object.freeze({
|
|
4
|
+
timeoutMs: 5_000,
|
|
5
|
+
maxHtmlBytes: 2_000_000,
|
|
6
|
+
sourceTimeoutMs: 5_000,
|
|
7
|
+
}),
|
|
8
|
+
dom: Object.freeze({
|
|
9
|
+
allowUnsafeHtml: false,
|
|
10
|
+
allowStyleValues: false,
|
|
11
|
+
allowedResourceOrigins: Object.freeze([]),
|
|
12
|
+
allowedUrlSchemes: Object.freeze([
|
|
13
|
+
'http:',
|
|
14
|
+
'https:',
|
|
15
|
+
'mailto:',
|
|
16
|
+
'tel:',
|
|
17
|
+
]),
|
|
18
|
+
}),
|
|
19
|
+
transport: Object.freeze({
|
|
20
|
+
maxBodyBytes: 1_000_000,
|
|
21
|
+
maxOutputBytes: 1_000_000,
|
|
22
|
+
timeoutMs: 10_000,
|
|
23
|
+
}),
|
|
24
|
+
transfer: Object.freeze({
|
|
25
|
+
mode: 'deny',
|
|
26
|
+
maxBytes: 512_000,
|
|
27
|
+
maxDepth: 20,
|
|
28
|
+
}),
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* Merges an app policy without mutating either the defaults or the input.
|
|
32
|
+
* Missing values intentionally retain the restrictive defaults.
|
|
33
|
+
*/
|
|
34
|
+
export function createCraftSecurityPolicy(input = {}) {
|
|
35
|
+
const policy = {
|
|
36
|
+
ssr: { ...DEFAULT_CRAFT_SECURITY_POLICY.ssr, ...input.ssr },
|
|
37
|
+
dom: { ...DEFAULT_CRAFT_SECURITY_POLICY.dom, ...input.dom },
|
|
38
|
+
transport: {
|
|
39
|
+
...DEFAULT_CRAFT_SECURITY_POLICY.transport,
|
|
40
|
+
...input.transport,
|
|
41
|
+
},
|
|
42
|
+
transfer: { ...DEFAULT_CRAFT_SECURITY_POLICY.transfer, ...input.transfer },
|
|
43
|
+
};
|
|
44
|
+
validateCraftSecurityPolicy(policy);
|
|
45
|
+
return Object.freeze({
|
|
46
|
+
...policy,
|
|
47
|
+
ssr: Object.freeze(policy.ssr),
|
|
48
|
+
dom: Object.freeze(policy.dom),
|
|
49
|
+
transport: Object.freeze(policy.transport),
|
|
50
|
+
transfer: Object.freeze(policy.transfer),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
export function validateCraftSecurityPolicy(policy) {
|
|
54
|
+
if (!['allowlist', 'deny', 'legacy'].includes(policy.transfer.mode)) {
|
|
55
|
+
throw new CraftSecurityError('CRAFT_SECURITY_POLICY_INVALID', 'transfer.mode must be allowlist, deny or legacy.');
|
|
56
|
+
}
|
|
57
|
+
const positive = (value, name) => {
|
|
58
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
59
|
+
throw new CraftSecurityError('CRAFT_SECURITY_POLICY_INVALID', `${name} must be a positive finite number.`);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
positive(policy.ssr.timeoutMs, 'ssr.timeoutMs');
|
|
63
|
+
positive(policy.ssr.maxHtmlBytes, 'ssr.maxHtmlBytes');
|
|
64
|
+
positive(policy.ssr.sourceTimeoutMs, 'ssr.sourceTimeoutMs');
|
|
65
|
+
positive(policy.transport.maxBodyBytes, 'transport.maxBodyBytes');
|
|
66
|
+
positive(policy.transport.maxOutputBytes, 'transport.maxOutputBytes');
|
|
67
|
+
positive(policy.transport.timeoutMs, 'transport.timeoutMs');
|
|
68
|
+
if (policy.transfer.maxBytes !== undefined) {
|
|
69
|
+
positive(policy.transfer.maxBytes, 'transfer.maxBytes');
|
|
70
|
+
}
|
|
71
|
+
if (policy.transfer.maxDepth !== undefined &&
|
|
72
|
+
(!Number.isInteger(policy.transfer.maxDepth) || policy.transfer.maxDepth < 1)) {
|
|
73
|
+
throw new CraftSecurityError('CRAFT_SECURITY_POLICY_INVALID', 'transfer.maxDepth must be a positive integer.');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export const CRAFT_SECURITY_POLICY = craftToken('CraftSecurityPolicy');
|
|
77
|
+
export function provideCraftSecurityPolicy(input) {
|
|
78
|
+
return {
|
|
79
|
+
token: CRAFT_SECURITY_POLICY,
|
|
80
|
+
useValue: createCraftSecurityPolicy(input),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export const CraftCspNonce = craftToken('CraftCspNonce');
|
|
84
|
+
export function assertCraftCspNonce(nonce) {
|
|
85
|
+
if (!/^[A-Za-z0-9+/_=-]+$/.test(nonce)) {
|
|
86
|
+
throw new CraftSecurityError('CRAFT_CSP_NONCE_INVALID', 'A CSP nonce must contain only base64 characters.');
|
|
87
|
+
}
|
|
88
|
+
return nonce;
|
|
89
|
+
}
|
|
90
|
+
export function provideCraftCspNonce(nonce) {
|
|
91
|
+
return { token: CraftCspNonce, useValue: assertCraftCspNonce(nonce) };
|
|
92
|
+
}
|
|
93
|
+
export function allowUnsafe(capability, exception) {
|
|
94
|
+
if (!capability ||
|
|
95
|
+
!exception.owner ||
|
|
96
|
+
!exception.reason ||
|
|
97
|
+
!exception.risk ||
|
|
98
|
+
!/^\d{4}-\d{2}-\d{2}$/.test(exception.expires)) {
|
|
99
|
+
throw new CraftSecurityError('CRAFT_SECURITY_EXCEPTION_INVALID', `Invalid exception for "${capability}".`);
|
|
100
|
+
}
|
|
101
|
+
const expires = new Date(`${exception.expires}T23:59:59.999Z`);
|
|
102
|
+
if (Number.isNaN(expires.valueOf())) {
|
|
103
|
+
throw new CraftSecurityError('CRAFT_SECURITY_EXCEPTION_INVALID', `Invalid expiration date for "${capability}".`);
|
|
104
|
+
}
|
|
105
|
+
return Object.freeze({ capability, ...exception });
|
|
106
|
+
}
|
|
107
|
+
export function isCraftSecurityExceptionExpired(exception, now = new Date()) {
|
|
108
|
+
return now.getTime() > new Date(`${exception.expires}T23:59:59.999Z`).getTime();
|
|
109
|
+
}
|
|
110
|
+
export class CraftSecurityError extends Error {
|
|
111
|
+
code;
|
|
112
|
+
constructor(code, message) {
|
|
113
|
+
super(`${code}: ${message}`);
|
|
114
|
+
this.code = code;
|
|
115
|
+
this.name = 'CraftSecurityError';
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { EnvironmentProviders, InjectionToken, Injector, Provider, Signal, Type } from './host/craft-compat';
|
|
1
|
+
import { EnvironmentProviders, InjectionToken, Injector, Provider, Signal, Type } from './host/craft-compat.js';
|
|
2
2
|
import type { Observable } from 'rxjs';
|
|
3
|
-
import { SERVICE_APP_START_REQUEST_MARKER, SERVICE_DEPENDENCY_ACCESS_MARKER, SERVICE_YIELD_REQUEST_MARKER, type ResolveGeneratorResult } from './craft-generator-runtime';
|
|
4
|
-
import { type YieldableReactiveProperties, type YieldableReactiveValue } from './reactive-read';
|
|
5
|
-
export { SERVICE_APP_START_REQUEST_MARKER, SERVICE_DEPENDENCY_ACCESS_MARKER, SERVICE_YIELD_REQUEST_MARKER, } from './craft-generator-runtime';
|
|
6
|
-
import { CRAFT_SERVICE_PROVIDER_BRAND, type CRAFT_SERVICE_PROVIDER_TYPE_BRAND } from './craft-service.shared';
|
|
7
|
-
import type { CallableShell, ConcreteServiceScope, MergeObjectUnion, ProvidedInputKey, RealCapableScope, RequirementScope, RootExposureKey, Simplify, UnionToTuple } from './craft-service.shared';
|
|
8
|
-
import type { ServiceTrackedDepsRequest } from './craft-primitive-gen';
|
|
9
|
-
import { type Yieldable } from './yieldable';
|
|
10
|
-
import type { BrandReactiveProperties } from './yieldable';
|
|
3
|
+
import { SERVICE_APP_START_REQUEST_MARKER, SERVICE_DEPENDENCY_ACCESS_MARKER, SERVICE_YIELD_REQUEST_MARKER, type ResolveGeneratorResult } from './craft-generator-runtime.js';
|
|
4
|
+
import { type YieldableReactiveProperties, type YieldableReactiveValue } from './reactive-read.js';
|
|
5
|
+
export { SERVICE_APP_START_REQUEST_MARKER, SERVICE_DEPENDENCY_ACCESS_MARKER, SERVICE_YIELD_REQUEST_MARKER, } from './craft-generator-runtime.js';
|
|
6
|
+
import { CRAFT_SERVICE_PROVIDER_BRAND, type CRAFT_SERVICE_PROVIDER_TYPE_BRAND } from './craft-service.shared.js';
|
|
7
|
+
import type { CallableShell, ConcreteServiceScope, MergeObjectUnion, ProvidedInputKey, RealCapableScope, RequirementScope, RootExposureKey, Simplify, UnionToTuple } from './craft-service.shared.js';
|
|
8
|
+
import type { ServiceTrackedDepsRequest } from './craft-primitive-gen.js';
|
|
9
|
+
import { type Yieldable } from './yieldable.js';
|
|
10
|
+
import type { BrandReactiveProperties } from './yieldable.js';
|
|
11
11
|
export declare const SERVICE_HELPER_DEPENDENCIES: unique symbol;
|
|
12
12
|
export declare const SERVICE_YIELD_METADATA: unique symbol;
|
|
13
13
|
export declare const SERVICE_META_DATA_TYPE: unique symbol;
|
|
@@ -557,7 +557,7 @@ export declare function craftRequirement<Contract>(): ServiceRequirement<Contrac
|
|
|
557
557
|
* @example
|
|
558
558
|
* Adapt `Router` as a global dependency
|
|
559
559
|
* ```ts
|
|
560
|
-
* import { Router } from './host/craft-router-types';
|
|
560
|
+
* import { Router } from './host/craft-router-types.js';
|
|
561
561
|
* import { toCraftService } from '@craft-ts/angular';
|
|
562
562
|
*
|
|
563
563
|
* const { Router } = toCraftService({
|
|
@@ -570,7 +570,7 @@ export declare function craftRequirement<Contract>(): ServiceRequirement<Contrac
|
|
|
570
570
|
* @example
|
|
571
571
|
* Adapt an injected token through the callback form
|
|
572
572
|
* ```ts
|
|
573
|
-
* import { inject, InjectionToken } from './host/craft-compat';
|
|
573
|
+
* import { inject, InjectionToken } from './host/craft-compat.js';
|
|
574
574
|
* import { toCraftService } from '@craft-ts/angular';
|
|
575
575
|
*
|
|
576
576
|
* const CURRENT_ROUTE = new InjectionToken<{ path: string }>('CurrentRoute');
|
|
@@ -585,7 +585,7 @@ export declare function craftRequirement<Contract>(): ServiceRequirement<Contrac
|
|
|
585
585
|
* @example
|
|
586
586
|
* Adapt a provider-capable dependency for explicit test coverage
|
|
587
587
|
* ```ts
|
|
588
|
-
* import { Router, provideRouter } from './host/craft-router-types';
|
|
588
|
+
* import { Router, provideRouter } from './host/craft-router-types.js';
|
|
589
589
|
* import { toCraftService } from '@craft-ts/angular';
|
|
590
590
|
*
|
|
591
591
|
* const { provideAppRouter, AppRouterToProvide } = toCraftService({
|
|
@@ -1031,4 +1031,3 @@ export declare function ɵTrackTags(): Generator<ɵTrackTagsYield, readonly Trac
|
|
|
1031
1031
|
export declare function ɵcreateHostTaggedInjector(injector: Injector, hostName: string, extraProviders?: readonly Provider[], options?: {
|
|
1032
1032
|
readonly instanced?: boolean;
|
|
1033
1033
|
}): Injector;
|
|
1034
|
-
//# sourceMappingURL=craft-service.d.ts.map
|
package/src/lib/craft-service.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { assertInInjectionContext, createEnvironmentInjector, DestroyRef, EnvironmentInjector, inject, InjectionToken, Injector, isSignal, runInInjectionContext, untracked, } from './host/craft-compat';
|
|
2
|
-
import { isGenerator, runCraftGenerator, SERVICE_APP_START_REQUEST_MARKER, SERVICE_DEPENDENCY_ACCESS_MARKER, SERVICE_YIELD_REQUEST_MARKER, } from './craft-generator-runtime';
|
|
3
|
-
import { registerResolvedService } from './craft-register-for-runtime';
|
|
4
|
-
import { createYieldableReactiveValue, isYieldableReactiveValue, rawReactiveValue, } from './reactive-read';
|
|
5
|
-
export { SERVICE_APP_START_REQUEST_MARKER, SERVICE_DEPENDENCY_ACCESS_MARKER, SERVICE_YIELD_REQUEST_MARKER, } from './craft-generator-runtime';
|
|
6
|
-
import { CRAFT_SERVICE_PROVIDER_BRAND, SERVICE_PROVIDED_INPUT_KEY, SERVICE_ROOT_EXPOSURE_KEY, } from './craft-service.shared';
|
|
7
|
-
import { COMPONENT_REGISTER, ɵfallbackComponentRegister, } from './component-register';
|
|
8
|
-
import { injectFnWrapper } from './fn-wrapper';
|
|
9
|
-
import { markNamedReactiveProperties, markYieldableMethod, yieldableInvocation, } from './yieldable';
|
|
10
|
-
import { craftToken, ɵregisterCraftTokenHostToken, } from './host/craft-injector';
|
|
11
|
-
import { ɵcraftInjectorFromHost } from './host/craft-injector-host';
|
|
1
|
+
import { assertInInjectionContext, createEnvironmentInjector, DestroyRef, EnvironmentInjector, inject, InjectionToken, Injector, isSignal, runInInjectionContext, untracked, } from './host/craft-compat.js';
|
|
2
|
+
import { isGenerator, runCraftGenerator, SERVICE_APP_START_REQUEST_MARKER, SERVICE_DEPENDENCY_ACCESS_MARKER, SERVICE_YIELD_REQUEST_MARKER, } from './craft-generator-runtime.js';
|
|
3
|
+
import { registerResolvedService } from './craft-register-for-runtime.js';
|
|
4
|
+
import { createYieldableReactiveValue, isYieldableReactiveValue, rawReactiveValue, } from './reactive-read.js';
|
|
5
|
+
export { SERVICE_APP_START_REQUEST_MARKER, SERVICE_DEPENDENCY_ACCESS_MARKER, SERVICE_YIELD_REQUEST_MARKER, } from './craft-generator-runtime.js';
|
|
6
|
+
import { CRAFT_SERVICE_PROVIDER_BRAND, SERVICE_PROVIDED_INPUT_KEY, SERVICE_ROOT_EXPOSURE_KEY, } from './craft-service.shared.js';
|
|
7
|
+
import { COMPONENT_REGISTER, ɵfallbackComponentRegister, } from './component-register.js';
|
|
8
|
+
import { injectFnWrapper } from './fn-wrapper.js';
|
|
9
|
+
import { markNamedReactiveProperties, markYieldableMethod, yieldableInvocation, } from './yieldable.js';
|
|
10
|
+
import { craftToken, ɵregisterCraftTokenHostToken, } from './host/craft-injector.js';
|
|
11
|
+
import { ɵcraftInjectorFromHost } from './host/craft-injector-host.js';
|
|
12
12
|
export const SERVICE_EXPOSURE_TOKEN_MARKER = Symbol('service-exposure-token-marker');
|
|
13
13
|
export const SERVICE_RUNTIME_META = Symbol('service-runtime-meta');
|
|
14
14
|
const SERVICE_RUNTIME_META_GLOBAL = Symbol.for('@craft-ts/core/service-runtime-meta');
|
|
@@ -1069,4 +1069,3 @@ export function ɵcreateHostTaggedInjector(injector, hostName, extraProviders =
|
|
|
1069
1069
|
});
|
|
1070
1070
|
return envInjector;
|
|
1071
1071
|
}
|
|
1072
|
-
//# sourceMappingURL=craft-service.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type Signal } from './host/craft-compat';
|
|
2
|
-
import { type CraftGenExceptionMarker } from './craft-gen';
|
|
3
|
-
import type { AnyCraftException } from './craft-exception';
|
|
4
|
-
import type { CraftResourceStatus } from './util/craft-resource-status';
|
|
5
|
-
import type { ReactiveReadRequest, YieldableReactiveValue } from './reactive-read';
|
|
1
|
+
import { type Signal } from './host/craft-compat.js';
|
|
2
|
+
import { type CraftGenExceptionMarker } from './craft-gen.js';
|
|
3
|
+
import type { AnyCraftException } from './craft-exception.js';
|
|
4
|
+
import type { CraftResourceStatus } from './util/craft-resource-status.js';
|
|
5
|
+
import type { ReactiveReadRequest, YieldableReactiveValue } from './reactive-read.js';
|
|
6
6
|
declare const CRAFT_NOT_SETTLED: unique symbol;
|
|
7
7
|
/**
|
|
8
8
|
* Thrown by a {@link CraftSettledSignal} read while its source has not settled
|
|
@@ -10,7 +10,7 @@ declare const CRAFT_NOT_SETTLED: unique symbol;
|
|
|
10
10
|
*
|
|
11
11
|
* It is the pending twin of {@link CraftGenShortCircuit}: both are native
|
|
12
12
|
* `throw`s raised during a render pass and caught by the nearest boundary — a
|
|
13
|
-
* `
|
|
13
|
+
* `catchNode` for the exception, a `pendingNode` for this one. The dependency
|
|
14
14
|
* on the source's `status` signal is established *before* the throw, so the
|
|
15
15
|
* reading computation re-runs on its own once the source settles.
|
|
16
16
|
*/
|
|
@@ -27,8 +27,8 @@ declare const CRAFT_SETTLED_BRAND: unique symbol;
|
|
|
27
27
|
* async source the reader depends on and **which** exception codes that source
|
|
28
28
|
* may raise, so both requirements can be enforced by the template type-checker:
|
|
29
29
|
*
|
|
30
|
-
* - `Source` must be covered by a `
|
|
31
|
-
* - `Codes` must be covered by a `
|
|
30
|
+
* - `Source` must be covered by a `pendingNode` boundary;
|
|
31
|
+
* - `Codes` must be covered by a `catchNode` boundary.
|
|
32
32
|
*
|
|
33
33
|
* The brand survives passing the signal by reference (`span(users.settledValue)`)
|
|
34
34
|
* and travels through `craftComputed` via the marker yielded by {@link settled}.
|
|
@@ -53,9 +53,17 @@ export type CraftSettledReadMarkers<Source extends string, Exceptions> = CraftPe
|
|
|
53
53
|
/** A settled reader that can be consumed directly with `yield* reader()`. */
|
|
54
54
|
export type CraftSettledYieldableValue<Value, Source extends string = string, Exceptions = never> = YieldableReactiveValue<Value, 'settledState', CraftSettledReadMarkers<Source, Exceptions>> & CraftSettledBrand<Source, Exceptions>;
|
|
55
55
|
/** The async source names a value depends on (`never` when it depends on none). */
|
|
56
|
-
export type CraftSettledSourcesOf<Value> = Value extends
|
|
56
|
+
export type CraftSettledSourcesOf<Value> = Value extends {
|
|
57
|
+
readonly [CRAFT_SETTLED_BRAND]: {
|
|
58
|
+
readonly source: infer Source;
|
|
59
|
+
};
|
|
60
|
+
} ? Source extends string ? string extends Source ? never : Source : never : never;
|
|
57
61
|
/** The `craftException`s a settled read may surface. */
|
|
58
|
-
export type CraftSettledExceptionsOf<Value> = Value extends
|
|
62
|
+
export type CraftSettledExceptionsOf<Value> = Value extends {
|
|
63
|
+
readonly [CRAFT_SETTLED_BRAND]: {
|
|
64
|
+
readonly exceptions: infer Exceptions;
|
|
65
|
+
};
|
|
66
|
+
} ? Exceptions : never;
|
|
59
67
|
/** The exception codes a settled read may surface. */
|
|
60
68
|
export type CraftSettledCodesOf<Value> = Extract<CraftSettledExceptionsOf<Value>, {
|
|
61
69
|
readonly _tag: string;
|
|
@@ -77,7 +85,7 @@ export type ExtractCraftPendingSources<Yielded> = [
|
|
|
77
85
|
] extends [never] ? never : Extract<Yielded, CraftPendingMarker<any>> extends CraftPendingMarker<infer Source> ? Source : never;
|
|
78
86
|
/**
|
|
79
87
|
* What a settled read reports about its source to whoever is listening — today
|
|
80
|
-
* a `
|
|
88
|
+
* a `pendingNode` boundary, which needs a handle on the source's liveness to
|
|
81
89
|
* render a reload indicator.
|
|
82
90
|
*
|
|
83
91
|
* A suspension is announced by a `throw`, but a **reload** is not: the stale
|
|
@@ -110,9 +118,9 @@ export type SettleableResource = {
|
|
|
110
118
|
* Builds the `settledValue` signal of a craft primitive. Reading it:
|
|
111
119
|
*
|
|
112
120
|
* - throws {@link CraftGenShortCircuit} when the source carries a business
|
|
113
|
-
* exception — routed to the nearest `
|
|
121
|
+
* exception — routed to the nearest `catchNode`;
|
|
114
122
|
* - throws {@link CraftNotSettled} while the source has no value to show yet —
|
|
115
|
-
* routed to the nearest `
|
|
123
|
+
* routed to the nearest `pendingNode`;
|
|
116
124
|
* - otherwise returns the resolved value, never `undefined`.
|
|
117
125
|
*
|
|
118
126
|
* A reload that preserves its previous value does **not** suspend: the stale
|
|
@@ -144,9 +152,9 @@ type SettledReaderOf<Ref> = Ref extends {
|
|
|
144
152
|
* generator runtime. The additional yielded markers are type-only and make the
|
|
145
153
|
* enclosing `craftComputed`:
|
|
146
154
|
*
|
|
147
|
-
* - depend on the source's pending state — a `
|
|
155
|
+
* - depend on the source's pending state — a `pendingNode` becomes mandatory in
|
|
148
156
|
* any template rendering it;
|
|
149
|
-
* - carry the source's exceptions — a `
|
|
157
|
+
* - carry the source's exceptions — a `catchNode` becomes mandatory too.
|
|
150
158
|
*/
|
|
151
159
|
export declare function settled<const Ref extends {
|
|
152
160
|
readonly settledValue: YieldableReactiveValue<any, any, any> & CraftSettledBrand<any, any>;
|
|
@@ -168,4 +176,3 @@ export declare function createYieldableSettledValue<Value, Source extends string
|
|
|
168
176
|
readonly path?: string;
|
|
169
177
|
}): CraftSettledYieldableValue<Value, Source, Exceptions>;
|
|
170
178
|
export {};
|
|
171
|
-
//# sourceMappingURL=craft-settled.d.ts.map
|
package/src/lib/craft-settled.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { computed } from './host/craft-compat';
|
|
2
|
-
import { CraftGenShortCircuit, } from './craft-gen';
|
|
3
|
-
import { createYieldableReactiveValue } from './reactive-read';
|
|
1
|
+
import { computed } from './host/craft-compat.js';
|
|
2
|
+
import { CraftGenShortCircuit, } from './craft-gen.js';
|
|
3
|
+
import { createYieldableReactiveValue } from './reactive-read.js';
|
|
4
4
|
const CRAFT_NOT_SETTLED = Symbol('craft-not-settled');
|
|
5
5
|
/**
|
|
6
6
|
* Thrown by a {@link CraftSettledSignal} read while its source has not settled
|
|
@@ -8,7 +8,7 @@ const CRAFT_NOT_SETTLED = Symbol('craft-not-settled');
|
|
|
8
8
|
*
|
|
9
9
|
* It is the pending twin of {@link CraftGenShortCircuit}: both are native
|
|
10
10
|
* `throw`s raised during a render pass and caught by the nearest boundary — a
|
|
11
|
-
* `
|
|
11
|
+
* `catchNode` for the exception, a `pendingNode` for this one. The dependency
|
|
12
12
|
* on the source's `status` signal is established *before* the throw, so the
|
|
13
13
|
* reading computation re-runs on its own once the source settles.
|
|
14
14
|
*/
|
|
@@ -17,7 +17,7 @@ export class CraftNotSettled extends Error {
|
|
|
17
17
|
/** Name of the async source that is not settled yet (`query` name, …). */
|
|
18
18
|
source;
|
|
19
19
|
constructor(source) {
|
|
20
|
-
super(`Craft async source "${source}" is not settled yet. Wrap the reading template in a
|
|
20
|
+
super(`Craft async source "${source}" is not settled yet. Wrap the reading template in a pendingNode(...).`);
|
|
21
21
|
this.name = 'CraftNotSettled';
|
|
22
22
|
this.source = source;
|
|
23
23
|
}
|
|
@@ -45,9 +45,9 @@ export function ɵwithSettledReadObserver(observer, work) {
|
|
|
45
45
|
* Builds the `settledValue` signal of a craft primitive. Reading it:
|
|
46
46
|
*
|
|
47
47
|
* - throws {@link CraftGenShortCircuit} when the source carries a business
|
|
48
|
-
* exception — routed to the nearest `
|
|
48
|
+
* exception — routed to the nearest `catchNode`;
|
|
49
49
|
* - throws {@link CraftNotSettled} while the source has no value to show yet —
|
|
50
|
-
* routed to the nearest `
|
|
50
|
+
* routed to the nearest `pendingNode`;
|
|
51
51
|
* - otherwise returns the resolved value, never `undefined`.
|
|
52
52
|
*
|
|
53
53
|
* A reload that preserves its previous value does **not** suspend: the stale
|
|
@@ -96,9 +96,9 @@ export function craftSettledValue(source, resource) {
|
|
|
96
96
|
* generator runtime. The additional yielded markers are type-only and make the
|
|
97
97
|
* enclosing `craftComputed`:
|
|
98
98
|
*
|
|
99
|
-
* - depend on the source's pending state — a `
|
|
99
|
+
* - depend on the source's pending state — a `pendingNode` becomes mandatory in
|
|
100
100
|
* any template rendering it;
|
|
101
|
-
* - carry the source's exceptions — a `
|
|
101
|
+
* - carry the source's exceptions — a `catchNode` becomes mandatory too.
|
|
102
102
|
*/
|
|
103
103
|
export function* settled(resource) {
|
|
104
104
|
const read = resource.settledValue;
|
|
@@ -127,4 +127,3 @@ export function attachCraftSettledValue(name, ref) {
|
|
|
127
127
|
export function createYieldableSettledValue(source, identity) {
|
|
128
128
|
return createYieldableReactiveValue(source, 'settledState', identity);
|
|
129
129
|
}
|
|
130
|
-
//# sourceMappingURL=craft-settled.js.map
|
package/src/lib/craft-ssr.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type CraftSsrPolicy = Readonly<{
|
|
|
3
3
|
mode: SsrMode;
|
|
4
4
|
timeoutMs?: number;
|
|
5
5
|
}>;
|
|
6
|
-
/** Nearest route-level default, overridden by a local
|
|
6
|
+
/** Nearest route-level default, overridden by a local pendingNode policy. */
|
|
7
7
|
export declare const CRAFT_SSR_POLICY: import("..").CraftToken<Readonly<{
|
|
8
8
|
mode: SsrMode;
|
|
9
9
|
timeoutMs?: number;
|
|
@@ -18,7 +18,7 @@ export declare const CRAFT_SSR_RUNTIME: import("..").CraftToken<Readonly<{
|
|
|
18
18
|
export declare class CraftUnhandledSsrResolutionError extends Error {
|
|
19
19
|
readonly source: string;
|
|
20
20
|
readonly route?: string;
|
|
21
|
-
readonly reason: 'no
|
|
21
|
+
readonly reason: 'no pendingNode or route SSR policy';
|
|
22
22
|
constructor(source: string, route?: string);
|
|
23
23
|
}
|
|
24
24
|
export declare class CraftSsrTimeoutError extends Error {
|
|
@@ -26,4 +26,3 @@ export declare class CraftSsrTimeoutError extends Error {
|
|
|
26
26
|
readonly sources: readonly string[];
|
|
27
27
|
constructor(timeoutMs: number, sources: readonly string[]);
|
|
28
28
|
}
|
|
29
|
-
//# sourceMappingURL=craft-ssr.d.ts.map
|
package/src/lib/craft-ssr.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { craftToken } from './host/craft-injector';
|
|
2
|
-
/** Nearest route-level default, overridden by a local
|
|
1
|
+
import { craftToken } from './host/craft-injector.js';
|
|
2
|
+
/** Nearest route-level default, overridden by a local pendingNode policy. */
|
|
3
3
|
export const CRAFT_SSR_POLICY = craftToken('CraftSsrPolicy');
|
|
4
4
|
export const CRAFT_SSR_RUNTIME = craftToken('CraftSsrRuntime');
|
|
5
5
|
export class CraftUnhandledSsrResolutionError extends Error {
|
|
@@ -7,11 +7,11 @@ export class CraftUnhandledSsrResolutionError extends Error {
|
|
|
7
7
|
route;
|
|
8
8
|
reason;
|
|
9
9
|
constructor(source, route) {
|
|
10
|
-
super(`Craft async source "${source}" suspended during SSR without a
|
|
10
|
+
super(`Craft async source "${source}" suspended during SSR without a pendingNode or route SSR policy${route ? ` (route: ${route})` : ''}.`);
|
|
11
11
|
this.name = 'CraftUnhandledSsrResolutionError';
|
|
12
12
|
this.source = source;
|
|
13
13
|
this.route = route;
|
|
14
|
-
this.reason = 'no
|
|
14
|
+
this.reason = 'no pendingNode or route SSR policy';
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
export class CraftSsrTimeoutError extends Error {
|
|
@@ -24,4 +24,3 @@ export class CraftSsrTimeoutError extends Error {
|
|
|
24
24
|
this.sources = sources;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
//# sourceMappingURL=craft-ssr.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Injector, type Signal } from './host/craft-compat';
|
|
2
|
-
import type { CraftWritableSignal } from './host/craft-signal';
|
|
1
|
+
import { Injector, type Signal } from './host/craft-compat.js';
|
|
2
|
+
import type { CraftWritableSignal } from './host/craft-signal.js';
|
|
3
3
|
/** A guard as the machine stores it: any transition in, truthiness out. */
|
|
4
4
|
export type RuntimeTransitionGuard = (transition: {
|
|
5
5
|
readonly from: string | undefined;
|
|
@@ -85,4 +85,3 @@ export declare function ɵrunTransition(scope: MachineScope, event: unknown, loc
|
|
|
85
85
|
export declare function ɵrestoreMachineStep(runtime: MachineRuntime, step: string): void;
|
|
86
86
|
/** Runs `restore` with the machine's registrations muted. */
|
|
87
87
|
export declare function ɵwithSuspendedMachine<Result>(runtime: MachineRuntime, restore: () => Result): Result;
|
|
88
|
-
//# sourceMappingURL=craft-state-machine-runtime.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DestroyRef, effect, inject, runInInjectionContext, untracked, } from './host/craft-compat';
|
|
2
|
-
import { isGenerator, runCraftGenerator, SERVICE_TRACKED_DEPS_REQUEST_MARKER, } from './craft-generator-runtime';
|
|
3
|
-
import { isYieldableReactiveValue, rawReactiveValue, } from './reactive-read';
|
|
1
|
+
import { DestroyRef, effect, inject, runInInjectionContext, untracked, } from './host/craft-compat.js';
|
|
2
|
+
import { isGenerator, runCraftGenerator, SERVICE_TRACKED_DEPS_REQUEST_MARKER, } from './craft-generator-runtime.js';
|
|
3
|
+
import { isYieldableReactiveValue, rawReactiveValue, } from './reactive-read.js';
|
|
4
4
|
/**
|
|
5
5
|
* Runtime core of `craftStateMachine`, kept in its own module so `on$` and
|
|
6
6
|
* `afterRecomputation` can register machine callbacks without importing the
|
|
@@ -164,4 +164,3 @@ export function ɵwithSuspendedMachine(runtime, restore) {
|
|
|
164
164
|
runtime.suspended = previous;
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
//# sourceMappingURL=craft-state-machine-runtime.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { CompleteServiceDependencyMapFromYielded, SERVICE_HELPER_DEPENDENCIES } from './craft-service';
|
|
2
|
-
import { type NamedCraftPrimitiveGen } from './craft-primitive-gen';
|
|
3
|
-
import { type BrandReactiveProperties, type YieldableInsertionMethods } from './yieldable';
|
|
4
|
-
import { type YieldableReactiveValue } from './reactive-read';
|
|
5
|
-
import type { MergeObject } from './util/types/util.type';
|
|
1
|
+
import type { CompleteServiceDependencyMapFromYielded, SERVICE_HELPER_DEPENDENCIES } from './craft-service.js';
|
|
2
|
+
import { type NamedCraftPrimitiveGen } from './craft-primitive-gen.js';
|
|
3
|
+
import { type BrandReactiveProperties, type YieldableInsertionMethods } from './yieldable.js';
|
|
4
|
+
import { type YieldableReactiveValue } from './reactive-read.js';
|
|
5
|
+
import type { MergeObject } from './util/types/util.type.js';
|
|
6
6
|
declare const TRANSITION_STEP_MARKER: unique symbol;
|
|
7
7
|
declare const TRANSITIONS_SETUP_MARKER: unique symbol;
|
|
8
8
|
declare const TRANSITION_GUARD_MARKER: unique symbol;
|
|
@@ -230,4 +230,3 @@ export declare function craftStateMachine<Name extends string, ContextYielded, C
|
|
|
230
230
|
export declare function craftStateMachine<ContextYielded, Context extends object, StepsRecord extends AnyStepsRecord, SetupYielded, StepContextYielded, StepContexts extends Record<MachineSteps<StepsRecord>, unknown>, InsertionYielded, Insertions>(contextFactory: ContextFactory<ContextYielded, Context>, transitions: CraftTransitionsInput<NoInfer<Context>, StepsRecord, SetupYielded> & CraftMachineInitRequirement<MachineYielded<SetupYielded, StepsRecord>>, currentStepWithContextFactory: CurrentStepWithContextFactory<NoInfer<Context>, StepContextYielded, StepContexts>, insertion: MachineInsertion<NoInfer<Context>, NoInfer<MachineSteps<StepsRecord>>, NoInfer<StepContexts>, InsertionYielded, Insertions>): NamedCraftPrimitiveGen<'stateMachine', CraftStateMachineOutput<Context, MachineSteps<StepsRecord>, StepContexts, Insertions, MachineDependencies<ContextYielded, MachineYielded<SetupYielded, StepsRecord>, StepContextYielded, InsertionYielded>>>;
|
|
231
231
|
export declare function craftStateMachine<ContextYielded, Context extends object, StepsRecord extends AnyStepsRecord, SetupYielded, StepContextYielded, StepContexts extends Record<MachineSteps<StepsRecord>, unknown>>(contextFactory: ContextFactory<ContextYielded, Context>, transitions: CraftTransitionsInput<NoInfer<Context>, StepsRecord, SetupYielded> & CraftMachineInitRequirement<MachineYielded<SetupYielded, StepsRecord>>, currentStepWithContextFactory: CurrentStepWithContextFactory<NoInfer<Context>, StepContextYielded, StepContexts>): NamedCraftPrimitiveGen<'stateMachine', CraftStateMachineOutput<Context, MachineSteps<StepsRecord>, StepContexts, {}, MachineDependencies<ContextYielded, MachineYielded<SetupYielded, StepsRecord>, StepContextYielded, never>>>;
|
|
232
232
|
export {};
|
|
233
|
-
//# sourceMappingURL=craft-state-machine.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { assertInInjectionContext, inject, Injector, isSignal, runInInjectionContext, } from './host/craft-compat';
|
|
2
|
-
import { craftComputed as createCraftComputed, craftSignal, } from './host/craft-signal';
|
|
3
|
-
import { injectFnWrapper } from './fn-wrapper';
|
|
4
|
-
import { ɵcreateHostTaggedInjector, ɵHOST_TAG_LIST } from './craft-service';
|
|
5
|
-
import { createNamedPrimitiveGen, } from './craft-primitive-gen';
|
|
6
|
-
import { isSource } from './util/util';
|
|
7
|
-
import { createYieldableInsertionMethod, isNonYieldableInsertionMethod, isYieldableMethod, } from './yieldable';
|
|
8
|
-
import { createYieldableReactiveValue, isYieldableReactiveValue, nameInsertedReactiveValue, } from './reactive-read';
|
|
9
|
-
import { ɵdriveMachineGenerator, ɵregisterMachineInit, ɵrestoreMachineStep, ɵrunTransition, ɵwithMachineScope, ɵwithSuspendedMachine, ɵrequireMachineScope, } from './craft-state-machine-runtime';
|
|
1
|
+
import { assertInInjectionContext, inject, Injector, isSignal, runInInjectionContext, } from './host/craft-compat.js';
|
|
2
|
+
import { craftComputed as createCraftComputed, craftSignal, } from './host/craft-signal.js';
|
|
3
|
+
import { injectFnWrapper } from './fn-wrapper.js';
|
|
4
|
+
import { ɵcreateHostTaggedInjector, ɵHOST_TAG_LIST } from './craft-service.js';
|
|
5
|
+
import { createNamedPrimitiveGen, } from './craft-primitive-gen.js';
|
|
6
|
+
import { isSource } from './util/util.js';
|
|
7
|
+
import { createYieldableInsertionMethod, isNonYieldableInsertionMethod, isYieldableMethod, } from './yieldable.js';
|
|
8
|
+
import { createYieldableReactiveValue, isYieldableReactiveValue, nameInsertedReactiveValue, } from './reactive-read.js';
|
|
9
|
+
import { ɵdriveMachineGenerator, ɵregisterMachineInit, ɵrestoreMachineStep, ɵrunTransition, ɵwithMachineScope, ɵwithSuspendedMachine, ɵrequireMachineScope, } from './craft-state-machine-runtime.js';
|
|
10
10
|
// ---------------------------------------------------------------------------
|
|
11
11
|
// Markers
|
|
12
12
|
// ---------------------------------------------------------------------------
|
|
@@ -251,4 +251,3 @@ function createStateMachineRef(name, contextFactory, transitionsInput, currentSt
|
|
|
251
251
|
return ref;
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
|
-
//# sourceMappingURL=craft-state-machine.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InjectionToken, type Injector, type Provider } from './host/craft-compat';
|
|
1
|
+
import { InjectionToken, type Injector, type Provider } from './host/craft-compat.js';
|
|
2
2
|
export type CraftTargetKind = 'component' | 'directive';
|
|
3
3
|
export type CraftTargetContext = Readonly<{
|
|
4
4
|
target: unknown;
|
|
@@ -17,4 +17,3 @@ export declare const CRAFT_TARGET_WRAPPER: InjectionToken<readonly CraftTargetWr
|
|
|
17
17
|
/** Adds a wrapper around the lifecycle registration of Craft targets. */
|
|
18
18
|
export declare function provideCraftTargetWrapper(_warning: string, wrapper: CraftTargetWrapper): Provider;
|
|
19
19
|
export declare function ɵrunCraftTargetWrappers(injector: Injector, context: CraftTargetContext, autoCleanup: boolean): CraftTargetRelease;
|
|
20
|
-
//# sourceMappingURL=craft-target-runtime.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DestroyRef, InjectionToken, } from './host/craft-compat';
|
|
2
|
-
import { runCraftGenerator } from './craft-generator-runtime';
|
|
1
|
+
import { DestroyRef, InjectionToken, } from './host/craft-compat.js';
|
|
2
|
+
import { runCraftGenerator } from './craft-generator-runtime.js';
|
|
3
3
|
export const CRAFT_TARGET_WRAPPER = new InjectionToken('CRAFT_TARGET_WRAPPER', {
|
|
4
4
|
providedIn: 'root',
|
|
5
5
|
factory: () => [],
|
|
@@ -39,4 +39,3 @@ export function ɵrunCraftTargetWrappers(injector, context, autoCleanup) {
|
|
|
39
39
|
}
|
|
40
40
|
return release;
|
|
41
41
|
}
|
|
42
|
-
//# sourceMappingURL=craft-target-runtime.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { CraftPrimitiveRegistry } from './craft-primitive-registry';
|
|
1
|
+
import type { CraftPrimitiveRegistry } from './craft-primitive-registry.js';
|
|
2
|
+
import { type CraftTransferPolicy } from './craft-security.js';
|
|
2
3
|
export declare const CRAFT_TRANSFER_SNAPSHOT_VERSION = 1;
|
|
3
4
|
export type CraftTransferQuerySnapshot = Readonly<{
|
|
4
5
|
status: string;
|
|
@@ -10,10 +11,14 @@ export type CraftTransferSnapshot = Readonly<{
|
|
|
10
11
|
values: Readonly<Record<string, unknown>>;
|
|
11
12
|
queries: Readonly<Record<string, CraftTransferQuerySnapshot>>;
|
|
12
13
|
}>;
|
|
14
|
+
export type CraftTransferCaptureOptions = Readonly<{
|
|
15
|
+
readonly policy?: CraftTransferPolicy;
|
|
16
|
+
/** Compatibility switch for callers that have not opted into policy yet. */
|
|
17
|
+
readonly legacy?: boolean;
|
|
18
|
+
}>;
|
|
13
19
|
/** Captures only JSON-compatible state; non-serializable entries fail loudly. */
|
|
14
|
-
export declare function captureCraftTransferSnapshot(registry: CraftPrimitiveRegistry): CraftTransferSnapshot;
|
|
20
|
+
export declare function captureCraftTransferSnapshot(registry: CraftPrimitiveRegistry, options?: CraftTransferCaptureOptions): CraftTransferSnapshot;
|
|
15
21
|
/** Primes registrations that will be created during the first client render. */
|
|
16
|
-
export declare function primeCraftTransferSnapshot(registry: CraftPrimitiveRegistry, snapshot: CraftTransferSnapshot): void;
|
|
22
|
+
export declare function primeCraftTransferSnapshot(registry: CraftPrimitiveRegistry, snapshot: CraftTransferSnapshot, policy?: CraftTransferPolicy): void;
|
|
17
23
|
/** JSON safe for embedding in an HTML script element. */
|
|
18
|
-
export declare function serializeCraftTransferSnapshot(snapshot: CraftTransferSnapshot): string;
|
|
19
|
-
//# sourceMappingURL=craft-transfer-snapshot.d.ts.map
|
|
24
|
+
export declare function serializeCraftTransferSnapshot(snapshot: CraftTransferSnapshot, policy?: CraftTransferPolicy): string;
|