intlayer-editor 9.7.0 → 9.7.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/bin/intlayer-editor.mjs +3 -1
- package/client/dist/assets/CodeBlockShiki-BaQlmvsF.js +2 -0
- package/client/dist/assets/MarkDownRender-CufSxUcK.js +25 -0
- package/client/dist/assets/MarkDownRender-HV9SKc56.js +1 -0
- package/client/dist/assets/MarkdownEditor-BSbSD-tQ.js +174 -0
- package/client/dist/assets/{codeTransformer-aP9a_qk2.js → codeTransformer-pmm6yJGh.js} +1 -1
- package/client/dist/assets/compat-BqYysBkt.js +1 -0
- package/client/dist/assets/css-DgaLhXQH.js +1 -0
- package/client/dist/assets/{dist-DRjLHkdX.js → dist-VBWB9uC8.js} +1 -1
- package/client/dist/assets/html-BCy9P6D2.js +1 -0
- package/client/dist/assets/index-65aMFXUF.css +2 -0
- package/client/dist/assets/index-MyctEsPU.js +116 -0
- package/client/dist/assets/javascript-CpIGwZ_Y.js +1 -0
- package/client/dist/assets/json-C3WlssX3.js +1 -0
- package/client/dist/assets/purify.es-Dqk5qvad.js +3 -0
- package/client/dist/assets/shikiBundle-DbyGgq42.js +12 -0
- package/client/dist/assets/tsx-CGosfAUg.js +1 -0
- package/client/dist/assets/typescript-Bb1J8qyy.js +1 -0
- package/client/dist/assets/{vue-BqdMUtqy.js → vue-jUI-lpPb.js} +1 -1
- package/client/dist/assets/wasm-inlined-4KdTHw0F.js +1 -0
- package/client/dist/index.html +3 -3
- package/package.json +35 -35
- package/server/dist/_virtual/_rolldown/runtime.cjs +1 -2
- package/server/dist/controllers/auth.controller.cjs +4 -5
- package/server/dist/controllers/auth.controller.d.ts +0 -2
- package/server/dist/controllers/auth.controller.mjs +1 -2
- package/server/dist/controllers/configuration.controller.cjs +6 -5
- package/server/dist/controllers/configuration.controller.cjs.map +1 -1
- package/server/dist/controllers/configuration.controller.d.ts +8 -3
- package/server/dist/controllers/configuration.controller.mjs +6 -5
- package/server/dist/controllers/configuration.controller.mjs.map +1 -1
- package/server/dist/controllers/dictionary.controller.cjs +2 -3
- package/server/dist/controllers/dictionary.controller.d.ts +1 -2
- package/server/dist/controllers/dictionary.controller.mjs +1 -2
- package/server/dist/export.cjs +2 -2
- package/server/dist/export.d.ts +2 -2
- package/server/dist/index.cjs +18 -9
- package/server/dist/index.cjs.map +1 -1
- package/server/dist/index.mjs +14 -5
- package/server/dist/index.mjs.map +1 -1
- package/server/dist/routes/auth.routes.cjs +2 -3
- package/server/dist/routes/auth.routes.d.ts +0 -2
- package/server/dist/routes/auth.routes.mjs +1 -2
- package/server/dist/routes/config.routes.cjs +2 -3
- package/server/dist/routes/config.routes.d.ts +0 -2
- package/server/dist/routes/config.routes.mjs +1 -2
- package/server/dist/routes/dictionary.routes.cjs +2 -3
- package/server/dist/routes/dictionary.routes.d.ts +0 -2
- package/server/dist/routes/dictionary.routes.mjs +1 -2
- package/server/dist/services/editorAuth.service.cjs +2 -3
- package/server/dist/services/editorAuth.service.d.ts +0 -2
- package/server/dist/services/editorAuth.service.mjs +1 -2
- package/server/dist/types/Routes.d.ts +0 -2
- package/server/dist/utils/checkPortAvailability.cjs +2 -3
- package/server/dist/utils/checkPortAvailability.d.ts +0 -2
- package/server/dist/utils/checkPortAvailability.mjs +1 -2
- package/server/dist/utils/httpStatusCodes.cjs +1 -2
- package/server/dist/utils/httpStatusCodes.d.ts +9 -20
- package/server/dist/utils/httpStatusCodes.mjs +1 -2
- package/server/dist/utils/responseData.cjs +2 -3
- package/server/dist/utils/responseData.d.ts +1 -2
- package/server/dist/utils/responseData.mjs +1 -2
- package/client/dist/assets/CodeBlockShiki-B-OcGOY1.js +0 -2
- package/client/dist/assets/MarkDownRender-BzY_8i9Z.js +0 -1
- package/client/dist/assets/MarkDownRender-CIkPpFUW.js +0 -25
- package/client/dist/assets/MarkdownEditor-BpbsoP4E.js +0 -161
- package/client/dist/assets/compat-r4Owm_RW.js +0 -1
- package/client/dist/assets/css-DUjzNfgv.js +0 -1
- package/client/dist/assets/html-WQKKblVZ.js +0 -1
- package/client/dist/assets/index-C5SpC4ap.css +0 -2
- package/client/dist/assets/index-CmQV7Z_A.js +0 -105
- package/client/dist/assets/javascript-Yelw-5ZN.js +0 -1
- package/client/dist/assets/json-CaljABEy.js +0 -1
- package/client/dist/assets/purify.es-Bvo9QlJ8.js +0 -3
- package/client/dist/assets/shikiBundle-BIG1bVgc.js +0 -12
- package/client/dist/assets/tsx-5f3ulCja.js +0 -1
- package/client/dist/assets/typescript-Utq2Cl8c.js +0 -1
- package/client/dist/assets/wasm-BnjxR4X6.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intlayer-editor",
|
|
3
|
-
"version": "9.7.
|
|
3
|
+
"version": "9.7.1",
|
|
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": [
|
|
@@ -88,47 +88,47 @@
|
|
|
88
88
|
"typecheck": "tsc --project ./server/tsconfig.types.json --noEmit"
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
|
-
"@fastify/compress": "9.
|
|
92
|
-
"@fastify/cookie": "11.1.
|
|
93
|
-
"@fastify/cors": "11.
|
|
94
|
-
"@fastify/formbody": "9.0.
|
|
95
|
-
"@fastify/helmet": "13.
|
|
96
|
-
"@fastify/static": "10.1.
|
|
97
|
-
"@intlayer/api": "9.7.
|
|
98
|
-
"@intlayer/cli": "9.7.
|
|
99
|
-
"@intlayer/config": "9.7.
|
|
100
|
-
"@intlayer/dictionaries-entry": "9.7.
|
|
101
|
-
"@intlayer/engine": "9.7.
|
|
102
|
-
"fastify": "5.12.
|
|
103
|
-
"fastify-intlayer": "9.7.
|
|
104
|
-
"mime": "4.1.
|
|
105
|
-
"preact-intlayer": "9.7.
|
|
106
|
-
"react-intlayer": "9.7.
|
|
107
|
-
"vite-intlayer": "9.7.
|
|
91
|
+
"@fastify/compress": "9.3.0",
|
|
92
|
+
"@fastify/cookie": "11.1.5",
|
|
93
|
+
"@fastify/cors": "11.4.0",
|
|
94
|
+
"@fastify/formbody": "9.0.1",
|
|
95
|
+
"@fastify/helmet": "13.2.0",
|
|
96
|
+
"@fastify/static": "10.1.8",
|
|
97
|
+
"@intlayer/api": "9.7.1",
|
|
98
|
+
"@intlayer/cli": "9.7.1",
|
|
99
|
+
"@intlayer/config": "9.7.1",
|
|
100
|
+
"@intlayer/dictionaries-entry": "9.7.1",
|
|
101
|
+
"@intlayer/engine": "9.7.1",
|
|
102
|
+
"fastify": "5.12.8",
|
|
103
|
+
"fastify-intlayer": "9.7.1",
|
|
104
|
+
"mime": "4.1.2",
|
|
105
|
+
"preact-intlayer": "9.7.1",
|
|
106
|
+
"react-intlayer": "9.7.1",
|
|
107
|
+
"vite-intlayer": "9.7.1"
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
|
-
"@intlayer/backend-contract": "9.7.
|
|
111
|
-
"@intlayer/core": "9.7.
|
|
112
|
-
"@intlayer/design-system": "9.7.
|
|
113
|
-
"@intlayer/editor-react": "9.7.
|
|
114
|
-
"@intlayer/types": "9.7.
|
|
110
|
+
"@intlayer/backend-contract": "9.7.1",
|
|
111
|
+
"@intlayer/core": "9.7.1",
|
|
112
|
+
"@intlayer/design-system": "9.7.1",
|
|
113
|
+
"@intlayer/editor-react": "9.7.1",
|
|
114
|
+
"@intlayer/types": "9.7.1",
|
|
115
115
|
"@preact/preset-vite": "2.10.6",
|
|
116
|
-
"@tailwindcss/vite": "4.3.
|
|
117
|
-
"@tanstack/react-query": "5.
|
|
116
|
+
"@tailwindcss/vite": "4.3.4",
|
|
117
|
+
"@tanstack/react-query": "5.105.3",
|
|
118
118
|
"@types/node": "^26",
|
|
119
119
|
"@utils/ts-config": "1.0.4",
|
|
120
|
-
"autoprefixer": "10.6.
|
|
121
|
-
"framer-motion": "14.
|
|
120
|
+
"autoprefixer": "10.6.2",
|
|
121
|
+
"framer-motion": "14.9.0",
|
|
122
122
|
"fuse.js": "7.5.0",
|
|
123
|
-
"globals": "17.
|
|
124
|
-
"intlayer": "9.7.
|
|
125
|
-
"lucide-react": "1.
|
|
126
|
-
"preact": "11.
|
|
127
|
-
"tailwindcss": "4.3.
|
|
128
|
-
"tsdown": "0.23.
|
|
123
|
+
"globals": "17.14.0",
|
|
124
|
+
"intlayer": "9.7.1",
|
|
125
|
+
"lucide-react": "1.66.0",
|
|
126
|
+
"preact": "11.1.1",
|
|
127
|
+
"tailwindcss": "4.3.4",
|
|
128
|
+
"tsdown": "0.23.4",
|
|
129
129
|
"typescript": "7.0.2",
|
|
130
|
-
"vite": "8.3.
|
|
131
|
-
"vitest": "5.0
|
|
130
|
+
"vite": "8.3.5",
|
|
131
|
+
"vitest": "5.1.0"
|
|
132
132
|
},
|
|
133
133
|
"engines": {
|
|
134
134
|
"node": ">=18.0.0"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// \0rolldown/runtime.js
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -24,5 +24,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
enumerable: true
|
|
25
25
|
}) : target, mod));
|
|
26
26
|
|
|
27
|
-
//#endregion
|
|
28
27
|
exports.__toESM = __toESM;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_services_editorAuth_service = require(
|
|
3
|
-
const require_utils_httpStatusCodes = require(
|
|
4
|
-
const require_utils_responseData = require(
|
|
2
|
+
const require_services_editorAuth_service = require("../services/editorAuth.service.cjs");
|
|
3
|
+
const require_utils_httpStatusCodes = require("../utils/httpStatusCodes.cjs");
|
|
4
|
+
const require_utils_responseData = require("../utils/responseData.cjs");
|
|
5
5
|
let _intlayer_config_node = require("@intlayer/config/node");
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/controllers/auth.controller.ts
|
|
8
8
|
const envFileOptions = {
|
|
9
9
|
env: process.env.NODE_ENV,
|
|
10
10
|
envFile: process.env.ENV_FILE
|
|
@@ -72,7 +72,6 @@ const logout = async (_request, reply) => {
|
|
|
72
72
|
} }));
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
//#endregion
|
|
76
75
|
exports.assertSameOrigin = assertSameOrigin;
|
|
77
76
|
exports.getEditorAuth = getEditorAuth;
|
|
78
77
|
exports.logout = logout;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { EditorAuth } from "../services/editorAuth.service.js";
|
|
2
2
|
import { ResponseData } from "../utils/responseData.js";
|
|
3
3
|
import { FastifyReply, FastifyRequest } from "fastify";
|
|
4
|
-
//#region src/controllers/auth.controller.d.ts
|
|
5
4
|
export type GetEditorAuthResultData = {
|
|
6
5
|
/** `null` when neither a login session nor an access key is available. */
|
|
7
6
|
auth: EditorAuth | null;
|
|
@@ -32,5 +31,4 @@ export declare const startLogin: (_request: FastifyRequest, reply: FastifyReply)
|
|
|
32
31
|
* identity left: the configured access key, if any.
|
|
33
32
|
*/
|
|
34
33
|
export declare const logout: (_request: FastifyRequest, reply: FastifyReply) => Promise<void>;
|
|
35
|
-
//#endregion
|
|
36
34
|
//# sourceMappingURL=auth.controller.d.ts.map
|
|
@@ -3,7 +3,7 @@ import { HttpStatusCodes } from "../utils/httpStatusCodes.mjs";
|
|
|
3
3
|
import { formatResponse } from "../utils/responseData.mjs";
|
|
4
4
|
import { getConfiguration } from "@intlayer/config/node";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/controllers/auth.controller.ts
|
|
7
7
|
const envFileOptions = {
|
|
8
8
|
env: process.env.NODE_ENV,
|
|
9
9
|
envFile: process.env.ENV_FILE
|
|
@@ -71,6 +71,5 @@ const logout = async (_request, reply) => {
|
|
|
71
71
|
} }));
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
-
//#endregion
|
|
75
74
|
export { assertSameOrigin, getEditorAuth, logout, startLogin };
|
|
76
75
|
//# sourceMappingURL=auth.controller.mjs.map
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_utils_responseData = require(
|
|
2
|
+
const require_utils_responseData = require("../utils/responseData.cjs");
|
|
3
3
|
let _intlayer_config_node = require("@intlayer/config/node");
|
|
4
|
+
let _intlayer_config_defaultValues = require("@intlayer/config/defaultValues");
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
// src/controllers/configuration.controller.ts
|
|
6
7
|
/**
|
|
7
8
|
* Get the Intlayer configuration
|
|
8
9
|
*/
|
|
9
10
|
const getConfiguration = async (_req, res) => {
|
|
10
11
|
try {
|
|
11
|
-
const config = (0, _intlayer_config_node.
|
|
12
|
+
const { configuration: config, customConfiguration } = (0, _intlayer_config_node.getConfigurationAndFilePath)();
|
|
12
13
|
const { clientSecret: _clientSecret, ...editor } = config.editor;
|
|
13
14
|
const formattedResponse = require_utils_responseData.formatResponse({ data: {
|
|
14
15
|
...config,
|
|
15
|
-
editor
|
|
16
|
+
editor,
|
|
17
|
+
isApplicationEditorEnabled: customConfiguration?.editor?.enabled ?? _intlayer_config_defaultValues.IS_ENABLED
|
|
16
18
|
} });
|
|
17
19
|
return res.send(formattedResponse);
|
|
18
20
|
} catch (err) {
|
|
@@ -32,6 +34,5 @@ const getConfiguration = async (_req, res) => {
|
|
|
32
34
|
}
|
|
33
35
|
};
|
|
34
36
|
|
|
35
|
-
//#endregion
|
|
36
37
|
exports.getConfiguration = getConfiguration;
|
|
37
38
|
//# sourceMappingURL=configuration.controller.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.controller.cjs","names":["
|
|
1
|
+
{"version":3,"file":"configuration.controller.cjs","names":["getConfigurationAndFilePath","formatResponse","IS_ENABLED"],"sources":["../../src/controllers/configuration.controller.ts"],"sourcesContent":["import { IS_ENABLED } from '@intlayer/config/defaultValues';\nimport { getConfigurationAndFilePath } from '@intlayer/config/node';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { formatResponse, type ResponseData } from '@utils/responseData';\nimport type { FastifyReply, FastifyRequest } from 'fastify';\n\nexport type EditorServerConfiguration = IntlayerConfig & {\n /**\n * `editor.enabled` as set in the application configuration. The editor\n * server forces `editor.enabled` on in its own process, so it cannot tell.\n */\n isApplicationEditorEnabled: boolean;\n};\n\nexport type GetConfigurationResult = ResponseData<EditorServerConfiguration>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getConfiguration = async (\n _req: FastifyRequest,\n res: FastifyReply\n): Promise<void> => {\n try {\n const { configuration: config, customConfiguration } =\n getConfigurationAndFilePath();\n\n // The client secret never leaves the server: the client authenticates\n // with the short-lived token served by the auth routes.\n const { clientSecret: _clientSecret, ...editor } = config.editor;\n\n const formattedResponse = formatResponse<EditorServerConfiguration>({\n data: {\n ...config,\n editor,\n isApplicationEditorEnabled:\n customConfiguration?.editor?.enabled ?? IS_ENABLED,\n },\n });\n\n return res.send(formattedResponse);\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<EditorServerConfiguration>({\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 return res.send(formattedErrorResponse);\n }\n};\n"],"mappings":";;;;;;;;;AAmBA,MAAa,mBAAmB,OAC9B,MACA,QACkB;CAClB,IAAI;EACF,MAAM,EAAE,eAAe,QAAQ,4BAC7BA,mDAA4B;EAI9B,MAAM,EAAE,cAAc,eAAe,GAAG,WAAW,OAAO;EAE1D,MAAM,oBAAoBC,0CAA0C,EAClE,MAAM;GACJ,GAAG;GACH;GACA,4BACE,qBAAqB,QAAQ,WAAWC;EAC5C,EACF,CAAC;EAED,OAAO,IAAI,KAAK,iBAAiB;CACnC,SAAS,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;EACV;EAEA,MAAM,yBAAyBD,0CAA0C;GACvE,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;GACT;GACA,QAAQ,aAAa,UAAU;EACjC,CAAC;EAED,OAAO,IAAI,KAAK,sBAAsB;CACxC;AACF"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { ResponseData } from "../utils/responseData.js";
|
|
2
2
|
import { IntlayerConfig } from "@intlayer/types/config";
|
|
3
3
|
import { FastifyReply, FastifyRequest } from "fastify";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
export type EditorServerConfiguration = IntlayerConfig & {
|
|
5
|
+
/**
|
|
6
|
+
* `editor.enabled` as set in the application configuration. The editor
|
|
7
|
+
* server forces `editor.enabled` on in its own process, so it cannot tell.
|
|
8
|
+
*/
|
|
9
|
+
isApplicationEditorEnabled: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type GetConfigurationResult = ResponseData<EditorServerConfiguration>;
|
|
6
12
|
/**
|
|
7
13
|
* Get the Intlayer configuration
|
|
8
14
|
*/
|
|
9
15
|
export declare const getConfiguration: (_req: FastifyRequest, res: FastifyReply) => Promise<void>;
|
|
10
|
-
//#endregion
|
|
11
16
|
//# sourceMappingURL=configuration.controller.d.ts.map
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { formatResponse } from "../utils/responseData.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { getConfigurationAndFilePath } from "@intlayer/config/node";
|
|
3
|
+
import { IS_ENABLED } from "@intlayer/config/defaultValues";
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
// src/controllers/configuration.controller.ts
|
|
5
6
|
/**
|
|
6
7
|
* Get the Intlayer configuration
|
|
7
8
|
*/
|
|
8
9
|
const getConfiguration = async (_req, res) => {
|
|
9
10
|
try {
|
|
10
|
-
const config =
|
|
11
|
+
const { configuration: config, customConfiguration } = getConfigurationAndFilePath();
|
|
11
12
|
const { clientSecret: _clientSecret, ...editor } = config.editor;
|
|
12
13
|
const formattedResponse = formatResponse({ data: {
|
|
13
14
|
...config,
|
|
14
|
-
editor
|
|
15
|
+
editor,
|
|
16
|
+
isApplicationEditorEnabled: customConfiguration?.editor?.enabled ?? IS_ENABLED
|
|
15
17
|
} });
|
|
16
18
|
return res.send(formattedResponse);
|
|
17
19
|
} catch (err) {
|
|
@@ -31,6 +33,5 @@ const getConfiguration = async (_req, res) => {
|
|
|
31
33
|
}
|
|
32
34
|
};
|
|
33
35
|
|
|
34
|
-
//#endregion
|
|
35
36
|
export { getConfiguration };
|
|
36
37
|
//# sourceMappingURL=configuration.controller.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.controller.mjs","names":[
|
|
1
|
+
{"version":3,"file":"configuration.controller.mjs","names":[],"sources":["../../src/controllers/configuration.controller.ts"],"sourcesContent":["import { IS_ENABLED } from '@intlayer/config/defaultValues';\nimport { getConfigurationAndFilePath } from '@intlayer/config/node';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { formatResponse, type ResponseData } from '@utils/responseData';\nimport type { FastifyReply, FastifyRequest } from 'fastify';\n\nexport type EditorServerConfiguration = IntlayerConfig & {\n /**\n * `editor.enabled` as set in the application configuration. The editor\n * server forces `editor.enabled` on in its own process, so it cannot tell.\n */\n isApplicationEditorEnabled: boolean;\n};\n\nexport type GetConfigurationResult = ResponseData<EditorServerConfiguration>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getConfiguration = async (\n _req: FastifyRequest,\n res: FastifyReply\n): Promise<void> => {\n try {\n const { configuration: config, customConfiguration } =\n getConfigurationAndFilePath();\n\n // The client secret never leaves the server: the client authenticates\n // with the short-lived token served by the auth routes.\n const { clientSecret: _clientSecret, ...editor } = config.editor;\n\n const formattedResponse = formatResponse<EditorServerConfiguration>({\n data: {\n ...config,\n editor,\n isApplicationEditorEnabled:\n customConfiguration?.editor?.enabled ?? IS_ENABLED,\n },\n });\n\n return res.send(formattedResponse);\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<EditorServerConfiguration>({\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 return res.send(formattedErrorResponse);\n }\n};\n"],"mappings":";;;;;;;;AAmBA,MAAa,mBAAmB,OAC9B,MACA,QACkB;CAClB,IAAI;EACF,MAAM,EAAE,eAAe,QAAQ,wBAC7B,4BAA4B;EAI9B,MAAM,EAAE,cAAc,eAAe,GAAG,WAAW,OAAO;EAE1D,MAAM,oBAAoB,eAA0C,EAClE,MAAM;GACJ,GAAG;GACH;GACA,4BACE,qBAAqB,QAAQ,WAAW;EAC5C,EACF,CAAC;EAED,OAAO,IAAI,KAAK,iBAAiB;CACnC,SAAS,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;EACV;EAEA,MAAM,yBAAyB,eAA0C;GACvE,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;GACT;GACA,QAAQ,aAAa,UAAU;EACjC,CAAC;EAED,OAAO,IAAI,KAAK,sBAAsB;CACxC;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_utils_responseData = require(
|
|
2
|
+
const require_utils_responseData = require("../utils/responseData.cjs");
|
|
3
3
|
let node_path = require("node:path");
|
|
4
4
|
let _intlayer_config_node = require("@intlayer/config/node");
|
|
5
5
|
let _intlayer_engine_build = require("@intlayer/engine/build");
|
|
@@ -7,7 +7,7 @@ let _intlayer_config_utils = require("@intlayer/config/utils");
|
|
|
7
7
|
let _intlayer_dictionaries_entry_unmerged = require("@intlayer/dictionaries-entry/unmerged");
|
|
8
8
|
let fastify_intlayer = require("fastify-intlayer");
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// src/controllers/dictionary.controller.ts
|
|
11
11
|
/**
|
|
12
12
|
* Get the Intlayer configuration
|
|
13
13
|
*/
|
|
@@ -106,7 +106,6 @@ const writeContentDeclaration = async (req, res) => {
|
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
-
//#endregion
|
|
110
109
|
exports.getDictionaries = getDictionaries;
|
|
111
110
|
exports.writeContentDeclaration = writeContentDeclaration;
|
|
112
111
|
//# sourceMappingURL=dictionary.controller.cjs.map
|
|
@@ -3,7 +3,6 @@ import { FastifyReply, FastifyRequest } from "fastify";
|
|
|
3
3
|
import { UnmergedDictionaries } from "@intlayer/dictionaries-entry/unmerged";
|
|
4
4
|
import { DictionaryStatus } from "@intlayer/engine/build";
|
|
5
5
|
import { Dictionary } from "@intlayer/types/dictionary";
|
|
6
|
-
//#region src/controllers/dictionary.controller.d.ts
|
|
7
6
|
export type GetEditorDictionariesResult = ResponseData<UnmergedDictionaries>;
|
|
8
7
|
/**
|
|
9
8
|
* Get the Intlayer configuration
|
|
@@ -23,5 +22,5 @@ export type WriteContentDeclarationResult = ResponseData<WriteContentDeclaration
|
|
|
23
22
|
export declare const writeContentDeclaration: (req: FastifyRequest<{
|
|
24
23
|
Body: WriteContentDeclarationBody;
|
|
25
24
|
}>, res: FastifyReply) => Promise<void>;
|
|
26
|
-
|
|
25
|
+
export {};
|
|
27
26
|
//# sourceMappingURL=dictionary.controller.d.ts.map
|
|
@@ -6,7 +6,7 @@ import { clearModuleCache } from "@intlayer/config/utils";
|
|
|
6
6
|
import { getUnmergedDictionaries } from "@intlayer/dictionaries-entry/unmerged";
|
|
7
7
|
import { t } from "fastify-intlayer";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// src/controllers/dictionary.controller.ts
|
|
10
10
|
/**
|
|
11
11
|
* Get the Intlayer configuration
|
|
12
12
|
*/
|
|
@@ -105,6 +105,5 @@ const writeContentDeclaration = async (req, res) => {
|
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
107
|
|
|
108
|
-
//#endregion
|
|
109
108
|
export { getDictionaries, writeContentDeclaration };
|
|
110
109
|
//# sourceMappingURL=dictionary.controller.mjs.map
|
package/server/dist/export.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_controllers_configuration_controller = require(
|
|
3
|
-
const require_controllers_dictionary_controller = require(
|
|
2
|
+
const require_controllers_configuration_controller = require("./controllers/configuration.controller.cjs");
|
|
3
|
+
const require_controllers_dictionary_controller = require("./controllers/dictionary.controller.cjs");
|
|
4
4
|
|
|
5
5
|
exports.getConfiguration = require_controllers_configuration_controller.getConfiguration;
|
|
6
6
|
exports.getDictionaries = require_controllers_dictionary_controller.getDictionaries;
|
package/server/dist/export.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { GetConfigurationResult, getConfiguration } from "./controllers/configuration.controller.js";
|
|
1
|
+
import { EditorServerConfiguration, GetConfigurationResult, getConfiguration } from "./controllers/configuration.controller.js";
|
|
2
2
|
import { GetEditorDictionariesResult, WriteContentDeclarationBody, WriteContentDeclarationResult, getDictionaries, writeContentDeclaration } from "./controllers/dictionary.controller.js";
|
|
3
|
-
export { GetConfigurationResult, GetEditorDictionariesResult, WriteContentDeclarationBody, WriteContentDeclarationResult, getConfiguration, getDictionaries, writeContentDeclaration };
|
|
3
|
+
export { EditorServerConfiguration, GetConfigurationResult, GetEditorDictionariesResult, WriteContentDeclarationBody, WriteContentDeclarationResult, getConfiguration, getDictionaries, writeContentDeclaration };
|
package/server/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_runtime = require(
|
|
2
|
-
const require_routes_auth_routes = require(
|
|
3
|
-
const require_routes_config_routes = require(
|
|
4
|
-
const require_routes_dictionary_routes = require(
|
|
5
|
-
const require_utils_checkPortAvailability = require(
|
|
1
|
+
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_routes_auth_routes = require("./routes/auth.routes.cjs");
|
|
3
|
+
const require_routes_config_routes = require("./routes/config.routes.cjs");
|
|
4
|
+
const require_routes_dictionary_routes = require("./routes/dictionary.routes.cjs");
|
|
5
|
+
const require_utils_checkPortAvailability = require("./utils/checkPortAvailability.cjs");
|
|
6
6
|
let node_fs = require("node:fs");
|
|
7
7
|
let node_path = require("node:path");
|
|
8
8
|
let node_url = require("node:url");
|
|
@@ -30,7 +30,7 @@ fastify = require_runtime.__toESM(fastify, 1);
|
|
|
30
30
|
let mime = require("mime");
|
|
31
31
|
mime = require_runtime.__toESM(mime, 1);
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
// src/index.ts
|
|
34
34
|
const __dirname$1 = (0, node_path.dirname)((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
|
|
35
35
|
const envFileOptions = {
|
|
36
36
|
env: process.env.NODE_ENV,
|
|
@@ -58,13 +58,23 @@ const startServer = async (app) => {
|
|
|
58
58
|
}
|
|
59
59
|
if (port !== preferredPort) appLogger(`Port ${preferredPort} is in use, using port ${port} instead.`, { level: "warn" });
|
|
60
60
|
process.env[_intlayer_config_node.EDITOR_SERVER_PORT_ENV_VAR] = String(port);
|
|
61
|
-
const
|
|
61
|
+
const editorOverride = {
|
|
62
62
|
enabled: true,
|
|
63
63
|
editorURL: (0, _intlayer_config_node.getEditorURLForPort)(config.editor.editorURL, port)
|
|
64
|
-
}
|
|
64
|
+
};
|
|
65
|
+
const overriddenKeys = await (0, _intlayer_engine_build.overrideBuiltEditorConfiguration)(config, editorOverride);
|
|
65
66
|
if (overriddenKeys.length > 0) {
|
|
66
67
|
const overriddenSettings = overriddenKeys.map((key) => (0, _intlayer_config_logger.colorize)(`editor.${key}`, _intlayer_config_colors.BLUE));
|
|
67
68
|
appLogger(`${overriddenSettings.join(" and ")} temporarily adapted in ${(0, _intlayer_config_logger.colorizePath)((0, node_path.relative)(config.system.baseDir, config.system.configDir))}. Set it in ${(0, _intlayer_config_logger.colorizePath)("intlayer.config.ts")} to keep it after the next build.`, { level: "warn" });
|
|
69
|
+
(0, _intlayer_engine_build.watchBuiltEditorConfiguration)(config.system.configDir, {
|
|
70
|
+
loadConfiguration: () => (0, _intlayer_config_node.getConfiguration)({
|
|
71
|
+
...envFileOptions,
|
|
72
|
+
cache: false
|
|
73
|
+
}),
|
|
74
|
+
editorOverride,
|
|
75
|
+
onRestore: () => appLogger(`${overriddenSettings.join(" and ")} adapted again in ${(0, _intlayer_config_logger.colorizePath)((0, node_path.relative)(config.system.baseDir, config.system.configDir))} after the application rebuilt it.`),
|
|
76
|
+
onError: (error) => appLogger(`Failed to keep the editor settings in the built configuration: ${error.message}`, { level: "warn" })
|
|
77
|
+
});
|
|
68
78
|
}
|
|
69
79
|
await app.register(_fastify_helmet.default, {
|
|
70
80
|
contentSecurityPolicy: {
|
|
@@ -126,5 +136,4 @@ const startServer = async (app) => {
|
|
|
126
136
|
};
|
|
127
137
|
startServer(app);
|
|
128
138
|
|
|
129
|
-
//#endregion
|
|
130
139
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["__dirname","dirname","fileURLToPath","getConfiguration","getAppLogger","readFileSync","resolve","Fastify","LogController","intlayer","findAvailablePort","EDITOR_SERVER_PORT_ENV_VAR","overrideBuiltEditorConfiguration","getEditorURLForPort","colorize","ANSIColors","colorizePath","relative","fastifyHelmet","fastifyCors","fastifyCompress","fastifyCookie","fastifyFormbody","dictionaryRouter","configurationRouter","authRouter","fastifyStatic","join","existsSync","lstatSync","getEnvFilePath"],"sources":["../src/index.ts"],"sourcesContent":["import { existsSync, lstatSync, readFileSync } from 'node:fs';\nimport { dirname, join, relative, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport fastifyCompress from '@fastify/compress';\nimport fastifyCookie from '@fastify/cookie';\nimport fastifyCors, { type FastifyCorsOptions } from '@fastify/cors';\nimport fastifyFormbody from '@fastify/formbody';\nimport fastifyHelmet from '@fastify/helmet';\nimport fastifyStatic from '@fastify/static';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { getEnvFilePath } from '@intlayer/config/env';\nimport { colorize, colorizePath, getAppLogger } from '@intlayer/config/logger';\nimport {\n EDITOR_SERVER_PORT_ENV_VAR,\n getConfiguration,\n getEditorURLForPort,\n} from '@intlayer/config/node';\nimport { overrideBuiltEditorConfiguration } from '@intlayer/engine/build';\nimport { authRouter } from '@routes/auth.routes';\nimport { configurationRouter } from '@routes/config.routes';\nimport { dictionaryRouter } from '@routes/dictionary.routes';\nimport { findAvailablePort } from '@utils/checkPortAvailability';\nimport Fastify, { type FastifyInstance, LogController } from 'fastify';\nimport { intlayer } from 'fastify-intlayer';\nimport mime from 'mime';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst envFileOptions = {\n env: process.env.NODE_ENV,\n envFile: process.env.ENV_FILE,\n};\n\nconst FALLBACK_PORT = 8000;\nconst config = getConfiguration(envFileOptions);\n\nconst appLogger = getAppLogger(config);\n/** Port tried first; the next free one is used when it is taken. */\nconst preferredPort = config.editor.port ?? FALLBACK_PORT;\nconst HOST = '0.0.0.0';\n\n// Load package.json\nconst packageJson = JSON.parse(\n readFileSync(resolve(__dirname, '../../package.json'), 'utf8')\n);\n\nconst app: FastifyInstance = Fastify({\n logController: new LogController({\n disableRequestLogging: true, // Keep logs clean like the original\n }),\n});\n\n// Load internationalization plugin\n// Assuming fastify-intlayer is the Fastify equivalent of express-intlayer\napp.register(intlayer);\n\nconst clientDistPath = resolve(__dirname, '../../client/dist');\n\nconst corsOptions: FastifyCorsOptions = {\n origin: '*',\n credentials: true,\n};\n\nconst startServer = async (app: FastifyInstance) => {\n const port = await findAvailablePort(preferredPort, HOST);\n\n if (port === undefined) {\n appLogger(`Error: Port ${preferredPort} and the next ones are in use.`, {\n level: 'error',\n });\n process.exit(255);\n }\n\n if (port !== preferredPort) {\n appLogger(`Port ${preferredPort} is in use, using port ${port} instead.`, {\n level: 'warn',\n });\n }\n\n // Served by `/api/config`: the client calls the editor at its actual URL\n process.env[EDITOR_SERVER_PORT_ENV_VAR] = String(port);\n\n // Adapted in the built configuration only: the application must load the\n // editor client, and accept messages from the URL the editor is served at\n const overriddenKeys = await overrideBuiltEditorConfiguration(config, {\n enabled: true,\n editorURL: getEditorURLForPort(config.editor.editorURL, port),\n });\n\n if (overriddenKeys.length > 0) {\n const overriddenSettings = overriddenKeys.map((key) =>\n colorize(`editor.${key}`, ANSIColors.BLUE)\n );\n\n appLogger(\n `${overriddenSettings.join(' and ')} temporarily adapted in ${colorizePath(relative(config.system.baseDir, config.system.configDir))}. Set it in ${colorizePath('intlayer.config.ts')} to keep it after the next build.`,\n {\n level: 'warn',\n }\n );\n }\n\n // Security Headers\n await app.register(fastifyHelmet, {\n // Only restrict who may frame the editor: itself and IDE webviews (the\n // VS Code extension panel). `X-Frame-Options` cannot list a scheme.\n contentSecurityPolicy: {\n useDefaults: false,\n directives: {\n // Helmet requires a `default-src`; the editor sets no other policy\n defaultSrc:\n fastifyHelmet.contentSecurityPolicy.dangerouslyDisableDefaultSrc,\n frameAncestors: [\n \"'self'\",\n 'vscode-webview:',\n 'vscode-file:',\n 'https://*.vscode-cdn.net',\n 'https://*.vscode-webview.net',\n 'localhost:*',\n 'http://localhost:*',\n 'http://127.0.0.1:*',\n ],\n },\n },\n frameguard: false,\n global: true,\n });\n\n // CORS\n await app.register(fastifyCors, corsOptions);\n\n // Compression\n await app.register(fastifyCompress);\n\n // Cookie Parser\n await app.register(fastifyCookie);\n\n // Parse application/x-www-form-urlencoded\n await app.register(fastifyFormbody);\n\n // Register Routes\n await app.register(dictionaryRouter, { prefix: '/api/dictionary' });\n await app.register(configurationRouter, { prefix: '/api/config' });\n await app.register(authRouter, { prefix: '/api/auth' });\n\n // Serve Static Files\n await app.register(fastifyStatic, {\n root: clientDistPath,\n wildcard: false, // We handle the fallback manually to match SPA logic\n });\n\n // For single-page applications, redirect all unmatched routes to index.html\n app.setNotFoundHandler((req, reply) => {\n const requestedPath = join(clientDistPath, req.raw.url || '/');\n\n if (existsSync(requestedPath) && lstatSync(requestedPath).isFile()) {\n const mimeType =\n mime.getType(requestedPath) ?? 'application/octet-stream';\n reply.header('Content-Type', mimeType);\n return reply.sendFile(req.raw.url?.split('/').pop() || 'index.html');\n } else {\n return reply.sendFile('index.html');\n }\n });\n\n try {\n await app.listen({ port, host: HOST });\n\n const dotEnvFilePath = getEnvFilePath(\n envFileOptions.env,\n envFileOptions.envFile\n );\n\n console.log(`\n ${colorize(colorize('INTLAYER', ANSIColors.BOLD), ANSIColors.GREY_DARK)} ${colorize(`v${packageJson.version}`, ANSIColors.GREY_DARK)}\n\n Editor running at: ${colorizePath(`http://localhost:${port}`)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Watching application at: ${config.editor.applicationURL === '' ? '-' : colorizePath(config.editor.applicationURL)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Access key: ${config.editor.clientId ?? '-'}\n ${colorize('➜', ANSIColors.GREY_DARK)} Environment: ${dotEnvFilePath ?? '-'}\n `);\n } catch (error) {\n // The Fastify logger is disabled, so `app.log` would swallow this\n appLogger(`Failed to start the editor: ${(error as Error).message}`, {\n level: 'error',\n });\n process.exit(\n (error as NodeJS.ErrnoException).code === 'EADDRINUSE' ? 255 : 1\n );\n }\n};\n\n// Start it up!\nstartServer(app);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,kBAAYC,uBAAQC,qEAA6B,CAAC;AAExD,MAAM,iBAAiB;CACrB;CACA,SAAS,QAAQ,IAAI;AACvB;AAEA,MAAM,gBAAgB;AACtB,MAAM,aAASC,wCA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AAO,cAAc,EAAE;UACzJF,kCAAS,KAAKC,wBAAW,SAAS,EAAE,8BAA8B,OAAO,OAAO,YAAY,IAAI;UAChGD,kCAAS,KAAKC,wBAAW,SAAS,EAAE,8BAA8B,kBAAkB,IAAI;KACzF;CACH,SAAS,OAAO;EAEd,UAAU,+BAAgC,MAAgB,WAAW,EACnE,OAAO,QACT,CAAC;EACD,QAAQ,KACL,MAAgC,SAAS,eAAe,MAAM,CACjE;CACF;AACF;AAGA,YAAY,GAAG"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["__dirname","dirname","fileURLToPath","getConfiguration","getAppLogger","readFileSync","resolve","Fastify","LogController","intlayer","findAvailablePort","EDITOR_SERVER_PORT_ENV_VAR","getEditorURLForPort","overrideBuiltEditorConfiguration","colorize","ANSIColors","colorizePath","relative","fastifyHelmet","fastifyCors","fastifyCompress","fastifyCookie","fastifyFormbody","dictionaryRouter","configurationRouter","authRouter","fastifyStatic","join","existsSync","lstatSync","getEnvFilePath"],"sources":["../src/index.ts"],"sourcesContent":["import { existsSync, lstatSync, readFileSync } from 'node:fs';\nimport { dirname, join, relative, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport fastifyCompress from '@fastify/compress';\nimport fastifyCookie from '@fastify/cookie';\nimport fastifyCors, { type FastifyCorsOptions } from '@fastify/cors';\nimport fastifyFormbody from '@fastify/formbody';\nimport fastifyHelmet from '@fastify/helmet';\nimport fastifyStatic from '@fastify/static';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { getEnvFilePath } from '@intlayer/config/env';\nimport { colorize, colorizePath, getAppLogger } from '@intlayer/config/logger';\nimport {\n EDITOR_SERVER_PORT_ENV_VAR,\n getConfiguration,\n getEditorURLForPort,\n} from '@intlayer/config/node';\nimport {\n type BuiltEditorOverride,\n overrideBuiltEditorConfiguration,\n watchBuiltEditorConfiguration,\n} from '@intlayer/engine/build';\nimport { authRouter } from '@routes/auth.routes';\nimport { configurationRouter } from '@routes/config.routes';\nimport { dictionaryRouter } from '@routes/dictionary.routes';\nimport { findAvailablePort } from '@utils/checkPortAvailability';\nimport Fastify, { type FastifyInstance, LogController } from 'fastify';\nimport { intlayer } from 'fastify-intlayer';\nimport mime from 'mime';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst envFileOptions = {\n env: process.env.NODE_ENV,\n envFile: process.env.ENV_FILE,\n};\n\nconst FALLBACK_PORT = 8000;\nconst config = getConfiguration(envFileOptions);\n\nconst appLogger = getAppLogger(config);\n/** Port tried first; the next free one is used when it is taken. */\nconst preferredPort = config.editor.port ?? FALLBACK_PORT;\nconst HOST = '0.0.0.0';\n\n// Load package.json\nconst packageJson = JSON.parse(\n readFileSync(resolve(__dirname, '../../package.json'), 'utf8')\n);\n\nconst app: FastifyInstance = Fastify({\n logController: new LogController({\n disableRequestLogging: true, // Keep logs clean like the original\n }),\n});\n\n// Load internationalization plugin\n// Assuming fastify-intlayer is the Fastify equivalent of express-intlayer\napp.register(intlayer);\n\nconst clientDistPath = resolve(__dirname, '../../client/dist');\n\nconst corsOptions: FastifyCorsOptions = {\n origin: '*',\n credentials: true,\n};\n\nconst startServer = async (app: FastifyInstance) => {\n const port = await findAvailablePort(preferredPort, HOST);\n\n if (port === undefined) {\n appLogger(`Error: Port ${preferredPort} and the next ones are in use.`, {\n level: 'error',\n });\n process.exit(255);\n }\n\n if (port !== preferredPort) {\n appLogger(`Port ${preferredPort} is in use, using port ${port} instead.`, {\n level: 'warn',\n });\n }\n\n // Served by `/api/config`: the client calls the editor at its actual URL\n process.env[EDITOR_SERVER_PORT_ENV_VAR] = String(port);\n\n // Adapted in the built configuration only: the application must load the\n // editor client, and accept messages from the URL the editor is served at\n const editorOverride: BuiltEditorOverride = {\n enabled: true,\n editorURL: getEditorURLForPort(config.editor.editorURL, port),\n };\n const overriddenKeys = await overrideBuiltEditorConfiguration(\n config,\n editorOverride\n );\n\n if (overriddenKeys.length > 0) {\n const overriddenSettings = overriddenKeys.map((key) =>\n colorize(`editor.${key}`, ANSIColors.BLUE)\n );\n\n appLogger(\n `${overriddenSettings.join(' and ')} temporarily adapted in ${colorizePath(relative(config.system.baseDir, config.system.configDir))}. Set it in ${colorizePath('intlayer.config.ts')} to keep it after the next build.`,\n {\n level: 'warn',\n }\n );\n\n // An application (re)started aside rebuilds the configuration without them\n watchBuiltEditorConfiguration(config.system.configDir, {\n loadConfiguration: () =>\n getConfiguration({ ...envFileOptions, cache: false }),\n editorOverride,\n onRestore: () =>\n appLogger(\n `${overriddenSettings.join(' and ')} adapted again in ${colorizePath(relative(config.system.baseDir, config.system.configDir))} after the application rebuilt it.`\n ),\n onError: (error) =>\n appLogger(\n `Failed to keep the editor settings in the built configuration: ${(error as Error).message}`,\n { level: 'warn' }\n ),\n });\n }\n\n // Security Headers\n await app.register(fastifyHelmet, {\n // Only restrict who may frame the editor: itself and IDE webviews (the\n // VS Code extension panel). `X-Frame-Options` cannot list a scheme.\n contentSecurityPolicy: {\n useDefaults: false,\n directives: {\n // Helmet requires a `default-src`; the editor sets no other policy\n defaultSrc:\n fastifyHelmet.contentSecurityPolicy.dangerouslyDisableDefaultSrc,\n frameAncestors: [\n \"'self'\",\n 'vscode-webview:',\n 'vscode-file:',\n 'https://*.vscode-cdn.net',\n 'https://*.vscode-webview.net',\n 'localhost:*',\n 'http://localhost:*',\n 'http://127.0.0.1:*',\n ],\n },\n },\n frameguard: false,\n global: true,\n });\n\n // CORS\n await app.register(fastifyCors, corsOptions);\n\n // Compression\n await app.register(fastifyCompress);\n\n // Cookie Parser\n await app.register(fastifyCookie);\n\n // Parse application/x-www-form-urlencoded\n await app.register(fastifyFormbody);\n\n // Register Routes\n await app.register(dictionaryRouter, { prefix: '/api/dictionary' });\n await app.register(configurationRouter, { prefix: '/api/config' });\n await app.register(authRouter, { prefix: '/api/auth' });\n\n // Serve Static Files\n await app.register(fastifyStatic, {\n root: clientDistPath,\n wildcard: false, // We handle the fallback manually to match SPA logic\n });\n\n // For single-page applications, redirect all unmatched routes to index.html\n app.setNotFoundHandler((req, reply) => {\n const requestedPath = join(clientDistPath, req.raw.url || '/');\n\n if (existsSync(requestedPath) && lstatSync(requestedPath).isFile()) {\n const mimeType =\n mime.getType(requestedPath) ?? 'application/octet-stream';\n reply.header('Content-Type', mimeType);\n return reply.sendFile(req.raw.url?.split('/').pop() || 'index.html');\n } else {\n return reply.sendFile('index.html');\n }\n });\n\n try {\n await app.listen({ port, host: HOST });\n\n const dotEnvFilePath = getEnvFilePath(\n envFileOptions.env,\n envFileOptions.envFile\n );\n\n console.log(`\n ${colorize(colorize('INTLAYER', ANSIColors.BOLD), ANSIColors.GREY_DARK)} ${colorize(`v${packageJson.version}`, ANSIColors.GREY_DARK)}\n\n Editor running at: ${colorizePath(`http://localhost:${port}`)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Watching application at: ${config.editor.applicationURL === '' ? '-' : colorizePath(config.editor.applicationURL)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Access key: ${config.editor.clientId ?? '-'}\n ${colorize('➜', ANSIColors.GREY_DARK)} Environment: ${dotEnvFilePath ?? '-'}\n `);\n } catch (error) {\n // The Fastify logger is disabled, so `app.log` would swallow this\n appLogger(`Failed to start the editor: ${(error as Error).message}`, {\n level: 'error',\n });\n process.exit(\n (error as NodeJS.ErrnoException).code === 'EADDRINUSE' ? 255 : 1\n );\n }\n};\n\n// Start it up!\nstartServer(app);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAMA,kBAAYC,uBAAQC,qEAA6B,CAAC;AAExD,MAAM,iBAAiB;CACrB;CACA,SAAS,QAAQ,IAAI;AACvB;AAEA,MAAM,gBAAgB;AACtB,MAAM,aAASC,wCAAiB,cAAc;AAE9C,MAAM,gBAAYC,sCAAa,MAAM;;AAErC,MAAM,gBAAgB,OAAO,OAAO,QAAQ;AAC5C,MAAM,OAAO;AAGb,MAAM,cAAc,KAAK,UACvBC,0BAAaC,mBAAQN,aAAW,oBAAoB,GAAG,MAAM,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EAAE;;uCAEtGC,sCAAa,oBAAoB,MAAM,EAAE;UACtEF,kCAAS,KAAKC,wBAAW,SAAS,EAAE,8BAA8B,OAAO,OAAO,mBAAmB,KAAK,UAAMC,sCAAa,OAAO,OAAO,cAAc,EAAE;UACzJF,kCAAS,KAAKC,wBAAW,SAAS,EAAE,8BAA8B,OAAO,OAAO,YAAY,IAAI;UAChGD,kCAAS,KAAKC,wBAAW,SAAS,EAAE,8BAA8B,kBAAkB,IAAI;KACzF;CACH,SAAS,OAAO;EAEd,UAAU,+BAAgC,MAAgB,WAAW,EACnE,OAAO,QACT,CAAC;EACD,QAAQ,KACL,MAAgC,SAAS,eAAe,MAAM,CACjE;CACF;AACF;AAGA,YAAY,GAAG"}
|
package/server/dist/index.mjs
CHANGED
|
@@ -15,12 +15,12 @@ import * as ANSIColors from "@intlayer/config/colors";
|
|
|
15
15
|
import { getEnvFilePath } from "@intlayer/config/env";
|
|
16
16
|
import { colorize, colorizePath, getAppLogger } from "@intlayer/config/logger";
|
|
17
17
|
import { EDITOR_SERVER_PORT_ENV_VAR, getConfiguration, getEditorURLForPort } from "@intlayer/config/node";
|
|
18
|
-
import { overrideBuiltEditorConfiguration } from "@intlayer/engine/build";
|
|
18
|
+
import { overrideBuiltEditorConfiguration, watchBuiltEditorConfiguration } from "@intlayer/engine/build";
|
|
19
19
|
import { intlayer } from "fastify-intlayer";
|
|
20
20
|
import Fastify, { LogController } from "fastify";
|
|
21
21
|
import mime from "mime";
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
// src/index.ts
|
|
24
24
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
25
25
|
const envFileOptions = {
|
|
26
26
|
env: process.env.NODE_ENV,
|
|
@@ -48,13 +48,23 @@ const startServer = async (app) => {
|
|
|
48
48
|
}
|
|
49
49
|
if (port !== preferredPort) appLogger(`Port ${preferredPort} is in use, using port ${port} instead.`, { level: "warn" });
|
|
50
50
|
process.env[EDITOR_SERVER_PORT_ENV_VAR] = String(port);
|
|
51
|
-
const
|
|
51
|
+
const editorOverride = {
|
|
52
52
|
enabled: true,
|
|
53
53
|
editorURL: getEditorURLForPort(config.editor.editorURL, port)
|
|
54
|
-
}
|
|
54
|
+
};
|
|
55
|
+
const overriddenKeys = await overrideBuiltEditorConfiguration(config, editorOverride);
|
|
55
56
|
if (overriddenKeys.length > 0) {
|
|
56
57
|
const overriddenSettings = overriddenKeys.map((key) => colorize(`editor.${key}`, ANSIColors.BLUE));
|
|
57
58
|
appLogger(`${overriddenSettings.join(" and ")} temporarily adapted in ${colorizePath(relative(config.system.baseDir, config.system.configDir))}. Set it in ${colorizePath("intlayer.config.ts")} to keep it after the next build.`, { level: "warn" });
|
|
59
|
+
watchBuiltEditorConfiguration(config.system.configDir, {
|
|
60
|
+
loadConfiguration: () => getConfiguration({
|
|
61
|
+
...envFileOptions,
|
|
62
|
+
cache: false
|
|
63
|
+
}),
|
|
64
|
+
editorOverride,
|
|
65
|
+
onRestore: () => appLogger(`${overriddenSettings.join(" and ")} adapted again in ${colorizePath(relative(config.system.baseDir, config.system.configDir))} after the application rebuilt it.`),
|
|
66
|
+
onError: (error) => appLogger(`Failed to keep the editor settings in the built configuration: ${error.message}`, { level: "warn" })
|
|
67
|
+
});
|
|
58
68
|
}
|
|
59
69
|
await app.register(fastifyHelmet, {
|
|
60
70
|
contentSecurityPolicy: {
|
|
@@ -116,5 +126,4 @@ const startServer = async (app) => {
|
|
|
116
126
|
};
|
|
117
127
|
startServer(app);
|
|
118
128
|
|
|
119
|
-
//#endregion
|
|
120
129
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { existsSync, lstatSync, readFileSync } from 'node:fs';\nimport { dirname, join, relative, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport fastifyCompress from '@fastify/compress';\nimport fastifyCookie from '@fastify/cookie';\nimport fastifyCors, { type FastifyCorsOptions } from '@fastify/cors';\nimport fastifyFormbody from '@fastify/formbody';\nimport fastifyHelmet from '@fastify/helmet';\nimport fastifyStatic from '@fastify/static';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { getEnvFilePath } from '@intlayer/config/env';\nimport { colorize, colorizePath, getAppLogger } from '@intlayer/config/logger';\nimport {\n EDITOR_SERVER_PORT_ENV_VAR,\n getConfiguration,\n getEditorURLForPort,\n} from '@intlayer/config/node';\nimport { overrideBuiltEditorConfiguration } from '@intlayer/engine/build';\nimport { authRouter } from '@routes/auth.routes';\nimport { configurationRouter } from '@routes/config.routes';\nimport { dictionaryRouter } from '@routes/dictionary.routes';\nimport { findAvailablePort } from '@utils/checkPortAvailability';\nimport Fastify, { type FastifyInstance, LogController } from 'fastify';\nimport { intlayer } from 'fastify-intlayer';\nimport mime from 'mime';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst envFileOptions = {\n env: process.env.NODE_ENV,\n envFile: process.env.ENV_FILE,\n};\n\nconst FALLBACK_PORT = 8000;\nconst config = getConfiguration(envFileOptions);\n\nconst appLogger = getAppLogger(config);\n/** Port tried first; the next free one is used when it is taken. */\nconst preferredPort = config.editor.port ?? FALLBACK_PORT;\nconst HOST = '0.0.0.0';\n\n// Load package.json\nconst packageJson = JSON.parse(\n readFileSync(resolve(__dirname, '../../package.json'), 'utf8')\n);\n\nconst app: FastifyInstance = Fastify({\n logController: new LogController({\n disableRequestLogging: true, // Keep logs clean like the original\n }),\n});\n\n// Load internationalization plugin\n// Assuming fastify-intlayer is the Fastify equivalent of express-intlayer\napp.register(intlayer);\n\nconst clientDistPath = resolve(__dirname, '../../client/dist');\n\nconst corsOptions: FastifyCorsOptions = {\n origin: '*',\n credentials: true,\n};\n\nconst startServer = async (app: FastifyInstance) => {\n const port = await findAvailablePort(preferredPort, HOST);\n\n if (port === undefined) {\n appLogger(`Error: Port ${preferredPort} and the next ones are in use.`, {\n level: 'error',\n });\n process.exit(255);\n }\n\n if (port !== preferredPort) {\n appLogger(`Port ${preferredPort} is in use, using port ${port} instead.`, {\n level: 'warn',\n });\n }\n\n // Served by `/api/config`: the client calls the editor at its actual URL\n process.env[EDITOR_SERVER_PORT_ENV_VAR] = String(port);\n\n // Adapted in the built configuration only: the application must load the\n // editor client, and accept messages from the URL the editor is served at\n const overriddenKeys = await overrideBuiltEditorConfiguration(config, {\n enabled: true,\n editorURL: getEditorURLForPort(config.editor.editorURL, port),\n });\n\n if (overriddenKeys.length > 0) {\n const overriddenSettings = overriddenKeys.map((key) =>\n colorize(`editor.${key}`, ANSIColors.BLUE)\n );\n\n appLogger(\n `${overriddenSettings.join(' and ')} temporarily adapted in ${colorizePath(relative(config.system.baseDir, config.system.configDir))}. Set it in ${colorizePath('intlayer.config.ts')} to keep it after the next build.`,\n {\n level: 'warn',\n }\n );\n }\n\n // Security Headers\n await app.register(fastifyHelmet, {\n // Only restrict who may frame the editor: itself and IDE webviews (the\n // VS Code extension panel). `X-Frame-Options` cannot list a scheme.\n contentSecurityPolicy: {\n useDefaults: false,\n directives: {\n // Helmet requires a `default-src`; the editor sets no other policy\n defaultSrc:\n fastifyHelmet.contentSecurityPolicy.dangerouslyDisableDefaultSrc,\n frameAncestors: [\n \"'self'\",\n 'vscode-webview:',\n 'vscode-file:',\n 'https://*.vscode-cdn.net',\n 'https://*.vscode-webview.net',\n 'localhost:*',\n 'http://localhost:*',\n 'http://127.0.0.1:*',\n ],\n },\n },\n frameguard: false,\n global: true,\n });\n\n // CORS\n await app.register(fastifyCors, corsOptions);\n\n // Compression\n await app.register(fastifyCompress);\n\n // Cookie Parser\n await app.register(fastifyCookie);\n\n // Parse application/x-www-form-urlencoded\n await app.register(fastifyFormbody);\n\n // Register Routes\n await app.register(dictionaryRouter, { prefix: '/api/dictionary' });\n await app.register(configurationRouter, { prefix: '/api/config' });\n await app.register(authRouter, { prefix: '/api/auth' });\n\n // Serve Static Files\n await app.register(fastifyStatic, {\n root: clientDistPath,\n wildcard: false, // We handle the fallback manually to match SPA logic\n });\n\n // For single-page applications, redirect all unmatched routes to index.html\n app.setNotFoundHandler((req, reply) => {\n const requestedPath = join(clientDistPath, req.raw.url || '/');\n\n if (existsSync(requestedPath) && lstatSync(requestedPath).isFile()) {\n const mimeType =\n mime.getType(requestedPath) ?? 'application/octet-stream';\n reply.header('Content-Type', mimeType);\n return reply.sendFile(req.raw.url?.split('/').pop() || 'index.html');\n } else {\n return reply.sendFile('index.html');\n }\n });\n\n try {\n await app.listen({ port, host: HOST });\n\n const dotEnvFilePath = getEnvFilePath(\n envFileOptions.env,\n envFileOptions.envFile\n );\n\n console.log(`\n ${colorize(colorize('INTLAYER', ANSIColors.BOLD), ANSIColors.GREY_DARK)} ${colorize(`v${packageJson.version}`, ANSIColors.GREY_DARK)}\n\n Editor running at: ${colorizePath(`http://localhost:${port}`)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Watching application at: ${config.editor.applicationURL === '' ? '-' : colorizePath(config.editor.applicationURL)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Access key: ${config.editor.clientId ?? '-'}\n ${colorize('➜', ANSIColors.GREY_DARK)} Environment: ${dotEnvFilePath ?? '-'}\n `);\n } catch (error) {\n // The Fastify logger is disabled, so `app.log` would swallow this\n appLogger(`Failed to start the editor: ${(error as Error).message}`, {\n level: 'error',\n });\n process.exit(\n (error as NodeJS.ErrnoException).code === 'EADDRINUSE' ? 255 : 1\n );\n }\n};\n\n// Start it up!\nstartServer(app);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,YAAY,QAAQ,cAAc,YAAY,GAAG,CAAC;AAExD,MAAM,iBAAiB;CACrB;CACA,SAAS,QAAQ,IAAI;AACvB;AAEA,MAAM,gBAAgB;AACtB,MAAM,SAAS,iBAAiB,cAAc;AAE9C,MAAM,YAAY,aAAa,MAAM;;AAErC,MAAM,gBAAgB,OAAO,OAAO,QAAQ;AAC5C,MAAM,OAAO;AAGb,MAAM,cAAc,KAAK,MACvB,aAAa,QAAQ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;EACD,QAAQ,KACL,MAAgC,SAAS,eAAe,MAAM,CACjE;CACF;AACF;AAGA,YAAY,GAAG"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { existsSync, lstatSync, readFileSync } from 'node:fs';\nimport { dirname, join, relative, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport fastifyCompress from '@fastify/compress';\nimport fastifyCookie from '@fastify/cookie';\nimport fastifyCors, { type FastifyCorsOptions } from '@fastify/cors';\nimport fastifyFormbody from '@fastify/formbody';\nimport fastifyHelmet from '@fastify/helmet';\nimport fastifyStatic from '@fastify/static';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { getEnvFilePath } from '@intlayer/config/env';\nimport { colorize, colorizePath, getAppLogger } from '@intlayer/config/logger';\nimport {\n EDITOR_SERVER_PORT_ENV_VAR,\n getConfiguration,\n getEditorURLForPort,\n} from '@intlayer/config/node';\nimport {\n type BuiltEditorOverride,\n overrideBuiltEditorConfiguration,\n watchBuiltEditorConfiguration,\n} from '@intlayer/engine/build';\nimport { authRouter } from '@routes/auth.routes';\nimport { configurationRouter } from '@routes/config.routes';\nimport { dictionaryRouter } from '@routes/dictionary.routes';\nimport { findAvailablePort } from '@utils/checkPortAvailability';\nimport Fastify, { type FastifyInstance, LogController } from 'fastify';\nimport { intlayer } from 'fastify-intlayer';\nimport mime from 'mime';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst envFileOptions = {\n env: process.env.NODE_ENV,\n envFile: process.env.ENV_FILE,\n};\n\nconst FALLBACK_PORT = 8000;\nconst config = getConfiguration(envFileOptions);\n\nconst appLogger = getAppLogger(config);\n/** Port tried first; the next free one is used when it is taken. */\nconst preferredPort = config.editor.port ?? FALLBACK_PORT;\nconst HOST = '0.0.0.0';\n\n// Load package.json\nconst packageJson = JSON.parse(\n readFileSync(resolve(__dirname, '../../package.json'), 'utf8')\n);\n\nconst app: FastifyInstance = Fastify({\n logController: new LogController({\n disableRequestLogging: true, // Keep logs clean like the original\n }),\n});\n\n// Load internationalization plugin\n// Assuming fastify-intlayer is the Fastify equivalent of express-intlayer\napp.register(intlayer);\n\nconst clientDistPath = resolve(__dirname, '../../client/dist');\n\nconst corsOptions: FastifyCorsOptions = {\n origin: '*',\n credentials: true,\n};\n\nconst startServer = async (app: FastifyInstance) => {\n const port = await findAvailablePort(preferredPort, HOST);\n\n if (port === undefined) {\n appLogger(`Error: Port ${preferredPort} and the next ones are in use.`, {\n level: 'error',\n });\n process.exit(255);\n }\n\n if (port !== preferredPort) {\n appLogger(`Port ${preferredPort} is in use, using port ${port} instead.`, {\n level: 'warn',\n });\n }\n\n // Served by `/api/config`: the client calls the editor at its actual URL\n process.env[EDITOR_SERVER_PORT_ENV_VAR] = String(port);\n\n // Adapted in the built configuration only: the application must load the\n // editor client, and accept messages from the URL the editor is served at\n const editorOverride: BuiltEditorOverride = {\n enabled: true,\n editorURL: getEditorURLForPort(config.editor.editorURL, port),\n };\n const overriddenKeys = await overrideBuiltEditorConfiguration(\n config,\n editorOverride\n );\n\n if (overriddenKeys.length > 0) {\n const overriddenSettings = overriddenKeys.map((key) =>\n colorize(`editor.${key}`, ANSIColors.BLUE)\n );\n\n appLogger(\n `${overriddenSettings.join(' and ')} temporarily adapted in ${colorizePath(relative(config.system.baseDir, config.system.configDir))}. Set it in ${colorizePath('intlayer.config.ts')} to keep it after the next build.`,\n {\n level: 'warn',\n }\n );\n\n // An application (re)started aside rebuilds the configuration without them\n watchBuiltEditorConfiguration(config.system.configDir, {\n loadConfiguration: () =>\n getConfiguration({ ...envFileOptions, cache: false }),\n editorOverride,\n onRestore: () =>\n appLogger(\n `${overriddenSettings.join(' and ')} adapted again in ${colorizePath(relative(config.system.baseDir, config.system.configDir))} after the application rebuilt it.`\n ),\n onError: (error) =>\n appLogger(\n `Failed to keep the editor settings in the built configuration: ${(error as Error).message}`,\n { level: 'warn' }\n ),\n });\n }\n\n // Security Headers\n await app.register(fastifyHelmet, {\n // Only restrict who may frame the editor: itself and IDE webviews (the\n // VS Code extension panel). `X-Frame-Options` cannot list a scheme.\n contentSecurityPolicy: {\n useDefaults: false,\n directives: {\n // Helmet requires a `default-src`; the editor sets no other policy\n defaultSrc:\n fastifyHelmet.contentSecurityPolicy.dangerouslyDisableDefaultSrc,\n frameAncestors: [\n \"'self'\",\n 'vscode-webview:',\n 'vscode-file:',\n 'https://*.vscode-cdn.net',\n 'https://*.vscode-webview.net',\n 'localhost:*',\n 'http://localhost:*',\n 'http://127.0.0.1:*',\n ],\n },\n },\n frameguard: false,\n global: true,\n });\n\n // CORS\n await app.register(fastifyCors, corsOptions);\n\n // Compression\n await app.register(fastifyCompress);\n\n // Cookie Parser\n await app.register(fastifyCookie);\n\n // Parse application/x-www-form-urlencoded\n await app.register(fastifyFormbody);\n\n // Register Routes\n await app.register(dictionaryRouter, { prefix: '/api/dictionary' });\n await app.register(configurationRouter, { prefix: '/api/config' });\n await app.register(authRouter, { prefix: '/api/auth' });\n\n // Serve Static Files\n await app.register(fastifyStatic, {\n root: clientDistPath,\n wildcard: false, // We handle the fallback manually to match SPA logic\n });\n\n // For single-page applications, redirect all unmatched routes to index.html\n app.setNotFoundHandler((req, reply) => {\n const requestedPath = join(clientDistPath, req.raw.url || '/');\n\n if (existsSync(requestedPath) && lstatSync(requestedPath).isFile()) {\n const mimeType =\n mime.getType(requestedPath) ?? 'application/octet-stream';\n reply.header('Content-Type', mimeType);\n return reply.sendFile(req.raw.url?.split('/').pop() || 'index.html');\n } else {\n return reply.sendFile('index.html');\n }\n });\n\n try {\n await app.listen({ port, host: HOST });\n\n const dotEnvFilePath = getEnvFilePath(\n envFileOptions.env,\n envFileOptions.envFile\n );\n\n console.log(`\n ${colorize(colorize('INTLAYER', ANSIColors.BOLD), ANSIColors.GREY_DARK)} ${colorize(`v${packageJson.version}`, ANSIColors.GREY_DARK)}\n\n Editor running at: ${colorizePath(`http://localhost:${port}`)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Watching application at: ${config.editor.applicationURL === '' ? '-' : colorizePath(config.editor.applicationURL)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Access key: ${config.editor.clientId ?? '-'}\n ${colorize('➜', ANSIColors.GREY_DARK)} Environment: ${dotEnvFilePath ?? '-'}\n `);\n } catch (error) {\n // The Fastify logger is disabled, so `app.log` would swallow this\n appLogger(`Failed to start the editor: ${(error as Error).message}`, {\n level: 'error',\n });\n process.exit(\n (error as NodeJS.ErrnoException).code === 'EADDRINUSE' ? 255 : 1\n );\n }\n};\n\n// Start it up!\nstartServer(app);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAM,YAAY,QAAQ,cAAc,YAAY,GAAG,CAAC;AAExD,MAAM,iBAAiB;CACrB;CACA,SAAS,QAAQ,IAAI;AACvB;AAEA,MAAM,gBAAgB;AACtB,MAAM,SAAS,iBAAiB,cAAc;AAE9C,MAAM,YAAY,aAAa,MAAM;;AAErC,MAAM,gBAAgB,OAAO,OAAO,QAAQ;AAC5C,MAAM,OAAO;AAGb,MAAM,cAAc,KAAK,MACvB,aAAa,QAAQ,WAAW,oBAAoB,GAAG,MAAM,CAC/D;AAEA,MAAM,MAAuB,QAAQ,EACnC,eAAe,IAAI,cAAc,EAC/B,uBAAuB,KACzB,CAAC,EACH,CAAC;AAID,IAAI,SAAS,QAAQ;AAErB,MAAM,iBAAiB,QAAQ,WAAW,mBAAmB;AAE7D,MAAM,cAAkC;CACtC,QAAQ;CACR,aAAa;AACf;AAEA,MAAM,cAAc,OAAO,QAAyB;CAClD,MAAM,OAAO,MAAM,kBAAkB,eAAe,IAAI;CAExD,IAAI,SAAS,QAAW;EACtB,UAAU,eAAe,cAAc,iCAAiC,EACtE,OAAO,QACT,CAAC;EACD,QAAQ,KAAK,GAAG;CAClB;CAEA,IAAI,SAAS,eACX,UAAU,QAAQ,cAAc,yBAAyB,KAAK,YAAY,EACxE,OAAO,OACT,CAAC;CAIH,QAAQ,IAAI,8BAA8B,OAAO,I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AAS,eAAe;EAChC,MAAM;EACN,UAAU;CACZ,CAAC;CAGD,IAAI,oBAAoB,KAAK,UAAU;EACrC,MAAM,gBAAgB,KAAK,gBAAgB,IAAI,IAAI,OAAO,GAAG;EAE7D,IAAI,WAAW,aAAa,KAAK,UAAU,aAAa,CAAC,CAAC,OAAO,GAAG;GAClE,MAAM,WACJ,KAAK,QAAQ,aAAa,KAAK;GACjC,MAAM,OAAO,gBAAgB,QAAQ;GACrC,OAAO,MAAM,SAAS,IAAI,IAAI,KAAK,MAAM,GAAG,CAAC,CAAC,IAAI,KAAK,YAAY;EACrE,OACE,OAAO,MAAM,SAAS,YAAY;CAEtC,CAAC;CAED,IAAI;EACF,MAAM,IAAI,OAAO;GAAE;GAAM,MAAM;EAAK,CAAC;EAErC,MAAM,iBAAiB,eACrB,eAAe,KACf,eAAe,OACjB;EAEA,QAAQ,IAAI;MACV,SAAS,SAAS,YAAY,WAAW,IAAI,GAAG,WAAW,SAAS,EAAE,GAAG,SAAS,IAAI,YAAY,WAAW,WAAW,SAAS,EAAE;;mCAEtG,aAAa,oBAAoB,MAAM,EAAE;MACtE,SAAS,KAAK,WAAW,SAAS,EAAE,8BAA8B,OAAO,OAAO,mBAAmB,KAAK,MAAM,aAAa,OAAO,OAAO,cAAc,EAAE;MACzJ,SAAS,KAAK,WAAW,SAAS,EAAE,8BAA8B,OAAO,OAAO,YAAY,IAAI;MAChG,SAAS,KAAK,WAAW,SAAS,EAAE,8BAA8B,kBAAkB,IAAI;KACzF;CACH,SAAS,OAAO;EAEd,UAAU,+BAAgC,MAAgB,WAAW,EACnE,OAAO,QACT,CAAC;EACD,QAAQ,KACL,MAAgC,SAAS,eAAe,MAAM,CACjE;CACF;AACF;AAGA,YAAY,GAAG"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_controllers_auth_controller = require(
|
|
2
|
+
const require_controllers_auth_controller = require("../controllers/auth.controller.cjs");
|
|
3
3
|
let _intlayer_config_node = require("@intlayer/config/node");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/routes/auth.routes.ts
|
|
6
6
|
const { editor } = (0, _intlayer_config_node.getConfiguration)();
|
|
7
7
|
const getBaseURL = () => `${editor.editorURL}/api/auth`;
|
|
8
8
|
const getAuthRoutes = () => ({
|
|
@@ -29,7 +29,6 @@ const authRouter = async (fastify) => {
|
|
|
29
29
|
fastify.post(getAuthRoutes().logout.urlModel, require_controllers_auth_controller.logout);
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
//#endregion
|
|
33
32
|
exports.authRouter = authRouter;
|
|
34
33
|
exports.getAuthRoutes = getAuthRoutes;
|
|
35
34
|
//# sourceMappingURL=auth.routes.cjs.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FastifyInstance } from "fastify";
|
|
2
|
-
//#region src/routes/auth.routes.d.ts
|
|
3
2
|
export declare const getAuthRoutes: () => {
|
|
4
3
|
getEditorAuth: {
|
|
5
4
|
urlModel: string;
|
|
@@ -18,5 +17,4 @@ export declare const getAuthRoutes: () => {
|
|
|
18
17
|
};
|
|
19
18
|
};
|
|
20
19
|
export declare const authRouter: (fastify: FastifyInstance) => Promise<void>;
|
|
21
|
-
//#endregion
|
|
22
20
|
//# sourceMappingURL=auth.routes.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { assertSameOrigin, getEditorAuth, logout, startLogin } from "../controllers/auth.controller.mjs";
|
|
2
2
|
import { getConfiguration } from "@intlayer/config/node";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/routes/auth.routes.ts
|
|
5
5
|
const { editor } = getConfiguration();
|
|
6
6
|
const getBaseURL = () => `${editor.editorURL}/api/auth`;
|
|
7
7
|
const getAuthRoutes = () => ({
|
|
@@ -28,6 +28,5 @@ const authRouter = async (fastify) => {
|
|
|
28
28
|
fastify.post(getAuthRoutes().logout.urlModel, logout);
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
//#endregion
|
|
32
31
|
export { authRouter, getAuthRoutes };
|
|
33
32
|
//# sourceMappingURL=auth.routes.mjs.map
|