@frangoteam/fuxa-min 1.1.19
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/LICENSE +21 -0
- package/README.md +41 -0
- package/_images/Pipes/P1.svg +39 -0
- package/_images/Tanks/Fl.svg +7 -0
- package/api/alarms/index.js +132 -0
- package/api/auth/index.js +71 -0
- package/api/command/index.js +187 -0
- package/api/daq/index.js +79 -0
- package/api/diagnose/index.js +163 -0
- package/api/index.js +181 -0
- package/api/jwt-helper.js +106 -0
- package/api/plugins/index.js +109 -0
- package/api/projects/index.js +229 -0
- package/api/resources/index.js +118 -0
- package/api/scripts/index.js +82 -0
- package/api/users/index.js +109 -0
- package/dist/3rdpartylicenses.txt +1477 -0
- package/dist/Quicksand-Bold.071154c292aef0b8.woff +0 -0
- package/dist/Quicksand-Bold.6383d6475ed5c40f.woff2 +0 -0
- package/dist/Quicksand-Bold.f07d467887f9cfab.ttf +0 -0
- package/dist/Quicksand-Medium.0982a651e8d4315f.woff +0 -0
- package/dist/Quicksand-Medium.9d2733fbfb9b1be8.ttf +0 -0
- package/dist/Quicksand-Medium.b09302365c586eb2.woff2 +0 -0
- package/dist/Quicksand-Regular.16adf9eecd267273.woff +0 -0
- package/dist/Quicksand-Regular.78819724f6aeff59.woff2 +0 -0
- package/dist/Quicksand-Regular.8829564f0e14bf76.ttf +0 -0
- package/dist/assets/fonts/icomoon.eot +0 -0
- package/dist/assets/fonts/icomoon.svg +19 -0
- package/dist/assets/fonts/icomoon.ttf +0 -0
- package/dist/assets/fonts/icomoon.woff +0 -0
- package/dist/assets/fonts/myicons.eot +0 -0
- package/dist/assets/fonts/myicons.svg +19 -0
- package/dist/assets/fonts/myicons.ttf +0 -0
- package/dist/assets/fonts/myicons.woff +0 -0
- package/dist/assets/fonts/quicksand-bold/Quicksand-Bold.ttf +0 -0
- package/dist/assets/fonts/quicksand-bold/Quicksand-Bold.woff +0 -0
- package/dist/assets/fonts/quicksand-bold/Quicksand-Bold.woff2 +0 -0
- package/dist/assets/fonts/quicksand-medium/Quicksand-Medium.ttf +0 -0
- package/dist/assets/fonts/quicksand-medium/Quicksand-Medium.woff +0 -0
- package/dist/assets/fonts/quicksand-medium/Quicksand-Medium.woff2 +0 -0
- package/dist/assets/fonts/quicksand-regular/Quicksand-Regular.ttf +0 -0
- package/dist/assets/fonts/quicksand-regular/Quicksand-Regular.woff +0 -0
- package/dist/assets/fonts/quicksand-regular/Quicksand-Regular.woff2 +0 -0
- package/dist/assets/fonts/roboto-bold/roboto-bold-webfont.svg +10486 -0
- package/dist/assets/fonts/roboto-bold/roboto-bold-webfont.ttf +0 -0
- package/dist/assets/fonts/roboto-bold/roboto-bold-webfont.woff +0 -0
- package/dist/assets/fonts/roboto-bold/roboto-bold-webfont.woff2 +0 -0
- package/dist/assets/fonts/roboto-light/roboto-light-webfont.svg +9998 -0
- package/dist/assets/fonts/roboto-light/roboto-light-webfont.ttf +0 -0
- package/dist/assets/fonts/roboto-light/roboto-light-webfont.woff +0 -0
- package/dist/assets/fonts/roboto-light/roboto-light-webfont.woff2 +0 -0
- package/dist/assets/fonts/roboto-medium/roboto-medium-webfont.svg +10487 -0
- package/dist/assets/fonts/roboto-medium/roboto-medium-webfont.ttf +0 -0
- package/dist/assets/fonts/roboto-medium/roboto-medium-webfont.woff +0 -0
- package/dist/assets/fonts/roboto-medium/roboto-medium-webfont.woff2 +0 -0
- package/dist/assets/fonts/roboto-regular/roboto-regular-webfont.svg +10004 -0
- package/dist/assets/fonts/roboto-regular/roboto-regular-webfont.ttf +0 -0
- package/dist/assets/fonts/roboto-regular/roboto-regular-webfont.woff +0 -0
- package/dist/assets/fonts/roboto-regular/roboto-regular-webfont.woff2 +0 -0
- package/dist/assets/fonts/roboto-thin/roboto-thin-webfont.svg +10012 -0
- package/dist/assets/fonts/roboto-thin/roboto-thin-webfont.ttf +0 -0
- package/dist/assets/fonts/roboto-thin/roboto-thin-webfont.woff +0 -0
- package/dist/assets/fonts/roboto-thin/roboto-thin-webfont.woff2 +0 -0
- package/dist/assets/i18n/de.json +1308 -0
- package/dist/assets/i18n/en.json +1438 -0
- package/dist/assets/i18n/es.json +777 -0
- package/dist/assets/i18n/fr.json +1129 -0
- package/dist/assets/i18n/ko.json +774 -0
- package/dist/assets/i18n/pt.json +657 -0
- package/dist/assets/i18n/ru.json +1228 -0
- package/dist/assets/i18n/tr.json +673 -0
- package/dist/assets/i18n/ua.json +614 -0
- package/dist/assets/i18n/zh-cn.json +1252 -0
- package/dist/assets/images/align-bottom.svg +88 -0
- package/dist/assets/images/align-center.svg +86 -0
- package/dist/assets/images/align-left.svg +86 -0
- package/dist/assets/images/align-middle.svg +88 -0
- package/dist/assets/images/align-right.svg +88 -0
- package/dist/assets/images/align-top.svg +88 -0
- package/dist/assets/images/bag.svg +115 -0
- package/dist/assets/images/button.svg +22 -0
- package/dist/assets/images/chart.svg +17 -0
- package/dist/assets/images/circle.svg +84 -0
- package/dist/assets/images/compressor-a.svg +2 -0
- package/dist/assets/images/editvalue.svg +14 -0
- package/dist/assets/images/ellipse.svg +84 -0
- package/dist/assets/images/flip-orizontal.svg +86 -0
- package/dist/assets/images/flip-vertical.svg +82 -0
- package/dist/assets/images/gauge-donut.png +0 -0
- package/dist/assets/images/gauge-mat.png +0 -0
- package/dist/assets/images/gauge-zone.png +0 -0
- package/dist/assets/images/graphbar.svg +18 -0
- package/dist/assets/images/group.svg +91 -0
- package/dist/assets/images/iframe.svg +54 -0
- package/dist/assets/images/image.svg +95 -0
- package/dist/assets/images/led-circle.svg +77 -0
- package/dist/assets/images/line.svg +86 -0
- package/dist/assets/images/linecap-butt.svg +77 -0
- package/dist/assets/images/linecap-round.svg +77 -0
- package/dist/assets/images/linecap-square.svg +82 -0
- package/dist/assets/images/linejoin-bevel.svg +77 -0
- package/dist/assets/images/linejoin-miter.svg +77 -0
- package/dist/assets/images/linejoin-round.svg +77 -0
- package/dist/assets/images/logo.svg +18 -0
- package/dist/assets/images/path.svg +100 -0
- package/dist/assets/images/pencil.svg +98 -0
- package/dist/assets/images/pipe.svg +15 -0
- package/dist/assets/images/progress-v.svg +79 -0
- package/dist/assets/images/rect.svg +84 -0
- package/dist/assets/images/select-pointer.svg +93 -0
- package/dist/assets/images/selectvalue.svg +14 -0
- package/dist/assets/images/semaphore.svg +19 -0
- package/dist/assets/images/slider.svg +17 -0
- package/dist/assets/images/switch.svg +15 -0
- package/dist/assets/images/table.svg +55 -0
- package/dist/assets/images/text.svg +294 -0
- package/dist/assets/images/to-bottom.svg +163 -0
- package/dist/assets/images/to-path.svg +94 -0
- package/dist/assets/images/to-top.svg +163 -0
- package/dist/assets/images/to_top.svg +88 -0
- package/dist/assets/images/todelete.svg +13 -0
- package/dist/assets/images/ungroup.svg +108 -0
- package/dist/assets/images/value.svg +81 -0
- package/dist/assets/images/valve-a.svg +2 -0
- package/dist/assets/images/webcam.svg +16 -0
- package/dist/assets/lib/ext-styles.css +28 -0
- package/dist/assets/lib/gauge/gauge.js +988 -0
- package/dist/assets/lib/gauge/gauge.min.js +1 -0
- package/dist/assets/lib/nouislider/nouislider.min.css +1 -0
- package/dist/assets/lib/nouislider/nouislider.min.js +1 -0
- package/dist/assets/lib/numeral/locales.min.js +7 -0
- package/dist/assets/lib/numeral/numeral.min.js +8 -0
- package/dist/assets/lib/pdfkit-table/index.js +967 -0
- package/dist/assets/lib/svg/raphael.min.js +1 -0
- package/dist/assets/lib/svg/svg.js +5573 -0
- package/dist/assets/lib/svg/svg.min.js +13 -0
- package/dist/assets/lib/svgeditor/extensions/ext-bundle.min.js +1 -0
- package/dist/assets/lib/svgeditor/extensions/ext-html_button.min.css +1 -0
- package/dist/assets/lib/svgeditor/fuxa-editor.min.js +23 -0
- package/dist/assets/lib/svgeditor/jquery-plugin.min.css +2 -0
- package/dist/assets/lib/svgeditor/jquery-plugin.min.js +52 -0
- package/dist/assets/lib/svgeditor/jquery-ui-1.8.17.custom.min.js +54 -0
- package/dist/assets/lib/svgeditor/jquery.min.js +4 -0
- package/dist/assets/lib/svgeditor/shapes/ape-shapes.js +39 -0
- package/dist/assets/lib/svgeditor/shapes/img/agitator-disc.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/agitator-paddle.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/agitator-prop.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/agitator-turbo.svg +19 -0
- package/dist/assets/lib/svgeditor/shapes/img/anim-eli.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/anim-piston.svg +14 -0
- package/dist/assets/lib/svgeditor/shapes/img/centrifugal.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/centrifugal1.svg +67 -0
- package/dist/assets/lib/svgeditor/shapes/img/centrifuge1.svg +67 -0
- package/dist/assets/lib/svgeditor/shapes/img/centrifuge2.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/centrifuge3.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/centrifuge4.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/compair.svg +92 -0
- package/dist/assets/lib/svgeditor/shapes/img/compdiaph.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/compejector.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/compreci.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/compreci2.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/compressor-fan.svg +18 -0
- package/dist/assets/lib/svgeditor/shapes/img/compressor-piston.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/compressor-void.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/compring.svg +72 -0
- package/dist/assets/lib/svgeditor/shapes/img/compring2.svg +72 -0
- package/dist/assets/lib/svgeditor/shapes/img/comprotary.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/comprotary2.svg +18 -0
- package/dist/assets/lib/svgeditor/shapes/img/compscrew.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/compsilence.svg +20 -0
- package/dist/assets/lib/svgeditor/shapes/img/compturbo.svg +72 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher1.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher2.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher3.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher4.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher5.svg +18 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher6.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher7.svg +21 -0
- package/dist/assets/lib/svgeditor/shapes/img/diaph.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/drier1.svg +63 -0
- package/dist/assets/lib/svgeditor/shapes/img/drier2.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/drier3.svg +23 -0
- package/dist/assets/lib/svgeditor/shapes/img/drier4.svg +18 -0
- package/dist/assets/lib/svgeditor/shapes/img/drier5.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger-filter.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger-heat.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger-tube.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger1.svg +67 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger2.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger3.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger4.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger5.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger6.svg +71 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger7.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger8.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger9.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/feeder.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/feeder2.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/feeder3.svg +63 -0
- package/dist/assets/lib/svgeditor/shapes/img/filter2.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/filter3.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting1.svg +67 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting10.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting11.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting12.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting13.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting2.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting3.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting4.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting5.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting6.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting7.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting8.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting9.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc1.svg +75 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc2.svg +71 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc3.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc4.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc5.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc6.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc7.svg +64 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc8.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/motor-simb.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/nozzle.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/nozzle2.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi1.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi2.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi3.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi4.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi5.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi6.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi7.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpblower.svg +76 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpcentri1.svg +64 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpcentri2.svg +64 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpfeed.svg +64 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpgear.svg +18 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpgear2.svg +19 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumphidra.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumphorizo.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpjet.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpperis.svg +20 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpscreew.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpscreew2.svg +72 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpturbi.svg +64 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpvacuum.svg +72 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-arrow.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-circle.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-circleindi.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-cloud.svg +63 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-cone.svg +71 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-corner.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-cross.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-cylinder.svg +71 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-delay.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-diamond.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-display.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-docu.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-doublearrow.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-drop.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-halfcircle.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-heart.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-looplimit.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-maninput.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-nosymbol.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-octagon.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-offpage.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-or.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-or2.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-parallelogram.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-pentagon.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-poval.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-prepara.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-rectangle.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-rectindi.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-star4.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-switch.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-tape.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-tee.svg +63 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-ticket.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-trape.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-triangle.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-vor.svg +14 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank1.svg +63 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank2.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank3.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank4.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank5.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank6.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank7.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank8.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank9.svg +21 -0
- package/dist/assets/lib/svgeditor/shapes/img/valve-ax.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/valve-bx.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/valve-cx.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/webcam.svg +6 -0
- package/dist/assets/lib/svgeditor/shapes/my-shapes.js +178 -0
- package/dist/assets/lib/svgeditor/shapes/proc-comp-shapes.js +105 -0
- package/dist/assets/lib/svgeditor/shapes/proc-general-shapes.js +60 -0
- package/dist/assets/lib/svgeditor/shapes/proc-pumps-shapes.js +112 -0
- package/dist/assets/lib/svgeditor/shapes/proc-shapes.js +606 -0
- package/dist/assets/lib/svgeditor/shapes/shapes.js +30 -0
- package/dist/assets/lib/svgeditor/svg-editor.min.css +1 -0
- package/dist/assets/lib/uplot/placement.min.js +2 -0
- package/dist/assets/project.demo.fuxap +1 -0
- package/dist/favicon.ico +0 -0
- package/dist/icomoon.86abfb46e057ade8.eot +0 -0
- package/dist/icomoon.c1f8b59bad308d66.woff +0 -0
- package/dist/icomoon.ce427f75e21963af.ttf +0 -0
- package/dist/icomoon.dfb0a89feb346906.svg +19 -0
- package/dist/index.html +50 -0
- package/dist/logo.0e8e64e69250a450.svg +18 -0
- package/dist/main.a356f552d9838b9e.js +1 -0
- package/dist/material-icons-outlined.78a93b2079680a08.woff +0 -0
- package/dist/material-icons-outlined.f86cb7b0aa53f0fe.woff2 +0 -0
- package/dist/material-icons-round.92dc7ca2f4c591e7.woff +0 -0
- package/dist/material-icons-round.b10ec9db5b7fbc74.woff2 +0 -0
- package/dist/material-icons-sharp.3885863ee4746422.woff2 +0 -0
- package/dist/material-icons-sharp.a71cb2bf66c604de.woff +0 -0
- package/dist/material-icons-two-tone.588d63134de807a7.woff +0 -0
- package/dist/material-icons-two-tone.675bd578bd14533e.woff2 +0 -0
- package/dist/material-icons.4ad034d2c499d9b6.woff +0 -0
- package/dist/material-icons.59322316b3fd6063.woff2 +0 -0
- package/dist/polyfills.2696a6f9dc75535e.js +1 -0
- package/dist/roboto-bold-webfont.29ac6158e35aee95.woff +0 -0
- package/dist/roboto-bold-webfont.568ab1fa3f154a77.svg +10486 -0
- package/dist/roboto-bold-webfont.6bcfbdc216b3bc78.woff2 +0 -0
- package/dist/roboto-bold-webfont.7c22a4dfdee2ff33.ttf +0 -0
- package/dist/roboto-light-webfont.13492ec56771eeee.svg +9998 -0
- package/dist/roboto-light-webfont.61fa26c99b07ac83.woff2 +0 -0
- package/dist/roboto-light-webfont.95295ce84942d8ce.ttf +0 -0
- package/dist/roboto-light-webfont.ae19119a2889dfdf.woff +0 -0
- package/dist/roboto-medium-webfont.30344f0411888055.woff +0 -0
- package/dist/roboto-medium-webfont.57fb00cab0317d2d.woff2 +0 -0
- package/dist/roboto-medium-webfont.a40869e060a388c0.ttf +0 -0
- package/dist/roboto-medium-webfont.ea02241c29620c02.svg +10487 -0
- package/dist/roboto-regular-webfont.2b0501b72f5a94d5.ttf +0 -0
- package/dist/roboto-regular-webfont.2ce0ba9a06424965.svg +10004 -0
- package/dist/roboto-regular-webfont.ae47f6f1292d196f.woff2 +0 -0
- package/dist/roboto-regular-webfont.f58066a2d9061006.woff +0 -0
- package/dist/roboto-thin-webfont.0a64479870f676e8.ttf +0 -0
- package/dist/roboto-thin-webfont.0f7221f5c7e972ef.woff2 +0 -0
- package/dist/roboto-thin-webfont.51b221e22714b1fe.svg +10012 -0
- package/dist/roboto-thin-webfont.dac941649dd4eac0.woff +0 -0
- package/dist/runtime.8ef63094e52a66ba.js +1 -0
- package/dist/scripts.1c3385254ff4c93c.js +1 -0
- package/dist/styles.cf8e3cf50d039a5c.css +1 -0
- package/fuxa.js +39 -0
- package/main.js +381 -0
- package/package.json +68 -0
- package/paths.js +44 -0
- package/project.default.json +11 -0
- package/project.demo.fuxap +1 -0
- package/runtime/alarms/alarmstorage.js +205 -0
- package/runtime/alarms/index.js +678 -0
- package/runtime/devices/bacnet/index.js +730 -0
- package/runtime/devices/device-utils.js +95 -0
- package/runtime/devices/device.js +551 -0
- package/runtime/devices/ethernetip/index.js +381 -0
- package/runtime/devices/fuxaserver/index.js +310 -0
- package/runtime/devices/httprequest/index.js +495 -0
- package/runtime/devices/index.js +489 -0
- package/runtime/devices/modbus/datatypes.js +122 -0
- package/runtime/devices/modbus/index.js +730 -0
- package/runtime/devices/mqtt/index.js +618 -0
- package/runtime/devices/odbc/index.js +408 -0
- package/runtime/devices/opcua/index.js +817 -0
- package/runtime/devices/s7/datatypes.js +88 -0
- package/runtime/devices/s7/index.js +702 -0
- package/runtime/devices/template/index.js +141 -0
- package/runtime/events.js +33 -0
- package/runtime/index.js +559 -0
- package/runtime/jobs/cleaner.js +74 -0
- package/runtime/jobs/fonts/LICENSE.txt +202 -0
- package/runtime/jobs/fonts/Roboto-Black.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-BlackItalic.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-Bold.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-BoldItalic.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-Italic.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-Light.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-LightItalic.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-Medium.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-MediumItalic.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-Regular.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-Thin.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-ThinItalic.ttf +0 -0
- package/runtime/jobs/helper/image-generator.js +82 -0
- package/runtime/jobs/index.js +214 -0
- package/runtime/jobs/report.js +353 -0
- package/runtime/logger.js +113 -0
- package/runtime/notificator/index.js +383 -0
- package/runtime/notificator/notifystorage.js +179 -0
- package/runtime/plugins/index.js +255 -0
- package/runtime/project/index.js +959 -0
- package/runtime/project/prjstorage.js +222 -0
- package/runtime/scripts/index.js +313 -0
- package/runtime/scripts/msm.js +146 -0
- package/runtime/storage/calculator.js +227 -0
- package/runtime/storage/daqstorage.js +188 -0
- package/runtime/storage/influxdb/index.js +240 -0
- package/runtime/storage/sqlite/currentstorage.js +144 -0
- package/runtime/storage/sqlite/index.js +695 -0
- package/runtime/storage/tdengine/index.js +106 -0
- package/runtime/users/index.js +123 -0
- package/runtime/users/usrstorage.js +201 -0
- package/runtime/utils.js +284 -0
- package/screenshot/feature-action-move.gif +0 -0
- package/screenshot/fuxa-ani.gif +0 -0
- package/screenshot/fuxa-device.gif +0 -0
- package/screenshot/fuxa-editor.png +0 -0
- package/screenshot/fuxa-hmi.gif +0 -0
- package/screenshot/fuxa-home.png +0 -0
- package/screenshot/fuxa-test.gif +0 -0
- package/settings.default.js +65 -0
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 'api/project': Project API to GET/POST project data
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
var express = require("express");
|
|
6
|
+
const authJwt = require('../jwt-helper');
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
const path = require('path');
|
|
9
|
+
|
|
10
|
+
var runtime;
|
|
11
|
+
var secureFnc;
|
|
12
|
+
var checkGroupsFnc;
|
|
13
|
+
|
|
14
|
+
module.exports = {
|
|
15
|
+
init: function (_runtime, _secureFnc, _checkGroupsFnc) {
|
|
16
|
+
runtime = _runtime;
|
|
17
|
+
secureFnc = _secureFnc;
|
|
18
|
+
checkGroupsFnc = _checkGroupsFnc;
|
|
19
|
+
},
|
|
20
|
+
app: function () {
|
|
21
|
+
var prjApp = express();
|
|
22
|
+
prjApp.use(function(req,res,next) {
|
|
23
|
+
if (!runtime.project) {
|
|
24
|
+
res.status(404).end();
|
|
25
|
+
} else {
|
|
26
|
+
next();
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* GET Project data
|
|
32
|
+
* Take from project storage and reply
|
|
33
|
+
*/
|
|
34
|
+
prjApp.get("/api/project", secureFnc, function(req, res) {
|
|
35
|
+
var groups = checkGroupsFnc(req);
|
|
36
|
+
runtime.project.getProject(req.userId, groups).then(result => {
|
|
37
|
+
// res.header("Access-Control-Allow-Origin", "*");
|
|
38
|
+
// res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
|
39
|
+
if (result) {
|
|
40
|
+
res.json(result);
|
|
41
|
+
} else {
|
|
42
|
+
res.status(404).end();
|
|
43
|
+
runtime.logger.error("api get project: Not Found!");
|
|
44
|
+
}
|
|
45
|
+
}).catch(function(err) {
|
|
46
|
+
if (err && err.code) {
|
|
47
|
+
if (err.code !== 'ERR_HTTP_HEADERS_SENT') {
|
|
48
|
+
res.status(400).json({error:err.code, message: err.message});
|
|
49
|
+
runtime.logger.error("api get project: " + err.message);
|
|
50
|
+
}
|
|
51
|
+
} else {
|
|
52
|
+
res.status(400).json({error:"unexpected_error", message: err});
|
|
53
|
+
runtime.logger.error("api get project: " + err);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* POST Project data
|
|
60
|
+
* Set to project storage
|
|
61
|
+
*/
|
|
62
|
+
prjApp.post("/api/project", secureFnc, function(req, res, next) {
|
|
63
|
+
var groups = checkGroupsFnc(req);
|
|
64
|
+
if (res.statusCode === 403) {
|
|
65
|
+
runtime.logger.error("api post project: Tocken Expired");
|
|
66
|
+
} else if (authJwt.adminGroups.indexOf(groups) === -1 ) {
|
|
67
|
+
res.status(401).json({error:"unauthorized_error", message: "Unauthorized!"});
|
|
68
|
+
runtime.logger.error("api post project: Unauthorized");
|
|
69
|
+
} else {
|
|
70
|
+
runtime.project.setProject(req.body).then(function(data) {
|
|
71
|
+
runtime.restart(true).then(function(result) {
|
|
72
|
+
res.end();
|
|
73
|
+
});
|
|
74
|
+
}).catch(function(err) {
|
|
75
|
+
if (err && err.code) {
|
|
76
|
+
res.status(400).json({error:err.code, message: err.message});
|
|
77
|
+
runtime.logger.error("api post project: " + err.message);
|
|
78
|
+
} else {
|
|
79
|
+
res.status(400).json({error:"unexpected_error", message: err});
|
|
80
|
+
runtime.logger.error("api post project: " + err);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* POST Single Project data
|
|
88
|
+
* Set the value (general/view/device/...) to project storage
|
|
89
|
+
*/
|
|
90
|
+
prjApp.post("/api/projectData", secureFnc, function(req, res, next) {
|
|
91
|
+
var groups = checkGroupsFnc(req);
|
|
92
|
+
if (res.statusCode === 403) {
|
|
93
|
+
runtime.logger.error("api post projectData: Tocken Expired");
|
|
94
|
+
} else if (authJwt.adminGroups.indexOf(groups) === -1 ) {
|
|
95
|
+
res.status(401).json({error:"unauthorized_error", message: "Unauthorized!"});
|
|
96
|
+
runtime.logger.error("api post projectData: Unauthorized");
|
|
97
|
+
} else {
|
|
98
|
+
runtime.project.setProjectData(req.body.cmd, req.body.data).then(setres => {
|
|
99
|
+
runtime.update(req.body.cmd, req.body.data).then(result => {
|
|
100
|
+
res.end();
|
|
101
|
+
});
|
|
102
|
+
}).catch(function(err) {
|
|
103
|
+
if (err && err.code) {
|
|
104
|
+
res.status(400).json({error:err.code, message: err.message});
|
|
105
|
+
runtime.logger.error("api post projectData: " + err.message);
|
|
106
|
+
} else {
|
|
107
|
+
res.status(400).json({error:"unexpected_error", message: err});
|
|
108
|
+
runtime.logger.error("api post projectData: " + err);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* GET Project demo data
|
|
116
|
+
* Take the project demo file from server folder
|
|
117
|
+
*/
|
|
118
|
+
prjApp.get("/api/projectdemo", secureFnc, function (req, res) {
|
|
119
|
+
const data = runtime.project.getProjectDemo();
|
|
120
|
+
// res.header("Access-Control-Allow-Origin", "*");
|
|
121
|
+
// res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
|
122
|
+
if (data) {
|
|
123
|
+
res.json(data);
|
|
124
|
+
} else {
|
|
125
|
+
res.status(404).end();
|
|
126
|
+
runtime.logger.error("api get project: Not Found!");
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* GET Device property like security
|
|
132
|
+
* Take from project storage and reply
|
|
133
|
+
*/
|
|
134
|
+
prjApp.get("/api/device", secureFnc, function(req, res) {
|
|
135
|
+
var groups = checkGroupsFnc(req);
|
|
136
|
+
if (res.statusCode === 403) {
|
|
137
|
+
runtime.logger.error("api get device: Tocken Expired");
|
|
138
|
+
} else if (authJwt.adminGroups.indexOf(groups) === -1 ) {
|
|
139
|
+
res.status(401).json({error:"unauthorized_error", message: "Unauthorized!"});
|
|
140
|
+
runtime.logger.error("api get device: Unauthorized");
|
|
141
|
+
} else {
|
|
142
|
+
runtime.project.getDeviceProperty(req.query).then(result => {
|
|
143
|
+
// res.header("Access-Control-Allow-Origin", "*");
|
|
144
|
+
// res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
|
145
|
+
if (result) {
|
|
146
|
+
res.json(result);
|
|
147
|
+
} else {
|
|
148
|
+
res.end();
|
|
149
|
+
}
|
|
150
|
+
}).catch(function(err) {
|
|
151
|
+
if (err && err.code) {
|
|
152
|
+
res.status(400).json({error:err.code, message: err.message});
|
|
153
|
+
runtime.logger.error("api get device: " + err.message);
|
|
154
|
+
} else {
|
|
155
|
+
res.status(400).json({error:"unexpected_error", message: err});
|
|
156
|
+
runtime.logger.error("api get device: " + err);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* POST Device property
|
|
164
|
+
* Set to project storage
|
|
165
|
+
*/
|
|
166
|
+
prjApp.post("/api/device", secureFnc, function(req, res, next) {
|
|
167
|
+
var groups = checkGroupsFnc(req);
|
|
168
|
+
if (res.statusCode === 403) {
|
|
169
|
+
runtime.logger.error("api post device: Tocken Expired");
|
|
170
|
+
} else if (authJwt.adminGroups.indexOf(groups) === -1 ) {
|
|
171
|
+
res.status(401).json({error:"unauthorized_error", message: "Unauthorized!"});
|
|
172
|
+
runtime.logger.error("api post device: Unauthorized");
|
|
173
|
+
} else {
|
|
174
|
+
runtime.project.setDeviceProperty(req.body.params).then(function(data) {
|
|
175
|
+
res.end();
|
|
176
|
+
}).catch(function(err) {
|
|
177
|
+
if (err && err.code) {
|
|
178
|
+
res.status(400).json({error:err.code, message: err.message});
|
|
179
|
+
runtime.logger.error("api post device: " + err.message);
|
|
180
|
+
} else {
|
|
181
|
+
res.status(400).json({error:"unexpected_error", message: err});
|
|
182
|
+
runtime.logger.error("api post device: " + err);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* POST Upload file resource
|
|
190
|
+
* images will be in media file saved
|
|
191
|
+
*/
|
|
192
|
+
prjApp.post('/api/upload', function (req, res) {
|
|
193
|
+
const file = req.body.resource;
|
|
194
|
+
const destination = req.body.destination;
|
|
195
|
+
try {
|
|
196
|
+
let basedata = file.data;
|
|
197
|
+
let encoding = {};
|
|
198
|
+
// let basedata = file.data.replace(/^data:.*,/, '');
|
|
199
|
+
// let basedata = file.data.replace(/^data:image\/png;base64,/, "");
|
|
200
|
+
let fileName = file.name.replace(new RegExp('../', 'g'), '');
|
|
201
|
+
if (file.type !== 'svg') {
|
|
202
|
+
basedata = file.data.replace(/^data:.*,/, '');
|
|
203
|
+
encoding = {encoding: 'base64'};
|
|
204
|
+
}
|
|
205
|
+
var filePath = path.join(runtime.settings.uploadFileDir, fileName);
|
|
206
|
+
if (destination) {
|
|
207
|
+
const destinationDir = path.resolve(runtime.settings.appDir, `_${destination}`);
|
|
208
|
+
if (!fs.existsSync(destinationDir)) {
|
|
209
|
+
fs.mkdirSync(destinationDir);
|
|
210
|
+
}
|
|
211
|
+
filePath = path.join(destinationDir, fileName);
|
|
212
|
+
}
|
|
213
|
+
fs.writeFileSync(filePath, basedata, encoding);
|
|
214
|
+
let result = {'location': '/' + runtime.settings.httpUploadFileStatic + '/' + fileName };
|
|
215
|
+
res.json(result);
|
|
216
|
+
} catch (err) {
|
|
217
|
+
if (err && err.code) {
|
|
218
|
+
res.status(400).json({error: err.code, message: err.message});
|
|
219
|
+
runtime.logger.error("api upload: " + err.message);
|
|
220
|
+
} else {
|
|
221
|
+
res.status(400).json({error:"unexpected_error", message: err});
|
|
222
|
+
runtime.logger.error("api upload: " + err);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
return prjApp;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 'api/resources': Diagnose API to GET resources: images
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
var express = require("express");
|
|
8
|
+
const authJwt = require('../jwt-helper');
|
|
9
|
+
const Report = require('../../runtime/jobs/report');
|
|
10
|
+
|
|
11
|
+
var runtime;
|
|
12
|
+
var secureFnc;
|
|
13
|
+
var checkGroupsFnc;
|
|
14
|
+
|
|
15
|
+
module.exports = {
|
|
16
|
+
init: function (_runtime, _secureFnc, _checkGroupsFnc) {
|
|
17
|
+
runtime = _runtime;
|
|
18
|
+
secureFnc = _secureFnc;
|
|
19
|
+
checkGroupsFnc = _checkGroupsFnc;
|
|
20
|
+
},
|
|
21
|
+
app: function () {
|
|
22
|
+
var resourcesApp = express();
|
|
23
|
+
resourcesApp.use(function (req, res, next) {
|
|
24
|
+
if (!runtime.project) {
|
|
25
|
+
res.status(404).end();
|
|
26
|
+
} else {
|
|
27
|
+
next();
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* GET Server logs folder content
|
|
33
|
+
*/
|
|
34
|
+
resourcesApp.get('/api/resources/images', secureFnc, function (req, res) {
|
|
35
|
+
var groups = checkGroupsFnc(req);
|
|
36
|
+
if (res.statusCode === 403) {
|
|
37
|
+
runtime.logger.error("api get resources/images: Tocken Expired");
|
|
38
|
+
} else if (authJwt.adminGroups.indexOf(groups) === -1) {
|
|
39
|
+
res.status(401).json({ error: "unauthorized_error", message: "Unauthorized!" });
|
|
40
|
+
runtime.logger.error("api get resources/images: Unauthorized!");
|
|
41
|
+
} else {
|
|
42
|
+
try {
|
|
43
|
+
var result = {...req.query, ...{ groups: [] }};
|
|
44
|
+
var resourcesDirs = getDirectories(runtime.settings.imagesFileDir);
|
|
45
|
+
for (var i = 0; i < resourcesDirs.length; i++) {
|
|
46
|
+
var group = { name: resourcesDirs[i], items: [] };
|
|
47
|
+
var dirPath = path.resolve(runtime.settings.imagesFileDir, resourcesDirs[i]);
|
|
48
|
+
var wwwSubDir = path.join('_images', resourcesDirs[i]);
|
|
49
|
+
var files = getFiles(dirPath, ['.jpg','.jpeg', '.png', '.gif', '.svg']);
|
|
50
|
+
for (var x = 0; x < files.length; x++) {
|
|
51
|
+
var filename = files[x].replace(/\.[^\/.]+$/, '');
|
|
52
|
+
group.items.push({ path: path.join(wwwSubDir, files[x]).split(path.sep).join(path.posix.sep), name: filename });
|
|
53
|
+
}
|
|
54
|
+
result.groups.push(group);
|
|
55
|
+
}
|
|
56
|
+
res.json(result);
|
|
57
|
+
} catch (err) {
|
|
58
|
+
if (err.code) {
|
|
59
|
+
res.status(400).json({ error: err.code, message: err.message });
|
|
60
|
+
} else {
|
|
61
|
+
res.status(400).json({ error: "unexpected_error", message: err.toString() });
|
|
62
|
+
}
|
|
63
|
+
runtime.logger.error("api get resources/images: " + err.message);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* GET svg/canvas rendered and converted to image
|
|
70
|
+
*/
|
|
71
|
+
resourcesApp.get('/api/resources/generateImage', secureFnc, function (req, res) {
|
|
72
|
+
var groups = checkGroupsFnc(req);
|
|
73
|
+
if (res.statusCode === 403) {
|
|
74
|
+
runtime.logger.error("api get resources/generateImage: Tocken Expired");
|
|
75
|
+
} else if (authJwt.adminGroups.indexOf(groups) === -1) {
|
|
76
|
+
res.status(401).json({ error: "unauthorized_error", message: "Unauthorized!" });
|
|
77
|
+
runtime.logger.error("api get resources/generateImage: Unauthorized!");
|
|
78
|
+
} else {
|
|
79
|
+
try {
|
|
80
|
+
var query = JSON.parse(req.query.param);
|
|
81
|
+
const report = Report.create(null, runtime);
|
|
82
|
+
report.getChartImage(query).then((content) => {
|
|
83
|
+
res.end(content.toString('base64'));
|
|
84
|
+
}).catch(function (err) {
|
|
85
|
+
if (err.code) {
|
|
86
|
+
res.status(400).json({ error: err.code, message: err.message });
|
|
87
|
+
} else {
|
|
88
|
+
res.status(400).json({ error: "unexpected_error", message: err.toString() });
|
|
89
|
+
}
|
|
90
|
+
runtime.logger.error("createImage: " + err.message);
|
|
91
|
+
});
|
|
92
|
+
} catch (err) {
|
|
93
|
+
if (err.code) {
|
|
94
|
+
res.status(400).json({ error: err.code, message: err.message });
|
|
95
|
+
} else {
|
|
96
|
+
res.status(400).json({ error: "unexpected_error", message: err.toString() });
|
|
97
|
+
}
|
|
98
|
+
runtime.logger.error("api get resources/generateImage: " + err.message);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
return resourcesApp;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function getDirectories (pathDir) {
|
|
108
|
+
const directoriesInDIrectory = fs.readdirSync(pathDir, { withFileTypes: true })
|
|
109
|
+
.filter((item) => item.isDirectory())
|
|
110
|
+
.map((item) => item.name);
|
|
111
|
+
return directoriesInDIrectory;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function getFiles (pathDir, extensions) {
|
|
115
|
+
const filesInDIrectory = fs.readdirSync(pathDir)
|
|
116
|
+
.filter((item) => extensions.indexOf(path.extname(item).toLowerCase()) !== -1);
|
|
117
|
+
return filesInDIrectory;
|
|
118
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 'api/scripts': Scripts API to POST run script
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
var express = require("express");
|
|
8
|
+
const authJwt = require('../jwt-helper');
|
|
9
|
+
var runtime;
|
|
10
|
+
var secureFnc;
|
|
11
|
+
var checkGroupsFnc;
|
|
12
|
+
|
|
13
|
+
module.exports = {
|
|
14
|
+
init: function (_runtime, _secureFnc, _checkGroupsFnc) {
|
|
15
|
+
runtime = _runtime;
|
|
16
|
+
secureFnc = _secureFnc;
|
|
17
|
+
checkGroupsFnc = _checkGroupsFnc;
|
|
18
|
+
},
|
|
19
|
+
app: function () {
|
|
20
|
+
var scriptsApp = express();
|
|
21
|
+
scriptsApp.use(function (req, res, next) {
|
|
22
|
+
if (!runtime.project) {
|
|
23
|
+
res.status(404).end();
|
|
24
|
+
} else {
|
|
25
|
+
next();
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* POST runscript
|
|
31
|
+
* Run script, can be call with script id or script content as test
|
|
32
|
+
*/
|
|
33
|
+
scriptsApp.post("/api/runscript", secureFnc, function (req, res, next) {
|
|
34
|
+
var groups = checkGroupsFnc(req);
|
|
35
|
+
if (res.statusCode === 403) {
|
|
36
|
+
runtime.logger.error("api post runscript: Tocken Expired");
|
|
37
|
+
} else if (!runtime.scriptsMgr.isAuthorised(req.body.params.script, groups)) {
|
|
38
|
+
res.status(401).json({ error: "unauthorized_error", message: "Unauthorized!" });
|
|
39
|
+
runtime.logger.error("api post runscript: Unauthorized");
|
|
40
|
+
} else {
|
|
41
|
+
runtime.scriptsMgr.runScript(req.body.params.script).then(function (result) {
|
|
42
|
+
res.json(result);
|
|
43
|
+
}).catch(function (err) {
|
|
44
|
+
if (err.code) {
|
|
45
|
+
res.status(400).json({ error: err.code, message: err.message });
|
|
46
|
+
runtime.logger.error("api post runscript: " + err.message);
|
|
47
|
+
} else {
|
|
48
|
+
res.status(400).json({ error: "unexpected_error", message: err.toString() });
|
|
49
|
+
runtime.logger.error("api post runscript: " + err);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* POST run server script and return result value
|
|
57
|
+
*/
|
|
58
|
+
scriptsApp.post("/api/runSysFunction", secureFnc, async function (req, res, next) {
|
|
59
|
+
var groups = checkGroupsFnc(req);
|
|
60
|
+
if (res.statusCode === 403) {
|
|
61
|
+
runtime.logger.error("api post runSysFunction: Tocken Expired");
|
|
62
|
+
} else if (authJwt.adminGroups.indexOf(groups) === -1 ) {
|
|
63
|
+
res.status(401).json({error:"unauthorized_error", message: "Unauthorized!"});
|
|
64
|
+
runtime.logger.error("api post runSysFunction: Unauthorized");
|
|
65
|
+
} else {
|
|
66
|
+
try {
|
|
67
|
+
if (runtime.scriptsMgr.sysFunctionExist(req.body.params.functionName)) {
|
|
68
|
+
const result = runtime.scriptsMgr.runSysFunction(req.body.params.functionName, req.body.params.parameters);
|
|
69
|
+
res.json(result);
|
|
70
|
+
} else {
|
|
71
|
+
res.status(400).json({ error: "not_found", message: 'script not found!'});
|
|
72
|
+
runtime.logger.error("api post runSysFunction: " + 'script not found!');
|
|
73
|
+
}
|
|
74
|
+
} catch (error) {
|
|
75
|
+
res.status(400).json({ error: "error", message: error});
|
|
76
|
+
runtime.logger.error("api post runSysFunction: " + error);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
return scriptsApp;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 'api/users': Users API to GET/POST users data
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
var express = require("express");
|
|
6
|
+
const authJwt = require('../jwt-helper');
|
|
7
|
+
var runtime;
|
|
8
|
+
var secureFnc;
|
|
9
|
+
var checkGroupsFnc;
|
|
10
|
+
|
|
11
|
+
module.exports = {
|
|
12
|
+
init: function (_runtime, _secureFnc, _checkGroupsFnc) {
|
|
13
|
+
runtime = _runtime;
|
|
14
|
+
secureFnc = _secureFnc;
|
|
15
|
+
checkGroupsFnc = _checkGroupsFnc;
|
|
16
|
+
},
|
|
17
|
+
app: function() {
|
|
18
|
+
var usersApp = express();
|
|
19
|
+
usersApp.use(function(req,res,next) {
|
|
20
|
+
if (!runtime.project) {
|
|
21
|
+
res.status(404).end();
|
|
22
|
+
} else {
|
|
23
|
+
next();
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* GET Users
|
|
29
|
+
* Take from users storage and reply
|
|
30
|
+
*/
|
|
31
|
+
usersApp.get("/api/users", secureFnc, function(req, res) {
|
|
32
|
+
var groups = checkGroupsFnc(req);
|
|
33
|
+
if (res.statusCode === 403) {
|
|
34
|
+
runtime.logger.error("api get users: Tocken Expired");
|
|
35
|
+
} else if (authJwt.adminGroups.indexOf(groups) === -1 ) {
|
|
36
|
+
res.status(401).json({error:"unauthorized_error", message: "Unauthorized!"});
|
|
37
|
+
runtime.logger.error("api get users: Unauthorized!");
|
|
38
|
+
} else {
|
|
39
|
+
runtime.users.getUsers(req.query).then(result => {
|
|
40
|
+
// res.header("Access-Control-Allow-Origin", "*");
|
|
41
|
+
// res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
|
42
|
+
if (result) {
|
|
43
|
+
res.json(result);
|
|
44
|
+
} else {
|
|
45
|
+
res.end();
|
|
46
|
+
}
|
|
47
|
+
}).catch(function(err) {
|
|
48
|
+
if (err.code) {
|
|
49
|
+
res.status(400).json({error:err.code, message: err.message});
|
|
50
|
+
} else {
|
|
51
|
+
res.status(400).json({error:"unexpected_error", message:err.toString()});
|
|
52
|
+
}
|
|
53
|
+
runtime.logger.error("api get users: " + err.message);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* POST Users
|
|
60
|
+
* Set to users storage
|
|
61
|
+
*/
|
|
62
|
+
usersApp.post("/api/users", secureFnc, function(req, res, next) {
|
|
63
|
+
var groups = checkGroupsFnc(req);
|
|
64
|
+
if (res.statusCode === 403) {
|
|
65
|
+
runtime.logger.error("api post users: Tocken Expired");
|
|
66
|
+
} else if (authJwt.adminGroups.indexOf(groups) === -1 ) {
|
|
67
|
+
res.status(401).json({error:"unauthorized_error", message: "Unauthorized!"});
|
|
68
|
+
runtime.logger.error("api post users: Unauthorized");
|
|
69
|
+
} else {
|
|
70
|
+
runtime.users.setUsers(req.body.params).then(function(data) {
|
|
71
|
+
res.end();
|
|
72
|
+
}).catch(function(err) {
|
|
73
|
+
if (err.code) {
|
|
74
|
+
res.status(400).json({error:err.code, message: err.message});
|
|
75
|
+
} else {
|
|
76
|
+
res.status(400).json({error:"unexpected_error", message:err.toString()});
|
|
77
|
+
}
|
|
78
|
+
runtime.logger.error("api post users: " + err.message);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* DELETE User
|
|
85
|
+
* Set to project storage
|
|
86
|
+
*/
|
|
87
|
+
usersApp.delete("/api/users", secureFnc, function(req, res, next) {
|
|
88
|
+
var groups = checkGroupsFnc(req);
|
|
89
|
+
if (res.statusCode === 403) {
|
|
90
|
+
runtime.logger.error("api delete users: Tocken Expired");
|
|
91
|
+
} else if (authJwt.adminGroups.indexOf(groups) === -1 ) {
|
|
92
|
+
res.status(401).json({error:"unauthorized_error", message: "Unauthorized!"});
|
|
93
|
+
runtime.logger.error("api delete users: Unauthorized");
|
|
94
|
+
} else {
|
|
95
|
+
runtime.users.removeUsers(req.query.param).then(function(data) {
|
|
96
|
+
res.end();
|
|
97
|
+
}).catch(function(err) {
|
|
98
|
+
if (err.code) {
|
|
99
|
+
res.status(400).json({error:err.code, message: err.message});
|
|
100
|
+
} else {
|
|
101
|
+
res.status(400).json({error:"unexpected_error", message:err.toString()});
|
|
102
|
+
}
|
|
103
|
+
runtime.logger.error("api delete users: " + err.message);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
return usersApp;
|
|
108
|
+
}
|
|
109
|
+
}
|