@crowdin/app-project-module 1.9.0 → 1.11.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 +323 -18
- package/out/modules/api/components.d.ts +222 -19
- package/out/modules/api/components.js +222 -19
- package/out/modules/custom-mt/index.js +2 -1
- package/out/modules/file-processing/handlers/file-download.js +2 -1
- package/out/modules/file-processing/handlers/pre-post-process.js +2 -1
- package/out/modules/file-processing/handlers/translations-alignment.js +2 -1
- package/out/modules/file-processing/index.js +3 -2
- package/out/modules/file-processing/util/folder.d.ts +1 -0
- package/out/modules/file-processing/util/folder.js +13 -0
- package/out/modules/integration/handlers/crowdin-file-progress.js +5 -2
- package/out/modules/integration/handlers/integration-data.js +14 -2
- package/out/modules/integration/handlers/job-list.js +4 -1
- package/out/modules/integration/handlers/settings-save.js +85 -42
- package/out/modules/integration/handlers/settings-schema.d.ts +3 -0
- package/out/modules/integration/handlers/settings-schema.js +29 -0
- package/out/modules/integration/handlers/sync-settings-save.js +57 -3
- package/out/modules/integration/handlers/sync-settings.js +11 -3
- package/out/modules/integration/types.d.ts +7 -0
- package/out/modules/integration/util/files.js +19 -7
- package/out/modules/integration/util/job.d.ts +2 -1
- package/out/modules/integration/util/job.js +3 -2
- package/out/modules/integration/util/types.d.ts +4 -2
- package/out/modules/integration/util/types.js +2 -0
- package/out/static/ui/main.bundle.js +94 -3
- package/out/static/ui/main.bundle.js.map +1 -1
- package/out/util/index.js +3 -1
- package/out/util/logger.d.ts +1 -0
- package/out/util/logger.js +7 -0
- package/package.json +14 -9
package/out/util/index.js
CHANGED
|
@@ -103,7 +103,9 @@ function handleError(err, req, res) {
|
|
|
103
103
|
}
|
|
104
104
|
if (!res.headersSent) {
|
|
105
105
|
const errorMessage = { message: (0, logger_1.getErrorMessage)(err), code };
|
|
106
|
-
|
|
106
|
+
const isApiCall = isCrowdinClientRequest(req) && req.isApiCall;
|
|
107
|
+
const isUiIntegration = 'integrationCredentials' in req && !isApiCall;
|
|
108
|
+
if (isUiIntegration) {
|
|
107
109
|
const html = (0, jsx_renderer_1.renderJSXOnClient)({ name: 'error', props: errorMessage });
|
|
108
110
|
res.setHeader('Content-Type', 'text/html; charset=utf-8');
|
|
109
111
|
res.send(html);
|
package/out/util/logger.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export declare class AppModuleError extends Error {
|
|
|
25
25
|
data: any;
|
|
26
26
|
appData: any;
|
|
27
27
|
isAxiosError: boolean;
|
|
28
|
+
code?: number;
|
|
28
29
|
constructor(error: CustomAxiosError | Error | string, data?: any);
|
|
29
30
|
}
|
|
30
31
|
export declare class AppUserModuleError extends AppModuleError {
|
package/out/util/logger.js
CHANGED
|
@@ -197,6 +197,7 @@ function getErrorMessage(err) {
|
|
|
197
197
|
}
|
|
198
198
|
class AppModuleError extends Error {
|
|
199
199
|
constructor(error, data) {
|
|
200
|
+
var _a;
|
|
200
201
|
super(typeof error === 'string' ? error : error.message);
|
|
201
202
|
this.isAxiosError = false;
|
|
202
203
|
this.name = 'AppModuleError';
|
|
@@ -209,6 +210,12 @@ class AppModuleError extends Error {
|
|
|
209
210
|
}
|
|
210
211
|
if (isAxiosError(error)) {
|
|
211
212
|
this.isAxiosError = true;
|
|
213
|
+
// Extract HTTP status code from axios error
|
|
214
|
+
this.code = ((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) || error.status;
|
|
215
|
+
}
|
|
216
|
+
else if (error.code && typeof error.code === 'number') {
|
|
217
|
+
// If error already has a numeric code property (e.g., CodeError)
|
|
218
|
+
this.code = error.code;
|
|
212
219
|
}
|
|
213
220
|
}
|
|
214
221
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crowdin/app-project-module",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "Module that generates for you all common endpoints for serving standalone Crowdin App",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"types": "out/index.d.ts",
|
|
@@ -10,15 +10,20 @@
|
|
|
10
10
|
"import": "./out/index.js",
|
|
11
11
|
"types": "./out/index.d.ts"
|
|
12
12
|
},
|
|
13
|
-
"./functions
|
|
14
|
-
"require": "./out/util/app-functions
|
|
15
|
-
"import": "./out/util/app-functions
|
|
16
|
-
"types": "./out/util/app-functions
|
|
13
|
+
"./functions/*": {
|
|
14
|
+
"require": "./out/util/app-functions/*.js",
|
|
15
|
+
"import": "./out/util/app-functions/*.js",
|
|
16
|
+
"types": "./out/util/app-functions/*.d.ts"
|
|
17
17
|
},
|
|
18
|
-
"./
|
|
19
|
-
"require": "./out
|
|
20
|
-
"import": "./out
|
|
21
|
-
"types": "./out
|
|
18
|
+
"./out/*": {
|
|
19
|
+
"require": "./out/*.js",
|
|
20
|
+
"import": "./out/*.js",
|
|
21
|
+
"types": "./out/*.d.ts"
|
|
22
|
+
},
|
|
23
|
+
"./modules/*": {
|
|
24
|
+
"require": "./out/modules/*/types.js",
|
|
25
|
+
"import": "./out/modules/*/types.js",
|
|
26
|
+
"types": "./out/modules/*/types.d.ts"
|
|
22
27
|
}
|
|
23
28
|
},
|
|
24
29
|
"scripts": {
|