@crowdin/app-project-module 0.23.3 → 0.23.5
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/out/util/cron.js +9 -3
- package/out/util/defaults.js +4 -7
- package/package.json +1 -1
package/out/util/cron.js
CHANGED
|
@@ -34,6 +34,12 @@ const _1 = require(".");
|
|
|
34
34
|
const storage_1 = require("../storage");
|
|
35
35
|
const connection_1 = require("./connection");
|
|
36
36
|
const defaults_1 = require("./defaults");
|
|
37
|
+
var SyncCondition;
|
|
38
|
+
(function (SyncCondition) {
|
|
39
|
+
SyncCondition["ALL"] = "0";
|
|
40
|
+
SyncCondition["TRANSLATED"] = "1";
|
|
41
|
+
SyncCondition["APPROVED"] = "2";
|
|
42
|
+
})(SyncCondition || (SyncCondition = {}));
|
|
37
43
|
function runJob(config, integration, job) {
|
|
38
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
45
|
(0, _1.log)(`Starting cron job with expression [${job.expression}]`, config.logger);
|
|
@@ -90,9 +96,9 @@ function filesCron(config, integration, period) {
|
|
|
90
96
|
const rootFolder = yield (0, defaults_1.getRootFolder)(config, integration, crowdinClient, projectId);
|
|
91
97
|
if (syncSettings.provider === 'crowdin') {
|
|
92
98
|
const crowdinFiles = files;
|
|
93
|
-
const onlyTranslated = intConfig.condition ===
|
|
94
|
-
const onlyApproved = intConfig.condition ===
|
|
95
|
-
const all = intConfig.condition ===
|
|
99
|
+
const onlyTranslated = intConfig.condition === SyncCondition.TRANSLATED;
|
|
100
|
+
const onlyApproved = intConfig.condition === SyncCondition.APPROVED;
|
|
101
|
+
const all = intConfig.condition === SyncCondition.ALL || intConfig.condition === undefined;
|
|
96
102
|
(0, _1.log)(`Executing updateIntegration task for files cron job with period [${period}] for project ${projectId} and request ${JSON.stringify(files, null, 2)}`, config.logger);
|
|
97
103
|
if (all) {
|
|
98
104
|
yield integration.updateIntegration(projectId, crowdinClient, apiCredentials, crowdinFiles, rootFolder, intConfig);
|
package/out/util/defaults.js
CHANGED
|
@@ -142,27 +142,24 @@ function applyDefaults(config, integration) {
|
|
|
142
142
|
},
|
|
143
143
|
{
|
|
144
144
|
key: 'condition',
|
|
145
|
-
label: '
|
|
145
|
+
label: 'Files export settings',
|
|
146
146
|
type: 'select',
|
|
147
147
|
defaultValue: '0',
|
|
148
148
|
options: [
|
|
149
149
|
{
|
|
150
150
|
value: '0',
|
|
151
|
-
label: '
|
|
151
|
+
label: 'Export all',
|
|
152
152
|
},
|
|
153
153
|
{
|
|
154
154
|
value: '1',
|
|
155
|
-
label: '
|
|
155
|
+
label: 'Export translated only',
|
|
156
156
|
},
|
|
157
157
|
{
|
|
158
158
|
value: '2',
|
|
159
|
-
label: '
|
|
159
|
+
label: 'Export approved only',
|
|
160
160
|
},
|
|
161
161
|
],
|
|
162
162
|
},
|
|
163
|
-
{
|
|
164
|
-
label: "To avoid downloading partially translated files, we recommend enabling the 'Skip untranslated files' option in your Crowdin project.",
|
|
165
|
-
},
|
|
166
163
|
...fields,
|
|
167
164
|
];
|
|
168
165
|
});
|
package/package.json
CHANGED