@crowdin/app-project-module 0.17.3 → 0.17.5
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/.github/workflows/basic.yml +39 -0
- package/.github/workflows/publish.yml +34 -0
- package/README.md +2 -1
- package/package.json +1 -1
- package/out/handlers/crowdin-file-progress.d.ts +0 -4
- package/out/handlers/crowdin-file-progress.js +0 -22
- package/out/handlers/crowdin-files.d.ts +0 -4
- package/out/handlers/crowdin-files.js +0 -31
- package/out/handlers/crowdin-project.d.ts +0 -4
- package/out/handlers/crowdin-project.js +0 -22
- package/out/handlers/crowdin-update.d.ts +0 -4
- package/out/handlers/crowdin-update.js +0 -26
- package/out/handlers/custom-file-format/download.d.ts +0 -4
- package/out/handlers/custom-file-format/download.js +0 -32
- package/out/handlers/custom-file-format/process.d.ts +0 -4
- package/out/handlers/custom-file-format/process.js +0 -134
- package/out/handlers/custom-mt/translate.d.ts +0 -4
- package/out/handlers/custom-mt/translate.js +0 -42
- package/out/handlers/install.d.ts +0 -4
- package/out/handlers/install.js +0 -45
- package/out/handlers/integration-data.d.ts +0 -4
- package/out/handlers/integration-data.js +0 -21
- package/out/handlers/integration-login.d.ts +0 -4
- package/out/handlers/integration-login.js +0 -30
- package/out/handlers/integration-logout.d.ts +0 -4
- package/out/handlers/integration-logout.js +0 -23
- package/out/handlers/integration-update.d.ts +0 -4
- package/out/handlers/integration-update.js +0 -25
- package/out/handlers/main.d.ts +0 -4
- package/out/handlers/main.js +0 -64
- package/out/handlers/manifest.d.ts +0 -3
- package/out/handlers/manifest.js +0 -120
- package/out/handlers/oauth-login.d.ts +0 -4
- package/out/handlers/oauth-login.js +0 -69
- package/out/handlers/settings-save.d.ts +0 -4
- package/out/handlers/settings-save.js +0 -21
- package/out/handlers/subscription-info.d.ts +0 -3
- package/out/handlers/subscription-info.js +0 -15
- package/out/handlers/sync-settings-save.d.ts +0 -4
- package/out/handlers/sync-settings-save.js +0 -29
- package/out/handlers/sync-settings.d.ts +0 -4
- package/out/handlers/sync-settings.js +0 -27
- package/out/handlers/uninstall.d.ts +0 -4
- package/out/handlers/uninstall.js +0 -27
- package/out/index.d.ts +0 -5
- package/out/index.js +0 -186
- package/out/logo.png +0 -0
- package/out/middlewares/crowdin-client.d.ts +0 -10
- package/out/middlewares/crowdin-client.js +0 -88
- package/out/middlewares/integration-credentials.d.ts +0 -4
- package/out/middlewares/integration-credentials.js +0 -39
- package/out/middlewares/json-response.d.ts +0 -2
- package/out/middlewares/json-response.js +0 -7
- package/out/middlewares/ui-module.d.ts +0 -4
- package/out/middlewares/ui-module.js +0 -39
- package/out/models/index.d.ts +0 -534
- package/out/models/index.js +0 -41
- package/out/static/css/styles.css +0 -57
- package/out/static/js/main.js +0 -130
- package/out/static/js/polyfills/fetch.js +0 -494
- package/out/static/js/polyfills/promise.js +0 -375
- package/out/storage/index.d.ts +0 -22
- package/out/storage/index.js +0 -319
- package/out/util/connection.d.ts +0 -10
- package/out/util/connection.js +0 -213
- package/out/util/cron.d.ts +0 -3
- package/out/util/cron.js +0 -103
- package/out/util/defaults.d.ts +0 -5
- package/out/util/defaults.js +0 -153
- package/out/util/index.d.ts +0 -11
- package/out/util/index.js +0 -105
- package/out/views/install.handlebars +0 -16
- package/out/views/login.handlebars +0 -115
- package/out/views/main.handlebars +0 -471
- package/out/views/oauth.handlebars +0 -4
- package/out/views/partials/head.handlebars +0 -20
- package/out/views/subscription.handlebars +0 -26
package/out/models/index.d.ts
DELETED
|
@@ -1,534 +0,0 @@
|
|
|
1
|
-
import Crowdin, { LanguagesModel, SourceFilesModel, SourceStringsModel } from '@crowdin/crowdin-api-client';
|
|
2
|
-
import { JwtPayload } from '@crowdin/crowdin-apps-functions';
|
|
3
|
-
import { Request } from 'express';
|
|
4
|
-
export interface Config extends ImagePath {
|
|
5
|
-
/**
|
|
6
|
-
* client id that we received when registering the app
|
|
7
|
-
*/
|
|
8
|
-
clientId: string;
|
|
9
|
-
/**
|
|
10
|
-
* client secret that we received when registering the app
|
|
11
|
-
*/
|
|
12
|
-
clientSecret: string;
|
|
13
|
-
/**
|
|
14
|
-
* Secret to encrypt/decrypt credentials (by default @clientSecret will be used)
|
|
15
|
-
*/
|
|
16
|
-
cryptoSecret?: string;
|
|
17
|
-
/**
|
|
18
|
-
* https url where an app is reachable from the internet (e.g. the one that ngrok generates for us)
|
|
19
|
-
*/
|
|
20
|
-
baseUrl: string;
|
|
21
|
-
/**
|
|
22
|
-
* Set of scopes requested by this app (default 'project')
|
|
23
|
-
*/
|
|
24
|
-
scopes?: Scope[];
|
|
25
|
-
/**
|
|
26
|
-
* app name
|
|
27
|
-
*/
|
|
28
|
-
name: string;
|
|
29
|
-
/**
|
|
30
|
-
* app identifier
|
|
31
|
-
*/
|
|
32
|
-
identifier: string;
|
|
33
|
-
/**
|
|
34
|
-
* app description
|
|
35
|
-
*/
|
|
36
|
-
description: string;
|
|
37
|
-
/**
|
|
38
|
-
* port where to start express application
|
|
39
|
-
*/
|
|
40
|
-
port?: number;
|
|
41
|
-
/**
|
|
42
|
-
* folder where module will create sqlite db file to persist credentials (e.g. {@example __dirname})
|
|
43
|
-
*/
|
|
44
|
-
dbFolder: string;
|
|
45
|
-
/**
|
|
46
|
-
* integration module logic
|
|
47
|
-
*/
|
|
48
|
-
projectIntegration?: IntegrationLogic & ImagePath;
|
|
49
|
-
/**
|
|
50
|
-
* custom file format module logic
|
|
51
|
-
*/
|
|
52
|
-
customFileFormat?: CustomFileFormatLogic;
|
|
53
|
-
/**
|
|
54
|
-
* custom MT module logic
|
|
55
|
-
*/
|
|
56
|
-
customMT?: CustomMTLogic;
|
|
57
|
-
/**
|
|
58
|
-
* resources module
|
|
59
|
-
*/
|
|
60
|
-
profileResourcesMenu?: UiModule & ImagePath;
|
|
61
|
-
/**
|
|
62
|
-
* organization-menu module
|
|
63
|
-
*/
|
|
64
|
-
organizationMenu?: UiModule & ImagePath;
|
|
65
|
-
/**
|
|
66
|
-
* editor-right-panel module
|
|
67
|
-
*/
|
|
68
|
-
editorRightPanel?: EditorPanels;
|
|
69
|
-
/**
|
|
70
|
-
* project menu module
|
|
71
|
-
*/
|
|
72
|
-
projectMenu?: UiModule;
|
|
73
|
-
/**
|
|
74
|
-
* tools module
|
|
75
|
-
*/
|
|
76
|
-
projectTools?: UiModule & ImagePath;
|
|
77
|
-
/**
|
|
78
|
-
* reports module
|
|
79
|
-
*/
|
|
80
|
-
projectReports?: UiModule & ImagePath;
|
|
81
|
-
/**
|
|
82
|
-
* Uninstall hook for cleanup logic
|
|
83
|
-
*/
|
|
84
|
-
onUninstall?: (organization: string) => Promise<void>;
|
|
85
|
-
/**
|
|
86
|
-
* Error interceptor (can be used to log error in centralized place)
|
|
87
|
-
*/
|
|
88
|
-
onError?: (error: any) => void;
|
|
89
|
-
/**
|
|
90
|
-
* Configuration to log everything that are happening in the app
|
|
91
|
-
*/
|
|
92
|
-
logger?: Logger;
|
|
93
|
-
/**
|
|
94
|
-
* Configuration of app pricing
|
|
95
|
-
*/
|
|
96
|
-
pricing?: Pricing;
|
|
97
|
-
}
|
|
98
|
-
export declare enum Scope {
|
|
99
|
-
ALL_SCOPES = "all",
|
|
100
|
-
NOTIFICATIONS = "notification",
|
|
101
|
-
TRANSLATION_MEMORIES = "tm",
|
|
102
|
-
MACHINE_TRANSLATION_ENGINES = "mt",
|
|
103
|
-
GLOSSARIES = "glossary",
|
|
104
|
-
PROJECTS = "project",
|
|
105
|
-
TASKS = "project.task",
|
|
106
|
-
REPORTS = "project.report",
|
|
107
|
-
TRANSLATION_STATUS = "project.status",
|
|
108
|
-
SOURCE_FILES_AND_STRINGS = "project.source",
|
|
109
|
-
WEBHOOKS = "project.webhook",
|
|
110
|
-
TRANSLATIONS = "project.translation",
|
|
111
|
-
SCREENSHOTS = "project.screenshot"
|
|
112
|
-
}
|
|
113
|
-
export interface IntegrationLogic {
|
|
114
|
-
/**
|
|
115
|
-
* Customize your app login form
|
|
116
|
-
*/
|
|
117
|
-
loginForm: LoginForm;
|
|
118
|
-
/**
|
|
119
|
-
* Define login process via OAuth2 protocol
|
|
120
|
-
*/
|
|
121
|
-
oauthLogin?: OAuthLogin;
|
|
122
|
-
/**
|
|
123
|
-
* name of the root folder in Crowdin where files from integration will be stored, default your app name, will be ignored in case if {@link withRootFolder} is false
|
|
124
|
-
*/
|
|
125
|
-
appFolderName?: string;
|
|
126
|
-
/**
|
|
127
|
-
* flag that defines if the app should have a dedicated root folder in Crowdin files, default 'false'
|
|
128
|
-
*/
|
|
129
|
-
withRootFolder?: boolean;
|
|
130
|
-
/**
|
|
131
|
-
* function which will be used to check connection with integration service
|
|
132
|
-
*/
|
|
133
|
-
checkConnection?: (apiCredentials: any) => Promise<void>;
|
|
134
|
-
/**
|
|
135
|
-
* function to get crowdin files that are related with this integration
|
|
136
|
-
*/
|
|
137
|
-
getCrowdinFiles?: (projectId: number, client: Crowdin, appRootFolder?: SourceFilesModel.Directory, config?: any) => Promise<TreeItem[]>;
|
|
138
|
-
/**
|
|
139
|
-
* function to get data from integration
|
|
140
|
-
*/
|
|
141
|
-
getIntegrationFiles: (apiCredentials: any, config?: any) => Promise<TreeItem[]>;
|
|
142
|
-
/**
|
|
143
|
-
* function to update crowdin files (e.g. pull integration data to crowdin source files)
|
|
144
|
-
*/
|
|
145
|
-
updateCrowdin: (projectId: number, client: Crowdin, apiCredentials: any, request: IntegrationFile[], appRootFolder?: SourceFilesModel.Directory, config?: any) => Promise<void>;
|
|
146
|
-
/**
|
|
147
|
-
* function to update integration content (e.g. load crowdin translations and push them to integration service)
|
|
148
|
-
*/
|
|
149
|
-
updateIntegration: (projectId: number, client: Crowdin, apiCredentials: any, request: UpdateIntegrationRequest, appRootFolder?: SourceFilesModel.Directory, config?: any) => Promise<void>;
|
|
150
|
-
/**
|
|
151
|
-
* function to define configuration(settings) modal for you app (by default app will not have any custom settings)
|
|
152
|
-
*/
|
|
153
|
-
getConfiguration?: (projectId: number, client: Crowdin, apiCredentials: any) => Promise<ConfigurationModalEntity[]>;
|
|
154
|
-
/**
|
|
155
|
-
* flag to turn on auto reload of the tree whenever user updates the configuration
|
|
156
|
-
*/
|
|
157
|
-
reloadOnConfigSave?: boolean;
|
|
158
|
-
/**
|
|
159
|
-
* define info modal (help section) for you app (by default app will not have own info section)
|
|
160
|
-
*/
|
|
161
|
-
infoModal?: {
|
|
162
|
-
title: string;
|
|
163
|
-
content: string;
|
|
164
|
-
};
|
|
165
|
-
/**
|
|
166
|
-
* background jobs that will be executed for each crowdin project and user
|
|
167
|
-
*/
|
|
168
|
-
cronJobs?: CronJob[];
|
|
169
|
-
withCronSync?: {
|
|
170
|
-
crowdin: boolean;
|
|
171
|
-
integration: boolean;
|
|
172
|
-
};
|
|
173
|
-
withWebhookSync?: {
|
|
174
|
-
crowdin: boolean;
|
|
175
|
-
integration: boolean;
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
export declare type ConfigurationModalEntity = ConfigurationField | ConfigurationDelimeter;
|
|
179
|
-
export interface ConfigurationField {
|
|
180
|
-
key: string;
|
|
181
|
-
label: string;
|
|
182
|
-
type: 'text' | 'checkbox' | 'select';
|
|
183
|
-
helpText?: string;
|
|
184
|
-
/**
|
|
185
|
-
* only for select
|
|
186
|
-
*/
|
|
187
|
-
isMulti?: boolean;
|
|
188
|
-
/**
|
|
189
|
-
* only for select
|
|
190
|
-
*/
|
|
191
|
-
options?: {
|
|
192
|
-
label: string;
|
|
193
|
-
value: string;
|
|
194
|
-
}[];
|
|
195
|
-
}
|
|
196
|
-
export interface ConfigurationDelimeter {
|
|
197
|
-
label: string;
|
|
198
|
-
}
|
|
199
|
-
export interface LoginForm {
|
|
200
|
-
fields: FormField[];
|
|
201
|
-
}
|
|
202
|
-
export interface OAuthLogin {
|
|
203
|
-
/**
|
|
204
|
-
* Authorization url (e.g. https://github.com/login/oauth/authorize or https://accounts.google.com/o/oauth2/v2/auth)
|
|
205
|
-
*/
|
|
206
|
-
authorizationUrl: string;
|
|
207
|
-
/**
|
|
208
|
-
* Access token url (e.g. https://github.com/login/oauth/access_token)
|
|
209
|
-
*/
|
|
210
|
-
accessTokenUrl: string;
|
|
211
|
-
/**
|
|
212
|
-
* Url to refresh token, default will use {@link accessTokenUrl}. Needed when {@link refresh} is enabled
|
|
213
|
-
*/
|
|
214
|
-
refreshTokenUrl?: string;
|
|
215
|
-
/**
|
|
216
|
-
* The scopes of access, usually expressed as a list of space-delimited, case-sensitive strings
|
|
217
|
-
*/
|
|
218
|
-
scope?: string;
|
|
219
|
-
/**
|
|
220
|
-
* Client id
|
|
221
|
-
*/
|
|
222
|
-
clientId: string;
|
|
223
|
-
/**
|
|
224
|
-
* Client secret
|
|
225
|
-
*/
|
|
226
|
-
clientSecret: string;
|
|
227
|
-
/**
|
|
228
|
-
* default '/oauth/code'
|
|
229
|
-
*/
|
|
230
|
-
redirectUriRoute?: string;
|
|
231
|
-
/**
|
|
232
|
-
* request/response fields mapping
|
|
233
|
-
*/
|
|
234
|
-
fieldsMapping?: {
|
|
235
|
-
/**
|
|
236
|
-
* default 'client_id'
|
|
237
|
-
*/
|
|
238
|
-
clientId?: string;
|
|
239
|
-
/**
|
|
240
|
-
* default 'client_secret'
|
|
241
|
-
*/
|
|
242
|
-
clientSecret?: string;
|
|
243
|
-
/**
|
|
244
|
-
* default 'scope'
|
|
245
|
-
*/
|
|
246
|
-
scope?: string;
|
|
247
|
-
/**
|
|
248
|
-
* default 'redirect_uri'
|
|
249
|
-
*/
|
|
250
|
-
redirectUri?: string;
|
|
251
|
-
/**
|
|
252
|
-
* default 'code'
|
|
253
|
-
*/
|
|
254
|
-
code: string;
|
|
255
|
-
/**
|
|
256
|
-
* default 'access_token'
|
|
257
|
-
*/
|
|
258
|
-
accessToken?: string;
|
|
259
|
-
/**
|
|
260
|
-
* default 'refresh_token'
|
|
261
|
-
*/
|
|
262
|
-
refreshToken?: string;
|
|
263
|
-
/**
|
|
264
|
-
* default 'expires_in'
|
|
265
|
-
*/
|
|
266
|
-
expiresIn?: string;
|
|
267
|
-
};
|
|
268
|
-
/**
|
|
269
|
-
* default 'false' which means that the access token has no expiration date
|
|
270
|
-
*/
|
|
271
|
-
refresh?: boolean;
|
|
272
|
-
/**
|
|
273
|
-
* Additional URL parameters for authorizarion url
|
|
274
|
-
*/
|
|
275
|
-
extraAutorizationUrlParameters?: {
|
|
276
|
-
[key: string]: string;
|
|
277
|
-
};
|
|
278
|
-
/**
|
|
279
|
-
* Additional parameters for access token request
|
|
280
|
-
*/
|
|
281
|
-
extraAccessTokenParameters?: {
|
|
282
|
-
[key: string]: any;
|
|
283
|
-
};
|
|
284
|
-
/**
|
|
285
|
-
* Additional parameters for refresh token request
|
|
286
|
-
*/
|
|
287
|
-
extraRefreshTokenParameters?: {
|
|
288
|
-
[key: string]: any;
|
|
289
|
-
};
|
|
290
|
-
/**
|
|
291
|
-
* Override to implement request for retrieving access token (and refresh token if 'refresh' is enabled)
|
|
292
|
-
*/
|
|
293
|
-
performGetTokenRequest?: (code: string) => Promise<any>;
|
|
294
|
-
/**
|
|
295
|
-
* Override to implement request for refreshing token (only if 'refresh' is enabled)
|
|
296
|
-
*/
|
|
297
|
-
performRefreshTokenRequest?: (currentCredentials: any) => Promise<any>;
|
|
298
|
-
}
|
|
299
|
-
export interface FormField {
|
|
300
|
-
key: string;
|
|
301
|
-
helpText?: string;
|
|
302
|
-
helpTextHtml?: string;
|
|
303
|
-
label: string;
|
|
304
|
-
type?: 'text' | 'password' | 'checkbox';
|
|
305
|
-
}
|
|
306
|
-
export declare type TreeItem = File | Folder;
|
|
307
|
-
export interface File {
|
|
308
|
-
id: string;
|
|
309
|
-
name: string;
|
|
310
|
-
type: SourceFilesModel.FileType;
|
|
311
|
-
parentId?: string;
|
|
312
|
-
}
|
|
313
|
-
export interface Folder {
|
|
314
|
-
id: string;
|
|
315
|
-
name: string;
|
|
316
|
-
parentId?: string;
|
|
317
|
-
}
|
|
318
|
-
export interface IntegrationRequest extends CrowdinClientRequest {
|
|
319
|
-
integrationCredentials: any;
|
|
320
|
-
integrationSettings?: any;
|
|
321
|
-
}
|
|
322
|
-
export interface CrowdinClientRequest extends Request {
|
|
323
|
-
crowdinApiClient: Crowdin;
|
|
324
|
-
crowdinContext: CrowdinContextInfo;
|
|
325
|
-
subscriptionInfo?: SubscriptionInfo;
|
|
326
|
-
}
|
|
327
|
-
export interface CrowdinCredentials {
|
|
328
|
-
id: string;
|
|
329
|
-
appSecret: string;
|
|
330
|
-
domain?: string;
|
|
331
|
-
userId: number;
|
|
332
|
-
organizationId: number;
|
|
333
|
-
baseUrl: string;
|
|
334
|
-
accessToken: string;
|
|
335
|
-
refreshToken: string;
|
|
336
|
-
expire: string;
|
|
337
|
-
type: AccountType;
|
|
338
|
-
}
|
|
339
|
-
export declare enum AccountType {
|
|
340
|
-
NORMAL = "normal",
|
|
341
|
-
ENTERPRISE = "enterprise"
|
|
342
|
-
}
|
|
343
|
-
export interface CrowdinContextInfo {
|
|
344
|
-
jwtPayload: JwtPayload;
|
|
345
|
-
crowdinId: string;
|
|
346
|
-
clientId: string;
|
|
347
|
-
}
|
|
348
|
-
export declare enum SubscriptionInfoType {
|
|
349
|
-
TRIAL = "trial",
|
|
350
|
-
SUBSCRIPTION = "subscription"
|
|
351
|
-
}
|
|
352
|
-
export interface SubscriptionInfo {
|
|
353
|
-
expired: boolean;
|
|
354
|
-
subscribeLink?: string;
|
|
355
|
-
daysLeft?: number;
|
|
356
|
-
type?: SubscriptionInfoType;
|
|
357
|
-
}
|
|
358
|
-
export interface IntegrationCredentials {
|
|
359
|
-
id: string;
|
|
360
|
-
credentials: any;
|
|
361
|
-
crowdinId: string;
|
|
362
|
-
config?: any;
|
|
363
|
-
}
|
|
364
|
-
export interface IntegrationFile {
|
|
365
|
-
id: string;
|
|
366
|
-
name: string;
|
|
367
|
-
type: SourceFilesModel.FileType;
|
|
368
|
-
parentId: string;
|
|
369
|
-
}
|
|
370
|
-
export interface UpdateIntegrationRequest {
|
|
371
|
-
[fileId: string]: string[];
|
|
372
|
-
}
|
|
373
|
-
export interface CronJob {
|
|
374
|
-
task: (projectId: number, client: Crowdin, apiCredentials: any, appRootFolder?: SourceFilesModel.Directory, config?: any) => Promise<void>;
|
|
375
|
-
expression: string;
|
|
376
|
-
}
|
|
377
|
-
export interface CustomFileFormatLogic {
|
|
378
|
-
/**
|
|
379
|
-
* The type parameter value for a custom file format. Used for a custom format file upload via API.
|
|
380
|
-
*/
|
|
381
|
-
type: string;
|
|
382
|
-
/**
|
|
383
|
-
* Folder where larger file will be temporary stored (default "{@link dbFolder}/custom-file-format")
|
|
384
|
-
*/
|
|
385
|
-
filesFolder?: string;
|
|
386
|
-
/**
|
|
387
|
-
* This parameter is used to combine the content of multiple languages into one request when uploading and downloading translations in your Crowdin project.
|
|
388
|
-
*/
|
|
389
|
-
multilingual?: boolean;
|
|
390
|
-
/**
|
|
391
|
-
* Contains fileName and/or fileContent regular expressions used to detect file type when uploading a new source file via UI (or via API without specified type parameter). If the file matches regular expressions, it's labeled as a custom format file.
|
|
392
|
-
*/
|
|
393
|
-
signaturePatterns?: SignaturePatterns;
|
|
394
|
-
/**
|
|
395
|
-
* Flag to automatically upload translations
|
|
396
|
-
*/
|
|
397
|
-
autoUploadTranslations?: boolean;
|
|
398
|
-
/**
|
|
399
|
-
* Enable strings export
|
|
400
|
-
*/
|
|
401
|
-
stringsExport?: boolean;
|
|
402
|
-
/**
|
|
403
|
-
* File extensions (used for strings export)
|
|
404
|
-
*/
|
|
405
|
-
extensions?: string[];
|
|
406
|
-
/**
|
|
407
|
-
* Used for initial source file upload, source file update, and translation upload
|
|
408
|
-
*/
|
|
409
|
-
parseFile?: (fileContent: string | object, req: Omit<ProcessFileRequest, 'jobType' | 'file'>, client: Crowdin, context: CrowdinContextInfo, projectId: number) => Promise<ParseFileResponse>;
|
|
410
|
-
/**
|
|
411
|
-
* Used for translation download
|
|
412
|
-
*/
|
|
413
|
-
buildFile?: (fileContent: string | object, req: Omit<ProcessFileRequest, 'jobType' | 'file'>, strings: ProcessFileString[], client: Crowdin, context: CrowdinContextInfo, projectId: number) => Promise<BuildFileResponse>;
|
|
414
|
-
/**
|
|
415
|
-
* Used for strings export
|
|
416
|
-
*/
|
|
417
|
-
exportStrings?: (req: Omit<ProcessFileRequest, 'jobType'>, strings: ProcessFileString[], client: Crowdin, context: CrowdinContextInfo, projectId: number) => Promise<BuildFileResponse>;
|
|
418
|
-
}
|
|
419
|
-
export interface SignaturePatterns {
|
|
420
|
-
fileName?: string;
|
|
421
|
-
fileContent?: string;
|
|
422
|
-
}
|
|
423
|
-
export interface ProcessFileRequest {
|
|
424
|
-
jobType: ProcessFileJobType;
|
|
425
|
-
file: ProcessFileRecord;
|
|
426
|
-
sourceLanguage: LanguagesModel.Language;
|
|
427
|
-
targetLanguages: LanguagesModel.Language[];
|
|
428
|
-
strings: ProcessFileString[];
|
|
429
|
-
stringsUrl: string;
|
|
430
|
-
}
|
|
431
|
-
export interface ProcessFileRecord {
|
|
432
|
-
content?: string;
|
|
433
|
-
contentUrl?: string;
|
|
434
|
-
path?: string;
|
|
435
|
-
id?: number;
|
|
436
|
-
name?: string;
|
|
437
|
-
}
|
|
438
|
-
export declare enum ProcessFileJobType {
|
|
439
|
-
PARSE_FILE = "parse-file",
|
|
440
|
-
BUILD_FILE = "build-file"
|
|
441
|
-
}
|
|
442
|
-
export interface ParseFileResponse {
|
|
443
|
-
previewFile?: string;
|
|
444
|
-
strings?: ProcessFileString[];
|
|
445
|
-
}
|
|
446
|
-
export interface BuildFileResponse {
|
|
447
|
-
contentFile: string;
|
|
448
|
-
}
|
|
449
|
-
export interface ProcessFileString {
|
|
450
|
-
previewId?: number;
|
|
451
|
-
id: number;
|
|
452
|
-
identifier: string;
|
|
453
|
-
context?: string;
|
|
454
|
-
customData?: string;
|
|
455
|
-
maxLength?: number;
|
|
456
|
-
isHidden?: boolean;
|
|
457
|
-
hasPlurals?: boolean;
|
|
458
|
-
labels?: string[];
|
|
459
|
-
text: string | SourceStringsModel.PluralText;
|
|
460
|
-
translations?: StringTranslations;
|
|
461
|
-
}
|
|
462
|
-
export interface StringTranslations {
|
|
463
|
-
[language: string]: {
|
|
464
|
-
text: string | SourceStringsModel.PluralText;
|
|
465
|
-
};
|
|
466
|
-
}
|
|
467
|
-
export interface CustomMTLogic {
|
|
468
|
-
translate: (client: Crowdin, context: CrowdinContextInfo, projectId: number, source: string, target: string, strings: string[]) => Promise<string[]>;
|
|
469
|
-
validate?: (client: Crowdin) => Promise<void>;
|
|
470
|
-
}
|
|
471
|
-
export interface CustomMTRequest {
|
|
472
|
-
strings: string[];
|
|
473
|
-
}
|
|
474
|
-
export interface UiModule {
|
|
475
|
-
/**
|
|
476
|
-
* path to ui folder (e.g. {@example join(__dirname, 'public')})
|
|
477
|
-
*/
|
|
478
|
-
uiPath: string;
|
|
479
|
-
/**
|
|
480
|
-
* page name (default index.html)
|
|
481
|
-
*/
|
|
482
|
-
fileName?: string;
|
|
483
|
-
}
|
|
484
|
-
export interface EditorPanels extends UiModule {
|
|
485
|
-
/**
|
|
486
|
-
* The Editor's mode list where the module will be available.
|
|
487
|
-
*/
|
|
488
|
-
modes: EditorPanelsMode[];
|
|
489
|
-
}
|
|
490
|
-
export declare enum EditorPanelsMode {
|
|
491
|
-
ASSETS = "assets",
|
|
492
|
-
REVIEW = "review",
|
|
493
|
-
TRANSLATE = "TRANSLATE",
|
|
494
|
-
PROOFREAD = "proofread"
|
|
495
|
-
}
|
|
496
|
-
export interface CrowdinAppUtilities {
|
|
497
|
-
saveMetadata: (id: string, metadata: any) => Promise<void>;
|
|
498
|
-
getMetadata: (id: string) => Promise<any | undefined>;
|
|
499
|
-
deleteMetadata: (id: string) => Promise<void>;
|
|
500
|
-
/**
|
|
501
|
-
* Settings that users manage in the integration module
|
|
502
|
-
*/
|
|
503
|
-
getUserSettings: (clientId: string) => Promise<any | undefined>;
|
|
504
|
-
establishCrowdinConnection: (jwtToken: string) => Promise<{
|
|
505
|
-
context: CrowdinContextInfo;
|
|
506
|
-
client?: Crowdin;
|
|
507
|
-
}>;
|
|
508
|
-
}
|
|
509
|
-
export interface IntegrationSyncSettings {
|
|
510
|
-
id: string;
|
|
511
|
-
files?: any;
|
|
512
|
-
integrationId: string;
|
|
513
|
-
crowdinId: string;
|
|
514
|
-
provider: string;
|
|
515
|
-
}
|
|
516
|
-
interface ImagePath {
|
|
517
|
-
/**
|
|
518
|
-
* path to app logo (e.g. {@example join(__dirname, 'logo.png')})
|
|
519
|
-
*/
|
|
520
|
-
imagePath?: string;
|
|
521
|
-
}
|
|
522
|
-
export interface Logger {
|
|
523
|
-
enabled: boolean;
|
|
524
|
-
log?: (message: string) => void;
|
|
525
|
-
}
|
|
526
|
-
export interface Pricing {
|
|
527
|
-
planType: 'free' | 'recurring';
|
|
528
|
-
trial?: number;
|
|
529
|
-
trialCrowdin?: number;
|
|
530
|
-
trialEnterprise?: number;
|
|
531
|
-
cachingSeconds?: number;
|
|
532
|
-
infoDisplayDaysThreshold?: number;
|
|
533
|
-
}
|
|
534
|
-
export {};
|
package/out/models/index.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EditorPanelsMode = exports.ProcessFileJobType = exports.SubscriptionInfoType = exports.AccountType = exports.Scope = void 0;
|
|
4
|
-
var Scope;
|
|
5
|
-
(function (Scope) {
|
|
6
|
-
Scope["ALL_SCOPES"] = "all";
|
|
7
|
-
Scope["NOTIFICATIONS"] = "notification";
|
|
8
|
-
Scope["TRANSLATION_MEMORIES"] = "tm";
|
|
9
|
-
Scope["MACHINE_TRANSLATION_ENGINES"] = "mt";
|
|
10
|
-
Scope["GLOSSARIES"] = "glossary";
|
|
11
|
-
Scope["PROJECTS"] = "project";
|
|
12
|
-
Scope["TASKS"] = "project.task";
|
|
13
|
-
Scope["REPORTS"] = "project.report";
|
|
14
|
-
Scope["TRANSLATION_STATUS"] = "project.status";
|
|
15
|
-
Scope["SOURCE_FILES_AND_STRINGS"] = "project.source";
|
|
16
|
-
Scope["WEBHOOKS"] = "project.webhook";
|
|
17
|
-
Scope["TRANSLATIONS"] = "project.translation";
|
|
18
|
-
Scope["SCREENSHOTS"] = "project.screenshot";
|
|
19
|
-
})(Scope = exports.Scope || (exports.Scope = {}));
|
|
20
|
-
var AccountType;
|
|
21
|
-
(function (AccountType) {
|
|
22
|
-
AccountType["NORMAL"] = "normal";
|
|
23
|
-
AccountType["ENTERPRISE"] = "enterprise";
|
|
24
|
-
})(AccountType = exports.AccountType || (exports.AccountType = {}));
|
|
25
|
-
var SubscriptionInfoType;
|
|
26
|
-
(function (SubscriptionInfoType) {
|
|
27
|
-
SubscriptionInfoType["TRIAL"] = "trial";
|
|
28
|
-
SubscriptionInfoType["SUBSCRIPTION"] = "subscription";
|
|
29
|
-
})(SubscriptionInfoType = exports.SubscriptionInfoType || (exports.SubscriptionInfoType = {}));
|
|
30
|
-
var ProcessFileJobType;
|
|
31
|
-
(function (ProcessFileJobType) {
|
|
32
|
-
ProcessFileJobType["PARSE_FILE"] = "parse-file";
|
|
33
|
-
ProcessFileJobType["BUILD_FILE"] = "build-file";
|
|
34
|
-
})(ProcessFileJobType = exports.ProcessFileJobType || (exports.ProcessFileJobType = {}));
|
|
35
|
-
var EditorPanelsMode;
|
|
36
|
-
(function (EditorPanelsMode) {
|
|
37
|
-
EditorPanelsMode["ASSETS"] = "assets";
|
|
38
|
-
EditorPanelsMode["REVIEW"] = "review";
|
|
39
|
-
EditorPanelsMode["TRANSLATE"] = "TRANSLATE";
|
|
40
|
-
EditorPanelsMode["PROOFREAD"] = "proofread";
|
|
41
|
-
})(EditorPanelsMode = exports.EditorPanelsMode || (exports.EditorPanelsMode = {}));
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
.i_w {
|
|
2
|
-
padding: 16px 24px;
|
|
3
|
-
max-width: 1420px;
|
|
4
|
-
margin: 0 auto;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.center {
|
|
8
|
-
text-align: center;
|
|
9
|
-
min-height: calc(100vh - 64px);
|
|
10
|
-
display: flex;
|
|
11
|
-
align-items: center;
|
|
12
|
-
justify-content: space-around;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.box-center {
|
|
16
|
-
display: flex;
|
|
17
|
-
align-items: center;
|
|
18
|
-
justify-content: center;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.top {
|
|
22
|
-
text-align: right;
|
|
23
|
-
margin-bottom: 10px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.login {
|
|
27
|
-
margin-bottom: 10px;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.login img {
|
|
31
|
-
max-width: 70px;
|
|
32
|
-
max-height: 70px;
|
|
33
|
-
width: auto;
|
|
34
|
-
height: auto;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.login crowdin-input {
|
|
38
|
-
margin-bottom: 8px;
|
|
39
|
-
display: block;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.login .inputs {
|
|
43
|
-
margin-bottom: 24px;
|
|
44
|
-
text-align: left;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.login crowdin-h4 {
|
|
48
|
-
margin: 8px 0 16px;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.ml-1 {
|
|
52
|
-
margin-left: 8px;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.m-0 {
|
|
56
|
-
margin: 0;
|
|
57
|
-
}
|