@minnovate/shadow-publisher 0.18.3 → 0.18.4

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "git-publisher",
3
3
  "displayName": "Git Publisher",
4
- "version": "0.18.3",
4
+ "version": "0.18.4",
5
5
  "description": "Publish an app folder's Git history to the serverless Git publishing backend and keep it updated (\"publish my app\", \"update my app\", \"fetch the engineered version\").",
6
6
  "author": { "name": "git-publisher project" },
7
7
  "keywords": ["git", "publish", "deploy", "serverless"]
@@ -21686,7 +21686,7 @@ var getApiTerminalRepositoriesPreparation = {
21686
21686
  }).nullable().optional(),
21687
21687
  canRetry: external_exports.boolean().optional(),
21688
21688
  answerable: external_exports.boolean().optional()
21689
- })
21689
+ }).nullable()
21690
21690
  }
21691
21691
  };
21692
21692
  var postApiTerminalRepositoriesPreparation = {
@@ -21781,7 +21781,7 @@ async function askOnce(fetchImpl, url2, token, body) {
21781
21781
  });
21782
21782
  const text = await res.text();
21783
21783
  try {
21784
- return { status: res.status, body: text ? JSON.parse(text) : null };
21784
+ return { status: res.status, body: text ? JSON.parse(text) : void 0 };
21785
21785
  } catch {
21786
21786
  return { status: res.status, body: void 0 };
21787
21787
  }
@@ -22239,7 +22239,7 @@ var RUN_PROGRESS = "run-progress";
22239
22239
 
22240
22240
  // ../client/src/clients/applications/preparation.ts
22241
22241
  var PREPARATION = "preparation";
22242
- var View = getApiTerminalRepositoriesPreparation.answers[200];
22242
+ var View = getApiTerminalRepositoriesPreparation.answers[200].unwrap();
22243
22243
  var MAX_FINDINGS = 10;
22244
22244
  var MAX_TEXT = 500;
22245
22245
  function readPreparation(input2, opts) {
@@ -22267,6 +22267,9 @@ async function call(input2, opts, body) {
22267
22267
  return refusalCode(answer2.body) === "no-such-application" ? { kind: "no-application" } : { kind: "unavailable", detail: "the portal does not serve this address" };
22268
22268
  }
22269
22269
  if (answer2.status === 200) {
22270
+ if (answer2.body === null && body === void 0) {
22271
+ return { kind: "nothing-prepared" };
22272
+ }
22270
22273
  const view = readView(answer2.body);
22271
22274
  return "detail" in view ? { kind: "malformed", detail: view.detail } : { kind: "view", view };
22272
22275
  }
@@ -24688,6 +24691,7 @@ function folderFor(name) {
24688
24691
  }
24689
24692
 
24690
24693
  // src/commands/question.ts
24694
+ var NOTHING_PREPARED = "nothing is being prepared for this app";
24691
24695
  async function questionAt(p, endpoint, repoId, opts = {}) {
24692
24696
  const at = await portalAt(endpoint, opts);
24693
24697
  if ("reason" in at) {
@@ -24702,6 +24706,9 @@ async function answerAt(p, endpoint, repoId, specs, opts = {}) {
24702
24706
  return at;
24703
24707
  }
24704
24708
  const read2 = shown(at.portal, await p.readPreparation({ portal: at.portal, repoId }), REFUSED2.read);
24709
+ if (read2.kind === "nothing-prepared") {
24710
+ throw new PublisherError("LOCAL_STATE", `nothing is waiting for an answer (${NOTHING_PREPARED})`);
24711
+ }
24705
24712
  if (read2.kind !== "view") {
24706
24713
  return read2;
24707
24714
  }
@@ -24724,6 +24731,9 @@ async function answerAt(p, endpoint, repoId, specs, opts = {}) {
24724
24731
  }
24725
24732
  async function retryAt(p, endpoint, repoId, opts = {}) {
24726
24733
  const read2 = await questionAt(p, endpoint, repoId, opts);
24734
+ if (read2.kind === "nothing-prepared") {
24735
+ throw new PublisherError("LOCAL_STATE", `nothing to try again (${NOTHING_PREPARED})`);
24736
+ }
24727
24737
  if (read2.kind !== "view") {
24728
24738
  return read2;
24729
24739
  }
@@ -24777,6 +24787,8 @@ function shown(portal, r, refused) {
24777
24787
  const { questions, ...preparation } = r.view;
24778
24788
  return { kind: "view", portal, preparation, questions, hint: hintFor(r.view) };
24779
24789
  }
24790
+ case "nothing-prepared":
24791
+ return { kind: "nothing-prepared", portal, hint: "Nothing is being prepared for this app, so nothing is waiting for an answer." };
24780
24792
  case "no-application":
24781
24793
  throw new PublisherError("NOT_FOUND", "this repository has no application in your organization yet; publish it first");
24782
24794
  case "moved-on":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minnovate/shadow-publisher",
3
- "version": "0.18.3",
3
+ "version": "0.18.4",
4
4
  "description": "publisher: publish an app's Git history to the serverless Git backend",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",