@crowdin/app-project-module 0.65.2 → 0.66.1
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.d.ts +2 -2
- package/out/index.js +2 -1
- package/out/util/axios.js +5 -1
- package/out/util/credentials-masker.d.ts +2 -1
- package/out/util/credentials-masker.js +2 -1
- package/out/views/main.handlebars +12 -11
- package/package.json +4 -3
package/out/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Express } from 'express';
|
|
2
2
|
import { ClientConfig, Config, CrowdinAppUtilities, CrowdinMetadataStore } from './types';
|
|
3
3
|
import express from './util/terminus-express';
|
|
4
|
-
import { getRequestCredentialsMasker, postRequestCredentialsMasker } from './util/credentials-masker';
|
|
5
|
-
export { getRequestCredentialsMasker, postRequestCredentialsMasker };
|
|
4
|
+
import { getRequestCredentialsMasker, postRequestCredentialsMasker, maskKey } from './util/credentials-masker';
|
|
5
|
+
export { getRequestCredentialsMasker, postRequestCredentialsMasker, maskKey };
|
|
6
6
|
export { ProjectPermissions, Scope, UserPermissions } from './types';
|
|
7
7
|
export { express };
|
|
8
8
|
export declare const metadataStore: CrowdinMetadataStore;
|
package/out/index.js
CHANGED
|
@@ -35,7 +35,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.addCrowdinEndpoints = exports.createApp = exports.metadataStore = exports.express = exports.UserPermissions = exports.Scope = exports.ProjectPermissions = exports.postRequestCredentialsMasker = exports.getRequestCredentialsMasker = void 0;
|
|
38
|
+
exports.addCrowdinEndpoints = exports.createApp = exports.metadataStore = exports.express = exports.UserPermissions = exports.Scope = exports.ProjectPermissions = exports.maskKey = exports.postRequestCredentialsMasker = exports.getRequestCredentialsMasker = void 0;
|
|
39
39
|
const logsFormatter = __importStar(require("@crowdin/logs-formatter"));
|
|
40
40
|
const path_1 = require("path");
|
|
41
41
|
const crowdin_client_1 = __importStar(require("./middlewares/crowdin-client"));
|
|
@@ -59,6 +59,7 @@ exports.express = terminus_express_1.default;
|
|
|
59
59
|
const credentials_masker_1 = require("./util/credentials-masker");
|
|
60
60
|
Object.defineProperty(exports, "getRequestCredentialsMasker", { enumerable: true, get: function () { return credentials_masker_1.getRequestCredentialsMasker; } });
|
|
61
61
|
Object.defineProperty(exports, "postRequestCredentialsMasker", { enumerable: true, get: function () { return credentials_masker_1.postRequestCredentialsMasker; } });
|
|
62
|
+
Object.defineProperty(exports, "maskKey", { enumerable: true, get: function () { return credentials_masker_1.maskKey; } });
|
|
62
63
|
//apps
|
|
63
64
|
const apiApp = __importStar(require("./modules/api"));
|
|
64
65
|
const contextMenuApp = __importStar(require("./modules/context-menu"));
|
package/out/util/axios.js
CHANGED
|
@@ -9,7 +9,11 @@ const axios_1 = __importDefault(require("axios"));
|
|
|
9
9
|
class AxiosProvider {
|
|
10
10
|
constructor() {
|
|
11
11
|
this.pendingRequests = 0;
|
|
12
|
-
this.axios = axios_1.default.create({
|
|
12
|
+
this.axios = axios_1.default.create({
|
|
13
|
+
validateStatus: (status) => {
|
|
14
|
+
return status < 400; // Resolve only if the status code is less than 400
|
|
15
|
+
},
|
|
16
|
+
});
|
|
13
17
|
this.configureRequest();
|
|
14
18
|
this.configureResponse();
|
|
15
19
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="qs" />
|
|
2
2
|
import { CrowdinClientRequest, UiModule } from '../types';
|
|
3
3
|
import { Request, Response } from 'express';
|
|
4
|
+
declare function maskKey(key: string): string;
|
|
4
5
|
declare function getRequestCredentialsMasker({ moduleConfig, dataPath, }: {
|
|
5
6
|
moduleConfig?: UiModule;
|
|
6
7
|
dataPath?: string;
|
|
7
8
|
}): (req: Request | CrowdinClientRequest, res: Response, next: Function) => any;
|
|
8
9
|
declare function postRequestCredentialsMasker(moduleConfig?: UiModule, credentialsExtractor?: Function): (req: CrowdinClientRequest | Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
|
|
9
|
-
export { getRequestCredentialsMasker, postRequestCredentialsMasker };
|
|
10
|
+
export { getRequestCredentialsMasker, postRequestCredentialsMasker, maskKey };
|
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.postRequestCredentialsMasker = exports.getRequestCredentialsMasker = void 0;
|
|
15
|
+
exports.maskKey = exports.postRequestCredentialsMasker = exports.getRequestCredentialsMasker = void 0;
|
|
16
16
|
const lodash_get_1 = __importDefault(require("lodash.get"));
|
|
17
17
|
const index_1 = require("./index");
|
|
18
18
|
const index_2 = require("../index");
|
|
@@ -24,6 +24,7 @@ function maskKey(key) {
|
|
|
24
24
|
const repeatCount = key.length > unmaskedCharsAtEnd ? key.length - unmaskedCharsAtEnd : 0;
|
|
25
25
|
return maskWith.repeat(repeatCount) + key.substring(key.length - 3);
|
|
26
26
|
}
|
|
27
|
+
exports.maskKey = maskKey;
|
|
27
28
|
function getMaskableFieldsKeys(moduleConfig) {
|
|
28
29
|
if (!moduleConfig.formUiSchema) {
|
|
29
30
|
return [];
|
|
@@ -467,18 +467,19 @@
|
|
|
467
467
|
appComponent.setIntegrationFilesData(tree);
|
|
468
468
|
} else if (tree.length) {
|
|
469
469
|
appComponent.pushIntegrationFilesData(tree).then(() => {
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
470
|
+
if (parentId) {
|
|
471
|
+
appIntegrationFiles.getSelected().then(selection => {
|
|
472
|
+
const selectedIds = selection?.filter((node) => node).map(({id}) => id.toString());
|
|
473
|
+
if (!selectedIds?.length) {
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
const filteredNodes = tree.filter((node) => selectedIds.includes(node.parent_id.toString()));
|
|
477
|
+
filteredNodes.forEach((node) => {
|
|
478
|
+
selectedIds.push(node.id);
|
|
479
|
+
});
|
|
480
|
+
appIntegrationFiles.setSelected(selectedIds);
|
|
479
481
|
});
|
|
480
|
-
|
|
481
|
-
});
|
|
482
|
+
}
|
|
482
483
|
});
|
|
483
484
|
}
|
|
484
485
|
{{#if integrationPagination}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crowdin/app-project-module",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.66.1",
|
|
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",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@aws-sdk/client-s3": "^3.606.0",
|
|
22
22
|
"@aws-sdk/s3-request-presigner": "^3.598.0",
|
|
23
23
|
"@crowdin/crowdin-apps-functions": "0.8.1",
|
|
24
|
-
"@crowdin/logs-formatter": "^2.1.
|
|
24
|
+
"@crowdin/logs-formatter": "^2.1.5",
|
|
25
25
|
"@godaddy/terminus": "^4.12.1",
|
|
26
26
|
"amqplib": "^0.10.4",
|
|
27
27
|
"crypto-js": "^4.2.0",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"@types/express": "4.17.21",
|
|
59
59
|
"@types/express-handlebars": "^5.3.1",
|
|
60
60
|
"@types/jest": "^29.5.12",
|
|
61
|
-
"@types/lodash.uniqby": "^4.7.9",
|
|
62
61
|
"@types/lodash.get": "^4.4.9",
|
|
62
|
+
"@types/lodash.uniqby": "^4.7.9",
|
|
63
63
|
"@types/node": "^16.18.101",
|
|
64
64
|
"@types/node-cron": "^3.0.11",
|
|
65
65
|
"@types/pg": "^8.11.6",
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"@types/uuid": "^9.0.7",
|
|
68
68
|
"@typescript-eslint/eslint-plugin": "^2.3.1",
|
|
69
69
|
"@typescript-eslint/parser": "^2.3.1",
|
|
70
|
+
"auto-changelog": "^2.5.0",
|
|
70
71
|
"eslint": "^6.4.0",
|
|
71
72
|
"eslint-config-prettier": "^6.3.0",
|
|
72
73
|
"eslint-plugin-prettier": "^3.1.1",
|