serwist 9.0.0-preview.24
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/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/NavigationRoute.d.ts +57 -0
- package/dist/NavigationRoute.d.ts.map +1 -0
- package/dist/PrecacheRoute.d.ts +17 -0
- package/dist/PrecacheRoute.d.ts.map +1 -0
- package/dist/PrecacheStrategy.d.ts +66 -0
- package/dist/PrecacheStrategy.d.ts.map +1 -0
- package/dist/RegExpRoute.d.ts +24 -0
- package/dist/RegExpRoute.d.ts.map +1 -0
- package/dist/Route.d.ts +33 -0
- package/dist/Route.d.ts.map +1 -0
- package/dist/Serwist.d.ts +331 -0
- package/dist/Serwist.d.ts.map +1 -0
- package/dist/cacheNames.d.ts +20 -0
- package/dist/cacheNames.d.ts.map +1 -0
- package/dist/chunks/NetworkOnly.js +599 -0
- package/dist/chunks/PrecacheFallbackPlugin.js +634 -0
- package/dist/chunks/Serwist.js +1034 -0
- package/dist/chunks/registerQuotaErrorCallback.js +17 -0
- package/dist/chunks/resultingClientExists.js +32 -0
- package/dist/chunks/timeout.js +400 -0
- package/dist/chunks/waitUntil.js +24 -0
- package/dist/cleanupOutdatedCaches.d.ts +6 -0
- package/dist/cleanupOutdatedCaches.d.ts.map +1 -0
- package/dist/clientsClaim.d.ts +6 -0
- package/dist/clientsClaim.d.ts.map +1 -0
- package/dist/constants.d.ts +15 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/copyResponse.d.ts +20 -0
- package/dist/copyResponse.d.ts.map +1 -0
- package/dist/disableDevLogs.d.ts +7 -0
- package/dist/disableDevLogs.d.ts.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.internal.d.ts +16 -0
- package/dist/index.internal.d.ts.map +1 -0
- package/dist/index.internal.js +24 -0
- package/dist/index.js +27 -0
- package/dist/index.legacy.d.ts +32 -0
- package/dist/index.legacy.d.ts.map +1 -0
- package/dist/index.legacy.js +640 -0
- package/dist/index.plugins.d.ts +41 -0
- package/dist/index.plugins.d.ts.map +1 -0
- package/dist/index.plugins.js +669 -0
- package/dist/index.strategies.d.ts +22 -0
- package/dist/index.strategies.d.ts.map +1 -0
- package/dist/index.strategies.js +144 -0
- package/dist/legacy/PrecacheController.d.ts +146 -0
- package/dist/legacy/PrecacheController.d.ts.map +1 -0
- package/dist/legacy/PrecacheFallbackPlugin.d.ts +62 -0
- package/dist/legacy/PrecacheFallbackPlugin.d.ts.map +1 -0
- package/dist/legacy/PrecacheRoute.d.ts +19 -0
- package/dist/legacy/PrecacheRoute.d.ts.map +1 -0
- package/dist/legacy/Router.d.ts +151 -0
- package/dist/legacy/Router.d.ts.map +1 -0
- package/dist/legacy/addPlugins.d.ts +9 -0
- package/dist/legacy/addPlugins.d.ts.map +1 -0
- package/dist/legacy/addRoute.d.ts +16 -0
- package/dist/legacy/addRoute.d.ts.map +1 -0
- package/dist/legacy/createHandlerBoundToURL.d.ts +18 -0
- package/dist/legacy/createHandlerBoundToURL.d.ts.map +1 -0
- package/dist/legacy/fallbacks.d.ts +59 -0
- package/dist/legacy/fallbacks.d.ts.map +1 -0
- package/dist/legacy/getCacheKeyForURL.d.ts +20 -0
- package/dist/legacy/getCacheKeyForURL.d.ts.map +1 -0
- package/dist/legacy/handlePrecaching.d.ts +54 -0
- package/dist/legacy/handlePrecaching.d.ts.map +1 -0
- package/dist/legacy/installSerwist.d.ts +15 -0
- package/dist/legacy/installSerwist.d.ts.map +1 -0
- package/dist/legacy/matchPrecache.d.ts +15 -0
- package/dist/legacy/matchPrecache.d.ts.map +1 -0
- package/dist/legacy/precache.d.ts +20 -0
- package/dist/legacy/precache.d.ts.map +1 -0
- package/dist/legacy/precacheAndRoute.d.ts +15 -0
- package/dist/legacy/precacheAndRoute.d.ts.map +1 -0
- package/dist/legacy/registerRoute.d.ts +16 -0
- package/dist/legacy/registerRoute.d.ts.map +1 -0
- package/dist/legacy/registerRuntimeCaching.d.ts +11 -0
- package/dist/legacy/registerRuntimeCaching.d.ts.map +1 -0
- package/dist/legacy/setCatchHandler.d.ts +10 -0
- package/dist/legacy/setCatchHandler.d.ts.map +1 -0
- package/dist/legacy/setDefaultHandler.d.ts +13 -0
- package/dist/legacy/setDefaultHandler.d.ts.map +1 -0
- package/dist/legacy/singletonPrecacheController.d.ts +34 -0
- package/dist/legacy/singletonPrecacheController.d.ts.map +1 -0
- package/dist/legacy/singletonRouter.d.ts +41 -0
- package/dist/legacy/singletonRouter.d.ts.map +1 -0
- package/dist/legacy/unregisterRoute.d.ts +9 -0
- package/dist/legacy/unregisterRoute.d.ts.map +1 -0
- package/dist/legacy/utils/PrecacheCacheKeyPlugin.d.ts +16 -0
- package/dist/legacy/utils/PrecacheCacheKeyPlugin.d.ts.map +1 -0
- package/dist/legacy/utils/getCacheKeyForURL.d.ts +14 -0
- package/dist/legacy/utils/getCacheKeyForURL.d.ts.map +1 -0
- package/dist/models/messages/messageGenerator.d.ts +4 -0
- package/dist/models/messages/messageGenerator.d.ts.map +1 -0
- package/dist/models/messages/messages.d.ts +44 -0
- package/dist/models/messages/messages.d.ts.map +1 -0
- package/dist/models/pluginEvents.d.ts +10 -0
- package/dist/models/pluginEvents.d.ts.map +1 -0
- package/dist/models/quotaErrorCallbacks.d.ts +3 -0
- package/dist/models/quotaErrorCallbacks.d.ts.map +1 -0
- package/dist/navigationPreload.d.ts +24 -0
- package/dist/navigationPreload.d.ts.map +1 -0
- package/dist/parseRoute.d.ts +16 -0
- package/dist/parseRoute.d.ts.map +1 -0
- package/dist/plugins/backgroundSync/BackgroundSyncPlugin.d.ts +23 -0
- package/dist/plugins/backgroundSync/BackgroundSyncPlugin.d.ts.map +1 -0
- package/dist/plugins/backgroundSync/Queue.d.ts +166 -0
- package/dist/plugins/backgroundSync/Queue.d.ts.map +1 -0
- package/dist/plugins/backgroundSync/QueueDb.d.ts +90 -0
- package/dist/plugins/backgroundSync/QueueDb.d.ts.map +1 -0
- package/dist/plugins/backgroundSync/QueueStore.d.ts +75 -0
- package/dist/plugins/backgroundSync/QueueStore.d.ts.map +1 -0
- package/dist/plugins/backgroundSync/StorableRequest.d.ts +51 -0
- package/dist/plugins/backgroundSync/StorableRequest.d.ts.map +1 -0
- package/dist/plugins/broadcastUpdate/BroadcastCacheUpdate.d.ts +45 -0
- package/dist/plugins/broadcastUpdate/BroadcastCacheUpdate.d.ts.map +1 -0
- package/dist/plugins/broadcastUpdate/BroadcastUpdatePlugin.d.ts +27 -0
- package/dist/plugins/broadcastUpdate/BroadcastUpdatePlugin.d.ts.map +1 -0
- package/dist/plugins/broadcastUpdate/constants.d.ts +5 -0
- package/dist/plugins/broadcastUpdate/constants.d.ts.map +1 -0
- package/dist/plugins/broadcastUpdate/responsesAreSame.d.ts +11 -0
- package/dist/plugins/broadcastUpdate/responsesAreSame.d.ts.map +1 -0
- package/dist/plugins/broadcastUpdate/types.d.ts +34 -0
- package/dist/plugins/broadcastUpdate/types.d.ts.map +1 -0
- package/dist/plugins/cacheableResponse/CacheableResponse.d.ts +40 -0
- package/dist/plugins/cacheableResponse/CacheableResponse.d.ts.map +1 -0
- package/dist/plugins/cacheableResponse/CacheableResponsePlugin.d.ts +27 -0
- package/dist/plugins/cacheableResponse/CacheableResponsePlugin.d.ts.map +1 -0
- package/dist/plugins/expiration/CacheExpiration.d.ts +66 -0
- package/dist/plugins/expiration/CacheExpiration.d.ts.map +1 -0
- package/dist/plugins/expiration/ExpirationPlugin.d.ts +116 -0
- package/dist/plugins/expiration/ExpirationPlugin.d.ts.map +1 -0
- package/dist/plugins/expiration/models/CacheTimestampsModel.d.ts +73 -0
- package/dist/plugins/expiration/models/CacheTimestampsModel.d.ts.map +1 -0
- package/dist/plugins/googleAnalytics/constants.d.ts +10 -0
- package/dist/plugins/googleAnalytics/constants.d.ts.map +1 -0
- package/dist/plugins/googleAnalytics/initialize.d.ts +30 -0
- package/dist/plugins/googleAnalytics/initialize.d.ts.map +1 -0
- package/dist/plugins/precaching/PrecacheFallbackPlugin.d.ts +53 -0
- package/dist/plugins/precaching/PrecacheFallbackPlugin.d.ts.map +1 -0
- package/dist/plugins/rangeRequests/RangeRequestsPlugin.d.ts +19 -0
- package/dist/plugins/rangeRequests/RangeRequestsPlugin.d.ts.map +1 -0
- package/dist/plugins/rangeRequests/createPartialResponse.d.ts +18 -0
- package/dist/plugins/rangeRequests/createPartialResponse.d.ts.map +1 -0
- package/dist/plugins/rangeRequests/utils/calculateEffectiveBoundaries.d.ts +14 -0
- package/dist/plugins/rangeRequests/utils/calculateEffectiveBoundaries.d.ts.map +1 -0
- package/dist/plugins/rangeRequests/utils/parseRangeHeader.d.ts +12 -0
- package/dist/plugins/rangeRequests/utils/parseRangeHeader.d.ts.map +1 -0
- package/dist/registerQuotaErrorCallback.d.ts +8 -0
- package/dist/registerQuotaErrorCallback.d.ts.map +1 -0
- package/dist/setCacheNameDetails.d.ts +9 -0
- package/dist/setCacheNameDetails.d.ts.map +1 -0
- package/dist/strategies/CacheFirst.d.ts +23 -0
- package/dist/strategies/CacheFirst.d.ts.map +1 -0
- package/dist/strategies/CacheOnly.d.ts +20 -0
- package/dist/strategies/CacheOnly.d.ts.map +1 -0
- package/dist/strategies/NetworkFirst.d.ts +61 -0
- package/dist/strategies/NetworkFirst.d.ts.map +1 -0
- package/dist/strategies/NetworkOnly.d.ts +32 -0
- package/dist/strategies/NetworkOnly.d.ts.map +1 -0
- package/dist/strategies/StaleWhileRevalidate.d.ts +35 -0
- package/dist/strategies/StaleWhileRevalidate.d.ts.map +1 -0
- package/dist/strategies/Strategy.d.ts +83 -0
- package/dist/strategies/Strategy.d.ts.map +1 -0
- package/dist/strategies/StrategyHandler.d.ts +189 -0
- package/dist/strategies/StrategyHandler.d.ts.map +1 -0
- package/dist/strategies/plugins/cacheOkAndOpaquePlugin.d.ts +3 -0
- package/dist/strategies/plugins/cacheOkAndOpaquePlugin.d.ts.map +1 -0
- package/dist/strategies/utils/messages.d.ts +5 -0
- package/dist/strategies/utils/messages.d.ts.map +1 -0
- package/dist/types.d.ts +317 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/Deferred.d.ts +19 -0
- package/dist/utils/Deferred.d.ts.map +1 -0
- package/dist/utils/PrecacheCacheKeyPlugin.d.ts +16 -0
- package/dist/utils/PrecacheCacheKeyPlugin.d.ts.map +1 -0
- package/dist/utils/PrecacheInstallReportPlugin.d.ts +14 -0
- package/dist/utils/PrecacheInstallReportPlugin.d.ts.map +1 -0
- package/dist/utils/SerwistError.d.ts +24 -0
- package/dist/utils/SerwistError.d.ts.map +1 -0
- package/dist/utils/assert.d.ts +11 -0
- package/dist/utils/assert.d.ts.map +1 -0
- package/dist/utils/cacheMatchIgnoreParams.d.ts +15 -0
- package/dist/utils/cacheMatchIgnoreParams.d.ts.map +1 -0
- package/dist/utils/cacheNames.d.ts +40 -0
- package/dist/utils/cacheNames.d.ts.map +1 -0
- package/dist/utils/canConstructReadableStream.d.ts +12 -0
- package/dist/utils/canConstructReadableStream.d.ts.map +1 -0
- package/dist/utils/canConstructResponseFromBodyStream.d.ts +11 -0
- package/dist/utils/canConstructResponseFromBodyStream.d.ts.map +1 -0
- package/dist/utils/createCacheKey.d.ts +16 -0
- package/dist/utils/createCacheKey.d.ts.map +1 -0
- package/dist/utils/deleteOutdatedCaches.d.ts +18 -0
- package/dist/utils/deleteOutdatedCaches.d.ts.map +1 -0
- package/dist/utils/dontWaitFor.d.ts +7 -0
- package/dist/utils/dontWaitFor.d.ts.map +1 -0
- package/dist/utils/executeQuotaErrorCallbacks.d.ts +8 -0
- package/dist/utils/executeQuotaErrorCallbacks.d.ts.map +1 -0
- package/dist/utils/generateURLVariations.d.ts +12 -0
- package/dist/utils/generateURLVariations.d.ts.map +1 -0
- package/dist/utils/getFriendlyURL.d.ts +3 -0
- package/dist/utils/getFriendlyURL.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +24 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/normalizeHandler.d.ts +10 -0
- package/dist/utils/normalizeHandler.d.ts.map +1 -0
- package/dist/utils/pluginUtils.d.ts +5 -0
- package/dist/utils/pluginUtils.d.ts.map +1 -0
- package/dist/utils/printCleanupDetails.d.ts +6 -0
- package/dist/utils/printCleanupDetails.d.ts.map +1 -0
- package/dist/utils/printInstallDetails.d.ts +7 -0
- package/dist/utils/printInstallDetails.d.ts.map +1 -0
- package/dist/utils/removeIgnoredSearchParams.d.ts +12 -0
- package/dist/utils/removeIgnoredSearchParams.d.ts.map +1 -0
- package/dist/utils/resultingClientExists.d.ts +12 -0
- package/dist/utils/resultingClientExists.d.ts.map +1 -0
- package/dist/utils/timeout.d.ts +10 -0
- package/dist/utils/timeout.d.ts.map +1 -0
- package/dist/utils/waitUntil.d.ts +11 -0
- package/dist/utils/waitUntil.d.ts.map +1 -0
- package/dist/utils/welcome.d.ts +2 -0
- package/dist/utils/welcome.d.ts.map +1 -0
- package/package.json +85 -0
- package/src/NavigationRoute.ts +119 -0
- package/src/PrecacheRoute.ts +46 -0
- package/src/PrecacheStrategy.ts +239 -0
- package/src/RegExpRoute.ts +74 -0
- package/src/Route.ts +67 -0
- package/src/Serwist.ts +920 -0
- package/src/cacheNames.ts +39 -0
- package/src/cleanupOutdatedCaches.ts +32 -0
- package/src/clientsClaim.ts +18 -0
- package/src/constants.ts +24 -0
- package/src/copyResponse.ts +60 -0
- package/src/disableDevLogs.ts +10 -0
- package/src/index.internal.ts +33 -0
- package/src/index.legacy.ts +66 -0
- package/src/index.plugins.ts +95 -0
- package/src/index.strategies.ts +26 -0
- package/src/index.ts +39 -0
- package/src/legacy/PrecacheController.ts +337 -0
- package/src/legacy/PrecacheFallbackPlugin.ts +93 -0
- package/src/legacy/PrecacheRoute.ts +48 -0
- package/src/legacy/Router.ts +484 -0
- package/src/legacy/addPlugins.ts +21 -0
- package/src/legacy/addRoute.ts +29 -0
- package/src/legacy/createHandlerBoundToURL.ts +30 -0
- package/src/legacy/fallbacks.ts +94 -0
- package/src/legacy/getCacheKeyForURL.ts +32 -0
- package/src/legacy/handlePrecaching.ts +86 -0
- package/src/legacy/installSerwist.ts +19 -0
- package/src/legacy/matchPrecache.ts +26 -0
- package/src/legacy/precache.ts +31 -0
- package/src/legacy/precacheAndRoute.ts +28 -0
- package/src/legacy/registerRoute.ts +27 -0
- package/src/legacy/registerRuntimeCaching.ts +17 -0
- package/src/legacy/setCatchHandler.ts +21 -0
- package/src/legacy/setDefaultHandler.ts +24 -0
- package/src/legacy/singletonPrecacheController.ts +53 -0
- package/src/legacy/singletonRouter.ts +70 -0
- package/src/legacy/unregisterRoute.ts +12 -0
- package/src/legacy/utils/PrecacheCacheKeyPlugin.ts +33 -0
- package/src/legacy/utils/getCacheKeyForURL.ts +36 -0
- package/src/models/messages/messageGenerator.ts +29 -0
- package/src/models/messages/messages.ts +233 -0
- package/src/models/pluginEvents.ts +17 -0
- package/src/models/quotaErrorCallbacks.ts +13 -0
- package/src/navigationPreload.ts +68 -0
- package/src/parseRoute.ts +78 -0
- package/src/plugins/backgroundSync/BackgroundSyncPlugin.ts +38 -0
- package/src/plugins/backgroundSync/Queue.ts +440 -0
- package/src/plugins/backgroundSync/QueueDb.ts +176 -0
- package/src/plugins/backgroundSync/QueueStore.ts +160 -0
- package/src/plugins/backgroundSync/StorableRequest.ts +142 -0
- package/src/plugins/broadcastUpdate/BroadcastCacheUpdate.ts +161 -0
- package/src/plugins/broadcastUpdate/BroadcastUpdatePlugin.ts +42 -0
- package/src/plugins/broadcastUpdate/constants.ts +12 -0
- package/src/plugins/broadcastUpdate/responsesAreSame.ts +49 -0
- package/src/plugins/broadcastUpdate/types.ts +37 -0
- package/src/plugins/cacheableResponse/CacheableResponse.ts +144 -0
- package/src/plugins/cacheableResponse/CacheableResponsePlugin.ts +45 -0
- package/src/plugins/expiration/CacheExpiration.ts +193 -0
- package/src/plugins/expiration/ExpirationPlugin.ts +300 -0
- package/src/plugins/expiration/models/CacheTimestampsModel.ts +184 -0
- package/src/plugins/googleAnalytics/constants.ts +22 -0
- package/src/plugins/googleAnalytics/initialize.ts +209 -0
- package/src/plugins/precaching/PrecacheFallbackPlugin.ts +83 -0
- package/src/plugins/rangeRequests/RangeRequestsPlugin.ts +38 -0
- package/src/plugins/rangeRequests/createPartialResponse.ts +93 -0
- package/src/plugins/rangeRequests/utils/calculateEffectiveBoundaries.ts +59 -0
- package/src/plugins/rangeRequests/utils/parseRangeHeader.ts +55 -0
- package/src/registerQuotaErrorCallback.ts +34 -0
- package/src/setCacheNameDetails.ts +53 -0
- package/src/strategies/CacheFirst.ts +88 -0
- package/src/strategies/CacheOnly.ts +59 -0
- package/src/strategies/NetworkFirst.ts +229 -0
- package/src/strategies/NetworkOnly.ts +98 -0
- package/src/strategies/StaleWhileRevalidate.ts +110 -0
- package/src/strategies/Strategy.ts +204 -0
- package/src/strategies/StrategyHandler.ts +554 -0
- package/src/strategies/plugins/cacheOkAndOpaquePlugin.ts +26 -0
- package/src/strategies/utils/messages.ts +21 -0
- package/src/types.ts +358 -0
- package/src/utils/Deferred.ts +33 -0
- package/src/utils/PrecacheCacheKeyPlugin.ts +33 -0
- package/src/utils/PrecacheInstallReportPlugin.ts +47 -0
- package/src/utils/SerwistError.ts +41 -0
- package/src/utils/assert.ts +89 -0
- package/src/utils/cacheMatchIgnoreParams.ts +54 -0
- package/src/utils/cacheNames.ts +87 -0
- package/src/utils/canConstructReadableStream.ts +34 -0
- package/src/utils/canConstructResponseFromBodyStream.ts +37 -0
- package/src/utils/createCacheKey.ts +68 -0
- package/src/utils/deleteOutdatedCaches.ts +40 -0
- package/src/utils/dontWaitFor.ts +16 -0
- package/src/utils/executeQuotaErrorCallbacks.ts +33 -0
- package/src/utils/generateURLVariations.ts +55 -0
- package/src/utils/getFriendlyURL.ts +16 -0
- package/src/utils/logger.ts +95 -0
- package/src/utils/normalizeHandler.ts +40 -0
- package/src/utils/pluginUtils.ts +15 -0
- package/src/utils/printCleanupDetails.ts +38 -0
- package/src/utils/printInstallDetails.ts +53 -0
- package/src/utils/removeIgnoredSearchParams.ts +29 -0
- package/src/utils/resultingClientExists.ts +58 -0
- package/src/utils/timeout.ts +19 -0
- package/src/utils/waitUntil.ts +21 -0
- package/src/utils/welcome.ts +19 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2018 Google LLC
|
|
3
|
+
|
|
4
|
+
Use of this source code is governed by an MIT-style
|
|
5
|
+
license that can be found in the LICENSE file or at
|
|
6
|
+
https://opensource.org/licenses/MIT.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
interface LoggableObject {
|
|
10
|
+
[key: string]: string | number;
|
|
11
|
+
}
|
|
12
|
+
interface MessageMap {
|
|
13
|
+
[messageID: string]: (param: LoggableObject) => string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const messages = {
|
|
17
|
+
"invalid-value": ({ paramName, validValueDescription, value }) => {
|
|
18
|
+
if (!paramName || !validValueDescription) {
|
|
19
|
+
throw new Error(`Unexpected input to 'invalid-value' error.`);
|
|
20
|
+
}
|
|
21
|
+
return (
|
|
22
|
+
`The '${paramName}' parameter was given a value with an ` +
|
|
23
|
+
`unexpected value. ${validValueDescription} Received a value of ` +
|
|
24
|
+
`${JSON.stringify(value)}.`
|
|
25
|
+
);
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
"not-an-array": ({ moduleName, className, funcName, paramName }) => {
|
|
29
|
+
if (!moduleName || !className || !funcName || !paramName) {
|
|
30
|
+
throw new Error(`Unexpected input to 'not-an-array' error.`);
|
|
31
|
+
}
|
|
32
|
+
return `The parameter '${paramName}' passed into ` + `'${moduleName}.${className}.${funcName}()' must be an array.`;
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
"incorrect-type": ({ expectedType, paramName, moduleName, className, funcName }) => {
|
|
36
|
+
if (!expectedType || !paramName || !moduleName || !funcName) {
|
|
37
|
+
throw new Error(`Unexpected input to 'incorrect-type' error.`);
|
|
38
|
+
}
|
|
39
|
+
const classNameStr = className ? `${className}.` : "";
|
|
40
|
+
return `The parameter '${paramName}' passed into ` + `'${moduleName}.${classNameStr}` + `${funcName}()' must be of type ${expectedType}.`;
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
"incorrect-class": ({ expectedClassName, paramName, moduleName, className, funcName, isReturnValueProblem }) => {
|
|
44
|
+
if (!expectedClassName || !moduleName || !funcName) {
|
|
45
|
+
throw new Error(`Unexpected input to 'incorrect-class' error.`);
|
|
46
|
+
}
|
|
47
|
+
const classNameStr = className ? `${className}.` : "";
|
|
48
|
+
if (isReturnValueProblem) {
|
|
49
|
+
return `The return value from '${moduleName}.${classNameStr}${funcName}()' must be an instance of class ${expectedClassName}.`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
`The parameter '${paramName}' passed into ` +
|
|
54
|
+
`'${moduleName}.${classNameStr}${funcName}()' ` +
|
|
55
|
+
`must be an instance of class ${expectedClassName}.`
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
"missing-a-method": ({ expectedMethod, paramName, moduleName, className, funcName }) => {
|
|
60
|
+
if (!expectedMethod || !paramName || !moduleName || !className || !funcName) {
|
|
61
|
+
throw new Error(`Unexpected input to 'missing-a-method' error.`);
|
|
62
|
+
}
|
|
63
|
+
return `${moduleName}.${className}.${funcName}() expected the ` + `'${paramName}' parameter to expose a '${expectedMethod}' method.`;
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
"add-to-cache-list-unexpected-type": ({ entry }) => {
|
|
67
|
+
return `An unexpected entry was passed to 'serwist.Serwist.addToPrecacheList()' The entry '${JSON.stringify(
|
|
68
|
+
entry,
|
|
69
|
+
)}' isn't supported. You must supply an array of strings with one or more characters, objects with a url property or Request objects.`;
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
"add-to-cache-list-conflicting-entries": ({ firstEntry, secondEntry }) => {
|
|
73
|
+
if (!firstEntry || !secondEntry) {
|
|
74
|
+
throw new Error("Unexpected input to " + `'add-to-cache-list-duplicate-entries' error.`);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return `Two of the entries passed to 'serwist.Serwist.addToPrecacheList()' had the URL ${firstEntry} but different revision details. Serwist is unable to cache and version the asset correctly. Please remove one of the entries.`;
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
"plugin-error-request-will-fetch": ({ thrownErrorMessage }) => {
|
|
81
|
+
if (!thrownErrorMessage) {
|
|
82
|
+
throw new Error("Unexpected input to " + `'plugin-error-request-will-fetch', error.`);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return `An error was thrown by a plugin's 'requestWillFetch()' method. The thrown error message was: '${thrownErrorMessage}'.`;
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
"invalid-cache-name": ({ cacheNameId, value }) => {
|
|
89
|
+
if (!cacheNameId) {
|
|
90
|
+
throw new Error(`Expected a 'cacheNameId' for error 'invalid-cache-name'`);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return `You must provide a name containing at least one character for setCacheDetails({${cacheNameId}: '...'}). Received a value of '${JSON.stringify(
|
|
94
|
+
value,
|
|
95
|
+
)}'`;
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
"unregister-route-but-not-found-with-method": ({ method }) => {
|
|
99
|
+
if (!method) {
|
|
100
|
+
throw new Error("Unexpected input to " + `'unregister-route-but-not-found-with-method' error.`);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return `The route you're trying to unregister was not previously registered for the method type '${method}'.`;
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
"unregister-route-route-not-registered": () => {
|
|
107
|
+
return `The route you're trying to unregister was not previously ` + "registered.";
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
"queue-replay-failed": ({ name }) => {
|
|
111
|
+
return `Replaying the background sync queue '${name}' failed.`;
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
"duplicate-queue-name": ({ name }) => {
|
|
115
|
+
return `The Queue name '${name}' is already being used. All instances of backgroundSync.Queue must be given unique names.`;
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
"expired-test-without-max-age": ({ methodName, paramName }) => {
|
|
119
|
+
return `The '${methodName}()' method can only be used when the ` + `'${paramName}' is used in the constructor.`;
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
"unsupported-route-type": ({ moduleName, className, funcName, paramName }) => {
|
|
123
|
+
return `The supplied '${paramName}' parameter was an unsupported type. Please check the docs for ${moduleName}.${className}.${funcName} for valid input types.`;
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
"not-array-of-class": ({ value, expectedClass, moduleName, className, funcName, paramName }) => {
|
|
127
|
+
return `The supplied '${paramName}' parameter must be an array of '${expectedClass}' objects. Received '${JSON.stringify(
|
|
128
|
+
value,
|
|
129
|
+
)},'. Please check the call to ${moduleName}.${className}.${funcName}() to fix the issue.`;
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
"max-entries-or-age-required": ({ moduleName, className, funcName }) => {
|
|
133
|
+
return `You must define either 'config.maxEntries' or 'config.maxAgeSeconds' in '${moduleName}.${className}.${funcName}'`;
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
"statuses-or-headers-required": ({ moduleName, className, funcName }) => {
|
|
137
|
+
return `You must define either 'config.statuses' or 'config.headers' in '${moduleName}.${className}.${funcName}'`;
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
"invalid-string": ({ moduleName, funcName, paramName }) => {
|
|
141
|
+
if (!paramName || !moduleName || !funcName) {
|
|
142
|
+
throw new Error(`Unexpected input to 'invalid-string' error.`);
|
|
143
|
+
}
|
|
144
|
+
return `When using strings, the '${paramName}' parameter must start with 'http' (for cross-origin matches) or '/' (for same-origin matches). Please see the docs for ${moduleName}.${funcName}() for more info.`;
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
"channel-name-required": () => {
|
|
148
|
+
return "You must provide a channelName to construct a " + "BroadcastCacheUpdate instance.";
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
"invalid-responses-are-same-args": () => {
|
|
152
|
+
return "The arguments passed into responsesAreSame() appear to be " + "invalid. Please ensure valid Responses are used.";
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
"expire-custom-caches-only": () => {
|
|
156
|
+
return `You must provide a 'cacheName' property when using the ` + "expiration plugin with a runtime caching strategy.";
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
"unit-must-be-bytes": ({ normalizedRangeHeader }) => {
|
|
160
|
+
if (!normalizedRangeHeader) {
|
|
161
|
+
throw new Error(`Unexpected input to 'unit-must-be-bytes' error.`);
|
|
162
|
+
}
|
|
163
|
+
return `The 'unit' portion of the Range header must be set to 'bytes'. The Range header provided was "${normalizedRangeHeader}"`;
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
"single-range-only": ({ normalizedRangeHeader }) => {
|
|
167
|
+
if (!normalizedRangeHeader) {
|
|
168
|
+
throw new Error(`Unexpected input to 'single-range-only' error.`);
|
|
169
|
+
}
|
|
170
|
+
return `Multiple ranges are not supported. Please use a single start value, and optional end value. The Range header provided was "${normalizedRangeHeader}"`;
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
"invalid-range-values": ({ normalizedRangeHeader }) => {
|
|
174
|
+
if (!normalizedRangeHeader) {
|
|
175
|
+
throw new Error(`Unexpected input to 'invalid-range-values' error.`);
|
|
176
|
+
}
|
|
177
|
+
return `The Range header is missing both start and end values. At least one of those values is needed. The Range header provided was "${normalizedRangeHeader}"`;
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
"no-range-header": () => {
|
|
181
|
+
return "No Range header was found in the Request provided.";
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
"range-not-satisfiable": ({ size, start, end }) => {
|
|
185
|
+
return `The start (${start}) and end (${end}) values in the Range are ` + `not satisfiable by the cached response, which is ${size} bytes.`;
|
|
186
|
+
},
|
|
187
|
+
|
|
188
|
+
"attempt-to-cache-non-get-request": ({ url, method }) => {
|
|
189
|
+
return `Unable to cache '${url}' because it is a '${method}' request and only 'GET' requests can be cached.`;
|
|
190
|
+
},
|
|
191
|
+
|
|
192
|
+
"cache-put-with-no-response": ({ url }) => {
|
|
193
|
+
return `There was an attempt to cache '${url}' but the response was not defined.`;
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
"no-response": ({ url, error }) => {
|
|
197
|
+
let message = `The strategy could not generate a response for '${url}'.`;
|
|
198
|
+
if (error) {
|
|
199
|
+
message += ` The underlying error is ${error}.`;
|
|
200
|
+
}
|
|
201
|
+
return message;
|
|
202
|
+
},
|
|
203
|
+
|
|
204
|
+
"bad-precaching-response": ({ url, status }) => {
|
|
205
|
+
return `The precaching request for '${url}' failed${status ? ` with an HTTP status of ${status}.` : "."}`;
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
"non-precached-url": ({ url }) => {
|
|
209
|
+
return `'createHandlerBoundToURL("${url}")' was called, but that URL is not precached. Please pass in a URL that is precached instead.`;
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
"add-to-cache-list-conflicting-integrities": ({ url }) => {
|
|
213
|
+
return `Two of the entries passed to 'serwist.Serwist.addToPrecacheList()' had the URL ${url} with different integrity values. Please remove one of them.`;
|
|
214
|
+
},
|
|
215
|
+
|
|
216
|
+
"missing-precache-entry": ({ cacheName, url }) => {
|
|
217
|
+
return `Unable to find a precached response in ${cacheName} for ${url}.`;
|
|
218
|
+
},
|
|
219
|
+
|
|
220
|
+
"cross-origin-copy-response": ({ origin }) => {
|
|
221
|
+
return `'@serwist/core.copyResponse()' can only be used with same-origin responses. It was passed a response with origin ${origin}.`;
|
|
222
|
+
},
|
|
223
|
+
|
|
224
|
+
"opaque-streams-source": ({ type }) => {
|
|
225
|
+
const message = `One of the '@serwist/streams' sources resulted in an '${type}' response.`;
|
|
226
|
+
if (type === "opaqueredirect") {
|
|
227
|
+
return `${message} Please do not use a navigation request that results in a redirect as a source.`;
|
|
228
|
+
}
|
|
229
|
+
return `${message} Please ensure your sources are CORS-enabled.`;
|
|
230
|
+
},
|
|
231
|
+
} satisfies MessageMap;
|
|
232
|
+
|
|
233
|
+
export type MessageKey = keyof typeof messages;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2018 Google LLC
|
|
3
|
+
|
|
4
|
+
Use of this source code is governed by an MIT-style
|
|
5
|
+
license that can be found in the LICENSE file or at
|
|
6
|
+
https://opensource.org/licenses/MIT.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export enum pluginEvents {
|
|
10
|
+
CACHE_DID_UPDATE = "cacheDidUpdate",
|
|
11
|
+
CACHE_KEY_WILL_BE_USED = "cacheKeyWillBeUsed",
|
|
12
|
+
CACHE_WILL_UPDATE = "cacheWillUpdate",
|
|
13
|
+
CACHED_RESPONSE_WILL_BE_USED = "cachedResponseWillBeUsed",
|
|
14
|
+
FETCH_DID_FAIL = "fetchDidFail",
|
|
15
|
+
FETCH_DID_SUCCEED = "fetchDidSucceed",
|
|
16
|
+
REQUEST_WILL_FETCH = "requestWillFetch",
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2018 Google LLC
|
|
3
|
+
|
|
4
|
+
Use of this source code is governed by an MIT-style
|
|
5
|
+
license that can be found in the LICENSE file or at
|
|
6
|
+
https://opensource.org/licenses/MIT.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// Callbacks to be executed whenever there's a quota error.
|
|
10
|
+
// biome-ignore lint/complexity/noBannedTypes: Can't change Function type right now.
|
|
11
|
+
const quotaErrorCallbacks: Set<Function> = new Set();
|
|
12
|
+
|
|
13
|
+
export { quotaErrorCallbacks };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { logger } from "./utils/logger.js";
|
|
2
|
+
|
|
3
|
+
declare const self: ServiceWorkerGlobalScope;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Checks whether the current browser supports
|
|
7
|
+
* navigation preloading.
|
|
8
|
+
*
|
|
9
|
+
* @returns
|
|
10
|
+
* @see https://serwist.pages.dev/docs/sw/navigation-preloading/is-navigation-preload-supported
|
|
11
|
+
*/
|
|
12
|
+
export const isNavigationPreloadSupported = (): boolean => {
|
|
13
|
+
return Boolean(self.registration?.navigationPreload);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* If the browser supports navigation preloading, then this will enable it.
|
|
18
|
+
*
|
|
19
|
+
* @param headerValue Optional. Allows developers to override the value of
|
|
20
|
+
* the `Service-Worker-Navigation-Preload` header which will be sent to the
|
|
21
|
+
* server when making the navigation request.
|
|
22
|
+
* @see https://serwist.pages.dev/docs/sw/navigation-preloading/enable-navigation-preload
|
|
23
|
+
*/
|
|
24
|
+
export const enableNavigationPreload = (headerValue?: string): void => {
|
|
25
|
+
if (isNavigationPreloadSupported()) {
|
|
26
|
+
self.addEventListener("activate", (event) => {
|
|
27
|
+
event.waitUntil(
|
|
28
|
+
self.registration.navigationPreload.enable().then(() => {
|
|
29
|
+
// Defaults to Service-Worker-Navigation-Preload: true if not set.
|
|
30
|
+
if (headerValue) {
|
|
31
|
+
void self.registration.navigationPreload.setHeaderValue(headerValue);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (process.env.NODE_ENV !== "production") {
|
|
35
|
+
logger.log("Navigation preloading is enabled.");
|
|
36
|
+
}
|
|
37
|
+
}),
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
} else {
|
|
41
|
+
if (process.env.NODE_ENV !== "production") {
|
|
42
|
+
logger.log("Navigation preloading is not supported in this browser.");
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* If the browser supports navigation preloading, then this will disable it.
|
|
49
|
+
*
|
|
50
|
+
* @see https://serwist.pages.dev/docs/sw/navigation-preloading/disable-navigation-preload
|
|
51
|
+
*/
|
|
52
|
+
export const disableNavigationPreload = (): void => {
|
|
53
|
+
if (isNavigationPreloadSupported()) {
|
|
54
|
+
self.addEventListener("activate", (event: ExtendableEvent) => {
|
|
55
|
+
event.waitUntil(
|
|
56
|
+
self.registration.navigationPreload.disable().then(() => {
|
|
57
|
+
if (process.env.NODE_ENV !== "production") {
|
|
58
|
+
logger.log("Navigation preloading is disabled.");
|
|
59
|
+
}
|
|
60
|
+
}),
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
} else {
|
|
64
|
+
if (process.env.NODE_ENV !== "production") {
|
|
65
|
+
logger.log("Navigation preloading is not supported in this browser.");
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { RouteHandler, RouteMatchCallback } from "./types.js";
|
|
2
|
+
import { SerwistError } from "./utils/SerwistError.js";
|
|
3
|
+
import { logger } from "./utils/logger.js";
|
|
4
|
+
import { RegExpRoute } from "./RegExpRoute.js";
|
|
5
|
+
import { Route } from "./Route.js";
|
|
6
|
+
import type { HTTPMethod } from "./constants.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Parses a `RegExp`, string, or function with a caching strategy into a `Route`. This is for
|
|
10
|
+
* when you want to create a `Route`, but you don't want to register it just yet: sometimes
|
|
11
|
+
* you want to call `setCatchHandler` first, for example.
|
|
12
|
+
*
|
|
13
|
+
* @param capture If the capture param is a `Route`, all other arguments will be ignored.
|
|
14
|
+
* @param handler A callback function that returns a `Promise` resulting in a `Response`.
|
|
15
|
+
* This parameter is required if `capture` is not a `Route` object.
|
|
16
|
+
* @param method The HTTP method to match the `Route` against. Defaults to `'GET'`.
|
|
17
|
+
* @returns The generated `Route`.
|
|
18
|
+
*/
|
|
19
|
+
export const parseRoute = (capture: RegExp | string | RouteMatchCallback | Route, handler?: RouteHandler, method?: HTTPMethod): Route => {
|
|
20
|
+
let route: Route;
|
|
21
|
+
|
|
22
|
+
if (typeof capture === "string") {
|
|
23
|
+
const captureUrl = new URL(capture, location.href);
|
|
24
|
+
|
|
25
|
+
if (process.env.NODE_ENV !== "production") {
|
|
26
|
+
if (!(capture.startsWith("/") || capture.startsWith("http"))) {
|
|
27
|
+
throw new SerwistError("invalid-string", {
|
|
28
|
+
moduleName: "serwist",
|
|
29
|
+
funcName: "parseRoute",
|
|
30
|
+
paramName: "capture",
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// We want to check if Express-style wildcards are in the pathname only.
|
|
35
|
+
// TODO: Remove this log message in v4.
|
|
36
|
+
const valueToCheck = capture.startsWith("http") ? captureUrl.pathname : capture;
|
|
37
|
+
|
|
38
|
+
// See https://github.com/pillarjs/path-to-regexp#parameters
|
|
39
|
+
const wildcards = "[*:?+]";
|
|
40
|
+
if (new RegExp(`${wildcards}`).exec(valueToCheck)) {
|
|
41
|
+
logger.debug(
|
|
42
|
+
`The '$capture' parameter contains an Express-style wildcard character (${wildcards}). Strings are now always interpreted as exact matches; use a RegExp for partial or wildcard matches.`,
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const matchCallback: RouteMatchCallback = ({ url }) => {
|
|
48
|
+
if (process.env.NODE_ENV !== "production") {
|
|
49
|
+
if (url.pathname === captureUrl.pathname && url.origin !== captureUrl.origin) {
|
|
50
|
+
logger.debug(
|
|
51
|
+
`${capture} only partially matches the cross-origin URL ${url.toString()}. This route will only handle cross-origin requests if they match the entire URL.`,
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return url.href === captureUrl.href;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// If `capture` is a string then `handler` and `method` must be present.
|
|
60
|
+
route = new Route(matchCallback, handler!, method);
|
|
61
|
+
} else if (capture instanceof RegExp) {
|
|
62
|
+
// If `capture` is a `RegExp` then `handler` and `method` must be present.
|
|
63
|
+
route = new RegExpRoute(capture, handler!, method);
|
|
64
|
+
} else if (typeof capture === "function") {
|
|
65
|
+
// If `capture` is a function then `handler` and `method` must be present.
|
|
66
|
+
route = new Route(capture, handler!, method);
|
|
67
|
+
} else if (capture instanceof Route) {
|
|
68
|
+
route = capture;
|
|
69
|
+
} else {
|
|
70
|
+
throw new SerwistError("unsupported-route-type", {
|
|
71
|
+
moduleName: "serwist",
|
|
72
|
+
funcName: "parseRoute",
|
|
73
|
+
paramName: "capture",
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return route;
|
|
78
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2018 Google LLC
|
|
3
|
+
|
|
4
|
+
Use of this source code is governed by an MIT-style
|
|
5
|
+
license that can be found in the LICENSE file or at
|
|
6
|
+
https://opensource.org/licenses/MIT.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { FetchDidFailCallbackParam, SerwistPlugin } from "../../types.js";
|
|
10
|
+
import type { QueueOptions } from "./Queue.js";
|
|
11
|
+
import { Queue } from "./Queue.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A class implementing the `fetchDidFail` lifecycle callback. This makes it
|
|
15
|
+
* easier to add failed requests to a background sync Queue.
|
|
16
|
+
*/
|
|
17
|
+
export class BackgroundSyncPlugin implements SerwistPlugin {
|
|
18
|
+
private readonly _queue: Queue;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @param name See the `serwist/plugins.BackgroundSyncQueue`
|
|
22
|
+
* documentation for parameter details.
|
|
23
|
+
* @param options See the `serwist/plugins.BackgroundSyncQueue`
|
|
24
|
+
* documentation for parameter details.
|
|
25
|
+
* @see https://serwist.pages.dev/docs/background-sync/queue
|
|
26
|
+
*/
|
|
27
|
+
constructor(name: string, options?: QueueOptions) {
|
|
28
|
+
this._queue = new Queue(name, options);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @param options
|
|
33
|
+
* @private
|
|
34
|
+
*/
|
|
35
|
+
async fetchDidFail({ request }: FetchDidFailCallbackParam) {
|
|
36
|
+
await this._queue.pushRequest({ request });
|
|
37
|
+
}
|
|
38
|
+
}
|