mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
* feat(stepfunctions): apply ResultSelector, add States.ArrayContains and wildcard path projection Three JSONPath/intrinsic features that AslExecutor was missing: - ResultSelector is now applied to a Task's result (before ResultPath), the same template resolution used for Parameters. Previously it was accepted but silently ignored, so the raw result flowed through unchanged. - $.X.*.Y wildcard projection in path resolution: a * segment projects the remainder of the path over each array element and collects the results (e.g. $.Regions.*.RegionName). - States.ArrayContains(array, value) intrinsic. These are used together by orchestration that lists results and validates an input against them. Unit-tested for projection, ArrayContains, and ResultSelector evaluation; existing Step Functions suites unchanged. * fix(stepfunctions): apply Parameters in Pass states A Pass state's Parameters (with intrinsics) were accepted but never applied — the effective input flowed through unchanged. Apply Parameters to produce the Pass result (a static Result still overrides), so transforms like States.ArrayContains in a Pass state take effect. Integration-tested. * fix(stepfunctions): IsPresent reports an absent path as not present resolvePath collapses an absent path to a null node, so the Choice IsPresent comparator (which only checked isMissingNode) reported absent fields as present. Treat null and missing alike. Integration-tested for absent vs present fields. * feat(stepfunctions): bracket [*] wildcard, ResultSelector on Map/Parallel, present-null Address review feedback on #1558: - Support the AWS bracket wildcard form ($.Regions[*].RegionName) and root-level brackets ($[*][*]) by normalizing bracket notation into path segments; multi-level wildcards now flatten, so $[*][*] flattens an array of arrays. The dot form ($.Regions.*.RegionName) keeps working. - Apply ResultSelector to Map and Parallel states (not just Task), before ResultPath merges the result in. - IsPresent now treats an explicit null value as present: resolvePathNode preserves the missing-vs-null distinction that resolvePath collapses. * fix(stepfunctions): keep nulls in projections, validate ArrayContains arg Address greptile review on #1558: - Wildcard projection now keeps explicit null values and omits only missing matches, so $[*].field over [{"field":null},{"field":"x"}] yields [null,"x"] (consistent with treating null as a present value). - States.ArrayContains throws States.Runtime when its first argument is not an array, matching AWS and States.ArrayLength, instead of silently returning false. - Documented the dotted-field-key limitation of path segment splitting. * test(stepfunctions): update AslExecutor ctor for new main params Current main added CloudFormationQueryHandler, Ec2Service and S3Service to the AslExecutor constructor; pass mocks for them in AslExecutorPathIntrinsicsTest so it compiles against main. * fix(stepfunctions): resolve the $.[0] dot-bracket root array-index form splitPathSegments turned "$.[0]" into "..0" (the [0]->.0 rewrite stacked on the existing leading dot), leaving a spurious empty segment after the split, so the path resolved to null. "$[0]" already worked. Collapse consecutive dots so both the dot-bracket ($.[0]) and no-dot ($[0]) root array-index forms resolve. EventBridge Pipes batch unwrapping (InputPath "$.[0]") relies on this. Covered by AslExecutorPathIntrinsicsTest root-array-index cases.