@heojeongbo/wirestage 0.0.0-stage → 0.1.1
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/LICENSES.md +21 -0
- package/README.md +150 -2
- package/dist/app/playwright/index.d.ts +3 -0
- package/dist/app/playwright/index.d.ts.map +1 -0
- package/dist/app/playwright/index.js +2 -0
- package/dist/app/playwright/index.js.map +1 -0
- package/dist/app/playwright/lib/fixture.d.ts +61 -0
- package/dist/app/playwright/lib/fixture.d.ts.map +1 -0
- package/dist/app/playwright/lib/fixture.js +110 -0
- package/dist/app/playwright/lib/fixture.js.map +1 -0
- package/dist/connect.d.ts +7 -0
- package/dist/connect.d.ts.map +1 -0
- package/dist/connect.js +7 -0
- package/dist/connect.js.map +1 -0
- package/dist/entities/frame/@x/plugin.d.ts +9 -0
- package/dist/entities/frame/@x/plugin.d.ts.map +1 -0
- package/dist/entities/frame/@x/plugin.js +2 -0
- package/dist/entities/frame/@x/plugin.js.map +1 -0
- package/dist/entities/frame/index.d.ts +6 -0
- package/dist/entities/frame/index.d.ts.map +1 -0
- package/dist/entities/frame/index.js +4 -0
- package/dist/entities/frame/index.js.map +1 -0
- package/dist/entities/frame/lib/filter.d.ts +8 -0
- package/dist/entities/frame/lib/filter.d.ts.map +1 -0
- package/dist/entities/frame/lib/filter.js +62 -0
- package/dist/entities/frame/lib/filter.js.map +1 -0
- package/dist/entities/frame/lib/payload.d.ts +8 -0
- package/dist/entities/frame/lib/payload.d.ts.map +1 -0
- package/dist/entities/frame/lib/payload.js +42 -0
- package/dist/entities/frame/lib/payload.js.map +1 -0
- package/dist/entities/frame/lib/snapshot.d.ts +15 -0
- package/dist/entities/frame/lib/snapshot.d.ts.map +1 -0
- package/dist/entities/frame/lib/snapshot.js +90 -0
- package/dist/entities/frame/lib/snapshot.js.map +1 -0
- package/dist/entities/frame/lib/timeline.d.ts +23 -0
- package/dist/entities/frame/lib/timeline.d.ts.map +1 -0
- package/dist/entities/frame/lib/timeline.js +122 -0
- package/dist/entities/frame/lib/timeline.js.map +1 -0
- package/dist/entities/frame/model/frame.d.ts +182 -0
- package/dist/entities/frame/model/frame.d.ts.map +1 -0
- package/dist/entities/frame/model/frame.js +2 -0
- package/dist/entities/frame/model/frame.js.map +1 -0
- package/dist/entities/plugin/index.d.ts +9 -0
- package/dist/entities/plugin/index.d.ts.map +1 -0
- package/dist/entities/plugin/index.js +3 -0
- package/dist/entities/plugin/index.js.map +1 -0
- package/dist/entities/plugin/lib/define-plugin.d.ts +8 -0
- package/dist/entities/plugin/lib/define-plugin.d.ts.map +1 -0
- package/dist/entities/plugin/lib/define-plugin.js +9 -0
- package/dist/entities/plugin/lib/define-plugin.js.map +1 -0
- package/dist/entities/plugin/lib/named.d.ts +10 -0
- package/dist/entities/plugin/lib/named.d.ts.map +1 -0
- package/dist/entities/plugin/lib/named.js +17 -0
- package/dist/entities/plugin/lib/named.js.map +1 -0
- package/dist/entities/plugin/model/attachment.d.ts +18 -0
- package/dist/entities/plugin/model/attachment.d.ts.map +1 -0
- package/dist/entities/plugin/model/attachment.js +2 -0
- package/dist/entities/plugin/model/attachment.js.map +1 -0
- package/dist/entities/plugin/model/http.d.ts +135 -0
- package/dist/entities/plugin/model/http.d.ts.map +1 -0
- package/dist/entities/plugin/model/http.js +2 -0
- package/dist/entities/plugin/model/http.js.map +1 -0
- package/dist/entities/plugin/model/page.d.ts +100 -0
- package/dist/entities/plugin/model/page.d.ts.map +1 -0
- package/dist/entities/plugin/model/page.js +2 -0
- package/dist/entities/plugin/model/page.js.map +1 -0
- package/dist/entities/plugin/model/plugin.d.ts +83 -0
- package/dist/entities/plugin/model/plugin.d.ts.map +1 -0
- package/dist/entities/plugin/model/plugin.js +2 -0
- package/dist/entities/plugin/model/plugin.js.map +1 -0
- package/dist/entities/plugin/model/socket.d.ts +107 -0
- package/dist/entities/plugin/model/socket.d.ts.map +1 -0
- package/dist/entities/plugin/model/socket.js +2 -0
- package/dist/entities/plugin/model/socket.js.map +1 -0
- package/dist/entities/plugin/model/stream.d.ts +46 -0
- package/dist/entities/plugin/model/stream.d.ts.map +1 -0
- package/dist/entities/plugin/model/stream.js +2 -0
- package/dist/entities/plugin/model/stream.js.map +1 -0
- package/dist/features/connect/index.d.ts +5 -0
- package/dist/features/connect/index.d.ts.map +1 -0
- package/dist/features/connect/index.js +4 -0
- package/dist/features/connect/index.js.map +1 -0
- package/dist/features/connect/lib/calls.d.ts +9 -0
- package/dist/features/connect/lib/calls.d.ts.map +1 -0
- package/dist/features/connect/lib/calls.js +46 -0
- package/dist/features/connect/lib/calls.js.map +1 -0
- package/dist/features/connect/lib/client.d.ts +33 -0
- package/dist/features/connect/lib/client.d.ts.map +1 -0
- package/dist/features/connect/lib/client.js +147 -0
- package/dist/features/connect/lib/client.js.map +1 -0
- package/dist/features/connect/lib/create-connect.d.ts +14 -0
- package/dist/features/connect/lib/create-connect.d.ts.map +1 -0
- package/dist/features/connect/lib/create-connect.js +124 -0
- package/dist/features/connect/lib/create-connect.js.map +1 -0
- package/dist/features/connect/lib/faults.d.ts +18 -0
- package/dist/features/connect/lib/faults.d.ts.map +1 -0
- package/dist/features/connect/lib/faults.js +85 -0
- package/dist/features/connect/lib/faults.js.map +1 -0
- package/dist/features/connect/lib/protocol.d.ts +42 -0
- package/dist/features/connect/lib/protocol.d.ts.map +1 -0
- package/dist/features/connect/lib/protocol.js +228 -0
- package/dist/features/connect/lib/protocol.js.map +1 -0
- package/dist/features/connect/lib/record.d.ts +14 -0
- package/dist/features/connect/lib/record.d.ts.map +1 -0
- package/dist/features/connect/lib/record.js +36 -0
- package/dist/features/connect/lib/record.js.map +1 -0
- package/dist/features/connect/lib/recorder.d.ts +77 -0
- package/dist/features/connect/lib/recorder.d.ts.map +1 -0
- package/dist/features/connect/lib/recorder.js +209 -0
- package/dist/features/connect/lib/recorder.js.map +1 -0
- package/dist/features/connect/lib/rules.d.ts +51 -0
- package/dist/features/connect/lib/rules.d.ts.map +1 -0
- package/dist/features/connect/lib/rules.js +222 -0
- package/dist/features/connect/lib/rules.js.map +1 -0
- package/dist/features/connect/lib/serve.d.ts +10 -0
- package/dist/features/connect/lib/serve.d.ts.map +1 -0
- package/dist/features/connect/lib/serve.js +78 -0
- package/dist/features/connect/lib/serve.js.map +1 -0
- package/dist/features/connect/lib/status-of.d.ts +11 -0
- package/dist/features/connect/lib/status-of.d.ts.map +1 -0
- package/dist/features/connect/lib/status-of.js +22 -0
- package/dist/features/connect/lib/status-of.js.map +1 -0
- package/dist/features/connect/lib/stubs.d.ts +18 -0
- package/dist/features/connect/lib/stubs.d.ts.map +1 -0
- package/dist/features/connect/lib/stubs.js +174 -0
- package/dist/features/connect/lib/stubs.js.map +1 -0
- package/dist/features/connect/lib/universal.d.ts +19 -0
- package/dist/features/connect/lib/universal.d.ts.map +1 -0
- package/dist/features/connect/lib/universal.js +71 -0
- package/dist/features/connect/lib/universal.js.map +1 -0
- package/dist/features/connect/model/types.d.ts +247 -0
- package/dist/features/connect/model/types.d.ts.map +1 -0
- package/dist/features/connect/model/types.js +2 -0
- package/dist/features/connect/model/types.js.map +1 -0
- package/dist/features/rest/index.d.ts +5 -0
- package/dist/features/rest/index.d.ts.map +1 -0
- package/dist/features/rest/index.js +3 -0
- package/dist/features/rest/index.js.map +1 -0
- package/dist/features/rest/lib/calls.d.ts +8 -0
- package/dist/features/rest/lib/calls.d.ts.map +1 -0
- package/dist/features/rest/lib/calls.js +32 -0
- package/dist/features/rest/lib/calls.js.map +1 -0
- package/dist/features/rest/lib/create-rest.d.ts +8 -0
- package/dist/features/rest/lib/create-rest.d.ts.map +1 -0
- package/dist/features/rest/lib/create-rest.js +136 -0
- package/dist/features/rest/lib/create-rest.js.map +1 -0
- package/dist/features/rest/lib/path.d.ts +14 -0
- package/dist/features/rest/lib/path.d.ts.map +1 -0
- package/dist/features/rest/lib/path.js +58 -0
- package/dist/features/rest/lib/path.js.map +1 -0
- package/dist/features/rest/lib/reply.d.ts +25 -0
- package/dist/features/rest/lib/reply.d.ts.map +1 -0
- package/dist/features/rest/lib/reply.js +40 -0
- package/dist/features/rest/lib/reply.js.map +1 -0
- package/dist/features/rest/model/types.d.ts +74 -0
- package/dist/features/rest/model/types.d.ts.map +1 -0
- package/dist/features/rest/model/types.js +2 -0
- package/dist/features/rest/model/types.js.map +1 -0
- package/dist/features/sse/index.d.ts +4 -0
- package/dist/features/sse/index.d.ts.map +1 -0
- package/dist/features/sse/index.js +3 -0
- package/dist/features/sse/index.js.map +1 -0
- package/dist/features/sse/lib/create-sse.d.ts +9 -0
- package/dist/features/sse/lib/create-sse.d.ts.map +1 -0
- package/dist/features/sse/lib/create-sse.js +121 -0
- package/dist/features/sse/lib/create-sse.js.map +1 -0
- package/dist/features/sse/lib/encode.d.ts +8 -0
- package/dist/features/sse/lib/encode.d.ts.map +1 -0
- package/dist/features/sse/lib/encode.js +29 -0
- package/dist/features/sse/lib/encode.js.map +1 -0
- package/dist/features/sse/model/types.d.ts +68 -0
- package/dist/features/sse/model/types.d.ts.map +1 -0
- package/dist/features/sse/model/types.js +2 -0
- package/dist/features/sse/model/types.js.map +1 -0
- package/dist/features/webrtc/index.d.ts +3 -0
- package/dist/features/webrtc/index.d.ts.map +1 -0
- package/dist/features/webrtc/index.js +2 -0
- package/dist/features/webrtc/index.js.map +1 -0
- package/dist/features/webrtc/lib/create-webrtc.d.ts +9 -0
- package/dist/features/webrtc/lib/create-webrtc.d.ts.map +1 -0
- package/dist/features/webrtc/lib/create-webrtc.js +123 -0
- package/dist/features/webrtc/lib/create-webrtc.js.map +1 -0
- package/dist/features/webrtc/lib/rtc-page-module.d.ts +22 -0
- package/dist/features/webrtc/lib/rtc-page-module.d.ts.map +1 -0
- package/dist/features/webrtc/lib/rtc-page-module.js +161 -0
- package/dist/features/webrtc/lib/rtc-page-module.js.map +1 -0
- package/dist/features/webrtc/lib/to-frame.d.ts +9 -0
- package/dist/features/webrtc/lib/to-frame.d.ts.map +1 -0
- package/dist/features/webrtc/lib/to-frame.js +43 -0
- package/dist/features/webrtc/lib/to-frame.js.map +1 -0
- package/dist/features/webrtc/model/types.d.ts +70 -0
- package/dist/features/webrtc/model/types.d.ts.map +1 -0
- package/dist/features/webrtc/model/types.js +2 -0
- package/dist/features/webrtc/model/types.js.map +1 -0
- package/dist/features/websocket/index.d.ts +3 -0
- package/dist/features/websocket/index.d.ts.map +1 -0
- package/dist/features/websocket/index.js +2 -0
- package/dist/features/websocket/index.js.map +1 -0
- package/dist/features/websocket/lib/create-websocket.d.ts +9 -0
- package/dist/features/websocket/lib/create-websocket.d.ts.map +1 -0
- package/dist/features/websocket/lib/create-websocket.js +34 -0
- package/dist/features/websocket/lib/create-websocket.js.map +1 -0
- package/dist/features/websocket/lib/mock.d.ts +6 -0
- package/dist/features/websocket/lib/mock.d.ts.map +1 -0
- package/dist/features/websocket/lib/mock.js +96 -0
- package/dist/features/websocket/lib/mock.js.map +1 -0
- package/dist/features/websocket/lib/proxy.d.ts +9 -0
- package/dist/features/websocket/lib/proxy.d.ts.map +1 -0
- package/dist/features/websocket/lib/proxy.js +120 -0
- package/dist/features/websocket/lib/proxy.js.map +1 -0
- package/dist/features/websocket/lib/wire.d.ts +16 -0
- package/dist/features/websocket/lib/wire.d.ts.map +1 -0
- package/dist/features/websocket/lib/wire.js +46 -0
- package/dist/features/websocket/lib/wire.js.map +1 -0
- package/dist/features/websocket/model/types.d.ts +133 -0
- package/dist/features/websocket/model/types.d.ts.map +1 -0
- package/dist/features/websocket/model/types.js +2 -0
- package/dist/features/websocket/model/types.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/playwright.d.ts +4 -0
- package/dist/playwright.d.ts.map +1 -0
- package/dist/playwright.js +2 -0
- package/dist/playwright.js.map +1 -0
- package/dist/rest.d.ts +3 -0
- package/dist/rest.d.ts.map +1 -0
- package/dist/rest.js +3 -0
- package/dist/rest.js.map +1 -0
- package/dist/shared/api/http-server/index.d.ts +3 -0
- package/dist/shared/api/http-server/index.d.ts.map +1 -0
- package/dist/shared/api/http-server/index.js +2 -0
- package/dist/shared/api/http-server/index.js.map +1 -0
- package/dist/shared/api/http-server/listen.d.ts +25 -0
- package/dist/shared/api/http-server/listen.d.ts.map +1 -0
- package/dist/shared/api/http-server/listen.js +44 -0
- package/dist/shared/api/http-server/listen.js.map +1 -0
- package/dist/shared/api/playwright/index.d.ts +2 -0
- package/dist/shared/api/playwright/index.d.ts.map +1 -0
- package/dist/shared/api/playwright/index.js +2 -0
- package/dist/shared/api/playwright/index.js.map +1 -0
- package/dist/shared/api/playwright/ports.d.ts +126 -0
- package/dist/shared/api/playwright/ports.d.ts.map +1 -0
- package/dist/shared/api/playwright/ports.js +11 -0
- package/dist/shared/api/playwright/ports.js.map +1 -0
- package/dist/shared/api/stream-server/index.d.ts +3 -0
- package/dist/shared/api/stream-server/index.d.ts.map +1 -0
- package/dist/shared/api/stream-server/index.js +2 -0
- package/dist/shared/api/stream-server/index.js.map +1 -0
- package/dist/shared/api/stream-server/stream-server.d.ts +45 -0
- package/dist/shared/api/stream-server/stream-server.d.ts.map +1 -0
- package/dist/shared/api/stream-server/stream-server.js +167 -0
- package/dist/shared/api/stream-server/stream-server.js.map +1 -0
- package/dist/shared/lib/async/arrivals.d.ts +31 -0
- package/dist/shared/lib/async/arrivals.d.ts.map +1 -0
- package/dist/shared/lib/async/arrivals.js +57 -0
- package/dist/shared/lib/async/arrivals.js.map +1 -0
- package/dist/shared/lib/async/async-queue.d.ts +23 -0
- package/dist/shared/lib/async/async-queue.d.ts.map +1 -0
- package/dist/shared/lib/async/async-queue.js +80 -0
- package/dist/shared/lib/async/async-queue.js.map +1 -0
- package/dist/shared/lib/async/deferred.d.ts +12 -0
- package/dist/shared/lib/async/deferred.d.ts.map +1 -0
- package/dist/shared/lib/async/deferred.js +34 -0
- package/dist/shared/lib/async/deferred.js.map +1 -0
- package/dist/shared/lib/async/index.d.ts +8 -0
- package/dist/shared/lib/async/index.d.ts.map +1 -0
- package/dist/shared/lib/async/index.js +5 -0
- package/dist/shared/lib/async/index.js.map +1 -0
- package/dist/shared/lib/async/run-all.d.ts +8 -0
- package/dist/shared/lib/async/run-all.d.ts.map +1 -0
- package/dist/shared/lib/async/run-all.js +22 -0
- package/dist/shared/lib/async/run-all.js.map +1 -0
- package/dist/shared/lib/bytes/bytes.d.ts +18 -0
- package/dist/shared/lib/bytes/bytes.d.ts.map +1 -0
- package/dist/shared/lib/bytes/bytes.js +48 -0
- package/dist/shared/lib/bytes/bytes.js.map +1 -0
- package/dist/shared/lib/bytes/index.d.ts +3 -0
- package/dist/shared/lib/bytes/index.d.ts.map +1 -0
- package/dist/shared/lib/bytes/index.js +2 -0
- package/dist/shared/lib/bytes/index.js.map +1 -0
- package/dist/shared/lib/clock/clock.d.ts +29 -0
- package/dist/shared/lib/clock/clock.d.ts.map +1 -0
- package/dist/shared/lib/clock/clock.js +85 -0
- package/dist/shared/lib/clock/clock.js.map +1 -0
- package/dist/shared/lib/clock/index.d.ts +3 -0
- package/dist/shared/lib/clock/index.d.ts.map +1 -0
- package/dist/shared/lib/clock/index.js +2 -0
- package/dist/shared/lib/clock/index.js.map +1 -0
- package/dist/shared/lib/cookies/index.d.ts +3 -0
- package/dist/shared/lib/cookies/index.d.ts.map +1 -0
- package/dist/shared/lib/cookies/index.js +2 -0
- package/dist/shared/lib/cookies/index.js.map +1 -0
- package/dist/shared/lib/cookies/set-cookie.d.ts +22 -0
- package/dist/shared/lib/cookies/set-cookie.d.ts.map +1 -0
- package/dist/shared/lib/cookies/set-cookie.js +89 -0
- package/dist/shared/lib/cookies/set-cookie.js.map +1 -0
- package/dist/shared/lib/envelope/envelope.d.ts +50 -0
- package/dist/shared/lib/envelope/envelope.d.ts.map +1 -0
- package/dist/shared/lib/envelope/envelope.js +111 -0
- package/dist/shared/lib/envelope/envelope.js.map +1 -0
- package/dist/shared/lib/envelope/index.d.ts +3 -0
- package/dist/shared/lib/envelope/index.d.ts.map +1 -0
- package/dist/shared/lib/envelope/index.js +2 -0
- package/dist/shared/lib/envelope/index.js.map +1 -0
- package/dist/shared/lib/errors/index.d.ts +3 -0
- package/dist/shared/lib/errors/index.d.ts.map +1 -0
- package/dist/shared/lib/errors/index.js +2 -0
- package/dist/shared/lib/errors/index.js.map +1 -0
- package/dist/shared/lib/errors/wirestage-error.d.ts +28 -0
- package/dist/shared/lib/errors/wirestage-error.d.ts.map +1 -0
- package/dist/shared/lib/errors/wirestage-error.js +16 -0
- package/dist/shared/lib/errors/wirestage-error.js.map +1 -0
- package/dist/shared/lib/id/id.d.ts +10 -0
- package/dist/shared/lib/id/id.d.ts.map +1 -0
- package/dist/shared/lib/id/id.js +26 -0
- package/dist/shared/lib/id/id.js.map +1 -0
- package/dist/shared/lib/id/index.d.ts +2 -0
- package/dist/shared/lib/id/index.d.ts.map +1 -0
- package/dist/shared/lib/id/index.js +2 -0
- package/dist/shared/lib/id/index.js.map +1 -0
- package/dist/shared/lib/logger/index.d.ts +3 -0
- package/dist/shared/lib/logger/index.d.ts.map +1 -0
- package/dist/shared/lib/logger/index.js +2 -0
- package/dist/shared/lib/logger/index.js.map +1 -0
- package/dist/shared/lib/logger/logger.d.ts +46 -0
- package/dist/shared/lib/logger/logger.d.ts.map +1 -0
- package/dist/shared/lib/logger/logger.js +67 -0
- package/dist/shared/lib/logger/logger.js.map +1 -0
- package/dist/shared/lib/match/index.d.ts +3 -0
- package/dist/shared/lib/match/index.d.ts.map +1 -0
- package/dist/shared/lib/match/index.js +2 -0
- package/dist/shared/lib/match/index.js.map +1 -0
- package/dist/shared/lib/match/url-matcher.d.ts +27 -0
- package/dist/shared/lib/match/url-matcher.d.ts.map +1 -0
- package/dist/shared/lib/match/url-matcher.js +88 -0
- package/dist/shared/lib/match/url-matcher.js.map +1 -0
- package/dist/sse.d.ts +3 -0
- package/dist/sse.d.ts.map +1 -0
- package/dist/sse.js +3 -0
- package/dist/sse.js.map +1 -0
- package/dist/webrtc.d.ts +3 -0
- package/dist/webrtc.d.ts.map +1 -0
- package/dist/webrtc.js +3 -0
- package/dist/webrtc.js.map +1 -0
- package/dist/websocket.d.ts +3 -0
- package/dist/websocket.d.ts.map +1 -0
- package/dist/websocket.js +3 -0
- package/dist/websocket.js.map +1 -0
- package/dist/widgets/stage/index.d.ts +3 -0
- package/dist/widgets/stage/index.d.ts.map +1 -0
- package/dist/widgets/stage/index.js +2 -0
- package/dist/widgets/stage/index.js.map +1 -0
- package/dist/widgets/stage/lib/attached-context.d.ts +10 -0
- package/dist/widgets/stage/lib/attached-context.d.ts.map +1 -0
- package/dist/widgets/stage/lib/attached-context.js +2 -0
- package/dist/widgets/stage/lib/attached-context.js.map +1 -0
- package/dist/widgets/stage/lib/create-stage.d.ts +12 -0
- package/dist/widgets/stage/lib/create-stage.d.ts.map +1 -0
- package/dist/widgets/stage/lib/create-stage.js +250 -0
- package/dist/widgets/stage/lib/create-stage.js.map +1 -0
- package/dist/widgets/stage/lib/http-router.d.ts +44 -0
- package/dist/widgets/stage/lib/http-router.d.ts.map +1 -0
- package/dist/widgets/stage/lib/http-router.js +696 -0
- package/dist/widgets/stage/lib/http-router.js.map +1 -0
- package/dist/widgets/stage/lib/page-host.d.ts +36 -0
- package/dist/widgets/stage/lib/page-host.d.ts.map +1 -0
- package/dist/widgets/stage/lib/page-host.js +240 -0
- package/dist/widgets/stage/lib/page-host.js.map +1 -0
- package/dist/widgets/stage/lib/page-runtime.d.ts +93 -0
- package/dist/widgets/stage/lib/page-runtime.d.ts.map +1 -0
- package/dist/widgets/stage/lib/page-runtime.js +247 -0
- package/dist/widgets/stage/lib/page-runtime.js.map +1 -0
- package/dist/widgets/stage/lib/reads.d.ts +21 -0
- package/dist/widgets/stage/lib/reads.d.ts.map +1 -0
- package/dist/widgets/stage/lib/reads.js +97 -0
- package/dist/widgets/stage/lib/reads.js.map +1 -0
- package/dist/widgets/stage/lib/response-stream.d.ts +23 -0
- package/dist/widgets/stage/lib/response-stream.d.ts.map +1 -0
- package/dist/widgets/stage/lib/response-stream.js +108 -0
- package/dist/widgets/stage/lib/response-stream.js.map +1 -0
- package/dist/widgets/stage/lib/socket-router.d.ts +25 -0
- package/dist/widgets/stage/lib/socket-router.d.ts.map +1 -0
- package/dist/widgets/stage/lib/socket-router.js +233 -0
- package/dist/widgets/stage/lib/socket-router.js.map +1 -0
- package/dist/widgets/stage/model/stage.d.ts +88 -0
- package/dist/widgets/stage/model/stage.d.ts.map +1 -0
- package/dist/widgets/stage/model/stage.js +2 -0
- package/dist/widgets/stage/model/stage.js.map +1 -0
- package/package.json +140 -5
- package/src/app/playwright/index.ts +7 -0
- package/src/app/playwright/lib/fixture.ts +201 -0
- package/src/connect.ts +6 -0
- package/src/entities/frame/@x/plugin.ts +8 -0
- package/src/entities/frame/index.ts +19 -0
- package/src/entities/frame/lib/filter.ts +58 -0
- package/src/entities/frame/lib/payload.ts +42 -0
- package/src/entities/frame/lib/snapshot.ts +105 -0
- package/src/entities/frame/lib/timeline.ts +147 -0
- package/src/entities/frame/model/frame.ts +191 -0
- package/src/entities/plugin/index.ts +36 -0
- package/src/entities/plugin/lib/define-plugin.ts +12 -0
- package/src/entities/plugin/lib/named.ts +21 -0
- package/src/entities/plugin/model/attachment.ts +18 -0
- package/src/entities/plugin/model/http.ts +156 -0
- package/src/entities/plugin/model/page.ts +110 -0
- package/src/entities/plugin/model/plugin.ts +96 -0
- package/src/entities/plugin/model/socket.ts +113 -0
- package/src/entities/plugin/model/stream.ts +46 -0
- package/src/features/connect/index.ts +23 -0
- package/src/features/connect/lib/calls.ts +58 -0
- package/src/features/connect/lib/client.ts +203 -0
- package/src/features/connect/lib/create-connect.ts +164 -0
- package/src/features/connect/lib/faults.ts +132 -0
- package/src/features/connect/lib/protocol.ts +321 -0
- package/src/features/connect/lib/record.ts +48 -0
- package/src/features/connect/lib/recorder.ts +306 -0
- package/src/features/connect/lib/rules.ts +385 -0
- package/src/features/connect/lib/serve.ts +114 -0
- package/src/features/connect/lib/status-of.ts +20 -0
- package/src/features/connect/lib/stubs.ts +282 -0
- package/src/features/connect/lib/universal.ts +100 -0
- package/src/features/connect/model/types.ts +305 -0
- package/src/features/rest/index.ts +23 -0
- package/src/features/rest/lib/calls.ts +31 -0
- package/src/features/rest/lib/create-rest.ts +169 -0
- package/src/features/rest/lib/path.ts +70 -0
- package/src/features/rest/lib/reply.ts +74 -0
- package/src/features/rest/model/types.ts +113 -0
- package/src/features/sse/index.ts +10 -0
- package/src/features/sse/lib/create-sse.ts +129 -0
- package/src/features/sse/lib/encode.ts +28 -0
- package/src/features/sse/model/types.ts +72 -0
- package/src/features/webrtc/index.ts +6 -0
- package/src/features/webrtc/lib/create-webrtc.ts +149 -0
- package/src/features/webrtc/lib/rtc-page-module.ts +189 -0
- package/src/features/webrtc/lib/to-frame.ts +63 -0
- package/src/features/webrtc/model/types.ts +80 -0
- package/src/features/websocket/index.ts +15 -0
- package/src/features/websocket/lib/create-websocket.ts +41 -0
- package/src/features/websocket/lib/mock.ts +114 -0
- package/src/features/websocket/lib/proxy.ts +153 -0
- package/src/features/websocket/lib/wire.ts +78 -0
- package/src/features/websocket/model/types.ts +134 -0
- package/src/index.ts +111 -0
- package/src/playwright.ts +8 -0
- package/src/rest.ts +2 -0
- package/src/shared/api/http-server/index.ts +2 -0
- package/src/shared/api/http-server/listen.ts +71 -0
- package/src/shared/api/playwright/index.ts +17 -0
- package/src/shared/api/playwright/ports.ts +150 -0
- package/src/shared/api/stream-server/index.ts +7 -0
- package/src/shared/api/stream-server/stream-server.ts +254 -0
- package/src/shared/lib/async/arrivals.ts +91 -0
- package/src/shared/lib/async/async-queue.ts +101 -0
- package/src/shared/lib/async/deferred.ts +38 -0
- package/src/shared/lib/async/index.ts +11 -0
- package/src/shared/lib/async/run-all.ts +19 -0
- package/src/shared/lib/bytes/bytes.ts +53 -0
- package/src/shared/lib/bytes/index.ts +9 -0
- package/src/shared/lib/clock/clock.ts +114 -0
- package/src/shared/lib/clock/index.ts +2 -0
- package/src/shared/lib/cookies/index.ts +2 -0
- package/src/shared/lib/cookies/set-cookie.ts +105 -0
- package/src/shared/lib/envelope/envelope.ts +133 -0
- package/src/shared/lib/envelope/index.ts +9 -0
- package/src/shared/lib/errors/index.ts +5 -0
- package/src/shared/lib/errors/wirestage-error.ts +50 -0
- package/src/shared/lib/id/id.ts +29 -0
- package/src/shared/lib/id/index.ts +1 -0
- package/src/shared/lib/logger/index.ts +12 -0
- package/src/shared/lib/logger/logger.ts +126 -0
- package/src/shared/lib/match/index.ts +6 -0
- package/src/shared/lib/match/url-matcher.ts +107 -0
- package/src/sse.ts +2 -0
- package/src/webrtc.ts +2 -0
- package/src/websocket.ts +2 -0
- package/src/widgets/stage/index.ts +9 -0
- package/src/widgets/stage/lib/attached-context.ts +10 -0
- package/src/widgets/stage/lib/create-stage.ts +307 -0
- package/src/widgets/stage/lib/http-router.ts +954 -0
- package/src/widgets/stage/lib/page-host.ts +375 -0
- package/src/widgets/stage/lib/page-runtime.ts +314 -0
- package/src/widgets/stage/lib/reads.ts +128 -0
- package/src/widgets/stage/lib/response-stream.ts +139 -0
- package/src/widgets/stage/lib/socket-router.ts +300 -0
- package/src/widgets/stage/model/stage.ts +110 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 heojeongbo
|
|
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/LICENSES.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# License and distribution
|
|
2
|
+
|
|
3
|
+
wirestage is distributed under the MIT license in [LICENSE](LICENSE), with
|
|
4
|
+
copyright attributed to heojeongbo. Package metadata declares `MIT`.
|
|
5
|
+
|
|
6
|
+
The npm tarball contains the compiled modules, the TypeScript source (for
|
|
7
|
+
source maps, tests excluded), README, LICENSE and this inventory. It bundles
|
|
8
|
+
no third-party code. Dependencies are installed separately and keep their own
|
|
9
|
+
licenses:
|
|
10
|
+
|
|
11
|
+
| Package | Kind | License |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| @heojeongbo/log-palette | dependency | MIT |
|
|
14
|
+
| @playwright/test | required peer | Apache-2.0 |
|
|
15
|
+
| @connectrpc/connect | optional peer (`/connect`) | Apache-2.0 |
|
|
16
|
+
| @connectrpc/connect-node | optional peer (`/connect`) | Apache-2.0 |
|
|
17
|
+
| @bufbuild/protobuf | optional peer (`/connect`) | Apache-2.0 AND BSD-3-Clause |
|
|
18
|
+
|
|
19
|
+
The core and the `/rest`, `/sse`, `/websocket` and `/webrtc` entries use only
|
|
20
|
+
Playwright and the platform. Connect and protobuf are imported by `/connect`
|
|
21
|
+
alone, so they may be absent otherwise (`pnpm package:check` proves it).
|
package/README.md
CHANGED
|
@@ -1,3 +1,151 @@
|
|
|
1
|
-
#
|
|
1
|
+
# wirestage
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Record, fake and fault-inject browser wire traffic in Playwright — REST,
|
|
4
|
+
Connect, gRPC-web, gRPC, SSE, WebSocket and WebRTC data channels — on one
|
|
5
|
+
timeline.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add -D @heojeongbo/wirestage
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Playwright can route HTTP and WebSockets, but a modern app talks more than
|
|
12
|
+
that: server-streaming RPCs, event streams, WebRTC data channels. Tests end up
|
|
13
|
+
hand-rolling gRPC-web frames, patching `RTCDataChannel` in init scripts and
|
|
14
|
+
running ad-hoc local servers for streams. wirestage is those pieces, done once,
|
|
15
|
+
behind one API:
|
|
16
|
+
|
|
17
|
+
- **Fake** any protocol, including responses that stay open: a test-driven
|
|
18
|
+
gRPC-web stream or event stream, message by message.
|
|
19
|
+
- **Record** what the page actually sent and received, decoded, on a single
|
|
20
|
+
timeline you can drain, mark and wait on.
|
|
21
|
+
- **Fault-inject**: abort, delay, hold, cut a stream mid-flight, drop messages
|
|
22
|
+
on one data channel while it stays open.
|
|
23
|
+
- **Drive** the real backend from the test, signed in as the page.
|
|
24
|
+
|
|
25
|
+
## Quick start
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { test as base, expect } from "@playwright/test";
|
|
29
|
+
import { withStage } from "@heojeongbo/wirestage/playwright";
|
|
30
|
+
import { json, rest } from "@heojeongbo/wirestage/rest";
|
|
31
|
+
import { webrtc } from "@heojeongbo/wirestage/webrtc";
|
|
32
|
+
|
|
33
|
+
export const test = withStage(base, {
|
|
34
|
+
plugins: [rest({ baseURL: "/api" }), webrtc({ labels: ["room/cursor"] })],
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test("the room card shows its state", async ({ page, stage }) => {
|
|
38
|
+
await stage.rest.get("/rooms/:id", (request) =>
|
|
39
|
+
json({ id: request.params["id"], state: "idle" }),
|
|
40
|
+
);
|
|
41
|
+
await page.goto("/rooms/r1");
|
|
42
|
+
await expect(page.getByText("idle")).toBeVisible();
|
|
43
|
+
|
|
44
|
+
await stage.mark("before move");
|
|
45
|
+
await page.getByRole("button", { name: "Share cursor" }).click();
|
|
46
|
+
const sent = await stage.since("before move", {
|
|
47
|
+
protocol: "webrtc",
|
|
48
|
+
endpoint: "room/cursor",
|
|
49
|
+
direction: "out",
|
|
50
|
+
});
|
|
51
|
+
expect(sent.length).toBeGreaterThan(0);
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
A failing test gets the timeline attached to its report, as text and JSON,
|
|
56
|
+
whenever anything is on it.
|
|
57
|
+
|
|
58
|
+
## Protocols
|
|
59
|
+
|
|
60
|
+
Each protocol is a plugin in its own subpath. Install only the peers of the
|
|
61
|
+
ones you use.
|
|
62
|
+
|
|
63
|
+
| Subpath | Plugin | Fakes | Records | Faults | Extra peers |
|
|
64
|
+
| --- | --- | --- | --- | --- | --- |
|
|
65
|
+
| `/rest` | `rest()` | routes with `:params`, `json`/`text`/`bytes` replies | requests and real responses | abort, delay, status | — |
|
|
66
|
+
| `/connect` | `connect()` | Connect, gRPC-web: unary, server streams, whole services | decoded messages and status | fail, abort, hold, cut | `@connectrpc/connect`, `@connectrpc/connect-node`, `@bufbuild/protobuf` |
|
|
67
|
+
| `/sse` | `sse()` | event streams driven from the test | events sent | end, cut | — |
|
|
68
|
+
| `/websocket` | `websocket()` | a fake server, or a proxy in front of the real one | both directions | drop, close | — |
|
|
69
|
+
| `/webrtc` | `webrtc()` | inject messages as the peer | every data channel message | suppress either direction | — |
|
|
70
|
+
|
|
71
|
+
The `connect` plugin also builds typed clients for the real backend
|
|
72
|
+
(`stage.connect.client(Service)`, cookies included) and serves stubs on a port
|
|
73
|
+
of their own for clients outside the browser — native gRPC over HTTP/2
|
|
74
|
+
included (`stage.connect.serve(...)`).
|
|
75
|
+
|
|
76
|
+
A protocol the library does not ship is a plugin you write against the same
|
|
77
|
+
contract the built-in ones use: [docs/plugins.md](docs/plugins.md).
|
|
78
|
+
|
|
79
|
+
## The timeline
|
|
80
|
+
|
|
81
|
+
Every plugin writes `Frame`s to the stage's timeline: protocol, direction
|
|
82
|
+
(`out` left the page, `in` reached it), endpoint, payload, who produced it,
|
|
83
|
+
and an id that ties the frames of one exchange together. Reads bring the
|
|
84
|
+
timeline up to date first: they flush what the pages have buffered.
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
import type { Stage } from "@heojeongbo/wirestage";
|
|
88
|
+
|
|
89
|
+
export async function lastCommand(stage: Stage) {
|
|
90
|
+
const frames = await stage.drain({ protocol: "webrtc", direction: "out" });
|
|
91
|
+
return frames.at(-1)?.payload.bytes();
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
`frames`, `drain`, `mark`, `since`, `between`, `waitFor` and `report` are
|
|
96
|
+
described in [docs/timeline.md](docs/timeline.md).
|
|
97
|
+
|
|
98
|
+
## Without the fixture
|
|
99
|
+
|
|
100
|
+
Contexts made with `browser.newContext()` attach the same way:
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
import type { Browser } from "@playwright/test";
|
|
104
|
+
import { createStage } from "@heojeongbo/wirestage";
|
|
105
|
+
import { webrtc } from "@heojeongbo/wirestage/webrtc";
|
|
106
|
+
|
|
107
|
+
export async function openSession(browser: Browser) {
|
|
108
|
+
const context = await browser.newContext({ baseURL: "http://localhost:3000" });
|
|
109
|
+
const stage = createStage({ plugins: [webrtc()] });
|
|
110
|
+
// Before the first navigation, so the page hooks are in place.
|
|
111
|
+
await stage.attach(context, { baseURL: "http://localhost:3000" });
|
|
112
|
+
return { context, stage, page: await context.newPage() };
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Documentation
|
|
117
|
+
|
|
118
|
+
- [Getting started](docs/getting-started.md)
|
|
119
|
+
- [The timeline](docs/timeline.md)
|
|
120
|
+
- Protocols: [Connect / gRPC-web / gRPC](docs/protocols/connect.md),
|
|
121
|
+
[REST](docs/protocols/rest.md), [SSE](docs/protocols/sse.md),
|
|
122
|
+
[WebSocket](docs/protocols/websocket.md), [WebRTC](docs/protocols/webrtc.md)
|
|
123
|
+
- [Writing a protocol plugin](docs/plugins.md)
|
|
124
|
+
- [Architecture](docs/architecture.md) and [design patterns](docs/design-patterns.md)
|
|
125
|
+
- [Testing](docs/testing.md), [performance](docs/performance.md),
|
|
126
|
+
[logging](docs/logging.md), [troubleshooting](docs/troubleshooting.md)
|
|
127
|
+
|
|
128
|
+
## Compatibility
|
|
129
|
+
|
|
130
|
+
- **Node 22.12 or later.** The package is ES modules. A CommonJS project loads
|
|
131
|
+
it with `require()`, which Node supports from that version; that is how
|
|
132
|
+
Playwright runs the tests of a project without `"type": "module"`.
|
|
133
|
+
- **Playwright 1.50 or later** — the one required peer. The suite runs
|
|
134
|
+
against 1.60 in Chromium.
|
|
135
|
+
- **TypeScript 5.0 or later**, with `moduleResolution` set to `node16`,
|
|
136
|
+
`nodenext` or `bundler` (the entry points are published through `exports`),
|
|
137
|
+
and `@types/node`, as in any Playwright project.
|
|
138
|
+
- Live streams (server streams, SSE) redirect the page's request to a local
|
|
139
|
+
server; see [troubleshooting](docs/troubleshooting.md) for https pages.
|
|
140
|
+
|
|
141
|
+
## Developing
|
|
142
|
+
|
|
143
|
+
Everything runs in the devcontainer, which is the Playwright image for the
|
|
144
|
+
pinned version: `pnpm check` and `pnpm check:browser`
|
|
145
|
+
([docs/testing.md](docs/testing.md)). Its `node_modules` is a volume, so the
|
|
146
|
+
host has none: run `pnpm install` on the host as well if you want editor
|
|
147
|
+
type-checking and the git hooks there.
|
|
148
|
+
|
|
149
|
+
## License
|
|
150
|
+
|
|
151
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/app/playwright/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACX,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,GACb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app/playwright/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { TestType } from "@playwright/test";
|
|
2
|
+
import type { AnyWirePlugin } from "../../../entities/plugin/index.js";
|
|
3
|
+
import type { ContextPort } from "../../../shared/api/playwright/index.js";
|
|
4
|
+
import { type LogThreshold } from "../../../shared/lib/logger/index.js";
|
|
5
|
+
import { type Stage, type StageOptions } from "../../../widgets/stage/index.js";
|
|
6
|
+
/** When the timeline is attached to the test report. */
|
|
7
|
+
export type ReportMode = "on-failure" | "always" | "never";
|
|
8
|
+
export interface StageFixtureOptions<Plugins extends readonly AnyWirePlugin[]> extends Omit<StageOptions<Plugins>, "baseURL" | "clock"> {
|
|
9
|
+
/**
|
|
10
|
+
* Default `on-failure`. `WIRESTAGE_REPORT` overrides it. An empty timeline
|
|
11
|
+
* is never attached.
|
|
12
|
+
*/
|
|
13
|
+
readonly report?: ReportMode;
|
|
14
|
+
/**
|
|
15
|
+
* Frames a report holds, counting back from the newest. Default 1,000: a
|
|
16
|
+
* report is read from its end, and one that grows with the test would
|
|
17
|
+
* attach tens of megabytes to a long run.
|
|
18
|
+
*/
|
|
19
|
+
readonly reportLimit?: number;
|
|
20
|
+
/** Default `warn`. `WIRESTAGE_LOG` overrides it. */
|
|
21
|
+
readonly log?: LogThreshold;
|
|
22
|
+
/**
|
|
23
|
+
* Attach the test's `context` before the body runs. Default true. Turn it
|
|
24
|
+
* off when tests open their own contexts (`browser.newContext()`, two users
|
|
25
|
+
* at once): the fixture then never asks Playwright for `context`, so no
|
|
26
|
+
* unused one is created, and the test attaches what it opens.
|
|
27
|
+
*/
|
|
28
|
+
readonly attach?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface StageFixtureArgs {
|
|
31
|
+
/** Absent when the fixture does not attach (`attach: false`). */
|
|
32
|
+
readonly context?: ContextPort;
|
|
33
|
+
readonly baseURL: string | undefined;
|
|
34
|
+
}
|
|
35
|
+
/** The part of Playwright's TestInfo the fixture uses. */
|
|
36
|
+
export interface StageTestInfo {
|
|
37
|
+
readonly status?: string;
|
|
38
|
+
readonly expectedStatus: string;
|
|
39
|
+
attach(name: string, options: {
|
|
40
|
+
readonly body: string;
|
|
41
|
+
readonly contentType: string;
|
|
42
|
+
}): Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
type Environment = Readonly<Record<string, string | undefined>>;
|
|
45
|
+
/**
|
|
46
|
+
* The `stage` fixture as a plain function, so it can be tested without the
|
|
47
|
+
* Playwright runner: one stage per test, attached to the test's context
|
|
48
|
+
* before the test body runs, reported on failure, disposed afterwards.
|
|
49
|
+
*/
|
|
50
|
+
export declare function createStageFixture<const Plugins extends readonly AnyWirePlugin[]>(options: StageFixtureOptions<Plugins>, env?: Environment): (args: StageFixtureArgs, use: (stage: Stage<Plugins>) => Promise<void>, testInfo: StageTestInfo) => Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Extend a Playwright `test` with a `stage` fixture:
|
|
53
|
+
*
|
|
54
|
+
* export const test = withStage(base, { plugins: [webrtc(), connect()] });
|
|
55
|
+
* test("...", async ({ page, stage }) => { ... });
|
|
56
|
+
*/
|
|
57
|
+
export declare function withStage<Args extends object, Workers extends object, const Plugins extends readonly AnyWirePlugin[]>(test: TestType<Args, Workers>, options: StageFixtureOptions<Plugins>): TestType<Args & {
|
|
58
|
+
stage: Stage<Plugins>;
|
|
59
|
+
}, Workers>;
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=fixture.d.ts.map
|
|
@@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OAAO,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;KAAE,GAC9D,OAAO,CAAC,IAAI,CAAC,CAAC;CACjB;AAED,KAAK,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;AAqChE;;;;GAIG;AACH,wBAAgB,kBAAkB,CACjC,KAAK,CAAC,OAAO,SAAS,SAAS,aAAa,EAAE,EAE9C,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC,EACrC,GAAG,GAAE,WAAyB,GAC5B,CACF,IAAI,EAAE,gBAAgB,EACtB,GAAG,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,EAC7C,QAAQ,EAAE,aAAa,KACnB,OAAO,CAAC,IAAI,CAAC,CAiEjB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CACxB,IAAI,SAAS,MAAM,EACnB,OAAO,SAAS,MAAM,EACtB,KAAK,CAAC,OAAO,SAAS,SAAS,aAAa,EAAE,EAE9C,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC,GACnC,QAAQ,CAAC,IAAI,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;CAAE,EAAE,OAAO,CAAC,CAUrD"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { createScopedLogger, parseLogThreshold, setLogThreshold, } from "../../../shared/lib/logger/index.js";
|
|
2
|
+
import { createStage, } from "../../../widgets/stage/index.js";
|
|
3
|
+
const REPORT_MODES = ["on-failure", "always", "never"];
|
|
4
|
+
/**
|
|
5
|
+
* The environment's say, read once when the fixture is made. A value it
|
|
6
|
+
* cannot use is ignored with one warning: a typo in CI config must neither
|
|
7
|
+
* turn reports off silently nor fail every test, and saying so once is
|
|
8
|
+
* enough.
|
|
9
|
+
*/
|
|
10
|
+
function readEnvironment(env) {
|
|
11
|
+
const warn = (name, value, allowed) => createScopedLogger("Fixture").warn(`ignoring an unknown ${name}`, {
|
|
12
|
+
value,
|
|
13
|
+
allowed,
|
|
14
|
+
});
|
|
15
|
+
const wantedReport = env["WIRESTAGE_REPORT"]?.trim().toLowerCase();
|
|
16
|
+
const report = REPORT_MODES.find((mode) => mode === wantedReport);
|
|
17
|
+
if (wantedReport !== undefined && report === undefined)
|
|
18
|
+
warn("WIRESTAGE_REPORT", wantedReport, REPORT_MODES);
|
|
19
|
+
const wantedLog = env["WIRESTAGE_LOG"];
|
|
20
|
+
const log = parseLogThreshold(wantedLog);
|
|
21
|
+
if (wantedLog !== undefined && log === undefined)
|
|
22
|
+
warn("WIRESTAGE_LOG", wantedLog, [
|
|
23
|
+
"debug",
|
|
24
|
+
"log",
|
|
25
|
+
"info",
|
|
26
|
+
"warn",
|
|
27
|
+
"error",
|
|
28
|
+
"silent",
|
|
29
|
+
]);
|
|
30
|
+
return { report, log };
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The `stage` fixture as a plain function, so it can be tested without the
|
|
34
|
+
* Playwright runner: one stage per test, attached to the test's context
|
|
35
|
+
* before the test body runs, reported on failure, disposed afterwards.
|
|
36
|
+
*/
|
|
37
|
+
export function createStageFixture(options, env = process.env) {
|
|
38
|
+
const { report, reportLimit, log, attach = true, ...stageOptions } = options;
|
|
39
|
+
const fromEnv = readEnvironment(env);
|
|
40
|
+
const threshold = fromEnv.log ?? log;
|
|
41
|
+
if (threshold !== undefined)
|
|
42
|
+
setLogThreshold(threshold);
|
|
43
|
+
const mode = fromEnv.report ?? report ?? "on-failure";
|
|
44
|
+
const fixtureLog = createScopedLogger("Fixture");
|
|
45
|
+
/** Attach the timeline to the test's report, when there is one to read. */
|
|
46
|
+
const attachReport = async (stage, testInfo) => {
|
|
47
|
+
const failed = testInfo.status !== testInfo.expectedStatus;
|
|
48
|
+
if (mode === "never" || (mode === "on-failure" && !failed))
|
|
49
|
+
return;
|
|
50
|
+
// What the pages still hold is often the frame the failure is about.
|
|
51
|
+
await stage.sync();
|
|
52
|
+
// Nothing on the timeline is nothing to read: no empty attachment.
|
|
53
|
+
if (stage.timeline.size === 0 && stage.timeline.evicted === 0)
|
|
54
|
+
return;
|
|
55
|
+
const { snapshot, text } = stage.report(undefined, reportLimit === undefined ? {} : { limit: reportLimit });
|
|
56
|
+
await testInfo.attach("wirestage-timeline.txt", {
|
|
57
|
+
body: text,
|
|
58
|
+
contentType: "text/plain",
|
|
59
|
+
});
|
|
60
|
+
await testInfo.attach("wirestage-timeline.json", {
|
|
61
|
+
body: JSON.stringify(snapshot, null, 2),
|
|
62
|
+
contentType: "application/json",
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
const run = async (context, baseURL, use, testInfo) => {
|
|
66
|
+
const stage = createStage({
|
|
67
|
+
...stageOptions,
|
|
68
|
+
...(baseURL === undefined ? {} : { baseURL }),
|
|
69
|
+
});
|
|
70
|
+
try {
|
|
71
|
+
if (context !== undefined)
|
|
72
|
+
await stage.attach(context);
|
|
73
|
+
await use(stage);
|
|
74
|
+
}
|
|
75
|
+
finally {
|
|
76
|
+
try {
|
|
77
|
+
await attachReport(stage, testInfo);
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
// The report is a courtesy; failing to write one must not hide
|
|
81
|
+
// the test's own result, nor keep the stage from being disposed.
|
|
82
|
+
fixtureLog.warn("could not attach the timeline", {}, error);
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
await stage.dispose();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
// Playwright reads a fixture's dependencies off its SOURCE, so each mode
|
|
90
|
+
// is its own literal: naming `context` is what makes Playwright create one.
|
|
91
|
+
return attach
|
|
92
|
+
? async ({ context, baseURL }, use, testInfo) => run(context, baseURL, use, testInfo)
|
|
93
|
+
: async ({ baseURL }, use, testInfo) => run(undefined, baseURL, use, testInfo);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Extend a Playwright `test` with a `stage` fixture:
|
|
97
|
+
*
|
|
98
|
+
* export const test = withStage(base, { plugins: [webrtc(), connect()] });
|
|
99
|
+
* test("...", async ({ page, stage }) => { ... });
|
|
100
|
+
*/
|
|
101
|
+
export function withStage(test, options) {
|
|
102
|
+
// Playwright reads a fixture's dependencies off the SOURCE of its first
|
|
103
|
+
// parameter, so the fixture must be passed as written — with its
|
|
104
|
+
// `({ context, baseURL }, use, testInfo)` destructuring — not wrapped. The
|
|
105
|
+
// cast is only for the generic `extend` signature, which TypeScript cannot
|
|
106
|
+
// resolve against an arbitrary `Args`.
|
|
107
|
+
const extend = test.extend.bind(test);
|
|
108
|
+
return extend({ stage: createStageFixture(options) });
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=fixture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture.js","sourceRoot":"","sources":["../../../../src/app/playwright/lib/fixture.ts"],"names":[],"mappings":"AAIA,OAAO,EACN,kBAAkB,EAElB,iBAAiB,EACjB,eAAe,GACf,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACN,WAAW,GAGX,MAAM,iCAAiC,CAAC;AA+CzC,MAAM,YAAY,GAA0B,CAAC,YAAY,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AAE9E;;;;;GAKG;AACH,SAAS,eAAe,CAAC,GAAgB;IAIxC,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,OAA0B,EAAE,EAAE,CACxE,kBAAkB,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,uBAAuB,IAAI,EAAE,EAAE;QACjE,KAAK;QACL,OAAO;KACP,CAAC,CAAC;IACJ,MAAM,YAAY,GAAG,GAAG,CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,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@
|
|
|
1
|
+
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The frame types the plugin contract is written in terms of.
|
|
3
|
+
*
|
|
4
|
+
* FSD's cross-import notation: `entities/plugin` may import this file and
|
|
5
|
+
* nothing else from `entities/frame`. It keeps the dependency between the two
|
|
6
|
+
* entities explicit and one-way — the frame model knows nothing of plugins.
|
|
7
|
+
*/
|
|
8
|
+
export type { Frame, FrameFilter, Timeline } from "../model/frame.js";
|
|
9
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/entities/frame/@x/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/entities/frame/@x/plugin.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { compileFilter } from "./lib/filter.js";
|
|
2
|
+
export { createPayload } from "./lib/payload.js";
|
|
3
|
+
export type { TimelineOptions } from "./lib/timeline.js";
|
|
4
|
+
export { createTimeline } from "./lib/timeline.js";
|
|
5
|
+
export type { Direction, Frame, FrameFilter, FrameInit, FrameKind, FrameSource, Payload, PayloadInput, SnapshotFrame, SnapshotOptions, Timeline, TimelineCursor, TimelineSnapshot, } from "./model/frame.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entities/frame/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EACX,SAAS,EACT,KAAK,EACL,WAAW,EACX,SAAS,EACT,SAAS,EACT,WAAW,EACX,OAAO,EACP,YAAY,EACZ,aAAa,EACb,eAAe,EACf,QAAQ,EACR,cAAc,EACd,gBAAgB,GAChB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/frame/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Frame, FrameFilter } from "../model/frame.js";
|
|
2
|
+
/**
|
|
3
|
+
* Compile a filter into one predicate. Queries run over every frame of a long
|
|
4
|
+
* test, often in a polling loop, so the per-frame work is a handful of
|
|
5
|
+
* comparisons and the `where` callback runs only after the cheap fields pass.
|
|
6
|
+
*/
|
|
7
|
+
export declare function compileFilter(filter: FrameFilter | undefined): (frame: Frame) => boolean;
|
|
8
|
+
//# sourceMappingURL=filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../../src/entities/frame/lib/filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAI5D;;;;GAIG;AACH,wBAAgB,aAAa,CAC5B,MAAM,EAAE,WAAW,GAAG,SAAS,GAC7B,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CA8C3B"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
const ALWAYS = () => true;
|
|
2
|
+
/**
|
|
3
|
+
* Compile a filter into one predicate. Queries run over every frame of a long
|
|
4
|
+
* test, often in a polling loop, so the per-frame work is a handful of
|
|
5
|
+
* comparisons and the `where` callback runs only after the cheap fields pass.
|
|
6
|
+
*/
|
|
7
|
+
export function compileFilter(filter) {
|
|
8
|
+
if (filter === undefined)
|
|
9
|
+
return ALWAYS;
|
|
10
|
+
const checks = [];
|
|
11
|
+
const { protocol, kind, endpoint, where } = filter;
|
|
12
|
+
if (protocol !== undefined) {
|
|
13
|
+
if (typeof protocol === "string")
|
|
14
|
+
checks.push((f) => f.protocol === protocol);
|
|
15
|
+
else {
|
|
16
|
+
const set = new Set(protocol);
|
|
17
|
+
checks.push((f) => set.has(f.protocol));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (kind !== undefined) {
|
|
21
|
+
if (typeof kind === "string")
|
|
22
|
+
checks.push((f) => f.kind === kind);
|
|
23
|
+
else {
|
|
24
|
+
const set = new Set(kind);
|
|
25
|
+
checks.push((f) => set.has(f.kind));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
for (const key of [
|
|
29
|
+
"direction",
|
|
30
|
+
"source",
|
|
31
|
+
"page",
|
|
32
|
+
"context",
|
|
33
|
+
"correlation",
|
|
34
|
+
]) {
|
|
35
|
+
const expected = filter[key];
|
|
36
|
+
if (expected !== undefined)
|
|
37
|
+
checks.push((f) => f[key] === expected);
|
|
38
|
+
}
|
|
39
|
+
if (endpoint !== undefined) {
|
|
40
|
+
if (typeof endpoint === "string")
|
|
41
|
+
checks.push((f) => f.endpoint === endpoint);
|
|
42
|
+
else
|
|
43
|
+
checks.push((f) => {
|
|
44
|
+
endpoint.lastIndex = 0;
|
|
45
|
+
return endpoint.test(f.endpoint);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const after = filter.after;
|
|
49
|
+
if (after !== undefined)
|
|
50
|
+
checks.push((f) => f.seq > after);
|
|
51
|
+
if (where !== undefined)
|
|
52
|
+
checks.push(where);
|
|
53
|
+
if (checks.length === 0)
|
|
54
|
+
return ALWAYS;
|
|
55
|
+
return (frame) => {
|
|
56
|
+
for (const check of checks)
|
|
57
|
+
if (!check(frame))
|
|
58
|
+
return false;
|
|
59
|
+
return true;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter.js","sourceRoot":"","sources":["../../../../src/entities/frame/lib/filter.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;AAE1B;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC5B,MAA+B;IAE/B,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACxC,MAAM,MAAM,GAAkC,EAAE,CAAC;IACjD,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IACnD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC5B,IAAI,OAAO,QAAQ,KAAK,QAAQ;YAC/B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;aACxC,CAAC;YACL,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC9B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;QACzC,CAAC;IACF,CAAC;IACD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACxB,IAAI,OAAO,IAAI,KAAK,QAAQ;YAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,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AAC,CAAC;IAC5C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC;IACvC,OAAO,CAAC,KAAK,EAAE,EAAE;QAChB,KAAK,MAAM,KAAK,IAAI,MAAM;YAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;gBAAE,OAAO,KAAK,CAAC;QAC5D,OAAO,IAAI,CAAC;IACb,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Payload, PayloadInput } from "../model/frame.js";
|
|
2
|
+
/**
|
|
3
|
+
* A payload that converts lazily and remembers every conversion. Frames are
|
|
4
|
+
* written far more often than read, so nothing is encoded or decoded until a
|
|
5
|
+
* test asks, and asking twice costs once.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createPayload(input: PayloadInput | undefined): Payload;
|
|
8
|
+
//# sourceMappingURL=payload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../../src/entities/frame/lib/payload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAI/D;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,GAAG,OAAO,CA+BtE"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { toBytes, utf8 } from "../../../shared/lib/bytes/index.js";
|
|
2
|
+
const EMPTY = new Uint8Array(0);
|
|
3
|
+
/**
|
|
4
|
+
* A payload that converts lazily and remembers every conversion. Frames are
|
|
5
|
+
* written far more often than read, so nothing is encoded or decoded until a
|
|
6
|
+
* test asks, and asking twice costs once.
|
|
7
|
+
*/
|
|
8
|
+
export function createPayload(input) {
|
|
9
|
+
let bytes = input instanceof Uint8Array ? input : undefined;
|
|
10
|
+
let text = typeof input === "string" ? input : undefined;
|
|
11
|
+
let decoded;
|
|
12
|
+
const getBytes = () => {
|
|
13
|
+
if (bytes !== undefined)
|
|
14
|
+
return bytes;
|
|
15
|
+
if (typeof input === "function")
|
|
16
|
+
bytes = input();
|
|
17
|
+
else if (text !== undefined)
|
|
18
|
+
bytes = toBytes(text);
|
|
19
|
+
else
|
|
20
|
+
bytes = EMPTY;
|
|
21
|
+
return bytes;
|
|
22
|
+
};
|
|
23
|
+
const getText = () => {
|
|
24
|
+
text ??= utf8(getBytes());
|
|
25
|
+
return text;
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
empty: input === undefined,
|
|
29
|
+
bytes: getBytes,
|
|
30
|
+
text: getText,
|
|
31
|
+
json: () => JSON.parse(getText()),
|
|
32
|
+
decode(decoder) {
|
|
33
|
+
decoded ??= new WeakMap();
|
|
34
|
+
if (decoded.has(decoder))
|
|
35
|
+
return decoded.get(decoder);
|
|
36
|
+
const value = decoder(getBytes());
|
|
37
|
+
decoded.set(decoder, value);
|
|
38
|
+
return value;
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=payload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../../src/entities/frame/lib/payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAGnE,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;AAEhC;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,KAA+B;IAC5D,IAAI,KAAK,GACR,KAAK,YAAY,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IACjD,IAAI,IAAI,GAAuB,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7E,IAAI,OAAqE,CAAC;IAE1E,MAAM,QAAQ,GAAG,GAAe,EAAE;QACjC,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC;QACtC,IAAI,OAAO,KAAK,KAAK,UAAU;YAAE,KAAK,GAAG,KAAK,EAAE,CAAC;aAC5C,IAAI,IAAI,KAAK,SAAS;YAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;;YAC9C,KAAK,GAAG,KAAK,CAAC;QACnB,OAAO,KAAK,CAAC;IACd,CAAC,CAAC;IACF,MAAM,OAAO,GAAG,GAAW,EAAE;QAC5B,IAAI,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACb,CAAC,CAAC;IAEF,OAAO;QACN,KAAK,EAAE,KAAK,KAAK,SAAS;QAC1B,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,GAAM,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAM;QACzC,MAAM,CAAI,OAAiC;YAC1C,OAAO,KAAK,IAAI,OAAO,EAAE,CAAC;YAC1B,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;gBAAE,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,CAAM,CAAC;YAC3D,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;YAClC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC5B,OAAO,KAAK,CAAC;QACd,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Frame, SnapshotOptions, TimelineSnapshot } from "../model/frame.js";
|
|
2
|
+
/**
|
|
3
|
+
* A JSON-safe copy of `frames`, with payloads cut at `maxBytes` and, given a
|
|
4
|
+
* `limit`, only the newest frames kept: a report is read from its end.
|
|
5
|
+
*/
|
|
6
|
+
export declare function snapshotFrames(frames: readonly Frame[], evicted: number, options?: SnapshotOptions): TimelineSnapshot;
|
|
7
|
+
/**
|
|
8
|
+
* One line per frame: `#12 +3.2ms connect out request pkg.Svc/Method 42B`.
|
|
9
|
+
* Times are relative to the first frame listed, which is what a reader of a
|
|
10
|
+
* failure report compares.
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatFrames(frames: readonly Frame[], options?: {
|
|
13
|
+
readonly limit?: number;
|
|
14
|
+
}): string;
|
|
15
|
+
//# sourceMappingURL=snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../../../src/entities/frame/lib/snapshot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,KAAK,EAEL,eAAe,EACf,gBAAgB,EAChB,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,wBAAgB,cAAc,CAC7B,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,eAAoB,GAC3B,gBAAgB,CAqClB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC3B,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,OAAO,GAAE;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GACvC,MAAM,CAgBR"}
|