@autocode-cli/autocode 0.23.0 → 0.24.0

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 (48) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{BtXQIoy8.js → -dQPdr6B.js} +1 -1
  3. package/.output/public/_nuxt/{BdgB0Sk8.js → 66ZmMMJ2.js} +1 -1
  4. package/.output/public/_nuxt/{Byshfb8L.js → 8THboZmE.js} +1 -1
  5. package/.output/public/_nuxt/{kZiZQgsI.js → B6eh1ZOq.js} +1 -1
  6. package/.output/public/_nuxt/{DAd8dbng.js → BA3hQEn3.js} +1 -1
  7. package/.output/public/_nuxt/{DuqM_LGj.js → BDASIxln.js} +1 -1
  8. package/.output/public/_nuxt/{mty-mFWB.js → BELXF6aE.js} +1 -1
  9. package/.output/public/_nuxt/{BiqphZN8.js → BE_AlRS6.js} +1 -1
  10. package/.output/public/_nuxt/{D9fas07B.js → BICeJifN.js} +1 -1
  11. package/.output/public/_nuxt/{ClY4a-PO.js → BL3gdTy3.js} +1 -1
  12. package/.output/public/_nuxt/{C2rmiAJ1.js → Bo-KGD7n.js} +1 -1
  13. package/.output/public/_nuxt/{DbZiOpag.js → C2_wg8pQ.js} +1 -1
  14. package/.output/public/_nuxt/{c4NRZ8AG.js → C4EkQk2p.js} +1 -1
  15. package/.output/public/_nuxt/{Bn2y2u4i.js → C7zce8Gq.js} +1 -1
  16. package/.output/public/_nuxt/{BXorvbPI.js → CHc8-G9J.js} +1 -1
  17. package/.output/public/_nuxt/{C10TWEVH.js → CIgI-kep.js} +1 -1
  18. package/.output/public/_nuxt/{CMIuQb6D.js → CKeBHRuu.js} +1 -1
  19. package/.output/public/_nuxt/{BJz8iexS.js → Ct1wD_ak.js} +1 -1
  20. package/.output/public/_nuxt/{BU6KT1Jg.js → DEicEhPN.js} +1 -1
  21. package/.output/public/_nuxt/{BAAVMorC.js → DKj_oZ78.js} +1 -1
  22. package/.output/public/_nuxt/{BJ-MtkWm.js → DXYLT_D8.js} +1 -1
  23. package/.output/public/_nuxt/{D1JH-OfY.js → DlTeOLHG.js} +1 -1
  24. package/.output/public/_nuxt/{D0HHOq4k.js → DsCGEKfY.js} +3 -3
  25. package/.output/public/_nuxt/{B6pOO9Bz.js → Dtyr3Ptk.js} +1 -1
  26. package/.output/public/_nuxt/{4sw7JTbp.js → DvVB97EX.js} +1 -1
  27. package/.output/public/_nuxt/{g7WOzF8b.js → DxaZgXvq.js} +1 -1
  28. package/.output/public/_nuxt/{DNMLSDtV.js → E2h0K5Qn.js} +1 -1
  29. package/.output/public/_nuxt/{kNuGsBnB.js → M57FIHwY.js} +1 -1
  30. package/.output/public/_nuxt/builds/latest.json +1 -1
  31. package/.output/public/_nuxt/builds/meta/a848760b-b2f3-47a2-a548-c3c02733b51c.json +1 -0
  32. package/.output/public/_nuxt/{DxFm2Qrx.js → p5o8ebxv.js} +1 -1
  33. package/.output/public/_nuxt/{BMCm0zjc.js → teKmjdue.js} +1 -1
  34. package/.output/public/_nuxt/{CTbIP459.js → uyQmTYnD.js} +1 -1
  35. package/.output/public/_payload.json +1 -1
  36. package/.output/public/index.html +1 -1
  37. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  38. package/.output/server/chunks/build/server.mjs +2 -2
  39. package/.output/server/chunks/build/styles.mjs +8 -8
  40. package/.output/server/chunks/nitro/nitro.mjs +224 -222
  41. package/.output/server/chunks/routes/api/purge.post.mjs +56 -0
  42. package/.output/server/chunks/routes/api/purge.post.mjs.map +1 -0
  43. package/.output/server/package.json +1 -1
  44. package/bin/autocode +55 -0
  45. package/package.json +1 -1
  46. package/.output/public/_nuxt/builds/meta/35ace9c2-472c-4755-ae87-74fdb84336dd.json +0 -1
  47. /package/.output/public/_i18n/{__ad3z6g → LLdrvu-h}/en/messages.json +0 -0
  48. /package/.output/public/_i18n/{__ad3z6g → LLdrvu-h}/fr/messages.json +0 -0
