@secret-agent/puppet
Advanced tools
Comparing version 1.1.0-alpha.1 to 1.2.0-alpha.0
@@ -1,19 +0,10 @@ | ||
import { IBoundLog } from '@secret-agent/commons/Logger'; | ||
import IBrowserEmulation from './interfaces/IBrowserEmulation'; | ||
import { IBoundLog } from '@secret-agent/core-interfaces/ILog'; | ||
import IBrowserEmulationSettings from '@secret-agent/puppet-interfaces/IBrowserEmulationSettings'; | ||
import IBrowserEngine from '@secret-agent/core-interfaces/IBrowserEngine'; | ||
export default class Puppet { | ||
readonly id: number; | ||
engine: { | ||
browser: string; | ||
revision: string; | ||
}; | ||
readonly engine: IBrowserEngine; | ||
isShuttingDown: boolean; | ||
readonly executablePath: string; | ||
private browser; | ||
constructor(startParams: { | ||
engine: { | ||
browser: string; | ||
revision: string; | ||
}; | ||
engineExecutablePath: string; | ||
}); | ||
constructor(engine: IBrowserEngine); | ||
start(args?: { | ||
@@ -24,4 +15,4 @@ proxyPort?: number; | ||
}): void; | ||
newContext(emulation: IBrowserEmulation, logger: IBoundLog): Promise<import("./interfaces/IPuppetContext").default>; | ||
newContext(emulation: IBrowserEmulationSettings, logger: IBoundLog): Promise<import("@secret-agent/puppet-interfaces/IPuppetContext").default>; | ||
close(): Promise<void>; | ||
} |
@@ -12,5 +12,4 @@ "use strict"; | ||
class Puppet { | ||
constructor(startParams) { | ||
this.engine = startParams.engine; | ||
this.executablePath = startParams.engineExecutablePath; | ||
constructor(engine) { | ||
this.engine = engine; | ||
this.isShuttingDown = false; | ||
@@ -35,3 +34,3 @@ this.id = puppBrowserCounter; | ||
const launchArgs = launcher.getLaunchArgs({ proxyPort, showBrowser }); | ||
const launchedProcess = launchProcess_1.default(this.executablePath, launchArgs, {}, pipeBrowserIo); | ||
const launchedProcess = launchProcess_1.default(this.engine.executablePath, launchArgs, {}, pipeBrowserIo); | ||
this.browser = launcher.createPuppet(launchedProcess, this.engine.revision); | ||
@@ -38,0 +37,0 @@ } |
/// <reference types="node" /> | ||
import ILaunchedProcess from '../interfaces/ILaunchedProcess'; | ||
import ILaunchedProcess from '@secret-agent/puppet-interfaces/ILaunchedProcess'; | ||
export default function launchProcess(executablePath: string, processArguments: string[], env: NodeJS.ProcessEnv, pipeIo?: boolean): ILaunchedProcess; |
/// <reference types="node" /> | ||
/** | ||
* Copyright 2020 Data Liberation Foundation, Inc. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import * as EventUtils from '@secret-agent/commons/eventUtils'; | ||
import { TypedEventEmitter } from '@secret-agent/commons/eventUtils'; | ||
import IConnectionTransport, { IConnectionTransportEvents } from '../interfaces/IConnectionTransport'; | ||
import IRegisteredEventListener from '@secret-agent/core-interfaces/IRegisteredEventListener'; | ||
import IConnectionTransport, { IConnectionTransportEvents } from '@secret-agent/puppet-interfaces/IConnectionTransport'; | ||
export declare class PipeTransport extends TypedEventEmitter<IConnectionTransportEvents> implements IConnectionTransport { | ||
pipeWrite: NodeJS.WritableStream; | ||
pendingMessage: string; | ||
eventListeners: EventUtils.IRegisteredEventListener[]; | ||
eventListeners: IRegisteredEventListener[]; | ||
constructor(pipeWrite: NodeJS.WritableStream, pipeRead: NodeJS.ReadableStream); | ||
@@ -25,0 +10,0 @@ send(message: string): void; |
@@ -29,4 +29,4 @@ "use strict"; | ||
const EventUtils = __importStar(require("@secret-agent/commons/eventUtils")); | ||
const eventUtils_1 = require("@secret-agent/commons/eventUtils"); | ||
const Logger_1 = __importDefault(require("@secret-agent/commons/Logger")); | ||
const eventUtils_1 = require("@secret-agent/commons/eventUtils"); | ||
const { log } = Logger_1.default(module); | ||
@@ -33,0 +33,0 @@ class PipeTransport extends eventUtils_1.TypedEventEmitter { |
{ | ||
"name": "@secret-agent/puppet", | ||
"version": "1.1.0-alpha.1", | ||
"version": "1.2.0-alpha.0", | ||
"description": "Puppet driver", | ||
@@ -25,5 +25,6 @@ "main": "index.js", | ||
"dependencies": { | ||
"@secret-agent/commons": "1.1.0-alpha.1", | ||
"@secret-agent/core-interfaces": "1.1.0-alpha.1", | ||
"@secret-agent/puppet-chrome": "1.1.0-alpha.1", | ||
"@secret-agent/commons": "1.2.0-alpha.0", | ||
"@secret-agent/core-interfaces": "1.2.0-alpha.0", | ||
"@secret-agent/puppet-chrome": "1.2.0-alpha.0", | ||
"@secret-agent/puppet-interfaces": "1.2.0-alpha.0", | ||
"extract-zip": "^2.0.1", | ||
@@ -35,3 +36,3 @@ "https-proxy-agent": "5.0.0", | ||
}, | ||
"gitHead": "ba9dfbd2025f65019d87c72c86a83019beb8c126" | ||
"gitHead": "8a2dfc434f857038c9f7e9214ccd78a353f19204" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
61866
9
23
966
+ Added@secret-agent/commons@1.2.0-alpha.0(transitive)
+ Added@secret-agent/core-interfaces@1.2.0-alpha.0(transitive)
+ Added@secret-agent/puppet-chrome@1.2.0-alpha.0(transitive)
+ Added@secret-agent/puppet-interfaces@1.2.0-alpha.0(transitive)
- Removed@secret-agent/commons@1.1.0-alpha.1(transitive)
- Removed@secret-agent/core-interfaces@1.1.0-alpha.1(transitive)
- Removed@secret-agent/puppet-chrome@1.1.0-alpha.1(transitive)