@lambdatest/smartui-cli 4.1.43 → 4.1.45
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.cjs +29 -9
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2584,10 +2584,8 @@ var server_default = (ctx) => __async(void 0, null, function* () {
|
|
|
2584
2584
|
lastExternalResponse = externalResponse;
|
|
2585
2585
|
if (externalResponse.statusCode === 200) {
|
|
2586
2586
|
replyCode = 200;
|
|
2587
|
-
replyBody =
|
|
2588
|
-
|
|
2589
|
-
error: externalResponse.error.message
|
|
2590
|
-
};
|
|
2587
|
+
replyBody = externalResponse.data;
|
|
2588
|
+
replyBody.error = externalResponse.error.message;
|
|
2591
2589
|
return reply.code(replyCode).send(replyBody);
|
|
2592
2590
|
} else if (externalResponse.statusCode === 202) {
|
|
2593
2591
|
replyBody = externalResponse.data;
|
|
@@ -2605,10 +2603,8 @@ var server_default = (ctx) => __async(void 0, null, function* () {
|
|
|
2605
2603
|
ctx.log.debug(`Time passed: ${Date.now() - startTime}`);
|
|
2606
2604
|
if (Date.now() - startTime > timeoutDuration) {
|
|
2607
2605
|
replyCode = 202;
|
|
2608
|
-
replyBody =
|
|
2609
|
-
|
|
2610
|
-
data: lastExternalResponse.data
|
|
2611
|
-
};
|
|
2606
|
+
replyBody = lastExternalResponse.data;
|
|
2607
|
+
replyBody.error = "Request timed out, Snapshot still processing";
|
|
2612
2608
|
return reply.code(replyCode).send(replyBody);
|
|
2613
2609
|
}
|
|
2614
2610
|
} catch (externalApiError) {
|
|
@@ -2634,6 +2630,30 @@ var server_default = (ctx) => __async(void 0, null, function* () {
|
|
|
2634
2630
|
return reply.code(replyCode).send(replyBody);
|
|
2635
2631
|
}
|
|
2636
2632
|
}));
|
|
2633
|
+
server.get("/build/info", opts, (request, reply) => __async(void 0, null, function* () {
|
|
2634
|
+
let replyCode;
|
|
2635
|
+
let replyBody;
|
|
2636
|
+
try {
|
|
2637
|
+
if (ctx.build && ctx.build.id) {
|
|
2638
|
+
const buildInfo = ctx.build;
|
|
2639
|
+
const data = {
|
|
2640
|
+
buildId: buildInfo.id,
|
|
2641
|
+
buildName: buildInfo.name,
|
|
2642
|
+
baseline: buildInfo.baseline,
|
|
2643
|
+
projectToken: ctx.env.PROJECT_TOKEN || ""
|
|
2644
|
+
};
|
|
2645
|
+
replyCode = 200;
|
|
2646
|
+
replyBody = { data };
|
|
2647
|
+
} else {
|
|
2648
|
+
throw new Error("Build information is not available");
|
|
2649
|
+
}
|
|
2650
|
+
} catch (error) {
|
|
2651
|
+
ctx.log.debug(`build info failed; ${error}`);
|
|
2652
|
+
replyCode = 500;
|
|
2653
|
+
replyBody = { error: { message: error.message } };
|
|
2654
|
+
}
|
|
2655
|
+
return reply.code(replyCode).send(replyBody);
|
|
2656
|
+
}));
|
|
2637
2657
|
if (ctx.sourceCommand && ctx.sourceCommand === "exec-start") {
|
|
2638
2658
|
yield server.listen({ port: ctx.options.port });
|
|
2639
2659
|
let { port } = server.addresses()[0];
|
|
@@ -2800,7 +2820,7 @@ var authExec_default = (ctx) => {
|
|
|
2800
2820
|
};
|
|
2801
2821
|
|
|
2802
2822
|
// package.json
|
|
2803
|
-
var version = "4.1.
|
|
2823
|
+
var version = "4.1.45";
|
|
2804
2824
|
var package_default = {
|
|
2805
2825
|
name: "@lambdatest/smartui-cli",
|
|
2806
2826
|
version,
|