@crowdin/n8n-nodes-crowdin 0.1.4 → 0.2.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/dist/nodes/Crowdin/CrowdinEnterpriseFileBasedTrigger.node.js +5 -167
- package/dist/nodes/Crowdin/CrowdinEnterpriseFileBasedTrigger.node.js.map +1 -1
- package/dist/nodes/Crowdin/CrowdinEnterpriseStringBasedTrigger.node.js +5 -132
- package/dist/nodes/Crowdin/CrowdinEnterpriseStringBasedTrigger.node.js.map +1 -1
- package/dist/nodes/Crowdin/CrowdinFileBasedTrigger.node.js +5 -157
- package/dist/nodes/Crowdin/CrowdinFileBasedTrigger.node.js.map +1 -1
- package/dist/nodes/Crowdin/CrowdinStringBasedTrigger.node.js +5 -122
- package/dist/nodes/Crowdin/CrowdinStringBasedTrigger.node.js.map +1 -1
- package/dist/nodes/Crowdin/methods/common/helpers.d.ts +1 -0
- package/dist/nodes/Crowdin/methods/common/helpers.js +5 -0
- package/dist/nodes/Crowdin/methods/common/helpers.js.map +1 -1
- package/dist/nodes/Crowdin/methods/common/index.js +41 -3
- package/dist/nodes/Crowdin/methods/common/index.js.map +1 -1
- package/dist/nodes/Crowdin/properties/crowdin/fileBased/index.js +21 -14
- package/dist/nodes/Crowdin/properties/crowdin/fileBased/index.js.map +1 -1
- package/dist/nodes/Crowdin/properties/crowdin/fileBased/integrations.d.ts +2 -0
- package/dist/nodes/Crowdin/properties/crowdin/fileBased/integrations.js +1688 -0
- package/dist/nodes/Crowdin/properties/crowdin/fileBased/integrations.js.map +1 -0
- package/dist/nodes/Crowdin/properties/enterprise/fileBased/index.js +94 -87
- package/dist/nodes/Crowdin/properties/enterprise/fileBased/index.js.map +1 -1
- package/dist/nodes/Crowdin/properties/enterprise/fileBased/integrations.d.ts +2 -0
- package/dist/nodes/Crowdin/properties/enterprise/fileBased/integrations.js +1688 -0
- package/dist/nodes/Crowdin/properties/enterprise/fileBased/integrations.js.map +1 -0
- package/dist/nodes/Crowdin/properties/enterprise/fileBased/projectsAndGroups.js +4 -1
- package/dist/nodes/Crowdin/properties/enterprise/fileBased/projectsAndGroups.js.map +1 -1
- package/dist/nodes/Crowdin/properties/enterprise/stringBased/projectsAndGroups.js +4 -1
- package/dist/nodes/Crowdin/properties/enterprise/stringBased/projectsAndGroups.js.map +1 -1
- package/dist/nodes/Crowdin/properties/enterprise/stringBased/webhooks.js +8 -0
- package/dist/nodes/Crowdin/properties/enterprise/stringBased/webhooks.js.map +1 -1
- package/dist/nodes/Crowdin/triggers/crowdin/fileBased/events.d.ts +9 -0
- package/dist/nodes/Crowdin/triggers/crowdin/fileBased/events.js +158 -0
- package/dist/nodes/Crowdin/triggers/crowdin/fileBased/events.js.map +1 -0
- package/dist/nodes/Crowdin/triggers/crowdin/stringBased/events.d.ts +9 -0
- package/dist/nodes/Crowdin/triggers/crowdin/stringBased/events.js +123 -0
- package/dist/nodes/Crowdin/triggers/crowdin/stringBased/events.js.map +1 -0
- package/dist/nodes/Crowdin/triggers/enterprise/fileBased/events.d.ts +9 -0
- package/dist/nodes/Crowdin/triggers/enterprise/fileBased/events.js +166 -0
- package/dist/nodes/Crowdin/triggers/enterprise/fileBased/events.js.map +1 -0
- package/dist/nodes/Crowdin/triggers/enterprise/stringBased/events.d.ts +9 -0
- package/dist/nodes/Crowdin/triggers/enterprise/stringBased/events.js +131 -0
- package/dist/nodes/Crowdin/triggers/enterprise/stringBased/events.js.map +1 -0
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -4,169 +4,7 @@ exports.CrowdinEnterpriseFileBasedTrigger = void 0;
|
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
5
|
const api_1 = require("./utils/api");
|
|
6
6
|
const enterprise_1 = require("./methods/enterprise");
|
|
7
|
-
const
|
|
8
|
-
const FILE_BASED_EVENTS = [
|
|
9
|
-
{
|
|
10
|
-
name: '[Organization] Project created',
|
|
11
|
-
value: 'project.created',
|
|
12
|
-
description: 'A project is created',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: '[Organization] Project deleted',
|
|
16
|
-
value: 'project.deleted',
|
|
17
|
-
description: 'A project is deleted',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: '[Organization] Group created',
|
|
21
|
-
value: 'group.created',
|
|
22
|
-
description: 'A group is created',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: '[Organization] Group deleted',
|
|
26
|
-
value: 'group.deleted',
|
|
27
|
-
description: 'A group is deleted',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: 'Project fully translated',
|
|
31
|
-
value: 'project.translated',
|
|
32
|
-
description: 'All files are translated into one of the target languages',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: 'Project fully reviewed',
|
|
36
|
-
value: 'project.approved',
|
|
37
|
-
description: 'Translations in all files are approved for one of the target languages',
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: 'Project successfully built',
|
|
41
|
-
value: 'project.built',
|
|
42
|
-
description: 'A project is built successfully',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: 'Project QA check finished',
|
|
46
|
-
value: 'project.qa.finished',
|
|
47
|
-
description: 'QA check for all strings in the project is finished',
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
name: 'File added',
|
|
51
|
-
value: 'file.added',
|
|
52
|
-
description: 'A new file is added to the project',
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
name: 'File updated',
|
|
56
|
-
value: 'file.updated',
|
|
57
|
-
description: 'A file is updated',
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
name: 'File deleted',
|
|
61
|
-
value: 'file.deleted',
|
|
62
|
-
description: 'A file is deleted',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
name: 'File reverted',
|
|
66
|
-
value: 'file.reverted',
|
|
67
|
-
description: 'A file is reverted to the previous revision',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: 'File fully translated',
|
|
71
|
-
value: 'file.translated',
|
|
72
|
-
description: 'A file is translated into one of the target languages',
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: 'File fully reviewed',
|
|
76
|
-
value: 'file.approved',
|
|
77
|
-
description: 'Translations in a file are approved for one of the target languages',
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: 'File QA check finished',
|
|
81
|
-
value: 'file.qa.finished',
|
|
82
|
-
description: 'QA check for all strings in a file is finished',
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
name: 'Source string added',
|
|
86
|
-
value: 'string.added',
|
|
87
|
-
description: 'A new string is added to the project',
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
name: 'Source string updated',
|
|
91
|
-
value: 'string.updated',
|
|
92
|
-
description: 'A string in the project is updated',
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
name: 'Source string deleted',
|
|
96
|
-
value: 'string.deleted',
|
|
97
|
-
description: 'A string is deleted',
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
name: 'String comment/issue created',
|
|
101
|
-
value: 'stringComment.created',
|
|
102
|
-
description: 'A comment or issue is added to the string',
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
name: 'String comment/issue updated',
|
|
106
|
-
value: 'stringComment.updated',
|
|
107
|
-
description: 'A comment or issue is updated',
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: 'String comment/issue deleted',
|
|
111
|
-
value: 'stringComment.deleted',
|
|
112
|
-
description: 'A comment or issue is deleted',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'String comment/issue restored',
|
|
116
|
-
value: 'stringComment.restored',
|
|
117
|
-
description: 'A comment or issue is restored',
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
name: 'Suggested translation added',
|
|
121
|
-
value: 'suggestion.added',
|
|
122
|
-
description: 'A string in the project is translated',
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
name: 'Suggested translation updated',
|
|
126
|
-
value: 'suggestion.updated',
|
|
127
|
-
description: 'A translation for a string in the project is updated',
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
name: 'Suggested translation deleted',
|
|
131
|
-
value: 'suggestion.deleted',
|
|
132
|
-
description: 'One of the translations is deleted',
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
name: 'Suggested translation approved',
|
|
136
|
-
value: 'suggestion.approved',
|
|
137
|
-
description: 'A translation for a string is approved',
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
name: 'Suggested translation disapproved',
|
|
141
|
-
value: 'suggestion.disapproved',
|
|
142
|
-
description: 'Approval for a previously added translation is removed',
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
name: 'Task added',
|
|
146
|
-
value: 'task.added',
|
|
147
|
-
description: 'A task is added to the project',
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
name: 'Task status changed',
|
|
151
|
-
value: 'task.statusChanged',
|
|
152
|
-
description: 'A task status is changed',
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
name: 'Task updated',
|
|
156
|
-
value: 'task.updated',
|
|
157
|
-
description: 'A task is updated',
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
name: 'Task deleted',
|
|
161
|
-
value: 'task.deleted',
|
|
162
|
-
description: 'A task is deleted',
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
name: 'Exported translation updated',
|
|
166
|
-
value: 'translation.updated',
|
|
167
|
-
description: 'Final translation of a string is updated',
|
|
168
|
-
},
|
|
169
|
-
];
|
|
7
|
+
const events_1 = require("./triggers/enterprise/fileBased/events");
|
|
170
8
|
class CrowdinEnterpriseFileBasedTrigger {
|
|
171
9
|
constructor() {
|
|
172
10
|
this.description = {
|
|
@@ -236,7 +74,7 @@ class CrowdinEnterpriseFileBasedTrigger {
|
|
|
236
74
|
required: true,
|
|
237
75
|
default: 'file.translated',
|
|
238
76
|
description: 'The event to listen for',
|
|
239
|
-
options:
|
|
77
|
+
options: events_1.ALL_EVENTS,
|
|
240
78
|
},
|
|
241
79
|
{
|
|
242
80
|
displayName: 'Project Id',
|
|
@@ -248,7 +86,7 @@ class CrowdinEnterpriseFileBasedTrigger {
|
|
|
248
86
|
required: true,
|
|
249
87
|
displayOptions: {
|
|
250
88
|
hide: {
|
|
251
|
-
event:
|
|
89
|
+
event: events_1.ORGANIZATION_LEVEL_EVENTS,
|
|
252
90
|
},
|
|
253
91
|
},
|
|
254
92
|
default: '',
|
|
@@ -263,7 +101,7 @@ class CrowdinEnterpriseFileBasedTrigger {
|
|
|
263
101
|
async checkExists() {
|
|
264
102
|
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
265
103
|
const event = this.getNodeParameter('event');
|
|
266
|
-
const isOrganizationEvent =
|
|
104
|
+
const isOrganizationEvent = events_1.ORGANIZATION_LEVEL_EVENTS.includes(event);
|
|
267
105
|
try {
|
|
268
106
|
if (isOrganizationEvent) {
|
|
269
107
|
const webhooks = await api_1.crowdinApiRequestAllItems.call(this, 'GET', '/webhooks');
|
|
@@ -305,7 +143,7 @@ class CrowdinEnterpriseFileBasedTrigger {
|
|
|
305
143
|
var _a;
|
|
306
144
|
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
307
145
|
const event = this.getNodeParameter('event');
|
|
308
|
-
const isOrganizationEvent =
|
|
146
|
+
const isOrganizationEvent = events_1.ORGANIZATION_LEVEL_EVENTS.includes(event);
|
|
309
147
|
try {
|
|
310
148
|
if (isOrganizationEvent) {
|
|
311
149
|
const response = await api_1.crowdinApiRequest.call(this, 'POST', '/webhooks', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CrowdinEnterpriseFileBasedTrigger.node.js","sourceRoot":"","sources":["../../../nodes/Crowdin/CrowdinEnterpriseFileBasedTrigger.node.ts"],"names":[],"mappings":";;;AASA,+CAAiE;AAEjE,qCAGqB;AACrB,qDAAmD;
|
|
1
|
+
{"version":3,"file":"CrowdinEnterpriseFileBasedTrigger.node.js","sourceRoot":"","sources":["../../../nodes/Crowdin/CrowdinEnterpriseFileBasedTrigger.node.ts"],"names":[],"mappings":";;;AASA,+CAAiE;AAEjE,qCAGqB;AACrB,qDAAmD;AACnD,mEAA+F;AAE/F,MAAa,iCAAiC;IAA9C;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,yCAAyC;YACtD,IAAI,EAAE,mCAAmC;YACzC,IAAI,EAAE,EAAE,KAAK,EAAE,8BAA8B,EAAE,IAAI,EAAE,mCAAmC,EAAE;YAC1F,KAAK,EAAE,CAAC,SAAS,CAAC;YAClB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,0BAA0B;YACpC,WAAW,EAAE,6EAA6E;YAC1F,QAAQ,EAAE;gBACT,IAAI,EAAE,yCAAyC;aAC/C;YACD,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,4BAA4B;oBAClC,QAAQ,EAAE,IAAI;oBACd,cAAc,EAAE;wBACf,IAAI,EAAE;4BACL,cAAc,EAAE,CAAC,QAAQ,CAAC;yBAC1B;qBACD;iBACD;gBACD;oBACC,IAAI,EAAE,sBAAsB;oBAC5B,QAAQ,EAAE,IAAI;oBACd,cAAc,EAAE;wBACf,IAAI,EAAE;4BACL,cAAc,EAAE,CAAC,aAAa,CAAC;yBAC/B;qBACD;iBACD;aACD;YACD,QAAQ,EAAE;gBACT;oBACC,IAAI,EAAE,SAAS;oBACf,UAAU,EAAE,MAAM;oBAClB,YAAY,EAAE,YAAY;oBAC1B,IAAI,EAAE,SAAS;iBACf;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,gBAAgB;oBAC7B,IAAI,EAAE,gBAAgB;oBACtB,IAAI,EAAE,SAAS;oBAC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AAa,SAAS,EAAE,CAC9C,CAAC;wBACH,CAAC;wBAED,OAAO,WAAW,CAAC,SAAS,CAAC;wBAC7B,OAAO,WAAW,CAAC,qBAAqB,CAAC;wBACzC,OAAO,WAAW,CAAC,SAAS,CAAC;wBAC7B,OAAO,IAAI,CAAC;oBACb,CAAC;oBAAC,MAAM,CAAC;wBACR,OAAO,IAAI,CAAC;oBACb,CAAC;gBACF,CAAC;aACD;SACD,CAAC;IAqBH,CAAC;IAnBA,KAAK,CAAC,OAAO;QACZ,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAGpC,IAAI,QAAQ,CAAC,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACvD,OAAO;gBACN,YAAY,EAAE;oBACZ,QAAQ,CAAC,MAAwB,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;wBACtD,IAAI,EAAE,SAAS;qBACf,CAAC,CAAC;iBACH;aACD,CAAC;QACH,CAAC;QAGD,OAAO;YACN,YAAY,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;SACpC,CAAC;IACH,CAAC;CACD;AAvPD,8EAuPC"}
|
|
@@ -4,134 +4,7 @@ exports.CrowdinEnterpriseStringBasedTrigger = void 0;
|
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
5
|
const api_1 = require("./utils/api");
|
|
6
6
|
const enterprise_1 = require("./methods/enterprise");
|
|
7
|
-
const
|
|
8
|
-
const STRING_BASED_EVENTS = [
|
|
9
|
-
{
|
|
10
|
-
name: '[Organization] Project created',
|
|
11
|
-
value: 'project.created',
|
|
12
|
-
description: 'A project is created',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: '[Organization] Project deleted',
|
|
16
|
-
value: 'project.deleted',
|
|
17
|
-
description: 'A project is deleted',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: '[Organization] Group created',
|
|
21
|
-
value: 'group.created',
|
|
22
|
-
description: 'A group is created',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: '[Organization] Group deleted',
|
|
26
|
-
value: 'group.deleted',
|
|
27
|
-
description: 'A group is deleted',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: 'Project fully translated',
|
|
31
|
-
value: 'project.translated',
|
|
32
|
-
description: 'All files are translated into one of the target languages',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: 'Project fully reviewed',
|
|
36
|
-
value: 'project.approved',
|
|
37
|
-
description: 'Translations in all files are approved for one of the target languages',
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: 'Project successfully built',
|
|
41
|
-
value: 'project.built',
|
|
42
|
-
description: 'A project is built successfully',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: 'Project QA check finished',
|
|
46
|
-
value: 'project.qa.finished',
|
|
47
|
-
description: 'QA check for all strings in the project is finished',
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
name: 'Source string added',
|
|
51
|
-
value: 'string.added',
|
|
52
|
-
description: 'A new string is added to the project',
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
name: 'Source string updated',
|
|
56
|
-
value: 'string.updated',
|
|
57
|
-
description: 'A string in the project is updated',
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
name: 'Source string deleted',
|
|
61
|
-
value: 'string.deleted',
|
|
62
|
-
description: 'A string is deleted',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
name: 'String comment/issue created',
|
|
66
|
-
value: 'stringComment.created',
|
|
67
|
-
description: 'A comment or issue is added to the string',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: 'String comment/issue updated',
|
|
71
|
-
value: 'stringComment.updated',
|
|
72
|
-
description: 'A comment or issue is updated',
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: 'String comment/issue deleted',
|
|
76
|
-
value: 'stringComment.deleted',
|
|
77
|
-
description: 'A comment or issue is deleted',
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: 'String comment/issue restored',
|
|
81
|
-
value: 'stringComment.restored',
|
|
82
|
-
description: 'A comment or issue is restored',
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
name: 'Suggested translation added',
|
|
86
|
-
value: 'suggestion.added',
|
|
87
|
-
description: 'A string in the project is translated',
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
name: 'Suggested translation updated',
|
|
91
|
-
value: 'suggestion.updated',
|
|
92
|
-
description: 'A translation for a string in the project is updated',
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
name: 'Suggested translation deleted',
|
|
96
|
-
value: 'suggestion.deleted',
|
|
97
|
-
description: 'One of the translations is deleted',
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
name: 'Suggested translation approved',
|
|
101
|
-
value: 'suggestion.approved',
|
|
102
|
-
description: 'A translation for a string is approved',
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
name: 'Suggested translation disapproved',
|
|
106
|
-
value: 'suggestion.disapproved',
|
|
107
|
-
description: 'Approval for a previously added translation is removed',
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: 'Task added',
|
|
111
|
-
value: 'task.added',
|
|
112
|
-
description: 'A task is added to the project',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'Task status changed',
|
|
116
|
-
value: 'task.statusChanged',
|
|
117
|
-
description: 'A task status is changed',
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
name: 'Task updated',
|
|
121
|
-
value: 'task.updated',
|
|
122
|
-
description: 'A task is updated',
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
name: 'Task deleted',
|
|
126
|
-
value: 'task.deleted',
|
|
127
|
-
description: 'A task is deleted',
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
name: 'Exported translation updated',
|
|
131
|
-
value: 'translation.updated',
|
|
132
|
-
description: 'Final translation of a string is updated',
|
|
133
|
-
},
|
|
134
|
-
];
|
|
7
|
+
const events_1 = require("./triggers/enterprise/stringBased/events");
|
|
135
8
|
class CrowdinEnterpriseStringBasedTrigger {
|
|
136
9
|
constructor() {
|
|
137
10
|
this.description = {
|
|
@@ -201,7 +74,7 @@ class CrowdinEnterpriseStringBasedTrigger {
|
|
|
201
74
|
required: true,
|
|
202
75
|
default: 'project.translated',
|
|
203
76
|
description: 'The event to listen for',
|
|
204
|
-
options:
|
|
77
|
+
options: events_1.ALL_EVENTS,
|
|
205
78
|
},
|
|
206
79
|
{
|
|
207
80
|
displayName: 'Project Id',
|
|
@@ -213,7 +86,7 @@ class CrowdinEnterpriseStringBasedTrigger {
|
|
|
213
86
|
required: true,
|
|
214
87
|
displayOptions: {
|
|
215
88
|
hide: {
|
|
216
|
-
event:
|
|
89
|
+
event: events_1.ORGANIZATION_LEVEL_EVENTS,
|
|
217
90
|
},
|
|
218
91
|
},
|
|
219
92
|
default: '',
|
|
@@ -228,7 +101,7 @@ class CrowdinEnterpriseStringBasedTrigger {
|
|
|
228
101
|
async checkExists() {
|
|
229
102
|
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
230
103
|
const event = this.getNodeParameter('event');
|
|
231
|
-
const isOrganizationEvent =
|
|
104
|
+
const isOrganizationEvent = events_1.ORGANIZATION_LEVEL_EVENTS.includes(event);
|
|
232
105
|
try {
|
|
233
106
|
if (isOrganizationEvent) {
|
|
234
107
|
const webhooks = await api_1.crowdinApiRequestAllItems.call(this, 'GET', '/webhooks');
|
|
@@ -270,7 +143,7 @@ class CrowdinEnterpriseStringBasedTrigger {
|
|
|
270
143
|
var _a;
|
|
271
144
|
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
272
145
|
const event = this.getNodeParameter('event');
|
|
273
|
-
const isOrganizationEvent =
|
|
146
|
+
const isOrganizationEvent = events_1.ORGANIZATION_LEVEL_EVENTS.includes(event);
|
|
274
147
|
try {
|
|
275
148
|
if (isOrganizationEvent) {
|
|
276
149
|
const response = await api_1.crowdinApiRequest.call(this, 'POST', '/webhooks', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CrowdinEnterpriseStringBasedTrigger.node.js","sourceRoot":"","sources":["../../../nodes/Crowdin/CrowdinEnterpriseStringBasedTrigger.node.ts"],"names":[],"mappings":";;;AASA,+CAAiE;AAEjE,qCAGqB;AACrB,qDAAmD;
|
|
1
|
+
{"version":3,"file":"CrowdinEnterpriseStringBasedTrigger.node.js","sourceRoot":"","sources":["../../../nodes/Crowdin/CrowdinEnterpriseStringBasedTrigger.node.ts"],"names":[],"mappings":";;;AASA,+CAAiE;AAEjE,qCAGqB;AACrB,qDAAmD;AACnD,qEAAiG;AAEjG,MAAa,mCAAmC;IAAhD;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,2CAA2C;YACxD,IAAI,EAAE,qCAAqC;YAC3C,IAAI,EAAE,EAAE,KAAK,EAAE,8BAA8B,EAAE,IAAI,EAAE,mCAAmC,EAAE;YAC1F,KAAK,EAAE,CAAC,SAAS,CAAC;YAClB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,0BAA0B;YACpC,WAAW,EAAE,+EAA+E;YAC5F,QAAQ,EAAE;gBACT,IAAI,EAAE,2CAA2C;aACjD;YACD,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,4BAA4B;oBAClC,QAAQ,EAAE,IAAI;oBACd,cAAc,EAAE;wBACf,IAAI,EAAE;4BACL,cAAc,EAAE,CAAC,QAAQ,CAAC;yBAC1B;qBACD;iBACD;gBACD;oBACC,IAAI,EAAE,sBAAsB;oBAC5B,QAAQ,EAAE,IAAI;oBACd,cAAc,EAAE;wBACf,IAAI,EAAE;4BACL,cAAc,EAAE,CAAC,aAA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AAI,qBAAqB,EAAE,CAAC;4BAC3B,MAAM,uBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,aAAa,SAAS,EAAE,CAAC,CAAC;wBACxE,CAAC;6BAAM,CAAC;4BACP,MAAM,SAAS,GAAG,WAAW,CAAC,SAAmB,CAAC;4BAClD,MAAM,uBAAiB,CAAC,IAAI,CAC3B,IAAI,EACJ,QAAQ,EACR,aAAa,SAAS,aAAa,SAAS,EAAE,CAC9C,CAAC;wBACH,CAAC;wBAED,OAAO,WAAW,CAAC,SAAS,CAAC;wBAC7B,OAAO,WAAW,CAAC,qBAAqB,CAAC;wBACzC,OAAO,WAAW,CAAC,SAAS,CAAC;wBAC7B,OAAO,IAAI,CAAC;oBACb,CAAC;oBAAC,MAAM,CAAC;wBACR,OAAO,IAAI,CAAC;oBACb,CAAC;gBACF,CAAC;aACD;SACD,CAAC;IAqBH,CAAC;IAnBA,KAAK,CAAC,OAAO;QACZ,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAGpC,IAAI,QAAQ,CAAC,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACvD,OAAO;gBACN,YAAY,EAAE;oBACZ,QAAQ,CAAC,MAAwB,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;wBACtD,IAAI,EAAE,SAAS;qBACf,CAAC,CAAC;iBACH;aACD,CAAC;QACH,CAAC;QAGD,OAAO;YACN,YAAY,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;SACpC,CAAC;IACH,CAAC;CACD;AAvPD,kFAuPC"}
|
|
@@ -4,159 +4,7 @@ exports.CrowdinFileBasedTrigger = void 0;
|
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
5
|
const api_1 = require("./utils/api");
|
|
6
6
|
const crowdin_1 = require("./methods/crowdin");
|
|
7
|
-
const
|
|
8
|
-
const FILE_BASED_EVENTS = [
|
|
9
|
-
{
|
|
10
|
-
name: '[Account] Project created',
|
|
11
|
-
value: 'project.created',
|
|
12
|
-
description: 'A project is created',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: '[Account] Project deleted',
|
|
16
|
-
value: 'project.deleted',
|
|
17
|
-
description: 'A project is deleted',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: 'Project fully translated',
|
|
21
|
-
value: 'project.translated',
|
|
22
|
-
description: 'All files are translated into one of the target languages',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: 'Project fully reviewed',
|
|
26
|
-
value: 'project.approved',
|
|
27
|
-
description: 'Translations in all files are approved for one of the target languages',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: 'Project successfully built',
|
|
31
|
-
value: 'project.built',
|
|
32
|
-
description: 'A project is built successfully',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: 'Project QA check finished',
|
|
36
|
-
value: 'project.qa.finished',
|
|
37
|
-
description: 'QA check for all strings in the project is finished',
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: 'File added',
|
|
41
|
-
value: 'file.added',
|
|
42
|
-
description: 'A new file is added to the project',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: 'File updated',
|
|
46
|
-
value: 'file.updated',
|
|
47
|
-
description: 'A file is updated',
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
name: 'File deleted',
|
|
51
|
-
value: 'file.deleted',
|
|
52
|
-
description: 'A file is deleted',
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
name: 'File reverted',
|
|
56
|
-
value: 'file.reverted',
|
|
57
|
-
description: 'A file is reverted to the previous revision',
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
name: 'File fully translated',
|
|
61
|
-
value: 'file.translated',
|
|
62
|
-
description: 'A file is translated into one of the target languages',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
name: 'File fully reviewed',
|
|
66
|
-
value: 'file.approved',
|
|
67
|
-
description: 'Translations in a file are approved for one of the target languages',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: 'File QA check finished',
|
|
71
|
-
value: 'file.qa.finished',
|
|
72
|
-
description: 'QA check for all strings in a file is finished',
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: 'Source string added',
|
|
76
|
-
value: 'string.added',
|
|
77
|
-
description: 'A new string is added to the project',
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: 'Source string updated',
|
|
81
|
-
value: 'string.updated',
|
|
82
|
-
description: 'A string in the project is updated',
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
name: 'Source string deleted',
|
|
86
|
-
value: 'string.deleted',
|
|
87
|
-
description: 'A string is deleted',
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
name: 'String comment/issue created',
|
|
91
|
-
value: 'stringComment.created',
|
|
92
|
-
description: 'A comment or issue is added to the string',
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
name: 'String comment/issue updated',
|
|
96
|
-
value: 'stringComment.updated',
|
|
97
|
-
description: 'A comment or issue is updated',
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
name: 'String comment/issue deleted',
|
|
101
|
-
value: 'stringComment.deleted',
|
|
102
|
-
description: 'A comment or issue is deleted',
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
name: 'String comment/issue restored',
|
|
106
|
-
value: 'stringComment.restored',
|
|
107
|
-
description: 'A comment or issue is restored',
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: 'Suggested translation added',
|
|
111
|
-
value: 'suggestion.added',
|
|
112
|
-
description: 'A string in the project is translated',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'Suggested translation updated',
|
|
116
|
-
value: 'suggestion.updated',
|
|
117
|
-
description: 'A translation for a string in the project is updated',
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
name: 'Suggested translation deleted',
|
|
121
|
-
value: 'suggestion.deleted',
|
|
122
|
-
description: 'One of the translations is deleted',
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
name: 'Suggested translation approved',
|
|
126
|
-
value: 'suggestion.approved',
|
|
127
|
-
description: 'A translation for a string is approved',
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
name: 'Suggested translation disapproved',
|
|
131
|
-
value: 'suggestion.disapproved',
|
|
132
|
-
description: 'Approval for a previously added translation is removed',
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
name: 'Task added',
|
|
136
|
-
value: 'task.added',
|
|
137
|
-
description: 'A task is added to the project',
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
name: 'Task status changed',
|
|
141
|
-
value: 'task.statusChanged',
|
|
142
|
-
description: 'A task status is changed',
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
name: 'Task updated',
|
|
146
|
-
value: 'task.updated',
|
|
147
|
-
description: 'A task is updated',
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
name: 'Task deleted',
|
|
151
|
-
value: 'task.deleted',
|
|
152
|
-
description: 'A task is deleted',
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
name: 'Exported translation updated',
|
|
156
|
-
value: 'translation.updated',
|
|
157
|
-
description: 'Final translation of a string is updated',
|
|
158
|
-
},
|
|
159
|
-
];
|
|
7
|
+
const events_1 = require("./triggers/crowdin/fileBased/events");
|
|
160
8
|
class CrowdinFileBasedTrigger {
|
|
161
9
|
constructor() {
|
|
162
10
|
this.description = {
|
|
@@ -226,7 +74,7 @@ class CrowdinFileBasedTrigger {
|
|
|
226
74
|
required: true,
|
|
227
75
|
default: 'file.translated',
|
|
228
76
|
description: 'The event to listen for',
|
|
229
|
-
options:
|
|
77
|
+
options: events_1.ALL_EVENTS,
|
|
230
78
|
},
|
|
231
79
|
{
|
|
232
80
|
displayName: 'Project Id',
|
|
@@ -238,7 +86,7 @@ class CrowdinFileBasedTrigger {
|
|
|
238
86
|
required: true,
|
|
239
87
|
displayOptions: {
|
|
240
88
|
hide: {
|
|
241
|
-
event:
|
|
89
|
+
event: events_1.ACCOUNT_LEVEL_EVENTS,
|
|
242
90
|
},
|
|
243
91
|
},
|
|
244
92
|
default: '',
|
|
@@ -253,7 +101,7 @@ class CrowdinFileBasedTrigger {
|
|
|
253
101
|
async checkExists() {
|
|
254
102
|
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
255
103
|
const event = this.getNodeParameter('event');
|
|
256
|
-
const isAccountEvent =
|
|
104
|
+
const isAccountEvent = events_1.ACCOUNT_LEVEL_EVENTS.includes(event);
|
|
257
105
|
try {
|
|
258
106
|
if (isAccountEvent) {
|
|
259
107
|
const webhooks = await api_1.crowdinApiRequestAllItems.call(this, 'GET', '/webhooks');
|
|
@@ -295,7 +143,7 @@ class CrowdinFileBasedTrigger {
|
|
|
295
143
|
var _a;
|
|
296
144
|
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
297
145
|
const event = this.getNodeParameter('event');
|
|
298
|
-
const isAccountEvent =
|
|
146
|
+
const isAccountEvent = events_1.ACCOUNT_LEVEL_EVENTS.includes(event);
|
|
299
147
|
try {
|
|
300
148
|
if (isAccountEvent) {
|
|
301
149
|
const response = await api_1.crowdinApiRequest.call(this, 'POST', '/webhooks', {
|