@serwist/core 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/_private/Deferred.d.ts +19 -0
- package/dist/_private/Deferred.d.ts.map +1 -0
- package/dist/_private/SerwistError.d.ts +24 -0
- package/dist/_private/SerwistError.d.ts.map +1 -0
- package/dist/_private/assert.d.ts +11 -0
- package/dist/_private/assert.d.ts.map +1 -0
- package/dist/_private/cacheMatchIgnoreParams.d.ts +15 -0
- package/dist/_private/cacheMatchIgnoreParams.d.ts.map +1 -0
- package/dist/_private/cacheNames.d.ts +40 -0
- package/dist/_private/cacheNames.d.ts.map +1 -0
- package/dist/_private/canConstructReadableStream.d.ts +12 -0
- package/dist/_private/canConstructReadableStream.d.ts.map +1 -0
- package/dist/_private/canConstructResponseFromBodyStream.d.ts +11 -0
- package/dist/_private/canConstructResponseFromBodyStream.d.ts.map +1 -0
- package/dist/_private/dontWaitFor.d.ts +7 -0
- package/dist/_private/dontWaitFor.d.ts.map +1 -0
- package/dist/_private/executeQuotaErrorCallbacks.d.ts +9 -0
- package/dist/_private/executeQuotaErrorCallbacks.d.ts.map +1 -0
- package/dist/_private/getFriendlyURL.d.ts +3 -0
- package/dist/_private/getFriendlyURL.d.ts.map +1 -0
- package/dist/_private/logger.d.ts +11 -0
- package/dist/_private/logger.d.ts.map +1 -0
- package/dist/_private/resultingClientExists.d.ts +12 -0
- package/dist/_private/resultingClientExists.d.ts.map +1 -0
- package/dist/_private/timeout.d.ts +10 -0
- package/dist/_private/timeout.d.ts.map +1 -0
- package/dist/_private/waitUntil.d.ts +12 -0
- package/dist/_private/waitUntil.d.ts.map +1 -0
- package/dist/cacheNames.d.ts +21 -0
- package/dist/cacheNames.d.ts.map +1 -0
- package/dist/clientsClaim.d.ts +7 -0
- package/dist/clientsClaim.d.ts.map +1 -0
- package/dist/copyResponse.d.ts +21 -0
- package/dist/copyResponse.d.ts.map +1 -0
- package/dist/index.d.ts +12 -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 +652 -0
- package/dist/index.internal.old.cjs +667 -0
- package/dist/index.js +571 -0
- package/dist/index.old.cjs +577 -0
- package/dist/models/messages/messageGenerator.d.ts +2 -0
- package/dist/models/messages/messageGenerator.d.ts.map +1 -0
- package/dist/models/messages/messages.d.ts +9 -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/registerQuotaErrorCallback.d.ts +9 -0
- package/dist/registerQuotaErrorCallback.d.ts.map +1 -0
- package/dist/setCacheNameDetails.d.ts +10 -0
- package/dist/setCacheNameDetails.d.ts.map +1 -0
- package/dist/types.d.ts +273 -0
- package/dist/types.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/welcome.d.ts +2 -0
- package/dist/utils/welcome.d.ts.map +1 -0
- package/package.json +59 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Google LLC, 2019 ShadowWalker w@weiw.io https://weiw.io, 2023 Serwist
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This module's documentation can be found at https://developers.google.com/web/tools/workbox/modules/workbox-core
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Deferred class composes Promises in a way that allows for them to be
|
|
3
|
+
* resolved or rejected from outside the constructor. In most cases promises
|
|
4
|
+
* should be used directly, but Deferreds can be necessary when the logic to
|
|
5
|
+
* resolve a promise must be separate.
|
|
6
|
+
*
|
|
7
|
+
* @private
|
|
8
|
+
*/
|
|
9
|
+
declare class Deferred<T> {
|
|
10
|
+
promise: Promise<T>;
|
|
11
|
+
resolve: (value: T) => void;
|
|
12
|
+
reject: (reason?: any) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a promise and exposes its resolve and reject functions as methods.
|
|
15
|
+
*/
|
|
16
|
+
constructor();
|
|
17
|
+
}
|
|
18
|
+
export { Deferred };
|
|
19
|
+
//# sourceMappingURL=Deferred.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Deferred.d.ts","sourceRoot":"","sources":["../../src/_private/Deferred.ts"],"names":[],"mappings":"AAQA;;;;;;;GAOG;AACH,cAAM,QAAQ,CAAC,CAAC;IACd,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,OAAO,EAAG,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,MAAM,EAAG,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAEhC;;OAEG;;CAOJ;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { MapLikeObject } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Serwist errors should be thrown with this class.
|
|
4
|
+
* This allows use to ensure the type easily in tests,
|
|
5
|
+
* helps developers identify errors from Serwist
|
|
6
|
+
* easily and allows use to optimise error
|
|
7
|
+
* messages correctly.
|
|
8
|
+
*
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
declare class SerwistError extends Error {
|
|
12
|
+
details?: MapLikeObject;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param errorCode The error code that
|
|
16
|
+
* identifies this particular error.
|
|
17
|
+
* @param details Any relevant arguments
|
|
18
|
+
* that will help developers identify issues should
|
|
19
|
+
* be added as a key on the context object.
|
|
20
|
+
*/
|
|
21
|
+
constructor(errorCode: string, details?: MapLikeObject);
|
|
22
|
+
}
|
|
23
|
+
export { SerwistError };
|
|
24
|
+
//# sourceMappingURL=SerwistError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SerwistError.d.ts","sourceRoot":"","sources":["../../src/_private/SerwistError.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;;;;;GAQG;AACH,cAAM,YAAa,SAAQ,KAAK;IAC9B,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;;;;OAOG;gBACS,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;CAQvD;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MapLikeObject } from "../types.js";
|
|
2
|
+
declare const finalAssertExports: {
|
|
3
|
+
hasMethod: (object: MapLikeObject, expectedMethod: string, details: MapLikeObject) => void;
|
|
4
|
+
isArray: (value: any[], details: MapLikeObject) => void;
|
|
5
|
+
isInstance: (object: unknown, expectedClass: Function, details: MapLikeObject) => void;
|
|
6
|
+
isOneOf: (value: any, validValues: any[], details: MapLikeObject) => void;
|
|
7
|
+
isType: (object: unknown, expectedType: string, details: MapLikeObject) => void;
|
|
8
|
+
isArrayOfClass: (value: any, expectedClass: Function, details: MapLikeObject) => void;
|
|
9
|
+
} | null;
|
|
10
|
+
export { finalAssertExports as assert };
|
|
11
|
+
//# sourceMappingURL=assert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/_private/assert.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAmEjD,QAAA,MAAM,kBAAkB;wBArDG,aAAa,kBAAkB,MAAM,WAAW,aAAa;qBANhE,GAAG,EAAE,WAAW,aAAa;yBAsB3C,OAAO,iBAGA,QAAQ,WACd,aAAa;qBAQA,GAAG,eAAe,GAAG,EAAE,WAAW,aAAa;qBApB/C,OAAO,gBAAgB,MAAM,WAAW,aAAa;4BA4BpE,GAAG,iBAEK,QAAQ,WACd,aAAa;QAwBjB,CAAC;AAER,OAAO,EAAE,kBAAkB,IAAI,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matches an item in the cache, ignoring specific URL params. This is similar
|
|
3
|
+
* to the `ignoreSearch` option, but it allows you to ignore just specific
|
|
4
|
+
* params (while continuing to match on the others).
|
|
5
|
+
*
|
|
6
|
+
* @private
|
|
7
|
+
* @param cache
|
|
8
|
+
* @param request
|
|
9
|
+
* @param matchOptions
|
|
10
|
+
* @param ignoreParams
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
declare function cacheMatchIgnoreParams(cache: Cache, request: Request, ignoreParams: string[], matchOptions?: CacheQueryOptions): Promise<Response | undefined>;
|
|
14
|
+
export { cacheMatchIgnoreParams };
|
|
15
|
+
//# sourceMappingURL=cacheMatchIgnoreParams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cacheMatchIgnoreParams.d.ts","sourceRoot":"","sources":["../../src/_private/cacheMatchIgnoreParams.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;GAWG;AACH,iBAAe,sBAAsB,CACnC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,MAAM,EAAE,EACtB,YAAY,CAAC,EAAE,iBAAiB,GAC/B,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAmB/B;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface CacheNameDetails {
|
|
2
|
+
googleAnalytics: string;
|
|
3
|
+
precache: string;
|
|
4
|
+
prefix: string;
|
|
5
|
+
runtime: string;
|
|
6
|
+
suffix: string;
|
|
7
|
+
}
|
|
8
|
+
export interface PartialCacheNameDetails {
|
|
9
|
+
/**
|
|
10
|
+
* The string to add to the beginning of the precache and runtime cache names.
|
|
11
|
+
*/
|
|
12
|
+
prefix?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The string to add to the end of the precache and runtime cache names.
|
|
15
|
+
*/
|
|
16
|
+
suffix?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The cache name to use for precache caching.
|
|
19
|
+
*/
|
|
20
|
+
precache?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The cache name to use for runtime caching.
|
|
23
|
+
*/
|
|
24
|
+
runtime?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The cache name to use for `@serwist/google-analytics` caching.
|
|
27
|
+
*/
|
|
28
|
+
googleAnalytics?: string;
|
|
29
|
+
[propName: string]: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
export type CacheNameDetailsProp = "googleAnalytics" | "precache" | "prefix" | "runtime" | "suffix";
|
|
32
|
+
export declare const cacheNames: {
|
|
33
|
+
updateDetails: (details: PartialCacheNameDetails) => void;
|
|
34
|
+
getGoogleAnalyticsName: (userCacheName?: string) => string;
|
|
35
|
+
getPrecacheName: (userCacheName?: string) => string;
|
|
36
|
+
getPrefix: () => string;
|
|
37
|
+
getRuntimeName: (userCacheName?: string) => string;
|
|
38
|
+
getSuffix: () => string;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=cacheNames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cacheNames.d.ts","sourceRoot":"","sources":["../../src/_private/cacheNames.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACxC;AAED,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AAoBpG,eAAO,MAAM,UAAU;6BACI,uBAAuB,KAAG,IAAI;6CAQd,MAAM,KAAG,MAAM;sCAGtB,MAAM,KAAG,MAAM;qBAGlC,MAAM;qCAGY,MAAM,KAAG,MAAM;qBAGjC,MAAM;CAGtB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A utility function that determines whether the current browser supports
|
|
3
|
+
* constructing a [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)
|
|
4
|
+
* object.
|
|
5
|
+
*
|
|
6
|
+
* @returns `true`, if the current browser can successfully construct a `ReadableStream`, `false` otherwise.
|
|
7
|
+
*
|
|
8
|
+
* @private
|
|
9
|
+
*/
|
|
10
|
+
declare function canConstructReadableStream(): boolean;
|
|
11
|
+
export { canConstructReadableStream };
|
|
12
|
+
//# sourceMappingURL=canConstructReadableStream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canConstructReadableStream.d.ts","sourceRoot":"","sources":["../../src/_private/canConstructReadableStream.ts"],"names":[],"mappings":"AAUA;;;;;;;;GAQG;AACH,iBAAS,0BAA0B,IAAI,OAAO,CAY7C;AAED,OAAO,EAAE,0BAA0B,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A utility function that determines whether the current browser supports
|
|
3
|
+
* constructing a new `Response` from a `response.body` stream.
|
|
4
|
+
*
|
|
5
|
+
* @returns `true`, if the current browser can successfully construct
|
|
6
|
+
* a `Response` from a `response.body` stream, `false` otherwise.
|
|
7
|
+
* @private
|
|
8
|
+
*/
|
|
9
|
+
declare function canConstructResponseFromBodyStream(): boolean;
|
|
10
|
+
export { canConstructResponseFromBodyStream };
|
|
11
|
+
//# sourceMappingURL=canConstructResponseFromBodyStream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canConstructResponseFromBodyStream.d.ts","sourceRoot":"","sources":["../../src/_private/canConstructResponseFromBodyStream.ts"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,iBAAS,kCAAkC,IAAI,OAAO,CAgBrD;AAED,OAAO,EAAE,kCAAkC,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dontWaitFor.d.ts","sourceRoot":"","sources":["../../src/_private/dontWaitFor.ts"],"names":[],"mappings":"AAOA;;;;IAII;AACJ,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAGvD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs all of the callback functions, one at a time sequentially, in the order
|
|
3
|
+
* in which they were registered.
|
|
4
|
+
*
|
|
5
|
+
* @private
|
|
6
|
+
*/
|
|
7
|
+
declare function executeQuotaErrorCallbacks(): Promise<void>;
|
|
8
|
+
export { executeQuotaErrorCallbacks };
|
|
9
|
+
//# sourceMappingURL=executeQuotaErrorCallbacks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executeQuotaErrorCallbacks.d.ts","sourceRoot":"","sources":["../../src/_private/executeQuotaErrorCallbacks.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,iBAAe,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC,CAezD;AAED,OAAO,EAAE,0BAA0B,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFriendlyURL.d.ts","sourceRoot":"","sources":["../../src/_private/getFriendlyURL.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,cAAc,QAAS,GAAG,GAAG,MAAM,KAAG,MAK3C,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/_private/logger.ts"],"names":[],"mappings":"AAQA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,iBAAiB;QACzB,qBAAqB,EAAE,OAAO,CAAC;KAChC;IAED,UAAU,MAAM;QACd,qBAAqB,EAAE,OAAO,CAAC;KAChC;CACF;AAID,QAAA,MAAM,MAAM,SAqEA,CAAC;AAEb,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a promise that resolves to a window client matching the passed
|
|
3
|
+
* `resultingClientId`. For browsers that don't support `resultingClientId`
|
|
4
|
+
* or if waiting for the resulting client to apper takes too long, resolve to
|
|
5
|
+
* `undefined`.
|
|
6
|
+
*
|
|
7
|
+
* @param resultingClientId
|
|
8
|
+
* @returns
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
export declare function resultingClientExists(resultingClientId?: string): Promise<Client | undefined>;
|
|
12
|
+
//# sourceMappingURL=resultingClientExists.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resultingClientExists.d.ts","sourceRoot":"","sources":["../../src/_private/resultingClientExists.ts"],"names":[],"mappings":"AAcA;;;;;;;;;GASG;AACH,wBAAsB,qBAAqB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAkCnG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a promise that resolves and the passed number of milliseconds.
|
|
3
|
+
* This utility is an async/await-friendly version of `setTimeout`.
|
|
4
|
+
*
|
|
5
|
+
* @param ms
|
|
6
|
+
* @returns
|
|
7
|
+
* @private
|
|
8
|
+
*/
|
|
9
|
+
export declare function timeout(ms: number): Promise<unknown>;
|
|
10
|
+
//# sourceMappingURL=timeout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeout.d.ts","sourceRoot":"","sources":["../../src/_private/timeout.ts"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AAEH,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEpD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A utility method that makes it easier to use `event.waitUntil` with
|
|
3
|
+
* async functions and return the result.
|
|
4
|
+
*
|
|
5
|
+
* @param event
|
|
6
|
+
* @param asyncFn
|
|
7
|
+
* @returns
|
|
8
|
+
* @private
|
|
9
|
+
*/
|
|
10
|
+
declare function waitUntil(event: ExtendableEvent, asyncFn: () => Promise<any>): Promise<any>;
|
|
11
|
+
export { waitUntil };
|
|
12
|
+
//# sourceMappingURL=waitUntil.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"waitUntil.d.ts","sourceRoot":"","sources":["../../src/_private/waitUntil.ts"],"names":[],"mappings":"AAOA;;;;;;;;GAQG;AACH,iBAAS,SAAS,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAIpF;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the current cache names and prefix/suffix used by Workbox.
|
|
3
|
+
*
|
|
4
|
+
* `cacheNames.precache` is used for precached assets,
|
|
5
|
+
* `cacheNames.googleAnalytics` is used by `@serwist/google-analytics` to
|
|
6
|
+
* store `analytics.js`, and `cacheNames.runtime` is used for everything else.
|
|
7
|
+
*
|
|
8
|
+
* `cacheNames.prefix` can be used to retrieve just the current prefix value.
|
|
9
|
+
* `cacheNames.suffix` can be used to retrieve just the current suffix value.
|
|
10
|
+
*
|
|
11
|
+
* @returns An object with `precache`, `runtime`, `prefix`, and `googleAnalytics` properties.
|
|
12
|
+
*/
|
|
13
|
+
declare const cacheNames: {
|
|
14
|
+
readonly googleAnalytics: string;
|
|
15
|
+
readonly precache: string;
|
|
16
|
+
readonly prefix: string;
|
|
17
|
+
readonly runtime: string;
|
|
18
|
+
readonly suffix: string;
|
|
19
|
+
};
|
|
20
|
+
export { cacheNames };
|
|
21
|
+
//# sourceMappingURL=cacheNames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cacheNames.d.ts","sourceRoot":"","sources":["../src/cacheNames.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,UAAU;;;;;;CAgBf,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientsClaim.d.ts","sourceRoot":"","sources":["../src/clientsClaim.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,iBAAS,YAAY,IAAI,IAAI,CAE5B;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Allows developers to copy a response and modify its `headers`, `status`,
|
|
3
|
+
* or `statusText` values (the values settable via a
|
|
4
|
+
* [`ResponseInit`](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax)
|
|
5
|
+
* object in the constructor).
|
|
6
|
+
* To modify these values, pass a function as the second argument. That
|
|
7
|
+
* function will be invoked with a single object with the response properties
|
|
8
|
+
* `{headers, status, statusText}`. The return value of this function will
|
|
9
|
+
* be used as the `ResponseInit` for the new `Response`. To change the values
|
|
10
|
+
* either modify the passed parameter(s) and return it, or return a totally
|
|
11
|
+
* new object.
|
|
12
|
+
*
|
|
13
|
+
* This method is intentionally limited to same-origin responses, regardless of
|
|
14
|
+
* whether CORS was used or not.
|
|
15
|
+
*
|
|
16
|
+
* @param response
|
|
17
|
+
* @param modifier
|
|
18
|
+
*/
|
|
19
|
+
declare function copyResponse(response: Response, modifier?: (responseInit: ResponseInit) => ResponseInit): Promise<Response>;
|
|
20
|
+
export { copyResponse };
|
|
21
|
+
//# sourceMappingURL=copyResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copyResponse.d.ts","sourceRoot":"","sources":["../src/copyResponse.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAe,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,CA8B1H;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { cacheNames } from "./cacheNames.js";
|
|
2
|
+
import { clientsClaim } from "./clientsClaim.js";
|
|
3
|
+
import { copyResponse } from "./copyResponse.js";
|
|
4
|
+
import { registerQuotaErrorCallback } from "./registerQuotaErrorCallback.js";
|
|
5
|
+
import { setCacheNameDetails } from "./setCacheNameDetails.js";
|
|
6
|
+
/**
|
|
7
|
+
* All Serwist libraries use `@serwist/core` for shared code as well as
|
|
8
|
+
* setting default values that need to be shared (like cache names).
|
|
9
|
+
*/
|
|
10
|
+
export { cacheNames, clientsClaim, copyResponse, registerQuotaErrorCallback, setCacheNameDetails };
|
|
11
|
+
export * from "./types.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;;GAGG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,CAAC;AAEnG,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { assert } from "./_private/assert.js";
|
|
2
|
+
import { cacheMatchIgnoreParams } from "./_private/cacheMatchIgnoreParams.js";
|
|
3
|
+
import { cacheNames as privateCacheNames } from "./_private/cacheNames.js";
|
|
4
|
+
import { canConstructReadableStream } from "./_private/canConstructReadableStream.js";
|
|
5
|
+
import { canConstructResponseFromBodyStream } from "./_private/canConstructResponseFromBodyStream.js";
|
|
6
|
+
import { Deferred } from "./_private/Deferred.js";
|
|
7
|
+
import { dontWaitFor } from "./_private/dontWaitFor.js";
|
|
8
|
+
import { executeQuotaErrorCallbacks } from "./_private/executeQuotaErrorCallbacks.js";
|
|
9
|
+
import { getFriendlyURL } from "./_private/getFriendlyURL.js";
|
|
10
|
+
import { logger } from "./_private/logger.js";
|
|
11
|
+
import { resultingClientExists } from "./_private/resultingClientExists.js";
|
|
12
|
+
import { SerwistError } from "./_private/SerwistError.js";
|
|
13
|
+
import { timeout } from "./_private/timeout.js";
|
|
14
|
+
import { waitUntil } from "./_private/waitUntil.js";
|
|
15
|
+
export { assert, cacheMatchIgnoreParams, canConstructReadableStream, canConstructResponseFromBodyStream, Deferred, dontWaitFor, executeQuotaErrorCallbacks, getFriendlyURL, logger, privateCacheNames, resultingClientExists, SerwistError, timeout, waitUntil, };
|
|
16
|
+
//# sourceMappingURL=index.internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.internal.d.ts","sourceRoot":"","sources":["../src/index.internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,kCAAkC,EAAE,MAAM,kDAAkD,CAAC;AACtG,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIpD,OAAO,EACL,MAAM,EACN,sBAAsB,EACtB,0BAA0B,EAC1B,kCAAkC,EAClC,QAAQ,EACR,WAAW,EACX,0BAA0B,EAC1B,cAAc,EACd,MAAM,EACN,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,EACZ,OAAO,EACP,SAAS,GACV,CAAC"}
|