@crowdin/app-project-module 0.68.0 → 0.69.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/index.js +5 -0
- package/out/modules/api/api.js +4 -4
- package/out/modules/integration/handlers/crowdin-update.js +1 -0
- package/out/modules/integration/handlers/integration-update.js +1 -0
- package/out/modules/integration/handlers/sync-settings-save.js +1 -0
- package/out/modules/integration/types.d.ts +5 -1
- package/out/modules/integration/util/cron.js +9 -5
- package/out/modules/integration/util/defaults.js +1 -0
- package/out/modules/integration/util/job.d.ts +3 -2
- package/out/modules/integration/util/job.js +37 -8
- package/out/modules/integration/util/types.d.ts +1 -0
- package/out/modules/integration/util/webhooks.js +5 -4
- package/out/modules/manifest.js +12 -0
- package/out/modules/webhooks/handlers/webhook-handler.d.ts +5 -0
- package/out/modules/webhooks/handlers/webhook-handler.js +75 -0
- package/out/modules/webhooks/index.d.ts +6 -0
- package/out/modules/webhooks/index.js +18 -0
- package/out/modules/webhooks/types.d.ts +292 -0
- package/out/modules/webhooks/types.js +2 -0
- package/out/static/js/form.js +1 -1
- package/out/static/js/main.js +2 -2
- package/out/types.d.ts +5 -0
- package/out/views/main.handlebars +48 -24
- package/package.json +3 -1
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { CrowdinCredentials, ModuleKey } from '../../types';
|
|
2
|
+
export interface Webhook extends ModuleKey {
|
|
3
|
+
/**
|
|
4
|
+
* Events that the webhook should listen to
|
|
5
|
+
*/
|
|
6
|
+
events: string[];
|
|
7
|
+
/**
|
|
8
|
+
* handle function
|
|
9
|
+
*/
|
|
10
|
+
callback: (data: {
|
|
11
|
+
credentials: CrowdinCredentials;
|
|
12
|
+
event: Event;
|
|
13
|
+
}) => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
interface EventPayload {
|
|
16
|
+
event: string;
|
|
17
|
+
}
|
|
18
|
+
interface BranchPayload {
|
|
19
|
+
id: number;
|
|
20
|
+
}
|
|
21
|
+
interface FilePayload {
|
|
22
|
+
id: number;
|
|
23
|
+
name: string;
|
|
24
|
+
title: string | null;
|
|
25
|
+
type: string;
|
|
26
|
+
path: string;
|
|
27
|
+
status: string;
|
|
28
|
+
revision: number;
|
|
29
|
+
branchId: number | null;
|
|
30
|
+
directoryId: number | null;
|
|
31
|
+
project?: ProjectPayload;
|
|
32
|
+
}
|
|
33
|
+
interface GroupPayload {
|
|
34
|
+
id: number;
|
|
35
|
+
name: string;
|
|
36
|
+
createdAt: string;
|
|
37
|
+
updatedAt: string;
|
|
38
|
+
description: string | null;
|
|
39
|
+
parentId: number;
|
|
40
|
+
userId: number;
|
|
41
|
+
organizationId: number;
|
|
42
|
+
}
|
|
43
|
+
interface LanguagePayload {
|
|
44
|
+
id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
editorCode: string;
|
|
47
|
+
twoLettersCode: string;
|
|
48
|
+
threeLettersCode: string;
|
|
49
|
+
locale: string;
|
|
50
|
+
androidCode: string;
|
|
51
|
+
osxCode: string;
|
|
52
|
+
osxLocale: string;
|
|
53
|
+
textDirection: string;
|
|
54
|
+
dialectOf: string;
|
|
55
|
+
}
|
|
56
|
+
interface ProjectBuildPayload {
|
|
57
|
+
id: number;
|
|
58
|
+
downloadUrl: string;
|
|
59
|
+
project: ProjectPayload;
|
|
60
|
+
}
|
|
61
|
+
interface ProjectPayload {
|
|
62
|
+
id: number;
|
|
63
|
+
userId: number;
|
|
64
|
+
sourceLanguageId: string;
|
|
65
|
+
targetLanguageIds: string[];
|
|
66
|
+
identifier: string;
|
|
67
|
+
name: string;
|
|
68
|
+
createdAt: string;
|
|
69
|
+
updatedAt: string;
|
|
70
|
+
lastActivity: string;
|
|
71
|
+
description: string;
|
|
72
|
+
url: string;
|
|
73
|
+
cname: string | null;
|
|
74
|
+
languageAccessPolicy?: string;
|
|
75
|
+
visibility?: string;
|
|
76
|
+
publicDownloads?: boolean;
|
|
77
|
+
logo?: string;
|
|
78
|
+
isExternal?: boolean;
|
|
79
|
+
externalType?: string | null;
|
|
80
|
+
hasCrowdsourcing?: boolean;
|
|
81
|
+
}
|
|
82
|
+
interface StepPayload {
|
|
83
|
+
name: string;
|
|
84
|
+
}
|
|
85
|
+
interface SuggestionPayload {
|
|
86
|
+
id: number;
|
|
87
|
+
text: string;
|
|
88
|
+
pluralCategoryName: string | null;
|
|
89
|
+
rating: number;
|
|
90
|
+
provider: string | null;
|
|
91
|
+
isPreTranslated: boolean;
|
|
92
|
+
createdAt: string;
|
|
93
|
+
step?: StepPayload | null;
|
|
94
|
+
}
|
|
95
|
+
interface NewSuggestionPayload {
|
|
96
|
+
user: UserPayload | null;
|
|
97
|
+
targetLanguage: LanguagePayload | null;
|
|
98
|
+
string: TranslationPayload | null;
|
|
99
|
+
}
|
|
100
|
+
interface TaskPayload {
|
|
101
|
+
id: number;
|
|
102
|
+
type: number;
|
|
103
|
+
vendor?: string | null;
|
|
104
|
+
status?: string | null;
|
|
105
|
+
title: string;
|
|
106
|
+
assignees: TaskAssigneeUserPayload[];
|
|
107
|
+
assignedTeams: TaskAssigneeTeamPayload[];
|
|
108
|
+
fileIds?: number[];
|
|
109
|
+
branchIds?: number[];
|
|
110
|
+
progress: {
|
|
111
|
+
total: number;
|
|
112
|
+
done: number;
|
|
113
|
+
percent: number;
|
|
114
|
+
};
|
|
115
|
+
description: string;
|
|
116
|
+
translationUrl: string | null;
|
|
117
|
+
wordsCount: number;
|
|
118
|
+
filesCount?: number;
|
|
119
|
+
commentsCount: number;
|
|
120
|
+
deadline: string;
|
|
121
|
+
timeRange: string | null;
|
|
122
|
+
workflowStepId: number;
|
|
123
|
+
buyUrl: string;
|
|
124
|
+
createdAt: string;
|
|
125
|
+
updatedAt: string;
|
|
126
|
+
oldStatus: string | null;
|
|
127
|
+
newStatus: string | null;
|
|
128
|
+
sourceLanguage: LanguagePayload;
|
|
129
|
+
targetLanguage: LanguagePayload | null;
|
|
130
|
+
project: ProjectPayload;
|
|
131
|
+
taskCreator: UserPayload;
|
|
132
|
+
}
|
|
133
|
+
interface TranslationDiscussionsPayload {
|
|
134
|
+
id: number;
|
|
135
|
+
text: string;
|
|
136
|
+
type: string;
|
|
137
|
+
issueType: string;
|
|
138
|
+
issueStatus: string;
|
|
139
|
+
resolvedAt: string;
|
|
140
|
+
createdAt: string;
|
|
141
|
+
string: TranslationPayload;
|
|
142
|
+
targetLanguage: LanguagePayload;
|
|
143
|
+
user: UserPayload;
|
|
144
|
+
commentResolver: UserPayload;
|
|
145
|
+
}
|
|
146
|
+
interface TranslationPayload {
|
|
147
|
+
id: number;
|
|
148
|
+
identifier: string;
|
|
149
|
+
key: string;
|
|
150
|
+
text: string;
|
|
151
|
+
type: string;
|
|
152
|
+
context: string;
|
|
153
|
+
maxLength: number;
|
|
154
|
+
isHidden: boolean;
|
|
155
|
+
isDuplicate: boolean;
|
|
156
|
+
masterStringId: number;
|
|
157
|
+
revision?: number;
|
|
158
|
+
hasPlurals: boolean;
|
|
159
|
+
labelIds: number[];
|
|
160
|
+
url: string;
|
|
161
|
+
createdAt: string;
|
|
162
|
+
updatedAt: string;
|
|
163
|
+
file?: FilePayload;
|
|
164
|
+
branch?: BranchPayload;
|
|
165
|
+
project: ProjectPayload;
|
|
166
|
+
}
|
|
167
|
+
interface UserPayload {
|
|
168
|
+
id: number;
|
|
169
|
+
username: string;
|
|
170
|
+
fullName: string;
|
|
171
|
+
avatarUrl: string;
|
|
172
|
+
}
|
|
173
|
+
interface TaskAssigneeUserPayload extends UserPayload {
|
|
174
|
+
worksCount: number;
|
|
175
|
+
wordsLeft: number;
|
|
176
|
+
}
|
|
177
|
+
interface TaskAssigneeTeamPayload {
|
|
178
|
+
id: number;
|
|
179
|
+
wordsCount: number;
|
|
180
|
+
}
|
|
181
|
+
export interface FileTranslatedEvent extends EventPayload {
|
|
182
|
+
file: FilePayload;
|
|
183
|
+
targetLanguage: LanguagePayload;
|
|
184
|
+
step?: StepPayload;
|
|
185
|
+
}
|
|
186
|
+
export interface FileApprovedEvent extends EventPayload {
|
|
187
|
+
file: FilePayload;
|
|
188
|
+
targetLanguage: LanguagePayload;
|
|
189
|
+
step?: StepPayload;
|
|
190
|
+
}
|
|
191
|
+
export interface FileAddedEvent extends EventPayload {
|
|
192
|
+
file: FilePayload;
|
|
193
|
+
user: UserPayload;
|
|
194
|
+
}
|
|
195
|
+
export interface FileUpdatedEvent extends EventPayload {
|
|
196
|
+
file: FilePayload;
|
|
197
|
+
user: UserPayload;
|
|
198
|
+
}
|
|
199
|
+
export interface FileRevertedEvent extends EventPayload {
|
|
200
|
+
file: FilePayload;
|
|
201
|
+
user: UserPayload;
|
|
202
|
+
}
|
|
203
|
+
export interface FileDeletedEvent extends EventPayload {
|
|
204
|
+
file: FilePayload;
|
|
205
|
+
user: UserPayload;
|
|
206
|
+
}
|
|
207
|
+
export interface ProjectTranslatedEvent extends EventPayload {
|
|
208
|
+
project: ProjectPayload;
|
|
209
|
+
targetLanguage: LanguagePayload;
|
|
210
|
+
workflowStep: StepPayload;
|
|
211
|
+
}
|
|
212
|
+
export interface ProjectApprovedEvent extends EventPayload {
|
|
213
|
+
project: ProjectPayload;
|
|
214
|
+
targetLanguage: LanguagePayload;
|
|
215
|
+
workflowStep: StepPayload;
|
|
216
|
+
}
|
|
217
|
+
export interface ProjectBuiltEvent extends EventPayload {
|
|
218
|
+
build: ProjectBuildPayload;
|
|
219
|
+
}
|
|
220
|
+
export interface TopSuggestionUpdatedEvent extends EventPayload {
|
|
221
|
+
oldTranslation: SuggestionPayload;
|
|
222
|
+
newTranslation: NewSuggestionPayload;
|
|
223
|
+
}
|
|
224
|
+
export interface SuggestionAddedEvent extends EventPayload {
|
|
225
|
+
translation: TranslationPayload;
|
|
226
|
+
}
|
|
227
|
+
export interface SuggestionUpdatedEvent extends EventPayload {
|
|
228
|
+
translation: TranslationPayload;
|
|
229
|
+
}
|
|
230
|
+
export interface SuggestionDeletedEvent extends EventPayload {
|
|
231
|
+
translation: TranslationPayload;
|
|
232
|
+
}
|
|
233
|
+
export interface SuggestionApprovedEvent extends EventPayload {
|
|
234
|
+
translation: TranslationPayload;
|
|
235
|
+
}
|
|
236
|
+
export interface SuggestionDisapprovedEvent extends EventPayload {
|
|
237
|
+
translation: TranslationPayload;
|
|
238
|
+
}
|
|
239
|
+
export interface StringAddedEvent extends EventPayload {
|
|
240
|
+
string: TranslationPayload;
|
|
241
|
+
user: UserPayload;
|
|
242
|
+
}
|
|
243
|
+
export interface StringUpdatedEvent extends EventPayload {
|
|
244
|
+
string: TranslationPayload;
|
|
245
|
+
user: UserPayload;
|
|
246
|
+
}
|
|
247
|
+
export interface StringDeletedEvent extends EventPayload {
|
|
248
|
+
string: TranslationPayload;
|
|
249
|
+
user: UserPayload;
|
|
250
|
+
}
|
|
251
|
+
export interface TranslationDiscussionsCreatedEvent extends EventPayload {
|
|
252
|
+
comment: TranslationDiscussionsPayload;
|
|
253
|
+
}
|
|
254
|
+
export interface TranslationDiscussionsUpdatedEvent extends EventPayload {
|
|
255
|
+
comment: TranslationDiscussionsPayload;
|
|
256
|
+
}
|
|
257
|
+
export interface TranslationDiscussionsDeletedEvent extends EventPayload {
|
|
258
|
+
comment: TranslationDiscussionsPayload;
|
|
259
|
+
}
|
|
260
|
+
export interface TranslationDiscussionsRestoredEvent extends EventPayload {
|
|
261
|
+
comment: TranslationDiscussionsPayload;
|
|
262
|
+
}
|
|
263
|
+
export interface TaskAddedEvent extends EventPayload {
|
|
264
|
+
task: TaskPayload;
|
|
265
|
+
}
|
|
266
|
+
export interface TaskStatusChangedEvent extends EventPayload {
|
|
267
|
+
task: TaskPayload;
|
|
268
|
+
}
|
|
269
|
+
export interface TaskDeletedEvent extends EventPayload {
|
|
270
|
+
task: TaskPayload;
|
|
271
|
+
}
|
|
272
|
+
export interface TaskUpdatedEvent extends EventPayload {
|
|
273
|
+
task: TaskPayload;
|
|
274
|
+
}
|
|
275
|
+
export interface ProjectCreatedEvent extends EventPayload {
|
|
276
|
+
project: ProjectPayload;
|
|
277
|
+
user: UserPayload;
|
|
278
|
+
}
|
|
279
|
+
export interface ProjectDeletedEvent extends EventPayload {
|
|
280
|
+
project: ProjectPayload;
|
|
281
|
+
user: UserPayload;
|
|
282
|
+
}
|
|
283
|
+
export interface GroupCreatedEvent extends EventPayload {
|
|
284
|
+
group: GroupPayload;
|
|
285
|
+
user: UserPayload;
|
|
286
|
+
}
|
|
287
|
+
export interface GroupDeletedEvent extends EventPayload {
|
|
288
|
+
group: GroupPayload;
|
|
289
|
+
user: UserPayload;
|
|
290
|
+
}
|
|
291
|
+
export type Event = FileTranslatedEvent | FileApprovedEvent | FileAddedEvent | FileUpdatedEvent | FileRevertedEvent | FileDeletedEvent | ProjectTranslatedEvent | ProjectApprovedEvent | ProjectBuiltEvent | TopSuggestionUpdatedEvent | SuggestionAddedEvent | SuggestionUpdatedEvent | SuggestionDeletedEvent | SuggestionApprovedEvent | SuggestionDisapprovedEvent | StringAddedEvent | StringUpdatedEvent | StringDeletedEvent | TranslationDiscussionsCreatedEvent | TranslationDiscussionsUpdatedEvent | TranslationDiscussionsDeletedEvent | TranslationDiscussionsRestoredEvent | TaskAddedEvent | TaskStatusChangedEvent | TaskDeletedEvent | TaskUpdatedEvent | ProjectCreatedEvent | ProjectDeletedEvent | GroupCreatedEvent | GroupDeletedEvent;
|
|
292
|
+
export {};
|