@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.
Files changed (319) hide show
  1. package/.dockerignore +10 -0
  2. package/CONTAINER.md +148 -0
  3. package/Dockerfile +73 -0
  4. package/HELM_CHART.md +96 -0
  5. package/README.md +56 -0
  6. package/bin/docker-entrypoint.sh +15 -0
  7. package/build/common/types/manifest.d.ts +1 -0
  8. package/build/common/types/manifest.js +1 -1
  9. package/build/common/util/debug-logger.js +4 -18
  10. package/build/common/util/helpers.d.ts +3 -2
  11. package/build/common/util/helpers.js +6 -18
  12. package/build/common/util/storage.d.ts +9 -0
  13. package/build/common/util/storage.js +24 -0
  14. package/build/if-api/config/config.d.ts +9 -0
  15. package/build/if-api/config/config.js +58 -0
  16. package/build/if-api/config/index.d.ts +2 -0
  17. package/build/if-api/config/index.js +8 -0
  18. package/build/if-api/config/strings.d.ts +16 -0
  19. package/build/if-api/config/strings.js +20 -0
  20. package/build/if-api/index.d.ts +2 -0
  21. package/build/if-api/index.js +268 -0
  22. package/build/if-api/types/process-args.d.ts +18 -0
  23. package/build/if-api/types/process-args.js +3 -0
  24. package/build/if-api/util/args.d.ts +5 -0
  25. package/build/if-api/util/args.js +42 -0
  26. package/build/if-check/index.js +1 -11
  27. package/build/if-check/util/npm.d.ts +1 -1
  28. package/build/if-check/util/npm.js +31 -74
  29. package/build/if-metadata-check/config/config.d.ts +5 -0
  30. package/build/if-metadata-check/config/config.js +26 -0
  31. package/build/if-metadata-check/config/strings.d.ts +5 -0
  32. package/build/if-metadata-check/config/strings.js +9 -0
  33. package/build/if-metadata-check/index.d.ts +2 -0
  34. package/build/if-metadata-check/index.js +30 -0
  35. package/build/if-metadata-check/types/plugin.d.ts +7 -0
  36. package/build/if-metadata-check/types/plugin.js +3 -0
  37. package/build/if-metadata-check/types/process-args.d.ts +5 -0
  38. package/build/if-metadata-check/types/process-args.js +3 -0
  39. package/build/if-metadata-check/util/args.d.ts +57 -0
  40. package/build/if-metadata-check/util/args.js +29 -0
  41. package/build/if-metadata-check/util/metadata-checker.d.ts +44 -0
  42. package/build/if-metadata-check/util/metadata-checker.js +99 -0
  43. package/build/if-run/builtins/divide/index.js +2 -2
  44. package/build/if-run/builtins/sci/index.js +2 -2
  45. package/build/if-run/config/strings.js +3 -3
  46. package/build/if-run/index.js +1 -1
  47. package/build/if-run/lib/aggregate.d.ts +2 -2
  48. package/build/if-run/lib/aggregate.js +5 -19
  49. package/build/if-run/lib/compute.d.ts +1 -1
  50. package/build/if-run/lib/compute.js +10 -9
  51. package/build/if-run/lib/environment.d.ts +5 -1
  52. package/build/if-run/lib/environment.js +30 -29
  53. package/build/if-run/lib/initialize.d.ts +12 -0
  54. package/build/if-run/lib/initialize.js +37 -3
  55. package/build/if-run/lib/regroup.d.ts +3 -2
  56. package/build/if-run/lib/regroup.js +13 -9
  57. package/build/if-run/types/compute.d.ts +1 -1
  58. package/build/if-run/types/compute.js +1 -1
  59. package/build/if-run/util/os-checker.js +14 -10
  60. package/helm-chart/.helmignore +23 -0
  61. package/helm-chart/Chart.yaml +24 -0
  62. package/helm-chart/templates/NOTES.txt +22 -0
  63. package/helm-chart/templates/_helpers.tpl +62 -0
  64. package/helm-chart/templates/additionalPlugins.yaml +13 -0
  65. package/helm-chart/templates/deployment.yaml +144 -0
  66. package/helm-chart/templates/disabledPlugins.yaml +11 -0
  67. package/helm-chart/templates/env-configmap.yaml +10 -0
  68. package/helm-chart/templates/env-secret.yaml +10 -0
  69. package/helm-chart/templates/hpa.yaml +32 -0
  70. package/helm-chart/templates/ingress.yaml +43 -0
  71. package/helm-chart/templates/npmrc.yaml +11 -0
  72. package/helm-chart/templates/service.yaml +24 -0
  73. package/helm-chart/templates/serviceaccount.yaml +13 -0
  74. package/helm-chart/templates/tests/test-connection.yaml +15 -0
  75. package/helm-chart/values.yaml +175 -0
  76. package/jest.config.js +6 -2
  77. package/manifests/examples/bugs/aggregation-error-wrong-metric.yml +173 -0
  78. package/manifests/examples/bugs/input-error-missing-duration.yml +25 -0
  79. package/manifests/examples/bugs/mock-observations-failure-duration-is-zero.yml +33 -0
  80. package/manifests/examples/bugs/pipeline-error-naming-mismatch.yml +32 -0
  81. package/manifests/examples/bugs/pipeline-error-uninitialized-plugin.yml +33 -0
  82. package/manifests/examples/bugs/pipeline-ordering-error.yml +91 -0
  83. package/manifests/examples/builtins/divide/success-denominator-equal-zero.yml +36 -0
  84. package/manifests/examples/builtins/mock-observations/failure-invalid-config-cpu-range.yml +0 -1
  85. package/manifests/examples/builtins/mock-observations/failure-invalid-memory-utilization-range.yml +0 -1
  86. package/manifests/examples/builtins/mock-observations/failure-missing-timestamp-from-param.yml +0 -1
  87. package/manifests/examples/builtins/mock-observations/success.yml +0 -1
  88. package/manifests/examples/builtins/sci/failure-invalid-config-value.yml +0 -1
  89. package/manifests/examples/builtins/sci/failure-missing-input-param.yml +0 -1
  90. package/manifests/examples/builtins/sci/success.yml +0 -1
  91. package/manifests/examples/builtins/sci-embodied/failure-invalid-default-emission-value.yml +22 -0
  92. package/manifests/examples/builtins/time-sync/failure-missing-config.yml +0 -2
  93. package/manifests/examples/builtins/time-sync/success.yml +0 -2
  94. package/manifests/examples/features/aggregate-failure-invalid-metrics.yml +50 -0
  95. package/manifests/examples/features/aggregate-failure-missing-metric-in-inputs.yml +50 -0
  96. package/manifests/examples/features/aggregate-horizontal.yml +58 -0
  97. package/manifests/examples/features/aggregate-vertical.yml +58 -0
  98. package/manifests/examples/features/aggregate.yml +58 -0
  99. package/manifests/examples/pipelines/cloud-metadata-divide.yml +36 -0
  100. package/manifests/examples/pipelines/pipeline-with-mocks.yml +0 -1
  101. package/manifests/examples/pipelines/scenario-5.yml +0 -1
  102. package/manifests/outputs/bugs/mock-observations-failure-duration-is-zero.yaml +0 -1
  103. package/manifests/outputs/builtins/mock-observations/failure-invalid-config-cpu-range.yaml +0 -1
  104. package/manifests/outputs/builtins/mock-observations/failure-invalid-memory-utilization-range.yaml +0 -1
  105. package/manifests/outputs/builtins/mock-observations/failure-missing-timestamp-from-param.yaml +0 -1
  106. package/manifests/outputs/builtins/sci/failure-invalid-config-value.yaml +0 -1
  107. package/manifests/outputs/builtins/sci/failure-missing-input-param.yaml +0 -1
  108. package/manifests/outputs/builtins/time-sync/failure-missing-config.yaml +0 -2
  109. package/manifests/outputs/features/regroup/success.yaml +72 -0
  110. package/manifests/outputs/pipelines/pipeline-with-aggregate.yaml +1291 -0
  111. package/manifests/outputs/pipelines/scenario-3.yaml +126 -0
  112. package/openapi.yaml +424 -0
  113. package/package.json +17 -12
  114. package/with-plugins/Dockerfile +59 -0
  115. package/.env +0 -5
  116. package/coverage/clover.xml +0 -2062
  117. package/coverage/coverage-final.json +0 -58
  118. package/coverage/lcov-report/base.css +0 -224
  119. package/coverage/lcov-report/block-navigation.js +0 -87
  120. package/coverage/lcov-report/builtins/coefficient/index.html +0 -116
  121. package/coverage/lcov-report/builtins/coefficient/index.ts.html +0 -298
  122. package/coverage/lcov-report/builtins/csv-lookup/index.html +0 -116
  123. package/coverage/lcov-report/builtins/csv-lookup/index.ts.html +0 -826
  124. package/coverage/lcov-report/builtins/divide/index.html +0 -116
  125. package/coverage/lcov-report/builtins/divide/index.ts.html +0 -358
  126. package/coverage/lcov-report/builtins/exponent/index.html +0 -116
  127. package/coverage/lcov-report/builtins/exponent/index.ts.html +0 -361
  128. package/coverage/lcov-report/builtins/export-csv-raw.ts.html +0 -553
  129. package/coverage/lcov-report/builtins/export-csv.ts.html +0 -436
  130. package/coverage/lcov-report/builtins/export-log.ts.html +0 -148
  131. package/coverage/lcov-report/builtins/export-yaml.ts.html +0 -193
  132. package/coverage/lcov-report/builtins/group-by.ts.html +0 -370
  133. package/coverage/lcov-report/builtins/index.html +0 -206
  134. package/coverage/lcov-report/builtins/index.ts.html +0 -130
  135. package/coverage/lcov-report/builtins/interpolation/index.html +0 -116
  136. package/coverage/lcov-report/builtins/interpolation/index.ts.html +0 -676
  137. package/coverage/lcov-report/builtins/interpolation/types.ts.html +0 -100
  138. package/coverage/lcov-report/builtins/mock-observations/helpers/common-generator.ts.html +0 -184
  139. package/coverage/lcov-report/builtins/mock-observations/helpers/index.html +0 -131
  140. package/coverage/lcov-report/builtins/mock-observations/helpers/rand-int-generator.ts.html +0 -289
  141. package/coverage/lcov-report/builtins/mock-observations/index.html +0 -116
  142. package/coverage/lcov-report/builtins/mock-observations/index.ts.html +0 -619
  143. package/coverage/lcov-report/builtins/multiply/index.html +0 -116
  144. package/coverage/lcov-report/builtins/multiply/index.ts.html +0 -343
  145. package/coverage/lcov-report/builtins/regex/index.html +0 -116
  146. package/coverage/lcov-report/builtins/regex/index.ts.html +0 -373
  147. package/coverage/lcov-report/builtins/sci/config.ts.html +0 -205
  148. package/coverage/lcov-report/builtins/sci/index.html +0 -116
  149. package/coverage/lcov-report/builtins/sci/index.ts.html +0 -325
  150. package/coverage/lcov-report/builtins/sci-embodied/index.html +0 -116
  151. package/coverage/lcov-report/builtins/sci-embodied/index.ts.html +0 -478
  152. package/coverage/lcov-report/builtins/shell/index.html +0 -116
  153. package/coverage/lcov-report/builtins/shell/index.ts.html +0 -280
  154. package/coverage/lcov-report/builtins/subtract/index.html +0 -116
  155. package/coverage/lcov-report/builtins/subtract/index.ts.html +0 -379
  156. package/coverage/lcov-report/builtins/sum/index.html +0 -116
  157. package/coverage/lcov-report/builtins/sum/index.ts.html +0 -334
  158. package/coverage/lcov-report/builtins/time-sync.ts.html +0 -1462
  159. package/coverage/lcov-report/common/config/index.html +0 -131
  160. package/coverage/lcov-report/common/config/index.ts.html +0 -88
  161. package/coverage/lcov-report/common/config/strings.ts.html +0 -121
  162. package/coverage/lcov-report/common/lib/index.html +0 -116
  163. package/coverage/lcov-report/common/lib/load.ts.html +0 -139
  164. package/coverage/lcov-report/common/util/debug-logger.ts.html +0 -514
  165. package/coverage/lcov-report/common/util/fs.ts.html +0 -289
  166. package/coverage/lcov-report/common/util/helpers.ts.html +0 -355
  167. package/coverage/lcov-report/common/util/index.html +0 -191
  168. package/coverage/lcov-report/common/util/logger.ts.html +0 -151
  169. package/coverage/lcov-report/common/util/validations.ts.html +0 -628
  170. package/coverage/lcov-report/common/util/yaml.ts.html +0 -226
  171. package/coverage/lcov-report/config/config.ts.html +0 -463
  172. package/coverage/lcov-report/config/index.html +0 -161
  173. package/coverage/lcov-report/config/index.ts.html +0 -94
  174. package/coverage/lcov-report/config/params.ts.html +0 -697
  175. package/coverage/lcov-report/config/strings.ts.html +0 -490
  176. package/coverage/lcov-report/favicon.png +0 -0
  177. package/coverage/lcov-report/if-check/config/config.ts.html +0 -184
  178. package/coverage/lcov-report/if-check/config/index.html +0 -146
  179. package/coverage/lcov-report/if-check/config/index.ts.html +0 -91
  180. package/coverage/lcov-report/if-check/config/strings.ts.html +0 -142
  181. package/coverage/lcov-report/if-check/util/args.ts.html +0 -310
  182. package/coverage/lcov-report/if-check/util/helpers.ts.html +0 -136
  183. package/coverage/lcov-report/if-check/util/index.html +0 -146
  184. package/coverage/lcov-report/if-check/util/npm.ts.html +0 -376
  185. package/coverage/lcov-report/if-csv/util/args.ts.html +0 -256
  186. package/coverage/lcov-report/if-csv/util/helpers.ts.html +0 -346
  187. package/coverage/lcov-report/if-csv/util/index.html +0 -131
  188. package/coverage/lcov-report/if-diff/config/config.ts.html +0 -184
  189. package/coverage/lcov-report/if-diff/config/index.html +0 -146
  190. package/coverage/lcov-report/if-diff/config/index.ts.html +0 -91
  191. package/coverage/lcov-report/if-diff/config/strings.ts.html +0 -100
  192. package/coverage/lcov-report/if-diff/lib/compare.ts.html +0 -286
  193. package/coverage/lcov-report/if-diff/lib/index.html +0 -131
  194. package/coverage/lcov-report/if-diff/lib/load.ts.html +0 -199
  195. package/coverage/lcov-report/if-diff/util/args.ts.html +0 -274
  196. package/coverage/lcov-report/if-diff/util/helpers.ts.html +0 -337
  197. package/coverage/lcov-report/if-diff/util/index.html +0 -131
  198. package/coverage/lcov-report/if-env/config/config.ts.html +0 -211
  199. package/coverage/lcov-report/if-env/config/index.html +0 -146
  200. package/coverage/lcov-report/if-env/config/index.ts.html +0 -91
  201. package/coverage/lcov-report/if-env/config/strings.ts.html +0 -109
  202. package/coverage/lcov-report/if-env/util/args.ts.html +0 -256
  203. package/coverage/lcov-report/if-env/util/index.html +0 -131
  204. package/coverage/lcov-report/if-env/util/npm.ts.html +0 -526
  205. package/coverage/lcov-report/if-merge/util/args.ts.html +0 -301
  206. package/coverage/lcov-report/if-merge/util/helpers.ts.html +0 -313
  207. package/coverage/lcov-report/if-merge/util/index.html +0 -131
  208. package/coverage/lcov-report/if-run/builtins/coefficient/index.html +0 -116
  209. package/coverage/lcov-report/if-run/builtins/coefficient/index.ts.html +0 -286
  210. package/coverage/lcov-report/if-run/builtins/copy-param/index.html +0 -116
  211. package/coverage/lcov-report/if-run/builtins/copy-param/index.ts.html +0 -301
  212. package/coverage/lcov-report/if-run/builtins/csv-import/index.html +0 -116
  213. package/coverage/lcov-report/if-run/builtins/csv-import/index.ts.html +0 -364
  214. package/coverage/lcov-report/if-run/builtins/csv-lookup/index.html +0 -116
  215. package/coverage/lcov-report/if-run/builtins/csv-lookup/index.ts.html +0 -478
  216. package/coverage/lcov-report/if-run/builtins/divide/index.html +0 -116
  217. package/coverage/lcov-report/if-run/builtins/divide/index.ts.html +0 -346
  218. package/coverage/lcov-report/if-run/builtins/exponent/index.html +0 -116
  219. package/coverage/lcov-report/if-run/builtins/exponent/index.ts.html +0 -319
  220. package/coverage/lcov-report/if-run/builtins/export-csv-raw.ts.html +0 -553
  221. package/coverage/lcov-report/if-run/builtins/export-csv.ts.html +0 -436
  222. package/coverage/lcov-report/if-run/builtins/export-log.ts.html +0 -148
  223. package/coverage/lcov-report/if-run/builtins/export-yaml.ts.html +0 -193
  224. package/coverage/lcov-report/if-run/builtins/group-by.ts.html +0 -370
  225. package/coverage/lcov-report/if-run/builtins/index.html +0 -146
  226. package/coverage/lcov-report/if-run/builtins/index.ts.html +0 -136
  227. package/coverage/lcov-report/if-run/builtins/interpolation/index.html +0 -116
  228. package/coverage/lcov-report/if-run/builtins/interpolation/index.ts.html +0 -643
  229. package/coverage/lcov-report/if-run/builtins/mock-observations/helpers/common-generator.ts.html +0 -184
  230. package/coverage/lcov-report/if-run/builtins/mock-observations/helpers/index.html +0 -131
  231. package/coverage/lcov-report/if-run/builtins/mock-observations/helpers/rand-int-generator.ts.html +0 -289
  232. package/coverage/lcov-report/if-run/builtins/mock-observations/index.html +0 -116
  233. package/coverage/lcov-report/if-run/builtins/mock-observations/index.ts.html +0 -607
  234. package/coverage/lcov-report/if-run/builtins/multiply/index.html +0 -116
  235. package/coverage/lcov-report/if-run/builtins/multiply/index.ts.html +0 -289
  236. package/coverage/lcov-report/if-run/builtins/regex/index.html +0 -116
  237. package/coverage/lcov-report/if-run/builtins/regex/index.ts.html +0 -298
  238. package/coverage/lcov-report/if-run/builtins/sci/index.html +0 -116
  239. package/coverage/lcov-report/if-run/builtins/sci/index.ts.html +0 -418
  240. package/coverage/lcov-report/if-run/builtins/sci-embodied/index.html +0 -116
  241. package/coverage/lcov-report/if-run/builtins/sci-embodied/index.ts.html +0 -664
  242. package/coverage/lcov-report/if-run/builtins/shell/index.html +0 -116
  243. package/coverage/lcov-report/if-run/builtins/shell/index.ts.html +0 -256
  244. package/coverage/lcov-report/if-run/builtins/subtract/index.html +0 -116
  245. package/coverage/lcov-report/if-run/builtins/subtract/index.ts.html +0 -298
  246. package/coverage/lcov-report/if-run/builtins/sum/index.html +0 -116
  247. package/coverage/lcov-report/if-run/builtins/sum/index.ts.html +0 -238
  248. package/coverage/lcov-report/if-run/builtins/time-converter/config.ts.html +0 -205
  249. package/coverage/lcov-report/if-run/builtins/time-converter/index.html +0 -131
  250. package/coverage/lcov-report/if-run/builtins/time-converter/index.ts.html +0 -328
  251. package/coverage/lcov-report/if-run/builtins/time-sync/index.html +0 -116
  252. package/coverage/lcov-report/if-run/builtins/time-sync/index.ts.html +0 -1804
  253. package/coverage/lcov-report/if-run/builtins/time-sync.ts.html +0 -1462
  254. package/coverage/lcov-report/if-run/builtins/util/csv-helpers.ts.html +0 -376
  255. package/coverage/lcov-report/if-run/builtins/util/index.html +0 -116
  256. package/coverage/lcov-report/if-run/config/config.ts.html +0 -271
  257. package/coverage/lcov-report/if-run/config/index.html +0 -161
  258. package/coverage/lcov-report/if-run/config/index.ts.html +0 -94
  259. package/coverage/lcov-report/if-run/config/params.ts.html +0 -679
  260. package/coverage/lcov-report/if-run/config/strings.ts.html +0 -460
  261. package/coverage/lcov-report/if-run/lib/aggregate.ts.html +0 -577
  262. package/coverage/lcov-report/if-run/lib/compute.ts.html +0 -733
  263. package/coverage/lcov-report/if-run/lib/environment.ts.html +0 -373
  264. package/coverage/lcov-report/if-run/lib/exhaust.ts.html +0 -193
  265. package/coverage/lcov-report/if-run/lib/explain.ts.html +0 -484
  266. package/coverage/lcov-report/if-run/lib/index.html +0 -206
  267. package/coverage/lcov-report/if-run/lib/initialize.ts.html +0 -490
  268. package/coverage/lcov-report/if-run/lib/parameterize.ts.html +0 -322
  269. package/coverage/lcov-report/if-run/lib/regroup.ts.html +0 -349
  270. package/coverage/lcov-report/if-run/lib/time-sync.ts.html +0 -1510
  271. package/coverage/lcov-report/if-run/types/aggregation.ts.html +0 -94
  272. package/coverage/lcov-report/if-run/types/index.html +0 -146
  273. package/coverage/lcov-report/if-run/types/interface.ts.html +0 -112
  274. package/coverage/lcov-report/if-run/types/parameters.ts.html +0 -106
  275. package/coverage/lcov-report/if-run/util/aggregation-helper.ts.html +0 -277
  276. package/coverage/lcov-report/if-run/util/args.ts.html +0 -325
  277. package/coverage/lcov-report/if-run/util/helpers.ts.html +0 -208
  278. package/coverage/lcov-report/if-run/util/index.html +0 -191
  279. package/coverage/lcov-report/if-run/util/json.ts.html +0 -115
  280. package/coverage/lcov-report/if-run/util/log-memoize.ts.html +0 -145
  281. package/coverage/lcov-report/if-run/util/os-checker.ts.html +0 -421
  282. package/coverage/lcov-report/if-run/util/plugin-storage.ts.html +0 -202
  283. package/coverage/lcov-report/index.html +0 -551
  284. package/coverage/lcov-report/lib/aggregate.ts.html +0 -358
  285. package/coverage/lcov-report/lib/compare.ts.html +0 -286
  286. package/coverage/lcov-report/lib/compute.ts.html +0 -436
  287. package/coverage/lcov-report/lib/environment.ts.html +0 -376
  288. package/coverage/lcov-report/lib/exhaust.ts.html +0 -289
  289. package/coverage/lcov-report/lib/index.html +0 -221
  290. package/coverage/lcov-report/lib/initialize.ts.html +0 -430
  291. package/coverage/lcov-report/lib/load.ts.html +0 -268
  292. package/coverage/lcov-report/lib/parameterize.ts.html +0 -316
  293. package/coverage/lcov-report/prettify.css +0 -1
  294. package/coverage/lcov-report/prettify.js +0 -2
  295. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  296. package/coverage/lcov-report/sorter.js +0 -196
  297. package/coverage/lcov-report/types/aggregation.ts.html +0 -94
  298. package/coverage/lcov-report/types/index.html +0 -146
  299. package/coverage/lcov-report/types/interface.ts.html +0 -112
  300. package/coverage/lcov-report/types/parameters.ts.html +0 -106
  301. package/coverage/lcov-report/util/aggregation-helper.ts.html +0 -289
  302. package/coverage/lcov-report/util/args.ts.html +0 -649
  303. package/coverage/lcov-report/util/debug-logger.ts.html +0 -481
  304. package/coverage/lcov-report/util/errors.ts.html +0 -232
  305. package/coverage/lcov-report/util/fs.ts.html +0 -124
  306. package/coverage/lcov-report/util/helpers.ts.html +0 -895
  307. package/coverage/lcov-report/util/index.html +0 -296
  308. package/coverage/lcov-report/util/json.ts.html +0 -115
  309. package/coverage/lcov-report/util/log-memoize.ts.html +0 -145
  310. package/coverage/lcov-report/util/logger.ts.html +0 -151
  311. package/coverage/lcov-report/util/npm.ts.html +0 -499
  312. package/coverage/lcov-report/util/os-checker.ts.html +0 -421
  313. package/coverage/lcov-report/util/plugin-storage.ts.html +0 -202
  314. package/coverage/lcov-report/util/validations.ts.html +0 -544
  315. package/coverage/lcov-report/util/yaml.ts.html +0 -193
  316. package/coverage/lcov.info +0 -3548
  317. package/manifests/outputs/builtins/interpolation/interpolation.yaml +0 -81
  318. package/manifests/outputs/features/failure-invalid-regroup.yaml +0 -87
  319. 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.1",
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
- "@commitlint/cli": "^18.6.0",
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": "^16.3.0",
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 --testPathPattern=src/__tests__/",
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 --testPathPattern=src/__tests__/"
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"]
package/.env DELETED
@@ -1,5 +0,0 @@
1
- # WATT_TIME_USERNAME=manushak
2
- # WATT_TIME_PASSWORD=S7Ub&_tNF=s{
3
-
4
- WATT_TIME_USERNAME=m_test
5
- WATT_TIME_PASSWORD=@watt-time17