strapi-cache 1.6.2 → 1.8.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.
- package/README.md +7 -2
- package/dist/_chunks/de-C_gFyhHL.mjs +18 -0
- package/dist/_chunks/de-l6MDDAXu.js +18 -0
- package/dist/_chunks/en-D9w03LyX.js +18 -0
- package/dist/_chunks/en-bK2OKwtN.mjs +18 -0
- package/dist/_chunks/index-B_MAAg0W.js +52 -0
- package/dist/_chunks/index-BwuX8jJl.mjs +396 -0
- package/dist/_chunks/index-CkLhx2ik.mjs +52 -0
- package/dist/_chunks/index-D_ssKKxu.js +395 -0
- package/dist/admin/index.js +3 -0
- package/dist/admin/index.mjs +4 -0
- package/dist/admin/src/components/PurgeCacheButton/index.d.ts +1 -1
- package/dist/admin/src/components/PurgeModal/index.d.ts +2 -1
- package/dist/admin/src/hooks/useCacheConfig.d.ts +1 -0
- package/dist/admin/src/hooks/useCacheOperations.d.ts +1 -0
- package/dist/server/index.js +999 -0
- package/dist/server/index.mjs +997 -0
- package/dist/server/src/bootstrap.d.ts +5 -0
- package/dist/server/src/config/index.d.ts +28 -0
- package/dist/server/src/content-types/index.d.ts +2 -0
- package/dist/server/src/controllers/controller.d.ts +10 -0
- package/dist/server/src/controllers/index.d.ts +11 -0
- package/dist/server/src/index.d.ts +76 -0
- package/dist/server/src/middlewares/cache.d.ts +3 -0
- package/dist/server/src/middlewares/graphql.d.ts +2 -0
- package/dist/server/src/middlewares/index.d.ts +6 -0
- package/dist/server/src/permissions.d.ts +6 -0
- package/dist/server/src/policies/index.d.ts +2 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/routes/index.d.ts +19 -0
- package/dist/server/src/routes/purge.d.ts +14 -0
- package/dist/server/src/services/index.d.ts +8 -0
- package/dist/server/src/services/memory/provider.d.ts +17 -0
- package/dist/server/src/services/memory/service.d.ts +6 -0
- package/dist/server/src/services/redis/provider.d.ts +23 -0
- package/dist/server/src/services/redis/service.d.ts +6 -0
- package/dist/server/src/services/resolver.d.ts +3 -0
- package/dist/server/src/types/cache.types.d.ts +18 -0
- package/dist/server/src/utils/body.d.ts +7 -0
- package/dist/server/src/utils/graphql.d.ts +6 -0
- package/dist/server/src/utils/header.d.ts +10 -0
- package/dist/server/src/utils/invalidateCache.d.ts +8 -0
- package/dist/server/src/utils/key.d.ts +5 -0
- package/dist/server/src/utils/log.d.ts +5 -0
- package/dist/server/src/utils/withTimeout.d.ts +1 -0
- package/package.json +16 -2
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const react = require("react");
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const admin = require("@strapi/strapi/admin");
|
|
5
|
+
const reactIntl = require("react-intl");
|
|
6
|
+
const icons = require("@strapi/icons");
|
|
7
|
+
const designSystem = require("@strapi/design-system");
|
|
8
|
+
const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
|
|
9
|
+
const v = glob[path];
|
|
10
|
+
if (v) {
|
|
11
|
+
return typeof v === "function" ? v() : Promise.resolve(v);
|
|
12
|
+
}
|
|
13
|
+
return new Promise((_, reject) => {
|
|
14
|
+
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
|
15
|
+
reject.bind(
|
|
16
|
+
null,
|
|
17
|
+
new Error(
|
|
18
|
+
"Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
|
|
19
|
+
)
|
|
20
|
+
)
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
const PLUGIN_ID = "strapi-cache";
|
|
25
|
+
const Initializer = ({ setPlugin }) => {
|
|
26
|
+
const ref = react.useRef(setPlugin);
|
|
27
|
+
react.useEffect(() => {
|
|
28
|
+
ref.current(PLUGIN_ID);
|
|
29
|
+
}, []);
|
|
30
|
+
return null;
|
|
31
|
+
};
|
|
32
|
+
const useCacheConfig = (enabled = true) => {
|
|
33
|
+
const [config, setConfig] = react.useState();
|
|
34
|
+
const [isLoading, setIsLoading] = react.useState(false);
|
|
35
|
+
const [error, setError] = react.useState(null);
|
|
36
|
+
const { get } = admin.useFetchClient();
|
|
37
|
+
react.useEffect(() => {
|
|
38
|
+
if (!enabled) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const fetchConfig = async () => {
|
|
42
|
+
setIsLoading(true);
|
|
43
|
+
setError(null);
|
|
44
|
+
try {
|
|
45
|
+
const { data } = await get("/strapi-cache/config");
|
|
46
|
+
setConfig(data);
|
|
47
|
+
} catch (error2) {
|
|
48
|
+
setError(error2);
|
|
49
|
+
} finally {
|
|
50
|
+
setIsLoading(false);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
fetchConfig();
|
|
54
|
+
}, [enabled, get]);
|
|
55
|
+
return {
|
|
56
|
+
config,
|
|
57
|
+
isLoading,
|
|
58
|
+
error,
|
|
59
|
+
refetch: () => {
|
|
60
|
+
const fetchConfig = async () => {
|
|
61
|
+
setIsLoading(true);
|
|
62
|
+
setError(null);
|
|
63
|
+
try {
|
|
64
|
+
const { data } = await get("/strapi-cache/config");
|
|
65
|
+
setConfig(data);
|
|
66
|
+
} catch (error2) {
|
|
67
|
+
setError(error2);
|
|
68
|
+
} finally {
|
|
69
|
+
setIsLoading(false);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
fetchConfig();
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
const pluginPermissions = {
|
|
77
|
+
purge: [{ action: "plugin::strapi-cache.purge-cache", subject: null }]
|
|
78
|
+
};
|
|
79
|
+
const useCachePermissions = () => {
|
|
80
|
+
const { allowedActions } = admin.useRBAC(pluginPermissions);
|
|
81
|
+
return {
|
|
82
|
+
canPurgeCache: allowedActions.canPurgeCache,
|
|
83
|
+
allowedActions
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
const useCacheOperations = () => {
|
|
87
|
+
const { post } = admin.useFetchClient();
|
|
88
|
+
const isCacheableRoute = (keyToUse, contentTypeName, config) => {
|
|
89
|
+
if (!keyToUse || !config) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
const { cacheableRoutes } = config;
|
|
93
|
+
return cacheableRoutes.length === 0 || cacheableRoutes.some((route) => {
|
|
94
|
+
return route.includes(keyToUse) || contentTypeName && route.includes(contentTypeName);
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
const clearCache = async (keyToUse) => {
|
|
98
|
+
if (!keyToUse) {
|
|
99
|
+
return {
|
|
100
|
+
success: false,
|
|
101
|
+
message: "No content type found"
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
try {
|
|
105
|
+
await post(
|
|
106
|
+
`/strapi-cache/purge-cache/key`,
|
|
107
|
+
{ key: keyToUse },
|
|
108
|
+
{
|
|
109
|
+
headers: {
|
|
110
|
+
"Content-Type": "application/json"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
return {
|
|
115
|
+
success: true,
|
|
116
|
+
message: `Cache purged successfully for key: "${keyToUse}"`
|
|
117
|
+
};
|
|
118
|
+
} catch (error) {
|
|
119
|
+
return {
|
|
120
|
+
success: false,
|
|
121
|
+
message: `Error purging cache for key: "${keyToUse}"`,
|
|
122
|
+
error
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const clearAllCache = async () => {
|
|
127
|
+
try {
|
|
128
|
+
await post(
|
|
129
|
+
`/strapi-cache/purge-cache`,
|
|
130
|
+
{},
|
|
131
|
+
{
|
|
132
|
+
headers: {
|
|
133
|
+
"Content-Type": "application/json"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
return {
|
|
138
|
+
success: true,
|
|
139
|
+
message: "All cache purged successfully"
|
|
140
|
+
};
|
|
141
|
+
} catch (error) {
|
|
142
|
+
return {
|
|
143
|
+
success: false,
|
|
144
|
+
message: "Error purging all cache",
|
|
145
|
+
error
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
return {
|
|
150
|
+
isCacheableRoute,
|
|
151
|
+
clearCache,
|
|
152
|
+
clearAllCache
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
const useCacheNotifications = (config) => {
|
|
156
|
+
const formatMessage = reactIntl.useIntl().formatMessage;
|
|
157
|
+
const { toggleNotification } = admin.useNotification();
|
|
158
|
+
const showConfigFetchError = (error) => {
|
|
159
|
+
const isPermissionError = error?.response?.status === 403 || error?.response?.status === 401;
|
|
160
|
+
if (!isPermissionError && !config?.disableAdminPopups) {
|
|
161
|
+
toggleNotification({
|
|
162
|
+
type: "warning",
|
|
163
|
+
message: formatMessage({
|
|
164
|
+
id: "strapi-cache.cache.routes.fetch-error",
|
|
165
|
+
defaultMessage: "Unable to fetch cache config. Cache purge may not work correctly."
|
|
166
|
+
})
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
const showPurgeSuccess = (key) => {
|
|
171
|
+
if (!config?.disableAdminPopups) {
|
|
172
|
+
toggleNotification({
|
|
173
|
+
type: "success",
|
|
174
|
+
message: formatMessage(
|
|
175
|
+
{
|
|
176
|
+
id: "strapi-cache.cache.purge.success",
|
|
177
|
+
defaultMessage: "Cache purged successfully"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
key: `"${key}"`
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
const showPurgeError = (key) => {
|
|
187
|
+
if (!config?.disableAdminPopups) {
|
|
188
|
+
toggleNotification({
|
|
189
|
+
type: "danger",
|
|
190
|
+
message: formatMessage(
|
|
191
|
+
{
|
|
192
|
+
id: "strapi-cache.cache.purge.error",
|
|
193
|
+
defaultMessage: "Error purging cache"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
key: `"${key}"`
|
|
197
|
+
}
|
|
198
|
+
)
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
const showNoContentTypeWarning = () => {
|
|
203
|
+
if (!config?.disableAdminPopups) {
|
|
204
|
+
toggleNotification({
|
|
205
|
+
type: "warning",
|
|
206
|
+
message: formatMessage({
|
|
207
|
+
id: "strapi-cache.cache.purge.no-content-type",
|
|
208
|
+
defaultMessage: "No content type found"
|
|
209
|
+
})
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
return {
|
|
214
|
+
showConfigFetchError,
|
|
215
|
+
showPurgeSuccess,
|
|
216
|
+
showPurgeError,
|
|
217
|
+
showNoContentTypeWarning
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
function PurgeModal({
|
|
221
|
+
buttonText,
|
|
222
|
+
keyToUse,
|
|
223
|
+
buttonWidth,
|
|
224
|
+
contentTypeName,
|
|
225
|
+
isSettingsPage,
|
|
226
|
+
isPurgeAll
|
|
227
|
+
}) {
|
|
228
|
+
const { canPurgeCache } = useCachePermissions();
|
|
229
|
+
const { config, error: configError } = useCacheConfig(canPurgeCache);
|
|
230
|
+
const { isCacheableRoute, clearCache, clearAllCache } = useCacheOperations();
|
|
231
|
+
const { showConfigFetchError, showPurgeSuccess, showPurgeError, showNoContentTypeWarning } = useCacheNotifications(config);
|
|
232
|
+
const formatMessage = reactIntl.useIntl().formatMessage;
|
|
233
|
+
react.useEffect(() => {
|
|
234
|
+
if (configError) {
|
|
235
|
+
showConfigFetchError(configError);
|
|
236
|
+
}
|
|
237
|
+
}, [configError, showConfigFetchError]);
|
|
238
|
+
const handleClearCache = async () => {
|
|
239
|
+
if (isPurgeAll) {
|
|
240
|
+
const result2 = await clearAllCache();
|
|
241
|
+
if (result2.success) {
|
|
242
|
+
showPurgeSuccess("all keys");
|
|
243
|
+
} else {
|
|
244
|
+
showPurgeError("all keys");
|
|
245
|
+
}
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
if (!keyToUse) {
|
|
249
|
+
showNoContentTypeWarning();
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const result = await clearCache(keyToUse);
|
|
253
|
+
if (result.success) {
|
|
254
|
+
showPurgeSuccess(keyToUse);
|
|
255
|
+
} else {
|
|
256
|
+
showPurgeError(keyToUse);
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
if (!canPurgeCache || !isPurgeAll && !isSettingsPage && !isCacheableRoute(keyToUse, contentTypeName, config)) {
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Root, { children: [
|
|
263
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
264
|
+
designSystem.Button,
|
|
265
|
+
{
|
|
266
|
+
width: buttonWidth,
|
|
267
|
+
disabled: !isPurgeAll && !keyToUse,
|
|
268
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Archive, {}),
|
|
269
|
+
variant: "danger",
|
|
270
|
+
children: buttonText
|
|
271
|
+
}
|
|
272
|
+
) }),
|
|
273
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Content, { children: [
|
|
274
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Title, { children: buttonText }) }),
|
|
275
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Body, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: isPurgeAll ? formatMessage({
|
|
276
|
+
id: "strapi-cache.cache.purge.confirmation-all",
|
|
277
|
+
defaultMessage: "This purges all items in the cache. Are you sure you want to purge the cache?"
|
|
278
|
+
}) : formatMessage(
|
|
279
|
+
{
|
|
280
|
+
id: "strapi-cache.cache.purge.confirmation",
|
|
281
|
+
defaultMessage: "Are you sure you want to purge the cache?"
|
|
282
|
+
},
|
|
283
|
+
{ key: `"${keyToUse}"` }
|
|
284
|
+
) }) }),
|
|
285
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Footer, { children: [
|
|
286
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Close, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", children: formatMessage({
|
|
287
|
+
id: "strapi-cache.cache.cancel",
|
|
288
|
+
defaultMessage: "No, cancel"
|
|
289
|
+
}) }) }),
|
|
290
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Close, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: handleClearCache, children: formatMessage({
|
|
291
|
+
id: "strapi-cache.cache.confirm",
|
|
292
|
+
defaultMessage: "Yes, confirm"
|
|
293
|
+
}) }) })
|
|
294
|
+
] })
|
|
295
|
+
] })
|
|
296
|
+
] });
|
|
297
|
+
}
|
|
298
|
+
function PurgeCacheButton() {
|
|
299
|
+
const { contentType } = admin.unstable_useContentManagerContext();
|
|
300
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
301
|
+
const { config } = useCacheConfig();
|
|
302
|
+
const keyToUse = contentType?.info.pluralName;
|
|
303
|
+
if (config?.disableAdminButtons) {
|
|
304
|
+
return null;
|
|
305
|
+
}
|
|
306
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
307
|
+
PurgeModal,
|
|
308
|
+
{
|
|
309
|
+
buttonText: formatMessage({
|
|
310
|
+
id: "strapi-cache.cache.purge",
|
|
311
|
+
defaultMessage: "Purge Cache"
|
|
312
|
+
}),
|
|
313
|
+
keyToUse
|
|
314
|
+
}
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
function PurgeEntityButton() {
|
|
318
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
319
|
+
const { id, isSingleType, contentType } = admin.unstable_useContentManagerContext();
|
|
320
|
+
const { config } = useCacheConfig();
|
|
321
|
+
const apiPath = isSingleType ? contentType?.info.singularName : id;
|
|
322
|
+
if (!apiPath) {
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
if (config?.disableAdminButtons) {
|
|
326
|
+
return null;
|
|
327
|
+
}
|
|
328
|
+
const keyToUse = encodeURIComponent(apiPath);
|
|
329
|
+
const contentTypeName = isSingleType ? contentType?.info.singularName : contentType?.info.pluralName;
|
|
330
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
331
|
+
PurgeModal,
|
|
332
|
+
{
|
|
333
|
+
buttonWidth: "100%",
|
|
334
|
+
buttonText: formatMessage({
|
|
335
|
+
id: "strapi-cache.cache.purge.entity",
|
|
336
|
+
defaultMessage: "Purge Entity Cache"
|
|
337
|
+
}),
|
|
338
|
+
keyToUse,
|
|
339
|
+
contentTypeName
|
|
340
|
+
}
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
const index = {
|
|
344
|
+
register(app) {
|
|
345
|
+
app.registerPlugin({
|
|
346
|
+
id: PLUGIN_ID,
|
|
347
|
+
initializer: Initializer,
|
|
348
|
+
isReady: false,
|
|
349
|
+
name: PLUGIN_ID
|
|
350
|
+
});
|
|
351
|
+
app.getPlugin("content-manager").injectComponent("listView", "actions", {
|
|
352
|
+
name: PurgeCacheButton,
|
|
353
|
+
Component: PurgeCacheButton
|
|
354
|
+
});
|
|
355
|
+
app.getPlugin("content-manager").injectComponent("editView", "right-links", {
|
|
356
|
+
name: PurgeEntityButton,
|
|
357
|
+
Component: PurgeEntityButton
|
|
358
|
+
});
|
|
359
|
+
app.createSettingSection(
|
|
360
|
+
{
|
|
361
|
+
id: PLUGIN_ID,
|
|
362
|
+
intlLabel: {
|
|
363
|
+
id: "strapi-cache.settings.link",
|
|
364
|
+
defaultMessage: "Strapi Cache"
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
[
|
|
368
|
+
{
|
|
369
|
+
intlLabel: {
|
|
370
|
+
id: "strapi-cache.settings.link",
|
|
371
|
+
defaultMessage: "Strapi Cache"
|
|
372
|
+
},
|
|
373
|
+
id: "settings",
|
|
374
|
+
to: `${PLUGIN_ID}/settings`,
|
|
375
|
+
Component: () => Promise.resolve().then(() => require("./index-B_MAAg0W.js")),
|
|
376
|
+
permissions: []
|
|
377
|
+
}
|
|
378
|
+
]
|
|
379
|
+
);
|
|
380
|
+
},
|
|
381
|
+
async registerTrads({ locales }) {
|
|
382
|
+
return Promise.all(
|
|
383
|
+
locales.map(async (locale) => {
|
|
384
|
+
try {
|
|
385
|
+
const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/de.json": () => Promise.resolve().then(() => require("./de-l6MDDAXu.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-D9w03LyX.js")) }), `./translations/${locale}.json`, 3);
|
|
386
|
+
return { data, locale };
|
|
387
|
+
} catch {
|
|
388
|
+
return { data: {}, locale };
|
|
389
|
+
}
|
|
390
|
+
})
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
exports.PurgeModal = PurgeModal;
|
|
395
|
+
exports.index = index;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function PurgeCacheButton(): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
declare function PurgeCacheButton(): import("react/jsx-runtime").JSX.Element | null;
|
|
2
2
|
export default PurgeCacheButton;
|
|
@@ -4,6 +4,7 @@ export type PurgeProps = {
|
|
|
4
4
|
keyToUse?: string;
|
|
5
5
|
contentTypeName?: string;
|
|
6
6
|
isSettingsPage?: boolean;
|
|
7
|
+
isPurgeAll?: boolean;
|
|
7
8
|
};
|
|
8
|
-
declare function PurgeModal({ buttonText, keyToUse, buttonWidth, contentTypeName, isSettingsPage, }: PurgeProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
declare function PurgeModal({ buttonText, keyToUse, buttonWidth, contentTypeName, isSettingsPage, isPurgeAll, }: PurgeProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
10
|
export default PurgeModal;
|
|
@@ -7,4 +7,5 @@ export type CacheOperationResult = {
|
|
|
7
7
|
export declare const useCacheOperations: () => {
|
|
8
8
|
isCacheableRoute: (keyToUse?: string, contentTypeName?: string, config?: CacheConfig) => boolean;
|
|
9
9
|
clearCache: (keyToUse?: string) => Promise<CacheOperationResult>;
|
|
10
|
+
clearAllCache: () => Promise<CacheOperationResult>;
|
|
10
11
|
};
|