serwist 9.0.2 → 9.0.3
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/dist/NavigationRoute.d.ts +2 -2
- package/dist/PrecacheRoute.d.ts +2 -3
- package/dist/PrecacheRoute.d.ts.map +1 -1
- package/dist/RegExpRoute.d.ts +2 -2
- package/dist/Route.d.ts +4 -4
- package/dist/Serwist.d.ts +19 -19
- package/dist/chunks/printInstallDetails.js +6 -10
- package/dist/copyResponse.d.ts.map +1 -1
- package/dist/legacy/PrecacheController.d.ts +1 -1
- package/dist/legacy/PrecacheFallbackPlugin.d.ts +6 -7
- package/dist/legacy/PrecacheFallbackPlugin.d.ts.map +1 -1
- package/dist/legacy/PrecacheRoute.d.ts +3 -3
- package/dist/legacy/Router.d.ts +23 -23
- package/dist/legacy/addRoute.d.ts +6 -8
- package/dist/legacy/addRoute.d.ts.map +1 -1
- package/dist/legacy/createHandlerBoundToURL.d.ts +5 -6
- package/dist/legacy/createHandlerBoundToURL.d.ts.map +1 -1
- package/dist/legacy/fallbacks.d.ts +3 -3
- package/dist/legacy/handlePrecaching.d.ts +3 -3
- package/dist/legacy/initializeGoogleAnalytics.d.ts +1 -1
- package/dist/legacy/installSerwist.d.ts +4 -4
- package/dist/legacy/matchPrecache.d.ts +4 -4
- package/dist/legacy/matchPrecache.d.ts.map +1 -1
- package/dist/legacy/precache.d.ts +2 -2
- package/dist/legacy/precache.d.ts.map +1 -1
- package/dist/legacy/precacheAndRoute.d.ts +3 -4
- package/dist/legacy/precacheAndRoute.d.ts.map +1 -1
- package/dist/legacy/registerRoute.d.ts +6 -6
- package/dist/legacy/registerRoute.d.ts.map +1 -1
- package/dist/legacy/registerRuntimeCaching.d.ts +1 -1
- package/dist/legacy/setCatchHandler.d.ts +2 -2
- package/dist/legacy/setDefaultHandler.d.ts +3 -3
- package/dist/legacy/singletonPrecacheController.d.ts +7 -7
- package/dist/legacy/singletonRouter.d.ts +9 -9
- package/dist/legacy/unregisterRoute.d.ts +1 -1
- package/dist/legacy/unregisterRoute.d.ts.map +1 -1
- package/dist/lib/backgroundSync/BackgroundSyncPlugin.d.ts +3 -3
- package/dist/lib/backgroundSync/BackgroundSyncQueue.d.ts +1 -1
- package/dist/lib/backgroundSync/StorableRequest.d.ts +1 -1
- package/dist/lib/broadcastUpdate/BroadcastCacheUpdate.d.ts +1 -2
- package/dist/lib/broadcastUpdate/BroadcastCacheUpdate.d.ts.map +1 -1
- package/dist/lib/broadcastUpdate/BroadcastUpdatePlugin.d.ts +4 -7
- package/dist/lib/broadcastUpdate/BroadcastUpdatePlugin.d.ts.map +1 -1
- package/dist/lib/broadcastUpdate/types.d.ts +2 -1
- package/dist/lib/broadcastUpdate/types.d.ts.map +1 -1
- package/dist/lib/cacheableResponse/CacheableResponse.d.ts +6 -6
- package/dist/lib/cacheableResponse/CacheableResponsePlugin.d.ts +2 -2
- package/dist/lib/expiration/CacheExpiration.d.ts +2 -2
- package/dist/lib/expiration/ExpirationPlugin.d.ts +11 -11
- package/dist/lib/expiration/ExpirationPlugin.d.ts.map +1 -1
- package/dist/lib/precaching/PrecacheFallbackPlugin.d.ts +4 -4
- package/dist/lib/rangeRequests/RangeRequestsPlugin.d.ts +3 -4
- package/dist/lib/rangeRequests/RangeRequestsPlugin.d.ts.map +1 -1
- package/dist/lib/rangeRequests/createPartialResponse.d.ts +7 -7
- package/dist/lib/rangeRequests/createPartialResponse.d.ts.map +1 -1
- package/dist/lib/rangeRequests/utils/parseRangeHeader.d.ts +2 -2
- package/dist/lib/strategies/CacheFirst.d.ts +1 -1
- package/dist/lib/strategies/CacheOnly.d.ts +1 -1
- package/dist/lib/strategies/NetworkFirst.d.ts +1 -1
- package/dist/lib/strategies/NetworkOnly.d.ts +1 -1
- package/dist/lib/strategies/PrecacheStrategy.d.ts +3 -3
- package/dist/lib/strategies/PrecacheStrategy.d.ts.map +1 -1
- package/dist/lib/strategies/StaleWhileRevalidate.d.ts +1 -1
- package/dist/lib/strategies/Strategy.d.ts +7 -7
- package/dist/lib/strategies/StrategyHandler.d.ts +12 -13
- package/dist/lib/strategies/StrategyHandler.d.ts.map +1 -1
- package/dist/types.d.ts +37 -36
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/cacheNames.d.ts +1 -1
- package/dist/utils/cacheNames.d.ts.map +1 -1
- package/dist/utils/canConstructResponseFromBodyStream.d.ts +2 -2
- package/dist/utils/deleteOutdatedCaches.d.ts.map +1 -1
- package/dist/utils/executeQuotaErrorCallbacks.d.ts.map +1 -1
- package/dist/utils/parseRoute.d.ts +8 -8
- package/dist/utils/waitUntil.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/NavigationRoute.ts +2 -2
- package/src/PrecacheRoute.ts +2 -3
- package/src/RegExpRoute.ts +2 -2
- package/src/Route.ts +4 -4
- package/src/Serwist.ts +19 -19
- package/src/legacy/PrecacheController.ts +1 -1
- package/src/legacy/PrecacheFallbackPlugin.ts +6 -7
- package/src/legacy/PrecacheRoute.ts +3 -3
- package/src/legacy/Router.ts +23 -23
- package/src/legacy/addRoute.ts +6 -8
- package/src/legacy/createHandlerBoundToURL.ts +6 -6
- package/src/legacy/fallbacks.ts +3 -3
- package/src/legacy/handlePrecaching.ts +3 -3
- package/src/legacy/initializeGoogleAnalytics.ts +1 -1
- package/src/legacy/installSerwist.ts +4 -4
- package/src/legacy/matchPrecache.ts +5 -4
- package/src/legacy/precache.ts +4 -2
- package/src/legacy/precacheAndRoute.ts +3 -4
- package/src/legacy/registerRoute.ts +8 -7
- package/src/legacy/registerRuntimeCaching.ts +1 -1
- package/src/legacy/setCatchHandler.ts +2 -2
- package/src/legacy/setDefaultHandler.ts +3 -3
- package/src/legacy/singletonPrecacheController.ts +7 -7
- package/src/legacy/singletonRouter.ts +9 -9
- package/src/legacy/unregisterRoute.ts +2 -1
- package/src/lib/backgroundSync/BackgroundSyncPlugin.ts +3 -3
- package/src/lib/backgroundSync/BackgroundSyncQueue.ts +1 -1
- package/src/lib/backgroundSync/StorableRequest.ts +1 -1
- package/src/lib/broadcastUpdate/BroadcastCacheUpdate.ts +1 -2
- package/src/lib/broadcastUpdate/BroadcastUpdatePlugin.ts +4 -7
- package/src/lib/broadcastUpdate/types.ts +2 -1
- package/src/lib/cacheableResponse/CacheableResponse.ts +6 -6
- package/src/lib/cacheableResponse/CacheableResponsePlugin.ts +2 -2
- package/src/lib/expiration/CacheExpiration.ts +2 -2
- package/src/lib/expiration/ExpirationPlugin.ts +12 -11
- package/src/lib/precaching/PrecacheFallbackPlugin.ts +4 -4
- package/src/lib/rangeRequests/RangeRequestsPlugin.ts +3 -4
- package/src/lib/rangeRequests/createPartialResponse.ts +7 -7
- package/src/lib/rangeRequests/utils/parseRangeHeader.ts +2 -2
- package/src/lib/strategies/CacheFirst.ts +1 -1
- package/src/lib/strategies/CacheOnly.ts +1 -1
- package/src/lib/strategies/NetworkFirst.ts +1 -1
- package/src/lib/strategies/NetworkOnly.ts +1 -1
- package/src/lib/strategies/PrecacheStrategy.ts +4 -3
- package/src/lib/strategies/StaleWhileRevalidate.ts +1 -1
- package/src/lib/strategies/Strategy.ts +7 -7
- package/src/lib/strategies/StrategyHandler.ts +21 -25
- package/src/types.ts +39 -36
- package/src/utils/cacheNames.ts +2 -1
- package/src/utils/canConstructResponseFromBodyStream.ts +2 -2
- package/src/utils/parseRoute.ts +8 -8
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { RouteHandler } from "../types.js";
|
|
2
2
|
/**
|
|
3
|
-
* Defines a default
|
|
3
|
+
* Defines a default handler that's called when no routes explicitly
|
|
4
4
|
* match the incoming request.
|
|
5
5
|
*
|
|
6
|
-
* Without a default
|
|
6
|
+
* Without a default handler, unmatched requests will go against the
|
|
7
7
|
* network as if there were no service worker present.
|
|
8
8
|
*
|
|
9
|
-
* @param handler A callback function that returns a
|
|
9
|
+
* @param handler A callback function that returns a promise resulting in a response.
|
|
10
10
|
* @deprecated
|
|
11
11
|
*/
|
|
12
12
|
export declare const setDefaultHandler: (handler: RouteHandler) => void;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { PrecacheController } from "./PrecacheController.js";
|
|
2
2
|
/**
|
|
3
|
-
* Creates a new, singleton
|
|
3
|
+
* Creates a new, singleton {@linkcode PrecacheController} if one does not exist. If one does
|
|
4
4
|
* already exist, that instance is returned. This instance is used by Serwist's
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* {@linkcode PrecacheController}-dependent functions and classes unless you provide a different
|
|
6
|
+
* {@linkcode PrecacheController} to them.
|
|
7
7
|
*
|
|
8
|
-
* @returns The singleton
|
|
8
|
+
* @returns The singleton {@linkcode PrecacheController}.
|
|
9
9
|
* @deprecated
|
|
10
10
|
*/
|
|
11
11
|
export declare const getSingletonPrecacheController: () => PrecacheController;
|
|
12
12
|
/**
|
|
13
|
-
* Changes the singleton
|
|
14
|
-
* want to pass your own
|
|
13
|
+
* Changes the singleton {@linkcode PrecacheController} to a different instance. This is meant for when you do not
|
|
14
|
+
* want to pass your own {@linkcode PrecacheController} to every one of Serwist's {@linkcode PrecacheController}-dependent
|
|
15
15
|
* functions and classes.
|
|
16
16
|
*
|
|
17
17
|
* It is highly recommended that you call this before anything else, if you plan on doing so.
|
|
@@ -27,7 +27,7 @@ export declare const getSingletonPrecacheController: () => PrecacheController;
|
|
|
27
27
|
* // Do something with your controller...
|
|
28
28
|
* ```
|
|
29
29
|
* @param router
|
|
30
|
-
* @returns The new singleton
|
|
30
|
+
* @returns The new singleton {@linkcode PrecacheController}.
|
|
31
31
|
* @deprecated
|
|
32
32
|
*/
|
|
33
33
|
export declare const setSingletonPrecacheController: (precacheController: PrecacheController) => PrecacheController;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { Router } from "./Router.js";
|
|
2
2
|
/**
|
|
3
|
-
* Creates a new, singleton
|
|
3
|
+
* Creates a new, singleton {@linkcode Router} if one does not exist. If one does
|
|
4
4
|
* already exist, that instance is returned. This instance is used by
|
|
5
|
-
* Serwist's
|
|
6
|
-
* a different
|
|
5
|
+
* Serwist's {@linkcode Router}-dependent functions and classes unless you provide
|
|
6
|
+
* a different {@linkcode Router} to them.
|
|
7
7
|
*
|
|
8
|
-
* @returns The singleton
|
|
8
|
+
* @returns The singleton {@linkcode Router}.
|
|
9
9
|
* @deprecated
|
|
10
10
|
*/
|
|
11
11
|
export declare const getSingletonRouter: () => Router;
|
|
12
12
|
/**
|
|
13
|
-
* Changes the singleton
|
|
14
|
-
* want to pass your own
|
|
15
|
-
* If this or
|
|
16
|
-
* previous singleton
|
|
13
|
+
* Changes the singleton {@linkcode Router} to a different instance. This is meant for when you do not
|
|
14
|
+
* want to pass your own {@linkcode Router} to every one of Serwist's {@linkcode Router}-dependent functions and classes.
|
|
15
|
+
* If this or {@linkcode getSingletonRouter} has been called before, it removes the listeners of the
|
|
16
|
+
* previous singleton {@linkcode Router}. It also adds those of the new one, so you need not do that yourself.
|
|
17
17
|
*
|
|
18
18
|
* It is highly recommended that you call this before anything else, if you plan on doing so.
|
|
19
19
|
*
|
|
@@ -34,7 +34,7 @@ export declare const getSingletonRouter: () => Router;
|
|
|
34
34
|
* );
|
|
35
35
|
* ```
|
|
36
36
|
* @param router
|
|
37
|
-
* @returns The new singleton
|
|
37
|
+
* @returns The new singleton {@linkcode Router}.
|
|
38
38
|
* @deprecated
|
|
39
39
|
*/
|
|
40
40
|
export declare const setSingletonRouter: (router: Router) => Router;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unregisterRoute.d.ts","sourceRoot":"","sources":["../../src/legacy/unregisterRoute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"unregisterRoute.d.ts","sourceRoot":"","sources":["../../src/legacy/unregisterRoute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIzC;;;;;GAKG;AACH,eAAO,MAAM,eAAe,UAAW,KAAK,KAAG,IAE9C,CAAC"}
|
|
@@ -2,14 +2,14 @@ import type { FetchDidFailCallbackParam, SerwistPlugin } from "../../types.js";
|
|
|
2
2
|
import type { BackgroundSyncQueueOptions } from "./BackgroundSyncQueue.js";
|
|
3
3
|
/**
|
|
4
4
|
* A class implementing the `fetchDidFail` lifecycle callback. This makes it
|
|
5
|
-
* easier to add failed requests to a
|
|
5
|
+
* easier to add failed requests to a {@linkcode BackgroundSyncQueue}.
|
|
6
6
|
*/
|
|
7
7
|
export declare class BackgroundSyncPlugin implements SerwistPlugin {
|
|
8
8
|
private readonly _queue;
|
|
9
9
|
/**
|
|
10
|
-
* @param name See the
|
|
10
|
+
* @param name See the {@linkcode BackgroundSyncQueue}
|
|
11
11
|
* documentation for parameter details.
|
|
12
|
-
* @param options See the
|
|
12
|
+
* @param options See the {@linkcode BackgroundSyncQueue}
|
|
13
13
|
* documentation for parameter details.
|
|
14
14
|
* @see https://serwist.pages.dev/docs/core/background-sync-queue
|
|
15
15
|
*/
|
|
@@ -144,7 +144,7 @@ export declare class BackgroundSyncQueue {
|
|
|
144
144
|
_addRequest({ request, metadata, timestamp }: BackgroundSyncQueueEntry, operation: "push" | "unshift"): Promise<void>;
|
|
145
145
|
/**
|
|
146
146
|
* Removes and returns the first or last (depending on `operation`) entry
|
|
147
|
-
* from the
|
|
147
|
+
* from the {@linkcode BackgroundSyncQueueStore} that's not older than the `maxRetentionTime`.
|
|
148
148
|
*
|
|
149
149
|
* @param operation
|
|
150
150
|
* @returns
|
|
@@ -23,7 +23,7 @@ export declare class StorableRequest {
|
|
|
23
23
|
static fromRequest(request: Request): Promise<StorableRequest>;
|
|
24
24
|
/**
|
|
25
25
|
* Accepts an object of request data that can be used to construct a
|
|
26
|
-
* `Request` but can also be stored in IndexedDB.
|
|
26
|
+
* `Request` object but can also be stored in IndexedDB.
|
|
27
27
|
*
|
|
28
28
|
* @param requestData An object of request data that includes the `url` plus any relevant property of
|
|
29
29
|
* [`requestInit`](https://fetch.spec.whatwg.org/#requestinit).
|
|
@@ -12,8 +12,7 @@ export declare class BroadcastCacheUpdate {
|
|
|
12
12
|
private readonly _generatePayload;
|
|
13
13
|
private readonly _notifyAllClients;
|
|
14
14
|
/**
|
|
15
|
-
* Construct
|
|
16
|
-
* broadcast messages on
|
|
15
|
+
* Construct an instance of `BroadcastCacheUpdate`.
|
|
17
16
|
*
|
|
18
17
|
* @param options
|
|
19
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BroadcastCacheUpdate.d.ts","sourceRoot":"","sources":["../../../src/lib/broadcastUpdate/BroadcastCacheUpdate.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAYlE,OAAO,KAAK,EAAE,2BAA2B,EAAiE,MAAM,YAAY,CAAC;AAuB7H;;;;;;GAMG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAW;IAC3C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA4B;IAC7D,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAU;IAE5C
|
|
1
|
+
{"version":3,"file":"BroadcastCacheUpdate.d.ts","sourceRoot":"","sources":["../../../src/lib/broadcastUpdate/BroadcastCacheUpdate.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAYlE,OAAO,KAAK,EAAE,2BAA2B,EAAiE,MAAM,YAAY,CAAC;AAuB7H;;;;;;GAMG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAW;IAC3C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA4B;IAC7D,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAU;IAE5C;;;;OAIG;gBACS,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,GAAE,2BAAgC;IAMnG;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,eAAe,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC;CA4E3E"}
|
|
@@ -7,18 +7,15 @@ import type { BroadcastCacheUpdateOptions } from "./types.js";
|
|
|
7
7
|
export declare class BroadcastUpdatePlugin implements SerwistPlugin {
|
|
8
8
|
private readonly _broadcastUpdate;
|
|
9
9
|
/**
|
|
10
|
-
* Construct a
|
|
11
|
-
* the passed options and calls its
|
|
12
|
-
* plugin's
|
|
10
|
+
* Construct a {@linkcode BroadcastCacheUpdate} instance with
|
|
11
|
+
* the passed options and calls its {@linkcode BroadcastCacheUpdate.notifyIfUpdated}
|
|
12
|
+
* method whenever the plugin's {@linkcode BroadcastUpdatePlugin.cacheDidUpdate} callback
|
|
13
|
+
* is invoked.
|
|
13
14
|
*
|
|
14
15
|
* @param options
|
|
15
16
|
*/
|
|
16
17
|
constructor(options?: BroadcastCacheUpdateOptions);
|
|
17
18
|
/**
|
|
18
|
-
* A "lifecycle" callback that will be triggered automatically by
|
|
19
|
-
* `@serwist/build.RuntimeCaching` handlers when an entry is
|
|
20
|
-
* added to a cache.
|
|
21
|
-
*
|
|
22
19
|
* @private
|
|
23
20
|
* @param options The input object to this function.
|
|
24
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BroadcastUpdatePlugin.d.ts","sourceRoot":"","sources":["../../../src/lib/broadcastUpdate/BroadcastUpdatePlugin.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,2BAA2B,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEjF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAE9D;;;GAGG;AACH,qBAAa,qBAAsB,YAAW,aAAa;IACzD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAuB;IAExD
|
|
1
|
+
{"version":3,"file":"BroadcastUpdatePlugin.d.ts","sourceRoot":"","sources":["../../../src/lib/broadcastUpdate/BroadcastUpdatePlugin.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,2BAA2B,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEjF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAE9D;;;GAGG;AACH,qBAAa,qBAAsB,YAAW,aAAa;IACzD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAuB;IAExD;;;;;;;OAOG;gBACS,OAAO,CAAC,EAAE,2BAA2B;IAIjD;;;OAGG;IACH,cAAc,CAAC,OAAO,EAAE,2BAA2B;CAGpD"}
|
|
@@ -5,7 +5,8 @@ export interface BroadcastCacheUpdateOptions {
|
|
|
5
5
|
* A list of headers that will be used to determine whether the responses
|
|
6
6
|
* differ.
|
|
7
7
|
*
|
|
8
|
-
* @default
|
|
8
|
+
* @default
|
|
9
|
+
* ['content-length', 'etag', 'last-modified']`
|
|
9
10
|
*/
|
|
10
11
|
headersToCheck?: string[];
|
|
11
12
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/broadcastUpdate/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,KAAK,EAAE,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAEnG,MAAM,WAAW,2BAA2B;IAC1C
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/broadcastUpdate/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,KAAK,EAAE,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAEnG,MAAM,WAAW,2BAA2B;IAC1C;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,2BAA2B,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChF;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEnD,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,EAAE,2BAA2B,KAAK,gBAAgB,CAAC;AAEnG,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,6BAA6B,CAAC;IAC3C,IAAI,EAAE,OAAO,6BAA6B,CAAC;IAC3C,OAAO,EAAE,gBAAgB,CAAC;CAC3B"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
export interface CacheableResponseOptions {
|
|
2
2
|
/**
|
|
3
|
-
* One or more status codes that a
|
|
3
|
+
* One or more HTTP status codes that a response can have to be considered cacheable.
|
|
4
4
|
*/
|
|
5
5
|
statuses?: number[];
|
|
6
6
|
/**
|
|
7
|
-
* A mapping of header names and expected values that a
|
|
7
|
+
* A mapping of header names and expected values that a response can have and be
|
|
8
8
|
* considered cacheable. If multiple headers are provided, only one needs to be present.
|
|
9
9
|
*/
|
|
10
10
|
headers?: HeadersInit;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Allows you to set up rules determining what status codes and/or headers need
|
|
14
|
-
* to be present in order for a [
|
|
14
|
+
* to be present in order for a [response](https://developer.mozilla.org/en-US/docs/Web/API/Response)
|
|
15
15
|
* to be considered cacheable.
|
|
16
16
|
*/
|
|
17
17
|
export declare class CacheableResponse {
|
|
18
18
|
private readonly _statuses?;
|
|
19
19
|
private readonly _headers?;
|
|
20
20
|
/**
|
|
21
|
-
* To construct a new CacheableResponse instance you must provide at least
|
|
21
|
+
* To construct a new `CacheableResponse` instance you must provide at least
|
|
22
22
|
* one of the `config` properties.
|
|
23
23
|
*
|
|
24
24
|
* If both `statuses` and `headers` are specified, then both conditions must
|
|
25
|
-
* be met for the
|
|
25
|
+
* be met for the response to be considered cacheable.
|
|
26
26
|
*
|
|
27
27
|
* @param config
|
|
28
28
|
*/
|
|
@@ -32,7 +32,7 @@ export declare class CacheableResponse {
|
|
|
32
32
|
*
|
|
33
33
|
* @param response The response whose cacheability is being
|
|
34
34
|
* checked.
|
|
35
|
-
* @returns `true` if the
|
|
35
|
+
* @returns `true` if the response is cacheable, and `false`
|
|
36
36
|
* otherwise.
|
|
37
37
|
*/
|
|
38
38
|
isResponseCacheable(response: Response): boolean;
|
|
@@ -8,11 +8,11 @@ import type { CacheableResponseOptions } from "./CacheableResponse.js";
|
|
|
8
8
|
export declare class CacheableResponsePlugin implements SerwistPlugin {
|
|
9
9
|
private readonly _cacheableResponse;
|
|
10
10
|
/**
|
|
11
|
-
* To construct a new CacheableResponsePlugin instance you must provide at
|
|
11
|
+
* To construct a new `CacheableResponsePlugin` instance you must provide at
|
|
12
12
|
* least one of the `config` properties.
|
|
13
13
|
*
|
|
14
14
|
* If both `statuses` and `headers` are specified, then both conditions must
|
|
15
|
-
* be met for the
|
|
15
|
+
* be met for the response to be considered cacheable.
|
|
16
16
|
*
|
|
17
17
|
* @param config
|
|
18
18
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
interface CacheExpirationConfig {
|
|
2
2
|
/**
|
|
3
|
-
* The maximum number of entries to cache. Entries used
|
|
3
|
+
* The maximum number of entries to cache. Entries used least recently will
|
|
4
4
|
* be removed as the maximum is reached.
|
|
5
5
|
*/
|
|
6
6
|
maxEntries?: number;
|
|
@@ -27,7 +27,7 @@ export declare class CacheExpiration {
|
|
|
27
27
|
private readonly _cacheName;
|
|
28
28
|
private readonly _timestampModel;
|
|
29
29
|
/**
|
|
30
|
-
* To construct a new CacheExpiration instance you must provide at least
|
|
30
|
+
* To construct a new `CacheExpiration` instance you must provide at least
|
|
31
31
|
* one of the `config` properties.
|
|
32
32
|
*
|
|
33
33
|
* @param cacheName Name of the cache to apply restrictions to.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { CacheDidUpdateCallbackParam, CachedResponseWillBeUsedCallbackParam, SerwistPlugin } from "../../types.js";
|
|
2
2
|
export interface ExpirationPluginOptions {
|
|
3
3
|
/**
|
|
4
|
-
* The maximum number of entries to cache. Entries used
|
|
5
|
-
*
|
|
4
|
+
* The maximum number of entries to cache. Entries used (if `maxAgeFrom` is
|
|
5
|
+
* `"last-used"`) or fetched from the network (if `maxAgeFrom` is `"last-fetched"`)
|
|
6
|
+
* least recently will be removed as the maximum is reached.
|
|
6
7
|
*/
|
|
7
8
|
maxEntries?: number;
|
|
8
9
|
/**
|
|
@@ -27,10 +28,10 @@ export interface ExpirationPluginOptions {
|
|
|
27
28
|
purgeOnQuotaError?: boolean;
|
|
28
29
|
}
|
|
29
30
|
/**
|
|
30
|
-
* This plugin can be used in a
|
|
31
|
+
* This plugin can be used in a {@linkcode Strategy} to regularly enforce a
|
|
31
32
|
* limit on the age and/or the number of cached requests.
|
|
32
33
|
*
|
|
33
|
-
* It can only be used with Strategy instances that have a custom `cacheName` property set.
|
|
34
|
+
* It can only be used with {@linkcode Strategy} instances that have a custom `cacheName` property set.
|
|
34
35
|
* In other words, it can't be used to expire entries in strategies that use the default runtime
|
|
35
36
|
* cache name.
|
|
36
37
|
*
|
|
@@ -64,11 +65,10 @@ export declare class ExpirationPlugin implements SerwistPlugin {
|
|
|
64
65
|
*/
|
|
65
66
|
private _getCacheExpiration;
|
|
66
67
|
/**
|
|
67
|
-
* A
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* prevents it from being used if the `Response`'s `Date` header value is
|
|
68
|
+
* A lifecycle callback that will be triggered automatically when a
|
|
69
|
+
* response is about to be returned from a [`Cache`](https://developer.mozilla.org/en-US/docs/Web/API/Cache).
|
|
70
|
+
* It allows the response to be inspected for freshness and
|
|
71
|
+
* prevents it from being used if the response's `Date` header value is
|
|
72
72
|
* older than the configured `maxAgeSeconds`.
|
|
73
73
|
*
|
|
74
74
|
* @param options
|
|
@@ -92,8 +92,8 @@ export declare class ExpirationPlugin implements SerwistPlugin {
|
|
|
92
92
|
*/
|
|
93
93
|
private _getDateHeaderTimestamp;
|
|
94
94
|
/**
|
|
95
|
-
* A
|
|
96
|
-
*
|
|
95
|
+
* A lifecycle callback that will be triggered automatically when an entry is added
|
|
96
|
+
* to a cache.
|
|
97
97
|
*
|
|
98
98
|
* @param options
|
|
99
99
|
* @private
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpirationPlugin.d.ts","sourceRoot":"","sources":["../../../src/lib/expiration/ExpirationPlugin.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,2BAA2B,EAAE,qCAAqC,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpirationPlugin.d.ts","sourceRoot":"","sources":["../../../src/lib/expiration/ExpirationPlugin.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,2BAA2B,EAAE,qCAAqC,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AASxH,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC;IAC1C;;;OAGG;IACH,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,gBAAiB,YAAW,aAAa;IACpD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA0B;IAClD,OAAO,CAAC,iBAAiB,CAA+B;IAExD;;OAEG;gBACS,MAAM,GAAE,uBAA4B;IAkDhD;;;;;;;OAOG;IACH,OAAO,CAAC,mBAAmB;IAa3B;;;;;;;;;;;OAWG;IACH,wBAAwB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,qCAAqC;IAqC7G;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IAwB5B;;;;;;OAMG;IACH,OAAO,CAAC,uBAAuB;IAkB/B;;;;;;OAMG;IACG,cAAc,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,2BAA2B;IAqBxE;;;;;;;;;;;OAWG;IACG,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;CAW9C"}
|
|
@@ -18,13 +18,13 @@ export interface PrecacheFallbackPluginOptions {
|
|
|
18
18
|
*/
|
|
19
19
|
fallbackUrls: (string | PrecacheFallbackEntry)[];
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* A {@linkcode Serwist} instance.
|
|
22
22
|
*/
|
|
23
23
|
serwist: Serwist;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
26
|
+
* Allows you to specify offline fallbacks to be used when a given strategy
|
|
27
|
+
* is unable to generate a response.
|
|
28
28
|
*
|
|
29
29
|
* It does this by intercepting the `handlerDidError` plugin callback
|
|
30
30
|
* and returning a precached response, taking the expected revision parameter
|
|
@@ -34,7 +34,7 @@ export declare class PrecacheFallbackPlugin implements SerwistPlugin {
|
|
|
34
34
|
private readonly _fallbackUrls;
|
|
35
35
|
private readonly _serwist;
|
|
36
36
|
/**
|
|
37
|
-
* Constructs a new
|
|
37
|
+
* Constructs a new instance with the associated `fallbackUrls`.
|
|
38
38
|
*
|
|
39
39
|
* @param config
|
|
40
40
|
*/
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { SerwistPlugin } from "../../types.js";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* be fulfilled by a cached response.
|
|
3
|
+
* Makes it easy for a request with a `Range` header to be fulfilled by a cached response.
|
|
5
4
|
*
|
|
6
5
|
* It does this by intercepting the `cachedResponseWillBeUsed` plugin callback
|
|
7
6
|
* and returning the appropriate subset of the cached response body.
|
|
@@ -9,8 +8,8 @@ import type { SerwistPlugin } from "../../types.js";
|
|
|
9
8
|
export declare class RangeRequestsPlugin implements SerwistPlugin {
|
|
10
9
|
/**
|
|
11
10
|
* @param options
|
|
12
|
-
* @returns If request contains a
|
|
13
|
-
*
|
|
11
|
+
* @returns If request contains a `Range` header, then a
|
|
12
|
+
* partial response whose body is a subset of `cachedResponse` is
|
|
14
13
|
* returned. Otherwise, `cachedResponse` is returned as-is.
|
|
15
14
|
* @private
|
|
16
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RangeRequestsPlugin.d.ts","sourceRoot":"","sources":["../../../src/lib/rangeRequests/RangeRequestsPlugin.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGpD
|
|
1
|
+
{"version":3,"file":"RangeRequestsPlugin.d.ts","sourceRoot":"","sources":["../../../src/lib/rangeRequests/RangeRequestsPlugin.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGpD;;;;;GAKG;AACH,qBAAa,mBAAoB,YAAW,aAAa;IACvD;;;;;;OAMG;IACH,wBAAwB,EAAE,aAAa,CAAC,0BAA0B,CAAC,CAUjE;CACH"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Given a
|
|
3
|
-
* promise
|
|
2
|
+
* Given a request and a response, this will return a
|
|
3
|
+
* promise that resolves to a partial response.
|
|
4
4
|
*
|
|
5
|
-
* If the original
|
|
6
|
-
* a status of 206), then this assumes it already fulfills the `Range
|
|
5
|
+
* If the original response already contains partial content (i.e. it has
|
|
6
|
+
* a status of 206), then this assumes it already fulfills the `Range`
|
|
7
7
|
* requirements, and will return it as-is.
|
|
8
8
|
*
|
|
9
|
-
* @param request A request, which should contain a Range
|
|
9
|
+
* @param request A request, which should contain a `Range`
|
|
10
10
|
* header.
|
|
11
11
|
* @param originalResponse A response.
|
|
12
12
|
* @returns Either a `206 Partial Content` response, with
|
|
13
13
|
* the response body set to the slice of content specified by the request's
|
|
14
|
-
* `Range
|
|
15
|
-
* conditions of the `Range
|
|
14
|
+
* `Range` header, or a `416 Range Not Satisfiable` response if the
|
|
15
|
+
* conditions of the `Range` header can't be met.
|
|
16
16
|
*/
|
|
17
17
|
export declare const createPartialResponse: (request: Request, originalResponse: Response) => Promise<Response>;
|
|
18
18
|
//# sourceMappingURL=createPartialResponse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPartialResponse.d.ts","sourceRoot":"","sources":["../../../src/lib/rangeRequests/createPartialResponse.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,qBAAqB,YAAmB,OAAO,oBAAoB,QAAQ,KAAG,
|
|
1
|
+
{"version":3,"file":"createPartialResponse.d.ts","sourceRoot":"","sources":["../../../src/lib/rangeRequests/createPartialResponse.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,qBAAqB,YAAmB,OAAO,oBAAoB,QAAQ,KAAG,OAAO,CAAC,QAAQ,CA8D1G,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @param rangeHeader A Range
|
|
2
|
+
* @param rangeHeader A `Range` header value.
|
|
3
3
|
* @returns An object with `start` and `end` properties, reflecting
|
|
4
|
-
* the parsed value of the Range
|
|
4
|
+
* the parsed value of the `Range` header. If either the `start` or `end` are
|
|
5
5
|
* omitted, then `null` will be returned.
|
|
6
6
|
* @private
|
|
7
7
|
*/
|
|
@@ -9,7 +9,7 @@ import type { StrategyHandler } from "./StrategyHandler.js";
|
|
|
9
9
|
* can be cached for long periods of time.
|
|
10
10
|
*
|
|
11
11
|
* If the network request fails, and there is no cache match, this will throw
|
|
12
|
-
* a
|
|
12
|
+
* a {@linkcode SerwistError} exception.
|
|
13
13
|
*/
|
|
14
14
|
export declare class CacheFirst extends Strategy {
|
|
15
15
|
/**
|
|
@@ -6,7 +6,7 @@ import type { StrategyHandler } from "./StrategyHandler.js";
|
|
|
6
6
|
*
|
|
7
7
|
* This class is useful if you already have your own precaching step.
|
|
8
8
|
*
|
|
9
|
-
* If there is no cache match, this will throw a
|
|
9
|
+
* If there is no cache match, this will throw a {@linkcode SerwistError} exception.
|
|
10
10
|
*/
|
|
11
11
|
export declare class CacheOnly extends Strategy {
|
|
12
12
|
/**
|
|
@@ -17,7 +17,7 @@ export interface NetworkFirstOptions extends StrategyOptions {
|
|
|
17
17
|
* support [CORS](https://enable-cors.org/).
|
|
18
18
|
*
|
|
19
19
|
* If the network request fails, and there is no cache match, this will throw
|
|
20
|
-
* a
|
|
20
|
+
* a {@linkcode SerwistError} exception.
|
|
21
21
|
*/
|
|
22
22
|
export declare class NetworkFirst extends Strategy {
|
|
23
23
|
private readonly _networkTimeoutSeconds;
|
|
@@ -13,7 +13,7 @@ export interface NetworkOnlyOptions extends Omit<StrategyOptions, "cacheName" |
|
|
|
13
13
|
*
|
|
14
14
|
* This class is useful if you require specific requests to only be fulfilled from the network.
|
|
15
15
|
*
|
|
16
|
-
* If the network request fails, this will throw a
|
|
16
|
+
* If the network request fails, this will throw a {@linkcode SerwistError} exception.
|
|
17
17
|
*/
|
|
18
18
|
export declare class NetworkOnly extends Strategy {
|
|
19
19
|
private readonly _networkTimeoutSeconds;
|
|
@@ -10,11 +10,11 @@ interface PrecacheStrategyOptions extends StrategyOptions {
|
|
|
10
10
|
fallbackToNetwork?: boolean;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* A
|
|
14
|
-
*
|
|
13
|
+
* A {@linkcode Strategy} implementation specifically designed to both cache
|
|
14
|
+
* and fetch precached assets.
|
|
15
15
|
*
|
|
16
16
|
* Note: an instance of this class is created automatically when creating a
|
|
17
|
-
*
|
|
17
|
+
* {@linkcode Serwist} instance; it's generally not necessary to create this yourself.
|
|
18
18
|
*/
|
|
19
19
|
export declare class PrecacheStrategy extends Strategy {
|
|
20
20
|
private readonly _fallbackToNetwork;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrecacheStrategy.d.ts","sourceRoot":"","sources":["../../../src/lib/strategies/PrecacheStrategy.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"PrecacheStrategy.d.ts","sourceRoot":"","sources":["../../../src/lib/strategies/PrecacheStrategy.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAMpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,UAAU,uBAAwB,SAAQ,eAAe;IACvD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,qBAAa,gBAAiB,SAAQ,QAAQ;IAC5C,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAU;IAE7C,MAAM,CAAC,QAAQ,CAAC,iCAAiC,EAAE,aAAa,CAQ9D;IAEF,MAAM,CAAC,QAAQ,CAAC,sCAAsC,EAAE,aAAa,CAInE;IAEF;;OAEG;gBACS,OAAO,GAAE,uBAA4B;IAcjD;;;;;OAKG;IACG,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC;IAkBtE,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC;IAyE3E,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC;IAqBnF;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,qCAAqC,IAAI,IAAI;CA4B9C"}
|
|
@@ -17,7 +17,7 @@ import type { StrategyHandler } from "./StrategyHandler.js";
|
|
|
17
17
|
* support [CORS](https://enable-cors.org/).
|
|
18
18
|
*
|
|
19
19
|
* If the network request fails, and there is no cache match, this will throw
|
|
20
|
-
* a
|
|
20
|
+
* a {@linkcode SerwistError} exception.
|
|
21
21
|
*/
|
|
22
22
|
export declare class StaleWhileRevalidate extends Strategy {
|
|
23
23
|
/**
|
|
@@ -44,13 +44,13 @@ export declare abstract class Strategy implements RouteHandlerObject {
|
|
|
44
44
|
*/
|
|
45
45
|
constructor(options?: StrategyOptions);
|
|
46
46
|
/**
|
|
47
|
-
* Performs a request strategy and returns a
|
|
48
|
-
* a
|
|
47
|
+
* Performs a request strategy and returns a promise that will resolve to
|
|
48
|
+
* a response, invoking all relevant plugin callbacks.
|
|
49
49
|
*
|
|
50
|
-
* When a strategy instance is registered with a
|
|
50
|
+
* When a strategy instance is registered with a route, this method is automatically
|
|
51
51
|
* called when the route matches.
|
|
52
52
|
*
|
|
53
|
-
* Alternatively, this method can be used in a standalone `
|
|
53
|
+
* Alternatively, this method can be used in a standalone `fetch` event
|
|
54
54
|
* listener by passing it to `event.respondWith()`.
|
|
55
55
|
*
|
|
56
56
|
* @param options A `FetchEvent` or an object with the properties listed below.
|
|
@@ -61,10 +61,10 @@ export declare abstract class Strategy implements RouteHandlerObject {
|
|
|
61
61
|
*/
|
|
62
62
|
handle(options: FetchEvent | HandlerCallbackOptions): Promise<Response>;
|
|
63
63
|
/**
|
|
64
|
-
* Similar to `handle()`, but instead of just returning a
|
|
65
|
-
* resolves to a
|
|
64
|
+
* Similar to `handle()`, but instead of just returning a promise that
|
|
65
|
+
* resolves to a response, it will return an tuple of `[response, done]` promises,
|
|
66
66
|
* where `response` is equivalent to what `handle()` returns, and `done` is a
|
|
67
|
-
*
|
|
67
|
+
* promise that will resolve once all promises added to `event.waitUntil()` as a part
|
|
68
68
|
* of performing the strategy have completed.
|
|
69
69
|
*
|
|
70
70
|
* You can await the `done` promise to ensure any extra work performed by
|