@baseplate-dev/plugin-auth 0.1.3 → 1.0.1
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/node.d.ts.map +1 -1
- package/dist/auth/core/node.js +6 -3
- package/dist/auth/core/node.js.map +1 -1
- package/dist/auth/generators/fastify/auth-module/auth-module.generator.d.ts +13 -1
- package/dist/auth/generators/fastify/auth-module/auth-module.generator.d.ts.map +1 -1
- package/dist/auth/generators/fastify/auth-module/auth-module.generator.js +20 -8
- package/dist/auth/generators/fastify/auth-module/auth-module.generator.js.map +1 -1
- package/dist/auth/generators/fastify/auth-module/generated/index.d.ts +88 -0
- package/dist/auth/generators/fastify/auth-module/generated/index.d.ts.map +1 -0
- package/dist/auth/generators/fastify/auth-module/generated/index.js +9 -0
- package/dist/auth/generators/fastify/auth-module/generated/index.js.map +1 -0
- package/dist/auth/generators/fastify/auth-module/generated/template-paths.d.ts +16 -0
- package/dist/auth/generators/fastify/auth-module/generated/template-paths.d.ts.map +1 -0
- package/dist/auth/generators/fastify/auth-module/generated/template-paths.js +26 -0
- package/dist/auth/generators/fastify/auth-module/generated/template-paths.js.map +1 -0
- package/dist/auth/generators/fastify/auth-module/generated/ts-import-providers.d.ts +10 -0
- package/dist/auth/generators/fastify/auth-module/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/auth/generators/fastify/auth-module/generated/ts-import-providers.js +23 -0
- package/dist/auth/generators/fastify/auth-module/generated/ts-import-providers.js.map +1 -0
- package/dist/auth/generators/fastify/auth-module/generated/{ts-templates.d.ts → typed-templates.d.ts} +26 -41
- package/dist/auth/generators/fastify/auth-module/generated/typed-templates.d.ts.map +1 -0
- package/dist/auth/generators/fastify/auth-module/generated/typed-templates.js +68 -0
- package/dist/auth/generators/fastify/auth-module/generated/typed-templates.js.map +1 -0
- package/dist/auth/generators/fastify/auth-module/index.d.ts +2 -0
- package/dist/auth/generators/fastify/auth-module/index.d.ts.map +1 -0
- package/dist/auth/generators/fastify/auth-module/index.js +2 -0
- package/dist/auth/generators/fastify/auth-module/index.js.map +1 -0
- package/dist/auth/generators/fastify/auth-module/templates/{utils → module/utils}/cookie-signer.ts +6 -0
- package/dist/auth/generators/fastify/index.d.ts +1 -1
- package/dist/auth/generators/fastify/index.d.ts.map +1 -1
- package/dist/auth/generators/fastify/index.js +1 -1
- package/dist/auth/generators/fastify/index.js.map +1 -1
- package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.d.ts +14 -6
- package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.d.ts.map +1 -1
- package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.js +11 -16
- package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.js.map +1 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/index.d.ts +62 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/index.d.ts.map +1 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/index.js +9 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/index.js.map +1 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.d.ts +13 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.d.ts.map +1 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.js +23 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/template-paths.js.map +1 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-providers.d.ts +10 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-providers.js +23 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-providers.js.map +1 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/{ts-templates.d.ts → typed-templates.d.ts} +2 -2
- package/dist/auth0/generators/fastify/auth0-module/generated/typed-templates.d.ts.map +1 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/{ts-templates.js → typed-templates.js} +11 -8
- package/dist/auth0/generators/fastify/auth0-module/generated/typed-templates.js.map +1 -0
- package/dist/auth0/generators/fastify/auth0-module/index.d.ts +2 -0
- package/dist/auth0/generators/fastify/auth0-module/index.d.ts.map +1 -0
- package/dist/auth0/generators/fastify/auth0-module/index.js +2 -0
- package/dist/auth0/generators/fastify/auth0-module/index.js.map +1 -0
- package/dist/auth0/generators/fastify/index.d.ts +1 -1
- package/dist/auth0/generators/fastify/index.d.ts.map +1 -1
- package/dist/auth0/generators/fastify/index.js +1 -1
- package/dist/auth0/generators/fastify/index.js.map +1 -1
- package/dist/auth0/generators/react/auth0-apollo/index.d.ts +2 -0
- package/dist/auth0/generators/react/auth0-apollo/index.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-apollo/index.js +2 -0
- package/dist/auth0/generators/react/auth0-apollo/index.js.map +1 -0
- package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.d.ts +101 -8
- package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.d.ts.map +1 -1
- package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.js +10 -11
- package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.js.map +1 -1
- package/dist/auth0/generators/react/auth0-callback/generated/index.d.ts +290 -0
- package/dist/auth0/generators/react/auth0-callback/generated/index.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-callback/generated/index.js +7 -0
- package/dist/auth0/generators/react/auth0-callback/generated/index.js.map +1 -0
- package/dist/auth0/generators/react/auth0-callback/generated/template-paths.d.ts +13 -0
- package/dist/auth0/generators/react/auth0-callback/generated/template-paths.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-callback/generated/template-paths.js +23 -0
- package/dist/auth0/generators/react/auth0-callback/generated/template-paths.js.map +1 -0
- package/dist/auth0/generators/react/auth0-callback/generated/typed-templates.d.ts +280 -0
- package/dist/auth0/generators/react/auth0-callback/generated/typed-templates.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-callback/generated/{ts-templates.js → typed-templates.js} +11 -9
- package/dist/auth0/generators/react/auth0-callback/generated/typed-templates.js.map +1 -0
- package/dist/auth0/generators/react/auth0-callback/index.d.ts +2 -0
- package/dist/auth0/generators/react/auth0-callback/index.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-callback/index.js +2 -0
- package/dist/auth0/generators/react/auth0-callback/index.js.map +1 -0
- package/dist/auth0/generators/react/auth0-callback/templates/{auth0-callback.page.tsx → routes/auth0-callback.page.tsx} +3 -3
- package/dist/auth0/generators/react/auth0-callback/templates/{signup.page.tsx → routes/signup.page.tsx} +3 -3
- package/dist/auth0/generators/react/auth0-components/auth0-components.generator.d.ts +106 -12
- package/dist/auth0/generators/react/auth0-components/auth0-components.generator.d.ts.map +1 -1
- package/dist/auth0/generators/react/auth0-components/auth0-components.generator.js +12 -16
- package/dist/auth0/generators/react/auth0-components/auth0-components.generator.js.map +1 -1
- package/dist/auth0/generators/react/auth0-components/generated/index.d.ts +151 -0
- package/dist/auth0/generators/react/auth0-components/generated/index.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-components/generated/index.js +9 -0
- package/dist/auth0/generators/react/auth0-components/generated/index.js.map +1 -0
- package/dist/auth0/generators/react/auth0-components/generated/template-paths.d.ts +12 -0
- package/dist/auth0/generators/react/auth0-components/generated/template-paths.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-components/generated/template-paths.js +22 -0
- package/dist/auth0/generators/react/auth0-components/generated/template-paths.js.map +1 -0
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-providers.d.ts +10 -0
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-providers.js +25 -0
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-providers.js.map +1 -0
- package/dist/auth0/generators/react/auth0-components/generated/typed-templates.d.ts +132 -0
- package/dist/auth0/generators/react/auth0-components/generated/typed-templates.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-components/generated/typed-templates.js +17 -0
- package/dist/auth0/generators/react/auth0-components/generated/typed-templates.js.map +1 -0
- package/dist/auth0/generators/react/auth0-components/index.d.ts +2 -0
- package/dist/auth0/generators/react/auth0-components/index.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-components/index.js +2 -0
- package/dist/auth0/generators/react/auth0-components/index.js.map +1 -0
- package/dist/auth0/generators/react/auth0-components/templates/{RequireAuth.tsx → src/components/require-auth/require-auth.tsx} +4 -4
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.d.ts +10 -2
- 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 +13 -24
- 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 +51 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/index.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/index.js +9 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/index.js.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.d.ts +16 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.js +26 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.js.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.d.ts +16 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.js +27 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.js.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.d.ts +44 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.js +67 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.js.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/index.d.ts +2 -0
- package/dist/auth0/generators/react/auth0-hooks/index.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/index.js +2 -0
- package/dist/auth0/generators/react/auth0-hooks/index.js.map +1 -0
- package/dist/auth0/generators/react/index.d.ts +5 -5
- package/dist/auth0/generators/react/index.d.ts.map +1 -1
- package/dist/auth0/generators/react/index.js +5 -5
- package/dist/auth0/generators/react/index.js.map +1 -1
- package/dist/auth0/generators/react/react-auth0/index.d.ts +2 -0
- package/dist/auth0/generators/react/react-auth0/index.d.ts.map +1 -0
- package/dist/auth0/generators/react/react-auth0/index.js +2 -0
- package/dist/auth0/generators/react/react-auth0/index.js.map +1 -0
- package/dist/web/assets/{__federation_expose_auth0CoreCommon-DCwCR5dZ.js → __federation_expose_auth0CoreCommon-BE50qa2_.js} +3 -3
- package/dist/web/assets/{__federation_expose_auth0CoreCommon-DCwCR5dZ.js.map → __federation_expose_auth0CoreCommon-BE50qa2_.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_auth0CoreWeb-BlCwYpTq.js → __federation_expose_auth0CoreWeb-AdDVCP7O.js} +7 -9
- package/dist/web/assets/__federation_expose_auth0CoreWeb-AdDVCP7O.js.map +1 -0
- package/dist/web/assets/__federation_expose_authCoreCommon-DKyLSPCa.js +36 -0
- package/dist/web/assets/__federation_expose_authCoreCommon-DKyLSPCa.js.map +1 -0
- package/dist/web/assets/__federation_expose_authCoreWeb-CfCyOvUk.js +442 -0
- package/dist/web/assets/__federation_expose_authCoreWeb-CfCyOvUk.js.map +1 -0
- package/dist/web/assets/{__federation_fn_import-dzKjrTzS.js → __federation_fn_import-CxP86CUK.js} +2 -2
- package/dist/web/assets/{__federation_fn_import-dzKjrTzS.js.map → __federation_fn_import-CxP86CUK.js.map} +1 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-BXHJHUXP.js → web-BFCvL5ku.js} +5 -5
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-BFCvL5ku.js.map +1 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/{project-builder-lib-GtzVuDsM.js → project-builder-lib-BAwM_-SS.js} +150 -159
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-BAwM_-SS.js.map +1 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/{ui-components-ChoqtPkg.js → ui-components-C3uzqK6u.js} +18156 -10210
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-C3uzqK6u.js.map +1 -0
- package/dist/web/assets/{index-BxDOOHD-.js → index-scyXBD_d.js} +10 -4
- package/dist/web/assets/{index-BxDOOHD-.js.map → index-scyXBD_d.js.map} +1 -1
- package/dist/web/assets/{index.esm-BZEyAv4m.js → index.esm-DIgRm3lq.js} +3 -3
- package/dist/web/assets/{index.esm-BZEyAv4m.js.map → index.esm-DIgRm3lq.js.map} +1 -1
- package/dist/web/assets/{model-merger-CdV-7CWE.js → model-merger-gxuB007n.js} +33 -23
- package/dist/web/assets/model-merger-gxuB007n.js.map +1 -0
- package/dist/web/assets/plugin-definition-Bgi_XH0-.js +22 -0
- package/dist/web/assets/plugin-definition-Bgi_XH0-.js.map +1 -0
- package/dist/web/assets/plugin-definition-EtIvYJxn.js +34 -0
- package/dist/web/assets/plugin-definition-EtIvYJxn.js.map +1 -0
- package/dist/web/assets/{react-BfiX28GO.js → react-CAuz_DuX.js} +2 -2
- package/dist/web/assets/{react-BfiX28GO.js.map → react-CAuz_DuX.js.map} +1 -1
- package/dist/web/assets/remoteEntry.js +8 -2
- package/dist/web/assets/remoteEntry.js.map +1 -1
- package/dist/web/assets/{plugin-definition-C9Q-BrBQ.js → schema-BAfRBwYE.js} +16 -27
- package/dist/web/assets/schema-BAfRBwYE.js.map +1 -0
- package/dist/web/assets/styles-BpKIyKWd.js +8 -0
- package/dist/web/assets/styles-BpKIyKWd.js.map +1 -0
- package/manifest.json +1 -1
- package/package.json +18 -10
- package/dist/auth/generators/fastify/auth-module/generated/ts-templates.d.ts.map +0 -1
- package/dist/auth/generators/fastify/auth-module/generated/ts-templates.js +0 -94
- package/dist/auth/generators/fastify/auth-module/generated/ts-templates.js.map +0 -1
- package/dist/auth/generators/fastify/auth-module/templates/management.ts +0 -22
- package/dist/auth/generators/fastify/auth-module/templates/schema/user-session-payload.object-type.ts +0 -23
- package/dist/auth/generators/fastify/auth-module/templates/schema/user-session.mutations.ts +0 -22
- package/dist/auth/generators/fastify/auth-module/templates/schema/user-session.queries.ts +0 -20
- package/dist/auth/generators/fastify/auth-module/templates/user-session.service.ts +0 -101
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-maps.d.ts +0 -3
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-maps.d.ts.map +0 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-maps.js +0 -12
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-maps.js.map +0 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-templates.d.ts.map +0 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-templates.js.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/generated/ts-templates.d.ts +0 -106
- package/dist/auth0/generators/react/auth0-callback/generated/ts-templates.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/generated/ts-templates.js.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-maps.d.ts +0 -3
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-maps.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-maps.js +0 -12
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-maps.js.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/ts-templates.d.ts +0 -45
- package/dist/auth0/generators/react/auth0-components/generated/ts-templates.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/ts-templates.js +0 -13
- package/dist/auth0/generators/react/auth0-components/generated/ts-templates.js.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/text-templates.d.ts +0 -8
- package/dist/auth0/generators/react/auth0-hooks/generated/text-templates.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/text-templates.js +0 -12
- package/dist/auth0/generators/react/auth0-hooks/generated/text-templates.js.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-maps.d.ts +0 -3
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-maps.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-maps.js +0 -16
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-maps.js.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-templates.d.ts +0 -33
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-templates.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-templates.js +0 -50
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-templates.js.map +0 -1
- package/dist/web/assets/__federation_expose_auth0CoreWeb-BlCwYpTq.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-BXHJHUXP.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-GtzVuDsM.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-ChoqtPkg.js.map +0 -1
- package/dist/web/assets/model-merger-CdV-7CWE.js.map +0 -1
- package/dist/web/assets/plugin-definition-C9Q-BrBQ.js.map +0 -1
- /package/dist/auth/generators/fastify/auth-module/templates/{user-session.constants.ts → module/constants/user-session.constants.ts} +0 -0
- /package/dist/auth/generators/fastify/auth-module/templates/{services → module/services}/user-session.service.ts +0 -0
- /package/dist/auth/generators/fastify/auth-module/templates/{utils → module/utils}/session-cookie.ts +0 -0
- /package/dist/auth/generators/fastify/auth-module/templates/{utils → module/utils}/verify-request-origin.ts +0 -0
- /package/dist/auth0/generators/fastify/auth0-module/templates/{management.ts → module/services/management.ts} +0 -0
- /package/dist/auth0/generators/fastify/auth0-module/templates/{user-session.service.ts → module/services/user-session.service.ts} +0 -0
- /package/dist/auth0/generators/react/auth0-hooks/templates/{useCurrentUser.gql → src/hooks/useCurrentUser.gql} +0 -0
- /package/dist/auth0/generators/react/auth0-hooks/templates/{useCurrentUser.ts → src/hooks/useCurrentUser.ts} +0 -0
- /package/dist/auth0/generators/react/auth0-hooks/templates/{useLogOut.ts → src/hooks/useLogOut.ts} +0 -0
- /package/dist/auth0/generators/react/auth0-hooks/templates/{useRequiredUserId.ts → src/hooks/useRequiredUserId.ts} +0 -0
- /package/dist/auth0/generators/react/auth0-hooks/templates/{useSession.ts → src/hooks/useSession.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { importShared } from './__federation_fn_import-
|
|
1
|
+
import { importShared } from './__federation_fn_import-CxP86CUK.js';
|
|
2
2
|
|
|
3
3
|
const {authRoleEntityType: authRoleEntityType$1} = await importShared('@baseplate-dev/project-builder-lib');
|
|
4
4
|
|
|
@@ -19,23 +19,29 @@ const AUTH_DEFAULT_ROLES = [
|
|
|
19
19
|
builtIn: true
|
|
20
20
|
}
|
|
21
21
|
];
|
|
22
|
+
function createDefaultAuthRoles() {
|
|
23
|
+
return AUTH_DEFAULT_ROLES.map((role) => ({
|
|
24
|
+
...role,
|
|
25
|
+
id: authRoleEntityType$1.generateNewId()
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
22
28
|
|
|
23
29
|
const {authRoleEntityType,zEnt} = await importShared('@baseplate-dev/project-builder-lib');
|
|
24
30
|
|
|
25
|
-
const {z
|
|
31
|
+
const {z} = await importShared('zod');
|
|
26
32
|
const authRoleSchema = zEnt(
|
|
27
|
-
z
|
|
28
|
-
name: z
|
|
29
|
-
comment: z
|
|
30
|
-
builtIn: z
|
|
33
|
+
z.object({
|
|
34
|
+
name: z.string().min(1),
|
|
35
|
+
comment: z.string().min(1),
|
|
36
|
+
builtIn: z.boolean().default(false)
|
|
31
37
|
}),
|
|
32
38
|
{ type: authRoleEntityType }
|
|
33
39
|
);
|
|
34
|
-
const authRolesSchema = z
|
|
40
|
+
const authRolesSchema = z.array(authRoleSchema).superRefine((roles, ctx) => {
|
|
35
41
|
const dup = roles.map((r) => r.name).filter((v, i, a) => a.indexOf(v) !== i);
|
|
36
42
|
if (dup.length > 0) {
|
|
37
43
|
ctx.addIssue({
|
|
38
|
-
code: z
|
|
44
|
+
code: z.ZodIssueCode.custom,
|
|
39
45
|
message: `Duplicate role name(s): ${dup.join(", ")}`
|
|
40
46
|
});
|
|
41
47
|
}
|
|
@@ -57,22 +63,5 @@ const authRolesSchema = z$1.array(authRoleSchema).superRefine((roles, ctx) => {
|
|
|
57
63
|
)
|
|
58
64
|
]);
|
|
59
65
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const {z} = await importShared('zod');
|
|
63
|
-
const auth0PluginDefinitionSchema = z.object({
|
|
64
|
-
modelRefs: z.object({
|
|
65
|
-
user: zRef(z.string().min(1), {
|
|
66
|
-
type: modelEntityType,
|
|
67
|
-
onDelete: "RESTRICT"
|
|
68
|
-
})
|
|
69
|
-
}),
|
|
70
|
-
authFeatureRef: zRef(z.string().min(1), {
|
|
71
|
-
type: featureEntityType,
|
|
72
|
-
onDelete: "RESTRICT"
|
|
73
|
-
}),
|
|
74
|
-
roles: authRolesSchema
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
export { AUTH_DEFAULT_ROLES as A, authRoleSchema as a, auth0PluginDefinitionSchema as b };
|
|
78
|
-
//# sourceMappingURL=plugin-definition-C9Q-BrBQ.js.map
|
|
66
|
+
export { AUTH_DEFAULT_ROLES as A, authRolesSchema as a, authRoleSchema as b, createDefaultAuthRoles as c };
|
|
67
|
+
//# sourceMappingURL=schema-BAfRBwYE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-BAfRBwYE.js","sources":["../../../src/roles/constants.ts","../../../src/roles/schema.ts"],"sourcesContent":["import { authRoleEntityType } from '@baseplate-dev/project-builder-lib';\n\nimport type { AuthRoleDefinition } from './schema.js';\n\nexport const AUTH_DEFAULT_ROLES: Omit<AuthRoleDefinition, 'id'>[] = [\n {\n name: 'public',\n comment: 'All users (including unauthenticated and authenticated users)',\n builtIn: true,\n },\n {\n name: 'user',\n comment: 'All authenticated users',\n builtIn: true,\n },\n {\n name: 'system',\n comment: 'System processes without a user context, e.g. background jobs',\n builtIn: true,\n },\n];\n\nexport function createDefaultAuthRoles(): AuthRoleDefinition[] {\n return AUTH_DEFAULT_ROLES.map((role) => ({\n ...role,\n id: authRoleEntityType.generateNewId(),\n }));\n}\n","import { authRoleEntityType, zEnt } from '@baseplate-dev/project-builder-lib';\nimport { z } from 'zod';\n\nimport { AUTH_DEFAULT_ROLES } from './constants.js';\n\nexport const authRoleSchema = zEnt(\n z.object({\n name: z.string().min(1),\n comment: z.string().min(1),\n builtIn: z.boolean().default(false),\n }),\n { type: authRoleEntityType },\n);\n\n/**\n * Defines the schema for a role.\n */\nexport type AuthRoleDefinition = z.infer<typeof authRoleSchema>;\n\nexport type AuthRoleInput = z.input<typeof authRoleSchema>;\n\n/**\n * Defines the schema for an array of roles ensuring that there are no duplicate\n * role names and that the built-in roles are included.\n */\nexport const authRolesSchema = z\n .array(authRoleSchema)\n .superRefine((roles, ctx) => {\n const dup = roles\n .map((r) => r.name)\n .filter((v, i, a) => a.indexOf(v) !== i);\n if (dup.length > 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `Duplicate role name(s): ${dup.join(', ')}`,\n });\n }\n })\n .transform((roles) => [\n ...AUTH_DEFAULT_ROLES.map((r) => {\n const existingRole = roles.find((role) => role.name === r.name);\n return existingRole\n ? {\n ...existingRole,\n builtIn: true,\n }\n : {\n ...r,\n builtIn: true,\n id: authRoleEntityType.generateNewId(),\n };\n }),\n // Filter out the built-in roles\n ...roles.filter(\n (r) => !AUTH_DEFAULT_ROLES.map((v) => v.name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MAAM,MAAM,KACT,CAAA,GAAA,CAAI,CAAC,CAAA,KAAM,EAAE,IAAI,CAAA,CACjB,MAAO,CAAA,CAAC,GAAG,CAAG,EAAA,CAAA,KAAM,EAAE,OAAQ,CAAA,CAAC,MAAM,CAAC,CAAA;AACzC,EAAI,IAAA,GAAA,CAAI,SAAS,CAAG,EAAA;AAClB,IAAA,GAAA,CAAI,QAAS,CAAA;AAAA,MACX,IAAA,EAAM,EAAE,YAAa,CAAA,MAAA;AAAA,MACrB,OAAS,EAAA,CAAA,wBAAA,EAA2B,GAAI,CAAA,IAAA,CAAK,IAAI,CAAC,CAAA;AAAA,KACnD,CAAA;AAAA;AAEL,CAAC,CAAA,CACA,SAAU,CAAA,CAAC,KAAU,KAAA;AAAA,EACpB,GAAG,kBAAA,CAAmB,GAAI,CAAA,CAAC,CAAM,KAAA;AAC/B,IAAM,MAAA,YAAA,GAAe,MAAM,IAAK,CAAA,CAAC,SAAS,IAAK,CAAA,IAAA,KAAS,EAAE,IAAI,CAAA;AAC9D,IAAA,OAAO,YACH,GAAA;AAAA,MACE,GAAG,YAAA;AAAA,MACH,OAAS,EAAA;AAAA,KAEX,GAAA;AAAA,MACE,GAAG,CAAA;AAAA,MACH,OAAS,EAAA,IAAA;AAAA,MACT,EAAA,EAAI,mBAAmB,aAAc;AAAA,KACvC;AAAA,GACL,CAAA;AAAA;AAAA,EAED,GAAG,KAAM,CAAA,MAAA;AAAA,IACP,CAAC,CAAA,KAAM,CAAC,kBAAA,CAAmB,GAAI,CAAA,CAAC,CAAM,KAAA,CAAA,CAAE,IAAI,CAAA,CAAE,QAAS,CAAA,CAAA,CAAE,IAAI;AAAA;AAEjE,CAAC;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { g as get, s as set, e as appendErrors } from './index.esm-DIgRm3lq.js';
|
|
2
|
+
|
|
3
|
+
const r=(t,r,o)=>{if(t&&"reportValidity"in t){const s=get(o,r);t.setCustomValidity(s&&s.message||""),t.reportValidity();}},o=(e,t)=>{for(const o in t.fields){const s=t.fields[o];s&&s.ref&&"reportValidity"in s.ref?r(s.ref,o,e):s&&s.refs&&s.refs.forEach(t=>r(t,o,e));}},s$1=(r,s)=>{s.shouldUseNativeValidation&&o(r,s);const n={};for(const o in r){const f=get(s.fields,o),c=Object.assign(r[o]||{},{ref:f&&f.ref});if(i(s.names||Object.keys(r),o)){const r=Object.assign({},get(n,o));set(r,"root",c),set(n,o,r);}else set(n,o,c);}return n},i=(e,t)=>{const r=n$1(t);return e.some(e=>n$1(e).match(`^${r}\\.\\d+`))};function n$1(e){return e.replace(/\]|\[/g,"")}
|
|
4
|
+
|
|
5
|
+
function n(r,e){for(var n={};r.length;){var s=r[0],t=s.code,i=s.message,a=s.path.join(".");if(!n[a])if("unionErrors"in s){var u=s.unionErrors[0].errors[0];n[a]={message:u.message,type:u.code};}else n[a]={message:i,type:t};if("unionErrors"in s&&s.unionErrors.forEach(function(e){return e.errors.forEach(function(e){return r.push(e)})}),e){var c=n[a].types,f=c&&c[s.code];n[a]=appendErrors(a,e,n,t,f?[].concat(f,s.message):s.message);}r.shift();}return n}function s(o$1,s,t){return void 0===t&&(t={}),function(i,a,u){try{return Promise.resolve(function(e,n){try{var a=Promise.resolve(o$1["sync"===t.mode?"parse":"parseAsync"](i,s)).then(function(e){return u.shouldUseNativeValidation&&o({},u),{errors:{},values:t.raw?Object.assign({},i):e}});}catch(r){return n(r)}return a&&a.then?a.then(void 0,n):a}(0,function(r){if(function(r){return Array.isArray(null==r?void 0:r.errors)}(r))return {values:{},errors:s$1(n(r.errors,!u.shouldUseNativeValidation&&"all"===u.criteriaMode),u)};throw r}))}catch(r){return Promise.reject(r)}}}
|
|
6
|
+
|
|
7
|
+
export { s };
|
|
8
|
+
//# sourceMappingURL=styles-BpKIyKWd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles-BpKIyKWd.js","sources":["../../../../../node_modules/.pnpm/@hookform+resolvers@5.0.1_react-hook-form@7.56.3_react@19.1.0_/node_modules/@hookform/resolvers/dist/resolvers.mjs","../../../../../node_modules/.pnpm/@hookform+resolvers@5.0.1_react-hook-form@7.56.3_react@19.1.0_/node_modules/@hookform/resolvers/zod/dist/zod.mjs"],"sourcesContent":["import{get as e,set as t}from\"react-hook-form\";const r=(t,r,o)=>{if(t&&\"reportValidity\"in t){const s=e(o,r);t.setCustomValidity(s&&s.message||\"\"),t.reportValidity()}},o=(e,t)=>{for(const o in t.fields){const s=t.fields[o];s&&s.ref&&\"reportValidity\"in s.ref?r(s.ref,o,e):s&&s.refs&&s.refs.forEach(t=>r(t,o,e))}},s=(r,s)=>{s.shouldUseNativeValidation&&o(r,s);const n={};for(const o in r){const f=e(s.fields,o),c=Object.assign(r[o]||{},{ref:f&&f.ref});if(i(s.names||Object.keys(r),o)){const r=Object.assign({},e(n,o));t(r,\"root\",c),t(n,o,r)}else t(n,o,c)}return n},i=(e,t)=>{const r=n(t);return e.some(e=>n(e).match(`^${r}\\\\.\\\\d+`))};function n(e){return e.replace(/\\]|\\[/g,\"\")}export{s as toNestErrors,o as validateFieldsNatively};\n//# sourceMappingURL=resolvers.mjs.map\n","import{validateFieldsNatively as r,toNestErrors as e}from\"@hookform/resolvers\";import{appendErrors as o}from\"react-hook-form\";function n(r,e){for(var n={};r.length;){var s=r[0],t=s.code,i=s.message,a=s.path.join(\".\");if(!n[a])if(\"unionErrors\"in s){var u=s.unionErrors[0].errors[0];n[a]={message:u.message,type:u.code}}else n[a]={message:i,type:t};if(\"unionErrors\"in s&&s.unionErrors.forEach(function(e){return e.errors.forEach(function(e){return r.push(e)})}),e){var c=n[a].types,f=c&&c[s.code];n[a]=o(a,e,n,t,f?[].concat(f,s.message):s.message)}r.shift()}return n}function s(o,s,t){return void 0===t&&(t={}),function(i,a,u){try{return Promise.resolve(function(e,n){try{var a=Promise.resolve(o[\"sync\"===t.mode?\"parse\":\"parseAsync\"](i,s)).then(function(e){return u.shouldUseNativeValidation&&r({},u),{errors:{},values:t.raw?Object.assign({},i):e}})}catch(r){return n(r)}return a&&a.then?a.then(void 0,n):a}(0,function(r){if(function(r){return Array.isArray(null==r?void 0:r.errors)}(r))return{values:{},errors:e(n(r.errors,!u.shouldUseNativeValidation&&\"all\"===u.criteriaMode),u)};throw r}))}catch(r){return Promise.reject(r)}}}export{s as zodResolver};\n//# sourceMappingURL=zod.module.js.map\n"],"names":["e","s","t","n","o","r"],"mappings":";;AAA+C,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,gBAAgB,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAACA,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,GAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,gBAAgB,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,CAACC,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,yBAAyB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,C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 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baseplate-dev/plugin-auth",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Contains the auth plugin for Baseplate",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"authentication",
|
|
7
|
+
"plugin",
|
|
8
|
+
"full-stack",
|
|
9
|
+
"typescript",
|
|
10
|
+
"baseplate",
|
|
11
|
+
"code-generation"
|
|
12
|
+
],
|
|
5
13
|
"homepage": "https://www.baseplate.dev",
|
|
6
14
|
"repository": "https://github.com/halfdomelabs/baseplate",
|
|
7
15
|
"license": "MPL-2.0",
|
|
@@ -27,10 +35,10 @@
|
|
|
27
35
|
"react-hook-form": "7.56.3",
|
|
28
36
|
"react-icons": "5.5.0",
|
|
29
37
|
"zod": "3.24.1",
|
|
30
|
-
"@baseplate-dev/core-generators": "0.1
|
|
31
|
-
"@baseplate-dev/fastify-generators": "0.1
|
|
32
|
-
"@baseplate-dev/react-generators": "0.1
|
|
33
|
-
"@baseplate-dev/ui-components": "0.1
|
|
38
|
+
"@baseplate-dev/core-generators": "0.2.1",
|
|
39
|
+
"@baseplate-dev/fastify-generators": "0.2.1",
|
|
40
|
+
"@baseplate-dev/react-generators": "0.2.1",
|
|
41
|
+
"@baseplate-dev/ui-components": "0.2.1"
|
|
34
42
|
},
|
|
35
43
|
"devDependencies": {
|
|
36
44
|
"@originjs/vite-plugin-federation": "1.3.6",
|
|
@@ -47,13 +55,13 @@
|
|
|
47
55
|
"typescript": "5.7.3",
|
|
48
56
|
"vite": "6.3.5",
|
|
49
57
|
"vitest": "3.0.7",
|
|
50
|
-
"@baseplate-dev/project-builder-lib": "0.1
|
|
51
|
-
"@baseplate-dev/sync": "0.1
|
|
52
|
-
"@baseplate-dev/tools": "0.1
|
|
58
|
+
"@baseplate-dev/project-builder-lib": "0.2.1",
|
|
59
|
+
"@baseplate-dev/sync": "0.2.1",
|
|
60
|
+
"@baseplate-dev/tools": "0.2.1"
|
|
53
61
|
},
|
|
54
62
|
"peerDependencies": {
|
|
55
|
-
"@baseplate-dev/project-builder-lib": "0.1
|
|
56
|
-
"@baseplate-dev/sync": "0.1
|
|
63
|
+
"@baseplate-dev/project-builder-lib": "0.2.1",
|
|
64
|
+
"@baseplate-dev/sync": "0.2.1"
|
|
57
65
|
},
|
|
58
66
|
"engines": {
|
|
59
67
|
"node": "^22.0.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ts-templates.d.ts","sourceRoot":"","sources":["../../../../../../src/auth/generators/fastify/auth-module/generated/ts-templates.ts"],"names":[],"mappings":"AA0GA,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAO5C,CAAC"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { createTsTemplateFile, createTsTemplateGroup, } from '@baseplate-dev/core-generators';
|
|
2
|
-
import { authContextImportsProvider, authRolesImportsProvider, configServiceImportsProvider, errorHandlerServiceImportsProvider, pothosImportsProvider, requestServiceContextImportsProvider, userSessionTypesImportsProvider, } from '@baseplate-dev/fastify-generators';
|
|
3
|
-
const schemaUserSessionMutations = createTsTemplateFile({
|
|
4
|
-
group: 'schema',
|
|
5
|
-
importMapProviders: { pothosImports: pothosImportsProvider },
|
|
6
|
-
name: 'schema-user-session-mutations',
|
|
7
|
-
projectExports: {},
|
|
8
|
-
source: { path: 'schema/user-session.mutations.ts' },
|
|
9
|
-
variables: {},
|
|
10
|
-
});
|
|
11
|
-
const schemaUserSessionQueries = createTsTemplateFile({
|
|
12
|
-
group: 'schema',
|
|
13
|
-
importMapProviders: { pothosImports: pothosImportsProvider },
|
|
14
|
-
name: 'schema-user-session-queries',
|
|
15
|
-
projectExports: {},
|
|
16
|
-
source: { path: 'schema/user-session.queries.ts' },
|
|
17
|
-
variables: { TPL_PRISMA_USER: {} },
|
|
18
|
-
});
|
|
19
|
-
const userSessionPayloadObjectType = createTsTemplateFile({
|
|
20
|
-
group: 'schema',
|
|
21
|
-
importMapProviders: { pothosImports: pothosImportsProvider },
|
|
22
|
-
name: 'user-session-payload-object-type',
|
|
23
|
-
projectExports: { userSessionPayload: {} },
|
|
24
|
-
source: { path: 'schema/user-session-payload.object-type.ts' },
|
|
25
|
-
variables: { TPL_PRISMA_USER: {}, TPL_USER_OBJECT_TYPE: {} },
|
|
26
|
-
});
|
|
27
|
-
const schemaGroup = createTsTemplateGroup({
|
|
28
|
-
templates: {
|
|
29
|
-
schemaUserSessionMutations: {
|
|
30
|
-
destination: 'user-session.mutations.ts',
|
|
31
|
-
template: schemaUserSessionMutations,
|
|
32
|
-
},
|
|
33
|
-
schemaUserSessionQueries: {
|
|
34
|
-
destination: 'user-session.queries.ts',
|
|
35
|
-
template: schemaUserSessionQueries,
|
|
36
|
-
},
|
|
37
|
-
userSessionPayloadObjectType: {
|
|
38
|
-
destination: 'user-session-payload.object-type.ts',
|
|
39
|
-
template: userSessionPayloadObjectType,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
const servicesUserSessionService = createTsTemplateFile({
|
|
44
|
-
importMapProviders: {
|
|
45
|
-
authContextImports: authContextImportsProvider,
|
|
46
|
-
authRolesImports: authRolesImportsProvider,
|
|
47
|
-
configServiceImports: configServiceImportsProvider,
|
|
48
|
-
errorHandlerServiceImports: errorHandlerServiceImportsProvider,
|
|
49
|
-
requestServiceContextImports: requestServiceContextImportsProvider,
|
|
50
|
-
userSessionTypesImports: userSessionTypesImportsProvider,
|
|
51
|
-
},
|
|
52
|
-
name: 'services-user-session-service',
|
|
53
|
-
projectExports: { userSessionService: {} },
|
|
54
|
-
source: { path: 'services/user-session.service.ts' },
|
|
55
|
-
variables: { TPL_PRISMA_USER_SESSION: {} },
|
|
56
|
-
});
|
|
57
|
-
const userSessionConstants = createTsTemplateFile({
|
|
58
|
-
name: 'user-session-constants',
|
|
59
|
-
projectExports: {
|
|
60
|
-
USER_SESSION_DURATION_SEC: {},
|
|
61
|
-
USER_SESSION_MAX_LIFETIME_SEC: {},
|
|
62
|
-
USER_SESSION_RENEWAL_THRESHOLD_SEC: {},
|
|
63
|
-
},
|
|
64
|
-
source: { path: 'user-session.constants.ts' },
|
|
65
|
-
variables: {},
|
|
66
|
-
});
|
|
67
|
-
const utilsCookieSigner = createTsTemplateFile({
|
|
68
|
-
name: 'utils-cookie-signer',
|
|
69
|
-
projectExports: { sign: {}, signObject: {}, unsign: {}, unsignObject: {} },
|
|
70
|
-
source: { path: 'utils/cookie-signer.ts' },
|
|
71
|
-
variables: {},
|
|
72
|
-
});
|
|
73
|
-
const utilsSessionCookie = createTsTemplateFile({
|
|
74
|
-
importMapProviders: { configServiceImports: configServiceImportsProvider },
|
|
75
|
-
name: 'utils-session-cookie',
|
|
76
|
-
projectExports: { getUserSessionCookieName: {} },
|
|
77
|
-
source: { path: 'utils/session-cookie.ts' },
|
|
78
|
-
variables: {},
|
|
79
|
-
});
|
|
80
|
-
const utilsVerifyRequestOrigin = createTsTemplateFile({
|
|
81
|
-
name: 'utils-verify-request-origin',
|
|
82
|
-
projectExports: { verifyRequestOrigin: {} },
|
|
83
|
-
source: { path: 'utils/verify-request-origin.ts' },
|
|
84
|
-
variables: {},
|
|
85
|
-
});
|
|
86
|
-
export const FASTIFY_AUTH_MODULE_TS_TEMPLATES = {
|
|
87
|
-
schemaGroup,
|
|
88
|
-
servicesUserSessionService,
|
|
89
|
-
userSessionConstants,
|
|
90
|
-
utilsCookieSigner,
|
|
91
|
-
utilsSessionCookie,
|
|
92
|
-
utilsVerifyRequestOrigin,
|
|
93
|
-
};
|
|
94
|
-
//# sourceMappingURL=ts-templates.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ts-templates.js","sourceRoot":"","sources":["../../../../../../src/auth/generators/fastify/auth-module/generated/ts-templates.ts"],"names":[],"mappings":"AAAA,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AAE,oBAAoB,EAAE,4BAA4B,EAAE;IAC1E,IAAI,EAAE,sBAAsB;IAC5B,cAAc,EAAE,EAAE,wBAAwB,EAAE,EAAE,EAAE;IAChD,MAAM,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAE;IAC3C,SAAS,EAAE,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;IACpD,IAAI,EAAE,6BAA6B;IACnC,cAAc,EAAE,EAAE,mBAAmB,EAAE,EAAE,EAAE;IAC3C,MAAM,EAAE,EAAE,IAAI,EAAE,gCAAgC,EAAE;IAClD,SAAS,EAAE,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,WAAW;IACX,0BAA0B;IAC1B,oBAAoB;IACpB,iBAAiB;IACjB,kBAAkB;IAClB,wBAAwB;CACzB,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
|
|
3
|
-
import { config } from '%configServiceImports';
|
|
4
|
-
import { ManagementClient } from 'auth';
|
|
5
|
-
|
|
6
|
-
let cachedClient: ManagementClient | null = null;
|
|
7
|
-
|
|
8
|
-
export function getAuthManagementClient(): ManagementClient {
|
|
9
|
-
if (cachedClient) {
|
|
10
|
-
return cachedClient;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const client = new ManagementClient({
|
|
14
|
-
domain: config.AUTH_TENANT_DOMAIN,
|
|
15
|
-
clientId: config.AUTH_CLIENT_ID,
|
|
16
|
-
clientSecret: config.AUTH_CLIENT_SECRET,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
cachedClient = client;
|
|
20
|
-
|
|
21
|
-
return client;
|
|
22
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
|
|
3
|
-
import { builder } from '%pothosImports';
|
|
4
|
-
|
|
5
|
-
export const userSessionPayload = builder.simpleObject(
|
|
6
|
-
'UserSessionPayload',
|
|
7
|
-
{
|
|
8
|
-
fields: (t) => ({
|
|
9
|
-
expiresAt: t.field({ type: 'DateTime' }),
|
|
10
|
-
userId: t.field({ type: 'Uuid' }),
|
|
11
|
-
}),
|
|
12
|
-
},
|
|
13
|
-
(t) => ({
|
|
14
|
-
user: t.prismaField({
|
|
15
|
-
type: TPL_USER_OBJECT_TYPE,
|
|
16
|
-
resolve: async (query, root) =>
|
|
17
|
-
TPL_PRISMA_USER.findUniqueOrThrow({
|
|
18
|
-
where: { id: root.userId },
|
|
19
|
-
...query,
|
|
20
|
-
}),
|
|
21
|
-
}),
|
|
22
|
-
}),
|
|
23
|
-
);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
|
|
3
|
-
import { builder } from '%pothosImports';
|
|
4
|
-
|
|
5
|
-
import { userSessionService } from '../services/user-session.service.js';
|
|
6
|
-
|
|
7
|
-
builder.mutationField('logOut', (t) =>
|
|
8
|
-
t.fieldWithInputPayload({
|
|
9
|
-
payload: {
|
|
10
|
-
success: t.payload.boolean({
|
|
11
|
-
description: 'Whether the logout was successful.',
|
|
12
|
-
}),
|
|
13
|
-
},
|
|
14
|
-
resolve: async (parent, args, context) => {
|
|
15
|
-
if (context.auth.session && context.auth.session.type === 'user') {
|
|
16
|
-
await userSessionService.clearSession(context.auth.session, context);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return { success: true };
|
|
20
|
-
},
|
|
21
|
-
}),
|
|
22
|
-
);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
|
|
3
|
-
import { builder } from '%pothosImports';
|
|
4
|
-
|
|
5
|
-
builder.queryField('currentUser', (t) =>
|
|
6
|
-
t.prismaField({
|
|
7
|
-
type: 'User',
|
|
8
|
-
nullable: true,
|
|
9
|
-
resolve: async (query, root, args, { auth }) => {
|
|
10
|
-
if (!auth.userId) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return TPL_PRISMA_USER.findUniqueOrThrow({
|
|
15
|
-
...query,
|
|
16
|
-
where: { id: auth.userId },
|
|
17
|
-
});
|
|
18
|
-
},
|
|
19
|
-
}),
|
|
20
|
-
);
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
|
|
3
|
-
import type { AuthUserSessionInfo } from '%authContextImports';
|
|
4
|
-
import type { AuthRole } from '%authRolesImports';
|
|
5
|
-
import type { UserSessionService } from '%userSessionTypesImports';
|
|
6
|
-
import type { FastifyRequest } from 'fastify';
|
|
7
|
-
|
|
8
|
-
import { DEFAULT_USER_ROLES } from '%authRolesImports';
|
|
9
|
-
|
|
10
|
-
const USER_ID_CLAIM = 'https://app.com/user_id';
|
|
11
|
-
const EMAIL_CLAIM = 'https://app.com/email';
|
|
12
|
-
const EMAIL_VERIFIED_CLAIM = 'https://app.com/email_verified';
|
|
13
|
-
const ROLES_CLAIM = 'https://app.com/roles';
|
|
14
|
-
|
|
15
|
-
interface AuthJwt {
|
|
16
|
-
[USER_ID_CLAIM]?: string;
|
|
17
|
-
[EMAIL_CLAIM]?: string;
|
|
18
|
-
[EMAIL_VERIFIED_CLAIM]?: boolean;
|
|
19
|
-
[ROLES_CLAIM]?: string[];
|
|
20
|
-
sub: string;
|
|
21
|
-
email: string;
|
|
22
|
-
exp: number;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export class AuthUserSessionService implements UserSessionService {
|
|
26
|
-
/**
|
|
27
|
-
* Retrieves the user session information from the request.
|
|
28
|
-
*
|
|
29
|
-
* @param req - The Fastify request object containing the cookies.
|
|
30
|
-
* @param reply - The Fastify reply object used to set or clear cookies.
|
|
31
|
-
* @param currentDate - The current date used for session validation. Defaults to the current date and time.
|
|
32
|
-
* @returns A promise that resolves to the authenticated user session information or null if the session is invalid.
|
|
33
|
-
* @throws {InvalidSessionError} If the session is invalid or expired.
|
|
34
|
-
*/
|
|
35
|
-
async getSessionInfoFromRequest(
|
|
36
|
-
req: FastifyRequest,
|
|
37
|
-
): Promise<AuthUserSessionInfo | undefined> {
|
|
38
|
-
if (!req.headers.authorization) {
|
|
39
|
-
return undefined;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const verifiedJwt = await req.jwtVerify<AuthJwt>();
|
|
43
|
-
const userId = verifiedJwt[USER_ID_CLAIM];
|
|
44
|
-
const roles = verifiedJwt[ROLES_CLAIM] ?? [];
|
|
45
|
-
const email = verifiedJwt[EMAIL_CLAIM];
|
|
46
|
-
|
|
47
|
-
if (!userId) {
|
|
48
|
-
throw new Error(`Missing user id in JWT`);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const user = await TPL_USER_MODEL.findUnique({ where: { id: userId } });
|
|
52
|
-
|
|
53
|
-
// create user if one does not exist already
|
|
54
|
-
if (!email) {
|
|
55
|
-
throw new Error(`Missing email claim in JWT`);
|
|
56
|
-
}
|
|
57
|
-
if (!user) {
|
|
58
|
-
// Use createMany to avoid race-conditions with creating the user
|
|
59
|
-
await TPL_USER_MODEL.createMany({
|
|
60
|
-
data: [
|
|
61
|
-
{
|
|
62
|
-
id: userId,
|
|
63
|
-
authId: verifiedJwt.sub,
|
|
64
|
-
email,
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
skipDuplicates: true,
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return {
|
|
72
|
-
id: verifiedJwt.sub,
|
|
73
|
-
type: 'user',
|
|
74
|
-
userId,
|
|
75
|
-
roles: [...DEFAULT_USER_ROLES, ...roles] as AuthRole[],
|
|
76
|
-
expiresAt:
|
|
77
|
-
typeof verifiedJwt.exp === 'number'
|
|
78
|
-
? new Date(verifiedJwt.exp * 1000)
|
|
79
|
-
: undefined,
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Retrieves the user session information from the authentication token
|
|
85
|
-
*
|
|
86
|
-
* @param req The request object
|
|
87
|
-
* @returns The session info or undefined if no session is found
|
|
88
|
-
*/
|
|
89
|
-
async getSessionInfoFromToken(
|
|
90
|
-
req: FastifyRequest,
|
|
91
|
-
token?: string | null,
|
|
92
|
-
): Promise<AuthUserSessionInfo | undefined> {
|
|
93
|
-
// We have to manually add the header to the request since we can't
|
|
94
|
-
// use server.jwt.verify due to an error
|
|
95
|
-
req.headers.authorization = token ?? undefined;
|
|
96
|
-
|
|
97
|
-
return this.getSessionInfoFromRequest(req);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export const userSessionService = new AuthUserSessionService();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ts-import-maps.d.ts","sourceRoot":"","sources":["../../../../../../src/auth0/generators/fastify/auth0-module/generated/ts-import-maps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,mCAAmC,CAAC;AAM3F,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,MAAM,GACjB,iCAAiC,CAQnC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createTsImportMap } from '@baseplate-dev/core-generators';
|
|
2
|
-
import { userSessionServiceImportsSchema } from '@baseplate-dev/fastify-generators';
|
|
3
|
-
import path from 'node:path/posix';
|
|
4
|
-
export function createAuth0ModuleImports(importBase) {
|
|
5
|
-
if (!importBase.startsWith('@/')) {
|
|
6
|
-
throw new Error('importBase must start with @/');
|
|
7
|
-
}
|
|
8
|
-
return createTsImportMap(userSessionServiceImportsSchema, {
|
|
9
|
-
userSessionService: path.join(importBase, 'user-session.service.js'),
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=ts-import-maps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ts-import-maps.js","sourceRoot":"","sources":["../../../../../../src/auth0/generators/fastify/auth0-module/generated/ts-import-maps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,IAAI,MAAM,iBAAiB,CAAC;AAEnC,MAAM,UAAU,wBAAwB,CACtC,UAAkB;IAElB,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,iBAAiB,CAAC,+BAA+B,EAAE;QACxD,kBAAkB,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,yBAAyB,CAAC;KACrE,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ts-templates.d.ts","sourceRoot":"","sources":["../../../../../../src/auth0/generators/fastify/auth0-module/generated/ts-templates.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAG7C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ts-templates.js","sourceRoot":"","sources":["../../../../../../src/auth0/generators/fastify/auth0-module/generated/ts-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,EAC5B,+BAA+B,GAChC,MAAM,mCAAmC,CAAC;AAE3C,MAAM,UAAU,GAAG,oBAAoB,CAAC;IACtC,kBAAkB,EAAE,EAAE,oBAAoB,EAAE,4BAA4B,EAAE;IAC1E,IAAI,EAAE,YAAY;IAClB,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE;IACjC,SAAS,EAAE,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;IAC9C,kBAAkB,EAAE;QAClB,kBAAkB,EAAE,0BAA0B;QAC9C,gBAAgB,EAAE,wBAAwB;QAC1C,uBAAuB,EAAE,+BAA+B;KACzD;IACD,IAAI,EAAE,sBAAsB;IAC5B,cAAc,EAAE,EAAE,kBAAkB,EAAE,EAAE,EAAE;IAC1C,MAAM,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAE;IAC3C,SAAS,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE;CAClC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC/C,UAAU;IACV,kBAAkB;CACnB,CAAC"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
export declare const AUTH_0_AUTH_0_CALLBACK_TS_TEMPLATES: {
|
|
2
|
-
auth0CallbackPage: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {
|
|
3
|
-
authHooksImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
4
|
-
SessionData: {
|
|
5
|
-
isTypeOnly: true;
|
|
6
|
-
};
|
|
7
|
-
useCurrentUser: {};
|
|
8
|
-
useLogOut: {};
|
|
9
|
-
useRequiredUserId: {};
|
|
10
|
-
useSession: {};
|
|
11
|
-
}>>;
|
|
12
|
-
reactComponentsImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
13
|
-
Alert: {};
|
|
14
|
-
AlertIcon: {};
|
|
15
|
-
BackButton: {};
|
|
16
|
-
Button: {};
|
|
17
|
-
ButtonGroup: {};
|
|
18
|
-
Card: {};
|
|
19
|
-
CheckedInput: {};
|
|
20
|
-
ConfirmDialog: {};
|
|
21
|
-
ErrorableLoader: {};
|
|
22
|
-
ErrorDisplay: {};
|
|
23
|
-
FormError: {};
|
|
24
|
-
FormLabel: {};
|
|
25
|
-
LinkButton: {};
|
|
26
|
-
ListGroup: {};
|
|
27
|
-
Modal: {};
|
|
28
|
-
NotFoundCard: {};
|
|
29
|
-
ReactDatePickerInput: {};
|
|
30
|
-
ReactSelectInput: {};
|
|
31
|
-
SelectInput: {};
|
|
32
|
-
Sidebar: {};
|
|
33
|
-
Spinner: {};
|
|
34
|
-
Status: {
|
|
35
|
-
isTypeOnly: true;
|
|
36
|
-
};
|
|
37
|
-
StatusType: {
|
|
38
|
-
isTypeOnly: true;
|
|
39
|
-
};
|
|
40
|
-
Table: {};
|
|
41
|
-
TextAreaInput: {};
|
|
42
|
-
TextInput: {};
|
|
43
|
-
Toast: {};
|
|
44
|
-
useConfirmDialog: {};
|
|
45
|
-
UseConfirmDialogRequestOptions: {
|
|
46
|
-
isTypeOnly: true;
|
|
47
|
-
};
|
|
48
|
-
useConfirmDialogState: {};
|
|
49
|
-
useStatus: {};
|
|
50
|
-
useToast: {};
|
|
51
|
-
}>>;
|
|
52
|
-
reactErrorImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
53
|
-
formatError: {};
|
|
54
|
-
logAndFormatError: {};
|
|
55
|
-
logError: {};
|
|
56
|
-
}>>;
|
|
57
|
-
}>;
|
|
58
|
-
signupPage: import("@baseplate-dev/core-generators").TsTemplateFile<{}, {
|
|
59
|
-
reactComponentsImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
60
|
-
Alert: {};
|
|
61
|
-
AlertIcon: {};
|
|
62
|
-
BackButton: {};
|
|
63
|
-
Button: {};
|
|
64
|
-
ButtonGroup: {};
|
|
65
|
-
Card: {};
|
|
66
|
-
CheckedInput: {};
|
|
67
|
-
ConfirmDialog: {};
|
|
68
|
-
ErrorableLoader: {};
|
|
69
|
-
ErrorDisplay: {};
|
|
70
|
-
FormError: {};
|
|
71
|
-
FormLabel: {};
|
|
72
|
-
LinkButton: {};
|
|
73
|
-
ListGroup: {};
|
|
74
|
-
Modal: {};
|
|
75
|
-
NotFoundCard: {};
|
|
76
|
-
ReactDatePickerInput: {};
|
|
77
|
-
ReactSelectInput: {};
|
|
78
|
-
SelectInput: {};
|
|
79
|
-
Sidebar: {};
|
|
80
|
-
Spinner: {};
|
|
81
|
-
Status: {
|
|
82
|
-
isTypeOnly: true;
|
|
83
|
-
};
|
|
84
|
-
StatusType: {
|
|
85
|
-
isTypeOnly: true;
|
|
86
|
-
};
|
|
87
|
-
Table: {};
|
|
88
|
-
TextAreaInput: {};
|
|
89
|
-
TextInput: {};
|
|
90
|
-
Toast: {};
|
|
91
|
-
useConfirmDialog: {};
|
|
92
|
-
UseConfirmDialogRequestOptions: {
|
|
93
|
-
isTypeOnly: true;
|
|
94
|
-
};
|
|
95
|
-
useConfirmDialogState: {};
|
|
96
|
-
useStatus: {};
|
|
97
|
-
useToast: {};
|
|
98
|
-
}>>;
|
|
99
|
-
reactErrorImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
100
|
-
formatError: {};
|
|
101
|
-
logAndFormatError: {};
|
|
102
|
-
logError: {};
|
|
103
|
-
}>>;
|
|
104
|
-
}>;
|
|
105
|
-
};
|
|
106
|
-
//# sourceMappingURL=ts-templates.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ts-templates.d.ts","sourceRoot":"","sources":["../../../../../../src/auth0/generators/react/auth0-callback/generated/ts-templates.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAG/C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ts-templates.js","sourceRoot":"","sources":["../../../../../../src/auth0/generators/react/auth0-callback/generated/ts-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAC9B,yBAAyB,GAC1B,MAAM,iCAAiC,CAAC;AAEzC,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;IAC7C,kBAAkB,EAAE;QAClB,gBAAgB,EAAE,wBAAwB;QAC1C,sBAAsB,EAAE,8BAA8B;QACtD,iBAAiB,EAAE,yBAAyB;KAC7C;IACD,IAAI,EAAE,qBAAqB;IAC3B,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAE;IAC3C,SAAS,EAAE,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,oBAAoB,CAAC;IACtC,kBAAkB,EAAE;QAClB,sBAAsB,EAAE,8BAA8B;QACtD,iBAAiB,EAAE,yBAAyB;KAC7C;IACD,IAAI,EAAE,aAAa;IACnB,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;IACnC,SAAS,EAAE,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mCAAmC,GAAG;IACjD,iBAAiB;IACjB,UAAU;CACX,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ts-import-maps.d.ts","sourceRoot":"","sources":["../../../../../../src/auth0/generators/react/auth0-components/generated/ts-import-maps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAMpF,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,MAAM,GACjB,4BAA4B,CAQ9B"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createTsImportMap } from '@baseplate-dev/core-generators';
|
|
2
|
-
import { authComponentsImportsSchema } from '@baseplate-dev/react-generators';
|
|
3
|
-
import path from 'node:path/posix';
|
|
4
|
-
export function createAuth0ComponentsImports(importBase) {
|
|
5
|
-
if (!importBase.startsWith('@/')) {
|
|
6
|
-
throw new Error('importBase must start with @/');
|
|
7
|
-
}
|
|
8
|
-
return createTsImportMap(authComponentsImportsSchema, {
|
|
9
|
-
RequireAuth: path.join(importBase, 'index.js'),
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=ts-import-maps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ts-import-maps.js","sourceRoot":"","sources":["../../../../../../src/auth0/generators/react/auth0-components/generated/ts-import-maps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,IAAI,MAAM,iBAAiB,CAAC;AAEnC,MAAM,UAAU,4BAA4B,CAC1C,UAAkB;IAElB,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,iBAAiB,CAAC,2BAA2B,EAAE;QACpD,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC;KAC/C,CAAC,CAAC;AACL,CAAC"}
|