@fdm-monster/server 1.7.1 → 1.7.2
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/.yarn/install-state.gz +0 -0
- package/RELEASE_NOTES.MD +6 -0
- package/dist/consoles/check-ports.js +170 -0
- package/dist/consoles/check-ports.js.map +1 -0
- package/dist/constants/service.constants.js +6 -6
- package/dist/constants/service.constants.js.map +1 -1
- package/dist/controllers/validation/printer-controller.validation.js +2 -2
- package/dist/controllers/validation/printer-controller.validation.js.map +1 -1
- package/dist/models/Printer.js.map +1 -1
- package/dist/server.constants.js +1 -1
- package/dist/services/validators/printer-service.validation.js +2 -2
- package/dist/services/validators/printer-service.validation.js.map +1 -1
- package/dist/services/validators/yaml-service.validation.js +1 -1
- package/dist/services/validators/yaml-service.validation.js.map +1 -1
- package/dist/state/validation/create-test-printer.validation.js +1 -1
- package/dist/state/validation/create-test-printer.validation.js.map +1 -1
- package/package.json +10 -10
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/RELEASE_NOTES.MD
CHANGED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
checkPort: function() {
|
|
13
|
+
return checkPort;
|
|
14
|
+
},
|
|
15
|
+
scanPortRange: function() {
|
|
16
|
+
return scanPortRange;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _net = /*#__PURE__*/ _interop_require_default(require("net"));
|
|
20
|
+
const _cluster = /*#__PURE__*/ _interop_require_default(require("cluster"));
|
|
21
|
+
const _os = require("os");
|
|
22
|
+
function _interop_require_default(obj) {
|
|
23
|
+
return obj && obj.__esModule ? obj : {
|
|
24
|
+
default: obj
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const numCPUs = (0, _os.cpus)().length;
|
|
28
|
+
const commonServices = {
|
|
29
|
+
80: "HTTP",
|
|
30
|
+
443: "HTTPS",
|
|
31
|
+
22: "SSH",
|
|
32
|
+
21: "FTP",
|
|
33
|
+
3306: "MySQL",
|
|
34
|
+
5432: "PostgreSQL",
|
|
35
|
+
27017: "MongoDB",
|
|
36
|
+
6379: "Redis",
|
|
37
|
+
8080: "HTTP-Alternate",
|
|
38
|
+
8443: "HTTPS-Alternate"
|
|
39
|
+
};
|
|
40
|
+
async function checkPort(host, port) {
|
|
41
|
+
console.log("Worker defined " + host + ":" + port);
|
|
42
|
+
return new Promise((resolve)=>{
|
|
43
|
+
const socket = new _net.default.Socket();
|
|
44
|
+
const timeout = 1000;
|
|
45
|
+
socket.setTimeout(timeout);
|
|
46
|
+
socket.on("connect", ()=>{
|
|
47
|
+
socket.destroy();
|
|
48
|
+
resolve({
|
|
49
|
+
port,
|
|
50
|
+
status: "open",
|
|
51
|
+
service: commonServices[port]
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
socket.on("timeout", ()=>{
|
|
55
|
+
socket.destroy();
|
|
56
|
+
resolve({
|
|
57
|
+
port,
|
|
58
|
+
status: "closed"
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
socket.on("error", ()=>{
|
|
62
|
+
socket.destroy();
|
|
63
|
+
resolve({
|
|
64
|
+
port,
|
|
65
|
+
status: "closed"
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
socket.connect(port, host);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
async function scanPortRange(host, start, end, specificPorts = []) {
|
|
72
|
+
const portsToScan = [
|
|
73
|
+
...Array.from({
|
|
74
|
+
length: end - start + 1
|
|
75
|
+
}, (_, i)=>start + i),
|
|
76
|
+
...specificPorts
|
|
77
|
+
].filter((value, index, self)=>self.indexOf(value) === index);
|
|
78
|
+
const chunkSize = Math.ceil(portsToScan.length / numCPUs);
|
|
79
|
+
const chunks = Array.from({
|
|
80
|
+
length: numCPUs
|
|
81
|
+
}, (_, i)=>portsToScan.slice(i * chunkSize, (i + 1) * chunkSize));
|
|
82
|
+
if (_cluster.default.isPrimary) {
|
|
83
|
+
console.log(`Primary ${process.pid} is running`);
|
|
84
|
+
console.log(`Starting scan on ${host} for ports ${start}-${end} and specific ports: ${specificPorts.join(", ")}`);
|
|
85
|
+
console.log(`Number of CPU cores: ${numCPUs}`);
|
|
86
|
+
const results = [];
|
|
87
|
+
const workers = new Set();
|
|
88
|
+
_cluster.default.on("exit", (worker, code, signal)=>{
|
|
89
|
+
console.log(`Worker ${worker.process.pid} died. Signal: ${signal}. Code: ${code}`);
|
|
90
|
+
workers.delete(worker);
|
|
91
|
+
if (workers.size === 0) {
|
|
92
|
+
console.log("All workers completed");
|
|
93
|
+
process.emit("allWorkersCompleted", results);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
return new Promise((resolve, reject)=>{
|
|
97
|
+
const timeout = setTimeout(()=>{
|
|
98
|
+
for (const worker of workers){
|
|
99
|
+
worker.kill();
|
|
100
|
+
}
|
|
101
|
+
reject(new Error("Scan timeout after 30 seconds"));
|
|
102
|
+
}, 30000);
|
|
103
|
+
process.once("allWorkersCompleted", (finalResults)=>{
|
|
104
|
+
clearTimeout(timeout);
|
|
105
|
+
resolve(finalResults.sort((a, b)=>a.port - b.port));
|
|
106
|
+
});
|
|
107
|
+
chunks.forEach((chunk, index)=>{
|
|
108
|
+
try {
|
|
109
|
+
const worker = _cluster.default.fork();
|
|
110
|
+
workers.add(worker);
|
|
111
|
+
console.log(`Created worker ${worker.process.pid} for chunk ${index + 1}/${chunks.length}`);
|
|
112
|
+
worker.on("message", (msg)=>{
|
|
113
|
+
console.log(`Received results from worker ${worker.process.pid}: ${msg.length} ports`);
|
|
114
|
+
results.push(...msg);
|
|
115
|
+
});
|
|
116
|
+
worker.on("error", (error)=>{
|
|
117
|
+
console.error(`Worker ${worker.process.pid} error:`, error);
|
|
118
|
+
});
|
|
119
|
+
worker.send({
|
|
120
|
+
host,
|
|
121
|
+
ports: chunk
|
|
122
|
+
});
|
|
123
|
+
} catch (error) {
|
|
124
|
+
console.error("Error creating worker:", error);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
} else {
|
|
129
|
+
console.log(`Worker ${process.pid} started`);
|
|
130
|
+
return new Promise((resolve)=>{
|
|
131
|
+
process.on("message", async (msg)=>{
|
|
132
|
+
try {
|
|
133
|
+
console.log(`Worker ${process.pid} received ${msg.ports.length} ports to scan`);
|
|
134
|
+
const results = [];
|
|
135
|
+
const promises = msg.ports.map((port)=>checkPort(msg.host, port));
|
|
136
|
+
const workerResults = await Promise.all(promises);
|
|
137
|
+
results.push(...workerResults);
|
|
138
|
+
if (process.send) {
|
|
139
|
+
process.send(results);
|
|
140
|
+
console.log(`Worker ${process.pid} completed scanning`);
|
|
141
|
+
}
|
|
142
|
+
process.exit(0);
|
|
143
|
+
} catch (error) {
|
|
144
|
+
console.error(`Worker ${process.pid} error:`, error);
|
|
145
|
+
process.exit(1);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (require.main === module) {
|
|
152
|
+
const host = process.argv[2] || "localhost";
|
|
153
|
+
scanPortRange(host, 80, 8888, [
|
|
154
|
+
27017
|
|
155
|
+
]).then((results)=>{
|
|
156
|
+
console.log("\nScan Results:");
|
|
157
|
+
const openPorts = results.filter((r)=>r.status === "open");
|
|
158
|
+
if (openPorts.length === 0) {
|
|
159
|
+
console.log("No open ports found");
|
|
160
|
+
} else {
|
|
161
|
+
console.table(openPorts);
|
|
162
|
+
}
|
|
163
|
+
process.exit(0);
|
|
164
|
+
}).catch((error)=>{
|
|
165
|
+
console.error("Error during scan:", error);
|
|
166
|
+
process.exit(1);
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
//# sourceMappingURL=check-ports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/consoles/check-ports.ts"],"names":["checkPort","scanPortRange","numCPUs","cpus","length","commonServices","host","port","console","log","Promise","resolve","socket","net","Socket","timeout","setTimeout","on","destroy","status","service","connect","start","end","specificPorts","portsToScan","Array","from","_","i","filter","value","index","self","indexOf","chunkSize","Math","ceil","chunks","slice","cluster","isPrimary","process","pid","join","results","workers","Set","worker","code","signal","delete","size","emit","reject","kill","Error","once","finalResults","clearTimeout","sort","a","b","forEach","chunk","fork","add","msg","push","error","send","ports","promises","map","workerResults","all","exit","require","main","module","argv","then","openPorts","r","table","catch"],"mappings":";;;;;;;;;;;IAyLwBA,SAAS;eAATA;;IAAfC,aAAa;eAAbA;;;4DAzLO;gEACgB;oBACX;;;;;;AAQrB,MAAMC,UAAUC,IAAAA,QAAI,IAAGC,MAAM;AAG7B,MAAMC,iBAA4C;IAChD,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;AACR;AAEA,eAAeL,UAAUM,IAAY,EAAEC,IAAY;IACjDC,QAAQC,GAAG,CAAC,oBAAoBH,OAAO,MAAMC;IAC7C,OAAO,IAAIG,QAAQ,CAACC;QAClB,MAAMC,SAAS,IAAIC,YAAG,CAACC,MAAM;QAC7B,MAAMC,UAAU;QAEhBH,OAAOI,UAAU,CAACD;QAElBH,OAAOK,EAAE,CAAC,WAAW;YACnBL,OAAOM,OAAO;YACdP,QAAQ;gBACNJ;gBACAY,QAAQ;gBACRC,SAASf,cAAc,CAACE,KAAK;YAC/B;QACF;QAEAK,OAAOK,EAAE,CAAC,WAAW;YACnBL,OAAOM,OAAO;YACdP,QAAQ;gBACNJ;gBACAY,QAAQ;YACV;QACF;QAEAP,OAAOK,EAAE,CAAC,SAAS;YACj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C,IAAI,CAAC;IACf,GACCS,KAAK,CAAC,CAAChB;QACN7D,QAAQ6D,KAAK,CAAC,sBAAsBA;QACpC3B,QAAQkC,IAAI,CAAC;IACf;AACJ"}
|
|
@@ -9,18 +9,18 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
|
|
13
|
-
return
|
|
12
|
+
apiKeyLengthMaxDefault: function() {
|
|
13
|
+
return apiKeyLengthMaxDefault;
|
|
14
14
|
},
|
|
15
|
-
|
|
16
|
-
return
|
|
15
|
+
apiKeyLengthMinDefault: function() {
|
|
16
|
+
return apiKeyLengthMinDefault;
|
|
17
17
|
},
|
|
18
18
|
minFloorNameLength: function() {
|
|
19
19
|
return minFloorNameLength;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
const UUID_LENGTH = 32;
|
|
23
22
|
const minFloorNameLength = 3;
|
|
24
|
-
const
|
|
23
|
+
const apiKeyLengthMinDefault = 32;
|
|
24
|
+
const apiKeyLengthMaxDefault = 43;
|
|
25
25
|
|
|
26
26
|
//# sourceMappingURL=service.constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/constants/service.constants.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../src/constants/service.constants.ts"],"names":["apiKeyLengthMaxDefault","apiKeyLengthMinDefault","minFloorNameLength"],"mappings":";;;;;;;;;;;IAGaA,sBAAsB;eAAtBA;;IADAC,sBAAsB;eAAtBA;;IAFAC,kBAAkB;eAAlBA;;;AAAN,MAAMA,qBAAqB;AAE3B,MAAMD,yBAAyB;AAC/B,MAAMD,yBAAyB"}
|
|
@@ -44,7 +44,7 @@ const feedRateRules = {
|
|
|
44
44
|
};
|
|
45
45
|
const testPrinterApiRules = {
|
|
46
46
|
printerType: `required|integer|in:${_printerapiinterface.OctoprintType},${_printerapiinterface.MoonrakerType}`,
|
|
47
|
-
apiKey: `requiredIf:printerType,${_printerapiinterface.OctoprintType}|length:${_serviceconstants.
|
|
47
|
+
apiKey: `requiredIf:printerType,${_printerapiinterface.OctoprintType}|length:${_serviceconstants.apiKeyLengthMaxDefault},${_serviceconstants.apiKeyLengthMinDefault}|alphaDash`,
|
|
48
48
|
printerURL: "required|httpurl"
|
|
49
49
|
};
|
|
50
50
|
const updatePrinterDisabledReasonRules = {
|
|
@@ -56,7 +56,7 @@ const updatePrinterEnabledRule = {
|
|
|
56
56
|
const updatePrinterConnectionSettingRules = {
|
|
57
57
|
printerType: `required|integer|in:${_printerapiinterface.OctoprintType},${_printerapiinterface.MoonrakerType}`,
|
|
58
58
|
printerURL: "required|httpurl",
|
|
59
|
-
apiKey: `requiredIf:printerType,${_printerapiinterface.OctoprintType}|length:${_serviceconstants.
|
|
59
|
+
apiKey: `requiredIf:printerType,${_printerapiinterface.OctoprintType}|length:${_serviceconstants.apiKeyLengthMaxDefault},${_serviceconstants.apiKeyLengthMinDefault}|alphaDash`
|
|
60
60
|
};
|
|
61
61
|
const createOctoPrintBackupRules = {
|
|
62
62
|
exclude: "array",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/controllers/validation/printer-controller.validation.ts"],"names":["createOctoPrintBackupRules","feedRateRules","flowRateRules","getOctoPrintBackupRules","testPrinterApiRules","updatePrinterConnectionSettingRules","updatePrinterDisabledReasonRules","updatePrinterEnabledRule","flowRate","feedRate","printerType","OctoprintType","MoonrakerType","apiKey","
|
|
1
|
+
{"version":3,"sources":["../../../src/controllers/validation/printer-controller.validation.ts"],"names":["createOctoPrintBackupRules","feedRateRules","flowRateRules","getOctoPrintBackupRules","testPrinterApiRules","updatePrinterConnectionSettingRules","updatePrinterDisabledReasonRules","updatePrinterEnabledRule","flowRate","feedRate","printerType","OctoprintType","MoonrakerType","apiKey","apiKeyLengthMaxDefault","apiKeyLengthMinDefault","printerURL","disabledReason","enabled","exclude","fileName"],"mappings":";;;;;;;;;;;IA+BaA,0BAA0B;eAA1BA;;IAxBAC,aAAa;eAAbA;;IAJAC,aAAa;eAAbA;;IAiCAC,uBAAuB;eAAvBA;;IAzBAC,mBAAmB;eAAnBA;;IAcAC,mCAAmC;eAAnCA;;IARAC,gCAAgC;eAAhCA;;IAIAC,wBAAwB;eAAxBA;;;kCArBkD;qCAClB;AAEtC,MAAML,gBAAgB;IAC3BM,UAAU;AACZ;AAEO,MAAMP,gBAAgB;IAC3BQ,UAAU;AACZ;AAEO,MAAML,sBAAsB;IACjCM,aAAa,CAAC,oBAAoB,EAAEC,kCAAa,CAAC,CAAC,EAAEC,kCAAa,EAAE;IACpEC,QAAQ,CAAC,uBAAuB,EAAEF,kCAAa,CAAC,QAAQ,EAAEG,wCAAsB,CAAC,CAAC,EAAEC,wCAAsB,CAAC,UAAU,CAAC;IACtHC,YAAY;AACd;AAEO,MAAMV,mCAAmC;IAC9CW,gBAAgB;AAClB;AAEO,MAAMV,2BAA2B;IACtCW,SAAS;AACX;AAEO,MAAMb,sCAAsC;IACjDK,aAAa,CAAC,oBAAoB,EAAEC,kCAAa,CAAC,CAAC,EAAEC,kCAAa,EAAE;IACpEI,YAAY;IACZH,QAAQ,CAAC,uBAAuB,EAAEF,kCAAa,CAAC,QAAQ,EAAEG,wCAAsB,CAAC,CAAC,EAAEC,wCAAsB,CAAC,UAAU,CAAC;AACxH;AAEO,MAAMf,6BAA6B;IACxCmB,SAAS;IACT,aAAa;AACf;AAEO,MAAMhB,0BAA0B;IACrCiB,UAAU;AACZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/models/Printer.ts"],"names":["Printer","PrinterSchema","Schema","apiKey","type","String","default","printerURL","required","printerType","Number","OctoprintType","enabled","Boolean","disabledReason","assignee","name","currentUser","dateAdded","feedRate","flowRate","model"],"mappings":";;;;;;;;;;;IAoEaA,OAAO;eAAPA;;IAlDAC,aAAa;eAAbA;;;0BAlBiB;
|
|
1
|
+
{"version":3,"sources":["../../src/models/Printer.ts"],"names":["Printer","PrinterSchema","Schema","apiKey","type","String","default","printerURL","required","printerType","Number","OctoprintType","enabled","Boolean","disabledReason","assignee","name","currentUser","dateAdded","feedRate","flowRate","model"],"mappings":";;;;;;;;;;;IAoEaA,OAAO;eAAPA;;IAlDAC,aAAa;eAAbA;;;0BAlBiB;qCACA;AAiBvB,MAAMA,gBAAgB,IAAIC,gBAAM,CAAW;IAChDC,QAAQ;QACNC,MAAMC;QACNC,SAAS;IACX;IACAC,YAAY;QACVH,MAAMC;QACNG,UAAU;IACZ;IACAC,aAAa;QACXL,MAAMM;QACNF,UAAU;QACVF,SAASK,kCAAa;IACxB;IACAC,SAAS;QACPR,MAAMS;QACNL,UAAU;QACVF,SAAS;IACX;IACAQ,gBAAgB;QACdV,MAAMC;QACNG,UAAU;IACZ;IACAO,UAAU;QACRX,MAAMC;QACNG,UAAU;IACZ;IACAQ,MAAM;QACJZ,MAAMC;QACNG,UAAU;IACZ;IAEAS,aAAa;QACXb,MAAMC;QACNG,UAAU;IACZ;IACAU,WAAW;QACTd,MAAMM;QACNF,UAAU;IACZ;IACAW,UAAU;QACRf,MAAMM;QACNF,UAAU;IACZ;IACAY,UAAU;QACRhB,MAAMM;QACNF,UAAU;IACZ;AACF;AAEO,MAAMR,UAAUqB,IAAAA,eAAK,EAAC,WAAWpB"}
|
package/dist/server.constants.js
CHANGED
|
@@ -66,7 +66,7 @@ const AppConstants = {
|
|
|
66
66
|
githubUrl: "https://github.com/fdm-monster/fdm-monster",
|
|
67
67
|
orgName: "fdm-monster",
|
|
68
68
|
currentWizardVersion: 1,
|
|
69
|
-
defaultClientMinimum: "1.6.
|
|
69
|
+
defaultClientMinimum: "1.6.8",
|
|
70
70
|
influxUrl: "INFLUX_URL",
|
|
71
71
|
influxToken: "INFLUX_TOKEN",
|
|
72
72
|
influxOrg: "INFLUX_ORG",
|
|
@@ -28,14 +28,14 @@ const createMongoPrinterRules = {
|
|
|
28
28
|
_id: "not",
|
|
29
29
|
printerURL: "required|httpurl",
|
|
30
30
|
printerType: `required|integer|in:${_printerapiinterface.OctoprintType},${_printerapiinterface.MoonrakerType}`,
|
|
31
|
-
apiKey: `requiredIf:printerType,${_printerapiinterface.OctoprintType}|length:${_serviceconstants.
|
|
31
|
+
apiKey: `requiredIf:printerType,${_printerapiinterface.OctoprintType}|length:${_serviceconstants.apiKeyLengthMaxDefault},${_serviceconstants.apiKeyLengthMinDefault}|alphaDash`,
|
|
32
32
|
enabled: "boolean",
|
|
33
33
|
name: "string"
|
|
34
34
|
};
|
|
35
35
|
const createPrinterRules = {
|
|
36
36
|
printerURL: "required|httpurl",
|
|
37
37
|
printerType: `required|integer|in:${_printerapiinterface.OctoprintType},${_printerapiinterface.MoonrakerType}`,
|
|
38
|
-
apiKey: `requiredIf:printerType,${_printerapiinterface.OctoprintType}|length:${_serviceconstants.
|
|
38
|
+
apiKey: `requiredIf:printerType,${_printerapiinterface.OctoprintType}|length:${_serviceconstants.apiKeyLengthMaxDefault},${_serviceconstants.apiKeyLengthMinDefault}|alphaDash`,
|
|
39
39
|
enabled: "boolean",
|
|
40
40
|
name: "required|string"
|
|
41
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/services/validators/printer-service.validation.ts"],"names":["createMongoPrinterRules","createPrinterRules","updatePrinterDisabledReasonRule","updatePrinterEnabledRule","_id","printerURL","printerType","OctoprintType","MoonrakerType","apiKey","
|
|
1
|
+
{"version":3,"sources":["../../../src/services/validators/printer-service.validation.ts"],"names":["createMongoPrinterRules","createPrinterRules","updatePrinterDisabledReasonRule","updatePrinterEnabledRule","_id","printerURL","printerType","OctoprintType","MoonrakerType","apiKey","apiKeyLengthMaxDefault","apiKeyLengthMinDefault","enabled","name","disabledReason"],"mappings":";;;;;;;;;;;IAGaA,uBAAuB;eAAvBA;;IASAC,kBAAkB;eAAlBA;;IAYAC,+BAA+B;eAA/BA;;IAJAC,wBAAwB;eAAxBA;;;kCApBkD;qCAClB;AAEtC,MAAMH,0BAA0B;IACrCI,KAAK;IACLC,YAAY;IACZC,aAAa,CAAC,oBAAoB,EAAEC,kCAAa,CAAC,CAAC,EAAEC,kCAAa,EAAE;IACpEC,QAAQ,CAAC,uBAAuB,EAAEF,kCAAa,CAAC,QAAQ,EAAEG,wCAAsB,CAAC,CAAC,EAAEC,wCAAsB,CAAC,UAAU,CAAC;IACtHC,SAAS;IACTC,MAAM;AACR;AAEO,MAAMZ,qBAAqB;IAChCI,YAAY;IACZC,aAAa,CAAC,oBAAoB,EAAEC,kCAAa,CAAC,CAAC,EAAEC,kCAAa,EAAE;IACpEC,QAAQ,CAAC,uBAAuB,EAAEF,kCAAa,CAAC,QAAQ,EAAEG,wCAAsB,CAAC,CAAC,EAAEC,wCAAsB,CAAC,UAAU,CAAC;IACtHC,SAAS;IACTC,MAAM;AACR;AAEO,MAAMV,2BAA2B;IACtCS,SAAS;AACX;AAEO,MAAMV,kCAAkC;IAC7CY,gBAAgB;IAChBF,SAAS;AACX"}
|
|
@@ -44,7 +44,7 @@ const importPrintersFloorsYamlRules = (importPrinters, importFloorGrid, importFl
|
|
|
44
44
|
"config.floorComparisonStrategiesByPriority": "required|string|in:name,floor,id",
|
|
45
45
|
printers: `${!!importPrinters ? "array|minLength:0" : "not"}`,
|
|
46
46
|
"printers.*.id": "required",
|
|
47
|
-
"printers.*.apiKey": `required|length:${_serviceconstants.
|
|
47
|
+
"printers.*.apiKey": `required|length:${_serviceconstants.apiKeyLengthMaxDefault},${_serviceconstants.apiKeyLengthMinDefault}|alphaNumeric`,
|
|
48
48
|
"printers.*.printerURL": "required|httpurl",
|
|
49
49
|
"printers.*.enabled": "boolean",
|
|
50
50
|
"printers.*.printerType": `integer|in:${_printerapiinterface.OctoprintType},${_printerapiinterface.MoonrakerType}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/services/validators/yaml-service.validation.ts"],"names":["exportPrintersFloorsYamlRules","importPrinterPositionsRules","importPrintersFloorsYamlRules","exportPrinters","exportFloorGrid","exportFloors","exportGroups","printerComparisonStrategiesByPriority","floorComparisonStrategiesByPriority","notes","importPrinters","importFloorGrid","importFloors","importGroups","version","config","printers","
|
|
1
|
+
{"version":3,"sources":["../../../src/services/validators/yaml-service.validation.ts"],"names":["exportPrintersFloorsYamlRules","importPrinterPositionsRules","importPrintersFloorsYamlRules","exportPrinters","exportFloorGrid","exportFloors","exportGroups","printerComparisonStrategiesByPriority","floorComparisonStrategiesByPriority","notes","importPrinters","importFloorGrid","importFloors","importGroups","version","config","printers","apiKeyLengthMaxDefault","apiKeyLengthMinDefault","OctoprintType","MoonrakerType","floors","groups","isTypeormMode"],"mappings":";;;;;;;;;;;IAGaA,6BAA6B;eAA7BA;;IAsDAC,2BAA2B;eAA3BA;;IApCAC,6BAA6B;eAA7BA;;;kCArBkD;qCAClB;AAEtC,MAAMF,gCAAgC;IAE3CG,gBAAgB;IAChBC,iBAAiB;IACjBC,cAAc;IAEdC,cAAc;IAEdC,uCAAuC;IACvC,2CAA2C;IAC3CC,qCAAqC;IAErCC,OAAO;AAIT;AAEO,MAAMP,gCAAgC,CAC3CQ,gBACAC,iBACAC,cACAC;IAEA,OAAO;QACLC,SAAS;QACTC,QAAQ;QACR,yBAAyB;QACzB,0BAA0B;QAC1B,uBAAuB;QACvB,uBAAuB;QACvB,gDAAgD;QAChD,kDAAkD;QAClD,8CAA8C;QAC9CC,UAAU,GAAG,CAAC,CAACN,iBAAiB,sBAAsB,OAAO;QAC7D,iBAAiB;QACjB,qBAAqB,CAAC,gBAAgB,EAAEO,wCAAsB,CAAC,CAAC,EAAEC,wCAAsB,CAAC,aAAa,CAAC;QACvG,yBAAyB;QACzB,sBAAsB;QACtB,0BAA0B,CAAC,WAAW,EAAEC,kCAAa,CAAC,CAAC,EAAEC,kCAAa,EAAE;QACxE,mBAAmB;QACnBC,QAAQ,GAAG,CAAC,CAACT,eAAe,sBAAsB,OAAO;QACzD,eAAe;QACf,kBAAkB;QAClB,iBAAiB;QAEjBU,QAAQ,GAAG,CAAC,CAACT,eAAe,sBAAsB,OAAO;QACzD,eAAe;QACf,iBAAiB;IAGnB;AACF;AAEO,MAAMZ,8BAA8B,CAACsB,gBAA4B,CAAA;QACtEP,UAAU;QACV,wBAAwB;QAExB,gBAAgB;QAChB,gBAAgB;IAClB,CAAA"}
|
|
@@ -13,7 +13,7 @@ const _printerapiinterface = require("../../services/printer-api.interface");
|
|
|
13
13
|
const createTestPrinterRules = {
|
|
14
14
|
printerType: `required|integer|in:${_printerapiinterface.OctoprintType},${_printerapiinterface.MoonrakerType}`,
|
|
15
15
|
correlationToken: "required|string",
|
|
16
|
-
apiKey: `requiredIf:printerType,${_printerapiinterface.OctoprintType}|length:${_serviceconstants.
|
|
16
|
+
apiKey: `requiredIf:printerType,${_printerapiinterface.OctoprintType}|length:${_serviceconstants.apiKeyLengthMaxDefault},${_serviceconstants.apiKeyLengthMinDefault}|alphaDash`,
|
|
17
17
|
printerURL: "required|httpurl"
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/state/validation/create-test-printer.validation.ts"],"names":["createTestPrinterRules","printerType","OctoprintType","MoonrakerType","correlationToken","apiKey","
|
|
1
|
+
{"version":3,"sources":["../../../src/state/validation/create-test-printer.validation.ts"],"names":["createTestPrinterRules","printerType","OctoprintType","MoonrakerType","correlationToken","apiKey","apiKeyLengthMaxDefault","apiKeyLengthMinDefault","printerURL"],"mappings":";;;;+BAGaA;;;eAAAA;;;kCAHkD;qCAClB;AAEtC,MAAMA,yBAAyB;IACpCC,aAAa,CAAC,oBAAoB,EAAEC,kCAAa,CAAC,CAAC,EAAEC,kCAAa,EAAE;IACpEC,kBAAkB;IAClBC,QAAQ,CAAC,uBAAuB,EAAEH,kCAAa,CAAC,QAAQ,EAAEI,wCAAsB,CAAC,CAAC,EAAEC,wCAAsB,CAAC,UAAU,CAAC;IACtHC,YAAY;AACd"}
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
},
|
|
7
7
|
"author": "David Zwart",
|
|
8
8
|
"license": "AGPL-3.0-or-later",
|
|
9
|
-
"version": "1.7.
|
|
9
|
+
"version": "1.7.2",
|
|
10
10
|
"bin": {
|
|
11
11
|
"fdm-monster": "dist/index.js",
|
|
12
12
|
"fdmm": "dist/index.js"
|
|
@@ -53,18 +53,18 @@
|
|
|
53
53
|
"vue"
|
|
54
54
|
],
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@fdm-monster/client": "1.6.
|
|
57
|
-
"@fdm-monster/client-next": "0.0.
|
|
56
|
+
"@fdm-monster/client": "1.6.8",
|
|
57
|
+
"@fdm-monster/client-next": "0.0.5",
|
|
58
58
|
"@influxdata/influxdb-client": "1.35.0",
|
|
59
59
|
"@octokit/plugin-throttling": "8.2.0",
|
|
60
|
-
"@sentry/node": "8.
|
|
60
|
+
"@sentry/node": "8.37.1",
|
|
61
61
|
"adm-zip": "0.5.16",
|
|
62
62
|
"awilix": "12.0.3",
|
|
63
63
|
"awilix-express": "9.0.1",
|
|
64
64
|
"axios": "1.7.7",
|
|
65
65
|
"bcryptjs": "2.4.3",
|
|
66
66
|
"better-sqlite3": "11.5.0",
|
|
67
|
-
"cache-manager": "6.1.
|
|
67
|
+
"cache-manager": "6.1.3",
|
|
68
68
|
"class-validator": "0.14.1",
|
|
69
69
|
"connect-history-api-fallback": "2.0.0",
|
|
70
70
|
"cookie-parser": "1.4.7",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"socket.io": "4.8.1",
|
|
96
96
|
"toad-scheduler": "3.0.1",
|
|
97
97
|
"typeorm": "0.3.20",
|
|
98
|
-
"uuid": "11.0.
|
|
98
|
+
"uuid": "11.0.3",
|
|
99
99
|
"winston": "3.16.0",
|
|
100
100
|
"ws": "8.18.0"
|
|
101
101
|
},
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"@lcov-viewer/cli": "1.3.0",
|
|
104
104
|
"@lcov-viewer/istanbul-report": "1.4.0",
|
|
105
105
|
"@swc/cli": "0.5.0",
|
|
106
|
-
"@swc/core": "1.
|
|
106
|
+
"@swc/core": "1.9.2",
|
|
107
107
|
"@swc/jest": "0.2.37",
|
|
108
108
|
"@types/adm-zip": "0.5.6",
|
|
109
109
|
"@types/bcryptjs": "2.4.6",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"@types/luxon": "3.4.2",
|
|
119
119
|
"@types/migrate-mongo": "10.0.5",
|
|
120
120
|
"@types/multer": "1.4.12",
|
|
121
|
-
"@types/node": "22.
|
|
121
|
+
"@types/node": "22.9.0",
|
|
122
122
|
"@types/passport-anonymous": "1.0.5",
|
|
123
123
|
"@types/passport-jwt": "4.0.1",
|
|
124
124
|
"@types/semver": "7.5.8",
|
|
@@ -132,14 +132,14 @@
|
|
|
132
132
|
"eslint-config-prettier": "9.1.0",
|
|
133
133
|
"eslint-config-standard": "17.1.0",
|
|
134
134
|
"eslint-plugin-import": "2.31.0",
|
|
135
|
-
"eslint-plugin-n": "17.
|
|
135
|
+
"eslint-plugin-n": "17.13.1",
|
|
136
136
|
"eslint-plugin-prettier": "4.2.1",
|
|
137
137
|
"eslint-plugin-promise": "7.1.0",
|
|
138
138
|
"express-list-routes": "1.2.4",
|
|
139
139
|
"jest": "29.7.0",
|
|
140
140
|
"jest-27-expect-message": "1.1.0",
|
|
141
141
|
"mongodb-memory-server": "10.1.2",
|
|
142
|
-
"nock": "13.5.
|
|
142
|
+
"nock": "13.5.6",
|
|
143
143
|
"prettier": "2.8.8",
|
|
144
144
|
"supertest": "7.0.0",
|
|
145
145
|
"ts-node": "10.9.2",
|