A big commit with a bunch of node modules so I could run puppeteer for Walmart. Added some todos and Headway's templates.

This commit is contained in:
Norm Rasmussen
2024-02-28 17:13:10 -05:00
parent dbcdfc8472
commit 1184fe0cd1
1107 changed files with 76526 additions and 8934 deletions

View File

@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CdpConnection = void 0;
exports.MapperCdpConnection = void 0;
const log_js_1 = require("../utils/log.js");
const CdpClient_js_1 = require("./CdpClient.js");
/**
@ -9,7 +9,7 @@ const CdpClient_js_1 = require("./CdpClient.js");
* Manages all CdpClients (each backed by a Session ID) instance for each active
* CDP session.
*/
class CdpConnection {
class MapperCdpConnection {
static LOGGER_PREFIX_RECV = `${log_js_1.LogType.cdp}:RECV ◂`;
static LOGGER_PREFIX_SEND = `${log_js_1.LogType.cdp}:SEND ▸`;
#mainBrowserCdpClient;
@ -69,12 +69,12 @@ class CdpConnection {
this.#logger?.(log_js_1.LogType.debugError, error);
this.#transport.close();
});
this.#logger?.(CdpConnection.LOGGER_PREFIX_SEND, cdpMessage);
this.#logger?.(MapperCdpConnection.LOGGER_PREFIX_SEND, cdpMessage);
});
}
#onMessage = (json) => {
const message = JSON.parse(json);
this.#logger?.(CdpConnection.LOGGER_PREFIX_RECV, message);
this.#logger?.(MapperCdpConnection.LOGGER_PREFIX_RECV, message);
// Update client map if a session is attached
// Listen for these events on every session.
if (message.method === 'Target.attachedToTarget') {
@ -116,10 +116,10 @@ class CdpConnection {
* @private
*/
#createCdpClient(sessionId) {
const cdpClient = new CdpClient_js_1.CdpClient(this, sessionId);
const cdpClient = new CdpClient_js_1.MapperCdpClient(this, sessionId);
this.#sessionCdpClients.set(sessionId, cdpClient);
return cdpClient;
}
}
exports.CdpConnection = CdpConnection;
exports.MapperCdpConnection = MapperCdpConnection;
//# sourceMappingURL=CdpConnection.js.map