From e4b343c1b4134ed446394db592a70b3a0a0ad5f9 Mon Sep 17 00:00:00 2001 From: Nikita Elfimov Date: Wed, 11 Sep 2024 10:16:17 +0300 Subject: [PATCH 1/2] feat(identity-integration): bump versions, switch to esm --- .pnp.cjs | 711 +++++++----------- packages/identity-integration/package.json | 20 +- .../src/flows/error.flow.tsx | 8 +- .../src/flows/handle-errors.util.ts | 8 +- .../identity-integration/src/flows/index.ts | 14 +- .../src/flows/login.flow.tsx | 18 +- .../src/flows/logout.flow.tsx | 6 +- .../src/flows/recovery.flow.tsx | 17 +- .../src/flows/registration.flow.tsx | 23 +- .../src/flows/settings.flow.tsx | 18 +- .../src/flows/verification.flow.tsx | 15 +- packages/identity-integration/src/index.ts | 10 +- .../src/locales/ru/ru-messages.json | 2 +- .../src/messages/index.ts | 4 +- .../messages/localized-messages.interfaces.ts | 2 +- .../src/messages/localized-messages.ts | 9 +- .../src/providers/error.context.ts | 2 +- .../src/providers/flow.context.ts | 2 +- .../src/providers/index.ts | 28 +- .../src/providers/kratos-client.context.ts | 7 +- .../src/providers/submit.context.ts | 2 +- .../src/providers/use-error.hook.ts | 4 +- .../src/providers/use-flow-node.hook.ts | 2 +- .../src/providers/use-flow.hook.ts | 4 +- .../src/providers/use-kratos-client.hook.ts | 4 +- .../src/providers/use-submit.hook.ts | 4 +- .../src/providers/use-value.hook.ts | 4 +- .../src/providers/use-values.hook.ts | 4 +- .../src/providers/values.context.ts | 2 +- .../src/providers/values.store.ts | 10 +- .../identity-integration/src/sdk/index.ts | 4 +- .../src/ui/error-node.component.tsx | 4 +- .../src/ui/flow-messages.component.tsx | 11 +- .../src/ui/flow-node-messages.component.tsx | 8 +- .../src/ui/flow-node.component.tsx | 18 +- .../src/ui/flow-nodes-filter.component.tsx | 12 +- .../src/ui/flow-nodes-group.component.tsx | 18 +- .../src/ui/flow-submit.component.tsx | 9 +- packages/identity-integration/src/ui/index.ts | 16 +- yarn.lock | 621 ++++++--------- 40 files changed, 695 insertions(+), 990 deletions(-) diff --git a/.pnp.cjs b/.pnp.cjs index c85ca400..58a8ec27 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -211,9 +211,9 @@ const RAW_RUNTIME_STATE = ["@types/node", "npm:18.19.10"],\ ["@types/react", "npm:18.2.40"],\ ["@types/react-dom", "npm:18.2.10"],\ - ["next", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:14.1.0"],\ + ["next", "virtual:3fb9ffcfd494380af48431fe188f0621c3a43ad3e8c2a3e9163ea3a134c01df40ca32ec70cae93d098ab7c70527ae493ef1548bee4091ff653ef51f02df4adb6#npm:14.1.0"],\ ["react", "npm:18.2.0"],\ - ["react-dom", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:18.2.0"]\ + ["react-dom", "virtual:3fb9ffcfd494380af48431fe188f0621c3a43ad3e8c2a3e9163ea3a134c01df40ca32ec70cae93d098ab7c70527ae493ef1548bee4091ff653ef51f02df4adb6#npm:18.2.0"]\ ],\ "linkType": "SOFT"\ }]\ @@ -226,9 +226,9 @@ const RAW_RUNTIME_STATE = ["@types/node", "npm:18.19.10"],\ ["@types/react", "npm:18.2.40"],\ ["@types/react-dom", "npm:18.2.10"],\ - ["next", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:14.1.0"],\ + ["next", "virtual:3fb9ffcfd494380af48431fe188f0621c3a43ad3e8c2a3e9163ea3a134c01df40ca32ec70cae93d098ab7c70527ae493ef1548bee4091ff653ef51f02df4adb6#npm:14.1.0"],\ ["react", "npm:18.2.0"],\ - ["react-dom", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:18.2.0"],\ + ["react-dom", "virtual:3fb9ffcfd494380af48431fe188f0621c3a43ad3e8c2a3e9163ea3a134c01df40ca32ec70cae93d098ab7c70527ae493ef1548bee4091ff653ef51f02df4adb6#npm:18.2.0"],\ ["react-helmet", "virtual:bf8a1598fa6a66838edf04cd1858984042966b4dcd6467a6373e96df1c74a52c69bba5507bf11b15cc923202e7da164deec40286571ad0c3340926914fe509d0#npm:6.1.0"]\ ],\ "linkType": "SOFT"\ @@ -242,9 +242,9 @@ const RAW_RUNTIME_STATE = ["@types/node", "npm:18.19.10"],\ ["@types/react", "npm:18.2.40"],\ ["@types/react-dom", "npm:18.2.10"],\ - ["next", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:14.1.0"],\ + ["next", "virtual:3fb9ffcfd494380af48431fe188f0621c3a43ad3e8c2a3e9163ea3a134c01df40ca32ec70cae93d098ab7c70527ae493ef1548bee4091ff653ef51f02df4adb6#npm:14.1.0"],\ ["react", "npm:18.2.0"],\ - ["react-dom", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:18.2.0"]\ + ["react-dom", "virtual:3fb9ffcfd494380af48431fe188f0621c3a43ad3e8c2a3e9163ea3a134c01df40ca32ec70cae93d098ab7c70527ae493ef1548bee4091ff653ef51f02df4adb6#npm:18.2.0"]\ ],\ "linkType": "SOFT"\ }]\ @@ -257,9 +257,9 @@ const RAW_RUNTIME_STATE = ["@types/node", "npm:18.19.10"],\ ["@types/react", "npm:18.2.40"],\ ["@types/react-dom", "npm:18.2.10"],\ - ["next", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:14.1.0"],\ + ["next", "virtual:3fb9ffcfd494380af48431fe188f0621c3a43ad3e8c2a3e9163ea3a134c01df40ca32ec70cae93d098ab7c70527ae493ef1548bee4091ff653ef51f02df4adb6#npm:14.1.0"],\ ["react", "npm:18.2.0"],\ - ["react-dom", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:18.2.0"]\ + ["react-dom", "virtual:3fb9ffcfd494380af48431fe188f0621c3a43ad3e8c2a3e9163ea3a134c01df40ca32ec70cae93d098ab7c70527ae493ef1548bee4091ff653ef51f02df4adb6#npm:18.2.0"]\ ],\ "linkType": "SOFT"\ }]\ @@ -269,16 +269,16 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/identity-integration/",\ "packageDependencies": [\ ["@atls/next-identity-integration", "workspace:packages/identity-integration"],\ - ["@ory/client", "npm:1.2.11"],\ - ["@ory/integrations", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:1.1.5"],\ - ["@ory/kratos-client", "npm:1.0.0"],\ + ["@ory/client", "npm:1.14.5"],\ + ["@ory/integrations", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:1.2.1"],\ + ["@ory/kratos-client", "npm:1.2.1"],\ ["@types/react", "npm:18.2.40"],\ ["@types/react-dom", "npm:18.2.10"],\ ["@types/tldjs", "npm:2.3.4"],\ ["axios", "npm:1.5.1"],\ - ["next", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:14.1.0"],\ - ["react", "npm:18.2.0"],\ - ["react-dom", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:18.2.0"],\ + ["next", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:14.2.9"],\ + ["react", "npm:18.3.1"],\ + ["react-dom", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:18.3.1"],\ ["tldjs", "npm:2.3.1"]\ ],\ "linkType": "SOFT"\ @@ -1789,6 +1789,13 @@ const RAW_RUNTIME_STATE = ["@next/env", "npm:14.1.0"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:14.2.9", {\ + "packageLocation": "../.yarn/berry/cache/@next-env-npm-14.2.9-a77f9bfce7-10.zip/node_modules/@next/env/",\ + "packageDependencies": [\ + ["@next/env", "npm:14.2.9"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["@next/eslint-plugin-next", [\ @@ -1808,6 +1815,13 @@ const RAW_RUNTIME_STATE = ["@next/swc-darwin-arm64", "npm:14.1.0"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:14.2.9", {\ + "packageLocation": "./.yarn/unplugged/@next-swc-darwin-arm64-npm-14.2.9-efe42f73a9/node_modules/@next/swc-darwin-arm64/",\ + "packageDependencies": [\ + ["@next/swc-darwin-arm64", "npm:14.2.9"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["@next/swc-darwin-x64", [\ @@ -1817,6 +1831,13 @@ const RAW_RUNTIME_STATE = ["@next/swc-darwin-x64", "npm:14.1.0"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:14.2.9", {\ + "packageLocation": "./.yarn/unplugged/@next-swc-darwin-x64-npm-14.2.9-258c166506/node_modules/@next/swc-darwin-x64/",\ + "packageDependencies": [\ + ["@next/swc-darwin-x64", "npm:14.2.9"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["@next/swc-linux-arm64-gnu", [\ @@ -1826,6 +1847,13 @@ const RAW_RUNTIME_STATE = ["@next/swc-linux-arm64-gnu", "npm:14.1.0"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:14.2.9", {\ + "packageLocation": "./.yarn/unplugged/@next-swc-linux-arm64-gnu-npm-14.2.9-9bc682653b/node_modules/@next/swc-linux-arm64-gnu/",\ + "packageDependencies": [\ + ["@next/swc-linux-arm64-gnu", "npm:14.2.9"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["@next/swc-linux-arm64-musl", [\ @@ -1835,6 +1863,13 @@ const RAW_RUNTIME_STATE = ["@next/swc-linux-arm64-musl", "npm:14.1.0"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:14.2.9", {\ + "packageLocation": "./.yarn/unplugged/@next-swc-linux-arm64-musl-npm-14.2.9-d6d526ec92/node_modules/@next/swc-linux-arm64-musl/",\ + "packageDependencies": [\ + ["@next/swc-linux-arm64-musl", "npm:14.2.9"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["@next/swc-linux-x64-gnu", [\ @@ -1844,6 +1879,13 @@ const RAW_RUNTIME_STATE = ["@next/swc-linux-x64-gnu", "npm:14.1.0"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:14.2.9", {\ + "packageLocation": "./.yarn/unplugged/@next-swc-linux-x64-gnu-npm-14.2.9-65d456936a/node_modules/@next/swc-linux-x64-gnu/",\ + "packageDependencies": [\ + ["@next/swc-linux-x64-gnu", "npm:14.2.9"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["@next/swc-linux-x64-musl", [\ @@ -1853,6 +1895,13 @@ const RAW_RUNTIME_STATE = ["@next/swc-linux-x64-musl", "npm:14.1.0"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:14.2.9", {\ + "packageLocation": "./.yarn/unplugged/@next-swc-linux-x64-musl-npm-14.2.9-a590bee8fd/node_modules/@next/swc-linux-x64-musl/",\ + "packageDependencies": [\ + ["@next/swc-linux-x64-musl", "npm:14.2.9"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["@next/swc-win32-arm64-msvc", [\ @@ -1862,6 +1911,13 @@ const RAW_RUNTIME_STATE = ["@next/swc-win32-arm64-msvc", "npm:14.1.0"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:14.2.9", {\ + "packageLocation": "./.yarn/unplugged/@next-swc-win32-arm64-msvc-npm-14.2.9-0626fd6098/node_modules/@next/swc-win32-arm64-msvc/",\ + "packageDependencies": [\ + ["@next/swc-win32-arm64-msvc", "npm:14.2.9"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["@next/swc-win32-ia32-msvc", [\ @@ -1871,6 +1927,13 @@ const RAW_RUNTIME_STATE = ["@next/swc-win32-ia32-msvc", "npm:14.1.0"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:14.2.9", {\ + "packageLocation": "./.yarn/unplugged/@next-swc-win32-ia32-msvc-npm-14.2.9-3d92c430f4/node_modules/@next/swc-win32-ia32-msvc/",\ + "packageDependencies": [\ + ["@next/swc-win32-ia32-msvc", "npm:14.2.9"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["@next/swc-win32-x64-msvc", [\ @@ -1880,6 +1943,13 @@ const RAW_RUNTIME_STATE = ["@next/swc-win32-x64-msvc", "npm:14.1.0"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:14.2.9", {\ + "packageLocation": "./.yarn/unplugged/@next-swc-win32-x64-msvc-npm-14.2.9-83b0931696/node_modules/@next/swc-win32-x64-msvc/",\ + "packageDependencies": [\ + ["@next/swc-win32-x64-msvc", "npm:14.2.9"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["@nodelib/fs.scandir", [\ @@ -1938,37 +2008,36 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@ory/client", [\ - ["npm:1.2.11", {\ - "packageLocation": "../.yarn/berry/cache/@ory-client-npm-1.2.11-20a2fd611b-10.zip/node_modules/@ory/client/",\ + ["npm:1.14.5", {\ + "packageLocation": "../.yarn/berry/cache/@ory-client-npm-1.14.5-5971dfd08c-10.zip/node_modules/@ory/client/",\ "packageDependencies": [\ - ["@ory/client", "npm:1.2.11"],\ - ["axios", "npm:0.21.4"]\ + ["@ory/client", "npm:1.14.5"],\ + ["axios", "npm:1.7.7"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@ory/integrations", [\ - ["npm:1.1.5", {\ - "packageLocation": "../.yarn/berry/cache/@ory-integrations-npm-1.1.5-6931081dde-10.zip/node_modules/@ory/integrations/",\ + ["npm:1.2.1", {\ + "packageLocation": "../.yarn/berry/cache/@ory-integrations-npm-1.2.1-fcfb4c3086-10.zip/node_modules/@ory/integrations/",\ "packageDependencies": [\ - ["@ory/integrations", "npm:1.1.5"]\ + ["@ory/integrations", "npm:1.2.1"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:1.1.5", {\ - "packageLocation": "./.yarn/__virtual__/@ory-integrations-virtual-a8f747bf48/2/.yarn/berry/cache/@ory-integrations-npm-1.1.5-6931081dde-10.zip/node_modules/@ory/integrations/",\ + ["virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:1.2.1", {\ + "packageLocation": "./.yarn/__virtual__/@ory-integrations-virtual-21387a4271/2/.yarn/berry/cache/@ory-integrations-npm-1.2.1-fcfb4c3086-10.zip/node_modules/@ory/integrations/",\ "packageDependencies": [\ - ["@ory/integrations", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:1.1.5"],\ - ["@ory/client", "npm:1.2.11"],\ + ["@ory/integrations", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:1.2.1"],\ + ["@ory/client", "npm:1.14.5"],\ ["@types/next", null],\ ["@types/ory__client", null],\ - ["@types/tldjs", "npm:2.3.1"],\ - ["cookie", "npm:0.5.0"],\ - ["istextorbinary", "npm:6.0.0"],\ - ["next", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:14.1.0"],\ + ["@types/tldjs", "npm:2.3.4"],\ + ["cookie", "npm:0.6.0"],\ + ["istextorbinary", "npm:9.5.0"],\ + ["next", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:14.2.9"],\ ["ory-prettier-styles", "npm:1.3.0"],\ - ["prettier", "npm:2.3.2"],\ - ["request", "npm:2.88.2"],\ + ["prettier", "npm:3.2.5"],\ ["set-cookie-parser", "npm:2.6.0"],\ ["tldjs", "npm:2.3.1"]\ ],\ @@ -1982,11 +2051,11 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@ory/kratos-client", [\ - ["npm:1.0.0", {\ - "packageLocation": "../.yarn/berry/cache/@ory-kratos-client-npm-1.0.0-d902522584-10.zip/node_modules/@ory/kratos-client/",\ + ["npm:1.2.1", {\ + "packageLocation": "../.yarn/berry/cache/@ory-kratos-client-npm-1.2.1-3ac961fde3-10.zip/node_modules/@ory/kratos-client/",\ "packageDependencies": [\ - ["@ory/kratos-client", "npm:1.0.0"],\ - ["axios", "npm:0.21.4"]\ + ["@ory/kratos-client", "npm:1.2.1"],\ + ["axios", "npm:1.7.7"]\ ],\ "linkType": "HARD"\ }]\ @@ -2459,6 +2528,15 @@ const RAW_RUNTIME_STATE = ["tslib", "npm:2.7.0"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:0.5.5", {\ + "packageLocation": "../.yarn/berry/cache/@swc-helpers-npm-0.5.5-a0698e6ac9-10.zip/node_modules/@swc/helpers/",\ + "packageDependencies": [\ + ["@swc/helpers", "npm:0.5.5"],\ + ["@swc/counter", "npm:0.1.3"],\ + ["tslib", "npm:2.7.0"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["@swc/jest", [\ @@ -2715,13 +2793,6 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@types/tldjs", [\ - ["npm:2.3.1", {\ - "packageLocation": "../.yarn/berry/cache/@types-tldjs-npm-2.3.1-5df0bfec5c-10.zip/node_modules/@types/tldjs/",\ - "packageDependencies": [\ - ["@types/tldjs", "npm:2.3.1"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:2.3.4", {\ "packageLocation": "../.yarn/berry/cache/@types-tldjs-npm-2.3.4-db0b02e2c1-10.zip/node_modules/@types/tldjs/",\ "packageDependencies": [\ @@ -3493,25 +3564,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["asn1", [\ - ["npm:0.2.6", {\ - "packageLocation": "../.yarn/berry/cache/asn1-npm-0.2.6-bdd07356c4-10.zip/node_modules/asn1/",\ - "packageDependencies": [\ - ["asn1", "npm:0.2.6"],\ - ["safer-buffer", "npm:2.1.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["assert-plus", [\ - ["npm:1.0.0", {\ - "packageLocation": "../.yarn/berry/cache/assert-plus-npm-1.0.0-cac95ef098-10.zip/node_modules/assert-plus/",\ - "packageDependencies": [\ - ["assert-plus", "npm:1.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["ast-types-flow", [\ ["npm:0.0.8", {\ "packageLocation": "../.yarn/berry/cache/ast-types-flow-npm-0.0.8-d5c457c18e-10.zip/node_modules/ast-types-flow/",\ @@ -3540,24 +3592,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["aws-sign2", [\ - ["npm:0.7.0", {\ - "packageLocation": "../.yarn/berry/cache/aws-sign2-npm-0.7.0-656c6cb84d-10.zip/node_modules/aws-sign2/",\ - "packageDependencies": [\ - ["aws-sign2", "npm:0.7.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["aws4", [\ - ["npm:1.12.0", {\ - "packageLocation": "../.yarn/berry/cache/aws4-npm-1.12.0-af8e48a2ab-10.zip/node_modules/aws4/",\ - "packageDependencies": [\ - ["aws4", "npm:1.12.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["axe-core", [\ ["npm:4.10.0", {\ "packageLocation": "../.yarn/berry/cache/axe-core-npm-4.10.0-90ec287b5d-10.zip/node_modules/axe-core/",\ @@ -3568,19 +3602,21 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["axios", [\ - ["npm:0.21.4", {\ - "packageLocation": "../.yarn/berry/cache/axios-npm-0.21.4-e278873748-10.zip/node_modules/axios/",\ + ["npm:1.5.1", {\ + "packageLocation": "../.yarn/berry/cache/axios-npm-1.5.1-6bc68e7d25-10.zip/node_modules/axios/",\ "packageDependencies": [\ - ["axios", "npm:0.21.4"],\ - ["follow-redirects", "virtual:e278873748b4e9d158db595d2f6cb0351c74052f52b53924aec4d9299e7b6babfb62aead374cf2f6e453bc8bea3b052380dc6b1137a162bbfc102bbb1c8cac42#npm:1.15.5"]\ + ["axios", "npm:1.5.1"],\ + ["follow-redirects", "virtual:cfbedc233d4c16068d815547ad303dec1092fdb3b8bb4ec9ab9c56bdd55b4e87650c7a525a88805756f4d2819c03abfd96a9983cfa927fedf995d1b8b879db38#npm:1.15.9"],\ + ["form-data", "npm:4.0.0"],\ + ["proxy-from-env", "npm:1.1.0"]\ ],\ "linkType": "HARD"\ }],\ - ["npm:1.5.1", {\ - "packageLocation": "../.yarn/berry/cache/axios-npm-1.5.1-6bc68e7d25-10.zip/node_modules/axios/",\ + ["npm:1.7.7", {\ + "packageLocation": "../.yarn/berry/cache/axios-npm-1.7.7-cfbedc233d-10.zip/node_modules/axios/",\ "packageDependencies": [\ - ["axios", "npm:1.5.1"],\ - ["follow-redirects", "virtual:e278873748b4e9d158db595d2f6cb0351c74052f52b53924aec4d9299e7b6babfb62aead374cf2f6e453bc8bea3b052380dc6b1137a162bbfc102bbb1c8cac42#npm:1.15.5"],\ + ["axios", "npm:1.7.7"],\ + ["follow-redirects", "virtual:cfbedc233d4c16068d815547ad303dec1092fdb3b8bb4ec9ab9c56bdd55b4e87650c7a525a88805756f4d2819c03abfd96a9983cfa927fedf995d1b8b879db38#npm:1.15.9"],\ ["form-data", "npm:4.0.0"],\ ["proxy-from-env", "npm:1.1.0"]\ ],\ @@ -3800,16 +3836,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["bcrypt-pbkdf", [\ - ["npm:1.0.2", {\ - "packageLocation": "../.yarn/berry/cache/bcrypt-pbkdf-npm-1.0.2-80db8b16ed-10.zip/node_modules/bcrypt-pbkdf/",\ - "packageDependencies": [\ - ["bcrypt-pbkdf", "npm:1.0.2"],\ - ["tweetnacl", "npm:0.14.5"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["big.js", [\ ["npm:5.2.2", {\ "packageLocation": "../.yarn/berry/cache/big.js-npm-5.2.2-e147c30820-10.zip/node_modules/big.js/",\ @@ -3820,10 +3846,11 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["binaryextensions", [\ - ["npm:4.19.0", {\ - "packageLocation": "../.yarn/berry/cache/binaryextensions-npm-4.19.0-d384ae168b-10.zip/node_modules/binaryextensions/",\ + ["npm:6.11.0", {\ + "packageLocation": "../.yarn/berry/cache/binaryextensions-npm-6.11.0-f49dc07d80-10.zip/node_modules/binaryextensions/",\ "packageDependencies": [\ - ["binaryextensions", "npm:4.19.0"]\ + ["binaryextensions", "npm:6.11.0"],\ + ["editions", "npm:6.21.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -3978,15 +4005,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["caseless", [\ - ["npm:0.12.0", {\ - "packageLocation": "../.yarn/berry/cache/caseless-npm-0.12.0-e83bc5df83-10.zip/node_modules/caseless/",\ - "packageDependencies": [\ - ["caseless", "npm:0.12.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["chalk", [\ ["npm:2.4.2", {\ "packageLocation": "../.yarn/berry/cache/chalk-npm-2.4.2-3ea16dd91e-10.zip/node_modules/chalk/",\ @@ -4168,19 +4186,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["cookie", [\ - ["npm:0.5.0", {\ - "packageLocation": "../.yarn/berry/cache/cookie-npm-0.5.0-e2d58a161a-10.zip/node_modules/cookie/",\ - "packageDependencies": [\ - ["cookie", "npm:0.5.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["core-util-is", [\ - ["npm:1.0.2", {\ - "packageLocation": "../.yarn/berry/cache/core-util-is-npm-1.0.2-9fc2b94dc3-10.zip/node_modules/core-util-is/",\ + ["npm:0.6.0", {\ + "packageLocation": "../.yarn/berry/cache/cookie-npm-0.6.0-362d6a2e45-10.zip/node_modules/cookie/",\ "packageDependencies": [\ - ["core-util-is", "npm:1.0.2"]\ + ["cookie", "npm:0.6.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -4241,16 +4250,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["dashdash", [\ - ["npm:1.14.1", {\ - "packageLocation": "../.yarn/berry/cache/dashdash-npm-1.14.1-be8f10a286-10.zip/node_modules/dashdash/",\ - "packageDependencies": [\ - ["dashdash", "npm:1.14.1"],\ - ["assert-plus", "npm:1.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["data-view-buffer", [\ ["npm:1.0.1", {\ "packageLocation": "../.yarn/berry/cache/data-view-buffer-npm-1.0.1-d911beebce-10.zip/node_modules/data-view-buffer/",\ @@ -4511,13 +4510,12 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["ecc-jsbn", [\ - ["npm:0.1.2", {\ - "packageLocation": "../.yarn/berry/cache/ecc-jsbn-npm-0.1.2-85b7a7be89-10.zip/node_modules/ecc-jsbn/",\ + ["editions", [\ + ["npm:6.21.0", {\ + "packageLocation": "../.yarn/berry/cache/editions-npm-6.21.0-24ed678810-10.zip/node_modules/editions/",\ "packageDependencies": [\ - ["ecc-jsbn", "npm:0.1.2"],\ - ["jsbn", "npm:0.1.1"],\ - ["safer-buffer", "npm:2.1.2"]\ + ["editions", "npm:6.21.0"],\ + ["version-range", "npm:4.14.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -5378,31 +5376,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["extend", [\ - ["npm:3.0.2", {\ - "packageLocation": "../.yarn/berry/cache/extend-npm-3.0.2-e1ca07ac54-10.zip/node_modules/extend/",\ - "packageDependencies": [\ - ["extend", "npm:3.0.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["extsprintf", [\ - ["npm:1.3.0", {\ - "packageLocation": "../.yarn/berry/cache/extsprintf-npm-1.3.0-61a92b324c-10.zip/node_modules/extsprintf/",\ - "packageDependencies": [\ - ["extsprintf", "npm:1.3.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:1.4.1", {\ - "packageLocation": "../.yarn/berry/cache/extsprintf-npm-1.4.1-140b2f27ab-10.zip/node_modules/extsprintf/",\ - "packageDependencies": [\ - ["extsprintf", "npm:1.4.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["fast-deep-equal", [\ ["npm:3.1.3", {\ "packageLocation": "../.yarn/berry/cache/fast-deep-equal-npm-3.1.3-790edcfcf5-10.zip/node_modules/fast-deep-equal/",\ @@ -5535,17 +5508,17 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["follow-redirects", [\ - ["npm:1.15.5", {\ - "packageLocation": "../.yarn/berry/cache/follow-redirects-npm-1.15.5-9d14db76ca-10.zip/node_modules/follow-redirects/",\ + ["npm:1.15.9", {\ + "packageLocation": "../.yarn/berry/cache/follow-redirects-npm-1.15.9-539785d34c-10.zip/node_modules/follow-redirects/",\ "packageDependencies": [\ - ["follow-redirects", "npm:1.15.5"]\ + ["follow-redirects", "npm:1.15.9"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:e278873748b4e9d158db595d2f6cb0351c74052f52b53924aec4d9299e7b6babfb62aead374cf2f6e453bc8bea3b052380dc6b1137a162bbfc102bbb1c8cac42#npm:1.15.5", {\ - "packageLocation": "./.yarn/__virtual__/follow-redirects-virtual-bc31d41c99/2/.yarn/berry/cache/follow-redirects-npm-1.15.5-9d14db76ca-10.zip/node_modules/follow-redirects/",\ + ["virtual:cfbedc233d4c16068d815547ad303dec1092fdb3b8bb4ec9ab9c56bdd55b4e87650c7a525a88805756f4d2819c03abfd96a9983cfa927fedf995d1b8b879db38#npm:1.15.9", {\ + "packageLocation": "./.yarn/__virtual__/follow-redirects-virtual-334ade9a15/2/.yarn/berry/cache/follow-redirects-npm-1.15.9-539785d34c-10.zip/node_modules/follow-redirects/",\ "packageDependencies": [\ - ["follow-redirects", "virtual:e278873748b4e9d158db595d2f6cb0351c74052f52b53924aec4d9299e7b6babfb62aead374cf2f6e453bc8bea3b052380dc6b1137a162bbfc102bbb1c8cac42#npm:1.15.5"],\ + ["follow-redirects", "virtual:cfbedc233d4c16068d815547ad303dec1092fdb3b8bb4ec9ab9c56bdd55b4e87650c7a525a88805756f4d2819c03abfd96a9983cfa927fedf995d1b8b879db38#npm:1.15.9"],\ ["@types/debug", null],\ ["debug", null]\ ],\ @@ -5577,26 +5550,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["forever-agent", [\ - ["npm:0.6.1", {\ - "packageLocation": "../.yarn/berry/cache/forever-agent-npm-0.6.1-01dae53bf9-10.zip/node_modules/forever-agent/",\ - "packageDependencies": [\ - ["forever-agent", "npm:0.6.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["form-data", [\ - ["npm:2.3.3", {\ - "packageLocation": "../.yarn/berry/cache/form-data-npm-2.3.3-c016cc11c0-10.zip/node_modules/form-data/",\ - "packageDependencies": [\ - ["form-data", "npm:2.3.3"],\ - ["asynckit", "npm:0.4.0"],\ - ["combined-stream", "npm:1.0.8"],\ - ["mime-types", "npm:2.1.35"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:4.0.0", {\ "packageLocation": "../.yarn/berry/cache/form-data-npm-4.0.0-916facec2d-10.zip/node_modules/form-data/",\ "packageDependencies": [\ @@ -5729,16 +5683,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["getpass", [\ - ["npm:0.1.7", {\ - "packageLocation": "../.yarn/berry/cache/getpass-npm-0.1.7-519164a3be-10.zip/node_modules/getpass/",\ - "packageDependencies": [\ - ["getpass", "npm:0.1.7"],\ - ["assert-plus", "npm:1.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["glob", [\ ["npm:10.3.10", {\ "packageLocation": "../.yarn/berry/cache/glob-npm-10.3.10-da1ef8b112-10.zip/node_modules/glob/",\ @@ -5876,26 +5820,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["har-schema", [\ - ["npm:2.0.0", {\ - "packageLocation": "../.yarn/berry/cache/har-schema-npm-2.0.0-3a318c0ca5-10.zip/node_modules/har-schema/",\ - "packageDependencies": [\ - ["har-schema", "npm:2.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["har-validator", [\ - ["npm:5.1.5", {\ - "packageLocation": "../.yarn/berry/cache/har-validator-npm-5.1.5-bd9ac162f5-10.zip/node_modules/har-validator/",\ - "packageDependencies": [\ - ["har-validator", "npm:5.1.5"],\ - ["ajv", "npm:6.12.6"],\ - ["har-schema", "npm:2.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["has-bigints", [\ ["npm:1.0.2", {\ "packageLocation": "../.yarn/berry/cache/has-bigints-npm-1.0.2-52732e614d-10.zip/node_modules/has-bigints/",\ @@ -5998,18 +5922,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["http-signature", [\ - ["npm:1.2.0", {\ - "packageLocation": "../.yarn/berry/cache/http-signature-npm-1.2.0-ee92426f34-10.zip/node_modules/http-signature/",\ - "packageDependencies": [\ - ["http-signature", "npm:1.2.0"],\ - ["assert-plus", "npm:1.0.0"],\ - ["jsprim", "npm:1.4.2"],\ - ["sshpk", "npm:1.18.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["https-proxy-agent", [\ ["npm:7.0.2", {\ "packageLocation": "../.yarn/berry/cache/https-proxy-agent-npm-7.0.2-83ea6a5d42-10.zip/node_modules/https-proxy-agent/",\ @@ -6401,15 +6313,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["is-typedarray", [\ - ["npm:1.0.0", {\ - "packageLocation": "../.yarn/berry/cache/is-typedarray-npm-1.0.0-bbd99de5b6-10.zip/node_modules/is-typedarray/",\ - "packageDependencies": [\ - ["is-typedarray", "npm:1.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["is-weakmap", [\ ["npm:2.0.1", {\ "packageLocation": "../.yarn/berry/cache/is-weakmap-npm-2.0.1-88ca3d1dc4-10.zip/node_modules/is-weakmap/",\ @@ -6465,15 +6368,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["isstream", [\ - ["npm:0.1.2", {\ - "packageLocation": "../.yarn/berry/cache/isstream-npm-0.1.2-8581c75385-10.zip/node_modules/isstream/",\ - "packageDependencies": [\ - ["isstream", "npm:0.1.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["istanbul-lib-coverage", [\ ["npm:3.2.2", {\ "packageLocation": "../.yarn/berry/cache/istanbul-lib-coverage-npm-3.2.2-5c0526e059-10.zip/node_modules/istanbul-lib-coverage/",\ @@ -6545,12 +6439,13 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["istextorbinary", [\ - ["npm:6.0.0", {\ - "packageLocation": "../.yarn/berry/cache/istextorbinary-npm-6.0.0-601c96afac-10.zip/node_modules/istextorbinary/",\ + ["npm:9.5.0", {\ + "packageLocation": "../.yarn/berry/cache/istextorbinary-npm-9.5.0-3cb0b083e5-10.zip/node_modules/istextorbinary/",\ "packageDependencies": [\ - ["istextorbinary", "npm:6.0.0"],\ - ["binaryextensions", "npm:4.19.0"],\ - ["textextensions", "npm:5.16.0"]\ + ["istextorbinary", "npm:9.5.0"],\ + ["binaryextensions", "npm:6.11.0"],\ + ["editions", "npm:6.21.0"],\ + ["textextensions", "npm:6.11.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -7437,15 +7332,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["jsbn", [\ - ["npm:0.1.1", {\ - "packageLocation": "../.yarn/berry/cache/jsbn-npm-0.1.1-0eb7132404-10.zip/node_modules/jsbn/",\ - "packageDependencies": [\ - ["jsbn", "npm:0.1.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["jsesc", [\ ["npm:2.5.2", {\ "packageLocation": "../.yarn/berry/cache/jsesc-npm-2.5.2-c5acb78804-10.zip/node_modules/jsesc/",\ @@ -7473,15 +7359,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["json-schema", [\ - ["npm:0.4.0", {\ - "packageLocation": "../.yarn/berry/cache/json-schema-npm-0.4.0-e776313070-10.zip/node_modules/json-schema/",\ - "packageDependencies": [\ - ["json-schema", "npm:0.4.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["json-schema-traverse", [\ ["npm:0.4.1", {\ "packageLocation": "../.yarn/berry/cache/json-schema-traverse-npm-0.4.1-4759091693-10.zip/node_modules/json-schema-traverse/",\ @@ -7500,15 +7377,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["json-stringify-safe", [\ - ["npm:5.0.1", {\ - "packageLocation": "../.yarn/berry/cache/json-stringify-safe-npm-5.0.1-064ddd6ab4-10.zip/node_modules/json-stringify-safe/",\ - "packageDependencies": [\ - ["json-stringify-safe", "npm:5.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["json5", [\ ["npm:1.0.2", {\ "packageLocation": "../.yarn/berry/cache/json5-npm-1.0.2-9607f93e30-10.zip/node_modules/json5/",\ @@ -7535,19 +7403,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["jsprim", [\ - ["npm:1.4.2", {\ - "packageLocation": "../.yarn/berry/cache/jsprim-npm-1.4.2-1ae6cade9a-10.zip/node_modules/jsprim/",\ - "packageDependencies": [\ - ["jsprim", "npm:1.4.2"],\ - ["assert-plus", "npm:1.0.0"],\ - ["extsprintf", "npm:1.3.0"],\ - ["json-schema", "npm:0.4.0"],\ - ["verror", "npm:1.10.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["jsx-ast-utils", [\ ["npm:3.3.5", {\ "packageLocation": "../.yarn/berry/cache/jsx-ast-utils-npm-3.3.5-114c80f97a-10.zip/node_modules/jsx-ast-utils/",\ @@ -7994,10 +7849,17 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "SOFT"\ }],\ - ["virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:14.1.0", {\ - "packageLocation": "./.yarn/__virtual__/next-virtual-15ea52649b/2/.yarn/berry/cache/next-npm-14.1.0-a62036d298-10.zip/node_modules/next/",\ + ["npm:14.2.9", {\ + "packageLocation": "../.yarn/berry/cache/next-npm-14.2.9-85dfbff355-10.zip/node_modules/next/",\ "packageDependencies": [\ - ["next", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:14.1.0"],\ + ["next", "npm:14.2.9"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:3fb9ffcfd494380af48431fe188f0621c3a43ad3e8c2a3e9163ea3a134c01df40ca32ec70cae93d098ab7c70527ae493ef1548bee4091ff653ef51f02df4adb6#npm:14.1.0", {\ + "packageLocation": "./.yarn/__virtual__/next-virtual-f4dcb14a6c/2/.yarn/berry/cache/next-npm-14.1.0-a62036d298-10.zip/node_modules/next/",\ + "packageDependencies": [\ + ["next", "virtual:3fb9ffcfd494380af48431fe188f0621c3a43ad3e8c2a3e9163ea3a134c01df40ca32ec70cae93d098ab7c70527ae493ef1548bee4091ff653ef51f02df4adb6#npm:14.1.0"],\ ["@next/env", "npm:14.1.0"],\ ["@next/swc-darwin-arm64", "npm:14.1.0"],\ ["@next/swc-darwin-x64", "npm:14.1.0"],\ @@ -8019,13 +7881,58 @@ const RAW_RUNTIME_STATE = ["graceful-fs", "npm:4.2.11"],\ ["postcss", "npm:8.4.31"],\ ["react", "npm:18.2.0"],\ - ["react-dom", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:18.2.0"],\ + ["react-dom", "virtual:3fb9ffcfd494380af48431fe188f0621c3a43ad3e8c2a3e9163ea3a134c01df40ca32ec70cae93d098ab7c70527ae493ef1548bee4091ff653ef51f02df4adb6#npm:18.2.0"],\ + ["sass", null],\ + ["styled-jsx", "virtual:f4dcb14a6cc0bd210d66b07e0e082327efc6703c56f2cd1e0b7fb668d6f2b9ca0b03f0187775a9dbd26f26a039111dad9d0d01622c237ce257badd9982b8288b#npm:5.1.1"]\ + ],\ + "packagePeers": [\ + "@opentelemetry/api",\ + "@types/opentelemetry__api",\ + "@types/react-dom",\ + "@types/react",\ + "@types/sass",\ + "react-dom",\ + "react",\ + "sass"\ + ],\ + "linkType": "HARD"\ + }],\ + ["virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:14.2.9", {\ + "packageLocation": "./.yarn/__virtual__/next-virtual-7f610d6770/2/.yarn/berry/cache/next-npm-14.2.9-85dfbff355-10.zip/node_modules/next/",\ + "packageDependencies": [\ + ["next", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:14.2.9"],\ + ["@next/env", "npm:14.2.9"],\ + ["@next/swc-darwin-arm64", "npm:14.2.9"],\ + ["@next/swc-darwin-x64", "npm:14.2.9"],\ + ["@next/swc-linux-arm64-gnu", "npm:14.2.9"],\ + ["@next/swc-linux-arm64-musl", "npm:14.2.9"],\ + ["@next/swc-linux-x64-gnu", "npm:14.2.9"],\ + ["@next/swc-linux-x64-musl", "npm:14.2.9"],\ + ["@next/swc-win32-arm64-msvc", "npm:14.2.9"],\ + ["@next/swc-win32-ia32-msvc", "npm:14.2.9"],\ + ["@next/swc-win32-x64-msvc", "npm:14.2.9"],\ + ["@opentelemetry/api", null],\ + ["@playwright/test", null],\ + ["@swc/helpers", "npm:0.5.5"],\ + ["@types/opentelemetry__api", null],\ + ["@types/playwright__test", null],\ + ["@types/react", "npm:18.2.40"],\ + ["@types/react-dom", "npm:18.2.10"],\ + ["@types/sass", null],\ + ["busboy", "npm:1.6.0"],\ + ["caniuse-lite", "npm:1.0.30001660"],\ + ["graceful-fs", "npm:4.2.11"],\ + ["postcss", "npm:8.4.31"],\ + ["react", "npm:18.3.1"],\ + ["react-dom", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:18.3.1"],\ ["sass", null],\ - ["styled-jsx", "virtual:15ea52649b4fac9b0f5240f02827cb65f3c5bbe2effc6c5f2476401dae57d3ed39fd29db41522556187d860ec3de5f4a9b127b3b495a73047861098ef66eb36b#npm:5.1.1"]\ + ["styled-jsx", "virtual:7f610d677057983436fc212be1110549a2ea59d77fca7f98b42e5173e2c6d41e534f4c42bac23f075ed965cb3382933426f6c38949cbd9946f49577d35fca569#npm:5.1.1"]\ ],\ "packagePeers": [\ "@opentelemetry/api",\ + "@playwright/test",\ "@types/opentelemetry__api",\ + "@types/playwright__test",\ "@types/react-dom",\ "@types/react",\ "@types/sass",\ @@ -8173,15 +8080,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["oauth-sign", [\ - ["npm:0.9.0", {\ - "packageLocation": "../.yarn/berry/cache/oauth-sign-npm-0.9.0-7aa9422221-10.zip/node_modules/oauth-sign/",\ - "packageDependencies": [\ - ["oauth-sign", "npm:0.9.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["object-assign", [\ ["npm:4.1.1", {\ "packageLocation": "../.yarn/berry/cache/object-assign-npm-4.1.1-1004ad6dec-10.zip/node_modules/object-assign/",\ @@ -8460,15 +8358,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["performance-now", [\ - ["npm:2.1.0", {\ - "packageLocation": "../.yarn/berry/cache/performance-now-npm-2.1.0-45e3ce7e49-10.zip/node_modules/performance-now/",\ - "packageDependencies": [\ - ["performance-now", "npm:2.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["picocolors", [\ ["npm:1.1.0", {\ "packageLocation": "../.yarn/berry/cache/picocolors-npm-1.1.0-ea12a640bd-10.zip/node_modules/picocolors/",\ @@ -8527,10 +8416,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["prettier", [\ - ["npm:2.3.2", {\ - "packageLocation": "../.yarn/berry/cache/prettier-npm-2.3.2-4467ec48dc-10.zip/node_modules/prettier/",\ + ["npm:3.2.5", {\ + "packageLocation": "./.yarn/unplugged/prettier-npm-3.2.5-6859110d6a/node_modules/prettier/",\ "packageDependencies": [\ - ["prettier", "npm:2.3.2"]\ + ["prettier", "npm:3.2.5"]\ ],\ "linkType": "HARD"\ }],\ @@ -8616,15 +8505,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["psl", [\ - ["npm:1.9.0", {\ - "packageLocation": "../.yarn/berry/cache/psl-npm-1.9.0-a546edad1a-10.zip/node_modules/psl/",\ - "packageDependencies": [\ - ["psl", "npm:1.9.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["punycode", [\ ["npm:1.4.1", {\ "packageLocation": "../.yarn/berry/cache/punycode-npm-1.4.1-be4c23e6d2-10.zip/node_modules/punycode/",\ @@ -8650,15 +8530,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["qs", [\ - ["npm:6.5.3", {\ - "packageLocation": "../.yarn/berry/cache/qs-npm-6.5.3-90b2635484-10.zip/node_modules/qs/",\ - "packageDependencies": [\ - ["qs", "npm:6.5.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["queue-microtask", [\ ["npm:1.2.3", {\ "packageLocation": "../.yarn/berry/cache/queue-microtask-npm-1.2.3-fcc98e4e2d-10.zip/node_modules/queue-microtask/",\ @@ -8704,14 +8575,36 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "SOFT"\ }],\ - ["virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:18.2.0", {\ - "packageLocation": "./.yarn/__virtual__/react-dom-virtual-b40f7bfe23/2/.yarn/berry/cache/react-dom-npm-18.2.0-dd675bca1c-10.zip/node_modules/react-dom/",\ + ["npm:18.3.1", {\ + "packageLocation": "../.yarn/berry/cache/react-dom-npm-18.3.1-a805663f38-10.zip/node_modules/react-dom/",\ + "packageDependencies": [\ + ["react-dom", "npm:18.3.1"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:3fb9ffcfd494380af48431fe188f0621c3a43ad3e8c2a3e9163ea3a134c01df40ca32ec70cae93d098ab7c70527ae493ef1548bee4091ff653ef51f02df4adb6#npm:18.2.0", {\ + "packageLocation": "./.yarn/__virtual__/react-dom-virtual-a14abe9e08/2/.yarn/berry/cache/react-dom-npm-18.2.0-dd675bca1c-10.zip/node_modules/react-dom/",\ "packageDependencies": [\ - ["react-dom", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:18.2.0"],\ + ["react-dom", "virtual:3fb9ffcfd494380af48431fe188f0621c3a43ad3e8c2a3e9163ea3a134c01df40ca32ec70cae93d098ab7c70527ae493ef1548bee4091ff653ef51f02df4adb6#npm:18.2.0"],\ ["@types/react", "npm:18.2.40"],\ ["loose-envify", "npm:1.4.0"],\ ["react", "npm:18.2.0"],\ - ["scheduler", "npm:0.23.0"]\ + ["scheduler", "npm:0.23.2"]\ + ],\ + "packagePeers": [\ + "@types/react",\ + "react"\ + ],\ + "linkType": "HARD"\ + }],\ + ["virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:18.3.1", {\ + "packageLocation": "./.yarn/__virtual__/react-dom-virtual-07407507e0/2/.yarn/berry/cache/react-dom-npm-18.3.1-a805663f38-10.zip/node_modules/react-dom/",\ + "packageDependencies": [\ + ["react-dom", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:18.3.1"],\ + ["@types/react", "npm:18.2.40"],\ + ["loose-envify", "npm:1.4.0"],\ + ["react", "npm:18.3.1"],\ + ["scheduler", "npm:0.23.2"]\ ],\ "packagePeers": [\ "@types/react",\ @@ -8848,35 +8741,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["request", [\ - ["npm:2.88.2", {\ - "packageLocation": "../.yarn/berry/cache/request-npm-2.88.2-f4a57c72c4-10.zip/node_modules/request/",\ - "packageDependencies": [\ - ["request", "npm:2.88.2"],\ - ["aws-sign2", "npm:0.7.0"],\ - ["aws4", "npm:1.12.0"],\ - ["caseless", "npm:0.12.0"],\ - ["combined-stream", "npm:1.0.8"],\ - ["extend", "npm:3.0.2"],\ - ["forever-agent", "npm:0.6.1"],\ - ["form-data", "npm:2.3.3"],\ - ["har-validator", "npm:5.1.5"],\ - ["http-signature", "npm:1.2.0"],\ - ["is-typedarray", "npm:1.0.0"],\ - ["isstream", "npm:0.1.2"],\ - ["json-stringify-safe", "npm:5.0.1"],\ - ["mime-types", "npm:2.1.35"],\ - ["oauth-sign", "npm:0.9.0"],\ - ["performance-now", "npm:2.1.0"],\ - ["qs", "npm:6.5.3"],\ - ["safe-buffer", "npm:5.2.1"],\ - ["tough-cookie", "npm:2.5.0"],\ - ["tunnel-agent", "npm:0.6.0"],\ - ["uuid", "npm:3.4.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["resolve", [\ ["patch:resolve@npm%3A1.22.8#optional!builtin::version=1.22.8&hash=c3c19d", {\ "packageLocation": "../.yarn/berry/cache/resolve-patch-4254c24959-10.zip/node_modules/resolve/",\ @@ -9032,10 +8896,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["scheduler", [\ - ["npm:0.23.0", {\ - "packageLocation": "../.yarn/berry/cache/scheduler-npm-0.23.0-a379a6bc3b-10.zip/node_modules/scheduler/",\ + ["npm:0.23.2", {\ + "packageLocation": "../.yarn/berry/cache/scheduler-npm-0.23.2-6d1dd9c2b7-10.zip/node_modules/scheduler/",\ "packageDependencies": [\ - ["scheduler", "npm:0.23.0"],\ + ["scheduler", "npm:0.23.2"],\ ["loose-envify", "npm:1.4.0"]\ ],\ "linkType": "HARD"\ @@ -9279,24 +9143,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["sshpk", [\ - ["npm:1.18.0", {\ - "packageLocation": "../.yarn/berry/cache/sshpk-npm-1.18.0-e75427668c-10.zip/node_modules/sshpk/",\ - "packageDependencies": [\ - ["sshpk", "npm:1.18.0"],\ - ["asn1", "npm:0.2.6"],\ - ["assert-plus", "npm:1.0.0"],\ - ["bcrypt-pbkdf", "npm:1.0.2"],\ - ["dashdash", "npm:1.14.1"],\ - ["ecc-jsbn", "npm:0.1.2"],\ - ["getpass", "npm:0.1.7"],\ - ["jsbn", "npm:0.1.1"],\ - ["safer-buffer", "npm:2.1.2"],\ - ["tweetnacl", "npm:0.14.5"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["ssri", [\ ["npm:10.0.5", {\ "packageLocation": "../.yarn/berry/cache/ssri-npm-10.0.5-1a7557d04d-10.zip/node_modules/ssri/",\ @@ -9509,10 +9355,32 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "SOFT"\ }],\ - ["virtual:15ea52649b4fac9b0f5240f02827cb65f3c5bbe2effc6c5f2476401dae57d3ed39fd29db41522556187d860ec3de5f4a9b127b3b495a73047861098ef66eb36b#npm:5.1.1", {\ - "packageLocation": "./.yarn/__virtual__/styled-jsx-virtual-d55d7439d2/2/.yarn/berry/cache/styled-jsx-npm-5.1.1-2557a209ba-10.zip/node_modules/styled-jsx/",\ + ["virtual:7f610d677057983436fc212be1110549a2ea59d77fca7f98b42e5173e2c6d41e534f4c42bac23f075ed965cb3382933426f6c38949cbd9946f49577d35fca569#npm:5.1.1", {\ + "packageLocation": "./.yarn/__virtual__/styled-jsx-virtual-c2cbb36652/2/.yarn/berry/cache/styled-jsx-npm-5.1.1-2557a209ba-10.zip/node_modules/styled-jsx/",\ + "packageDependencies": [\ + ["styled-jsx", "virtual:7f610d677057983436fc212be1110549a2ea59d77fca7f98b42e5173e2c6d41e534f4c42bac23f075ed965cb3382933426f6c38949cbd9946f49577d35fca569#npm:5.1.1"],\ + ["@babel/core", null],\ + ["@types/babel-plugin-macros", null],\ + ["@types/babel__core", null],\ + ["@types/react", "npm:18.2.40"],\ + ["babel-plugin-macros", null],\ + ["client-only", "npm:0.0.1"],\ + ["react", "npm:18.3.1"]\ + ],\ + "packagePeers": [\ + "@babel/core",\ + "@types/babel-plugin-macros",\ + "@types/babel__core",\ + "@types/react",\ + "babel-plugin-macros",\ + "react"\ + ],\ + "linkType": "HARD"\ + }],\ + ["virtual:f4dcb14a6cc0bd210d66b07e0e082327efc6703c56f2cd1e0b7fb668d6f2b9ca0b03f0187775a9dbd26f26a039111dad9d0d01622c237ce257badd9982b8288b#npm:5.1.1", {\ + "packageLocation": "./.yarn/__virtual__/styled-jsx-virtual-32558424fe/2/.yarn/berry/cache/styled-jsx-npm-5.1.1-2557a209ba-10.zip/node_modules/styled-jsx/",\ "packageDependencies": [\ - ["styled-jsx", "virtual:15ea52649b4fac9b0f5240f02827cb65f3c5bbe2effc6c5f2476401dae57d3ed39fd29db41522556187d860ec3de5f4a9b127b3b495a73047861098ef66eb36b#npm:5.1.1"],\ + ["styled-jsx", "virtual:f4dcb14a6cc0bd210d66b07e0e082327efc6703c56f2cd1e0b7fb668d6f2b9ca0b03f0187775a9dbd26f26a039111dad9d0d01622c237ce257badd9982b8288b#npm:5.1.1"],\ ["@babel/core", null],\ ["@types/babel-plugin-macros", null],\ ["@types/babel__core", null],\ @@ -9705,10 +9573,11 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["textextensions", [\ - ["npm:5.16.0", {\ - "packageLocation": "../.yarn/berry/cache/textextensions-npm-5.16.0-da2c817a32-10.zip/node_modules/textextensions/",\ + ["npm:6.11.0", {\ + "packageLocation": "../.yarn/berry/cache/textextensions-npm-6.11.0-b47b7e802e-10.zip/node_modules/textextensions/",\ "packageDependencies": [\ - ["textextensions", "npm:5.16.0"]\ + ["textextensions", "npm:6.11.0"],\ + ["editions", "npm:6.21.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -9751,17 +9620,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["tough-cookie", [\ - ["npm:2.5.0", {\ - "packageLocation": "../.yarn/berry/cache/tough-cookie-npm-2.5.0-79a2fe43fe-10.zip/node_modules/tough-cookie/",\ - "packageDependencies": [\ - ["tough-cookie", "npm:2.5.0"],\ - ["psl", "npm:1.9.0"],\ - ["punycode", "npm:2.3.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["ts-jest-resolver", [\ ["npm:2.0.1", {\ "packageLocation": "../.yarn/berry/cache/ts-jest-resolver-npm-2.0.1-ebb3c6f6e1-10.zip/node_modules/ts-jest-resolver/",\ @@ -9869,25 +9727,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["tunnel-agent", [\ - ["npm:0.6.0", {\ - "packageLocation": "../.yarn/berry/cache/tunnel-agent-npm-0.6.0-64345ab7eb-10.zip/node_modules/tunnel-agent/",\ - "packageDependencies": [\ - ["tunnel-agent", "npm:0.6.0"],\ - ["safe-buffer", "npm:5.2.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["tweetnacl", [\ - ["npm:0.14.5", {\ - "packageLocation": "../.yarn/berry/cache/tweetnacl-npm-0.14.5-a3f766c0d1-10.zip/node_modules/tweetnacl/",\ - "packageDependencies": [\ - ["tweetnacl", "npm:0.14.5"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["type-check", [\ ["npm:0.4.0", {\ "packageLocation": "../.yarn/berry/cache/type-check-npm-0.4.0-60565800ce-10.zip/node_modules/type-check/",\ @@ -10064,15 +9903,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["uuid", [\ - ["npm:3.4.0", {\ - "packageLocation": "../.yarn/berry/cache/uuid-npm-3.4.0-4fd8ef88ad-10.zip/node_modules/uuid/",\ - "packageDependencies": [\ - ["uuid", "npm:3.4.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["v8-to-istanbul", [\ ["npm:9.2.0", {\ "packageLocation": "../.yarn/berry/cache/v8-to-istanbul-npm-9.2.0-fb333cc45f-10.zip/node_modules/v8-to-istanbul/",\ @@ -10085,14 +9915,11 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["verror", [\ - ["npm:1.10.0", {\ - "packageLocation": "../.yarn/berry/cache/verror-npm-1.10.0-c3f839c579-10.zip/node_modules/verror/",\ + ["version-range", [\ + ["npm:4.14.0", {\ + "packageLocation": "../.yarn/berry/cache/version-range-npm-4.14.0-58b03d2e5b-10.zip/node_modules/version-range/",\ "packageDependencies": [\ - ["verror", "npm:1.10.0"],\ - ["assert-plus", "npm:1.0.0"],\ - ["core-util-is", "npm:1.0.2"],\ - ["extsprintf", "npm:1.4.1"]\ + ["version-range", "npm:4.14.0"]\ ],\ "linkType": "HARD"\ }]\ diff --git a/packages/identity-integration/package.json b/packages/identity-integration/package.json index 6b5b13f9..15ebc29e 100644 --- a/packages/identity-integration/package.json +++ b/packages/identity-integration/package.json @@ -1,7 +1,11 @@ { "name": "@atls/next-identity-integration", - "version": "0.2.4", + "version": "1.0.0", "license": "BSD-3-Clause", + "type": "module", + "exports": { + ".": "./src/index.ts" + }, "main": "src/index.ts", "files": [ "dist" @@ -12,19 +16,19 @@ "postpack": "rm -rf dist" }, "dependencies": { - "@ory/client": "1.2.11", - "@ory/integrations": "1.1.5", - "@ory/kratos-client": "1.0.0", - "@types/tldjs": "2.3.4", + "@ory/client": "1.14.5", + "@ory/integrations": "1.2.1", + "@ory/kratos-client": "1.2.1", "tldjs": "2.3.1" }, "devDependencies": { "@types/react": "18.2.40", "@types/react-dom": "18.2.10", + "@types/tldjs": "2.3.4", "axios": "1.5.1", - "next": "14.1.0", - "react": "18.2.0", - "react-dom": "18.2.0" + "next": "14.2.9", + "react": "18.3.1", + "react-dom": "18.3.1" }, "peerDependencies": { "next": "^14.1.0", diff --git a/packages/identity-integration/src/flows/error.flow.tsx b/packages/identity-integration/src/flows/error.flow.tsx index 05bc5a15..45a20d47 100644 --- a/packages/identity-integration/src/flows/error.flow.tsx +++ b/packages/identity-integration/src/flows/error.flow.tsx @@ -2,14 +2,14 @@ import { FlowError } from '@ory/kratos-client' import { AxiosError } from 'axios' import { PropsWithChildren } from 'react' import { FC } from 'react' -import { useRouter } from 'next/navigation' -import { useSearchParams } from 'next/navigation' +import { useRouter } from 'next/navigation.js' +import { useSearchParams } from 'next/navigation.js' import { useState } from 'react' import { useEffect } from 'react' import React from 'react' -import { ErrorProvider } from '../providers' -import { useKratosClient } from '../providers' +import { ErrorProvider } from '../providers/index.js' +import { useKratosClient } from '../providers/index.js' export interface ErrorErrorProps { returnToUrl?: string diff --git a/packages/identity-integration/src/flows/handle-errors.util.ts b/packages/identity-integration/src/flows/handle-errors.util.ts index 0cb823b5..edf8a215 100644 --- a/packages/identity-integration/src/flows/handle-errors.util.ts +++ b/packages/identity-integration/src/flows/handle-errors.util.ts @@ -2,10 +2,10 @@ /* eslint-disable prefer-template */ /* eslint-disable default-case */ -import { AxiosError } from 'axios' -import { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime' -import { Dispatch } from 'react' -import { SetStateAction } from 'react' +import type { AxiosError } from 'axios' +import type { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime.js' +import type { Dispatch } from 'react' +import type { SetStateAction } from 'react' export const handleFlowError = ( router: AppRouterInstance, diff --git a/packages/identity-integration/src/flows/index.ts b/packages/identity-integration/src/flows/index.ts index be4d29f0..87bf4646 100644 --- a/packages/identity-integration/src/flows/index.ts +++ b/packages/identity-integration/src/flows/index.ts @@ -1,7 +1,7 @@ -export * from './verification.flow' -export * from './registration.flow' -export * from './recovery.flow' -export * from './settings.flow' -export * from './login.flow' -export * from './error.flow' -export * from './logout.flow' +export * from './verification.flow.js' +export * from './registration.flow.js' +export * from './recovery.flow.js' +export * from './settings.flow.js' +export * from './login.flow.js' +export * from './error.flow.js' +export * from './logout.flow.js' diff --git a/packages/identity-integration/src/flows/login.flow.tsx b/packages/identity-integration/src/flows/login.flow.tsx index aea3f57d..4fc9a57d 100644 --- a/packages/identity-integration/src/flows/login.flow.tsx +++ b/packages/identity-integration/src/flows/login.flow.tsx @@ -3,20 +3,20 @@ import { LoginFlow as KratosLoginFlow } from '@ory/kratos-client' import { AxiosError } from 'axios' import { PropsWithChildren } from 'react' import { FC } from 'react' -import { useSearchParams } from 'next/navigation' -import { useRouter } from 'next/navigation' +import { useSearchParams } from 'next/navigation.js' +import { useRouter } from 'next/navigation.js' import { useState } from 'react' import { useEffect } from 'react' import { useMemo } from 'react' import { useCallback } from 'react' import React from 'react' -import { FlowProvider } from '../providers' -import { ValuesProvider } from '../providers' -import { ValuesStore } from '../providers' -import { SubmitProvider } from '../providers' -import { useKratosClient } from '../providers' -import { handleFlowError } from './handle-errors.util' +import { FlowProvider } from '../providers/index.js' +import { ValuesProvider } from '../providers/index.js' +import { ValuesStore } from '../providers/index.js' +import { SubmitProvider } from '../providers/index.js' +import { useKratosClient } from '../providers/index.js' +import { handleFlowError } from './handle-errors.util.js' export interface LoginFlowProps { onError?: (error: { id: string }) => void @@ -92,6 +92,7 @@ export const LoginFlow: FC> = ({ kratosClient .updateLoginFlow( + // @ts-ignore { flow: String(flow?.id), updateLoginFlowBody: body }, { withCredentials: true } ) @@ -122,6 +123,7 @@ export const LoginFlow: FC> = ({ return ( + {/* @ts-ignore */} {children} diff --git a/packages/identity-integration/src/flows/logout.flow.tsx b/packages/identity-integration/src/flows/logout.flow.tsx index a55ba2f8..cf8cf636 100644 --- a/packages/identity-integration/src/flows/logout.flow.tsx +++ b/packages/identity-integration/src/flows/logout.flow.tsx @@ -2,13 +2,13 @@ import { LogoutFlow as KratosLogoutFlow } from '@ory/kratos-client' import { AxiosError } from 'axios' import { PropsWithChildren } from 'react' import { FC } from 'react' -import { useSearchParams } from 'next/navigation' -import { useRouter } from 'next/navigation' +import { useSearchParams } from 'next/navigation.js' +import { useRouter } from 'next/navigation.js' import { useState } from 'react' import { useEffect } from 'react' import React from 'react' -import { useKratosClient } from '../providers' +import { useKratosClient } from '../providers/index.js' interface LogoutFlowProps { returnToUrl?: string diff --git a/packages/identity-integration/src/flows/recovery.flow.tsx b/packages/identity-integration/src/flows/recovery.flow.tsx index 2d572efe..43b4c7e4 100644 --- a/packages/identity-integration/src/flows/recovery.flow.tsx +++ b/packages/identity-integration/src/flows/recovery.flow.tsx @@ -3,20 +3,20 @@ import { RecoveryFlow as KratosRecoveryFlow } from '@ory/kratos-client' import { AxiosError } from 'axios' import { PropsWithChildren } from 'react' import { FC } from 'react' -import { useSearchParams } from 'next/navigation' -import { useRouter } from 'next/navigation' +import { useSearchParams } from 'next/navigation.js' +import { useRouter } from 'next/navigation.js' import { useState } from 'react' import { useEffect } from 'react' import { useMemo } from 'react' import { useCallback } from 'react' import React from 'react' -import { FlowProvider } from '../providers' -import { ValuesProvider } from '../providers' -import { ValuesStore } from '../providers' -import { SubmitProvider } from '../providers' -import { useKratosClient } from '../providers' -import { handleFlowError } from './handle-errors.util' +import { FlowProvider } from '../providers/index.js' +import { ValuesProvider } from '../providers/index.js' +import { ValuesStore } from '../providers/index.js' +import { SubmitProvider } from '../providers/index.js' +import { useKratosClient } from '../providers/index.js' +import { handleFlowError } from './handle-errors.util.js' export interface RecoveryFlowProps { onError?: (error: { id: string }) => void @@ -100,6 +100,7 @@ export const RecoveryFlow: FC> = ({ kratosClient .updateRecoveryFlow( + // @ts-ignore { flow: String(flow?.id), updateRecoveryFlowBody: body }, { withCredentials: true } ) diff --git a/packages/identity-integration/src/flows/registration.flow.tsx b/packages/identity-integration/src/flows/registration.flow.tsx index 874ef0da..66f45a73 100644 --- a/packages/identity-integration/src/flows/registration.flow.tsx +++ b/packages/identity-integration/src/flows/registration.flow.tsx @@ -6,20 +6,20 @@ import { UiNodeInputAttributes } from '@ory/kratos-client' import { AxiosError } from 'axios' import { PropsWithChildren } from 'react' import { FC } from 'react' -import { useSearchParams } from 'next/navigation' -import { useRouter } from 'next/navigation' +import { useSearchParams } from 'next/navigation.js' +import { useRouter } from 'next/navigation.js' import { useState } from 'react' import { useEffect } from 'react' import { useMemo } from 'react' import { useCallback } from 'react' import React from 'react' -import { FlowProvider } from '../providers' -import { ValuesProvider } from '../providers' -import { ValuesStore } from '../providers' -import { SubmitProvider } from '../providers' -import { useKratosClient } from '../providers' -import { handleFlowError } from './handle-errors.util' +import { FlowProvider } from '../providers/index.js' +import { ValuesProvider } from '../providers/index.js' +import { ValuesStore } from '../providers/index.js' +import { SubmitProvider } from '../providers/index.js' +import { useKratosClient } from '../providers/index.js' +import { handleFlowError } from './handle-errors.util.js' export interface RegistrationFlowProps { onError?: (error: { id: string }) => void @@ -32,7 +32,7 @@ type ContinueWith = KratosContinueWith & { flow?: { id: string url?: string - verifiable_address: string + verifiable_address?: string } } @@ -124,6 +124,7 @@ export const RegistrationFlow: FC> = ({ kratosClient .updateRegistrationFlow( + // @ts-ignore { flow: String(flow?.id), updateRegistrationFlowBody: body }, { withCredentials: true } ) @@ -146,7 +147,8 @@ export const RegistrationFlow: FC> = ({ const url = new URL(continueWithAction.flow.url) const params = url.searchParams const email = continueWithAction.flow.verifiable_address - params.set('email', email) + if (email) params.set('email', email) + const newUrlString = `${url.origin}${url.pathname}?${params.toString()}` router.push(newUrlString) } else { @@ -177,6 +179,7 @@ export const RegistrationFlow: FC> = ({ return ( + {/* @ts-ignore */} {children} diff --git a/packages/identity-integration/src/flows/settings.flow.tsx b/packages/identity-integration/src/flows/settings.flow.tsx index 5ebbe31d..4e44dff7 100644 --- a/packages/identity-integration/src/flows/settings.flow.tsx +++ b/packages/identity-integration/src/flows/settings.flow.tsx @@ -3,20 +3,20 @@ import { SettingsFlow as KratosSettingsFlow } from '@ory/kratos-client' import { AxiosError } from 'axios' import { PropsWithChildren } from 'react' import { FC } from 'react' -import { useSearchParams } from 'next/navigation' -import { useRouter } from 'next/navigation' +import { useSearchParams } from 'next/navigation.js' +import { useRouter } from 'next/navigation.js' import { useState } from 'react' import { useEffect } from 'react' import { useMemo } from 'react' import { useCallback } from 'react' import React from 'react' -import { FlowProvider } from '../providers' -import { ValuesProvider } from '../providers' -import { ValuesStore } from '../providers' -import { SubmitProvider } from '../providers' -import { useKratosClient } from '../providers' -import { handleFlowError } from './handle-errors.util' +import { FlowProvider } from '../providers/index.js' +import { ValuesProvider } from '../providers/index.js' +import { ValuesStore } from '../providers/index.js' +import { SubmitProvider } from '../providers/index.js' +import { useKratosClient } from '../providers/index.js' +import { handleFlowError } from './handle-errors.util.js' export interface SettingsFlowProps { onError?: (error: { id: string }) => void @@ -103,6 +103,7 @@ export const SettingsFlow: FC> = ({ kratosClient .updateSettingsFlow( + // @ts-ignore { flow: String(flow?.id), updateSettingsFlowBody: body }, { withCredentials: true } ) @@ -136,6 +137,7 @@ export const SettingsFlow: FC> = ({ return ( + {/* @ts-ignore */} {children} diff --git a/packages/identity-integration/src/flows/verification.flow.tsx b/packages/identity-integration/src/flows/verification.flow.tsx index 643b8680..036912ac 100644 --- a/packages/identity-integration/src/flows/verification.flow.tsx +++ b/packages/identity-integration/src/flows/verification.flow.tsx @@ -5,19 +5,19 @@ import { VerificationFlow as KratosVerificationFlow } from '@ory/kratos-client' import { AxiosError } from 'axios' import { PropsWithChildren } from 'react' import { FC } from 'react' -import { useSearchParams } from 'next/navigation' -import { useRouter } from 'next/navigation' +import { useSearchParams } from 'next/navigation.js' +import { useRouter } from 'next/navigation.js' import { useState } from 'react' import { useEffect } from 'react' import { useMemo } from 'react' import { useCallback } from 'react' import React from 'react' -import { FlowProvider } from '../providers' -import { ValuesProvider } from '../providers' -import { ValuesStore } from '../providers' -import { SubmitProvider } from '../providers' -import { useKratosClient } from '../providers' +import { FlowProvider } from '../providers/index.js' +import { ValuesProvider } from '../providers/index.js' +import { ValuesStore } from '../providers/index.js' +import { SubmitProvider } from '../providers/index.js' +import { useKratosClient } from '../providers/index.js' export interface VerificationFlowProps { onError?: (error: { id: string }) => void @@ -106,6 +106,7 @@ export const VerificationFlow: FC> = ({ kratosClient .updateVerificationFlow( + // @ts-ignore { flow: String(flow?.id), updateVerificationFlowBody: body }, { withCredentials: true, diff --git a/packages/identity-integration/src/index.ts b/packages/identity-integration/src/index.ts index ab887bfa..d33f98ed 100644 --- a/packages/identity-integration/src/index.ts +++ b/packages/identity-integration/src/index.ts @@ -1,7 +1,7 @@ export { Session } from '@ory/kratos-client' export { Configuration } from '@ory/kratos-client' -export * from './providers' -export * from './flows' -export * from './ui' -export * from './messages' -export * from './sdk' +export * from './providers/index.js' +export * from './flows/index.js' +export * from './ui/index.js' +export * from './messages/index.js' +export * from './sdk/index.js' diff --git a/packages/identity-integration/src/locales/ru/ru-messages.json b/packages/identity-integration/src/locales/ru/ru-messages.json index 463b8db0..d7392120 100644 --- a/packages/identity-integration/src/locales/ru/ru-messages.json +++ b/packages/identity-integration/src/locales/ru/ru-messages.json @@ -411,7 +411,7 @@ { "id": 4000005, "text": "The password can not be used because {reason}.", - "ru": "Этот пароль не может быть использован потому что {reason}.", + "ru": "Этот пароль не может быть использован, потому что {reason}.", "type": "error", "context": { "reason": "{reason}" diff --git a/packages/identity-integration/src/messages/index.ts b/packages/identity-integration/src/messages/index.ts index 81cff732..d122703e 100644 --- a/packages/identity-integration/src/messages/index.ts +++ b/packages/identity-integration/src/messages/index.ts @@ -1,2 +1,2 @@ -export * from './localized-messages' -export * from './localized-messages.interfaces' +export * from './localized-messages.js' +export * from './localized-messages.interfaces.js' diff --git a/packages/identity-integration/src/messages/localized-messages.interfaces.ts b/packages/identity-integration/src/messages/localized-messages.interfaces.ts index 3ff2bb44..eecbef1e 100644 --- a/packages/identity-integration/src/messages/localized-messages.interfaces.ts +++ b/packages/identity-integration/src/messages/localized-messages.interfaces.ts @@ -1,3 +1,3 @@ -import { UiText } from '@ory/kratos-client' +import type { UiText } from '@ory/kratos-client' export type LocalizedMessagesProps = (messages: UiText[]) => string[] diff --git a/packages/identity-integration/src/messages/localized-messages.ts b/packages/identity-integration/src/messages/localized-messages.ts index eb63a446..9b12075b 100644 --- a/packages/identity-integration/src/messages/localized-messages.ts +++ b/packages/identity-integration/src/messages/localized-messages.ts @@ -1,7 +1,8 @@ -import { LocalizedMessagesProps } from './localized-messages.interfaces' -import ruFields from '../locales/ru/ru-fields.json' -import ruMessages from '../locales/ru/ru-messages.json' -import ruReasons from '../locales/ru/ru-reasons.json' +import type { LocalizedMessagesProps } from './localized-messages.interfaces.js' + +import ruFields from '../locales/ru/ru-fields.json' +import ruMessages from '../locales/ru/ru-messages.json' +import ruReasons from '../locales/ru/ru-reasons.json' export const localizedMessages: LocalizedMessagesProps = (messages) => messages.map( diff --git a/packages/identity-integration/src/providers/error.context.ts b/packages/identity-integration/src/providers/error.context.ts index 6d2d78c5..70bf26e9 100644 --- a/packages/identity-integration/src/providers/error.context.ts +++ b/packages/identity-integration/src/providers/error.context.ts @@ -1,4 +1,4 @@ -import { FlowError } from '@ory/kratos-client' +import type { FlowError } from '@ory/kratos-client' import { createContext } from 'react' export interface ContextError { diff --git a/packages/identity-integration/src/providers/flow.context.ts b/packages/identity-integration/src/providers/flow.context.ts index bc44448c..246b19dc 100644 --- a/packages/identity-integration/src/providers/flow.context.ts +++ b/packages/identity-integration/src/providers/flow.context.ts @@ -1,7 +1,7 @@ import { Identity } from '@ory/kratos-client' import { createContext } from 'react' -import { Flow } from './flow.interfaces' +import { Flow } from './flow.interfaces.js' export interface ContextFlow { flow?: Flow diff --git a/packages/identity-integration/src/providers/index.ts b/packages/identity-integration/src/providers/index.ts index abcaaa30..14089208 100644 --- a/packages/identity-integration/src/providers/index.ts +++ b/packages/identity-integration/src/providers/index.ts @@ -1,14 +1,14 @@ -export * from './flow.interfaces' -export * from './flow.context' -export * from './use-flow.hook' -export * from './use-flow-node.hook' -export * from './values.context' -export * from './values.store' -export * from './use-values.hook' -export * from './use-value.hook' -export * from './submit.context' -export * from './use-submit.hook' -export * from './error.context' -export * from './use-error.hook' -export * from './kratos-client.context' -export * from './use-kratos-client.hook' +export * from './flow.interfaces.js' +export * from './flow.context.js' +export * from './use-flow.hook.js' +export * from './use-flow-node.hook.js' +export * from './values.context.js' +export * from './values.store.js' +export * from './use-values.hook.js' +export * from './use-value.hook.js' +export * from './submit.context.js' +export * from './use-submit.hook.js' +export * from './error.context.js' +export * from './use-error.hook.js' +export * from './kratos-client.context.js' +export * from './use-kratos-client.hook.js' diff --git a/packages/identity-integration/src/providers/kratos-client.context.ts b/packages/identity-integration/src/providers/kratos-client.context.ts index eced5972..2dc1fd3d 100644 --- a/packages/identity-integration/src/providers/kratos-client.context.ts +++ b/packages/identity-integration/src/providers/kratos-client.context.ts @@ -1,7 +1,8 @@ -import { createContext } from 'react' +import type { KratosClient } from '../sdk/index.js' -import { KratosClient } from '../sdk' -import { kratos } from '../sdk' +import { createContext } from 'react' + +import { kratos } from '../sdk/index.js' export interface ContextKratosClient { kratosClient?: KratosClient diff --git a/packages/identity-integration/src/providers/submit.context.ts b/packages/identity-integration/src/providers/submit.context.ts index ccf99052..3d16cc4f 100644 --- a/packages/identity-integration/src/providers/submit.context.ts +++ b/packages/identity-integration/src/providers/submit.context.ts @@ -1,6 +1,6 @@ import { createContext } from 'react' -import { Body } from './flow.interfaces' +import { Body } from './flow.interfaces.js' export interface ContextSubmit { onSubmit: (override?: Partial) => void diff --git a/packages/identity-integration/src/providers/use-error.hook.ts b/packages/identity-integration/src/providers/use-error.hook.ts index 7efdffd3..ebda4141 100644 --- a/packages/identity-integration/src/providers/use-error.hook.ts +++ b/packages/identity-integration/src/providers/use-error.hook.ts @@ -1,7 +1,7 @@ import { useContext } from 'react' -import { ErrorContext } from './error.context' -import { ContextError } from './error.context' +import { ErrorContext } from './error.context.js' +import { ContextError } from './error.context.js' export const useError = (): ContextError => { const error = useContext(ErrorContext) diff --git a/packages/identity-integration/src/providers/use-flow-node.hook.ts b/packages/identity-integration/src/providers/use-flow-node.hook.ts index 2eabc01a..80f963e0 100644 --- a/packages/identity-integration/src/providers/use-flow-node.hook.ts +++ b/packages/identity-integration/src/providers/use-flow-node.hook.ts @@ -4,7 +4,7 @@ import type { UiNode } from '@ory/kratos-client' import { useMemo } from 'react' -import { useFlow } from './use-flow.hook' +import { useFlow } from './use-flow.hook.js' export const useFlowNode = (nameOrId: string): UiNode | undefined => { const { flow } = useFlow() diff --git a/packages/identity-integration/src/providers/use-flow.hook.ts b/packages/identity-integration/src/providers/use-flow.hook.ts index bd64a4ca..633608a6 100644 --- a/packages/identity-integration/src/providers/use-flow.hook.ts +++ b/packages/identity-integration/src/providers/use-flow.hook.ts @@ -1,7 +1,7 @@ import { useContext } from 'react' -import { FlowContext } from './flow.context' -import { ContextFlow } from './flow.context' +import { FlowContext } from './flow.context.js' +import { ContextFlow } from './flow.context.js' export const useFlow = (): ContextFlow => { const flow = useContext(FlowContext) diff --git a/packages/identity-integration/src/providers/use-kratos-client.hook.ts b/packages/identity-integration/src/providers/use-kratos-client.hook.ts index f0f5b21f..96c7fb48 100644 --- a/packages/identity-integration/src/providers/use-kratos-client.hook.ts +++ b/packages/identity-integration/src/providers/use-kratos-client.hook.ts @@ -1,7 +1,7 @@ import { useContext } from 'react' -import { ContextKratosClient } from './kratos-client.context' -import { KratosClientContext } from './kratos-client.context' +import { ContextKratosClient } from './kratos-client.context.js' +import { KratosClientContext } from './kratos-client.context.js' export const useKratosClient = (): Required => { const { kratosClient, returnToSettingsUrl } = useContext(KratosClientContext) diff --git a/packages/identity-integration/src/providers/use-submit.hook.ts b/packages/identity-integration/src/providers/use-submit.hook.ts index af671c2f..dce73177 100644 --- a/packages/identity-integration/src/providers/use-submit.hook.ts +++ b/packages/identity-integration/src/providers/use-submit.hook.ts @@ -1,7 +1,7 @@ import { useContext } from 'react' -import { SubmitContext } from './submit.context' -import { ContextSubmit } from './submit.context' +import { SubmitContext } from './submit.context.js' +import { ContextSubmit } from './submit.context.js' export const useSubmit = (): ContextSubmit => { const submit = useContext(SubmitContext) diff --git a/packages/identity-integration/src/providers/use-value.hook.ts b/packages/identity-integration/src/providers/use-value.hook.ts index 8d253cde..e9473f77 100644 --- a/packages/identity-integration/src/providers/use-value.hook.ts +++ b/packages/identity-integration/src/providers/use-value.hook.ts @@ -2,7 +2,7 @@ import { useState } from 'react' import { useEffect } from 'react' import { useCallback } from 'react' -import { useValues } from './use-values.hook' +import { useValues } from './use-values.hook.js' export const useValue = (name: string) => { const values = useValues() @@ -17,7 +17,7 @@ export const useValue = (name: string) => { } }, [values, name]) - const onChange = useCallback((val) => values.setValue(name, val), [values, name]) + const onChange = useCallback((val: string) => values.setValue(name, val), [values, name]) return [value, onChange] } diff --git a/packages/identity-integration/src/providers/use-values.hook.ts b/packages/identity-integration/src/providers/use-values.hook.ts index cc587895..d739e0ed 100644 --- a/packages/identity-integration/src/providers/use-values.hook.ts +++ b/packages/identity-integration/src/providers/use-values.hook.ts @@ -1,7 +1,7 @@ import { useContext } from 'react' -import { ValuesContext } from './values.context' -import { ValuesStore } from './values.store' +import { ValuesContext } from './values.context.js' +import { ValuesStore } from './values.store.js' export const useValues = (): ValuesStore => { const values = useContext(ValuesContext) diff --git a/packages/identity-integration/src/providers/values.context.ts b/packages/identity-integration/src/providers/values.context.ts index 7d145adf..021fa93b 100644 --- a/packages/identity-integration/src/providers/values.context.ts +++ b/packages/identity-integration/src/providers/values.context.ts @@ -1,6 +1,6 @@ import { createContext } from 'react' -import { ValuesStore } from './values.store' +import { ValuesStore } from './values.store.js' const Context = createContext(new ValuesStore()) diff --git a/packages/identity-integration/src/providers/values.store.ts b/packages/identity-integration/src/providers/values.store.ts index 7acb81e3..e72133ab 100644 --- a/packages/identity-integration/src/providers/values.store.ts +++ b/packages/identity-integration/src/providers/values.store.ts @@ -1,7 +1,7 @@ import type { UiNodeInputAttributes } from '@ory/kratos-client' -import type { Flow } from './flow.interfaces' -import type { Body } from './flow.interfaces' +import type { Flow } from './flow.interfaces.js' +import type { Body } from './flow.interfaces.js' import { isUiNodeInputAttributes } from '@ory/integrations/ui' import { EventEmitter } from 'events' @@ -15,7 +15,8 @@ export class ValuesStore extends EventEmitter { this.setMaxListeners(50) } - getValue(name): string | any { + getValue(name: string): string | any { + // @ts-ignore return this.#values[name] } @@ -24,6 +25,7 @@ export class ValuesStore extends EventEmitter { } setValue(name: string, value: string) { + // @ts-ignore this.#values[name] = value this.emit(name, value) } @@ -34,7 +36,9 @@ export class ValuesStore extends EventEmitter { if (isUiNodeInputAttributes(attributes as any)) { if (type !== 'button' && type !== 'submit') { + // @ts-ignore if (!this.#values[name]) { + // @ts-ignore this.#values[name] = value this.emit(name, value) } diff --git a/packages/identity-integration/src/sdk/index.ts b/packages/identity-integration/src/sdk/index.ts index e03bef30..377e8a8d 100644 --- a/packages/identity-integration/src/sdk/index.ts +++ b/packages/identity-integration/src/sdk/index.ts @@ -1,2 +1,2 @@ -export * from './kratos-admin.client' -export * from './kratos.client' +export * from './kratos-admin.client.js' +export * from './kratos.client.js' diff --git a/packages/identity-integration/src/ui/error-node.component.tsx b/packages/identity-integration/src/ui/error-node.component.tsx index 04b75b53..728513ba 100644 --- a/packages/identity-integration/src/ui/error-node.component.tsx +++ b/packages/identity-integration/src/ui/error-node.component.tsx @@ -1,8 +1,8 @@ import { ReactElement } from 'react' import { FC } from 'react' -import { ActualFlowError } from './ui.interfaces' -import { useError } from '../providers' +import { ActualFlowError } from './ui.interfaces.js' +import { useError } from '../providers/index.js' export interface ErrorNodeProps { children: (node: ActualFlowError) => ReactElement diff --git a/packages/identity-integration/src/ui/flow-messages.component.tsx b/packages/identity-integration/src/ui/flow-messages.component.tsx index eb75bff7..d819a7f9 100644 --- a/packages/identity-integration/src/ui/flow-messages.component.tsx +++ b/packages/identity-integration/src/ui/flow-messages.component.tsx @@ -1,10 +1,11 @@ -import { UiText } from '@ory/kratos-client' -import { ReactElement } from 'react' -import { FC } from 'react' +import type { UiText } from '@ory/kratos-client' +import type { ReactElement } from 'react' +import type { FC } from 'react' + import { useMemo } from 'react' -import { localizedMessages } from '../messages' -import { useFlow } from '../providers' +import { localizedMessages } from '../messages/index.js' +import { useFlow } from '../providers/index.js' export interface FlowMessagesProps { children: (messages: UiText[], ruMessages: string[]) => ReactElement diff --git a/packages/identity-integration/src/ui/flow-node-messages.component.tsx b/packages/identity-integration/src/ui/flow-node-messages.component.tsx index bea1efe9..ddb0144a 100644 --- a/packages/identity-integration/src/ui/flow-node-messages.component.tsx +++ b/packages/identity-integration/src/ui/flow-node-messages.component.tsx @@ -1,11 +1,11 @@ import type { UiText } from '@ory/kratos-client' +import type { ReactElement } from 'react' +import type { FC } from 'react' -import { ReactElement } from 'react' -import { FC } from 'react' import { useMemo } from 'react' -import { localizedMessages } from '../messages' -import { useFlowNode } from '../providers' +import { localizedMessages } from '../messages/index.js' +import { useFlowNode } from '../providers/index.js' export interface FlowNodeMessagesProps { name: string diff --git a/packages/identity-integration/src/ui/flow-node.component.tsx b/packages/identity-integration/src/ui/flow-node.component.tsx index c0bdd1a5..23c75938 100644 --- a/packages/identity-integration/src/ui/flow-node.component.tsx +++ b/packages/identity-integration/src/ui/flow-node.component.tsx @@ -1,11 +1,13 @@ -import { ReactElement } from 'react' -import { FC } from 'react' -import { FormEvent } from 'react' -import { useCallback } from 'react' - -import { ActualUiNode } from './ui.interfaces' -import { useFlowNode } from '../providers' -import { useValue } from '../providers' +import type { ReactElement } from 'react' +import type { FC } from 'react' +import type { FormEvent } from 'react' + +import type { ActualUiNode } from './ui.interfaces.js' + +import { useCallback } from 'react' + +import { useFlowNode } from '../providers/index.js' +import { useValue } from '../providers/index.js' type OnChangeCallback = (event: FormEvent | string | any) => void diff --git a/packages/identity-integration/src/ui/flow-nodes-filter.component.tsx b/packages/identity-integration/src/ui/flow-nodes-filter.component.tsx index 71c0f10d..33722e03 100644 --- a/packages/identity-integration/src/ui/flow-nodes-filter.component.tsx +++ b/packages/identity-integration/src/ui/flow-nodes-filter.component.tsx @@ -1,9 +1,11 @@ -import { ReactElement } from 'react' -import { FC } from 'react' -import { useMemo } from 'react' +import type { ReactElement } from 'react' +import type { FC } from 'react' -import { ActualUiNode } from './ui.interfaces' -import { useFlow } from '../providers' +import type { ActualUiNode } from './ui.interfaces.js' + +import { useMemo } from 'react' + +import { useFlow } from '../providers/index.js' export type FlowNodesFilterChildren = (node: ActualUiNode[]) => ReactElement diff --git a/packages/identity-integration/src/ui/flow-nodes-group.component.tsx b/packages/identity-integration/src/ui/flow-nodes-group.component.tsx index f2d882c8..ec918da1 100644 --- a/packages/identity-integration/src/ui/flow-nodes-group.component.tsx +++ b/packages/identity-integration/src/ui/flow-nodes-group.component.tsx @@ -1,9 +1,12 @@ -import { ReactElement } from 'react' -import { FC } from 'react' -import { useMemo } from 'react' +import type { UiNode } from '@ory/kratos-client' +import type { ReactElement } from 'react' +import type { FC } from 'react' -import { ActualUiNode } from './ui.interfaces' -import { useFlow } from '../providers' +import type { ActualUiNode } from './ui.interfaces.js' + +import { useMemo } from 'react' + +import { useFlow } from '../providers/index.js' export type FlowNodesGroupChildren = (node: ActualUiNode[]) => ReactElement @@ -15,7 +18,10 @@ export interface FlowNodesGroupProps { export const FlowNodesGroup: FC = ({ name, children }) => { const { flow } = useFlow() - const nodes = useMemo(() => flow?.ui?.nodes?.filter((node) => node.group === name), [flow, name]) + const nodes = useMemo( + () => flow?.ui?.nodes?.filter((node: UiNode) => node.group === name), + [flow, name] + ) if (!(nodes && nodes.length > 0)) { return null diff --git a/packages/identity-integration/src/ui/flow-submit.component.tsx b/packages/identity-integration/src/ui/flow-submit.component.tsx index e2912edb..cc62eb1a 100644 --- a/packages/identity-integration/src/ui/flow-submit.component.tsx +++ b/packages/identity-integration/src/ui/flow-submit.component.tsx @@ -1,8 +1,9 @@ -import { ReactElement } from 'react' -import { FC } from 'react' +import type { ReactElement } from 'react' +import type { FC } from 'react' -import { Body } from '../providers' -import { useSubmit } from '../providers' +import type { Body } from '../providers/index.js' + +import { useSubmit } from '../providers/index.js' export interface FlowSubmitProps { children: (submit: { diff --git a/packages/identity-integration/src/ui/index.ts b/packages/identity-integration/src/ui/index.ts index 247c928c..a884e2ac 100644 --- a/packages/identity-integration/src/ui/index.ts +++ b/packages/identity-integration/src/ui/index.ts @@ -1,8 +1,8 @@ -export * from './flow-node-messages.component' -export * from './flow-nodes-filter.component' -export * from './flow-nodes-group.component' -export * from './flow-messages.component' -export * from './flow-submit.component' -export * from './flow-node.component' -export * from './error-node.component' -export * from './ui.interfaces' +export * from './flow-node-messages.component.js' +export * from './flow-nodes-filter.component.js' +export * from './flow-nodes-group.component.js' +export * from './flow-messages.component.js' +export * from './flow-submit.component.js' +export * from './flow-node.component.js' +export * from './error-node.component.js' +export * from './ui.interfaces.js' diff --git a/yarn.lock b/yarn.lock index e5b88dc5..c1630014 100644 --- a/yarn.lock +++ b/yarn.lock @@ -182,16 +182,16 @@ __metadata: version: 0.0.0-use.local resolution: "@atls/next-identity-integration@workspace:packages/identity-integration" dependencies: - "@ory/client": "npm:1.2.11" - "@ory/integrations": "npm:1.1.5" - "@ory/kratos-client": "npm:1.0.0" + "@ory/client": "npm:1.14.5" + "@ory/integrations": "npm:1.2.1" + "@ory/kratos-client": "npm:1.2.1" "@types/react": "npm:18.2.40" "@types/react-dom": "npm:18.2.10" "@types/tldjs": "npm:2.3.4" axios: "npm:1.5.1" - next: "npm:14.1.0" - react: "npm:18.2.0" - react-dom: "npm:18.2.0" + next: "npm:14.2.9" + react: "npm:18.3.1" + react-dom: "npm:18.3.1" tldjs: "npm:2.3.1" peerDependencies: next: ^14.1.0 @@ -1245,6 +1245,13 @@ __metadata: languageName: node linkType: hard +"@next/env@npm:14.2.9": + version: 14.2.9 + resolution: "@next/env@npm:14.2.9" + checksum: 10/d338b785266c1d84ec29dcbb4041e1903d9bb3811f588a664fe89e5bc12bb580cd88cd928c0d4b207bb99482b53b33bd5a2c3f1665bfda85c66befdfff345924 + languageName: node + linkType: hard + "@next/eslint-plugin-next@npm:^13.4.8": version: 13.5.6 resolution: "@next/eslint-plugin-next@npm:13.5.6" @@ -1261,6 +1268,13 @@ __metadata: languageName: node linkType: hard +"@next/swc-darwin-arm64@npm:14.2.9": + version: 14.2.9 + resolution: "@next/swc-darwin-arm64@npm:14.2.9" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + "@next/swc-darwin-x64@npm:14.1.0": version: 14.1.0 resolution: "@next/swc-darwin-x64@npm:14.1.0" @@ -1268,6 +1282,13 @@ __metadata: languageName: node linkType: hard +"@next/swc-darwin-x64@npm:14.2.9": + version: 14.2.9 + resolution: "@next/swc-darwin-x64@npm:14.2.9" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + "@next/swc-linux-arm64-gnu@npm:14.1.0": version: 14.1.0 resolution: "@next/swc-linux-arm64-gnu@npm:14.1.0" @@ -1275,6 +1296,13 @@ __metadata: languageName: node linkType: hard +"@next/swc-linux-arm64-gnu@npm:14.2.9": + version: 14.2.9 + resolution: "@next/swc-linux-arm64-gnu@npm:14.2.9" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + "@next/swc-linux-arm64-musl@npm:14.1.0": version: 14.1.0 resolution: "@next/swc-linux-arm64-musl@npm:14.1.0" @@ -1282,6 +1310,13 @@ __metadata: languageName: node linkType: hard +"@next/swc-linux-arm64-musl@npm:14.2.9": + version: 14.2.9 + resolution: "@next/swc-linux-arm64-musl@npm:14.2.9" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + "@next/swc-linux-x64-gnu@npm:14.1.0": version: 14.1.0 resolution: "@next/swc-linux-x64-gnu@npm:14.1.0" @@ -1289,6 +1324,13 @@ __metadata: languageName: node linkType: hard +"@next/swc-linux-x64-gnu@npm:14.2.9": + version: 14.2.9 + resolution: "@next/swc-linux-x64-gnu@npm:14.2.9" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + "@next/swc-linux-x64-musl@npm:14.1.0": version: 14.1.0 resolution: "@next/swc-linux-x64-musl@npm:14.1.0" @@ -1296,6 +1338,13 @@ __metadata: languageName: node linkType: hard +"@next/swc-linux-x64-musl@npm:14.2.9": + version: 14.2.9 + resolution: "@next/swc-linux-x64-musl@npm:14.2.9" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + "@next/swc-win32-arm64-msvc@npm:14.1.0": version: 14.1.0 resolution: "@next/swc-win32-arm64-msvc@npm:14.1.0" @@ -1303,6 +1352,13 @@ __metadata: languageName: node linkType: hard +"@next/swc-win32-arm64-msvc@npm:14.2.9": + version: 14.2.9 + resolution: "@next/swc-win32-arm64-msvc@npm:14.2.9" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + "@next/swc-win32-ia32-msvc@npm:14.1.0": version: 14.1.0 resolution: "@next/swc-win32-ia32-msvc@npm:14.1.0" @@ -1310,6 +1366,13 @@ __metadata: languageName: node linkType: hard +"@next/swc-win32-ia32-msvc@npm:14.2.9": + version: 14.2.9 + resolution: "@next/swc-win32-ia32-msvc@npm:14.2.9" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + "@next/swc-win32-x64-msvc@npm:14.1.0": version: 14.1.0 resolution: "@next/swc-win32-x64-msvc@npm:14.1.0" @@ -1317,6 +1380,13 @@ __metadata: languageName: node linkType: hard +"@next/swc-win32-x64-msvc@npm:14.2.9": + version: 14.2.9 + resolution: "@next/swc-win32-x64-msvc@npm:14.2.9" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@nodelib/fs.scandir@npm:2.1.5": version: 2.1.5 resolution: "@nodelib/fs.scandir@npm:2.1.5" @@ -1366,41 +1436,40 @@ __metadata: languageName: node linkType: hard -"@ory/client@npm:1.2.11": - version: 1.2.11 - resolution: "@ory/client@npm:1.2.11" +"@ory/client@npm:1.14.5": + version: 1.14.5 + resolution: "@ory/client@npm:1.14.5" dependencies: - axios: "npm:^0.21.4" - checksum: 10/d41774c9027ef424a57a6db5c81c28b7e4a7d09df3d63eb0bcd3cf39392f3884c23450e3e2867d6eb8313c1137c3c435066a571fcae12c3ec5d0c6a782044534 + axios: "npm:^1.6.1" + checksum: 10/48f256126cc5588546064f994910681586594d3352a7b36af0fe2cde8f200b60d62ce9fbf58f1480e444fddd1d60990d4bfca6473e377144841c61025e497079 languageName: node linkType: hard -"@ory/integrations@npm:1.1.5": - version: 1.1.5 - resolution: "@ory/integrations@npm:1.1.5" +"@ory/integrations@npm:1.2.1": + version: 1.2.1 + resolution: "@ory/integrations@npm:1.2.1" dependencies: - "@types/tldjs": "npm:2.3.1" - cookie: "npm:0.5.0" - istextorbinary: "npm:6.0.0" + "@types/tldjs": "npm:2.3.4" + cookie: "npm:0.6.0" + istextorbinary: "npm:9.5.0" next: "npm:>=12.0.10" ory-prettier-styles: "npm:1.3.0" - prettier: "npm:2.3.2" - request: "npm:2.88.2" + prettier: "npm:3.2.5" set-cookie-parser: "npm:2.6.0" tldjs: "npm:2.3.1" peerDependencies: "@ory/client": ">1.1.38" next: ">=12.0.10" - checksum: 10/d01242625783952a7a29b24e98dbe632292fda16464092107741993219491eee85d0331f9a55e0c12bf6f597a2f0d433a6356e2cc797dc555ef830584a8f3f93 + checksum: 10/4be42e5e85d82b6f2383fbd583910f7a5e380bb0feeef512f9606405c953402e61c5ce9db587657fc33bb989dc305a02fcbf817a760f7194f44850b22401640d languageName: node linkType: hard -"@ory/kratos-client@npm:1.0.0": - version: 1.0.0 - resolution: "@ory/kratos-client@npm:1.0.0" +"@ory/kratos-client@npm:1.2.1": + version: 1.2.1 + resolution: "@ory/kratos-client@npm:1.2.1" dependencies: - axios: "npm:^0.21.4" - checksum: 10/450ae08f55caa78acbcc1abe84b1b4c7d4b12d7a8caabb467f801cee355931ec57f24a189430aa07808a35cecaf9624c908e0282fde140c868e10b3c24db8a8f + axios: "npm:^1.6.1" + checksum: 10/7660a1bbd732acf704b5660d5be08c92ac4cfa0e8d3257100c473753c91edff305e43588dd558b58e4fa0f58b23abf0183b0e584e9a406b87385d3bb70f05fcf languageName: node linkType: hard @@ -1727,6 +1796,16 @@ __metadata: languageName: node linkType: hard +"@swc/helpers@npm:0.5.5": + version: 0.5.5 + resolution: "@swc/helpers@npm:0.5.5" + dependencies: + "@swc/counter": "npm:^0.1.3" + tslib: "npm:^2.4.0" + checksum: 10/1c5ef04f642542212df28c669438f3e0f459dcde7b448a5b1fcafb2e9e4f13e76d8428535a270e91ed123dd2a21189dbed34086b88a8cf68baf84984d6d0e39b + languageName: node + linkType: hard + "@swc/jest@npm:0.2.36": version: 0.2.36 resolution: "@swc/jest@npm:0.2.36" @@ -1938,13 +2017,6 @@ __metadata: languageName: node linkType: hard -"@types/tldjs@npm:2.3.1": - version: 2.3.1 - resolution: "@types/tldjs@npm:2.3.1" - checksum: 10/3b796de8c41c2f108cc5e8cc888d4676964fe73bdbb9383ab7e0e6a69bdd845d0b186d0688bdbe751ba8ffb1694dd5c12c0785c4959b0ecdbcd031dfcc36887d - languageName: node - linkType: hard - "@types/tldjs@npm:2.3.4": version: 2.3.4 resolution: "@types/tldjs@npm:2.3.4" @@ -2323,7 +2395,7 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^6.12.3, ajv@npm:^6.12.4, ajv@npm:^6.12.5": +"ajv@npm:^6.12.4, ajv@npm:^6.12.5": version: 6.12.6 resolution: "ajv@npm:6.12.6" dependencies: @@ -2537,22 +2609,6 @@ __metadata: languageName: node linkType: hard -"asn1@npm:~0.2.3": - version: 0.2.6 - resolution: "asn1@npm:0.2.6" - dependencies: - safer-buffer: "npm:~2.1.0" - checksum: 10/cf629291fee6c1a6f530549939433ebf32200d7849f38b810ff26ee74235e845c0c12b2ed0f1607ac17383d19b219b69cefa009b920dab57924c5c544e495078 - languageName: node - linkType: hard - -"assert-plus@npm:1.0.0, assert-plus@npm:^1.0.0": - version: 1.0.0 - resolution: "assert-plus@npm:1.0.0" - checksum: 10/f4f991ae2df849cc678b1afba52d512a7cbf0d09613ba111e72255409ff9158550c775162a47b12d015d1b82b3c273e8e25df0e4783d3ddb008a293486d00a07 - languageName: node - linkType: hard - "ast-types-flow@npm:^0.0.8": version: 0.0.8 resolution: "ast-types-flow@npm:0.0.8" @@ -2576,20 +2632,6 @@ __metadata: languageName: node linkType: hard -"aws-sign2@npm:~0.7.0": - version: 0.7.0 - resolution: "aws-sign2@npm:0.7.0" - checksum: 10/2ac497d739f71be3264cf096a33ab256a1fea7fe80b87dc51ec29374505bd5a661279ef1c22989d68528ea61ed634021ca63b31cf1d3c2a3682ffc106f7d0e96 - languageName: node - linkType: hard - -"aws4@npm:^1.8.0": - version: 1.12.0 - resolution: "aws4@npm:1.12.0" - checksum: 10/2b8455fe1eee87f0e7d5f32e81e7fec74dce060c72d03f528c8c631fa74209cef53aab6fede182ea17d0c9520cb1e5e3023c5fedb4f1139ae9f067fc720869a5 - languageName: node - linkType: hard - "axe-core@npm:^4.10.0": version: 4.10.0 resolution: "axe-core@npm:4.10.0" @@ -2608,12 +2650,14 @@ __metadata: languageName: node linkType: hard -"axios@npm:^0.21.4": - version: 0.21.4 - resolution: "axios@npm:0.21.4" +"axios@npm:^1.6.1": + version: 1.7.7 + resolution: "axios@npm:1.7.7" dependencies: - follow-redirects: "npm:^1.14.0" - checksum: 10/da644592cb6f8f9f8c64fdabd7e1396d6769d7a4c1ea5f8ae8beb5c2eb90a823e3a574352b0b934ac62edc762c0f52647753dc54f7d07279127a7e5c4cd20272 + follow-redirects: "npm:^1.15.6" + form-data: "npm:^4.0.0" + proxy-from-env: "npm:^1.1.0" + checksum: 10/7f875ea13b9298cd7b40fd09985209f7a38d38321f1118c701520939de2f113c4ba137832fe8e3f811f99a38e12c8225481011023209a77b0c0641270e20cde1 languageName: node linkType: hard @@ -2748,15 +2792,6 @@ __metadata: languageName: node linkType: hard -"bcrypt-pbkdf@npm:^1.0.0": - version: 1.0.2 - resolution: "bcrypt-pbkdf@npm:1.0.2" - dependencies: - tweetnacl: "npm:^0.14.3" - checksum: 10/13a4cde058250dbf1fa77a4f1b9a07d32ae2e3b9e28e88a0c7a1827835bc3482f3e478c4a0cfd4da6ff0c46dae07da1061123a995372b32cc563d9975f975404 - languageName: node - linkType: hard - "big.js@npm:^5.2.2": version: 5.2.2 resolution: "big.js@npm:5.2.2" @@ -2764,10 +2799,12 @@ __metadata: languageName: node linkType: hard -"binaryextensions@npm:^4.18.0": - version: 4.19.0 - resolution: "binaryextensions@npm:4.19.0" - checksum: 10/dee47ff48379994202e391ee52d8eaf90d7cf94980264a7d01e24f464a80ac0c3b5bffea0bba2ce24dcf4afcc33da1b75a95a05dafb85f880750514576fbbe50 +"binaryextensions@npm:^6.11.0": + version: 6.11.0 + resolution: "binaryextensions@npm:6.11.0" + dependencies: + editions: "npm:^6.21.0" + checksum: 10/5b61b16f89e871c95e9b802ffb171e5a0c0f54569894c28c5602381a0617b38f4c1b15fda0047a270745411b6f672689c4e87519a4a58dbc5cde8d280971c852 languageName: node linkType: hard @@ -2908,13 +2945,6 @@ __metadata: languageName: node linkType: hard -"caseless@npm:~0.12.0": - version: 0.12.0 - resolution: "caseless@npm:0.12.0" - checksum: 10/ea1efdf430975fdbac3505cdd21007f7ac5aa29b6d4d1c091f965853cd1bf87e4b08ea07b31a6d688b038872b7cdf0589d9262d59c699d199585daad052aeb20 - languageName: node - linkType: hard - "chalk@npm:^2.4.2": version: 2.4.2 resolution: "chalk@npm:2.4.2" @@ -3031,7 +3061,7 @@ __metadata: languageName: node linkType: hard -"combined-stream@npm:^1.0.6, combined-stream@npm:^1.0.8, combined-stream@npm:~1.0.6": +"combined-stream@npm:^1.0.8": version: 1.0.8 resolution: "combined-stream@npm:1.0.8" dependencies: @@ -3068,17 +3098,10 @@ __metadata: languageName: node linkType: hard -"cookie@npm:0.5.0": - version: 0.5.0 - resolution: "cookie@npm:0.5.0" - checksum: 10/aae7911ddc5f444a9025fbd979ad1b5d60191011339bce48e555cb83343d0f98b865ff5c4d71fecdfb8555a5cafdc65632f6fce172f32aaf6936830a883a0380 - languageName: node - linkType: hard - -"core-util-is@npm:1.0.2": - version: 1.0.2 - resolution: "core-util-is@npm:1.0.2" - checksum: 10/d0f7587346b44a1fe6c269267e037dd34b4787191e473c3e685f507229d88561c40eb18872fabfff02977301815d474300b7bfbd15396c13c5377393f7e87ec3 +"cookie@npm:0.6.0": + version: 0.6.0 + resolution: "cookie@npm:0.6.0" + checksum: 10/c1f8f2ea7d443b9331680598b0ae4e6af18a618c37606d1bbdc75bec8361cce09fe93e727059a673f2ba24467131a9fb5a4eec76bb1b149c1b3e1ccb268dc583 languageName: node linkType: hard @@ -3124,15 +3147,6 @@ __metadata: languageName: node linkType: hard -"dashdash@npm:^1.12.0": - version: 1.14.1 - resolution: "dashdash@npm:1.14.1" - dependencies: - assert-plus: "npm:^1.0.0" - checksum: 10/137b287fa021201ce100cef772c8eeeaaafdd2aa7282864022acf3b873021e54cb809e9c060fa164840bf54ff72d00d6e2d8da1ee5a86d7200eeefa1123a8f7f - languageName: node - linkType: hard - "data-view-buffer@npm:^1.0.1": version: 1.0.1 resolution: "data-view-buffer@npm:1.0.1" @@ -3340,13 +3354,12 @@ __metadata: languageName: node linkType: hard -"ecc-jsbn@npm:~0.1.1": - version: 0.1.2 - resolution: "ecc-jsbn@npm:0.1.2" +"editions@npm:^6.21.0": + version: 6.21.0 + resolution: "editions@npm:6.21.0" dependencies: - jsbn: "npm:~0.1.0" - safer-buffer: "npm:^2.1.0" - checksum: 10/d43591f2396196266e186e6d6928038cc11c76c3699a912cb9c13757060f7bbc7f17f47c4cb16168cdeacffc7965aef021142577e646fb3cb88810c15173eb57 + version-range: "npm:^4.13.0" + checksum: 10/3a6101fe60272a733ef4f1742174bc55f350ace6485a18c7ac30488c0abd6788495bf62332de4198487e60a9dbfd0247b45e5b6d571d9c19e93eb455c0b8be97 languageName: node linkType: hard @@ -4026,27 +4039,6 @@ __metadata: languageName: node linkType: hard -"extend@npm:~3.0.2": - version: 3.0.2 - resolution: "extend@npm:3.0.2" - checksum: 10/59e89e2dc798ec0f54b36d82f32a27d5f6472c53974f61ca098db5d4648430b725387b53449a34df38fd0392045434426b012f302b3cc049a6500ccf82877e4e - languageName: node - linkType: hard - -"extsprintf@npm:1.3.0": - version: 1.3.0 - resolution: "extsprintf@npm:1.3.0" - checksum: 10/26967d6c7ecbfb5bc5b7a6c43503dc5fafd9454802037e9fa1665e41f615da4ff5918bd6cb871a3beabed01a31eca1ccd0bdfb41231f50ad50d405a430f78377 - languageName: node - linkType: hard - -"extsprintf@npm:^1.2.0": - version: 1.4.1 - resolution: "extsprintf@npm:1.4.1" - checksum: 10/bfd6d55f3c0c04d826fe0213264b383c03f32825af6b1ff777f3f2dc49467e599361993568d75b7b19a8ea1bb08c8e7cd8c3d87d179ced91bb0dcf81ca6938e0 - languageName: node - linkType: hard - "fast-deep-equal@npm:^3.1.1, fast-deep-equal@npm:^3.1.3": version: 3.1.3 resolution: "fast-deep-equal@npm:3.1.3" @@ -4162,13 +4154,13 @@ __metadata: languageName: node linkType: hard -"follow-redirects@npm:^1.14.0, follow-redirects@npm:^1.15.0": - version: 1.15.5 - resolution: "follow-redirects@npm:1.15.5" +"follow-redirects@npm:^1.15.0, follow-redirects@npm:^1.15.6": + version: 1.15.9 + resolution: "follow-redirects@npm:1.15.9" peerDependenciesMeta: debug: optional: true - checksum: 10/d467f13c1c6aa734599b8b369cd7a625b20081af358f6204ff515f6f4116eb440de9c4e0c49f10798eeb0df26c95dd05d5e0d9ddc5786ab1a8a8abefe92929b4 + checksum: 10/e3ab42d1097e90d28b913903841e6779eb969b62a64706a3eb983e894a5db000fbd89296f45f08885a0e54cd558ef62e81be1165da9be25a6c44920da10f424c languageName: node linkType: hard @@ -4191,13 +4183,6 @@ __metadata: languageName: node linkType: hard -"forever-agent@npm:~0.6.1": - version: 0.6.1 - resolution: "forever-agent@npm:0.6.1" - checksum: 10/c1e1644d5e074ac063ecbc3fb8582013ef91fff0e3fa41e76db23d2f62bc6d9677aac86db950917deed4fe1fdd772df780cfaa352075f23deec9c015313afb97 - languageName: node - linkType: hard - "form-data@npm:^4.0.0": version: 4.0.0 resolution: "form-data@npm:4.0.0" @@ -4209,17 +4194,6 @@ __metadata: languageName: node linkType: hard -"form-data@npm:~2.3.2": - version: 2.3.3 - resolution: "form-data@npm:2.3.3" - dependencies: - asynckit: "npm:^0.4.0" - combined-stream: "npm:^1.0.6" - mime-types: "npm:^2.1.12" - checksum: 10/1b6f3ccbf4540e535887b42218a2431a3f6cfdea320119c2affa2a7a374ad8fdd1e60166fc865181f45d49b1684c3e90e7b2190d3fe016692957afb9cf0d0d02 - languageName: node - linkType: hard - "fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -4335,15 +4309,6 @@ __metadata: languageName: node linkType: hard -"getpass@npm:^0.1.1": - version: 0.1.7 - resolution: "getpass@npm:0.1.7" - dependencies: - assert-plus: "npm:^1.0.0" - checksum: 10/ab18d55661db264e3eac6012c2d3daeafaab7a501c035ae0ccb193c3c23e9849c6e29b6ac762b9c2adae460266f925d55a3a2a3a3c8b94be2f222df94d70c046 - languageName: node - linkType: hard - "glob-parent@npm:^5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" @@ -4474,23 +4439,6 @@ __metadata: languageName: node linkType: hard -"har-schema@npm:^2.0.0": - version: 2.0.0 - resolution: "har-schema@npm:2.0.0" - checksum: 10/d8946348f333fb09e2bf24cc4c67eabb47c8e1d1aa1c14184c7ffec1140a49ec8aa78aa93677ae452d71d5fc0fdeec20f0c8c1237291fc2bcb3f502a5d204f9b - languageName: node - linkType: hard - -"har-validator@npm:~5.1.3": - version: 5.1.5 - resolution: "har-validator@npm:5.1.5" - dependencies: - ajv: "npm:^6.12.3" - har-schema: "npm:^2.0.0" - checksum: 10/b998a7269ca560d7f219eedc53e2c664cd87d487e428ae854a6af4573fc94f182fe9d2e3b92ab968249baec7ebaf9ead69cf975c931dc2ab282ec182ee988280 - languageName: node - linkType: hard - "has-bigints@npm:^1.0.1, has-bigints@npm:^1.0.2": version: 1.0.2 resolution: "has-bigints@npm:1.0.2" @@ -4577,17 +4525,6 @@ __metadata: languageName: node linkType: hard -"http-signature@npm:~1.2.0": - version: 1.2.0 - resolution: "http-signature@npm:1.2.0" - dependencies: - assert-plus: "npm:^1.0.0" - jsprim: "npm:^1.2.2" - sshpk: "npm:^1.7.0" - checksum: 10/2ff7112e6b0d8f08b382dfe705078c655501f2ddd76cf589d108445a9dd388a0a9be928c37108261519a7f53e6bbd1651048d74057b804807cce1ec49e87a95b - languageName: node - linkType: hard - "https-proxy-agent@npm:^7.0.1": version: 7.0.2 resolution: "https-proxy-agent@npm:7.0.2" @@ -4921,13 +4858,6 @@ __metadata: languageName: node linkType: hard -"is-typedarray@npm:~1.0.0": - version: 1.0.0 - resolution: "is-typedarray@npm:1.0.0" - checksum: 10/4b433bfb0f9026f079f4eb3fbaa4ed2de17c9995c3a0b5c800bec40799b4b2a8b4e051b1ada77749deb9ded4ae52fe2096973f3a93ff83df1a5a7184a669478c - languageName: node - linkType: hard - "is-weakmap@npm:^2.0.1": version: 2.0.1 resolution: "is-weakmap@npm:2.0.1" @@ -4975,13 +4905,6 @@ __metadata: languageName: node linkType: hard -"isstream@npm:~0.1.2": - version: 0.1.2 - resolution: "isstream@npm:0.1.2" - checksum: 10/22d9c181015226d4534a227539256897bbbcb7edd1066ca4fc4d3a06dbd976325dfdd16b3983c7d236a89f256805c1a685a772e0364e98873d3819b064ad35a1 - languageName: node - linkType: hard - "istanbul-lib-coverage@npm:^3.0.0, istanbul-lib-coverage@npm:^3.2.0": version: 3.2.2 resolution: "istanbul-lib-coverage@npm:3.2.2" @@ -5047,13 +4970,14 @@ __metadata: languageName: node linkType: hard -"istextorbinary@npm:6.0.0": - version: 6.0.0 - resolution: "istextorbinary@npm:6.0.0" +"istextorbinary@npm:9.5.0": + version: 9.5.0 + resolution: "istextorbinary@npm:9.5.0" dependencies: - binaryextensions: "npm:^4.18.0" - textextensions: "npm:^5.14.0" - checksum: 10/4078f6a22c09b9f34cf85df27e4d7d94a7cb2cc563769a223ea272a3202397b2d8c7a2e3ef5578a1f8859389c74cf9145bc14bf915779f527e76468e4ddcf7ac + binaryextensions: "npm:^6.11.0" + editions: "npm:^6.21.0" + textextensions: "npm:^6.11.0" + checksum: 10/388f6d4f0ceb12da06e0c107d0a708ff5ef86f8e674b45c138cb59d85cfbebf4b48fdfeeaf1e32ee8c8588db7d7b879ee889da13ef4ef4e0e424037d70f925e8 languageName: node linkType: hard @@ -5906,13 +5830,6 @@ __metadata: languageName: node linkType: hard -"jsbn@npm:~0.1.0": - version: 0.1.1 - resolution: "jsbn@npm:0.1.1" - checksum: 10/5450133242845100e694f0ef9175f44c012691a9b770b2571e677314e6f70600abb10777cdfc9a0c6a9f2ac6d134577403633de73e2fcd0f97875a67744e2d14 - languageName: node - linkType: hard - "jsesc@npm:^2.5.1": version: 2.5.2 resolution: "jsesc@npm:2.5.2" @@ -5943,13 +5860,6 @@ __metadata: languageName: node linkType: hard -"json-schema@npm:0.4.0": - version: 0.4.0 - resolution: "json-schema@npm:0.4.0" - checksum: 10/8b3b64eff4a807dc2a3045b104ed1b9335cd8d57aa74c58718f07f0f48b8baa3293b00af4dcfbdc9144c3aafea1e97982cc27cc8e150fc5d93c540649507a458 - languageName: node - linkType: hard - "json-stable-stringify-without-jsonify@npm:^1.0.1": version: 1.0.1 resolution: "json-stable-stringify-without-jsonify@npm:1.0.1" @@ -5957,13 +5867,6 @@ __metadata: languageName: node linkType: hard -"json-stringify-safe@npm:~5.0.1": - version: 5.0.1 - resolution: "json-stringify-safe@npm:5.0.1" - checksum: 10/59169a081e4eeb6f9559ae1f938f656191c000e0512aa6df9f3c8b2437a4ab1823819c6b9fd1818a4e39593ccfd72e9a051fdd3e2d1e340ed913679e888ded8c - languageName: node - linkType: hard - "json5@npm:^1.0.2": version: 1.0.2 resolution: "json5@npm:1.0.2" @@ -5991,18 +5894,6 @@ __metadata: languageName: node linkType: hard -"jsprim@npm:^1.2.2": - version: 1.4.2 - resolution: "jsprim@npm:1.4.2" - dependencies: - assert-plus: "npm:1.0.0" - extsprintf: "npm:1.3.0" - json-schema: "npm:0.4.0" - verror: "npm:1.10.0" - checksum: 10/df2bf234eab1b5078d01bcbff3553d50a243f7b5c10a169745efeda6344d62798bd1d85bcca6a8446f3b5d0495e989db45f9de8dae219f0f9796e70e0c776089 - languageName: node - linkType: hard - "jsx-ast-utils@npm:^2.4.1 || ^3.0.0, jsx-ast-utils@npm:^3.3.5": version: 3.3.5 resolution: "jsx-ast-utils@npm:3.3.5" @@ -6211,7 +6102,7 @@ __metadata: languageName: node linkType: hard -"mime-types@npm:^2.1.12, mime-types@npm:^2.1.27, mime-types@npm:~2.1.19": +"mime-types@npm:^2.1.12, mime-types@npm:^2.1.27": version: 2.1.35 resolution: "mime-types@npm:2.1.35" dependencies: @@ -6396,7 +6287,7 @@ __metadata: languageName: node linkType: hard -"next@npm:14.1.0, next@npm:>=12.0.10": +"next@npm:14.1.0": version: 14.1.0 resolution: "next@npm:14.1.0" dependencies: @@ -6451,6 +6342,64 @@ __metadata: languageName: node linkType: hard +"next@npm:14.2.9, next@npm:>=12.0.10": + version: 14.2.9 + resolution: "next@npm:14.2.9" + dependencies: + "@next/env": "npm:14.2.9" + "@next/swc-darwin-arm64": "npm:14.2.9" + "@next/swc-darwin-x64": "npm:14.2.9" + "@next/swc-linux-arm64-gnu": "npm:14.2.9" + "@next/swc-linux-arm64-musl": "npm:14.2.9" + "@next/swc-linux-x64-gnu": "npm:14.2.9" + "@next/swc-linux-x64-musl": "npm:14.2.9" + "@next/swc-win32-arm64-msvc": "npm:14.2.9" + "@next/swc-win32-ia32-msvc": "npm:14.2.9" + "@next/swc-win32-x64-msvc": "npm:14.2.9" + "@swc/helpers": "npm:0.5.5" + busboy: "npm:1.6.0" + caniuse-lite: "npm:^1.0.30001579" + graceful-fs: "npm:^4.2.11" + postcss: "npm:8.4.31" + styled-jsx: "npm:5.1.1" + peerDependencies: + "@opentelemetry/api": ^1.1.0 + "@playwright/test": ^1.41.2 + react: ^18.2.0 + react-dom: ^18.2.0 + sass: ^1.3.0 + dependenciesMeta: + "@next/swc-darwin-arm64": + optional: true + "@next/swc-darwin-x64": + optional: true + "@next/swc-linux-arm64-gnu": + optional: true + "@next/swc-linux-arm64-musl": + optional: true + "@next/swc-linux-x64-gnu": + optional: true + "@next/swc-linux-x64-musl": + optional: true + "@next/swc-win32-arm64-msvc": + optional: true + "@next/swc-win32-ia32-msvc": + optional: true + "@next/swc-win32-x64-msvc": + optional: true + peerDependenciesMeta: + "@opentelemetry/api": + optional: true + "@playwright/test": + optional: true + sass: + optional: true + bin: + next: dist/bin/next + checksum: 10/92188b23f2952a24fc4c7591aa4544cbd781dd4cb5902eabfae8a7e0c344232683b47c7e9e2d656ccc507c3f824e51e8b23bc17676bb7acd67d10af80c2c4c27 + languageName: node + linkType: hard + "nextjs@workspace:.": version: 0.0.0-use.local resolution: "nextjs@workspace:." @@ -6556,13 +6505,6 @@ __metadata: languageName: node linkType: hard -"oauth-sign@npm:~0.9.0": - version: 0.9.0 - resolution: "oauth-sign@npm:0.9.0" - checksum: 10/1809a366d258f41fdf4ab5310cff3d1e15f96b187503bc7333cef4351de7bd0f52cb269bc95800f1fae5fb04dd886287df1471985fd67e8484729fdbcf857119 - languageName: node - linkType: hard - "object-assign@npm:^4.1.1": version: 4.1.1 resolution: "object-assign@npm:4.1.1" @@ -6808,13 +6750,6 @@ __metadata: languageName: node linkType: hard -"performance-now@npm:^2.1.0": - version: 2.1.0 - resolution: "performance-now@npm:2.1.0" - checksum: 10/534e641aa8f7cba160f0afec0599b6cecefbb516a2e837b512be0adbe6c1da5550e89c78059c7fabc5c9ffdf6627edabe23eb7c518c4500067a898fa65c2b550 - languageName: node - linkType: hard - "picocolors@npm:^1.0.0, picocolors@npm:^1.0.1": version: 1.1.0 resolution: "picocolors@npm:1.1.0" @@ -6870,12 +6805,12 @@ __metadata: languageName: node linkType: hard -"prettier@npm:2.3.2": - version: 2.3.2 - resolution: "prettier@npm:2.3.2" +"prettier@npm:3.2.5": + version: 3.2.5 + resolution: "prettier@npm:3.2.5" bin: - prettier: bin-prettier.js - checksum: 10/1481c939f64e2ba02277d8bb680974b0c925d3674e1cd68702cd4920361703c53d2cd7f49bcec086fab0820af8013df481b3ffd9e3beac86cfdba2212a614ba9 + prettier: bin/prettier.cjs + checksum: 10/d509f9da0b70e8cacc561a1911c0d99ec75117faed27b95cc8534cb2349667dee6351b0ca83fa9d5703f14127faa52b798de40f5705f02d843da133fc3aa416a languageName: node linkType: hard @@ -6946,13 +6881,6 @@ __metadata: languageName: node linkType: hard -"psl@npm:^1.1.28": - version: 1.9.0 - resolution: "psl@npm:1.9.0" - checksum: 10/d07879d4bfd0ac74796306a8e5a36a93cfb9c4f4e8ee8e63fbb909066c192fe1008cd8f12abd8ba2f62ca28247949a20c8fb32e1d18831d9e71285a1569720f9 - languageName: node - linkType: hard - "punycode@npm:^1.4.1": version: 1.4.1 resolution: "punycode@npm:1.4.1" @@ -6960,7 +6888,7 @@ __metadata: languageName: node linkType: hard -"punycode@npm:^2.1.0, punycode@npm:^2.1.1": +"punycode@npm:^2.1.0": version: 2.3.1 resolution: "punycode@npm:2.3.1" checksum: 10/febdc4362bead22f9e2608ff0171713230b57aff9dddc1c273aa2a651fbd366f94b7d6a71d78342a7c0819906750351ca7f2edd26ea41b626d87d6a13d1bd059 @@ -6974,13 +6902,6 @@ __metadata: languageName: node linkType: hard -"qs@npm:~6.5.2": - version: 6.5.3 - resolution: "qs@npm:6.5.3" - checksum: 10/485c990fba7ad17671e16c92715fb064c1600337738f5d140024eb33a49fbc1ed31890d3db850117c760caeb9c9cc9f4ba22a15c20dd119968e41e3d3fe60b28 - languageName: node - linkType: hard - "queue-microtask@npm:^1.2.2": version: 1.2.3 resolution: "queue-microtask@npm:1.2.3" @@ -7009,6 +6930,18 @@ __metadata: languageName: node linkType: hard +"react-dom@npm:18.3.1": + version: 18.3.1 + resolution: "react-dom@npm:18.3.1" + dependencies: + loose-envify: "npm:^1.1.0" + scheduler: "npm:^0.23.2" + peerDependencies: + react: ^18.3.1 + checksum: 10/3f4b73a3aa083091173b29812b10394dd06f4ac06aff410b74702cfb3aa29d7b0ced208aab92d5272919b612e5cda21aeb1d54191848cf6e46e9e354f3541f81 + languageName: node + linkType: hard + "react-fast-compare@npm:^3.1.1": version: 3.2.2 resolution: "react-fast-compare@npm:3.2.2" @@ -7062,7 +6995,7 @@ __metadata: languageName: node linkType: hard -"react@npm:^18.3.1": +"react@npm:18.3.1, react@npm:^18.3.1": version: 18.3.1 resolution: "react@npm:18.3.1" dependencies: @@ -7120,34 +7053,6 @@ __metadata: languageName: node linkType: hard -"request@npm:2.88.2": - version: 2.88.2 - resolution: "request@npm:2.88.2" - dependencies: - aws-sign2: "npm:~0.7.0" - aws4: "npm:^1.8.0" - caseless: "npm:~0.12.0" - combined-stream: "npm:~1.0.6" - extend: "npm:~3.0.2" - forever-agent: "npm:~0.6.1" - form-data: "npm:~2.3.2" - har-validator: "npm:~5.1.3" - http-signature: "npm:~1.2.0" - is-typedarray: "npm:~1.0.0" - isstream: "npm:~0.1.2" - json-stringify-safe: "npm:~5.0.1" - mime-types: "npm:~2.1.19" - oauth-sign: "npm:~0.9.0" - performance-now: "npm:^2.1.0" - qs: "npm:~6.5.2" - safe-buffer: "npm:^5.1.2" - tough-cookie: "npm:~2.5.0" - tunnel-agent: "npm:^0.6.0" - uuid: "npm:^3.3.2" - checksum: 10/005b8b237b56f1571cfd4ecc09772adaa2e82dcb884fc14ea2bb25e23dbf7c2009f9929e0b6d3fd5802e33ed8ee705a3b594c8f9467c1458cd973872bf89db8e - languageName: node - linkType: hard - "resolve-from@npm:^4.0.0": version: 4.0.0 resolution: "resolve-from@npm:4.0.0" @@ -7274,7 +7179,7 @@ __metadata: languageName: node linkType: hard -"safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:^5.1.2": +"safe-buffer@npm:^5.1.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" checksum: 10/32872cd0ff68a3ddade7a7617b8f4c2ae8764d8b7d884c651b74457967a9e0e886267d3ecc781220629c44a865167b61c375d2da6c720c840ecd73f45d5d9451 @@ -7301,7 +7206,7 @@ __metadata: languageName: node linkType: hard -"safer-buffer@npm:>= 2.1.2 < 3.0.0, safer-buffer@npm:^2.0.2, safer-buffer@npm:^2.1.0, safer-buffer@npm:~2.1.0": +"safer-buffer@npm:>= 2.1.2 < 3.0.0": version: 2.1.2 resolution: "safer-buffer@npm:2.1.2" checksum: 10/7eaf7a0cf37cc27b42fb3ef6a9b1df6e93a1c6d98c6c6702b02fe262d5fcbd89db63320793b99b21cb5348097d0a53de81bd5f4e8b86e20cc9412e3f1cfb4e83 @@ -7315,12 +7220,12 @@ __metadata: languageName: node linkType: hard -"scheduler@npm:^0.23.0": - version: 0.23.0 - resolution: "scheduler@npm:0.23.0" +"scheduler@npm:^0.23.0, scheduler@npm:^0.23.2": + version: 0.23.2 + resolution: "scheduler@npm:0.23.2" dependencies: loose-envify: "npm:^1.1.0" - checksum: 10/0c4557aa37bafca44ff21dc0ea7c92e2dbcb298bc62eae92b29a39b029134f02fb23917d6ebc8b1fa536b4184934314c20d8864d156a9f6357f3398aaf7bfda8 + checksum: 10/e8d68b89d18d5b028223edf090092846868a765a591944760942b77ea1f69b17235f7e956696efbb62c8130ab90af7e0949bfb8eba7896335507317236966bc9 languageName: node linkType: hard @@ -7539,27 +7444,6 @@ __metadata: languageName: node linkType: hard -"sshpk@npm:^1.7.0": - version: 1.18.0 - resolution: "sshpk@npm:1.18.0" - dependencies: - asn1: "npm:~0.2.3" - assert-plus: "npm:^1.0.0" - bcrypt-pbkdf: "npm:^1.0.0" - dashdash: "npm:^1.12.0" - ecc-jsbn: "npm:~0.1.1" - getpass: "npm:^0.1.1" - jsbn: "npm:~0.1.0" - safer-buffer: "npm:^2.0.2" - tweetnacl: "npm:~0.14.0" - bin: - sshpk-conv: bin/sshpk-conv - sshpk-sign: bin/sshpk-sign - sshpk-verify: bin/sshpk-verify - checksum: 10/858339d43e3c6b6a848772a66f69442ce74f1a37655d9f35ba9d1f85329499ff0000af9f8ab83dbb39ad24c0c370edabe0be1e39863f70c6cded9924b8458c34 - languageName: node - linkType: hard - "ssri@npm:^10.0.0": version: 10.0.5 resolution: "ssri@npm:10.0.5" @@ -7905,10 +7789,12 @@ __metadata: languageName: node linkType: hard -"textextensions@npm:^5.14.0": - version: 5.16.0 - resolution: "textextensions@npm:5.16.0" - checksum: 10/d41e9265e9d74d192d4fb26fc89a2f4dbe7a6d85cc5c14f99f1df68d07bce5346f8abe0ed680a91ef805b91e9972e5787c7365a03f3a5489e16ca350d28a3879 +"textextensions@npm:^6.11.0": + version: 6.11.0 + resolution: "textextensions@npm:6.11.0" + dependencies: + editions: "npm:^6.21.0" + checksum: 10/f0fc73c38462fe4cb675c7b176494763c819be1e9fc4c10d669bad47b20fcf576de2331b19c729c64cbff9451b9e92ae05c04a5c4321edc66d5e5bde7ec2047f languageName: node linkType: hard @@ -7944,16 +7830,6 @@ __metadata: languageName: node linkType: hard -"tough-cookie@npm:~2.5.0": - version: 2.5.0 - resolution: "tough-cookie@npm:2.5.0" - dependencies: - psl: "npm:^1.1.28" - punycode: "npm:^2.1.1" - checksum: 10/024cb13a4d1fe9af57f4323dff765dd9b217cc2a69be77e3b8a1ca45600aa33a097b6ad949f225d885e904f4bd3ceccef104741ef202d8378e6ca78e850ff82f - languageName: node - linkType: hard - "ts-jest-resolver@npm:^2.0.1": version: 2.0.1 resolution: "ts-jest-resolver@npm:2.0.1" @@ -8016,22 +7892,6 @@ __metadata: languageName: node linkType: hard -"tunnel-agent@npm:^0.6.0": - version: 0.6.0 - resolution: "tunnel-agent@npm:0.6.0" - dependencies: - safe-buffer: "npm:^5.0.1" - checksum: 10/7f0d9ed5c22404072b2ae8edc45c071772affd2ed14a74f03b4e71b4dd1a14c3714d85aed64abcaaee5fec2efc79002ba81155c708f4df65821b444abb0cfade - languageName: node - linkType: hard - -"tweetnacl@npm:^0.14.3, tweetnacl@npm:~0.14.0": - version: 0.14.5 - resolution: "tweetnacl@npm:0.14.5" - checksum: 10/04ee27901cde46c1c0a64b9584e04c96c5fe45b38c0d74930710751ea991408b405747d01dfae72f80fc158137018aea94f9c38c651cb9c318f0861a310c3679 - languageName: node - linkType: hard - "type-check@npm:^0.4.0, type-check@npm:~0.4.0": version: 0.4.0 resolution: "type-check@npm:0.4.0" @@ -8194,15 +8054,6 @@ __metadata: languageName: node linkType: hard -"uuid@npm:^3.3.2": - version: 3.4.0 - resolution: "uuid@npm:3.4.0" - bin: - uuid: ./bin/uuid - checksum: 10/4f2b86432b04cc7c73a0dd1bcf11f1fc18349d65d2e4e32dd0fc658909329a1e0cc9244aa93f34c0cccfdd5ae1af60a149251a5f420ec3ac4223a3dab198fb2e - languageName: node - linkType: hard - "v8-to-istanbul@npm:^9.0.1": version: 9.2.0 resolution: "v8-to-istanbul@npm:9.2.0" @@ -8214,14 +8065,10 @@ __metadata: languageName: node linkType: hard -"verror@npm:1.10.0": - version: 1.10.0 - resolution: "verror@npm:1.10.0" - dependencies: - assert-plus: "npm:^1.0.0" - core-util-is: "npm:1.0.2" - extsprintf: "npm:^1.2.0" - checksum: 10/da548149dd9c130a8a2587c9ee71ea30128d1526925707e2d01ed9c5c45c9e9f86733c66a328247cdd5f7c1516fb25b0f959ba754bfbe15072aa99ff96468a29 +"version-range@npm:^4.13.0": + version: 4.14.0 + resolution: "version-range@npm:4.14.0" + checksum: 10/8099d724e4374e473dca506e7e12859e554e19633df29b46cfa3b4b3a7a73d2360ede841f43965f113b1ba005573723b023fa157ab36f4b7b5ec0e0b271628f3 languageName: node linkType: hard From ec161d878df2c7b64176d7e9d043f0343c24e304 Mon Sep 17 00:00:00 2001 From: Nikita Elfimov Date: Wed, 11 Sep 2024 11:45:58 +0300 Subject: [PATCH 2/2] feat(identity-integration): export page and app router flows --- .pnp.cjs | 12 +- .yarnrc.yml | 6 + packages/identity-integration/README.md | 6 + packages/identity-integration/package.json | 25 ++- .../identity-integration/src/app-router.ts | 1 + .../error.flow.tsx | 25 +-- .../handle-errors.util.ts | 0 .../src/{flows => flows-app-router}/index.ts | 0 .../login.flow.tsx | 39 ++-- .../logout.flow.tsx | 23 +-- .../recovery.flow.tsx | 39 ++-- .../registration.flow.tsx | 45 ++--- .../settings.flow.tsx | 39 ++-- .../verification.flow.tsx | 37 ++-- .../src/flows-page-router/error.flow.tsx | 53 +++++ .../flows-page-router/handle-errors.util.ts | 89 +++++++++ .../src/flows-page-router/index.ts | 7 + .../src/flows-page-router/login.flow.tsx | 125 ++++++++++++ .../src/flows-page-router/logout.flow.tsx | 58 ++++++ .../src/flows-page-router/recovery.flow.tsx | 129 +++++++++++++ .../flows-page-router/registration.flow.tsx | 181 ++++++++++++++++++ .../src/flows-page-router/settings.flow.tsx | 139 ++++++++++++++ .../flows-page-router/verification.flow.tsx | 135 +++++++++++++ packages/identity-integration/src/index.ts | 1 - .../identity-integration/src/page-router.ts | 1 + .../src/providers/error.context.ts | 5 +- yarn.lock | 17 +- 27 files changed, 1087 insertions(+), 150 deletions(-) create mode 100644 packages/identity-integration/src/app-router.ts rename packages/identity-integration/src/{flows => flows-app-router}/error.flow.tsx (64%) rename packages/identity-integration/src/{flows => flows-app-router}/handle-errors.util.ts (100%) rename packages/identity-integration/src/{flows => flows-app-router}/index.ts (100%) rename packages/identity-integration/src/{flows => flows-app-router}/login.flow.tsx (72%) rename packages/identity-integration/src/{flows => flows-app-router}/logout.flow.tsx (66%) rename packages/identity-integration/src/{flows => flows-app-router}/recovery.flow.tsx (71%) rename packages/identity-integration/src/{flows => flows-app-router}/registration.flow.tsx (74%) rename packages/identity-integration/src/{flows => flows-app-router}/settings.flow.tsx (73%) rename packages/identity-integration/src/{flows => flows-app-router}/verification.flow.tsx (70%) create mode 100644 packages/identity-integration/src/flows-page-router/error.flow.tsx create mode 100644 packages/identity-integration/src/flows-page-router/handle-errors.util.ts create mode 100644 packages/identity-integration/src/flows-page-router/index.ts create mode 100644 packages/identity-integration/src/flows-page-router/login.flow.tsx create mode 100644 packages/identity-integration/src/flows-page-router/logout.flow.tsx create mode 100644 packages/identity-integration/src/flows-page-router/recovery.flow.tsx create mode 100644 packages/identity-integration/src/flows-page-router/registration.flow.tsx create mode 100644 packages/identity-integration/src/flows-page-router/settings.flow.tsx create mode 100644 packages/identity-integration/src/flows-page-router/verification.flow.tsx create mode 100644 packages/identity-integration/src/page-router.ts diff --git a/.pnp.cjs b/.pnp.cjs index 58a8ec27..845c0180 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -275,7 +275,7 @@ const RAW_RUNTIME_STATE = ["@types/react", "npm:18.2.40"],\ ["@types/react-dom", "npm:18.2.10"],\ ["@types/tldjs", "npm:2.3.4"],\ - ["axios", "npm:1.5.1"],\ + ["axios", "npm:1.7.7"],\ ["next", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:14.2.9"],\ ["react", "npm:18.3.1"],\ ["react-dom", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:18.3.1"],\ @@ -3602,16 +3602,6 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["axios", [\ - ["npm:1.5.1", {\ - "packageLocation": "../.yarn/berry/cache/axios-npm-1.5.1-6bc68e7d25-10.zip/node_modules/axios/",\ - "packageDependencies": [\ - ["axios", "npm:1.5.1"],\ - ["follow-redirects", "virtual:cfbedc233d4c16068d815547ad303dec1092fdb3b8bb4ec9ab9c56bdd55b4e87650c7a525a88805756f4d2819c03abfd96a9983cfa927fedf995d1b8b879db38#npm:1.15.9"],\ - ["form-data", "npm:4.0.0"],\ - ["proxy-from-env", "npm:1.1.0"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:1.7.7", {\ "packageLocation": "../.yarn/berry/cache/axios-npm-1.7.7-cfbedc233d-10.zip/node_modules/axios/",\ "packageDependencies": [\ diff --git a/.yarnrc.yml b/.yarnrc.yml index 5a723690..a6838ed3 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -5,3 +5,9 @@ enableGlobalCache: true globalFolder: ../.yarn/berry yarnPath: .yarn/releases/yarn.cjs + +preferReuse: true + +defaultSemverRangePrefix: '' + +pnpEnableEsmLoader: true diff --git a/packages/identity-integration/README.md b/packages/identity-integration/README.md index 19e9d5b3..4eb33731 100644 --- a/packages/identity-integration/README.md +++ b/packages/identity-integration/README.md @@ -1,5 +1,11 @@ # Identity Integration +## BREAKING CHANGE 1.0.0 + +- Flow экспортируются: + - `@atls/next-identity-integration/app-router` - для `app` роутера + - `@atls/next-identity-integration/page-router` - для `pages` роутера + ## BREAKING CHANGE 0.2.0 - Переход на `App Router` для `Next.JS@14` diff --git a/packages/identity-integration/package.json b/packages/identity-integration/package.json index 15ebc29e..40c8aa18 100644 --- a/packages/identity-integration/package.json +++ b/packages/identity-integration/package.json @@ -4,7 +4,10 @@ "license": "BSD-3-Clause", "type": "module", "exports": { - ".": "./src/index.ts" + ".": "./src/index.ts", + "./package.json": "./package.json", + "./app-router": "./src/app-router.ts", + "./page-router": "./src/page-router.ts" }, "main": "src/index.ts", "files": [ @@ -25,7 +28,7 @@ "@types/react": "18.2.40", "@types/react-dom": "18.2.10", "@types/tldjs": "2.3.4", - "axios": "1.5.1", + "axios": "1.7.7", "next": "14.2.9", "react": "18.3.1", "react-dom": "18.3.1" @@ -36,6 +39,24 @@ }, "publishConfig": { "access": "public", + "exports": { + "./package.json": "./package.json", + ".": { + "import": "./dist/index.js", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./app-router": { + "import": "./dist/app-router.js", + "types": "./dist/app-router.d.ts", + "default": "./dist/app-router.js" + }, + "./page-router": { + "import": "./dist/page-router.js", + "types": "./dist/page-router.d.ts", + "default": "./dist/page-router.js" + } + }, "main": "dist/index.js", "typings": "dist/index.d.ts" }, diff --git a/packages/identity-integration/src/app-router.ts b/packages/identity-integration/src/app-router.ts new file mode 100644 index 00000000..a1c7a332 --- /dev/null +++ b/packages/identity-integration/src/app-router.ts @@ -0,0 +1 @@ +export * from './flows-app-router/index.js' diff --git a/packages/identity-integration/src/flows/error.flow.tsx b/packages/identity-integration/src/flows-app-router/error.flow.tsx similarity index 64% rename from packages/identity-integration/src/flows/error.flow.tsx rename to packages/identity-integration/src/flows-app-router/error.flow.tsx index 45a20d47..c8c2004d 100644 --- a/packages/identity-integration/src/flows/error.flow.tsx +++ b/packages/identity-integration/src/flows-app-router/error.flow.tsx @@ -1,15 +1,16 @@ -import { FlowError } from '@ory/kratos-client' -import { AxiosError } from 'axios' -import { PropsWithChildren } from 'react' -import { FC } from 'react' -import { useRouter } from 'next/navigation.js' -import { useSearchParams } from 'next/navigation.js' -import { useState } from 'react' -import { useEffect } from 'react' -import React from 'react' - -import { ErrorProvider } from '../providers/index.js' -import { useKratosClient } from '../providers/index.js' +import type { FlowError } from '@ory/kratos-client' +import type { AxiosError } from 'axios' +import type { PropsWithChildren } from 'react' +import type { FC } from 'react' + +import { useRouter } from 'next/navigation.js' +import { useSearchParams } from 'next/navigation.js' +import { useState } from 'react' +import { useEffect } from 'react' +import React from 'react' + +import { ErrorProvider } from '../providers/index.js' +import { useKratosClient } from '../providers/index.js' export interface ErrorErrorProps { returnToUrl?: string diff --git a/packages/identity-integration/src/flows/handle-errors.util.ts b/packages/identity-integration/src/flows-app-router/handle-errors.util.ts similarity index 100% rename from packages/identity-integration/src/flows/handle-errors.util.ts rename to packages/identity-integration/src/flows-app-router/handle-errors.util.ts diff --git a/packages/identity-integration/src/flows/index.ts b/packages/identity-integration/src/flows-app-router/index.ts similarity index 100% rename from packages/identity-integration/src/flows/index.ts rename to packages/identity-integration/src/flows-app-router/index.ts diff --git a/packages/identity-integration/src/flows/login.flow.tsx b/packages/identity-integration/src/flows-app-router/login.flow.tsx similarity index 72% rename from packages/identity-integration/src/flows/login.flow.tsx rename to packages/identity-integration/src/flows-app-router/login.flow.tsx index 4fc9a57d..8dc069e2 100644 --- a/packages/identity-integration/src/flows/login.flow.tsx +++ b/packages/identity-integration/src/flows-app-router/login.flow.tsx @@ -1,22 +1,23 @@ -import { UpdateLoginFlowBody } from '@ory/kratos-client' -import { LoginFlow as KratosLoginFlow } from '@ory/kratos-client' -import { AxiosError } from 'axios' -import { PropsWithChildren } from 'react' -import { FC } from 'react' -import { useSearchParams } from 'next/navigation.js' -import { useRouter } from 'next/navigation.js' -import { useState } from 'react' -import { useEffect } from 'react' -import { useMemo } from 'react' -import { useCallback } from 'react' -import React from 'react' - -import { FlowProvider } from '../providers/index.js' -import { ValuesProvider } from '../providers/index.js' -import { ValuesStore } from '../providers/index.js' -import { SubmitProvider } from '../providers/index.js' -import { useKratosClient } from '../providers/index.js' -import { handleFlowError } from './handle-errors.util.js' +import type { UpdateLoginFlowBody } from '@ory/kratos-client' +import type { LoginFlow as KratosLoginFlow } from '@ory/kratos-client' +import type { AxiosError } from 'axios' +import type { PropsWithChildren } from 'react' +import type { FC } from 'react' + +import { useSearchParams } from 'next/navigation.js' +import { useRouter } from 'next/navigation.js' +import { useState } from 'react' +import { useEffect } from 'react' +import { useMemo } from 'react' +import { useCallback } from 'react' +import React from 'react' + +import { FlowProvider } from '../providers/index.js' +import { ValuesProvider } from '../providers/index.js' +import { ValuesStore } from '../providers/index.js' +import { SubmitProvider } from '../providers/index.js' +import { useKratosClient } from '../providers/index.js' +import { handleFlowError } from './handle-errors.util.js' export interface LoginFlowProps { onError?: (error: { id: string }) => void diff --git a/packages/identity-integration/src/flows/logout.flow.tsx b/packages/identity-integration/src/flows-app-router/logout.flow.tsx similarity index 66% rename from packages/identity-integration/src/flows/logout.flow.tsx rename to packages/identity-integration/src/flows-app-router/logout.flow.tsx index cf8cf636..1650abc7 100644 --- a/packages/identity-integration/src/flows/logout.flow.tsx +++ b/packages/identity-integration/src/flows-app-router/logout.flow.tsx @@ -1,14 +1,15 @@ -import { LogoutFlow as KratosLogoutFlow } from '@ory/kratos-client' -import { AxiosError } from 'axios' -import { PropsWithChildren } from 'react' -import { FC } from 'react' -import { useSearchParams } from 'next/navigation.js' -import { useRouter } from 'next/navigation.js' -import { useState } from 'react' -import { useEffect } from 'react' -import React from 'react' - -import { useKratosClient } from '../providers/index.js' +import type { LogoutFlow as KratosLogoutFlow } from '@ory/kratos-client' +import type { AxiosError } from 'axios' +import type { PropsWithChildren } from 'react' +import type { FC } from 'react' + +import { useSearchParams } from 'next/navigation.js' +import { useRouter } from 'next/navigation.js' +import { useState } from 'react' +import { useEffect } from 'react' +import React from 'react' + +import { useKratosClient } from '../providers/index.js' interface LogoutFlowProps { returnToUrl?: string diff --git a/packages/identity-integration/src/flows/recovery.flow.tsx b/packages/identity-integration/src/flows-app-router/recovery.flow.tsx similarity index 71% rename from packages/identity-integration/src/flows/recovery.flow.tsx rename to packages/identity-integration/src/flows-app-router/recovery.flow.tsx index 43b4c7e4..6657ba1a 100644 --- a/packages/identity-integration/src/flows/recovery.flow.tsx +++ b/packages/identity-integration/src/flows-app-router/recovery.flow.tsx @@ -1,22 +1,23 @@ -import { UpdateRecoveryFlowBody } from '@ory/kratos-client' -import { RecoveryFlow as KratosRecoveryFlow } from '@ory/kratos-client' -import { AxiosError } from 'axios' -import { PropsWithChildren } from 'react' -import { FC } from 'react' -import { useSearchParams } from 'next/navigation.js' -import { useRouter } from 'next/navigation.js' -import { useState } from 'react' -import { useEffect } from 'react' -import { useMemo } from 'react' -import { useCallback } from 'react' -import React from 'react' - -import { FlowProvider } from '../providers/index.js' -import { ValuesProvider } from '../providers/index.js' -import { ValuesStore } from '../providers/index.js' -import { SubmitProvider } from '../providers/index.js' -import { useKratosClient } from '../providers/index.js' -import { handleFlowError } from './handle-errors.util.js' +import type { UpdateRecoveryFlowBody } from '@ory/kratos-client' +import type { RecoveryFlow as KratosRecoveryFlow } from '@ory/kratos-client' +import type { AxiosError } from 'axios' +import type { PropsWithChildren } from 'react' +import type { FC } from 'react' + +import { useSearchParams } from 'next/navigation.js' +import { useRouter } from 'next/navigation.js' +import { useState } from 'react' +import { useEffect } from 'react' +import { useMemo } from 'react' +import { useCallback } from 'react' +import React from 'react' + +import { FlowProvider } from '../providers/index.js' +import { ValuesProvider } from '../providers/index.js' +import { ValuesStore } from '../providers/index.js' +import { SubmitProvider } from '../providers/index.js' +import { useKratosClient } from '../providers/index.js' +import { handleFlowError } from './handle-errors.util.js' export interface RecoveryFlowProps { onError?: (error: { id: string }) => void diff --git a/packages/identity-integration/src/flows/registration.flow.tsx b/packages/identity-integration/src/flows-app-router/registration.flow.tsx similarity index 74% rename from packages/identity-integration/src/flows/registration.flow.tsx rename to packages/identity-integration/src/flows-app-router/registration.flow.tsx index 66f45a73..57a570ba 100644 --- a/packages/identity-integration/src/flows/registration.flow.tsx +++ b/packages/identity-integration/src/flows-app-router/registration.flow.tsx @@ -1,25 +1,26 @@ -import { Identity } from '@ory/kratos-client' -import { UpdateRegistrationFlowBody } from '@ory/kratos-client' -import { RegistrationFlow as KratosRegistrationFlow } from '@ory/kratos-client' -import { ContinueWith as KratosContinueWith } from '@ory/kratos-client' -import { UiNodeInputAttributes } from '@ory/kratos-client' -import { AxiosError } from 'axios' -import { PropsWithChildren } from 'react' -import { FC } from 'react' -import { useSearchParams } from 'next/navigation.js' -import { useRouter } from 'next/navigation.js' -import { useState } from 'react' -import { useEffect } from 'react' -import { useMemo } from 'react' -import { useCallback } from 'react' -import React from 'react' - -import { FlowProvider } from '../providers/index.js' -import { ValuesProvider } from '../providers/index.js' -import { ValuesStore } from '../providers/index.js' -import { SubmitProvider } from '../providers/index.js' -import { useKratosClient } from '../providers/index.js' -import { handleFlowError } from './handle-errors.util.js' +import type { Identity } from '@ory/kratos-client' +import type { UpdateRegistrationFlowBody } from '@ory/kratos-client' +import type { RegistrationFlow as KratosRegistrationFlow } from '@ory/kratos-client' +import type { ContinueWith as KratosContinueWith } from '@ory/kratos-client' +import type { UiNodeInputAttributes } from '@ory/kratos-client' +import type { AxiosError } from 'axios' +import type { PropsWithChildren } from 'react' +import type { FC } from 'react' + +import { useSearchParams } from 'next/navigation.js' +import { useRouter } from 'next/navigation.js' +import { useState } from 'react' +import { useEffect } from 'react' +import { useMemo } from 'react' +import { useCallback } from 'react' +import React from 'react' + +import { FlowProvider } from '../providers/index.js' +import { ValuesProvider } from '../providers/index.js' +import { ValuesStore } from '../providers/index.js' +import { SubmitProvider } from '../providers/index.js' +import { useKratosClient } from '../providers/index.js' +import { handleFlowError } from './handle-errors.util.js' export interface RegistrationFlowProps { onError?: (error: { id: string }) => void diff --git a/packages/identity-integration/src/flows/settings.flow.tsx b/packages/identity-integration/src/flows-app-router/settings.flow.tsx similarity index 73% rename from packages/identity-integration/src/flows/settings.flow.tsx rename to packages/identity-integration/src/flows-app-router/settings.flow.tsx index 4e44dff7..e58660d5 100644 --- a/packages/identity-integration/src/flows/settings.flow.tsx +++ b/packages/identity-integration/src/flows-app-router/settings.flow.tsx @@ -1,22 +1,23 @@ -import { UpdateSettingsFlowBody } from '@ory/kratos-client' -import { SettingsFlow as KratosSettingsFlow } from '@ory/kratos-client' -import { AxiosError } from 'axios' -import { PropsWithChildren } from 'react' -import { FC } from 'react' -import { useSearchParams } from 'next/navigation.js' -import { useRouter } from 'next/navigation.js' -import { useState } from 'react' -import { useEffect } from 'react' -import { useMemo } from 'react' -import { useCallback } from 'react' -import React from 'react' - -import { FlowProvider } from '../providers/index.js' -import { ValuesProvider } from '../providers/index.js' -import { ValuesStore } from '../providers/index.js' -import { SubmitProvider } from '../providers/index.js' -import { useKratosClient } from '../providers/index.js' -import { handleFlowError } from './handle-errors.util.js' +import type { UpdateSettingsFlowBody } from '@ory/kratos-client' +import type { SettingsFlow as KratosSettingsFlow } from '@ory/kratos-client' +import type { AxiosError } from 'axios' +import type { PropsWithChildren } from 'react' +import type { FC } from 'react' + +import { useSearchParams } from 'next/navigation.js' +import { useRouter } from 'next/navigation.js' +import { useState } from 'react' +import { useEffect } from 'react' +import { useMemo } from 'react' +import { useCallback } from 'react' +import React from 'react' + +import { FlowProvider } from '../providers/index.js' +import { ValuesProvider } from '../providers/index.js' +import { ValuesStore } from '../providers/index.js' +import { SubmitProvider } from '../providers/index.js' +import { useKratosClient } from '../providers/index.js' +import { handleFlowError } from './handle-errors.util.js' export interface SettingsFlowProps { onError?: (error: { id: string }) => void diff --git a/packages/identity-integration/src/flows/verification.flow.tsx b/packages/identity-integration/src/flows-app-router/verification.flow.tsx similarity index 70% rename from packages/identity-integration/src/flows/verification.flow.tsx rename to packages/identity-integration/src/flows-app-router/verification.flow.tsx index 036912ac..a8b4866c 100644 --- a/packages/identity-integration/src/flows/verification.flow.tsx +++ b/packages/identity-integration/src/flows-app-router/verification.flow.tsx @@ -1,23 +1,24 @@ /* eslint-disable default-case */ -import { UpdateVerificationFlowBody } from '@ory/kratos-client' -import { VerificationFlow as KratosVerificationFlow } from '@ory/kratos-client' -import { AxiosError } from 'axios' -import { PropsWithChildren } from 'react' -import { FC } from 'react' -import { useSearchParams } from 'next/navigation.js' -import { useRouter } from 'next/navigation.js' -import { useState } from 'react' -import { useEffect } from 'react' -import { useMemo } from 'react' -import { useCallback } from 'react' -import React from 'react' - -import { FlowProvider } from '../providers/index.js' -import { ValuesProvider } from '../providers/index.js' -import { ValuesStore } from '../providers/index.js' -import { SubmitProvider } from '../providers/index.js' -import { useKratosClient } from '../providers/index.js' +import type { UpdateVerificationFlowBody } from '@ory/kratos-client' +import type { VerificationFlow as KratosVerificationFlow } from '@ory/kratos-client' +import type { AxiosError } from 'axios' +import type { PropsWithChildren } from 'react' +import type { FC } from 'react' + +import { useSearchParams } from 'next/navigation.js' +import { useRouter } from 'next/navigation.js' +import { useState } from 'react' +import { useEffect } from 'react' +import { useMemo } from 'react' +import { useCallback } from 'react' +import React from 'react' + +import { FlowProvider } from '../providers/index.js' +import { ValuesProvider } from '../providers/index.js' +import { ValuesStore } from '../providers/index.js' +import { SubmitProvider } from '../providers/index.js' +import { useKratosClient } from '../providers/index.js' export interface VerificationFlowProps { onError?: (error: { id: string }) => void diff --git a/packages/identity-integration/src/flows-page-router/error.flow.tsx b/packages/identity-integration/src/flows-page-router/error.flow.tsx new file mode 100644 index 00000000..9069494e --- /dev/null +++ b/packages/identity-integration/src/flows-page-router/error.flow.tsx @@ -0,0 +1,53 @@ +import type { FlowError } from '@ory/kratos-client' +import type { AxiosError } from 'axios' +import type { PropsWithChildren } from 'react' +import type { FC } from 'react' + +import { useRouter } from 'next/router.js' +import { useState } from 'react' +import { useEffect } from 'react' +import React from 'react' + +import { ErrorProvider } from '../providers/index.js' +import { useKratosClient } from '../providers/index.js' + +export interface ErrorErrorProps { + returnToUrl?: string +} + +export const ErrorFlow: FC> = ({ children, returnToUrl }) => { + const [error, setError] = useState() + const [loading, setLoading] = useState(true) + const { push, query, isReady } = useRouter() + + const { kratosClient } = useKratosClient() + + const { id } = query + + useEffect(() => { + if (!isReady || error) { + return + } + + kratosClient + .getFlowError({ id: String(id) }) + .then(({ data }) => { + setError(data) + }) + .catch((err: AxiosError) => { + // eslint-disable-next-line default-case + switch (err.response?.status) { + case 404: + case 403: + case 410: + return push(returnToUrl ?? '/auth/login') + } + + return Promise.reject(err) + }) + .finally(() => setLoading(false)) + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [id, push, isReady, error]) + + return {children} +} diff --git a/packages/identity-integration/src/flows-page-router/handle-errors.util.ts b/packages/identity-integration/src/flows-page-router/handle-errors.util.ts new file mode 100644 index 00000000..d7c560de --- /dev/null +++ b/packages/identity-integration/src/flows-page-router/handle-errors.util.ts @@ -0,0 +1,89 @@ +/* eslint-disable consistent-return */ +/* eslint-disable prefer-template */ +/* eslint-disable default-case */ + +import type { AxiosError } from 'axios' +import type { NextRouter } from 'next/router.js' +import type { Dispatch } from 'react' +import type { SetStateAction } from 'react' + +export const handleFlowError = ( + router: NextRouter, + flowType: 'login' | 'registration' | 'settings' | 'recovery' | 'verification', + onResetFlow: Dispatch>, + onErrorRedirectUrl: string, + onError?: (error: any) => void + ) => + async (error: AxiosError) => { + const redirectToSettings = onErrorRedirectUrl + + switch (error.response?.data.error?.id) { + case 'session_aal2_required': + window.location.href = error.response?.data.redirect_browser_to + + return + case 'session_already_available': + if (error.response?.data?.redirect_browser_to) { + window.location.href = error.response.data.redirect_browser_to + } else { + await router.push(redirectToSettings) + } + + return + case 'session_refresh_required': + window.location.href = error.response?.data.redirect_browser_to + + return + case 'self_service_flow_return_to_forbidden': + if (onError) { + onError(error.response.data.error) + } + + onResetFlow(undefined) + + await router.push(flowType === 'settings' ? redirectToSettings : '/auth/' + flowType) + + return + case 'self_service_flow_expired': + if (onError) { + onError(error.response.data.error) + } + + onResetFlow(undefined) + + await router.push(flowType === 'settings' ? redirectToSettings : '/auth/' + flowType) + + return + case 'security_csrf_violation': + if (onError) { + onError(error.response.data.error) + } + + onResetFlow(undefined) + + await router.push(flowType === 'settings' ? redirectToSettings : '/auth/' + flowType) + + return + case 'security_identity_mismatch': + onResetFlow(undefined) + + await router.push(flowType === 'settings' ? redirectToSettings : '/auth/' + flowType) + + return + case 'browser_location_change_required': + window.location.href = error.response.data.redirect_browser_to + + return + } + + switch (error.response?.status) { + case 410: + onResetFlow(undefined) + + await router.push(flowType === 'settings' ? redirectToSettings : '/auth/' + flowType) + + return + } + + return Promise.reject(error) + } diff --git a/packages/identity-integration/src/flows-page-router/index.ts b/packages/identity-integration/src/flows-page-router/index.ts new file mode 100644 index 00000000..87bf4646 --- /dev/null +++ b/packages/identity-integration/src/flows-page-router/index.ts @@ -0,0 +1,7 @@ +export * from './verification.flow.js' +export * from './registration.flow.js' +export * from './recovery.flow.js' +export * from './settings.flow.js' +export * from './login.flow.js' +export * from './error.flow.js' +export * from './logout.flow.js' diff --git a/packages/identity-integration/src/flows-page-router/login.flow.tsx b/packages/identity-integration/src/flows-page-router/login.flow.tsx new file mode 100644 index 00000000..63e8920a --- /dev/null +++ b/packages/identity-integration/src/flows-page-router/login.flow.tsx @@ -0,0 +1,125 @@ +import type { UpdateLoginFlowBody } from '@ory/kratos-client' +import type { LoginFlow as KratosLoginFlow } from '@ory/kratos-client' +import type { AxiosError } from 'axios' +import type { PropsWithChildren } from 'react' +import type { FC } from 'react' + +import { useRouter } from 'next/router.js' +import { useState } from 'react' +import { useEffect } from 'react' +import { useMemo } from 'react' +import { useCallback } from 'react' +import React from 'react' + +import { FlowProvider } from '../providers/index.js' +import { ValuesProvider } from '../providers/index.js' +import { ValuesStore } from '../providers/index.js' +import { SubmitProvider } from '../providers/index.js' +import { useKratosClient } from '../providers/index.js' +import { handleFlowError } from './handle-errors.util.js' + +export interface LoginFlowProps { + onError?: (error: { id: string }) => void + returnToUrl?: string +} + +export const LoginFlow: FC> = ({ + children, + onError, + returnToUrl, +}) => { + const [flow, setFlow] = useState() + const [submitting, setSubmitting] = useState(false) + const [loading, setLoading] = useState(true) + const values = useMemo(() => new ValuesStore(), []) + const router = useRouter() + const { kratosClient, returnToSettingsUrl } = useKratosClient() + + const { return_to: returnTo, flow: flowId, refresh, aal } = router.query + + useEffect(() => { + if (!router.isReady || flow) return + + if (flowId) { + kratosClient + .getLoginFlow({ id: String(flowId) }, { withCredentials: true }) + .then(({ data }) => { + setFlow(data) + }) + .catch(handleFlowError(router, 'login', setFlow, returnToSettingsUrl, onError)) + .finally(() => setLoading(false)) + + return + } + + kratosClient + .createBrowserLoginFlow( + { + refresh: Boolean(refresh), + aal: aal ? String(aal) : undefined, + returnTo: returnTo?.toString() ?? returnToUrl, + }, + { withCredentials: true } + ) + .then(({ data }) => { + setFlow(data) + }) + .catch(handleFlowError(router, 'login', setFlow, returnToSettingsUrl, onError)) + .finally(() => setLoading(false)) + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [flowId, router, router.isReady, aal, refresh, returnTo, flow, onError]) + + useEffect(() => { + if (flow) { + values.setFromFlow(flow) + } + }, [values, flow]) + + const onSubmit = useCallback( + (override?: Partial) => { + setSubmitting(true) + + const body = { + ...(values.getValues() as UpdateLoginFlowBody), + ...(override || {}), + } + + kratosClient + .updateLoginFlow( + // @ts-ignore + { flow: String(flow?.id), updateLoginFlowBody: body }, + { withCredentials: true } + ) + .then(() => { + if (flow?.return_to) { + window.location.href = flow?.return_to + } else { + router.push(returnToUrl ?? '/') + } + }) + .catch(handleFlowError(router, 'login', setFlow, returnToSettingsUrl)) + .catch((error: AxiosError) => { + if (error.response?.status === 400) { + setFlow(error.response?.data) + + return + } + + // eslint-disable-next-line consistent-return + return Promise.reject(error) + }) + .finally(() => setSubmitting(false)) + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [router, flow, values, setSubmitting] + ) + + return ( + + + {/* @ts-ignore */} + {children} + + + ) +} diff --git a/packages/identity-integration/src/flows-page-router/logout.flow.tsx b/packages/identity-integration/src/flows-page-router/logout.flow.tsx new file mode 100644 index 00000000..dd5a14fe --- /dev/null +++ b/packages/identity-integration/src/flows-page-router/logout.flow.tsx @@ -0,0 +1,58 @@ +import type { LogoutFlow as KratosLogoutFlow } from '@ory/kratos-client' +import type { AxiosError } from 'axios' +import type { PropsWithChildren } from 'react' +import type { FC } from 'react' + +import { useRouter } from 'next/router.js' +import { useState } from 'react' +import { useEffect } from 'react' +import React from 'react' + +import { useKratosClient } from '../providers/index.js' + +interface LogoutFlowProps { + returnToUrl?: string +} + +export const LogoutFlow: FC> = ({ children, returnToUrl }) => { + const [logoutToken, setLogoutToken] = useState('') + const router = useRouter() + const { kratosClient } = useKratosClient() + + const { return_to: returnTo } = router.query + + useEffect(() => { + if (!router.isReady) return + + kratosClient + .createBrowserLogoutFlow( + { returnTo: returnTo?.toString() ?? returnToUrl }, + { withCredentials: true } + ) + .then(({ data }) => { + setLogoutToken(data.logout_token) + }) + .catch((error: AxiosError) => { + // eslint-disable-next-line default-case + switch (error.response?.status) { + case 401: + return router.push('/auth/login') + } + + return Promise.reject(error) + }) + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [router]) + + useEffect(() => { + if (logoutToken) { + kratosClient + .updateLogoutFlow({ token: logoutToken }, { withCredentials: true }) + .then(() => router.reload()) + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [logoutToken, router]) + + // eslint-disable-next-line react/jsx-no-useless-fragment + return <>{children} +} diff --git a/packages/identity-integration/src/flows-page-router/recovery.flow.tsx b/packages/identity-integration/src/flows-page-router/recovery.flow.tsx new file mode 100644 index 00000000..3a39eb50 --- /dev/null +++ b/packages/identity-integration/src/flows-page-router/recovery.flow.tsx @@ -0,0 +1,129 @@ +import type { UpdateRecoveryFlowBody } from '@ory/kratos-client' +import type { RecoveryFlow as KratosRecoveryFlow } from '@ory/kratos-client' +import type { AxiosError } from 'axios' +import type { PropsWithChildren } from 'react' +import type { FC } from 'react' + +import { useRouter } from 'next/router.js' +import { useState } from 'react' +import { useEffect } from 'react' +import { useMemo } from 'react' +import { useCallback } from 'react' +import React from 'react' + +import { FlowProvider } from '../providers/index.js' +import { ValuesProvider } from '../providers/index.js' +import { ValuesStore } from '../providers/index.js' +import { SubmitProvider } from '../providers/index.js' +import { useKratosClient } from '../providers/index.js' +import { handleFlowError } from './handle-errors.util.js' + +export interface RecoveryFlowProps { + onError?: (error: { id: string }) => void + returnToUrl?: string +} + +export const RecoveryFlow: FC> = ({ + children, + onError, + returnToUrl, +}) => { + const [flow, setFlow] = useState() + const [submitting, setSubmitting] = useState(false) + const [loading, setLoading] = useState(true) + const values = useMemo(() => new ValuesStore(), []) + const router = useRouter() + const { kratosClient, returnToSettingsUrl } = useKratosClient() + + const { return_to: returnTo, flow: flowId, refresh, aal } = router.query + + useEffect(() => { + if (!router.isReady || flow) return + + if (flowId) { + kratosClient + .getRecoveryFlow({ id: String(flowId) }, { withCredentials: true }) + .then(({ data }) => { + setFlow(data) + }) + .catch(handleFlowError(router, 'recovery', setFlow, returnToSettingsUrl, onError)) + .finally(() => setLoading(false)) + + return + } + + kratosClient + .createBrowserRecoveryFlow( + { returnTo: returnTo?.toString() ?? returnToUrl }, + { + withCredentials: true, + } + ) + .then(({ data }) => { + setFlow(data) + }) + .catch(handleFlowError(router, 'recovery', setFlow, returnToSettingsUrl, onError)) + .catch((error: AxiosError) => { + if (error.response?.status === 400) { + setFlow(error.response?.data) + + return + } + + // eslint-disable-next-line consistent-return + return Promise.reject(error) + }) + .finally(() => setLoading(false)) + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [flowId, router, router.isReady, aal, refresh, returnTo, flow, onError]) + + useEffect(() => { + if (flow) { + values.setFromFlow(flow) + } + }, [values, flow]) + + const onSubmit = useCallback( + (override?: Partial) => { + setSubmitting(true) + + const body = { + ...(values.getValues() as UpdateRecoveryFlowBody), + ...(override || {}), + } + + kratosClient + .updateRecoveryFlow( + // @ts-ignore + { flow: String(flow?.id), updateRecoveryFlowBody: body }, + { withCredentials: true } + ) + .then(({ data }) => { + setFlow(data) + }) + .catch(handleFlowError(router, 'recovery', setFlow, returnToSettingsUrl)) + .catch((error: AxiosError) => { + if (error.response?.status === 400) { + setFlow(error.response?.data) + + return + } + + // eslint-disable-next-line consistent-return + return Promise.reject(error) + }) + .finally(() => setSubmitting(false)) + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [router, flow, values, setSubmitting] + ) + + return ( + + + {/* @ts-ignore Enum conflict with string */} + {children} + + + ) +} diff --git a/packages/identity-integration/src/flows-page-router/registration.flow.tsx b/packages/identity-integration/src/flows-page-router/registration.flow.tsx new file mode 100644 index 00000000..ae6db432 --- /dev/null +++ b/packages/identity-integration/src/flows-page-router/registration.flow.tsx @@ -0,0 +1,181 @@ +import type { Identity } from '@ory/kratos-client' +import type { UpdateRegistrationFlowBody } from '@ory/kratos-client' +import type { RegistrationFlow as KratosRegistrationFlow } from '@ory/kratos-client' +import type { ContinueWith as KratosContinueWith } from '@ory/kratos-client' +import type { UiNodeInputAttributes } from '@ory/kratos-client' +import type { AxiosError } from 'axios' +import type { PropsWithChildren } from 'react' +import type { FC } from 'react' + +import { useRouter } from 'next/router.js' +import { useState } from 'react' +import { useEffect } from 'react' +import { useMemo } from 'react' +import { useCallback } from 'react' +import React from 'react' + +import { FlowProvider } from '../providers/index.js' +import { ValuesProvider } from '../providers/index.js' +import { ValuesStore } from '../providers/index.js' +import { SubmitProvider } from '../providers/index.js' +import { useKratosClient } from '../providers/index.js' +import { handleFlowError } from './handle-errors.util.js' + +export interface RegistrationFlowProps { + onError?: (error: { id: string }) => void + returnToUrl?: string + shouldRedirect?: boolean + passEmail: boolean +} + +type ContinueWith = KratosContinueWith & { + flow?: { + id: string + url?: string + verifiable_address?: string + } +} + +export const RegistrationFlow: FC> = ({ + children, + onError, + returnToUrl, + shouldRedirect = true, + passEmail = false, +}) => { + const [flow, setFlow] = useState() + const [identity, setIdentity] = useState() + const [isValid, setIsValid] = useState(false) + const [submitting, setSubmitting] = useState(false) + const [loading, setLoading] = useState(true) + const values = useMemo(() => new ValuesStore(), []) + const router = useRouter() + const { kratosClient, returnToSettingsUrl } = useKratosClient() + + const { return_to: returnTo, flow: flowId, refresh, aal } = router.query + + useEffect(() => { + if (!router.isReady || flow) return + + if (flowId) { + kratosClient + .getRegistrationFlow({ id: String(flowId) }, { withCredentials: true }) + .then(({ data }) => { + setFlow(data) + }) + .catch(handleFlowError(router, 'registration', setFlow, returnToSettingsUrl, onError)) + .finally(() => setLoading(false)) + + return + } + + kratosClient + .createBrowserRegistrationFlow( + { returnTo: shouldRedirect ? (returnTo?.toString() ?? returnToUrl) : undefined }, + { + withCredentials: true, + } + ) + .then(({ data }) => { + setFlow(data) + }) + .catch(handleFlowError(router, 'registration', setFlow, returnToSettingsUrl, onError)) + .finally(() => setLoading(false)) + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [flowId, router, router.isReady, aal, refresh, returnTo, flow, onError]) + + useEffect(() => { + if (flow) { + values.setFromFlow(flow) + } + }, [values, flow]) + + const onSubmit = useCallback( + (override?: Partial) => { + setSubmitting(true) + + const [submitNode] = [ + flow?.ui.nodes.filter( + ({ attributes, group }) => + group === 'password' && (attributes as UiNodeInputAttributes).type === 'submit' + ), + flow?.ui.nodes.filter( + ({ attributes }) => (attributes as UiNodeInputAttributes).type === 'submit' + ), + ].flat() + + const body = { + ...(values.getValues() as UpdateRegistrationFlowBody), + ...(submitNode + ? { + [(submitNode.attributes as UiNodeInputAttributes).name]: ( + submitNode.attributes as UiNodeInputAttributes + ).value, + } + : {}), + ...(override || {}), + } + + kratosClient + .updateRegistrationFlow( + // @ts-ignore + { flow: String(flow?.id), updateRegistrationFlowBody: body }, + { withCredentials: true } + ) + .then(async ({ data }) => { + setIdentity(data.identity) + setIsValid(true) + + const continueWithAction: ContinueWith | undefined = data.continue_with?.find( + (action) => action.action === 'show_verification_ui' + ) + + if (flow?.return_to) { + window.location.href = flow?.return_to + } else if (shouldRedirect) { + if (returnToUrl) { + router.push(returnToUrl) + } + if (continueWithAction?.flow?.url) { + if (passEmail) { + const url = new URL(continueWithAction.flow.url) + const params = url.searchParams + const email = continueWithAction.flow.verifiable_address + if (email) params.set('email', email) + + const newUrlString = `${url.origin}${url.pathname}?${params.toString()}` + router.push(newUrlString) + } else { + router.push(continueWithAction.flow.url) + } + } else { + router.push('/') + } + } + }) + .catch(handleFlowError(router, 'registration', setFlow, returnToSettingsUrl)) + .catch((error: AxiosError) => { + if (error.response?.status === 400) { + setFlow(error.response?.data) + + return + } + + // eslint-disable-next-line consistent-return + return Promise.reject(error) + }) + .finally(() => setSubmitting(false)) + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [router, flow, values, setSubmitting] + ) + + return ( + + + {/* @ts-ignore */} + {children} + + + ) +} diff --git a/packages/identity-integration/src/flows-page-router/settings.flow.tsx b/packages/identity-integration/src/flows-page-router/settings.flow.tsx new file mode 100644 index 00000000..05c8ad0c --- /dev/null +++ b/packages/identity-integration/src/flows-page-router/settings.flow.tsx @@ -0,0 +1,139 @@ +import type { UpdateSettingsFlowBody } from '@ory/kratos-client' +import type { SettingsFlow as KratosSettingsFlow } from '@ory/kratos-client' +import type { AxiosError } from 'axios' +import type { PropsWithChildren } from 'react' +import type { FC } from 'react' + +import { useRouter } from 'next/router.js' +import { useState } from 'react' +import { useEffect } from 'react' +import { useMemo } from 'react' +import { useCallback } from 'react' +import React from 'react' + +import { FlowProvider } from '../providers/index.js' +import { ValuesProvider } from '../providers/index.js' +import { ValuesStore } from '../providers/index.js' +import { SubmitProvider } from '../providers/index.js' +import { useKratosClient } from '../providers/index.js' +import { handleFlowError } from './handle-errors.util.js' + +export interface SettingsFlowProps { + onError?: (error: { id: string }) => void + returnToUrl?: string +} + +export const SettingsFlow: FC> = ({ + children, + onError, + returnToUrl, +}) => { + const [flow, setFlow] = useState() + const [submitting, setSubmitting] = useState(false) + const [loading, setLoading] = useState(true) + const values = useMemo(() => new ValuesStore(), []) + const router = useRouter() + const { kratosClient, returnToSettingsUrl } = useKratosClient() + + const { return_to: returnTo, flow: flowId, refresh, aal } = router.query + + useEffect(() => { + if (!router.isReady || flow) return + + if (flowId) { + kratosClient + .getSettingsFlow({ id: String(flowId) }, { withCredentials: true }) + .then(({ data }) => { + setFlow(data) + }) + .catch(handleFlowError(router, 'settings', setFlow, returnToSettingsUrl, onError)) + .finally(() => setLoading(false)) + + return + } + + kratosClient + .createBrowserSettingsFlow( + { returnTo: returnTo?.toString() ?? returnToUrl }, + { + withCredentials: true, + } + ) + .then(({ data }) => { + setFlow(data) + }) + .catch(handleFlowError(router, 'settings', setFlow, returnToSettingsUrl, onError)) + .catch((error: AxiosError) => { + // eslint-disable-next-line default-case + switch (error.response?.status) { + case 401: + if (error.response.data.return_to) { + window.location.href = error.response.data.return_to + } else { + return router.push('/auth/login') + } + } + + return Promise.reject(error) + }) + .finally(() => setLoading(false)) + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [flowId, router, router.isReady, aal, refresh, returnTo, flow, onError]) + + useEffect(() => { + if (flow) { + values.setFromFlow(flow) + } + }, [values, flow]) + + const onSubmit = useCallback( + (override?: Partial) => { + setSubmitting(true) + + const body = { + ...(values.getValues() as UpdateSettingsFlowBody), + ...(override || {}), + } + + kratosClient + .updateSettingsFlow( + // @ts-ignore + { flow: String(flow?.id), updateSettingsFlowBody: body }, + { withCredentials: true } + ) + .then(({ data }) => { + setFlow(data) + if (flow?.return_to) { + window.location.href = flow?.return_to + } else if (returnToUrl) { + router.push(returnToUrl) + } else { + router.reload() + } + }) + .catch(handleFlowError(router, 'settings', setFlow, returnToSettingsUrl)) + .catch((error: AxiosError) => { + if (error.response?.status === 400) { + setFlow(error.response?.data) + + return + } + + // eslint-disable-next-line consistent-return + return Promise.reject(error) + }) + .finally(() => setSubmitting(false)) + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [router, flow, values, setSubmitting] + ) + + return ( + + + {/* @ts-ignore */} + {children} + + + ) +} diff --git a/packages/identity-integration/src/flows-page-router/verification.flow.tsx b/packages/identity-integration/src/flows-page-router/verification.flow.tsx new file mode 100644 index 00000000..068fbd62 --- /dev/null +++ b/packages/identity-integration/src/flows-page-router/verification.flow.tsx @@ -0,0 +1,135 @@ +/* eslint-disable default-case */ + +import type { UpdateVerificationFlowBody } from '@ory/kratos-client' +import type { VerificationFlow as KratosVerificationFlow } from '@ory/kratos-client' +import type { AxiosError } from 'axios' +import type { PropsWithChildren } from 'react' +import type { FC } from 'react' + +import { useRouter } from 'next/router.js' +import { useState } from 'react' +import { useEffect } from 'react' +import { useMemo } from 'react' +import { useCallback } from 'react' +import React from 'react' + +import { FlowProvider } from '../providers/index.js' +import { ValuesProvider } from '../providers/index.js' +import { ValuesStore } from '../providers/index.js' +import { SubmitProvider } from '../providers/index.js' +import { useKratosClient } from '../providers/index.js' + +export interface VerificationFlowProps { + onError?: (error: { id: string }) => void + returnToUrl?: string +} + +export const VerificationFlow: FC> = ({ + children, + onError, + returnToUrl, +}) => { + const [flow, setFlow] = useState() + const [submitting, setSubmitting] = useState(false) + const [loading, setLoading] = useState(true) + const values = useMemo(() => new ValuesStore(), []) + const router = useRouter() + const { kratosClient } = useKratosClient() + + const { return_to: returnTo, flow: flowId, refresh, aal } = router.query + + useEffect(() => { + if (!router.isReady || flow) return + + if (flowId) { + kratosClient + .getVerificationFlow({ id: String(flowId) }, { withCredentials: true }) + .then(({ data }) => { + setFlow(data) + }) + .catch((error: AxiosError) => { + switch (error.response?.status) { + case 410: + case 403: + return router.push('/auth/verification') + } + + throw error + }) + .finally(() => setLoading(false)) + + return + } + + kratosClient + .createBrowserVerificationFlow( + { returnTo: returnTo?.toString() ?? returnToUrl }, + { + withCredentials: true, + } + ) + .then(({ data }) => { + setFlow(data) + }) + .catch((error: AxiosError) => { + switch (error.response?.status) { + case 400: + return router.push('/') + } + + throw error + }) + .finally(() => setLoading(false)) + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [flowId, router, router.isReady, aal, refresh, returnTo, flow, onError]) + + useEffect(() => { + if (flow) { + values.setFromFlow(flow) + } + }, [values, flow]) + + const onSubmit = useCallback( + (override?: Partial) => { + setSubmitting(true) + + const body = { + ...(values.getValues() as UpdateVerificationFlowBody), + ...(override || {}), + } + + kratosClient + .updateVerificationFlow( + // @ts-ignore + { flow: String(flow?.id), updateVerificationFlowBody: body }, + { + withCredentials: true, + } + ) + .then(({ data }) => { + setFlow(data) + }) + .catch((error: AxiosError) => { + switch (error.response?.status) { + case 400: + setFlow(error.response?.data) + return + } + + throw error + }) + .finally(() => setSubmitting(false)) + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [flow, values, setSubmitting] + ) + + return ( + + + {/* @ts-ignore Enum conflict with string */} + {children} + + + ) +} diff --git a/packages/identity-integration/src/index.ts b/packages/identity-integration/src/index.ts index d33f98ed..14a57feb 100644 --- a/packages/identity-integration/src/index.ts +++ b/packages/identity-integration/src/index.ts @@ -1,7 +1,6 @@ export { Session } from '@ory/kratos-client' export { Configuration } from '@ory/kratos-client' export * from './providers/index.js' -export * from './flows/index.js' export * from './ui/index.js' export * from './messages/index.js' export * from './sdk/index.js' diff --git a/packages/identity-integration/src/page-router.ts b/packages/identity-integration/src/page-router.ts new file mode 100644 index 00000000..66191f3a --- /dev/null +++ b/packages/identity-integration/src/page-router.ts @@ -0,0 +1 @@ +export * from './flows-page-router/index.js' diff --git a/packages/identity-integration/src/providers/error.context.ts b/packages/identity-integration/src/providers/error.context.ts index 70bf26e9..069cf39a 100644 --- a/packages/identity-integration/src/providers/error.context.ts +++ b/packages/identity-integration/src/providers/error.context.ts @@ -1,5 +1,6 @@ -import type { FlowError } from '@ory/kratos-client' -import { createContext } from 'react' +import type { FlowError } from '@ory/kratos-client' + +import { createContext } from 'react' export interface ContextError { error?: FlowError diff --git a/yarn.lock b/yarn.lock index c1630014..36f5f5b3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -188,7 +188,7 @@ __metadata: "@types/react": "npm:18.2.40" "@types/react-dom": "npm:18.2.10" "@types/tldjs": "npm:2.3.4" - axios: "npm:1.5.1" + axios: "npm:1.7.7" next: "npm:14.2.9" react: "npm:18.3.1" react-dom: "npm:18.3.1" @@ -2639,18 +2639,7 @@ __metadata: languageName: node linkType: hard -"axios@npm:1.5.1": - version: 1.5.1 - resolution: "axios@npm:1.5.1" - dependencies: - follow-redirects: "npm:^1.15.0" - form-data: "npm:^4.0.0" - proxy-from-env: "npm:^1.1.0" - checksum: 10/67633db5867c789a6edb6e5229884501bef89584a6718220c243fd5a64de4ea7dcdfdf4f8368a672d582db78aaa9f8d7b619d39403b669f451e1242bbd4c7ee2 - languageName: node - linkType: hard - -"axios@npm:^1.6.1": +"axios@npm:1.7.7, axios@npm:^1.6.1": version: 1.7.7 resolution: "axios@npm:1.7.7" dependencies: @@ -4154,7 +4143,7 @@ __metadata: languageName: node linkType: hard -"follow-redirects@npm:^1.15.0, follow-redirects@npm:^1.15.6": +"follow-redirects@npm:^1.15.6": version: 1.15.9 resolution: "follow-redirects@npm:1.15.9" peerDependenciesMeta: