@serwist/core 9.0.0-preview.19 → 9.0.0-preview.20
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.
|
@@ -9,7 +9,7 @@ import type { MapLikeObject } from "../types.js";
|
|
|
9
9
|
*
|
|
10
10
|
* @private
|
|
11
11
|
*/
|
|
12
|
-
declare class SerwistError extends Error {
|
|
12
|
+
export declare class SerwistError extends Error {
|
|
13
13
|
details?: MapLikeObject;
|
|
14
14
|
/**
|
|
15
15
|
*
|
|
@@ -21,5 +21,4 @@ declare class SerwistError extends Error {
|
|
|
21
21
|
*/
|
|
22
22
|
constructor(errorCode: MessageKey, details?: MapLikeObject);
|
|
23
23
|
}
|
|
24
|
-
export { SerwistError };
|
|
25
24
|
//# sourceMappingURL=SerwistError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SerwistError.d.ts","sourceRoot":"","sources":["../../src/_private/SerwistError.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;;;;;GAQG;AACH,
|
|
1
|
+
{"version":3,"file":"SerwistError.d.ts","sourceRoot":"","sources":["../../src/_private/SerwistError.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACrC,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;;;;OAOG;gBACS,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,aAAa;CAQ3D"}
|
|
@@ -125,10 +125,10 @@ const messages = {
|
|
|
125
125
|
return `The supplied '${paramName}' parameter must be an array of '${expectedClass}' objects. Received '${JSON.stringify(value)},'. Please check the call to ${moduleName}.${className}.${funcName}() to fix the issue.`;
|
|
126
126
|
},
|
|
127
127
|
"max-entries-or-age-required": ({ moduleName, className, funcName })=>{
|
|
128
|
-
return `You must define either config.maxEntries or config.
|
|
128
|
+
return `You must define either 'config.maxEntries' or 'config.maxAgeSeconds' in '${moduleName}.${className}.${funcName}'`;
|
|
129
129
|
},
|
|
130
130
|
"statuses-or-headers-required": ({ moduleName, className, funcName })=>{
|
|
131
|
-
return `You must define either config.statuses or config.
|
|
131
|
+
return `You must define either 'config.statuses' or 'config.headers' in '${moduleName}.${className}.${funcName}'`;
|
|
132
132
|
},
|
|
133
133
|
"invalid-string": ({ moduleName, funcName, paramName })=>{
|
|
134
134
|
if (!paramName || !moduleName || !funcName) {
|
|
@@ -186,7 +186,7 @@ const messages = {
|
|
|
186
186
|
return `The precaching request for '${url}' failed${status ? ` with an HTTP status of ${status}.` : "."}`;
|
|
187
187
|
},
|
|
188
188
|
"non-precached-url": ({ url })=>{
|
|
189
|
-
return `createHandlerBoundToURL(
|
|
189
|
+
return `'createHandlerBoundToURL("${url}")' was called, but that URL is not precached. Please pass in a URL that is precached instead.`;
|
|
190
190
|
},
|
|
191
191
|
"add-to-cache-list-conflicting-integrities": ({ url })=>{
|
|
192
192
|
return `Two of the entries passed to '@serwist/precaching.PrecacheController.addToCacheList()' had the URL ${url} with different integrity values. Please remove one of them.`;
|
|
@@ -195,10 +195,10 @@ const messages = {
|
|
|
195
195
|
return `Unable to find a precached response in ${cacheName} for ${url}.`;
|
|
196
196
|
},
|
|
197
197
|
"cross-origin-copy-response": ({ origin })=>{
|
|
198
|
-
return
|
|
198
|
+
return `'@serwist/core.copyResponse()' can only be used with same-origin responses. It was passed a response with origin ${origin}.`;
|
|
199
199
|
},
|
|
200
200
|
"opaque-streams-source": ({ type })=>{
|
|
201
|
-
const message = `One of the @serwist/streams sources resulted in an '${type}' response.`;
|
|
201
|
+
const message = `One of the '@serwist/streams' sources resulted in an '${type}' response.`;
|
|
202
202
|
if (type === "opaqueredirect") {
|
|
203
203
|
return `${message} Please do not use a navigation request that results in a redirect as a source.`;
|
|
204
204
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serwist/core",
|
|
3
|
-
"version": "9.0.0-preview.
|
|
3
|
+
"version": "9.0.0-preview.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "This module is used by a number of the other Serwist modules to share common code.",
|
|
6
6
|
"files": [
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"rollup": "4.13.0",
|
|
42
42
|
"typescript": "5.5.0-dev.20240323",
|
|
43
|
-
"@serwist/constants": "9.0.0-preview.
|
|
43
|
+
"@serwist/constants": "9.0.0-preview.20"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"typescript": ">=5.0.0"
|
|
@@ -19,7 +19,7 @@ import type { MapLikeObject } from "../types.js";
|
|
|
19
19
|
*
|
|
20
20
|
* @private
|
|
21
21
|
*/
|
|
22
|
-
class SerwistError extends Error {
|
|
22
|
+
export class SerwistError extends Error {
|
|
23
23
|
details?: MapLikeObject;
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -39,5 +39,3 @@ class SerwistError extends Error {
|
|
|
39
39
|
this.details = details;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
export { SerwistError };
|
|
@@ -130,11 +130,11 @@ export const messages = {
|
|
|
130
130
|
},
|
|
131
131
|
|
|
132
132
|
"max-entries-or-age-required": ({ moduleName, className, funcName }) => {
|
|
133
|
-
return `You must define either config.maxEntries or config.
|
|
133
|
+
return `You must define either 'config.maxEntries' or 'config.maxAgeSeconds' in '${moduleName}.${className}.${funcName}'`;
|
|
134
134
|
},
|
|
135
135
|
|
|
136
136
|
"statuses-or-headers-required": ({ moduleName, className, funcName }) => {
|
|
137
|
-
return `You must define either config.statuses or config.
|
|
137
|
+
return `You must define either 'config.statuses' or 'config.headers' in '${moduleName}.${className}.${funcName}'`;
|
|
138
138
|
},
|
|
139
139
|
|
|
140
140
|
"invalid-string": ({ moduleName, funcName, paramName }) => {
|
|
@@ -206,7 +206,7 @@ export const messages = {
|
|
|
206
206
|
},
|
|
207
207
|
|
|
208
208
|
"non-precached-url": ({ url }) => {
|
|
209
|
-
return `createHandlerBoundToURL(
|
|
209
|
+
return `'createHandlerBoundToURL("${url}")' was called, but that URL is not precached. Please pass in a URL that is precached instead.`;
|
|
210
210
|
},
|
|
211
211
|
|
|
212
212
|
"add-to-cache-list-conflicting-integrities": ({ url }) => {
|
|
@@ -218,11 +218,11 @@ export const messages = {
|
|
|
218
218
|
},
|
|
219
219
|
|
|
220
220
|
"cross-origin-copy-response": ({ origin }) => {
|
|
221
|
-
return
|
|
221
|
+
return `'@serwist/core.copyResponse()' can only be used with same-origin responses. It was passed a response with origin ${origin}.`;
|
|
222
222
|
},
|
|
223
223
|
|
|
224
224
|
"opaque-streams-source": ({ type }) => {
|
|
225
|
-
const message = `One of the @serwist/streams sources resulted in an '${type}' response.`;
|
|
225
|
+
const message = `One of the '@serwist/streams' sources resulted in an '${type}' response.`;
|
|
226
226
|
if (type === "opaqueredirect") {
|
|
227
227
|
return `${message} Please do not use a navigation request that results in a redirect as a source.`;
|
|
228
228
|
}
|