storyblok 3.35.2 → 3.36.1
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.mjs +13 -3
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -1645,15 +1645,25 @@ const SyncSpaces = {
|
|
|
1645
1645
|
},
|
|
1646
1646
|
async syncFolders() {
|
|
1647
1647
|
console.log(chalk.green("\u2713") + " Syncing folders...");
|
|
1648
|
-
const
|
|
1648
|
+
const sourceFolderParams = {
|
|
1649
1649
|
folder_only: 1,
|
|
1650
1650
|
sort_by: "slug:asc"
|
|
1651
|
-
}
|
|
1651
|
+
};
|
|
1652
|
+
if (this.startsWith) {
|
|
1653
|
+
sourceFolderParams.starts_with = this.startsWith;
|
|
1654
|
+
}
|
|
1655
|
+
const sourceFolders = await this.client.getAll(`spaces/${this.sourceSpaceId}/stories`, sourceFolderParams);
|
|
1652
1656
|
const syncedFolders = {};
|
|
1653
1657
|
for (const folder of sourceFolders) {
|
|
1654
1658
|
try {
|
|
1659
|
+
const targetFolderParams = {
|
|
1660
|
+
with_slug: folder.full_slug
|
|
1661
|
+
};
|
|
1662
|
+
if (this.startsWith) {
|
|
1663
|
+
targetFolderParams.starts_with = this.startsWith;
|
|
1664
|
+
}
|
|
1655
1665
|
const folderResult = await this.client.get(`spaces/${this.sourceSpaceId}/stories/${folder.id}`);
|
|
1656
|
-
const { data } = await this.client.get(`spaces/${this.targetSpaceId}/stories`,
|
|
1666
|
+
const { data } = await this.client.get(`spaces/${this.targetSpaceId}/stories`, targetFolderParams);
|
|
1657
1667
|
const existingFolder = data.stories[0] || null;
|
|
1658
1668
|
const folderData = await this.getStoryWithTranslatedSlugs(folderResult.data.story, existingFolder);
|
|
1659
1669
|
delete folderData.id;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "storyblok",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.36.1",
|
|
4
4
|
"description": "A simple CLI to start Storyblok from your command line.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@storyblok/region-helper": "^1.0.0",
|
|
35
|
-
"axios": "^0.
|
|
35
|
+
"axios": "^0.30.0",
|
|
36
36
|
"chalk": "^4.1.0",
|
|
37
37
|
"clear": "0.1.0",
|
|
38
38
|
"commander": "^5.1.0",
|