@nucypher/taco 0.7.0-alpha.2 → 0.7.0-alpha.4
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/cjs/conditions/base/context-variable.d.ts +10 -0
- package/dist/cjs/conditions/base/context-variable.js +19 -0
- package/dist/cjs/conditions/base/context-variable.js.map +1 -0
- package/dist/cjs/conditions/base/index.d.ts +2 -1
- package/dist/cjs/conditions/base/index.js +3 -2
- package/dist/cjs/conditions/base/index.js.map +1 -1
- package/dist/cjs/conditions/base/json.d.ts +7 -0
- package/dist/cjs/conditions/base/json.js +18 -0
- package/dist/cjs/conditions/base/json.js.map +1 -0
- package/dist/cjs/conditions/condition-factory.js +6 -3
- package/dist/cjs/conditions/condition-factory.js.map +1 -1
- package/dist/cjs/conditions/condition.d.ts +1 -0
- package/dist/cjs/conditions/condition.js +4 -3
- package/dist/cjs/conditions/condition.js.map +1 -1
- package/dist/cjs/conditions/predefined/address-allowlist.d.ts +11 -0
- package/dist/cjs/conditions/predefined/address-allowlist.js +31 -0
- package/dist/cjs/conditions/predefined/address-allowlist.js.map +1 -0
- package/dist/cjs/conditions/predefined/index.d.ts +1 -0
- package/dist/cjs/conditions/predefined/index.js +2 -1
- package/dist/cjs/conditions/predefined/index.js.map +1 -1
- package/dist/cjs/conditions/schemas/address-allowlist.d.ts +1 -14
- package/dist/cjs/conditions/schemas/address-allowlist.js +6 -15
- package/dist/cjs/conditions/schemas/address-allowlist.js.map +1 -1
- package/dist/cjs/conditions/schemas/context-variable.d.ts +91 -0
- package/dist/cjs/conditions/schemas/context-variable.js +17 -0
- package/dist/cjs/conditions/schemas/context-variable.js.map +1 -0
- package/dist/cjs/conditions/schemas/contract.d.ts +66 -12
- package/dist/cjs/conditions/schemas/export-for-zod-doc-gen.d.ts +3 -0
- package/dist/cjs/conditions/schemas/export-for-zod-doc-gen.js +3 -0
- package/dist/cjs/conditions/schemas/export-for-zod-doc-gen.js.map +1 -1
- package/dist/cjs/conditions/schemas/json-api.d.ts +62 -8
- package/dist/cjs/conditions/schemas/json-rpc.d.ts +62 -8
- package/dist/cjs/conditions/schemas/json.d.ts +94 -0
- package/dist/cjs/conditions/schemas/json.js +17 -0
- package/dist/cjs/conditions/schemas/json.js.map +1 -0
- package/dist/cjs/conditions/schemas/return-value-test.d.ts +76 -0
- package/dist/cjs/conditions/schemas/return-value-test.js +4 -1
- package/dist/cjs/conditions/schemas/return-value-test.js.map +1 -1
- package/dist/cjs/conditions/schemas/rpc.d.ts +50 -4
- package/dist/cjs/conditions/schemas/sequential.js +6 -2
- package/dist/cjs/conditions/schemas/sequential.js.map +1 -1
- package/dist/cjs/conditions/schemas/time.d.ts +47 -1
- package/dist/cjs/conditions/schemas/utils.js +2 -2
- package/dist/cjs/conditions/schemas/utils.js.map +1 -1
- package/dist/cjs/conditions/schemas/variable-operation.d.ts +48 -0
- package/dist/cjs/conditions/schemas/variable-operation.js +81 -0
- package/dist/cjs/conditions/schemas/variable-operation.js.map +1 -0
- package/dist/cjs/sign.d.ts +2 -2
- package/dist/cjs/sign.js +73 -38
- package/dist/cjs/sign.js.map +1 -1
- package/dist/cjs/types.d.ts +1 -1
- package/dist/es/conditions/base/context-variable.d.ts +10 -0
- package/dist/es/conditions/base/context-variable.js +15 -0
- package/dist/es/conditions/base/context-variable.js.map +1 -0
- package/dist/es/conditions/base/index.d.ts +2 -1
- package/dist/es/conditions/base/index.js +2 -1
- package/dist/es/conditions/base/index.js.map +1 -1
- package/dist/es/conditions/base/json.d.ts +7 -0
- package/dist/es/conditions/base/json.js +12 -0
- package/dist/es/conditions/base/json.js.map +1 -0
- package/dist/es/conditions/condition-factory.js +6 -3
- package/dist/es/conditions/condition-factory.js.map +1 -1
- package/dist/es/conditions/condition.d.ts +1 -0
- package/dist/es/conditions/condition.js +1 -1
- package/dist/es/conditions/condition.js.map +1 -1
- package/dist/es/conditions/predefined/address-allowlist.d.ts +11 -0
- package/dist/es/conditions/predefined/address-allowlist.js +27 -0
- package/dist/es/conditions/predefined/address-allowlist.js.map +1 -0
- package/dist/es/conditions/predefined/index.d.ts +1 -0
- package/dist/es/conditions/predefined/index.js +1 -0
- package/dist/es/conditions/predefined/index.js.map +1 -1
- package/dist/es/conditions/schemas/address-allowlist.d.ts +1 -14
- package/dist/es/conditions/schemas/address-allowlist.js +5 -14
- package/dist/es/conditions/schemas/address-allowlist.js.map +1 -1
- package/dist/es/conditions/schemas/context-variable.d.ts +91 -0
- package/dist/es/conditions/schemas/context-variable.js +14 -0
- package/dist/es/conditions/schemas/context-variable.js.map +1 -0
- package/dist/es/conditions/schemas/contract.d.ts +66 -12
- package/dist/es/conditions/schemas/export-for-zod-doc-gen.d.ts +3 -0
- package/dist/es/conditions/schemas/export-for-zod-doc-gen.js +3 -0
- package/dist/es/conditions/schemas/export-for-zod-doc-gen.js.map +1 -1
- package/dist/es/conditions/schemas/json-api.d.ts +62 -8
- package/dist/es/conditions/schemas/json-rpc.d.ts +62 -8
- package/dist/es/conditions/schemas/json.d.ts +94 -0
- package/dist/es/conditions/schemas/json.js +14 -0
- package/dist/es/conditions/schemas/json.js.map +1 -0
- package/dist/es/conditions/schemas/return-value-test.d.ts +76 -0
- package/dist/es/conditions/schemas/return-value-test.js +4 -1
- package/dist/es/conditions/schemas/return-value-test.js.map +1 -1
- package/dist/es/conditions/schemas/rpc.d.ts +50 -4
- package/dist/es/conditions/schemas/sequential.js +6 -2
- package/dist/es/conditions/schemas/sequential.js.map +1 -1
- package/dist/es/conditions/schemas/time.d.ts +47 -1
- package/dist/es/conditions/schemas/utils.js +2 -2
- package/dist/es/conditions/schemas/utils.js.map +1 -1
- package/dist/es/conditions/schemas/variable-operation.d.ts +48 -0
- package/dist/es/conditions/schemas/variable-operation.js +78 -0
- package/dist/es/conditions/schemas/variable-operation.js.map +1 -0
- package/dist/es/sign.d.ts +2 -2
- package/dist/es/sign.js +74 -39
- package/dist/es/sign.js.map +1 -1
- package/dist/es/types.d.ts +1 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.es.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/dist/cjs/conditions/base/address-allowlist.d.ts +0 -10
- package/dist/cjs/conditions/base/address-allowlist.js +0 -19
- package/dist/cjs/conditions/base/address-allowlist.js.map +0 -1
- package/dist/cjs/conditions/zod.d.ts +0 -3
- package/dist/cjs/conditions/zod.js +0 -19
- package/dist/cjs/conditions/zod.js.map +0 -1
- package/dist/es/conditions/base/address-allowlist.d.ts +0 -10
- package/dist/es/conditions/base/address-allowlist.js +0 -15
- package/dist/es/conditions/base/address-allowlist.js.map +0 -1
- package/dist/es/conditions/zod.d.ts +0 -3
- package/dist/es/conditions/zod.js +0 -17
- package/dist/es/conditions/zod.js.map +0 -1
|
@@ -10,72 +10,126 @@ export declare const jsonApiConditionSchema: z.ZodEffects<z.ZodObject<{} & {
|
|
|
10
10
|
returnValueTest: z.ZodEffects<z.ZodObject<{
|
|
11
11
|
index: z.ZodOptional<z.ZodNumber>;
|
|
12
12
|
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
13
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
14
|
+
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str"]>;
|
|
15
|
+
value: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
18
|
+
value?: any;
|
|
19
|
+
}, {
|
|
20
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
21
|
+
value?: any;
|
|
22
|
+
}>, {
|
|
23
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
24
|
+
value?: any;
|
|
25
|
+
}, {
|
|
26
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
27
|
+
value?: any;
|
|
28
|
+
}>, {
|
|
29
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
30
|
+
value?: any;
|
|
31
|
+
}, {
|
|
32
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
33
|
+
value?: any;
|
|
34
|
+
}>, "many">>;
|
|
13
35
|
} & {
|
|
14
36
|
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
15
37
|
}, "strip", z.ZodTypeAny, {
|
|
16
38
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
17
39
|
value?: any;
|
|
18
40
|
index?: number | undefined;
|
|
41
|
+
operations?: {
|
|
42
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
43
|
+
value?: any;
|
|
44
|
+
}[] | undefined;
|
|
19
45
|
}, {
|
|
20
46
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
21
47
|
value?: any;
|
|
22
48
|
index?: number | undefined;
|
|
49
|
+
operations?: {
|
|
50
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
51
|
+
value?: any;
|
|
52
|
+
}[] | undefined;
|
|
23
53
|
}>, {
|
|
24
54
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
25
55
|
value?: any;
|
|
26
56
|
index?: number | undefined;
|
|
57
|
+
operations?: {
|
|
58
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
59
|
+
value?: any;
|
|
60
|
+
}[] | undefined;
|
|
27
61
|
}, {
|
|
28
62
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
29
63
|
value?: any;
|
|
30
64
|
index?: number | undefined;
|
|
65
|
+
operations?: {
|
|
66
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
67
|
+
value?: any;
|
|
68
|
+
}[] | undefined;
|
|
31
69
|
}>;
|
|
32
70
|
}, "strip", z.ZodTypeAny, {
|
|
33
71
|
conditionType: "json-api";
|
|
34
|
-
endpoint: string;
|
|
35
72
|
returnValueTest: {
|
|
36
73
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
37
74
|
value?: any;
|
|
38
75
|
index?: number | undefined;
|
|
76
|
+
operations?: {
|
|
77
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
78
|
+
value?: any;
|
|
79
|
+
}[] | undefined;
|
|
39
80
|
};
|
|
81
|
+
endpoint: string;
|
|
82
|
+
parameters?: Record<string, unknown> | undefined;
|
|
40
83
|
query?: string | undefined;
|
|
41
84
|
authorizationToken?: string | undefined;
|
|
42
85
|
authorizationType?: "Bearer" | "Basic" | "X-API-Key" | undefined;
|
|
43
|
-
parameters?: Record<string, unknown> | undefined;
|
|
44
86
|
}, {
|
|
45
|
-
endpoint: string;
|
|
46
87
|
returnValueTest: {
|
|
47
88
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
48
89
|
value?: any;
|
|
49
90
|
index?: number | undefined;
|
|
91
|
+
operations?: {
|
|
92
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
93
|
+
value?: any;
|
|
94
|
+
}[] | undefined;
|
|
50
95
|
};
|
|
96
|
+
endpoint: string;
|
|
51
97
|
conditionType?: "json-api" | undefined;
|
|
98
|
+
parameters?: Record<string, unknown> | undefined;
|
|
52
99
|
query?: string | undefined;
|
|
53
100
|
authorizationToken?: string | undefined;
|
|
54
101
|
authorizationType?: "Bearer" | "Basic" | "X-API-Key" | undefined;
|
|
55
|
-
parameters?: Record<string, unknown> | undefined;
|
|
56
102
|
}>, {
|
|
57
103
|
conditionType: "json-api";
|
|
58
|
-
endpoint: string;
|
|
59
104
|
returnValueTest: {
|
|
60
105
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
61
106
|
value?: any;
|
|
62
107
|
index?: number | undefined;
|
|
108
|
+
operations?: {
|
|
109
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
110
|
+
value?: any;
|
|
111
|
+
}[] | undefined;
|
|
63
112
|
};
|
|
113
|
+
endpoint: string;
|
|
114
|
+
parameters?: Record<string, unknown> | undefined;
|
|
64
115
|
query?: string | undefined;
|
|
65
116
|
authorizationToken?: string | undefined;
|
|
66
117
|
authorizationType?: "Bearer" | "Basic" | "X-API-Key" | undefined;
|
|
67
|
-
parameters?: Record<string, unknown> | undefined;
|
|
68
118
|
}, {
|
|
69
|
-
endpoint: string;
|
|
70
119
|
returnValueTest: {
|
|
71
120
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
72
121
|
value?: any;
|
|
73
122
|
index?: number | undefined;
|
|
123
|
+
operations?: {
|
|
124
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
125
|
+
value?: any;
|
|
126
|
+
}[] | undefined;
|
|
74
127
|
};
|
|
128
|
+
endpoint: string;
|
|
75
129
|
conditionType?: "json-api" | undefined;
|
|
130
|
+
parameters?: Record<string, unknown> | undefined;
|
|
76
131
|
query?: string | undefined;
|
|
77
132
|
authorizationToken?: string | undefined;
|
|
78
133
|
authorizationType?: "Bearer" | "Basic" | "X-API-Key" | undefined;
|
|
79
|
-
parameters?: Record<string, unknown> | undefined;
|
|
80
134
|
}>;
|
|
81
135
|
export type JsonApiConditionProps = z.infer<typeof jsonApiConditionSchema>;
|
|
@@ -11,46 +11,92 @@ export declare const jsonRpcConditionSchema: z.ZodEffects<z.ZodObject<{} & {
|
|
|
11
11
|
returnValueTest: z.ZodEffects<z.ZodObject<{
|
|
12
12
|
index: z.ZodOptional<z.ZodNumber>;
|
|
13
13
|
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
14
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
15
|
+
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str"]>;
|
|
16
|
+
value: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
19
|
+
value?: any;
|
|
20
|
+
}, {
|
|
21
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
22
|
+
value?: any;
|
|
23
|
+
}>, {
|
|
24
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
25
|
+
value?: any;
|
|
26
|
+
}, {
|
|
27
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
28
|
+
value?: any;
|
|
29
|
+
}>, {
|
|
30
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
31
|
+
value?: any;
|
|
32
|
+
}, {
|
|
33
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
34
|
+
value?: any;
|
|
35
|
+
}>, "many">>;
|
|
14
36
|
} & {
|
|
15
37
|
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
16
38
|
}, "strip", z.ZodTypeAny, {
|
|
17
39
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
18
40
|
value?: any;
|
|
19
41
|
index?: number | undefined;
|
|
42
|
+
operations?: {
|
|
43
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
44
|
+
value?: any;
|
|
45
|
+
}[] | undefined;
|
|
20
46
|
}, {
|
|
21
47
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
22
48
|
value?: any;
|
|
23
49
|
index?: number | undefined;
|
|
50
|
+
operations?: {
|
|
51
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
52
|
+
value?: any;
|
|
53
|
+
}[] | undefined;
|
|
24
54
|
}>, {
|
|
25
55
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
26
56
|
value?: any;
|
|
27
57
|
index?: number | undefined;
|
|
58
|
+
operations?: {
|
|
59
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
60
|
+
value?: any;
|
|
61
|
+
}[] | undefined;
|
|
28
62
|
}, {
|
|
29
63
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
30
64
|
value?: any;
|
|
31
65
|
index?: number | undefined;
|
|
66
|
+
operations?: {
|
|
67
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
68
|
+
value?: any;
|
|
69
|
+
}[] | undefined;
|
|
32
70
|
}>;
|
|
33
71
|
}, "strip", z.ZodTypeAny, {
|
|
34
72
|
conditionType: "json-rpc";
|
|
35
|
-
endpoint: string;
|
|
36
|
-
method: string;
|
|
37
73
|
returnValueTest: {
|
|
38
74
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
39
75
|
value?: any;
|
|
40
76
|
index?: number | undefined;
|
|
77
|
+
operations?: {
|
|
78
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
79
|
+
value?: any;
|
|
80
|
+
}[] | undefined;
|
|
41
81
|
};
|
|
82
|
+
method: string;
|
|
83
|
+
endpoint: string;
|
|
42
84
|
params?: unknown[] | Record<string, unknown> | undefined;
|
|
43
85
|
query?: string | undefined;
|
|
44
86
|
authorizationToken?: string | undefined;
|
|
45
87
|
authorizationType?: "Bearer" | "Basic" | "X-API-Key" | undefined;
|
|
46
88
|
}, {
|
|
47
|
-
endpoint: string;
|
|
48
|
-
method: string;
|
|
49
89
|
returnValueTest: {
|
|
50
90
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
51
91
|
value?: any;
|
|
52
92
|
index?: number | undefined;
|
|
93
|
+
operations?: {
|
|
94
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
95
|
+
value?: any;
|
|
96
|
+
}[] | undefined;
|
|
53
97
|
};
|
|
98
|
+
method: string;
|
|
99
|
+
endpoint: string;
|
|
54
100
|
params?: unknown[] | Record<string, unknown> | undefined;
|
|
55
101
|
conditionType?: "json-rpc" | undefined;
|
|
56
102
|
query?: string | undefined;
|
|
@@ -58,25 +104,33 @@ export declare const jsonRpcConditionSchema: z.ZodEffects<z.ZodObject<{} & {
|
|
|
58
104
|
authorizationType?: "Bearer" | "Basic" | "X-API-Key" | undefined;
|
|
59
105
|
}>, {
|
|
60
106
|
conditionType: "json-rpc";
|
|
61
|
-
endpoint: string;
|
|
62
|
-
method: string;
|
|
63
107
|
returnValueTest: {
|
|
64
108
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
65
109
|
value?: any;
|
|
66
110
|
index?: number | undefined;
|
|
111
|
+
operations?: {
|
|
112
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
113
|
+
value?: any;
|
|
114
|
+
}[] | undefined;
|
|
67
115
|
};
|
|
116
|
+
method: string;
|
|
117
|
+
endpoint: string;
|
|
68
118
|
params?: unknown[] | Record<string, unknown> | undefined;
|
|
69
119
|
query?: string | undefined;
|
|
70
120
|
authorizationToken?: string | undefined;
|
|
71
121
|
authorizationType?: "Bearer" | "Basic" | "X-API-Key" | undefined;
|
|
72
122
|
}, {
|
|
73
|
-
endpoint: string;
|
|
74
|
-
method: string;
|
|
75
123
|
returnValueTest: {
|
|
76
124
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
77
125
|
value?: any;
|
|
78
126
|
index?: number | undefined;
|
|
127
|
+
operations?: {
|
|
128
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
129
|
+
value?: any;
|
|
130
|
+
}[] | undefined;
|
|
79
131
|
};
|
|
132
|
+
method: string;
|
|
133
|
+
endpoint: string;
|
|
80
134
|
params?: unknown[] | Record<string, unknown> | undefined;
|
|
81
135
|
conditionType?: "json-rpc" | undefined;
|
|
82
136
|
query?: string | undefined;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const JsonConditionType = "json";
|
|
3
|
+
export declare const jsonConditionSchema: z.ZodObject<{} & {
|
|
4
|
+
conditionType: z.ZodDefault<z.ZodLiteral<"json">>;
|
|
5
|
+
data: z.ZodString;
|
|
6
|
+
query: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
7
|
+
returnValueTest: z.ZodEffects<z.ZodObject<{
|
|
8
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
10
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
11
|
+
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str"]>;
|
|
12
|
+
value: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
15
|
+
value?: any;
|
|
16
|
+
}, {
|
|
17
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
18
|
+
value?: any;
|
|
19
|
+
}>, {
|
|
20
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
21
|
+
value?: any;
|
|
22
|
+
}, {
|
|
23
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
24
|
+
value?: any;
|
|
25
|
+
}>, {
|
|
26
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
27
|
+
value?: any;
|
|
28
|
+
}, {
|
|
29
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
30
|
+
value?: any;
|
|
31
|
+
}>, "many">>;
|
|
32
|
+
} & {
|
|
33
|
+
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
36
|
+
value?: any;
|
|
37
|
+
index?: number | undefined;
|
|
38
|
+
operations?: {
|
|
39
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
40
|
+
value?: any;
|
|
41
|
+
}[] | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
44
|
+
value?: any;
|
|
45
|
+
index?: number | undefined;
|
|
46
|
+
operations?: {
|
|
47
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
48
|
+
value?: any;
|
|
49
|
+
}[] | undefined;
|
|
50
|
+
}>, {
|
|
51
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
52
|
+
value?: any;
|
|
53
|
+
index?: number | undefined;
|
|
54
|
+
operations?: {
|
|
55
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
56
|
+
value?: any;
|
|
57
|
+
}[] | undefined;
|
|
58
|
+
}, {
|
|
59
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
60
|
+
value?: any;
|
|
61
|
+
index?: number | undefined;
|
|
62
|
+
operations?: {
|
|
63
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
64
|
+
value?: any;
|
|
65
|
+
}[] | undefined;
|
|
66
|
+
}>;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
conditionType: "json";
|
|
69
|
+
data: string;
|
|
70
|
+
returnValueTest: {
|
|
71
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
72
|
+
value?: any;
|
|
73
|
+
index?: number | undefined;
|
|
74
|
+
operations?: {
|
|
75
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
76
|
+
value?: any;
|
|
77
|
+
}[] | undefined;
|
|
78
|
+
};
|
|
79
|
+
query?: string | undefined;
|
|
80
|
+
}, {
|
|
81
|
+
data: string;
|
|
82
|
+
returnValueTest: {
|
|
83
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
84
|
+
value?: any;
|
|
85
|
+
index?: number | undefined;
|
|
86
|
+
operations?: {
|
|
87
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
88
|
+
value?: any;
|
|
89
|
+
}[] | undefined;
|
|
90
|
+
};
|
|
91
|
+
conditionType?: "json" | undefined;
|
|
92
|
+
query?: string | undefined;
|
|
93
|
+
}>;
|
|
94
|
+
export type JsonConditionProps = z.infer<typeof jsonConditionSchema>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { baseConditionSchema, jsonPathSchema } from './common';
|
|
3
|
+
import { contextParamSchema } from './context';
|
|
4
|
+
import { returnValueTestSchema } from './return-value-test';
|
|
5
|
+
export const JsonConditionType = 'json';
|
|
6
|
+
export const jsonConditionSchema = baseConditionSchema.extend({
|
|
7
|
+
conditionType: z.literal(JsonConditionType).default(JsonConditionType),
|
|
8
|
+
data: contextParamSchema.describe('Context variable that resolves to JSON data at decryption time.'),
|
|
9
|
+
query: jsonPathSchema
|
|
10
|
+
.optional()
|
|
11
|
+
.describe('Optional JSONPath query to extract a specific value from the data.'),
|
|
12
|
+
returnValueTest: returnValueTestSchema,
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAExC,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,MAAM,CAAC;IAC5D,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC;IACtE,IAAI,EAAE,kBAAkB,CAAC,QAAQ,CAC/B,iEAAiE,CAClE;IACD,KAAK,EAAE,cAAc;SAClB,QAAQ,EAAE;SACV,QAAQ,CACP,oEAAoE,CACrE;IACH,eAAe,EAAE,qBAAqB;CACvC,CAAC,CAAC"}
|
|
@@ -2,46 +2,122 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const returnValueTestSchema: z.ZodEffects<z.ZodObject<{
|
|
3
3
|
index: z.ZodOptional<z.ZodNumber>;
|
|
4
4
|
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
5
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
6
|
+
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str"]>;
|
|
7
|
+
value: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
10
|
+
value?: any;
|
|
11
|
+
}, {
|
|
12
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
13
|
+
value?: any;
|
|
14
|
+
}>, {
|
|
15
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
16
|
+
value?: any;
|
|
17
|
+
}, {
|
|
18
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
19
|
+
value?: any;
|
|
20
|
+
}>, {
|
|
21
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
22
|
+
value?: any;
|
|
23
|
+
}, {
|
|
24
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
25
|
+
value?: any;
|
|
26
|
+
}>, "many">>;
|
|
5
27
|
} & {
|
|
6
28
|
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
7
29
|
}, "strip", z.ZodTypeAny, {
|
|
8
30
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
9
31
|
value?: any;
|
|
10
32
|
index?: number | undefined;
|
|
33
|
+
operations?: {
|
|
34
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
35
|
+
value?: any;
|
|
36
|
+
}[] | undefined;
|
|
11
37
|
}, {
|
|
12
38
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
13
39
|
value?: any;
|
|
14
40
|
index?: number | undefined;
|
|
41
|
+
operations?: {
|
|
42
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
43
|
+
value?: any;
|
|
44
|
+
}[] | undefined;
|
|
15
45
|
}>, {
|
|
16
46
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
17
47
|
value?: any;
|
|
18
48
|
index?: number | undefined;
|
|
49
|
+
operations?: {
|
|
50
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
51
|
+
value?: any;
|
|
52
|
+
}[] | undefined;
|
|
19
53
|
}, {
|
|
20
54
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
21
55
|
value?: any;
|
|
22
56
|
index?: number | undefined;
|
|
57
|
+
operations?: {
|
|
58
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
59
|
+
value?: any;
|
|
60
|
+
}[] | undefined;
|
|
23
61
|
}>;
|
|
24
62
|
export declare const blockchainReturnValueTestSchema: z.ZodEffects<z.ZodObject<{
|
|
25
63
|
index: z.ZodOptional<z.ZodNumber>;
|
|
26
64
|
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
65
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
66
|
+
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str"]>;
|
|
67
|
+
value: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
68
|
+
}, "strip", z.ZodTypeAny, {
|
|
69
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
70
|
+
value?: any;
|
|
71
|
+
}, {
|
|
72
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
73
|
+
value?: any;
|
|
74
|
+
}>, {
|
|
75
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
76
|
+
value?: any;
|
|
77
|
+
}, {
|
|
78
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
79
|
+
value?: any;
|
|
80
|
+
}>, {
|
|
81
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
82
|
+
value?: any;
|
|
83
|
+
}, {
|
|
84
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
85
|
+
value?: any;
|
|
86
|
+
}>, "many">>;
|
|
27
87
|
} & {
|
|
28
88
|
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
29
89
|
}, "strip", z.ZodTypeAny, {
|
|
30
90
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
31
91
|
value?: any;
|
|
32
92
|
index?: number | undefined;
|
|
93
|
+
operations?: {
|
|
94
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
95
|
+
value?: any;
|
|
96
|
+
}[] | undefined;
|
|
33
97
|
}, {
|
|
34
98
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
35
99
|
value?: any;
|
|
36
100
|
index?: number | undefined;
|
|
101
|
+
operations?: {
|
|
102
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
103
|
+
value?: any;
|
|
104
|
+
}[] | undefined;
|
|
37
105
|
}>, {
|
|
38
106
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
39
107
|
value?: any;
|
|
40
108
|
index?: number | undefined;
|
|
109
|
+
operations?: {
|
|
110
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
111
|
+
value?: any;
|
|
112
|
+
}[] | undefined;
|
|
41
113
|
}, {
|
|
42
114
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
43
115
|
value?: any;
|
|
44
116
|
index?: number | undefined;
|
|
117
|
+
operations?: {
|
|
118
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
119
|
+
value?: any;
|
|
120
|
+
}[] | undefined;
|
|
45
121
|
}>;
|
|
46
122
|
export type ReturnValueTestProps = z.infer<typeof returnValueTestSchema>;
|
|
47
123
|
export type BlockchainReturnValueTestProps = z.infer<typeof blockchainReturnValueTestSchema>;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { blockchainParamOrContextParamSchema, paramOrContextParamSchema, } from './context';
|
|
3
|
+
import { variableOperationsArraySchema } from './variable-operation';
|
|
3
4
|
const returnValueTestBaseSchema = z.object({
|
|
4
5
|
index: z.number().int().nonnegative().optional(),
|
|
5
6
|
comparator: z.enum(['==', '>', '<', '>=', '<=', '!=', 'in', '!in']),
|
|
7
|
+
operations: variableOperationsArraySchema.describe('Optional operations to perform on the obtained result before comparison'),
|
|
6
8
|
});
|
|
7
9
|
const requireNonEmptyArrayIfComparatorIsIn = (data) => {
|
|
8
10
|
if (data.comparator === 'in' || data.comparator === '!in') {
|
|
@@ -18,7 +20,8 @@ export const returnValueTestSchema = returnValueTestBaseSchema
|
|
|
18
20
|
.extend({
|
|
19
21
|
value: paramOrContextParamSchema,
|
|
20
22
|
})
|
|
21
|
-
.refine(requireNonEmptyArrayIfComparatorIsIn, inComparatorErrorConfig)
|
|
23
|
+
.refine(requireNonEmptyArrayIfComparatorIsIn, inComparatorErrorConfig)
|
|
24
|
+
.describe('Test to perform on a value. Supports comparison operators like ==, >, <, >=, <=, !=, in, !in');
|
|
22
25
|
export const blockchainReturnValueTestSchema = returnValueTestBaseSchema
|
|
23
26
|
.extend({
|
|
24
27
|
value: blockchainParamOrContextParamSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"return-value-test.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/return-value-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,mCAAmC,EACnC,yBAAyB,GAC1B,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"return-value-test.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/return-value-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,mCAAmC,EACnC,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAErE,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IAChD,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACnE,UAAU,EAAE,6BAA6B,CAAC,QAAQ,CAChD,yEAAyE,CAC1E;CACF,CAAC,CAAC;AAEH,MAAM,oCAAoC,GAAG,CAAC,IAI7C,EAAW,EAAE;IACZ,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,IAAI,IAAI,CAAC,UAAU,KAAK,KAAK,EAAE,CAAC;QAC1D,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,uBAAuB,GAAG;IAC9B,OAAO,EAAE,iEAAiE;IAC1E,IAAI,EAAE,CAAC,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,yBAAyB;KAC3D,MAAM,CAAC;IACN,KAAK,EAAE,yBAAyB;CACjC,CAAC;KACD,MAAM,CAAC,oCAAoC,EAAE,uBAAuB,CAAC;KACrE,QAAQ,CACP,8FAA8F,CAC/F,CAAC;AAEJ,MAAM,CAAC,MAAM,+BAA+B,GAAG,yBAAyB;KACrE,MAAM,CAAC;IACN,KAAK,EAAE,mCAAmC;CAC3C,CAAC;KACD,MAAM,CAAC,oCAAoC,EAAE,uBAAuB,CAAC,CAAC"}
|