intlayer-editor 6.1.6 → 7.0.0-canary.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/intlayer-editor.mjs +6 -5
- package/client/dist/assets/CodeBlockShiki-Da9FdWZC.js +2 -0
- package/client/dist/assets/angular-html-BhtAKmdv.js +1 -0
- package/client/dist/assets/{angular-ts-C26w9mnW.js → angular-ts-BeFqxUEK.js} +1 -1
- package/client/dist/assets/astro-fnUV64w6.js +1 -0
- package/client/dist/assets/{shellscript-Yzrsuije.js → bash-SHvotRv0.js} +1 -1
- package/client/dist/assets/blade-BXHw_pqF.js +1 -0
- package/client/dist/assets/bundle-web-mXNhGq2u.js +13 -0
- package/client/dist/assets/coffee-Bn-gRTwi.js +1 -0
- package/client/dist/assets/{github-dark-DHJKELXO.js → github-dark-nz1Ug7wa.js} +1 -1
- package/client/dist/assets/{github-light-DAi9KRSo.js → github-light-hIqfNsk6.js} +1 -1
- package/client/dist/assets/graphql-DsDBh1Xd.js +1 -0
- package/client/dist/assets/haml-DXac2MKr.js +1 -0
- package/client/dist/assets/handlebars-DGp8LPLW.js +1 -0
- package/client/dist/assets/html-C3HxQsge.js +1 -0
- package/client/dist/assets/html-derivative-BSjB4sSK.js +1 -0
- package/client/dist/assets/http-DCi7G6X5.js +1 -0
- package/client/dist/assets/index-CUWL1CMm.js +329 -0
- package/client/dist/assets/index-DhJQvNNZ.css +1 -0
- package/client/dist/assets/{javascript-BMMyXqK5.js → javascript-Bu8dFlWd.js} +1 -1
- package/client/dist/assets/jinja-DRFn41Dg.js +1 -0
- package/client/dist/assets/jison-D2rCaaX8.js +1 -0
- package/client/dist/assets/{json-Cp-IABpG.js → json-BHNwtY8x.js} +1 -1
- package/client/dist/assets/julia-CKK9Si6J.js +1 -0
- package/client/dist/assets/marko-oTM4hF24.js +1 -0
- package/client/dist/assets/{mdc-DvHMhoCT.js → mdc-CnEUHEQ0.js} +1 -1
- package/client/dist/assets/php-BVkpE1Rs.js +1 -0
- package/client/dist/assets/pug-Cxa3IGBH.js +1 -0
- package/client/dist/assets/svelte-Dn5bEqJ2.js +1 -0
- package/client/dist/assets/ts-tags-o7tE_SiD.js +1 -0
- package/client/dist/assets/{tsx-COt5Ahok.js → tsx-D7BNtDUy.js} +1 -1
- package/client/dist/assets/{typescript-DlfHMoPT.js → typescript-DtkYWpva.js} +1 -1
- package/client/dist/assets/vue-CGSbC7ds.js +1 -0
- package/client/dist/assets/vue-html-2e51hq9W.js +1 -0
- package/client/dist/assets/vue-vine-BIRRuYKM.js +1 -0
- package/client/dist/index.html +2 -2
- package/package.json +80 -84
- package/server/dist/_virtual/rolldown_runtime.cjs +25 -0
- package/server/dist/controllers/configuration.controller.cjs +32 -52
- package/server/dist/controllers/configuration.controller.cjs.map +1 -1
- package/server/dist/controllers/configuration.controller.d.ts +9 -5
- package/server/dist/controllers/configuration.controller.d.ts.map +1 -1
- package/server/dist/controllers/configuration.controller.mjs +30 -30
- package/server/dist/controllers/configuration.controller.mjs.map +1 -1
- package/server/dist/controllers/dictionary.controller.cjs +111 -139
- package/server/dist/controllers/dictionary.controller.cjs.map +1 -1
- package/server/dist/controllers/dictionary.controller.d.ts +17 -14
- package/server/dist/controllers/dictionary.controller.d.ts.map +1 -1
- package/server/dist/controllers/dictionary.controller.mjs +103 -104
- package/server/dist/controllers/dictionary.controller.mjs.map +1 -1
- package/server/dist/export.cjs +6 -25
- package/server/dist/export.d.ts +3 -3
- package/server/dist/export.mjs +4 -3
- package/server/dist/index.cjs +70 -90
- package/server/dist/index.cjs.map +1 -1
- package/server/dist/index.d.ts +1 -2
- package/server/dist/index.mjs +45 -53
- package/server/dist/index.mjs.map +1 -1
- package/server/dist/routes/config.routes.cjs +20 -55
- package/server/dist/routes/config.routes.cjs.map +1 -1
- package/server/dist/routes/config.routes.d.ts +12 -8
- package/server/dist/routes/config.routes.d.ts.map +1 -1
- package/server/dist/routes/config.routes.mjs +12 -16
- package/server/dist/routes/config.routes.mjs.map +1 -1
- package/server/dist/routes/dictionary.routes.cjs +26 -52
- package/server/dist/routes/dictionary.routes.cjs.map +1 -1
- package/server/dist/routes/dictionary.routes.d.ts +17 -13
- package/server/dist/routes/dictionary.routes.d.ts.map +1 -1
- package/server/dist/routes/dictionary.routes.mjs +18 -26
- package/server/dist/routes/dictionary.routes.mjs.map +1 -1
- package/server/dist/types/Routes.cjs +0 -17
- package/server/dist/types/Routes.d.ts +8 -5
- package/server/dist/types/Routes.d.ts.map +1 -1
- package/server/dist/types/Routes.mjs +0 -1
- package/server/dist/utils/checkPortAvailability.cjs +20 -53
- package/server/dist/utils/checkPortAvailability.cjs.map +1 -1
- package/server/dist/utils/checkPortAvailability.d.ts +4 -1
- package/server/dist/utils/checkPortAvailability.d.ts.map +1 -1
- package/server/dist/utils/checkPortAvailability.mjs +17 -18
- package/server/dist/utils/checkPortAvailability.mjs.map +1 -1
- package/server/dist/utils/httpStatusCodes.cjs +400 -92
- package/server/dist/utils/httpStatusCodes.cjs.map +1 -1
- package/server/dist/utils/httpStatusCodes.d.ts +261 -249
- package/server/dist/utils/httpStatusCodes.d.ts.map +1 -1
- package/server/dist/utils/httpStatusCodes.mjs +399 -68
- package/server/dist/utils/httpStatusCodes.mjs.map +1 -1
- package/server/dist/utils/responseData.cjs +30 -71
- package/server/dist/utils/responseData.cjs.map +1 -1
- package/server/dist/utils/responseData.d.ts +73 -50
- package/server/dist/utils/responseData.d.ts.map +1 -1
- package/server/dist/utils/responseData.mjs +27 -44
- package/server/dist/utils/responseData.mjs.map +1 -1
- package/LICENSE +0 -202
- package/client/dist/assets/abap-BdImnpbu.js +0 -1
- package/client/dist/assets/actionscript-3-CfeIJUat.js +0 -1
- package/client/dist/assets/ada-bCR0ucgS.js +0 -1
- package/client/dist/assets/angular-html-Bbf3ZyxA.js +0 -1
- package/client/dist/assets/apache-Pmp26Uib.js +0 -1
- package/client/dist/assets/apex-C7Pw0Ztw.js +0 -1
- package/client/dist/assets/apl-e980N3t4.js +0 -1
- package/client/dist/assets/applescript-Co6uUVPk.js +0 -1
- package/client/dist/assets/ara-BRHolxvo.js +0 -1
- package/client/dist/assets/asciidoc-Dv7Oe6Be.js +0 -1
- package/client/dist/assets/asm-D_Q5rh1f.js +0 -1
- package/client/dist/assets/astro-CjFzhNUq.js +0 -1
- package/client/dist/assets/awk-DMzUqQB5.js +0 -1
- package/client/dist/assets/ballerina-BFfxhgS-.js +0 -1
- package/client/dist/assets/bat-BkioyH1T.js +0 -1
- package/client/dist/assets/beancount-BoKiGodi.js +0 -1
- package/client/dist/assets/berry-D08WgyRC.js +0 -1
- package/client/dist/assets/bibtex-CHM0blh-.js +0 -1
- package/client/dist/assets/bicep-6nHXG8SA.js +0 -1
- package/client/dist/assets/blade-B2ZbN0F_.js +0 -1
- package/client/dist/assets/bsl-BO_Y6i37.js +0 -1
- package/client/dist/assets/cadence-D2CYqzqI.js +0 -1
- package/client/dist/assets/cairo-KRGpt6FW.js +0 -1
- package/client/dist/assets/clarity-CHh-QcGE.js +0 -1
- package/client/dist/assets/clojure-P80f7IUj.js +0 -1
- package/client/dist/assets/cmake-D1j8_8rp.js +0 -1
- package/client/dist/assets/cobol-DwXMNnPA.js +0 -1
- package/client/dist/assets/codeowners-Bp6g37R7.js +0 -1
- package/client/dist/assets/codeql-DsOJ9woJ.js +0 -1
- package/client/dist/assets/coffee-JUOWOZUj.js +0 -1
- package/client/dist/assets/common-lisp-Cg-RD9OK.js +0 -1
- package/client/dist/assets/coq-DkFqJrB1.js +0 -1
- package/client/dist/assets/crystal-DVs0tusA.js +0 -1
- package/client/dist/assets/csharp-CHadp7IV.js +0 -1
- package/client/dist/assets/csv-fuZLfV_i.js +0 -1
- package/client/dist/assets/cue-D82EKSYY.js +0 -1
- package/client/dist/assets/cypher-COkxafJQ.js +0 -1
- package/client/dist/assets/d-85-TOEBH.js +0 -1
- package/client/dist/assets/dart-CF10PKvl.js +0 -1
- package/client/dist/assets/dax-CEL-wOlO.js +0 -1
- package/client/dist/assets/desktop-BmXAJ9_W.js +0 -1
- package/client/dist/assets/diff-D97Zzqfu.js +0 -1
- package/client/dist/assets/docker-BcOcwvcX.js +0 -1
- package/client/dist/assets/dotenv-Da5cRb03.js +0 -1
- package/client/dist/assets/dream-maker-BtqSS_iP.js +0 -1
- package/client/dist/assets/edge-CKszZCnI.js +0 -1
- package/client/dist/assets/elixir-Cc7HHYVZ.js +0 -1
- package/client/dist/assets/elm-DbKCFpqz.js +0 -1
- package/client/dist/assets/emacs-lisp-C9XAeP06.js +0 -1
- package/client/dist/assets/erb-C7QrGF_t.js +0 -1
- package/client/dist/assets/erlang-DsQrWhSR.js +0 -1
- package/client/dist/assets/fennel-BYunw83y.js +0 -1
- package/client/dist/assets/fish-Bl2oy6fF.js +0 -1
- package/client/dist/assets/fluent-C4IJs8-o.js +0 -1
- package/client/dist/assets/fortran-fixed-form-BZjJHVRy.js +0 -1
- package/client/dist/assets/fortran-free-form-D22FLkUw.js +0 -1
- package/client/dist/assets/fsharp-CufqaIoK.js +0 -1
- package/client/dist/assets/gdresource-B7Tvp0Sc.js +0 -1
- package/client/dist/assets/gdscript-DTMYz4Jt.js +0 -1
- package/client/dist/assets/gdshader-DkwncUOv.js +0 -1
- package/client/dist/assets/genie-D0YGMca9.js +0 -1
- package/client/dist/assets/gherkin-DyxjwDmM.js +0 -1
- package/client/dist/assets/git-commit-F4YmCXRG.js +0 -1
- package/client/dist/assets/git-rebase-r7XF79zn.js +0 -1
- package/client/dist/assets/gleam-BspZqrRM.js +0 -1
- package/client/dist/assets/glimmer-js-Dz9X99Cm.js +0 -1
- package/client/dist/assets/glimmer-ts-aQ3p29eY.js +0 -1
- package/client/dist/assets/gnuplot-DdkO51Og.js +0 -1
- package/client/dist/assets/go-Dn2_MT6a.js +0 -1
- package/client/dist/assets/graphql-Caa12_AY.js +0 -1
- package/client/dist/assets/groovy-gcz8RCvz.js +0 -1
- package/client/dist/assets/hack-D_o3P2UH.js +0 -1
- package/client/dist/assets/haml-AZXGPtNI.js +0 -1
- package/client/dist/assets/handlebars-YebKLiTq.js +0 -1
- package/client/dist/assets/haskell-Df6bDoY_.js +0 -1
- package/client/dist/assets/haxe-CzTSHFRz.js +0 -1
- package/client/dist/assets/hcl-BWvSN4gD.js +0 -1
- package/client/dist/assets/hjson-D5-asLiD.js +0 -1
- package/client/dist/assets/hlsl-D3lLCCz7.js +0 -1
- package/client/dist/assets/html-B8pBdPMQ.js +0 -1
- package/client/dist/assets/html-derivative-ZQ8onl8Z.js +0 -1
- package/client/dist/assets/http-C38VWM-o.js +0 -1
- package/client/dist/assets/hxml-Bvhsp5Yf.js +0 -1
- package/client/dist/assets/hy-DFXneXwc.js +0 -1
- package/client/dist/assets/index-BZsb0J9r.css +0 -1
- package/client/dist/assets/index-Dqu0HW5s.js +0 -348
- package/client/dist/assets/ini-BEwlwnbL.js +0 -1
- package/client/dist/assets/jinja-BJmZiE_F.js +0 -1
- package/client/dist/assets/jison-BCRtk9Os.js +0 -1
- package/client/dist/assets/jsonnet-DFQXde-d.js +0 -1
- package/client/dist/assets/jssm-C2t-YnRu.js +0 -1
- package/client/dist/assets/julia-353pQ8cl.js +0 -1
- package/client/dist/assets/kotlin-BdnUsdx6.js +0 -1
- package/client/dist/assets/kusto-BvAqAH-y.js +0 -1
- package/client/dist/assets/latex-CPEt12BK.js +0 -1
- package/client/dist/assets/lean-qliWkHmV.js +0 -1
- package/client/dist/assets/liquid-DFk8BABL.js +0 -1
- package/client/dist/assets/llvm-D32k8WzR.js +0 -1
- package/client/dist/assets/log-2UxHyX5q.js +0 -1
- package/client/dist/assets/logo-BtOb2qkB.js +0 -1
- package/client/dist/assets/lua-BbnMAYS6.js +0 -1
- package/client/dist/assets/luau-CXu1NL6O.js +0 -1
- package/client/dist/assets/make-CHLpvVh8.js +0 -1
- package/client/dist/assets/marko-BM38lbjI.js +0 -1
- package/client/dist/assets/matlab-D7o27uSR.js +0 -1
- package/client/dist/assets/mermaid-DKYwYmdq.js +0 -1
- package/client/dist/assets/mipsasm-CKIfxQSi.js +0 -1
- package/client/dist/assets/mojo-1DNp92w6.js +0 -1
- package/client/dist/assets/move-DNEoBllO.js +0 -1
- package/client/dist/assets/narrat-DRg8JJMk.js +0 -1
- package/client/dist/assets/nextflow-CUEJCptM.js +0 -1
- package/client/dist/assets/nginx-DknmC5AR.js +0 -1
- package/client/dist/assets/nim-BZI_8mFl.js +0 -1
- package/client/dist/assets/nix-BepWV7mh.js +0 -1
- package/client/dist/assets/nushell-ChH_ziBE.js +0 -1
- package/client/dist/assets/objective-c-DXmwc3jG.js +0 -1
- package/client/dist/assets/objective-cpp-CLxacb5B.js +0 -1
- package/client/dist/assets/ocaml-C0hk2d4L.js +0 -1
- package/client/dist/assets/pascal-D93ZcfNL.js +0 -1
- package/client/dist/assets/perl-g0D2lH3a.js +0 -1
- package/client/dist/assets/php-Gk5eUrPQ.js +0 -1
- package/client/dist/assets/plsql-ChMvpjG-.js +0 -1
- package/client/dist/assets/po-BTJTHyun.js +0 -1
- package/client/dist/assets/polar-C0HS_06l.js +0 -1
- package/client/dist/assets/powerquery-CEu0bR-o.js +0 -1
- package/client/dist/assets/powershell-Dpen1YoG.js +0 -1
- package/client/dist/assets/prisma-Dd19v3D-.js +0 -1
- package/client/dist/assets/prolog-CbFg5uaA.js +0 -1
- package/client/dist/assets/proto-DyJlTyXw.js +0 -1
- package/client/dist/assets/pug-Ch9lOoSd.js +0 -1
- package/client/dist/assets/puppet-BMWR74SV.js +0 -1
- package/client/dist/assets/purescript-CklMAg4u.js +0 -1
- package/client/dist/assets/qml-CHzV51_b.js +0 -1
- package/client/dist/assets/qmldir-C8lEn-DE.js +0 -1
- package/client/dist/assets/qss-IeuSbFQv.js +0 -1
- package/client/dist/assets/racket-BqYA7rlc.js +0 -1
- package/client/dist/assets/raku-DXvB9xmW.js +0 -1
- package/client/dist/assets/razor-CNXmhs1n.js +0 -1
- package/client/dist/assets/reg-C-SQnVFl.js +0 -1
- package/client/dist/assets/rel-C3B-1QV4.js +0 -1
- package/client/dist/assets/riscv-BM1_JUlF.js +0 -1
- package/client/dist/assets/rst-DKdxLoXm.js +0 -1
- package/client/dist/assets/ruby-W1VRIm2Q.js +0 -1
- package/client/dist/assets/rust-B1yitclQ.js +0 -1
- package/client/dist/assets/sas-cz2c8ADy.js +0 -1
- package/client/dist/assets/scala-C151Ov-r.js +0 -1
- package/client/dist/assets/scheme-C98Dy4si.js +0 -1
- package/client/dist/assets/sdbl-DVxCFoDh.js +0 -1
- package/client/dist/assets/shaderlab-Dg9Lc6iA.js +0 -1
- package/client/dist/assets/shellsession-BADoaaVG.js +0 -1
- package/client/dist/assets/smalltalk-BERRCDM3.js +0 -1
- package/client/dist/assets/solidity-BbcW6ACK.js +0 -1
- package/client/dist/assets/soy-B_7ge1HE.js +0 -1
- package/client/dist/assets/sparql-rVzFXLq3.js +0 -1
- package/client/dist/assets/splunk-BtCnVYZw.js +0 -1
- package/client/dist/assets/ssh-config-_ykCGR6B.js +0 -1
- package/client/dist/assets/stata-BH5u7GGu.js +0 -1
- package/client/dist/assets/svelte-Dt5jNKfG.js +0 -1
- package/client/dist/assets/swift-Dg5xB15N.js +0 -1
- package/client/dist/assets/system-verilog-CnnmHF94.js +0 -1
- package/client/dist/assets/systemd-4A_iFExJ.js +0 -1
- package/client/dist/assets/talonscript-CkByrt1z.js +0 -1
- package/client/dist/assets/tasl-QIJgUcNo.js +0 -1
- package/client/dist/assets/tcl-dwOrl1Do.js +0 -1
- package/client/dist/assets/templ-0CNLO7il.js +0 -1
- package/client/dist/assets/terraform-BETggiCN.js +0 -1
- package/client/dist/assets/tex-B5i3u9ba.js +0 -1
- package/client/dist/assets/toml-vGWfd6FD.js +0 -1
- package/client/dist/assets/ts-tags-B9XN6NYQ.js +0 -1
- package/client/dist/assets/tsv-B_m7g4N7.js +0 -1
- package/client/dist/assets/turtle-BsS91CYL.js +0 -1
- package/client/dist/assets/twig-B_ULif71.js +0 -1
- package/client/dist/assets/typespec-Df68jz8_.js +0 -1
- package/client/dist/assets/typst-DHCkPAjA.js +0 -1
- package/client/dist/assets/v-DljmTZ5-.js +0 -1
- package/client/dist/assets/vala-CsfeWuGM.js +0 -1
- package/client/dist/assets/vb-D17OF-Vu.js +0 -1
- package/client/dist/assets/verilog-BQ8w6xss.js +0 -1
- package/client/dist/assets/vhdl-CeAyd5Ju.js +0 -1
- package/client/dist/assets/viml-CJc9bBzg.js +0 -1
- package/client/dist/assets/vue-BEetzCYT.js +0 -1
- package/client/dist/assets/vue-html-BsD9fJC1.js +0 -1
- package/client/dist/assets/vue-vine-CCdTUzyM.js +0 -1
- package/client/dist/assets/vyper-CDx5xZoG.js +0 -1
- package/client/dist/assets/wenyan-BV7otONQ.js +0 -1
- package/client/dist/assets/wikitext-BhOHFoWU.js +0 -1
- package/client/dist/assets/wolfram-lXgVvXCa.js +0 -1
- package/client/dist/assets/xsl-CtQFsRM5.js +0 -1
- package/client/dist/assets/zenscript-DVFEvuxE.js +0 -1
- package/client/dist/assets/zig-VOosw3JB.js +0 -1
- package/server/dist/export.cjs.map +0 -1
- package/server/dist/export.d.ts.map +0 -1
- package/server/dist/export.mjs.map +0 -1
- package/server/dist/index.d.ts.map +0 -1
- package/server/dist/types/Routes.cjs.map +0 -1
- package/server/dist/types/Routes.mjs.map +0 -1
package/server/dist/export.cjs
CHANGED
|
@@ -1,25 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
var export_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(export_exports);
|
|
18
|
-
__reExport(export_exports, require('./controllers/configuration.controller.cjs'), module.exports);
|
|
19
|
-
__reExport(export_exports, require('./controllers/dictionary.controller.cjs'), module.exports);
|
|
20
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
21
|
-
0 && (module.exports = {
|
|
22
|
-
...require('./controllers/configuration.controller.cjs'),
|
|
23
|
-
...require('./controllers/dictionary.controller.cjs')
|
|
24
|
-
});
|
|
25
|
-
//# sourceMappingURL=export.cjs.map
|
|
1
|
+
const require_controllers_configuration_controller = require('./controllers/configuration.controller.cjs');
|
|
2
|
+
const require_controllers_dictionary_controller = require('./controllers/dictionary.controller.cjs');
|
|
3
|
+
|
|
4
|
+
exports.getConfiguration = require_controllers_configuration_controller.getConfiguration;
|
|
5
|
+
exports.getDictionaries = require_controllers_dictionary_controller.getDictionaries;
|
|
6
|
+
exports.writeContentDeclaration = require_controllers_dictionary_controller.writeContentDeclaration;
|
package/server/dist/export.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { GetConfigurationResult, getConfiguration } from "./controllers/configuration.controller.js";
|
|
2
|
+
import { WriteContentDeclarationBody, WriteContentDeclarationResult, getDictionaries, writeContentDeclaration } from "./controllers/dictionary.controller.js";
|
|
3
|
+
export { GetConfigurationResult, WriteContentDeclarationBody, WriteContentDeclarationResult, getConfiguration, getDictionaries, writeContentDeclaration };
|
package/server/dist/export.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { getConfiguration } from "./controllers/configuration.controller.mjs";
|
|
2
|
+
import { getDictionaries, writeContentDeclaration } from "./controllers/dictionary.controller.mjs";
|
|
3
|
+
|
|
4
|
+
export { getConfiguration, getDictionaries, writeContentDeclaration };
|
package/server/dist/index.cjs
CHANGED
|
@@ -1,103 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var import_cors = __toESM(require("cors"), 1);
|
|
31
|
-
var import_express = __toESM(require("express"), 1);
|
|
32
|
-
var import_express_intlayer = require("express-intlayer");
|
|
33
|
-
var import_helmet = __toESM(require("helmet"), 1);
|
|
34
|
-
var import_mime = __toESM(require("mime"), 1);
|
|
35
|
-
var import_node_fs = require("node:fs");
|
|
36
|
-
var import_node_path = require("node:path");
|
|
37
|
-
var import_node_url = require("node:url");
|
|
38
|
-
const import_meta = {};
|
|
39
|
-
const __dirname = (0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
1
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_routes_config_routes = require('./routes/config.routes.cjs');
|
|
3
|
+
const require_routes_dictionary_routes = require('./routes/dictionary.routes.cjs');
|
|
4
|
+
const require_utils_checkPortAvailability = require('./utils/checkPortAvailability.cjs');
|
|
5
|
+
let __intlayer_config = require("@intlayer/config");
|
|
6
|
+
__intlayer_config = require_rolldown_runtime.__toESM(__intlayer_config);
|
|
7
|
+
let express_intlayer = require("express-intlayer");
|
|
8
|
+
express_intlayer = require_rolldown_runtime.__toESM(express_intlayer);
|
|
9
|
+
let node_fs = require("node:fs");
|
|
10
|
+
node_fs = require_rolldown_runtime.__toESM(node_fs);
|
|
11
|
+
let node_path = require("node:path");
|
|
12
|
+
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
13
|
+
let node_url = require("node:url");
|
|
14
|
+
node_url = require_rolldown_runtime.__toESM(node_url);
|
|
15
|
+
let express = require("express");
|
|
16
|
+
express = require_rolldown_runtime.__toESM(express);
|
|
17
|
+
let compression = require("compression");
|
|
18
|
+
compression = require_rolldown_runtime.__toESM(compression);
|
|
19
|
+
let cookie_parser = require("cookie-parser");
|
|
20
|
+
cookie_parser = require_rolldown_runtime.__toESM(cookie_parser);
|
|
21
|
+
let cors = require("cors");
|
|
22
|
+
cors = require_rolldown_runtime.__toESM(cors);
|
|
23
|
+
let helmet = require("helmet");
|
|
24
|
+
helmet = require_rolldown_runtime.__toESM(helmet);
|
|
25
|
+
let mime = require("mime");
|
|
26
|
+
mime = require_rolldown_runtime.__toESM(mime);
|
|
27
|
+
|
|
28
|
+
//#region server/src/index.ts
|
|
29
|
+
const __dirname$1 = (0, node_path.dirname)((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
|
|
40
30
|
const envFileOptions = {
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
env: process.env.NODE_ENV,
|
|
32
|
+
envFile: process.env.ENV_FILE
|
|
43
33
|
};
|
|
44
|
-
const packageJson = JSON.parse(
|
|
45
|
-
|
|
46
|
-
);
|
|
47
|
-
const app = (0, import_express.default)();
|
|
48
|
-
app.use((0, import_express_intlayer.intlayer)());
|
|
34
|
+
const packageJson = JSON.parse((0, node_fs.readFileSync)((0, node_path.resolve)(__dirname$1, "../../package.json"), "utf8"));
|
|
35
|
+
const app = (0, express.default)();
|
|
36
|
+
app.use((0, express_intlayer.intlayer)());
|
|
49
37
|
const FALLBACK_PORT = 8e3;
|
|
50
|
-
const config = (0,
|
|
38
|
+
const config = (0, __intlayer_config.getConfiguration)(envFileOptions);
|
|
51
39
|
const port = config.editor.port ?? FALLBACK_PORT;
|
|
52
|
-
const clientDistPath = (0,
|
|
40
|
+
const clientDistPath = (0, node_path.resolve)(__dirname$1, "../../client/dist");
|
|
53
41
|
const corsOptions = {
|
|
54
|
-
|
|
55
|
-
|
|
42
|
+
origin: "*",
|
|
43
|
+
credentials: true
|
|
56
44
|
};
|
|
57
|
-
const startServer = async (
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
res.sendFile((0, import_node_path.resolve)(clientDistPath, "index.html"));
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
app2.listen(port, () => {
|
|
88
|
-
const dotEnvFilePath = (0, import_config.getEnvFilePath)(
|
|
89
|
-
envFileOptions.env,
|
|
90
|
-
envFileOptions.envFile
|
|
91
|
-
);
|
|
92
|
-
console.log(`
|
|
93
|
-
\x1B[1;90mINTLAYER v${packageJson.version}\x1B[0m
|
|
45
|
+
const startServer = async (app$1) => {
|
|
46
|
+
if (!await require_utils_checkPortAvailability.checkPortAvailability(port)) {
|
|
47
|
+
console.error(`\x1b[1;31mError: Port ${port} is already in use.\x1b[0m`);
|
|
48
|
+
process.exit(255);
|
|
49
|
+
}
|
|
50
|
+
app$1.disable("x-powered-by");
|
|
51
|
+
app$1.use((0, helmet.default)({ contentSecurityPolicy: false }));
|
|
52
|
+
app$1.use((0, cors.default)(corsOptions));
|
|
53
|
+
app$1.use((0, compression.default)());
|
|
54
|
+
app$1.use(express.default.json());
|
|
55
|
+
app$1.use((0, cookie_parser.default)());
|
|
56
|
+
app$1.use(express.default.urlencoded({ extended: true }));
|
|
57
|
+
app$1.use("/api/dictionary", require_routes_dictionary_routes.dictionaryRouter);
|
|
58
|
+
app$1.use("/api/config", require_routes_config_routes.configurationRouter);
|
|
59
|
+
app$1.use(express.default.static(clientDistPath));
|
|
60
|
+
app$1.get(/(.*)/, (req, res) => {
|
|
61
|
+
const requestedPath = (0, node_path.join)(clientDistPath, req.url);
|
|
62
|
+
if ((0, node_fs.existsSync)(requestedPath) && (0, node_fs.lstatSync)(requestedPath).isFile()) {
|
|
63
|
+
const mimeType = mime.default.getType(requestedPath) ?? "application/octet-stream";
|
|
64
|
+
res.setHeader("Content-Type", mimeType);
|
|
65
|
+
res.sendFile(requestedPath);
|
|
66
|
+
} else res.sendFile((0, node_path.resolve)(clientDistPath, "index.html"));
|
|
67
|
+
});
|
|
68
|
+
app$1.listen(port, () => {
|
|
69
|
+
const dotEnvFilePath = (0, __intlayer_config.getEnvFilePath)(envFileOptions.env, envFileOptions.envFile);
|
|
70
|
+
console.log(`
|
|
71
|
+
\x1b[1;90mINTLAYER v${packageJson.version}\x1b[0m
|
|
94
72
|
|
|
95
|
-
Editor running at: \
|
|
96
|
-
- Watching application at: ${config.editor.applicationURL === "" ? "-" : `\
|
|
73
|
+
Editor running at: \x1b[90mhttp://localhost:${port}\x1b[0m
|
|
74
|
+
- Watching application at: ${config.editor.applicationURL === "" ? "-" : `\x1b[90m${config.editor.applicationURL}\x1b[0m`}
|
|
97
75
|
- Access key: ${config.editor.clientId ?? "-"}
|
|
98
76
|
- Environment: ${dotEnvFilePath ?? "-"}
|
|
99
77
|
`);
|
|
100
|
-
|
|
78
|
+
});
|
|
101
79
|
};
|
|
102
80
|
startServer(app);
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
103
83
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { getConfiguration, getEnvFilePath } from '@intlayer/config';\nimport { configurationRouter } from '@routes/config.routes';\nimport { dictionaryRouter } from '@routes/dictionary.routes';\nimport { checkPortAvailability } from '@utils/checkPortAvailability';\nimport compression from 'compression';\nimport cookieParser from 'cookie-parser';\nimport cors, { type CorsOptions } from 'cors';\nimport express, { type Express } from 'express';\nimport { intlayer } from 'express-intlayer';\nimport helmet from 'helmet';\nimport mime from 'mime';\
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["__dirname","app: Express","corsOptions: CorsOptions","checkPortAvailability","dictionaryRouter","configurationRouter"],"sources":["../src/index.ts"],"sourcesContent":["import { existsSync, lstatSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { getConfiguration, getEnvFilePath } from '@intlayer/config';\nimport { configurationRouter } from '@routes/config.routes';\nimport { dictionaryRouter } from '@routes/dictionary.routes';\nimport { checkPortAvailability } from '@utils/checkPortAvailability';\nimport compression from 'compression';\nimport cookieParser from 'cookie-parser';\nimport cors, { type CorsOptions } from 'cors';\nimport express, { type Express } from 'express';\nimport { intlayer } from 'express-intlayer';\nimport helmet from 'helmet';\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\n// Load package.json\nconst packageJson = JSON.parse(\n readFileSync(resolve(__dirname, '../../package.json'), 'utf8')\n);\n\nconst app: Express = express();\n\n// Load internationalization request handler\napp.use(intlayer());\n\nconst FALLBACK_PORT = 8000;\nconst config = getConfiguration(envFileOptions);\nconst port = config.editor.port ?? FALLBACK_PORT;\n\nconst clientDistPath = resolve(__dirname, '../../client/dist');\n\nconst corsOptions: CorsOptions = {\n origin: '*',\n credentials: true,\n};\n\nconst startServer = async (app: Express) => {\n const isPortAvailable = await checkPortAvailability(port);\n\n if (!isPortAvailable) {\n console.error(`\\x1b[1;31mError: Port ${port} is already in use.\\x1b[0m`);\n process.exit(255);\n }\n\n app.disable('x-powered-by'); // Disabled to prevent attackers from knowing that the app is running Express\n app.use(\n helmet({\n contentSecurityPolicy: false,\n })\n );\n\n app.use(cors(corsOptions));\n\n // Compress all HTTP responses\n app.use(compression());\n\n app.use(express.json());\n\n app.use(cookieParser());\n\n // Parse incoming requests with urlencoded payloads\n app.use(express.urlencoded({ extended: true }));\n\n app.use('/api/dictionary', dictionaryRouter);\n app.use('/api/config', configurationRouter);\n\n app.use(express.static(clientDistPath));\n\n // For single-page applications, redirect all unmatched routes to index.html\n app.get(/(.*)/, (req, res) => {\n const requestedPath = join(clientDistPath, req.url); // Full path of the requested file\n\n if (existsSync(requestedPath) && lstatSync(requestedPath).isFile()) {\n // If the requested file exists, determine its MIME type and serve it\n const mimeType =\n mime.getType(requestedPath) ?? 'application/octet-stream';\n res.setHeader('Content-Type', mimeType);\n res.sendFile(requestedPath);\n } else {\n // Otherwise, serve the index.html for React Router fallback\n res.sendFile(resolve(clientDistPath, 'index.html'));\n }\n });\n\n app.listen(port, () => {\n const dotEnvFilePath = getEnvFilePath(\n envFileOptions.env,\n envFileOptions.envFile\n );\n\n console.log(`\n \\x1b[1;90mINTLAYER v${packageJson.version}\\x1b[0m\n\n Editor running at: \\x1b[90mhttp://localhost:${port}\\x1b[0m\n - Watching application at: ${config.editor.applicationURL === '' ? '-' : `\\x1b[90m${config.editor.applicationURL}\\x1b[0m`}\n - Access key: ${config.editor.clientId ?? '-'}\n - Environment: ${dotEnvFilePath ?? '-'}\n `);\n });\n};\n\n// Start it up!\nstartServer(app);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,MAAMA,+GAAkD,CAAC;AAEzD,MAAM,iBAAiB;CACrB,KAAK,QAAQ,IAAI;CACjB,SAAS,QAAQ,IAAI;CACtB;AAGD,MAAM,cAAc,KAAK,uDACFA,aAAW,qBAAqB,EAAE,OAAO,CAC/D;AAED,MAAMC,4BAAwB;AAG9B,IAAI,oCAAc,CAAC;AAEnB,MAAM,gBAAgB;AACtB,MAAM,iDAA0B,eAAe;AAC/C,MAAM,OAAO,OAAO,OAAO,QAAQ;AAEnC,MAAM,wCAAyBD,aAAW,oBAAoB;AAE9D,MAAME,cAA2B;CAC/B,QAAQ;CACR,aAAa;CACd;AAED,MAAM,cAAc,OAAO,UAAiB;AAG1C,KAAI,CAFoB,MAAMC,0DAAsB,KAAK,EAEnC;AACpB,UAAQ,MAAM,yBAAyB,KAAK,4BAA4B;AACxE,UAAQ,KAAK,IAAI;;AAGnB,OAAI,QAAQ,eAAe;AAC3B,OAAI,wBACK,EACL,uBAAuB,OACxB,CAAC,CACH;AAED,OAAI,sBAAS,YAAY,CAAC;AAG1B,OAAI,8BAAiB,CAAC;AAEtB,OAAI,IAAI,gBAAQ,MAAM,CAAC;AAEvB,OAAI,gCAAkB,CAAC;AAGvB,OAAI,IAAI,gBAAQ,WAAW,EAAE,UAAU,MAAM,CAAC,CAAC;AAE/C,OAAI,IAAI,mBAAmBC,kDAAiB;AAC5C,OAAI,IAAI,eAAeC,iDAAoB;AAE3C,OAAI,IAAI,gBAAQ,OAAO,eAAe,CAAC;AAGvC,OAAI,IAAI,SAAS,KAAK,QAAQ;EAC5B,MAAM,oCAAqB,gBAAgB,IAAI,IAAI;AAEnD,8BAAe,cAAc,2BAAc,cAAc,CAAC,QAAQ,EAAE;GAElE,MAAM,WACJ,aAAK,QAAQ,cAAc,IAAI;AACjC,OAAI,UAAU,gBAAgB,SAAS;AACvC,OAAI,SAAS,cAAc;QAG3B,KAAI,gCAAiB,gBAAgB,aAAa,CAAC;GAErD;AAEF,OAAI,OAAO,YAAY;EACrB,MAAM,uDACJ,eAAe,KACf,eAAe,QAChB;AAED,UAAQ,IAAI;0BACU,YAAY,QAAQ;;2DAEa,KAAK;kCAC9B,OAAO,OAAO,mBAAmB,KAAK,MAAM,WAAW,OAAO,OAAO,eAAe,SAAS;kCAC7F,OAAO,OAAO,YAAY,IAAI;kCAC9B,kBAAkB,IAAI;MAClD;GACF;;AAIJ,YAAY,IAAI"}
|
package/server/dist/index.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export { };
|
package/server/dist/index.mjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { getConfiguration, getEnvFilePath } from "@intlayer/config";
|
|
2
1
|
import { configurationRouter } from "./routes/config.routes.mjs";
|
|
3
2
|
import { dictionaryRouter } from "./routes/dictionary.routes.mjs";
|
|
4
3
|
import { checkPortAvailability } from "./utils/checkPortAvailability.mjs";
|
|
4
|
+
import { getConfiguration, getEnvFilePath } from "@intlayer/config";
|
|
5
|
+
import { intlayer } from "express-intlayer";
|
|
6
|
+
import { existsSync, lstatSync, readFileSync } from "node:fs";
|
|
7
|
+
import { dirname, join, resolve } from "node:path";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
import express from "express";
|
|
5
10
|
import compression from "compression";
|
|
6
11
|
import cookieParser from "cookie-parser";
|
|
7
12
|
import cors from "cors";
|
|
8
|
-
import express from "express";
|
|
9
|
-
import { intlayer } from "express-intlayer";
|
|
10
13
|
import helmet from "helmet";
|
|
11
14
|
import mime from "mime";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import { fileURLToPath } from "node:url";
|
|
15
|
+
|
|
16
|
+
//#region server/src/index.ts
|
|
15
17
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
16
18
|
const envFileOptions = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
env: "development",
|
|
20
|
+
envFile: process.env.ENV_FILE
|
|
19
21
|
};
|
|
20
|
-
const packageJson = JSON.parse(
|
|
21
|
-
readFileSync(resolve(__dirname, "../../package.json"), "utf8")
|
|
22
|
-
);
|
|
22
|
+
const packageJson = JSON.parse(readFileSync(resolve(__dirname, "../../package.json"), "utf8"));
|
|
23
23
|
const app = express();
|
|
24
24
|
app.use(intlayer());
|
|
25
25
|
const FALLBACK_PORT = 8e3;
|
|
@@ -27,53 +27,45 @@ const config = getConfiguration(envFileOptions);
|
|
|
27
27
|
const port = config.editor.port ?? FALLBACK_PORT;
|
|
28
28
|
const clientDistPath = resolve(__dirname, "../../client/dist");
|
|
29
29
|
const corsOptions = {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
origin: "*",
|
|
31
|
+
credentials: true
|
|
32
32
|
};
|
|
33
|
-
const startServer = async (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
res.sendFile(resolve(clientDistPath, "index.html"));
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
app2.listen(port, () => {
|
|
64
|
-
const dotEnvFilePath = getEnvFilePath(
|
|
65
|
-
envFileOptions.env,
|
|
66
|
-
envFileOptions.envFile
|
|
67
|
-
);
|
|
68
|
-
console.log(`
|
|
69
|
-
\x1B[1;90mINTLAYER v${packageJson.version}\x1B[0m
|
|
33
|
+
const startServer = async (app$1) => {
|
|
34
|
+
if (!await checkPortAvailability(port)) {
|
|
35
|
+
console.error(`\x1b[1;31mError: Port ${port} is already in use.\x1b[0m`);
|
|
36
|
+
process.exit(255);
|
|
37
|
+
}
|
|
38
|
+
app$1.disable("x-powered-by");
|
|
39
|
+
app$1.use(helmet({ contentSecurityPolicy: false }));
|
|
40
|
+
app$1.use(cors(corsOptions));
|
|
41
|
+
app$1.use(compression());
|
|
42
|
+
app$1.use(express.json());
|
|
43
|
+
app$1.use(cookieParser());
|
|
44
|
+
app$1.use(express.urlencoded({ extended: true }));
|
|
45
|
+
app$1.use("/api/dictionary", dictionaryRouter);
|
|
46
|
+
app$1.use("/api/config", configurationRouter);
|
|
47
|
+
app$1.use(express.static(clientDistPath));
|
|
48
|
+
app$1.get(/(.*)/, (req, res) => {
|
|
49
|
+
const requestedPath = join(clientDistPath, req.url);
|
|
50
|
+
if (existsSync(requestedPath) && lstatSync(requestedPath).isFile()) {
|
|
51
|
+
const mimeType = mime.getType(requestedPath) ?? "application/octet-stream";
|
|
52
|
+
res.setHeader("Content-Type", mimeType);
|
|
53
|
+
res.sendFile(requestedPath);
|
|
54
|
+
} else res.sendFile(resolve(clientDistPath, "index.html"));
|
|
55
|
+
});
|
|
56
|
+
app$1.listen(port, () => {
|
|
57
|
+
const dotEnvFilePath = getEnvFilePath(envFileOptions.env, envFileOptions.envFile);
|
|
58
|
+
console.log(`
|
|
59
|
+
\x1b[1;90mINTLAYER v${packageJson.version}\x1b[0m
|
|
70
60
|
|
|
71
|
-
Editor running at: \
|
|
72
|
-
- Watching application at: ${config.editor.applicationURL === "" ? "-" : `\
|
|
61
|
+
Editor running at: \x1b[90mhttp://localhost:${port}\x1b[0m
|
|
62
|
+
- Watching application at: ${config.editor.applicationURL === "" ? "-" : `\x1b[90m${config.editor.applicationURL}\x1b[0m`}
|
|
73
63
|
- Access key: ${config.editor.clientId ?? "-"}
|
|
74
64
|
- Environment: ${dotEnvFilePath ?? "-"}
|
|
75
65
|
`);
|
|
76
|
-
|
|
66
|
+
});
|
|
77
67
|
};
|
|
78
68
|
startServer(app);
|
|
69
|
+
|
|
70
|
+
//#endregion
|
|
79
71
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { getConfiguration, getEnvFilePath } from '@intlayer/config';\nimport { configurationRouter } from '@routes/config.routes';\nimport { dictionaryRouter } from '@routes/dictionary.routes';\nimport { checkPortAvailability } from '@utils/checkPortAvailability';\nimport compression from 'compression';\nimport cookieParser from 'cookie-parser';\nimport cors, { type CorsOptions } from 'cors';\nimport express, { type Express } from 'express';\nimport { intlayer } from 'express-intlayer';\nimport helmet from 'helmet';\nimport mime from 'mime';\
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["app: Express","corsOptions: CorsOptions"],"sources":["../src/index.ts"],"sourcesContent":["import { existsSync, lstatSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { getConfiguration, getEnvFilePath } from '@intlayer/config';\nimport { configurationRouter } from '@routes/config.routes';\nimport { dictionaryRouter } from '@routes/dictionary.routes';\nimport { checkPortAvailability } from '@utils/checkPortAvailability';\nimport compression from 'compression';\nimport cookieParser from 'cookie-parser';\nimport cors, { type CorsOptions } from 'cors';\nimport express, { type Express } from 'express';\nimport { intlayer } from 'express-intlayer';\nimport helmet from 'helmet';\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\n// Load package.json\nconst packageJson = JSON.parse(\n readFileSync(resolve(__dirname, '../../package.json'), 'utf8')\n);\n\nconst app: Express = express();\n\n// Load internationalization request handler\napp.use(intlayer());\n\nconst FALLBACK_PORT = 8000;\nconst config = getConfiguration(envFileOptions);\nconst port = config.editor.port ?? FALLBACK_PORT;\n\nconst clientDistPath = resolve(__dirname, '../../client/dist');\n\nconst corsOptions: CorsOptions = {\n origin: '*',\n credentials: true,\n};\n\nconst startServer = async (app: Express) => {\n const isPortAvailable = await checkPortAvailability(port);\n\n if (!isPortAvailable) {\n console.error(`\\x1b[1;31mError: Port ${port} is already in use.\\x1b[0m`);\n process.exit(255);\n }\n\n app.disable('x-powered-by'); // Disabled to prevent attackers from knowing that the app is running Express\n app.use(\n helmet({\n contentSecurityPolicy: false,\n })\n );\n\n app.use(cors(corsOptions));\n\n // Compress all HTTP responses\n app.use(compression());\n\n app.use(express.json());\n\n app.use(cookieParser());\n\n // Parse incoming requests with urlencoded payloads\n app.use(express.urlencoded({ extended: true }));\n\n app.use('/api/dictionary', dictionaryRouter);\n app.use('/api/config', configurationRouter);\n\n app.use(express.static(clientDistPath));\n\n // For single-page applications, redirect all unmatched routes to index.html\n app.get(/(.*)/, (req, res) => {\n const requestedPath = join(clientDistPath, req.url); // Full path of the requested file\n\n if (existsSync(requestedPath) && lstatSync(requestedPath).isFile()) {\n // If the requested file exists, determine its MIME type and serve it\n const mimeType =\n mime.getType(requestedPath) ?? 'application/octet-stream';\n res.setHeader('Content-Type', mimeType);\n res.sendFile(requestedPath);\n } else {\n // Otherwise, serve the index.html for React Router fallback\n res.sendFile(resolve(clientDistPath, 'index.html'));\n }\n });\n\n app.listen(port, () => {\n const dotEnvFilePath = getEnvFilePath(\n envFileOptions.env,\n envFileOptions.envFile\n );\n\n console.log(`\n \\x1b[1;90mINTLAYER v${packageJson.version}\\x1b[0m\n\n Editor running at: \\x1b[90mhttp://localhost:${port}\\x1b[0m\n - Watching application at: ${config.editor.applicationURL === '' ? '-' : `\\x1b[90m${config.editor.applicationURL}\\x1b[0m`}\n - Access key: ${config.editor.clientId ?? '-'}\n - Environment: ${dotEnvFilePath ?? '-'}\n `);\n });\n};\n\n// Start it up!\nstartServer(app);\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,MAAM,YAAY,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;AAEzD,MAAM,iBAAiB;CACrB;CACA,SAAS,QAAQ,IAAI;CACtB;AAGD,MAAM,cAAc,KAAK,MACvB,aAAa,QAAQ,WAAW,qBAAqB,EAAE,OAAO,CAC/D;AAED,MAAMA,MAAe,SAAS;AAG9B,IAAI,IAAI,UAAU,CAAC;AAEnB,MAAM,gBAAgB;AACtB,MAAM,SAAS,iBAAiB,eAAe;AAC/C,MAAM,OAAO,OAAO,OAAO,QAAQ;AAEnC,MAAM,iBAAiB,QAAQ,WAAW,oBAAoB;AAE9D,MAAMC,cAA2B;CAC/B,QAAQ;CACR,aAAa;CACd;AAED,MAAM,cAAc,OAAO,UAAiB;AAG1C,KAAI,CAFoB,MAAM,sBAAsB,KAAK,EAEnC;AACpB,UAAQ,MAAM,yBAAyB,KAAK,4BAA4B;AACxE,UAAQ,KAAK,IAAI;;AAGnB,OAAI,QAAQ,eAAe;AAC3B,OAAI,IACF,OAAO,EACL,uBAAuB,OACxB,CAAC,CACH;AAED,OAAI,IAAI,KAAK,YAAY,CAAC;AAG1B,OAAI,IAAI,aAAa,CAAC;AAEtB,OAAI,IAAI,QAAQ,MAAM,CAAC;AAEvB,OAAI,IAAI,cAAc,CAAC;AAGvB,OAAI,IAAI,QAAQ,WAAW,EAAE,UAAU,MAAM,CAAC,CAAC;AAE/C,OAAI,IAAI,mBAAmB,iBAAiB;AAC5C,OAAI,IAAI,eAAe,oBAAoB;AAE3C,OAAI,IAAI,QAAQ,OAAO,eAAe,CAAC;AAGvC,OAAI,IAAI,SAAS,KAAK,QAAQ;EAC5B,MAAM,gBAAgB,KAAK,gBAAgB,IAAI,IAAI;AAEnD,MAAI,WAAW,cAAc,IAAI,UAAU,cAAc,CAAC,QAAQ,EAAE;GAElE,MAAM,WACJ,KAAK,QAAQ,cAAc,IAAI;AACjC,OAAI,UAAU,gBAAgB,SAAS;AACvC,OAAI,SAAS,cAAc;QAG3B,KAAI,SAAS,QAAQ,gBAAgB,aAAa,CAAC;GAErD;AAEF,OAAI,OAAO,YAAY;EACrB,MAAM,iBAAiB,eACrB,eAAe,KACf,eAAe,QAChB;AAED,UAAQ,IAAI;0BACU,YAAY,QAAQ;;2DAEa,KAAK;kCAC9B,OAAO,OAAO,mBAAmB,KAAK,MAAM,WAAW,OAAO,OAAO,eAAe,SAAS;kCAC7F,OAAO,OAAO,YAAY,IAAI;kCAC9B,kBAAkB,IAAI;MAClD;GACF;;AAIJ,YAAY,IAAI"}
|
|
@@ -1,57 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
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
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var config_routes_exports = {};
|
|
30
|
-
__export(config_routes_exports, {
|
|
31
|
-
configurationRouter: () => configurationRouter,
|
|
32
|
-
getConfigurationRoutes: () => getConfigurationRoutes
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(config_routes_exports);
|
|
35
|
-
var configurationController = __toESM(require('./../controllers/configuration.controller.cjs'), 1);
|
|
36
|
-
var import_config = require("@intlayer/config");
|
|
37
|
-
var import_express = require("express");
|
|
38
|
-
const configurationRouter = (0, import_express.Router)();
|
|
39
|
-
const { editor } = (0, import_config.getConfiguration)();
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_controllers_configuration_controller = require('../controllers/configuration.controller.cjs');
|
|
3
|
+
let __intlayer_config = require("@intlayer/config");
|
|
4
|
+
__intlayer_config = require_rolldown_runtime.__toESM(__intlayer_config);
|
|
5
|
+
let express = require("express");
|
|
6
|
+
express = require_rolldown_runtime.__toESM(express);
|
|
7
|
+
|
|
8
|
+
//#region server/src/routes/config.routes.ts
|
|
9
|
+
const configurationRouter = (0, express.Router)();
|
|
10
|
+
const { editor } = (0, __intlayer_config.getConfiguration)();
|
|
40
11
|
const getBaseURL = () => `${editor.editorURL}/api/dictionary`;
|
|
41
|
-
const getConfigurationRoutes = () => ({
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
);
|
|
52
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
-
0 && (module.exports = {
|
|
54
|
-
configurationRouter,
|
|
55
|
-
getConfigurationRoutes
|
|
56
|
-
});
|
|
12
|
+
const getConfigurationRoutes = () => ({ getConfiguration: {
|
|
13
|
+
urlModel: "/",
|
|
14
|
+
url: getBaseURL(),
|
|
15
|
+
method: "GET"
|
|
16
|
+
} });
|
|
17
|
+
configurationRouter.get(getConfigurationRoutes().getConfiguration.urlModel, require_controllers_configuration_controller.getConfiguration);
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
exports.configurationRouter = configurationRouter;
|
|
21
|
+
exports.getConfigurationRoutes = getConfigurationRoutes;
|
|
57
22
|
//# sourceMappingURL=config.routes.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/routes/config.routes.ts"],"sourcesContent":["import * as configurationController from '@controllers/configuration.controller';\nimport { getConfiguration } from '@intlayer/config';\nimport { Router } from 'express';\nimport type { Routes } from '@/types/Routes';\n\nexport const configurationRouter: Router = Router();\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getConfigurationRoutes = () =>\n ({\n getConfiguration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n }) satisfies Routes;\n\nconfigurationRouter.get(\n getConfigurationRoutes().getConfiguration.urlModel,\n configurationController.getConfiguration\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.routes.cjs","names":["configurationRouter: Router"],"sources":["../../src/routes/config.routes.ts"],"sourcesContent":["import * as configurationController from '@controllers/configuration.controller';\nimport { getConfiguration } from '@intlayer/config';\nimport { Router } from 'express';\nimport type { Routes } from '@/types/Routes';\n\nexport const configurationRouter: Router = Router();\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getConfigurationRoutes = () =>\n ({\n getConfiguration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n }) satisfies Routes;\n\nconfigurationRouter.get(\n getConfigurationRoutes().getConfiguration.urlModel,\n configurationController.getConfiguration\n);\n"],"mappings":";;;;;;;;AAKA,MAAaA,2CAAsC;AAEnD,MAAM,EAAE,oDAA6B;AAErC,MAAM,mBAAmB,GAAG,OAAO,UAAU;AAE7C,MAAa,gCACV,EACC,kBAAkB;CAChB,UAAU;CACV,KAAK,YAAY;CACjB,QAAQ;CACT,EACF;AAEH,oBAAoB,IAClB,wBAAwB,CAAC,iBAAiB,wEAE3C"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { Router } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { Router } from "express";
|
|
2
|
+
|
|
3
|
+
//#region server/src/routes/config.routes.d.ts
|
|
4
|
+
declare const configurationRouter: Router;
|
|
5
|
+
declare const getConfigurationRoutes: () => {
|
|
6
|
+
getConfiguration: {
|
|
7
|
+
urlModel: string;
|
|
8
|
+
url: string;
|
|
9
|
+
method: "GET";
|
|
10
|
+
};
|
|
9
11
|
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { configurationRouter, getConfigurationRoutes };
|
|
10
14
|
//# sourceMappingURL=config.routes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.routes.d.ts","
|
|
1
|
+
{"version":3,"file":"config.routes.d.ts","names":[],"sources":["../../src/routes/config.routes.ts"],"sourcesContent":[],"mappings":";;;cAKa,qBAAqB;cAMrB;EANA,gBAAA,EAAA;IAMA,QAAA,EAAA,MAAA"}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getConfiguration as getConfiguration$1 } from "../controllers/configuration.controller.mjs";
|
|
2
2
|
import { getConfiguration } from "@intlayer/config";
|
|
3
3
|
import { Router } from "express";
|
|
4
|
+
|
|
5
|
+
//#region server/src/routes/config.routes.ts
|
|
4
6
|
const configurationRouter = Router();
|
|
5
7
|
const { editor } = getConfiguration();
|
|
6
8
|
const getBaseURL = () => `${editor.editorURL}/api/dictionary`;
|
|
7
|
-
const getConfigurationRoutes = () => ({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
configurationController.getConfiguration
|
|
17
|
-
);
|
|
18
|
-
export {
|
|
19
|
-
configurationRouter,
|
|
20
|
-
getConfigurationRoutes
|
|
21
|
-
};
|
|
9
|
+
const getConfigurationRoutes = () => ({ getConfiguration: {
|
|
10
|
+
urlModel: "/",
|
|
11
|
+
url: getBaseURL(),
|
|
12
|
+
method: "GET"
|
|
13
|
+
} });
|
|
14
|
+
configurationRouter.get(getConfigurationRoutes().getConfiguration.urlModel, getConfiguration$1);
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { configurationRouter, getConfigurationRoutes };
|
|
22
18
|
//# sourceMappingURL=config.routes.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/routes/config.routes.ts"],"sourcesContent":["import * as configurationController from '@controllers/configuration.controller';\nimport { getConfiguration } from '@intlayer/config';\nimport { Router } from 'express';\nimport type { Routes } from '@/types/Routes';\n\nexport const configurationRouter: Router = Router();\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getConfigurationRoutes = () =>\n ({\n getConfiguration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n }) satisfies Routes;\n\nconfigurationRouter.get(\n getConfigurationRoutes().getConfiguration.urlModel,\n configurationController.getConfiguration\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.routes.mjs","names":["configurationRouter: Router","configurationController.getConfiguration"],"sources":["../../src/routes/config.routes.ts"],"sourcesContent":["import * as configurationController from '@controllers/configuration.controller';\nimport { getConfiguration } from '@intlayer/config';\nimport { Router } from 'express';\nimport type { Routes } from '@/types/Routes';\n\nexport const configurationRouter: Router = Router();\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getConfigurationRoutes = () =>\n ({\n getConfiguration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n }) satisfies Routes;\n\nconfigurationRouter.get(\n getConfigurationRoutes().getConfiguration.urlModel,\n configurationController.getConfiguration\n);\n"],"mappings":";;;;;AAKA,MAAaA,sBAA8B,QAAQ;AAEnD,MAAM,EAAE,WAAW,kBAAkB;AAErC,MAAM,mBAAmB,GAAG,OAAO,UAAU;AAE7C,MAAa,gCACV,EACC,kBAAkB;CAChB,UAAU;CACV,KAAK,YAAY;CACjB,QAAQ;CACT,EACF;AAEH,oBAAoB,IAClB,wBAAwB,CAAC,iBAAiB,UAC1CC,mBACD"}
|