@platforma-sdk/model 1.58.3 → 1.58.9

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 (366) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +43 -0
  2. package/dist/_virtual/_rolldown/runtime.js +18 -0
  3. package/dist/annotations/converter.cjs +15 -20
  4. package/dist/annotations/converter.cjs.map +1 -1
  5. package/dist/annotations/converter.d.ts +6 -2
  6. package/dist/annotations/converter.js +14 -18
  7. package/dist/annotations/converter.js.map +1 -1
  8. package/dist/annotations/index.cjs +1 -0
  9. package/dist/annotations/index.d.ts +2 -3
  10. package/dist/annotations/index.js +1 -0
  11. package/dist/annotations/types.d.ts +21 -16
  12. package/dist/bconfig/index.cjs +2 -0
  13. package/dist/bconfig/index.d.ts +5 -6
  14. package/dist/bconfig/index.js +2 -0
  15. package/dist/bconfig/lambdas.d.ts +52 -52
  16. package/dist/bconfig/normalization.cjs +13 -18
  17. package/dist/bconfig/normalization.cjs.map +1 -1
  18. package/dist/bconfig/normalization.d.ts +10 -6
  19. package/dist/bconfig/normalization.js +12 -16
  20. package/dist/bconfig/normalization.js.map +1 -1
  21. package/dist/bconfig/types.cjs +4 -3
  22. package/dist/bconfig/types.cjs.map +1 -1
  23. package/dist/bconfig/types.d.ts +10 -5
  24. package/dist/bconfig/types.js +4 -2
  25. package/dist/bconfig/types.js.map +1 -1
  26. package/dist/bconfig/util.d.ts +7 -4
  27. package/dist/bconfig/v3.d.ts +10 -6
  28. package/dist/block_api_v1.d.ts +62 -58
  29. package/dist/block_api_v2.d.ts +51 -47
  30. package/dist/block_api_v3.d.ts +33 -29
  31. package/dist/block_migrations.cjs +481 -413
  32. package/dist/block_migrations.cjs.map +1 -1
  33. package/dist/block_migrations.d.ts +258 -204
  34. package/dist/block_migrations.js +482 -408
  35. package/dist/block_migrations.js.map +1 -1
  36. package/dist/block_model.cjs +312 -343
  37. package/dist/block_model.cjs.map +1 -1
  38. package/dist/block_model.d.ts +143 -147
  39. package/dist/block_model.js +312 -341
  40. package/dist/block_model.js.map +1 -1
  41. package/dist/block_model_legacy.cjs +231 -255
  42. package/dist/block_model_legacy.cjs.map +1 -1
  43. package/dist/block_model_legacy.d.ts +108 -106
  44. package/dist/block_model_legacy.js +231 -253
  45. package/dist/block_model_legacy.js.map +1 -1
  46. package/dist/block_state_patch.d.ts +10 -10
  47. package/dist/block_state_util.cjs +15 -19
  48. package/dist/block_state_util.cjs.map +1 -1
  49. package/dist/block_state_util.d.ts +14 -13
  50. package/dist/block_state_util.js +15 -18
  51. package/dist/block_state_util.js.map +1 -1
  52. package/dist/block_storage.cjs +233 -238
  53. package/dist/block_storage.cjs.map +1 -1
  54. package/dist/block_storage.d.ts +62 -78
  55. package/dist/block_storage.js +234 -237
  56. package/dist/block_storage.js.map +1 -1
  57. package/dist/block_storage_callbacks.cjs +156 -195
  58. package/dist/block_storage_callbacks.cjs.map +1 -1
  59. package/dist/block_storage_callbacks.js +156 -192
  60. package/dist/block_storage_callbacks.js.map +1 -1
  61. package/dist/block_storage_facade.cjs +29 -85
  62. package/dist/block_storage_facade.cjs.map +1 -1
  63. package/dist/block_storage_facade.d.ts +83 -126
  64. package/dist/block_storage_facade.js +29 -83
  65. package/dist/block_storage_facade.js.map +1 -1
  66. package/dist/components/PFrameForGraphs.cjs +26 -24
  67. package/dist/components/PFrameForGraphs.cjs.map +1 -1
  68. package/dist/components/PFrameForGraphs.d.ts +12 -7
  69. package/dist/components/PFrameForGraphs.js +25 -22
  70. package/dist/components/PFrameForGraphs.js.map +1 -1
  71. package/dist/components/PlAnnotations/filter.d.ts +62 -79
  72. package/dist/components/PlAnnotations/filters_ui.cjs +135 -171
  73. package/dist/components/PlAnnotations/filters_ui.cjs.map +1 -1
  74. package/dist/components/PlAnnotations/filters_ui.d.ts +48 -46
  75. package/dist/components/PlAnnotations/filters_ui.js +135 -170
  76. package/dist/components/PlAnnotations/filters_ui.js.map +1 -1
  77. package/dist/components/PlAnnotations/index.d.ts +2 -3
  78. package/dist/components/PlDataTable/index.cjs +2 -0
  79. package/dist/components/PlDataTable/index.d.ts +3 -5
  80. package/dist/components/PlDataTable/index.js +2 -0
  81. package/dist/components/PlDataTable/labels.cjs +59 -81
  82. package/dist/components/PlDataTable/labels.cjs.map +1 -1
  83. package/dist/components/PlDataTable/labels.js +58 -79
  84. package/dist/components/PlDataTable/labels.js.map +1 -1
  85. package/dist/components/PlDataTable/state-migration.cjs +186 -144
  86. package/dist/components/PlDataTable/state-migration.cjs.map +1 -1
  87. package/dist/components/PlDataTable/state-migration.d.ts +85 -82
  88. package/dist/components/PlDataTable/state-migration.js +185 -142
  89. package/dist/components/PlDataTable/state-migration.js.map +1 -1
  90. package/dist/components/PlDataTable/table.cjs +172 -194
  91. package/dist/components/PlDataTable/table.cjs.map +1 -1
  92. package/dist/components/PlDataTable/table.d.ts +16 -12
  93. package/dist/components/PlDataTable/table.js +171 -192
  94. package/dist/components/PlDataTable/table.js.map +1 -1
  95. package/dist/components/PlDataTable/v4.d.ts +84 -119
  96. package/dist/components/PlDataTable/v5.d.ts +80 -103
  97. package/dist/components/PlMultiSequenceAlignment.cjs +27 -29
  98. package/dist/components/PlMultiSequenceAlignment.cjs.map +1 -1
  99. package/dist/components/PlMultiSequenceAlignment.d.ts +36 -27
  100. package/dist/components/PlMultiSequenceAlignment.js +26 -27
  101. package/dist/components/PlMultiSequenceAlignment.js.map +1 -1
  102. package/dist/components/PlSelectionModel.cjs +7 -6
  103. package/dist/components/PlSelectionModel.cjs.map +1 -1
  104. package/dist/components/PlSelectionModel.d.ts +10 -8
  105. package/dist/components/PlSelectionModel.js +7 -5
  106. package/dist/components/PlSelectionModel.js.map +1 -1
  107. package/dist/components/index.cjs +8 -0
  108. package/dist/components/index.d.ts +11 -6
  109. package/dist/components/index.js +8 -0
  110. package/dist/config/actions.cjs +138 -171
  111. package/dist/config/actions.cjs.map +1 -1
  112. package/dist/config/actions.d.ts +47 -47
  113. package/dist/config/actions.js +146 -178
  114. package/dist/config/actions.js.map +1 -1
  115. package/dist/config/actions_kinds.d.ts +114 -121
  116. package/dist/config/index.cjs +1 -0
  117. package/dist/config/index.d.ts +6 -7
  118. package/dist/config/index.js +1 -0
  119. package/dist/config/model.d.ts +131 -127
  120. package/dist/config/model_meta.d.ts +4 -1
  121. package/dist/config/type_engine.d.ts +22 -21
  122. package/dist/config/type_util.d.ts +12 -10
  123. package/dist/env_value.cjs +5 -6
  124. package/dist/env_value.cjs.map +1 -1
  125. package/dist/env_value.d.ts +4 -1
  126. package/dist/env_value.js +5 -5
  127. package/dist/env_value.js.map +1 -1
  128. package/dist/filters/converters/filterToQuery.cjs +273 -239
  129. package/dist/filters/converters/filterToQuery.cjs.map +1 -1
  130. package/dist/filters/converters/filterToQuery.d.ts +6 -2
  131. package/dist/filters/converters/filterToQuery.js +272 -237
  132. package/dist/filters/converters/filterToQuery.js.map +1 -1
  133. package/dist/filters/converters/filterUiToExpressionImpl.cjs +56 -85
  134. package/dist/filters/converters/filterUiToExpressionImpl.cjs.map +1 -1
  135. package/dist/filters/converters/filterUiToExpressionImpl.d.ts +8 -4
  136. package/dist/filters/converters/filterUiToExpressionImpl.js +55 -83
  137. package/dist/filters/converters/filterUiToExpressionImpl.js.map +1 -1
  138. package/dist/filters/converters/index.cjs +2 -0
  139. package/dist/filters/converters/index.d.ts +2 -3
  140. package/dist/filters/converters/index.js +2 -0
  141. package/dist/filters/distill.cjs +59 -50
  142. package/dist/filters/distill.cjs.map +1 -1
  143. package/dist/filters/distill.d.ts +6 -3
  144. package/dist/filters/distill.js +58 -48
  145. package/dist/filters/distill.js.map +1 -1
  146. package/dist/filters/index.cjs +4 -0
  147. package/dist/filters/index.d.ts +5 -4
  148. package/dist/filters/index.js +4 -0
  149. package/dist/filters/traverse.cjs +31 -40
  150. package/dist/filters/traverse.cjs.map +1 -1
  151. package/dist/filters/traverse.js +31 -39
  152. package/dist/filters/traverse.js.map +1 -1
  153. package/dist/filters/types.d.ts +10 -7
  154. package/dist/index.cjs +193 -187
  155. package/dist/index.d.ts +61 -28
  156. package/dist/index.js +49 -41
  157. package/dist/internal.cjs +48 -62
  158. package/dist/internal.cjs.map +1 -1
  159. package/dist/internal.js +49 -60
  160. package/dist/internal.js.map +1 -1
  161. package/dist/package.cjs +12 -0
  162. package/dist/package.cjs.map +1 -0
  163. package/dist/package.js +6 -0
  164. package/dist/package.js.map +1 -0
  165. package/dist/pframe.cjs +32 -37
  166. package/dist/pframe.cjs.map +1 -1
  167. package/dist/pframe.d.ts +14 -10
  168. package/dist/pframe.js +32 -35
  169. package/dist/pframe.js.map +1 -1
  170. package/dist/pframe_utils/axes.cjs +81 -114
  171. package/dist/pframe_utils/axes.cjs.map +1 -1
  172. package/dist/pframe_utils/axes.d.ts +10 -13
  173. package/dist/pframe_utils/axes.js +80 -112
  174. package/dist/pframe_utils/axes.js.map +1 -1
  175. package/dist/pframe_utils/columns.cjs +61 -81
  176. package/dist/pframe_utils/columns.cjs.map +1 -1
  177. package/dist/pframe_utils/columns.d.ts +15 -6
  178. package/dist/pframe_utils/columns.js +60 -79
  179. package/dist/pframe_utils/columns.js.map +1 -1
  180. package/dist/pframe_utils/index.cjs +232 -253
  181. package/dist/pframe_utils/index.cjs.map +1 -1
  182. package/dist/pframe_utils/index.d.ts +39 -35
  183. package/dist/pframe_utils/index.js +231 -251
  184. package/dist/pframe_utils/index.js.map +1 -1
  185. package/dist/platforma.d.ts +48 -46
  186. package/dist/plugin_handle.cjs +6 -14
  187. package/dist/plugin_handle.cjs.map +1 -1
  188. package/dist/plugin_handle.d.ts +20 -25
  189. package/dist/plugin_handle.js +6 -13
  190. package/dist/plugin_handle.js.map +1 -1
  191. package/dist/plugin_model.cjs +364 -163
  192. package/dist/plugin_model.cjs.map +1 -1
  193. package/dist/plugin_model.d.ts +280 -129
  194. package/dist/plugin_model.js +362 -163
  195. package/dist/plugin_model.js.map +1 -1
  196. package/dist/raw_globals.cjs +10 -22
  197. package/dist/raw_globals.cjs.map +1 -1
  198. package/dist/raw_globals.d.ts +8 -5
  199. package/dist/raw_globals.js +10 -20
  200. package/dist/raw_globals.js.map +1 -1
  201. package/dist/ref_util.cjs +14 -13
  202. package/dist/ref_util.cjs.map +1 -1
  203. package/dist/ref_util.d.ts +18 -12
  204. package/dist/ref_util.js +14 -11
  205. package/dist/ref_util.js.map +1 -1
  206. package/dist/render/accessor.cjs +213 -226
  207. package/dist/render/accessor.cjs.map +1 -1
  208. package/dist/render/accessor.d.ts +115 -120
  209. package/dist/render/accessor.js +212 -224
  210. package/dist/render/accessor.js.map +1 -1
  211. package/dist/render/api.cjs +478 -580
  212. package/dist/render/api.cjs.map +1 -1
  213. package/dist/render/api.d.ts +207 -209
  214. package/dist/render/api.js +476 -578
  215. package/dist/render/api.js.map +1 -1
  216. package/dist/render/future.cjs +28 -32
  217. package/dist/render/future.cjs.map +1 -1
  218. package/dist/render/future.d.ts +15 -11
  219. package/dist/render/future.js +28 -30
  220. package/dist/render/future.js.map +1 -1
  221. package/dist/render/index.cjs +8 -0
  222. package/dist/render/index.d.ts +10 -8
  223. package/dist/render/index.js +8 -0
  224. package/dist/render/internal.cjs +33 -29
  225. package/dist/render/internal.cjs.map +1 -1
  226. package/dist/render/internal.d.ts +78 -72
  227. package/dist/render/internal.js +29 -26
  228. package/dist/render/internal.js.map +1 -1
  229. package/dist/render/traversal_ops.d.ts +42 -43
  230. package/dist/render/util/axis_filtering.cjs +63 -86
  231. package/dist/render/util/axis_filtering.cjs.map +1 -1
  232. package/dist/render/util/axis_filtering.d.ts +10 -7
  233. package/dist/render/util/axis_filtering.js +63 -85
  234. package/dist/render/util/axis_filtering.js.map +1 -1
  235. package/dist/render/util/column_collection.cjs +266 -321
  236. package/dist/render/util/column_collection.cjs.map +1 -1
  237. package/dist/render/util/column_collection.d.ts +47 -47
  238. package/dist/render/util/column_collection.js +264 -319
  239. package/dist/render/util/column_collection.js.map +1 -1
  240. package/dist/render/util/index.cjs +4 -0
  241. package/dist/render/util/index.d.ts +4 -5
  242. package/dist/render/util/index.js +4 -0
  243. package/dist/render/util/label.cjs +129 -163
  244. package/dist/render/util/label.cjs.map +1 -1
  245. package/dist/render/util/label.d.ts +45 -46
  246. package/dist/render/util/label.js +128 -161
  247. package/dist/render/util/label.js.map +1 -1
  248. package/dist/render/util/pcolumn_data.cjs +315 -375
  249. package/dist/render/util/pcolumn_data.cjs.map +1 -1
  250. package/dist/render/util/pcolumn_data.d.ts +33 -32
  251. package/dist/render/util/pcolumn_data.js +314 -373
  252. package/dist/render/util/pcolumn_data.js.map +1 -1
  253. package/dist/render/util/pframe_upgraders.cjs +37 -42
  254. package/dist/render/util/pframe_upgraders.cjs.map +1 -1
  255. package/dist/render/util/pframe_upgraders.js +37 -41
  256. package/dist/render/util/pframe_upgraders.js.map +1 -1
  257. package/dist/render/util/split_selectors.d.ts +13 -9
  258. package/dist/version.cjs +6 -8
  259. package/dist/version.cjs.map +1 -1
  260. package/dist/version.d.ts +7 -4
  261. package/dist/version.js +5 -5
  262. package/dist/version.js.map +1 -1
  263. package/package.json +9 -3
  264. package/src/block_migrations.test.ts +184 -14
  265. package/src/block_migrations.ts +185 -30
  266. package/src/block_model.ts +111 -66
  267. package/src/block_storage.test.ts +147 -3
  268. package/src/block_storage.ts +43 -8
  269. package/src/block_storage_callbacks.ts +9 -4
  270. package/src/env_value.ts +0 -2
  271. package/src/filters/distill.ts +17 -6
  272. package/src/index.ts +12 -11
  273. package/src/internal.ts +0 -1
  274. package/src/platforma.ts +4 -4
  275. package/src/plugin_handle.ts +1 -1
  276. package/src/plugin_model.test.ts +217 -21
  277. package/src/plugin_model.ts +450 -55
  278. package/src/raw_globals.ts +0 -1
  279. package/dist/annotations/converter.d.ts.map +0 -1
  280. package/dist/annotations/index.d.ts.map +0 -1
  281. package/dist/annotations/types.d.ts.map +0 -1
  282. package/dist/bconfig/index.d.ts.map +0 -1
  283. package/dist/bconfig/lambdas.d.ts.map +0 -1
  284. package/dist/bconfig/normalization.d.ts.map +0 -1
  285. package/dist/bconfig/types.d.ts.map +0 -1
  286. package/dist/bconfig/util.d.ts.map +0 -1
  287. package/dist/bconfig/v3.d.ts.map +0 -1
  288. package/dist/block_api_v1.d.ts.map +0 -1
  289. package/dist/block_api_v2.d.ts.map +0 -1
  290. package/dist/block_api_v3.d.ts.map +0 -1
  291. package/dist/block_migrations.d.ts.map +0 -1
  292. package/dist/block_model.d.ts.map +0 -1
  293. package/dist/block_model_legacy.d.ts.map +0 -1
  294. package/dist/block_state_patch.d.ts.map +0 -1
  295. package/dist/block_state_util.d.ts.map +0 -1
  296. package/dist/block_storage.d.ts.map +0 -1
  297. package/dist/block_storage_callbacks.d.ts +0 -115
  298. package/dist/block_storage_callbacks.d.ts.map +0 -1
  299. package/dist/block_storage_facade.d.ts.map +0 -1
  300. package/dist/components/PFrameForGraphs.d.ts.map +0 -1
  301. package/dist/components/PlAnnotations/filter.d.ts.map +0 -1
  302. package/dist/components/PlAnnotations/filters_ui.d.ts.map +0 -1
  303. package/dist/components/PlAnnotations/index.d.ts.map +0 -1
  304. package/dist/components/PlAnnotations/types.d.ts +0 -3
  305. package/dist/components/PlAnnotations/types.d.ts.map +0 -1
  306. package/dist/components/PlDataTable/index.d.ts.map +0 -1
  307. package/dist/components/PlDataTable/labels.d.ts +0 -7
  308. package/dist/components/PlDataTable/labels.d.ts.map +0 -1
  309. package/dist/components/PlDataTable/state-migration.d.ts.map +0 -1
  310. package/dist/components/PlDataTable/table.d.ts.map +0 -1
  311. package/dist/components/PlDataTable/v4.d.ts.map +0 -1
  312. package/dist/components/PlDataTable/v5.d.ts.map +0 -1
  313. package/dist/components/PlMultiSequenceAlignment.d.ts.map +0 -1
  314. package/dist/components/PlSelectionModel.d.ts.map +0 -1
  315. package/dist/components/index.d.ts.map +0 -1
  316. package/dist/config/actions.d.ts.map +0 -1
  317. package/dist/config/actions_kinds.d.ts.map +0 -1
  318. package/dist/config/index.d.ts.map +0 -1
  319. package/dist/config/model.d.ts.map +0 -1
  320. package/dist/config/model_meta.d.ts.map +0 -1
  321. package/dist/config/type_engine.d.ts.map +0 -1
  322. package/dist/config/type_util.d.ts.map +0 -1
  323. package/dist/env_value.d.ts.map +0 -1
  324. package/dist/filters/converters/filterToQuery.d.ts.map +0 -1
  325. package/dist/filters/converters/filterUiToExpressionImpl.d.ts.map +0 -1
  326. package/dist/filters/converters/index.d.ts.map +0 -1
  327. package/dist/filters/distill.d.ts.map +0 -1
  328. package/dist/filters/index.d.ts.map +0 -1
  329. package/dist/filters/traverse.d.ts +0 -27
  330. package/dist/filters/traverse.d.ts.map +0 -1
  331. package/dist/filters/types.d.ts.map +0 -1
  332. package/dist/index.cjs.map +0 -1
  333. package/dist/index.d.ts.map +0 -1
  334. package/dist/index.js.map +0 -1
  335. package/dist/internal.d.ts +0 -36
  336. package/dist/internal.d.ts.map +0 -1
  337. package/dist/package.json.cjs +0 -6
  338. package/dist/package.json.cjs.map +0 -1
  339. package/dist/package.json.js +0 -4
  340. package/dist/package.json.js.map +0 -1
  341. package/dist/pframe.d.ts.map +0 -1
  342. package/dist/pframe_utils/axes.d.ts.map +0 -1
  343. package/dist/pframe_utils/columns.d.ts.map +0 -1
  344. package/dist/pframe_utils/index.d.ts.map +0 -1
  345. package/dist/pframe_utils/querySpec.d.ts +0 -2
  346. package/dist/pframe_utils/querySpec.d.ts.map +0 -1
  347. package/dist/platforma.d.ts.map +0 -1
  348. package/dist/plugin_handle.d.ts.map +0 -1
  349. package/dist/plugin_model.d.ts.map +0 -1
  350. package/dist/raw_globals.d.ts.map +0 -1
  351. package/dist/ref_util.d.ts.map +0 -1
  352. package/dist/render/accessor.d.ts.map +0 -1
  353. package/dist/render/api.d.ts.map +0 -1
  354. package/dist/render/future.d.ts.map +0 -1
  355. package/dist/render/index.d.ts.map +0 -1
  356. package/dist/render/internal.d.ts.map +0 -1
  357. package/dist/render/traversal_ops.d.ts.map +0 -1
  358. package/dist/render/util/axis_filtering.d.ts.map +0 -1
  359. package/dist/render/util/column_collection.d.ts.map +0 -1
  360. package/dist/render/util/index.d.ts.map +0 -1
  361. package/dist/render/util/label.d.ts.map +0 -1
  362. package/dist/render/util/pcolumn_data.d.ts.map +0 -1
  363. package/dist/render/util/pframe_upgraders.d.ts +0 -3
  364. package/dist/render/util/pframe_upgraders.d.ts.map +0 -1
  365. package/dist/render/util/split_selectors.d.ts.map +0 -1
  366. package/dist/version.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"actions.cjs","sources":["../../src/config/actions.ts"],"sourcesContent":["import type {\n ActGetField,\n ActGetFromCtx,\n ActGetImmediate,\n ActGetResourceField,\n ActGetResourceValueAsJson,\n ActMakeObject,\n ActMapRecordValues,\n ActMapResourceFields,\n ActMapArrayValues,\n ActIsEmpty,\n ActNot,\n ActIsolate,\n ActGetBlobContentAsJson,\n ActGetBlobContentAsString,\n ActGetBlobContent,\n ActAnd,\n ActOr,\n ActMakeArray,\n ActFlatten,\n ActGetDownloadedBlobContent,\n ActGetOnDemandBlobContent,\n ActImportProgress,\n ActGetLastLogs,\n ActGetProgressLog,\n ActGetProgressLogWithInfo,\n ActGetLogHandle,\n ActExtractArchiveAndGetURL,\n} from \"./actions_kinds\";\nimport type {\n ExtractAction,\n POCExtractAction,\n PrimitiveOrConfig,\n TypedConfig,\n} from \"./type_engine\";\nimport type { Cfg } from \"./model\";\nimport type { CheckedSyncConf } from \"./type_util\";\nimport type { ArchiveFormat, RangeBytes } from \"@milaboratories/pl-model-common\";\n\n//\n// Helpers\n//\n\nfunction primitiveToConfig(value: PrimitiveOrConfig): TypedConfig {\n if (\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\" ||\n value === null\n )\n return getImmediate(value);\n else return value as TypedConfig;\n}\n\n//\n// Context\n//\n\nexport function getFromCfg<const V extends string>(variable: V): TypedConfig<ActGetFromCtx<V>> {\n return { type: \"GetFromCtx\", variable } as Cfg as any;\n}\n\n//\n// Isolate\n//\n\nexport function isolate<const Config extends TypedConfig>(\n cfg: Config,\n): TypedConfig<ActIsolate<ExtractAction<Config>>> {\n return {\n type: \"Isolate\",\n cfg,\n } as Cfg as any;\n}\n\n//\n// Well-known Context Vars\n//\n\nexport const Args = getFromCfg(\"$args\");\nexport const It = getFromCfg(\"$it\");\nexport const MainOutputs = getFromCfg(\"$prod\");\nexport const StagingOutputs = getFromCfg(\"$staging\");\nexport const UiState = getFromCfg(\"$ui\");\n\n//\n// Json\n//\n\nexport function getImmediate<const T>(value: T): TypedConfig<ActGetImmediate<T>> {\n return { type: \"Immediate\", value } as Cfg as any;\n}\n\nexport function makeObject<const T extends Record<string, PrimitiveOrConfig>>(\n template: T,\n): TypedConfig<ActMakeObject<{ [Key in keyof T]: POCExtractAction<T[Key]> }>> {\n const normalizedTemplate: Record<string, TypedConfig> = {};\n for (const [k, cfg] of Object.entries(template)) normalizedTemplate[k] = primitiveToConfig(cfg);\n return {\n type: \"MakeObject\",\n template: normalizedTemplate,\n } as Cfg as any;\n}\n\nexport function makeArray<const T extends PrimitiveOrConfig[]>(\n ...template: T\n): TypedConfig<ActMakeArray<{ [Key in keyof T]: POCExtractAction<T[Key]> }>> {\n const normalizedTemplate: TypedConfig[] = [];\n for (const cfg of template) normalizedTemplate.push(primitiveToConfig(cfg));\n return {\n type: \"MakeArray\",\n template: normalizedTemplate,\n } as Cfg as any;\n}\n\nexport function getJsonField<\n const Source extends PrimitiveOrConfig,\n const Field extends PrimitiveOrConfig,\n>(\n source: Source,\n field: Field,\n): TypedConfig<ActGetField<POCExtractAction<Source>, POCExtractAction<Field>>> {\n return {\n type: \"GetJsonField\",\n source: primitiveToConfig(source),\n field: primitiveToConfig(field),\n } as Cfg as any;\n}\n\nexport function mapRecordValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n>(\n source: Source & CheckedSyncConf<Source>,\n mapping: Mapping,\n): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, \"$it\">>;\nexport function mapRecordValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n>(\n source: Source,\n mapping: Mapping & CheckedSyncConf<Mapping>,\n): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, \"$it\">>;\nexport function mapRecordValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string,\n>(\n source: Source & CheckedSyncConf<Source>,\n mapping: Mapping,\n itVar: ItVar,\n): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;\nexport function mapRecordValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string,\n>(\n source: Source,\n mapping: Mapping & CheckedSyncConf<Mapping>,\n itVar: ItVar,\n): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;\nexport function mapRecordValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string,\n>(\n source: Source,\n mapping: Mapping,\n itVar: ItVar = \"$it\" as ItVar,\n): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>> {\n return {\n type: \"MapRecordValues\",\n source,\n mapping,\n itVar,\n } as Cfg as any;\n}\n\nexport function mapArrayValues<const Source extends TypedConfig, const Mapping extends TypedConfig>(\n source: Source & CheckedSyncConf<Source>,\n mapping: Mapping,\n): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, \"$it\">>;\nexport function mapArrayValues<const Source extends TypedConfig, const Mapping extends TypedConfig>(\n source: Source,\n mapping: Mapping & CheckedSyncConf<Mapping>,\n): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, \"$it\">>;\nexport function mapArrayValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string,\n>(\n source: Source & CheckedSyncConf<Source>,\n mapping: Mapping,\n itVar: ItVar,\n): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;\nexport function mapArrayValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string,\n>(\n source: Source,\n mapping: Mapping & CheckedSyncConf<Mapping>,\n itVar: ItVar,\n): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;\nexport function mapArrayValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string,\n>(\n source: Source,\n mapping: Mapping,\n itVar: ItVar = \"$it\" as ItVar,\n): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>> {\n return {\n type: \"MapArrayValues\",\n source,\n mapping,\n itVar,\n } as Cfg as any;\n}\n\nexport function flatten<const Source extends TypedConfig>(\n source: Source,\n): TypedConfig<ActFlatten<ExtractAction<Source>>> {\n return {\n type: \"Flatten\",\n source,\n } as Cfg as any;\n}\n\n//\n// Boolean\n//\n\nexport function isEmpty<const Arg extends TypedConfig>(\n arg: Arg,\n): TypedConfig<ActIsEmpty<ExtractAction<Arg>>> {\n return {\n type: \"IsEmpty\",\n arg,\n } as Cfg as any;\n}\n\nexport function not<const Operand extends TypedConfig>(\n operand: Operand,\n): TypedConfig<ActNot<ExtractAction<Operand>>> {\n return {\n type: \"Not\",\n operand,\n } as Cfg as any;\n}\n\nexport function and<const Operand1 extends TypedConfig, const Operand2 extends TypedConfig>(\n operand1: Operand1,\n operand2: Operand2,\n): TypedConfig<ActAnd<ExtractAction<Operand1>, ExtractAction<Operand2>>> {\n return {\n type: \"And\",\n operand1,\n operand2,\n } as Cfg as any;\n}\n\nexport function or<const Operand1 extends TypedConfig, const Operand2 extends TypedConfig>(\n operand1: Operand1,\n operand2: Operand2,\n): TypedConfig<ActOr<ExtractAction<Operand1>, ExtractAction<Operand2>>> {\n return {\n type: \"Or\",\n operand1,\n operand2,\n } as Cfg as any;\n}\n\n//\n// Resources\n//\n\nexport function getResourceField<\n const Source extends PrimitiveOrConfig,\n const Field extends PrimitiveOrConfig,\n>(\n source: Source,\n field: Field,\n): TypedConfig<ActGetResourceField<POCExtractAction<Source>, POCExtractAction<Field>>> {\n return {\n type: \"GetResourceField\",\n source: primitiveToConfig(source),\n field: primitiveToConfig(field),\n } as Cfg as any;\n}\n\nexport function getResourceValueAsJson<T>() {\n return function <const Source extends PrimitiveOrConfig>(\n source: Source,\n ): TypedConfig<ActGetResourceValueAsJson<POCExtractAction<Source>, T>> {\n return {\n type: \"GetResourceValueAsJson\",\n source: primitiveToConfig(source),\n } as Cfg as any;\n };\n}\n\nexport function mapResourceFields<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n>(\n source: Source,\n mapping: Mapping,\n): TypedConfig<ActMapResourceFields<ExtractAction<Source>, ExtractAction<Mapping>, \"$it\">>;\nexport function mapResourceFields<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string,\n>(\n source: Source,\n mapping: Mapping,\n itVar: ItVar,\n): TypedConfig<ActMapResourceFields<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;\nexport function mapResourceFields<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string,\n>(\n source: Source,\n mapping: Mapping,\n itVar: ItVar = \"$it\" as ItVar,\n): TypedConfig<ActMapResourceFields<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>> {\n return {\n type: \"MapResourceFields\",\n source,\n mapping,\n itVar,\n } as Cfg as TypedConfig<\n ActMapResourceFields<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>\n >;\n}\n\n//\n// Download Blobs\n//\n\nexport function getBlobContent<const Source extends TypedConfig>(\n source: Source,\n range?: RangeBytes,\n): TypedConfig<ActGetBlobContent<ExtractAction<Source>>> {\n return {\n type: \"GetBlobContent\",\n range,\n source: primitiveToConfig(source),\n } as Cfg as any;\n}\n\nexport function getBlobContentAsString<const Source extends TypedConfig>(\n source: Source,\n range?: RangeBytes,\n): TypedConfig<ActGetBlobContentAsString<ExtractAction<Source>>> {\n return {\n type: \"GetBlobContentAsString\",\n range,\n source: primitiveToConfig(source),\n } as Cfg as any;\n}\n\nexport function getBlobContentAsJson<T>() {\n return function <const Source extends TypedConfig>(\n source: Source,\n range?: RangeBytes,\n ): TypedConfig<ActGetBlobContentAsJson<ExtractAction<Source>, T>> {\n return {\n type: \"GetBlobContentAsJson\",\n range,\n source: primitiveToConfig(source),\n } as Cfg as any;\n };\n}\n\nexport function getDownloadedBlobContent<const Source extends TypedConfig>(\n source: Source,\n): TypedConfig<ActGetDownloadedBlobContent<ExtractAction<Source>>> {\n return {\n type: \"GetDownloadedBlobContent\",\n source: primitiveToConfig(source),\n } as Cfg as any;\n}\n\nexport function getOnDemandBlobContent<const Source extends TypedConfig>(\n source: Source,\n): TypedConfig<ActGetOnDemandBlobContent<ExtractAction<Source>>> {\n return {\n type: \"GetOnDemandBlobContent\",\n source: primitiveToConfig(source),\n } as Cfg as any;\n}\n\n//\n// Download Blobs to URLs\n//\n\nexport function extractArchiveAndGetURL<const Source extends TypedConfig>(\n source: Source,\n format: ArchiveFormat,\n): TypedConfig<ActExtractArchiveAndGetURL<ExtractAction<Source>>> {\n return {\n type: \"ExtractArchiveAndGetURL\",\n format,\n source: primitiveToConfig(source),\n } as Cfg as any;\n}\n\n//\n// Upload Blobs\n//\n\nexport function getImportProgress<const Source extends TypedConfig>(\n source: Source,\n): TypedConfig<ActImportProgress<ExtractAction<Source>>> {\n return {\n type: \"GetImportProgress\",\n source: primitiveToConfig(source),\n } as Cfg as any;\n}\n\n//\n// Logs\n//\n\nexport function getLastLogs<const Source extends TypedConfig>(\n source: Source,\n lines: number,\n): TypedConfig<ActGetLastLogs<ExtractAction<Source>>> {\n return {\n type: \"GetLastLogs\",\n source: primitiveToConfig(source),\n lines,\n } as Cfg as any;\n}\n\nexport function getProgressLog<const Source extends TypedConfig>(\n source: Source,\n patternToSearch: string,\n): TypedConfig<ActGetProgressLog<ExtractAction<Source>>> {\n return {\n type: \"GetProgressLog\",\n source: primitiveToConfig(source),\n patternToSearch,\n } as Cfg as any;\n}\n\nexport function getProgressLogWithInfo<const Source extends TypedConfig>(\n source: Source,\n patternToSearch: string,\n): TypedConfig<ActGetProgressLogWithInfo<ExtractAction<Source>>> {\n return {\n type: \"GetProgressLogWithInfo\",\n source: primitiveToConfig(source),\n patternToSearch,\n } as Cfg as any;\n}\n\nexport function getLogHandle<const Source extends TypedConfig>(\n source: Source,\n): TypedConfig<ActGetLogHandle<ExtractAction<Source>>> {\n return {\n type: \"GetLogHandle\",\n source: primitiveToConfig(source),\n } as Cfg as any;\n}\n"],"names":[],"mappings":";;AAuCA;AACA;AACA;AAEA,SAAS,iBAAiB,CAAC,KAAwB,EAAA;IACjD,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,SAAS;AAC1B,QAAA,KAAK,KAAK,IAAI;AAEd,QAAA,OAAO,YAAY,CAAC,KAAK,CAAC;;AACvB,QAAA,OAAO,KAAoB;AAClC;AAEA;AACA;AACA;AAEM,SAAU,UAAU,CAAyB,QAAW,EAAA;AAC5D,IAAA,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAgB;AACvD;AAEA;AACA;AACA;AAEM,SAAU,OAAO,CACrB,GAAW,EAAA;IAEX,OAAO;AACL,QAAA,IAAI,EAAE,SAAS;QACf,GAAG;KACU;AACjB;AAEA;AACA;AACA;MAEa,IAAI,GAAG,UAAU,CAAC,OAAO;MACzB,EAAE,GAAG,UAAU,CAAC,KAAK;MACrB,WAAW,GAAG,UAAU,CAAC,OAAO;MAChC,cAAc,GAAG,UAAU,CAAC,UAAU;MACtC,OAAO,GAAG,UAAU,CAAC,KAAK;AAEvC;AACA;AACA;AAEM,SAAU,YAAY,CAAU,KAAQ,EAAA;AAC5C,IAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAgB;AACnD;AAEM,SAAU,UAAU,CACxB,QAAW,EAAA;IAEX,MAAM,kBAAkB,GAAgC,EAAE;AAC1D,IAAA,KAAK,MAA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pC,MAAc,EACd,eAAuB,EAAA;IAEvB,OAAO;AACL,QAAA,IAAI,EAAE,wBAAwB;AAC9B,QAAA,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC;QACjC,eAAe;KACF;AACjB;AAEM,SAAU,YAAY,CAC1B,MAAc,EAAA;IAEd,OAAO;AACL,QAAA,IAAI,EAAE,cAAc;AACpB,QAAA,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC;KACpB;AACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"actions.cjs","names":[],"sources":["../../src/config/actions.ts"],"sourcesContent":["import type {\n ActGetField,\n ActGetFromCtx,\n ActGetImmediate,\n ActGetResourceField,\n ActGetResourceValueAsJson,\n ActMakeObject,\n ActMapRecordValues,\n ActMapResourceFields,\n ActMapArrayValues,\n ActIsEmpty,\n ActNot,\n ActIsolate,\n ActGetBlobContentAsJson,\n ActGetBlobContentAsString,\n ActGetBlobContent,\n ActAnd,\n ActOr,\n ActMakeArray,\n ActFlatten,\n ActGetDownloadedBlobContent,\n ActGetOnDemandBlobContent,\n ActImportProgress,\n ActGetLastLogs,\n ActGetProgressLog,\n ActGetProgressLogWithInfo,\n ActGetLogHandle,\n ActExtractArchiveAndGetURL,\n} from \"./actions_kinds\";\nimport type {\n ExtractAction,\n POCExtractAction,\n PrimitiveOrConfig,\n TypedConfig,\n} from \"./type_engine\";\nimport type { Cfg } from \"./model\";\nimport type { CheckedSyncConf } from \"./type_util\";\nimport type { ArchiveFormat, RangeBytes } from \"@milaboratories/pl-model-common\";\n\n//\n// Helpers\n//\n\nfunction primitiveToConfig(value: PrimitiveOrConfig): TypedConfig {\n if (\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\" ||\n value === null\n )\n return getImmediate(value);\n else return value as TypedConfig;\n}\n\n//\n// Context\n//\n\nexport function getFromCfg<const V extends string>(variable: V): TypedConfig<ActGetFromCtx<V>> {\n return { type: \"GetFromCtx\", variable } as Cfg as any;\n}\n\n//\n// Isolate\n//\n\nexport function isolate<const Config extends TypedConfig>(\n cfg: Config,\n): TypedConfig<ActIsolate<ExtractAction<Config>>> {\n return {\n type: \"Isolate\",\n cfg,\n } as Cfg as any;\n}\n\n//\n// Well-known Context Vars\n//\n\nexport const Args = getFromCfg(\"$args\");\nexport const It = getFromCfg(\"$it\");\nexport const MainOutputs = getFromCfg(\"$prod\");\nexport const StagingOutputs = getFromCfg(\"$staging\");\nexport const UiState = getFromCfg(\"$ui\");\n\n//\n// Json\n//\n\nexport function getImmediate<const T>(value: T): TypedConfig<ActGetImmediate<T>> {\n return { type: \"Immediate\", value } as Cfg as any;\n}\n\nexport function makeObject<const T extends Record<string, PrimitiveOrConfig>>(\n template: T,\n): TypedConfig<ActMakeObject<{ [Key in keyof T]: POCExtractAction<T[Key]> }>> {\n const normalizedTemplate: Record<string, TypedConfig> = {};\n for (const [k, cfg] of Object.entries(template)) normalizedTemplate[k] = primitiveToConfig(cfg);\n return {\n type: \"MakeObject\",\n template: normalizedTemplate,\n } as Cfg as any;\n}\n\nexport function makeArray<const T extends PrimitiveOrConfig[]>(\n ...template: T\n): TypedConfig<ActMakeArray<{ [Key in keyof T]: POCExtractAction<T[Key]> }>> {\n const normalizedTemplate: TypedConfig[] = [];\n for (const cfg of template) normalizedTemplate.push(primitiveToConfig(cfg));\n return {\n type: \"MakeArray\",\n template: normalizedTemplate,\n } as Cfg as any;\n}\n\nexport function getJsonField<\n const Source extends PrimitiveOrConfig,\n const Field extends PrimitiveOrConfig,\n>(\n source: Source,\n field: Field,\n): TypedConfig<ActGetField<POCExtractAction<Source>, POCExtractAction<Field>>> {\n return {\n type: \"GetJsonField\",\n source: primitiveToConfig(source),\n field: primitiveToConfig(field),\n } as Cfg as any;\n}\n\nexport function mapRecordValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n>(\n source: Source & CheckedSyncConf<Source>,\n mapping: Mapping,\n): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, \"$it\">>;\nexport function mapRecordValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n>(\n source: Source,\n mapping: Mapping & CheckedSyncConf<Mapping>,\n): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, \"$it\">>;\nexport function mapRecordValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string,\n>(\n source: Source & CheckedSyncConf<Source>,\n mapping: Mapping,\n itVar: ItVar,\n): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;\nexport function mapRecordValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string,\n>(\n source: Source,\n mapping: Mapping & CheckedSyncConf<Mapping>,\n itVar: ItVar,\n): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;\nexport function mapRecordValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string,\n>(\n source: Source,\n mapping: Mapping,\n itVar: ItVar = \"$it\" as ItVar,\n): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>> {\n return {\n type: \"MapRecordValues\",\n source,\n mapping,\n itVar,\n } as Cfg as any;\n}\n\nexport function mapArrayValues<const Source extends TypedConfig, const Mapping extends TypedConfig>(\n source: Source & CheckedSyncConf<Source>,\n mapping: Mapping,\n): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, \"$it\">>;\nexport function mapArrayValues<const Source extends TypedConfig, const Mapping extends TypedConfig>(\n source: Source,\n mapping: Mapping & CheckedSyncConf<Mapping>,\n): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, \"$it\">>;\nexport function mapArrayValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string,\n>(\n source: Source & CheckedSyncConf<Source>,\n mapping: Mapping,\n itVar: ItVar,\n): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;\nexport function mapArrayValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string,\n>(\n source: Source,\n mapping: Mapping & CheckedSyncConf<Mapping>,\n itVar: ItVar,\n): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;\nexport function mapArrayValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string,\n>(\n source: Source,\n mapping: Mapping,\n itVar: ItVar = \"$it\" as ItVar,\n): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>> {\n return {\n type: \"MapArrayValues\",\n source,\n mapping,\n itVar,\n } as Cfg as any;\n}\n\nexport function flatten<const Source extends TypedConfig>(\n source: Source,\n): TypedConfig<ActFlatten<ExtractAction<Source>>> {\n return {\n type: \"Flatten\",\n source,\n } as Cfg as any;\n}\n\n//\n// Boolean\n//\n\nexport function isEmpty<const Arg extends TypedConfig>(\n arg: Arg,\n): TypedConfig<ActIsEmpty<ExtractAction<Arg>>> {\n return {\n type: \"IsEmpty\",\n arg,\n } as Cfg as any;\n}\n\nexport function not<const Operand extends TypedConfig>(\n operand: Operand,\n): TypedConfig<ActNot<ExtractAction<Operand>>> {\n return {\n type: \"Not\",\n operand,\n } as Cfg as any;\n}\n\nexport function and<const Operand1 extends TypedConfig, const Operand2 extends TypedConfig>(\n operand1: Operand1,\n operand2: Operand2,\n): TypedConfig<ActAnd<ExtractAction<Operand1>, ExtractAction<Operand2>>> {\n return {\n type: \"And\",\n operand1,\n operand2,\n } as Cfg as any;\n}\n\nexport function or<const Operand1 extends TypedConfig, const Operand2 extends TypedConfig>(\n operand1: Operand1,\n operand2: Operand2,\n): TypedConfig<ActOr<ExtractAction<Operand1>, ExtractAction<Operand2>>> {\n return {\n type: \"Or\",\n operand1,\n operand2,\n } as Cfg as any;\n}\n\n//\n// Resources\n//\n\nexport function getResourceField<\n const Source extends PrimitiveOrConfig,\n const Field extends PrimitiveOrConfig,\n>(\n source: Source,\n field: Field,\n): TypedConfig<ActGetResourceField<POCExtractAction<Source>, POCExtractAction<Field>>> {\n return {\n type: \"GetResourceField\",\n source: primitiveToConfig(source),\n field: primitiveToConfig(field),\n } as Cfg as any;\n}\n\nexport function getResourceValueAsJson<T>() {\n return function <const Source extends PrimitiveOrConfig>(\n source: Source,\n ): TypedConfig<ActGetResourceValueAsJson<POCExtractAction<Source>, T>> {\n return {\n type: \"GetResourceValueAsJson\",\n source: primitiveToConfig(source),\n } as Cfg as any;\n };\n}\n\nexport function mapResourceFields<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n>(\n source: Source,\n mapping: Mapping,\n): TypedConfig<ActMapResourceFields<ExtractAction<Source>, ExtractAction<Mapping>, \"$it\">>;\nexport function mapResourceFields<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string,\n>(\n source: Source,\n mapping: Mapping,\n itVar: ItVar,\n): TypedConfig<ActMapResourceFields<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;\nexport function mapResourceFields<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string,\n>(\n source: Source,\n mapping: Mapping,\n itVar: ItVar = \"$it\" as ItVar,\n): TypedConfig<ActMapResourceFields<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>> {\n return {\n type: \"MapResourceFields\",\n source,\n mapping,\n itVar,\n } as Cfg as TypedConfig<\n ActMapResourceFields<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>\n >;\n}\n\n//\n// Download Blobs\n//\n\nexport function getBlobContent<const Source extends TypedConfig>(\n source: Source,\n range?: RangeBytes,\n): TypedConfig<ActGetBlobContent<ExtractAction<Source>>> {\n return {\n type: \"GetBlobContent\",\n range,\n source: primitiveToConfig(source),\n } as Cfg as any;\n}\n\nexport function getBlobContentAsString<const Source extends TypedConfig>(\n source: Source,\n range?: RangeBytes,\n): TypedConfig<ActGetBlobContentAsString<ExtractAction<Source>>> {\n return {\n type: \"GetBlobContentAsString\",\n range,\n source: primitiveToConfig(source),\n } as Cfg as any;\n}\n\nexport function getBlobContentAsJson<T>() {\n return function <const Source extends TypedConfig>(\n source: Source,\n range?: RangeBytes,\n ): TypedConfig<ActGetBlobContentAsJson<ExtractAction<Source>, T>> {\n return {\n type: \"GetBlobContentAsJson\",\n range,\n source: primitiveToConfig(source),\n } as Cfg as any;\n };\n}\n\nexport function getDownloadedBlobContent<const Source extends TypedConfig>(\n source: Source,\n): TypedConfig<ActGetDownloadedBlobContent<ExtractAction<Source>>> {\n return {\n type: \"GetDownloadedBlobContent\",\n source: primitiveToConfig(source),\n } as Cfg as any;\n}\n\nexport function getOnDemandBlobContent<const Source extends TypedConfig>(\n source: Source,\n): TypedConfig<ActGetOnDemandBlobContent<ExtractAction<Source>>> {\n return {\n type: \"GetOnDemandBlobContent\",\n source: primitiveToConfig(source),\n } as Cfg as any;\n}\n\n//\n// Download Blobs to URLs\n//\n\nexport function extractArchiveAndGetURL<const Source extends TypedConfig>(\n source: Source,\n format: ArchiveFormat,\n): TypedConfig<ActExtractArchiveAndGetURL<ExtractAction<Source>>> {\n return {\n type: \"ExtractArchiveAndGetURL\",\n format,\n source: primitiveToConfig(source),\n } as Cfg as any;\n}\n\n//\n// Upload Blobs\n//\n\nexport function getImportProgress<const Source extends TypedConfig>(\n source: Source,\n): TypedConfig<ActImportProgress<ExtractAction<Source>>> {\n return {\n type: \"GetImportProgress\",\n source: primitiveToConfig(source),\n } as Cfg as any;\n}\n\n//\n// Logs\n//\n\nexport function getLastLogs<const Source extends TypedConfig>(\n source: Source,\n lines: number,\n): TypedConfig<ActGetLastLogs<ExtractAction<Source>>> {\n return {\n type: \"GetLastLogs\",\n source: primitiveToConfig(source),\n lines,\n } as Cfg as any;\n}\n\nexport function getProgressLog<const Source extends TypedConfig>(\n source: Source,\n patternToSearch: string,\n): TypedConfig<ActGetProgressLog<ExtractAction<Source>>> {\n return {\n type: \"GetProgressLog\",\n source: primitiveToConfig(source),\n patternToSearch,\n } as Cfg as any;\n}\n\nexport function getProgressLogWithInfo<const Source extends TypedConfig>(\n source: Source,\n patternToSearch: string,\n): TypedConfig<ActGetProgressLogWithInfo<ExtractAction<Source>>> {\n return {\n type: \"GetProgressLogWithInfo\",\n source: primitiveToConfig(source),\n patternToSearch,\n } as Cfg as any;\n}\n\nexport function getLogHandle<const Source extends TypedConfig>(\n source: Source,\n): TypedConfig<ActGetLogHandle<ExtractAction<Source>>> {\n return {\n type: \"GetLogHandle\",\n source: primitiveToConfig(source),\n } as Cfg as any;\n}\n"],"mappings":";;AA2CA,SAAS,kBAAkB,OAAuC;AAChE,KACE,OAAO,UAAU,YACjB,OAAO,UAAU,YACjB,OAAO,UAAU,aACjB,UAAU,KAEV,QAAO,aAAa,MAAM;KACvB,QAAO;;AAOd,SAAgB,WAAmC,UAA4C;AAC7F,QAAO;EAAE,MAAM;EAAc;EAAU;;AAOzC,SAAgB,QACd,KACgD;AAChD,QAAO;EACL,MAAM;EACN;EACD;;AAOH,MAAa,OAAO,WAAW,QAAQ;AACvC,MAAa,KAAK,WAAW,MAAM;AACnC,MAAa,cAAc,WAAW,QAAQ;AAC9C,MAAa,iBAAiB,WAAW,WAAW;AACpD,MAAa,UAAU,WAAW,MAAM;AAMxC,SAAgB,aAAsB,OAA2C;AAC/E,QAAO;EAAE,MAAM;EAAa;EAAO;;AAGrC,SAAgB,WACd,UAC4E;CAC5E,MAAM,qBAAkD,EAAE;AAC1D,MAAK,MAAM,CAAC,GAAG,QAAQ,OAAO,QAAQ,SAAS,CAAE,oBAAmB,KAAK,kBAAkB,IAAI;AAC/F,QAAO;EACL,MAAM;EACN,UAAU;EACX;;AAGH,SAAgB,UACd,GAAG,UACwE;CAC3E,MAAM,qBAAoC,EAAE;AAC5C,MAAK,MAAM,OAAO,SAAU,oBAAmB,KAAK,kBAAkB,IAAI,CAAC;AAC3E,QAAO;EACL,MAAM;EACN,UAAU;EAC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,QAAO;EACL,MAAM;EACN,QAAQ,kBAAkB,OAAO;EAClC;;AAGH,SAAgB,uBACd,QAC+D;AAC/D,QAAO;EACL,MAAM;EACN,QAAQ,kBAAkB,OAAO;EAClC;;AAOH,SAAgB,wBACd,QACA,QACgE;AAChE,QAAO;EACL,MAAM;EACN;EACA,QAAQ,kBAAkB,OAAO;EAClC;;AAOH,SAAgB,kBACd,QACuD;AACvD,QAAO;EACL,MAAM;EACN,QAAQ,kBAAkB,OAAO;EAClC;;AAOH,SAAgB,YACd,QACA,OACoD;AACpD,QAAO;EACL,MAAM;EACN,QAAQ,kBAAkB,OAAO;EACjC;EACD;;AAGH,SAAgB,eACd,QACA,iBACuD;AACvD,QAAO;EACL,MAAM;EACN,QAAQ,kBAAkB,OAAO;EACjC;EACD;;AAGH,SAAgB,uBACd,QACA,iBAC+D;AAC/D,QAAO;EACL,MAAM;EACN,QAAQ,kBAAkB,OAAO;EACjC;EACD;;AAGH,SAAgB,aACd,QACqD;AACrD,QAAO;EACL,MAAM;EACN,QAAQ,kBAAkB,OAAO;EAClC"}
