@crowdin/app-project-module 0.37.0 → 0.38.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/handlers/manifest.js +12 -0
- package/out/index.js +3 -0
- package/out/models/index.d.ts +22 -2
- package/out/models/index.js +8 -8
- package/out/util/cron.js +2 -0
- package/out/util/logger.js +20 -0
- package/package.json +3 -3
package/out/handlers/manifest.js
CHANGED
|
@@ -113,6 +113,18 @@ function handle(config) {
|
|
|
113
113
|
},
|
|
114
114
|
];
|
|
115
115
|
}
|
|
116
|
+
if (config.editorThemes) {
|
|
117
|
+
modules['editor-themes'] = [
|
|
118
|
+
{
|
|
119
|
+
key: config.identifier + '-editor-themes',
|
|
120
|
+
name: config.editorThemes.name || config.name,
|
|
121
|
+
logo: (0, util_1.getLogoUrl)(config.editorThemes, '/editor-themes'),
|
|
122
|
+
styles: config.editorThemes.styles,
|
|
123
|
+
modes: config.editorThemes.modes,
|
|
124
|
+
environments: config.editorThemes.environments,
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
}
|
|
116
128
|
if (config.projectMenu) {
|
|
117
129
|
modules['project-menu'] = [
|
|
118
130
|
{
|
package/out/index.js
CHANGED
|
@@ -225,6 +225,9 @@ function addCrowdinEndpoints(app, clientConfig) {
|
|
|
225
225
|
if (config.editorRightPanel) {
|
|
226
226
|
app.use('/editor-panels', (0, ui_module_1.default)(config, config.editorRightPanel.allowUnauthorized), (0, render_ui_module_1.default)(config.editorRightPanel));
|
|
227
227
|
}
|
|
228
|
+
if (config.editorThemes) {
|
|
229
|
+
app.get((0, util_1.getLogoUrl)(config.editorThemes, '/editor-themes'), (req, res) => { var _a; return res.sendFile(((_a = config.editorThemes) === null || _a === void 0 ? void 0 : _a.imagePath) || config.imagePath); });
|
|
230
|
+
}
|
|
228
231
|
if (config.projectMenu) {
|
|
229
232
|
app.use('/project-menu', (0, ui_module_1.default)(config, config.projectMenu.allowUnauthorized), (0, render_ui_module_1.default)(config.projectMenu));
|
|
230
233
|
}
|
package/out/models/index.d.ts
CHANGED
|
@@ -94,6 +94,10 @@ export interface ClientConfig extends ImagePath {
|
|
|
94
94
|
* editor-right-panel module
|
|
95
95
|
*/
|
|
96
96
|
editorRightPanel?: EditorPanels & Environments;
|
|
97
|
+
/**
|
|
98
|
+
* editor-themes module
|
|
99
|
+
*/
|
|
100
|
+
editorThemes?: EditorThemes & ImagePath & Environments;
|
|
97
101
|
/**
|
|
98
102
|
* project menu module
|
|
99
103
|
*/
|
|
@@ -754,9 +758,25 @@ export interface EditorPanels extends UiModule {
|
|
|
754
758
|
/**
|
|
755
759
|
* The Editor's mode list where the module will be available.
|
|
756
760
|
*/
|
|
757
|
-
modes:
|
|
761
|
+
modes: EditorMode[];
|
|
762
|
+
}
|
|
763
|
+
export interface EditorThemes {
|
|
764
|
+
/**
|
|
765
|
+
* Module name
|
|
766
|
+
*/
|
|
767
|
+
name?: string;
|
|
768
|
+
/**
|
|
769
|
+
* Defines a set of CSS custom variables for theming purposes
|
|
770
|
+
*/
|
|
771
|
+
styles: {
|
|
772
|
+
[key: string]: string;
|
|
773
|
+
};
|
|
774
|
+
/**
|
|
775
|
+
* The Editor's mode list where the module will be available.
|
|
776
|
+
*/
|
|
777
|
+
modes: EditorMode[];
|
|
758
778
|
}
|
|
759
|
-
export declare enum
|
|
779
|
+
export declare enum EditorMode {
|
|
760
780
|
ASSETS = "assets",
|
|
761
781
|
REVIEW = "review",
|
|
762
782
|
TRANSLATE = "TRANSLATE",
|
package/out/models/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProjectPermissions = exports.UserPermissions = exports.SyncSchedule = exports.SyncCondition = exports.RequestMethods = exports.Provider = exports.ContextOptionsTypes = exports.ContextOptionsLocations = exports.
|
|
3
|
+
exports.ProjectPermissions = exports.UserPermissions = exports.SyncSchedule = exports.SyncCondition = exports.RequestMethods = exports.Provider = exports.ContextOptionsTypes = exports.ContextOptionsLocations = exports.EditorMode = exports.ProcessFileJobType = exports.SubscriptionInfoType = exports.AccountType = exports.Scope = exports.AuthenticationType = void 0;
|
|
4
4
|
var AuthenticationType;
|
|
5
5
|
(function (AuthenticationType) {
|
|
6
6
|
AuthenticationType["CODE"] = "authorization_code";
|
|
@@ -44,13 +44,13 @@ var ProcessFileJobType;
|
|
|
44
44
|
ProcessFileJobType["PRE_EXPORT"] = "pre-export-file";
|
|
45
45
|
ProcessFileJobType["POST_EXPORT"] = "post-export-file";
|
|
46
46
|
})(ProcessFileJobType = exports.ProcessFileJobType || (exports.ProcessFileJobType = {}));
|
|
47
|
-
var
|
|
48
|
-
(function (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
})(
|
|
47
|
+
var EditorMode;
|
|
48
|
+
(function (EditorMode) {
|
|
49
|
+
EditorMode["ASSETS"] = "assets";
|
|
50
|
+
EditorMode["REVIEW"] = "review";
|
|
51
|
+
EditorMode["TRANSLATE"] = "TRANSLATE";
|
|
52
|
+
EditorMode["PROOFREAD"] = "proofread";
|
|
53
|
+
})(EditorMode = exports.EditorMode || (exports.EditorMode = {}));
|
|
54
54
|
var ContextOptionsLocations;
|
|
55
55
|
(function (ContextOptionsLocations) {
|
|
56
56
|
ContextOptionsLocations["TM"] = "tm";
|
package/out/util/cron.js
CHANGED
|
@@ -103,6 +103,8 @@ function filesCron(config, integration, period) {
|
|
|
103
103
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
104
104
|
organization_id: crowdinCredentials.organizationId,
|
|
105
105
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
106
|
+
organization_domain: crowdinCredentials.domain,
|
|
107
|
+
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
106
108
|
user_id: crowdinCredentials.userId,
|
|
107
109
|
},
|
|
108
110
|
},
|
package/out/util/logger.js
CHANGED
|
@@ -49,6 +49,7 @@ function withContextError(context) {
|
|
|
49
49
|
}
|
|
50
50
|
exports.withContextError = withContextError;
|
|
51
51
|
function log(message, context) {
|
|
52
|
+
var _a, _b, _c;
|
|
52
53
|
if (logConfig === null || logConfig === void 0 ? void 0 : logConfig.enabled) {
|
|
53
54
|
if (logConfig.log) {
|
|
54
55
|
logConfig.log(message, context);
|
|
@@ -59,11 +60,20 @@ function log(message, context) {
|
|
|
59
60
|
logsFormatter.setContext({
|
|
60
61
|
project: {
|
|
61
62
|
id: context.jwtPayload.context.project_id,
|
|
63
|
+
identifier: (_a = context.jwtPayload.context.project_identifier) !== null && _a !== void 0 ? _a : '',
|
|
62
64
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
63
65
|
organization_id: context.jwtPayload.context.organization_id,
|
|
64
66
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
65
67
|
user_id: context.jwtPayload.context.user_id,
|
|
66
68
|
},
|
|
69
|
+
user: {
|
|
70
|
+
id: context.jwtPayload.context.user_id,
|
|
71
|
+
login: (_b = context.jwtPayload.context.user_login) !== null && _b !== void 0 ? _b : '',
|
|
72
|
+
},
|
|
73
|
+
organization: {
|
|
74
|
+
id: context.jwtPayload.context.organization_id,
|
|
75
|
+
domain: (_c = context.jwtPayload.context.organization_domain) !== null && _c !== void 0 ? _c : '',
|
|
76
|
+
},
|
|
67
77
|
});
|
|
68
78
|
prefix += ` Context [${JSON.stringify(prepareContext(context))}]`;
|
|
69
79
|
}
|
|
@@ -74,6 +84,7 @@ function log(message, context) {
|
|
|
74
84
|
}
|
|
75
85
|
exports.log = log;
|
|
76
86
|
function logError(e, context) {
|
|
87
|
+
var _a, _b, _c;
|
|
77
88
|
if (onError) {
|
|
78
89
|
onError(e, context);
|
|
79
90
|
}
|
|
@@ -82,11 +93,20 @@ function logError(e, context) {
|
|
|
82
93
|
logsFormatter.setContext({
|
|
83
94
|
project: {
|
|
84
95
|
id: context.jwtPayload.context.project_id,
|
|
96
|
+
identifier: (_a = context.jwtPayload.context.project_identifier) !== null && _a !== void 0 ? _a : '',
|
|
85
97
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
86
98
|
organization_id: context.jwtPayload.context.organization_id,
|
|
87
99
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
88
100
|
user_id: context.jwtPayload.context.user_id,
|
|
89
101
|
},
|
|
102
|
+
user: {
|
|
103
|
+
id: context.jwtPayload.context.user_id,
|
|
104
|
+
login: (_b = context.jwtPayload.context.user_login) !== null && _b !== void 0 ? _b : '',
|
|
105
|
+
},
|
|
106
|
+
organization: {
|
|
107
|
+
id: context.jwtPayload.context.organization_id,
|
|
108
|
+
domain: (_c = context.jwtPayload.context.organization_domain) !== null && _c !== void 0 ? _c : '',
|
|
109
|
+
},
|
|
90
110
|
});
|
|
91
111
|
}
|
|
92
112
|
if (e instanceof AppModuleAggregateError) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crowdin/app-project-module",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.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",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@aws-sdk/client-s3": "^3.423.0",
|
|
18
18
|
"@aws-sdk/s3-request-presigner": "^3.423.0",
|
|
19
|
-
"@crowdin/crowdin-apps-functions": "0.
|
|
20
|
-
"@crowdin/logs-formatter": "^2.0.
|
|
19
|
+
"@crowdin/crowdin-apps-functions": "0.6.0",
|
|
20
|
+
"@crowdin/logs-formatter": "^2.0.5",
|
|
21
21
|
"@godaddy/terminus": "^4.12.1",
|
|
22
22
|
"@types/pg": "^8.10.3",
|
|
23
23
|
"amqplib": "^0.10.3",
|