@contentauth/c2pa-web 0.13.3 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/dist/c2pa-ClWjHDBi.js +597 -0
- package/dist/c2pa_worker.js +32 -0
- package/dist/common.d.ts +0 -1
- package/dist/common.d.ts.map +1 -1
- package/dist/index.d.ts +1 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -3
- package/dist/inline.js +5 -5
- package/dist/lib/builder.d.ts +19 -1
- package/dist/lib/builder.d.ts.map +1 -1
- package/dist/lib/c2pa.d.ts +14 -1
- package/dist/lib/c2pa.d.ts.map +1 -1
- package/dist/lib/error.d.ts +0 -3
- package/dist/lib/error.d.ts.map +1 -1
- package/dist/lib/reader.d.ts +1 -1
- package/dist/lib/reader.d.ts.map +1 -1
- package/dist/lib/signer.d.ts +2 -9
- package/dist/lib/signer.d.ts.map +1 -1
- package/dist/lib/worker/rpc.d.ts +2 -0
- package/dist/lib/worker/rpc.d.ts.map +1 -1
- package/dist/resources/c2pa_bg.wasm +0 -0
- package/package.json +29 -6
- package/LICENSE +0 -21
- package/dist/c2pa-0g6nuBRG.js +0 -480
- package/dist/lib/settings.d.ts +0 -106
- package/dist/lib/settings.d.ts.map +0 -1
package/dist/c2pa_worker.js
CHANGED
|
@@ -258,6 +258,35 @@ var be = G((de, C) => {
|
|
|
258
258
|
throw b(e[1]);
|
|
259
259
|
return b(e[0]);
|
|
260
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* Replaces the actions in the `c2pa.actions`/`c2pa.actions.v2` assertions with
|
|
263
|
+
* `action_groups`, computed on the JS side (see [`Self::filter_actions_at`]).
|
|
264
|
+
* `softwareAgents`/`allActionsIncluded`/`templates`/`metadata` are preserved as-is.
|
|
265
|
+
*
|
|
266
|
+
* A manifest can carry more than one actions assertion (the created-list and gathered-list
|
|
267
|
+
* entries are distinct assertions), so `action_groups` is a list-of-lists: one entry per
|
|
268
|
+
* actions assertion, in the same positional order this binding enumerates them.
|
|
269
|
+
*
|
|
270
|
+
* Each assertion is rewritten in place, which keeps its label, `created` flag, `kind`, and
|
|
271
|
+
* position in the assertion list — mirroring `Builder::filter_actions` in c2pa-rs. A group
|
|
272
|
+
* that is empty drops its assertion rather than writing an invalid empty actions array.
|
|
273
|
+
* No-op if there is no actions assertion. Use `add_action` for those.
|
|
274
|
+
*
|
|
275
|
+
* All fallible work runs before any mutation, so a failure never leaves a partially-rewritten
|
|
276
|
+
* builder. An existing but malformed actions assertion is surfaced as an error rather than
|
|
277
|
+
* silently replaced.
|
|
278
|
+
*
|
|
279
|
+
* The groups are written back verbatim: they are not validated or reordered, and unlike
|
|
280
|
+
* [`Self::filter_actions_at`] the inception action is not force-kept. A caller that drops
|
|
281
|
+
* `c2pa.created`/`c2pa.opened` or moves it out of first position can produce an actions
|
|
282
|
+
* array that fails validation at signing time.
|
|
283
|
+
* @param {any} action_groups
|
|
284
|
+
*/
|
|
285
|
+
updateActionsAt(e) {
|
|
286
|
+
const t = o.wasmbuilder_updateActionsAt(this.__wbg_ptr, e);
|
|
287
|
+
if (t[1])
|
|
288
|
+
throw b(t[0]);
|
|
289
|
+
}
|
|
261
290
|
}
|
|
262
291
|
Symbol.dispose && (h.prototype[Symbol.dispose] = h.prototype.free);
|
|
263
292
|
class I {
|
|
@@ -1161,6 +1190,9 @@ ${r.stack}` : n;
|
|
|
1161
1190
|
builder_filterActionsAt(r, e) {
|
|
1162
1191
|
d.get(r).filterActionsAt(Uint32Array.from(e));
|
|
1163
1192
|
},
|
|
1193
|
+
builder_updateActionsAt(r, e) {
|
|
1194
|
+
d.get(r).updateActionsAt(e);
|
|
1195
|
+
},
|
|
1164
1196
|
builder_filterIngredientsAt(r, e) {
|
|
1165
1197
|
d.get(r).filterIngredientsAt(Uint32Array.from(e));
|
|
1166
1198
|
},
|
package/dist/common.d.ts
CHANGED
|
@@ -11,6 +11,5 @@ export type { Reader, ReaderFactory } from './lib/reader.js';
|
|
|
11
11
|
export type { Builder, BuilderFactory, ManifestAndAssetBytes } from './lib/builder.js';
|
|
12
12
|
export type { Signer, SigningAlg } from './lib/signer.js';
|
|
13
13
|
export { isSupportedReaderFormat, READER_SUPPORTED_FORMATS } from './lib/supportedFormats.js';
|
|
14
|
-
export type { Settings, VerifySettings, TrustSettings, BuilderSettings, CawgTrustSettings } from './lib/settings.js';
|
|
15
14
|
export type * from '@contentauth/c2pa-types';
|
|
16
15
|
//# sourceMappingURL=common.d.ts.map
|
package/dist/common.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,mBAAmB,eAAe,CAAC;AAEnC,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE7D,YAAY,EACV,OAAO,EACP,cAAc,EACd,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,mBAAmB,eAAe,CAAC;AAEnC,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE7D,YAAY,EACV,OAAO,EACP,cAAc,EACd,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,2BAA2B,CAAC;AAGnC,mBAAmB,yBAAyB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,19 +6,7 @@
|
|
|
6
6
|
* accordance with the terms of the Adobe license agreement accompanying
|
|
7
7
|
* it.
|
|
8
8
|
*/
|
|
9
|
-
/**
|
|
10
|
-
* Creates a new instance of c2pa-web by setting up a web worker and preparing a WASM binary.
|
|
11
|
-
*
|
|
12
|
-
* @param config - SDK configuration object.
|
|
13
|
-
* @returns An object providing access to factory methods for creating new reader objects.
|
|
14
|
-
*
|
|
15
|
-
* @example Creating a new SDK instance and reader:
|
|
16
|
-
* ```
|
|
17
|
-
* const c2pa = await createC2pa({ wasmSrc: 'url/hosting/wasm/binary' });
|
|
18
|
-
*
|
|
19
|
-
* const reader = await c2pa.reader.fromBlob(imageBlob.type, imageBlob);
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
9
|
export { createC2pa } from './lib/c2pa.js';
|
|
23
10
|
export * from './common.js';
|
|
11
|
+
export * from '@contentauth/c2pa-utilities';
|
|
24
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as e, D as t, a as r, b as E, c as _, d as S, e as T, R as A, f as R, g as i, h as o, i as g, j as n, k as D, l as F, m as L, n as M, o as l, r as U, p as c, s as f, q as I, v as Y } from "./c2pa-ClWjHDBi.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
e as AssetTooLargeError,
|
|
4
|
+
t as DEFAULT_INITIAL_RETRY_DELAY_MS,
|
|
5
|
+
r as DEFAULT_MAX_RESPONSE_BYTES,
|
|
6
|
+
E as DEFAULT_MAX_RETRIES,
|
|
7
|
+
_ as DEFAULT_MAX_RETRY_AFTER_MS,
|
|
8
|
+
S as DEFAULT_MAX_RETRY_DELAY_MS,
|
|
9
|
+
T as DEFAULT_MAX_SIZE_IN_BYTES,
|
|
10
|
+
A as READER_SUPPORTED_FORMATS,
|
|
4
11
|
R as createC2pa,
|
|
5
|
-
|
|
12
|
+
i as createCawgTrustSettings,
|
|
13
|
+
o as createTrustSettings,
|
|
14
|
+
g as createVerifySettings,
|
|
15
|
+
n as defaultIsRetryableStatus,
|
|
16
|
+
D as fetchWithRetry,
|
|
17
|
+
F as fetchWithRetryRaw,
|
|
18
|
+
L as isSupportedReaderFormat,
|
|
19
|
+
M as loadSettingsFromUrl,
|
|
20
|
+
l as mergeSettings,
|
|
21
|
+
U as resolveSettings,
|
|
22
|
+
c as resolveTrustSettings,
|
|
23
|
+
f as settingsToJson,
|
|
24
|
+
I as snakeCaseify,
|
|
25
|
+
Y as validateAssetSize
|
|
6
26
|
};
|