carta-controller 5.0.0-rc.0 → 5.0.3-patch1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/database.js +14 -5
- package/package.json +3 -3
- package/schemas/preferences_schema_2.json +54 -67
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# CARTA Controller
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/carta-controller/v/latest)
|
|
4
|
+
[](https://www.npmjs.com/package/carta-controller/v/beta)
|
|
5
5
|

|
|
6
6
|

|
|
7
7
|
|
package/dist/database.js
CHANGED
|
@@ -29,12 +29,14 @@ const preferenceSchema = require("../schemas/preferences_schema_2.json");
|
|
|
29
29
|
const layoutSchema = require("../schemas/layout_schema_2.json");
|
|
30
30
|
const snippetSchema = require("../schemas/snippet_schema_1.json");
|
|
31
31
|
const workspaceSchema = require("../schemas/workspace_schema_1.json");
|
|
32
|
-
const ajv = new ajv_1.default({ useDefaults:
|
|
32
|
+
const ajv = new ajv_1.default({ useDefaults: false, strictTypes: false });
|
|
33
|
+
const ajvWithDefaults = new ajv_1.default({ useDefaults: true, strictTypes: false });
|
|
33
34
|
(0, ajv_formats_1.default)(ajv);
|
|
35
|
+
(0, ajv_formats_1.default)(ajvWithDefaults);
|
|
34
36
|
const validatePreferences = ajv.compile(preferenceSchema);
|
|
35
|
-
const validateLayout =
|
|
36
|
-
const validateSnippet =
|
|
37
|
-
const validateWorkspace =
|
|
37
|
+
const validateLayout = ajvWithDefaults.compile(layoutSchema);
|
|
38
|
+
const validateSnippet = ajvWithDefaults.compile(snippetSchema);
|
|
39
|
+
const validateWorkspace = ajvWithDefaults.compile(workspaceSchema);
|
|
38
40
|
let client;
|
|
39
41
|
let preferenceCollection;
|
|
40
42
|
let layoutsCollection;
|
|
@@ -111,7 +113,7 @@ function handleGetPreferences(req, res, next) {
|
|
|
111
113
|
res.json({ success: true, preferences: doc });
|
|
112
114
|
}
|
|
113
115
|
else {
|
|
114
|
-
|
|
116
|
+
res.json({ success: true, preferences: {} });
|
|
115
117
|
}
|
|
116
118
|
}
|
|
117
119
|
catch (err) {
|
|
@@ -131,6 +133,7 @@ function handleSetPreferences(req, res, next) {
|
|
|
131
133
|
const update = req.body;
|
|
132
134
|
// Check for malformed update
|
|
133
135
|
if (!update || !Object.keys(update).length || update.username || update._id) {
|
|
136
|
+
util_1.logger.warning("Malformed preference update received");
|
|
134
137
|
return next({ statusCode: 400, message: "Malformed preference update" });
|
|
135
138
|
}
|
|
136
139
|
update.version = PREFERENCE_SCHEMA_VERSION;
|
|
@@ -142,9 +145,11 @@ function handleSetPreferences(req, res, next) {
|
|
|
142
145
|
try {
|
|
143
146
|
const updateResult = yield preferenceCollection.updateOne({ username: req.username }, { $set: update }, { upsert: true });
|
|
144
147
|
if (updateResult.acknowledged) {
|
|
148
|
+
util_1.logger.debug("Preferences updated");
|
|
145
149
|
res.json({ success: true });
|
|
146
150
|
}
|
|
147
151
|
else {
|
|
152
|
+
util_1.logger.warning("Error updating preferences");
|
|
148
153
|
return next({ statusCode: 500, message: "Problem updating preferences" });
|
|
149
154
|
}
|
|
150
155
|
}
|
|
@@ -166,6 +171,7 @@ function handleClearPreferences(req, res, next) {
|
|
|
166
171
|
const keys = (_a = req.body) === null || _a === void 0 ? void 0 : _a.keys;
|
|
167
172
|
// Check for malformed update
|
|
168
173
|
if (!keys || !Array.isArray(keys) || !keys.length) {
|
|
174
|
+
util_1.logger.debug("Malformed key list received for clearing preferences");
|
|
169
175
|
return next({ statusCode: 400, message: "Malformed key list" });
|
|
170
176
|
}
|
|
171
177
|
const update = {};
|
|
@@ -175,13 +181,16 @@ function handleClearPreferences(req, res, next) {
|
|
|
175
181
|
try {
|
|
176
182
|
const updateResult = yield preferenceCollection.updateOne({ username: req.username }, { $unset: update });
|
|
177
183
|
if (updateResult.acknowledged) {
|
|
184
|
+
util_1.logger.debug("Preferences cleared");
|
|
178
185
|
res.json({ success: true });
|
|
179
186
|
}
|
|
180
187
|
else {
|
|
188
|
+
util_1.logger.debug("Error clearing preferences");
|
|
181
189
|
return next({ statusCode: 500, message: "Problem clearing preferences" });
|
|
182
190
|
}
|
|
183
191
|
}
|
|
184
192
|
catch (err) {
|
|
193
|
+
util_1.logger.debug("Error clearing preferences");
|
|
185
194
|
util_1.logger.debug(err);
|
|
186
195
|
return next({ statusCode: 500, message: "Problem clearing preferences" });
|
|
187
196
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carta-controller",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.3-patch1",
|
|
4
4
|
"description": "NodeJS-based controller for CARTA",
|
|
5
5
|
"repository": "https://github.com/CARTAvis/carta-controller",
|
|
6
6
|
"homepage": "https://www.cartavis.org",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"ajv-formats": "^3.0.1",
|
|
26
26
|
"axios": "^1.8.2",
|
|
27
27
|
"body-parser": "^1.19.0",
|
|
28
|
-
"carta-frontend": "^5.0.
|
|
28
|
+
"carta-frontend": "^5.0.3",
|
|
29
29
|
"compression": "^1.8.0",
|
|
30
30
|
"cookie-parser": "^1.4.7",
|
|
31
31
|
"cors": "^2.8.5",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@types/cors": "^2.8.10",
|
|
61
61
|
"@types/express": "^4.17.11",
|
|
62
62
|
"@types/http-proxy": "^1.17.16",
|
|
63
|
-
"@types/jsonwebtoken": "
|
|
63
|
+
"@types/jsonwebtoken": "9.0.6",
|
|
64
64
|
"@types/lodash": "^4.17.15",
|
|
65
65
|
"@types/ms": "^0.7.31",
|
|
66
66
|
"@types/node": "^22.13.1",
|
|
@@ -12,13 +12,7 @@
|
|
|
12
12
|
"minimum": 1,
|
|
13
13
|
"maximum": 2
|
|
14
14
|
},
|
|
15
|
-
"username": {
|
|
16
|
-
"description": "Deprecated option",
|
|
17
|
-
"type": "string",
|
|
18
|
-
"minLength": 1
|
|
19
|
-
},
|
|
20
15
|
"theme": {
|
|
21
|
-
"type": "string",
|
|
22
16
|
"enum": ["auto", "light", "dark"]
|
|
23
17
|
},
|
|
24
18
|
"autoLaunch": {
|
|
@@ -29,37 +23,26 @@
|
|
|
29
23
|
"pattern": "^([+\\-])(date|filename|type|size)$"
|
|
30
24
|
},
|
|
31
25
|
"fileFilteringType": {
|
|
32
|
-
"type": "string",
|
|
33
26
|
"enum": ["fuzzy", "unix", "regex"]
|
|
34
27
|
},
|
|
35
28
|
"layout": {
|
|
36
29
|
"type": "string"
|
|
37
30
|
},
|
|
38
31
|
"cursorPosition": {
|
|
39
|
-
"type": "string",
|
|
40
32
|
"enum": ["fixed", "tracking"]
|
|
41
33
|
},
|
|
42
34
|
"zoomMode": {
|
|
43
|
-
"type": "string",
|
|
44
35
|
"enum": ["fit", "full"]
|
|
45
36
|
},
|
|
46
37
|
"zoomPoint": {
|
|
47
|
-
"type": "string",
|
|
48
38
|
"enum": ["cursor", "center"]
|
|
49
39
|
},
|
|
50
40
|
"dragPanning": {
|
|
51
41
|
"type": "boolean"
|
|
52
42
|
},
|
|
53
43
|
"spectralMatchingType": {
|
|
54
|
-
"type": "string",
|
|
55
44
|
"enum": ["VRAD", "VOPT", "FREQ", "WAVE", "AWAV", "CHANNEL"]
|
|
56
45
|
},
|
|
57
|
-
"wcsMatchingType": {
|
|
58
|
-
"description": "Deprecated option",
|
|
59
|
-
"type": "integer",
|
|
60
|
-
"minimum": 0,
|
|
61
|
-
"maximum": 3
|
|
62
|
-
},
|
|
63
46
|
"transparentImageBackground": {
|
|
64
47
|
"type": "boolean"
|
|
65
48
|
},
|
|
@@ -73,16 +56,18 @@
|
|
|
73
56
|
},
|
|
74
57
|
"percentile": {
|
|
75
58
|
"type": "number",
|
|
76
|
-
"
|
|
77
|
-
"
|
|
59
|
+
"minimum": 0,
|
|
60
|
+
"maximum": 100
|
|
78
61
|
},
|
|
79
62
|
"scalingAlpha": {
|
|
80
63
|
"type": "number",
|
|
81
|
-
"minimum": 1
|
|
64
|
+
"minimum": 0.1,
|
|
65
|
+
"maximum": 1000000
|
|
82
66
|
},
|
|
83
67
|
"scalingGamma": {
|
|
84
68
|
"type": "number",
|
|
85
|
-
"
|
|
69
|
+
"minimum": 0.1,
|
|
70
|
+
"maximum": 2
|
|
86
71
|
},
|
|
87
72
|
"nanColorHex": {
|
|
88
73
|
"type": "string",
|
|
@@ -97,7 +82,6 @@
|
|
|
97
82
|
"type": "boolean"
|
|
98
83
|
},
|
|
99
84
|
"contourGeneratorType": {
|
|
100
|
-
"type": "string",
|
|
101
85
|
"enum": ["start-step-multiplier", "min-max-scaling", "percentages-ref.value", "mean-sigma-list"]
|
|
102
86
|
},
|
|
103
87
|
"contourSmoothingMode": {
|
|
@@ -107,15 +91,18 @@
|
|
|
107
91
|
},
|
|
108
92
|
"contourSmoothingFactor": {
|
|
109
93
|
"type": "integer",
|
|
110
|
-
"minimum":
|
|
94
|
+
"minimum": 1,
|
|
95
|
+
"maximum": 33
|
|
111
96
|
},
|
|
112
97
|
"contourNumLevels": {
|
|
113
98
|
"type": "integer",
|
|
114
|
-
"minimum": 1
|
|
99
|
+
"minimum": 1,
|
|
100
|
+
"maximum": 15
|
|
115
101
|
},
|
|
116
102
|
"contourThickness": {
|
|
117
103
|
"type": "number",
|
|
118
|
-
"minimum": 0
|
|
104
|
+
"minimum": 0.5,
|
|
105
|
+
"maximum": 10
|
|
119
106
|
},
|
|
120
107
|
"contourColormapEnabled": {
|
|
121
108
|
"type": "boolean"
|
|
@@ -129,7 +116,8 @@
|
|
|
129
116
|
},
|
|
130
117
|
"vectorOverlayPixelAveraging": {
|
|
131
118
|
"type": "number",
|
|
132
|
-
"minimum":
|
|
119
|
+
"minimum": 0,
|
|
120
|
+
"maximum": 64,
|
|
133
121
|
"default": 4
|
|
134
122
|
},
|
|
135
123
|
"vectorOverlayFractionalIntensity": {
|
|
@@ -138,7 +126,8 @@
|
|
|
138
126
|
},
|
|
139
127
|
"vectorOverlayThickness": {
|
|
140
128
|
"type": "number",
|
|
141
|
-
"minimum": 0
|
|
129
|
+
"minimum": 0.5,
|
|
130
|
+
"maximum": 10
|
|
142
131
|
},
|
|
143
132
|
"vectorOverlayColormapEnabled": {
|
|
144
133
|
"type": "boolean"
|
|
@@ -163,7 +152,6 @@
|
|
|
163
152
|
"type": "boolean"
|
|
164
153
|
},
|
|
165
154
|
"wcsType": {
|
|
166
|
-
"type": "string",
|
|
167
155
|
"enum": ["automatic", "degrees", "sexagesimal"]
|
|
168
156
|
},
|
|
169
157
|
"colorbarVisible": {
|
|
@@ -173,7 +161,6 @@
|
|
|
173
161
|
"type": "boolean"
|
|
174
162
|
},
|
|
175
163
|
"colorbarPosition": {
|
|
176
|
-
"type": "string",
|
|
177
164
|
"enum": ["right", "top", "bottom"]
|
|
178
165
|
},
|
|
179
166
|
"colorbarWidth": {
|
|
@@ -196,12 +183,12 @@
|
|
|
196
183
|
"type": "string"
|
|
197
184
|
},
|
|
198
185
|
"beamType": {
|
|
199
|
-
"type": "string",
|
|
200
186
|
"enum": ["open", "solid"]
|
|
201
187
|
},
|
|
202
188
|
"beamWidth": {
|
|
203
189
|
"type": "number",
|
|
204
|
-
"minimum": 0
|
|
190
|
+
"minimum": 0.5,
|
|
191
|
+
"maximum": 10
|
|
205
192
|
},
|
|
206
193
|
"regionColor": {
|
|
207
194
|
"type": "string",
|
|
@@ -209,44 +196,44 @@
|
|
|
209
196
|
},
|
|
210
197
|
"regionLineWidth": {
|
|
211
198
|
"type": "number",
|
|
212
|
-
"minimum": 0
|
|
199
|
+
"minimum": 0.5,
|
|
200
|
+
"maximum": 10
|
|
213
201
|
},
|
|
214
202
|
"regionDashLength": {
|
|
215
203
|
"type": "integer",
|
|
216
|
-
"minimum": 0
|
|
204
|
+
"minimum": 0,
|
|
205
|
+
"maximum": 50
|
|
217
206
|
},
|
|
218
207
|
"regionType": {
|
|
219
|
-
"
|
|
220
|
-
"minimum": 0,
|
|
221
|
-
"maximum": 6
|
|
208
|
+
"enum": [0, 1, 2, 3, 4, 6]
|
|
222
209
|
},
|
|
223
210
|
"regionCreationMode": {
|
|
224
|
-
"type": "string",
|
|
225
211
|
"enum": ["center", "corner"]
|
|
226
212
|
},
|
|
227
213
|
"regionSize": {
|
|
228
214
|
"type": "number",
|
|
229
|
-
"minimum":
|
|
215
|
+
"minimum": 10,
|
|
216
|
+
"maximum": 100
|
|
230
217
|
},
|
|
231
218
|
"imageCompressionQuality": {
|
|
232
219
|
"type": "integer",
|
|
233
|
-
"minimum":
|
|
220
|
+
"minimum": 1,
|
|
234
221
|
"maximum": 32
|
|
235
222
|
},
|
|
236
223
|
"animationCompressionQuality": {
|
|
237
224
|
"type": "integer",
|
|
238
|
-
"minimum":
|
|
225
|
+
"minimum": 1,
|
|
239
226
|
"maximum": 32
|
|
240
227
|
},
|
|
241
228
|
"GPUTileCache": {
|
|
242
229
|
"type": "integer",
|
|
243
230
|
"multipleOf": 256,
|
|
244
|
-
"minimum":
|
|
231
|
+
"minimum": 256
|
|
245
232
|
},
|
|
246
233
|
"systemTileCache": {
|
|
247
234
|
"type": "integer",
|
|
248
|
-
"multipleOf":
|
|
249
|
-
"minimum":
|
|
235
|
+
"multipleOf": 256,
|
|
236
|
+
"minimum": 256
|
|
250
237
|
},
|
|
251
238
|
"contourDecimation": {
|
|
252
239
|
"type": "integer",
|
|
@@ -260,15 +247,12 @@
|
|
|
260
247
|
},
|
|
261
248
|
"contourChunkSize": {
|
|
262
249
|
"type": "integer",
|
|
263
|
-
"
|
|
264
|
-
"minimum": 25000,
|
|
265
|
-
"maximum": 1000000
|
|
250
|
+
"minimum": 1000
|
|
266
251
|
},
|
|
267
252
|
"contourControlMapWidth": {
|
|
268
253
|
"type": "integer",
|
|
269
254
|
"multipleOf": 128,
|
|
270
|
-
"minimum": 128
|
|
271
|
-
"maximum": 1024
|
|
255
|
+
"minimum": 128
|
|
272
256
|
},
|
|
273
257
|
"streamContoursWhileZooming": {
|
|
274
258
|
"type": "boolean"
|
|
@@ -276,10 +260,9 @@
|
|
|
276
260
|
"lowBandwidthMode": {
|
|
277
261
|
"type": "boolean"
|
|
278
262
|
},
|
|
279
|
-
"
|
|
280
|
-
"type": "
|
|
281
|
-
"minimum":
|
|
282
|
-
"maximum": 30
|
|
263
|
+
"stopAnimationPlaybackMinutes": {
|
|
264
|
+
"type": "number",
|
|
265
|
+
"minimum": 0
|
|
283
266
|
},
|
|
284
267
|
"pixelGridVisible": {
|
|
285
268
|
"type": "boolean"
|
|
@@ -295,7 +278,6 @@
|
|
|
295
278
|
"default": true
|
|
296
279
|
},
|
|
297
280
|
"cursorInfoVisible": {
|
|
298
|
-
"type": "string",
|
|
299
281
|
"enum": ["always", "activeImage", "hideTiled", "never"],
|
|
300
282
|
"default": "activeImage"
|
|
301
283
|
},
|
|
@@ -312,7 +294,6 @@
|
|
|
312
294
|
"default": false
|
|
313
295
|
},
|
|
314
296
|
"imagePanelMode": {
|
|
315
|
-
"type": "string",
|
|
316
297
|
"enum": ["dynamic", "fixed"],
|
|
317
298
|
"default": "dynamic"
|
|
318
299
|
},
|
|
@@ -339,7 +320,6 @@
|
|
|
339
320
|
"type": "string"
|
|
340
321
|
},
|
|
341
322
|
"telemetryMode": {
|
|
342
|
-
"type": "string",
|
|
343
323
|
"enum": ["none", "minimal", "usage"],
|
|
344
324
|
"default": "usage"
|
|
345
325
|
},
|
|
@@ -352,7 +332,6 @@
|
|
|
352
332
|
"default": false
|
|
353
333
|
},
|
|
354
334
|
"fileFilterMode": {
|
|
355
|
-
"type": "string",
|
|
356
335
|
"enum": ["content", "extension", "all"],
|
|
357
336
|
"default": "content"
|
|
358
337
|
},
|
|
@@ -383,10 +362,14 @@
|
|
|
383
362
|
"type": "string"
|
|
384
363
|
},
|
|
385
364
|
"annotationLineWidth": {
|
|
386
|
-
"type": "number"
|
|
365
|
+
"type": "number",
|
|
366
|
+
"minimum": 0.5,
|
|
367
|
+
"maximum": 10
|
|
387
368
|
},
|
|
388
369
|
"annotationDashLength": {
|
|
389
|
-
"type": "number"
|
|
370
|
+
"type": "number",
|
|
371
|
+
"minimum": 0,
|
|
372
|
+
"maximum": 50
|
|
390
373
|
},
|
|
391
374
|
"pointAnnotationShape": {
|
|
392
375
|
"type": "integer",
|
|
@@ -394,20 +377,23 @@
|
|
|
394
377
|
"maximum": 7
|
|
395
378
|
},
|
|
396
379
|
"pointAnnotationWidth": {
|
|
397
|
-
"type": "number"
|
|
380
|
+
"type": "number",
|
|
381
|
+
"minimum": 1,
|
|
382
|
+
"maximum": 100
|
|
398
383
|
},
|
|
399
384
|
"textAnnotationLineWidth": {
|
|
400
|
-
"type": "number"
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
"type": "number"
|
|
385
|
+
"type": "number",
|
|
386
|
+
"minimum": 0.5,
|
|
387
|
+
"maximum": 10
|
|
404
388
|
},
|
|
405
389
|
"pvPreviewCubeSizeLimit": {
|
|
406
|
-
"type": "number"
|
|
390
|
+
"type": "number",
|
|
391
|
+
"minimum": 0.1,
|
|
392
|
+
"description": "PV preview cube size limit, in GB."
|
|
407
393
|
},
|
|
408
394
|
"pvPreviewCubeSizeLimitUnit": {
|
|
409
|
-
"
|
|
410
|
-
"
|
|
395
|
+
"enum": ["TB", "GB", "MB", "kB", "B"],
|
|
396
|
+
"description": "This is a deprecated preference."
|
|
411
397
|
},
|
|
412
398
|
"logEventList": {
|
|
413
399
|
"type": "array",
|
|
@@ -416,7 +402,8 @@
|
|
|
416
402
|
}
|
|
417
403
|
},
|
|
418
404
|
"catalogDisplayedColumnSize": {
|
|
419
|
-
"type": "number"
|
|
405
|
+
"type": "number",
|
|
406
|
+
"minimum": 1
|
|
420
407
|
},
|
|
421
408
|
"catalogTableSeparatorPosition": {
|
|
422
409
|
"type": "string"
|