@cedar-policy/cedar-wasm 3.4.0 → 3.4.1

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.
@@ -21,6 +21,13 @@ export function checkParsePolicySet(input_policies_str: string): CheckParsePolic
21
21
  */
22
22
  export function checkParseTemplate(template_str: string): CheckParseTemplateResult;
23
23
  /**
24
+ * @param {string} policies_str
25
+ * @param {number} line_width
26
+ * @param {number} indent_width
27
+ * @returns {FormattingResult}
28
+ */
29
+ export function formatPolicies(policies_str: string, line_width: number, indent_width: number): FormattingResult;
30
+ /**
24
31
  * @param {string} input_schema
25
32
  * @returns {CheckParseResult}
26
33
  */
@@ -39,12 +46,10 @@ export function checkParseEntities(entities_str: string, schema_str: string): Ch
39
46
  */
40
47
  export function checkParseContext(context_str: string, action_str: string, schema_str: string): CheckParseResult;
41
48
  /**
42
- * @param {string} policies_str
43
- * @param {number} line_width
44
- * @param {number} indent_width
45
- * @returns {FormattingResult}
49
+ * @param {AuthorizationCall} call
50
+ * @returns {AuthorizationAnswer}
46
51
  */
47
- export function formatPolicies(policies_str: string, line_width: number, indent_width: number): FormattingResult;
52
+ export function isAuthorized(call: AuthorizationCall): AuthorizationAnswer;
48
53
  /**
49
54
  * @param {ValidationCall} call
50
55
  * @returns {ValidationAnswer}
@@ -54,11 +59,6 @@ export function validate(call: ValidationCall): ValidationAnswer;
54
59
  * @returns {string}
55
60
  */
56
61
  export function getCedarVersion(): string;
57
- /**
58
- * @param {AuthorizationCall} call
59
- * @returns {AuthorizationAnswer}
60
- */
61
- export function isAuthorized(call: AuthorizationCall): AuthorizationAnswer;
62
62
  export type JsonToPolicyResult = { type: "success"; policyText: string } | { type: "error"; errors: string[] };
63
63
 
64
64
  export type PolicyToJsonResult = { type: "success"; policy: Policy } | { type: "error"; errors: string[] };
