@contentauth/c2pa-node 0.5.2 → 0.5.3

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.
@@ -454,6 +454,29 @@ describe("Builder", () => {
454
454
  expect(JSON.stringify(manifestStore)).toContain("Test Ingredient");
455
455
  expect(JSON.stringify(manifestStore)).toContain("thumbnail.ingredient");
456
456
  }));
457
+ it("should add ingredient with custom metadata", () => __awaiter(void 0, void 0, void 0, function* () {
458
+ const builder = Builder.new();
459
+ const ingredient = {
460
+ title: "Test Ingredient",
461
+ format: "image/jpeg",
462
+ instance_id: "ingredient-12345",
463
+ relationship: "componentOf",
464
+ metadata: {
465
+ customString: "my custom value",
466
+ customNumber: 42,
467
+ customBool: true,
468
+ customObject: {
469
+ nested: "value",
470
+ count: 123
471
+ },
472
+ customArray: ["item1", "item2", "item3"]
473
+ }
474
+ };
475
+ yield builder.addIngredient(JSON.stringify(ingredient));
476
+ const definition = builder.getManifestDefinition();
477
+ expect(definition.ingredients).toHaveLength(1);
478
+ expect(definition.ingredients[0]).toMatchObject(ingredient);
479
+ }));
457
480
  it("should perform redaction workflow like test_redaction_async", () => __awaiter(void 0, void 0, void 0, function* () {
458
481
  // This test mirrors the Rust test_redaction_async test
459
482
  // Create a reader to get the parent manifest label from the existing source
package/dist/index.node CHANGED
Binary file
@@ -19,6 +19,9 @@ import type {
19
19
  Manifest,
20
20
  ManifestStore,
21
21
  } from "@contentauth/c2pa-types";
22
+
23
+ export type { Ingredient } from "@contentauth/c2pa-types";
24
+
22
25
  /**
23
26
  * Describes the digital signature algorithms allowed by the C2PA spec
24
27
  *
@@ -59,7 +62,7 @@ export type TrustmarkVariant =
59
62
  // Quality Trustmark model
60
63
  | "Q";
61
64
 
62
- type ManifestAssertionKind = "Cbor" | "Json" | "Binary" | "Uri";
65
+ export type ManifestAssertionKind = "Cbor" | "Json" | "Binary" | "Uri";
63
66
 
64
67
  /**
65
68
  * A buffer for the source asset
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/contentauth/c2pa-node-v2.git"
6
6
  },
7
- "version": "0.5.2",
7
+ "version": "0.5.3",
8
8
  "description": "Node.js bindings for C2PA",
9
9
  "main": "dist/index.js",
10
10
  "type": "module",