vibes-diy 14.3.392 → 14.3.393
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.
|
@@ -245548,6 +245548,7 @@ var defaultHttpHeaders = Lazy(
|
|
|
245548
245548
|
init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process();
|
|
245549
245549
|
init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console();
|
|
245550
245550
|
init_performance2();
|
|
245551
|
+
init_esm();
|
|
245551
245552
|
var LINQ_BASE_URL = "https://api.linqapp.com/api/partner/v3";
|
|
245552
245553
|
var TERMINAL_CODES = /* @__PURE__ */ new Set([2026, 4005, 2011, 2012, 2014, 2033]);
|
|
245553
245554
|
function classifyLinqError(status, code2) {
|
|
@@ -245559,7 +245560,8 @@ function classifyLinqError(status, code2) {
|
|
|
245559
245560
|
}
|
|
245560
245561
|
__name(classifyLinqError, "classifyLinqError");
|
|
245561
245562
|
function wirePart(p3) {
|
|
245562
|
-
if (p3.type !== "text")
|
|
245563
|
+
if (p3.type !== "text")
|
|
245564
|
+
return "attachmentId" in p3 ? { type: p3.type, attachment_id: p3.attachmentId } : { type: p3.type, url: p3.url };
|
|
245563
245565
|
const decorations = p3.textDecorations ?? [];
|
|
245564
245566
|
return {
|
|
245565
245567
|
type: "text",
|
|
@@ -245777,6 +245779,34 @@ function createLinqClient(opts) {
|
|
|
245777
245779
|
body: { voice_memo_url: a4.voiceMemoUrl, ...a4.overrideOptout ? { override_optout: true } : {} },
|
|
245778
245780
|
map: /* @__PURE__ */ __name((j3) => ({ messageId: j3.voice_memo?.id ?? j3.message?.id }), "map")
|
|
245779
245781
|
}), "sendVoiceMemo"),
|
|
245782
|
+
async uploadAttachment(a4) {
|
|
245783
|
+
const slot = await call2({
|
|
245784
|
+
method: "POST",
|
|
245785
|
+
path: "/attachments",
|
|
245786
|
+
body: { filename: a4.filename, content_type: a4.contentType, size_bytes: a4.bytes.byteLength },
|
|
245787
|
+
map: /* @__PURE__ */ __name((j3) => ({
|
|
245788
|
+
attachmentId: j3.attachment_id,
|
|
245789
|
+
uploadUrl: j3.upload_url,
|
|
245790
|
+
method: j3.http_method ?? "PUT",
|
|
245791
|
+
headers: j3.required_headers ?? {}
|
|
245792
|
+
}), "map")
|
|
245793
|
+
});
|
|
245794
|
+
if (!slot.ok) return slot;
|
|
245795
|
+
const { attachmentId, uploadUrl, method, headers } = slot.value;
|
|
245796
|
+
if (typeof attachmentId !== "string" || typeof uploadUrl !== "string") return { ok: false, kind: "retry", status: 0 };
|
|
245797
|
+
const put2 = Object.fromEntries(Object.entries(headers).filter(([k4]) => k4.toLowerCase() !== "content-length"));
|
|
245798
|
+
const signal = AbortSignal.timeout(timeoutMs);
|
|
245799
|
+
const doFetch = opts.fetch ?? fetch.bind(globalThis);
|
|
245800
|
+
const rPut = await exception2Result(async () => {
|
|
245801
|
+
const res = await untilAborted(doFetch(uploadUrl, { method, headers: put2, body: a4.bytes, signal }), signal);
|
|
245802
|
+
await exception2Result(() => untilAborted(res.arrayBuffer(), signal));
|
|
245803
|
+
return res.status;
|
|
245804
|
+
});
|
|
245805
|
+
if (rPut.isErr()) return { ok: false, kind: "retry", status: 0 };
|
|
245806
|
+
const status = rPut.Ok();
|
|
245807
|
+
if (status < 200 || status >= 300) return { ok: false, kind: status >= 500 || status === 429 ? "retry" : "terminal", status };
|
|
245808
|
+
return { ok: true, value: { attachmentId } };
|
|
245809
|
+
},
|
|
245780
245810
|
markRead: /* @__PURE__ */ __name((chatId) => call2({ method: "POST", path: `/chats/${encodeURIComponent(chatId)}/read`, body: void 0, map: none2 }), "markRead"),
|
|
245781
245811
|
typing: /* @__PURE__ */ __name((chatId, on4) => call2({
|
|
245782
245812
|
method: on4 ? "POST" : "DELETE",
|