@bettercms-ai/sdk 1.13.1 → 1.13.2
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/index.cjs +18 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -38,6 +38,7 @@ __export(index_exports, {
|
|
|
38
38
|
BetterCMSError: () => BetterCMSError,
|
|
39
39
|
BetterCMSManagementClient: () => BetterCMSManagementClient,
|
|
40
40
|
ErrorCodes: () => ErrorCodes,
|
|
41
|
+
PORTABLE_TEXT_FORMAT: () => PORTABLE_TEXT_FORMAT,
|
|
41
42
|
addModelFields: () => addModelFields,
|
|
42
43
|
addPageFields: () => addPageFields,
|
|
43
44
|
asStringArray: () => asStringArray,
|
|
@@ -87,6 +88,7 @@ __export(index_exports, {
|
|
|
87
88
|
listSubmissions: () => listSubmissions,
|
|
88
89
|
listWorkspaces: () => listWorkspaces,
|
|
89
90
|
plain: () => plain,
|
|
91
|
+
portableText: () => portableText,
|
|
90
92
|
publishPage: () => publishPage,
|
|
91
93
|
regenerateApiKey: () => regenerateApiKey,
|
|
92
94
|
removeMember: () => removeMember,
|
|
@@ -624,7 +626,14 @@ var MIME_BY_EXT = {
|
|
|
624
626
|
avif: "image/avif",
|
|
625
627
|
mp4: "video/mp4",
|
|
626
628
|
webm: "video/webm",
|
|
627
|
-
pdf: "application/pdf"
|
|
629
|
+
pdf: "application/pdf",
|
|
630
|
+
// mp3/ogg were server-allowed all along; the SDK sent application/octet-stream for them,
|
|
631
|
+
// which the allowlist then refused — so an agent could never upload audio.
|
|
632
|
+
mp3: "audio/mpeg",
|
|
633
|
+
ogg: "audio/ogg",
|
|
634
|
+
txt: "text/plain",
|
|
635
|
+
md: "text/markdown",
|
|
636
|
+
markdown: "text/markdown"
|
|
628
637
|
};
|
|
629
638
|
function basenameOf(p) {
|
|
630
639
|
const clean = p.split(/[?#]/)[0] ?? p;
|
|
@@ -1340,6 +1349,12 @@ function stripStega(value) {
|
|
|
1340
1349
|
}
|
|
1341
1350
|
|
|
1342
1351
|
// src/richtext.ts
|
|
1352
|
+
var PORTABLE_TEXT_FORMAT = "portable-text-1";
|
|
1353
|
+
function portableText(value) {
|
|
1354
|
+
if (!isRichText(value)) return null;
|
|
1355
|
+
const v = value;
|
|
1356
|
+
return v.format === PORTABLE_TEXT_FORMAT && Array.isArray(v.value) ? v.value : null;
|
|
1357
|
+
}
|
|
1343
1358
|
function isRichText(value) {
|
|
1344
1359
|
return typeof value === "object" && value !== null && !Array.isArray(value) && ("html" in value || "format" in value);
|
|
1345
1360
|
}
|
|
@@ -1728,6 +1743,7 @@ var import_types = require("@bettercms-ai/types");
|
|
|
1728
1743
|
BetterCMSError,
|
|
1729
1744
|
BetterCMSManagementClient,
|
|
1730
1745
|
ErrorCodes,
|
|
1746
|
+
PORTABLE_TEXT_FORMAT,
|
|
1731
1747
|
addModelFields,
|
|
1732
1748
|
addPageFields,
|
|
1733
1749
|
asStringArray,
|
|
@@ -1777,6 +1793,7 @@ var import_types = require("@bettercms-ai/types");
|
|
|
1777
1793
|
listSubmissions,
|
|
1778
1794
|
listWorkspaces,
|
|
1779
1795
|
plain,
|
|
1796
|
+
portableText,
|
|
1780
1797
|
publishPage,
|
|
1781
1798
|
regenerateApiKey,
|
|
1782
1799
|
removeMember,
|