@applitools/ec-client 1.12.20 → 1.12.22
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/CHANGELOG.md +107 -0
- package/dist/server.js +10 -3
- package/dist/tunnels/loader.js +45 -0
- package/dist/tunnels/manager-client.js +42 -17
- package/dist/tunnels/manager.js +3 -2
- package/package.json +13 -10
- package/types/tunnels/loader.d.ts +10 -0
- package/types/tunnels/manager.d.ts +1 -1
- package/types/types.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,112 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.12.22](https://github.com/Applitools-Dev/sdk/compare/js/ec-client@1.12.21...js/ec-client@1.12.22) (2026-03-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Dependencies
|
|
7
|
+
|
|
8
|
+
* @applitools/snippets bumped to 2.8.0
|
|
9
|
+
#### Features
|
|
10
|
+
|
|
11
|
+
* support coded regions within iframes and shadow DOM | FLD-4019 ([#3542](https://github.com/Applitools-Dev/sdk/issues/3542)) ([7c5639a](https://github.com/Applitools-Dev/sdk/commit/7c5639a8a4c135bc9331d9ff93f1824906549568))
|
|
12
|
+
* @applitools/driver bumped to 1.25.3
|
|
13
|
+
#### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* enhance NML error messages for better user-facing diagnostics | FLD-4279 ([#3622](https://github.com/Applitools-Dev/sdk/issues/3622)) ([2aef039](https://github.com/Applitools-Dev/sdk/commit/2aef0395875fd0ff0b4f657d769bda23d66660ad))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
* @applitools/spec-driver-webdriver bumped to 1.5.8
|
|
20
|
+
|
|
21
|
+
* @applitools/core-base bumped to 1.32.2
|
|
22
|
+
#### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* logEventBatch leaks to console | FLD-4175 ([#3608](https://github.com/Applitools-Dev/sdk/issues/3608)) ([f749d28](https://github.com/Applitools-Dev/sdk/commit/f749d287bf8a8e91ab819c04b13f8246f3d3a244))
|
|
25
|
+
|
|
26
|
+
## [1.12.21](https://github.com/Applitools-Dev/sdk/compare/js/ec-client@1.12.20...js/ec-client@1.12.21) (2026-03-08)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* audit fix for fastify node >=20 ([#3578](https://github.com/Applitools-Dev/sdk/issues/3578)) ([7c7b9b2](https://github.com/Applitools-Dev/sdk/commit/7c7b9b295b68285d585092dd71b99a4e148c6f55))
|
|
32
|
+
* unskip js/mcp ([#3618](https://github.com/Applitools-Dev/sdk/issues/3618)) ([103f9e2](https://github.com/Applitools-Dev/sdk/commit/103f9e2f18cddc225aba2f2f59556e5fa38965c0))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Dependencies
|
|
36
|
+
|
|
37
|
+
* @applitools/utils bumped to 1.14.2
|
|
38
|
+
#### Bug Fixes
|
|
39
|
+
|
|
40
|
+
* unskip js/mcp ([#3618](https://github.com/Applitools-Dev/sdk/issues/3618)) ([103f9e2](https://github.com/Applitools-Dev/sdk/commit/103f9e2f18cddc225aba2f2f59556e5fa38965c0))
|
|
41
|
+
* @applitools/logger bumped to 2.2.9
|
|
42
|
+
#### Bug Fixes
|
|
43
|
+
|
|
44
|
+
* unskip js/mcp ([#3618](https://github.com/Applitools-Dev/sdk/issues/3618)) ([103f9e2](https://github.com/Applitools-Dev/sdk/commit/103f9e2f18cddc225aba2f2f59556e5fa38965c0))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
* @applitools/socket bumped to 1.3.10
|
|
49
|
+
#### Bug Fixes
|
|
50
|
+
|
|
51
|
+
* unskip js/mcp ([#3618](https://github.com/Applitools-Dev/sdk/issues/3618)) ([103f9e2](https://github.com/Applitools-Dev/sdk/commit/103f9e2f18cddc225aba2f2f59556e5fa38965c0))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
* @applitools/req bumped to 1.9.1
|
|
56
|
+
#### Bug Fixes
|
|
57
|
+
|
|
58
|
+
* unskip js/mcp ([#3618](https://github.com/Applitools-Dev/sdk/issues/3618)) ([103f9e2](https://github.com/Applitools-Dev/sdk/commit/103f9e2f18cddc225aba2f2f59556e5fa38965c0))
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
* @applitools/image bumped to 1.2.8
|
|
63
|
+
#### Bug Fixes
|
|
64
|
+
|
|
65
|
+
* unskip js/mcp ([#3618](https://github.com/Applitools-Dev/sdk/issues/3618)) ([103f9e2](https://github.com/Applitools-Dev/sdk/commit/103f9e2f18cddc225aba2f2f59556e5fa38965c0))
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
* @applitools/snippets bumped to 2.7.1
|
|
70
|
+
#### Bug Fixes
|
|
71
|
+
|
|
72
|
+
* unskip js/mcp ([#3618](https://github.com/Applitools-Dev/sdk/issues/3618)) ([103f9e2](https://github.com/Applitools-Dev/sdk/commit/103f9e2f18cddc225aba2f2f59556e5fa38965c0))
|
|
73
|
+
* @applitools/driver bumped to 1.25.2
|
|
74
|
+
#### Bug Fixes
|
|
75
|
+
|
|
76
|
+
* unskip js/mcp ([#3618](https://github.com/Applitools-Dev/sdk/issues/3618)) ([103f9e2](https://github.com/Applitools-Dev/sdk/commit/103f9e2f18cddc225aba2f2f59556e5fa38965c0))
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
* @applitools/spec-driver-webdriver bumped to 1.5.7
|
|
81
|
+
#### Bug Fixes
|
|
82
|
+
|
|
83
|
+
* unskip js/mcp ([#3618](https://github.com/Applitools-Dev/sdk/issues/3618)) ([103f9e2](https://github.com/Applitools-Dev/sdk/commit/103f9e2f18cddc225aba2f2f59556e5fa38965c0))
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
* @applitools/tunnel-client bumped to 1.11.8
|
|
88
|
+
#### Bug Fixes
|
|
89
|
+
|
|
90
|
+
* audit fix for fastify node >=20 ([#3578](https://github.com/Applitools-Dev/sdk/issues/3578)) ([7c7b9b2](https://github.com/Applitools-Dev/sdk/commit/7c7b9b295b68285d585092dd71b99a4e148c6f55))
|
|
91
|
+
* unskip js/mcp ([#3618](https://github.com/Applitools-Dev/sdk/issues/3618)) ([103f9e2](https://github.com/Applitools-Dev/sdk/commit/103f9e2f18cddc225aba2f2f59556e5fa38965c0))
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
* @applitools/core-base bumped to 1.32.1
|
|
96
|
+
#### Bug Fixes
|
|
97
|
+
|
|
98
|
+
* unskip js/mcp ([#3618](https://github.com/Applitools-Dev/sdk/issues/3618)) ([103f9e2](https://github.com/Applitools-Dev/sdk/commit/103f9e2f18cddc225aba2f2f59556e5fa38965c0))
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
* @applitools/test-server bumped to 1.4.1
|
|
103
|
+
#### Bug Fixes
|
|
104
|
+
|
|
105
|
+
* unskip js/mcp ([#3618](https://github.com/Applitools-Dev/sdk/issues/3618)) ([103f9e2](https://github.com/Applitools-Dev/sdk/commit/103f9e2f18cddc225aba2f2f59556e5fa38965c0))
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
3
110
|
## [1.12.20](https://github.com/Applitools-Dev/sdk/compare/js/ec-client@1.12.19...js/ec-client@1.12.20) (2026-03-02)
|
|
4
111
|
|
|
5
112
|
|
package/dist/server.js
CHANGED
|
@@ -54,9 +54,16 @@ async function makeServer({ settings, logger: mainLogger, }) {
|
|
|
54
54
|
useDnsCache: settings.useDnsCache,
|
|
55
55
|
});
|
|
56
56
|
const core = (0, core_base_1.makeCore)({ agentId: `js/ec-client/${require('../package.json').version}` });
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
let tunnels;
|
|
58
|
+
try {
|
|
59
|
+
tunnels = ((_a = settings.tunnel) === null || _a === void 0 ? void 0 : _a.serviceUrl)
|
|
60
|
+
? await (0, manager_1.makeTunnelManager)({ settings: settings.tunnel, logger: serverLogger })
|
|
61
|
+
: await (0, manager_client_1.makeTunnelManagerClient)({ settings: settings.tunnel, logger: serverLogger });
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
serverLogger.warn('Tunnel manager could not be initialized. Tunnel functionality will be disabled.', error.message);
|
|
65
|
+
tunnels = undefined;
|
|
66
|
+
}
|
|
60
67
|
const sessions = new Map();
|
|
61
68
|
const commands = {
|
|
62
69
|
startSession: (0, start_session_1.makeStartSession)({ settings, req, tunnels }),
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMakeTunnelClient = void 0;
|
|
4
|
+
const TUNNEL_CLIENT_PACKAGE = '@applitools/tunnel-client';
|
|
5
|
+
let tunnelClientModule = null;
|
|
6
|
+
let loadError = null;
|
|
7
|
+
async function loadTunnelClient() {
|
|
8
|
+
var _a;
|
|
9
|
+
if (tunnelClientModule) {
|
|
10
|
+
return tunnelClientModule;
|
|
11
|
+
}
|
|
12
|
+
if (loadError) {
|
|
13
|
+
throw loadError;
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
tunnelClientModule = await import(TUNNEL_CLIENT_PACKAGE);
|
|
17
|
+
if (!tunnelClientModule || !tunnelClientModule.makeTunnelClient) {
|
|
18
|
+
throw new Error(`Invalid ${TUNNEL_CLIENT_PACKAGE} module structure`);
|
|
19
|
+
}
|
|
20
|
+
return tunnelClientModule;
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
if (error.code === 'MODULE_NOT_FOUND' || ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('Cannot find module'))) {
|
|
24
|
+
loadError = new Error(`The tunnel client functionality requires the optional dependency '${TUNNEL_CLIENT_PACKAGE}' to be installed. ` +
|
|
25
|
+
`Please install it using: npm install ${TUNNEL_CLIENT_PACKAGE}`);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
const currentNodeVersion = parseInt(process.version.slice(1).split('.')[0], 10);
|
|
29
|
+
if (currentNodeVersion < 20) {
|
|
30
|
+
const compatibilityMessage = `You are running an old version of Node.js (${process.version}). ` +
|
|
31
|
+
`You need to manually install ${TUNNEL_CLIENT_PACKAGE} with a version that is compatible with your version of Node.js.\n\n`;
|
|
32
|
+
loadError = new Error(compatibilityMessage + `Original error: ${error.message}`);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
loadError = error;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
throw loadError;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async function getMakeTunnelClient() {
|
|
42
|
+
const module = await loadTunnelClient();
|
|
43
|
+
return module.makeTunnelClient;
|
|
44
|
+
}
|
|
45
|
+
exports.getMakeTunnelClient = getMakeTunnelClient;
|
|
@@ -10,30 +10,55 @@ async function makeTunnelManagerClient({ settings, logger, }) {
|
|
|
10
10
|
(process.platform === 'win32' ? '\\\\.\\pipe\\applitools-tunnel-manager' : '/tmp/applitools-tunnel-manager.sock');
|
|
11
11
|
const socket = (0, socket_1.makeSocket)((0, net_1.createConnection)({ path }), { transport: 'ipc' });
|
|
12
12
|
let server;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
let initializationError;
|
|
14
|
+
await new Promise((resolve, reject) => {
|
|
15
|
+
socket.once('error', async (error) => {
|
|
16
|
+
let shouldReconnect = true;
|
|
17
|
+
try {
|
|
18
|
+
if (['ECONNREFUSED', 'ENOENT'].includes(error.code)) {
|
|
19
|
+
if (error.code === 'ECONNREFUSED') {
|
|
20
|
+
try {
|
|
21
|
+
await fs_1.promises.unlink(path);
|
|
22
|
+
}
|
|
23
|
+
catch { }
|
|
24
|
+
}
|
|
25
|
+
logger.log(`Starting tunnel manager in separate process using path ${path} and settings`, settings);
|
|
17
26
|
try {
|
|
18
|
-
await
|
|
27
|
+
server = await (0, manager_server_1.makeTunnelManagerServerProcess)({ settings, path });
|
|
28
|
+
resolve();
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
if (error.code !== 'EADDRINUSE') {
|
|
32
|
+
logger.error('Failed to start tunnel manager server', error);
|
|
33
|
+
shouldReconnect = false;
|
|
34
|
+
initializationError = error;
|
|
35
|
+
reject(error);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
shouldReconnect = true;
|
|
39
|
+
}
|
|
19
40
|
}
|
|
20
|
-
catch { }
|
|
21
41
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
42
|
+
else {
|
|
43
|
+
shouldReconnect = false;
|
|
44
|
+
initializationError = error;
|
|
45
|
+
reject(error);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
if (shouldReconnect) {
|
|
50
|
+
socket.use((0, net_1.createConnection)({ path }));
|
|
25
51
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
throw error;
|
|
52
|
+
else if (initializationError) {
|
|
53
|
+
socket.cleanup();
|
|
29
54
|
}
|
|
30
55
|
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
socket.
|
|
34
|
-
|
|
56
|
+
});
|
|
57
|
+
socket.once('ready', () => {
|
|
58
|
+
socket.target.unref();
|
|
59
|
+
resolve();
|
|
60
|
+
});
|
|
35
61
|
});
|
|
36
|
-
socket.once('ready', () => socket.target.unref());
|
|
37
62
|
return {
|
|
38
63
|
acquire: (options) => socket.request('Tunnel.acquire', options),
|
|
39
64
|
release: (options) => socket.request('Tunnel.release', options),
|
package/dist/tunnels/manager.js
CHANGED
|
@@ -24,10 +24,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.makeTunnelManager = void 0;
|
|
27
|
-
const
|
|
27
|
+
const loader_1 = require("./loader");
|
|
28
28
|
const utils = __importStar(require("@applitools/utils"));
|
|
29
29
|
async function makeTunnelManager({ settings, logger, }) {
|
|
30
|
-
const
|
|
30
|
+
const createTunnelClient = await (0, loader_1.getMakeTunnelClient)();
|
|
31
|
+
const client = createTunnelClient({ settings, logger });
|
|
31
32
|
const pools = new Map();
|
|
32
33
|
return { acquire, release, close: client.close };
|
|
33
34
|
async function acquire(credentials) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/ec-client",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.22",
|
|
4
4
|
"homepage": "https://applitools.com",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
|
|
@@ -52,21 +52,21 @@
|
|
|
52
52
|
"test:it": "MOCHA_GROUP=it run --top-level mocha './test/it/*.spec.ts'"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@applitools/core-base": "1.32.
|
|
56
|
-
"@applitools/driver": "1.25.
|
|
57
|
-
"@applitools/logger": "2.2.
|
|
58
|
-
"@applitools/req": "1.9.
|
|
59
|
-
"@applitools/socket": "1.3.
|
|
60
|
-
"@applitools/spec-driver-webdriver": "1.5.
|
|
61
|
-
"@applitools/
|
|
62
|
-
"@applitools/utils": "1.14.1",
|
|
55
|
+
"@applitools/core-base": "1.32.2",
|
|
56
|
+
"@applitools/driver": "1.25.3",
|
|
57
|
+
"@applitools/logger": "2.2.9",
|
|
58
|
+
"@applitools/req": "1.9.1",
|
|
59
|
+
"@applitools/socket": "1.3.10",
|
|
60
|
+
"@applitools/spec-driver-webdriver": "1.5.8",
|
|
61
|
+
"@applitools/utils": "1.14.2",
|
|
63
62
|
"abort-controller": "3.0.0",
|
|
64
63
|
"webdriver": "7.31.1",
|
|
65
64
|
"yargs": "^17.7.2"
|
|
66
65
|
},
|
|
67
66
|
"devDependencies": {
|
|
68
|
-
"@applitools/test-server": "^1.4.
|
|
67
|
+
"@applitools/test-server": "^1.4.1",
|
|
69
68
|
"@applitools/test-utils": "^1.5.17",
|
|
69
|
+
"@applitools/tunnel-client": "1.11.8",
|
|
70
70
|
"@types/node": "^12.20.55",
|
|
71
71
|
"@types/node-fetch": "^2.6.1",
|
|
72
72
|
"@types/selenium-webdriver": "^4.0.19",
|
|
@@ -74,6 +74,9 @@
|
|
|
74
74
|
"nock": "^13.3.2",
|
|
75
75
|
"selenium-webdriver": "^4.15.0"
|
|
76
76
|
},
|
|
77
|
+
"optionalDependencies": {
|
|
78
|
+
"@applitools/tunnel-client": ">=1.11.8"
|
|
79
|
+
},
|
|
77
80
|
"engines": {
|
|
78
81
|
"node": ">=12.13.0"
|
|
79
82
|
},
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TunnelClient } from '@applitools/tunnel-client';
|
|
2
|
+
import { type Logger } from '@applitools/logger';
|
|
3
|
+
interface TunnelClientModule {
|
|
4
|
+
makeTunnelClient: (options: {
|
|
5
|
+
settings?: any;
|
|
6
|
+
logger: Logger;
|
|
7
|
+
}) => TunnelClient;
|
|
8
|
+
}
|
|
9
|
+
export declare function getMakeTunnelClient(): Promise<TunnelClientModule['makeTunnelClient']>;
|
|
10
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TunnelManagerSettings } from '../types';
|
|
2
2
|
import { type Logger } from '@applitools/logger';
|
|
3
|
-
import {
|
|
3
|
+
import type { Tunnel, TunnelCredentials } from '@applitools/tunnel-client';
|
|
4
4
|
export interface TunnelManager {
|
|
5
5
|
acquire(credentials: TunnelCredentials): Promise<Tunnel[]>;
|
|
6
6
|
release(tunnels: Tunnel[]): Promise<void>;
|
package/types/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Proxy } from '@applitools/req';
|
|
2
2
|
import { type Batch, type FunctionalSession } from '@applitools/core-base';
|
|
3
|
-
import {
|
|
3
|
+
import type { TunnelClientSettings, Tunnel } from '@applitools/tunnel-client';
|
|
4
4
|
export interface ECClient {
|
|
5
5
|
readonly url: string;
|
|
6
6
|
readonly port: number;
|