@blockrun/clawrouter 0.11.3 → 0.11.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.
package/dist/cli.js CHANGED
@@ -4792,18 +4792,18 @@ async function uploadDataUriToHost(dataUri) {
4792
4792
  const buffer = Buffer.from(b64Data, "base64");
4793
4793
  const blob = new Blob([buffer], { type: mimeType });
4794
4794
  const form = new FormData();
4795
- form.append("file", blob, `image.${ext}`);
4796
- const resp = await fetch("https://telegra.ph/upload", {
4795
+ form.append("reqtype", "fileupload");
4796
+ form.append("fileToUpload", blob, `image.${ext}`);
4797
+ const resp = await fetch("https://catbox.moe/user/api.php", {
4797
4798
  method: "POST",
4798
4799
  body: form
4799
4800
  });
4800
- if (!resp.ok) throw new Error(`telegra.ph upload failed: HTTP ${resp.status}`);
4801
- const result = await resp.json();
4802
- if (Array.isArray(result) && result[0]?.src) {
4803
- return `https://telegra.ph${result[0].src}`;
4801
+ if (!resp.ok) throw new Error(`catbox.moe upload failed: HTTP ${resp.status}`);
4802
+ const result = await resp.text();
4803
+ if (result.startsWith("https://")) {
4804
+ return result.trim();
4804
4805
  }
4805
- const errMsg = !Array.isArray(result) && result.error ? result.error : "unknown error";
4806
- throw new Error(`telegra.ph upload failed: ${errMsg}`);
4806
+ throw new Error(`catbox.moe upload failed: ${result}`);
4807
4807
  }
4808
4808
  async function startProxy(options) {
4809
4809
  const apiBase = options.apiBase ?? BLOCKRUN_API;