@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
|
@@ -7,9 +7,11 @@ export * from './utils';
|
|
|
7
7
|
export * from './common';
|
|
8
8
|
export * from './context';
|
|
9
9
|
export * from './compound';
|
|
10
|
+
export * from './context-variable';
|
|
10
11
|
export * from './contract';
|
|
11
12
|
export * from './ecdsa';
|
|
12
13
|
export * from './if-then-else';
|
|
14
|
+
export * from './json';
|
|
13
15
|
export * from './json-api';
|
|
14
16
|
export * from './json-rpc';
|
|
15
17
|
export * from './jwt';
|
|
@@ -18,4 +20,5 @@ export * from './rpc';
|
|
|
18
20
|
export * from './sequential';
|
|
19
21
|
export * from './signing';
|
|
20
22
|
export * from './time';
|
|
23
|
+
export * from './variable-operation';
|
|
21
24
|
export * from './address-allowlist';
|
|
@@ -25,9 +25,11 @@ __exportStar(require("./common"), exports);
|
|
|
25
25
|
__exportStar(require("./context"), exports);
|
|
26
26
|
// ts-unused-exports:disable-next-line - this comment line is added to prevent lint from changing or objecting the export order.
|
|
27
27
|
__exportStar(require("./compound"), exports);
|
|
28
|
+
__exportStar(require("./context-variable"), exports);
|
|
28
29
|
__exportStar(require("./contract"), exports);
|
|
29
30
|
__exportStar(require("./ecdsa"), exports);
|
|
30
31
|
__exportStar(require("./if-then-else"), exports);
|
|
32
|
+
__exportStar(require("./json"), exports);
|
|
31
33
|
__exportStar(require("./json-api"), exports);
|
|
32
34
|
__exportStar(require("./json-rpc"), exports);
|
|
33
35
|
__exportStar(require("./jwt"), exports);
|
|
@@ -36,6 +38,7 @@ __exportStar(require("./rpc"), exports);
|
|
|
36
38
|
__exportStar(require("./sequential"), exports);
|
|
37
39
|
__exportStar(require("./signing"), exports);
|
|
38
40
|
__exportStar(require("./time"), exports);
|
|
41
|
+
__exportStar(require("./variable-operation"), exports);
|
|
39
42
|
// ts-unused-exports:disable-next-line - this comment line is added to prevent lint from changing or objecting the export order.
|
|
40
43
|
__exportStar(require("./address-allowlist"), exports);
|
|
41
44
|
//# sourceMappingURL=export-for-zod-doc-gen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-for-zod-doc-gen.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/export-for-zod-doc-gen.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,gIAAgI;AAChI,2CAAyB;AACzB,4CAA0B;AAC1B,gIAAgI;AAChI,6CAA2B;AAC3B,6CAA2B;AAC3B,0CAAwB;AACxB,iDAA+B;AAC/B,6CAA2B;AAC3B,6CAA2B;AAC3B,wCAAsB;AACtB,sDAAoC;AACpC,wCAAsB;AACtB,+CAA6B;AAC7B,4CAA0B;AAC1B,yCAAuB;AACvB,gIAAgI;AAChI,sDAAoC"}
|
|
1
|
+
{"version":3,"file":"export-for-zod-doc-gen.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/export-for-zod-doc-gen.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,gIAAgI;AAChI,2CAAyB;AACzB,4CAA0B;AAC1B,gIAAgI;AAChI,6CAA2B;AAC3B,qDAAmC;AACnC,6CAA2B;AAC3B,0CAAwB;AACxB,iDAA+B;AAC/B,yCAAuB;AACvB,6CAA2B;AAC3B,6CAA2B;AAC3B,wCAAsB;AACtB,sDAAoC;AACpC,wCAAsB;AACtB,+CAA6B;AAC7B,4CAA0B;AAC1B,yCAAuB;AACvB,uDAAqC;AACrC,gIAAgI;AAChI,sDAAoC"}
|
|
@@ -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,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.jsonConditionSchema = exports.JsonConditionType = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const common_1 = require("./common");
|
|
6
|
+
const context_1 = require("./context");
|
|
7
|
+
const return_value_test_1 = require("./return-value-test");
|
|
8
|
+
exports.JsonConditionType = 'json';
|
|
9
|
+
exports.jsonConditionSchema = common_1.baseConditionSchema.extend({
|
|
10
|
+
conditionType: zod_1.z.literal(exports.JsonConditionType).default(exports.JsonConditionType),
|
|
11
|
+
data: context_1.contextParamSchema.describe('Context variable that resolves to JSON data at decryption time.'),
|
|
12
|
+
query: common_1.jsonPathSchema
|
|
13
|
+
.optional()
|
|
14
|
+
.describe('Optional JSONPath query to extract a specific value from the data.'),
|
|
15
|
+
returnValueTest: return_value_test_1.returnValueTestSchema,
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/json.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,qCAA+D;AAC/D,uCAA+C;AAC/C,2DAA4D;AAE/C,QAAA,iBAAiB,GAAG,MAAM,CAAC;AAE3B,QAAA,mBAAmB,GAAG,4BAAmB,CAAC,MAAM,CAAC;IAC5D,aAAa,EAAE,OAAC,CAAC,OAAO,CAAC,yBAAiB,CAAC,CAAC,OAAO,CAAC,yBAAiB,CAAC;IACtE,IAAI,EAAE,4BAAkB,CAAC,QAAQ,CAC/B,iEAAiE,CAClE;IACD,KAAK,EAAE,uBAAc;SAClB,QAAQ,EAAE;SACV,QAAQ,CACP,oEAAoE,CACrE;IACH,eAAe,EAAE,yCAAqB;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>;
|
|
@@ -3,9 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.blockchainReturnValueTestSchema = exports.returnValueTestSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const context_1 = require("./context");
|
|
6
|
+
const variable_operation_1 = require("./variable-operation");
|
|
6
7
|
const returnValueTestBaseSchema = zod_1.z.object({
|
|
7
8
|
index: zod_1.z.number().int().nonnegative().optional(),
|
|
8
9
|
comparator: zod_1.z.enum(['==', '>', '<', '>=', '<=', '!=', 'in', '!in']),
|
|
10
|
+
operations: variable_operation_1.variableOperationsArraySchema.describe('Optional operations to perform on the obtained result before comparison'),
|
|
9
11
|
});
|
|
10
12
|
const requireNonEmptyArrayIfComparatorIsIn = (data) => {
|
|
11
13
|
if (data.comparator === 'in' || data.comparator === '!in') {
|
|
@@ -21,7 +23,8 @@ exports.returnValueTestSchema = returnValueTestBaseSchema
|
|
|
21
23
|
.extend({
|
|
22
24
|
value: context_1.paramOrContextParamSchema,
|
|
23
25
|
})
|
|
24
|
-
.refine(requireNonEmptyArrayIfComparatorIsIn, inComparatorErrorConfig)
|
|
26
|
+
.refine(requireNonEmptyArrayIfComparatorIsIn, inComparatorErrorConfig)
|
|
27
|
+
.describe('Test to perform on a value. Supports comparison operators like ==, >, <, >=, <=, !=, in, !in');
|
|
25
28
|
exports.blockchainReturnValueTestSchema = returnValueTestBaseSchema
|
|
26
29
|
.extend({
|
|
27
30
|
value: context_1.blockchainParamOrContextParamSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"return-value-test.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/return-value-test.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,uCAGmB;
|
|
1
|
+
{"version":3,"file":"return-value-test.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/return-value-test.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,uCAGmB;AACnB,6DAAqE;AAErE,MAAM,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IAChD,UAAU,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACnE,UAAU,EAAE,kDAA6B,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;AAEW,QAAA,qBAAqB,GAAG,yBAAyB;KAC3D,MAAM,CAAC;IACN,KAAK,EAAE,mCAAyB;CACjC,CAAC;KACD,MAAM,CAAC,oCAAoC,EAAE,uBAAuB,CAAC;KACrE,QAAQ,CACP,8FAA8F,CAC/F,CAAC;AAES,QAAA,+BAA+B,GAAG,yBAAyB;KACrE,MAAM,CAAC;IACN,KAAK,EAAE,6CAAmC;CAC3C,CAAC;KACD,MAAM,CAAC,oCAAoC,EAAE,uBAAuB,CAAC,CAAC"}
|