@baseplate-dev/plugin-auth 1.0.6 → 2.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/common.d.ts.map +1 -1
- package/dist/auth/core/common.js +3 -7
- 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 +44 -30
- package/dist/auth/core/components/auth-definition-editor.js.map +1 -1
- package/dist/{common/roles → auth/core}/components/role-editor-form/role-dialog.d.ts +1 -1
- package/dist/auth/core/components/role-editor-form/role-dialog.d.ts.map +1 -0
- package/dist/{common/roles → auth/core}/components/role-editor-form/role-dialog.js +1 -1
- package/dist/auth/core/components/role-editor-form/role-dialog.js.map +1 -0
- package/dist/auth/core/components/role-editor-form/role-editor-form.d.ts +10 -0
- package/dist/auth/core/components/role-editor-form/role-editor-form.d.ts.map +1 -0
- package/dist/{common/roles → auth/core}/components/role-editor-form/role-editor-form.js +6 -3
- package/dist/auth/core/components/role-editor-form/role-editor-form.js.map +1 -0
- package/dist/auth/core/node.d.ts.map +1 -1
- package/dist/auth/core/node.js +21 -32
- package/dist/auth/core/node.js.map +1 -1
- package/dist/auth/core/schema/plugin-definition.d.ts +3 -28
- package/dist/auth/core/schema/plugin-definition.d.ts.map +1 -1
- package/dist/auth/core/schema/plugin-definition.js +5 -20
- package/dist/auth/core/schema/plugin-definition.js.map +1 -1
- package/dist/auth/core/schema/roles/constants.d.ts.map +1 -0
- package/dist/auth/core/schema/roles/constants.js.map +1 -0
- package/dist/auth/core/schema/roles/index.d.ts +3 -0
- package/dist/auth/core/schema/roles/index.d.ts.map +1 -0
- package/dist/auth/core/schema/roles/index.js +3 -0
- package/dist/auth/core/schema/roles/index.js.map +1 -0
- package/dist/auth/core/schema/roles/schema.d.ts.map +1 -0
- package/dist/auth/core/schema/roles/schema.js.map +1 -0
- package/dist/auth/core/web.js +2 -2
- package/dist/auth/core/web.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/auth/plugin.json +8 -0
- package/dist/auth/utils/get-auth-plugin-definition.d.ts +9 -0
- package/dist/auth/utils/get-auth-plugin-definition.d.ts.map +1 -0
- package/dist/auth/utils/get-auth-plugin-definition.js +10 -0
- package/dist/auth/utils/get-auth-plugin-definition.js.map +1 -0
- package/dist/auth/utils/index.d.ts +2 -0
- package/dist/auth/utils/index.d.ts.map +1 -0
- package/dist/auth/utils/index.js +2 -0
- package/dist/auth/utils/index.js.map +1 -0
- package/dist/auth0/core/common.d.ts +2 -1
- package/dist/auth0/core/common.d.ts.map +1 -1
- package/dist/auth0/core/common.js +7 -11
- package/dist/auth0/core/common.js.map +1 -1
- package/dist/auth0/core/components/auth0-definition-editor.d.ts +5 -0
- package/dist/auth0/core/components/auth0-definition-editor.d.ts.map +1 -0
- package/dist/auth0/core/components/auth0-definition-editor.js +54 -0
- package/dist/auth0/core/components/auth0-definition-editor.js.map +1 -0
- package/dist/auth0/core/node.d.ts.map +1 -1
- package/dist/auth0/core/node.js +12 -11
- package/dist/auth0/core/node.js.map +1 -1
- package/dist/auth0/core/schema/models.d.ts +2 -1
- package/dist/auth0/core/schema/models.d.ts.map +1 -1
- package/dist/auth0/core/schema/models.js +1 -1
- package/dist/auth0/core/schema/models.js.map +1 -1
- package/dist/auth0/core/schema/plugin-definition.d.ts +0 -61
- package/dist/auth0/core/schema/plugin-definition.d.ts.map +1 -1
- package/dist/auth0/core/schema/plugin-definition.js +1 -7
- package/dist/auth0/core/schema/plugin-definition.js.map +1 -1
- package/dist/auth0/core/web.js +3 -3
- package/dist/auth0/core/web.js.map +1 -1
- package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.d.ts +3 -0
- package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.d.ts.map +1 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/index.d.ts +6 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/index.d.ts.map +1 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.d.ts +3 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.d.ts.map +1 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/typed-templates.d.ts +3 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/typed-templates.d.ts.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.d.ts +4 -0
- 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 +7 -1
- 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 +6 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/index.d.ts.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.d.ts +3 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.d.ts.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.js +1 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-providers.js.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.d.ts +6 -2
- 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 -2
- package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.js.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/use-session.ts +14 -1
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.d.ts +2 -0
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.d.ts.map +1 -1
- package/dist/auth0/{metadata.json → plugin.json} +2 -1
- package/dist/common/components/auth-config-tabs.d.ts +2 -0
- package/dist/common/components/auth-config-tabs.d.ts.map +1 -0
- package/dist/common/components/auth-config-tabs.js +21 -0
- package/dist/common/components/auth-config-tabs.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/local-auth/core/common.d.ts +8 -0
- package/dist/local-auth/core/common.d.ts.map +1 -0
- package/dist/local-auth/core/common.js +22 -0
- package/dist/local-auth/core/common.js.map +1 -0
- package/dist/local-auth/core/components/local-auth-definition-editor.d.ts +5 -0
- package/dist/local-auth/core/components/local-auth-definition-editor.d.ts.map +1 -0
- package/dist/local-auth/core/components/local-auth-definition-editor.js +62 -0
- package/dist/local-auth/core/components/local-auth-definition-editor.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-apollo/auth-apollo.generator.d.ts +1 -15
- package/dist/local-auth/core/generators/auth-apollo/auth-apollo.generator.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-apollo/auth-apollo.generator.js +2 -6
- package/dist/local-auth/core/generators/auth-apollo/auth-apollo.generator.js.map +1 -0
- package/dist/local-auth/core/generators/auth-apollo/index.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-apollo/index.js.map +1 -0
- package/dist/local-auth/core/generators/auth-apollo/templates/session-error-link.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-apollo/templates/session-error-link.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-email-password/auth-email-password.generator.d.ts +7 -6
- package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-email-password/auth-email-password.generator.js +2 -2
- package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-email-password/generated/index.d.ts +8 -7
- package/dist/local-auth/core/generators/auth-email-password/generated/index.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/index.js +11 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/index.js.map +1 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.d.ts +14 -0
- package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-email-password/generated/template-paths.js +7 -7
- package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-email-password/generated/template-renderers.d.ts +7 -7
- package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-email-password/generated/template-renderers.js +12 -12
- package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-email-password/generated/ts-import-providers.d.ts +5 -2
- package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-email-password/generated/ts-import-providers.js +7 -5
- package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-email-password/generated/typed-templates.d.ts +1 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-email-password/generated/typed-templates.js +3 -2
- package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.js.map +1 -0
- package/dist/local-auth/core/generators/auth-email-password/index.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-email-password/index.js.map +1 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.js.map +1 -0
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js +2 -2
- package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-email-password/templates/module/schema/user-password.mutations.ts +2 -2
- package/dist/{auth → local-auth}/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts +9 -1
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-email-password/templates/module/services/user-password.service.js +6 -2
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-email-password/templates/module/services/user-password.service.ts +17 -4
- package/dist/{auth → local-auth}/core/generators/auth-hooks/auth-hooks.generator.d.ts +12 -20
- package/dist/local-auth/core/generators/auth-hooks/auth-hooks.generator.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-hooks/auth-hooks.generator.js +2 -2
- package/dist/local-auth/core/generators/auth-hooks/auth-hooks.generator.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-hooks/generated/index.d.ts +17 -54
- package/dist/local-auth/core/generators/auth-hooks/generated/index.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-hooks/generated/index.js +11 -0
- package/dist/local-auth/core/generators/auth-hooks/generated/index.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-hooks/generated/template-paths.d.ts +4 -4
- package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-hooks/generated/template-paths.js +9 -7
- package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-hooks/generated/template-renderers.d.ts +9 -23
- package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-hooks/generated/template-renderers.js +15 -13
- package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.js.map +1 -0
- package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts +31 -0
- package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.js +38 -0
- package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-hooks/generated/typed-templates.d.ts +7 -65
- package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-hooks/generated/typed-templates.js +14 -4
- package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.js.map +1 -0
- package/dist/local-auth/core/generators/auth-hooks/index.d.ts +4 -0
- package/dist/local-auth/core/generators/auth-hooks/index.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-hooks/index.js +3 -0
- package/dist/local-auth/core/generators/auth-hooks/index.js.map +1 -0
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-hooks/templates/src/hooks/use-current-user.js +4 -4
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-hooks/templates/src/hooks/use-current-user.ts +4 -4
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-hooks/templates/src/hooks/use-log-out.js +3 -7
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-hooks/templates/src/hooks/use-log-out.ts +3 -7
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts +15 -0
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.js +16 -0
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.js.map +1 -0
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.ts +32 -0
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.js +1 -1
- package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.ts +1 -1
- package/dist/{auth → local-auth}/core/generators/auth-module/auth-module.generator.d.ts +12 -6
- package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-module/auth-module.generator.js +3 -3
- package/dist/local-auth/core/generators/auth-module/auth-module.generator.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-module/generated/index.d.ts +38 -8
- package/dist/local-auth/core/generators/auth-module/generated/index.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-module/generated/index.js +11 -0
- package/dist/local-auth/core/generators/auth-module/generated/index.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-module/generated/template-paths.d.ts +5 -4
- package/dist/local-auth/core/generators/auth-module/generated/template-paths.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-module/generated/template-paths.js +10 -7
- package/dist/local-auth/core/generators/auth-module/generated/template-paths.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-module/generated/template-renderers.d.ts +16 -10
- package/dist/local-auth/core/generators/auth-module/generated/template-renderers.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-module/generated/template-renderers.js +19 -16
- package/dist/local-auth/core/generators/auth-module/generated/template-renderers.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-module/generated/ts-import-providers.d.ts +2 -2
- package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-module/generated/ts-import-providers.js +5 -5
- package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-module/generated/typed-templates.d.ts +45 -3
- package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-module/generated/typed-templates.js +19 -2
- package/dist/local-auth/core/generators/auth-module/generated/typed-templates.js.map +1 -0
- package/dist/local-auth/core/generators/auth-module/index.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-module/index.js.map +1 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/constants/user-session.constants.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/constants/user-session.constants.js.map +1 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.d.ts +8 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.js +16 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.js.map +1 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.ts +21 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.js +2 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.ts +2 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js.map +1 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/schema/user-session.queries.js +1 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/schema/user-session.queries.ts +1 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/services/user-session.service.js +11 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/services/user-session.service.ts +13 -1
- package/dist/local-auth/core/generators/auth-module/templates/module/utils/cookie-signer.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/utils/cookie-signer.js.map +1 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/utils/session-cookie.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/utils/session-cookie.js.map +1 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/utils/verify-request-origin.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-module/templates/module/utils/verify-request-origin.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-routes/auth-routes.generator.d.ts +1 -15
- package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-routes/generated/index.d.ts +3 -45
- package/dist/{auth → local-auth}/core/generators/auth-routes/generated/index.d.ts.map +1 -1
- package/dist/local-auth/core/generators/auth-routes/generated/index.js.map +1 -0
- package/dist/local-auth/core/generators/auth-routes/generated/template-paths.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-routes/generated/template-paths.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-routes/generated/template-renderers.d.ts +1 -15
- package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-routes/generated/template-renderers.js +1 -1
- package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-routes/generated/typed-templates.d.ts +4 -60
- package/dist/{auth → local-auth}/core/generators/auth-routes/generated/typed-templates.d.ts.map +1 -1
- package/dist/{auth → local-auth}/core/generators/auth-routes/generated/typed-templates.js +1 -1
- package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.js.map +1 -0
- package/dist/local-auth/core/generators/auth-routes/index.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-routes/index.js.map +1 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts +15 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-routes/templates/routes/auth_/login.js +2 -3
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-routes/templates/routes/auth_/login.tsx +2 -3
- package/dist/{auth → local-auth}/core/generators/auth-routes/templates/routes/auth_/queries.gql +2 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts +15 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-routes/templates/routes/auth_/register.js +2 -3
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/auth-routes/templates/routes/auth_/register.tsx +2 -3
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/route.d.ts +2 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/route.d.ts.map +1 -0
- package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/route.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/index.d.ts +1 -0
- package/dist/local-auth/core/generators/index.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/index.js +1 -0
- package/dist/local-auth/core/generators/index.js.map +1 -0
- package/dist/local-auth/core/generators/react-auth/index.d.ts.map +1 -0
- package/dist/local-auth/core/generators/react-auth/index.js.map +1 -0
- package/dist/local-auth/core/generators/react-auth/react-auth.generator.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/react-auth/react-auth.generator.js +1 -1
- package/dist/local-auth/core/generators/react-auth/react-auth.generator.js.map +1 -0
- package/dist/local-auth/core/generators/react-session/generated/index.d.ts +345 -0
- package/dist/local-auth/core/generators/react-session/generated/index.d.ts.map +1 -0
- package/dist/local-auth/core/generators/react-session/generated/index.js +11 -0
- package/dist/{auth/core/generators/auth-email-password → local-auth/core/generators/react-session}/generated/index.js.map +1 -1
- package/dist/local-auth/core/generators/react-session/generated/template-paths.d.ts +14 -0
- package/dist/local-auth/core/generators/react-session/generated/template-paths.d.ts.map +1 -0
- package/dist/local-auth/core/generators/react-session/generated/template-paths.js +26 -0
- package/dist/local-auth/core/generators/react-session/generated/template-paths.js.map +1 -0
- package/dist/local-auth/core/generators/react-session/generated/template-renderers.d.ts +173 -0
- package/dist/local-auth/core/generators/react-session/generated/template-renderers.d.ts.map +1 -0
- package/dist/local-auth/core/generators/react-session/generated/template-renderers.js +58 -0
- package/dist/local-auth/core/generators/react-session/generated/template-renderers.js.map +1 -0
- package/dist/local-auth/core/generators/react-session/generated/ts-import-providers.d.ts +22 -0
- package/dist/local-auth/core/generators/react-session/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/local-auth/core/generators/react-session/generated/ts-import-providers.js +30 -0
- package/dist/local-auth/core/generators/react-session/generated/ts-import-providers.js.map +1 -0
- package/dist/local-auth/core/generators/react-session/generated/typed-templates.d.ts +324 -0
- package/dist/local-auth/core/generators/react-session/generated/typed-templates.d.ts.map +1 -0
- package/dist/local-auth/core/generators/react-session/generated/typed-templates.js +46 -0
- package/dist/local-auth/core/generators/react-session/generated/typed-templates.js.map +1 -0
- package/dist/local-auth/core/generators/react-session/index.d.ts.map +1 -0
- package/dist/local-auth/core/generators/react-session/index.js.map +1 -0
- package/dist/local-auth/core/generators/react-session/react-session.generator.d.ts +189 -0
- package/dist/local-auth/core/generators/react-session/react-session.generator.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/react-session/react-session.generator.js +6 -11
- package/dist/local-auth/core/generators/react-session/react-session.generator.js.map +1 -0
- package/dist/local-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-check.gql → local-auth/core/generators/react-session/templates/src/app/user-session-provider.gql} +1 -0
- package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.js +48 -0
- package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.js.map +1 -0
- package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.tsx +73 -0
- package/dist/{auth → local-auth}/core/generators/react-session/templates/src/services/user-session-client.d.ts +10 -31
- package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/generators/react-session/templates/src/services/user-session-client.js +9 -25
- package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.js.map +1 -0
- package/dist/{auth → local-auth}/core/generators/react-session/templates/src/services/user-session-client.ts +15 -52
- package/dist/local-auth/core/generators/seed-initial-user/generated/index.d.ts +75 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/index.d.ts.map +1 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/index.js +11 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/index.js.map +1 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/template-paths.d.ts +12 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/template-paths.d.ts.map +1 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/template-paths.js +24 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/template-paths.js.map +1 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.d.ts +38 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.d.ts.map +1 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.js +44 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.js.map +1 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/ts-import-providers.d.ts +19 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/ts-import-providers.js +26 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/ts-import-providers.js.map +1 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.d.ts +27 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.d.ts.map +1 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.js +20 -0
- package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.js.map +1 -0
- package/dist/local-auth/core/generators/seed-initial-user/index.d.ts +4 -0
- package/dist/local-auth/core/generators/seed-initial-user/index.d.ts.map +1 -0
- package/dist/local-auth/core/generators/seed-initial-user/index.js +3 -0
- package/dist/local-auth/core/generators/seed-initial-user/index.js.map +1 -0
- package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.d.ts +46 -0
- package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.d.ts.map +1 -0
- package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.js +57 -0
- package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.js.map +1 -0
- package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.d.ts +3 -0
- package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.d.ts.map +1 -0
- package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.js +32 -0
- package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.js.map +1 -0
- package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.ts +43 -0
- package/dist/local-auth/core/index.d.ts.map +1 -0
- package/dist/local-auth/core/index.js.map +1 -0
- package/dist/local-auth/core/node.d.ts +5 -0
- package/dist/local-auth/core/node.d.ts.map +1 -0
- package/dist/local-auth/core/node.js +59 -0
- package/dist/local-auth/core/node.js.map +1 -0
- package/dist/local-auth/core/schema/models.d.ts +10 -0
- package/dist/local-auth/core/schema/models.d.ts.map +1 -0
- package/dist/{auth → local-auth}/core/schema/models.js +1 -1
- package/dist/local-auth/core/schema/models.js.map +1 -0
- package/dist/local-auth/core/schema/plugin-definition.d.ts +40 -0
- package/dist/local-auth/core/schema/plugin-definition.d.ts.map +1 -0
- package/dist/local-auth/core/schema/plugin-definition.js +27 -0
- package/dist/local-auth/core/schema/plugin-definition.js.map +1 -0
- package/dist/local-auth/core/web.d.ts +6 -0
- package/dist/local-auth/core/web.d.ts.map +1 -0
- package/dist/local-auth/core/web.js +14 -0
- package/dist/local-auth/core/web.js.map +1 -0
- package/dist/local-auth/index.d.ts +2 -0
- package/dist/local-auth/index.d.ts.map +1 -0
- package/dist/local-auth/index.js +2 -0
- package/dist/local-auth/index.js.map +1 -0
- package/dist/{auth/metadata.json → local-auth/plugin.json} +4 -3
- package/dist/local-auth/static/icon.svg +1 -0
- package/dist/placeholder-auth/core/common.d.ts +1 -1
- package/dist/placeholder-auth/core/common.d.ts.map +1 -1
- package/dist/placeholder-auth/core/common.js +6 -10
- package/dist/placeholder-auth/core/common.js.map +1 -1
- package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.d.ts.map +1 -1
- package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.js +12 -16
- package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.js.map +1 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.d.ts +3 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.d.ts.map +1 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.d.ts +3 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.d.ts.map +1 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.js +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.js.map +1 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.d.ts.map +1 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.js +5 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.js.map +1 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.d.ts +3 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.d.ts.map +1 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/auth-module.generator.d.ts +2 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/auth-module.generator.d.ts.map +1 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.d.ts +4 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.d.ts.map +1 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.d.ts +2 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.d.ts.map +1 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.d.ts +2 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.d.ts.map +1 -1
- package/dist/placeholder-auth/core/node.d.ts.map +1 -1
- package/dist/placeholder-auth/core/node.js +7 -10
- package/dist/placeholder-auth/core/node.js.map +1 -1
- package/dist/placeholder-auth/core/schema/models.d.ts +2 -1
- package/dist/placeholder-auth/core/schema/models.d.ts.map +1 -1
- package/dist/placeholder-auth/core/schema/models.js +1 -1
- package/dist/placeholder-auth/core/schema/models.js.map +1 -1
- package/dist/placeholder-auth/core/schema/plugin-definition.d.ts +0 -61
- package/dist/placeholder-auth/core/schema/plugin-definition.d.ts.map +1 -1
- package/dist/placeholder-auth/core/schema/plugin-definition.js +1 -7
- package/dist/placeholder-auth/core/schema/plugin-definition.js.map +1 -1
- package/dist/placeholder-auth/core/web.js +2 -2
- package/dist/placeholder-auth/core/web.js.map +1 -1
- package/dist/placeholder-auth/{metadata.json → plugin.json} +2 -1
- package/dist/web/assets/__federation_expose_auth0CoreCommon-lV5QSzvf.js +49 -0
- package/dist/web/assets/__federation_expose_auth0CoreCommon-lV5QSzvf.js.map +1 -0
- package/dist/web/assets/{__federation_expose_auth0CoreWeb-DjVw47sM.js → __federation_expose_auth0CoreWeb-5F0rTNis.js} +51 -78
- package/dist/web/assets/__federation_expose_auth0CoreWeb-5F0rTNis.js.map +1 -0
- package/dist/web/assets/__federation_expose_authCoreCommon-C5cVmNCH.js +29 -0
- package/dist/web/assets/__federation_expose_authCoreCommon-C5cVmNCH.js.map +1 -0
- package/dist/web/assets/__federation_expose_authCoreWeb-CJxY8hZC.js +439 -0
- package/dist/web/assets/__federation_expose_authCoreWeb-CJxY8hZC.js.map +1 -0
- package/dist/web/assets/__federation_expose_local-authCoreCommon-Dr_ngV2l.js +32 -0
- package/dist/web/assets/__federation_expose_local-authCoreCommon-Dr_ngV2l.js.map +1 -0
- package/dist/web/assets/{__federation_expose_authCoreWeb-CrFEmZp3.js → __federation_expose_local-authCoreWeb-B5iBudnh.js} +109 -108
- package/dist/web/assets/__federation_expose_local-authCoreWeb-B5iBudnh.js.map +1 -0
- package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-l8knzO7I.js +32 -0
- package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-l8knzO7I.js.map +1 -0
- package/dist/web/assets/{__federation_expose_placeholder-authCoreWeb-CpxfTdxv.js → __federation_expose_placeholder-authCoreWeb-DbI_bZsk.js} +50 -74
- package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-DbI_bZsk.js.map +1 -0
- package/dist/web/assets/{__federation_fn_import-CGvRdRVe.js → __federation_fn_import-DReOsou_.js} +2 -2
- package/dist/web/assets/{__federation_fn_import-CGvRdRVe.js.map → __federation_fn_import-DReOsou_.js.map} +1 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-D1kBtwsm.js → web-BlPKO2K7.js} +7 -5
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-D1kBtwsm.js.map → web-BlPKO2K7.js.map} +1 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/{project-builder-lib-B7442OYh.js → project-builder-lib-CGEZr0YI.js} +232 -614
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-CGEZr0YI.js.map +1 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/{ui-components-X318M5Ml.js → ui-components-RO_rk4f0.js} +2224 -2030
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-RO_rk4f0.js.map +1 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/utils-BbU_EX7_.js +1544 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/utils-BbU_EX7_.js.map +1 -0
- package/dist/web/assets/__federation_shared_@tanstack/react-router-CNTPQj7N.js +6138 -0
- package/dist/web/assets/__federation_shared_@tanstack/react-router-CNTPQj7N.js.map +1 -0
- package/dist/web/assets/__federation_shared_react-CJ2OfFKA.js +8 -0
- package/dist/web/assets/{__federation_shared_react-uocnGSER.js.map → __federation_shared_react-CJ2OfFKA.js.map} +1 -1
- package/dist/web/assets/{__federation_shared_react-dom-Bwq4pLax.js → __federation_shared_react-dom-B4vgf5Ln.js} +3 -2
- package/dist/web/assets/{__federation_shared_react-dom-Bwq4pLax.js.map → __federation_shared_react-dom-B4vgf5Ln.js.map} +1 -1
- package/dist/web/assets/_commonjsHelpers-B85MJLTf.js +6 -0
- package/dist/web/assets/_commonjsHelpers-B85MJLTf.js.map +1 -0
- package/dist/web/assets/get-auth-plugin-definition-CQ6mWMZk.js +13 -0
- package/dist/web/assets/get-auth-plugin-definition-CQ6mWMZk.js.map +1 -0
- package/dist/web/assets/{index-ydDQKauE.js → index-BkOJzK_m.js} +3 -3
- package/dist/web/assets/{index-ydDQKauE.js.map → index-BkOJzK_m.js.map} +1 -1
- package/dist/web/assets/{index-B1hOKVPw.js → index-DUwCgkeV.js} +2 -6
- package/dist/web/assets/{index-B1hOKVPw.js.map → index-DUwCgkeV.js.map} +1 -1
- package/dist/web/assets/{index.esm-DYWXRkn-.js → index.esm-UnRzlLlr.js} +3 -61
- package/dist/web/assets/index.esm-UnRzlLlr.js.map +1 -0
- package/dist/web/assets/isEqual-DAXqKRba.js +242 -0
- package/dist/web/assets/isEqual-DAXqKRba.js.map +1 -0
- package/dist/web/assets/jsx-runtime-XI9uIe3W.js +60 -0
- package/dist/web/assets/jsx-runtime-XI9uIe3W.js.map +1 -0
- package/dist/web/assets/{model-merger-BVBtbNAj.js → model-merger-BLEOsCIp.js} +9 -321
- package/dist/web/assets/model-merger-BLEOsCIp.js.map +1 -0
- package/dist/web/assets/plugin-definition-C935Xf1h.js +19 -0
- package/dist/web/assets/plugin-definition-C935Xf1h.js.map +1 -0
- package/dist/web/assets/plugin-definition-ChUKIqUg.js +40 -0
- package/dist/web/assets/plugin-definition-ChUKIqUg.js.map +1 -0
- package/dist/web/assets/plugin-definition-DH4QyCfv.js +86 -0
- package/dist/web/assets/plugin-definition-DH4QyCfv.js.map +1 -0
- package/dist/web/assets/plugin-definition-PCHsX2lR.js +19 -0
- package/dist/web/assets/plugin-definition-PCHsX2lR.js.map +1 -0
- package/dist/web/assets/{react-B23vKoD0.js → react-ecPihYHK.js} +2 -2
- package/dist/web/assets/{react-B23vKoD0.js.map → react-ecPihYHK.js.map} +1 -1
- package/dist/web/assets/remoteEntry.js +18 -12
- package/dist/web/assets/remoteEntry.js.map +1 -1
- package/dist/web/assets/sortBy-BPH_zRB8.js +34 -0
- package/dist/web/assets/sortBy-BPH_zRB8.js.map +1 -0
- package/dist/web/assets/{style-ZUYizAnf.css → style-BhUCMIWI.css} +51 -6
- package/dist/web/assets/styles-I6mpdfRm.js +58 -0
- package/dist/web/assets/styles-I6mpdfRm.js.map +1 -0
- package/dist/web/index.html +1 -1
- package/package.json +17 -16
- package/dist/auth/core/generators/auth-apollo/auth-apollo.generator.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-apollo/auth-apollo.generator.js.map +0 -1
- package/dist/auth/core/generators/auth-apollo/index.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-apollo/index.js.map +0 -1
- package/dist/auth/core/generators/auth-apollo/templates/session-error-link.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-apollo/templates/session-error-link.js.map +0 -1
- package/dist/auth/core/generators/auth-email-password/auth-email-password.generator.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/auth-email-password.generator.js.map +0 -1
- package/dist/auth/core/generators/auth-email-password/generated/index.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/generated/index.js +0 -11
- package/dist/auth/core/generators/auth-email-password/generated/template-paths.d.ts +0 -14
- package/dist/auth/core/generators/auth-email-password/generated/template-paths.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/generated/template-paths.js.map +0 -1
- package/dist/auth/core/generators/auth-email-password/generated/template-renderers.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/generated/template-renderers.js.map +0 -1
- package/dist/auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/generated/ts-import-providers.js.map +0 -1
- package/dist/auth/core/generators/auth-email-password/generated/typed-templates.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/generated/typed-templates.js.map +0 -1
- package/dist/auth/core/generators/auth-email-password/index.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/index.js.map +0 -1
- package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.js.map +0 -1
- package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js.map +0 -1
- package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/auth-hooks.generator.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/auth-hooks.generator.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/index.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/index.js +0 -11
- package/dist/auth/core/generators/auth-hooks/generated/index.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/template-paths.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/template-paths.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/template-renderers.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/template-renderers.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts +0 -16
- package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.js +0 -27
- package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/typed-templates.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/generated/typed-templates.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/index.d.ts +0 -2
- package/dist/auth/core/generators/auth-hooks/index.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/index.js +0 -2
- package/dist/auth/core/generators/auth-hooks/index.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts +0 -8
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.js +0 -12
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.js.map +0 -1
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.ts +0 -16
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.js.map +0 -1
- package/dist/auth/core/generators/auth-module/auth-module.generator.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/auth-module.generator.js.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/index.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/index.js +0 -11
- package/dist/auth/core/generators/auth-module/generated/index.js.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/template-paths.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/template-paths.js.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/template-renderers.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/template-renderers.js.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/ts-import-providers.js.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/typed-templates.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/generated/typed-templates.js.map +0 -1
- package/dist/auth/core/generators/auth-module/index.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/index.js.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/constants/user-session.constants.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/constants/user-session.constants.js.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.js.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.js.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.js.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/utils/cookie-signer.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/utils/cookie-signer.js.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/utils/session-cookie.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/utils/session-cookie.js.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/utils/verify-request-origin.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-module/templates/module/utils/verify-request-origin.js.map +0 -1
- package/dist/auth/core/generators/auth-routes/auth-routes.generator.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-routes/auth-routes.generator.js.map +0 -1
- package/dist/auth/core/generators/auth-routes/generated/index.js.map +0 -1
- package/dist/auth/core/generators/auth-routes/generated/template-paths.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-routes/generated/template-paths.js.map +0 -1
- package/dist/auth/core/generators/auth-routes/generated/template-renderers.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-routes/generated/template-renderers.js.map +0 -1
- package/dist/auth/core/generators/auth-routes/generated/typed-templates.js.map +0 -1
- package/dist/auth/core/generators/auth-routes/index.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-routes/index.js.map +0 -1
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts +0 -2
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.js.map +0 -1
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts +0 -2
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.js.map +0 -1
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/route.d.ts +0 -2
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/route.d.ts.map +0 -1
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/route.js.map +0 -1
- package/dist/auth/core/generators/index.d.ts.map +0 -1
- package/dist/auth/core/generators/index.js.map +0 -1
- package/dist/auth/core/generators/react-auth/index.d.ts.map +0 -1
- package/dist/auth/core/generators/react-auth/index.js.map +0 -1
- package/dist/auth/core/generators/react-auth/react-auth.generator.d.ts.map +0 -1
- package/dist/auth/core/generators/react-auth/react-auth.generator.js.map +0 -1
- package/dist/auth/core/generators/react-session/generated/index.d.ts +0 -74
- package/dist/auth/core/generators/react-session/generated/index.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/generated/index.js +0 -11
- package/dist/auth/core/generators/react-session/generated/index.js.map +0 -1
- package/dist/auth/core/generators/react-session/generated/template-paths.d.ts +0 -16
- package/dist/auth/core/generators/react-session/generated/template-paths.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/generated/template-paths.js +0 -26
- package/dist/auth/core/generators/react-session/generated/template-paths.js.map +0 -1
- package/dist/auth/core/generators/react-session/generated/template-renderers.d.ts +0 -27
- package/dist/auth/core/generators/react-session/generated/template-renderers.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/generated/template-renderers.js +0 -49
- package/dist/auth/core/generators/react-session/generated/template-renderers.js.map +0 -1
- package/dist/auth/core/generators/react-session/generated/ts-import-providers.d.ts +0 -64
- package/dist/auth/core/generators/react-session/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/generated/ts-import-providers.js +0 -42
- package/dist/auth/core/generators/react-session/generated/ts-import-providers.js.map +0 -1
- package/dist/auth/core/generators/react-session/generated/typed-templates.d.ts +0 -46
- package/dist/auth/core/generators/react-session/generated/typed-templates.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/generated/typed-templates.js +0 -82
- package/dist/auth/core/generators/react-session/generated/typed-templates.js.map +0 -1
- package/dist/auth/core/generators/react-session/index.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/index.js.map +0 -1
- package/dist/auth/core/generators/react-session/react-session.generator.d.ts +0 -58
- package/dist/auth/core/generators/react-session/react-session.generator.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/react-session.generator.js.map +0 -1
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.d.ts +0 -7
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.js +0 -25
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.js.map +0 -1
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.tsx +0 -28
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.js +0 -18
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.js.map +0 -1
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.tsx +0 -45
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.d.ts +0 -12
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.js +0 -15
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.js.map +0 -1
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.ts +0 -30
- package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.d.ts.map +0 -1
- package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.js.map +0 -1
- package/dist/auth/core/index.d.ts.map +0 -1
- package/dist/auth/core/index.js.map +0 -1
- package/dist/auth/core/schema/models.d.ts +0 -9
- package/dist/auth/core/schema/models.d.ts.map +0 -1
- package/dist/auth/core/schema/models.js.map +0 -1
- package/dist/auth0/core/components/auth-definition-editor.d.ts +0 -5
- package/dist/auth0/core/components/auth-definition-editor.d.ts.map +0 -1
- package/dist/auth0/core/components/auth-definition-editor.js +0 -61
- package/dist/auth0/core/components/auth-definition-editor.js.map +0 -1
- package/dist/common/compiler/generator-creators.d.ts +0 -18
- package/dist/common/compiler/generator-creators.d.ts.map +0 -1
- package/dist/common/compiler/generator-creators.js +0 -34
- package/dist/common/compiler/generator-creators.js.map +0 -1
- package/dist/common/compiler/index.d.ts +0 -2
- package/dist/common/compiler/index.d.ts.map +0 -1
- package/dist/common/compiler/index.js +0 -2
- package/dist/common/compiler/index.js.map +0 -1
- package/dist/common/index.d.ts +0 -3
- package/dist/common/index.d.ts.map +0 -1
- package/dist/common/index.js +0 -3
- package/dist/common/index.js.map +0 -1
- package/dist/common/roles/components/index.d.ts +0 -2
- package/dist/common/roles/components/index.d.ts.map +0 -1
- package/dist/common/roles/components/index.js +0 -2
- package/dist/common/roles/components/index.js.map +0 -1
- package/dist/common/roles/components/role-editor-form/role-dialog.d.ts.map +0 -1
- package/dist/common/roles/components/role-editor-form/role-dialog.js.map +0 -1
- package/dist/common/roles/components/role-editor-form/role-editor-form.d.ts +0 -10
- package/dist/common/roles/components/role-editor-form/role-editor-form.d.ts.map +0 -1
- package/dist/common/roles/components/role-editor-form/role-editor-form.js.map +0 -1
- package/dist/common/roles/constants.d.ts.map +0 -1
- package/dist/common/roles/constants.js.map +0 -1
- package/dist/common/roles/index.d.ts +0 -4
- package/dist/common/roles/index.d.ts.map +0 -1
- package/dist/common/roles/index.js +0 -4
- package/dist/common/roles/index.js.map +0 -1
- package/dist/common/roles/schema.d.ts.map +0 -1
- package/dist/common/roles/schema.js.map +0 -1
- package/dist/web/assets/__federation_expose_auth0CoreCommon-CSWdt8d_.js +0 -56
- package/dist/web/assets/__federation_expose_auth0CoreCommon-CSWdt8d_.js.map +0 -1
- package/dist/web/assets/__federation_expose_auth0CoreWeb-DjVw47sM.js.map +0 -1
- package/dist/web/assets/__federation_expose_authCoreCommon-CvHJZFIq.js +0 -36
- package/dist/web/assets/__federation_expose_authCoreCommon-CvHJZFIq.js.map +0 -1
- package/dist/web/assets/__federation_expose_authCoreWeb-CrFEmZp3.js.map +0 -1
- package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-CmkiEJ6z.js +0 -39
- package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-CmkiEJ6z.js.map +0 -1
- package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-CpxfTdxv.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-B7442OYh.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-X318M5Ml.js.map +0 -1
- package/dist/web/assets/__federation_shared_react-uocnGSER.js +0 -7
- package/dist/web/assets/index.esm-DYWXRkn-.js.map +0 -1
- package/dist/web/assets/model-merger-BVBtbNAj.js.map +0 -1
- package/dist/web/assets/plugin-definition-Bdhuga1j.js +0 -36
- package/dist/web/assets/plugin-definition-Bdhuga1j.js.map +0 -1
- package/dist/web/assets/plugin-definition-C9d7ykhX.js +0 -24
- package/dist/web/assets/plugin-definition-C9d7ykhX.js.map +0 -1
- package/dist/web/assets/plugin-definition-QzgXWr1I.js +0 -24
- package/dist/web/assets/plugin-definition-QzgXWr1I.js.map +0 -1
- package/dist/web/assets/role-editor-form-BkcoVwtU.js +0 -319
- package/dist/web/assets/role-editor-form-BkcoVwtU.js.map +0 -1
- package/dist/web/assets/styles-Dfjm_ApH.js +0 -201
- package/dist/web/assets/styles-Dfjm_ApH.js.map +0 -1
- package/manifest.json +0 -4
- /package/dist/{common → auth/core/schema}/roles/constants.d.ts +0 -0
- /package/dist/{common → auth/core/schema}/roles/constants.js +0 -0
- /package/dist/{common → auth/core/schema}/roles/schema.d.ts +0 -0
- /package/dist/{common → auth/core/schema}/roles/schema.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-apollo/index.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-apollo/index.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-apollo/templates/session-error-link.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-apollo/templates/session-error-link.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-apollo/templates/session-error-link.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-email-password/index.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-email-password/index.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-email-password/templates/module/constants/password.constants.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-email-password/templates/module/constants/password.constants.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-email-password/templates/module/schema/user-password.mutations.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-hooks/templates/src/hooks/use-current-user.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-hooks/templates/src/hooks/use-current-user.gql +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-hooks/templates/src/hooks/use-log-out.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-hooks/templates/src/hooks/use-log-out.gql +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/index.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/index.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/constants/user-session.constants.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/constants/user-session.constants.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/constants/user-session.constants.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/schema/user-session.mutations.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/schema/user-session.mutations.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/schema/user-session.mutations.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/schema/user-session.queries.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/services/user-session.service.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/cookie-signer.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/cookie-signer.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/cookie-signer.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/session-cookie.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/session-cookie.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/session-cookie.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/verify-request-origin.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/verify-request-origin.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-module/templates/module/utils/verify-request-origin.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-routes/auth-routes.generator.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-routes/generated/index.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-routes/generated/template-paths.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-routes/generated/template-paths.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-routes/index.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-routes/index.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-routes/templates/routes/auth_/route.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/auth-routes/templates/routes/auth_/route.tsx +0 -0
- /package/dist/{auth → local-auth}/core/generators/react-auth/index.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/react-auth/index.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/react-auth/react-auth.generator.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/react-session/index.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/generators/react-session/index.js +0 -0
- /package/dist/{auth → local-auth}/core/generators/react-session/templates/src/app/user-session-provider.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/index.d.ts +0 -0
- /package/dist/{auth → local-auth}/core/index.js +0 -0
|
@@ -0,0 +1,1544 @@
|
|
|
1
|
+
import { s as sortBy } from '../sortBy-BPH_zRB8.js';
|
|
2
|
+
import { i as isEqual } from '../isEqual-DAXqKRba.js';
|
|
3
|
+
import { importShared } from '../__federation_fn_import-DReOsou_.js';
|
|
4
|
+
|
|
5
|
+
function isObjectLike(value) {
|
|
6
|
+
return typeof value === 'object' && value !== null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function mergeWith(target, source, merge) {
|
|
10
|
+
const sourceKeys = Object.keys(source);
|
|
11
|
+
for (let i = 0; i < sourceKeys.length; i++) {
|
|
12
|
+
const key = sourceKeys[i];
|
|
13
|
+
const sourceValue = source[key];
|
|
14
|
+
const targetValue = target[key];
|
|
15
|
+
const merged = merge(targetValue, sourceValue, key, target, source);
|
|
16
|
+
if (merged != null) {
|
|
17
|
+
target[key] = merged;
|
|
18
|
+
}
|
|
19
|
+
else if (Array.isArray(sourceValue)) {
|
|
20
|
+
target[key] = mergeWith(targetValue ?? [], sourceValue, merge);
|
|
21
|
+
}
|
|
22
|
+
else if (isObjectLike(targetValue) && isObjectLike(sourceValue)) {
|
|
23
|
+
target[key] = mergeWith(targetValue ?? {}, sourceValue, merge);
|
|
24
|
+
}
|
|
25
|
+
else if (targetValue === undefined || sourceValue !== undefined) {
|
|
26
|
+
target[key] = sourceValue;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return target;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function normalizeContent(content) {
|
|
33
|
+
if (typeof content === 'string') {
|
|
34
|
+
const encoder = new TextEncoder();
|
|
35
|
+
return encoder.encode(content);
|
|
36
|
+
}
|
|
37
|
+
return content;
|
|
38
|
+
}
|
|
39
|
+
async function hashWithSHA256(content) {
|
|
40
|
+
const data = normalizeContent(content);
|
|
41
|
+
const hashBuffer = await crypto.subtle.digest('SHA-256', data);
|
|
42
|
+
const hashArray = [...new Uint8Array(hashBuffer)];
|
|
43
|
+
return hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Enhances an error with additional context while preserving the original stack trace
|
|
48
|
+
* @param {Error} originalError - The original error that was caught
|
|
49
|
+
* @param {string} contextMessage - Additional context to prepend to the error message
|
|
50
|
+
* @param {Object} [additionalProps] - Optional object with additional properties to add to the error
|
|
51
|
+
* @returns {Error} - Enhanced error with preserved stack trace
|
|
52
|
+
*/
|
|
53
|
+
function enhanceErrorWithContext(originalError, contextMessage) {
|
|
54
|
+
// Create a new error with combined message
|
|
55
|
+
const enhancedError = new Error(`${contextMessage}: ${originalError instanceof Error
|
|
56
|
+
? originalError.message
|
|
57
|
+
: String(originalError)}`, { cause: originalError });
|
|
58
|
+
// Preserve the original stack if possible
|
|
59
|
+
if (originalError instanceof Error) {
|
|
60
|
+
enhancedError.stack = originalError.stack;
|
|
61
|
+
}
|
|
62
|
+
return enhancedError;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Class providing typed event emitter functionality.
|
|
67
|
+
*
|
|
68
|
+
* @template T - Mapping of event names to payload types.
|
|
69
|
+
*/
|
|
70
|
+
class TypedEventEmitter {
|
|
71
|
+
listenerMap = new Map();
|
|
72
|
+
/**
|
|
73
|
+
* Abort controller for the event emitter to terminate all async generator listeners.
|
|
74
|
+
*/
|
|
75
|
+
eventEmitterAbortController = new AbortController();
|
|
76
|
+
/**
|
|
77
|
+
* Registers a listener for an event.
|
|
78
|
+
*
|
|
79
|
+
* @template K - The event name.
|
|
80
|
+
* @param eventName - Name of the event.
|
|
81
|
+
* @param listener - Callback invoked with the event payload.
|
|
82
|
+
* @param options - Options for the listener.
|
|
83
|
+
* @returns Function to unregister the listener.
|
|
84
|
+
*/
|
|
85
|
+
on(eventName, listener, options) {
|
|
86
|
+
const { signal } = options ?? {};
|
|
87
|
+
const existingListeners = this.listenerMap.get(eventName) ?? [];
|
|
88
|
+
this.listenerMap.set(eventName, [
|
|
89
|
+
...existingListeners,
|
|
90
|
+
listener,
|
|
91
|
+
]);
|
|
92
|
+
// Returns a function that unregisters this listener.
|
|
93
|
+
const unregister = () => {
|
|
94
|
+
const updatedListeners = (this.listenerMap.get(eventName) ?? []).filter((l) => l !== listener);
|
|
95
|
+
if (updatedListeners.length > 0) {
|
|
96
|
+
this.listenerMap.set(eventName, updatedListeners);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
this.listenerMap.delete(eventName);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
signal?.addEventListener('abort', unregister, {
|
|
103
|
+
once: true,
|
|
104
|
+
});
|
|
105
|
+
return unregister;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Creates an async generator for an event.
|
|
109
|
+
*
|
|
110
|
+
* @template K - The event name.
|
|
111
|
+
* @param eventName - Name of the event.
|
|
112
|
+
* @param options - Additional options.
|
|
113
|
+
* @returns An async generator yielding event payloads.
|
|
114
|
+
*/
|
|
115
|
+
async *onAsync(eventName, options) {
|
|
116
|
+
// Create a queue to store events when consumer isn't ready
|
|
117
|
+
const queue = [];
|
|
118
|
+
let pendingNext;
|
|
119
|
+
let isDone = false;
|
|
120
|
+
// Return early if the signal is aborted
|
|
121
|
+
const eventEmitterAbortSignal = this.eventEmitterAbortController.signal;
|
|
122
|
+
if (options.signal?.aborted || eventEmitterAbortSignal.aborted)
|
|
123
|
+
return;
|
|
124
|
+
function abortHandler() {
|
|
125
|
+
isDone = true;
|
|
126
|
+
// trigger dummy event to unblock the consumer
|
|
127
|
+
pendingNext?.(undefined);
|
|
128
|
+
}
|
|
129
|
+
options.signal?.addEventListener('abort', abortHandler, { once: true });
|
|
130
|
+
eventEmitterAbortSignal.addEventListener('abort', abortHandler, {
|
|
131
|
+
once: true,
|
|
132
|
+
});
|
|
133
|
+
this.on(eventName, (payload) => {
|
|
134
|
+
if (pendingNext) {
|
|
135
|
+
pendingNext(payload);
|
|
136
|
+
pendingNext = undefined;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
queue.push(payload);
|
|
140
|
+
}
|
|
141
|
+
}, { signal: options.signal });
|
|
142
|
+
// Keep yielding events until done
|
|
143
|
+
while (!isDone) {
|
|
144
|
+
const payload = queue.shift() ??
|
|
145
|
+
(await new Promise((resolve) => {
|
|
146
|
+
pendingNext = resolve;
|
|
147
|
+
}));
|
|
148
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- false positive since isDone is set to true in the abort handler
|
|
149
|
+
if (isDone)
|
|
150
|
+
break;
|
|
151
|
+
yield payload;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Emits an event with the given payload.
|
|
156
|
+
*
|
|
157
|
+
* @template K - The event name.
|
|
158
|
+
* @param eventName - Name of the event.
|
|
159
|
+
* @param payload - Payload for the event.
|
|
160
|
+
*/
|
|
161
|
+
emit(eventName, payload) {
|
|
162
|
+
const listeners = this.listenerMap.get(eventName) ?? [];
|
|
163
|
+
for (const listener of listeners) {
|
|
164
|
+
listener(payload);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Removes all registered event listeners.
|
|
169
|
+
*
|
|
170
|
+
* Note: This is dangerous and should only be used in testing.
|
|
171
|
+
*/
|
|
172
|
+
clearListeners() {
|
|
173
|
+
this.listenerMap.clear();
|
|
174
|
+
this.eventEmitterAbortController.abort();
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Aborts the event emitter to terminate all async generator listeners.
|
|
178
|
+
*/
|
|
179
|
+
abortEventEmitter() {
|
|
180
|
+
this.eventEmitterAbortController.abort();
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Creates a typed event emitter that supports event listening and emitting.
|
|
185
|
+
*
|
|
186
|
+
* @template T - Mapping of event names to payload types.
|
|
187
|
+
* @returns An emitter with `on`, `emit`, and `clear` methods.
|
|
188
|
+
*/
|
|
189
|
+
function createTypedEventEmitter() {
|
|
190
|
+
return new TypedEventEmitter();
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Field container for a single value that cannot be overridden once set
|
|
195
|
+
*/
|
|
196
|
+
class ScalarContainer {
|
|
197
|
+
_value;
|
|
198
|
+
defaultValue;
|
|
199
|
+
isSet = false;
|
|
200
|
+
setBySource;
|
|
201
|
+
getDynamicSource;
|
|
202
|
+
constructor(defaultValue, options) {
|
|
203
|
+
this.defaultValue = defaultValue;
|
|
204
|
+
this.getDynamicSource = options?.getDynamicSource;
|
|
205
|
+
}
|
|
206
|
+
getValue() {
|
|
207
|
+
return this._value === undefined ? this.defaultValue : this._value;
|
|
208
|
+
}
|
|
209
|
+
set(value, source) {
|
|
210
|
+
if (this.isSet) {
|
|
211
|
+
throw new Error(`Value has already been set by ${this.setBySource} and cannot be overwritten by ${source}`);
|
|
212
|
+
}
|
|
213
|
+
this._value = value;
|
|
214
|
+
this.isSet = true;
|
|
215
|
+
this.setBySource = source ?? this.getDynamicSource?.() ?? 'unknown';
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
// Array field container
|
|
219
|
+
class ArrayContainer {
|
|
220
|
+
_stripDuplicates;
|
|
221
|
+
_value;
|
|
222
|
+
constructor(initialValue, options) {
|
|
223
|
+
this._stripDuplicates = options?.stripDuplicates ?? false;
|
|
224
|
+
this._value = initialValue ?? [];
|
|
225
|
+
}
|
|
226
|
+
push(...items) {
|
|
227
|
+
let currentValue = this._value;
|
|
228
|
+
if (this._stripDuplicates) {
|
|
229
|
+
// Add items without duplicates
|
|
230
|
+
const set = new Set([...currentValue, ...items]);
|
|
231
|
+
currentValue = [...set];
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
// Add all items
|
|
235
|
+
currentValue = [...currentValue, ...items];
|
|
236
|
+
}
|
|
237
|
+
this._value = currentValue;
|
|
238
|
+
}
|
|
239
|
+
getValue() {
|
|
240
|
+
return this._value;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
class ObjectContainer {
|
|
244
|
+
map;
|
|
245
|
+
getDynamicSource;
|
|
246
|
+
constructor(initialValue, options) {
|
|
247
|
+
this.getDynamicSource = options?.getDynamicSource;
|
|
248
|
+
this.map = new Map(Object.entries(initialValue).map(([key, value]) => [
|
|
249
|
+
key,
|
|
250
|
+
{ value, setBySource: this.getDynamicSource?.() },
|
|
251
|
+
]));
|
|
252
|
+
}
|
|
253
|
+
set(key, value, source) {
|
|
254
|
+
const existingValue = this.map.get(key);
|
|
255
|
+
if (existingValue?.setBySource) {
|
|
256
|
+
throw new Error(`Value for key ${key} has already been set by ${existingValue.setBySource} and cannot be overwritten by ${source}`);
|
|
257
|
+
}
|
|
258
|
+
this.map.set(key, {
|
|
259
|
+
value,
|
|
260
|
+
setBySource: source ?? this.getDynamicSource?.(),
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
merge(value, source) {
|
|
264
|
+
const mergeSource = source ?? this.getDynamicSource?.();
|
|
265
|
+
for (const [key, val] of Object.entries(value)) {
|
|
266
|
+
this.set(key, val, mergeSource);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
getValue() {
|
|
270
|
+
return Object.fromEntries([...this.map.entries()].map(([key, value]) => [key, value.value]));
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
// Map field container
|
|
274
|
+
class MapContainer {
|
|
275
|
+
_value;
|
|
276
|
+
getDynamicSource;
|
|
277
|
+
constructor(initialValue, options) {
|
|
278
|
+
this.getDynamicSource = options?.getDynamicSource;
|
|
279
|
+
const initialMap = initialValue ?? new Map();
|
|
280
|
+
this._value = new Map([...initialMap.entries()].map(([key, value]) => [
|
|
281
|
+
key,
|
|
282
|
+
{ value, setBySource: this.getDynamicSource?.() },
|
|
283
|
+
]));
|
|
284
|
+
}
|
|
285
|
+
set(key, value, source) {
|
|
286
|
+
const existingValue = this._value.get(key);
|
|
287
|
+
if (existingValue?.setBySource) {
|
|
288
|
+
throw new Error(`Value for key ${key} has already been set by ${existingValue.setBySource} and cannot be overwritten by ${source}`);
|
|
289
|
+
}
|
|
290
|
+
this._value.set(key, {
|
|
291
|
+
value,
|
|
292
|
+
setBySource: source ?? this.getDynamicSource?.(),
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
merge(value, source) {
|
|
296
|
+
const mergeSource = source ?? this.getDynamicSource?.();
|
|
297
|
+
for (const [key, val] of value.entries()) {
|
|
298
|
+
this.set(key, val, mergeSource);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
mergeObj(value, source) {
|
|
302
|
+
const mergeSource = source ?? this.getDynamicSource?.();
|
|
303
|
+
for (const [key, val] of Object.entries(value)) {
|
|
304
|
+
this.set(key, val, mergeSource);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
getValue() {
|
|
308
|
+
return new Map([...this._value.entries()].map(([key, value]) => [key, value.value]));
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Named field container
|
|
313
|
+
*
|
|
314
|
+
* This container stores objects that contains a name field that can be used for
|
|
315
|
+
* detecting duplicate names.
|
|
316
|
+
*/
|
|
317
|
+
class NamedArrayFieldContainer {
|
|
318
|
+
_value;
|
|
319
|
+
getDynamicSource;
|
|
320
|
+
constructor(initialValue, options) {
|
|
321
|
+
this.getDynamicSource = options?.getDynamicSource;
|
|
322
|
+
const value = initialValue ?? [];
|
|
323
|
+
this._value = new Map(value.map((val) => [
|
|
324
|
+
val.name,
|
|
325
|
+
{ value: val, setBySource: this.getDynamicSource?.() },
|
|
326
|
+
]));
|
|
327
|
+
}
|
|
328
|
+
add(value, source) {
|
|
329
|
+
const existingValue = this._value.get(value.name);
|
|
330
|
+
if (existingValue?.setBySource) {
|
|
331
|
+
throw new Error(`Value for name ${value.name} has already been set by ${existingValue.setBySource} and cannot be overwritten by ${source}`);
|
|
332
|
+
}
|
|
333
|
+
this._value.set(value.name, {
|
|
334
|
+
value,
|
|
335
|
+
setBySource: source ?? this.getDynamicSource?.(),
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
addMany(values, source) {
|
|
339
|
+
for (const value of values) {
|
|
340
|
+
this.add(value, source);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
getValue() {
|
|
344
|
+
return sortBy([...this._value.values()].map((value) => value.value), [(v) => v.name]);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
// Map of maps field container
|
|
348
|
+
class MapOfMapsContainer {
|
|
349
|
+
_value;
|
|
350
|
+
getDynamicSource;
|
|
351
|
+
constructor(initialValue, options) {
|
|
352
|
+
this.getDynamicSource = options?.getDynamicSource;
|
|
353
|
+
const initialMap = initialValue ?? new Map();
|
|
354
|
+
this._value = new Map([...initialMap.entries()].map(([key1, innerMap]) => [
|
|
355
|
+
key1,
|
|
356
|
+
{
|
|
357
|
+
value: new Map([...innerMap.entries()].map(([key2, value]) => [
|
|
358
|
+
key2,
|
|
359
|
+
{ value, setBySource: this.getDynamicSource?.() },
|
|
360
|
+
])),
|
|
361
|
+
setBySource: this.getDynamicSource?.(),
|
|
362
|
+
},
|
|
363
|
+
]));
|
|
364
|
+
}
|
|
365
|
+
set(key1, key2, value, source) {
|
|
366
|
+
const existingOuterValue = this._value.get(key1);
|
|
367
|
+
const sourceToUse = source ?? this.getDynamicSource?.() ?? 'unknown';
|
|
368
|
+
// If the outer key doesn't exist yet, create a new map for it
|
|
369
|
+
if (!existingOuterValue) {
|
|
370
|
+
const newInnerMap = new Map();
|
|
371
|
+
newInnerMap.set(key2, { value, setBySource: sourceToUse });
|
|
372
|
+
this._value.set(key1, {
|
|
373
|
+
value: newInnerMap,
|
|
374
|
+
setBySource: sourceToUse,
|
|
375
|
+
});
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
// Check if this specific key1+key2 combination has already been set
|
|
379
|
+
const existingInnerValue = existingOuterValue.value.get(key2);
|
|
380
|
+
if (existingInnerValue?.setBySource) {
|
|
381
|
+
throw new Error(`Value for keys ${key1}+${key2} has already been set by ${existingInnerValue.setBySource} and cannot be overwritten by ${sourceToUse}`);
|
|
382
|
+
}
|
|
383
|
+
// Add the new value to the existing inner map
|
|
384
|
+
existingOuterValue.value.set(key2, {
|
|
385
|
+
value,
|
|
386
|
+
setBySource: sourceToUse,
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
merge(key1, value, source) {
|
|
390
|
+
const mergeSource = source ?? this.getDynamicSource?.() ?? 'unknown';
|
|
391
|
+
for (const [key2, val] of value.entries()) {
|
|
392
|
+
this.set(key1, key2, val, mergeSource);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
mergeObj(key1, value, source) {
|
|
396
|
+
const mergeSource = source ?? this.getDynamicSource?.() ?? 'unknown';
|
|
397
|
+
for (const [key2, val] of Object.entries(value)) {
|
|
398
|
+
this.set(key1, key2, val, mergeSource);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
getValue() {
|
|
402
|
+
return new Map([...this._value.entries()].map(([key1, outerValue]) => [
|
|
403
|
+
key1,
|
|
404
|
+
new Map([...outerValue.value.entries()].map(([key2, innerValue]) => [
|
|
405
|
+
key2,
|
|
406
|
+
innerValue.value,
|
|
407
|
+
])),
|
|
408
|
+
]));
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
// Schema builder class
|
|
412
|
+
class FieldMapSchemaBuilder {
|
|
413
|
+
options;
|
|
414
|
+
constructor(options) {
|
|
415
|
+
this.options = options;
|
|
416
|
+
}
|
|
417
|
+
scalar(defaultValue) {
|
|
418
|
+
return new ScalarContainer(defaultValue, this.options);
|
|
419
|
+
}
|
|
420
|
+
string(defaultValue) {
|
|
421
|
+
return new ScalarContainer(defaultValue, this.options);
|
|
422
|
+
}
|
|
423
|
+
number(defaultValue) {
|
|
424
|
+
return new ScalarContainer(defaultValue, this.options);
|
|
425
|
+
}
|
|
426
|
+
boolean(defaultValue) {
|
|
427
|
+
return new ScalarContainer(defaultValue, this.options);
|
|
428
|
+
}
|
|
429
|
+
array(initialValue, options) {
|
|
430
|
+
return new ArrayContainer(initialValue, options);
|
|
431
|
+
}
|
|
432
|
+
object(defaultValue) {
|
|
433
|
+
return new ObjectContainer(defaultValue, this.options);
|
|
434
|
+
}
|
|
435
|
+
map(initialValue) {
|
|
436
|
+
return new MapContainer(initialValue ?? new Map(), this.options);
|
|
437
|
+
}
|
|
438
|
+
mapFromObj(initialValue) {
|
|
439
|
+
return new MapContainer(new Map(Object.entries(initialValue ?? {})), this.options);
|
|
440
|
+
}
|
|
441
|
+
namedArray(initialValue) {
|
|
442
|
+
return new NamedArrayFieldContainer(initialValue, this.options);
|
|
443
|
+
}
|
|
444
|
+
mapOfMaps(initialValue) {
|
|
445
|
+
return new MapOfMapsContainer(initialValue ?? new Map(), this.options);
|
|
446
|
+
}
|
|
447
|
+
mapOfMapsFromObj(initialValue) {
|
|
448
|
+
const map = new Map();
|
|
449
|
+
if (initialValue) {
|
|
450
|
+
for (const [key1, innerObj] of Object.entries(initialValue)) {
|
|
451
|
+
map.set(key1, new Map(Object.entries(innerObj)));
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
return new MapOfMapsContainer(map, this.options);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
function createFieldMapSchemaBuilder(schemaBuilder) {
|
|
458
|
+
return schemaBuilder;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Creates a field map with type-safe field definitions
|
|
462
|
+
*/
|
|
463
|
+
function createFieldMap(schemaBuilder, options) {
|
|
464
|
+
const schema = schemaBuilder(new FieldMapSchemaBuilder(options));
|
|
465
|
+
// Add getValues method
|
|
466
|
+
return {
|
|
467
|
+
...schema,
|
|
468
|
+
getValues: () => {
|
|
469
|
+
const values = {};
|
|
470
|
+
for (const key of Object.keys(schema)) {
|
|
471
|
+
const container = schema[key];
|
|
472
|
+
values[key] = container.getValue();
|
|
473
|
+
}
|
|
474
|
+
return values;
|
|
475
|
+
},
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Recursively deep clones JSON-compatible values.
|
|
481
|
+
* Throws if the value is not JSON-serializable.
|
|
482
|
+
*
|
|
483
|
+
* @param value - The value to clone
|
|
484
|
+
* @returns A deep-cloned copy of the value
|
|
485
|
+
* @throws Error if a non-JSON value is encountered
|
|
486
|
+
*/
|
|
487
|
+
function jsonDeepClone(value) {
|
|
488
|
+
if (value === undefined ||
|
|
489
|
+
value === null ||
|
|
490
|
+
typeof value === 'boolean' ||
|
|
491
|
+
typeof value === 'string') {
|
|
492
|
+
return value;
|
|
493
|
+
}
|
|
494
|
+
if (typeof value === 'number') {
|
|
495
|
+
return value;
|
|
496
|
+
}
|
|
497
|
+
if (typeof value === 'object') {
|
|
498
|
+
if (value instanceof Date || value instanceof RegExp) {
|
|
499
|
+
throw new TypeError(`Cannot clone value of unsupported type: ${value.constructor.name}`);
|
|
500
|
+
}
|
|
501
|
+
if (Array.isArray(value)) {
|
|
502
|
+
// Clone array elements
|
|
503
|
+
const copy = [];
|
|
504
|
+
for (const [i, element] of value.entries()) {
|
|
505
|
+
copy[i] = jsonDeepClone(element);
|
|
506
|
+
}
|
|
507
|
+
return copy;
|
|
508
|
+
}
|
|
509
|
+
// Clone plain object properties
|
|
510
|
+
const copy = {};
|
|
511
|
+
for (const key in value) {
|
|
512
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
513
|
+
const prop = value[key];
|
|
514
|
+
copy[key] = jsonDeepClone(prop);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
return copy;
|
|
518
|
+
}
|
|
519
|
+
// Reject functions, symbols, BigInt, etc.
|
|
520
|
+
throw new Error(`Cannot clone value of unsupported type: ${typeof value}`);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
// adapted from https://github.com/AitoDotAI/json-stringify-pretty-compact
|
|
524
|
+
// allows { } to be presented as {} to better mirror prettier formatting
|
|
525
|
+
function isObject(obj) {
|
|
526
|
+
return typeof obj === 'object' && obj !== null;
|
|
527
|
+
}
|
|
528
|
+
function forEach(obj, cb) {
|
|
529
|
+
if (Array.isArray(obj)) {
|
|
530
|
+
// eslint-disable-next-line unicorn/no-array-for-each
|
|
531
|
+
obj.forEach(cb);
|
|
532
|
+
}
|
|
533
|
+
else if (isObject(obj)) {
|
|
534
|
+
for (const key of Object.keys(obj)) {
|
|
535
|
+
const val = obj[key];
|
|
536
|
+
cb(val, key);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
function getTreeDepth(obj) {
|
|
541
|
+
let depth = 0;
|
|
542
|
+
if (Array.isArray(obj) || isObject(obj)) {
|
|
543
|
+
forEach(obj, (val) => {
|
|
544
|
+
if (Array.isArray(val) || isObject(val)) {
|
|
545
|
+
const tmpDepth = getTreeDepth(val);
|
|
546
|
+
if (tmpDepth > depth) {
|
|
547
|
+
depth = tmpDepth;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
});
|
|
551
|
+
return depth + 1;
|
|
552
|
+
}
|
|
553
|
+
return depth;
|
|
554
|
+
}
|
|
555
|
+
function get(options, name, defaultValue) {
|
|
556
|
+
return (name in options ? options[name] : defaultValue);
|
|
557
|
+
}
|
|
558
|
+
// Note: This regex matches even invalid JSON strings, but since we’re
|
|
559
|
+
// working on the output of `JSON.stringify` we know that only valid strings
|
|
560
|
+
// are present (unless the user supplied a weird `options.indent` but in
|
|
561
|
+
// that case we don’t care since the output would be invalid anyway).
|
|
562
|
+
// This regex has been adjusted to allow replacement of { } and [ ] with {} and []
|
|
563
|
+
// to better mirror prettier formatting.
|
|
564
|
+
const stringOrChar = /("(?:[^\\"]|\\.)*")|[:,]|\{(?!})|(?<!\{)}|\[(?!])|(?<!\[)]/g;
|
|
565
|
+
function prettify(str, options = {}) {
|
|
566
|
+
const tokens = {
|
|
567
|
+
'{': '{',
|
|
568
|
+
'}': '}',
|
|
569
|
+
'[': '[',
|
|
570
|
+
']': ']',
|
|
571
|
+
',': ', ',
|
|
572
|
+
':': ': ',
|
|
573
|
+
};
|
|
574
|
+
if (!!options.addMargin || !!options.addObjectMargin) {
|
|
575
|
+
tokens['{'] = '{ ';
|
|
576
|
+
tokens['}'] = ' }';
|
|
577
|
+
}
|
|
578
|
+
if (!!options.addMargin || !!options.addArrayMargin) {
|
|
579
|
+
tokens['['] = '[ ';
|
|
580
|
+
tokens[']'] = ' ]';
|
|
581
|
+
}
|
|
582
|
+
return str.replaceAll(stringOrChar, (match, string) => string ? match : tokens[match]);
|
|
583
|
+
}
|
|
584
|
+
function stringifyPrettyCompact(rootObj, options = {}) {
|
|
585
|
+
const indent = JSON.stringify([1], null, get(options, 'indent', 2)).slice(2, -3);
|
|
586
|
+
const addMargin = get(options, 'margins', false);
|
|
587
|
+
const addArrayMargin = get(options, 'arrayMargins', false);
|
|
588
|
+
const addObjectMargin = get(options, 'objectMargins', true);
|
|
589
|
+
const maxLength = indent === '' ? Infinity : get(options, 'maxLength', 80);
|
|
590
|
+
const maxNesting = get(options, 'maxNesting', Infinity);
|
|
591
|
+
return (function stringifyRecursive(obj, currentIndent, reserved) {
|
|
592
|
+
if (obj &&
|
|
593
|
+
typeof obj === 'object' &&
|
|
594
|
+
typeof obj.toJSON === 'function') {
|
|
595
|
+
// eslint-disable-next-line @typescript-eslint/no-confusing-void-expression
|
|
596
|
+
obj = obj.toJSON();
|
|
597
|
+
}
|
|
598
|
+
const string = JSON.stringify(obj);
|
|
599
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
600
|
+
if (string === undefined) {
|
|
601
|
+
return string;
|
|
602
|
+
}
|
|
603
|
+
const length = maxLength - currentIndent.length - reserved;
|
|
604
|
+
const treeDepth = getTreeDepth(obj);
|
|
605
|
+
if (treeDepth <= maxNesting && string.length <= length) {
|
|
606
|
+
const prettified = prettify(string, {
|
|
607
|
+
addMargin,
|
|
608
|
+
addArrayMargin,
|
|
609
|
+
addObjectMargin,
|
|
610
|
+
});
|
|
611
|
+
if (prettified.length <= length) {
|
|
612
|
+
return prettified;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
if (isObject(obj)) {
|
|
616
|
+
const nextIndent = currentIndent + indent;
|
|
617
|
+
const items = [];
|
|
618
|
+
let delimiters;
|
|
619
|
+
const atEndOfArray = (array, index) => index === array.length - 1 ? 0 : 1;
|
|
620
|
+
if (Array.isArray(obj)) {
|
|
621
|
+
for (let index = 0; index < obj.length; index += 1) {
|
|
622
|
+
items.push(stringifyRecursive(obj[index], nextIndent, atEndOfArray(obj, index)) || 'null');
|
|
623
|
+
}
|
|
624
|
+
delimiters = '[]';
|
|
625
|
+
}
|
|
626
|
+
else {
|
|
627
|
+
// eslint-disable-next-line unicorn/no-array-for-each
|
|
628
|
+
Object.keys(obj).forEach((key, index, array) => {
|
|
629
|
+
const keyPart = `${JSON.stringify(key)}: `;
|
|
630
|
+
const value = stringifyRecursive(obj[key], nextIndent, keyPart.length + atEndOfArray(array, index));
|
|
631
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
632
|
+
if (value !== undefined) {
|
|
633
|
+
items.push(keyPart + value);
|
|
634
|
+
}
|
|
635
|
+
});
|
|
636
|
+
delimiters = '{}';
|
|
637
|
+
}
|
|
638
|
+
if (items.length > 0) {
|
|
639
|
+
return [
|
|
640
|
+
delimiters[0],
|
|
641
|
+
indent + items.join(`,\n${nextIndent}`),
|
|
642
|
+
delimiters[1],
|
|
643
|
+
].join(`\n${currentIndent}`);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
return string;
|
|
647
|
+
})(rootObj, '', 0);
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
function isPlainObject(value) {
|
|
651
|
+
if (typeof value !== 'object' || value === null) {
|
|
652
|
+
return false;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
const prototype = Object.getPrototypeOf(value);
|
|
656
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
function sortKeys(object, options = {}) {
|
|
660
|
+
if (!isPlainObject(object) && !Array.isArray(object)) {
|
|
661
|
+
throw new TypeError('Expected a plain object or array');
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
const {deep, compare} = options;
|
|
665
|
+
const cache = new WeakMap();
|
|
666
|
+
|
|
667
|
+
const deepSortArray = array => {
|
|
668
|
+
const resultFromCache = cache.get(array);
|
|
669
|
+
if (resultFromCache !== undefined) {
|
|
670
|
+
return resultFromCache;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
const result = [];
|
|
674
|
+
cache.set(array, result);
|
|
675
|
+
|
|
676
|
+
result.push(...array.map(item => {
|
|
677
|
+
if (Array.isArray(item)) {
|
|
678
|
+
return deepSortArray(item);
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
if (isPlainObject(item)) {
|
|
682
|
+
return _sortKeys(item);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
return item;
|
|
686
|
+
}));
|
|
687
|
+
|
|
688
|
+
return result;
|
|
689
|
+
};
|
|
690
|
+
|
|
691
|
+
const _sortKeys = object => {
|
|
692
|
+
const resultFromCache = cache.get(object);
|
|
693
|
+
if (resultFromCache !== undefined) {
|
|
694
|
+
return resultFromCache;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
const result = {};
|
|
698
|
+
const keys = Object.keys(object).sort(compare);
|
|
699
|
+
|
|
700
|
+
cache.set(object, result);
|
|
701
|
+
|
|
702
|
+
for (const key of keys) {
|
|
703
|
+
const value = object[key];
|
|
704
|
+
let newValue;
|
|
705
|
+
|
|
706
|
+
if (deep && Array.isArray(value)) {
|
|
707
|
+
newValue = deepSortArray(value);
|
|
708
|
+
} else {
|
|
709
|
+
newValue = deep && isPlainObject(value) ? _sortKeys(value) : value;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
Object.defineProperty(result, key, {
|
|
713
|
+
...Object.getOwnPropertyDescriptor(object, key),
|
|
714
|
+
value: newValue,
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
return result;
|
|
719
|
+
};
|
|
720
|
+
|
|
721
|
+
if (Array.isArray(object)) {
|
|
722
|
+
return deep ? deepSortArray(object) : [...object];
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
return _sortKeys(object);
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Stringifies a value with stable pretty printing.
|
|
730
|
+
*
|
|
731
|
+
* That means the keys are sorted and the value is pretty printed.
|
|
732
|
+
*
|
|
733
|
+
* @param value - The value to stringify.
|
|
734
|
+
* @returns The stringified value.
|
|
735
|
+
*/
|
|
736
|
+
function stringifyPrettyStable(value) {
|
|
737
|
+
const sortedValue = sortKeys(value, {
|
|
738
|
+
deep: true,
|
|
739
|
+
});
|
|
740
|
+
return `${stringifyPrettyCompact(sortedValue)}\n`;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Groups values of an iterable using a key-generating function and returns a Map.
|
|
745
|
+
*
|
|
746
|
+
* Mimics the behavior of ES2025 `Map.groupBy`.
|
|
747
|
+
*
|
|
748
|
+
* @template T The type of elements in the iterable.
|
|
749
|
+
* @template K The key type returned by the key function.
|
|
750
|
+
* @param iterable The iterable to group.
|
|
751
|
+
* @param keyFn A function that returns a grouping key for each element.
|
|
752
|
+
* @returns A Map where each key maps to an array of elements with that key.
|
|
753
|
+
*/
|
|
754
|
+
function mapGroupBy(iterable, keyFn) {
|
|
755
|
+
const result = new Map();
|
|
756
|
+
for (const item of iterable) {
|
|
757
|
+
const key = keyFn(item);
|
|
758
|
+
const group = result.get(key);
|
|
759
|
+
if (group) {
|
|
760
|
+
group.push(item);
|
|
761
|
+
}
|
|
762
|
+
else {
|
|
763
|
+
result.set(key, [item]);
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
return result;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
/**
|
|
770
|
+
* Creates a Map from an iterable, using a key-generating function.
|
|
771
|
+
* If multiple elements generate the same key, later elements override earlier ones.
|
|
772
|
+
*
|
|
773
|
+
* Analogous to lodash's keyBy function, but returns a Map instead of an object.
|
|
774
|
+
*
|
|
775
|
+
* @template T The type of elements in the iterable.
|
|
776
|
+
* @template K The key type returned by the key function.
|
|
777
|
+
* @param iterable The iterable to transform.
|
|
778
|
+
* @param keyFn A function that returns a unique key for each element.
|
|
779
|
+
* @returns A Map where each key maps to a single element.
|
|
780
|
+
*/
|
|
781
|
+
function mapKeyBy(iterable, keyFn) {
|
|
782
|
+
const result = new Map();
|
|
783
|
+
for (const item of iterable) {
|
|
784
|
+
const key = keyFn(item);
|
|
785
|
+
result.set(key, item);
|
|
786
|
+
}
|
|
787
|
+
return result;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Maps the values of a Map to a new Map with the same keys.
|
|
792
|
+
*
|
|
793
|
+
* @template K - Type of keys in the map.
|
|
794
|
+
* @template V - Original value type.
|
|
795
|
+
* @template R - Resulting value type.
|
|
796
|
+
* @param map - The input Map to transform.
|
|
797
|
+
* @param fn - A function to transform each value, receiving the value, key, and original map.
|
|
798
|
+
* @returns A new Map with the same keys and transformed values.
|
|
799
|
+
*/
|
|
800
|
+
function mapValuesOfMap(map, fn) {
|
|
801
|
+
const result = new Map();
|
|
802
|
+
for (const [key, value] of map.entries()) {
|
|
803
|
+
result.set(key, fn(value, key, map));
|
|
804
|
+
}
|
|
805
|
+
return result;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
/**
|
|
809
|
+
* Merges an array of maps, throwing an error if any keys overlap (unless the values are deeply equal and allowed).
|
|
810
|
+
*
|
|
811
|
+
* @param maps - The array of maps to merge.
|
|
812
|
+
* @param options - Options to control merge behavior.
|
|
813
|
+
* @returns The merged map.
|
|
814
|
+
*/
|
|
815
|
+
function safeMergeMapsWithOptions(maps, options = {}) {
|
|
816
|
+
const result = new Map();
|
|
817
|
+
for (const map of maps) {
|
|
818
|
+
for (const [key, value] of map) {
|
|
819
|
+
if (result.has(key)) {
|
|
820
|
+
const existing = result.get(key);
|
|
821
|
+
if (!options.allowEqualValues || !isEqual(existing, value)) {
|
|
822
|
+
throw new Error(`Cannot merge key ${String(key)} because it already exists.`);
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
result.set(key, value);
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
return result;
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Merges two maps, throwing an error if any keys overlap.
|
|
832
|
+
*
|
|
833
|
+
* @param mapOne - The first map to merge.
|
|
834
|
+
* @param mapTwo - The second map to merge.
|
|
835
|
+
* @param options - Options to control merge behavior
|
|
836
|
+
* @returns The merged map.
|
|
837
|
+
*/
|
|
838
|
+
function safeMergeMap(mapOne, mapTwo, options = {}) {
|
|
839
|
+
return safeMergeMapsWithOptions([mapOne, mapTwo], options);
|
|
840
|
+
}
|
|
841
|
+
/**
|
|
842
|
+
* Merges an array of maps, throwing an error if any keys overlap (unless the values are deeply equal and allowed).
|
|
843
|
+
* This function delegates to safeMergeMapsWithOptions.
|
|
844
|
+
*
|
|
845
|
+
* @param maps - The array of maps to merge.
|
|
846
|
+
* @returns The merged map.
|
|
847
|
+
*/
|
|
848
|
+
function safeMergeMaps(...maps) {
|
|
849
|
+
return safeMergeMapsWithOptions(maps);
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* Merges two objects, throwing an error if any keys overlap.
|
|
854
|
+
*
|
|
855
|
+
* @param itemOne - The first object to merge.
|
|
856
|
+
* @param itemTwo - The second object to merge.
|
|
857
|
+
* @param options - Options to control merge behavior
|
|
858
|
+
* @returns The merged object.
|
|
859
|
+
*/
|
|
860
|
+
function safeMerge(itemOne, itemTwo, options = {}) {
|
|
861
|
+
return mergeWith(itemOne, itemTwo, (targetValue, sourceValue, key) => {
|
|
862
|
+
if (key in itemOne && key in itemTwo) {
|
|
863
|
+
if (options.allowEqualValues && isEqual(targetValue, sourceValue)) {
|
|
864
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return -- we're just using the sourceValue
|
|
865
|
+
return sourceValue;
|
|
866
|
+
}
|
|
867
|
+
throw new Error(`Cannot merge key ${key} because it already exists.`);
|
|
868
|
+
}
|
|
869
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return -- we're just using the sourceValue
|
|
870
|
+
return sourceValue;
|
|
871
|
+
});
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Merges an array of objects, throwing an error if any keys overlap.
|
|
875
|
+
*
|
|
876
|
+
* @param items - The array of objects to merge.
|
|
877
|
+
* @param options - Options to control merge behavior
|
|
878
|
+
* @returns The merged object.
|
|
879
|
+
*/
|
|
880
|
+
function safeMergeAllWithOptions(items, options = {}) {
|
|
881
|
+
const targetValue = {};
|
|
882
|
+
for (const item of items.flat()) {
|
|
883
|
+
safeMerge(targetValue, item, options);
|
|
884
|
+
}
|
|
885
|
+
return targetValue;
|
|
886
|
+
}
|
|
887
|
+
/**
|
|
888
|
+
* Merges an array of objects, throwing an error if any keys overlap.
|
|
889
|
+
*
|
|
890
|
+
* @param items - The array of objects to merge.
|
|
891
|
+
* @returns The merged object.
|
|
892
|
+
*/
|
|
893
|
+
function safeMergeAll(...items) {
|
|
894
|
+
return safeMergeAllWithOptions(items);
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* Recursively sorts all keys in an object, including nested objects and arrays.
|
|
899
|
+
*
|
|
900
|
+
* @param obj - The object to sort recursively.
|
|
901
|
+
* @returns A new object with all keys sorted recursively.
|
|
902
|
+
*/
|
|
903
|
+
function sortKeysRecursive(obj) {
|
|
904
|
+
if (obj === null || typeof obj !== 'object') {
|
|
905
|
+
return obj;
|
|
906
|
+
}
|
|
907
|
+
if (Array.isArray(obj)) {
|
|
908
|
+
return obj.map(sortKeysRecursive);
|
|
909
|
+
}
|
|
910
|
+
return Object.fromEntries(Object.entries(obj)
|
|
911
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
912
|
+
.map(([key, value]) => [key, sortKeysRecursive(value)]));
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
/**
|
|
916
|
+
* Sorts the keys of an object.
|
|
917
|
+
*
|
|
918
|
+
* @param obj - The object to sort.
|
|
919
|
+
* @returns The sorted object.
|
|
920
|
+
*/
|
|
921
|
+
function sortObjectKeys(obj) {
|
|
922
|
+
return Object.fromEntries(Object.entries(obj).sort(([a], [b]) => a.localeCompare(b)));
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* Returns a new Set containing values in `setA` that are not in `setB`.
|
|
927
|
+
*
|
|
928
|
+
* @param setA - The original set
|
|
929
|
+
* @param setB - The set of values to exclude
|
|
930
|
+
* @returns A new Set with the difference
|
|
931
|
+
*/
|
|
932
|
+
function differenceSet(setA, setB) {
|
|
933
|
+
const result = new Set();
|
|
934
|
+
for (const value of setA) {
|
|
935
|
+
if (!setB.has(value)) {
|
|
936
|
+
result.add(value);
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
return result;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* Converts a string to the specified case while preserving non-alphanumeric prefixes and suffixes.
|
|
944
|
+
*
|
|
945
|
+
* @param input - The string to convert
|
|
946
|
+
* @param caseConverter - The case conversion function to apply
|
|
947
|
+
* @returns The converted string with preserved prefix and suffix
|
|
948
|
+
*
|
|
949
|
+
* @example
|
|
950
|
+
* ```typescript
|
|
951
|
+
* convertCaseWithPrefix('_layoutTest', kebabCase)
|
|
952
|
+
* // Returns: '_layout-test'
|
|
953
|
+
*
|
|
954
|
+
* convertCaseWithPrefix('__privateHelper', kebabCase)
|
|
955
|
+
* // Returns: '__private-helper'
|
|
956
|
+
*
|
|
957
|
+
* convertCaseWithPrefix('[id]', kebabCase)
|
|
958
|
+
* // Returns: '[id]'
|
|
959
|
+
* ```
|
|
960
|
+
*/
|
|
961
|
+
function convertCaseWithPrefix(input, caseConverter) {
|
|
962
|
+
// Handle special pattern where the entire string is non-alphanumeric (like "[id]")
|
|
963
|
+
if (!/[a-zA-Z0-9]/.test(input)) {
|
|
964
|
+
return input;
|
|
965
|
+
}
|
|
966
|
+
// Extract non-alphanumeric prefix
|
|
967
|
+
const prefixMatch = /^([^a-zA-Z0-9]*)/.exec(input);
|
|
968
|
+
const prefix = prefixMatch?.[1] ?? '';
|
|
969
|
+
// Extract non-alphanumeric suffix
|
|
970
|
+
const suffixMatch = /([^a-zA-Z0-9]*)$/.exec(input);
|
|
971
|
+
const suffix = suffixMatch?.[1] ?? '';
|
|
972
|
+
// Get the middle part (everything between prefix and suffix)
|
|
973
|
+
const startIndex = prefix.length;
|
|
974
|
+
const endIndex = input.length - suffix.length;
|
|
975
|
+
const middlePart = input.slice(startIndex, endIndex);
|
|
976
|
+
// Only apply case conversion to the middle part if it contains alphanumeric characters
|
|
977
|
+
const convertedMiddlePart = middlePart && /[a-zA-Z0-9]/.test(middlePart)
|
|
978
|
+
? caseConverter(middlePart)
|
|
979
|
+
: middlePart;
|
|
980
|
+
return prefix + convertedMiddlePart + suffix;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
/**
|
|
984
|
+
* Quotes a string with single quotes and escapes single quotes.
|
|
985
|
+
* @param value - The string to quote.
|
|
986
|
+
* @returns The quoted string.
|
|
987
|
+
*/
|
|
988
|
+
function quot(value) {
|
|
989
|
+
return `'${value.replaceAll("'", String.raw `\'`)}'`;
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* Quotes a string with double quotes and escapes double quotes.
|
|
993
|
+
* @param value - The string to quote.
|
|
994
|
+
* @returns The quoted string.
|
|
995
|
+
*/
|
|
996
|
+
function doubleQuot(value) {
|
|
997
|
+
return `"${value.replaceAll('"', String.raw `\"`)}"`;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
let random = bytes => crypto.getRandomValues(new Uint8Array(bytes));
|
|
1001
|
+
let customRandom = (alphabet, defaultSize, getRandom) => {
|
|
1002
|
+
let mask = (2 << Math.log2(alphabet.length - 1)) - 1;
|
|
1003
|
+
let step = -~((1.6 * mask * defaultSize) / alphabet.length);
|
|
1004
|
+
return (size = defaultSize) => {
|
|
1005
|
+
let id = '';
|
|
1006
|
+
while (true) {
|
|
1007
|
+
let bytes = getRandom(step);
|
|
1008
|
+
let j = step | 0;
|
|
1009
|
+
while (j--) {
|
|
1010
|
+
id += alphabet[bytes[j] & mask] || '';
|
|
1011
|
+
if (id.length >= size) return id
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
};
|
|
1016
|
+
let customAlphabet = (alphabet, size = 21) =>
|
|
1017
|
+
customRandom(alphabet, size | 0, random);
|
|
1018
|
+
|
|
1019
|
+
const NUMBERS = '0123456789';
|
|
1020
|
+
const LOWERCASE = 'abcdefghijklmnopqrstuvwxyz';
|
|
1021
|
+
const UPPERCASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
1022
|
+
/**
|
|
1023
|
+
* Use custom ID generator for characters that be easily selected
|
|
1024
|
+
*/
|
|
1025
|
+
const customNanoid = customAlphabet(`${NUMBERS}${LOWERCASE}${UPPERCASE}_`, 12);
|
|
1026
|
+
/**
|
|
1027
|
+
* Generate a random key string made up of numbers, lowercase, and uppercase letters
|
|
1028
|
+
* @returns A random key string
|
|
1029
|
+
*/
|
|
1030
|
+
function randomKey(length = 12) {
|
|
1031
|
+
return customNanoid(length);
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
class ToposortCyclicalDependencyError extends Error {
|
|
1035
|
+
cyclePath;
|
|
1036
|
+
constructor(nodes) {
|
|
1037
|
+
super(`Cyclical dependency detected: ${nodes.map((n) => JSON.stringify(n)).join(' -> ')}`);
|
|
1038
|
+
this.name = 'ToposortCyclicalDependencyError';
|
|
1039
|
+
this.cyclePath = nodes; // Store the path for potential inspection
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
class ToposortUnknownNodeError extends Error {
|
|
1043
|
+
unknownNode;
|
|
1044
|
+
constructor(node) {
|
|
1045
|
+
super(`Unknown node referenced in edges: ${JSON.stringify(node)}`);
|
|
1046
|
+
this.name = 'ToposortUnknownNodeError';
|
|
1047
|
+
this.unknownNode = node; // Store the node for potential inspection
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
/**
|
|
1052
|
+
* Creates a map of inbound edges from node indices to their source indices
|
|
1053
|
+
*/
|
|
1054
|
+
function makeInboundEdges(nodes, edgeArr) {
|
|
1055
|
+
const inboundEdgesMap = new Map();
|
|
1056
|
+
for (const edge of edgeArr) {
|
|
1057
|
+
const [source, target] = edge;
|
|
1058
|
+
const sourceIndex = nodes.get(source);
|
|
1059
|
+
const targetIndex = nodes.get(target);
|
|
1060
|
+
// Check both source and target exist in the provided nodes set
|
|
1061
|
+
if (sourceIndex === undefined)
|
|
1062
|
+
throw new ToposortUnknownNodeError(source);
|
|
1063
|
+
if (targetIndex === undefined)
|
|
1064
|
+
throw new ToposortUnknownNodeError(target);
|
|
1065
|
+
const targetEdges = inboundEdgesMap.get(targetIndex);
|
|
1066
|
+
if (targetEdges) {
|
|
1067
|
+
targetEdges.add(sourceIndex);
|
|
1068
|
+
}
|
|
1069
|
+
else {
|
|
1070
|
+
inboundEdgesMap.set(targetIndex, new Set([sourceIndex]));
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
return inboundEdgesMap;
|
|
1074
|
+
}
|
|
1075
|
+
/**
|
|
1076
|
+
* Creates a map of node indices to their out-degree
|
|
1077
|
+
*/
|
|
1078
|
+
function makeNodeOutDegrees(inboundEdgesMap, nodeLength) {
|
|
1079
|
+
const nodeOutDegrees = Array.from({ length: nodeLength }, () => 0);
|
|
1080
|
+
for (const [, sources] of inboundEdgesMap.entries()) {
|
|
1081
|
+
for (const source of sources) {
|
|
1082
|
+
nodeOutDegrees[source]++;
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
return nodeOutDegrees;
|
|
1086
|
+
}
|
|
1087
|
+
/**
|
|
1088
|
+
* Detects a cycle in a graph and returns the path of the first cycle found.
|
|
1089
|
+
*/
|
|
1090
|
+
function detectCycle$1(nodes,
|
|
1091
|
+
// Set of nodes already processed by a prior algorithm (e.g., a topological sort).
|
|
1092
|
+
// This function will only search for cycles among the remaining nodes.
|
|
1093
|
+
initialVisited, edges) {
|
|
1094
|
+
// Tracks nodes visited by ANY DFS traversal within this function.
|
|
1095
|
+
const cycleCheckVisited = new Set();
|
|
1096
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
1097
|
+
if (!initialVisited.has(i) && !cycleCheckVisited.has(i)) {
|
|
1098
|
+
const path = [];
|
|
1099
|
+
const recursionStack = new Set();
|
|
1100
|
+
const cyclePath = dfs(i, path, recursionStack);
|
|
1101
|
+
if (cyclePath) {
|
|
1102
|
+
// A cycle was found, convert indices to nodes and return immediately.
|
|
1103
|
+
return cyclePath.map((idx) => nodes[idx]);
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
// No cycles were found in any of the graph's components.
|
|
1108
|
+
return [];
|
|
1109
|
+
/**
|
|
1110
|
+
* Performs a DFS from a starting node to find a cycle.
|
|
1111
|
+
* @returns The cycle path as an array of indices if found, otherwise null.
|
|
1112
|
+
*/
|
|
1113
|
+
function dfs(node, path, recursionStack) {
|
|
1114
|
+
path.push(node);
|
|
1115
|
+
recursionStack.add(node);
|
|
1116
|
+
cycleCheckVisited.add(node);
|
|
1117
|
+
const neighbors = edges.get(node) ?? new Set();
|
|
1118
|
+
for (const neighbor of neighbors) {
|
|
1119
|
+
if (recursionStack.has(neighbor)) {
|
|
1120
|
+
const cycleStartIndex = path.indexOf(neighbor);
|
|
1121
|
+
const cycle = path.slice(cycleStartIndex);
|
|
1122
|
+
cycle.push(neighbor);
|
|
1123
|
+
return cycle;
|
|
1124
|
+
}
|
|
1125
|
+
// If the neighbor hasn't been visited by any DFS run yet, recurse.
|
|
1126
|
+
if (!cycleCheckVisited.has(neighbor)) {
|
|
1127
|
+
const result = dfs(neighbor, path, recursionStack);
|
|
1128
|
+
if (result) {
|
|
1129
|
+
// A cycle was found deeper in the traversal; propagate the result up.
|
|
1130
|
+
return result;
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
// Backtrack: No cycle found from this node.
|
|
1135
|
+
recursionStack.delete(node);
|
|
1136
|
+
path.pop();
|
|
1137
|
+
return null;
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
/**
|
|
1141
|
+
* Default comparison function for stable topological sort
|
|
1142
|
+
*/
|
|
1143
|
+
function defaultCompareFunc$1(a, b) {
|
|
1144
|
+
if (typeof a === 'string' && typeof b === 'string') {
|
|
1145
|
+
return a.localeCompare(b);
|
|
1146
|
+
}
|
|
1147
|
+
if (a === b)
|
|
1148
|
+
return 0;
|
|
1149
|
+
return a < b ? -1 : 1;
|
|
1150
|
+
}
|
|
1151
|
+
/**
|
|
1152
|
+
* Performs a locality-based topological sort on a directed acyclic graph.
|
|
1153
|
+
*
|
|
1154
|
+
* This is a variant of Kahn's algorithm that starts from nodes with no outbound edges first,
|
|
1155
|
+
* and then works its way back.
|
|
1156
|
+
*
|
|
1157
|
+
* This is useful for tasks where we want to process nodes in a way that is consistent with their locality in the graph
|
|
1158
|
+
* such as sorting fragments of a generated code file that depend on each other.
|
|
1159
|
+
*
|
|
1160
|
+
* @param nodes - The nodes to sort
|
|
1161
|
+
* @param edges - The edges of the graph
|
|
1162
|
+
* @param options - Optional options for the topological sort
|
|
1163
|
+
* @returns The sorted nodes
|
|
1164
|
+
*/
|
|
1165
|
+
function toposortLocal(nodes, edges, options = {}) {
|
|
1166
|
+
const { compareFunc = defaultCompareFunc$1 } = options;
|
|
1167
|
+
const compareIdx = (a, b) => compareFunc(nodes[a], nodes[b]);
|
|
1168
|
+
// Map each node to its index
|
|
1169
|
+
const nodeIndexMap = new Map(nodes.map((node, index) => [node, index]));
|
|
1170
|
+
// Create a map of outgoing edges from each node
|
|
1171
|
+
const inboundEdgesMap = makeInboundEdges(nodeIndexMap, edges);
|
|
1172
|
+
const nodeOutDegrees = makeNodeOutDegrees(inboundEdgesMap, nodes.length);
|
|
1173
|
+
// Create a stack of nodes with no incoming edges (in-degree == 0)
|
|
1174
|
+
// We use a stack so that the most recently added nodes are processed first
|
|
1175
|
+
const zeroOutDegreeStack = [];
|
|
1176
|
+
for (const [i, nodeOutDegree] of nodeOutDegrees.entries()) {
|
|
1177
|
+
if (nodeOutDegree === 0) {
|
|
1178
|
+
zeroOutDegreeStack.push(i);
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
zeroOutDegreeStack.sort(compareIdx);
|
|
1182
|
+
const reverseResult = [];
|
|
1183
|
+
const visited = new Set();
|
|
1184
|
+
// Process nodes in BFS order
|
|
1185
|
+
while (zeroOutDegreeStack.length > 0) {
|
|
1186
|
+
const current = zeroOutDegreeStack.pop();
|
|
1187
|
+
if (current === undefined)
|
|
1188
|
+
break;
|
|
1189
|
+
visited.add(current);
|
|
1190
|
+
reverseResult.push(nodes[current]);
|
|
1191
|
+
// Process all outgoing edges from the current node
|
|
1192
|
+
const incomingEdges = inboundEdgesMap.get(current);
|
|
1193
|
+
const newZeroOutDegreeNodes = [];
|
|
1194
|
+
if (incomingEdges) {
|
|
1195
|
+
for (const source of incomingEdges) {
|
|
1196
|
+
nodeOutDegrees[source]--;
|
|
1197
|
+
// If the target node now has no incoming edges, add it to the queue
|
|
1198
|
+
if (nodeOutDegrees[source] === 0) {
|
|
1199
|
+
newZeroOutDegreeNodes.push(source);
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
newZeroOutDegreeNodes.sort(compareIdx);
|
|
1204
|
+
zeroOutDegreeStack.push(...newZeroOutDegreeNodes);
|
|
1205
|
+
}
|
|
1206
|
+
// Check for cycles
|
|
1207
|
+
if (reverseResult.length !== nodes.length) {
|
|
1208
|
+
const cyclePath = detectCycle$1(nodes, visited, inboundEdgesMap);
|
|
1209
|
+
throw new ToposortCyclicalDependencyError(cyclePath.toReversed());
|
|
1210
|
+
}
|
|
1211
|
+
return reverseResult.toReversed();
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
class TinyQueue {
|
|
1215
|
+
constructor(data = [], compare = (a, b) => (a < b ? -1 : a > b ? 1 : 0)) {
|
|
1216
|
+
this.data = data;
|
|
1217
|
+
this.length = this.data.length;
|
|
1218
|
+
this.compare = compare;
|
|
1219
|
+
|
|
1220
|
+
if (this.length > 0) {
|
|
1221
|
+
for (let i = (this.length >> 1) - 1; i >= 0; i--) this._down(i);
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
push(item) {
|
|
1226
|
+
this.data.push(item);
|
|
1227
|
+
this._up(this.length++);
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
pop() {
|
|
1231
|
+
if (this.length === 0) return undefined;
|
|
1232
|
+
|
|
1233
|
+
const top = this.data[0];
|
|
1234
|
+
const bottom = this.data.pop();
|
|
1235
|
+
|
|
1236
|
+
if (--this.length > 0) {
|
|
1237
|
+
this.data[0] = bottom;
|
|
1238
|
+
this._down(0);
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
return top;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
peek() {
|
|
1245
|
+
return this.data[0];
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
_up(pos) {
|
|
1249
|
+
const {data, compare} = this;
|
|
1250
|
+
const item = data[pos];
|
|
1251
|
+
|
|
1252
|
+
while (pos > 0) {
|
|
1253
|
+
const parent = (pos - 1) >> 1;
|
|
1254
|
+
const current = data[parent];
|
|
1255
|
+
if (compare(item, current) >= 0) break;
|
|
1256
|
+
data[pos] = current;
|
|
1257
|
+
pos = parent;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
data[pos] = item;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
_down(pos) {
|
|
1264
|
+
const {data, compare} = this;
|
|
1265
|
+
const halfLength = this.length >> 1;
|
|
1266
|
+
const item = data[pos];
|
|
1267
|
+
|
|
1268
|
+
while (pos < halfLength) {
|
|
1269
|
+
let bestChild = (pos << 1) + 1; // initially it is the left child
|
|
1270
|
+
const right = bestChild + 1;
|
|
1271
|
+
|
|
1272
|
+
if (right < this.length && compare(data[right], data[bestChild]) < 0) {
|
|
1273
|
+
bestChild = right;
|
|
1274
|
+
}
|
|
1275
|
+
if (compare(data[bestChild], item) >= 0) break;
|
|
1276
|
+
|
|
1277
|
+
data[pos] = data[bestChild];
|
|
1278
|
+
pos = bestChild;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
data[pos] = item;
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
/**
|
|
1286
|
+
* Creates a map of outgoing edges from node indices to their target indices
|
|
1287
|
+
*/
|
|
1288
|
+
function makeOutgoingEdges(nodes, edgeArr) {
|
|
1289
|
+
const outgoingEdgesMap = new Map();
|
|
1290
|
+
for (const edge of edgeArr) {
|
|
1291
|
+
const [source, target] = edge;
|
|
1292
|
+
const sourceIndex = nodes.get(source);
|
|
1293
|
+
const targetIndex = nodes.get(target);
|
|
1294
|
+
// Check both source and target exist in the provided nodes set
|
|
1295
|
+
if (sourceIndex === undefined)
|
|
1296
|
+
throw new ToposortUnknownNodeError(source);
|
|
1297
|
+
if (targetIndex === undefined)
|
|
1298
|
+
throw new ToposortUnknownNodeError(target);
|
|
1299
|
+
const sourceEdges = outgoingEdgesMap.get(sourceIndex);
|
|
1300
|
+
if (sourceEdges) {
|
|
1301
|
+
sourceEdges.add(targetIndex);
|
|
1302
|
+
}
|
|
1303
|
+
else {
|
|
1304
|
+
outgoingEdgesMap.set(sourceIndex, new Set([targetIndex]));
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
return outgoingEdgesMap;
|
|
1308
|
+
}
|
|
1309
|
+
/**
|
|
1310
|
+
* Creates a map of node indices to their in-degree
|
|
1311
|
+
*/
|
|
1312
|
+
function makeNodeInDegrees(outgoingEdgesMap, nodeLength) {
|
|
1313
|
+
const nodeInDegrees = Array.from({ length: nodeLength }, () => 0);
|
|
1314
|
+
for (const [, targets] of outgoingEdgesMap.entries()) {
|
|
1315
|
+
for (const target of targets) {
|
|
1316
|
+
nodeInDegrees[target]++;
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
return nodeInDegrees;
|
|
1320
|
+
}
|
|
1321
|
+
/**
|
|
1322
|
+
* Detects cycles in a graph by checking if all nodes are included in the topological sort
|
|
1323
|
+
*/
|
|
1324
|
+
function detectCycle(nodes, visited, edges) {
|
|
1325
|
+
// If all nodes were visited, no cycle exists
|
|
1326
|
+
if (visited.size === nodes.length) {
|
|
1327
|
+
return [];
|
|
1328
|
+
}
|
|
1329
|
+
// Run DFS from any unvisited node to find a cycle
|
|
1330
|
+
const path = [];
|
|
1331
|
+
const visitSet = new Set();
|
|
1332
|
+
function dfs(node) {
|
|
1333
|
+
if (visitSet.has(node)) {
|
|
1334
|
+
path.push(node);
|
|
1335
|
+
return true;
|
|
1336
|
+
}
|
|
1337
|
+
if (visited.has(node)) {
|
|
1338
|
+
return false;
|
|
1339
|
+
}
|
|
1340
|
+
visitSet.add(node);
|
|
1341
|
+
path.push(node);
|
|
1342
|
+
const neighbors = edges.get(node) ?? new Set();
|
|
1343
|
+
for (const neighbor of neighbors) {
|
|
1344
|
+
if (dfs(neighbor)) {
|
|
1345
|
+
return true;
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
path.pop();
|
|
1349
|
+
visitSet.delete(node);
|
|
1350
|
+
return false;
|
|
1351
|
+
}
|
|
1352
|
+
// For cycle detection, we need to try all unvisited nodes
|
|
1353
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
1354
|
+
if (!visited.has(i)) {
|
|
1355
|
+
// Reset path and visitSet for each starting node
|
|
1356
|
+
path.length = 0;
|
|
1357
|
+
visitSet.clear();
|
|
1358
|
+
const cycleFound = dfs(i);
|
|
1359
|
+
if (cycleFound) {
|
|
1360
|
+
// Convert path indices to actual nodes
|
|
1361
|
+
return path.map((idx) => nodes[idx]);
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
return [];
|
|
1366
|
+
}
|
|
1367
|
+
/**
|
|
1368
|
+
* Default comparison function for stable topological sort
|
|
1369
|
+
*/
|
|
1370
|
+
function defaultCompareFunc(a, b) {
|
|
1371
|
+
if (typeof a === 'string' && typeof b === 'string') {
|
|
1372
|
+
return a.localeCompare(b);
|
|
1373
|
+
}
|
|
1374
|
+
if (a === b)
|
|
1375
|
+
return 0;
|
|
1376
|
+
return a < b ? -1 : 1;
|
|
1377
|
+
}
|
|
1378
|
+
/**
|
|
1379
|
+
* Performs a topological sort on a directed acyclic graph.
|
|
1380
|
+
*
|
|
1381
|
+
* @param nodes - The nodes to sort
|
|
1382
|
+
* @param edges - The edges of the graph
|
|
1383
|
+
* @param options - Optional options for the topological sort
|
|
1384
|
+
* @returns The sorted nodes
|
|
1385
|
+
*/
|
|
1386
|
+
function toposort(nodes, edges, options = {}) {
|
|
1387
|
+
const { compareFunc } = options;
|
|
1388
|
+
// Map each node to its index
|
|
1389
|
+
const nodeIndexMap = new Map(nodes.map((node, index) => [node, index]));
|
|
1390
|
+
// Create a map of outgoing edges from each node
|
|
1391
|
+
const outgoingEdgesMap = makeOutgoingEdges(nodeIndexMap, edges);
|
|
1392
|
+
const nodeInDegrees = makeNodeInDegrees(outgoingEdgesMap, nodes.length);
|
|
1393
|
+
// Create a queue of nodes with no incoming edges (in-degree == 0)
|
|
1394
|
+
const zeroInDegreeQueue = compareFunc
|
|
1395
|
+
? new TinyQueue([], (a, b) => compareFunc(nodes[a], nodes[b]))
|
|
1396
|
+
: [];
|
|
1397
|
+
for (const [i, nodeInDegree] of nodeInDegrees.entries()) {
|
|
1398
|
+
if (nodeInDegree === 0) {
|
|
1399
|
+
zeroInDegreeQueue.push(i);
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
const result = [];
|
|
1403
|
+
const visited = new Set();
|
|
1404
|
+
// Process nodes in BFS order
|
|
1405
|
+
while (zeroInDegreeQueue.length > 0) {
|
|
1406
|
+
const current = zeroInDegreeQueue.pop();
|
|
1407
|
+
if (current === undefined)
|
|
1408
|
+
break;
|
|
1409
|
+
visited.add(current);
|
|
1410
|
+
result.push(nodes[current]);
|
|
1411
|
+
// Process all outgoing edges from the current node
|
|
1412
|
+
const outgoingEdges = outgoingEdgesMap.get(current);
|
|
1413
|
+
if (outgoingEdges) {
|
|
1414
|
+
for (const target of outgoingEdges) {
|
|
1415
|
+
nodeInDegrees[target]--;
|
|
1416
|
+
// If the target node now has no incoming edges, add it to the queue
|
|
1417
|
+
if (nodeInDegrees[target] === 0) {
|
|
1418
|
+
zeroInDegreeQueue.push(target);
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
// Check for cycles
|
|
1424
|
+
if (result.length !== nodes.length) {
|
|
1425
|
+
const cyclePath = detectCycle(nodes, visited, outgoingEdgesMap);
|
|
1426
|
+
throw new ToposortCyclicalDependencyError(cyclePath);
|
|
1427
|
+
}
|
|
1428
|
+
return result;
|
|
1429
|
+
}
|
|
1430
|
+
/**
|
|
1431
|
+
* Performs a topological sort on a directed acyclic graph, always selecting
|
|
1432
|
+
* the smallest available node according to the provided comparison function,
|
|
1433
|
+
* yielding the lexicographically minimal ordering.
|
|
1434
|
+
*
|
|
1435
|
+
* @param nodes - The nodes to sort
|
|
1436
|
+
* @param edges - The edges of the graph
|
|
1437
|
+
* @param compareFunc - Optional custom comparison function to break ties between nodes with the same topological level (default is string comparison)
|
|
1438
|
+
* @returns The sorted nodes
|
|
1439
|
+
*/
|
|
1440
|
+
function toposortOrdered(nodes, edges, compareFunc = defaultCompareFunc) {
|
|
1441
|
+
return toposort(nodes, edges, { compareFunc });
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
/**
|
|
1445
|
+
* Type guard to check if a value is not null or undefined.
|
|
1446
|
+
*/
|
|
1447
|
+
function notEmpty(value) {
|
|
1448
|
+
return value !== null && value !== undefined;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
const {z: z$2} = await importShared('zod');
|
|
1452
|
+
|
|
1453
|
+
/**
|
|
1454
|
+
* Regex for validating kebab case, e.g. "my-project".
|
|
1455
|
+
*/
|
|
1456
|
+
const KEBAB_CASE_REGEX = /^[a-z0-9-]+$/;
|
|
1457
|
+
/**
|
|
1458
|
+
* Regex for validating pascal case, e.g. "MyProject".
|
|
1459
|
+
*/
|
|
1460
|
+
const PASCAL_CASE_REGEX = /^[A-Z][a-zA-Z0-9]*$/;
|
|
1461
|
+
/**
|
|
1462
|
+
* Regex for validating camel case, e.g. "myProject".
|
|
1463
|
+
*/
|
|
1464
|
+
const CAMEL_CASE_REGEX = /^[a-z][a-zA-Z0-9]*$/;
|
|
1465
|
+
/**
|
|
1466
|
+
* Regex for validating constant case, e.g. "MY_PROJECT".
|
|
1467
|
+
*/
|
|
1468
|
+
const CONSTANT_CASE_REGEX = /^[A-Z][A-Z0-9_]*$/;
|
|
1469
|
+
const CASE_VALIDATORS = {
|
|
1470
|
+
/**
|
|
1471
|
+
* Zod validator for validating kebab case, e.g. "my-project".
|
|
1472
|
+
*/
|
|
1473
|
+
KEBAB_CASE: z$2.string().regex(KEBAB_CASE_REGEX, {
|
|
1474
|
+
message: 'Must be kebab case (e.g. "my-project")',
|
|
1475
|
+
}),
|
|
1476
|
+
/**
|
|
1477
|
+
* Zod validator for validating pascal case, e.g. "MyProject".
|
|
1478
|
+
*/
|
|
1479
|
+
PASCAL_CASE: z$2.string().regex(PASCAL_CASE_REGEX, {
|
|
1480
|
+
message: 'Must be pascal case (e.g. "MyProject")',
|
|
1481
|
+
}),
|
|
1482
|
+
/**
|
|
1483
|
+
* Zod validator for validating camel case, e.g. "myProject".
|
|
1484
|
+
*/
|
|
1485
|
+
CAMEL_CASE: z$2.string().regex(CAMEL_CASE_REGEX, {
|
|
1486
|
+
message: 'Must be camel case (e.g. "myProject")',
|
|
1487
|
+
}),
|
|
1488
|
+
/**
|
|
1489
|
+
* Zod validator for validating constant case, e.g. "MY_PROJECT".
|
|
1490
|
+
*/
|
|
1491
|
+
CONSTANT_CASE: z$2.string().regex(CONSTANT_CASE_REGEX, {
|
|
1492
|
+
message: 'Must be constant case (e.g. "MY_PROJECT")',
|
|
1493
|
+
}),
|
|
1494
|
+
};
|
|
1495
|
+
|
|
1496
|
+
const {z: z$1} = await importShared('zod');
|
|
1497
|
+
|
|
1498
|
+
/**
|
|
1499
|
+
* Zod validator for a positive integer.
|
|
1500
|
+
*/
|
|
1501
|
+
const POSITIVE_INT = z$1.number().int().positive();
|
|
1502
|
+
/**
|
|
1503
|
+
* Zod number validators.
|
|
1504
|
+
*/
|
|
1505
|
+
const NUMBER_VALIDATORS = {
|
|
1506
|
+
POSITIVE_INT,
|
|
1507
|
+
};
|
|
1508
|
+
|
|
1509
|
+
const {z} = await importShared('zod');
|
|
1510
|
+
|
|
1511
|
+
/**
|
|
1512
|
+
* Transforms a value using a dynamic schema and forwards any issues to transform context.
|
|
1513
|
+
*
|
|
1514
|
+
* Note: This does not change the return type of the schema.
|
|
1515
|
+
*
|
|
1516
|
+
* @param schemaFn - A function returning a Zod schema based on the current object.
|
|
1517
|
+
*/
|
|
1518
|
+
function transformWithDynamicSchema(schemaFn, valuePath) {
|
|
1519
|
+
return (data, ctx) => {
|
|
1520
|
+
const schema = schemaFn(data);
|
|
1521
|
+
if (!schema) {
|
|
1522
|
+
return data;
|
|
1523
|
+
}
|
|
1524
|
+
const result = schema.safeParse((valuePath ? data[valuePath] : data) ?? undefined);
|
|
1525
|
+
if (!result.success) {
|
|
1526
|
+
for (const issue of result.error.issues) {
|
|
1527
|
+
ctx.addIssue({
|
|
1528
|
+
...issue,
|
|
1529
|
+
path: [...(valuePath ? [valuePath] : []), ...issue.path],
|
|
1530
|
+
});
|
|
1531
|
+
}
|
|
1532
|
+
return z.NEVER;
|
|
1533
|
+
}
|
|
1534
|
+
return valuePath
|
|
1535
|
+
? {
|
|
1536
|
+
...data,
|
|
1537
|
+
[valuePath]: result.data,
|
|
1538
|
+
}
|
|
1539
|
+
: result.data;
|
|
1540
|
+
};
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
export { ArrayContainer, CAMEL_CASE_REGEX, CASE_VALIDATORS, CONSTANT_CASE_REGEX, FieldMapSchemaBuilder, KEBAB_CASE_REGEX, MapContainer, MapOfMapsContainer, NUMBER_VALIDATORS, NamedArrayFieldContainer, ObjectContainer, PASCAL_CASE_REGEX, ScalarContainer, ToposortCyclicalDependencyError, ToposortUnknownNodeError, TypedEventEmitter, convertCaseWithPrefix, createFieldMap, createFieldMapSchemaBuilder, createTypedEventEmitter, differenceSet, doubleQuot, enhanceErrorWithContext, hashWithSHA256, jsonDeepClone, mapGroupBy, mapKeyBy, mapValuesOfMap, notEmpty, quot, randomKey, safeMerge, safeMergeAll, safeMergeAllWithOptions, safeMergeMap, safeMergeMaps, safeMergeMapsWithOptions, sortKeysRecursive, sortObjectKeys, stringifyPrettyCompact, stringifyPrettyStable, toposort, toposortLocal, toposortOrdered, transformWithDynamicSchema };
|
|
1544
|
+
//# sourceMappingURL=utils-BbU_EX7_.js.map
|