@cedar-policy/cedar-wasm 3.2.3 → 3.2.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.
@@ -71,6 +71,31 @@ export type FormattingResult = { type: "success"; formatted_policy: string } | {
71
71
 
72
72
  export type CheckParseResult = { type: "success" } | { type: "error"; errors: string[] };
73
73
 
74
+ export type Schema = { human: string } | { json: SchemaJson };
75
+
76
+ export type PolicySet = string | Record<string, string>;
77
+
78
+ export interface SourceLocation {
79
+ start: number;
80
+ end: number;
81
+ }
82
+
83
+ export interface SourceLabel extends SourceLocation {
84
+ label: string | null;
85
+ }
86
+
87
+ export type Severity = "advice" | "warning" | "error";
88
+
89
+ export interface DetailedError {
90
+ message: string;
91
+ help: string | null;
92
+ code: string | null;
93
+ url: string | null;
94
+ severity: Severity | null;
95
+ sourceLocations?: SourceLabel[];
96
+ related?: DetailedError[];
97
+ }
98
+
74
99
  export type ValidationAnswer = { type: "failure"; errors: DetailedError[]; warnings: DetailedError[] } | { type: "success"; validationErrors: ValidationError[]; validationWarnings: ValidationError[]; otherWarnings: DetailedError[] };
75
100
 
76
101
  export interface ValidationError {
@@ -142,31 +167,6 @@ export interface Response {
142
167
  diagnostics: Diagnostics;
143
168
  }
144
169
 
145
- export type Schema = { human: string } | { json: SchemaJson };
146
-
147
- export type PolicySet = string | Record<string, string>;
148
-
149
- export interface SourceLocation {
150
- start: number;
151
- end: number;
152
- }
153
-
154
- export interface SourceLabel extends SourceLocation {
155
- label: string | null;
156
- }
157
-
158
- export type Severity = "advice" | "warning" | "error";
159
-
160
- export interface DetailedError {
161
- message: string;
162
- help: string | null;
163
- code: string | null;
164
- url: string | null;
165
- severity: Severity | null;
166
- sourceLocations?: SourceLabel[];
167
- related?: DetailedError[];
168
- }
169
-
170
170
  export type SchemaTypeVariant = { type: "String" } | { type: "Long" } | { type: "Boolean" } | { type: "Set"; element: SchemaType } | { type: "Record"; attributes: Record<SmolStr, TypeOfAttribute>; additionalAttributes: boolean } | { type: "Entity"; name: Name } | { type: "Extension"; name: Id };
171
171
 
172
172
  export type SchemaType = SchemaTypeVariant | { type: Name };
@@ -239,6 +239,12 @@ export interface Policy {
239
239
 
240
240
  export type Effect = "permit" | "forbid";
241
241
 
242
+ export type ExtFuncCall = {} & Record<string, Array<Expr>>;
243
+
244
+ export type ExprNoExt = { Value: CedarValueJson } | { Var: Var } | { Slot: string } | { Unknown: { name: string } } | { "!": { arg: Expr } } | { neg: { arg: Expr } } | { "==": { left: Expr; right: Expr } } | { "!=": { left: Expr; right: Expr } } | { in: { left: Expr; right: Expr } } | { "<": { left: Expr; right: Expr } } | { "<=": { left: Expr; right: Expr } } | { ">": { left: Expr; right: Expr } } | { ">=": { left: Expr; right: Expr } } | { "&&": { left: Expr; right: Expr } } | { "||": { left: Expr; right: Expr } } | { "+": { left: Expr; right: Expr } } | { "-": { left: Expr; right: Expr } } | { "*": { left: Expr; right: Expr } } | { contains: { left: Expr; right: Expr } } | { containsAll: { left: Expr; right: Expr } } | { containsAny: { left: Expr; right: Expr } } | { ".": { left: Expr; attr: SmolStr } } | { has: { left: Expr; attr: SmolStr } } | { like: { left: Expr; pattern: SmolStr } } | { is: { left: Expr; entity_type: SmolStr; in?: Expr } } | { "if-then-else": { if: Expr; then: Expr; else: Expr } } | { Set: Expr[] } | { Record: Record<string, Expr> };
245
+
246
+ export type Expr = ExprNoExt | ExtFuncCall;
247
+
242
248
  export type EntityUidJson = { __expr: string } | { __entity: TypeAndId } | TypeAndId;
243
249
 
244
250
  export interface FnAndArg {
@@ -255,12 +261,6 @@ export type CedarValueJson = { __expr: string } | { __entity: TypeAndId } | { __
255
261
 
256
262
  export type Decision = "Allow" | "Deny";
257
263
 
258
- export type ExtFuncCall = {} & Record<string, Array<Expr>>;
259
-
260
- export type ExprNoExt = { Value: CedarValueJson } | { Var: Var } | { Slot: string } | { Unknown: { name: string } } | { "!": { arg: Expr } } | { neg: { arg: Expr } } | { "==": { left: Expr; right: Expr } } | { "!=": { left: Expr; right: Expr } } | { in: { left: Expr; right: Expr } } | { "<": { left: Expr; right: Expr } } | { "<=": { left: Expr; right: Expr } } | { ">": { left: Expr; right: Expr } } | { ">=": { left: Expr; right: Expr } } | { "&&": { left: Expr; right: Expr } } | { "||": { left: Expr; right: Expr } } | { "+": { left: Expr; right: Expr } } | { "-": { left: Expr; right: Expr } } | { "*": { left: Expr; right: Expr } } | { contains: { left: Expr; right: Expr } } | { containsAll: { left: Expr; right: Expr } } | { containsAny: { left: Expr; right: Expr } } | { ".": { left: Expr; attr: SmolStr } } | { has: { left: Expr; attr: SmolStr } } | { like: { left: Expr; pattern: SmolStr } } | { is: { left: Expr; entity_type: SmolStr; in?: Expr } } | { "if-then-else": { if: Expr; then: Expr; else: Expr } } | { Set: Expr[] } | { Record: Record<string, Expr> };
261
-
262
- export type Expr = ExprNoExt | ExtFuncCall;
263
-
264
264
  export type Var = "principal" | "action" | "resource" | "context";
265
265
 
266
266
  type SmolStr = string;
Binary file
package/esm/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cedar-policy/cedar-wasm",
3
3
  "description": "Wasm bindings and typescript types for Cedar lib",
4
- "version": "3.2.3",
4
+ "version": "3.2.4",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
7
7
  "cedar_wasm_bg.wasm",
@@ -71,6 +71,31 @@ export type FormattingResult = { type: "success"; formatted_policy: string } | {
71
71
 
72
72
  export type CheckParseResult = { type: "success" } | { type: "error"; errors: string[] };
73
73
 
74
+ export type Schema = { human: string } | { json: SchemaJson };
75
+
76
+ export type PolicySet = string | Record<string, string>;
77
+
78
+ export interface SourceLocation {
79
+ start: number;
80
+ end: number;
81
+ }
82
+
83
+ export interface SourceLabel extends SourceLocation {
84
+ label: string | null;
85
+ }
86
+
87
+ export type Severity = "advice" | "warning" | "error";
88
+
89
+ export interface DetailedError {
90
+ message: string;
91
+ help: string | null;
92
+ code: string | null;
93
+ url: string | null;
94
+ severity: Severity | null;
95
+ sourceLocations?: SourceLabel[];
96
+ related?: DetailedError[];
97
+ }
98
+
74
99
  export type ValidationAnswer = { type: "failure"; errors: DetailedError[]; warnings: DetailedError[] } | { type: "success"; validationErrors: ValidationError[]; validationWarnings: ValidationError[]; otherWarnings: DetailedError[] };
75
100
 
76
101
  export interface ValidationError {
@@ -142,31 +167,6 @@ export interface Response {
142
167
  diagnostics: Diagnostics;
143
168
  }
144
169
 
145
- export type Schema = { human: string } | { json: SchemaJson };
146
-
147
- export type PolicySet = string | Record<string, string>;
148
-
149
- export interface SourceLocation {
150
- start: number;
151
- end: number;
152
- }
153
-
154
- export interface SourceLabel extends SourceLocation {
155
- label: string | null;
156
- }
157
-
158
- export type Severity = "advice" | "warning" | "error";
159
-
160
- export interface DetailedError {
161
- message: string;
162
- help: string | null;
163
- code: string | null;
164
- url: string | null;
165
- severity: Severity | null;
166
- sourceLocations?: SourceLabel[];
167
- related?: DetailedError[];
168
- }
169
-
170
170
  export type SchemaTypeVariant = { type: "String" } | { type: "Long" } | { type: "Boolean" } | { type: "Set"; element: SchemaType } | { type: "Record"; attributes: Record<SmolStr, TypeOfAttribute>; additionalAttributes: boolean } | { type: "Entity"; name: Name } | { type: "Extension"; name: Id };
171
171
 
172
172
  export type SchemaType = SchemaTypeVariant | { type: Name };
@@ -239,6 +239,12 @@ export interface Policy {
239
239
 
240
240
  export type Effect = "permit" | "forbid";
241
241
 
242
+ export type ExtFuncCall = {} & Record<string, Array<Expr>>;
243
+
244
+ export type ExprNoExt = { Value: CedarValueJson } | { Var: Var } | { Slot: string } | { Unknown: { name: string } } | { "!": { arg: Expr } } | { neg: { arg: Expr } } | { "==": { left: Expr; right: Expr } } | { "!=": { left: Expr; right: Expr } } | { in: { left: Expr; right: Expr } } | { "<": { left: Expr; right: Expr } } | { "<=": { left: Expr; right: Expr } } | { ">": { left: Expr; right: Expr } } | { ">=": { left: Expr; right: Expr } } | { "&&": { left: Expr; right: Expr } } | { "||": { left: Expr; right: Expr } } | { "+": { left: Expr; right: Expr } } | { "-": { left: Expr; right: Expr } } | { "*": { left: Expr; right: Expr } } | { contains: { left: Expr; right: Expr } } | { containsAll: { left: Expr; right: Expr } } | { containsAny: { left: Expr; right: Expr } } | { ".": { left: Expr; attr: SmolStr } } | { has: { left: Expr; attr: SmolStr } } | { like: { left: Expr; pattern: SmolStr } } | { is: { left: Expr; entity_type: SmolStr; in?: Expr } } | { "if-then-else": { if: Expr; then: Expr; else: Expr } } | { Set: Expr[] } | { Record: Record<string, Expr> };
245
+
246
+ export type Expr = ExprNoExt | ExtFuncCall;
247
+
242
248
  export type EntityUidJson = { __expr: string } | { __entity: TypeAndId } | TypeAndId;
243
249
 
244
250
  export interface FnAndArg {
@@ -255,12 +261,6 @@ export type CedarValueJson = { __expr: string } | { __entity: TypeAndId } | { __
255
261
 
256
262
  export type Decision = "Allow" | "Deny";
257
263
 
258
- export type ExtFuncCall = {} & Record<string, Array<Expr>>;
259
-
260
- export type ExprNoExt = { Value: CedarValueJson } | { Var: Var } | { Slot: string } | { Unknown: { name: string } } | { "!": { arg: Expr } } | { neg: { arg: Expr } } | { "==": { left: Expr; right: Expr } } | { "!=": { left: Expr; right: Expr } } | { in: { left: Expr; right: Expr } } | { "<": { left: Expr; right: Expr } } | { "<=": { left: Expr; right: Expr } } | { ">": { left: Expr; right: Expr } } | { ">=": { left: Expr; right: Expr } } | { "&&": { left: Expr; right: Expr } } | { "||": { left: Expr; right: Expr } } | { "+": { left: Expr; right: Expr } } | { "-": { left: Expr; right: Expr } } | { "*": { left: Expr; right: Expr } } | { contains: { left: Expr; right: Expr } } | { containsAll: { left: Expr; right: Expr } } | { containsAny: { left: Expr; right: Expr } } | { ".": { left: Expr; attr: SmolStr } } | { has: { left: Expr; attr: SmolStr } } | { like: { left: Expr; pattern: SmolStr } } | { is: { left: Expr; entity_type: SmolStr; in?: Expr } } | { "if-then-else": { if: Expr; then: Expr; else: Expr } } | { Set: Expr[] } | { Record: Record<string, Expr> };
261
-
262
- export type Expr = ExprNoExt | ExtFuncCall;
263
-
264
264
  export type Var = "principal" | "action" | "resource" | "context";
265
265
 
266
266
  type SmolStr = string;
Binary file
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cedar-policy/cedar-wasm",
3
3
  "description": "Wasm bindings and typescript types for Cedar lib",
4
- "version": "3.2.3",
4
+ "version": "3.2.4",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
7
7
  "cedar_wasm_bg.wasm",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cedar-policy/cedar-wasm",
3
3
  "description": "Wasm bindings and typescript types for Cedar lib",
4
- "version": "3.2.3",
4
+ "version": "3.2.4",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
7
7
  "esm/package.json",
@@ -71,6 +71,31 @@ export type FormattingResult = { type: "success"; formatted_policy: string } | {
71
71
 
72
72
  export type CheckParseResult = { type: "success" } | { type: "error"; errors: string[] };
73
73
 
74
+ export type Schema = { human: string } | { json: SchemaJson };
75
+
76
+ export type PolicySet = string | Record<string, string>;
77
+
78
+ export interface SourceLocation {
79
+ start: number;
80
+ end: number;
81
+ }
82
+
83
+ export interface SourceLabel extends SourceLocation {
84
+ label: string | null;
85
+ }
86
+
87
+ export type Severity = "advice" | "warning" | "error";
88
+
89
+ export interface DetailedError {
90
+ message: string;
91
+ help: string | null;
92
+ code: string | null;
93
+ url: string | null;
94
+ severity: Severity | null;
95
+ sourceLocations?: SourceLabel[];
96
+ related?: DetailedError[];
97
+ }
98
+
74
99
  export type ValidationAnswer = { type: "failure"; errors: DetailedError[]; warnings: DetailedError[] } | { type: "success"; validationErrors: ValidationError[]; validationWarnings: ValidationError[]; otherWarnings: DetailedError[] };
75
100
 
76
101
  export interface ValidationError {
@@ -142,31 +167,6 @@ export interface Response {
142
167
  diagnostics: Diagnostics;
143
168
  }
144
169
 
145
- export type Schema = { human: string } | { json: SchemaJson };
146
-
147
- export type PolicySet = string | Record<string, string>;
148
-
149
- export interface SourceLocation {
150
- start: number;
151
- end: number;
152
- }
153
-
154
- export interface SourceLabel extends SourceLocation {
155
- label: string | null;
156
- }
157
-
158
- export type Severity = "advice" | "warning" | "error";
159
-
160
- export interface DetailedError {
161
- message: string;
162
- help: string | null;
163
- code: string | null;
164
- url: string | null;
165
- severity: Severity | null;
166
- sourceLocations?: SourceLabel[];
167
- related?: DetailedError[];
168
- }
169
-
170
170
  export type SchemaTypeVariant = { type: "String" } | { type: "Long" } | { type: "Boolean" } | { type: "Set"; element: SchemaType } | { type: "Record"; attributes: Record<SmolStr, TypeOfAttribute>; additionalAttributes: boolean } | { type: "Entity"; name: Name } | { type: "Extension"; name: Id };
171
171
 
172
172
  export type SchemaType = SchemaTypeVariant | { type: Name };
@@ -239,6 +239,12 @@ export interface Policy {
239
239
 
240
240
  export type Effect = "permit" | "forbid";
241
241
 
242
+ export type ExtFuncCall = {} & Record<string, Array<Expr>>;
243
+
244
+ export type ExprNoExt = { Value: CedarValueJson } | { Var: Var } | { Slot: string } | { Unknown: { name: string } } | { "!": { arg: Expr } } | { neg: { arg: Expr } } | { "==": { left: Expr; right: Expr } } | { "!=": { left: Expr; right: Expr } } | { in: { left: Expr; right: Expr } } | { "<": { left: Expr; right: Expr } } | { "<=": { left: Expr; right: Expr } } | { ">": { left: Expr; right: Expr } } | { ">=": { left: Expr; right: Expr } } | { "&&": { left: Expr; right: Expr } } | { "||": { left: Expr; right: Expr } } | { "+": { left: Expr; right: Expr } } | { "-": { left: Expr; right: Expr } } | { "*": { left: Expr; right: Expr } } | { contains: { left: Expr; right: Expr } } | { containsAll: { left: Expr; right: Expr } } | { containsAny: { left: Expr; right: Expr } } | { ".": { left: Expr; attr: SmolStr } } | { has: { left: Expr; attr: SmolStr } } | { like: { left: Expr; pattern: SmolStr } } | { is: { left: Expr; entity_type: SmolStr; in?: Expr } } | { "if-then-else": { if: Expr; then: Expr; else: Expr } } | { Set: Expr[] } | { Record: Record<string, Expr> };
245
+
246
+ export type Expr = ExprNoExt | ExtFuncCall;
247
+
242
248
  export type EntityUidJson = { __expr: string } | { __entity: TypeAndId } | TypeAndId;
243
249
 
244
250
  export interface FnAndArg {
@@ -255,12 +261,6 @@ export type CedarValueJson = { __expr: string } | { __entity: TypeAndId } | { __
255
261
 
256
262
  export type Decision = "Allow" | "Deny";
257
263
 
258
- export type ExtFuncCall = {} & Record<string, Array<Expr>>;
259
-
260
- export type ExprNoExt = { Value: CedarValueJson } | { Var: Var } | { Slot: string } | { Unknown: { name: string } } | { "!": { arg: Expr } } | { neg: { arg: Expr } } | { "==": { left: Expr; right: Expr } } | { "!=": { left: Expr; right: Expr } } | { in: { left: Expr; right: Expr } } | { "<": { left: Expr; right: Expr } } | { "<=": { left: Expr; right: Expr } } | { ">": { left: Expr; right: Expr } } | { ">=": { left: Expr; right: Expr } } | { "&&": { left: Expr; right: Expr } } | { "||": { left: Expr; right: Expr } } | { "+": { left: Expr; right: Expr } } | { "-": { left: Expr; right: Expr } } | { "*": { left: Expr; right: Expr } } | { contains: { left: Expr; right: Expr } } | { containsAll: { left: Expr; right: Expr } } | { containsAny: { left: Expr; right: Expr } } | { ".": { left: Expr; attr: SmolStr } } | { has: { left: Expr; attr: SmolStr } } | { like: { left: Expr; pattern: SmolStr } } | { is: { left: Expr; entity_type: SmolStr; in?: Expr } } | { "if-then-else": { if: Expr; then: Expr; else: Expr } } | { Set: Expr[] } | { Record: Record<string, Expr> };
261
-
262
- export type Expr = ExprNoExt | ExtFuncCall;
263
-
264
264
  export type Var = "principal" | "action" | "resource" | "context";
265
265
 
266
266
 
Binary file
package/web/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cedar-policy/cedar-wasm",
3
3
  "description": "Wasm bindings and typescript types for Cedar lib",
4
- "version": "3.2.3",
4
+ "version": "3.2.4",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
7
7
  "cedar_wasm_bg.wasm",