@cedar-policy/cedar-wasm 4.3.0 → 4.3.3

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.
@@ -245,6 +245,37 @@ export type CommonTypeId = string;
245
245
 
246
246
  export type SchemaJson<N> = Record<string, NamespaceDefinition<N>>;
247
247
 
248
+ export type Clause = { kind: "when"; body: Expr } | { kind: "unless"; body: Expr };
249
+
250
+ export interface PolicyJson {
251
+ effect: Effect;
252
+ principal: PrincipalConstraint;
253
+ action: ActionConstraint;
254
+ resource: ResourceConstraint;
255
+ conditions: Clause[];
256
+ annotations?: Annotations;
257
+ }
258
+
259
+ export type ExtFuncCall = {} & Record<string, Array<Expr>>;
260
+
261
+ export type ExprNoExt = { Value: CedarValueJson } | { Var: Var } | { Slot: 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 } } | { isEmpty: { arg: Expr } } | { getTag: { left: Expr; right: Expr } } | { hasTag: { left: Expr; right: Expr } } | { ".": { left: Expr; attr: SmolStr } } | { has: { left: Expr; attr: SmolStr } } | { like: { left: Expr; pattern: PatternElem[] } } | { is: { left: Expr; entity_type: SmolStr; in?: Expr } } | { "if-then-else": { if: Expr; then: Expr; else: Expr } } | { Set: Expr[] } | { Record: Record<string, Expr> };
262
+
263
+ export type PatternElem = "Wildcard" | { Literal: SmolStr };
264
+
265
+ export type Expr = ExprNoExt | ExtFuncCall;
266
+
267
+ export type AnyId = SmolStr;
268
+
269
+ export type UnreservedId = string;
270
+
271
+ export type Effect = "permit" | "forbid";
272
+
273
+ export type Annotations = Record<string, Annotation>;
274
+
275
+ export type Decision = "allow" | "deny";
276
+
277
+ export type Annotation = SmolStr;
278
+
248
279
  export type ActionInConstraint = { entity: EntityUidJson } | { entities: EntityUidJson[] };
249
280
 