@@ -1,48 +1,48 @@
1
- import type { ActGetField, ActGetFromCtx, ActGetImmediate, ActGetResourceField, ActGetResourceValueAsJson, ActMakeObject, ActMapRecordValues, ActMapResourceFields, ActMapArrayValues, ActIsEmpty, ActNot, ActIsolate, ActGetBlobContentAsJson, ActGetBlobContentAsString, ActGetBlobContent, ActAnd, ActOr, ActMakeArray, ActFlatten, ActGetDownloadedBlobContent, ActGetOnDemandBlobContent, ActImportProgress, ActGetLastLogs, ActGetProgressLog, ActGetProgressLogWithInfo, ActGetLogHandle, ActExtractArchiveAndGetURL } from "./actions_kinds";
2
- import type { ExtractAction, POCExtractAction, PrimitiveOrConfig, TypedConfig } from "./type_engine";
3
- import type { CheckedSyncConf } from "./type_util";
4
- import type { ArchiveFormat, RangeBytes } from "@milaboratories/pl-model-common";
5
- export declare function getFromCfg<const V extends string>(variable: V): TypedConfig<ActGetFromCtx<V>>;
6
- export declare function isolate<const Config extends TypedConfig>(cfg: Config): TypedConfig<ActIsolate<ExtractAction<Config>>>;
7
- export declare const Args: TypedConfig<ActGetFromCtx<"$args">>;
8
- export declare const It: TypedConfig<ActGetFromCtx<"$it">>;
9
- export declare const MainOutputs: TypedConfig<ActGetFromCtx<"$prod">>;
10
- export declare const StagingOutputs: TypedConfig<ActGetFromCtx<"$staging">>;
11
- export declare const UiState: TypedConfig<ActGetFromCtx<"$ui">>;
12
- export declare function getImmediate<const T>(value: T): TypedConfig<ActGetImmediate<T>>;
13
- export declare function makeObject<const T extends Record<string, PrimitiveOrConfig>>(template: T): TypedConfig<ActMakeObject<{
14
- [Key in keyof T]: POCExtractAction<T[Key]>;
15
- }>>;
16
- export declare function makeArray<const T extends PrimitiveOrConfig[]>(...template: T): TypedConfig<ActMakeArray<{
17
- [Key in keyof T]: POCExtractAction<T[Key]>;
18
- }>>;
19
- export declare function getJsonField<const Source extends PrimitiveOrConfig, const Field extends PrimitiveOrConfig>(source: Source, field: Field): TypedConfig<ActGetField<POCExtractAction<Source>, POCExtractAction<Field>>>;
20
- export declare function mapRecordValues<const Source extends TypedConfig, const Mapping extends TypedConfig>(source: Source & CheckedSyncConf<Source>, mapping: Mapping): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, "$it">>;
21
- export declare function mapRecordValues<const Source extends TypedConfig, const Mapping extends TypedConfig>(source: Source, mapping: Mapping & CheckedSyncConf<Mapping>): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, "$it">>;
22
- export declare function mapRecordValues<const Source extends TypedConfig, const Mapping extends TypedConfig, const ItVar extends string>(source: Source & CheckedSyncConf<Source>, mapping: Mapping, itVar: ItVar): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;
23
- export declare function mapRecordValues<const Source extends TypedConfig, const Mapping extends TypedConfig, const ItVar extends string>(source: Source, mapping: Mapping & CheckedSyncConf<Mapping>, itVar: ItVar): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;
24
- export declare function mapArrayValues<const Source extends TypedConfig, const Mapping extends TypedConfig>(source: Source & CheckedSyncConf<Source>, mapping: Mapping): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, "$it">>;
25
- export declare function mapArrayValues<const Source extends TypedConfig, const Mapping extends TypedConfig>(source: Source, mapping: Mapping & CheckedSyncConf<Mapping>): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, "$it">>;
26
- export declare function mapArrayValues<const Source extends TypedConfig, const Mapping extends TypedConfig, const ItVar extends string>(source: Source & CheckedSyncConf<Source>, mapping: Mapping, itVar: ItVar): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;
27
- export declare function mapArrayValues<const Source extends TypedConfig, const Mapping extends TypedConfig, const ItVar extends string>(source: Source, mapping: Mapping & CheckedSyncConf<Mapping>, itVar: ItVar): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;
28
- export declare function flatten<const Source extends TypedConfig>(source: Source): TypedConfig<ActFlatten<ExtractAction<Source>>>;
29
- export declare function isEmpty<const Arg extends TypedConfig>(arg: Arg): TypedConfig<ActIsEmpty<ExtractAction<Arg>>>;
30
- export declare function not<const Operand extends TypedConfig>(operand: Operand): TypedConfig<ActNot<ExtractAction<Operand>>>;
31
- export declare function and<const Operand1 extends TypedConfig, const Operand2 extends TypedConfig>(operand1: Operand1, operand2: Operand2): TypedConfig<ActAnd<ExtractAction<Operand1>, ExtractAction<Operand2>>>;
32
- export declare function or<const Operand1 extends TypedConfig, const Operand2 extends TypedConfig>(operand1: Operand1, operand2: Operand2): TypedConfig<ActOr<ExtractAction<Operand1>, ExtractAction<Operand2>>>;
33
- export declare function getResourceField<const Source extends PrimitiveOrConfig, const Field extends PrimitiveOrConfig>(source: Source, field: Field): TypedConfig<ActGetResourceField<POCExtractAction<Source>, POCExtractAction<Field>>>;
34
- export declare function getResourceValueAsJson<T>(): <const Source extends PrimitiveOrConfig>(source: Source) => TypedConfig<ActGetResourceValueAsJson<POCExtractAction<Source>, T>>;
35
- export declare function mapResourceFields<const Source extends TypedConfig, const Mapping extends TypedConfig>(source: Source, mapping: Mapping): TypedConfig<ActMapResourceFields<ExtractAction<Source>, ExtractAction<Mapping>, "$it">>;
36
- export declare function mapResourceFields<const Source extends TypedConfig, const Mapping extends TypedConfig, const ItVar extends string>(source: Source, mapping: Mapping, itVar: ItVar): TypedConfig<ActMapResourceFields<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;
37
- export declare function getBlobContent<const Source extends TypedConfig>(source: Source, range?: RangeBytes): TypedConfig<ActGetBlobContent<ExtractAction<Source>>>;
38
- export declare function getBlobContentAsString<const Source extends TypedConfig>(source: Source, range?: RangeBytes): TypedConfig<ActGetBlobContentAsString<ExtractAction<Source>>>;
39
- export declare function getBlobContentAsJson<T>(): <const Source extends TypedConfig>(source: Source, range?: RangeBytes) => TypedConfig<ActGetBlobContentAsJson<ExtractAction<Source>, T>>;
40
- export declare function getDownloadedBlobContent<const Source extends TypedConfig>(source: Source): TypedConfig<ActGetDownloadedBlobContent<ExtractAction<Source>>>;
41
- export declare function getOnDemandBlobContent<const Source extends TypedConfig>(source: Source): TypedConfig<ActGetOnDemandBlobContent<ExtractAction<Source>>>;
42
- export declare function extractArchiveAndGetURL<const Source extends TypedConfig>(source: Source, format: ArchiveFormat): TypedConfig<ActExtractArchiveAndGetURL<ExtractAction<Source>>>;
43
- export declare function getImportProgress<const Source extends TypedConfig>(source: Source): TypedConfig<ActImportProgress<ExtractAction<Source>>>;
44
- export declare function getLastLogs<const Source extends TypedConfig>(source: Source, lines: number): TypedConfig<ActGetLastLogs<ExtractAction<Source>>>;
45
- export declare function getProgressLog<const Source extends TypedConfig>(source: Source, patternToSearch: string): TypedConfig<ActGetProgressLog<ExtractAction<Source>>>;
46
- export declare function getProgressLogWithInfo<const Source extends TypedConfig>(source: Source, patternToSearch: string): TypedConfig<ActGetProgressLogWithInfo<ExtractAction<Source>>>;
47
- export declare function getLogHandle<const Source extends TypedConfig>(source: Source): TypedConfig<ActGetLogHandle<ExtractAction<Source>>>;
1
+ import { ExtractAction, POCExtractAction, PrimitiveOrConfig, TypedConfig } from "./type_engine.js";
2
+ import { CheckedSyncConf } from "./type_util.js";
3
+ import { ActAnd, ActExtractArchiveAndGetURL, ActFlatten, ActGetBlobContent, ActGetBlobContentAsJson, ActGetBlobContentAsString, ActGetDownloadedBlobContent, ActGetField, ActGetFromCtx, ActGetImmediate, ActGetLastLogs, ActGetLogHandle, ActGetOnDemandBlobContent, ActGetProgressLog, ActGetProgressLogWithInfo, ActGetResourceField, ActGetResourceValueAsJson, ActImportProgress, ActIsEmpty, ActIsolate, ActMakeArray, ActMakeObject, ActMapArrayValues, ActMapRecordValues, ActMapResourceFields, ActNot, ActOr } from "./actions_kinds.js";
4
+ import { ArchiveFormat, RangeBytes } from "@milaboratories/pl-model-common";
5
+
6
+ //#region src/config/actions.d.ts
7
+ declare function getFromCfg<const V extends string>(variable: V): TypedConfig<ActGetFromCtx<V>>;
8
+ declare function isolate<const Config extends TypedConfig>(cfg: Config): TypedConfig<ActIsolate<ExtractAction<Config>>>;
9
+ declare const Args: TypedConfig<ActGetFromCtx<"$args">>;
10
+ declare const It: TypedConfig<ActGetFromCtx<"$it">>;
11
+ declare const MainOutputs: TypedConfig<ActGetFromCtx<"$prod">>;
12
+ declare const StagingOutputs: TypedConfig<ActGetFromCtx<"$staging">>;
13
+ declare const UiState: TypedConfig<ActGetFromCtx<"$ui">>;
14
+ declare function getImmediate<const T>(value: T): TypedConfig<ActGetImmediate<T>>;
15
+ declare function makeObject<const T extends Record<string, PrimitiveOrConfig>>(template: T): TypedConfig<ActMakeObject<{ [Key in keyof T]: POCExtractAction<T[Key]> }>>;
16
+ declare function makeArray<const T extends PrimitiveOrConfig[]>(...template: T): TypedConfig<ActMakeArray<{ [Key in keyof T]: POCExtractAction<T[Key]> }>>;
17
+ declare function getJsonField<const Source extends PrimitiveOrConfig, const Field extends PrimitiveOrConfig>(source: Source, field: Field): TypedConfig<ActGetField<POCExtractAction<Source>, POCExtractAction<Field>>>;
18
+ declare function mapRecordValues<const Source extends TypedConfig, const Mapping extends TypedConfig>(source: Source & CheckedSyncConf<Source>, mapping: Mapping): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, "$it">>;
19
+ declare function mapRecordValues<const Source extends TypedConfig, const Mapping extends TypedConfig>(source: Source, mapping: Mapping & CheckedSyncConf<Mapping>): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, "$it">>;
20
+ declare function mapRecordValues<const Source extends TypedConfig, const Mapping extends TypedConfig, const ItVar extends string>(source: Source & CheckedSyncConf<Source>, mapping: Mapping, itVar: ItVar): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;
21
+ declare function mapRecordValues<const Source extends TypedConfig, const Mapping extends TypedConfig, const ItVar extends string>(source: Source, mapping: Mapping & CheckedSyncConf<Mapping>, itVar: ItVar): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;
22
+ declare function mapArrayValues<const Source extends TypedConfig, const Mapping extends TypedConfig>(source: Source & CheckedSyncConf<Source>, mapping: Mapping): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, "$it">>;
23
+ declare function mapArrayValues<const Source extends TypedConfig, const Mapping extends TypedConfig>(source: Source, mapping: Mapping & CheckedSyncConf<Mapping>): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, "$it">>;
24
+ declare function mapArrayValues<const Source extends TypedConfig, const Mapping extends TypedConfig, const ItVar extends string>(source: Source & CheckedSyncConf<Source>, mapping: Mapping, itVar: ItVar): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;
25
+ declare function mapArrayValues<const Source extends TypedConfig, const Mapping extends TypedConfig, const ItVar extends string>(source: Source, mapping: Mapping & CheckedSyncConf<Mapping>, itVar: ItVar): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;
26
+ declare function flatten<const Source extends TypedConfig>(source: Source): TypedConfig<ActFlatten<ExtractAction<Source>>>;
27
+ declare function isEmpty<const Arg extends TypedConfig>(arg: Arg): TypedConfig<ActIsEmpty<ExtractAction<Arg>>>;
28
+ declare function not<const Operand extends TypedConfig>(operand: Operand): TypedConfig<ActNot<ExtractAction<Operand>>>;
29
+ declare function and<const Operand1 extends TypedConfig, const Operand2 extends TypedConfig>(operand1: Operand1, operand2: Operand2): TypedConfig<ActAnd<ExtractAction<Operand1>, ExtractAction<Operand2>>>;
30
+ declare function or<const Operand1 extends TypedConfig, const Operand2 extends TypedConfig>(operand1: Operand1, operand2: Operand2): TypedConfig<ActOr<ExtractAction<Operand1>, ExtractAction<Operand2>>>;
31
+ declare function getResourceField<const Source extends PrimitiveOrConfig, const Field extends PrimitiveOrConfig>(source: Source, field: Field): TypedConfig<ActGetResourceField<POCExtractAction<Source>, POCExtractAction<Field>>>;
32
+ declare function getResourceValueAsJson<T>(): <const Source extends PrimitiveOrConfig>(source: Source) => TypedConfig<ActGetResourceValueAsJson<POCExtractAction<Source>, T>>;
33
+ declare function mapResourceFields<const Source extends TypedConfig, const Mapping extends TypedConfig>(source: Source, mapping: Mapping): TypedConfig<ActMapResourceFields<ExtractAction<Source>, ExtractAction<Mapping>, "$it">>;
34
+ declare function mapResourceFields<const Source extends TypedConfig, const Mapping extends TypedConfig, const ItVar extends string>(source: Source, mapping: Mapping, itVar: ItVar): TypedConfig<ActMapResourceFields<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;
35
+ declare function getBlobContent<const Source extends TypedConfig>(source: Source, range?: RangeBytes): TypedConfig<ActGetBlobContent<ExtractAction<Source>>>;
36
+ declare function getBlobContentAsString<const Source extends TypedConfig>(source: Source, range?: RangeBytes): TypedConfig<ActGetBlobContentAsString<ExtractAction<Source>>>;
37
+ declare function getBlobContentAsJson<T>(): <const Source extends TypedConfig>(source: Source, range?: RangeBytes) => TypedConfig<ActGetBlobContentAsJson<ExtractAction<Source>, T>>;
38
+ declare function getDownloadedBlobContent<const Source extends TypedConfig>(source: Source): TypedConfig<ActGetDownloadedBlobContent<ExtractAction<Source>>>;
39
+ declare function getOnDemandBlobContent<const Source extends TypedConfig>(source: Source): TypedConfig<ActGetOnDemandBlobContent<ExtractAction<Source>>>;
40
+ declare function extractArchiveAndGetURL<const Source extends TypedConfig>(source: Source, format: ArchiveFormat): TypedConfig<ActExtractArchiveAndGetURL<ExtractAction<Source>>>;
41
+ declare function getImportProgress<const Source extends TypedConfig>(source: Source): TypedConfig<ActImportProgress<ExtractAction<Source>>>;
42
+ declare function getLastLogs<const Source extends TypedConfig>(source: Source, lines: number): TypedConfig<ActGetLastLogs<ExtractAction<Source>>>;
43
+ declare function getProgressLog<const Source extends TypedConfig>(source: Source, patternToSearch: string): TypedConfig<ActGetProgressLog<ExtractAction<Source>>>;
44
+ declare function getProgressLogWithInfo<const Source extends TypedConfig>(source: Source, patternToSearch: string): TypedConfig<ActGetProgressLogWithInfo<ExtractAction<Source>>>;
45
+ declare function getLogHandle<const Source extends TypedConfig>(source: Source): TypedConfig<ActGetLogHandle<ExtractAction<Source>>>;
46
+ //#endregion
47
+ export { Args, It, MainOutputs, StagingOutputs, UiState, and, extractArchiveAndGetURL, flatten, getBlobContent, getBlobContentAsJson, getBlobContentAsString, getDownloadedBlobContent, getFromCfg, getImmediate, getImportProgress, getJsonField, getLastLogs, getLogHandle, getOnDemandBlobContent, getProgressLog, getProgressLogWithInfo, getResourceField, getResourceValueAsJson, isEmpty, isolate, makeArray, makeObject, mapArrayValues, mapRecordValues, mapResourceFields, not, or };
48
48
  //# sourceMappingURL=actions.d.ts.map
