@baseplate-dev/plugin-auth 2.0.0 → 2.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/dist/auth0/generators/react/auth0-pages/auth0-pages.generator.d.ts +88 -3
- package/dist/auth0/generators/react/auth0-pages/auth0-pages.generator.d.ts.map +1 -1
- package/dist/auth0/generators/react/auth0-pages/generated/index.d.ts +176 -6
- package/dist/auth0/generators/react/auth0-pages/generated/index.d.ts.map +1 -1
- package/dist/auth0/generators/react/auth0-pages/generated/template-renderers.d.ts +88 -3
- package/dist/auth0/generators/react/auth0-pages/generated/template-renderers.d.ts.map +1 -1
- package/dist/auth0/generators/react/auth0-pages/generated/typed-templates.d.ts +176 -6
- package/dist/auth0/generators/react/auth0-pages/generated/typed-templates.d.ts.map +1 -1
- package/dist/auth0/generators/react/react-auth0/generated/index.d.ts +176 -6
- package/dist/auth0/generators/react/react-auth0/generated/index.d.ts.map +1 -1
- package/dist/auth0/generators/react/react-auth0/generated/template-renderers.d.ts +88 -3
- package/dist/auth0/generators/react/react-auth0/generated/template-renderers.d.ts.map +1 -1
- package/dist/auth0/generators/react/react-auth0/generated/typed-templates.d.ts +88 -3
- package/dist/auth0/generators/react/react-auth0/generated/typed-templates.d.ts.map +1 -1
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.d.ts +88 -3
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.d.ts.map +1 -1
- package/dist/local-auth/admin/common.d.ts +4 -0
- package/dist/local-auth/admin/common.d.ts.map +1 -0
- package/dist/local-auth/admin/common.js +30 -0
- package/dist/local-auth/admin/common.js.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts +453 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.js +121 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.js.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts +457 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.js +9 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.js.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.d.ts +13 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.d.ts.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.js +25 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.js.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts +235 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.js +48 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.js.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts +224 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.js +29 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.js.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.d.ts +2 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.d.ts.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.js +2 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.js.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.d.ts +21 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.d.ts.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.gql +7 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.js +59 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.js.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.tsx +145 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts +452 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.js +107 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.js.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts +457 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.js +9 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.js.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.d.ts +13 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.d.ts.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.js +25 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.js.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts +235 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.js +48 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.js.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts +442 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.js +31 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.js.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.d.ts +2 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.d.ts.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.js +2 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.js.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.d.ts +21 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.d.ts.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.gql +7 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.js +73 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.js.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.tsx +155 -0
- package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.d.ts +221 -0
- package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.d.ts.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.js +58 -0
- package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.js.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-roles-column/index.d.ts +2 -0
- package/dist/local-auth/admin/generators/admin-crud-roles-column/index.d.ts.map +1 -0
- package/dist/local-auth/admin/generators/admin-crud-roles-column/index.js +2 -0
- package/dist/local-auth/admin/generators/admin-crud-roles-column/index.js.map +1 -0
- package/dist/local-auth/admin/node.d.ts +8 -0
- package/dist/local-auth/admin/node.d.ts.map +1 -0
- package/dist/local-auth/admin/node.js +60 -0
- package/dist/local-auth/admin/node.js.map +1 -0
- package/dist/local-auth/admin/schema/manage-role-action.d.ts +19 -0
- package/dist/local-auth/admin/schema/manage-role-action.d.ts.map +1 -0
- package/dist/local-auth/admin/schema/manage-role-action.js +6 -0
- package/dist/local-auth/admin/schema/manage-role-action.js.map +1 -0
- package/dist/local-auth/admin/schema/reset-password-action.d.ts +19 -0
- package/dist/local-auth/admin/schema/reset-password-action.d.ts.map +1 -0
- package/dist/local-auth/admin/schema/reset-password-action.js +6 -0
- package/dist/local-auth/admin/schema/reset-password-action.js.map +1 -0
- package/dist/local-auth/admin/schema/roles-column.d.ts +19 -0
- package/dist/local-auth/admin/schema/roles-column.d.ts.map +1 -0
- package/dist/local-auth/admin/schema/roles-column.js +6 -0
- package/dist/local-auth/admin/schema/roles-column.js.map +1 -0
- package/dist/local-auth/admin/web.d.ts +6 -0
- package/dist/local-auth/admin/web.d.ts.map +1 -0
- package/dist/local-auth/admin/web.js +43 -0
- package/dist/local-auth/admin/web.js.map +1 -0
- package/dist/local-auth/core/components/local-auth-definition-editor.d.ts.map +1 -1
- package/dist/local-auth/core/components/local-auth-definition-editor.js +5 -2
- package/dist/local-auth/core/components/local-auth-definition-editor.js.map +1 -1
- package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.d.ts +5 -1
- 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 +20 -5
- 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 +4 -1
- 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/typed-templates.d.ts +8 -2
- 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 +1 -1
- 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/schema/user-password.mutations.js +40 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js.map +1 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.ts +47 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts +31 -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 +97 -1
- 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 +133 -0
- package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts +2 -1
- 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 +9 -3
- 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 +26 -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-paths.d.ts +2 -0
- package/dist/local-auth/core/generators/auth-module/generated/template-paths.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-module/generated/template-paths.js +2 -0
- package/dist/local-auth/core/generators/auth-module/generated/template-paths.js.map +1 -1
- 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/template-renderers.js +1 -0
- package/dist/local-auth/core/generators/auth-module/generated/template-renderers.js.map +1 -1
- package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts +52 -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/generated/typed-templates.js +28 -0
- package/dist/local-auth/core/generators/auth-module/generated/typed-templates.js.map +1 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.d.ts +2 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.js +23 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.js.map +1 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.ts +26 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.d.ts +15 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.js +35 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.js.map +1 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.ts +47 -0
- package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.d.ts +88 -3
- package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-routes/generated/index.d.ts +264 -9
- package/dist/local-auth/core/generators/auth-routes/generated/index.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts +88 -3
- 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/typed-templates.d.ts +352 -12
- package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts.map +1 -1
- package/dist/local-auth/core/generators/react-session/generated/index.d.ts +176 -6
- package/dist/local-auth/core/generators/react-session/generated/index.d.ts.map +1 -1
- package/dist/local-auth/core/generators/react-session/generated/template-renderers.d.ts +88 -3
- package/dist/local-auth/core/generators/react-session/generated/template-renderers.d.ts.map +1 -1
- package/dist/local-auth/core/generators/react-session/generated/typed-templates.d.ts +176 -6
- package/dist/local-auth/core/generators/react-session/generated/typed-templates.d.ts.map +1 -1
- package/dist/local-auth/core/generators/react-session/react-session.generator.d.ts +88 -3
- package/dist/local-auth/core/generators/react-session/react-session.generator.d.ts.map +1 -1
- package/dist/local-auth/core/node.d.ts.map +1 -1
- package/dist/local-auth/core/node.js +5 -1
- package/dist/local-auth/core/node.js.map +1 -1
- package/dist/local-auth/core/schema/plugin-definition.d.ts +3 -0
- package/dist/local-auth/core/schema/plugin-definition.d.ts.map +1 -1
- package/dist/local-auth/core/schema/plugin-definition.js +4 -0
- package/dist/local-auth/core/schema/plugin-definition.js.map +1 -1
- package/dist/local-auth/plugin.json +1 -1
- package/dist/web/assets/{__federation_expose_auth0CoreCommon-lV5QSzvf.js → __federation_expose_auth0CoreCommon-Dd4OxG3J.js} +3 -3
- package/dist/web/assets/{__federation_expose_auth0CoreCommon-lV5QSzvf.js.map → __federation_expose_auth0CoreCommon-Dd4OxG3J.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_auth0CoreWeb-5F0rTNis.js → __federation_expose_auth0CoreWeb-C_de43BE.js} +5 -5
- package/dist/web/assets/{__federation_expose_auth0CoreWeb-5F0rTNis.js.map → __federation_expose_auth0CoreWeb-C_de43BE.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_authCoreCommon-C5cVmNCH.js → __federation_expose_authCoreCommon-BAF30G9e.js} +3 -3
- package/dist/web/assets/{__federation_expose_authCoreCommon-C5cVmNCH.js.map → __federation_expose_authCoreCommon-BAF30G9e.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_authCoreWeb-CJxY8hZC.js → __federation_expose_authCoreWeb-B26BFarY.js} +6 -6
- package/dist/web/assets/{__federation_expose_authCoreWeb-CJxY8hZC.js.map → __federation_expose_authCoreWeb-B26BFarY.js.map} +1 -1
- package/dist/web/assets/__federation_expose_local-authAdminCommon-DLbuTALX.js +64 -0
- package/dist/web/assets/__federation_expose_local-authAdminCommon-DLbuTALX.js.map +1 -0
- package/dist/web/assets/__federation_expose_local-authAdminWeb-bT8Js4V6.js +58 -0
- package/dist/web/assets/__federation_expose_local-authAdminWeb-bT8Js4V6.js.map +1 -0
- package/dist/web/assets/{__federation_expose_local-authCoreCommon-Dr_ngV2l.js → __federation_expose_local-authCoreCommon-D9tovFrj.js} +3 -3
- package/dist/web/assets/{__federation_expose_local-authCoreCommon-Dr_ngV2l.js.map → __federation_expose_local-authCoreCommon-D9tovFrj.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_local-authCoreWeb-B5iBudnh.js → __federation_expose_local-authCoreWeb-DKVkRzEo.js} +24 -7
- package/dist/web/assets/__federation_expose_local-authCoreWeb-DKVkRzEo.js.map +1 -0
- package/dist/web/assets/{__federation_expose_placeholder-authCoreCommon-l8knzO7I.js → __federation_expose_placeholder-authCoreCommon-D1fszuKq.js} +3 -3
- package/dist/web/assets/{__federation_expose_placeholder-authCoreCommon-l8knzO7I.js.map → __federation_expose_placeholder-authCoreCommon-D1fszuKq.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_placeholder-authCoreWeb-DbI_bZsk.js → __federation_expose_placeholder-authCoreWeb-tw3UiMLM.js} +5 -5
- package/dist/web/assets/{__federation_expose_placeholder-authCoreWeb-DbI_bZsk.js.map → __federation_expose_placeholder-authCoreWeb-tw3UiMLM.js.map} +1 -1
- package/dist/web/assets/{__federation_fn_import-DReOsou_.js → __federation_fn_import-B_QMlAIe.js} +2 -2
- package/dist/web/assets/{__federation_fn_import-DReOsou_.js.map → __federation_fn_import-B_QMlAIe.js.map} +1 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-BlPKO2K7.js → web-DdrB9jrq.js} +74 -6
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-DdrB9jrq.js.map +1 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/{project-builder-lib-CGEZr0YI.js → project-builder-lib-BvG5Zcxb.js} +567 -184
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-BvG5Zcxb.js.map +1 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/{ui-components-RO_rk4f0.js → ui-components-CjIA8Av2.js} +873 -624
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-CjIA8Av2.js.map +1 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/{utils-BbU_EX7_.js → utils-LpAGNm5N.js} +2 -2
- package/dist/web/assets/__federation_shared_@baseplate-dev/{utils-BbU_EX7_.js.map → utils-LpAGNm5N.js.map} +1 -1
- package/dist/web/assets/__federation_shared_@tanstack/{react-router-CNTPQj7N.js → react-router-CEcQRiV1.js} +2 -2
- package/dist/web/assets/__federation_shared_@tanstack/{react-router-CNTPQj7N.js.map → react-router-CEcQRiV1.js.map} +1 -1
- package/dist/web/assets/{get-auth-plugin-definition-CQ6mWMZk.js → get-auth-plugin-definition-BrApugiB.js} +2 -2
- package/dist/web/assets/{get-auth-plugin-definition-CQ6mWMZk.js.map → get-auth-plugin-definition-BrApugiB.js.map} +1 -1
- package/dist/web/assets/{index-BkOJzK_m.js → index-DAcyTb_o.js} +5 -3
- package/dist/web/assets/{index-BkOJzK_m.js.map → index-DAcyTb_o.js.map} +1 -1
- package/dist/web/assets/{index.esm-UnRzlLlr.js → index.esm-BFQQfZNu.js} +2 -2
- package/dist/web/assets/{index.esm-UnRzlLlr.js.map → index.esm-BFQQfZNu.js.map} +1 -1
- package/dist/web/assets/{model-merger-BLEOsCIp.js → model-merger-boZDknXa.js} +11 -4
- package/dist/web/assets/model-merger-boZDknXa.js.map +1 -0
- package/dist/web/assets/{plugin-definition-PCHsX2lR.js → plugin-definition-B7A-hS1o.js} +2 -2
- package/dist/web/assets/{plugin-definition-PCHsX2lR.js.map → plugin-definition-B7A-hS1o.js.map} +1 -1
- package/dist/web/assets/{plugin-definition-ChUKIqUg.js → plugin-definition-BeK0C-OP.js} +11 -2
- package/dist/web/assets/plugin-definition-BeK0C-OP.js.map +1 -0
- package/dist/web/assets/{plugin-definition-DH4QyCfv.js → plugin-definition-CyqVivit.js} +2 -2
- package/dist/web/assets/{plugin-definition-DH4QyCfv.js.map → plugin-definition-CyqVivit.js.map} +1 -1
- package/dist/web/assets/{plugin-definition-C935Xf1h.js → plugin-definition-DfsGhMRb.js} +2 -2
- package/dist/web/assets/{plugin-definition-C935Xf1h.js.map → plugin-definition-DfsGhMRb.js.map} +1 -1
- package/dist/web/assets/{react-ecPihYHK.js → react-CKjL52W8.js} +2 -2
- package/dist/web/assets/{react-ecPihYHK.js.map → react-CKjL52W8.js.map} +1 -1
- package/dist/web/assets/remoteEntry.js +14 -8
- package/dist/web/assets/remoteEntry.js.map +1 -1
- package/dist/web/assets/{styles-I6mpdfRm.js → styles-CyTaudys.js} +3 -3
- package/dist/web/assets/{styles-I6mpdfRm.js.map → styles-CyTaudys.js.map} +1 -1
- package/package.json +12 -12
- package/dist/web/assets/__federation_expose_local-authCoreWeb-B5iBudnh.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-BlPKO2K7.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-CGEZr0YI.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-RO_rk4f0.js.map +0 -1
- package/dist/web/assets/model-merger-BLEOsCIp.js.map +0 -1
- package/dist/web/assets/plugin-definition-ChUKIqUg.js.map +0 -1
|
@@ -8,6 +8,7 @@ import { PASSWORD_MIN_LENGTH } from '$constantsPassword';
|
|
|
8
8
|
import {
|
|
9
9
|
BadRequestError,
|
|
10
10
|
handleZodRequestValidationError,
|
|
11
|
+
NotFoundError,
|
|
11
12
|
} from '%errorHandlerServiceImports';
|
|
12
13
|
import {
|
|
13
14
|
createPasswordHash,
|
|
@@ -132,3 +133,135 @@ export async function authenticateUserWithEmailAndPassword({
|
|
|
132
133
|
|
|
133
134
|
return { session };
|
|
134
135
|
}
|
|
136
|
+
|
|
137
|
+
const changePasswordSchema = z.object({
|
|
138
|
+
currentPassword: z.string().min(1).max(MAX_VALUE_LENGTH),
|
|
139
|
+
newPassword: z.string().min(PASSWORD_MIN_LENGTH).max(MAX_VALUE_LENGTH),
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Change a user's password after validating their current password.
|
|
144
|
+
* This is used when a user wants to change their own password.
|
|
145
|
+
*
|
|
146
|
+
* @param params - The parameters for changing password
|
|
147
|
+
* @param params.userId - The ID of the user changing their password
|
|
148
|
+
* @param params.input - The current and new password
|
|
149
|
+
* @returns The updated user
|
|
150
|
+
*/
|
|
151
|
+
export async function changeUserPassword({
|
|
152
|
+
userId,
|
|
153
|
+
input,
|
|
154
|
+
}: {
|
|
155
|
+
userId: string;
|
|
156
|
+
input: {
|
|
157
|
+
currentPassword: string;
|
|
158
|
+
newPassword: string;
|
|
159
|
+
};
|
|
160
|
+
}): Promise<User> {
|
|
161
|
+
const { currentPassword, newPassword } = await changePasswordSchema
|
|
162
|
+
.parseAsync(input)
|
|
163
|
+
.catch(handleZodRequestValidationError);
|
|
164
|
+
|
|
165
|
+
// Get the user's account
|
|
166
|
+
const userAccount = await prisma.userAccount.findFirst({
|
|
167
|
+
where: {
|
|
168
|
+
userId,
|
|
169
|
+
providerId: PROVIDER_ID,
|
|
170
|
+
},
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
// Verify current password
|
|
174
|
+
const isValid = await verifyPasswordHash(
|
|
175
|
+
userAccount?.password ?? '',
|
|
176
|
+
currentPassword,
|
|
177
|
+
);
|
|
178
|
+
if (!isValid || !userAccount) {
|
|
179
|
+
throw new BadRequestError(
|
|
180
|
+
'Current password is incorrect',
|
|
181
|
+
'invalid-current-password',
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// Update to new password
|
|
186
|
+
await prisma.userAccount.update({
|
|
187
|
+
where: {
|
|
188
|
+
accountId_providerId: {
|
|
189
|
+
accountId: userAccount.accountId,
|
|
190
|
+
providerId: PROVIDER_ID,
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
data: {
|
|
194
|
+
password: await createPasswordHash(newPassword),
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
return prisma.user.findUniqueOrThrow({
|
|
199
|
+
where: { id: userId },
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const resetPasswordSchema = z.object({
|
|
204
|
+
newPassword: z.string().min(PASSWORD_MIN_LENGTH).max(MAX_VALUE_LENGTH),
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Reset a user's password without requiring the current password.
|
|
209
|
+
* This is used by administrators to reset any user's password.
|
|
210
|
+
*
|
|
211
|
+
* @param params - The parameters for resetting password
|
|
212
|
+
* @param params.userId - The ID of the user whose password is being reset
|
|
213
|
+
* @param params.input - The new password
|
|
214
|
+
* @returns The updated user
|
|
215
|
+
*/
|
|
216
|
+
export async function resetUserPassword({
|
|
217
|
+
userId,
|
|
218
|
+
input,
|
|
219
|
+
}: {
|
|
220
|
+
userId: string;
|
|
221
|
+
input: {
|
|
222
|
+
newPassword: string;
|
|
223
|
+
};
|
|
224
|
+
}): Promise<User> {
|
|
225
|
+
const { newPassword } = await resetPasswordSchema
|
|
226
|
+
.parseAsync(input)
|
|
227
|
+
.catch(handleZodRequestValidationError);
|
|
228
|
+
|
|
229
|
+
// Check if user exists
|
|
230
|
+
const user = await prisma.user.findUnique({
|
|
231
|
+
where: { id: userId },
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
if (user === null) {
|
|
235
|
+
throw new NotFoundError('User not found', 'user-not-found');
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (!user.email) {
|
|
239
|
+
throw new BadRequestError('User has no email', 'user-has-no-email');
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// Get or create the user's password account
|
|
243
|
+
const passwordHash = await createPasswordHash(newPassword);
|
|
244
|
+
await prisma.userAccount.upsert({
|
|
245
|
+
where: {
|
|
246
|
+
accountId_providerId: {
|
|
247
|
+
accountId: user.email,
|
|
248
|
+
providerId: PROVIDER_ID,
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
create: {
|
|
252
|
+
user: {
|
|
253
|
+
connect: {
|
|
254
|
+
id: userId,
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
accountId: user.email,
|
|
258
|
+
providerId: PROVIDER_ID,
|
|
259
|
+
password: passwordHash,
|
|
260
|
+
},
|
|
261
|
+
update: {
|
|
262
|
+
password: passwordHash,
|
|
263
|
+
},
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
return user;
|
|
267
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const authModuleGenerator: import("@baseplate-dev/sync").GeneratorBundleCreator<{
|
|
2
|
-
userSessionModelName: string;
|
|
3
2
|
userModelName: string;
|
|
3
|
+
userSessionModelName: string;
|
|
4
|
+
userAdminRoles?: string[] | undefined;
|
|
4
5
|
}, {
|
|
5
6
|
paths: import("@baseplate-dev/sync").GeneratorTask<{
|
|
6
7
|
localAuthCoreAuthModulePaths: import("@baseplate-dev/sync").ProviderExport<import("./generated/template-paths.js").LocalAuthCoreAuthModulePaths>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-module.generator.d.ts","sourceRoot":"","sources":["../../../../../src/local-auth/core/generators/auth-module/auth-module.generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth-module.generator.d.ts","sourceRoot":"","sources":["../../../../../src/local-auth/core/generators/auth-module/auth-module.generator.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCACI,sBACjB;;;;;;;;;;;;EAgFjB,CAAC"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { tsCodeFragment } from '@baseplate-dev/core-generators';
|
|
1
|
+
import { tsCodeFragment, TsCodeUtils } from '@baseplate-dev/core-generators';
|
|
2
2
|
import { appModuleProvider, configServiceProvider, createPothosPrismaObjectTypeOutputName, pothosTypeOutputProvider, prismaOutputProvider, } from '@baseplate-dev/fastify-generators';
|
|
3
3
|
import { createGenerator, createGeneratorTask, createProviderTask, } from '@baseplate-dev/sync';
|
|
4
|
+
import { quot } from '@baseplate-dev/utils';
|
|
4
5
|
import { z } from 'zod';
|
|
5
6
|
import { LOCAL_AUTH_CORE_AUTH_MODULE_GENERATED as GENERATED_TEMPLATES } from './generated/index.js';
|
|
6
7
|
const descriptorSchema = z.object({
|
|
7
8
|
userSessionModelName: z.string().min(1),
|
|
8
9
|
userModelName: z.string().min(1),
|
|
10
|
+
userAdminRoles: z.array(z.string()).default([]),
|
|
9
11
|
});
|
|
10
12
|
export const authModuleGenerator = createGenerator({
|
|
11
13
|
name: 'local-auth/core/auth-module',
|
|
12
14
|
generatorFileUrl: import.meta.url,
|
|
13
15
|
descriptorSchema,
|
|
14
|
-
buildTasks: ({ userSessionModelName, userModelName }) => ({
|
|
16
|
+
buildTasks: ({ userSessionModelName, userModelName, userAdminRoles }) => ({
|
|
15
17
|
paths: GENERATED_TEMPLATES.paths.task,
|
|
16
18
|
imports: GENERATED_TEMPLATES.imports.task,
|
|
17
19
|
renderers: GENERATED_TEMPLATES.renderers.task,
|
|
@@ -29,7 +31,7 @@ export const authModuleGenerator = createGenerator({
|
|
|
29
31
|
appModule: appModuleProvider,
|
|
30
32
|
},
|
|
31
33
|
run({ paths, appModule }) {
|
|
32
|
-
appModule.moduleImports.push(paths.schemaUserSessionMutations, paths.schemaUserSessionQueries, paths.schemaUserSessionPayloadObjectType, paths.authRoleEnum);
|
|
34
|
+
appModule.moduleImports.push(paths.schemaUserSessionMutations, paths.schemaUserSessionQueries, paths.schemaUserSessionPayloadObjectType, paths.userRolesMutations, paths.authRoleEnum);
|
|
33
35
|
},
|
|
34
36
|
}),
|
|
35
37
|
main: createGeneratorTask({
|
|
@@ -59,6 +61,10 @@ export const authModuleGenerator = createGenerator({
|
|
|
59
61
|
TPL_PRISMA_USER: prismaOutput.getPrismaModelFragment(userModelName),
|
|
60
62
|
TPL_USER_OBJECT_TYPE: userObjectType.getTypeReference().fragment,
|
|
61
63
|
},
|
|
64
|
+
userRolesMutations: {
|
|
65
|
+
TPL_ADMIN_ROLES: TsCodeUtils.mergeFragmentsAsArrayPresorted(userAdminRoles.map(quot).sort()),
|
|
66
|
+
TPL_USER_OBJECT_TYPE: userObjectType.getTypeReference().fragment,
|
|
67
|
+
},
|
|
62
68
|
},
|
|
63
69
|
}));
|
|
64
70
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-module.generator.js","sourceRoot":"","sources":["../../../../../src/local-auth/core/generators/auth-module/auth-module.generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"auth-module.generator.js","sourceRoot":"","sources":["../../../../../src/local-auth/core/generators/auth-module/auth-module.generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,sCAAsC,EACtC,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,CA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CAAC,gBAAgB,EAAE,CAAC,QAAQ;iCAC7C;gCACD,kBAAkB,EAAE;oCAClB,eAAe,EAAE,WAAW,CAAC,8BAA8B,CACzD,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAChC;oCACD,oBAAoB,EAClB,cAAc,CAAC,gBAAgB,EAAE,CAAC,QAAQ;iCAC7C;6BACF;yBACF,CAAC,CACH,CAAC;oBACJ,CAAC;iBACF,CAAC;YACJ,CAAC;SACF,CAAC;KACH,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -132,6 +132,32 @@ export declare const LOCAL_AUTH_CORE_AUTH_MODULE_GENERATED: {
|
|
|
132
132
|
}, {
|
|
133
133
|
schemaUserSessionPayloadObjectType: {};
|
|
134
134
|
}>;
|
|
135
|
+
userRolesMutations: import("@baseplate-dev/core-generators").TsTemplateFile<{
|
|
136
|
+
TPL_ADMIN_ROLES: {};
|
|
137
|
+
TPL_USER_OBJECT_TYPE: {};
|
|
138
|
+
}, {
|
|
139
|
+
pothosImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
140
|
+
builder: {};
|
|
141
|
+
}>>;
|
|
142
|
+
}, {
|
|
143
|
+
userRolesService: {};
|
|
144
|
+
}>;
|
|
145
|
+
userRolesService: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {
|
|
146
|
+
authRolesImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
147
|
+
AUTH_ROLE_CONFIG: {};
|
|
148
|
+
AuthRole: {
|
|
149
|
+
isTypeOnly: true;
|
|
150
|
+
};
|
|
151
|
+
DEFAULT_PUBLIC_ROLES: {};
|
|
152
|
+
DEFAULT_USER_ROLES: {};
|
|
153
|
+
RoleConfig: {
|
|
154
|
+
isTypeOnly: true;
|
|
155
|
+
};
|
|
156
|
+
}>>;
|
|
157
|
+
prismaImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
158
|
+
prisma: {};
|
|
159
|
+
}>>;
|
|
160
|
+
}, Record<never, Record<never, never>>>;
|
|
135
161
|
};
|
|
136
162
|
userSessionService: import("@baseplate-dev/core-generators").TsTemplateFile<{
|
|
137
163
|
TPL_PRISMA_USER_SESSION: {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-module/generated/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,qCAAqC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-module/generated/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKjD,CAAC"}
|
|
@@ -5,6 +5,8 @@ export interface LocalAuthCoreAuthModulePaths {
|
|
|
5
5
|
schemaUserSessionPayloadObjectType: string;
|
|
6
6
|
schemaUserSessionQueries: string;
|
|
7
7
|
sessionCookie: string;
|
|
8
|
+
userRolesMutations: string;
|
|
9
|
+
userRolesService: string;
|
|
8
10
|
userSessionConstants: string;
|
|
9
11
|
userSessionService: string;
|
|
10
12
|
verifyRequestOrigin: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-paths.d.ts","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-module/generated/template-paths.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,4BAA4B;IAC3C,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,0BAA0B,EAAE,MAAM,CAAC;IACnC,kCAAkC,EAAE,MAAM,CAAC;IAC3C,wBAAwB,EAAE,MAAM,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;CAC7B;
|
|
1
|
+
{"version":3,"file":"template-paths.d.ts","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-module/generated/template-paths.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,4BAA4B;IAC3C,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,0BAA0B,EAAE,MAAM,CAAC;IACnC,kCAAkC,EAAE,MAAM,CAAC;IAC3C,wBAAwB,EAAE,MAAM,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAmCD,eAAO,MAAM,iCAAiC;;;;;;;CAG7C,CAAC"}
|
|
@@ -17,6 +17,8 @@ const localAuthCoreAuthModulePathsTask = createGeneratorTask({
|
|
|
17
17
|
schemaUserSessionPayloadObjectType: `${moduleRoot}/schema/user-session-payload.object-type.ts`,
|
|
18
18
|
schemaUserSessionQueries: `${moduleRoot}/schema/user-session.queries.ts`,
|
|
19
19
|
sessionCookie: `${moduleRoot}/utils/session-cookie.ts`,
|
|
20
|
+
userRolesMutations: `${moduleRoot}/schema/user-roles.mutations.ts`,
|
|
21
|
+
userRolesService: `${moduleRoot}/services/user-roles.service.ts`,
|
|
20
22
|
userSessionConstants: `${moduleRoot}/constants/user-session.constants.ts`,
|
|
21
23
|
userSessionService: `${moduleRoot}/services/user-session.service.ts`,
|
|
22
24
|
verifyRequestOrigin: `${moduleRoot}/utils/verify-request-origin.ts`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-paths.js","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-module/generated/template-paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"template-paths.js","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-module/generated/template-paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAgB9E,MAAM,4BAA4B,GAChC,kBAAkB,CAChB,mCAAmC,CACpC,CAAC;AAEJ,MAAM,gCAAgC,GAAG,mBAAmB,CAAC;IAC3D,YAAY,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE;IAC9C,OAAO,EAAE;QACP,4BAA4B,EAAE,4BAA4B,CAAC,MAAM,EAAE;KACpE;IACD,GAAG,CAAC,EAAE,SAAS,EAAE;QACf,MAAM,UAAU,GAAG,SAAS,CAAC,eAAe,EAAE,CAAC;QAE/C,OAAO;YACL,SAAS,EAAE;gBACT,4BAA4B,EAAE;oBAC5B,YAAY,EAAE,GAAG,UAAU,2BAA2B;oBACtD,YAAY,EAAE,GAAG,UAAU,yBAAyB;oBACpD,0BAA0B,EAAE,GAAG,UAAU,mCAAmC;oBAC5E,kCAAkC,EAAE,GAAG,UAAU,6CAA6C;oBAC9F,wBAAwB,EAAE,GAAG,UAAU,iCAAiC;oBACxE,aAAa,EAAE,GAAG,UAAU,0BAA0B;oBACtD,kBAAkB,EAAE,GAAG,UAAU,iCAAiC;oBAClE,gBAAgB,EAAE,GAAG,UAAU,iCAAiC;oBAChE,oBAAoB,EAAE,GAAG,UAAU,sCAAsC;oBACzE,kBAAkB,EAAE,GAAG,UAAU,mCAAmC;oBACpE,mBAAmB,EAAE,GAAG,UAAU,iCAAiC;iBACpE;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC/C,QAAQ,EAAE,4BAA4B;IACtC,IAAI,EAAE,gCAAgC;CACvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-renderers.d.ts","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-module/generated/template-renderers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,+BAA+B,EAC/B,gCAAgC,EACjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAgBzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,sBAAsB,CAAC;AAE7E,MAAM,WAAW,gCAAgC;IAC/C,cAAc,EAAE;QACd,MAAM,EAAE,CACN,OAAO,EAAE,IAAI,CACX,gCAAgC,CAC9B,OAAO,qCAAqC,CAAC,cAAc,CAC5D,EACD,oBAAoB,GAAG,OAAO,GAAG,OAAO,GAAG,gBAAgB,CAC5D,KACE,aAAa,CAAC;KACpB,CAAC;IACF,WAAW,EAAE;QACX,MAAM,EAAE,CACN,OAAO,EAAE,IAAI,CACX,gCAAgC,CAC9B,OAAO,qCAAqC,CAAC,WAAW,CACzD,EACD,oBAAoB,GAAG,OAAO,GAAG,OAAO,GAAG,gBAAgB,CAC5D,KACE,aAAa,CAAC;KACpB,CAAC;IACF,kBAAkB,EAAE;QAClB,MAAM,EAAE,CACN,OAAO,EAAE,IAAI,CACX,+BAA+B,CAC7B,OAAO,qCAAqC,CAAC,kBAAkB,CAChE,EACD,aAAa,GAAG,oBAAoB,GAAG,UAAU,GAAG,gBAAgB,CACrE,KACE,aAAa,CAAC;KACpB,CAAC;IACF,UAAU,EAAE;QACV,MAAM,EAAE,CACN,OAAO,EAAE,IAAI,CACX,gCAAgC,CAC9B,OAAO,qCAAqC,CAAC,UAAU,CACxD,EACD,oBAAoB,GAAG,OAAO,GAAG,OAAO,GAAG,gBAAgB,CAC5D,KACE,aAAa,CAAC;KACpB,CAAC;CACH;
|
|
1
|
+
{"version":3,"file":"template-renderers.d.ts","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-module/generated/template-renderers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,+BAA+B,EAC/B,gCAAgC,EACjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAgBzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,sBAAsB,CAAC;AAE7E,MAAM,WAAW,gCAAgC;IAC/C,cAAc,EAAE;QACd,MAAM,EAAE,CACN,OAAO,EAAE,IAAI,CACX,gCAAgC,CAC9B,OAAO,qCAAqC,CAAC,cAAc,CAC5D,EACD,oBAAoB,GAAG,OAAO,GAAG,OAAO,GAAG,gBAAgB,CAC5D,KACE,aAAa,CAAC;KACpB,CAAC;IACF,WAAW,EAAE;QACX,MAAM,EAAE,CACN,OAAO,EAAE,IAAI,CACX,gCAAgC,CAC9B,OAAO,qCAAqC,CAAC,WAAW,CACzD,EACD,oBAAoB,GAAG,OAAO,GAAG,OAAO,GAAG,gBAAgB,CAC5D,KACE,aAAa,CAAC;KACpB,CAAC;IACF,kBAAkB,EAAE;QAClB,MAAM,EAAE,CACN,OAAO,EAAE,IAAI,CACX,+BAA+B,CAC7B,OAAO,qCAAqC,CAAC,kBAAkB,CAChE,EACD,aAAa,GAAG,oBAAoB,GAAG,UAAU,GAAG,gBAAgB,CACrE,KACE,aAAa,CAAC;KACpB,CAAC;IACF,UAAU,EAAE;QACV,MAAM,EAAE,CACN,OAAO,EAAE,IAAI,CACX,gCAAgC,CAC9B,OAAO,qCAAqC,CAAC,UAAU,CACxD,EACD,oBAAoB,GAAG,OAAO,GAAG,OAAO,GAAG,gBAAgB,CAC5D,KACE,aAAa,CAAC;KACpB,CAAC;CACH;AAgGD,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-renderers.js","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-module/generated/template-renderers.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,EAC5B,kCAAkC,EAClC,qBAAqB,EACrB,qBAAqB,EACrB,oCAAoC,EACpC,+BAA+B,GAChC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,qCAAqC,EAAE,MAAM,sBAAsB,CAAC;AA6C7E,MAAM,gCAAgC,GACpC,kBAAkB,CAChB,uCAAuC,CACxC,CAAC;AAEJ,MAAM,oCAAoC,GAAG,mBAAmB,CAAC;IAC/D,YAAY,EAAE;QACZ,kBAAkB,EAAE,0BAA0B;QAC9C,gBAAgB,EAAE,wBAAwB;QAC1C,oBAAoB,EAAE,4BAA4B;QAClD,0BAA0B,EAAE,kCAAkC;QAC9D,KAAK,EAAE,iCAAiC,CAAC,QAAQ;QACjD,aAAa,EAAE,qBAAqB;QACpC,aAAa,EAAE,qBAAqB;QACpC,4BAA4B,EAAE,oCAAoC;QAClE,cAAc,EAAE,sBAAsB;QACtC,uBAAuB,EAAE,+BAA+B;KACzD;IACD,OAAO,EAAE;QACP,gCAAgC,EAAE,gCAAgC,CAAC,M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;4BACD,GAAG,OAAO;yBACX,CAAC;qBACL;iBACF;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qCAAqC,GAAG;IACnD,QAAQ,EAAE,gCAAgC;IAC1C,IAAI,EAAE,oCAAoC;CAC3C,CAAC"}
|
|
1
|
+
{"version":3,"file":"template-renderers.js","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-module/generated/template-renderers.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,EAC5B,kCAAkC,EAClC,qBAAqB,EACrB,qBAAqB,EACrB,oCAAoC,EACpC,+BAA+B,GAChC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,qCAAqC,EAAE,MAAM,sBAAsB,CAAC;AA6C7E,MAAM,gCAAgC,GACpC,kBAAkB,CAChB,uCAAuC,CACxC,CAAC;AAEJ,MAAM,oCAAoC,GAAG,mBAAmB,CAAC;IAC/D,YAAY,EAAE;QACZ,kBAAkB,EAAE,0BAA0B;QAC9C,gBAAgB,EAAE,wBAAwB;QAC1C,oBAAoB,EAAE,4BAA4B;QAClD,0BAA0B,EAAE,kCAAkC;QAC9D,KAAK,EAAE,iCAAiC,CAAC,QAAQ;QACjD,aAAa,EAAE,qBAAqB;QACpC,aAAa,EAAE,qBAAqB;QACpC,4BAA4B,EAAE,oCAAoC;QAClE,cAAc,EAAE,sBAAsB;QACtC,uBAAuB,EAAE,+BAA+B;KACzD;IACD,OAAO,EAAE;QACP,gCAAgC,EAAE,gCAAgC,CAAC,MAAM,EAAE;KAC5E;IACD,GAAG,CAAC,EACF,kBAAkB,EAClB,gBAAgB,EACh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AAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qCAAqC,GAAG;IACnD,QAAQ,EAAE,gCAAgC;IAC1C,IAAI,EAAE,oCAAoC;CAC3C,CAAC"}
|
|
@@ -42,6 +42,32 @@ export declare const moduleGroup: {
|
|
|
42
42
|
}, {
|
|
43
43
|
schemaUserSessionPayloadObjectType: {};
|
|
44
44
|
}>;
|
|
45
|
+
userRolesMutations: import("@baseplate-dev/core-generators").TsTemplateFile<{
|
|
46
|
+
TPL_ADMIN_ROLES: {};
|
|
47
|
+
TPL_USER_OBJECT_TYPE: {};
|
|
48
|
+
}, {
|
|
49
|
+
pothosImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
50
|
+
builder: {};
|
|
51
|
+
}>>;
|
|
52
|
+
}, {
|
|
53
|
+
userRolesService: {};
|
|
54
|
+
}>;
|
|
55
|
+
userRolesService: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {
|
|
56
|
+
authRolesImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
57
|
+
AUTH_ROLE_CONFIG: {};
|
|
58
|
+
AuthRole: {
|
|
59
|
+
isTypeOnly: true;
|
|
60
|
+
};
|
|
61
|
+
DEFAULT_PUBLIC_ROLES: {};
|
|
62
|
+
DEFAULT_USER_ROLES: {};
|
|
63
|
+
RoleConfig: {
|
|
64
|
+
isTypeOnly: true;
|
|
65
|
+
};
|
|
66
|
+
}>>;
|
|
67
|
+
prismaImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
68
|
+
prisma: {};
|
|
69
|
+
}>>;
|
|
70
|
+
}, Record<never, Record<never, never>>>;
|
|
45
71
|
};
|
|
46
72
|
export declare const utilsGroup: {
|
|
47
73
|
cookieSigner: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {}, Record<never, Record<never, never>>>;
|
|
@@ -97,6 +123,32 @@ export declare const LOCAL_AUTH_CORE_AUTH_MODULE_TEMPLATES: {
|
|
|
97
123
|
}, {
|
|
98
124
|
schemaUserSessionPayloadObjectType: {};
|
|
99
125
|
}>;
|
|
126
|
+
userRolesMutations: import("@baseplate-dev/core-generators").TsTemplateFile<{
|
|
127
|
+
TPL_ADMIN_ROLES: {};
|
|
128
|
+
TPL_USER_OBJECT_TYPE: {};
|
|
129
|
+
}, {
|
|
130
|
+
pothosImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
131
|
+
builder: {};
|
|
132
|
+
}>>;
|
|
133
|
+
}, {
|
|
134
|
+
userRolesService: {};
|
|
135
|
+
}>;
|
|
136
|
+
userRolesService: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {
|
|
137
|
+
authRolesImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
138
|
+
AUTH_ROLE_CONFIG: {};
|
|
139
|
+
AuthRole: {
|
|
140
|
+
isTypeOnly: true;
|
|
141
|
+
};
|
|
142
|
+
DEFAULT_PUBLIC_ROLES: {};
|
|
143
|
+
DEFAULT_USER_ROLES: {};
|
|
144
|
+
RoleConfig: {
|
|
145
|
+
isTypeOnly: true;
|
|
146
|
+
};
|
|
147
|
+
}>>;
|
|
148
|
+
prismaImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
149
|
+
prisma: {};
|
|
150
|
+
}>>;
|
|
151
|
+
}, Record<never, Record<never, never>>>;
|
|
100
152
|
};
|
|
101
153
|
userSessionService: import("@baseplate-dev/core-generators").TsTemplateFile<{
|
|
102
154
|
TPL_PRISMA_USER_SESSION: {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typed-templates.d.ts","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-module/generated/typed-templates.ts"],"names":[],"mappings":"AA2BA,eAAO,MAAM,cAAc;;CAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"typed-templates.d.ts","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-module/generated/typed-templates.ts"],"names":[],"mappings":"AA2BA,eAAO,MAAM,cAAc;;CAA2B,CAAC;AAoGvD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOvB,CAAC;AAwEF,eAAO,MAAM,UAAU;;;;;;;;CAAuD,CAAC;AAE/E,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKjD,CAAC"}
|
|
@@ -60,11 +60,39 @@ const schemaUserSessionQueries = createTsTemplateFile({
|
|
|
60
60
|
},
|
|
61
61
|
variables: {},
|
|
62
62
|
});
|
|
63
|
+
const userRolesMutations = createTsTemplateFile({
|
|
64
|
+
fileOptions: { kind: 'singleton' },
|
|
65
|
+
group: 'module',
|
|
66
|
+
importMapProviders: { pothosImports: pothosImportsProvider },
|
|
67
|
+
name: 'user-roles-mutations',
|
|
68
|
+
projectExports: {},
|
|
69
|
+
referencedGeneratorTemplates: { userRolesService: {} },
|
|
70
|
+
source: {
|
|
71
|
+
path: path.join(import.meta.dirname, '../templates/module/schema/user-roles.mutations.ts'),
|
|
72
|
+
},
|
|
73
|
+
variables: { TPL_ADMIN_ROLES: {}, TPL_USER_OBJECT_TYPE: {} },
|
|
74
|
+
});
|
|
75
|
+
const userRolesService = createTsTemplateFile({
|
|
76
|
+
fileOptions: { kind: 'singleton' },
|
|
77
|
+
group: 'module',
|
|
78
|
+
importMapProviders: {
|
|
79
|
+
authRolesImports: authRolesImportsProvider,
|
|
80
|
+
prismaImports: prismaImportsProvider,
|
|
81
|
+
},
|
|
82
|
+
name: 'user-roles-service',
|
|
83
|
+
projectExports: {},
|
|
84
|
+
source: {
|
|
85
|
+
path: path.join(import.meta.dirname, '../templates/module/services/user-roles.service.ts'),
|
|
86
|
+
},
|
|
87
|
+
variables: {},
|
|
88
|
+
});
|
|
63
89
|
export const moduleGroup = {
|
|
64
90
|
authRoleEnum,
|
|
65
91
|
schemaUserSessionMutations,
|
|
66
92
|
schemaUserSessionPayloadObjectType,
|
|
67
93
|
schemaUserSessionQueries,
|
|
94
|
+
userRolesMutations,
|
|
95
|
+
userRolesService,
|
|
68
96
|
};
|
|
69
97
|
const userSessionService = createTsTemplateFile({
|
|
70
98
|
fileOptions: { kind: 'singleton' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typed-templates.js","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-module/generated/typed-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,EAC5B,kCAAkC,EAClC,qBAAqB,EACrB,qBAAqB,EACrB,oCAAoC,EACpC,+BAA+B,GAChC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;IAChD,WAAW,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;IAClC,KAAK,EAAE,WAAW;IAClB,kBAAkB,EAAE,EAAE;IACtB,IAAI,EAAE,wBAAwB;IAC9B,MAAM,EAAE;QACN,IAAI,EAAE,IAAI,CAAC,IAAI,CACb,MAAM,CAAC,IAAI,CAAC,OAAO,EACnB,yDAAyD,CAC1D;KACF;IACD,SAAS,EAAE,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,oBAAoB,EAAE,CAAC;AAEvD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EAAE,EAAE,EAAE,oBAAoB,EAAE,EAAE,EAAE;CAC7D,CAAC,CAAC;AAEH,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;IACpD,WAAW,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;IAClC,KAAK,EAAE,QAAQ;IACf,kBAAkB,EAAE,EAAE,aAAa,EAAE,qBAAqB,EAAE;IAC5D,IAAI,EAAE,6BAA6B;IACnC,4BAA4B,EAAE,EAAE,kCAAkC,EAAE,EAAE,EAAE;IACxE,MAAM,EAAE;QACN,IAAI,EAAE,IAAI,CAAC,IAAI,CACb,MAAM,CAAC,IAAI,CAAC,OAAO,EACnB,oDAAoD,CACrD;KACF;IACD,SAAS,EAAE,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,YAAY;IACZ,0BAA0B;IAC1B,kCAAkC;IAClC,wBAAwB;
|
|
1
|
+
{"version":3,"file":"typed-templates.js","sourceRoot":"","sources":["../../../../../../src/local-auth/core/generators/auth-module/generated/typed-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,EAC5B,kCAAkC,EAClC,qBAAqB,EACrB,qBAAqB,EACrB,oCAAoC,EACpC,+BAA+B,GAChC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;IAChD,WAAW,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;IAClC,KAAK,EAAE,WAAW;IAClB,kBAAkB,EAAE,EAAE;IACtB,IAAI,EAAE,wBAAwB;IAC9B,MAAM,EAAE;QACN,IAAI,EAAE,IAAI,CAAC,IAAI,CACb,MAAM,CAAC,IAAI,CAAC,OAAO,EACnB,yDAAyD,CAC1D;KACF;IACD,SAAS,EAAE,EAAE;CACd,CAAC,CAAC;A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CACb,MAAM,CAAC,IAAI,CAAC,OAAO,EACnB,4CAA4C,CAC7C;KACF;IACD,SAAS,EAAE,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,oBAAoB,CAAC;IACzC,WAAW,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;IAClC,KAAK,EAAE,OAAO;IACd,kBAAkB,EAAE,EAAE,oBAAoB,EAAE,4BAA4B,EAAE;IAC1E,IAAI,EAAE,gBAAgB;IACtB,MAAM,EAAE;QACN,IAAI,EAAE,IAAI,CAAC,IAAI,CACb,MAAM,CAAC,IAAI,CAAC,OAAO,EACnB,6CAA6C,CAC9C;KACF;IACD,SAAS,EAAE,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;IAC/C,WAAW,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;IAClC,KAAK,EAAE,OAAO;IACd,kBAAkB,EAAE,EAAE;IACtB,IAAI,EAAE,uBAAuB;IAC7B,MAAM,EAAE;QACN,IAAI,EAAE,IAAI,CAAC,IAAI,CACb,MAAM,CAAC,IAAI,CAAC,OAAO,EACnB,oDAAoD,CACrD;KACF;IACD,SAAS,EAAE,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,CAAC;AAE/E,MAAM,CAAC,MAAM,qCAAqC,GAAG;IACnD,cAAc;IACd,WAAW;IACX,kBAAkB;IAClB,UAAU;CACX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-roles.mutations.d.ts","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.ts"],"names":[],"mappings":""}
|
package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { updateUserRoles } from '$userRolesService';
|
|
3
|
+
import { builder } from '%pothosImports';
|
|
4
|
+
builder.mutationField('updateUserRoles', (t) => t.fieldWithInputPayload({
|
|
5
|
+
authorize: TPL_ADMIN_ROLES,
|
|
6
|
+
payload: {
|
|
7
|
+
user: t.payload.field({
|
|
8
|
+
type: TPL_USER_OBJECT_TYPE,
|
|
9
|
+
}),
|
|
10
|
+
},
|
|
11
|
+
input: {
|
|
12
|
+
userId: t.input.field({ required: true, type: 'Uuid' }),
|
|
13
|
+
roles: t.input.field({
|
|
14
|
+
required: true,
|
|
15
|
+
type: ['String'],
|
|
16
|
+
}),
|
|
17
|
+
},
|
|
18
|
+
resolve: async (root, { input }) => {
|
|
19
|
+
const user = await updateUserRoles(input);
|
|
20
|
+
return { user };
|
|
21
|
+
},
|
|
22
|
+
}));
|
|
23
|
+
//# sourceMappingURL=user-roles.mutations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-roles.mutations.js","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,CAAC,aAAa,CAAC,iBAAiB,EAAE,CAAC,CAAC,EAAE,EAAE,CAC7C,CAAC,CAAC,qBAAqB,CAAC;IACtB,SAAS,EAAE,eAAe;IAC1B,OAAO,EAAE;QACP,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;YACpB,IAAI,EAAE,oBAAoB;SAC3B,CAAC;KACH;IACD,KAAK,EAAE;QACL,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QACvD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;YACnB,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,CAAC,QAAQ,CAAC;SACjB,CAAC;KACH;IACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QACjC,MAAM,IAAI,GAAG,MAAM,eAAe,CAAC,KAAK,CAAC,CAAC;QAC1C,OAAO,EAAE,IAAI,EAAE,CAAC;IAClB,CAAC;CACF,CAAC,CACH,CAAC"}
|
package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
import { updateUserRoles } from '$userRolesService';
|
|
4
|
+
import { builder } from '%pothosImports';
|
|
5
|
+
|
|
6
|
+
builder.mutationField('updateUserRoles', (t) =>
|
|
7
|
+
t.fieldWithInputPayload({
|
|
8
|
+
authorize: TPL_ADMIN_ROLES,
|
|
9
|
+
payload: {
|
|
10
|
+
user: t.payload.field({
|
|
11
|
+
type: TPL_USER_OBJECT_TYPE,
|
|
12
|
+
}),
|
|
13
|
+
},
|
|
14
|
+
input: {
|
|
15
|
+
userId: t.input.field({ required: true, type: 'Uuid' }),
|
|
16
|
+
roles: t.input.field({
|
|
17
|
+
required: true,
|
|
18
|
+
type: ['String'],
|
|
19
|
+
}),
|
|
20
|
+
},
|
|
21
|
+
resolve: async (root, { input }) => {
|
|
22
|
+
const user = await updateUserRoles(input);
|
|
23
|
+
return { user };
|
|
24
|
+
},
|
|
25
|
+
}),
|
|
26
|
+
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { User } from '@prisma/client';
|
|
2
|
+
/**
|
|
3
|
+
* Updates the roles assigned to a user.
|
|
4
|
+
* Filters out built-in roles (public, user, system) as these are automatically assigned.
|
|
5
|
+
*
|
|
6
|
+
* @param params - The parameters for updating user roles
|
|
7
|
+
* @param params.userId - The ID of the user to update
|
|
8
|
+
* @param params.roles - Array of role names to assign to the user
|
|
9
|
+
* @returns The updated user with their roles
|
|
10
|
+
*/
|
|
11
|
+
export declare function updateUserRoles({ userId, roles, }: {
|
|
12
|
+
userId: string;
|
|
13
|
+
roles: string[];
|
|
14
|
+
}): Promise<User>;
|
|
15
|
+
//# sourceMappingURL=user-roles.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-roles.service.d.ts","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAK3C;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CAAC,EACpC,MAAM,EACN,KAAK,GACN,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBhB"}
|
package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { AUTH_ROLE_CONFIG } from '%authRolesImports';
|
|
3
|
+
import { prisma } from '%prismaImports';
|
|
4
|
+
/**
|
|
5
|
+
* Updates the roles assigned to a user.
|
|
6
|
+
* Filters out built-in roles (public, user, system) as these are automatically assigned.
|
|
7
|
+
*
|
|
8
|
+
* @param params - The parameters for updating user roles
|
|
9
|
+
* @param params.userId - The ID of the user to update
|
|
10
|
+
* @param params.roles - Array of role names to assign to the user
|
|
11
|
+
* @returns The updated user with their roles
|
|
12
|
+
*/
|
|
13
|
+
export async function updateUserRoles({ userId, roles, }) {
|
|
14
|
+
// Filter out built-in roles (public, user, system)
|
|
15
|
+
const validRoles = roles.filter((role) => {
|
|
16
|
+
if (!(role in AUTH_ROLE_CONFIG)) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
const roleConfig = AUTH_ROLE_CONFIG[role];
|
|
20
|
+
return !roleConfig.builtIn;
|
|
21
|
+
});
|
|
22
|
+
await prisma.$transaction([
|
|
23
|
+
prisma.userRole.deleteMany({
|
|
24
|
+
where: { userId, role: { notIn: validRoles } },
|
|
25
|
+
}),
|
|
26
|
+
prisma.userRole.createMany({
|
|
27
|
+
data: validRoles.map((role) => ({ userId, role })),
|
|
28
|
+
skipDuplicates: true,
|
|
29
|
+
}),
|
|
30
|
+
]);
|
|
31
|
+
return prisma.user.findUnique({
|
|
32
|
+
where: { id: userId },
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=user-roles.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-roles.service.js","sourceRoot":"","sources":["../../../../../../../../src/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.ts"],"names":[],"mappings":"AAAA,cAAc;AAKd,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,EACpC,MAAM,EACN,KAAK,GAIN;IACC,mDAAmD;IACnD,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QACvC,IAAI,CAAC,CAAC,IAAI,IAAI,gBAAgB,CAAC,EAAE,CAAC;YAChC,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAgB,CAAC,CAAC;QACtD,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,MAAM,MAAM,CAAC,YAAY,CAAC;QACxB,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC;YACzB,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE;SAC/C,CAAC;QACF,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC;YACzB,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;YAClD,cAAc,EAAE,IAAI;SACrB,CAAC;KACH,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;QAC5B,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;KACtB,CAAkB,CAAC;AACtB,CAAC"}
|
package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
import type { AuthRole } from '%authRolesImports';
|
|
4
|
+
import type { User } from '@prisma/client';
|
|
5
|
+
|
|
6
|
+
import { AUTH_ROLE_CONFIG } from '%authRolesImports';
|
|
7
|
+
import { prisma } from '%prismaImports';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Updates the roles assigned to a user.
|
|
11
|
+
* Filters out built-in roles (public, user, system) as these are automatically assigned.
|
|
12
|
+
*
|
|
13
|
+
* @param params - The parameters for updating user roles
|
|
14
|
+
* @param params.userId - The ID of the user to update
|
|
15
|
+
* @param params.roles - Array of role names to assign to the user
|
|
16
|
+
* @returns The updated user with their roles
|
|
17
|
+
*/
|
|
18
|
+
export async function updateUserRoles({
|
|
19
|
+
userId,
|
|
20
|
+
roles,
|
|
21
|
+
}: {
|
|
22
|
+
userId: string;
|
|
23
|
+
roles: string[];
|
|
24
|
+
}): Promise<User> {
|
|
25
|
+
// Filter out built-in roles (public, user, system)
|
|
26
|
+
const validRoles = roles.filter((role) => {
|
|
27
|
+
if (!(role in AUTH_ROLE_CONFIG)) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
const roleConfig = AUTH_ROLE_CONFIG[role as AuthRole];
|
|
31
|
+
return !roleConfig.builtIn;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
await prisma.$transaction([
|
|
35
|
+
prisma.userRole.deleteMany({
|
|
36
|
+
where: { userId, role: { notIn: validRoles } },
|
|
37
|
+
}),
|
|
38
|
+
prisma.userRole.createMany({
|
|
39
|
+
data: validRoles.map((role) => ({ userId, role })),
|
|
40
|
+
skipDuplicates: true,
|
|
41
|
+
}),
|
|
42
|
+
]);
|
|
43
|
+
|
|
44
|
+
return prisma.user.findUnique({
|
|
45
|
+
where: { id: userId },
|
|
46
|
+
}) as Promise<User>;
|
|
47
|
+
}
|