@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,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LINK_JSON_HEADER2,
|
|
3
|
+
postLinkArgs2,
|
|
4
|
+
postLinkRequest2,
|
|
5
|
+
SIGN_IN_PATHS2,
|
|
6
|
+
signInPath2,
|
|
7
|
+
secondFactorPath2,
|
|
8
|
+
TOTP_CODE2
|
|
9
|
+
} from "../../chunks/index-t2ph23wk.js";
|
|
10
|
+
import {
|
|
11
|
+
HOME2,
|
|
12
|
+
safeNext2
|
|
13
|
+
} from "../../chunks/index-0786n4qe.js";
|
|
14
|
+
import {
|
|
15
|
+
INITIAL_STEP_UP2,
|
|
16
|
+
stepUpReducer2,
|
|
17
|
+
stepUpProps2
|
|
18
|
+
} from "../../chunks/index-sxh06ged.js";
|
|
19
|
+
export {
|
|
20
|
+
HOME2 as HOME,
|
|
21
|
+
INITIAL_STEP_UP2 as INITIAL_STEP_UP,
|
|
22
|
+
LINK_JSON_HEADER2 as LINK_JSON_HEADER,
|
|
23
|
+
SIGN_IN_PATHS2 as SIGN_IN_PATHS,
|
|
24
|
+
TOTP_CODE2 as TOTP_CODE,
|
|
25
|
+
postLinkArgs2 as postLinkArgs,
|
|
26
|
+
postLinkRequest2 as postLinkRequest,
|
|
27
|
+
safeNext2 as safeNext,
|
|
28
|
+
secondFactorPath2 as secondFactorPath,
|
|
29
|
+
signInPath2 as signInPath,
|
|
30
|
+
stepUpProps2 as stepUpProps,
|
|
31
|
+
stepUpReducer2 as stepUpReducer
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
//# debugId=C40565120538FD8464756E2164756E21
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** The refusal a promise-based auth form takes back: `form`, a wait, a field's word. */
|
|
2
|
+
export type LinkPostRefusal<F extends string = string> = {
|
|
3
|
+
form?: string | undefined;
|
|
4
|
+
retryAfter?: number | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
[K in F]?: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
/** The request header that asks a link route for its redirects as data; `postLinkArgs` sends it. */
|
|
9
|
+
export declare const LINK_JSON_HEADER = "x-alxia-link";
|
|
10
|
+
export interface LinkPostOptions {
|
|
11
|
+
/** The `fetch` to use; the global one by default. */
|
|
12
|
+
readonly fetch?: typeof fetch | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Where a `{ redirect }` answer leads; `location.assign`, or
|
|
15
|
+
* `location.replace` when the answer says `replace` (the token page's
|
|
16
|
+
* entry must not stay in the history), by default.
|
|
17
|
+
*/
|
|
18
|
+
readonly navigate?: ((location: string, how: {
|
|
19
|
+
readonly replace: boolean;
|
|
20
|
+
}) => void) | undefined;
|
|
21
|
+
/** The form's message for a failed call or an answer with no shape; English by default. */
|
|
22
|
+
readonly unreachable?: string | undefined;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Posts `body` as JSON to a link route (whose action runs through
|
|
26
|
+
* `handingOver`) and maps the answer to a promise form's refusal:
|
|
27
|
+
* `undefined` when it is accepted (`sent`, or a `{ redirect }` it follows),
|
|
28
|
+
* else `{ form, retryAfter, ...fields }`, `fields` naming the `fieldErrors`
|
|
29
|
+
* to carry over. A network failure or an answer with no shape is the form's
|
|
30
|
+
* message, never a success.
|
|
31
|
+
*/
|
|
32
|
+
export declare function postLinkArgs<const F extends string>(path: string, body: unknown, fields: readonly F[], options?: LinkPostOptions): Promise<LinkPostRefusal<F> | undefined>;
|
|
33
|
+
/** Requests a mail's link: posts `{ input: { email } }`; see {@link postLinkArgs}. */
|
|
34
|
+
export declare const postLinkRequest: (path: string, email: string, options?: LinkPostOptions) => Promise<LinkPostRefusal<"email"> | undefined>;
|
|
35
|
+
//# sourceMappingURL=link-post.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-post.d.ts","sourceRoot":"","sources":["../../../src/session/model/link-post.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;IACxD,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC,GAAG;KAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS;CAAE,CAAC;AAEtC,oGAAoG;AACpG,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAE/C,MAAM,WAAW,eAAe;IAC/B,qDAAqD;IACrD,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,GAAG,SAAS,CAAC;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EACf,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC,GAChE,SAAS,CAAC;IACb,2FAA2F;IAC3F,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1C;AAOD;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,EACxD,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,SAAS,CAAC,EAAE,EACpB,OAAO,GAAE,eAAoB,GAC3B,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAqDzC;AAED,sFAAsF;AACtF,eAAO,MAAM,eAAe,GAC3B,MAAM,MAAM,EACZ,OAAO,MAAM,EACb,UAAU,eAAe,kDACuC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** The two pages of a sign-in. */
|
|
2
|
+
export interface SignInPaths {
|
|
3
|
+
readonly signIn: string;
|
|
4
|
+
readonly secondFactor: string;
|
|
5
|
+
}
|
|
6
|
+
/** The defaults: `/sign-in` and `/sign-in/second-factor`. */
|
|
7
|
+
export declare const SIGN_IN_PATHS: SignInPaths;
|
|
8
|
+
/**
|
|
9
|
+
* The sign-in page's URL, coming back to `next` (none for the home page, and
|
|
10
|
+
* `next` goes through `safeNext`). `query` adds parameters, such as
|
|
11
|
+
* `{ expired: '1' }`; `path` replaces `/sign-in` and must be a path of this
|
|
12
|
+
* site with no query or fragment (a `TypeError` otherwise).
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* signInPath('/orders'); // '/sign-in?next=%2Forders'
|
|
16
|
+
* signInPath('/', { query: { expired: '1' } }); // '/sign-in?expired=1'
|
|
17
|
+
*/
|
|
18
|
+
export declare function signInPath(next: string, options?: {
|
|
19
|
+
readonly query?: Record<string, string> | undefined;
|
|
20
|
+
readonly path?: string | undefined;
|
|
21
|
+
}): string;
|
|
22
|
+
/** The second-factor page's URL, coming back to `next` as `signInPath` does. */
|
|
23
|
+
export declare function secondFactorPath(next: string, path?: string): string;
|
|
24
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/session/model/paths.ts"],"names":[],"mappings":"AAGA,kCAAkC;AAClC,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC9B;AAED,6DAA6D;AAC7D,eAAO,MAAM,aAAa,EAAE,WAG3B,CAAC;AAcF;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CACzB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IACR,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IACpD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,GACJ,MAAM,CAMR;AAED,gFAAgF;AAChF,wBAAgB,gBAAgB,CAC/B,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,MAAmC,GACvC,MAAM,CAER"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Where a sign-in lands when `next` is missing or unsafe. */
|
|
2
|
+
export declare const HOME = "/";
|
|
3
|
+
/**
|
|
4
|
+
* The `next` a sign-in may redirect to: a path of this site only. Anything
|
|
5
|
+
* that could leave it (`//host`, `/\host`, `https://…`, `javascript:…`, a
|
|
6
|
+
* control character a browser would strip, a value over 2000 characters)
|
|
7
|
+
* falls back to `/`. The path is read after normalisation, so `/a/..//host`
|
|
8
|
+
* is refused too.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* safeNext('/orders?page=2'); // '/orders?page=2'
|
|
12
|
+
* safeNext('//evil.test'); // '/'
|
|
13
|
+
*/
|
|
14
|
+
export declare function safeNext(value: string | null | undefined): string;
|
|
15
|
+
//# sourceMappingURL=safe-next.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safe-next.d.ts","sourceRoot":"","sources":["../../../src/session/model/safe-next.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,eAAO,MAAM,IAAI,MAAM,CAAC;AAKxB;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAcjE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** A code of an authenticator app: six digits. */
|
|
2
|
+
export declare const TOTP_CODE: RegExp;
|
|
3
|
+
/**
|
|
4
|
+
* What a second-factor form sends: `code` is the issued code (an app's, or
|
|
5
|
+
* the one mailed), `recovery` a recovery code. Janus has no name for it, only
|
|
6
|
+
* `confirm` and `recover`.
|
|
7
|
+
*/
|
|
8
|
+
export type SecondFactorKind = 'code' | 'recovery';
|
|
9
|
+
/** How a sign-in ended, in `@softistx/janus`'s words (`SignInResult['status']`). */
|
|
10
|
+
export type SignInStatus = 'signedIn' | 'secondFactor';
|
|
11
|
+
/**
|
|
12
|
+
* How a step-up is confirmed, in `@softistx/janus`'s words: a code mailed to the
|
|
13
|
+
* current address, or the account's second factor.
|
|
14
|
+
*/
|
|
15
|
+
export type StepUpVia = 'email' | 'secondFactor';
|
|
16
|
+
//# sourceMappingURL=second-factor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"second-factor.d.ts","sourceRoot":"","sources":["../../../src/session/model/second-factor.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,eAAO,MAAM,SAAS,EAAE,MAAkB,CAAC;AAE3C;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,UAAU,CAAC;AAEnD,oFAAoF;AACpF,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,cAAc,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A path of this site, or a `TypeError` naming `label`. With no `query`, the
|
|
3
|
+
* path holds no `?` or `#` either, and the message prints it only up to
|
|
4
|
+
* there, since what follows may be a token.
|
|
5
|
+
*/
|
|
6
|
+
export declare function sitePath(path: string, { label, query, }: {
|
|
7
|
+
readonly label: string;
|
|
8
|
+
readonly query?: boolean | undefined;
|
|
9
|
+
}): string;
|
|
10
|
+
//# sourceMappingURL=site-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site-path.d.ts","sourceRoot":"","sources":["../../../src/session/model/site-path.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,QAAQ,CACvB,IAAI,EAAE,MAAM,EACZ,EACC,KAAK,EACL,KAAa,GACb,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAE,GACjE,MAAM,CAQR"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { StepUpVia } from './second-factor';
|
|
2
|
+
/**
|
|
3
|
+
* Why a step-up step failed: a wrong code, a challenge gone, a request held
|
|
4
|
+
* back for asking too often (`throttled`: a mail the API holds back or a rate
|
|
5
|
+
* limit, a 429, with `retryAfter` when the API says how long), or anything
|
|
6
|
+
* else.
|
|
7
|
+
*/
|
|
8
|
+
export type StepUpError = 'invalid' | 'expired' | 'failed' | 'throttled';
|
|
9
|
+
/** What the server answers to a request for a challenge. */
|
|
10
|
+
export type StepUpRequestAnswer = {
|
|
11
|
+
readonly ok: true;
|
|
12
|
+
readonly intent: 'request-step-up';
|
|
13
|
+
readonly challenge: string;
|
|
14
|
+
readonly via: StepUpVia;
|
|
15
|
+
} | {
|
|
16
|
+
readonly ok: false;
|
|
17
|
+
readonly intent: 'request-step-up';
|
|
18
|
+
readonly error: StepUpError;
|
|
19
|
+
/** The refusal worded for the page, in its language. */
|
|
20
|
+
readonly message?: string | undefined;
|
|
21
|
+
/** The seconds to wait before asking again (a whole number from 0), when `error` is `throttled` (a 429, or `reason: 'throttled'`) and the API says. */
|
|
22
|
+
readonly retryAfter?: number | undefined;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* What the server answers to a code. `attemptsLeft` is the tries a refused
|
|
26
|
+
* code leaves (left out when `throttled`); `locked` is always `false` since
|
|
27
|
+
* a timed wait is `error: 'throttled'` with `retryAfter`, and 0 tries left is
|
|
28
|
+
* `expired`.
|
|
29
|
+
*/
|
|
30
|
+
export type StepUpConfirmAnswer = {
|
|
31
|
+
readonly ok: true;
|
|
32
|
+
readonly intent: 'confirm-step-up';
|
|
33
|
+
} | {
|
|
34
|
+
readonly ok: false;
|
|
35
|
+
readonly intent: 'confirm-step-up';
|
|
36
|
+
readonly error: StepUpError;
|
|
37
|
+
readonly attemptsLeft?: number | undefined;
|
|
38
|
+
/** @deprecated No longer read: always `false`. */
|
|
39
|
+
readonly locked: boolean;
|
|
40
|
+
/** The refusal worded for the page, in its language. */
|
|
41
|
+
readonly message?: string | undefined;
|
|
42
|
+
/** The seconds to wait before trying again (a whole number from 0), when `error` is `throttled` (a 429, or `reason: 'throttled'`) and the API says. */
|
|
43
|
+
readonly retryAfter?: number | undefined;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=step-up-answers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-up-answers.d.ts","sourceRoot":"","sources":["../../../src/session/model/step-up-answers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEzE,4DAA4D;AAC5D,MAAM,MAAM,mBAAmB,GAC5B;IACA,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;CACvB,GACD;IACA,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,wDAAwD;IACxD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,uJAAuJ;IACvJ,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC,CAAC;AAEL;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAC5B;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAA;CAAE,GACzD;IACA,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,kDAAkD;IAClD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,wDAAwD;IACxD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,uJAAuJ;IACvJ,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { StepUpVia } from './second-factor';
|
|
2
|
+
import type { StepUpState } from './step-up';
|
|
3
|
+
import type { StepUpError } from './step-up-answers';
|
|
4
|
+
/**
|
|
5
|
+
* The props of `@nxgt/material`'s `VerificationCode` and `StepUpDialog` that
|
|
6
|
+
* the state decides. The state's `message` is not one: the dialog words its
|
|
7
|
+
* own texts from `error`, `attemptsLeft`, `locked` and `retryAfter`. The callbacks (`onSubmit`, `onResend`) are the app's.
|
|
8
|
+
*/
|
|
9
|
+
export interface StepUpProps {
|
|
10
|
+
readonly via?: StepUpVia;
|
|
11
|
+
readonly attemptsLeft?: number;
|
|
12
|
+
/** @deprecated No longer read: always `false`. */
|
|
13
|
+
readonly locked: boolean;
|
|
14
|
+
readonly error?: StepUpError;
|
|
15
|
+
/** The seconds to wait when `error` is `throttled` and the API said how long. */
|
|
16
|
+
readonly retryAfter?: number;
|
|
17
|
+
readonly pending: boolean;
|
|
18
|
+
readonly resent: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** The state as the dialog's props: `{ ...stepUpProps(state), onSubmit, onResend }`. */
|
|
21
|
+
export declare function stepUpProps(state: StepUpState): StepUpProps;
|
|
22
|
+
//# sourceMappingURL=step-up-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-up-props.d.ts","sourceRoot":"","sources":["../../../src/session/model/step-up-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,kDAAkD;IAClD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;IAC7B,iFAAiF;IACjF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CACzB;AAED,wFAAwF;AACxF,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,CAY3D"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { StepUpVia } from './second-factor';
|
|
2
|
+
import type { StepUpConfirmAnswer, StepUpError, StepUpRequestAnswer } from './step-up-answers';
|
|
3
|
+
/** Where a step-up is. */
|
|
4
|
+
export type StepUpPhase = 'idle' | 'requesting' | 'code' | 'confirming' | 'done';
|
|
5
|
+
export interface StepUpState {
|
|
6
|
+
readonly phase: StepUpPhase;
|
|
7
|
+
/** How the challenge held (or the last one) is confirmed. */
|
|
8
|
+
readonly via?: StepUpVia | undefined;
|
|
9
|
+
/** The challenge held. A secret: never in a URL, a log or loader data. */
|
|
10
|
+
readonly challenge?: string | undefined;
|
|
11
|
+
/** The tries the last refused code left. */
|
|
12
|
+
readonly attemptsLeft?: number | undefined;
|
|
13
|
+
/** @deprecated No longer read: always `false`. */
|
|
14
|
+
readonly locked: boolean;
|
|
15
|
+
readonly error?: StepUpError | undefined;
|
|
16
|
+
/** The last refusal worded for the page, until the next step or the release. */
|
|
17
|
+
readonly message?: string | undefined;
|
|
18
|
+
/** The seconds a throttled request asks to wait before asking again. */
|
|
19
|
+
readonly retryAfter?: number | undefined;
|
|
20
|
+
/** A request or a code is in flight. */
|
|
21
|
+
readonly pending: boolean;
|
|
22
|
+
/** The last request replaced a challenge that was held. */
|
|
23
|
+
readonly resent: boolean;
|
|
24
|
+
}
|
|
25
|
+
export type StepUpAction = {
|
|
26
|
+
readonly type: 'start';
|
|
27
|
+
} | {
|
|
28
|
+
readonly type: 'requested';
|
|
29
|
+
readonly answer: StepUpRequestAnswer;
|
|
30
|
+
} | {
|
|
31
|
+
readonly type: 'submit';
|
|
32
|
+
} | {
|
|
33
|
+
readonly type: 'confirmed';
|
|
34
|
+
readonly answer: StepUpConfirmAnswer;
|
|
35
|
+
} | {
|
|
36
|
+
readonly type: 'release';
|
|
37
|
+
};
|
|
38
|
+
export declare const INITIAL_STEP_UP: StepUpState;
|
|
39
|
+
/**
|
|
40
|
+
* The step-up's transitions, pure. `start` (a request in flight) forgets the
|
|
41
|
+
* last error but keeps a challenge held, so a refused "Resend code" leaves
|
|
42
|
+
* the code form up; a refusal keeps its `message` (and a throttle its
|
|
43
|
+
* `retryAfter`) until the next step; a granted request replaces the challenge; a code accepted
|
|
44
|
+
* spends it; an expired or spent one leaves "ask again"; at 0 tries left the
|
|
45
|
+
* challenge is `expired` for any factor, and a throttle keeps the challenge.
|
|
46
|
+
*/
|
|
47
|
+
export declare function stepUpReducer(state: StepUpState, action: StepUpAction): StepUpState;
|
|
48
|
+
//# sourceMappingURL=step-up.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-up.d.ts","sourceRoot":"","sources":["../../../src/session/model/step-up.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EACX,mBAAmB,EACnB,WAAW,EACX,mBAAmB,EACnB,MAAM,mBAAmB,CAAC;AAE3B,0BAA0B;AAC1B,MAAM,MAAM,WAAW,GACpB,MAAM,GACN,YAAY,GACZ,MAAM,GACN,YAAY,GACZ,MAAM,CAAC;AAEV,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,6DAA6D;IAC7D,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IACrC,0EAA0E;IAC1E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,4CAA4C;IAC5C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,kDAAkD;IAClD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACzC,gFAAgF;IAChF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,wEAAwE;IACxE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,wCAAwC;IACxC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,2DAA2D;IAC3D,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,MAAM,YAAY,GACrB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAA;CAAE,GACpE;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAA;CAAE,GACpE;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAEhC,eAAO,MAAM,eAAe,EAAE,WAK7B,CAAC;AAwEF;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC5B,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,YAAY,GAClB,WAAW,CAoCb"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@softistx/alxia-react-router/session/react`: the hooks of a page around the
|
|
3
|
+
* session flows `/session` serves: signing out, a mail link's parameter,
|
|
4
|
+
* posting a link or sign-in form, a one-code field and the step-up with the replay of the refused action. `react` and `react-router` are its only imports; it
|
|
5
|
+
* shares nothing with the server side of `/session`.
|
|
6
|
+
*/
|
|
7
|
+
export { asksStepUp, confirmAnswerOf, dialogPropsOf, requestAnswerOf, type StepUpChannel, type StepUpDialogPhase, type StepUpDialogProps, type StepUpOptions, type StepUpReplayOptions, type StepUpRunnerOptions, stepUpDialogPhase, useStepUp, useStepUpReplay, useStepUpRunner, } from './step-up';
|
|
8
|
+
export { type CodeField, type CodeSchema, useCodeField, useOnRefusal, } from './use-code-field';
|
|
9
|
+
export { type LinkFragmentOptions, useLinkFragment, } from './use-link-fragment';
|
|
10
|
+
export { type LinkParamOptions, useLinkParam } from './use-link-param';
|
|
11
|
+
export { type LinkAnswer, type LinkPostOptions, type LinkRefusal, refusalOf, useLinkPost, } from './use-link-post';
|
|
12
|
+
export { SIGN_OUT_PATH, type SignOutCall, type SignOutOptions, signOutAfter, signOutBody, useSignOut, } from './use-sign-out';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/session/react/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACN,UAAU,EACV,eAAe,EACf,aAAa,EACb,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,KAAK,SAAS,EACd,KAAK,UAAU,EACf,YAAY,EACZ,YAAY,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,KAAK,mBAAmB,EACxB,eAAe,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,gBAAgB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EACN,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,SAAS,EACT,WAAW,GACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,YAAY,EACZ,WAAW,EACX,UAAU,GACV,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import {
|
|
2
|
+
requestAnswerOf2,
|
|
3
|
+
confirmAnswerOf2,
|
|
4
|
+
dialogPropsOf2,
|
|
5
|
+
stepUpDialogPhase2,
|
|
6
|
+
asksStepUp2,
|
|
7
|
+
useStepUp2,
|
|
8
|
+
useStepUpReplay2,
|
|
9
|
+
useStepUpRunner2
|
|
10
|
+
} from "../../chunks/index-8as4j8m3.js";
|
|
11
|
+
import {
|
|
12
|
+
useJsonFetcher2
|
|
13
|
+
} from "../../chunks/index-ajtvyq35.js";
|
|
14
|
+
import"../../chunks/index-zyg8amjc.js";
|
|
15
|
+
import {
|
|
16
|
+
FetcherPromiseAborted2,
|
|
17
|
+
useFetcherPromise2
|
|
18
|
+
} from "../../chunks/index-xd5aqy3g.js";
|
|
19
|
+
// src/session/react/use-code-field.ts
|
|
20
|
+
import {
|
|
21
|
+
useCallback,
|
|
22
|
+
useEffect,
|
|
23
|
+
useRef,
|
|
24
|
+
useState
|
|
25
|
+
} from "react";
|
|
26
|
+
function useOnRefusal(refusal, handler) {
|
|
27
|
+
const handled = useRef(refusal);
|
|
28
|
+
const latest = useRef(handler);
|
|
29
|
+
latest.current = handler;
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (!refusal || handled.current === refusal)
|
|
32
|
+
return;
|
|
33
|
+
handled.current = refusal;
|
|
34
|
+
latest.current();
|
|
35
|
+
}, [refusal]);
|
|
36
|
+
}
|
|
37
|
+
function useCodeField(schema, refusal) {
|
|
38
|
+
const [code, setCodeState] = useState("");
|
|
39
|
+
const [error, setError] = useState();
|
|
40
|
+
const ref = useRef(null);
|
|
41
|
+
const setCode = useCallback((next) => {
|
|
42
|
+
setCodeState(next);
|
|
43
|
+
setError(undefined);
|
|
44
|
+
}, []);
|
|
45
|
+
useOnRefusal(refusal, () => {
|
|
46
|
+
setCode("");
|
|
47
|
+
ref.current?.focus();
|
|
48
|
+
});
|
|
49
|
+
const check = () => {
|
|
50
|
+
const result = schema["~standard"].validate(code);
|
|
51
|
+
if (result instanceof Promise) {
|
|
52
|
+
throw new TypeError("useCodeField takes a synchronous schema");
|
|
53
|
+
}
|
|
54
|
+
const { issues, value } = result;
|
|
55
|
+
if (issues?.length) {
|
|
56
|
+
setError(issues[0]?.message);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
setError(undefined);
|
|
60
|
+
return value;
|
|
61
|
+
};
|
|
62
|
+
return { code, setCode, ref, error, check };
|
|
63
|
+
}
|
|
64
|
+
// src/session/react/use-link-fragment.ts
|
|
65
|
+
import { useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
|
|
66
|
+
function useLinkFragment({
|
|
67
|
+
drop = false
|
|
68
|
+
} = {}) {
|
|
69
|
+
const [fragment, setFragment] = useState2(undefined);
|
|
70
|
+
const read = useRef2(undefined);
|
|
71
|
+
useEffect2(() => {
|
|
72
|
+
if (read.current === undefined) {
|
|
73
|
+
const raw = window.location.hash.replace(/^#/, "");
|
|
74
|
+
let value = null;
|
|
75
|
+
if (raw) {
|
|
76
|
+
try {
|
|
77
|
+
value = decodeURIComponent(raw);
|
|
78
|
+
} catch {
|
|
79
|
+
value = raw;
|
|
80
|
+
}
|
|
81
|
+
if (drop) {
|
|
82
|
+
window.history.replaceState(window.history.state, "", window.location.pathname + window.location.search);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
read.current = value;
|
|
86
|
+
}
|
|
87
|
+
setFragment(read.current);
|
|
88
|
+
}, [drop]);
|
|
89
|
+
return fragment;
|
|
90
|
+
}
|
|
91
|
+
// src/session/react/use-link-param.ts
|
|
92
|
+
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
93
|
+
import { useLocation, useSearchParams } from "react-router";
|
|
94
|
+
function useLinkParam(name, { drop = false, live = false } = {}) {
|
|
95
|
+
const [params] = useSearchParams();
|
|
96
|
+
const { key } = useLocation();
|
|
97
|
+
const followed = live ? key : null;
|
|
98
|
+
const current = params.get(name) || null;
|
|
99
|
+
const [kept, setKept] = useState3(current);
|
|
100
|
+
const [seen, setSeen] = useState3(current);
|
|
101
|
+
if (live && current !== seen) {
|
|
102
|
+
setSeen(current);
|
|
103
|
+
if (!drop || current !== null)
|
|
104
|
+
setKept(current);
|
|
105
|
+
}
|
|
106
|
+
useEffect3(() => {
|
|
107
|
+
if (!drop)
|
|
108
|
+
return;
|
|
109
|
+
const url = new URL(window.location.href);
|
|
110
|
+
if (!url.searchParams.has(name))
|
|
111
|
+
return;
|
|
112
|
+
url.searchParams.delete(name);
|
|
113
|
+
window.history.replaceState(window.history.state, "", `${url.pathname}${url.search}${url.hash}`);
|
|
114
|
+
}, [drop, name, followed]);
|
|
115
|
+
if (live && !drop)
|
|
116
|
+
return current;
|
|
117
|
+
return kept;
|
|
118
|
+
}
|
|
119
|
+
// src/session/react/use-link-post.ts
|
|
120
|
+
function refusalOf(answer) {
|
|
121
|
+
if (!answer)
|
|
122
|
+
return;
|
|
123
|
+
const { formError, retryAfter, fieldErrors } = answer;
|
|
124
|
+
if (!formError && retryAfter === undefined && !fieldErrors?.email)
|
|
125
|
+
return;
|
|
126
|
+
return {
|
|
127
|
+
...fieldErrors?.email ? { email: fieldErrors.email } : {},
|
|
128
|
+
...formError ? { form: formError } : {},
|
|
129
|
+
...retryAfter !== undefined ? { retryAfter } : {}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function useLinkPost(options = {}) {
|
|
133
|
+
const { fetcher, post, busy } = useJsonFetcher2(undefined, options.action);
|
|
134
|
+
const ask = useFetcherPromise2(fetcher);
|
|
135
|
+
const send = (body, to) => ask(() => post(body, to?.action ?? options.action)).then(refusalOf, (error) => {
|
|
136
|
+
if (!(error instanceof FetcherPromiseAborted2))
|
|
137
|
+
throw error;
|
|
138
|
+
return;
|
|
139
|
+
});
|
|
140
|
+
return { send, busy };
|
|
141
|
+
}
|
|
142
|
+
// src/session/react/use-sign-out.ts
|
|
143
|
+
import { useCallback as useCallback2, useState as useState4 } from "react";
|
|
144
|
+
import { useNavigation, useSubmit } from "react-router";
|
|
145
|
+
var SIGN_OUT_PATH = "/sign-out";
|
|
146
|
+
function signOutBody(next) {
|
|
147
|
+
if (next === undefined)
|
|
148
|
+
return {};
|
|
149
|
+
const local = /^\/(?![/\\])/.test(next) && next.length <= 2000;
|
|
150
|
+
return local && next !== "/" ? { next } : {};
|
|
151
|
+
}
|
|
152
|
+
async function signOutAfter(before, submit) {
|
|
153
|
+
try {
|
|
154
|
+
await before?.();
|
|
155
|
+
} catch {}
|
|
156
|
+
await submit();
|
|
157
|
+
}
|
|
158
|
+
function useSignOut(options = {}) {
|
|
159
|
+
const { action = SIGN_OUT_PATH, before, next } = options;
|
|
160
|
+
const submit = useSubmit();
|
|
161
|
+
const [preparing, setPreparing] = useState4(false);
|
|
162
|
+
const submitting = useNavigation().formAction === action;
|
|
163
|
+
const signOut = useCallback2((call) => {
|
|
164
|
+
setPreparing(true);
|
|
165
|
+
const own = typeof call?.next === "string" ? call.next : next;
|
|
166
|
+
signOutAfter(before, () => submit(signOutBody(own), {
|
|
167
|
+
method: "post",
|
|
168
|
+
action,
|
|
169
|
+
encType: "application/json"
|
|
170
|
+
})).finally(() => setPreparing(false));
|
|
171
|
+
}, [submit, action, before, next]);
|
|
172
|
+
return { signOut, busy: preparing || submitting };
|
|
173
|
+
}
|
|
174
|
+
export {
|
|
175
|
+
SIGN_OUT_PATH,
|
|
176
|
+
asksStepUp2 as asksStepUp,
|
|
177
|
+
confirmAnswerOf2 as confirmAnswerOf,
|
|
178
|
+
dialogPropsOf2 as dialogPropsOf,
|
|
179
|
+
refusalOf,
|
|
180
|
+
requestAnswerOf2 as requestAnswerOf,
|
|
181
|
+
signOutAfter,
|
|
182
|
+
signOutBody,
|
|
183
|
+
stepUpDialogPhase2 as stepUpDialogPhase,
|
|
184
|
+
useCodeField,
|
|
185
|
+
useLinkFragment,
|
|
186
|
+
useLinkParam,
|
|
187
|
+
useLinkPost,
|
|
188
|
+
useOnRefusal,
|
|
189
|
+
useSignOut,
|
|
190
|
+
useStepUp2 as useStepUp,
|
|
191
|
+
useStepUpReplay2 as useStepUpReplay,
|
|
192
|
+
useStepUpRunner2 as useStepUpRunner
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
//# debugId=78CCEE5359258CEC64756E2164756E21
|
|
196
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/session/react/use-code-field.ts", "../src/session/react/use-link-fragment.ts", "../src/session/react/use-link-param.ts", "../src/session/react/use-link-post.ts", "../src/session/react/use-sign-out.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import {\n\ttype RefObject,\n\tuseCallback,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from 'react';\n\n/** The part of a Standard Schema (`~standard`) this hook reads; Zod, Valibot and ArkType satisfy it. */\nexport interface CodeSchema {\n\treadonly '~standard': {\n\t\tvalidate(value: unknown): unknown;\n\t};\n}\n\n/**\n * Calls `handler` once for each new `refusal` (a new object each time,\n * `undefined` when there is none). A refusal already there when the\n * component mounted is not new: it is the page's own, seen again.\n * Library-agnostic: pair it with any form library's `reset` and `focus`.\n */\nexport function useOnRefusal(\n\trefusal: object | undefined,\n\thandler: () => void,\n): void {\n\tconst handled = useRef(refusal);\n\tconst latest = useRef(handler);\n\tlatest.current = handler;\n\tuseEffect(() => {\n\t\tif (!refusal || handled.current === refusal) return;\n\t\thandled.current = refusal;\n\t\tlatest.current();\n\t}, [refusal]);\n}\n\nexport interface CodeField {\n\t/** The code typed so far. */\n\treadonly code: string;\n\treadonly setCode: (code: string) => void;\n\t/** On the input, so a refusal can focus it. */\n\treadonly ref: RefObject<HTMLInputElement | null>;\n\t/** The first issue's message of the last `check`, cleared by typing. */\n\treadonly error: string | undefined;\n\t/**\n\t * Validates the code against the schema: the parsed value, or\n\t * `undefined` and `error` set. Synchronous schemas only.\n\t */\n\treadonly check: () => unknown;\n}\n\n/**\n * A one-code field (an authenticator app's code, a recovery code) with no\n * form library: it holds the code, checks it against `schema`, and on each\n * new `refusal` clears the refused code and focuses the input for the next\n * try. With react-hook-form, use `useOnRefusal` and its `setValue` and\n * `setFocus` instead.\n */\nexport function useCodeField(\n\tschema: CodeSchema,\n\trefusal: object | undefined,\n): CodeField {\n\tconst [code, setCodeState] = useState('');\n\tconst [error, setError] = useState<string | undefined>();\n\tconst ref = useRef<HTMLInputElement | null>(null);\n\tconst setCode = useCallback((next: string) => {\n\t\tsetCodeState(next);\n\t\tsetError(undefined);\n\t}, []);\n\tuseOnRefusal(refusal, () => {\n\t\tsetCode('');\n\t\tref.current?.focus();\n\t});\n\tconst check = () => {\n\t\tconst result = schema['~standard'].validate(code);\n\t\tif (result instanceof Promise) {\n\t\t\tthrow new TypeError('useCodeField takes a synchronous schema');\n\t\t}\n\t\tconst { issues, value } = result as {\n\t\t\tissues?: ReadonlyArray<{ message: string }>;\n\t\t\tvalue?: unknown;\n\t\t};\n\t\tif (issues?.length) {\n\t\t\tsetError(issues[0]?.message);\n\t\t\treturn undefined;\n\t\t}\n\t\tsetError(undefined);\n\t\treturn value;\n\t};\n\treturn { code, setCode, ref, error, check };\n}\n",
|
|
6
|
+
"import { useEffect, useRef, useState } from 'react';\n\nexport interface LinkFragmentOptions {\n\t/**\n\t * Remove the fragment from the address bar once read\n\t * (`history.replaceState`), so a code is not left in the history, a copied\n\t * address or a screenshot. Default `false`.\n\t */\n\treadonly drop?: boolean;\n}\n\n/**\n * The fragment a mail's link carries (`/invitations/accept#<code>`: a\n * fragment never reaches a server, a log or a `Referer`), decoded and without\n * the `#`. The fragment twin of `useLinkParam`.\n *\n * `undefined` until the page has hydrated and read it (a server render and\n * the first client render agree), then the code, or `null` for a link with\n * none (absent or empty). It is read once and kept for the page's life: with\n * `drop: true` the fragment is removed from the address bar and the value\n * survives it, including React Strict Mode's second effect run, which finds\n * the fragment already gone.\n */\nexport function useLinkFragment({\n\tdrop = false,\n}: LinkFragmentOptions = {}): string | null | undefined {\n\tconst [fragment, setFragment] = useState<string | null | undefined>(\n\t\tundefined,\n\t);\n\tconst read = useRef<string | null | undefined>(undefined);\n\tuseEffect(() => {\n\t\tif (read.current === undefined) {\n\t\t\tconst raw = window.location.hash.replace(/^#/, '');\n\t\t\tlet value: string | null = null;\n\t\t\tif (raw) {\n\t\t\t\ttry {\n\t\t\t\t\tvalue = decodeURIComponent(raw);\n\t\t\t\t} catch {\n\t\t\t\t\tvalue = raw;\n\t\t\t\t}\n\t\t\t\tif (drop) {\n\t\t\t\t\twindow.history.replaceState(\n\t\t\t\t\t\twindow.history.state,\n\t\t\t\t\t\t'',\n\t\t\t\t\t\twindow.location.pathname + window.location.search,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tread.current = value;\n\t\t}\n\t\tsetFragment(read.current);\n\t}, [drop]);\n\treturn fragment;\n}\n",
|
|
7
|
+
"import { useEffect, useState } from 'react';\nimport { useLocation, useSearchParams } from 'react-router';\n\nexport interface LinkParamOptions {\n\t/**\n\t * Remove the parameter from the address bar once read\n\t * (`history.replaceState`), so a token is not left in the history, a\n\t * bookmark or a shared screen. Default `false`.\n\t */\n\treadonly drop?: boolean;\n\t/**\n\t * Follow the URL instead of reading it once. A parameter that a redirect\n\t * or a link adds to the SAME mounted route (`?state=linked`) is seen, and\n\t * each new location is read again. Without `drop` the value is the\n\t * parameter of the current location. With `drop` the value is kept after\n\t * the address bar loses the parameter, until a location carries a new\n\t * one: a navigation that has none does not clear it. Default `false`.\n\t */\n\treadonly live?: boolean;\n}\n\n/**\n * The query parameter a mail's link carries (`token`, `code`, `state`),\n * read once: the value of the first render is kept for the page's life, so\n * dropping it from the address bar never loses it. With `live: true` it\n * follows the URL instead (see `LinkParamOptions`). `null` when absent or\n * empty. Safe to render on the server, where nothing is dropped.\n */\nexport function useLinkParam(\n\tname: string,\n\t{ drop = false, live = false }: LinkParamOptions = {},\n): string | null {\n\tconst [params] = useSearchParams();\n\tconst { key } = useLocation();\n\tconst followed = live ? key : null;\n\tconst current = params.get(name) || null;\n\tconst [kept, setKept] = useState(current);\n\tconst [seen, setSeen] = useState(current);\n\tif (live && current !== seen) {\n\t\tsetSeen(current);\n\t\tif (!drop || current !== null) setKept(current);\n\t}\n\tuseEffect(() => {\n\t\tif (!drop) return;\n\t\tconst url = new URL(window.location.href);\n\t\tif (!url.searchParams.has(name)) return;\n\t\turl.searchParams.delete(name);\n\t\twindow.history.replaceState(\n\t\t\twindow.history.state,\n\t\t\t'',\n\t\t\t`${url.pathname}${url.search}${url.hash}`,\n\t\t);\n\t}, [drop, name, followed]);\n\tif (live && !drop) return current;\n\treturn kept;\n}\n",
|
|
8
|
+
"import { type JsonBody, useJsonFetcher } from '../../errors/use-json-fetcher';\nimport {\n\tFetcherPromiseAborted,\n\tuseFetcherPromise,\n} from '../../fetcher/use-fetcher-promise';\n\n/** What the sign-in and link actions answer a JSON post (`formError`, `retryAfter`, `fieldErrors.email`). */\nexport interface LinkAnswer {\n\treadonly formError?: string;\n\treadonly retryAfter?: number;\n\treadonly fieldErrors?: { readonly email?: string };\n}\n\n/** The refusal a sign-in or link form takes: `{ form, retryAfter, email }`. */\nexport interface LinkRefusal {\n\treadonly form?: string;\n\treadonly retryAfter?: number;\n\treadonly email?: string;\n}\n\n/**\n * The answer as a form's refusal, or `undefined` when it refused nothing\n * (or there is no answer). `formError` becomes `form`, `fieldErrors.email`\n * becomes `email`, `retryAfter` is kept; absent fields are left out.\n */\nexport function refusalOf(\n\tanswer: LinkAnswer | null | undefined,\n): LinkRefusal | undefined {\n\tif (!answer) return undefined;\n\tconst { formError, retryAfter, fieldErrors } = answer;\n\tif (!formError && retryAfter === undefined && !fieldErrors?.email)\n\t\treturn undefined;\n\treturn {\n\t\t...(fieldErrors?.email ? { email: fieldErrors.email } : {}),\n\t\t...(formError ? { form: formError } : {}),\n\t\t...(retryAfter !== undefined ? { retryAfter } : {}),\n\t};\n}\n\n/** Where a `useLinkPost` post goes. */\nexport interface LinkPostOptions {\n\t/** Another route's action (a resource route's, such as `/auth/resend`); the page's own when absent. */\n\treadonly action?: string;\n}\n\n/**\n * Posts JSON to the page's action, or to another route's with\n * `useLinkPost({ action })` (a component rendered on every page, such as a\n * banner), and resolves the form's refusal (`refusalOf` of the answer), or\n * `undefined` when nothing was refused or a navigation aborted the post. Any\n * other failure rejects. `send(body, { action })` targets one call, like\n * `useJsonFetcher`'s `post(body, to)`. `busy` while the post is in flight.\n */\nexport function useLinkPost(options: LinkPostOptions = {}): {\n\tsend(body: JsonBody, to?: LinkPostOptions): Promise<LinkRefusal | undefined>;\n\tbusy: boolean;\n} {\n\tconst { fetcher, post, busy } = useJsonFetcher<LinkAnswer>(\n\t\tundefined,\n\t\toptions.action,\n\t);\n\tconst ask = useFetcherPromise(fetcher);\n\tconst send = (body: JsonBody, to?: LinkPostOptions) =>\n\t\task(() => post(body, to?.action ?? options.action)).then(\n\t\t\trefusalOf,\n\t\t\t(error) => {\n\t\t\t\tif (!(error instanceof FetcherPromiseAborted)) throw error;\n\t\t\t\treturn undefined;\n\t\t\t},\n\t\t);\n\treturn { send, busy };\n}\n",
|
|
9
|
+
"import { useCallback, useState } from 'react';\nimport { useNavigation, useSubmit } from 'react-router';\n\n/** Where `signInFlow`'s sign-out action is mounted unless the app says otherwise. */\nexport const SIGN_OUT_PATH = '/sign-out';\n\nexport interface SignOutOptions {\n\t/** The sign-out route (default `/sign-out`). */\n\treadonly action?: string;\n\t/**\n\t * Runs before the post: clear the worker's caches, a local store. A\n\t * rejection never keeps the user signed in: the sign-out goes on.\n\t */\n\treadonly before?: () => Promise<unknown> | unknown;\n\t/**\n\t * Where the user lands after signing in again: a path of this site. It\n\t * is posted as `{ next }`, and the sign-out action redirects to the\n\t * sign-in page with `?next=`. A path that leaves the site is not posted.\n\t */\n\treadonly next?: string;\n}\n\n/** What a call of `signOut` may say. */\nexport interface SignOutCall {\n\t/** Overrides the hook's `next` for this call. */\n\treadonly next?: string;\n}\n\n/**\n * The JSON body to post: `{ next }` for a path of the site, `{}` otherwise.\n * This page imports nothing of the server's side, so it only keeps the\n * obvious shape (`/path`, not `//host` or `/\\host`); `signIn.signOut` runs\n * `safeNext` on what arrives, and it is the guard that counts.\n */\nexport function signOutBody(next: string | undefined): { next?: string } {\n\tif (next === undefined) return {};\n\tconst local = /^\\/(?![/\\\\])/.test(next) && next.length <= 2000;\n\treturn local && next !== '/' ? { next } : {};\n}\n\n/**\n * Runs `before`, then `submit`. A `before` that throws or rejects is\n * ignored, so a failed cleanup cannot keep a session alive.\n */\nexport async function signOutAfter(\n\tbefore: (() => Promise<unknown> | unknown) | undefined,\n\tsubmit: () => Promise<void> | void,\n): Promise<void> {\n\ttry {\n\t\tawait before?.();\n\t} catch {\n\t\t// Signing out matters more than the cleanup.\n\t}\n\tawait submit();\n}\n\n/**\n * The one way a page signs out, wherever the control is: posts `{}` (or `{ next }`) as JSON\n * to the sign-out route (same-origin and JSON only, as `signInFlow`'s action\n * requires). `busy` from the call until the navigation it starts has ended.\n */\nexport function useSignOut(options: SignOutOptions = {}): {\n\tsignOut: (call?: SignOutCall) => void;\n\tbusy: boolean;\n} {\n\tconst { action = SIGN_OUT_PATH, before, next } = options;\n\tconst submit = useSubmit();\n\tconst [preparing, setPreparing] = useState(false);\n\tconst submitting = useNavigation().formAction === action;\n\tconst signOut = useCallback(\n\t\t(call?: SignOutCall) => {\n\t\t\tsetPreparing(true);\n\t\t\t// A click handler passes its event: only a plain `{ next }` counts.\n\t\t\tconst own = typeof call?.next === 'string' ? call.next : next;\n\t\t\tvoid signOutAfter(before, () =>\n\t\t\t\tsubmit(signOutBody(own), {\n\t\t\t\t\tmethod: 'post',\n\t\t\t\t\taction,\n\t\t\t\t\tencType: 'application/json',\n\t\t\t\t}),\n\t\t\t).finally(() => setPreparing(false));\n\t\t},\n\t\t[submit, action, before, next],\n\t);\n\treturn { signOut, busy: preparing || submitting };\n}\n"
|
|
10
|
+
],
|
|
11
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBO,SAAS,YAAY,CAC3B,SACA,SACO;AAAA,EACP,MAAM,UAAU,OAAO,OAAO;AAAA,EAC9B,MAAM,SAAS,OAAO,OAAO;AAAA,EAC7B,OAAO,UAAU;AAAA,EACjB,UAAU,MAAM;AAAA,IACf,IAAI,CAAC,WAAW,QAAQ,YAAY;AAAA,MAAS;AAAA,IAC7C,QAAQ,UAAU;AAAA,IAClB,OAAO,QAAQ;AAAA,KACb,CAAC,OAAO,CAAC;AAAA;AAyBN,SAAS,YAAY,CAC3B,QACA,SACY;AAAA,EACZ,OAAO,MAAM,gBAAgB,SAAS,EAAE;AAAA,EACxC,OAAO,OAAO,YAAY,SAA6B;AAAA,EACvD,MAAM,MAAM,OAAgC,IAAI;AAAA,EAChD,MAAM,UAAU,YAAY,CAAC,SAAiB;AAAA,IAC7C,aAAa,IAAI;AAAA,IACjB,SAAS,SAAS;AAAA,KAChB,CAAC,CAAC;AAAA,EACL,aAAa,SAAS,MAAM;AAAA,IAC3B,QAAQ,EAAE;AAAA,IACV,IAAI,SAAS,MAAM;AAAA,GACnB;AAAA,EACD,MAAM,QAAQ,MAAM;AAAA,IACnB,MAAM,SAAS,OAAO,aAAa,SAAS,IAAI;AAAA,IAChD,IAAI,kBAAkB,SAAS;AAAA,MAC9B,MAAM,IAAI,UAAU,yCAAyC;AAAA,IAC9D;AAAA,IACA,QAAQ,QAAQ,UAAU;AAAA,IAI1B,IAAI,QAAQ,QAAQ;AAAA,MACnB,SAAS,OAAO,IAAI,OAAO;AAAA,MAC3B;AAAA,IACD;AAAA,IACA,SAAS,SAAS;AAAA,IAClB,OAAO;AAAA;AAAA,EAER,OAAO,EAAE,MAAM,SAAS,KAAK,OAAO,MAAM;AAAA;;ACxF3C,sBAAS,sBAAW,qBAAQ;AAuBrB,SAAS,eAAe;AAAA,EAC9B,OAAO;AAAA,IACiB,CAAC,GAA8B;AAAA,EACvD,OAAO,UAAU,eAAe,UAC/B,SACD;AAAA,EACA,MAAM,OAAO,QAAkC,SAAS;AAAA,EACxD,WAAU,MAAM;AAAA,IACf,IAAI,KAAK,YAAY,WAAW;AAAA,MAC/B,MAAM,MAAM,OAAO,SAAS,KAAK,QAAQ,MAAM,EAAE;AAAA,MACjD,IAAI,QAAuB;AAAA,MAC3B,IAAI,KAAK;AAAA,QACR,IAAI;AAAA,UACH,QAAQ,mBAAmB,GAAG;AAAA,UAC7B,MAAM;AAAA,UACP,QAAQ;AAAA;AAAA,QAET,IAAI,MAAM;AAAA,UACT,OAAO,QAAQ,aACd,OAAO,QAAQ,OACf,IACA,OAAO,SAAS,WAAW,OAAO,SAAS,MAC5C;AAAA,QACD;AAAA,MACD;AAAA,MACA,KAAK,UAAU;AAAA,IAChB;AAAA,IACA,YAAY,KAAK,OAAO;AAAA,KACtB,CAAC,IAAI,CAAC;AAAA,EACT,OAAO;AAAA;;ACpDR,sBAAS,wBAAW;AACpB;AA2BO,SAAS,YAAY,CAC3B,QACE,OAAO,OAAO,OAAO,UAA4B,CAAC,GACpC;AAAA,EAChB,OAAO,UAAU,gBAAgB;AAAA,EACjC,QAAQ,QAAQ,YAAY;AAAA,EAC5B,MAAM,WAAW,OAAO,MAAM;AAAA,EAC9B,MAAM,UAAU,OAAO,IAAI,IAAI,KAAK;AAAA,EACpC,OAAO,MAAM,WAAW,UAAS,OAAO;AAAA,EACxC,OAAO,MAAM,WAAW,UAAS,OAAO;AAAA,EACxC,IAAI,QAAQ,YAAY,MAAM;AAAA,IAC7B,QAAQ,OAAO;AAAA,IACf,IAAI,CAAC,QAAQ,YAAY;AAAA,MAAM,QAAQ,OAAO;AAAA,EAC/C;AAAA,EACA,WAAU,MAAM;AAAA,IACf,IAAI,CAAC;AAAA,MAAM;AAAA,IACX,MAAM,MAAM,IAAI,IAAI,OAAO,SAAS,IAAI;AAAA,IACxC,IAAI,CAAC,IAAI,aAAa,IAAI,IAAI;AAAA,MAAG;AAAA,IACjC,IAAI,aAAa,OAAO,IAAI;AAAA,IAC5B,OAAO,QAAQ,aACd,OAAO,QAAQ,OACf,IACA,GAAG,IAAI,WAAW,IAAI,SAAS,IAAI,MACpC;AAAA,KACE,CAAC,MAAM,MAAM,QAAQ,CAAC;AAAA,EACzB,IAAI,QAAQ,CAAC;AAAA,IAAM,OAAO;AAAA,EAC1B,OAAO;AAAA;;AC7BD,SAAS,SAAS,CACxB,QAC0B;AAAA,EAC1B,IAAI,CAAC;AAAA,IAAQ;AAAA,EACb,QAAQ,WAAW,YAAY,gBAAgB;AAAA,EAC/C,IAAI,CAAC,aAAa,eAAe,aAAa,CAAC,aAAa;AAAA,IAC3D;AAAA,EACD,OAAO;AAAA,OACF,aAAa,QAAQ,EAAE,OAAO,YAAY,MAAM,IAAI,CAAC;AAAA,OACrD,YAAY,EAAE,MAAM,UAAU,IAAI,CAAC;AAAA,OACnC,eAAe,YAAY,EAAE,WAAW,IAAI,CAAC;AAAA,EAClD;AAAA;AAiBM,SAAS,WAAW,CAAC,UAA2B,CAAC,GAGtD;AAAA,EACD,QAAQ,SAAS,MAAM,SAAS,gBAC/B,WACA,QAAQ,MACT;AAAA,EACA,MAAM,MAAM,mBAAkB,OAAO;AAAA,EACrC,MAAM,OAAO,CAAC,MAAgB,OAC7B,IAAI,MAAM,KAAK,MAAM,IAAI,UAAU,QAAQ,MAAM,CAAC,EAAE,KACnD,WACA,CAAC,UAAU;AAAA,IACV,IAAI,EAAE,iBAAiB;AAAA,MAAwB,MAAM;AAAA,IACrD;AAAA,GAEF;AAAA,EACD,OAAO,EAAE,MAAM,KAAK;AAAA;;ACtErB,wBAAS,0BAAa;AACtB;AAGO,IAAM,gBAAgB;AA8BtB,SAAS,WAAW,CAAC,MAA6C;AAAA,EACxE,IAAI,SAAS;AAAA,IAAW,OAAO,CAAC;AAAA,EAChC,MAAM,QAAQ,eAAe,KAAK,IAAI,KAAK,KAAK,UAAU;AAAA,EAC1D,OAAO,SAAS,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;AAAA;AAOrC,eAAe,YAAY,CACjC,QACA,QACgB;AAAA,EAChB,IAAI;AAAA,IACH,MAAM,SAAS;AAAA,IACd,MAAM;AAAA,EAGR,MAAM,OAAO;AAAA;AAQP,SAAS,UAAU,CAAC,UAA0B,CAAC,GAGpD;AAAA,EACD,QAAQ,SAAS,eAAe,QAAQ,SAAS;AAAA,EACjD,MAAM,SAAS,UAAU;AAAA,EACzB,OAAO,WAAW,gBAAgB,UAAS,KAAK;AAAA,EAChD,MAAM,aAAa,cAAc,EAAE,eAAe;AAAA,EAClD,MAAM,UAAU,aACf,CAAC,SAAuB;AAAA,IACvB,aAAa,IAAI;AAAA,IAEjB,MAAM,MAAM,OAAO,MAAM,SAAS,WAAW,KAAK,OAAO;AAAA,IACpD,aAAa,QAAQ,MACzB,OAAO,YAAY,GAAG,GAAG;AAAA,MACxB,QAAQ;AAAA,MACR;AAAA,MACA,SAAS;AAAA,IACV,CAAC,CACF,EAAE,QAAQ,MAAM,aAAa,KAAK,CAAC;AAAA,KAEpC,CAAC,QAAQ,QAAQ,QAAQ,IAAI,CAC9B;AAAA,EACA,OAAO,EAAE,SAAS,MAAM,aAAa,WAAW;AAAA;",
|
|
12
|
+
"debugId": "78CCEE5359258CEC64756E2164756E21",
|
|
13
|
+
"names": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StepUpConfirmAnswer, StepUpRequestAnswer } from '../../model/step-up-answers';
|
|
2
|
+
/**
|
|
3
|
+
* The step-up route answers both intents from one action, so a fetcher's data
|
|
4
|
+
* is their union: this is the request's answer, or `undefined` for any other.
|
|
5
|
+
*/
|
|
6
|
+
export declare function requestAnswerOf(data: unknown): StepUpRequestAnswer | undefined;
|
|
7
|
+
/** The confirm's answer out of the route's union, or `undefined` for any other. */
|
|
8
|
+
export declare function confirmAnswerOf(data: unknown): StepUpConfirmAnswer | undefined;
|
|
9
|
+
//# sourceMappingURL=answers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"answers.d.ts","sourceRoot":"","sources":["../../../../src/session/react/step-up/answers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,mBAAmB,EACnB,mBAAmB,EACnB,MAAM,6BAA6B,CAAC;AAOrC;;;GAGG;AACH,wBAAgB,eAAe,CAC9B,IAAI,EAAE,OAAO,GACX,mBAAmB,GAAG,SAAS,CAIjC;AAED,mFAAmF;AACnF,wBAAgB,eAAe,CAC9B,IAAI,EAAE,OAAO,GACX,mBAAmB,GAAG,SAAS,CAIjC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { StepUpVia } from '../../model/second-factor';
|
|
2
|
+
import type { StepUpProps } from '../../model/step-up-props';
|
|
3
|
+
import type { StepUpDialogPhase } from './phase';
|
|
4
|
+
import type { useStepUp } from './use-step-up';
|
|
5
|
+
/** What a step-up dialog is given: the phase to show and the handlers. */
|
|
6
|
+
export interface StepUpDialogProps {
|
|
7
|
+
open: boolean;
|
|
8
|
+
phase: StepUpDialogPhase;
|
|
9
|
+
/** How the code is confirmed, in every phase once a challenge was granted (`undefined` before). */
|
|
10
|
+
via: StepUpVia | undefined;
|
|
11
|
+
/** The words of the code form (`stepUpProps`). */
|
|
12
|
+
props: StepUpProps;
|
|
13
|
+
/** The last refusal worded by the server. */
|
|
14
|
+
message: string | undefined;
|
|
15
|
+
busy: boolean;
|
|
16
|
+
/** The code was accepted and the action is being sent again. */
|
|
17
|
+
confirming: boolean;
|
|
18
|
+
onCancel(): void;
|
|
19
|
+
/** "Retry" after a refused request or an over challenge. */
|
|
20
|
+
onRetry(): void;
|
|
21
|
+
onSubmit(code: string): void;
|
|
22
|
+
/** "Resend code", for a mailed code only. */
|
|
23
|
+
onResend: (() => void) | undefined;
|
|
24
|
+
}
|
|
25
|
+
/** The dialog's props out of a step-up: plain, so any host can build them. */
|
|
26
|
+
export declare function dialogPropsOf(stepUp: ReturnType<typeof useStepUp>, open: boolean, cancel: () => void): StepUpDialogProps;
|
|
27
|
+
//# sourceMappingURL=dialog-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog-props.d.ts","sourceRoot":"","sources":["../../../../src/session/react/step-up/dialog-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,0EAA0E;AAC1E,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,iBAAiB,CAAC;IACzB,mGAAmG;IACnG,GAAG,EAAE,SAAS,GAAG,SAAS,CAAC;IAC3B,kDAAkD;IAClD,KAAK,EAAE,WAAW,CAAC;IACnB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,gEAAgE;IAChE,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,IAAI,IAAI,CAAC;IACjB,4DAA4D;IAC5D,OAAO,IAAI,IAAI,CAAC;IAChB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,6CAA6C;IAC7C,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;CACnC;AAED,8EAA8E;AAC9E,wBAAgB,aAAa,CAC5B,MAAM,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,EACpC,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,MAAM,IAAI,GAChB,iBAAiB,CAcnB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { confirmAnswerOf, requestAnswerOf } from './answers';
|
|
2
|
+
export { dialogPropsOf, type StepUpDialogProps } from './dialog-props';
|
|
3
|
+
export { asksStepUp, type StepUpDialogPhase, stepUpDialogPhase } from './phase';
|
|
4
|
+
export { type StepUpChannel, type StepUpOptions, useStepUp, } from './use-step-up';
|
|
5
|
+
export { type StepUpReplayOptions, useStepUpReplay, } from './use-step-up-replay';
|
|
6
|
+
export { type StepUpRunnerOptions, useStepUpRunner, } from './use-step-up-runner';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/session/react/step-up/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAChF,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,SAAS,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,KAAK,mBAAmB,EACxB,eAAe,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,KAAK,mBAAmB,EACxB,eAAe,GACf,MAAM,sBAAsB,CAAC"}
|