@@ -1,233 +1,201 @@
1
- //
2
- // Helpers
3
- //
1
+ //#region src/config/actions.ts
4
2
  function primitiveToConfig(value) {
5
- if (typeof value === "string" ||
6
- typeof value === "number" ||
7
- typeof value === "boolean" ||
8
- value === null)
9
- return getImmediate(value);
10
- else
11
- return value;
12
- }
13
- //
14
- // Context
15
- //
3
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === null) return getImmediate(value);
4
+ else return value;
5
+ }
16
6
  function getFromCfg(variable) {
17
- return { type: "GetFromCtx", variable };
7
+ return {
8
+ type: "GetFromCtx",
9
+ variable
10
+ };
18
11
  }
19
- //
20
- // Isolate
21
- //
22
12
  function isolate(cfg) {
23
- return {
24
- type: "Isolate",
25
- cfg,
26
- };
27
- }
28
- //
29
- // Well-known Context Vars
30
- //
13
+ return {
14
+ type: "Isolate",
15
+ cfg
16
+ };
17
+ }
31
18
  const Args = getFromCfg("$args");
32
19
  const It = getFromCfg("$it");
33
20
  const MainOutputs = getFromCfg("$prod");
34
21
  const StagingOutputs = getFromCfg("$staging");
35
22
  const UiState = getFromCfg("$ui");
