@attraccess/plugin-rabbitmq 0.2.0-nightly.1197.2 → 0.2.0-nightly.1200.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.
@@ -15,10 +15,20 @@ var PluginApiError = class extends Error {
15
15
  this.name = "PluginApiError";
16
16
  }
17
17
  };
18
+ /**
19
+ * Joins validation messages into one text. Messages that already end a sentence are separated by a space, so
20
+ * "The URL is too long." and "The token is short." never become "long., token".
21
+ */
22
+ function joinErrorMessages(parts) {
23
+ return parts.map((part) => part.trim()).filter(Boolean).reduce((joined, part) => {
24
+ if (joined === "") return part;
25
+ return /[.!?]$/.test(joined) ? `${joined} ${part}` : `${joined}, ${part}`;
26
+ }, "");
27
+ }
18
28
  async function toError(res) {
19
29
  try {
20
30
  const body = await res.json();
21
- const message = Array.isArray(body.message) ? body.message.join(", ") : body.message;
31
+ const message = Array.isArray(body.message) ? joinErrorMessages(body.message) : body.message;
22
32
  if (message) return new PluginApiError(message, res.status);
23
33
  } catch {}
24
34
  return new PluginApiError(`Request failed (HTTP ${res.status}).`, res.status);
@@ -8,7 +8,7 @@ var exportSet = /* @__PURE__ */ new Set([
8
8
  ]);
9
9
  var moduleMap = { "./plugin": () => {
10
10
  dynamicLoadingCss(["style.css"], false, "./plugin");
11
- return __federation_import("./__federation_expose_Plugin--VB44ZV_.js").then((module) => Object.keys(module).every((item) => exportSet.has(item)) ? () => module.default : () => module);
11
+ return __federation_import("./__federation_expose_Plugin-L2rsPs-d.js").then((module) => Object.keys(module).every((item) => exportSet.has(item)) ? () => module.default : () => module);
12
12
  } };
13
13
  var seen = {};
14
14
  var dynamicLoadingCss = (cssFilePaths, dontAppendStylesToHead, exposeItemName) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attraccess/plugin-rabbitmq",
3
- "version": "0.2.0-nightly.1197.2",
3
+ "version": "0.2.0-nightly.1200.1",
4
4
  "description": "Official Attraccess integration for RabbitMQ.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "repository": {
@@ -40,7 +40,7 @@
40
40
  "backend": "^2.0.0-0",
41
41
  "frontend": "^2.0.0-0"
42
42
  },
43
- "publishedCommit": "2080d34f3b92ed143ac355d5928ec9ec1e0d1cdd"
43
+ "publishedCommit": "45e93faeec0f3dce84926e2dc8900084875478a9"
44
44
  },
45
- "gitHead": "2080d34f3b92ed143ac355d5928ec9ec1e0d1cdd"
45
+ "gitHead": "45e93faeec0f3dce84926e2dc8900084875478a9"
46
46
  }