@baseplate-dev/plugin-auth 4.0.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +621 -0
- package/dist/auth0/core/schema/plugin-definition.js +1 -1
- package/dist/auth0/core/schema/plugin-definition.js.map +1 -1
- package/dist/auth0/generators/fastify/auth0-module/templates/module/schema/user-session.queries.ts +1 -1
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js +1 -1
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js.map +1 -1
- package/dist/local-auth/constants/model-names.d.ts +4 -0
- package/dist/local-auth/constants/model-names.d.ts.map +1 -1
- package/dist/local-auth/constants/model-names.js +4 -0
- package/dist/local-auth/constants/model-names.js.map +1 -1
- package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.d.ts +49 -0
- package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.js +17 -6
- package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.js.map +1 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/index.d.ts +209 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/index.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.d.ts +5 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.js +5 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.js.map +1 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.d.ts +47 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.js +48 -2
- package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.js.map +1 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts +18 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.js +12 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.js.map +1 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.d.ts +253 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.js +102 -4
- package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.js.map +1 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts +15 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.js +15 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.js.map +1 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.ts +18 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.d.ts +2 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.js +24 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.js.map +1 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.ts +35 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.d.ts +2 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.js +38 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.js.map +1 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.ts +54 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/auth-verification.service.d.ts +40 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/auth-verification.service.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/auth-verification.service.js +106 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/auth-verification.service.js.map +1 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/auth-verification.service.ts +146 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.d.ts +24 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.js +88 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.js.map +1 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.ts +141 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.d.ts +35 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.js +157 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.js.map +1 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.ts +233 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.js +48 -14
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.js.map +1 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.ts +79 -15
- package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.d.ts +43 -0
- package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.js +48 -0
- package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.js.map +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/index.d.ts +96 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/index.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/index.js +11 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/index.js.map +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.d.ts +14 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.js +26 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.js.map +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.d.ts +41 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.js +59 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.js.map +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.d.ts +60 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.js +42 -0
- package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.js.map +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/index.d.ts +2 -0
- package/dist/local-auth/core/generators/auth-email-templates/index.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/index.js +2 -0
- package/dist/local-auth/core/generators/auth-email-templates/index.js.map +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.d.ts +3 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.js +14 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.js.map +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.tsx +55 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.d.ts +3 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.js +12 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.js.map +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.tsx +44 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.d.ts +3 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.js +14 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.js.map +1 -0
- package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.tsx +55 -0
- package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts +1 -0
- package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-module/auth-module.generator.js +1 -1
- package/dist/local-auth/core/generators/auth-module/auth-module.generator.js.map +1 -1
- package/dist/local-auth/core/generators/auth-module/generated/index.d.ts +2 -0
- package/dist/local-auth/core/generators/auth-module/generated/index.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-module/generated/template-renderers.d.ts +1 -0
- package/dist/local-auth/core/generators/auth-module/generated/template-renderers.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts +1 -0
- package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js +1 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js.map +1 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.ts +1 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.js +2 -2
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.js.map +1 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.ts +2 -2
- package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.js +1 -0
- package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.js.map +1 -1
- package/dist/local-auth/core/generators/auth-routes/generated/index.d.ts +722 -4
- package/dist/local-auth/core/generators/auth-routes/generated/index.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-routes/generated/index.js +2 -0
- package/dist/local-auth/core/generators/auth-routes/generated/index.js.map +1 -1
- package/dist/local-auth/core/generators/auth-routes/generated/template-paths.d.ts +4 -0
- package/dist/local-auth/core/generators/auth-routes/generated/template-paths.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-routes/generated/template-paths.js +4 -0
- package/dist/local-auth/core/generators/auth-routes/generated/template-paths.js.map +1 -1
- package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts +4 -1
- package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.js +14 -0
- package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.js.map +1 -1
- package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.d.ts +21 -0
- package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.js +30 -0
- package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.js.map +1 -0
- package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts +1216 -34
- package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.js +70 -2
- package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.js.map +1 -1
- package/dist/local-auth/core/generators/auth-routes/index.d.ts +2 -0
- package/dist/local-auth/core/generators/auth-routes/index.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-routes/index.js +1 -0
- package/dist/local-auth/core/generators/auth-routes/index.js.map +1 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.d.ts +10 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.js +11 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.js.map +1 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.ts +12 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.d.ts +2 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.js +60 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.js.map +1 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.tsx +127 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts +1 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.js +6 -11
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.js.map +1 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.tsx +20 -19
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts +1 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.js +2 -2
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.js.map +1 -1
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.tsx +2 -3
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.d.ts +7 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.js +131 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.js.map +1 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.tsx +240 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.d.ts +7 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.js +106 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.js.map +1 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.tsx +206 -0
- package/dist/local-auth/core/generators/index.d.ts +1 -0
- package/dist/local-auth/core/generators/index.d.ts.map +1 -1
- package/dist/local-auth/core/generators/index.js +1 -0
- package/dist/local-auth/core/generators/index.js.map +1 -1
- package/dist/local-auth/core/generators/seed-initial-user/generated/index.d.ts +12 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/index.d.ts.map +1 -1
- package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.d.ts +6 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.d.ts.map +1 -1
- package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.d.ts +6 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.d.ts.map +1 -1
- package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.d.ts +6 -0
- package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.d.ts.map +1 -1
- package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.js +1 -1
- package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.js.map +1 -1
- package/dist/local-auth/core/node.d.ts.map +1 -1
- package/dist/local-auth/core/node.js +11 -1
- package/dist/local-auth/core/node.js.map +1 -1
- package/dist/local-auth/core/schema/models.d.ts.map +1 -1
- package/dist/local-auth/core/schema/models.js +60 -0
- package/dist/local-auth/core/schema/models.js.map +1 -1
- package/dist/placeholder-auth/core/schema/plugin-definition.js +1 -1
- package/dist/placeholder-auth/core/schema/plugin-definition.js.map +1 -1
- package/dist/web/assets/{__federation_expose_auth0CoreCommon-DLSGXjCI.js → __federation_expose_auth0CoreCommon-DKJVe6Rd.js} +3 -3
- package/dist/web/assets/{__federation_expose_auth0CoreCommon-DLSGXjCI.js.map → __federation_expose_auth0CoreCommon-DKJVe6Rd.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_auth0CoreWeb-C7FfhlmF.js → __federation_expose_auth0CoreWeb-CfhSWZsK.js} +5 -5
- package/dist/web/assets/{__federation_expose_auth0CoreWeb-C7FfhlmF.js.map → __federation_expose_auth0CoreWeb-CfhSWZsK.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_authCoreCommon-BF58isGa.js → __federation_expose_authCoreCommon-D3-Gk9mI.js} +3 -3
- package/dist/web/assets/{__federation_expose_authCoreCommon-BF58isGa.js.map → __federation_expose_authCoreCommon-D3-Gk9mI.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_authCoreWeb-DMq9M88g.js → __federation_expose_authCoreWeb-DZoAij9e.js} +6 -6
- package/dist/web/assets/{__federation_expose_authCoreWeb-DMq9M88g.js.map → __federation_expose_authCoreWeb-DZoAij9e.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_local-authAdminCommon-sQw4q5YX.js → __federation_expose_local-authAdminCommon-BRHnF0Hn.js} +2 -2
- package/dist/web/assets/{__federation_expose_local-authAdminCommon-sQw4q5YX.js.map → __federation_expose_local-authAdminCommon-BRHnF0Hn.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_local-authAdminWeb-9FbO89NR.js → __federation_expose_local-authAdminWeb-dYAIxuqC.js} +3 -3
- package/dist/web/assets/{__federation_expose_local-authAdminWeb-9FbO89NR.js.map → __federation_expose_local-authAdminWeb-dYAIxuqC.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_local-authCoreCommon-CpUK09_4.js → __federation_expose_local-authCoreCommon-CIwvOx0d.js} +4 -4
- package/dist/web/assets/{__federation_expose_local-authCoreCommon-CpUK09_4.js.map → __federation_expose_local-authCoreCommon-CIwvOx0d.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_local-authCoreWeb-Czp0GaY1.js → __federation_expose_local-authCoreWeb-Bwooi2qZ.js} +66 -6
- package/dist/web/assets/__federation_expose_local-authCoreWeb-Bwooi2qZ.js.map +1 -0
- package/dist/web/assets/{__federation_expose_placeholder-authCoreCommon-CFDDdOMo.js → __federation_expose_placeholder-authCoreCommon-gFDSzGjB.js} +3 -3
- package/dist/web/assets/{__federation_expose_placeholder-authCoreCommon-CFDDdOMo.js.map → __federation_expose_placeholder-authCoreCommon-gFDSzGjB.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_placeholder-authCoreWeb-Bcn1_oDP.js → __federation_expose_placeholder-authCoreWeb-BZLwIkLk.js} +5 -5
- package/dist/web/assets/{__federation_expose_placeholder-authCoreWeb-Bcn1_oDP.js.map → __federation_expose_placeholder-authCoreWeb-BZLwIkLk.js.map} +1 -1
- package/dist/web/assets/{__federation_fn_import-DsXcpNlB.js → __federation_fn_import-pxYUpmb_.js} +2 -2
- package/dist/web/assets/{__federation_fn_import-DsXcpNlB.js.map → __federation_fn_import-pxYUpmb_.js.map} +1 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-zqe3PPcn.js → web-BXi2UCP-.js} +7 -7
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-BXi2UCP-.js.map +1 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/{project-builder-lib-CmgMfkI5.js → project-builder-lib-O0clDXMb.js} +7137 -136
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-O0clDXMb.js.map +1 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-BpuFQk6s.js +52536 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-BpuFQk6s.js.map +1 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/{utils-BO5VHrCf.js → utils-UiZ-8JBg.js} +5 -6
- package/dist/web/assets/__federation_shared_@baseplate-dev/utils-UiZ-8JBg.js.map +1 -0
- package/dist/web/assets/__federation_shared_@tanstack/{react-router-CNzDweD5.js → react-router-BPEAtEJI.js} +1069 -746
- package/dist/web/assets/__federation_shared_@tanstack/react-router-BPEAtEJI.js.map +1 -0
- package/dist/web/assets/{get-auth-plugin-definition-BV2O8wTa.js → get-auth-plugin-definition-DPsrvQbo.js} +2 -2
- package/dist/web/assets/{get-auth-plugin-definition-BV2O8wTa.js.map → get-auth-plugin-definition-DPsrvQbo.js.map} +1 -1
- package/dist/web/assets/{index-BL7fotl7.js → index-CSfs0UAV.js} +2 -2
- package/dist/web/assets/{index-BL7fotl7.js.map → index-CSfs0UAV.js.map} +1 -1
- package/dist/web/assets/{index.esm-B4RpOlq_.js → index.esm-BoRQu8mM.js} +2 -2
- package/dist/web/assets/{index.esm-B4RpOlq_.js.map → index.esm-BoRQu8mM.js.map} +1 -1
- package/dist/web/assets/{model-merger-BwRNqcBu.js → model-merger-CdjliK9v.js} +80 -23
- package/dist/web/assets/model-merger-CdjliK9v.js.map +1 -0
- package/dist/web/assets/{model-names-CEoSIalq.js → model-names-DrcaRxt1.js} +6 -2
- package/dist/web/assets/{model-names-CEoSIalq.js.map → model-names-DrcaRxt1.js.map} +1 -1
- package/dist/web/assets/{plugin-definition-CHD5r-h7.js → plugin-definition-BG6tu7Hh.js} +3 -3
- package/dist/web/assets/plugin-definition-BG6tu7Hh.js.map +1 -0
- package/dist/web/assets/{plugin-definition-DA9rJBcS.js → plugin-definition-BMYDEj3f.js} +3 -3
- package/dist/web/assets/plugin-definition-BMYDEj3f.js.map +1 -0
- package/dist/web/assets/{plugin-definition-B9d2CoQL.js → plugin-definition-DRhTuQas.js} +2 -2
- package/dist/web/assets/{plugin-definition-B9d2CoQL.js.map → plugin-definition-DRhTuQas.js.map} +1 -1
- package/dist/web/assets/{plugin-definition-BMTsmwyH.js → plugin-definition-j1nJ0FFI.js} +2 -2
- package/dist/web/assets/{plugin-definition-BMTsmwyH.js.map → plugin-definition-j1nJ0FFI.js.map} +1 -1
- package/dist/web/assets/{react-B9vhIZMy.js → react-CBhSWxr_.js} +2 -2
- package/dist/web/assets/{react-B9vhIZMy.js.map → react-CBhSWxr_.js.map} +1 -1
- package/dist/web/assets/remoteEntry.js +20 -20
- package/dist/web/assets/{style-DZ-aOCkd.css → style-DiK_rD1L.css} +1 -1
- package/dist/web/assets/{styles-CEm5K1iU.js → styles-BbHyE-2h.js} +3 -3
- package/dist/web/assets/{styles-CEm5K1iU.js.map → styles-BbHyE-2h.js.map} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +21 -19
- package/dist/web/assets/__federation_expose_local-authCoreWeb-Czp0GaY1.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-zqe3PPcn.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-CmgMfkI5.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-D1Dayhn9.js +0 -24082
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-D1Dayhn9.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/utils-BO5VHrCf.js.map +0 -1
- package/dist/web/assets/__federation_shared_@tanstack/react-router-CNzDweD5.js.map +0 -1
- package/dist/web/assets/model-merger-BwRNqcBu.js.map +0 -1
- package/dist/web/assets/plugin-definition-CHD5r-h7.js.map +0 -1
- package/dist/web/assets/plugin-definition-DA9rJBcS.js.map +0 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { createTsTemplateFile } from '@baseplate-dev/core-generators';
|
|
2
|
-
import { errorHandlerServiceImportsProvider, passwordHasherServiceImportsProvider, pothosImportsProvider, prismaGeneratedImportsProvider, prismaImportsProvider, requestServiceContextImportsProvider, userSessionServiceImportsProvider, userSessionTypesImportsProvider, } from '@baseplate-dev/fastify-generators';
|
|
2
|
+
import { configServiceImportsProvider, errorHandlerServiceImportsProvider, passwordHasherServiceImportsProvider, pothosImportsProvider, prismaGeneratedImportsProvider, prismaImportsProvider, requestServiceContextImportsProvider, userSessionServiceImportsProvider, userSessionTypesImportsProvider, } from '@baseplate-dev/fastify-generators';
|
|
3
|
+
import { emailModuleImportsProvider } from '@baseplate-dev/plugin-email';
|
|
4
|
+
import { rateLimitImportsProvider } from '@baseplate-dev/plugin-rate-limit';
|
|
3
5
|
import path from 'node:path';
|
|
4
6
|
import { authModuleImportsProvider } from '#src/local-auth/core/generators/auth-module/generated/ts-import-providers.js';
|
|
5
7
|
const constantsPassword = createTsTemplateFile({
|
|
@@ -7,12 +9,27 @@ const constantsPassword = createTsTemplateFile({
|
|
|
7
9
|
group: 'module',
|
|
8
10
|
importMapProviders: {},
|
|
9
11
|
name: 'constants-password',
|
|
10
|
-
projectExports: {
|
|
12
|
+
projectExports: {
|
|
13
|
+
PASSWORD_MAX_LENGTH: {},
|
|
14
|
+
PASSWORD_MIN_LENGTH: {},
|
|
15
|
+
PASSWORD_RESET_TOKEN_EXPIRY_SEC: {},
|
|
16
|
+
},
|
|
11
17
|
source: {
|
|
12
18
|
path: path.join(import.meta.dirname, '../templates/module/constants/password.constants.ts'),
|
|
13
19
|
},
|
|
14
20
|
variables: {},
|
|
15
21
|
});
|
|
22
|
+
const schemaPasswordResetMutations = createTsTemplateFile({
|
|
23
|
+
fileOptions: { kind: 'singleton' },
|
|
24
|
+
group: 'module',
|
|
25
|
+
importMapProviders: { pothosImports: pothosImportsProvider },
|
|
26
|
+
name: 'schema-password-reset-mutations',
|
|
27
|
+
referencedGeneratorTemplates: { servicesPasswordReset: {} },
|
|
28
|
+
source: {
|
|
29
|
+
path: path.join(import.meta.dirname, '../templates/module/schema/password-reset.mutations.ts'),
|
|
30
|
+
},
|
|
31
|
+
variables: {},
|
|
32
|
+
});
|
|
16
33
|
const schemaUserPasswordMutations = createTsTemplateFile({
|
|
17
34
|
fileOptions: { kind: 'singleton' },
|
|
18
35
|
group: 'module',
|
|
@@ -27,6 +44,34 @@ const schemaUserPasswordMutations = createTsTemplateFile({
|
|
|
27
44
|
},
|
|
28
45
|
variables: { TPL_ADMIN_ROLES: {}, TPL_USER_OBJECT_TYPE: {} },
|
|
29
46
|
});
|
|
47
|
+
const servicesPasswordReset = createTsTemplateFile({
|
|
48
|
+
fileOptions: { kind: 'singleton' },
|
|
49
|
+
group: 'module',
|
|
50
|
+
importMapProviders: {
|
|
51
|
+
configServiceImports: configServiceImportsProvider,
|
|
52
|
+
emailModuleImports: emailModuleImportsProvider,
|
|
53
|
+
errorHandlerServiceImports: errorHandlerServiceImportsProvider,
|
|
54
|
+
passwordHasherServiceImports: passwordHasherServiceImportsProvider,
|
|
55
|
+
prismaImports: prismaImportsProvider,
|
|
56
|
+
rateLimitImports: rateLimitImportsProvider,
|
|
57
|
+
requestServiceContextImports: requestServiceContextImportsProvider,
|
|
58
|
+
},
|
|
59
|
+
name: 'services-password-reset',
|
|
60
|
+
projectExports: {
|
|
61
|
+
cleanupExpiredPasswordResetTokens: { isTypeOnly: false },
|
|
62
|
+
completePasswordReset: { isTypeOnly: false },
|
|
63
|
+
requestPasswordReset: { isTypeOnly: false },
|
|
64
|
+
validatePasswordResetToken: { isTypeOnly: false },
|
|
65
|
+
},
|
|
66
|
+
referencedGeneratorTemplates: {
|
|
67
|
+
constantsPassword: {},
|
|
68
|
+
servicesAuthVerification: {},
|
|
69
|
+
},
|
|
70
|
+
source: {
|
|
71
|
+
path: path.join(import.meta.dirname, '../templates/module/services/password-reset.service.ts'),
|
|
72
|
+
},
|
|
73
|
+
variables: {},
|
|
74
|
+
});
|
|
30
75
|
const servicesUserPassword = createTsTemplateFile({
|
|
31
76
|
fileOptions: { kind: 'singleton' },
|
|
32
77
|
group: 'module',
|
|
@@ -35,6 +80,7 @@ const servicesUserPassword = createTsTemplateFile({
|
|
|
35
80
|
passwordHasherServiceImports: passwordHasherServiceImportsProvider,
|
|
36
81
|
prismaGeneratedImports: prismaGeneratedImportsProvider,
|
|
37
82
|
prismaImports: prismaImportsProvider,
|
|
83
|
+
rateLimitImports: rateLimitImportsProvider,
|
|
38
84
|
requestServiceContextImports: requestServiceContextImportsProvider,
|
|
39
85
|
userSessionServiceImports: userSessionServiceImportsProvider,
|
|
40
86
|
userSessionTypesImports: userSessionTypesImportsProvider,
|
|
@@ -45,7 +91,10 @@ const servicesUserPassword = createTsTemplateFile({
|
|
|
45
91
|
createUserWithEmailAndPassword: {},
|
|
46
92
|
registerUserWithEmailAndPassword: {},
|
|
47
93
|
},
|
|
48
|
-
referencedGeneratorTemplates: {
|
|
94
|
+
referencedGeneratorTemplates: {
|
|
95
|
+
constantsPassword: {},
|
|
96
|
+
servicesEmailVerification: {},
|
|
97
|
+
},
|
|
49
98
|
source: {
|
|
50
99
|
path: path.join(import.meta.dirname, '../templates/module/services/user-password.service.ts'),
|
|
51
100
|
},
|
|
@@ -53,8 +102,57 @@ const servicesUserPassword = createTsTemplateFile({
|
|
|
53
102
|
});
|
|
54
103
|
export const moduleGroup = {
|
|
55
104
|
constantsPassword,
|
|
105
|
+
schemaPasswordResetMutations,
|
|
56
106
|
schemaUserPasswordMutations,
|
|
107
|
+
servicesPasswordReset,
|
|
57
108
|
servicesUserPassword,
|
|
58
109
|
};
|
|
59
|
-
|
|
110
|
+
const schemaEmailVerificationMutations = createTsTemplateFile({
|
|
111
|
+
fileOptions: { kind: 'singleton' },
|
|
112
|
+
importMapProviders: { pothosImports: pothosImportsProvider },
|
|
113
|
+
name: 'schema-email-verification-mutations',
|
|
114
|
+
referencedGeneratorTemplates: { servicesEmailVerification: {} },
|
|
115
|
+
source: {
|
|
116
|
+
path: path.join(import.meta.dirname, '../templates/module/schema/email-verification.mutations.ts'),
|
|
117
|
+
},
|
|
118
|
+
variables: {},
|
|
119
|
+
});
|
|
120
|
+
const servicesAuthVerification = createTsTemplateFile({
|
|
121
|
+
fileOptions: { kind: 'singleton' },
|
|
122
|
+
importMapProviders: {
|
|
123
|
+
prismaGeneratedImports: prismaGeneratedImportsProvider,
|
|
124
|
+
prismaImports: prismaImportsProvider,
|
|
125
|
+
},
|
|
126
|
+
name: 'services-auth-verification',
|
|
127
|
+
source: {
|
|
128
|
+
path: path.join(import.meta.dirname, '../templates/module/services/auth-verification.service.ts'),
|
|
129
|
+
},
|
|
130
|
+
variables: {},
|
|
131
|
+
});
|
|
132
|
+
const servicesEmailVerification = createTsTemplateFile({
|
|
133
|
+
fileOptions: { kind: 'singleton' },
|
|
134
|
+
importMapProviders: {
|
|
135
|
+
configServiceImports: configServiceImportsProvider,
|
|
136
|
+
emailModuleImports: emailModuleImportsProvider,
|
|
137
|
+
errorHandlerServiceImports: errorHandlerServiceImportsProvider,
|
|
138
|
+
prismaImports: prismaImportsProvider,
|
|
139
|
+
rateLimitImports: rateLimitImportsProvider,
|
|
140
|
+
requestServiceContextImports: requestServiceContextImportsProvider,
|
|
141
|
+
},
|
|
142
|
+
name: 'services-email-verification',
|
|
143
|
+
referencedGeneratorTemplates: {
|
|
144
|
+
constantsPassword: {},
|
|
145
|
+
servicesAuthVerification: {},
|
|
146
|
+
},
|
|
147
|
+
source: {
|
|
148
|
+
path: path.join(import.meta.dirname, '../templates/module/services/email-verification.service.ts'),
|
|
149
|
+
},
|
|
150
|
+
variables: {},
|
|
151
|
+
});
|
|
152
|
+
export const LOCAL_AUTH_CORE_AUTH_EMAIL_PASSWORD_TEMPLATES = {
|
|
153
|
+
moduleGroup,
|
|
154
|
+
schemaEmailVerificationMutations,
|
|
155
|
+
servicesAuthVerification,
|
|
156
|
+
servicesEmailVerification,
|
|
157
|
+
};
|
|
60
158
|
//# sourceMappingURL=typed-templates.js.map
|
package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typed-templates.js","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-email-password/generated/typed-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EACL,kCAAkC,EAClC,oCAAoC,EACpC,qBAAqB,EACrB,8BAA8B,EAC9B,qBAAqB,EACrB,oCAAoC,EACpC,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,8EAA8E,CAAC;AAEzH,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;IAC7C,WAAW,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;IAClC,KAAK,EAAE,QAAQ;IACf,kBAAkB,EAAE,EAAE;IACtB,IAAI,EAAE,oBAAoB;IAC1B,cAAc,EAAE,EAAE,mBAAmB,EAAE,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"typed-templates.js","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-email-password/generated/typed-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EACL,4BAA4B,EAC5B,kCAAkC,EAClC,oCAAoC,EACpC,qBAAqB,EACrB,8BAA8B,EAC9B,qBAAqB,EACrB,oCAAoC,EACpC,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,E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;IAClC,MAAM,EAAE;QACN,IAAI,EAAE,IAAI,CAAC,IAAI,CACb,MAAM,CAAC,IAAI,CAAC,OAAO,EACnB,2DAA2D,CAC5D;KACF;IACD,SAAS,EAAE,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,yBAAyB,GAAG,oBAAoB,CAAC;IACrD,WAAW,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;IAClC,kBAAkB,EAAE;QAClB,oBAAoB,EAAE,4BAA4B;QAClD,kBAAkB,EAAE,0BAA0B;QAC9C,0BAA0B,EAAE,kCAAkC;QAC9D,aAAa,EAAE,qBAAqB;QACpC,gBAAgB,EAAE,wBAAwB;QAC1C,4BAA4B,EAAE,oCAAoC;KACnE;IACD,IAAI,EAAE,6BAA6B;IACnC,4BAA4B,EAAE;QAC5B,iBAAiB,EAAE,EAAE;QACrB,wBAAwB,EAAE,EAAE;KAC7B;IACD,MAAM,EAAE;QACN,IAAI,EAAE,IAAI,CAAC,IAAI,CACb,MAAM,CAAC,IAAI,CAAC,OAAO,EACnB,4DAA4D,CAC7D;KACF;IACD,SAAS,EAAE,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,6CAA6C,GAAG;IAC3D,WAAW;IACX,gCAAgC;IAChC,wBAAwB;IACxB,yBAAyB;CAC1B,CAAC"}
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimum password length
|
|
3
|
+
*/
|
|
1
4
|
export declare const PASSWORD_MIN_LENGTH = 8;
|
|
5
|
+
/**
|
|
6
|
+
* Maximum password length (prevents DoS attacks via excessive bcrypt/argon2 computation)
|
|
7
|
+
*/
|
|
8
|
+
export declare const PASSWORD_MAX_LENGTH = 255;
|
|
9
|
+
/**
|
|
10
|
+
* Password reset token expiration time in seconds (1 hour per OWASP recommendations)
|
|
11
|
+
*/
|
|
12
|
+
export declare const PASSWORD_RESET_TOKEN_EXPIRY_SEC: number;
|
|
13
|
+
/**
|
|
14
|
+
* Email verification token expiration time in seconds (24 hours)
|
|
15
|
+
*/
|
|
16
|
+
export declare const EMAIL_VERIFICATION_TOKEN_EXPIRY_SEC: number;
|
|
2
17
|
//# sourceMappingURL=password.constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password.constants.d.ts","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"password.constants.d.ts","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC;;GAEG;AACH,eAAO,MAAM,+BAA+B,QAAU,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,mCAAmC,QAAe,CAAC"}
|
|
@@ -1,3 +1,18 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* Minimum password length
|
|
4
|
+
*/
|
|
2
5
|
export const PASSWORD_MIN_LENGTH = 8;
|
|
6
|
+
/**
|
|
7
|
+
* Maximum password length (prevents DoS attacks via excessive bcrypt/argon2 computation)
|
|
8
|
+
*/
|
|
9
|
+
export const PASSWORD_MAX_LENGTH = 255;
|
|
10
|
+
/**
|
|
11
|
+
* Password reset token expiration time in seconds (1 hour per OWASP recommendations)
|
|
12
|
+
*/
|
|
13
|
+
export const PASSWORD_RESET_TOKEN_EXPIRY_SEC = 60 * 60;
|
|
14
|
+
/**
|
|
15
|
+
* Email verification token expiration time in seconds (24 hours)
|
|
16
|
+
*/
|
|
17
|
+
export const EMAIL_VERIFICATION_TOKEN_EXPIRY_SEC = 60 * 60 * 24;
|
|
3
18
|
//# sourceMappingURL=password.constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password.constants.js","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"password.constants.js","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAErC;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,EAAE,GAAG,EAAE,CAAC;AAEvD;;GAEG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -1,3 +1,21 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Minimum password length
|
|
5
|
+
*/
|
|
3
6
|
export const PASSWORD_MIN_LENGTH = 8;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Maximum password length (prevents DoS attacks via excessive bcrypt/argon2 computation)
|
|
10
|
+
*/
|
|
11
|
+
export const PASSWORD_MAX_LENGTH = 255;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Password reset token expiration time in seconds (1 hour per OWASP recommendations)
|
|
15
|
+
*/
|
|
16
|
+
export const PASSWORD_RESET_TOKEN_EXPIRY_SEC = 60 * 60;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Email verification token expiration time in seconds (24 hours)
|
|
20
|
+
*/
|
|
21
|
+
export const EMAIL_VERIFICATION_TOKEN_EXPIRY_SEC = 60 * 60 * 24;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-verification.mutations.d.ts","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { requestEmailVerification, verifyEmail, } from '$servicesEmailVerification';
|
|
3
|
+
import { builder } from '%pothosImports';
|
|
4
|
+
builder.mutationField('requestEmailVerification', (t) => t.fieldWithInputPayload({
|
|
5
|
+
authorize: ['user'],
|
|
6
|
+
payload: {
|
|
7
|
+
success: t.payload.field({ type: 'Boolean' }),
|
|
8
|
+
},
|
|
9
|
+
resolve: async (_root, _args, context) => requestEmailVerification({
|
|
10
|
+
userId: context.auth.userIdOrThrow(),
|
|
11
|
+
context,
|
|
12
|
+
}),
|
|
13
|
+
}));
|
|
14
|
+
builder.mutationField('verifyEmail', (t) => t.fieldWithInputPayload({
|
|
15
|
+
authorize: ['public'],
|
|
16
|
+
payload: {
|
|
17
|
+
success: t.payload.field({ type: 'Boolean' }),
|
|
18
|
+
},
|
|
19
|
+
input: {
|
|
20
|
+
token: t.input.field({ required: true, type: 'String' }),
|
|
21
|
+
},
|
|
22
|
+
resolve: async (_root, { input }, context) => verifyEmail({ token: input.token, context }),
|
|
23
|
+
}));
|
|
24
|
+
//# sourceMappingURL=email-verification.mutations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-verification.mutations.js","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EACL,wBAAwB,EACxB,WAAW,GACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,CAAC,aAAa,CAAC,0BAA0B,EAAE,CAAC,CAAC,EAAE,EAAE,CACtD,CAAC,CAAC,qBAAqB,CAAC;IACtB,SAAS,EAAE,CAAC,MAAM,CAAC;IACnB,OAAO,EAAE;QACP,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC9C;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CACvC,wBAAwB,CAAC;QACvB,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE;QACpC,OAAO;KACR,CAAC;CACL,CAAC,CACH,CAAC;AAEF,OAAO,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,CACzC,CAAC,CAAC,qBAAqB,CAAC;IACtB,SAAS,EAAE,CAAC,QAAQ,CAAC;IACrB,OAAO,EAAE;QACP,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC9C;IACD,KAAK,EAAE;QACL,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;KACzD;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,CAC3C,WAAW,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC;CAC/C,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
requestEmailVerification,
|
|
5
|
+
verifyEmail,
|
|
6
|
+
} from '$servicesEmailVerification';
|
|
7
|
+
import { builder } from '%pothosImports';
|
|
8
|
+
|
|
9
|
+
builder.mutationField('requestEmailVerification', (t) =>
|
|
10
|
+
t.fieldWithInputPayload({
|
|
11
|
+
authorize: ['user'],
|
|
12
|
+
payload: {
|
|
13
|
+
success: t.payload.field({ type: 'Boolean' }),
|
|
14
|
+
},
|
|
15
|
+
resolve: async (_root, _args, context) =>
|
|
16
|
+
requestEmailVerification({
|
|
17
|
+
userId: context.auth.userIdOrThrow(),
|
|
18
|
+
context,
|
|
19
|
+
}),
|
|
20
|
+
}),
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
builder.mutationField('verifyEmail', (t) =>
|
|
24
|
+
t.fieldWithInputPayload({
|
|
25
|
+
authorize: ['public'],
|
|
26
|
+
payload: {
|
|
27
|
+
success: t.payload.field({ type: 'Boolean' }),
|
|
28
|
+
},
|
|
29
|
+
input: {
|
|
30
|
+
token: t.input.field({ required: true, type: 'String' }),
|
|
31
|
+
},
|
|
32
|
+
resolve: async (_root, { input }, context) =>
|
|
33
|
+
verifyEmail({ token: input.token, context }),
|
|
34
|
+
}),
|
|
35
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-reset.mutations.d.ts","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { completePasswordReset, requestPasswordReset, validatePasswordResetToken, } from '$servicesPasswordReset';
|
|
3
|
+
import { builder } from '%pothosImports';
|
|
4
|
+
builder.mutationField('requestPasswordReset', (t) => t.fieldWithInputPayload({
|
|
5
|
+
authorize: ['public'],
|
|
6
|
+
payload: {
|
|
7
|
+
success: t.payload.field({ type: 'Boolean' }),
|
|
8
|
+
},
|
|
9
|
+
input: {
|
|
10
|
+
email: t.input.field({ required: true, type: 'String' }),
|
|
11
|
+
},
|
|
12
|
+
resolve: async (_root, { input }, context) => requestPasswordReset({ email: input.email, context }),
|
|
13
|
+
}));
|
|
14
|
+
builder.mutationField('validatePasswordResetToken', (t) => t.fieldWithInputPayload({
|
|
15
|
+
authorize: ['public'],
|
|
16
|
+
payload: {
|
|
17
|
+
valid: t.payload.field({ type: 'Boolean' }),
|
|
18
|
+
},
|
|
19
|
+
input: {
|
|
20
|
+
token: t.input.field({ required: true, type: 'String' }),
|
|
21
|
+
},
|
|
22
|
+
resolve: async (_root, { input }) => validatePasswordResetToken({ token: input.token }),
|
|
23
|
+
}));
|
|
24
|
+
builder.mutationField('resetPasswordWithToken', (t) => t.fieldWithInputPayload({
|
|
25
|
+
authorize: ['public'],
|
|
26
|
+
payload: {
|
|
27
|
+
success: t.payload.field({ type: 'Boolean' }),
|
|
28
|
+
},
|
|
29
|
+
input: {
|
|
30
|
+
token: t.input.field({ required: true, type: 'String' }),
|
|
31
|
+
newPassword: t.input.field({ required: true, type: 'String' }),
|
|
32
|
+
},
|
|
33
|
+
resolve: async (_root, { input }) => completePasswordReset({
|
|
34
|
+
token: input.token,
|
|
35
|
+
newPassword: input.newPassword,
|
|
36
|
+
}),
|
|
37
|
+
}));
|
|
38
|
+
//# sourceMappingURL=password-reset.mutations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-reset.mutations.js","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,CAAC,aAAa,CAAC,sBAAsB,EAAE,CAAC,CAAC,EAAE,EAAE,CAClD,CAAC,CAAC,qBAAqB,CAAC;IACtB,SAAS,EAAE,CAAC,QAAQ,CAAC;IACrB,OAAO,EAAE;QACP,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC9C;IACD,KAAK,EAAE;QACL,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE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AAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;KAC/D;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAClC,qBAAqB,CAAC;QACpB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,WAAW,EAAE,KAAK,CAAC,WAAW;KAC/B,CAAC;CACL,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
completePasswordReset,
|
|
5
|
+
requestPasswordReset,
|
|
6
|
+
validatePasswordResetToken,
|
|
7
|
+
} from '$servicesPasswordReset';
|
|
8
|
+
import { builder } from '%pothosImports';
|
|
9
|
+
|
|
10
|
+
builder.mutationField('requestPasswordReset', (t) =>
|
|
11
|
+
t.fieldWithInputPayload({
|
|
12
|
+
authorize: ['public'],
|
|
13
|
+
payload: {
|
|
14
|
+
success: t.payload.field({ type: 'Boolean' }),
|
|
15
|
+
},
|
|
16
|
+
input: {
|
|
17
|
+
email: t.input.field({ required: true, type: 'String' }),
|
|
18
|
+
},
|
|
19
|
+
resolve: async (_root, { input }, context) =>
|
|
20
|
+
requestPasswordReset({ email: input.email, context }),
|
|
21
|
+
}),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
builder.mutationField('validatePasswordResetToken', (t) =>
|
|
25
|
+
t.fieldWithInputPayload({
|
|
26
|
+
authorize: ['public'],
|
|
27
|
+
payload: {
|
|
28
|
+
valid: t.payload.field({ type: 'Boolean' }),
|
|
29
|
+
},
|
|
30
|
+
input: {
|
|
31
|
+
token: t.input.field({ required: true, type: 'String' }),
|
|
32
|
+
},
|
|
33
|
+
resolve: async (_root, { input }) =>
|
|
34
|
+
validatePasswordResetToken({ token: input.token }),
|
|
35
|
+
}),
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
builder.mutationField('resetPasswordWithToken', (t) =>
|
|
39
|
+
t.fieldWithInputPayload({
|
|
40
|
+
authorize: ['public'],
|
|
41
|
+
payload: {
|
|
42
|
+
success: t.payload.field({ type: 'Boolean' }),
|
|
43
|
+
},
|
|
44
|
+
input: {
|
|
45
|
+
token: t.input.field({ required: true, type: 'String' }),
|
|
46
|
+
newPassword: t.input.field({ required: true, type: 'String' }),
|
|
47
|
+
},
|
|
48
|
+
resolve: async (_root, { input }) =>
|
|
49
|
+
completePasswordReset({
|
|
50
|
+
token: input.token,
|
|
51
|
+
newPassword: input.newPassword,
|
|
52
|
+
}),
|
|
53
|
+
}),
|
|
54
|
+
);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { AuthVerification, Prisma } from '%prismaGeneratedImports';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a new auth verification using the split-token pattern.
|
|
4
|
+
*
|
|
5
|
+
* @param type - Verification type (e.g., "password-reset", "email-verify")
|
|
6
|
+
* @param userId - Optional user ID to associate with the token
|
|
7
|
+
* @param expiresInSec - Token lifetime in seconds
|
|
8
|
+
* @param metadata - Optional JSON metadata to store with the token
|
|
9
|
+
* @returns The combined token (`{selector}.{verifier}`) to send to the user
|
|
10
|
+
*/
|
|
11
|
+
export declare function createAuthVerification({ type, userId, expiresInSec, metadata, }: {
|
|
12
|
+
type: string;
|
|
13
|
+
userId?: string;
|
|
14
|
+
expiresInSec: number;
|
|
15
|
+
metadata?: Prisma.JsonValue;
|
|
16
|
+
}): Promise<{
|
|
17
|
+
token: string;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* Validates an auth verification token without consuming it.
|
|
21
|
+
* Returns the full record if valid so the caller can delete it
|
|
22
|
+
* as part of their own transaction.
|
|
23
|
+
*
|
|
24
|
+
* Security: If the selector matches but the verifier is wrong or expired,
|
|
25
|
+
* the token is deleted to prevent brute-force attempts.
|
|
26
|
+
*
|
|
27
|
+
* @throws BadRequestError if token is invalid, expired, or malformed
|
|
28
|
+
*/
|
|
29
|
+
export declare function validateAuthVerification({ type, token, }: {
|
|
30
|
+
type: string;
|
|
31
|
+
token: string;
|
|
32
|
+
}): Promise<AuthVerification | null>;
|
|
33
|
+
/**
|
|
34
|
+
* Cleanup job to delete expired auth verification tokens.
|
|
35
|
+
* Should be called periodically (e.g., via cron job or queue).
|
|
36
|
+
*/
|
|
37
|
+
export declare function cleanupExpiredAuthVerifications(): Promise<{
|
|
38
|
+
deletedCount: number;
|
|
39
|
+
}>;
|
|
40
|
+
//# sourceMappingURL=auth-verification.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-verification.service.d.ts","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/services/auth-verification.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAiDxE;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAAC,EAC3C,IAAI,EACJ,MAAM,EACN,YAAY,EACZ,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC;CAC7B,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAiB7B;AAED;;;;;;;;;GASG;AACH,wBAAsB,wBAAwB,CAAC,EAC7C,IAAI,EACJ,KAAK,GACN,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAwBnC;AAED;;;GAGG;AACH,wBAAsB,+BAA+B,IAAI,OAAO,CAAC;IAC/D,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC,CAQD"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { prisma } from '%prismaImports';
|
|
3
|
+
import * as crypto from 'node:crypto';
|
|
4
|
+
/**
|
|
5
|
+
* Split-token pattern for secure verification flows.
|
|
6
|
+
*
|
|
7
|
+
* - selector: random identifier used for DB lookup (stored as `identifier`)
|
|
8
|
+
* - verifier: random secret, hashed before storage (stored as `value`)
|
|
9
|
+
* - token: `{selector}.{verifier}` — the value sent to the user
|
|
10
|
+
*/
|
|
11
|
+
function generateSplitToken() {
|
|
12
|
+
return {
|
|
13
|
+
selector: crypto.randomBytes(16).toString('base64url'),
|
|
14
|
+
verifier: crypto.randomBytes(16).toString('base64url'),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function hashVerifier(verifier) {
|
|
18
|
+
return crypto.createHash('sha256').update(verifier).digest('hex');
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Constant-time comparison of two hex strings to prevent timing attacks.
|
|
22
|
+
*/
|
|
23
|
+
function safeCompare(a, b) {
|
|
24
|
+
if (a.length !== b.length)
|
|
25
|
+
return false;
|
|
26
|
+
return crypto.timingSafeEqual(Buffer.from(a, 'hex'), Buffer.from(b, 'hex'));
|
|
27
|
+
}
|
|
28
|
+
function encodeToken(selector, verifier) {
|
|
29
|
+
return `${selector}.${verifier}`;
|
|
30
|
+
}
|
|
31
|
+
function decodeToken(token) {
|
|
32
|
+
const dotIndex = token.indexOf('.');
|
|
33
|
+
if (dotIndex === -1) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
selector: token.slice(0, dotIndex),
|
|
38
|
+
verifier: token.slice(dotIndex + 1),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Creates a new auth verification using the split-token pattern.
|
|
43
|
+
*
|
|
44
|
+
* @param type - Verification type (e.g., "password-reset", "email-verify")
|
|
45
|
+
* @param userId - Optional user ID to associate with the token
|
|
46
|
+
* @param expiresInSec - Token lifetime in seconds
|
|
47
|
+
* @param metadata - Optional JSON metadata to store with the token
|
|
48
|
+
* @returns The combined token (`{selector}.{verifier}`) to send to the user
|
|
49
|
+
*/
|
|
50
|
+
export async function createAuthVerification({ type, userId, expiresInSec, metadata, }) {
|
|
51
|
+
const { selector, verifier } = generateSplitToken();
|
|
52
|
+
const value = hashVerifier(verifier);
|
|
53
|
+
const expiresAt = new Date(Date.now() + expiresInSec * 1000);
|
|
54
|
+
await prisma.authVerification.create({
|
|
55
|
+
data: {
|
|
56
|
+
type,
|
|
57
|
+
identifier: selector,
|
|
58
|
+
value,
|
|
59
|
+
userId,
|
|
60
|
+
metadata: metadata ?? undefined,
|
|
61
|
+
expiresAt,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
return { token: encodeToken(selector, verifier) };
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Validates an auth verification token without consuming it.
|
|
68
|
+
* Returns the full record if valid so the caller can delete it
|
|
69
|
+
* as part of their own transaction.
|
|
70
|
+
*
|
|
71
|
+
* Security: If the selector matches but the verifier is wrong or expired,
|
|
72
|
+
* the token is deleted to prevent brute-force attempts.
|
|
73
|
+
*
|
|
74
|
+
* @throws BadRequestError if token is invalid, expired, or malformed
|
|
75
|
+
*/
|
|
76
|
+
export async function validateAuthVerification({ type, token, }) {
|
|
77
|
+
const decoded = decodeToken(token);
|
|
78
|
+
if (!decoded) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
const record = await prisma.authVerification.findUnique({
|
|
82
|
+
where: { type_identifier: { type, identifier: decoded.selector } },
|
|
83
|
+
});
|
|
84
|
+
if (!record) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
if (!safeCompare(record.value, hashVerifier(decoded.verifier)) ||
|
|
88
|
+
record.expiresAt < new Date()) {
|
|
89
|
+
await prisma.authVerification.delete({ where: { id: record.id } });
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
return record;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Cleanup job to delete expired auth verification tokens.
|
|
96
|
+
* Should be called periodically (e.g., via cron job or queue).
|
|
97
|
+
*/
|
|
98
|
+
export async function cleanupExpiredAuthVerifications() {
|
|
99
|
+
const result = await prisma.authVerification.deleteMany({
|
|
100
|
+
where: {
|
|
101
|
+
expiresAt: { lt: new Date() },
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
return { deletedCount: result.count };
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=auth-verification.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-verification.service.js","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-email-password/templates/module/services/auth-verification.service.ts"],"names":[],"mappings":"AAAA,cAAc;AAId,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC;;;;;;GAMG;AAEH,SAAS,kBAAkB;IACzB,OAAO;QACL,QAAQ,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC;QACtD,QAAQ,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC;KACvD,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,QAAgB;IACpC,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACpE,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAC,CAAS,EAAE,CAAS;IACvC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACxC,OAAO,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK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