36
- //
37
- // Json
38
- //
39
23
  function getImmediate(value) {
40
- return { type: "Immediate", value };
24
+ return {
25
+ type: "Immediate",
26
+ value
27
+ };
41
28
  }
42
29
  function makeObject(template) {
43
- const normalizedTemplate = {};
44
- for (const [k, cfg] of Object.entries(template))
45
- normalizedTemplate[k] = primitiveToConfig(cfg);
46
- return {
47
- type: "MakeObject",
48
- template: normalizedTemplate,
49
- };
30
+ const normalizedTemplate = {};
31
+ for (const [k, cfg] of Object.entries(template)) normalizedTemplate[k] = primitiveToConfig(cfg);
32
+ return {
33
+ type: "MakeObject",
34
+ template: normalizedTemplate
35
+ };
50
36
  }
51
37
  function makeArray(...template) {
52
- const normalizedTemplate = [];
53
- for (const cfg of template)
54
- normalizedTemplate.push(primitiveToConfig(cfg));
55
- return {
56
- type: "MakeArray",
57
- template: normalizedTemplate,
58
- };
38
+ const normalizedTemplate = [];
39
+ for (const cfg of template) normalizedTemplate.push(primitiveToConfig(cfg));
40
+ return {
41
+ type: "MakeArray",
42
+ template: normalizedTemplate
43
+ };
59
44
  }
