intlayer-editor 5.5.2 → 5.5.4
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/client/dist/assets/index-Yc-vRZFR.js +290 -0
- package/client/dist/index.html +1 -1
- package/package.json +28 -25
- package/server/dist/controllers/configuration.controller.cjs +4 -1
- package/server/dist/controllers/configuration.controller.cjs.map +1 -1
- package/server/dist/controllers/configuration.controller.d.ts +9 -0
- package/server/dist/controllers/configuration.controller.d.ts.map +1 -0
- package/server/dist/controllers/configuration.controller.mjs +4 -1
- package/server/dist/controllers/configuration.controller.mjs.map +1 -1
- package/server/dist/controllers/dictionary.controller.cjs +42 -2
- package/server/dist/controllers/dictionary.controller.cjs.map +1 -1
- package/server/dist/controllers/dictionary.controller.d.ts +23 -0
- package/server/dist/controllers/dictionary.controller.d.ts.map +1 -0
- package/server/dist/controllers/dictionary.controller.mjs +32 -3
- package/server/dist/controllers/dictionary.controller.mjs.map +1 -1
- package/server/dist/export.cjs +2 -0
- package/server/dist/export.cjs.map +1 -1
- package/server/dist/export.d.ts +3 -0
- package/server/dist/export.d.ts.map +1 -0
- package/server/dist/export.mjs +1 -0
- package/server/dist/export.mjs.map +1 -1
- package/server/dist/index.d.ts +2 -0
- package/server/dist/index.d.ts.map +1 -0
- package/server/dist/routes/config.routes.d.ts +10 -0
- package/server/dist/routes/config.routes.d.ts.map +1 -0
- package/server/dist/routes/dictionary.routes.cjs +9 -0
- package/server/dist/routes/dictionary.routes.cjs.map +1 -1
- package/server/dist/routes/dictionary.routes.d.ts +15 -0
- package/server/dist/routes/dictionary.routes.d.ts.map +1 -0
- package/server/dist/routes/dictionary.routes.mjs +13 -1
- package/server/dist/routes/dictionary.routes.mjs.map +1 -1
- package/server/dist/types/Routes.d.ts +7 -0
- package/server/dist/types/Routes.d.ts.map +1 -0
- package/server/dist/utils/checkPortAvailability.d.ts +2 -0
- package/server/dist/utils/checkPortAvailability.d.ts.map +1 -0
- package/server/dist/utils/httpStatusCodes.d.ts +395 -0
- package/server/dist/utils/httpStatusCodes.d.ts.map +1 -0
- package/server/dist/utils/responseData.d.ts +64 -0
- package/server/dist/utils/responseData.d.ts.map +1 -0
- package/client/dist/assets/index-A_u6piFE.js +0 -290
package/client/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Intlayer Editor</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-Yc-vRZFR.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-BF7i91m0.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intlayer-editor",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Integrate the Intlayer visual editor into your Intlayer projects, enabling CMS-like content management with multilingual support.",
|
|
6
6
|
"keywords": [
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
},
|
|
42
42
|
"./package.json": "./package.json"
|
|
43
43
|
},
|
|
44
|
-
"main": "./
|
|
45
|
-
"module": "
|
|
46
|
-
"types": "
|
|
44
|
+
"main": "./server/dist/export.cjs",
|
|
45
|
+
"module": "./server/dist/export.mjs",
|
|
46
|
+
"types": "./server/dist/export.d.ts",
|
|
47
47
|
"typesVersions": {
|
|
48
48
|
"*": {
|
|
49
49
|
"package.json": [
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"./package.json"
|
|
62
62
|
],
|
|
63
63
|
"dependencies": {
|
|
64
|
+
"@types/node": "^22.13.10",
|
|
64
65
|
"compression": "^1.8.0",
|
|
65
66
|
"cookie-parser": "^1.4.7",
|
|
66
67
|
"cors": "^2.8.5",
|
|
@@ -73,14 +74,14 @@
|
|
|
73
74
|
"react-dom": "^19.0.0",
|
|
74
75
|
"react-router-dom": "^7.4.0",
|
|
75
76
|
"rimraf": "^6.0.1",
|
|
76
|
-
"@intlayer/
|
|
77
|
-
"@intlayer/
|
|
78
|
-
"@intlayer/
|
|
79
|
-
"@intlayer/
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
77
|
+
"@intlayer/api": "5.5.4",
|
|
78
|
+
"@intlayer/core": "5.5.4",
|
|
79
|
+
"@intlayer/config": "5.5.4",
|
|
80
|
+
"@intlayer/editor-react": "5.5.4",
|
|
81
|
+
"express-intlayer": "5.5.4",
|
|
82
|
+
"react-intlayer": "5.5.4",
|
|
83
|
+
"@intlayer/design-system": "5.5.4",
|
|
84
|
+
"vite-intlayer": "5.5.4"
|
|
84
85
|
},
|
|
85
86
|
"devDependencies": {
|
|
86
87
|
"@tailwindcss/vite": "^4.0.14",
|
|
@@ -95,13 +96,14 @@
|
|
|
95
96
|
"eslint-plugin-react-refresh": "^0.4.19",
|
|
96
97
|
"globals": "^15.15.0",
|
|
97
98
|
"tailwindcss": "^4.0.14",
|
|
99
|
+
"tsc-alias": "^1.8.11",
|
|
98
100
|
"tsup": "^8.4.0",
|
|
99
101
|
"tsx": "^4.19.3",
|
|
100
102
|
"typescript": "~5.8.2",
|
|
101
103
|
"typescript-eslint": "^8.27.0",
|
|
102
104
|
"vite": "^6.3.1",
|
|
103
105
|
"vitest": "^3.0.9",
|
|
104
|
-
"@intlayer/backend": "5.5.
|
|
106
|
+
"@intlayer/backend": "5.5.4"
|
|
105
107
|
},
|
|
106
108
|
"peerDependencies": {
|
|
107
109
|
"@types/compression": "^1.7.5",
|
|
@@ -112,15 +114,15 @@
|
|
|
112
114
|
"react-dom": ">=16.0.0",
|
|
113
115
|
"react-router-dom": ">=6.0.0",
|
|
114
116
|
"tailwind-merge": "^3.0.2",
|
|
115
|
-
"@intlayer/
|
|
116
|
-
"@intlayer/
|
|
117
|
-
"@intlayer/design-system": "5.5.
|
|
118
|
-
"@intlayer/editor-react": "5.5.
|
|
119
|
-
"intlayer": "5.5.
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"@intlayer/chokidar": "5.5.
|
|
123
|
-
"
|
|
117
|
+
"@intlayer/config": "5.5.4",
|
|
118
|
+
"@intlayer/core": "5.5.4",
|
|
119
|
+
"@intlayer/design-system": "5.5.4",
|
|
120
|
+
"@intlayer/editor-react": "5.5.4",
|
|
121
|
+
"react-intlayer": "5.5.4",
|
|
122
|
+
"vite-intlayer": "5.5.4",
|
|
123
|
+
"@intlayer/dictionaries-entry": "5.5.4",
|
|
124
|
+
"@intlayer/chokidar": "5.5.4",
|
|
125
|
+
"intlayer": "5.5.4"
|
|
124
126
|
},
|
|
125
127
|
"engines": {
|
|
126
128
|
"node": ">=14.18"
|
|
@@ -131,7 +133,8 @@
|
|
|
131
133
|
"scripts": {
|
|
132
134
|
"build": "pnpm build:client && pnpm build:server",
|
|
133
135
|
"build:client": "vite build --config ./client/vite.config.ts",
|
|
134
|
-
"build:server": "tsup 'server/src/**/*.ts' --
|
|
136
|
+
"build:server": "tsup 'server/src/**/*.ts' --config ./server/tsup.config.ts --tsconfig ./server/tsconfig.json && pnpm build:types",
|
|
137
|
+
"build:types": "tsc --project ./server/tsconfig.types.json && tsc-alias --project ./server/tsconfig.types.json",
|
|
135
138
|
"clean": "pnpm clean:client && pnpm clean:server",
|
|
136
139
|
"clean:client": "rimraf ./client/dist",
|
|
137
140
|
"clean:server": "rimraf ./server/dist",
|
|
@@ -143,8 +146,8 @@
|
|
|
143
146
|
"reset": "pnpm reset:client && pnpm reset:server",
|
|
144
147
|
"reset:client": "pnpm clean:client && pnpm build:client",
|
|
145
148
|
"reset:server": "pnpm clean:server && pnpm build:server",
|
|
146
|
-
"start": "node server/dist/index.mjs",
|
|
149
|
+
"start": "node server/dist/esm/index.mjs",
|
|
147
150
|
"start:client": "vite preview --config ./client/vite.config.ts",
|
|
148
|
-
"start:server": "node --watch ./server/dist/index.mjs"
|
|
151
|
+
"start:server": "node --watch ./server/dist/esm/index.mjs"
|
|
149
152
|
}
|
|
150
153
|
}
|
|
@@ -32,7 +32,10 @@ const getConfiguration = async (req, res, _next) => {
|
|
|
32
32
|
res.json(formattedResponse);
|
|
33
33
|
return;
|
|
34
34
|
} catch (err) {
|
|
35
|
-
const errorMessage = err ??
|
|
35
|
+
const errorMessage = err ?? {
|
|
36
|
+
message: "Internal Server Error",
|
|
37
|
+
status: 500
|
|
38
|
+
};
|
|
36
39
|
const formattedErrorResponse = (0, import_responseData.formatResponse)({
|
|
37
40
|
error: {
|
|
38
41
|
message: errorMessage.message ?? "Internal Server Error",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/controllers/configuration.controller.ts"],"sourcesContent":["import {\n type IntlayerConfig,\n getConfiguration as getApplicationConfiguration,\n} from '@intlayer/config';\nimport { type ResponseData, formatResponse } from '@utils/responseData';\nimport type { NextFunction, Request, Response } from 'express';\n\nexport type GetConfigurationResult = ResponseData<IntlayerConfig>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getConfiguration = async (\n req: Request,\n res: Response<GetConfigurationResult>,\n _next: NextFunction\n): Promise<void> => {\n try {\n const config = getApplicationConfiguration();\n\n const formattedResponse = formatResponse<IntlayerConfig>({\n data: config,\n });\n\n res.json(formattedResponse);\n return;\n } catch (err) {\n const errorMessage
|
|
1
|
+
{"version":3,"sources":["../../src/controllers/configuration.controller.ts"],"sourcesContent":["import {\n type IntlayerConfig,\n getConfiguration as getApplicationConfiguration,\n} from '@intlayer/config';\nimport { type ResponseData, formatResponse } from '@utils/responseData';\nimport type { NextFunction, Request, Response } from 'express';\n\nexport type GetConfigurationResult = ResponseData<IntlayerConfig>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getConfiguration = async (\n req: Request,\n res: Response<GetConfigurationResult>,\n _next: NextFunction\n): Promise<void> => {\n try {\n const config = getApplicationConfiguration();\n\n const formattedResponse = formatResponse<IntlayerConfig>({\n data: config,\n });\n\n res.json(formattedResponse);\n return;\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n const formattedErrorResponse = formatResponse<IntlayerConfig>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n res.json(formattedErrorResponse);\n return;\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAGO;AACP,0BAAkD;AAQ3C,MAAM,mBAAmB,OAC9B,KACA,KACA,UACkB;AAClB,MAAI;AACF,UAAM,aAAS,cAAAA,kBAA4B;AAE3C,UAAM,wBAAoB,oCAA+B;AAAA,MACvD,MAAM;AAAA,IACR,CAAC;AAED,QAAI,KAAK,iBAAiB;AAC1B;AAAA,EACF,SAAS,KAAK;AACZ,UAAM,eAAgB,OAAiD;AAAA,MACrE,SAAS;AAAA,MACT,QAAQ;AAAA,IACV;AAEA,UAAM,6BAAyB,oCAA+B;AAAA,MAC5D,OAAO;AAAA,QACL,SAAS,aAAa,WAAW;AAAA,QACjC,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,QAAQ,aAAa,UAAU;AAAA,IACjC,CAAC;AAED,QAAI,KAAK,sBAAsB;AAC/B;AAAA,EACF;AACF;","names":["getApplicationConfiguration"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type IntlayerConfig } from '@intlayer/config';
|
|
2
|
+
import { type ResponseData } from '../utils/responseData';
|
|
3
|
+
import type { NextFunction, Request, Response } from 'express';
|
|
4
|
+
export type GetConfigurationResult = ResponseData<IntlayerConfig>;
|
|
5
|
+
/**
|
|
6
|
+
* Get the Intlayer configuration
|
|
7
|
+
*/
|
|
8
|
+
export declare const getConfiguration: (req: Request, res: Response<GetConfigurationResult>, _next: NextFunction) => Promise<void>;
|
|
9
|
+
//# sourceMappingURL=configuration.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/configuration.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE/D,MAAM,MAAM,sBAAsB,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,KAAK,OAAO,EACZ,KAAK,QAAQ,CAAC,sBAAsB,CAAC,EACrC,OAAO,YAAY,KAClB,OAAO,CAAC,IAAI,CA4Bd,CAAC"}
|
|
@@ -11,7 +11,10 @@ const getConfiguration = async (req, res, _next) => {
|
|
|
11
11
|
res.json(formattedResponse);
|
|
12
12
|
return;
|
|
13
13
|
} catch (err) {
|
|
14
|
-
const errorMessage = err ??
|
|
14
|
+
const errorMessage = err ?? {
|
|
15
|
+
message: "Internal Server Error",
|
|
16
|
+
status: 500
|
|
17
|
+
};
|
|
15
18
|
const formattedErrorResponse = formatResponse({
|
|
16
19
|
error: {
|
|
17
20
|
message: errorMessage.message ?? "Internal Server Error",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/controllers/configuration.controller.ts"],"sourcesContent":["import {\n type IntlayerConfig,\n getConfiguration as getApplicationConfiguration,\n} from '@intlayer/config';\nimport { type ResponseData, formatResponse } from '@utils/responseData';\nimport type { NextFunction, Request, Response } from 'express';\n\nexport type GetConfigurationResult = ResponseData<IntlayerConfig>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getConfiguration = async (\n req: Request,\n res: Response<GetConfigurationResult>,\n _next: NextFunction\n): Promise<void> => {\n try {\n const config = getApplicationConfiguration();\n\n const formattedResponse = formatResponse<IntlayerConfig>({\n data: config,\n });\n\n res.json(formattedResponse);\n return;\n } catch (err) {\n const errorMessage
|
|
1
|
+
{"version":3,"sources":["../../src/controllers/configuration.controller.ts"],"sourcesContent":["import {\n type IntlayerConfig,\n getConfiguration as getApplicationConfiguration,\n} from '@intlayer/config';\nimport { type ResponseData, formatResponse } from '@utils/responseData';\nimport type { NextFunction, Request, Response } from 'express';\n\nexport type GetConfigurationResult = ResponseData<IntlayerConfig>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getConfiguration = async (\n req: Request,\n res: Response<GetConfigurationResult>,\n _next: NextFunction\n): Promise<void> => {\n try {\n const config = getApplicationConfiguration();\n\n const formattedResponse = formatResponse<IntlayerConfig>({\n data: config,\n });\n\n res.json(formattedResponse);\n return;\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n const formattedErrorResponse = formatResponse<IntlayerConfig>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n res.json(formattedErrorResponse);\n return;\n }\n};\n"],"mappings":"AAAA;AAAA,EAEE,oBAAoB;AAAA,OACf;AACP,SAA4B,sBAAsB;AAQ3C,MAAM,mBAAmB,OAC9B,KACA,KACA,UACkB;AAClB,MAAI;AACF,UAAM,SAAS,4BAA4B;AAE3C,UAAM,oBAAoB,eAA+B;AAAA,MACvD,MAAM;AAAA,IACR,CAAC;AAED,QAAI,KAAK,iBAAiB;AAC1B;AAAA,EACF,SAAS,KAAK;AACZ,UAAM,eAAgB,OAAiD;AAAA,MACrE,SAAS;AAAA,MACT,QAAQ;AAAA,IACV;AAEA,UAAM,yBAAyB,eAA+B;AAAA,MAC5D,OAAO;AAAA,QACL,SAAS,aAAa,WAAW;AAAA,QACjC,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,QAAQ,aAAa,UAAU;AAAA,IACjC,CAAC;AAED,QAAI,KAAK,sBAAsB;AAC/B;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,16 +17,50 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
var dictionary_controller_exports = {};
|
|
20
30
|
__export(dictionary_controller_exports, {
|
|
31
|
+
getDictionaries: () => getDictionaries,
|
|
21
32
|
writeContentDeclaration: () => writeContentDeclaration
|
|
22
33
|
});
|
|
23
34
|
module.exports = __toCommonJS(dictionary_controller_exports);
|
|
35
|
+
var import_chokidar = require("@intlayer/chokidar");
|
|
24
36
|
var import_config = require("@intlayer/config");
|
|
37
|
+
var import_dictionaries_entry = __toESM(require("@intlayer/dictionaries-entry"), 1);
|
|
25
38
|
var import_responseData = require('./../utils/responseData.cjs');
|
|
26
|
-
var import_chokidar = require("@intlayer/chokidar");
|
|
27
39
|
var import_express_intlayer = require("express-intlayer");
|
|
40
|
+
const getDictionaries = async (req, res, _next) => {
|
|
41
|
+
try {
|
|
42
|
+
const formattedResponse = (0, import_responseData.formatResponse)({
|
|
43
|
+
data: import_dictionaries_entry.default
|
|
44
|
+
});
|
|
45
|
+
res.json(formattedResponse);
|
|
46
|
+
return;
|
|
47
|
+
} catch (err) {
|
|
48
|
+
const errorMessage = err ?? {
|
|
49
|
+
message: "Internal Server Error",
|
|
50
|
+
status: 500
|
|
51
|
+
};
|
|
52
|
+
const formattedErrorResponse = (0, import_responseData.formatResponse)({
|
|
53
|
+
error: {
|
|
54
|
+
message: errorMessage.message ?? "Internal Server Error",
|
|
55
|
+
code: "INTERNAL_SERVER_ERROR",
|
|
56
|
+
title: "Internal Server Error"
|
|
57
|
+
},
|
|
58
|
+
status: errorMessage.status ?? 500
|
|
59
|
+
});
|
|
60
|
+
res.json(formattedErrorResponse);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
28
64
|
const writeContentDeclaration = async (req, res, _next) => {
|
|
29
65
|
try {
|
|
30
66
|
const dictionaryData = req.body.dictionary;
|
|
@@ -83,7 +119,10 @@ const writeContentDeclaration = async (req, res, _next) => {
|
|
|
83
119
|
res.json(formattedResponse);
|
|
84
120
|
return;
|
|
85
121
|
} catch (err) {
|
|
86
|
-
const errorMessage = err ??
|
|
122
|
+
const errorMessage = err ?? {
|
|
123
|
+
message: "Internal Server Error",
|
|
124
|
+
status: 500
|
|
125
|
+
};
|
|
87
126
|
console.error(errorMessage);
|
|
88
127
|
const formattedErrorResponse = (0, import_responseData.formatResponse)({
|
|
89
128
|
error: {
|
|
@@ -99,6 +138,7 @@ const writeContentDeclaration = async (req, res, _next) => {
|
|
|
99
138
|
};
|
|
100
139
|
// Annotate the CommonJS export names for ESM import in node:
|
|
101
140
|
0 && (module.exports = {
|
|
141
|
+
getDictionaries,
|
|
102
142
|
writeContentDeclaration
|
|
103
143
|
});
|
|
104
144
|
//# sourceMappingURL=dictionary.controller.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/controllers/dictionary.controller.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/controllers/dictionary.controller.ts"],"sourcesContent":["import {\n writeContentDeclaration as writeContentDeclarationEditor,\n type DictionaryStatus,\n} from '@intlayer/chokidar';\nimport { getConfiguration } from '@intlayer/config';\nimport { type Dictionary } from '@intlayer/core';\nimport dictionaries from '@intlayer/dictionaries-entry';\nimport { formatResponse, type ResponseData } from '@utils/responseData';\nimport type { NextFunction, Request, Response } from 'express';\nimport { t } from 'express-intlayer';\n\ntype GetDictionariesResult = ResponseData<Record<string, Dictionary>>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getDictionaries = async (\n req: Request,\n res: Response<GetDictionariesResult>,\n _next: NextFunction\n): Promise<void> => {\n try {\n const formattedResponse = formatResponse<Record<string, Dictionary>>({\n data: dictionaries,\n });\n\n res.json(formattedResponse);\n return;\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n const formattedErrorResponse = formatResponse<Record<string, Dictionary>>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n res.json(formattedErrorResponse);\n return;\n }\n};\n\nexport type WriteContentDeclarationBody = { dictionary: Dictionary };\ntype WriteContentDeclarationResultData = {\n status: DictionaryStatus;\n path: string;\n};\nexport type WriteContentDeclarationResult =\n ResponseData<WriteContentDeclarationResultData>;\n\n/**\n * Adds a new dictionary to the database.\n */\nexport const writeContentDeclaration = async (\n req: Request<any, any, WriteContentDeclarationBody>,\n res: Response<WriteContentDeclarationResult>,\n _next: NextFunction\n): Promise<void> => {\n try {\n const dictionaryData = req.body.dictionary;\n\n const config = getConfiguration();\n\n const result = await writeContentDeclarationEditor(dictionaryData, config);\n\n let description = '';\n\n switch (result.status) {\n case 'updated': {\n description = t({\n en: 'Content declaration updated successfully',\n fr: 'Déclaration de contenu mise à jour avec succès',\n es: 'Declaración de contenido actualizada con éxito',\n });\n break;\n }\n case 'reimported in JSON': {\n description = t({\n en: 'Content declaration reimported in JSON successfully',\n fr: 'Déclaration de contenu réimportée en JSON avec succès',\n es: 'Declaración de contenido reimportada en JSON con éxito',\n });\n break;\n }\n case 'reimported in new location': {\n description = t({\n en: 'Content declaration reimported in new location successfully',\n fr: 'Déclaration de contenu réimportée dans un nouveau emplacement avec succès',\n es: 'Declaración de contenido reimportada en un nuevo lugar con éxito',\n });\n break;\n }\n default: {\n description = t({\n en: 'Content declaration written successfully',\n fr: 'Déclaration de contenu écrite avec succès',\n es: 'Declaración de contenido escrita con éxito',\n });\n break;\n }\n }\n\n const formattedResponse = formatResponse<WriteContentDeclarationResultData>(\n {\n data: result,\n message: t({\n en: 'Content declaration written',\n fr: 'Déclaration de contenu écrite',\n es: 'Declaración de contenido escrita',\n }),\n description: t({\n en: 'Content declaration written successfully',\n fr: 'Déclaration de contenu écrite avec succès',\n es: 'Declaración de contenido escrita con éxito',\n }),\n }\n );\n\n res.json(formattedResponse);\n return;\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n console.error(errorMessage);\n\n const formattedErrorResponse =\n formatResponse<WriteContentDeclarationResultData>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n res.json(formattedErrorResponse);\n return;\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAGO;AACP,oBAAiC;AAEjC,gCAAyB;AACzB,0BAAkD;AAElD,8BAAkB;AAOX,MAAM,kBAAkB,OAC7B,KACA,KACA,UACkB;AAClB,MAAI;AACF,UAAM,wBAAoB,oCAA2C;AAAA,MACnE,MAAM,0BAAAA;AAAA,IACR,CAAC;AAED,QAAI,KAAK,iBAAiB;AAC1B;AAAA,EACF,SAAS,KAAK;AACZ,UAAM,eAAgB,OAAiD;AAAA,MACrE,SAAS;AAAA,MACT,QAAQ;AAAA,IACV;AAEA,UAAM,6BAAyB,oCAA2C;AAAA,MACxE,OAAO;AAAA,QACL,SAAS,aAAa,WAAW;AAAA,QACjC,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,QAAQ,aAAa,UAAU;AAAA,IACjC,CAAC;AAED,QAAI,KAAK,sBAAsB;AAC/B;AAAA,EACF;AACF;AAaO,MAAM,0BAA0B,OACrC,KACA,KACA,UACkB;AAClB,MAAI;AACF,UAAM,iBAAiB,IAAI,KAAK;AAEhC,UAAM,aAAS,gCAAiB;AAEhC,UAAM,SAAS,UAAM,gBAAAC,yBAA8B,gBAAgB,MAAM;AAEzE,QAAI,cAAc;AAElB,YAAQ,OAAO,QAAQ;AAAA,MACrB,KAAK,WAAW;AACd,0BAAc,2BAAE;AAAA,UACd,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QACN,CAAC;AACD;AAAA,MACF;AAAA,MACA,KAAK,sBAAsB;AACzB,0BAAc,2BAAE;AAAA,UACd,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QACN,CAAC;AACD;AAAA,MACF;AAAA,MACA,KAAK,8BAA8B;AACjC,0BAAc,2BAAE;AAAA,UACd,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QACN,CAAC;AACD;AAAA,MACF;AAAA,MACA,SAAS;AACP,0BAAc,2BAAE;AAAA,UACd,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QACN,CAAC;AACD;AAAA,MACF;AAAA,IACF;AAEA,UAAM,wBAAoB;AAAA,MACxB;AAAA,QACE,MAAM;AAAA,QACN,aAAS,2BAAE;AAAA,UACT,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QACN,CAAC;AAAA,QACD,iBAAa,2BAAE;AAAA,UACb,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QACN,CAAC;AAAA,MACH;AAAA,IACF;AAEA,QAAI,KAAK,iBAAiB;AAC1B;AAAA,EACF,SAAS,KAAK;AACZ,UAAM,eAAgB,OAAiD;AAAA,MACrE,SAAS;AAAA,MACT,QAAQ;AAAA,IACV;AAEA,YAAQ,MAAM,YAAY;AAE1B,UAAM,6BACJ,oCAAkD;AAAA,MAChD,OAAO;AAAA,QACL,SAAS,aAAa,WAAW;AAAA,QACjC,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,QAAQ,aAAa,UAAU;AAAA,IACjC,CAAC;AAEH,QAAI,KAAK,sBAAsB;AAC/B;AAAA,EACF;AACF;","names":["dictionaries","writeContentDeclarationEditor"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type DictionaryStatus } from '@intlayer/chokidar';
|
|
2
|
+
import { type Dictionary } from '@intlayer/core';
|
|
3
|
+
import { type ResponseData } from '../utils/responseData';
|
|
4
|
+
import type { NextFunction, Request, Response } from 'express';
|
|
5
|
+
type GetDictionariesResult = ResponseData<Record<string, Dictionary>>;
|
|
6
|
+
/**
|
|
7
|
+
* Get the Intlayer configuration
|
|
8
|
+
*/
|
|
9
|
+
export declare const getDictionaries: (req: Request, res: Response<GetDictionariesResult>, _next: NextFunction) => Promise<void>;
|
|
10
|
+
export type WriteContentDeclarationBody = {
|
|
11
|
+
dictionary: Dictionary;
|
|
12
|
+
};
|
|
13
|
+
type WriteContentDeclarationResultData = {
|
|
14
|
+
status: DictionaryStatus;
|
|
15
|
+
path: string;
|
|
16
|
+
};
|
|
17
|
+
export type WriteContentDeclarationResult = ResponseData<WriteContentDeclarationResultData>;
|
|
18
|
+
/**
|
|
19
|
+
* Adds a new dictionary to the database.
|
|
20
|
+
*/
|
|
21
|
+
export declare const writeContentDeclaration: (req: Request<any, any, WriteContentDeclarationBody>, res: Response<WriteContentDeclarationResult>, _next: NextFunction) => Promise<void>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=dictionary.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dictionary.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/dictionary.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAG/D,KAAK,qBAAqB,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,eAAe,GAC1B,KAAK,OAAO,EACZ,KAAK,QAAQ,CAAC,qBAAqB,CAAC,EACpC,OAAO,YAAY,KAClB,OAAO,CAAC,IAAI,CA0Bd,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IAAE,UAAU,EAAE,UAAU,CAAA;CAAE,CAAC;AACrE,KAAK,iCAAiC,GAAG;IACvC,MAAM,EAAE,gBAAgB,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AACF,MAAM,MAAM,6BAA6B,GACvC,YAAY,CAAC,iCAAiC,CAAC,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAClC,KAAK,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,2BAA2B,CAAC,EACnD,KAAK,QAAQ,CAAC,6BAA6B,CAAC,EAC5C,OAAO,YAAY,KAClB,OAAO,CAAC,IAAI,CAoFd,CAAC"}
|
|
@@ -1,9 +1,34 @@
|
|
|
1
|
-
import { getConfiguration } from "@intlayer/config";
|
|
2
|
-
import { formatResponse } from "./../utils/responseData.mjs";
|
|
3
1
|
import {
|
|
4
2
|
writeContentDeclaration as writeContentDeclarationEditor
|
|
5
3
|
} from "@intlayer/chokidar";
|
|
4
|
+
import { getConfiguration } from "@intlayer/config";
|
|
5
|
+
import dictionaries from "@intlayer/dictionaries-entry";
|
|
6
|
+
import { formatResponse } from "./../utils/responseData.mjs";
|
|
6
7
|
import { t } from "express-intlayer";
|
|
8
|
+
const getDictionaries = async (req, res, _next) => {
|
|
9
|
+
try {
|
|
10
|
+
const formattedResponse = formatResponse({
|
|
11
|
+
data: dictionaries
|
|
12
|
+
});
|
|
13
|
+
res.json(formattedResponse);
|
|
14
|
+
return;
|
|
15
|
+
} catch (err) {
|
|
16
|
+
const errorMessage = err ?? {
|
|
17
|
+
message: "Internal Server Error",
|
|
18
|
+
status: 500
|
|
19
|
+
};
|
|
20
|
+
const formattedErrorResponse = formatResponse({
|
|
21
|
+
error: {
|
|
22
|
+
message: errorMessage.message ?? "Internal Server Error",
|
|
23
|
+
code: "INTERNAL_SERVER_ERROR",
|
|
24
|
+
title: "Internal Server Error"
|
|
25
|
+
},
|
|
26
|
+
status: errorMessage.status ?? 500
|
|
27
|
+
});
|
|
28
|
+
res.json(formattedErrorResponse);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
7
32
|
const writeContentDeclaration = async (req, res, _next) => {
|
|
8
33
|
try {
|
|
9
34
|
const dictionaryData = req.body.dictionary;
|
|
@@ -62,7 +87,10 @@ const writeContentDeclaration = async (req, res, _next) => {
|
|
|
62
87
|
res.json(formattedResponse);
|
|
63
88
|
return;
|
|
64
89
|
} catch (err) {
|
|
65
|
-
const errorMessage = err ??
|
|
90
|
+
const errorMessage = err ?? {
|
|
91
|
+
message: "Internal Server Error",
|
|
92
|
+
status: 500
|
|
93
|
+
};
|
|
66
94
|
console.error(errorMessage);
|
|
67
95
|
const formattedErrorResponse = formatResponse({
|
|
68
96
|
error: {
|
|
@@ -77,6 +105,7 @@ const writeContentDeclaration = async (req, res, _next) => {
|
|
|
77
105
|
}
|
|
78
106
|
};
|
|
79
107
|
export {
|
|
108
|
+
getDictionaries,
|
|
80
109
|
writeContentDeclaration
|
|
81
110
|
};
|
|
82
111
|
//# sourceMappingURL=dictionary.controller.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/controllers/dictionary.controller.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/controllers/dictionary.controller.ts"],"sourcesContent":["import {\n writeContentDeclaration as writeContentDeclarationEditor,\n type DictionaryStatus,\n} from '@intlayer/chokidar';\nimport { getConfiguration } from '@intlayer/config';\nimport { type Dictionary } from '@intlayer/core';\nimport dictionaries from '@intlayer/dictionaries-entry';\nimport { formatResponse, type ResponseData } from '@utils/responseData';\nimport type { NextFunction, Request, Response } from 'express';\nimport { t } from 'express-intlayer';\n\ntype GetDictionariesResult = ResponseData<Record<string, Dictionary>>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getDictionaries = async (\n req: Request,\n res: Response<GetDictionariesResult>,\n _next: NextFunction\n): Promise<void> => {\n try {\n const formattedResponse = formatResponse<Record<string, Dictionary>>({\n data: dictionaries,\n });\n\n res.json(formattedResponse);\n return;\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n const formattedErrorResponse = formatResponse<Record<string, Dictionary>>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n res.json(formattedErrorResponse);\n return;\n }\n};\n\nexport type WriteContentDeclarationBody = { dictionary: Dictionary };\ntype WriteContentDeclarationResultData = {\n status: DictionaryStatus;\n path: string;\n};\nexport type WriteContentDeclarationResult =\n ResponseData<WriteContentDeclarationResultData>;\n\n/**\n * Adds a new dictionary to the database.\n */\nexport const writeContentDeclaration = async (\n req: Request<any, any, WriteContentDeclarationBody>,\n res: Response<WriteContentDeclarationResult>,\n _next: NextFunction\n): Promise<void> => {\n try {\n const dictionaryData = req.body.dictionary;\n\n const config = getConfiguration();\n\n const result = await writeContentDeclarationEditor(dictionaryData, config);\n\n let description = '';\n\n switch (result.status) {\n case 'updated': {\n description = t({\n en: 'Content declaration updated successfully',\n fr: 'Déclaration de contenu mise à jour avec succès',\n es: 'Declaración de contenido actualizada con éxito',\n });\n break;\n }\n case 'reimported in JSON': {\n description = t({\n en: 'Content declaration reimported in JSON successfully',\n fr: 'Déclaration de contenu réimportée en JSON avec succès',\n es: 'Declaración de contenido reimportada en JSON con éxito',\n });\n break;\n }\n case 'reimported in new location': {\n description = t({\n en: 'Content declaration reimported in new location successfully',\n fr: 'Déclaration de contenu réimportée dans un nouveau emplacement avec succès',\n es: 'Declaración de contenido reimportada en un nuevo lugar con éxito',\n });\n break;\n }\n default: {\n description = t({\n en: 'Content declaration written successfully',\n fr: 'Déclaration de contenu écrite avec succès',\n es: 'Declaración de contenido escrita con éxito',\n });\n break;\n }\n }\n\n const formattedResponse = formatResponse<WriteContentDeclarationResultData>(\n {\n data: result,\n message: t({\n en: 'Content declaration written',\n fr: 'Déclaration de contenu écrite',\n es: 'Declaración de contenido escrita',\n }),\n description: t({\n en: 'Content declaration written successfully',\n fr: 'Déclaration de contenu écrite avec succès',\n es: 'Declaración de contenido escrita con éxito',\n }),\n }\n );\n\n res.json(formattedResponse);\n return;\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n console.error(errorMessage);\n\n const formattedErrorResponse =\n formatResponse<WriteContentDeclarationResultData>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n res.json(formattedErrorResponse);\n return;\n }\n};\n"],"mappings":"AAAA;AAAA,EACE,2BAA2B;AAAA,OAEtB;AACP,SAAS,wBAAwB;AAEjC,OAAO,kBAAkB;AACzB,SAAS,sBAAyC;AAElD,SAAS,SAAS;AAOX,MAAM,kBAAkB,OAC7B,KACA,KACA,UACkB;AAClB,MAAI;AACF,UAAM,oBAAoB,eAA2C;AAAA,MACnE,MAAM;AAAA,IACR,CAAC;AAED,QAAI,KAAK,iBAAiB;AAC1B;AAAA,EACF,SAAS,KAAK;AACZ,UAAM,eAAgB,OAAiD;AAAA,MACrE,SAAS;AAAA,MACT,QAAQ;AAAA,IACV;AAEA,UAAM,yBAAyB,eAA2C;AAAA,MACxE,OAAO;AAAA,QACL,SAAS,aAAa,WAAW;AAAA,QACjC,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,QAAQ,aAAa,UAAU;AAAA,IACjC,CAAC;AAED,QAAI,KAAK,sBAAsB;AAC/B;AAAA,EACF;AACF;AAaO,MAAM,0BAA0B,OACrC,KACA,KACA,UACkB;AAClB,MAAI;AACF,UAAM,iBAAiB,IAAI,KAAK;AAEhC,UAAM,SAAS,iBAAiB;AAEhC,UAAM,SAAS,MAAM,8BAA8B,gBAAgB,MAAM;AAEzE,QAAI,cAAc;AAElB,YAAQ,OAAO,QAAQ;AAAA,MACrB,KAAK,WAAW;AACd,sBAAc,EAAE;AAAA,UACd,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QACN,CAAC;AACD;AAAA,MACF;AAAA,MACA,KAAK,sBAAsB;AACzB,sBAAc,EAAE;AAAA,UACd,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QACN,CAAC;AACD;AAAA,MACF;AAAA,MACA,KAAK,8BAA8B;AACjC,sBAAc,EAAE;AAAA,UACd,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QACN,CAAC;AACD;AAAA,MACF;AAAA,MACA,SAAS;AACP,sBAAc,EAAE;AAAA,UACd,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QACN,CAAC;AACD;AAAA,MACF;AAAA,IACF;AAEA,UAAM,oBAAoB;AAAA,MACxB;AAAA,QACE,MAAM;AAAA,QACN,SAAS,EAAE;AAAA,UACT,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QACN,CAAC;AAAA,QACD,aAAa,EAAE;AAAA,UACb,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QACN,CAAC;AAAA,MACH;AAAA,IACF;AAEA,QAAI,KAAK,iBAAiB;AAC1B;AAAA,EACF,SAAS,KAAK;AACZ,UAAM,eAAgB,OAAiD;AAAA,MACrE,SAAS;AAAA,MACT,QAAQ;AAAA,IACV;AAEA,YAAQ,MAAM,YAAY;AAE1B,UAAM,yBACJ,eAAkD;AAAA,MAChD,OAAO;AAAA,QACL,SAAS,aAAa,WAAW;AAAA,QACjC,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,QAAQ,aAAa,UAAU;AAAA,IACjC,CAAC;AAEH,QAAI,KAAK,sBAAsB;AAC/B;AAAA,EACF;AACF;","names":[]}
|
package/server/dist/export.cjs
CHANGED
|
@@ -15,9 +15,11 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
|
|
|
15
15
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
16
|
var export_exports = {};
|
|
17
17
|
module.exports = __toCommonJS(export_exports);
|
|
18
|
+
__reExport(export_exports, require('./controllers/configuration.controller.cjs'), module.exports);
|
|
18
19
|
__reExport(export_exports, require('./controllers/dictionary.controller.cjs'), module.exports);
|
|
19
20
|
// Annotate the CommonJS export names for ESM import in node:
|
|
20
21
|
0 && (module.exports = {
|
|
22
|
+
...require('./controllers/configuration.controller.cjs'),
|
|
21
23
|
...require('./controllers/dictionary.controller.cjs')
|
|
22
24
|
});
|
|
23
25
|
//# sourceMappingURL=export.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/export.ts"],"sourcesContent":["export * from './controllers/dictionary.controller';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,2BAAc,
|
|
1
|
+
{"version":3,"sources":["../src/export.ts"],"sourcesContent":["export * from './controllers/configuration.controller';\nexport * from './controllers/dictionary.controller';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,2BAAc,mDAAd;AACA,2BAAc,gDADd;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../src/export.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC;AACvD,cAAc,qCAAqC,CAAC"}
|
package/server/dist/export.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/export.ts"],"sourcesContent":["export * from './controllers/dictionary.controller';\n"],"mappings":"AAAA,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/export.ts"],"sourcesContent":["export * from './controllers/configuration.controller';\nexport * from './controllers/dictionary.controller';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Router } from 'express';
|
|
2
|
+
export declare const configurationRouter: Router;
|
|
3
|
+
export declare const getConfigurationRoutes: () => {
|
|
4
|
+
getConfiguration: {
|
|
5
|
+
urlModel: string;
|
|
6
|
+
url: string;
|
|
7
|
+
method: "GET";
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=config.routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.routes.d.ts","sourceRoot":"","sources":["../../src/routes/config.routes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGjC,eAAO,MAAM,mBAAmB,EAAE,MAAiB,CAAC;AAMpD,eAAO,MAAM,sBAAsB;;;;;;CAOd,CAAC"}
|
|
@@ -29,12 +29,21 @@ const dictionaryRouter = (0, import_express.Router)();
|
|
|
29
29
|
const { editor } = (0, import_config.getConfiguration)();
|
|
30
30
|
const getBaseURL = () => `${editor.editorURL}/api/dictionary`;
|
|
31
31
|
const getDictionaryRoutes = () => ({
|
|
32
|
+
getDictionaries: {
|
|
33
|
+
urlModel: "/",
|
|
34
|
+
url: getBaseURL(),
|
|
35
|
+
method: "GET"
|
|
36
|
+
},
|
|
32
37
|
writeContentDeclaration: {
|
|
33
38
|
urlModel: "/",
|
|
34
39
|
url: getBaseURL(),
|
|
35
40
|
method: "POST"
|
|
36
41
|
}
|
|
37
42
|
});
|
|
43
|
+
dictionaryRouter.get(
|
|
44
|
+
getDictionaryRoutes().getDictionaries.urlModel,
|
|
45
|
+
import_dictionary.getDictionaries
|
|
46
|
+
);
|
|
38
47
|
dictionaryRouter.post(
|
|
39
48
|
getDictionaryRoutes().writeContentDeclaration.urlModel,
|
|
40
49
|
import_dictionary.writeContentDeclaration
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/routes/dictionary.routes.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/routes/dictionary.routes.ts"],"sourcesContent":["import type { Routes } from '@/types/Routes';\nimport {\n getDictionaries,\n writeContentDeclaration,\n} from '@controllers/dictionary.controller';\nimport { getConfiguration } from '@intlayer/config';\nimport { Router } from 'express';\n\nexport const dictionaryRouter: Router = Router();\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getDictionaryRoutes = () =>\n ({\n getDictionaries: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n writeContentDeclaration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'POST',\n },\n }) satisfies Routes;\n\ndictionaryRouter.get(\n getDictionaryRoutes().getDictionaries.urlModel,\n getDictionaries\n);\ndictionaryRouter.post(\n getDictionaryRoutes().writeContentDeclaration.urlModel,\n writeContentDeclaration\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAGO;AACP,oBAAiC;AACjC,qBAAuB;AAEhB,MAAM,uBAA2B,uBAAO;AAE/C,MAAM,EAAE,OAAO,QAAI,gCAAiB;AAEpC,MAAM,aAAa,MAAM,GAAG,OAAO,SAAS;AAErC,MAAM,sBAAsB,OAChC;AAAA,EACC,iBAAiB;AAAA,IACf,UAAU;AAAA,IACV,KAAK,WAAW;AAAA,IAChB,QAAQ;AAAA,EACV;AAAA,EACA,yBAAyB;AAAA,IACvB,UAAU;AAAA,IACV,KAAK,WAAW;AAAA,IAChB,QAAQ;AAAA,EACV;AACF;AAEF,iBAAiB;AAAA,EACf,oBAAoB,EAAE,gBAAgB;AAAA,EACtC;AACF;AACA,iBAAiB;AAAA,EACf,oBAAoB,EAAE,wBAAwB;AAAA,EAC9C;AACF;","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Router } from 'express';
|
|
2
|
+
export declare const dictionaryRouter: Router;
|
|
3
|
+
export declare const getDictionaryRoutes: () => {
|
|
4
|
+
getDictionaries: {
|
|
5
|
+
urlModel: string;
|
|
6
|
+
url: string;
|
|
7
|
+
method: "GET";
|
|
8
|
+
};
|
|
9
|
+
writeContentDeclaration: {
|
|
10
|
+
urlModel: string;
|
|
11
|
+
url: string;
|
|
12
|
+
method: "POST";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=dictionary.routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dictionary.routes.d.ts","sourceRoot":"","sources":["../../src/routes/dictionary.routes.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,eAAO,MAAM,gBAAgB,EAAE,MAAiB,CAAC;AAMjD,eAAO,MAAM,mBAAmB;;;;;;;;;;;CAYX,CAAC"}
|
|
@@ -1,16 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
getDictionaries,
|
|
3
|
+
writeContentDeclaration
|
|
4
|
+
} from "./../controllers/dictionary.controller.mjs";
|
|
2
5
|
import { getConfiguration } from "@intlayer/config";
|
|
3
6
|
import { Router } from "express";
|
|
4
7
|
const dictionaryRouter = Router();
|
|
5
8
|
const { editor } = getConfiguration();
|
|
6
9
|
const getBaseURL = () => `${editor.editorURL}/api/dictionary`;
|
|
7
10
|
const getDictionaryRoutes = () => ({
|
|
11
|
+
getDictionaries: {
|
|
12
|
+
urlModel: "/",
|
|
13
|
+
url: getBaseURL(),
|
|
14
|
+
method: "GET"
|
|
15
|
+
},
|
|
8
16
|
writeContentDeclaration: {
|
|
9
17
|
urlModel: "/",
|
|
10
18
|
url: getBaseURL(),
|
|
11
19
|
method: "POST"
|
|
12
20
|
}
|
|
13
21
|
});
|
|
22
|
+
dictionaryRouter.get(
|
|
23
|
+
getDictionaryRoutes().getDictionaries.urlModel,
|
|
24
|
+
getDictionaries
|
|
25
|
+
);
|
|
14
26
|
dictionaryRouter.post(
|
|
15
27
|
getDictionaryRoutes().writeContentDeclaration.urlModel,
|
|
16
28
|
writeContentDeclaration
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/routes/dictionary.routes.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/routes/dictionary.routes.ts"],"sourcesContent":["import type { Routes } from '@/types/Routes';\nimport {\n getDictionaries,\n writeContentDeclaration,\n} from '@controllers/dictionary.controller';\nimport { getConfiguration } from '@intlayer/config';\nimport { Router } from 'express';\n\nexport const dictionaryRouter: Router = Router();\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getDictionaryRoutes = () =>\n ({\n getDictionaries: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n writeContentDeclaration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'POST',\n },\n }) satisfies Routes;\n\ndictionaryRouter.get(\n getDictionaryRoutes().getDictionaries.urlModel,\n getDictionaries\n);\ndictionaryRouter.post(\n getDictionaryRoutes().writeContentDeclaration.urlModel,\n writeContentDeclaration\n);\n"],"mappings":"AACA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,wBAAwB;AACjC,SAAS,cAAc;AAEhB,MAAM,mBAA2B,OAAO;AAE/C,MAAM,EAAE,OAAO,IAAI,iBAAiB;AAEpC,MAAM,aAAa,MAAM,GAAG,OAAO,SAAS;AAErC,MAAM,sBAAsB,OAChC;AAAA,EACC,iBAAiB;AAAA,IACf,UAAU;AAAA,IACV,KAAK,WAAW;AAAA,IAChB,QAAQ;AAAA,EACV;AAAA,EACA,yBAAyB;AAAA,IACvB,UAAU;AAAA,IACV,KAAK,WAAW;AAAA,IAChB,QAAQ;AAAA,EACV;AACF;AAEF,iBAAiB;AAAA,EACf,oBAAoB,EAAE,gBAAgB;AAAA,EACtC;AACF;AACA,iBAAiB;AAAA,EACf,oBAAoB,EAAE,wBAAwB;AAAA,EAC9C;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Routes.d.ts","sourceRoot":"","sources":["../../src/types/Routes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,EAAE,MAAM,CAAC;IAEjB,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,KAAK,MAAM,CAAC,CAAC;IACtC,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkPortAvailability.d.ts","sourceRoot":"","sources":["../../src/utils/checkPortAvailability.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,GAAI,MAAM,MAAM,KAAG,OAAO,CAAC,OAAO,CAmBnE,CAAC"}
|