@contentauth/c2pa-web 0.13.0 → 0.13.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.
@@ -1,5 +1,5 @@
1
1
  var G = (r, e) => () => (e || r((e = { exports: {} }).exports, e), e.exports);
2
- var fe = G((de, C) => {
2
+ var be = G((de, C) => {
3
3
  class h {
4
4
  static __wrap(e) {
5
5
  const t = Object.create(h.prototype);
@@ -20,7 +20,17 @@ var fe = G((de, C) => {
20
20
  addAction(e) {
21
21
  const t = o.wasmbuilder_addAction(this.__wbg_ptr, e);
22
22
  if (t[1])
23
- throw f(t[0]);
23
+ throw b(t[0]);
24
+ }
25
+ /**
26
+ * Add an assertion to the manifest under `label` with the given `data`.
27
+ * @param {string} label
28
+ * @param {any} data
29
+ */
30
+ addAssertion(e, t) {
31
+ const n = f(e, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a, c = o.wasmbuilder_addAssertion(this.__wbg_ptr, n, _, t);
32
+ if (c[1])
33
+ throw b(c[0]);
24
34
  }
25
35
  /**
26
36
  * Add an ingredient to the manifest from a JSON ingredient definition without a blob
@@ -30,9 +40,9 @@ var fe = G((de, C) => {
30
40
  * @param {string} json
31
41
  */
32
42
  addIngredient(e) {
33
- const t = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), n = a, _ = o.wasmbuilder_addIngredient(this.__wbg_ptr, t, n);
43
+ const t = f(e, o.__wbindgen_malloc, o.__wbindgen_realloc), n = a, _ = o.wasmbuilder_addIngredient(this.__wbg_ptr, t, n);
34
44
  if (_[1])
35
- throw f(_[0]);
45
+ throw b(_[0]);
36
46
  }
37
47
  /**
38
48
  * Add an ingredient to the manifest from a JSON ingredient definition and a [`Blob`].
@@ -47,7 +57,7 @@ var fe = G((de, C) => {
47
57
  * @returns {Promise<void>}
48
58
  */
49
59
  addIngredientFromBlob(e, t, n) {
50
- const _ = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a, i = b(t, o.__wbindgen_malloc, o.__wbindgen_realloc), s = a;
60
+ const _ = f(e, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a, i = f(t, o.__wbindgen_malloc, o.__wbindgen_realloc), s = a;
51
61
  return o.wasmbuilder_addIngredientFromBlob(this.__wbg_ptr, _, c, i, s, n);
52
62
  }
53
63
  /**
@@ -59,9 +69,9 @@ var fe = G((de, C) => {
59
69
  * @param {any} reason
60
70
  */
61
71
  addRedaction(e, t) {
62
- const n = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a, c = o.wasmbuilder_addRedaction(this.__wbg_ptr, n, _, t);
72
+ const n = f(e, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a, c = o.wasmbuilder_addRedaction(this.__wbg_ptr, n, _, t);
63
73
  if (c[1])
64
- throw f(c[0]);
74
+ throw b(c[0]);
65
75
  }
66
76
  /**
67
77
  * Add a [`Blob`] to the manifest as a resource. The ID must match an identifier in the manifest.
@@ -69,9 +79,9 @@ var fe = G((de, C) => {
69
79
  * @param {Blob} blob
70
80
  */
71
81
  addResourceFromBlob(e, t) {
72
- const n = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a, c = o.wasmbuilder_addResourceFromBlob(this.__wbg_ptr, n, _, t);
82
+ const n = f(e, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a, c = o.wasmbuilder_addResourceFromBlob(this.__wbg_ptr, n, _, t);
73
83
  if (c[1])
74
- throw f(c[0]);
84
+ throw b(c[0]);
75
85
  }
76
86
  /**
77
87
  * Retains only the actions at the given 0-based indices into the actions currently returned
@@ -93,7 +103,7 @@ var fe = G((de, C) => {
93
103
  filterActionsAt(e) {
94
104
  const t = J(e, o.__wbindgen_malloc), n = a, _ = o.wasmbuilder_filterActionsAt(this.__wbg_ptr, t, n);
95
105
  if (_[1])
96
- throw f(_[0]);
106
+ throw b(_[0]);
97
107
  }
98
108
  /**
99
109
  * Retains ingredients, rescuing an otherwise-orphaned ingredient when its 0-based index into
@@ -107,7 +117,7 @@ var fe = G((de, C) => {
107
117
  filterIngredientsAt(e) {
108
118
  const t = J(e, o.__wbindgen_malloc), n = a, _ = o.wasmbuilder_filterIngredientsAt(this.__wbg_ptr, t, n);
109
119
  if (_[1])
110
- throw f(_[0]);
120
+ throw b(_[0]);
111
121
  }
112
122
  /**
113
123
  * Attempts to create a new `WasmBuilder` from a builder archive.
@@ -117,10 +127,10 @@ var fe = G((de, C) => {
117
127
  * @returns {WasmBuilder}
118
128
  */
119
129
  static fromArchive(e, t) {
120
- var n = w(t) ? 0 : b(t, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a;
130
+ var n = w(t) ? 0 : f(t, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a;
121
131
  const c = o.wasmbuilder_fromArchive(e, n, _);
122
132
  if (c[2])
123
- throw f(c[1]);
133
+ throw b(c[1]);
124
134
  return h.__wrap(c[0]);
125
135
  }
126
136
  /**
@@ -131,11 +141,11 @@ var fe = G((de, C) => {
131
141
  * @returns {WasmBuilder}
132
142
  */
133
143
  static fromJson(e, t) {
134
- const n = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a;
135
- var c = w(t) ? 0 : b(t, o.__wbindgen_malloc, o.__wbindgen_realloc), i = a;
144
+ const n = f(e, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a;
145
+ var c = w(t) ? 0 : f(t, o.__wbindgen_malloc, o.__wbindgen_realloc), i = a;
136
146
  const s = o.wasmbuilder_fromJson(n, _, c, i);
137
147
  if (s[2])
138
- throw f(s[1]);
148
+ throw b(s[1]);
139
149
  return h.__wrap(s[0]);
140
150
  }
141
151
  /**
@@ -145,8 +155,8 @@ var fe = G((de, C) => {
145
155
  getDefinition() {
146
156
  const e = o.wasmbuilder_getDefinition(this.__wbg_ptr);
147
157
  if (e[2])
148
- throw f(e[1]);
149
- return f(e[0]);
158
+ throw b(e[1]);
159
+ return b(e[0]);
150
160
  }
151
161
  /**
152
162
  * Creates a new `WasmBuilder` with a minimal manifest definition.
@@ -155,10 +165,10 @@ var fe = G((de, C) => {
155
165
  * @returns {WasmBuilder}
156
166
  */
157
167
  static new(e) {
158
- var t = w(e) ? 0 : b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), n = a;
168
+ var t = w(e) ? 0 : f(e, o.__wbindgen_malloc, o.__wbindgen_realloc), n = a;
159
169
  const _ = o.wasmbuilder_new(t, n);
160
170
  if (_[2])
161
- throw f(_[1]);
171
+ throw b(_[1]);
162
172
  return h.__wrap(_[0]);
163
173
  }
164
174
  /**
@@ -168,7 +178,7 @@ var fe = G((de, C) => {
168
178
  setIntent(e) {
169
179
  const t = o.wasmbuilder_setIntent(this.__wbg_ptr, e);
170
180
  if (t[1])
171
- throw f(t[0]);
181
+ throw b(t[0]);
172
182
  }
173
183
  /**
174
184
  * Sets the state of the no_embed flag.
@@ -185,7 +195,7 @@ var fe = G((de, C) => {
185
195
  * @param {string} url
186
196
  */
187
197
  setRemoteUrl(e) {
188
- const t = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), n = a;
198
+ const t = f(e, o.__wbindgen_malloc, o.__wbindgen_realloc), n = a;
189
199
  o.wasmbuilder_setRemoteUrl(this.__wbg_ptr, t, n);
190
200
  }
191
201
  /**
@@ -194,9 +204,9 @@ var fe = G((de, C) => {
194
204
  * @param {Blob} blob
195
205
  */
196
206
  setThumbnailFromBlob(e, t) {
197
- const n = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a, c = o.wasmbuilder_setThumbnailFromBlob(this.__wbg_ptr, n, _, t);
207
+ const n = f(e, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a, c = o.wasmbuilder_setThumbnailFromBlob(this.__wbg_ptr, n, _, t);
198
208
  if (c[1])
199
- throw f(c[0]);
209
+ throw b(c[0]);
200
210
  }
201
211
  /**
202
212
  * Sign an asset using the provided SignerDefinition, format, and source Blob.
@@ -206,7 +216,7 @@ var fe = G((de, C) => {
206
216
  * @returns {Promise<Uint8Array>}
207
217
  */
208
218
  sign(e, t, n) {
209
- const _ = b(t, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
219
+ const _ = f(t, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
210
220
  return o.wasmbuilder_sign(this.__wbg_ptr, e, _, c, n);
211
221
  }
212
222
  /**
@@ -218,7 +228,7 @@ var fe = G((de, C) => {
218
228
  * @returns {Promise<any>}
219
229
  */
220
230
  signAndGetManifestBytes(e, t, n) {
221
- const _ = b(t, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
231
+ const _ = f(t, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
222
232
  return o.wasmbuilder_signAndGetManifestBytes(this.__wbg_ptr, e, _, c, n);
223
233
  }
224
234
  /**
@@ -228,8 +238,8 @@ var fe = G((de, C) => {
228
238
  toArchive() {
229
239
  const e = o.wasmbuilder_toArchive(this.__wbg_ptr);
230
240
  if (e[2])
231
- throw f(e[1]);
232
- return f(e[0]);
241
+ throw b(e[1]);
242
+ return b(e[0]);
233
243
  }
234
244
  }
235
245
  Symbol.dispose && (h.prototype[Symbol.dispose] = h.prototype.free);
@@ -262,8 +272,8 @@ var fe = G((de, C) => {
262
272
  activeManifest() {
263
273
  const e = o.wasmreader_activeManifest(this.__wbg_ptr);
264
274
  if (e[2])
265
- throw f(e[1]);
266
- return f(e[0]);
275
+ throw b(e[1]);
276
+ return b(e[0]);
267
277
  }
268
278
  /**
269
279
  * Returns the asset's manifest store as crJSON.
@@ -287,8 +297,8 @@ var fe = G((de, C) => {
287
297
  * @returns {Promise<WasmReader>}
288
298
  */
289
299
  static fromBlob(e, t, n) {
290
- const _ = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
291
- var i = w(n) ? 0 : b(n, o.__wbindgen_malloc, o.__wbindgen_realloc), s = a;
300
+ const _ = f(e, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
301
+ var i = w(n) ? 0 : f(n, o.__wbindgen_malloc, o.__wbindgen_realloc), s = a;
292
302
  return o.wasmreader_fromBlob(_, c, t, i, s);
293
303
  }
294
304
  /**
@@ -301,8 +311,8 @@ var fe = G((de, C) => {
301
311
  * @returns {Promise<WasmReader>}
302
312
  */
303
313
  static fromBlobFragment(e, t, n, _) {
304
- const c = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), i = a;
305
- var s = w(_) ? 0 : b(_, o.__wbindgen_malloc, o.__wbindgen_realloc), u = a;
314
+ const c = f(e, o.__wbindgen_malloc, o.__wbindgen_realloc), i = a;
315
+ var s = w(_) ? 0 : f(_, o.__wbindgen_malloc, o.__wbindgen_realloc), u = a;
306
316
  return o.wasmreader_fromBlobFragment(c, i, t, n, s, u);
307
317
  }
308
318
  /**
@@ -325,8 +335,8 @@ var fe = G((de, C) => {
325
335
  manifestStore() {
326
336
  const e = o.wasmreader_manifestStore(this.__wbg_ptr);
327
337
  if (e[2])
328
- throw f(e[1]);
329
- return f(e[0]);
338
+ throw b(e[1]);
339
+ return b(e[0]);
330
340
  }
331
341
  /**
332
342
  * Accepts a URI reference to a binary object in the resource store and returns a `js_sys::Uint8Array` containing the resource's bytes.
@@ -334,17 +344,17 @@ var fe = G((de, C) => {
334
344
  * @returns {Uint8Array}
335
345
  */
336
346
  resourceToBytes(e) {
337
- const t = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), n = a, _ = o.wasmreader_resourceToBytes(this.__wbg_ptr, t, n);
347
+ const t = f(e, o.__wbindgen_malloc, o.__wbindgen_realloc), n = a, _ = o.wasmreader_resourceToBytes(this.__wbg_ptr, t, n);
338
348
  if (_[2])
339
- throw f(_[1]);
340
- return f(_[0]);
349
+ throw b(_[1]);
350
+ return b(_[0]);
341
351
  }
342
352
  }
343
353
  Symbol.dispose && (F.prototype[Symbol.dispose] = F.prototype.free);
344
354
  function $(r) {
345
- const e = b(r, o.__wbindgen_malloc, o.__wbindgen_realloc), t = a, n = o.loadSettings(e, t);
355
+ const e = f(r, o.__wbindgen_malloc, o.__wbindgen_realloc), t = a, n = o.loadSettings(e, t);
346
356
  if (n[1])
347
- throw f(n[0]);
357
+ throw b(n[0]);
348
358
  }
349
359
  function H() {
350
360
  return {
@@ -366,7 +376,7 @@ var fe = G((de, C) => {
366
376
  return w(n) ? 16777215 : n ? 1 : 0;
367
377
  },
368
378
  __wbg___wbindgen_debug_string_0accd80f45e5faa2: function(e, t) {
369
- const n = x(t), _ = b(n, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
379
+ const n = x(t), _ = f(n, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
370
380
  m().setInt32(e + 4, c, !0), m().setInt32(e + 0, _, !0);
371
381
  },
372
382
  __wbg___wbindgen_in_70a403a56e771704: function(e, t) {
@@ -400,7 +410,7 @@ var fe = G((de, C) => {
400
410
  },
401
411
  __wbg___wbindgen_string_get_72bdf95d3ae505b1: function(e, t) {
402
412
  const n = t, _ = typeof n == "string" ? n : void 0;
403
- var c = w(_) ? 0 : b(_, o.__wbindgen_malloc, o.__wbindgen_realloc), i = a;
413
+ var c = w(_) ? 0 : f(_, o.__wbindgen_malloc, o.__wbindgen_realloc), i = a;
404
414
  m().setInt32(e + 4, i, !0), m().setInt32(e + 0, c, !0);
405
415
  },
406
416
  __wbg___wbindgen_throw_1506f2235d1bdba0: function(e, t) {
@@ -732,7 +742,7 @@ var fe = G((de, C) => {
732
742
  }, arguments);
733
743
  },
734
744
  __wbg_stack_3b0d974bbf31e44f: function(e, t) {
735
- const n = t.stack, _ = b(n, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
745
+ const n = t.stack, _ = f(n, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
736
746
  m().setInt32(e + 4, c, !0), m().setInt32(e + 0, _, !0);
737
747
  },
738
748
  __wbg_static_accessor_GLOBAL_9d53f2689e622ca1: function() {
@@ -769,7 +779,7 @@ var fe = G((de, C) => {
769
779
  return e.then(t);
770
780
  },
771
781
  __wbg_url_6808f1c468f2d0cd: function(e, t) {
772
- const n = t.url, _ = b(n, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
782
+ const n = t.url, _ = f(n, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
773
783
  m().setInt32(e + 4, c, !0), m().setInt32(e + 0, _, !0);
774
784
  },
775
785
  __wbg_valueOf_41ae57308c1f031c: function(e) {
@@ -822,7 +832,7 @@ var fe = G((de, C) => {
822
832
  function Y(r, e, t) {
823
833
  const n = o.wasm_bindgen_304c265eb9e6f0af___convert__closures_____invoke___wasm_bindgen_304c265eb9e6f0af___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_304c265eb9e6f0af___JsError___true_(r, e, t);
824
834
  if (n[1])
825
- throw f(n[0]);
835
+ throw b(n[0]);
826
836
  }
827
837
  function K(r, e, t, n) {
828
838
  o.wasm_bindgen_304c265eb9e6f0af___convert__closures_____invoke___js_sys_74e7014fb12660c3___Function_fn_wasm_bindgen_304c265eb9e6f0af___JsValue_____wasm_bindgen_304c265eb9e6f0af___sys__Undefined___js_sys_74e7014fb12660c3___Function_fn_wasm_bindgen_304c265eb9e6f0af___JsValue_____wasm_bindgen_304c265eb9e6f0af___sys__Undefined_______true_(r, e, t, n);
@@ -925,7 +935,7 @@ ${r.stack}` : n;
925
935
  const t = e(r.length * 4, 4) >>> 0;
926
936
  return te().set(r, t / 4), a = r.length, t;
927
937
  }
928
- function b(r, e, t) {
938
+ function f(r, e, t) {
929
939
  if (t === void 0) {
930
940
  const s = j.encode(r), u = e(s.length, 1) >>> 0;
931
941
  return T().subarray(u, u + s.length).set(s), a = s.length, u;
@@ -945,7 +955,7 @@ ${r.stack}` : n;
945
955
  }
946
956
  return a = i, _;
947
957
  }
948
- function f(r) {
958
+ function b(r) {
949
959
  const e = o.__wbindgen_externrefs.get(r);
950
960
  return o.__externref_table_dealloc(r), e;
951
961
  }
@@ -1125,6 +1135,9 @@ ${r.stack}` : n;
1125
1135
  builder_addAction(r, e) {
1126
1136
  l.get(r).addAction(e);
1127
1137
  },
1138
+ builder_addAssertion(r, e, t) {
1139
+ l.get(r).addAssertion(e, t);
1140
+ },
1128
1141
  builder_addRedaction(r, e, t) {
1129
1142
  l.get(r).addRedaction(e, t);
1130
1143
  },
@@ -1215,4 +1228,4 @@ ${r.stack}` : n;
1215
1228
  return e;
1216
1229
  }
1217
1230
  });
1218
- export default fe();
1231
+ export default be();
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { R as r, c as R, i as o } from "./c2pa-B5kyABlZ.js";
1
+ import { R as r, c as R, i as o } from "./c2pa-8eeyObgG.js";
2
2
  export {
3
3
  r as READER_SUPPORTED_FORMATS,
4
4
  R as createC2pa,