@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,588 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isApiErrorLike2,
|
|
3
|
+
isStaleVersion2,
|
|
4
|
+
waitMinutes2,
|
|
5
|
+
retryAfterOf2,
|
|
6
|
+
isThrottledReason2,
|
|
7
|
+
attemptsLeftOf2,
|
|
8
|
+
valuesOf,
|
|
9
|
+
isStatusError,
|
|
10
|
+
isUnavailableError,
|
|
11
|
+
ProblemError2,
|
|
12
|
+
problemError2,
|
|
13
|
+
isProblemErrorLike2,
|
|
14
|
+
REQUEST_ID_HEADER2,
|
|
15
|
+
requestIdOf2,
|
|
16
|
+
routeError2,
|
|
17
|
+
errorRequestId2
|
|
18
|
+
} from "../chunks/index-wyypkfdv.js";
|
|
19
|
+
import {
|
|
20
|
+
fetcherRefusal,
|
|
21
|
+
fetcherResult
|
|
22
|
+
} from "../chunks/index-pghmb2dm.js";
|
|
23
|
+
import {
|
|
24
|
+
nextOf2,
|
|
25
|
+
siteCheck,
|
|
26
|
+
rememberSiteCheck,
|
|
27
|
+
requireSameSite2
|
|
28
|
+
} from "../chunks/index-v2z5k640.js";
|
|
29
|
+
import {
|
|
30
|
+
useJsonFetcher2
|
|
31
|
+
} from "../chunks/index-ajtvyq35.js";
|
|
32
|
+
import {
|
|
33
|
+
isRouteRefusal2,
|
|
34
|
+
routeRefusalStatus2
|
|
35
|
+
} from "../chunks/index-thyabr5n.js";
|
|
36
|
+
// src/errors/code-resolver.ts
|
|
37
|
+
var API_CODE = /^[a-z][a-zA-Z0-9-]*\.errors\.[a-z0-9-]+$/;
|
|
38
|
+
function paramsCode(issue) {
|
|
39
|
+
const code = issue.params?.code;
|
|
40
|
+
return typeof code === "string" ? code : undefined;
|
|
41
|
+
}
|
|
42
|
+
function apiCodeResolver(messages, options) {
|
|
43
|
+
const isApiCode = (key) => options.isApiCode ? options.isApiCode(key) : API_CODE.test(key);
|
|
44
|
+
return {
|
|
45
|
+
translate(key, context, provideLanguage) {
|
|
46
|
+
if (!isApiCode(key))
|
|
47
|
+
return options.translate(key, context, provideLanguage);
|
|
48
|
+
const language = typeof provideLanguage === "function" ? provideLanguage() : provideLanguage ?? options.language();
|
|
49
|
+
return messages.apiMessage(key, context, language) ?? key;
|
|
50
|
+
},
|
|
51
|
+
codeOf(issue) {
|
|
52
|
+
return options.codeOf ? options.codeOf(issue) : paramsCode(issue);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// src/errors/describe-refusal.ts
|
|
58
|
+
function refusalOf(errors, error, language) {
|
|
59
|
+
if (isApiErrorLike2(error)) {
|
|
60
|
+
return {
|
|
61
|
+
message: errors.apiErrorMessage(error, language),
|
|
62
|
+
status: error.status
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
if (error instanceof Response && error.status === 503) {
|
|
66
|
+
return { message: errors.unavailableMessage(language), status: 503 };
|
|
67
|
+
}
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
function fieldErrorsOf(errors, error, language) {
|
|
71
|
+
const extensions = error.errors[0]?.extensions;
|
|
72
|
+
const fields = Array.isArray(extensions?.fields) ? extensions.fields : [];
|
|
73
|
+
if (!fields.length && extensions?.field) {
|
|
74
|
+
return { [extensions.field]: errors.apiErrorMessage(error, language) };
|
|
75
|
+
}
|
|
76
|
+
return Object.fromEntries(fields.map(({ path, code, message, params }) => [
|
|
77
|
+
path,
|
|
78
|
+
errors.translateCode(code, message, language, params)
|
|
79
|
+
]));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// src/errors/field-placement.ts
|
|
83
|
+
function placeFieldErrors(errors, error, language, fieldOf) {
|
|
84
|
+
const byField = {};
|
|
85
|
+
const unplaced = [];
|
|
86
|
+
for (const [path, message] of Object.entries(errors.fieldErrors(error, language))) {
|
|
87
|
+
const field = fieldOf(path);
|
|
88
|
+
if (field)
|
|
89
|
+
byField[field] = message;
|
|
90
|
+
else
|
|
91
|
+
unplaced.push(message);
|
|
92
|
+
}
|
|
93
|
+
return { byField, unplaced };
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// src/errors/form-refusal.ts
|
|
97
|
+
function formRefusal(errors, error, language, fieldOf, route) {
|
|
98
|
+
const { message, status } = fetcherRefusal(errors, error, language, route);
|
|
99
|
+
if (!isApiErrorLike2(error))
|
|
100
|
+
return { error: message, fieldErrors: {}, status };
|
|
101
|
+
const { byField, unplaced } = placeFieldErrors(errors, error, language, fieldOf);
|
|
102
|
+
return {
|
|
103
|
+
error: Object.keys(byField).length && !unplaced.length ? "" : [message, ...unplaced].join(" "),
|
|
104
|
+
fieldErrors: byField,
|
|
105
|
+
status
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// src/errors/submit-form.ts
|
|
110
|
+
import { data } from "react-router";
|
|
111
|
+
async function submitForm(errors, language, run, fieldOf, route) {
|
|
112
|
+
try {
|
|
113
|
+
return { ok: true, value: await run() };
|
|
114
|
+
} catch (error) {
|
|
115
|
+
if (!isApiErrorLike2(error) || error.status === 401) {
|
|
116
|
+
throw routeError2(error, route);
|
|
117
|
+
}
|
|
118
|
+
const field = error.errors[0]?.extensions?.field;
|
|
119
|
+
if (error.status === 404 && !(field && fieldOf(field))) {
|
|
120
|
+
throw routeError2(error, route);
|
|
121
|
+
}
|
|
122
|
+
const { byField, unplaced } = placeFieldErrors(errors, error, language, fieldOf);
|
|
123
|
+
const formError = Object.keys(byField).length && !unplaced.length ? undefined : [errors.apiErrorMessage(error, language), ...unplaced].join(" ");
|
|
124
|
+
return data({ fieldErrors: byField, formError }, { status: error.status });
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// src/errors/describe.ts
|
|
129
|
+
function describeApiErrors({
|
|
130
|
+
messages,
|
|
131
|
+
unavailable,
|
|
132
|
+
refused,
|
|
133
|
+
reword,
|
|
134
|
+
byCode = {},
|
|
135
|
+
isApiCode = (code) => API_CODE.test(code)
|
|
136
|
+
}) {
|
|
137
|
+
const translateCode = (code, fallback, language, values) => {
|
|
138
|
+
if (!code)
|
|
139
|
+
return fallback;
|
|
140
|
+
return messages.apiMessage(code, values, language) ?? fallback;
|
|
141
|
+
};
|
|
142
|
+
const apiErrorMessage = (error, language) => {
|
|
143
|
+
const code = error.code;
|
|
144
|
+
if (refused && (!code || !isApiCode(code)))
|
|
145
|
+
return refused(language);
|
|
146
|
+
const own = code && Object.hasOwn(byCode, code) ? byCode[code] : undefined;
|
|
147
|
+
const values = valuesOf(error.errors[0]?.extensions);
|
|
148
|
+
const text = own ? own(error, language) : translateCode(code, error.message, language, values);
|
|
149
|
+
if (!reword || !code)
|
|
150
|
+
return text;
|
|
151
|
+
return reword(text, error, { code, values: values ?? {}, language }) ?? text;
|
|
152
|
+
};
|
|
153
|
+
const unavailableMessage = (language) => unavailable(language);
|
|
154
|
+
const apiRefusal = (error, language) => refusalOf({ apiErrorMessage, unavailableMessage }, error, language);
|
|
155
|
+
const fieldErrors = (error, language) => fieldErrorsOf({ apiErrorMessage, translateCode }, error, language);
|
|
156
|
+
const parts = { apiRefusal, apiErrorMessage, fieldErrors };
|
|
157
|
+
return {
|
|
158
|
+
translateCode,
|
|
159
|
+
apiErrorMessage,
|
|
160
|
+
unavailableMessage,
|
|
161
|
+
fieldErrors,
|
|
162
|
+
apiRefusal,
|
|
163
|
+
fetcherRefusal: (error, language, route) => fetcherRefusal(parts, error, language, route),
|
|
164
|
+
formRefusal: (error, language, fieldOf, route) => formRefusal(parts, error, language, fieldOf, route),
|
|
165
|
+
fetcherResult: (language, about, run, options) => fetcherResult(parts, language, about, run, options),
|
|
166
|
+
submitForm: (language, run, fieldOf, route) => submitForm(parts, language, run, fieldOf, route)
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// src/errors/api-errors.ts
|
|
171
|
+
function createApiErrors(options) {
|
|
172
|
+
return describeApiErrors(options);
|
|
173
|
+
}
|
|
174
|
+
// src/errors/log.ts
|
|
175
|
+
function quietLog(log, methods) {
|
|
176
|
+
const quiet = {};
|
|
177
|
+
for (const method of methods) {
|
|
178
|
+
quiet[method] = (...args) => {
|
|
179
|
+
try {
|
|
180
|
+
log[method](...args);
|
|
181
|
+
} catch {}
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
return quiet;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// src/errors/call-failure.ts
|
|
188
|
+
var PASSED_THROUGH = new Set([401, 403, 404]);
|
|
189
|
+
var NO_BODY = new Set([101, 204, 205, 304]);
|
|
190
|
+
function apiCallFailure(error, {
|
|
191
|
+
api,
|
|
192
|
+
operation = "operation",
|
|
193
|
+
requestId,
|
|
194
|
+
signal,
|
|
195
|
+
passedThrough = PASSED_THROUGH,
|
|
196
|
+
log: appLog = console
|
|
197
|
+
}) {
|
|
198
|
+
const log = quietLog(appLog, ["warn", "error"]);
|
|
199
|
+
const call = `${api}: ${operation}${requestId ? ` (request ${requestId})` : ""}`;
|
|
200
|
+
const headers = requestId ? { [REQUEST_ID_HEADER2]: requestId } : {};
|
|
201
|
+
const unavailable = (reason, cause) => {
|
|
202
|
+
log.error(`${call} ${reason}`, cause ?? "");
|
|
203
|
+
return new Response(null, { status: 503, headers });
|
|
204
|
+
};
|
|
205
|
+
if (isApiErrorLike2(error)) {
|
|
206
|
+
if (requestId)
|
|
207
|
+
error.requestId = requestId;
|
|
208
|
+
const line = `${call} answered ${error.status}${error.code ? ` ${error.code}` : ""}`;
|
|
209
|
+
if (error.status >= 500)
|
|
210
|
+
log.error(line);
|
|
211
|
+
else
|
|
212
|
+
log.warn(line);
|
|
213
|
+
return error;
|
|
214
|
+
}
|
|
215
|
+
if (isProblemErrorLike2(error)) {
|
|
216
|
+
if (requestId)
|
|
217
|
+
error.requestId = requestId;
|
|
218
|
+
const line = `${call} answered ${error.status}`;
|
|
219
|
+
if (error.status >= 500)
|
|
220
|
+
log.error(line);
|
|
221
|
+
else
|
|
222
|
+
log.warn(line);
|
|
223
|
+
return error;
|
|
224
|
+
}
|
|
225
|
+
if (isStatusError(error)) {
|
|
226
|
+
if (passedThrough.has(error.status)) {
|
|
227
|
+
log.warn(`${call} answered ${error.status}`);
|
|
228
|
+
const statusText = typeof error.statusText === "string" ? error.statusText : "";
|
|
229
|
+
if (NO_BODY.has(error.status)) {
|
|
230
|
+
return new Response(null, {
|
|
231
|
+
status: error.status,
|
|
232
|
+
statusText,
|
|
233
|
+
headers
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
return new Response(statusText, {
|
|
237
|
+
status: error.status,
|
|
238
|
+
statusText,
|
|
239
|
+
headers
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
return unavailable(`answered ${error.status} without GraphQL`, error.body);
|
|
243
|
+
}
|
|
244
|
+
if (isUnavailableError(error))
|
|
245
|
+
return unavailable(error.reason, error.cause);
|
|
246
|
+
if (signal?.aborted)
|
|
247
|
+
return unavailable("aborted", error);
|
|
248
|
+
return error;
|
|
249
|
+
}
|
|
250
|
+
function operationName(document) {
|
|
251
|
+
for (const definition of document.definitions) {
|
|
252
|
+
if (definition.kind === "OperationDefinition") {
|
|
253
|
+
return definition.name?.value ?? definition.operation ?? "operation";
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return "operation";
|
|
257
|
+
}
|
|
258
|
+
// src/errors/catalogue-check.ts
|
|
259
|
+
async function checkVersions({ reader, versions, ttl, retryMs, log }, now) {
|
|
260
|
+
try {
|
|
261
|
+
const latest = await versions();
|
|
262
|
+
for (const [language, entry] of [...reader.held]) {
|
|
263
|
+
if (latest[language] !== entry.version) {
|
|
264
|
+
await reader.load(language, now);
|
|
265
|
+
} else {
|
|
266
|
+
entry.checkedAt = now;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
} catch (error) {
|
|
270
|
+
log.error("alxia-react-router: the error catalogue was not checked, keeping what is held", error);
|
|
271
|
+
for (const entry of reader.held.values()) {
|
|
272
|
+
entry.checkedAt = now - ttl() + retryMs;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function safeTtl(ttlMs, fallback, log) {
|
|
277
|
+
return () => {
|
|
278
|
+
try {
|
|
279
|
+
const ttl = typeof ttlMs === "function" ? ttlMs() : ttlMs;
|
|
280
|
+
if (typeof ttl === "number" && Number.isFinite(ttl) && ttl >= 0) {
|
|
281
|
+
return ttl;
|
|
282
|
+
}
|
|
283
|
+
log.error("alxia-react-router: ttlMs is not a duration, using retryMs");
|
|
284
|
+
} catch (error) {
|
|
285
|
+
log.error("alxia-react-router: ttlMs threw, using retryMs", error);
|
|
286
|
+
}
|
|
287
|
+
return fallback;
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// src/errors/catalogue-read.ts
|
|
292
|
+
async function boundedWait(pending, firstReadWaitMs) {
|
|
293
|
+
const left = firstReadWaitMs - (performance.now() - pending.started);
|
|
294
|
+
if (left <= 0)
|
|
295
|
+
return;
|
|
296
|
+
let timer;
|
|
297
|
+
const limit = new Promise((resolve) => {
|
|
298
|
+
timer = setTimeout(resolve, left);
|
|
299
|
+
});
|
|
300
|
+
await Promise.race([pending.read, limit]);
|
|
301
|
+
clearTimeout(timer);
|
|
302
|
+
}
|
|
303
|
+
function createCatalogueReader({
|
|
304
|
+
messages,
|
|
305
|
+
read,
|
|
306
|
+
retryMs,
|
|
307
|
+
firstReadWaitMs,
|
|
308
|
+
log
|
|
309
|
+
}) {
|
|
310
|
+
const held = new Map;
|
|
311
|
+
const loading = new Map;
|
|
312
|
+
const failedAt = new Map;
|
|
313
|
+
async function load(language, now) {
|
|
314
|
+
const reply = await read(language);
|
|
315
|
+
const entries = Object.create(null);
|
|
316
|
+
for (const { code, message, params } of reply.messages) {
|
|
317
|
+
entries[code] = { message, params };
|
|
318
|
+
}
|
|
319
|
+
messages.set(language, entries);
|
|
320
|
+
held.set(language, { version: reply.version, checkedAt: now });
|
|
321
|
+
}
|
|
322
|
+
function loadOnce(language, now) {
|
|
323
|
+
let pending = loading.get(language);
|
|
324
|
+
if (!pending) {
|
|
325
|
+
const started = performance.now();
|
|
326
|
+
const reading = load(language, now).then(() => {
|
|
327
|
+
failedAt.delete(language);
|
|
328
|
+
}).catch((error) => {
|
|
329
|
+
failedAt.set(language, now + (performance.now() - started));
|
|
330
|
+
log.error(`alxia-react-router: the error catalogue (${language}) was not read`, error);
|
|
331
|
+
}).finally(() => {
|
|
332
|
+
loading.delete(language);
|
|
333
|
+
});
|
|
334
|
+
pending = { read: reading, started };
|
|
335
|
+
loading.set(language, pending);
|
|
336
|
+
}
|
|
337
|
+
return pending;
|
|
338
|
+
}
|
|
339
|
+
return {
|
|
340
|
+
held,
|
|
341
|
+
load,
|
|
342
|
+
async first(language, now) {
|
|
343
|
+
const failed = failedAt.get(language);
|
|
344
|
+
if (failed === undefined || now - failed >= retryMs) {
|
|
345
|
+
await boundedWait(loadOnce(language, now), firstReadWaitMs);
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
reset() {
|
|
349
|
+
held.clear();
|
|
350
|
+
loading.clear();
|
|
351
|
+
failedAt.clear();
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// src/errors/catalogue.ts
|
|
357
|
+
function clientMessages(messages, languages, clientCodes) {
|
|
358
|
+
const byLanguage = {};
|
|
359
|
+
for (const language of languages) {
|
|
360
|
+
const entries = Object.create(null);
|
|
361
|
+
for (const code of clientCodes) {
|
|
362
|
+
const entry = messages.messageOf(language, code);
|
|
363
|
+
if (entry)
|
|
364
|
+
entries[code] = entry;
|
|
365
|
+
}
|
|
366
|
+
byLanguage[language] = entries;
|
|
367
|
+
}
|
|
368
|
+
return byLanguage;
|
|
369
|
+
}
|
|
370
|
+
function createErrorCatalogue({
|
|
371
|
+
messages,
|
|
372
|
+
languages,
|
|
373
|
+
read,
|
|
374
|
+
versions,
|
|
375
|
+
ttlMs,
|
|
376
|
+
retryMs = 5000,
|
|
377
|
+
firstReadWaitMs = 1500,
|
|
378
|
+
clientCodes,
|
|
379
|
+
log: appLog = console
|
|
380
|
+
}) {
|
|
381
|
+
if (languages.length === 0) {
|
|
382
|
+
throw new TypeError("createErrorCatalogue(): needs at least one language.");
|
|
383
|
+
}
|
|
384
|
+
const log = quietLog(appLog, ["error"]);
|
|
385
|
+
const ttl = safeTtl(ttlMs, retryMs, log);
|
|
386
|
+
const reader = createCatalogueReader({
|
|
387
|
+
messages,
|
|
388
|
+
read,
|
|
389
|
+
retryMs,
|
|
390
|
+
firstReadWaitMs,
|
|
391
|
+
log
|
|
392
|
+
});
|
|
393
|
+
const context = { reader, versions, ttl, retryMs, log };
|
|
394
|
+
let checking;
|
|
395
|
+
async function fresh(language, now = Date.now()) {
|
|
396
|
+
const entry = reader.held.get(language);
|
|
397
|
+
if (!entry)
|
|
398
|
+
return reader.first(language, now);
|
|
399
|
+
if (now - entry.checkedAt >= ttl() && !checking) {
|
|
400
|
+
checking = checkVersions(context, now).finally(() => {
|
|
401
|
+
checking = undefined;
|
|
402
|
+
}).catch(() => {});
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
const freshAll = async (now = Date.now()) => {
|
|
406
|
+
await Promise.all(languages.map((language) => fresh(language, now)));
|
|
407
|
+
};
|
|
408
|
+
return {
|
|
409
|
+
fresh,
|
|
410
|
+
freshAll,
|
|
411
|
+
warm() {
|
|
412
|
+
freshAll().catch((error) => {
|
|
413
|
+
log.error("alxia-react-router: the error catalogue was not warmed", error);
|
|
414
|
+
});
|
|
415
|
+
},
|
|
416
|
+
clientMessages: () => clientMessages(messages, languages, clientCodes),
|
|
417
|
+
reset() {
|
|
418
|
+
reader.reset();
|
|
419
|
+
checking = undefined;
|
|
420
|
+
messages.clear();
|
|
421
|
+
},
|
|
422
|
+
heldVersion: (language) => reader.held.get(language)?.version,
|
|
423
|
+
settled: () => checking ?? Promise.resolve()
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
// src/errors/json-actions.ts
|
|
427
|
+
import { data as data2, redirect } from "react-router";
|
|
428
|
+
function jsonActions(options = {}) {
|
|
429
|
+
const crossSite = siteCheck(options.origin);
|
|
430
|
+
const isJson = (request) => request.headers.get("content-type")?.startsWith("application/json");
|
|
431
|
+
async function readJson(request) {
|
|
432
|
+
crossSite(request);
|
|
433
|
+
if (!isJson(request)) {
|
|
434
|
+
throw data2("Expected a JSON body", { status: 415 });
|
|
435
|
+
}
|
|
436
|
+
return request.json().catch(() => {
|
|
437
|
+
throw data2("Malformed JSON body", { status: 400 });
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
const actions = {
|
|
441
|
+
readJson,
|
|
442
|
+
requireJsonPost(request) {
|
|
443
|
+
if (!isJson(request))
|
|
444
|
+
throw redirect(nextOf2(request.url));
|
|
445
|
+
},
|
|
446
|
+
async readInput(request, schema) {
|
|
447
|
+
const body = await readJson(request);
|
|
448
|
+
const result = await schema["~standard"].validate(body?.input);
|
|
449
|
+
if (result.issues) {
|
|
450
|
+
throw data2("The form sent an input the API would refuse", {
|
|
451
|
+
status: 400
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
return result.value;
|
|
455
|
+
}
|
|
456
|
+
};
|
|
457
|
+
rememberSiteCheck(actions, crossSite);
|
|
458
|
+
return actions;
|
|
459
|
+
}
|
|
460
|
+
// src/errors/message-values.ts
|
|
461
|
+
var DAY = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
462
|
+
function dayOf(value) {
|
|
463
|
+
const parts = DAY.exec(value);
|
|
464
|
+
if (!parts)
|
|
465
|
+
return;
|
|
466
|
+
return new Date(Number(parts[1]), Number(parts[2]) - 1, Number(parts[3]));
|
|
467
|
+
}
|
|
468
|
+
function valuesFor(params, values) {
|
|
469
|
+
const worded = { ...values };
|
|
470
|
+
for (const { name, kind } of params) {
|
|
471
|
+
const value = values[name];
|
|
472
|
+
if (typeof value !== "string")
|
|
473
|
+
continue;
|
|
474
|
+
if (kind === "DATE") {
|
|
475
|
+
const day = dayOf(value);
|
|
476
|
+
if (day)
|
|
477
|
+
worded[name] = day;
|
|
478
|
+
} else if ((kind === "NUMBER" || kind === "PLURAL") && value.trim() !== "" && !Number.isNaN(Number(value))) {
|
|
479
|
+
worded[name] = Number(value);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
return worded;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// src/errors/messages.ts
|
|
486
|
+
function createApiMessages({
|
|
487
|
+
format
|
|
488
|
+
}) {
|
|
489
|
+
const catalogues = new Map;
|
|
490
|
+
const messageOf = (language, code) => catalogues.get(language)?.get(code);
|
|
491
|
+
function formatEntry(entry, values, language) {
|
|
492
|
+
const worded = valuesFor(entry.params, values ?? {});
|
|
493
|
+
let failed = false;
|
|
494
|
+
try {
|
|
495
|
+
const text = format(entry.message, language, worded, {
|
|
496
|
+
onError: () => {
|
|
497
|
+
failed = true;
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
return failed ? undefined : text;
|
|
501
|
+
} catch {
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
return {
|
|
506
|
+
set(language, messages) {
|
|
507
|
+
catalogues.set(language, new Map(Object.entries(messages)));
|
|
508
|
+
},
|
|
509
|
+
add(language, messages) {
|
|
510
|
+
const held = catalogues.get(language) ?? new Map;
|
|
511
|
+
for (const [code, message] of Object.entries(messages)) {
|
|
512
|
+
held.set(code, message);
|
|
513
|
+
}
|
|
514
|
+
catalogues.set(language, held);
|
|
515
|
+
},
|
|
516
|
+
clear() {
|
|
517
|
+
catalogues.clear();
|
|
518
|
+
},
|
|
519
|
+
messageOf,
|
|
520
|
+
format: formatEntry,
|
|
521
|
+
apiMessage(code, values, language) {
|
|
522
|
+
const entry = messageOf(language, code);
|
|
523
|
+
return entry ? formatEntry(entry, values, language) : undefined;
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
// src/errors/provider.ts
|
|
528
|
+
function ApiMessagesProvider({
|
|
529
|
+
messages,
|
|
530
|
+
value,
|
|
531
|
+
children
|
|
532
|
+
}) {
|
|
533
|
+
const inBrowser = typeof globalThis.document !== "undefined";
|
|
534
|
+
if (value && inBrowser) {
|
|
535
|
+
for (const [language, held] of Object.entries(value)) {
|
|
536
|
+
messages.add(language, held);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
return children;
|
|
540
|
+
}
|
|
541
|
+
// src/errors/section-action.ts
|
|
542
|
+
import { data as data3 } from "react-router";
|
|
543
|
+
async function sectionAction(errors, language, intent, run, { fieldOf, isStale }) {
|
|
544
|
+
try {
|
|
545
|
+
await run();
|
|
546
|
+
return { ok: true, intent };
|
|
547
|
+
} catch (error) {
|
|
548
|
+
const { status, ...refusal } = formRefusal(errors, error, language, fieldOf);
|
|
549
|
+
return data3({
|
|
550
|
+
ok: false,
|
|
551
|
+
intent,
|
|
552
|
+
stale: isStale(error),
|
|
553
|
+
...refusal
|
|
554
|
+
}, { status });
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
export {
|
|
558
|
+
ApiMessagesProvider,
|
|
559
|
+
ProblemError2 as ProblemError,
|
|
560
|
+
REQUEST_ID_HEADER2 as REQUEST_ID_HEADER,
|
|
561
|
+
apiCallFailure,
|
|
562
|
+
apiCodeResolver,
|
|
563
|
+
attemptsLeftOf2 as attemptsLeftOf,
|
|
564
|
+
createApiErrors,
|
|
565
|
+
createApiMessages,
|
|
566
|
+
createErrorCatalogue,
|
|
567
|
+
errorRequestId2 as errorRequestId,
|
|
568
|
+
isApiErrorLike2 as isApiErrorLike,
|
|
569
|
+
isProblemErrorLike2 as isProblemErrorLike,
|
|
570
|
+
isRouteRefusal2 as isRouteRefusal,
|
|
571
|
+
isStaleVersion2 as isStaleVersion,
|
|
572
|
+
isThrottledReason2 as isThrottledReason,
|
|
573
|
+
jsonActions,
|
|
574
|
+
nextOf2 as nextOf,
|
|
575
|
+
operationName,
|
|
576
|
+
problemError2 as problemError,
|
|
577
|
+
requestIdOf2 as requestIdOf,
|
|
578
|
+
requireSameSite2 as requireSameSite,
|
|
579
|
+
retryAfterOf2 as retryAfterOf,
|
|
580
|
+
routeError2 as routeError,
|
|
581
|
+
routeRefusalStatus2 as routeRefusalStatus,
|
|
582
|
+
sectionAction,
|
|
583
|
+
useJsonFetcher2 as useJsonFetcher,
|
|
584
|
+
waitMinutes2 as waitMinutes
|
|
585
|
+
};
|
|
586
|
+
|
|
587
|
+
//# debugId=29CC739BED3AAC8864756E2164756E21
|
|
588
|
+
//# sourceMappingURL=index.js.map
|