diff --git a/README.md b/README.md index 43e330f..56b0fdd 100644 --- a/README.md +++ b/README.md @@ -37,3 +37,8 @@ CREATE TABLE IF NOT EXISTS query_cache_tags ( ### Other Utilities - `classNames`: Cleans and joins an array of inputs with possible undefined or boolean values. Useful for tailwind classnames. + +### Types + +- `CacheTag`: A branded type for cache tags. +- `CacheTagsInvalidateWebhook`: The payload of the DatoCMS cache tags invalidate webhook. diff --git a/src/types.ts b/src/types.ts index 281a580..e6cdedc 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1 +1,13 @@ export type CacheTag = string & { readonly _: unique symbol }; + +export type CacheTagsInvalidateWebhook = { + entity_type: 'cda_cache_tags'; + event_type: 'invalidate'; + entity: { + id: 'cda_cache_tags'; + type: 'cda_cache_tags'; + attributes: { + tags: CacheTag[]; + }; + }; +};