@apilift/cli 1.5.6 → 1.5.7

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/apilift.js CHANGED
@@ -30650,7 +30650,22 @@ var init_drafts = __esm({
30650
30650
  if (!next) break;
30651
30651
  this.discard(sessionId);
30652
30652
  }
30653
- this.state.db.prepare("DELETE FROM discovery_session WHERE session_id=?").run(sessionId);
30653
+ this.state.db.exec("BEGIN IMMEDIATE");
30654
+ try {
30655
+ this.state.db.prepare("DELETE FROM discovery_session WHERE session_id=?").run(sessionId);
30656
+ if (this.hasTable("selected_discovery_research")) this.state.db.prepare("DELETE FROM selected_discovery_research WHERE session_id=?").run(sessionId);
30657
+ if (this.hasTable("discovery_research") && !this.state.db.prepare("SELECT 1 FROM discovery_session WHERE app_slug=? LIMIT 1").get(current.appSlug)) {
30658
+ for (const row of this.state.db.prepare("SELECT file_path FROM discovery_research WHERE app_slug=?").all(current.appSlug)) {
30659
+ this.state.db.prepare("INSERT INTO discovery_cleanup (draft_id,file_path,paths_json,scope_id) VALUES (?,?,?,NULL)").run(randomUUID3(), row.file_path, JSON.stringify([row.file_path]));
30660
+ }
30661
+ if (this.hasTable("selected_discovery_research")) this.state.db.prepare("DELETE FROM selected_discovery_research WHERE app_slug=?").run(current.appSlug);
30662
+ this.state.db.prepare("DELETE FROM discovery_research WHERE app_slug=?").run(current.appSlug);
30663
+ }
30664
+ this.state.db.exec("COMMIT");
30665
+ } catch (error62) {
30666
+ this.state.db.exec("ROLLBACK");
30667
+ throw error62;
30668
+ }
30654
30669
  return current;
30655
30670
  }
30656
30671
  retained(appSlug) {
@@ -34377,6 +34392,8 @@ function handleResearch(invocation, state, store, session, root) {
34377
34392
  return fail5(`${error62 instanceof Error ? error62.message : "Invalid research scope"}.
34378
34393
  `);
34379
34394
  }
34395
+ if (state.db.prepare("SELECT 1 FROM discovery_cleanup WHERE file_path=?").get(path2)) return fail5(`Research cleanup is pending. Finish it with ${command4(invocation, "discover close")} before reopening this assessment.
34396
+ `, 12);
34380
34397
  mkdirSync9(dirname6(path2), { recursive: true, mode: 448 });
34381
34398
  if (!existsSync4(path2)) writeFileSync8(path2, `// Record a focused check of official operation and access documentation.
34382
34399
  ${JSON.stringify({ scope: scope2, conclusion: "pending", findings: "", sources: [{ kind: "operation", url: "", finding: "" }, { kind: "access", url: "", finding: "" }] }, null, 2)}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apilift",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "description": "Use logged-in apps and discover missing actions with Apilift.",
5
5
  "author": {
6
6
  "name": "Apilift"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apilift",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "description": "Use logged-in apps and discover missing actions with Apilift.",
5
5
  "author": {
6
6
  "name": "Apilift"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apilift/cli",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {
@@ -36,7 +36,7 @@
36
36
  "engines": {
37
37
  "node": ">=24.16.0 <27"
38
38
  },
39
- "gitHead": "96ed48a06d2c8cb1e147eada2a56b2e5f4f8cb92",
39
+ "gitHead": "ef64dc7015807fd042d91b7f6b0c9f880f05103f",
40
40
  "repository": {
41
41
  "type": "git",
42
42
  "url": "git+https://github.com/egor-sergeev/apilift.git",