@nucypher/taco 0.6.0-alpha.3 → 0.7.0-alpha.0
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/address-allowlist.d.ts +10 -0
- package/dist/cjs/conditions/base/address-allowlist.js +19 -0
- package/dist/cjs/conditions/base/address-allowlist.js.map +1 -0
- package/dist/cjs/conditions/base/index.d.ts +2 -0
- package/dist/cjs/conditions/base/index.js +3 -1
- package/dist/cjs/conditions/base/index.js.map +1 -1
- package/dist/cjs/conditions/base/signing.d.ts +10 -0
- package/dist/cjs/conditions/base/signing.js +32 -0
- package/dist/cjs/conditions/base/signing.js.map +1 -0
- package/dist/cjs/conditions/condition-factory.js +8 -0
- package/dist/cjs/conditions/condition-factory.js.map +1 -1
- package/dist/cjs/conditions/context/context.d.ts +4 -0
- package/dist/cjs/conditions/context/context.js +28 -3
- package/dist/cjs/conditions/context/context.js.map +1 -1
- package/dist/cjs/conditions/schemas/address-allowlist.d.ts +16 -0
- package/dist/cjs/conditions/schemas/address-allowlist.js +20 -0
- package/dist/cjs/conditions/schemas/address-allowlist.js.map +1 -0
- package/dist/cjs/conditions/schemas/common.d.ts +1 -0
- package/dist/cjs/conditions/schemas/common.js +16 -3
- package/dist/cjs/conditions/schemas/common.js.map +1 -1
- package/dist/cjs/conditions/schemas/contract.d.ts +21 -18
- package/dist/cjs/conditions/schemas/export-for-zod-doc-gen.d.ts +2 -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 +47 -14
- package/dist/cjs/conditions/schemas/json-api.js +16 -2
- package/dist/cjs/conditions/schemas/json-api.js.map +1 -1
- package/dist/cjs/conditions/schemas/json-rpc.d.ts +48 -13
- package/dist/cjs/conditions/schemas/json-rpc.js +16 -2
- package/dist/cjs/conditions/schemas/json-rpc.js.map +1 -1
- package/dist/cjs/conditions/schemas/jwt.d.ts +2 -4
- package/dist/cjs/conditions/schemas/return-value-test.d.ts +28 -12
- package/dist/cjs/conditions/schemas/return-value-test.js +19 -5
- package/dist/cjs/conditions/schemas/return-value-test.js.map +1 -1
- package/dist/cjs/conditions/schemas/rpc.d.ts +18 -12
- package/dist/cjs/conditions/schemas/signing.d.ts +12 -0
- package/dist/cjs/conditions/schemas/signing.js +204 -0
- package/dist/cjs/conditions/schemas/signing.js.map +1 -0
- package/dist/cjs/conditions/schemas/time.d.ts +16 -8
- package/dist/cjs/conditions/schemas/utils.js +6 -1
- package/dist/cjs/conditions/schemas/utils.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/sign.d.ts +24 -0
- package/dist/cjs/sign.js +88 -0
- package/dist/cjs/sign.js.map +1 -0
- package/dist/cjs/types.d.ts +1 -0
- package/dist/es/conditions/base/address-allowlist.d.ts +10 -0
- package/dist/es/conditions/base/address-allowlist.js +15 -0
- package/dist/es/conditions/base/address-allowlist.js.map +1 -0
- package/dist/es/conditions/base/index.d.ts +2 -0
- package/dist/es/conditions/base/index.js +2 -0
- package/dist/es/conditions/base/index.js.map +1 -1
- package/dist/es/conditions/base/signing.d.ts +10 -0
- package/dist/es/conditions/base/signing.js +20 -0
- package/dist/es/conditions/base/signing.js.map +1 -0
- package/dist/es/conditions/condition-factory.js +8 -0
- package/dist/es/conditions/condition-factory.js.map +1 -1
- package/dist/es/conditions/context/context.d.ts +4 -0
- package/dist/es/conditions/context/context.js +27 -2
- package/dist/es/conditions/context/context.js.map +1 -1
- package/dist/es/conditions/schemas/address-allowlist.d.ts +16 -0
- package/dist/es/conditions/schemas/address-allowlist.js +17 -0
- package/dist/es/conditions/schemas/address-allowlist.js.map +1 -0
- package/dist/es/conditions/schemas/common.d.ts +1 -0
- package/dist/es/conditions/schemas/common.js +15 -2
- package/dist/es/conditions/schemas/common.js.map +1 -1
- package/dist/es/conditions/schemas/contract.d.ts +21 -18
- package/dist/es/conditions/schemas/export-for-zod-doc-gen.d.ts +2 -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 +47 -14
- package/dist/es/conditions/schemas/json-api.js +17 -3
- package/dist/es/conditions/schemas/json-api.js.map +1 -1
- package/dist/es/conditions/schemas/json-rpc.d.ts +48 -13
- package/dist/es/conditions/schemas/json-rpc.js +17 -3
- package/dist/es/conditions/schemas/json-rpc.js.map +1 -1
- package/dist/es/conditions/schemas/jwt.d.ts +2 -4
- package/dist/es/conditions/schemas/return-value-test.d.ts +28 -12
- package/dist/es/conditions/schemas/return-value-test.js +19 -5
- package/dist/es/conditions/schemas/return-value-test.js.map +1 -1
- package/dist/es/conditions/schemas/rpc.d.ts +18 -12
- package/dist/es/conditions/schemas/signing.d.ts +12 -0
- package/dist/es/conditions/schemas/signing.js +201 -0
- package/dist/es/conditions/schemas/signing.js.map +1 -0
- package/dist/es/conditions/schemas/time.d.ts +16 -8
- package/dist/es/conditions/schemas/utils.js +6 -1
- package/dist/es/conditions/schemas/utils.js.map +1 -1
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.js +1 -0
- package/dist/es/index.js.map +1 -1
- package/dist/es/sign.d.ts +24 -0
- package/dist/es/sign.js +85 -0
- package/dist/es/sign.js.map +1 -0
- package/dist/es/types.d.ts +1 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.es.tsbuildinfo +1 -1
- package/package.json +5 -4
|
@@ -153,28 +153,31 @@ export declare const functionAbiSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
|
153
153
|
}>;
|
|
154
154
|
export type FunctionAbiProps = z.infer<typeof functionAbiSchema>;
|
|
155
155
|
export declare const ContractConditionType = "contract";
|
|
156
|
-
export declare const contractConditionSchema: z.ZodEffects<z.ZodObject<
|
|
157
|
-
conditionType: z.ZodString;
|
|
158
|
-
}, {
|
|
159
|
-
conditionType: z.ZodDefault<z.ZodLiteral<"rpc">>;
|
|
156
|
+
export declare const contractConditionSchema: z.ZodEffects<z.ZodObject<{
|
|
160
157
|
chain: z.ZodNumber;
|
|
161
|
-
|
|
162
|
-
parameters: z.ZodUnion<[z.ZodTuple<[z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodLiteral<":userAddress">, z.ZodString]>, z.ZodUnion<[z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodEnum<["earliest", "finalized", "safe", "latest", "pending"]>]>, z.ZodString]>], null>, z.ZodTuple<[z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodLiteral<":userAddress">, z.ZodString]>], null>]>;
|
|
163
|
-
returnValueTest: z.ZodObject<z.objectUtil.extendShape<{
|
|
158
|
+
returnValueTest: z.ZodEffects<z.ZodObject<{
|
|
164
159
|
index: z.ZodOptional<z.ZodNumber>;
|
|
165
|
-
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!="]>;
|
|
166
|
-
}
|
|
160
|
+
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
161
|
+
} & {
|
|
167
162
|
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
168
|
-
}
|
|
169
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
163
|
+
}, "strip", z.ZodTypeAny, {
|
|
164
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
170
165
|
value?: any;
|
|
171
166
|
index?: number | undefined;
|
|
172
167
|
}, {
|
|
173
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
168
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
169
|
+
value?: any;
|
|
170
|
+
index?: number | undefined;
|
|
171
|
+
}>, {
|
|
172
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
173
|
+
value?: any;
|
|
174
|
+
index?: number | undefined;
|
|
175
|
+
}, {
|
|
176
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
174
177
|
value?: any;
|
|
175
178
|
index?: number | undefined;
|
|
176
179
|
}>;
|
|
177
|
-
}
|
|
180
|
+
} & {
|
|
178
181
|
conditionType: z.ZodDefault<z.ZodLiteral<"contract">>;
|
|
179
182
|
contractAddress: z.ZodEffects<z.ZodString, string, string>;
|
|
180
183
|
standardContractType: z.ZodOptional<z.ZodEnum<["ERC20", "ERC721"]>>;
|
|
@@ -319,13 +322,13 @@ export declare const contractConditionSchema: z.ZodEffects<z.ZodObject<z.objectU
|
|
|
319
322
|
stateMutability: "view" | "pure";
|
|
320
323
|
}>>;
|
|
321
324
|
parameters: z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">;
|
|
322
|
-
}
|
|
325
|
+
}, "strip", z.ZodTypeAny, {
|
|
323
326
|
conditionType: "contract";
|
|
324
327
|
chain: number;
|
|
325
328
|
method: string;
|
|
326
329
|
parameters: any[];
|
|
327
330
|
returnValueTest: {
|
|
328
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
331
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
329
332
|
value?: any;
|
|
330
333
|
index?: number | undefined;
|
|
331
334
|
};
|
|
@@ -355,7 +358,7 @@ export declare const contractConditionSchema: z.ZodEffects<z.ZodObject<z.objectU
|
|
|
355
358
|
method: string;
|
|
356
359
|
parameters: any[];
|
|
357
360
|
returnValueTest: {
|
|
358
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
361
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
359
362
|
value?: any;
|
|
360
363
|
index?: number | undefined;
|
|
361
364
|
};
|
|
@@ -387,7 +390,7 @@ export declare const contractConditionSchema: z.ZodEffects<z.ZodObject<z.objectU
|
|
|
387
390
|
method: string;
|
|
388
391
|
parameters: any[];
|
|
389
392
|
returnValueTest: {
|
|
390
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
393
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
391
394
|
value?: any;
|
|
392
395
|
index?: number | undefined;
|
|
393
396
|
};
|
|
@@ -417,7 +420,7 @@ export declare const contractConditionSchema: z.ZodEffects<z.ZodObject<z.objectU
|
|
|
417
420
|
method: string;
|
|
418
421
|
parameters: any[];
|
|
419
422
|
returnValueTest: {
|
|
420
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
423
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
421
424
|
value?: any;
|
|
422
425
|
index?: number | undefined;
|
|
423
426
|
};
|
|
@@ -17,5 +17,8 @@ export * from './jwt';
|
|
|
17
17
|
export * from './return-value-test';
|
|
18
18
|
export * from './rpc';
|
|
19
19
|
export * from './sequential';
|
|
20
|
+
export * from './signing';
|
|
20
21
|
export * from './time';
|
|
22
|
+
// ts-unused-exports:disable-next-line - this comment line is added to prevent lint from changing or objecting the export order.
|
|
23
|
+
export * from './address-allowlist';
|
|
21
24
|
//# 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,cAAc,SAAS,CAAC;AACxB,gIAAgI;AAChI,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,gIAAgI;AAChI,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,qBAAqB,CAAC;AACpC,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
|
|
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,cAAc,SAAS,CAAC;AACxB,gIAAgI;AAChI,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,gIAAgI;AAChI,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,qBAAqB,CAAC;AACpC,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,gIAAgI;AAChI,cAAc,qBAAqB,CAAC"}
|
|
@@ -1,48 +1,81 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const JsonApiConditionType = "json-api";
|
|
3
|
-
export declare const jsonApiConditionSchema: z.
|
|
4
|
-
conditionType: z.ZodString;
|
|
5
|
-
}, {
|
|
3
|
+
export declare const jsonApiConditionSchema: z.ZodEffects<z.ZodObject<{} & {
|
|
6
4
|
conditionType: z.ZodDefault<z.ZodLiteral<"json-api">>;
|
|
7
5
|
endpoint: z.ZodEffects<z.ZodString, string, string>;
|
|
8
6
|
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
9
7
|
query: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
10
8
|
authorizationToken: z.ZodOptional<z.ZodString>;
|
|
11
|
-
|
|
9
|
+
authorizationType: z.ZodOptional<z.ZodEnum<["Bearer", "Basic", "X-API-Key"]>>;
|
|
10
|
+
returnValueTest: z.ZodEffects<z.ZodObject<{
|
|
12
11
|
index: z.ZodOptional<z.ZodNumber>;
|
|
13
|
-
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!="]>;
|
|
14
|
-
}
|
|
12
|
+
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
13
|
+
} & {
|
|
15
14
|
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
16
|
-
}
|
|
17
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
17
|
+
value?: any;
|
|
18
|
+
index?: number | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
21
|
+
value?: any;
|
|
22
|
+
index?: number | undefined;
|
|
23
|
+
}>, {
|
|
24
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
18
25
|
value?: any;
|
|
19
26
|
index?: number | undefined;
|
|
20
27
|
}, {
|
|
21
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
28
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
22
29
|
value?: any;
|
|
23
30
|
index?: number | undefined;
|
|
24
31
|
}>;
|
|
25
|
-
}
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
33
|
conditionType: "json-api";
|
|
34
|
+
endpoint: string;
|
|
27
35
|
returnValueTest: {
|
|
28
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
36
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
29
37
|
value?: any;
|
|
30
38
|
index?: number | undefined;
|
|
31
39
|
};
|
|
40
|
+
query?: string | undefined;
|
|
41
|
+
authorizationToken?: string | undefined;
|
|
42
|
+
authorizationType?: "Bearer" | "Basic" | "X-API-Key" | undefined;
|
|
43
|
+
parameters?: Record<string, unknown> | undefined;
|
|
44
|
+
}, {
|
|
32
45
|
endpoint: string;
|
|
46
|
+
returnValueTest: {
|
|
47
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
48
|
+
value?: any;
|
|
49
|
+
index?: number | undefined;
|
|
50
|
+
};
|
|
51
|
+
conditionType?: "json-api" | undefined;
|
|
52
|
+
query?: string | undefined;
|
|
53
|
+
authorizationToken?: string | undefined;
|
|
54
|
+
authorizationType?: "Bearer" | "Basic" | "X-API-Key" | undefined;
|
|
33
55
|
parameters?: Record<string, unknown> | undefined;
|
|
56
|
+
}>, {
|
|
57
|
+
conditionType: "json-api";
|
|
58
|
+
endpoint: string;
|
|
59
|
+
returnValueTest: {
|
|
60
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
61
|
+
value?: any;
|
|
62
|
+
index?: number | undefined;
|
|
63
|
+
};
|
|
34
64
|
query?: string | undefined;
|
|
35
65
|
authorizationToken?: string | undefined;
|
|
66
|
+
authorizationType?: "Bearer" | "Basic" | "X-API-Key" | undefined;
|
|
67
|
+
parameters?: Record<string, unknown> | undefined;
|
|
36
68
|
}, {
|
|
69
|
+
endpoint: string;
|
|
37
70
|
returnValueTest: {
|
|
38
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
71
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
39
72
|
value?: any;
|
|
40
73
|
index?: number | undefined;
|
|
41
74
|
};
|
|
42
|
-
endpoint: string;
|
|
43
75
|
conditionType?: "json-api" | undefined;
|
|
44
|
-
parameters?: Record<string, unknown> | undefined;
|
|
45
76
|
query?: string | undefined;
|
|
46
77
|
authorizationToken?: string | undefined;
|
|
78
|
+
authorizationType?: "Bearer" | "Basic" | "X-API-Key" | undefined;
|
|
79
|
+
parameters?: Record<string, unknown> | undefined;
|
|
47
80
|
}>;
|
|
48
81
|
export type JsonApiConditionProps = z.infer<typeof jsonApiConditionSchema>;
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { baseConditionSchema, httpsURLSchema, jsonPathSchema } from './common';
|
|
2
|
+
import { baseConditionSchema, httpsURLSchema, jsonAuthorizationTypeSchema, jsonPathSchema, } from './common';
|
|
3
3
|
import { contextParamSchema } from './context';
|
|
4
4
|
import { returnValueTestSchema } from './return-value-test';
|
|
5
5
|
export const JsonApiConditionType = 'json-api';
|
|
6
|
-
export const jsonApiConditionSchema = baseConditionSchema
|
|
7
|
-
|
|
6
|
+
export const jsonApiConditionSchema = baseConditionSchema
|
|
7
|
+
.extend({
|
|
8
|
+
conditionType: z
|
|
9
|
+
.literal(JsonApiConditionType)
|
|
10
|
+
.default(JsonApiConditionType),
|
|
8
11
|
endpoint: httpsURLSchema,
|
|
9
12
|
parameters: z.record(z.string(), z.unknown()).optional(),
|
|
10
13
|
query: jsonPathSchema.optional(),
|
|
11
14
|
authorizationToken: contextParamSchema.optional(),
|
|
15
|
+
authorizationType: jsonAuthorizationTypeSchema.optional(),
|
|
12
16
|
returnValueTest: returnValueTestSchema, // Update to allow multiple return values after expanding supported methods
|
|
17
|
+
})
|
|
18
|
+
.refine((data) => {
|
|
19
|
+
// Ensure that if authorizationType is provided, then authorizationToken is set
|
|
20
|
+
if (data.authorizationType && !data.authorizationToken) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
return true;
|
|
24
|
+
}, {
|
|
25
|
+
message: 'authorizationToken must be provided if authorizationType is set',
|
|
26
|
+
path: ['authorizationType'],
|
|
13
27
|
});
|
|
14
28
|
//# sourceMappingURL=json-api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-api.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/json-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,
|
|
1
|
+
{"version":3,"file":"json-api.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/json-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,2BAA2B,EAC3B,cAAc,GACf,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC;AAE/C,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB;KACtD,MAAM,CAAC;IACN,aAAa,EAAE,CAAC;SACb,OAAO,CAAC,oBAAoB,CAAC;SAC7B,OAAO,CAAC,oBAAoB,CAAC;IAChC,QAAQ,EAAE,cAAc;IACxB,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;IACxD,KAAK,EAAE,cAAc,CAAC,QAAQ,EAAE;IAChC,kBAAkB,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IACjD,iBAAiB,EAAE,2BAA2B,CAAC,QAAQ,EAAE;IACzD,eAAe,EAAE,qBAAqB,EAAE,2EAA2E;CACpH,CAAC;KACD,MAAM,CACL,CAAC,IAAI,EAAE,EAAE;IACP,+EAA+E;IAC/E,IAAI,IAAI,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACvD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,EACD;IACE,OAAO,EACL,iEAAiE;IACnE,IAAI,EAAE,CAAC,mBAAmB,CAAC;CAC5B,CACF,CAAC"}
|
|
@@ -1,51 +1,86 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const JsonRpcConditionType = "json-rpc";
|
|
3
|
-
export declare const jsonRpcConditionSchema: z.
|
|
4
|
-
conditionType: z.ZodString;
|
|
5
|
-
}, {
|
|
3
|
+
export declare const jsonRpcConditionSchema: z.ZodEffects<z.ZodObject<{} & {
|
|
6
4
|
conditionType: z.ZodDefault<z.ZodLiteral<"json-rpc">>;
|
|
7
5
|
endpoint: z.ZodEffects<z.ZodString, string, string>;
|
|
8
6
|
method: z.ZodString;
|
|
9
7
|
params: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnknown, "many">, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
10
8
|
query: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
11
9
|
authorizationToken: z.ZodOptional<z.ZodString>;
|
|
12
|
-
|
|
10
|
+
authorizationType: z.ZodOptional<z.ZodEnum<["Bearer", "Basic", "X-API-Key"]>>;
|
|
11
|
+
returnValueTest: z.ZodEffects<z.ZodObject<{
|
|
13
12
|
index: z.ZodOptional<z.ZodNumber>;
|
|
14
|
-
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!="]>;
|
|
15
|
-
}
|
|
13
|
+
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
14
|
+
} & {
|
|
16
15
|
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
17
|
-
}
|
|
18
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
18
|
+
value?: any;
|
|
19
|
+
index?: number | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
22
|
+
value?: any;
|
|
23
|
+
index?: number | undefined;
|
|
24
|
+
}>, {
|
|
25
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
19
26
|
value?: any;
|
|
20
27
|
index?: number | undefined;
|
|
21
28
|
}, {
|
|
22
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
29
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
23
30
|
value?: any;
|
|
24
31
|
index?: number | undefined;
|
|
25
32
|
}>;
|
|
26
|
-
}
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
27
34
|
conditionType: "json-rpc";
|
|
35
|
+
endpoint: string;
|
|
28
36
|
method: string;
|
|
29
37
|
returnValueTest: {
|
|
30
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
38
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
31
39
|
value?: any;
|
|
32
40
|
index?: number | undefined;
|
|
33
41
|
};
|
|
34
|
-
endpoint: string;
|
|
35
42
|
params?: unknown[] | Record<string, unknown> | undefined;
|
|
36
43
|
query?: string | undefined;
|
|
37
44
|
authorizationToken?: string | undefined;
|
|
45
|
+
authorizationType?: "Bearer" | "Basic" | "X-API-Key" | undefined;
|
|
38
46
|
}, {
|
|
47
|
+
endpoint: string;
|
|
48
|
+
method: string;
|
|
49
|
+
returnValueTest: {
|
|
50
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
51
|
+
value?: any;
|
|
52
|
+
index?: number | undefined;
|
|
53
|
+
};
|
|
54
|
+
params?: unknown[] | Record<string, unknown> | undefined;
|
|
55
|
+
conditionType?: "json-rpc" | undefined;
|
|
56
|
+
query?: string | undefined;
|
|
57
|
+
authorizationToken?: string | undefined;
|
|
58
|
+
authorizationType?: "Bearer" | "Basic" | "X-API-Key" | undefined;
|
|
59
|
+
}>, {
|
|
60
|
+
conditionType: "json-rpc";
|
|
61
|
+
endpoint: string;
|
|
39
62
|
method: string;
|
|
40
63
|
returnValueTest: {
|
|
41
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
64
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
42
65
|
value?: any;
|
|
43
66
|
index?: number | undefined;
|
|
44
67
|
};
|
|
68
|
+
params?: unknown[] | Record<string, unknown> | undefined;
|
|
69
|
+
query?: string | undefined;
|
|
70
|
+
authorizationToken?: string | undefined;
|
|
71
|
+
authorizationType?: "Bearer" | "Basic" | "X-API-Key" | undefined;
|
|
72
|
+
}, {
|
|
45
73
|
endpoint: string;
|
|
74
|
+
method: string;
|
|
75
|
+
returnValueTest: {
|
|
76
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
77
|
+
value?: any;
|
|
78
|
+
index?: number | undefined;
|
|
79
|
+
};
|
|
46
80
|
params?: unknown[] | Record<string, unknown> | undefined;
|
|
47
81
|
conditionType?: "json-rpc" | undefined;
|
|
48
82
|
query?: string | undefined;
|
|
49
83
|
authorizationToken?: string | undefined;
|
|
84
|
+
authorizationType?: "Bearer" | "Basic" | "X-API-Key" | undefined;
|
|
50
85
|
}>;
|
|
51
86
|
export type JsonRpcConditionProps = z.infer<typeof jsonRpcConditionSchema>;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { baseConditionSchema, httpsURLSchema, jsonPathSchema } from './common';
|
|
2
|
+
import { baseConditionSchema, httpsURLSchema, jsonAuthorizationTypeSchema, jsonPathSchema, } from './common';
|
|
3
3
|
import { contextParamSchema } from './context';
|
|
4
4
|
import { returnValueTestSchema } from './return-value-test';
|
|
5
5
|
export const JsonRpcConditionType = 'json-rpc';
|
|
6
|
-
export const jsonRpcConditionSchema = baseConditionSchema
|
|
7
|
-
|
|
6
|
+
export const jsonRpcConditionSchema = baseConditionSchema
|
|
7
|
+
.extend({
|
|
8
|
+
conditionType: z
|
|
9
|
+
.literal(JsonRpcConditionType)
|
|
10
|
+
.default(JsonRpcConditionType),
|
|
8
11
|
endpoint: httpsURLSchema,
|
|
9
12
|
method: z.string(),
|
|
10
13
|
// list or dictionary
|
|
@@ -13,6 +16,17 @@ export const jsonRpcConditionSchema = baseConditionSchema.extend({
|
|
|
13
16
|
.optional(),
|
|
14
17
|
query: jsonPathSchema.optional(),
|
|
15
18
|
authorizationToken: contextParamSchema.optional(),
|
|
19
|
+
authorizationType: jsonAuthorizationTypeSchema.optional(),
|
|
16
20
|
returnValueTest: returnValueTestSchema,
|
|
21
|
+
})
|
|
22
|
+
.refine((data) => {
|
|
23
|
+
// Ensure that if authorizationType is provided, then authorizationToken is set
|
|
24
|
+
if (data.authorizationType && !data.authorizationToken) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
}, {
|
|
29
|
+
message: 'authorizationToken must be provided if authorizationType is set',
|
|
30
|
+
path: ['authorizationType'],
|
|
17
31
|
});
|
|
18
32
|
//# sourceMappingURL=json-rpc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-rpc.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/json-rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,
|
|
1
|
+
{"version":3,"file":"json-rpc.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/json-rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,2BAA2B,EAC3B,cAAc,GACf,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC;AAE/C,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB;KACtD,MAAM,CAAC;IACN,aAAa,EAAE,CAAC;SACb,OAAO,CAAC,oBAAoB,CAAC;SAC7B,OAAO,CAAC,oBAAoB,CAAC;IAChC,QAAQ,EAAE,cAAc;IACxB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,qBAAqB;IACrB,MAAM,EAAE,CAAC;SACN,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;SAChE,QAAQ,EAAE;IACb,KAAK,EAAE,cAAc,CAAC,QAAQ,EAAE;IAChC,kBAAkB,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IACjD,iBAAiB,EAAE,2BAA2B,CAAC,QAAQ,EAAE;IACzD,eAAe,EAAE,qBAAqB;CACvC,CAAC;KACD,MAAM,CACL,CAAC,IAAI,EAAE,EAAE;IACP,+EAA+E;IAC/E,IAAI,IAAI,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACvD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,EACD;IACE,OAAO,EACL,iEAAiE;IACnE,IAAI,EAAE,CAAC,mBAAmB,CAAC;CAC5B,CACF,CAAC"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const JWT_PARAM_DEFAULT = ":jwtToken";
|
|
3
3
|
export declare const JWTConditionType = "jwt";
|
|
4
|
-
export declare const jwtConditionSchema: z.ZodObject<
|
|
5
|
-
conditionType: z.ZodString;
|
|
6
|
-
}, {
|
|
4
|
+
export declare const jwtConditionSchema: z.ZodObject<{} & {
|
|
7
5
|
conditionType: z.ZodDefault<z.ZodLiteral<"jwt">>;
|
|
8
6
|
publicKey: z.ZodString;
|
|
9
7
|
expectedIssuer: z.ZodOptional<z.ZodString>;
|
|
10
8
|
jwtToken: z.ZodDefault<z.ZodString>;
|
|
11
|
-
}
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
10
|
conditionType: "jwt";
|
|
13
11
|
publicKey: string;
|
|
14
12
|
jwtToken: string;
|
|
@@ -1,29 +1,45 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const returnValueTestSchema: z.
|
|
2
|
+
export declare const returnValueTestSchema: z.ZodEffects<z.ZodObject<{
|
|
3
3
|
index: z.ZodOptional<z.ZodNumber>;
|
|
4
|
-
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!="]>;
|
|
5
|
-
}
|
|
4
|
+
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
5
|
+
} & {
|
|
6
6
|
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
7
|
-
}
|
|
8
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
9
|
+
value?: any;
|
|
10
|
+
index?: number | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
13
|
+
value?: any;
|
|
14
|
+
index?: number | undefined;
|
|
15
|
+
}>, {
|
|
16
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
9
17
|
value?: any;
|
|
10
18
|
index?: number | undefined;
|
|
11
19
|
}, {
|
|
12
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
20
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
13
21
|
value?: any;
|
|
14
22
|
index?: number | undefined;
|
|
15
23
|
}>;
|
|
16
|
-
export declare const blockchainReturnValueTestSchema: z.
|
|
24
|
+
export declare const blockchainReturnValueTestSchema: z.ZodEffects<z.ZodObject<{
|
|
17
25
|
index: z.ZodOptional<z.ZodNumber>;
|
|
18
|
-
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!="]>;
|
|
19
|
-
}
|
|
26
|
+
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
27
|
+
} & {
|
|
20
28
|
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
21
|
-
}
|
|
22
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
31
|
+
value?: any;
|
|
32
|
+
index?: number | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
35
|
+
value?: any;
|
|
36
|
+
index?: number | undefined;
|
|
37
|
+
}>, {
|
|
38
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
23
39
|
value?: any;
|
|
24
40
|
index?: number | undefined;
|
|
25
41
|
}, {
|
|
26
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
42
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
27
43
|
value?: any;
|
|
28
44
|
index?: number | undefined;
|
|
29
45
|
}>;
|
|
@@ -2,12 +2,26 @@ import { z } from 'zod';
|
|
|
2
2
|
import { blockchainParamOrContextParamSchema, paramOrContextParamSchema, } from './context';
|
|
3
3
|
const returnValueTestBaseSchema = z.object({
|
|
4
4
|
index: z.number().int().nonnegative().optional(),
|
|
5
|
-
comparator: z.enum(['==', '>', '<', '>=', '<=', '!=']),
|
|
5
|
+
comparator: z.enum(['==', '>', '<', '>=', '<=', '!=', 'in', '!in']),
|
|
6
6
|
});
|
|
7
|
-
|
|
7
|
+
const requireNonEmptyArrayIfComparatorIsIn = (data) => {
|
|
8
|
+
if (data.comparator === 'in' || data.comparator === '!in') {
|
|
9
|
+
return Array.isArray(data.value) && data.value.length > 0;
|
|
10
|
+
}
|
|
11
|
+
return true;
|
|
12
|
+
};
|
|
13
|
+
const inComparatorErrorConfig = {
|
|
14
|
+
message: `"value" must be a non-empty array when comparator is "in"/"!in"`,
|
|
15
|
+
path: ['value'],
|
|
16
|
+
};
|
|
17
|
+
export const returnValueTestSchema = returnValueTestBaseSchema
|
|
18
|
+
.extend({
|
|
8
19
|
value: paramOrContextParamSchema,
|
|
9
|
-
})
|
|
10
|
-
|
|
20
|
+
})
|
|
21
|
+
.refine(requireNonEmptyArrayIfComparatorIsIn, inComparatorErrorConfig);
|
|
22
|
+
export const blockchainReturnValueTestSchema = returnValueTestBaseSchema
|
|
23
|
+
.extend({
|
|
11
24
|
value: blockchainParamOrContextParamSchema,
|
|
12
|
-
})
|
|
25
|
+
})
|
|
26
|
+
.refine(requireNonEmptyArrayIfComparatorIsIn, inComparatorErrorConfig);
|
|
13
27
|
//# sourceMappingURL=return-value-test.js.map
|
|
@@ -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;AAEnB,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,CAAC,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;AAEnB,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;CACpE,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,CAAC;AAEzE,MAAM,CAAC,MAAM,+BAA+B,GAAG,yBAAyB;KACrE,MAAM,CAAC;IACN,KAAK,EAAE,mCAAmC;CAC3C,CAAC;KACD,MAAM,CAAC,oCAAoC,EAAE,uBAAuB,CAAC,CAAC"}
|
|
@@ -1,33 +1,39 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const RpcConditionType = "rpc";
|
|
3
|
-
export declare const rpcConditionSchema: z.ZodObject<
|
|
4
|
-
conditionType: z.ZodString;
|
|
5
|
-
}, {
|
|
3
|
+
export declare const rpcConditionSchema: z.ZodObject<{} & {
|
|
6
4
|
conditionType: z.ZodDefault<z.ZodLiteral<"rpc">>;
|
|
7
5
|
chain: z.ZodNumber;
|
|
8
6
|
method: z.ZodEnum<["eth_getBalance"]>;
|
|
9
7
|
parameters: z.ZodUnion<[z.ZodTuple<[z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodLiteral<":userAddress">, z.ZodString]>, z.ZodUnion<[z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodEnum<["earliest", "finalized", "safe", "latest", "pending"]>]>, z.ZodString]>], null>, z.ZodTuple<[z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodLiteral<":userAddress">, z.ZodString]>], null>]>;
|
|
10
|
-
returnValueTest: z.
|
|
8
|
+
returnValueTest: z.ZodEffects<z.ZodObject<{
|
|
11
9
|
index: z.ZodOptional<z.ZodNumber>;
|
|
12
|
-
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!="]>;
|
|
13
|
-
}
|
|
10
|
+
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
11
|
+
} & {
|
|
14
12
|
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
15
|
-
}
|
|
16
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
15
|
+
value?: any;
|
|
16
|
+
index?: number | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
19
|
+
value?: any;
|
|
20
|
+
index?: number | undefined;
|
|
21
|
+
}>, {
|
|
22
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
17
23
|
value?: any;
|
|
18
24
|
index?: number | undefined;
|
|
19
25
|
}, {
|
|
20
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
26
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
21
27
|
value?: any;
|
|
22
28
|
index?: number | undefined;
|
|
23
29
|
}>;
|
|
24
|
-
}
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
31
|
conditionType: "rpc";
|
|
26
32
|
chain: number;
|
|
27
33
|
method: "eth_getBalance";
|
|
28
34
|
parameters: [string, string | number] | [string];
|
|
29
35
|
returnValueTest: {
|
|
30
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
36
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
31
37
|
value?: any;
|
|
32
38
|
index?: number | undefined;
|
|
33
39
|
};
|
|
@@ -36,7 +42,7 @@ export declare const rpcConditionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
36
42
|
method: "eth_getBalance";
|
|
37
43
|
parameters: [string, string | number] | [string];
|
|
38
44
|
returnValueTest: {
|
|
39
|
-
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
|
|
45
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
40
46
|
value?: any;
|
|
41
47
|
index?: number | undefined;
|
|
42
48
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SIGNING_CONDITION_OBJECT_CONTEXT_VAR = ":signingConditionObject";
|
|
3
|
+
export declare const SigningObjectAttributeConditionType = "signing-attribute";
|
|
4
|
+
export declare const signingObjectAttributeConditionSchema: z.ZodSchema;
|
|
5
|
+
export type SigningObjectAttributeConditionProps = z.infer<typeof signingObjectAttributeConditionSchema>;
|
|
6
|
+
export declare const abiParameterValidationSchema: z.ZodSchema;
|
|
7
|
+
export type AbiParameterValidationProps = z.infer<typeof abiParameterValidationSchema>;
|
|
8
|
+
export declare const abiCallValidationSchema: z.ZodSchema;
|
|
9
|
+
export type AbiCallValidationProps = z.infer<typeof abiCallValidationSchema>;
|
|
10
|
+
export declare const SigningObjectAbiAttributeConditionType = "signing-abi-attribute";
|
|
11
|
+
export declare const signingObjectAbiAttributeConditionSchema: z.ZodSchema;
|
|
12
|
+
export type SigningObjectAbiAttributeConditionProps = z.infer<typeof signingObjectAbiAttributeConditionSchema>;
|