@oondemand/create-central-oon 0.4.0 → 0.4.2
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/package.json +1 -1
- package/schemas/central.app.schema.json +32 -86
- package/src/conformance.js +23 -1
- package/templates/_base/backend/package.json +1 -1
- package/templates/_base/central.app.json +5 -0
- package/templates/_base/frontend/package.json +1 -1
- package/templates/_base/package.json +1 -1
package/package.json
CHANGED
|
@@ -4,16 +4,7 @@
|
|
|
4
4
|
"title": "Oon Central App Manifest",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"additionalProperties": false,
|
|
7
|
-
"required": [
|
|
8
|
-
"schemaVersion",
|
|
9
|
-
"id",
|
|
10
|
-
"name",
|
|
11
|
-
"slug",
|
|
12
|
-
"appKind",
|
|
13
|
-
"modules",
|
|
14
|
-
"capabilities",
|
|
15
|
-
"compatibility"
|
|
16
|
-
],
|
|
7
|
+
"required": ["schemaVersion", "id", "name", "slug", "appKind", "modules", "capabilities", "compatibility"],
|
|
17
8
|
"properties": {
|
|
18
9
|
"$schema": { "type": "string" },
|
|
19
10
|
"schemaVersion": { "const": 1 },
|
|
@@ -21,89 +12,44 @@
|
|
|
21
12
|
"name": { "type": "string", "minLength": 1 },
|
|
22
13
|
"slug": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" },
|
|
23
14
|
"appKind": { "enum": ["root-central", "member-central", "portal-cockpit"] },
|
|
15
|
+
"tenancyModel": { "enum": ["none", "single_tenant", "multi_tenant"] },
|
|
16
|
+
"availability": { "enum": ["system", "common", "licensed"] },
|
|
17
|
+
"accessMode": { "enum": ["tenant_members", "explicit_users"] },
|
|
18
|
+
"authorizationMode": { "enum": ["none", "rbac"] },
|
|
19
|
+
"accessPolicy": {
|
|
20
|
+
"enum": ["tenant_members", "explicit_users", "rbac"],
|
|
21
|
+
"description": "Compatibilidade legada. Novos manifestos devem usar accessMode e authorizationMode."
|
|
22
|
+
},
|
|
23
|
+
"deploymentMode": { "enum": ["singleton", "shared", "dedicated", "hybrid"] },
|
|
24
24
|
"modules": {
|
|
25
25
|
"type": "object",
|
|
26
26
|
"additionalProperties": false,
|
|
27
27
|
"properties": {
|
|
28
|
-
"collections": { "type": "boolean" },
|
|
29
|
-
"
|
|
30
|
-
"pipelines": { "type": "boolean" },
|
|
31
|
-
"integrations": { "type": "boolean" },
|
|
32
|
-
"omie": { "type": "boolean" },
|
|
33
|
-
"assistants": { "type": "boolean" },
|
|
34
|
-
"currencies": { "type": "boolean" }
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"capabilities": {
|
|
38
|
-
"type": "array",
|
|
39
|
-
"uniqueItems": true,
|
|
40
|
-
"items": {
|
|
41
|
-
"type": "string",
|
|
42
|
-
"pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9][a-z0-9-]*)+$"
|
|
28
|
+
"collections": { "type": "boolean" }, "documents": { "type": "boolean" }, "pipelines": { "type": "boolean" },
|
|
29
|
+
"integrations": { "type": "boolean" }, "omie": { "type": "boolean" }, "assistants": { "type": "boolean" }, "currencies": { "type": "boolean" }
|
|
43
30
|
}
|
|
44
31
|
},
|
|
32
|
+
"capabilities": { "type": "array", "uniqueItems": true, "items": { "type": "string", "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9][a-z0-9-]*)+$" } },
|
|
45
33
|
"compatibility": {
|
|
46
|
-
"type": "object",
|
|
47
|
-
"additionalProperties": false,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"type": "object",
|
|
52
|
-
"additionalProperties": false,
|
|
53
|
-
"required": ["minVersion"],
|
|
54
|
-
"properties": {
|
|
55
|
-
"minVersion": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+(?:[-+][0-9A-Za-z.-]+)?$" },
|
|
56
|
-
"maxVersionExclusive": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+(?:[-+][0-9A-Za-z.-]+)?$" }
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
"activation": {
|
|
62
|
-
"type": "object",
|
|
63
|
-
"additionalProperties": false,
|
|
64
|
-
"properties": {
|
|
65
|
-
"enabled": { "type": "boolean" },
|
|
66
|
-
"configurationVersion": { "type": "integer", "minimum": 1 },
|
|
67
|
-
"fields": { "type": "array" }
|
|
68
|
-
}
|
|
34
|
+
"type": "object", "additionalProperties": false, "required": ["core"],
|
|
35
|
+
"properties": { "core": { "type": "object", "additionalProperties": false, "required": ["minVersion"], "properties": {
|
|
36
|
+
"minVersion": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+(?:[-+][0-9A-Za-z.-]+)?$" },
|
|
37
|
+
"maxVersionExclusive": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+(?:[-+][0-9A-Za-z.-]+)?$" }
|
|
38
|
+
} } }
|
|
69
39
|
},
|
|
70
|
-
"
|
|
71
|
-
"type": "
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"items": {
|
|
85
|
-
"type": "object",
|
|
86
|
-
"additionalProperties": false,
|
|
87
|
-
"required": ["code", "name", "permissions"],
|
|
88
|
-
"properties": {
|
|
89
|
-
"code": { "type": "string", "pattern": "^[a-z][a-z0-9_-]*$" },
|
|
90
|
-
"name": { "type": "string", "minLength": 1 },
|
|
91
|
-
"description": { "type": "string" },
|
|
92
|
-
"admin": { "type": "boolean" },
|
|
93
|
-
"permissions": {
|
|
94
|
-
"type": "array",
|
|
95
|
-
"uniqueItems": true,
|
|
96
|
-
"items": {
|
|
97
|
-
"anyOf": [
|
|
98
|
-
{ "const": "*" },
|
|
99
|
-
{ "type": "string", "pattern": "^[a-z][a-z0-9-]*(?:\\.[a-z][a-z0-9-]*)+$" }
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
40
|
+
"activation": { "type": "object", "additionalProperties": false, "properties": {
|
|
41
|
+
"enabled": { "type": "boolean" }, "configurationVersion": { "type": "integer", "minimum": 1 }, "fields": { "type": "array" }
|
|
42
|
+
} },
|
|
43
|
+
"rbac": { "type": "object", "additionalProperties": false, "required": ["roles"], "properties": {
|
|
44
|
+
"permissions": { "type": "array", "uniqueItems": true, "items": { "type": "string", "pattern": "^[a-z][a-z0-9-]*(?:\\.[a-z][a-z0-9-]*)+$" } },
|
|
45
|
+
"invitationTtlHours": { "type": "integer", "minimum": 1, "maximum": 720 },
|
|
46
|
+
"roles": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["code", "name", "permissions"], "properties": {
|
|
47
|
+
"code": { "type": "string", "pattern": "^[a-z][a-z0-9_-]*$" }, "name": { "type": "string", "minLength": 1 },
|
|
48
|
+
"description": { "type": "string" }, "admin": { "type": "boolean" },
|
|
49
|
+
"permissions": { "type": "array", "uniqueItems": true, "items": { "anyOf": [
|
|
50
|
+
{ "const": "*" }, { "type": "string", "pattern": "^[a-z][a-z0-9-]*(?:\\.[a-z][a-z0-9-]*)+$" }
|
|
51
|
+
] } }
|
|
52
|
+
} } }
|
|
53
|
+
} }
|
|
108
54
|
}
|
|
109
55
|
}
|
package/src/conformance.js
CHANGED
|
@@ -43,11 +43,33 @@ function addIssue(issues, code, file, message) {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
function fallbackValidateAppManifest(manifest) {
|
|
46
|
-
const required = [
|
|
46
|
+
const required = [
|
|
47
|
+
"schemaVersion", "id", "name", "slug", "appKind",
|
|
48
|
+
"modules", "capabilities", "compatibility",
|
|
49
|
+
];
|
|
47
50
|
const missing = required.filter((key) => manifest?.[key] === undefined);
|
|
48
51
|
if (missing.length) throw new Error(`campos obrigatórios ausentes: ${missing.join(", ")}.`);
|
|
49
52
|
if (manifest.schemaVersion !== 1) throw new Error("schemaVersion deve ser 1.");
|
|
50
53
|
if (!Array.isArray(manifest.capabilities)) throw new Error("capabilities deve ser uma lista.");
|
|
54
|
+
const hasCanonicalAccess = manifest.accessMode !== undefined && manifest.authorizationMode !== undefined;
|
|
55
|
+
const hasLegacyAccess = manifest.accessPolicy !== undefined;
|
|
56
|
+
if (!hasCanonicalAccess && !hasLegacyAccess) {
|
|
57
|
+
throw new Error("informe accessMode e authorizationMode (ou accessPolicy em manifesto legado).");
|
|
58
|
+
}
|
|
59
|
+
if (hasCanonicalAccess && hasLegacyAccess) {
|
|
60
|
+
throw new Error("accessPolicy não pode ser combinado com accessMode/authorizationMode.");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const optionalDimensions = {
|
|
64
|
+
tenancyModel: ["none", "single_tenant", "multi_tenant"],
|
|
65
|
+
availability: ["system", "common", "licensed"],
|
|
66
|
+
deploymentMode: ["singleton", "shared", "dedicated", "hybrid"],
|
|
67
|
+
};
|
|
68
|
+
for (const [key, allowed] of Object.entries(optionalDimensions)) {
|
|
69
|
+
if (manifest[key] !== undefined && !allowed.includes(manifest[key])) {
|
|
70
|
+
throw new Error(`${key} deve ser um de: ${allowed.join(", ")}.`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
51
73
|
}
|
|
52
74
|
|
|
53
75
|
function validateAppManifest(root, manifest) {
|
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
"name": "__NAME__",
|
|
6
6
|
"slug": "__SLUG__",
|
|
7
7
|
"appKind": "member-central",
|
|
8
|
+
"tenancyModel": "single_tenant",
|
|
9
|
+
"availability": "licensed",
|
|
10
|
+
"accessMode": "explicit_users",
|
|
11
|
+
"authorizationMode": "rbac",
|
|
12
|
+
"deploymentMode": "dedicated",
|
|
8
13
|
"modules": {
|
|
9
14
|
"collections": true,
|
|
10
15
|
"documents": false,
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"sync:metadata": "oonCore-front sync:metadata"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@oondemand/oon-core-front": "^0.4.
|
|
13
|
+
"@oondemand/oon-core-front": "^0.4.2",
|
|
14
14
|
"@chakra-ui/react": "^3.13.0",
|
|
15
15
|
"@emotion/react": "^11.14.0",
|
|
16
16
|
"@tanstack/react-query": "^5.65.0",
|