@milaboratories/pl-middle-layer 1.46.20 → 1.46.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/block_registry/index.d.ts +3 -3
- package/dist/block_registry/registry-v2-provider.cjs.map +1 -1
- package/dist/block_registry/registry-v2-provider.d.ts +2 -2
- package/dist/block_registry/registry-v2-provider.js.map +1 -1
- package/dist/block_registry/registry.cjs +54 -53
- package/dist/block_registry/registry.cjs.map +1 -1
- package/dist/block_registry/registry.d.ts +4 -4
- package/dist/block_registry/registry.d.ts.map +1 -1
- package/dist/block_registry/registry.js +54 -53
- package/dist/block_registry/registry.js.map +1 -1
- package/dist/block_registry/watcher.cjs +12 -12
- package/dist/block_registry/watcher.cjs.map +1 -1
- package/dist/block_registry/watcher.d.ts +6 -6
- package/dist/block_registry/watcher.d.ts.map +1 -1
- package/dist/block_registry/watcher.js +12 -12
- package/dist/block_registry/watcher.js.map +1 -1
- package/dist/block_registry/well_known_registries.cjs +6 -6
- package/dist/block_registry/well_known_registries.cjs.map +1 -1
- package/dist/block_registry/well_known_registries.d.ts +1 -1
- package/dist/block_registry/well_known_registries.js +6 -6
- package/dist/block_registry/well_known_registries.js.map +1 -1
- package/dist/cfg_render/executor.cjs +11 -11
- package/dist/cfg_render/executor.cjs.map +1 -1
- package/dist/cfg_render/executor.d.ts +5 -5
- package/dist/cfg_render/executor.js +11 -11
- package/dist/cfg_render/executor.js.map +1 -1
- package/dist/cfg_render/operation.d.ts +5 -5
- package/dist/cfg_render/renderer.cjs +74 -75
- package/dist/cfg_render/renderer.cjs.map +1 -1
- package/dist/cfg_render/renderer.d.ts +2 -2
- package/dist/cfg_render/renderer.d.ts.map +1 -1
- package/dist/cfg_render/renderer.js +74 -75
- package/dist/cfg_render/renderer.js.map +1 -1
- package/dist/cfg_render/traverse.cjs +27 -27
- package/dist/cfg_render/traverse.cjs.map +1 -1
- package/dist/cfg_render/traverse.d.ts +1 -1
- package/dist/cfg_render/traverse.js +27 -27
- package/dist/cfg_render/traverse.js.map +1 -1
- package/dist/cfg_render/util.cjs +1 -1
- package/dist/cfg_render/util.cjs.map +1 -1
- package/dist/cfg_render/util.d.ts +1 -1
- package/dist/cfg_render/util.js +1 -1
- package/dist/cfg_render/util.js.map +1 -1
- package/dist/debug/index.cjs +4 -2
- package/dist/debug/index.cjs.map +1 -1
- package/dist/debug/index.d.ts +2 -2
- package/dist/debug/index.d.ts.map +1 -1
- package/dist/debug/index.js +4 -2
- package/dist/debug/index.js.map +1 -1
- package/dist/dev_env/index.cjs +8 -8
- package/dist/dev_env/index.cjs.map +1 -1
- package/dist/dev_env/index.js +8 -8
- package/dist/dev_env/index.js.map +1 -1
- package/dist/dev_env/util.cjs +1 -1
- package/dist/dev_env/util.cjs.map +1 -1
- package/dist/dev_env/util.d.ts +1 -1
- package/dist/dev_env/util.js +1 -1
- package/dist/dev_env/util.js.map +1 -1
- package/dist/index.d.ts +16 -16
- package/dist/js_render/computable_context.cjs +78 -78
- package/dist/js_render/computable_context.cjs.map +1 -1
- package/dist/js_render/computable_context.d.ts +9 -9
- package/dist/js_render/computable_context.d.ts.map +1 -1
- package/dist/js_render/computable_context.js +78 -78
- package/dist/js_render/computable_context.js.map +1 -1
- package/dist/js_render/context.cjs +33 -27
- package/dist/js_render/context.cjs.map +1 -1
- package/dist/js_render/context.d.ts +7 -7
- package/dist/js_render/context.d.ts.map +1 -1
- package/dist/js_render/context.js +33 -27
- package/dist/js_render/context.js.map +1 -1
- package/dist/js_render/index.cjs +10 -6
- package/dist/js_render/index.cjs.map +1 -1
- package/dist/js_render/index.d.ts +6 -6
- package/dist/js_render/index.d.ts.map +1 -1
- package/dist/js_render/index.js +10 -6
- package/dist/js_render/index.js.map +1 -1
- package/dist/middle_layer/active_cfg.cjs.map +1 -1
- package/dist/middle_layer/active_cfg.d.ts +3 -3
- package/dist/middle_layer/active_cfg.d.ts.map +1 -1
- package/dist/middle_layer/active_cfg.js.map +1 -1
- package/dist/middle_layer/block.cjs +1 -1
- package/dist/middle_layer/block.cjs.map +1 -1
- package/dist/middle_layer/block.d.ts +6 -6
- package/dist/middle_layer/block.d.ts.map +1 -1
- package/dist/middle_layer/block.js +1 -1
- package/dist/middle_layer/block.js.map +1 -1
- package/dist/middle_layer/block_ctx.cjs +9 -9
- package/dist/middle_layer/block_ctx.cjs.map +1 -1
- package/dist/middle_layer/block_ctx.d.ts +6 -6
- package/dist/middle_layer/block_ctx.d.ts.map +1 -1
- package/dist/middle_layer/block_ctx.js +9 -9
- package/dist/middle_layer/block_ctx.js.map +1 -1
- package/dist/middle_layer/block_ctx_unsafe.cjs +1 -1
- package/dist/middle_layer/block_ctx_unsafe.cjs.map +1 -1
- package/dist/middle_layer/block_ctx_unsafe.d.ts +5 -5
- package/dist/middle_layer/block_ctx_unsafe.js +1 -1
- package/dist/middle_layer/block_ctx_unsafe.js.map +1 -1
- package/dist/middle_layer/driver_kit.cjs +1 -2
- package/dist/middle_layer/driver_kit.cjs.map +1 -1
- package/dist/middle_layer/driver_kit.d.ts +7 -7
- package/dist/middle_layer/driver_kit.d.ts.map +1 -1
- package/dist/middle_layer/driver_kit.js +1 -2
- package/dist/middle_layer/driver_kit.js.map +1 -1
- package/dist/middle_layer/frontend_path.cjs +5 -5
- package/dist/middle_layer/frontend_path.cjs.map +1 -1
- package/dist/middle_layer/frontend_path.d.ts +4 -4
- package/dist/middle_layer/frontend_path.d.ts.map +1 -1
- package/dist/middle_layer/frontend_path.js +5 -5
- package/dist/middle_layer/frontend_path.js.map +1 -1
- package/dist/middle_layer/index.d.ts +4 -4
- package/dist/middle_layer/middle_layer.cjs +11 -11
- package/dist/middle_layer/middle_layer.cjs.map +1 -1
- package/dist/middle_layer/middle_layer.d.ts +18 -18
- package/dist/middle_layer/middle_layer.d.ts.map +1 -1
- package/dist/middle_layer/middle_layer.js +11 -11
- package/dist/middle_layer/middle_layer.js.map +1 -1
- package/dist/middle_layer/navigation_states.cjs +2 -2
- package/dist/middle_layer/navigation_states.cjs.map +1 -1
- package/dist/middle_layer/navigation_states.d.ts +2 -2
- package/dist/middle_layer/navigation_states.js +2 -2
- package/dist/middle_layer/navigation_states.js.map +1 -1
- package/dist/middle_layer/ops.cjs +5 -5
- package/dist/middle_layer/ops.cjs.map +1 -1
- package/dist/middle_layer/ops.d.ts +11 -11
- package/dist/middle_layer/ops.d.ts.map +1 -1
- package/dist/middle_layer/ops.js +5 -5
- package/dist/middle_layer/ops.js.map +1 -1
- package/dist/middle_layer/project.cjs +71 -63
- package/dist/middle_layer/project.cjs.map +1 -1
- package/dist/middle_layer/project.d.ts +10 -10
- package/dist/middle_layer/project.d.ts.map +1 -1
- package/dist/middle_layer/project.js +71 -63
- package/dist/middle_layer/project.js.map +1 -1
- package/dist/middle_layer/project_list.cjs +2 -2
- package/dist/middle_layer/project_list.cjs.map +1 -1
- package/dist/middle_layer/project_list.d.ts +6 -6
- package/dist/middle_layer/project_list.d.ts.map +1 -1
- package/dist/middle_layer/project_list.js +2 -2
- package/dist/middle_layer/project_list.js.map +1 -1
- package/dist/middle_layer/project_overview.cjs +40 -40
- package/dist/middle_layer/project_overview.cjs.map +1 -1
- package/dist/middle_layer/project_overview.d.ts +5 -5
- package/dist/middle_layer/project_overview.d.ts.map +1 -1
- package/dist/middle_layer/project_overview.js +40 -40
- package/dist/middle_layer/project_overview.js.map +1 -1
- package/dist/middle_layer/project_overview_light.cjs.map +1 -1
- package/dist/middle_layer/project_overview_light.d.ts +2 -2
- package/dist/middle_layer/project_overview_light.d.ts.map +1 -1
- package/dist/middle_layer/project_overview_light.js.map +1 -1
- package/dist/middle_layer/render.cjs +1 -1
- package/dist/middle_layer/render.cjs.map +1 -1
- package/dist/middle_layer/render.d.ts +4 -4
- package/dist/middle_layer/render.js +1 -1
- package/dist/middle_layer/render.js.map +1 -1
- package/dist/middle_layer/render.test.d.ts +2 -2
- package/dist/middle_layer/types.d.ts +3 -3
- package/dist/middle_layer/util.cjs +9 -4
- package/dist/middle_layer/util.cjs.map +1 -1
- package/dist/middle_layer/util.d.ts +4 -4
- package/dist/middle_layer/util.d.ts.map +1 -1
- package/dist/middle_layer/util.js +9 -4
- package/dist/middle_layer/util.js.map +1 -1
- package/dist/model/args.cjs +19 -15
- package/dist/model/args.cjs.map +1 -1
- package/dist/model/args.d.ts +1 -1
- package/dist/model/args.d.ts.map +1 -1
- package/dist/model/args.js +19 -15
- package/dist/model/args.js.map +1 -1
- package/dist/model/block_pack.d.ts +2 -2
- package/dist/model/block_pack_spec.cjs +3 -3
- package/dist/model/block_pack_spec.cjs.map +1 -1
- package/dist/model/block_pack_spec.d.ts +8 -8
- package/dist/model/block_pack_spec.js +3 -3
- package/dist/model/block_pack_spec.js.map +1 -1
- package/dist/model/block_storage_helper.cjs +4 -4
- package/dist/model/block_storage_helper.cjs.map +1 -1
- package/dist/model/block_storage_helper.d.ts +2 -2
- package/dist/model/block_storage_helper.d.ts.map +1 -1
- package/dist/model/block_storage_helper.js +4 -4
- package/dist/model/block_storage_helper.js.map +1 -1
- package/dist/model/index.d.ts +3 -3
- package/dist/model/project_helper.cjs +30 -13
- package/dist/model/project_helper.cjs.map +1 -1
- package/dist/model/project_helper.d.ts +4 -4
- package/dist/model/project_helper.d.ts.map +1 -1
- package/dist/model/project_helper.js +30 -13
- package/dist/model/project_helper.js.map +1 -1
- package/dist/model/project_model.cjs +23 -23
- package/dist/model/project_model.cjs.map +1 -1
- package/dist/model/project_model.d.ts +6 -6
- package/dist/model/project_model.d.ts.map +1 -1
- package/dist/model/project_model.js +23 -23
- package/dist/model/project_model.js.map +1 -1
- package/dist/model/project_model_util.cjs +2 -2
- package/dist/model/project_model_util.cjs.map +1 -1
- package/dist/model/project_model_util.d.ts +3 -3
- package/dist/model/project_model_util.d.ts.map +1 -1
- package/dist/model/project_model_util.js +2 -2
- package/dist/model/project_model_util.js.map +1 -1
- package/dist/model/project_model_v1.cjs +2 -2
- package/dist/model/project_model_v1.cjs.map +1 -1
- package/dist/model/project_model_v1.js +2 -2
- package/dist/model/project_model_v1.js.map +1 -1
- package/dist/model/template_spec.d.ts +5 -5
- package/dist/mutator/block-pack/block_pack.cjs +43 -43
- package/dist/mutator/block-pack/block_pack.cjs.map +1 -1
- package/dist/mutator/block-pack/block_pack.d.ts +6 -6
- package/dist/mutator/block-pack/block_pack.d.ts.map +1 -1
- package/dist/mutator/block-pack/block_pack.js +43 -43
- package/dist/mutator/block-pack/block_pack.js.map +1 -1
- package/dist/mutator/block-pack/frontend.cjs +2 -2
- package/dist/mutator/block-pack/frontend.cjs.map +1 -1
- package/dist/mutator/block-pack/frontend.d.ts +2 -2
- package/dist/mutator/block-pack/frontend.d.ts.map +1 -1
- package/dist/mutator/block-pack/frontend.js +2 -2
- package/dist/mutator/block-pack/frontend.js.map +1 -1
- package/dist/mutator/context_export.cjs +5 -5
- package/dist/mutator/context_export.cjs.map +1 -1
- package/dist/mutator/context_export.d.ts +2 -2
- package/dist/mutator/context_export.d.ts.map +1 -1
- package/dist/mutator/context_export.js +5 -5
- package/dist/mutator/context_export.js.map +1 -1
- package/dist/mutator/migration.cjs +7 -7
- package/dist/mutator/migration.cjs.map +1 -1
- package/dist/mutator/migration.d.ts +1 -1
- package/dist/mutator/migration.d.ts.map +1 -1
- package/dist/mutator/migration.js +7 -7
- package/dist/mutator/migration.js.map +1 -1
- package/dist/mutator/project.cjs +147 -148
- package/dist/mutator/project.cjs.map +1 -1
- package/dist/mutator/project.d.ts +13 -13
- package/dist/mutator/project.d.ts.map +1 -1
- package/dist/mutator/project.js +147 -148
- package/dist/mutator/project.js.map +1 -1
- package/dist/mutator/template/direct_template_loader.cjs +16 -16
- package/dist/mutator/template/direct_template_loader.cjs.map +1 -1
- package/dist/mutator/template/direct_template_loader.d.ts +2 -2
- package/dist/mutator/template/direct_template_loader.d.ts.map +1 -1
- package/dist/mutator/template/direct_template_loader.js +16 -16
- package/dist/mutator/template/direct_template_loader.js.map +1 -1
- package/dist/mutator/template/direct_template_loader_v3.cjs +13 -13
- package/dist/mutator/template/direct_template_loader_v3.cjs.map +1 -1
- package/dist/mutator/template/direct_template_loader_v3.d.ts +3 -3
- package/dist/mutator/template/direct_template_loader_v3.d.ts.map +1 -1
- package/dist/mutator/template/direct_template_loader_v3.js +13 -13
- package/dist/mutator/template/direct_template_loader_v3.js.map +1 -1
- package/dist/mutator/template/render_block.cjs +7 -7
- package/dist/mutator/template/render_block.cjs.map +1 -1
- package/dist/mutator/template/render_block.d.ts +1 -1
- package/dist/mutator/template/render_block.d.ts.map +1 -1
- package/dist/mutator/template/render_block.js +7 -7
- package/dist/mutator/template/render_block.js.map +1 -1
- package/dist/mutator/template/render_template.cjs +10 -10
- package/dist/mutator/template/render_template.cjs.map +1 -1
- package/dist/mutator/template/render_template.d.ts +2 -2
- package/dist/mutator/template/render_template.js +10 -10
- package/dist/mutator/template/render_template.js.map +1 -1
- package/dist/mutator/template/template_loading.cjs +17 -17
- package/dist/mutator/template/template_loading.cjs.map +1 -1
- package/dist/mutator/template/template_loading.d.ts +2 -2
- package/dist/mutator/template/template_loading.js +17 -17
- package/dist/mutator/template/template_loading.js.map +1 -1
- package/dist/network_check/network_check.cjs +33 -32
- package/dist/network_check/network_check.cjs.map +1 -1
- package/dist/network_check/network_check.d.ts +6 -6
- package/dist/network_check/network_check.d.ts.map +1 -1
- package/dist/network_check/network_check.js +33 -32
- package/dist/network_check/network_check.js.map +1 -1
- package/dist/network_check/pings.cjs +3 -3
- package/dist/network_check/pings.cjs.map +1 -1
- package/dist/network_check/pings.d.ts +4 -4
- package/dist/network_check/pings.d.ts.map +1 -1
- package/dist/network_check/pings.js +3 -3
- package/dist/network_check/pings.js.map +1 -1
- package/dist/network_check/template.cjs +57 -44
- package/dist/network_check/template.cjs.map +1 -1
- package/dist/network_check/template.d.ts +8 -8
- package/dist/network_check/template.d.ts.map +1 -1
- package/dist/network_check/template.js +57 -44
- package/dist/network_check/template.js.map +1 -1
- package/dist/pool/data.cjs +45 -33
- package/dist/pool/data.cjs.map +1 -1
- package/dist/pool/data.d.ts +3 -3
- package/dist/pool/data.d.ts.map +1 -1
- package/dist/pool/data.js +45 -33
- package/dist/pool/data.js.map +1 -1
- package/dist/pool/driver.cjs +18 -16
- package/dist/pool/driver.cjs.map +1 -1
- package/dist/pool/driver.d.ts +5 -5
- package/dist/pool/driver.d.ts.map +1 -1
- package/dist/pool/driver.js +18 -16
- package/dist/pool/driver.js.map +1 -1
- package/dist/pool/index.d.ts +2 -2
- package/dist/pool/p_object_collection.cjs +5 -5
- package/dist/pool/p_object_collection.cjs.map +1 -1
- package/dist/pool/p_object_collection.d.ts +2 -2
- package/dist/pool/p_object_collection.d.ts.map +1 -1
- package/dist/pool/p_object_collection.js +5 -5
- package/dist/pool/p_object_collection.js.map +1 -1
- package/dist/pool/result_pool.cjs +6 -6
- package/dist/pool/result_pool.cjs.map +1 -1
- package/dist/pool/result_pool.d.ts +6 -6
- package/dist/pool/result_pool.d.ts.map +1 -1
- package/dist/pool/result_pool.js +6 -6
- package/dist/pool/result_pool.js.map +1 -1
- package/dist/test/block_packs.d.ts +2 -2
- package/dist/test/known_templates.d.ts +1 -1
- package/dist/worker/WorkerManager.cjs +7 -8
- package/dist/worker/WorkerManager.cjs.map +1 -1
- package/dist/worker/WorkerManager.d.ts +2 -2
- package/dist/worker/WorkerManager.d.ts.map +1 -1
- package/dist/worker/WorkerManager.js +7 -8
- package/dist/worker/WorkerManager.js.map +1 -1
- package/dist/worker/worker.cjs +6 -4
- package/dist/worker/worker.cjs.map +1 -1
- package/dist/worker/worker.js +6 -4
- package/dist/worker/worker.js.map +1 -1
- package/dist/worker/workerApi.cjs.map +1 -1
- package/dist/worker/workerApi.js.map +1 -1
- package/package.json +41 -41
- package/src/block_registry/index.ts +3 -3
- package/src/block_registry/registry-v2-provider.ts +2 -2
- package/src/block_registry/registry.test.ts +17 -17
- package/src/block_registry/registry.ts +55 -60
- package/src/block_registry/watcher.ts +24 -23
- package/src/block_registry/well_known_registries.ts +7 -7
- package/src/cfg_render/executor.test.ts +36 -36
- package/src/cfg_render/executor.ts +24 -24
- package/src/cfg_render/operation.ts +5 -5
- package/src/cfg_render/renderer.ts +96 -93
- package/src/cfg_render/traverse.ts +50 -50
- package/src/cfg_render/util.ts +3 -3
- package/src/debug/index.ts +6 -4
- package/src/dev_env/index.ts +16 -16
- package/src/dev_env/util.ts +3 -3
- package/src/index.ts +16 -16
- package/src/js_render/computable_context.ts +143 -126
- package/src/js_render/context.ts +72 -44
- package/src/js_render/index.ts +51 -24
- package/src/middle_layer/active_cfg.ts +14 -12
- package/src/middle_layer/block.ts +30 -23
- package/src/middle_layer/block_ctx.ts +27 -31
- package/src/middle_layer/block_ctx_unsafe.ts +9 -9
- package/src/middle_layer/driver_kit.ts +13 -19
- package/src/middle_layer/frontend_path.ts +18 -23
- package/src/middle_layer/index.ts +4 -4
- package/src/middle_layer/middle_layer.ts +57 -55
- package/src/middle_layer/navigation_states.ts +6 -6
- package/src/middle_layer/ops.ts +43 -42
- package/src/middle_layer/project.ts +274 -173
- package/src/middle_layer/project_list.ts +14 -15
- package/src/middle_layer/project_overview.ts +104 -113
- package/src/middle_layer/project_overview_light.ts +7 -9
- package/src/middle_layer/render.test.ts +49 -48
- package/src/middle_layer/render.ts +9 -9
- package/src/middle_layer/types.ts +3 -3
- package/src/middle_layer/util.ts +17 -12
- package/src/model/args.ts +22 -19
- package/src/model/block_pack.ts +2 -2
- package/src/model/block_pack_spec.ts +11 -11
- package/src/model/block_storage_helper.ts +11 -11
- package/src/model/index.ts +3 -3
- package/src/model/project_helper.ts +78 -32
- package/src/model/project_model.test.ts +5 -9
- package/src/model/project_model.ts +48 -49
- package/src/model/project_model_util.test.ts +86 -53
- package/src/model/project_model_util.ts +18 -14
- package/src/model/project_model_v1.ts +3 -3
- package/src/model/template_spec.ts +5 -5
- package/src/mutator/block-pack/block_pack.test.ts +25 -25
- package/src/mutator/block-pack/block_pack.ts +70 -68
- package/src/mutator/block-pack/frontend.ts +6 -13
- package/src/mutator/context_export.ts +12 -10
- package/src/mutator/migration.ts +20 -14
- package/src/mutator/project-v3.test.ts +123 -118
- package/src/mutator/project.test.ts +105 -94
- package/src/mutator/project.ts +357 -274
- package/src/mutator/template/direct_template_loader.ts +26 -32
- package/src/mutator/template/direct_template_loader_v3.ts +51 -25
- package/src/mutator/template/render_block.ts +14 -21
- package/src/mutator/template/render_template.ts +13 -13
- package/src/mutator/template/template_loading.ts +23 -23
- package/src/mutator/template/template_render.test.ts +87 -86
- package/src/network_check/network_check.test.ts +4 -4
- package/src/network_check/network_check.ts +102 -79
- package/src/network_check/pings.ts +35 -16
- package/src/network_check/template.test.ts +47 -44
- package/src/network_check/template.ts +151 -95
- package/src/network_check/test_utils.ts +1 -1
- package/src/pool/data.ts +81 -69
- package/src/pool/driver.ts +56 -51
- package/src/pool/index.ts +2 -2
- package/src/pool/p_object_collection.ts +16 -15
- package/src/pool/result_pool.ts +23 -34
- package/src/test/block_packs.ts +15 -15
- package/src/test/explicit_templates.ts +4 -4
- package/src/test/known_templates.ts +10 -10
- package/src/test_env.ts +1 -1
- package/src/worker/WorkerManager.ts +22 -18
- package/src/worker/worker.ts +11 -9
- package/src/worker/workerApi.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sources":["../../src/cfg_render/executor.ts"],"sourcesContent":["import type {\n ArgumentKey,\n ArgumentValues,\n ExecutionEnvironment,\n Operation,\n Subroutine,\n} from './operation';\nimport Denque from 'denque';\nimport { assertNever, notEmpty } from '@milaboratories/ts-helpers';\nimport type { ComputableCtx, ComputableRenderingOps } from '@milaboratories/computable';\nimport { Computable } from '@milaboratories/computable';\nimport type { Cfg } from '@platforma-sdk/model';\nimport { renderCfg, resOp } from './renderer';\nimport canonicalize from 'canonicalize';\nimport type { BlockContextAny } from '../middle_layer/block_ctx';\nimport type { MiddleLayerDriverKit } from '../middle_layer/driver_kit';\nimport { NonKeyCtxFields, toCfgContext } from '../middle_layer/block_ctx_unsafe';\n\n/** Addresses pending subroutines inside the stack */\ntype SubroutineKey = symbol;\n\n/** Represents destination of the result of an operation. I.e. when sequence of\n * subroutine invocations, and computables terminates with result, this object\n * determines to which argument of which pending subroutine it should be delivered.\n * See special value for delivery of the final \"return\" result. */\ntype Destination = {\n op: SubroutineKey;\n arg: ArgumentKey;\n};\n\n/** Special address of operation, see below. */\nconst ReturnOpKey: unique symbol = Symbol();\n/** The same, but for the argument part of destination, see below. */\nconst ReturnArgKey = 'return';\n\n/** Special destination, telling the executor that corresponding result should\n * be exposed as a final result, and execution terminate at this point. */\nconst ReturnDestination = { op: ReturnOpKey, arg: ReturnArgKey } as Destination;\n\nfunction isReturnDestination(destination: Destination): boolean {\n return destination.op == ReturnOpKey && destination.arg == ReturnArgKey;\n}\n\n/** Queued operation, used inside the executor */\ntype QueuedOperation = {\n operation: Operation;\n destination: Destination;\n};\n\n/** Queued computation, returned by the first round of config execution. Such\n * computables should be returned in the intermediate representation of the\n * enclosing computable, and after they are resolved and passed to the\n * postprocessing routine, should be injected into the execution stack to\n * finalize the computation. */\ntype ScheduledComputable = {\n destination: Destination;\n computable: Computable<unknown>;\n};\n\n/** This is what ScheduledComputable transforms from intermediate\n * representation to post-processing. */\ntype MaterializedComputable = {\n destination: Destination;\n computable: unknown;\n};\n\n/** Main entry inside the execution stack. */\ntype PendingSubroutine = {\n subroutine: Subroutine;\n destination: Destination;\n argCounter: number;\n args: ArgumentValues;\n};\n\n/** Execution stack. The closest concept that this object along with enclosed\n * {@link PendingSubroutine}s represent is a Continuation.\n * https://en.wikipedia.org/wiki/Continuation */\ntype ExecutionStack = {\n result?: unknown;\n pendingSubroutines: Map<SubroutineKey, PendingSubroutine>;\n};\n\n/** Returns initial stack value. */\nfunction zeroStack(): ExecutionStack {\n return { pendingSubroutines: new Map<SubroutineKey, PendingSubroutine>() };\n}\n\n/** Implements main executor mechanism.\n * @param env to be passed to while executing operations\n * @param stack execution stack to continue execution from\n * @param operations operations to initiate the execution process\n * @param allowComputables if false, scheduling of async computables will result in error\n * */\nfunction execute(\n env: ExecutionEnvironment,\n stack: ExecutionStack,\n operations: QueuedOperation[],\n allowComputables: boolean,\n): ScheduledComputable[] {\n const operationQueue = new Denque<QueuedOperation>(operations);\n\n /** Returns false if final result is set as result of this operation,\n * true if we should continue processing. */\n const deliverResult = (destination: Destination, result: unknown): boolean => {\n if (isReturnDestination(destination)) {\n stack.result = result;\n return false;\n }\n\n const pending = notEmpty(stack.pendingSubroutines.get(destination.op));\n if (destination.arg in pending.args) throw new Error('argument already set');\n pending.args[destination.arg] = result;\n pending.argCounter--;\n if (pending.argCounter === 0) {\n stack.pendingSubroutines.delete(destination.op);\n operationQueue.push({\n destination: pending.destination,\n operation: pending.subroutine(pending.args),\n });\n }\n\n return true;\n };\n\n // computables, scheduled during computation, are aggregated in this array,\n // and returned from the function in the end\n const computables: ScheduledComputable[] = [];\n\n // each loop = execution of a single queued operation\n mainLoop: while (operationQueue.length > 0) {\n const op = operationQueue.shift()!;\n const action = op.operation(env);\n switch (action.type) {\n case 'ReturnResult':\n if (!deliverResult(op.destination, action.result)) break mainLoop; // this terminates execution\n break; // switch\n\n case 'ScheduleSubroutine':\n {\n const newOpKey = Symbol();\n\n const argRequests = Object.entries(action.args);\n const initialArgCounter = argRequests.length;\n\n if (initialArgCounter === 0)\n // if no pending arguments\n operationQueue.push({\n destination: op.destination,\n operation: action.subroutine({}),\n });\n else {\n for (const [arg, operation] of argRequests)\n operationQueue.push({\n destination: { op: newOpKey, arg },\n operation,\n });\n\n stack.pendingSubroutines.set(newOpKey, {\n argCounter: initialArgCounter,\n args: {},\n subroutine: action.subroutine,\n destination: op.destination,\n });\n }\n }\n break;\n\n case 'ScheduleComputable':\n if (!allowComputables)\n throw new Error('asynchronous operations are forbidden in this context');\n computables.push({\n destination: op.destination,\n computable: action.computable,\n });\n break;\n\n default:\n assertNever(action);\n }\n }\n\n return computables;\n}\n\n//\n// Computable\n//\n\n/** Main method to render configurations */\nexport function computableFromCfg(\n drivers: MiddleLayerDriverKit,\n bCtx: BlockContextAny,\n cfg: Cfg,\n ops: Partial<ComputableRenderingOps> = {},\n): Computable<unknown> {\n return computableFromCfgUnsafe(drivers, toCfgContext(bCtx), cfg, ops);\n}\n\nexport function computableFromCfgUnsafe(\n drivers: MiddleLayerDriverKit,\n ctx: Record<string, unknown>,\n cfg: Cfg,\n ops: Partial<ComputableRenderingOps> = {},\n): Computable<unknown> {\n const key\n = `${ctx.blockId}#`\n + canonicalize({\n ctx: Object.fromEntries(\n Object.entries(ctx).filter(([k]) => NonKeyCtxFields.indexOf(k) === -1),\n ),\n cfg: cfg,\n })!;\n return Computable.makeRaw(\n (c) => {\n const env: ExecutionEnvironment = { drivers, cCtx: c };\n const stack = zeroStack();\n const computables = execute(\n env,\n stack,\n [\n {\n destination: ReturnDestination,\n operation: renderCfg(ctx, cfg),\n },\n ],\n true,\n );\n return {\n ir: computables,\n postprocessValue(value: MaterializedComputable[]): unknown {\n const resolvedOps: QueuedOperation[] = [];\n for (const mc of value)\n resolvedOps.push({ destination: mc.destination, operation: resOp(mc.computable) });\n const postEnv: ExecutionEnvironment = {\n drivers,\n get cCtx(): ComputableCtx {\n throw new Error('asynchronous operations are forbidden in this context');\n },\n };\n\n // Post process can be called several times, that's why it must be a side-effect-free function.\n // But `execute` modifies a stack, so we have to defensively copy it here.\n const copyOfPendingSubrotines = new Map<SubroutineKey, PendingSubroutine>();\n for (const [key, value] of stack.pendingSubroutines)\n copyOfPendingSubrotines.set(key, { ...value, args: { ...value.args } });\n const copiedStack: ExecutionStack = {\n result: stack.result,\n pendingSubroutines: copyOfPendingSubrotines,\n };\n execute(postEnv, copiedStack, resolvedOps, false);\n if (!('result' in copiedStack))\n throw new Error('illegal cfg rendering stack state, no result');\n return copiedStack.result;\n },\n };\n },\n { ...ops, key },\n );\n}\n"],"names":[],"mappings":";;;;;;;AA8BA;AACA,MAAM,WAAW,GAAkB,MAAM,EAAE;AAC3C;AACA,MAAM,YAAY,GAAG,QAAQ;AAE7B;AAC0E;AAC1E,MAAM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AE,GAAG,GAAG,EAAE,GAAG,EAAE,CAChB;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"executor.js","sources":["../../src/cfg_render/executor.ts"],"sourcesContent":["import type {\n ArgumentKey,\n ArgumentValues,\n ExecutionEnvironment,\n Operation,\n Subroutine,\n} from \"./operation\";\nimport Denque from \"denque\";\nimport { assertNever, notEmpty } from \"@milaboratories/ts-helpers\";\nimport type { ComputableCtx, ComputableRenderingOps } from \"@milaboratories/computable\";\nimport { Computable } from \"@milaboratories/computable\";\nimport type { Cfg } from \"@platforma-sdk/model\";\nimport { renderCfg, resOp } from \"./renderer\";\nimport canonicalize from \"canonicalize\";\nimport type { BlockContextAny } from \"../middle_layer/block_ctx\";\nimport type { MiddleLayerDriverKit } from \"../middle_layer/driver_kit\";\nimport { NonKeyCtxFields, toCfgContext } from \"../middle_layer/block_ctx_unsafe\";\n\n/** Addresses pending subroutines inside the stack */\ntype SubroutineKey = symbol;\n\n/** Represents destination of the result of an operation. I.e. when sequence of\n * subroutine invocations, and computables terminates with result, this object\n * determines to which argument of which pending subroutine it should be delivered.\n * See special value for delivery of the final \"return\" result. */\ntype Destination = {\n op: SubroutineKey;\n arg: ArgumentKey;\n};\n\n/** Special address of operation, see below. */\nconst ReturnOpKey: unique symbol = Symbol();\n/** The same, but for the argument part of destination, see below. */\nconst ReturnArgKey = \"return\";\n\n/** Special destination, telling the executor that corresponding result should\n * be exposed as a final result, and execution terminate at this point. */\nconst ReturnDestination = { op: ReturnOpKey, arg: ReturnArgKey } as Destination;\n\nfunction isReturnDestination(destination: Destination): boolean {\n return destination.op == ReturnOpKey && destination.arg == ReturnArgKey;\n}\n\n/** Queued operation, used inside the executor */\ntype QueuedOperation = {\n operation: Operation;\n destination: Destination;\n};\n\n/** Queued computation, returned by the first round of config execution. Such\n * computables should be returned in the intermediate representation of the\n * enclosing computable, and after they are resolved and passed to the\n * postprocessing routine, should be injected into the execution stack to\n * finalize the computation. */\ntype ScheduledComputable = {\n destination: Destination;\n computable: Computable<unknown>;\n};\n\n/** This is what ScheduledComputable transforms from intermediate\n * representation to post-processing. */\ntype MaterializedComputable = {\n destination: Destination;\n computable: unknown;\n};\n\n/** Main entry inside the execution stack. */\ntype PendingSubroutine = {\n subroutine: Subroutine;\n destination: Destination;\n argCounter: number;\n args: ArgumentValues;\n};\n\n/** Execution stack. The closest concept that this object along with enclosed\n * {@link PendingSubroutine}s represent is a Continuation.\n * https://en.wikipedia.org/wiki/Continuation */\ntype ExecutionStack = {\n result?: unknown;\n pendingSubroutines: Map<SubroutineKey, PendingSubroutine>;\n};\n\n/** Returns initial stack value. */\nfunction zeroStack(): ExecutionStack {\n return { pendingSubroutines: new Map<SubroutineKey, PendingSubroutine>() };\n}\n\n/** Implements main executor mechanism.\n * @param env to be passed to while executing operations\n * @param stack execution stack to continue execution from\n * @param operations operations to initiate the execution process\n * @param allowComputables if false, scheduling of async computables will result in error\n * */\nfunction execute(\n env: ExecutionEnvironment,\n stack: ExecutionStack,\n operations: QueuedOperation[],\n allowComputables: boolean,\n): ScheduledComputable[] {\n const operationQueue = new Denque<QueuedOperation>(operations);\n\n /** Returns false if final result is set as result of this operation,\n * true if we should continue processing. */\n const deliverResult = (destination: Destination, result: unknown): boolean => {\n if (isReturnDestination(destination)) {\n stack.result = result;\n return false;\n }\n\n const pending = notEmpty(stack.pendingSubroutines.get(destination.op));\n if (destination.arg in pending.args) throw new Error(\"argument already set\");\n pending.args[destination.arg] = result;\n pending.argCounter--;\n if (pending.argCounter === 0) {\n stack.pendingSubroutines.delete(destination.op);\n operationQueue.push({\n destination: pending.destination,\n operation: pending.subroutine(pending.args),\n });\n }\n\n return true;\n };\n\n // computables, scheduled during computation, are aggregated in this array,\n // and returned from the function in the end\n const computables: ScheduledComputable[] = [];\n\n // each loop = execution of a single queued operation\n mainLoop: while (operationQueue.length > 0) {\n const op = operationQueue.shift()!;\n const action = op.operation(env);\n switch (action.type) {\n case \"ReturnResult\":\n if (!deliverResult(op.destination, action.result)) break mainLoop; // this terminates execution\n break; // switch\n\n case \"ScheduleSubroutine\":\n {\n const newOpKey = Symbol();\n\n const argRequests = Object.entries(action.args);\n const initialArgCounter = argRequests.length;\n\n if (initialArgCounter === 0)\n // if no pending arguments\n operationQueue.push({\n destination: op.destination,\n operation: action.subroutine({}),\n });\n else {\n for (const [arg, operation] of argRequests)\n operationQueue.push({\n destination: { op: newOpKey, arg },\n operation,\n });\n\n stack.pendingSubroutines.set(newOpKey, {\n argCounter: initialArgCounter,\n args: {},\n subroutine: action.subroutine,\n destination: op.destination,\n });\n }\n }\n break;\n\n case \"ScheduleComputable\":\n if (!allowComputables)\n throw new Error(\"asynchronous operations are forbidden in this context\");\n computables.push({\n destination: op.destination,\n computable: action.computable,\n });\n break;\n\n default:\n assertNever(action);\n }\n }\n\n return computables;\n}\n\n//\n// Computable\n//\n\n/** Main method to render configurations */\nexport function computableFromCfg(\n drivers: MiddleLayerDriverKit,\n bCtx: BlockContextAny,\n cfg: Cfg,\n ops: Partial<ComputableRenderingOps> = {},\n): Computable<unknown> {\n return computableFromCfgUnsafe(drivers, toCfgContext(bCtx), cfg, ops);\n}\n\nexport function computableFromCfgUnsafe(\n drivers: MiddleLayerDriverKit,\n ctx: Record<string, unknown>,\n cfg: Cfg,\n ops: Partial<ComputableRenderingOps> = {},\n): Computable<unknown> {\n const key =\n `${ctx.blockId}#` +\n canonicalize({\n ctx: Object.fromEntries(\n Object.entries(ctx).filter(([k]) => NonKeyCtxFields.indexOf(k) === -1),\n ),\n cfg: cfg,\n })!;\n return Computable.makeRaw(\n (c) => {\n const env: ExecutionEnvironment = { drivers, cCtx: c };\n const stack = zeroStack();\n const computables = execute(\n env,\n stack,\n [\n {\n destination: ReturnDestination,\n operation: renderCfg(ctx, cfg),\n },\n ],\n true,\n );\n return {\n ir: computables,\n postprocessValue(value: MaterializedComputable[]): unknown {\n const resolvedOps: QueuedOperation[] = [];\n for (const mc of value)\n resolvedOps.push({ destination: mc.destination, operation: resOp(mc.computable) });\n const postEnv: ExecutionEnvironment = {\n drivers,\n get cCtx(): ComputableCtx {\n throw new Error(\"asynchronous operations are forbidden in this context\");\n },\n };\n\n // Post process can be called several times, that's why it must be a side-effect-free function.\n // But `execute` modifies a stack, so we have to defensively copy it here.\n const copyOfPendingSubrotines = new Map<SubroutineKey, PendingSubroutine>();\n for (const [key, value] of stack.pendingSubroutines)\n copyOfPendingSubrotines.set(key, { ...value, args: { ...value.args } });\n const copiedStack: ExecutionStack = {\n result: stack.result,\n pendingSubroutines: copyOfPendingSubrotines,\n };\n execute(postEnv, copiedStack, resolvedOps, false);\n if (!(\"result\" in copiedStack))\n throw new Error(\"illegal cfg rendering stack state, no result\");\n return copiedStack.result;\n },\n };\n },\n { ...ops, key },\n );\n}\n"],"names":[],"mappings":";;;;;;;AA8BA;AACA,MAAM,WAAW,GAAkB,MAAM,EAAE;AAC3C;AACA,MAAM,YAAY,GAAG,QAAQ;AAE7B;AAC0E;AAC1E,MAAM,iBAAiB,GAAG,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,YAAY,EAAiB;AAE/E,SAAS,mBAAmB,CAAC,WAAwB,EAAA;IACnD,OAAO,WAAW,CAAC,EAAE,IAAI,WAAW,IAAI,WAAW,CAAC,GAAG,IAAI,YAAY;AACzE;AAyCA;AACA,SAAS,SAAS,GAAA;AAChB,IAAA,OAAO,EAAE,kBAAkB,EAAE,IAAI,GAAG,EAAoC,EAAE;AAC5E;AAEA;;;;;AAKK;AACL,SAAS,OAAO,CACd,GAAyB,EACzB,KAAqB,EACrB,UAA6B,EAC7B,gBAAyB,EAAA;AAEzB,IAAA,MAAM,cAAc,GAAG,IAAI,MAAM,CAAkB,UAAU,CAAC;AAE9D;AAC4C;AAC5C,IAAA,MAAM,aAAa,GAAG,CAAC,WAAwB,EAAE,MAAe,KAAa;AAC3E,QAAA,IAAI,mBAAmB,CAAC,WAAW,CAAC,EAAE;AACpC,YAAA,KAAK,CAAC,MAAM,GAAG,MAAM;AACrB,YAAA,OAA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,uBAAuB,GAAG,IAAI,GAAG,EAAoC;gBAC3E,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,KAAK,CAAC,kBAAkB;AACjD,oBAAA,uBAAuB,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;AACzE,gBAAA,MAAM,WAAW,GAAmB;oBAClC,MAAM,EAAE,KAAK,CAAC,MAAM;AACpB,oBAAA,kBAAkB,EAAE,uBAAuB;iBAC5C;gBACD,OAAO,CAAC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,CAAC;AACjD,gBAAA,IAAI,EAAE,QAAQ,IAAI,WAAW,CAAC;AAC5B,oBAAA,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC;gBACjE,OAAO,WAAW,CAAC,MAAM;YAC3B,CAAC;SACF;IACH,CAAC,EACD,EAAE,GAAG,GAAG,EAAE,GAAG,EAAE,CAChB;AACH;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Computable, ComputableCtx } from
|
|
2
|
-
import type { MiddleLayerDriverKit } from
|
|
1
|
+
import type { Computable, ComputableCtx } from "@milaboratories/computable";
|
|
2
|
+
import type { MiddleLayerDriverKit } from "../middle_layer/driver_kit";
|
|
3
3
|
export type ArgumentKey = string;
|
|
4
4
|
export type ExecutionEnvironment = {
|
|
5
5
|
/** Each configuration is rendered inside a computable callback, this is the
|
|
@@ -12,16 +12,16 @@ export type ArgumentValues = Record<ArgumentKey, unknown>;
|
|
|
12
12
|
export type ArgumentRequests = Record<ArgumentKey, Operation>;
|
|
13
13
|
export type Subroutine = (args: ArgumentValues) => Operation;
|
|
14
14
|
export type ScheduleSubroutine = {
|
|
15
|
-
type:
|
|
15
|
+
type: "ScheduleSubroutine";
|
|
16
16
|
subroutine: Subroutine;
|
|
17
17
|
args: ArgumentRequests;
|
|
18
18
|
};
|
|
19
19
|
export type ScheduleComputable = {
|
|
20
|
-
type:
|
|
20
|
+
type: "ScheduleComputable";
|
|
21
21
|
computable: Computable<unknown>;
|
|
22
22
|
};
|
|
23
23
|
export type ReturnResult = {
|
|
24
|
-
type:
|
|
24
|
+
type: "ReturnResult";
|
|
25
25
|
result: unknown;
|
|
26
26
|
};
|
|
27
27
|
export type OperationAction = ScheduleSubroutine | ScheduleComputable | ReturnResult;
|
|
@@ -7,7 +7,7 @@ var computable = require('@milaboratories/computable');
|
|
|
7
7
|
|
|
8
8
|
function res(result) {
|
|
9
9
|
return {
|
|
10
|
-
type:
|
|
10
|
+
type: "ReturnResult",
|
|
11
11
|
result: result,
|
|
12
12
|
};
|
|
13
13
|
}
|
|
@@ -58,7 +58,7 @@ function SRMapArrayValues1(ctx, ops) {
|
|
|
58
58
|
if (source === undefined)
|
|
59
59
|
return resOp(undefined);
|
|
60
60
|
return () => ({
|
|
61
|
-
type:
|
|
61
|
+
type: "ScheduleSubroutine",
|
|
62
62
|
subroutine: SRCollectArrayFromArgs(source.length),
|
|
63
63
|
args: mapArrayToRecord(source, (e) => renderCfg({ ...ctx, [ops.itVar]: e }, ops.mapping)),
|
|
64
64
|
});
|
|
@@ -83,7 +83,7 @@ function SRMapRecordValues1(ctx, ops) {
|
|
|
83
83
|
nextArgs[k] = renderCfg(newCtx, ops.mapping);
|
|
84
84
|
}
|
|
85
85
|
return () => ({
|
|
86
|
-
type:
|
|
86
|
+
type: "ScheduleSubroutine",
|
|
87
87
|
subroutine: SRMapRecordValues2,
|
|
88
88
|
args: nextArgs,
|
|
89
89
|
});
|
|
@@ -149,7 +149,7 @@ function SRMapResourceFields1(ctx, ops) {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
return {
|
|
152
|
-
type:
|
|
152
|
+
type: "ScheduleSubroutine",
|
|
153
153
|
subroutine: SRMapResourceFields2,
|
|
154
154
|
args: nextArgs,
|
|
155
155
|
};
|
|
@@ -165,7 +165,7 @@ const SRGetBlobContent = (range) => (args) => {
|
|
|
165
165
|
return resOp(undefined);
|
|
166
166
|
return ({ drivers }) => {
|
|
167
167
|
return {
|
|
168
|
-
type:
|
|
168
|
+
type: "ScheduleComputable",
|
|
169
169
|
computable: computable.Computable.make((ctx) => {
|
|
170
170
|
return drivers.blobDriver.getDownloadedBlob(ctx.accessor(source).node().resourceInfo);
|
|
171
171
|
}, {
|
|
@@ -186,7 +186,7 @@ const SRGetBlobContentAsString = (range) => (args) => {
|
|
|
186
186
|
// getting target resource id and type
|
|
187
187
|
const resourceInfo = cCtx.accessor(source).node().resourceInfo;
|
|
188
188
|
return {
|
|
189
|
-
type:
|
|
189
|
+
type: "ScheduleComputable",
|
|
190
190
|
computable: computable.Computable.make((ctx) => drivers.blobDriver.getDownloadedBlob(resourceInfo, ctx), {
|
|
191
191
|
postprocessValue: async (value) => {
|
|
192
192
|
if (value === undefined)
|
|
@@ -204,7 +204,7 @@ const SRGetBlobContentAsJson = (range) => (args) => {
|
|
|
204
204
|
return resOp(undefined);
|
|
205
205
|
return ({ drivers }) => {
|
|
206
206
|
return {
|
|
207
|
-
type:
|
|
207
|
+
type: "ScheduleComputable",
|
|
208
208
|
computable: computable.Computable.make((c) => drivers.blobDriver.getDownloadedBlob(c.accessor(source).node().resourceInfo, c), {
|
|
209
209
|
postprocessValue: async (value) => {
|
|
210
210
|
if (value == undefined)
|
|
@@ -224,7 +224,7 @@ const SRGetDownloadedBlobContent = (args) => {
|
|
|
224
224
|
return resOp(undefined);
|
|
225
225
|
return (ctx) => {
|
|
226
226
|
return {
|
|
227
|
-
type:
|
|
227
|
+
type: "ScheduleComputable",
|
|
228
228
|
computable: ctx.drivers.blobDriver.getDownloadedBlob(source),
|
|
229
229
|
};
|
|
230
230
|
};
|
|
@@ -235,7 +235,7 @@ const SRGetOnDemandBlobContent = (args) => {
|
|
|
235
235
|
return resOp(undefined);
|
|
236
236
|
return ({ drivers }) => {
|
|
237
237
|
return {
|
|
238
|
-
type:
|
|
238
|
+
type: "ScheduleComputable",
|
|
239
239
|
computable: drivers.blobDriver.getOnDemandBlob(source),
|
|
240
240
|
};
|
|
241
241
|
};
|
|
@@ -246,7 +246,7 @@ const SRExtractArchiveAndGetURL = (format) => (args) => {
|
|
|
246
246
|
return resOp(undefined);
|
|
247
247
|
return ({ drivers }) => {
|
|
248
248
|
return {
|
|
249
|
-
type:
|
|
249
|
+
type: "ScheduleComputable",
|
|
250
250
|
computable: drivers.blobToURLDriver.extractArchiveAndGetURL(source, format),
|
|
251
251
|
};
|
|
252
252
|
};
|
|
@@ -257,7 +257,7 @@ const SRGetImportProgress = (args) => {
|
|
|
257
257
|
return resOp(undefined);
|
|
258
258
|
return ({ drivers }) => {
|
|
259
259
|
return {
|
|
260
|
-
type:
|
|
260
|
+
type: "ScheduleComputable",
|
|
261
261
|
computable: drivers.uploadDriver.getProgressId(source),
|
|
262
262
|
};
|
|
263
263
|
};
|
|
@@ -268,7 +268,7 @@ const SRGetLastLogs = (lines) => (args) => {
|
|
|
268
268
|
return resOp(undefined);
|
|
269
269
|
return ({ drivers }) => {
|
|
270
270
|
return {
|
|
271
|
-
type:
|
|
271
|
+
type: "ScheduleComputable",
|
|
272
272
|
computable: drivers.logDriver.getLastLogs(source, lines),
|
|
273
273
|
};
|
|
274
274
|
};
|
|
@@ -279,7 +279,7 @@ const SRGetProgressLog = (patternToSearch) => (args) => {
|
|
|
279
279
|
return resOp(undefined);
|
|
280
280
|
return ({ drivers }) => {
|
|
281
281
|
return {
|
|
282
|
-
type:
|
|
282
|
+
type: "ScheduleComputable",
|
|
283
283
|
computable: drivers.logDriver.getProgressLog(source, patternToSearch),
|
|
284
284
|
};
|
|
285
285
|
};
|
|
@@ -290,7 +290,7 @@ const SRGetProgressLogWithInfo = (patternToSearch) => (args) => {
|
|
|
290
290
|
return resOp(undefined);
|
|
291
291
|
return ({ drivers }) => {
|
|
292
292
|
return {
|
|
293
|
-
type:
|
|
293
|
+
type: "ScheduleComputable",
|
|
294
294
|
computable: drivers.logDriver.getProgressLogWithInfo(source, patternToSearch),
|
|
295
295
|
};
|
|
296
296
|
};
|
|
@@ -301,7 +301,7 @@ const SRGetLogHandle = (args) => {
|
|
|
301
301
|
return resOp(undefined);
|
|
302
302
|
return ({ drivers }) => {
|
|
303
303
|
return {
|
|
304
|
-
type:
|
|
304
|
+
type: "ScheduleComputable",
|
|
305
305
|
computable: drivers.logDriver.getLogHandle(source),
|
|
306
306
|
};
|
|
307
307
|
};
|
|
@@ -309,210 +309,209 @@ const SRGetLogHandle = (args) => {
|
|
|
309
309
|
/** Renders configuration into executor's Operation */
|
|
310
310
|
function renderCfg(ctx, cfg) {
|
|
311
311
|
switch (cfg.type) {
|
|
312
|
-
case
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
return (e) => res(ctxValue(e.cCtx));
|
|
317
|
-
}
|
|
318
|
-
else {
|
|
319
|
-
return resOp(ctxValue);
|
|
320
|
-
}
|
|
312
|
+
case "GetFromCtx": {
|
|
313
|
+
const ctxValue = ctx[cfg.variable];
|
|
314
|
+
if (typeof ctxValue === "function") {
|
|
315
|
+
return (e) => res(ctxValue(e.cCtx));
|
|
321
316
|
}
|
|
322
|
-
|
|
317
|
+
else {
|
|
318
|
+
return resOp(ctxValue);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
case "Isolate":
|
|
323
322
|
return ({ drivers }) => ({
|
|
324
|
-
type:
|
|
323
|
+
type: "ScheduleComputable",
|
|
325
324
|
computable: executor.computableFromCfgUnsafe(drivers, ctx, cfg.cfg),
|
|
326
325
|
});
|
|
327
|
-
case
|
|
326
|
+
case "Immediate":
|
|
328
327
|
return resOp(cfg.value);
|
|
329
|
-
case
|
|
328
|
+
case "GetJsonField":
|
|
330
329
|
return () => ({
|
|
331
|
-
type:
|
|
330
|
+
type: "ScheduleSubroutine",
|
|
332
331
|
subroutine: SRGetJsonField,
|
|
333
332
|
args: {
|
|
334
333
|
source: renderCfg(ctx, cfg.source),
|
|
335
334
|
field: renderCfg(ctx, cfg.field),
|
|
336
335
|
},
|
|
337
336
|
});
|
|
338
|
-
case
|
|
337
|
+
case "MapArrayValues":
|
|
339
338
|
return () => ({
|
|
340
|
-
type:
|
|
339
|
+
type: "ScheduleSubroutine",
|
|
341
340
|
subroutine: SRMapArrayValues1(ctx, cfg),
|
|
342
341
|
args: {
|
|
343
342
|
source: renderCfg(ctx, cfg.source),
|
|
344
343
|
},
|
|
345
344
|
});
|
|
346
|
-
case
|
|
345
|
+
case "MapRecordValues":
|
|
347
346
|
return () => ({
|
|
348
|
-
type:
|
|
347
|
+
type: "ScheduleSubroutine",
|
|
349
348
|
subroutine: SRMapRecordValues1(ctx, cfg),
|
|
350
349
|
args: {
|
|
351
350
|
source: renderCfg(ctx, cfg.source),
|
|
352
351
|
},
|
|
353
352
|
});
|
|
354
|
-
case
|
|
353
|
+
case "MakeObject":
|
|
355
354
|
return () => ({
|
|
356
|
-
type:
|
|
355
|
+
type: "ScheduleSubroutine",
|
|
357
356
|
subroutine: SRMakeObject,
|
|
358
357
|
args: util.mapRecord(cfg.template, (c) => renderCfg(ctx, c)),
|
|
359
358
|
});
|
|
360
|
-
case
|
|
359
|
+
case "MakeArray":
|
|
361
360
|
return () => ({
|
|
362
|
-
type:
|
|
361
|
+
type: "ScheduleSubroutine",
|
|
363
362
|
subroutine: SRCollectArrayFromArgs(cfg.template.length),
|
|
364
363
|
args: mapArrayToRecord(cfg.template, (e) => renderCfg(ctx, e)),
|
|
365
364
|
});
|
|
366
|
-
case
|
|
365
|
+
case "Flatten":
|
|
367
366
|
return () => ({
|
|
368
|
-
type:
|
|
367
|
+
type: "ScheduleSubroutine",
|
|
369
368
|
subroutine: SRFlatten,
|
|
370
369
|
args: {
|
|
371
370
|
source: renderCfg(ctx, cfg.source),
|
|
372
371
|
},
|
|
373
372
|
});
|
|
374
|
-
case
|
|
373
|
+
case "IsEmpty":
|
|
375
374
|
return () => ({
|
|
376
|
-
type:
|
|
375
|
+
type: "ScheduleSubroutine",
|
|
377
376
|
subroutine: SRIsEmpty,
|
|
378
377
|
args: {
|
|
379
378
|
arg: renderCfg(ctx, cfg.arg),
|
|
380
379
|
},
|
|
381
380
|
});
|
|
382
|
-
case
|
|
381
|
+
case "Not":
|
|
383
382
|
return () => ({
|
|
384
|
-
type:
|
|
383
|
+
type: "ScheduleSubroutine",
|
|
385
384
|
subroutine: SRNot,
|
|
386
385
|
args: {
|
|
387
386
|
operand: renderCfg(ctx, cfg.operand),
|
|
388
387
|
},
|
|
389
388
|
});
|
|
390
|
-
case
|
|
389
|
+
case "And":
|
|
391
390
|
return () => ({
|
|
392
|
-
type:
|
|
391
|
+
type: "ScheduleSubroutine",
|
|
393
392
|
subroutine: SRAnd,
|
|
394
393
|
args: {
|
|
395
394
|
operand1: renderCfg(ctx, cfg.operand1),
|
|
396
395
|
operand2: renderCfg(ctx, cfg.operand2),
|
|
397
396
|
},
|
|
398
397
|
});
|
|
399
|
-
case
|
|
398
|
+
case "Or":
|
|
400
399
|
return () => ({
|
|
401
|
-
type:
|
|
400
|
+
type: "ScheduleSubroutine",
|
|
402
401
|
subroutine: SROr,
|
|
403
402
|
args: {
|
|
404
403
|
operand1: renderCfg(ctx, cfg.operand1),
|
|
405
404
|
operand2: renderCfg(ctx, cfg.operand2),
|
|
406
405
|
},
|
|
407
406
|
});
|
|
408
|
-
case
|
|
407
|
+
case "MapResourceFields":
|
|
409
408
|
return () => ({
|
|
410
|
-
type:
|
|
409
|
+
type: "ScheduleSubroutine",
|
|
411
410
|
subroutine: SRMapResourceFields1(ctx, cfg),
|
|
412
411
|
args: {
|
|
413
412
|
source: renderCfg(ctx, cfg.source),
|
|
414
413
|
},
|
|
415
414
|
});
|
|
416
|
-
case
|
|
415
|
+
case "GetResourceField":
|
|
417
416
|
return () => ({
|
|
418
|
-
type:
|
|
417
|
+
type: "ScheduleSubroutine",
|
|
419
418
|
subroutine: SRGetResourceField,
|
|
420
419
|
args: {
|
|
421
420
|
source: renderCfg(ctx, cfg.source),
|
|
422
421
|
field: renderCfg(ctx, cfg.field),
|
|
423
422
|
},
|
|
424
423
|
});
|
|
425
|
-
case
|
|
424
|
+
case "GetResourceValueAsJson":
|
|
426
425
|
return () => ({
|
|
427
|
-
type:
|
|
426
|
+
type: "ScheduleSubroutine",
|
|
428
427
|
subroutine: SRResourceValueAsJson,
|
|
429
428
|
args: {
|
|
430
429
|
source: renderCfg(ctx, cfg.source),
|
|
431
430
|
},
|
|
432
431
|
});
|
|
433
|
-
case
|
|
432
|
+
case "GetBlobContent":
|
|
434
433
|
return () => ({
|
|
435
|
-
type:
|
|
434
|
+
type: "ScheduleSubroutine",
|
|
436
435
|
subroutine: SRGetBlobContent(cfg.range),
|
|
437
436
|
args: {
|
|
438
437
|
source: renderCfg(ctx, cfg.source),
|
|
439
438
|
},
|
|
440
439
|
});
|
|
441
|
-
case
|
|
440
|
+
case "GetBlobContentAsString":
|
|
442
441
|
return () => ({
|
|
443
|
-
type:
|
|
442
|
+
type: "ScheduleSubroutine",
|
|
444
443
|
subroutine: SRGetBlobContentAsString(cfg.range),
|
|
445
444
|
args: {
|
|
446
445
|
source: renderCfg(ctx, cfg.source),
|
|
447
446
|
},
|
|
448
447
|
});
|
|
449
|
-
case
|
|
448
|
+
case "GetBlobContentAsJson":
|
|
450
449
|
return () => ({
|
|
451
|
-
type:
|
|
450
|
+
type: "ScheduleSubroutine",
|
|
452
451
|
subroutine: SRGetBlobContentAsJson(cfg.range),
|
|
453
452
|
args: {
|
|
454
453
|
source: renderCfg(ctx, cfg.source),
|
|
455
454
|
},
|
|
456
455
|
});
|
|
457
|
-
case
|
|
456
|
+
case "GetDownloadedBlobContent":
|
|
458
457
|
return () => ({
|
|
459
|
-
type:
|
|
458
|
+
type: "ScheduleSubroutine",
|
|
460
459
|
subroutine: SRGetDownloadedBlobContent,
|
|
461
460
|
args: {
|
|
462
461
|
source: renderCfg(ctx, cfg.source),
|
|
463
462
|
},
|
|
464
463
|
});
|
|
465
|
-
case
|
|
464
|
+
case "GetOnDemandBlobContent":
|
|
466
465
|
return () => ({
|
|
467
|
-
type:
|
|
466
|
+
type: "ScheduleSubroutine",
|
|
468
467
|
subroutine: SRGetOnDemandBlobContent,
|
|
469
468
|
args: {
|
|
470
469
|
source: renderCfg(ctx, cfg.source),
|
|
471
470
|
},
|
|
472
471
|
});
|
|
473
|
-
case
|
|
472
|
+
case "ExtractArchiveAndGetURL":
|
|
474
473
|
return () => ({
|
|
475
|
-
type:
|
|
474
|
+
type: "ScheduleSubroutine",
|
|
476
475
|
subroutine: SRExtractArchiveAndGetURL(cfg.format),
|
|
477
476
|
args: {
|
|
478
477
|
source: renderCfg(ctx, cfg.source),
|
|
479
478
|
},
|
|
480
479
|
});
|
|
481
|
-
case
|
|
480
|
+
case "GetImportProgress":
|
|
482
481
|
return () => ({
|
|
483
|
-
type:
|
|
482
|
+
type: "ScheduleSubroutine",
|
|
484
483
|
subroutine: SRGetImportProgress,
|
|
485
484
|
args: {
|
|
486
485
|
source: renderCfg(ctx, cfg.source),
|
|
487
486
|
},
|
|
488
487
|
});
|
|
489
|
-
case
|
|
488
|
+
case "GetLastLogs":
|
|
490
489
|
return () => ({
|
|
491
|
-
type:
|
|
490
|
+
type: "ScheduleSubroutine",
|
|
492
491
|
subroutine: SRGetLastLogs(cfg.lines),
|
|
493
492
|
args: {
|
|
494
493
|
source: renderCfg(ctx, cfg.source),
|
|
495
494
|
},
|
|
496
495
|
});
|
|
497
|
-
case
|
|
496
|
+
case "GetProgressLog":
|
|
498
497
|
return () => ({
|
|
499
|
-
type:
|
|
498
|
+
type: "ScheduleSubroutine",
|
|
500
499
|
subroutine: SRGetProgressLog(cfg.patternToSearch),
|
|
501
500
|
args: {
|
|
502
501
|
source: renderCfg(ctx, cfg.source),
|
|
503
502
|
},
|
|
504
503
|
});
|
|
505
|
-
case
|
|
504
|
+
case "GetProgressLogWithInfo":
|
|
506
505
|
return () => ({
|
|
507
|
-
type:
|
|
506
|
+
type: "ScheduleSubroutine",
|
|
508
507
|
subroutine: SRGetProgressLogWithInfo(cfg.patternToSearch),
|
|
509
508
|
args: {
|
|
510
509
|
source: renderCfg(ctx, cfg.source),
|
|
511
510
|
},
|
|
512
511
|
});
|
|
513
|
-
case
|
|
512
|
+
case "GetLogHandle":
|
|
514
513
|
return () => ({
|
|
515
|
-
type:
|
|
514
|
+
type: "ScheduleSubroutine",
|
|
516
515
|
subroutine: SRGetLogHandle,
|
|
517
516
|
args: {
|
|
518
517
|
source: renderCfg(ctx, cfg.source),
|