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