@vibedropio/publisher 0.24.2 → 0.25.1

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.24.2",
4
+ "version": "0.25.1",
5
5
  "description": "Publish an app folder to the platform and keep it updated (\"publish my app\", \"update my app\", \"fetch the engineered version\").",
6
6
  "author": { "name": "VibeDrop" },
7
7
  "keywords": ["git", "publish", "deploy", "serverless"]
@@ -22096,7 +22096,7 @@ var Transport = class {
22096
22096
  return { status: res.status, body: parsed, headers: res.headers };
22097
22097
  }
22098
22098
  const err = parsed?.error;
22099
- const code = err && ERROR_CODES.includes(err.code) ? err.code : fallbackCode(res.status);
22099
+ const code = codeOf(err?.code, res.status);
22100
22100
  throw new PublisherError(code, err?.message ?? `HTTP ${res.status}`, {
22101
22101
  isRetryable: err?.isRetryable ?? (res.status === 429 || res.status >= 500),
22102
22102
  httpStatus: res.status,
@@ -22108,6 +22108,23 @@ var Transport = class {
22108
22108
  }
22109
22109
  }
22110
22110
  };
22111
+ var PLATFORM_CODES = {
22112
+ "no-such-route": "NOT_FOUND",
22113
+ "method-not-allowed": "METHOD_NOT_ALLOWED",
22114
+ "body-too-large": "LIMIT_EXCEEDED",
22115
+ "bad-request": "INVALID_REQUEST",
22116
+ unauthorized: "UNAUTHORIZED",
22117
+ forbidden: "FORBIDDEN",
22118
+ "workspace-required": "WORKSPACE_REQUIRED",
22119
+ unavailable: "UNAVAILABLE",
22120
+ misconfigured: "UNAVAILABLE"
22121
+ };
22122
+ function codeOf(sent, status2) {
22123
+ if (sent !== void 0 && ERROR_CODES.includes(sent)) {
22124
+ return sent;
22125
+ }
22126
+ return (sent !== void 0 && Object.hasOwn(PLATFORM_CODES, sent) ? PLATFORM_CODES[sent] : void 0) ?? fallbackCode(status2);
22127
+ }
22111
22128
  function fallbackCode(status2) {
22112
22129
  if (status2 === 401) {
22113
22130
  return "UNAUTHORIZED";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibedropio/publisher",
3
- "version": "0.24.2",
3
+ "version": "0.25.1",
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",