yaml-flow 6.0.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/board-live-cards-cli.js +4 -4
- package/browser/asset-integrity.json +3 -3
- package/browser/board-livecards-client.js +2 -0
- package/browser/board-livecards-client.js.map +1 -0
- package/browser/board-livecards-localstorage.js +10 -0
- package/browser/board-livecards-localstorage.js.map +1 -0
- package/browser/board-livegraph-engine.js +2 -2
- package/browser/board-livegraph-engine.js.map +1 -1
- package/browser/card-compute.js +28 -28
- package/browser/compute-jsonata.js +5 -0
- package/browser/compute-jsonata.js.map +1 -0
- package/browser/live-cards.js +261 -150
- package/card-store.js +4 -4
- package/dist/{board-live-cards-public-CltXYgaY.d.cts → board-live-cards-public-CW5074xr.d.cts} +9 -5
- package/dist/{board-live-cards-public-f-E-FAyp.d.ts → board-live-cards-public-hnZo0mAf.d.ts} +9 -5
- package/dist/board-livegraph-runtime/index.cjs +2 -2
- package/dist/board-livegraph-runtime/index.cjs.map +1 -1
- package/dist/board-livegraph-runtime/index.d.cts +11 -9
- package/dist/board-livegraph-runtime/index.d.ts +11 -9
- package/dist/board-livegraph-runtime/index.js +2 -2
- package/dist/board-livegraph-runtime/index.js.map +1 -1
- package/dist/board-livegraph-runtime/jsonata-sync.cjs +37 -1
- package/dist/card-compute/index.cjs +4 -4
- package/dist/card-compute/index.cjs.map +1 -1
- package/dist/card-compute/index.d.cts +5 -1
- package/dist/card-compute/index.d.ts +5 -1
- package/dist/card-compute/index.js +4 -4
- package/dist/card-compute/index.js.map +1 -1
- package/dist/card-compute/jsonata-sync.cjs +37 -1
- package/dist/cli/browser-api/board-live-cards-browser-adapter.cjs +2 -1
- package/dist/cli/browser-api/board-live-cards-browser-adapter.cjs.map +1 -1
- package/dist/cli/browser-api/board-live-cards-browser-adapter.d.cts +27 -14
- package/dist/cli/browser-api/board-live-cards-browser-adapter.d.ts +27 -14
- package/dist/cli/browser-api/board-live-cards-browser-adapter.js +2 -1
- package/dist/cli/browser-api/board-live-cards-browser-adapter.js.map +1 -1
- package/dist/cli/browser-api/card-store-browser-api.cjs +1 -1
- package/dist/cli/browser-api/card-store-browser-api.cjs.map +1 -1
- package/dist/cli/browser-api/card-store-browser-api.js +1 -1
- package/dist/cli/browser-api/card-store-browser-api.js.map +1 -1
- package/dist/cli/browser-api/jsonata-sync.cjs +37 -1
- package/dist/cli/node/artifacts-store-cli.cjs +8 -8
- package/dist/cli/node/artifacts-store-cli.cjs.map +1 -1
- package/dist/cli/node/artifacts-store-cli.js +8 -8
- package/dist/cli/node/artifacts-store-cli.js.map +1 -1
- package/dist/cli/node/board-live-cards-cli.cjs +7 -7
- package/dist/cli/node/board-live-cards-cli.cjs.map +1 -1
- package/dist/cli/node/board-live-cards-cli.js +7 -7
- package/dist/cli/node/board-live-cards-cli.js.map +1 -1
- package/dist/cli/node/card-store-cli.cjs +5 -5
- package/dist/cli/node/card-store-cli.cjs.map +1 -1
- package/dist/cli/node/card-store-cli.js +5 -5
- package/dist/cli/node/card-store-cli.js.map +1 -1
- package/dist/cli/node/execution-adapter.cjs +3 -0
- package/dist/cli/node/execution-adapter.cjs.map +1 -0
- package/dist/cli/node/execution-adapter.d.cts +174 -0
- package/dist/cli/node/execution-adapter.d.ts +174 -0
- package/dist/cli/node/execution-adapter.js +3 -0
- package/dist/cli/node/execution-adapter.js.map +1 -0
- package/dist/cli/node/fs-board-adapter.cjs +7 -7
- package/dist/cli/node/fs-board-adapter.cjs.map +1 -1
- package/dist/cli/node/fs-board-adapter.d.cts +2 -2
- package/dist/cli/node/fs-board-adapter.d.ts +2 -2
- package/dist/cli/node/fs-board-adapter.js +7 -7
- package/dist/cli/node/fs-board-adapter.js.map +1 -1
- package/dist/cli/node/jsonata-sync.cjs +37 -1
- package/dist/cli/node/source-cli-task-executor.cjs +4 -4
- package/dist/cli/node/source-cli-task-executor.cjs.map +1 -1
- package/dist/cli/node/source-cli-task-executor.js +4 -4
- package/dist/cli/node/source-cli-task-executor.js.map +1 -1
- package/dist/continuous-event-graph/index.cjs +2 -2
- package/dist/continuous-event-graph/index.cjs.map +1 -1
- package/dist/continuous-event-graph/index.js +2 -2
- package/dist/continuous-event-graph/index.js.map +1 -1
- package/dist/continuous-event-graph/jsonata-sync.cjs +37 -1
- package/dist/execution-refs.cjs +2 -1
- package/dist/execution-refs.cjs.map +1 -1
- package/dist/execution-refs.d.cts +49 -11
- package/dist/execution-refs.d.ts +49 -11
- package/dist/execution-refs.js +2 -1
- package/dist/execution-refs.js.map +1 -1
- package/dist/index.cjs +10 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/dist/jsonata-sync.cjs +37 -1
- package/dist/server-runtime/index.cjs +9 -0
- package/dist/server-runtime/index.cjs.map +1 -0
- package/dist/server-runtime/index.d.cts +31 -0
- package/dist/server-runtime/index.d.ts +31 -0
- package/dist/server-runtime/index.js +9 -0
- package/dist/server-runtime/index.js.map +1 -0
- package/dist/server-runtime/jsonata-sync.cjs +7623 -0
- package/dist/step-machine-public/index.cjs +2 -0
- package/dist/step-machine-public/index.cjs.map +1 -0
- package/dist/step-machine-public/index.d.cts +159 -0
- package/dist/step-machine-public/index.d.ts +159 -0
- package/dist/step-machine-public/index.js +2 -0
- package/dist/step-machine-public/index.js.map +1 -0
- package/dist/step-machine-public/jsonata-sync.cjs +7623 -0
- package/dist/storage-refs.cjs +2 -2
- package/dist/storage-refs.cjs.map +1 -1
- package/dist/storage-refs.d.cts +7 -6
- package/dist/storage-refs.d.ts +7 -6
- package/dist/storage-refs.js +2 -2
- package/dist/storage-refs.js.map +1 -1
- package/dist/types-B1ZRa4aI.d.ts +147 -0
- package/dist/types-BxEFcVK9.d.cts +147 -0
- package/examples/browser/boards/portfolio-tracker/portfolio-t4.js +9 -10
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-http-test.js +357 -0
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-public.js +9 -10
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-server.js +300 -0
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-server.py +617 -0
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-sse-worker.js +48 -0
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker.py +11 -10
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/_board-cli.js +19 -4
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/add-cards-cli.js +4 -8
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/init-board-cli.js +6 -10
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/poll-status-cli.js +8 -16
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/reset-board-dir-cli.js +2 -6
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/retrigger-cli.js +4 -8
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/status-cli.js +3 -7
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/update-holdings-cli.js +4 -8
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/wait-completed-cli.js +7 -16
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/write-prices-cli.js +2 -6
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/_board_pycli.py +13 -3
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/add-cards.py +2 -1
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/init-board.py +2 -1
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/poll-status.py +2 -1
- package/examples/cli/step-machine-cli/portfolio-tracker/portfolio-tracker.flow.yaml +20 -24
- package/examples/cli/step-machine-cli/portfolio-tracker/run-inline-python-demo-pycli.py +0 -3
- package/examples/cli/step-machine-demo/jsonata-init-board-cli.js +8 -13
- package/examples/cli/step-machine-demo/jsonata-init-board.flow.yaml +33 -9
- package/examples/cli/step-machine-demo/one-step-cli-only.flow.yaml +3 -1
- package/examples/cli/step-machine-demo/step2-double-cli.js +6 -12
- package/examples/cli/step-machine-demo/two-step-math.flow.yaml +66 -4
- package/examples/cli/step-machine-demo/two-step-mixed.flow.yaml +13 -5
- package/examples/example-board/cards/_index.json +47 -0
- package/examples/example-board/cards/card-market-prices.json +33 -9
- package/examples/example-board/cards/card-my-identity.json +30 -6
- package/examples/example-board/cards/card-portfolio-action.json +24 -6
- package/examples/example-board/cards/card-portfolio-intelligence.json +97 -0
- package/examples/example-board/cards/card-portfolio-risks.json +24 -6
- package/examples/example-board/cards/card-portfolio-value.json +38 -10
- package/examples/example-board/cards/card-portfolio.json +57 -13
- package/examples/example-board/cards/card-rebalance-impact.json +22 -6
- package/examples/example-board/cards/card-rebalance-sim.json +66 -15
- package/examples/example-board/demo-server.js +360 -69
- package/examples/example-board/demo-shell-localstorage.html +774 -0
- package/examples/example-board/demo-shell-with-server.html +18 -36
- package/examples/example-board/demo-shell.html +5 -4
- package/examples/example-board/demo-task-executor.js +217 -265
- package/package.json +15 -13
- package/step-machine-cli.js +43 -310
- package/board-livecards-server-runtime.js +0 -1513
- package/browser/board-livecards-runtime-client.js +0 -263
- package/dist/pycli/quickjs-board-runtime.global.js +0 -9
- package/dist/pycli/quickjs-board-runtime.global.js.map +0 -1
- package/dist/pycli/quickjs-step-machine-runtime.global.js +0 -5
- package/dist/pycli/quickjs-step-machine-runtime.global.js.map +0 -1
- package/examples/cli/step-machine-demo/two-step-math-handlers.js +0 -32
- package/examples/cli/step-machine-demo/two-step-mixed-handlers.js +0 -24
- package/examples/example-board/demo-shell-browser.html +0 -675
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.
|
|
1
|
+
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jsonataSync = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
|
2
2
|
/**
|
|
3
3
|
* © Copyright IBM Corp. 2018 All Rights Reserved
|
|
4
4
|
* Project name: JSONata
|
|
@@ -2839,6 +2839,10 @@ const functions = (() => {
|
|
|
2839
2839
|
}
|
|
2840
2840
|
|
|
2841
2841
|
var result = createSequence();
|
|
2842
|
+
// PATCH: $map must always return an array (never collapse to scalar),
|
|
2843
|
+
// even when the input has exactly 1 item. keepSingleton prevents the
|
|
2844
|
+
// length===1 → result[0] collapse in evaluate().
|
|
2845
|
+
result.keepSingleton = true;
|
|
2842
2846
|
// do the map - iterate over the arrays, and invoke func
|
|
2843
2847
|
for (var i = 0; i < arr.length; i++) {
|
|
2844
2848
|
var func_args = hofFuncArgs(func, arr[i], i, arr);
|
|
@@ -2865,6 +2869,8 @@ const functions = (() => {
|
|
|
2865
2869
|
}
|
|
2866
2870
|
|
|
2867
2871
|
var result = createSequence();
|
|
2872
|
+
// PATCH: $filter must always return an array (never scalar)
|
|
2873
|
+
result.keepSingleton = true;
|
|
2868
2874
|
|
|
2869
2875
|
for (var i = 0; i < arr.length; i++) {
|
|
2870
2876
|
var entry = arr[i];
|
|
@@ -3022,6 +3028,8 @@ const functions = (() => {
|
|
|
3022
3028
|
} else if (arg !== null && typeof arg === 'object' && !isFunction(arg)) {
|
|
3023
3029
|
Object.keys(arg).forEach(key => result.push(key));
|
|
3024
3030
|
}
|
|
3031
|
+
// PATCH: $keys must always return an array (never scalar)
|
|
3032
|
+
result.keepSingleton = true;
|
|
3025
3033
|
return result;
|
|
3026
3034
|
}
|
|
3027
3035
|
|
|
@@ -3096,6 +3104,8 @@ const functions = (() => {
|
|
|
3096
3104
|
*/
|
|
3097
3105
|
function spread(arg) {
|
|
3098
3106
|
var result = createSequence();
|
|
3107
|
+
// PATCH: $spread must always return an array (never scalar)
|
|
3108
|
+
result.keepSingleton = true;
|
|
3099
3109
|
|
|
3100
3110
|
if (Array.isArray(arg)) {
|
|
3101
3111
|
// spread all of the items in the array
|
|
@@ -3168,6 +3178,8 @@ const functions = (() => {
|
|
|
3168
3178
|
*/
|
|
3169
3179
|
function each(obj, func) {
|
|
3170
3180
|
var result = createSequence();
|
|
3181
|
+
// PATCH: $each must always return an array (never scalar)
|
|
3182
|
+
result.keepSingleton = true;
|
|
3171
3183
|
|
|
3172
3184
|
for (var key in obj) {
|
|
3173
3185
|
var func_args = hofFuncArgs(func, obj[key], key, obj);
|
|
@@ -3600,6 +3612,7 @@ var jsonata = (function() {
|
|
|
3600
3612
|
var resultSequence;
|
|
3601
3613
|
var isTupleStream = false;
|
|
3602
3614
|
var tupleBindings = undefined;
|
|
3615
|
+
var traversedArray = false; // PATCH: track if any step iterated over an array
|
|
3603
3616
|
|
|
3604
3617
|
// evaluate each step in turn
|
|
3605
3618
|
for(var ii = 0; ii < expr.steps.length; ii++) {
|
|
@@ -3624,6 +3637,11 @@ var jsonata = (function() {
|
|
|
3624
3637
|
break;
|
|
3625
3638
|
}
|
|
3626
3639
|
|
|
3640
|
+
// PATCH: detect array traversal from the step result
|
|
3641
|
+
if (!isTupleStream && Array.isArray(resultSequence) && resultSequence._fromArrayField) {
|
|
3642
|
+
traversedArray = true;
|
|
3643
|
+
}
|
|
3644
|
+
|
|
3627
3645
|
if(typeof step.focus === 'undefined') {
|
|
3628
3646
|
inputSequence = resultSequence;
|
|
3629
3647
|
}
|
|
@@ -3650,6 +3668,12 @@ var jsonata = (function() {
|
|
|
3650
3668
|
resultSequence.keepSingleton = true;
|
|
3651
3669
|
}
|
|
3652
3670
|
|
|
3671
|
+
// PATCH: Always preserve array results from path expressions that traversed
|
|
3672
|
+
// through an array. Ensures predictable array output regardless of input cardinality.
|
|
3673
|
+
if (traversedArray && Array.isArray(resultSequence) && resultSequence.sequence) {
|
|
3674
|
+
Object.defineProperty(resultSequence, 'keepSingleton', { value: true, enumerable: false, configurable: true });
|
|
3675
|
+
}
|
|
3676
|
+
|
|
3653
3677
|
if (expr.hasOwnProperty('group')) {
|
|
3654
3678
|
resultSequence = evaluateGroupExpression(expr.group, isTupleStream ? tupleBindings : resultSequence, environment)
|
|
3655
3679
|
}
|
|
@@ -3698,8 +3722,10 @@ var jsonata = (function() {
|
|
|
3698
3722
|
}
|
|
3699
3723
|
|
|
3700
3724
|
var resultSequence = createSequence();
|
|
3725
|
+
var _flattenedArray = false; // PATCH: track if we flattened a real array
|
|
3701
3726
|
if(lastStep && result.length === 1 && Array.isArray(result[0]) && !isSequence(result[0])) {
|
|
3702
3727
|
resultSequence = result[0];
|
|
3728
|
+
_flattenedArray = true;
|
|
3703
3729
|
} else {
|
|
3704
3730
|
// flatten the sequence
|
|
3705
3731
|
result.forEach(function(res) {
|
|
@@ -3709,10 +3735,20 @@ var jsonata = (function() {
|
|
|
3709
3735
|
} else {
|
|
3710
3736
|
// res is a sequence - flatten it into the parent sequence
|
|
3711
3737
|
res.forEach(val => resultSequence.push(val));
|
|
3738
|
+
// PATCH: only mark as flattened array if res is a genuine data array,
|
|
3739
|
+
// not an intermediate sequence (from filter results, etc.)
|
|
3740
|
+
if (!isSequence(res)) {
|
|
3741
|
+
_flattenedArray = true;
|
|
3742
|
+
}
|
|
3712
3743
|
}
|
|
3713
3744
|
});
|
|
3714
3745
|
}
|
|
3715
3746
|
|
|
3747
|
+
// PATCH: Mark sequences that came from flattening array fields
|
|
3748
|
+
if (_flattenedArray && Array.isArray(resultSequence)) {
|
|
3749
|
+
Object.defineProperty(resultSequence, '_fromArrayField', { value: true, enumerable: false, configurable: true });
|
|
3750
|
+
}
|
|
3751
|
+
|
|
3716
3752
|
return resultSequence;
|
|
3717
3753
|
}
|
|
3718
3754
|
|