-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathrun.liquid
More file actions
45 lines (38 loc) · 915 Bytes
/
run.liquid
File metadata and controls
45 lines (38 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{%- if flavor contains "vanilla-js" -%}
// @ts-check
/**
* @typedef {import("../generated/api").RunInput} RunInput
* @typedef {import("../generated/api").FunctionRunResult} FunctionRunResult
*/
/**
* @type {FunctionRunResult}
*/
const NO_CHANGES = {
operations: [],
};
/**
* @param {RunInput} input
* @returns {FunctionRunResult}
*/
export function run(input) {
const configuration = JSON.parse(
input?.paymentCustomization?.metafield?.value ?? "{}"
);
return NO_CHANGES;
};
{%- elsif flavor contains "typescript" -%}
import type {
RunInput,
FunctionRunResult,
} from "../generated/api";
const NO_CHANGES: FunctionRunResult = {
operations: [],
};
type Configuration = {};
export function run(input: RunInput): FunctionRunResult {
const configuration: Configuration = JSON.parse(
input?.paymentCustomization?.metafield?.value ?? "{}"
);
return NO_CHANGES;
};
{%- endif -%}