test-proxy-recorder 0.3.0 → 0.3.2
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/README.md +146 -21
- package/dist/{index-CVuiglPk.d.cts → index-BlBWqSE4.d.cts} +21 -4
- package/dist/{index-CVuiglPk.d.ts → index-BlBWqSE4.d.ts} +21 -4
- package/dist/index.cjs +439 -260
- package/dist/index.d.cts +15 -7
- package/dist/index.d.ts +15 -7
- package/dist/index.mjs +438 -259
- package/dist/playwright/index.cjs +151 -13
- package/dist/playwright/index.d.cts +1 -1
- package/dist/playwright/index.d.ts +1 -1
- package/dist/playwright/index.mjs +147 -14
- package/dist/proxy.js +296 -246
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { RECORDING_ID_HEADER, createHeadersWithRecordingId, getRecordingId, setNextProxyHeaders } from './nextjs/index.cjs';
|
|
2
2
|
import http from 'node:http';
|
|
3
|
-
export { C as ControlRequest, M as Mode, P as PlaywrightTestInfo, R as Recording, a as RecordingSession, W as WebSocketRecording, g as generateSessionId, p as playwrightProxy, s as setProxyMode, b as startRecording, c as startReplay, d as stopProxy } from './index-
|
|
3
|
+
export { C as ControlRequest, M as Mode, P as PlaywrightTestInfo, R as Recording, a as RecordingSession, W as WebSocketRecording, g as generateSessionId, p as playwrightProxy, s as setProxyMode, b as startRecording, c as startReplay, d as stopProxy } from './index-BlBWqSE4.cjs';
|
|
4
4
|
import '@playwright/test';
|
|
5
5
|
|
|
6
6
|
declare class ProxyServer {
|
|
@@ -14,13 +14,14 @@ declare class ProxyServer {
|
|
|
14
14
|
private currentSession;
|
|
15
15
|
private recordingsDir;
|
|
16
16
|
private recordingIdCounter;
|
|
17
|
+
private sequenceCounterByKey;
|
|
17
18
|
private replaySessions;
|
|
19
|
+
private recordingPromises;
|
|
18
20
|
constructor(targets: string[], recordingsDir: string);
|
|
19
21
|
init(): Promise<void>;
|
|
20
22
|
listen(port: number): http.Server;
|
|
21
23
|
private setupProxyEventHandlers;
|
|
22
24
|
private handleProxyError;
|
|
23
|
-
private handleProxyResponse;
|
|
24
25
|
/**
|
|
25
26
|
* Get CORS headers for a given request
|
|
26
27
|
* @param req The incoming HTTP request
|
|
@@ -55,7 +56,13 @@ declare class ProxyServer {
|
|
|
55
56
|
* @returns The replay session state
|
|
56
57
|
*/
|
|
57
58
|
private getOrCreateReplaySession;
|
|
59
|
+
/**
|
|
60
|
+
* Clean up a session - removes it from memory and resets counters
|
|
61
|
+
* @param sessionId The session ID to clean up
|
|
62
|
+
*/
|
|
63
|
+
private cleanupSession;
|
|
58
64
|
private parseGetParams;
|
|
65
|
+
private parseControlRequest;
|
|
59
66
|
private handleControlRequest;
|
|
60
67
|
private clearModeTimeout;
|
|
61
68
|
private switchMode;
|
|
@@ -63,17 +70,18 @@ declare class ProxyServer {
|
|
|
63
70
|
private switchToRecordMode;
|
|
64
71
|
private switchToReplayMode;
|
|
65
72
|
private setupModeTimeout;
|
|
73
|
+
private flushPendingRecordings;
|
|
66
74
|
private saveCurrentSession;
|
|
67
|
-
private
|
|
68
|
-
private
|
|
69
|
-
private
|
|
70
|
-
private
|
|
75
|
+
private getRecordingIdOrError;
|
|
76
|
+
private ensureSessionLoaded;
|
|
77
|
+
private getServedTracker;
|
|
78
|
+
private selectReplayRecord;
|
|
71
79
|
private handleReplayRequest;
|
|
72
80
|
private handleReplayError;
|
|
73
81
|
private handleRequest;
|
|
74
82
|
private handleCorsPreflightRequest;
|
|
75
83
|
private handleProxyRequest;
|
|
76
|
-
private
|
|
84
|
+
private recordAndProxyRequest;
|
|
77
85
|
private handleUpgrade;
|
|
78
86
|
private handleRecordWebSocket;
|
|
79
87
|
private handleReplayWebSocket;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { RECORDING_ID_HEADER, createHeadersWithRecordingId, getRecordingId, setNextProxyHeaders } from './nextjs/index.js';
|
|
2
2
|
import http from 'node:http';
|
|
3
|
-
export { C as ControlRequest, M as Mode, P as PlaywrightTestInfo, R as Recording, a as RecordingSession, W as WebSocketRecording, g as generateSessionId, p as playwrightProxy, s as setProxyMode, b as startRecording, c as startReplay, d as stopProxy } from './index-
|
|
3
|
+
export { C as ControlRequest, M as Mode, P as PlaywrightTestInfo, R as Recording, a as RecordingSession, W as WebSocketRecording, g as generateSessionId, p as playwrightProxy, s as setProxyMode, b as startRecording, c as startReplay, d as stopProxy } from './index-BlBWqSE4.js';
|
|
4
4
|
import '@playwright/test';
|
|
5
5
|
|
|
6
6
|
declare class ProxyServer {
|
|
@@ -14,13 +14,14 @@ declare class ProxyServer {
|
|
|
14
14
|
private currentSession;
|
|
15
15
|
private recordingsDir;
|
|
16
16
|
private recordingIdCounter;
|
|
17
|
+
private sequenceCounterByKey;
|
|
17
18
|
private replaySessions;
|
|
19
|
+
private recordingPromises;
|
|
18
20
|
constructor(targets: string[], recordingsDir: string);
|
|
19
21
|
init(): Promise<void>;
|
|
20
22
|
listen(port: number): http.Server;
|
|
21
23
|
private setupProxyEventHandlers;
|
|
22
24
|
private handleProxyError;
|
|
23
|
-
private handleProxyResponse;
|
|
24
25
|
/**
|
|
25
26
|
* Get CORS headers for a given request
|
|
26
27
|
* @param req The incoming HTTP request
|
|
@@ -55,7 +56,13 @@ declare class ProxyServer {
|
|
|
55
56
|
* @returns The replay session state
|
|
56
57
|
*/
|
|
57
58
|
private getOrCreateReplaySession;
|
|
59
|
+
/**
|
|
60
|
+
* Clean up a session - removes it from memory and resets counters
|
|
61
|
+
* @param sessionId The session ID to clean up
|
|
62
|
+
*/
|
|
63
|
+
private cleanupSession;
|
|
58
64
|
private parseGetParams;
|
|
65
|
+
private parseControlRequest;
|
|
59
66
|
private handleControlRequest;
|
|
60
67
|
private clearModeTimeout;
|
|
61
68
|
private switchMode;
|
|
@@ -63,17 +70,18 @@ declare class ProxyServer {
|
|
|
63
70
|
private switchToRecordMode;
|
|
64
71
|
private switchToReplayMode;
|
|
65
72
|
private setupModeTimeout;
|
|
73
|
+
private flushPendingRecordings;
|
|
66
74
|
private saveCurrentSession;
|
|
67
|
-
private
|
|
68
|
-
private
|
|
69
|
-
private
|
|
70
|
-
private
|
|
75
|
+
private getRecordingIdOrError;
|
|
76
|
+
private ensureSessionLoaded;
|
|
77
|
+
private getServedTracker;
|
|
78
|
+
private selectReplayRecord;
|
|
71
79
|
private handleReplayRequest;
|
|
72
80
|
private handleReplayError;
|
|
73
81
|
private handleRequest;
|
|
74
82
|
private handleCorsPreflightRequest;
|
|
75
83
|
private handleProxyRequest;
|
|
76
|
-
private
|
|
84
|
+
private recordAndProxyRequest;
|
|
77
85
|
private handleUpgrade;
|
|
78
86
|
private handleRecordWebSocket;
|
|
79
87
|
private handleReplayWebSocket;
|