diff --git a/babel.config.js b/babel.config.js index 42ac49c7b..fa28f52c1 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + module.exports = { presets: [ ["@babel/preset-env", { targets: { node: "current" } }], diff --git a/examples/nextjs-spa/src/pages/settings.tsx b/examples/nextjs-spa/src/pages/settings.tsx index 6bf31ae03..b125d44f5 100644 --- a/examples/nextjs-spa/src/pages/settings.tsx +++ b/examples/nextjs-spa/src/pages/settings.tsx @@ -121,7 +121,7 @@ const Settings: NextPageWithLayout = () => { // include scripts for webauthn support includeScripts={true} // submit the form data the user provides to Ory - onSubmit={({ body }) => onSubmit(body)} + onSubmit={({ body }) => onSubmit(body as UpdateSettingsFlowBody)} /> ))} diff --git a/examples/nextjs-spa/src/pkg/hooks.tsx b/examples/nextjs-spa/src/pkg/hooks.tsx index 96bc7fe11..b05110d27 100644 --- a/examples/nextjs-spa/src/pkg/hooks.tsx +++ b/examples/nextjs-spa/src/pkg/hooks.tsx @@ -11,7 +11,9 @@ export const HandleError = ( defaultNav: string | undefined = undefined, fatalToError = false, ) => { - return async (error: AxiosError): Promise => { + return async ( + error: AxiosError, + ): Promise => { if (!error.response || error.response?.status === 0) { window.location.href = `/error?error=${encodeURIComponent( JSON.stringify(error.response), diff --git a/examples/preact-spa/package.json b/examples/preact-spa/package.json index 495f6899c..f53f5469b 100644 --- a/examples/preact-spa/package.json +++ b/examples/preact-spa/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "preact": "10.13.1", - "wouter": "2.10.0" + "wouter-preact": "3.0.1" }, "devDependencies": { "@ory/elements-preact": "*", diff --git a/examples/preact-spa/src/main.tsx b/examples/preact-spa/src/main.tsx index 514cf80a6..d9414dfbd 100644 --- a/examples/preact-spa/src/main.tsx +++ b/examples/preact-spa/src/main.tsx @@ -2,7 +2,7 @@ import "@ory/elements-preact/assets/normalize.css" import { render } from "preact" -import { Route, Router } from "wouter/preact" +import { Route, Router } from "wouter-preact" import { Dashboard } from "./app" import { Error } from "./error" import "./index.css" diff --git a/examples/preact-spa/src/sdk.ts b/examples/preact-spa/src/sdk.ts index d954f7177..b04dec942 100644 --- a/examples/preact-spa/src/sdk.ts +++ b/examples/preact-spa/src/sdk.ts @@ -33,7 +33,7 @@ export const sdkError = ( const [location, setLocation] = useLocation() return useCallback( - (error: AxiosError): Promise => { + (error: AxiosError): Promise => { const responseData = error.response?.data || {} switch (error.response?.status) { diff --git a/examples/preact-spa/src/settings.tsx b/examples/preact-spa/src/settings.tsx index 68a3674fe..d2b23c96a 100644 --- a/examples/preact-spa/src/settings.tsx +++ b/examples/preact-spa/src/settings.tsx @@ -85,7 +85,7 @@ export const Settings = () => { flow={flow} method={flowType} includeScripts={true} - onSubmit={({ body }) => onSubmit(body)} + onSubmit={({ body }) => onSubmit(body as UpdateSettingsFlowBody)} /> ))} diff --git a/examples/react-spa/src/Settings.tsx b/examples/react-spa/src/Settings.tsx index 788cc87fb..fc39fe6f5 100644 --- a/examples/react-spa/src/Settings.tsx +++ b/examples/react-spa/src/Settings.tsx @@ -93,7 +93,7 @@ export const Settings = () => { // include scripts for webauthn support includeScripts={true} // submit the form data the user provides to Ory - onSubmit={({ body }) => onSubmit(body)} + onSubmit={({ body }) => onSubmit(body as UpdateSettingsFlowBody)} /> ))} diff --git a/examples/react-spa/src/sdk.ts b/examples/react-spa/src/sdk.ts index 03ece6911..9ec72a89e 100644 --- a/examples/react-spa/src/sdk.ts +++ b/examples/react-spa/src/sdk.ts @@ -34,7 +34,7 @@ export const sdkError = ( const navigate = useNavigate() return useCallback( - (error: AxiosError): Promise => { + (error: AxiosError): Promise => { const responseData = error.response?.data || {} switch (error.response?.status) { diff --git a/jest.config.js b/jest.config.js index 7f6c1a090..da494f944 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + /* * For a detailed explanation regarding each configuration property, visit: * https://jestjs.io/docs/configuration diff --git a/package-lock.json b/package-lock.json index a3e58f917..879fbcd9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@babel/core": "7.18.10", "@babel/preset-typescript": "7.23.3", "@formatjs/cli-lib": "6.3.3", - "@ory/client": "1.2.10", + "@ory/client": "1.6.2", "@playwright/experimental-ct-react": "1.38.0", "@playwright/test": "1.38.0", "@preact/preset-vite": "2.5.0", @@ -188,7 +188,7 @@ "version": "0.0.0", "dependencies": { "preact": "10.13.1", - "wouter": "2.10.0" + "wouter-preact": "3.0.1" }, "devDependencies": { "@ory/elements-preact": "*", @@ -4247,6 +4247,7 @@ }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.14", + "dev": true, "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { @@ -7736,21 +7737,12 @@ } }, "node_modules/@ory/client": { - "version": "1.2.10", - "resolved": "https://registry.npmjs.org/@ory/client/-/client-1.2.10.tgz", - "integrity": "sha512-BcbHrKifOom1nPhF3GPmIY619IioGyHHbyeSFb5AgcIa0PI1z4XPLkjDrXlckrx01c3fHxY2stzwJDEAavPrqA==", - "dev": true, - "dependencies": { - "axios": "^0.21.4" - } - }, - "node_modules/@ory/client/node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/@ory/client/-/client-1.6.2.tgz", + "integrity": "sha512-eeSkFZsrX/hLaariBg2I9PQWueE9IVAV3Tps5UE7CYEvrGziFB1zdv8joQDGMss5O3Yv/CSlSf4rOwTeENDqBg==", "dev": true, "dependencies": { - "follow-redirects": "^1.14.0" + "axios": "^1.6.1" } }, "node_modules/@ory/elements": { @@ -8596,49 +8588,6 @@ "node": ">=14" } }, - "node_modules/@rollup/plugin-replace": { - "version": "5.0.2", - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^5.0.1", - "magic-string": "^0.27.0" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rollup/plugin-replace/node_modules/@rollup/pluginutils": { - "version": "5.0.2", - "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.0", - "estree-walker": "^2.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rollup/plugin-replace/node_modules/@types/estree": { - "version": "1.0.0", - "license": "MIT" - }, "node_modules/@rollup/pluginutils": { "version": "4.2.1", "dev": true, @@ -16391,6 +16340,7 @@ }, "node_modules/estree-walker": { "version": "2.0.2", + "dev": true, "license": "MIT" }, "node_modules/esutils": { @@ -20254,6 +20204,7 @@ }, "node_modules/magic-string": { "version": "0.27.0", + "dev": true, "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.13" @@ -20681,6 +20632,11 @@ "dev": true, "license": "ISC" }, + "node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==" + }, "node_modules/mkdirp": { "version": "1.0.4", "dev": true, @@ -23536,6 +23492,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/regexparam": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/regexparam/-/regexparam-3.0.0.tgz", + "integrity": "sha512-RSYAtP31mvYLkAHrOlh25pCNQ5hWnT106VukGaaFfuJrZFkGRX5GhUAdPqpSDXxOhA2c4akmRuplv1mRqnBn6Q==", + "engines": { + "node": ">=8" + } + }, "node_modules/regexpp": { "version": "3.2.0", "license": "MIT", @@ -25425,13 +25389,6 @@ } } }, - "node_modules/use-sync-external-store": { - "version": "1.2.0", - "license": "MIT", - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/util": { "version": "0.12.5", "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", @@ -25910,15 +25867,16 @@ "dev": true, "license": "MIT" }, - "node_modules/wouter": { - "version": "2.10.0", - "license": "ISC", + "node_modules/wouter-preact": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/wouter-preact/-/wouter-preact-3.0.1.tgz", + "integrity": "sha512-nfNhl3IKtDEAFW8fKKbdsYRoqhR6zIhJ5EK0Mv/6dyIrhQ9iEm5ibOBmozAnwbQFHFZ6csMPW87C1K6v5vPhqA==", "dependencies": { - "@rollup/plugin-replace": "^5.0.2", - "use-sync-external-store": "^1.0.0" + "mitt": "^3.0.1", + "regexparam": "^3.0.0" }, "peerDependencies": { - "react": ">=16.8.0" + "preact": "^10.0.0" } }, "node_modules/wrap-ansi": { diff --git a/package.json b/package.json index 04c760a8a..c6be87fde 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@babel/core": "7.18.10", "@babel/preset-typescript": "7.23.3", "@formatjs/cli-lib": "6.3.3", - "@ory/client": "1.2.10", + "@ory/client": "1.6.2", "@playwright/experimental-ct-react": "1.38.0", "@playwright/test": "1.38.0", "@preact/preset-vite": "2.5.0", diff --git a/src/ui/index.test.ts b/src/ui/index.test.ts index 331ea0c97..1fbc488aa 100644 --- a/src/ui/index.test.ts +++ b/src/ui/index.test.ts @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + import { UiNode } from "@ory/client" import { filterNodesByGroups, FilterNodesByGroups, getNodeLabel } from "./index" import nodes from "./fixtures/nodes.json" diff --git a/src/ui/index.ts b/src/ui/index.ts index b999749ca..971efd71b 100644 --- a/src/ui/index.ts +++ b/src/ui/index.ts @@ -1,3 +1,6 @@ +// Copyright © 2024 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + import type { UiNode, UiNodeAnchorAttributes,