@wix/ditto-codegen-public 1.0.212 → 1.0.214
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 +62 -16
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -1329,55 +1329,82 @@ var require_CodeGenService = __commonJS({
|
|
|
1329
1329
|
constructor(baseUrl, projectId) {
|
|
1330
1330
|
this.baseUrl = baseUrl;
|
|
1331
1331
|
this.projectId = projectId;
|
|
1332
|
+
this.accessToken = process.env.WIX_ACCESS_TOKEN;
|
|
1332
1333
|
this.fetchPendingJobs = async () => {
|
|
1333
|
-
const resp = await fetch(`${this.baseUrl}/projects/${this.projectId}/jobs
|
|
1334
|
+
const resp = await fetch(`${this.baseUrl}/projects/${this.projectId}/jobs`, {
|
|
1335
|
+
headers: {
|
|
1336
|
+
authorization: `Bearer ${this.accessToken}`
|
|
1337
|
+
}
|
|
1338
|
+
});
|
|
1334
1339
|
const jobsData = await resp.json();
|
|
1335
1340
|
return jobsData.jobs.filter((job) => job.status === ditto_codegen_types_12.Status.PENDING);
|
|
1336
1341
|
};
|
|
1337
1342
|
this.markJobAsCompleted = async (jobId) => {
|
|
1338
1343
|
await fetch(`${this.baseUrl}/projects/${this.projectId}/jobs/${jobId}`, {
|
|
1339
1344
|
method: "PUT",
|
|
1340
|
-
headers: {
|
|
1345
|
+
headers: {
|
|
1346
|
+
"Content-Type": "application/json",
|
|
1347
|
+
authorization: `Bearer ${this.accessToken}`
|
|
1348
|
+
},
|
|
1341
1349
|
body: JSON.stringify({ status: ditto_codegen_types_12.Status.COMPLETED })
|
|
1342
1350
|
});
|
|
1343
1351
|
};
|
|
1344
1352
|
this.markJobAsCancelled = async (jobId) => {
|
|
1345
1353
|
await fetch(`${this.baseUrl}/projects/${this.projectId}/jobs/${jobId}`, {
|
|
1346
1354
|
method: "PUT",
|
|
1347
|
-
headers: {
|
|
1355
|
+
headers: {
|
|
1356
|
+
"Content-Type": "application/json",
|
|
1357
|
+
authorization: `Bearer ${this.accessToken}`
|
|
1358
|
+
},
|
|
1348
1359
|
body: JSON.stringify({ status: ditto_codegen_types_12.Status.CANCELLED })
|
|
1349
1360
|
});
|
|
1350
1361
|
};
|
|
1351
1362
|
this.updateJob = async (jobId, payload) => {
|
|
1352
1363
|
await fetch(`${this.baseUrl}/projects/${this.projectId}/jobs/${jobId}`, {
|
|
1353
1364
|
method: "PUT",
|
|
1354
|
-
headers: {
|
|
1365
|
+
headers: {
|
|
1366
|
+
"Content-Type": "application/json",
|
|
1367
|
+
authorization: `Bearer ${this.accessToken}`
|
|
1368
|
+
},
|
|
1355
1369
|
body: JSON.stringify({ payload })
|
|
1356
1370
|
});
|
|
1357
1371
|
};
|
|
1358
1372
|
this.updateJobStatus = async (jobId, status) => {
|
|
1359
1373
|
await fetch(`${this.baseUrl}/projects/${this.projectId}/jobs/${jobId}`, {
|
|
1360
1374
|
method: "PUT",
|
|
1361
|
-
headers: {
|
|
1375
|
+
headers: {
|
|
1376
|
+
"Content-Type": "application/json",
|
|
1377
|
+
authorization: `Bearer ${this.accessToken}`
|
|
1378
|
+
},
|
|
1362
1379
|
body: JSON.stringify({ status })
|
|
1363
1380
|
});
|
|
1364
1381
|
};
|
|
1365
1382
|
this.updateTask = async (jobId, taskId, status, payload) => {
|
|
1366
1383
|
await fetch(`${this.baseUrl}/projects/${this.projectId}/jobs/${jobId}/tasks/${taskId}`, {
|
|
1367
1384
|
method: "PUT",
|
|
1368
|
-
headers: {
|
|
1385
|
+
headers: {
|
|
1386
|
+
"Content-Type": "application/json",
|
|
1387
|
+
authorization: `Bearer ${this.accessToken}`
|
|
1388
|
+
},
|
|
1369
1389
|
body: JSON.stringify({ status, payload })
|
|
1370
1390
|
});
|
|
1371
1391
|
};
|
|
1372
1392
|
this.addTask = async (jobId, task) => {
|
|
1373
1393
|
await fetch(`${this.baseUrl}/projects/${this.projectId}/jobs/${jobId}/tasks`, {
|
|
1374
1394
|
method: "POST",
|
|
1375
|
-
headers: {
|
|
1395
|
+
headers: {
|
|
1396
|
+
"Content-Type": "application/json",
|
|
1397
|
+
authorization: `Bearer ${this.accessToken}`
|
|
1398
|
+
},
|
|
1376
1399
|
body: JSON.stringify(this.mapServerTask(task))
|
|
1377
1400
|
});
|
|
1378
1401
|
};
|
|
1379
1402
|
this.getJob = async (jobId) => {
|
|
1380
|
-
const resp = await fetch(`${this.baseUrl}/projects/${this.projectId}/jobs/${jobId}
|
|
1403
|
+
const resp = await fetch(`${this.baseUrl}/projects/${this.projectId}/jobs/${jobId}`, {
|
|
1404
|
+
headers: {
|
|
1405
|
+
authorization: `Bearer ${this.accessToken}`
|
|
1406
|
+
}
|
|
1407
|
+
});
|
|
1381
1408
|
if (!resp.ok)
|
|
1382
1409
|
return null;
|
|
1383
1410
|
const response = await resp.json();
|
|
@@ -84552,7 +84579,7 @@ var require_fetchApiDocs = __commonJS({
|
|
|
84552
84579
|
"use strict";
|
|
84553
84580
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
84554
84581
|
exports2.fetchApiDocsByName = fetchApiDocsByName;
|
|
84555
|
-
exports2.
|
|
84582
|
+
exports2.extractMatchingUrlFromSearchResult = extractMatchingUrlFromSearchResult;
|
|
84556
84583
|
exports2.formatApiDocumentation = formatApiDocumentation;
|
|
84557
84584
|
var WixMCPClient_1 = require_WixMCPClient();
|
|
84558
84585
|
async function fetchApiDocsByName(apis) {
|
|
@@ -84564,8 +84591,8 @@ var require_fetchApiDocs = __commonJS({
|
|
|
84564
84591
|
await mcpClient.connect();
|
|
84565
84592
|
const results = await Promise.all(apis.map(async (api) => {
|
|
84566
84593
|
try {
|
|
84567
|
-
const searchResult = await mcpClient.searchSDKDocumentation(api.name,
|
|
84568
|
-
const docsUrl =
|
|
84594
|
+
const searchResult = await mcpClient.searchSDKDocumentation(api.name, 5);
|
|
84595
|
+
const docsUrl = extractMatchingUrlFromSearchResult(searchResult.content, api.name);
|
|
84569
84596
|
if (!docsUrl) {
|
|
84570
84597
|
console.warn(`Could not find docsUrl for API: ${api.name}`);
|
|
84571
84598
|
return { name: api.name, purpose: api.purpose };
|
|
@@ -84594,13 +84621,32 @@ var require_fetchApiDocs = __commonJS({
|
|
|
84594
84621
|
}
|
|
84595
84622
|
}
|
|
84596
84623
|
var WIX_SDK_DOCS_URL_PATTERN = /https:\/\/dev\.wix\.com\/docs\/sdk\/[^\s"']+/;
|
|
84597
|
-
function
|
|
84598
|
-
|
|
84599
|
-
|
|
84600
|
-
|
|
84601
|
-
|
|
84624
|
+
function parseSearchResults(content) {
|
|
84625
|
+
const results = [];
|
|
84626
|
+
const fullContent = content.join("\n");
|
|
84627
|
+
const blocks = fullContent.split("---");
|
|
84628
|
+
for (const block of blocks) {
|
|
84629
|
+
const methodNameMatch = block.match(/# Method name:\s*\n?\s*([^\n(]+)/);
|
|
84630
|
+
const urlMatch = block.match(WIX_SDK_DOCS_URL_PATTERN);
|
|
84631
|
+
if (methodNameMatch && urlMatch) {
|
|
84632
|
+
results.push({
|
|
84633
|
+
methodName: methodNameMatch[1].trim(),
|
|
84634
|
+
url: urlMatch[0]
|
|
84635
|
+
});
|
|
84602
84636
|
}
|
|
84603
84637
|
}
|
|
84638
|
+
return results;
|
|
84639
|
+
}
|
|
84640
|
+
function extractMatchingUrlFromSearchResult(content, apiName) {
|
|
84641
|
+
const results = parseSearchResults(content);
|
|
84642
|
+
if (results.length === 0) {
|
|
84643
|
+
return void 0;
|
|
84644
|
+
}
|
|
84645
|
+
const exactMatch = results.find((r) => r.methodName.toLowerCase().startsWith(apiName.toLowerCase()));
|
|
84646
|
+
if (exactMatch) {
|
|
84647
|
+
return exactMatch.url;
|
|
84648
|
+
}
|
|
84649
|
+
console.warn(`No exact match found for API "${apiName}", available methods: ${results.map((r) => r.methodName).join(", ")}`);
|
|
84604
84650
|
return void 0;
|
|
84605
84651
|
}
|
|
84606
84652
|
function formatApiDocumentation(apis) {
|
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.214",
|
|
4
4
|
"description": "AI-powered Wix CLI app generator - standalone executable",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "node build.mjs",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"@wix/ditto-codegen": "1.0.0",
|
|
25
25
|
"esbuild": "^0.27.2"
|
|
26
26
|
},
|
|
27
|
-
"falconPackageHash": "
|
|
27
|
+
"falconPackageHash": "b904ef5d8a8e851e4c6c6c8a8ddaa14058c3cb98da38b70a202d28ef"
|
|
28
28
|
}
|