@zapier/policy-schema 0.5.0 → 0.7.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 CHANGED
@@ -126,13 +126,13 @@ var OperatorSchema = zod.z.enum([
126
126
  ]);
127
127
  var ConditionValueSchema = JsonValueSchema;
128
128
  var StatementSchema = zod.z.object({
129
- effect: zod.z.enum(["allow", "deny"]),
129
+ effect: zod.z.enum(["allow", "ask", "deny"]),
130
130
  permissions: zod.z.array(zod.z.string()).min(1),
131
131
  resources: zod.z.array(zod.z.string()).min(1),
132
132
  conditions: zod.z.array(ConditionSchema).optional()
133
133
  }).strict();
134
134
  var PolicySchema = zod.z.object({
135
- version: zod.z.literal(1),
135
+ version: zod.z.literal(2),
136
136
  statements: zod.z.array(StatementSchema)
137
137
  }).strict();
138
138
 
package/dist/index.d.cts CHANGED
@@ -19,7 +19,7 @@ interface Condition {
19
19
  operator: Operator;
20
20
  value?: ConditionValue;
21
21
  }
22
- type Effect = "allow" | "deny";
22
+ type Effect = "allow" | "ask" | "deny";
23
23
  interface Statement {
24
24
  effect: Effect;
25
25
  permissions: string[];
@@ -27,7 +27,7 @@ interface Statement {
27
27
  conditions?: Condition[];
28
28
  }
29
29
  interface Policy {
30
- version: 1;
30
+ version: 2;
31
31
  statements: Statement[];
32
32
  }
33
33
  interface PolicyRequest {
@@ -36,7 +36,7 @@ interface PolicyRequest {
36
36
  context?: Record<string, unknown>;
37
37
  }
38
38
  interface PolicyResult {
39
- allowed: boolean;
39
+ effect: Effect;
40
40
  matchedStatement?: Statement;
41
41
  }
42
42
  interface ParsedUrl {
@@ -148,6 +148,7 @@ declare const ConditionValueSchema: z.ZodType<JsonValue, unknown, z.core.$ZodTyp
148
148
  declare const StatementSchema: z.ZodObject<{
149
149
  effect: z.ZodEnum<{
150
150
  allow: "allow";
151
+ ask: "ask";
151
152
  deny: "deny";
152
153
  }>;
153
154
  permissions: z.ZodArray<z.ZodString>;
@@ -204,10 +205,11 @@ declare const StatementSchema: z.ZodObject<{
204
205
  }, z.core.$strict>]>>>;
205
206
  }, z.core.$strict>;
206
207
  declare const PolicySchema: z.ZodObject<{
207
- version: z.ZodLiteral<1>;
208
+ version: z.ZodLiteral<2>;
208
209
  statements: z.ZodArray<z.ZodObject<{
209
210
  effect: z.ZodEnum<{
210
211
  allow: "allow";
212
+ ask: "ask";
211
213
  deny: "deny";
212
214
  }>;
213
215
  permissions: z.ZodArray<z.ZodString>;
package/dist/index.d.ts CHANGED
@@ -19,7 +19,7 @@ interface Condition {
19
19
  operator: Operator;
20
20
  value?: ConditionValue;
21
21
  }
22
- type Effect = "allow" | "deny";
22
+ type Effect = "allow" | "ask" | "deny";
23
23
  interface Statement {
24
24
  effect: Effect;
25
25
  permissions: string[];
@@ -27,7 +27,7 @@ interface Statement {
27
27
  conditions?: Condition[];
28
28
  }
29
29
  interface Policy {
30
- version: 1;
30
+ version: 2;
31
31
  statements: Statement[];
32
32
  }
33
33
  interface PolicyRequest {
@@ -36,7 +36,7 @@ interface PolicyRequest {
36
36
  context?: Record<string, unknown>;
37
37
  }
38
38
  interface PolicyResult {
39
- allowed: boolean;
39
+ effect: Effect;
40
40
  matchedStatement?: Statement;
41
41
  }
42
42
  interface ParsedUrl {
@@ -148,6 +148,7 @@ declare const ConditionValueSchema: z.ZodType<JsonValue, unknown, z.core.$ZodTyp
148
148
  declare const StatementSchema: z.ZodObject<{
149
149
  effect: z.ZodEnum<{
150
150
  allow: "allow";
151
+ ask: "ask";
151
152
  deny: "deny";
152
153
  }>;
153
154
  permissions: z.ZodArray<z.ZodString>;
@@ -204,10 +205,11 @@ declare const StatementSchema: z.ZodObject<{
204
205
  }, z.core.$strict>]>>>;
205
206
  }, z.core.$strict>;
206
207
  declare const PolicySchema: z.ZodObject<{
207
- version: z.ZodLiteral<1>;
208
+ version: z.ZodLiteral<2>;
208
209
  statements: z.ZodArray<z.ZodObject<{
209
210
  effect: z.ZodEnum<{
210
211
  allow: "allow";
212
+ ask: "ask";
211
213
  deny: "deny";
212
214
  }>;
213
215
  permissions: z.ZodArray<z.ZodString>;
package/dist/index.mjs CHANGED
@@ -124,13 +124,13 @@ var OperatorSchema = z.enum([
124
124
  ]);
125
125
  var ConditionValueSchema = JsonValueSchema;
126
126
  var StatementSchema = z.object({
127
- effect: z.enum(["allow", "deny"]),
127
+ effect: z.enum(["allow", "ask", "deny"]),
128
128
  permissions: z.array(z.string()).min(1),
129
129
  resources: z.array(z.string()).min(1),
130
130
  conditions: z.array(ConditionSchema).optional()
131
131
  }).strict();
132
132
  var PolicySchema = z.object({
133
- version: z.literal(1),
133
+ version: z.literal(2),
134
134
  statements: z.array(StatementSchema)
135
135
  }).strict();
136
136
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/policy-schema",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Zod schemas and TypeScript types for the Zapier policy engine",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -22,6 +22,11 @@
22
22
  "dist",
23
23
  "README.md"
24
24
  ],
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://gitlab.com/zapier/team-identity-platform/policy.git",
28
+ "directory": "typescript/schema"
29
+ },
25
30
  "publishConfig": {
26
31
  "access": "public"
27
32
  },