@@ -0,0 +1,56 @@
1
+ import { p as prisma, d as defineEventHandler, i as debug } from '../../nitro/nitro.mjs';
2
+ import { rm } from 'fs/promises';
3
+ import { join } from 'path';
4
+ import 'node:http';
5
+ import 'node:https';
6
+ import 'node:crypto';
7
+ import 'stream';
8
+ import 'events';
9
+ import 'http';
10
+ import 'crypto';
11
+ import 'buffer';
12
+ import 'zlib';
13
+ import 'https';
14
+ import 'net';
15
+ import 'tls';
16
+ import 'url';
17
+ import 'node:events';
18
+ import 'node:buffer';
19
+ import 'node:fs';
20
+ import 'node:path';
21
+ import 'vue-router';
22
+ import '@prisma/client';
23
+ import '@prisma/adapter-better-sqlite3';
24
+ import 'fs';
25
+ import 'child_process';
26
+ import 'node:child_process';
27
+ import 'node:url';
28
+
29
+ async function purgeAll() {
30
+ const count = await prisma.issue.count();
31
+ const autocodeRoot = process.env.AUTOCODE_ROOT || join(process.cwd(), "autocode");
32
+ try {
33
+ await rm(join(autocodeRoot, "attachments"), { recursive: true, force: true });
34
+ } catch {
35
+ }
36
+ try {
37
+ await rm(join(autocodeRoot, "debug.log"), { force: true });
38
+ } catch {
39
+ }
40
+ await prisma.issue.deleteMany({});
41
+ await prisma.sequence.updateMany({
42
+ where: { name: "issue_key" },
43
+ data: { currentValue: 0 }
44
+ });
45
+ return { deleted: count };
46
+ }
47
+
48
+ const purge_post = defineEventHandler(async () => {
49
+ debug("api", "POST /api/purge");
50
+ const result = await purgeAll();
51
+ debug("api", "purge completed", { deleted: result.deleted });
52
+ return result;
53
+ });
54
+
55
+ export { purge_post as default };
56
+ //# sourceMappingURL=purge.post.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"purge.post.mjs","sources":["../../../../../server/services/purge.service.ts","../../../../../server/api/purge.post.ts"],"names":["purgeService.purgeAll"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,eAAsB,QAAA,GAAyC;AAE7D,EAAA,MAAM,KAAA,GAAQ,MAAM,MAAA,CAAO,KAAA,CAAM,KAAA,EAAM;AAEvC,EAAA,MAAM,YAAA,GAAe,QAAQ,GAAA,CAAI,aAAA,IAAiB,KAAK,OAAA,CAAQ,GAAA,IAAO,UAAU,CAAA;AAGhF,EAAA,IAAI;AACF,IAAA,MAAM,EAAA,CAAG,IAAA,CAAK,YAAA,EAAc,aAAa,CAAA,EAAG,EAAE,SAAA,EAAW,IAAA,EAAM,KAAA,EAAO,IAAA,EAAM,CAAA;AAAA,EAC9E,CAAA,CAAA,MAAQ;AAAA,EAER;AAGA,EAAA,IAAI;AACF,IAAA,MAAM,EAAA,CAAG,KAAK,YAAA,EAAc,WAAW,GAAG,EAAE,KAAA,EAAO,MAAM,CAAA;AAAA,EAC3D,CAAA,CAAA,MAAQ;AAAA,EAER;AAGA,EAAA,MAAM,MAAA,CAAO,KAAA,CAAM,UAAA,CAAW,EAAE,CAAA;AAGhC,EAAA,MAAM,MAAA,CAAO,SAAS,UAAA,CAAW;AAAA,IAC/B,KAAA,EAAO,EAAE,IAAA,EAAM,WAAA,EAAY;AAAA,IAC3B,IAAA,EAAM,EAAE,YAAA,EAAc,CAAA;AAAE,GACzB,CAAA;AAED,EAAA,OAAO,EAAE,SAAS,KAAA,EAAM;AAC1B;;ACrCA,mBAAA,mBAAA,YAAA;AACA,EAAA,KAAA,CAAA,OAAA,iBAAA,CAAA;AAEA,EAAA,MAAA,MAAA,GAAA,MAAAA,QAAA,EAAA;AACA,EAAA,KAAA,CAAA,OAAA,iBAAA,EAAA,EAAA,OAAA,EAAA,MAAA,CAAA,SAAA,CAAA;AAEA,EAAA,OAAA,MAAA;AACA,CAAA,CAAA;;;;"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autocode-cli/autocode-prod",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "dependencies": {
package/bin/autocode CHANGED
@@ -46,6 +46,7 @@ Commands:
46
46
  parent <key> [parent] Manage parent relationships