60
45
  function getJsonField(source, field) {
61
- return {
62
- type: "GetJsonField",
63
- source: primitiveToConfig(source),
64
- field: primitiveToConfig(field),
65
- };
46
+ return {
47
+ type: "GetJsonField",
48
+ source: primitiveToConfig(source),
49
+ field: primitiveToConfig(field)
50
+ };
66
51
  }
67
52
  function mapRecordValues(source, mapping, itVar = "$it") {
68
- return {
69
- type: "MapRecordValues",
70
- source,
71
- mapping,
72
- itVar,
73
- };
53
+ return {
54
+ type: "MapRecordValues",
55
+ source,
56
+ mapping,
57
+ itVar
58
+ };
74
59
  }
75
60
  function mapArrayValues(source, mapping, itVar = "$it") {
76
- return {
77
- type: "MapArrayValues",
78
- source,
79
- mapping,
80
- itVar,
81
- };
61
+ return {
62
+ type: "MapArrayValues",
63
+ source,
64
+ mapping,
65
+ itVar
66
+ };
82
67
  }
83
68
  function flatten(source) {
84
- return {
85
- type: "Flatten",
86
- source,
87
- };
88
- }
89
- //
90
- // Boolean
91
- //
69
+ return {
70
+ type: "Flatten",
71
+ source
72
+ };
73
+ }
92
74
  function isEmpty(arg) {
93
- return {
94
- type: "IsEmpty",
95
- arg,
96
- };
75
+ return {
76
+ type: "IsEmpty",
77
+ arg
78
+ };
97
79
  }
