@duet3d/objectmodel 3.5.0-rc.16 → 3.5.0-rc.17
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/dist/ModelObject.js
CHANGED
|
@@ -101,6 +101,27 @@ class ModelObject {
|
|
|
101
101
|
console.warn(`Model set ${key} could not be changed because the target type ${typeof value} is invalid`);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
+
else if (prop instanceof Map) {
|
|
105
|
+
if (value instanceof Object) {
|
|
106
|
+
// Remove deleted items
|
|
107
|
+
for (let item in prop) {
|
|
108
|
+
if (!(item in value)) {
|
|
109
|
+
prop.delete(item);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// Add new items
|
|
113
|
+
for (let item in value) {
|
|
114
|
+
prop.set(item, value[item]);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else if (value === null) {
|
|
118
|
+
// Sets may be assignable to null
|
|
119
|
+
this[ownKey] = value;
|
|
120
|
+
}
|
|
121
|
+
else if (process.env.NODE_ENV !== "production") {
|
|
122
|
+
console.warn(`Model map ${key} could not be changed because the target type ${typeof value} is invalid`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
104
125
|
else if (prop === null || value === null) {
|
|
105
126
|
// Unfortunately we cannot do type checks during runtime without excessive extra work and possibly
|
|
106
127
|
// third-party libraries, so skip them for null values until there is a better solution.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duet3d/objectmodel",
|
|
3
|
-
"version": "3.5.0-rc.
|
|
3
|
+
"version": "3.5.0-rc.17",
|
|
4
4
|
"description": "TypeScript implementation of the Duet3D Object Model",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@types/jest": "^29.5.12",
|
|
25
25
|
"jest": "^29.7.0",
|
|
26
26
|
"ts-jest": "^29.1.2",
|
|
27
|
-
"typescript": "^5.4.
|
|
27
|
+
"typescript": "^5.4.3"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"/dist"
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import ModelObject from "../ModelObject";
|
|
2
|
-
export declare enum HttpEndpointType {
|
|
3
|
-
GET = "GET",
|
|
4
|
-
POST = "POST",
|
|
5
|
-
PUT = "PUT",
|
|
6
|
-
PATCH = "PATCH",
|
|
7
|
-
TRACE = "TRACE",
|
|
8
|
-
DELETE = "DELETE",
|
|
9
|
-
OPTIONS = "OPTIONS",
|
|
10
|
-
WebSocket = "WebSocket"
|
|
11
|
-
}
|
|
12
|
-
export declare class HttpEndpoint extends ModelObject {
|
|
13
|
-
endpointType: HttpEndpointType;
|
|
14
|
-
namespace: string;
|
|
15
|
-
path: string;
|
|
16
|
-
isUploadRequest: boolean;
|
|
17
|
-
unixSocket: string;
|
|
18
|
-
}
|
|
19
|
-
export default HttpEndpoint;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpEndpoint = exports.HttpEndpointType = void 0;
|
|
4
|
-
const ModelObject_1 = require("../ModelObject");
|
|
5
|
-
var HttpEndpointType;
|
|
6
|
-
(function (HttpEndpointType) {
|
|
7
|
-
HttpEndpointType["GET"] = "GET";
|
|
8
|
-
HttpEndpointType["POST"] = "POST";
|
|
9
|
-
HttpEndpointType["PUT"] = "PUT";
|
|
10
|
-
HttpEndpointType["PATCH"] = "PATCH";
|
|
11
|
-
HttpEndpointType["TRACE"] = "TRACE";
|
|
12
|
-
HttpEndpointType["DELETE"] = "DELETE";
|
|
13
|
-
HttpEndpointType["OPTIONS"] = "OPTIONS";
|
|
14
|
-
HttpEndpointType["WebSocket"] = "WebSocket";
|
|
15
|
-
})(HttpEndpointType = exports.HttpEndpointType || (exports.HttpEndpointType = {}));
|
|
16
|
-
class HttpEndpoint extends ModelObject_1.default {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.endpointType = HttpEndpointType.GET;
|
|
20
|
-
this.namespace = "";
|
|
21
|
-
this.path = "";
|
|
22
|
-
this.isUploadRequest = false;
|
|
23
|
-
this.unixSocket = "";
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.HttpEndpoint = HttpEndpoint;
|
|
27
|
-
exports.default = HttpEndpoint;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import ModelObject from "../ModelObject";
|
|
2
|
-
export declare enum AccessLevel {
|
|
3
|
-
readOnly = "readOnly",
|
|
4
|
-
readWrite = "readWrite"
|
|
5
|
-
}
|
|
6
|
-
export declare enum SessionType {
|
|
7
|
-
local = "local",
|
|
8
|
-
http = "http",
|
|
9
|
-
telnet = "telnet"
|
|
10
|
-
}
|
|
11
|
-
export declare class UserSession extends ModelObject {
|
|
12
|
-
accessLevel: AccessLevel;
|
|
13
|
-
id: number;
|
|
14
|
-
origin: string | null;
|
|
15
|
-
originId: number;
|
|
16
|
-
sessionType: SessionType;
|
|
17
|
-
}
|
|
18
|
-
export default UserSession;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserSession = exports.SessionType = exports.AccessLevel = void 0;
|
|
4
|
-
const ModelObject_1 = require("../ModelObject");
|
|
5
|
-
var AccessLevel;
|
|
6
|
-
(function (AccessLevel) {
|
|
7
|
-
AccessLevel["readOnly"] = "readOnly";
|
|
8
|
-
AccessLevel["readWrite"] = "readWrite";
|
|
9
|
-
})(AccessLevel = exports.AccessLevel || (exports.AccessLevel = {}));
|
|
10
|
-
var SessionType;
|
|
11
|
-
(function (SessionType) {
|
|
12
|
-
SessionType["local"] = "local";
|
|
13
|
-
SessionType["http"] = "http";
|
|
14
|
-
SessionType["telnet"] = "telnet";
|
|
15
|
-
})(SessionType = exports.SessionType || (exports.SessionType = {}));
|
|
16
|
-
class UserSession extends ModelObject_1.default {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.accessLevel = AccessLevel.readOnly;
|
|
20
|
-
this.id = 0;
|
|
21
|
-
this.origin = null;
|
|
22
|
-
this.originId = -1;
|
|
23
|
-
this.sessionType = SessionType.local;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.UserSession = UserSession;
|
|
27
|
-
exports.default = UserSession;
|