@wix/ditto-codegen-public 1.0.301 → 1.0.303
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/out.js +33 -4
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -10296,6 +10296,7 @@ var require_CodeGenService = __commonJS({
|
|
|
10296
10296
|
"use strict";
|
|
10297
10297
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10298
10298
|
exports2.CodeGenService = exports2.TaskKind = exports2.Status = void 0;
|
|
10299
|
+
exports2.createCodeGenErrorHandler = createCodeGenErrorHandler;
|
|
10299
10300
|
var http_client_1 = require_index_node();
|
|
10300
10301
|
var http_1 = require_http_impl();
|
|
10301
10302
|
var types_1 = require_types_impl();
|
|
@@ -10306,8 +10307,27 @@ var require_CodeGenService = __commonJS({
|
|
|
10306
10307
|
return types_1.TaskKind;
|
|
10307
10308
|
} });
|
|
10308
10309
|
var logger_12 = require_logger();
|
|
10310
|
+
function createCodeGenErrorHandler(getHttpClient) {
|
|
10311
|
+
return {
|
|
10312
|
+
handleError: (error, { requestOptions }) => {
|
|
10313
|
+
if (!http_client_1.HttpClient.isHttpError(error))
|
|
10314
|
+
return;
|
|
10315
|
+
if (getHttpClient().isCancel(error))
|
|
10316
|
+
return;
|
|
10317
|
+
logger_12.logger.error("[CodeGenService] HTTP request failed", {
|
|
10318
|
+
method: error.config?.method?.toUpperCase(),
|
|
10319
|
+
url: requestOptions.url ?? error.config?.url,
|
|
10320
|
+
status: error.response?.status,
|
|
10321
|
+
code: error.code,
|
|
10322
|
+
requestId: error.requestId || void 0,
|
|
10323
|
+
message: error.message,
|
|
10324
|
+
data: error.response?.data
|
|
10325
|
+
});
|
|
10326
|
+
}
|
|
10327
|
+
};
|
|
10328
|
+
}
|
|
10309
10329
|
var CodeGenService = class {
|
|
10310
|
-
constructor(projectId) {
|
|
10330
|
+
constructor(projectId, httpClient) {
|
|
10311
10331
|
this.projectId = projectId;
|
|
10312
10332
|
this.accessToken = process.env.WIX_ACCESS_TOKEN;
|
|
10313
10333
|
this.sandboxId = process.env.SANDBOX_ID;
|
|
@@ -10440,12 +10460,17 @@ var require_CodeGenService = __commonJS({
|
|
|
10440
10460
|
}));
|
|
10441
10461
|
return resp.data?.job ?? null;
|
|
10442
10462
|
};
|
|
10463
|
+
if (httpClient) {
|
|
10464
|
+
this.httpClient = httpClient;
|
|
10465
|
+
return;
|
|
10466
|
+
}
|
|
10443
10467
|
const serverUrl = process.env.CODEGEN_SERVER_BASE_URL || "https://manage.wix.com";
|
|
10444
10468
|
this.httpClient = (0, http_client_1.createHttpClient)({
|
|
10445
10469
|
baseURL: serverUrl,
|
|
10446
10470
|
headers: {
|
|
10447
10471
|
authorization: `Bearer ${this.accessToken}`
|
|
10448
|
-
}
|
|
10472
|
+
},
|
|
10473
|
+
errorHandler: createCodeGenErrorHandler(() => this.httpClient)
|
|
10449
10474
|
});
|
|
10450
10475
|
}
|
|
10451
10476
|
};
|
|
@@ -18267,6 +18292,7 @@ var require_job_timeout_monitor = __commonJS({
|
|
|
18267
18292
|
var ditto_codegen_types_12 = require_dist4();
|
|
18268
18293
|
var utils_1 = require_utils9();
|
|
18269
18294
|
var logger_12 = require_logger();
|
|
18295
|
+
var context_12 = require_context();
|
|
18270
18296
|
exports2.JOB_TIMEOUT_MS = 1e3 * 60 * 20;
|
|
18271
18297
|
var JobTimeoutMonitor = class {
|
|
18272
18298
|
constructor(codeGenerationService) {
|
|
@@ -18285,17 +18311,20 @@ var require_job_timeout_monitor = __commonJS({
|
|
|
18285
18311
|
}
|
|
18286
18312
|
}
|
|
18287
18313
|
async handleTimeout(jobId) {
|
|
18314
|
+
const logContext = { jobId, appDefId: context_12.ctx.projectId };
|
|
18288
18315
|
logger_12.logger.error("[Job] Job exceeded timeout", {
|
|
18316
|
+
...logContext,
|
|
18289
18317
|
timeoutMs: exports2.JOB_TIMEOUT_MS
|
|
18290
18318
|
});
|
|
18291
18319
|
try {
|
|
18292
|
-
logger_12.logger.info("[Job] Timeout detected, exiting");
|
|
18320
|
+
logger_12.logger.info("[Job] Timeout detected, exiting", logContext);
|
|
18293
18321
|
await (0, utils_1.updateAllRunningTasks)(jobId, ditto_codegen_types_12.Status.FAILED, new ditto_codegen_types_12.TimeoutError(`Job exceeded timeout of ${exports2.JOB_TIMEOUT_MS}ms`));
|
|
18294
18322
|
await this.codeGenerationService.markJobAsCompleted(jobId);
|
|
18295
|
-
logger_12.logger.info("[Job] Marked job as completed, failed all running tasks");
|
|
18323
|
+
logger_12.logger.info("[Job] Marked job as completed, failed all running tasks", logContext);
|
|
18296
18324
|
process.exit();
|
|
18297
18325
|
} catch (error) {
|
|
18298
18326
|
logger_12.logger.error("[Job] Failed to mark timed-out job as completed", {
|
|
18327
|
+
...logContext,
|
|
18299
18328
|
error: error instanceof Error ? error.message : String(error)
|
|
18300
18329
|
});
|
|
18301
18330
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/ditto-codegen-public",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.303",
|
|
4
4
|
"description": "AI-powered Wix CLI app generator - standalone executable",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "node build.mjs",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"@wix/ditto-codegen": "1.0.0",
|
|
28
28
|
"esbuild": "^0.27.2"
|
|
29
29
|
},
|
|
30
|
-
"falconPackageHash": "
|
|
30
|
+
"falconPackageHash": "880f28f27c00d452fdf410e2d620e8b1f982d9b04450dad9a4d47b1e"
|
|
31
31
|
}
|