@lambdatest/smartui-cli 4.1.52 → 4.1.53

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.
Files changed (2) hide show
  1. package/dist/index.cjs +11 -6
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -2895,7 +2895,7 @@ var authExec_default = (ctx) => {
2895
2895
  };
2896
2896
 
2897
2897
  // package.json
2898
- var version = "4.1.52";
2898
+ var version = "4.1.53";
2899
2899
  var package_default = {
2900
2900
  name: "@lambdatest/smartui-cli",
2901
2901
  version,
@@ -3662,7 +3662,7 @@ var httpClient = class {
3662
3662
  }
3663
3663
  });
3664
3664
  }
3665
- uploadPdf(ctx, form, buildName) {
3665
+ uploadPdf(ctx, form, buildName, pdfNames) {
3666
3666
  return __async(this, null, function* () {
3667
3667
  form.append("projectToken", this.projectToken);
3668
3668
  if (ctx.build.name !== void 0 && ctx.build.name !== "") {
@@ -3671,6 +3671,9 @@ var httpClient = class {
3671
3671
  if (ctx.options.markBaseline) {
3672
3672
  form.append("markBaseline", ctx.options.markBaseline.toString());
3673
3673
  }
3674
+ if (pdfNames && pdfNames !== "") {
3675
+ form.append("pdfNames", pdfNames);
3676
+ }
3674
3677
  try {
3675
3678
  const response = yield this.axiosInstance.request({
3676
3679
  url: ctx.env.SMARTUI_UPLOAD_URL + "/pdf/upload",
@@ -3924,7 +3927,8 @@ var ctx_default = (options) => {
3924
3927
  githubURL: options.gitURL || options.githubURL || "",
3925
3928
  showRenderErrors: options.showRenderErrors ? true : false,
3926
3929
  userName: options.userName || "",
3927
- accessKey: options.accessKey || ""
3930
+ accessKey: options.accessKey || "",
3931
+ pdfNames: options.pdfNames || ""
3928
3932
  },
3929
3933
  cliVersion: version,
3930
3934
  totalSnapshots: -1,
@@ -7529,18 +7533,19 @@ function uploadPdfs(ctx, pdfPath) {
7529
7533
  formData.append("pathToFiles", fs6__default.default.createReadStream(pdfPath));
7530
7534
  } else {
7531
7535
  const files = fs6__default.default.readdirSync(pdfPath);
7532
- const pdfFiles = files.filter((file) => file.endsWith(".pdf"));
7536
+ const pdfFiles = files.filter((file) => file.endsWith(".pdf")).sort();
7533
7537
  pdfFiles.forEach((pdf) => {
7534
7538
  const filePath = path3__default.default.join(pdfPath, pdf);
7535
7539
  formData.append("pathToFiles", fs6__default.default.createReadStream(filePath));
7536
7540
  });
7537
7541
  }
7538
7542
  const buildName = ctx.options.buildName;
7543
+ const pdfNames = ctx.options.pdfNames;
7539
7544
  if (buildName) {
7540
7545
  ctx.build.name = buildName;
7541
7546
  }
7542
7547
  try {
7543
- const response = yield ctx.client.uploadPdf(ctx, formData, buildName);
7548
+ const response = yield ctx.client.uploadPdf(ctx, formData, buildName, pdfNames);
7544
7549
  if (response && response.buildId) {
7545
7550
  ctx.build.id = response.buildId;
7546
7551
  ctx.log.debug(`PDF upload successful. Build ID: ${ctx.build.id}`);
@@ -7556,7 +7561,7 @@ function uploadPdfs(ctx, pdfPath) {
7556
7561
 
7557
7562
  // src/commander/uploadPdf.ts
7558
7563
  var command10 = new commander.Command();
7559
- command10.name("upload-pdf").description("Upload PDFs for visual comparison").argument("<directory>", "Path of the directory containing PDFs").option("--fetch-results [filename]", "Fetch results and optionally specify an output file, e.g., <filename>.json").option("--buildName <string>", "Specify the build name").option("--markBaseline", "Mark this build baseline").action(function(directory, _, command11) {
7564
+ command10.name("upload-pdf").description("Upload PDFs for visual comparison").argument("<directory>", "Path of the directory containing PDFs").option("--fetch-results [filename]", "Fetch results and optionally specify an output file, e.g., <filename>.json").option("--buildName <string>", "Specify the build name").option("--markBaseline", "Mark this build baseline").option("--pdfNames <string>", "Specify PDF names for the upload").action(function(directory, _, command11) {
7560
7565
  return __async(this, null, function* () {
7561
7566
  const options = command11.optsWithGlobals();
7562
7567
  if (options.buildName === "") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambdatest/smartui-cli",
3
- "version": "4.1.52",
3
+ "version": "4.1.53",
4
4
  "description": "A command line interface (CLI) to run SmartUI tests on LambdaTest",
5
5
  "files": [
6
6
  "dist/**/*"