@smartive/datocms-utils 1.2.0 → 1.3.0

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
- # [1.2.0](https://github.com/smartive/datocms-utils/compare/v1.1.0...v1.2.0) (2024-09-27)
1
+ # [1.3.0](https://github.com/smartive/datocms-utils/compare/v1.2.0...v1.3.0) (2024-09-27)
2
2
 
3
3
 
4
4
  ### Features
5
5
 
6
- * check for empty cachtags ([#4](https://github.com/smartive/datocms-utils/issues/4)) ([e8aa483](https://github.com/smartive/datocms-utils/commit/e8aa483ca9f27462331e08c8e80bd257adca064f))
6
+ * add type for invalidate webhook ([#5](https://github.com/smartive/datocms-utils/issues/5)) ([f198853](https://github.com/smartive/datocms-utils/commit/f198853586cda7662266bee1fe1ff3fcbd607741))
package/README.md CHANGED
@@ -37,3 +37,8 @@ CREATE TABLE IF NOT EXISTS query_cache_tags (
37
37
  ### Other Utilities
38
38
 
39
39
  - `classNames`: Cleans and joins an array of inputs with possible undefined or boolean values. Useful for tailwind classnames.
40
+
41
+ ### Types
42
+
43
+ - `CacheTag`: A branded type for cache tags.
44
+ - `CacheTagsInvalidateWebhook`: The payload of the DatoCMS cache tags invalidate webhook.
package/dist/types.d.ts CHANGED
@@ -1,3 +1,14 @@
1
1
  export type CacheTag = string & {
2
2
  readonly _: unique symbol;
3
3
  };
4
+ export type CacheTagsInvalidateWebhook = {
5
+ entity_type: 'cda_cache_tags';
6
+ event_type: 'invalidate';
7
+ entity: {
8
+ id: 'cda_cache_tags';
9
+ type: 'cda_cache_tags';
10
+ attributes: {
11
+ tags: CacheTag[];
12
+ };
13
+ };
14
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartive/datocms-utils",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "A set of utilities and helpers to work with DatoCMS in a Next.js project.",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
package/src/types.ts CHANGED
@@ -1 +1,13 @@
1
1
  export type CacheTag = string & { readonly _: unique symbol };
2
+
3
+ export type CacheTagsInvalidateWebhook = {
4
+ entity_type: 'cda_cache_tags';
5
+ event_type: 'invalidate';
6
+ entity: {
7
+ id: 'cda_cache_tags';
8
+ type: 'cda_cache_tags';
9
+ attributes: {
10
+ tags: CacheTag[];
11
+ };
12
+ };
13
+ };