From 6a551bd84a78d3d098e69492160427d38d60e12f Mon Sep 17 00:00:00 2001 From: Jonas Hungershausen Date: Mon, 12 Dec 2022 15:37:56 +0100 Subject: [PATCH] chore: update SDK to V1 (#56) * chore: update SDK to V1 * chore: update client * chore: fix examples --- Makefile | 14 + README.md | 75 ++- contrib/sdk/.gitignore | 2 + contrib/sdk/typescript.yml | 7 + examples/preact-spa/src/app.tsx | 2 +- examples/preact-spa/src/login.tsx | 20 +- examples/preact-spa/src/recovery.tsx | 17 +- examples/preact-spa/src/register.tsx | 17 +- examples/preact-spa/src/sdk.ts | 4 +- examples/preact-spa/src/settings.tsx | 31 +- examples/preact-spa/src/verification.tsx | 6 +- examples/react-spa/src/Dashboard.tsx | 2 +- examples/react-spa/src/Login.tsx | 21 +- examples/react-spa/src/Recovery.tsx | 22 +- examples/react-spa/src/Registration.tsx | 22 +- examples/react-spa/src/Settings.tsx | 15 +- examples/react-spa/src/Verification.tsx | 22 +- examples/react-spa/src/sdk.ts | 4 +- openapitools.json | 7 + package-lock.json | 595 ++++++++++-------- package.json | 4 +- src/react-components/ory/helpers/types.ts | 20 +- .../ory/helpers/user-auth-form.tsx | 30 +- src/react-components/ory/user-auth-card.tsx | 10 +- src/react-components/ory/user-error-card.tsx | 4 +- .../ory/user-settings-card.tsx | 4 +- 26 files changed, 547 insertions(+), 430 deletions(-) create mode 100644 contrib/sdk/.gitignore create mode 100644 contrib/sdk/typescript.yml create mode 100644 openapitools.json diff --git a/Makefile b/Makefile index f4333a5f9..c0d4c121a 100644 --- a/Makefile +++ b/Makefile @@ -30,3 +30,17 @@ licenses: .bin/licenses node_modules # checks open-source licenses node_modules: package-lock.json npm ci touch node_modules + +build-sdk: + (cd $$KRATOS_DIR; make sdk) + cp $$KRATOS_DIR/spec/api.json ./contrib/sdk/api.json + npx @openapitools/openapi-generator-cli generate -i "./contrib/sdk/api.json" \ + -g typescript-axios \ + -o "./contrib/sdk/generated" \ + --git-user-id ory \ + --git-repo-id sdk \ + --git-host github.com \ + -c ./contrib/sdk/typescript.yml + (cd ./contrib/sdk/generated; npm i; npm run build) + rm -rf node_modules/@ory/kratos-client/* + cp -r ./contrib/sdk/generated/* node_modules/@ory/client diff --git a/README.md b/README.md index d753df925..1e0f89a5e 100644 --- a/README.md +++ b/README.md @@ -166,13 +166,24 @@ var dividerStyle = createRuntimeFn({ }) ``` -And the gO .\_3ldkmt0 { display: block; text-align: center; overflow: hidden; -box-sizing: border-box; border: 0; border-top: 0.25rem solid; border-color: -var(--ory-theme-border-def); width: 4rem; } +And the CSS. -.\_3ldkmt1 { width: 100%; } +```css +gO .\_3ldkmt0 { + display: block; + text-align: center; + overflow: hidden; + box-sizing: border-box; + border: 0; + border-top: 0.25rem solid; + border-color: var(--ory-theme-border-def); + width: 4rem; +} -```` +.\_3ldkmt1 { + width: 100%; +} +``` ### Overriding Styles @@ -210,7 +221,7 @@ This means we can overwrite them inside the project consuming the library! --ory-theme-input-placeholder: #9e9e9e; --ory-theme-input-text: #424242; } -```` +``` Inside our components we provide the `` which exposes the `themeOverrides` property so that you can implement your own theme. @@ -357,3 +368,55 @@ and are sometimes required by a component. An example is the Ory Elements uses a fully automatic release publishing pipeline. All that is necessary is to create a new release on GitHub after which the workflow runs all the necessary steps to release the modules to the NPM registry. + +## Using local Ory SDKs + +Most of the time, new features to this repository need some work in the +corresponding Ory products to work. To make the development cycle more +productive, it's possible to generate the SDK from a local OpenAPI/Swagger spec +file. + +```bash +export KRATOS_DIR=/path/to/kratos # point this variable to the root of your local Kratos clone + +make build-sdk +``` + +This copies the current OpenAPI spec from the local Kratos repository to the +current Elements directory (`./contrib/sdk/api.json`). + +After that it generates the Typescript SDK according to the spec and copies it +to the `node_modules` directory. This overrides the currently installed module! + +Now you can use the updated SDK without publishing to NPM first. + +## Testing `@ory/elements` changes locally + +To test local changes in `@ory/elements` in a local Ory examples repository you +can point NPM to use a local directory instead of a remote package from the +registry. + +This requires to first build `@ory/elements`: + +```bash +# In your cloned elements directory +npm run build # or more specialized `npm run build:react, etc.` +``` + +Make sure, that the build passed without errors! + +After that, you can set the path to elements in the `package.json` of your +project: + +```shell +npm i /path/to/elements/packages/markup + +# or for preact +# npm i /path/to/elements/packages/preact + +# or for react +# npm i /path/to/elements/packages/react +``` + +Make sure to not commit these changes, as they will break on CI or on other +machines that have a different setup. diff --git a/contrib/sdk/.gitignore b/contrib/sdk/.gitignore new file mode 100644 index 000000000..8aa49c2e9 --- /dev/null +++ b/contrib/sdk/.gitignore @@ -0,0 +1,2 @@ +generated/ +api.json diff --git a/contrib/sdk/typescript.yml b/contrib/sdk/typescript.yml new file mode 100644 index 000000000..f3ebfc9f7 --- /dev/null +++ b/contrib/sdk/typescript.yml @@ -0,0 +1,7 @@ +npmName: "@ory/client" +npmVersion: v0.0.1 +supportsES6: true +ensureUniqueParams: true +modelPropertyNaming: original +disallowAdditionalPropertiesIfNotPresent: false +withInterfaces: true diff --git a/examples/preact-spa/src/app.tsx b/examples/preact-spa/src/app.tsx index 10f8c9b45..93931490d 100644 --- a/examples/preact-spa/src/app.tsx +++ b/examples/preact-spa/src/app.tsx @@ -28,7 +28,7 @@ export const Dashboard = () => { useEffect(() => { sdk - .createSelfServiceLogoutFlowUrlForBrowsers(undefined, { + .createBrowserLogoutFlow(undefined, { params: { return_url: "/", }, diff --git a/examples/preact-spa/src/login.tsx b/examples/preact-spa/src/login.tsx index 5609d901a..aec259a83 100644 --- a/examples/preact-spa/src/login.tsx +++ b/examples/preact-spa/src/login.tsx @@ -1,24 +1,18 @@ -import { - SelfServiceLoginFlow, - SubmitSelfServiceLoginFlowBody, -} from "@ory/client" +import { LoginFlow, UpdateLoginFlowBody } from "@ory/client" import { UserAuthCard } from "@ory/elements-preact" import { useCallback, useEffect, useState } from "preact/hooks" import sdk from "./sdk" import { useLocation } from "wouter" export const Login = () => { - const [flow, setFlow] = useState(null) + const [flow, setFlow] = useState(null) const [location, setLocation] = useLocation() const handleFlow = useCallback( ({ refresh, mfa }: { refresh: boolean; mfa: boolean }) => { return sdk - .initializeSelfServiceLoginFlowForBrowsers( - refresh, - mfa ? "aal2" : "aal1", - ) + .createBrowserLoginFlow({ refresh, aal: mfa ? "aal2" : "aal1" }) .then(({ data: flow }) => flow) }, [], @@ -56,10 +50,10 @@ export const Login = () => { includeScripts={true} onSubmit={({ body }) => { sdk - .submitSelfServiceLoginFlow( - flow.id, - body as SubmitSelfServiceLoginFlowBody, - ) + .updateLoginFlow({ + flow: flow.id, + updateLoginFlowBody: body as UpdateLoginFlowBody, + }) .then(() => { // we successfully submitted the login flow, so lets redirect to the dashboard setLocation("/", { replace: true }) diff --git a/examples/preact-spa/src/recovery.tsx b/examples/preact-spa/src/recovery.tsx index 0352198c6..279254fb9 100644 --- a/examples/preact-spa/src/recovery.tsx +++ b/examples/preact-spa/src/recovery.tsx @@ -1,20 +1,17 @@ -import { - SelfServiceRecoveryFlow, - SubmitSelfServiceRecoveryFlowBody, -} from "@ory/client" +import { RecoveryFlow, UpdateRecoveryFlowBody } from "@ory/client" import { UserAuthCard } from "@ory/elements-preact" import { useEffect, useState } from "preact/hooks" import { useLocation } from "wouter" import sdk from "./sdk" export const Recovery = () => { - const [flow, setFlow] = useState(null) + const [flow, setFlow] = useState(null) const [location, setLocation] = useLocation() useEffect(() => { sdk - .initializeSelfServiceRecoveryFlowForBrowsers() + .createBrowserRecoveryFlow() .then(({ data: flow }) => { setFlow(flow) }) @@ -31,10 +28,10 @@ export const Recovery = () => { additionalProps={{ loginURL: "/login" }} onSubmit={({ body }) => { sdk - .submitSelfServiceRecoveryFlow( - flow.id, - body as SubmitSelfServiceRecoveryFlowBody, - ) + .updateRecoveryFlow({ + flow: flow.id, + updateRecoveryFlowBody: body as UpdateRecoveryFlowBody, + }) .then(() => { // we successfully submitted the login flow, so lets redirect to the dashboard setLocation("/", { replace: true }) diff --git a/examples/preact-spa/src/register.tsx b/examples/preact-spa/src/register.tsx index 90e0228b8..cdbe39a94 100644 --- a/examples/preact-spa/src/register.tsx +++ b/examples/preact-spa/src/register.tsx @@ -1,20 +1,17 @@ -import { - SelfServiceRegistrationFlow, - SubmitSelfServiceRegistrationFlowBody, -} from "@ory/client" +import { RegistrationFlow, UpdateRegistrationFlowBody } from "@ory/client" import { UserAuthCard } from "@ory/elements-preact" import { useEffect, useState } from "preact/hooks" import sdk from "./sdk" import { useLocation } from "wouter" export const Register = () => { - const [flow, setFlow] = useState(null) + const [flow, setFlow] = useState(null) const [location, setLocation] = useLocation() useEffect(() => { sdk - .initializeSelfServiceRegistrationFlowForBrowsers() + .createBrowserRegistrationFlow() .then(({ data: flow }) => { setFlow(flow) }) @@ -32,10 +29,10 @@ export const Register = () => { includeScripts={true} onSubmit={({ body }) => { sdk - .submitSelfServiceRegistrationFlow( - flow.id, - body as SubmitSelfServiceRegistrationFlowBody, - ) + .updateRegistrationFlow({ + flow: flow.id, + updateRegistrationFlowBody: body as UpdateRegistrationFlowBody, + }) .then(() => { // we successfully submitted the login flow, so lets redirect to the dashboard setLocation("/", { replace: true }) diff --git a/examples/preact-spa/src/sdk.ts b/examples/preact-spa/src/sdk.ts index ea238f936..602ce04e3 100644 --- a/examples/preact-spa/src/sdk.ts +++ b/examples/preact-spa/src/sdk.ts @@ -1,9 +1,9 @@ // Copyright © 2022 Ory Corp // SPDX-License-Identifier: Apache-2.0 -import { V0alpha2Api, Configuration } from "@ory/client" +import { FrontendApi, Configuration } from "@ory/client" -export default new V0alpha2Api( +export default new FrontendApi( new Configuration({ //https://vitejs.dev/guide/env-and-mode.html#env-files basePath: import.meta.env.VITE_ORY_SDK_URL, diff --git a/examples/preact-spa/src/settings.tsx b/examples/preact-spa/src/settings.tsx index eff35a344..9732f3f24 100644 --- a/examples/preact-spa/src/settings.tsx +++ b/examples/preact-spa/src/settings.tsx @@ -6,29 +6,20 @@ import { import { useCallback, useEffect, useState } from "preact/hooks" import sdk from "./sdk" import { useLocation } from "wouter" -import { - SelfServiceSettingsFlow, - SubmitSelfServiceSettingsFlowBody, -} from "@ory/client" +import { SettingsFlow, UpdateSettingsFlowBody } from "@ory/client" export const Settings = () => { - const [flow, setFlow] = useState(null) + const [flow, setFlow] = useState(null) const [location, setLocation] = useLocation() const onSubmit = useCallback( - ({ - flow, - body, - }: { - flow: SelfServiceSettingsFlow - body: SubmitSelfServiceSettingsFlowBody - }) => + ({ flow, body }: { flow: SettingsFlow; body: UpdateSettingsFlowBody }) => sdk - .submitSelfServiceSettingsFlow( - flow.id, - body as SubmitSelfServiceSettingsFlowBody, - ) + .updateSettingsFlow({ + flow: flow.id, + updateSettingsFlowBody: body as UpdateSettingsFlowBody, + }) .then(({ data: flow }) => { setFlow(flow) }) @@ -42,11 +33,9 @@ export const Settings = () => { ) useEffect(() => { - sdk - .initializeSelfServiceSettingsFlowForBrowsers() - .then(({ data: flow }) => { - setFlow(flow) - }) + sdk.createBrowserSettingsFlow().then(({ data: flow }) => { + setFlow(flow) + }) }, []) return flow ? ( diff --git a/examples/preact-spa/src/verification.tsx b/examples/preact-spa/src/verification.tsx index 188010cb9..ce09714c4 100644 --- a/examples/preact-spa/src/verification.tsx +++ b/examples/preact-spa/src/verification.tsx @@ -1,14 +1,14 @@ -import { SelfServiceVerificationFlow } from "@ory/client" +import { VerificationFlow } from "@ory/client" import { UserAuthCard } from "@ory/elements-preact" import { useEffect, useState } from "preact/hooks" import sdk from "./sdk" export const Verification = () => { - const [flow, setFlow] = useState(null) + const [flow, setFlow] = useState(null) useEffect(() => { sdk - .initializeSelfServiceVerificationFlowForBrowsers() + .createBrowserVerificationFlow() .then(({ data: flow }) => { setFlow(flow) }) diff --git a/examples/react-spa/src/Dashboard.tsx b/examples/react-spa/src/Dashboard.tsx index e7bf344e7..16fc64a93 100644 --- a/examples/react-spa/src/Dashboard.tsx +++ b/examples/react-spa/src/Dashboard.tsx @@ -35,7 +35,7 @@ export const Dashboard = () => { useEffect(() => { // here we create a new logout URL which we can use to log the user out sdk - .createSelfServiceLogoutFlowUrlForBrowsers(undefined, { + .createBrowserLogoutFlow(undefined, { params: { return_url: "/", }, diff --git a/examples/react-spa/src/Login.tsx b/examples/react-spa/src/Login.tsx index 53c35567e..ec425517f 100644 --- a/examples/react-spa/src/Login.tsx +++ b/examples/react-spa/src/Login.tsx @@ -1,14 +1,11 @@ -import { - SelfServiceLoginFlow, - SubmitSelfServiceLoginFlowBody, -} from "@ory/client" +import { LoginFlow, UpdateLoginFlowBody } from "@ory/client" import { UserAuthCard } from "@ory/elements" import { useCallback, useEffect, useState } from "react" import { useNavigate, useSearchParams } from "react-router-dom" import sdk from "./sdk" export const Login = (): JSX.Element => { - const [flow, setFlow] = useState(null) + const [flow, setFlow] = useState(null) const [searchParams, setSearchParams] = useSearchParams() const navigate = useNavigate() @@ -21,7 +18,7 @@ export const Login = (): JSX.Element => { // aal2 is a query parameter that can be used to request Two-Factor authentication // aal1 is the default authentication level (Single-Factor) // we always pass refresh (true) on login so that the session can be refreshed when there is already an active session - .initializeSelfServiceLoginFlowForBrowsers(true, aal2 ? "aal2" : "aal1") + .createBrowserLoginFlow({ refresh: true, aal: aal2 ? "aal2" : "aal1" }) // flow contains the form fields and csrf token .then(({ data: flow }) => setFlow(flow)) .catch((error) => { @@ -44,7 +41,7 @@ export const Login = (): JSX.Element => { (flowId: string) => sdk // the flow data contains the form fields, error messages and csrf token - .getSelfServiceLoginFlow(flowId) + .getLoginFlow({ id: flowId }) .then(({ data: flow }) => setFlow(flow)) .catch((err) => { console.error(err) @@ -54,13 +51,13 @@ export const Login = (): JSX.Element => { ) // submit the login form data to Ory - const submitFlow = (body: SubmitSelfServiceLoginFlowBody) => { + const submitFlow = (body: UpdateLoginFlowBody) => { // something unexpected went wrong and the flow was not set if (!flow) return navigate("/login", { replace: true }) // we submit the flow to Ory with the form data sdk - .submitSelfServiceLoginFlow(flow.id, body) + .updateLoginFlow({ flow: flow.id, updateLoginFlowBody: body }) .then(() => { // we successfully submitted the login flow, so lets redirect to the dashboard navigate("/", { replace: true }) @@ -76,7 +73,7 @@ export const Login = (): JSX.Element => { const u = new URL(error.response.data.redirect_browser_to) // get new flow data based on the flow id in the redirect url sdk - .getSelfServiceLoginFlow(u.searchParams.get("flow") || "") + .getLoginFlow({ id: u.searchParams.get("flow") || "" }) .then(({ data: flow }) => { setFlow(flow) }) @@ -124,9 +121,7 @@ export const Login = (): JSX.Element => { // we might need webauthn support which requires additional js includeScripts={true} // we submit the form data to Ory - onSubmit={({ body }) => - submitFlow(body as SubmitSelfServiceLoginFlowBody) - } + onSubmit={({ body }) => submitFlow(body as UpdateLoginFlowBody)} /> ) : (
Loading...
diff --git a/examples/react-spa/src/Recovery.tsx b/examples/react-spa/src/Recovery.tsx index 962e9a0b5..c5b4eec30 100644 --- a/examples/react-spa/src/Recovery.tsx +++ b/examples/react-spa/src/Recovery.tsx @@ -1,14 +1,11 @@ -import { - SelfServiceRecoveryFlow, - SubmitSelfServiceRecoveryFlowBody, -} from "@ory/client" +import { RecoveryFlow, UpdateRecoveryFlowBody } from "@ory/client" import { UserAuthCard } from "@ory/elements" import { useCallback, useEffect, useState } from "react" import { useNavigate, useSearchParams } from "react-router-dom" import sdk from "./sdk" export const Recovery = () => { - const [flow, setFlow] = useState(null) + const [flow, setFlow] = useState(null) const [searchParams, setSearchParams] = useSearchParams() const navigate = useNavigate() @@ -18,7 +15,7 @@ export const Recovery = () => { useCallback( () => sdk - .initializeSelfServiceRecoveryFlowForBrowsers() + .createBrowserRecoveryFlow() // flow contains the form fields, error messages and csrf token .then(({ data: flow }) => setFlow(flow)) // something serious went wrong so we redirect to the recovery page @@ -32,7 +29,7 @@ export const Recovery = () => { const getFlow = useCallback( (flowId: string) => sdk - .getSelfServiceRecoveryFlow(flowId) + .getRecoveryFlow({ id: flowId }) .then(({ data: flow }) => setFlow(flow)) .catch((err) => { console.error(err) @@ -41,15 +38,12 @@ export const Recovery = () => { [], ) - const submitFlow = (body: SubmitSelfServiceRecoveryFlowBody) => { + const submitFlow = (body: UpdateRecoveryFlowBody) => { // something unexpected went wrong and the flow was not set if (!flow) return navigate("/login", { replace: true }) sdk - .submitSelfServiceRecoveryFlow( - flow.id, - body as SubmitSelfServiceRecoveryFlowBody, - ) + .updateRecoveryFlow({ flow: flow.id, updateRecoveryFlowBody: body }) .then(() => { // we successfully submitted the login flow, so lets redirect to the dashboard navigate("/", { replace: true }) @@ -83,9 +77,7 @@ export const Recovery = () => { // the recovery form should allow users to navigate to the login page additionalProps={{ loginURL: "/login" }} // submit the form data to Ory - onSubmit={({ body }) => - submitFlow(body as SubmitSelfServiceRecoveryFlowBody) - } + onSubmit={({ body }) => submitFlow(body as UpdateRecoveryFlowBody)} /> ) : (
Loading...
diff --git a/examples/react-spa/src/Registration.tsx b/examples/react-spa/src/Registration.tsx index 55c5a00d5..5dffbe411 100644 --- a/examples/react-spa/src/Registration.tsx +++ b/examples/react-spa/src/Registration.tsx @@ -1,14 +1,11 @@ -import { - SelfServiceRegistrationFlow, - SubmitSelfServiceRegistrationFlowBody, -} from "@ory/client" +import { RegistrationFlow, UpdateRegistrationFlowBody } from "@ory/client" import { UserAuthCard } from "@ory/elements" import { useCallback, useEffect, useState } from "react" import { useNavigate, useSearchParams } from "react-router-dom" import sdk from "./sdk" export const Registration = () => { - const [flow, setFlow] = useState(null) + const [flow, setFlow] = useState(null) const [searchParams, setSearchParams] = useSearchParams() const navigate = useNavigate() @@ -18,7 +15,7 @@ export const Registration = () => { () => sdk // we don't need to specify the return_to here since we are building an SPA. In server-side browser flows we would need to specify the return_to - .initializeSelfServiceRegistrationFlowForBrowsers() + .createBrowserRegistrationFlow() .then(({ data: flow }) => { setFlow(flow) }) @@ -35,7 +32,7 @@ export const Registration = () => { (flowId: string) => sdk // the flow data contains the form fields, error messages and csrf token - .getSelfServiceRegistrationFlow(flowId) + .getRegistrationFlow({ id: flowId }) .then(({ data: flow }) => setFlow(flow)) .catch((err) => { console.error(err) @@ -45,12 +42,15 @@ export const Registration = () => { ) // submit the registration form data to Ory - const submitFlow = (body: SubmitSelfServiceRegistrationFlowBody) => { + const submitFlow = (body: UpdateRegistrationFlowBody) => { // something unexpected went wrong and the flow was not set if (!flow) return navigate("/signup", { replace: true }) sdk - .submitSelfServiceRegistrationFlow(flow.id, body) + .updateRegistrationFlow({ + flow: flow.id, + updateRegistrationFlowBody: body, + }) .then(() => { // we successfully submitted the login flow, so lets redirect to the dashboard navigate("/", { replace: true }) @@ -108,9 +108,7 @@ export const Registration = () => { // include the necessary scripts for webauthn to work includeScripts={true} // submit the registration form data to Ory - onSubmit={({ body }) => - submitFlow(body as SubmitSelfServiceRegistrationFlowBody) - } + onSubmit={({ body }) => submitFlow(body as UpdateRegistrationFlowBody)} /> ) : (
Loading...
diff --git a/examples/react-spa/src/Settings.tsx b/examples/react-spa/src/Settings.tsx index 545f4ab98..e33c2fd3d 100644 --- a/examples/react-spa/src/Settings.tsx +++ b/examples/react-spa/src/Settings.tsx @@ -1,7 +1,4 @@ -import { - SelfServiceSettingsFlow, - SubmitSelfServiceSettingsFlowBody, -} from "@ory/client" +import { SettingsFlow, UpdateSettingsFlowBody } from "@ory/client" import { gridStyle, UserSettingsCard, @@ -12,7 +9,7 @@ import { useNavigate, useSearchParams } from "react-router-dom" import sdk from "./sdk" export const Settings = () => { - const [flow, setFlow] = useState(null) + const [flow, setFlow] = useState(null) const [searchParams, setSearchParams] = useSearchParams() const navigate = useNavigate() @@ -23,7 +20,7 @@ export const Settings = () => { // create a new settings flow // the flow contains the form fields, error messages and csrf token // depending on the Ory Network project settings, the form fields returned may vary - .initializeSelfServiceSettingsFlowForBrowsers() + .createBrowserSettingsFlow() .then(({ data: flow }) => { setFlow(flow) }) @@ -40,7 +37,7 @@ export const Settings = () => { (flowId: string) => sdk // the flow data contains the form fields, error messages and csrf token - .getSelfServiceSettingsFlow(flowId) + .getSettingsFlow({ id: flowId }) .then(({ data: flow }) => setFlow(flow)) .catch((err) => { console.error(err) @@ -50,13 +47,13 @@ export const Settings = () => { ) // submit any of the settings form data to Ory - const onSubmit = (body: SubmitSelfServiceSettingsFlowBody) => { + const onSubmit = (body: UpdateSettingsFlowBody) => { // something unexpected went wrong and the flow was not set if (!flow) return navigate("/settings", { replace: true }) sdk // submit the form data the user provided to Ory - .submitSelfServiceSettingsFlow(flow.id, body) + .updateSettingsFlow({ flow: flow.id, updateSettingsFlowBody: body }) .then(({ data: flow }) => { setFlow(flow) }) diff --git a/examples/react-spa/src/Verification.tsx b/examples/react-spa/src/Verification.tsx index 56ad7373f..979e45df7 100644 --- a/examples/react-spa/src/Verification.tsx +++ b/examples/react-spa/src/Verification.tsx @@ -1,14 +1,11 @@ -import { - SelfServiceVerificationFlow, - SubmitSelfServiceVerificationFlowBody, -} from "@ory/client" +import { VerificationFlow, UpdateVerificationFlowBody } from "@ory/client" import { UserAuthCard } from "@ory/elements" import { useCallback, useEffect, useState } from "react" import { useNavigate, useSearchParams } from "react-router-dom" import sdk from "./sdk" export const Verification = (): JSX.Element => { - const [flow, setFlow] = useState(null) + const [flow, setFlow] = useState(null) const [searchParams, setSearchParams] = useSearchParams() const navigate = useNavigate() @@ -17,7 +14,7 @@ export const Verification = (): JSX.Element => { const createFlow = useCallback( () => sdk - .initializeSelfServiceVerificationFlowForBrowsers() + .createBrowserVerificationFlow() // flow contains the form fields, error messages and csrf token .then(({ data: flow }) => { setFlow(flow) @@ -35,7 +32,7 @@ export const Verification = (): JSX.Element => { (flowId: string) => sdk // the flow data contains the form fields, error messages and csrf token - .getSelfServiceVerificationFlow(flowId) + .getVerificationFlow({ id: flowId }) .then(({ data: flow }) => setFlow(flow)) .catch((err) => { console.error(err) @@ -45,12 +42,15 @@ export const Verification = (): JSX.Element => { ) // submit the verification form data to Ory - const submitFlow = (body: SubmitSelfServiceVerificationFlowBody) => { + const submitFlow = (body: UpdateVerificationFlowBody) => { // something unexpected went wrong and the flow was not set if (!flow) return navigate("/verification", { replace: true }) sdk - .submitSelfServiceVerificationFlow(flow.id, body) + .updateVerificationFlow({ + flow: flow.id, + updateVerificationFlowBody: body, + }) .then(({ data: flow }) => { setFlow(flow) }) @@ -105,9 +105,7 @@ export const Verification = (): JSX.Element => { loginURL: "/login", }} // submit the verification form data to Ory - onSubmit={({ body }) => - submitFlow(body as SubmitSelfServiceVerificationFlowBody) - } + onSubmit={({ body }) => submitFlow(body as UpdateVerificationFlowBody)} /> ) : (
Loading...
diff --git a/examples/react-spa/src/sdk.ts b/examples/react-spa/src/sdk.ts index c712e6082..376033c4e 100644 --- a/examples/react-spa/src/sdk.ts +++ b/examples/react-spa/src/sdk.ts @@ -1,9 +1,9 @@ // Copyright © 2022 Ory Corp // SPDX-License-Identifier: Apache-2.0 -import { Configuration, V0alpha2Api } from "@ory/client" +import { Configuration, FrontendApi } from "@ory/client" -export default new V0alpha2Api( +export default new FrontendApi( new Configuration({ //https://vitejs.dev/guide/env-and-mode.html#env-files basePath: import.meta.env.VITE_ORY_SDK_URL, diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 000000000..c871d87b7 --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "6.2.1" + } +} diff --git a/package-lock.json b/package-lock.json index 733fa0fe0..e5c15397d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,10 +12,10 @@ ], "devDependencies": { "@babel/core": "^7.18.10", - "@ory/client": "^0.2.0-alpha.60", + "@ory/client": "^1.1.0", "@ory/elements": "*", "@ory/elements-test": "*", - "@ory/integrations": "^0.2.7", + "@ory/integrations": "^1.1.0", "@playwright/experimental-ct-react": "^1.25.0", "@playwright/test": "^1.25.1", "@preact/preset-vite": "^2.3.0", @@ -6831,15 +6831,15 @@ "dev": true }, "node_modules/@next/env": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/env/-/env-12.2.5.tgz", - "integrity": "sha512-vLPLV3cpPGjUPT3PjgRj7e3nio9t6USkuew3JE/jMeon/9Mvp1WyR18v3iwnCuX7eUAm1HmAbJHHLAbcu/EJcw==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/env/-/env-13.0.6.tgz", + "integrity": "sha512-yceT6DCHKqPRS1cAm8DHvDvK74DLIkDQdm5iV+GnIts8h0QbdHvkUIkdOvQoOODgpr6018skbmSQp12z5OWIQQ==", "dev": true }, "node_modules/@next/swc-android-arm-eabi": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.2.5.tgz", - "integrity": "sha512-cPWClKxGhgn2dLWnspW+7psl3MoLQUcNqJqOHk2BhNcou9ARDtC0IjQkKe5qcn9qg7I7U83Gp1yh2aesZfZJMA==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.0.6.tgz", + "integrity": "sha512-FGFSj3v2Bluw8fD/X+1eXIEB0PhoJE0zfutsAauRhmNpjjZshLDgoXMWm1jTRL/04K/o9gwwO2+A8+sPVCH1uw==", "cpu": [ "arm" ], @@ -6853,9 +6853,9 @@ } }, "node_modules/@next/swc-android-arm64": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-12.2.5.tgz", - "integrity": "sha512-vMj0efliXmC5b7p+wfcQCX0AfU8IypjkzT64GiKJD9PgiA3IILNiGJr1fw2lyUDHkjeWx/5HMlMEpLnTsQslwg==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-13.0.6.tgz", + "integrity": "sha512-7MgbtU7kimxuovVsd7jSJWMkIHBDBUsNLmmlkrBRHTvgzx5nDBXogP0hzZm7EImdOPwVMPpUHRQMBP9mbsiJYQ==", "cpu": [ "arm64" ], @@ -6869,9 +6869,9 @@ } }, "node_modules/@next/swc-darwin-arm64": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.2.5.tgz", - "integrity": "sha512-VOPWbO5EFr6snla/WcxUKtvzGVShfs302TEMOtzYyWni6f9zuOetijJvVh9CCTzInnXAZMtHyNhefijA4HMYLg==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.0.6.tgz", + "integrity": "sha512-AUVEpVTxbP/fxdFsjVI9d5a0CFn6NVV7A/RXOb0Y+pXKIIZ1V5rFjPwpYfIfyOo2lrqgehMNQcyMRoTrhq04xg==", "cpu": [ "arm64" ], @@ -6885,9 +6885,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-12.2.5.tgz", - "integrity": "sha512-5o8bTCgAmtYOgauO/Xd27vW52G2/m3i5PX7MUYePquxXAnX73AAtqA3WgPXBRitEB60plSKZgOTkcpqrsh546A==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.0.6.tgz", + "integrity": "sha512-SasCDJlshglsPnbzhWaIF6VEGkQy2NECcAOxPwaPr0cwbbt4aUlZ7QmskNzgolr5eAjFS/xTr7CEeKJtZpAAtQ==", "cpu": [ "x64" ], @@ -6901,9 +6901,9 @@ } }, "node_modules/@next/swc-freebsd-x64": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.2.5.tgz", - "integrity": "sha512-yYUbyup1JnznMtEBRkK4LT56N0lfK5qNTzr6/DEyDw5TbFVwnuy2hhLBzwCBkScFVjpFdfiC6SQAX3FrAZzuuw==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.0.6.tgz", + "integrity": "sha512-6Lbxd9gAdXneTkwHyYW/qtX1Tdw7ND9UbiGsGz/SP43ZInNWnW6q0au4hEVPZ9bOWWRKzcVoeTBdoMpQk9Hx9w==", "cpu": [ "x64" ], @@ -6917,9 +6917,9 @@ } }, "node_modules/@next/swc-linux-arm-gnueabihf": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.2.5.tgz", - "integrity": "sha512-2ZE2/G921Acks7UopJZVMgKLdm4vN4U0yuzvAMJ6KBavPzqESA2yHJlm85TV/K9gIjKhSk5BVtauIUntFRP8cg==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.0.6.tgz", + "integrity": "sha512-wNdi5A519e1P+ozEuYOhWPzzE6m1y7mkO6NFwn6watUwO0X9nZs7fT9THmnekvmFQpaZ6U+xf2MQ9poQoCh6jQ==", "cpu": [ "arm" ], @@ -6933,9 +6933,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.2.5.tgz", - "integrity": "sha512-/I6+PWVlz2wkTdWqhlSYYJ1pWWgUVva6SgX353oqTh8njNQp1SdFQuWDqk8LnM6ulheVfSsgkDzxrDaAQZnzjQ==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.0.6.tgz", + "integrity": "sha512-e8KTRnleQY1KLk5PwGV5hrmvKksCc74QRpHl5ffWnEEAtL2FE0ave5aIkXqErsPdXkiKuA/owp3LjQrP+/AH7Q==", "cpu": [ "arm64" ], @@ -6949,9 +6949,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.2.5.tgz", - "integrity": "sha512-LPQRelfX6asXyVr59p5sTpx5l+0yh2Vjp/R8Wi4X9pnqcayqT4CUJLiHqCvZuLin3IsFdisJL0rKHMoaZLRfmg==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.0.6.tgz", + "integrity": "sha512-/7RF03C3mhjYpHN+pqOolgME3guiHU5T3TsejuyteqyEyzdEyLHod+jcYH6ft7UZ71a6TdOewvmbLOtzHW2O8A==", "cpu": [ "arm64" ], @@ -6965,9 +6965,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.2.5.tgz", - "integrity": "sha512-0szyAo8jMCClkjNK0hknjhmAngUppoRekW6OAezbEYwHXN/VNtsXbfzgYOqjKWxEx3OoAzrT3jLwAF0HdX2MEw==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.0.6.tgz", + "integrity": "sha512-kxyEXnYHpOEkFnmrlwB1QlzJtjC6sAJytKcceIyFUHbCaD3W/Qb5tnclcnHKTaFccizZRePXvV25Ok/eUSpKTw==", "cpu": [ "x64" ], @@ -6981,9 +6981,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.2.5.tgz", - "integrity": "sha512-zg/Y6oBar1yVnW6Il1I/08/2ukWtOG6s3acdJdEyIdsCzyQi4RLxbbhkD/EGQyhqBvd3QrC6ZXQEXighQUAZ0g==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.0.6.tgz", + "integrity": "sha512-N0c6gubS3WW1oYYgo02xzZnNatfVQP/CiJq2ax+DJ55ePV62IACbRCU99TZNXXg+Kos6vNW4k+/qgvkvpGDeyA==", "cpu": [ "x64" ], @@ -6997,9 +6997,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.2.5.tgz", - "integrity": "sha512-3/90DRNSqeeSRMMEhj4gHHQlLhhKg5SCCoYfE3kBjGpE63EfnblYUqsszGGZ9ekpKL/R4/SGB40iCQr8tR5Jiw==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.0.6.tgz", + "integrity": "sha512-QjeMB2EBqBFPb/ac0CYr7GytbhUkrG4EwFWbcE0vsRp4H8grt25kYpFQckL4Jak3SUrp7vKfDwZ/SwO7QdO8vw==", "cpu": [ "arm64" ], @@ -7013,9 +7013,9 @@ } }, "node_modules/@next/swc-win32-ia32-msvc": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.2.5.tgz", - "integrity": "sha512-hGLc0ZRAwnaPL4ulwpp4D2RxmkHQLuI8CFOEEHdzZpS63/hMVzv81g8jzYA0UXbb9pus/iTc3VRbVbAM03SRrw==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.0.6.tgz", + "integrity": "sha512-EQzXtdqRTcmhT/tCq81rIwE36Y3fNHPInaCuJzM/kftdXfa0F+64y7FAoMO13npX8EG1+SamXgp/emSusKrCXg==", "cpu": [ "ia32" ], @@ -7029,9 +7029,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.2.5.tgz", - "integrity": "sha512-7h5/ahY7NeaO2xygqVrSG/Y8Vs4cdjxIjowTZ5W6CKoTKn7tmnuxlUc2h74x06FKmbhAd9agOjr/AOKyxYYm9Q==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.0.6.tgz", + "integrity": "sha512-pSkqZ//UP/f2sS9T7IvHLfEWDPTX0vRyXJnAUNisKvO3eF3e1xdhDX7dix/X3Z3lnN4UjSwOzclAI87JFbOwmQ==", "cpu": [ "x64" ], @@ -7701,9 +7701,9 @@ } }, "node_modules/@ory/client": { - "version": "0.2.0-alpha.60", - "resolved": "https://registry.npmjs.org/@ory/client/-/client-0.2.0-alpha.60.tgz", - "integrity": "sha512-fGovJ/xIl7dvJJP9/IL4Xu1yiOCy9pvmkfj2xnHZbPrIbL9c9tqVcC3CSlzBq6zJQZMC3XI7VmZ8uEQ+cF4suw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@ory/client/-/client-1.1.0.tgz", + "integrity": "sha512-3yOD/0tX7oZQxtAiU8EHiU3VvzMZwXZmjbWMRAz38Ohc8OgrmX1PYubXSFCdyV1coNt5/YJ//+bA/FUk8JCJLA==", "dev": true, "dependencies": { "axios": "^0.21.4" @@ -7726,12 +7726,12 @@ "link": true }, "node_modules/@ory/integrations": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/@ory/integrations/-/integrations-0.2.7.tgz", - "integrity": "sha512-8LvO+WKO/vrojydgt91JblGjjJF/o59WKQRSe0+GyueeveEPIAqKTF2Gb2uynejym1YHdzOybgLbvMVzU+7NNA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@ory/integrations/-/integrations-1.1.0.tgz", + "integrity": "sha512-1PQhpj2AGF2fX15IyftdMACeaBWSMzsOJgX3q5mJY76CzjJxfWPxnrX3Y0YaHcbCQsHw3NPcRPK0am3NCezumw==", "dev": true, "dependencies": { - "@ory/client": "^0.2.0-alpha.16", + "@ory/client": "^1.1.0", "@types/tldjs": "^2.3.1", "cookie": "^0.4.1", "istextorbinary": "^6.0.0", @@ -7747,6 +7747,125 @@ "next": ">=12.0.10" } }, + "node_modules/@ory/integrations/node_modules/next": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/next/-/next-13.0.6.tgz", + "integrity": "sha512-COvigvms2LRt1rrzfBQcMQ2GZd86Mvk1z+LOLY5pniFtL4VrTmhZ9salrbKfSiXbhsD01TrDdD68ec3ABDyscA==", + "dev": true, + "dependencies": { + "@next/env": "13.0.6", + "@swc/helpers": "0.4.14", + "caniuse-lite": "^1.0.30001406", + "postcss": "8.4.14", + "styled-jsx": "5.1.0" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": ">=14.6.0" + }, + "optionalDependencies": { + "@next/swc-android-arm-eabi": "13.0.6", + "@next/swc-android-arm64": "13.0.6", + "@next/swc-darwin-arm64": "13.0.6", + "@next/swc-darwin-x64": "13.0.6", + "@next/swc-freebsd-x64": "13.0.6", + "@next/swc-linux-arm-gnueabihf": "13.0.6", + "@next/swc-linux-arm64-gnu": "13.0.6", + "@next/swc-linux-arm64-musl": "13.0.6", + "@next/swc-linux-x64-gnu": "13.0.6", + "@next/swc-linux-x64-musl": "13.0.6", + "@next/swc-win32-arm64-msvc": "13.0.6", + "@next/swc-win32-ia32-msvc": "13.0.6", + "@next/swc-win32-x64-msvc": "13.0.6" + }, + "peerDependencies": { + "fibers": ">= 3.1.0", + "node-sass": "^6.0.0 || ^7.0.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "fibers": { + "optional": true + }, + "node-sass": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "node_modules/@ory/integrations/node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/@ory/integrations/node_modules/postcss": { + "version": "8.4.14", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", + "integrity": "sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + } + ], + "dependencies": { + "nanoid": "^3.3.4", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/@ory/integrations/node_modules/react": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "dev": true, + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@ory/integrations/node_modules/react-dom": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "dev": true, + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.0" + }, + "peerDependencies": { + "react": "^18.2.0" + } + }, + "node_modules/@ory/integrations/node_modules/scheduler": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "dev": true, + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0" + } + }, "node_modules/@parcel/watcher": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.0.4.tgz", @@ -10429,9 +10548,9 @@ } }, "node_modules/@swc/helpers": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.3.tgz", - "integrity": "sha512-6JrF+fdUK2zbGpJIlN7G3v966PQjyx/dPt1T9km2wj+EUBqgrxCk3uX4Kct16MIm9gGxfKRcfax2hVf5jvlTzA==", + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.14.tgz", + "integrity": "sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==", "dev": true, "dependencies": { "tslib": "^2.4.0" @@ -13406,9 +13525,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001383", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001383.tgz", - "integrity": "sha512-swMpEoTp5vDoGBZsYZX7L7nXHe6dsHxi9o6/LKf/f0LukVtnrxly5GVb/fWdCDTqi/yw6Km6tiJ0pmBacm0gbg==", + "version": "1.0.30001439", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001439.tgz", + "integrity": "sha512-1MgUzEkoMO6gKfXflStpYgZDlFM7M/ck/bgfVCACO5vnAf0fXoNVHdWtqGU+MYca+4bL9Z5bpOVmR33cWW9G2A==", "dev": true, "funding": [ { @@ -13781,6 +13900,12 @@ "node": ">= 10" } }, + "node_modules/client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", + "dev": true + }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -22939,89 +23064,6 @@ "integrity": "sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==", "dev": true }, - "node_modules/next": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/next/-/next-12.2.5.tgz", - "integrity": "sha512-tBdjqX5XC/oFs/6gxrZhjmiq90YWizUYU6qOWAfat7zJwrwapJ+BYgX2PmiacunXMaRpeVT4vz5MSPSLgNkrpA==", - "dev": true, - "dependencies": { - "@next/env": "12.2.5", - "@swc/helpers": "0.4.3", - "caniuse-lite": "^1.0.30001332", - "postcss": "8.4.14", - "styled-jsx": "5.0.4", - "use-sync-external-store": "1.2.0" - }, - "bin": { - "next": "dist/bin/next" - }, - "engines": { - "node": ">=12.22.0" - }, - "optionalDependencies": { - "@next/swc-android-arm-eabi": "12.2.5", - "@next/swc-android-arm64": "12.2.5", - "@next/swc-darwin-arm64": "12.2.5", - "@next/swc-darwin-x64": "12.2.5", - "@next/swc-freebsd-x64": "12.2.5", - "@next/swc-linux-arm-gnueabihf": "12.2.5", - "@next/swc-linux-arm64-gnu": "12.2.5", - "@next/swc-linux-arm64-musl": "12.2.5", - "@next/swc-linux-x64-gnu": "12.2.5", - "@next/swc-linux-x64-musl": "12.2.5", - "@next/swc-win32-arm64-msvc": "12.2.5", - "@next/swc-win32-ia32-msvc": "12.2.5", - "@next/swc-win32-x64-msvc": "12.2.5" - }, - "peerDependencies": { - "fibers": ">= 3.1.0", - "node-sass": "^6.0.0 || ^7.0.0", - "react": "^17.0.2 || ^18.0.0-0", - "react-dom": "^17.0.2 || ^18.0.0-0", - "sass": "^1.3.0" - }, - "peerDependenciesMeta": { - "fibers": { - "optional": true - }, - "node-sass": { - "optional": true - }, - "sass": { - "optional": true - } - } - }, - "node_modules/next/node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true - }, - "node_modules/next/node_modules/postcss": { - "version": "8.4.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", - "integrity": "sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - } - ], - "dependencies": { - "nanoid": "^3.3.4", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, "node_modules/nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -28771,10 +28813,13 @@ } }, "node_modules/styled-jsx": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.0.4.tgz", - "integrity": "sha512-sDFWLbg4zR+UkNzfk5lPilyIgtpddfxXEULxhujorr5jtePTUqiPDc5BC0v1NRqTr/WaFBGQQUoYToGlF4B2KQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.0.tgz", + "integrity": "sha512-/iHaRJt9U7T+5tp6TRelLnqBqiaIT0HsO0+vgyj8hK2KUk7aejFqRrumqPUlAqDwAj8IbS/1hk3IhBAAK/FCUQ==", "dev": true, + "dependencies": { + "client-only": "0.0.1" + }, "engines": { "node": ">= 12.0.0" }, @@ -30465,15 +30510,6 @@ "node": ">=0.10.0" } }, - "node_modules/use-sync-external-store": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", - "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", - "dev": true, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/util": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", @@ -37054,99 +37090,99 @@ } }, "@next/env": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/env/-/env-12.2.5.tgz", - "integrity": "sha512-vLPLV3cpPGjUPT3PjgRj7e3nio9t6USkuew3JE/jMeon/9Mvp1WyR18v3iwnCuX7eUAm1HmAbJHHLAbcu/EJcw==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/env/-/env-13.0.6.tgz", + "integrity": "sha512-yceT6DCHKqPRS1cAm8DHvDvK74DLIkDQdm5iV+GnIts8h0QbdHvkUIkdOvQoOODgpr6018skbmSQp12z5OWIQQ==", "dev": true }, "@next/swc-android-arm-eabi": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.2.5.tgz", - "integrity": "sha512-cPWClKxGhgn2dLWnspW+7psl3MoLQUcNqJqOHk2BhNcou9ARDtC0IjQkKe5qcn9qg7I7U83Gp1yh2aesZfZJMA==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.0.6.tgz", + "integrity": "sha512-FGFSj3v2Bluw8fD/X+1eXIEB0PhoJE0zfutsAauRhmNpjjZshLDgoXMWm1jTRL/04K/o9gwwO2+A8+sPVCH1uw==", "dev": true, "optional": true }, "@next/swc-android-arm64": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-12.2.5.tgz", - "integrity": "sha512-vMj0efliXmC5b7p+wfcQCX0AfU8IypjkzT64GiKJD9PgiA3IILNiGJr1fw2lyUDHkjeWx/5HMlMEpLnTsQslwg==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-13.0.6.tgz", + "integrity": "sha512-7MgbtU7kimxuovVsd7jSJWMkIHBDBUsNLmmlkrBRHTvgzx5nDBXogP0hzZm7EImdOPwVMPpUHRQMBP9mbsiJYQ==", "dev": true, "optional": true }, "@next/swc-darwin-arm64": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.2.5.tgz", - "integrity": "sha512-VOPWbO5EFr6snla/WcxUKtvzGVShfs302TEMOtzYyWni6f9zuOetijJvVh9CCTzInnXAZMtHyNhefijA4HMYLg==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.0.6.tgz", + "integrity": "sha512-AUVEpVTxbP/fxdFsjVI9d5a0CFn6NVV7A/RXOb0Y+pXKIIZ1V5rFjPwpYfIfyOo2lrqgehMNQcyMRoTrhq04xg==", "dev": true, "optional": true }, "@next/swc-darwin-x64": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-12.2.5.tgz", - "integrity": "sha512-5o8bTCgAmtYOgauO/Xd27vW52G2/m3i5PX7MUYePquxXAnX73AAtqA3WgPXBRitEB60plSKZgOTkcpqrsh546A==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.0.6.tgz", + "integrity": "sha512-SasCDJlshglsPnbzhWaIF6VEGkQy2NECcAOxPwaPr0cwbbt4aUlZ7QmskNzgolr5eAjFS/xTr7CEeKJtZpAAtQ==", "dev": true, "optional": true }, "@next/swc-freebsd-x64": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.2.5.tgz", - "integrity": "sha512-yYUbyup1JnznMtEBRkK4LT56N0lfK5qNTzr6/DEyDw5TbFVwnuy2hhLBzwCBkScFVjpFdfiC6SQAX3FrAZzuuw==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.0.6.tgz", + "integrity": "sha512-6Lbxd9gAdXneTkwHyYW/qtX1Tdw7ND9UbiGsGz/SP43ZInNWnW6q0au4hEVPZ9bOWWRKzcVoeTBdoMpQk9Hx9w==", "dev": true, "optional": true }, "@next/swc-linux-arm-gnueabihf": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.2.5.tgz", - "integrity": "sha512-2ZE2/G921Acks7UopJZVMgKLdm4vN4U0yuzvAMJ6KBavPzqESA2yHJlm85TV/K9gIjKhSk5BVtauIUntFRP8cg==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.0.6.tgz", + "integrity": "sha512-wNdi5A519e1P+ozEuYOhWPzzE6m1y7mkO6NFwn6watUwO0X9nZs7fT9THmnekvmFQpaZ6U+xf2MQ9poQoCh6jQ==", "dev": true, "optional": true }, "@next/swc-linux-arm64-gnu": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.2.5.tgz", - "integrity": "sha512-/I6+PWVlz2wkTdWqhlSYYJ1pWWgUVva6SgX353oqTh8njNQp1SdFQuWDqk8LnM6ulheVfSsgkDzxrDaAQZnzjQ==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.0.6.tgz", + "integrity": "sha512-e8KTRnleQY1KLk5PwGV5hrmvKksCc74QRpHl5ffWnEEAtL2FE0ave5aIkXqErsPdXkiKuA/owp3LjQrP+/AH7Q==", "dev": true, "optional": true }, "@next/swc-linux-arm64-musl": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.2.5.tgz", - "integrity": "sha512-LPQRelfX6asXyVr59p5sTpx5l+0yh2Vjp/R8Wi4X9pnqcayqT4CUJLiHqCvZuLin3IsFdisJL0rKHMoaZLRfmg==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.0.6.tgz", + "integrity": "sha512-/7RF03C3mhjYpHN+pqOolgME3guiHU5T3TsejuyteqyEyzdEyLHod+jcYH6ft7UZ71a6TdOewvmbLOtzHW2O8A==", "dev": true, "optional": true }, "@next/swc-linux-x64-gnu": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.2.5.tgz", - "integrity": "sha512-0szyAo8jMCClkjNK0hknjhmAngUppoRekW6OAezbEYwHXN/VNtsXbfzgYOqjKWxEx3OoAzrT3jLwAF0HdX2MEw==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.0.6.tgz", + "integrity": "sha512-kxyEXnYHpOEkFnmrlwB1QlzJtjC6sAJytKcceIyFUHbCaD3W/Qb5tnclcnHKTaFccizZRePXvV25Ok/eUSpKTw==", "dev": true, "optional": true }, "@next/swc-linux-x64-musl": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.2.5.tgz", - "integrity": "sha512-zg/Y6oBar1yVnW6Il1I/08/2ukWtOG6s3acdJdEyIdsCzyQi4RLxbbhkD/EGQyhqBvd3QrC6ZXQEXighQUAZ0g==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.0.6.tgz", + "integrity": "sha512-N0c6gubS3WW1oYYgo02xzZnNatfVQP/CiJq2ax+DJ55ePV62IACbRCU99TZNXXg+Kos6vNW4k+/qgvkvpGDeyA==", "dev": true, "optional": true }, "@next/swc-win32-arm64-msvc": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.2.5.tgz", - "integrity": "sha512-3/90DRNSqeeSRMMEhj4gHHQlLhhKg5SCCoYfE3kBjGpE63EfnblYUqsszGGZ9ekpKL/R4/SGB40iCQr8tR5Jiw==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.0.6.tgz", + "integrity": "sha512-QjeMB2EBqBFPb/ac0CYr7GytbhUkrG4EwFWbcE0vsRp4H8grt25kYpFQckL4Jak3SUrp7vKfDwZ/SwO7QdO8vw==", "dev": true, "optional": true }, "@next/swc-win32-ia32-msvc": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.2.5.tgz", - "integrity": "sha512-hGLc0ZRAwnaPL4ulwpp4D2RxmkHQLuI8CFOEEHdzZpS63/hMVzv81g8jzYA0UXbb9pus/iTc3VRbVbAM03SRrw==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.0.6.tgz", + "integrity": "sha512-EQzXtdqRTcmhT/tCq81rIwE36Y3fNHPInaCuJzM/kftdXfa0F+64y7FAoMO13npX8EG1+SamXgp/emSusKrCXg==", "dev": true, "optional": true }, "@next/swc-win32-x64-msvc": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.2.5.tgz", - "integrity": "sha512-7h5/ahY7NeaO2xygqVrSG/Y8Vs4cdjxIjowTZ5W6CKoTKn7tmnuxlUc2h74x06FKmbhAd9agOjr/AOKyxYYm9Q==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.0.6.tgz", + "integrity": "sha512-pSkqZ//UP/f2sS9T7IvHLfEWDPTX0vRyXJnAUNisKvO3eF3e1xdhDX7dix/X3Z3lnN4UjSwOzclAI87JFbOwmQ==", "dev": true, "optional": true }, @@ -37673,9 +37709,9 @@ } }, "@ory/client": { - "version": "0.2.0-alpha.60", - "resolved": "https://registry.npmjs.org/@ory/client/-/client-0.2.0-alpha.60.tgz", - "integrity": "sha512-fGovJ/xIl7dvJJP9/IL4Xu1yiOCy9pvmkfj2xnHZbPrIbL9c9tqVcC3CSlzBq6zJQZMC3XI7VmZ8uEQ+cF4suw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@ory/client/-/client-1.1.0.tgz", + "integrity": "sha512-3yOD/0tX7oZQxtAiU8EHiU3VvzMZwXZmjbWMRAz38Ohc8OgrmX1PYubXSFCdyV1coNt5/YJ//+bA/FUk8JCJLA==", "dev": true, "requires": { "axios": "^0.21.4" @@ -37711,12 +37747,12 @@ } }, "@ory/integrations": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/@ory/integrations/-/integrations-0.2.7.tgz", - "integrity": "sha512-8LvO+WKO/vrojydgt91JblGjjJF/o59WKQRSe0+GyueeveEPIAqKTF2Gb2uynejym1YHdzOybgLbvMVzU+7NNA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@ory/integrations/-/integrations-1.1.0.tgz", + "integrity": "sha512-1PQhpj2AGF2fX15IyftdMACeaBWSMzsOJgX3q5mJY76CzjJxfWPxnrX3Y0YaHcbCQsHw3NPcRPK0am3NCezumw==", "dev": true, "requires": { - "@ory/client": "^0.2.0-alpha.16", + "@ory/client": "^1.1.0", "@types/tldjs": "^2.3.1", "cookie": "^0.4.1", "istextorbinary": "^6.0.0", @@ -37726,6 +37762,82 @@ "request": "^2.88.2", "set-cookie-parser": "^2.4.8", "tldjs": "^2.3.1" + }, + "dependencies": { + "next": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/next/-/next-13.0.6.tgz", + "integrity": "sha512-COvigvms2LRt1rrzfBQcMQ2GZd86Mvk1z+LOLY5pniFtL4VrTmhZ9salrbKfSiXbhsD01TrDdD68ec3ABDyscA==", + "dev": true, + "requires": { + "@next/env": "13.0.6", + "@next/swc-android-arm-eabi": "13.0.6", + "@next/swc-android-arm64": "13.0.6", + "@next/swc-darwin-arm64": "13.0.6", + "@next/swc-darwin-x64": "13.0.6", + "@next/swc-freebsd-x64": "13.0.6", + "@next/swc-linux-arm-gnueabihf": "13.0.6", + "@next/swc-linux-arm64-gnu": "13.0.6", + "@next/swc-linux-arm64-musl": "13.0.6", + "@next/swc-linux-x64-gnu": "13.0.6", + "@next/swc-linux-x64-musl": "13.0.6", + "@next/swc-win32-arm64-msvc": "13.0.6", + "@next/swc-win32-ia32-msvc": "13.0.6", + "@next/swc-win32-x64-msvc": "13.0.6", + "@swc/helpers": "0.4.14", + "caniuse-lite": "^1.0.30001406", + "postcss": "8.4.14", + "styled-jsx": "5.1.0" + } + }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "postcss": { + "version": "8.4.14", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", + "integrity": "sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==", + "dev": true, + "requires": { + "nanoid": "^3.3.4", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + } + }, + "react": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "dev": true, + "peer": true, + "requires": { + "loose-envify": "^1.1.0" + } + }, + "react-dom": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "dev": true, + "peer": true, + "requires": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.0" + } + }, + "scheduler": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "dev": true, + "peer": true, + "requires": { + "loose-envify": "^1.1.0" + } + } } }, "@parcel/watcher": { @@ -39590,9 +39702,9 @@ } }, "@swc/helpers": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.3.tgz", - "integrity": "sha512-6JrF+fdUK2zbGpJIlN7G3v966PQjyx/dPt1T9km2wj+EUBqgrxCk3uX4Kct16MIm9gGxfKRcfax2hVf5jvlTzA==", + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.14.tgz", + "integrity": "sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==", "dev": true, "requires": { "tslib": "^2.4.0" @@ -41965,9 +42077,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001383", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001383.tgz", - "integrity": "sha512-swMpEoTp5vDoGBZsYZX7L7nXHe6dsHxi9o6/LKf/f0LukVtnrxly5GVb/fWdCDTqi/yw6Km6tiJ0pmBacm0gbg==", + "version": "1.0.30001439", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001439.tgz", + "integrity": "sha512-1MgUzEkoMO6gKfXflStpYgZDlFM7M/ck/bgfVCACO5vnAf0fXoNVHdWtqGU+MYca+4bL9Z5bpOVmR33cWW9G2A==", "dev": true }, "capture-exit": { @@ -42239,6 +42351,12 @@ "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", "dev": true }, + "client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", + "dev": true + }, "cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -49275,52 +49393,6 @@ "integrity": "sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==", "dev": true }, - "next": { - "version": "12.2.5", - "resolved": "https://registry.npmjs.org/next/-/next-12.2.5.tgz", - "integrity": "sha512-tBdjqX5XC/oFs/6gxrZhjmiq90YWizUYU6qOWAfat7zJwrwapJ+BYgX2PmiacunXMaRpeVT4vz5MSPSLgNkrpA==", - "dev": true, - "requires": { - "@next/env": "12.2.5", - "@next/swc-android-arm-eabi": "12.2.5", - "@next/swc-android-arm64": "12.2.5", - "@next/swc-darwin-arm64": "12.2.5", - "@next/swc-darwin-x64": "12.2.5", - "@next/swc-freebsd-x64": "12.2.5", - "@next/swc-linux-arm-gnueabihf": "12.2.5", - "@next/swc-linux-arm64-gnu": "12.2.5", - "@next/swc-linux-arm64-musl": "12.2.5", - "@next/swc-linux-x64-gnu": "12.2.5", - "@next/swc-linux-x64-musl": "12.2.5", - "@next/swc-win32-arm64-msvc": "12.2.5", - "@next/swc-win32-ia32-msvc": "12.2.5", - "@next/swc-win32-x64-msvc": "12.2.5", - "@swc/helpers": "0.4.3", - "caniuse-lite": "^1.0.30001332", - "postcss": "8.4.14", - "styled-jsx": "5.0.4", - "use-sync-external-store": "1.2.0" - }, - "dependencies": { - "picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true - }, - "postcss": { - "version": "8.4.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", - "integrity": "sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==", - "dev": true, - "requires": { - "nanoid": "^3.3.4", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" - } - } - } - }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -54307,11 +54379,13 @@ } }, "styled-jsx": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.0.4.tgz", - "integrity": "sha512-sDFWLbg4zR+UkNzfk5lPilyIgtpddfxXEULxhujorr5jtePTUqiPDc5BC0v1NRqTr/WaFBGQQUoYToGlF4B2KQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.0.tgz", + "integrity": "sha512-/iHaRJt9U7T+5tp6TRelLnqBqiaIT0HsO0+vgyj8hK2KUk7aejFqRrumqPUlAqDwAj8IbS/1hk3IhBAAK/FCUQ==", "dev": true, - "requires": {} + "requires": { + "client-only": "0.0.1" + } }, "supports-color": { "version": "5.5.0", @@ -55575,13 +55649,6 @@ "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", "dev": true }, - "use-sync-external-store": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", - "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", - "dev": true, - "requires": {} - }, "util": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", diff --git a/package.json b/package.json index fd0405bd3..39632f182 100644 --- a/package.json +++ b/package.json @@ -34,10 +34,10 @@ }, "devDependencies": { "@babel/core": "^7.18.10", - "@ory/client": "^0.2.0-alpha.60", + "@ory/client": "^1.1.0", "@ory/elements": "*", "@ory/elements-test": "*", - "@ory/integrations": "^0.2.7", + "@ory/integrations": "^1.1.0", "@playwright/experimental-ct-react": "^1.25.0", "@playwright/test": "^1.25.1", "@preact/preset-vite": "^2.3.0", diff --git a/src/react-components/ory/helpers/types.ts b/src/react-components/ory/helpers/types.ts index a7261b0bb..fd55038b1 100644 --- a/src/react-components/ory/helpers/types.ts +++ b/src/react-components/ory/helpers/types.ts @@ -2,16 +2,16 @@ // SPDX-License-Identifier: Apache-2.0 import { - SelfServiceLoginFlow, - SelfServiceRecoveryFlow, - SelfServiceRegistrationFlow, - SelfServiceSettingsFlow, - SelfServiceVerificationFlow, + LoginFlow, + RecoveryFlow, + RegistrationFlow, + SettingsFlow, + VerificationFlow, } from "@ory/client" export type SelfServiceFlow = - | SelfServiceLoginFlow - | SelfServiceRecoveryFlow - | SelfServiceRegistrationFlow - | SelfServiceSettingsFlow - | SelfServiceVerificationFlow + | LoginFlow + | RecoveryFlow + | RegistrationFlow + | SettingsFlow + | VerificationFlow diff --git a/src/react-components/ory/helpers/user-auth-form.tsx b/src/react-components/ory/helpers/user-auth-form.tsx index b1df5e158..2749cf9c1 100644 --- a/src/react-components/ory/helpers/user-auth-form.tsx +++ b/src/react-components/ory/helpers/user-auth-form.tsx @@ -1,9 +1,9 @@ import { - SubmitSelfServiceLoginFlowBody, - SubmitSelfServiceRecoveryFlowBody, - SubmitSelfServiceRegistrationFlowBody, - SubmitSelfServiceSettingsFlowBody, - SubmitSelfServiceVerificationFlowBody, + UpdateLoginFlowBody, + UpdateRecoveryFlowBody, + UpdateRegistrationFlowBody, + UpdateSettingsFlowBody, + UpdateVerificationFlowBody, } from "@ory/client" import { FilterNodesByGroups } from "@ory/integrations/ui" import cn from "classnames" @@ -18,11 +18,11 @@ export type UserAuthFormAdditionalProps = { event, }: { body: - | SubmitSelfServiceLoginFlowBody - | SubmitSelfServiceRegistrationFlowBody - | SubmitSelfServiceRecoveryFlowBody - | SubmitSelfServiceVerificationFlowBody - | SubmitSelfServiceSettingsFlowBody + | UpdateLoginFlowBody + | UpdateRegistrationFlowBody + | UpdateRecoveryFlowBody + | UpdateVerificationFlowBody + | UpdateSettingsFlowBody event?: React.FormEvent }) => void } @@ -66,11 +66,11 @@ export const UserAuthForm = ({ // map the entire form data to JSON for the request body let body = Object.fromEntries(formData) as unknown as - | SubmitSelfServiceLoginFlowBody - | SubmitSelfServiceRegistrationFlowBody - | SubmitSelfServiceRecoveryFlowBody - | SubmitSelfServiceVerificationFlowBody - | SubmitSelfServiceSettingsFlowBody + | UpdateLoginFlowBody + | UpdateRegistrationFlowBody + | UpdateRecoveryFlowBody + | UpdateVerificationFlowBody + | UpdateSettingsFlowBody // We need the method specified from the name and value of the submit button. // when multiple submit buttons are present, the clicked one's value is used. diff --git a/src/react-components/ory/user-auth-card.tsx b/src/react-components/ory/user-auth-card.tsx index 8e45f8047..040e0773d 100644 --- a/src/react-components/ory/user-auth-card.tsx +++ b/src/react-components/ory/user-auth-card.tsx @@ -1,4 +1,4 @@ -import { SelfServiceLoginFlow } from "@ory/client" +import { LoginFlow } from "@ory/client" import { filterNodesByGroups } from "@ory/integrations/ui" import React from "react" import { gridStyle, typographyStyle } from "../../theme" @@ -95,7 +95,7 @@ export const UserAuthCard = ({ let message: MessageSectionProps | null = null // the user might need to logout on the second factor page. - const isLoggedIn = (flow: SelfServiceLoginFlow): boolean => { + const isLoggedIn = (flow: LoginFlow): boolean => { return flow.refresh || flow.requested_aal === "aal2" } @@ -103,11 +103,11 @@ export const UserAuthCard = ({ // we want the login section to handle passwordless as well when we have a 2FA screen. const canShowPasswordless = () => !!$passwordless && - (!isLoggedIn(flow as SelfServiceLoginFlow) || flowType === "registration") + (!isLoggedIn(flow as LoginFlow) || flowType === "registration") // the current flow is a two factor flow if the user is logged in and has any of the second factor methods enabled. const isTwoFactor = () => - isLoggedIn(flow as SelfServiceLoginFlow) && + isLoggedIn(flow as LoginFlow) && flowType === "login" && (hasTotp(flow.ui.nodes) || hasWebauthn(flow.ui.nodes) || @@ -207,7 +207,7 @@ export const UserAuthCard = ({ ...additionalProps, }) - message = isLoggedIn(flow as SelfServiceLoginFlow) + message = isLoggedIn(flow as LoginFlow) ? { text: <>Something's not working?, buttonText: "Logout", diff --git a/src/react-components/ory/user-error-card.tsx b/src/react-components/ory/user-error-card.tsx index 83b7c072c..14be5f077 100644 --- a/src/react-components/ory/user-error-card.tsx +++ b/src/react-components/ory/user-error-card.tsx @@ -1,4 +1,4 @@ -import { SelfServiceError } from "@ory/client" +import { FlowError } from "@ory/client" import React from "react" import { colorSprinkle, gridStyle, typographyStyle } from "../../theme" import { ButtonLink } from "../button-link" @@ -9,7 +9,7 @@ import { Message } from "../message" // SelfServiceErrorCard props export type UserErrorCardProps = { title: string - error: SelfServiceError + error: FlowError backUrl: string cardImage?: string | React.ReactElement contactSupportEmail?: string diff --git a/src/react-components/ory/user-settings-card.tsx b/src/react-components/ory/user-settings-card.tsx index bfb40316e..62ee79019 100644 --- a/src/react-components/ory/user-settings-card.tsx +++ b/src/react-components/ory/user-settings-card.tsx @@ -1,4 +1,4 @@ -import { SelfServiceSettingsFlow } from "@ory/client" +import { SettingsFlow } from "@ory/client" import cn from "classnames" import { colorSprinkle, gridStyle, typographyStyle } from "../../theme" import { useScriptNodes } from "./helpers/node-script" @@ -29,7 +29,7 @@ export type UserSettingsFlowType = | "lookupSecret" export type UserSettingsCardProps = { - flow: SelfServiceSettingsFlow + flow: SettingsFlow flowType: UserSettingsFlowType title?: string includeScripts?: boolean