@grnsft/if 1.0.1 → 1.1.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/.dockerignore +10 -0
- package/CONTAINER.md +148 -0
- package/Dockerfile +73 -0
- package/HELM_CHART.md +96 -0
- package/README.md +56 -0
- package/bin/docker-entrypoint.sh +15 -0
- package/build/common/types/manifest.d.ts +1 -0
- package/build/common/types/manifest.js +1 -1
- package/build/common/util/debug-logger.js +4 -18
- package/build/common/util/helpers.d.ts +3 -2
- package/build/common/util/helpers.js +6 -18
- package/build/common/util/storage.d.ts +9 -0
- package/build/common/util/storage.js +24 -0
- package/build/if-api/config/config.d.ts +9 -0
- package/build/if-api/config/config.js +58 -0
- package/build/if-api/config/index.d.ts +2 -0
- package/build/if-api/config/index.js +8 -0
- package/build/if-api/config/strings.d.ts +16 -0
- package/build/if-api/config/strings.js +20 -0
- package/build/if-api/index.d.ts +2 -0
- package/build/if-api/index.js +268 -0
- package/build/if-api/types/process-args.d.ts +18 -0
- package/build/if-api/types/process-args.js +3 -0
- package/build/if-api/util/args.d.ts +5 -0
- package/build/if-api/util/args.js +42 -0
- package/build/if-check/index.js +1 -11
- package/build/if-check/util/npm.d.ts +1 -1
- package/build/if-check/util/npm.js +31 -74
- package/build/if-metadata-check/config/config.d.ts +5 -0
- package/build/if-metadata-check/config/config.js +26 -0
- package/build/if-metadata-check/config/strings.d.ts +5 -0
- package/build/if-metadata-check/config/strings.js +9 -0
- package/build/if-metadata-check/index.d.ts +2 -0
- package/build/if-metadata-check/index.js +30 -0
- package/build/if-metadata-check/types/plugin.d.ts +7 -0
- package/build/if-metadata-check/types/plugin.js +3 -0
- package/build/if-metadata-check/types/process-args.d.ts +5 -0
- package/build/if-metadata-check/types/process-args.js +3 -0
- package/build/if-metadata-check/util/args.d.ts +57 -0
- package/build/if-metadata-check/util/args.js +29 -0
- package/build/if-metadata-check/util/metadata-checker.d.ts +44 -0
- package/build/if-metadata-check/util/metadata-checker.js +99 -0
- package/build/if-run/builtins/divide/index.js +2 -2
- package/build/if-run/builtins/sci/index.js +2 -2
- package/build/if-run/config/strings.js +3 -3
- package/build/if-run/index.js +1 -1
- package/build/if-run/lib/aggregate.d.ts +2 -2
- package/build/if-run/lib/aggregate.js +5 -19
- package/build/if-run/lib/compute.d.ts +1 -1
- package/build/if-run/lib/compute.js +10 -9
- package/build/if-run/lib/environment.d.ts +5 -1
- package/build/if-run/lib/environment.js +30 -29
- package/build/if-run/lib/initialize.d.ts +12 -0
- package/build/if-run/lib/initialize.js +37 -3
- package/build/if-run/lib/regroup.d.ts +3 -2
- package/build/if-run/lib/regroup.js +13 -9
- package/build/if-run/types/compute.d.ts +1 -1
- package/build/if-run/types/compute.js +1 -1
- package/build/if-run/util/os-checker.js +14 -10
- package/helm-chart/.helmignore +23 -0
- package/helm-chart/Chart.yaml +24 -0
- package/helm-chart/templates/NOTES.txt +22 -0
- package/helm-chart/templates/_helpers.tpl +62 -0
- package/helm-chart/templates/additionalPlugins.yaml +13 -0
- package/helm-chart/templates/deployment.yaml +144 -0
- package/helm-chart/templates/disabledPlugins.yaml +11 -0
- package/helm-chart/templates/env-configmap.yaml +10 -0
- package/helm-chart/templates/env-secret.yaml +10 -0
- package/helm-chart/templates/hpa.yaml +32 -0
- package/helm-chart/templates/ingress.yaml +43 -0
- package/helm-chart/templates/npmrc.yaml +11 -0
- package/helm-chart/templates/service.yaml +24 -0
- package/helm-chart/templates/serviceaccount.yaml +13 -0
- package/helm-chart/templates/tests/test-connection.yaml +15 -0
- package/helm-chart/values.yaml +175 -0
- package/jest.config.js +6 -2
- package/manifests/examples/bugs/aggregation-error-wrong-metric.yml +173 -0
- package/manifests/examples/bugs/input-error-missing-duration.yml +25 -0
- package/manifests/examples/bugs/mock-observations-failure-duration-is-zero.yml +33 -0
- package/manifests/examples/bugs/pipeline-error-naming-mismatch.yml +32 -0
- package/manifests/examples/bugs/pipeline-error-uninitialized-plugin.yml +33 -0
- package/manifests/examples/bugs/pipeline-ordering-error.yml +91 -0
- package/manifests/examples/builtins/divide/success-denominator-equal-zero.yml +36 -0
- package/manifests/examples/builtins/mock-observations/failure-invalid-config-cpu-range.yml +0 -1
- package/manifests/examples/builtins/mock-observations/failure-invalid-memory-utilization-range.yml +0 -1
- package/manifests/examples/builtins/mock-observations/failure-missing-timestamp-from-param.yml +0 -1
- package/manifests/examples/builtins/mock-observations/success.yml +0 -1
- package/manifests/examples/builtins/sci/failure-invalid-config-value.yml +0 -1
- package/manifests/examples/builtins/sci/failure-missing-input-param.yml +0 -1
- package/manifests/examples/builtins/sci/success.yml +0 -1
- package/manifests/examples/builtins/sci-embodied/failure-invalid-default-emission-value.yml +22 -0
- package/manifests/examples/builtins/time-sync/failure-missing-config.yml +0 -2
- package/manifests/examples/builtins/time-sync/success.yml +0 -2
- package/manifests/examples/features/aggregate-failure-invalid-metrics.yml +50 -0
- package/manifests/examples/features/aggregate-failure-missing-metric-in-inputs.yml +50 -0
- package/manifests/examples/features/aggregate-horizontal.yml +58 -0
- package/manifests/examples/features/aggregate-vertical.yml +58 -0
- package/manifests/examples/features/aggregate.yml +58 -0
- package/manifests/examples/pipelines/cloud-metadata-divide.yml +36 -0
- package/manifests/examples/pipelines/pipeline-with-mocks.yml +0 -1
- package/manifests/examples/pipelines/scenario-5.yml +0 -1
- package/manifests/outputs/bugs/mock-observations-failure-duration-is-zero.yaml +0 -1
- package/manifests/outputs/builtins/mock-observations/failure-invalid-config-cpu-range.yaml +0 -1
- package/manifests/outputs/builtins/mock-observations/failure-invalid-memory-utilization-range.yaml +0 -1
- package/manifests/outputs/builtins/mock-observations/failure-missing-timestamp-from-param.yaml +0 -1
- package/manifests/outputs/builtins/sci/failure-invalid-config-value.yaml +0 -1
- package/manifests/outputs/builtins/sci/failure-missing-input-param.yaml +0 -1
- package/manifests/outputs/builtins/time-sync/failure-missing-config.yaml +0 -2
- package/manifests/outputs/features/regroup/success.yaml +72 -0
- package/manifests/outputs/pipelines/pipeline-with-aggregate.yaml +1291 -0
- package/manifests/outputs/pipelines/scenario-3.yaml +126 -0
- package/openapi.yaml +424 -0
- package/package.json +17 -12
- package/with-plugins/Dockerfile +59 -0
- package/.env +0 -5
- package/coverage/clover.xml +0 -2062
- package/coverage/coverage-final.json +0 -58
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/builtins/coefficient/index.html +0 -116
- package/coverage/lcov-report/builtins/coefficient/index.ts.html +0 -298
- package/coverage/lcov-report/builtins/csv-lookup/index.html +0 -116
- package/coverage/lcov-report/builtins/csv-lookup/index.ts.html +0 -826
- package/coverage/lcov-report/builtins/divide/index.html +0 -116
- package/coverage/lcov-report/builtins/divide/index.ts.html +0 -358
- package/coverage/lcov-report/builtins/exponent/index.html +0 -116
- package/coverage/lcov-report/builtins/exponent/index.ts.html +0 -361
- package/coverage/lcov-report/builtins/export-csv-raw.ts.html +0 -553
- package/coverage/lcov-report/builtins/export-csv.ts.html +0 -436
- package/coverage/lcov-report/builtins/export-log.ts.html +0 -148
- package/coverage/lcov-report/builtins/export-yaml.ts.html +0 -193
- package/coverage/lcov-report/builtins/group-by.ts.html +0 -370
- package/coverage/lcov-report/builtins/index.html +0 -206
- package/coverage/lcov-report/builtins/index.ts.html +0 -130
- package/coverage/lcov-report/builtins/interpolation/index.html +0 -116
- package/coverage/lcov-report/builtins/interpolation/index.ts.html +0 -676
- package/coverage/lcov-report/builtins/interpolation/types.ts.html +0 -100
- package/coverage/lcov-report/builtins/mock-observations/helpers/common-generator.ts.html +0 -184
- package/coverage/lcov-report/builtins/mock-observations/helpers/index.html +0 -131
- package/coverage/lcov-report/builtins/mock-observations/helpers/rand-int-generator.ts.html +0 -289
- package/coverage/lcov-report/builtins/mock-observations/index.html +0 -116
- package/coverage/lcov-report/builtins/mock-observations/index.ts.html +0 -619
- package/coverage/lcov-report/builtins/multiply/index.html +0 -116
- package/coverage/lcov-report/builtins/multiply/index.ts.html +0 -343
- package/coverage/lcov-report/builtins/regex/index.html +0 -116
- package/coverage/lcov-report/builtins/regex/index.ts.html +0 -373
- package/coverage/lcov-report/builtins/sci/config.ts.html +0 -205
- package/coverage/lcov-report/builtins/sci/index.html +0 -116
- package/coverage/lcov-report/builtins/sci/index.ts.html +0 -325
- package/coverage/lcov-report/builtins/sci-embodied/index.html +0 -116
- package/coverage/lcov-report/builtins/sci-embodied/index.ts.html +0 -478
- package/coverage/lcov-report/builtins/shell/index.html +0 -116
- package/coverage/lcov-report/builtins/shell/index.ts.html +0 -280
- package/coverage/lcov-report/builtins/subtract/index.html +0 -116
- package/coverage/lcov-report/builtins/subtract/index.ts.html +0 -379
- package/coverage/lcov-report/builtins/sum/index.html +0 -116
- package/coverage/lcov-report/builtins/sum/index.ts.html +0 -334
- package/coverage/lcov-report/builtins/time-sync.ts.html +0 -1462
- package/coverage/lcov-report/common/config/index.html +0 -131
- package/coverage/lcov-report/common/config/index.ts.html +0 -88
- package/coverage/lcov-report/common/config/strings.ts.html +0 -121
- package/coverage/lcov-report/common/lib/index.html +0 -116
- package/coverage/lcov-report/common/lib/load.ts.html +0 -139
- package/coverage/lcov-report/common/util/debug-logger.ts.html +0 -514
- package/coverage/lcov-report/common/util/fs.ts.html +0 -289
- package/coverage/lcov-report/common/util/helpers.ts.html +0 -355
- package/coverage/lcov-report/common/util/index.html +0 -191
- package/coverage/lcov-report/common/util/logger.ts.html +0 -151
- package/coverage/lcov-report/common/util/validations.ts.html +0 -628
- package/coverage/lcov-report/common/util/yaml.ts.html +0 -226
- package/coverage/lcov-report/config/config.ts.html +0 -463
- package/coverage/lcov-report/config/index.html +0 -161
- package/coverage/lcov-report/config/index.ts.html +0 -94
- package/coverage/lcov-report/config/params.ts.html +0 -697
- package/coverage/lcov-report/config/strings.ts.html +0 -490
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/if-check/config/config.ts.html +0 -184
- package/coverage/lcov-report/if-check/config/index.html +0 -146
- package/coverage/lcov-report/if-check/config/index.ts.html +0 -91
- package/coverage/lcov-report/if-check/config/strings.ts.html +0 -142
- package/coverage/lcov-report/if-check/util/args.ts.html +0 -310
- package/coverage/lcov-report/if-check/util/helpers.ts.html +0 -136
- package/coverage/lcov-report/if-check/util/index.html +0 -146
- package/coverage/lcov-report/if-check/util/npm.ts.html +0 -376
- package/coverage/lcov-report/if-csv/util/args.ts.html +0 -256
- package/coverage/lcov-report/if-csv/util/helpers.ts.html +0 -346
- package/coverage/lcov-report/if-csv/util/index.html +0 -131
- package/coverage/lcov-report/if-diff/config/config.ts.html +0 -184
- package/coverage/lcov-report/if-diff/config/index.html +0 -146
- package/coverage/lcov-report/if-diff/config/index.ts.html +0 -91
- package/coverage/lcov-report/if-diff/config/strings.ts.html +0 -100
- package/coverage/lcov-report/if-diff/lib/compare.ts.html +0 -286
- package/coverage/lcov-report/if-diff/lib/index.html +0 -131
- package/coverage/lcov-report/if-diff/lib/load.ts.html +0 -199
- package/coverage/lcov-report/if-diff/util/args.ts.html +0 -274
- package/coverage/lcov-report/if-diff/util/helpers.ts.html +0 -337
- package/coverage/lcov-report/if-diff/util/index.html +0 -131
- package/coverage/lcov-report/if-env/config/config.ts.html +0 -211
- package/coverage/lcov-report/if-env/config/index.html +0 -146
- package/coverage/lcov-report/if-env/config/index.ts.html +0 -91
- package/coverage/lcov-report/if-env/config/strings.ts.html +0 -109
- package/coverage/lcov-report/if-env/util/args.ts.html +0 -256
- package/coverage/lcov-report/if-env/util/index.html +0 -131
- package/coverage/lcov-report/if-env/util/npm.ts.html +0 -526
- package/coverage/lcov-report/if-merge/util/args.ts.html +0 -301
- package/coverage/lcov-report/if-merge/util/helpers.ts.html +0 -313
- package/coverage/lcov-report/if-merge/util/index.html +0 -131
- package/coverage/lcov-report/if-run/builtins/coefficient/index.html +0 -116
- package/coverage/lcov-report/if-run/builtins/coefficient/index.ts.html +0 -286
- package/coverage/lcov-report/if-run/builtins/copy-param/index.html +0 -116
- package/coverage/lcov-report/if-run/builtins/copy-param/index.ts.html +0 -301
- package/coverage/lcov-report/if-run/builtins/csv-import/index.html +0 -116
- package/coverage/lcov-report/if-run/builtins/csv-import/index.ts.html +0 -364
- package/coverage/lcov-report/if-run/builtins/csv-lookup/index.html +0 -116
- package/coverage/lcov-report/if-run/builtins/csv-lookup/index.ts.html +0 -478
- package/coverage/lcov-report/if-run/builtins/divide/index.html +0 -116
- package/coverage/lcov-report/if-run/builtins/divide/index.ts.html +0 -346
- package/coverage/lcov-report/if-run/builtins/exponent/index.html +0 -116
- package/coverage/lcov-report/if-run/builtins/exponent/index.ts.html +0 -319
- package/coverage/lcov-report/if-run/builtins/export-csv-raw.ts.html +0 -553
- package/coverage/lcov-report/if-run/builtins/export-csv.ts.html +0 -436
- package/coverage/lcov-report/if-run/builtins/export-log.ts.html +0 -148
- package/coverage/lcov-report/if-run/builtins/export-yaml.ts.html +0 -193
- package/coverage/lcov-report/if-run/builtins/group-by.ts.html +0 -370
- package/coverage/lcov-report/if-run/builtins/index.html +0 -146
- package/coverage/lcov-report/if-run/builtins/index.ts.html +0 -136
- package/coverage/lcov-report/if-run/builtins/interpolation/index.html +0 -116
- package/coverage/lcov-report/if-run/builtins/interpolation/index.ts.html +0 -643
- package/coverage/lcov-report/if-run/builtins/mock-observations/helpers/common-generator.ts.html +0 -184
- package/coverage/lcov-report/if-run/builtins/mock-observations/helpers/index.html +0 -131
- package/coverage/lcov-report/if-run/builtins/mock-observations/helpers/rand-int-generator.ts.html +0 -289
- package/coverage/lcov-report/if-run/builtins/mock-observations/index.html +0 -116
- package/coverage/lcov-report/if-run/builtins/mock-observations/index.ts.html +0 -607
- package/coverage/lcov-report/if-run/builtins/multiply/index.html +0 -116
- package/coverage/lcov-report/if-run/builtins/multiply/index.ts.html +0 -289
- package/coverage/lcov-report/if-run/builtins/regex/index.html +0 -116
- package/coverage/lcov-report/if-run/builtins/regex/index.ts.html +0 -298
- package/coverage/lcov-report/if-run/builtins/sci/index.html +0 -116
- package/coverage/lcov-report/if-run/builtins/sci/index.ts.html +0 -418
- package/coverage/lcov-report/if-run/builtins/sci-embodied/index.html +0 -116
- package/coverage/lcov-report/if-run/builtins/sci-embodied/index.ts.html +0 -664
- package/coverage/lcov-report/if-run/builtins/shell/index.html +0 -116
- package/coverage/lcov-report/if-run/builtins/shell/index.ts.html +0 -256
- package/coverage/lcov-report/if-run/builtins/subtract/index.html +0 -116
- package/coverage/lcov-report/if-run/builtins/subtract/index.ts.html +0 -298
- package/coverage/lcov-report/if-run/builtins/sum/index.html +0 -116
- package/coverage/lcov-report/if-run/builtins/sum/index.ts.html +0 -238
- package/coverage/lcov-report/if-run/builtins/time-converter/config.ts.html +0 -205
- package/coverage/lcov-report/if-run/builtins/time-converter/index.html +0 -131
- package/coverage/lcov-report/if-run/builtins/time-converter/index.ts.html +0 -328
- package/coverage/lcov-report/if-run/builtins/time-sync/index.html +0 -116
- package/coverage/lcov-report/if-run/builtins/time-sync/index.ts.html +0 -1804
- package/coverage/lcov-report/if-run/builtins/time-sync.ts.html +0 -1462
- package/coverage/lcov-report/if-run/builtins/util/csv-helpers.ts.html +0 -376
- package/coverage/lcov-report/if-run/builtins/util/index.html +0 -116
- package/coverage/lcov-report/if-run/config/config.ts.html +0 -271
- package/coverage/lcov-report/if-run/config/index.html +0 -161
- package/coverage/lcov-report/if-run/config/index.ts.html +0 -94
- package/coverage/lcov-report/if-run/config/params.ts.html +0 -679
- package/coverage/lcov-report/if-run/config/strings.ts.html +0 -460
- package/coverage/lcov-report/if-run/lib/aggregate.ts.html +0 -577
- package/coverage/lcov-report/if-run/lib/compute.ts.html +0 -733
- package/coverage/lcov-report/if-run/lib/environment.ts.html +0 -373
- package/coverage/lcov-report/if-run/lib/exhaust.ts.html +0 -193
- package/coverage/lcov-report/if-run/lib/explain.ts.html +0 -484
- package/coverage/lcov-report/if-run/lib/index.html +0 -206
- package/coverage/lcov-report/if-run/lib/initialize.ts.html +0 -490
- package/coverage/lcov-report/if-run/lib/parameterize.ts.html +0 -322
- package/coverage/lcov-report/if-run/lib/regroup.ts.html +0 -349
- package/coverage/lcov-report/if-run/lib/time-sync.ts.html +0 -1510
- package/coverage/lcov-report/if-run/types/aggregation.ts.html +0 -94
- package/coverage/lcov-report/if-run/types/index.html +0 -146
- package/coverage/lcov-report/if-run/types/interface.ts.html +0 -112
- package/coverage/lcov-report/if-run/types/parameters.ts.html +0 -106
- package/coverage/lcov-report/if-run/util/aggregation-helper.ts.html +0 -277
- package/coverage/lcov-report/if-run/util/args.ts.html +0 -325
- package/coverage/lcov-report/if-run/util/helpers.ts.html +0 -208
- package/coverage/lcov-report/if-run/util/index.html +0 -191
- package/coverage/lcov-report/if-run/util/json.ts.html +0 -115
- package/coverage/lcov-report/if-run/util/log-memoize.ts.html +0 -145
- package/coverage/lcov-report/if-run/util/os-checker.ts.html +0 -421
- package/coverage/lcov-report/if-run/util/plugin-storage.ts.html +0 -202
- package/coverage/lcov-report/index.html +0 -551
- package/coverage/lcov-report/lib/aggregate.ts.html +0 -358
- package/coverage/lcov-report/lib/compare.ts.html +0 -286
- package/coverage/lcov-report/lib/compute.ts.html +0 -436
- package/coverage/lcov-report/lib/environment.ts.html +0 -376
- package/coverage/lcov-report/lib/exhaust.ts.html +0 -289
- package/coverage/lcov-report/lib/index.html +0 -221
- package/coverage/lcov-report/lib/initialize.ts.html +0 -430
- package/coverage/lcov-report/lib/load.ts.html +0 -268
- package/coverage/lcov-report/lib/parameterize.ts.html +0 -316
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov-report/types/aggregation.ts.html +0 -94
- package/coverage/lcov-report/types/index.html +0 -146
- package/coverage/lcov-report/types/interface.ts.html +0 -112
- package/coverage/lcov-report/types/parameters.ts.html +0 -106
- package/coverage/lcov-report/util/aggregation-helper.ts.html +0 -289
- package/coverage/lcov-report/util/args.ts.html +0 -649
- package/coverage/lcov-report/util/debug-logger.ts.html +0 -481
- package/coverage/lcov-report/util/errors.ts.html +0 -232
- package/coverage/lcov-report/util/fs.ts.html +0 -124
- package/coverage/lcov-report/util/helpers.ts.html +0 -895
- package/coverage/lcov-report/util/index.html +0 -296
- package/coverage/lcov-report/util/json.ts.html +0 -115
- package/coverage/lcov-report/util/log-memoize.ts.html +0 -145
- package/coverage/lcov-report/util/logger.ts.html +0 -151
- package/coverage/lcov-report/util/npm.ts.html +0 -499
- package/coverage/lcov-report/util/os-checker.ts.html +0 -421
- package/coverage/lcov-report/util/plugin-storage.ts.html +0 -202
- package/coverage/lcov-report/util/validations.ts.html +0 -544
- package/coverage/lcov-report/util/yaml.ts.html +0 -193
- package/coverage/lcov.info +0 -3548
- package/manifests/outputs/builtins/interpolation/interpolation.yaml +0 -81
- package/manifests/outputs/features/failure-invalid-regroup.yaml +0 -87
- package/manifests/outputs/features/failure-missing-cloud-instance-type.yaml +0 -86
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
name: groupby
|
|
2
|
+
description: successful path
|
|
3
|
+
initialize:
|
|
4
|
+
plugins:
|
|
5
|
+
sum:
|
|
6
|
+
path: builtin
|
|
7
|
+
method: Sum
|
|
8
|
+
config:
|
|
9
|
+
input-parameters:
|
|
10
|
+
- cpu/energy
|
|
11
|
+
- network/energy
|
|
12
|
+
output-parameter: energy
|
|
13
|
+
execution:
|
|
14
|
+
command: >-
|
|
15
|
+
/usr/bin/node /home/mitsuru/if/build/if-run -m
|
|
16
|
+
manifests/examples/pipelines/scenario-3.yml -o
|
|
17
|
+
manifests/outputs/pipelines/scenario-3.yaml
|
|
18
|
+
environment:
|
|
19
|
+
if-version: 1.0.2
|
|
20
|
+
os: Ubuntu
|
|
21
|
+
os-version: 24.04.2 LTS
|
|
22
|
+
node-version: 18.19.1
|
|
23
|
+
date-time: 2025-06-02T14:32:40.906Z (UTC)
|
|
24
|
+
dependencies:
|
|
25
|
+
- '@grnsft/if-core@0.0.30'
|
|
26
|
+
- axios@1.8.3
|
|
27
|
+
- csv-parse@5.5.6
|
|
28
|
+
- csv-stringify@6.4.6
|
|
29
|
+
- express@5.1.0
|
|
30
|
+
- js-yaml@4.1.0
|
|
31
|
+
- luxon@3.4.4
|
|
32
|
+
- ts-command-line-args@2.5.1
|
|
33
|
+
- typescript-cubic-spline@1.0.1
|
|
34
|
+
- winston@3.11.0
|
|
35
|
+
- zod@3.23.8
|
|
36
|
+
status: success
|
|
37
|
+
tree:
|
|
38
|
+
children:
|
|
39
|
+
my-app:
|
|
40
|
+
pipeline:
|
|
41
|
+
observe: null
|
|
42
|
+
regroup:
|
|
43
|
+
- cloud/instance-type
|
|
44
|
+
- cloud/region
|
|
45
|
+
compute: null
|
|
46
|
+
children:
|
|
47
|
+
uk-west:
|
|
48
|
+
children:
|
|
49
|
+
A1:
|
|
50
|
+
children:
|
|
51
|
+
uk-west:
|
|
52
|
+
inputs:
|
|
53
|
+
- timestamp: 2023-07-06T00:00
|
|
54
|
+
duration: 300
|
|
55
|
+
cloud/instance-type: A1
|
|
56
|
+
cloud/region: uk-west
|
|
57
|
+
cpu/utilization: 99
|
|
58
|
+
- timestamp: 2023-07-06T05:00
|
|
59
|
+
duration: 300
|
|
60
|
+
cloud/instance-type: A1
|
|
61
|
+
cloud/region: uk-west
|
|
62
|
+
cpu/utilization: 23
|
|
63
|
+
- timestamp: 2023-07-06T10:00
|
|
64
|
+
duration: 300
|
|
65
|
+
cloud/instance-type: A1
|
|
66
|
+
cloud/region: uk-west
|
|
67
|
+
cpu/utilization: 12
|
|
68
|
+
B1:
|
|
69
|
+
children:
|
|
70
|
+
uk-west:
|
|
71
|
+
inputs:
|
|
72
|
+
- timestamp: 2023-07-06T00:00
|
|
73
|
+
duration: 300
|
|
74
|
+
cloud/instance-type: B1
|
|
75
|
+
cloud/region: uk-west
|
|
76
|
+
cpu/utilization: 11
|
|
77
|
+
- timestamp: 2023-07-06T05:00
|
|
78
|
+
duration: 300
|
|
79
|
+
cloud/instance-type: B1
|
|
80
|
+
cloud/region: uk-west
|
|
81
|
+
cpu/utilization: 67
|
|
82
|
+
- timestamp: 2023-07-06T10:00
|
|
83
|
+
duration: 300
|
|
84
|
+
cloud/instance-type: B1
|
|
85
|
+
cloud/region: uk-west
|
|
86
|
+
cpu/utilization: 1
|
|
87
|
+
uk-east:
|
|
88
|
+
children:
|
|
89
|
+
A1:
|
|
90
|
+
children:
|
|
91
|
+
uk-east:
|
|
92
|
+
inputs:
|
|
93
|
+
- timestamp: 2023-07-06T00:00
|
|
94
|
+
duration: 300
|
|
95
|
+
cloud/instance-type: A1
|
|
96
|
+
cloud/region: uk-east
|
|
97
|
+
cpu/utilization: 9
|
|
98
|
+
- timestamp: 2023-07-06T05:00
|
|
99
|
+
duration: 300
|
|
100
|
+
cloud/instance-type: A1
|
|
101
|
+
cloud/region: uk-east
|
|
102
|
+
cpu/utilization: 23
|
|
103
|
+
- timestamp: 2023-07-06T10:00
|
|
104
|
+
duration: 300
|
|
105
|
+
cloud/instance-type: A1
|
|
106
|
+
cloud/region: uk-east
|
|
107
|
+
cpu/utilization: 12
|
|
108
|
+
B1:
|
|
109
|
+
children:
|
|
110
|
+
uk-east:
|
|
111
|
+
inputs:
|
|
112
|
+
- timestamp: 2023-07-06T00:00
|
|
113
|
+
duration: 300
|
|
114
|
+
cloud/instance-type: B1
|
|
115
|
+
cloud/region: uk-east
|
|
116
|
+
cpu/utilization: 11
|
|
117
|
+
- timestamp: 2023-07-06T05:00
|
|
118
|
+
duration: 300
|
|
119
|
+
cloud/instance-type: B1
|
|
120
|
+
cloud/region: uk-east
|
|
121
|
+
cpu/utilization: 67
|
|
122
|
+
- timestamp: 2023-07-06T10:00
|
|
123
|
+
duration: 300
|
|
124
|
+
cloud/instance-type: B1
|
|
125
|
+
cloud/region: uk-east
|
|
126
|
+
cpu/utilization: 1
|
package/openapi.yaml
ADDED
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
openapi: 3.0.3
|
|
2
|
+
info:
|
|
3
|
+
title: Impact Framework Web API
|
|
4
|
+
description: |-
|
|
5
|
+
This API provides key feature of Impact Framework (IF) as a Web API.
|
|
6
|
+
license:
|
|
7
|
+
name: MIT license
|
|
8
|
+
url: https://github.com/Green-Software-Foundation/if/blob/main/LICENSE
|
|
9
|
+
version: 1.0.0
|
|
10
|
+
externalDocs:
|
|
11
|
+
description: Find out more about Impact Framework
|
|
12
|
+
url: https://if.greensoftware.foundation/
|
|
13
|
+
components:
|
|
14
|
+
schemas:
|
|
15
|
+
aggregation-method-type:
|
|
16
|
+
type: string
|
|
17
|
+
enum:
|
|
18
|
+
- sum
|
|
19
|
+
- avg
|
|
20
|
+
- none
|
|
21
|
+
- copy
|
|
22
|
+
aggregation-method:
|
|
23
|
+
type: object
|
|
24
|
+
properties:
|
|
25
|
+
time:
|
|
26
|
+
$ref: '#/components/schemas/aggregation-method-type'
|
|
27
|
+
component:
|
|
28
|
+
$ref: '#/components/schemas/aggregation-method-type'
|
|
29
|
+
required:
|
|
30
|
+
- time
|
|
31
|
+
- component
|
|
32
|
+
additionalProperties: false
|
|
33
|
+
aggregation-type:
|
|
34
|
+
type: string
|
|
35
|
+
enum:
|
|
36
|
+
- horizontal
|
|
37
|
+
- time
|
|
38
|
+
- vertical
|
|
39
|
+
- component
|
|
40
|
+
- both
|
|
41
|
+
metadata:
|
|
42
|
+
type: object
|
|
43
|
+
additionalProperties:
|
|
44
|
+
type: object
|
|
45
|
+
properties:
|
|
46
|
+
unit:
|
|
47
|
+
type: string
|
|
48
|
+
description:
|
|
49
|
+
type: string
|
|
50
|
+
aggregation-method:
|
|
51
|
+
$ref: '#/components/schemas/aggregation-method'
|
|
52
|
+
required:
|
|
53
|
+
- unit
|
|
54
|
+
- description
|
|
55
|
+
- aggregation-method
|
|
56
|
+
additionalProperties: false
|
|
57
|
+
nullable: true
|
|
58
|
+
parameter-metadata:
|
|
59
|
+
type: object
|
|
60
|
+
properties:
|
|
61
|
+
inputs:
|
|
62
|
+
$ref: '#/components/schemas/metadata'
|
|
63
|
+
outputs:
|
|
64
|
+
$ref: '#/components/schemas/metadata'
|
|
65
|
+
additionalProperties: false
|
|
66
|
+
manifest:
|
|
67
|
+
type: object
|
|
68
|
+
properties:
|
|
69
|
+
name:
|
|
70
|
+
type: string
|
|
71
|
+
description:
|
|
72
|
+
type: string
|
|
73
|
+
nullable: true
|
|
74
|
+
tags:
|
|
75
|
+
type: object
|
|
76
|
+
properties:
|
|
77
|
+
kind:
|
|
78
|
+
type: string
|
|
79
|
+
nullable: true
|
|
80
|
+
complexity:
|
|
81
|
+
type: string
|
|
82
|
+
nullable: true
|
|
83
|
+
category:
|
|
84
|
+
type: string
|
|
85
|
+
nullable: true
|
|
86
|
+
additionalProperties: false
|
|
87
|
+
nullable: true
|
|
88
|
+
explainer:
|
|
89
|
+
type: boolean
|
|
90
|
+
explain:
|
|
91
|
+
type: object
|
|
92
|
+
aggregation:
|
|
93
|
+
type: object
|
|
94
|
+
properties:
|
|
95
|
+
metrics:
|
|
96
|
+
type: array
|
|
97
|
+
items:
|
|
98
|
+
type: string
|
|
99
|
+
type:
|
|
100
|
+
$ref: '#/components/schemas/aggregation-type'
|
|
101
|
+
skip-components:
|
|
102
|
+
type: array
|
|
103
|
+
items:
|
|
104
|
+
type: string
|
|
105
|
+
required:
|
|
106
|
+
- metrics
|
|
107
|
+
- type
|
|
108
|
+
additionalProperties: false
|
|
109
|
+
nullable: true
|
|
110
|
+
initialize:
|
|
111
|
+
type: object
|
|
112
|
+
properties:
|
|
113
|
+
plugins:
|
|
114
|
+
type: object
|
|
115
|
+
additionalProperties:
|
|
116
|
+
type: object
|
|
117
|
+
properties:
|
|
118
|
+
path:
|
|
119
|
+
type: string
|
|
120
|
+
method:
|
|
121
|
+
type: string
|
|
122
|
+
mapping:
|
|
123
|
+
type: object
|
|
124
|
+
additionalProperties:
|
|
125
|
+
type: string
|
|
126
|
+
config:
|
|
127
|
+
type: object
|
|
128
|
+
parameter-metadata:
|
|
129
|
+
$ref: '#/components/schemas/parameter-metadata'
|
|
130
|
+
required:
|
|
131
|
+
- path
|
|
132
|
+
- method
|
|
133
|
+
additionalProperties: false
|
|
134
|
+
required:
|
|
135
|
+
- plugins
|
|
136
|
+
additionalProperties: false
|
|
137
|
+
execution:
|
|
138
|
+
type: object
|
|
139
|
+
properties:
|
|
140
|
+
command:
|
|
141
|
+
type: string
|
|
142
|
+
environment:
|
|
143
|
+
type: object
|
|
144
|
+
properties:
|
|
145
|
+
if-version:
|
|
146
|
+
type: string
|
|
147
|
+
os:
|
|
148
|
+
type: string
|
|
149
|
+
os-version:
|
|
150
|
+
type: string
|
|
151
|
+
node-version:
|
|
152
|
+
type: string
|
|
153
|
+
date-time:
|
|
154
|
+
type: string
|
|
155
|
+
dependencies:
|
|
156
|
+
type: array
|
|
157
|
+
items:
|
|
158
|
+
type: string
|
|
159
|
+
required:
|
|
160
|
+
- if-version
|
|
161
|
+
- os
|
|
162
|
+
- os-version
|
|
163
|
+
- node-version
|
|
164
|
+
- date-time
|
|
165
|
+
- dependencies
|
|
166
|
+
additionalProperties: false
|
|
167
|
+
status:
|
|
168
|
+
type: string
|
|
169
|
+
error:
|
|
170
|
+
type: string
|
|
171
|
+
required:
|
|
172
|
+
- status
|
|
173
|
+
additionalProperties: false
|
|
174
|
+
tree:
|
|
175
|
+
type: object
|
|
176
|
+
required:
|
|
177
|
+
- name
|
|
178
|
+
- initialize
|
|
179
|
+
- tree
|
|
180
|
+
additionalProperties: false
|
|
181
|
+
examples:
|
|
182
|
+
request-yaml:
|
|
183
|
+
summary: 'sample request YAML'
|
|
184
|
+
value:
|
|
185
|
+
name: demo
|
|
186
|
+
initialize:
|
|
187
|
+
plugins:
|
|
188
|
+
double-a-value:
|
|
189
|
+
path: 'builtin'
|
|
190
|
+
method: Coefficient
|
|
191
|
+
config:
|
|
192
|
+
input-parameter: "cpu/utilization"
|
|
193
|
+
coefficient: 2
|
|
194
|
+
output-parameter: "cpu-utilization-doubled"
|
|
195
|
+
tree:
|
|
196
|
+
children:
|
|
197
|
+
child-0:
|
|
198
|
+
pipeline:
|
|
199
|
+
compute:
|
|
200
|
+
- double-a-value
|
|
201
|
+
inputs:
|
|
202
|
+
- timestamp: 2023-07-06T00:00
|
|
203
|
+
duration: 1
|
|
204
|
+
cpu/utilization: 20
|
|
205
|
+
- timestamp: 2023-07-06T00:01
|
|
206
|
+
duration: 1
|
|
207
|
+
cpu/utilization: 80
|
|
208
|
+
request-json:
|
|
209
|
+
summary: 'sample request JSON'
|
|
210
|
+
value:
|
|
211
|
+
{
|
|
212
|
+
"name": "demo",
|
|
213
|
+
"initialize": {
|
|
214
|
+
"plugins": {
|
|
215
|
+
"double-a-value": {
|
|
216
|
+
"path": "builtin",
|
|
217
|
+
"method": "Coefficient",
|
|
218
|
+
"config": {
|
|
219
|
+
"input-parameter": "cpu/utilization",
|
|
220
|
+
"coefficient": 2,
|
|
221
|
+
"output-parameter": "cpu-utilization-doubled"
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"tree": {
|
|
227
|
+
"children": {
|
|
228
|
+
"child-0": {
|
|
229
|
+
"pipeline": {
|
|
230
|
+
"compute": [
|
|
231
|
+
"double-a-value"
|
|
232
|
+
]
|
|
233
|
+
},
|
|
234
|
+
"inputs": [
|
|
235
|
+
{
|
|
236
|
+
"timestamp": "2023-07-06T00:00",
|
|
237
|
+
"duration": 1,
|
|
238
|
+
"cpu/utilization": 20
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"timestamp": "2023-07-06T00:01",
|
|
242
|
+
"duration": 1,
|
|
243
|
+
"cpu/utilization": 80
|
|
244
|
+
}
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
response-yaml:
|
|
251
|
+
summary: 'sample response YAML'
|
|
252
|
+
value:
|
|
253
|
+
name: demo
|
|
254
|
+
initialize:
|
|
255
|
+
plugins:
|
|
256
|
+
double-a-value:
|
|
257
|
+
path: builtin
|
|
258
|
+
method: Coefficient
|
|
259
|
+
config:
|
|
260
|
+
input-parameter: cpu/utilization
|
|
261
|
+
coefficient: 2
|
|
262
|
+
output-parameter: cpu-utilization-doubled
|
|
263
|
+
execution:
|
|
264
|
+
command: /usr/bin/node /usr/local/bin/if-api
|
|
265
|
+
environment:
|
|
266
|
+
if-version: 1.0.1
|
|
267
|
+
os: Ubuntu
|
|
268
|
+
os-version: 24.04.2 LTS
|
|
269
|
+
node-version: 18.19.1
|
|
270
|
+
date-time: 2025-05-08T06:26:22.727Z (UTC)
|
|
271
|
+
dependencies: []
|
|
272
|
+
status: success
|
|
273
|
+
tree:
|
|
274
|
+
children:
|
|
275
|
+
child-0:
|
|
276
|
+
pipeline:
|
|
277
|
+
compute:
|
|
278
|
+
- double-a-value
|
|
279
|
+
inputs:
|
|
280
|
+
- timestamp: 2023-07-06T00:00
|
|
281
|
+
duration: 1
|
|
282
|
+
cpu/utilization: 20
|
|
283
|
+
- timestamp: 2023-07-06T00:01
|
|
284
|
+
duration: 1
|
|
285
|
+
cpu/utilization: 80
|
|
286
|
+
outputs:
|
|
287
|
+
- timestamp: 2023-07-06T00:00
|
|
288
|
+
duration: 1
|
|
289
|
+
cpu/utilization: 20
|
|
290
|
+
cpu-utilization-doubled: 40
|
|
291
|
+
- timestamp: 2023-07-06T00:01
|
|
292
|
+
duration: 1
|
|
293
|
+
cpu/utilization: 80
|
|
294
|
+
cpu-utilization-doubled: 160
|
|
295
|
+
response-json:
|
|
296
|
+
summary: 'sample response JSON'
|
|
297
|
+
value:
|
|
298
|
+
{
|
|
299
|
+
"name": "demo",
|
|
300
|
+
"initialize": {
|
|
301
|
+
"plugins": {
|
|
302
|
+
"double-a-value": {
|
|
303
|
+
"path": "builtin",
|
|
304
|
+
"method": "Coefficient",
|
|
305
|
+
"config": {
|
|
306
|
+
"input-parameter": "cpu/utilization",
|
|
307
|
+
"coefficient": 2,
|
|
308
|
+
"output-parameter": "cpu-utilization-doubled"
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
"execution": {
|
|
314
|
+
"command": "/usr/bin/node /usr/local/bin/if-api",
|
|
315
|
+
"environment": {
|
|
316
|
+
"if-version": "1.0.1",
|
|
317
|
+
"os": "Ubuntu",
|
|
318
|
+
"os-version": "24.04.2 LTS",
|
|
319
|
+
"node-version": "18.19.1",
|
|
320
|
+
"date-time": "2025-05-08T06:30:00.855Z (UTC)",
|
|
321
|
+
"dependencies": []
|
|
322
|
+
},
|
|
323
|
+
"status": "success"
|
|
324
|
+
},
|
|
325
|
+
"tree": {
|
|
326
|
+
"children": {
|
|
327
|
+
"child-0": {
|
|
328
|
+
"pipeline": {
|
|
329
|
+
"compute": [
|
|
330
|
+
"double-a-value"
|
|
331
|
+
]
|
|
332
|
+
},
|
|
333
|
+
"inputs": [
|
|
334
|
+
{
|
|
335
|
+
"timestamp": "2023-07-06T00:00",
|
|
336
|
+
"duration": 1,
|
|
337
|
+
"cpu/utilization": 20
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"timestamp": "2023-07-06T00:01",
|
|
341
|
+
"duration": 1,
|
|
342
|
+
"cpu/utilization": 80
|
|
343
|
+
}
|
|
344
|
+
],
|
|
345
|
+
"outputs": [
|
|
346
|
+
{
|
|
347
|
+
"timestamp": "2023-07-06T00:00",
|
|
348
|
+
"duration": 1,
|
|
349
|
+
"cpu/utilization": 20,
|
|
350
|
+
"cpu-utilization-doubled": 40
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"timestamp": "2023-07-06T00:01",
|
|
354
|
+
"duration": 1,
|
|
355
|
+
"cpu/utilization": 80,
|
|
356
|
+
"cpu-utilization-doubled": 160
|
|
357
|
+
}
|
|
358
|
+
]
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
paths:
|
|
364
|
+
/v1/run:
|
|
365
|
+
post:
|
|
366
|
+
summary: Execute `if-run` with given manifest.
|
|
367
|
+
operationId: ifRun
|
|
368
|
+
parameters:
|
|
369
|
+
- in: query
|
|
370
|
+
name: observe
|
|
371
|
+
schema:
|
|
372
|
+
type: boolean
|
|
373
|
+
required: false
|
|
374
|
+
description: "executes only observe pipeline of the manifest"
|
|
375
|
+
- in: query
|
|
376
|
+
name: aggregate
|
|
377
|
+
schema:
|
|
378
|
+
type: boolean
|
|
379
|
+
required: false
|
|
380
|
+
description: "executes only regroup pipeline of the manifest"
|
|
381
|
+
- in: query
|
|
382
|
+
name: compute
|
|
383
|
+
schema:
|
|
384
|
+
type: boolean
|
|
385
|
+
required: false
|
|
386
|
+
description: "executes only compute pipeline of the manifest"
|
|
387
|
+
requestBody:
|
|
388
|
+
description: IF Manifest
|
|
389
|
+
content:
|
|
390
|
+
application/yaml:
|
|
391
|
+
schema:
|
|
392
|
+
$ref: '#/components/schemas/manifest'
|
|
393
|
+
examples:
|
|
394
|
+
sample:
|
|
395
|
+
$ref: '#/components/examples/request-yaml'
|
|
396
|
+
application/json:
|
|
397
|
+
schema:
|
|
398
|
+
$ref: '#/components/schemas/manifest'
|
|
399
|
+
examples:
|
|
400
|
+
sample:
|
|
401
|
+
$ref: '#/components/examples/request-json'
|
|
402
|
+
required: true
|
|
403
|
+
responses:
|
|
404
|
+
'200':
|
|
405
|
+
description: Successful operation.
|
|
406
|
+
content:
|
|
407
|
+
application/yaml:
|
|
408
|
+
schema:
|
|
409
|
+
$ref: '#/components/schemas/manifest'
|
|
410
|
+
examples:
|
|
411
|
+
success:
|
|
412
|
+
$ref: '#/components/examples/response-yaml'
|
|
413
|
+
application/json:
|
|
414
|
+
schema:
|
|
415
|
+
$ref: '#/components/schemas/manifest'
|
|
416
|
+
examples:
|
|
417
|
+
success:
|
|
418
|
+
$ref: '#/components/examples/response-json'
|
|
419
|
+
'400':
|
|
420
|
+
description: Validation Error
|
|
421
|
+
'415':
|
|
422
|
+
description: Invalid Content Type
|
|
423
|
+
'500':
|
|
424
|
+
description: Internal Server Error
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grnsft/if",
|
|
3
3
|
"description": "Impact Framework",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.1.0-beta.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Green Software Foundation",
|
|
7
7
|
"email": "info@gsf.com"
|
|
@@ -12,22 +12,22 @@
|
|
|
12
12
|
"if-env": "build/if-env/index.js",
|
|
13
13
|
"if-check": "build/if-check/index.js",
|
|
14
14
|
"if-csv": "build/if-csv/index.js",
|
|
15
|
-
"if-merge": "build/if-merge/index.js"
|
|
15
|
+
"if-merge": "build/if-merge/index.js",
|
|
16
|
+
"if-api": "build/if-api/index.js",
|
|
17
|
+
"if-metadata-check": "build/if-metadata-check/index.js"
|
|
16
18
|
},
|
|
17
19
|
"bugs": {
|
|
18
20
|
"url": "https://github.com/Green-Software-Foundation/if/issues/new?assignees=&labels=feedback&projects=&template=feedback.md&title=Feedback+-+"
|
|
19
21
|
},
|
|
20
22
|
"dependencies": {
|
|
21
|
-
"@
|
|
22
|
-
"@commitlint/config-conventional": "^18.6.0",
|
|
23
|
-
"@grnsft/if-core": "^0.0.29",
|
|
23
|
+
"@grnsft/if-core": "^0.0.30",
|
|
24
24
|
"axios": "^1.7.2",
|
|
25
25
|
"csv-parse": "^5.5.6",
|
|
26
26
|
"csv-stringify": "^6.4.6",
|
|
27
|
+
"express": "^5.1.0",
|
|
27
28
|
"js-yaml": "^4.1.0",
|
|
28
29
|
"luxon": "^3.4.4",
|
|
29
30
|
"ts-command-line-args": "^2.5.1",
|
|
30
|
-
"typescript": "^5.1.6",
|
|
31
31
|
"typescript-cubic-spline": "^1.0.1",
|
|
32
32
|
"winston": "^3.11.0",
|
|
33
33
|
"zod": "^3.22.4"
|
|
@@ -35,7 +35,10 @@
|
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/core": "^7.22.10",
|
|
37
37
|
"@babel/preset-typescript": "^7.22.5",
|
|
38
|
+
"@commitlint/cli": "^18.6.0",
|
|
39
|
+
"@commitlint/config-conventional": "^18.6.0",
|
|
38
40
|
"@jest/globals": "^29.6.1",
|
|
41
|
+
"@types/express": "^5.0.1",
|
|
39
42
|
"@types/jest": "^29.5.7",
|
|
40
43
|
"@types/js-yaml": "^4.0.5",
|
|
41
44
|
"@types/luxon": "^3.4.2",
|
|
@@ -47,9 +50,10 @@
|
|
|
47
50
|
"husky": "^8.0.0",
|
|
48
51
|
"jest": "^29.6.1",
|
|
49
52
|
"lint-staged": "^15.2.2",
|
|
50
|
-
"release-it": "^
|
|
53
|
+
"release-it": "^19.0.3",
|
|
51
54
|
"rimraf": "^5.0.5",
|
|
52
|
-
"ts-jest": "^29.1.1"
|
|
55
|
+
"ts-jest": "^29.1.1",
|
|
56
|
+
"typescript": "^5.1.6"
|
|
53
57
|
},
|
|
54
58
|
"engines": {
|
|
55
59
|
"node": ">=18",
|
|
@@ -76,21 +80,22 @@
|
|
|
76
80
|
"scripts": {
|
|
77
81
|
"build": "npm run clean && tsc --project tsconfig.build.json",
|
|
78
82
|
"clean": "rimraf build/",
|
|
79
|
-
"coverage": "jest --verbose --coverage
|
|
83
|
+
"coverage": "jest --verbose --coverage",
|
|
80
84
|
"fix": "gts fix",
|
|
81
85
|
"fix:package": "fixpack",
|
|
86
|
+
"if-api": "npx ts-node src/if-api/index.ts",
|
|
82
87
|
"if-check": "cross-env CURRENT_DIR=$(node -p \"process.env.INIT_CWD\") npx ts-node src/if-check/index.ts",
|
|
83
88
|
"if-csv": "cross-env CURRENT_DIR=$(node -p \"process.env.INIT_CWD\") npx ts-node src/if-csv/index.ts",
|
|
84
|
-
"if-diff": "npx ts-node src/if-diff/index.ts",
|
|
89
|
+
"if-diff": "cross-env CURRENT_DIR=$(node -p \"process.env.INIT_CWD\") npx ts-node src/if-diff/index.ts",
|
|
85
90
|
"if-env": "cross-env CURRENT_DIR=$(node -p \"process.env.INIT_CWD\") npx ts-node src/if-env/index.ts",
|
|
86
91
|
"if-merge": "cross-env CURRENT_DIR=$(node -p \"process.env.INIT_CWD\") npx ts-node src/if-merge/index.ts",
|
|
87
|
-
"if-run": "npx ts-node src/if-run/index.ts",
|
|
92
|
+
"if-run": "cross-env CURRENT_DIR=$(node -p \"process.env.INIT_CWD\") npx ts-node src/if-run/index.ts",
|
|
88
93
|
"lint": "gts lint",
|
|
89
94
|
"pre-commit": "lint-staged",
|
|
90
95
|
"prepare": "husky install",
|
|
91
96
|
"prepublishOnly": "npm run build",
|
|
92
97
|
"release": "release-it",
|
|
93
|
-
"test": "jest --verbose
|
|
98
|
+
"test": "jest --verbose"
|
|
94
99
|
},
|
|
95
100
|
"stability": "stable"
|
|
96
101
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
ARG BUILDBASEIMAGE=ghcr.io/green-software-foundation/if
|
|
2
|
+
ARG BASEIMAGE=node:18-slim
|
|
3
|
+
|
|
4
|
+
FROM --platform=$BUILDPLATFORM $BUILDBASEIMAGE AS deps
|
|
5
|
+
|
|
6
|
+
USER 0
|
|
7
|
+
|
|
8
|
+
ARG PLUGINS=plugins.txt
|
|
9
|
+
ARG NPMRC=.npmrc
|
|
10
|
+
|
|
11
|
+
# Install additional plugins
|
|
12
|
+
RUN --mount=src=.,target=settings \
|
|
13
|
+
--mount=type=cache,target=/root/.npm,sharing=locked \
|
|
14
|
+
if [ -r settings/$NPMRC -a -s settings/$NPMRC ]; then \
|
|
15
|
+
cp settings/$NPMRC /root/.npmrc; \
|
|
16
|
+
fi; \
|
|
17
|
+
npm install --no-fund $(cat settings/$PLUGINS); \
|
|
18
|
+
rm -f /root/.npmrc
|
|
19
|
+
|
|
20
|
+
# Remove devDependencies
|
|
21
|
+
RUN --mount=type=cache,target=/root/.npm,sharing=locked \
|
|
22
|
+
npm prune --ignore-scripts --omit=dev
|
|
23
|
+
|
|
24
|
+
# Remove empty directory
|
|
25
|
+
RUN rmdir --ignore-fail-on-non-empty node_modules/*
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
FROM $BASEIMAGE
|
|
29
|
+
|
|
30
|
+
# Packages to be installed
|
|
31
|
+
ARG PACKAGES='git ca-certificates'
|
|
32
|
+
|
|
33
|
+
# Install lsb_release, git and ca-certificates
|
|
34
|
+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
|
35
|
+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
|
36
|
+
apt-get update && \
|
|
37
|
+
apt-get --no-install-recommends install -y \
|
|
38
|
+
lsb-release $PACKAGES
|
|
39
|
+
|
|
40
|
+
# Copy entrypoint shell script
|
|
41
|
+
COPY --from=deps /usr/local/bin/docker-entrypoint.sh /usr/local/bin
|
|
42
|
+
|
|
43
|
+
# Set execution user
|
|
44
|
+
USER 1000
|
|
45
|
+
|
|
46
|
+
# Create application directory
|
|
47
|
+
WORKDIR /app
|
|
48
|
+
|
|
49
|
+
# Copy application and runtime dependencies
|
|
50
|
+
COPY --from=deps --chown=node:node /app .
|
|
51
|
+
|
|
52
|
+
# Set environment variables
|
|
53
|
+
ENV NODE_ENV=production NPM_CONFIG_UPDATE_NOTIFIER=false PATH=/app/node_modules/.bin:$PATH HOST=
|
|
54
|
+
|
|
55
|
+
# Expose port
|
|
56
|
+
EXPOSE 3000
|
|
57
|
+
|
|
58
|
+
# Run the application
|
|
59
|
+
CMD ["if-api"]
|