@mat3ra/esse 2026.5.18-2 → 2026.5.27-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/dist/js/esse/JSONSchemasGenerator.d.ts +2 -1
- package/dist/js/esse/JSONSchemasGenerator.js +1 -1
- package/dist/js/esse/JSONSchemasInterface.d.ts +1 -1
- package/dist/js/esse/JSONSchemasInterface.js +1 -1
- package/dist/js/esse/JSONSchemasInterfaceServer.js +3 -2
- package/dist/js/esse/schemaUtils.d.ts +1 -1
- package/dist/js/esse/schemaUtils.js +2 -1
- package/dist/js/esse/server/utils.d.ts +12 -0
- package/dist/js/esse/server/utils.js +68 -0
- package/dist/js/esse/utils.d.ts +0 -11
- package/dist/js/esse/utils.js +3 -60
- package/dist/js/example/job.json +38 -11
- package/dist/js/example/material.json +7 -1
- package/dist/js/example/materials_category/compound_pristine_structures/two_dimensional/interface/configuration.json +35 -5
- package/dist/js/example/materials_category/defective_structures/one_dimensional/grain_boundary_linear/configuration.json +28 -4
- package/dist/js/example/materials_category/defective_structures/two_dimensional/adatom/configuration.json +28 -4
- package/dist/js/example/materials_category/defective_structures/two_dimensional/grain_boundary_planar/configuration.json +35 -5
- package/dist/js/example/materials_category/defective_structures/two_dimensional/island/configuration.json +42 -6
- package/dist/js/example/materials_category/defective_structures/two_dimensional/terrace/configuration.json +42 -6
- package/dist/js/example/materials_category/defective_structures/zero_dimensional/point_defect/base_configuration.json +14 -2
- package/dist/js/example/materials_category/defective_structures/zero_dimensional/point_defect/interstitial.json +14 -2
- package/dist/js/example/materials_category/defective_structures/zero_dimensional/point_defect/substitutional.json +14 -2
- package/dist/js/example/materials_category/defective_structures/zero_dimensional/point_defect/vacancy.json +7 -1
- package/dist/js/example/materials_category/pristine_structures/two_dimensional/nanoribbon.json +21 -3
- package/dist/js/example/materials_category/pristine_structures/two_dimensional/nanotape.json +14 -2
- package/dist/js/example/materials_category/pristine_structures/two_dimensional/slab.json +14 -2
- package/dist/js/example/materials_category/pristine_structures/two_dimensional/slab_strained_supercell.json +14 -2
- package/dist/js/example/materials_category/processed_structures/two_dimensional/passivation/configuration.json +28 -4
- package/dist/js/example/materials_category_components/entities/auxiliary/zero_dimensional/crystal_site.json +7 -1
- package/dist/js/example/materials_category_components/entities/auxiliary/zero_dimensional/point_defect_site.json +7 -1
- package/dist/js/example/materials_category_components/entities/core/three_dimensional/crystal.json +7 -1
- package/dist/js/example/materials_category_components/entities/core/two_dimensional/vacuum.json +7 -1
- package/dist/js/example/materials_category_components/entities/reusable/one_dimensional/crystal_lattice_lines.json +7 -1
- package/dist/js/example/materials_category_components/entities/reusable/one_dimensional/crystal_lattice_lines_unique_repeated.json +7 -1
- package/dist/js/example/materials_category_components/entities/reusable/two_dimensional/slab_stack_configuration.json +28 -4
- package/dist/js/example/materials_category_components/operations/core/combinations/merge.json +14 -2
- package/dist/js/example/materials_category_components/operations/core/combinations/stack.json +14 -2
- package/dist/js/example/materials_category_components/operations/core/modifications/perturb.json +7 -1
- package/dist/js/example/model.json +2 -1
- package/dist/js/example/software/application.json +1 -0
- package/dist/js/example/software/executable.json +3 -4
- package/dist/js/example/software/flavor.json +9 -2
- package/dist/js/example/software/template.json +5 -8
- package/dist/js/example/software_directory/modeling/espresso.json +2 -1
- package/dist/js/example/software_directory/modeling/nwchem.json +3 -1
- package/dist/js/example/software_directory/modeling/unit/execution.json +57 -15
- package/dist/js/example/software_directory/modeling/vasp.json +2 -1
- package/dist/js/example/software_directory/scripting/jupyter_lab.json +2 -1
- package/dist/js/example/software_directory/scripting/python.json +2 -1
- package/dist/js/example/software_directory/scripting/shell.json +2 -1
- package/dist/js/example/software_directory/scripting/unit/execution.json +57 -15
- package/dist/js/example/system/runtime_items.json +14 -0
- package/dist/js/example/workflow/subworkflow.json +32 -10
- package/dist/js/example/workflow/unit/assignment.json +5 -1
- package/dist/js/example/workflow/unit/condition.json +5 -1
- package/dist/js/example/workflow/unit/execution.json +29 -9
- package/dist/js/example/workflow/unit/io/api.json +1 -0
- package/dist/js/example/workflow/unit/io/db_collection.json +5 -0
- package/dist/js/example/workflow/unit/io/db_ids.json +6 -0
- package/dist/js/example/workflow/unit/io/object_storage.json +2 -1
- package/dist/js/example/workflow/unit/io.json +22 -2
- package/dist/js/example/workflow/unit/map.json +5 -1
- package/dist/js/example/workflow/unit/reduce.json +5 -1
- package/dist/js/example/workflow.json +38 -11
- package/dist/js/schema/apse/file/applications/espresso/7.2/pw.x/atomic_species.json +5 -0
- package/dist/js/schema/apse/file/applications/espresso/7.2/pw.x.json +5 -0
- package/dist/js/schema/context_providers_directory/by_application/nwchem_total_energy_context_provider.json +7 -1
- package/dist/js/schema/context_providers_directory/by_application/qe_neb_context_provider.json +164 -6
- package/dist/js/schema/context_providers_directory/by_application/qe_pwx_base_context_provider.json +10 -0
- package/dist/js/schema/context_providers_directory/by_application/qe_pwx_context_provider.json +17 -1
- package/dist/js/schema/context_providers_directory/by_application/vasp_context_provider.json +7 -1
- package/dist/js/schema/context_providers_directory/by_application/vasp_neb_context_provider.json +7 -1
- package/dist/js/schema/context_providers_directory/collinear_magnetization_context_provider.json +14 -0
- package/dist/js/schema/context_providers_directory/non_collinear_magnetization_context_provider.json +7 -0
- package/dist/js/schema/context_providers_directory/points_grid_data_provider.json +23 -6
- package/dist/js/schema/context_providers_directory/points_path_data_provider.json +6 -2
- package/dist/js/schema/context_providers_directory/points_path_data_provider_rendering.json +32 -0
- package/dist/js/schema/core/primitive/linked_list/named_node.json +2 -1
- package/dist/js/schema/core/primitive/linked_list/named_node_in_group.json +2 -1
- package/dist/js/schema/core/primitive/linked_list.json +4 -2
- package/dist/js/schema/in_memory_entity/has_consistency_check_has_metadata_named_defaultable.json +3 -0
- package/dist/js/schema/in_memory_entity/named.json +3 -0
- package/dist/js/schema/in_memory_entity/named_defaultable.json +3 -0
- package/dist/js/schema/in_memory_entity/named_defaultable_has_metadata.json +3 -0
- package/dist/js/schema/in_memory_entity/named_defaultable_runtime_items.json +3 -0
- package/dist/js/schema/job/base.json +133 -132
- package/dist/js/schema/job/compute.json +1 -1
- package/dist/js/schema/job/compute_property.json +182 -0
- package/dist/js/schema/job.json +3829 -4566
- package/dist/js/schema/material/material_properties.json +736 -0
- package/dist/js/schema/material/metadata/boundary_conditions.json +32 -0
- package/dist/js/schema/material/metadata/bulk_properties.json +13 -0
- package/dist/js/schema/material/metadata/slab_properties.json +41 -0
- package/dist/js/schema/material/metadata.json +101 -0
- package/dist/js/schema/material.json +117 -27
- package/dist/js/schema/materials_category/compound_pristine_structures/two_dimensional/interface/configuration.json +1069 -268
- package/dist/js/schema/materials_category/defective_structures/one_dimensional/grain_boundary_linear/configuration.json +1069 -268
- package/dist/js/schema/materials_category/defective_structures/two_dimensional/adatom/configuration.json +464 -108
- package/dist/js/schema/materials_category/defective_structures/two_dimensional/grain_boundary_planar/configuration.json +1069 -268
- package/dist/js/schema/materials_category/defective_structures/two_dimensional/island/configuration.json +698 -164
- package/dist/js/schema/materials_category/defective_structures/two_dimensional/terrace/configuration.json +698 -164
- package/dist/js/schema/materials_category/defective_structures/zero_dimensional/point_defect/base_configuration.json +116 -27
- package/dist/js/schema/materials_category/defective_structures/zero_dimensional/point_defect/interstitial.json +232 -54
- package/dist/js/schema/materials_category/defective_structures/zero_dimensional/point_defect/substitutional.json +232 -54
- package/dist/js/schema/materials_category/defective_structures/zero_dimensional/point_defect/vacancy.json +116 -27
- package/dist/js/schema/materials_category/pristine_structures/three_dimensional/ideal_crystal.json +116 -27
- package/dist/js/schema/materials_category/pristine_structures/two_dimensional/nanoribbon.json +348 -81
- package/dist/js/schema/materials_category/pristine_structures/two_dimensional/nanotape.json +232 -54
- package/dist/js/schema/materials_category/pristine_structures/two_dimensional/slab.json +232 -54
- package/dist/js/schema/materials_category/pristine_structures/two_dimensional/slab_strained_supercell.json +232 -54
- package/dist/js/schema/materials_category/processed_structures/two_dimensional/passivation/configuration.json +233 -54
- package/dist/js/schema/materials_category_components/entities/auxiliary/zero_dimensional/crystal_site.json +116 -27
- package/dist/js/schema/materials_category_components/entities/auxiliary/zero_dimensional/point_defect_site.json +116 -27
- package/dist/js/schema/materials_category_components/entities/auxiliary/zero_dimensional/void_region.json +116 -27
- package/dist/js/schema/materials_category_components/entities/core/three_dimensional/crystal.json +116 -27
- package/dist/js/schema/materials_category_components/entities/core/two_dimensional/vacuum.json +116 -27
- package/dist/js/schema/materials_category_components/entities/reusable/one_dimensional/crystal_lattice_lines.json +116 -27
- package/dist/js/schema/materials_category_components/entities/reusable/one_dimensional/crystal_lattice_lines_unique_repeated.json +116 -27
- package/dist/js/schema/materials_category_components/entities/reusable/three_dimensional/crystal_lattice_base.json +116 -27
- package/dist/js/schema/materials_category_components/entities/reusable/three_dimensional/strained_non_uniform.json +116 -27
- package/dist/js/schema/materials_category_components/entities/reusable/three_dimensional/strained_uniform.json +116 -27
- package/dist/js/schema/materials_category_components/entities/reusable/three_dimensional/supercell.json +116 -27
- package/dist/js/schema/materials_category_components/entities/reusable/two_dimensional/atomic_layers.json +116 -27
- package/dist/js/schema/materials_category_components/entities/reusable/two_dimensional/atomic_layers_unique.json +116 -27
- package/dist/js/schema/materials_category_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated.json +116 -27
- package/dist/js/schema/materials_category_components/entities/reusable/two_dimensional/crystal_lattice_planes.json +116 -27
- package/dist/js/schema/materials_category_components/entities/reusable/two_dimensional/slab_stack_configuration.json +348 -81
- package/dist/js/schema/materials_category_components/operations/core/modifications/perturb.json +117 -27
- package/dist/js/schema/method/categorized_method.json +4 -0
- package/dist/js/schema/method/unit_method.json +3 -0
- package/dist/js/schema/method.json +7 -1
- package/dist/js/schema/methods_directory/legacy/localorbital.json +7 -1
- package/dist/js/schema/methods_directory/legacy/pseudopotential.json +7 -1
- package/dist/js/schema/methods_directory/legacy/regression.json +4 -0
- package/dist/js/schema/methods_directory/legacy/unknown.json +7 -1
- package/dist/js/schema/methods_directory/mathematical/cg.json +2 -1
- package/dist/js/schema/methods_directory/mathematical/davidson.json +2 -1
- package/dist/js/schema/methods_directory/mathematical/regression.json +3 -2
- package/dist/js/schema/methods_directory/physical/ao/dunning.json +2 -1
- package/dist/js/schema/methods_directory/physical/ao/other.json +2 -1
- package/dist/js/schema/methods_directory/physical/ao/pople.json +2 -1
- package/dist/js/schema/methods_directory/physical/psp.json +2 -1
- package/dist/js/schema/methods_directory/physical/pw.json +2 -1
- package/dist/js/schema/methods_directory/physical/smearing.json +2 -1
- package/dist/js/schema/methods_directory/physical/tetrahedron.json +2 -1
- package/dist/js/schema/model/categorized_model.json +5 -0
- package/dist/js/schema/model/model_without_method.json +1 -0
- package/dist/js/schema/model.json +7 -2
- package/dist/js/schema/models_directory/double_hybrid.json +1 -0
- package/dist/js/schema/models_directory/gga.json +1 -0
- package/dist/js/schema/models_directory/gw.json +1 -0
- package/dist/js/schema/models_directory/hybrid.json +1 -0
- package/dist/js/schema/models_directory/lda.json +1 -0
- package/dist/js/schema/models_directory/legacy/any.json +488 -0
- package/dist/js/schema/models_directory/legacy/dft.json +267 -39
- package/dist/js/schema/models_directory/legacy/ml.json +10 -9
- package/dist/js/schema/models_directory/legacy/unknown.json +10 -9
- package/dist/js/schema/models_directory/mgga.json +1 -0
- package/dist/js/schema/models_directory/re.json +1 -0
- package/dist/js/schema/project.json +3 -0
- package/dist/js/schema/properties_directory/non_scalar/workflow.json +3682 -4421
- package/dist/js/schema/property/holder.json +3717 -4456
- package/dist/js/schema/software/application.json +53 -24
- package/dist/js/schema/software/application_properties.json +68 -0
- package/dist/js/schema/software/application_with_build_config.json +52 -23
- package/dist/js/schema/software/executable.json +67 -108
- package/dist/js/schema/software/executable_properties.json +24 -0
- package/dist/js/schema/software/flavor.json +90 -128
- package/dist/js/schema/software/flavor_properties.json +50 -0
- package/dist/js/schema/software/template.json +30 -35
- package/dist/js/schema/software/template_properties.json +44 -0
- package/dist/js/schema/software_directory/modeling/deepmd.json +48 -19
- package/dist/js/schema/software_directory/modeling/lammps.json +47 -18
- package/dist/js/schema/software_directory/modeling/nwchem.json +48 -19
- package/dist/js/schema/software_directory/modeling/unit/execution.json +2019 -455
- package/dist/js/schema/software_directory/modeling/vasp.json +48 -19
- package/dist/js/schema/software_directory/scripting/jupyter_lab.json +48 -19
- package/dist/js/schema/software_directory/scripting/python.json +48 -19
- package/dist/js/schema/software_directory/scripting/shell.json +48 -19
- package/dist/js/schema/software_directory/scripting/unit/execution.json +2019 -455
- package/dist/js/schema/system/bankable.json +4 -0
- package/dist/js/schema/system/creator.json +2 -1
- package/dist/js/schema/system/creator_account.json +3 -0
- package/dist/js/schema/system/in_set.json +3 -0
- package/dist/js/schema/system/name.json +3 -0
- package/dist/js/schema/system/owner.json +2 -1
- package/dist/js/schema/system/path_entity.json +3 -0
- package/dist/js/schema/system/runtime_item.json +17 -0
- package/dist/js/schema/system/runtime_items.json +94 -0
- package/dist/js/schema/workflow/base.json +4591 -39
- package/dist/js/schema/workflow/base_flow.json +1 -1
- package/dist/js/schema/workflow/subworkflow/mixin.json +3919 -0
- package/dist/js/schema/workflow/subworkflow/unit.json +2365 -1560
- package/dist/js/schema/workflow/subworkflow.json +3137 -1852
- package/dist/js/schema/workflow/unit/assertion.json +96 -140
- package/dist/js/schema/workflow/unit/assignment.json +129 -173
- package/dist/js/schema/workflow/unit/base.json +90 -133
- package/dist/js/schema/workflow/unit/condition.json +132 -175
- package/dist/js/schema/workflow/unit/context/_base.json +20 -0
- package/dist/js/schema/workflow/unit/context/_extra_data_material_hash.json +14 -0
- package/dist/js/schema/workflow/unit/context/item/boundaryConditions.json +63 -0
- package/dist/js/schema/workflow/unit/context/item/collinearMagnetization.json +82 -0
- package/dist/js/schema/workflow/unit/context/item/cutoffs.json +38 -0
- package/dist/js/schema/workflow/unit/context/item/dynamics.json +48 -0
- package/dist/js/schema/workflow/unit/context/item/grid.json +100 -0
- package/dist/js/schema/workflow/unit/context/item/hubbard_j.json +59 -0
- package/dist/js/schema/workflow/unit/context/item/hubbard_legacy.json +49 -0
- package/dist/js/schema/workflow/unit/context/item/hubbard_u.json +57 -0
- package/dist/js/schema/workflow/unit/context/item/hubbard_v.json +64 -0
- package/dist/js/schema/workflow/unit/context/item/input.json +712 -0
- package/dist/js/schema/workflow/unit/context/item/mlSettings.json +43 -0
- package/dist/js/schema/workflow/unit/context/item/mlTrainTestSplit.json +37 -0
- package/dist/js/schema/workflow/unit/context/item/neb.json +35 -0
- package/dist/js/schema/workflow/unit/context/item/nonCollinearMagnetization.json +150 -0
- package/dist/js/schema/workflow/unit/context/item/path.json +62 -0
- package/dist/js/schema/workflow/unit/context/item.json +1594 -0
- package/dist/js/schema/workflow/unit/execution.json +1928 -423
- package/dist/js/schema/workflow/unit/input/_input.json +74 -12
- package/dist/js/schema/workflow/unit/input/_inputItem.json +70 -10
- package/dist/js/schema/workflow/unit/input/_inputItemId.json +3 -1
- package/dist/js/schema/workflow/unit/io/api.json +5 -1
- package/dist/js/schema/workflow/unit/io/db_collection.json +24 -0
- package/dist/js/schema/workflow/unit/io/db_ids.json +22 -0
- package/dist/js/schema/workflow/unit/io/object_storage.json +5 -1
- package/dist/js/schema/workflow/unit/io.json +182 -253
- package/dist/js/schema/workflow/unit/map.json +134 -177
- package/dist/js/schema/workflow/unit/mixins/assertion.json +23 -0
- package/dist/js/schema/workflow/unit/mixins/assignment.json +57 -0
- package/dist/js/schema/workflow/unit/mixins/base.json +50 -0
- package/dist/js/schema/workflow/unit/mixins/condition.json +61 -0
- package/dist/js/schema/workflow/unit/mixins/execution.json +1998 -0
- package/dist/js/schema/workflow/unit/mixins/io.json +131 -0
- package/dist/js/schema/workflow/unit/mixins/map.json +60 -0
- package/dist/js/schema/workflow/unit/mixins/processing.json +27 -0
- package/dist/js/schema/workflow/unit/mixins/reduce.json +43 -0
- package/dist/js/schema/workflow/unit/mixins/subworkflow.json +11 -0
- package/dist/js/schema/workflow/unit/reduce.json +117 -160
- package/dist/js/schema/workflow/unit/subworkflow.json +91 -134
- package/dist/js/schema/workflow/unit.json +285 -2477
- package/dist/js/schema/workflow.json +3684 -4422
- package/dist/js/schemas.json +1 -1
- package/dist/js/scripts/compileTs.js +1 -1
- package/dist/js/scripts/setSchemaIds.js +2 -1
- package/dist/js/types.d.ts +27163 -15301
- package/dist/js/types.js +5 -5
- package/dist/js/utils/ajv.js +5 -4
- package/dist/js/utils/common.js +3 -2
- package/dist/js/utils/filesystem.js +3 -2
- package/example/material.json +7 -1
- package/example/model.json +2 -1
- package/example/software/application.json +1 -0
- package/example/software/executable.json +3 -4
- package/example/software/flavor.json +9 -2
- package/example/software/template.json +5 -8
- package/example/software_directory/modeling/espresso.json +2 -1
- package/example/software_directory/modeling/nwchem.json +4 -2
- package/example/software_directory/modeling/unit/execution.json +17 -2
- package/example/software_directory/modeling/vasp.json +2 -1
- package/example/software_directory/scripting/jupyter-lab.json +2 -1
- package/example/software_directory/scripting/python.json +2 -1
- package/example/software_directory/scripting/shell.json +2 -1
- package/example/software_directory/scripting/unit/execution.json +17 -2
- package/example/system/runtime_items.json +14 -0
- package/example/workflow/unit/assignment.json +5 -1
- package/example/workflow/unit/condition.json +5 -1
- package/example/workflow/unit/execution.json +7 -3
- package/example/workflow/unit/io/api.json +1 -0
- package/example/workflow/unit/io/db_collection.json +5 -0
- package/example/workflow/unit/io/db_ids.json +6 -0
- package/example/workflow/unit/io/object_storage.json +2 -1
- package/example/workflow/unit/io.json +9 -29
- package/example/workflow/unit/map.json +5 -1
- package/example/workflow/unit/reduce.json +5 -1
- package/example/workflow.json +6 -1
- package/package.json +2 -1
- package/schema/apse/file/applications/espresso/7.2/pw.x/atomic_species.json +6 -1
- package/schema/context_providers_directory/by_application/nwchem_total_energy_context_provider.json +7 -1
- package/schema/context_providers_directory/by_application/qe_neb_context_provider.json +12 -6
- package/schema/context_providers_directory/by_application/qe_pwx_context_provider.json +10 -1
- package/schema/context_providers_directory/by_application/vasp_context_provider.json +7 -1
- package/schema/context_providers_directory/by_application/vasp_neb_context_provider.json +7 -1
- package/schema/context_providers_directory/collinear_magnetization_context_provider.json +18 -4
- package/schema/context_providers_directory/non_collinear_magnetization_context_provider.json +7 -0
- package/schema/context_providers_directory/points_grid_data_provider.json +24 -7
- package/schema/context_providers_directory/points_path_data_provider.json +7 -3
- package/schema/context_providers_directory/points_path_data_provider_rendering.json +32 -0
- package/schema/job/base.json +4 -5
- package/schema/job/compute.json +1 -1
- package/schema/job/compute_property.json +15 -0
- package/schema/material/material_properties.json +65 -0
- package/schema/material/metadata/boundary_conditions.json +24 -0
- package/schema/material/metadata/bulk_properties.json +13 -0
- package/schema/material/metadata/slab_properties.json +41 -0
- package/schema/material/metadata.json +27 -0
- package/schema/material.json +5 -57
- package/schema/method.json +7 -1
- package/schema/model.json +0 -1
- package/schema/models_directory/legacy/any.json +20 -0
- package/schema/models_directory/legacy/dft.json +63 -12
- package/schema/models_directory/legacy/ml.json +10 -7
- package/schema/models_directory/legacy/unknown.json +10 -7
- package/schema/software/application.json +4 -35
- package/schema/software/application_properties.json +68 -0
- package/schema/software/executable.json +5 -23
- package/schema/software/executable_properties.json +24 -0
- package/schema/software/flavor.json +6 -28
- package/schema/software/flavor_properties.json +33 -0
- package/schema/software/template.json +2 -26
- package/schema/software/template_properties.json +44 -0
- package/schema/system/bankable.json +5 -1
- package/schema/system/creator.json +4 -1
- package/schema/system/creator_account.json +4 -1
- package/schema/system/in_set.json +4 -1
- package/schema/system/name.json +4 -1
- package/schema/system/owner.json +4 -1
- package/schema/system/runtime_item.json +17 -0
- package/schema/system/runtime_items.json +42 -0
- package/schema/workflow/base.json +17 -17
- package/schema/workflow/subworkflow/mixin.json +48 -0
- package/schema/workflow/subworkflow/unit.json +0 -6
- package/schema/workflow/subworkflow.json +4 -31
- package/schema/workflow/unit/assertion.json +2 -16
- package/schema/workflow/unit/assignment.json +2 -34
- package/schema/workflow/unit/base.json +6 -51
- package/schema/workflow/unit/condition.json +2 -38
- package/schema/workflow/unit/context/_base.json +20 -0
- package/schema/workflow/unit/context/_extra_data_material_hash.json +14 -0
- package/schema/workflow/unit/context/item/boundaryConditions.json +27 -0
- package/schema/workflow/unit/context/item/collinearMagnetization.json +27 -0
- package/schema/workflow/unit/context/item/cutoffs.json +20 -0
- package/schema/workflow/unit/context/item/dynamics.json +20 -0
- package/schema/workflow/unit/context/item/grid.json +31 -0
- package/schema/workflow/unit/context/item/hubbard_j.json +20 -0
- package/schema/workflow/unit/context/item/hubbard_legacy.json +20 -0
- package/schema/workflow/unit/context/item/hubbard_u.json +27 -0
- package/schema/workflow/unit/context/item/hubbard_v.json +20 -0
- package/schema/workflow/unit/context/item/input.json +47 -0
- package/schema/workflow/unit/context/item/mlSettings.json +20 -0
- package/schema/workflow/unit/context/item/mlTrainTestSplit.json +20 -0
- package/schema/workflow/unit/context/item/neb.json +20 -0
- package/schema/workflow/unit/context/item/nonCollinearMagnetization.json +27 -0
- package/schema/workflow/unit/context/item/path.json +33 -0
- package/schema/workflow/unit/context/item.json +55 -0
- package/schema/workflow/unit/execution.json +4 -25
- package/schema/workflow/unit/input/_input.json +1 -1
- package/schema/workflow/unit/input/_inputItem.json +9 -9
- package/schema/workflow/unit/input/_inputItemId.json +3 -1
- package/schema/workflow/unit/io/api.json +6 -2
- package/schema/workflow/unit/io/db_collection.json +24 -0
- package/schema/workflow/unit/io/db_ids.json +22 -0
- package/schema/workflow/unit/io/object_storage.json +6 -2
- package/schema/workflow/unit/io.json +2 -39
- package/schema/workflow/unit/map.json +2 -53
- package/schema/workflow/unit/mixins/assertion.json +23 -0
- package/schema/workflow/unit/mixins/assignment.json +42 -0
- package/schema/workflow/unit/mixins/base.json +50 -0
- package/schema/workflow/unit/mixins/condition.json +46 -0
- package/schema/workflow/unit/mixins/execution.json +49 -0
- package/schema/workflow/unit/mixins/io.json +46 -0
- package/schema/workflow/unit/mixins/map.json +61 -0
- package/schema/workflow/unit/{processing.json → mixins/processing.json} +3 -7
- package/schema/workflow/unit/mixins/reduce.json +44 -0
- package/schema/workflow/unit/mixins/subworkflow.json +12 -0
- package/schema/workflow/unit/reduce.json +2 -36
- package/schema/workflow/unit/subworkflow.json +4 -6
- package/schema/workflow/unit.json +1 -19
- package/schema/workflow.json +19 -15
- package/src/html/index.html +2 -1
- package/src/js/esse/JSONSchemasGenerator.ts +2 -1
- package/src/js/esse/JSONSchemasInterface.ts +1 -1
- package/src/js/esse/schemaUtils.ts +1 -1
- package/src/js/esse/server/utils.ts +82 -0
- package/src/js/esse/utils.ts +0 -74
- package/src/js/scripts/compileTs.ts +1 -1
- package/src/js/scripts/setSchemaIds.ts +1 -0
- package/src/js/utils/ajv.ts +1 -1
- package/dist/js/example/workflow/unit/io/db.json +0 -15
- package/dist/js/example/workflow/unit/processing.json +0 -13
- package/dist/js/schema/workflow/unit/io/db.json +0 -40
- package/dist/js/schema/workflow/unit/processing.json +0 -242
- package/example/workflow/unit/io/db.json +0 -15
- package/example/workflow/unit/processing.json +0 -13
- package/schema/workflow/unit/io/db.json +0 -40
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "workflow/unit/mixins/map",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"title": "map unit mixin schema",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"type": {
|
|
8
|
+
"const": "map"
|
|
9
|
+
},
|
|
10
|
+
"workflowId": {
|
|
11
|
+
"description": "Id of workflow to run inside map",
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"input": {
|
|
15
|
+
"description": "Input information for map.",
|
|
16
|
+
"type": "object",
|
|
17
|
+
"properties": {
|
|
18
|
+
"target": {
|
|
19
|
+
"description": "Name of the target variable to substitute using the values below. e.g. K_POINTS",
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"scope": {
|
|
23
|
+
"description": "Scope to retrieve `values` from, global or flowchartId. Optional if `values` is given.",
|
|
24
|
+
"type": "string"
|
|
25
|
+
},
|
|
26
|
+
"name": {
|
|
27
|
+
"description": "Name of the variable inside the scope to retrieve `values` from. Optional if `values` is given.",
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"values": {
|
|
31
|
+
"description": "Sequence of values for the target Jinja variable. Optional if `scope` and `name` are given. This can be used for map-reduce type parallel execution",
|
|
32
|
+
"type": "array",
|
|
33
|
+
"items": {
|
|
34
|
+
"oneOf": [
|
|
35
|
+
{
|
|
36
|
+
"type": "string"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"type": "number"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"type": "object"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"useValues": {
|
|
48
|
+
"type": "boolean"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"required": [
|
|
52
|
+
"target"
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"required": [
|
|
57
|
+
"input",
|
|
58
|
+
"workflowId"
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "workflow/unit/processing",
|
|
2
|
+
"$id": "workflow/unit/mixins/processing",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
-
"title": "processing unit schema",
|
|
4
|
+
"title": "processing unit mixin schema",
|
|
5
5
|
"type": "object",
|
|
6
|
-
"allOf": [
|
|
7
|
-
{
|
|
8
|
-
"$ref": "./base.json"
|
|
9
|
-
}
|
|
10
|
-
],
|
|
11
6
|
"properties": {
|
|
12
7
|
"type": {
|
|
13
8
|
"const": "processing"
|
|
@@ -30,3 +25,4 @@
|
|
|
30
25
|
"inputData"
|
|
31
26
|
]
|
|
32
27
|
}
|
|
28
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "workflow/unit/mixins/reduce",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"title": "reduce unit mixin schema",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"type": {
|
|
8
|
+
"const": "reduce"
|
|
9
|
+
},
|
|
10
|
+
"mapFlowchartId": {
|
|
11
|
+
"description": "corresponding map unit flowchart ID",
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"input": {
|
|
15
|
+
"description": "input information for reduce unit",
|
|
16
|
+
"type": "array",
|
|
17
|
+
"items": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"properties": {
|
|
20
|
+
"operation": {
|
|
21
|
+
"description": "reduce operation, e.g. aggregate",
|
|
22
|
+
"type": "string"
|
|
23
|
+
},
|
|
24
|
+
"arguments": {
|
|
25
|
+
"description": "arguments which are passed to reduce operation function",
|
|
26
|
+
"type": "array",
|
|
27
|
+
"items": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"required": [
|
|
33
|
+
"operation",
|
|
34
|
+
"arguments"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"required": [
|
|
40
|
+
"mapFlowchartId",
|
|
41
|
+
"input"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
|
|
@@ -6,43 +6,9 @@
|
|
|
6
6
|
"allOf": [
|
|
7
7
|
{
|
|
8
8
|
"$ref": "./base.json"
|
|
9
|
-
}
|
|
10
|
-
],
|
|
11
|
-
"properties": {
|
|
12
|
-
"type": {
|
|
13
|
-
"const": "reduce"
|
|
14
|
-
},
|
|
15
|
-
"mapFlowchartId": {
|
|
16
|
-
"description": "corresponding map unit flowchart ID",
|
|
17
|
-
"type": "string"
|
|
18
9
|
},
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
"type": "array",
|
|
22
|
-
"items": {
|
|
23
|
-
"type": "object",
|
|
24
|
-
"properties": {
|
|
25
|
-
"operation": {
|
|
26
|
-
"description": "reduce operation, e.g. aggregate",
|
|
27
|
-
"type": "string"
|
|
28
|
-
},
|
|
29
|
-
"arguments": {
|
|
30
|
-
"description": "arguments which are passed to reduce operation function",
|
|
31
|
-
"type": "array",
|
|
32
|
-
"items": {
|
|
33
|
-
"type": "string"
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"required": [
|
|
38
|
-
"operation",
|
|
39
|
-
"arguments"
|
|
40
|
-
]
|
|
41
|
-
}
|
|
10
|
+
{
|
|
11
|
+
"$ref": "./mixins/reduce.json"
|
|
42
12
|
}
|
|
43
|
-
},
|
|
44
|
-
"required": [
|
|
45
|
-
"mapFlowchartId",
|
|
46
|
-
"input"
|
|
47
13
|
]
|
|
48
14
|
}
|
|
@@ -5,29 +5,11 @@
|
|
|
5
5
|
"type": "object",
|
|
6
6
|
"oneOf": [
|
|
7
7
|
{
|
|
8
|
-
"$ref": "./unit/
|
|
8
|
+
"$ref": "./unit/map.json"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
"$ref": "./unit/reduce.json"
|
|
12
12
|
},
|
|
13
|
-
{
|
|
14
|
-
"$ref": "./unit/condition.json"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"$ref": "./unit/assertion.json"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"$ref": "./unit/execution.json"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"$ref": "./unit/assignment.json"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"$ref": "./unit/processing.json"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"$ref": "./unit/map.json"
|
|
30
|
-
},
|
|
31
13
|
{
|
|
32
14
|
"$ref": "./unit/subworkflow.json"
|
|
33
15
|
}
|
package/schema/workflow.json
CHANGED
|
@@ -4,32 +4,36 @@
|
|
|
4
4
|
"title": "workflow schema",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"allOf": [
|
|
7
|
+
{
|
|
8
|
+
"$ref": "in_memory_entity/named.json"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"$ref": "system/metadata.json"
|
|
12
|
+
},
|
|
7
13
|
{
|
|
8
14
|
"$ref": "workflow/base.json"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"$ref": "system/description.json"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"$ref": "system/tags.json"
|
|
9
21
|
}
|
|
10
22
|
],
|
|
11
23
|
"properties": {
|
|
12
|
-
"
|
|
13
|
-
"description": "Array of
|
|
24
|
+
"workflows": {
|
|
25
|
+
"description": "Array of workflows with the same schema as the current one.",
|
|
14
26
|
"type": "array",
|
|
15
27
|
"items": {
|
|
16
|
-
"
|
|
17
|
-
{
|
|
18
|
-
"$ref": "workflow/subworkflow.json"
|
|
19
|
-
}
|
|
20
|
-
]
|
|
28
|
+
"type": "object"
|
|
21
29
|
}
|
|
22
30
|
},
|
|
23
|
-
"
|
|
24
|
-
"description": "
|
|
25
|
-
"
|
|
26
|
-
"items": {
|
|
27
|
-
"$ref": "workflow/unit.json"
|
|
28
|
-
}
|
|
31
|
+
"compute": {
|
|
32
|
+
"description": "compute parameters",
|
|
33
|
+
"$ref": "job/compute.json"
|
|
29
34
|
}
|
|
30
35
|
},
|
|
31
36
|
"required": [
|
|
32
|
-
"
|
|
33
|
-
"subworkflows"
|
|
37
|
+
"workflows"
|
|
34
38
|
]
|
|
35
39
|
}
|
package/src/html/index.html
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>ESSEntial Source of Schemas and Examples (ESSE)</title>
|
|
7
|
-
|
|
7
|
+
<!-- URL-encoded svg favicon with theme-aware styles -->
|
|
8
|
+
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20xmlns%3Asvgjs%3D%22http%3A%2F%2Fsvgjs.com%2Fsvgjs%22%20width%3D%22512%22%20height%3D%22512%22%3E%3Cstyle%3E%40media%20%28prefers-color-scheme%3Alight%29%7B.theme-color%7Bfill%3A%23000000%7D%7D%40media%20%28prefers-color-scheme%3Adark%29%7B.theme-color%7Bfill%3A%23FFFFFF%7D%7D%3C%2Fstyle%3E%3Csvg%20width%3D%22512%22%20height%3D%22512%22%20viewBox%3D%220%200%20512%20512%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ccircle%20class%3D%22theme-color%22%20cx%3D%22256%22%20cy%3D%22256%22%20r%3D%2280%22%20transform%3D%22rotate%28-180%20256%20256%29%22%3E%3C%2Fcircle%3E%3Cpath%20class%3D%22theme-color%22%20d%3D%22M334%20100.056C334%2050.8718%20373.847%2011%20423%2011C472.153%2011%20512%2050.8718%20512%20100.056C512%20130.306%20480.115%20171.982%20480.115%20171.982C480.115%20171.982%20427.327%20236.133%20427.327%20256.326C427.327%20276.516%20456.851%20312.743%20480.115%20341.285C497.341%20362.431%20512%20383.184%20512%20411.944C512%20461.128%20472.153%20501%20423%20501C373.847%20501%20334%20461.128%20334%20411.944C334%20384.78%20349.322%20361.543%20365.887%20341.285C389.152%20312.74%20418.674%20276.516%20418.674%20256.326C418.674%20236.289%20366.784%20171.982%20366.784%20171.982C366.784%20171.982%20334%20131.672%20334%20100.056Z%22%20fill%3D%22%23000000%22%3E%3C%2Fpath%3E%3Cpath%20class%3D%22theme-color%22%20d%3D%22M0%20100.056C0%2050.8718%2039.8467%2011%2089%2011C138.153%2011%20178%2050.8718%20178%20100.056C178%20130.306%20146.115%20171.982%20146.115%20171.982C146.115%20171.982%2093.3276%20236.133%2093.3276%20256.326C93.3276%20276.516%20122.851%20312.743%20146.115%20341.285C163.341%20362.431%20178%20383.184%20178%20411.944C178%20461.128%20138.153%20501%2089%20501C39.8467%20501%200%20461.128%200%20411.944C0%20384.78%2015.3226%20361.543%2031.8867%20341.285C55.1519%20312.74%2084.6738%20276.516%2084.6738%20256.326C84.6738%20236.289%2032.7845%20171.982%2032.7845%20171.982C32.7845%20171.982%200%20131.672%200%20100.056Z%22%20fill%3D%22%23000000%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E%3C%2Fsvg%3E" />
|
|
8
9
|
<link rel="stylesheet" href="style.css">
|
|
9
10
|
</head>
|
|
10
11
|
<body>
|
|
@@ -4,8 +4,9 @@ import yaml from "js-yaml";
|
|
|
4
4
|
import mergeAllOf from "json-schema-merge-allof";
|
|
5
5
|
import path from "path";
|
|
6
6
|
|
|
7
|
+
import { JSONSchemaWithPath, parseIncludeReferenceStatementsByDir } from "./server/utils";
|
|
7
8
|
import { EXAMPLES_DIR, PROPERTIES_MANIFEST_PATH, SCHEMAS_DIR } from "./settings";
|
|
8
|
-
import { JSONSchema
|
|
9
|
+
import type { JSONSchema } from "./utils";
|
|
9
10
|
|
|
10
11
|
interface JSONSchemasGeneratorConfig {
|
|
11
12
|
schemasDir: string;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side schema parsing utilities.
|
|
3
|
+
*
|
|
4
|
+
* Use this module only in Node/server contexts where the filesystem is available.
|
|
5
|
+
* It walks directories and reads JSON schema files from disk; do not import it in
|
|
6
|
+
* browser bundles.
|
|
7
|
+
*/
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
import deref from "json-schema-deref-sync";
|
|
10
|
+
import path from "path";
|
|
11
|
+
|
|
12
|
+
import { JSONInclude } from "../../json_include";
|
|
13
|
+
import { walkDirSync } from "../../utils/filesystem";
|
|
14
|
+
import type { JSONSchema } from "../utils";
|
|
15
|
+
|
|
16
|
+
export interface JSONSchemaWithPath {
|
|
17
|
+
data: JSONSchema;
|
|
18
|
+
path: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Resolves `include` and `$ref` statements.
|
|
23
|
+
* @param filePath {String} file to parse.
|
|
24
|
+
*/
|
|
25
|
+
export function parseIncludeReferenceStatements(filePath: string): JSONSchema {
|
|
26
|
+
const jsonResolver = new JSONInclude();
|
|
27
|
+
const parsed = jsonResolver.parseIncludeStatements(filePath) as JSONSchema;
|
|
28
|
+
const dirPath = path.dirname(filePath);
|
|
29
|
+
// Store the original $id before dereferencing
|
|
30
|
+
const originalId = parsed.$id;
|
|
31
|
+
let dereferenced = deref(parsed, { baseFolder: dirPath, removeIds: true });
|
|
32
|
+
// handle circular references and use non-dereferenced source
|
|
33
|
+
if (dereferenced instanceof Error && dereferenced.message === "Circular self reference") {
|
|
34
|
+
dereferenced = parsed;
|
|
35
|
+
}
|
|
36
|
+
// Restore the original $id after dereferencing
|
|
37
|
+
if (originalId) {
|
|
38
|
+
dereferenced.$id = originalId;
|
|
39
|
+
}
|
|
40
|
+
return dereferenced;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function parseIncludeReferenceStatementsByDir(
|
|
44
|
+
dirPath: string,
|
|
45
|
+
wrapInDataAndPath: true,
|
|
46
|
+
): JSONSchemaWithPath[];
|
|
47
|
+
|
|
48
|
+
export function parseIncludeReferenceStatementsByDir(
|
|
49
|
+
dirPath: string,
|
|
50
|
+
wrapInDataAndPath?: false,
|
|
51
|
+
): JSONSchema[];
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Resolves `include` and `$ref` statements for all the JSON files inside a given directory.
|
|
55
|
+
* @param dirPath directory to parse.
|
|
56
|
+
*/
|
|
57
|
+
export function parseIncludeReferenceStatementsByDir(dirPath: string, wrapInDataAndPath = false) {
|
|
58
|
+
const schemas: JSONSchema[] = [];
|
|
59
|
+
const schemasWithPath: JSONSchemaWithPath[] = [];
|
|
60
|
+
const topDir = path.resolve(__dirname, "../../../../");
|
|
61
|
+
|
|
62
|
+
walkDirSync(dirPath, (filePath) => {
|
|
63
|
+
if (filePath.endsWith(".json")) {
|
|
64
|
+
const config = parseIncludeReferenceStatements(filePath);
|
|
65
|
+
if (wrapInDataAndPath) {
|
|
66
|
+
const _path = path.join(
|
|
67
|
+
// remove leading slashes and "example" from path
|
|
68
|
+
path
|
|
69
|
+
.dirname(filePath)
|
|
70
|
+
.replace(path.join(topDir, "example"), "")
|
|
71
|
+
.replace(/^\/+/, ""),
|
|
72
|
+
path.basename(filePath).replace(".json", ""),
|
|
73
|
+
);
|
|
74
|
+
schemasWithPath.push({ data: config, path: _path });
|
|
75
|
+
} else {
|
|
76
|
+
schemas.push(config);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
return wrapInDataAndPath ? schemasWithPath : schemas;
|
|
82
|
+
}
|
package/src/js/esse/utils.ts
CHANGED
|
@@ -1,83 +1,9 @@
|
|
|
1
1
|
import { JSONSchema7, JSONSchema7Definition } from "json-schema";
|
|
2
|
-
// @ts-ignore
|
|
3
|
-
import deref from "json-schema-deref-sync";
|
|
4
|
-
import path from "path";
|
|
5
|
-
|
|
6
|
-
import { JSONInclude } from "../json_include";
|
|
7
|
-
import { walkDirSync } from "../utils/filesystem";
|
|
8
2
|
|
|
9
3
|
export type JSONSchema = JSONSchema7;
|
|
10
4
|
|
|
11
5
|
export type JSONSchemaDefinition = JSONSchema7Definition;
|
|
12
6
|
|
|
13
|
-
/**
|
|
14
|
-
* Resolves `include` and `$ref` statements.
|
|
15
|
-
* @param filePath {String} file to parse.
|
|
16
|
-
*/
|
|
17
|
-
export function parseIncludeReferenceStatements(filePath: string): JSONSchema {
|
|
18
|
-
const jsonResolver = new JSONInclude();
|
|
19
|
-
const parsed = jsonResolver.parseIncludeStatements(filePath) as JSONSchema;
|
|
20
|
-
const dirPath = path.dirname(filePath);
|
|
21
|
-
// Store the original $id before dereferencing
|
|
22
|
-
const originalId = parsed.$id;
|
|
23
|
-
let dereferenced = deref(parsed, { baseFolder: dirPath, removeIds: true });
|
|
24
|
-
// handle circular references and use non-dereferenced source
|
|
25
|
-
if (dereferenced instanceof Error && dereferenced.message === "Circular self reference") {
|
|
26
|
-
dereferenced = parsed;
|
|
27
|
-
}
|
|
28
|
-
// Restore the original $id after dereferencing
|
|
29
|
-
if (originalId) {
|
|
30
|
-
dereferenced.$id = originalId;
|
|
31
|
-
}
|
|
32
|
-
return dereferenced;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface JSONSchemaWithPath {
|
|
36
|
-
data: JSONSchema;
|
|
37
|
-
path: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function parseIncludeReferenceStatementsByDir(
|
|
41
|
-
dirPath: string,
|
|
42
|
-
wrapInDataAndPath: true,
|
|
43
|
-
): JSONSchemaWithPath[];
|
|
44
|
-
|
|
45
|
-
export function parseIncludeReferenceStatementsByDir(
|
|
46
|
-
dirPath: string,
|
|
47
|
-
wrapInDataAndPath?: false,
|
|
48
|
-
): JSONSchema[];
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Resolves `include` and `$ref` statements for all the JSON files inside a given directory.
|
|
52
|
-
* @param dirPath directory to parse.
|
|
53
|
-
*/
|
|
54
|
-
export function parseIncludeReferenceStatementsByDir(dirPath: string, wrapInDataAndPath = false) {
|
|
55
|
-
const schemas: JSONSchema[] = [];
|
|
56
|
-
const schemasWithPath: JSONSchemaWithPath[] = [];
|
|
57
|
-
const topDir = path.resolve(__dirname, "../../../");
|
|
58
|
-
|
|
59
|
-
walkDirSync(dirPath, (filePath) => {
|
|
60
|
-
if (filePath.endsWith(".json")) {
|
|
61
|
-
const config = parseIncludeReferenceStatements(filePath);
|
|
62
|
-
if (wrapInDataAndPath) {
|
|
63
|
-
const _path = path.join(
|
|
64
|
-
// remove leading slashes and "example" from path
|
|
65
|
-
path
|
|
66
|
-
.dirname(filePath)
|
|
67
|
-
.replace(path.join(topDir, "example"), "")
|
|
68
|
-
.replace(/^\/+/, ""),
|
|
69
|
-
path.basename(filePath).replace(".json", ""),
|
|
70
|
-
);
|
|
71
|
-
schemasWithPath.push({ data: config, path: _path });
|
|
72
|
-
} else {
|
|
73
|
-
schemas.push(config);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
return wrapInDataAndPath ? schemasWithPath : schemas;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
7
|
function isPlainObject(value: unknown): value is Record<string, unknown> {
|
|
82
8
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
83
9
|
}
|
|
@@ -3,7 +3,7 @@ import fs from "fs";
|
|
|
3
3
|
import { compile } from "json-schema-to-typescript";
|
|
4
4
|
|
|
5
5
|
import { mapObjectDeep } from "../esse/schemaUtils";
|
|
6
|
-
import { JSONSchema } from "../esse/utils";
|
|
6
|
+
import type { JSONSchema } from "../esse/utils";
|
|
7
7
|
import { walkDir } from "../utils/filesystem";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -15,6 +15,7 @@ export default function setSchemaIds(schemaDir: string) {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
const fileContents = fs.readFileSync(filePath);
|
|
18
|
+
console.log(filePath);
|
|
18
19
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
19
20
|
const { $id, ...schema } = JSON.parse(fileContents.toString());
|
|
20
21
|
const schemaId = filePath.replace(schemaDir, "").replace(".json", "").replace(/_/g, "-");
|
package/src/js/utils/ajv.ts
CHANGED
|
@@ -4,7 +4,7 @@ import addFormats from "ajv-formats";
|
|
|
4
4
|
|
|
5
5
|
import { mapObjectDeep } from "../esse/schemaUtils";
|
|
6
6
|
import { AnyObject } from "../esse/types";
|
|
7
|
-
import { JSONSchema } from "../esse/utils";
|
|
7
|
+
import type { JSONSchema } from "../esse/utils";
|
|
8
8
|
|
|
9
9
|
function addAdditionalPropertiesToSchema(schema: JSONSchema, additionalProperties = false) {
|
|
10
10
|
return mapObjectDeep(schema, (object) => {
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"flowchartId": "data_transformation_manipulation",
|
|
3
|
-
"inputData": {
|
|
4
|
-
"cleanMissingData": true,
|
|
5
|
-
"removeDuplicateRows": true,
|
|
6
|
-
"replaceNoneValuesWith": 0
|
|
7
|
-
},
|
|
8
|
-
"name": "data_transformation_manipulation",
|
|
9
|
-
"operation": "data_transformation",
|
|
10
|
-
"operationType": "manipulation",
|
|
11
|
-
"status": "idle",
|
|
12
|
-
"type": "processing"
|
|
13
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$id": "workflow/unit/io/db",
|
|
3
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
-
"title": "data IO database input/output schema",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"oneOf": [
|
|
7
|
-
{
|
|
8
|
-
"properties": {
|
|
9
|
-
"ids": {
|
|
10
|
-
"description": "IDs of item to retrieve from db",
|
|
11
|
-
"type": "array",
|
|
12
|
-
"items": {
|
|
13
|
-
"type": "string"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"required": [
|
|
18
|
-
"ids"
|
|
19
|
-
],
|
|
20
|
-
"additionalProperties": true
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"properties": {
|
|
24
|
-
"collection": {
|
|
25
|
-
"description": "db collection name",
|
|
26
|
-
"type": "string"
|
|
27
|
-
},
|
|
28
|
-
"draft": {
|
|
29
|
-
"description": "whether the result should be saved as draft",
|
|
30
|
-
"type": "boolean"
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
"required": [
|
|
34
|
-
"collection",
|
|
35
|
-
"draft"
|
|
36
|
-
],
|
|
37
|
-
"additionalProperties": true
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
}
|