@zapier/policy-schema 0.8.0 → 0.10.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
@@ -142,6 +142,7 @@ var OperatorSchema = zod.z.enum([
142
142
  var ConditionValueSchema = JsonValueSchema;
143
143
  var V1StatementSchema = zod.z.object({
144
144
  id: zod.z.string().optional(),
145
+ label: zod.z.string().optional(),
145
146
  effect: zod.z.enum(["allow", "deny"]),
146
147
  permissions: zod.z.array(zod.z.string()).min(1),
147
148
  resources: zod.z.array(zod.z.string()).min(1),
@@ -149,6 +150,7 @@ var V1StatementSchema = zod.z.object({
149
150
  }).strict();
150
151
  var V2StatementSchema = zod.z.object({
151
152
  id: zod.z.string().optional(),
153
+ label: zod.z.string().optional(),
152
154
  effect: zod.z.enum(["allow", "ask", "deny"]),
153
155
  permissions: zod.z.array(zod.z.string()).min(1),
154
156
  resources: zod.z.array(zod.z.string()).min(1),
@@ -183,7 +185,11 @@ function getOpenApiSchema() {
183
185
  properties: {
184
186
  id: {
185
187
  type: "string",
186
- description: "Optional identifier for debugging and provenance. Included in canonical hash."
188
+ description: "Optional identifier for debugging and provenance. Included in statementHash for override targeting."
189
+ },
190
+ label: {
191
+ type: "string",
192
+ description: "Optional human-readable description of the statement. Excluded from statementHash for override targeting."
187
193
  },
188
194
  effect: {
189
195
  type: "string",
package/dist/index.d.cts CHANGED
@@ -22,6 +22,7 @@ interface Condition {
22
22
  type Effect = "allow" | "ask" | "deny";
23
23
  interface Statement {
24
24
  id?: string;
25
+ label?: string;
25
26
  effect: Effect;
26
27
  permissions: string[];
27
28
  resources: string[];
@@ -218,6 +219,7 @@ declare const ConditionValueSchema: z.ZodType<JsonValue, unknown, z.core.$ZodTyp
218
219
  /** Statement schema accepting the union of all effects (use PolicySchema for version-aware validation). */
219
220
  declare const StatementSchema: z.ZodObject<{
220
221
  id: z.ZodOptional<z.ZodString>;
222
+ label: z.ZodOptional<z.ZodString>;
221
223
  effect: z.ZodEnum<{
222
224
  allow: "allow";
223
225
  ask: "ask";
@@ -280,6 +282,7 @@ declare const PolicySchema: z.ZodUnion<readonly [z.ZodObject<{
280
282
  version: z.ZodLiteral<1>;
281
283
  statements: z.ZodArray<z.ZodObject<{
282
284
  id: z.ZodOptional<z.ZodString>;
285
+ label: z.ZodOptional<z.ZodString>;
283
286
  effect: z.ZodEnum<{
284
287
  allow: "allow";
285
288
  deny: "deny";
@@ -341,6 +344,7 @@ declare const PolicySchema: z.ZodUnion<readonly [z.ZodObject<{
341
344
  version: z.ZodLiteral<2>;
342
345
  statements: z.ZodArray<z.ZodObject<{
343
346
  id: z.ZodOptional<z.ZodString>;
347
+ label: z.ZodOptional<z.ZodString>;
344
348
  effect: z.ZodEnum<{
345
349
  allow: "allow";
346
350
  ask: "ask";
package/dist/index.d.ts CHANGED
@@ -22,6 +22,7 @@ interface Condition {
22
22
  type Effect = "allow" | "ask" | "deny";
23
23
  interface Statement {
24
24
  id?: string;
25
+ label?: string;
25
26
  effect: Effect;
26
27
  permissions: string[];
27
28
  resources: string[];
@@ -218,6 +219,7 @@ declare const ConditionValueSchema: z.ZodType<JsonValue, unknown, z.core.$ZodTyp
218
219
  /** Statement schema accepting the union of all effects (use PolicySchema for version-aware validation). */
219
220
  declare const StatementSchema: z.ZodObject<{
220
221
  id: z.ZodOptional<z.ZodString>;
222
+ label: z.ZodOptional<z.ZodString>;
221
223
  effect: z.ZodEnum<{
222
224
  allow: "allow";
223
225
  ask: "ask";
@@ -280,6 +282,7 @@ declare const PolicySchema: z.ZodUnion<readonly [z.ZodObject<{
280
282
  version: z.ZodLiteral<1>;
281
283
  statements: z.ZodArray<z.ZodObject<{
282
284
  id: z.ZodOptional<z.ZodString>;
285
+ label: z.ZodOptional<z.ZodString>;
283
286
  effect: z.ZodEnum<{
284
287
  allow: "allow";
285
288
  deny: "deny";
@@ -341,6 +344,7 @@ declare const PolicySchema: z.ZodUnion<readonly [z.ZodObject<{
341
344
  version: z.ZodLiteral<2>;
342
345
  statements: z.ZodArray<z.ZodObject<{
343
346
  id: z.ZodOptional<z.ZodString>;
347
+ label: z.ZodOptional<z.ZodString>;
344
348
  effect: z.ZodEnum<{
345
349
  allow: "allow";
346
350
  ask: "ask";
package/dist/index.mjs CHANGED
@@ -140,6 +140,7 @@ var OperatorSchema = z.enum([
140
140
  var ConditionValueSchema = JsonValueSchema;
141
141
  var V1StatementSchema = z.object({
142
142
  id: z.string().optional(),
143
+ label: z.string().optional(),
143
144
  effect: z.enum(["allow", "deny"]),
144
145
  permissions: z.array(z.string()).min(1),
145
146
  resources: z.array(z.string()).min(1),
@@ -147,6 +148,7 @@ var V1StatementSchema = z.object({
147
148
  }).strict();
148
149
  var V2StatementSchema = z.object({
149
150
  id: z.string().optional(),
151
+ label: z.string().optional(),
150
152
  effect: z.enum(["allow", "ask", "deny"]),
151
153
  permissions: z.array(z.string()).min(1),
152
154
  resources: z.array(z.string()).min(1),
@@ -181,7 +183,11 @@ function getOpenApiSchema() {
181
183
  properties: {
182
184
  id: {
183
185
  type: "string",
184
- description: "Optional identifier for debugging and provenance. Included in canonical hash."
186
+ description: "Optional identifier for debugging and provenance. Included in statementHash for override targeting."
187
+ },
188
+ label: {
189
+ type: "string",
190
+ description: "Optional human-readable description of the statement. Excluded from statementHash for override targeting."
185
191
  },
186
192
  effect: {
187
193
  type: "string",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/policy-schema",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "description": "Zod schemas and TypeScript types for the Zapier policy engine",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",