@intuned/runtime-dev 1.1.4-bot-detection → 1.1.4

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.
@@ -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 "patchright";
3
+ import * as playwright from "playwright-core";
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("patchright"));
29
+ var playwright = _interopRequireWildcard(require("playwright-core"));
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 "patchright";
1
+ import { BrowserContext } from "playwright-core";
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("patchright"));
12
+ var playwright = _interopRequireWildcard(require("playwright-core"));
13
13
  var fs = _interopRequireWildcard(require("fs-extra"));
14
14
  var _fileUtils = require("./utils/fileUtils");
15
15
  var _contextStorageStateHelpers = require("../../common/contextStorageStateHelpers");
@@ -27,7 +27,7 @@ const userCLIScripts = exports.userCLIScripts = {
27
27
  };
28
28
  const tsConfigCli = exports.tsConfigCli = {
29
29
  compilerOptions: {
30
- moduleResolution: "node",
30
+ moduleResolution: "bundler",
31
31
  target: "ES2021",
32
32
  outDir: "./dist",
33
33
  sourceMap: false,
@@ -1,4 +1,4 @@
1
- import * as playwright from "patchright";
1
+ import * as playwright from "playwright";
2
2
  interface StorageEntry {
3
3
  name: string;
4
4
  value: string;
@@ -1,4 +1,4 @@
1
- import * as playwright from "patchright";
1
+ import * as playwright from "playwright-core";
2
2
  import type { RunApiSession } from "./runApi";
3
3
  interface Proxy {
4
4
  server: string;
@@ -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("patchright"));
10
+ var playwright = _interopRequireWildcard(require("playwright-core"));
11
11
  var _fsExtra = _interopRequireWildcard(require("fs-extra"));
12
12
  var fs = _fsExtra;
13
13
  var _contextStorageStateHelpers = require("./contextStorageStateHelpers");
@@ -76,6 +76,9 @@ 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
+ });
79
82
  let page = context.pages().at(0);
80
83
  if (page) {
81
84
  const scriptString = await (0, _fsExtra.readFile)(assetsFile, "utf8");
@@ -101,6 +104,9 @@ async function getPlaywrightConstructsForMode(mode, cdpAddress, authSession) {
101
104
  throw new Error("no context found");
102
105
  }
103
106
  const assetsFile = _path.default.join(__dirname, "./assets/browser_scripts.js");
107
+ await context.addInitScript({
108
+ path: assetsFile
109
+ });
104
110
  const pages = await context.pages();
105
111
  let page = null;
106
112
  if (pages.length > 0) {
@@ -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("patchright"));
8
+ var playwright = _interopRequireWildcard(require("playwright-core"));
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 "patchright";
3
+ import { Page, BrowserContext } from "playwright-core";
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.4-bot-detection",
3
+ "version": "1.1.4",
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
- "patchright": "1.48.2",
86
+ "playwright": "1.44.1",
87
87
  "playwright-extra": "4.3.6",
88
88
  "prettier": "2.8.0",
89
89
  "promptly": "3.2.0",
@@ -1,14 +1,11 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "module": "ESNext",
4
3
  "target": "ES2021",
5
- "lib": [
6
- "dom",
7
- "es2021"
8
- ],
4
+ "lib": ["dom", "es2021"],
9
5
  "resolveJsonModule": true,
10
6
  "esModuleInterop": true,
11
- "moduleResolution": "node",
7
+ "moduleResolution": "nodenext",
8
+ "module": "NodeNext",
12
9
  "skipLibCheck": true
13
10
  }
14
- }
11
+ }