@percy/client 1.28.3 → 1.28.4-beta.0

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/client.js CHANGED
@@ -188,6 +188,7 @@ export class PercyClient {
188
188
  try {
189
189
  return await this.get(`comparisons/${comparisonId}?sync=true&response_format=sync-cli`);
190
190
  } catch (error) {
191
+ this.log.error(error);
191
192
  if (error.response.statusCode === 403) {
192
193
  throw new Error(INVALID_TOKEN_ERROR_MESSAGE);
193
194
  }
@@ -199,6 +200,7 @@ export class PercyClient {
199
200
  try {
200
201
  return await this.get(`snapshots/${snapshotId}?sync=true&response_format=sync-cli`);
201
202
  } catch (error) {
203
+ this.log.error(error);
202
204
  if (error.response.statusCode === 403) {
203
205
  throw new Error(INVALID_TOKEN_ERROR_MESSAGE);
204
206
  }
@@ -552,6 +554,7 @@ export class PercyClient {
552
554
  }
553
555
  });
554
556
  } catch (error) {
557
+ this.log.error(error);
555
558
  if (error.response.statusCode === 400) {
556
559
  return false;
557
560
  }
@@ -593,6 +596,12 @@ export class PercyClient {
593
596
  data: body
594
597
  });
595
598
  }
599
+ async sendBuildLogs(body) {
600
+ this.log.debug('Sending Build Logs');
601
+ return this.post('logs', {
602
+ data: body
603
+ });
604
+ }
596
605
  mayBeLogUploadSize(contentSize) {
597
606
  if (contentSize >= 25 * 1024 * 1024) {
598
607
  this.log.error('Uploading resource above 25MB might fail the build...');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/client",
3
- "version": "1.28.3",
3
+ "version": "1.28.4-beta.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "publishConfig": {
11
11
  "access": "public",
12
- "tag": "latest"
12
+ "tag": "beta"
13
13
  },
14
14
  "engines": {
15
15
  "node": ">=14"
@@ -32,9 +32,9 @@
32
32
  "test:coverage": "yarn test --coverage"
33
33
  },
34
34
  "dependencies": {
35
- "@percy/env": "1.28.3",
36
- "@percy/logger": "1.28.3",
35
+ "@percy/env": "1.28.4-beta.0",
36
+ "@percy/logger": "1.28.4-beta.0",
37
37
  "pako": "^2.1.0"
38
38
  },
39
- "gitHead": "5d41045921c7ac06329c4b72caaf291d34e3f699"
39
+ "gitHead": "fe4d7e944acd2081d901eb2eed202ccb64098576"
40
40
  }
package/test/helpers.js CHANGED
@@ -145,7 +145,8 @@ export const api = {
145
145
  }],
146
146
  '/discovery/device-details': () => [201, {
147
147
  data: []
148
- }]
148
+ }],
149
+ '/logs': () => [200, 'random_sha']
149
150
  },
150
151
 
151
152
  async mock({ delay = 10 } = {}) {