@minnovate/shadow-publisher 0.11.2 → 0.11.3
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.11.
|
|
4
|
+
"version": "0.11.3",
|
|
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"]
|
package/dist/publisher.cjs
CHANGED
|
@@ -102,6 +102,11 @@ var ERROR_CODES = [
|
|
|
102
102
|
// meets it is an older client calling this route directly, and can say "upgrade" rather than
|
|
103
103
|
// "you may not".
|
|
104
104
|
"APPLICATION_REQUIRED",
|
|
105
|
+
// The subject can read the repository and the route needs admin. Its own code rather than
|
|
106
|
+
// FORBIDDEN: the portal tells "this person does not administer it" from "the portal was refused"
|
|
107
|
+
// (a delegation the service would not take), and before this code it could only compare the
|
|
108
|
+
// English message. A client that does not know it reads the 403 as FORBIDDEN, as it did before.
|
|
109
|
+
"ADMIN_REQUIRED",
|
|
105
110
|
// repositories
|
|
106
111
|
"REPOSITORY_NOT_FOUND",
|
|
107
112
|
"REPOSITORY_CONFLICT",
|
|
@@ -145,6 +150,7 @@ var HTTP_STATUS_FOR_CODE = {
|
|
|
145
150
|
REF_FORBIDDEN: 403,
|
|
146
151
|
ORGANISATION_REQUIRED: 403,
|
|
147
152
|
APPLICATION_REQUIRED: 403,
|
|
153
|
+
ADMIN_REQUIRED: 403,
|
|
148
154
|
REPOSITORY_NOT_FOUND: 404,
|
|
149
155
|
REPOSITORY_CONFLICT: 409,
|
|
150
156
|
REPOSITORY_ARCHIVED: 409,
|
|
@@ -6706,6 +6712,13 @@ function replacedLine(t) {
|
|
|
6706
6712
|
return t.replaced === null ? null : `note: the temporary directory ${t.replaced.path} ${t.replaced.reason}; using ${t.path} instead`;
|
|
6707
6713
|
}
|
|
6708
6714
|
|
|
6715
|
+
// src/exit-code.ts
|
|
6716
|
+
function exitCodeFor(code) {
|
|
6717
|
+
if (code === "UNAUTHORIZED" || code === "FORBIDDEN" || code === "ADMIN_REQUIRED") return 4;
|
|
6718
|
+
if (code === "OUTCOME_UNKNOWN" || code === "NETWORK" || code === "UNAVAILABLE") return 3;
|
|
6719
|
+
return 1;
|
|
6720
|
+
}
|
|
6721
|
+
|
|
6709
6722
|
// src/main.ts
|
|
6710
6723
|
var USAGE = `publisher \u2014 publish an app's Git history to the serverless Git backend
|
|
6711
6724
|
|
|
@@ -7212,7 +7225,7 @@ main(process.argv.slice(2)).then(
|
|
|
7212
7225
|
const hint = e.code === "NETWORK" ? `
|
|
7213
7226
|
if this folder's service moved, "publisher doctor" says where to` : "";
|
|
7214
7227
|
process.stdout.write((json ? JSON.stringify(payload) : `error [${e.code}]: ${e.message}${hint}`) + "\n");
|
|
7215
|
-
process.exit(e.code
|
|
7228
|
+
process.exit(exitCodeFor(e.code));
|
|
7216
7229
|
}
|
|
7217
7230
|
process.stdout.write(
|
|
7218
7231
|
(json ? JSON.stringify({ error: { code: "INTERNAL", message: String(e?.message ?? e) } }) : `error: ${String(e?.message ?? e)}`) + "\n"
|