Skip to content

Commit

Permalink
feat: add type for invalidate webhook (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Walkeezy authored Sep 27, 2024
1 parent e8aa483 commit f198853
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
12 changes: 12 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -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[];
};
};
};

0 comments on commit f198853

Please sign in to comment.