98
80
  function not(operand) {
99
- return {
100
- type: "Not",
101
- operand,
102
- };
81
+ return {
82
+ type: "Not",
83
+ operand
84
+ };
103
85
  }
104
86
  function and(operand1, operand2) {
105
- return {
106
- type: "And",
107
- operand1,
108
- operand2,
109
- };
87
+ return {
88
+ type: "And",
89
+ operand1,
90
+ operand2
91
+ };
110
92
  }
111
93
  function or(operand1, operand2) {
112
- return {
113
- type: "Or",
114
- operand1,
115
- operand2,
116
- };
117
- }
118
- //
119
- // Resources
120
- //
94
+ return {
95
+ type: "Or",
96
+ operand1,
97
+ operand2
98
+ };
99
+ }
121
100
  function getResourceField(source, field) {
122
- return {
123
- type: "GetResourceField",
124
- source: primitiveToConfig(source),
125
- field: primitiveToConfig(field),
126
- };
101
+ return {
102
+ type: "GetResourceField",
103
+ source: primitiveToConfig(source),
104
+ field: primitiveToConfig(field)
105
+ };
127
106
  }
128
107
  function getResourceValueAsJson() {
129
- return function (source) {
130
- return {
131
- type: "GetResourceValueAsJson",
132
- source: primitiveToConfig(source),
133
- };
134
- };
108
+ return function(source) {
109
+ return {
110
+ type: "GetResourceValueAsJson",
111
+ source: primitiveToConfig(source)
112
+ };
113
+ };
135
114
  }
