@intuned/runtime-dev 1.1.6 → 1.1.7-bot-detection
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/dist/commands/cli-auth-sessions/utils.d.ts +1 -1
- package/dist/commands/cli-auth-sessions/utils.js +1 -1
- package/dist/commands/common/browserUtils.d.ts +1 -1
- package/dist/commands/common/browserUtils.js +1 -1
- package/dist/common/cli/constants.js +1 -1
- package/dist/common/contextStorageStateHelpers.d.ts +1 -1
- package/dist/common/getPlaywrightConstructs.d.ts +1 -1
- package/dist/common/getPlaywrightConstructs.js +2 -10
- package/dist/common/runApi/errors.js +1 -1
- package/dist/common/runApi/index.d.ts +1 -1
- package/package.json +2 -2
- package/template.tsconfig.json +7 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StorageState } from "../../common/contextStorageStateHelpers";
|
|
2
2
|
import { AuthSessionMetadata, AuthSessionType } from "../../common/cli/types";
|
|
3
|
-
import * as playwright from "
|
|
3
|
+
import * as playwright from "patchright";
|
|
4
4
|
export declare function isAuthEnabled(): Promise<boolean>;
|
|
5
5
|
export declare function getAuthType(): Promise<AuthSessionType>;
|
|
6
6
|
export declare function ensureRecorderURLs(): Promise<{
|
|
@@ -26,7 +26,7 @@ var _tsNodeImport = require("../common/tsNodeImport");
|
|
|
26
26
|
var _promptly = require("promptly");
|
|
27
27
|
var _utils = require("../../common/cli/utils");
|
|
28
28
|
var _types = require("../../common/cli/types");
|
|
29
|
-
var playwright = _interopRequireWildcard(require("
|
|
29
|
+
var playwright = _interopRequireWildcard(require("patchright"));
|
|
30
30
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
31
31
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
32
32
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BrowserContext } from "
|
|
1
|
+
import { BrowserContext } from "patchright";
|
|
2
2
|
export declare const REMOTE_DEBUGGING_PORT = 9222;
|
|
3
3
|
export declare const getChromiumLaunchArgs: () => string[];
|
|
4
4
|
export declare function startOrRestartBrowser(): Promise<void>;
|
|
@@ -9,7 +9,7 @@ exports.saveSession = saveSession;
|
|
|
9
9
|
exports.saveSessionFromOpenedBrowser = saveSessionFromOpenedBrowser;
|
|
10
10
|
exports.startOrRestartBrowser = startOrRestartBrowser;
|
|
11
11
|
var _child_process = require("child_process");
|
|
12
|
-
var playwright = _interopRequireWildcard(require("
|
|
12
|
+
var playwright = _interopRequireWildcard(require("patchright"));
|
|
13
13
|
var fs = _interopRequireWildcard(require("fs-extra"));
|
|
14
14
|
var _fileUtils = require("./utils/fileUtils");
|
|
15
15
|
var _contextStorageStateHelpers = require("../../common/contextStorageStateHelpers");
|
|
@@ -7,7 +7,7 @@ exports.getPlaywrightConstructsForMode = getPlaywrightConstructsForMode;
|
|
|
7
7
|
exports.getProductionPlaywrightConstructs = getProductionPlaywrightConstructs;
|
|
8
8
|
exports.getRemotePlaywrightContext = getRemotePlaywrightContext;
|
|
9
9
|
exports.loadSessionToContext = loadSessionToContext;
|
|
10
|
-
var playwright = _interopRequireWildcard(require("
|
|
10
|
+
var playwright = _interopRequireWildcard(require("patchright"));
|
|
11
11
|
var _fsExtra = _interopRequireWildcard(require("fs-extra"));
|
|
12
12
|
var fs = _fsExtra;
|
|
13
13
|
var _contextStorageStateHelpers = require("./contextStorageStateHelpers");
|
|
@@ -76,9 +76,6 @@ async function getProductionPlaywrightConstructs({
|
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
const assetsFile = _path.default.join(__dirname, "./assets/browser_scripts.js");
|
|
79
|
-
await context.addInitScript({
|
|
80
|
-
path: assetsFile
|
|
81
|
-
});
|
|
82
79
|
let page = context.pages().at(0);
|
|
83
80
|
if (page) {
|
|
84
81
|
const scriptString = await (0, _fsExtra.readFile)(assetsFile, "utf8");
|
|
@@ -104,15 +101,10 @@ async function getPlaywrightConstructsForMode(mode, cdpAddress, authSession) {
|
|
|
104
101
|
throw new Error("no context found");
|
|
105
102
|
}
|
|
106
103
|
const assetsFile = _path.default.join(__dirname, "./assets/browser_scripts.js");
|
|
107
|
-
await context.addInitScript({
|
|
108
|
-
path: assetsFile
|
|
109
|
-
});
|
|
110
104
|
const pages = await context.pages();
|
|
111
105
|
let page = null;
|
|
112
106
|
if (pages.length > 0) {
|
|
113
107
|
page = pages[0];
|
|
114
|
-
const scriptString = await fs.readFile(assetsFile, "utf8");
|
|
115
|
-
await page.evaluate(scriptString);
|
|
116
108
|
} else {
|
|
117
109
|
page = await context.newPage();
|
|
118
110
|
}
|
|
@@ -163,7 +155,7 @@ async function loadSessionToContext({
|
|
|
163
155
|
await (0, _contextStorageStateHelpers.setStorageState)(context, sessionToLoad);
|
|
164
156
|
}
|
|
165
157
|
async function getRemotePlaywrightContext(cdpAddress) {
|
|
166
|
-
const playwright = await Promise.resolve().then(() => _interopRequireWildcard(require("
|
|
158
|
+
const playwright = await Promise.resolve().then(() => _interopRequireWildcard(require("patchright")));
|
|
167
159
|
let browser = null;
|
|
168
160
|
if (!cdpAddress) {
|
|
169
161
|
throw new Error("cdpAddress is required");
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.runAutomationErrorCodes = exports.maxLevelsExceededErrorCode = exports.invalidCheckErrorCode = exports.invalidApiErrorCode = exports.internalInvalidInputErrorCode = exports.automationError = exports.authRequiredErrorCode = exports.authCheckNotFoundErrorCode = exports.authCheckFailedErrorCode = exports.apiNotFoundErrorCode = exports.abortedErrorCode = exports.RunAutomationError = exports.MaxLevelsExceededError = exports.InvalidCheckError = exports.InvalidApiError = exports.InternalInvalidInputError = exports.AutomationError = exports.AuthRequiredError = exports.AuthCheckNotFoundError = exports.AuthCheckFailedError = exports.ApiNotFoundError = exports.AbortedError = void 0;
|
|
7
7
|
var _runtime = require("../../runtime");
|
|
8
|
-
var playwright = _interopRequireWildcard(require("
|
|
8
|
+
var playwright = _interopRequireWildcard(require("patchright"));
|
|
9
9
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
10
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
11
|
const apiNotFoundErrorCode = exports.apiNotFoundErrorCode = "APINotFoundError";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Result } from "neverthrow";
|
|
2
2
|
import { RunAutomationError } from "./errors";
|
|
3
|
-
import { Page, BrowserContext } from "
|
|
3
|
+
import { Page, BrowserContext } from "patchright";
|
|
4
4
|
import { ExtendedRunApiParameters, RunApiResult, RunApiResultWithSessionOk } from "./types";
|
|
5
5
|
export * from "./types";
|
|
6
6
|
export * from "./errors";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intuned/runtime-dev",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7-bot-detection",
|
|
4
4
|
"description": "Intuned runtime",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"minimatch": "10.0.1",
|
|
84
84
|
"nanoid": "3",
|
|
85
85
|
"neverthrow": "6.1.0",
|
|
86
|
-
"
|
|
86
|
+
"patchright": "1.48.2",
|
|
87
87
|
"playwright-extra": "4.3.6",
|
|
88
88
|
"prettier": "2.8.0",
|
|
89
89
|
"promptly": "3.2.0",
|
package/template.tsconfig.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
+
"module": "ESNext",
|
|
3
4
|
"target": "ES2021",
|
|
4
|
-
"lib": [
|
|
5
|
+
"lib": [
|
|
6
|
+
"dom",
|
|
7
|
+
"es2021"
|
|
8
|
+
],
|
|
5
9
|
"resolveJsonModule": true,
|
|
6
10
|
"esModuleInterop": true,
|
|
7
|
-
"moduleResolution": "
|
|
8
|
-
"module": "esnext",
|
|
11
|
+
"moduleResolution": "node",
|
|
9
12
|
"skipLibCheck": true
|
|
10
13
|
}
|
|
11
|
-
}
|
|
14
|
+
}
|