@argos-ci/core 2.6.0 → 2.7.1-alpha.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/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { ArgosAPISchema } from "@argos-ci/api-client";
2
+ type BuildMetadata = ArgosAPISchema.components["schemas"]["BuildMetadata"];
1
3
  interface UploadParameters {
2
4
  /**
3
5
  * Globs matching image file paths to upload
@@ -68,6 +70,10 @@ interface UploadParameters {
68
70
  * @default 0.5
69
71
  */
70
72
  threshold?: number;
73
+ /**
74
+ * Build metadata.
75
+ */
76
+ metadata?: BuildMetadata;
71
77
  }
72
78
  /**
73
79
  * Upload screenshots to Argos.
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { createClient } from '@argos-ci/api-client';
1
+ import { createClient, throwAPIError } from '@argos-ci/api-client';
2
2
  import convict from 'convict';
3
3
  import { execSync } from 'node:child_process';
4
4
  import { existsSync, readFileSync, createReadStream } from 'node:fs';
@@ -822,7 +822,7 @@ async function uploadFilesToS3(files) {
822
822
  debug("Fetch project");
823
823
  const projectResponse = await apiClient.GET("/project");
824
824
  if (projectResponse.error) {
825
- throw new Error(projectResponse.error.error);
825
+ throwAPIError(projectResponse);
826
826
  }
827
827
  const { defaultBaseBranch, hasRemoteContentAccess } = projectResponse.data;
828
828
  const referenceBranch = config.referenceBranch || defaultBaseBranch;
@@ -883,7 +883,7 @@ async function uploadFilesToS3(files) {
883
883
  }
884
884
  });
885
885
  if (createBuildResponse.error) {
886
- throw new Error(createBuildResponse.error.error);
886
+ throwAPIError(createBuildResponse);
887
887
  }
888
888
  const result = createBuildResponse.data;
889
889
  debug("Got uploads url", result);
@@ -931,11 +931,12 @@ async function uploadFilesToS3(files) {
931
931
  })),
932
932
  parallel: config.parallel,
933
933
  parallelTotal: config.parallelTotal,
934
- parallelIndex: config.parallelIndex
934
+ parallelIndex: config.parallelIndex,
935
+ metadata: params.metadata
935
936
  }
936
937
  });
937
938
  if (uploadBuildResponse.error) {
938
- throw new Error(uploadBuildResponse.error.error);
939
+ throwAPIError(uploadBuildResponse);
939
940
  }
940
941
  return {
941
942
  build: uploadBuildResponse.data.build,
@@ -963,7 +964,7 @@ async function uploadFilesToS3(files) {
963
964
  }
964
965
  });
965
966
  if (finalizeBuildsResult.error) {
966
- throw new Error(finalizeBuildsResult.error.error);
967
+ throwAPIError(finalizeBuildsResult);
967
968
  }
968
969
  return finalizeBuildsResult.data;
969
970
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@argos-ci/core",
3
3
  "description": "Visual testing solution to avoid visual regression. The core component of Argos SDK that handles build creation.",
4
- "version": "2.6.0",
4
+ "version": "2.7.1-alpha.0+4ed9b25",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "types": "./dist/index.d.ts",
@@ -40,8 +40,8 @@
40
40
  "access": "public"
41
41
  },
42
42
  "dependencies": {
43
- "@argos-ci/api-client": "0.3.0",
44
- "@argos-ci/util": "2.1.1",
43
+ "@argos-ci/api-client": "0.4.1-alpha.0+4ed9b25",
44
+ "@argos-ci/util": "2.1.2-alpha.14+4ed9b25",
45
45
  "axios": "^1.7.4",
46
46
  "convict": "^6.2.4",
47
47
  "debug": "^4.3.6",
@@ -60,5 +60,5 @@
60
60
  "build": "rollup -c",
61
61
  "e2e": "node ./e2e/upload.cjs && node ./e2e/upload.mjs"
62
62
  },
63
- "gitHead": "fd9935c114e6a948eca173127947cebcf6381007"
63
+ "gitHead": "4ed9b253b5037f2111d44bcd41fe3467371c41e3"
64
64
  }