@applitools/ec-client 1.7.8 → 1.7.10

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 CHANGED
@@ -1,5 +1,100 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.7.10](https://github.com/applitools/eyes.sdk.javascript1/compare/js/ec-client@1.7.9...js/ec-client@1.7.10) (2023-09-25)
4
+
5
+
6
+ ### Code Refactoring
7
+
8
+ * use Uint8Array instead of Buffer for binary data representation ([#1928](https://github.com/applitools/eyes.sdk.javascript1/issues/1928)) ([d1472ab](https://github.com/applitools/eyes.sdk.javascript1/commit/d1472ab8fd49e9a240e99a44dbf1d180b6c7a54b))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * @applitools/utils bumped to 1.6.1
14
+ #### Bug Fixes
15
+
16
+ * add browser entry point declaration and test ([#1933](https://github.com/applitools/eyes.sdk.javascript1/issues/1933)) ([5ba0720](https://github.com/applitools/eyes.sdk.javascript1/commit/5ba0720d62a9af8a9a2e1c2437c569e6ab19afd8))
17
+
18
+
19
+ #### Code Refactoring
20
+
21
+ * use Uint8Array instead of Buffer for binary data representation ([#1928](https://github.com/applitools/eyes.sdk.javascript1/issues/1928)) ([d1472ab](https://github.com/applitools/eyes.sdk.javascript1/commit/d1472ab8fd49e9a240e99a44dbf1d180b6c7a54b))
22
+ * @applitools/logger bumped to 2.0.11
23
+ #### Bug Fixes
24
+
25
+ * add browser entry point declaration and test ([#1933](https://github.com/applitools/eyes.sdk.javascript1/issues/1933)) ([5ba0720](https://github.com/applitools/eyes.sdk.javascript1/commit/5ba0720d62a9af8a9a2e1c2437c569e6ab19afd8))
26
+
27
+
28
+
29
+ * @applitools/socket bumped to 1.1.11
30
+ #### Code Refactoring
31
+
32
+ * use Uint8Array instead of Buffer for binary data representation ([#1928](https://github.com/applitools/eyes.sdk.javascript1/issues/1928)) ([d1472ab](https://github.com/applitools/eyes.sdk.javascript1/commit/d1472ab8fd49e9a240e99a44dbf1d180b6c7a54b))
33
+
34
+
35
+
36
+ * @applitools/req bumped to 1.6.1
37
+ #### Bug Fixes
38
+
39
+ * add browser entry point declaration and test ([#1933](https://github.com/applitools/eyes.sdk.javascript1/issues/1933)) ([5ba0720](https://github.com/applitools/eyes.sdk.javascript1/commit/5ba0720d62a9af8a9a2e1c2437c569e6ab19afd8))
40
+
41
+
42
+
43
+ * @applitools/image bumped to 1.1.6
44
+ #### Code Refactoring
45
+
46
+ * use Uint8Array instead of Buffer for binary data representation ([#1928](https://github.com/applitools/eyes.sdk.javascript1/issues/1928)) ([d1472ab](https://github.com/applitools/eyes.sdk.javascript1/commit/d1472ab8fd49e9a240e99a44dbf1d180b6c7a54b))
47
+
48
+
49
+
50
+ * @applitools/spec-driver-webdriver bumped to 1.0.46
51
+
52
+ * @applitools/driver bumped to 1.14.2
53
+ #### Code Refactoring
54
+
55
+ * use Uint8Array instead of Buffer for binary data representation ([#1928](https://github.com/applitools/eyes.sdk.javascript1/issues/1928)) ([d1472ab](https://github.com/applitools/eyes.sdk.javascript1/commit/d1472ab8fd49e9a240e99a44dbf1d180b6c7a54b))
56
+
57
+
58
+
59
+ * @applitools/tunnel-client bumped to 1.2.3
60
+ #### Code Refactoring
61
+
62
+ * use Uint8Array instead of Buffer for binary data representation ([#1928](https://github.com/applitools/eyes.sdk.javascript1/issues/1928)) ([d1472ab](https://github.com/applitools/eyes.sdk.javascript1/commit/d1472ab8fd49e9a240e99a44dbf1d180b6c7a54b))
63
+
64
+
65
+
66
+ * @applitools/core-base bumped to 1.6.1
67
+ #### Reverts
68
+
69
+ * perform major changes ([994cd70](https://github.com/applitools/eyes.sdk.javascript1/commit/994cd703ebe891bf68aecd49d77b5fb119f6ebe8))
70
+
71
+
72
+ #### Code Refactoring
73
+
74
+ * use Uint8Array instead of Buffer for binary data representation ([#1928](https://github.com/applitools/eyes.sdk.javascript1/issues/1928)) ([d1472ab](https://github.com/applitools/eyes.sdk.javascript1/commit/d1472ab8fd49e9a240e99a44dbf1d180b6c7a54b))
75
+
76
+
77
+
78
+
79
+ ## [1.7.9](https://github.com/applitools/eyes.sdk.javascript1/compare/js/ec-client@1.7.8...js/ec-client@1.7.9) (2023-09-21)
80
+
81
+
82
+ ### Bug Fixes
83
+
84
+ * change expiration time of the tunnel ([c019241](https://github.com/applitools/eyes.sdk.javascript1/commit/c0192411410135b23f3ae47dd62fbef67be66f1a))
85
+
86
+
87
+ ### Dependencies
88
+
89
+ * @applitools/snippets bumped to 2.4.24
90
+ #### Bug Fixes
91
+
92
+ * add support to shadow dom iframe ([#1925](https://github.com/applitools/eyes.sdk.javascript1/issues/1925)) ([a06b955](https://github.com/applitools/eyes.sdk.javascript1/commit/a06b9555a3b37918fe43a90e92c0a94f765151cc))
93
+ * @applitools/spec-driver-webdriver bumped to 1.0.45
94
+
95
+ * @applitools/driver bumped to 1.14.1
96
+
97
+
3
98
  ## [1.7.8](https://github.com/applitools/eyes.sdk.javascript1/compare/js/ec-client@1.7.7...js/ec-client@1.7.8) (2023-09-05)
4
99
 
5
100
 
package/dist/client.js CHANGED
@@ -42,7 +42,7 @@ async function makeECClient({ settings, logger: defaultLogger, } = {}) {
42
42
  (_l = (_13 = settings.tunnel.pool).maxInuse) !== null && _l !== void 0 ? _l : (_13.maxInuse = (_m = utils.general.getEnvValue('TUNNEL_POOL_MAX_INUSE', 'number')) !== null && _m !== void 0 ? _m : 4);
43
43
  (_o = (_14 = settings.tunnel.pool).timeout) !== null && _o !== void 0 ? _o : (_14.timeout = {});
44
44
  (_p = (_15 = settings.tunnel.pool.timeout).idle) !== null && _p !== void 0 ? _p : (_15.idle = (_q = utils.general.getEnvValue('TUNNEL_POOL_TIMEOUT_IDLE', 'number')) !== null && _q !== void 0 ? _q : 20 * 60000);
45
- (_r = (_16 = settings.tunnel.pool.timeout).expiration) !== null && _r !== void 0 ? _r : (_16.expiration = (_s = utils.general.getEnvValue('TUNNEL_POOL_TIMEOUT_EXPIRATION', 'number')) !== null && _s !== void 0 ? _s : 30000);
45
+ (_r = (_16 = settings.tunnel.pool.timeout).expiration) !== null && _r !== void 0 ? _r : (_16.expiration = (_s = utils.general.getEnvValue('TUNNEL_POOL_TIMEOUT_EXPIRATION', 'number')) !== null && _s !== void 0 ? _s : 20 * 60000);
46
46
  (_t = settings.options) !== null && _t !== void 0 ? _t : (settings.options = {});
47
47
  (_u = (_17 = settings.options).eyesServerUrl) !== null && _u !== void 0 ? _u : (_17.eyesServerUrl = (_w = (_v = utils.general.getEnvValue('EYES_SERVER_URL')) !== null && _v !== void 0 ? _v : utils.general.getEnvValue('SERVER_URL')) !== null && _w !== void 0 ? _w : 'https://eyesapi.applitools.com');
48
48
  (_x = (_18 = settings.options).apiKey) !== null && _x !== void 0 ? _x : (_18.apiKey = utils.general.getEnvValue('API_KEY'));
@@ -10,8 +10,8 @@ function makeFindElement({ req }) {
10
10
  io: { request, response, handle: false },
11
11
  logger,
12
12
  });
13
- const responseBody = Buffer.from(await proxyResponse.arrayBuffer());
14
- const parsed = JSON.parse(responseBody.toString('utf8'));
13
+ const responseBody = new Uint8Array(await proxyResponse.arrayBuffer());
14
+ const parsed = JSON.parse(new TextDecoder().decode(responseBody));
15
15
  if ((_b = (_a = parsed === null || parsed === void 0 ? void 0 : parsed.appliCustomData) === null || _a === void 0 ? void 0 : _a.selfHealing) === null || _b === void 0 ? void 0 : _b.successfulSelector) {
16
16
  logger.log('Self-healed locators detected', parsed.appliCustomData.selfHealing);
17
17
  (_c = session.metadata) !== null && _c !== void 0 ? _c : (session.metadata = []);
@@ -20,7 +20,9 @@ function makeFindElement({ req }) {
20
20
  else {
21
21
  logger.log('No self-healing metadata found');
22
22
  }
23
- response.writeHead(proxyResponse.status, Object.fromEntries(proxyResponse.headers.entries())).end(responseBody);
23
+ response
24
+ .writeHead(proxyResponse.status, Object.fromEntries(proxyResponse.headers.entries()))
25
+ .end(Buffer.from(responseBody));
24
26
  };
25
27
  }
26
28
  exports.makeFindElement = makeFindElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/ec-client",
3
- "version": "1.7.8",
3
+ "version": "1.7.10",
4
4
  "homepage": "https://applitools.com",
5
5
  "bugs": {
6
6
  "url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
@@ -52,14 +52,14 @@
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.6.0",
56
- "@applitools/driver": "1.14.0",
57
- "@applitools/logger": "2.0.10",
58
- "@applitools/req": "1.6.0",
59
- "@applitools/socket": "1.1.10",
60
- "@applitools/spec-driver-webdriver": "1.0.44",
61
- "@applitools/tunnel-client": "1.2.2",
62
- "@applitools/utils": "1.6.0",
55
+ "@applitools/core-base": "1.6.1",
56
+ "@applitools/driver": "1.14.2",
57
+ "@applitools/logger": "2.0.11",
58
+ "@applitools/req": "1.6.1",
59
+ "@applitools/socket": "1.1.11",
60
+ "@applitools/spec-driver-webdriver": "1.0.46",
61
+ "@applitools/tunnel-client": "1.2.3",
62
+ "@applitools/utils": "1.6.1",
63
63
  "abort-controller": "3.0.0",
64
64
  "webdriver": "7.31.1",
65
65
  "yargs": "^17.7.2"
@@ -0,0 +1,15 @@
1
+ import { type Logger } from '@applitools/logger';
2
+ import { type AbortSignal } from 'abort-controller';
3
+ export type Queue = {
4
+ readonly corked: boolean;
5
+ readonly pause: never;
6
+ run<TResult>(task: Task<TResult>): Promise<TResult>;
7
+ cancel(task: (signal: AbortSignal) => Promise<any>): void;
8
+ cork(): void;
9
+ uncork(): void;
10
+ };
11
+ type Task<TResult> = (signal: AbortSignal) => Promise<TResult>;
12
+ export declare function makeQueue({ logger }: {
13
+ logger: Logger;
14
+ }): Queue;
15
+ export {};