@crowdin/app-project-module 0.108.0 → 1.0.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.
- package/out/app-test/integration/get-integration-files.js +16 -4
- package/out/app-test/integration/types.d.ts +1 -1
- package/out/app-test/integration/update-crowdin.js +2 -2
- package/out/app-test/integration/update-integration.js +2 -2
- package/out/index.d.ts +2 -1
- package/out/index.js +73 -30
- package/out/middlewares/auto-credentials-masker.d.ts +4 -0
- package/out/middlewares/auto-credentials-masker.js +45 -0
- package/out/middlewares/crowdin-client.d.ts +1 -1
- package/out/middlewares/integration-credentials.d.ts +2 -2
- package/out/middlewares/integration-credentials.js +7 -4
- package/out/middlewares/render-ui-module.d.ts +3 -3
- package/out/middlewares/render-ui-module.js +10 -13
- package/out/middlewares/ui-module.d.ts +1 -1
- package/out/middlewares/ui-module.js +11 -1
- package/out/modules/about.d.ts +2 -1
- package/out/modules/about.js +10 -3
- package/out/modules/ai-prompt-provider/handlers/compile.d.ts +1 -1
- package/out/modules/ai-prompt-provider/handlers/compile.js +7 -1
- package/out/modules/ai-prompt-provider/index.js +2 -2
- package/out/modules/ai-prompt-provider/types.d.ts +7 -1
- package/out/modules/ai-provider/handlers/chat-completions.d.ts +1 -1
- package/out/modules/ai-provider/handlers/chat-completions.js +1 -1
- package/out/modules/ai-provider/handlers/get-model-list.d.ts +1 -1
- package/out/modules/ai-provider/index.js +2 -2
- package/out/modules/ai-provider/types.d.ts +4 -4
- package/out/modules/ai-request-processors/handler.d.ts +1 -1
- package/out/modules/ai-request-processors/handler.js +12 -2
- package/out/modules/ai-request-processors/types.d.ts +12 -2
- package/out/modules/ai-tools/handlers/tool-calls.d.ts +1 -1
- package/out/modules/ai-tools/handlers/tool-calls.js +1 -1
- package/out/modules/ai-tools/index.js +1 -1
- package/out/modules/ai-tools/types.d.ts +1 -1
- package/out/modules/auth-guard/handlers/verify.d.ts +1 -1
- package/out/modules/auth-guard/index.js +1 -1
- package/out/modules/automation-action/handlers/execute.d.ts +1 -1
- package/out/modules/automation-action/handlers/execute.js +1 -1
- package/out/modules/automation-action/handlers/input-schema.d.ts +1 -1
- package/out/modules/automation-action/handlers/output-schema.d.ts +1 -1
- package/out/modules/automation-action/handlers/validate-settings.d.ts +1 -1
- package/out/modules/automation-action/handlers/validate-settings.js +1 -1
- package/out/modules/automation-action/index.js +1 -1
- package/out/modules/automation-action/types.d.ts +4 -4
- package/out/modules/automation-action/util/index.js +2 -5
- package/out/modules/context-menu/index.js +2 -2
- package/out/modules/custom-mt/handlers/translate.d.ts +1 -1
- package/out/modules/custom-mt/handlers/translate.js +25 -9
- package/out/modules/custom-mt/index.js +3 -3
- package/out/modules/custom-mt/types.d.ts +10 -2
- package/out/modules/custom-spell-check/handlers/get-languages-list.d.ts +1 -1
- package/out/modules/custom-spell-check/handlers/spell-check.d.ts +1 -1
- package/out/modules/custom-spell-check/index.js +4 -4
- package/out/modules/editor-right-panel/index.js +1 -1
- package/out/modules/external-qa-check/handlers/validate.d.ts +1 -1
- package/out/modules/external-qa-check/index.js +2 -2
- package/out/modules/file-processing/handlers/custom-file-format.d.ts +7 -2
- package/out/modules/file-processing/handlers/custom-file-format.js +62 -22
- package/out/modules/file-processing/handlers/file-download.d.ts +1 -1
- package/out/modules/file-processing/handlers/file-download.js +5 -0
- package/out/modules/file-processing/handlers/pre-post-process.d.ts +1 -1
- package/out/modules/file-processing/handlers/pre-post-process.js +41 -15
- package/out/modules/file-processing/handlers/translations-alignment.d.ts +1 -1
- package/out/modules/file-processing/handlers/translations-alignment.js +10 -4
- package/out/modules/file-processing/index.js +12 -2
- package/out/modules/file-processing/types.d.ts +36 -5
- package/out/modules/file-processing/util/defaults.js +50 -6
- package/out/modules/file-processing/util/files.js +2 -1
- package/out/modules/form-data-display.d.ts +1 -1
- package/out/modules/form-data-save.d.ts +1 -1
- package/out/modules/install.d.ts +1 -1
- package/out/modules/integration/handlers/crowdin-file-progress.d.ts +1 -1
- package/out/modules/integration/handlers/crowdin-file-progress.js +5 -1
- package/out/modules/integration/handlers/crowdin-files-target-languages.d.ts +5 -0
- package/out/modules/integration/handlers/crowdin-files-target-languages.js +103 -0
- package/out/modules/integration/handlers/crowdin-files.d.ts +1 -1
- package/out/modules/integration/handlers/crowdin-files.js +7 -1
- package/out/modules/integration/handlers/crowdin-project.d.ts +1 -1
- package/out/modules/integration/handlers/crowdin-update.d.ts +1 -1
- package/out/modules/integration/handlers/crowdin-update.js +59 -18
- package/out/modules/integration/handlers/crowdin-webhook.d.ts +1 -1
- package/out/modules/integration/handlers/crowdin-webhook.js +15 -8
- package/out/modules/integration/handlers/integration-data.d.ts +1 -1
- package/out/modules/integration/handlers/integration-data.js +13 -6
- package/out/modules/integration/handlers/integration-login.d.ts +1 -1
- package/out/modules/integration/handlers/integration-logout.d.ts +1 -1
- package/out/modules/integration/handlers/integration-logout.js +8 -3
- package/out/modules/integration/handlers/integration-update.d.ts +1 -1
- package/out/modules/integration/handlers/integration-update.js +44 -6
- package/out/modules/integration/handlers/integration-webhook.d.ts +1 -1
- package/out/modules/integration/handlers/invite-users.d.ts +1 -1
- package/out/modules/integration/handlers/job-cancel.d.ts +1 -1
- package/out/modules/integration/handlers/job-info-deprecated.d.ts +1 -1
- package/out/modules/integration/handlers/job-info-deprecated.js +3 -2
- package/out/modules/integration/handlers/job-info.d.ts +1 -1
- package/out/modules/integration/handlers/job-list.d.ts +1 -1
- package/out/modules/integration/handlers/main.d.ts +1 -1
- package/out/modules/integration/handlers/main.js +32 -2
- package/out/modules/integration/handlers/oauth-login.d.ts +1 -1
- package/out/modules/integration/handlers/oauth-login.js +28 -6
- package/out/modules/integration/handlers/oauth-polling.d.ts +1 -1
- package/out/modules/integration/handlers/oauth-url.d.ts +1 -1
- package/out/modules/integration/handlers/settings-save.d.ts +1 -1
- package/out/modules/integration/handlers/settings-save.js +9 -9
- package/out/modules/integration/handlers/settings.d.ts +1 -1
- package/out/modules/integration/handlers/sync-settings-save.d.ts +1 -1
- package/out/modules/integration/handlers/sync-settings-save.js +5 -9
- package/out/modules/integration/handlers/sync-settings.d.ts +1 -1
- package/out/modules/integration/handlers/user-errors.d.ts +1 -1
- package/out/modules/integration/handlers/users.d.ts +1 -1
- package/out/modules/integration/index.js +19 -33
- package/out/modules/integration/types.d.ts +133 -29
- package/out/modules/integration/types.js +1 -0
- package/out/modules/integration/util/cron.d.ts +2 -2
- package/out/modules/integration/util/cron.js +40 -24
- package/out/modules/integration/util/defaults.d.ts +4 -0
- package/out/modules/integration/util/defaults.js +175 -15
- package/out/modules/integration/util/files.d.ts +2 -1
- package/out/modules/integration/util/files.js +19 -8
- package/out/modules/integration/util/job.js +4 -3
- package/out/modules/integration/util/snapshot.js +19 -3
- package/out/modules/integration/util/types.d.ts +1 -0
- package/out/modules/integration/util/types.js +1 -0
- package/out/modules/integration/util/webhooks.d.ts +8 -8
- package/out/modules/integration/util/webhooks.js +34 -17
- package/out/modules/manifest.js +12 -12
- package/out/modules/modal/index.js +2 -2
- package/out/modules/organization-menu/index.js +5 -4
- package/out/modules/organization-settings-menu/index.js +5 -4
- package/out/modules/profile-resources-menu/index.js +5 -4
- package/out/modules/profile-settings-menu/index.js +5 -4
- package/out/modules/project-menu/index.js +1 -1
- package/out/modules/project-menu-crowdsource/index.js +1 -1
- package/out/modules/project-reports/index.js +3 -2
- package/out/modules/project-tools/index.js +3 -2
- package/out/modules/status.d.ts +1 -1
- package/out/modules/status.js +12 -3
- package/out/modules/subscription-paid.d.ts +1 -1
- package/out/modules/uninstall.d.ts +1 -1
- package/out/modules/uninstall.js +1 -1
- package/out/modules/webhooks/handlers/webhook-handler.d.ts +2 -2
- package/out/modules/webhooks/handlers/webhook-handler.js +33 -22
- package/out/modules/webhooks/types.d.ts +7 -0
- package/out/modules/workflow-step-type/handlers/delete-step.d.ts +1 -1
- package/out/modules/workflow-step-type/handlers/step-settings-save.d.ts +1 -1
- package/out/modules/workflow-step-type/index.js +2 -2
- package/out/modules/workflow-step-type/util/index.js +3 -6
- package/out/static/js/dependent.js +16 -7
- package/out/static/ui/error.bundle.js +474 -0
- package/out/static/ui/error.bundle.js.map +1 -0
- package/out/static/ui/install.bundle.js +459 -0
- package/out/static/ui/install.bundle.js.map +1 -0
- package/out/static/ui/login.bundle.js +630 -0
- package/out/static/ui/login.bundle.js.map +1 -0
- package/out/static/ui/main.bundle.js +2109 -0
- package/out/static/ui/main.bundle.js.map +1 -0
- package/out/static/ui/oauth.bundle.js +467 -0
- package/out/static/ui/oauth.bundle.js.map +1 -0
- package/out/storage/d1.d.ts +107 -0
- package/out/storage/d1.js +831 -0
- package/out/storage/index.js +8 -1
- package/out/storage/mysql.js +22 -19
- package/out/storage/postgre.d.ts +0 -1
- package/out/storage/postgre.js +20 -30
- package/out/storage/sqlite.d.ts +2 -5
- package/out/storage/sqlite.js +29 -69
- package/out/types.d.ts +78 -18
- package/out/util/connection.js +1 -1
- package/out/util/credentials-masker.d.ts +3 -3
- package/out/util/credentials-masker.js +14 -20
- package/out/util/cron.d.ts +29 -0
- package/out/util/cron.js +87 -0
- package/out/util/index.d.ts +14 -1
- package/out/util/index.js +121 -10
- package/out/util/jsx-renderer.d.ts +14 -0
- package/out/util/jsx-renderer.js +35 -0
- package/out/util/logger.d.ts +1 -0
- package/out/util/logger.js +2 -2
- package/out/util/static-files.d.ts +19 -0
- package/out/util/static-files.js +87 -0
- package/out/util/subscription.js +1 -1
- package/out/views/AboutPage.d.ts +10 -0
- package/out/views/AboutPage.js +76 -0
- package/out/views/FormPage.d.ts +14 -0
- package/out/views/FormPage.js +28 -0
- package/out/views/SubscriptionPage.d.ts +7 -0
- package/out/views/SubscriptionPage.js +26 -0
- package/out/views/index.d.ts +8 -0
- package/out/views/index.js +15 -0
- package/out/views/layout/Head.d.ts +9 -0
- package/out/views/layout/Head.js +54 -0
- package/package.json +43 -41
- package/out/util/handlebars.d.ts +0 -1
- package/out/util/handlebars.js +0 -46
- package/out/views/about.handlebars +0 -102
- package/out/views/error.handlebars +0 -54
- package/out/views/form.handlebars +0 -31
- package/out/views/install.handlebars +0 -16
- package/out/views/login.handlebars +0 -332
- package/out/views/main.handlebars +0 -2042
- package/out/views/oauth.handlebars +0 -11
- package/out/views/partials/head.handlebars +0 -53
- package/out/views/subscription.handlebars +0 -26
package/out/modules/manifest.js
CHANGED
|
@@ -21,7 +21,7 @@ function handle(config) {
|
|
|
21
21
|
// prevent possible overrides of the other modules
|
|
22
22
|
config.projectIntegration = Object.assign(Object.assign({}, config.projectIntegration), { key: config.identifier + '-int' });
|
|
23
23
|
modules['project-integrations'] = [
|
|
24
|
-
Object.assign({ key: config.projectIntegration.key, name: config.name, description: config.description, logo: (0, util_1.getLogoUrl)(config.projectIntegration, '/integration'), url: '/' }, (!!config.projectIntegration.environments && {
|
|
24
|
+
Object.assign({ key: config.projectIntegration.key, name: config.name, description: config.description, logo: (0, util_1.getLogoUrl)(config, config.projectIntegration, '/integration'), url: '/' }, (!!config.projectIntegration.environments && {
|
|
25
25
|
environments: normalizeEnvironments(config.projectIntegration.environments),
|
|
26
26
|
})),
|
|
27
27
|
];
|
|
@@ -102,7 +102,7 @@ function handle(config) {
|
|
|
102
102
|
// prevent possible overrides of the other modules
|
|
103
103
|
config.customMT = Object.assign(Object.assign({}, config.customMT), { key: config.identifier + '-mt' });
|
|
104
104
|
modules['custom-mt'] = [
|
|
105
|
-
Object.assign(Object.assign(Object.assign(Object.assign({ key: config.customMT.key, name: config.name, logo: (0, util_1.getLogoUrl)(config.customMT, '/mt'), url: '/mt/translate', withContext: !!config.customMT.withContext }, ((0, util_1.isDefined)(config.customMT.splitStringsIntoChunks) && {
|
|
105
|
+
Object.assign(Object.assign(Object.assign(Object.assign({ key: config.customMT.key, name: config.name, logo: (0, util_1.getLogoUrl)(config, config.customMT, '/mt'), url: '/mt/translate', withContext: !!config.customMT.withContext }, ((0, util_1.isDefined)(config.customMT.splitStringsIntoChunks) && {
|
|
106
106
|
splitStringsIntoChunks: config.customMT.splitStringsIntoChunks,
|
|
107
107
|
})), ((0, util_1.isDefined)(config.customMT.batchSize) && {
|
|
108
108
|
batchSize: config.customMT.batchSize,
|
|
@@ -121,7 +121,7 @@ function handle(config) {
|
|
|
121
121
|
key: config.organizationMenu.key,
|
|
122
122
|
name: config.organizationMenu.name || config.name,
|
|
123
123
|
url: '/organization-menu/' + (config.organizationMenu.fileName || 'index.html'),
|
|
124
|
-
icon: (0, util_1.getLogoUrl)(config.organizationMenu, '/resources'),
|
|
124
|
+
icon: (0, util_1.getLogoUrl)(config, config.organizationMenu, '/resources'),
|
|
125
125
|
},
|
|
126
126
|
];
|
|
127
127
|
}
|
|
@@ -133,7 +133,7 @@ function handle(config) {
|
|
|
133
133
|
key: config.organizationSettingsMenu.key,
|
|
134
134
|
name: config.organizationSettingsMenu.name || config.name,
|
|
135
135
|
url: '/organization-settings/' + (config.organizationSettingsMenu.fileName || 'index.html'),
|
|
136
|
-
icon: (0, util_1.getLogoUrl)(config.organizationSettingsMenu, '/organization-settings'),
|
|
136
|
+
icon: (0, util_1.getLogoUrl)(config, config.organizationSettingsMenu, '/organization-settings'),
|
|
137
137
|
},
|
|
138
138
|
];
|
|
139
139
|
}
|
|
@@ -141,7 +141,7 @@ function handle(config) {
|
|
|
141
141
|
// prevent possible overrides of the other modules
|
|
142
142
|
config.profileResourcesMenu = Object.assign(Object.assign({}, config.profileResourcesMenu), { key: config.identifier + '-profile-resources-menu' });
|
|
143
143
|
modules['profile-resources-menu'] = [
|
|
144
|
-
Object.assign({ key: config.profileResourcesMenu.key, name: config.profileResourcesMenu.name || config.name, url: '/profile-resources/' + (config.profileResourcesMenu.fileName || 'index.html'), icon: (0, util_1.getLogoUrl)(config.profileResourcesMenu, '/profile-resources') }, (!!config.profileResourcesMenu.environments && {
|
|
144
|
+
Object.assign({ key: config.profileResourcesMenu.key, name: config.profileResourcesMenu.name || config.name, url: '/profile-resources/' + (config.profileResourcesMenu.fileName || 'index.html'), icon: (0, util_1.getLogoUrl)(config, config.profileResourcesMenu, '/profile-resources') }, (!!config.profileResourcesMenu.environments && {
|
|
145
145
|
environments: normalizeEnvironments(config.profileResourcesMenu.environments),
|
|
146
146
|
})),
|
|
147
147
|
];
|
|
@@ -150,7 +150,7 @@ function handle(config) {
|
|
|
150
150
|
// prevent possible overrides of the other modules
|
|
151
151
|
config.profileSettingsMenu = Object.assign(Object.assign({}, config.profileSettingsMenu), { key: config.identifier + '-profile-settings-menu' });
|
|
152
152
|
modules['profile-settings-menu'] = [
|
|
153
|
-
Object.assign({ key: config.profileSettingsMenu.key, name: config.profileSettingsMenu.name || config.name, url: '/profile-settings/' + (config.profileSettingsMenu.fileName || 'index.html'), icon: (0, util_1.getLogoUrl)(config.profileSettingsMenu, '/profile-settings') }, (!!config.profileSettingsMenu.environments && {
|
|
153
|
+
Object.assign({ key: config.profileSettingsMenu.key, name: config.profileSettingsMenu.name || config.name, url: '/profile-settings/' + (config.profileSettingsMenu.fileName || 'index.html'), icon: (0, util_1.getLogoUrl)(config, config.profileSettingsMenu, '/profile-settings') }, (!!config.profileSettingsMenu.environments && {
|
|
154
154
|
environments: normalizeEnvironments(config.profileSettingsMenu.environments),
|
|
155
155
|
})),
|
|
156
156
|
];
|
|
@@ -188,7 +188,7 @@ function handle(config) {
|
|
|
188
188
|
// prevent possible overrides of the other modules
|
|
189
189
|
config.projectTools = Object.assign(Object.assign({}, config.projectTools), { key: config.identifier + '-tools' });
|
|
190
190
|
modules['project-tools'] = [
|
|
191
|
-
Object.assign({ key: config.projectTools.key, name: config.projectTools.name || config.name, description: config.description, logo: (0, util_1.getLogoUrl)(config.projectTools, '/tools'), url: '/tools/' + (config.projectTools.fileName || 'index.html') }, (!!config.projectTools.environments && {
|
|
191
|
+
Object.assign({ key: config.projectTools.key, name: config.projectTools.name || config.name, description: config.description, logo: (0, util_1.getLogoUrl)(config, config.projectTools, '/tools'), url: '/tools/' + (config.projectTools.fileName || 'index.html') }, (!!config.projectTools.environments && {
|
|
192
192
|
environments: normalizeEnvironments(config.projectTools.environments),
|
|
193
193
|
})),
|
|
194
194
|
];
|
|
@@ -201,7 +201,7 @@ function handle(config) {
|
|
|
201
201
|
key: config.projectReports.key,
|
|
202
202
|
name: config.projectReports.name || config.name,
|
|
203
203
|
description: config.description,
|
|
204
|
-
logo: (0, util_1.getLogoUrl)(config.projectReports, '/reports'),
|
|
204
|
+
logo: (0, util_1.getLogoUrl)(config, config.projectReports, '/reports'),
|
|
205
205
|
url: '/reports/' + (config.projectReports.fileName || 'index.html'),
|
|
206
206
|
},
|
|
207
207
|
];
|
|
@@ -272,7 +272,7 @@ function handle(config) {
|
|
|
272
272
|
config.aiProvider = Object.assign(Object.assign({}, config.aiProvider), { key: config.identifier + '-aiprovider' });
|
|
273
273
|
const uiModule = config.aiProvider.settingsUiModule;
|
|
274
274
|
modules['ai-provider'] = [
|
|
275
|
-
Object.assign(Object.assign({ key: config.aiProvider.key, name: config.aiProvider.name || config.name, description: config.aiProvider.description || config.description, logo: (0, util_1.getLogoUrl)(config.aiProvider, '/aiprovider'), chatCompletionsUrl: '/ai-provider/completions', modelsUrl: '/ai-provider/models' }, (!!config.aiProvider.environments && {
|
|
275
|
+
Object.assign(Object.assign({ key: config.aiProvider.key, name: config.aiProvider.name || config.name, description: config.aiProvider.description || config.description, logo: (0, util_1.getLogoUrl)(config, config.aiProvider, '/aiprovider'), chatCompletionsUrl: '/ai-provider/completions', modelsUrl: '/ai-provider/models' }, (!!config.aiProvider.environments && {
|
|
276
276
|
environments: normalizeEnvironments(config.aiProvider.environments),
|
|
277
277
|
})), (uiModule ? { url: '/settings/' + (uiModule.fileName || 'index.html') } : {})),
|
|
278
278
|
];
|
|
@@ -297,7 +297,7 @@ function handle(config) {
|
|
|
297
297
|
// prevent possible overrides of the other modules
|
|
298
298
|
config.aiPromptProvider = Object.assign(Object.assign({}, config.aiPromptProvider), { key: config.identifier + '-ai-prompt-provider' });
|
|
299
299
|
modules['ai-prompt-provider'] = [
|
|
300
|
-
Object.assign(Object.assign({ key: config.aiPromptProvider.key, name: config.aiPromptProvider.name || config.name, logo: (0, util_1.getLogoUrl)(config.aiPromptProvider, '/ai-prompt-provider'), compileUrl: '/prompt-provider/compile' }, (config.aiPromptProvider.actions
|
|
300
|
+
Object.assign(Object.assign({ key: config.aiPromptProvider.key, name: config.aiPromptProvider.name || config.name, logo: (0, util_1.getLogoUrl)(config, config.aiPromptProvider, '/ai-prompt-provider'), compileUrl: '/prompt-provider/compile' }, (config.aiPromptProvider.actions
|
|
301
301
|
? {
|
|
302
302
|
actions: config.aiPromptProvider.actions,
|
|
303
303
|
}
|
|
@@ -386,7 +386,7 @@ function handle(config) {
|
|
|
386
386
|
workflowStep.key = config.identifier + '-' + (0, util_3.getWorkflowStepKey)(workflowStep);
|
|
387
387
|
}
|
|
388
388
|
const uiModule = ((_b = workflowStep === null || workflowStep === void 0 ? void 0 : workflowStep.settingsUiModule) === null || _b === void 0 ? void 0 : _b.formSchema) || ((_c = workflowStep === null || workflowStep === void 0 ? void 0 : workflowStep.settingsUiModule) === null || _c === void 0 ? void 0 : _c.fileName);
|
|
389
|
-
modules['workflow-step-type'].push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ key: workflowStep.key, name: workflowStep.name || config.name }, ((workflowStep === null || workflowStep === void 0 ? void 0 : workflowStep.imagePath) ? { logo: (0, util_1.getLogoUrl)(workflowStep, `-${workflowStep.key}`) } : {})), { description: workflowStep.description || config.description, boundaries: workflowStep.boundaries }), (workflowStep.editorMode ? { editorMode: workflowStep.editorMode } : {})), { updateSettingsUrl: (0, util_3.getWorkflowStepUrl)('/workflow-step/settings', workflowStep), deleteSettingsUrl: (0, util_3.getWorkflowStepUrl)('/workflow-step/delete', workflowStep) }), (uiModule ? { url: (0, util_3.getWorkflowStepUrl)('/workflow-step', workflowStep) } : {})));
|
|
389
|
+
modules['workflow-step-type'].push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ key: workflowStep.key, name: workflowStep.name || config.name }, ((workflowStep === null || workflowStep === void 0 ? void 0 : workflowStep.imagePath) ? { logo: (0, util_1.getLogoUrl)(config, workflowStep, `-${workflowStep.key}`) } : {})), { description: workflowStep.description || config.description, boundaries: workflowStep.boundaries }), (workflowStep.editorMode ? { editorMode: workflowStep.editorMode } : {})), { updateSettingsUrl: (0, util_3.getWorkflowStepUrl)('/workflow-step/settings', workflowStep), deleteSettingsUrl: (0, util_3.getWorkflowStepUrl)('/workflow-step/delete', workflowStep) }), (uiModule ? { url: (0, util_3.getWorkflowStepUrl)('/workflow-step', workflowStep) } : {})));
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
if (config.automationAction) {
|
|
@@ -450,7 +450,7 @@ function handle(config) {
|
|
|
450
450
|
events['subscription_paid'] = '/subscription-paid';
|
|
451
451
|
}
|
|
452
452
|
return (_req, res) => {
|
|
453
|
-
const manifest = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ identifier: config.identifier, name: config.name, logo: (0, util_1.getLogoUrl)(), baseUrl: config.baseUrl, authentication: {
|
|
453
|
+
const manifest = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ identifier: config.identifier, name: config.name, logo: (0, util_1.getLogoUrl)(config), baseUrl: config.baseUrl, authentication: {
|
|
454
454
|
type: config.authenticationType || types_1.AuthenticationType.APP,
|
|
455
455
|
clientId: config.clientId,
|
|
456
456
|
}, restrictAiToSameApp: config.restrictAiToSameApp }, (config.stringBasedAvailable !== undefined && { stringBasedAvailable: config.stringBasedAvailable })), (config.agent && { agent: config.agent })), { events, scopes: config.scopes ? config.scopes : [types_1.Scope.PROJECTS] }), (config.defaultPermissions && { default_permissions: config.defaultPermissions })), { modules });
|
|
@@ -16,14 +16,14 @@ function register({ config, app }) {
|
|
|
16
16
|
if (Array.isArray(config.modal)) {
|
|
17
17
|
config.modal.forEach((modal) => {
|
|
18
18
|
if ((modal === null || modal === void 0 ? void 0 : modal.uiPath) || (modal === null || modal === void 0 ? void 0 : modal.formSchema)) {
|
|
19
|
-
app.use(`/modal-${modal.key}`, (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: modal.key }), (0, render_ui_module_1.default)(modal));
|
|
19
|
+
app.use(`/modal-${modal.key}`, (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: modal.key }), (0, render_ui_module_1.default)(modal, config));
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
24
24
|
// backward compatibility will be removed after migration
|
|
25
25
|
if (((_a = config.modal) === null || _a === void 0 ? void 0 : _a.uiPath) || ((_b = config.modal) === null || _b === void 0 ? void 0 : _b.formSchema)) {
|
|
26
|
-
app.use('/modal', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.modal.key }), (0, render_ui_module_1.default)(config.modal));
|
|
26
|
+
app.use('/modal', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.modal.key }), (0, render_ui_module_1.default)(config.modal, config));
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -7,16 +7,17 @@ exports.register = void 0;
|
|
|
7
7
|
const render_ui_module_1 = __importDefault(require("../../middlewares/render-ui-module"));
|
|
8
8
|
const ui_module_1 = __importDefault(require("../../middlewares/ui-module"));
|
|
9
9
|
const util_1 = require("../../util");
|
|
10
|
+
const util_2 = require("../../util");
|
|
10
11
|
function register({ config, app }) {
|
|
11
12
|
if (!config.organizationMenu) {
|
|
12
13
|
return;
|
|
13
14
|
}
|
|
14
15
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
15
|
-
app.
|
|
16
|
-
app.use('/organization-menu', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.organizationMenu.key }), (0, render_ui_module_1.default)(config.organizationMenu));
|
|
16
|
+
app.use('/logo/organization-menu', (0, util_2.serveLogo)(config, config.organizationMenu));
|
|
17
|
+
app.use('/organization-menu', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.organizationMenu.key }), (0, render_ui_module_1.default)(config.organizationMenu, config));
|
|
17
18
|
// TEMPORARY CODE: it needs to support old path
|
|
18
|
-
app.
|
|
19
|
-
app.use('/resources', (0, ui_module_1.default)({ config, allowUnauthorized }), (0, render_ui_module_1.default)(config.organizationMenu));
|
|
19
|
+
app.use('/logo/resources', (0, util_2.serveLogo)(config, config.organizationMenu));
|
|
20
|
+
app.use('/resources', (0, ui_module_1.default)({ config, allowUnauthorized }), (0, render_ui_module_1.default)(config.organizationMenu, config));
|
|
20
21
|
// END TEMPORARY CODE
|
|
21
22
|
}
|
|
22
23
|
exports.register = register;
|
|
@@ -7,16 +7,17 @@ exports.register = void 0;
|
|
|
7
7
|
const render_ui_module_1 = __importDefault(require("../../middlewares/render-ui-module"));
|
|
8
8
|
const ui_module_1 = __importDefault(require("../../middlewares/ui-module"));
|
|
9
9
|
const util_1 = require("../../util");
|
|
10
|
+
const util_2 = require("../../util");
|
|
10
11
|
function register({ config, app }) {
|
|
11
12
|
if (!config.organizationSettingsMenu) {
|
|
12
13
|
return;
|
|
13
14
|
}
|
|
14
15
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
15
|
-
app.
|
|
16
|
-
app.use('/organization-settings', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.organizationSettingsMenu.key }), (0, render_ui_module_1.default)(config.organizationSettingsMenu));
|
|
16
|
+
app.use('/logo/organization-settings', (0, util_2.serveLogo)(config, config.organizationSettingsMenu));
|
|
17
|
+
app.use('/organization-settings', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.organizationSettingsMenu.key }), (0, render_ui_module_1.default)(config.organizationSettingsMenu, config));
|
|
17
18
|
// TEMPORARY CODE: it needs to support old path
|
|
18
|
-
app.
|
|
19
|
-
app.use('/settings', (0, ui_module_1.default)({ config, allowUnauthorized }), (0, render_ui_module_1.default)(config.organizationSettingsMenu));
|
|
19
|
+
app.use('/logo/settings', (0, util_2.serveLogo)(config, config.organizationSettingsMenu));
|
|
20
|
+
app.use('/settings', (0, ui_module_1.default)({ config, allowUnauthorized }), (0, render_ui_module_1.default)(config.organizationSettingsMenu, config));
|
|
20
21
|
// END TEMPORARY CODE
|
|
21
22
|
}
|
|
22
23
|
exports.register = register;
|
|
@@ -7,16 +7,17 @@ exports.register = void 0;
|
|
|
7
7
|
const render_ui_module_1 = __importDefault(require("../../middlewares/render-ui-module"));
|
|
8
8
|
const ui_module_1 = __importDefault(require("../../middlewares/ui-module"));
|
|
9
9
|
const util_1 = require("../../util");
|
|
10
|
+
const util_2 = require("../../util");
|
|
10
11
|
function register({ config, app }) {
|
|
11
12
|
if (!config.profileResourcesMenu) {
|
|
12
13
|
return;
|
|
13
14
|
}
|
|
14
|
-
app.
|
|
15
|
+
app.use('/logo/profile-resources', (0, util_2.serveLogo)(config, config.profileResourcesMenu));
|
|
15
16
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
16
|
-
app.use('/profile-resources', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.profileResourcesMenu.key }), (0, render_ui_module_1.default)(config.profileResourcesMenu));
|
|
17
|
+
app.use('/profile-resources', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.profileResourcesMenu.key }), (0, render_ui_module_1.default)(config.profileResourcesMenu, config));
|
|
17
18
|
// TEMPORARY CODE: it needs to support old path
|
|
18
|
-
app.
|
|
19
|
-
app.use('/resources', (0, ui_module_1.default)({ config, allowUnauthorized }), (0, render_ui_module_1.default)(config.profileResourcesMenu));
|
|
19
|
+
app.use('/logo/resources', (0, util_2.serveLogo)(config, config.profileResourcesMenu));
|
|
20
|
+
app.use('/resources', (0, ui_module_1.default)({ config, allowUnauthorized }), (0, render_ui_module_1.default)(config.profileResourcesMenu, config));
|
|
20
21
|
// END TEMPORARY CODE
|
|
21
22
|
}
|
|
22
23
|
exports.register = register;
|
|
@@ -7,16 +7,17 @@ exports.register = void 0;
|
|
|
7
7
|
const render_ui_module_1 = __importDefault(require("../../middlewares/render-ui-module"));
|
|
8
8
|
const ui_module_1 = __importDefault(require("../../middlewares/ui-module"));
|
|
9
9
|
const util_1 = require("../../util");
|
|
10
|
+
const util_2 = require("../../util");
|
|
10
11
|
function register({ config, app }) {
|
|
11
12
|
if (!config.profileSettingsMenu) {
|
|
12
13
|
return;
|
|
13
14
|
}
|
|
14
|
-
app.
|
|
15
|
+
app.use('/logo/profile-settings', (0, util_2.serveLogo)(config, config.profileSettingsMenu));
|
|
15
16
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
16
|
-
app.use('/profile-settings', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.profileSettingsMenu.key }), (0, render_ui_module_1.default)(config.profileSettingsMenu));
|
|
17
|
+
app.use('/profile-settings', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.profileSettingsMenu.key }), (0, render_ui_module_1.default)(config.profileSettingsMenu, config));
|
|
17
18
|
// TEMPORARY CODE: it needs to support old path
|
|
18
|
-
app.
|
|
19
|
-
app.use('/settings', (0, ui_module_1.default)({ config, allowUnauthorized }), (0, render_ui_module_1.default)(config.profileSettingsMenu));
|
|
19
|
+
app.use('/logo/settings', (0, util_2.serveLogo)(config, config.profileSettingsMenu));
|
|
20
|
+
app.use('/settings', (0, ui_module_1.default)({ config, allowUnauthorized }), (0, render_ui_module_1.default)(config.profileSettingsMenu, config));
|
|
20
21
|
// END TEMPORARY CODE
|
|
21
22
|
}
|
|
22
23
|
exports.register = register;
|
|
@@ -12,6 +12,6 @@ function register({ config, app }) {
|
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
15
|
-
app.use('/project-menu', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.projectMenu.key }), (0, render_ui_module_1.default)(config.projectMenu));
|
|
15
|
+
app.use('/project-menu', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.projectMenu.key }), (0, render_ui_module_1.default)(config.projectMenu, config));
|
|
16
16
|
}
|
|
17
17
|
exports.register = register;
|
|
@@ -12,6 +12,6 @@ function register({ config, app }) {
|
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
15
|
-
app.use('/project-menu-crowdsource', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.projectMenuCrowdsource.key }), (0, render_ui_module_1.default)(config.projectMenuCrowdsource));
|
|
15
|
+
app.use('/project-menu-crowdsource', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.projectMenuCrowdsource.key }), (0, render_ui_module_1.default)(config.projectMenuCrowdsource, config));
|
|
16
16
|
}
|
|
17
17
|
exports.register = register;
|
|
@@ -7,12 +7,13 @@ exports.register = void 0;
|
|
|
7
7
|
const render_ui_module_1 = __importDefault(require("../../middlewares/render-ui-module"));
|
|
8
8
|
const ui_module_1 = __importDefault(require("../../middlewares/ui-module"));
|
|
9
9
|
const util_1 = require("../../util");
|
|
10
|
+
const util_2 = require("../../util");
|
|
10
11
|
function register({ config, app }) {
|
|
11
12
|
if (!config.projectReports) {
|
|
12
13
|
return;
|
|
13
14
|
}
|
|
14
15
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
15
|
-
app.
|
|
16
|
-
app.use('/reports', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.projectReports.key }), (0, render_ui_module_1.default)(config.projectReports));
|
|
16
|
+
app.use('/logo/reports', (0, util_2.serveLogo)(config, config.projectReports));
|
|
17
|
+
app.use('/reports', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.projectReports.key }), (0, render_ui_module_1.default)(config.projectReports, config));
|
|
17
18
|
}
|
|
18
19
|
exports.register = register;
|
|
@@ -7,12 +7,13 @@ exports.register = void 0;
|
|
|
7
7
|
const render_ui_module_1 = __importDefault(require("../../middlewares/render-ui-module"));
|
|
8
8
|
const ui_module_1 = __importDefault(require("../../middlewares/ui-module"));
|
|
9
9
|
const util_1 = require("../../util");
|
|
10
|
+
const util_2 = require("../../util");
|
|
10
11
|
function register({ config, app }) {
|
|
11
12
|
if (!config.projectTools) {
|
|
12
13
|
return;
|
|
13
14
|
}
|
|
14
15
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
15
|
-
app.
|
|
16
|
-
app.use('/tools', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.projectTools.key }), (0, render_ui_module_1.default)(config.projectTools));
|
|
16
|
+
app.use('/logo/tools', (0, util_2.serveLogo)(config, config.projectTools));
|
|
17
|
+
app.use('/tools', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.projectTools.key }), (0, render_ui_module_1.default)(config.projectTools, config));
|
|
17
18
|
}
|
|
18
19
|
exports.register = register;
|
package/out/modules/status.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="qs" />
|
|
2
2
|
import { Request, Response } from 'express';
|
|
3
3
|
import { Config, UnauthorizedConfig } from '../types';
|
|
4
|
-
export default function handle(config: Config | UnauthorizedConfig): (req:
|
|
4
|
+
export default function handle(config: Config | UnauthorizedConfig): (req: Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>> | import("../types").CrowdinClientRequest, res: Response<any, Record<string, any>>, next: Function) => void;
|
package/out/modules/status.js
CHANGED
|
@@ -47,9 +47,18 @@ function handle(config) {
|
|
|
47
47
|
let status = 'ok';
|
|
48
48
|
let message = 'Filesystem access successful';
|
|
49
49
|
try {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
if (config.fileStore) {
|
|
51
|
+
// Use custom fileStore if provided
|
|
52
|
+
const testContent = Buffer.from('test');
|
|
53
|
+
const fileRef = yield config.fileStore.storeFile(testContent);
|
|
54
|
+
yield config.fileStore.deleteFile(fileRef);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
// Fallback to default filesystem operations
|
|
58
|
+
const testFile = path_1.default.join(os_1.default.tmpdir(), `status-check-${Date.now()}.txt`);
|
|
59
|
+
yield promises_1.default.writeFile(testFile, 'test');
|
|
60
|
+
yield promises_1.default.unlink(testFile);
|
|
61
|
+
}
|
|
53
62
|
}
|
|
54
63
|
catch (e) {
|
|
55
64
|
status = 'error';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="qs" />
|
|
2
2
|
import { Request, Response } from 'express';
|
|
3
|
-
export default function handle(): (req:
|
|
3
|
+
export default function handle(): (req: Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>> | import("../types").CrowdinClientRequest, res: Response<any, Record<string, any>>, next: Function) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="qs" />
|
|
2
2
|
import { Request, Response } from 'express';
|
|
3
3
|
import { Config } from '../types';
|
|
4
|
-
export default function handle(config: Config): (req:
|
|
4
|
+
export default function handle(config: Config): (req: Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>> | import("../types").CrowdinClientRequest, res: Response<any, Record<string, any>>, next: Function) => void;
|
package/out/modules/uninstall.js
CHANGED
|
@@ -40,7 +40,7 @@ function handle(config) {
|
|
|
40
40
|
})));
|
|
41
41
|
}
|
|
42
42
|
(0, logger_1.log)('Invoking onUninstall hook');
|
|
43
|
-
yield config.onUninstall(organization, allCredentials);
|
|
43
|
+
yield config.onUninstall({ organization, allCredentials });
|
|
44
44
|
}
|
|
45
45
|
if (projectIntegration) {
|
|
46
46
|
if (projectIntegration.webhooks) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="qs" />
|
|
2
|
-
import { Config, CrowdinClientRequest } from '../../../types';
|
|
3
2
|
import { Response } from 'express';
|
|
3
|
+
import { Config, CrowdinClientRequest } from '../../../types';
|
|
4
4
|
import { Webhook } from '../types';
|
|
5
|
-
export declare function webhookHandler(config: Config, webhooks: Webhook[]): (req:
|
|
5
|
+
export declare function webhookHandler(config: Config, webhooks: Webhook[]): (req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>> | CrowdinClientRequest, res: Response<any, Record<string, any>>, next: Function) => void;
|
|
@@ -31,15 +31,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
31
31
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
35
|
exports.webhookHandler = void 0;
|
|
39
|
-
const util_1 = require("../../../util");
|
|
40
|
-
const lodash_isstring_1 = __importDefault(require("lodash.isstring"));
|
|
41
36
|
const crypto = __importStar(require("node:crypto"));
|
|
42
37
|
const storage = __importStar(require("../../../storage"));
|
|
38
|
+
const util_1 = require("../../../util");
|
|
43
39
|
const connection_1 = require("../../../util/connection");
|
|
44
40
|
function webhookHandler(config, webhooks) {
|
|
45
41
|
return (0, util_1.runAsyncWrapper)((req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -47,11 +43,11 @@ function webhookHandler(config, webhooks) {
|
|
|
47
43
|
const organizationId = req.headers['x-crowdin-id'];
|
|
48
44
|
const signature = req.headers['x-crowdin-signature'];
|
|
49
45
|
const moduleKey = req.headers['x-module-key'];
|
|
50
|
-
if (!(0,
|
|
46
|
+
if (!(0, util_1.isString)(organizationId) || !(0, util_1.isString)(signature) || !(0, util_1.isString)(moduleKey)) {
|
|
51
47
|
res.status(400).send({ error: 'Invalid request' });
|
|
52
48
|
return;
|
|
53
49
|
}
|
|
54
|
-
const crowdinId = domain && (0,
|
|
50
|
+
const crowdinId = domain && (0, util_1.isString)(domain) ? domain : organizationId;
|
|
55
51
|
const credentials = yield storage.getStorage().getCrowdinCredentials(crowdinId);
|
|
56
52
|
if (!credentials) {
|
|
57
53
|
res.status(401).send({ error: 'Unable to load Crowdin credentials' });
|
|
@@ -64,22 +60,37 @@ function webhookHandler(config, webhooks) {
|
|
|
64
60
|
res.status(403).send({ error: 'Invalid signature' });
|
|
65
61
|
return;
|
|
66
62
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
63
|
+
const shouldDeferResponse = webhooks.some((webhook) => webhook.key === moduleKey && webhook.deferResponse);
|
|
64
|
+
if (!shouldDeferResponse) {
|
|
65
|
+
res.status(200).send();
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
const { client } = yield (0, connection_1.prepareCrowdinClient)({ config, credentials, autoRenew: true });
|
|
69
|
+
const json = JSON.parse(req.body.toString());
|
|
70
|
+
for (const webhook of webhooks) {
|
|
71
|
+
if (webhook.key === moduleKey) {
|
|
72
|
+
yield webhook.callback({
|
|
73
|
+
events: json.events,
|
|
74
|
+
client,
|
|
75
|
+
webhookContext: {
|
|
76
|
+
domain: credentials.domain,
|
|
77
|
+
organizationId: credentials.organizationId,
|
|
78
|
+
userId: credentials.userId,
|
|
79
|
+
agentId: credentials.agentId,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (!shouldDeferResponse) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
res.status(200).send();
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
if (!shouldDeferResponse) {
|
|
91
|
+
throw error;
|
|
82
92
|
}
|
|
93
|
+
res.status(500).send({ error: 'Webhook processing failed' });
|
|
83
94
|
}
|
|
84
95
|
}));
|
|
85
96
|
}
|
|
@@ -13,6 +13,13 @@ export interface Webhook extends ModuleKey {
|
|
|
13
13
|
events: Event[];
|
|
14
14
|
client: Crowdin;
|
|
15
15
|
}) => Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* If true, response will be sent after webhook processing is complete.
|
|
18
|
+
* This is required for Cloudflare Workers where the execution context
|
|
19
|
+
* terminates after the response is sent.
|
|
20
|
+
* Default: false (response is sent immediately after signature verification)
|
|
21
|
+
*/
|
|
22
|
+
deferResponse?: boolean;
|
|
16
23
|
}
|
|
17
24
|
interface WebhookContext {
|
|
18
25
|
domain?: string;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
import { Response } from 'express';
|
|
3
3
|
import { CrowdinClientRequest } from '../../../types';
|
|
4
4
|
import { WorkflowStepTypeModule } from '../types';
|
|
5
|
-
export default function handle(workflowStep: WorkflowStepTypeModule): (req:
|
|
5
|
+
export default function handle(workflowStep: WorkflowStepTypeModule): (req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>> | CrowdinClientRequest, res: Response<any, Record<string, any>>, next: Function) => void;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
import { Response } from 'express';
|
|
3
3
|
import { CrowdinClientRequest } from '../../../types';
|
|
4
4
|
import { WorkflowStepTypeModule } from '../types';
|
|
5
|
-
export default function handle(workflowStep: WorkflowStepTypeModule): (req:
|
|
5
|
+
export default function handle(workflowStep: WorkflowStepTypeModule): (req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>> | CrowdinClientRequest, res: Response<any, Record<string, any>>, next: Function) => void;
|
|
@@ -42,10 +42,10 @@ function register({ config, app }) {
|
|
|
42
42
|
}), (0, delete_step_1.default)(workflowStep));
|
|
43
43
|
// END TEMPORARY CODE
|
|
44
44
|
if (workflowStep.imagePath) {
|
|
45
|
-
app.
|
|
45
|
+
app.use(`/logo-${workflowStep.key}`, (0, util_2.serveLogo)(config, workflowStep));
|
|
46
46
|
}
|
|
47
47
|
if (workflowStep.settingsUiModule) {
|
|
48
|
-
app.use((0, util_1.getWorkflowStepUrl)('/workflow-step', workflowStep), (0, ui_module_1.default)({ config, moduleType: workflowStep.key }), (0, render_ui_module_1.default)(workflowStep.settingsUiModule));
|
|
48
|
+
app.use((0, util_1.getWorkflowStepUrl)('/workflow-step', workflowStep), (0, ui_module_1.default)({ config, moduleType: workflowStep.key }), (0, render_ui_module_1.default)(workflowStep.settingsUiModule, config));
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.getWorkflowStepUrl = exports.getWorkflowStepKey = void 0;
|
|
7
|
-
const
|
|
4
|
+
const util_1 = require("../../../util");
|
|
8
5
|
function getWorkflowStepKey(workflowStep) {
|
|
9
|
-
return (0,
|
|
6
|
+
return (0, util_1.snakeCase)(workflowStep.name);
|
|
10
7
|
}
|
|
11
8
|
exports.getWorkflowStepKey = getWorkflowStepKey;
|
|
12
9
|
function getWorkflowStepUrl(url, workflowStep) {
|
|
13
|
-
const key = (0,
|
|
10
|
+
const key = (0, util_1.snakeCase)(workflowStep.key) || getWorkflowStepKey(workflowStep);
|
|
14
11
|
return `${url}/${key}`;
|
|
15
12
|
}
|
|
16
13
|
exports.getWorkflowStepUrl = getWorkflowStepUrl;
|
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
function initializeDependencies() {
|
|
2
2
|
const fields = document.querySelectorAll('[data-dependency]');
|
|
3
3
|
|
|
4
4
|
if (fields.length > 0) {
|
|
5
5
|
fields.forEach((field) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
try {
|
|
7
|
+
const conditions = JSON.parse(field.dataset['dependency']);
|
|
8
|
+
action(field, conditions);
|
|
9
|
+
|
|
10
|
+
const success = check(conditions);
|
|
11
|
+
showHide(field, success);
|
|
12
|
+
} catch (e) {
|
|
13
|
+
console.error('[Dependencies] Error parsing conditions for field:', field, e);
|
|
14
|
+
}
|
|
11
15
|
});
|
|
12
16
|
}
|
|
13
|
-
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
document.addEventListener('DOMContentLoaded', initializeDependencies);
|
|
20
|
+
|
|
21
|
+
// Expose globally so it can be called from React
|
|
22
|
+
window.initializeDependencies = initializeDependencies;
|
|
14
23
|
|
|
15
24
|
function action(field, conditions) {
|
|
16
25
|
conditions.forEach((rules) => {
|