@openinc/parse-server-opendash 5.1.0 → 5.1.1
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.
|
@@ -222,7 +222,7 @@ exports.customoptions = {
|
|
|
222
222
|
secret: false,
|
|
223
223
|
public: true,
|
|
224
224
|
default: "false",
|
|
225
|
-
description: "Create the classes of open.SERVICE v1 (OD3_Maintenance_*). No runtime any more — only for installations that still have to run the v1 → v2 migration.",
|
|
225
|
+
description: "Create the classes of open.SERVICE v1 (OD3_Maintenance_*). No runtime any more — only for installations that still have to run the v1 → v2 migration. Off leaves existing v1 classes and their data untouched, even with FORCE_SCHEMA and FORCE_DELETE_CLASS.",
|
|
226
226
|
},
|
|
227
227
|
FEATURE_MIAAS: {
|
|
228
228
|
env: "OPENINC_PARSE_FEATURE_MIAAS",
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { NotificationMap } from "./NotificationTypes.js";
|
|
1
2
|
/**
|
|
2
3
|
* Notifications that should be registered in the database by default when the server starts.
|
|
3
4
|
* The ACLs are set to od-admin only.
|
|
4
5
|
* Adding new Notification here requires the server to restart for registering those.
|
|
6
|
+
*
|
|
7
|
+
* One enum of keys per feature, e.g. `{ Feature: { key: "<ns>:notification.<key>" } }`.
|
|
8
|
+
* Empty since open.SERVICE v1 and its `schedule_due` were removed; the
|
|
9
|
+
* `OD3_Notification_Setting` rows registered for it stay in the database.
|
|
5
10
|
*/
|
|
6
|
-
export declare
|
|
7
|
-
enum OpenService {
|
|
8
|
-
schedule_due = "maintenance:notification.schedule_due"
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
+
export declare const Notifications: NotificationMap;
|
|
@@ -5,12 +5,9 @@ exports.Notifications = void 0;
|
|
|
5
5
|
* Notifications that should be registered in the database by default when the server starts.
|
|
6
6
|
* The ACLs are set to od-admin only.
|
|
7
7
|
* Adding new Notification here requires the server to restart for registering those.
|
|
8
|
+
*
|
|
9
|
+
* One enum of keys per feature, e.g. `{ Feature: { key: "<ns>:notification.<key>" } }`.
|
|
10
|
+
* Empty since open.SERVICE v1 and its `schedule_due` were removed; the
|
|
11
|
+
* `OD3_Notification_Setting` rows registered for it stay in the database.
|
|
8
12
|
*/
|
|
9
|
-
|
|
10
|
-
(function (Notifications) {
|
|
11
|
-
// needs to be exported for getAllNotifications() to work
|
|
12
|
-
let OpenService;
|
|
13
|
-
(function (OpenService) {
|
|
14
|
-
OpenService["schedule_due"] = "maintenance:notification.schedule_due";
|
|
15
|
-
})(OpenService = Notifications.OpenService || (Notifications.OpenService = {}));
|
|
16
|
-
})(Notifications || (exports.Notifications = Notifications = {}));
|
|
13
|
+
exports.Notifications = {};
|
|
@@ -14,6 +14,23 @@ const ensureIndexes_js_1 = require("./ensureIndexes.js");
|
|
|
14
14
|
const PREFIX = "OD3_";
|
|
15
15
|
const LOG_PREFIX = "[@openinc/parse-server-opendash]";
|
|
16
16
|
const schemaHandler = SchemaClass_js_1.SchemaClass.getInstance();
|
|
17
|
+
/**
|
|
18
|
+
* Remote classes the upload must leave alone.
|
|
19
|
+
*
|
|
20
|
+
* `OD3_Maintenance_*` is open.SERVICE v1: no runtime any more, but its data
|
|
21
|
+
* stays in the database for the v1 → v2 migration (`src/scripts/migration/`).
|
|
22
|
+
* With `FEATURE_MAINTENANCE` off, `filter` drops these classes from the
|
|
23
|
+
* *local* schema only — the remote side is filtered by `ignore` alone — so
|
|
24
|
+
* `FORCE_SCHEMA` + `FORCE_DELETE_CLASS` would delete every v1 class, data and
|
|
25
|
+
* all, as "not in the local schema".
|
|
26
|
+
*
|
|
27
|
+
* With the flag on they must not be ignored: they are in the local schema
|
|
28
|
+
* then, and a remote class the upload cannot see would be created a second
|
|
29
|
+
* time, which fails the start.
|
|
30
|
+
*/
|
|
31
|
+
function ignoredRemoteClasses() {
|
|
32
|
+
return (0, index_js_1.isFeatureEnabled)("MAINTENANCE") ? [] : ["OD3_Maintenance_*"];
|
|
33
|
+
}
|
|
17
34
|
async function initSchema() {
|
|
18
35
|
const config = index_js_1.ConfigInstance.getInstance();
|
|
19
36
|
await (0, parse_server_schema_1.loadConfig)();
|
|
@@ -24,6 +41,7 @@ async function initSchema() {
|
|
|
24
41
|
deleteFields: config.getBoolean("FORCE_SCHEMA"),
|
|
25
42
|
deleteNonEmptyClass: config.getBoolean("FORCE_DELETE_CLASS"),
|
|
26
43
|
filter: (className) => (0, isClassEnabled_js_1.isClassEnabled)(className),
|
|
44
|
+
ignore: ignoredRemoteClasses(),
|
|
27
45
|
});
|
|
28
46
|
}
|
|
29
47
|
catch (error) {
|