@wix/ditto-codegen-public 1.0.213 → 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.
Files changed (2) hide show
  1. package/dist/out.js +35 -8
  2. 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: { "Content-Type": "application/json" },
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: { "Content-Type": "application/json" },
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: { "Content-Type": "application/json" },
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: { "Content-Type": "application/json" },
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: { "Content-Type": "application/json" },
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: { "Content-Type": "application/json" },
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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.213",
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": "47600d341c19ba7c336cc524f1cc2038e1cef8953542639ed4ecd624"
27
+ "falconPackageHash": "b904ef5d8a8e851e4c6c6c8a8ddaa14058c3cb98da38b70a202d28ef"
28
28
  }