@iqb/validate-md-profile 0.3.1 → 0.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.
- package/README.md +24 -0
- package/index.d.ts +0 -1
- package/index.js +0 -1
- package/index.js.map +1 -1
- package/package.json +7 -23
- package/schema-validate.factory.d.ts +3 -13
- package/schema-validate.factory.js +105 -129
- package/schema-validate.factory.js.map +1 -1
- package/validate-md-profile.js +41 -16
- package/validate-md-profile.js.map +1 -1
- package/md-profile-config.schema.json +0 -52
- package/md-profile-schema.classes.d.ts +0 -52
- package/md-profile-schema.classes.js +0 -122
- package/md-profile-schema.classes.js.map +0 -1
- package/md-profile.schema.json +0 -204
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Install
|
|
2
|
+
|
|
3
|
+
Metadata profiles for web applications of [IQB](https://www.iqb.hu-berlin.de) are stored in GitHub-repositories. We group metadata profiles in so-called "profile stores" to improve the handling. Every profile store resides in one GitHub repository. The entry point of the store is a config file `profile-config.json` in the root of the repo.
|
|
4
|
+
|
|
5
|
+
Best choice is to take one of the GitHub repositories of IQB as template (naming convention: `p<nn>`). You learn the parameters and files and the way to use the programming of this repo `validate-md-profile`: You see a `package.json` (nodejs-universe) and two entries:
|
|
6
|
+
```json
|
|
7
|
+
"scripts": {
|
|
8
|
+
"validate": "validate-md-profile"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@iqb/validate-md-profile": "^0.4.0"
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
Sure the version of the package will change...
|
|
15
|
+
|
|
16
|
+
# Validate
|
|
17
|
+
|
|
18
|
+
Calling the script will validate the `profile-config.json` in the root and all profiles listed here:
|
|
19
|
+
* test the syntax of all files against the JSON schema
|
|
20
|
+
* check whether the ids of profile entries are unique
|
|
21
|
+
|
|
22
|
+
# Generate Documentation
|
|
23
|
+
|
|
24
|
+
To support the dialog between stakeholders during the development phase, the validate-script generates one markdown file as documentation, if a `/docs`-Folder is found.
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -15,5 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./validate-md-profile"), exports);
|
|
18
|
-
__exportStar(require("./md-profile-schema.classes"), exports);
|
|
19
18
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC"}
|
package/package.json
CHANGED
|
@@ -1,36 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iqb/validate-md-profile",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"author": "IQB - Institut zur Qualitätsentwicklung im Bildungswesen",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"description": "
|
|
7
|
-
"scripts": {
|
|
8
|
-
"test_profile": "ts-node ./test.ts md-profile",
|
|
9
|
-
"test_value": "ts-node ./test.ts md-values",
|
|
10
|
-
"test_profile_config": "ts-node ./test.ts md-profile-config",
|
|
11
|
-
"validate_profile": "ts-node src/validate-md-profile.ts json_schema/md-profile-config/test_valid/test1.json",
|
|
12
|
-
"generate_docs": "asyncapi generate fromTemplate json_schema/asyncapi.yaml @asyncapi/html-template -o ./public --force-write && cat json_schema/add.css >> ./public/css/global.min.css",
|
|
13
|
-
"prepare_publish": "rm -rf dist/* && tsc && cp ./json_schema/md-profile/md-profile.schema.json ./dist",
|
|
14
|
-
"postprepare_publish": "cp ./json_schema/md-profile-config/md-profile-config.schema.json ./dist && cp ./package.json ./dist",
|
|
15
|
-
"npm_publish": "./dist/npm publish --access public"
|
|
16
|
-
},
|
|
6
|
+
"description": "Tooling to validate and generate documentation of metadata profile stores",
|
|
17
7
|
"repository": {
|
|
18
8
|
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/iqb-vocabs/
|
|
9
|
+
"url": "git+https://github.com/iqb-vocabs/validate-md-profile.git"
|
|
20
10
|
},
|
|
21
11
|
"bugs": {
|
|
22
|
-
"url": "https://github.com/iqb-vocabs/
|
|
12
|
+
"url": "https://github.com/iqb-vocabs/validate-md-profile/issues"
|
|
23
13
|
},
|
|
24
|
-
"homepage": "https://github.com/iqb-vocabs/
|
|
14
|
+
"homepage": "https://github.com/iqb-vocabs/validate-md-profile#readme",
|
|
25
15
|
"dependencies": {
|
|
26
|
-
"ajv": "^8.12.0"
|
|
27
|
-
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"@asyncapi/cli": "^0.58.10",
|
|
30
|
-
"@asyncapi/html-template": "^1.0.0",
|
|
31
|
-
"@types/node": "^20.4.4",
|
|
32
|
-
"ts-node": "^10.9.1",
|
|
33
|
-
"typescript": "^5.2.2"
|
|
16
|
+
"ajv": "^8.12.0",
|
|
17
|
+
"@iqb/metadata": "0.3.2"
|
|
34
18
|
},
|
|
35
19
|
"bin": {
|
|
36
20
|
"validate-md-profile": "./validate-md-profile.js"
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import { MDProfile } from "
|
|
2
|
-
export interface ConfigData {
|
|
3
|
-
id: string;
|
|
4
|
-
title: {
|
|
5
|
-
lang: string;
|
|
6
|
-
value: string;
|
|
7
|
-
}[];
|
|
8
|
-
mdOutDir: string;
|
|
9
|
-
creator: any;
|
|
10
|
-
profiles: string[];
|
|
11
|
-
}
|
|
1
|
+
import { MDProfile, MDProfileStore } from "@iqb/metadata";
|
|
12
2
|
export declare abstract class SchemaValidateFactory {
|
|
13
|
-
static validateProfile(sourceFilename: string
|
|
14
|
-
static validateConfig(sourceFilename: string
|
|
3
|
+
static validateProfile(sourceFilename: string): MDProfile | null;
|
|
4
|
+
static validateConfig(sourceFilename: string): MDProfileStore | null;
|
|
15
5
|
}
|
|
@@ -2,178 +2,154 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SchemaValidateFactory = void 0;
|
|
4
4
|
var ajv_1 = require("ajv");
|
|
5
|
-
var
|
|
5
|
+
var metadata_1 = require("@iqb/metadata");
|
|
6
6
|
var SchemaValidateFactory = /** @class */ (function () {
|
|
7
7
|
function SchemaValidateFactory() {
|
|
8
8
|
}
|
|
9
|
-
SchemaValidateFactory.validateProfile = function (sourceFilename
|
|
10
|
-
var schema;
|
|
9
|
+
SchemaValidateFactory.validateProfile = function (sourceFilename) {
|
|
11
10
|
var mdProfile = null;
|
|
12
11
|
var fs = require('fs');
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
var compiledSchema;
|
|
13
|
+
var ajv = new ajv_1.default(); // options can be passed, e.g. {allErrors: true}
|
|
14
|
+
try {
|
|
15
|
+
compiledSchema = ajv.compile(metadata_1.profileSchemaJSON);
|
|
16
|
+
}
|
|
17
|
+
catch (err) {
|
|
18
|
+
console.log('\x1b[0;31mERROR\x1b[0m parsing profile schema');
|
|
19
|
+
console.error(err);
|
|
20
|
+
process.exitCode = 1;
|
|
21
|
+
compiledSchema = null;
|
|
22
|
+
}
|
|
23
|
+
if (compiledSchema) {
|
|
24
|
+
if (fs.existsSync(sourceFilename)) {
|
|
25
|
+
var profileData = void 0;
|
|
26
26
|
try {
|
|
27
|
-
|
|
27
|
+
var profile_data_raw = fs.readFileSync(sourceFilename, 'utf8');
|
|
28
|
+
profileData = JSON.parse(profile_data_raw);
|
|
28
29
|
}
|
|
29
30
|
catch (err) {
|
|
30
|
-
console.log("\u001B[0;31mERROR\u001B[0m parsing
|
|
31
|
+
console.log("\u001B[0;31mERROR\u001B[0m reading and parsing profile file '".concat(sourceFilename, "':"));
|
|
31
32
|
console.error(err);
|
|
33
|
+
profileData = null;
|
|
32
34
|
process.exitCode = 1;
|
|
33
|
-
compiledSchema = null;
|
|
34
35
|
}
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
var
|
|
36
|
+
if (profileData) {
|
|
37
|
+
try {
|
|
38
|
+
var valid = compiledSchema ? compiledSchema(profileData) : null;
|
|
39
|
+
if (!valid) {
|
|
40
|
+
console.log("\u001B[0;31mERROR\u001B[0m invalid profile file '".concat(sourceFilename, "':"));
|
|
41
|
+
console.error(compiledSchema ? compiledSchema.errors : 'error unknown');
|
|
42
|
+
profileData = null;
|
|
43
|
+
process.exitCode = 1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
console.log("\u001B[0;31mERROR\u001B[0m invalid profile file '".concat(sourceFilename, "':"));
|
|
48
|
+
console.error(err);
|
|
49
|
+
profileData = null;
|
|
50
|
+
process.exitCode = 1;
|
|
51
|
+
}
|
|
52
|
+
if (profileData) {
|
|
38
53
|
try {
|
|
39
|
-
|
|
40
|
-
profileData = JSON.parse(profile_data_raw);
|
|
54
|
+
mdProfile = new metadata_1.MDProfile(profileData);
|
|
41
55
|
}
|
|
42
56
|
catch (err) {
|
|
43
|
-
console.log("\u001B[0;31mERROR\u001B[0m
|
|
57
|
+
console.log("\u001B[0;31mERROR\u001B[0m parsing profile file '".concat(sourceFilename, "':"));
|
|
44
58
|
console.error(err);
|
|
45
|
-
|
|
59
|
+
mdProfile = null;
|
|
46
60
|
process.exitCode = 1;
|
|
47
61
|
}
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
catch (err) {
|
|
59
|
-
console.log("\u001B[0;31mERROR\u001B[0m invalid profile file '".concat(sourceFilename, "':"));
|
|
60
|
-
console.error(err);
|
|
61
|
-
profileData = null;
|
|
62
|
-
process.exitCode = 1;
|
|
63
|
-
}
|
|
64
|
-
if (profileData) {
|
|
65
|
-
try {
|
|
66
|
-
mdProfile = new md_profile_schema_classes_1.MDProfile(profileData);
|
|
67
|
-
}
|
|
68
|
-
catch (err) {
|
|
69
|
-
console.log("\u001B[0;31mERROR\u001B[0m parsing profile file '".concat(sourceFilename, "':"));
|
|
70
|
-
console.error(err);
|
|
71
|
-
mdProfile = null;
|
|
72
|
-
process.exitCode = 1;
|
|
73
|
-
}
|
|
74
|
-
if (mdProfile) {
|
|
75
|
-
var doubleIds_1 = [];
|
|
76
|
-
var allEntryIds_1 = [];
|
|
77
|
-
mdProfile.groups.forEach(function (g) {
|
|
78
|
-
g.entries.forEach(function (e) {
|
|
79
|
-
if (allEntryIds_1.includes(e.id)) {
|
|
80
|
-
doubleIds_1.push(e.id);
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
allEntryIds_1.push(e.id);
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
if (doubleIds_1.length > 0) {
|
|
88
|
-
console.log("\u001B[0;31mERROR\u001B[0m in profile file '".concat(sourceFilename, "': double ids ").concat(doubleIds_1.join(', ')));
|
|
89
|
-
mdProfile = null;
|
|
90
|
-
process.exitCode = 1;
|
|
62
|
+
if (mdProfile) {
|
|
63
|
+
var doubleIds_1 = [];
|
|
64
|
+
var allEntryIds_1 = [];
|
|
65
|
+
mdProfile.groups.forEach(function (g) {
|
|
66
|
+
g.entries.forEach(function (e) {
|
|
67
|
+
if (allEntryIds_1.includes(e.id)) {
|
|
68
|
+
doubleIds_1.push(e.id);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
allEntryIds_1.push(e.id);
|
|
91
72
|
}
|
|
92
|
-
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
if (doubleIds_1.length > 0) {
|
|
76
|
+
console.log("\u001B[0;31mERROR\u001B[0m in profile file '".concat(sourceFilename, "': double ids ").concat(doubleIds_1.join(', ')));
|
|
77
|
+
mdProfile = null;
|
|
78
|
+
process.exitCode = 1;
|
|
93
79
|
}
|
|
94
80
|
}
|
|
95
81
|
}
|
|
96
|
-
else {
|
|
97
|
-
console.log("\u001B[0;31mERROR\u001B[0m profile file '".concat(sourceFilename, "' not found"));
|
|
98
|
-
process.exitCode = 1;
|
|
99
|
-
}
|
|
100
82
|
}
|
|
101
83
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
84
|
+
else {
|
|
85
|
+
console.log("\u001B[0;31mERROR\u001B[0m profile file '".concat(sourceFilename, "' not found"));
|
|
86
|
+
process.exitCode = 1;
|
|
87
|
+
}
|
|
106
88
|
}
|
|
107
89
|
return mdProfile;
|
|
108
90
|
};
|
|
109
|
-
SchemaValidateFactory.validateConfig = function (sourceFilename
|
|
110
|
-
var
|
|
111
|
-
var mdConfig = null;
|
|
91
|
+
SchemaValidateFactory.validateConfig = function (sourceFilename) {
|
|
92
|
+
var mdStore = null;
|
|
112
93
|
var fs = require('fs');
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
94
|
+
var compiledSchema;
|
|
95
|
+
var ajv = new ajv_1.default(); // options can be passed, e.g. {allErrors: true}
|
|
96
|
+
try {
|
|
97
|
+
compiledSchema = ajv.compile(metadata_1.profileStoreSchemaJSON);
|
|
98
|
+
}
|
|
99
|
+
catch (err) {
|
|
100
|
+
console.log('\x1b[0;31mERROR\x1b[0m parsing profile config schema');
|
|
101
|
+
console.error(err);
|
|
102
|
+
process.exitCode = 1;
|
|
103
|
+
compiledSchema = null;
|
|
104
|
+
}
|
|
105
|
+
if (compiledSchema) {
|
|
106
|
+
if (fs.existsSync(sourceFilename)) {
|
|
107
|
+
var profileStoreData = void 0;
|
|
126
108
|
try {
|
|
127
|
-
|
|
109
|
+
var config_data_raw = fs.readFileSync(sourceFilename, 'utf8');
|
|
110
|
+
profileStoreData = JSON.parse(config_data_raw);
|
|
128
111
|
}
|
|
129
112
|
catch (err) {
|
|
130
|
-
console.log("\u001B[0;31mERROR\u001B[0m parsing
|
|
113
|
+
console.log("\u001B[0;31mERROR\u001B[0m reading and parsing config file '".concat(sourceFilename, "':"));
|
|
131
114
|
console.error(err);
|
|
115
|
+
profileStoreData = null;
|
|
132
116
|
process.exitCode = 1;
|
|
133
|
-
compiledSchema = null;
|
|
134
117
|
}
|
|
135
|
-
if (
|
|
136
|
-
|
|
118
|
+
if (profileStoreData) {
|
|
119
|
+
try {
|
|
120
|
+
var valid = compiledSchema ? compiledSchema(profileStoreData) : null;
|
|
121
|
+
if (!valid) {
|
|
122
|
+
console.log("\u001B[0;31mERROR\u001B[0m invalid config file '".concat(sourceFilename, "':"));
|
|
123
|
+
console.error(compiledSchema ? compiledSchema.errors : 'error unknown');
|
|
124
|
+
profileStoreData = null;
|
|
125
|
+
process.exitCode = 1;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
console.log("\u001B[0;31mERROR\u001B[0m invalid config file '".concat(sourceFilename, "':"));
|
|
130
|
+
console.error(err);
|
|
131
|
+
profileStoreData = null;
|
|
132
|
+
process.exitCode = 1;
|
|
133
|
+
}
|
|
134
|
+
if (profileStoreData) {
|
|
137
135
|
try {
|
|
138
|
-
|
|
139
|
-
mdConfig = JSON.parse(config_data_raw);
|
|
136
|
+
mdStore = new metadata_1.MDProfileStore(profileStoreData);
|
|
140
137
|
}
|
|
141
138
|
catch (err) {
|
|
142
|
-
console.log("\u001B[0;31mERROR\u001B[0m
|
|
139
|
+
console.log("\u001B[0;31mERROR\u001B[0m instanciating profile store '".concat(sourceFilename, "':"));
|
|
143
140
|
console.error(err);
|
|
144
|
-
|
|
141
|
+
mdStore = null;
|
|
145
142
|
process.exitCode = 1;
|
|
146
143
|
}
|
|
147
|
-
if (mdConfig) {
|
|
148
|
-
try {
|
|
149
|
-
var valid = compiledSchema ? compiledSchema(mdConfig) : null;
|
|
150
|
-
if (!valid) {
|
|
151
|
-
console.log("\u001B[0;31mERROR\u001B[0m invalid config file '".concat(sourceFilename, "':"));
|
|
152
|
-
console.error(compiledSchema ? compiledSchema.errors : 'error unknown');
|
|
153
|
-
mdConfig = null;
|
|
154
|
-
process.exitCode = 1;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
catch (err) {
|
|
158
|
-
console.log("\u001B[0;31mERROR\u001B[0m invalid config file '".concat(sourceFilename, "':"));
|
|
159
|
-
console.error(err);
|
|
160
|
-
mdConfig = null;
|
|
161
|
-
process.exitCode = 1;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
console.log("\u001B[0;31mERROR\u001B[0m config file '".concat(sourceFilename, "' not found"));
|
|
167
|
-
process.exitCode = 1;
|
|
168
144
|
}
|
|
169
145
|
}
|
|
170
146
|
}
|
|
147
|
+
else {
|
|
148
|
+
console.log("\u001B[0;31mERROR\u001B[0m config file '".concat(sourceFilename, "' not found"));
|
|
149
|
+
process.exitCode = 1;
|
|
150
|
+
}
|
|
171
151
|
}
|
|
172
|
-
|
|
173
|
-
console.log("\u001B[0;31mERROR\u001B[0m config file '".concat(sourceFilename, "' not found"));
|
|
174
|
-
process.exitCode = 1;
|
|
175
|
-
}
|
|
176
|
-
return mdConfig;
|
|
152
|
+
return mdStore;
|
|
177
153
|
};
|
|
178
154
|
return SchemaValidateFactory;
|
|
179
155
|
}());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-validate.factory.js","sourceRoot":"","sources":["../src/schema-validate.factory.ts"],"names":[],"mappings":";;;AAAA,2BAAsB;AACtB,
|
|
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AAI,CAAC;4BACf,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;yBACxB;qBACJ;iBACJ;aACJ;iBAAM;gBACH,OAAO,CAAC,GAAG,CAAC,kDAAuC,cAAc,gBAAa,CAAC,CAAC;gBAChF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;aACxB;SACJ;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;IACL,4BAAC;AAAD,CAAC,AAxID,IAwIC;AAxIqB,sDAAqB"}
|
package/validate-md-profile.js
CHANGED
|
@@ -2,28 +2,53 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
var schema_validate_factory_1 = require("./schema-validate.factory");
|
|
5
|
+
var mdTargetFolder = './docs';
|
|
6
|
+
var mdTargetFilename = "".concat(mdTargetFolder, "/README.md");
|
|
5
7
|
var configFileName = './profile-config.json';
|
|
6
8
|
if (process.argv[2]) {
|
|
7
9
|
configFileName = "./".concat(process.argv[2]);
|
|
8
10
|
}
|
|
9
|
-
var
|
|
10
|
-
var configSchemaFilename = 'md-profile-config.schema.json';
|
|
11
|
-
var configSchemaFullFilename = "".concat(__dirname, "/").concat(configSchemaFilename);
|
|
12
|
-
if (!fs.existsSync(configSchemaFullFilename)) {
|
|
13
|
-
configSchemaFullFilename = "./json_schema/md-profile-config/".concat(configSchemaFilename);
|
|
14
|
-
}
|
|
15
|
-
var mdConfig = schema_validate_factory_1.SchemaValidateFactory.validateConfig(configFileName, configSchemaFullFilename);
|
|
11
|
+
var mdConfig = schema_validate_factory_1.SchemaValidateFactory.validateConfig(configFileName);
|
|
16
12
|
if (mdConfig) {
|
|
17
|
-
console.log("config file '".concat(configFileName, "' is valid
|
|
18
|
-
var
|
|
19
|
-
var profileSchemaFullFilename_1 = "".concat(__dirname, "/").concat(profileSchemaFilename);
|
|
20
|
-
if (!fs.existsSync(profileSchemaFullFilename_1)) {
|
|
21
|
-
profileSchemaFullFilename_1 = "./json_schema/md-profile/".concat(profileSchemaFilename);
|
|
22
|
-
}
|
|
13
|
+
console.log("config file '".concat(configFileName, "' is valid: ").concat(mdConfig.title));
|
|
14
|
+
var allProfiles_1 = [];
|
|
23
15
|
mdConfig.profiles.forEach(function (p) {
|
|
24
|
-
var myMDProfile = schema_validate_factory_1.SchemaValidateFactory.validateProfile(p
|
|
25
|
-
if (myMDProfile)
|
|
26
|
-
|
|
16
|
+
var myMDProfile = schema_validate_factory_1.SchemaValidateFactory.validateProfile(p);
|
|
17
|
+
if (myMDProfile) {
|
|
18
|
+
var entryCount_1 = 0;
|
|
19
|
+
myMDProfile.groups.forEach(function (g) {
|
|
20
|
+
entryCount_1 += g.entries.length;
|
|
21
|
+
});
|
|
22
|
+
console.log("".concat(myMDProfile.groups.length, " ").concat(myMDProfile.groups.length === 1 ? 'group' : 'groups', " and ").concat(entryCount_1, " ").concat(entryCount_1 === 1 ? 'entry' : 'entries', " found in '").concat(p, "'."));
|
|
23
|
+
allProfiles_1.push(myMDProfile);
|
|
24
|
+
}
|
|
27
25
|
});
|
|
26
|
+
var fs = require('fs');
|
|
27
|
+
if (fs.existsSync(mdTargetFolder)) {
|
|
28
|
+
var mdContent_1 = "# ".concat(mdConfig.title, "\n");
|
|
29
|
+
mdContent_1 += "```\n".concat(mdConfig.id, "\n```\n\n");
|
|
30
|
+
if (mdConfig.creator)
|
|
31
|
+
mdContent_1 += "Autor/Organisation: ".concat(mdConfig.creator, "\n\n");
|
|
32
|
+
if (allProfiles_1.length > 0) {
|
|
33
|
+
mdContent_1 += "".concat(allProfiles_1.length, " ").concat(allProfiles_1.length === 1 ? 'Profil' : 'Profile', " definiert:\n\n");
|
|
34
|
+
allProfiles_1.forEach(function (p) {
|
|
35
|
+
mdContent_1 += "## Profil \"".concat(p.label, "\"\n");
|
|
36
|
+
mdContent_1 += "```\n".concat(p.id, "\n```\n\n");
|
|
37
|
+
p.groups.forEach(function (g) {
|
|
38
|
+
if (p.groups.length > 1)
|
|
39
|
+
mdContent_1 += "### Gruppe \"".concat(g.label, "\"\n\n");
|
|
40
|
+
g.entries.forEach(function (e) {
|
|
41
|
+
mdContent_1 += "* ".concat(e.label, " (").concat(e.id, ", ").concat(e.type, ")");
|
|
42
|
+
mdContent_1 += '\n';
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
mdContent_1 += 'Keine Profile definiert.\n';
|
|
49
|
+
}
|
|
50
|
+
fs.writeFileSync(mdTargetFilename, mdContent_1, { encoding: 'utf8' });
|
|
51
|
+
console.log("markdown file \"".concat(mdTargetFilename, "\" generated."));
|
|
52
|
+
}
|
|
28
53
|
}
|
|
29
54
|
//# sourceMappingURL=validate-md-profile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-md-profile.js","sourceRoot":"","sources":["../src/validate-md-profile.ts"],"names":[],"mappings":";;;AACA,qEAAgE;
|
|
1
|
+
{"version":3,"file":"validate-md-profile.js","sourceRoot":"","sources":["../src/validate-md-profile.ts"],"names":[],"mappings":";;;AACA,qEAAgE;AAGhE,IAAM,cAAc,GAAG,QAAQ,CAAC;AAChC,IAAM,gBAAgB,GAAG,UAAG,cAAc,eAAY,CAAC;AAEvD,IAAI,cAAc,GAAG,uBAAuB,CAAC;AAC7C,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;IACjB,cAAc,GAAG,YAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,CAAC;CAC3C;AAED,IAAM,QAAQ,GAAG,+CAAqB,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AACtE,IAAI,QAAQ,EAAE;IACV,OAAO,CAAC,GAAG,CAAC,uBAAgB,cAAc,yBAAe,QAAQ,CAAC,KAAK,CAAE,CAAC,CAAC;IAC3E,IAAI,aAAW,GAAgB,EAAE,CAAC;IAClC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,CAAC;QACvB,IA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,eAAW,CAAC,CAAC,EAAE,cAAc,CAAC;gBAC3C,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,CAAC;oBACd,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;wBAAE,WAAS,IAAI,uBAAe,CAAC,CAAC,KAAK,WAAO,CAAC;oBACpE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,UAAA,CAAC;wBACf,WAAS,IAAI,YAAK,CAAC,CAAC,KAAK,eAAK,CAAC,CAAC,EAAE,eAAK,CAAC,CAAC,IAAI,MAAG,CAAC;wBACjD,WAAS,IAAI,IAAI,CAAC;oBACtB,CAAC,CAAC,CAAA;gBACN,CAAC,CAAC,CAAA;YACN,CAAC,CAAC,CAAA;SACL;aAAM;YACH,WAAS,IAAI,4BAA4B,CAAC;SAC7C;QACD,EAAE,CAAC,aAAa,CAAC,gBAAgB,EAAE,WAAS,EAAE,EAAC,QAAQ,EAAE,MAAM,EAAC,CAAC,CAAC;QAClE,OAAO,CAAC,GAAG,CAAC,0BAAkB,gBAAgB,kBAAc,CAAC,CAAC;KACjE;CACJ"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$id": "https://w3id.org/iqb/vocabs/md-profile-config.schema.json",
|
|
3
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
-
"title": "Metadata Profile Store Config",
|
|
5
|
-
"description": "Configuration file to validate a metadata profile store",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"properties": {
|
|
8
|
-
"id": {
|
|
9
|
-
"type": "string",
|
|
10
|
-
"pattern": "^[0-9a-zA-Z_]+$",
|
|
11
|
-
"description": "Identifier for the metadata profile store as part of the uri"
|
|
12
|
-
},
|
|
13
|
-
"creator": {
|
|
14
|
-
"type": "string",
|
|
15
|
-
"description": "Creator as person or institution"
|
|
16
|
-
},
|
|
17
|
-
"title": {
|
|
18
|
-
"type": "array",
|
|
19
|
-
"items": {
|
|
20
|
-
"type": "object",
|
|
21
|
-
"properties": {
|
|
22
|
-
"lang": {
|
|
23
|
-
"type": "string",
|
|
24
|
-
"pattern": "^[a-z]+$",
|
|
25
|
-
"description": "Language of the value"
|
|
26
|
-
},
|
|
27
|
-
"value": {
|
|
28
|
-
"type": "string",
|
|
29
|
-
"description": "Language of the value"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"required": ["lang", "value"]
|
|
33
|
-
},
|
|
34
|
-
"minItems": 1
|
|
35
|
-
},
|
|
36
|
-
"mdOutDir": {
|
|
37
|
-
"type": "string",
|
|
38
|
-
"description": "Folder where the markdown output is written to.",
|
|
39
|
-
"default": "./docs"
|
|
40
|
-
},
|
|
41
|
-
"profiles": {
|
|
42
|
-
"type": "array",
|
|
43
|
-
"items": {
|
|
44
|
-
"type": "string",
|
|
45
|
-
"minLength": 1,
|
|
46
|
-
"description": "Name of the profile json files"
|
|
47
|
-
},
|
|
48
|
-
"minItems": 1
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
"required": ["id", "title", "creator", "profiles"]
|
|
52
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
export interface TextWithLanguage {
|
|
2
|
-
"lang": string;
|
|
3
|
-
"value": string;
|
|
4
|
-
}
|
|
5
|
-
export declare class ProfileEntryParametersVocabulary {
|
|
6
|
-
readonly url: string;
|
|
7
|
-
readonly allowMultipleValues: boolean;
|
|
8
|
-
readonly maxLevel: number;
|
|
9
|
-
readonly hideNumbering: boolean;
|
|
10
|
-
readonly hideTitle: boolean;
|
|
11
|
-
readonly hideDescription: boolean;
|
|
12
|
-
readonly addTextLanguages: string[];
|
|
13
|
-
constructor(profileEntryParameters: any);
|
|
14
|
-
}
|
|
15
|
-
export declare class ProfileEntryParametersText {
|
|
16
|
-
readonly format: string;
|
|
17
|
-
readonly textLanguages: string[];
|
|
18
|
-
readonly pattern: string;
|
|
19
|
-
constructor(profileEntryParameters: any);
|
|
20
|
-
}
|
|
21
|
-
export declare class ProfileEntryParametersNumber {
|
|
22
|
-
readonly digits: number;
|
|
23
|
-
readonly minValue: number | null;
|
|
24
|
-
readonly maxValue: number | null;
|
|
25
|
-
readonly isPeriodSeconds: boolean;
|
|
26
|
-
constructor(profileEntryParameters: any);
|
|
27
|
-
}
|
|
28
|
-
export declare class ProfileEntryParametersBoolean {
|
|
29
|
-
readonly trueLabel: string;
|
|
30
|
-
readonly falseLabel: string;
|
|
31
|
-
constructor(profileEntryParameters: any);
|
|
32
|
-
}
|
|
33
|
-
export declare class MDProfileEntry {
|
|
34
|
-
readonly id: string;
|
|
35
|
-
readonly label: string;
|
|
36
|
-
readonly type: string;
|
|
37
|
-
readonly parameters: ProfileEntryParametersNumber | ProfileEntryParametersBoolean | ProfileEntryParametersText | ProfileEntryParametersVocabulary | null;
|
|
38
|
-
constructor(entryData: any);
|
|
39
|
-
}
|
|
40
|
-
export declare class MDProfileGroup {
|
|
41
|
-
readonly label: string;
|
|
42
|
-
readonly entries: MDProfileEntry[];
|
|
43
|
-
constructor(groupData: any);
|
|
44
|
-
}
|
|
45
|
-
export declare class MDProfile {
|
|
46
|
-
static lang: string;
|
|
47
|
-
readonly id: string;
|
|
48
|
-
readonly label: string;
|
|
49
|
-
readonly groups: MDProfileGroup[];
|
|
50
|
-
constructor(profileData: any);
|
|
51
|
-
static getTextFromTextWithLanguage(langArray: any | null): string;
|
|
52
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MDProfile = exports.MDProfileGroup = exports.MDProfileEntry = exports.ProfileEntryParametersBoolean = exports.ProfileEntryParametersNumber = exports.ProfileEntryParametersText = exports.ProfileEntryParametersVocabulary = void 0;
|
|
4
|
-
var ProfileEntryParametersVocabulary = /** @class */ (function () {
|
|
5
|
-
function ProfileEntryParametersVocabulary(profileEntryParameters) {
|
|
6
|
-
this.url = profileEntryParameters['url'] || '?url';
|
|
7
|
-
this.allowMultipleValues = profileEntryParameters['allowMultipleValues'] || false;
|
|
8
|
-
this.maxLevel = profileEntryParameters['maxLevel'] || 0;
|
|
9
|
-
this.hideNumbering = profileEntryParameters['hideNumbering'] || false;
|
|
10
|
-
this.hideTitle = profileEntryParameters['hideTitle'] || false;
|
|
11
|
-
this.hideDescription = profileEntryParameters['hideDescription'] || false;
|
|
12
|
-
this.addTextLanguages = profileEntryParameters['addTextLanguages'] || [];
|
|
13
|
-
}
|
|
14
|
-
return ProfileEntryParametersVocabulary;
|
|
15
|
-
}());
|
|
16
|
-
exports.ProfileEntryParametersVocabulary = ProfileEntryParametersVocabulary;
|
|
17
|
-
var ProfileEntryParametersText = /** @class */ (function () {
|
|
18
|
-
function ProfileEntryParametersText(profileEntryParameters) {
|
|
19
|
-
this.format = profileEntryParameters['format'] || '';
|
|
20
|
-
this.pattern = profileEntryParameters['pattern'] || '';
|
|
21
|
-
this.textLanguages = profileEntryParameters['textLanguages'] || [];
|
|
22
|
-
}
|
|
23
|
-
return ProfileEntryParametersText;
|
|
24
|
-
}());
|
|
25
|
-
exports.ProfileEntryParametersText = ProfileEntryParametersText;
|
|
26
|
-
var ProfileEntryParametersNumber = /** @class */ (function () {
|
|
27
|
-
function ProfileEntryParametersNumber(profileEntryParameters) {
|
|
28
|
-
this.digits = profileEntryParameters['digits'] || 0;
|
|
29
|
-
if (profileEntryParameters['minValue'] === null) {
|
|
30
|
-
this.minValue = null;
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
this.minValue = profileEntryParameters['minValue'];
|
|
34
|
-
}
|
|
35
|
-
if (profileEntryParameters['maxValue'] === null) {
|
|
36
|
-
this.maxValue = null;
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
this.maxValue = profileEntryParameters['maxValue'];
|
|
40
|
-
}
|
|
41
|
-
this.isPeriodSeconds = profileEntryParameters['isPeriodSeconds'] || false;
|
|
42
|
-
}
|
|
43
|
-
return ProfileEntryParametersNumber;
|
|
44
|
-
}());
|
|
45
|
-
exports.ProfileEntryParametersNumber = ProfileEntryParametersNumber;
|
|
46
|
-
var ProfileEntryParametersBoolean = /** @class */ (function () {
|
|
47
|
-
function ProfileEntryParametersBoolean(profileEntryParameters) {
|
|
48
|
-
this.trueLabel = MDProfile.getTextFromTextWithLanguage(profileEntryParameters['trueLabel']);
|
|
49
|
-
this.falseLabel = MDProfile.getTextFromTextWithLanguage(profileEntryParameters['falseLabel']);
|
|
50
|
-
}
|
|
51
|
-
return ProfileEntryParametersBoolean;
|
|
52
|
-
}());
|
|
53
|
-
exports.ProfileEntryParametersBoolean = ProfileEntryParametersBoolean;
|
|
54
|
-
var MDProfileEntry = /** @class */ (function () {
|
|
55
|
-
function MDProfileEntry(entryData) {
|
|
56
|
-
this.id = entryData['id'] || '';
|
|
57
|
-
this.label = MDProfile.getTextFromTextWithLanguage(entryData['label']);
|
|
58
|
-
this.type = entryData['type'] || '';
|
|
59
|
-
this.parameters = null;
|
|
60
|
-
if (entryData['parameters']) {
|
|
61
|
-
if (this.type === 'number') {
|
|
62
|
-
this.parameters = new ProfileEntryParametersNumber(entryData['parameters']);
|
|
63
|
-
}
|
|
64
|
-
else if (this.type === 'text') {
|
|
65
|
-
this.parameters = new ProfileEntryParametersText(entryData['parameters']);
|
|
66
|
-
}
|
|
67
|
-
else if (this.type === 'boolean') {
|
|
68
|
-
this.parameters = new ProfileEntryParametersBoolean(entryData['parameters']);
|
|
69
|
-
}
|
|
70
|
-
else if (this.type === 'vocabulary') {
|
|
71
|
-
this.parameters = new ProfileEntryParametersVocabulary(entryData['parameters']);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return MDProfileEntry;
|
|
76
|
-
}());
|
|
77
|
-
exports.MDProfileEntry = MDProfileEntry;
|
|
78
|
-
var MDProfileGroup = /** @class */ (function () {
|
|
79
|
-
function MDProfileGroup(groupData) {
|
|
80
|
-
var _this = this;
|
|
81
|
-
this.label = MDProfile.getTextFromTextWithLanguage(groupData['label']);
|
|
82
|
-
this.entries = [];
|
|
83
|
-
if (groupData['entries']) {
|
|
84
|
-
var entryArray = groupData['entries'];
|
|
85
|
-
entryArray.forEach(function (e) {
|
|
86
|
-
_this.entries.push(new MDProfileEntry(e));
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return MDProfileGroup;
|
|
91
|
-
}());
|
|
92
|
-
exports.MDProfileGroup = MDProfileGroup;
|
|
93
|
-
var MDProfile = /** @class */ (function () {
|
|
94
|
-
function MDProfile(profileData) {
|
|
95
|
-
var _this = this;
|
|
96
|
-
this.id = profileData['id'] || null;
|
|
97
|
-
this.label = MDProfile.getTextFromTextWithLanguage(profileData['label']);
|
|
98
|
-
this.groups = [];
|
|
99
|
-
if (profileData['groups']) {
|
|
100
|
-
var groupArray = profileData['groups'];
|
|
101
|
-
groupArray.forEach(function (g) {
|
|
102
|
-
_this.groups.push(new MDProfileGroup(g));
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
MDProfile.getTextFromTextWithLanguage = function (langArray) {
|
|
107
|
-
if (langArray) {
|
|
108
|
-
var langArrayTyped = langArray;
|
|
109
|
-
var textEntry = langArrayTyped.find(function (t) { return t.lang === MDProfile.lang; });
|
|
110
|
-
if (textEntry)
|
|
111
|
-
return textEntry['value'] || '';
|
|
112
|
-
if (langArrayTyped.length > 0) {
|
|
113
|
-
return langArrayTyped[0]['value'] || '';
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
return '';
|
|
117
|
-
};
|
|
118
|
-
MDProfile.lang = "de";
|
|
119
|
-
return MDProfile;
|
|
120
|
-
}());
|
|
121
|
-
exports.MDProfile = MDProfile;
|
|
122
|
-
//# sourceMappingURL=md-profile-schema.classes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"md-profile-schema.classes.js","sourceRoot":"","sources":["../src/md-profile-schema.classes.ts"],"names":[],"mappings":";;;AAIA;IASI,0CAAY,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BAChB,KAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5C,CAAC,CAAC,CAAA;SACL;IACL,CAAC;IAEM,qCAA2B,GAAlC,UAAmC,SAAqB;QACpD,IAAI,SAAS,EAAE;YACX,IAAM,cAAc,GAAuB,SAAS,CAAC;YACrD,IAAM,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,EAAzB,CAAyB,CAAC,CAAC;YACtE,IAAI,SAAS;gBAAE,OAAO,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC/C,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC3B,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;aAC3C;SACJ;QACD,OAAO,EAAE,CAAC;IACd,CAAC;IA1BM,cAAI,GAAG,IAAI,CAAC;IA2BvB,gBAAC;CAAA,AA5BD,IA4BC;AA5BY,8BAAS"}
|
package/md-profile.schema.json
DELETED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$id": "https://w3id.org/iqb/vocabs/md-profile.json",
|
|
3
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
-
"title": "Metadata Profile",
|
|
5
|
-
"description": "Data structure to manage UI components for metadata of objects",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"properties": {
|
|
8
|
-
"id": {
|
|
9
|
-
"type": "string",
|
|
10
|
-
"description": "Identifier for the metadata profile"
|
|
11
|
-
},
|
|
12
|
-
"label": {
|
|
13
|
-
"$ref": "#/definitions/multi_language_text",
|
|
14
|
-
"description": "Name of the profile"
|
|
15
|
-
},
|
|
16
|
-
"groups": {
|
|
17
|
-
"type": "array",
|
|
18
|
-
"items": {
|
|
19
|
-
"type": "object",
|
|
20
|
-
"properties": {
|
|
21
|
-
"label": {
|
|
22
|
-
"$ref": "#/definitions/multi_language_text"
|
|
23
|
-
},
|
|
24
|
-
"entries": {
|
|
25
|
-
"type": "array",
|
|
26
|
-
"items": {
|
|
27
|
-
"$ref": "#/definitions/entry"
|
|
28
|
-
},
|
|
29
|
-
"minItems": 1
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"required": ["label", "entries"]
|
|
33
|
-
},
|
|
34
|
-
"minItems": 1
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"required": ["id", "label", "groups"],
|
|
38
|
-
"definitions": {
|
|
39
|
-
"multi_language_text": {
|
|
40
|
-
"type": "array",
|
|
41
|
-
"items": {
|
|
42
|
-
"type": "object",
|
|
43
|
-
"properties": {
|
|
44
|
-
"lang": {
|
|
45
|
-
"type": "string",
|
|
46
|
-
"description": "ISO-language code",
|
|
47
|
-
"pattern": "^[a-z]{2}$"
|
|
48
|
-
},
|
|
49
|
-
"value": {
|
|
50
|
-
"type": "string"
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
"required": ["lang", "value"]
|
|
54
|
-
},
|
|
55
|
-
"minItems": 1
|
|
56
|
-
},
|
|
57
|
-
"vocabulary": {
|
|
58
|
-
"type": "object",
|
|
59
|
-
"description": "Creates values of type string (one possible id), string[] (multiple ids) or id+text tuples, if text input is allowed (see md-values).",
|
|
60
|
-
"properties": {
|
|
61
|
-
"url": {
|
|
62
|
-
"type": "string",
|
|
63
|
-
"description": "URI to the JSON representation (SkoHub) of the vocabulary definition"
|
|
64
|
-
},
|
|
65
|
-
"allowMultipleValues": {
|
|
66
|
-
"type": "boolean",
|
|
67
|
-
"description": "If true, multiple values are allowed taken from the vocabulary",
|
|
68
|
-
"default": false
|
|
69
|
-
},
|
|
70
|
-
"maxLevel": {
|
|
71
|
-
"type": "integer",
|
|
72
|
-
"description": "Maximum level taken from the hierarchical vocabulary. This is to hide lower levels. Use '0' for all levels (default).",
|
|
73
|
-
"default": 0
|
|
74
|
-
},
|
|
75
|
-
"hideNumbering": {
|
|
76
|
-
"type": "boolean",
|
|
77
|
-
"description": "If true, the numbering of vocabulary entries is not used/showed in components.",
|
|
78
|
-
"default": false
|
|
79
|
-
},
|
|
80
|
-
"hideDescription": {
|
|
81
|
-
"type": "boolean",
|
|
82
|
-
"description": "If true, the description of vocabulary entries is not used/showed in components.",
|
|
83
|
-
"default": false
|
|
84
|
-
},
|
|
85
|
-
"hideTitle": {
|
|
86
|
-
"type": "boolean",
|
|
87
|
-
"description": "If true, the title of vocabulary entries is not used/showed in components.",
|
|
88
|
-
"default": false
|
|
89
|
-
},
|
|
90
|
-
"addTextLanguages": {
|
|
91
|
-
"type": "array",
|
|
92
|
-
"items": {
|
|
93
|
-
"type": "string",
|
|
94
|
-
"description": "ISO-language code",
|
|
95
|
-
"pattern": "^[a-z]{2}$"
|
|
96
|
-
},
|
|
97
|
-
"description": "If not empty, text can be added to the selected vocabulary entry. The given entries specify the expected language(s).",
|
|
98
|
-
"default": []
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
"required": ["url"]
|
|
102
|
-
},
|
|
103
|
-
"text": {
|
|
104
|
-
"type": "object",
|
|
105
|
-
"description": "Creates values of type string (one possible language) or multi-language texts (see md-values).",
|
|
106
|
-
"properties": {
|
|
107
|
-
"format": {
|
|
108
|
-
"type": "string",
|
|
109
|
-
"enum": ["single", "multiline", "html"],
|
|
110
|
-
"description": "If true, more then one line of text is prepared for input. Text is wrapped and vertical scrolling is possible.",
|
|
111
|
-
"default": "single"
|
|
112
|
-
},
|
|
113
|
-
"textLanguages": {
|
|
114
|
-
"type": "array",
|
|
115
|
-
"items": {
|
|
116
|
-
"type": "string",
|
|
117
|
-
"description": "ISO-language code",
|
|
118
|
-
"pattern": "^[a-z]{2}$"
|
|
119
|
-
},
|
|
120
|
-
"description": "Use this property to add languages, so you provide more then one text input form field.",
|
|
121
|
-
"default": [
|
|
122
|
-
"de"
|
|
123
|
-
]
|
|
124
|
-
},
|
|
125
|
-
"pattern": {
|
|
126
|
-
"type": "string",
|
|
127
|
-
"description": "Use this regular expression to validate the input value."
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
"number": {
|
|
132
|
-
"type": "object",
|
|
133
|
-
"description": "Creates values of type string with number content. The decimal separator is always dot '.'.",
|
|
134
|
-
"properties": {
|
|
135
|
-
"digits": {
|
|
136
|
-
"type": "integer",
|
|
137
|
-
"description": "Number of digits. Negative values are not valid.",
|
|
138
|
-
"minimum": 0,
|
|
139
|
-
"default": 0
|
|
140
|
-
},
|
|
141
|
-
"minValue": {
|
|
142
|
-
"type": "number",
|
|
143
|
-
"description": "Minimal value valid for this entry."
|
|
144
|
-
},
|
|
145
|
-
"maxValue": {
|
|
146
|
-
"type": "number",
|
|
147
|
-
"description": "Maximal value valid for this entry."
|
|
148
|
-
},
|
|
149
|
-
"isPeriodSeconds": {
|
|
150
|
-
"type": "boolean",
|
|
151
|
-
"description": "If true, the (integer) value is interpreted as a number of seconds (duration, time period). This might adapt the form controls.",
|
|
152
|
-
"default": false
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
"boolean": {
|
|
157
|
-
"type": "object",
|
|
158
|
-
"description": "Creates values of type string 'true' or 'false'.",
|
|
159
|
-
"properties": {
|
|
160
|
-
"trueLabel": {
|
|
161
|
-
"$ref": "#/definitions/multi_language_text"
|
|
162
|
-
},
|
|
163
|
-
"falseLabel": {
|
|
164
|
-
"$ref": "#/definitions/multi_language_text"
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
"entry": {
|
|
169
|
-
"type": "object",
|
|
170
|
-
"properties": {
|
|
171
|
-
"id": {
|
|
172
|
-
"type": "string",
|
|
173
|
-
"pattern": "^[a-zA-Z][0-9a-zA-Z_]*$",
|
|
174
|
-
"description": "Identifier for the property as part of the metadata profile"
|
|
175
|
-
},
|
|
176
|
-
"label": {
|
|
177
|
-
"$ref": "#/definitions/multi_language_text",
|
|
178
|
-
"description": "Text presented in UI components as prompt"
|
|
179
|
-
},
|
|
180
|
-
"type": {
|
|
181
|
-
"type": "string",
|
|
182
|
-
"enum": ["text", "vocabulary", "boolean", "number"]
|
|
183
|
-
},
|
|
184
|
-
"parameters": {
|
|
185
|
-
"anyOf": [
|
|
186
|
-
{
|
|
187
|
-
"$ref": "#/definitions/vocabulary"
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
"$ref": "#/definitions/text"
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
"$ref": "#/definitions/number"
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
"$ref": "#/definitions/boolean"
|
|
197
|
-
}
|
|
198
|
-
]
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
"required": ["id", "type"]
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|