136
115
  function mapResourceFields(source, mapping, itVar = "$it") {
137
- return {
138
- type: "MapResourceFields",
139
- source,
140
- mapping,
141
- itVar,
142
- };
143
- }
144
- //
145
- // Download Blobs
146
- //
116
+ return {
117
+ type: "MapResourceFields",
118
+ source,
119
+ mapping,
120
+ itVar
121
+ };
122
+ }
147
123
  function getBlobContent(source, range) {
148
- return {
149
- type: "GetBlobContent",
150
- range,
151
- source: primitiveToConfig(source),
152
- };
124
+ return {
125
+ type: "GetBlobContent",
126
+ range,
127
+ source: primitiveToConfig(source)
128
+ };
153
129
  }
154
130
  function getBlobContentAsString(source, range) {
155
- return {
156
- type: "GetBlobContentAsString",
157
- range,
158
- source: primitiveToConfig(source),
159
- };
131
+ return {
132
+ type: "GetBlobContentAsString",
133
+ range,
134
+ source: primitiveToConfig(source)
135
+ };
160
136
  }
161
137
  function getBlobContentAsJson() {
162
- return function (source, range) {
163
- return {
164
- type: "GetBlobContentAsJson",
165
- range,
166
- source: primitiveToConfig(source),
167
- };
168
- };
138
+ return function(source, range) {
139
+ return {
140
+ type: "GetBlobContentAsJson",
141
+ range,
142
+ source: primitiveToConfig(source)
143
+ };
144
+ };
169
145
  }