250
281
  export interface PrincipalOrResourceIsConstraint {
@@ -278,8 +309,6 @@ export interface TypeAndId {
278
309
 
279
310
  export type CedarValueJson = { __entity: TypeAndId } | { __extn: FnAndArg } | boolean | number | string | CedarValueJson[] | { [key: string]: CedarValueJson } | null;
280
311
 
281
- export type Annotations = Record<string, Annotation>;
282
-
283
312
  export interface EntityJson {
284
313
  uid: EntityUidJson;
285
314
  attrs: Record<string, CedarValueJson>;
@@ -287,35 +316,6 @@ export interface EntityJson {
287
316
  tags?: Record<string, CedarValueJson>;
288
317
  }
289
318
 
290
- export type Decision = "allow" | "deny";
291
-
292
- export type Annotation = SmolStr;
293
-
294
- export type Clause = { kind: "when"; body: Expr } | { kind: "unless"; body: Expr };
295
-
296
- export interface PolicyJson {
297
- effect: Effect;
298
- principal: PrincipalConstraint;
299
- action: ActionConstraint;
300
- resource: ResourceConstraint;
301
- conditions: Clause[];
302
- annotations?: Annotations;
303
- }
304
-
305
- export type ExtFuncCall = {} & Record<string, Array<Expr>>;
306
-
307
- export type ExprNoExt = { Value: CedarValueJson } | { Var: Var } | { Slot: 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 } } | { isEmpty: { arg: Expr } } | { getTag: { left: Expr; right: Expr } } | { hasTag: { left: Expr; right: Expr } } | { ".": { left: Expr; attr: SmolStr } } | { has: { left: Expr; attr: SmolStr } } | { like: { left: Expr; pattern: PatternElem[] } } | { is: { left: Expr; entity_type: SmolStr; in?: Expr } } | { "if-then-else": { if: Expr; then: Expr; else: Expr } } | { Set: Expr[] } | { Record: Record<string, Expr> };
308
-
309
- export type PatternElem = "Wildcard" | { Literal: SmolStr };
310
-
311
- export type Expr = ExprNoExt | ExtFuncCall;
312
-
313
- export type AnyId = SmolStr;
314
-
315
- export type UnreservedId = string;
316
-
317
- export type Effect = "permit" | "forbid";
318
-
319
319
  type SmolStr = string;
320
320
  export type TypeOfAttribute<N> = Type<N> & { required?: boolean };
321
321
  export type CommonType<N> = Type<N> & { annotations?: Annotations };
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": "4.3.0",
4
+ "version": "4.3.3",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
7
7
  "cedar_wasm_bg.wasm",
@@ -245,6 +245,37 @@ export type CommonTypeId = string;
245
245
 
246
246
  export type SchemaJson<N> = Record<string, NamespaceDefinition<N>>;
247
247
 
248
+ export type Clause = { kind: "when"; body: Expr } | { kind: "unless"; body: Expr };
249
+
250
+ export interface PolicyJson {
251
+ effect: Effect;
252
+ principal: PrincipalConstraint;
253
+ action: ActionConstraint;
254
+ resource: ResourceConstraint;
255
+ conditions: Clause[];
256
+ annotations?: Annotations;
257
+ }
258
+
259
+ export type ExtFuncCall = {} & Record<string, Array<Expr>>;
260
+
261
+ export type ExprNoExt = { Value: CedarValueJson } | { Var: Var } | { Slot: 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 } } | { isEmpty: { arg: Expr } } | { getTag: { left: Expr; right: Expr } } | { hasTag: { left: Expr; right: Expr } } | { ".": { left: Expr; attr: SmolStr } } | { has: { left: Expr; attr: SmolStr } } | { like: { left: Expr; pattern: PatternElem[] } } | { is: { left: Expr; entity_type: SmolStr; in?: Expr } } | { "if-then-else": { if: Expr; then: Expr; else: Expr } } | { Set: Expr[] } | { Record: Record<string, Expr> };
262
+
263
+ export type PatternElem = "Wildcard" | { Literal: SmolStr };
264
+
265
+ export type Expr = ExprNoExt | ExtFuncCall;
266
+
267
+ export type AnyId = SmolStr;
268
+
269
+ export type UnreservedId = string;
270
+
271
+ export type Effect = "permit" | "forbid";
272
+
273
+ export type Annotations = Record<string, Annotation>;
274
+
275
+ export type Decision = "allow" | "deny";
276
+
277
+ export type Annotation = SmolStr;
278
+
248
279
  export type ActionInConstraint = { entity: EntityUidJson } | { entities: EntityUidJson[] };
249
280
 
250
281
  export interface PrincipalOrResourceIsConstraint {
@@ -278,8 +309,6 @@ export interface TypeAndId {
278
309
 
279
310
  export type CedarValueJson = { __entity: TypeAndId } | { __extn: FnAndArg } | boolean | number | string | CedarValueJson[] | { [key: string]: CedarValueJson } | null;
280
311
 
281
- export type Annotations = Record<string, Annotation>;
282
-
283
312
  export interface EntityJson {
284
313
  uid: EntityUidJson;
285
314
  attrs: Record<string, CedarValueJson>;
@@ -287,35 +316,6 @@ export interface EntityJson {
287
316
  tags?: Record<string, CedarValueJson>;
288
317
  }
289
318
 
290
- export type Decision = "allow" | "deny";
291
-
292
- export type Annotation = SmolStr;
293
-
294
- export type Clause = { kind: "when"; body: Expr } | { kind: "unless"; body: Expr };
295
-
296
- export interface PolicyJson {
297
- effect: Effect;
298
- principal: PrincipalConstraint;
299
- action: ActionConstraint;
300
- resource: ResourceConstraint;
301
- conditions: Clause[];
302
- annotations?: Annotations;
303
- }
304
-
305
- export type ExtFuncCall = {} & Record<string, Array<Expr>>;
306
-
307
- export type ExprNoExt = { Value: CedarValueJson } | { Var: Var } | { Slot: 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 } } | { isEmpty: { arg: Expr } } | { getTag: { left: Expr; right: Expr } } | { hasTag: { left: Expr; right: Expr } } | { ".": { left: Expr; attr: SmolStr } } | { has: { left: Expr; attr: SmolStr } } | { like: { left: Expr; pattern: PatternElem[] } } | { is: { left: Expr; entity_type: SmolStr; in?: Expr } } | { "if-then-else": { if: Expr; then: Expr; else: Expr } } | { Set: Expr[] } | { Record: Record<string, Expr> };
308
-
309
- export type PatternElem = "Wildcard" | { Literal: SmolStr };
310
-
311
- export type Expr = ExprNoExt | ExtFuncCall;
312
-
313
- export type AnyId = SmolStr;
314
-
315
- export type UnreservedId = string;
316
-
317
- export type Effect = "permit" | "forbid";
318
-
319
319
  type SmolStr = string;
320
320
  export type TypeOfAttribute<N> = Type<N> & { required?: boolean };
321
321
  export type CommonType<N> = Type<N> & { annotations?: Annotations };
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": "4.3.0",
4
+ "version": "4.3.3",
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": "4.3.0",
4
+ "version": "4.3.3",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
7
7
  "esm/package.json",
@@ -245,6 +245,37 @@ export type CommonTypeId = string;
245
245
 
246
246
  export type SchemaJson<N> = Record<string, NamespaceDefinition<N>>;
247
247
 
248
+ export type Clause = { kind: "when"; body: Expr } | { kind: "unless"; body: Expr };
249
+
250
+ export interface PolicyJson {
251
+ effect: Effect;
252
+ principal: PrincipalConstraint;
253
+ action: ActionConstraint;
254
+ resource: ResourceConstraint;
255
+ conditions: Clause[];
256
+ annotations?: Annotations;
257
+ }
258
+
259
+ export type ExtFuncCall = {} & Record<string, Array<Expr>>;
260
+
261
+ export type ExprNoExt = { Value: CedarValueJson } | { Var: Var } | { Slot: 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 } } | { isEmpty: { arg: Expr } } | { getTag: { left: Expr; right: Expr } } | { hasTag: { left: Expr; right: Expr } } | { ".": { left: Expr; attr: SmolStr } } | { has: { left: Expr; attr: SmolStr } } | { like: { left: Expr; pattern: PatternElem[] } } | { is: { left: Expr; entity_type: SmolStr; in?: Expr } } | { "if-then-else": { if: Expr; then: Expr; else: Expr } } | { Set: Expr[] } | { Record: Record<string, Expr> };
262
+
263
+ export type PatternElem = "Wildcard" | { Literal: SmolStr };
264
+
265
+ export type Expr = ExprNoExt | ExtFuncCall;
266
+
267
+ export type AnyId = SmolStr;
268
+
269
+ export type UnreservedId = string;
270
+
271
+ export type Effect = "permit" | "forbid";
272
+
273
+ export type Annotations = Record<string, Annotation>;
274
+
275
+ export type Decision = "allow" | "deny";
276
+
277
+ export type Annotation = SmolStr;
278
+
248
279
  export type ActionInConstraint = { entity: EntityUidJson } | { entities: EntityUidJson[] };
249
280
 
250
281
  export interface PrincipalOrResourceIsConstraint {
@@ -278,8 +309,6 @@ export interface TypeAndId {
278
309
 
279
310
  export type CedarValueJson = { __entity: TypeAndId } | { __extn: FnAndArg } | boolean | number | string | CedarValueJson[] | { [key: string]: CedarValueJson } | null;
280
311
 
281
- export type Annotations = Record<string, Annotation>;
282
-
283
312
  export interface EntityJson {
284
313
  uid: EntityUidJson;
285
314
  attrs: Record<string, CedarValueJson>;
@@ -287,35 +316,6 @@ export interface EntityJson {
287
316
  tags?: Record<string, CedarValueJson>;
288
317
  }
289
318
 
290
- export type Decision = "allow" | "deny";
291
-
292
- export type Annotation = SmolStr;
293
-
294
- export type Clause = { kind: "when"; body: Expr } | { kind: "unless"; body: Expr };
295
-
296
- export interface PolicyJson {
297
- effect: Effect;
298
- principal: PrincipalConstraint;
299
- action: ActionConstraint;
300
- resource: ResourceConstraint;
301
- conditions: Clause[];
302
- annotations?: Annotations;
303
- }
304
-
305
- export type ExtFuncCall = {} & Record<string, Array<Expr>>;
306
-
307
- export type ExprNoExt = { Value: CedarValueJson } | { Var: Var } | { Slot: 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 } } | { isEmpty: { arg: Expr } } | { getTag: { left: Expr; right: Expr } } | { hasTag: { left: Expr; right: Expr } } | { ".": { left: Expr; attr: SmolStr } } | { has: { left: Expr; attr: SmolStr } } | { like: { left: Expr; pattern: PatternElem[] } } | { is: { left: Expr; entity_type: SmolStr; in?: Expr } } | { "if-then-else": { if: Expr; then: Expr; else: Expr } } | { Set: Expr[] } | { Record: Record<string, Expr> };
308
-
309
- export type PatternElem = "Wildcard" | { Literal: SmolStr };
310
-
311
- export type Expr = ExprNoExt | ExtFuncCall;
312
-
313
- export type AnyId = SmolStr;
314
-
315
- export type UnreservedId = string;
316
-
317
- export type Effect = "permit" | "forbid";
318
-
319
319
 
320
320
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
321
321
 
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": "4.3.0",
4
+ "version": "4.3.3",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
7
7
  "cedar_wasm_bg.wasm",