@datum-cloud/strapi-revalidate 0.3.0 → 0.3.1

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.
@@ -7,10 +7,17 @@
7
7
  import { z } from 'zod';
8
8
  import type { WebhookEvent } from '../webhook/types.js';
9
9
  /** Supported cache driver identifiers. */
10
- export declare const cacheDriverNameSchema: z.ZodEnum<["file", "memory", "redis"]>;
10
+ export declare const cacheDriverNameSchema: z.ZodEnum<{
11
+ file: "file";
12
+ memory: "memory";
13
+ redis: "redis";
14
+ }>;
11
15
  export type CacheDriverName = z.infer<typeof cacheDriverNameSchema>;
12
16
  /** Supported transport identifiers for the Strapi client. */
13
- export declare const transportNameSchema: z.ZodEnum<["graphql", "rest"]>;
17
+ export declare const transportNameSchema: z.ZodEnum<{
18
+ graphql: "graphql";
19
+ rest: "rest";
20
+ }>;
14
21
  export type TransportName = z.infer<typeof transportNameSchema>;
15
22
  /**
16
23
  * Full runtime configuration schema.
@@ -23,95 +30,30 @@ export declare const revalidateConfigSchema: z.ZodObject<{
23
30
  token: z.ZodOptional<z.ZodString>;
24
31
  webhook: z.ZodOptional<z.ZodObject<{
25
32
  secret: z.ZodOptional<z.ZodString>;
26
- tagMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
27
- onRevalidate: z.ZodOptional<z.ZodType<(event: WebhookEvent) => void | Promise<void>, z.ZodTypeDef, (event: WebhookEvent) => void | Promise<void>>>;
28
- /**
29
- * When true (default), an `onRevalidate` hook failure returns HTTP 502 with
30
- * `{ ok: false, invalidated: true }` so webhook callers can detect partial
31
- * failure after cache invalidation. Set false to preserve the pre-0.3.0
32
- * behaviour of logging the error and returning 200.
33
- */
33
+ tagMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
34
+ onRevalidate: z.ZodOptional<z.ZodCustom<(event: WebhookEvent) => void | Promise<void>, (event: WebhookEvent) => void | Promise<void>>>;
34
35
  failOnWarmError: z.ZodDefault<z.ZodBoolean>;
35
- }, "strip", z.ZodTypeAny, {
36
- failOnWarmError: boolean;
37
- secret?: string | undefined;
38
- tagMap?: Record<string, string[]> | undefined;
39
- onRevalidate?: ((event: WebhookEvent) => void | Promise<void>) | undefined;
40
- }, {
41
- secret?: string | undefined;
42
- tagMap?: Record<string, string[]> | undefined;
43
- onRevalidate?: ((event: WebhookEvent) => void | Promise<void>) | undefined;
44
- failOnWarmError?: boolean | undefined;
45
- }>>;
46
- cache: z.ZodDefault<z.ZodObject<{
47
- driver: z.ZodDefault<z.ZodEnum<["file", "memory", "redis"]>>;
36
+ }, z.core.$strip>>;
37
+ cache: z.ZodPrefault<z.ZodObject<{
38
+ driver: z.ZodDefault<z.ZodEnum<{
39
+ file: "file";
40
+ memory: "memory";
41
+ redis: "redis";
42
+ }>>;
48
43
  ttl: z.ZodDefault<z.ZodNumber>;
49
44
  dir: z.ZodDefault<z.ZodString>;
50
45
  fallbackDir: z.ZodDefault<z.ZodString>;
51
46
  redisUrl: z.ZodOptional<z.ZodString>;
52
47
  keyPrefix: z.ZodOptional<z.ZodString>;
53
- }, "strip", z.ZodTypeAny, {
54
- driver: "file" | "memory" | "redis";
55
- ttl: number;
56
- dir: string;
57
- fallbackDir: string;
58
- redisUrl?: string | undefined;
59
- keyPrefix?: string | undefined;
60
- }, {
61
- driver?: "file" | "memory" | "redis" | undefined;
62
- ttl?: number | undefined;
63
- dir?: string | undefined;
64
- fallbackDir?: string | undefined;
65
- redisUrl?: string | undefined;
66
- keyPrefix?: string | undefined;
48
+ }, z.core.$strip>>;
49
+ transport: z.ZodDefault<z.ZodEnum<{
50
+ graphql: "graphql";
51
+ rest: "rest";
67
52
  }>>;
