@baseplate-dev/project-builder-lib 0.1.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/LICENSE +390 -0
- package/dist/compiler/admin-crud-input-spec.d.ts +26 -0
- package/dist/compiler/admin-crud-input-spec.d.ts.map +1 -0
- package/dist/compiler/admin-crud-input-spec.js +29 -0
- package/dist/compiler/admin-crud-input-spec.js.map +1 -0
- package/dist/compiler/app-compiler-spec.d.ts +36 -0
- package/dist/compiler/app-compiler-spec.d.ts.map +1 -0
- package/dist/compiler/app-compiler-spec.js +42 -0
- package/dist/compiler/app-compiler-spec.js.map +1 -0
- package/dist/compiler/index.d.ts +5 -0
- package/dist/compiler/index.d.ts.map +1 -0
- package/dist/compiler/index.js +4 -0
- package/dist/compiler/index.js.map +1 -0
- package/dist/compiler/model-transformer-compiler-spec.d.ts +25 -0
- package/dist/compiler/model-transformer-compiler-spec.d.ts.map +1 -0
- package/dist/compiler/model-transformer-compiler-spec.js +29 -0
- package/dist/compiler/model-transformer-compiler-spec.js.map +1 -0
- package/dist/compiler/types.d.ts +2 -0
- package/dist/compiler/types.d.ts.map +1 -0
- package/dist/compiler/types.js +2 -0
- package/dist/compiler/types.js.map +1 -0
- package/dist/constants/colors.d.ts +294 -0
- package/dist/constants/colors.d.ts.map +1 -0
- package/dist/constants/colors.js +307 -0
- package/dist/constants/colors.js.map +1 -0
- package/dist/constants/index.d.ts +3 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +3 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/constants/theme-colors.d.ts +397 -0
- package/dist/constants/theme-colors.d.ts.map +1 -0
- package/dist/constants/theme-colors.js +247 -0
- package/dist/constants/theme-colors.js.map +1 -0
- package/dist/definition/apps/app-utils.d.ts +11 -0
- package/dist/definition/apps/app-utils.d.ts.map +1 -0
- package/dist/definition/apps/app-utils.js +30 -0
- package/dist/definition/apps/app-utils.js.map +1 -0
- package/dist/definition/feature/feature-utils.d.ts +27 -0
- package/dist/definition/feature/feature-utils.d.ts.map +1 -0
- package/dist/definition/feature/feature-utils.js +81 -0
- package/dist/definition/feature/feature-utils.js.map +1 -0
- package/dist/definition/index.d.ts +10 -0
- package/dist/definition/index.d.ts.map +1 -0
- package/dist/definition/index.js +10 -0
- package/dist/definition/index.js.map +1 -0
- package/dist/definition/model/enum-utils.d.ts +9 -0
- package/dist/definition/model/enum-utils.d.ts.map +1 -0
- package/dist/definition/model/enum-utils.js +15 -0
- package/dist/definition/model/enum-utils.js.map +1 -0
- package/dist/definition/model/model-field-utils.d.ts +17 -0
- package/dist/definition/model/model-field-utils.d.ts.map +1 -0
- package/dist/definition/model/model-field-utils.js +85 -0
- package/dist/definition/model/model-field-utils.js.map +1 -0
- package/dist/definition/model/model-transformer-utils.d.ts +11 -0
- package/dist/definition/model/model-transformer-utils.d.ts.map +1 -0
- package/dist/definition/model/model-transformer-utils.js +13 -0
- package/dist/definition/model/model-transformer-utils.js.map +1 -0
- package/dist/definition/model/model-utils.d.ts +32 -0
- package/dist/definition/model/model-utils.d.ts.map +1 -0
- package/dist/definition/model/model-utils.js +59 -0
- package/dist/definition/model/model-utils.js.map +1 -0
- package/dist/definition/plugins/index.d.ts +2 -0
- package/dist/definition/plugins/index.d.ts.map +1 -0
- package/dist/definition/plugins/index.js +2 -0
- package/dist/definition/plugins/index.js.map +1 -0
- package/dist/definition/plugins/plugin-utils.d.ts +14 -0
- package/dist/definition/plugins/plugin-utils.d.ts.map +1 -0
- package/dist/definition/plugins/plugin-utils.js +44 -0
- package/dist/definition/plugins/plugin-utils.js.map +1 -0
- package/dist/definition/project-definition-container.d.ts +65 -0
- package/dist/definition/project-definition-container.d.ts.map +1 -0
- package/dist/definition/project-definition-container.js +118 -0
- package/dist/definition/project-definition-container.js.map +1 -0
- package/dist/definition/project-definition-container.test-helper.d.ts +5 -0
- package/dist/definition/project-definition-container.test-helper.d.ts.map +1 -0
- package/dist/definition/project-definition-container.test-helper.js +36 -0
- package/dist/definition/project-definition-container.test-helper.js.map +1 -0
- package/dist/feature-flags/flags.d.ts +3 -0
- package/dist/feature-flags/flags.d.ts.map +1 -0
- package/dist/feature-flags/flags.js +2 -0
- package/dist/feature-flags/flags.js.map +1 -0
- package/dist/feature-flags/index.d.ts +2 -0
- package/dist/feature-flags/index.d.ts.map +1 -0
- package/dist/feature-flags/index.js +2 -0
- package/dist/feature-flags/index.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/index.d.ts +15 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +68 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/migrations/migration-005-primaryUniqueRefs.d.ts +37 -0
- package/dist/migrations/migration-005-primaryUniqueRefs.d.ts.map +1 -0
- package/dist/migrations/migration-005-primaryUniqueRefs.js +40 -0
- package/dist/migrations/migration-005-primaryUniqueRefs.js.map +1 -0
- package/dist/migrations/migration-006-individual-service-controllers.d.ts +42 -0
- package/dist/migrations/migration-006-individual-service-controllers.d.ts.map +1 -0
- package/dist/migrations/migration-006-individual-service-controllers.js +31 -0
- package/dist/migrations/migration-006-individual-service-controllers.js.map +1 -0
- package/dist/migrations/migration-007-model-graphql.d.ts +59 -0
- package/dist/migrations/migration-007-model-graphql.d.ts.map +1 -0
- package/dist/migrations/migration-007-model-graphql.js +62 -0
- package/dist/migrations/migration-007-model-graphql.js.map +1 -0
- package/dist/migrations/migration-008-anonymous-public-role.d.ts +22 -0
- package/dist/migrations/migration-008-anonymous-public-role.d.ts.map +1 -0
- package/dist/migrations/migration-008-anonymous-public-role.js +52 -0
- package/dist/migrations/migration-008-anonymous-public-role.js.map +1 -0
- package/dist/migrations/migration-009-rename-refs.d.ts +2 -0
- package/dist/migrations/migration-009-rename-refs.d.ts.map +1 -0
- package/dist/migrations/migration-009-rename-refs.js +59 -0
- package/dist/migrations/migration-009-rename-refs.js.map +1 -0
- package/dist/migrations/migration-010-hex-to-oklch.d.ts +2 -0
- package/dist/migrations/migration-010-hex-to-oklch.d.ts.map +1 -0
- package/dist/migrations/migration-010-hex-to-oklch.js +24 -0
- package/dist/migrations/migration-010-hex-to-oklch.js.map +1 -0
- package/dist/migrations/migration-011-plugin-id.d.ts +2 -0
- package/dist/migrations/migration-011-plugin-id.d.ts.map +1 -0
- package/dist/migrations/migration-011-plugin-id.js +10 -0
- package/dist/migrations/migration-011-plugin-id.js.map +1 -0
- package/dist/migrations/migration-012-migrate-auth-config.d.ts +36 -0
- package/dist/migrations/migration-012-migrate-auth-config.d.ts.map +1 -0
- package/dist/migrations/migration-012-migrate-auth-config.js +48 -0
- package/dist/migrations/migration-012-migrate-auth-config.js.map +1 -0
- package/dist/migrations/migration-013-move-general-settings.d.ts +38 -0
- package/dist/migrations/migration-013-move-general-settings.d.ts.map +1 -0
- package/dist/migrations/migration-013-move-general-settings.js +22 -0
- package/dist/migrations/migration-013-move-general-settings.js.map +1 -0
- package/dist/migrations/migration-014-migrate-plugin-ids.d.ts +21 -0
- package/dist/migrations/migration-014-migrate-plugin-ids.d.ts.map +1 -0
- package/dist/migrations/migration-014-migrate-plugin-ids.js +32 -0
- package/dist/migrations/migration-014-migrate-plugin-ids.js.map +1 -0
- package/dist/migrations/transform-json-path.d.ts +13 -0
- package/dist/migrations/transform-json-path.d.ts.map +1 -0
- package/dist/migrations/transform-json-path.js +66 -0
- package/dist/migrations/transform-json-path.js.map +1 -0
- package/dist/migrations/types.d.ts +29 -0
- package/dist/migrations/types.d.ts.map +1 -0
- package/dist/migrations/types.js +4 -0
- package/dist/migrations/types.js.map +1 -0
- package/dist/migrations/utils.d.ts +3 -0
- package/dist/migrations/utils.d.ts.map +1 -0
- package/dist/migrations/utils.js +10 -0
- package/dist/migrations/utils.js.map +1 -0
- package/dist/parser/index.d.ts +3 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +2 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/parser.d.ts +35 -0
- package/dist/parser/parser.d.ts.map +1 -0
- package/dist/parser/parser.js +84 -0
- package/dist/parser/parser.js.map +1 -0
- package/dist/parser/types.d.ts +8 -0
- package/dist/parser/types.d.ts.map +1 -0
- package/dist/parser/types.js +2 -0
- package/dist/parser/types.js.map +1 -0
- package/dist/plugin-tools/index.d.ts +2 -0
- package/dist/plugin-tools/index.d.ts.map +1 -0
- package/dist/plugin-tools/index.js +2 -0
- package/dist/plugin-tools/index.js.map +1 -0
- package/dist/plugin-tools/plugin-loader.d.ts +16 -0
- package/dist/plugin-tools/plugin-loader.d.ts.map +1 -0
- package/dist/plugin-tools/plugin-loader.js +166 -0
- package/dist/plugin-tools/plugin-loader.js.map +1 -0
- package/dist/plugins/imports/index.d.ts +3 -0
- package/dist/plugins/imports/index.d.ts.map +1 -0
- package/dist/plugins/imports/index.js +3 -0
- package/dist/plugins/imports/index.js.map +1 -0
- package/dist/plugins/imports/loader.d.ts +23 -0
- package/dist/plugins/imports/loader.d.ts.map +1 -0
- package/dist/plugins/imports/loader.js +81 -0
- package/dist/plugins/imports/loader.js.map +1 -0
- package/dist/plugins/imports/types.d.ts +27 -0
- package/dist/plugins/imports/types.d.ts.map +1 -0
- package/dist/plugins/imports/types.js +4 -0
- package/dist/plugins/imports/types.js.map +1 -0
- package/dist/plugins/index.d.ts +7 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +7 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/manifest/manifest.d.ts +13 -0
- package/dist/plugins/manifest/manifest.d.ts.map +1 -0
- package/dist/plugins/manifest/manifest.js +6 -0
- package/dist/plugins/manifest/manifest.js.map +1 -0
- package/dist/plugins/metadata/index.d.ts +2 -0
- package/dist/plugins/metadata/index.d.ts.map +1 -0
- package/dist/plugins/metadata/index.js +2 -0
- package/dist/plugins/metadata/index.js.map +1 -0
- package/dist/plugins/metadata/types.d.ts +163 -0
- package/dist/plugins/metadata/types.d.ts.map +1 -0
- package/dist/plugins/metadata/types.js +59 -0
- package/dist/plugins/metadata/types.js.map +1 -0
- package/dist/plugins/migrations/index.d.ts +2 -0
- package/dist/plugins/migrations/index.d.ts.map +1 -0
- package/dist/plugins/migrations/index.js +2 -0
- package/dist/plugins/migrations/index.js.map +1 -0
- package/dist/plugins/migrations/run-migrations.d.ts +4 -0
- package/dist/plugins/migrations/run-migrations.d.ts.map +1 -0
- package/dist/plugins/migrations/run-migrations.js +30 -0
- package/dist/plugins/migrations/run-migrations.js.map +1 -0
- package/dist/plugins/schema/common.d.ts +6 -0
- package/dist/plugins/schema/common.d.ts.map +1 -0
- package/dist/plugins/schema/common.js +2 -0
- package/dist/plugins/schema/common.js.map +1 -0
- package/dist/plugins/schema/index.d.ts +4 -0
- package/dist/plugins/schema/index.d.ts.map +1 -0
- package/dist/plugins/schema/index.js +4 -0
- package/dist/plugins/schema/index.js.map +1 -0
- package/dist/plugins/schema/parser.d.ts +19 -0
- package/dist/plugins/schema/parser.d.ts.map +1 -0
- package/dist/plugins/schema/parser.js +41 -0
- package/dist/plugins/schema/parser.js.map +1 -0
- package/dist/plugins/schema/store.d.ts +8 -0
- package/dist/plugins/schema/store.d.ts.map +1 -0
- package/dist/plugins/schema/store.js +21 -0
- package/dist/plugins/schema/store.js.map +1 -0
- package/dist/plugins/schema/zod-with-plugins.d.ts +12 -0
- package/dist/plugins/schema/zod-with-plugins.d.ts.map +1 -0
- package/dist/plugins/schema/zod-with-plugins.js +26 -0
- package/dist/plugins/schema/zod-with-plugins.js.map +1 -0
- package/dist/plugins/spec/auth-config-spec.d.ts +21 -0
- package/dist/plugins/spec/auth-config-spec.d.ts.map +1 -0
- package/dist/plugins/spec/auth-config-spec.js +6 -0
- package/dist/plugins/spec/auth-config-spec.js.map +1 -0
- package/dist/plugins/spec/config-spec.d.ts +31 -0
- package/dist/plugins/spec/config-spec.d.ts.map +1 -0
- package/dist/plugins/spec/config-spec.js +58 -0
- package/dist/plugins/spec/config-spec.js.map +1 -0
- package/dist/plugins/spec/index.d.ts +5 -0
- package/dist/plugins/spec/index.d.ts.map +1 -0
- package/dist/plugins/spec/index.js +5 -0
- package/dist/plugins/spec/index.js.map +1 -0
- package/dist/plugins/spec/types.d.ts +29 -0
- package/dist/plugins/spec/types.d.ts.map +1 -0
- package/dist/plugins/spec/types.js +17 -0
- package/dist/plugins/spec/types.js.map +1 -0
- package/dist/plugins/spec/web-config-spec.d.ts +22 -0
- package/dist/plugins/spec/web-config-spec.d.ts.map +1 -0
- package/dist/plugins/spec/web-config-spec.js +23 -0
- package/dist/plugins/spec/web-config-spec.js.map +1 -0
- package/dist/references/deserialize-schema.d.ts +4 -0
- package/dist/references/deserialize-schema.d.ts.map +1 -0
- package/dist/references/deserialize-schema.js +68 -0
- package/dist/references/deserialize-schema.js.map +1 -0
- package/dist/references/fix-ref-deletions.d.ts +22 -0
- package/dist/references/fix-ref-deletions.d.ts.map +1 -0
- package/dist/references/fix-ref-deletions.js +99 -0
- package/dist/references/fix-ref-deletions.js.map +1 -0
- package/dist/references/index.d.ts +6 -0
- package/dist/references/index.d.ts.map +1 -0
- package/dist/references/index.js +6 -0
- package/dist/references/index.js.map +1 -0
- package/dist/references/parse-schema-with-references.d.ts +14 -0
- package/dist/references/parse-schema-with-references.d.ts.map +1 -0
- package/dist/references/parse-schema-with-references.js +16 -0
- package/dist/references/parse-schema-with-references.js.map +1 -0
- package/dist/references/ref-builder.d.ts +346 -0
- package/dist/references/ref-builder.d.ts.map +1 -0
- package/dist/references/ref-builder.js +494 -0
- package/dist/references/ref-builder.js.map +1 -0
- package/dist/references/resolve-zod-ref-payload-names.d.ts +26 -0
- package/dist/references/resolve-zod-ref-payload-names.d.ts.map +1 -0
- package/dist/references/resolve-zod-ref-payload-names.js +52 -0
- package/dist/references/resolve-zod-ref-payload-names.js.map +1 -0
- package/dist/references/serialize-schema.d.ts +5 -0
- package/dist/references/serialize-schema.d.ts.map +1 -0
- package/dist/references/serialize-schema.js +22 -0
- package/dist/references/serialize-schema.js.map +1 -0
- package/dist/references/types.d.ts +126 -0
- package/dist/references/types.d.ts.map +1 -0
- package/dist/references/types.js +59 -0
- package/dist/references/types.js.map +1 -0
- package/dist/schema/apps/admin/app.d.ts +1144 -0
- package/dist/schema/apps/admin/app.d.ts.map +1 -0
- package/dist/schema/apps/admin/app.js +27 -0
- package/dist/schema/apps/admin/app.js.map +1 -0
- package/dist/schema/apps/admin/index.d.ts +3 -0
- package/dist/schema/apps/admin/index.d.ts.map +1 -0
- package/dist/schema/apps/admin/index.js +3 -0
- package/dist/schema/apps/admin/index.js.map +1 -0
- package/dist/schema/apps/admin/sections/base.d.ts +9 -0
- package/dist/schema/apps/admin/sections/base.d.ts.map +1 -0
- package/dist/schema/apps/admin/sections/base.js +15 -0
- package/dist/schema/apps/admin/sections/base.js.map +1 -0
- package/dist/schema/apps/admin/sections/crud-form/admin-crud-input.d.ts +11 -0
- package/dist/schema/apps/admin/sections/crud-form/admin-crud-input.d.ts.map +1 -0
- package/dist/schema/apps/admin/sections/crud-form/admin-crud-input.js +11 -0
- package/dist/schema/apps/admin/sections/crud-form/admin-crud-input.js.map +1 -0
- package/dist/schema/apps/admin/sections/crud-form/admin-input-spec.d.ts +17 -0
- package/dist/schema/apps/admin/sections/crud-form/admin-input-spec.d.ts.map +1 -0
- package/dist/schema/apps/admin/sections/crud-form/admin-input-spec.js +30 -0
- package/dist/schema/apps/admin/sections/crud-form/admin-input-spec.js.map +1 -0
- package/dist/schema/apps/admin/sections/crud-form/built-in-input.d.ts +138 -0
- package/dist/schema/apps/admin/sections/crud-form/built-in-input.d.ts.map +1 -0
- package/dist/schema/apps/admin/sections/crud-form/built-in-input.js +101 -0
- package/dist/schema/apps/admin/sections/crud-form/built-in-input.js.map +1 -0
- package/dist/schema/apps/admin/sections/crud-form/index.d.ts +5 -0
- package/dist/schema/apps/admin/sections/crud-form/index.d.ts.map +1 -0
- package/dist/schema/apps/admin/sections/crud-form/index.js +5 -0
- package/dist/schema/apps/admin/sections/crud-form/index.js.map +1 -0
- package/dist/schema/apps/admin/sections/crud-form/types.d.ts +19 -0
- package/dist/schema/apps/admin/sections/crud-form/types.d.ts.map +1 -0
- package/dist/schema/apps/admin/sections/crud-form/types.js +14 -0
- package/dist/schema/apps/admin/sections/crud-form/types.js.map +1 -0
- package/dist/schema/apps/admin/sections/crud.d.ts +988 -0
- package/dist/schema/apps/admin/sections/crud.d.ts.map +1 -0
- package/dist/schema/apps/admin/sections/crud.js +101 -0
- package/dist/schema/apps/admin/sections/crud.js.map +1 -0
- package/dist/schema/apps/admin/sections/index.d.ts +5 -0
- package/dist/schema/apps/admin/sections/index.d.ts.map +1 -0
- package/dist/schema/apps/admin/sections/index.js +5 -0
- package/dist/schema/apps/admin/sections/index.js.map +1 -0
- package/dist/schema/apps/admin/sections/types.d.ts +2 -0
- package/dist/schema/apps/admin/sections/types.d.ts.map +1 -0
- package/dist/schema/apps/admin/sections/types.js +6 -0
- package/dist/schema/apps/admin/sections/types.js.map +1 -0
- package/dist/schema/apps/backend/index.d.ts +49 -0
- package/dist/schema/apps/backend/index.d.ts.map +1 -0
- package/dist/schema/apps/backend/index.js +15 -0
- package/dist/schema/apps/backend/index.js.map +1 -0
- package/dist/schema/apps/base.d.ts +25 -0
- package/dist/schema/apps/base.d.ts.map +1 -0
- package/dist/schema/apps/base.js +16 -0
- package/dist/schema/apps/base.js.map +1 -0
- package/dist/schema/apps/index.d.ts +6 -0
- package/dist/schema/apps/index.d.ts.map +1 -0
- package/dist/schema/apps/index.js +6 -0
- package/dist/schema/apps/index.js.map +1 -0
- package/dist/schema/apps/types.d.ts +6 -0
- package/dist/schema/apps/types.d.ts.map +1 -0
- package/dist/schema/apps/types.js +6 -0
- package/dist/schema/apps/types.js.map +1 -0
- package/dist/schema/apps/web/index.d.ts +49 -0
- package/dist/schema/apps/web/index.d.ts.map +1 -0
- package/dist/schema/apps/web/index.js +22 -0
- package/dist/schema/apps/web/index.js.map +1 -0
- package/dist/schema/auth/index.d.ts +2 -0
- package/dist/schema/auth/index.d.ts.map +1 -0
- package/dist/schema/auth/index.js +3 -0
- package/dist/schema/auth/index.js.map +1 -0
- package/dist/schema/creator/index.d.ts +2 -0
- package/dist/schema/creator/index.d.ts.map +1 -0
- package/dist/schema/creator/index.js +2 -0
- package/dist/schema/creator/index.js.map +1 -0
- package/dist/schema/creator/schema-creator.d.ts +4 -0
- package/dist/schema/creator/schema-creator.d.ts.map +1 -0
- package/dist/schema/creator/schema-creator.js +4 -0
- package/dist/schema/creator/schema-creator.js.map +1 -0
- package/dist/schema/creator/types.d.ts +14 -0
- package/dist/schema/creator/types.d.ts.map +1 -0
- package/dist/schema/creator/types.js +2 -0
- package/dist/schema/creator/types.js.map +1 -0
- package/dist/schema/features/feature.d.ts +33 -0
- package/dist/schema/features/feature.d.ts.map +1 -0
- package/dist/schema/features/feature.js +21 -0
- package/dist/schema/features/feature.js.map +1 -0
- package/dist/schema/features/index.d.ts +3 -0
- package/dist/schema/features/index.d.ts.map +1 -0
- package/dist/schema/features/index.js +3 -0
- package/dist/schema/features/index.js.map +1 -0
- package/dist/schema/features/theme.d.ts +208 -0
- package/dist/schema/features/theme.d.ts.map +1 -0
- package/dist/schema/features/theme.js +34 -0
- package/dist/schema/features/theme.js.map +1 -0
- package/dist/schema/index.d.ts +11 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +11 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/models/enums.d.ts +97 -0
- package/dist/schema/models/enums.d.ts.map +1 -0
- package/dist/schema/models/enums.js +25 -0
- package/dist/schema/models/enums.js.map +1 -0
- package/dist/schema/models/graphql.d.ts +181 -0
- package/dist/schema/models/graphql.d.ts.map +1 -0
- package/dist/schema/models/graphql.js +96 -0
- package/dist/schema/models/graphql.js.map +1 -0
- package/dist/schema/models/index.d.ts +1692 -0
- package/dist/schema/models/index.d.ts.map +1 -0
- package/dist/schema/models/index.js +220 -0
- package/dist/schema/models/index.js.map +1 -0
- package/dist/schema/models/mocks.d.ts +6 -0
- package/dist/schema/models/mocks.d.ts.map +1 -0
- package/dist/schema/models/mocks.js +55 -0
- package/dist/schema/models/mocks.js.map +1 -0
- package/dist/schema/models/transformers/built-in-transformers.d.ts +71 -0
- package/dist/schema/models/transformers/built-in-transformers.d.ts.map +1 -0
- package/dist/schema/models/transformers/built-in-transformers.js +59 -0
- package/dist/schema/models/transformers/built-in-transformers.js.map +1 -0
- package/dist/schema/models/transformers/index.d.ts +5 -0
- package/dist/schema/models/transformers/index.d.ts.map +1 -0
- package/dist/schema/models/transformers/index.js +5 -0
- package/dist/schema/models/transformers/index.js.map +1 -0
- package/dist/schema/models/transformers/model-transformer-spec.d.ts +17 -0
- package/dist/schema/models/transformers/model-transformer-spec.d.ts.map +1 -0
- package/dist/schema/models/transformers/model-transformer-spec.js +40 -0
- package/dist/schema/models/transformers/model-transformer-spec.js.map +1 -0
- package/dist/schema/models/transformers/transformers.d.ts +11 -0
- package/dist/schema/models/transformers/transformers.d.ts.map +1 -0
- package/dist/schema/models/transformers/transformers.js +11 -0
- package/dist/schema/models/transformers/transformers.js.map +1 -0
- package/dist/schema/models/transformers/types.d.ts +23 -0
- package/dist/schema/models/transformers/types.d.ts.map +1 -0
- package/dist/schema/models/transformers/types.js +12 -0
- package/dist/schema/models/transformers/types.js.map +1 -0
- package/dist/schema/models/types.d.ts +9 -0
- package/dist/schema/models/types.d.ts.map +1 -0
- package/dist/schema/models/types.js +14 -0
- package/dist/schema/models/types.js.map +1 -0
- package/dist/schema/plugins/definition.d.ts +128 -0
- package/dist/schema/plugins/definition.d.ts.map +1 -0
- package/dist/schema/plugins/definition.js +28 -0
- package/dist/schema/plugins/definition.js.map +1 -0
- package/dist/schema/plugins/entity-types.d.ts +2 -0
- package/dist/schema/plugins/entity-types.d.ts.map +1 -0
- package/dist/schema/plugins/entity-types.js +3 -0
- package/dist/schema/plugins/entity-types.js.map +1 -0
- package/dist/schema/plugins/index.d.ts +3 -0
- package/dist/schema/plugins/index.d.ts.map +1 -0
- package/dist/schema/plugins/index.js +3 -0
- package/dist/schema/plugins/index.js.map +1 -0
- package/dist/schema/project-definition.d.ts +2877 -0
- package/dist/schema/project-definition.d.ts.map +1 -0
- package/dist/schema/project-definition.js +34 -0
- package/dist/schema/project-definition.js.map +1 -0
- package/dist/schema/settings.d.ts +228 -0
- package/dist/schema/settings.d.ts.map +1 -0
- package/dist/schema/settings.js +32 -0
- package/dist/schema/settings.js.map +1 -0
- package/dist/schema/template-extractor/index.d.ts +25 -0
- package/dist/schema/template-extractor/index.d.ts.map +1 -0
- package/dist/schema/template-extractor/index.js +18 -0
- package/dist/schema/template-extractor/index.js.map +1 -0
- package/dist/schema/utils/validation.d.ts +8 -0
- package/dist/schema/utils/validation.d.ts.map +1 -0
- package/dist/schema/utils/validation.js +18 -0
- package/dist/schema/utils/validation.js.map +1 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +2 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/model-merger/index.d.ts +2 -0
- package/dist/tools/model-merger/index.d.ts.map +1 -0
- package/dist/tools/model-merger/index.js +2 -0
- package/dist/tools/model-merger/index.js.map +1 -0
- package/dist/tools/model-merger/model-merger.d.ts +376 -0
- package/dist/tools/model-merger/model-merger.d.ts.map +1 -0
- package/dist/tools/model-merger/model-merger.js +229 -0
- package/dist/tools/model-merger/model-merger.js.map +1 -0
- package/dist/types/field-types.d.ts +3 -0
- package/dist/types/field-types.d.ts.map +1 -0
- package/dist/types/field-types.js +13 -0
- package/dist/types/field-types.js.map +1 -0
- package/dist/types/files.d.ts +8 -0
- package/dist/types/files.d.ts.map +1 -0
- package/dist/types/files.js +2 -0
- package/dist/types/files.js.map +1 -0
- package/dist/utils/color-conversions.d.ts +20 -0
- package/dist/utils/color-conversions.d.ts.map +1 -0
- package/dist/utils/color-conversions.js +38 -0
- package/dist/utils/color-conversions.js.map +1 -0
- package/dist/utils/color-names.d.ts +18 -0
- package/dist/utils/color-names.d.ts.map +1 -0
- package/dist/utils/color-names.js +54 -0
- package/dist/utils/color-names.js.map +1 -0
- package/dist/utils/definition-diff/definition-diff.d.ts +68 -0
- package/dist/utils/definition-diff/definition-diff.d.ts.map +1 -0
- package/dist/utils/definition-diff/definition-diff.js +149 -0
- package/dist/utils/definition-diff/definition-diff.js.map +1 -0
- package/dist/utils/definition-diff/index.d.ts +2 -0
- package/dist/utils/definition-diff/index.d.ts.map +1 -0
- package/dist/utils/definition-diff/index.js +2 -0
- package/dist/utils/definition-diff/index.js.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/path.d.ts +5 -0
- package/dist/utils/path.d.ts.map +1 -0
- package/dist/utils/path.js +27 -0
- package/dist/utils/path.js.map +1 -0
- package/dist/utils/strip.d.ts +18 -0
- package/dist/utils/strip.d.ts.map +1 -0
- package/dist/utils/strip.js +37 -0
- package/dist/utils/strip.js.map +1 -0
- package/dist/utils/theme.d.ts +10 -0
- package/dist/utils/theme.d.ts.map +1 -0
- package/dist/utils/theme.js +58 -0
- package/dist/utils/theme.js.map +1 -0
- package/dist/web/components/FeatureComboboxField.d.ts +17 -0
- package/dist/web/components/FeatureComboboxField.d.ts.map +1 -0
- package/dist/web/components/FeatureComboboxField.js +38 -0
- package/dist/web/components/FeatureComboboxField.js.map +1 -0
- package/dist/web/components/ModelComboboxField.d.ts +17 -0
- package/dist/web/components/ModelComboboxField.d.ts.map +1 -0
- package/dist/web/components/ModelComboboxField.js +38 -0
- package/dist/web/components/ModelComboboxField.js.map +1 -0
- package/dist/web/components/ModelMergerResultAlert.d.ts +8 -0
- package/dist/web/components/ModelMergerResultAlert.d.ts.map +1 -0
- package/dist/web/components/ModelMergerResultAlert.js +10 -0
- package/dist/web/components/ModelMergerResultAlert.js.map +1 -0
- package/dist/web/components/index.d.ts +4 -0
- package/dist/web/components/index.d.ts.map +1 -0
- package/dist/web/components/index.js +4 -0
- package/dist/web/components/index.js.map +1 -0
- package/dist/web/contexts/error-handler.d.ts +7 -0
- package/dist/web/contexts/error-handler.d.ts.map +1 -0
- package/dist/web/contexts/error-handler.js +3 -0
- package/dist/web/contexts/error-handler.js.map +1 -0
- package/dist/web/contexts/index.d.ts +2 -0
- package/dist/web/contexts/index.d.ts.map +1 -0
- package/dist/web/contexts/index.js +2 -0
- package/dist/web/contexts/index.js.map +1 -0
- package/dist/web/hooks/index.d.ts +8 -0
- package/dist/web/hooks/index.d.ts.map +1 -0
- package/dist/web/hooks/index.js +8 -0
- package/dist/web/hooks/index.js.map +1 -0
- package/dist/web/hooks/useBlockDirtyFormNavigate.d.ts +3 -0
- package/dist/web/hooks/useBlockDirtyFormNavigate.d.ts.map +1 -0
- package/dist/web/hooks/useBlockDirtyFormNavigate.js +14 -0
- package/dist/web/hooks/useBlockDirtyFormNavigate.js.map +1 -0
- package/dist/web/hooks/useBlockUnsavedChangesNavigate.d.ts +7 -0
- package/dist/web/hooks/useBlockUnsavedChangesNavigate.d.ts.map +1 -0
- package/dist/web/hooks/useBlockUnsavedChangesNavigate.js +47 -0
- package/dist/web/hooks/useBlockUnsavedChangesNavigate.js.map +1 -0
- package/dist/web/hooks/useBlockerDialog.d.ts +44 -0
- package/dist/web/hooks/useBlockerDialog.d.ts.map +1 -0
- package/dist/web/hooks/useBlockerDialog.js +77 -0
- package/dist/web/hooks/useBlockerDialog.js.map +1 -0
- package/dist/web/hooks/useErrorHandler.d.ts +3 -0
- package/dist/web/hooks/useErrorHandler.d.ts.map +1 -0
- package/dist/web/hooks/useErrorHandler.js +10 -0
- package/dist/web/hooks/useErrorHandler.js.map +1 -0
- package/dist/web/hooks/usePluginEnhancedSchema.d.ts +4 -0
- package/dist/web/hooks/usePluginEnhancedSchema.d.ts.map +1 -0
- package/dist/web/hooks/usePluginEnhancedSchema.js +8 -0
- package/dist/web/hooks/usePluginEnhancedSchema.js.map +1 -0
- package/dist/web/hooks/useProjectDefinition.d.ts +65 -0
- package/dist/web/hooks/useProjectDefinition.d.ts.map +1 -0
- package/dist/web/hooks/useProjectDefinition.js +10 -0
- package/dist/web/hooks/useProjectDefinition.js.map +1 -0
- package/dist/web/hooks/useResettableForm.d.ts +3 -0
- package/dist/web/hooks/useResettableForm.d.ts.map +1 -0
- package/dist/web/hooks/useResettableForm.js +29 -0
- package/dist/web/hooks/useResettableForm.js.map +1 -0
- package/dist/web/index.d.ts +6 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +6 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/specs/admin-crud-input-web-spec.d.ts +36 -0
- package/dist/web/specs/admin-crud-input-web-spec.d.ts.map +1 -0
- package/dist/web/specs/admin-crud-input-web-spec.js +35 -0
- package/dist/web/specs/admin-crud-input-web-spec.js.map +1 -0
- package/dist/web/specs/index.d.ts +3 -0
- package/dist/web/specs/index.d.ts.map +1 -0
- package/dist/web/specs/index.js +3 -0
- package/dist/web/specs/index.js.map +1 -0
- package/dist/web/specs/model-transformer-web-spec.d.ts +40 -0
- package/dist/web/specs/model-transformer-web-spec.d.ts.map +1 -0
- package/dist/web/specs/model-transformer-web-spec.js +35 -0
- package/dist/web/specs/model-transformer-web-spec.js.map +1 -0
- package/dist/web/utils/form.d.ts +2 -0
- package/dist/web/utils/form.d.ts.map +1 -0
- package/dist/web/utils/form.js +6 -0
- package/dist/web/utils/form.js.map +1 -0
- package/dist/web/utils/index.d.ts +2 -0
- package/dist/web/utils/index.d.ts.map +1 -0
- package/dist/web/utils/index.js +2 -0
- package/dist/web/utils/index.js.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
import { get, set } from 'es-toolkit/compat';
|
|
2
|
+
import { z, ZodType } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* Zod reference ID schema: a string with a minimum length of 1.
|
|
5
|
+
*/
|
|
6
|
+
export const zRefId = z.string().min(1);
|
|
7
|
+
/**
|
|
8
|
+
* Determines whether the given object is a Promise.
|
|
9
|
+
* @param object - The value to test.
|
|
10
|
+
* @returns True if the value is a Promise, false otherwise.
|
|
11
|
+
*/
|
|
12
|
+
function isPromise(object) {
|
|
13
|
+
return object instanceof Promise;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Creates a definition entity name resolver.
|
|
17
|
+
* @param entityNameResolver - The entity name resolver.
|
|
18
|
+
* @returns The definition entity name resolver.
|
|
19
|
+
*/
|
|
20
|
+
export function createDefinitionEntityNameResolver(entityNameResolver) {
|
|
21
|
+
return entityNameResolver;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* ZodRefBuilder is responsible for constructing reference paths, and registering
|
|
25
|
+
* references and entities as defined in a Zod schema.
|
|
26
|
+
*
|
|
27
|
+
* The builder uses a prefix (usually the current parsing path) and context (a
|
|
28
|
+
* shared map for resolving relative references) to build complete reference paths.
|
|
29
|
+
*
|
|
30
|
+
* @template TInput - The type of the input data being parsed.
|
|
31
|
+
*/
|
|
32
|
+
export class ZodRefBuilder {
|
|
33
|
+
/**
|
|
34
|
+
* Creates a new builder instance.
|
|
35
|
+
* @param pathPrefix - The starting path for all references.
|
|
36
|
+
* @param context - Shared context including a path map and deserialize flag.
|
|
37
|
+
* @param data - The data being parsed.
|
|
38
|
+
*/
|
|
39
|
+
constructor(pathPrefix, context, data) {
|
|
40
|
+
Object.defineProperty(this, "references", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
configurable: true,
|
|
43
|
+
writable: true,
|
|
44
|
+
value: void 0
|
|
45
|
+
});
|
|
46
|
+
Object.defineProperty(this, "entitiesWithNameResolver", {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
configurable: true,
|
|
49
|
+
writable: true,
|
|
50
|
+
value: void 0
|
|
51
|
+
});
|
|
52
|
+
Object.defineProperty(this, "pathPrefix", {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
configurable: true,
|
|
55
|
+
writable: true,
|
|
56
|
+
value: void 0
|
|
57
|
+
});
|
|
58
|
+
Object.defineProperty(this, "context", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
configurable: true,
|
|
61
|
+
writable: true,
|
|
62
|
+
value: void 0
|
|
63
|
+
});
|
|
64
|
+
Object.defineProperty(this, "pathMap", {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
configurable: true,
|
|
67
|
+
writable: true,
|
|
68
|
+
value: void 0
|
|
69
|
+
});
|
|
70
|
+
Object.defineProperty(this, "data", {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
configurable: true,
|
|
73
|
+
writable: true,
|
|
74
|
+
value: void 0
|
|
75
|
+
});
|
|
76
|
+
this.references = [];
|
|
77
|
+
this.entitiesWithNameResolver = [];
|
|
78
|
+
this.pathPrefix = pathPrefix;
|
|
79
|
+
this.context = context;
|
|
80
|
+
this.pathMap = new Map();
|
|
81
|
+
this.data = data;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Converts a dot-separated string path into an array of keys.
|
|
85
|
+
* @param path - A string (e.g. "a.b.0.c") representing the path.
|
|
86
|
+
* @returns An array of keys (numbers for numeric strings, otherwise strings).
|
|
87
|
+
*/
|
|
88
|
+
_constructPathWithoutPrefix(path) {
|
|
89
|
+
if (!path)
|
|
90
|
+
return [];
|
|
91
|
+
const pathComponents = path
|
|
92
|
+
.split('.')
|
|
93
|
+
.map((key) => (/^[0-9]+$/.test(key) ? Number.parseInt(key, 10) : key));
|
|
94
|
+
return pathComponents;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Prepends the builder's path prefix to the provided path.
|
|
98
|
+
* @param path - The dot-separated path string.
|
|
99
|
+
* @returns The complete reference path as an array.
|
|
100
|
+
*/
|
|
101
|
+
_constructPath(path) {
|
|
102
|
+
if (!path)
|
|
103
|
+
return this.pathPrefix;
|
|
104
|
+
return [...this.pathPrefix, ...this._constructPathWithoutPrefix(path)];
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Constructs a reference path that may be defined directly as a string or indirectly
|
|
108
|
+
* via a context object. If a context object is provided, the function looks up the
|
|
109
|
+
* actual path from the builder's context.
|
|
110
|
+
*
|
|
111
|
+
* @param path - Either a dot-separated string path or an object with a context key.
|
|
112
|
+
* @param expectedEntityType - The entity type expected for this context.
|
|
113
|
+
* @returns The resolved reference path.
|
|
114
|
+
* @throws If the context cannot be found or its type does not match.
|
|
115
|
+
*/
|
|
116
|
+
_constructPathWithContext(path, expectedEntityType) {
|
|
117
|
+
if (typeof path === 'string') {
|
|
118
|
+
return this._constructPath(path);
|
|
119
|
+
}
|
|
120
|
+
// Lookup the context for the given key.
|
|
121
|
+
const pathContext = this.context.pathMap.get(path.context);
|
|
122
|
+
if (!pathContext) {
|
|
123
|
+
throw new Error(`Could not find context for ${path.context} from ${this.pathPrefix.join('.')}`);
|
|
124
|
+
}
|
|
125
|
+
if (pathContext.type !== expectedEntityType) {
|
|
126
|
+
throw new Error(`Attempted to retrieve context for ${path.context} from ${this.pathPrefix.join('.')} expecting ${expectedEntityType.name}, but found ${pathContext.type.name}`);
|
|
127
|
+
}
|
|
128
|
+
return pathContext.path;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Registers a reference based on the provided input definition.
|
|
132
|
+
*
|
|
133
|
+
* Flow:
|
|
134
|
+
* 1. Validate that the parent path is provided if required (and vice versa).
|
|
135
|
+
* 2. Compute the reference path; if the path is empty, use the entire data.
|
|
136
|
+
* 3. If the referenced value is null or undefined, skip adding the reference.
|
|
137
|
+
* 4. Otherwise, add the reference and, if requested, register its context.
|
|
138
|
+
*
|
|
139
|
+
* @param reference - The reference definition.
|
|
140
|
+
* @throws If parent path usage is incorrect.
|
|
141
|
+
*/
|
|
142
|
+
addReference(reference) {
|
|
143
|
+
if (!reference.type.parentType && reference.parentPath) {
|
|
144
|
+
throw new Error(`Parent path does nothing since reference does not have parent`);
|
|
145
|
+
}
|
|
146
|
+
if (reference.type.parentType && !reference.parentPath) {
|
|
147
|
+
throw new Error(`Parent path required if reference type has parent type`);
|
|
148
|
+
}
|
|
149
|
+
// Compute the path without prefix once.
|
|
150
|
+
const refPathWithoutPrefix = this._constructPathWithoutPrefix(reference.path);
|
|
151
|
+
// If the path is empty, use the entire data; otherwise, retrieve the value.
|
|
152
|
+
const refValue = refPathWithoutPrefix.length === 0
|
|
153
|
+
? this.data
|
|
154
|
+
: get(this.data, refPathWithoutPrefix);
|
|
155
|
+
if (refValue === undefined || refValue === null)
|
|
156
|
+
return;
|
|
157
|
+
const fullPath = this._constructPath(reference.path);
|
|
158
|
+
this.references.push({
|
|
159
|
+
type: reference.type,
|
|
160
|
+
path: fullPath,
|
|
161
|
+
parentPath: reference.parentPath &&
|
|
162
|
+
reference.type.parentType &&
|
|
163
|
+
this._constructPathWithContext(reference.parentPath, reference.type.parentType),
|
|
164
|
+
onDelete: reference.onDelete,
|
|
165
|
+
});
|
|
166
|
+
// Optionally, add this path to the shared context.
|
|
167
|
+
if (reference.addContext) {
|
|
168
|
+
this._addPathToContext(fullPath, reference.type, reference.addContext);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Registers an entity based on the provided definition.
|
|
173
|
+
*
|
|
174
|
+
* Flow:
|
|
175
|
+
* 1. Validate that not both a name and a name reference path are provided.
|
|
176
|
+
* 2. Compute the full entity path.
|
|
177
|
+
* 3. Resolve the entity ID:
|
|
178
|
+
* - Use the provided idPath if available; otherwise, default to appending 'id'
|
|
179
|
+
* to the entity path.
|
|
180
|
+
* - If no id is found, generate a new one.
|
|
181
|
+
* 4. Resolve the entity name:
|
|
182
|
+
* - Use the provided resolveName if available; otherwise, default to using the
|
|
183
|
+
* name path.
|
|
184
|
+
* 5. Register the entity in either the direct entities list or the name-ref list.
|
|
185
|
+
* 6. Optionally, add the entity’s id path to the shared context.
|
|
186
|
+
*
|
|
187
|
+
* @param entity - The entity definition.
|
|
188
|
+
* @throws If both name and nameRefPath are provided or if no name is resolved.
|
|
189
|
+
*/
|
|
190
|
+
addEntity(entity) {
|
|
191
|
+
// Build the full path for the entity.
|
|
192
|
+
const path = this._constructPath(entity.path);
|
|
193
|
+
// Resolve the id path: if provided use it; otherwise, assume the id is at "entity.path.id"
|
|
194
|
+
const idPath = entity.idPath
|
|
195
|
+
? this._constructPathWithoutPrefix(entity.idPath)
|
|
196
|
+
: [...this._constructPathWithoutPrefix(entity.path), 'id'];
|
|
197
|
+
// TODO [>=0.9.16] Remove the fallback to generateNewId once a new version is released and manual setter
|
|
198
|
+
const id = get(this.data, idPath) ??
|
|
199
|
+
entity.type.generateNewId();
|
|
200
|
+
if (!get(this.data, idPath)) {
|
|
201
|
+
set(this.data, idPath, id);
|
|
202
|
+
}
|
|
203
|
+
if (!entity.type.isId(id)) {
|
|
204
|
+
throw new Error(`Invalid id: ${id} for entity ${entity.type.name}`);
|
|
205
|
+
}
|
|
206
|
+
// Resolve the name: if getNameResolver is provided, use it to build the name resolver; otherwise,
|
|
207
|
+
// use the default name resolver.
|
|
208
|
+
const getNameResolver = entity.getNameResolver ?? ((value) => get(value, 'name'));
|
|
209
|
+
const nameResolver = getNameResolver(this.data);
|
|
210
|
+
// Base entity definition shared between regular entities and those with a name reference.
|
|
211
|
+
const entityBase = {
|
|
212
|
+
id,
|
|
213
|
+
type: entity.type,
|
|
214
|
+
path,
|
|
215
|
+
idPath: [...this.pathPrefix, ...idPath],
|
|
216
|
+
parentPath: entity.parentPath &&
|
|
217
|
+
entity.type.parentType &&
|
|
218
|
+
this._constructPathWithContext(entity.parentPath, entity.type.parentType),
|
|
219
|
+
};
|
|
220
|
+
this.entitiesWithNameResolver.push({
|
|
221
|
+
...entityBase,
|
|
222
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- needed to allow more specific generic typed to be put in here
|
|
223
|
+
nameResolver: typeof nameResolver === 'string'
|
|
224
|
+
? { resolveName: () => nameResolver }
|
|
225
|
+
: nameResolver,
|
|
226
|
+
});
|
|
227
|
+
// Optionally add the id path to the context.
|
|
228
|
+
if (entity.addContext) {
|
|
229
|
+
this._addPathToContext([...this.pathPrefix, ...idPath], entity.type, entity.addContext);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Registers a given path into the builder's context map.
|
|
234
|
+
* @param path - The full reference path.
|
|
235
|
+
* @param type - The entity type associated with the path.
|
|
236
|
+
* @param context - A unique key to identify this context.
|
|
237
|
+
* @throws If the context key is already registered.
|
|
238
|
+
*/
|
|
239
|
+
_addPathToContext(path, type, context) {
|
|
240
|
+
if (this.pathMap.has(context)) {
|
|
241
|
+
throw new Error(`Context path already defined for ${context} at ${this.pathPrefix.join('.')}`);
|
|
242
|
+
}
|
|
243
|
+
this.pathMap.set(context, { path, type });
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Convenience method that builds a full path from a dot-separated string and
|
|
247
|
+
* adds it to the context.
|
|
248
|
+
* @param path - The dot-separated string path.
|
|
249
|
+
* @param type - The entity type.
|
|
250
|
+
* @param context - The context key.
|
|
251
|
+
*/
|
|
252
|
+
addPathToContext(path, type, context) {
|
|
253
|
+
this._addPathToContext(this._constructPath(path), type, context);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Unique symbol used to store ZodRef context in the parent’s common context.
|
|
258
|
+
*/
|
|
259
|
+
const zodRefSymbol = Symbol('zod-ref');
|
|
260
|
+
/**
|
|
261
|
+
* ZodRef wraps an inner Zod type and enhances it with the ability to register
|
|
262
|
+
* and process entity references. During parsing, it delegates to a builder (if present)
|
|
263
|
+
* to collect references and entities before delegating to the inner type.
|
|
264
|
+
*
|
|
265
|
+
* @template T - The inner Zod type.
|
|
266
|
+
*/
|
|
267
|
+
export class ZodRef extends ZodType {
|
|
268
|
+
/**
|
|
269
|
+
* The core parse method that:
|
|
270
|
+
* 1. Retrieves (or creates) the builder context from the parent.
|
|
271
|
+
* 2. Runs the builder function (if present) to register references/entities.
|
|
272
|
+
* 3. Delegates parsing to the inner type.
|
|
273
|
+
* 4. Transforms the output to replace entity id placeholders with generated ids.
|
|
274
|
+
*
|
|
275
|
+
* @param input - The Zod parse input.
|
|
276
|
+
* @returns The parse result.
|
|
277
|
+
*/
|
|
278
|
+
_parse(input) {
|
|
279
|
+
const context = input.parent.common;
|
|
280
|
+
// If no builder context or builder function exists, simply parse using the inner type.
|
|
281
|
+
const zodRefContext = context[zodRefSymbol];
|
|
282
|
+
if (!zodRefContext || !this._def.builder) {
|
|
283
|
+
return this._def.innerType._parse(input);
|
|
284
|
+
}
|
|
285
|
+
// Create a new builder instance for the current parsing context.
|
|
286
|
+
const builder = new ZodRefBuilder(input.path, zodRefContext.context, input.data);
|
|
287
|
+
// Execute the builder function to register references/entities.
|
|
288
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
289
|
+
this._def.builder(builder, input.data);
|
|
290
|
+
zodRefContext.references.push(...builder.references);
|
|
291
|
+
zodRefContext.entitiesWithNameResolver.push(...builder.entitiesWithNameResolver);
|
|
292
|
+
// Re-parse using the inner type but merge the updated context.
|
|
293
|
+
const parseOutput = this._def.innerType._parse({
|
|
294
|
+
...input,
|
|
295
|
+
path: input.path,
|
|
296
|
+
parent: {
|
|
297
|
+
...input.parent,
|
|
298
|
+
common: {
|
|
299
|
+
...input.parent.common,
|
|
300
|
+
[zodRefSymbol]: {
|
|
301
|
+
...zodRefContext,
|
|
302
|
+
context: {
|
|
303
|
+
...zodRefContext.context,
|
|
304
|
+
// Merge new context entries from the builder.
|
|
305
|
+
pathMap: new Map([
|
|
306
|
+
...zodRefContext.context.pathMap,
|
|
307
|
+
...builder.pathMap,
|
|
308
|
+
]),
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
});
|
|
314
|
+
/**
|
|
315
|
+
* Transforms the output of the inner parse by iterating through all registered
|
|
316
|
+
* entities and assigning the id to the corresponding path in the output in case
|
|
317
|
+
* it was generated by the builder.
|
|
318
|
+
*
|
|
319
|
+
* @param output - The result from the inner parse.
|
|
320
|
+
* @returns The transformed parse output.
|
|
321
|
+
*/
|
|
322
|
+
function transformParseOutput(output) {
|
|
323
|
+
if (output.status === 'aborted')
|
|
324
|
+
return output;
|
|
325
|
+
// For each entity, assign the id to the corresponding path in the output
|
|
326
|
+
// in the event that it was generated by the builder.
|
|
327
|
+
for (const entity of builder.entitiesWithNameResolver) {
|
|
328
|
+
set(output.value, entity.idPath.slice(input.path.length), entity.id);
|
|
329
|
+
}
|
|
330
|
+
return output;
|
|
331
|
+
}
|
|
332
|
+
// If the parse result is a Promise, attach the transformation asynchronously.
|
|
333
|
+
if (isPromise(parseOutput)) {
|
|
334
|
+
return parseOutput.then(transformParseOutput);
|
|
335
|
+
}
|
|
336
|
+
return transformParseOutput(parseOutput);
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Returns the inner Zod type.
|
|
340
|
+
* @returns The wrapped inner Zod type.
|
|
341
|
+
*/
|
|
342
|
+
innerType() {
|
|
343
|
+
return this._def.innerType;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Adds an entity registration to the current ZodRef.
|
|
347
|
+
*
|
|
348
|
+
* @param entity - Either an entity definition or a function that returns one.
|
|
349
|
+
* @returns A new ZodRef instance with the entity registration added.
|
|
350
|
+
*/
|
|
351
|
+
addEntity(entity) {
|
|
352
|
+
return ZodRef.create(this, (builder, data) => {
|
|
353
|
+
builder.addEntity(typeof entity === 'function' ? entity(data) : entity);
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Adds a reference registration to the current ZodRef.
|
|
358
|
+
*
|
|
359
|
+
* @param reference - Either a reference definition or a function that returns one.
|
|
360
|
+
* @returns A new ZodRef instance with the reference registration added.
|
|
361
|
+
*/
|
|
362
|
+
addReference(reference) {
|
|
363
|
+
return ZodRef.create(this, (builder, data) => {
|
|
364
|
+
builder.addReference(typeof reference === 'function' ? reference(data) : reference);
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Applies a custom builder function to the ZodRef.
|
|
369
|
+
* @param builder - The builder function that registers additional references/entities.
|
|
370
|
+
* @returns A new ZodRef instance with the builder applied.
|
|
371
|
+
*/
|
|
372
|
+
refBuilder(builder) {
|
|
373
|
+
return ZodRef.create(this, builder);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Creates a new ZodRef instance wrapping a given Zod type with an optional builder.
|
|
378
|
+
* @param type - The inner Zod type.
|
|
379
|
+
* @param builder - Optional builder function to register references/entities.
|
|
380
|
+
* @returns A new ZodRef instance.
|
|
381
|
+
*/
|
|
382
|
+
Object.defineProperty(ZodRef, "create", {
|
|
383
|
+
enumerable: true,
|
|
384
|
+
configurable: true,
|
|
385
|
+
writable: true,
|
|
386
|
+
value: (type, builder) => new ZodRef({
|
|
387
|
+
innerType: type,
|
|
388
|
+
builder,
|
|
389
|
+
})
|
|
390
|
+
});
|
|
391
|
+
/**
|
|
392
|
+
* Convenience function for creating a ZodRef using a schema and an optional builder.
|
|
393
|
+
* @param schema - The base Zod schema.
|
|
394
|
+
* @param builder - Optional builder function.
|
|
395
|
+
* @returns A new ZodRef instance.
|
|
396
|
+
*/
|
|
397
|
+
export function zRefBuilder(schema, builder) {
|
|
398
|
+
return ZodRef.create(schema, builder);
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Convenience function for creating a ZodRef with a reference added.
|
|
402
|
+
* @param schema - The base Zod schema.
|
|
403
|
+
* @param reference - Either a reference definition or a function returning one.
|
|
404
|
+
* @returns A new ZodRef instance with the reference registration.
|
|
405
|
+
*/
|
|
406
|
+
export function zRef(schema, reference) {
|
|
407
|
+
return ZodRef.create(schema).addReference(reference);
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Convenience function for creating a ZodRef that registers an entity.
|
|
411
|
+
* This function also sets the id key on the schema using zRefId.
|
|
412
|
+
*
|
|
413
|
+
* @template TObject - The Zod object type.
|
|
414
|
+
* @template TEntityType - The entity type.
|
|
415
|
+
* @template TPath - The path type.
|
|
416
|
+
* @param schema - The base Zod object schema.
|
|
417
|
+
* @param entity - Either an entity definition or a function returning one.
|
|
418
|
+
* @returns A new ZodRef instance with the entity registration.
|
|
419
|
+
*/
|
|
420
|
+
export function zEnt(schema, entity) {
|
|
421
|
+
// Set the "id" key on the schema using zRefId and then register the entity.
|
|
422
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-explicit-any
|
|
423
|
+
return ZodRef.create(schema.setKey('id', zRefId)).addEntity(entity);
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* ZodRefWrapper is used for initializing parsing that collects references and entities.
|
|
427
|
+
*
|
|
428
|
+
* @template T - The inner Zod type.
|
|
429
|
+
*/
|
|
430
|
+
export class ZodRefWrapper extends ZodType {
|
|
431
|
+
/**
|
|
432
|
+
* Core parse method that:
|
|
433
|
+
* 1. Initializes a fresh reference context.
|
|
434
|
+
* 2. Parses using the inner type while injecting the context.
|
|
435
|
+
* 3. Returns a payload containing the parsed data, along with references and entities.
|
|
436
|
+
*
|
|
437
|
+
* @param input - The parse input.
|
|
438
|
+
* @returns The parsed payload.
|
|
439
|
+
*/
|
|
440
|
+
_parse(input) {
|
|
441
|
+
// Initialize the reference context.
|
|
442
|
+
const refContext = {
|
|
443
|
+
context: {
|
|
444
|
+
pathMap: new Map(),
|
|
445
|
+
},
|
|
446
|
+
references: [],
|
|
447
|
+
entitiesWithNameResolver: [],
|
|
448
|
+
};
|
|
449
|
+
// Inject the refContext into the parent's common context and parse the inner type.
|
|
450
|
+
const parseOutput = this._def.innerType._parse({
|
|
451
|
+
...input,
|
|
452
|
+
parent: {
|
|
453
|
+
...input.parent,
|
|
454
|
+
common: {
|
|
455
|
+
...input.parent.common,
|
|
456
|
+
[zodRefSymbol]: refContext,
|
|
457
|
+
},
|
|
458
|
+
},
|
|
459
|
+
});
|
|
460
|
+
function transformParseOutput(output) {
|
|
461
|
+
if (output.status === 'aborted')
|
|
462
|
+
return output;
|
|
463
|
+
return {
|
|
464
|
+
...output,
|
|
465
|
+
value: {
|
|
466
|
+
data: output.value,
|
|
467
|
+
entitiesWithNameResolver: refContext.entitiesWithNameResolver,
|
|
468
|
+
references: refContext.references,
|
|
469
|
+
},
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
if (isPromise(parseOutput)) {
|
|
473
|
+
return parseOutput.then(transformParseOutput);
|
|
474
|
+
}
|
|
475
|
+
return transformParseOutput(parseOutput);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Creates a new ZodRefWrapper instance.
|
|
480
|
+
* @param type - The inner Zod type.
|
|
481
|
+
* @param options - Options for the ZodRefWrapper.
|
|
482
|
+
* @param options.skipReferenceNameResolution - Flag to skip resolving references to names (serialized definitions use resolved name references).
|
|
483
|
+
* @param options.allowInvalidReferences - Flag to allow invalid references (used for testing deletes).
|
|
484
|
+
* @returns A new instance of ZodRefWrapper.
|
|
485
|
+
*/
|
|
486
|
+
Object.defineProperty(ZodRefWrapper, "create", {
|
|
487
|
+
enumerable: true,
|
|
488
|
+
configurable: true,
|
|
489
|
+
writable: true,
|
|
490
|
+
value: (type) => new ZodRefWrapper({
|
|
491
|
+
innerType: type,
|
|
492
|
+
})
|
|
493
|
+
});
|
|
494
|
+
//# sourceMappingURL=ref-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ref-builder.js","sourceRoot":"","sources":["../../src/references/ref-builder.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AASjC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAExC;;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AS,oBAAoB,CAC3B,MAAoC;YAEpC,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS;gBAAE,OAAO,MAAM,CAAC;YAE/C,OAAO;gBACL,GAAG,MAAM;gBACT,KAAK,EAAE;oBACL,IAAI,EAAE,MAAM,CAAC,KAAK;oBAClB,wBAAwB,EAAE,UAAU,CAAC,wBAAwB;oBAC7D,UAAU,EAAE,UAAU,CAAC,UAAU;iBAClC;aACF,CAAC;QACJ,CAAC;QAED,IAAI,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC;YAC3B,OAAO,WAAW,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAChD,CAAC;QAED,OAAO,oBAAoB,CAAC,WAAW,CAAC,CAAC;IAC3C,CAAC;;AAED;;;;;;;GAOG;AACI;;;;WAAS,CAAuB,IAAO,EAAoB,EAAE,CAClE,IAAI,aAAa,CAAI;QACnB,SAAS,EAAE,IAAI;KAChB,CAAC;GAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ZodRefPayload } from './ref-builder.js';
|
|
2
|
+
import type { ResolvedZodRefPayload } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Options for resolving entity names in a ZodRefPayload.
|
|
5
|
+
*/
|
|
6
|
+
export interface ResolveZodRefPayloadNamesOptions {
|
|
7
|
+
/**
|
|
8
|
+
* If true, skip reference name resolution. (Used when we are deserializing since
|
|
9
|
+
* the references are already resolved to names)
|
|
10
|
+
*/
|
|
11
|
+
skipReferenceNameResolution?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* If true, allow invalid references. (Used for testing deletes)
|
|
14
|
+
*/
|
|
15
|
+
allowInvalidReferences?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Resolves entity names in a ZodRefPayload.
|
|
19
|
+
*
|
|
20
|
+
* @param payload - The ZodRefPayload to resolve.
|
|
21
|
+
* @param options - The options for resolving entity names.
|
|
22
|
+
*
|
|
23
|
+
* @template T - The type of the payload.
|
|
24
|
+
*/
|
|
25
|
+
export declare function resolveZodRefPayloadNames<T>(payload: ZodRefPayload<T>, { skipReferenceNameResolution, allowInvalidReferences, }?: ResolveZodRefPayloadNamesOptions): ResolvedZodRefPayload<T>;
|
|
26
|
+
//# sourceMappingURL=resolve-zod-ref-payload-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-zod-ref-payload-names.d.ts","sourceRoot":"","sources":["../../src/references/resolve-zod-ref-payload-names.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAoB,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C;;;OAGG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC;;OAEG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EACzC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,EACzB,EACE,2BAAmC,EACnC,sBAA8B,GAC/B,GAAE,gCAAqC,GACvC,qBAAqB,CAAC,CAAC,CAAC,CAgD1B"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { toposort } from '@baseplate-dev/utils';
|
|
2
|
+
import { keyBy, mapValues } from 'es-toolkit';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves entity names in a ZodRefPayload.
|
|
5
|
+
*
|
|
6
|
+
* @param payload - The ZodRefPayload to resolve.
|
|
7
|
+
* @param options - The options for resolving entity names.
|
|
8
|
+
*
|
|
9
|
+
* @template T - The type of the payload.
|
|
10
|
+
*/
|
|
11
|
+
export function resolveZodRefPayloadNames(payload, { skipReferenceNameResolution = false, allowInvalidReferences = false, } = {}) {
|
|
12
|
+
const { entitiesWithNameResolver, references, data } = payload;
|
|
13
|
+
const entitiesById = keyBy(entitiesWithNameResolver, (entity) => entity.id);
|
|
14
|
+
const resolvedEntitiesById = new Map();
|
|
15
|
+
// sort entities by dependency order
|
|
16
|
+
const orderedEntities = toposort(entitiesWithNameResolver.map((entity) => entity.id), entitiesWithNameResolver.flatMap((entity) => {
|
|
17
|
+
const entityIds = entity.nameResolver.idsToResolve ?? {};
|
|
18
|
+
return Object.values(entityIds)
|
|
19
|
+
.flat()
|
|
20
|
+
.filter((id) => id in entitiesById)
|
|
21
|
+
.map((id) => [id, entity.id]);
|
|
22
|
+
}));
|
|
23
|
+
function resolveIdToName(id) {
|
|
24
|
+
if (skipReferenceNameResolution) {
|
|
25
|
+
return id;
|
|
26
|
+
}
|
|
27
|
+
const entity = resolvedEntitiesById.get(id);
|
|
28
|
+
if (!entity) {
|
|
29
|
+
if (allowInvalidReferences) {
|
|
30
|
+
return id;
|
|
31
|
+
}
|
|
32
|
+
throw new Error(`Could not resolve entity name for id: ${id}`);
|
|
33
|
+
}
|
|
34
|
+
return entity.name;
|
|
35
|
+
}
|
|
36
|
+
for (const id of orderedEntities) {
|
|
37
|
+
const { nameResolver, ...rest } = entitiesById[id];
|
|
38
|
+
const resolvedIds = mapValues(nameResolver.idsToResolve ?? {}, (idOrIds) => Array.isArray(idOrIds)
|
|
39
|
+
? idOrIds.map((id) => resolveIdToName(id))
|
|
40
|
+
: resolveIdToName(idOrIds));
|
|
41
|
+
resolvedEntitiesById.set(rest.id, {
|
|
42
|
+
...rest,
|
|
43
|
+
name: nameResolver.resolveName(resolvedIds),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
entities: [...resolvedEntitiesById.values()],
|
|
48
|
+
references,
|
|
49
|
+
data,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=resolve-zod-ref-payload-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-zod-ref-payload-names.js","sourceRoot":"","sources":["../../src/references/resolve-zod-ref-payload-names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AAC;YACZ,IAAI,sBAAsB,EAAE,CAAC;gBAC3B,OAAO,EAAE,CAAC;YACZ,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,yCAAyC,EAAE,EAAE,CAAC,CAAC;QACjE,CAAC;QACD,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,KAAK,MAAM,EAAE,IAAI,eAAe,EAAE,CAAC;QACjC,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,GAAG,YAAY,CAAC,EAAE,CAAC,CAAC;QACnD,MAAM,WAAW,GAAG,SAAS,CAAC,YAAY,CAAC,YAAY,IAAI,EAAE,EAAE,CAAC,OAAO,EAAE,EAAE,CACzE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;YACpB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;YAC1C,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAC7B,CAAC;QACF,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE;YAChC,GAAG,IAAI;YACP,IAAI,EAAE,YAAY,CAAC,WAAW,CAAC,WAAW,CAAC;SAC5C,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,CAAC,GAAG,oBAAoB,CAAC,MAAM,EAAE,CAAC;QAC5C,UAAU;QACV,IAAI;KACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TypeOf, z } from 'zod';
|
|
2
|
+
import type { ResolvedZodRefPayload } from './types.js';
|
|
3
|
+
export declare function serializeSchemaFromRefPayload<TValue extends Record<string, unknown>>(payload: ResolvedZodRefPayload<TValue>): TValue;
|
|
4
|
+
export declare function serializeSchema<TSchema extends z.ZodType>(schema: TSchema, value: TypeOf<TSchema>): TypeOf<TSchema>;
|
|
5
|
+
//# sourceMappingURL=serialize-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize-schema.d.ts","sourceRoot":"","sources":["../../src/references/serialize-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKrC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAIxD,wBAAgB,6BAA6B,CAC3C,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACtC,OAAO,EAAE,qBAAqB,CAAC,MAAM,CAAC,GAAG,MAAM,CAmBhD;AAED,wBAAgB,eAAe,CAAC,OAAO,SAAS,CAAC,CAAC,OAAO,EACvD,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,GACrB,MAAM,CAAC,OAAO,CAAC,CAIjB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { get, set } from 'es-toolkit/compat';
|
|
2
|
+
import { produce } from 'immer';
|
|
3
|
+
import { parseSchemaWithReferences } from './parse-schema-with-references.js';
|
|
4
|
+
export function serializeSchemaFromRefPayload(payload) {
|
|
5
|
+
const { references, entities, data } = payload;
|
|
6
|
+
const entitiesById = new Map(entities.map((e) => [e.id, e]));
|
|
7
|
+
return produce((draftData) => {
|
|
8
|
+
for (const reference of references) {
|
|
9
|
+
const entityId = get(draftData, reference.path);
|
|
10
|
+
const entity = entitiesById.get(entityId);
|
|
11
|
+
if (!entity) {
|
|
12
|
+
throw new Error(`Could not find entity with ID: ${entityId} at ${reference.path.join('.')}`);
|
|
13
|
+
}
|
|
14
|
+
set(draftData, reference.path, entity.name);
|
|
15
|
+
}
|
|
16
|
+
})(data);
|
|
17
|
+
}
|
|
18
|
+
export function serializeSchema(schema, value) {
|
|
19
|
+
const payload = parseSchemaWithReferences(schema, value);
|
|
20
|
+
return serializeSchemaFromRefPayload(payload);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=serialize-schema.js.map
|
|
@@ -0,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