@grnsft/if 0.6.0-beta.0 → 0.7.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 (354) hide show
  1. package/Refactor-migration-guide.md +68 -82
  2. package/github-processes.md +3 -9
  3. package/manifests/examples/builtins/coefficient/failure-invalid-config-input-param.yml +2 -4
  4. package/manifests/examples/builtins/coefficient/failure-output-param-is-null.yaml +1 -3
  5. package/manifests/examples/builtins/coefficient/success.yml +1 -3
  6. package/manifests/examples/builtins/csv-lookup/cloud-metadata/failure-invalid-instance-type.yaml +1 -2
  7. package/manifests/examples/builtins/csv-lookup/cloud-metadata/failure-invalid-vendor.yaml +3 -4
  8. package/manifests/examples/builtins/csv-lookup/cloud-metadata/failure-missing-cloud-vendor.yml +2 -3
  9. package/manifests/examples/builtins/csv-lookup/cloud-metadata/success.yml +1 -2
  10. package/manifests/examples/builtins/csv-lookup/region-metadata/failure-missing-column.yml +1 -1
  11. package/manifests/examples/builtins/csv-lookup/region-metadata/failure-missing-output.yml +2 -2
  12. package/manifests/examples/builtins/csv-lookup/region-metadata/success-renaming.yml +1 -1
  13. package/manifests/examples/builtins/csv-lookup/region-metadata/success.yml +1 -1
  14. package/manifests/examples/builtins/csv-lookup/tdp-finder/failure-missing-input-param.yml +1 -2
  15. package/manifests/examples/builtins/csv-lookup/tdp-finder/failure-unsupported-physical-processor.yml +1 -2
  16. package/manifests/examples/builtins/csv-lookup/tdp-finder/success.yml +1 -2
  17. package/manifests/examples/builtins/divide/failure-invalid-config-denominator.yml +3 -5
  18. package/manifests/examples/builtins/divide/failure-missing-numerator.yml +2 -4
  19. package/manifests/examples/builtins/divide/success.yml +2 -2
  20. package/manifests/examples/builtins/exponent/success.yml +1 -1
  21. package/manifests/examples/builtins/interpolation/success.yml +1 -1
  22. package/manifests/examples/builtins/mock-observations/failure-invalid-config-cpu-range.yml +2 -2
  23. package/manifests/examples/builtins/mock-observations/failure-invalid-memory-utilization-range.yml +1 -1
  24. package/manifests/examples/builtins/mock-observations/failure-missing-timestamp-from-param.yml +1 -1
  25. package/manifests/examples/builtins/mock-observations/success.yml +1 -1
  26. package/manifests/examples/builtins/multiply/failure-input-parameter-is-missing.yml +1 -1
  27. package/manifests/examples/builtins/multiply/success-with-multiple-inputs.yml +1 -1
  28. package/manifests/examples/builtins/multiply/success.yml +1 -1
  29. package/manifests/examples/builtins/regex/failure-missing-input-param.yml +1 -1
  30. package/manifests/examples/builtins/regex/failure-not-matching-with-regex.yml +2 -2
  31. package/manifests/examples/builtins/regex/success.yml +1 -1
  32. package/manifests/examples/builtins/sci/failure-invalid-config-value.yml +3 -4
  33. package/manifests/examples/builtins/sci/failure-missing-input-param.yml +1 -1
  34. package/manifests/examples/builtins/sci/success.yml +1 -1
  35. package/manifests/examples/builtins/sci-embodied/scenario-1.yml +27 -0
  36. package/manifests/examples/builtins/sci-embodied/scenario-2.yml +37 -0
  37. package/manifests/examples/builtins/sci-embodied/success.yml +13 -0
  38. package/manifests/examples/builtins/shell/failure-invalid-command.yml +2 -2
  39. package/manifests/examples/builtins/shell/success.yml +2 -2
  40. package/manifests/examples/builtins/subtract/success.yml +1 -1
  41. package/manifests/examples/builtins/sum/failure-missing-input-param.yml +2 -2
  42. package/manifests/examples/builtins/sum/failure-missing-output-param.yml +2 -2
  43. package/manifests/examples/builtins/sum/success.yml +1 -1
  44. package/manifests/examples/builtins/time-converter/success.yaml +24 -0
  45. package/manifests/examples/builtins/time-sync/failure-config-start-later-end.yml +10 -12
  46. package/manifests/examples/builtins/time-sync/{failure-missing-global-config.yml → failure-missing-config.yml} +3 -8
  47. package/manifests/examples/builtins/time-sync/success.yml +2 -2
  48. package/manifests/examples/features/regroup/failure-missing-cloud-instance-type.yml +1 -1
  49. package/manifests/examples/features/regroup/success.yml +1 -1
  50. package/manifests/examples/pipelines/generics.yml +8 -8
  51. package/manifests/examples/pipelines/instance-metadata.yml +2 -2
  52. package/manifests/examples/pipelines/nesting.yml +75 -33
  53. package/manifests/examples/pipelines/outputs-if-diff/pipeline-with-aggregate.yaml +166 -122
  54. package/manifests/examples/pipelines/outputs-if-diff/pipeline-with-mocks.yaml +130 -70
  55. package/manifests/examples/pipelines/pipeline-teads-sci.yml +15 -15
  56. package/manifests/examples/pipelines/pipeline-with-aggregate.yml +57 -27
  57. package/manifests/examples/pipelines/pipeline-with-mocks.yml +99 -41
  58. package/manifests/examples/pipelines/scenario-3.yml +1 -1
  59. package/manifests/examples/pipelines/scenario-4.yml +5 -5
  60. package/manifests/examples/pipelines/scenario-5.yml +3 -3
  61. package/manifests/examples/pipelines/sci.yml +12 -12
  62. package/manifests/examples/pipelines/teads-curve.yml +10 -10
  63. package/manifests/examples/pipelines/zeros.yml +23 -23
  64. package/manifests/outputs/bugs/aggregation-error-wrong-metric.yaml +40 -40
  65. package/manifests/outputs/bugs/input-error-missing-duration.yaml +1 -1
  66. package/manifests/outputs/bugs/mock-observations-failure-duration-is-zero.yaml +2 -2
  67. package/manifests/outputs/bugs/pipeline-error-naming-mismatch.yaml +1 -1
  68. package/manifests/outputs/bugs/pipeline-error-uninitialized-plugin.yaml +1 -1
  69. package/manifests/outputs/bugs/pipeline-ordering-error.yaml +6 -6
  70. package/manifests/outputs/builtins/coefficient/failure-invalid-config-input-param.yaml +2 -2
  71. package/manifests/outputs/builtins/coefficient/failure-output-param-is-null.yaml +1 -1
  72. package/manifests/outputs/builtins/coefficient/success.yaml +23 -22
  73. package/manifests/outputs/builtins/csv-lookup/cloud-metadata/failure-invalid-instance-type.yaml +1 -1
  74. package/manifests/outputs/builtins/csv-lookup/cloud-metadata/failure-invalid-vendor.yaml +76 -0
  75. package/manifests/outputs/builtins/csv-lookup/cloud-metadata/failure-missing-cloud-vendor.yaml +22 -21
  76. package/manifests/outputs/builtins/csv-lookup/cloud-metadata/success.yaml +1 -1
  77. package/manifests/outputs/builtins/csv-lookup/region-metadata/failure-missing-column.yaml +1 -1
  78. package/manifests/outputs/builtins/csv-lookup/region-metadata/failure-missing-output.yaml +21 -20
  79. package/manifests/outputs/builtins/csv-lookup/region-metadata/success-renaming.yaml +1 -1
  80. package/manifests/outputs/builtins/csv-lookup/region-metadata/success.yaml +1 -1
  81. package/manifests/outputs/builtins/csv-lookup/tdp-finder/failure-missing-input-param.yaml +1 -1
  82. package/manifests/outputs/builtins/csv-lookup/tdp-finder/failure-unsupported-physical-processor.yaml +1 -1
  83. package/manifests/outputs/builtins/csv-lookup/tdp-finder/success.yaml +1 -1
  84. package/manifests/outputs/builtins/divide/failure-invalid-config-denominator.yaml +41 -25
  85. package/manifests/outputs/builtins/divide/failure-missing-numerator.yaml +32 -23
  86. package/manifests/outputs/builtins/divide/success-denominator-equal-zero.yaml +2 -2
  87. package/manifests/outputs/builtins/divide/success.yaml +2 -2
  88. package/manifests/outputs/builtins/exponent/success.yaml +1 -1
  89. package/manifests/outputs/builtins/interpolation/interpolation.yaml +1 -1
  90. package/manifests/outputs/builtins/interpolation/success.yaml +1 -1
  91. package/manifests/outputs/builtins/mock-observations/failure-invalid-config-cpu-range.yaml +3 -3
  92. package/manifests/outputs/builtins/mock-observations/failure-invalid-memory-utilization-range.yaml +2 -2
  93. package/manifests/outputs/builtins/mock-observations/failure-missing-timestamp-from-param.yaml +1 -1
  94. package/manifests/outputs/builtins/mock-observations/success.yaml +49 -190
  95. package/manifests/outputs/builtins/multiply/failure-input-parameter-is-missing.yaml +1 -1
  96. package/manifests/outputs/builtins/multiply/success-with-multiple-inputs.yaml +1 -1
  97. package/manifests/outputs/builtins/multiply/success.yaml +1 -1
  98. package/manifests/outputs/builtins/regex/failure-missing-input-param.yaml +1 -1
  99. package/manifests/outputs/builtins/regex/failure-not-matching-with-regex.yaml +72 -0
  100. package/manifests/outputs/builtins/regex/success.yaml +1 -1
  101. package/manifests/outputs/builtins/sci/failure-invalid-config-value.yaml +22 -23
  102. package/manifests/outputs/builtins/sci/failure-missing-input-param.yaml +1 -1
  103. package/manifests/outputs/builtins/sci/success.yaml +1 -1
  104. package/manifests/outputs/builtins/sci-embodied/failure-invalid-default-emission-value.yaml +22 -26
  105. package/manifests/outputs/builtins/sci-embodied/scenario-1.yaml +100 -0
  106. package/manifests/outputs/builtins/sci-embodied/scenario-2.yaml +101 -0
  107. package/manifests/outputs/builtins/sci-embodied/success.yaml +44 -20
  108. package/manifests/outputs/builtins/shell/failure-invalid-command.yaml +2 -2
  109. package/manifests/outputs/builtins/shell/success.yaml +1 -1
  110. package/manifests/outputs/builtins/subtract/success.yaml +1 -1
  111. package/manifests/outputs/builtins/sum/failure-missing-input-param.yaml +2 -2
  112. package/manifests/outputs/builtins/sum/failure-missing-output-param.yaml +2 -2
  113. package/manifests/outputs/builtins/sum/success.yaml +1 -1
  114. package/manifests/outputs/builtins/time-converter/success.yaml +73 -0
  115. package/manifests/outputs/builtins/time-sync/failure-config-start-later-end.yaml +3 -3
  116. package/manifests/outputs/builtins/time-sync/failure-missing-config.yaml +74 -0
  117. package/manifests/outputs/builtins/time-sync/success.yaml +50 -59
  118. package/manifests/outputs/features/aggregate-failure-invalid-metrics.yaml +1 -1
  119. package/manifests/outputs/features/aggregate-failure-missing-metric-in-inputs.yaml +1 -1
  120. package/manifests/outputs/features/aggregate-horizontal.yaml +4 -2
  121. package/manifests/outputs/features/aggregate-vertical.yaml +4 -2
  122. package/manifests/outputs/features/aggregate.yaml +4 -2
  123. package/manifests/outputs/features/regroup/failure-invalid-regroup.yaml +87 -0
  124. package/manifests/outputs/features/regroup/failure-missing-cloud-instance-type.yaml +87 -0
  125. package/manifests/outputs/pipelines/cloud-metadata-divide.yaml +2 -2
  126. package/manifests/outputs/pipelines/generics.yaml +28 -28
  127. package/manifests/outputs/pipelines/instance-metadata.yaml +14 -14
  128. package/manifests/outputs/pipelines/nesting.yaml +713 -486
  129. package/manifests/outputs/pipelines/pipeline-teads-sci.yaml +63 -32
  130. package/manifests/outputs/pipelines/scenario-4.yaml +105 -0
  131. package/manifests/outputs/pipelines/sci.yaml +56 -32
  132. package/manifests/outputs/pipelines/teads-curve.yaml +18 -18
  133. package/manifests/outputs/pipelines/zeros.yaml +27 -27
  134. package/package.json +7 -5
  135. package/src/__mocks__/mock-manifest.yaml +1 -2
  136. package/src/if-env/config/env-template.yml +1 -2
  137. package/src/if-run/builtins/coefficient/README.md +41 -17
  138. package/src/if-run/builtins/copy-param/README.md +28 -8
  139. package/src/if-run/builtins/csv-lookup/README.md +31 -11
  140. package/src/if-run/builtins/divide/README.md +34 -12
  141. package/src/if-run/builtins/exponent/README.md +29 -11
  142. package/src/if-run/builtins/interpolation/README.md +37 -22
  143. package/src/if-run/builtins/mock-observations/README.md +27 -7
  144. package/src/if-run/builtins/multiply/README.md +27 -9
  145. package/src/if-run/builtins/regex/README.md +31 -11
  146. package/src/if-run/builtins/sci/README.md +29 -8
  147. package/src/if-run/builtins/sci-embodied/README.md +76 -75
  148. package/src/if-run/builtins/shell/README.md +15 -7
  149. package/src/if-run/builtins/subtract/README.md +28 -11
  150. package/src/if-run/builtins/sum/README.md +47 -14
  151. package/src/if-run/builtins/time-converter/README.md +136 -0
  152. package/src/if-run/builtins/time-sync/README.md +44 -22
  153. package/.gitmodules +0 -3
  154. package/build/common/config/index.d.ts +0 -1
  155. package/build/common/config/index.js +0 -6
  156. package/build/common/config/strings.d.ts +0 -8
  157. package/build/common/config/strings.js +0 -16
  158. package/build/common/lib/load.d.ts +0 -6
  159. package/build/common/lib/load.js +0 -18
  160. package/build/common/types/manifest.d.ts +0 -13
  161. package/build/common/types/manifest.js +0 -3
  162. package/build/common/util/debug-logger.d.ts +0 -4
  163. package/build/common/util/debug-logger.js +0 -115
  164. package/build/common/util/fs.d.ts +0 -20
  165. package/build/common/util/fs.js +0 -94
  166. package/build/common/util/helpers.d.ts +0 -15
  167. package/build/common/util/helpers.js +0 -80
  168. package/build/common/util/logger.d.ts +0 -5
  169. package/build/common/util/logger.js +0 -39
  170. package/build/common/util/validations.d.ts +0 -367
  171. package/build/common/util/validations.js +0 -141
  172. package/build/common/util/yaml.d.ts +0 -12
  173. package/build/common/util/yaml.js +0 -59
  174. package/build/if-check/config/config.d.ts +0 -6
  175. package/build/if-check/config/config.js +0 -31
  176. package/build/if-check/config/index.d.ts +0 -2
  177. package/build/if-check/config/index.js +0 -8
  178. package/build/if-check/config/strings.d.ts +0 -12
  179. package/build/if-check/config/strings.js +0 -16
  180. package/build/if-check/index.d.ts +0 -2
  181. package/build/if-check/index.js +0 -98
  182. package/build/if-check/types/process-args.d.ts +0 -4
  183. package/build/if-check/types/process-args.js +0 -3
  184. package/build/if-check/util/args.d.ts +0 -10
  185. package/build/if-check/util/args.js +0 -56
  186. package/build/if-check/util/helpers.d.ts +0 -4
  187. package/build/if-check/util/helpers.js +0 -18
  188. package/build/if-check/util/npm.d.ts +0 -4
  189. package/build/if-check/util/npm.js +0 -59
  190. package/build/if-csv/config/config.d.ts +0 -6
  191. package/build/if-csv/config/config.js +0 -37
  192. package/build/if-csv/config/index.d.ts +0 -2
  193. package/build/if-csv/config/index.js +0 -8
  194. package/build/if-csv/config/strings.d.ts +0 -4
  195. package/build/if-csv/config/strings.js +0 -8
  196. package/build/if-csv/index.d.ts +0 -2
  197. package/build/if-csv/index.js +0 -63
  198. package/build/if-csv/types/csv.d.ts +0 -7
  199. package/build/if-csv/types/csv.js +0 -3
  200. package/build/if-csv/types/process-args.d.ts +0 -5
  201. package/build/if-csv/types/process-args.js +0 -3
  202. package/build/if-csv/util/args.d.ts +0 -12
  203. package/build/if-csv/util/args.js +0 -51
  204. package/build/if-csv/util/helpers.d.ts +0 -9
  205. package/build/if-csv/util/helpers.js +0 -95
  206. package/build/if-diff/config/config.d.ts +0 -6
  207. package/build/if-diff/config/config.js +0 -31
  208. package/build/if-diff/config/index.d.ts +0 -2
  209. package/build/if-diff/config/index.js +0 -8
  210. package/build/if-diff/config/strings.d.ts +0 -6
  211. package/build/if-diff/config/strings.js +0 -10
  212. package/build/if-diff/index.d.ts +0 -2
  213. package/build/if-diff/index.js +0 -46
  214. package/build/if-diff/lib/compare.d.ts +0 -10
  215. package/build/if-diff/lib/compare.js +0 -56
  216. package/build/if-diff/lib/load.d.ts +0 -55
  217. package/build/if-diff/lib/load.js +0 -51
  218. package/build/if-diff/types/args.d.ts +0 -5
  219. package/build/if-diff/types/args.js +0 -3
  220. package/build/if-diff/types/compare.d.ts +0 -7
  221. package/build/if-diff/types/compare.js +0 -3
  222. package/build/if-diff/types/process-args.d.ts +0 -4
  223. package/build/if-diff/types/process-args.js +0 -3
  224. package/build/if-diff/util/args.d.ts +0 -5
  225. package/build/if-diff/util/args.js +0 -51
  226. package/build/if-diff/util/helpers.d.ts +0 -13
  227. package/build/if-diff/util/helpers.js +0 -75
  228. package/build/if-env/config/config.d.ts +0 -6
  229. package/build/if-env/config/config.js +0 -37
  230. package/build/if-env/config/index.d.ts +0 -2
  231. package/build/if-env/config/index.js +0 -8
  232. package/build/if-env/config/strings.d.ts +0 -7
  233. package/build/if-env/config/strings.js +0 -11
  234. package/build/if-env/index.d.ts +0 -2
  235. package/build/if-env/index.js +0 -40
  236. package/build/if-env/types/if-env.d.ts +0 -8
  237. package/build/if-env/types/if-env.js +0 -3
  238. package/build/if-env/types/npm.d.ts +0 -9
  239. package/build/if-env/types/npm.js +0 -3
  240. package/build/if-env/types/process-args.d.ts +0 -5
  241. package/build/if-env/types/process-args.js +0 -3
  242. package/build/if-env/util/args.d.ts +0 -12
  243. package/build/if-env/util/args.js +0 -47
  244. package/build/if-env/util/helpers.d.ts +0 -20
  245. package/build/if-env/util/helpers.js +0 -94
  246. package/build/if-env/util/npm.d.ts +0 -24
  247. package/build/if-env/util/npm.js +0 -126
  248. package/build/if-run/builtins/coefficient/index.d.ts +0 -2
  249. package/build/if-run/builtins/coefficient/index.js +0 -67
  250. package/build/if-run/builtins/copy-param/index.d.ts +0 -2
  251. package/build/if-run/builtins/copy-param/index.js +0 -70
  252. package/build/if-run/builtins/csv-lookup/index.d.ts +0 -2
  253. package/build/if-run/builtins/csv-lookup/index.js +0 -190
  254. package/build/if-run/builtins/divide/index.d.ts +0 -2
  255. package/build/if-run/builtins/divide/index.js +0 -80
  256. package/build/if-run/builtins/exponent/index.d.ts +0 -2
  257. package/build/if-run/builtins/exponent/index.js +0 -60
  258. package/build/if-run/builtins/export-log.d.ts +0 -4
  259. package/build/if-run/builtins/export-log.js +0 -44
  260. package/build/if-run/builtins/export-yaml.d.ts +0 -4
  261. package/build/if-run/builtins/export-yaml.js +0 -30
  262. package/build/if-run/builtins/index.d.ts +0 -15
  263. package/build/if-run/builtins/index.js +0 -34
  264. package/build/if-run/builtins/interpolation/index.d.ts +0 -2
  265. package/build/if-run/builtins/interpolation/index.js +0 -151
  266. package/build/if-run/builtins/mock-observations/helpers/common-generator.d.ts +0 -3
  267. package/build/if-run/builtins/mock-observations/helpers/common-generator.js +0 -29
  268. package/build/if-run/builtins/mock-observations/helpers/rand-int-generator.d.ts +0 -3
  269. package/build/if-run/builtins/mock-observations/helpers/rand-int-generator.js +0 -48
  270. package/build/if-run/builtins/mock-observations/index.d.ts +0 -2
  271. package/build/if-run/builtins/mock-observations/index.js +0 -116
  272. package/build/if-run/builtins/mock-observations/interfaces/index.d.ts +0 -6
  273. package/build/if-run/builtins/mock-observations/interfaces/index.js +0 -3
  274. package/build/if-run/builtins/multiply/index.d.ts +0 -2
  275. package/build/if-run/builtins/multiply/index.js +0 -59
  276. package/build/if-run/builtins/regex/index.d.ts +0 -2
  277. package/build/if-run/builtins/regex/index.js +0 -76
  278. package/build/if-run/builtins/sci/config.d.ts +0 -1
  279. package/build/if-run/builtins/sci/config.js +0 -44
  280. package/build/if-run/builtins/sci/index.d.ts +0 -2
  281. package/build/if-run/builtins/sci/index.js +0 -92
  282. package/build/if-run/builtins/sci-embodied/index.d.ts +0 -2
  283. package/build/if-run/builtins/sci-embodied/index.js +0 -156
  284. package/build/if-run/builtins/shell/index.d.ts +0 -2
  285. package/build/if-run/builtins/shell/index.js +0 -60
  286. package/build/if-run/builtins/subtract/index.d.ts +0 -2
  287. package/build/if-run/builtins/subtract/index.js +0 -61
  288. package/build/if-run/builtins/sum/index.d.ts +0 -2
  289. package/build/if-run/builtins/sum/index.js +0 -66
  290. package/build/if-run/builtins/time-sync/index.d.ts +0 -17
  291. package/build/if-run/builtins/time-sync/index.js +0 -339
  292. package/build/if-run/config/config.d.ts +0 -9
  293. package/build/if-run/config/config.js +0 -73
  294. package/build/if-run/config/index.d.ts +0 -2
  295. package/build/if-run/config/index.js +0 -8
  296. package/build/if-run/config/strings.d.ts +0 -64
  297. package/build/if-run/config/strings.js +0 -76
  298. package/build/if-run/index.d.ts +0 -2
  299. package/build/if-run/index.js +0 -63
  300. package/build/if-run/lib/aggregate.d.ts +0 -15
  301. package/build/if-run/lib/aggregate.js +0 -123
  302. package/build/if-run/lib/compute.d.ts +0 -5
  303. package/build/if-run/lib/compute.js +0 -136
  304. package/build/if-run/lib/environment.d.ts +0 -5
  305. package/build/if-run/lib/environment.js +0 -75
  306. package/build/if-run/lib/exhaust.d.ts +0 -7
  307. package/build/if-run/lib/exhaust.js +0 -27
  308. package/build/if-run/lib/explain.d.ts +0 -9
  309. package/build/if-run/lib/explain.js +0 -43
  310. package/build/if-run/lib/initialize.d.ts +0 -6
  311. package/build/if-run/lib/initialize.js +0 -109
  312. package/build/if-run/lib/regroup.d.ts +0 -5
  313. package/build/if-run/lib/regroup.js +0 -64
  314. package/build/if-run/types/aggregation.d.ts +0 -5
  315. package/build/if-run/types/aggregation.js +0 -6
  316. package/build/if-run/types/compute.d.ts +0 -29
  317. package/build/if-run/types/compute.js +0 -3
  318. package/build/if-run/types/environment.d.ts +0 -18
  319. package/build/if-run/types/environment.js +0 -3
  320. package/build/if-run/types/exhaust-plugin-interface.d.ts +0 -7
  321. package/build/if-run/types/exhaust-plugin-interface.js +0 -3
  322. package/build/if-run/types/explain.d.ts +0 -10
  323. package/build/if-run/types/explain.js +0 -3
  324. package/build/if-run/types/interface.d.ts +0 -3
  325. package/build/if-run/types/interface.js +0 -6
  326. package/build/if-run/types/plugin-storage.d.ts +0 -6
  327. package/build/if-run/types/plugin-storage.js +0 -3
  328. package/build/if-run/types/process-args.d.ts +0 -25
  329. package/build/if-run/types/process-args.js +0 -3
  330. package/build/if-run/types/time-sync.d.ts +0 -17
  331. package/build/if-run/types/time-sync.js +0 -3
  332. package/build/if-run/util/aggregation-helper.d.ts +0 -7
  333. package/build/if-run/util/aggregation-helper.js +0 -47
  334. package/build/if-run/util/args.d.ts +0 -9
  335. package/build/if-run/util/args.js +0 -60
  336. package/build/if-run/util/helpers.d.ts +0 -14
  337. package/build/if-run/util/helpers.js +0 -57
  338. package/build/if-run/util/log-memoize.d.ts +0 -3
  339. package/build/if-run/util/log-memoize.js +0 -19
  340. package/build/if-run/util/os-checker.d.ts +0 -7
  341. package/build/if-run/util/os-checker.js +0 -97
  342. package/build/if-run/util/plugin-storage.d.ts +0 -14
  343. package/build/if-run/util/plugin-storage.js +0 -34
  344. package/grafana/IF_GRAFANA_SETUP.md +0 -71
  345. package/grafana/if_grafana_config.json +0 -370
  346. package/manifests/examples/builtins/divide/failure-denominator-equal-zero.yml +0 -38
  347. package/manifests/examples/builtins/interpolation/interpolation.yml +0 -24
  348. package/manifests/examples/builtins/sci-embodied/failure-invalid-default-emission-value.yml +0 -23
  349. package/manifests/examples/builtins/sci-embodied/failure-missing-expected-lifespan.yml +0 -23
  350. package/manifests/examples/pipelines/scenario-1.yml +0 -34
  351. package/manifests/examples/pipelines/scenario-2.yml +0 -52
  352. package/manifests/outputs/bugs/sci-embodied-missing-resources-total.yaml +0 -72
  353. package/manifests/outputs/builtins/sci-embodied/failure-missing-expected-lifespan.yaml +0 -69
  354. package/manifests/outputs/pipelines/mock-obs-time-sync.yaml +0 -449
