@bettercms-ai/sdk 1.20.0 → 1.21.0
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 +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +103 -13
- package/dist/index.d.ts +103 -13
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -639,12 +639,13 @@ async function updateModel(client, id, input) {
|
|
|
639
639
|
);
|
|
640
640
|
return res.data;
|
|
641
641
|
}
|
|
642
|
+
var withWarnings = (res) => res.warnings?.length ? { ...res.data, warnings: res.warnings } : res.data;
|
|
642
643
|
async function createEntry(client, input) {
|
|
643
644
|
const res = await client.fetchJSON(
|
|
644
645
|
client.url("/management/content/entries"),
|
|
645
646
|
{ method: "POST", body: JSON.stringify(input) }
|
|
646
647
|
);
|
|
647
|
-
return res
|
|
648
|
+
return withWarnings(res);
|
|
648
649
|
}
|
|
649
650
|
async function updateEntry(client, id, input, opts) {
|
|
650
651
|
const headers = {};
|
|
@@ -653,7 +654,7 @@ async function updateEntry(client, id, input, opts) {
|
|
|
653
654
|
client.url(`/management/content/entries/${id}`),
|
|
654
655
|
{ method: "PATCH", body: JSON.stringify(input), headers }
|
|
655
656
|
);
|
|
656
|
-
return res
|
|
657
|
+
return withWarnings(res);
|
|
657
658
|
}
|
|
658
659
|
async function deleteManagedPage(client, id) {
|
|
659
660
|
const res = await client.fetchJSON(
|