@contentauth/c2pa-types 0.3.1 → 0.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.
@@ -5,28 +5,8 @@
5
5
  * and run json-schema-to-typescript to regenerate this file.
6
6
  */
7
7
 
8
- /**
9
- * Assertions in C2PA can be stored in several formats
10
- */
11
- export type ManifestAssertionKind = "Cbor" | "Json" | "Binary" | "Uri";
12
8
  export type UriOrResource = ResourceRef | HashedUri;
13
9
  export type DateT = string;
14
- /**
15
- * The type of shape for the range.
16
- */
17
- export type ShapeType = "rectangle" | "circle" | "polygon";
18
- /**
19
- * The type of unit for the range.
20
- */
21
- export type UnitType = "pixel" | "percent";
22
- /**
23
- * The type of time.
24
- */
25
- export type TimeType = "npt";
26
- /**
27
- * The type of range for the region of interest.
28
- */
29
- export type RangeType = "spatial" | "temporal" | "frame" | "textual" | "identified";
30
10
  /**
31
11
  * A role describing the region.
32
12
  */
@@ -41,23 +21,28 @@ export type Role =
41
21
  | "c2pa.styled"
42
22
  | "c2pa.watermarked";
43
23
  /**
44
- * The relationship of the ingredient to the current asset.
24
+ * Assertions in C2PA can be stored in several formats
45
25
  */
46
- export type Relationship = "parentOf" | "componentOf" | "inputTo";
26
+ export type ManifestAssertionKind = "Cbor" | "Json" | "Binary" | "Uri";
47
27
  /**
48
28
  * Describes the digital signature algorithms allowed by the C2PA spec.
49
29
  *
50
30
  * Per [§13.2, “Digital Signatures”]:
51
31
  *
52
- * > All digital signatures applied as per the technical requirements of this > specification shall be generated using one of the digital signature > algorithms and key types listed as described in this section.
32
+ * > All digital signatures applied as per the technical requirements of this
33
+ * > specification shall be generated using one of the digital signature
34
+ * > algorithms and key types listed as described in this section.
53
35
  *
54
36
  * [§13.2, “Digital Signatures”]: https://c2pa.org/specifications/specifications/2.1/specs/C2PA_Specification.html#_digital_signatures
55
37
  */
56
38
  export type SigningAlg = "Es256" | "Es384" | "Es512" | "Ps256" | "Ps384" | "Ps512" | "Ed25519";
57
39
  /**
58
- * Indicates if the manifest store is valid and trusted.
40
+ * Represents the levels of assurance a manifest store achives when evaluated against the C2PA
41
+ * specifications structural, cryptographic, and trust requirements.
59
42
  *
60
- * The Trusted state implies the manifest store is valid and the active signature is trusted.
43
+ * See [§14.3. Validation states].
44
+ *
45
+ * [§14.3. Validation states]: https://spec.c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_validation_states
61
46
  */
62
47
  export type ValidationState = "Invalid" | "Valid" | "Trusted";
63
48
 
