@oondemand/create-central-oon 0.4.1 → 0.4.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oondemand/create-central-oon",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/oondemand/oon-platform.git",
@@ -14,7 +14,12 @@
14
14
  "appKind": { "enum": ["root-central", "member-central", "portal-cockpit"] },
15
15
  "tenancyModel": { "enum": ["none", "single_tenant", "multi_tenant"] },
16
16
  "availability": { "enum": ["system", "common", "licensed"] },
17
- "accessPolicy": { "enum": ["tenant_members", "explicit_users", "rbac"] },
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
+ },
18
23
  "deploymentMode": { "enum": ["singleton", "shared", "dedicated", "hybrid"] },
19
24
  "modules": {
20
25
  "type": "object",
@@ -43,11 +43,33 @@ function addIssue(issues, code, file, message) {
43
43
  }
44
44
 
45
45
  function fallbackValidateAppManifest(manifest) {
46
- const required = ["schemaVersion", "id", "name", "slug", "appKind", "modules", "capabilities", "compatibility"];
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) {
@@ -12,6 +12,6 @@
12
12
  "deploy": "oonCore-back deploy"
13
13
  },
14
14
  "dependencies": {
15
- "@oondemand/oon-core-back": "^0.4.1"
15
+ "@oondemand/oon-core-back": "^0.4.3"
16
16
  }
17
17
  }
@@ -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.1",
13
+ "@oondemand/oon-core-front": "^0.4.3",
14
14
  "@chakra-ui/react": "^3.13.0",
15
15
  "@emotion/react": "^11.14.0",
16
16
  "@tanstack/react-query": "^5.65.0",
@@ -12,6 +12,6 @@
12
12
  "dev:frontend": "npm run dev --prefix frontend"
13
13
  },
14
14
  "devDependencies": {
15
- "@oondemand/create-central-oon": "0.4.1"
15
+ "@oondemand/create-central-oon": "0.4.3"
16
16
  }
17
17
  }