@duet3d/objectmodel 3.4.0

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.
Files changed (119) hide show
  1. package/LICENSE +504 -0
  2. package/README.md +7 -0
  3. package/lib/ModelCollection.d.ts +25 -0
  4. package/lib/ModelCollection.js +79 -0
  5. package/lib/ModelDictionary.d.ts +28 -0
  6. package/lib/ModelDictionary.js +68 -0
  7. package/lib/ModelObject.d.ts +35 -0
  8. package/lib/ModelObject.js +155 -0
  9. package/lib/boards/index.d.ts +49 -0
  10. package/lib/boards/index.js +78 -0
  11. package/lib/directories/index.d.ts +11 -0
  12. package/lib/directories/index.js +17 -0
  13. package/lib/fans/index.d.ts +17 -0
  14. package/lib/fans/index.js +28 -0
  15. package/lib/heat/Heater.d.ts +24 -0
  16. package/lib/heat/Heater.js +32 -0
  17. package/lib/heat/HeaterModel.d.ts +20 -0
  18. package/lib/heat/HeaterModel.js +31 -0
  19. package/lib/heat/HeaterMonitor.d.ts +17 -0
  20. package/lib/heat/HeaterMonitor.js +26 -0
  21. package/lib/heat/index.d.ts +10 -0
  22. package/lib/heat/index.js +16 -0
  23. package/lib/httpEndpoints/index.d.ts +18 -0
  24. package/lib/httpEndpoints/index.js +26 -0
  25. package/lib/index.d.ts +44 -0
  26. package/lib/index.js +59 -0
  27. package/lib/inputs/CodeChannel.d.ts +15 -0
  28. package/lib/inputs/CodeChannel.js +19 -0
  29. package/lib/inputs/Compatibility.d.ts +9 -0
  30. package/lib/inputs/Compatibility.js +13 -0
  31. package/lib/inputs/InputChannel.d.ts +27 -0
  32. package/lib/inputs/InputChannel.js +36 -0
  33. package/lib/job/Build.d.ts +14 -0
  34. package/lib/job/Build.js +25 -0
  35. package/lib/job/GCodeFileInfo.d.ts +16 -0
  36. package/lib/job/GCodeFileInfo.js +22 -0
  37. package/lib/job/ThumbnailInfo.d.ts +14 -0
  38. package/lib/job/ThumbnailInfo.js +22 -0
  39. package/lib/job/index.d.ts +36 -0
  40. package/lib/job/index.js +52 -0
  41. package/lib/limits/index.d.ts +28 -0
  42. package/lib/limits/index.js +34 -0
  43. package/lib/messages/index.d.ts +12 -0
  44. package/lib/messages/index.js +26 -0
  45. package/lib/move/Axis.d.ts +51 -0
  46. package/lib/move/Axis.js +59 -0
  47. package/lib/move/DriverId.d.ts +7 -0
  48. package/lib/move/DriverId.js +29 -0
  49. package/lib/move/Extruder.d.ts +26 -0
  50. package/lib/move/Extruder.js +37 -0
  51. package/lib/move/InputShaping.d.ts +18 -0
  52. package/lib/move/InputShaping.js +26 -0
  53. package/lib/move/Microstepping.d.ts +5 -0
  54. package/lib/move/Microstepping.js +11 -0
  55. package/lib/move/MoveCalibration.d.ts +10 -0
  56. package/lib/move/MoveCalibration.js +21 -0
  57. package/lib/move/MoveCompensation.d.ts +29 -0
  58. package/lib/move/MoveCompensation.js +46 -0
  59. package/lib/move/index.d.ts +46 -0
  60. package/lib/move/index.js +69 -0
  61. package/lib/move/kinematics/CoreKinematics.d.ts +8 -0
  62. package/lib/move/kinematics/CoreKinematics.js +29 -0
  63. package/lib/move/kinematics/DeltaKinematics.d.ts +19 -0
  64. package/lib/move/kinematics/DeltaKinematics.js +39 -0
  65. package/lib/move/kinematics/HangprinterKinematics.d.ts +8 -0
  66. package/lib/move/kinematics/HangprinterKinematics.js +25 -0
  67. package/lib/move/kinematics/KinematicsBase.d.ts +36 -0
  68. package/lib/move/kinematics/KinematicsBase.js +55 -0
  69. package/lib/move/kinematics/PolarKinematics.d.ts +6 -0
  70. package/lib/move/kinematics/PolarKinematics.js +19 -0
  71. package/lib/move/kinematics/ScaraKinematics.d.ts +5 -0
  72. package/lib/move/kinematics/ScaraKinematics.js +16 -0
  73. package/lib/move/kinematics/index.d.ts +7 -0
  74. package/lib/move/kinematics/index.js +48 -0
  75. package/lib/network/NetworkInterface.d.ts +27 -0
  76. package/lib/network/NetworkInterface.js +36 -0
  77. package/lib/network/index.d.ts +12 -0
  78. package/lib/network/index.js +19 -0
  79. package/lib/plugins/PluginManifest.d.ts +59 -0
  80. package/lib/plugins/PluginManifest.js +112 -0
  81. package/lib/plugins/index.d.ts +7 -0
  82. package/lib/plugins/index.js +13 -0
  83. package/lib/scanner/index.d.ts +13 -0
  84. package/lib/scanner/index.js +21 -0
  85. package/lib/sensors/AnalogSensor.d.ts +23 -0
  86. package/lib/sensors/AnalogSensor.js +31 -0
  87. package/lib/sensors/Endstop.d.ts +13 -0
  88. package/lib/sensors/Endstop.js +21 -0
  89. package/lib/sensors/FilamentMonitors/FilamentMonitorBase.d.ts +23 -0
  90. package/lib/sensors/FilamentMonitors/FilamentMonitorBase.js +31 -0
  91. package/lib/sensors/FilamentMonitors/LaserFilamentMonitor.d.ts +21 -0
  92. package/lib/sensors/FilamentMonitors/LaserFilamentMonitor.js +45 -0
  93. package/lib/sensors/FilamentMonitors/PulsedFilamentMonitor.d.ts +20 -0
  94. package/lib/sensors/FilamentMonitors/PulsedFilamentMonitor.js +44 -0
  95. package/lib/sensors/FilamentMonitors/RotatingMagnetFilamentMonitor.d.ts +21 -0
  96. package/lib/sensors/FilamentMonitors/RotatingMagnetFilamentMonitor.js +45 -0
  97. package/lib/sensors/FilamentMonitors/index.d.ts +6 -0
  98. package/lib/sensors/FilamentMonitors/index.js +32 -0
  99. package/lib/sensors/Probe.d.ts +32 -0
  100. package/lib/sensors/Probe.js +40 -0
  101. package/lib/sensors/index.d.ts +16 -0
  102. package/lib/sensors/index.js +27 -0
  103. package/lib/spindles/index.d.ts +16 -0
  104. package/lib/spindles/index.js +24 -0
  105. package/lib/state/MachineStatus.d.ts +16 -0
  106. package/lib/state/MachineStatus.js +20 -0
  107. package/lib/state/MessageBox.d.ts +15 -0
  108. package/lib/state/MessageBox.js +23 -0
  109. package/lib/state/RestorePoint.d.ts +11 -0
  110. package/lib/state/RestorePoint.js +17 -0
  111. package/lib/state/index.d.ts +52 -0
  112. package/lib/state/index.js +70 -0
  113. package/lib/tools/index.d.ts +25 -0
  114. package/lib/tools/index.js +33 -0
  115. package/lib/userSessions/index.d.ts +17 -0
  116. package/lib/userSessions/index.js +26 -0
  117. package/lib/volumes/index.d.ts +10 -0
  118. package/lib/volumes/index.js +16 -0
  119. package/package.json +29 -0
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZLeadscrewKinematics = exports.TiltCorrection = exports.MoveSegmentation = exports.KinematicsName = void 0;
4
+ const ModelObject_1 = require("../../ModelObject");
5
+ var KinematicsName;
6
+ (function (KinematicsName) {
7
+ KinematicsName["cartesian"] = "cartesian";
8
+ KinematicsName["coreXY"] = "corexy";
9
+ KinematicsName["coreXYU"] = "corexyu";
10
+ KinematicsName["coreXYUV"] = "corexyuv";
11
+ KinematicsName["coreXZ"] = "corexz";
12
+ KinematicsName["markForged"] = "markforged";
13
+ KinematicsName["fiveBarScara"] = "fivebarscara";
14
+ KinematicsName["hangprinter"] = "hangprinter";
15
+ KinematicsName["delta"] = "delta";
16
+ KinematicsName["polar"] = "polar";
17
+ KinematicsName["rotaryDelta"] = "rotary delta";
18
+ KinematicsName["scara"] = "scara";
19
+ KinematicsName["unknown"] = "unknown";
20
+ })(KinematicsName = exports.KinematicsName || (exports.KinematicsName = {}));
21
+ class MoveSegmentation extends ModelObject_1.default {
22
+ constructor() {
23
+ super(...arguments);
24
+ this.segmentsPerSec = 0;
25
+ this.minSegmentLength = 0;
26
+ }
27
+ }
28
+ exports.MoveSegmentation = MoveSegmentation;
29
+ class KinematicsBase extends ModelObject_1.default {
30
+ constructor(name) {
31
+ super();
32
+ this.segmentation = new MoveSegmentation();
33
+ this.name = name;
34
+ }
35
+ }
36
+ exports.default = KinematicsBase;
37
+ class TiltCorrection extends ModelObject_1.default {
38
+ constructor() {
39
+ super(...arguments);
40
+ this.correctionFactor = 0;
41
+ this.lastCorrections = [];
42
+ this.maxCorrection = 0;
43
+ this.screwPitch = 0;
44
+ this.screwX = [];
45
+ this.screwY = [];
46
+ }
47
+ }
48
+ exports.TiltCorrection = TiltCorrection;
49
+ class ZLeadscrewKinematics extends KinematicsBase {
50
+ constructor() {
51
+ super(...arguments);
52
+ this.tiltCorrection = new TiltCorrection();
53
+ }
54
+ }
55
+ exports.ZLeadscrewKinematics = ZLeadscrewKinematics;
@@ -0,0 +1,6 @@
1
+ import { IModelObject } from "../../ModelObject";
2
+ import KinematicsBase from "./KinematicsBase";
3
+ export default class PolarKinematics extends KinematicsBase {
4
+ constructor();
5
+ update(jsonElement: any): IModelObject | null;
6
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const KinematicsBase_1 = require("./KinematicsBase");
4
+ const index_1 = require("./index");
5
+ class PolarKinematics extends KinematicsBase_1.default {
6
+ constructor() {
7
+ super(KinematicsBase_1.KinematicsName.polar);
8
+ }
9
+ update(jsonElement) {
10
+ if (jsonElement === null) {
11
+ throw new Error("Kinematics must not be null");
12
+ }
13
+ if (typeof jsonElement.name === "string" && this.name !== jsonElement.name) {
14
+ return (0, index_1.getKinematics)(jsonElement.name).update(jsonElement);
15
+ }
16
+ return super.update(jsonElement);
17
+ }
18
+ }
19
+ exports.default = PolarKinematics;
@@ -0,0 +1,5 @@
1
+ import { IModelObject } from "../../ModelObject";
2
+ import { ZLeadscrewKinematics } from "./KinematicsBase";
3
+ export default class ScaraKinematics extends ZLeadscrewKinematics {
4
+ update(jsonElement: any): IModelObject | null;
5
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const KinematicsBase_1 = require("./KinematicsBase");
4
+ const index_1 = require("./index");
5
+ class ScaraKinematics extends KinematicsBase_1.ZLeadscrewKinematics {
6
+ update(jsonElement) {
7
+ if (jsonElement === null) {
8
+ throw new Error("Kinematics must not be null");
9
+ }
10
+ if (typeof jsonElement.name === "string" && this.name !== jsonElement.name) {
11
+ return (0, index_1.getKinematics)(jsonElement.name).update(jsonElement);
12
+ }
13
+ return super.update(jsonElement);
14
+ }
15
+ }
16
+ exports.default = ScaraKinematics;
@@ -0,0 +1,7 @@
1
+ import { IModelObject } from "../../ModelObject";
2
+ import KinematicsBase, { KinematicsName } from "./KinematicsBase";
3
+ export default class Kinematics extends KinematicsBase {
4
+ constructor();
5
+ update(jsonElement: any): IModelObject | null;
6
+ }
7
+ export declare function getKinematics(name: KinematicsName): KinematicsBase;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getKinematics = void 0;
4
+ const KinematicsBase_1 = require("./KinematicsBase");
5
+ const CoreKinematics_1 = require("./CoreKinematics");
6
+ const DeltaKinematics_1 = require("./DeltaKinematics");
7
+ const HangprinterKinematics_1 = require("./HangprinterKinematics");
8
+ const ScaraKinematics_1 = require("./ScaraKinematics");
9
+ const PolarKinematics_1 = require("./PolarKinematics");
10
+ class Kinematics extends KinematicsBase_1.default {
11
+ constructor() {
12
+ super(KinematicsBase_1.KinematicsName.unknown);
13
+ }
14
+ update(jsonElement) {
15
+ if (jsonElement === null) {
16
+ throw new Error("Kinematics must not be null");
17
+ }
18
+ if (typeof jsonElement.name === "string" && this.name !== jsonElement.name) {
19
+ return getKinematics(jsonElement.name).update(jsonElement);
20
+ }
21
+ return super.update(jsonElement);
22
+ }
23
+ }
24
+ exports.default = Kinematics;
25
+ function getKinematics(name) {
26
+ switch (name) {
27
+ case KinematicsBase_1.KinematicsName.cartesian:
28
+ case KinematicsBase_1.KinematicsName.coreXY:
29
+ case KinematicsBase_1.KinematicsName.coreXYU:
30
+ case KinematicsBase_1.KinematicsName.coreXYUV:
31
+ case KinematicsBase_1.KinematicsName.coreXZ:
32
+ case KinematicsBase_1.KinematicsName.markForged:
33
+ return new CoreKinematics_1.default(name);
34
+ case KinematicsBase_1.KinematicsName.delta:
35
+ case KinematicsBase_1.KinematicsName.rotaryDelta:
36
+ return new DeltaKinematics_1.default(name);
37
+ case KinematicsBase_1.KinematicsName.hangprinter:
38
+ return new HangprinterKinematics_1.default();
39
+ case KinematicsBase_1.KinematicsName.fiveBarScara:
40
+ case KinematicsBase_1.KinematicsName.scara:
41
+ return new ScaraKinematics_1.default(name);
42
+ case KinematicsBase_1.KinematicsName.polar:
43
+ return new PolarKinematics_1.default();
44
+ default:
45
+ return name;
46
+ }
47
+ }
48
+ exports.getKinematics = getKinematics;
@@ -0,0 +1,27 @@
1
+ import ModelObject from "../ModelObject";
2
+ export declare enum NetworkProtocol {
3
+ HTTP = "http",
4
+ HTTPS = "https",
5
+ FTP = "ftp",
6
+ SFTP = "sftp",
7
+ Telnet = "telnet",
8
+ SSH = "ssh"
9
+ }
10
+ export declare enum NetworkInterfaceType {
11
+ lan = "lan",
12
+ wifi = "wifi"
13
+ }
14
+ export default class NetworkInterface extends ModelObject {
15
+ activeProtocols: Set<NetworkProtocol>;
16
+ actualIP: string | null;
17
+ configuredIP: string | null;
18
+ dnsServer: string | null;
19
+ firmwareVersion: string | null;
20
+ gateway: string | null;
21
+ mac: string | null;
22
+ numReconnects: number | null;
23
+ signal: number | null;
24
+ speed: number | null;
25
+ subnet: string | null;
26
+ type: NetworkInterfaceType;
27
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NetworkInterfaceType = exports.NetworkProtocol = void 0;
4
+ const ModelObject_1 = require("../ModelObject");
5
+ var NetworkProtocol;
6
+ (function (NetworkProtocol) {
7
+ NetworkProtocol["HTTP"] = "http";
8
+ NetworkProtocol["HTTPS"] = "https";
9
+ NetworkProtocol["FTP"] = "ftp";
10
+ NetworkProtocol["SFTP"] = "sftp";
11
+ NetworkProtocol["Telnet"] = "telnet";
12
+ NetworkProtocol["SSH"] = "ssh";
13
+ })(NetworkProtocol = exports.NetworkProtocol || (exports.NetworkProtocol = {}));
14
+ var NetworkInterfaceType;
15
+ (function (NetworkInterfaceType) {
16
+ NetworkInterfaceType["lan"] = "lan";
17
+ NetworkInterfaceType["wifi"] = "wifi";
18
+ })(NetworkInterfaceType = exports.NetworkInterfaceType || (exports.NetworkInterfaceType = {}));
19
+ class NetworkInterface extends ModelObject_1.default {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.activeProtocols = new Set();
23
+ this.actualIP = null;
24
+ this.configuredIP = null;
25
+ this.dnsServer = null;
26
+ this.firmwareVersion = null;
27
+ this.gateway = null;
28
+ this.mac = null;
29
+ this.numReconnects = null;
30
+ this.signal = null;
31
+ this.speed = null;
32
+ this.subnet = null;
33
+ this.type = NetworkInterfaceType.wifi;
34
+ }
35
+ }
36
+ exports.default = NetworkInterface;
@@ -0,0 +1,12 @@
1
+ import ModelObject from "../ModelObject";
2
+ import ModelCollection from "../ModelCollection";
3
+ import NetworkInterface from "./NetworkInterface";
4
+ export declare const DefaultName = "My Duet";
5
+ export declare const DefaultHostname = "duet";
6
+ export declare const DefaultPassword = "reprap";
7
+ export default class Network extends ModelObject {
8
+ corsSite: string | null;
9
+ hostname: string;
10
+ readonly interfaces: ModelCollection<NetworkInterface>;
11
+ name: string;
12
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DefaultPassword = exports.DefaultHostname = exports.DefaultName = void 0;
4
+ const ModelObject_1 = require("../ModelObject");
5
+ const ModelCollection_1 = require("../ModelCollection");
6
+ const NetworkInterface_1 = require("./NetworkInterface");
7
+ exports.DefaultName = "My Duet";
8
+ exports.DefaultHostname = "duet";
9
+ exports.DefaultPassword = "reprap";
10
+ class Network extends ModelObject_1.default {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.corsSite = null;
14
+ this.hostname = exports.DefaultHostname;
15
+ this.interfaces = new ModelCollection_1.default(NetworkInterface_1.default);
16
+ this.name = exports.DefaultName;
17
+ }
18
+ }
19
+ exports.default = Network;
@@ -0,0 +1,59 @@
1
+ import ModelObject from "../ModelObject";
2
+ export declare enum SbcPermission {
3
+ none = "none",
4
+ commandExecution = "commandExecution",
5
+ codeInterceptionRead = "codeInterceptionRead",
6
+ codeInterceptionReadWrite = "codeInterceptionReadWrite",
7
+ managePlugins = "managePlugins",
8
+ servicePlugins = "servicePlugins",
9
+ manageUserSessions = "manageUserSessions",
10
+ objectModelRead = "objectModelRead",
11
+ objectModelReadWrite = "objectModelReadWrite",
12
+ registerHttpEndpoints = "registerHttpEndpoints",
13
+ readFilaments = "readFilaments",
14
+ writeFilaments = "writeFilaments",
15
+ readFirmware = "readFirmware",
16
+ writeFirmware = "writeFilaments",
17
+ readGCodes = "readGCodes",
18
+ writeGCodes = "writeGCodes",
19
+ readMacros = "readMacros",
20
+ writeMacros = "writeMacros",
21
+ readMenu = "readMenu",
22
+ writeMenu = "writeMenu",
23
+ readSystem = "readSystem",
24
+ writeSystem = "writeSystem",
25
+ readWeb = "readWeb",
26
+ writeWeb = "writeWeb",
27
+ fileSystemAccess = "fileSystemAccess",
28
+ launchProcesses = "launchProcesses",
29
+ networkAccess = "networkAccess",
30
+ webcamAccess = "webcamAccess",
31
+ gpioAccess = "gpioAccess",
32
+ superUser = "superUser"
33
+ }
34
+ export default class PluginManifest extends ModelObject {
35
+ #private;
36
+ get id(): string;
37
+ set id(value: string);
38
+ get name(): string;
39
+ set name(value: string);
40
+ author: string;
41
+ version: string;
42
+ license: string;
43
+ homepage: string | null;
44
+ dwcVersion: string | null;
45
+ dwcDependencies: Array<string>;
46
+ sbcRequired: boolean;
47
+ sbcDsfVersion: string | null;
48
+ sbcExecutable: string | null;
49
+ sbcExecutableArguments: string | null;
50
+ sbcExtraExecutables: Array<string>;
51
+ sbcOutputRedirected: boolean;
52
+ sbcPermissions: Set<SbcPermission>;
53
+ sbcPackageDependencies: Array<string>;
54
+ sbcPluginDependencies: Array<string>;
55
+ sbcPythonDependencies: Array<string>;
56
+ rrfVersion: string | null;
57
+ data: Map<string, any>;
58
+ static checkVersion(actual: string, required: string): boolean;
59
+ }
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
+ };
7
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8
+ if (kind === "m") throw new TypeError("Private method is not writable");
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
11
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
12
+ };
13
+ var _PluginManifest_id, _PluginManifest_name;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.SbcPermission = void 0;
16
+ const ModelObject_1 = require("../ModelObject");
17
+ var SbcPermission;
18
+ (function (SbcPermission) {
19
+ SbcPermission["none"] = "none";
20
+ SbcPermission["commandExecution"] = "commandExecution";
21
+ SbcPermission["codeInterceptionRead"] = "codeInterceptionRead";
22
+ SbcPermission["codeInterceptionReadWrite"] = "codeInterceptionReadWrite";
23
+ SbcPermission["managePlugins"] = "managePlugins";
24
+ SbcPermission["servicePlugins"] = "servicePlugins";
25
+ SbcPermission["manageUserSessions"] = "manageUserSessions";
26
+ SbcPermission["objectModelRead"] = "objectModelRead";
27
+ SbcPermission["objectModelReadWrite"] = "objectModelReadWrite";
28
+ SbcPermission["registerHttpEndpoints"] = "registerHttpEndpoints";
29
+ SbcPermission["readFilaments"] = "readFilaments";
30
+ SbcPermission["writeFilaments"] = "writeFilaments";
31
+ SbcPermission["readFirmware"] = "readFirmware";
32
+ SbcPermission["writeFirmware"] = "writeFilaments";
33
+ SbcPermission["readGCodes"] = "readGCodes";
34
+ SbcPermission["writeGCodes"] = "writeGCodes";
35
+ SbcPermission["readMacros"] = "readMacros";
36
+ SbcPermission["writeMacros"] = "writeMacros";
37
+ SbcPermission["readMenu"] = "readMenu";
38
+ SbcPermission["writeMenu"] = "writeMenu";
39
+ SbcPermission["readSystem"] = "readSystem";
40
+ SbcPermission["writeSystem"] = "writeSystem";
41
+ SbcPermission["readWeb"] = "readWeb";
42
+ SbcPermission["writeWeb"] = "writeWeb";
43
+ SbcPermission["fileSystemAccess"] = "fileSystemAccess";
44
+ SbcPermission["launchProcesses"] = "launchProcesses";
45
+ SbcPermission["networkAccess"] = "networkAccess";
46
+ SbcPermission["webcamAccess"] = "webcamAccess";
47
+ SbcPermission["gpioAccess"] = "gpioAccess";
48
+ SbcPermission["superUser"] = "superUser";
49
+ })(SbcPermission = exports.SbcPermission || (exports.SbcPermission = {}));
50
+ class PluginManifest extends ModelObject_1.default {
51
+ constructor() {
52
+ super(...arguments);
53
+ _PluginManifest_id.set(this, "");
54
+ _PluginManifest_name.set(this, "");
55
+ this.author = "";
56
+ this.version = "1.0.0";
57
+ this.license = "LGPL-3.0-or-later";
58
+ this.homepage = null;
59
+ this.dwcVersion = null;
60
+ this.dwcDependencies = [];
61
+ this.sbcRequired = false;
62
+ this.sbcDsfVersion = null;
63
+ this.sbcExecutable = null;
64
+ this.sbcExecutableArguments = null;
65
+ this.sbcExtraExecutables = [];
66
+ this.sbcOutputRedirected = true;
67
+ this.sbcPermissions = new Set();
68
+ this.sbcPackageDependencies = [];
69
+ this.sbcPluginDependencies = [];
70
+ this.sbcPythonDependencies = [];
71
+ this.rrfVersion = null;
72
+ this.data = new Map();
73
+ }
74
+ get id() { return __classPrivateFieldGet(this, _PluginManifest_id, "f"); }
75
+ set id(value) {
76
+ if (!value || value.length > 32) {
77
+ throw new Error("Invalid plugin identifier");
78
+ }
79
+ for (const c in value.split("")) {
80
+ if (!/\w/.test(c)) {
81
+ throw new Error("Illegal plugin identifier");
82
+ }
83
+ }
84
+ __classPrivateFieldSet(this, _PluginManifest_id, value, "f");
85
+ }
86
+ get name() { return __classPrivateFieldGet(this, _PluginManifest_name, "f"); }
87
+ set name(value) {
88
+ if (!value || value.length > 64) {
89
+ throw new Error("Invalid plugin name");
90
+ }
91
+ for (const c in value.split("")) {
92
+ if (!/[\w -_]/.test(c)) {
93
+ throw new Error("Illegal plugin name");
94
+ }
95
+ }
96
+ __classPrivateFieldSet(this, _PluginManifest_name, value, "f");
97
+ }
98
+ static checkVersion(actual, required) {
99
+ if (required) {
100
+ const actualItems = actual.split(/[.\-+]/);
101
+ const requiredItems = required.split(/[.\-+]/);
102
+ for (let i = 0; i < Math.min(actualItems.length, requiredItems.length); i++) {
103
+ if (actualItems[i] !== requiredItems[i]) {
104
+ return false;
105
+ }
106
+ }
107
+ }
108
+ return true;
109
+ }
110
+ }
111
+ exports.default = PluginManifest;
112
+ _PluginManifest_id = new WeakMap(), _PluginManifest_name = new WeakMap();
@@ -0,0 +1,7 @@
1
+ import PluginManifest from "./PluginManifest";
2
+ export default class Plugin extends PluginManifest {
3
+ dsfFiles: Array<string>;
4
+ dwcFiles: Array<string>;
5
+ sdFiles: Array<string>;
6
+ pid: number;
7
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const PluginManifest_1 = require("./PluginManifest");
4
+ class Plugin extends PluginManifest_1.default {
5
+ constructor() {
6
+ super(...arguments);
7
+ this.dsfFiles = [];
8
+ this.dwcFiles = [];
9
+ this.sdFiles = [];
10
+ this.pid = -1;
11
+ }
12
+ }
13
+ exports.default = Plugin;
@@ -0,0 +1,13 @@
1
+ import ModelObject from "../ModelObject";
2
+ export declare enum ScannerStatus {
3
+ disconnected = "D",
4
+ idle = "I",
5
+ scanning = "S",
6
+ postProcessing = "P",
7
+ calibrating = "C",
8
+ uploading = "U"
9
+ }
10
+ export default class Scanner extends ModelObject {
11
+ progress: number;
12
+ status: ScannerStatus;
13
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ScannerStatus = void 0;
4
+ const ModelObject_1 = require("../ModelObject");
5
+ var ScannerStatus;
6
+ (function (ScannerStatus) {
7
+ ScannerStatus["disconnected"] = "D";
8
+ ScannerStatus["idle"] = "I";
9
+ ScannerStatus["scanning"] = "S";
10
+ ScannerStatus["postProcessing"] = "P";
11
+ ScannerStatus["calibrating"] = "C";
12
+ ScannerStatus["uploading"] = "U";
13
+ })(ScannerStatus = exports.ScannerStatus || (exports.ScannerStatus = {}));
14
+ class Scanner extends ModelObject_1.default {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.progress = 0;
18
+ this.status = ScannerStatus.disconnected;
19
+ }
20
+ }
21
+ exports.default = Scanner;
@@ -0,0 +1,23 @@
1
+ import ModelObject from "../ModelObject";
2
+ export declare enum AnalogSensorType {
3
+ thermistor = "thermistor",
4
+ pt1000 = "pt1000",
5
+ max31865 = "rtdmax31865",
6
+ max31855 = "thermocouplemax31855",
7
+ max31856 = "thermocouplemax31856",
8
+ linearAnalog = "linearanalog",
9
+ dht11 = "dht11",
10
+ dht21 = "dht21",
11
+ dht22 = "dht22",
12
+ dhtHumidity = "dhthumidity",
13
+ currentLoop = "currentloooppyro",
14
+ mcuTemp = "mcutemp",
15
+ drivers = "drivers",
16
+ driversDuex = "driversduex",
17
+ unknown = "unknown"
18
+ }
19
+ export default class AnalogSensor extends ModelObject {
20
+ lastReading: number | null;
21
+ name: string | null;
22
+ type: AnalogSensorType;
23
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AnalogSensorType = void 0;
4
+ const ModelObject_1 = require("../ModelObject");
5
+ var AnalogSensorType;
6
+ (function (AnalogSensorType) {
7
+ AnalogSensorType["thermistor"] = "thermistor";
8
+ AnalogSensorType["pt1000"] = "pt1000";
9
+ AnalogSensorType["max31865"] = "rtdmax31865";
10
+ AnalogSensorType["max31855"] = "thermocouplemax31855";
11
+ AnalogSensorType["max31856"] = "thermocouplemax31856";
12
+ AnalogSensorType["linearAnalog"] = "linearanalog";
13
+ AnalogSensorType["dht11"] = "dht11";
14
+ AnalogSensorType["dht21"] = "dht21";
15
+ AnalogSensorType["dht22"] = "dht22";
16
+ AnalogSensorType["dhtHumidity"] = "dhthumidity";
17
+ AnalogSensorType["currentLoop"] = "currentloooppyro";
18
+ AnalogSensorType["mcuTemp"] = "mcutemp";
19
+ AnalogSensorType["drivers"] = "drivers";
20
+ AnalogSensorType["driversDuex"] = "driversduex";
21
+ AnalogSensorType["unknown"] = "unknown";
22
+ })(AnalogSensorType = exports.AnalogSensorType || (exports.AnalogSensorType = {}));
23
+ class AnalogSensor extends ModelObject_1.default {
24
+ constructor() {
25
+ super(...arguments);
26
+ this.lastReading = null;
27
+ this.name = null;
28
+ this.type = AnalogSensorType.unknown;
29
+ }
30
+ }
31
+ exports.default = AnalogSensor;
@@ -0,0 +1,13 @@
1
+ import ModelObject from "../ModelObject";
2
+ export declare enum EndstopType {
3
+ InputPin = "inputPin",
4
+ ZProbeAsEndstop = "zProbeAsEndstop",
5
+ motorStallAny = "motorStallAny",
6
+ motorStallIndividual = "motorStallIndividual",
7
+ unknown = "unknown"
8
+ }
9
+ export default class Endstop extends ModelObject {
10
+ highEnd: boolean;
11
+ triggered: boolean;
12
+ type: EndstopType;
13
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EndstopType = void 0;
4
+ const ModelObject_1 = require("../ModelObject");
5
+ var EndstopType;
6
+ (function (EndstopType) {
7
+ EndstopType["InputPin"] = "inputPin";
8
+ EndstopType["ZProbeAsEndstop"] = "zProbeAsEndstop";
9
+ EndstopType["motorStallAny"] = "motorStallAny";
10
+ EndstopType["motorStallIndividual"] = "motorStallIndividual";
11
+ EndstopType["unknown"] = "unknown";
12
+ })(EndstopType = exports.EndstopType || (exports.EndstopType = {}));
13
+ class Endstop extends ModelObject_1.default {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.highEnd = false;
17
+ this.triggered = false;
18
+ this.type = EndstopType.unknown;
19
+ }
20
+ }
21
+ exports.default = Endstop;
@@ -0,0 +1,23 @@
1
+ import ModelObject from "../../ModelObject";
2
+ export declare enum FilamentMonitorStatus {
3
+ noMonitor = "noMonitor",
4
+ ok = "ok",
5
+ noDataReceived = "noDataReceived",
6
+ noFilament = "noFilament",
7
+ tooLittleMovement = "tooLittleMovement",
8
+ tooMuchMovement = "tooMuchMovement",
9
+ sensorError = "sensorError"
10
+ }
11
+ export declare enum FilamentMonitorType {
12
+ simple = "simple",
13
+ laser = "laser",
14
+ pulsed = "pulsed",
15
+ rotatingMagnet = "rotatingMagnet",
16
+ unknown = "unknown"
17
+ }
18
+ export default class FilamentMonitorBase extends ModelObject {
19
+ enabled: boolean;
20
+ status: FilamentMonitorStatus;
21
+ type: FilamentMonitorType;
22
+ constructor(type?: FilamentMonitorType);
23
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FilamentMonitorType = exports.FilamentMonitorStatus = void 0;
4
+ const ModelObject_1 = require("../../ModelObject");
5
+ var FilamentMonitorStatus;
6
+ (function (FilamentMonitorStatus) {
7
+ FilamentMonitorStatus["noMonitor"] = "noMonitor";
8
+ FilamentMonitorStatus["ok"] = "ok";
9
+ FilamentMonitorStatus["noDataReceived"] = "noDataReceived";
10
+ FilamentMonitorStatus["noFilament"] = "noFilament";
11
+ FilamentMonitorStatus["tooLittleMovement"] = "tooLittleMovement";
12
+ FilamentMonitorStatus["tooMuchMovement"] = "tooMuchMovement";
13
+ FilamentMonitorStatus["sensorError"] = "sensorError";
14
+ })(FilamentMonitorStatus = exports.FilamentMonitorStatus || (exports.FilamentMonitorStatus = {}));
15
+ var FilamentMonitorType;
16
+ (function (FilamentMonitorType) {
17
+ FilamentMonitorType["simple"] = "simple";
18
+ FilamentMonitorType["laser"] = "laser";
19
+ FilamentMonitorType["pulsed"] = "pulsed";
20
+ FilamentMonitorType["rotatingMagnet"] = "rotatingMagnet";
21
+ FilamentMonitorType["unknown"] = "unknown";
22
+ })(FilamentMonitorType = exports.FilamentMonitorType || (exports.FilamentMonitorType = {}));
23
+ class FilamentMonitorBase extends ModelObject_1.default {
24
+ constructor(type = FilamentMonitorType.unknown) {
25
+ super();
26
+ this.enabled = false;
27
+ this.status = FilamentMonitorStatus.noDataReceived;
28
+ this.type = type;
29
+ }
30
+ }
31
+ exports.default = FilamentMonitorBase;