@grnsft/if 0.5.0-beta.0 → 0.6.0-beta.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/README.md +5 -17
- package/Refactor-migration-guide.md +110 -164
- package/build/common/config/index.d.ts +1 -0
- package/build/common/config/index.js +6 -0
- package/build/common/config/strings.d.ts +8 -0
- package/build/common/config/strings.js +16 -0
- package/build/common/lib/load.d.ts +6 -0
- package/build/common/lib/load.js +18 -0
- package/build/{types → common/types}/manifest.d.ts +4 -1
- package/build/common/types/manifest.js +3 -0
- package/build/common/util/debug-logger.js +115 -0
- package/build/common/util/fs.js +94 -0
- package/build/common/util/helpers.d.ts +15 -0
- package/build/common/util/helpers.js +80 -0
- package/build/{util → common/util}/logger.js +1 -1
- package/build/{util → common/util}/validations.d.ts +149 -47
- package/build/common/util/validations.js +141 -0
- package/build/common/util/yaml.js +59 -0
- package/build/if-check/config/config.d.ts +6 -0
- package/build/if-check/config/config.js +31 -0
- package/build/{config → if-check/config}/index.d.ts +0 -1
- package/build/if-check/config/index.js +8 -0
- package/build/if-check/config/strings.d.ts +12 -0
- package/build/if-check/config/strings.js +16 -0
- package/build/if-check/index.js +98 -0
- package/build/if-check/types/process-args.d.ts +4 -0
- package/build/if-check/types/process-args.js +3 -0
- package/build/if-check/util/args.d.ts +10 -0
- package/build/if-check/util/args.js +56 -0
- package/build/if-check/util/helpers.d.ts +4 -0
- package/build/if-check/util/helpers.js +18 -0
- package/build/if-check/util/npm.d.ts +4 -0
- package/build/if-check/util/npm.js +59 -0
- package/build/if-csv/config/config.d.ts +6 -0
- package/build/if-csv/config/config.js +37 -0
- package/build/if-csv/config/index.d.ts +2 -0
- package/build/if-csv/config/index.js +8 -0
- package/build/if-csv/config/strings.d.ts +4 -0
- package/build/if-csv/config/strings.js +8 -0
- package/build/if-csv/index.js +63 -0
- package/build/if-csv/types/csv.d.ts +7 -0
- package/build/if-csv/types/csv.js +3 -0
- package/build/if-csv/types/process-args.d.ts +5 -0
- package/build/if-csv/types/process-args.js +3 -0
- package/build/if-csv/util/args.d.ts +12 -0
- package/build/if-csv/util/args.js +51 -0
- package/build/if-csv/util/helpers.d.ts +9 -0
- package/build/if-csv/util/helpers.js +95 -0
- package/build/if-diff/config/config.d.ts +6 -0
- package/build/if-diff/config/config.js +31 -0
- package/build/if-diff/config/index.d.ts +2 -0
- package/build/if-diff/config/index.js +8 -0
- package/build/if-diff/config/strings.d.ts +6 -0
- package/build/if-diff/config/strings.js +10 -0
- package/build/if-diff/index.js +46 -0
- package/build/{lib → if-diff/lib}/compare.d.ts +1 -1
- package/build/if-diff/lib/compare.js +56 -0
- package/build/{lib → if-diff/lib}/load.d.ts +16 -18
- package/build/if-diff/lib/load.js +51 -0
- package/build/if-diff/types/args.js +3 -0
- package/build/if-diff/types/compare.js +3 -0
- package/build/if-diff/types/process-args.d.ts +4 -0
- package/build/if-diff/types/process-args.js +3 -0
- package/build/if-diff/util/args.d.ts +5 -0
- package/build/if-diff/util/args.js +51 -0
- package/build/if-diff/util/helpers.d.ts +13 -0
- package/build/if-diff/util/helpers.js +75 -0
- package/build/if-env/config/config.d.ts +6 -0
- package/build/if-env/config/config.js +37 -0
- package/build/if-env/config/index.d.ts +2 -0
- package/build/if-env/config/index.js +8 -0
- package/build/if-env/config/strings.d.ts +7 -0
- package/build/if-env/config/strings.js +11 -0
- package/build/if-env/index.js +40 -0
- package/build/if-env/types/if-env.js +3 -0
- package/build/if-env/types/npm.js +3 -0
- package/build/if-env/types/process-args.d.ts +5 -0
- package/build/if-env/types/process-args.js +3 -0
- package/build/if-env/util/args.d.ts +12 -0
- package/build/if-env/util/args.js +47 -0
- package/build/if-env/util/helpers.d.ts +20 -0
- package/build/if-env/util/helpers.js +94 -0
- package/build/{util → if-env/util}/npm.d.ts +0 -4
- package/build/if-env/util/npm.js +126 -0
- package/build/if-run/builtins/coefficient/index.d.ts +2 -0
- package/build/if-run/builtins/coefficient/index.js +67 -0
- package/build/if-run/builtins/copy-param/index.d.ts +2 -0
- package/build/if-run/builtins/copy-param/index.js +70 -0
- package/build/if-run/builtins/csv-lookup/index.d.ts +2 -0
- package/build/if-run/builtins/csv-lookup/index.js +190 -0
- package/build/if-run/builtins/divide/index.d.ts +2 -0
- package/build/if-run/builtins/divide/index.js +80 -0
- package/build/if-run/builtins/exponent/index.d.ts +2 -0
- package/build/if-run/builtins/exponent/index.js +60 -0
- package/build/{builtins → if-run/builtins}/export-log.d.ts +1 -1
- package/build/{builtins → if-run/builtins}/export-log.js +1 -1
- package/build/{builtins → if-run/builtins}/export-yaml.d.ts +1 -1
- package/build/if-run/builtins/export-yaml.js +30 -0
- package/build/{builtins → if-run/builtins}/index.d.ts +1 -2
- package/build/{builtins → if-run/builtins}/index.js +4 -6
- package/build/if-run/builtins/interpolation/index.d.ts +2 -0
- package/build/if-run/builtins/interpolation/index.js +151 -0
- package/build/if-run/builtins/mock-observations/helpers/common-generator.js +29 -0
- package/build/if-run/builtins/mock-observations/helpers/rand-int-generator.js +48 -0
- package/build/if-run/builtins/mock-observations/index.d.ts +2 -0
- package/build/if-run/builtins/mock-observations/index.js +116 -0
- package/build/if-run/builtins/mock-observations/interfaces/index.js +3 -0
- package/build/if-run/builtins/multiply/index.d.ts +2 -0
- package/build/if-run/builtins/multiply/index.js +59 -0
- package/build/if-run/builtins/regex/index.d.ts +2 -0
- package/build/if-run/builtins/regex/index.js +76 -0
- package/build/if-run/builtins/sci/config.js +44 -0
- package/build/if-run/builtins/sci/index.d.ts +2 -0
- package/build/if-run/builtins/sci/index.js +92 -0
- package/build/if-run/builtins/sci-embodied/index.d.ts +2 -0
- package/build/if-run/builtins/sci-embodied/index.js +156 -0
- package/build/if-run/builtins/shell/index.d.ts +2 -0
- package/build/if-run/builtins/shell/index.js +60 -0
- package/build/if-run/builtins/subtract/index.d.ts +2 -0
- package/build/if-run/builtins/subtract/index.js +61 -0
- package/build/if-run/builtins/sum/index.d.ts +2 -0
- package/build/if-run/builtins/sum/index.js +66 -0
- package/build/if-run/builtins/time-sync/index.d.ts +17 -0
- package/build/if-run/builtins/time-sync/index.js +339 -0
- package/build/if-run/config/config.d.ts +9 -0
- package/build/if-run/config/config.js +73 -0
- package/build/if-run/config/index.d.ts +2 -0
- package/build/if-run/config/index.js +8 -0
- package/build/{config → if-run/config}/strings.d.ts +28 -50
- package/build/if-run/config/strings.js +76 -0
- package/build/if-run/index.d.ts +2 -0
- package/build/if-run/index.js +63 -0
- package/build/if-run/lib/aggregate.d.ts +15 -0
- package/build/if-run/lib/aggregate.js +123 -0
- package/build/if-run/lib/compute.js +136 -0
- package/build/{lib → if-run/lib}/environment.d.ts +1 -1
- package/build/if-run/lib/environment.js +75 -0
- package/build/{lib → if-run/lib}/exhaust.d.ts +1 -1
- package/build/if-run/lib/exhaust.js +27 -0
- package/build/if-run/lib/explain.d.ts +9 -0
- package/build/if-run/lib/explain.js +43 -0
- package/build/if-run/lib/initialize.d.ts +6 -0
- package/build/if-run/lib/initialize.js +109 -0
- package/build/if-run/lib/regroup.d.ts +5 -0
- package/build/if-run/lib/regroup.js +64 -0
- package/build/if-run/types/aggregation.d.ts +5 -0
- package/build/if-run/types/aggregation.js +6 -0
- package/build/{types → if-run/types}/compute.d.ts +12 -8
- package/build/if-run/types/compute.js +3 -0
- package/build/if-run/types/environment.js +3 -0
- package/build/{types → if-run/types}/exhaust-plugin-interface.d.ts +1 -1
- package/build/if-run/types/exhaust-plugin-interface.js +3 -0
- package/build/if-run/types/explain.d.ts +10 -0
- package/build/if-run/types/explain.js +3 -0
- package/build/if-run/types/interface.d.ts +3 -0
- package/build/if-run/types/interface.js +6 -0
- package/build/if-run/types/plugin-storage.js +3 -0
- package/build/if-run/types/process-args.d.ts +25 -0
- package/build/if-run/types/process-args.js +3 -0
- package/build/if-run/types/time-sync.js +3 -0
- package/build/{util → if-run/util}/aggregation-helper.d.ts +2 -1
- package/build/if-run/util/aggregation-helper.js +47 -0
- package/build/if-run/util/args.d.ts +9 -0
- package/build/if-run/util/args.js +60 -0
- package/build/if-run/util/helpers.d.ts +14 -0
- package/build/if-run/util/helpers.js +57 -0
- package/build/if-run/util/log-memoize.js +19 -0
- package/build/if-run/util/os-checker.js +97 -0
- package/build/{util → if-run/util}/plugin-storage.d.ts +1 -1
- package/build/if-run/util/plugin-storage.js +34 -0
- package/jest.config.js +2 -6
- package/manifests/{plugins → examples/builtins}/coefficient/failure-invalid-config-input-param.yml +2 -2
- package/manifests/{plugins → examples/builtins}/coefficient/failure-output-param-is-null.yaml +3 -3
- package/manifests/{plugins → examples/builtins}/coefficient/success.yml +2 -2
- package/manifests/{plugins → examples/builtins}/csv-lookup/cloud-metadata/failure-invalid-instance-type.yaml +3 -3
- package/manifests/{plugins → examples/builtins}/csv-lookup/cloud-metadata/failure-invalid-vendor.yaml +3 -3
- package/manifests/{plugins → examples/builtins}/csv-lookup/cloud-metadata/failure-missing-cloud-vendor.yml +3 -3
- package/manifests/{plugins → examples/builtins}/csv-lookup/cloud-metadata/success.yml +3 -3
- package/manifests/{plugins → examples/builtins}/csv-lookup/region-metadata/failure-missing-column.yml +3 -4
- package/manifests/{plugins → examples/builtins}/csv-lookup/region-metadata/failure-missing-output.yml +3 -4
- package/manifests/{plugins → examples/builtins}/csv-lookup/region-metadata/success-renaming.yml +4 -5
- package/manifests/{plugins → examples/builtins}/csv-lookup/region-metadata/success.yml +3 -4
- package/manifests/{plugins → examples/builtins}/csv-lookup/tdp-finder/failure-missing-input-param.yml +2 -2
- package/manifests/{plugins → examples/builtins}/csv-lookup/tdp-finder/failure-unsupported-physical-processor.yml +2 -2
- package/manifests/{plugins → examples/builtins}/csv-lookup/tdp-finder/success.yml +2 -2
- package/manifests/{plugins → examples/builtins}/divide/failure-denominator-equal-zero.yml +4 -4
- package/manifests/{plugins → examples/builtins}/divide/failure-invalid-config-denominator.yml +5 -5
- package/manifests/{plugins → examples/builtins}/divide/failure-missing-numerator.yml +4 -4
- package/manifests/{plugins → examples/builtins}/divide/success.yml +4 -6
- package/manifests/{plugins → examples/builtins}/exponent/success.yml +5 -8
- package/manifests/{plugins → examples/builtins}/interpolation/interpolation.yml +2 -2
- package/manifests/{plugins → examples/builtins}/interpolation/success.yml +2 -2
- package/manifests/{plugins → examples/builtins}/mock-observations/failure-invalid-config-cpu-range.yml +2 -2
- package/manifests/{plugins → examples/builtins}/mock-observations/failure-invalid-memory-utilization-range.yml +2 -2
- package/manifests/{plugins → examples/builtins}/mock-observations/failure-missing-timestamp-from-param.yml +2 -2
- package/manifests/{plugins → examples/builtins}/mock-observations/success.yml +2 -2
- package/manifests/{plugins → examples/builtins}/multiply/failure-input-parameter-is-missing.yml +2 -4
- package/manifests/{plugins → examples/builtins}/multiply/success-with-multiple-inputs.yml +2 -4
- package/manifests/{plugins → examples/builtins}/multiply/success.yml +3 -4
- package/manifests/{plugins → examples/builtins}/regex/failure-missing-input-param.yml +2 -4
- package/manifests/{plugins → examples/builtins}/regex/failure-not-matching-with-regex.yml +2 -4
- package/manifests/{plugins → examples/builtins}/regex/success.yml +2 -4
- package/manifests/{plugins → examples/builtins}/sci/failure-invalid-config-value.yml +2 -2
- package/manifests/{plugins → examples/builtins}/sci/failure-missing-input-param.yml +3 -2
- package/manifests/{plugins → examples/builtins}/sci/success.yml +2 -3
- package/manifests/{plugins → examples/builtins}/sci-embodied/failure-invalid-default-emission-value.yml +3 -3
- package/manifests/{plugins → examples/builtins}/sci-embodied/failure-missing-expected-lifespan.yml +2 -2
- package/manifests/{plugins → examples/builtins}/sci-embodied/success.yml +2 -2
- package/manifests/{plugins → examples/builtins}/shell/failure-invalid-command.yml +2 -2
- package/manifests/{plugins → examples/builtins}/shell/success.yml +2 -1
- package/manifests/{plugins → examples/builtins}/subtract/success.yml +6 -9
- package/manifests/{plugins → examples/builtins}/sum/failure-missing-input-param.yml +2 -4
- package/manifests/{plugins → examples/builtins}/sum/failure-missing-output-param.yml +3 -5
- package/manifests/{plugins → examples/builtins}/sum/success.yml +2 -4
- package/manifests/{plugins → examples/builtins}/time-sync/failure-config-start-later-end.yml +3 -3
- package/manifests/{plugins → examples/builtins}/time-sync/failure-missing-global-config.yml +3 -3
- package/manifests/{plugins → examples/builtins}/time-sync/success.yml +2 -2
- package/manifests/{plugins/groupby/failure-invalid-config-group.yml → examples/features/regroup/failure-invalid-regroup.yml} +4 -11
- package/manifests/{plugins/groupby → examples/features/regroup}/failure-missing-cloud-instance-type.yml +5 -12
- package/manifests/{plugins/groupby → examples/features/regroup}/success.yml +4 -11
- package/manifests/examples/{generics.yml → pipelines/generics.yml} +12 -12
- package/manifests/examples/{instance-metadata.yml → pipelines/instance-metadata.yml} +6 -7
- package/manifests/examples/{nesting.yml → pipelines/nesting.yml} +157 -50
- package/manifests/examples/pipelines/outputs-if-diff/pipeline-with-aggregate.yaml +997 -0
- package/manifests/examples/pipelines/outputs-if-diff/pipeline-with-mocks.yaml +1059 -0
- package/manifests/examples/{pipeline-teads-sci.yml → pipelines/pipeline-teads-sci.yml} +11 -11
- package/manifests/examples/{pipeline-with-aggregate.yml → pipelines/pipeline-with-aggregate.yml} +113 -36
- package/manifests/examples/pipelines/pipeline-with-mocks.yml +297 -0
- package/manifests/{bugs/mock-observations-failure-duration-is-zero.yml → examples/pipelines/scenario-1.yml} +7 -7
- package/manifests/examples/pipelines/scenario-2.yml +52 -0
- package/manifests/examples/pipelines/scenario-3.yml +86 -0
- package/manifests/examples/pipelines/scenario-4.yml +46 -0
- package/manifests/examples/pipelines/scenario-5.yml +46 -0
- package/manifests/examples/{sci.yml → pipelines/sci.yml} +15 -17
- package/manifests/examples/{teads-curve.yml → pipelines/teads-curve.yml} +7 -6
- package/manifests/examples/{zeros.yaml → pipelines/zeros.yml} +15 -16
- package/manifests/outputs/bugs/aggregation-error-wrong-metric.yaml +235 -0
- package/manifests/outputs/bugs/input-error-missing-duration.yaml +82 -0
- package/manifests/outputs/bugs/mock-observations-failure-duration-is-zero.yaml +79 -0
- package/manifests/outputs/bugs/pipeline-error-naming-mismatch.yaml +89 -0
- package/manifests/outputs/bugs/pipeline-error-uninitialized-plugin.yaml +90 -0
- package/manifests/outputs/bugs/pipeline-ordering-error.yaml +152 -0
- package/manifests/outputs/bugs/sci-embodied-missing-resources-total.yaml +72 -0
- package/manifests/outputs/builtins/coefficient/failure-invalid-config-input-param.yaml +69 -0
- package/manifests/outputs/builtins/coefficient/failure-output-param-is-null.yaml +69 -0
- package/manifests/outputs/builtins/coefficient/success.yaml +70 -0
- package/manifests/outputs/builtins/csv-lookup/cloud-metadata/failure-invalid-instance-type.yaml +76 -0
- package/manifests/outputs/builtins/csv-lookup/cloud-metadata/failure-missing-cloud-vendor.yaml +74 -0
- package/manifests/outputs/builtins/csv-lookup/cloud-metadata/success.yaml +79 -0
- package/manifests/outputs/builtins/csv-lookup/region-metadata/failure-missing-column.yaml +75 -0
- package/manifests/outputs/builtins/csv-lookup/region-metadata/failure-missing-output.yaml +73 -0
- package/manifests/outputs/builtins/csv-lookup/region-metadata/success-renaming.yaml +78 -0
- package/manifests/outputs/builtins/csv-lookup/region-metadata/success.yaml +90 -0
- package/manifests/outputs/builtins/csv-lookup/tdp-finder/failure-missing-input-param.yaml +71 -0
- package/manifests/outputs/builtins/csv-lookup/tdp-finder/failure-unsupported-physical-processor.yaml +73 -0
- package/manifests/outputs/builtins/csv-lookup/tdp-finder/success.yaml +74 -0
- package/manifests/outputs/builtins/divide/failure-invalid-config-denominator.yaml +69 -0
- package/manifests/outputs/builtins/divide/failure-missing-numerator.yaml +75 -0
- package/manifests/outputs/builtins/divide/success-denominator-equal-zero.yaml +91 -0
- package/manifests/outputs/builtins/divide/success.yaml +91 -0
- package/manifests/outputs/builtins/exponent/success.yaml +73 -0
- package/manifests/outputs/builtins/interpolation/interpolation.yaml +81 -0
- package/manifests/outputs/builtins/interpolation/success.yaml +81 -0
- package/manifests/outputs/builtins/mock-observations/failure-invalid-config-cpu-range.yaml +84 -0
- package/manifests/outputs/builtins/mock-observations/failure-invalid-memory-utilization-range.yaml +82 -0
- package/manifests/outputs/builtins/mock-observations/failure-missing-timestamp-from-param.yaml +81 -0
- package/manifests/outputs/builtins/mock-observations/success.yaml +358 -0
- package/manifests/outputs/builtins/multiply/failure-input-parameter-is-missing.yaml +71 -0
- package/manifests/outputs/builtins/multiply/success-with-multiple-inputs.yaml +92 -0
- package/manifests/outputs/builtins/multiply/success.yaml +74 -0
- package/manifests/outputs/builtins/regex/failure-missing-input-param.yaml +71 -0
- package/manifests/outputs/builtins/regex/success.yaml +76 -0
- package/manifests/outputs/builtins/sci/failure-invalid-config-value.yaml +70 -0
- package/manifests/outputs/builtins/sci/failure-missing-input-param.yaml +70 -0
- package/manifests/outputs/builtins/sci/success.yaml +77 -0
- package/manifests/outputs/builtins/sci-embodied/failure-invalid-default-emission-value.yaml +73 -0
- package/manifests/outputs/builtins/sci-embodied/failure-missing-expected-lifespan.yaml +69 -0
- package/manifests/outputs/builtins/sci-embodied/success.yaml +76 -0
- package/manifests/outputs/builtins/shell/failure-invalid-command.yaml +68 -0
- package/manifests/outputs/builtins/shell/success.yaml +66 -0
- package/manifests/outputs/builtins/subtract/success.yaml +74 -0
- package/manifests/outputs/builtins/sum/failure-missing-input-param.yaml +71 -0
- package/manifests/outputs/builtins/sum/failure-missing-output-param.yaml +74 -0
- package/manifests/outputs/builtins/sum/success.yaml +74 -0
- package/manifests/outputs/builtins/time-sync/failure-config-start-later-end.yaml +79 -0
- package/manifests/outputs/builtins/time-sync/success.yaml +122 -0
- package/manifests/outputs/features/aggregate-failure-invalid-metrics.yaml +100 -0
- package/manifests/outputs/features/aggregate-failure-missing-metric-in-inputs.yaml +99 -0
- package/manifests/outputs/features/aggregate-horizontal.yaml +132 -0
- package/manifests/outputs/features/aggregate-vertical.yaml +155 -0
- package/manifests/outputs/features/aggregate.yaml +159 -0
- package/manifests/outputs/features/failure-invalid-regroup.yaml +87 -0
- package/manifests/outputs/features/failure-missing-cloud-instance-type.yaml +86 -0
- package/manifests/outputs/pipelines/cloud-metadata-divide.yaml +91 -0
- package/manifests/outputs/pipelines/generics.yaml +239 -0
- package/manifests/outputs/pipelines/instance-metadata.yaml +98 -0
- package/manifests/outputs/pipelines/mock-obs-time-sync.yaml +449 -0
- package/manifests/outputs/pipelines/nesting.yaml +1799 -0
- package/manifests/outputs/pipelines/pipeline-teads-sci.yaml +276 -0
- package/manifests/outputs/pipelines/sci.yaml +297 -0
- package/manifests/outputs/pipelines/teads-curve.yaml +188 -0
- package/manifests/outputs/pipelines/zeros.yaml +198 -0
- package/package.json +15 -16
- package/src/__mocks__/mock-manifest.yaml +2 -3
- package/src/{config → if-env/config}/env-template.yml +2 -3
- package/src/{builtins → if-run/builtins}/coefficient/README.md +31 -9
- package/src/{builtins → if-run/builtins}/copy-param/README.md +30 -11
- package/src/{builtins → if-run/builtins}/csv-lookup/README.md +32 -20
- package/src/{builtins → if-run/builtins}/divide/README.md +21 -8
- package/src/{builtins → if-run/builtins}/exponent/README.md +19 -8
- package/src/{builtins → if-run/builtins}/interpolation/README.md +21 -6
- package/src/{builtins → if-run/builtins}/mock-observations/README.md +18 -4
- package/src/{builtins → if-run/builtins}/multiply/README.md +20 -8
- package/src/{builtins → if-run/builtins}/regex/README.md +19 -9
- package/src/{builtins → if-run/builtins}/sci/README.md +19 -9
- package/src/{builtins → if-run/builtins}/sci-embodied/README.md +17 -5
- package/src/{builtins → if-run/builtins}/shell/README.md +19 -7
- package/src/{builtins → if-run/builtins}/subtract/README.md +17 -6
- package/src/{builtins → if-run/builtins}/sum/README.md +34 -8
- package/src/if-run/builtins/time-sync/README.md +267 -0
- package/build/builtins/coefficient/index.d.ts +0 -2
- package/build/builtins/coefficient/index.js +0 -65
- package/build/builtins/copy-param/index.d.ts +0 -2
- package/build/builtins/copy-param/index.js +0 -68
- package/build/builtins/csv-lookup/index.d.ts +0 -2
- package/build/builtins/csv-lookup/index.js +0 -188
- package/build/builtins/divide/index.d.ts +0 -2
- package/build/builtins/divide/index.js +0 -78
- package/build/builtins/exponent/index.d.ts +0 -2
- package/build/builtins/exponent/index.js +0 -58
- package/build/builtins/export-csv-raw.d.ts +0 -4
- package/build/builtins/export-csv-raw.js +0 -132
- package/build/builtins/export-csv.d.ts +0 -10
- package/build/builtins/export-csv.js +0 -96
- package/build/builtins/export-yaml.js +0 -30
- package/build/builtins/group-by.d.ts +0 -5
- package/build/builtins/group-by.js +0 -71
- package/build/builtins/interpolation/index.d.ts +0 -2
- package/build/builtins/interpolation/index.js +0 -148
- package/build/builtins/mock-observations/helpers/common-generator.js +0 -29
- package/build/builtins/mock-observations/helpers/rand-int-generator.js +0 -48
- package/build/builtins/mock-observations/index.d.ts +0 -2
- package/build/builtins/mock-observations/index.js +0 -114
- package/build/builtins/mock-observations/interfaces/index.js +0 -3
- package/build/builtins/multiply/index.d.ts +0 -2
- package/build/builtins/multiply/index.js +0 -57
- package/build/builtins/regex/index.d.ts +0 -2
- package/build/builtins/regex/index.js +0 -74
- package/build/builtins/sci/config.js +0 -44
- package/build/builtins/sci/index.d.ts +0 -2
- package/build/builtins/sci/index.js +0 -70
- package/build/builtins/sci-embodied/index.d.ts +0 -2
- package/build/builtins/sci-embodied/index.js +0 -114
- package/build/builtins/shell/index.d.ts +0 -2
- package/build/builtins/shell/index.js +0 -58
- package/build/builtins/subtract/index.d.ts +0 -2
- package/build/builtins/subtract/index.js +0 -59
- package/build/builtins/sum/index.d.ts +0 -2
- package/build/builtins/sum/index.js +0 -64
- package/build/builtins/time-sync.d.ts +0 -2
- package/build/builtins/time-sync.js +0 -300
- package/build/check.js +0 -85
- package/build/config/config.d.ts +0 -29
- package/build/config/config.js +0 -147
- package/build/config/index.js +0 -10
- package/build/config/params.d.ts +0 -2
- package/build/config/params.js +0 -196
- package/build/config/strings.js +0 -101
- package/build/diff.js +0 -46
- package/build/env.js +0 -38
- package/build/index.js +0 -48
- package/build/lib/aggregate.d.ts +0 -6
- package/build/lib/aggregate.js +0 -77
- package/build/lib/compare.js +0 -56
- package/build/lib/compute.js +0 -91
- package/build/lib/environment.js +0 -75
- package/build/lib/exhaust.js +0 -53
- package/build/lib/initialize.d.ts +0 -6
- package/build/lib/initialize.js +0 -101
- package/build/lib/load.js +0 -70
- package/build/lib/parameterize.d.ts +0 -6
- package/build/lib/parameterize.js +0 -55
- package/build/types/aggregation.d.ts +0 -2
- package/build/types/aggregation.js +0 -5
- package/build/types/compute.js +0 -3
- package/build/types/environment.js +0 -3
- package/build/types/exhaust-plugin-interface.js +0 -3
- package/build/types/if-env.js +0 -3
- package/build/types/interface.d.ts +0 -4
- package/build/types/interface.js +0 -8
- package/build/types/lib/compare.js +0 -3
- package/build/types/manifest.js +0 -3
- package/build/types/npm.js +0 -3
- package/build/types/parameters.d.ts +0 -5
- package/build/types/parameters.js +0 -5
- package/build/types/plugin-storage.js +0 -3
- package/build/types/process-args.d.ts +0 -33
- package/build/types/process-args.js +0 -3
- package/build/types/time-sync.js +0 -3
- package/build/types/util/args.js +0 -3
- package/build/util/aggregation-helper.js +0 -55
- package/build/util/args.d.ts +0 -37
- package/build/util/args.js +0 -205
- package/build/util/debug-logger.js +0 -117
- package/build/util/fs.js +0 -94
- package/build/util/helpers.d.ts +0 -57
- package/build/util/helpers.js +0 -250
- package/build/util/json.d.ts +0 -4
- package/build/util/json.js +0 -36
- package/build/util/log-memoize.js +0 -19
- package/build/util/npm.js +0 -152
- package/build/util/os-checker.js +0 -97
- package/build/util/plugin-storage.js +0 -34
- package/build/util/validations.js +0 -124
- package/build/util/yaml.js +0 -59
- package/manifests/bugs/aggregation-error-wrong-metric.yml +0 -178
- package/manifests/bugs/azure-importer-ignoring-defaults.yml +0 -64
- package/manifests/bugs/azure-importer-incorrect-calculation.yml +0 -59
- package/manifests/bugs/initialize-error-no-config.yml +0 -26
- package/manifests/bugs/initialize-error-no-path.yml +0 -32
- package/manifests/bugs/initialize-error-no-plugins.yml +0 -23
- package/manifests/bugs/input-error-missing-duration.yml +0 -25
- package/manifests/bugs/pipeline-error-naming-mismatch.yml +0 -32
- package/manifests/bugs/pipeline-error-uninitialized-plugin.yml +0 -33
- package/manifests/bugs/pipeline-ordering-error.yml +0 -91
- package/manifests/bugs/sci-embodied-missing-resources-total.yml +0 -23
- package/manifests/examples/copy.yaml +0 -20
- package/manifests/examples/mock-cpu-util-to-carbon.yml +0 -76
- package/manifests/examples/pipeline-with-mocks.yml +0 -207
- package/manifests/examples/region-metadata.yml +0 -26
- package/manifests/examples/tdp-finder.yml +0 -23
- package/manifests/features/aggregate-failure-invalid-metrics.yml +0 -49
- package/manifests/features/aggregate-failure-missing-metric-in-inputs.yml +0 -49
- package/manifests/features/aggregate-horizontal.yml +0 -50
- package/manifests/features/aggregate-vertical.yml +0 -50
- package/manifests/features/aggregate.yml +0 -50
- package/manifests/integrations/cloud-metadata-divide.yml +0 -37
- package/manifests/integrations/instance-metadata/failure-invalid-instance-type.yaml +0 -33
- package/manifests/integrations/instance-metadata/failure-invalid-provider.yaml +0 -33
- package/manifests/integrations/instance-metadata/failure-missing-queried-input.yml +0 -33
- package/manifests/integrations/instance-metadata/success.yml +0 -33
- package/manifests/integrations/mock-obs-group-by-cloud-meta.yml +0 -57
- package/manifests/integrations/mock-obs-groupby.yml +0 -39
- package/manifests/integrations/mock-obs-time-sync.yml +0 -110
- package/src/__tests__/integration/templates/integration.yaml +0 -16
- package/src/builtins/README.md +0 -848
- /package/build/{util → common/util}/debug-logger.d.ts +0 -0
- /package/build/{util → common/util}/fs.d.ts +0 -0
- /package/build/{util → common/util}/logger.d.ts +0 -0
- /package/build/{util → common/util}/yaml.d.ts +0 -0
- /package/build/{index.d.ts → if-check/index.d.ts} +0 -0
- /package/build/{check.d.ts → if-csv/index.d.ts} +0 -0
- /package/build/{diff.d.ts → if-diff/index.d.ts} +0 -0
- /package/build/{types/util → if-diff/types}/args.d.ts +0 -0
- /package/build/{types/lib → if-diff/types}/compare.d.ts +0 -0
- /package/build/{env.d.ts → if-env/index.d.ts} +0 -0
- /package/build/{types → if-env/types}/if-env.d.ts +0 -0
- /package/build/{types → if-env/types}/npm.d.ts +0 -0
- /package/build/{builtins → if-run/builtins}/mock-observations/helpers/common-generator.d.ts +0 -0
- /package/build/{builtins → if-run/builtins}/mock-observations/helpers/rand-int-generator.d.ts +0 -0
- /package/build/{builtins → if-run/builtins}/mock-observations/interfaces/index.d.ts +0 -0
- /package/build/{builtins → if-run/builtins}/sci/config.d.ts +0 -0
- /package/build/{lib → if-run/lib}/compute.d.ts +0 -0
- /package/build/{types → if-run/types}/environment.d.ts +0 -0
- /package/build/{types → if-run/types}/plugin-storage.d.ts +0 -0
- /package/build/{types → if-run/types}/time-sync.d.ts +0 -0
- /package/build/{util → if-run/util}/log-memoize.d.ts +0 -0
- /package/build/{util → if-run/util}/os-checker.d.ts +0 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.debugLogger = void 0;
|
|
4
|
+
const config_1 = require("../../if-run/config");
|
|
5
|
+
const logMessagesKeys = [
|
|
6
|
+
'STARTING_IF',
|
|
7
|
+
'EXITING_IF',
|
|
8
|
+
'LOADING_MANIFEST',
|
|
9
|
+
'VALIDATING_MANIFEST',
|
|
10
|
+
'CAPTURING_RUNTIME_ENVIRONMENT_DATA',
|
|
11
|
+
'CHECKING_AGGREGATION_METHOD',
|
|
12
|
+
'INITIALIZING_PLUGINS',
|
|
13
|
+
'INITIALIZING_PLUGIN',
|
|
14
|
+
'LOADING_PLUGIN_FROM_PATH',
|
|
15
|
+
'COMPUTING_PIPELINE_FOR_NODE',
|
|
16
|
+
'MERGING_DEFAULTS_WITH_INPUT_DATA',
|
|
17
|
+
'AGGREGATING_OUTPUTS',
|
|
18
|
+
'AGGREGATING_NODE',
|
|
19
|
+
'PREPARING_OUTPUT_DATA',
|
|
20
|
+
'EXPORTING_TO_YAML_FILE',
|
|
21
|
+
];
|
|
22
|
+
var LogLevel;
|
|
23
|
+
(function (LogLevel) {
|
|
24
|
+
LogLevel["Info"] = "INFO";
|
|
25
|
+
LogLevel["Warn"] = "WARN";
|
|
26
|
+
LogLevel["Error"] = "ERROR";
|
|
27
|
+
LogLevel["Debug"] = "DEBUG";
|
|
28
|
+
})(LogLevel || (LogLevel = {}));
|
|
29
|
+
const originalConsole = {
|
|
30
|
+
log: console.log,
|
|
31
|
+
info: console.info,
|
|
32
|
+
warn: console.warn,
|
|
33
|
+
error: console.error,
|
|
34
|
+
debug: console.debug,
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Overrides console methods with custom debug logging.
|
|
38
|
+
*/
|
|
39
|
+
const overrideConsoleMethods = (debugMode) => {
|
|
40
|
+
console.log = (...args) => debugLog(LogLevel.Info, args, debugMode);
|
|
41
|
+
console.info = (...args) => debugLog(LogLevel.Info, args, debugMode);
|
|
42
|
+
console.warn = (...args) => debugLog(LogLevel.Warn, args, debugMode);
|
|
43
|
+
console.error = (...args) => debugLog(LogLevel.Error, args, debugMode);
|
|
44
|
+
console.debug = (...args) => debugLog(LogLevel.Debug, args, debugMode);
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Creates an encapsulated object to retrieve the plugin name.
|
|
48
|
+
*/
|
|
49
|
+
const pluginNameManager = (() => {
|
|
50
|
+
let pluginName = '';
|
|
51
|
+
const manager = {
|
|
52
|
+
get currentPluginName() {
|
|
53
|
+
return pluginName;
|
|
54
|
+
},
|
|
55
|
+
set currentPluginName(value) {
|
|
56
|
+
pluginName = value;
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
return manager;
|
|
60
|
+
})();
|
|
61
|
+
/**
|
|
62
|
+
* Sets the name of the currently executing plugin.
|
|
63
|
+
*/
|
|
64
|
+
const setExecutingPluginName = (pluginName) => {
|
|
65
|
+
pluginNameManager.currentPluginName = pluginName;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Logs messages with the specified log level and format.
|
|
69
|
+
*/
|
|
70
|
+
const debugLog = (level, args, debugMode) => {
|
|
71
|
+
if (!debugMode) {
|
|
72
|
+
if (level === LogLevel.Debug) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const isDebugLog = typeof args[0] === 'string' &&
|
|
76
|
+
logMessagesKeys.some(key => {
|
|
77
|
+
const message = typeof config_1.STRINGS[key] === 'function'
|
|
78
|
+
? config_1.STRINGS[key].call(null, '')
|
|
79
|
+
: config_1.STRINGS[key];
|
|
80
|
+
return args[0].includes(message);
|
|
81
|
+
});
|
|
82
|
+
if (!isDebugLog) {
|
|
83
|
+
originalConsole.log(...args);
|
|
84
|
+
}
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (args[0].includes('# start')) {
|
|
88
|
+
originalConsole.log(...args);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const date = new Date().toISOString();
|
|
92
|
+
const plugin = pluginNameManager.currentPluginName;
|
|
93
|
+
const formattedMessage = `${level}: ${date}: ${plugin ? plugin + ': ' : ''}${args.join(', ')}`;
|
|
94
|
+
if (debugMode) {
|
|
95
|
+
switch (level) {
|
|
96
|
+
case LogLevel.Info:
|
|
97
|
+
originalConsole.info(formattedMessage);
|
|
98
|
+
break;
|
|
99
|
+
case LogLevel.Warn:
|
|
100
|
+
originalConsole.warn(formattedMessage);
|
|
101
|
+
break;
|
|
102
|
+
case LogLevel.Error:
|
|
103
|
+
originalConsole.error(formattedMessage);
|
|
104
|
+
break;
|
|
105
|
+
case LogLevel.Debug:
|
|
106
|
+
originalConsole.debug(formattedMessage);
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
exports.debugLogger = {
|
|
112
|
+
overrideConsoleMethods,
|
|
113
|
+
setExecutingPluginName,
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVidWctbG9nZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvbW1vbi91dGlsL2RlYnVnLWxvZ2dl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94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.removeFileIfExists = exports.getFileName = exports.getYamlFiles = exports.isDirectoryExists = exports.isFileExists = void 0;
|
|
27
|
+
const fs = __importStar(require("fs/promises"));
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
/**
|
|
30
|
+
* Checks if file exists with the given `filePath`.
|
|
31
|
+
*/
|
|
32
|
+
const isFileExists = async (filePath) => {
|
|
33
|
+
try {
|
|
34
|
+
await fs.stat(filePath);
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
exports.isFileExists = isFileExists;
|
|
42
|
+
/**
|
|
43
|
+
* Checks if the directory exists with the given `filePath`.
|
|
44
|
+
*/
|
|
45
|
+
const isDirectoryExists = async (directoryPath) => {
|
|
46
|
+
try {
|
|
47
|
+
await fs.access(directoryPath);
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
exports.isDirectoryExists = isDirectoryExists;
|
|
55
|
+
/**
|
|
56
|
+
* Gets all files that have either .yml or .yaml extension in the given directory.
|
|
57
|
+
*/
|
|
58
|
+
const getYamlFiles = async (directory) => {
|
|
59
|
+
let yamlFiles = [];
|
|
60
|
+
const files = await fs.readdir(directory);
|
|
61
|
+
for (const file of files) {
|
|
62
|
+
const fullPath = path.join(directory, file);
|
|
63
|
+
const stat = await fs.lstat(fullPath);
|
|
64
|
+
if (stat.isDirectory()) {
|
|
65
|
+
yamlFiles = yamlFiles.concat(await (0, exports.getYamlFiles)(fullPath));
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
if (file.endsWith('.yml') || file.endsWith('.yaml')) {
|
|
69
|
+
yamlFiles.push(fullPath);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return yamlFiles;
|
|
74
|
+
};
|
|
75
|
+
exports.getYamlFiles = getYamlFiles;
|
|
76
|
+
/**
|
|
77
|
+
* Gets fileName from the given path without an extension.
|
|
78
|
+
*/
|
|
79
|
+
const getFileName = (filePath) => {
|
|
80
|
+
const baseName = path.basename(filePath);
|
|
81
|
+
const extension = path.extname(filePath);
|
|
82
|
+
return baseName.replace(extension, '');
|
|
83
|
+
};
|
|
84
|
+
exports.getFileName = getFileName;
|
|
85
|
+
/**
|
|
86
|
+
* Removes the given file if exists.
|
|
87
|
+
*/
|
|
88
|
+
const removeFileIfExists = async (filePath) => {
|
|
89
|
+
if (await (0, ex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UoZmlsZVBhdGgpO1xuICBjb25zdCBleHRlbnNpb24gPSBwYXRoLmV4dG5hbWUoZmlsZVBhdGgpO1xuICByZXR1cm4gYmFzZU5hbWUucmVwbGFjZShleHRlbnNpb24sICcnKTtcbn07XG5cbi8qKlxuICogUmVtb3ZlcyB0aGUgZ2l2ZW4gZmlsZSBpZiBleGlzdHMuXG4gKi9cbmV4cG9ydCBjb25zdCByZW1vdmVGaWxlSWZFeGlzdHMgPSBhc3luYyAoZmlsZVBhdGg6IHN0cmluZykgPT4ge1xuICBpZiAoYXdhaXQgaXNGaWxlRXhpc3RzKGZpbGVQYXRoKSkge1xuICAgIGF3YWl0IGZzLnVubGluayhmaWxlUGF0aCk7XG4gIH1cbn07XG4iXX0=
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { exec } from 'child_process';
|
|
3
|
+
/**
|
|
4
|
+
* Promise version of Node's `exec` from `child-process`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const execPromise: typeof exec.__promisify__;
|
|
7
|
+
/**
|
|
8
|
+
* Prepends process path to given `filePath`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const prependFullFilePath: (filePath: string) => string;
|
|
11
|
+
/**
|
|
12
|
+
* Checks if there is piped data, tries to parse yaml from it.
|
|
13
|
+
* Returns empty string if haven't found anything.
|
|
14
|
+
*/
|
|
15
|
+
export declare const parseManifestFromStdin: () => Promise<string>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.parseManifestFromStdin = exports.prependFullFilePath = exports.execPromise = void 0;
|
|
27
|
+
const promises_1 = require("node:readline/promises");
|
|
28
|
+
const child_process_1 = require("child_process");
|
|
29
|
+
const path = __importStar(require("path"));
|
|
30
|
+
const util_1 = require("util");
|
|
31
|
+
/**
|
|
32
|
+
* Promise version of Node's `exec` from `child-process`.
|
|
33
|
+
*/
|
|
34
|
+
exports.execPromise = (0, util_1.promisify)(child_process_1.exec);
|
|
35
|
+
/**
|
|
36
|
+
* Prepends process path to given `filePath`.
|
|
37
|
+
*/
|
|
38
|
+
const prependFullFilePath = (filePath) => {
|
|
39
|
+
const processRunningPath = process.cwd();
|
|
40
|
+
if (path.isAbsolute(filePath)) {
|
|
41
|
+
return filePath;
|
|
42
|
+
}
|
|
43
|
+
return path.normalize(`${processRunningPath}/${filePath}`);
|
|
44
|
+
};
|
|
45
|
+
exports.prependFullFilePath = prependFullFilePath;
|
|
46
|
+
/**
|
|
47
|
+
* Checks if there is data piped, then collects it.
|
|
48
|
+
* Otherwise returns empty string.
|
|
49
|
+
*/
|
|
50
|
+
const collectPipedData = async () => {
|
|
51
|
+
if (process.stdin.isTTY) {
|
|
52
|
+
return '';
|
|
53
|
+
}
|
|
54
|
+
const readline = (0, promises_1.createInterface)({
|
|
55
|
+
input: process.stdin,
|
|
56
|
+
});
|
|
57
|
+
const data = [];
|
|
58
|
+
for await (const line of readline) {
|
|
59
|
+
data.push(line);
|
|
60
|
+
}
|
|
61
|
+
return data.join('\n');
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Checks if there is piped data, tries to parse yaml from it.
|
|
65
|
+
* Returns empty string if haven't found anything.
|
|
66
|
+
*/
|
|
67
|
+
const parseManifestFromStdin = async () => {
|
|
68
|
+
const pipedSourceManifest = await collectPipedData();
|
|
69
|
+
if (!pipedSourceManifest) {
|
|
70
|
+
return '';
|
|
71
|
+
}
|
|
72
|
+
const regex = /# start((?:.*\n)+?)# end/;
|
|
73
|
+
const match = regex.exec(pipedSourceManifest);
|
|
74
|
+
if (!match) {
|
|
75
|
+
return '';
|
|
76
|
+
}
|
|
77
|
+
return match[1];
|
|
78
|
+
};
|
|
79
|
+
exports.parseManifestFromStdin = parseManifestFromStdin;
|
|
80
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGVscGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21tb24vdXRpbC9oZWxwZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEscURBQXVEO0FBQ3ZELGlEQUFtQztBQUNuQywyQ0FBNkI7QUFDN0IsK0JBQStCO0FBRS9COztHQUVHO0FBQ1UsUUFBQSxXQUFXLEdBQUcsSUFBQSxnQkFBUyxFQUFDLG9CQUFJLENBQUMsQ0FBQztBQUUzQzs7R0FFRztBQUNJLE1BQU0sbUJBQW1CLEdBQUcsQ0FBQyxRQUFn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Jyc7XG4gIH1cblxuICByZXR1cm4gbWF0Y2ghWzFdO1xufTtcbiJdfQ==
|
|
@@ -36,4 +36,4 @@ exports.logger = winston.createLogger({
|
|
|
36
36
|
${info.stack || ''}`)),
|
|
37
37
|
transports: [new winston.transports.Console()],
|
|
38
38
|
});
|
|
39
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
39
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvbW1vbi91dGlsL2xvZ2dlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLGlEQUFtQztBQUVuQyxNQUFNLEVBQUMsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLEVBQUUsUUFBUSxFQUFFLEtBQUssRUFBQyxHQUFHLE9BQU8sQ0FBQyxNQUFNLENBQUM7QUFFckU7O0dBRUc7QUFDVSxRQUFBLE1BQU0sR0FBRyxPQUFPLENBQUMsWUFBWSxDQUFDO0lBQ3pDLE1BQU0sRUFBRSxPQUFPLENBQ2IsUUFBUSxDQUFDLEVBQUMsR0FBRyxFQUFFLElBQUksRUFBQyxDQUFDLEVBQ3JCLFNBQVMsQ0FBQztRQUNSLE1BQU0sRUFBRSwyQkFBMkI7S0FDcEMsQ0FBQyxFQUNGLEtBQUssRUFBRSxFQUNQLE1BQU0sQ0FDSixDQUFDLElBQVMsRUFBRSxFQUFFLENBQ1osSUFBSSxJQUFJLENBQUMsU0FBUyxLQUFLLElBQUksQ0FBQyxLQUFLLEtBQUssSUFBSSxDQUFDLE9BQU87RUFDeEQsSUFBSSxDQUFDLEtBQUssSUFBSSxFQUFFLEVBQUUsQ0FDZixDQUNGO0lBQ0QsVUFBVSxFQUFFLENBQUMsSUFBSSxPQUFPLENBQUMsVUFBVSxDQUFDLE9BQU8sRUFBRSxDQUFDO0NBQy9DLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCAqIGFzIHdpbnN0b24gZnJvbSAnd2luc3Rvbic7XG5cbmNvbnN0IHtjb21iaW5lLCB0aW1lc3RhbXAsIHByaW50ZiwgY29sb3JpemUsIGFsaWdufSA9IHdpbnN0b24uZm9ybWF0O1xuXG4vKipcbiAqIFdpbnN0b24gbG9nZ2VyIGluc3RhbmNlLlxuICovXG5leHBvcnQgY29uc3QgbG9nZ2VyID0gd2luc3Rvbi5jcmVhdGVMb2dnZXIoe1xuICBmb3JtYXQ6IGNvbWJpbmUoXG4gICAgY29sb3JpemUoe2FsbDogdHJ1ZX0pLFxuICAgIHRpbWVzdGFtcCh7XG4gICAgICBmb3JtYXQ6ICdZWVlZLU1NLUREIGhoOm1tOnNzLlNTUyBBJyxcbiAgICB9KSxcbiAgICBhbGlnbigpLFxuICAgIHByaW50ZihcbiAgICAgIChpbmZvOiBhbnkpID0+XG4gICAgICAgIGBbJHtpbmZvLnRpbWVzdGFtcH1dICR7aW5mby5sZXZlbH06ICR7aW5mby5tZXNzYWdlfVxuJHtpbmZvLnN0YWNrIHx8ICcnfWBcbiAgICApXG4gICksXG4gIHRyYW5zcG9ydHM6IFtuZXcgd2luc3Rvbi50cmFuc3BvcnRzLkNvbnNvbGUoKV0sXG59KTtcbiJdfQ==
|
|
@@ -26,6 +26,8 @@ export declare const manifestSchema: z.ZodObject<{
|
|
|
26
26
|
complexity?: string | null | undefined;
|
|
27
27
|
category?: string | null | undefined;
|
|
28
28
|
}>>>;
|
|
29
|
+
explainer: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
explain: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
29
31
|
aggregation: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
30
32
|
metrics: z.ZodArray<z.ZodString, "many">;
|
|
31
33
|
type: z.ZodEnum<["horizontal", "vertical", "both"]>;
|
|
@@ -36,51 +38,130 @@ export declare const manifestSchema: z.ZodObject<{
|
|
|
36
38
|
type: "horizontal" | "vertical" | "both";
|
|
37
39
|
metrics: string[];
|
|
38
40
|
}>>>;
|
|
39
|
-
params: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
40
|
-
name: z.ZodString;
|
|
41
|
-
description: z.ZodString;
|
|
42
|
-
aggregation: z.ZodEnum<["sum", "none", "avg"]>;
|
|
43
|
-
unit: z.ZodString;
|
|
44
|
-
}, "strip", z.ZodTypeAny, {
|
|
45
|
-
name: string;
|
|
46
|
-
description: string;
|
|
47
|
-
aggregation: "sum" | "none" | "avg";
|
|
48
|
-
unit: string;
|
|
49
|
-
}, {
|
|
50
|
-
name: string;
|
|
51
|
-
description: string;
|
|
52
|
-
aggregation: "sum" | "none" | "avg";
|
|
53
|
-
unit: string;
|
|
54
|
-
}>, "many">>>;
|
|
55
41
|
initialize: z.ZodObject<{
|
|
56
|
-
plugins: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
42
|
+
plugins: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodObject<{
|
|
57
43
|
path: z.ZodString;
|
|
58
44
|
method: z.ZodString;
|
|
59
45
|
'global-config': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
46
|
+
'parameter-metadata': z.ZodOptional<z.ZodObject<{
|
|
47
|
+
inputs: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
48
|
+
unit: z.ZodString;
|
|
49
|
+
description: z.ZodString;
|
|
50
|
+
'aggregation-method': z.ZodString;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
unit: string;
|
|
53
|
+
description: string;
|
|
54
|
+
'aggregation-method': string;
|
|
55
|
+
}, {
|
|
56
|
+
unit: string;
|
|
57
|
+
description: string;
|
|
58
|
+
'aggregation-method': string;
|
|
59
|
+
}>>>>;
|
|
60
|
+
outputs: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
61
|
+
unit: z.ZodString;
|
|
62
|
+
description: z.ZodString;
|
|
63
|
+
'aggregation-method': z.ZodString;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
unit: string;
|
|
66
|
+
description: string;
|
|
67
|
+
'aggregation-method': string;
|
|
68
|
+
}, {
|
|
69
|
+
unit: string;
|
|
70
|
+
description: string;
|
|
71
|
+
'aggregation-method': string;
|
|
72
|
+
}>>>>;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
inputs?: Record<string, {
|
|
75
|
+
unit: string;
|
|
76
|
+
description: string;
|
|
77
|
+
'aggregation-method': string;
|
|
78
|
+
}> | null | undefined;
|
|
79
|
+
outputs?: Record<string, {
|
|
80
|
+
unit: string;
|
|
81
|
+
description: string;
|
|
82
|
+
'aggregation-method': string;
|
|
83
|
+
}> | null | undefined;
|
|
84
|
+
}, {
|
|
85
|
+
inputs?: Record<string, {
|
|
86
|
+
unit: string;
|
|
87
|
+
description: string;
|
|
88
|
+
'aggregation-method': string;
|
|
89
|
+
}> | null | undefined;
|
|
90
|
+
outputs?: Record<string, {
|
|
91
|
+
unit: string;
|
|
92
|
+
description: string;
|
|
93
|
+
'aggregation-method': string;
|
|
94
|
+
}> | null | undefined;
|
|
95
|
+
}>>;
|
|
60
96
|
}, "strip", z.ZodTypeAny, {
|
|
61
97
|
path: string;
|
|
62
98
|
method: string;
|
|
63
99
|
'global-config'?: Record<string, any> | undefined;
|
|
100
|
+
'parameter-metadata'?: {
|
|
101
|
+
inputs?: Record<string, {
|
|
102
|
+
unit: string;
|
|
103
|
+
description: string;
|
|
104
|
+
'aggregation-method': string;
|
|
105
|
+
}> | null | undefined;
|
|
106
|
+
outputs?: Record<string, {
|
|
107
|
+
unit: string;
|
|
108
|
+
description: string;
|
|
109
|
+
'aggregation-method': string;
|
|
110
|
+
}> | null | undefined;
|
|
111
|
+
} | undefined;
|
|
64
112
|
}, {
|
|
65
113
|
path: string;
|
|
66
114
|
method: string;
|
|
67
115
|
'global-config'?: Record<string, any> | undefined;
|
|
68
|
-
|
|
69
|
-
|
|
116
|
+
'parameter-metadata'?: {
|
|
117
|
+
inputs?: Record<string, {
|
|
118
|
+
unit: string;
|
|
119
|
+
description: string;
|
|
120
|
+
'aggregation-method': string;
|
|
121
|
+
}> | null | undefined;
|
|
122
|
+
outputs?: Record<string, {
|
|
123
|
+
unit: string;
|
|
124
|
+
description: string;
|
|
125
|
+
'aggregation-method': string;
|
|
126
|
+
}> | null | undefined;
|
|
127
|
+
} | undefined;
|
|
128
|
+
}>>>;
|
|
70
129
|
}, "strip", z.ZodTypeAny, {
|
|
71
130
|
plugins: Record<string, {
|
|
72
131
|
path: string;
|
|
73
132
|
method: string;
|
|
74
133
|
'global-config'?: Record<string, any> | undefined;
|
|
75
|
-
|
|
76
|
-
|
|
134
|
+
'parameter-metadata'?: {
|
|
135
|
+
inputs?: Record<string, {
|
|
136
|
+
unit: string;
|
|
137
|
+
description: string;
|
|
138
|
+
'aggregation-method': string;
|
|
139
|
+
}> | null | undefined;
|
|
140
|
+
outputs?: Record<string, {
|
|
141
|
+
unit: string;
|
|
142
|
+
description: string;
|
|
143
|
+
'aggregation-method': string;
|
|
144
|
+
}> | null | undefined;
|
|
145
|
+
} | undefined;
|
|
146
|
+
} | undefined>;
|
|
77
147
|
}, {
|
|
78
148
|
plugins: Record<string, {
|
|
79
149
|
path: string;
|
|
80
150
|
method: string;
|
|
81
151
|
'global-config'?: Record<string, any> | undefined;
|
|
82
|
-
|
|
83
|
-
|
|
152
|
+
'parameter-metadata'?: {
|
|
153
|
+
inputs?: Record<string, {
|
|
154
|
+
unit: string;
|
|
155
|
+
description: string;
|
|
156
|
+
'aggregation-method': string;
|
|
157
|
+
}> | null | undefined;
|
|
158
|
+
outputs?: Record<string, {
|
|
159
|
+
unit: string;
|
|
160
|
+
description: string;
|
|
161
|
+
'aggregation-method': string;
|
|
162
|
+
}> | null | undefined;
|
|
163
|
+
} | undefined;
|
|
164
|
+
} | undefined>;
|
|
84
165
|
}>;
|
|
85
166
|
execution: z.ZodOptional<z.ZodObject<{
|
|
86
167
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -141,8 +222,19 @@ export declare const manifestSchema: z.ZodObject<{
|
|
|
141
222
|
path: string;
|
|
142
223
|
method: string;
|
|
143
224
|
'global-config'?: Record<string, any> | undefined;
|
|
144
|
-
|
|
145
|
-
|
|
225
|
+
'parameter-metadata'?: {
|
|
226
|
+
inputs?: Record<string, {
|
|
227
|
+
unit: string;
|
|
228
|
+
description: string;
|
|
229
|
+
'aggregation-method': string;
|
|
230
|
+
}> | null | undefined;
|
|
231
|
+
outputs?: Record<string, {
|
|
232
|
+
unit: string;
|
|
233
|
+
description: string;
|
|
234
|
+
'aggregation-method': string;
|
|
235
|
+
}> | null | undefined;
|
|
236
|
+
} | undefined;
|
|
237
|
+
} | undefined>;
|
|
146
238
|
};
|
|
147
239
|
tree: Record<string, any>;
|
|
148
240
|
description?: string | null | undefined;
|
|
@@ -151,16 +243,12 @@ export declare const manifestSchema: z.ZodObject<{
|
|
|
151
243
|
complexity?: string | null | undefined;
|
|
152
244
|
category?: string | null | undefined;
|
|
153
245
|
} | null | undefined;
|
|
246
|
+
explainer?: boolean | undefined;
|
|
247
|
+
explain?: Record<string, any> | undefined;
|
|
154
248
|
aggregation?: {
|
|
155
249
|
type: "horizontal" | "vertical" | "both";
|
|
156
250
|
metrics: string[];
|
|
157
251
|
} | null | undefined;
|
|
158
|
-
params?: {
|
|
159
|
-
name: string;
|
|
160
|
-
description: string;
|
|
161
|
-
aggregation: "sum" | "none" | "avg";
|
|
162
|
-
unit: string;
|
|
163
|
-
}[] | null | undefined;
|
|
164
252
|
execution?: {
|
|
165
253
|
status: string;
|
|
166
254
|
command?: string | undefined;
|
|
@@ -181,8 +269,19 @@ export declare const manifestSchema: z.ZodObject<{
|
|
|
181
269
|
path: string;
|
|
182
270
|
method: string;
|
|
183
271
|
'global-config'?: Record<string, any> | undefined;
|
|
184
|
-
|
|
185
|
-
|
|
272
|
+
'parameter-metadata'?: {
|
|
273
|
+
inputs?: Record<string, {
|
|
274
|
+
unit: string;
|
|
275
|
+
description: string;
|
|
276
|
+
'aggregation-method': string;
|
|
277
|
+
}> | null | undefined;
|
|
278
|
+
outputs?: Record<string, {
|
|
279
|
+
unit: string;
|
|
280
|
+
description: string;
|
|
281
|
+
'aggregation-method': string;
|
|
282
|
+
}> | null | undefined;
|
|
283
|
+
} | undefined;
|
|
284
|
+
} | undefined>;
|
|
186
285
|
};
|
|
187
286
|
tree: Record<string, any>;
|
|
188
287
|
description?: string | null | undefined;
|
|
@@ -191,16 +290,12 @@ export declare const manifestSchema: z.ZodObject<{
|
|
|
191
290
|
complexity?: string | null | undefined;
|
|
192
291
|
category?: string | null | undefined;
|
|
193
292
|
} | null | undefined;
|
|
293
|
+
explainer?: boolean | undefined;
|
|
294
|
+
explain?: Record<string, any> | undefined;
|
|
194
295
|
aggregation?: {
|
|
195
296
|
type: "horizontal" | "vertical" | "both";
|
|
196
297
|
metrics: string[];
|
|
197
298
|
} | null | undefined;
|
|
198
|
-
params?: {
|
|
199
|
-
name: string;
|
|
200
|
-
description: string;
|
|
201
|
-
aggregation: "sum" | "none" | "avg";
|
|
202
|
-
unit: string;
|
|
203
|
-
}[] | null | undefined;
|
|
204
299
|
execution?: {
|
|
205
300
|
status: string;
|
|
206
301
|
command?: string | undefined;
|
|
@@ -225,8 +320,19 @@ export declare const validateManifest: (manifest: any) => {
|
|
|
225
320
|
path: string;
|
|
226
321
|
method: string;
|
|
227
322
|
'global-config'?: Record<string, any> | undefined;
|
|
228
|
-
|
|
229
|
-
|
|
323
|
+
'parameter-metadata'?: {
|
|
324
|
+
inputs?: Record<string, {
|
|
325
|
+
unit: string;
|
|
326
|
+
description: string;
|
|
327
|
+
'aggregation-method': string;
|
|
328
|
+
}> | null | undefined;
|
|
329
|
+
outputs?: Record<string, {
|
|
330
|
+
unit: string;
|
|
331
|
+
description: string;
|
|
332
|
+
'aggregation-method': string;
|
|
333
|
+
}> | null | undefined;
|
|
334
|
+
} | undefined;
|
|
335
|
+
} | undefined>;
|
|
230
336
|
};
|
|
231
337
|
tree: Record<string, any>;
|
|
232
338
|
description?: string | null | undefined;
|
|
@@ -235,16 +341,12 @@ export declare const validateManifest: (manifest: any) => {
|
|
|
235
341
|
complexity?: string | null | undefined;
|
|
236
342
|
category?: string | null | undefined;
|
|
237
343
|
} | null | undefined;
|
|
344
|
+
explainer?: boolean | undefined;
|
|
345
|
+
explain?: Record<string, any> | undefined;
|
|
238
346
|
aggregation?: {
|
|
239
347
|
type: "horizontal" | "vertical" | "both";
|
|
240
348
|
metrics: string[];
|
|
241
349
|
} | null | undefined;
|
|
242
|
-
params?: {
|
|
243
|
-
name: string;
|
|
244
|
-
description: string;
|
|
245
|
-
aggregation: "sum" | "none" | "avg";
|
|
246
|
-
unit: string;
|
|
247
|
-
}[] | null | undefined;
|
|
248
350
|
execution?: {
|
|
249
351
|
status: string;
|
|
250
352
|
command?: string | undefined;
|