@@ -10,7 +10,7 @@ For example, you use `cpu/energy` as base and `network/energy` as and name the r
10
10
 
11
11
  ### Plugin config
12
12
 
13
- Three parameters are required in global config: `input-parameter`, `exponent` and `output-parameter`.
13
+ Three parameters are required in config: `input-parameter`, `exponent` and `output-parameter`.
14
14
 
15
15
  `input-parameter`: a string defining the base. Must match an existing key in the `inputs` array
16
16
  `exponent`: a number defining the exponent.
@@ -20,16 +20,32 @@ Three parameters are required in global config: `input-parameter`, `exponent` an
20
20
 
21
21
  The `parameter-metadata` section contains information about `description`, `unit` and `aggregation-method` of the parameters of the inputs and outputs
22
22
 
23
- - `inputs`: describe the parameter of the `input-parameter` of the global config. The parameter has the following attributes:
23
+ - `inputs`: describe the parameter of the `input-parameter` of the config. The parameter has the following attributes:
24
24
 
25
25
  - `description`: description of the parameter
26
26
  - `unit`: unit of the parameter
27
- - `aggregation-method`: aggregation method of the parameter (it can be `sum`, `avg` or `none`)
27
+ - `aggregation-method`: aggregation method object of the parameter
28
+ - `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
29
+ - `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
28
30
 
