Socket
Socket
Sign inDemoInstall

@talend/i18n-scripts

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@talend/i18n-scripts - npm Package Compare versions

Comparing version 2.2.1 to 2.3.0

54

common/xtm.js

@@ -114,2 +114,55 @@ /* eslint-disable no-param-reassign */

function getFileGenerationStatus(data, iteration) {
const { project } = data;
const xtm = getXTMVariables();
printRunning(`Check generated files...`);
return fetch(
`${xtm.apiUrl}/projects/${project.id}/files/status?fileScope=PROJECT&fileType=TARGET`,
{
headers: { Authorization: `XTM-Basic ${xtm.token}` },
},
)
.then(handleError)
.then((res) => res.json())
.then((res) => {
printInfo(JSON.stringify(res));
const status = res.some(({ status }) => status === 'IN_PROGRESS')
? 'IN_PROGRESS'
: 'FINISHED';
if (status === 'IN_PROGRESS') {
printInfo(`Generation status: still in progress, retry in 3s`);
return new Promise((resolve) => {
setTimeout(() => {
resolve(getFileGenerationStatus(data, iteration + 1));
}, 3000);
});
}
printInfo(`Generation status: ${status}`);
});
}
function waitForFilesGeneration(data) {
return getFileGenerationStatus(data, 0);
}
function generateTargetFiles(data) {
const { project } = data;
const xtm = getXTMVariables();
const formData = new FormData();
formData.append('fileType', 'TARGET');
printRunning(`Generate target files...`);
return fetch(`${xtm.apiUrl}/projects/${project.id}/files/generate`, {
method: 'POST',
headers: { Authorization: `XTM-Basic ${xtm.token}` },
body: formData,
})
.then(handleError)
.then((res) => res.json())
.then(() => waitForFilesGeneration(data))
.then(() => data);
}
function getFilesToDownload(data) {

@@ -285,2 +338,3 @@ const { project, version } = data;

downloadFiles,
generateTargetFiles,
getFilesToDownload,

@@ -287,0 +341,0 @@ getProject,

2

package.json
{
"name": "@talend/i18n-scripts",
"description": "Set of scripts to ease i18n workflow",
"version": "2.2.1",
"version": "2.3.0",
"license": "Apache-2.0",

@@ -6,0 +6,0 @@ "main": "index.js",

@@ -6,3 +6,8 @@ const fs = require('fs');

const rimraf = require('rimraf');
const { getFilesToDownload, getProject, downloadFiles } = require('../common/xtm');
const {
generateTargetFiles,
getFilesToDownload,
getProject,
downloadFiles,
} = require('../common/xtm');
const error = require('../common/error');

@@ -81,2 +86,3 @@ const { printRunning, printSection, printSuccess } = require('../common/log');

.then(getFilesToDownload)
.then(generateTargetFiles)
.then(downloadFiles)

@@ -83,0 +89,0 @@ .then(unzip)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc