@baseplate-dev/plugin-auth 1.0.1 → 1.0.3
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/auth/core/common.js +2 -2
- package/dist/auth/core/common.js.map +1 -1
- package/dist/auth/core/components/auth-definition-editor.d.ts.map +1 -1
- package/dist/auth/core/components/auth-definition-editor.js +11 -7
- package/dist/auth/core/components/auth-definition-editor.js.map +1 -1
- package/dist/auth/core/generators/auth-apollo/auth-apollo.generator.d.ts +28 -0
- package/dist/auth/core/generators/auth-apollo/auth-apollo.generator.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-apollo/auth-apollo.generator.js +43 -0
- package/dist/auth/core/generators/auth-apollo/auth-apollo.generator.js.map +1 -0
- package/dist/auth/core/generators/auth-apollo/index.d.ts +2 -0
- package/dist/auth/core/generators/auth-apollo/index.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-apollo/index.js +2 -0
- package/dist/auth/core/generators/auth-apollo/index.js.map +1 -0
- package/dist/auth/core/generators/auth-apollo/templates/session-error-link.d.ts +2 -0
- package/dist/auth/core/generators/auth-apollo/templates/session-error-link.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-apollo/templates/session-error-link.js +15 -0
- package/dist/auth/core/generators/auth-apollo/templates/session-error-link.js.map +1 -0
- package/dist/auth/core/generators/auth-apollo/templates/session-error-link.ts +16 -0
- package/dist/auth/core/generators/auth-email-password/auth-email-password.generator.d.ts +73 -0
- package/dist/auth/core/generators/auth-email-password/auth-email-password.generator.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/auth-email-password.generator.js +40 -0
- package/dist/auth/core/generators/auth-email-password/auth-email-password.generator.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/index.d.ts +120 -0
- package/dist/auth/core/generators/auth-email-password/generated/index.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/index.js +11 -0
- package/dist/auth/core/generators/auth-email-password/generated/index.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/template-paths.d.ts +14 -0
- package/dist/auth/core/generators/auth-email-password/generated/template-paths.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/template-paths.js +26 -0
- package/dist/auth/core/generators/auth-email-password/generated/template-paths.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/template-renderers.d.ts +58 -0
- package/dist/auth/core/generators/auth-email-password/generated/template-renderers.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/template-renderers.js +54 -0
- package/dist/auth/core/generators/auth-email-password/generated/template-renderers.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts +25 -0
- package/dist/auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/ts-import-providers.js +32 -0
- package/dist/auth/core/generators/auth-email-password/generated/ts-import-providers.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/typed-templates.d.ts +97 -0
- package/dist/auth/core/generators/auth-email-password/generated/typed-templates.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/typed-templates.js +56 -0
- package/dist/auth/core/generators/auth-email-password/generated/typed-templates.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/index.d.ts +4 -0
- package/dist/auth/core/generators/auth-email-password/index.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/index.js +3 -0
- package/dist/auth/core/generators/auth-email-password/index.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts +2 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.js +3 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.ts +3 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.d.ts +2 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js +33 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.ts +45 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts +21 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.js +74 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.ts +122 -0
- package/dist/auth/core/generators/auth-hooks/auth-hooks.generator.d.ts +62 -0
- package/dist/auth/core/generators/auth-hooks/auth-hooks.generator.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/auth-hooks.generator.js +38 -0
- package/dist/auth/core/generators/auth-hooks/auth-hooks.generator.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/index.d.ts +120 -0
- package/dist/auth/core/generators/auth-hooks/generated/index.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/index.js +11 -0
- package/dist/auth/core/generators/auth-hooks/generated/index.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/template-paths.d.ts +16 -0
- package/dist/auth/core/generators/auth-hooks/generated/template-paths.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/template-paths.js +26 -0
- package/dist/auth/core/generators/auth-hooks/generated/template-paths.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/template-renderers.d.ts +47 -0
- package/dist/auth/core/generators/auth-hooks/generated/template-renderers.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/template-renderers.js +49 -0
- package/dist/auth/core/generators/auth-hooks/generated/template-renderers.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts +16 -0
- package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.js +27 -0
- package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/typed-templates.d.ts +116 -0
- package/dist/auth/core/generators/auth-hooks/generated/typed-templates.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/typed-templates.js +70 -0
- package/dist/auth/core/generators/auth-hooks/generated/typed-templates.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/index.d.ts +2 -0
- package/dist/auth/core/generators/auth-hooks/index.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/index.js +2 -0
- package/dist/auth/core/generators/auth-hooks/index.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.d.ts +18 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.gql +10 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.js +22 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.ts +40 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.d.ts +2 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.js +27 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.ts +29 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts +8 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.js +12 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.ts +16 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts +7 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.js +15 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.ts +16 -0
- package/dist/auth/{generators/fastify → core/generators}/auth-module/auth-module.generator.d.ts +45 -32
- package/dist/auth/core/generators/auth-module/auth-module.generator.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/auth-module.generator.js +61 -0
- package/dist/auth/core/generators/auth-module/auth-module.generator.js.map +1 -0
- package/dist/auth/core/generators/auth-module/generated/index.d.ts +173 -0
- package/dist/{auth0/generators/react/auth0-components → auth/core/generators/auth-module}/generated/index.d.ts.map +1 -1
- package/dist/auth/core/generators/auth-module/generated/index.js +11 -0
- package/dist/auth/core/generators/auth-module/generated/index.js.map +1 -0
- package/dist/auth/core/generators/auth-module/generated/template-paths.d.ts +19 -0
- package/dist/auth/core/generators/auth-module/generated/template-paths.d.ts.map +1 -0
- package/dist/auth/{generators/fastify → core/generators}/auth-module/generated/template-paths.js +10 -7
- package/dist/auth/core/generators/auth-module/generated/template-paths.js.map +1 -0
- package/dist/auth/core/generators/auth-module/generated/template-renderers.d.ts +80 -0
- package/dist/auth/core/generators/auth-module/generated/template-renderers.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/generated/template-renderers.js +77 -0
- package/dist/auth/core/generators/auth-module/generated/template-renderers.js.map +1 -0
- package/dist/auth/core/generators/auth-module/generated/ts-import-providers.d.ts +22 -0
- package/dist/auth/core/generators/auth-module/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/generated/ts-import-providers.js +31 -0
- package/dist/auth/core/generators/auth-module/generated/ts-import-providers.js.map +1 -0
- package/dist/auth/{generators/fastify → core/generators}/auth-module/generated/typed-templates.d.ts +47 -7
- package/dist/auth/core/generators/auth-module/generated/typed-templates.d.ts.map +1 -0
- package/dist/auth/{generators/fastify → core/generators}/auth-module/generated/typed-templates.js +40 -3
- package/dist/auth/core/generators/auth-module/generated/typed-templates.js.map +1 -0
- package/dist/auth/core/generators/auth-module/index.d.ts +4 -0
- package/dist/auth/core/generators/auth-module/index.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/index.js +3 -0
- package/dist/auth/core/generators/auth-module/index.js.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/constants/user-session.constants.d.ts +16 -0
- package/dist/auth/core/generators/auth-module/templates/module/constants/user-session.constants.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/constants/user-session.constants.js +17 -0
- package/dist/auth/core/generators/auth-module/templates/module/constants/user-session.constants.js.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.d.ts +2 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.js +17 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.js.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.ts +23 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.d.ts +2 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js +18 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.ts +23 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.d.ts +2 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.js +19 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.js.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.ts +24 -0
- package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.d.ts +43 -0
- package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.js +180 -0
- package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.js.map +1 -0
- package/dist/auth/{generators/fastify → core/generators}/auth-module/templates/module/services/user-session.service.ts +1 -1
- package/dist/auth/core/generators/auth-module/templates/module/utils/cookie-signer.d.ts +38 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/cookie-signer.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/cookie-signer.js +71 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/cookie-signer.js.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/session-cookie.d.ts +11 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/session-cookie.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/session-cookie.js +38 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/session-cookie.js.map +1 -0
- package/dist/auth/{generators/fastify → core/generators}/auth-module/templates/module/utils/session-cookie.ts +2 -2
- package/dist/auth/core/generators/auth-module/templates/module/utils/verify-request-origin.d.ts +10 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/verify-request-origin.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/verify-request-origin.js +35 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/verify-request-origin.js.map +1 -0
- package/dist/auth/core/generators/auth-routes/auth-routes.generator.d.ts +177 -0
- package/dist/auth/core/generators/auth-routes/auth-routes.generator.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-routes/auth-routes.generator.js +38 -0
- package/dist/auth/core/generators/auth-routes/auth-routes.generator.js.map +1 -0
- package/dist/auth/core/generators/auth-routes/generated/index.d.ts +498 -0
- package/dist/auth/core/generators/auth-routes/generated/index.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-routes/generated/index.js +9 -0
- package/dist/auth/core/generators/auth-routes/generated/index.js.map +1 -0
- package/dist/auth/core/generators/auth-routes/generated/template-paths.d.ts +15 -0
- package/dist/auth/core/generators/auth-routes/generated/template-paths.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-routes/generated/template-paths.js +25 -0
- package/dist/auth/core/generators/auth-routes/generated/template-paths.js.map +1 -0
- package/dist/auth/core/generators/auth-routes/generated/template-renderers.d.ts +177 -0
- package/dist/auth/core/generators/auth-routes/generated/template-renderers.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-routes/generated/template-renderers.js +55 -0
- package/dist/auth/core/generators/auth-routes/generated/template-renderers.js.map +1 -0
- package/dist/auth/core/generators/auth-routes/generated/typed-templates.d.ts +642 -0
- package/dist/auth/core/generators/auth-routes/generated/typed-templates.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-routes/generated/typed-templates.js +57 -0
- package/dist/auth/core/generators/auth-routes/generated/typed-templates.js.map +1 -0
- package/dist/auth/core/generators/auth-routes/index.d.ts +2 -0
- package/dist/auth/core/generators/auth-routes/index.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-routes/index.js +2 -0
- package/dist/auth/core/generators/auth-routes/index.js.map +1 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts +2 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.js +85 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.js.map +1 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.tsx +161 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/queries.gql +15 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts +2 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.js +77 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.js.map +1 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.tsx +148 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/route.d.ts +2 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/route.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/route.js +10 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/route.js.map +1 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/route.tsx +17 -0
- package/dist/auth/core/generators/index.d.ts +8 -0
- package/dist/auth/core/generators/index.d.ts.map +1 -0
- package/dist/auth/core/generators/index.js +8 -0
- package/dist/auth/core/generators/index.js.map +1 -0
- package/dist/auth/core/generators/react-auth/index.d.ts +2 -0
- package/dist/auth/core/generators/react-auth/index.d.ts.map +1 -0
- package/dist/auth/core/generators/react-auth/index.js +2 -0
- package/dist/auth/core/generators/react-auth/index.js.map +1 -0
- package/dist/auth/core/generators/react-auth/react-auth.generator.d.ts +9 -0
- package/dist/auth/core/generators/react-auth/react-auth.generator.d.ts.map +1 -0
- package/dist/auth/core/generators/react-auth/react-auth.generator.js +31 -0
- package/dist/auth/core/generators/react-auth/react-auth.generator.js.map +1 -0
- package/dist/auth/core/generators/react-session/generated/index.d.ts +67 -0
- package/dist/auth/core/generators/react-session/generated/index.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/generated/index.js +11 -0
- package/dist/auth/core/generators/react-session/generated/index.js.map +1 -0
- package/dist/auth/core/generators/react-session/generated/template-paths.d.ts +16 -0
- package/dist/auth/core/generators/react-session/generated/template-paths.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/generated/template-paths.js +26 -0
- package/dist/auth/core/generators/react-session/generated/template-paths.js.map +1 -0
- package/dist/auth/core/generators/react-session/generated/template-renderers.d.ts +27 -0
- package/dist/auth/core/generators/react-session/generated/template-renderers.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/generated/template-renderers.js +48 -0
- package/dist/auth/core/generators/react-session/generated/template-renderers.js.map +1 -0
- package/dist/auth/core/generators/react-session/generated/ts-import-providers.d.ts +64 -0
- package/dist/auth/core/generators/react-session/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/generated/ts-import-providers.js +42 -0
- package/dist/auth/core/generators/react-session/generated/ts-import-providers.js.map +1 -0
- package/dist/auth/core/generators/react-session/generated/typed-templates.d.ts +32 -0
- package/dist/auth/core/generators/react-session/generated/typed-templates.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/generated/typed-templates.js +76 -0
- package/dist/auth/core/generators/react-session/generated/typed-templates.js.map +1 -0
- package/dist/auth/core/generators/react-session/index.d.ts +4 -0
- package/dist/auth/core/generators/react-session/index.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/index.js +3 -0
- package/dist/auth/core/generators/react-session/index.js.map +1 -0
- package/dist/auth/core/generators/react-session/react-session.generator.d.ts +49 -0
- package/dist/auth/core/generators/react-session/react-session.generator.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/react-session.generator.js +39 -0
- package/dist/auth/core/generators/react-session/react-session.generator.js.map +1 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.d.ts +7 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.gql +6 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.js +25 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.js.map +1 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.tsx +29 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.d.ts +7 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.js +18 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.js.map +1 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.tsx +47 -0
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.d.ts +12 -0
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.js +15 -0
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.js.map +1 -0
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.ts +33 -0
- package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.d.ts +79 -0
- package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.js +133 -0
- package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.js.map +1 -0
- package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.ts +153 -0
- package/dist/auth/core/index.d.ts +2 -0
- package/dist/auth/core/index.d.ts.map +1 -0
- package/dist/auth/core/index.js +2 -0
- package/dist/auth/core/index.js.map +1 -0
- package/dist/auth/core/node.d.ts.map +1 -1
- package/dist/auth/core/node.js +29 -24
- package/dist/auth/core/node.js.map +1 -1
- package/dist/auth/core/schema/models.d.ts.map +1 -1
- package/dist/auth/core/schema/models.js +15 -10
- package/dist/auth/core/schema/models.js.map +1 -1
- package/dist/auth/core/schema/plugin-definition.d.ts +22 -12
- package/dist/auth/core/schema/plugin-definition.d.ts.map +1 -1
- package/dist/auth/core/schema/plugin-definition.js +10 -10
- package/dist/auth/core/schema/plugin-definition.js.map +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/auth/index.js.map +1 -1
- package/dist/auth0/core/common.js +2 -2
- package/dist/auth0/core/common.js.map +1 -1
- package/dist/auth0/core/components/auth-definition-editor.d.ts.map +1 -1
- package/dist/auth0/core/components/auth-definition-editor.js +10 -6
- package/dist/auth0/core/components/auth-definition-editor.js.map +1 -1
- package/dist/auth0/core/node.d.ts.map +1 -1
- package/dist/auth0/core/node.js +19 -48
- package/dist/auth0/core/node.js.map +1 -1
- package/dist/auth0/core/schema/plugin-definition.d.ts +19 -9
- package/dist/auth0/core/schema/plugin-definition.d.ts.map +1 -1
- package/dist/auth0/core/schema/plugin-definition.js +7 -7
- package/dist/auth0/core/schema/plugin-definition.js.map +1 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/index.d.ts +43 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/index.d.ts.map +1 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/index.js +2 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/index.js.map +1 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.d.ts +55 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.d.ts.map +1 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.js +52 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.js.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.d.ts +0 -1
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.d.ts.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js +2 -4
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/index.d.ts +22 -5
- package/dist/auth0/generators/react/auth0-hooks/generated/index.d.ts.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/index.js +2 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/index.js.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.d.ts +1 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.d.ts.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.js +5 -5
- package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.js.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.d.ts +29 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.js +46 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.js.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.d.ts +5 -5
- package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.d.ts.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.js +6 -6
- package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.js.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/{useCurrentUser.ts → use-current-user.ts} +4 -3
- package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/{useRequiredUserId.ts → use-required-user-id.ts} +1 -1
- package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/{useSession.ts → use-session.ts} +2 -2
- package/dist/auth0/generators/react/{auth0-components/auth0-components.generator.d.ts → auth0-pages/auth0-pages.generator.d.ts} +17 -20
- package/dist/auth0/generators/react/auth0-pages/auth0-pages.generator.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-pages/auth0-pages.generator.js +26 -0
- package/dist/auth0/generators/react/auth0-pages/auth0-pages.generator.js.map +1 -0
- package/dist/auth0/generators/react/auth0-pages/generated/index.d.ts +280 -0
- package/dist/auth0/generators/react/{auth0-callback → auth0-pages}/generated/index.d.ts.map +1 -1
- package/dist/auth0/generators/react/auth0-pages/generated/index.js +9 -0
- package/dist/auth0/generators/react/auth0-pages/generated/index.js.map +1 -0
- package/dist/auth0/generators/react/auth0-pages/generated/template-paths.d.ts +12 -0
- package/dist/auth0/generators/react/auth0-pages/generated/template-paths.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-pages/generated/template-paths.js +20 -0
- package/dist/auth0/generators/react/auth0-pages/generated/template-paths.js.map +1 -0
- package/dist/auth0/generators/react/auth0-pages/generated/template-renderers.d.ts +145 -0
- package/dist/auth0/generators/react/auth0-pages/generated/template-renderers.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-pages/generated/template-renderers.js +37 -0
- package/dist/auth0/generators/react/auth0-pages/generated/template-renderers.js.map +1 -0
- package/dist/auth0/generators/react/auth0-pages/generated/typed-templates.d.ts +265 -0
- package/dist/auth0/generators/react/auth0-pages/generated/typed-templates.d.ts.map +1 -0
- package/dist/auth0/generators/react/{auth0-components → auth0-pages}/generated/typed-templates.js +6 -5
- package/dist/auth0/generators/react/auth0-pages/generated/typed-templates.js.map +1 -0
- package/dist/auth0/generators/react/auth0-pages/index.d.ts +2 -0
- package/dist/auth0/generators/react/auth0-pages/index.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-pages/index.js +2 -0
- package/dist/auth0/generators/react/auth0-pages/index.js.map +1 -0
- package/dist/auth0/generators/react/auth0-pages/templates/routes/login.tsx +31 -0
- package/dist/auth0/generators/react/index.d.ts +1 -2
- package/dist/auth0/generators/react/index.d.ts.map +1 -1
- package/dist/auth0/generators/react/index.js +1 -2
- package/dist/auth0/generators/react/index.js.map +1 -1
- package/dist/auth0/generators/react/{auth0-callback → react-auth0}/generated/index.d.ts +29 -31
- package/dist/auth0/generators/react/react-auth0/generated/index.d.ts.map +1 -0
- package/dist/auth0/generators/react/react-auth0/generated/index.js +9 -0
- package/dist/auth0/generators/react/react-auth0/generated/index.js.map +1 -0
- package/dist/auth0/generators/react/react-auth0/generated/template-paths.d.ts +12 -0
- package/dist/auth0/generators/react/react-auth0/generated/template-paths.d.ts.map +1 -0
- package/dist/auth0/generators/react/react-auth0/generated/template-paths.js +22 -0
- package/dist/auth0/generators/react/react-auth0/generated/template-paths.js.map +1 -0
- package/dist/auth0/generators/react/{auth0-callback/auth0-callback.generator.d.ts → react-auth0/generated/template-renderers.d.ts} +24 -28
- package/dist/auth0/generators/react/react-auth0/generated/template-renderers.d.ts.map +1 -0
- package/dist/auth0/generators/react/react-auth0/generated/template-renderers.js +39 -0
- package/dist/auth0/generators/react/react-auth0/generated/template-renderers.js.map +1 -0
- package/dist/auth0/generators/react/{auth0-components → react-auth0}/generated/typed-templates.d.ts +14 -9
- package/dist/auth0/generators/react/react-auth0/generated/typed-templates.d.ts.map +1 -0
- package/dist/auth0/generators/react/react-auth0/generated/typed-templates.js +17 -0
- package/dist/auth0/generators/react/react-auth0/generated/typed-templates.js.map +1 -0
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.d.ts +159 -3
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.d.ts.map +1 -1
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.js +56 -13
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.js.map +1 -1
- package/dist/auth0/generators/react/react-auth0/templates/src/app/auth-loaded-gate.tsx +78 -0
- package/dist/common/compiler/generator-creators.d.ts +18 -0
- package/dist/common/compiler/generator-creators.d.ts.map +1 -0
- package/dist/common/compiler/generator-creators.js +34 -0
- package/dist/common/compiler/generator-creators.js.map +1 -0
- package/dist/common/compiler/index.d.ts +2 -0
- package/dist/common/compiler/index.d.ts.map +1 -0
- package/dist/common/compiler/index.js +2 -0
- package/dist/common/compiler/index.js.map +1 -0
- package/dist/common/index.d.ts +3 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +3 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/roles/components/index.d.ts +2 -0
- package/dist/common/roles/components/index.d.ts.map +1 -0
- package/dist/common/roles/components/index.js +2 -0
- package/dist/common/roles/components/index.js.map +1 -0
- package/dist/{auth0/core/components → common/roles/components/role-editor-form}/role-dialog.d.ts +1 -1
- package/dist/common/roles/components/role-editor-form/role-dialog.d.ts.map +1 -0
- package/dist/{auth0/core/components → common/roles/components/role-editor-form}/role-dialog.js +3 -1
- package/dist/common/roles/components/role-editor-form/role-dialog.js.map +1 -0
- package/dist/common/roles/components/role-editor-form/role-editor-form.d.ts +10 -0
- package/dist/common/roles/components/role-editor-form/role-editor-form.d.ts.map +1 -0
- package/dist/{auth0/core/components → common/roles/components/role-editor-form}/role-editor-form.js +5 -8
- package/dist/common/roles/components/role-editor-form/role-editor-form.js.map +1 -0
- package/dist/common/roles/constants.d.ts.map +1 -0
- package/dist/common/roles/constants.js.map +1 -0
- package/dist/common/roles/index.d.ts +4 -0
- package/dist/common/roles/index.d.ts.map +1 -0
- package/dist/common/roles/index.js +4 -0
- package/dist/common/roles/index.js.map +1 -0
- package/dist/{roles → common/roles}/schema.d.ts +29 -10
- package/dist/common/roles/schema.d.ts.map +1 -0
- package/dist/{roles → common/roles}/schema.js +7 -6
- package/dist/common/roles/schema.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/placeholder-auth/core/common.d.ts +8 -0
- package/dist/placeholder-auth/core/common.d.ts.map +1 -0
- package/dist/placeholder-auth/core/common.js +26 -0
- package/dist/placeholder-auth/core/common.js.map +1 -0
- package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.d.ts +5 -0
- package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.d.ts.map +1 -0
- package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.js +58 -0
- package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.js.map +1 -0
- package/dist/placeholder-auth/core/generators/index.d.ts +4 -0
- package/dist/placeholder-auth/core/generators/index.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/index.js +4 -0
- package/dist/placeholder-auth/core/generators/index.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.d.ts +51 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.js +11 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.d.ts +16 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.js +28 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.d.ts +24 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.js +46 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.d.ts +16 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.js +27 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.d.ts +24 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.js +68 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/index.d.ts +2 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/index.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/index.js +2 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/index.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.d.ts +39 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.js +38 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.d.ts +14 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.gql +10 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.js +23 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.ts +35 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-log-out.d.ts +5 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-log-out.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-log-out.js +8 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-log-out.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-log-out.ts +8 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-session.d.ts +9 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-session.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-session.js +8 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-session.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-session.ts +13 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts +5 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-user-id-or-throw.js +13 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-user-id-or-throw.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-user-id-or-throw.ts +14 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/auth-module.generator.d.ts +45 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/auth-module.generator.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/auth-module.generator.js +27 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/auth-module.generator.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.d.ts +75 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.js +11 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-paths.d.ts +12 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-paths.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-paths.js +24 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-paths.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.d.ts +39 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.js +41 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.js.map +1 -0
- package/dist/{auth/generators/fastify/auth-module → placeholder-auth/core/generators/placeholder-auth-module}/generated/ts-import-providers.d.ts +2 -2
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/{auth/generators/fastify/auth-module → placeholder-auth/core/generators/placeholder-auth-module}/generated/ts-import-providers.js +5 -5
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/ts-import-providers.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.d.ts +26 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.js +20 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/index.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/index.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.d.ts +23 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.js +29 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.ts +41 -0
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/index.d.ts +2 -0
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/index.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/index.js +2 -0
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/index.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/react-auth.generator.d.ts +9 -0
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/react-auth.generator.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/react-auth.generator.js +31 -0
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/react-auth.generator.js.map +1 -0
- package/dist/placeholder-auth/core/index.d.ts +2 -0
- package/dist/placeholder-auth/core/index.d.ts.map +1 -0
- package/dist/placeholder-auth/core/index.js +2 -0
- package/dist/placeholder-auth/core/index.js.map +1 -0
- package/dist/placeholder-auth/core/node.d.ts +5 -0
- package/dist/placeholder-auth/core/node.d.ts.map +1 -0
- package/dist/placeholder-auth/core/node.js +46 -0
- package/dist/placeholder-auth/core/node.js.map +1 -0
- package/dist/placeholder-auth/core/schema/models.d.ts +6 -0
- package/dist/placeholder-auth/core/schema/models.d.ts.map +1 -0
- package/dist/placeholder-auth/core/schema/models.js +35 -0
- package/dist/placeholder-auth/core/schema/models.js.map +1 -0
- package/dist/placeholder-auth/core/schema/plugin-definition.d.ts +82 -0
- package/dist/placeholder-auth/core/schema/plugin-definition.d.ts.map +1 -0
- package/dist/placeholder-auth/core/schema/plugin-definition.js +17 -0
- package/dist/placeholder-auth/core/schema/plugin-definition.js.map +1 -0
- package/dist/placeholder-auth/core/web.d.ts +6 -0
- package/dist/placeholder-auth/core/web.d.ts.map +1 -0
- package/dist/placeholder-auth/core/web.js +14 -0
- package/dist/placeholder-auth/core/web.js.map +1 -0
- package/dist/placeholder-auth/index.d.ts +2 -0
- package/dist/placeholder-auth/index.d.ts.map +1 -0
- package/dist/placeholder-auth/index.js +2 -0
- package/dist/placeholder-auth/index.js.map +1 -0
- package/dist/placeholder-auth/metadata.json +9 -0
- package/dist/placeholder-auth/static/icon.svg +1 -0
- package/dist/web/assets/{__federation_expose_auth0CoreCommon-BE50qa2_.js → __federation_expose_auth0CoreCommon-ClLdXltM.js} +4 -4
- package/dist/web/assets/__federation_expose_auth0CoreCommon-ClLdXltM.js.map +1 -0
- package/dist/web/assets/__federation_expose_auth0CoreWeb-n4O5Eaci.js +201 -0
- package/dist/web/assets/__federation_expose_auth0CoreWeb-n4O5Eaci.js.map +1 -0
- package/dist/web/assets/{__federation_expose_authCoreCommon-DKyLSPCa.js → __federation_expose_authCoreCommon-DnPBC3Po.js} +4 -4
- package/dist/web/assets/__federation_expose_authCoreCommon-DnPBC3Po.js.map +1 -0
- package/dist/web/assets/{__federation_expose_authCoreWeb-CfCyOvUk.js → __federation_expose_authCoreWeb-xIZTC0Jm.js} +53 -94
- package/dist/web/assets/__federation_expose_authCoreWeb-xIZTC0Jm.js.map +1 -0
- package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-B3uMizrx.js +39 -0
- package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-B3uMizrx.js.map +1 -0
- package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-B_PIacU8.js +197 -0
- package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-B_PIacU8.js.map +1 -0
- package/dist/web/assets/{__federation_fn_import-CxP86CUK.js → __federation_fn_import-CktB8mRs.js} +2 -2
- package/dist/web/assets/{__federation_fn_import-CxP86CUK.js.map → __federation_fn_import-CktB8mRs.js.map} +1 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-BFCvL5ku.js → web-CX2RIWJk.js} +12 -12
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-CX2RIWJk.js.map +1 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/{project-builder-lib-BAwM_-SS.js → project-builder-lib-CScAnw0t.js} +615 -261
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-CScAnw0t.js.map +1 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/{ui-components-C3uzqK6u.js → ui-components-sv0OhmFj.js} +2970 -16
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-sv0OhmFj.js.map +1 -0
- package/dist/web/assets/{index-scyXBD_d.js → index-C1wLMBlv.js} +2 -2
- package/dist/web/assets/{index-scyXBD_d.js.map → index-C1wLMBlv.js.map} +1 -1
- package/dist/web/assets/{index.esm-DIgRm3lq.js → index.esm-CGKugQk7.js} +90 -47
- package/dist/web/assets/index.esm-CGKugQk7.js.map +1 -0
- package/dist/web/assets/{model-merger-gxuB007n.js → model-merger-DYdmgijL.js} +181 -546
- package/dist/web/assets/model-merger-DYdmgijL.js.map +1 -0
- package/dist/web/assets/plugin-definition-BRtH1ZCf.js +24 -0
- package/dist/web/assets/plugin-definition-BRtH1ZCf.js.map +1 -0
- package/dist/web/assets/plugin-definition-DSr4dqJI.js +36 -0
- package/dist/web/assets/plugin-definition-DSr4dqJI.js.map +1 -0
- package/dist/web/assets/plugin-definition-DkPo-aBg.js +24 -0
- package/dist/web/assets/plugin-definition-DkPo-aBg.js.map +1 -0
- package/dist/web/assets/{react-CAuz_DuX.js → react-S9chR6jh.js} +2 -2
- package/dist/web/assets/{react-CAuz_DuX.js.map → react-S9chR6jh.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/role-editor-form-BbHZ0ofl.js +319 -0
- package/dist/web/assets/role-editor-form-BbHZ0ofl.js.map +1 -0
- package/dist/web/assets/{style-BdgwWjAf.css → style-ZUYizAnf.css} +9 -11
- package/dist/web/assets/styles-Bqxfz3Ig.js +201 -0
- package/dist/web/assets/styles-Bqxfz3Ig.js.map +1 -0
- package/dist/web/index.html +1 -1
- package/manifest.json +1 -1
- package/package.json +12 -11
- package/dist/auth/core/components/role-editor-form.d.ts +0 -10
- package/dist/auth/core/components/role-editor-form.d.ts.map +0 -1
- package/dist/auth/core/components/role-editor-form.js +0 -27
- package/dist/auth/core/components/role-editor-form.js.map +0 -1
- package/dist/auth/generators/fastify/auth-module/auth-module.generator.d.ts.map +0 -1
- package/dist/auth/generators/fastify/auth-module/auth-module.generator.js +0 -74
- package/dist/auth/generators/fastify/auth-module/auth-module.generator.js.map +0 -1
- package/dist/auth/generators/fastify/auth-module/generated/index.d.ts +0 -88
- package/dist/auth/generators/fastify/auth-module/generated/index.d.ts.map +0 -1
- package/dist/auth/generators/fastify/auth-module/generated/index.js +0 -9
- package/dist/auth/generators/fastify/auth-module/generated/index.js.map +0 -1
- package/dist/auth/generators/fastify/auth-module/generated/template-paths.d.ts +0 -16
- package/dist/auth/generators/fastify/auth-module/generated/template-paths.d.ts.map +0 -1
- package/dist/auth/generators/fastify/auth-module/generated/template-paths.js.map +0 -1
- package/dist/auth/generators/fastify/auth-module/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/auth/generators/fastify/auth-module/generated/ts-import-providers.js.map +0 -1
- package/dist/auth/generators/fastify/auth-module/generated/typed-templates.d.ts.map +0 -1
- package/dist/auth/generators/fastify/auth-module/generated/typed-templates.js.map +0 -1
- package/dist/auth/generators/fastify/auth-module/index.d.ts.map +0 -1
- package/dist/auth/generators/fastify/auth-module/index.js.map +0 -1
- package/dist/auth/generators/fastify/index.d.ts +0 -2
- package/dist/auth/generators/fastify/index.d.ts.map +0 -1
- package/dist/auth/generators/fastify/index.js +0 -2
- package/dist/auth/generators/fastify/index.js.map +0 -1
- package/dist/auth/generators/index.d.ts +0 -2
- package/dist/auth/generators/index.d.ts.map +0 -1
- package/dist/auth/generators/index.js +0 -2
- package/dist/auth/generators/index.js.map +0 -1
- package/dist/auth0/core/components/role-dialog.d.ts.map +0 -1
- package/dist/auth0/core/components/role-dialog.js.map +0 -1
- package/dist/auth0/core/components/role-editor-form.d.ts +0 -10
- package/dist/auth0/core/components/role-editor-form.d.ts.map +0 -1
- package/dist/auth0/core/components/role-editor-form.js.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.js +0 -58
- package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.js.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/generated/index.js +0 -7
- package/dist/auth0/generators/react/auth0-callback/generated/index.js.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/generated/template-paths.d.ts +0 -13
- package/dist/auth0/generators/react/auth0-callback/generated/template-paths.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/generated/template-paths.js +0 -23
- package/dist/auth0/generators/react/auth0-callback/generated/template-paths.js.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/generated/typed-templates.d.ts +0 -280
- package/dist/auth0/generators/react/auth0-callback/generated/typed-templates.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/generated/typed-templates.js +0 -30
- package/dist/auth0/generators/react/auth0-callback/generated/typed-templates.js.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/index.d.ts +0 -2
- package/dist/auth0/generators/react/auth0-callback/index.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/index.js +0 -2
- package/dist/auth0/generators/react/auth0-callback/index.js.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/templates/routes/auth0-callback.page.tsx +0 -61
- package/dist/auth0/generators/react/auth0-callback/templates/routes/signup.page.tsx +0 -48
- package/dist/auth0/generators/react/auth0-components/auth0-components.generator.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-components/auth0-components.generator.js +0 -40
- package/dist/auth0/generators/react/auth0-components/auth0-components.generator.js.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/index.d.ts +0 -151
- package/dist/auth0/generators/react/auth0-components/generated/index.js +0 -9
- package/dist/auth0/generators/react/auth0-components/generated/index.js.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/template-paths.d.ts +0 -12
- package/dist/auth0/generators/react/auth0-components/generated/template-paths.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/template-paths.js +0 -22
- package/dist/auth0/generators/react/auth0-components/generated/template-paths.js.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-providers.d.ts +0 -10
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-providers.js +0 -25
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-providers.js.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/typed-templates.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/typed-templates.js.map +0 -1
- package/dist/auth0/generators/react/auth0-components/index.d.ts +0 -2
- package/dist/auth0/generators/react/auth0-components/index.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-components/index.js +0 -2
- package/dist/auth0/generators/react/auth0-components/index.js.map +0 -1
- package/dist/auth0/generators/react/auth0-components/templates/src/components/require-auth/require-auth.tsx +0 -22
- package/dist/roles/constants.d.ts.map +0 -1
- package/dist/roles/constants.js.map +0 -1
- package/dist/roles/index.d.ts +0 -3
- package/dist/roles/index.d.ts.map +0 -1
- package/dist/roles/index.js +0 -3
- package/dist/roles/index.js.map +0 -1
- package/dist/roles/schema.d.ts.map +0 -1
- package/dist/roles/schema.js.map +0 -1
- package/dist/utils/cn.d.ts +0 -2
- package/dist/utils/cn.d.ts.map +0 -1
- package/dist/utils/cn.js +0 -2
- package/dist/utils/cn.js.map +0 -1
- package/dist/web/assets/__federation_expose_auth0CoreCommon-BE50qa2_.js.map +0 -1
- package/dist/web/assets/__federation_expose_auth0CoreWeb-AdDVCP7O.js +0 -381
- package/dist/web/assets/__federation_expose_auth0CoreWeb-AdDVCP7O.js.map +0 -1
- package/dist/web/assets/__federation_expose_authCoreCommon-DKyLSPCa.js.map +0 -1
- package/dist/web/assets/__federation_expose_authCoreWeb-CfCyOvUk.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-BFCvL5ku.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-BAwM_-SS.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-C3uzqK6u.js.map +0 -1
- package/dist/web/assets/index.esm-DIgRm3lq.js.map +0 -1
- package/dist/web/assets/model-merger-gxuB007n.js.map +0 -1
- package/dist/web/assets/plugin-definition-Bgi_XH0-.js +0 -22
- package/dist/web/assets/plugin-definition-Bgi_XH0-.js.map +0 -1
- package/dist/web/assets/plugin-definition-EtIvYJxn.js +0 -34
- package/dist/web/assets/plugin-definition-EtIvYJxn.js.map +0 -1
- package/dist/web/assets/schema-BAfRBwYE.js +0 -67
- package/dist/web/assets/schema-BAfRBwYE.js.map +0 -1
- package/dist/web/assets/styles-BpKIyKWd.js +0 -8
- package/dist/web/assets/styles-BpKIyKWd.js.map +0 -1
- /package/dist/auth/{generators/fastify → core/generators}/auth-module/templates/module/constants/user-session.constants.ts +0 -0
- /package/dist/auth/{generators/fastify → core/generators}/auth-module/templates/module/utils/cookie-signer.ts +0 -0
- /package/dist/auth/{generators/fastify → core/generators}/auth-module/templates/module/utils/verify-request-origin.ts +0 -0
- /package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/{useCurrentUser.gql → use-current-user.gql} +0 -0
- /package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/{useLogOut.ts → use-log-out.ts} +0 -0
- /package/dist/{roles → common/roles}/constants.d.ts +0 -0
- /package/dist/{roles → common/roles}/constants.js +0 -0
- /package/dist/{auth/generators/fastify/auth-module → placeholder-auth/core/generators/placeholder-auth-module}/index.d.ts +0 -0
- /package/dist/{auth/generators/fastify/auth-module → placeholder-auth/core/generators/placeholder-auth-module}/index.js +0 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { importShared } from './__federation_fn_import-CktB8mRs.js';
|
|
2
|
+
import { g as get, s as set, c as appendErrors, d as useFieldArray$1, a as useForm, j as jsxRuntimeExports, e as useWatch } from './index.esm-CGKugQk7.js';
|
|
3
|
+
import { n as MdEdit, o as MdDeleteOutline, p as MdAdd } from './index-C1wLMBlv.js';
|
|
4
|
+
|
|
5
|
+
const r=(t,r,o)=>{if(t&&"reportValidity"in t){const s=get(o,r);t.setCustomValidity(s&&s.message||""),t.reportValidity();}},o=(e,t)=>{for(const o in t.fields){const s=t.fields[o];s&&s.ref&&"reportValidity"in s.ref?r(s.ref,o,e):s&&s.refs&&s.refs.forEach(t=>r(t,o,e));}},s$1=(r,s)=>{s.shouldUseNativeValidation&&o(r,s);const n={};for(const o in r){const f=get(s.fields,o),c=Object.assign(r[o]||{},{ref:f&&f.ref});if(i(s.names||Object.keys(r),o)){const r=Object.assign({},get(n,o));set(r,"root",c),set(n,o,r);}else set(n,o,c);}return n},i=(e,t)=>{const r=n$1(t);return e.some(e=>n$1(e).match(`^${r}\\.\\d+`))};function n$1(e){return e.replace(/\]|\[/g,"")}
|
|
6
|
+
|
|
7
|
+
function n(r,e){for(var n={};r.length;){var s=r[0],t=s.code,i=s.message,a=s.path.join(".");if(!n[a])if("unionErrors"in s){var u=s.unionErrors[0].errors[0];n[a]={message:u.message,type:u.code};}else n[a]={message:i,type:t};if("unionErrors"in s&&s.unionErrors.forEach(function(e){return e.errors.forEach(function(e){return r.push(e)})}),e){var c=n[a].types,f=c&&c[s.code];n[a]=appendErrors(a,e,n,t,f?[].concat(f,s.message):s.message);}r.shift();}return n}function s(o$1,s,t){return void 0===t&&(t={}),function(i,a,u){try{return Promise.resolve(function(e,n){try{var a=Promise.resolve(o$1["sync"===t.mode?"parse":"parseAsync"](i,s)).then(function(e){return u.shouldUseNativeValidation&&o({},u),{errors:{},values:t.raw?Object.assign({},i):e}});}catch(r){return n(r)}return a&&a.then?a.then(void 0,n):a}(0,function(r){if(function(r){return Array.isArray(null==r?void 0:r.errors)}(r))return {values:{},errors:s$1(n(r.errors,!u.shouldUseNativeValidation&&"all"===u.criteriaMode),u)};throw r}))}catch(r){return Promise.reject(r)}}}
|
|
8
|
+
|
|
9
|
+
// src/rhf/useFieldArray.ts
|
|
10
|
+
const {useMemo} = await importShared('react');
|
|
11
|
+
function useFieldArray(props) {
|
|
12
|
+
const original = useFieldArray$1(props);
|
|
13
|
+
const newFields = useMemo(() => {
|
|
14
|
+
if (!props.getTransformer) {
|
|
15
|
+
return original.fields;
|
|
16
|
+
}
|
|
17
|
+
return original.fields.map(props.getTransformer);
|
|
18
|
+
}, [original.fields, props.getTransformer]);
|
|
19
|
+
return {
|
|
20
|
+
fields: newFields,
|
|
21
|
+
move: original.move,
|
|
22
|
+
remove: original.remove,
|
|
23
|
+
swap: original.swap,
|
|
24
|
+
prepend: (value, options) => {
|
|
25
|
+
if (!props.setTransformer) {
|
|
26
|
+
return original.prepend(value, options);
|
|
27
|
+
}
|
|
28
|
+
const newValue = Array.isArray(value) ? value.map(props.setTransformer) : props.setTransformer(value);
|
|
29
|
+
original.prepend(newValue, options);
|
|
30
|
+
},
|
|
31
|
+
append: (value, options) => {
|
|
32
|
+
if (!props.setTransformer) {
|
|
33
|
+
return original.append(value, options);
|
|
34
|
+
}
|
|
35
|
+
const newValue = Array.isArray(value) ? value.map(props.setTransformer) : props.setTransformer(value);
|
|
36
|
+
original.append(newValue, options);
|
|
37
|
+
},
|
|
38
|
+
insert: (index, value, options) => {
|
|
39
|
+
if (!props.setTransformer) {
|
|
40
|
+
return original.insert(index, value, options);
|
|
41
|
+
}
|
|
42
|
+
const newValue = Array.isArray(value) ? value.map(props.setTransformer) : props.setTransformer(value);
|
|
43
|
+
original.insert(index, newValue, options);
|
|
44
|
+
},
|
|
45
|
+
update: (index, value) => {
|
|
46
|
+
if (!props.setTransformer) {
|
|
47
|
+
return original.update(index, value);
|
|
48
|
+
}
|
|
49
|
+
const newValue = props.setTransformer(value);
|
|
50
|
+
original.update(index, newValue);
|
|
51
|
+
},
|
|
52
|
+
replace: (value) => {
|
|
53
|
+
if (!props.setTransformer) {
|
|
54
|
+
return original.replace(value);
|
|
55
|
+
}
|
|
56
|
+
const newValue = props.setTransformer(value);
|
|
57
|
+
original.replace(newValue);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const {authRoleEntityType: authRoleEntityType$2} = await importShared('@baseplate-dev/project-builder-lib');
|
|
63
|
+
|
|
64
|
+
const AUTH_DEFAULT_ROLES = [
|
|
65
|
+
{
|
|
66
|
+
name: "public",
|
|
67
|
+
comment: "All users (including unauthenticated and authenticated users)",
|
|
68
|
+
builtIn: true
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "user",
|
|
72
|
+
comment: "All authenticated users",
|
|
73
|
+
builtIn: true
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "system",
|
|
77
|
+
comment: "System processes without a user context, e.g. background jobs",
|
|
78
|
+
builtIn: true
|
|
79
|
+
}
|
|
80
|
+
];
|
|
81
|
+
function createDefaultAuthRoles() {
|
|
82
|
+
return AUTH_DEFAULT_ROLES.map((role) => ({
|
|
83
|
+
...role,
|
|
84
|
+
id: authRoleEntityType$2.generateNewId()
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const {authRoleEntityType: authRoleEntityType$1,definitionSchema} = await importShared('@baseplate-dev/project-builder-lib');
|
|
89
|
+
|
|
90
|
+
const {z} = await importShared('zod');
|
|
91
|
+
const createAuthRoleSchema = definitionSchema(
|
|
92
|
+
(ctx) => ctx.withEnt(
|
|
93
|
+
z.object({
|
|
94
|
+
id: z.string(),
|
|
95
|
+
name: z.string().min(1),
|
|
96
|
+
comment: z.string().min(1),
|
|
97
|
+
builtIn: z.boolean().default(false)
|
|
98
|
+
}),
|
|
99
|
+
{ type: authRoleEntityType$1 }
|
|
100
|
+
)
|
|
101
|
+
);
|
|
102
|
+
const createAuthRolesSchema = definitionSchema(
|
|
103
|
+
(ctx) => z.array(createAuthRoleSchema(ctx)).superRefine((roles, ctx2) => {
|
|
104
|
+
const dup = roles.map((r) => r.name).filter((v, i, a) => a.indexOf(v) !== i);
|
|
105
|
+
if (dup.length > 0) {
|
|
106
|
+
ctx2.addIssue({
|
|
107
|
+
code: z.ZodIssueCode.custom,
|
|
108
|
+
message: `Duplicate role name(s): ${dup.join(", ")}`
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}).transform((roles) => [
|
|
112
|
+
...AUTH_DEFAULT_ROLES.map((r) => {
|
|
113
|
+
const existingRole = roles.find((role) => role.name === r.name);
|
|
114
|
+
return existingRole ? {
|
|
115
|
+
...existingRole,
|
|
116
|
+
builtIn: true
|
|
117
|
+
} : {
|
|
118
|
+
...r,
|
|
119
|
+
builtIn: true,
|
|
120
|
+
id: authRoleEntityType$1.generateNewId()
|
|
121
|
+
};
|
|
122
|
+
}),
|
|
123
|
+
// Filter out the built-in roles
|
|
124
|
+
...roles.filter(
|
|
125
|
+
(r) => !AUTH_DEFAULT_ROLES.map((v) => v.name).includes(r.name)
|
|
126
|
+
)
|
|
127
|
+
])
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
const {useDefinitionSchema} = await importShared('@baseplate-dev/project-builder-lib/web');
|
|
131
|
+
|
|
132
|
+
const {Button: Button$1,Dialog,DialogContent,DialogDescription,DialogFooter,DialogHeader,DialogTitle,DialogTrigger,InputFieldController} = await importShared('@baseplate-dev/ui-components');
|
|
133
|
+
const {useId} = await importShared('react');
|
|
134
|
+
function RoleDialog({
|
|
135
|
+
open,
|
|
136
|
+
onOpenChange,
|
|
137
|
+
role,
|
|
138
|
+
isNew = false,
|
|
139
|
+
onSave,
|
|
140
|
+
asChild,
|
|
141
|
+
children
|
|
142
|
+
}) {
|
|
143
|
+
const authRoleSchema = useDefinitionSchema(createAuthRoleSchema);
|
|
144
|
+
const form = useForm({
|
|
145
|
+
resolver: s(authRoleSchema),
|
|
146
|
+
values: role
|
|
147
|
+
});
|
|
148
|
+
const { control, handleSubmit } = form;
|
|
149
|
+
const onSubmit = handleSubmit((data) => {
|
|
150
|
+
onSave(data);
|
|
151
|
+
onOpenChange?.(false);
|
|
152
|
+
});
|
|
153
|
+
const formId = useId();
|
|
154
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Dialog, { open, onOpenChange, children: [
|
|
155
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(DialogTrigger, { asChild, children }),
|
|
156
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(DialogContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
157
|
+
"form",
|
|
158
|
+
{
|
|
159
|
+
id: formId,
|
|
160
|
+
onSubmit: (e) => {
|
|
161
|
+
e.stopPropagation();
|
|
162
|
+
return onSubmit(e);
|
|
163
|
+
},
|
|
164
|
+
children: [
|
|
165
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(DialogHeader, { children: [
|
|
166
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { children: isNew ? "Add Role" : "Edit Role" }),
|
|
167
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(DialogDescription, { children: isNew ? "Enter the details for the new role." : "Update the role details below." })
|
|
168
|
+
] }),
|
|
169
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "auth:space-y-4 auth:py-4", children: [
|
|
170
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
171
|
+
InputFieldController,
|
|
172
|
+
{
|
|
173
|
+
label: "Role Name",
|
|
174
|
+
name: "name",
|
|
175
|
+
control,
|
|
176
|
+
placeholder: "Enter role name"
|
|
177
|
+
}
|
|
178
|
+
),
|
|
179
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
180
|
+
InputFieldController,
|
|
181
|
+
{
|
|
182
|
+
label: "Description",
|
|
183
|
+
name: "comment",
|
|
184
|
+
control,
|
|
185
|
+
placeholder: "Describe this role's purpose"
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
] }),
|
|
189
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(DialogFooter, { children: [
|
|
190
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
191
|
+
Button$1,
|
|
192
|
+
{
|
|
193
|
+
type: "button",
|
|
194
|
+
variant: "outline",
|
|
195
|
+
onClick: () => {
|
|
196
|
+
onOpenChange?.(false);
|
|
197
|
+
},
|
|
198
|
+
children: "Cancel"
|
|
199
|
+
}
|
|
200
|
+
),
|
|
201
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button$1, { form: formId, type: "submit", children: [
|
|
202
|
+
isNew ? "Add" : "Update",
|
|
203
|
+
" Role"
|
|
204
|
+
] })
|
|
205
|
+
] })
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
) })
|
|
209
|
+
] });
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const {authRoleEntityType} = await importShared('@baseplate-dev/project-builder-lib');
|
|
213
|
+
|
|
214
|
+
const {Badge,Button,RecordView,RecordViewActions,RecordViewItem,RecordViewItemList,SectionListSection,SectionListSectionContent,SectionListSectionDescription,SectionListSectionHeader,SectionListSectionTitle,useConfirmDialog} = await importShared('@baseplate-dev/ui-components');
|
|
215
|
+
const {useState} = await importShared('react');
|
|
216
|
+
function RoleEditorForm({ className, lens }) {
|
|
217
|
+
const { requestConfirm } = useConfirmDialog();
|
|
218
|
+
const { append, update, remove } = useFieldArray(lens.interop());
|
|
219
|
+
const [roleToEdit, setRoleToEdit] = useState();
|
|
220
|
+
const [isEditing, setIsEditing] = useState(false);
|
|
221
|
+
const roles = useWatch(lens.interop());
|
|
222
|
+
function handleSaveRole(newRole) {
|
|
223
|
+
const existingIndex = roles.findIndex((role) => role.id === newRole.id);
|
|
224
|
+
if (existingIndex === -1) {
|
|
225
|
+
append(newRole);
|
|
226
|
+
} else {
|
|
227
|
+
update(existingIndex, newRole);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function handleDeleteRole(roleIdx) {
|
|
231
|
+
const role = roles[roleIdx];
|
|
232
|
+
requestConfirm({
|
|
233
|
+
title: "Delete Role",
|
|
234
|
+
content: `Are you sure you want to delete the role "${role.name}"?`,
|
|
235
|
+
onConfirm: () => {
|
|
236
|
+
remove(roleIdx);
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionListSection, { className, children: [
|
|
241
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(SectionListSectionHeader, { children: [
|
|
242
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionListSectionTitle, { children: "User Roles" }),
|
|
243
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionListSectionDescription, { children: "Define roles for your application. Default roles are protected and cannot be removed." })
|
|
244
|
+
] }),
|
|
245
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(SectionListSectionContent, { className: "auth:space-y-4", children: [
|
|
246
|
+
roles.map((role, roleIdx) => /* @__PURE__ */ jsxRuntimeExports.jsxs(RecordView, { children: [
|
|
247
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(RecordViewItemList, { children: [
|
|
248
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(RecordViewItem, { title: "Name", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "auth:flex auth:items-center auth:gap-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: role.name }) }) }),
|
|
249
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(RecordViewItem, { title: "Description", children: role.comment.trim() || /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "auth:text-muted-foreground", children: "No description" }) })
|
|
250
|
+
] }),
|
|
251
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(RecordViewActions, { children: [
|
|
252
|
+
role.builtIn && /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { variant: "secondary", children: "Default Role" }),
|
|
253
|
+
!role.builtIn && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
254
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
255
|
+
Button,
|
|
256
|
+
{
|
|
257
|
+
variant: "ghost",
|
|
258
|
+
size: "icon",
|
|
259
|
+
title: "Edit",
|
|
260
|
+
"aria-label": "Edit role",
|
|
261
|
+
onClick: () => {
|
|
262
|
+
setRoleToEdit(role);
|
|
263
|
+
setIsEditing(true);
|
|
264
|
+
},
|
|
265
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(MdEdit, {})
|
|
266
|
+
}
|
|
267
|
+
),
|
|
268
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
269
|
+
Button,
|
|
270
|
+
{
|
|
271
|
+
variant: "ghostDestructive",
|
|
272
|
+
size: "icon",
|
|
273
|
+
title: "Delete",
|
|
274
|
+
"aria-label": "Delete role",
|
|
275
|
+
onClick: () => {
|
|
276
|
+
handleDeleteRole(roleIdx);
|
|
277
|
+
},
|
|
278
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(MdDeleteOutline, {})
|
|
279
|
+
}
|
|
280
|
+
)
|
|
281
|
+
] })
|
|
282
|
+
] })
|
|
283
|
+
] }, role.id)),
|
|
284
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
285
|
+
RoleDialog,
|
|
286
|
+
{
|
|
287
|
+
open: isEditing,
|
|
288
|
+
onOpenChange: setIsEditing,
|
|
289
|
+
role: roleToEdit,
|
|
290
|
+
isNew: roleToEdit ? !roles.some((r) => r.id === roleToEdit.id) : true,
|
|
291
|
+
onSave: handleSaveRole
|
|
292
|
+
}
|
|
293
|
+
),
|
|
294
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
295
|
+
Button,
|
|
296
|
+
{
|
|
297
|
+
variant: "secondary",
|
|
298
|
+
size: "sm",
|
|
299
|
+
onClick: () => {
|
|
300
|
+
setRoleToEdit({
|
|
301
|
+
id: authRoleEntityType.generateNewId(),
|
|
302
|
+
name: "",
|
|
303
|
+
comment: "",
|
|
304
|
+
builtIn: false
|
|
305
|
+
});
|
|
306
|
+
setIsEditing(true);
|
|
307
|
+
},
|
|
308
|
+
children: [
|
|
309
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(MdAdd, {}),
|
|
310
|
+
"Add Role"
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
)
|
|
314
|
+
] })
|
|
315
|
+
] });
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export { AUTH_DEFAULT_ROLES as A, RoleEditorForm as R, createAuthRolesSchema as a, createDefaultAuthRoles as c, s };
|
|
319
|
+
//# sourceMappingURL=role-editor-form-BbHZ0ofl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"role-editor-form-BbHZ0ofl.js","sources":["../../../../../node_modules/.pnpm/@hookform+resolvers@5.0.1_react-hook-form@7.60.0_react@19.1.0_/node_modules/@hookform/resolvers/dist/resolvers.mjs","../../../../../node_modules/.pnpm/@hookform+resolvers@5.0.1_react-hook-form@7.60.0_react@19.1.0_/node_modules/@hookform/resolvers/zod/dist/zod.mjs","../../../../../node_modules/.pnpm/@hookform+lenses@0.7.1_react-hook-form@7.60.0_react@19.1.0__react@19.1.0/node_modules/@hookform/lenses/dist/rhf/index.js","../../../src/common/roles/constants.ts","../../../src/common/roles/schema.ts","../../../src/common/roles/components/role-editor-form/role-dialog.tsx","../../../src/common/roles/components/role-editor-form/role-editor-form.tsx"],"sourcesContent":["import{get as e,set as t}from\"react-hook-form\";const r=(t,r,o)=>{if(t&&\"reportValidity\"in t){const s=e(o,r);t.setCustomValidity(s&&s.message||\"\"),t.reportValidity()}},o=(e,t)=>{for(const o in t.fields){const s=t.fields[o];s&&s.ref&&\"reportValidity\"in s.ref?r(s.ref,o,e):s&&s.refs&&s.refs.forEach(t=>r(t,o,e))}},s=(r,s)=>{s.shouldUseNativeValidation&&o(r,s);const n={};for(const o in r){const f=e(s.fields,o),c=Object.assign(r[o]||{},{ref:f&&f.ref});if(i(s.names||Object.keys(r),o)){const r=Object.assign({},e(n,o));t(r,\"root\",c),t(n,o,r)}else t(n,o,c)}return n},i=(e,t)=>{const r=n(t);return e.some(e=>n(e).match(`^${r}\\\\.\\\\d+`))};function n(e){return e.replace(/\\]|\\[/g,\"\")}export{s as toNestErrors,o as validateFieldsNatively};\n//# sourceMappingURL=resolvers.mjs.map\n","import{validateFieldsNatively as r,toNestErrors as e}from\"@hookform/resolvers\";import{appendErrors as o}from\"react-hook-form\";function n(r,e){for(var n={};r.length;){var s=r[0],t=s.code,i=s.message,a=s.path.join(\".\");if(!n[a])if(\"unionErrors\"in s){var u=s.unionErrors[0].errors[0];n[a]={message:u.message,type:u.code}}else n[a]={message:i,type:t};if(\"unionErrors\"in s&&s.unionErrors.forEach(function(e){return e.errors.forEach(function(e){return r.push(e)})}),e){var c=n[a].types,f=c&&c[s.code];n[a]=o(a,e,n,t,f?[].concat(f,s.message):s.message)}r.shift()}return n}function s(o,s,t){return void 0===t&&(t={}),function(i,a,u){try{return Promise.resolve(function(e,n){try{var a=Promise.resolve(o[\"sync\"===t.mode?\"parse\":\"parseAsync\"](i,s)).then(function(e){return u.shouldUseNativeValidation&&r({},u),{errors:{},values:t.raw?Object.assign({},i):e}})}catch(r){return n(r)}return a&&a.then?a.then(void 0,n):a}(0,function(r){if(function(r){return Array.isArray(null==r?void 0:r.errors)}(r))return{values:{},errors:e(n(r.errors,!u.shouldUseNativeValidation&&\"all\"===u.criteriaMode),u)};throw r}))}catch(r){return Promise.reject(r)}}}export{s as zodResolver};\n//# sourceMappingURL=zod.module.js.map\n","// src/rhf/useFieldArray.ts\nimport { useMemo } from \"react\";\nimport {\n useFieldArray as useFieldArrayOriginal\n} from \"react-hook-form\";\nfunction useFieldArray(props) {\n const original = useFieldArrayOriginal(props);\n const newFields = useMemo(() => {\n if (!props.getTransformer) {\n return original.fields;\n }\n return original.fields.map(props.getTransformer);\n }, [original.fields, props.getTransformer]);\n return {\n fields: newFields,\n move: original.move,\n remove: original.remove,\n swap: original.swap,\n prepend: (value, options) => {\n if (!props.setTransformer) {\n return original.prepend(value, options);\n }\n const newValue = Array.isArray(value) ? value.map(props.setTransformer) : props.setTransformer(value);\n original.prepend(newValue, options);\n },\n append: (value, options) => {\n if (!props.setTransformer) {\n return original.append(value, options);\n }\n const newValue = Array.isArray(value) ? value.map(props.setTransformer) : props.setTransformer(value);\n original.append(newValue, options);\n },\n insert: (index, value, options) => {\n if (!props.setTransformer) {\n return original.insert(index, value, options);\n }\n const newValue = Array.isArray(value) ? value.map(props.setTransformer) : props.setTransformer(value);\n original.insert(index, newValue, options);\n },\n update: (index, value) => {\n if (!props.setTransformer) {\n return original.update(index, value);\n }\n const newValue = props.setTransformer(value);\n original.update(index, newValue);\n },\n replace: (value) => {\n if (!props.setTransformer) {\n return original.replace(value);\n }\n const newValue = props.setTransformer(value);\n original.replace(newValue);\n }\n };\n}\nexport {\n useFieldArray\n};\n//# sourceMappingURL=index.js.map","import { authRoleEntityType } from '@baseplate-dev/project-builder-lib';\n\nimport type { AuthRoleDefinition } from './schema.js';\n\nexport const AUTH_DEFAULT_ROLES: Omit<AuthRoleDefinition, 'id'>[] = [\n {\n name: 'public',\n comment: 'All users (including unauthenticated and authenticated users)',\n builtIn: true,\n },\n {\n name: 'user',\n comment: 'All authenticated users',\n builtIn: true,\n },\n {\n name: 'system',\n comment: 'System processes without a user context, e.g. background jobs',\n builtIn: true,\n },\n];\n\nexport function createDefaultAuthRoles(): AuthRoleDefinition[] {\n return AUTH_DEFAULT_ROLES.map((role) => ({\n ...role,\n id: authRoleEntityType.generateNewId(),\n }));\n}\n","import type { def } from '@baseplate-dev/project-builder-lib';\n\nimport {\n authRoleEntityType,\n definitionSchema,\n} from '@baseplate-dev/project-builder-lib';\nimport { z } from 'zod';\n\nimport { AUTH_DEFAULT_ROLES } from './constants.js';\n\nexport const createAuthRoleSchema = definitionSchema((ctx) =>\n ctx.withEnt(\n z.object({\n id: z.string(),\n name: z.string().min(1),\n comment: z.string().min(1),\n builtIn: z.boolean().default(false),\n }),\n { type: authRoleEntityType },\n ),\n);\n\n/**\n * Defines the schema for a role.\n */\nexport type AuthRoleDefinition = def.InferOutput<typeof createAuthRoleSchema>;\n\nexport type AuthRoleInput = def.InferInput<typeof createAuthRoleSchema>;\n\n/**\n * Defines the schema for an array of roles ensuring that there are no duplicate\n * role names and that the built-in roles are included.\n */\nexport const createAuthRolesSchema = definitionSchema((ctx) =>\n z\n .array(createAuthRoleSchema(ctx))\n .superRefine((roles, ctx) => {\n const dup = roles\n .map((r) => r.name)\n .filter((v, i, a) => a.indexOf(v) !== i);\n if (dup.length > 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `Duplicate role name(s): ${dup.join(', ')}`,\n });\n }\n })\n .transform((roles) => [\n ...AUTH_DEFAULT_ROLES.map((r) => {\n const existingRole = roles.find((role) => role.name === r.name);\n return existingRole\n ? {\n ...existingRole,\n builtIn: true,\n }\n : {\n ...r,\n builtIn: true,\n id: authRoleEntityType.generateNewId(),\n };\n }),\n // Filter out the built-in roles\n ...roles.filter(\n (r) => !AUTH_DEFAULT_ROLES.map((v) => v.name).includes(r.name),\n ),\n ]),\n);\n","import type React from 'react';\n\nimport { useDefinitionSchema } from '@baseplate-dev/project-builder-lib/web';\nimport {\n Button,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n InputFieldController,\n} from '@baseplate-dev/ui-components';\nimport { zodResolver } from '@hookform/resolvers/zod';\nimport { useId } from 'react';\nimport { useForm } from 'react-hook-form';\n\nimport type { AuthRoleInput } from '#src/common/roles/schema.js';\n\nimport { createAuthRoleSchema } from '#src/common/roles/schema.js';\n\ninterface RoleDialogProps {\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n role?: AuthRoleInput;\n isNew?: boolean;\n onSave: (role: AuthRoleInput) => void;\n asChild?: boolean;\n children?: React.ReactNode;\n}\n\nexport function RoleDialog({\n open,\n onOpenChange,\n role,\n isNew = false,\n onSave,\n asChild,\n children,\n}: RoleDialogProps): React.JSX.Element {\n const authRoleSchema = useDefinitionSchema(createAuthRoleSchema);\n const form = useForm({\n resolver: zodResolver(authRoleSchema),\n values: role,\n });\n\n const { control, handleSubmit } = form;\n\n const onSubmit = handleSubmit((data) => {\n onSave(data);\n onOpenChange?.(false);\n });\n\n const formId = useId();\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogTrigger asChild={asChild}>{children}</DialogTrigger>\n <DialogContent>\n <form\n id={formId}\n onSubmit={(e) => {\n e.stopPropagation();\n return onSubmit(e);\n }}\n >\n <DialogHeader>\n <DialogTitle>{isNew ? 'Add Role' : 'Edit Role'}</DialogTitle>\n <DialogDescription>\n {isNew\n ? 'Enter the details for the new role.'\n : 'Update the role details below.'}\n </DialogDescription>\n </DialogHeader>\n <div className=\"auth:space-y-4 auth:py-4\">\n <InputFieldController\n label=\"Role Name\"\n name=\"name\"\n control={control}\n placeholder=\"Enter role name\"\n />\n <InputFieldController\n label=\"Description\"\n name=\"comment\"\n control={control}\n placeholder=\"Describe this role's purpose\"\n />\n </div>\n <DialogFooter>\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => {\n onOpenChange?.(false);\n }}\n >\n Cancel\n </Button>\n <Button form={formId} type=\"submit\">\n {isNew ? 'Add' : 'Update'} Role\n </Button>\n </DialogFooter>\n </form>\n </DialogContent>\n </Dialog>\n );\n}\n","import type { Lens } from '@hookform/lenses';\nimport type React from 'react';\n\nimport { authRoleEntityType } from '@baseplate-dev/project-builder-lib';\nimport {\n Badge,\n Button,\n RecordView,\n RecordViewActions,\n RecordViewItem,\n RecordViewItemList,\n SectionListSection,\n SectionListSectionContent,\n SectionListSectionDescription,\n SectionListSectionHeader,\n SectionListSectionTitle,\n useConfirmDialog,\n} from '@baseplate-dev/ui-components';\nimport { useFieldArray } from '@hookform/lenses/rhf';\nimport { useState } from 'react';\nimport { useWatch } from 'react-hook-form';\nimport { MdAdd, MdDeleteOutline, MdEdit } from 'react-icons/md';\n\nimport type { AuthRoleInput } from '#src/common/roles/index.js';\n\nimport { RoleDialog } from './role-dialog.js';\n\ninterface Props {\n className?: string;\n lens: Lens<AuthRoleInput[]>;\n}\n\nexport function RoleEditorForm({ className, lens }: Props): React.JSX.Element {\n const { requestConfirm } = useConfirmDialog();\n const { append, update, remove } = useFieldArray(lens.interop());\n const [roleToEdit, setRoleToEdit] = useState<AuthRoleInput | undefined>();\n const [isEditing, setIsEditing] = useState(false);\n\n const roles = useWatch(lens.interop());\n\n function handleSaveRole(newRole: AuthRoleInput): void {\n const existingIndex = roles.findIndex((role) => role.id === newRole.id);\n if (existingIndex === -1) {\n append(newRole);\n } else {\n update(existingIndex, newRole);\n }\n }\n\n function handleDeleteRole(roleIdx: number): void {\n const role = roles[roleIdx];\n requestConfirm({\n title: 'Delete Role',\n content: `Are you sure you want to delete the role \"${role.name}\"?`,\n onConfirm: () => {\n remove(roleIdx);\n },\n });\n }\n\n return (\n <SectionListSection className={className}>\n <SectionListSectionHeader>\n <SectionListSectionTitle>User Roles</SectionListSectionTitle>\n <SectionListSectionDescription>\n Define roles for your application. Default roles are protected and\n cannot be removed.\n </SectionListSectionDescription>\n </SectionListSectionHeader>\n <SectionListSectionContent className=\"auth:space-y-4\">\n {roles.map((role, roleIdx) => (\n <RecordView key={role.id}>\n <RecordViewItemList>\n <RecordViewItem title=\"Name\">\n <div className=\"auth:flex auth:items-center auth:gap-2\">\n <span>{role.name}</span>\n </div>\n </RecordViewItem>\n <RecordViewItem title=\"Description\">\n {role.comment.trim() || (\n <span className=\"auth:text-muted-foreground\">\n No description\n </span>\n )}\n </RecordViewItem>\n </RecordViewItemList>\n <RecordViewActions>\n {role.builtIn && <Badge variant=\"secondary\">Default Role</Badge>}\n {!role.builtIn && (\n <>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n title=\"Edit\"\n aria-label=\"Edit role\"\n onClick={() => {\n setRoleToEdit(role);\n setIsEditing(true);\n }}\n >\n <MdEdit />\n </Button>\n <Button\n variant=\"ghostDestructive\"\n size=\"icon\"\n title=\"Delete\"\n aria-label=\"Delete role\"\n onClick={() => {\n handleDeleteRole(roleIdx);\n }}\n >\n <MdDeleteOutline />\n </Button>\n </>\n )}\n </RecordViewActions>\n </RecordView>\n ))}\n <RoleDialog\n open={isEditing}\n onOpenChange={setIsEditing}\n role={roleToEdit}\n isNew={roleToEdit ? !roles.some((r) => r.id === roleToEdit.id) : true}\n onSave={handleSaveRole}\n />\n <Button\n variant=\"secondary\"\n size=\"sm\"\n onClick={() => {\n setRoleToEdit({\n id: authRoleEntityType.generateNewId(),\n name: '',\n comment: '',\n builtIn: false,\n });\n setIsEditing(true);\n }}\n >\n <MdAdd />\n Add Role\n </Button>\n </SectionListSectionContent>\n </SectionListSection>\n );\n}\n"],"names":["e","s","t","n","o","r","useFieldArrayOriginal","authRoleEntityType","ctx","Button","zodResolver","jsxs","jsx","Fragment"],"mappings":";;;;AAA+C,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,gBAAgB,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAACA,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,GAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,gBAAgB,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,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ACC,IAAM,EAAA,SAAA;AAAA,UACN,YAAc,EAAA,YAAA;AAAA,UACd,IAAM,EAAA,UAAA;AAAA,UACN,KAAA,EAAO,UAAa,GAAA,CAAC,KAAM,CAAA,IAAA,CAAK,CAAC,CAAA,KAAM,CAAE,CAAA,EAAA,KAAO,UAAW,CAAA,EAAE,CAAI,GAAA,IAAA;AAAA,UACjE,MAAQ,EAAA;AAAA;AAAA,OACV;AAAA,sBACAD,sBAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,OAAQ,EAAA,WAAA;AAAA,UACR,IAAK,EAAA,IAAA;AAAA,UACL,SAAS,MAAM;AACb,YAAc,aAAA,CAAA;AAAA,cACZ,EAAA,EAAI,mBAAmB,aAAc,EAAA;AAAA,cACrC,IAAM,EAAA,EAAA;AAAA,cACN,OAAS,EAAA,EAAA;AAAA,cACT,OAAS,EAAA;AAAA,aACV,CAAA;AACD,YAAA,YAAA,CAAa,IAAI,CAAA;AAAA,WACnB;AAAA,UAEA,QAAA,EAAA;AAAA,4BAAAC,qBAAA,CAAC,KAAM,EAAA,EAAA,CAAA;AAAA,YAAE;AAAA;AAAA;AAAA;AAEX,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;","x_google_ignoreList":[0,1,2]}
|
|
@@ -10,17 +10,13 @@
|
|
|
10
10
|
@layer theme {
|
|
11
11
|
:root, :host {
|
|
12
12
|
--auth-spacing: .25rem;
|
|
13
|
-
--auth-container-
|
|
13
|
+
--auth-container-6xl: 72rem;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
@layer base, components;
|
|
18
18
|
|
|
19
19
|
@layer utilities {
|
|
20
|
-
.auth\:relative {
|
|
21
|
-
position: relative;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
20
|
.auth\:mb-\[--action-bar-height\] {
|
|
25
21
|
margin-bottom: --action-bar-height;
|
|
26
22
|
}
|
|
@@ -33,12 +29,8 @@
|
|
|
33
29
|
display: grid;
|
|
34
30
|
}
|
|
35
31
|
|
|
36
|
-
.auth\:
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.auth\:max-w-3xl {
|
|
41
|
-
max-width: var(--auth-container-3xl);
|
|
32
|
+
.auth\:max-w-6xl {
|
|
33
|
+
max-width: var(--auth-container-6xl);
|
|
42
34
|
}
|
|
43
35
|
|
|
44
36
|
.auth\:grid-cols-1 {
|
|
@@ -86,6 +78,12 @@
|
|
|
86
78
|
.auth\:text-muted-foreground {
|
|
87
79
|
color: var(--muted-foreground);
|
|
88
80
|
}
|
|
81
|
+
|
|
82
|
+
@media (min-width: 48rem) {
|
|
83
|
+
.auth\:md\:grid-cols-2 {
|
|
84
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
89
87
|
}
|
|
90
88
|
|
|
91
89
|
@property --tw-space-y-reverse {
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { importShared } from './__federation_fn_import-CktB8mRs.js';
|
|
2
|
+
import { g as get, s as set } from './index.esm-CGKugQk7.js';
|
|
3
|
+
|
|
4
|
+
var LensCore = class _LensCore {
|
|
5
|
+
constructor(control, path, cache) {
|
|
6
|
+
this.control = control;
|
|
7
|
+
this.path = path;
|
|
8
|
+
this.cache = cache;
|
|
9
|
+
}
|
|
10
|
+
static create(control, cache) {
|
|
11
|
+
return new _LensCore(control, "", cache);
|
|
12
|
+
}
|
|
13
|
+
focus(prop) {
|
|
14
|
+
var _a, _b, _c, _d, _e, _f;
|
|
15
|
+
const propString = prop.toString();
|
|
16
|
+
const nestedPath = this.path ? `${this.path}.${propString}` : propString;
|
|
17
|
+
const fromCache = (_a = this.cache) == null ? void 0 : _a.get(nestedPath);
|
|
18
|
+
if (fromCache) {
|
|
19
|
+
return fromCache;
|
|
20
|
+
}
|
|
21
|
+
if (Array.isArray(this.override)) {
|
|
22
|
+
const [template] = this.override;
|
|
23
|
+
const result2 = new _LensCore(this.control, nestedPath, this.cache);
|
|
24
|
+
result2.isArrayItemReflection = true;
|
|
25
|
+
result2.override = template;
|
|
26
|
+
(_b = this.cache) == null ? void 0 : _b.set(result2, nestedPath);
|
|
27
|
+
return result2;
|
|
28
|
+
} else if (this.override) {
|
|
29
|
+
const overriddenLens = get(this.override, propString);
|
|
30
|
+
if (!overriddenLens) {
|
|
31
|
+
const result2 = new _LensCore(this.control, nestedPath, this.cache);
|
|
32
|
+
(_c = this.cache) == null ? void 0 : _c.set(result2, nestedPath);
|
|
33
|
+
return result2;
|
|
34
|
+
}
|
|
35
|
+
if (this.isArrayItemReflection) {
|
|
36
|
+
const arrayItemNestedPath = `${this.path}.${overriddenLens.path}`;
|
|
37
|
+
const result2 = new _LensCore(this.control, arrayItemNestedPath, this.cache);
|
|
38
|
+
(_d = this.cache) == null ? void 0 : _d.set(result2, arrayItemNestedPath);
|
|
39
|
+
return result2;
|
|
40
|
+
} else {
|
|
41
|
+
(_e = this.cache) == null ? void 0 : _e.set(overriddenLens, nestedPath);
|
|
42
|
+
return overriddenLens;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const result = new _LensCore(this.control, nestedPath, this.cache);
|
|
46
|
+
(_f = this.cache) == null ? void 0 : _f.set(result, nestedPath);
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
reflect(getter) {
|
|
50
|
+
var _a, _b, _c;
|
|
51
|
+
const fromCache = (_a = this.cache) == null ? void 0 : _a.get(this.path, getter);
|
|
52
|
+
if (fromCache) {
|
|
53
|
+
return fromCache;
|
|
54
|
+
}
|
|
55
|
+
const template = new _LensCore(this.control, this.path, this.cache);
|
|
56
|
+
const dictionary = new Proxy(
|
|
57
|
+
{},
|
|
58
|
+
{
|
|
59
|
+
get: (target, prop) => {
|
|
60
|
+
if (typeof prop === "string") {
|
|
61
|
+
return template.focus(prop);
|
|
62
|
+
}
|
|
63
|
+
return target;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
const override = getter(dictionary, template);
|
|
68
|
+
if (Array.isArray(override)) {
|
|
69
|
+
const result = new _LensCore(this.control, this.path, this.cache);
|
|
70
|
+
template.path = "";
|
|
71
|
+
result.override = getter(dictionary, template);
|
|
72
|
+
(_b = this.cache) == null ? void 0 : _b.set(result, this.path, getter);
|
|
73
|
+
return result;
|
|
74
|
+
} else {
|
|
75
|
+
template.override = override;
|
|
76
|
+
template.path = this.path;
|
|
77
|
+
(_c = this.cache) == null ? void 0 : _c.set(template, this.path, getter);
|
|
78
|
+
return template;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
map(fields, mapper) {
|
|
82
|
+
return fields.map((value, index, array) => {
|
|
83
|
+
const item = this.focus(index.toString());
|
|
84
|
+
const res = mapper(value, item, index, array, this);
|
|
85
|
+
return res;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
interop(cb) {
|
|
89
|
+
var _a;
|
|
90
|
+
if (cb) {
|
|
91
|
+
return cb(this.control, this.path);
|
|
92
|
+
}
|
|
93
|
+
(_a = this.interopCache) != null ? _a : this.interopCache = {
|
|
94
|
+
control: this.control,
|
|
95
|
+
name: this.path,
|
|
96
|
+
...this.override ? { getTransformer: this.getTransformer.bind(this), setTransformer: this.setTransformer.bind(this) } : {}
|
|
97
|
+
};
|
|
98
|
+
return this.interopCache;
|
|
99
|
+
}
|
|
100
|
+
getTransformer(value) {
|
|
101
|
+
const [template] = Array.isArray(this.override) ? this.override : [this.override];
|
|
102
|
+
if (!value || !template) {
|
|
103
|
+
return value;
|
|
104
|
+
}
|
|
105
|
+
const newValue = {};
|
|
106
|
+
Object.entries(template).forEach(([key, valueTemplate]) => {
|
|
107
|
+
const restructuredLens = valueTemplate;
|
|
108
|
+
if (!restructuredLens) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const v = get(value, restructuredLens.path);
|
|
112
|
+
set(newValue, key, v);
|
|
113
|
+
});
|
|
114
|
+
return newValue;
|
|
115
|
+
}
|
|
116
|
+
setTransformer(value) {
|
|
117
|
+
const [template] = Array.isArray(this.override) ? this.override : [this.override];
|
|
118
|
+
if (!value || !template) {
|
|
119
|
+
return value;
|
|
120
|
+
}
|
|
121
|
+
const newValue = {};
|
|
122
|
+
Object.entries(value).forEach(([key, value2]) => {
|
|
123
|
+
const restructuredLens = template[key];
|
|
124
|
+
if (!restructuredLens) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
set(newValue, restructuredLens.path, value2);
|
|
128
|
+
});
|
|
129
|
+
return newValue;
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
// src/LensesStorage.ts
|
|
134
|
+
var LensesStorage = class {
|
|
135
|
+
constructor(control) {
|
|
136
|
+
var _a, _b, _c;
|
|
137
|
+
this.cache = /* @__PURE__ */ new Map();
|
|
138
|
+
(_c = (_b = (_a = control == null ? void 0 : control._subjects) == null ? void 0 : _a.values) == null ? void 0 : _b.subscribe) == null ? void 0 : _c.call(_b, {
|
|
139
|
+
next: () => {
|
|
140
|
+
control._names.unMount.forEach((name) => {
|
|
141
|
+
this.delete(name);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
get(path, complexKey) {
|
|
147
|
+
const cached = this.cache.get(path);
|
|
148
|
+
if (cached) {
|
|
149
|
+
if (complexKey) {
|
|
150
|
+
return cached.complex.get(complexKey);
|
|
151
|
+
}
|
|
152
|
+
return cached.plain;
|
|
153
|
+
}
|
|
154
|
+
return void 0;
|
|
155
|
+
}
|
|
156
|
+
set(lens, path, complexKey) {
|
|
157
|
+
let cached = this.cache.get(path);
|
|
158
|
+
if (!cached) {
|
|
159
|
+
cached = {
|
|
160
|
+
complex: /* @__PURE__ */ new WeakMap()
|
|
161
|
+
};
|
|
162
|
+
this.cache.set(path, cached);
|
|
163
|
+
}
|
|
164
|
+
if (complexKey) {
|
|
165
|
+
cached.complex.set(complexKey, lens);
|
|
166
|
+
} else {
|
|
167
|
+
cached.plain = lens;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
has(path, complexKey) {
|
|
171
|
+
var _a, _b;
|
|
172
|
+
if (complexKey) {
|
|
173
|
+
return (_b = (_a = this.cache.get(path)) == null ? void 0 : _a.complex.has(complexKey)) != null ? _b : false;
|
|
174
|
+
}
|
|
175
|
+
return this.cache.has(path);
|
|
176
|
+
}
|
|
177
|
+
delete(path) {
|
|
178
|
+
for (const key of this.cache.keys()) {
|
|
179
|
+
if (key.startsWith(path)) {
|
|
180
|
+
this.cache.delete(key);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
clear() {
|
|
185
|
+
this.cache.clear();
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
// src/useLens.ts
|
|
190
|
+
const {useMemo} = await importShared('react');
|
|
191
|
+
|
|
192
|
+
function useLens(props, deps = []) {
|
|
193
|
+
return useMemo(() => {
|
|
194
|
+
const cache = new LensesStorage(props.control);
|
|
195
|
+
const lens = LensCore.create(props.control, cache);
|
|
196
|
+
return lens;
|
|
197
|
+
}, [props.control, ...deps]);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export { useLens as u };
|
|
201
|
+
//# sourceMappingURL=styles-Bqxfz3Ig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles-Bqxfz3Ig.js","sources":["../../../../../node_modules/.pnpm/@hookform+lenses@0.7.1_react-hook-form@7.60.0_react@19.1.0__react@19.1.0/node_modules/@hookform/lenses/dist/index.js"],"sourcesContent":["// src/LensCore.ts\nimport { get, set } from \"react-hook-form\";\nvar LensCore = class _LensCore {\n constructor(control, path, cache) {\n this.control = control;\n this.path = path;\n this.cache = cache;\n }\n static create(control, cache) {\n return new _LensCore(control, \"\", cache);\n }\n focus(prop) {\n var _a, _b, _c, _d, _e, _f;\n const propString = prop.toString();\n const nestedPath = this.path ? `${this.path}.${propString}` : propString;\n const fromCache = (_a = this.cache) == null ? void 0 : _a.get(nestedPath);\n if (fromCache) {\n return fromCache;\n }\n if (Array.isArray(this.override)) {\n const [template] = this.override;\n const result2 = new _LensCore(this.control, nestedPath, this.cache);\n result2.isArrayItemReflection = true;\n result2.override = template;\n (_b = this.cache) == null ? void 0 : _b.set(result2, nestedPath);\n return result2;\n } else if (this.override) {\n const overriddenLens = get(this.override, propString);\n if (!overriddenLens) {\n const result2 = new _LensCore(this.control, nestedPath, this.cache);\n (_c = this.cache) == null ? void 0 : _c.set(result2, nestedPath);\n return result2;\n }\n if (this.isArrayItemReflection) {\n const arrayItemNestedPath = `${this.path}.${overriddenLens.path}`;\n const result2 = new _LensCore(this.control, arrayItemNestedPath, this.cache);\n (_d = this.cache) == null ? void 0 : _d.set(result2, arrayItemNestedPath);\n return result2;\n } else {\n (_e = this.cache) == null ? void 0 : _e.set(overriddenLens, nestedPath);\n return overriddenLens;\n }\n }\n const result = new _LensCore(this.control, nestedPath, this.cache);\n (_f = this.cache) == null ? void 0 : _f.set(result, nestedPath);\n return result;\n }\n reflect(getter) {\n var _a, _b, _c;\n const fromCache = (_a = this.cache) == null ? void 0 : _a.get(this.path, getter);\n if (fromCache) {\n return fromCache;\n }\n const template = new _LensCore(this.control, this.path, this.cache);\n const dictionary = new Proxy(\n {},\n {\n get: (target, prop) => {\n if (typeof prop === \"string\") {\n return template.focus(prop);\n }\n return target;\n }\n }\n );\n const override = getter(dictionary, template);\n if (Array.isArray(override)) {\n const result = new _LensCore(this.control, this.path, this.cache);\n template.path = \"\";\n result.override = getter(dictionary, template);\n (_b = this.cache) == null ? void 0 : _b.set(result, this.path, getter);\n return result;\n } else {\n template.override = override;\n template.path = this.path;\n (_c = this.cache) == null ? void 0 : _c.set(template, this.path, getter);\n return template;\n }\n }\n map(fields, mapper) {\n return fields.map((value, index, array) => {\n const item = this.focus(index.toString());\n const res = mapper(value, item, index, array, this);\n return res;\n });\n }\n interop(cb) {\n var _a;\n if (cb) {\n return cb(this.control, this.path);\n }\n (_a = this.interopCache) != null ? _a : this.interopCache = {\n control: this.control,\n name: this.path,\n ...this.override ? { getTransformer: this.getTransformer.bind(this), setTransformer: this.setTransformer.bind(this) } : {}\n };\n return this.interopCache;\n }\n getTransformer(value) {\n const [template] = Array.isArray(this.override) ? this.override : [this.override];\n if (!value || !template) {\n return value;\n }\n const newValue = {};\n Object.entries(template).forEach(([key, valueTemplate]) => {\n const restructuredLens = valueTemplate;\n if (!restructuredLens) {\n return;\n }\n const v = get(value, restructuredLens.path);\n set(newValue, key, v);\n });\n return newValue;\n }\n setTransformer(value) {\n const [template] = Array.isArray(this.override) ? this.override : [this.override];\n if (!value || !template) {\n return value;\n }\n const newValue = {};\n Object.entries(value).forEach(([key, value2]) => {\n const restructuredLens = template[key];\n if (!restructuredLens) {\n return;\n }\n set(newValue, restructuredLens.path, value2);\n });\n return newValue;\n }\n};\n\n// src/LensesStorage.ts\nvar LensesStorage = class {\n constructor(control) {\n var _a, _b, _c;\n this.cache = /* @__PURE__ */ new Map();\n (_c = (_b = (_a = control == null ? void 0 : control._subjects) == null ? void 0 : _a.values) == null ? void 0 : _b.subscribe) == null ? void 0 : _c.call(_b, {\n next: () => {\n control._names.unMount.forEach((name) => {\n this.delete(name);\n });\n }\n });\n }\n get(path, complexKey) {\n const cached = this.cache.get(path);\n if (cached) {\n if (complexKey) {\n return cached.complex.get(complexKey);\n }\n return cached.plain;\n }\n return void 0;\n }\n set(lens, path, complexKey) {\n let cached = this.cache.get(path);\n if (!cached) {\n cached = {\n complex: /* @__PURE__ */ new WeakMap()\n };\n this.cache.set(path, cached);\n }\n if (complexKey) {\n cached.complex.set(complexKey, lens);\n } else {\n cached.plain = lens;\n }\n }\n has(path, complexKey) {\n var _a, _b;\n if (complexKey) {\n return (_b = (_a = this.cache.get(path)) == null ? void 0 : _a.complex.has(complexKey)) != null ? _b : false;\n }\n return this.cache.has(path);\n }\n delete(path) {\n for (const key of this.cache.keys()) {\n if (key.startsWith(path)) {\n this.cache.delete(key);\n }\n }\n }\n clear() {\n this.cache.clear();\n }\n};\n\n// src/useLens.ts\nimport { useMemo } from \"react\";\nfunction useLens(props, deps = []) {\n return useMemo(() => {\n const cache = new LensesStorage(props.control);\n const lens = LensCore.create(props.control, cache);\n return lens;\n }, [props.control, ...deps]);\n}\nexport {\n LensCore,\n LensesStorage,\n useLens\n};\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;AAEA,IAAI,QAAQ,GAAG,MAAM,SAAS,CAAC;AAC/B,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE;AACpC,IAAI,IAAI,CAAC,OAAO,GAAG,OAAO;AAC1B,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI;AACpB,IAAI,IAAI,CAAC,KAAK,GAAG,KAAK;AACtB;AACA,EAAE,OAAO,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE;AAChC,IAAI,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC;AAC5C;AACA,EAAE,KAAK,CAAC,IAAI,EAAE;AACd,IAAI,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;AAC9B,IAAI,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,EAAE;AACtC,IAAI,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,GAAG,UAAU;AAC5E,IAAI,MAAM,SAAS,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,KAAK,IAAI,GAAG,MAAM,GAAG,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC;AAC7E,IAAI,IAAI,SAAS,EAAE;AACnB,MAAM,OAAO,SAAS;AACtB;AACA,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;AACtC,MAAM,MAAM,CAAC,QAAQ,CA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