@mat3ra/esse 2024.2.6-0 → 2024.2.19-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/.eslintrc.json +9 -1
- package/.mocharc.json +5 -0
- package/build_schemas.js +7 -32
- package/compile_ts.ts +3 -0
- package/example/models_directory/re.json +1 -0
- package/example/workflow/subworkflow.json +1 -1
- package/example/workflow.json +2 -1
- package/lib/js/esse/JSONSchemasGenerator.d.ts +20 -0
- package/lib/js/esse/JSONSchemasGenerator.js +64 -0
- package/lib/js/esse/JSONSchemasInterface.d.ts +31 -0
- package/lib/js/esse/JSONSchemasInterface.js +48 -0
- package/lib/js/esse/JSONSchemasInterfaceServer.d.ts +9 -0
- package/lib/js/esse/JSONSchemasInterfaceServer.js +46 -0
- package/lib/js/esse/schemaUtils.d.ts +4 -0
- package/lib/js/esse/schemaUtils.js +13 -74
- package/lib/js/esse/settings.d.ts +3 -0
- package/lib/js/esse/settings.js +9 -21
- package/lib/js/esse/types.d.ts +3 -0
- package/lib/js/esse/types.js +2 -0
- package/lib/js/esse/utils.d.ts +14 -0
- package/lib/js/esse/utils.js +42 -62
- package/lib/js/example/3pse/file/applications/espresso/7.2/pw.x.json +94 -0
- package/lib/js/example/core/abstract/2d_data.json +19 -0
- package/lib/js/example/core/abstract/2d_plot.json +26 -0
- package/lib/js/example/core/abstract/3d_grid.json +12 -0
- package/lib/js/example/core/abstract/3d_tensor.json +17 -0
- package/lib/js/example/core/abstract/3d_vector_basis.json +17 -0
- package/lib/js/example/core/abstract/point.json +5 -0
- package/lib/js/example/core/abstract/vector.json +5 -0
- package/lib/js/example/core/primitive/1d_data_series.json +12 -0
- package/lib/js/example/core/primitive/3d_lattice.json +8 -0
- package/lib/js/example/core/primitive/array_of_3_booleans.json +5 -0
- package/lib/js/example/core/primitive/array_of_3_numbers.json +5 -0
- package/lib/js/example/core/primitive/array_of_ids.json +8 -0
- package/lib/js/example/core/primitive/axis.json +4 -0
- package/lib/js/example/core/primitive/scalar.json +3 -0
- package/lib/js/example/core/primitive/string.json +3 -0
- package/lib/js/example/core/reference/experiment/condition.json +12 -0
- package/lib/js/example/core/reference/experiment/location.json +4 -0
- package/lib/js/example/core/reference/experiment.json +38 -0
- package/lib/js/example/core/reference/literature/name.json +5 -0
- package/lib/js/example/core/reference/literature/pages.json +4 -0
- package/lib/js/example/core/reference/literature.json +10 -0
- package/lib/js/example/core/reference/modeling/exabyte.json +9 -0
- package/lib/js/example/core/reference/modeling.json +9 -0
- package/lib/js/example/core/reference.json +9 -0
- package/lib/js/example/core/reusable/atomic_vectors.json +18 -0
- package/lib/js/example/core/reusable/band_gap.json +16 -0
- package/lib/js/example/core/reusable/energy.json +5 -0
- package/lib/js/example/core/reusable/file_metadata.json +5 -0
- package/lib/js/example/core/reusable/object_storage_container_data.json +8 -0
- package/lib/js/example/element.json +17 -0
- package/lib/js/example/job/compute.json +26 -0
- package/lib/js/example/job.json +183 -0
- package/lib/js/example/material.json +128 -0
- package/lib/js/example/method/categorized_method.json +47 -0
- package/lib/js/example/method/method_parameters.json +3 -0
- package/lib/js/example/method.json +7 -0
- package/lib/js/example/methods_directory/legacy/localorbital.json +4 -0
- package/lib/js/example/methods_directory/legacy/pseudopotential.json +4 -0
- package/lib/js/example/methods_directory/legacy/regression.json +61 -0
- package/lib/js/example/methods_directory/legacy/unknown.json +4 -0
- package/lib/js/example/methods_directory/mathematical/cg.json +10 -0
- package/lib/js/example/methods_directory/mathematical/regression.json +65 -0
- package/lib/js/example/methods_directory/physical/ao/dunning.json +13 -0
- package/lib/js/example/methods_directory/physical/psp/file.json +54 -0
- package/lib/js/example/methods_directory/physical/psp.json +67 -0
- package/lib/js/example/methods_directory/physical/pw.json +9 -0
- package/lib/js/example/methods_directory/physical/smearing.json +10 -0
- package/lib/js/example/methods_directory/physical/tetrahedron.json +10 -0
- package/lib/js/example/model/categorized_model.json +77 -0
- package/lib/js/example/model/model_parameters.json +7 -0
- package/lib/js/example/model.json +11 -0
- package/lib/js/example/models_category/pb/qm/abin/gw.json +7 -0
- package/lib/js/example/models_category/pb/qm/dft/ksdft.json +6 -0
- package/lib/js/example/models_category/pb/qm/semp.json +5 -0
- package/lib/js/example/models_directory/gga.json +15 -0
- package/lib/js/example/models_directory/gw.json +15 -0
- package/lib/js/example/models_directory/hybrid.json +15 -0
- package/lib/js/example/models_directory/lda.json +15 -0
- package/lib/js/example/models_directory/legacy/dft.json +12 -0
- package/lib/js/example/models_directory/legacy/ml.json +11 -0
- package/lib/js/example/models_directory/legacy/unknown.json +11 -0
- package/lib/js/example/models_directory/re.json +10 -0
- package/lib/js/example/project.json +25 -0
- package/lib/js/example/properties_directory/electronic_configuration.json +4 -0
- package/lib/js/example/properties_directory/elemental/atomic_radius.json +4 -0
- package/lib/js/example/properties_directory/elemental/electronegativity.json +4 -0
- package/lib/js/example/properties_directory/elemental/ionization_potential.json +4 -0
- package/lib/js/example/properties_directory/non_scalar/band_gaps.json +25 -0
- package/lib/js/example/properties_directory/non_scalar/band_structure.json +47 -0
- package/lib/js/example/properties_directory/non_scalar/charge_density_profile.json +22 -0
- package/lib/js/example/properties_directory/non_scalar/density_of_states.json +55 -0
- package/lib/js/example/properties_directory/non_scalar/dielectric_tensor.json +133 -0
- package/lib/js/example/properties_directory/non_scalar/file_content.json +13 -0
- package/lib/js/example/properties_directory/non_scalar/hubbard_u.json +24 -0
- package/lib/js/example/properties_directory/non_scalar/hubbard_v.json +22 -0
- package/lib/js/example/properties_directory/non_scalar/hubbard_v_nn.json +24 -0
- package/lib/js/example/properties_directory/non_scalar/phonon_dispersions.json +41 -0
- package/lib/js/example/properties_directory/non_scalar/phonon_dos.json +37 -0
- package/lib/js/example/properties_directory/non_scalar/potential_profile.json +32 -0
- package/lib/js/example/properties_directory/non_scalar/reaction_energy_profile.json +30 -0
- package/lib/js/example/properties_directory/non_scalar/stress_tensor.json +21 -0
- package/lib/js/example/properties_directory/non_scalar/total_energy_contributions.json +44 -0
- package/lib/js/example/properties_directory/non_scalar/vibrational_spectrum.json +25 -0
- package/lib/js/example/properties_directory/scalar/electron_affinity.json +5 -0
- package/lib/js/example/properties_directory/scalar/fermi_energy.json +5 -0
- package/lib/js/example/properties_directory/scalar/formation_energy.json +5 -0
- package/lib/js/example/properties_directory/scalar/ionization_potential.json +5 -0
- package/lib/js/example/properties_directory/scalar/pressure.json +5 -0
- package/lib/js/example/properties_directory/scalar/reaction_energy_barrier.json +5 -0
- package/lib/js/example/properties_directory/scalar/surface_energy.json +5 -0
- package/lib/js/example/properties_directory/scalar/total_energy.json +5 -0
- package/lib/js/example/properties_directory/scalar/total_force.json +5 -0
- package/lib/js/example/properties_directory/scalar/valence_band_offset.json +5 -0
- package/lib/js/example/properties_directory/scalar/zero_point_energy.json +5 -0
- package/lib/js/example/properties_directory/structural/atomic_forces.json +22 -0
- package/lib/js/example/properties_directory/structural/basis/atomic_constraints.json +21 -0
- package/lib/js/example/properties_directory/structural/basis/atomic_coordinate.json +8 -0
- package/lib/js/example/properties_directory/structural/basis/atomic_coordinates.json +21 -0
- package/lib/js/example/properties_directory/structural/basis/atomic_element.json +4 -0
- package/lib/js/example/properties_directory/structural/basis/bonds.json +24 -0
- package/lib/js/example/properties_directory/structural/basis.json +46 -0
- package/lib/js/example/properties_directory/structural/density.json +5 -0
- package/lib/js/example/properties_directory/structural/elemental_ratio.json +5 -0
- package/lib/js/example/properties_directory/structural/inchi.json +4 -0
- package/lib/js/example/properties_directory/structural/inchi_key.json +4 -0
- package/lib/js/example/properties_directory/structural/lattice/lattice_bravais.json +13 -0
- package/lib/js/example/properties_directory/structural/lattice/lattice_vectors.json +19 -0
- package/lib/js/example/properties_directory/structural/lattice.json +33 -0
- package/lib/js/example/properties_directory/structural/magnetic_moments.json +22 -0
- package/lib/js/example/properties_directory/structural/molecular_pattern.json +71 -0
- package/lib/js/example/properties_directory/structural/p_norm.json +5 -0
- package/lib/js/example/properties_directory/structural/symmetry.json +9 -0
- package/lib/js/example/properties_directory/structural/volume.json +5 -0
- package/lib/js/example/properties_directory/workflow/convergence/electronic.json +15 -0
- package/lib/js/example/properties_directory/workflow/convergence/ionic.json +20 -0
- package/lib/js/example/properties_directory/workflow/convergence/kpoint.json +22 -0
- package/lib/js/example/property/base.json +31 -0
- package/lib/js/example/software/application.json +7 -0
- package/lib/js/example/software/executable.json +20 -0
- package/lib/js/example/software/flavor.json +9 -0
- package/lib/js/example/software/template.json +14 -0
- package/lib/js/example/software_directory/ml/exabyteml.json +6 -0
- package/lib/js/example/software_directory/ml/unit/execution/evaluate/cross_validate.json +20 -0
- package/lib/js/example/software_directory/ml/unit/execution/initialize.json +23 -0
- package/lib/js/example/software_directory/ml/unit/execution/score.json +18 -0
- package/lib/js/example/software_directory/ml/unit/execution/train.json +29 -0
- package/lib/js/example/software_directory/ml/unit/processing/data_transformation/manipulation.json +14 -0
- package/lib/js/example/software_directory/ml/unit/processing/data_transformation/scale_and_reduce.json +26 -0
- package/lib/js/example/software_directory/ml/unit/processing/feature_selection/filter_based.json +13 -0
- package/lib/js/example/software_directory/modeling/espresso/arguments.json +5 -0
- package/lib/js/example/software_directory/modeling/espresso.json +6 -0
- package/lib/js/example/software_directory/modeling/nwchem.json +6 -0
- package/lib/js/example/software_directory/modeling/unit/execution.json +19 -0
- package/lib/js/example/software_directory/modeling/vasp.json +6 -0
- package/lib/js/example/software_directory/scripting/jupyter_lab.json +8 -0
- package/lib/js/example/software_directory/scripting/python.json +8 -0
- package/lib/js/example/software_directory/scripting/shell.json +8 -0
- package/lib/js/example/software_directory/scripting/unit/execution.json +22 -0
- package/lib/js/example/system/_material.json +5 -0
- package/lib/js/example/system/_parent_job.json +5 -0
- package/lib/js/example/system/_project.json +5 -0
- package/lib/js/example/system/consistency_check.json +6 -0
- package/lib/js/example/system/creator.json +5 -0
- package/lib/js/example/system/entity_reference.json +5 -0
- package/lib/js/example/system/file_source.json +6 -0
- package/lib/js/example/system/message.json +16 -0
- package/lib/js/example/system/owner.json +5 -0
- package/lib/js/example/workflow/subworkflow.json +93 -0
- package/lib/js/example/workflow/unit/assignment.json +19 -0
- package/lib/js/example/workflow/unit/condition.json +22 -0
- package/lib/js/example/workflow/unit/execution.json +66 -0
- package/lib/js/example/workflow/unit/input/_inputItemScope.json +4 -0
- package/lib/js/example/workflow/unit/io/api.json +31 -0
- package/lib/js/example/workflow/unit/io/db.json +15 -0
- package/lib/js/example/workflow/unit/io/object_storage.json +12 -0
- package/lib/js/example/workflow/unit/io.json +41 -0
- package/lib/js/example/workflow/unit/map.json +16 -0
- package/lib/js/example/workflow/unit/processing.json +13 -0
- package/lib/js/example/workflow/unit/reduce.json +16 -0
- package/lib/js/example/workflow/unit/runtime/runtime_items.json +14 -0
- package/lib/js/example/workflow.json +129 -0
- package/lib/js/json_include/index.d.ts +20 -0
- package/lib/js/json_include/index.js +61 -97
- package/lib/js/json_include/settings.d.ts +3 -0
- package/lib/js/json_include/settings.js +4 -11
- package/lib/js/schema/3pse/file/applications/espresso/7.2/pw.x/atomic_positions.json +72 -0
- package/lib/js/schema/3pse/file/applications/espresso/7.2/pw.x/atomic_species.json +30 -0
- package/lib/js/schema/3pse/file/applications/espresso/7.2/pw.x/cell.json +89 -0
- package/lib/js/schema/3pse/file/applications/espresso/7.2/pw.x/cell_parameters.json +54 -0
- package/lib/js/schema/3pse/file/applications/espresso/7.2/pw.x/control.json +181 -0
- package/lib/js/schema/3pse/file/applications/espresso/7.2/pw.x/electrons.json +163 -0
- package/lib/js/schema/3pse/file/applications/espresso/7.2/pw.x/hubbard.json +219 -0
- package/lib/js/schema/3pse/file/applications/espresso/7.2/pw.x/ions.json +216 -0
- package/lib/js/schema/3pse/file/applications/espresso/7.2/pw.x/k_points.json +87 -0
- package/lib/js/schema/3pse/file/applications/espresso/7.2/pw.x/system.json +652 -0
- package/lib/js/schema/3pse/file/applications/espresso/7.2/pw.x.json +1776 -0
- package/lib/js/schema/core/abstract/2d_data.json +31 -0
- package/lib/js/schema/core/abstract/2d_plot.json +74 -0
- package/lib/js/schema/core/abstract/3d_grid.json +32 -0
- package/lib/js/schema/core/abstract/3d_tensor.json +18 -0
- package/lib/js/schema/core/abstract/3d_vector_basis.json +43 -0
- package/lib/js/schema/core/abstract/point.json +11 -0
- package/lib/js/schema/core/abstract/vector.json +27 -0
- package/lib/js/schema/core/primitive/1d_data_series.json +16 -0
- package/lib/js/schema/core/primitive/3d_lattice.json +40 -0
- package/lib/js/schema/core/primitive/array_of_3_booleans.json +11 -0
- package/lib/js/schema/core/primitive/array_of_3_numbers.json +11 -0
- package/lib/js/schema/core/primitive/array_of_ids.json +16 -0
- package/lib/js/schema/core/primitive/array_of_strings.json +11 -0
- package/lib/js/schema/core/primitive/axis.json +19 -0
- package/lib/js/schema/core/primitive/group_info.json +16 -0
- package/lib/js/schema/core/primitive/integer_one_or_zero.json +8 -0
- package/lib/js/schema/core/primitive/linked_list/base_node.json +36 -0
- package/lib/js/schema/core/primitive/linked_list/named_node.json +40 -0
- package/lib/js/schema/core/primitive/linked_list/named_node_in_group.json +48 -0
- package/lib/js/schema/core/primitive/linked_list/node_with_type.json +39 -0
- package/lib/js/schema/core/primitive/linked_list.json +171 -0
- package/lib/js/schema/core/primitive/scalar.json +14 -0
- package/lib/js/schema/core/primitive/slugified_entry.json +21 -0
- package/lib/js/schema/core/primitive/slugified_entry_or_slug.json +31 -0
- package/lib/js/schema/core/primitive/string.json +14 -0
- package/lib/js/schema/core/reference/exabyte.json +19 -0
- package/lib/js/schema/core/reference/experiment/condition.json +31 -0
- package/lib/js/schema/core/reference/experiment/location.json +20 -0
- package/lib/js/schema/core/reference/experiment.json +249 -0
- package/lib/js/schema/core/reference/literature/name.json +24 -0
- package/lib/js/schema/core/reference/literature/pages.json +17 -0
- package/lib/js/schema/core/reference/literature.json +131 -0
- package/lib/js/schema/core/reference/modeling/exabyte.json +46 -0
- package/lib/js/schema/core/reference/modeling.json +52 -0
- package/lib/js/schema/core/reference.json +436 -0
- package/lib/js/schema/core/reusable/atomic_data/per_orbital.json +22 -0
- package/lib/js/schema/core/reusable/atomic_data/per_orbital_pair.json +39 -0
- package/lib/js/schema/core/reusable/atomic_data/value_number.json +13 -0
- package/lib/js/schema/core/reusable/atomic_data/value_string.json +13 -0
- package/lib/js/schema/core/reusable/atomic_data_per_orbital_numeric.json +26 -0
- package/lib/js/schema/core/reusable/atomic_data_per_orbital_pair_numeric.json +43 -0
- package/lib/js/schema/core/reusable/atomic_orbital.json +32 -0
- package/lib/js/schema/core/reusable/atomic_scalars.json +29 -0
- package/lib/js/schema/core/reusable/atomic_strings.json +19 -0
- package/lib/js/schema/core/reusable/atomic_vectors.json +42 -0
- package/lib/js/schema/core/reusable/band_gap.json +64 -0
- package/lib/js/schema/core/reusable/categories.json +159 -0
- package/lib/js/schema/core/reusable/category_path.json +7 -0
- package/lib/js/schema/core/reusable/dielectric_tensor_component.json +46 -0
- package/lib/js/schema/core/reusable/energy.json +39 -0
- package/lib/js/schema/core/reusable/file_metadata.json +21 -0
- package/lib/js/schema/core/reusable/frequency_function_matrix.json +30 -0
- package/lib/js/schema/core/reusable/object_storage_container_data.json +38 -0
- package/lib/js/schema/definitions/units.json +103 -0
- package/lib/js/schema/element.json +103 -0
- package/lib/js/schema/in_memory_entity/base.json +65 -0
- package/lib/js/schema/in_memory_entity/defaultable.json +70 -0
- package/lib/js/schema/in_memory_entity/named.json +69 -0
- package/lib/js/schema/in_memory_entity/named_defaultable.json +74 -0
- package/lib/js/schema/in_memory_entity/named_defaultable_has_metadata.json +77 -0
- package/lib/js/schema/in_memory_entity/named_defaultable_runtime_items.json +194 -0
- package/lib/js/schema/job/base.json +376 -0
- package/lib/js/schema/job/compute.json +176 -0
- package/lib/js/schema/job.json +6868 -0
- package/lib/js/schema/material/conventional.json +11 -0
- package/lib/js/schema/material.json +624 -0
- package/lib/js/schema/method/categorized_method.json +221 -0
- package/lib/js/schema/method/method_parameters.json +47 -0
- package/lib/js/schema/method/unit_method.json +191 -0
- package/lib/js/schema/method.json +28 -0
- package/lib/js/schema/methods_category/mathematical/diff/enum_options.json +8 -0
- package/lib/js/schema/methods_category/mathematical/diff/fd.json +165 -0
- package/lib/js/schema/methods_category/mathematical/diff.json +162 -0
- package/lib/js/schema/methods_category/mathematical/discr/enum_options.json +8 -0
- package/lib/js/schema/methods_category/mathematical/discr/mesh/enum_options.json +18 -0
- package/lib/js/schema/methods_category/mathematical/discr/mesh/hybrid.json +168 -0
- package/lib/js/schema/methods_category/mathematical/discr/mesh/nstruct.json +168 -0
- package/lib/js/schema/methods_category/mathematical/discr/mesh/struct/cartesian.json +171 -0
- package/lib/js/schema/methods_category/mathematical/discr/mesh/struct/enum_options.json +8 -0
- package/lib/js/schema/methods_category/mathematical/discr/mesh/struct.json +168 -0
- package/lib/js/schema/methods_category/mathematical/discr/mesh.json +165 -0
- package/lib/js/schema/methods_category/mathematical/discr.json +162 -0
- package/lib/js/schema/methods_category/mathematical/enum_options.json +45 -0
- package/lib/js/schema/methods_category/mathematical/fapprx/basisexp.json +165 -0
- package/lib/js/schema/methods_category/mathematical/fapprx/enum_options.json +13 -0
- package/lib/js/schema/methods_category/mathematical/fapprx/ipol/enum_options.json +18 -0
- package/lib/js/schema/methods_category/mathematical/fapprx/ipol/lin.json +168 -0
- package/lib/js/schema/methods_category/mathematical/fapprx/ipol/poly.json +168 -0
- package/lib/js/schema/methods_category/mathematical/fapprx/ipol/spline.json +168 -0
- package/lib/js/schema/methods_category/mathematical/fapprx/ipol.json +165 -0
- package/lib/js/schema/methods_category/mathematical/fapprx.json +162 -0
- package/lib/js/schema/methods_category/mathematical/intgr/analytic/enum_options.json +20 -0
- package/lib/js/schema/methods_category/mathematical/intgr/analytic/volume.json +178 -0
- package/lib/js/schema/methods_category/mathematical/intgr/analytic.json +165 -0
- package/lib/js/schema/methods_category/mathematical/intgr/diffeq/enum_options.json +13 -0
- package/lib/js/schema/methods_category/mathematical/intgr/diffeq/order1.json +168 -0
- package/lib/js/schema/methods_category/mathematical/intgr/diffeq/order2.json +168 -0
- package/lib/js/schema/methods_category/mathematical/intgr/diffeq.json +165 -0
- package/lib/js/schema/methods_category/mathematical/intgr/enum_options.json +23 -0
- package/lib/js/schema/methods_category/mathematical/intgr/numquad/enum_options.json +13 -0
- package/lib/js/schema/methods_category/mathematical/intgr/numquad/gauss.json +168 -0
- package/lib/js/schema/methods_category/mathematical/intgr/numquad/newcot.json +168 -0
- package/lib/js/schema/methods_category/mathematical/intgr/numquad.json +165 -0
- package/lib/js/schema/methods_category/mathematical/intgr/transf/enum_options.json +8 -0
- package/lib/js/schema/methods_category/mathematical/intgr/transf/fourier.json +168 -0
- package/lib/js/schema/methods_category/mathematical/intgr/transf.json +165 -0
- package/lib/js/schema/methods_category/mathematical/intgr.json +162 -0
- package/lib/js/schema/methods_category/mathematical/linalg/dcomp.json +165 -0
- package/lib/js/schema/methods_category/mathematical/linalg/diag/davidson.json +168 -0
- package/lib/js/schema/methods_category/mathematical/linalg/diag/enum_options.json +8 -0
- package/lib/js/schema/methods_category/mathematical/linalg/diag.json +165 -0
- package/lib/js/schema/methods_category/mathematical/linalg/enum_options.json +23 -0
- package/lib/js/schema/methods_category/mathematical/linalg/lintra.json +165 -0
- package/lib/js/schema/methods_category/mathematical/linalg/matf.json +165 -0
- package/lib/js/schema/methods_category/mathematical/linalg.json +162 -0
- package/lib/js/schema/methods_category/mathematical/opt/diff/bracket.json +168 -0
- package/lib/js/schema/methods_category/mathematical/opt/diff/enum_options.json +28 -0
- package/lib/js/schema/methods_category/mathematical/opt/diff/local.json +168 -0
- package/lib/js/schema/methods_category/mathematical/opt/diff/order1.json +168 -0
- package/lib/js/schema/methods_category/mathematical/opt/diff/order2.json +168 -0
- package/lib/js/schema/methods_category/mathematical/opt/diff/ordern/cg.json +171 -0
- package/lib/js/schema/methods_category/mathematical/opt/diff/ordern/enum_options.json +8 -0
- package/lib/js/schema/methods_category/mathematical/opt/diff/ordern.json +168 -0
- package/lib/js/schema/methods_category/mathematical/opt/diff.json +165 -0
- package/lib/js/schema/methods_category/mathematical/opt/enum_options.json +18 -0
- package/lib/js/schema/methods_category/mathematical/opt/ndiff/direct.json +168 -0
- package/lib/js/schema/methods_category/mathematical/opt/ndiff/enum_options.json +18 -0
- package/lib/js/schema/methods_category/mathematical/opt/ndiff/pop.json +168 -0
- package/lib/js/schema/methods_category/mathematical/opt/ndiff/stoch.json +168 -0
- package/lib/js/schema/methods_category/mathematical/opt/ndiff.json +165 -0
- package/lib/js/schema/methods_category/mathematical/opt/root/bracket.json +168 -0
- package/lib/js/schema/methods_category/mathematical/opt/root/enum_options.json +13 -0
- package/lib/js/schema/methods_category/mathematical/opt/root/iter.json +168 -0
- package/lib/js/schema/methods_category/mathematical/opt/root.json +165 -0
- package/lib/js/schema/methods_category/mathematical/opt.json +162 -0
- package/lib/js/schema/methods_category/mathematical/regression.json +167 -0
- package/lib/js/schema/methods_category/physical/enum_options.json +8 -0
- package/lib/js/schema/methods_category/physical/qm/enum_options.json +8 -0
- package/lib/js/schema/methods_category/physical/qm/wf/ao/dunning.json +171 -0
- package/lib/js/schema/methods_category/physical/qm/wf/ao/other.json +171 -0
- package/lib/js/schema/methods_category/physical/qm/wf/ao/pople.json +171 -0
- package/lib/js/schema/methods_category/physical/qm/wf/ao.json +173 -0
- package/lib/js/schema/methods_category/physical/qm/wf/enum_options.json +63 -0
- package/lib/js/schema/methods_category/physical/qm/wf/psp.json +174 -0
- package/lib/js/schema/methods_category/physical/qm/wf/pw.json +168 -0
- package/lib/js/schema/methods_category/physical/qm/wf/smearing.json +174 -0
- package/lib/js/schema/methods_category/physical/qm/wf/tetrahedron.json +173 -0
- package/lib/js/schema/methods_category/physical/qm/wf.json +165 -0
- package/lib/js/schema/methods_category/physical/qm.json +162 -0
- package/lib/js/schema/methods_directory/legacy/localorbital.json +34 -0
- package/lib/js/schema/methods_directory/legacy/pseudopotential.json +37 -0
- package/lib/js/schema/methods_directory/legacy/regression.json +185 -0
- package/lib/js/schema/methods_directory/legacy/unknown.json +34 -0
- package/lib/js/schema/methods_directory/mathematical/cg.json +207 -0
- package/lib/js/schema/methods_directory/mathematical/davidson.json +204 -0
- package/lib/js/schema/methods_directory/mathematical/regression/data.json +122 -0
- package/lib/js/schema/methods_directory/mathematical/regression/dataset.json +21 -0
- package/lib/js/schema/methods_directory/mathematical/regression/kernel_ridge/data_per_property.json +47 -0
- package/lib/js/schema/methods_directory/mathematical/regression/linear/data_per_property.json +42 -0
- package/lib/js/schema/methods_directory/mathematical/regression/per_feature_item.json +23 -0
- package/lib/js/schema/methods_directory/mathematical/regression/precision.json +33 -0
- package/lib/js/schema/methods_directory/mathematical/regression/precision_per_property.json +23 -0
- package/lib/js/schema/methods_directory/mathematical/regression.json +354 -0
- package/lib/js/schema/methods_directory/physical/ao/dunning.json +230 -0
- package/lib/js/schema/methods_directory/physical/ao/enum_options.json +28 -0
- package/lib/js/schema/methods_directory/physical/ao/other.json +238 -0
- package/lib/js/schema/methods_directory/physical/ao/pople.json +230 -0
- package/lib/js/schema/methods_directory/physical/psp/file.json +140 -0
- package/lib/js/schema/methods_directory/physical/psp/file_data_item.json +116 -0
- package/lib/js/schema/methods_directory/physical/psp.json +352 -0
- package/lib/js/schema/methods_directory/physical/pw.json +204 -0
- package/lib/js/schema/methods_directory/physical/smearing.json +210 -0
- package/lib/js/schema/methods_directory/physical/tetrahedron.json +208 -0
- package/lib/js/schema/model/categorized_model.json +542 -0
- package/lib/js/schema/model/mixins/dft/double_hybrid_functional.json +13 -0
- package/lib/js/schema/model/mixins/dft/enum_options.json +30 -0
- package/lib/js/schema/model/mixins/dft/gga_functional.json +15 -0
- package/lib/js/schema/model/mixins/dft/hybrid_functional.json +14 -0
- package/lib/js/schema/model/mixins/dft/lda_functional.json +14 -0
- package/lib/js/schema/model/mixins/dft/mgga_functional.json +14 -0
- package/lib/js/schema/model/mixins/dispersion_correction.json +16 -0
- package/lib/js/schema/model/mixins/enum_options.json +22 -0
- package/lib/js/schema/model/mixins/hubbard.json +13 -0
- package/lib/js/schema/model/mixins/spin_orbit_coupling.json +12 -0
- package/lib/js/schema/model/mixins/spin_polarization.json +15 -0
- package/lib/js/schema/model/model_parameters.json +98 -0
- package/lib/js/schema/model/model_without_method.json +321 -0
- package/lib/js/schema/model.json +49 -0
- package/lib/js/schema/models_category/enum_options.json +13 -0
- package/lib/js/schema/models_category/pb/enum_options.json +8 -0
- package/lib/js/schema/models_category/pb/qm/abin/enum_options.json +15 -0
- package/lib/js/schema/models_category/pb/qm/abin/gw.json +176 -0
- package/lib/js/schema/models_category/pb/qm/abin.json +168 -0
- package/lib/js/schema/models_category/pb/qm/dft/enum_options.json +8 -0
- package/lib/js/schema/models_category/pb/qm/dft/ksdft/double_hybrid.json +174 -0
- package/lib/js/schema/models_category/pb/qm/dft/ksdft/enum_options.json +28 -0
- package/lib/js/schema/models_category/pb/qm/dft/ksdft/gga.json +174 -0
- package/lib/js/schema/models_category/pb/qm/dft/ksdft/hybrid.json +174 -0
- package/lib/js/schema/models_category/pb/qm/dft/ksdft/lda.json +174 -0
- package/lib/js/schema/models_category/pb/qm/dft/ksdft/mgga.json +174 -0
- package/lib/js/schema/models_category/pb/qm/dft/ksdft.json +171 -0
- package/lib/js/schema/models_category/pb/qm/dft.json +168 -0
- package/lib/js/schema/models_category/pb/qm/enum_options.json +18 -0
- package/lib/js/schema/models_category/pb/qm/semp.json +168 -0
- package/lib/js/schema/models_category/pb/qm.json +165 -0
- package/lib/js/schema/models_category/pb.json +162 -0
- package/lib/js/schema/models_category/st/det/enum_options.json +8 -0
- package/lib/js/schema/models_category/st/det/ml/enum_options.json +8 -0
- package/lib/js/schema/models_category/st/det/ml/re.json +171 -0
- package/lib/js/schema/models_category/st/det/ml.json +168 -0
- package/lib/js/schema/models_category/st/det.json +165 -0
- package/lib/js/schema/models_category/st/enum_options.json +8 -0
- package/lib/js/schema/models_category/st.json +162 -0
- package/lib/js/schema/models_directory/double_hybrid.json +387 -0
- package/lib/js/schema/models_directory/gga.json +401 -0
- package/lib/js/schema/models_directory/gw.json +415 -0
- package/lib/js/schema/models_directory/hybrid.json +400 -0
- package/lib/js/schema/models_directory/lda.json +400 -0
- package/lib/js/schema/models_directory/legacy/dft.json +154 -0
- package/lib/js/schema/models_directory/legacy/ml.json +55 -0
- package/lib/js/schema/models_directory/legacy/unknown.json +55 -0
- package/lib/js/schema/models_directory/mgga.json +400 -0
- package/lib/js/schema/models_directory/re.json +334 -0
- package/lib/js/schema/project.json +103 -0
- package/lib/js/schema/properties_directory/derived_properties.json +185 -0
- package/lib/js/schema/properties_directory/electronic_configuration.json +16 -0
- package/lib/js/schema/properties_directory/elemental/atomic_radius.json +35 -0
- package/lib/js/schema/properties_directory/elemental/electronegativity.json +20 -0
- package/lib/js/schema/properties_directory/elemental/ionization_potential.json +31 -0
- package/lib/js/schema/properties_directory/non_scalar/average_potential_profile.json +107 -0
- package/lib/js/schema/properties_directory/non_scalar/band_gaps.json +121 -0
- package/lib/js/schema/properties_directory/non_scalar/band_structure.json +118 -0
- package/lib/js/schema/properties_directory/non_scalar/charge_density_profile.json +88 -0
- package/lib/js/schema/properties_directory/non_scalar/density_of_states.json +123 -0
- package/lib/js/schema/properties_directory/non_scalar/dielectric_tensor.json +65 -0
- package/lib/js/schema/properties_directory/non_scalar/file_content.json +73 -0
- package/lib/js/schema/properties_directory/non_scalar/hubbard_u.json +56 -0
- package/lib/js/schema/properties_directory/non_scalar/hubbard_v.json +75 -0
- package/lib/js/schema/properties_directory/non_scalar/hubbard_v_nn.json +75 -0
- package/lib/js/schema/properties_directory/non_scalar/phonon_dispersions.json +103 -0
- package/lib/js/schema/properties_directory/non_scalar/phonon_dos.json +95 -0
- package/lib/js/schema/properties_directory/non_scalar/potential_profile.json +94 -0
- package/lib/js/schema/properties_directory/non_scalar/reaction_energy_profile.json +94 -0
- package/lib/js/schema/properties_directory/non_scalar/stress_tensor.json +36 -0
- package/lib/js/schema/properties_directory/non_scalar/total_energy_contributions.json +271 -0
- package/lib/js/schema/properties_directory/non_scalar/vibrational_spectrum.json +99 -0
- package/lib/js/schema/properties_directory/scalar/electron_affinity.json +42 -0
- package/lib/js/schema/properties_directory/scalar/fermi_energy.json +42 -0
- package/lib/js/schema/properties_directory/scalar/formation_energy.json +42 -0
- package/lib/js/schema/properties_directory/scalar/ionization_potential.json +42 -0
- package/lib/js/schema/properties_directory/scalar/pressure.json +26 -0
- package/lib/js/schema/properties_directory/scalar/reaction_energy_barrier.json +42 -0
- package/lib/js/schema/properties_directory/scalar/surface_energy.json +42 -0
- package/lib/js/schema/properties_directory/scalar/total_energy.json +42 -0
- package/lib/js/schema/properties_directory/scalar/total_force.json +29 -0
- package/lib/js/schema/properties_directory/scalar/valence_band_offset.json +42 -0
- package/lib/js/schema/properties_directory/scalar/zero_point_energy.json +42 -0
- package/lib/js/schema/properties_directory/structural/atomic_forces.json +65 -0
- package/lib/js/schema/properties_directory/structural/basis/atomic_constraints.json +55 -0
- package/lib/js/schema/properties_directory/structural/basis/atomic_coordinate.json +38 -0
- package/lib/js/schema/properties_directory/structural/basis/atomic_coordinates.json +68 -0
- package/lib/js/schema/properties_directory/structural/basis/atomic_element.json +26 -0
- package/lib/js/schema/properties_directory/structural/basis/bonds.json +42 -0
- package/lib/js/schema/properties_directory/structural/basis.json +127 -0
- package/lib/js/schema/properties_directory/structural/density.json +24 -0
- package/lib/js/schema/properties_directory/structural/elemental_ratio.json +26 -0
- package/lib/js/schema/properties_directory/structural/inchi.json +19 -0
- package/lib/js/schema/properties_directory/structural/inchi_key.json +19 -0
- package/lib/js/schema/properties_directory/structural/lattice/lattice_bravais.json +81 -0
- package/lib/js/schema/properties_directory/structural/lattice/lattice_vectors.json +63 -0
- package/lib/js/schema/properties_directory/structural/lattice/type_enum.json +22 -0
- package/lib/js/schema/properties_directory/structural/lattice/type_extended_enum.json +32 -0
- package/lib/js/schema/properties_directory/structural/lattice.json +148 -0
- package/lib/js/schema/properties_directory/structural/magnetic_moments.json +60 -0
- package/lib/js/schema/properties_directory/structural/molecular_pattern.json +111 -0
- package/lib/js/schema/properties_directory/structural/p_norm.json +24 -0
- package/lib/js/schema/properties_directory/structural/patterns/functional_group.json +36 -0
- package/lib/js/schema/properties_directory/structural/patterns/ring.json +35 -0
- package/lib/js/schema/properties_directory/structural/patterns/special_bond.json +33 -0
- package/lib/js/schema/properties_directory/structural/symmetry.json +40 -0
- package/lib/js/schema/properties_directory/structural/volume.json +24 -0
- package/lib/js/schema/properties_directory/workflow/convergence/electronic.json +32 -0
- package/lib/js/schema/properties_directory/workflow/convergence/ionic.json +62 -0
- package/lib/js/schema/properties_directory/workflow/convergence/kpoint.json +48 -0
- package/lib/js/schema/property/base.json +387 -0
- package/lib/js/schema/property/meta.json +387 -0
- package/lib/js/schema/property/raw.json +387 -0
- package/lib/js/schema/property/source.json +286 -0
- package/lib/js/schema/software/application.json +99 -0
- package/lib/js/schema/software/executable.json +208 -0
- package/lib/js/schema/software/flavor.json +228 -0
- package/lib/js/schema/software/template.json +103 -0
- package/lib/js/schema/software_directory/ml/exabyteml.json +23 -0
- package/lib/js/schema/software_directory/ml/unit/execution/evaluate/cross_validate.json +814 -0
- package/lib/js/schema/software_directory/ml/unit/execution/initialize.json +818 -0
- package/lib/js/schema/software_directory/ml/unit/execution/score.json +804 -0
- package/lib/js/schema/software_directory/ml/unit/execution/train.json +827 -0
- package/lib/js/schema/software_directory/ml/unit/execution.json +3264 -0
- package/lib/js/schema/software_directory/ml/unit/processing/data_transformation/manipulation.json +310 -0
- package/lib/js/schema/software_directory/ml/unit/processing/data_transformation/scale_and_reduce.json +330 -0
- package/lib/js/schema/software_directory/ml/unit/processing/data_transformation.json +334 -0
- package/lib/js/schema/software_directory/ml/unit/processing/feature_selection/filter_based.json +305 -0
- package/lib/js/schema/software_directory/ml/unit/processing/feature_selection.json +309 -0
- package/lib/js/schema/software_directory/ml/unit/processing.json +646 -0
- package/lib/js/schema/software_directory/modeling/deepmd.json +115 -0
- package/lib/js/schema/software_directory/modeling/espresso/arguments.json +44 -0
- package/lib/js/schema/software_directory/modeling/espresso.json +34 -0
- package/lib/js/schema/software_directory/modeling/nwchem.json +114 -0
- package/lib/js/schema/software_directory/modeling/unit/execution.json +847 -0
- package/lib/js/schema/software_directory/modeling/vasp.json +120 -0
- package/lib/js/schema/software_directory/scripting/jupyter_lab.json +118 -0
- package/lib/js/schema/software_directory/scripting/python.json +132 -0
- package/lib/js/schema/software_directory/scripting/shell.json +132 -0
- package/lib/js/schema/software_directory/scripting/unit/execution.json +847 -0
- package/lib/js/schema/system/_material.json +23 -0
- package/lib/js/schema/system/_parent_job.json +23 -0
- package/lib/js/schema/system/_project.json +23 -0
- package/lib/js/schema/system/bankable.json +16 -0
- package/lib/js/schema/system/consistency_check.json +39 -0
- package/lib/js/schema/system/creator.json +23 -0
- package/lib/js/schema/system/creator_account.json +27 -0
- package/lib/js/schema/system/database_source.json +38 -0
- package/lib/js/schema/system/defaultable.json +13 -0
- package/lib/js/schema/system/description.json +15 -0
- package/lib/js/schema/system/entity_reference.json +20 -0
- package/lib/js/schema/system/file_source.json +30 -0
- package/lib/js/schema/system/history.json +26 -0
- package/lib/js/schema/system/in_set.json +36 -0
- package/lib/js/schema/system/is_multi_material.json +11 -0
- package/lib/js/schema/system/is_outdated.json +11 -0
- package/lib/js/schema/system/job_extended.json +64 -0
- package/lib/js/schema/system/message.json +68 -0
- package/lib/js/schema/system/metadata.json +11 -0
- package/lib/js/schema/system/name.json +12 -0
- package/lib/js/schema/system/owner.json +23 -0
- package/lib/js/schema/system/path.json +14 -0
- package/lib/js/schema/system/path_entity.json +18 -0
- package/lib/js/schema/system/schema_version.json +13 -0
- package/lib/js/schema/system/scope.json +11 -0
- package/lib/js/schema/system/set.json +17 -0
- package/lib/js/schema/system/sharing.json +11 -0
- package/lib/js/schema/system/soft_removable.json +16 -0
- package/lib/js/schema/system/status.json +32 -0
- package/lib/js/schema/system/tags.json +15 -0
- package/lib/js/schema/system/timestampable.json +38 -0
- package/lib/js/schema/system/use_values.json +11 -0
- package/lib/js/schema/workflow/base.json +103 -0
- package/lib/js/schema/workflow/base_flow.json +218 -0
- package/lib/js/schema/workflow/scope.json +20 -0
- package/lib/js/schema/workflow/subworkflow/unit.json +2713 -0
- package/lib/js/schema/workflow/subworkflow.json +3087 -0
- package/lib/js/schema/workflow/unit/assertion.json +277 -0
- package/lib/js/schema/workflow/unit/assignment.json +314 -0
- package/lib/js/schema/workflow/unit/base.json +264 -0
- package/lib/js/schema/workflow/unit/condition.json +315 -0
- package/lib/js/schema/workflow/unit/execution.json +804 -0
- package/lib/js/schema/workflow/unit/input/_input.json +53 -0
- package/lib/js/schema/workflow/unit/input/_inputItem.json +20 -0
- package/lib/js/schema/workflow/unit/input/_inputItemId.json +19 -0
- package/lib/js/schema/workflow/unit/input/_inputItemScope.json +20 -0
- package/lib/js/schema/workflow/unit/input/_map_input/values.json +11 -0
- package/lib/js/schema/workflow/unit/input/_map_input.json +36 -0
- package/lib/js/schema/workflow/unit/io/api.json +24 -0
- package/lib/js/schema/workflow/unit/io/db.json +39 -0
- package/lib/js/schema/workflow/unit/io/object_storage.json +67 -0
- package/lib/js/schema/workflow/unit/io.json +418 -0
- package/lib/js/schema/workflow/unit/map.json +314 -0
- package/lib/js/schema/workflow/unit/processing.json +281 -0
- package/lib/js/schema/workflow/unit/reduce.json +297 -0
- package/lib/js/schema/workflow/unit/runtime/_runtime_item_full_object.json +15 -0
- package/lib/js/schema/workflow/unit/runtime/_runtime_item_name_object.json +15 -0
- package/lib/js/schema/workflow/unit/runtime/_runtime_item_string.json +7 -0
- package/lib/js/schema/workflow/unit/runtime/runtime_item.json +27 -0
- package/lib/js/schema/workflow/unit/runtime/runtime_items.json +128 -0
- package/lib/js/schema/workflow/unit/subworkflow.json +267 -0
- package/lib/js/schema/workflow/unit.json +3292 -0
- package/lib/js/schema/workflow.json +6492 -0
- package/lib/js/schemas.json +1 -0
- package/lib/js/scripts/compileTs.d.ts +1 -0
- package/lib/js/scripts/compileTs.js +79 -0
- package/lib/js/scripts/createEnumsFromYaml.d.ts +1 -0
- package/lib/js/scripts/createEnumsFromYaml.js +21 -67
- package/lib/js/scripts/setSchemaIds.d.ts +5 -0
- package/lib/js/scripts/setSchemaIds.js +26 -153
- package/lib/js/utils/ajv.d.ts +31 -0
- package/lib/js/utils/ajv.js +94 -0
- package/lib/js/utils/common.d.ts +6 -0
- package/lib/js/utils/common.js +15 -0
- package/lib/js/utils/filesystem.d.ts +2 -0
- package/lib/js/utils/filesystem.js +38 -0
- package/modules.d.ts +5 -0
- package/package.json +48 -23
- package/schema/3pse/file/applications/espresso/7.2/pw.x/atomic_positions.json +1 -1
- package/schema/3pse/file/applications/espresso/7.2/pw.x/atomic_species.json +1 -1
- package/schema/3pse/file/applications/espresso/7.2/pw.x/cell.json +1 -1
- package/schema/3pse/file/applications/espresso/7.2/pw.x/cell_parameters.json +1 -1
- package/schema/3pse/file/applications/espresso/7.2/pw.x/control.json +1 -1
- package/schema/3pse/file/applications/espresso/7.2/pw.x/electrons.json +1 -1
- package/schema/3pse/file/applications/espresso/7.2/pw.x/hubbard.json +1 -1
- package/schema/3pse/file/applications/espresso/7.2/pw.x/ions.json +1 -1
- package/schema/3pse/file/applications/espresso/7.2/pw.x/k_points.json +1 -1
- package/schema/3pse/file/applications/espresso/7.2/pw.x/system.json +9 -6
- package/schema/3pse/file/applications/espresso/7.2/pw.x.json +2 -1
- package/schema/core/abstract/2d_data.json +1 -1
- package/schema/core/abstract/2d_plot.json +2 -1
- package/schema/core/abstract/3d_grid.json +2 -1
- package/schema/core/abstract/3d_tensor.json +1 -1
- package/schema/core/abstract/3d_vector_basis.json +1 -1
- package/schema/core/abstract/point.json +1 -1
- package/schema/core/abstract/vector.json +1 -1
- package/schema/core/primitive/1d_data_series.json +1 -1
- package/schema/core/primitive/3d_lattice.json +1 -1
- package/schema/core/primitive/array_of_3_booleans.json +1 -1
- package/schema/core/primitive/array_of_3_numbers.json +1 -1
- package/schema/core/primitive/array_of_ids.json +2 -3
- package/schema/core/primitive/array_of_strings.json +1 -1
- package/schema/core/primitive/axis.json +2 -1
- package/schema/core/primitive/group_info.json +1 -1
- package/schema/core/primitive/integer_one_or_zero.json +1 -1
- package/schema/core/primitive/linked_list/base_node.json +1 -1
- package/schema/core/primitive/linked_list/named_node.json +1 -1
- package/schema/core/primitive/linked_list/named_node_in_group.json +1 -1
- package/schema/core/primitive/linked_list/node_with_type.json +1 -1
- package/schema/core/primitive/linked_list.json +1 -1
- package/schema/core/primitive/scalar.json +1 -1
- package/schema/core/primitive/slugified_entry.json +1 -1
- package/schema/core/primitive/slugified_entry_or_slug.json +1 -1
- package/schema/core/primitive/string.json +1 -1
- package/schema/core/reference/exabyte.json +1 -1
- package/schema/core/reference/experiment/condition.json +3 -1
- package/schema/core/reference/experiment/location.json +2 -1
- package/schema/core/reference/experiment.json +2 -1
- package/schema/core/reference/literature/name.json +1 -1
- package/schema/core/reference/literature/pages.json +1 -1
- package/schema/core/reference/literature.json +2 -1
- package/schema/core/reference/modeling/exabyte.json +2 -1
- package/schema/core/reference/modeling.json +1 -1
- package/schema/core/reference.json +1 -1
- package/schema/core/reusable/atomic_data/per_orbital.json +1 -1
- package/schema/core/reusable/atomic_data/per_orbital_pair.json +1 -1
- package/schema/core/reusable/atomic_data/value_number.json +1 -1
- package/schema/core/reusable/atomic_data/value_string.json +2 -2
- package/schema/core/reusable/atomic_data_per_orbital_numeric.json +2 -2
- package/schema/core/reusable/atomic_data_per_orbital_pair_numeric.json +2 -2
- package/schema/core/reusable/atomic_orbital.json +1 -1
- package/schema/core/reusable/atomic_scalars.json +2 -1
- package/schema/core/reusable/atomic_strings.json +1 -1
- package/schema/core/reusable/atomic_vectors.json +3 -1
- package/schema/core/reusable/band_gap.json +2 -1
- package/schema/core/reusable/categories.json +2 -2
- package/schema/core/reusable/category_path.json +1 -1
- package/schema/core/reusable/dielectric_tensor_component.json +2 -1
- package/schema/core/reusable/energy.json +2 -1
- package/schema/core/reusable/file_metadata.json +2 -1
- package/schema/core/reusable/frequency_function_matrix.json +1 -1
- package/schema/core/reusable/object_storage_container_data.json +2 -1
- package/schema/element.json +2 -1
- package/schema/in_memory_entity/base.json +2 -1
- package/schema/in_memory_entity/defaultable.json +1 -1
- package/schema/in_memory_entity/named.json +1 -1
- package/schema/in_memory_entity/named_defaultable.json +1 -1
- package/schema/in_memory_entity/named_defaultable_has_metadata.json +1 -1
- package/schema/in_memory_entity/named_defaultable_runtime_items.json +1 -1
- package/schema/job/base.json +3 -2
- package/schema/job/compute.json +6 -14
- package/schema/job.json +2 -1
- package/schema/material/conventional.json +2 -1
- package/schema/material.json +2 -1
- package/schema/method/categorized_method.json +2 -1
- package/schema/method/method_parameters.json +1 -1
- package/schema/method/unit_method.json +2 -1
- package/schema/method.json +2 -1
- package/schema/methods_category/mathematical/diff/fd.json +3 -2
- package/schema/methods_category/mathematical/diff.json +3 -2
- package/schema/methods_category/mathematical/discr/mesh/hybrid.json +3 -2
- package/schema/methods_category/mathematical/discr/mesh/nstruct.json +3 -2
- package/schema/methods_category/mathematical/discr/mesh/struct/cartesian.json +2 -1
- package/schema/methods_category/mathematical/discr/mesh/struct.json +3 -2
- package/schema/methods_category/mathematical/discr/mesh.json +3 -2
- package/schema/methods_category/mathematical/discr.json +3 -2
- package/schema/methods_category/mathematical/fapprx/basisexp.json +3 -2
- package/schema/methods_category/mathematical/fapprx/ipol/lin.json +3 -2
- package/schema/methods_category/mathematical/fapprx/ipol/poly.json +3 -2
- package/schema/methods_category/mathematical/fapprx/ipol/spline.json +3 -2
- package/schema/methods_category/mathematical/fapprx/ipol.json +3 -2
- package/schema/methods_category/mathematical/fapprx.json +3 -2
- package/schema/methods_category/mathematical/intgr/analytic/volume.json +3 -2
- package/schema/methods_category/mathematical/intgr/analytic.json +3 -2
- package/schema/methods_category/mathematical/intgr/diffeq/order1.json +3 -1
- package/schema/methods_category/mathematical/intgr/diffeq/order2.json +3 -1
- package/schema/methods_category/mathematical/intgr/diffeq.json +3 -2
- package/schema/methods_category/mathematical/intgr/numquad/gauss.json +3 -2
- package/schema/methods_category/mathematical/intgr/numquad/newcot.json +3 -2
- package/schema/methods_category/mathematical/intgr/numquad.json +3 -2
- package/schema/methods_category/mathematical/intgr/transf/fourier.json +3 -1
- package/schema/methods_category/mathematical/intgr/transf.json +3 -1
- package/schema/methods_category/mathematical/intgr.json +3 -2
- package/schema/methods_category/mathematical/linalg/dcomp.json +3 -2
- package/schema/methods_category/mathematical/linalg/diag/davidson.json +3 -2
- package/schema/methods_category/mathematical/linalg/diag.json +3 -2
- package/schema/methods_category/mathematical/linalg/lintra.json +3 -2
- package/schema/methods_category/mathematical/linalg/matf.json +3 -2
- package/schema/methods_category/mathematical/linalg.json +3 -2
- package/schema/methods_category/mathematical/opt/diff/bracket.json +3 -2
- package/schema/methods_category/mathematical/opt/diff/local.json +3 -2
- package/schema/methods_category/mathematical/opt/diff/order1.json +3 -2
- package/schema/methods_category/mathematical/opt/diff/order2.json +3 -2
- package/schema/methods_category/mathematical/opt/diff/ordern/cg.json +3 -2
- package/schema/methods_category/mathematical/opt/diff/ordern.json +3 -2
- package/schema/methods_category/mathematical/opt/diff.json +3 -2
- package/schema/methods_category/mathematical/opt/ndiff/direct.json +3 -2
- package/schema/methods_category/mathematical/opt/ndiff/pop.json +3 -2
- package/schema/methods_category/mathematical/opt/ndiff/stoch.json +3 -2
- package/schema/methods_category/mathematical/opt/ndiff.json +3 -2
- package/schema/methods_category/mathematical/opt/root/bracket.json +3 -2
- package/schema/methods_category/mathematical/opt/root/iter.json +3 -2
- package/schema/methods_category/mathematical/opt/root.json +3 -2
- package/schema/methods_category/mathematical/opt.json +3 -2
- package/schema/methods_category/mathematical/regression.json +2 -1
- package/schema/methods_category/physical/qm/wf/ao/dunning.json +3 -2
- package/schema/methods_category/physical/qm/wf/ao/other.json +3 -2
- package/schema/methods_category/physical/qm/wf/ao/pople.json +3 -2
- package/schema/methods_category/physical/qm/wf/ao.json +3 -2
- package/schema/methods_category/physical/qm/wf/psp.json +3 -2
- package/schema/methods_category/physical/qm/wf/pw.json +3 -2
- package/schema/methods_category/physical/qm/wf/smearing.json +2 -1
- package/schema/methods_category/physical/qm/wf/tetrahedron.json +3 -2
- package/schema/methods_category/physical/qm/wf.json +3 -2
- package/schema/methods_category/physical/qm.json +3 -2
- package/schema/methods_directory/legacy/localorbital.json +2 -1
- package/schema/methods_directory/legacy/pseudopotential.json +2 -1
- package/schema/methods_directory/legacy/regression.json +2 -1
- package/schema/methods_directory/legacy/unknown.json +2 -1
- package/schema/methods_directory/mathematical/cg.json +6 -3
- package/schema/methods_directory/mathematical/davidson.json +6 -3
- package/schema/methods_directory/mathematical/regression/data.json +1 -1
- package/schema/methods_directory/mathematical/regression/dataset.json +1 -1
- package/schema/methods_directory/mathematical/regression/kernel_ridge/data_per_property.json +2 -1
- package/schema/methods_directory/mathematical/regression/linear/data_per_property.json +2 -1
- package/schema/methods_directory/mathematical/regression/per_feature_item.json +2 -1
- package/schema/methods_directory/mathematical/regression/precision.json +1 -1
- package/schema/methods_directory/mathematical/regression/precision_per_property.json +1 -1
- package/schema/methods_directory/mathematical/regression.json +2 -1
- package/schema/methods_directory/physical/ao/dunning.json +6 -2
- package/schema/methods_directory/physical/ao/other.json +6 -2
- package/schema/methods_directory/physical/ao/pople.json +6 -2
- package/schema/methods_directory/physical/psp/file.json +5 -2
- package/schema/methods_directory/physical/psp/file_data_item.json +5 -2
- package/schema/methods_directory/physical/psp.json +5 -2
- package/schema/methods_directory/physical/pw.json +5 -2
- package/schema/methods_directory/physical/smearing.json +5 -2
- package/schema/methods_directory/physical/tetrahedron.json +5 -2
- package/schema/model/categorized_model.json +2 -1
- package/schema/model/mixins/dft/double_hybrid_functional.json +1 -1
- package/schema/model/mixins/dft/gga_functional.json +3 -2
- package/schema/model/mixins/dft/hybrid_functional.json +1 -1
- package/schema/model/mixins/dft/lda_functional.json +3 -2
- package/schema/model/mixins/dft/mgga_functional.json +3 -2
- package/schema/model/mixins/dispersion_correction.json +1 -1
- package/schema/model/mixins/hubbard.json +1 -1
- package/schema/model/mixins/spin_orbit_coupling.json +3 -2
- package/schema/model/mixins/spin_polarization.json +3 -2
- package/schema/model/model_parameters.json +2 -1
- package/schema/model/model_without_method.json +2 -1
- package/schema/model.json +2 -1
- package/schema/models_category/pb/qm/abin/gw.json +2 -1
- package/schema/models_category/pb/qm/abin.json +2 -1
- package/schema/models_category/pb/qm/dft/ksdft/double_hybrid.json +2 -1
- package/schema/models_category/pb/qm/dft/ksdft/gga.json +2 -1
- package/schema/models_category/pb/qm/dft/ksdft/hybrid.json +2 -1
- package/schema/models_category/pb/qm/dft/ksdft/lda.json +2 -1
- package/schema/models_category/pb/qm/dft/ksdft/mgga.json +2 -1
- package/schema/models_category/pb/qm/dft/ksdft.json +2 -1
- package/schema/models_category/pb/qm/dft.json +2 -1
- package/schema/models_category/pb/qm/semp.json +2 -1
- package/schema/models_category/pb/qm.json +2 -1
- package/schema/models_category/pb.json +2 -1
- package/schema/models_category/st/det/ml/re.json +2 -1
- package/schema/models_category/st/det/ml.json +1 -1
- package/schema/models_category/st/det.json +1 -1
- package/schema/models_category/st.json +2 -1
- package/schema/models_directory/double_hybrid.json +2 -1
- package/schema/models_directory/gga.json +2 -1
- package/schema/models_directory/gw.json +3 -1
- package/schema/models_directory/hybrid.json +2 -1
- package/schema/models_directory/lda.json +2 -1
- package/schema/models_directory/legacy/dft.json +2 -1
- package/schema/models_directory/legacy/ml.json +2 -1
- package/schema/models_directory/legacy/unknown.json +2 -1
- package/schema/models_directory/mgga.json +2 -1
- package/schema/models_directory/re.json +2 -1
- package/schema/project.json +1 -1
- package/schema/properties_directory/derived_properties.json +8 -2
- package/schema/properties_directory/electronic_configuration.json +1 -1
- package/schema/properties_directory/elemental/atomic_radius.json +2 -1
- package/schema/properties_directory/elemental/electronegativity.json +2 -1
- package/schema/properties_directory/elemental/ionization_potential.json +2 -1
- package/schema/properties_directory/non-scalar/average_potential_profile.json +2 -1
- package/schema/properties_directory/non-scalar/band_gaps.json +4 -1
- package/schema/properties_directory/non-scalar/band_structure.json +4 -1
- package/schema/properties_directory/non-scalar/charge_density_profile.json +4 -1
- package/schema/properties_directory/non-scalar/density_of_states.json +4 -1
- package/schema/properties_directory/non-scalar/dielectric_tensor.json +2 -1
- package/schema/properties_directory/non-scalar/file_content.json +2 -1
- package/schema/properties_directory/non-scalar/hubbard_u.json +11 -4
- package/schema/properties_directory/non-scalar/hubbard_v.json +12 -4
- package/schema/properties_directory/non-scalar/hubbard_v_nn.json +2 -1
- package/schema/properties_directory/non-scalar/phonon_dispersions.json +4 -1
- package/schema/properties_directory/non-scalar/phonon_dos.json +3 -1
- package/schema/properties_directory/non-scalar/potential_profile.json +4 -1
- package/schema/properties_directory/non-scalar/reaction_energy_profile.json +4 -1
- package/schema/properties_directory/non-scalar/stress_tensor.json +2 -1
- package/schema/properties_directory/non-scalar/total_energy_contributions.json +14 -1
- package/schema/properties_directory/non-scalar/vibrational_spectrum.json +3 -1
- package/schema/properties_directory/scalar/electron_affinity.json +2 -1
- package/schema/properties_directory/scalar/fermi_energy.json +2 -1
- package/schema/properties_directory/scalar/formation_energy.json +2 -1
- package/schema/properties_directory/scalar/ionization_potential.json +2 -1
- package/schema/properties_directory/scalar/pressure.json +2 -1
- package/schema/properties_directory/scalar/reaction_energy_barrier.json +2 -1
- package/schema/properties_directory/scalar/surface_energy.json +2 -1
- package/schema/properties_directory/scalar/total_energy.json +2 -1
- package/schema/properties_directory/scalar/total_force.json +2 -1
- package/schema/properties_directory/scalar/valence_band_offset.json +2 -1
- package/schema/properties_directory/scalar/zero_point_energy.json +2 -1
- package/schema/properties_directory/structural/atomic_forces.json +2 -1
- package/schema/properties_directory/structural/basis/atomic_constraints.json +2 -1
- package/schema/properties_directory/structural/basis/atomic_coordinate.json +2 -1
- package/schema/properties_directory/structural/basis/atomic_coordinates.json +1 -0
- package/schema/properties_directory/structural/basis/atomic_element.json +2 -1
- package/schema/properties_directory/structural/basis/bonds.json +2 -1
- package/schema/properties_directory/structural/basis.json +1 -1
- package/schema/properties_directory/structural/density.json +2 -1
- package/schema/properties_directory/structural/elemental_ratio.json +4 -3
- package/schema/properties_directory/structural/inchi.json +2 -1
- package/schema/properties_directory/structural/inchi_key.json +2 -1
- package/schema/properties_directory/structural/lattice/lattice_bravais.json +2 -1
- package/schema/properties_directory/structural/lattice/lattice_vectors.json +2 -1
- package/schema/properties_directory/structural/lattice/type_enum.json +1 -2
- package/schema/properties_directory/structural/lattice/type_extended_enum.json +1 -1
- package/schema/properties_directory/structural/lattice.json +1 -1
- package/schema/properties_directory/structural/magnetic_moments.json +2 -1
- package/schema/properties_directory/structural/molecular_pattern.json +1 -1
- package/schema/properties_directory/structural/p-norm.json +2 -1
- package/schema/properties_directory/structural/patterns/functional_group.json +3 -1
- package/schema/properties_directory/structural/patterns/ring.json +3 -1
- package/schema/properties_directory/structural/patterns/special_bond.json +3 -1
- package/schema/properties_directory/structural/symmetry.json +3 -1
- package/schema/properties_directory/structural/volume.json +2 -1
- package/schema/properties_directory/workflow/convergence/electronic.json +2 -1
- package/schema/properties_directory/workflow/convergence/ionic.json +3 -1
- package/schema/properties_directory/workflow/convergence/kpoint.json +3 -1
- package/schema/property/base.json +2 -1
- package/schema/property/meta.json +2 -1
- package/schema/property/raw.json +2 -1
- package/schema/property/source.json +1 -1
- package/schema/software/application.json +7 -9
- package/schema/software/executable.json +3 -4
- package/schema/software/flavor.json +3 -11
- package/schema/software/template.json +4 -2
- package/schema/software_directory/ml/exabyteml.json +1 -1
- package/schema/software_directory/ml/unit/execution/evaluate/cross-validate.json +2 -1
- package/schema/software_directory/ml/unit/execution/initialize.json +2 -1
- package/schema/software_directory/ml/unit/execution/score.json +2 -1
- package/schema/software_directory/ml/unit/execution/train.json +2 -1
- package/schema/software_directory/ml/unit/processing/data_transformation/manipulation.json +1 -1
- package/schema/software_directory/ml/unit/processing/data_transformation/scale_and_reduce.json +2 -2
- package/schema/software_directory/ml/unit/processing/feature_selection/filter_based.json +1 -1
- package/schema/software_directory/modeling/deepmd.json +1 -1
- package/schema/software_directory/modeling/espresso/arguments.json +1 -1
- package/schema/software_directory/modeling/espresso.json +1 -1
- package/schema/software_directory/modeling/nwchem.json +1 -1
- package/schema/software_directory/modeling/unit/execution.json +1 -1
- package/schema/software_directory/modeling/vasp.json +1 -1
- package/schema/software_directory/scripting/jupyter-lab.json +1 -1
- package/schema/software_directory/scripting/python.json +1 -1
- package/schema/software_directory/scripting/shell.json +1 -1
- package/schema/software_directory/scripting/unit/execution.json +1 -1
- package/schema/system/_material.json +2 -1
- package/schema/system/_parent_job.json +2 -1
- package/schema/system/_project.json +2 -1
- package/schema/system/bankable.json +2 -1
- package/schema/system/consistency_check.json +1 -1
- package/schema/system/creator.json +2 -1
- package/schema/system/creator_account.json +2 -1
- package/schema/system/database_source.json +6 -8
- package/schema/system/defaultable.json +2 -1
- package/schema/system/description.json +2 -1
- package/schema/system/entity_reference.json +2 -1
- package/schema/system/file_source.json +1 -1
- package/schema/system/history.json +2 -1
- package/schema/system/in_set.json +2 -1
- package/schema/system/is_multi_material.json +2 -1
- package/schema/system/is_outdated.json +2 -1
- package/schema/system/job_extended.json +2 -1
- package/schema/system/message.json +2 -1
- package/schema/system/metadata.json +2 -1
- package/schema/system/name.json +2 -1
- package/schema/system/owner.json +2 -1
- package/schema/system/path.json +1 -1
- package/schema/system/path_entity.json +1 -1
- package/schema/system/schema_version.json +2 -1
- package/schema/system/scope.json +2 -1
- package/schema/system/set.json +2 -1
- package/schema/system/sharing.json +2 -1
- package/schema/system/soft_removable.json +2 -1
- package/schema/system/status.json +2 -1
- package/schema/system/tags.json +2 -1
- package/schema/system/timestampable.json +2 -1
- package/schema/system/use_values.json +2 -1
- package/schema/workflow/base.json +1 -1
- package/schema/workflow/base_flow.json +9 -2
- package/schema/workflow/scope.json +1 -1
- package/schema/workflow/subworkflow/unit.json +35 -0
- package/schema/workflow/subworkflow.json +2 -2
- package/schema/workflow/unit/assertion.json +2 -2
- package/schema/workflow/unit/assignment.json +16 -3
- package/schema/workflow/unit/base.json +68 -0
- package/schema/workflow/unit/condition.json +2 -2
- package/schema/workflow/unit/execution.json +2 -2
- package/schema/workflow/unit/input/_input.json +1 -1
- package/schema/workflow/unit/input/_inputItem.json +1 -1
- package/schema/workflow/unit/input/_inputItemId.json +2 -4
- package/schema/workflow/unit/input/_inputItemScope.json +1 -1
- package/schema/workflow/unit/input/_map_input/values.json +11 -0
- package/schema/workflow/unit/input/_map_input.json +36 -0
- package/schema/workflow/unit/io/api.json +1 -1
- package/schema/workflow/unit/io/db.json +1 -1
- package/schema/workflow/unit/io/object_storage.json +2 -2
- package/schema/workflow/unit/io.json +2 -2
- package/schema/workflow/unit/map.json +2 -2
- package/schema/workflow/unit/processing.json +2 -2
- package/schema/workflow/unit/reduce.json +2 -2
- package/schema/workflow/unit/runtime/_runtime_item_full_object.json +1 -1
- package/schema/workflow/unit/runtime/_runtime_item_name_object.json +1 -1
- package/schema/workflow/unit/runtime/_runtime_item_string.json +1 -1
- package/schema/workflow/unit/runtime/runtime_item.json +1 -1
- package/schema/workflow/unit/runtime/runtime_items.json +1 -1
- package/schema/workflow/unit/subworkflow.json +18 -0
- package/schema/workflow/unit.json +22 -46
- package/schema/workflow.json +2 -30
- package/set_schema_ids.ts +3 -0
- package/src/js/esse/JSONSchemasGenerator.ts +94 -0
- package/src/js/esse/JSONSchemasInterface.ts +56 -0
- package/src/js/esse/JSONSchemasInterfaceServer.ts +49 -0
- package/src/js/esse/schemaUtils.ts +28 -0
- package/src/js/esse/types.ts +3 -0
- package/src/js/esse/utils.ts +72 -0
- package/src/js/json_include/{index.js → index.ts} +22 -21
- package/src/js/scripts/compileTs.ts +84 -0
- package/src/js/scripts/{createEnumsFromYaml.mjs → createEnumsFromYaml.ts} +5 -19
- package/src/js/scripts/setSchemaIds.ts +28 -0
- package/src/js/utils/ajv.ts +119 -0
- package/src/js/utils/common.ts +15 -0
- package/src/js/utils/filesystem.ts +34 -0
- package/tsconfig.json +34 -0
- package/example/workflow/unit.json +0 -8
- package/lib/js/esse/index.js +0 -101
- package/lib/js/json_include/utils.js +0 -22
- package/src/js/esse/index.js +0 -57
- package/src/js/esse/schemaUtils.js +0 -45
- package/src/js/esse/utils.js +0 -52
- package/src/js/json_include/utils.js +0 -11
- package/src/js/scripts/setSchemaIds.mjs +0 -34
- /package/src/js/esse/{settings.js → settings.ts} +0 -0
- /package/src/js/json_include/{settings.js → settings.ts} +0 -0
package/.eslintrc.json
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": ["@exabyte-io/eslint-config"]
|
|
2
|
+
"extends": ["@exabyte-io/eslint-config"],
|
|
3
|
+
"ignorePatterns": ["lib/js/**/*.js", "lib/js/**/*.ts"],
|
|
4
|
+
"settings": {
|
|
5
|
+
"import/resolver": {
|
|
6
|
+
"node": {
|
|
7
|
+
"extensions": [".js", ".jsx", ".ts", ".tsx"]
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
3
11
|
}
|
package/.mocharc.json
ADDED
package/build_schemas.js
CHANGED
|
@@ -4,23 +4,12 @@
|
|
|
4
4
|
* downstream consumption to avoid FS calls in the browser.
|
|
5
5
|
*/
|
|
6
6
|
const fs = require("fs");
|
|
7
|
-
const
|
|
8
|
-
const mergeAllOf = require("json-schema-merge-allof");
|
|
9
|
-
const { ESSE } = require("./lib/js/esse");
|
|
7
|
+
const JSONSchemasGenerator = require("./lib/js/esse/JSONSchemasGenerator").default;
|
|
10
8
|
|
|
11
9
|
// JS Modules
|
|
12
10
|
|
|
13
|
-
const
|
|
14
|
-
const { schemas, wrappedExamples, propertiesManifest, results } =
|
|
15
|
-
const schema = esse.buildGlobalSchema();
|
|
16
|
-
|
|
17
|
-
fs.writeFileSync(
|
|
18
|
-
"./schemas.js",
|
|
19
|
-
"module.exports = {schemas: " + JSON.stringify(schemas) + "}",
|
|
20
|
-
"utf8",
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
fs.writeFileSync("./schema.js", "module.exports = " + JSON.stringify(schema), "utf8");
|
|
11
|
+
const generator = new JSONSchemasGenerator();
|
|
12
|
+
const { schemas, wrappedExamples, propertiesManifest, results } = generator;
|
|
24
13
|
|
|
25
14
|
if (process.env.BUILD_PYTHON_MODULES === "true") {
|
|
26
15
|
// PY Modules
|
|
@@ -52,21 +41,7 @@ if (process.env.BUILD_ASSETS !== "true") {
|
|
|
52
41
|
}
|
|
53
42
|
|
|
54
43
|
const subfolder = process.env.BUILD_PATH || "./docs/js/";
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
resolvers: { defaultResolver: mergeAllOf.options.resolvers.title },
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
const id_as_path = mergedSchema.$id.replace("-", "_");
|
|
63
|
-
const full_path = `${subfolder}/schema/${id_as_path}.json`;
|
|
64
|
-
fs.mkdirSync(path.dirname(full_path), { recursive: true });
|
|
65
|
-
fs.writeFileSync(full_path, JSON.stringify(mergedSchema, null, 4), "utf8");
|
|
66
|
-
});
|
|
67
|
-
wrappedExamples.forEach((e) => {
|
|
68
|
-
const id_as_path = e.path.replace("-", "_");
|
|
69
|
-
const full_path = `${subfolder}/example/${id_as_path}.json`;
|
|
70
|
-
fs.mkdirSync(path.dirname(full_path), { recursive: true });
|
|
71
|
-
fs.writeFileSync(full_path, JSON.stringify(e.data, null, 4), "utf8");
|
|
72
|
-
});
|
|
44
|
+
const skipMergeAllOff = process.env.SKIP_MERGE_ALLOF === "true";
|
|
45
|
+
|
|
46
|
+
generator.writeResolvedSchemas(subfolder, skipMergeAllOff);
|
|
47
|
+
generator.writeResolvedExamples(subfolder);
|
package/compile_ts.ts
ADDED
package/example/workflow.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { JSONSchema, JSONSchemaWithPath } from "./utils";
|
|
2
|
+
interface JSONSchemasGeneratorConfig {
|
|
3
|
+
schemasDir: string;
|
|
4
|
+
examplesDir?: string;
|
|
5
|
+
propertiesManifestDir?: string;
|
|
6
|
+
}
|
|
7
|
+
export default class JSONSchemasGenerator implements JSONSchemasGeneratorConfig {
|
|
8
|
+
readonly schemas: JSONSchema[];
|
|
9
|
+
readonly examples?: JSONSchema[];
|
|
10
|
+
readonly wrappedExamples: JSONSchemaWithPath[];
|
|
11
|
+
readonly propertiesManifest: object;
|
|
12
|
+
readonly results: object;
|
|
13
|
+
readonly schemasDir: string;
|
|
14
|
+
readonly examplesDir?: string;
|
|
15
|
+
readonly propertiesManifestDir?: string;
|
|
16
|
+
constructor(config?: JSONSchemasGeneratorConfig);
|
|
17
|
+
writeResolvedSchemas(subfolder: string, skipMergeAllOff?: boolean): void;
|
|
18
|
+
writeResolvedExamples(subfolder: string): void;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/* eslint-disable class-methods-use-this */
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
9
|
+
const json_schema_merge_allof_1 = __importDefault(require("json-schema-merge-allof"));
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const settings_1 = require("./settings");
|
|
12
|
+
const utils_1 = require("./utils");
|
|
13
|
+
const DEFAULT_CONFIG = {
|
|
14
|
+
schemasDir: settings_1.SCHEMAS_DIR,
|
|
15
|
+
examplesDir: settings_1.EXAMPLES_DIR,
|
|
16
|
+
propertiesManifestDir: settings_1.PROPERTIES_MANIFEST_PATH,
|
|
17
|
+
};
|
|
18
|
+
class JSONSchemasGenerator {
|
|
19
|
+
constructor(config = DEFAULT_CONFIG) {
|
|
20
|
+
this.schemasDir = config.schemasDir;
|
|
21
|
+
this.examplesDir = config.examplesDir;
|
|
22
|
+
this.propertiesManifestDir = config.propertiesManifestDir;
|
|
23
|
+
this.schemas = (0, utils_1.parseIncludeReferenceStatementsByDir)(this.schemasDir);
|
|
24
|
+
this.wrappedExamples = this.examplesDir
|
|
25
|
+
? (0, utils_1.parseIncludeReferenceStatementsByDir)(this.examplesDir, true)
|
|
26
|
+
: [];
|
|
27
|
+
this.examples = this.wrappedExamples.map((example) => example.data);
|
|
28
|
+
this.propertiesManifest = this.propertiesManifestDir
|
|
29
|
+
? js_yaml_1.default.load(fs_1.default.readFileSync(this.propertiesManifestDir, "utf-8"))
|
|
30
|
+
: {};
|
|
31
|
+
this.results = Object.entries(this.propertiesManifest)
|
|
32
|
+
.map((k) => (k[1].isResult ? k[0] : null))
|
|
33
|
+
.filter((x) => x);
|
|
34
|
+
}
|
|
35
|
+
writeResolvedSchemas(subfolder, skipMergeAllOff = false) {
|
|
36
|
+
const schemasFolder = `${subfolder}/schema`;
|
|
37
|
+
fs_1.default.rmSync(schemasFolder, { recursive: true, force: true });
|
|
38
|
+
const mergeAllOfConfig = {
|
|
39
|
+
resolvers: { defaultResolver: json_schema_merge_allof_1.default.options.resolvers.title },
|
|
40
|
+
};
|
|
41
|
+
const schemas = this.schemas.map((schema) => {
|
|
42
|
+
var _a;
|
|
43
|
+
console.log(`Resolving schema: ${schema.$id}`);
|
|
44
|
+
const mergedSchema = skipMergeAllOff ? schema : (0, json_schema_merge_allof_1.default)(schema, mergeAllOfConfig);
|
|
45
|
+
const idAsPath = (_a = mergedSchema.$id) === null || _a === void 0 ? void 0 : _a.replace(/-/g, "_");
|
|
46
|
+
const fullPath = `${schemasFolder}/${idAsPath}.json`;
|
|
47
|
+
fs_1.default.mkdirSync(path_1.default.dirname(fullPath), { recursive: true });
|
|
48
|
+
fs_1.default.writeFileSync(fullPath, JSON.stringify(mergedSchema, null, 4), "utf8");
|
|
49
|
+
return mergedSchema;
|
|
50
|
+
});
|
|
51
|
+
fs_1.default.writeFileSync(`${subfolder}/schemas.json`, `${JSON.stringify(schemas)}`);
|
|
52
|
+
}
|
|
53
|
+
writeResolvedExamples(subfolder) {
|
|
54
|
+
const examplesFolder = `${subfolder}/example`;
|
|
55
|
+
fs_1.default.rmSync(`${examplesFolder}`, { recursive: true, force: true });
|
|
56
|
+
this.wrappedExamples.forEach((e) => {
|
|
57
|
+
const idAsPath = e.path.replace(/-/g, "_");
|
|
58
|
+
const fullPath = `${examplesFolder}/${idAsPath}.json`;
|
|
59
|
+
fs_1.default.mkdirSync(path_1.default.dirname(fullPath), { recursive: true });
|
|
60
|
+
fs_1.default.writeFileSync(fullPath, JSON.stringify(e.data, null, 4), "utf8");
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.default = JSONSchemasGenerator;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { JSONSchema } from "./utils";
|
|
2
|
+
export type JSONSchemasInterfaceQuery = {
|
|
3
|
+
[key in keyof JSONSchema]: {
|
|
4
|
+
$regex: string;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export default class JSONSchemasInterface {
|
|
8
|
+
static schemasCache: Map<string, import("json-schema").JSONSchema7>;
|
|
9
|
+
static setSchemas(schema: JSONSchema[]): void;
|
|
10
|
+
static addSchema(schema: JSONSchema): void;
|
|
11
|
+
static getSchemaById(schemaId: string): import("json-schema").JSONSchema7 | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* @example <caption>Search by $id regex</caption>
|
|
14
|
+
* JSONSchemasInterface.matchSchema({
|
|
15
|
+
* $id: {
|
|
16
|
+
* $regex: 'software-application'
|
|
17
|
+
* }
|
|
18
|
+
* })
|
|
19
|
+
*
|
|
20
|
+
* @example <caption>Search by $id and title regex</caption>
|
|
21
|
+
* JSONSchemasInterface.matchSchema({
|
|
22
|
+
* $id: {
|
|
23
|
+
* $regex: 'software-application'
|
|
24
|
+
* },
|
|
25
|
+
* title: {
|
|
26
|
+
* $regex: 'application'
|
|
27
|
+
* }
|
|
28
|
+
* })
|
|
29
|
+
*/
|
|
30
|
+
static matchSchema(query: JSONSchemasInterfaceQuery): import("json-schema").JSONSchema7 | undefined;
|
|
31
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class JSONSchemasInterface {
|
|
4
|
+
static setSchemas(schema) {
|
|
5
|
+
schema.forEach((schema) => this.addSchema(schema));
|
|
6
|
+
}
|
|
7
|
+
static addSchema(schema) {
|
|
8
|
+
if (schema.$id) {
|
|
9
|
+
this.schemasCache.set(schema.$id, schema);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
static getSchemaById(schemaId) {
|
|
13
|
+
return this.schemasCache.get(schemaId);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @example <caption>Search by $id regex</caption>
|
|
17
|
+
* JSONSchemasInterface.matchSchema({
|
|
18
|
+
* $id: {
|
|
19
|
+
* $regex: 'software-application'
|
|
20
|
+
* }
|
|
21
|
+
* })
|
|
22
|
+
*
|
|
23
|
+
* @example <caption>Search by $id and title regex</caption>
|
|
24
|
+
* JSONSchemasInterface.matchSchema({
|
|
25
|
+
* $id: {
|
|
26
|
+
* $regex: 'software-application'
|
|
27
|
+
* },
|
|
28
|
+
* title: {
|
|
29
|
+
* $regex: 'application'
|
|
30
|
+
* }
|
|
31
|
+
* })
|
|
32
|
+
*/
|
|
33
|
+
static matchSchema(query) {
|
|
34
|
+
const searchFields = Object.keys(query);
|
|
35
|
+
return Array.from(this.schemasCache.values()).find((schema) => {
|
|
36
|
+
return searchFields.every((field) => {
|
|
37
|
+
const queryField = query[field];
|
|
38
|
+
const schemaField = schema[field];
|
|
39
|
+
if (!queryField || typeof schemaField !== "string") {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
return new RegExp(queryField.$regex).test(schemaField);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.default = JSONSchemasInterface;
|
|
48
|
+
JSONSchemasInterface.schemasCache = new Map();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SchemaObject } from "ajv";
|
|
2
|
+
import JSONSchemasInterface from "./JSONSchemasInterface";
|
|
3
|
+
export declare function readSchemaFolderSync(folderPath: string): SchemaObject[];
|
|
4
|
+
export default class JSONSchemasInterfaceServer extends JSONSchemasInterface {
|
|
5
|
+
static schemaFolder: string;
|
|
6
|
+
static setSchemaFolder(schemaFolder: string): void;
|
|
7
|
+
static readSchemaFolder(): void;
|
|
8
|
+
static getSchemaById(schemaId: string): import("json-schema").JSONSchema7 | undefined;
|
|
9
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.readSchemaFolderSync = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const filesystem_1 = require("../utils/filesystem");
|
|
10
|
+
const JSONSchemasInterface_1 = __importDefault(require("./JSONSchemasInterface"));
|
|
11
|
+
function readSchemaFolderSync(folderPath) {
|
|
12
|
+
const schemas = [];
|
|
13
|
+
(0, filesystem_1.walkDirSync)(folderPath, (filePath) => {
|
|
14
|
+
if (path_1.default.extname(filePath) !== ".json") {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const schema = JSON.parse(fs_1.default.readFileSync(filePath).toString());
|
|
18
|
+
schemas.push(schema);
|
|
19
|
+
});
|
|
20
|
+
return schemas;
|
|
21
|
+
}
|
|
22
|
+
exports.readSchemaFolderSync = readSchemaFolderSync;
|
|
23
|
+
class JSONSchemasInterfaceServer extends JSONSchemasInterface_1.default {
|
|
24
|
+
static setSchemaFolder(schemaFolder) {
|
|
25
|
+
if (this.schemaFolder !== schemaFolder) {
|
|
26
|
+
this.schemaFolder = schemaFolder;
|
|
27
|
+
this.readSchemaFolder();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
static readSchemaFolder() {
|
|
31
|
+
const schemas = readSchemaFolderSync(this.schemaFolder);
|
|
32
|
+
schemas.forEach((schema) => {
|
|
33
|
+
if (schema.$id) {
|
|
34
|
+
this.schemasCache.set(schema.$id, schema);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
static getSchemaById(schemaId) {
|
|
39
|
+
if (this.schemasCache.size === 0) {
|
|
40
|
+
this.readSchemaFolder();
|
|
41
|
+
}
|
|
42
|
+
return super.getSchemaById(schemaId);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.default = JSONSchemasInterfaceServer;
|
|
46
|
+
JSONSchemasInterfaceServer.schemaFolder = path_1.default.resolve(__dirname, "./../schema");
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { JSONSchema, JSONSchemaDefinition } from "./utils";
|
|
2
|
+
export type MapSchema = (prop: JSONSchemaDefinition) => JSONSchemaDefinition | undefined;
|
|
3
|
+
export declare function mapObjectDeep(object: JSONSchemaDefinition, mapValue: MapSchema): JSONSchema;
|
|
4
|
+
export declare function mapObjectDeep(object: JSONSchemaDefinition[], mapValue: MapSchema): JSONSchema[];
|
|
@@ -1,78 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.buildSchemaDefinitions = buildSchemaDefinitions;
|
|
7
|
-
exports.makeFlatSchemaKey = makeFlatSchemaKey;
|
|
8
|
-
exports.makeFlatSchemaRef = makeFlatSchemaRef;
|
|
9
|
-
exports.mapObjectDeep = mapObjectDeep;
|
|
10
|
-
|
|
11
|
-
var _keyBy = _interopRequireDefault(require("lodash/keyBy"));
|
|
12
|
-
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
|
-
|
|
15
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
|
-
|
|
17
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
18
|
-
|
|
19
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
20
|
-
|
|
21
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
22
|
-
|
|
23
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
24
|
-
|
|
25
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
|
-
|
|
27
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
28
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mapObjectDeep = void 0;
|
|
29
4
|
function mapObjectDeep(object, mapValue) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
5
|
+
if (typeof object !== "object" || object === null) {
|
|
6
|
+
return object;
|
|
7
|
+
}
|
|
8
|
+
if (Array.isArray(object)) {
|
|
9
|
+
return object.map((innerValue) => mapObjectDeep(innerValue, mapValue));
|
|
10
|
+
}
|
|
11
|
+
const mappedObject = mapValue(object) || object;
|
|
12
|
+
const entries = Object.entries(mappedObject).map(([key, value]) => {
|
|
13
|
+
return [key, mapObjectDeep(value, mapValue)];
|
|
37
14
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var entries = Object.entries(object).map(function (_ref) {
|
|
41
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
42
|
-
key = _ref2[0],
|
|
43
|
-
value = _ref2[1];
|
|
44
|
-
|
|
45
|
-
var res = mapValue(value);
|
|
46
|
-
return [key, res === undefined ? mapObjectDeep(value, mapValue) : res];
|
|
47
|
-
});
|
|
48
|
-
return Object.fromEntries(entries);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function makeFlatSchemaKey(schemaId) {
|
|
52
|
-
return schemaId.replace(/[^a-zA-Z-]/g, ":");
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function makeFlatSchemaRef(schemaId) {
|
|
56
|
-
return {
|
|
57
|
-
$ref: "#/definitions/".concat(makeFlatSchemaKey(schemaId))
|
|
58
|
-
};
|
|
15
|
+
return Object.fromEntries(entries);
|
|
59
16
|
}
|
|
60
|
-
|
|
61
|
-
function buildSchemaDefinitions(originalSchemas) {
|
|
62
|
-
var schemas = originalSchemas.map(function (schema) {
|
|
63
|
-
return mapObjectDeep(schema, function (value) {
|
|
64
|
-
if (_typeof(value) === "object" && value.$id) {
|
|
65
|
-
return makeFlatSchemaRef(value.$id);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (_typeof(value) === "object" && value.$ref) {
|
|
69
|
-
// assume value.$ref is a $id
|
|
70
|
-
return makeFlatSchemaRef(value.$ref);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
return (0, _keyBy["default"])(schemas, function (_ref3) {
|
|
75
|
-
var $id = _ref3.$id;
|
|
76
|
-
return makeFlatSchemaKey($id);
|
|
77
|
-
});
|
|
78
|
-
}
|
|
17
|
+
exports.mapObjectDeep = mapObjectDeep;
|
package/lib/js/esse/settings.js
CHANGED
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var SCHEMAS_DIR = _path["default"].resolve(__dirname, "../../../schema");
|
|
13
|
-
|
|
14
|
-
exports.SCHEMAS_DIR = SCHEMAS_DIR;
|
|
15
|
-
|
|
16
|
-
var EXAMPLES_DIR = _path["default"].resolve(__dirname, "../../../example");
|
|
17
|
-
|
|
18
|
-
exports.EXAMPLES_DIR = EXAMPLES_DIR;
|
|
19
|
-
|
|
20
|
-
var PROPERTIES_MANIFEST_PATH = _path["default"].resolve(__dirname, "../../../manifest/properties.yaml");
|
|
21
|
-
|
|
22
|
-
exports.PROPERTIES_MANIFEST_PATH = PROPERTIES_MANIFEST_PATH;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PROPERTIES_MANIFEST_PATH = exports.EXAMPLES_DIR = exports.SCHEMAS_DIR = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
exports.SCHEMAS_DIR = path_1.default.resolve(__dirname, "../../../schema");
|
|
9
|
+
exports.EXAMPLES_DIR = path_1.default.resolve(__dirname, "../../../example");
|
|
10
|
+
exports.PROPERTIES_MANIFEST_PATH = path_1.default.resolve(__dirname, "../../../manifest/properties.yaml");
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { JSONSchema7, JSONSchema7Definition } from "json-schema";
|
|
2
|
+
export type JSONSchema = JSONSchema7;
|
|
3
|
+
export type JSONSchemaDefinition = JSONSchema7Definition;
|
|
4
|
+
/**
|
|
5
|
+
* Resolves `include` and `$ref` statements.
|
|
6
|
+
* @param filePath {String} file to parse.
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseIncludeReferenceStatements(filePath: string): JSONSchema;
|
|
9
|
+
export interface JSONSchemaWithPath {
|
|
10
|
+
data: JSONSchema;
|
|
11
|
+
path: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function parseIncludeReferenceStatementsByDir(dirPath: string, wrapInDataAndPath: true): JSONSchemaWithPath[];
|
|
14
|
+
export declare function parseIncludeReferenceStatementsByDir(dirPath: string, wrapInDataAndPath?: false): JSONSchema[];
|
package/lib/js/esse/utils.js
CHANGED
|
@@ -1,74 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.parseIncludeReferenceStatements =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _jsonSchemaDerefSync = _interopRequireDefault(require("json-schema-deref-sync"));
|
|
12
|
-
|
|
13
|
-
var _path2 = _interopRequireDefault(require("path"));
|
|
14
|
-
|
|
15
|
-
var _json_include = require("../json_include");
|
|
16
|
-
|
|
17
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
18
|
-
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.parseIncludeReferenceStatementsByDir = exports.parseIncludeReferenceStatements = void 0;
|
|
7
|
+
const json_schema_deref_sync_1 = __importDefault(require("json-schema-deref-sync"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const json_include_1 = require("../json_include");
|
|
10
|
+
const filesystem_1 = require("../utils/filesystem");
|
|
19
11
|
/**
|
|
20
12
|
* Resolves `include` and `$ref` statements.
|
|
21
13
|
* @param filePath {String} file to parse.
|
|
22
14
|
*/
|
|
23
15
|
function parseIncludeReferenceStatements(filePath) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (dereferenced instanceof Error && dereferenced.message === "Circular self reference") {
|
|
34
|
-
dereferenced = parsed;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return dereferenced;
|
|
16
|
+
const jsonResolver = new json_include_1.JSONInclude();
|
|
17
|
+
const parsed = jsonResolver.parseIncludeStatements(filePath);
|
|
18
|
+
const dirPath = path_1.default.dirname(filePath);
|
|
19
|
+
let dereferenced = (0, json_schema_deref_sync_1.default)(parsed, { baseFolder: dirPath, removeIds: true });
|
|
20
|
+
// handle circular references and use non-dereferenced source
|
|
21
|
+
if (dereferenced instanceof Error && dereferenced.message === "Circular self reference") {
|
|
22
|
+
dereferenced = parsed;
|
|
23
|
+
}
|
|
24
|
+
return dereferenced;
|
|
38
25
|
}
|
|
26
|
+
exports.parseIncludeReferenceStatements = parseIncludeReferenceStatements;
|
|
39
27
|
/**
|
|
40
28
|
* Resolves `include` and `$ref` statements for all the JSON files inside a given directory.
|
|
41
|
-
* @param dirPath
|
|
29
|
+
* @param dirPath directory to parse.
|
|
42
30
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
data.push({
|
|
63
|
-
data: config,
|
|
64
|
-
path: _path
|
|
65
|
-
});
|
|
66
|
-
} else {
|
|
67
|
-
data.push(config);
|
|
31
|
+
function parseIncludeReferenceStatementsByDir(dirPath, wrapInDataAndPath = false) {
|
|
32
|
+
const schemas = [];
|
|
33
|
+
const schemasWithPath = [];
|
|
34
|
+
const topDir = path_1.default.resolve(__dirname, "../../../");
|
|
35
|
+
(0, filesystem_1.walkDirSync)(dirPath, (filePath) => {
|
|
36
|
+
if (filePath.endsWith(".json")) {
|
|
37
|
+
const config = parseIncludeReferenceStatements(filePath);
|
|
38
|
+
if (wrapInDataAndPath) {
|
|
39
|
+
const _path = path_1.default.join(
|
|
40
|
+
// remove leading slashes and "example" from path
|
|
41
|
+
path_1.default
|
|
42
|
+
.dirname(filePath)
|
|
43
|
+
.replace(path_1.default.join(topDir, "example"), "")
|
|
44
|
+
.replace(/^\/+/, ""), path_1.default.basename(filePath).replace(".json", ""));
|
|
45
|
+
schemasWithPath.push({ data: config, path: _path });
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
schemas.push(config);
|
|
49
|
+
}
|
|
68
50
|
}
|
|
69
|
-
}
|
|
70
51
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
52
|
+
return wrapInDataAndPath ? schemasWithPath : schemas;
|
|
53
|
+
}
|
|
54
|
+
exports.parseIncludeReferenceStatementsByDir = parseIncludeReferenceStatementsByDir;
|