storyblok 4.16.5 → 4.16.7

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.mjs CHANGED
@@ -12,7 +12,7 @@ import { MultiBar, Presets } from 'cli-progress';
12
12
  import { Spinner } from '@topcli/spinner';
13
13
  import fs, { mkdir, writeFile, access, constants, readFile as readFile$1, appendFile, readdir, unlink } from 'node:fs/promises';
14
14
  import filenamify from 'filenamify';
15
- import { ManagementApiClient } from '@storyblok/management-api-client';
15
+ import { ManagementApiClient, normalizeAssetUrl } from '@storyblok/management-api-client';
16
16
  import { RateLimit, Sema } from 'async-sema';
17
17
  import { select, password, input, confirm } from '@inquirer/prompts';
18
18
  import { exec, spawn } from 'node:child_process';
@@ -8115,9 +8115,13 @@ const bloksFieldRefMapper = (data, { schemas, maps, fieldRefMappers: fieldRefMap
8115
8115
  };
8116
8116
  const assetFieldRefMapper = (data, { maps }) => {
8117
8117
  const mappedAsset = typeof data.id === "number" ? maps.assets?.get(data.id) : void 0;
8118
+ if (!mappedAsset) {
8119
+ return data;
8120
+ }
8118
8121
  return {
8119
8122
  ...data,
8120
- ...mappedAsset?.new
8123
+ ...mappedAsset.new,
8124
+ filename: normalizeAssetUrl(mappedAsset.new.filename)
8121
8125
  };
8122
8126
  };
8123
8127
  const multiassetFieldRefMapper = (data, options) => {