@plentymarkets/shop-core 1.13.8 → 1.13.9
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/module.d.mts +0 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +3 -4
- package/package.json +1 -1
package/dist/module.d.mts
CHANGED
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -4,13 +4,12 @@ import { mkdir, writeFile } from 'fs/promises';
|
|
|
4
4
|
import { join } from 'path';
|
|
5
5
|
import { existsSync } from 'fs';
|
|
6
6
|
|
|
7
|
-
const fetchAllTranslations = async (url, configId
|
|
7
|
+
const fetchAllTranslations = async (url, configId) => {
|
|
8
8
|
return await ofetch(
|
|
9
9
|
`${url}/rest/storefront/translations/${configId}/complete`,
|
|
10
10
|
{
|
|
11
11
|
method: "GET",
|
|
12
12
|
headers: {
|
|
13
|
-
"X-Security-Token": securityToken,
|
|
14
13
|
"Content-Type": "application/json"
|
|
15
14
|
}
|
|
16
15
|
}
|
|
@@ -39,9 +38,9 @@ const module$1 = defineNuxtModule({
|
|
|
39
38
|
if (!existsSync(overridesDir)) {
|
|
40
39
|
await mkdir(overridesDir, { recursive: true });
|
|
41
40
|
}
|
|
42
|
-
if (_options.apiEndpoint && _options.configId
|
|
41
|
+
if (_options.apiEndpoint && _options.configId) {
|
|
43
42
|
try {
|
|
44
|
-
const { data } = await fetchAllTranslations(_options.apiEndpoint, _options.configId
|
|
43
|
+
const { data } = await fetchAllTranslations(_options.apiEndpoint, _options.configId);
|
|
45
44
|
for (const key of Object.keys(data)) {
|
|
46
45
|
allLocalesForOverride.push(key);
|
|
47
46
|
await writeFile(join(overridesDir, `${key}.json`), JSON.stringify({ translated: data[key] }, null, 2));
|