170
146
  function getDownloadedBlobContent(source) {
171
- return {
172
- type: "GetDownloadedBlobContent",
173
- source: primitiveToConfig(source),
174
- };
147
+ return {
148
+ type: "GetDownloadedBlobContent",
149
+ source: primitiveToConfig(source)
150
+ };
175
151
  }
176
152
  function getOnDemandBlobContent(source) {
177
- return {
178
- type: "GetOnDemandBlobContent",
179
- source: primitiveToConfig(source),
180
- };
181
- }
182
- //
183
- // Download Blobs to URLs
184
- //
153
+ return {
154
+ type: "GetOnDemandBlobContent",
155
+ source: primitiveToConfig(source)
156
+ };
157
+ }
185
158
  function extractArchiveAndGetURL(source, format) {
186
- return {
187
- type: "ExtractArchiveAndGetURL",
188
- format,
189
- source: primitiveToConfig(source),
190
- };
191
- }
192
- //
193
- // Upload Blobs
194
- //
159
+ return {
160
+ type: "ExtractArchiveAndGetURL",
161
+ format,
162
+ source: primitiveToConfig(source)
163
+ };
164
+ }
195
165
  function getImportProgress(source) {
196
- return {
197
- type: "GetImportProgress",
198
- source: primitiveToConfig(source),
199
- };
200
- }
201
- //
202
- // Logs
203
- //
166
+ return {
167
+ type: "GetImportProgress",
168
+ source: primitiveToConfig(source)
169
+ };
170
+ }
204
171
  function getLastLogs(source, lines) {
205
- return {
206
- type: "GetLastLogs",
207
- source: primitiveToConfig(source),
208
- lines,
209
- };
172
+ return {
173
+ type: "GetLastLogs",
174
+ source: primitiveToConfig(source),
175
+ lines
176
+ };
210
177
  }
211
178
  function getProgressLog(source, patternToSearch) {
212
- return {
213
- type: "GetProgressLog",
214
- source: primitiveToConfig(source),
215
- patternToSearch,
216
- };
179
+ return {
180
+ type: "GetProgressLog",
181
+ source: primitiveToConfig(source),
182
+ patternToSearch
183
+ };
217
184
  }
218
185
  function getProgressLogWithInfo(source, patternToSearch) {
219
- return {
220
- type: "GetProgressLogWithInfo",
221
- source: primitiveToConfig(source),
222
- patternToSearch,
223
- };
186
+ return {
187
+ type: "GetProgressLogWithInfo",
188
+ source: primitiveToConfig(source),
189
+ patternToSearch
190
+ };
224
191
  }
225
192
  function getLogHandle(source) {
226
- return {
227
- type: "GetLogHandle",
228
- source: primitiveToConfig(source),
229
- };
193
+ return {
194
+ type: "GetLogHandle",
195
+ source: primitiveToConfig(source)
196
+ };
230
197
  }
231
198
 
199
+ //#endregion
232
200
  export { Args, It, MainOutputs, StagingOutputs, UiState, and, extractArchiveAndGetURL, flatten, getBlobContent, getBlobContentAsJson, getBlobContentAsString, getDownloadedBlobContent, getFromCfg, getImmediate, getImportProgress, getJsonField, getLastLogs, getLogHandle, getOnDemandBlobContent, getProgressLog, getProgressLogWithInfo, getResourceField, getResourceValueAsJson, isEmpty, isolate, makeArray, makeObject, mapArrayValues, mapRecordValues, mapResourceFields, not, or };
233
- //# sourceMappingURL=actions.js.map
201
+ //# sourceMappingURL=actions.js.map