From 6b5e91ba5bcbe01b8af9554aef1ee8699c29fa87 Mon Sep 17 00:00:00 2001 From: Ben Beckford Date: Mon, 29 Jun 2026 06:51:42 -0700 Subject: [PATCH] chore: update tag filter method declaration --- packages/plugin-core/src/index.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/plugin-core/src/index.ts b/packages/plugin-core/src/index.ts index 90083ab689..526c9586fb 100644 --- a/packages/plugin-core/src/index.ts +++ b/packages/plugin-core/src/index.ts @@ -142,6 +142,24 @@ const methods = wrapper({ return { workflow: { continue: hasTimeZone === needsTimeZone } }; }, + assetTagFilter: ({ config, data }) => { + const assetTags = data.asset.tags.map((tag) => tag.id); + + for (const tag of config.tags) { + if (assetTags.includes(tag)) { + if (config.matching === 'any') { + break; + } else if (config.matching === 'none') { + return { workflow: { continue: false } }; + } + } else if (config.matching === 'all') { + return { workflow: { continue: false } }; + } + } + + return { workflow: { continue: true } }; + }, + assetTypeFilter: ({ config, data }) => { return { workflow: { continue: config.allowedTypes.includes(data.asset.type) } }; }, @@ -177,6 +195,7 @@ const { assetLocationFilter, assetLock, assetMissingTimeZoneFilter, + assetTagFilter, assetTypeFilter, assetVisibility, webhook, @@ -193,6 +212,7 @@ export { assetLocationFilter, assetLock, assetMissingTimeZoneFilter, + assetTagFilter, assetTypeFilter, assetVisibility, webhook,