@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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as createPluginSpec, i as isEqual, m as mapValues, a as createEntityType,
|
|
2
|
-
export {
|
|
3
|
-
import { importShared } from '../__federation_fn_import-
|
|
1
|
+
import { c as createPluginSpec, i as isEqual, m as mapValues, a as createEntityType, C as CASE_VALIDATORS, D as DefinitionReferenceMarker, g as get$1, R as REF_ANNOTATIONS_MARKER_SYMBOL, b as createDefinitionSchemaParserContext, s as set$1, d as definitionSchema, e as modelForeignRelationEntityType, f as modelLocalRelationEntityType, h as modelScalarFieldEntityType, j as modelTransformerEntityType, k as modelEntityType, l as modelEnumValueEntityType, n as featureEntityType, o as modelEnumEntityType, p as modelUniqueConstraintEntityType, q as createFeaturesSchema, M as ModelUtils, r as omit, t as cloneDeep } from '../model-merger-DYdmgijL.js';
|
|
2
|
+
export { K as DefinitionDiffArrayIncludesField, I as DefinitionDiffKeyedArrayField, J as DefinitionDiffReplacementField, v as DefinitionEntityType, F as FeatureUtils, O as applyDefinitionDiff, E as applyModelMergerDiff, G as applyModelMergerResultInPlace, H as createAndApplyModelMergerResults, N as createDefinitionDiff, L as createDefinitionDiffConfig, x as createFeatureSchema, u as createInitializedPluginSpec, z as createModelMergerResult, B as createModelMergerResults, A as doesModelMergerResultsHaveChanges, w as featureNameSchema, y as modelMergerDefinitionDiffConfig } from '../model-merger-DYdmgijL.js';
|
|
3
|
+
import { importShared } from '../__federation_fn_import-CktB8mRs.js';
|
|
4
4
|
|
|
5
5
|
function createAdminCrudInputCompilerImplementation() {
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -536,15 +536,20 @@ function detectCycle(nodes, visited, edges) {
|
|
|
536
536
|
visitSet.delete(node);
|
|
537
537
|
return false;
|
|
538
538
|
}
|
|
539
|
-
// For cycle detection, we need to
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
539
|
+
// For cycle detection, we need to try all unvisited nodes
|
|
540
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
541
|
+
if (!visited.has(i)) {
|
|
542
|
+
// Reset path and visitSet for each starting node
|
|
543
|
+
path.length = 0;
|
|
544
|
+
visitSet.clear();
|
|
545
|
+
const cycleFound = dfs(i);
|
|
546
|
+
if (cycleFound) {
|
|
547
|
+
// Convert path indices to actual nodes
|
|
548
|
+
return path.map((idx) => nodes[idx]);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
543
551
|
}
|
|
544
|
-
|
|
545
|
-
dfs(unvistedNodeIdx);
|
|
546
|
-
// Convert path indices to actual nodes
|
|
547
|
-
return path.map((idx) => nodes[idx]);
|
|
552
|
+
return [];
|
|
548
553
|
}
|
|
549
554
|
/**
|
|
550
555
|
* Default comparison function for stable topological sort
|
|
@@ -826,6 +831,12 @@ const pluginMetadataSchema = z$k.object({
|
|
|
826
831
|
dependencies: z$k.array(pluginSpecDependencySchema).optional(),
|
|
827
832
|
})
|
|
828
833
|
.optional(),
|
|
834
|
+
/**
|
|
835
|
+
* Whether the plugin should be hidden in the project builder UI
|
|
836
|
+
*
|
|
837
|
+
* (It can be used once in the definition but cannot be added)
|
|
838
|
+
*/
|
|
839
|
+
hidden: z$k.boolean().optional(),
|
|
829
840
|
});
|
|
830
841
|
|
|
831
842
|
var NOTHING = Symbol.for("immer-nothing");
|
|
@@ -1473,11 +1484,11 @@ function createPluginConfigImplementation() {
|
|
|
1473
1484
|
const schemas = new Map();
|
|
1474
1485
|
const migrationsMap = new Map();
|
|
1475
1486
|
return {
|
|
1476
|
-
|
|
1487
|
+
registerSchemaCreator(pluginKey, schemaCreator) {
|
|
1477
1488
|
if (schemas.has(pluginKey)) {
|
|
1478
1489
|
throw new Error(`Schema for plugin ${pluginKey} is already registered`);
|
|
1479
1490
|
}
|
|
1480
|
-
schemas.set(pluginKey,
|
|
1491
|
+
schemas.set(pluginKey, schemaCreator);
|
|
1481
1492
|
},
|
|
1482
1493
|
registerMigrations(pluginKey, migrations) {
|
|
1483
1494
|
if (migrationsMap.has(pluginKey)) {
|
|
@@ -1486,7 +1497,7 @@ function createPluginConfigImplementation() {
|
|
|
1486
1497
|
const sortedMigrations = sortAndValidateMigrations(migrations);
|
|
1487
1498
|
migrationsMap.set(pluginKey, sortedMigrations);
|
|
1488
1499
|
},
|
|
1489
|
-
|
|
1500
|
+
getSchemaCreator(pluginKey) {
|
|
1490
1501
|
return schemas.get(pluginKey);
|
|
1491
1502
|
},
|
|
1492
1503
|
getMigrations(pluginKey) {
|
|
@@ -1540,31 +1551,6 @@ function runPluginMigrations(projectDefinition, pluginImplementationStore) {
|
|
|
1540
1551
|
});
|
|
1541
1552
|
}
|
|
1542
1553
|
|
|
1543
|
-
const {ZodType} = await importShared('zod');
|
|
1544
|
-
class ZodWithPlugins extends ZodType {
|
|
1545
|
-
_parse(input) {
|
|
1546
|
-
const context = input.parent.common;
|
|
1547
|
-
// run builder
|
|
1548
|
-
const zodPluginContext = context[zodPluginSymbol];
|
|
1549
|
-
if (!zodPluginContext) {
|
|
1550
|
-
throw new Error(`Spec must be run within a Zod plugin context`);
|
|
1551
|
-
}
|
|
1552
|
-
const innerType = this._def.getter(zodPluginContext.pluginStore, input.data);
|
|
1553
|
-
return innerType._parse(input);
|
|
1554
|
-
}
|
|
1555
|
-
}
|
|
1556
|
-
Object.defineProperty(ZodWithPlugins, "create", {
|
|
1557
|
-
enumerable: true,
|
|
1558
|
-
configurable: true,
|
|
1559
|
-
writable: true,
|
|
1560
|
-
value: (getter) => new ZodWithPlugins({
|
|
1561
|
-
getter,
|
|
1562
|
-
})
|
|
1563
|
-
});
|
|
1564
|
-
function zWithPlugins(getter) {
|
|
1565
|
-
return ZodWithPlugins.create(getter);
|
|
1566
|
-
}
|
|
1567
|
-
|
|
1568
1554
|
/**
|
|
1569
1555
|
* Spec for adding config component for plugin
|
|
1570
1556
|
*/
|
|
@@ -2270,6 +2256,357 @@ const AppUtils = {
|
|
|
2270
2256
|
getBackendRelativePath,
|
|
2271
2257
|
};
|
|
2272
2258
|
|
|
2259
|
+
const authRoleEntityType = createEntityType('role');
|
|
2260
|
+
|
|
2261
|
+
const appEntityType = createEntityType('app');
|
|
2262
|
+
function createAppEntryType(name) {
|
|
2263
|
+
return name;
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
const {z: z$j} = await importShared('zod');
|
|
2267
|
+
const baseAppValidators = {
|
|
2268
|
+
id: z$j.string().default(appEntityType.generateNewId()),
|
|
2269
|
+
name: CASE_VALIDATORS.KEBAB_CASE,
|
|
2270
|
+
type: z$j.string(),
|
|
2271
|
+
packageLocation: z$j
|
|
2272
|
+
.string()
|
|
2273
|
+
.regex(/^(?!.*(?:\/|\.\.)\/)(?!^\.\.$)(?!^\.$)(?:[\w\-.]+\/?)+[\w\-.]*|^$/, {
|
|
2274
|
+
message: 'Invalid package location. Must be a valid subdirectory.',
|
|
2275
|
+
})
|
|
2276
|
+
.optional(),
|
|
2277
|
+
};
|
|
2278
|
+
const baseAppSchema = z$j.object(baseAppValidators);
|
|
2279
|
+
|
|
2280
|
+
/**
|
|
2281
|
+
* Strips the DefinitionReferenceMarker from the value recursively.
|
|
2282
|
+
* @param value - The value to strip the DefinitionReferenceMarker from.
|
|
2283
|
+
* @returns The value without the DefinitionReferenceMarker.
|
|
2284
|
+
*/
|
|
2285
|
+
function stripRefMarkers(value) {
|
|
2286
|
+
if (value instanceof DefinitionReferenceMarker) {
|
|
2287
|
+
return value.value;
|
|
2288
|
+
}
|
|
2289
|
+
if (Array.isArray(value)) {
|
|
2290
|
+
return value.map(stripRefMarkers);
|
|
2291
|
+
}
|
|
2292
|
+
if (typeof value === 'object' && value !== null) {
|
|
2293
|
+
return Object.fromEntries(Object.entries(value).map(([key, childValue]) => [
|
|
2294
|
+
key,
|
|
2295
|
+
stripRefMarkers(childValue),
|
|
2296
|
+
]));
|
|
2297
|
+
}
|
|
2298
|
+
return value;
|
|
2299
|
+
}
|
|
2300
|
+
|
|
2301
|
+
/**
|
|
2302
|
+
* Creates a definition entity name resolver.
|
|
2303
|
+
* @param entityNameResolver - The entity name resolver.
|
|
2304
|
+
* @returns The definition entity name resolver.
|
|
2305
|
+
*/
|
|
2306
|
+
function createDefinitionEntityNameResolver(entityNameResolver) {
|
|
2307
|
+
return entityNameResolver;
|
|
2308
|
+
}
|
|
2309
|
+
/**
|
|
2310
|
+
* DefinitionRefBuilder is responsible for constructing reference paths, and registering
|
|
2311
|
+
* references and entities as defined in a Zod schema.
|
|
2312
|
+
*
|
|
2313
|
+
* The builder uses a prefix (usually the current parsing path) and context (a
|
|
2314
|
+
* shared map for resolving relative references) to build complete reference paths.
|
|
2315
|
+
*
|
|
2316
|
+
* @template TInput - The type of the input data being parsed.
|
|
2317
|
+
*/
|
|
2318
|
+
class DefinitionRefBuilder {
|
|
2319
|
+
/**
|
|
2320
|
+
* Creates a new builder instance.
|
|
2321
|
+
* @param pathPrefix - The starting path for all references.
|
|
2322
|
+
* @param context - Shared context including a path map and deserialize flag.
|
|
2323
|
+
* @param data - The data being parsed.
|
|
2324
|
+
*/
|
|
2325
|
+
constructor(pathPrefix, context, data) {
|
|
2326
|
+
Object.defineProperty(this, "references", {
|
|
2327
|
+
enumerable: true,
|
|
2328
|
+
configurable: true,
|
|
2329
|
+
writable: true,
|
|
2330
|
+
value: void 0
|
|
2331
|
+
});
|
|
2332
|
+
Object.defineProperty(this, "entitiesWithNameResolver", {
|
|
2333
|
+
enumerable: true,
|
|
2334
|
+
configurable: true,
|
|
2335
|
+
writable: true,
|
|
2336
|
+
value: void 0
|
|
2337
|
+
});
|
|
2338
|
+
Object.defineProperty(this, "pathPrefix", {
|
|
2339
|
+
enumerable: true,
|
|
2340
|
+
configurable: true,
|
|
2341
|
+
writable: true,
|
|
2342
|
+
value: void 0
|
|
2343
|
+
});
|
|
2344
|
+
Object.defineProperty(this, "context", {
|
|
2345
|
+
enumerable: true,
|
|
2346
|
+
configurable: true,
|
|
2347
|
+
writable: true,
|
|
2348
|
+
value: void 0
|
|
2349
|
+
});
|
|
2350
|
+
Object.defineProperty(this, "pathMap", {
|
|
2351
|
+
enumerable: true,
|
|
2352
|
+
configurable: true,
|
|
2353
|
+
writable: true,
|
|
2354
|
+
value: void 0
|
|
2355
|
+
});
|
|
2356
|
+
Object.defineProperty(this, "data", {
|
|
2357
|
+
enumerable: true,
|
|
2358
|
+
configurable: true,
|
|
2359
|
+
writable: true,
|
|
2360
|
+
value: void 0
|
|
2361
|
+
});
|
|
2362
|
+
this.references = [];
|
|
2363
|
+
this.entitiesWithNameResolver = [];
|
|
2364
|
+
this.pathPrefix = pathPrefix;
|
|
2365
|
+
this.context = context;
|
|
2366
|
+
this.pathMap = new Map();
|
|
2367
|
+
this.data = data;
|
|
2368
|
+
}
|
|
2369
|
+
/**
|
|
2370
|
+
* Converts a dot-separated string path into an array of keys.
|
|
2371
|
+
* @param path - A string (e.g. "a.b.0.c") representing the path.
|
|
2372
|
+
* @returns An array of keys (numbers for numeric strings, otherwise strings).
|
|
2373
|
+
*/
|
|
2374
|
+
_constructPathWithoutPrefix(path) {
|
|
2375
|
+
if (!path)
|
|
2376
|
+
return [];
|
|
2377
|
+
const pathComponents = path
|
|
2378
|
+
.split('.')
|
|
2379
|
+
.map((key) => (/^[0-9]+$/.test(key) ? Number.parseInt(key, 10) : key));
|
|
2380
|
+
return pathComponents;
|
|
2381
|
+
}
|
|
2382
|
+
/**
|
|
2383
|
+
* Prepends the builder's path prefix to the provided path.
|
|
2384
|
+
* @param path - The dot-separated path string.
|
|
2385
|
+
* @returns The complete reference path as an array.
|
|
2386
|
+
*/
|
|
2387
|
+
_constructPath(path) {
|
|
2388
|
+
if (!path)
|
|
2389
|
+
return this.pathPrefix;
|
|
2390
|
+
return [...this.pathPrefix, ...this._constructPathWithoutPrefix(path)];
|
|
2391
|
+
}
|
|
2392
|
+
/**
|
|
2393
|
+
* Constructs a reference path that may be defined directly as a string or indirectly
|
|
2394
|
+
* via a context object. If a context object is provided, the function looks up the
|
|
2395
|
+
* actual path from the builder's context.
|
|
2396
|
+
*
|
|
2397
|
+
* @param path - Either a dot-separated string path or an object with a context key.
|
|
2398
|
+
* @param expectedEntityType - The entity type expected for this context.
|
|
2399
|
+
* @returns The resolved reference path.
|
|
2400
|
+
* @throws If the context cannot be found or its type does not match.
|
|
2401
|
+
*/
|
|
2402
|
+
_constructPathWithContext(path, expectedEntityType) {
|
|
2403
|
+
if (typeof path === 'string') {
|
|
2404
|
+
return this._constructPath(path);
|
|
2405
|
+
}
|
|
2406
|
+
// Lookup the context for the given key.
|
|
2407
|
+
const pathContext = this.context.pathMap.get(path.context);
|
|
2408
|
+
if (!pathContext) {
|
|
2409
|
+
throw new Error(`Could not find context for ${path.context} from ${this.pathPrefix.join('.')}`);
|
|
2410
|
+
}
|
|
2411
|
+
if (pathContext.type !== expectedEntityType) {
|
|
2412
|
+
throw new Error(`Attempted to retrieve context for ${path.context} from ${this.pathPrefix.join('.')} expecting ${expectedEntityType.name}, but found ${pathContext.type.name}`);
|
|
2413
|
+
}
|
|
2414
|
+
return pathContext.path;
|
|
2415
|
+
}
|
|
2416
|
+
/**
|
|
2417
|
+
* Registers a reference based on the provided input definition.
|
|
2418
|
+
*
|
|
2419
|
+
* Flow:
|
|
2420
|
+
* 1. Validate that the parent path is provided if required (and vice versa).
|
|
2421
|
+
* 2. Compute the reference path; if the path is empty, use the entire data.
|
|
2422
|
+
* 3. If the referenced value is null or undefined, skip adding the reference.
|
|
2423
|
+
* 4. Otherwise, add the reference and, if requested, register its context.
|
|
2424
|
+
*
|
|
2425
|
+
* @param reference - The reference definition.
|
|
2426
|
+
* @throws If parent path usage is incorrect.
|
|
2427
|
+
*/
|
|
2428
|
+
addReference(reference) {
|
|
2429
|
+
if (!reference.type.parentType && reference.parentPath) {
|
|
2430
|
+
throw new Error(`Parent path does nothing since reference does not have parent`);
|
|
2431
|
+
}
|
|
2432
|
+
if (reference.type.parentType && !reference.parentPath) {
|
|
2433
|
+
throw new Error(`Parent path required if reference type has parent type`);
|
|
2434
|
+
}
|
|
2435
|
+
// Compute the path without prefix once.
|
|
2436
|
+
const refPathWithoutPrefix = this._constructPathWithoutPrefix(reference.path);
|
|
2437
|
+
// If the path is empty, use the entire data; otherwise, retrieve the value.
|
|
2438
|
+
const refValue = refPathWithoutPrefix.length === 0
|
|
2439
|
+
? this.data
|
|
2440
|
+
: get$1(this.data, refPathWithoutPrefix);
|
|
2441
|
+
if (refValue === undefined || refValue === null)
|
|
2442
|
+
return;
|
|
2443
|
+
const fullPath = this._constructPath(reference.path);
|
|
2444
|
+
this.references.push({
|
|
2445
|
+
type: reference.type,
|
|
2446
|
+
path: fullPath,
|
|
2447
|
+
parentPath: reference.parentPath &&
|
|
2448
|
+
reference.type.parentType &&
|
|
2449
|
+
this._constructPathWithContext(reference.parentPath, reference.type.parentType),
|
|
2450
|
+
onDelete: reference.onDelete,
|
|
2451
|
+
});
|
|
2452
|
+
// Optionally, add this path to the shared context.
|
|
2453
|
+
if (reference.addContext) {
|
|
2454
|
+
this._addPathToContext(fullPath, reference.type, reference.addContext);
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
/**
|
|
2458
|
+
* Registers an entity based on the provided definition.
|
|
2459
|
+
*
|
|
2460
|
+
* Flow:
|
|
2461
|
+
* 1. Validate that not both a name and a name reference path are provided.
|
|
2462
|
+
* 2. Compute the full entity path.
|
|
2463
|
+
* 3. Resolve the entity ID:
|
|
2464
|
+
* - Use the provided idPath if available; otherwise, default to appending 'id'
|
|
2465
|
+
* to the entity path.
|
|
2466
|
+
* - If no id is found, generate a new one.
|
|
2467
|
+
* 4. Resolve the entity name:
|
|
2468
|
+
* - Use the provided resolveName if available; otherwise, default to using the
|
|
2469
|
+
* name path.
|
|
2470
|
+
* 5. Register the entity in either the direct entities list or the name-ref list.
|
|
2471
|
+
* 6. Optionally, add the entity’s id path to the shared context.
|
|
2472
|
+
*
|
|
2473
|
+
* @param entity - The entity definition.
|
|
2474
|
+
* @throws If both name and nameRefPath are provided or if no name is resolved.
|
|
2475
|
+
*/
|
|
2476
|
+
addEntity(entity) {
|
|
2477
|
+
// Build the full path for the entity.
|
|
2478
|
+
const path = this._constructPath(entity.path);
|
|
2479
|
+
// Resolve the id path: if provided use it; otherwise, assume the id is at "entity.path.id"
|
|
2480
|
+
const idPath = entity.idPath
|
|
2481
|
+
? this._constructPathWithoutPrefix(entity.idPath)
|
|
2482
|
+
: [...this._constructPathWithoutPrefix(entity.path), 'id'];
|
|
2483
|
+
const id = get$1(this.data, idPath);
|
|
2484
|
+
if (!id) {
|
|
2485
|
+
throw new Error(`No id found for entity ${entity.type.name}`);
|
|
2486
|
+
}
|
|
2487
|
+
if (!entity.type.isId(id)) {
|
|
2488
|
+
throw new Error(`Invalid id: ${id} for entity ${entity.type.name}`);
|
|
2489
|
+
}
|
|
2490
|
+
// Resolve the name: if getNameResolver is provided, use it to build the name resolver; otherwise,
|
|
2491
|
+
// use the default name resolver.
|
|
2492
|
+
const getNameResolver = entity.getNameResolver ?? ((value) => get$1(value, 'name'));
|
|
2493
|
+
const nameResolver = getNameResolver(stripRefMarkers(this.data));
|
|
2494
|
+
// Base entity definition shared between regular entities and those with a name reference.
|
|
2495
|
+
const entityBase = {
|
|
2496
|
+
id,
|
|
2497
|
+
type: entity.type,
|
|
2498
|
+
path,
|
|
2499
|
+
idPath: [...this.pathPrefix, ...idPath],
|
|
2500
|
+
parentPath: entity.parentPath &&
|
|
2501
|
+
entity.type.parentType &&
|
|
2502
|
+
this._constructPathWithContext(entity.parentPath, entity.type.parentType),
|
|
2503
|
+
};
|
|
2504
|
+
this.entitiesWithNameResolver.push({
|
|
2505
|
+
...entityBase,
|
|
2506
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- needed to allow more specific generic typed to be put in here
|
|
2507
|
+
nameResolver: typeof nameResolver === 'string'
|
|
2508
|
+
? { resolveName: () => nameResolver }
|
|
2509
|
+
: nameResolver,
|
|
2510
|
+
});
|
|
2511
|
+
// Optionally add the id path to the context.
|
|
2512
|
+
if (entity.addContext) {
|
|
2513
|
+
this._addPathToContext([...this.pathPrefix, ...idPath], entity.type, entity.addContext);
|
|
2514
|
+
}
|
|
2515
|
+
}
|
|
2516
|
+
/**
|
|
2517
|
+
* Registers a given path into the builder's context map.
|
|
2518
|
+
* @param path - The full reference path.
|
|
2519
|
+
* @param type - The entity type associated with the path.
|
|
2520
|
+
* @param context - A unique key to identify this context.
|
|
2521
|
+
* @throws If the context key is already registered.
|
|
2522
|
+
*/
|
|
2523
|
+
_addPathToContext(path, type, context) {
|
|
2524
|
+
// For now, allow overriding contexts to maintain compatibility
|
|
2525
|
+
this.pathMap.set(context, { path, type });
|
|
2526
|
+
// Also register in the shared context for other builders to access
|
|
2527
|
+
this.context.pathMap.set(context, { path, type });
|
|
2528
|
+
}
|
|
2529
|
+
/**
|
|
2530
|
+
* Convenience method that builds a full path from a dot-separated string and
|
|
2531
|
+
* adds it to the context.
|
|
2532
|
+
* @param path - The dot-separated string path.
|
|
2533
|
+
* @param type - The entity type.
|
|
2534
|
+
* @param context - The context key.
|
|
2535
|
+
*/
|
|
2536
|
+
addPathToContext(path, type, context) {
|
|
2537
|
+
this._addPathToContext(this._constructPath(path), type, context);
|
|
2538
|
+
}
|
|
2539
|
+
}
|
|
2540
|
+
|
|
2541
|
+
function extractDefinitionRefsRecursive(value, context, path) {
|
|
2542
|
+
const builder = new DefinitionRefBuilder(path, context.context, value);
|
|
2543
|
+
if (value instanceof DefinitionReferenceMarker) {
|
|
2544
|
+
builder.addReference(value.reference);
|
|
2545
|
+
context.references.push(...builder.references);
|
|
2546
|
+
context.entitiesWithNameResolver.push(...builder.entitiesWithNameResolver);
|
|
2547
|
+
return value.value;
|
|
2548
|
+
}
|
|
2549
|
+
if (typeof value === 'object' &&
|
|
2550
|
+
value !== null &&
|
|
2551
|
+
REF_ANNOTATIONS_MARKER_SYMBOL in value) {
|
|
2552
|
+
const annotations = value[REF_ANNOTATIONS_MARKER_SYMBOL];
|
|
2553
|
+
for (const entity of annotations.entities) {
|
|
2554
|
+
builder.addEntity(entity);
|
|
2555
|
+
}
|
|
2556
|
+
for (const reference of annotations.references) {
|
|
2557
|
+
builder.addReference(reference);
|
|
2558
|
+
}
|
|
2559
|
+
for (const pathInfo of annotations.contextPaths) {
|
|
2560
|
+
builder.addPathToContext(pathInfo.path, pathInfo.type, pathInfo.context);
|
|
2561
|
+
}
|
|
2562
|
+
context.references.push(...builder.references);
|
|
2563
|
+
context.entitiesWithNameResolver.push(...builder.entitiesWithNameResolver);
|
|
2564
|
+
// Remove the marker symbol and process the clean object
|
|
2565
|
+
const { [REF_ANNOTATIONS_MARKER_SYMBOL]: _, ...cleanValue } = value;
|
|
2566
|
+
// Process the clean object recursively
|
|
2567
|
+
return Object.fromEntries(Object.entries(cleanValue).map(([key, childValue]) => [
|
|
2568
|
+
key,
|
|
2569
|
+
extractDefinitionRefsRecursive(childValue, context, [...path, key]),
|
|
2570
|
+
]));
|
|
2571
|
+
}
|
|
2572
|
+
// Run recursively for arrays first (arrays are also objects)
|
|
2573
|
+
if (Array.isArray(value)) {
|
|
2574
|
+
return value.map((element, i) => extractDefinitionRefsRecursive(element, context, [...path, i]));
|
|
2575
|
+
}
|
|
2576
|
+
// Run recursively for regular objects
|
|
2577
|
+
if (typeof value === 'object' && value !== null) {
|
|
2578
|
+
return Object.fromEntries(Object.entries(value).map(([key, childValue]) => [
|
|
2579
|
+
key,
|
|
2580
|
+
extractDefinitionRefsRecursive(childValue, context, [...path, key]),
|
|
2581
|
+
]));
|
|
2582
|
+
}
|
|
2583
|
+
// Return primitive values as-is
|
|
2584
|
+
return value;
|
|
2585
|
+
}
|
|
2586
|
+
function extractDefinitionRefs(value) {
|
|
2587
|
+
const refContext = {
|
|
2588
|
+
context: {
|
|
2589
|
+
pathMap: new Map(),
|
|
2590
|
+
},
|
|
2591
|
+
references: [],
|
|
2592
|
+
entitiesWithNameResolver: [],
|
|
2593
|
+
};
|
|
2594
|
+
const cleanData = extractDefinitionRefsRecursive(value, refContext, []);
|
|
2595
|
+
// Simple sanity check to make sure we don't have duplicate IDs
|
|
2596
|
+
const idSet = new Set();
|
|
2597
|
+
for (const entity of refContext.entitiesWithNameResolver) {
|
|
2598
|
+
if (idSet.has(entity.id)) {
|
|
2599
|
+
throw new Error(`Duplicate ID found: ${entity.id}`);
|
|
2600
|
+
}
|
|
2601
|
+
idSet.add(entity.id);
|
|
2602
|
+
}
|
|
2603
|
+
return {
|
|
2604
|
+
data: cleanData,
|
|
2605
|
+
references: refContext.references,
|
|
2606
|
+
entitiesWithNameResolver: refContext.entitiesWithNameResolver,
|
|
2607
|
+
};
|
|
2608
|
+
}
|
|
2609
|
+
|
|
2273
2610
|
/**
|
|
2274
2611
|
* Resolves entity names in a ZodRefPayload.
|
|
2275
2612
|
*
|
|
@@ -2329,19 +2666,47 @@ function resolveZodRefPayloadNames(payload, { skipReferenceNameResolution = fals
|
|
|
2329
2666
|
*
|
|
2330
2667
|
* @returns The parsed data.
|
|
2331
2668
|
*/
|
|
2332
|
-
function
|
|
2333
|
-
const
|
|
2334
|
-
|
|
2669
|
+
function parseSchemaWithTransformedReferences(schemaCreator, input, schemaCreatorOptions, options) {
|
|
2670
|
+
const schemaContext = createDefinitionSchemaParserContext({
|
|
2671
|
+
...schemaCreatorOptions,
|
|
2672
|
+
transformReferences: true,
|
|
2673
|
+
});
|
|
2674
|
+
const schema = schemaCreator(schemaContext);
|
|
2675
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- using the type T which can be any zod schema
|
|
2676
|
+
const value = schema.parse(input);
|
|
2677
|
+
const refPayload = extractDefinitionRefs(value);
|
|
2678
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return -- using the type T which can be any zod schema
|
|
2679
|
+
return resolveZodRefPayloadNames(refPayload, options);
|
|
2335
2680
|
}
|
|
2336
2681
|
|
|
2337
2682
|
function referenceToNameParentId(name, parentId) {
|
|
2338
2683
|
return JSON.stringify({ name, parentId });
|
|
2339
2684
|
}
|
|
2340
|
-
|
|
2341
|
-
|
|
2685
|
+
/**
|
|
2686
|
+
* Deserialize a schema with references using the new transform-based approach.
|
|
2687
|
+
* This function converts human-readable names back to entity IDs.
|
|
2688
|
+
*
|
|
2689
|
+
* @template T - The schema creator type
|
|
2690
|
+
* @param schemaCreator - The schema creator function
|
|
2691
|
+
* @param input - The input data with names instead of IDs
|
|
2692
|
+
* @param options - Options for the schema creator (excluding transformReferences)
|
|
2693
|
+
* @returns The resolved payload with IDs instead of names
|
|
2694
|
+
*/
|
|
2695
|
+
function deserializeSchemaWithTransformedReferences(schemaCreator, input, options) {
|
|
2696
|
+
const payload = parseSchemaWithTransformedReferences(schemaCreator, input, options, {
|
|
2342
2697
|
skipReferenceNameResolution: true,
|
|
2343
2698
|
});
|
|
2344
|
-
//
|
|
2699
|
+
// Use the same resolution logic as the original function
|
|
2700
|
+
return resolveReferencesToIds(payload);
|
|
2701
|
+
}
|
|
2702
|
+
/**
|
|
2703
|
+
* Internal function to resolve entity names to IDs in the payload.
|
|
2704
|
+
* This is shared logic between the old and new approaches.
|
|
2705
|
+
*
|
|
2706
|
+
* @param payload - The parsed payload with entities and references
|
|
2707
|
+
* @returns The payload with references resolved to IDs
|
|
2708
|
+
*/
|
|
2709
|
+
function resolveReferencesToIds(payload) {
|
|
2345
2710
|
const { references, entities, data } = payload;
|
|
2346
2711
|
// check we don't have more entities than IDs
|
|
2347
2712
|
const entitiesById = groupBy(entities, (entity) => entity.id);
|
|
@@ -2403,13 +2768,13 @@ const DELETED_SENTINEL_ID = 'deleted-sentinel-id';
|
|
|
2403
2768
|
/**
|
|
2404
2769
|
* Fixes any reference deletions by performing the appropriate action for the reference
|
|
2405
2770
|
*/
|
|
2406
|
-
function fixRefDeletions(
|
|
2771
|
+
function fixRefDeletions(schemaCreator, value, schemaCreatorOptions) {
|
|
2407
2772
|
const issues = [];
|
|
2408
2773
|
// find all references that do not have a corresponding entity
|
|
2409
2774
|
let iterations;
|
|
2410
2775
|
let valueToEdit = value;
|
|
2411
2776
|
for (iterations = 0; iterations < 100; iterations++) {
|
|
2412
|
-
const parseResult =
|
|
2777
|
+
const parseResult = parseSchemaWithTransformedReferences(schemaCreator, valueToEdit, schemaCreatorOptions, {
|
|
2413
2778
|
allowInvalidReferences: true,
|
|
2414
2779
|
});
|
|
2415
2780
|
const { references, entities } = parseResult;
|
|
@@ -2452,8 +2817,16 @@ function fixRefDeletions(schema, value) {
|
|
|
2452
2817
|
for (const ref of referencesMissingEntity) {
|
|
2453
2818
|
const id = get$1(valueToEdit, ref.path);
|
|
2454
2819
|
switch (ref.onDelete) {
|
|
2455
|
-
case '
|
|
2456
|
-
|
|
2820
|
+
case 'SET_UNDEFINED': {
|
|
2821
|
+
// Check if reference is inside an array
|
|
2822
|
+
if (ref.path.length > 0) {
|
|
2823
|
+
const parentPath = ref.path.slice(0, -1);
|
|
2824
|
+
const parent = get$1(valueToEdit, parentPath);
|
|
2825
|
+
if (Array.isArray(parent)) {
|
|
2826
|
+
throw new TypeError(`SET_UNDEFINED cannot be used for references inside arrays at path ${ref.path.join('.')}. Use DELETE instead to remove the array element.`);
|
|
2827
|
+
}
|
|
2828
|
+
}
|
|
2829
|
+
set$1(valueToEdit, ref.path, undefined);
|
|
2457
2830
|
break;
|
|
2458
2831
|
}
|
|
2459
2832
|
case 'RESTRICT': {
|
|
@@ -2508,32 +2881,12 @@ function serializeSchemaFromRefPayload(payload) {
|
|
|
2508
2881
|
}
|
|
2509
2882
|
})(data);
|
|
2510
2883
|
}
|
|
2511
|
-
function serializeSchema(
|
|
2512
|
-
const payload =
|
|
2884
|
+
function serializeSchema(schemaCreator, value, schemaCreatorOptions) {
|
|
2885
|
+
const payload = parseSchemaWithTransformedReferences(schemaCreator, value, schemaCreatorOptions);
|
|
2886
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return -- typed as def.InferOutput<T>
|
|
2513
2887
|
return serializeSchemaFromRefPayload(payload);
|
|
2514
2888
|
}
|
|
2515
2889
|
|
|
2516
|
-
const authRoleEntityType = createEntityType('role');
|
|
2517
|
-
|
|
2518
|
-
const appEntityType = createEntityType('app');
|
|
2519
|
-
function createAppEntryType(name) {
|
|
2520
|
-
return name;
|
|
2521
|
-
}
|
|
2522
|
-
|
|
2523
|
-
const {z: z$j} = await importShared('zod');
|
|
2524
|
-
const baseAppValidators = {
|
|
2525
|
-
id: z$j.string().default(appEntityType.generateNewId()),
|
|
2526
|
-
name: CASE_VALIDATORS.KEBAB_CASE,
|
|
2527
|
-
type: z$j.string(),
|
|
2528
|
-
packageLocation: z$j
|
|
2529
|
-
.string()
|
|
2530
|
-
.regex(/^(?!.*(?:\/|\.\.)\/)(?!^\.\.$)(?!^\.$)(?:[\w\-.]+\/?)+[\w\-.]*|^$/, {
|
|
2531
|
-
message: 'Invalid package location. Must be a valid subdirectory.',
|
|
2532
|
-
})
|
|
2533
|
-
.optional(),
|
|
2534
|
-
};
|
|
2535
|
-
const baseAppSchema = z$j.object(baseAppValidators);
|
|
2536
|
-
|
|
2537
2890
|
const SCALAR_FIELD_TYPES = [
|
|
2538
2891
|
'string',
|
|
2539
2892
|
'uuid',
|
|
@@ -2599,113 +2952,68 @@ const VALIDATORS = {
|
|
|
2599
2952
|
};
|
|
2600
2953
|
|
|
2601
2954
|
const {z: z$g} = await importShared('zod');
|
|
2602
|
-
const
|
|
2603
|
-
.array(zRef(z$g.string(), {
|
|
2955
|
+
const createRoleArray = definitionSchema((ctx) => ctx.withDefault(z$g.array(ctx.withRef({
|
|
2604
2956
|
type: authRoleEntityType,
|
|
2605
2957
|
onDelete: 'DELETE',
|
|
2606
|
-
}))
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
.
|
|
2611
|
-
enabled: z$g.boolean().default(false),
|
|
2612
|
-
fields: z$g.array(zRef(z$g.string(), {
|
|
2958
|
+
})), []));
|
|
2959
|
+
const createModelGraphqlSchema = definitionSchema((ctx) => z$g.object({
|
|
2960
|
+
objectType: ctx.withDefault(z$g.object({
|
|
2961
|
+
enabled: ctx.withDefault(z$g.boolean(), false),
|
|
2962
|
+
fields: ctx.withDefault(z$g.array(ctx.withRef({
|
|
2613
2963
|
type: modelScalarFieldEntityType,
|
|
2614
2964
|
onDelete: 'DELETE',
|
|
2615
2965
|
parentPath: { context: 'model' },
|
|
2616
|
-
})),
|
|
2617
|
-
localRelations: z$g
|
|
2618
|
-
.array(zRef(z$g.string(), {
|
|
2966
|
+
})), []),
|
|
2967
|
+
localRelations: ctx.withDefault(z$g.array(ctx.withRef({
|
|
2619
2968
|
type: modelLocalRelationEntityType,
|
|
2620
2969
|
onDelete: 'DELETE',
|
|
2621
2970
|
parentPath: { context: 'model' },
|
|
2622
|
-
}))
|
|
2623
|
-
|
|
2624
|
-
foreignRelations: z$g
|
|
2625
|
-
.array(zRef(z$g.string(), {
|
|
2971
|
+
})), []),
|
|
2972
|
+
foreignRelations: ctx.withDefault(z$g.array(ctx.withRef({
|
|
2626
2973
|
type: modelForeignRelationEntityType,
|
|
2627
2974
|
onDelete: 'DELETE',
|
|
2628
2975
|
parentPath: { context: 'model' },
|
|
2629
|
-
}))
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
.
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
.
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
},
|
|
2656
|
-
list: {
|
|
2657
|
-
enabled: false,
|
|
2658
|
-
roles: [],
|
|
2659
|
-
},
|
|
2660
|
-
}),
|
|
2661
|
-
mutations: z$g
|
|
2662
|
-
.object({
|
|
2663
|
-
create: z$g
|
|
2664
|
-
.object({
|
|
2665
|
-
enabled: z$g.boolean().optional(),
|
|
2666
|
-
roles: roleArray,
|
|
2667
|
-
})
|
|
2668
|
-
.default({
|
|
2669
|
-
enabled: false,
|
|
2670
|
-
roles: [],
|
|
2671
|
-
}),
|
|
2672
|
-
update: z$g
|
|
2673
|
-
.object({
|
|
2674
|
-
enabled: z$g.boolean().optional(),
|
|
2675
|
-
roles: roleArray,
|
|
2676
|
-
})
|
|
2677
|
-
.default({
|
|
2678
|
-
enabled: false,
|
|
2679
|
-
roles: [],
|
|
2680
|
-
}),
|
|
2681
|
-
delete: z$g
|
|
2682
|
-
.object({
|
|
2683
|
-
enabled: z$g.boolean().optional(),
|
|
2684
|
-
roles: roleArray,
|
|
2685
|
-
})
|
|
2686
|
-
.default({
|
|
2687
|
-
enabled: false,
|
|
2688
|
-
roles: [],
|
|
2689
|
-
}),
|
|
2690
|
-
})
|
|
2691
|
-
.default({}),
|
|
2976
|
+
})), []),
|
|
2977
|
+
}), {}),
|
|
2978
|
+
queries: ctx.withDefault(z$g.object({
|
|
2979
|
+
get: ctx.withDefault(z$g.object({
|
|
2980
|
+
enabled: ctx.withDefault(z$g.boolean(), false),
|
|
2981
|
+
roles: createRoleArray(ctx),
|
|
2982
|
+
}), {}),
|
|
2983
|
+
list: ctx.withDefault(z$g.object({
|
|
2984
|
+
enabled: ctx.withDefault(z$g.boolean(), false),
|
|
2985
|
+
roles: createRoleArray(ctx),
|
|
2986
|
+
}), {}),
|
|
2987
|
+
}), {}),
|
|
2988
|
+
mutations: ctx.withDefault(z$g.object({
|
|
2989
|
+
create: ctx.withDefault(z$g.object({
|
|
2990
|
+
enabled: ctx.withDefault(z$g.boolean(), false),
|
|
2991
|
+
roles: createRoleArray(ctx),
|
|
2992
|
+
}), {}),
|
|
2993
|
+
update: ctx.withDefault(z$g.object({
|
|
2994
|
+
enabled: ctx.withDefault(z$g.boolean(), false),
|
|
2995
|
+
roles: createRoleArray(ctx),
|
|
2996
|
+
}), {}),
|
|
2997
|
+
delete: ctx.withDefault(z$g.object({
|
|
2998
|
+
enabled: ctx.withDefault(z$g.boolean(), false),
|
|
2999
|
+
roles: createRoleArray(ctx),
|
|
3000
|
+
}), {}),
|
|
3001
|
+
}), {}),
|
|
2692
3002
|
}));
|
|
2693
3003
|
|
|
2694
3004
|
const {z: z$f} = await importShared('zod');
|
|
2695
3005
|
|
|
2696
3006
|
const baseTransformerFields = {
|
|
3007
|
+
id: z$f.string(),
|
|
2697
3008
|
type: z$f.string().min(1),
|
|
2698
3009
|
};
|
|
2699
|
-
const baseTransformerSchema = z$f.object(
|
|
2700
|
-
id: z$f.string(),
|
|
2701
|
-
...baseTransformerFields,
|
|
2702
|
-
});
|
|
3010
|
+
const baseTransformerSchema = z$f.object(baseTransformerFields);
|
|
2703
3011
|
function createModelTransformerType(payload) {
|
|
2704
3012
|
return payload;
|
|
2705
3013
|
}
|
|
2706
3014
|
|
|
2707
3015
|
const {z: z$e} = await importShared('zod');
|
|
2708
|
-
const createPasswordTransformerSchema = definitionSchema(() =>
|
|
3016
|
+
const createPasswordTransformerSchema = definitionSchema((ctx) => ctx.withEnt(z$e.object({
|
|
2709
3017
|
...baseTransformerFields,
|
|
2710
3018
|
type: z$e.literal('password'),
|
|
2711
3019
|
}), {
|
|
@@ -2713,27 +3021,27 @@ const createPasswordTransformerSchema = definitionSchema(() => zEnt(z$e.object({
|
|
|
2713
3021
|
parentPath: { context: 'model' },
|
|
2714
3022
|
getNameResolver: () => 'password',
|
|
2715
3023
|
}));
|
|
2716
|
-
const createEmbeddedRelationTransformerSchema = definitionSchema(() =>
|
|
3024
|
+
const createEmbeddedRelationTransformerSchema = definitionSchema((ctx) => ctx.withRefBuilder(ctx.withEnt(z$e.object({
|
|
2717
3025
|
...baseTransformerFields,
|
|
2718
|
-
foreignRelationRef:
|
|
3026
|
+
foreignRelationRef: ctx.withRef({
|
|
2719
3027
|
type: modelForeignRelationEntityType,
|
|
2720
3028
|
onDelete: 'DELETE_PARENT',
|
|
2721
3029
|
parentPath: { context: 'model' },
|
|
2722
3030
|
}),
|
|
2723
3031
|
type: z$e.literal('embeddedRelation'),
|
|
2724
|
-
embeddedFieldNames: z$e.array(
|
|
3032
|
+
embeddedFieldNames: z$e.array(ctx.withRef({
|
|
2725
3033
|
type: modelScalarFieldEntityType,
|
|
2726
3034
|
onDelete: 'RESTRICT',
|
|
2727
3035
|
parentPath: { context: 'embeddedModel' },
|
|
2728
3036
|
})),
|
|
2729
3037
|
embeddedTransformerNames: z$e
|
|
2730
|
-
.array(
|
|
3038
|
+
.array(ctx.withRef({
|
|
2731
3039
|
type: modelTransformerEntityType,
|
|
2732
3040
|
onDelete: 'RESTRICT',
|
|
2733
3041
|
parentPath: { context: 'embeddedModel' },
|
|
2734
3042
|
}))
|
|
2735
3043
|
.optional(),
|
|
2736
|
-
modelRef:
|
|
3044
|
+
modelRef: ctx.withRef({
|
|
2737
3045
|
type: modelEntityType,
|
|
2738
3046
|
onDelete: 'RESTRICT',
|
|
2739
3047
|
}),
|
|
@@ -2744,18 +3052,18 @@ const createEmbeddedRelationTransformerSchema = definitionSchema(() => zEnt(z$e.
|
|
|
2744
3052
|
idsToResolve: { foreignRelation: entity.foreignRelationRef },
|
|
2745
3053
|
resolveName: (entityNames) => entityNames.foreignRelation,
|
|
2746
3054
|
}),
|
|
2747
|
-
})
|
|
3055
|
+
}), (builder) => {
|
|
2748
3056
|
builder.addPathToContext('modelRef', modelEntityType, 'embeddedModel');
|
|
2749
3057
|
}));
|
|
2750
3058
|
const BUILT_IN_TRANSFORMERS = [
|
|
2751
3059
|
createModelTransformerType({
|
|
2752
3060
|
name: 'password',
|
|
2753
|
-
|
|
3061
|
+
createSchema: createPasswordTransformerSchema,
|
|
2754
3062
|
getName: () => 'Password',
|
|
2755
3063
|
}),
|
|
2756
3064
|
createModelTransformerType({
|
|
2757
3065
|
name: 'embeddedRelation',
|
|
2758
|
-
|
|
3066
|
+
createSchema: createEmbeddedRelationTransformerSchema,
|
|
2759
3067
|
getName: (definitionContainer, definition) => definitionContainer.nameFromId(definition.foreignRelationRef),
|
|
2760
3068
|
}),
|
|
2761
3069
|
];
|
|
@@ -2793,16 +3101,22 @@ const modelTransformerSpec = createPluginSpec('core/model-transformer', {
|
|
|
2793
3101
|
defaultInitializer: createModelTransformerImplementation,
|
|
2794
3102
|
});
|
|
2795
3103
|
|
|
2796
|
-
const createTransformerSchema = definitionSchema((ctx) =>
|
|
2797
|
-
const { type } =
|
|
2798
|
-
const transformer = plugins
|
|
3104
|
+
const createTransformerSchema = definitionSchema((ctx) => baseTransformerSchema.passthrough().transform((data, parseCtx) => {
|
|
3105
|
+
const { type } = data;
|
|
3106
|
+
const transformer = ctx.plugins
|
|
2799
3107
|
.getPluginSpec(modelTransformerSpec)
|
|
2800
3108
|
.getModelTransformer(type);
|
|
2801
|
-
return transformer
|
|
3109
|
+
return transformer
|
|
3110
|
+
.createSchema(ctx)
|
|
3111
|
+
.and(baseTransformerSchema)
|
|
3112
|
+
.parse(data, {
|
|
3113
|
+
path: parseCtx.path,
|
|
3114
|
+
});
|
|
2802
3115
|
}));
|
|
2803
3116
|
|
|
2804
3117
|
const {z: z$d} = await importShared('zod');
|
|
2805
|
-
const createEnumValueSchema = definitionSchema(() =>
|
|
3118
|
+
const createEnumValueSchema = definitionSchema((ctx) => ctx.withEnt(z$d.object({
|
|
3119
|
+
id: z$d.string(),
|
|
2806
3120
|
name: z$d.string().min(1),
|
|
2807
3121
|
friendlyName: z$d.string().min(1),
|
|
2808
3122
|
}), {
|
|
@@ -2810,25 +3124,28 @@ const createEnumValueSchema = definitionSchema(() => zEnt(z$d.object({
|
|
|
2810
3124
|
parentPath: { context: 'enum' },
|
|
2811
3125
|
}));
|
|
2812
3126
|
const createEnumBaseSchema = definitionSchema((ctx) => z$d.object({
|
|
3127
|
+
id: z$d.string(),
|
|
2813
3128
|
name: z$d.string().min(1),
|
|
2814
|
-
featureRef:
|
|
3129
|
+
featureRef: ctx.withRef({
|
|
2815
3130
|
type: featureEntityType,
|
|
2816
3131
|
onDelete: 'RESTRICT',
|
|
2817
3132
|
}),
|
|
2818
3133
|
values: z$d.array(createEnumValueSchema(ctx)),
|
|
2819
3134
|
isExposed: z$d.boolean(),
|
|
2820
3135
|
}));
|
|
2821
|
-
const createEnumSchema = definitionSchema((ctx) =>
|
|
3136
|
+
const createEnumSchema = definitionSchema((ctx) => ctx.withEnt(createEnumBaseSchema(ctx), {
|
|
2822
3137
|
type: modelEnumEntityType,
|
|
2823
3138
|
addContext: 'enum',
|
|
2824
3139
|
}));
|
|
2825
3140
|
|
|
2826
3141
|
const {z: z$c} = await importShared('zod');
|
|
2827
|
-
const createModelScalarFieldSchema = definitionSchema(() =>
|
|
3142
|
+
const createModelScalarFieldSchema = definitionSchema((ctx) => ctx
|
|
3143
|
+
.withEnt(z$c.object({
|
|
3144
|
+
id: z$c.string(),
|
|
2828
3145
|
name: VALIDATORS.CAMEL_CASE_STRING,
|
|
2829
3146
|
type: z$c.enum(SCALAR_FIELD_TYPES),
|
|
2830
3147
|
isOptional: z$c.boolean().default(false),
|
|
2831
|
-
options:
|
|
3148
|
+
options: ctx.withRefBuilder(z$c
|
|
2832
3149
|
.object({
|
|
2833
3150
|
// string options
|
|
2834
3151
|
default: z$c.string().default(''),
|
|
@@ -2838,10 +3155,12 @@ const createModelScalarFieldSchema = definitionSchema(() => zEnt(z$c.object({
|
|
|
2838
3155
|
updatedAt: z$c.boolean().optional(),
|
|
2839
3156
|
defaultToNow: z$c.boolean().optional(),
|
|
2840
3157
|
// enum options
|
|
2841
|
-
enumRef:
|
|
3158
|
+
enumRef: ctx
|
|
3159
|
+
.withRef({
|
|
2842
3160
|
type: modelEnumEntityType,
|
|
2843
3161
|
onDelete: 'RESTRICT',
|
|
2844
|
-
})
|
|
3162
|
+
})
|
|
3163
|
+
.optional(),
|
|
2845
3164
|
defaultEnumValueRef: z$c.string().optional(),
|
|
2846
3165
|
})
|
|
2847
3166
|
.transform((val) => ({
|
|
@@ -2894,19 +3213,19 @@ const REFERENTIAL_ACTIONS = [
|
|
|
2894
3213
|
'SetNull',
|
|
2895
3214
|
'SetDefault',
|
|
2896
3215
|
];
|
|
2897
|
-
const createModelRelationFieldSchema = definitionSchema(() =>
|
|
2898
|
-
id:
|
|
3216
|
+
const createModelRelationFieldSchema = definitionSchema((ctx) => ctx.withRefBuilder(z$c.object({
|
|
3217
|
+
id: z$c.string(),
|
|
2899
3218
|
foreignId: z$c
|
|
2900
3219
|
.string()
|
|
2901
3220
|
.default(() => modelForeignRelationEntityType.generateNewId()),
|
|
2902
3221
|
name: VALIDATORS.CAMEL_CASE_STRING,
|
|
2903
3222
|
references: z$c.array(z$c.object({
|
|
2904
|
-
localRef:
|
|
3223
|
+
localRef: ctx.withRef({
|
|
2905
3224
|
type: modelScalarFieldEntityType,
|
|
2906
3225
|
onDelete: 'RESTRICT',
|
|
2907
3226
|
parentPath: { context: 'model' },
|
|
2908
3227
|
}),
|
|
2909
|
-
foreignRef:
|
|
3228
|
+
foreignRef: ctx.withRef({
|
|
2910
3229
|
type: modelScalarFieldEntityType,
|
|
2911
3230
|
onDelete: 'RESTRICT',
|
|
2912
3231
|
parentPath: { context: 'foreignModel' },
|
|
@@ -2934,9 +3253,10 @@ const createModelRelationFieldSchema = definitionSchema(() => zRefBuilder(z$c.ob
|
|
|
2934
3253
|
parentPath: 'modelRef',
|
|
2935
3254
|
});
|
|
2936
3255
|
}));
|
|
2937
|
-
const createModelUniqueConstraintSchema = definitionSchema(() =>
|
|
3256
|
+
const createModelUniqueConstraintSchema = definitionSchema((ctx) => ctx.withEnt(z$c.object({
|
|
3257
|
+
id: z$c.string(),
|
|
2938
3258
|
fields: z$c.array(z$c.object({
|
|
2939
|
-
fieldRef:
|
|
3259
|
+
fieldRef: ctx.withRef({
|
|
2940
3260
|
type: modelScalarFieldEntityType,
|
|
2941
3261
|
onDelete: 'RESTRICT',
|
|
2942
3262
|
parentPath: { context: 'model' },
|
|
@@ -2957,14 +3277,14 @@ const createModelServiceSchema = definitionSchema((ctx) => z$c.object({
|
|
|
2957
3277
|
.object({
|
|
2958
3278
|
enabled: z$c.boolean().default(false),
|
|
2959
3279
|
fields: z$c
|
|
2960
|
-
.array(
|
|
3280
|
+
.array(ctx.withRef({
|
|
2961
3281
|
type: modelScalarFieldEntityType,
|
|
2962
3282
|
onDelete: 'DELETE',
|
|
2963
3283
|
parentPath: { context: 'model' },
|
|
2964
3284
|
}))
|
|
2965
3285
|
.optional(),
|
|
2966
3286
|
transformerNames: z$c
|
|
2967
|
-
.array(
|
|
3287
|
+
.array(ctx.withRef({
|
|
2968
3288
|
type: modelTransformerEntityType,
|
|
2969
3289
|
onDelete: 'DELETE',
|
|
2970
3290
|
parentPath: { context: 'model' },
|
|
@@ -2976,14 +3296,14 @@ const createModelServiceSchema = definitionSchema((ctx) => z$c.object({
|
|
|
2976
3296
|
.object({
|
|
2977
3297
|
enabled: z$c.boolean().default(false),
|
|
2978
3298
|
fields: z$c
|
|
2979
|
-
.array(
|
|
3299
|
+
.array(ctx.withRef({
|
|
2980
3300
|
type: modelScalarFieldEntityType,
|
|
2981
3301
|
onDelete: 'DELETE',
|
|
2982
3302
|
parentPath: { context: 'model' },
|
|
2983
3303
|
}))
|
|
2984
3304
|
.optional(),
|
|
2985
3305
|
transformerNames: z$c
|
|
2986
|
-
.array(
|
|
3306
|
+
.array(ctx.withRef({
|
|
2987
3307
|
type: modelTransformerEntityType,
|
|
2988
3308
|
onDelete: 'DELETE',
|
|
2989
3309
|
parentPath: { context: 'model' },
|
|
@@ -3001,9 +3321,9 @@ const createModelServiceSchema = definitionSchema((ctx) => z$c.object({
|
|
|
3001
3321
|
transformers: z$c.array(createTransformerSchema(ctx)).default([]),
|
|
3002
3322
|
}));
|
|
3003
3323
|
const createModelBaseSchema = definitionSchema((ctx) => z$c.object({
|
|
3004
|
-
id:
|
|
3324
|
+
id: z$c.string(),
|
|
3005
3325
|
name: VALIDATORS.PASCAL_CASE_STRING,
|
|
3006
|
-
featureRef:
|
|
3326
|
+
featureRef: ctx.withRef({
|
|
3007
3327
|
type: featureEntityType,
|
|
3008
3328
|
onDelete: 'RESTRICT',
|
|
3009
3329
|
}),
|
|
@@ -3011,7 +3331,7 @@ const createModelBaseSchema = definitionSchema((ctx) => z$c.object({
|
|
|
3011
3331
|
fields: z$c.array(createModelScalarFieldSchema(ctx)),
|
|
3012
3332
|
relations: z$c.array(createModelRelationFieldSchema(ctx)).optional(),
|
|
3013
3333
|
primaryKeyFieldRefs: z$c
|
|
3014
|
-
.array(
|
|
3334
|
+
.array(ctx.withRef({
|
|
3015
3335
|
type: modelScalarFieldEntityType,
|
|
3016
3336
|
onDelete: 'RESTRICT',
|
|
3017
3337
|
parentPath: { context: 'model' },
|
|
@@ -3029,7 +3349,7 @@ const createModelBaseSchema = definitionSchema((ctx) => z$c.object({
|
|
|
3029
3349
|
}),
|
|
3030
3350
|
graphql: createModelGraphqlSchema(ctx).optional(),
|
|
3031
3351
|
}));
|
|
3032
|
-
const createModelSchema = definitionSchema((ctx) =>
|
|
3352
|
+
const createModelSchema = definitionSchema((ctx) => ctx.withEnt(createModelBaseSchema(ctx), {
|
|
3033
3353
|
type: modelEntityType,
|
|
3034
3354
|
addContext: 'model',
|
|
3035
3355
|
}));
|
|
@@ -3039,16 +3359,16 @@ const adminSectionEntityType = createEntityType('admin-section', {
|
|
|
3039
3359
|
});
|
|
3040
3360
|
|
|
3041
3361
|
const {z: z$b} = await importShared('zod');
|
|
3042
|
-
const
|
|
3362
|
+
const createBaseAdminSectionValidators = definitionSchema((ctx) => z$b.object({
|
|
3043
3363
|
id: z$b.string().default(adminSectionEntityType.generateNewId()),
|
|
3044
3364
|
name: z$b.string().min(1),
|
|
3045
|
-
featureRef:
|
|
3365
|
+
featureRef: ctx.withRef({
|
|
3046
3366
|
type: featureEntityType,
|
|
3047
3367
|
onDelete: 'RESTRICT',
|
|
3048
3368
|
}),
|
|
3049
3369
|
icon: z$b.string().optional(),
|
|
3050
3370
|
type: z$b.string().min(1),
|
|
3051
|
-
};
|
|
3371
|
+
}));
|
|
3052
3372
|
|
|
3053
3373
|
const {z: z$a} = await importShared('zod');
|
|
3054
3374
|
const baseAdminCrudInputSchema = z$a.object({
|
|
@@ -3063,10 +3383,10 @@ const adminCrudEmbeddedFormEntityType = createEntityType('admin-crud-embedded-fo
|
|
|
3063
3383
|
});
|
|
3064
3384
|
|
|
3065
3385
|
const {z: z$9} = await importShared('zod');
|
|
3066
|
-
const createAdminCrudTextInputSchema = definitionSchema(() => z$9.object({
|
|
3386
|
+
const createAdminCrudTextInputSchema = definitionSchema((ctx) => z$9.object({
|
|
3067
3387
|
type: z$9.literal('text'),
|
|
3068
3388
|
label: z$9.string().min(1),
|
|
3069
|
-
modelFieldRef:
|
|
3389
|
+
modelFieldRef: ctx.withRef({
|
|
3070
3390
|
type: modelScalarFieldEntityType,
|
|
3071
3391
|
onDelete: 'RESTRICT',
|
|
3072
3392
|
parentPath: { context: 'model' },
|
|
@@ -3075,12 +3395,12 @@ const createAdminCrudTextInputSchema = definitionSchema(() => z$9.object({
|
|
|
3075
3395
|
}));
|
|
3076
3396
|
const adminCrudTextInputType = createAdminCrudInputType({
|
|
3077
3397
|
name: 'text',
|
|
3078
|
-
|
|
3398
|
+
createSchema: createAdminCrudTextInputSchema,
|
|
3079
3399
|
});
|
|
3080
|
-
const createAdminCrudForeignInputSchema = definitionSchema(() => z$9.object({
|
|
3400
|
+
const createAdminCrudForeignInputSchema = definitionSchema((ctx) => z$9.object({
|
|
3081
3401
|
type: z$9.literal('foreign'),
|
|
3082
3402
|
label: z$9.string().min(1),
|
|
3083
|
-
localRelationRef:
|
|
3403
|
+
localRelationRef: ctx.withRef({
|
|
3084
3404
|
type: modelLocalRelationEntityType,
|
|
3085
3405
|
onDelete: 'RESTRICT',
|
|
3086
3406
|
parentPath: { context: 'model' },
|
|
@@ -3092,12 +3412,12 @@ const createAdminCrudForeignInputSchema = definitionSchema(() => z$9.object({
|
|
|
3092
3412
|
}));
|
|
3093
3413
|
const adminCrudForeignInputType = createAdminCrudInputType({
|
|
3094
3414
|
name: 'foreign',
|
|
3095
|
-
|
|
3415
|
+
createSchema: createAdminCrudForeignInputSchema,
|
|
3096
3416
|
});
|
|
3097
|
-
const createAdminCrudEnumInputSchema = definitionSchema(() => z$9.object({
|
|
3417
|
+
const createAdminCrudEnumInputSchema = definitionSchema((ctx) => z$9.object({
|
|
3098
3418
|
type: z$9.literal('enum'),
|
|
3099
3419
|
label: z$9.string().min(1),
|
|
3100
|
-
modelFieldRef:
|
|
3420
|
+
modelFieldRef: ctx.withRef({
|
|
3101
3421
|
type: modelScalarFieldEntityType,
|
|
3102
3422
|
onDelete: 'RESTRICT',
|
|
3103
3423
|
parentPath: { context: 'model' },
|
|
@@ -3105,17 +3425,17 @@ const createAdminCrudEnumInputSchema = definitionSchema(() => z$9.object({
|
|
|
3105
3425
|
}));
|
|
3106
3426
|
const adminCrudEnumInputType = createAdminCrudInputType({
|
|
3107
3427
|
name: 'enum',
|
|
3108
|
-
|
|
3428
|
+
createSchema: createAdminCrudEnumInputSchema,
|
|
3109
3429
|
});
|
|
3110
|
-
const createAdminCrudEmbeddedInputSchema = definitionSchema(() => z$9.object({
|
|
3430
|
+
const createAdminCrudEmbeddedInputSchema = definitionSchema((ctx) => z$9.object({
|
|
3111
3431
|
type: z$9.literal('embedded'),
|
|
3112
3432
|
label: z$9.string().min(1),
|
|
3113
|
-
modelRelationRef:
|
|
3433
|
+
modelRelationRef: ctx.withRef({
|
|
3114
3434
|
type: modelForeignRelationEntityType,
|
|
3115
3435
|
onDelete: 'RESTRICT',
|
|
3116
3436
|
parentPath: { context: 'model' },
|
|
3117
3437
|
}),
|
|
3118
|
-
embeddedFormRef:
|
|
3438
|
+
embeddedFormRef: ctx.withRef({
|
|
3119
3439
|
type: adminCrudEmbeddedFormEntityType,
|
|
3120
3440
|
parentPath: { context: 'admin-section' },
|
|
3121
3441
|
onDelete: 'RESTRICT',
|
|
@@ -3123,17 +3443,17 @@ const createAdminCrudEmbeddedInputSchema = definitionSchema(() => z$9.object({
|
|
|
3123
3443
|
}));
|
|
3124
3444
|
const adminCrudEmbeddedInputType = createAdminCrudInputType({
|
|
3125
3445
|
name: 'embedded',
|
|
3126
|
-
|
|
3446
|
+
createSchema: createAdminCrudEmbeddedInputSchema,
|
|
3127
3447
|
});
|
|
3128
|
-
const createAdminCrudEmbeddedLocalInputSchema = definitionSchema(() => z$9.object({
|
|
3448
|
+
const createAdminCrudEmbeddedLocalInputSchema = definitionSchema((ctx) => z$9.object({
|
|
3129
3449
|
type: z$9.literal('embeddedLocal'),
|
|
3130
3450
|
label: z$9.string().min(1),
|
|
3131
|
-
localRelationRef:
|
|
3451
|
+
localRelationRef: ctx.withRef({
|
|
3132
3452
|
type: modelLocalRelationEntityType,
|
|
3133
3453
|
onDelete: 'RESTRICT',
|
|
3134
3454
|
parentPath: { context: 'model' },
|
|
3135
3455
|
}),
|
|
3136
|
-
embeddedFormRef:
|
|
3456
|
+
embeddedFormRef: ctx.withRef({
|
|
3137
3457
|
type: adminCrudEmbeddedFormEntityType,
|
|
3138
3458
|
parentPath: { context: 'admin-section' },
|
|
3139
3459
|
onDelete: 'RESTRICT',
|
|
@@ -3141,7 +3461,7 @@ const createAdminCrudEmbeddedLocalInputSchema = definitionSchema(() => z$9.objec
|
|
|
3141
3461
|
}));
|
|
3142
3462
|
const adminCrudEmbeddedLocalInputType = createAdminCrudInputType({
|
|
3143
3463
|
name: 'embeddedLocal',
|
|
3144
|
-
|
|
3464
|
+
createSchema: createAdminCrudEmbeddedLocalInputSchema,
|
|
3145
3465
|
});
|
|
3146
3466
|
const createAdminCrudPasswordInputSchema = definitionSchema(() => z$9.object({
|
|
3147
3467
|
type: z$9.literal('password'),
|
|
@@ -3149,7 +3469,7 @@ const createAdminCrudPasswordInputSchema = definitionSchema(() => z$9.object({
|
|
|
3149
3469
|
}));
|
|
3150
3470
|
const adminCrudPasswordInputType = createAdminCrudInputType({
|
|
3151
3471
|
name: 'password',
|
|
3152
|
-
|
|
3472
|
+
createSchema: createAdminCrudPasswordInputSchema,
|
|
3153
3473
|
});
|
|
3154
3474
|
const BUILT_IN_ADMIN_CRUD_INPUTS = [
|
|
3155
3475
|
adminCrudTextInputType,
|
|
@@ -3188,19 +3508,24 @@ const adminCrudInputSpec = createPluginSpec('core/admin-crud-input', {
|
|
|
3188
3508
|
defaultInitializer: createAdminCrudInputImplementation,
|
|
3189
3509
|
});
|
|
3190
3510
|
|
|
3191
|
-
const createAdminCrudInputSchema = definitionSchema((ctx) =>
|
|
3192
|
-
const { type } =
|
|
3193
|
-
const
|
|
3511
|
+
const createAdminCrudInputSchema = definitionSchema((ctx) => baseAdminCrudInputSchema.passthrough().transform((data, parseCtx) => {
|
|
3512
|
+
const { type } = data;
|
|
3513
|
+
const crudInput = ctx.plugins
|
|
3194
3514
|
.getPluginSpec(adminCrudInputSpec)
|
|
3195
3515
|
.getAdminCrudInput(type);
|
|
3196
|
-
return
|
|
3516
|
+
return crudInput
|
|
3517
|
+
.createSchema(ctx)
|
|
3518
|
+
.and(baseAdminCrudInputSchema)
|
|
3519
|
+
.parse(data, {
|
|
3520
|
+
path: parseCtx.path,
|
|
3521
|
+
});
|
|
3197
3522
|
}));
|
|
3198
3523
|
|
|
3199
3524
|
const {z: z$8} = await importShared('zod');
|
|
3200
3525
|
// Table Columns
|
|
3201
|
-
const createAdminCrudForeignDisplaySchema = definitionSchema(() => z$8.object({
|
|
3526
|
+
const createAdminCrudForeignDisplaySchema = definitionSchema((ctx) => z$8.object({
|
|
3202
3527
|
type: z$8.literal('foreign'),
|
|
3203
|
-
localRelationRef:
|
|
3528
|
+
localRelationRef: ctx.withRef({
|
|
3204
3529
|
type: modelLocalRelationEntityType,
|
|
3205
3530
|
onDelete: 'RESTRICT',
|
|
3206
3531
|
parentPath: { context: 'model' },
|
|
@@ -3208,9 +3533,9 @@ const createAdminCrudForeignDisplaySchema = definitionSchema(() => z$8.object({
|
|
|
3208
3533
|
labelExpression: z$8.string().min(1),
|
|
3209
3534
|
valueExpression: z$8.string().min(1),
|
|
3210
3535
|
}));
|
|
3211
|
-
const createAdminCrudTextDisplaySchema = definitionSchema(() => z$8.object({
|
|
3536
|
+
const createAdminCrudTextDisplaySchema = definitionSchema((ctx) => z$8.object({
|
|
3212
3537
|
type: z$8.literal('text'),
|
|
3213
|
-
modelFieldRef:
|
|
3538
|
+
modelFieldRef: ctx.withRef({
|
|
3214
3539
|
type: modelScalarFieldEntityType,
|
|
3215
3540
|
onDelete: 'RESTRICT',
|
|
3216
3541
|
parentPath: { context: 'model' },
|
|
@@ -3230,7 +3555,7 @@ const createAdminCrudTableColumnSchema = definitionSchema((ctx) => z$8.object({
|
|
|
3230
3555
|
const createAdminCrudEmbeddedObjectSchema = definitionSchema((ctx) => z$8.object({
|
|
3231
3556
|
id: z$8.string().min(1),
|
|
3232
3557
|
name: z$8.string().min(1),
|
|
3233
|
-
modelRef:
|
|
3558
|
+
modelRef: ctx.withRef({
|
|
3234
3559
|
type: modelEntityType,
|
|
3235
3560
|
onDelete: 'RESTRICT',
|
|
3236
3561
|
}),
|
|
@@ -3243,7 +3568,7 @@ const createAdminCrudEmbeddedObjectSchema = definitionSchema((ctx) => z$8.object
|
|
|
3243
3568
|
const createAdminCrudEmbeddedListSchema = definitionSchema((ctx) => z$8.object({
|
|
3244
3569
|
id: z$8.string().min(1),
|
|
3245
3570
|
name: z$8.string().min(1),
|
|
3246
|
-
modelRef:
|
|
3571
|
+
modelRef: ctx.withRef({
|
|
3247
3572
|
type: modelEntityType,
|
|
3248
3573
|
onDelete: 'RESTRICT',
|
|
3249
3574
|
}),
|
|
@@ -3258,7 +3583,7 @@ const createAdminCrudEmbeddedListSchema = definitionSchema((ctx) => z$8.object({
|
|
|
3258
3583
|
fields: z$8.array(createAdminCrudInputSchema(ctx)),
|
|
3259
3584
|
}),
|
|
3260
3585
|
}));
|
|
3261
|
-
const createAdminCrudEmbeddedFormSchema = definitionSchema((ctx) =>
|
|
3586
|
+
const createAdminCrudEmbeddedFormSchema = definitionSchema((ctx) => ctx.withRefBuilder(z$8.discriminatedUnion('type', [
|
|
3262
3587
|
createAdminCrudEmbeddedObjectSchema(ctx),
|
|
3263
3588
|
createAdminCrudEmbeddedListSchema(ctx),
|
|
3264
3589
|
]), (builder) => {
|
|
@@ -3269,10 +3594,9 @@ const createAdminCrudEmbeddedFormSchema = definitionSchema((ctx) => zRefBuilder(
|
|
|
3269
3594
|
builder.addPathToContext('modelRef', modelEntityType, 'model');
|
|
3270
3595
|
}));
|
|
3271
3596
|
// Admin Section
|
|
3272
|
-
const createAdminCrudSectionSchema = definitionSchema((ctx) =>
|
|
3273
|
-
...baseAdminSectionValidators,
|
|
3597
|
+
const createAdminCrudSectionSchema = definitionSchema((ctx) => ctx.withRefBuilder(createBaseAdminSectionValidators(ctx).and(z$8.object({
|
|
3274
3598
|
type: z$8.literal('crud'),
|
|
3275
|
-
modelRef:
|
|
3599
|
+
modelRef: ctx.withRef({
|
|
3276
3600
|
type: modelEntityType,
|
|
3277
3601
|
onDelete: 'RESTRICT',
|
|
3278
3602
|
}),
|
|
@@ -3283,13 +3607,15 @@ const createAdminCrudSectionSchema = definitionSchema((ctx) => zRefBuilder(z$8.o
|
|
|
3283
3607
|
form: z$8.object({
|
|
3284
3608
|
fields: z$8.array(createAdminCrudInputSchema(ctx)),
|
|
3285
3609
|
}),
|
|
3286
|
-
embeddedForms: z$8
|
|
3287
|
-
|
|
3610
|
+
embeddedForms: z$8
|
|
3611
|
+
.array(createAdminCrudEmbeddedFormSchema(ctx))
|
|
3612
|
+
.optional(),
|
|
3613
|
+
})), (builder) => {
|
|
3288
3614
|
builder.addPathToContext('modelRef', modelEntityType, 'model');
|
|
3289
3615
|
}));
|
|
3290
3616
|
|
|
3291
3617
|
const {z: z$7} = await importShared('zod');
|
|
3292
|
-
const createAdminSectionSchema = definitionSchema((ctx) =>
|
|
3618
|
+
const createAdminSectionSchema = definitionSchema((ctx) => ctx.withRefBuilder(createAdminCrudSectionSchema(ctx), (builder) => {
|
|
3293
3619
|
builder.addEntity({
|
|
3294
3620
|
type: adminSectionEntityType,
|
|
3295
3621
|
parentPath: { context: 'app' },
|
|
@@ -3300,7 +3626,7 @@ const createAdminAppSchema = definitionSchema((ctx) => z$7.object({
|
|
|
3300
3626
|
...baseAppValidators,
|
|
3301
3627
|
type: z$7.literal('admin'),
|
|
3302
3628
|
allowedRoles: z$7
|
|
3303
|
-
.array(
|
|
3629
|
+
.array(ctx.withRef({
|
|
3304
3630
|
type: authRoleEntityType,
|
|
3305
3631
|
onDelete: 'DELETE',
|
|
3306
3632
|
}))
|
|
@@ -3323,14 +3649,14 @@ const createBackendAppSchema = definitionSchema(() => z$6.object({
|
|
|
3323
3649
|
const backendAppEntryType = createAppEntryType('backend');
|
|
3324
3650
|
|
|
3325
3651
|
const {z: z$5} = await importShared('zod');
|
|
3326
|
-
const createWebAppSchema = definitionSchema(() => z$5.object({
|
|
3652
|
+
const createWebAppSchema = definitionSchema((ctx) => z$5.object({
|
|
3327
3653
|
...baseAppValidators,
|
|
3328
3654
|
type: z$5.literal('web'),
|
|
3329
3655
|
includeAuth: z$5.boolean().optional(),
|
|
3330
3656
|
title: z$5.string().optional(),
|
|
3331
3657
|
description: z$5.string().optional(),
|
|
3332
3658
|
allowedRoles: z$5
|
|
3333
|
-
.array(
|
|
3659
|
+
.array(ctx.withRef({
|
|
3334
3660
|
type: authRoleEntityType,
|
|
3335
3661
|
onDelete: 'DELETE',
|
|
3336
3662
|
}))
|
|
@@ -3342,28 +3668,31 @@ const webAppEntryType = createAppEntryType('web');
|
|
|
3342
3668
|
|
|
3343
3669
|
const {z: z$4} = await importShared('zod');
|
|
3344
3670
|
const basePluginDefinitionSchema = z$4.object({
|
|
3345
|
-
id: z$4.string()
|
|
3671
|
+
id: z$4.string(),
|
|
3346
3672
|
packageName: z$4.string(),
|
|
3347
3673
|
name: z$4.string(),
|
|
3348
3674
|
version: z$4.string(),
|
|
3349
3675
|
config: z$4.unknown(),
|
|
3350
3676
|
configSchemaVersion: z$4.number().optional(),
|
|
3351
3677
|
});
|
|
3352
|
-
const createPluginWithConfigSchema = definitionSchema(() =>
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3678
|
+
const createPluginWithConfigSchema = definitionSchema((ctx) => ctx
|
|
3679
|
+
.withEnt(basePluginDefinitionSchema.passthrough(), {
|
|
3680
|
+
type: pluginEntityType,
|
|
3681
|
+
})
|
|
3682
|
+
.transform((data, parseCtx) => {
|
|
3683
|
+
const pluginKey = pluginEntityType.keyFromId(data.id);
|
|
3684
|
+
const createConfigSchema = ctx.plugins
|
|
3356
3685
|
.getPluginSpec(pluginConfigSpec)
|
|
3357
|
-
.
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3686
|
+
.getSchemaCreator(pluginKey);
|
|
3687
|
+
let pluginDefinitionSchema = basePluginDefinitionSchema;
|
|
3688
|
+
if (createConfigSchema) {
|
|
3689
|
+
pluginDefinitionSchema = pluginDefinitionSchema.extend({
|
|
3690
|
+
config: createConfigSchema(ctx),
|
|
3691
|
+
});
|
|
3363
3692
|
}
|
|
3364
|
-
return
|
|
3365
|
-
|
|
3366
|
-
})
|
|
3693
|
+
return pluginDefinitionSchema.parse(data, {
|
|
3694
|
+
path: parseCtx.path,
|
|
3695
|
+
});
|
|
3367
3696
|
}));
|
|
3368
3697
|
const createPluginsSchema = definitionSchema((ctx) => z$4.array(createPluginWithConfigSchema(ctx)));
|
|
3369
3698
|
|
|
@@ -3414,7 +3743,7 @@ const createSettingsSchema = definitionSchema((ctx) => z$2.object({
|
|
|
3414
3743
|
}));
|
|
3415
3744
|
|
|
3416
3745
|
const {z: z$1} = await importShared('zod');
|
|
3417
|
-
const createAppSchema = definitionSchema((ctx) =>
|
|
3746
|
+
const createAppSchema = definitionSchema((ctx) => ctx.withRefBuilder(z$1.discriminatedUnion('type', [
|
|
3418
3747
|
createBackendAppSchema(ctx),
|
|
3419
3748
|
createWebAppSchema(ctx),
|
|
3420
3749
|
createAdminAppSchema(ctx),
|
|
@@ -3647,7 +3976,10 @@ function createPluginImplementationStore(pluginStore, projectDefinition) {
|
|
|
3647
3976
|
function createProjectDefinitionSchemaWithContext(projectDefinition, context) {
|
|
3648
3977
|
const { pluginStore } = context;
|
|
3649
3978
|
const pluginImplementationStore = createPluginImplementationStore(pluginStore, projectDefinition);
|
|
3650
|
-
|
|
3979
|
+
const definitionContext = createDefinitionSchemaParserContext({
|
|
3980
|
+
plugins: pluginImplementationStore,
|
|
3981
|
+
});
|
|
3982
|
+
return createProjectDefinitionSchema(definitionContext);
|
|
3651
3983
|
}
|
|
3652
3984
|
function parseProjectDefinitionWithContext(projectDefinition, context) {
|
|
3653
3985
|
const schema = createProjectDefinitionSchemaWithContext(projectDefinition, context);
|
|
@@ -3661,9 +3993,10 @@ function parseProjectDefinitionWithContext(projectDefinition, context) {
|
|
|
3661
3993
|
* @returns The parsed project definition with entities/references
|
|
3662
3994
|
*/
|
|
3663
3995
|
function parseProjectDefinitionWithReferences(projectDefinition, context) {
|
|
3664
|
-
const
|
|
3665
|
-
const
|
|
3666
|
-
|
|
3996
|
+
const { pluginStore } = context;
|
|
3997
|
+
const pluginImplementationStore = createPluginImplementationStore(pluginStore, projectDefinition);
|
|
3998
|
+
const definition = parseSchemaWithTransformedReferences(createProjectDefinitionSchema, projectDefinition, { plugins: pluginImplementationStore });
|
|
3999
|
+
return { definition, pluginStore: pluginImplementationStore };
|
|
3667
4000
|
}
|
|
3668
4001
|
|
|
3669
4002
|
/**
|
|
@@ -3745,8 +4078,9 @@ class ProjectDefinitionContainer {
|
|
|
3745
4078
|
*/
|
|
3746
4079
|
fixRefDeletions(setter) {
|
|
3747
4080
|
const newDefinition = produce(setter)(this.definition);
|
|
3748
|
-
|
|
3749
|
-
|
|
4081
|
+
return fixRefDeletions(createProjectDefinitionSchema, newDefinition, {
|
|
4082
|
+
plugins: this.pluginStore,
|
|
4083
|
+
});
|
|
3750
4084
|
}
|
|
3751
4085
|
/**
|
|
3752
4086
|
* Serializes the project definition resolving references to their names for easier reading.
|
|
@@ -3754,7 +4088,11 @@ class ProjectDefinitionContainer {
|
|
|
3754
4088
|
* @returns The serialized contents of the project definition
|
|
3755
4089
|
*/
|
|
3756
4090
|
toSerializedContents() {
|
|
3757
|
-
|
|
4091
|
+
const serializedContents = serializeSchema(createProjectDefinitionSchema, this.definition, {
|
|
4092
|
+
defaultMode: 'strip',
|
|
4093
|
+
plugins: this.pluginStore,
|
|
4094
|
+
});
|
|
4095
|
+
return stringifyPrettyStable(serializedContents);
|
|
3758
4096
|
}
|
|
3759
4097
|
/**
|
|
3760
4098
|
* Creates a new ProjectDefinitionContainer from a raw project definition.
|
|
@@ -3775,8 +4113,8 @@ class ProjectDefinitionContainer {
|
|
|
3775
4113
|
* @returns A new ProjectDefinitionContainer
|
|
3776
4114
|
*/
|
|
3777
4115
|
static fromSerializedConfig(config, context) {
|
|
3778
|
-
const
|
|
3779
|
-
return new ProjectDefinitionContainer(
|
|
4116
|
+
const plugins = createPluginImplementationStore(context.pluginStore, config);
|
|
4117
|
+
return new ProjectDefinitionContainer(deserializeSchemaWithTransformedReferences(createProjectDefinitionSchema, config, { plugins }), context, plugins);
|
|
3780
4118
|
}
|
|
3781
4119
|
}
|
|
3782
4120
|
|
|
@@ -8735,6 +9073,25 @@ const migration014MigratePluginIds = createSchemaMigration({
|
|
|
8735
9073
|
},
|
|
8736
9074
|
});
|
|
8737
9075
|
|
|
9076
|
+
const migration015NullParentRefs = createSchemaMigration({
|
|
9077
|
+
version: 15,
|
|
9078
|
+
name: 'nullParentRefs',
|
|
9079
|
+
description: 'Convert null parentRefs to undefined in features',
|
|
9080
|
+
migrate: (config) => {
|
|
9081
|
+
if (!config.features) {
|
|
9082
|
+
return config;
|
|
9083
|
+
}
|
|
9084
|
+
const features = config.features.map((feature) => ({
|
|
9085
|
+
...feature,
|
|
9086
|
+
parentRef: feature.parentRef ?? undefined,
|
|
9087
|
+
}));
|
|
9088
|
+
return {
|
|
9089
|
+
...config,
|
|
9090
|
+
features,
|
|
9091
|
+
};
|
|
9092
|
+
},
|
|
9093
|
+
});
|
|
9094
|
+
|
|
8738
9095
|
const SCHEMA_MIGRATIONS = [
|
|
8739
9096
|
migration005PrimaryUniqueRefs,
|
|
8740
9097
|
migration006IndividualServiceControllers,
|
|
@@ -8746,6 +9103,7 @@ const SCHEMA_MIGRATIONS = [
|
|
|
8746
9103
|
migration012MigrateAuthConfig,
|
|
8747
9104
|
migration013MoveGeneralSettings,
|
|
8748
9105
|
migration014MigratePluginIds,
|
|
9106
|
+
migration015NullParentRefs,
|
|
8749
9107
|
];
|
|
8750
9108
|
function isMigrateableProjectDefinition(projectDefinition) {
|
|
8751
9109
|
return (typeof projectDefinition === 'object' &&
|
|
@@ -8822,11 +9180,7 @@ function createTestProjectDefinitionContainer(input = {}) {
|
|
|
8822
9180
|
availablePlugins: [],
|
|
8823
9181
|
};
|
|
8824
9182
|
const pluginImplementationStore = new PluginImplementationStore({});
|
|
8825
|
-
const
|
|
8826
|
-
plugins: pluginImplementationStore,
|
|
8827
|
-
});
|
|
8828
|
-
const schemaWithPlugins = zPluginWrapper(projectDefinitionSchema, pluginImplementationStore);
|
|
8829
|
-
const resolvedRefPayload = deserializeSchemaWithReferences(schemaWithPlugins, createTestProjectDefinitionInput(input));
|
|
9183
|
+
const resolvedRefPayload = deserializeSchemaWithTransformedReferences(createProjectDefinitionSchema, createTestProjectDefinitionInput(input), { plugins: pluginImplementationStore });
|
|
8830
9184
|
return new ProjectDefinitionContainer(resolvedRefPayload, { pluginStore }, pluginImplementationStore);
|
|
8831
9185
|
}
|
|
8832
9186
|
|
|
@@ -9888,5 +10242,5 @@ function generateDefaultTheme() {
|
|
|
9888
10242
|
};
|
|
9889
10243
|
}
|
|
9890
10244
|
|
|
9891
|
-
export { AVAILABLE_FLAGS, AppUtils, BUILT_IN_ADMIN_CRUD_INPUTS, BUILT_IN_TRANSFORMERS, COLOR_PALETTES, EnumUtils, FIXED_COLOR_MAPPINGS, ModelFieldUtils, ModelTransformerUtils, ModelUtils, PALETTE_SHADES, PluginImplementationStore, PluginUtils, ProjectDefinitionContainer, REFERENTIAL_ACTIONS, SCALAR_FIELD_TYPES, SCHEMA_MIGRATIONS, SchemaMigrationError, THEME_COLORS, THEME_COLOR_KEYS, VALIDATORS,
|
|
9892
|
-
//# sourceMappingURL=project-builder-lib-
|
|
10245
|
+
export { AVAILABLE_FLAGS, AppUtils, BUILT_IN_ADMIN_CRUD_INPUTS, BUILT_IN_TRANSFORMERS, COLOR_PALETTES, DefinitionRefBuilder, EnumUtils, FIXED_COLOR_MAPPINGS, ModelFieldUtils, ModelTransformerUtils, ModelUtils, PALETTE_SHADES, PluginImplementationStore, PluginUtils, ProjectDefinitionContainer, REFERENTIAL_ACTIONS, SCALAR_FIELD_TYPES, SCHEMA_MIGRATIONS, SchemaMigrationError, THEME_COLORS, THEME_COLOR_KEYS, VALIDATORS, adminAppEntryType, adminCrudDisplayTypes, adminCrudEmbeddedFormEntityType, adminCrudEmbeddedInputType, adminCrudEmbeddedLocalInputType, adminCrudInputCompilerSpec, adminCrudInputSpec, adminSectionEntityType, appCompilerSpec, appEntityType, authConfigSpec, authRoleEntityType, backendAppEntryType, baseAdminCrudInputSchema, baseAppSchema, baseAppValidators, basePluginDefinitionSchema, baseTransformerFields, baseTransformerSchema, convertColorNameToOklch, convertHexToOklch, convertOklchToColorName, convertOklchToHex, createAdminAppSchema, createAdminCrudDisplaySchema, createAdminCrudEmbeddedFormSchema, createAdminCrudEmbeddedInputSchema, createAdminCrudEmbeddedListSchema, createAdminCrudEmbeddedLocalInputSchema, createAdminCrudEmbeddedObjectSchema, createAdminCrudEnumInputSchema, createAdminCrudForeignDisplaySchema, createAdminCrudForeignInputSchema, createAdminCrudInputCompilerImplementation, createAdminCrudInputImplementation, createAdminCrudInputSchema, createAdminCrudInputType, createAdminCrudPasswordInputSchema, createAdminCrudSectionSchema, createAdminCrudTableColumnSchema, createAdminCrudTextDisplaySchema, createAdminCrudTextInputSchema, createAdminSectionSchema, createAppCompiler, createAppCompilerPlugin, createAppEntryType, createAppSchema, createBackendAppSchema, createBaseAdminSectionValidators, createDefinitionEntityNameResolver, createDefinitionSchemaParserContext, createEmbeddedRelationTransformerSchema, createEntityType, createEnumBaseSchema, createEnumSchema, createEnumValueSchema, createFeaturesSchema, createModelBaseSchema, createModelGraphqlSchema, createModelRelationFieldSchema, createModelScalarFieldSchema, createModelSchema, createModelServiceSchema, createModelTransformerCompilerImplementation, createModelTransformerImplementation, createModelTransformerType, createModelUniqueConstraintSchema, createPasswordTransformerSchema, createPlatformPluginExport, createPluginConfigImplementation, createPluginImplementationStore, createPluginSpec, createPluginWithConfigSchema, createPluginsSchema, createProjectDefinitionSchema, createProjectDefinitionSchemaWithContext, createSettingsSchema, createTemplateExtractorSchema, createTestProjectDefinition, createTestProjectDefinitionContainer, createTestProjectDefinitionInput, createThemeSchema, createTransformerSchema, createWebAppSchema, createWebConfigImplementation, definitionSchema, deserializeSchemaWithTransformedReferences, extractDefinitionRefs, extractDefinitionRefsRecursive, featureEntityType, fixRefDeletions, generalSettingsSchema, generateCssFromThemeConfig, generateDefaultTheme, generateThemeColorsFromShade, getBackendRelativePath, getDefaultThemeColorFromShade, getLatestMigrationVersion, initializePlugins, isMigrateableProjectDefinition, modelEntityType, modelEnumEntityType, modelEnumValueEntityType, modelForeignRelationEntityType, modelLocalRelationEntityType, modelScalarFieldEntityType, modelTransformerCompilerSpec, modelTransformerEntityType, modelTransformerSpec, modelUniqueConstraintEntityType, oklchColor, paletteSchema, palettesSchema, parseOklch, parseProjectDefinitionWithContext, parseProjectDefinitionWithReferences, pluginConfigSpec, pluginEntityType, pluginManifestJsonSchema, pluginMetadataSchema, pluginSpecDependencySchema, pluginSpecSupportSchema, runPluginMigrations, runSchemaMigrations, serializeSchema, serializeSchemaFromRefPayload, stripEmptyGeneratorChildren, stripUndefinedValues, themeColorSchema, undefinedIfEmpty, undefinedIfFalsy, webAppEntryType, webConfigSpec };
|
|
10246
|
+
//# sourceMappingURL=project-builder-lib-CScAnw0t.js.map
|