@@ -75,6 +60,10 @@ export interface Reader {
75
60
  manifests: {
76
61
  [k: string]: Manifest;
77
62
  };
63
+ /**
64
+ * ValidationStatus generated when loading the ManifestStore from an asset
65
+ */
66
+ validation_status?: ValidationStatus[] | null;
78
67
  /**
79
68
  * ValidationStatus generated when loading the ManifestStore from an asset
80
69
  */
@@ -83,10 +72,6 @@ export interface Reader {
83
72
  * The validation state of the manifest store
84
73
  */
85
74
  validation_state?: ValidationState | null;
86
- /**
87
- * ValidationStatus generated when loading the ManifestStore from an asset
88
- */
89
- validation_status?: ValidationStatus[] | null;
90
75
  [k: string]: unknown;
91
76
  }
92
77
  /**
@@ -94,11 +79,13 @@ export interface Reader {
94
79
  */
95
80
  export interface Manifest {
96
81
  /**
97
- * A list of assertions
82
+ * Optional prefix added to the generated Manifest label.
83
+ * This is typically an internet domain name for the vendor (i.e. `adobe`).
98
84
  */
99
- assertions?: ManifestAssertion[];
85
+ vendor?: string | null;
100
86
  /**
101
- * A User Agent formatted string identifying the software/hardware/system produced this claim Spaces are not allowed in names, versions can be specified with product/1.0 syntax.
87
+ * A User Agent formatted string identifying the software/hardware/system produced this claim
88
+ * Spaces are not allowed in names, versions can be specified with product/1.0 syntax.
102
89
  */
103
90
  claim_generator?: string | null;
104
91
  /**
@@ -106,66 +93,43 @@ export interface Manifest {
106
93
  */
107
94
  claim_generator_info?: ClaimGeneratorInfo[] | null;
108
95
  /**
109
- * A List of verified credentials
96
+ * A list of user metadata for this claim.
110
97
  */
111
- credentials?: unknown[] | null;
98
+ metadata?: AssertionMetadata[] | null;
99
+ /**
100
+ * A human-readable title, generally source filename.
101
+ */
102
+ title?: string | null;
112
103
  /**
113
104
  * The format of the source file as a MIME type.
114
105
  */
115
106
  format?: string | null;
107
+ /**
108
+ * Instance ID from `xmpMM:InstanceID` in XMP metadata.
109
+ */
110
+ instance_id?: string;
111
+ thumbnail?: ResourceRef | null;
116
112
  /**
117
113
  * A List of ingredients
118
114
  */
119
115
  ingredients?: Ingredient[];
120
116
  /**
121
- * Instance ID from `xmpMM:InstanceID` in XMP metadata.
117
+ * A List of verified credentials
122
118
  */
123
- instance_id?: string;
124
- label?: string | null;
119
+ credentials?: unknown[] | null;
125
120
  /**
126
- * A list of user metadata for this claim.
121
+ * A list of assertions
127
122
  */
128
- metadata?: AssertionMetadata[] | null;
123
+ assertions?: ManifestAssertion[];
129
124
  /**
130
125
  * A list of redactions - URIs to a redacted assertions
131
126
  */
132
127
  redactions?: string[] | null;
133
- /**
134
- * container for binary assets (like thumbnails)
135
- */
136
- resources?: ResourceStore;
137
128
  /**
138
129
  * Signature data (only used for reporting)
139
130
  */
140
131
  signature_info?: SignatureInfo | null;
141
- thumbnail?: ResourceRef | null;
142
- /**
143
- * A human-readable title, generally source filename.
144
- */
145
- title?: string | null;
146
- /**
147
- * Optional prefix added to the generated Manifest label. This is typically an internet domain name for the vendor (i.e. `adobe`).
148
- */
149
- vendor?: string | null;
150
- [k: string]: unknown;
151
- }
152
- /**
153
- * A labeled container for an Assertion value in a Manifest
154
- */
155
- export interface ManifestAssertion {
156
- data: unknown;
157
- /**
158
- * There can be more than one assertion for any label
159
- */
160
- instance?: number | null;
161
- /**
162
- * The [ManifestAssertionKind] for this assertion (as stored in c2pa content)
163
- */
164
- kind?: ManifestAssertionKind | null;
165
- /**
166
- * An assertion label in reverse domain format
167
- */
168
- label: string;
132
+ label?: string | null;
169
133
  [k: string]: unknown;
170
134
  }
171
135
  /**
@@ -174,22 +138,22 @@ export interface ManifestAssertion {
174
138
  * This structure is also used for actions softwareAgent
175
139
  */
176
140
  export interface ClaimGeneratorInfo {
177
- /**
178
- * hashed URI to the icon (either embedded or remote)
179
- */
180
- icon?: UriOrResource | null;
181
141
  /**
182
142
  * A human readable string naming the claim_generator
183
143
  */
184
144
  name: string;
185
- /**
186
- * A human readable string of the OS the claim generator is running on
187
- */
188
- operating_system?: string | null;
189
145
  /**
190
146
  * A human readable string of the product's version
191
147
  */
192
148
  version?: string | null;
149
+ /**
150
+ * hashed URI to the icon (either embedded or remote)
151
+ */
152
+ icon?: UriOrResource | null;
153
+ /**
154
+ * A human readable string of the OS the claim generator is running on
155
+ */
156
+ operating_system?: string | null;
193
157
  [k: string]: unknown;
194
158
  }
195
159
  /**
@@ -199,27 +163,29 @@ export interface ClaimGeneratorInfo {
199
163
  */
200
164
  export interface ResourceRef {
201
165
  /**
202
- * The algorithm used to hash the resource (if applicable).
166
+ * The mime type of the referenced resource.
203
167
  */
204
- alg?: string | null;
168
+ format: string;
169
+ /**
170
+ * A URI that identifies the resource as referenced from the manifest.
171
+ *
172
+ * This may be a JUMBF URI, a file path, a URL or any other string.
173
+ * Relative JUMBF URIs will be resolved with the manifest label.
174
+ * Relative file paths will be resolved with the base path if provided.
175
+ */
176
+ identifier: string;
205
177
  /**
206
178
  * More detailed data types as defined in the C2PA spec.
207
179
  */
208
180
  data_types?: AssetType[] | null;
209
181
  /**
210
- * The mime type of the referenced resource.
182
+ * The algorithm used to hash the resource (if applicable).
211
183
  */
212
- format: string;
184
+ alg?: string | null;
213
185
  /**
214
186
  * The hash of the resource (if applicable).
215
187
  */
216
188
  hash?: string | null;
217
- /**
218
- * A URI that identifies the resource as referenced from the manifest.
219
- *
220
- * This may be a JUMBF URI, a file path, a URL or any other string. Relative JUMBF URIs will be resolved with the manifest label. Relative file paths will be resolved with the base path if provided.
221
- */
222
- identifier: string;
223
189
  [k: string]: unknown;
224
190
  }
225
191
  export interface AssetType {
@@ -228,125 +194,38 @@ export interface AssetType {
228
194
  [k: string]: unknown;
229
195
  }
230
196
  /**
231
- * A `HashedUri` provides a reference to content available within the same manifest store.
197
+ * A `HashedUri` provides a reference to content available within the same
198
+ * manifest store.
232
199
  *
233
- * This is described in [§8.3, URI References], of the C2PA Technical Specification.
200
+ * This is described in [§8.3, URI References], of the C2PA Technical
201
+ * Specification.
234
202
  *
235
203
  * [§8.3, URI References]: https://c2pa.org/specifications/specifications/2.1/specs/C2PA_Specification.html#_uri_references
236
204
  */
237
205
  export interface HashedUri {
238
- /**
239
- * A string identifying the cryptographic hash algorithm used to compute the hash
240
- */
241
- alg?: string | null;
242
- /**
243
- * Byte string containing the hash value
244
- */
245
- hash: number[];
246
206
  /**
247
207
  * JUMBF URI reference
248
208
  */
249
209
  url: string;
250
- [k: string]: unknown;
251
- }
252
- /**
253
- * An `Ingredient` is any external asset that has been used in the creation of an asset.
254
- */
255
- export interface Ingredient {
256
- /**
257
- * The active manifest label (if one exists).
258
- *
259
- * If this ingredient has a [`ManifestStore`], this will hold the label of the active [`Manifest`].
260
- *
261
- * [`Manifest`]: crate::Manifest [`ManifestStore`]: crate::ManifestStore
262
- */
263
- active_manifest?: string | null;
264
- /**
265
- * A reference to the actual data of the ingredient.
266
- */
267
- data?: ResourceRef | null;
268
- /**
269
- * Additional information about the data's type to the ingredient V2 structure.
270
- */
271
- data_types?: AssetType[] | null;
272
- /**
273
- * Additional description of the ingredient.
274
- */
275
- description?: string | null;
276
- /**
277
- * Document ID from `xmpMM:DocumentID` in XMP metadata.
278
- */
279
- document_id?: string | null;
280
- /**
281
- * The format of the source file as a MIME type.
282
- */
283
- format?: string | null;
284
- /**
285
- * An optional hash of the asset to prevent duplicates.
286
- */
287
- hash?: string | null;
288
- /**
289
- * URI to an informational page about the ingredient or its data.
290
- */
291
- informational_URI?: string | null;
292
- /**
293
- * Instance ID from `xmpMM:InstanceID` in XMP metadata.
294
- */
295
- instance_id?: string | null;
296
- /**
297
- * The ingredient's label as assigned in the manifest.
298
- */
299
- label?: string | null;
300
- /**
301
- * A [`ManifestStore`] from the source asset extracted as a binary C2PA blob.
302
- *
303
- * [`ManifestStore`]: crate::ManifestStore
304
- */
305
- manifest_data?: ResourceRef | null;
306
- /**
307
- * Any additional [`Metadata`] as defined in the C2PA spec.
308
- *
309
- * [`Metadata`]: crate::Metadata
310
- */
311
- metadata?: AssertionMetadata | null;
312
- ocsp_responses?: ResourceRef[] | null;
313
- /**
314
- * URI from `dcterms:provenance` in XMP metadata.
315
- */
316
- provenance?: string | null;
317
- /**
318
- * Set to `ParentOf` if this is the parent ingredient.
319
- *
320
- * There can only be one parent ingredient in the ingredients.
321
- */
322
- relationship?: Relationship & string;
323
- resources?: ResourceStore;
324
- /**
325
- * A thumbnail image capturing the visual state at the time of import.
326
- *
327
- * A tuple of thumbnail MIME format (for example `image/jpeg`) and binary bits of the image.
328
- */
329
- thumbnail?: ResourceRef | null;
330
- /**
331
- * A human-readable title, generally source filename.
332
- */
333
- title?: string | null;
334
210
  /**
335
- * Validation results (Ingredient.V3)
211
+ * A string identifying the cryptographic hash algorithm used to compute
212
+ * the hash
336
213
  */
337
- validation_results?: ValidationResults | null;
214
+ alg?: string | null;
338
215
  /**
339
- * Validation status (Ingredient v1 & v2)
216
+ * Byte string containing the hash value
340
217
  */
341
- validation_status?: ValidationStatus[] | null;
218
+ hash: number[];
342
219
  [k: string]: unknown;
343
220
  }
344
221
  /**
345
222
  * The AssertionMetadata structure can be used as part of other assertions or on its own to reference others
346
223
  */
347
224
  export interface AssertionMetadata {
348
- dataSource?: DataSource | null;
225
+ reviewRatings?: ReviewRating[] | null;
349
226
  dateTime?: DateT | null;
227
+ reference?: HashedUri | null;
228
+ dataSource?: DataSource | null;
350
229
  localizations?:
351
230
  | {
352
231
  [k: string]: {
@@ -354,9 +233,18 @@ export interface AssertionMetadata {
354
233
  };
355
234
  }[]
356
235
  | null;
357
- reference?: HashedUri | null;
358
236
  regionOfInterest?: RegionOfInterest | null;
359
- reviewRatings?: ReviewRating[] | null;
237
+ [k: string]: unknown;
238
+ }
239
+ /**
240
+ * A rating on an Assertion.
241
+ *
242
+ * See <https://c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_review_ratings>.
243
+ */
244
+ export interface ReviewRating {
245
+ explanation: string;
246
+ code?: string | null;
247
+ value: number;
360
248
  [k: string]: unknown;
361
249
  }
362
250
  /**
@@ -364,69 +252,73 @@ export interface AssertionMetadata {
364
252
  */
365
253
  export interface DataSource {
366
254
  /**
367
- * A list of [`Actor`]s associated with this source.
255
+ * A value from among the enumerated list indicating the source of the assertion.
368
256
  */
369
- actors?: Actor[] | null;
257
+ type: string;
370
258
  /**
371
259
  * A human-readable string giving details about the source of the assertion data.
372
260
  */
373
261
  details?: string | null;
374
262
  /**
375
- * A value from among the enumerated list indicating the source of the assertion.
263
+ * A list of [`Actor`]s associated with this source.
376
264
  */
377
- type: string;
265
+ actors?: Actor[] | null;
378
266
  [k: string]: unknown;
379
267
  }
380
268
  /**
381
269
  * Identifies a person responsible for an action.
382
270
  */
383
271
  export interface Actor {
384
- /**
385
- * List of references to W3C Verifiable Credentials.
386
- */
387
- credentials?: HashedUri[] | null;
388
272
  /**
389
273
  * An identifier for a human actor, used when the "type" is `humanEntry.identified`.
390
274
  */
391
275
  identifier?: string | null;
276
+ /**
277
+ * List of references to W3C Verifiable Credentials.
278
+ */
279
+ credentials?: HashedUri[] | null;
392
280
  [k: string]: unknown;
393
281
  }
394
282
  /**
395
283
  * A region of interest within an asset describing the change.
396
284
  *
397
- * This struct can be used from [`Action::changes`][crate::assertions::Action::changes], [`AssertionMetadata::region_of_interest`][crate::assertions::AssertionMetadata::region_of_interest], or [`SoftBindingScope::region`][crate::assertions::soft_binding::SoftBindingScope::region].
285
+ * This struct can be used from [`Action::changes`][crate::assertions::Action::changes],
286
+ * [`AssertionMetadata::region_of_interest`][crate::assertions::AssertionMetadata::region_of_interest], or
287
+ * [`SoftBindingScope::region`][crate::assertions::soft_binding::SoftBindingScope::region].
398
288
  */
399
289
  export interface RegionOfInterest {
400
290
  /**
401
- * A free-text string.
291
+ * A range describing the region of interest for the specific asset.
402
292
  */
403
- description?: string | null;
293
+ region: Range[];
294
+ /**
295
+ * A free-text string representing a human-readable name for the region which might be used in a user interface.
296
+ */
297
+ name?: string | null;
404
298
  /**
405
299
  * A free-text string representing a machine-readable, unique to this assertion, identifier for the region.
406
300
  */
407
301
  identifier?: string | null;
408
302
  /**
409
- * Additional information about the asset.
303
+ * A value from a controlled vocabulary such as <https://cv.iptc.org/newscodes/imageregiontype/> or an entity-specific
304
+ * value (e.g., com.litware.newType) that represents the type of thing(s) depicted by a region.
305
+ *
306
+ * Note this field serializes/deserializes into the name `type`.
410
307
  */
411
- metadata?: AssertionMetadata | null;
308
+ type?: string | null;
412
309
  /**
413
- * A free-text string representing a human-readable name for the region which might be used in a user interface.
310
+ * A value from our controlled vocabulary or an entity-specific value (e.g., com.litware.coolArea) that represents
311
+ * the role of a region among other regions.
414
312
  */
415
- name?: string | null;
313
+ role?: Role | null;
416
314
  /**
417
- * A range describing the region of interest for the specific asset.
418
- */
419
- region: Range[];
420
- /**
421
- * A value from our controlled vocabulary or an entity-specific value (e.g., com.litware.coolArea) that represents the role of a region among other regions.
315
+ * A free-text string.
422
316
  */
423
- role?: Role | null;
317
+ description?: string | null;
424
318
  /**
425
- * A value from a controlled vocabulary such as <https://cv.iptc.org/newscodes/imageregiontype/> or an entity-specific value (e.g., com.litware.newType) that represents the type of thing(s) depicted by a region.
426
- *
427
- * Note this field serializes/deserializes into the name `type`.
319
+ * Additional information about the asset.
428
320
  */
429
- type?: string | null;
321
+ metadata?: AssertionMetadata | null;
430
322
  [k: string]: unknown;
431
323
  }
432
324
  /**
@@ -434,67 +326,50 @@ export interface RegionOfInterest {
434
326
  */
435
327
  export interface Range {
436
328
  /**
437
- * A frame range.
329
+ * The type of range of interest.
438
330
  */
439
- frame?: Frame | null;
440
- /**
441
- * A item identifier.
442
- */
443
- item?: Item | null;
331
+ type: "spatial" | "temporal" | "frame" | "textual" | "identified";
444
332
  /**
445
333
  * A spatial range.
446
334
  */
447
335
  shape?: Shape | null;
448
- /**
449
- * A textual range.
450
- */
451
- text?: Text | null;
452
336
  /**
453
337
  * A temporal range.
454
338
  */
455
339
  time?: Time | null;
456
340
  /**
457
- * The type of range of interest.
341
+ * A frame range.
458
342
  */
459
- type: RangeType;
460
- [k: string]: unknown;
461
- }
462
- /**
463
- * A frame range representing starting and ending frames or pages.
464
- *
465
- * If both `start` and `end` are missing, the frame will span the entire asset.
466
- */
467
- export interface Frame {
343
+ frame?: Frame | null;
468
344
  /**
469
- * The end of the frame inclusive or the end of the asset if not present.
345
+ * A textual range.
470
346
  */
471
- end?: number | null;
347
+ text?: Text | null;
472
348
  /**
473
- * The start of the frame or the end of the asset if not present.
474
- *
475
- * The first frame/page starts at 0.
349
+ * A item identifier.
476
350
  */
477
- start?: number | null;
351
+ item?: Item | null;
478
352
  [k: string]: unknown;
479
353
  }
480
354
  /**
481
- * Description of the boundaries of an identified range.
355
+ * A spatial range representing rectangle, circle, or a polygon.
482
356
  */
483
- export interface Item {
357
+ export interface Shape {
484
358
  /**
485
- * The container-specific term used to identify items, such as "track_id" for MP4 or "item_ID" for HEIF.
359
+ * The type of shape.
486
360
  */
487
- identifier: string;
361
+ type: "rectangle" | "circle" | "polygon";
488
362
  /**
489
- * The value of the identifier, e.g. a value of "2" for an identifier of "track_id" would imply track 2 of the asset.
363
+ * The type of unit for the shape range.
490
364
  */
491
- value: string;
492
- [k: string]: unknown;
493
- }
494
- /**
495
- * A spatial range representing rectangle, circle, or a polygon.
496
- */
497
- export interface Shape {
365
+ unit: "pixel" | "percent";
366
+ origin: Coordinate;
367
+ /**
368
+ * The width for rectangles or diameter for circles.
369
+ *
370
+ * This field can be ignored for polygons.
371
+ */
372
+ width?: number | null;
498
373
  /**
499
374
  * The height of a rectnagle.
500
375
  *
@@ -507,36 +382,32 @@ export interface Shape {
507
382
  * The default value is true.
508
383
  */
509
384
  inside?: boolean | null;
510
- /**
511
- * THe origin of the coordinate in the shape.
512
- */
513
- origin: Coordinate;
514
- /**
515
- * The type of shape.
516
- */
517
- type: ShapeType;
518
- /**
519
- * The type of unit for the shape range.
520
- */
521
- unit: UnitType;
522
385
  /**
523
386
  * The vertices of the polygon.
524
387
  *
525
388
  * This field can be ignored for rectangles and circles.
526
389
  */
527
- vertices?: Coordinate[] | null;
390
+ vertices?: Coordinate1[] | null;
391
+ [k: string]: unknown;
392
+ }
393
+ /**
394
+ * THe origin of the coordinate in the shape.
395
+ */
396
+ export interface Coordinate {
528
397
  /**
529
- * The width for rectangles or diameter for circles.
530
- *
531
- * This field can be ignored for polygons.
398
+ * The coordinate along the x-axis.
532
399
  */
533
- width?: number | null;
400
+ x: number;
401
+ /**
402
+ * The coordinate along the y-axis.
403
+ */
404
+ y: number;
534
405
  [k: string]: unknown;
535
406
  }
536
407
  /**
537
408
  * An x, y coordinate used for specifying vertices in polygons.
538
409
  */
539
- export interface Coordinate {
410
+ export interface Coordinate1 {
540
411
  /**
541
412
  * The coordinate along the x-axis.
542
413
  */
@@ -547,6 +418,42 @@ export interface Coordinate {
547
418
  y: number;
548
419
  [k: string]: unknown;
549
420
  }
421
+ /**
422
+ * A temporal range representing a starting time to an ending time.
423
+ */
424
+ export interface Time {
425
+ /**
426
+ * The type of time.
427
+ */
428
+ type?: "npt";
429
+ /**
430
+ * The start time or the start of the asset if not present.
431
+ */
432
+ start?: string | null;
433
+ /**
434
+ * The end time or the end of the asset if not present.
435
+ */
436
+ end?: string | null;
437
+ [k: string]: unknown;
438
+ }
439
+ /**
440
+ * A frame range representing starting and ending frames or pages.
441
+ *
442
+ * If both `start` and `end` are missing, the frame will span the entire asset.
443
+ */
444
+ export interface Frame {
445
+ /**
446
+ * The start of the frame or the end of the asset if not present.
447
+ *
448
+ * The first frame/page starts at 0.
449
+ */
450
+ start?: number | null;
451
+ /**
452
+ * The end of the frame inclusive or the end of the asset if not present.
453
+ */
454
+ end?: number | null;
455
+ [k: string]: unknown;
456
+ }
550
457
  /**
551
458
  * A textual range representing multiple (possibly discontinuous) ranges of text.
552
459
  */
@@ -561,26 +468,37 @@ export interface Text {
561
468
  * One or two [`TextSelector`][TextSelector] identifiying the range to select.
562
469
  */
563
470
  export interface TextSelectorRange {
471
+ selector: TextSelector;
564
472
  /**
565
473
  * The end of the text range.
566
474
  */
567
- end?: TextSelector | null;
568
- /**
569
- * The start (or entire) text range.
570
- */
571
- selector: TextSelector;
475
+ end?: TextSelector1 | null;
572
476
  [k: string]: unknown;
573
477
  }
574
478
  /**
575
- * Selects a range of text via a fragment identifier.
576
- *
577
- * This is modeled after the W3C Web Annotation selector model.
479
+ * The start (or entire) text range.
578
480
  */
579
481
  export interface TextSelector {
482
+ /**
483
+ * Fragment identifier as per RFC3023 (XML) or ISO 32000-2 (PDF), Annex O.
484
+ */
485
+ fragment: string;
486
+ /**
487
+ * The start character offset or the start of the fragment if not present.
488
+ */
489
+ start?: number | null;
580
490
  /**
581
491
  * The end character offset or the end of the fragment if not present.
582
492
  */
583
493
  end?: number | null;
494
+ [k: string]: unknown;
495
+ }
496
+ /**
497
+ * Selects a range of text via a fragment identifier.
498
+ *
499
+ * This is modeled after the W3C Web Annotation selector model.
500
+ */
501
+ export interface TextSelector1 {
584
502
  /**
585
503
  * Fragment identifier as per RFC3023 (XML) or ISO 32000-2 (PDF), Annex O.
586
504
  */
@@ -589,54 +507,148 @@ export interface TextSelector {
589
507
  * The start character offset or the start of the fragment if not present.
590
508
  */
591
509
  start?: number | null;
510
+ /**
511
+ * The end character offset or the end of the fragment if not present.
512
+ */
513
+ end?: number | null;
592
514
  [k: string]: unknown;
593
515
  }
594
516
  /**
595
- * A temporal range representing a starting time to an ending time.
517
+ * Description of the boundaries of an identified range.
596
518
  */
597
- export interface Time {
598
- /**
599
- * The end time or the end of the asset if not present.
600
- */
601
- end?: string | null;
519
+ export interface Item {
602
520
  /**
603
- * The start time or the start of the asset if not present.
521
+ * The container-specific term used to identify items, such as "track_id" for MP4 or "item_ID" for HEIF.
604
522
  */
605
- start?: string | null;
523
+ identifier: string;
606
524
  /**
607
- * The type of time.
525
+ * The value of the identifier, e.g. a value of "2" for an identifier of "track_id" would imply track 2 of the asset.
608
526
  */
609
- type?: TimeType & string;
527
+ value: string;
610
528
  [k: string]: unknown;
611
529
  }
612
530
  /**
613
- * A rating on an Assertion.
614
- *
615
- * See <https://c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_review_ratings>.
531
+ * An `Ingredient` is any external asset that has been used in the creation of an asset.
616
532
  */
617
- export interface ReviewRating {
618
- code?: string | null;
619
- explanation: string;
620
- value: number;
533
+ export interface Ingredient {
534
+ /**
535
+ * A human-readable title, generally source filename.
536
+ */
537
+ title?: string | null;
538
+ /**
539
+ * The format of the source file as a MIME type.
540
+ */
541
+ format?: string | null;
542
+ /**
543
+ * Document ID from `xmpMM:DocumentID` in XMP metadata.
544
+ */
545
+ document_id?: string | null;
546
+ /**
547
+ * Instance ID from `xmpMM:InstanceID` in XMP metadata.
548
+ */
549
+ instance_id?: string | null;
550
+ /**
551
+ * URI from `dcterms:provenance` in XMP metadata.
552
+ */
553
+ provenance?: string | null;
554
+ /**
555
+ * A thumbnail image capturing the visual state at the time of import.
556
+ *
557
+ * A tuple of thumbnail MIME format (for example `image/jpeg`) and binary bits of the image.
558
+ */
559
+ thumbnail?: ResourceRef | null;
560
+ /**
561
+ * An optional hash of the asset to prevent duplicates.
562
+ */
563
+ hash?: string | null;
564
+ /**
565
+ * Set to `ParentOf` if this is the parent ingredient.
566
+ *
567
+ * There can only be one parent ingredient in the ingredients.
568
+ */
569
+ relationship?: "parentOf" | "componentOf" | "inputTo";
570
+ /**
571
+ * The active manifest label (if one exists).
572
+ *
573
+ * If this ingredient has a [`ManifestStore`],
574
+ * this will hold the label of the active [`Manifest`].
575
+ *
576
+ * [`Manifest`]: crate::Manifest
577
+ * [`ManifestStore`]: crate::ManifestStore
578
+ */
579
+ active_manifest?: string | null;
580
+ /**
581
+ * Validation status (Ingredient v1 & v2)
582
+ */
583
+ validation_status?: ValidationStatus[] | null;
584
+ /**
585
+ * Validation results (Ingredient.V3)
586
+ */
587
+ validation_results?: ValidationResults | null;
588
+ /**
589
+ * A reference to the actual data of the ingredient.
590
+ */
591
+ data?: ResourceRef | null;
592
+ /**
593
+ * Additional description of the ingredient.
594
+ */
595
+ description?: string | null;
596
+ /**
597
+ * URI to an informational page about the ingredient or its data.
598
+ */
599
+ informational_URI?: string | null;
600
+ /**
601
+ * Any additional [`Metadata`] as defined in the C2PA spec.
602
+ *
603
+ * [`Metadata`]: crate::Metadata
604
+ */
605
+ metadata?: AssertionMetadata | null;
606
+ /**
607
+ * Additional information about the data's type to the ingredient V2 structure.
608
+ */
609
+ data_types?: AssetType[] | null;
610
+ /**
611
+ * A [`ManifestStore`] from the source asset extracted as a binary C2PA blob.
612
+ *
613
+ * [`ManifestStore`]: crate::ManifestStore
614
+ */
615
+ manifest_data?: ResourceRef | null;
616
+ /**
617
+ * The ingredient's label as assigned in the manifest.
618
+ */
619
+ label?: string | null;
620
+ ocsp_responses?: ResourceRef[] | null;
621
621
  [k: string]: unknown;
622
622
  }
623
623
  /**
624
- * Resource store to contain binary objects referenced from JSON serializable structures
624
+ * A `ValidationStatus` struct describes the validation status of a
625
+ * specific part of a manifest.
626
+ *
627
+ * See <https://c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_existing_manifests>.
625
628
  */
626
- export interface ResourceStore {
627
- label?: string | null;
628
- resources: {
629
- [k: string]: number[];
630
- };
629
+ export interface ValidationStatus {
630
+ code: string;
631
+ url?: string | null;
632
+ explanation?: string | null;
633
+ success?: boolean | null;
631
634
  [k: string]: unknown;
632
635
  }
633
636
  /**
634
637
  * A map of validation results for a manifest store.
635
638
  *
636
- * The map contains the validation results for the active manifest and any ingredient deltas. It is normal for there to be many
639
+ * The map contains the validation results for the active manifest and any ingredient deltas.
640
+ * It is normal for there to be many
637
641
  */
638
642
  export interface ValidationResults {
643
+ /**
644
+ * Validation status codes for the ingredient's active manifest. Present if ingredient is a C2PA
645
+ * asset. Not present if the ingredient is not a C2PA asset.
646
+ */
639
647
  activeManifest?: StatusCodes | null;
648
+ /**
649
+ * List of any changes/deltas between the current and previous validation results for each ingredient's
650
+ * manifest. Present if the the ingredient is a C2PA asset.
651
+ */
640
652
  ingredientDeltas?: IngredientDeltaValidationResult[] | null;
641
653
  [k: string]: unknown;
642
654
  }
@@ -644,21 +656,15 @@ export interface ValidationResults {
644
656
  * Contains a set of success, informational, and failure validation status codes.
645
657
  */
646
658
  export interface StatusCodes {
647
- failure: ValidationStatus[];
648
- informational: ValidationStatus[];
659
+ /**
660
+ * An array of validation success codes. May be empty.
661
+ */
649
662
  success: ValidationStatus[];
650
- [k: string]: unknown;
651
- }
652
- /**
653
- * A `ValidationStatus` struct describes the validation status of a specific part of a manifest.
654
- *
655
- * See <https://c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_existing_manifests>.
656
- */
657
- export interface ValidationStatus {
658
- code: string;
659
- explanation?: string | null;
660
- success?: boolean | null;
661
- url?: string | null;
663
+ /**
664
+ * An array of validation informational codes. May be empty.
665
+ */
666
+ informational: ValidationStatus[];
667
+ failure: ValidationStatus[];
662
668
  [k: string]: unknown;
663
669
  }
664
670
  /**
@@ -669,10 +675,46 @@ export interface IngredientDeltaValidationResult {
669
675
  * JUMBF URI reference to the ingredient assertion
670
676
  */
671
677
  ingredientAssertionURI: string;
678
+ validationDeltas: StatusCodes1;
679
+ [k: string]: unknown;
680
+ }
681
+ /**
682
+ * Contains a set of success, informational, and failure validation status codes.
683
+ */
684
+ export interface StatusCodes1 {
672
685
  /**
673
- * Validation results for the ingredient's active manifest
686
+ * An array of validation success codes. May be empty.
674
687
  */
675
- validationDeltas: StatusCodes;
688
+ success: ValidationStatus[];
689
+ /**
690
+ * An array of validation informational codes. May be empty.
691
+ */
692
+ informational: ValidationStatus[];
693
+ failure: ValidationStatus[];
694
+ [k: string]: unknown;
695
+ }
696
+ /**
697
+ * A labeled container for an Assertion value in a Manifest
698
+ */
699
+ export interface ManifestAssertion {
700
+ /**
701
+ * An assertion label in reverse domain format
702
+ */
703
+ label: string;
704
+ data: unknown;
705
+ /**
706
+ * There can be more than one assertion for any label
707
+ */
708
+ instance?: number | null;
709
+ /**
710
+ * The [ManifestAssertionKind] for this assertion (as stored in c2pa content)
711
+ */
712
+ kind?: ManifestAssertionKind | null;
713
+ /**
714
+ * True if this assertion is attributed to the signer
715
+ * This maps to a created vs a gathered assertion. (defaults to false)
716
+ */
717
+ created?: boolean;
676
718
  [k: string]: unknown;
677
719
  }
678
720
  /**
@@ -684,24 +726,24 @@ export interface SignatureInfo {
684
726
  */
685
727
  alg?: SigningAlg | null;
686
728
  /**
687
- * The serial number of the certificate.
729
+ * Human-readable issuing authority for this signature.
688
730
  */
689
- cert_serial_number?: string | null;
731
+ issuer?: string | null;
690
732
  /**
691
733
  * Human-readable for common name of this certificate.
692
734
  */
693
735
  common_name?: string | null;
694
736
  /**
695
- * Human-readable issuing authority for this signature.
696
- */
697
- issuer?: string | null;
698
- /**
699
- * Revocation status of the certificate.
737
+ * The serial number of the certificate.
700
738
  */
701
- revocation_status?: boolean | null;
739
+ cert_serial_number?: string | null;
702
740
  /**
703
741
  * The time the signature was created.
704
742
  */
705
743
  time?: string | null;
744
+ /**
745
+ * Revocation status of the certificate.
746
+ */
747
+ revocation_status?: boolean | null;
706
748
  [k: string]: unknown;
707
749
  }