@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function compileTS(schemaPath: string, savePath: string): Promise<void>;
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const json_schema_to_typescript_1 = require("json-schema-to-typescript");
|
|
8
|
+
const schemaUtils_1 = require("../esse/schemaUtils");
|
|
9
|
+
const filesystem_1 = require("../utils/filesystem");
|
|
10
|
+
/**
|
|
11
|
+
* By definition, the "compile" function will generate 2 schemas based on the following input:
|
|
12
|
+
* {
|
|
13
|
+
* "title": "schema1",
|
|
14
|
+
* "type": "object",
|
|
15
|
+
* "properties": {
|
|
16
|
+
* "prop": {
|
|
17
|
+
* "title": "schema2",
|
|
18
|
+
* "type": "string"
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* Result:
|
|
24
|
+
* type schema2 = string;
|
|
25
|
+
*
|
|
26
|
+
* interface schema1 {
|
|
27
|
+
* prop: schema2
|
|
28
|
+
* }
|
|
29
|
+
*
|
|
30
|
+
* To disable this behavior we need to remove "title" property from the "prop":
|
|
31
|
+
* {
|
|
32
|
+
* "title": "schema1",
|
|
33
|
+
* "type": "object",
|
|
34
|
+
* "properties": {
|
|
35
|
+
* "prop": {
|
|
36
|
+
* "type": "string"
|
|
37
|
+
* }
|
|
38
|
+
* }
|
|
39
|
+
* }
|
|
40
|
+
*
|
|
41
|
+
* New result:
|
|
42
|
+
* interface schema1 {
|
|
43
|
+
* prop: string;
|
|
44
|
+
* }
|
|
45
|
+
* @returns Clean schema
|
|
46
|
+
*/
|
|
47
|
+
function cleanSchema(schema) {
|
|
48
|
+
let firstRun = true;
|
|
49
|
+
return (0, schemaUtils_1.mapObjectDeep)(schema, (object) => {
|
|
50
|
+
if (typeof object === "object" && (object === null || object === void 0 ? void 0 : object.title) && !firstRun) {
|
|
51
|
+
firstRun = false;
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
53
|
+
const { title, $schema, ...restObject } = object;
|
|
54
|
+
return restObject;
|
|
55
|
+
}
|
|
56
|
+
firstRun = false;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
async function compileTS(schemaPath, savePath) {
|
|
60
|
+
try {
|
|
61
|
+
await fs_1.default.promises.unlink(savePath);
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
console.log("File with types not exists");
|
|
65
|
+
}
|
|
66
|
+
await (0, filesystem_1.walkDir)(schemaPath, async (filePath) => {
|
|
67
|
+
const data = await fs_1.default.promises.readFile(filePath, "utf8");
|
|
68
|
+
const schema = cleanSchema(JSON.parse(data));
|
|
69
|
+
console.log(`Compiling Typescript: ${filePath}`);
|
|
70
|
+
// @ts-ignore
|
|
71
|
+
const compiledSchema = await (0, json_schema_to_typescript_1.compile)(schema, schema.title || "", {
|
|
72
|
+
unreachableDefinitions: true,
|
|
73
|
+
additionalProperties: false,
|
|
74
|
+
bannerComment: `/** Schema ${filePath} */`,
|
|
75
|
+
});
|
|
76
|
+
await fs_1.default.promises.appendFile(savePath, `${compiledSchema} \n`, { flag: "a+" });
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
exports.default = compileTS;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,74 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
|
-
|
|
13
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
14
|
-
|
|
15
|
-
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); }
|
|
16
|
-
|
|
17
|
-
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; }
|
|
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
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const filesystem_1 = require("../utils/filesystem");
|
|
19
11
|
/**
|
|
20
12
|
* We use YAML files to list enum options which need to be reused in other places.
|
|
21
13
|
* The format also allows for additional context to the often shortened slugs, such as DOIs.
|
|
22
14
|
* This script converts the enum lists to JSON files for $ref blocks inside schemas.
|
|
23
15
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var _iterator = _createForOfIteratorHelper(subDirs),
|
|
30
|
-
_step;
|
|
31
|
-
|
|
32
|
-
try {
|
|
33
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
34
|
-
var subDir = _step.value;
|
|
35
|
-
|
|
36
|
-
var itemPath = _path["default"].join(dir, subDir);
|
|
37
|
-
|
|
38
|
-
var stat = _fs["default"].statSync(itemPath);
|
|
39
|
-
|
|
40
|
-
if (stat.isDirectory()) {
|
|
41
|
-
walkDir(itemPath, callback);
|
|
42
|
-
} else {
|
|
43
|
-
callback(itemPath);
|
|
44
|
-
}
|
|
16
|
+
const SCHEMA_DIR = "../../../schema/";
|
|
17
|
+
(0, filesystem_1.walkDir)(SCHEMA_DIR, (filePath) => {
|
|
18
|
+
if (path_1.default.extname(filePath) !== ".yml") {
|
|
19
|
+
return;
|
|
45
20
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (_path["default"].extname(filePath) !== ".yml") {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
console.log(filePath);
|
|
59
|
-
var outFilename = "".concat(_path["default"].basename(filePath, ".yml"), ".json");
|
|
60
|
-
|
|
61
|
-
var dirname = _path["default"].dirname(filePath);
|
|
62
|
-
|
|
63
|
-
var fileContents = _fs["default"].readFileSync(filePath);
|
|
64
|
-
|
|
65
|
-
var obj = _jsYaml["default"].load(fileContents);
|
|
66
|
-
|
|
67
|
-
var enumObj = _lodash["default"].mapValues(obj, function (value) {
|
|
68
|
-
return {
|
|
69
|
-
"enum": value
|
|
70
|
-
};
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
_fs["default"].writeFileSync("".concat(_path["default"].join(dirname, outFilename)), "".concat(JSON.stringify(enumObj, null, 4), "\n"));
|
|
74
|
-
});
|
|
21
|
+
console.log(filePath);
|
|
22
|
+
const outFilename = `${path_1.default.basename(filePath, ".yml")}.json`;
|
|
23
|
+
const dirname = path_1.default.dirname(filePath);
|
|
24
|
+
const fileContents = fs_1.default.readFileSync(filePath);
|
|
25
|
+
const obj = js_yaml_1.default.load(fileContents.toString());
|
|
26
|
+
const enumObj = lodash_1.default.mapValues(obj, (value) => ({ enum: value }));
|
|
27
|
+
fs_1.default.writeFileSync(`${path_1.default.join(dirname, outFilename)}`, `${JSON.stringify(enumObj, null, 4)}\n`);
|
|
28
|
+
});
|
|
@@ -1,156 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
|
-
|
|
19
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
20
|
-
|
|
21
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22
|
-
|
|
23
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
24
|
-
|
|
25
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
26
|
-
|
|
27
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
28
|
-
|
|
29
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
30
|
-
|
|
31
|
-
var SCHEMA_DIR = "../../../schema/";
|
|
32
|
-
|
|
33
|
-
function walkDir(_x, _x2) {
|
|
34
|
-
return _walkDir.apply(this, arguments);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function _walkDir() {
|
|
38
|
-
_walkDir = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(dir, callback) {
|
|
39
|
-
var subDirs, _iterator, _step, subDir, itemPath, stat;
|
|
40
|
-
|
|
41
|
-
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
42
|
-
while (1) {
|
|
43
|
-
switch (_context2.prev = _context2.next) {
|
|
44
|
-
case 0:
|
|
45
|
-
_context2.next = 2;
|
|
46
|
-
return _promises["default"].readdir(dir);
|
|
47
|
-
|
|
48
|
-
case 2:
|
|
49
|
-
subDirs = _context2.sent;
|
|
50
|
-
_iterator = _createForOfIteratorHelper(subDirs);
|
|
51
|
-
_context2.prev = 4;
|
|
52
|
-
|
|
53
|
-
_iterator.s();
|
|
54
|
-
|
|
55
|
-
case 6:
|
|
56
|
-
if ((_step = _iterator.n()).done) {
|
|
57
|
-
_context2.next = 21;
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
subDir = _step.value;
|
|
62
|
-
itemPath = _path["default"].join(dir, subDir);
|
|
63
|
-
_context2.next = 11;
|
|
64
|
-
return _promises["default"].stat(itemPath);
|
|
65
|
-
|
|
66
|
-
case 11:
|
|
67
|
-
stat = _context2.sent;
|
|
68
|
-
|
|
69
|
-
if (!stat.isDirectory()) {
|
|
70
|
-
_context2.next = 17;
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
_context2.next = 15;
|
|
75
|
-
return walkDir(itemPath, callback);
|
|
76
|
-
|
|
77
|
-
case 15:
|
|
78
|
-
_context2.next = 19;
|
|
79
|
-
break;
|
|
80
|
-
|
|
81
|
-
case 17:
|
|
82
|
-
_context2.next = 19;
|
|
83
|
-
return callback(itemPath);
|
|
84
|
-
|
|
85
|
-
case 19:
|
|
86
|
-
_context2.next = 6;
|
|
87
|
-
break;
|
|
88
|
-
|
|
89
|
-
case 21:
|
|
90
|
-
_context2.next = 26;
|
|
91
|
-
break;
|
|
92
|
-
|
|
93
|
-
case 23:
|
|
94
|
-
_context2.prev = 23;
|
|
95
|
-
_context2.t0 = _context2["catch"](4);
|
|
96
|
-
|
|
97
|
-
_iterator.e(_context2.t0);
|
|
98
|
-
|
|
99
|
-
case 26:
|
|
100
|
-
_context2.prev = 26;
|
|
101
|
-
|
|
102
|
-
_iterator.f();
|
|
103
|
-
|
|
104
|
-
return _context2.finish(26);
|
|
105
|
-
|
|
106
|
-
case 29:
|
|
107
|
-
case "end":
|
|
108
|
-
return _context2.stop();
|
|
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
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const filesystem_1 = require("../utils/filesystem");
|
|
9
|
+
/**
|
|
10
|
+
* Helper script.
|
|
11
|
+
* Applies correct $id to all schemas based on the schema path
|
|
12
|
+
*/
|
|
13
|
+
function setSchemaIds(schemaDir) {
|
|
14
|
+
(0, filesystem_1.walkDirSync)(schemaDir, (filePath) => {
|
|
15
|
+
if (path_1.default.extname(filePath) !== ".json") {
|
|
16
|
+
return;
|
|
109
17
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
var fileContents, _JSON$parse, oldSchemaId, schema, schemaId, newContent;
|
|
119
|
-
|
|
120
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
121
|
-
while (1) {
|
|
122
|
-
switch (_context.prev = _context.next) {
|
|
123
|
-
case 0:
|
|
124
|
-
if (!(_path["default"].extname(filePath) !== ".json")) {
|
|
125
|
-
_context.next = 2;
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return _context.abrupt("return");
|
|
130
|
-
|
|
131
|
-
case 2:
|
|
132
|
-
_context.next = 4;
|
|
133
|
-
return _promises["default"].readFile(filePath);
|
|
134
|
-
|
|
135
|
-
case 4:
|
|
136
|
-
fileContents = _context.sent;
|
|
137
|
-
_JSON$parse = JSON.parse(fileContents), oldSchemaId = _JSON$parse.$id, schema = _objectWithoutProperties(_JSON$parse, _excluded);
|
|
138
|
-
schemaId = filePath.replace(SCHEMA_DIR, "").replace(".json", "").replace(/_/g, "-");
|
|
139
|
-
newContent = JSON.stringify(_objectSpread({
|
|
140
|
-
$id: schemaId
|
|
141
|
-
}, schema), null, 4);
|
|
142
|
-
_context.next = 10;
|
|
143
|
-
return _promises["default"].writeFile(filePath, "".concat(newContent, "\n"));
|
|
144
|
-
|
|
145
|
-
case 10:
|
|
146
|
-
case "end":
|
|
147
|
-
return _context.stop();
|
|
18
|
+
const fileContents = fs_1.default.readFileSync(filePath);
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20
|
+
const { $id, ...schema } = JSON.parse(fileContents.toString());
|
|
21
|
+
const schemaId = filePath.replace(schemaDir, "").replace(".json", "").replace(/_/g, "-");
|
|
22
|
+
if ($id !== schemaId) {
|
|
23
|
+
console.log(`Set correct $id: ${filePath}`);
|
|
24
|
+
const newContent = JSON.stringify({ $id: schemaId, ...schema }, null, 4);
|
|
25
|
+
fs_1.default.writeFileSync(filePath, `${newContent}\n`);
|
|
148
26
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
return function (_x3) {
|
|
154
|
-
return _ref.apply(this, arguments);
|
|
155
|
-
};
|
|
156
|
-
}());
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
exports.default = setSchemaIds;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SchemaObject } from "ajv";
|
|
2
|
+
import { AnyValidateFunction } from "ajv/dist/core";
|
|
3
|
+
import { AnyObject } from "../esse/types";
|
|
4
|
+
interface AjvInstanceOptions {
|
|
5
|
+
clean: boolean;
|
|
6
|
+
coerceTypes: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function getValidator(jsonSchema: SchemaObject, { clean, coerceTypes }: AjvInstanceOptions): AnyValidateFunction;
|
|
9
|
+
/**
|
|
10
|
+
* Validates a given example against the schema.
|
|
11
|
+
* @param example example to validate.
|
|
12
|
+
* @param schema schema to validate the example with.
|
|
13
|
+
* @returns whether example is valid.
|
|
14
|
+
*/
|
|
15
|
+
export declare function validate(data: AnyObject, jsonSchema: SchemaObject): {
|
|
16
|
+
isValid: boolean | Promise<any>;
|
|
17
|
+
errors: import("ajv").ErrorObject<string, Record<string, any>, unknown>[] | null | undefined;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Validates and clean a given example against the schema
|
|
21
|
+
* @param example example to validate.
|
|
22
|
+
* @param schema schema to validate the example with.
|
|
23
|
+
* @returns whether example is valid.
|
|
24
|
+
*/
|
|
25
|
+
export declare function validateAndClean(data: AnyObject, jsonSchema: SchemaObject, { coerceTypes }: {
|
|
26
|
+
coerceTypes?: boolean | undefined;
|
|
27
|
+
}): {
|
|
28
|
+
isValid: boolean | Promise<any>;
|
|
29
|
+
errors: import("ajv").ErrorObject<string, Record<string, any>, unknown>[] | null | undefined;
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
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.validateAndClean = exports.validate = exports.getValidator = void 0;
|
|
7
|
+
const ajv_1 = __importDefault(require("ajv"));
|
|
8
|
+
const schemaUtils_1 = require("../esse/schemaUtils");
|
|
9
|
+
function addAdditionalPropertiesToSchema(schema, additionalProperties = false) {
|
|
10
|
+
return (0, schemaUtils_1.mapObjectDeep)(schema, (object) => {
|
|
11
|
+
const schema = object;
|
|
12
|
+
if (typeof object === "object" &&
|
|
13
|
+
(schema === null || schema === void 0 ? void 0 : schema.type) === "object" &&
|
|
14
|
+
(schema === null || schema === void 0 ? void 0 : schema.properties) &&
|
|
15
|
+
!("additionalProperties" in schema)) {
|
|
16
|
+
return {
|
|
17
|
+
...schema,
|
|
18
|
+
additionalProperties,
|
|
19
|
+
unevaluatedProperties: false,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
const ajvConfig = {
|
|
25
|
+
strict: false,
|
|
26
|
+
useDefaults: true,
|
|
27
|
+
/**
|
|
28
|
+
* discriminator fixes default values in oneOf
|
|
29
|
+
* @see https://ajv.js.org/guide/modifying-data.html#assigning-defaults
|
|
30
|
+
*/
|
|
31
|
+
discriminator: true,
|
|
32
|
+
};
|
|
33
|
+
const ajvValidator = new ajv_1.default({ ...ajvConfig });
|
|
34
|
+
const ajvValidatorAndCleaner = new ajv_1.default({ ...ajvConfig, removeAdditional: true });
|
|
35
|
+
const ajvValidatorAndCleanerWithCoercingTypes = new ajv_1.default({
|
|
36
|
+
...ajvConfig,
|
|
37
|
+
removeAdditional: true,
|
|
38
|
+
coerceTypes: true,
|
|
39
|
+
});
|
|
40
|
+
function getAjvInstance({ clean, coerceTypes }) {
|
|
41
|
+
if (clean && coerceTypes) {
|
|
42
|
+
return ajvValidatorAndCleanerWithCoercingTypes;
|
|
43
|
+
}
|
|
44
|
+
if (clean) {
|
|
45
|
+
return ajvValidatorAndCleaner;
|
|
46
|
+
}
|
|
47
|
+
return ajvValidator;
|
|
48
|
+
}
|
|
49
|
+
function getValidator(jsonSchema, { clean, coerceTypes }) {
|
|
50
|
+
const schemaKey = jsonSchema.$id;
|
|
51
|
+
const ajv = getAjvInstance({ clean, coerceTypes });
|
|
52
|
+
let validate = ajv.getSchema(schemaKey);
|
|
53
|
+
if (!validate) {
|
|
54
|
+
// properties that were not defined in schema will be ignored when clean = false
|
|
55
|
+
const patchedSchema = clean ? addAdditionalPropertiesToSchema(jsonSchema) : jsonSchema;
|
|
56
|
+
ajv.addSchema(patchedSchema, schemaKey);
|
|
57
|
+
validate = ajv.getSchema(schemaKey);
|
|
58
|
+
}
|
|
59
|
+
if (!validate) {
|
|
60
|
+
throw new Error("JSONSchemasInterface AJV validator error");
|
|
61
|
+
}
|
|
62
|
+
return validate;
|
|
63
|
+
}
|
|
64
|
+
exports.getValidator = getValidator;
|
|
65
|
+
/**
|
|
66
|
+
* Validates a given example against the schema.
|
|
67
|
+
* @param example example to validate.
|
|
68
|
+
* @param schema schema to validate the example with.
|
|
69
|
+
* @returns whether example is valid.
|
|
70
|
+
*/
|
|
71
|
+
function validate(data, jsonSchema) {
|
|
72
|
+
const validator = getValidator(jsonSchema, { clean: false, coerceTypes: false });
|
|
73
|
+
const isValid = validator(data);
|
|
74
|
+
return {
|
|
75
|
+
isValid,
|
|
76
|
+
errors: validator.errors,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
exports.validate = validate;
|
|
80
|
+
/**
|
|
81
|
+
* Validates and clean a given example against the schema
|
|
82
|
+
* @param example example to validate.
|
|
83
|
+
* @param schema schema to validate the example with.
|
|
84
|
+
* @returns whether example is valid.
|
|
85
|
+
*/
|
|
86
|
+
function validateAndClean(data, jsonSchema, { coerceTypes = false }) {
|
|
87
|
+
const validator = getValidator(jsonSchema, { clean: true, coerceTypes });
|
|
88
|
+
const isValid = validator(data);
|
|
89
|
+
return {
|
|
90
|
+
isValid,
|
|
91
|
+
errors: validator.errors,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
exports.validateAndClean = validateAndClean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function isInstanceOf(object: object, type: "Array"): object is object[];
|
|
2
|
+
export declare function isInstanceOf(object: object, type: "Object"): object is object;
|
|
3
|
+
/**
|
|
4
|
+
* Makes sure that text representing arrays is parsed into Arrays.
|
|
5
|
+
*/
|
|
6
|
+
export declare function safeParseJSON(string: string): any;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.safeParseJSON = exports.isInstanceOf = void 0;
|
|
4
|
+
function isInstanceOf(object, type) {
|
|
5
|
+
return Object.prototype.toString.call(object).slice(8, -1) === type;
|
|
6
|
+
}
|
|
7
|
+
exports.isInstanceOf = isInstanceOf;
|
|
8
|
+
/**
|
|
9
|
+
* Makes sure that text representing arrays is parsed into Arrays.
|
|
10
|
+
*/
|
|
11
|
+
function safeParseJSON(string) {
|
|
12
|
+
const obj = JSON.parse(string);
|
|
13
|
+
return string[0] === "[" ? Object.keys(obj).map((key) => obj[key]) : obj;
|
|
14
|
+
}
|
|
15
|
+
exports.safeParseJSON = safeParseJSON;
|
|
@@ -0,0 +1,38 @@
|
|
|
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.walkDirSync = exports.walkDir = void 0;
|
|
7
|
+
/* eslint-disable no-await-in-loop */
|
|
8
|
+
/* eslint-disable no-restricted-syntax */
|
|
9
|
+
const fs_1 = __importDefault(require("fs"));
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
async function walkDir(dir, callback) {
|
|
12
|
+
const subDirs = await fs_1.default.promises.readdir(dir);
|
|
13
|
+
for (const subDir of subDirs) {
|
|
14
|
+
const itemPath = path_1.default.join(dir, subDir);
|
|
15
|
+
const stat = await fs_1.default.promises.stat(itemPath);
|
|
16
|
+
if (stat.isDirectory()) {
|
|
17
|
+
await walkDir(itemPath, callback);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
await callback(itemPath);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.walkDir = walkDir;
|
|
25
|
+
function walkDirSync(dir, callback) {
|
|
26
|
+
const subDirs = fs_1.default.readdirSync(dir);
|
|
27
|
+
for (const subDir of subDirs) {
|
|
28
|
+
const itemPath = path_1.default.join(dir, subDir);
|
|
29
|
+
const stat = fs_1.default.statSync(itemPath);
|
|
30
|
+
if (stat.isDirectory()) {
|
|
31
|
+
walkDirSync(itemPath, callback);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
callback(itemPath);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.walkDirSync = walkDirSync;
|