@crowdin/app-project-module 0.107.0 → 0.108.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/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/workflow-step-type/types.d.ts +1 -1
- package/out/types.d.ts +2 -0
- package/out/util/connection.js +15 -4
- package/package.json +1 -1
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
|
},
|
package/out/modules/api/base.js
CHANGED
|
@@ -4,50 +4,100 @@
|
|
|
4
4
|
* schemas:
|
|
5
5
|
* CrowdinFiles:
|
|
6
6
|
* type: array
|
|
7
|
-
*
|
|
7
|
+
* description: 'List of Crowdin files and folders'
|
|
8
|
+
* example: [{id: '1', name: 'Landing pages'}, {id: '2', parentId: '1', name: 'Home Page', type: 'json'}]
|
|
8
9
|
* items:
|
|
9
10
|
* anyOf:
|
|
10
|
-
* -
|
|
11
|
+
* - type: object
|
|
12
|
+
* description: 'Folder'
|
|
13
|
+
* properties:
|
|
11
14
|
* id:
|
|
12
15
|
* type: string
|
|
16
|
+
* description: 'Unique identifier'
|
|
13
17
|
* name:
|
|
14
18
|
* type: string
|
|
15
|
-
*
|
|
19
|
+
* description: 'Folder name'
|
|
20
|
+
* parentId:
|
|
21
|
+
* type: string
|
|
22
|
+
* description: 'Parent folder identifier'
|
|
23
|
+
* - type: object
|
|
24
|
+
* description: 'File'
|
|
25
|
+
* properties:
|
|
16
26
|
* id:
|
|
17
27
|
* type: string
|
|
28
|
+
* description: 'Unique identifier'
|
|
18
29
|
* parentId:
|
|
19
30
|
* type: string
|
|
31
|
+
* description: 'Parent folder identifier'
|
|
20
32
|
* name:
|
|
21
33
|
* type: string
|
|
34
|
+
* description: 'File name'
|
|
22
35
|
* type:
|
|
23
36
|
* type: string
|
|
37
|
+
* description: 'File type (e.g., json, xml, html)'
|
|
38
|
+
* excludedTargetLanguages:
|
|
39
|
+
* type: array
|
|
40
|
+
* description: 'Languages excluded from translation'
|
|
41
|
+
* items:
|
|
42
|
+
* type: string
|
|
43
|
+
* NodeType:
|
|
44
|
+
* type: string
|
|
45
|
+
* description: 'Type of tree element'
|
|
46
|
+
* enum:
|
|
47
|
+
* - '0'
|
|
48
|
+
* - '1'
|
|
49
|
+
* - '2'
|
|
50
|
+
* x-enum-descriptions:
|
|
51
|
+
* - 'Folder'
|
|
52
|
+
* - 'File'
|
|
53
|
+
* - 'Branch'
|
|
24
54
|
* IntegrationFiles:
|
|
25
55
|
* type: array
|
|
26
|
-
*
|
|
56
|
+
* description: 'List of integration files and folders'
|
|
57
|
+
* example: [{id: '1', name: 'Landing pages'}, {id: '73291251883', name: 'Intro', parentId: '1', type: 'json'}]
|
|
27
58
|
* items:
|
|
28
59
|
* anyOf:
|
|
29
|
-
* -
|
|
60
|
+
* - type: object
|
|
61
|
+
* description: 'Folder'
|
|
62
|
+
* properties:
|
|
30
63
|
* id:
|
|
31
64
|
* type: string
|
|
65
|
+
* description: 'Unique identifier'
|
|
32
66
|
* name:
|
|
33
67
|
* type: string
|
|
34
|
-
*
|
|
68
|
+
* description: 'Folder name'
|
|
69
|
+
* parentId:
|
|
35
70
|
* type: string
|
|
36
|
-
*
|
|
71
|
+
* description: 'Parent folder identifier'
|
|
72
|
+
* - type: object
|
|
73
|
+
* description: 'File'
|
|
74
|
+
* properties:
|
|
75
|
+
* id:
|
|
37
76
|
* type: string
|
|
38
|
-
*
|
|
77
|
+
* description: 'Unique identifier'
|
|
39
78
|
* name:
|
|
40
79
|
* type: string
|
|
41
|
-
*
|
|
42
|
-
* type: string
|
|
80
|
+
* description: 'File name'
|
|
43
81
|
* parentId:
|
|
44
82
|
* type: string
|
|
83
|
+
* description: 'Parent folder identifier'
|
|
45
84
|
* type:
|
|
46
85
|
* type: string
|
|
47
|
-
*
|
|
48
|
-
*
|
|
86
|
+
* description: 'File type (e.g., json, xml, html)'
|
|
87
|
+
* isNew:
|
|
88
|
+
* type: boolean
|
|
89
|
+
* description: 'Whether file is new (not synced before)'
|
|
90
|
+
* isUpdated:
|
|
91
|
+
* type: boolean
|
|
92
|
+
* description: 'Whether file was updated since last sync'
|
|
93
|
+
* notSynced:
|
|
94
|
+
* type: boolean
|
|
95
|
+
* description: 'Whether file was never synced'
|
|
96
|
+
* synced:
|
|
97
|
+
* type: boolean
|
|
98
|
+
* description: 'Whether file is synced'
|
|
49
99
|
* UpdateCrowdinFiles:
|
|
50
|
-
* title: '
|
|
100
|
+
* title: 'Sync Files to Crowdin'
|
|
51
101
|
* required:
|
|
52
102
|
* - projectId
|
|
53
103
|
* - files
|
|
@@ -64,7 +114,7 @@
|
|
|
64
114
|
* default: false
|
|
65
115
|
* example: true
|
|
66
116
|
* FileLanguagePair:
|
|
67
|
-
* title: '
|
|
117
|
+
* title: 'Sync Translations to Integration'
|
|
68
118
|
* required:
|
|
69
119
|
* - projectId
|
|
70
120
|
* - files
|
|
@@ -134,7 +184,7 @@
|
|
|
134
184
|
* type:
|
|
135
185
|
* type: string
|
|
136
186
|
* node_type:
|
|
137
|
-
*
|
|
187
|
+
* $ref: '#/components/schemas/NodeType'
|
|
138
188
|
* schedule:
|
|
139
189
|
* type: boolean
|
|
140
190
|
* UpdateSyncSettingsData:
|
|
@@ -199,17 +249,45 @@
|
|
|
199
249
|
* type: integer
|
|
200
250
|
* example: 86
|
|
201
251
|
* LoginFieldsResponse:
|
|
202
|
-
* type:
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
* type:
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
252
|
+
* type: object
|
|
253
|
+
* properties:
|
|
254
|
+
* fields:
|
|
255
|
+
* type: array
|
|
256
|
+
* items:
|
|
257
|
+
* type: object
|
|
258
|
+
* properties:
|
|
259
|
+
* key:
|
|
260
|
+
* type: string
|
|
261
|
+
* description: 'Unique field identifier'
|
|
262
|
+
* example: 'apiKey'
|
|
263
|
+
* name:
|
|
264
|
+
* type: string
|
|
265
|
+
* description: 'Human-readable field label'
|
|
266
|
+
* example: 'Service API key'
|
|
267
|
+
* type:
|
|
268
|
+
* type: string
|
|
269
|
+
* description: 'Field input type'
|
|
270
|
+
* enum:
|
|
271
|
+
* - text
|
|
272
|
+
* - password
|
|
273
|
+
* - checkbox
|
|
274
|
+
* - select
|
|
275
|
+
* - textarea
|
|
276
|
+
* - file
|
|
277
|
+
* - notice
|
|
278
|
+
* example: 'password'
|
|
279
|
+
* options:
|
|
280
|
+
* type: array
|
|
281
|
+
* description: 'Available options (only for select type)'
|
|
282
|
+
* items:
|
|
283
|
+
* type: object
|
|
284
|
+
* properties:
|
|
285
|
+
* label:
|
|
286
|
+
* type: string
|
|
287
|
+
* value:
|
|
288
|
+
* type: string
|
|
289
|
+
* example:
|
|
290
|
+
* fields: [{ key: 'email', name: 'User email', type: 'text' }, { key: 'password', name: 'User password', type: 'password' }]
|
|
213
291
|
* Login:
|
|
214
292
|
* title: 'Login'
|
|
215
293
|
* required:
|
|
@@ -226,8 +304,146 @@
|
|
|
226
304
|
* type: object
|
|
227
305
|
* description: 'Login Form Fields. Get via [Integration Login Form Fields](#operation/integration.fields)'
|
|
228
306
|
* example: { email: 'user@crowdin.com', password: 'password' }
|
|
307
|
+
* JobStatus:
|
|
308
|
+
* type: string
|
|
309
|
+
* description: 'Possible job statuses'
|
|
310
|
+
* enum:
|
|
311
|
+
* - created
|
|
312
|
+
* - inProgress
|
|
313
|
+
* - finished
|
|
314
|
+
* - failed
|
|
315
|
+
* - canceled
|
|
316
|
+
* JobType:
|
|
317
|
+
* type: string
|
|
318
|
+
* description: 'Possible job types'
|
|
319
|
+
* enum:
|
|
320
|
+
* - updateCrowdin
|
|
321
|
+
* - updateIntegration
|
|
322
|
+
* - crowdinSyncSettingsSave
|
|
323
|
+
* - integrationSyncSettingsSave
|
|
324
|
+
* JobListItem:
|
|
325
|
+
* type: object
|
|
326
|
+
* description: 'Job item returned in list response'
|
|
327
|
+
* properties:
|
|
328
|
+
* id:
|
|
329
|
+
* type: string
|
|
330
|
+
* description: 'Unique identifier of the job'
|
|
331
|
+
* example: '067da473-fc0b-43e3-b0a2-09d26af130c1'
|
|
332
|
+
* progress:
|
|
333
|
+
* type: integer
|
|
334
|
+
* description: 'Current progress percentage (0-100)'
|
|
335
|
+
* minimum: 0
|
|
336
|
+
* maximum: 100
|
|
337
|
+
* example: 94
|
|
338
|
+
* status:
|
|
339
|
+
* $ref: '#/components/schemas/JobStatus'
|
|
340
|
+
* title:
|
|
341
|
+
* type: string
|
|
342
|
+
* description: 'Human-readable title of the job'
|
|
343
|
+
* example: 'Sync files to Crowdin'
|
|
344
|
+
* type:
|
|
345
|
+
* $ref: '#/components/schemas/JobType'
|
|
346
|
+
* createdAt:
|
|
347
|
+
* type: string
|
|
348
|
+
* format: date-time
|
|
349
|
+
* description: 'ISO 8601 timestamp when the job was created'
|
|
350
|
+
* example: '2024-01-15T10:30:00.000Z'
|
|
351
|
+
* finishedAt:
|
|
352
|
+
* type: string
|
|
353
|
+
* format: date-time
|
|
354
|
+
* nullable: true
|
|
355
|
+
* description: 'ISO 8601 timestamp when the job finished (null if not finished)'
|
|
356
|
+
* example: '2024-01-15T10:35:00.000Z'
|
|
229
357
|
* Job:
|
|
230
358
|
* type: object
|
|
359
|
+
* description: 'Detailed job information'
|
|
360
|
+
* properties:
|
|
361
|
+
* id:
|
|
362
|
+
* type: string
|
|
363
|
+
* description: 'Unique identifier of the job'
|
|
364
|
+
* example: '067da473-fc0b-43e3-b0a2-09d26af130c1'
|
|
365
|
+
* progress:
|
|
366
|
+
* type: integer
|
|
367
|
+
* description: 'Current progress percentage (0-100)'
|
|
368
|
+
* minimum: 0
|
|
369
|
+
* maximum: 100
|
|
370
|
+
* example: 94
|
|
371
|
+
* status:
|
|
372
|
+
* $ref: '#/components/schemas/JobStatus'
|
|
373
|
+
* title:
|
|
374
|
+
* type: string
|
|
375
|
+
* description: 'Human-readable title of the job'
|
|
376
|
+
* example: 'Sync files to Crowdin'
|
|
377
|
+
* type:
|
|
378
|
+
* $ref: '#/components/schemas/JobType'
|
|
379
|
+
* info:
|
|
380
|
+
* type: string
|
|
381
|
+
* nullable: true
|
|
382
|
+
* description: 'Additional information about the job progress (e.g., ETA)'
|
|
383
|
+
* example: 'About 2 minutes remaining'
|
|
384
|
+
* data:
|
|
385
|
+
* type: object
|
|
386
|
+
* nullable: true
|
|
387
|
+
* description: 'Additional data associated with the job'
|
|
388
|
+
* payload:
|
|
389
|
+
* type: object
|
|
390
|
+
* nullable: true
|
|
391
|
+
* description: 'Original payload used to create the job'
|
|
392
|
+
* attempt:
|
|
393
|
+
* type: integer
|
|
394
|
+
* nullable: true
|
|
395
|
+
* description: 'Current attempt number for retried jobs'
|
|
396
|
+
* example: 1
|
|
397
|
+
* eta:
|
|
398
|
+
* type: number
|
|
399
|
+
* nullable: true
|
|
400
|
+
* description: 'Estimated time remaining in milliseconds'
|
|
401
|
+
* example: 120000
|
|
402
|
+
* createdAt:
|
|
403
|
+
* type: string
|
|
404
|
+
* format: date-time
|
|
405
|
+
* description: 'ISO 8601 timestamp when the job was created'
|
|
406
|
+
* example: '2024-01-15T10:30:00.000Z'
|
|
407
|
+
* updatedAt:
|
|
408
|
+
* type: string
|
|
409
|
+
* format: date-time
|
|
410
|
+
* nullable: true
|
|
411
|
+
* description: 'ISO 8601 timestamp when the job was last updated'
|
|
412
|
+
* example: '2024-01-15T10:32:00.000Z'
|
|
413
|
+
* finishedAt:
|
|
414
|
+
* type: string
|
|
415
|
+
* format: date-time
|
|
416
|
+
* nullable: true
|
|
417
|
+
* description: 'ISO 8601 timestamp when the job finished'
|
|
418
|
+
* example: '2024-01-15T10:35:00.000Z'
|
|
419
|
+
* JobListResponse:
|
|
420
|
+
* type: object
|
|
421
|
+
* description: 'List of jobs response'
|
|
422
|
+
* properties:
|
|
423
|
+
* data:
|
|
424
|
+
* type: array
|
|
425
|
+
* items:
|
|
426
|
+
* $ref: '#/components/schemas/JobListItem'
|
|
427
|
+
* JobInfoResponse:
|
|
428
|
+
* type: object
|
|
429
|
+
* description: 'Single job info response'
|
|
430
|
+
* properties:
|
|
431
|
+
* data:
|
|
432
|
+
* $ref: '#/components/schemas/Job'
|
|
433
|
+
* ErrorResponse:
|
|
434
|
+
* type: object
|
|
435
|
+
* properties:
|
|
436
|
+
* error:
|
|
437
|
+
* type: object
|
|
438
|
+
* properties:
|
|
439
|
+
* message:
|
|
440
|
+
* type: string
|
|
441
|
+
* description: 'Error message describing what went wrong'
|
|
442
|
+
* example: 'jobId is required'
|
|
443
|
+
* JobBasic:
|
|
444
|
+
* type: object
|
|
445
|
+
* deprecated: true
|
|
446
|
+
* description: 'Basic job info (deprecated format)'
|
|
231
447
|
* properties:
|
|
232
448
|
* id:
|
|
233
449
|
* type: string
|
|
@@ -247,11 +463,13 @@
|
|
|
247
463
|
* example: 'Sync files to Crowdin'
|
|
248
464
|
* JobResponse:
|
|
249
465
|
* type: object
|
|
466
|
+
* deprecated: true
|
|
467
|
+
* description: 'Deprecated. Use Job or JobListResponse instead'
|
|
250
468
|
* properties:
|
|
251
469
|
* data:
|
|
252
470
|
* type: array
|
|
253
471
|
* items:
|
|
254
|
-
* $ref: '#/components/schemas/
|
|
472
|
+
* $ref: '#/components/schemas/JobBasic'
|
|
255
473
|
*
|
|
256
474
|
* parameters:
|
|
257
475
|
* ProjectId:
|
|
@@ -262,4 +480,10 @@
|
|
|
262
480
|
* schema:
|
|
263
481
|
* type: integer
|
|
264
482
|
* example: 12
|
|
483
|
+
*
|
|
484
|
+
* securitySchemes:
|
|
485
|
+
* bearerAuth:
|
|
486
|
+
* type: http
|
|
487
|
+
* scheme: bearer
|
|
488
|
+
* description: 'Crowdin API Personal Access Token. Get via [Account Settings](https://crowdin.com/settings#api-key)'
|
|
265
489
|
*/
|
|
@@ -5,50 +5,100 @@
|
|
|
5
5
|
* schemas:
|
|
6
6
|
* CrowdinFiles:
|
|
7
7
|
* type: array
|
|
8
|
-
*
|
|
8
|
+
* description: 'List of Crowdin files and folders'
|
|
9
|
+
* example: [{id: '1', name: 'Landing pages'}, {id: '2', parentId: '1', name: 'Home Page', type: 'json'}]
|
|
9
10
|
* items:
|
|
10
11
|
* anyOf:
|
|
11
|
-
* -
|
|
12
|
+
* - type: object
|
|
13
|
+
* description: 'Folder'
|
|
14
|
+
* properties:
|
|
12
15
|
* id:
|
|
13
16
|
* type: string
|
|
17
|
+
* description: 'Unique identifier'
|
|
14
18
|
* name:
|
|
15
19
|
* type: string
|
|
16
|
-
*
|
|
20
|
+
* description: 'Folder name'
|
|
21
|
+
* parentId:
|
|
22
|
+
* type: string
|
|
23
|
+
* description: 'Parent folder identifier'
|
|
24
|
+
* - type: object
|
|
25
|
+
* description: 'File'
|
|
26
|
+
* properties:
|
|
17
27
|
* id:
|
|
18
28
|
* type: string
|
|
29
|
+
* description: 'Unique identifier'
|
|
19
30
|
* parentId:
|
|
20
31
|
* type: string
|
|
32
|
+
* description: 'Parent folder identifier'
|
|
21
33
|
* name:
|
|
22
34
|
* type: string
|
|
35
|
+
* description: 'File name'
|
|
23
36
|
* type:
|
|
24
37
|
* type: string
|
|
38
|
+
* description: 'File type (e.g., json, xml, html)'
|
|
39
|
+
* excludedTargetLanguages:
|
|
40
|
+
* type: array
|
|
41
|
+
* description: 'Languages excluded from translation'
|
|
42
|
+
* items:
|
|
43
|
+
* type: string
|
|
44
|
+
* NodeType:
|
|
45
|
+
* type: string
|
|
46
|
+
* description: 'Type of tree element'
|
|
47
|
+
* enum:
|
|
48
|
+
* - '0'
|
|
49
|
+
* - '1'
|
|
50
|
+
* - '2'
|
|
51
|
+
* x-enum-descriptions:
|
|
52
|
+
* - 'Folder'
|
|
53
|
+
* - 'File'
|
|
54
|
+
* - 'Branch'
|
|
25
55
|
* IntegrationFiles:
|
|
26
56
|
* type: array
|
|
27
|
-
*
|
|
57
|
+
* description: 'List of integration files and folders'
|
|
58
|
+
* example: [{id: '1', name: 'Landing pages'}, {id: '73291251883', name: 'Intro', parentId: '1', type: 'json'}]
|
|
28
59
|
* items:
|
|
29
60
|
* anyOf:
|
|
30
|
-
* -
|
|
61
|
+
* - type: object
|
|
62
|
+
* description: 'Folder'
|
|
63
|
+
* properties:
|
|
31
64
|
* id:
|
|
32
65
|
* type: string
|
|
66
|
+
* description: 'Unique identifier'
|
|
33
67
|
* name:
|
|
34
68
|
* type: string
|
|
35
|
-
*
|
|
69
|
+
* description: 'Folder name'
|
|
70
|
+
* parentId:
|
|
36
71
|
* type: string
|
|
37
|
-
*
|
|
72
|
+
* description: 'Parent folder identifier'
|
|
73
|
+
* - type: object
|
|
74
|
+
* description: 'File'
|
|
75
|
+
* properties:
|
|
76
|
+
* id:
|
|
38
77
|
* type: string
|
|
39
|
-
*
|
|
78
|
+
* description: 'Unique identifier'
|
|
40
79
|
* name:
|
|
41
80
|
* type: string
|
|
42
|
-
*
|
|
43
|
-
* type: string
|
|
81
|
+
* description: 'File name'
|
|
44
82
|
* parentId:
|
|
45
83
|
* type: string
|
|
84
|
+
* description: 'Parent folder identifier'
|
|
46
85
|
* type:
|
|
47
86
|
* type: string
|
|
48
|
-
*
|
|
49
|
-
*
|
|
87
|
+
* description: 'File type (e.g., json, xml, html)'
|
|
88
|
+
* isNew:
|
|
89
|
+
* type: boolean
|
|
90
|
+
* description: 'Whether file is new (not synced before)'
|
|
91
|
+
* isUpdated:
|
|
92
|
+
* type: boolean
|
|
93
|
+
* description: 'Whether file was updated since last sync'
|
|
94
|
+
* notSynced:
|
|
95
|
+
* type: boolean
|
|
96
|
+
* description: 'Whether file was never synced'
|
|
97
|
+
* synced:
|
|
98
|
+
* type: boolean
|
|
99
|
+
* description: 'Whether file is synced'
|
|
50
100
|
* UpdateCrowdinFiles:
|
|
51
|
-
* title: '
|
|
101
|
+
* title: 'Sync Files to Crowdin'
|
|
52
102
|
* required:
|
|
53
103
|
* - projectId
|
|
54
104
|
* - files
|
|
@@ -65,7 +115,7 @@
|
|
|
65
115
|
* default: false
|
|
66
116
|
* example: true
|
|
67
117
|
* FileLanguagePair:
|
|
68
|
-
* title: '
|
|
118
|
+
* title: 'Sync Translations to Integration'
|
|
69
119
|
* required:
|
|
70
120
|
* - projectId
|
|
71
121
|
* - files
|
|
@@ -135,7 +185,7 @@
|
|
|
135
185
|
* type:
|
|
136
186
|
* type: string
|
|
137
187
|
* node_type:
|
|
138
|
-
*
|
|
188
|
+
* $ref: '#/components/schemas/NodeType'
|
|
139
189
|
* schedule:
|
|
140
190
|
* type: boolean
|
|
141
191
|
* UpdateSyncSettingsData:
|
|
@@ -200,17 +250,45 @@
|
|
|
200
250
|
* type: integer
|
|
201
251
|
* example: 86
|
|
202
252
|
* LoginFieldsResponse:
|
|
203
|
-
* type:
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
* type:
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
253
|
+
* type: object
|
|
254
|
+
* properties:
|
|
255
|
+
* fields:
|
|
256
|
+
* type: array
|
|
257
|
+
* items:
|
|
258
|
+
* type: object
|
|
259
|
+
* properties:
|
|
260
|
+
* key:
|
|
261
|
+
* type: string
|
|
262
|
+
* description: 'Unique field identifier'
|
|
263
|
+
* example: 'apiKey'
|
|
264
|
+
* name:
|
|
265
|
+
* type: string
|
|
266
|
+
* description: 'Human-readable field label'
|
|
267
|
+
* example: 'Service API key'
|
|
268
|
+
* type:
|
|
269
|
+
* type: string
|
|
270
|
+
* description: 'Field input type'
|
|
271
|
+
* enum:
|
|
272
|
+
* - text
|
|
273
|
+
* - password
|
|
274
|
+
* - checkbox
|
|
275
|
+
* - select
|
|
276
|
+
* - textarea
|
|
277
|
+
* - file
|
|
278
|
+
* - notice
|
|
279
|
+
* example: 'password'
|
|
280
|
+
* options:
|
|
281
|
+
* type: array
|
|
282
|
+
* description: 'Available options (only for select type)'
|
|
283
|
+
* items:
|
|
284
|
+
* type: object
|
|
285
|
+
* properties:
|
|
286
|
+
* label:
|
|
287
|
+
* type: string
|
|
288
|
+
* value:
|
|
289
|
+
* type: string
|
|
290
|
+
* example:
|
|
291
|
+
* fields: [{ key: 'email', name: 'User email', type: 'text' }, { key: 'password', name: 'User password', type: 'password' }]
|
|
214
292
|
* Login:
|
|
215
293
|
* title: 'Login'
|
|
216
294
|
* required:
|
|
@@ -227,8 +305,146 @@
|
|
|
227
305
|
* type: object
|
|
228
306
|
* description: 'Login Form Fields. Get via [Integration Login Form Fields](#operation/integration.fields)'
|
|
229
307
|
* example: { email: 'user@crowdin.com', password: 'password' }
|
|
308
|
+
* JobStatus:
|
|
309
|
+
* type: string
|
|
310
|
+
* description: 'Possible job statuses'
|
|
311
|
+
* enum:
|
|
312
|
+
* - created
|
|
313
|
+
* - inProgress
|
|
314
|
+
* - finished
|
|
315
|
+
* - failed
|
|
316
|
+
* - canceled
|
|
317
|
+
* JobType:
|
|
318
|
+
* type: string
|
|
319
|
+
* description: 'Possible job types'
|
|
320
|
+
* enum:
|
|
321
|
+
* - updateCrowdin
|
|
322
|
+
* - updateIntegration
|
|
323
|
+
* - crowdinSyncSettingsSave
|
|
324
|
+
* - integrationSyncSettingsSave
|
|
325
|
+
* JobListItem:
|
|
326
|
+
* type: object
|
|
327
|
+
* description: 'Job item returned in list response'
|
|
328
|
+
* properties:
|
|
329
|
+
* id:
|
|
330
|
+
* type: string
|
|
331
|
+
* description: 'Unique identifier of the job'
|
|
332
|
+
* example: '067da473-fc0b-43e3-b0a2-09d26af130c1'
|
|
333
|
+
* progress:
|
|
334
|
+
* type: integer
|
|
335
|
+
* description: 'Current progress percentage (0-100)'
|
|
336
|
+
* minimum: 0
|
|
337
|
+
* maximum: 100
|
|
338
|
+
* example: 94
|
|
339
|
+
* status:
|
|
340
|
+
* $ref: '#/components/schemas/JobStatus'
|
|
341
|
+
* title:
|
|
342
|
+
* type: string
|
|
343
|
+
* description: 'Human-readable title of the job'
|
|
344
|
+
* example: 'Sync files to Crowdin'
|
|
345
|
+
* type:
|
|
346
|
+
* $ref: '#/components/schemas/JobType'
|
|
347
|
+
* createdAt:
|
|
348
|
+
* type: string
|
|
349
|
+
* format: date-time
|
|
350
|
+
* description: 'ISO 8601 timestamp when the job was created'
|
|
351
|
+
* example: '2024-01-15T10:30:00.000Z'
|
|
352
|
+
* finishedAt:
|
|
353
|
+
* type: string
|
|
354
|
+
* format: date-time
|
|
355
|
+
* nullable: true
|
|
356
|
+
* description: 'ISO 8601 timestamp when the job finished (null if not finished)'
|
|
357
|
+
* example: '2024-01-15T10:35:00.000Z'
|
|
230
358
|
* Job:
|
|
231
359
|
* type: object
|
|
360
|
+
* description: 'Detailed job information'
|
|
361
|
+
* properties:
|
|
362
|
+
* id:
|
|
363
|
+
* type: string
|
|
364
|
+
* description: 'Unique identifier of the job'
|
|
365
|
+
* example: '067da473-fc0b-43e3-b0a2-09d26af130c1'
|
|
366
|
+
* progress:
|
|
367
|
+
* type: integer
|
|
368
|
+
* description: 'Current progress percentage (0-100)'
|
|
369
|
+
* minimum: 0
|
|
370
|
+
* maximum: 100
|
|
371
|
+
* example: 94
|
|
372
|
+
* status:
|
|
373
|
+
* $ref: '#/components/schemas/JobStatus'
|
|
374
|
+
* title:
|
|
375
|
+
* type: string
|
|
376
|
+
* description: 'Human-readable title of the job'
|
|
377
|
+
* example: 'Sync files to Crowdin'
|
|
378
|
+
* type:
|
|
379
|
+
* $ref: '#/components/schemas/JobType'
|
|
380
|
+
* info:
|
|
381
|
+
* type: string
|
|
382
|
+
* nullable: true
|
|
383
|
+
* description: 'Additional information about the job progress (e.g., ETA)'
|
|
384
|
+
* example: 'About 2 minutes remaining'
|
|
385
|
+
* data:
|
|
386
|
+
* type: object
|
|
387
|
+
* nullable: true
|
|
388
|
+
* description: 'Additional data associated with the job'
|
|
389
|
+
* payload:
|
|
390
|
+
* type: object
|
|
391
|
+
* nullable: true
|
|
392
|
+
* description: 'Original payload used to create the job'
|
|
393
|
+
* attempt:
|
|
394
|
+
* type: integer
|
|
395
|
+
* nullable: true
|
|
396
|
+
* description: 'Current attempt number for retried jobs'
|
|
397
|
+
* example: 1
|
|
398
|
+
* eta:
|
|
399
|
+
* type: number
|
|
400
|
+
* nullable: true
|
|
401
|
+
* description: 'Estimated time remaining in milliseconds'
|
|
402
|
+
* example: 120000
|
|
403
|
+
* createdAt:
|
|
404
|
+
* type: string
|
|
405
|
+
* format: date-time
|
|
406
|
+
* description: 'ISO 8601 timestamp when the job was created'
|
|
407
|
+
* example: '2024-01-15T10:30:00.000Z'
|
|
408
|
+
* updatedAt:
|
|
409
|
+
* type: string
|
|
410
|
+
* format: date-time
|
|
411
|
+
* nullable: true
|
|
412
|
+
* description: 'ISO 8601 timestamp when the job was last updated'
|
|
413
|
+
* example: '2024-01-15T10:32:00.000Z'
|
|
414
|
+
* finishedAt:
|
|
415
|
+
* type: string
|
|
416
|
+
* format: date-time
|
|
417
|
+
* nullable: true
|
|
418
|
+
* description: 'ISO 8601 timestamp when the job finished'
|
|
419
|
+
* example: '2024-01-15T10:35:00.000Z'
|
|
420
|
+
* JobListResponse:
|
|
421
|
+
* type: object
|
|
422
|
+
* description: 'List of jobs response'
|
|
423
|
+
* properties:
|
|
424
|
+
* data:
|
|
425
|
+
* type: array
|
|
426
|
+
* items:
|
|
427
|
+
* $ref: '#/components/schemas/JobListItem'
|
|
428
|
+
* JobInfoResponse:
|
|
429
|
+
* type: object
|
|
430
|
+
* description: 'Single job info response'
|
|
431
|
+
* properties:
|
|
432
|
+
* data:
|
|
433
|
+
* $ref: '#/components/schemas/Job'
|
|
434
|
+
* ErrorResponse:
|
|
435
|
+
* type: object
|
|
436
|
+
* properties:
|
|
437
|
+
* error:
|
|
438
|
+
* type: object
|
|
439
|
+
* properties:
|
|
440
|
+
* message:
|
|
441
|
+
* type: string
|
|
442
|
+
* description: 'Error message describing what went wrong'
|
|
443
|
+
* example: 'jobId is required'
|
|
444
|
+
* JobBasic:
|
|
445
|
+
* type: object
|
|
446
|
+
* deprecated: true
|
|
447
|
+
* description: 'Basic job info (deprecated format)'
|
|
232
448
|
* properties:
|
|
233
449
|
* id:
|
|
234
450
|
* type: string
|
|
@@ -248,11 +464,13 @@
|
|
|
248
464
|
* example: 'Sync files to Crowdin'
|
|
249
465
|
* JobResponse:
|
|
250
466
|
* type: object
|
|
467
|
+
* deprecated: true
|
|
468
|
+
* description: 'Deprecated. Use Job or JobListResponse instead'
|
|
251
469
|
* properties:
|
|
252
470
|
* data:
|
|
253
471
|
* type: array
|
|
254
472
|
* items:
|
|
255
|
-
* $ref: '#/components/schemas/
|
|
473
|
+
* $ref: '#/components/schemas/JobBasic'
|
|
256
474
|
*
|
|
257
475
|
* parameters:
|
|
258
476
|
* ProjectId:
|
|
@@ -263,4 +481,10 @@
|
|
|
263
481
|
* schema:
|
|
264
482
|
* type: integer
|
|
265
483
|
* example: 12
|
|
484
|
+
*
|
|
485
|
+
* securitySchemes:
|
|
486
|
+
* bearerAuth:
|
|
487
|
+
* type: http
|
|
488
|
+
* scheme: bearer
|
|
489
|
+
* description: 'Crowdin API Personal Access Token. Get via [Account Settings](https://crowdin.com/settings#api-key)'
|
|
266
490
|
*/
|
|
@@ -12,7 +12,7 @@ interface Output {
|
|
|
12
12
|
title: string;
|
|
13
13
|
port: Port;
|
|
14
14
|
}
|
|
15
|
-
type Port = '
|
|
15
|
+
type Port = 'false' | 'true' | 'untranslated' | 'translated' | 'approved' | 'skipped' | 'all' | 'initial';
|
|
16
16
|
export interface WorkflowStepTypeModule extends ModuleKey, ImagePath {
|
|
17
17
|
/**
|
|
18
18
|
* module name
|
package/out/types.d.ts
CHANGED
package/out/util/connection.js
CHANGED
|
@@ -49,7 +49,7 @@ const defaults_1 = require("../modules/integration/util/defaults");
|
|
|
49
49
|
const crowdinAppFunctions = __importStar(require("@crowdin/crowdin-apps-functions"));
|
|
50
50
|
const axiosCustom = new axios_2.AxiosProvider().axios;
|
|
51
51
|
function prepareCrowdinClient({ config, credentials, autoRenew = false, context, }) {
|
|
52
|
-
var _a, _b, _c, _d, _e;
|
|
52
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
53
53
|
return __awaiter(this, void 0, void 0, function* () {
|
|
54
54
|
let userAgent;
|
|
55
55
|
if (config.crowdinApiUserAgent) {
|
|
@@ -78,7 +78,12 @@ function prepareCrowdinClient({ config, credentials, autoRenew = false, context,
|
|
|
78
78
|
});
|
|
79
79
|
const token = freshToken.accessToken;
|
|
80
80
|
return {
|
|
81
|
-
client: new crowdin_api_client_1.default({
|
|
81
|
+
client: new crowdin_api_client_1.default({
|
|
82
|
+
token,
|
|
83
|
+
organization,
|
|
84
|
+
apiDomain: (_c = config.crowdinUrls) === null || _c === void 0 ? void 0 : _c.apiDomain,
|
|
85
|
+
baseUrl: (_d = config.crowdinUrls) === null || _d === void 0 ? void 0 : _d.apiUrl,
|
|
86
|
+
}, { userAgent }),
|
|
82
87
|
token,
|
|
83
88
|
};
|
|
84
89
|
}
|
|
@@ -95,7 +100,12 @@ function prepareCrowdinClient({ config, credentials, autoRenew = false, context,
|
|
|
95
100
|
}
|
|
96
101
|
if (!autoRenew) {
|
|
97
102
|
return {
|
|
98
|
-
client: new crowdin_api_client_1.default({
|
|
103
|
+
client: new crowdin_api_client_1.default({
|
|
104
|
+
token,
|
|
105
|
+
organization,
|
|
106
|
+
apiDomain: (_e = config.crowdinUrls) === null || _e === void 0 ? void 0 : _e.apiDomain,
|
|
107
|
+
baseUrl: (_f = config.crowdinUrls) === null || _f === void 0 ? void 0 : _f.apiUrl,
|
|
108
|
+
}, { userAgent }),
|
|
99
109
|
token,
|
|
100
110
|
};
|
|
101
111
|
}
|
|
@@ -125,7 +135,8 @@ function prepareCrowdinClient({ config, credentials, autoRenew = false, context,
|
|
|
125
135
|
client: new crowdin_api_client_1.default({
|
|
126
136
|
token,
|
|
127
137
|
organization,
|
|
128
|
-
|
|
138
|
+
apiDomain: (_g = config.crowdinUrls) === null || _g === void 0 ? void 0 : _g.apiDomain,
|
|
139
|
+
baseUrl: (_h = config.crowdinUrls) === null || _h === void 0 ? void 0 : _h.apiUrl,
|
|
129
140
|
}, {
|
|
130
141
|
httpClient: {
|
|
131
142
|
get(url, httpConfig) {
|
package/package.json
CHANGED