29
- - `outputs`: describe the parameter of the `output-parameter` of the global config. The parameter has the following attributes::
31
+ - `outputs`: describe the parameter of the `output-parameter` of the config. The parameter has the following attributes:
30
32
  - `description`: description of the parameter
31
33
  - `unit`: unit of the parameter
32
- - `aggregation-method`: aggregation method of the parameter (it can be `sum`, `avg` or `none`)
34
+ - `aggregation-method`: aggregation method object of the parameter
35
+ - `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
36
+ - `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
37
+
38
+ ### Mapping
39
+
40
+ The `mapping` block is an optional block. It is added in the plugin section and allows the plugin to receive a parameter from the input with a different name than the one the plugin uses for data manipulation. The parameter with the mapped name will not appear in the outputs. It also maps the output parameter of the plugin. The structure of the `mapping` block is:
41
+
42
+ ```yaml
43
+ exponent:
44
+ method: Exponent
45
+ path: 'builtin'
46
+ mapping:
47
+ 'parameter-name-in-the-plugin': 'parameter-name-in-the-input'
48
+ ```
33
49
 
34
50
  ### Inputs
35
51
 
@@ -37,7 +53,7 @@ The `parameter-metadata` section contains information about `description`, `unit
37
53
 
38
54
  ## Returns
39
55
 
40
- - `output-parameter`: `input-parameter` raised by `exponent` with the parameter name defined by `output-parameter` in global config.
56
+ - `output-parameter`: `input-parameter` raised by `exponent` with the parameter name defined by `output-parameter` in config.
41
57
 
42
58
  ## Calculation
43
59
 
@@ -53,12 +69,14 @@ To run the plugin, you must first create an instance of `Exponent`. Then, you ca
53
69
  import {Exponent} from 'builtins';
54
70
 
55
71
  const config = {
56
- inputParameter: ['cpu/energy'],
57
- exponent: 2
58
- outputParameter: 'energy',
72
+ inputParameter: ['cpu/energy'],
73
+ exponent: 2
74
+ outputParameter: 'energy',
59
75
  };
76
+ const parametersMetadata = {inputs: {}, outputs: {}};
77
+ const mapping = {};
60
78
 
61
- const exponent = Exponent(config);
79
+ const exponent = Exponent(config, parametersMetadata, mapping);
62
80
  const result = await exponent.execute([
63
81
  {
64
82
  duration: 3600,
@@ -82,7 +100,7 @@ initialize:
82
100
  exponent:
83
101
  method: Exponent
84
102
  path: 'builtin'
85
- global-config:
103
+ config:
86
104
  input-parameter: 'cpu/energy'
87
105
  exponent: 2
88
106
  output-parameter: 'energy'
@@ -9,13 +9,13 @@ This plugin provides the `y` value at a given `x` by interpolating between known
9
9
 
10
10
  To employ the `Interpolation` plugin, adhere to these steps:
11
11
 
12
- 1. **Initialize Plugin**: Import the `Interpolation` function and initialize it with global configuration parameters `method`, `x`, `y`, `input-parameter` and `output-parameter`.
12
+ 1. **Initialize Plugin**: Import the `Interpolation` function and initialize it with configuration parameters `method`, `x`, `y`, `input-parameter` and `output-parameter`.
13
13
 
14
14
  2. **Execute Plugin**: Invoke the `execute` method of the initialized plugin instance with an array of input parameters. Each input parameter should include a `timestamp`, `duration` and `[input-parameter]` information.
15
15
 
16
16
  3. **Result**: The plugin will return an array of plugin parameters enriched with the calculated average carbon intensity for each input.
17
17
 
18
- ## Global Config
18
+ ## Config
19
19
 
20
20
  - `method`: specifies the interpolation method for the data. Acceptable values are 'linear', 'spline', or 'polynomial'. The default method is linear. (optional)
21
21
  - `x`: array of x points. Numbers should be in ascending order (required).
@@ -29,16 +29,32 @@ To employ the `Interpolation` plugin, adhere to these steps:
29
29
 
30
30
  The `parameter-metadata` section contains information about `description`, `unit` and `aggregation-method` of the parameters of the inputs and outputs
31
31
 
32
- - `inputs`: describe the parameter of the `input-parameter` of the global config. The parameter has the following attributes:
32
+ - `inputs`: describe the parameter of the `input-parameter` of the config. The parameter has the following attributes:
33
33
 
34
34
  - `description`: description of the parameter
35
35
  - `unit`: unit of the parameter
36
- - `aggregation-method`: aggregation method of the parameter (it can be `sum`, `avg` or `none`)
36
+ - `aggregation-method`: aggregation method object of the parameter
37
+ - `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
38
+ - `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
37
39
 
38
- - `outputs`: describe the parameters of the `output-parameter` of the global config. The parameter has the following attributes:
40
+ - `outputs`: describe the parameters of the `output-parameter` of the config. The parameter has the following attributes:
39
41
  - `description`: description of the parameter
40
42
  - `unit`: unit of the parameter
41
- - `aggregation-method`: aggregation method of the parameter (it can be `sum`, `avg` or `none`)
43
+ - `aggregation-method`: aggregation method object of the parameter
44
+ - `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
45
+ - `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
46
+
47
+ ### Mapping
48
+
49
+ The `mapping` block is an optional block. It is added in the plugin section and allows the plugin to receive a parameter from the input with a different name than the one the plugin uses for data manipulation. The parameter with the mapped name will not appear in the outputs. It also maps the output parameter of the plugin. The structure of the `mapping` block is:
50
+
51
+ ```yaml
52
+ interpolation:
53
+ method: Interpolation
54
+ path: 'builtin'
55
+ mapping:
56
+ 'parameter-name-in-the-plugin': 'parameter-name-in-the-input'
57
+ ```
42
58
 
43
59
  ## Input Parameters
44
60
 
@@ -46,7 +62,7 @@ The plugin expects the following input parameters:
46
62
 
47
63
  - `timestamp`: a timestamp for the input (required)
48
64
  - `duration`: the amount of time, in seconds, that the input covers. (required)
49
- - `[input-parameter]` - a field whose name matches the string provided to input-parameter in global config (i.e. if the input-parameter in global config is cpu/utilisation then cpu-utilisation must exist in the input data)
65
+ - `[input-parameter]` - a field whose name matches the string provided to input-parameter in config (i.e. if the input-parameter in config is cpu/utilisation then cpu-utilisation must exist in the input data)
50
66
 
51
67
  ## Output
52
68
 
@@ -60,7 +76,7 @@ The plugin conducts input validation using the `zod` library and may throw error
60
76
 
61
77
  1. **Execution**:
62
78
 
63
- - Validate Global config
79
+ - Validate config
64
80
 
65
81
  - `method` - validates if the method is one of these methods: `linear`, `spline`, or `polynomial`. If the method isn’t provided, it sets to `linear`.
66
82
  - `x` and `y` should be arrays of numbers, the length should be equal, and elements should be ordered in the ascendant order.
@@ -84,28 +100,27 @@ The plugin conducts input validation using the `zod` library and may throw error
84
100
  ### TypeScript Usage
85
101
 
86
102
  ```ts
