@creaditor/business-ai 1.0.51 → 1.0.54
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/business-ai.es.js +44 -12
- package/dist/business-ai.umd.js +56 -51
- package/package.json +1 -1
package/dist/business-ai.es.js
CHANGED
|
@@ -23691,6 +23691,7 @@ async function IT(e) {
|
|
|
23691
23691
|
return t.json();
|
|
23692
23692
|
}
|
|
23693
23693
|
async function xT(e) {
|
|
23694
|
+
var o;
|
|
23694
23695
|
if (!e.prompt)
|
|
23695
23696
|
throw new Error("generateNewsletterV3: prompt is required");
|
|
23696
23697
|
const t = await fetch(Xn.STUDIO_NEWSLETTER_V3, {
|
|
@@ -23699,10 +23700,41 @@ async function xT(e) {
|
|
|
23699
23700
|
body: JSON.stringify(AE(e))
|
|
23700
23701
|
});
|
|
23701
23702
|
if (!t.ok) {
|
|
23702
|
-
const
|
|
23703
|
-
throw new Error(`studio newsletter v3 failed: ${t.status} ${
|
|
23703
|
+
const s = await t.text();
|
|
23704
|
+
throw new Error(`studio newsletter v3 failed: ${t.status} ${s}`);
|
|
23705
|
+
}
|
|
23706
|
+
console.log("[v3-sse] response status:", t.status, "content-type:", t.headers.get("content-type"));
|
|
23707
|
+
const n = t.body.getReader(), a = new TextDecoder();
|
|
23708
|
+
let r = "", l = null, i = 0;
|
|
23709
|
+
for (; ; ) {
|
|
23710
|
+
const { done: s, value: p } = await n.read();
|
|
23711
|
+
if (s) {
|
|
23712
|
+
console.log("[v3-sse] stream ended. total chunks:", i, "remaining buffer:", r.slice(0, 200));
|
|
23713
|
+
break;
|
|
23714
|
+
}
|
|
23715
|
+
const u = a.decode(p, { stream: !0 });
|
|
23716
|
+
console.log(`[v3-sse] chunk #${i}:`, u.slice(0, 300)), i++, r += u;
|
|
23717
|
+
const c = r.split(`
|
|
23718
|
+
|
|
23719
|
+
`);
|
|
23720
|
+
r = c.pop();
|
|
23721
|
+
for (const d of c) {
|
|
23722
|
+
const f = d.split(`
|
|
23723
|
+
`)[0];
|
|
23724
|
+
if (console.log("[v3-sse] event:", f), d.startsWith("event: done")) {
|
|
23725
|
+
const W = d.split(`
|
|
23726
|
+
data: `)[1];
|
|
23727
|
+
console.log("[v3-sse] done payload length:", W == null ? void 0 : W.length), l = JSON.parse(W);
|
|
23728
|
+
} else if (d.startsWith("event: error")) {
|
|
23729
|
+
const W = d.split(`
|
|
23730
|
+
data: `)[1];
|
|
23731
|
+
throw console.error("[v3-sse] error event:", W), new Error(JSON.parse(W).reason);
|
|
23732
|
+
}
|
|
23733
|
+
}
|
|
23704
23734
|
}
|
|
23705
|
-
|
|
23735
|
+
if (!l)
|
|
23736
|
+
throw console.error("[v3-sse] no done event received. buffer was:", r.slice(0, 500)), new Error("studio newsletter v3: stream ended without a done event");
|
|
23737
|
+
return console.log("[v3-sse] success, nodes count:", (o = l.nodes) == null ? void 0 : o.length), l;
|
|
23706
23738
|
}
|
|
23707
23739
|
function ET(e, t) {
|
|
23708
23740
|
const n = e ?? {}, a = n.accountId || n.domain || n.websiteUrl || n.website || "", r = n.theme && typeof n.theme == "object" ? n.theme : { primary: "#1b65a0", secondary: "#841d94", colors: ["#1b65a0", "#ffffff"] }, l = {
|
|
@@ -28438,15 +28470,15 @@ rb = $h.default = (0, pK.default)(/* @__PURE__ */ (0, uK.jsx)("path", {
|
|
|
28438
28470
|
}), "Refresh");
|
|
28439
28471
|
const lb = [
|
|
28440
28472
|
{ id: "authentic_text", label: "טקסט אישי", questions: [{ id: "topic", label: "נושא / תיאור קצר", inputType: "multiline" }] },
|
|
28441
|
-
{
|
|
28442
|
-
|
|
28443
|
-
|
|
28444
|
-
|
|
28445
|
-
|
|
28446
|
-
|
|
28447
|
-
|
|
28448
|
-
|
|
28449
|
-
},
|
|
28473
|
+
// {
|
|
28474
|
+
// id: "webinar",
|
|
28475
|
+
// label: "וובינר",
|
|
28476
|
+
// questions: [
|
|
28477
|
+
// { id: "date", label: "תאריך", inputType: "date" },
|
|
28478
|
+
// { id: "time", label: "שעה", inputType: "time" },
|
|
28479
|
+
// { id: "topic", label: "נושא / תיאור", inputType: "multiline" },
|
|
28480
|
+
// ],
|
|
28481
|
+
// },
|
|
28450
28482
|
{ id: "designed_mail", label: "מעוצב (מצב מהיר)", questions: [{ id: "topic", label: "נושא / תיאור קצר", inputType: "multiline" }] },
|
|
28451
28483
|
{ id: "studio_design", label: "מעוצב (סטודיו)", questions: [{ id: "topic", label: "נושא / תיאור קצר", inputType: "multiline" }] },
|
|
28452
28484
|
{ id: "designed_mail_advanced", comingSoon: !0, label: "מעצב פרו (סטודיו)", questions: [{ id: "topic", label: "נושא / תיאור קצר", inputType: "multiline" }] }
|