@@ -67,28 +67,9 @@ export type CheckParsePolicySetResult = { type: "success"; policies: number; tem
67
67
 
68
68
  export type CheckParseTemplateResult = { type: "success"; slots: string[] } | { type: "error"; errors: string[] };
69
69
 
70
- export type CheckParseResult = { type: "success" } | { type: "error"; errors: string[] };
71
-
72
70
  export type FormattingResult = { type: "success"; formatted_policy: string } | { type: "error"; errors: string[] };
73
71
 
74
- export type ValidationAnswer = { type: "failure"; errors: DetailedError[]; warnings: DetailedError[] } | { type: "success"; validationErrors: ValidationError[]; validationWarnings: ValidationError[]; otherWarnings: DetailedError[] };
75
-
76
- export interface ValidationError {
77
- policyId: SmolStr;
78
- error: DetailedError;
79
- }
80
-
81
- export type ValidationEnabled = "on" | "off";
82
-
83
- export interface ValidationSettings {
84
- enabled: ValidationEnabled;
85
- }
86
-
87
- export interface ValidationCall {
88
- validationSettings?: ValidationSettings;
89
- schema: Schema;
90
- policySet: PolicySet;
91
- }
72
+ export type CheckParseResult = { type: "success" } | { type: "error"; errors: string[] };
92
73
 
93
74
  export interface RecvdSlice {
94
75
  policies: PolicySet;
@@ -142,6 +123,25 @@ export interface Response {
142
123
  diagnostics: Diagnostics;
143
124
  }
144
125
 
126
+ export type ValidationAnswer = { type: "failure"; errors: DetailedError[]; warnings: DetailedError[] } | { type: "success"; validationErrors: ValidationError[]; validationWarnings: ValidationError[]; otherWarnings: DetailedError[] };
127
+
128
+ export interface ValidationError {
129
+ policyId: SmolStr;
130
+ error: DetailedError;
131
+ }
132
+
133
+ export type ValidationEnabled = "on" | "off";
134
+
135
+ export interface ValidationSettings {
136
+ enabled: ValidationEnabled;
137
+ }
138
+
139
+ export interface ValidationCall {
140
+ validationSettings?: ValidationSettings;
141
+ schema: Schema;
142
+ policySet: PolicySet;
143
+ }
144
+
145
145
  export type Schema = { human: string } | { json: SchemaJson };
146
146
 
147
147
  export type PolicySet = string | Record<string, string>;
package/esm/cedar_wasm.js CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  import * as wasm from "./cedar_wasm_bg.wasm";
2
3
  import { __wbg_set_wasm } from "./cedar_wasm_bg.js";
3
4
  __wbg_set_wasm(wasm);
@@ -35,13 +35,13 @@ function takeObject(idx) {
35
35
 
36
36
  let WASM_VECTOR_LEN = 0;
37
37
 
38
- let cachedUint8Memory0 = null;
38
+ let cachedUint8ArrayMemory0 = null;
39
39
 
40
- function getUint8Memory0() {
41
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
42
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
40
+ function getUint8ArrayMemory0() {
41
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
42
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
43
43
  }
44
- return cachedUint8Memory0;
44
+ return cachedUint8ArrayMemory0;
45
45
  }
46
46
 
47
47
  const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
@@ -66,7 +66,7 @@ function passStringToWasm0(arg, malloc, realloc) {
66
66
  if (realloc === undefined) {
67
67
  const buf = cachedTextEncoder.encode(arg);
68
68
  const ptr = malloc(buf.length, 1) >>> 0;
69
- getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
69
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
70
70
  WASM_VECTOR_LEN = buf.length;
71
71
  return ptr;
72
72
  }
@@ -74,7 +74,7 @@ function passStringToWasm0(arg, malloc, realloc) {
74
74
  let len = arg.length;
75
75
  let ptr = malloc(len, 1) >>> 0;
76
76
 
77
- const mem = getUint8Memory0();
77
+ const mem = getUint8ArrayMemory0();
78
78
 
79
79
  let offset = 0;
80
80
 
@@ -89,7 +89,7 @@ function passStringToWasm0(arg, malloc, realloc) {
89
89
  arg = arg.slice(offset);
90
90
  }
91
91
  ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
92
- const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
92
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
93
93
  const ret = encodeString(arg, view);
94
94
 
95
95
  offset += ret.written;
@@ -104,13 +104,13 @@ function isLikeNone(x) {
104
104
  return x === undefined || x === null;
105
105
  }
106
106
 
107
- let cachedInt32Memory0 = null;
107
+ let cachedDataViewMemory0 = null;
108
108
 
109
- function getInt32Memory0() {
110
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
111
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
109
+ function getDataViewMemory0() {
110
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
111
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
112
112
  }
113
- return cachedInt32Memory0;
113
+ return cachedDataViewMemory0;
114
114
  }
115
115
 
116
116
  const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
@@ -121,7 +121,7 @@ cachedTextDecoder.decode();
121
121
 
122
122
  function getStringFromWasm0(ptr, len) {
123
123
  ptr = ptr >>> 0;
124
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
124
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
125
125
  }
126
126
  /**
127
127
  * @param {string} json_str
@@ -167,6 +167,19 @@ export function checkParseTemplate(template_str) {
167
167
  return takeObject(ret);
168
168
  }
169
169
 
170
+ /**
171
+ * @param {string} policies_str
172
+ * @param {number} line_width
173
+ * @param {number} indent_width
174
+ * @returns {FormattingResult}
175
+ */
176
+ export function formatPolicies(policies_str, line_width, indent_width) {
177
+ const ptr0 = passStringToWasm0(policies_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
178
+ const len0 = WASM_VECTOR_LEN;
179
+ const ret = wasm.formatPolicies(ptr0, len0, line_width, indent_width);
180
+ return takeObject(ret);
181
+ }
182
+
170
183
  /**
171
184
  * @param {string} input_schema
172
185
  * @returns {CheckParseResult}
@@ -210,15 +223,11 @@ export function checkParseContext(context_str, action_str, schema_str) {
210
223
  }
211
224
 
212
225
  /**
213
- * @param {string} policies_str
214
- * @param {number} line_width
215
- * @param {number} indent_width
216
- * @returns {FormattingResult}
226
+ * @param {AuthorizationCall} call
227
+ * @returns {AuthorizationAnswer}
217
228
  */
218
- export function formatPolicies(policies_str, line_width, indent_width) {
219
- const ptr0 = passStringToWasm0(policies_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
220
- const len0 = WASM_VECTOR_LEN;
221
- const ret = wasm.formatPolicies(ptr0, len0, line_width, indent_width);
229
+ export function isAuthorized(call) {
230
+ const ret = wasm.isAuthorized(addHeapObject(call));
222
231
  return takeObject(ret);
223
232
  }
224
233
 
@@ -240,8 +249,8 @@ export function getCedarVersion() {
240
249
  try {
241
250
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
242
251
  wasm.getCedarVersion(retptr);
243
- var r0 = getInt32Memory0()[retptr / 4 + 0];
244
- var r1 = getInt32Memory0()[retptr / 4 + 1];
252
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
253
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
245
254
  deferred1_0 = r0;
246
255
  deferred1_1 = r1;
247
256
  return getStringFromWasm0(r0, r1);
@@ -251,15 +260,6 @@ export function getCedarVersion() {
251
260
  }
252
261
  }
253
262
 
254
- /**
255
- * @param {AuthorizationCall} call
256
- * @returns {AuthorizationAnswer}
257
- */
258
- export function isAuthorized(call) {
259
- const ret = wasm.isAuthorized(addHeapObject(call));
260
- return takeObject(ret);
261
- }
262
-
263
263
  function handleError(f, args) {
264
264
  try {
265
265
  return f.apply(this, args);
@@ -287,16 +287,16 @@ export function __wbindgen_string_get(arg0, arg1) {
287
287
  const ret = typeof(obj) === 'string' ? obj : undefined;
288
288
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
289
289
  var len1 = WASM_VECTOR_LEN;
290
- getInt32Memory0()[arg0 / 4 + 1] = len1;
291
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
290
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
291
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
292
292
  };
293
293
 
294
- export function __wbg_parse_66d1801634e099ac() { return handleError(function (arg0, arg1) {
294
+ export function __wbg_parse_52202f117ec9ecfa() { return handleError(function (arg0, arg1) {
295
295
  const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
296
296
  return addHeapObject(ret);
297
297
  }, arguments) };
298
298
 
299
- export function __wbg_stringify_8887fe74e1c50d81() { return handleError(function (arg0) {
299
+ export function __wbg_stringify_bbf45426c92a6bf5() { return handleError(function (arg0) {
300
300
  const ret = JSON.stringify(getObject(arg0));
301
301
  return addHeapObject(ret);
302
302
  }, arguments) };
Binary file
@@ -5,13 +5,13 @@ export function policyTextFromJson(a: number, b: number): number;
5
5
  export function policyTextToJson(a: number, b: number): number;
6
6
  export function checkParsePolicySet(a: number, b: number): number;
7
7
  export function checkParseTemplate(a: number, b: number): number;
8
+ export function formatPolicies(a: number, b: number, c: number, d: number): number;
8
9
  export function checkParseSchema(a: number, b: number): number;
9
10
  export function checkParseEntities(a: number, b: number, c: number, d: number): number;
10
11
  export function checkParseContext(a: number, b: number, c: number, d: number, e: number, f: number): number;
11
- export function formatPolicies(a: number, b: number, c: number, d: number): number;
12
+ export function isAuthorized(a: number): number;
12
13
  export function validate(a: number): number;
13
14
  export function getCedarVersion(a: number): void;
14
- export function isAuthorized(a: number): number;
15
15
  export function __wbindgen_malloc(a: number, b: number): number;
16
16
  export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
17
17
  export function __wbindgen_add_to_stack_pointer(a: number): number;
package/esm/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@cedar-policy/cedar-wasm",
3
+ "type": "module",
3
4
  "description": "Wasm bindings and typescript types for Cedar lib",
4
- "version": "3.4.0",
5
+ "version": "3.4.1",
5
6
  "license": "Apache-2.0",
6
7
  "files": [
7
8
  "cedar_wasm_bg.wasm",
@@ -9,11 +10,10 @@
9
10
  "cedar_wasm_bg.js",
10
11
  "cedar_wasm.d.ts"
11
12
  ],
12
- "module": "cedar_wasm.js",
13
+ "main": "cedar_wasm.js",
13
14
  "types": "cedar_wasm.d.ts",
14
15
  "sideEffects": [
15
16
  "./cedar_wasm.js",
16
17
  "./snippets/*"
17
- ],
18
- "type": "module"
18
+ ]
19
19
  }
@@ -21,6 +21,13 @@ export function checkParsePolicySet(input_policies_str: string): CheckParsePolic
21
21
  */
22
22
  export function checkParseTemplate(template_str: string): CheckParseTemplateResult;
23
23
  /**
24
+ * @param {string} policies_str
25
+ * @param {number} line_width
26
+ * @param {number} indent_width
27
+ * @returns {FormattingResult}
28
+ */
29
+ export function formatPolicies(policies_str: string, line_width: number, indent_width: number): FormattingResult;
30
+ /**
24
31
  * @param {string} input_schema
25
32
  * @returns {CheckParseResult}
26
33
  */
@@ -39,12 +46,10 @@ export function checkParseEntities(entities_str: string, schema_str: string): Ch
39
46
  */
40
47
  export function checkParseContext(context_str: string, action_str: string, schema_str: string): CheckParseResult;
41
48
  /**
42
- * @param {string} policies_str
43
- * @param {number} line_width
44
- * @param {number} indent_width
45
- * @returns {FormattingResult}
49
+ * @param {AuthorizationCall} call
50
+ * @returns {AuthorizationAnswer}
46
51
  */
47
- export function formatPolicies(policies_str: string, line_width: number, indent_width: number): FormattingResult;
52
+ export function isAuthorized(call: AuthorizationCall): AuthorizationAnswer;
48
53
  /**
49
54
  * @param {ValidationCall} call
50
55
  * @returns {ValidationAnswer}
@@ -54,11 +59,6 @@ export function validate(call: ValidationCall): ValidationAnswer;
54
59
  * @returns {string}
55
60
  */
56
61
  export function getCedarVersion(): string;
57
- /**
58
- * @param {AuthorizationCall} call
59
- * @returns {AuthorizationAnswer}
60
- */
61
- export function isAuthorized(call: AuthorizationCall): AuthorizationAnswer;
62
62
  export type JsonToPolicyResult = { type: "success"; policyText: string } | { type: "error"; errors: string[] };
63
63
 
64
64
  export type PolicyToJsonResult = { type: "success"; policy: Policy } | { type: "error"; errors: string[] };
@@ -67,28 +67,9 @@ export type CheckParsePolicySetResult = { type: "success"; policies: number; tem
67
67
 
68
68
  export type CheckParseTemplateResult = { type: "success"; slots: string[] } | { type: "error"; errors: string[] };
69
69
 
70
- export type CheckParseResult = { type: "success" } | { type: "error"; errors: string[] };
71
-
72
70
  export type FormattingResult = { type: "success"; formatted_policy: string } | { type: "error"; errors: string[] };
73
71
 
74
- export type ValidationAnswer = { type: "failure"; errors: DetailedError[]; warnings: DetailedError[] } | { type: "success"; validationErrors: ValidationError[]; validationWarnings: ValidationError[]; otherWarnings: DetailedError[] };
75
-
76
- export interface ValidationError {
77
- policyId: SmolStr;
78
- error: DetailedError;
79
- }
80
-
81
- export type ValidationEnabled = "on" | "off";
82
-
83
- export interface ValidationSettings {
84
- enabled: ValidationEnabled;
85
- }
86
-
87
- export interface ValidationCall {
88
- validationSettings?: ValidationSettings;
89
- schema: Schema;
90
- policySet: PolicySet;
91
- }
72
+ export type CheckParseResult = { type: "success" } | { type: "error"; errors: string[] };
92
73
 
93
74
  export interface RecvdSlice {
94
75
  policies: PolicySet;
@@ -142,6 +123,25 @@ export interface Response {
142
123
  diagnostics: Diagnostics;
143
124
  }
144
125
 
126
+ export type ValidationAnswer = { type: "failure"; errors: DetailedError[]; warnings: DetailedError[] } | { type: "success"; validationErrors: ValidationError[]; validationWarnings: ValidationError[]; otherWarnings: DetailedError[] };
127
+
128
+ export interface ValidationError {
129
+ policyId: SmolStr;
130
+ error: DetailedError;
131
+ }
132
+
133
+ export type ValidationEnabled = "on" | "off";
134
+
135
+ export interface ValidationSettings {
136
+ enabled: ValidationEnabled;
137
+ }
138
+
139
+ export interface ValidationCall {
140
+ validationSettings?: ValidationSettings;
141
+ schema: Schema;
142
+ policySet: PolicySet;
143
+ }
144
+
145
145
  export type Schema = { human: string } | { json: SchemaJson };
146
146
 
147
147
  export type PolicySet = string | Record<string, string>;
@@ -1,3 +1,4 @@
1
+
1
2
  let imports = {};
2
3
  imports['__wbindgen_placeholder__'] = module.exports;
3
4
  let wasm;
@@ -34,13 +35,13 @@ function takeObject(idx) {
34
35
 
35
36
  let WASM_VECTOR_LEN = 0;
36
37
 
37
- let cachedUint8Memory0 = null;
38
+ let cachedUint8ArrayMemory0 = null;
38
39
 
39
- function getUint8Memory0() {
40
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
41
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
40
+ function getUint8ArrayMemory0() {
41
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
42
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
42
43
  }
43
- return cachedUint8Memory0;
44
+ return cachedUint8ArrayMemory0;
44
45
  }
45
46
 
46
47
  let cachedTextEncoder = new TextEncoder('utf-8');
@@ -63,7 +64,7 @@ function passStringToWasm0(arg, malloc, realloc) {
63
64
  if (realloc === undefined) {
64
65
  const buf = cachedTextEncoder.encode(arg);
65
66
  const ptr = malloc(buf.length, 1) >>> 0;
66
- getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
67
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
67
68
  WASM_VECTOR_LEN = buf.length;
68
69
  return ptr;
69
70
  }
@@ -71,7 +72,7 @@ function passStringToWasm0(arg, malloc, realloc) {
71
72
  let len = arg.length;
72
73
  let ptr = malloc(len, 1) >>> 0;
73
74
 
74
- const mem = getUint8Memory0();
75
+ const mem = getUint8ArrayMemory0();
75
76
 
76
77
  let offset = 0;
77
78
 
@@ -86,7 +87,7 @@ function passStringToWasm0(arg, malloc, realloc) {
86
87
  arg = arg.slice(offset);
87
88
  }
88
89
  ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
89
- const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
90
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
90
91
  const ret = encodeString(arg, view);
91
92
 
92
93
  offset += ret.written;
@@ -101,13 +102,13 @@ function isLikeNone(x) {
101
102
  return x === undefined || x === null;
102
103
  }
103
104
 
104
- let cachedInt32Memory0 = null;
105
+ let cachedDataViewMemory0 = null;
105
106
 
106
- function getInt32Memory0() {
107
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
108
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
107
+ function getDataViewMemory0() {
108
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
109
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
109
110
  }
110
- return cachedInt32Memory0;
111
+ return cachedDataViewMemory0;
111
112
  }
112
113
 
113
114
  let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
@@ -116,7 +117,7 @@ cachedTextDecoder.decode();
116
117
 
117
118
  function getStringFromWasm0(ptr, len) {
118
119
  ptr = ptr >>> 0;
119
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
120
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
120
121
  }
121
122
  /**
122
123
  * @param {string} json_str
@@ -162,6 +163,19 @@ module.exports.checkParseTemplate = function(template_str) {
162
163
  return takeObject(ret);
163
164
  };
164
165
 
166
+ /**
167
+ * @param {string} policies_str
168
+ * @param {number} line_width
169
+ * @param {number} indent_width
170
+ * @returns {FormattingResult}
171
+ */
172
+ module.exports.formatPolicies = function(policies_str, line_width, indent_width) {
173
+ const ptr0 = passStringToWasm0(policies_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
174
+ const len0 = WASM_VECTOR_LEN;
175
+ const ret = wasm.formatPolicies(ptr0, len0, line_width, indent_width);
176
+ return takeObject(ret);
177
+ };
178
+
165
179
  /**
166
180
  * @param {string} input_schema
167
181
  * @returns {CheckParseResult}
@@ -205,15 +219,11 @@ module.exports.checkParseContext = function(context_str, action_str, schema_str)
205
219
  };
206
220
 
207
221
  /**
208
- * @param {string} policies_str
209
- * @param {number} line_width
210
- * @param {number} indent_width
211
- * @returns {FormattingResult}
222
+ * @param {AuthorizationCall} call
223
+ * @returns {AuthorizationAnswer}
212
224
  */
213
- module.exports.formatPolicies = function(policies_str, line_width, indent_width) {
214
- const ptr0 = passStringToWasm0(policies_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
215
- const len0 = WASM_VECTOR_LEN;
216
- const ret = wasm.formatPolicies(ptr0, len0, line_width, indent_width);
225
+ module.exports.isAuthorized = function(call) {
226
+ const ret = wasm.isAuthorized(addHeapObject(call));
217
227
  return takeObject(ret);
218
228
  };
219
229
 
@@ -235,8 +245,8 @@ module.exports.getCedarVersion = function() {
235
245
  try {
236
246
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
237
247
  wasm.getCedarVersion(retptr);
238
- var r0 = getInt32Memory0()[retptr / 4 + 0];
239
- var r1 = getInt32Memory0()[retptr / 4 + 1];
248
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
249
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
240
250
  deferred1_0 = r0;
241
251
  deferred1_1 = r1;
242
252
  return getStringFromWasm0(r0, r1);
@@ -246,15 +256,6 @@ module.exports.getCedarVersion = function() {
246
256
  }
247
257
  };
248
258
 
249
- /**
250
- * @param {AuthorizationCall} call
251
- * @returns {AuthorizationAnswer}
252
- */
253
- module.exports.isAuthorized = function(call) {
254
- const ret = wasm.isAuthorized(addHeapObject(call));
255
- return takeObject(ret);
256
- };
257
-
258
259
  function handleError(f, args) {
259
260
  try {
260
261
  return f.apply(this, args);
@@ -282,16 +283,16 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
282
283
  const ret = typeof(obj) === 'string' ? obj : undefined;
283
284
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
284
285
  var len1 = WASM_VECTOR_LEN;
285
- getInt32Memory0()[arg0 / 4 + 1] = len1;
286
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
286
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
287
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
287
288
  };
288
289
 
289
- module.exports.__wbg_parse_66d1801634e099ac = function() { return handleError(function (arg0, arg1) {
290
+ module.exports.__wbg_parse_52202f117ec9ecfa = function() { return handleError(function (arg0, arg1) {
290
291
  const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
291
292
  return addHeapObject(ret);
292
293
  }, arguments) };
293
294
 
294
- module.exports.__wbg_stringify_8887fe74e1c50d81 = function() { return handleError(function (arg0) {
295
+ module.exports.__wbg_stringify_bbf45426c92a6bf5 = function() { return handleError(function (arg0) {
295
296
  const ret = JSON.stringify(getObject(arg0));
296
297
  return addHeapObject(ret);
297
298
  }, arguments) };
Binary file
@@ -5,13 +5,13 @@ export function policyTextFromJson(a: number, b: number): number;
5
5
  export function policyTextToJson(a: number, b: number): number;
6
6
  export function checkParsePolicySet(a: number, b: number): number;
7
7
  export function checkParseTemplate(a: number, b: number): number;
8
+ export function formatPolicies(a: number, b: number, c: number, d: number): number;
8
9
  export function checkParseSchema(a: number, b: number): number;
9
10
  export function checkParseEntities(a: number, b: number, c: number, d: number): number;
10
11
  export function checkParseContext(a: number, b: number, c: number, d: number, e: number, f: number): number;
11
- export function formatPolicies(a: number, b: number, c: number, d: number): number;
12
+ export function isAuthorized(a: number): number;
12
13
  export function validate(a: number): number;
13
14
  export function getCedarVersion(a: number): void;
14
- export function isAuthorized(a: number): number;
15
15
  export function __wbindgen_malloc(a: number, b: number): number;
16
16
  export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
17
17
  export function __wbindgen_add_to_stack_pointer(a: number): number;
@@ -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.4.0",
4
+ "version": "3.4.1",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
7
7
  "cedar_wasm_bg.wasm",
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@cedar-policy/cedar-wasm",
3
+ "type": "module",
3
4
  "description": "Wasm bindings and typescript types for Cedar lib",
4
- "version": "3.4.0",
5
+ "version": "3.4.1",
5
6
  "license": "Apache-2.0",
6
7
  "files": [
7
8
  "esm/package.json",
@@ -24,11 +25,12 @@
24
25
  "web/cedar_wasm.js",
25
26
  "web/cedar_wasm.d.ts"
26
27
  ],
27
- "module": "esm/cedar_wasm.js",
28
+ "main": "cedar_wasm.js",
28
29
  "types": "esm/cedar_wasm.d.ts",
29
30
  "sideEffects": [
30
31
  "./snippets/*"
31
32
  ],
33
+ "module": "esm/cedar_wasm.js",
32
34
  "exports": {
33
35
  ".": {
34
36
  "import": "./esm/cedar_wasm.js",
@@ -21,6 +21,13 @@ export function checkParsePolicySet(input_policies_str: string): CheckParsePolic
21
21
  */
22
22
  export function checkParseTemplate(template_str: string): CheckParseTemplateResult;
23
23
  /**
24
+ * @param {string} policies_str
25
+ * @param {number} line_width
26
+ * @param {number} indent_width
27
+ * @returns {FormattingResult}
28
+ */
29
+ export function formatPolicies(policies_str: string, line_width: number, indent_width: number): FormattingResult;
30
+ /**
24
31
  * @param {string} input_schema
25
32
  * @returns {CheckParseResult}
26
33
  */
@@ -39,12 +46,10 @@ export function checkParseEntities(entities_str: string, schema_str: string): Ch
39
46
  */
40
47
  export function checkParseContext(context_str: string, action_str: string, schema_str: string): CheckParseResult;
41
48
  /**
42
- * @param {string} policies_str
43
- * @param {number} line_width
44
- * @param {number} indent_width
45
- * @returns {FormattingResult}
49
+ * @param {AuthorizationCall} call
50
+ * @returns {AuthorizationAnswer}
46
51
  */
47
- export function formatPolicies(policies_str: string, line_width: number, indent_width: number): FormattingResult;
52
+ export function isAuthorized(call: AuthorizationCall): AuthorizationAnswer;
48
53
  /**
49
54
  * @param {ValidationCall} call
50
55
  * @returns {ValidationAnswer}
@@ -54,11 +59,6 @@ export function validate(call: ValidationCall): ValidationAnswer;
54
59
  * @returns {string}
55
60
  */
56
61
  export function getCedarVersion(): string;
57
- /**
58
- * @param {AuthorizationCall} call
59
- * @returns {AuthorizationAnswer}
60
- */
61
- export function isAuthorized(call: AuthorizationCall): AuthorizationAnswer;
62
62
  export type JsonToPolicyResult = { type: "success"; policyText: string } | { type: "error"; errors: string[] };
63
63
 
64
64
  export type PolicyToJsonResult = { type: "success"; policy: Policy } | { type: "error"; errors: string[] };
@@ -67,28 +67,9 @@ export type CheckParsePolicySetResult = { type: "success"; policies: number; tem
67
67
 
68
68
  export type CheckParseTemplateResult = { type: "success"; slots: string[] } | { type: "error"; errors: string[] };
69
69
 
70
- export type CheckParseResult = { type: "success" } | { type: "error"; errors: string[] };
71
-
72
70
  export type FormattingResult = { type: "success"; formatted_policy: string } | { type: "error"; errors: string[] };
73
71
 
74
- export type ValidationAnswer = { type: "failure"; errors: DetailedError[]; warnings: DetailedError[] } | { type: "success"; validationErrors: ValidationError[]; validationWarnings: ValidationError[]; otherWarnings: DetailedError[] };
75
-
76
- export interface ValidationError {
77
- policyId: SmolStr;
78
- error: DetailedError;
79
- }
80
-
81
- export type ValidationEnabled = "on" | "off";
82
-
83
- export interface ValidationSettings {
84
- enabled: ValidationEnabled;
85
- }
86
-
87
- export interface ValidationCall {
88
- validationSettings?: ValidationSettings;
89
- schema: Schema;
90
- policySet: PolicySet;
91
- }
72
+ export type CheckParseResult = { type: "success" } | { type: "error"; errors: string[] };
92
73
 
93
74
  export interface RecvdSlice {
94
75
  policies: PolicySet;
@@ -142,6 +123,25 @@ export interface Response {
142
123
  diagnostics: Diagnostics;
143
124
  }
144
125
 
126
+ export type ValidationAnswer = { type: "failure"; errors: DetailedError[]; warnings: DetailedError[] } | { type: "success"; validationErrors: ValidationError[]; validationWarnings: ValidationError[]; otherWarnings: DetailedError[] };
127
+
128
+ export interface ValidationError {
129
+ policyId: SmolStr;
130
+ error: DetailedError;
131
+ }
132
+
133
+ export type ValidationEnabled = "on" | "off";
134
+
135
+ export interface ValidationSettings {
136
+ enabled: ValidationEnabled;
137
+ }
138
+
139
+ export interface ValidationCall {
140
+ validationSettings?: ValidationSettings;
141
+ schema: Schema;
142
+ policySet: PolicySet;
143
+ }
144
+
145
145
  export type Schema = { human: string } | { json: SchemaJson };
146
146
 
147
147
  export type PolicySet = string | Record<string, string>;
@@ -272,13 +272,13 @@ export interface InitOutput {
272
272
  readonly policyTextToJson: (a: number, b: number) => number;
273
273
  readonly checkParsePolicySet: (a: number, b: number) => number;
274
274
  readonly checkParseTemplate: (a: number, b: number) => number;
275
+ readonly formatPolicies: (a: number, b: number, c: number, d: number) => number;
275
276
  readonly checkParseSchema: (a: number, b: number) => number;
276
277
  readonly checkParseEntities: (a: number, b: number, c: number, d: number) => number;
277
278
  readonly checkParseContext: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
278
- readonly formatPolicies: (a: number, b: number, c: number, d: number) => number;
279
+ readonly isAuthorized: (a: number) => number;
279
280
  readonly validate: (a: number) => number;
280
281
  readonly getCedarVersion: (a: number) => void;
281
- readonly isAuthorized: (a: number) => number;
282
282
  readonly __wbindgen_malloc: (a: number, b: number) => number;
283
283
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
284
284
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
@@ -291,21 +291,21 @@ export type SyncInitInput = BufferSource | WebAssembly.Module;
291
291
  * Instantiates the given `module`, which can either be bytes or
292
292
  * a precompiled `WebAssembly.Module`.
293
293
  *
294
- * @param {SyncInitInput} module
294
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
295
295
  *
296
296
  * @returns {InitOutput}
297
297
  */
298
- export function initSync(module: SyncInitInput): InitOutput;
298
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
299
299
 
300
300
  /**
301
301
  * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
302
302
  * for everything else, calls `WebAssembly.instantiate` directly.
303
303
  *
304
- * @param {InitInput | Promise<InitInput>} module_or_path
304
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
305
305
  *
306
306
  * @returns {Promise<InitOutput>}
307
307
  */
308
- export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
308
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
309
309
  type SmolStr = string;
310
310
  type Name = string;
311
311
  type Id = string;
package/web/cedar_wasm.js CHANGED
@@ -31,13 +31,13 @@ function takeObject(idx) {
31
31
 
32
32
  let WASM_VECTOR_LEN = 0;
33
33
 
34
- let cachedUint8Memory0 = null;
34
+ let cachedUint8ArrayMemory0 = null;
35
35
 
36
- function getUint8Memory0() {
37
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
38
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
36
+ function getUint8ArrayMemory0() {
37
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
38
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
39
39
  }
40
- return cachedUint8Memory0;
40
+ return cachedUint8ArrayMemory0;
41
41
  }
42
42
 
43
43
  const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
@@ -60,7 +60,7 @@ function passStringToWasm0(arg, malloc, realloc) {
60
60
  if (realloc === undefined) {
61
61
  const buf = cachedTextEncoder.encode(arg);
62
62
  const ptr = malloc(buf.length, 1) >>> 0;
63
- getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
63
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
64
64
  WASM_VECTOR_LEN = buf.length;
65
65
  return ptr;
66
66
  }
@@ -68,7 +68,7 @@ function passStringToWasm0(arg, malloc, realloc) {
68
68
  let len = arg.length;
69
69
  let ptr = malloc(len, 1) >>> 0;
70
70
 
71
- const mem = getUint8Memory0();
71
+ const mem = getUint8ArrayMemory0();
72
72
 
73
73
  let offset = 0;
74
74
 
@@ -83,7 +83,7 @@ function passStringToWasm0(arg, malloc, realloc) {
83
83
  arg = arg.slice(offset);
84
84
  }
85
85
  ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
86
- const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
86
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
87
87
  const ret = encodeString(arg, view);
88
88
 
89
89
  offset += ret.written;
@@ -98,13 +98,13 @@ function isLikeNone(x) {
98
98
  return x === undefined || x === null;
99
99
  }
100
100
 
101
- let cachedInt32Memory0 = null;
101
+ let cachedDataViewMemory0 = null;
102
102
 
103
- function getInt32Memory0() {
104
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
105
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
103
+ function getDataViewMemory0() {
104
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
105
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
106
106
  }
107
- return cachedInt32Memory0;
107
+ return cachedDataViewMemory0;
108
108
  }
109
109
 
110
110
  const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
@@ -113,7 +113,7 @@ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
113
113
 
114
114
  function getStringFromWasm0(ptr, len) {
115
115
  ptr = ptr >>> 0;
116
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
116
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
117
117
  }
118
118
  /**
119
119
  * @param {string} json_str
@@ -159,6 +159,19 @@ export function checkParseTemplate(template_str) {
159
159
  return takeObject(ret);
160
160
  }
161
161
 
162
+ /**
163
+ * @param {string} policies_str
164
+ * @param {number} line_width
165
+ * @param {number} indent_width
166
+ * @returns {FormattingResult}
167
+ */
168
+ export function formatPolicies(policies_str, line_width, indent_width) {
169
+ const ptr0 = passStringToWasm0(policies_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
170
+ const len0 = WASM_VECTOR_LEN;
171
+ const ret = wasm.formatPolicies(ptr0, len0, line_width, indent_width);
172
+ return takeObject(ret);
173
+ }
174
+
162
175
  /**
163
176
  * @param {string} input_schema
164
177
  * @returns {CheckParseResult}
@@ -202,15 +215,11 @@ export function checkParseContext(context_str, action_str, schema_str) {
202
215
  }
203
216
 
204
217
  /**
205
- * @param {string} policies_str
206
- * @param {number} line_width
207
- * @param {number} indent_width
208
- * @returns {FormattingResult}
218
+ * @param {AuthorizationCall} call
219
+ * @returns {AuthorizationAnswer}
209
220
  */
210
- export function formatPolicies(policies_str, line_width, indent_width) {
211
- const ptr0 = passStringToWasm0(policies_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
212
- const len0 = WASM_VECTOR_LEN;
213
- const ret = wasm.formatPolicies(ptr0, len0, line_width, indent_width);
221
+ export function isAuthorized(call) {
222
+ const ret = wasm.isAuthorized(addHeapObject(call));
214
223
  return takeObject(ret);
215
224
  }
216
225
 
@@ -232,8 +241,8 @@ export function getCedarVersion() {
232
241
  try {
233
242
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
234
243
  wasm.getCedarVersion(retptr);
235
- var r0 = getInt32Memory0()[retptr / 4 + 0];
236
- var r1 = getInt32Memory0()[retptr / 4 + 1];
244
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
245
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
237
246
  deferred1_0 = r0;
238
247
  deferred1_1 = r1;
239
248
  return getStringFromWasm0(r0, r1);
@@ -243,15 +252,6 @@ export function getCedarVersion() {
243
252
  }
244
253
  }
245
254
 
246
- /**
247
- * @param {AuthorizationCall} call
248
- * @returns {AuthorizationAnswer}
249
- */
250
- export function isAuthorized(call) {
251
- const ret = wasm.isAuthorized(addHeapObject(call));
252
- return takeObject(ret);
253
- }
254
-
255
255
  function handleError(f, args) {
256
256
  try {
257
257
  return f.apply(this, args);
@@ -310,14 +310,14 @@ function __wbg_get_imports() {
310
310
  const ret = typeof(obj) === 'string' ? obj : undefined;
311
311
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
312
312
  var len1 = WASM_VECTOR_LEN;
313
- getInt32Memory0()[arg0 / 4 + 1] = len1;
314
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
313
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
314
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
315
315
  };
316
- imports.wbg.__wbg_parse_66d1801634e099ac = function() { return handleError(function (arg0, arg1) {
316
+ imports.wbg.__wbg_parse_52202f117ec9ecfa = function() { return handleError(function (arg0, arg1) {
317
317
  const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
318
318
  return addHeapObject(ret);
319
319
  }, arguments) };
320
- imports.wbg.__wbg_stringify_8887fe74e1c50d81 = function() { return handleError(function (arg0) {
320
+ imports.wbg.__wbg_stringify_bbf45426c92a6bf5 = function() { return handleError(function (arg0) {
321
321
  const ret = JSON.stringify(getObject(arg0));
322
322
  return addHeapObject(ret);
323
323
  }, arguments) };
@@ -328,15 +328,16 @@ function __wbg_get_imports() {
328
328
  return imports;
329
329
  }
330
330
 
331
- function __wbg_init_memory(imports, maybe_memory) {
331
+ function __wbg_init_memory(imports, memory) {
332
332
 
333
333
  }
334
334
 
335
335
  function __wbg_finalize_init(instance, module) {
336
336
  wasm = instance.exports;
337
337
  __wbg_init.__wbindgen_wasm_module = module;
338
- cachedInt32Memory0 = null;
339
- cachedUint8Memory0 = null;
338
+ cachedDataViewMemory0 = null;
339
+ cachedUint8ArrayMemory0 = null;
340
+
340
341
 
341
342
 
342
343
  return wasm;
@@ -345,6 +346,12 @@ function __wbg_finalize_init(instance, module) {
345
346
  function initSync(module) {
346
347
  if (wasm !== undefined) return wasm;
347
348
 
349
+
350
+ if (typeof module !== 'undefined' && Object.getPrototypeOf(module) === Object.prototype)
351
+ ({module} = module)
352
+ else
353
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
354
+
348
355
  const imports = __wbg_get_imports();
349
356
 
350
357
  __wbg_init_memory(imports);
@@ -358,24 +365,30 @@ function initSync(module) {
358
365
  return __wbg_finalize_init(instance, module);
359
366
  }
360
367
 
361
- async function __wbg_init(input) {
368
+ async function __wbg_init(module_or_path) {
362
369
  if (wasm !== undefined) return wasm;
363
370
 
364
- if (typeof input === 'undefined') {
365
- input = new URL('cedar_wasm_bg.wasm', import.meta.url);
371
+
372
+ if (typeof module_or_path !== 'undefined' && Object.getPrototypeOf(module_or_path) === Object.prototype)
373
+ ({module_or_path} = module_or_path)
374
+ else
375
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
376
+
377
+ if (typeof module_or_path === 'undefined') {
378
+ module_or_path = new URL('cedar_wasm_bg.wasm', import.meta.url);
366
379
  }
367
380
  const imports = __wbg_get_imports();
368
381
 
369
- if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
370
- input = fetch(input);
382
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
383
+ module_or_path = fetch(module_or_path);
371
384
  }
372
385
 
373
386
  __wbg_init_memory(imports);
374
387
 
375
- const { instance, module } = await __wbg_load(await input, imports);
388
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
376
389
 
377
390
  return __wbg_finalize_init(instance, module);
378
391
  }
379
392
 
380
- export { initSync }
393
+ export { initSync };
381
394
  export default __wbg_init;
Binary file
@@ -5,13 +5,13 @@ export function policyTextFromJson(a: number, b: number): number;
5
5
  export function policyTextToJson(a: number, b: number): number;
6
6
  export function checkParsePolicySet(a: number, b: number): number;
7
7
  export function checkParseTemplate(a: number, b: number): number;
8
+ export function formatPolicies(a: number, b: number, c: number, d: number): number;
8
9
  export function checkParseSchema(a: number, b: number): number;
9
10
  export function checkParseEntities(a: number, b: number, c: number, d: number): number;
10
11
  export function checkParseContext(a: number, b: number, c: number, d: number, e: number, f: number): number;
11
- export function formatPolicies(a: number, b: number, c: number, d: number): number;
12
+ export function isAuthorized(a: number): number;
12
13
  export function validate(a: number): number;
13
14
  export function getCedarVersion(a: number): void;
14
- export function isAuthorized(a: number): number;
15
15
  export function __wbindgen_malloc(a: number, b: number): number;
16
16
  export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
17
17
  export function __wbindgen_add_to_stack_pointer(a: number): number;
package/web/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@cedar-policy/cedar-wasm",
3
+ "type": "module",
3
4
  "description": "Wasm bindings and typescript types for Cedar lib",
4
- "version": "3.4.0",
5
+ "version": "3.4.1",
5
6
  "license": "Apache-2.0",
6
7
  "files": [
7
8
  "cedar_wasm_bg.wasm",
8
9
  "cedar_wasm.js",
9
10
  "cedar_wasm.d.ts"
10
11
  ],
11
- "module": "cedar_wasm.js",
12
+ "main": "cedar_wasm.js",
12
13
  "types": "cedar_wasm.d.ts",
13
14
  "sideEffects": [
14
15
  "./snippets/*"
15
- ],
16
- "type": "module"
16
+ ]
17
17
  }