@openinc/parse-server-opendash 3.33.2 → 3.34.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.
- package/dist/featuremap.json +3 -1
- package/dist/features/meta/convertion/ticketMeta.d.ts +33 -0
- package/dist/features/meta/convertion/ticketMeta.js +139 -0
- package/dist/features/meta/types/MetaField.d.ts +117 -0
- package/dist/features/meta/types/MetaField.js +21 -0
- package/dist/features/permissions/types/Permissions.d.ts +2 -1
- package/dist/features/permissions/types/Permissions.js +1 -0
- package/dist/hooks/Maintenance_Schedule_Execution.js +2 -1
- package/dist/hooks/Meta_Config.d.ts +1 -0
- package/dist/hooks/Meta_Config.js +164 -0
- package/dist/hooks/Meta_Entry.d.ts +1 -0
- package/dist/hooks/Meta_Entry.js +17 -0
- package/dist/hooks/Spreadsheet_Workbook.d.ts +1 -0
- package/dist/hooks/Spreadsheet_Workbook.js +19 -0
- package/dist/types/Meta_Config.d.ts +20 -0
- package/dist/types/Meta_Config.js +29 -0
- package/dist/types/Meta_Entry.d.ts +33 -0
- package/dist/types/Meta_Entry.js +53 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.js +6 -2
- package/package.json +1 -1
- package/schema/Changelog.json +66 -66
- package/schema/Meta_Config.json +49 -0
- package/schema/Meta_Entry.json +66 -0
package/dist/featuremap.json
CHANGED
|
@@ -76,6 +76,8 @@
|
|
|
76
76
|
"OD3_Maintenance_Ticket_QR_Code": "MAINTENANCE",
|
|
77
77
|
"OD3_Maintenance_Ticket_Source": "MAINTENANCE",
|
|
78
78
|
"OD3_Maintenance_Ticket_Title": "MAINTENANCE",
|
|
79
|
+
"OD3_Meta_Config": "CORE",
|
|
80
|
+
"OD3_Meta_Entry": "CORE",
|
|
79
81
|
"OD3_MES_Article": "MONITORING",
|
|
80
82
|
"OD3_MES_Order": "MONITORING",
|
|
81
83
|
"OD3_MES_OrderPlan": "MONITORING",
|
|
@@ -104,7 +106,7 @@
|
|
|
104
106
|
"OD3_Share": "CORE",
|
|
105
107
|
"OD3_Source": "CORE",
|
|
106
108
|
"OD3_SourceMeta": "CORE",
|
|
107
|
-
"OD3_Spreadsheet_Workbook": "
|
|
109
|
+
"OD3_Spreadsheet_Workbook": "MONITORING",
|
|
108
110
|
"OD3_Tenant": "CORE",
|
|
109
111
|
"OD3_TenantMeta": "CORE",
|
|
110
112
|
"OD3_TenantTrustedDomain": "CORE",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { TicketMeta, TicketMetaField, TicketMetaFieldConfig, TicketTypedMetaField } from "../../openservice/types/TicketMeta";
|
|
2
|
+
import { MetaFieldConfig, MetaConfig } from "../types/MetaField";
|
|
3
|
+
/**
|
|
4
|
+
* Maps an old TicketMetaField (config) to the new MetaFieldConfig format.
|
|
5
|
+
*
|
|
6
|
+
* Key differences handled:
|
|
7
|
+
* - `description` → `help`
|
|
8
|
+
* - `name` and `label` become required (fallback to empty string / type)
|
|
9
|
+
* - `select.options` from `string[]` → `Array<{ label, value }>`
|
|
10
|
+
* - `select_parse` class-specific extensions (e.g. `onlyChildren`) are dropped
|
|
11
|
+
* (these should be handled via MetaServiceConfig custom fields if needed)
|
|
12
|
+
* - `value` fields are stripped (data now lives in Meta_Entry.values)
|
|
13
|
+
*/
|
|
14
|
+
declare function migrateFieldConfig(field: TicketMetaField | TicketTypedMetaField, index: number): MetaFieldConfig;
|
|
15
|
+
/**
|
|
16
|
+
* Migrates an entire old TicketMetaFieldConfig to the new MetaConfig format.
|
|
17
|
+
*/
|
|
18
|
+
export declare function migrateTicketMetaFieldConfig(oldConfig: TicketMetaFieldConfig): MetaConfig;
|
|
19
|
+
/**
|
|
20
|
+
* Migrates old ticket meta data (fields with inline values) into the
|
|
21
|
+
* new separated format:
|
|
22
|
+
*
|
|
23
|
+
* - `config`: A MetaConfig describing the field definitions
|
|
24
|
+
* - `values`: A flat `Record<string, any>` to be stored in Meta_Entry.values
|
|
25
|
+
*
|
|
26
|
+
* @param oldMeta - The old TicketMeta (or TicketTypedMetaField[])
|
|
27
|
+
* @returns An object with `config` and `values` ready for the new system
|
|
28
|
+
*/
|
|
29
|
+
export declare function migrateTicketMeta(oldMeta: TicketMeta): {
|
|
30
|
+
config: MetaConfig;
|
|
31
|
+
values: Record<string, unknown>;
|
|
32
|
+
};
|
|
33
|
+
export { migrateFieldConfig };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ────────────────────────────────────────────────────────────────────
|
|
3
|
+
// 1. Config Migration: Old TicketMetaField[] → New MetaFieldConfig[]
|
|
4
|
+
// ────────────────────────────────────────────────────────────────────
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.migrateTicketMetaFieldConfig = migrateTicketMetaFieldConfig;
|
|
7
|
+
exports.migrateTicketMeta = migrateTicketMeta;
|
|
8
|
+
exports.migrateFieldConfig = migrateFieldConfig;
|
|
9
|
+
/**
|
|
10
|
+
* Maps an old TicketMetaField (config) to the new MetaFieldConfig format.
|
|
11
|
+
*
|
|
12
|
+
* Key differences handled:
|
|
13
|
+
* - `description` → `help`
|
|
14
|
+
* - `name` and `label` become required (fallback to empty string / type)
|
|
15
|
+
* - `select.options` from `string[]` → `Array<{ label, value }>`
|
|
16
|
+
* - `select_parse` class-specific extensions (e.g. `onlyChildren`) are dropped
|
|
17
|
+
* (these should be handled via MetaServiceConfig custom fields if needed)
|
|
18
|
+
* - `value` fields are stripped (data now lives in Meta_Entry.values)
|
|
19
|
+
*/
|
|
20
|
+
function migrateFieldConfig(field, index) {
|
|
21
|
+
const name = field.name || `field_${index}`;
|
|
22
|
+
const label = field.label || name;
|
|
23
|
+
const help = field.description;
|
|
24
|
+
const base = {
|
|
25
|
+
name,
|
|
26
|
+
label,
|
|
27
|
+
...(help ? { help } : {}),
|
|
28
|
+
};
|
|
29
|
+
switch (field.type) {
|
|
30
|
+
case "string":
|
|
31
|
+
return {
|
|
32
|
+
...base,
|
|
33
|
+
type: "string",
|
|
34
|
+
};
|
|
35
|
+
case "number":
|
|
36
|
+
return {
|
|
37
|
+
...base,
|
|
38
|
+
type: "number",
|
|
39
|
+
...("min" in field && field.min != null ? { min: field.min } : {}),
|
|
40
|
+
...("max" in field && field.max != null ? { max: field.max } : {}),
|
|
41
|
+
};
|
|
42
|
+
case "boolean":
|
|
43
|
+
return {
|
|
44
|
+
...base,
|
|
45
|
+
type: "boolean",
|
|
46
|
+
};
|
|
47
|
+
case "date":
|
|
48
|
+
return {
|
|
49
|
+
...base,
|
|
50
|
+
type: "date",
|
|
51
|
+
};
|
|
52
|
+
case "select": {
|
|
53
|
+
const oldOptions = field.options;
|
|
54
|
+
const options = (oldOptions ?? []).map((opt) => ({
|
|
55
|
+
label: opt,
|
|
56
|
+
value: opt,
|
|
57
|
+
}));
|
|
58
|
+
return {
|
|
59
|
+
...base,
|
|
60
|
+
type: "select",
|
|
61
|
+
options,
|
|
62
|
+
...("multiple" in field && field.multiple != null
|
|
63
|
+
? { multiple: field.multiple }
|
|
64
|
+
: {}),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
case "select_parse": {
|
|
68
|
+
const result = {
|
|
69
|
+
...base,
|
|
70
|
+
type: "select_parse",
|
|
71
|
+
className: field.className ?? "",
|
|
72
|
+
...("display" in field && field.display != null
|
|
73
|
+
? { display: field.display }
|
|
74
|
+
: {}),
|
|
75
|
+
...("multiple" in field && field.multiple != null
|
|
76
|
+
? { multiple: field.multiple }
|
|
77
|
+
: {}),
|
|
78
|
+
};
|
|
79
|
+
return result;
|
|
80
|
+
}
|
|
81
|
+
default: {
|
|
82
|
+
// Fallback for any unknown types – treat as string
|
|
83
|
+
return {
|
|
84
|
+
...base,
|
|
85
|
+
type: "string",
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Migrates an entire old TicketMetaFieldConfig to the new MetaConfig format.
|
|
92
|
+
*/
|
|
93
|
+
function migrateTicketMetaFieldConfig(oldConfig) {
|
|
94
|
+
const fields = (oldConfig.fields ?? []).map((field, index) => migrateFieldConfig(field, index));
|
|
95
|
+
return { fields };
|
|
96
|
+
}
|
|
97
|
+
// ────────────────────────────────────────────────────────────────────
|
|
98
|
+
// 2. Data Migration: Old TicketTypedMetaField[] → New values record
|
|
99
|
+
// ────────────────────────────────────────────────────────────────────
|
|
100
|
+
/**
|
|
101
|
+
* Extracts the runtime value from an old TicketTypedMetaField.
|
|
102
|
+
*
|
|
103
|
+
* The old format stores values inline on the field objects.
|
|
104
|
+
* The new format stores them as a flat `{ [fieldName]: value }` map
|
|
105
|
+
* in Meta_Entry.values.
|
|
106
|
+
*/
|
|
107
|
+
function extractValue(field) {
|
|
108
|
+
if ("value" in field) {
|
|
109
|
+
return field.value;
|
|
110
|
+
}
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Migrates old ticket meta data (fields with inline values) into the
|
|
115
|
+
* new separated format:
|
|
116
|
+
*
|
|
117
|
+
* - `config`: A MetaConfig describing the field definitions
|
|
118
|
+
* - `values`: A flat `Record<string, any>` to be stored in Meta_Entry.values
|
|
119
|
+
*
|
|
120
|
+
* @param oldMeta - The old TicketMeta (or TicketTypedMetaField[])
|
|
121
|
+
* @returns An object with `config` and `values` ready for the new system
|
|
122
|
+
*/
|
|
123
|
+
function migrateTicketMeta(oldMeta) {
|
|
124
|
+
const fields = [];
|
|
125
|
+
const values = {};
|
|
126
|
+
for (let i = 0; i < oldMeta.fields.length; i++) {
|
|
127
|
+
const oldField = oldMeta.fields[i];
|
|
128
|
+
const fieldConfig = migrateFieldConfig(oldField, i);
|
|
129
|
+
fields.push(fieldConfig);
|
|
130
|
+
const value = extractValue(oldField);
|
|
131
|
+
if (value !== undefined) {
|
|
132
|
+
values[fieldConfig.name] = value;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
config: { fields },
|
|
137
|
+
values,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base properties shared by all meta field types
|
|
3
|
+
*/
|
|
4
|
+
export type MetaFieldBaseConfig = {
|
|
5
|
+
name: string;
|
|
6
|
+
label: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
help?: string;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
/** Default value for the field */
|
|
11
|
+
defaultValue?: any;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* String field type with optional validation
|
|
15
|
+
*/
|
|
16
|
+
export type MetaFieldString = MetaFieldBaseConfig & {
|
|
17
|
+
type: "string";
|
|
18
|
+
minLength?: number;
|
|
19
|
+
maxLength?: number;
|
|
20
|
+
pattern?: string;
|
|
21
|
+
multiline?: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Number field type with min/max constraints
|
|
25
|
+
*/
|
|
26
|
+
export type MetaFieldNumber = MetaFieldBaseConfig & {
|
|
27
|
+
type: "number";
|
|
28
|
+
min?: number;
|
|
29
|
+
max?: number;
|
|
30
|
+
step?: number;
|
|
31
|
+
unit?: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Boolean field type (checkbox/switch)
|
|
35
|
+
*/
|
|
36
|
+
export type MetaFieldBoolean = MetaFieldBaseConfig & {
|
|
37
|
+
type: "boolean";
|
|
38
|
+
defaultValue?: boolean;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Date field type with optional date range constraints
|
|
42
|
+
*/
|
|
43
|
+
export type MetaFieldDate = MetaFieldBaseConfig & {
|
|
44
|
+
type: "date";
|
|
45
|
+
minDate?: Date;
|
|
46
|
+
maxDate?: Date;
|
|
47
|
+
includeTime?: boolean;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Select field type with predefined options
|
|
51
|
+
*/
|
|
52
|
+
export type MetaFieldSelect = MetaFieldBaseConfig & {
|
|
53
|
+
type: "select";
|
|
54
|
+
options: Array<{
|
|
55
|
+
label: string;
|
|
56
|
+
value: string;
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
}>;
|
|
59
|
+
/** Optional grouping for select options */
|
|
60
|
+
groups?: Array<{
|
|
61
|
+
label: string;
|
|
62
|
+
options: Array<{
|
|
63
|
+
label: string;
|
|
64
|
+
value: string;
|
|
65
|
+
disabled?: boolean;
|
|
66
|
+
}>;
|
|
67
|
+
}>;
|
|
68
|
+
multiple?: boolean;
|
|
69
|
+
defaultValue?: string | string[];
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Parse select field type for selecting Parse objects
|
|
73
|
+
*/
|
|
74
|
+
export type MetaFieldSelectParse = MetaFieldBaseConfig & {
|
|
75
|
+
type: "select_parse";
|
|
76
|
+
className: string;
|
|
77
|
+
display?: string;
|
|
78
|
+
multiple?: boolean;
|
|
79
|
+
defaultValue?: string | string[];
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Array of all available field types
|
|
83
|
+
*/
|
|
84
|
+
export declare const META_FIELD_TYPES: readonly ["string", "number", "boolean", "date", "select", "select_parse"];
|
|
85
|
+
/**
|
|
86
|
+
* Literal type for field types derived from the array
|
|
87
|
+
*/
|
|
88
|
+
export type MetaFieldTypes = (typeof META_FIELD_TYPES)[number];
|
|
89
|
+
/**
|
|
90
|
+
* Mapped type for accessing MetaField types by their string literal
|
|
91
|
+
* @example MetaFieldMap["string"] => MetaFieldString
|
|
92
|
+
*/
|
|
93
|
+
export type MetaFieldMap = {
|
|
94
|
+
string: MetaFieldString;
|
|
95
|
+
number: MetaFieldNumber;
|
|
96
|
+
boolean: MetaFieldBoolean;
|
|
97
|
+
date: MetaFieldDate;
|
|
98
|
+
select: MetaFieldSelect;
|
|
99
|
+
select_parse: MetaFieldSelectParse;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Union type of all specific meta field types
|
|
103
|
+
*/
|
|
104
|
+
export type MetaFieldConfig = MetaFieldString | MetaFieldNumber | MetaFieldBoolean | MetaFieldDate | MetaFieldSelect | MetaFieldSelectParse;
|
|
105
|
+
/**
|
|
106
|
+
* Helper type to extract specific field type from MetaField union
|
|
107
|
+
*/
|
|
108
|
+
export type MetaFieldOfType<T extends MetaFieldTypes> = Extract<MetaFieldConfig, {
|
|
109
|
+
type: T;
|
|
110
|
+
}>;
|
|
111
|
+
/**
|
|
112
|
+
* Type guard to check if a field is of a specific type
|
|
113
|
+
*/
|
|
114
|
+
export declare function isMetaFieldType<T extends MetaFieldTypes>(field: MetaFieldConfig, type: T): field is MetaFieldOfType<T>;
|
|
115
|
+
export type MetaConfig = {
|
|
116
|
+
fields: MetaFieldConfig[];
|
|
117
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.META_FIELD_TYPES = void 0;
|
|
4
|
+
exports.isMetaFieldType = isMetaFieldType;
|
|
5
|
+
/**
|
|
6
|
+
* Array of all available field types
|
|
7
|
+
*/
|
|
8
|
+
exports.META_FIELD_TYPES = [
|
|
9
|
+
"string",
|
|
10
|
+
"number",
|
|
11
|
+
"boolean",
|
|
12
|
+
"date",
|
|
13
|
+
"select",
|
|
14
|
+
"select_parse",
|
|
15
|
+
];
|
|
16
|
+
/**
|
|
17
|
+
* Type guard to check if a field is of a specific type
|
|
18
|
+
*/
|
|
19
|
+
function isMetaFieldType(field, type) {
|
|
20
|
+
return field.type === type;
|
|
21
|
+
}
|
|
@@ -20,7 +20,8 @@ export declare namespace Permissions {
|
|
|
20
20
|
}
|
|
21
21
|
enum CORE {
|
|
22
22
|
adminoverview = "opendash:can-access-admin-overview",
|
|
23
|
-
mailadmin = "parse-admin:can-access-mail-admin"
|
|
23
|
+
mailadmin = "parse-admin:can-access-mail-admin",
|
|
24
|
+
metaadmin = "meta:can-see-admin"
|
|
24
25
|
}
|
|
25
26
|
enum DOCUMENTATION {
|
|
26
27
|
see_app = "documentation:can-see-app"
|
|
@@ -33,6 +33,7 @@ var Permissions;
|
|
|
33
33
|
// Access
|
|
34
34
|
CORE["adminoverview"] = "opendash:can-access-admin-overview";
|
|
35
35
|
CORE["mailadmin"] = "parse-admin:can-access-mail-admin";
|
|
36
|
+
CORE["metaadmin"] = "meta:can-see-admin";
|
|
36
37
|
})(CORE = Permissions.CORE || (Permissions.CORE = {}));
|
|
37
38
|
let DOCUMENTATION;
|
|
38
39
|
(function (DOCUMENTATION) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const schema_1 = require("../features/schema");
|
|
5
4
|
const openservice_1 = require("../features/openservice");
|
|
5
|
+
const schema_1 = require("../features/schema");
|
|
6
6
|
const openinc_openservice_save_ticket_data_1 = require("../functions/openinc-openservice-save-ticket-data");
|
|
7
7
|
const catchError_1 = require("../helper/catchError");
|
|
8
8
|
const types_1 = require("../types");
|
|
@@ -67,6 +67,7 @@ async function init() {
|
|
|
67
67
|
title: step.get("title"),
|
|
68
68
|
fields: step.get("fields"),
|
|
69
69
|
order: step.get("order"),
|
|
70
|
+
step: step,
|
|
70
71
|
});
|
|
71
72
|
const mediarelation = executionstep.relation("media");
|
|
72
73
|
if (media !== undefined) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function init(): Promise<void>;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.init = init;
|
|
4
|
+
const ticketMeta_1 = require("../features/meta/convertion/ticketMeta");
|
|
5
|
+
const schema_1 = require("../features/schema");
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
async function init() {
|
|
8
|
+
(0, schema_1.beforeSaveHook)(types_1.Meta_Config, async (request) => {
|
|
9
|
+
const { object, original, user } = request;
|
|
10
|
+
await (0, schema_1.defaultHandler)(request);
|
|
11
|
+
await (0, schema_1.defaultAclHandler)(request);
|
|
12
|
+
// TODO
|
|
13
|
+
});
|
|
14
|
+
(0, schema_1.afterSaveHook)(types_1.Meta_Config, async (request) => {
|
|
15
|
+
const { object, original, user } = request;
|
|
16
|
+
// TODO
|
|
17
|
+
});
|
|
18
|
+
// SCHEDULE META MIGRATION
|
|
19
|
+
// create configs from old meta config for schedule steps
|
|
20
|
+
await createMetaConfigFromStepMetaConfig();
|
|
21
|
+
// now we can create the schedule execution step meta witht the actual values of the meta fields
|
|
22
|
+
await createMetaEntriesFromScheduleExecutionStepMeta();
|
|
23
|
+
// create meta entries for existing tickets if not already done
|
|
24
|
+
await createMetaEntriesFromExistingTickets();
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Previously the meta config of a schedule step was saved directly on the step object.
|
|
28
|
+
* We now want to migrate this to the new MetaConfig format.
|
|
29
|
+
* This function creates a MetaConfig for each step that has a meta config and saves it in the Meta_Config class.
|
|
30
|
+
*/
|
|
31
|
+
async function createMetaConfigFromStepMetaConfig() {
|
|
32
|
+
const steps = await new Parse.Query(types_1.Maintenance_Schedule_Step).findAll({
|
|
33
|
+
useMasterKey: true,
|
|
34
|
+
});
|
|
35
|
+
for await (const step of steps) {
|
|
36
|
+
const context = ["schedule", "step", "meta", step.id];
|
|
37
|
+
const contextString = JSON.stringify(context);
|
|
38
|
+
const existingConfig = await new Parse.Query(types_1.Meta_Config)
|
|
39
|
+
.equalTo("context", contextString)
|
|
40
|
+
.first({ useMasterKey: true });
|
|
41
|
+
if (!existingConfig) {
|
|
42
|
+
const oldMetaConfig = step.get("fields");
|
|
43
|
+
// Skip creation if there is no old meta config or it is empty
|
|
44
|
+
if (!oldMetaConfig || Object.keys(oldMetaConfig).length === 0) {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
const newConfig = (0, ticketMeta_1.migrateTicketMetaFieldConfig)({ fields: oldMetaConfig });
|
|
48
|
+
const config = new types_1.Meta_Config();
|
|
49
|
+
config.set("context", contextString);
|
|
50
|
+
config.set("config", newConfig);
|
|
51
|
+
config.set("tenant", step.get("tenant"));
|
|
52
|
+
const stepACL = step.getACL();
|
|
53
|
+
if (stepACL)
|
|
54
|
+
config.setACL(stepACL);
|
|
55
|
+
await config.save(null, { useMasterKey: true });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Migrates old schedule execution step meta (which is stored inline on the Maintenance_Schedule_Execution_Step objects) to the new Meta_Entry format.
|
|
61
|
+
* For each execution step, it creates a Meta_Entry with the corresponding MetaConfig (created in the previous function) and the values extracted from the old meta fields.
|
|
62
|
+
* The context for each Meta_Entry is ["schedule", "step", "meta", stepId] to match the context of the Meta_Config created for the step meta config.
|
|
63
|
+
* This way, the Meta_Entry can be easily linked to the correct Meta_Config when accessed in the application.
|
|
64
|
+
*/
|
|
65
|
+
async function createMetaEntriesFromScheduleExecutionStepMeta() {
|
|
66
|
+
const executionSteps = await new Parse.Query(types_1.Maintenance_Schedule_Execution_Step).findAll({ useMasterKey: true });
|
|
67
|
+
for await (const exeStep of executionSteps) {
|
|
68
|
+
const step = exeStep.get("step");
|
|
69
|
+
// If the execution step is not linked to a schedule step, skip migration to avoid
|
|
70
|
+
// generating a context like ["schedule","step","meta", null] which would collide.
|
|
71
|
+
if (!step || !step.id) {
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
const context = ["schedule", "step", "meta", step.id];
|
|
75
|
+
const contextString = JSON.stringify(context);
|
|
76
|
+
const existingEntry = await new Parse.Query(types_1.Meta_Entry)
|
|
77
|
+
.equalTo("context", contextString)
|
|
78
|
+
.equalTo("entryClassName", types_1.Maintenance_Schedule_Execution_Step.className)
|
|
79
|
+
.equalTo("entryObjectId", exeStep.id)
|
|
80
|
+
.first({ useMasterKey: true });
|
|
81
|
+
if (!existingEntry) {
|
|
82
|
+
const oldMeta = exeStep.get("fields");
|
|
83
|
+
const { config, values } = (0, ticketMeta_1.migrateTicketMeta)({ fields: oldMeta });
|
|
84
|
+
const entry = new types_1.Meta_Entry();
|
|
85
|
+
entry.set("context", contextString);
|
|
86
|
+
entry.set("config", config);
|
|
87
|
+
entry.set("values", values);
|
|
88
|
+
entry.set("entryClassName", types_1.Maintenance_Schedule_Execution_Step.className);
|
|
89
|
+
entry.set("entryObjectId", exeStep.id);
|
|
90
|
+
entry.set("tenant", exeStep.get("tenant"));
|
|
91
|
+
const exeStepACL = exeStep.getACL();
|
|
92
|
+
if (exeStepACL)
|
|
93
|
+
entry.setACL(exeStepACL);
|
|
94
|
+
await entry.save(null, { useMasterKey: true });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* We create the Meta_Entries for existing tickets and build a record of all the field configs we encounter in order to create the corresponding Meta_Config for each tenant afterwards.
|
|
100
|
+
* The ticket's meta includes both the field config and the values, so we can
|
|
101
|
+
* migrate them to the new Meta_Entry format via the context.
|
|
102
|
+
*/
|
|
103
|
+
async function createMetaEntriesFromExistingTickets() {
|
|
104
|
+
const tickets = await new Parse.Query(types_1.Maintenance_Ticket)
|
|
105
|
+
.exists("meta")
|
|
106
|
+
.include("tenant")
|
|
107
|
+
.findAll({
|
|
108
|
+
useMasterKey: true,
|
|
109
|
+
});
|
|
110
|
+
const allConfigs = {};
|
|
111
|
+
const context = ["ticket", "meta", "config"];
|
|
112
|
+
const contextString = JSON.stringify(context);
|
|
113
|
+
for await (const ticket of tickets) {
|
|
114
|
+
const ticketMeta = ticket.get("meta");
|
|
115
|
+
if (!ticketMeta?.fields?.length)
|
|
116
|
+
continue;
|
|
117
|
+
const { config, values } = (0, ticketMeta_1.migrateTicketMeta)(ticketMeta);
|
|
118
|
+
// create the meta config for this ticket's tenant if it doesn't exist yet, or add any new fields to the existing config if it does
|
|
119
|
+
const newConfigFields = config.fields.filter((field) => allConfigs[ticket.get("tenant")?.id ?? "noTenant"]?.every((c) => c.name !== field.name) ?? true);
|
|
120
|
+
if (newConfigFields.length)
|
|
121
|
+
allConfigs[ticket.get("tenant")?.id ?? "noTenant"] =
|
|
122
|
+
allConfigs[ticket.get("tenant")?.id ?? "noTenant"]?.concat(newConfigFields) ?? newConfigFields;
|
|
123
|
+
const existingEntry = await new Parse.Query(types_1.Meta_Entry)
|
|
124
|
+
.equalTo("context", contextString)
|
|
125
|
+
.equalTo("entryClassName", types_1.Maintenance_Ticket.className)
|
|
126
|
+
.equalTo("entryObjectId", ticket.id)
|
|
127
|
+
.first({ useMasterKey: true });
|
|
128
|
+
if (!existingEntry) {
|
|
129
|
+
const entry = new types_1.Meta_Entry();
|
|
130
|
+
entry.set("context", contextString);
|
|
131
|
+
entry.set("config", config);
|
|
132
|
+
entry.set("values", values);
|
|
133
|
+
entry.set("entryClassName", types_1.Maintenance_Ticket.className);
|
|
134
|
+
entry.set("entryObjectId", ticket.id);
|
|
135
|
+
entry.set("tenant", ticket.get("tenant"));
|
|
136
|
+
const ticketACL = ticket.getACL();
|
|
137
|
+
if (ticketACL)
|
|
138
|
+
entry.setACL(ticketACL);
|
|
139
|
+
await entry.save(null, { useMasterKey: true });
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
for (const tenantId in allConfigs) {
|
|
143
|
+
const configQuery = new Parse.Query(types_1.Meta_Config).equalTo("context", contextString);
|
|
144
|
+
if (tenantId === "noTenant") {
|
|
145
|
+
configQuery.doesNotExist("tenant");
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
configQuery.equalTo("tenant", new types_1.Tenant({ objectId: tenantId }));
|
|
149
|
+
}
|
|
150
|
+
const existingConfig = await configQuery.first({ useMasterKey: true });
|
|
151
|
+
if (existingConfig)
|
|
152
|
+
continue;
|
|
153
|
+
// we dont use .get here because that would throw if the tenant id is invalid
|
|
154
|
+
const tenantFound = await new Parse.Query(types_1.Tenant)
|
|
155
|
+
.equalTo("objectId", tenantId)
|
|
156
|
+
.first({ useMasterKey: true });
|
|
157
|
+
const metaConfig = new types_1.Meta_Config({
|
|
158
|
+
context: contextString,
|
|
159
|
+
config: { fields: allConfigs[tenantId] },
|
|
160
|
+
tenant: tenantFound,
|
|
161
|
+
});
|
|
162
|
+
await metaConfig.save(null, { useMasterKey: true });
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function init(): Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.init = init;
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
async function init() {
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.Meta_Entry, async (request) => {
|
|
8
|
+
const { object, original, user } = request;
|
|
9
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
|
+
await (0, schema_1.defaultAclHandler)(request);
|
|
11
|
+
// TODO
|
|
12
|
+
});
|
|
13
|
+
(0, schema_1.afterSaveHook)(types_1.Meta_Entry, async (request) => {
|
|
14
|
+
const { object, original, user } = request;
|
|
15
|
+
// TODO
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function init(): Promise<void>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.init = init;
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
async function init() {
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.Spreadsheet_Workbook, async (request) => {
|
|
8
|
+
const { object, original, user } = request;
|
|
9
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
|
+
await (0, schema_1.defaultAclHandler)(request, { allowCustomACL: true });
|
|
11
|
+
if (user) {
|
|
12
|
+
object.getACL()?.setWriteAccess(user.id, true);
|
|
13
|
+
object.getACL()?.setReadAccess(user.id, true);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
// afterSaveHook(Spreadsheet_Workbook, async (request) => {
|
|
17
|
+
// const { object, original, user } = request;
|
|
18
|
+
// });
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Tenant } from "./Tenant";
|
|
2
|
+
export interface Meta_ConfigAttributes {
|
|
3
|
+
id: string;
|
|
4
|
+
objectId: string;
|
|
5
|
+
createdAt: Date;
|
|
6
|
+
updatedAt: Date;
|
|
7
|
+
config: any;
|
|
8
|
+
context?: string | undefined;
|
|
9
|
+
tenant?: Tenant | undefined;
|
|
10
|
+
}
|
|
11
|
+
export declare class Meta_Config extends Parse.Object<Meta_ConfigAttributes> {
|
|
12
|
+
static className: string;
|
|
13
|
+
constructor(data?: Partial<Meta_ConfigAttributes>);
|
|
14
|
+
get config(): any;
|
|
15
|
+
set config(value: any);
|
|
16
|
+
get context(): string | undefined;
|
|
17
|
+
set context(value: string | undefined);
|
|
18
|
+
get tenant(): Tenant | undefined;
|
|
19
|
+
set tenant(value: Tenant | undefined);
|
|
20
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Meta_Config = void 0;
|
|
4
|
+
class Meta_Config extends Parse.Object {
|
|
5
|
+
constructor(data) {
|
|
6
|
+
super("OD3_Meta_Config", data);
|
|
7
|
+
}
|
|
8
|
+
get config() {
|
|
9
|
+
return super.get("config");
|
|
10
|
+
}
|
|
11
|
+
set config(value) {
|
|
12
|
+
super.set("config", value);
|
|
13
|
+
}
|
|
14
|
+
get context() {
|
|
15
|
+
return super.get("context");
|
|
16
|
+
}
|
|
17
|
+
set context(value) {
|
|
18
|
+
super.set("context", value);
|
|
19
|
+
}
|
|
20
|
+
get tenant() {
|
|
21
|
+
return super.get("tenant");
|
|
22
|
+
}
|
|
23
|
+
set tenant(value) {
|
|
24
|
+
super.set("tenant", value);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.Meta_Config = Meta_Config;
|
|
28
|
+
Meta_Config.className = "OD3_Meta_Config";
|
|
29
|
+
Parse.Object.registerSubclass("OD3_Meta_Config", Meta_Config);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Meta_Config } from "./Meta_Config";
|
|
2
|
+
import type { Tenant } from "./Tenant";
|
|
3
|
+
export interface Meta_EntryAttributes {
|
|
4
|
+
id: string;
|
|
5
|
+
objectId: string;
|
|
6
|
+
createdAt: Date;
|
|
7
|
+
updatedAt: Date;
|
|
8
|
+
config?: any | undefined;
|
|
9
|
+
context?: string | undefined;
|
|
10
|
+
entryClassName?: string | undefined;
|
|
11
|
+
entryObjectId?: string | undefined;
|
|
12
|
+
origin?: Meta_Config | undefined;
|
|
13
|
+
tenant?: Tenant | undefined;
|
|
14
|
+
values?: any | undefined;
|
|
15
|
+
}
|
|
16
|
+
export declare class Meta_Entry extends Parse.Object<Meta_EntryAttributes> {
|
|
17
|
+
static className: string;
|
|
18
|
+
constructor(data?: Partial<Meta_EntryAttributes>);
|
|
19
|
+
get config(): any | undefined;
|
|
20
|
+
set config(value: any | undefined);
|
|
21
|
+
get context(): string | undefined;
|
|
22
|
+
set context(value: string | undefined);
|
|
23
|
+
get entryClassName(): string | undefined;
|
|
24
|
+
set entryClassName(value: string | undefined);
|
|
25
|
+
get entryObjectId(): string | undefined;
|
|
26
|
+
set entryObjectId(value: string | undefined);
|
|
27
|
+
get origin(): Meta_Config | undefined;
|
|
28
|
+
set origin(value: Meta_Config | undefined);
|
|
29
|
+
get tenant(): Tenant | undefined;
|
|
30
|
+
set tenant(value: Tenant | undefined);
|
|
31
|
+
get values(): any | undefined;
|
|
32
|
+
set values(value: any | undefined);
|
|
33
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Meta_Entry = void 0;
|
|
4
|
+
class Meta_Entry extends Parse.Object {
|
|
5
|
+
constructor(data) {
|
|
6
|
+
super("OD3_Meta_Entry", data);
|
|
7
|
+
}
|
|
8
|
+
get config() {
|
|
9
|
+
return super.get("config");
|
|
10
|
+
}
|
|
11
|
+
set config(value) {
|
|
12
|
+
super.set("config", value);
|
|
13
|
+
}
|
|
14
|
+
get context() {
|
|
15
|
+
return super.get("context");
|
|
16
|
+
}
|
|
17
|
+
set context(value) {
|
|
18
|
+
super.set("context", value);
|
|
19
|
+
}
|
|
20
|
+
get entryClassName() {
|
|
21
|
+
return super.get("entryClassName");
|
|
22
|
+
}
|
|
23
|
+
set entryClassName(value) {
|
|
24
|
+
super.set("entryClassName", value);
|
|
25
|
+
}
|
|
26
|
+
get entryObjectId() {
|
|
27
|
+
return super.get("entryObjectId");
|
|
28
|
+
}
|
|
29
|
+
set entryObjectId(value) {
|
|
30
|
+
super.set("entryObjectId", value);
|
|
31
|
+
}
|
|
32
|
+
get origin() {
|
|
33
|
+
return super.get("origin");
|
|
34
|
+
}
|
|
35
|
+
set origin(value) {
|
|
36
|
+
super.set("origin", value);
|
|
37
|
+
}
|
|
38
|
+
get tenant() {
|
|
39
|
+
return super.get("tenant");
|
|
40
|
+
}
|
|
41
|
+
set tenant(value) {
|
|
42
|
+
super.set("tenant", value);
|
|
43
|
+
}
|
|
44
|
+
get values() {
|
|
45
|
+
return super.get("values");
|
|
46
|
+
}
|
|
47
|
+
set values(value) {
|
|
48
|
+
super.set("values", value);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.Meta_Entry = Meta_Entry;
|
|
52
|
+
Meta_Entry.className = "OD3_Meta_Entry";
|
|
53
|
+
Parse.Object.registerSubclass("OD3_Meta_Entry", Meta_Entry);
|
package/dist/types/index.d.ts
CHANGED
|
@@ -160,6 +160,10 @@ export { Maintenance_Ticket_Source } from "./Maintenance_Ticket_Source";
|
|
|
160
160
|
export type { Maintenance_Ticket_SourceAttributes } from "./Maintenance_Ticket_Source";
|
|
161
161
|
export { Maintenance_Ticket_Title } from "./Maintenance_Ticket_Title";
|
|
162
162
|
export type { Maintenance_Ticket_TitleAttributes } from "./Maintenance_Ticket_Title";
|
|
163
|
+
export { Meta_Config } from "./Meta_Config";
|
|
164
|
+
export type { Meta_ConfigAttributes } from "./Meta_Config";
|
|
165
|
+
export { Meta_Entry } from "./Meta_Entry";
|
|
166
|
+
export type { Meta_EntryAttributes } from "./Meta_Entry";
|
|
163
167
|
export { Monitoring_DataHierachies } from "./Monitoring_DataHierachies";
|
|
164
168
|
export type { Monitoring_DataHierachiesAttributes } from "./Monitoring_DataHierachies";
|
|
165
169
|
export { Monitoring_Jobs } from "./Monitoring_Jobs";
|
package/dist/types/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MailTemplate = exports.ML_DataSelection = exports.MIAAS_MDSEndpoint = exports.MES_OrderPlan = exports.MES_Order = exports.MES_Article = exports.Log = exports.Language = exports.Knowledge_Video = exports.Knowledge_DocumentPage = exports.Knowledge_Document = exports.Knowledge_ChatMessage = exports.Knowledge_Chat = exports.Knowledge_Category = exports.Knowledge_Article = exports.GTFS_Wheelchair_Boarding = exports.GTFS_Wheelchair_Accessible = exports.GTFS_Trip = exports.GTFS_Stop_Times = exports.GTFS_Stop = exports.GTFS_Route_Type = exports.GTFS_Route = exports.GTFS_Location_Type = exports.GTFS_Level = exports.GTFS_Direction = exports.GTFS_Calendar = exports.GTFS_Bikes_Allowed = exports.GTFS_Agency = exports.EMS_ChargePoint = exports.Documentation_Document = exports.Documentation_Config = exports.Documentation_Category = exports.Dashboard = exports.Core_Token = exports.Core_Email = exports.Contact = exports.Config = exports.Company = exports.Changelog = exports.BDE_Unit = exports.BDE_Result = exports.BDE_Page = exports.BDE_ListEntry = exports.BDE_List = exports.BDE_Form = exports.Attachment = exports.Assets = exports.AlarmWebhook = exports.AlarmAction = exports.Alarm = void 0;
|
|
4
|
-
exports.
|
|
5
|
-
exports.WidgetPreset = exports.Widget = exports.WebPush = exports.VirtualKPI = exports.User_Setting = exports.UserData = exports.TenantTrustedDomain = exports.TenantMeta = exports.Tenant = exports.Spreadsheet_Workbook = exports.SourceMeta = exports.Source = exports.Share = exports.Report = void 0;
|
|
4
|
+
exports.RAG_Prompts = exports.RAG_Meta = exports.RAG_Interview = exports.RAG_Data = exports.Push = exports.Permission = exports.OWPlcItem = exports.OWPlcDevice = exports.Notification_Setting = exports.Notification = exports.NavigationItem = exports.NavigationGroup = exports.Monitoring_Slideshow = exports.Monitoring_ReportImage = exports.Monitoring_ParseTableSensor = exports.Monitoring_Jobs = exports.Monitoring_DataHierachies = exports.Meta_Entry = exports.Meta_Config = exports.Maintenance_Ticket_Title = exports.Maintenance_Ticket_Source = exports.Maintenance_Ticket_QR_Code = exports.Maintenance_Ticket_Project = exports.Maintenance_Ticket_Material = exports.Maintenance_Ticket_Kanban_State_Current = exports.Maintenance_Ticket_Kanban_State = exports.Maintenance_Ticket_Issuecategory = exports.Maintenance_Ticket_FormConfig = exports.Maintenance_Ticket_Data = exports.Maintenance_Ticket_Assignment = exports.Maintenance_Ticket = exports.Maintenance_Source_File = exports.Maintenance_Schedule_Template = exports.Maintenance_Schedule_Step = exports.Maintenance_Schedule_Execution_Step = exports.Maintenance_Schedule_Execution = exports.Maintenance_Schedule = exports.Maintenance_Restriction = exports.Maintenance_Project = exports.Maintenance_Priority = exports.Maintenance_Order = exports.Maintenance_Message = exports.Maintenance_Media = exports.Maintenance_Kanban_State = exports.Maintenance_Item = exports.Maintenance_Issuecategory = exports.Maintenance_Frequency = exports.Maintenance_Duedate = exports.Maintenance_Downtime = exports.Mail_Groups = void 0;
|
|
5
|
+
exports.WidgetPreset = exports.Widget = exports.WebPush = exports.VirtualKPI = exports.User_Setting = exports.UserData = exports.TenantTrustedDomain = exports.TenantMeta = exports.Tenant = exports.Spreadsheet_Workbook = exports.SourceMeta = exports.Source = exports.Share = exports.Report = exports.RAG_Request = exports.RAG_Questions = void 0;
|
|
6
6
|
var Alarm_1 = require("./Alarm");
|
|
7
7
|
Object.defineProperty(exports, "Alarm", { enumerable: true, get: function () { return Alarm_1.Alarm; } });
|
|
8
8
|
var AlarmAction_1 = require("./AlarmAction");
|
|
@@ -165,6 +165,10 @@ var Maintenance_Ticket_Source_1 = require("./Maintenance_Ticket_Source");
|
|
|
165
165
|
Object.defineProperty(exports, "Maintenance_Ticket_Source", { enumerable: true, get: function () { return Maintenance_Ticket_Source_1.Maintenance_Ticket_Source; } });
|
|
166
166
|
var Maintenance_Ticket_Title_1 = require("./Maintenance_Ticket_Title");
|
|
167
167
|
Object.defineProperty(exports, "Maintenance_Ticket_Title", { enumerable: true, get: function () { return Maintenance_Ticket_Title_1.Maintenance_Ticket_Title; } });
|
|
168
|
+
var Meta_Config_1 = require("./Meta_Config");
|
|
169
|
+
Object.defineProperty(exports, "Meta_Config", { enumerable: true, get: function () { return Meta_Config_1.Meta_Config; } });
|
|
170
|
+
var Meta_Entry_1 = require("./Meta_Entry");
|
|
171
|
+
Object.defineProperty(exports, "Meta_Entry", { enumerable: true, get: function () { return Meta_Entry_1.Meta_Entry; } });
|
|
168
172
|
var Monitoring_DataHierachies_1 = require("./Monitoring_DataHierachies");
|
|
169
173
|
Object.defineProperty(exports, "Monitoring_DataHierachies", { enumerable: true, get: function () { return Monitoring_DataHierachies_1.Monitoring_DataHierachies; } });
|
|
170
174
|
var Monitoring_Jobs_1 = require("./Monitoring_Jobs");
|
package/package.json
CHANGED
package/schema/Changelog.json
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
},
|
|
8
|
-
"masterkey": {
|
|
9
|
-
"type": "Boolean",
|
|
10
|
-
"required": true,
|
|
11
|
-
"default": false
|
|
12
|
-
},
|
|
13
|
-
"context": {
|
|
14
|
-
"type": "Object",
|
|
15
|
-
"required": false
|
|
16
|
-
},
|
|
17
|
-
"nameOfClass": {
|
|
18
|
-
"type": "String",
|
|
19
|
-
"required": true
|
|
20
|
-
},
|
|
21
|
-
"changedObject": {
|
|
22
|
-
"type": "String",
|
|
23
|
-
"required": true
|
|
24
|
-
},
|
|
25
|
-
"operation": {
|
|
26
|
-
"type": "String",
|
|
27
|
-
"required": true
|
|
28
|
-
},
|
|
29
|
-
"value": {
|
|
30
|
-
"type": "Object",
|
|
31
|
-
"required": false
|
|
32
|
-
},
|
|
33
|
-
"original": {
|
|
34
|
-
"type": "Object",
|
|
35
|
-
"required": false
|
|
36
|
-
}
|
|
2
|
+
"fields": {
|
|
3
|
+
"actingUser": {
|
|
4
|
+
"type": "Pointer",
|
|
5
|
+
"targetClass": "_User",
|
|
6
|
+
"required": false
|
|
37
7
|
},
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
8
|
+
"changedObject": {
|
|
9
|
+
"type": "String",
|
|
10
|
+
"required": true
|
|
11
|
+
},
|
|
12
|
+
"context": {
|
|
13
|
+
"type": "Object",
|
|
14
|
+
"required": false
|
|
15
|
+
},
|
|
16
|
+
"masterkey": {
|
|
17
|
+
"type": "Boolean",
|
|
18
|
+
"required": true,
|
|
19
|
+
"default": false
|
|
20
|
+
},
|
|
21
|
+
"nameOfClass": {
|
|
22
|
+
"type": "String",
|
|
23
|
+
"required": true
|
|
24
|
+
},
|
|
25
|
+
"operation": {
|
|
26
|
+
"type": "String",
|
|
27
|
+
"required": true
|
|
28
|
+
},
|
|
29
|
+
"original": {
|
|
30
|
+
"type": "Object",
|
|
31
|
+
"required": false
|
|
32
|
+
},
|
|
33
|
+
"value": {
|
|
34
|
+
"type": "Object",
|
|
35
|
+
"required": false
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"classLevelPermissions": {
|
|
39
|
+
"find": {
|
|
40
|
+
"requiresAuthentication": true,
|
|
41
|
+
"role:od-admin": true
|
|
42
|
+
},
|
|
43
|
+
"count": {
|
|
44
|
+
"requiresAuthentication": true,
|
|
45
|
+
"role:od-admin": true
|
|
46
|
+
},
|
|
47
|
+
"get": {
|
|
48
|
+
"requiresAuthentication": true,
|
|
49
|
+
"role:od-admin": true
|
|
50
|
+
},
|
|
51
|
+
"create": {
|
|
52
|
+
"role:od-admin": true
|
|
53
|
+
},
|
|
54
|
+
"update": {
|
|
55
|
+
"requiresAuthentication": true,
|
|
56
|
+
"role:od-admin": true
|
|
57
|
+
},
|
|
58
|
+
"delete": {
|
|
59
|
+
"requiresAuthentication": true,
|
|
60
|
+
"role:od-admin": true
|
|
61
|
+
},
|
|
62
|
+
"addField": {
|
|
63
|
+
"role:od-admin": true
|
|
64
|
+
},
|
|
65
|
+
"protectedFields": {
|
|
66
|
+
"*": []
|
|
68
67
|
}
|
|
69
|
-
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"fields": {
|
|
3
|
+
"config": {
|
|
4
|
+
"type": "Object",
|
|
5
|
+
"required": true
|
|
6
|
+
},
|
|
7
|
+
"context": {
|
|
8
|
+
"type": "String",
|
|
9
|
+
"required": false
|
|
10
|
+
},
|
|
11
|
+
"tenant": {
|
|
12
|
+
"type": "Pointer",
|
|
13
|
+
"targetClass": "{{PREFIX}}Tenant",
|
|
14
|
+
"required": false
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"classLevelPermissions": {
|
|
18
|
+
"ACL": {
|
|
19
|
+
"*": {
|
|
20
|
+
"read": true,
|
|
21
|
+
"write": true
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"find": {
|
|
25
|
+
"*": true
|
|
26
|
+
},
|
|
27
|
+
"count": {
|
|
28
|
+
"*": true
|
|
29
|
+
},
|
|
30
|
+
"get": {
|
|
31
|
+
"*": true
|
|
32
|
+
},
|
|
33
|
+
"create": {
|
|
34
|
+
"*": true
|
|
35
|
+
},
|
|
36
|
+
"update": {
|
|
37
|
+
"*": true
|
|
38
|
+
},
|
|
39
|
+
"delete": {
|
|
40
|
+
"*": true
|
|
41
|
+
},
|
|
42
|
+
"addField": {
|
|
43
|
+
"*": true
|
|
44
|
+
},
|
|
45
|
+
"protectedFields": {
|
|
46
|
+
"*": []
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"fields": {
|
|
3
|
+
"config": {
|
|
4
|
+
"type": "Object",
|
|
5
|
+
"required": false
|
|
6
|
+
},
|
|
7
|
+
"context": {
|
|
8
|
+
"type": "String",
|
|
9
|
+
"required": false
|
|
10
|
+
},
|
|
11
|
+
"entryClassName": {
|
|
12
|
+
"type": "String",
|
|
13
|
+
"required": false
|
|
14
|
+
},
|
|
15
|
+
"entryObjectId": {
|
|
16
|
+
"type": "String",
|
|
17
|
+
"required": false
|
|
18
|
+
},
|
|
19
|
+
"origin": {
|
|
20
|
+
"type": "Pointer",
|
|
21
|
+
"targetClass": "{{PREFIX}}Meta_Config",
|
|
22
|
+
"required": false
|
|
23
|
+
},
|
|
24
|
+
"tenant": {
|
|
25
|
+
"type": "Pointer",
|
|
26
|
+
"targetClass": "{{PREFIX}}Tenant",
|
|
27
|
+
"required": false
|
|
28
|
+
},
|
|
29
|
+
"values": {
|
|
30
|
+
"type": "Object",
|
|
31
|
+
"required": false
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"classLevelPermissions": {
|
|
35
|
+
"ACL": {
|
|
36
|
+
"*": {
|
|
37
|
+
"read": true,
|
|
38
|
+
"write": true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"find": {
|
|
42
|
+
"*": true
|
|
43
|
+
},
|
|
44
|
+
"count": {
|
|
45
|
+
"*": true
|
|
46
|
+
},
|
|
47
|
+
"get": {
|
|
48
|
+
"*": true
|
|
49
|
+
},
|
|
50
|
+
"create": {
|
|
51
|
+
"*": true
|
|
52
|
+
},
|
|
53
|
+
"update": {
|
|
54
|
+
"*": true
|
|
55
|
+
},
|
|
56
|
+
"delete": {
|
|
57
|
+
"*": true
|
|
58
|
+
},
|
|
59
|
+
"addField": {
|
|
60
|
+
"*": true
|
|
61
|
+
},
|
|
62
|
+
"protectedFields": {
|
|
63
|
+
"*": []
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|