nodebb-plugin-customize 4.0.2 → 4.0.3
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/build/lib/build.js +54 -55
- package/build/lib/build.js.map +1 -1
- package/build/lib/controllers.js +119 -119
- package/build/lib/controllers.js.map +1 -1
- package/build/lib/database.js +103 -91
- package/build/lib/database.js.map +1 -1
- package/build/lib/index.js +18 -18
- package/build/lib/pubsub.js +32 -33
- package/build/lib/pubsub.js.map +1 -1
- package/build/public/language/pl-PL/admin/plugins/customize.json +5 -0
- package/build/public/lib/index.js +10 -0
- package/build/public/lib/index.js.map +1 -0
- package/build/public/lib/shared.js +25 -0
- package/build/public/lib/shared.js.map +1 -0
- package/build/public/lib/templates.js +157 -0
- package/build/public/lib/templates.js.map +1 -0
- package/build/public/lib/translations.js +148 -0
- package/build/public/lib/translations.js.map +1 -0
- package/build/public/templates/admin/plugins/customize.tpl +9 -8
- package/build/public/templates/partials/admin/plugins/customize/templates-list.tpl +1 -1
- package/lib/database.ts +24 -5
- package/package.json +16 -16
- package/public/lib/types.d.ts +2 -0
- package/build/public/lib/admin.js +0 -345
- package/build/public/lib/admin.js.map +0 -1
- package/build/public/templates/400.tpl +0 -13
package/build/lib/build.js
CHANGED
|
@@ -1,56 +1,55 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.build =
|
|
4
|
-
const fs_extra_1 = require("fs-extra");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
const lodash_1 = require("lodash");
|
|
7
|
-
const database_1 = require("./database");
|
|
8
|
-
if (!require.main) {
|
|
9
|
-
throw Error('[plugin-customize] `require.main` is wrong');
|
|
10
|
-
}
|
|
11
|
-
const translationsSrcDir = (0, path_1.join)(__dirname, '../../public/language');
|
|
12
|
-
const templatesSrcDir = (0, path_1.join)(__dirname, '../../public/templates');
|
|
13
|
-
const translationsDir = (0, path_1.join)(__dirname, '../public/language');
|
|
14
|
-
const templatesDir = (0, path_1.join)(__dirname, '../public/templates');
|
|
15
|
-
async function build() {
|
|
16
|
-
const [translations, templates] = await Promise.all([
|
|
17
|
-
(0, database_1.getTranslations)(),
|
|
18
|
-
(0, database_1.getTemplates)(),
|
|
19
|
-
]);
|
|
20
|
-
const translationTree = {};
|
|
21
|
-
translations.forEach(({ language, namespace, key, value }) => {
|
|
22
|
-
translationTree[language] = translationTree[language] || {};
|
|
23
|
-
translationTree[language][namespace] = translationTree[language][namespace] || {};
|
|
24
|
-
translationTree[language][namespace][key] = value;
|
|
25
|
-
});
|
|
26
|
-
// delete existing files
|
|
27
|
-
await Promise.all([
|
|
28
|
-
(0, fs_extra_1.remove)(translationsDir),
|
|
29
|
-
(0, fs_extra_1.remove)(templatesDir),
|
|
30
|
-
]);
|
|
31
|
-
await Promise.all([
|
|
32
|
-
(0, fs_extra_1.mkdirp)(translationsDir),
|
|
33
|
-
(0, fs_extra_1.mkdirp)(templatesDir),
|
|
34
|
-
]);
|
|
35
|
-
// copy in own step to avoid conflicts
|
|
36
|
-
await Promise.all([
|
|
37
|
-
(0, fs_extra_1.copy)(translationsSrcDir, translationsDir),
|
|
38
|
-
(0, fs_extra_1.copy)(templatesSrcDir, templatesDir),
|
|
39
|
-
]);
|
|
40
|
-
const translationWrites = (0, lodash_1.flatMap)(Object.keys(translationTree), (language) => (0, lodash_1.flatMap)(Object.keys(translationTree[language]), async (namespace) => {
|
|
41
|
-
const path = (0, path_1.join)(translationsDir, language, `${namespace}.json`);
|
|
42
|
-
await (0, fs_extra_1.mkdirp)((0, path_1.dirname)(path));
|
|
43
|
-
await (0, fs_extra_1.writeJson)(path, translationTree[language][namespace]);
|
|
44
|
-
}));
|
|
45
|
-
const templateWrites = templates.map(async ({ path, value }) => {
|
|
46
|
-
const filePath = (0, path_1.join)(templatesDir, path);
|
|
47
|
-
await (0, fs_extra_1.mkdirp)((0, path_1.dirname)(filePath));
|
|
48
|
-
await (0, fs_extra_1.writeFile)(filePath, value);
|
|
49
|
-
});
|
|
50
|
-
await Promise.all([
|
|
51
|
-
...translationWrites,
|
|
52
|
-
...templateWrites,
|
|
53
|
-
]);
|
|
54
|
-
}
|
|
55
|
-
exports.build = build;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.build = build;
|
|
4
|
+
const fs_extra_1 = require("fs-extra");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const lodash_1 = require("lodash");
|
|
7
|
+
const database_1 = require("./database");
|
|
8
|
+
if (!require.main) {
|
|
9
|
+
throw Error('[plugin-customize] `require.main` is wrong');
|
|
10
|
+
}
|
|
11
|
+
const translationsSrcDir = (0, path_1.join)(__dirname, '../../public/language');
|
|
12
|
+
const templatesSrcDir = (0, path_1.join)(__dirname, '../../public/templates');
|
|
13
|
+
const translationsDir = (0, path_1.join)(__dirname, '../public/language');
|
|
14
|
+
const templatesDir = (0, path_1.join)(__dirname, '../public/templates');
|
|
15
|
+
async function build() {
|
|
16
|
+
const [translations, templates] = await Promise.all([
|
|
17
|
+
(0, database_1.getTranslations)(),
|
|
18
|
+
(0, database_1.getTemplates)(),
|
|
19
|
+
]);
|
|
20
|
+
const translationTree = {};
|
|
21
|
+
translations.forEach(({ language, namespace, key, value }) => {
|
|
22
|
+
translationTree[language] = translationTree[language] || {};
|
|
23
|
+
translationTree[language][namespace] = translationTree[language][namespace] || {};
|
|
24
|
+
translationTree[language][namespace][key] = value;
|
|
25
|
+
});
|
|
26
|
+
// delete existing files
|
|
27
|
+
await Promise.all([
|
|
28
|
+
(0, fs_extra_1.remove)(translationsDir),
|
|
29
|
+
(0, fs_extra_1.remove)(templatesDir),
|
|
30
|
+
]);
|
|
31
|
+
await Promise.all([
|
|
32
|
+
(0, fs_extra_1.mkdirp)(translationsDir),
|
|
33
|
+
(0, fs_extra_1.mkdirp)(templatesDir),
|
|
34
|
+
]);
|
|
35
|
+
// copy in own step to avoid conflicts
|
|
36
|
+
await Promise.all([
|
|
37
|
+
(0, fs_extra_1.copy)(translationsSrcDir, translationsDir),
|
|
38
|
+
(0, fs_extra_1.copy)(templatesSrcDir, templatesDir),
|
|
39
|
+
]);
|
|
40
|
+
const translationWrites = (0, lodash_1.flatMap)(Object.keys(translationTree), (language) => (0, lodash_1.flatMap)(Object.keys(translationTree[language]), async (namespace) => {
|
|
41
|
+
const path = (0, path_1.join)(translationsDir, language, `${namespace}.json`);
|
|
42
|
+
await (0, fs_extra_1.mkdirp)((0, path_1.dirname)(path));
|
|
43
|
+
await (0, fs_extra_1.writeJson)(path, translationTree[language][namespace]);
|
|
44
|
+
}));
|
|
45
|
+
const templateWrites = templates.map(async ({ path, value }) => {
|
|
46
|
+
const filePath = (0, path_1.join)(templatesDir, path);
|
|
47
|
+
await (0, fs_extra_1.mkdirp)((0, path_1.dirname)(filePath));
|
|
48
|
+
await (0, fs_extra_1.writeFile)(filePath, value);
|
|
49
|
+
});
|
|
50
|
+
await Promise.all([
|
|
51
|
+
...translationWrites,
|
|
52
|
+
...templateWrites,
|
|
53
|
+
]);
|
|
54
|
+
}
|
|
56
55
|
//# sourceMappingURL=build.js.map
|
package/build/lib/build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../lib/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../lib/build.ts"],"names":[],"mappings":";;AAmBA,sBA2DC;AA9ED,uCAMkB;AAClB,+BAAqC;AACrC,mCAAiC;AAEjC,yCAA2D;AAE3D,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IAAC,MAAM,KAAK,CAAC,4CAA4C,CAAC,CAAC;AAAC,CAAC;AAEjF,MAAM,kBAAkB,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC;AACpE,MAAM,eAAe,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,wBA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H,MAAM,iBAAiB,GAAG,IAAA,gBAAO,EAC/B,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,EAC5B,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAA,gBAAO,EACnB,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,EACtC,KAAK,EAAE,SAAS,EAAE,EAAE;QAClB,MAAM,IAAI,GAAG,IAAA,WAAI,EAAC,eAAe,EAAE,QAAQ,EAAE,GAAG,SAAS,OAAO,CAAC,CAAC;QAClE,MAAM,IAAA,iBAAM,EAAC,IAAA,cAAO,EAAC,IAAI,CAAC,CAAC,CAAC;QAC5B,MAAM,IAAA,oBAAS,EAAC,IAAI,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9D,CAAC,CACF,CACF,CAAC;IAEF,MAAM,cAAc,GAAG,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;QAC7D,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QAC1C,MAAM,IAAA,iBAAM,EAAC,IAAA,cAAO,EAAC,QAAQ,CAAC,CAAC,CAAC;QAChC,MAAM,IAAA,oBAAS,EAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,GAAG,iBAAiB;QACpB,GAAG,cAAc;KAClB,CAAC,CAAC;AACL,CAAC"}
|
package/build/lib/controllers.js
CHANGED
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const {
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
db.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
setupApiRoute(router, '
|
|
115
|
-
setupApiRoute(router, '
|
|
116
|
-
setupApiRoute(router, '
|
|
117
|
-
setupApiRoute(router, '
|
|
118
|
-
|
|
119
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = controllers;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const util_1 = require("util");
|
|
6
|
+
const fs_extra_1 = require("fs-extra");
|
|
7
|
+
const pubsub_1 = require("./pubsub");
|
|
8
|
+
const db = require("./database");
|
|
9
|
+
if (!require.main) {
|
|
10
|
+
throw Error('[plugin-customize] `require.main` is undefined');
|
|
11
|
+
}
|
|
12
|
+
const nconf = require.main.require('nconf');
|
|
13
|
+
const User = require.main.require('./src/user');
|
|
14
|
+
const Languages = require.main.require('./src/languages');
|
|
15
|
+
const File = require.main.require('./src/file');
|
|
16
|
+
const Translator = require.main.require('./src/translator');
|
|
17
|
+
const Utils = require.main.require('./src/utils');
|
|
18
|
+
const { setupApiRoute, setupAdminPageRoute } = require.main.require('./src/routes/helpers');
|
|
19
|
+
const { formatApiResponse } = require.main.require('./src/controllers/helpers');
|
|
20
|
+
const escape = (dirty) => Translator.escape(Utils.escapeHTML(dirty));
|
|
21
|
+
const listLanguages = (0, util_1.promisify)(Languages.list);
|
|
22
|
+
const getSettings = (0, util_1.promisify)(User.getSettings);
|
|
23
|
+
const walk = (0, util_1.promisify)(File.walk);
|
|
24
|
+
// eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-var-requires
|
|
25
|
+
const version = require((0, path_1.join)(__dirname, '../../package.json')).version;
|
|
26
|
+
let namespaceCache = [];
|
|
27
|
+
async function listNamespaces() {
|
|
28
|
+
if (namespaceCache.length) {
|
|
29
|
+
return namespaceCache;
|
|
30
|
+
}
|
|
31
|
+
const metadataFile = (0, path_1.join)(nconf.get('base_dir'), 'build/public/language/metadata.json');
|
|
32
|
+
const metadata = await (0, fs_extra_1.readJson)(metadataFile);
|
|
33
|
+
namespaceCache = metadata.namespaces;
|
|
34
|
+
return namespaceCache;
|
|
35
|
+
}
|
|
36
|
+
let templateCache = [];
|
|
37
|
+
async function listTemplates() {
|
|
38
|
+
if (templateCache.length) {
|
|
39
|
+
return templateCache;
|
|
40
|
+
}
|
|
41
|
+
const viewsDir = nconf.get('views_dir');
|
|
42
|
+
const templates = await walk(viewsDir);
|
|
43
|
+
templateCache = templates
|
|
44
|
+
.filter((path) => path.endsWith('.tpl'))
|
|
45
|
+
.map((path) => (0, path_1.relative)(viewsDir, path).split(/\/\\/).join('/'));
|
|
46
|
+
return templateCache;
|
|
47
|
+
}
|
|
48
|
+
const renderAdmin = async (req, res) => {
|
|
49
|
+
const [templates, translations, languages, userLang, namespaces, templatePaths,] = await Promise.all([
|
|
50
|
+
db.getTemplates(),
|
|
51
|
+
db.getTranslations(),
|
|
52
|
+
listLanguages(),
|
|
53
|
+
getSettings(req.uid).then((data) => data.userLang),
|
|
54
|
+
listNamespaces(),
|
|
55
|
+
listTemplates(),
|
|
56
|
+
]);
|
|
57
|
+
res.render('admin/plugins/customize', {
|
|
58
|
+
version,
|
|
59
|
+
templates: templates.map((x) => ({
|
|
60
|
+
path: x.path,
|
|
61
|
+
json: escape(JSON.stringify(x)),
|
|
62
|
+
diff: escape(x.diff),
|
|
63
|
+
})),
|
|
64
|
+
translations,
|
|
65
|
+
languages: languages.map(({ code, name }) => ({
|
|
66
|
+
code,
|
|
67
|
+
name,
|
|
68
|
+
selected: code === userLang,
|
|
69
|
+
})),
|
|
70
|
+
namespaces: namespaces.map((name) => ({ name })),
|
|
71
|
+
templatePaths,
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
const adminBuild = async (req, res) => {
|
|
75
|
+
await (0, pubsub_1.build)();
|
|
76
|
+
formatApiResponse(200, res, 'OK');
|
|
77
|
+
};
|
|
78
|
+
const adminEditTranslation = async (req, res) => {
|
|
79
|
+
const translation = req.body.translation;
|
|
80
|
+
await db.editTranslation(translation);
|
|
81
|
+
const translations = await db.getTranslations();
|
|
82
|
+
formatApiResponse(200, res, { translations });
|
|
83
|
+
};
|
|
84
|
+
const adminRemoveTranslation = async (req, res) => {
|
|
85
|
+
await db.removeTranslation(req.body.translation);
|
|
86
|
+
const translations = await db.getTranslations();
|
|
87
|
+
formatApiResponse(200, res, { translations });
|
|
88
|
+
};
|
|
89
|
+
const adminEditTemplate = async (req, res) => {
|
|
90
|
+
const template = req.body.template;
|
|
91
|
+
await db.editTemplate(template);
|
|
92
|
+
const templates = await db.getTemplates();
|
|
93
|
+
formatApiResponse(200, res, {
|
|
94
|
+
templates: templates.map((x) => ({
|
|
95
|
+
path: x.path,
|
|
96
|
+
json: escape(JSON.stringify(x)),
|
|
97
|
+
diff: escape(x.diff),
|
|
98
|
+
})),
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
const adminRemoveTemplate = async (req, res) => {
|
|
102
|
+
await db.removeTemplate(req.body.template);
|
|
103
|
+
const templates = await db.getTemplates();
|
|
104
|
+
formatApiResponse(200, res, {
|
|
105
|
+
templates: templates.map((x) => ({
|
|
106
|
+
path: x.path,
|
|
107
|
+
json: escape(JSON.stringify(x)),
|
|
108
|
+
diff: escape(x.diff),
|
|
109
|
+
})),
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
function controllers({ router, middleware }) {
|
|
113
|
+
setupAdminPageRoute(router, '/admin/plugins/customize', renderAdmin);
|
|
114
|
+
setupApiRoute(router, 'put', '/api/v3/admin/plugins/customize/edit/template', [middleware.admin.checkPrivileges], adminEditTemplate);
|
|
115
|
+
setupApiRoute(router, 'delete', '/api/v3/admin/plugins/customize/delete/template', [middleware.admin.checkPrivileges], adminRemoveTemplate);
|
|
116
|
+
setupApiRoute(router, 'put', '/api/v3/admin/plugins/customize/edit/translation', [middleware.admin.checkPrivileges], adminEditTranslation);
|
|
117
|
+
setupApiRoute(router, 'delete', '/api/v3/admin/plugins/customize/delete/translation', [middleware.admin.checkPrivileges], adminRemoveTranslation);
|
|
118
|
+
setupApiRoute(router, 'put', '/api/v3/admin/plugins/customize/build', [middleware.admin.checkPrivileges], adminBuild);
|
|
119
|
+
}
|
|
120
120
|
//# sourceMappingURL=controllers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controllers.js","sourceRoot":"","sources":["../../lib/controllers.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"controllers.js","sourceRoot":"","sources":["../../lib/controllers.ts"],"names":[],"mappings":";;AA0IA,8BAUC;AAnJD,+BAAsC;AACtC,+BAAiC;AACjC,uCAAoC;AAEpC,qCAAiC;AACjC,iCAAiC;AAEjC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IAAC,MAAM,KAAK,CAAC,gDAAgD,CAAC,CAAC;AAAC,CAAC;AACrF,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAC5C,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AAChD,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAC1D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AAChD,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC5D,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;AAClD,MAAM,EAAE,aAAa,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAC5F,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAEhF,MAAM,MAAM,G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,CAAC,UAAU,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,oBAAoB,CAAC,CAAC;IAC3I,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,oDAAoD,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,sBAAsB,CAAC,CAAC;IAElJ,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,uCAAuC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC,CAAC;AACxH,CAAC"}
|
package/build/lib/database.js
CHANGED
|
@@ -1,92 +1,104 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// types and helper functions for database
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
// types and helper functions for database
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.getTranslations = getTranslations;
|
|
5
|
+
exports.editTranslation = editTranslation;
|
|
6
|
+
exports.removeTranslation = removeTranslation;
|
|
7
|
+
exports.getTemplates = getTemplates;
|
|
8
|
+
exports.editTemplate = editTemplate;
|
|
9
|
+
exports.removeTemplate = removeTemplate;
|
|
10
|
+
const util_1 = require("util");
|
|
11
|
+
const path_1 = require("path");
|
|
12
|
+
const fs_extra_1 = require("fs-extra");
|
|
13
|
+
const diff_1 = require("diff");
|
|
14
|
+
if (!require.main) {
|
|
15
|
+
throw Error('[plugin-customize] `require.main` is undefined');
|
|
16
|
+
}
|
|
17
|
+
const db = require.main.require('./src/database');
|
|
18
|
+
const nconf = require.main.require('nconf');
|
|
19
|
+
const getSortedSetRange = (0, util_1.promisify)(db.getSortedSetRange);
|
|
20
|
+
const getObjects = (0, util_1.promisify)(db.getObjects);
|
|
21
|
+
const sortedSetAdd = (0, util_1.promisify)(db.sortedSetAdd);
|
|
22
|
+
const setObject = (0, util_1.promisify)(db.setObject);
|
|
23
|
+
const remove = (0, util_1.promisify)(db.delete);
|
|
24
|
+
const sortedSetRemove = (0, util_1.promisify)(db.sortedSetRemove);
|
|
25
|
+
const languagesDir = (0, path_1.join)(nconf.get('base_dir'), 'build/public/language');
|
|
26
|
+
const viewsDir = nconf.get('views_dir');
|
|
27
|
+
const translationsSet = 'plugin-customize:translations';
|
|
28
|
+
const translationHashKey = (key) => `${translationsSet}:${key}`;
|
|
29
|
+
const templatesSet = 'plugin-customize:templates';
|
|
30
|
+
const templateHashKey = (key) => `${templatesSet}:${key}`;
|
|
31
|
+
// translation id looks like `<language>:<namespace>:<key>`
|
|
32
|
+
async function getTranslations() {
|
|
33
|
+
const ids = await getSortedSetRange(translationsSet, 0, -1);
|
|
34
|
+
const [hashes, currentValues] = await Promise.all([
|
|
35
|
+
getObjects(ids.map(translationHashKey)),
|
|
36
|
+
Promise.all(ids.map(async (id) => {
|
|
37
|
+
const [language, namespace, key] = id.split(':');
|
|
38
|
+
const filePath = (0, path_1.join)(languagesDir, language, `${namespace}.json`);
|
|
39
|
+
const translations = await (0, fs_extra_1.readJson)(filePath).catch(() => ({}));
|
|
40
|
+
return translations[key] || '';
|
|
41
|
+
})),
|
|
42
|
+
]);
|
|
43
|
+
return currentValues.map((current, i) => (Object.assign({ current }, hashes[i])));
|
|
44
|
+
}
|
|
45
|
+
async function editTranslation({ language, namespace, key, old, value, }) {
|
|
46
|
+
const id = `${language}:${namespace}:${key}`;
|
|
47
|
+
await Promise.all([
|
|
48
|
+
setObject(translationHashKey(id), {
|
|
49
|
+
language,
|
|
50
|
+
namespace,
|
|
51
|
+
key,
|
|
52
|
+
old,
|
|
53
|
+
value,
|
|
54
|
+
}),
|
|
55
|
+
sortedSetAdd(translationsSet, Date.now(), id),
|
|
56
|
+
]);
|
|
57
|
+
}
|
|
58
|
+
async function removeTranslation(id) {
|
|
59
|
+
await Promise.all([
|
|
60
|
+
remove(translationHashKey(id)),
|
|
61
|
+
sortedSetRemove(translationsSet, id),
|
|
62
|
+
]);
|
|
63
|
+
}
|
|
64
|
+
const PATCH_FAILED_NOTICE = `
|
|
65
|
+
<!--
|
|
66
|
+
Attention: PATCH FAILED
|
|
67
|
+
To fix this, you will need to delete this customization
|
|
68
|
+
and then recreate it manually.
|
|
69
|
+
-->
|
|
70
|
+
`;
|
|
71
|
+
async function getTemplates() {
|
|
72
|
+
const paths = await getSortedSetRange(templatesSet, 0, -1);
|
|
73
|
+
const [hashes, currentValues] = await Promise.all([
|
|
74
|
+
getObjects(paths.map(templateHashKey)),
|
|
75
|
+
Promise.all(paths.map(async (path) => {
|
|
76
|
+
const filePath = (0, path_1.join)(viewsDir, path);
|
|
77
|
+
return await (0, fs_extra_1.readFile)(filePath, 'utf-8');
|
|
78
|
+
})),
|
|
79
|
+
]);
|
|
80
|
+
return currentValues.map((current, i) => {
|
|
81
|
+
const patched = (0, diff_1.applyPatch)(hashes[i].old, hashes[i].diff);
|
|
82
|
+
if (patched === false) {
|
|
83
|
+
return Object.assign(Object.assign({}, hashes[i]), { path: paths[i], value: PATCH_FAILED_NOTICE + hashes[i].old });
|
|
84
|
+
}
|
|
85
|
+
return Object.assign(Object.assign({}, hashes[i]), { path: paths[i], value: patched });
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
async function editTemplate({ path, diff, old, }) {
|
|
89
|
+
await Promise.all([
|
|
90
|
+
setObject(templateHashKey(path), {
|
|
91
|
+
path,
|
|
92
|
+
diff,
|
|
93
|
+
old,
|
|
94
|
+
}),
|
|
95
|
+
sortedSetAdd(templatesSet, Date.now(), path),
|
|
96
|
+
]);
|
|
97
|
+
}
|
|
98
|
+
async function removeTemplate(path) {
|
|
99
|
+
await Promise.all([
|
|
100
|
+
remove(templateHashKey(path)),
|
|
101
|
+
sortedSetRemove(templatesSet, path),
|
|
102
|
+
]);
|
|
103
|
+
}
|
|
92
104
|
//# sourceMappingURL=database.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../lib/database.ts"],"names":[],"mappings":";AAAA,0CAA0C
|
|
1
|
+
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../lib/database.ts"],"names":[],"mappings":";AAAA,0CAA0C;;AA+C1C,0CAgBC;AAED,0CAmBC;AAED,8CAKC;AAgBD,o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