@softistx/alxia-react-router 0.0.0-stage → 0.83.1
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/README.md +2085 -2
- package/dist/api-keys/api-keys.d.ts +93 -0
- package/dist/api-keys/api-keys.d.ts.map +1 -0
- package/dist/api-keys/index.d.ts +9 -0
- package/dist/api-keys/index.d.ts.map +1 -0
- package/dist/api-keys/index.js +66 -0
- package/dist/api-keys/index.js.map +10 -0
- package/dist/assets.d.ts +14 -0
- package/dist/assets.d.ts.map +1 -0
- package/dist/chunks/index-0786n4qe.js +25 -0
- package/dist/chunks/index-0786n4qe.js.map +10 -0
- package/dist/chunks/index-1nw5yeek.js +169 -0
- package/dist/chunks/index-1nw5yeek.js.map +11 -0
- package/dist/chunks/index-59vhfj6n.js +10 -0
- package/dist/chunks/index-59vhfj6n.js.map +10 -0
- package/dist/chunks/index-5gqcpyyg.js +34 -0
- package/dist/chunks/index-5gqcpyyg.js.map +10 -0
- package/dist/chunks/index-6jf7zpxz.js +119 -0
- package/dist/chunks/index-6jf7zpxz.js.map +11 -0
- package/dist/chunks/index-8as4j8m3.js +340 -0
- package/dist/chunks/index-8as4j8m3.js.map +16 -0
- package/dist/chunks/index-9xv2a8et.js +108 -0
- package/dist/chunks/index-9xv2a8et.js.map +11 -0
- package/dist/chunks/index-ajtvyq35.js +16 -0
- package/dist/chunks/index-ajtvyq35.js.map +10 -0
- package/dist/chunks/index-c55hxgr5.js +124 -0
- package/dist/chunks/index-c55hxgr5.js.map +14 -0
- package/dist/chunks/index-d42p3mdp.js +19 -0
- package/dist/chunks/index-d42p3mdp.js.map +10 -0
- package/dist/chunks/index-gac44rs5.js +42 -0
- package/dist/chunks/index-gac44rs5.js.map +11 -0
- package/dist/chunks/index-j4ktpcke.js +62 -0
- package/dist/chunks/index-j4ktpcke.js.map +10 -0
- package/dist/chunks/index-mscfme4r.js +12 -0
- package/dist/chunks/index-mscfme4r.js.map +10 -0
- package/dist/chunks/index-pghmb2dm.js +30 -0
- package/dist/chunks/index-pghmb2dm.js.map +10 -0
- package/dist/chunks/index-rfr02vg4.js +40 -0
- package/dist/chunks/index-rfr02vg4.js.map +10 -0
- package/dist/chunks/index-sfhshxqz.js +31 -0
- package/dist/chunks/index-sfhshxqz.js.map +10 -0
- package/dist/chunks/index-skwypsjz.js +357 -0
- package/dist/chunks/index-skwypsjz.js.map +12 -0
- package/dist/chunks/index-sxh06ged.js +118 -0
- package/dist/chunks/index-sxh06ged.js.map +11 -0
- package/dist/chunks/index-t2ph23wk.js +96 -0
- package/dist/chunks/index-t2ph23wk.js.map +13 -0
- package/dist/chunks/index-thyabr5n.js +19 -0
- package/dist/chunks/index-thyabr5n.js.map +10 -0
- package/dist/chunks/index-tx36swjx.js +134 -0
- package/dist/chunks/index-tx36swjx.js.map +11 -0
- package/dist/chunks/index-v2z5k640.js +54 -0
- package/dist/chunks/index-v2z5k640.js.map +11 -0
- package/dist/chunks/index-vr82typq.js +23 -0
- package/dist/chunks/index-vr82typq.js.map +11 -0
- package/dist/chunks/index-whj6h5eg.js +9 -0
- package/dist/chunks/index-whj6h5eg.js.map +10 -0
- package/dist/chunks/index-wyypkfdv.js +130 -0
- package/dist/chunks/index-wyypkfdv.js.map +13 -0
- package/dist/chunks/index-xd5aqy3g.js +90 -0
- package/dist/chunks/index-xd5aqy3g.js.map +10 -0
- package/dist/chunks/index-zdbqzcjp.js +97 -0
- package/dist/chunks/index-zdbqzcjp.js.map +12 -0
- package/dist/chunks/index-zyg8amjc.js +23 -0
- package/dist/chunks/index-zyg8amjc.js.map +10 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +215 -0
- package/dist/cli/index.js.map +13 -0
- package/dist/cli/main.d.ts +13 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/reveal.d.ts +18 -0
- package/dist/cli/reveal.d.ts.map +1 -0
- package/dist/cli/template.d.ts +8 -0
- package/dist/cli/template.d.ts.map +1 -0
- package/dist/context.d.ts +104 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/document/index.d.ts +11 -0
- package/dist/document/index.d.ts.map +1 -0
- package/dist/document/index.js +19 -0
- package/dist/document/index.js.map +9 -0
- package/dist/document/inline-script.d.ts +27 -0
- package/dist/document/inline-script.d.ts.map +1 -0
- package/dist/document/language-store.d.ts +8 -0
- package/dist/document/language-store.d.ts.map +1 -0
- package/dist/document/nonce.d.ts +34 -0
- package/dist/document/nonce.d.ts.map +1 -0
- package/dist/document/page-language.d.ts +39 -0
- package/dist/document/page-language.d.ts.map +1 -0
- package/dist/document/text-direction.d.ts +10 -0
- package/dist/document/text-direction.d.ts.map +1 -0
- package/dist/entry/abort.d.ts +21 -0
- package/dist/entry/abort.d.ts.map +1 -0
- package/dist/entry/create-entry.d.ts +41 -0
- package/dist/entry/create-entry.d.ts.map +1 -0
- package/dist/entry/index.d.ts +8 -0
- package/dist/entry/index.d.ts.map +1 -0
- package/dist/entry/index.js +154 -0
- package/dist/entry/index.js.map +13 -0
- package/dist/entry/root-data.d.ts +27 -0
- package/dist/entry/root-data.d.ts.map +1 -0
- package/dist/entry/whole-page.d.ts +10 -0
- package/dist/entry/whole-page.d.ts.map +1 -0
- package/dist/errors/api-error.d.ts +117 -0
- package/dist/errors/api-error.d.ts.map +1 -0
- package/dist/errors/api-errors.d.ts +122 -0
- package/dist/errors/api-errors.d.ts.map +1 -0
- package/dist/errors/call-failure.d.ts +45 -0
- package/dist/errors/call-failure.d.ts.map +1 -0
- package/dist/errors/catalogue-check.d.ts +24 -0
- package/dist/errors/catalogue-check.d.ts.map +1 -0
- package/dist/errors/catalogue-read.d.ts +33 -0
- package/dist/errors/catalogue-read.d.ts.map +1 -0
- package/dist/errors/catalogue.d.ts +59 -0
- package/dist/errors/catalogue.d.ts.map +1 -0
- package/dist/errors/code-resolver.d.ts +44 -0
- package/dist/errors/code-resolver.d.ts.map +1 -0
- package/dist/errors/cross-site.d.ts +8 -0
- package/dist/errors/cross-site.d.ts.map +1 -0
- package/dist/errors/describe-refusal.d.ts +6 -0
- package/dist/errors/describe-refusal.d.ts.map +1 -0
- package/dist/errors/describe.d.ts +3 -0
- package/dist/errors/describe.d.ts.map +1 -0
- package/dist/errors/fetcher-result.d.ts +33 -0
- package/dist/errors/fetcher-result.d.ts.map +1 -0
- package/dist/errors/field-placement.d.ts +12 -0
- package/dist/errors/field-placement.d.ts.map +1 -0
- package/dist/errors/form-errors.d.ts +8 -0
- package/dist/errors/form-errors.d.ts.map +1 -0
- package/dist/errors/form-refusal.d.ts +25 -0
- package/dist/errors/form-refusal.d.ts.map +1 -0
- package/dist/errors/index.d.ts +21 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +588 -0
- package/dist/errors/index.js.map +26 -0
- package/dist/errors/json-actions.d.ts +38 -0
- package/dist/errors/json-actions.d.ts.map +1 -0
- package/dist/errors/log.d.ts +8 -0
- package/dist/errors/log.d.ts.map +1 -0
- package/dist/errors/message-values.d.ts +11 -0
- package/dist/errors/message-values.d.ts.map +1 -0
- package/dist/errors/messages.d.ts +63 -0
- package/dist/errors/messages.d.ts.map +1 -0
- package/dist/errors/page-path.d.ts +9 -0
- package/dist/errors/page-path.d.ts.map +1 -0
- package/dist/errors/problem-error.d.ts +50 -0
- package/dist/errors/problem-error.d.ts.map +1 -0
- package/dist/errors/provider.d.ts +20 -0
- package/dist/errors/provider.d.ts.map +1 -0
- package/dist/errors/request-id.d.ts +5 -0
- package/dist/errors/request-id.d.ts.map +1 -0
- package/dist/errors/route-error.d.ts +33 -0
- package/dist/errors/route-error.d.ts.map +1 -0
- package/dist/errors/route-refusal.d.ts +20 -0
- package/dist/errors/route-refusal.d.ts.map +1 -0
- package/dist/errors/same-site.d.ts +49 -0
- package/dist/errors/same-site.d.ts.map +1 -0
- package/dist/errors/section-action.d.ts +46 -0
- package/dist/errors/section-action.d.ts.map +1 -0
- package/dist/errors/standard-schema.d.ts +34 -0
- package/dist/errors/standard-schema.d.ts.map +1 -0
- package/dist/errors/submit-form.d.ts +16 -0
- package/dist/errors/submit-form.d.ts.map +1 -0
- package/dist/errors/upstream-headers.d.ts +18 -0
- package/dist/errors/upstream-headers.d.ts.map +1 -0
- package/dist/errors/use-json-fetcher.d.ts +18 -0
- package/dist/errors/use-json-fetcher.d.ts.map +1 -0
- package/dist/fetcher/auth-refusal.d.ts +29 -0
- package/dist/fetcher/auth-refusal.d.ts.map +1 -0
- package/dist/fetcher/index.d.ts +20 -0
- package/dist/fetcher/index.d.ts.map +1 -0
- package/dist/fetcher/index.js +392 -0
- package/dist/fetcher/index.js.map +21 -0
- package/dist/fetcher/section-form.d.ts +24 -0
- package/dist/fetcher/section-form.d.ts.map +1 -0
- package/dist/fetcher/section-reload.d.ts +17 -0
- package/dist/fetcher/section-reload.d.ts.map +1 -0
- package/dist/fetcher/section-save.d.ts +29 -0
- package/dist/fetcher/section-save.d.ts.map +1 -0
- package/dist/fetcher/use-debounced-fetcher.d.ts +57 -0
- package/dist/fetcher/use-debounced-fetcher.d.ts.map +1 -0
- package/dist/fetcher/use-fetcher-answer.d.ts +16 -0
- package/dist/fetcher/use-fetcher-answer.d.ts.map +1 -0
- package/dist/fetcher/use-fetcher-done.d.ts +15 -0
- package/dist/fetcher/use-fetcher-done.d.ts.map +1 -0
- package/dist/fetcher/use-fetcher-promise.d.ts +48 -0
- package/dist/fetcher/use-fetcher-promise.d.ts.map +1 -0
- package/dist/fetcher/use-form-refusal.d.ts +20 -0
- package/dist/fetcher/use-form-refusal.d.ts.map +1 -0
- package/dist/fetcher/use-revalidate-on-focus.d.ts +20 -0
- package/dist/fetcher/use-revalidate-on-focus.d.ts.map +1 -0
- package/dist/fetcher/use-row-save.d.ts +32 -0
- package/dist/fetcher/use-row-save.d.ts.map +1 -0
- package/dist/fetcher/use-section-save.d.ts +46 -0
- package/dist/fetcher/use-section-save.d.ts.map +1 -0
- package/dist/fetcher/use-visible-interval.d.ts +24 -0
- package/dist/fetcher/use-visible-interval.d.ts.map +1 -0
- package/dist/fetcher/use-visible-revalidation.d.ts +10 -0
- package/dist/fetcher/use-visible-revalidation.d.ts.map +1 -0
- package/dist/health.d.ts +21 -0
- package/dist/health.d.ts.map +1 -0
- package/dist/help/check/check.d.ts +35 -0
- package/dist/help/check/check.d.ts.map +1 -0
- package/dist/help/check/index.d.ts +8 -0
- package/dist/help/check/index.d.ts.map +1 -0
- package/dist/help/check/index.js +17 -0
- package/dist/help/check/index.js.map +9 -0
- package/dist/help/check/routes.d.ts +22 -0
- package/dist/help/check/routes.d.ts.map +1 -0
- package/dist/help/guide.d.ts +33 -0
- package/dist/help/guide.d.ts.map +1 -0
- package/dist/help/index.d.ts +16 -0
- package/dist/help/index.d.ts.map +1 -0
- package/dist/help/index.js +192 -0
- package/dist/help/index.js.map +14 -0
- package/dist/help/load.d.ts +39 -0
- package/dist/help/load.d.ts.map +1 -0
- package/dist/help/panel.d.ts +69 -0
- package/dist/help/panel.d.ts.map +1 -0
- package/dist/help/parse-flow.d.ts +27 -0
- package/dist/help/parse-flow.d.ts.map +1 -0
- package/dist/help/react.d.ts +12 -0
- package/dist/help/react.d.ts.map +1 -0
- package/dist/help/resolve.d.ts +24 -0
- package/dist/help/resolve.d.ts.map +1 -0
- package/dist/help/types.d.ts +50 -0
- package/dist/help/types.d.ts.map +1 -0
- package/dist/help/yaml.d.ts +18 -0
- package/dist/help/yaml.d.ts.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +197 -0
- package/dist/index.js.map +14 -0
- package/dist/link/index.d.ts +7 -0
- package/dist/link/index.d.ts.map +1 -0
- package/dist/link/index.js +16 -0
- package/dist/link/index.js.map +10 -0
- package/dist/link/router-link.d.ts +27 -0
- package/dist/link/router-link.d.ts.map +1 -0
- package/dist/lists/connection-page.d.ts +50 -0
- package/dist/lists/connection-page.d.ts.map +1 -0
- package/dist/lists/index.d.ts +13 -0
- package/dist/lists/index.d.ts.map +1 -0
- package/dist/lists/index.js +205 -0
- package/dist/lists/index.js.map +15 -0
- package/dist/lists/newest-first.d.ts +5 -0
- package/dist/lists/newest-first.d.ts.map +1 -0
- package/dist/lists/nodes-of.d.ts +21 -0
- package/dist/lists/nodes-of.d.ts.map +1 -0
- package/dist/lists/or-failed.d.ts +19 -0
- package/dist/lists/or-failed.d.ts.map +1 -0
- package/dist/lists/use-paged-rows.d.ts +40 -0
- package/dist/lists/use-paged-rows.d.ts.map +1 -0
- package/dist/lists/use-same-route-loading.d.ts +8 -0
- package/dist/lists/use-same-route-loading.d.ts.map +1 -0
- package/dist/lists/use-search-change.d.ts +20 -0
- package/dist/lists/use-search-change.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +8 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +105 -0
- package/dist/mcp/index.js.map +11 -0
- package/dist/mcp/mcp-relay.d.ts +58 -0
- package/dist/mcp/mcp-relay.d.ts.map +1 -0
- package/dist/mcp/relay.d.ts +38 -0
- package/dist/mcp/relay.d.ts.map +1 -0
- package/dist/media/client/error.d.ts +29 -0
- package/dist/media/client/error.d.ts.map +1 -0
- package/dist/media/client/index.d.ts +8 -0
- package/dist/media/client/index.d.ts.map +1 -0
- package/dist/media/client/index.js +133 -0
- package/dist/media/client/index.js.map +11 -0
- package/dist/media/client/upload.d.ts +32 -0
- package/dist/media/client/upload.d.ts.map +1 -0
- package/dist/media/forward.d.ts +14 -0
- package/dist/media/forward.d.ts.map +1 -0
- package/dist/media/headers.d.ts +11 -0
- package/dist/media/headers.d.ts.map +1 -0
- package/dist/media/index.d.ts +9 -0
- package/dist/media/index.d.ts.map +1 -0
- package/dist/media/index.js +396 -0
- package/dist/media/index.js.map +16 -0
- package/dist/media/options.d.ts +114 -0
- package/dist/media/options.d.ts.map +1 -0
- package/dist/media/path.d.ts +12 -0
- package/dist/media/path.d.ts.map +1 -0
- package/dist/media/read.d.ts +11 -0
- package/dist/media/read.d.ts.map +1 -0
- package/dist/media/refusal.d.ts +11 -0
- package/dist/media/refusal.d.ts.map +1 -0
- package/dist/media/respond.d.ts +8 -0
- package/dist/media/respond.d.ts.map +1 -0
- package/dist/media/write.d.ts +13 -0
- package/dist/media/write.d.ts.map +1 -0
- package/dist/navigation/index.d.ts +9 -0
- package/dist/navigation/index.d.ts.map +1 -0
- package/dist/navigation/index.js +48 -0
- package/dist/navigation/index.js.map +11 -0
- package/dist/navigation/use-focus-on-navigate.d.ts +16 -0
- package/dist/navigation/use-focus-on-navigate.d.ts.map +1 -0
- package/dist/navigation/use-route-transition.d.ts +19 -0
- package/dist/navigation/use-route-transition.d.ts.map +1 -0
- package/dist/nonce.d.ts +16 -0
- package/dist/nonce.d.ts.map +1 -0
- package/dist/oauth/answer.d.ts +33 -0
- package/dist/oauth/answer.d.ts.map +1 -0
- package/dist/oauth/binding.d.ts +43 -0
- package/dist/oauth/binding.d.ts.map +1 -0
- package/dist/oauth/consent.d.ts +134 -0
- package/dist/oauth/consent.d.ts.map +1 -0
- package/dist/oauth/grants.d.ts +88 -0
- package/dist/oauth/grants.d.ts.map +1 -0
- package/dist/oauth/index.d.ts +16 -0
- package/dist/oauth/index.d.ts.map +1 -0
- package/dist/oauth/index.js +207 -0
- package/dist/oauth/index.js.map +12 -0
- package/dist/oauth/model.d.ts +13 -0
- package/dist/oauth/model.d.ts.map +1 -0
- package/dist/oauth/react/index.d.ts +7 -0
- package/dist/oauth/react/index.d.ts.map +1 -0
- package/dist/oauth/react/index.js +99 -0
- package/dist/oauth/react/index.js.map +10 -0
- package/dist/oauth/react/use-consent.d.ts +52 -0
- package/dist/oauth/react/use-consent.d.ts.map +1 -0
- package/dist/oidc/dpop.d.ts +80 -0
- package/dist/oidc/dpop.d.ts.map +1 -0
- package/dist/oidc/errors.d.ts +16 -0
- package/dist/oidc/errors.d.ts.map +1 -0
- package/dist/oidc/flow.d.ts +59 -0
- package/dist/oidc/flow.d.ts.map +1 -0
- package/dist/oidc/index.d.ts +11 -0
- package/dist/oidc/index.d.ts.map +1 -0
- package/dist/oidc/index.js +742 -0
- package/dist/oidc/index.js.map +15 -0
- package/dist/oidc/oidc.d.ts +132 -0
- package/dist/oidc/oidc.d.ts.map +1 -0
- package/dist/oidc/revoke.d.ts +28 -0
- package/dist/oidc/revoke.d.ts.map +1 -0
- package/dist/oidc/seal.d.ts +20 -0
- package/dist/oidc/seal.d.ts.map +1 -0
- package/dist/pwa/build/build-worker.d.ts +41 -0
- package/dist/pwa/build/build-worker.d.ts.map +1 -0
- package/dist/pwa/build/index.d.ts +9 -0
- package/dist/pwa/build/index.d.ts.map +1 -0
- package/dist/pwa/build/index.js +9 -0
- package/dist/pwa/build/index.js.map +9 -0
- package/dist/pwa/build/precache.d.ts +17 -0
- package/dist/pwa/build/precache.d.ts.map +1 -0
- package/dist/pwa/index.d.ts +16 -0
- package/dist/pwa/index.d.ts.map +1 -0
- package/dist/pwa/index.js +110 -0
- package/dist/pwa/index.js.map +12 -0
- package/dist/pwa/model/caching.d.ts +46 -0
- package/dist/pwa/model/caching.d.ts.map +1 -0
- package/dist/pwa/model/clear-app-caches.d.ts +9 -0
- package/dist/pwa/model/clear-app-caches.d.ts.map +1 -0
- package/dist/pwa/model/font-precache.d.ts +15 -0
- package/dist/pwa/model/font-precache.d.ts.map +1 -0
- package/dist/pwa/model/manifest.d.ts +80 -0
- package/dist/pwa/model/manifest.d.ts.map +1 -0
- package/dist/pwa/model/precache-list.d.ts +40 -0
- package/dist/pwa/model/precache-list.d.ts.map +1 -0
- package/dist/pwa/model/registration.d.ts +39 -0
- package/dist/pwa/model/registration.d.ts.map +1 -0
- package/dist/pwa/model/start-service-worker.d.ts +24 -0
- package/dist/pwa/model/start-service-worker.d.ts.map +1 -0
- package/dist/pwa/model/storable.d.ts +8 -0
- package/dist/pwa/model/storable.d.ts.map +1 -0
- package/dist/pwa/model/theme-color.d.ts +20 -0
- package/dist/pwa/model/theme-color.d.ts.map +1 -0
- package/dist/pwa/model/update-notice.d.ts +38 -0
- package/dist/pwa/model/update-notice.d.ts.map +1 -0
- package/dist/pwa/model/worker-contract.d.ts +61 -0
- package/dist/pwa/model/worker-contract.d.ts.map +1 -0
- package/dist/pwa/react/index.d.ts +9 -0
- package/dist/pwa/react/index.d.ts.map +1 -0
- package/dist/pwa/react/index.js +75 -0
- package/dist/pwa/react/index.js.map +13 -0
- package/dist/pwa/react/use-online.d.ts +6 -0
- package/dist/pwa/react/use-online.d.ts.map +1 -0
- package/dist/pwa/react/use-service-worker.d.ts +33 -0
- package/dist/pwa/react/use-service-worker.d.ts.map +1 -0
- package/dist/pwa/react/use-update-notice.d.ts +14 -0
- package/dist/pwa/react/use-update-notice.d.ts.map +1 -0
- package/dist/pwa/server/index.d.ts +7 -0
- package/dist/pwa/server/index.d.ts.map +1 -0
- package/dist/pwa/server/index.js +18 -0
- package/dist/pwa/server/index.js.map +10 -0
- package/dist/pwa/server/no-cache.d.ts +22 -0
- package/dist/pwa/server/no-cache.d.ts.map +1 -0
- package/dist/pwa/worker/index.d.ts +9 -0
- package/dist/pwa/worker/index.d.ts.map +1 -0
- package/dist/pwa/worker/index.js +144 -0
- package/dist/pwa/worker/index.js.map +12 -0
- package/dist/pwa/worker/injected.d.ts +15 -0
- package/dist/pwa/worker/injected.d.ts.map +1 -0
- package/dist/pwa/worker/plan.d.ts +65 -0
- package/dist/pwa/worker/plan.d.ts.map +1 -0
- package/dist/pwa/worker/scope.d.ts +18 -0
- package/dist/pwa/worker/scope.d.ts.map +1 -0
- package/dist/pwa/worker/start-worker.d.ts +17 -0
- package/dist/pwa/worker/start-worker.d.ts.map +1 -0
- package/dist/react-router.d.ts +68 -0
- package/dist/react-router.d.ts.map +1 -0
- package/dist/server.d.ts +127 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/session/codes.d.ts +9 -0
- package/dist/session/codes.d.ts.map +1 -0
- package/dist/session/cookies.d.ts +128 -0
- package/dist/session/cookies.d.ts.map +1 -0
- package/dist/session/flow-types.d.ts +235 -0
- package/dist/session/flow-types.d.ts.map +1 -0
- package/dist/session/guard.d.ts +10 -0
- package/dist/session/guard.d.ts.map +1 -0
- package/dist/session/index.d.ts +22 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +1090 -0
- package/dist/session/index.js.map +27 -0
- package/dist/session/land.d.ts +28 -0
- package/dist/session/land.d.ts.map +1 -0
- package/dist/session/link-json.d.ts +22 -0
- package/dist/session/link-json.d.ts.map +1 -0
- package/dist/session/link-land.d.ts +20 -0
- package/dist/session/link-land.d.ts.map +1 -0
- package/dist/session/link-token.d.ts +24 -0
- package/dist/session/link-token.d.ts.map +1 -0
- package/dist/session/link-types.d.ts +142 -0
- package/dist/session/link-types.d.ts.map +1 -0
- package/dist/session/links.d.ts +14 -0
- package/dist/session/links.d.ts.map +1 -0
- package/dist/session/model/index.d.ts +8 -0
- package/dist/session/model/index.d.ts.map +1 -0
- package/dist/session/model/index.js +35 -0
- package/dist/session/model/index.js.map +9 -0
- package/dist/session/model/link-post.d.ts +35 -0
- package/dist/session/model/link-post.d.ts.map +1 -0
- package/dist/session/model/paths.d.ts +24 -0
- package/dist/session/model/paths.d.ts.map +1 -0
- package/dist/session/model/safe-next.d.ts +15 -0
- package/dist/session/model/safe-next.d.ts.map +1 -0
- package/dist/session/model/second-factor.d.ts +16 -0
- package/dist/session/model/second-factor.d.ts.map +1 -0
- package/dist/session/model/site-path.d.ts +10 -0
- package/dist/session/model/site-path.d.ts.map +1 -0
- package/dist/session/model/step-up-answers.d.ts +45 -0
- package/dist/session/model/step-up-answers.d.ts.map +1 -0
- package/dist/session/model/step-up-props.d.ts +22 -0
- package/dist/session/model/step-up-props.d.ts.map +1 -0
- package/dist/session/model/step-up.d.ts +48 -0
- package/dist/session/model/step-up.d.ts.map +1 -0
- package/dist/session/react/index.d.ts +13 -0
- package/dist/session/react/index.d.ts.map +1 -0
- package/dist/session/react/index.js +196 -0
- package/dist/session/react/index.js.map +14 -0
- package/dist/session/react/step-up/answers.d.ts +9 -0
- package/dist/session/react/step-up/answers.d.ts.map +1 -0
- package/dist/session/react/step-up/dialog-props.d.ts +27 -0
- package/dist/session/react/step-up/dialog-props.d.ts.map +1 -0
- package/dist/session/react/step-up/index.d.ts +7 -0
- package/dist/session/react/step-up/index.d.ts.map +1 -0
- package/dist/session/react/step-up/pending-runs.d.ts +21 -0
- package/dist/session/react/step-up/pending-runs.d.ts.map +1 -0
- package/dist/session/react/step-up/phase.d.ts +8 -0
- package/dist/session/react/step-up/phase.d.ts.map +1 -0
- package/dist/session/react/step-up/use-step-up-replay.d.ts +59 -0
- package/dist/session/react/step-up/use-step-up-replay.d.ts.map +1 -0
- package/dist/session/react/step-up/use-step-up-runner.d.ts +70 -0
- package/dist/session/react/step-up/use-step-up-runner.d.ts.map +1 -0
- package/dist/session/react/step-up/use-step-up.d.ts +51 -0
- package/dist/session/react/step-up/use-step-up.d.ts.map +1 -0
- package/dist/session/react/use-code-field.d.ts +37 -0
- package/dist/session/react/use-code-field.d.ts.map +1 -0
- package/dist/session/react/use-link-fragment.d.ts +22 -0
- package/dist/session/react/use-link-fragment.d.ts.map +1 -0
- package/dist/session/react/use-link-param.d.ts +26 -0
- package/dist/session/react/use-link-param.d.ts.map +1 -0
- package/dist/session/react/use-link-post.d.ts +39 -0
- package/dist/session/react/use-link-post.d.ts.map +1 -0
- package/dist/session/react/use-sign-out.d.ts +46 -0
- package/dist/session/react/use-sign-out.d.ts.map +1 -0
- package/dist/session/second-factor.d.ts +22 -0
- package/dist/session/second-factor.d.ts.map +1 -0
- package/dist/session/serialize.d.ts +42 -0
- package/dist/session/serialize.d.ts.map +1 -0
- package/dist/session/sign-in.d.ts +19 -0
- package/dist/session/sign-in.d.ts.map +1 -0
- package/dist/session/signed.d.ts +44 -0
- package/dist/session/signed.d.ts.map +1 -0
- package/dist/session/social-flow.d.ts +22 -0
- package/dist/session/social-flow.d.ts.map +1 -0
- package/dist/session/social-land.d.ts +31 -0
- package/dist/session/social-land.d.ts.map +1 -0
- package/dist/session/social-types.d.ts +136 -0
- package/dist/session/social-types.d.ts.map +1 -0
- package/dist/session/social.d.ts +32 -0
- package/dist/session/social.d.ts.map +1 -0
- package/dist/session/step-up-codes.d.ts +9 -0
- package/dist/session/step-up-codes.d.ts.map +1 -0
- package/dist/session/step-up-signed-out.d.ts +21 -0
- package/dist/session/step-up-signed-out.d.ts.map +1 -0
- package/dist/session/step-up-types.d.ts +127 -0
- package/dist/session/step-up-types.d.ts.map +1 -0
- package/dist/session/step-up.d.ts +17 -0
- package/dist/session/step-up.d.ts.map +1 -0
- package/dist/session/step.d.ts +22 -0
- package/dist/session/step.d.ts.map +1 -0
- package/dist/session/throttle.d.ts +73 -0
- package/dist/session/throttle.d.ts.map +1 -0
- package/dist/session/timed-wait.d.ts +4 -0
- package/dist/session/timed-wait.d.ts.map +1 -0
- package/dist/session/viewer.d.ts +34 -0
- package/dist/session/viewer.d.ts.map +1 -0
- package/dist/subscription/documents.d.ts +3 -0
- package/dist/subscription/documents.d.ts.map +1 -0
- package/dist/subscription/index.d.ts +7 -0
- package/dist/subscription/index.d.ts.map +1 -0
- package/dist/subscription/index.js +359 -0
- package/dist/subscription/index.js.map +14 -0
- package/dist/subscription/proxy.d.ts +54 -0
- package/dist/subscription/proxy.d.ts.map +1 -0
- package/dist/subscription/react/backoff.d.ts +8 -0
- package/dist/subscription/react/backoff.d.ts.map +1 -0
- package/dist/subscription/react/classify.d.ts +15 -0
- package/dist/subscription/react/classify.d.ts.map +1 -0
- package/dist/subscription/react/controller.d.ts +40 -0
- package/dist/subscription/react/controller.d.ts.map +1 -0
- package/dist/subscription/react/fake-timers.d.ts +8 -0
- package/dist/subscription/react/fake-timers.d.ts.map +1 -0
- package/dist/subscription/react/index.d.ts +15 -0
- package/dist/subscription/react/index.d.ts.map +1 -0
- package/dist/subscription/react/index.js +227 -0
- package/dist/subscription/react/index.js.map +17 -0
- package/dist/subscription/react/reconnect.d.ts +9 -0
- package/dist/subscription/react/reconnect.d.ts.map +1 -0
- package/dist/subscription/react/scheduler.d.ts +13 -0
- package/dist/subscription/react/scheduler.d.ts.map +1 -0
- package/dist/subscription/react/timers.d.ts +7 -0
- package/dist/subscription/react/timers.d.ts.map +1 -0
- package/dist/subscription/react/use-live-subscription.d.ts +36 -0
- package/dist/subscription/react/use-live-subscription.d.ts.map +1 -0
- package/dist/subscription/react/versions.d.ts +6 -0
- package/dist/subscription/react/versions.d.ts.map +1 -0
- package/dist/subscription/read.d.ts +17 -0
- package/dist/subscription/read.d.ts.map +1 -0
- package/dist/subscription/refusal.d.ts +11 -0
- package/dist/subscription/refusal.d.ts.map +1 -0
- package/dist/subscription/relay.d.ts +16 -0
- package/dist/subscription/relay.d.ts.map +1 -0
- package/dist/vite/bun.d.ts +21 -0
- package/dist/vite/bun.d.ts.map +1 -0
- package/dist/vite/bundle.d.ts +33 -0
- package/dist/vite/bundle.d.ts.map +1 -0
- package/dist/vite/compress.d.ts +18 -0
- package/dist/vite/compress.d.ts.map +1 -0
- package/dist/vite/config.d.ts +33 -0
- package/dist/vite/config.d.ts.map +1 -0
- package/dist/vite/dev.d.ts +28 -0
- package/dist/vite/dev.d.ts.map +1 -0
- package/dist/vite/entry.d.ts +20 -0
- package/dist/vite/entry.d.ts.map +1 -0
- package/dist/vite/hosts.d.ts +16 -0
- package/dist/vite/hosts.d.ts.map +1 -0
- package/dist/vite/index.d.ts +68 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +635 -0
- package/dist/vite/index.js.map +22 -0
- package/dist/vite/inline.d.ts +18 -0
- package/dist/vite/inline.d.ts.map +1 -0
- package/dist/vite/node.d.ts +16 -0
- package/dist/vite/node.d.ts.map +1 -0
- package/dist/vite/preview.d.ts +8 -0
- package/dist/vite/preview.d.ts.map +1 -0
- package/dist/vite/runtime.d.ts +8 -0
- package/dist/vite/runtime.d.ts.map +1 -0
- package/dist/vite/socket.d.ts +75 -0
- package/dist/vite/socket.d.ts.map +1 -0
- package/dist/vite/worker.d.ts +16 -0
- package/dist/vite/worker.d.ts.map +1 -0
- package/dist/with-alxia.d.ts +36 -0
- package/dist/with-alxia.d.ts.map +1 -0
- package/docs/README.md +42 -0
- package/docs/guide/api-keys.md +216 -0
- package/docs/guide/beside-the-pages.md +201 -0
- package/docs/guide/csp-nonce.md +166 -0
- package/docs/guide/customising-the-server.md +324 -0
- package/docs/guide/deploying.md +102 -0
- package/docs/guide/document.md +334 -0
- package/docs/guide/errors.md +1147 -0
- package/docs/guide/fetcher.md +355 -0
- package/docs/guide/getting-started.md +112 -0
- package/docs/guide/help.md +325 -0
- package/docs/guide/how-it-works.md +274 -0
- package/docs/guide/link.md +32 -0
- package/docs/guide/lists.md +225 -0
- package/docs/guide/mcp.md +173 -0
- package/docs/guide/media.md +273 -0
- package/docs/guide/navigation.md +52 -0
- package/docs/guide/oauth.md +342 -0
- package/docs/guide/oidc.md +262 -0
- package/docs/guide/openapi.md +51 -0
- package/docs/guide/pwa.md +670 -0
- package/docs/guide/session.md +2105 -0
- package/docs/guide/subscriptions.md +211 -0
- package/docs/guide/testing.md +42 -0
- package/docs/guide/typing-the-loaders.md +311 -0
- package/docs/guide.md +82 -0
- package/docs/roadmap.md +474 -0
- package/docs/troubleshooting.md +3837 -0
- package/package.json +301 -5
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare function isThenable(value: unknown): value is PromiseLike<unknown>;
|
|
2
|
+
/** The one pending run: its request (kept as `last` for the replay hook), its settle and its own promise. */
|
|
3
|
+
export declare function pendingRuns<Request, Outcome>(): {
|
|
4
|
+
start(request: Request, resolve: (o: Outcome | "cancelled") => void, reject: (error: unknown) => void): void;
|
|
5
|
+
current: () => Request | undefined;
|
|
6
|
+
/** The pending run's number, to tell it from the one that replaced it. */
|
|
7
|
+
id: () => number;
|
|
8
|
+
last: () => Request | undefined;
|
|
9
|
+
/** Keeps the promise `post` returned for the run `n`, if still pending. */
|
|
10
|
+
sent(n: number, sent: PromiseLike<unknown>): void;
|
|
11
|
+
/** Settles the pending run; false when none was pending. */
|
|
12
|
+
settle(outcome: Outcome | "cancelled"): boolean;
|
|
13
|
+
/** Rejects the pending run with the error of its `post`. */
|
|
14
|
+
reject(error: unknown): void;
|
|
15
|
+
/**
|
|
16
|
+
* Closes the pending run for a new one: it settles with its own
|
|
17
|
+
* promise's outcome (or error) when `post` returned one, else cancelled.
|
|
18
|
+
*/
|
|
19
|
+
replace(): void;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=pending-runs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending-runs.d.ts","sourceRoot":"","sources":["../../../../src/session/react/step-up/pending-runs.ts"],"names":[],"mappings":"AAEA,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAAC,OAAO,CAAC,CAMxE;AAED,6GAA6G;AAC7G,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO;mBAahC,OAAO,WACP,CAAC,CAAC,EAAE,OAAO,GAAG,WAAW,KAAK,IAAI,UACnC,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;;IAMjC,0EAA0E;;;IAG1E,2EAA2E;YACnE,MAAM,QAAQ,WAAW,CAAC,OAAO,CAAC;IAG1C,4DAA4D;oBAC5C,OAAO,GAAG,WAAW;IAMrC,4DAA4D;kBAC9C,OAAO;IAKrB;;;OAGG;;EAkBJ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StepUpState } from '../../model/step-up';
|
|
2
|
+
/** Where a step-up is, as a dialog shows it. */
|
|
3
|
+
export type StepUpDialogPhase = 'asking' | 'failed' | 'code' | 'expired' | 'confirmed';
|
|
4
|
+
/** The phase a reducer state is in: what the dialog shows. */
|
|
5
|
+
export declare function stepUpDialogPhase(state: StepUpState): StepUpDialogPhase;
|
|
6
|
+
/** Whether an answer is a refusal asking for a step-up (`stepUp` set, not ok). */
|
|
7
|
+
export declare function asksStepUp(answer: unknown): boolean;
|
|
8
|
+
//# sourceMappingURL=phase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phase.d.ts","sourceRoot":"","sources":["../../../../src/session/react/step-up/phase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,gDAAgD;AAChD,MAAM,MAAM,iBAAiB,GAC1B,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,SAAS,GACT,WAAW,CAAC;AAEf,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,iBAAiB,CAKvE;AAED,kFAAkF;AAClF,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAInD"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type StepUpOptions } from './use-step-up';
|
|
2
|
+
export interface StepUpReplayOptions<Action> extends Pick<StepUpOptions, 'request' | 'confirm'> {
|
|
3
|
+
/**
|
|
4
|
+
* The settled answer of the sensitive action. A refusal carrying `stepUp`
|
|
5
|
+
* opens the step-up; the first answer after the replay closes it.
|
|
6
|
+
*/
|
|
7
|
+
answer: unknown;
|
|
8
|
+
/** Sends the refused action again, once the session is confirmed. */
|
|
9
|
+
replay(): void;
|
|
10
|
+
/** The action that was refused, for `spendsCode`. */
|
|
11
|
+
action?: Action | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the action carries a one-time code that a step-up by the
|
|
14
|
+
* second factor just spent. Such an action is not replayed: the dialog
|
|
15
|
+
* closes and `confirmedNotice` is true ("confirmed, type a new code").
|
|
16
|
+
* The notice clears when `action` becomes another value (a new action was
|
|
17
|
+
* posted), at once and not at its answer, so pass the action as you post
|
|
18
|
+
* it, a new object for each post.
|
|
19
|
+
*/
|
|
20
|
+
spendsCode?(action: Action): boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The step-up a sensitive action asks for: an answer carrying `stepUp` opens
|
|
24
|
+
* it; once the session is confirmed the same action is sent again by itself
|
|
25
|
+
* (`replay`), except an action that `spendsCode` after a step-up by the
|
|
26
|
+
* second factor, whose code was just spent: the user types the next one
|
|
27
|
+
* (`confirmedNotice`). The dialog stays, saying so, until the replayed
|
|
28
|
+
* action is answered; if that is refused for a step-up again, it asks again.
|
|
29
|
+
* If `replay` posts nothing, no answer ends that wait: call `cancel()`.
|
|
30
|
+
* Generic over the host's `post`s, so each intent keeps its typed fields.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* const { open, dialogProps, cancel, confirmedNotice } = useStepUpReplay({
|
|
34
|
+
* answer: fetcher.data,
|
|
35
|
+
* replay: () => post(lastAction.current),
|
|
36
|
+
* request: { post: () => stepUpPost({ intent: 'request-step-up' }), answer, busy },
|
|
37
|
+
* confirm: { post: (f) => stepUpPost({ intent: 'confirm-step-up', ...f }), answer, busy },
|
|
38
|
+
* });
|
|
39
|
+
*/
|
|
40
|
+
export declare function useStepUpReplay<Action = never>({ answer, replay, action, spendsCode, request, confirm, }: StepUpReplayOptions<Action>): {
|
|
41
|
+
open: boolean;
|
|
42
|
+
/** True after a step-up by the second factor spent the action's own code. */
|
|
43
|
+
confirmedNotice: boolean;
|
|
44
|
+
dialogProps: import("./dialog-props").StepUpDialogProps;
|
|
45
|
+
/** Closes the dialog without sending the action again. */
|
|
46
|
+
cancel: () => void;
|
|
47
|
+
dismissNotice: () => void;
|
|
48
|
+
stepUp: {
|
|
49
|
+
phase: import("./phase").StepUpDialogPhase;
|
|
50
|
+
via: import("../../model").StepUpVia | undefined;
|
|
51
|
+
props: import("../../model").StepUpProps;
|
|
52
|
+
message: string | undefined;
|
|
53
|
+
busy: boolean;
|
|
54
|
+
start(): void;
|
|
55
|
+
submit(code: string): void;
|
|
56
|
+
release(): void;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=use-step-up-replay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-step-up-replay.d.ts","sourceRoot":"","sources":["../../../../src/session/react/step-up/use-step-up-replay.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,aAAa,EAAa,MAAM,eAAe,CAAC;AAE9D,MAAM,WAAW,mBAAmB,CAAC,MAAM,CAC1C,SAAQ,IAAI,CAAC,aAAa,EAAE,SAAS,GAAG,SAAS,CAAC;IAClD;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB,qEAAqE;IACrE,MAAM,IAAI,IAAI,CAAC;IACf,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B;;;;;;;OAOG;IACH,UAAU,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAAC,MAAM,GAAG,KAAK,EAAE,EAC/C,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,EACV,OAAO,EACP,OAAO,GACP,EAAE,mBAAmB,CAAC,MAAM,CAAC;;IAkF5B,6EAA6E;;;IAG7E,0DAA0D;;;;;;;;;;;;;EAK3D"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { StepUpDialogProps } from './dialog-props';
|
|
2
|
+
import { type StepUpReplayOptions } from './use-step-up-replay';
|
|
3
|
+
export interface StepUpRunnerOptions<Request> extends Pick<StepUpReplayOptions<Request>, 'request' | 'confirm' | 'spendsCode'> {
|
|
4
|
+
/**
|
|
5
|
+
* The settled answer of the sensitive action: the fetcher's `data` once it
|
|
6
|
+
* is idle (`fetcher.state === 'idle' ? fetcher.data : undefined`). A new
|
|
7
|
+
* answer settles the pending run, unless it asks for a step-up.
|
|
8
|
+
*/
|
|
9
|
+
answer: unknown;
|
|
10
|
+
/** Sends one request (a JSON submit of your fetcher). Also used for the replay. */
|
|
11
|
+
post(request: Request): void | Promise<unknown>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Runs sensitive actions as promises. `run(request)` posts the request and
|
|
15
|
+
* resolves with the answer that settles it, or with `'cancelled'` when the
|
|
16
|
+
* step-up dialog is cancelled or another `run` replaces it. An answer asking
|
|
17
|
+
* for a step-up opens the dialog and keeps the promise pending; once the
|
|
18
|
+
* session is confirmed the same request is posted again and its answer
|
|
19
|
+
* settles the run. One dialog serves every feature that shares the runner.
|
|
20
|
+
*
|
|
21
|
+
* `post` may return a promise of the outcome (`post: (r) => save(r)`, then
|
|
22
|
+
* `await run(input)`): when it resolves with a value, the run settles with
|
|
23
|
+
* it, a refusal asking for a step-up included (it opens the dialog and the
|
|
24
|
+
* replay's value settles the run). A promise resolving with `undefined` (a
|
|
25
|
+
* fetcher's `submit`) leaves the settling to the `answer` channel. An error
|
|
26
|
+
* thrown by `post`, synchronously or as a rejection (the replay included),
|
|
27
|
+
* rejects `run()` and clears `busy`.
|
|
28
|
+
*
|
|
29
|
+
* A run replaced by another `run` settles with its own action's outcome once
|
|
30
|
+
* its promise arrives (or rejects with its error), so a replaced fetcher
|
|
31
|
+
* `submit` resolves `'cancelled'` once that promise settles; when its `post`
|
|
32
|
+
* returned no promise it resolves `'cancelled'` at once. Its late value never settles the next run.
|
|
33
|
+
*
|
|
34
|
+
* `run` keeps one identity for the life of the component and reads the latest
|
|
35
|
+
* `post`. Not tied to a UI library: `dialogProps` are plain.
|
|
36
|
+
*
|
|
37
|
+
* One runner is backed by one fetcher key (one fetcher): a new submit on a
|
|
38
|
+
* fetcher supersedes the one in flight, so the answer of a replaced run never
|
|
39
|
+
* arrives to settle the run that replaced it. A run pending when the component
|
|
40
|
+
* unmounts resolves as `'cancelled'`. When the step-up spent the action's own
|
|
41
|
+
* code (`spendsCode`), the run resolves as `'cancelled'` and `confirmedNotice`
|
|
42
|
+
* is true: the page shows "confirmed, type a new code".
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* const fetcher = useFetcher<Outcome>({ key: 'item-actions' });
|
|
46
|
+
* const { run, busy, dialogProps } = useStepUpRunner<ItemRequest, Outcome>({
|
|
47
|
+
* answer: fetcher.state === 'idle' ? fetcher.data : undefined,
|
|
48
|
+
* post: (r) => void fetcher.submit(r, { method: 'post', encType: 'application/json' }),
|
|
49
|
+
* request, // the step-up channels, as for useStepUpReplay
|
|
50
|
+
* confirm,
|
|
51
|
+
* });
|
|
52
|
+
* const outcome = await run({ intent: 'remove', id });
|
|
53
|
+
* if (outcome !== 'cancelled' && outcome.ok) { ... }
|
|
54
|
+
* return <StepUpDialog {...dialogProps} />;
|
|
55
|
+
*/
|
|
56
|
+
export declare function useStepUpRunner<Request, Outcome = unknown>({ answer, post, request, confirm, spendsCode, }: StepUpRunnerOptions<Request>): {
|
|
57
|
+
/** Posts the request; resolves with its outcome, or `'cancelled'`. */
|
|
58
|
+
run(request: Request): Promise<Outcome | 'cancelled'>;
|
|
59
|
+
/** A run is pending (posted, or waiting behind the step-up). */
|
|
60
|
+
busy: boolean;
|
|
61
|
+
/** Props of your step-up dialog; its `onCancel` also cancels the pending run. */
|
|
62
|
+
dialogProps: StepUpDialogProps;
|
|
63
|
+
/** Cancels the pending run and closes the dialog. */
|
|
64
|
+
cancel(): void;
|
|
65
|
+
/** A second-factor step-up spent the request's code: the run is cancelled, ask for a new code. */
|
|
66
|
+
confirmedNotice: boolean;
|
|
67
|
+
/** Clears `confirmedNotice` without starting a run. */
|
|
68
|
+
dismissNotice(): void;
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=use-step-up-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-step-up-runner.d.ts","sourceRoot":"","sources":["../../../../src/session/react/step-up/use-step-up-runner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxD,OAAO,EACN,KAAK,mBAAmB,EAExB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,mBAAmB,CAAC,OAAO,CAC3C,SAAQ,IAAI,CACX,mBAAmB,CAAC,OAAO,CAAC,EAC5B,SAAS,GAAG,SAAS,GAAG,YAAY,CACpC;IACD;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB,mFAAmF;IACnF,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAChD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,EAC3D,MAAM,EACN,IAAI,EACJ,OAAO,EACP,OAAO,EACP,UAAU,GACV,EAAE,mBAAmB,CAAC,OAAO,CAAC,GAAG;IACjC,sEAAsE;IACtE,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,GAAG,WAAW,CAAC,CAAC;IACtD,gEAAgE;IAChE,IAAI,EAAE,OAAO,CAAC;IACd,iFAAiF;IACjF,WAAW,EAAE,iBAAiB,CAAC;IAC/B,qDAAqD;IACrD,MAAM,IAAI,IAAI,CAAC;IACf,kGAAkG;IAClG,eAAe,EAAE,OAAO,CAAC;IACzB,uDAAuD;IACvD,aAAa,IAAI,IAAI,CAAC;CACtB,CAwHA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { StepUpVia } from '../../model/second-factor';
|
|
2
|
+
import type { StepUpConfirmAnswer, StepUpRequestAnswer } from '../../model/step-up-answers';
|
|
3
|
+
/**
|
|
4
|
+
* One step-up intent as the host posts it: its own `post` (so the fields stay
|
|
5
|
+
* typed by the host's action), the settled answer it got since it mounted
|
|
6
|
+
* (`undefined` before), and whether it is in flight. `reset` forgets the
|
|
7
|
+
* answer (a fetcher's `reset`).
|
|
8
|
+
*/
|
|
9
|
+
export interface StepUpChannel<Fields, Answer> {
|
|
10
|
+
post(fields: Fields): void;
|
|
11
|
+
readonly answer: Answer | undefined;
|
|
12
|
+
readonly busy: boolean;
|
|
13
|
+
reset?(): void;
|
|
14
|
+
}
|
|
15
|
+
export interface StepUpOptions {
|
|
16
|
+
/** Posts `{ intent: 'request-step-up' }`, to the route that serves `stepUpSteps().route`. */
|
|
17
|
+
request: StepUpChannel<Record<string, never>, StepUpRequestAnswer>;
|
|
18
|
+
/** Posts `{ intent: 'confirm-step-up', challenge, code, via }`. */
|
|
19
|
+
confirm: StepUpChannel<{
|
|
20
|
+
challenge: string;
|
|
21
|
+
code: string;
|
|
22
|
+
via: StepUpVia | undefined;
|
|
23
|
+
}, StepUpConfirmAnswer>;
|
|
24
|
+
/** Runs once the API accepted the code. */
|
|
25
|
+
onConfirmed(): void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The step-up as the page lives it, on `stepUpReducer`: `start` asks for a
|
|
29
|
+
* challenge, `submit` posts the code, and once it is accepted `onConfirmed`
|
|
30
|
+
* runs. The challenge lives in the reducer's state and the channels' answers
|
|
31
|
+
* only; `release` forgets everything, and an answer that lands after it (a
|
|
32
|
+
* request or a code in flight when the host closed) is ignored.
|
|
33
|
+
*/
|
|
34
|
+
export declare function useStepUp({ request, confirm, onConfirmed }: StepUpOptions): {
|
|
35
|
+
phase: import("./phase").StepUpDialogPhase;
|
|
36
|
+
/** How the challenge held (or the last one) is confirmed. */
|
|
37
|
+
via: StepUpVia | undefined;
|
|
38
|
+
/** What a dialog words its texts from (`stepUpProps`). */
|
|
39
|
+
props: import("../../model").StepUpProps;
|
|
40
|
+
/** The last refusal worded by the server: the fallback of the dialog's own words. */
|
|
41
|
+
message: string | undefined;
|
|
42
|
+
/** A request or a code is in flight. */
|
|
43
|
+
busy: boolean;
|
|
44
|
+
/** Asks for a challenge: the first, or "Resend code" / "New code". */
|
|
45
|
+
start(): void;
|
|
46
|
+
/** Posts the code for the challenge held. */
|
|
47
|
+
submit(code: string): void;
|
|
48
|
+
/** Forgets the challenge, the answers and the errors. */
|
|
49
|
+
release(): void;
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=use-step-up.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-step-up.d.ts","sourceRoot":"","sources":["../../../../src/session/react/step-up/use-step-up.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,KAAK,EACX,mBAAmB,EACnB,mBAAmB,EACnB,MAAM,6BAA6B,CAAC;AAIrC;;;;;GAKG;AACH,MAAM,WAAW,aAAa,CAAC,MAAM,EAAE,MAAM;IAC5C,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,IAAI,IAAI,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC7B,6FAA6F;IAC7F,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,mBAAmB,CAAC,CAAC;IACnE,mEAAmE;IACnE,OAAO,EAAE,aAAa,CACrB;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,SAAS,GAAG,SAAS,CAAA;KAAE,EAC/D,mBAAmB,CACnB,CAAC;IACF,2CAA2C;IAC3C,WAAW,IAAI,IAAI,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,aAAa;;IA4BxE,6DAA6D;;IAE7D,0DAA0D;;IAE1D,qFAAqF;;IAErF,wCAAwC;;IAExC,sEAAsE;;IAMtE,6CAA6C;iBAChC,MAAM;IAKnB,yDAAyD;;EAU1D"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
/** The part of a Standard Schema (`~standard`) this hook reads; Zod, Valibot and ArkType satisfy it. */
|
|
3
|
+
export interface CodeSchema {
|
|
4
|
+
readonly '~standard': {
|
|
5
|
+
validate(value: unknown): unknown;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Calls `handler` once for each new `refusal` (a new object each time,
|
|
10
|
+
* `undefined` when there is none). A refusal already there when the
|
|
11
|
+
* component mounted is not new: it is the page's own, seen again.
|
|
12
|
+
* Library-agnostic: pair it with any form library's `reset` and `focus`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useOnRefusal(refusal: object | undefined, handler: () => void): void;
|
|
15
|
+
export interface CodeField {
|
|
16
|
+
/** The code typed so far. */
|
|
17
|
+
readonly code: string;
|
|
18
|
+
readonly setCode: (code: string) => void;
|
|
19
|
+
/** On the input, so a refusal can focus it. */
|
|
20
|
+
readonly ref: RefObject<HTMLInputElement | null>;
|
|
21
|
+
/** The first issue's message of the last `check`, cleared by typing. */
|
|
22
|
+
readonly error: string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Validates the code against the schema: the parsed value, or
|
|
25
|
+
* `undefined` and `error` set. Synchronous schemas only.
|
|
26
|
+
*/
|
|
27
|
+
readonly check: () => unknown;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A one-code field (an authenticator app's code, a recovery code) with no
|
|
31
|
+
* form library: it holds the code, checks it against `schema`, and on each
|
|
32
|
+
* new `refusal` clears the refused code and focuses the input for the next
|
|
33
|
+
* try. With react-hook-form, use `useOnRefusal` and its `setValue` and
|
|
34
|
+
* `setFocus` instead.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useCodeField(schema: CodeSchema, refusal: object | undefined): CodeField;
|
|
37
|
+
//# sourceMappingURL=use-code-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-code-field.d.ts","sourceRoot":"","sources":["../../../src/session/react/use-code-field.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,SAAS,EAKd,MAAM,OAAO,CAAC;AAEf,wGAAwG;AACxG,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,WAAW,EAAE;QACrB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;KAClC,CAAC;CACF;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,EAAE,MAAM,IAAI,GACjB,IAAI,CASN;AAED,MAAM,WAAW,SAAS;IACzB,6BAA6B;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,+CAA+C;IAC/C,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACjD,wEAAwE;IACxE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC3B,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,MAAM,GAAG,SAAS,GACzB,SAAS,CA6BX"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface LinkFragmentOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Remove the fragment from the address bar once read
|
|
4
|
+
* (`history.replaceState`), so a code is not left in the history, a copied
|
|
5
|
+
* address or a screenshot. Default `false`.
|
|
6
|
+
*/
|
|
7
|
+
readonly drop?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The fragment a mail's link carries (`/invitations/accept#<code>`: a
|
|
11
|
+
* fragment never reaches a server, a log or a `Referer`), decoded and without
|
|
12
|
+
* the `#`. The fragment twin of `useLinkParam`.
|
|
13
|
+
*
|
|
14
|
+
* `undefined` until the page has hydrated and read it (a server render and
|
|
15
|
+
* the first client render agree), then the code, or `null` for a link with
|
|
16
|
+
* none (absent or empty). It is read once and kept for the page's life: with
|
|
17
|
+
* `drop: true` the fragment is removed from the address bar and the value
|
|
18
|
+
* survives it, including React Strict Mode's second effect run, which finds
|
|
19
|
+
* the fragment already gone.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useLinkFragment({ drop, }?: LinkFragmentOptions): string | null | undefined;
|
|
22
|
+
//# sourceMappingURL=use-link-fragment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-link-fragment.d.ts","sourceRoot":"","sources":["../../../src/session/react/use-link-fragment.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IACnC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,EAC/B,IAAY,GACZ,GAAE,mBAAwB,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CA4BtD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface LinkParamOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Remove the parameter from the address bar once read
|
|
4
|
+
* (`history.replaceState`), so a token is not left in the history, a
|
|
5
|
+
* bookmark or a shared screen. Default `false`.
|
|
6
|
+
*/
|
|
7
|
+
readonly drop?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Follow the URL instead of reading it once. A parameter that a redirect
|
|
10
|
+
* or a link adds to the SAME mounted route (`?state=linked`) is seen, and
|
|
11
|
+
* each new location is read again. Without `drop` the value is the
|
|
12
|
+
* parameter of the current location. With `drop` the value is kept after
|
|
13
|
+
* the address bar loses the parameter, until a location carries a new
|
|
14
|
+
* one: a navigation that has none does not clear it. Default `false`.
|
|
15
|
+
*/
|
|
16
|
+
readonly live?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The query parameter a mail's link carries (`token`, `code`, `state`),
|
|
20
|
+
* read once: the value of the first render is kept for the page's life, so
|
|
21
|
+
* dropping it from the address bar never loses it. With `live: true` it
|
|
22
|
+
* follows the URL instead (see `LinkParamOptions`). `null` when absent or
|
|
23
|
+
* empty. Safe to render on the server, where nothing is dropped.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useLinkParam(name: string, { drop, live }?: LinkParamOptions): string | null;
|
|
26
|
+
//# sourceMappingURL=use-link-param.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-link-param.d.ts","sourceRoot":"","sources":["../../../src/session/react/use-link-param.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAChC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC3B,IAAI,EAAE,MAAM,EACZ,EAAE,IAAY,EAAE,IAAY,EAAE,GAAE,gBAAqB,GACnD,MAAM,GAAG,IAAI,CAwBf"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type JsonBody } from '../../errors/use-json-fetcher';
|
|
2
|
+
/** What the sign-in and link actions answer a JSON post (`formError`, `retryAfter`, `fieldErrors.email`). */
|
|
3
|
+
export interface LinkAnswer {
|
|
4
|
+
readonly formError?: string;
|
|
5
|
+
readonly retryAfter?: number;
|
|
6
|
+
readonly fieldErrors?: {
|
|
7
|
+
readonly email?: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
/** The refusal a sign-in or link form takes: `{ form, retryAfter, email }`. */
|
|
11
|
+
export interface LinkRefusal {
|
|
12
|
+
readonly form?: string;
|
|
13
|
+
readonly retryAfter?: number;
|
|
14
|
+
readonly email?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The answer as a form's refusal, or `undefined` when it refused nothing
|
|
18
|
+
* (or there is no answer). `formError` becomes `form`, `fieldErrors.email`
|
|
19
|
+
* becomes `email`, `retryAfter` is kept; absent fields are left out.
|
|
20
|
+
*/
|
|
21
|
+
export declare function refusalOf(answer: LinkAnswer | null | undefined): LinkRefusal | undefined;
|
|
22
|
+
/** Where a `useLinkPost` post goes. */
|
|
23
|
+
export interface LinkPostOptions {
|
|
24
|
+
/** Another route's action (a resource route's, such as `/auth/resend`); the page's own when absent. */
|
|
25
|
+
readonly action?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Posts JSON to the page's action, or to another route's with
|
|
29
|
+
* `useLinkPost({ action })` (a component rendered on every page, such as a
|
|
30
|
+
* banner), and resolves the form's refusal (`refusalOf` of the answer), or
|
|
31
|
+
* `undefined` when nothing was refused or a navigation aborted the post. Any
|
|
32
|
+
* other failure rejects. `send(body, { action })` targets one call, like
|
|
33
|
+
* `useJsonFetcher`'s `post(body, to)`. `busy` while the post is in flight.
|
|
34
|
+
*/
|
|
35
|
+
export declare function useLinkPost(options?: LinkPostOptions): {
|
|
36
|
+
send(body: JsonBody, to?: LinkPostOptions): Promise<LinkRefusal | undefined>;
|
|
37
|
+
busy: boolean;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=use-link-post.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-link-post.d.ts","sourceRoot":"","sources":["../../../src/session/react/use-link-post.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,+BAA+B,CAAC;AAM9E,6GAA6G;AAC7G,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACnD;AAED,+EAA+E;AAC/E,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CACxB,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GACnC,WAAW,GAAG,SAAS,CAUzB;AAED,uCAAuC;AACvC,MAAM,WAAW,eAAe;IAC/B,uGAAuG;IACvG,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,eAAoB,GAAG;IAC3D,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;IAC7E,IAAI,EAAE,OAAO,CAAC;CACd,CAeA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** Where `signInFlow`'s sign-out action is mounted unless the app says otherwise. */
|
|
2
|
+
export declare const SIGN_OUT_PATH = "/sign-out";
|
|
3
|
+
export interface SignOutOptions {
|
|
4
|
+
/** The sign-out route (default `/sign-out`). */
|
|
5
|
+
readonly action?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Runs before the post: clear the worker's caches, a local store. A
|
|
8
|
+
* rejection never keeps the user signed in: the sign-out goes on.
|
|
9
|
+
*/
|
|
10
|
+
readonly before?: () => Promise<unknown> | unknown;
|
|
11
|
+
/**
|
|
12
|
+
* Where the user lands after signing in again: a path of this site. It
|
|
13
|
+
* is posted as `{ next }`, and the sign-out action redirects to the
|
|
14
|
+
* sign-in page with `?next=`. A path that leaves the site is not posted.
|
|
15
|
+
*/
|
|
16
|
+
readonly next?: string;
|
|
17
|
+
}
|
|
18
|
+
/** What a call of `signOut` may say. */
|
|
19
|
+
export interface SignOutCall {
|
|
20
|
+
/** Overrides the hook's `next` for this call. */
|
|
21
|
+
readonly next?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The JSON body to post: `{ next }` for a path of the site, `{}` otherwise.
|
|
25
|
+
* This page imports nothing of the server's side, so it only keeps the
|
|
26
|
+
* obvious shape (`/path`, not `//host` or `/\host`); `signIn.signOut` runs
|
|
27
|
+
* `safeNext` on what arrives, and it is the guard that counts.
|
|
28
|
+
*/
|
|
29
|
+
export declare function signOutBody(next: string | undefined): {
|
|
30
|
+
next?: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Runs `before`, then `submit`. A `before` that throws or rejects is
|
|
34
|
+
* ignored, so a failed cleanup cannot keep a session alive.
|
|
35
|
+
*/
|
|
36
|
+
export declare function signOutAfter(before: (() => Promise<unknown> | unknown) | undefined, submit: () => Promise<void> | void): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* The one way a page signs out, wherever the control is: posts `{}` (or `{ next }`) as JSON
|
|
39
|
+
* to the sign-out route (same-origin and JSON only, as `signInFlow`'s action
|
|
40
|
+
* requires). `busy` from the call until the navigation it starts has ended.
|
|
41
|
+
*/
|
|
42
|
+
export declare function useSignOut(options?: SignOutOptions): {
|
|
43
|
+
signOut: (call?: SignOutCall) => void;
|
|
44
|
+
busy: boolean;
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=use-sign-out.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sign-out.d.ts","sourceRoot":"","sources":["../../../src/session/react/use-sign-out.ts"],"names":[],"mappings":"AAGA,qFAAqF;AACrF,eAAO,MAAM,aAAa,cAAc,CAAC;AAEzC,MAAM,WAAW,cAAc;IAC9B,gDAAgD;IAChD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACnD;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wCAAwC;AACxC,MAAM,WAAW,WAAW;IAC3B,iDAAiD;IACjD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAIvE;AAED;;;GAGG;AACH,wBAAsB,YAAY,CACjC,MAAM,EAAE,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,GAAG,SAAS,EACtD,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAChC,OAAO,CAAC,IAAI,CAAC,CAOf;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,cAAmB,GAAG;IACzD,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC;IACtC,IAAI,EAAE,OAAO,CAAC;CACd,CAqBA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { FlowContext, SignInAnswer, SignInFlow } from './flow-types';
|
|
2
|
+
import type { SecondFactorKind } from './model';
|
|
3
|
+
/**
|
|
4
|
+
* The code a second-factor page posted, with how it is given
|
|
5
|
+
* (`{ kind: 'code' | 'recovery', code }`, the code at most 40 characters). A
|
|
6
|
+
* native form post goes back to its page, which then posts JSON; a
|
|
7
|
+
* cross-site post is a 403; a body of another shape is a 400.
|
|
8
|
+
*/
|
|
9
|
+
export declare function readCodeInput<L extends string, C>({ options }: FlowContext<L, C>, request: Request): Promise<{
|
|
10
|
+
kind: SecondFactorKind;
|
|
11
|
+
code: string;
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* The code against the sign-in's challenge: an issued code (an app's, or
|
|
15
|
+
* the one mailed) is confirmed, a recovery code is recovered. Either
|
|
16
|
+
* answers like a sign-in.
|
|
17
|
+
*/
|
|
18
|
+
export declare function codeStep(input: {
|
|
19
|
+
readonly kind: SecondFactorKind;
|
|
20
|
+
readonly code: string;
|
|
21
|
+
}, challenge: string, steps: Parameters<SignInFlow<string>['codeStep']>[2]): Promise<SignInAnswer>;
|
|
22
|
+
//# sourceMappingURL=second-factor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"second-factor.d.ts","sourceRoot":"","sources":["../../src/session/second-factor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAQhD;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EACtD,EAAE,OAAO,EAAE,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,EAC9B,OAAO,EAAE,OAAO,GACd,OAAO,CAAC;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAWnD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CACvB,KAAK,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACjE,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,GAClD,OAAO,CAAC,YAAY,CAAC,CAIvB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bytes of a cookie, and the reading of one: `Name=v; Max-Age=n; Path=/;
|
|
3
|
+
* HttpOnly[; Secure]; SameSite=Lax`, in this order, so a session set by an
|
|
4
|
+
* app before it adopted this package is still read after, and the other way
|
|
5
|
+
* round.
|
|
6
|
+
*/
|
|
7
|
+
export interface SerializeOptions {
|
|
8
|
+
/** Seconds; floored, and never below 0 (0 removes the cookie, and so does a value that is not finite). */
|
|
9
|
+
readonly maxAge: number;
|
|
10
|
+
/** `/` by default. */
|
|
11
|
+
readonly path?: string | undefined;
|
|
12
|
+
/** Adds `Secure`. Required: it is never read from the environment. */
|
|
13
|
+
readonly secure: boolean;
|
|
14
|
+
/** `'lax'` by default. `'none'` needs `secure`. */
|
|
15
|
+
readonly sameSite?: SameSite | undefined;
|
|
16
|
+
}
|
|
17
|
+
/** The `SameSite` attribute of a cookie. */
|
|
18
|
+
export type SameSite = 'lax' | 'strict' | 'none';
|
|
19
|
+
/** Throws a `TypeError` for a `SameSite` the package does not write, or `none` without `Secure`. */
|
|
20
|
+
export declare function checkSameSite(caller: string, sameSite: string, secure: boolean): asserts sameSite is SameSite;
|
|
21
|
+
/** Whether `name` can name a cookie (an RFC 6265 token). */
|
|
22
|
+
export declare const isCookieName: (name: string) => boolean;
|
|
23
|
+
/** Whether `path` can be a cookie's `Path`: absolute, no `;`, no control character. */
|
|
24
|
+
export declare const isCookiePath: (path: string) => boolean;
|
|
25
|
+
/**
|
|
26
|
+
* A `Set-Cookie` value: always `HttpOnly`, `SameSite=Lax` unless `sameSite`
|
|
27
|
+
* says otherwise, `Secure` when asked. A name or a path that could open another attribute throws a
|
|
28
|
+
* `TypeError`; a `maxAge` that is not finite is 0.
|
|
29
|
+
*/
|
|
30
|
+
export declare function serializeCookie(name: string, value: string, { maxAge, path, secure, sameSite }: SerializeOptions): string;
|
|
31
|
+
/**
|
|
32
|
+
* A cookie of the request: the first one of that name that is not empty,
|
|
33
|
+
* decoded; `null` when there is none, or when it is not valid percent-encoding.
|
|
34
|
+
*/
|
|
35
|
+
export declare function readCookie(request: Request, name: string): string | null;
|
|
36
|
+
/** Whether the request has a cookie named `name`, whatever its value. */
|
|
37
|
+
export declare function hasCookie(request: Request, name: string): boolean;
|
|
38
|
+
/** An instant as milliseconds; 0 when it is not a date. */
|
|
39
|
+
export declare function millisOf(at: string | Date): number;
|
|
40
|
+
/** Seconds from `now` until `expiresAt`: 0 when past or unreadable. */
|
|
41
|
+
export declare function secondsUntil(expiresAt: string | Date, now?: number): number;
|
|
42
|
+
//# sourceMappingURL=serialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/session/serialize.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,gBAAgB;IAChC,0GAA0G;IAC1G,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,sBAAsB;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,sEAAsE;IACtE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,mDAAmD;IACnD,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CACzC;AAED,4CAA4C;AAC5C,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAIjD,oGAAoG;AACpG,wBAAgB,aAAa,CAC5B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,GACb,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAW9B;AAQD,4DAA4D;AAC5D,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG,OAA2B,CAAC;AACxE,uFAAuF;AACvF,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG,OAA0B,CAAC;AAEvE;;;;GAIG;AACH,wBAAgB,eAAe,CAC9B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,EAAE,MAAM,EAAE,IAAU,EAAE,MAAM,EAAE,QAAgB,EAAE,EAAE,gBAAgB,GAChE,MAAM,CAoBR;AAYD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUxE;AAED,yEAAyE;AACzE,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED,2DAA2D;AAC3D,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAGlD;AAED,uEAAuE;AACvE,wBAAgB,YAAY,CAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,GAAG,GAAE,MAAmB,GACtB,MAAM,CAGR"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SignInFlow, SignInFlowOptions, SignInFlowWithoutSecondFactorOptions } from './flow-types';
|
|
2
|
+
/**
|
|
3
|
+
* The server side of a BFF's sign-in, over the cookies, the app's
|
|
4
|
+
* `createApiErrors` and its `jsonActions`: where an answer lands, the form
|
|
5
|
+
* steps with their refusals, the second factor, the viewer and sign-out.
|
|
6
|
+
* Built once, beside the app's cookies; it speaks `@softistx/janus`'s words
|
|
7
|
+
* (`signedIn`, `secondFactor`, `CODE_INVALID`) and the app maps its API's.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* export const signIn = signInFlow({
|
|
11
|
+
* cookies, errors, json,
|
|
12
|
+
* revoke: (token, request, caller?: Caller) =>
|
|
13
|
+
* execute(SignOutMutation, {}, { token, ...caller }),
|
|
14
|
+
* attemptsLeft: (count, language) => t('auth.attempts-left', { count }, language),
|
|
15
|
+
* });
|
|
16
|
+
*/
|
|
17
|
+
export declare function signInFlow<L extends string, C = undefined>(options: SignInFlowOptions<L, C>): SignInFlow<L, C, true>;
|
|
18
|
+
export declare function signInFlow<L extends string, C = undefined>(options: SignInFlowWithoutSecondFactorOptions<L, C>): SignInFlow<L, C, false>;
|
|
19
|
+
//# sourceMappingURL=sign-in.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign-in.d.ts","sourceRoot":"","sources":["../../src/session/sign-in.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEX,UAAU,EAEV,iBAAiB,EACjB,oCAAoC,EACpC,MAAM,cAAc,CAAC;AA6CtB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,GAAG,SAAS,EACzD,OAAO,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC9B,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;AAC1B,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,GAAG,SAAS,EACzD,OAAO,EAAE,oCAAoC,CAAC,CAAC,EAAE,CAAC,CAAC,GACjD,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type SameSite } from './serialize';
|
|
2
|
+
/** What `signedSession` takes. */
|
|
3
|
+
export interface SignedSessionOptions {
|
|
4
|
+
/** The HMAC key: at least 32 characters, from the environment, never committed. Changing it signs everyone out. */
|
|
5
|
+
readonly secret: string;
|
|
6
|
+
/** The base name of the cookie, e.g. `'my-app_operator'`; `__Host-` is added when `secure`. */
|
|
7
|
+
readonly name: string;
|
|
8
|
+
/** How long a session lasts, in seconds: a positive integer. It is the cookie's `Max-Age` and, signed, its expiry. */
|
|
9
|
+
readonly maxAge: number;
|
|
10
|
+
/** The app is served over HTTPS. Required, never read from the environment: pass `!import.meta.env.DEV`. */
|
|
11
|
+
readonly secure: boolean;
|
|
12
|
+
/** `'lax'` by default. */
|
|
13
|
+
readonly sameSite?: SameSite | undefined;
|
|
14
|
+
}
|
|
15
|
+
/** A signed, stateless session: no token, no store. */
|
|
16
|
+
export interface SignedSession {
|
|
17
|
+
/** The cookie name as sent, prefix included. */
|
|
18
|
+
readonly name: string;
|
|
19
|
+
/** A `Set-Cookie` value starting a session of `maxAge` seconds from `now`. */
|
|
20
|
+
commit(now?: number): Promise<string>;
|
|
21
|
+
/** A `Set-Cookie` value removing the cookie. */
|
|
22
|
+
destroy(): string;
|
|
23
|
+
/** Whether the request carries an unexpired cookie this secret signed. */
|
|
24
|
+
valid(request: Request, now?: number): Promise<boolean>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The session of a single local operator with no identity provider: the
|
|
28
|
+
* cookie holds `<expiresAt ms>.<nonce>.<mac>`, the MAC an HMAC-SHA256 of
|
|
29
|
+
* `<expiresAt>.<nonce>`, so the expiry cannot be moved without the secret.
|
|
30
|
+
* `valid` checks it in constant time and never throws. Both are async (Web Crypto).
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* const operator = signedSession({
|
|
34
|
+
* secret: process.env.SESSION_SECRET!,
|
|
35
|
+
* name: 'my-app_operator',
|
|
36
|
+
* maxAge: 8 * 3600,
|
|
37
|
+
* secure: !import.meta.env.DEV,
|
|
38
|
+
* sameSite: 'strict',
|
|
39
|
+
* });
|
|
40
|
+
* // after the password was checked: headers.append('Set-Cookie', await operator.commit())
|
|
41
|
+
* // in a loader: if (!(await operator.valid(request))) throw redirect('/sign-in')
|
|
42
|
+
*/
|
|
43
|
+
export declare function signedSession(options: SignedSessionOptions): SignedSession;
|
|
44
|
+
//# sourceMappingURL=signed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signed.d.ts","sourceRoot":"","sources":["../../src/session/signed.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,QAAQ,EAEb,MAAM,aAAa,CAAC;AAErB,kCAAkC;AAClC,MAAM,WAAW,oBAAoB;IACpC,mHAAmH;IACnH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,+FAA+F;IAC/F,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sHAAsH;IACtH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,4GAA4G;IAC5G,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,0BAA0B;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CACzC;AAED,uDAAuD;AACvD,MAAM,WAAW,aAAa;IAC7B,gDAAgD;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACtC,gDAAgD;IAChD,OAAO,IAAI,MAAM,CAAC;IAClB,0EAA0E;IAC1E,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACxD;AAuCD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,aAAa,CAmD1E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SocialFlowCookie } from './social-types';
|
|
2
|
+
/** Marks a flow cookie value that carries the return path: `r1.<base64url path>.<flow>`. */
|
|
3
|
+
export declare const RETURN_MARK = "r1.";
|
|
4
|
+
/** Marks a link flow: `r2.l.<base64url path>.<flow>`. A sign-in flow keeps `r1.` or the bare token, so cookies written before links existed still read as sign-ins. */
|
|
5
|
+
export declare const LINK_MARK = "r2.l.";
|
|
6
|
+
/** Which flow a cookie started. */
|
|
7
|
+
export type FlowKind = 'signIn' | 'link';
|
|
8
|
+
/** The flow cookie's value: the bare flow token, or the flow token behind its return path when that is not `/`. */
|
|
9
|
+
export declare function packFlow(flow: string, returnTo: string, kind?: FlowKind): string;
|
|
10
|
+
/** Reads `packFlow` back; a cookie written before the return path or the kind existed is a sign-in whose flow token is the value whole, as is any value whose mark or parts are malformed. The path is checked again. */
|
|
11
|
+
export declare function unpackFlow(value: string): {
|
|
12
|
+
flow: string;
|
|
13
|
+
returnTo: string;
|
|
14
|
+
kind: FlowKind;
|
|
15
|
+
};
|
|
16
|
+
/** The flow cookie's checked name (prefixed when secure), lifetime and flag. */
|
|
17
|
+
export declare function flowCookieOf(flowCookie: SocialFlowCookie): {
|
|
18
|
+
readonly name: string;
|
|
19
|
+
readonly seconds: number;
|
|
20
|
+
readonly secure: boolean;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=social-flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"social-flow.d.ts","sourceRoot":"","sources":["../../src/session/social-flow.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,4FAA4F;AAC5F,eAAO,MAAM,WAAW,QAAQ,CAAC;AAEjC,uKAAuK;AACvK,eAAO,MAAM,SAAS,UAAU,CAAC;AAEjC,mCAAmC;AACnC,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEzC,mHAAmH;AACnH,wBAAgB,QAAQ,CACvB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,QAAmB,GACvB,MAAM,CAKR;AAeD,yNAAyN;AACzN,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,QAAQ,CAAC;CACf,CASA;AAED,gFAAgF;AAChF,wBAAgB,YAAY,CAAC,UAAU,EAAE,gBAAgB,GAAG;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CACzB,CAcA"}
|