68
- transport: z.ZodDefault<z.ZodEnum<["graphql", "rest"]>>;
69
53
  timeout: z.ZodDefault<z.ZodNumber>;
70
54
  retry: z.ZodDefault<z.ZodNumber>;
71
55
  debug: z.ZodDefault<z.ZodBoolean>;
72
- }, "strip", z.ZodTypeAny, {
73
- url: string;
74
- cache: {
75
- driver: "file" | "memory" | "redis";
76
- ttl: number;
77
- dir: string;
78
- fallbackDir: string;
79
- redisUrl?: string | undefined;
80
- keyPrefix?: string | undefined;
81
- };
82
- transport: "graphql" | "rest";
83
- timeout: number;
84
- retry: number;
85
- debug: boolean;
86
- token?: string | undefined;
87
- webhook?: {
88
- failOnWarmError: boolean;
89
- secret?: string | undefined;
90
- tagMap?: Record<string, string[]> | undefined;
91
- onRevalidate?: ((event: WebhookEvent) => void | Promise<void>) | undefined;
92
- } | undefined;
93
- }, {
94
- url: string;
95
- token?: string | undefined;
96
- webhook?: {
97
- secret?: string | undefined;
98
- tagMap?: Record<string, string[]> | undefined;
99
- onRevalidate?: ((event: WebhookEvent) => void | Promise<void>) | undefined;
100
- failOnWarmError?: boolean | undefined;
101
- } | undefined;
102
- cache?: {
103
- driver?: "file" | "memory" | "redis" | undefined;
104
- ttl?: number | undefined;
105
- dir?: string | undefined;
106
- fallbackDir?: string | undefined;
107
- redisUrl?: string | undefined;
108
- keyPrefix?: string | undefined;
109
- } | undefined;
110
- transport?: "graphql" | "rest" | undefined;
111
- timeout?: number | undefined;
112
- retry?: number | undefined;
113
- debug?: boolean | undefined;
114
- }>;
56
+ }, z.core.$strip>;
115
57
  /** User-supplied configuration (pre-validation). */
116
58
  export type RevalidateConfigInput = z.input<typeof revalidateConfigSchema>;
117
59
  /** Validated, defaults-applied configuration. */
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,0CAA0C;AAC1C,eAAO,MAAM,qBAAqB,wCAAsC,CAAC;AACzE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC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AAC/D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAoChE;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;;;;;;wDApBb,YAAY,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,UAArC,YAAY,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;iBA6BzD,CAAC;AAEH,oDAAoD;AACpD,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE3E,iDAAiD;AACjD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -18,11 +18,11 @@ const cacheConfigSchema = z
18
18
  redisUrl: z.string().url().optional(),
19
19
  keyPrefix: z.string().optional(),
20
20
  })
21
- .default({});
21
+ .prefault({});
22
22
  const webhookConfigSchema = z
