@pagepocket/capture-http-lighterceptor-unit 0.12.0 → 0.13.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.
|
@@ -3,7 +3,7 @@ import { type LighterceptorAdapterOptions } from "./internal/lighterceptor-adapt
|
|
|
3
3
|
export type CaptureHttpLighterceptorUnitOptions = LighterceptorAdapterOptions;
|
|
4
4
|
export declare class CaptureHttpLighterceptorUnit extends Unit {
|
|
5
5
|
readonly id = "captureHttpLighterceptor";
|
|
6
|
-
readonly
|
|
6
|
+
readonly description = "Capturing page via Lighterceptor";
|
|
7
7
|
private adapterOptions;
|
|
8
8
|
constructor(options?: CaptureHttpLighterceptorUnitOptions);
|
|
9
9
|
run(ctx: UnitContext, rt: UnitRuntime): Promise<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NETWORK } from "@pagepocket/contracts";
|
|
2
|
-
import { Unit, createMemoryContentStore, InflightTracker, mapKind, networkIdle, normalizeCompletion, throwUnsupportedEntryKind, timeout } from "@pagepocket/lib";
|
|
2
|
+
import { Unit, createMemoryContentStore, debugLog, InflightTracker, mapKind, networkIdle, normalizeCompletion, throwUnsupportedEntryKind, timeout } from "@pagepocket/lib";
|
|
3
3
|
import { LighterceptorAdapter } from "./internal/lighterceptor-adapter.js";
|
|
4
4
|
const headersRecordToList = (headers) => {
|
|
5
5
|
if (!headers) {
|
|
@@ -23,7 +23,7 @@ export class CaptureHttpLighterceptorUnit extends Unit {
|
|
|
23
23
|
constructor(options) {
|
|
24
24
|
super();
|
|
25
25
|
this.id = "captureHttpLighterceptor";
|
|
26
|
-
this.
|
|
26
|
+
this.description = "Capturing page via Lighterceptor";
|
|
27
27
|
this.adapterOptions = options ?? {};
|
|
28
28
|
}
|
|
29
29
|
async run(ctx, rt) {
|
|
@@ -98,7 +98,7 @@ export class CaptureHttpLighterceptorUnit extends Unit {
|
|
|
98
98
|
void handleNetworkEvent(event);
|
|
99
99
|
},
|
|
100
100
|
onError: (error) => {
|
|
101
|
-
|
|
101
|
+
debugLog("[pagepocket][capture-http-lighterceptor] adapter error", error);
|
|
102
102
|
}
|
|
103
103
|
}, this.adapterOptions);
|
|
104
104
|
const html = ctx.value.html ?? (await session.waitForHtml());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagepocket/capture-http-lighterceptor-unit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "PagePocket plugin: capture HTTP events (lighterceptor adapter)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
],
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@pagepocket/lib": "0.
|
|
14
|
-
"@pagepocket/contracts": "0.
|
|
15
|
-
"@pagepocket/lighterceptor": "0.
|
|
13
|
+
"@pagepocket/lib": "0.13.0",
|
|
14
|
+
"@pagepocket/contracts": "0.13.0",
|
|
15
|
+
"@pagepocket/lighterceptor": "0.13.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"typescript": "^5.4.5"
|