Commit 97b3d9e
committed
[One Workflow] Update liquidjs to version 10.26.0 and add sha256 and hmac_sha256 filters (#269989)
## Summary
Adopts Shopify-compatible `sha256` and `hmac_sha256` Liquid filters for
Workflows by upgrading [liquidjs to
10.26.0](https://github.com/harttle/liquidjs/releases/tag/v10.26.0)
([harttle/liquidjs#889](harttle/liquidjs#889)).
Filter behavior comes from liquidjs core—no custom server-side
implementations.
- **Execution (server):** Built-in filters work via
`createWorkflowLiquidEngine()` with existing `renderSync` /
`evalValueSync` (Node `crypto`).
- **Editor autocomplete:** Added `sha256` and `hmac_sha256` entries with
Shopify reference examples.
- **Hover preview (browser):** Switched `evaluateExpression` to async
`evalValue` so crypto filters resolve correctly in the browser bundle
(Web Crypto is async-only). Hover only shows evaluated filter output
when viewing an execution on the **Executions** tab and hovering on the
filter segment inside `{{ }}`.
## Changes
| Area | Change |
|------|--------|
| `package.json` / `yarn.lock` | `liquidjs` `10.25.7` → `10.26.0` |
| `liquid_completions.ts` | Autocomplete for `sha256`, `hmac_sha256` |
| `templating_engine.test.ts` | Server tests (Shopify reference vectors)
|
| `liquid_parse_cache.test.ts` | Parse/validation tests for built-in
crypto filters |
| `evaluate_expression.ts` | `evalValueSync` → `await evalValue` for
browser crypto |
| `unified_hover_provider.ts` | `await evaluateExpression(...)` |
| `evaluate_expression.test.ts` | Async tests + crypto filter coverage |
**Not changed:** `templating_engine.ts`, `liquid_parse_cache.ts` — no
`registerFilter` stubs needed for built-in filters.
## Examples:
```yaml
name: Crypto filters
enabled: true
triggers:
- type: manual
inputs:
- name: message
type: string
default: "hello world"
consts:
secret: "secret"
steps:
- name: hmac_sha256
type: console
with:
message: "{{ inputs.message | hmac_sha256: consts.secret }}"
- name: sha256
type: console
with:
message: "{{ inputs.message | sha256 }}"
```
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 79909d5)
# Conflicts:
# package.json
# src/platform/plugins/shared/workflows_execution_engine/server/templating_engine.test.ts
# yarn.lock1 parent 5527b15 commit 97b3d9e
9 files changed
Lines changed: 157 additions & 70 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1415 | 1415 | | |
1416 | 1416 | | |
1417 | 1417 | | |
1418 | | - | |
| 1418 | + | |
1419 | 1419 | | |
1420 | 1420 | | |
1421 | 1421 | | |
| |||
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
158 | 193 | | |
159 | 194 | | |
160 | 195 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
35 | 48 | | |
36 | 49 | | |
37 | 50 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
196 | 203 | | |
197 | 204 | | |
198 | 205 | | |
| |||
347 | 354 | | |
348 | 355 | | |
349 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
350 | 364 | | |
351 | 365 | | |
352 | 366 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
558 | | - | |
| 558 | + | |
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
564 | | - | |
| 564 | + | |
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| |||
0 commit comments