@baseplate-dev/project-builder-lib 0.5.3 → 0.6.0
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/CHANGELOG.md +60 -0
- package/dist/definition/index.d.ts +0 -1
- package/dist/definition/index.d.ts.map +1 -1
- package/dist/definition/index.js +0 -1
- package/dist/definition/index.js.map +1 -1
- package/dist/definition/model/model-field-utils.js +2 -2
- package/dist/definition/model/model-field-utils.js.map +1 -1
- package/dist/definition/model/model-utils.d.ts.map +1 -1
- package/dist/definition/model/model-utils.js +2 -2
- package/dist/definition/model/model-utils.js.map +1 -1
- package/dist/definition/project-definition-container.d.ts +21 -12
- package/dist/definition/project-definition-container.d.ts.map +1 -1
- package/dist/definition/project-definition-container.js +42 -23
- package/dist/definition/project-definition-container.js.map +1 -1
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +6 -0
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/migration-024-graphql-object-type-field-auth.d.ts +30 -0
- package/dist/migrations/migration-024-graphql-object-type-field-auth.d.ts.map +1 -0
- package/dist/migrations/migration-024-graphql-object-type-field-auth.js +54 -0
- package/dist/migrations/migration-024-graphql-object-type-field-auth.js.map +1 -0
- package/dist/migrations/migration-025-service-method-auth.d.ts +44 -0
- package/dist/migrations/migration-025-service-method-auth.d.ts.map +1 -0
- package/dist/migrations/migration-025-service-method-auth.js +62 -0
- package/dist/migrations/migration-025-service-method-auth.js.map +1 -0
- package/dist/migrations/migration-026-query-shared-roles.d.ts +32 -0
- package/dist/migrations/migration-026-query-shared-roles.d.ts.map +1 -0
- package/dist/migrations/migration-026-query-shared-roles.js +48 -0
- package/dist/migrations/migration-026-query-shared-roles.js.map +1 -0
- package/dist/parser/apply-definition-fixes.d.ts +13 -0
- package/dist/parser/apply-definition-fixes.d.ts.map +1 -0
- package/dist/parser/apply-definition-fixes.js +25 -0
- package/dist/parser/apply-definition-fixes.js.map +1 -0
- package/dist/parser/clean-default-values.d.ts +14 -0
- package/dist/parser/clean-default-values.d.ts.map +1 -0
- package/dist/parser/clean-default-values.js +24 -0
- package/dist/parser/clean-default-values.js.map +1 -0
- package/dist/parser/collect-definition-issues.d.ts +36 -0
- package/dist/parser/collect-definition-issues.d.ts.map +1 -0
- package/dist/parser/collect-definition-issues.js +94 -0
- package/dist/parser/collect-definition-issues.js.map +1 -0
- package/dist/parser/collect-expression-issues.d.ts +17 -0
- package/dist/parser/collect-expression-issues.d.ts.map +1 -0
- package/dist/parser/collect-expression-issues.js +33 -0
- package/dist/parser/collect-expression-issues.js.map +1 -0
- package/dist/parser/definition-issue-checkers/mutation-roles-checker.d.ts +11 -0
- package/dist/parser/definition-issue-checkers/mutation-roles-checker.d.ts.map +1 -0
- package/dist/parser/definition-issue-checkers/mutation-roles-checker.js +41 -0
- package/dist/parser/definition-issue-checkers/mutation-roles-checker.js.map +1 -0
- package/dist/parser/definition-issue-checkers/relation-type-mismatch-checker.d.ts +10 -0
- package/dist/parser/definition-issue-checkers/relation-type-mismatch-checker.d.ts.map +1 -0
- package/dist/parser/definition-issue-checkers/relation-type-mismatch-checker.js +36 -0
- package/dist/parser/definition-issue-checkers/relation-type-mismatch-checker.js.map +1 -0
- package/dist/parser/definition-issue-utils.d.ts +23 -0
- package/dist/parser/definition-issue-utils.d.ts.map +1 -0
- package/dist/parser/definition-issue-utils.js +33 -0
- package/dist/parser/definition-issue-utils.js.map +1 -0
- package/dist/parser/index.d.ts +9 -0
- package/dist/parser/index.d.ts.map +1 -1
- package/dist/parser/index.js +8 -0
- package/dist/parser/index.js.map +1 -1
- package/dist/parser/parser.d.ts.map +1 -1
- package/dist/parser/parser.js +7 -2
- package/dist/parser/parser.js.map +1 -1
- package/dist/parser/schema-structure.d.ts +53 -0
- package/dist/parser/schema-structure.d.ts.map +1 -0
- package/dist/parser/schema-structure.js +171 -0
- package/dist/parser/schema-structure.js.map +1 -0
- package/dist/parser/transform-data-with-schema.d.ts +35 -0
- package/dist/parser/transform-data-with-schema.d.ts.map +1 -0
- package/dist/parser/transform-data-with-schema.js +140 -0
- package/dist/parser/transform-data-with-schema.js.map +1 -0
- package/dist/parser/types.d.ts +6 -3
- package/dist/parser/types.d.ts.map +1 -1
- package/dist/parser/walk-data-with-schema.d.ts +46 -0
- package/dist/parser/walk-data-with-schema.d.ts.map +1 -0
- package/dist/parser/walk-data-with-schema.js +140 -0
- package/dist/parser/walk-data-with-schema.js.map +1 -0
- package/dist/parser/walk-schema-structure.d.ts +60 -0
- package/dist/parser/walk-schema-structure.d.ts.map +1 -0
- package/dist/parser/walk-schema-structure.js +163 -0
- package/dist/parser/walk-schema-structure.js.map +1 -0
- package/dist/plugins/imports/loader.d.ts +1 -1
- package/dist/plugins/imports/loader.d.ts.map +1 -1
- package/dist/plugins/imports/loader.js +2 -2
- package/dist/plugins/imports/loader.js.map +1 -1
- package/dist/plugins/imports/types.d.ts +1 -1
- package/dist/plugins/imports/types.d.ts.map +1 -1
- package/dist/plugins/metadata/types.d.ts +1 -1
- package/dist/plugins/metadata/types.js +1 -1
- package/dist/plugins/plugins.test-utils.d.ts +15 -0
- package/dist/plugins/plugins.test-utils.d.ts.map +1 -1
- package/dist/plugins/plugins.test-utils.js +24 -0
- package/dist/plugins/plugins.test-utils.js.map +1 -1
- package/dist/plugins/spec/config-spec.d.ts +1 -0
- package/dist/plugins/spec/config-spec.d.ts.map +1 -1
- package/dist/plugins/spec/config-spec.js +1 -0
- package/dist/plugins/spec/config-spec.js.map +1 -1
- package/dist/plugins/store/store.d.ts +6 -1
- package/dist/plugins/store/store.d.ts.map +1 -1
- package/dist/plugins/store/store.js +9 -1
- package/dist/plugins/store/store.js.map +1 -1
- package/dist/references/definition-ref-registry.d.ts +105 -0
- package/dist/references/definition-ref-registry.d.ts.map +1 -0
- package/dist/references/definition-ref-registry.js +40 -0
- package/dist/references/definition-ref-registry.js.map +1 -0
- package/dist/references/deserialize-schema.d.ts +4 -6
- package/dist/references/deserialize-schema.d.ts.map +1 -1
- package/dist/references/deserialize-schema.js +4 -5
- package/dist/references/deserialize-schema.js.map +1 -1
- package/dist/references/expression-types.d.ts +46 -14
- package/dist/references/expression-types.d.ts.map +1 -1
- package/dist/references/expression-types.js +17 -0
- package/dist/references/expression-types.js.map +1 -1
- package/dist/references/extend-parser-context-with-refs.d.ts +32 -2
- package/dist/references/extend-parser-context-with-refs.d.ts.map +1 -1
- package/dist/references/extend-parser-context-with-refs.js +123 -163
- package/dist/references/extend-parser-context-with-refs.js.map +1 -1
- package/dist/references/extract-definition-refs.d.ts +9 -8
- package/dist/references/extract-definition-refs.d.ts.map +1 -1
- package/dist/references/extract-definition-refs.js +110 -26
- package/dist/references/extract-definition-refs.js.map +1 -1
- package/dist/references/fix-ref-deletions.d.ts +6 -6
- package/dist/references/fix-ref-deletions.d.ts.map +1 -1
- package/dist/references/fix-ref-deletions.js +2 -2
- package/dist/references/fix-ref-deletions.js.map +1 -1
- package/dist/references/index.d.ts +3 -0
- package/dist/references/index.d.ts.map +1 -1
- package/dist/references/index.js +3 -0
- package/dist/references/index.js.map +1 -1
- package/dist/references/parse-schema-with-references.d.ts +8 -6
- package/dist/references/parse-schema-with-references.d.ts.map +1 -1
- package/dist/references/parse-schema-with-references.js +10 -12
- package/dist/references/parse-schema-with-references.js.map +1 -1
- package/dist/references/ref-schema-visitor.d.ts +33 -0
- package/dist/references/ref-schema-visitor.d.ts.map +1 -0
- package/dist/references/ref-schema-visitor.js +61 -0
- package/dist/references/ref-schema-visitor.js.map +1 -0
- package/dist/references/resolve-slots.d.ts +1 -1
- package/dist/references/resolve-slots.d.ts.map +1 -1
- package/dist/references/serialize-schema.d.ts +9 -2
- package/dist/references/serialize-schema.d.ts.map +1 -1
- package/dist/references/serialize-schema.js +20 -4
- package/dist/references/serialize-schema.js.map +1 -1
- package/dist/schema/apps/web/admin/admin.d.ts +22 -37
- package/dist/schema/apps/web/admin/admin.d.ts.map +1 -1
- package/dist/schema/apps/web/admin/sections/crud-actions/admin-crud-action.d.ts +6 -15
- package/dist/schema/apps/web/admin/sections/crud-actions/admin-crud-action.d.ts.map +1 -1
- package/dist/schema/apps/web/admin/sections/crud-actions/admin-crud-action.js +3 -8
- package/dist/schema/apps/web/admin/sections/crud-actions/admin-crud-action.js.map +1 -1
- package/dist/schema/apps/web/admin/sections/crud-columns/admin-crud-column.d.ts +6 -15
- package/dist/schema/apps/web/admin/sections/crud-columns/admin-crud-column.d.ts.map +1 -1
- package/dist/schema/apps/web/admin/sections/crud-columns/admin-crud-column.js +3 -8
- package/dist/schema/apps/web/admin/sections/crud-columns/admin-crud-column.js.map +1 -1
- package/dist/schema/apps/web/admin/sections/crud-form/admin-crud-input.d.ts +9 -15
- package/dist/schema/apps/web/admin/sections/crud-form/admin-crud-input.d.ts.map +1 -1
- package/dist/schema/apps/web/admin/sections/crud-form/admin-crud-input.js +3 -8
- package/dist/schema/apps/web/admin/sections/crud-form/admin-crud-input.js.map +1 -1
- package/dist/schema/apps/web/admin/sections/crud.d.ts +6 -6
- package/dist/schema/apps/web/web-app.d.ts +32 -47
- package/dist/schema/apps/web/web-app.d.ts.map +1 -1
- package/dist/schema/creator/definition-default-registry.d.ts +22 -0
- package/dist/schema/creator/definition-default-registry.d.ts.map +1 -0
- package/dist/schema/creator/definition-default-registry.js +18 -0
- package/dist/schema/creator/definition-default-registry.js.map +1 -0
- package/dist/schema/creator/definition-fix-registry.d.ts +45 -0
- package/dist/schema/creator/definition-fix-registry.d.ts.map +1 -0
- package/dist/schema/creator/definition-fix-registry.js +41 -0
- package/dist/schema/creator/definition-fix-registry.js.map +1 -0
- package/dist/schema/creator/definition-issue-checker-spec.d.ts +37 -0
- package/dist/schema/creator/definition-issue-checker-spec.d.ts.map +1 -0
- package/dist/schema/creator/definition-issue-checker-spec.js +28 -0
- package/dist/schema/creator/definition-issue-checker-spec.js.map +1 -0
- package/dist/schema/creator/definition-issue-checkers.d.ts +16 -0
- package/dist/schema/creator/definition-issue-checkers.d.ts.map +1 -0
- package/dist/schema/creator/definition-issue-checkers.js +35 -0
- package/dist/schema/creator/definition-issue-checkers.js.map +1 -0
- package/dist/schema/creator/definition-issue-registry.d.ts +54 -0
- package/dist/schema/creator/definition-issue-registry.d.ts.map +1 -0
- package/dist/schema/creator/definition-issue-registry.js +47 -0
- package/dist/schema/creator/definition-issue-registry.js.map +1 -0
- package/dist/schema/creator/definition-issue-types.d.ts +53 -0
- package/dist/schema/creator/definition-issue-types.d.ts.map +1 -0
- package/dist/schema/creator/definition-issue-types.js +2 -0
- package/dist/schema/creator/definition-issue-types.js.map +1 -0
- package/dist/schema/creator/extend-parser-context-with-defaults.d.ts +20 -4
- package/dist/schema/creator/extend-parser-context-with-defaults.d.ts.map +1 -1
- package/dist/schema/creator/extend-parser-context-with-defaults.js +24 -42
- package/dist/schema/creator/extend-parser-context-with-defaults.js.map +1 -1
- package/dist/schema/creator/index.d.ts +6 -0
- package/dist/schema/creator/index.d.ts.map +1 -1
- package/dist/schema/creator/index.js +5 -0
- package/dist/schema/creator/index.js.map +1 -1
- package/dist/schema/creator/schema-creator.d.ts.map +1 -1
- package/dist/schema/creator/schema-creator.js +18 -4
- package/dist/schema/creator/schema-creator.js.map +1 -1
- package/dist/schema/creator/types.d.ts +3 -30
- package/dist/schema/creator/types.d.ts.map +1 -1
- package/dist/schema/models/authorizer/authorizer-expression-acorn-parser.d.ts.map +1 -1
- package/dist/schema/models/authorizer/authorizer-expression-acorn-parser.js +116 -25
- package/dist/schema/models/authorizer/authorizer-expression-acorn-parser.js.map +1 -1
- package/dist/schema/models/authorizer/authorizer-expression-ast.d.ts +82 -1
- package/dist/schema/models/authorizer/authorizer-expression-ast.d.ts.map +1 -1
- package/dist/schema/models/authorizer/authorizer-expression-ast.js.map +1 -1
- package/dist/schema/models/authorizer/authorizer-expression-parser.d.ts +8 -9
- package/dist/schema/models/authorizer/authorizer-expression-parser.d.ts.map +1 -1
- package/dist/schema/models/authorizer/authorizer-expression-parser.js +28 -35
- package/dist/schema/models/authorizer/authorizer-expression-parser.js.map +1 -1
- package/dist/schema/models/authorizer/authorizer-expression-validator.d.ts +42 -4
- package/dist/schema/models/authorizer/authorizer-expression-validator.d.ts.map +1 -1
- package/dist/schema/models/authorizer/authorizer-expression-validator.js +119 -18
- package/dist/schema/models/authorizer/authorizer-expression-validator.js.map +1 -1
- package/dist/schema/models/graphql.d.ts +42 -111
- package/dist/schema/models/graphql.d.ts.map +1 -1
- package/dist/schema/models/graphql.js +59 -19
- package/dist/schema/models/graphql.js.map +1 -1
- package/dist/schema/models/models.d.ts +1134 -343
- package/dist/schema/models/models.d.ts.map +1 -1
- package/dist/schema/models/models.js +258 -86
- package/dist/schema/models/models.js.map +1 -1
- package/dist/schema/plugins/definition.d.ts +2 -30
- package/dist/schema/plugins/definition.d.ts.map +1 -1
- package/dist/schema/plugins/definition.js +26 -15
- package/dist/schema/plugins/definition.js.map +1 -1
- package/dist/schema/project-definition.d.ts +532 -186
- package/dist/schema/project-definition.d.ts.map +1 -1
- package/dist/schema/project-definition.js +15 -3
- package/dist/schema/project-definition.js.map +1 -1
- package/dist/schema/settings/general.d.ts +1 -1
- package/dist/schema/settings/general.d.ts.map +1 -1
- package/dist/schema/settings/general.js +4 -1
- package/dist/schema/settings/general.js.map +1 -1
- package/dist/schema/settings/settings.d.ts +3 -3
- package/dist/schema/settings/theme.d.ts +3 -3
- package/dist/testing/definition-helpers.test-helper.d.ts +12 -0
- package/dist/testing/definition-helpers.test-helper.d.ts.map +1 -0
- package/dist/testing/definition-helpers.test-helper.js +77 -0
- package/dist/testing/definition-helpers.test-helper.js.map +1 -0
- package/dist/testing/expression-stub-parser.test-helper.d.ts +59 -0
- package/dist/testing/expression-stub-parser.test-helper.d.ts.map +1 -0
- package/dist/testing/expression-stub-parser.test-helper.js +79 -0
- package/dist/testing/expression-stub-parser.test-helper.js.map +1 -0
- package/dist/testing/expression-warning-parser.test-helper.d.ts +39 -0
- package/dist/testing/expression-warning-parser.test-helper.d.ts.map +1 -0
- package/dist/testing/expression-warning-parser.test-helper.js +62 -0
- package/dist/testing/expression-warning-parser.test-helper.js.map +1 -0
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +5 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/parser-context.test-helper.d.ts +8 -0
- package/dist/testing/parser-context.test-helper.d.ts.map +1 -0
- package/dist/testing/parser-context.test-helper.js +16 -0
- package/dist/testing/parser-context.test-helper.js.map +1 -0
- package/dist/{definition/project-definition-container.test-utils.d.ts → testing/project-definition-container.test-helper.d.ts} +4 -2
- package/dist/testing/project-definition-container.test-helper.d.ts.map +1 -0
- package/dist/{definition/project-definition-container.test-utils.js → testing/project-definition-container.test-helper.js} +11 -5
- package/dist/testing/project-definition-container.test-helper.js.map +1 -0
- package/dist/tools/assign-entity-ids.d.ts +17 -0
- package/dist/tools/assign-entity-ids.d.ts.map +1 -0
- package/dist/tools/assign-entity-ids.js +34 -0
- package/dist/tools/assign-entity-ids.js.map +1 -0
- package/dist/tools/entity-service/entity-navigation.d.ts +13 -0
- package/dist/tools/entity-service/entity-navigation.d.ts.map +1 -0
- package/dist/tools/entity-service/entity-navigation.js +84 -0
- package/dist/tools/entity-service/entity-navigation.js.map +1 -0
- package/dist/tools/entity-service/entity-read.d.ts +38 -0
- package/dist/tools/entity-service/entity-read.d.ts.map +1 -0
- package/dist/tools/entity-service/entity-read.js +56 -0
- package/dist/tools/entity-service/entity-read.js.map +1 -0
- package/dist/tools/entity-service/entity-type-map.d.ts +18 -0
- package/dist/tools/entity-service/entity-type-map.d.ts.map +1 -0
- package/dist/tools/entity-service/entity-type-map.js +75 -0
- package/dist/tools/entity-service/entity-type-map.js.map +1 -0
- package/dist/tools/entity-service/entity-write.d.ts +39 -0
- package/dist/tools/entity-service/entity-write.d.ts.map +1 -0
- package/dist/tools/entity-service/entity-write.js +99 -0
- package/dist/tools/entity-service/entity-write.js.map +1 -0
- package/dist/tools/entity-service/index.d.ts +5 -0
- package/dist/tools/entity-service/index.d.ts.map +1 -0
- package/dist/tools/entity-service/index.js +4 -0
- package/dist/tools/entity-service/index.js.map +1 -0
- package/dist/tools/entity-service/types.d.ts +41 -0
- package/dist/tools/entity-service/types.d.ts.map +1 -0
- package/dist/tools/entity-service/types.js +2 -0
- package/dist/tools/entity-service/types.js.map +1 -0
- package/dist/tools/index.d.ts +2 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/merge-schema/diff-definition.d.ts +74 -0
- package/dist/tools/merge-schema/diff-definition.d.ts.map +1 -0
- package/dist/tools/merge-schema/diff-definition.js +163 -0
- package/dist/tools/merge-schema/diff-definition.js.map +1 -0
- package/dist/tools/merge-schema/entity-utils.d.ts +18 -0
- package/dist/tools/merge-schema/entity-utils.d.ts.map +1 -0
- package/dist/tools/merge-schema/entity-utils.js +42 -0
- package/dist/tools/merge-schema/entity-utils.js.map +1 -0
- package/dist/tools/merge-schema/index.d.ts +10 -0
- package/dist/tools/merge-schema/index.d.ts.map +1 -0
- package/dist/tools/merge-schema/index.js +7 -0
- package/dist/tools/merge-schema/index.js.map +1 -0
- package/dist/tools/merge-schema/merge-data-with-schema.d.ts +21 -0
- package/dist/tools/merge-schema/merge-data-with-schema.d.ts.map +1 -0
- package/dist/tools/merge-schema/merge-data-with-schema.js +168 -0
- package/dist/tools/merge-schema/merge-data-with-schema.js.map +1 -0
- package/dist/tools/merge-schema/merge-definition.d.ts +42 -0
- package/dist/tools/merge-schema/merge-definition.d.ts.map +1 -0
- package/dist/tools/merge-schema/merge-definition.js +53 -0
- package/dist/tools/merge-schema/merge-definition.js.map +1 -0
- package/dist/tools/merge-schema/merge-rule-registry.d.ts +47 -0
- package/dist/tools/merge-schema/merge-rule-registry.d.ts.map +1 -0
- package/dist/tools/merge-schema/merge-rule-registry.js +53 -0
- package/dist/tools/merge-schema/merge-rule-registry.js.map +1 -0
- package/dist/tools/merge-schema/walk-schema.d.ts +26 -0
- package/dist/tools/merge-schema/walk-schema.d.ts.map +1 -0
- package/dist/tools/merge-schema/walk-schema.js +94 -0
- package/dist/tools/merge-schema/walk-schema.js.map +1 -0
- package/dist/utils/definition-diff/definition-diff.js.map +1 -1
- package/dist/web/components/definition-diff-alert.d.ts +9 -0
- package/dist/web/components/definition-diff-alert.d.ts.map +1 -0
- package/dist/web/components/definition-diff-alert.js +17 -0
- package/dist/web/components/definition-diff-alert.js.map +1 -0
- package/dist/web/components/index.d.ts +1 -1
- package/dist/web/components/index.d.ts.map +1 -1
- package/dist/web/components/index.js +1 -1
- package/dist/web/components/index.js.map +1 -1
- package/dist/web/hooks/use-project-definition.d.ts +10 -2
- package/dist/web/hooks/use-project-definition.d.ts.map +1 -1
- package/dist/web/hooks/use-project-definition.js.map +1 -1
- package/dist/web/specs/entity-type-url-web-spec.d.ts +68 -0
- package/dist/web/specs/entity-type-url-web-spec.d.ts.map +1 -0
- package/dist/web/specs/entity-type-url-web-spec.js +27 -0
- package/dist/web/specs/entity-type-url-web-spec.js.map +1 -0
- package/dist/web/specs/index.d.ts +1 -0
- package/dist/web/specs/index.d.ts.map +1 -1
- package/dist/web/specs/index.js +1 -0
- package/dist/web/specs/index.js.map +1 -1
- package/package.json +12 -11
- package/dist/definition/project-definition-container.test-utils.d.ts.map +0 -1
- package/dist/definition/project-definition-container.test-utils.js.map +0 -1
- package/dist/references/collect-refs.d.ts +0 -24
- package/dist/references/collect-refs.d.ts.map +0 -1
- package/dist/references/collect-refs.js +0 -86
- package/dist/references/collect-refs.js.map +0 -1
- package/dist/references/markers.d.ts +0 -59
- package/dist/references/markers.d.ts.map +0 -1
- package/dist/references/markers.js +0 -29
- package/dist/references/markers.js.map +0 -1
- package/dist/references/strip-ref-markers.d.ts +0 -7
- package/dist/references/strip-ref-markers.d.ts.map +0 -1
- package/dist/references/strip-ref-markers.js +0 -25
- package/dist/references/strip-ref-markers.js.map +0 -1
- package/dist/schema/models/mocks.d.ts +0 -6
- package/dist/schema/models/mocks.d.ts.map +0 -1
- package/dist/schema/models/mocks.js +0 -55
- package/dist/schema/models/mocks.js.map +0 -1
- package/dist/tools/model-merger/index.d.ts +0 -2
- package/dist/tools/model-merger/index.d.ts.map +0 -1
- package/dist/tools/model-merger/index.js +0 -2
- package/dist/tools/model-merger/index.js.map +0 -1
- package/dist/tools/model-merger/model-merger.d.ts +0 -569
- package/dist/tools/model-merger/model-merger.d.ts.map +0 -1
- package/dist/tools/model-merger/model-merger.js +0 -319
- package/dist/tools/model-merger/model-merger.js.map +0 -1
- package/dist/web/components/model-merger-result-alert.d.ts +0 -8
- package/dist/web/components/model-merger-result-alert.d.ts.map +0 -1
- package/dist/web/components/model-merger-result-alert.js +0 -20
- package/dist/web/components/model-merger-result-alert.js.map +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { DefinitionIssue } from './definition-issue-types.js';
|
|
3
|
+
/**
|
|
4
|
+
* A field-level issue checker result.
|
|
5
|
+
*
|
|
6
|
+
* The `path` is relative to the schema node the checker is registered on.
|
|
7
|
+
* The infrastructure (`collectFieldIssues`) handles scoping to the correct
|
|
8
|
+
* entity and prepending the entity-relative path.
|
|
9
|
+
*/
|
|
10
|
+
export type FieldIssueResult = Pick<DefinitionIssue, 'message' | 'path' | 'severity' | 'fix'>;
|
|
11
|
+
/**
|
|
12
|
+
* A field-level issue checker registered on a schema node.
|
|
13
|
+
* Invoked during `collectFieldIssues()` to find problems in the local value.
|
|
14
|
+
*
|
|
15
|
+
* Returns issues with paths relative to the current schema node.
|
|
16
|
+
* The infrastructure handles entity scoping automatically.
|
|
17
|
+
*/
|
|
18
|
+
export type DefinitionFieldIssueChecker<T = unknown> = (value: T) => FieldIssueResult[];
|
|
19
|
+
/**
|
|
20
|
+
* Metadata stored on a schema node annotated by `withIssueChecker`.
|
|
21
|
+
* Exposed as readonly; the registry manages mutation internally.
|
|
22
|
+
*/
|
|
23
|
+
export interface FieldIssueCheckerSchemaMeta {
|
|
24
|
+
readonly checkers: readonly DefinitionFieldIssueChecker[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Registry that stores field-level issue checker metadata on Zod schema instances.
|
|
28
|
+
*
|
|
29
|
+
* Uses a WeakMap to avoid interfering with Zod's type system.
|
|
30
|
+
* Annotated by `withIssueChecker()`; read by `collectFieldIssues()`.
|
|
31
|
+
*/
|
|
32
|
+
export declare const definitionFieldIssueRegistry: {
|
|
33
|
+
add(schema: z.ZodType, checker: DefinitionFieldIssueChecker): void;
|
|
34
|
+
get(schema: z.ZodType): FieldIssueCheckerSchemaMeta | undefined;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Creates a schema decorator that registers a field-level issue checker.
|
|
38
|
+
*
|
|
39
|
+
* Used with `.apply()`:
|
|
40
|
+
* ```typescript
|
|
41
|
+
* z.object({ ... }).apply(withIssueChecker<MyType>((value) => {
|
|
42
|
+
* const issues: FieldIssueResult[] = [];
|
|
43
|
+
* if (someCondition) {
|
|
44
|
+
* issues.push({ message: '...', path: ['fieldName'], severity: 'error' });
|
|
45
|
+
* }
|
|
46
|
+
* return issues;
|
|
47
|
+
* }))
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @param checker - The issue checker function to register
|
|
51
|
+
* @returns A function that decorates a schema with the checker
|
|
52
|
+
*/
|
|
53
|
+
export declare function withIssueChecker<T extends z.ZodType>(checker: DefinitionFieldIssueChecker<z.output<T>>): (schema: T) => T;
|
|
54
|
+
//# sourceMappingURL=definition-issue-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition-issue-registry.d.ts","sourceRoot":"","sources":["../../../src/schema/creator/definition-issue-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,eAAe,EACf,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,CACxC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,2BAA2B,CAAC,CAAC,GAAG,OAAO,IAAI,CACrD,KAAK,EAAE,CAAC,KACL,gBAAgB,EAAE,CAAC;AAExB;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,QAAQ,EAAE,SAAS,2BAA2B,EAAE,CAAC;CAC3D;AAOD;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B;gBAGzB,CAAC,CAAC,OAAO,WAAW,2BAA2B,GAAG,IAAI;gBAQtD,CAAC,CAAC,OAAO,GAAG,2BAA2B,GAAG,SAAS;CAI/D,CAAC;AAEL;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAClD,OAAO,EAAE,2BAA2B,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAChD,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAQlB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registry that stores field-level issue checker metadata on Zod schema instances.
|
|
3
|
+
*
|
|
4
|
+
* Uses a WeakMap to avoid interfering with Zod's type system.
|
|
5
|
+
* Annotated by `withIssueChecker()`; read by `collectFieldIssues()`.
|
|
6
|
+
*/
|
|
7
|
+
export const definitionFieldIssueRegistry = (() => {
|
|
8
|
+
const map = new WeakMap();
|
|
9
|
+
return {
|
|
10
|
+
add(schema, checker) {
|
|
11
|
+
const existing = map.get(schema);
|
|
12
|
+
if (existing) {
|
|
13
|
+
existing.checkers.push(checker);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
map.set(schema, { checkers: [checker] });
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
get(schema) {
|
|
20
|
+
return map.get(schema);
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
/**
|
|
25
|
+
* Creates a schema decorator that registers a field-level issue checker.
|
|
26
|
+
*
|
|
27
|
+
* Used with `.apply()`:
|
|
28
|
+
* ```typescript
|
|
29
|
+
* z.object({ ... }).apply(withIssueChecker<MyType>((value) => {
|
|
30
|
+
* const issues: FieldIssueResult[] = [];
|
|
31
|
+
* if (someCondition) {
|
|
32
|
+
* issues.push({ message: '...', path: ['fieldName'], severity: 'error' });
|
|
33
|
+
* }
|
|
34
|
+
* return issues;
|
|
35
|
+
* }))
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @param checker - The issue checker function to register
|
|
39
|
+
* @returns A function that decorates a schema with the checker
|
|
40
|
+
*/
|
|
41
|
+
export function withIssueChecker(checker) {
|
|
42
|
+
return (schema) => {
|
|
43
|
+
definitionFieldIssueRegistry.add(schema, checker);
|
|
44
|
+
return schema;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=definition-issue-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition-issue-registry.js","sourceRoot":"","sources":["../../../src/schema/creator/definition-issue-registry.ts"],"names":[],"mappings":"AAwCA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,GAAG,EAAE;IAChD,MAAM,GAAG,GAAG,IAAI,OAAO,EAAiD,CAAC;IACzE,OAAO;QACL,GAAG,CAAC,MAAiB,EAAE,OAAoC;YACzD,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACjC,IAAI,QAAQ,EAAE,CAAC;gBACb,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAClC,CAAC;iBAAM,CAAC;gBACN,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;QACD,GAAG,CAAC,MAAiB;YACnB,OAAO,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,EAAE,CAAC;AAEL;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAAiD;IAEjD,OAAO,CAAC,MAAS,EAAK,EAAE;QACtB,4BAA4B,CAAC,GAAG,CAC9B,MAAM,EACN,OAAsC,CACvC,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ReferencePath } from '#src/references/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* An auto-fix proposal attached to an issue.
|
|
4
|
+
* The `apply` function receives the local value and returns a fixed value.
|
|
5
|
+
*/
|
|
6
|
+
export interface DefinitionIssueFix {
|
|
7
|
+
/** Short label for the fix action (e.g. "Remove duplicate port") */
|
|
8
|
+
readonly label: string;
|
|
9
|
+
/** Apply the fix to the local value, returning a fixed value */
|
|
10
|
+
readonly apply: (value: unknown) => unknown;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Common fields shared by all definition issues.
|
|
14
|
+
*
|
|
15
|
+
* - `'error'` severity blocks saving and shows toast errors
|
|
16
|
+
* - `'warning'` severity allows saving but blocks syncing, shown as toast warnings
|
|
17
|
+
*/
|
|
18
|
+
interface DefinitionIssueBase {
|
|
19
|
+
/** Human-readable description of the issue */
|
|
20
|
+
readonly message: string;
|
|
21
|
+
/** Severity: 'error' blocks save, 'warning' blocks sync only */
|
|
22
|
+
readonly severity: 'error' | 'warning';
|
|
23
|
+
/** Optional auto-fix proposal */
|
|
24
|
+
readonly fix?: DefinitionIssueFix;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* An issue scoped to a specific entity. The path is relative to the entity root.
|
|
28
|
+
*/
|
|
29
|
+
export interface EntityDefinitionIssue extends DefinitionIssueBase {
|
|
30
|
+
/** The entity this issue belongs to */
|
|
31
|
+
readonly entityId: string;
|
|
32
|
+
/** Path relative to the entity root */
|
|
33
|
+
readonly path: ReferencePath;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A root-level issue with an absolute path from the definition root.
|
|
37
|
+
* Used for cross-cutting validations (e.g., duplicate names in arrays)
|
|
38
|
+
* and settings that aren't scoped to a specific entity.
|
|
39
|
+
*/
|
|
40
|
+
export interface RootDefinitionIssue extends DefinitionIssueBase {
|
|
41
|
+
readonly entityId?: undefined;
|
|
42
|
+
/** Absolute path from the definition root */
|
|
43
|
+
readonly path: ReferencePath;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A definition issue is either entity-scoped or root-scoped.
|
|
47
|
+
*
|
|
48
|
+
* - Entity-scoped: has `entityId` (string) + path relative to entity root
|
|
49
|
+
* - Root-scoped: no `entityId` + absolute path from definition root
|
|
50
|
+
*/
|
|
51
|
+
export type DefinitionIssue = EntityDefinitionIssue | RootDefinitionIssue;
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=definition-issue-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition-issue-types.d.ts","sourceRoot":"","sources":["../../../src/schema/creator/definition-issue-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CAC7C;AAED;;;;;GAKG;AACH,UAAU,mBAAmB;IAC3B,8CAA8C;IAC9C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,iCAAiC;IACjC,QAAQ,CAAC,GAAG,CAAC,EAAE,kBAAkB,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,mBAAmB;IAChE,uCAAuC;IACvC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,uCAAuC;IACvC,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;CAC9B;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC9D,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B,6CAA6C;IAC7C,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;CAC9B;AAED;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAAG,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition-issue-types.js","sourceRoot":"","sources":["../../../src/schema/creator/definition-issue-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
export type WithDefaultType = <T extends z.ZodType>(schema: T, defaultValue: z.input<T>) =>
|
|
2
|
+
type WithDefaultResult<T extends z.ZodType> = z.ZodPrefault<T>;
|
|
3
|
+
export type WithDefaultType = <T extends z.ZodType>(schema: T, defaultValue: z.input<T>) => WithDefaultResult<T>;
|
|
4
|
+
/**
|
|
5
|
+
* Creates a schema decorator that applies a default value.
|
|
6
|
+
*
|
|
7
|
+
* Uses `prefault` to ensure defaults are populated during Zod parse, and
|
|
8
|
+
* registers the default value in the registry so `cleanDefaultValues()` can
|
|
9
|
+
* strip matching values during serialization.
|
|
10
|
+
*
|
|
11
|
+
* Can be used standalone with `.apply()`:
|
|
12
|
+
* ```typescript
|
|
13
|
+
* z.boolean().apply(withDefault(false))
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param defaultValue - The default value to apply
|
|
17
|
+
* @returns A function that decorates a schema with the default value
|
|
18
|
+
*/
|
|
19
|
+
export declare function withDefault(defaultValue: unknown): <T extends z.ZodType>(schema: T) => WithDefaultResult<T>;
|
|
4
20
|
/**
|
|
5
21
|
* Extends the parser context with default value handling functionality.
|
|
6
22
|
*
|
|
7
|
-
* @param options - The schema creator options containing the defaultMode
|
|
8
23
|
* @returns An object containing the withDefault method
|
|
9
24
|
*/
|
|
10
|
-
export declare function extendParserContextWithDefaults(
|
|
25
|
+
export declare function extendParserContextWithDefaults(): {
|
|
11
26
|
withDefault: WithDefaultType;
|
|
12
27
|
};
|
|
28
|
+
export {};
|
|
13
29
|
//# sourceMappingURL=extend-parser-context-with-defaults.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extend-parser-context-with-defaults.d.ts","sourceRoot":"","sources":["../../../src/schema/creator/extend-parser-context-with-defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"extend-parser-context-with-defaults.d.ts","sourceRoot":"","sources":["../../../src/schema/creator/extend-parser-context-with-defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAI7B,KAAK,iBAAiB,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AAE/D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAChD,MAAM,EAAE,CAAC,EACT,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KACrB,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAE1B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CACzB,YAAY,EAAE,OAAO,GACpB,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,KAAK,iBAAiB,CAAC,CAAC,CAAC,CAM1D;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,IAAI;IACjD,WAAW,EAAE,eAAe,CAAC;CAC9B,CAIA"}
|
|
@@ -1,52 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { definitionDefaultRegistry } from './definition-default-registry.js';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a schema decorator that applies a default value.
|
|
4
|
+
*
|
|
5
|
+
* Uses `prefault` to ensure defaults are populated during Zod parse, and
|
|
6
|
+
* registers the default value in the registry so `cleanDefaultValues()` can
|
|
7
|
+
* strip matching values during serialization.
|
|
8
|
+
*
|
|
9
|
+
* Can be used standalone with `.apply()`:
|
|
10
|
+
* ```typescript
|
|
11
|
+
* z.boolean().apply(withDefault(false))
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @param defaultValue - The default value to apply
|
|
15
|
+
* @returns A function that decorates a schema with the default value
|
|
16
|
+
*/
|
|
17
|
+
export function withDefault(defaultValue) {
|
|
18
|
+
return (schema) => {
|
|
19
|
+
const result = schema.prefault(defaultValue);
|
|
20
|
+
definitionDefaultRegistry.set(result, { defaultValue });
|
|
21
|
+
return result;
|
|
22
|
+
};
|
|
16
23
|
}
|
|
17
24
|
/**
|
|
18
25
|
* Extends the parser context with default value handling functionality.
|
|
19
26
|
*
|
|
20
|
-
* @param options - The schema creator options containing the defaultMode
|
|
21
27
|
* @returns An object containing the withDefault method
|
|
22
28
|
*/
|
|
23
|
-
export function extendParserContextWithDefaults(
|
|
24
|
-
const mode = options.defaultMode ?? 'populate';
|
|
29
|
+
export function extendParserContextWithDefaults() {
|
|
25
30
|
return {
|
|
26
|
-
withDefault:
|
|
27
|
-
switch (mode) {
|
|
28
|
-
case 'populate': {
|
|
29
|
-
return schema.prefault(defaultValue).optional();
|
|
30
|
-
}
|
|
31
|
-
case 'strip': {
|
|
32
|
-
// Use transform to remove values matching defaults after validation
|
|
33
|
-
return schema
|
|
34
|
-
.transform((value) => {
|
|
35
|
-
if (value === defaultValue)
|
|
36
|
-
return undefined;
|
|
37
|
-
if (isEmpty(value)) {
|
|
38
|
-
return undefined;
|
|
39
|
-
}
|
|
40
|
-
return value;
|
|
41
|
-
})
|
|
42
|
-
.optional();
|
|
43
|
-
}
|
|
44
|
-
case 'preserve': {
|
|
45
|
-
// Return schema with .optional() added
|
|
46
|
-
return schema.transform((x) => x).optional();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
},
|
|
31
|
+
withDefault: (schema, defaultValue) => withDefault(defaultValue)(schema),
|
|
50
32
|
};
|
|
51
33
|
}
|
|
52
34
|
//# sourceMappingURL=extend-parser-context-with-defaults.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extend-parser-context-with-defaults.js","sourceRoot":"","sources":["../../../src/schema/creator/extend-parser-context-with-defaults.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extend-parser-context-with-defaults.js","sourceRoot":"","sources":["../../../src/schema/creator/extend-parser-context-with-defaults.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAS7E;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,WAAW,CACzB,YAAqB;IAErB,OAAO,CAAsB,MAAS,EAAwB,EAAE;QAC9D,MAAM,MAAM,GAAI,MAAoB,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAC5D,yBAAyB,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC;QACxD,OAAO,MAA8B,CAAC;IACxC,CAAC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,+BAA+B;IAG7C,OAAO;QACL,WAAW,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC;KACzE,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
export * from './definition-fix-registry.js';
|
|
2
|
+
export * from './definition-issue-checker-spec.js';
|
|
3
|
+
export * from './definition-issue-checkers.js';
|
|
4
|
+
export * from './definition-issue-registry.js';
|
|
5
|
+
export type * from './definition-issue-types.js';
|
|
6
|
+
export { withDefault } from './extend-parser-context-with-defaults.js';
|
|
1
7
|
export type * as def from './infer-types.js';
|
|
2
8
|
export * from './schema-creator.js';
|
|
3
9
|
export type * from './types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/creator/index.ts"],"names":[],"mappings":"AAAA,YAAY,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAE7C,cAAc,qBAAqB,CAAC;AAEpC,mBAAmB,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/creator/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,mBAAmB,6BAA6B,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAEvE,YAAY,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAE7C,cAAc,qBAAqB,CAAC;AAEpC,mBAAmB,YAAY,CAAC"}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
export * from './definition-fix-registry.js';
|
|
2
|
+
export * from './definition-issue-checker-spec.js';
|
|
3
|
+
export * from './definition-issue-checkers.js';
|
|
4
|
+
export * from './definition-issue-registry.js';
|
|
5
|
+
export { withDefault } from './extend-parser-context-with-defaults.js';
|
|
1
6
|
export * from './schema-creator.js';
|
|
2
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema/creator/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema/creator/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAIvE,cAAc,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-creator.d.ts","sourceRoot":"","sources":["../../../src/schema/creator/schema-creator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schema-creator.d.ts","sourceRoot":"","sources":["../../../src/schema/creator/schema-creator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,KAAK,EACV,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,qCAAqC,CAAC;AAK7C,OAAO,KAAK,EACV,uBAAuB,EACvB,8BAA8B,EAC9B,gCAAgC,EAChC,6BAA6B,EAC9B,MAAM,YAAY,CAAC;AASpB,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,8BAA8B,GACtC,6BAA6B,CAW/B;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAClD,OAAO,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAClC,CAAC,OAAO,EAAE,6BAA6B,KAAK,CAAC,CAS/C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,SAAS,wBAAwB,EACzC,CAAC,SAAS,CAAC,CAAC,OAAO,EAEnB,cAAc,EAAE,QAAQ,EACxB,OAAO,EAAE,CACP,GAAG,EAAE,6BAA6B,EAClC,KAAK,EAAE,iBAAiB,CAAC,QAAQ,CAAC,KAC/B,CAAC,GACL,gCAAgC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAO/C;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oBAAoB,CAClC,CAAC,SAAS,CAAC,CAAC,OAAO,EACnB,QAAQ,SAAS,wBAAwB,EAEzC,aAAa,EAAE,gCAAgC,CAAC,CAAC,EAAE,QAAQ,CAAC,GAC3D,uBAAuB,CAAC,CAAC,CAAC,CAO5B"}
|
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
import { extendParserContextWithRefs } from '#src/references/extend-parser-context-with-refs.js';
|
|
2
2
|
import { createRefContextSlotMap } from '#src/references/ref-context-slot.js';
|
|
3
3
|
import { extendParserContextWithDefaults } from './extend-parser-context-with-defaults.js';
|
|
4
|
+
const contextCache = new WeakMap();
|
|
4
5
|
export function createDefinitionSchemaParserContext(options) {
|
|
5
|
-
|
|
6
|
+
const cached = contextCache.get(options.plugins);
|
|
7
|
+
if (cached)
|
|
8
|
+
return cached;
|
|
9
|
+
const context = {
|
|
6
10
|
...options,
|
|
7
|
-
...extendParserContextWithRefs(
|
|
8
|
-
...extendParserContextWithDefaults(
|
|
11
|
+
...extendParserContextWithRefs(),
|
|
12
|
+
...extendParserContextWithDefaults(),
|
|
9
13
|
};
|
|
14
|
+
contextCache.set(options.plugins, context);
|
|
15
|
+
return context;
|
|
10
16
|
}
|
|
11
17
|
export function definitionSchema(creator) {
|
|
12
|
-
|
|
18
|
+
const cache = new WeakMap();
|
|
19
|
+
return (context) => {
|
|
20
|
+
const cached = cache.get(context);
|
|
21
|
+
if (cached)
|
|
22
|
+
return cached;
|
|
23
|
+
const result = creator(context);
|
|
24
|
+
cache.set(context, result);
|
|
25
|
+
return result;
|
|
26
|
+
};
|
|
13
27
|
}
|
|
14
28
|
/**
|
|
15
29
|
* Creates a schema that requires slots to be passed from parent schemas.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-creator.js","sourceRoot":"","sources":["../../../src/schema/creator/schema-creator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema-creator.js","sourceRoot":"","sources":["../../../src/schema/creator/schema-creator.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oDAAoD,CAAC;AACjG,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAS9E,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAE3F,MAAM,YAAY,GAAG,IAAI,OAAO,EAG7B,CAAC;AAEJ,MAAM,UAAU,mCAAmC,CACjD,OAAuC;IAEvC,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACjD,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAE1B,MAAM,OAAO,GAAkC;QAC7C,GAAG,OAAO;QACV,GAAG,2BAA2B,EAAE;QAChC,GAAG,+BAA+B,EAAE;KACrC,CAAC;IACF,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3C,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,OAAmC;IAEnC,MAAM,KAAK,GAAG,IAAI,OAAO,EAAoC,CAAC;IAC9D,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAClC,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;QAC1B,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QAChC,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC3B,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,yBAAyB,CAIvC,cAAwB,EACxB,OAGM;IAEN,MAAM,gBAAgB,GAAkD,CACtE,OAAO,EACP,KAAK,EACL,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7B,gBAAgB,CAAC,cAAc,GAAG,cAAc,CAAC;IACjD,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,oBAAoB,CAIlC,aAA4D;IAE5D,OAAO,CAAC,GAAG,EAAE,EAAE;QACb,MAAM,gBAAgB,GAAG,uBAAuB,CAC9C,aAAa,CAAC,cAAc,CAC7B,CAAC;QACF,OAAO,aAAa,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAC9C,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -11,38 +11,12 @@ export interface DefinitionSchemaCreatorOptions {
|
|
|
11
11
|
* The plugin implementation store that contains the instantiated plugin spec implementations.
|
|
12
12
|
*/
|
|
13
13
|
plugins: PluginSpecStore;
|
|
14
|
-
/**
|
|
15
|
-
* If true, the schema will be transformed to include references.
|
|
16
|
-
*
|
|
17
|
-
* Note: The parsed data will not match the Typescript type definition of the schema
|
|
18
|
-
* because refs will be replaced with special marker classes. You must call extractRefs
|
|
19
|
-
* to convert the parsed data to the correct type.
|
|
20
|
-
*/
|
|
21
|
-
transformReferences?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* How to handle default values in the schema.
|
|
24
|
-
*
|
|
25
|
-
* - 'populate': Ensure defaults are present (useful for React Hook Form)
|
|
26
|
-
* - 'strip': Remove values that match their defaults (useful for clean JSON serialization)
|
|
27
|
-
* - 'preserve': Keep values as-is without transformation
|
|
28
|
-
*
|
|
29
|
-
* @default 'populate'
|
|
30
|
-
*/
|
|
31
|
-
defaultMode?: 'populate' | 'strip' | 'preserve';
|
|
32
14
|
}
|
|
33
15
|
export interface DefinitionSchemaParserContext {
|
|
34
16
|
/**
|
|
35
17
|
* The plugin implementation store that contains the instantiated plugin spec implementations.
|
|
36
18
|
*/
|
|
37
19
|
plugins: PluginSpecStore;
|
|
38
|
-
/**
|
|
39
|
-
* If true, the schema will be transformed to include references.
|
|
40
|
-
*/
|
|
41
|
-
transformReferences?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* How to handle default values in the schema.
|
|
44
|
-
*/
|
|
45
|
-
defaultMode?: 'populate' | 'strip' | 'preserve';
|
|
46
20
|
/**
|
|
47
21
|
* Adds a reference to the schema.
|
|
48
22
|
*/
|
|
@@ -52,10 +26,9 @@ export interface DefinitionSchemaParserContext {
|
|
|
52
26
|
*/
|
|
53
27
|
withEnt: WithEntType;
|
|
54
28
|
/**
|
|
55
|
-
* Wraps a schema with default value handling
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* - 'preserve': Returns schema unchanged
|
|
29
|
+
* Wraps a schema with default value handling. Uses prefault to ensure defaults
|
|
30
|
+
* are populated during parsing, and registers the default so it can be stripped
|
|
31
|
+
* during serialization via `cleanDefaultValues()`.
|
|
59
32
|
*/
|
|
60
33
|
withDefault: WithDefaultType;
|
|
61
34
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/schema/creator/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,WAAW,EACZ,MAAM,oDAAoD,CAAC;AAC5D,OAAO,KAAK,EACV,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,OAAO,EAAE,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/schema/creator/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,WAAW,EACZ,MAAM,oDAAoD,CAAC;AAC5D,OAAO,KAAK,EACV,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,OAAO,EAAE,eAAe,CAAC;IACzB;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC;IACrB;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC;IACrB;;;;OAIG;IACH,WAAW,EAAE,eAAe,CAAC;IAC7B;;;OAGG;IACH,UAAU,EAAE,cAAc,CAAC;IAC3B;;;OAGG;IACH,cAAc,EAAE,kBAAkB,CAAC;CACpC;AAED,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,IAAI,CACrE,GAAG,EAAE,6BAA6B,KAC/B,CAAC,CAAC;AAEP,MAAM,MAAM,gCAAgC,CAC1C,iBAAiB,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,EAC/C,eAAe,SAAS,wBAAwB,GAAG,wBAAwB,IACzE,CAAC,CACH,GAAG,EAAE,6BAA6B,EAClC,KAAK,EAAE,iBAAiB,CAAC,eAAe,CAAC,KACtC,iBAAiB,CAAC,GAAG;IACxB,cAAc,EAAE,eAAe,CAAC;CACjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorizer-expression-acorn-parser.d.ts","sourceRoot":"","sources":["../../../../src/schema/models/authorizer/authorizer-expression-acorn-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAYH,OAAO,KAAK,EACV,wBAAwB,
|
|
1
|
+
{"version":3,"file":"authorizer-expression-acorn-parser.d.ts","sourceRoot":"","sources":["../../../../src/schema/models/authorizer/authorizer-expression-acorn-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAYH,OAAO,KAAK,EACV,wBAAwB,EAUzB,MAAM,gCAAgC,CAAC;AAIxC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,GACZ,wBAAwB,CA6C1B"}
|