47
47
  health Check workflow health
48
48
  stats Show usage statistics
49
+ purge [--force] Purge all issues and reset sequence
49
50
  init Initialize project structure
50
51
  catalog [action] List or manage column catalog
51
52
  pipeline <action> Manage pipelines
@@ -1367,6 +1368,57 @@ function formatDuration(ms) {
1367
1368
  return (ms / 1000).toFixed(1) + 's';
1368
1369
  }
1369
1370
 
1371
+ // ============================================
1372
+ // purge - Purge all issues
1373
+ // ============================================
1374
+ async function purgeCmd() {
1375
+ const force = commandArgs.includes('--force') || commandArgs.includes('-f');
1376
+
1377
+ try {
1378
+ const API = getApiBase();
1379
+ const countRes = await fetch(`${API}/api/issues`);
1380
+ const issues = countRes.ok ? await countRes.json() : [];
1381
+ const count = issues.length;
1382
+
1383
+ if (count === 0) {
1384
+ console.log('No issues to purge');
1385
+ return;
1386
+ }
1387
+
1388
+ // Dry run mode (default)
1389
+ if (!force) {
1390
+ console.log(`\x1b[33mDry run - would delete:\x1b[0m`);
1391
+ console.log(` • ${count} issue(s) and related data`);
1392
+ console.log(` • attachments/ folder`);
1393
+ console.log(` • debug.log file`);
1394
+ console.log(` • Reset sequence to AC-000000`);
1395
+ console.log();
1396
+ console.log(`Run with \x1b[1m--force\x1b[0m to execute.`);
1397
+ return;
1398
+ }
1399
+
1400
+ // Execute purge
1401
+ const res = await fetch(`${API}/api/purge`, {
1402
+ method: 'POST',
1403
+ headers: { 'Content-Type': 'application/json' },
1404
+ });
1405
+
1406
+ if (!res.ok) {
1407
+ const err = await res.json().catch(() => ({}));
1408
+ console.error(`Failed: ${err.message || res.statusText}`);
1409
+ process.exit(1);
1410
+ }
1411
+
1412
+ const result = await res.json();
1413
+ console.log(`✓ Purged ${result.deleted} issue(s)`);
1414
+ console.log(' Sequence reset to AC-000000');
1415
+ } catch (e) {
1416
+ console.error(`Error: ${e.message}`);
1417
+ console.error('Make sure autocode server is running');
1418
+ process.exit(1);
1419
+ }
1420
+ }
1421
+
1370
1422
  // ============================================
1371
1423
  // init - Initialize project structure
1372
1424
  // ============================================
@@ -2361,6 +2413,9 @@ switch (command) {
2361
2413
  case 'stats':
2362
2414
  statsCmd();
2363
2415
  break;
2416
+ case 'purge':
2417
+ purgeCmd();
2418
+ break;
2364
2419
  case 'init':
2365
2420
  initCmd();
2366
2421
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autocode-cli/autocode",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
4
  "description": "AutoCode Dashboard - Issue tracking with web interface",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1 +0,0 @@
1
- {"id":"35ace9c2-472c-4755-ae87-74fdb84336dd","timestamp":1767711009504,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":["/"]}