@lambdatest/smartui-cli 4.1.56-beta.1 → 4.1.56-beta.2

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 +22 -6
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -2721,11 +2721,27 @@ var server_default = (ctx) => __async(null, null, function* () {
2721
2721
  ctx.log.debug(`smartui results request: sessionId=${sessionId || "none"}`);
2722
2722
  let resolvedBuildId = "";
2723
2723
  let projectToken = "";
2724
- if (sessionId && ((_a = ctx.sessionCapabilitiesMap) == null ? void 0 : _a.has(sessionId))) {
2725
- const cachedCapabilities = ctx.sessionCapabilitiesMap.get(sessionId);
2726
- resolvedBuildId = (cachedCapabilities == null ? void 0 : cachedCapabilities.buildId) || "";
2727
- projectToken = (cachedCapabilities == null ? void 0 : cachedCapabilities.projectToken) || "";
2728
- ctx.log.debug(`Resolved from sessionCapabilitiesMap for sessionId ${sessionId}: buildId=${resolvedBuildId}, projectToken=${projectToken ? "present" : "missing"}`);
2724
+ if (sessionId) {
2725
+ if ((_a = ctx.sessionCapabilitiesMap) == null ? void 0 : _a.has(sessionId)) {
2726
+ const cachedCapabilities = ctx.sessionCapabilitiesMap.get(sessionId);
2727
+ resolvedBuildId = (cachedCapabilities == null ? void 0 : cachedCapabilities.buildId) || "";
2728
+ projectToken = (cachedCapabilities == null ? void 0 : cachedCapabilities.projectToken) || "";
2729
+ ctx.log.debug(`Resolved from sessionCapabilitiesMap for sessionId ${sessionId}: buildId=${resolvedBuildId}, projectToken=${projectToken ? "present" : "missing"}`);
2730
+ } else {
2731
+ try {
2732
+ const fetchedCapabilitiesResp = yield ctx.client.getSmartUICapabilities(sessionId, ctx.config, ctx.git, ctx.log, ctx.isStartExec, ctx.options.baselineBuild);
2733
+ resolvedBuildId = (fetchedCapabilitiesResp == null ? void 0 : fetchedCapabilitiesResp.buildId) || "";
2734
+ projectToken = (fetchedCapabilitiesResp == null ? void 0 : fetchedCapabilitiesResp.projectToken) || "";
2735
+ ctx.log.debug(`Fetched caps for sessionId: ${sessionId} are ${JSON.stringify(fetchedCapabilitiesResp)}`);
2736
+ if (resolvedBuildId) {
2737
+ ctx.sessionCapabilitiesMap.set(sessionId, fetchedCapabilitiesResp);
2738
+ } else if (fetchedCapabilitiesResp && (fetchedCapabilitiesResp == null ? void 0 : fetchedCapabilitiesResp.sessionId)) {
2739
+ ctx.sessionCapabilitiesMap.set(sessionId, fetchedCapabilitiesResp);
2740
+ }
2741
+ } catch (error) {
2742
+ ctx.log.debug(`Failed to fetch capabilities for sessionId ${sessionId}: ${JSON.stringify(error)}`);
2743
+ }
2744
+ }
2729
2745
  }
2730
2746
  if ((!resolvedBuildId || resolvedBuildId.length <= 30) && ctx.build && ctx.build.id) {
2731
2747
  resolvedBuildId = ctx.build.id;
@@ -2971,7 +2987,7 @@ var authExec_default = (ctx) => {
2971
2987
  };
2972
2988
 
2973
2989
  // package.json
2974
- var version = "4.1.56-beta.1";
2990
+ var version = "4.1.56-beta.2";
2975
2991
  var package_default = {
2976
2992
  name: "@lambdatest/smartui-cli",
2977
2993
  version,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambdatest/smartui-cli",
3
- "version": "4.1.56-beta.1",
3
+ "version": "4.1.56-beta.2",
4
4
  "description": "A command line interface (CLI) to run SmartUI tests on LambdaTest",
5
5
  "files": [
6
6
  "dist/**/*"