@crowdin/app-project-module 0.107.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/api/api.js +58 -7
- package/out/modules/api/base.d.ts +1 -0
- package/out/modules/api/base.js +1 -0
- package/out/modules/api/components.d.ts +251 -27
- package/out/modules/api/components.js +251 -27
- 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/types.d.ts +1 -1
- 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 +80 -18
- package/out/util/connection.js +16 -5
- 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
|
@@ -16,9 +16,9 @@ function register({ config, app }) {
|
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
if (config.aiProvider.settingsUiModule) {
|
|
19
|
-
app.use('/settings', (0, ui_module_1.default)({ config, allowUnauthorized: true, moduleType: config.aiProvider.key }), (0, render_ui_module_1.default)(config.aiProvider.settingsUiModule));
|
|
19
|
+
app.use('/settings', (0, ui_module_1.default)({ config, allowUnauthorized: true, moduleType: config.aiProvider.key }), (0, render_ui_module_1.default)(config.aiProvider.settingsUiModule, config));
|
|
20
20
|
}
|
|
21
|
-
app.
|
|
21
|
+
app.use('/logo/aiprovider', (0, util_1.serveLogo)(config, config.aiProvider));
|
|
22
22
|
app.get('/ai-provider/models', json_response_1.default, (0, crowdin_client_1.default)({
|
|
23
23
|
config,
|
|
24
24
|
optional: false,
|
|
@@ -5,11 +5,11 @@ export interface AiProviderModule extends Environments, ModuleKey {
|
|
|
5
5
|
/**
|
|
6
6
|
* module name
|
|
7
7
|
*/
|
|
8
|
-
name
|
|
8
|
+
name?: string;
|
|
9
9
|
/**
|
|
10
10
|
* module description
|
|
11
11
|
*/
|
|
12
|
-
description
|
|
12
|
+
description?: string;
|
|
13
13
|
/**
|
|
14
14
|
* Settings UI module
|
|
15
15
|
*/
|
|
@@ -17,14 +17,14 @@ export interface AiProviderModule extends Environments, ModuleKey {
|
|
|
17
17
|
/**
|
|
18
18
|
* processes a sequence of conversation messages and generates responses from the assistant
|
|
19
19
|
*/
|
|
20
|
-
chatCompletions: ({ messages, model, action, responseFormat, client, context,
|
|
20
|
+
chatCompletions: ({ messages, model, action, responseFormat, client, context, request, isStream, sendEvent, tools, toolChoice, }: {
|
|
21
21
|
messages: ChatCompletionMessage[];
|
|
22
22
|
model: string;
|
|
23
23
|
action: string;
|
|
24
24
|
responseFormat: string;
|
|
25
25
|
client: Crowdin;
|
|
26
26
|
context: CrowdinContextInfo;
|
|
27
|
-
|
|
27
|
+
request: CrowdinClientRequest;
|
|
28
28
|
isStream: boolean;
|
|
29
29
|
sendEvent: (chunk: ChatCompletionChunkMessage) => Promise<void>;
|
|
30
30
|
tools?: ChatCompletionTool[];
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
import { Response } from 'express';
|
|
3
3
|
import { CrowdinClientRequest } from '../../types';
|
|
4
4
|
import { AiRequestProcessorModule, AiStreamProcessorModule } from './types';
|
|
5
|
-
export default function handle(module: AiRequestProcessorModule | AiStreamProcessorModule, canHandleStream?: boolean): (req:
|
|
5
|
+
export default function handle(module: AiRequestProcessorModule | AiStreamProcessorModule, canHandleStream?: boolean): (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;
|
|
@@ -30,7 +30,12 @@ function handle(module, canHandleStream = false) {
|
|
|
30
30
|
let chunkStr = chunk.toString();
|
|
31
31
|
// actually we checked if processStream exists already, but need do to this again to calm down TS compiler
|
|
32
32
|
chunkStr = module.processStream
|
|
33
|
-
? yield module.processStream(
|
|
33
|
+
? yield module.processStream({
|
|
34
|
+
chunk: chunkStr,
|
|
35
|
+
requestContext: req.query,
|
|
36
|
+
client: req.crowdinApiClient,
|
|
37
|
+
context: req.crowdinContext,
|
|
38
|
+
})
|
|
34
39
|
: chunkStr;
|
|
35
40
|
if (!chunkStr && typeof chunkStr !== 'string') {
|
|
36
41
|
res.write(BUFFERING_FLAG);
|
|
@@ -49,7 +54,12 @@ function handle(module, canHandleStream = false) {
|
|
|
49
54
|
});
|
|
50
55
|
return;
|
|
51
56
|
}
|
|
52
|
-
const result = yield module.processRequest(
|
|
57
|
+
const result = yield module.processRequest({
|
|
58
|
+
requestData: req.body,
|
|
59
|
+
requestContext: req.query,
|
|
60
|
+
client: req.crowdinApiClient,
|
|
61
|
+
context: req.crowdinContext,
|
|
62
|
+
});
|
|
53
63
|
res.send(result);
|
|
54
64
|
}
|
|
55
65
|
catch (e) {
|
|
@@ -4,11 +4,21 @@ export interface AiRequestProcessorModule extends ModuleKey {
|
|
|
4
4
|
/**
|
|
5
5
|
* updates request data
|
|
6
6
|
*/
|
|
7
|
-
processRequest: (
|
|
7
|
+
processRequest: (options: {
|
|
8
|
+
requestData: any;
|
|
9
|
+
requestContext: any;
|
|
10
|
+
client: Crowdin;
|
|
11
|
+
context: CrowdinContextInfo;
|
|
12
|
+
}) => Promise<never>;
|
|
8
13
|
}
|
|
9
14
|
export interface AiStreamProcessorModule extends AiRequestProcessorModule {
|
|
10
15
|
/**
|
|
11
16
|
* updates request data
|
|
12
17
|
*/
|
|
13
|
-
processStream?: (
|
|
18
|
+
processStream?: (options: {
|
|
19
|
+
chunk: any;
|
|
20
|
+
requestContext: any;
|
|
21
|
+
client: Crowdin;
|
|
22
|
+
context: CrowdinContextInfo;
|
|
23
|
+
}) => Promise<string | null>;
|
|
14
24
|
}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
import { Response } from 'express';
|
|
3
3
|
import { CrowdinClientRequest } from '../../../types';
|
|
4
4
|
import { AiTool } from '../types';
|
|
5
|
-
export default function handle(aiTool: AiTool): (req:
|
|
5
|
+
export default function handle(aiTool: AiTool): (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;
|
|
@@ -37,7 +37,7 @@ function registerAiToolWidgets({ config, app }) {
|
|
|
37
37
|
const tools = Array.isArray(config.aiToolsWidget) ? config.aiToolsWidget : [config.aiToolsWidget];
|
|
38
38
|
for (const tool of tools) {
|
|
39
39
|
if ((0, util_1.isUniqueFunctionName)(tool)) {
|
|
40
|
-
app.use((0, util_1.getAiToolWidgetUrl)(tool), (0, ui_module_1.default)({ config, moduleType: tool.key }), (0, render_ui_module_1.default)(tool));
|
|
40
|
+
app.use((0, util_1.getAiToolWidgetUrl)(tool), (0, ui_module_1.default)({ config, moduleType: tool.key }), (0, render_ui_module_1.default)(tool, config));
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
43
|
throw new Error(`The function name '${tool.function.name}' is not unique within aiTools and aiToolsWidget`);
|
package/out/modules/api/api.js
CHANGED
|
@@ -256,9 +256,14 @@ function addDefaultApiEndpoints(app, config) {
|
|
|
256
256
|
* content:
|
|
257
257
|
* application/json:
|
|
258
258
|
* schema:
|
|
259
|
+
* type: object
|
|
259
260
|
* properties:
|
|
260
261
|
* data:
|
|
261
262
|
* $ref: '#/components/schemas/IntegrationFiles'
|
|
263
|
+
* message:
|
|
264
|
+
* type: string
|
|
265
|
+
* nullable: true
|
|
266
|
+
* description: 'Optional message (e.g., error info)'
|
|
262
267
|
*
|
|
263
268
|
*/
|
|
264
269
|
app.get('/integration-files', api_call_1.default, json_response_1.default, (0, crowdin_client_1.default)({
|
|
@@ -330,30 +335,36 @@ function addDefaultApiEndpoints(app, config) {
|
|
|
330
335
|
* tags:
|
|
331
336
|
* - 'Jobs'
|
|
332
337
|
* summary: 'List Jobs'
|
|
338
|
+
* description: 'Retrieve a paginated list of all jobs for the current integration'
|
|
333
339
|
* operationId: job.list
|
|
334
340
|
* parameters:
|
|
335
341
|
* - $ref: '#/components/parameters/ProjectId'
|
|
336
342
|
* - name: limit
|
|
337
343
|
* in: query
|
|
338
344
|
* required: false
|
|
339
|
-
* description: '
|
|
345
|
+
* description: 'Maximum number of jobs to return'
|
|
340
346
|
* schema:
|
|
341
347
|
* type: integer
|
|
348
|
+
* default: 25
|
|
349
|
+
* minimum: 1
|
|
350
|
+
* maximum: 100
|
|
342
351
|
* example: 25
|
|
343
352
|
* - name: offset
|
|
344
353
|
* in: query
|
|
345
354
|
* required: false
|
|
346
|
-
* description: 'Number of jobs to skip'
|
|
355
|
+
* description: 'Number of jobs to skip for pagination'
|
|
347
356
|
* schema:
|
|
348
357
|
* type: integer
|
|
358
|
+
* default: 0
|
|
359
|
+
* minimum: 0
|
|
349
360
|
* example: 0
|
|
350
361
|
* responses:
|
|
351
362
|
* 200:
|
|
352
|
-
* description: '
|
|
363
|
+
* description: 'List of jobs retrieved successfully'
|
|
353
364
|
* content:
|
|
354
365
|
* application/json:
|
|
355
366
|
* schema:
|
|
356
|
-
* $ref: '#/components/schemas/
|
|
367
|
+
* $ref: '#/components/schemas/JobListResponse'
|
|
357
368
|
*/
|
|
358
369
|
app.get('/all-jobs', api_call_1.default, json_response_1.default, (0, crowdin_client_1.default)({
|
|
359
370
|
config,
|
|
@@ -368,12 +379,14 @@ function addDefaultApiEndpoints(app, config) {
|
|
|
368
379
|
* tags:
|
|
369
380
|
* - 'Jobs'
|
|
370
381
|
* summary: 'Get Job Info'
|
|
382
|
+
* description: 'Retrieve detailed information about a specific job including progress, status, and timing data'
|
|
371
383
|
* operationId: job.info
|
|
372
384
|
* parameters:
|
|
373
385
|
* - $ref: '#/components/parameters/ProjectId'
|
|
374
386
|
* - name: jobId
|
|
375
387
|
* in: query
|
|
376
388
|
* required: true
|
|
389
|
+
* description: 'Unique identifier of the job. Get via [List Jobs](#operation/job.list)'
|
|
377
390
|
* schema:
|
|
378
391
|
* type: string
|
|
379
392
|
* example: 067da473-fc0b-43e3-b0a2-09d26af130c1
|
|
@@ -383,7 +396,19 @@ function addDefaultApiEndpoints(app, config) {
|
|
|
383
396
|
* content:
|
|
384
397
|
* application/json:
|
|
385
398
|
* schema:
|
|
386
|
-
* $ref: '#/components/schemas/
|
|
399
|
+
* $ref: '#/components/schemas/JobInfoResponse'
|
|
400
|
+
* 400:
|
|
401
|
+
* description: 'Bad Request - jobId parameter is missing'
|
|
402
|
+
* content:
|
|
403
|
+
* application/json:
|
|
404
|
+
* schema:
|
|
405
|
+
* $ref: '#/components/schemas/ErrorResponse'
|
|
406
|
+
* 404:
|
|
407
|
+
* description: 'Job not found'
|
|
408
|
+
* content:
|
|
409
|
+
* application/json:
|
|
410
|
+
* schema:
|
|
411
|
+
* $ref: '#/components/schemas/ErrorResponse'
|
|
387
412
|
*/
|
|
388
413
|
app.get('/job-info', api_call_1.default, json_response_1.default, (0, crowdin_client_1.default)({
|
|
389
414
|
config,
|
|
@@ -429,18 +454,32 @@ function addDefaultApiEndpoints(app, config) {
|
|
|
429
454
|
* tags:
|
|
430
455
|
* - 'Jobs'
|
|
431
456
|
* summary: 'Cancel Job'
|
|
457
|
+
* description: 'Cancel a running job. Only jobs with status "created" or "inProgress" can be canceled'
|
|
432
458
|
* operationId: job.cancel
|
|
433
459
|
* parameters:
|
|
434
460
|
* - $ref: '#/components/parameters/ProjectId'
|
|
435
461
|
* - name: jobId
|
|
436
462
|
* in: query
|
|
437
463
|
* required: true
|
|
464
|
+
* description: 'Unique identifier of the job to cancel. Get via [List Jobs](#operation/job.list)'
|
|
438
465
|
* schema:
|
|
439
466
|
* type: string
|
|
440
467
|
* example: 067da473-fc0b-43e3-b0a2-09d26af130c1
|
|
441
468
|
* responses:
|
|
442
469
|
* 204:
|
|
443
470
|
* description: 'Job canceled successfully'
|
|
471
|
+
* 400:
|
|
472
|
+
* description: 'Bad Request - jobId parameter is missing'
|
|
473
|
+
* content:
|
|
474
|
+
* application/json:
|
|
475
|
+
* schema:
|
|
476
|
+
* $ref: '#/components/schemas/ErrorResponse'
|
|
477
|
+
* 404:
|
|
478
|
+
* description: 'Job not found'
|
|
479
|
+
* content:
|
|
480
|
+
* application/json:
|
|
481
|
+
* schema:
|
|
482
|
+
* $ref: '#/components/schemas/ErrorResponse'
|
|
444
483
|
*/
|
|
445
484
|
app.delete('/jobs', api_call_1.default, json_response_1.default, (0, crowdin_client_1.default)({
|
|
446
485
|
config,
|
|
@@ -460,7 +499,7 @@ function addDefaultApiEndpoints(app, config) {
|
|
|
460
499
|
* - $ref: '#/components/parameters/ProjectId'
|
|
461
500
|
* responses:
|
|
462
501
|
* 200:
|
|
463
|
-
* description: '
|
|
502
|
+
* description: 'Application Settings'
|
|
464
503
|
* content:
|
|
465
504
|
* application/json:
|
|
466
505
|
* schema:
|
|
@@ -468,7 +507,7 @@ function addDefaultApiEndpoints(app, config) {
|
|
|
468
507
|
* data:
|
|
469
508
|
* $ref: '#/components/schemas/SettingsResponse'
|
|
470
509
|
*/
|
|
471
|
-
app.get('/settings', api_call_1.default, (0, crowdin_client_1.default)({
|
|
510
|
+
app.get('/settings', api_call_1.default, json_response_1.default, (0, crowdin_client_1.default)({
|
|
472
511
|
config,
|
|
473
512
|
optional: false,
|
|
474
513
|
checkSubscriptionExpiration: true,
|
|
@@ -510,6 +549,7 @@ function addDefaultApiEndpoints(app, config) {
|
|
|
510
549
|
* - name: provider
|
|
511
550
|
* in: query
|
|
512
551
|
* required: true
|
|
552
|
+
* description: 'Data source: "crowdin" for Crowdin file-language pairs, "integration" for integration files with sync schedule'
|
|
513
553
|
* schema:
|
|
514
554
|
* type: string
|
|
515
555
|
* enum:
|
|
@@ -638,6 +678,17 @@ function addSwagerApiDocumentation(app, config) {
|
|
|
638
678
|
servers: [
|
|
639
679
|
{
|
|
640
680
|
url: `{protocol}//{host}/api/v2/applications/${config.identifier}/api`,
|
|
681
|
+
variables: {
|
|
682
|
+
protocol: {
|
|
683
|
+
default: 'https',
|
|
684
|
+
enum: ['https', 'http'],
|
|
685
|
+
description: 'Protocol (https for production)',
|
|
686
|
+
},
|
|
687
|
+
host: {
|
|
688
|
+
default: 'crowdin.com',
|
|
689
|
+
description: 'Crowdin host (crowdin.com or {organization}.crowdin.com for Enterprise)',
|
|
690
|
+
},
|
|
691
|
+
},
|
|
641
692
|
},
|
|
642
693
|
],
|
|
643
694
|
},
|