storyblok 3.35.1 → 3.36.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.
Files changed (2) hide show
  1. package/dist/cli.mjs +13 -3
  2. package/package.json +3 -3
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 sourceFolders = await this.client.getAll(`spaces/${this.sourceSpaceId}/stories`, {
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`, { with_slug: folder.full_slug });
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.35.1",
3
+ "version": "3.36.0",
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.27.2",
35
+ "axios": "^0.29.0",
36
36
  "chalk": "^4.1.0",
37
37
  "clear": "0.1.0",
38
38
  "commander": "^5.1.0",
@@ -40,7 +40,7 @@
40
40
  "figlet": "^1.5.0",
41
41
  "form-data": "^3.0.0",
42
42
  "fs-extra": "^9.0.1",
43
- "git-clone": "^0.1.0",
43
+ "git-clone": "^0.2.0",
44
44
  "inquirer": "^7.3.2",
45
45
  "json-schema-to-typescript": "^13.1.2",
46
46
  "lodash": "^4.17.21",