Skip to content

Commit 1649184

Browse files
authored
fix: allow optional templates in actions v2 (#250)
1 parent 5e0bd87 commit 1649184

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@contentauth/toolkit",
5+
"comment": "Make templates optional in actions v2",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@contentauth/toolkit"
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "c2pa",
5+
"comment": "Handle non-existent templates in actions v2",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "c2pa"
10+
}

packages/c2pa/src/selectors/isHandmade.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function isHandmadeManifest(manifest: Manifest): boolean {
3030
const actionsHandmade =
3131
actionsV2.length > 0 &&
3232
actionsV2.every(({ data }) => {
33-
const handmadeTemplate = !!data.templates.find(
33+
const handmadeTemplate = !!data.templates?.find(
3434
(template) =>
3535
template.action === '*' &&
3636
template.digitalSourceType ===

packages/toolkit/types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export type C2paActionsAssertionV2 = Assertion<
133133
{
134134
actions: ActionV2[];
135135
allActionsIncluded?: boolean;
136-
templates: Template[];
136+
templates?: Template[];
137137
}
138138
>;
139139

0 commit comments

Comments
 (0)