87
- const globalConfig = {
103
+ const config = {
88
104
  method: 'linear',
89
105
  x: [0, 10, 50, 100],
90
106
  y: [0.12, 0.32, 0.75, 1.02],
91
- 'input-parameter': 'cpu/utilization'
92
- 'output-parameter': 'cpu/energy'
93
-
107
+ 'input-parameter': 'cpu/utilization',
108
+ 'output-parameter': 'cpu/energy',
94
109
  };
95
-
96
- const interpolationPlugin = Interpolation(globalConfig);
110
+ const parametersMetadata = {inputs: {}, outputs: {}};
111
+ const interpolationPlugin = Interpolation(config, parametersMetadata, {});
97
112
 
98
113
  const inputs = [
99
114
  {
100
115
  timestamp: '2024-04-16T12:00:00Z',
101
116
  duration: 3600,
102
- 'cpu/utilization': 45
117
+ 'cpu/utilization': 45,
103
118
  },
104
119
  ];
105
120
 
106
- const results = interpolationPlugin.execute(inputs);
121
+ const result = await interpolationPlugin.execute(inputs);
107
122
 
108
- console.log(results);
123
+ console.log(result);
109
124
  ```
110
125
 
111
126
  ### Manifest Usage
@@ -121,7 +136,7 @@ initialize:
121
136
  interpolation:
122
137
  method: Interpolation
123
138
  path: 'builtin'
124
- global-config:
139
+ config:
125
140
  method: linear
126
141
  x: [0, 10, 50, 100]
127
142
  y: [0.12, 0.32, 0.75, 1.02]
@@ -150,7 +165,7 @@ initialize:
150
165
  interpolation:
151
166
  method: Interpolation
152
167
  path: 'builtin'
153
- global-config:
168
+ config:
154
169
  method: linear
155
170
  x: [0, 10, 50, 100]
156
171
  y: [0.12, 0.32, 0.75, 1.02]
@@ -184,11 +199,11 @@ if-run --manifest ./manifests/examples/interpolation.yml --output ./manifests/ou
184
199
 
185
200
  `Interpolation` exposes one of IF's error classes.
186
201
 
187
- ## `GlobalConfigError`
202
+ ## `ConfigError`
188
203
 
189
- ### GlobalConfigError
204
+ ### ConfigError
190
205
 
191
- You will receive an error starting `GlobalConfigError: ` if you have not provided the expected configuration data in the plugin's `initialize` block.
206
+ You will receive an error starting `ConfigError: ` if you have not provided the expected configuration data in the plugin's `initialize` block.
192
207
 
193
208
  The required parameters are:
194
209
 
@@ -11,7 +11,7 @@ The mode currently mocks 2 types of observation data:
11
11
  - Common key-value pairs, that are generated statically and are the same for each generated observation/input (see 'helpers/CommonGenerator.ts')
12
12
  - Randomly generated integer values for predefined keys (see 'helpers/RandIntGenerator.ts')
13
13
 
14
- ### Plugin global config
14
+ ### Plugin config
15
15
 
16
16
  - `timestamp-from`, `timestamp-to` and `duration` define time buckets for which to generate observations.
17
17
  - `generators` define which fields to generate for each observation
@@ -25,12 +25,29 @@ The `parameter-metadata` section contains information about `description`, `unit
25
25
 
26
26
  - `description`: description of the parameter
27
27
  - `unit`: unit of the parameter
28
- - `aggregation-method`: aggregation method of the parameter (it can be `sum`, `avg` or `none`)
28
+ - `aggregation-method`: aggregation method object of the parameter
29
+ - `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
30
+ - `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
29
31
 
30
32
  - `outputs`: describe the output parameters. The parameter has the following attributes:
31
33
  - `description`: description of the parameter
32
34
  - `unit`: unit of the parameter
33
- - `aggregation-method`: aggregation method of the parameter (it can be `sum`, `avg` or `none`)
35
+ - `aggregation-method`: aggregation method object of the parameter
36
+ - `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
37
+ - `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
38
+
39
+ ### Mapping
40
+
41
+ The `mapping` block is an optional block. It is added in the plugin section and allows the plugin to receive a parameter from the input with a different name than the one the plugin uses for data manipulation. The parameter with the mapped name will not appear in the outputs. It also maps the output parameter of the plugin. The structure of the `mapping` block is:
42
+
43
+ ```yaml
44
+ mock-observations:
45
+ kind: plugin
46
+ method: MockObservations
47
+ path: 'builtin'
48
+ mapping:
49
+ 'parameter-name-in-the-plugin': 'parameter-name-in-the-input'
50
+ ```
34
51
 
35
52
  ### Authentication
36
53
 
@@ -38,13 +55,13 @@ N/A
38
55
 
39
56
  ### Inputs
40
57
 
41
- The plugin's `global-config` section in the manifest file determines its behaviour.
58
+ The plugin's `config` section in the manifest file determines its behaviour.
42
59
  'inputs' section is ignored.
43
60
 
44
61
  ### Typescript Usage
45
62
 
46
63
  ```typescript
47
- const mockObservations = MockObservations({
64
+ const config = {
48
65
  'timestamp-from': '2023-07-06T00:00',
49
66
  'timestamp-to': '2023-07-06T00:10',
50
67
  duration: 60,
@@ -56,7 +73,10 @@ const mockObservations = MockObservations({
56
73
  region: 'uk-west',
57
74
  },
58
75
  },
59
- });
76
+ };
77
+ const parametersMetadata = {inputs: {}, outputs: {}};
78
+ const mapping = {};
79
+ const mockObservations = MockObservations(config, parametersMetadata, mapping);
60
80
  const result = await mockObservations.execute([]);
61
81
  ```
62
82
 
@@ -74,7 +94,7 @@ initialize:
74
94
  kind: plugin
75
95
  method: MockObservations
76
96
  path: 'builtin'
77
- global-config:
97
+ config:
78
98
  timestamp-from: 2023-07-06T00:00
79
99
  timestamp-to: 2023-07-06T00:10
80
100
  duration: 60
@@ -10,7 +10,7 @@ For example, you could multiply `cpu/energy` and `network/energy` and name the r
10
10
 
11
11
  ### Plugin config
12
12
 
13
- Two parameters are required in global config: `input-parameters` and `output-parameter`.
13
+ Two parameters are required in config: `input-parameters` and `output-parameter`.
14
14
 
15
15
  `input-parameters`: an array of strings. Each string should match an existing key in the `inputs` array
16
16
  `output-parameter`: a string defining the name to use to add the product of the input parameters to the output array.
@@ -19,16 +19,32 @@ Two parameters are required in global config: `input-parameters` and `output-par
19
19
 
20
20
  The `parameter-metadata` section contains information about `description`, `unit` and `aggregation-method` of the parameters of the inputs and outputs
21
21
 
22
- - `inputs`: describe parameters of the `input-parameters` of the global config. Each parameter has:
22
+ - `inputs`: describe parameters of the `input-parameters` of the config. Each parameter has:
23
23
 
24
24
  - `description`: description of the parameter
25
25
  - `unit`: unit of the parameter
26
- - `aggregation-method`: aggregation method of the parameter (it can be `sum`, `avg` or `none`)
26
+ - `aggregation-method`: aggregation method object of the parameter
27
+ - `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
28
+ - `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
27
29
 
28
- - `outputs`: describe the parameter of the `output-parameter` of the global config. The parameter has the following attributes:
30
+ - `outputs`: describe the parameter of the `output-parameter` of the config. The parameter has the following attributes:
29
31
  - `description`: description of the parameter
30
32
  - `unit`: unit of the parameter
31
- - `aggregation-method`: aggregation method of the parameter (it can be `sum`, `avg` or `none`)
33
+ - `aggregation-method`: aggregation method object of the parameter
34
+ - `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
35
+ - `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
36
+
37
+ ### Mapping
38
+
39
+ The `mapping` block is an optional block. It is added in the plugin section and allows the plugin to receive a parameter from the input with a different name than the one the plugin uses for data manipulation. The parameter with the mapped name will not appear in the outputs. It also maps the output parameter of the plugin. The structure of the `mapping` block is:
40
+
41
+ ```yaml
42
+ multiply:
43
+ method: Multiply
44
+ path: 'builtin'
45
+ mapping:
46
+ 'parameter-name-in-the-plugin': 'parameter-name-in-the-input'
47
+ ```
32
48
 
33
49
  ### Inputs
34
50
 
@@ -36,7 +52,7 @@ All of `input-parameters` must be available in the input array.
36
52
 
37
53
  ## Returns
38
54
 
39
- - `output-parameter`: the product of all `input-parameters` with the parameter name defined by `output-parameter` in global config.
55
+ - `output-parameter`: the product of all `input-parameters` with the parameter name defined by `output-parameter` in config.
40
56
 
41
57
  ## Calculation
42
58
 
@@ -56,7 +72,9 @@ const config = {
56
72
  outputParameter: 'energy-product',
57
73
  };
58
74
 
59
- const multiply = Multiply(config, parametersMetadata);
75
+ const parametersMetadata = {inputs: {}, outputs: {}};
76
+ const mapping = {};
77
+ const multiply = Multiply(config, parametersMetadata, mapping);
60
78
  const result = await multiply.execute([
61
79
  {
62
80
  duration: 3600,
@@ -69,7 +87,7 @@ const result = await multiply.execute([
69
87
 
70
88
  ## Example manifest
71
89
 
72
- IF users will typically call the plugin as part of a pipeline defined in a manifest file. In this case, instantiating the plugin is handled by `ie` and does not have to be done explicitly by the user. The following is an example manifest that calls `multiply`:
90
+ IF users will typically call the plugin as part of a pipeline defined in a manifest file. In this case, instantiating the plugin is handled by `if-run` and does not have to be done explicitly by the user. The following is an example manifest that calls `multiply`:
73
91
 
74
92
  ```yaml
75
93
  name: multiply-demo
@@ -80,7 +98,7 @@ initialize:
80
98
  multiply:
81
99
  method: Multiply
82
100
  path: 'builtin'
83
- global-config:
101
+ config:
84
102
  input-parameters: ['cpu/energy', 'network/energy']
85
103
  output-parameter: 'energy-product'
86
104
  tree:
@@ -20,16 +20,32 @@ Intel® Xeon® Platinum 8272CL,Intel® Xeon® 8171M 2.1 GHz,Intel® Xeon® E5-26
20
20
 
21
21
  The `parameter-metadata` section contains information about `description`, `unit` and `aggregation-method` of the parameters of the inputs and outputs
22
22
 
23
- - `inputs`: describe the parameter of the `parameter` value of the global config. The parameter has the following attributes:
23
+ - `inputs`: describe the parameter of the `parameter` value of the config. The parameter has the following attributes:
24
24
 
25
25
  - `description`: description of the parameter
26
26
  - `unit`: unit of the parameter
27
- - `aggregation-method`: aggregation method of the parameter (it can be `sum`, `avg` or `none`)
27
+ - `aggregation-method`: aggregation method object of the parameter
28
+ - `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
29
+ - `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
28
30
 
29
- - `outputs`: describe the parameters of the `output` of the global config. The parameter has the following attributes:
31
+ - `outputs`: describe the parameters of the `output` of the config. The parameter has the following attributes:
30
32
  - `description`: description of the parameter
31
33
  - `unit`: unit of the parameter
32
- - `aggregation-method`: aggregation method of the parameter (it can be `sum`, `avg` or `none`)
34
+ - `aggregation-method`: aggregation method object of the parameter
35
+ - `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
36
+ - `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
37
+
38
+ ### Mapping
39
+
40
+ The `mapping` block is an optional block. It is added in the plugin section and allows the plugin to receive a parameter from the input with a different name than the one the plugin uses for data manipulation. The parameter with the mapped name will not appear in the outputs. It also maps the output parameter of the plugin. The structure of the `mapping` block is:
41
+
42
+ ```yaml
43
+ regex:
44
+ method: Regex
45
+ path: 'builtin'
46
+ mapping:
47
+ 'parameter-name-in-the-plugin': 'parameter-name-in-the-input'
48
+ ```
33
49
 
34
50
  ### Inputs
35
51
 
@@ -37,21 +53,23 @@ The `parameter-metadata` section contains information about `description`, `unit
37
53
 
38
54
  ## Returns
39
55
 
40
- - `output`: The match of the `parameter` value using the `match` regex defined in the global config. If the `match` regex includes the global flag (`g`), a string containing all matches separated by spaces.
56
+ - `output`: The match of the `parameter` value using the `match` regex defined in the config. If the `match` regex includes the global flag (`g`), a string containing all matches separated by spaces.
41
57
 
42
58
  ## Implementation
43
59
 
44
60
  To run the plugin, you must first create an instance of `Regex`. Then, you can call `execute()`.
45
61
 
46
62
  ```typescript
47
- const globalConfig = {
63
+ const config = {
48
64
  parameter: 'physical-processor',
49
65
  match: '^[^,]+',
50
66
  output: 'cpu/name',
51
67
  };
52
- const regex = Regex(globalConfig);
68
+ const parametersMetadata = {inputs: {}, outputs: {}};
69
+ const mapping = {};
70
+ const regex = Regex(config, parametersMetadata, mapping);
53
71
 
54
- const input = [
72
+ const inputs = [
55
73
  {
56
74
  timestamp: '2021-01-01T00:00:00Z',
57
75
  duration: 3600,
@@ -59,6 +77,8 @@ const input = [
59
77
  'Intel® Xeon® Platinum 8272CL,Intel® Xeon® 8171M 2.1 GHz,Intel® Xeon® E5-2673 v4 2.3 GHz,Intel® Xeon® E5-2673 v3 2.4 GHz',
60
78
  },
61
79
  ];
80
+
81
+ const result = await regex.execute(inputs);
62
82
  ```
63
83
 
64
84
  ## Example manifest
@@ -74,7 +94,7 @@ initialize:
74
94
  regex:
75
95
  method: Regex
76
96
  path: 'builtin'
77
- global-config:
97
+ config:
78
98
  parameter: physical-processor
79
99
  match: ^[^,]+
80
100
  output: cpu/name
@@ -112,9 +132,9 @@ Every element in the `inputs` array must contain:
112
132
  - `duration`
113
133
  - whatever value you passed to `parameter`
114
134
 
115
- ### `GlobalConfigError`
135
+ ### `ConfigError`
116
136
 
117
- You will receive an error starting `GlobalConfigError: ` if you have not provided the expected configuration data in the plugin's `initialize` block.
137
+ You will receive an error starting `ConfigError: ` if you have not provided the expected configuration data in the plugin's `initialize` block.
118
138
 
119
139
  The required parameters are:
120
140
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Parameters
6
6
 
7
- ### Plugin global config
7
+ ### Plugin config
8
8
 
9
9
  - `functional-unit`: the name of the functional unit in which to express the carbon impact (required)
10
10
 
@@ -16,17 +16,34 @@ The `parameter-metadata` section contains information about `description`, `unit
16
16
 
17
17
  - `description`: description of the parameter
18
18
  - `unit`: unit of the parameter
19
- - `aggregation-method`: aggregation method of the parameter (it can be `sum`, `avg` or `none`)
19
+ - `aggregation-method`: aggregation method object of the parameter
20
+ - `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
21
+ - `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
20
22
 
21
23
  - `outputs`: describe the `sci` parameter which has the following attributes:
24
+
22
25
  - `description`: description of the parameter
23
26
  - `unit`: unit of the parameter
24
- - `aggregation-method`: aggregation method of the parameter (it can be `sum`, `avg` or `none`)
27
+ - `aggregation-method`: aggregation method object of the parameter
28
+ - `time`: this value is used for `horizontal` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
29
+ - `component`: this value is used for `vertical` aggregation. It can be of the following values: `sum`, `avg`, `copy`, or `none`.
30
+
31
+ ### Mapping
32
+
33
+ The `mapping` block is an optional block. It is added in the plugin section and allows the plugin to receive a parameter from the input with a different name than the one the plugin uses for data manipulation. The parameter with the mapped name will not appear in the outputs. It also maps the output parameter of the plugin. The structure of the `mapping` block is:
34
+
35
+ ```yaml
36
+ sci:
37
+ method: Sci
38
+ path: 'builtin'
39
+ mapping:
40
+ 'parameter-name-in-the-plugin': 'parameter-name-in-the-input'
41
+ ```
25
42
 
26
43
  ### Inputs
27
44
 
28
45
  - `carbon`: total carbon in gCO2eq (required)
29
- - `functional-unit`: whatever `functional-unit` you define in global config also has to be present in each input, for example if you provide `functional-unit: requests` in global config, `requests` must be present in your input data.
46
+ - `functional-unit`: whatever `functional-unit` you define in config also has to be present in each input, for example if you provide `functional-unit: requests` in config, `requests` must be present in your input data.
30
47
 
31
48
  ## Returns
32
49
 
@@ -49,11 +66,15 @@ To run the plugin, you must first create an instance of `Sci`. Then, you can cal
49
66
  ```typescript
50
67
  import {Sci} from 'builtins';
51
68
 
52
- const sci = Sci({'functional-unit': 'requests'});
69
+ const config = {'functional-unit': 'requests'}
70
+ const parametersMetadata = {inputs: {}, outputs: {}};
71
+
72
+ const sci = Sci(config, parametersMetadata, {});
73
+
53
74
  const results = await sci.execute(
54
75
  [
55
76
  {
56
- 'carbon': 5'
77
+ 'carbon': 5
57
78
  duration: 1,
58
79
  requests: 100,
59
80
  },
@@ -63,7 +84,7 @@ const results = await sci.execute(
63
84
 
64
85
  ## Example manifest
65
86
 
66
- IF users will typically call the plugin as part of a pipeline defined in a `manifest` file. In this case, instantiating the plugin is handled by `ie` and does not have to be done explicitly by the user.
87
+ IF users will typically call the plugin as part of a pipeline defined in a `manifest` file. In this case, instantiating the plugin is handled by `if-run` and does not have to be done explicitly by the user.
67
88
 
68
89
  The following is an example `manifest` that calls `sci`:
69
90
 
@@ -76,7 +97,7 @@ initialize:
76
97
  sci:
77
98
  method: Sci
78
99
  path: 'builtin'
79
- global-config:
100
+ config:
80
101
  functional-unit: 'requests'
81
102
  tree:
82
103
  children: