@toapi/worker 0.12.1 → 1.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/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Logger } from "@toapi/common";
|
|
2
|
-
export {
|
|
2
|
+
export type { Logger } from "@toapi/common";
|
|
3
3
|
export { cleanup } from "./cleanup";
|
|
4
4
|
export type { CleanupOptions } from "./cleanup";
|
|
5
|
-
export
|
|
5
|
+
export { listenForInvalidations } from "./revalidation-stream";
|
|
6
6
|
export declare function handleTapiRequest(req: Request, options?: {
|
|
7
7
|
logger?: Logger;
|
|
8
8
|
}): Promise<Response>;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAK5C,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,OAAO,EACZ,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,qBAsC9B"}
|
package/dist/index.js
CHANGED
|
@@ -2,10 +2,11 @@ import { isMutation } from "@toapi/common";
|
|
|
2
2
|
import { getCachedEntry, getMetadata } from "./cache";
|
|
3
3
|
import { mutateAndInvalidate } from "./mutate-and-invalidate";
|
|
4
4
|
import { serveFromNetwork } from "./serve-from-network";
|
|
5
|
-
export { listenForInvalidations } from "./revalidation-stream";
|
|
6
5
|
export { cleanup } from "./cleanup";
|
|
6
|
+
export { listenForInvalidations } from "./revalidation-stream";
|
|
7
7
|
export async function handleTapiRequest(req, options) {
|
|
8
|
-
const errorLog = options?.logger?.error ??
|
|
8
|
+
const errorLog = options?.logger?.error ??
|
|
9
|
+
((err) => console.error("TApi Worker fetch failed", err));
|
|
9
10
|
if (isMutation(req)) {
|
|
10
11
|
return mutateAndInvalidate(req);
|
|
11
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toapi/worker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Michel Smola",
|
|
6
6
|
"email": "michel.smola@farbenmeer.de"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@toapi/common": "^0.
|
|
23
|
+
"@toapi/common": "^1.0.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^25.0.3",
|