23
23
  .object({
24
24
  secret: z.string().optional(),
25
- tagMap: z.record(z.array(z.string())).optional(),
25
+ tagMap: z.record(z.string(), z.array(z.string())).optional(),
26
26
  // `z.function().args(...).returns(...)` is a zod v3-only chain — v4 reshaped
27
27
  // the function schema API and removed it. Use `z.custom` instead so the schema
28
28
  // loads under either major version. Runtime validation still ensures the value
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,0CAA0C;AAC1C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAGzE,6DAA6D;AAC7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,C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G,EAAE;IACrB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACnC,OAAO,EAAE,mBAAmB;IAC5B,KAAK,EAAE,iBAAiB;IACxB,SAAS,EAAE,mBAAmB,CAAC,OAAO,CAAC,SAAS,CAAC;IACjD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAClD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACzC,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CAClC,CAAC,CAAC","sourcesContent":["/**\n * Runtime configuration schema for strapi-revalidate.\n *\n * Validated with zod so misconfigurations surface at startup rather than\n * at the first cache miss or webhook delivery.\n */\n\nimport { z } from 'zod';\nimport type { WebhookEvent } from '../webhook/types.js';\n\n/** Supported cache driver identifiers. */\nexport const cacheDriverNameSchema = z.enum(['file', 'memory', 'redis']);\nexport type CacheDriverName = z.infer<typeof cacheDriverNameSchema>;\n\n/** Supported transport identifiers for the Strapi client. */\nexport const transportNameSchema = z.enum(['graphql', 'rest']);\nexport type TransportName = z.infer<typeof transportNameSchema>;\n\nconst cacheConfigSchema = z\n .object({\n driver: cacheDriverNameSchema.default('file'),\n ttl: z.number().int().positive().default(3600),\n dir: z.string().default('.cache/strapi-revalidate'),\n fallbackDir: z.string().default('.cache/strapi-fallback'),\n redisUrl: z.string().url().optional(),\n keyPrefix: z.string().optional(),\n })\n .default({});\n\nconst webhookConfigSchema = z\n .object({\n secret: z.string().optional(),\n tagMap: z.record(z.array(z.string())).optional(),\n // `z.function().args(...).returns(...)` is a zod v3-only chain — v4 reshaped\n // the function schema API and removed it. Use `z.custom` instead so the schema\n // loads under either major version. Runtime validation still ensures the value\n // is a function; the TS-level signature carries the typed shape.\n onRevalidate: z\n .custom<(event: WebhookEvent) => void | Promise<void>>(\n (val) => typeof val === 'function'\n )\n .optional(),\n /**\n * When true (default), an `onRevalidate` hook failure returns HTTP 502 with\n * `{ ok: false, invalidated: true }` so webhook callers can detect partial\n * failure after cache invalidation. Set false to preserve the pre-0.3.0\n * behaviour of logging the error and returning 200.\n */\n failOnWarmError: z.boolean().default(true),\n })\n .optional();\n\n/**\n * Full runtime configuration schema.\n *\n * Use `revalidateConfigSchema.parse(input)` to validate user input and\n * apply defaults in one step.\n */\nexport const revalidateConfigSchema = z.object({\n url: z.string().url(),\n token: z.string().min(1).optional(),\n webhook: webhookConfigSchema,\n cache: cacheConfigSchema,\n transport: transportNameSchema.default('graphql'),\n timeout: z.number().int().positive().default(3000),\n retry: z.number().int().min(0).default(2),\n debug: z.boolean().default(false),\n});\n\n/** User-supplied configuration (pre-validation). */\nexport type RevalidateConfigInput = z.input<typeof revalidateConfigSchema>;\n\n/** Validated, defaults-applied configuration. */\nexport type RevalidateConfig = z.output<typeof revalidateConfigSchema>;\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,0CAA0C;AAC1C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAGzE,6DAA6D;AAC7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;AAG/D,MAAM,iBAAiB,GAAG,CAAC;KACxB,MAAM,CAAC;IACN,MAAM,EAAE,qBAAqB,CAAC,OAAO,CAAC,MAAM,CAAC;IAC7C,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE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AAmB;IAC5B,KAAK,EAAE,iBAAiB;IACxB,SAAS,EAAE,mBAAmB,CAAC,OAAO,CAAC,SAAS,CAAC;IACjD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAClD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACzC,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CAClC,CAAC,CAAC","sourcesContent":["/**\n * Runtime configuration schema for strapi-revalidate.\n *\n * Validated with zod so misconfigurations surface at startup rather than\n * at the first cache miss or webhook delivery.\n */\n\nimport { z } from 'zod';\nimport type { WebhookEvent } from '../webhook/types.js';\n\n/** Supported cache driver identifiers. */\nexport const cacheDriverNameSchema = z.enum(['file', 'memory', 'redis']);\nexport type CacheDriverName = z.infer<typeof cacheDriverNameSchema>;\n\n/** Supported transport identifiers for the Strapi client. */\nexport const transportNameSchema = z.enum(['graphql', 'rest']);\nexport type TransportName = z.infer<typeof transportNameSchema>;\n\nconst cacheConfigSchema = z\n .object({\n driver: cacheDriverNameSchema.default('file'),\n ttl: z.number().int().positive().default(3600),\n dir: z.string().default('.cache/strapi-revalidate'),\n fallbackDir: z.string().default('.cache/strapi-fallback'),\n redisUrl: z.string().url().optional(),\n keyPrefix: z.string().optional(),\n })\n .prefault({});\n\nconst webhookConfigSchema = z\n .object({\n secret: z.string().optional(),\n tagMap: z.record(z.string(), z.array(z.string())).optional(),\n // `z.function().args(...).returns(...)` is a zod v3-only chain — v4 reshaped\n // the function schema API and removed it. Use `z.custom` instead so the schema\n // loads under either major version. Runtime validation still ensures the value\n // is a function; the TS-level signature carries the typed shape.\n onRevalidate: z\n .custom<(event: WebhookEvent) => void | Promise<void>>(\n (val) => typeof val === 'function'\n )\n .optional(),\n /**\n * When true (default), an `onRevalidate` hook failure returns HTTP 502 with\n * `{ ok: false, invalidated: true }` so webhook callers can detect partial\n * failure after cache invalidation. Set false to preserve the pre-0.3.0\n * behaviour of logging the error and returning 200.\n */\n failOnWarmError: z.boolean().default(true),\n })\n .optional();\n\n/**\n * Full runtime configuration schema.\n *\n * Use `revalidateConfigSchema.parse(input)` to validate user input and\n * apply defaults in one step.\n */\nexport const revalidateConfigSchema = z.object({\n url: z.string().url(),\n token: z.string().min(1).optional(),\n webhook: webhookConfigSchema,\n cache: cacheConfigSchema,\n transport: transportNameSchema.default('graphql'),\n timeout: z.number().int().positive().default(3000),\n retry: z.number().int().min(0).default(2),\n debug: z.boolean().default(false),\n});\n\n/** User-supplied configuration (pre-validation). */\nexport type RevalidateConfigInput = z.input<typeof revalidateConfigSchema>;\n\n/** Validated, defaults-applied configuration. */\nexport type RevalidateConfig = z.output<typeof revalidateConfigSchema>;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datum-cloud/strapi-revalidate",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Framework-agnostic runtime cache invalidation for Strapi v5 in SSR frontends. Receives Strapi publish webhooks, clears affected cache tags, next request serves fresh data.",
5
5
  "keywords": [
6
6
  "strapi",
@@ -72,7 +72,7 @@
72
72
  "access": "public"
73
73
  },
74
74
  "dependencies": {
75
- "zod": "^3.23.0"
75
+ "zod": "^4.6.6"
76
76
  },
77
77
  "peerDependencies": {
78
78
  "typescript": ">=5.0.0"
@@ -86,9 +86,9 @@
86
86
  "ioredis": "^5.0.0"
87
87
  },
88
88
  "devDependencies": {
89
- "@changesets/cli": "^2.31.0",
90
- "@types/node": "^20.0.0",
89
+ "@changesets/cli": "^2.31.1",
90
+ "@types/node": "^26.6.0",
91
91
  "typescript": "^5.4.0",
92
- "vitest": "^1.6.0"
92
+ "vitest": "^4.0.0"
93
93
  }
94
94
  }