@zapier/policy-schema 0.17.0 → 0.18.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/index.cjs +34 -13
- package/dist/index.d.cts +198 -0
- package/dist/index.d.ts +198 -0
- package/dist/index.mjs +34 -13
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -25,33 +25,40 @@ var VALID_OPERATOR_LIST = [
|
|
|
25
25
|
"values_in"
|
|
26
26
|
];
|
|
27
27
|
var ScalarSchema = z.union([z.string(), z.number(), z.boolean()]);
|
|
28
|
-
var
|
|
29
|
-
var
|
|
28
|
+
var PathSegmentSchema = z.union([z.string(), z.number().int()]);
|
|
29
|
+
var PathSchema = z.array(PathSegmentSchema).min(1);
|
|
30
|
+
var RelativePathSchema = z.array(PathSegmentSchema);
|
|
31
|
+
var NegateField = { negate: z.boolean().optional() };
|
|
30
32
|
var ConditionValueSchema = z.json();
|
|
31
33
|
var EqualsConditionSchema = z.object({
|
|
32
34
|
path: PathSchema,
|
|
33
35
|
operator: z.literal("equals"),
|
|
34
|
-
value: ConditionValueSchema
|
|
36
|
+
value: ConditionValueSchema,
|
|
37
|
+
...NegateField
|
|
35
38
|
}).strict();
|
|
36
39
|
var InConditionSchema = z.object({
|
|
37
40
|
path: PathSchema,
|
|
38
41
|
operator: z.literal("in"),
|
|
39
|
-
value: z.array(ScalarSchema).min(1)
|
|
42
|
+
value: z.array(ScalarSchema).min(1),
|
|
43
|
+
...NegateField
|
|
40
44
|
}).strict();
|
|
41
45
|
var MatchesConditionSchema = z.object({
|
|
42
46
|
path: PathSchema,
|
|
43
47
|
operator: z.literal("matches"),
|
|
44
|
-
value: z.string()
|
|
48
|
+
value: z.string(),
|
|
49
|
+
...NegateField
|
|
45
50
|
}).strict();
|
|
46
51
|
var MatchesHostConditionSchema = z.object({
|
|
47
52
|
path: PathSchema,
|
|
48
53
|
operator: z.literal("matches_host"),
|
|
49
|
-
value: z.string()
|
|
54
|
+
value: z.string(),
|
|
55
|
+
...NegateField
|
|
50
56
|
}).strict();
|
|
51
57
|
var MatchesPathConditionSchema = z.object({
|
|
52
58
|
path: PathSchema,
|
|
53
59
|
operator: z.literal("matches_path"),
|
|
54
|
-
value: z.string()
|
|
60
|
+
value: z.string(),
|
|
61
|
+
...NegateField
|
|
55
62
|
}).strict();
|
|
56
63
|
var RangeValueSchema = z.object({
|
|
57
64
|
min: z.number().finite().optional(),
|
|
@@ -62,26 +69,31 @@ var RangeValueSchema = z.object({
|
|
|
62
69
|
var RangeConditionSchema = z.object({
|
|
63
70
|
path: PathSchema,
|
|
64
71
|
operator: z.literal("range"),
|
|
65
|
-
value: RangeValueSchema
|
|
72
|
+
value: RangeValueSchema,
|
|
73
|
+
...NegateField
|
|
66
74
|
}).strict();
|
|
67
75
|
var MatchesUrlConditionSchema = z.object({
|
|
68
76
|
path: PathSchema,
|
|
69
77
|
operator: z.literal("matches_url"),
|
|
70
|
-
value: z.string()
|
|
78
|
+
value: z.string(),
|
|
79
|
+
...NegateField
|
|
71
80
|
}).strict();
|
|
72
81
|
var ValuesInConditionSchema = z.object({
|
|
73
82
|
path: PathSchema,
|
|
74
83
|
operator: z.literal("values_in"),
|
|
75
|
-
value: z.array(ScalarSchema).min(1)
|
|
84
|
+
value: z.array(ScalarSchema).min(1),
|
|
85
|
+
...NegateField
|
|
76
86
|
}).strict();
|
|
77
87
|
var ExistsConditionSchema = z.object({
|
|
78
88
|
path: PathSchema,
|
|
79
|
-
operator: z.literal("exists")
|
|
89
|
+
operator: z.literal("exists"),
|
|
90
|
+
...NegateField
|
|
80
91
|
}).strict();
|
|
81
92
|
var KeysInConditionSchema = z.object({
|
|
82
93
|
path: PathSchema,
|
|
83
94
|
operator: z.literal("keys_in"),
|
|
84
|
-
value: z.array(z.string())
|
|
95
|
+
value: z.array(z.string()),
|
|
96
|
+
...NegateField
|
|
85
97
|
}).strict();
|
|
86
98
|
var SizeValueSchema = z.union([
|
|
87
99
|
z.number().int().nonnegative(),
|
|
@@ -90,7 +102,8 @@ var SizeValueSchema = z.union([
|
|
|
90
102
|
var SizeConditionSchema = z.object({
|
|
91
103
|
path: PathSchema,
|
|
92
104
|
operator: z.literal("size"),
|
|
93
|
-
value: SizeValueSchema
|
|
105
|
+
value: SizeValueSchema,
|
|
106
|
+
...NegateField
|
|
94
107
|
}).strict();
|
|
95
108
|
var RelativeConditionSchema = z.union([
|
|
96
109
|
EqualsConditionSchema.extend({ path: RelativePathSchema }),
|
|
@@ -328,6 +341,10 @@ function getOpenApiSchema() {
|
|
|
328
341
|
value: {
|
|
329
342
|
description: "Value to compare against using the operator."
|
|
330
343
|
},
|
|
344
|
+
negate: {
|
|
345
|
+
type: "boolean",
|
|
346
|
+
description: "When true, the condition passes only if the operator would have failed. Not permitted on the some, all, and none quantifiers."
|
|
347
|
+
},
|
|
331
348
|
where: {
|
|
332
349
|
type: "array",
|
|
333
350
|
minItems: 1,
|
|
@@ -353,6 +370,10 @@ function getOpenApiSchema() {
|
|
|
353
370
|
},
|
|
354
371
|
value: {
|
|
355
372
|
description: "Value to compare against using the operator."
|
|
373
|
+
},
|
|
374
|
+
negate: {
|
|
375
|
+
type: "boolean",
|
|
376
|
+
description: "When true, the relative condition passes only if the operator would have failed."
|
|
356
377
|
}
|
|
357
378
|
}
|
|
358
379
|
}
|