@origostudio/origo-design 0.0.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/.editorconfig +13 -0
- package/.gitattributes +22 -0
- package/.perf-baseline.json +12 -0
- package/.prettierignore +13 -0
- package/.prettierrc +10 -0
- package/.vscode/extensions.json +3 -0
- package/BRANCH-PROTECTION.md +25 -0
- package/CHANGELOG.md +292 -0
- package/LICENSE +21 -0
- package/README.md +11 -0
- package/commitlint.config.js +6 -0
- package/dist/packages/cli/CHANGELOG.md +92 -0
- package/dist/packages/cli/README.md +11 -0
- package/dist/packages/cli/package.json +16 -0
- package/dist/packages/cli/package.json.bak +16 -0
- package/dist/packages/cli/src/commands/generate/entity.d.ts +2 -0
- package/dist/packages/cli/src/commands/generate/entity.js +24 -0
- package/dist/packages/cli/src/commands/generate/entity.js.map +1 -0
- package/dist/packages/cli/src/commands/generate/index.d.ts +2 -0
- package/dist/packages/cli/src/commands/generate/index.js +30 -0
- package/dist/packages/cli/src/commands/generate/index.js.map +1 -0
- package/dist/packages/cli/src/commands/init.d.ts +5 -0
- package/dist/packages/cli/src/commands/init.js +27 -0
- package/dist/packages/cli/src/commands/init.js.map +1 -0
- package/dist/packages/cli/src/commands/new.d.ts +2 -0
- package/dist/packages/cli/src/commands/new.js +24 -0
- package/dist/packages/cli/src/commands/new.js.map +1 -0
- package/dist/packages/cli/src/commands/validate.d.ts +2 -0
- package/dist/packages/cli/src/commands/validate.js +50 -0
- package/dist/packages/cli/src/commands/validate.js.map +1 -0
- package/dist/packages/cli/src/index.d.ts +11 -0
- package/dist/packages/cli/src/index.js +15 -0
- package/dist/packages/cli/src/index.js.map +1 -0
- package/dist/packages/cli/src/lib/cli.d.ts +1 -0
- package/dist/packages/cli/src/lib/cli.js +7 -0
- package/dist/packages/cli/src/lib/cli.js.map +1 -0
- package/dist/packages/cli/src/lib/generator.d.ts +16 -0
- package/dist/packages/cli/src/lib/generator.js +165 -0
- package/dist/packages/cli/src/lib/generator.js.map +1 -0
- package/dist/packages/cli/src/lib/scaffolding.d.ts +5 -0
- package/dist/packages/cli/src/lib/scaffolding.js +87 -0
- package/dist/packages/cli/src/lib/scaffolding.js.map +1 -0
- package/dist/packages/cli/src/lib/validation.d.ts +4 -0
- package/dist/packages/cli/src/lib/validation.js +191 -0
- package/dist/packages/cli/src/lib/validation.js.map +1 -0
- package/dist/packages/cli/src/main.d.ts +4 -0
- package/dist/packages/cli/src/main.js +38 -0
- package/dist/packages/cli/src/main.js.map +1 -0
- package/dist/packages/cli/src/templates/entity.json +6 -0
- package/dist/packages/cli/src/templates/extension.json +8 -0
- package/dist/packages/cli/src/templates/index.d.ts +29 -0
- package/dist/packages/cli/src/templates/index.js +61 -0
- package/dist/packages/cli/src/templates/index.js.map +1 -0
- package/dist/packages/cli/src/templates/origo.json +16 -0
- package/dist/packages/cli/src/utils/errors.d.ts +15 -0
- package/dist/packages/cli/src/utils/errors.js +58 -0
- package/dist/packages/cli/src/utils/errors.js.map +1 -0
- package/dist/packages/core/CHANGELOG.md +275 -0
- package/dist/packages/core/README.md +11 -0
- package/dist/packages/core/package.json +21 -0
- package/dist/packages/core/package.json.bak +21 -0
- package/dist/packages/core/src/extension-api/extension-manager.d.ts +35 -0
- package/dist/packages/core/src/extension-api/extension-manager.js +300 -0
- package/dist/packages/core/src/extension-api/extension-manager.js.map +1 -0
- package/dist/packages/core/src/extension-api/index.d.ts +2 -0
- package/dist/packages/core/src/extension-api/index.js +6 -0
- package/dist/packages/core/src/extension-api/index.js.map +1 -0
- package/dist/packages/core/src/extension-api/types.d.ts +34 -0
- package/dist/packages/core/src/extension-api/types.js +3 -0
- package/dist/packages/core/src/extension-api/types.js.map +1 -0
- package/dist/packages/core/src/index.d.ts +3 -0
- package/dist/packages/core/src/index.js +7 -0
- package/dist/packages/core/src/index.js.map +1 -0
- package/dist/packages/core/src/schemas/capability.schema.json +104 -0
- package/dist/packages/core/src/schemas/contract.schema.json +52 -0
- package/dist/packages/core/src/schemas/domain.schema.json +47 -0
- package/dist/packages/core/src/schemas/entity.schema.json +72 -0
- package/dist/packages/core/src/schemas/extension.schema.json +39 -0
- package/dist/packages/core/src/schemas/permission.schema.json +21 -0
- package/dist/packages/core/src/types/ast.d.ts +17 -0
- package/dist/packages/core/src/types/ast.js +3 -0
- package/dist/packages/core/src/types/ast.js.map +1 -0
- package/dist/packages/core/src/types/domain.d.ts +101 -0
- package/dist/packages/core/src/types/domain.js +8 -0
- package/dist/packages/core/src/types/domain.js.map +1 -0
- package/dist/packages/core/src/types/validation.d.ts +12 -0
- package/dist/packages/core/src/types/validation.js +16 -0
- package/dist/packages/core/src/types/validation.js.map +1 -0
- package/dist/packages/core/src/validator/ast-validator.d.ts +11 -0
- package/dist/packages/core/src/validator/ast-validator.js +388 -0
- package/dist/packages/core/src/validator/ast-validator.js.map +1 -0
- package/dist/packages/core/src/validator/index.d.ts +23 -0
- package/dist/packages/core/src/validator/index.js +143 -0
- package/dist/packages/core/src/validator/index.js.map +1 -0
- package/dist/packages/core/src/validator/serializer.d.ts +11 -0
- package/dist/packages/core/src/validator/serializer.js +99 -0
- package/dist/packages/core/src/validator/serializer.js.map +1 -0
- package/eslint.config.js +114 -0
- package/generate_prompts.js +19 -0
- package/jest.config.ts +5 -0
- package/jest.preset.js +3 -0
- package/nx.json +169 -0
- package/package.json +115 -0
- package/packages/angular-renderer/CHANGELOG.md +274 -0
- package/packages/angular-renderer/README.md +11 -0
- package/packages/angular-renderer/package.json +20 -0
- package/packages/angular-renderer/playwright-ct.config.ts +23 -0
- package/packages/angular-renderer/src/adapters/web/adapter.ts +145 -0
- package/packages/angular-renderer/src/adapters/web/experience-adapter.service.ts +21 -0
- package/packages/angular-renderer/src/components/primitives/button/button.component.html +9 -0
- package/packages/angular-renderer/src/components/primitives/button/button.component.pw.ts +19 -0
- package/packages/angular-renderer/src/components/primitives/button/button.component.scss +31 -0
- package/packages/angular-renderer/src/components/primitives/button/button.component.ts +67 -0
- package/packages/angular-renderer/src/components/primitives/primitives.a11y.pw.ts +33 -0
- package/packages/angular-renderer/src/components/primitives/text-input/text-input.component.html +10 -0
- package/packages/angular-renderer/src/components/primitives/text-input/text-input.component.pw.ts +29 -0
- package/packages/angular-renderer/src/components/primitives/text-input/text-input.component.scss +42 -0
- package/packages/angular-renderer/src/components/primitives/text-input/text-input.component.ts +84 -0
- package/packages/angular-renderer/src/components/primitives/vbox/vbox.component.html +2 -0
- package/packages/angular-renderer/src/components/primitives/vbox/vbox.component.pw.ts +19 -0
- package/packages/angular-renderer/src/components/primitives/vbox/vbox.component.scss +5 -0
- package/packages/angular-renderer/src/components/primitives/vbox/vbox.component.ts +74 -0
- package/packages/angular-renderer/src/index.ts +7 -0
- package/packages/angular-renderer/src/lib/renderer.component.ts +118 -0
- package/packages/angular-renderer/src/lib/renderer.tokens.ts +9 -0
- package/packages/angular-renderer/src/lib/test-utils.ts +26 -0
- package/packages/angular-renderer/src/lib/theme.provider.ts +83 -0
- package/packages/angular-renderer/src/test-setup.ts +8 -0
- package/packages/cli/CHANGELOG.md +92 -0
- package/packages/cli/README.md +11 -0
- package/packages/cli/package.json +16 -0
- package/packages/cli/src/commands/generate/entity.ts +20 -0
- package/packages/cli/src/commands/generate/index.ts +28 -0
- package/packages/cli/src/commands/init.ts +28 -0
- package/packages/cli/src/commands/new.ts +22 -0
- package/packages/cli/src/commands/validate.ts +47 -0
- package/packages/cli/src/index.ts +11 -0
- package/packages/cli/src/lib/cli.ts +3 -0
- package/packages/cli/src/lib/generator.ts +181 -0
- package/packages/cli/src/lib/scaffolding.ts +104 -0
- package/packages/cli/src/lib/validation.ts +218 -0
- package/packages/cli/src/main.ts +38 -0
- package/packages/cli/src/templates/entity.json +6 -0
- package/packages/cli/src/templates/extension.json +8 -0
- package/packages/cli/src/templates/index.ts +94 -0
- package/packages/cli/src/templates/origo.json +16 -0
- package/packages/cli/src/utils/errors.ts +80 -0
- package/packages/core/CHANGELOG.md +275 -0
- package/packages/core/README.md +11 -0
- package/packages/core/package-lock.json +1035 -0
- package/packages/core/package.json +21 -0
- package/packages/core/scripts/generate-types.ts +23 -0
- package/packages/core/src/extension-api/extension-manager.ts +378 -0
- package/packages/core/src/extension-api/index.ts +2 -0
- package/packages/core/src/extension-api/types.ts +37 -0
- package/packages/core/src/index.ts +3 -0
- package/packages/core/src/schemas/__fixtures__/target-page.json +222 -0
- package/packages/core/src/schemas/capability.schema.json +104 -0
- package/packages/core/src/schemas/contract.schema.json +52 -0
- package/packages/core/src/schemas/domain.schema.json +47 -0
- package/packages/core/src/schemas/entity.schema.json +72 -0
- package/packages/core/src/schemas/extension.schema.json +39 -0
- package/packages/core/src/schemas/permission.schema.json +21 -0
- package/packages/core/src/types/ast.ts +20 -0
- package/packages/core/src/types/domain.ts +105 -0
- package/packages/core/src/types/validation.ts +29 -0
- package/packages/core/src/validator/ast-validator.ts +406 -0
- package/packages/core/src/validator/index.ts +207 -0
- package/packages/core/src/validator/serializer.ts +120 -0
- package/packages/core/test/fixtures/target-page.json +87 -0
- package/packages/design-tokens/CHANGELOG.md +273 -0
- package/packages/design-tokens/README.md +11 -0
- package/packages/design-tokens/package.json +25 -0
- package/packages/design-tokens/src/build.ts +97 -0
- package/packages/design-tokens/src/compile.ts +60 -0
- package/packages/design-tokens/src/index.ts +7 -0
- package/packages/design-tokens/src/runtime/index.ts +2 -0
- package/packages/design-tokens/src/runtime/theme-fetcher.ts +90 -0
- package/packages/design-tokens/src/runtime/theme-injector.ts +149 -0
- package/packages/design-tokens/src/schemas/base-tokens.schema.json +127 -0
- package/packages/design-tokens/src/schemas/semantic-tokens.schema.json +52 -0
- package/packages/design-tokens/src/tokens/base.json +46 -0
- package/packages/design-tokens/src/tokens/semantic.json +33 -0
- package/packages/playground/CHANGELOG.md +12 -0
- package/packages/playground/package.json +10 -0
- package/packages/playground/public/favicon.ico +0 -0
- package/packages/playground/src/app/app.component.html +1 -0
- package/packages/playground/src/app/app.component.scss +4 -0
- package/packages/playground/src/app/app.component.ts +13 -0
- package/packages/playground/src/app/app.config.ts +9 -0
- package/packages/playground/src/editor/badl-editor.component.html +1 -0
- package/packages/playground/src/editor/badl-editor.component.scss +10 -0
- package/packages/playground/src/editor/badl-editor.component.ts +57 -0
- package/packages/playground/src/editor/editor.worker.ts +1 -0
- package/packages/playground/src/editor/json.worker.ts +1 -0
- package/packages/playground/src/editor/monaco-environment.ts +11 -0
- package/packages/playground/src/editor/schema-registry.ts +30 -0
- package/packages/playground/src/index.html +13 -0
- package/packages/playground/src/main.ts +5 -0
- package/packages/playground/src/schemas/capability.schema.json +104 -0
- package/packages/playground/src/schemas/contract.schema.json +52 -0
- package/packages/playground/src/schemas/domain.schema.json +47 -0
- package/packages/playground/src/schemas/entity.schema.json +72 -0
- package/packages/playground/src/schemas/extension.schema.json +39 -0
- package/packages/playground/src/schemas/permission.schema.json +21 -0
- package/packages/playground/src/styles.scss +8 -0
- package/packages/playground/src/test-setup.ts +146 -0
- package/packages/playground/vite.config.ts +12 -0
- package/packages/playground/vitest.config.mjs +24 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as monaco from 'monaco-editor';
|
|
2
|
+
import domainSchema from '../schemas/domain.schema.json';
|
|
3
|
+
import entitySchema from '../schemas/entity.schema.json';
|
|
4
|
+
import capabilitySchema from '../schemas/capability.schema.json';
|
|
5
|
+
import contractSchema from '../schemas/contract.schema.json';
|
|
6
|
+
import permissionSchema from '../schemas/permission.schema.json';
|
|
7
|
+
import extensionSchema from '../schemas/extension.schema.json';
|
|
8
|
+
|
|
9
|
+
let isRegistered = false;
|
|
10
|
+
|
|
11
|
+
export function registerBadlSchema(): void {
|
|
12
|
+
if (isRegistered || !monaco?.languages?.json?.jsonDefaults) return;
|
|
13
|
+
isRegistered = true;
|
|
14
|
+
|
|
15
|
+
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
16
|
+
validate: true,
|
|
17
|
+
schemas: [
|
|
18
|
+
{
|
|
19
|
+
uri: 'https://origo.design/schemas/v1/domain.schema.json',
|
|
20
|
+
fileMatch: ['*.json'],
|
|
21
|
+
schema: domainSchema,
|
|
22
|
+
},
|
|
23
|
+
{ uri: 'https://origo.design/schemas/v1/entity.schema.json', schema: entitySchema },
|
|
24
|
+
{ uri: 'https://origo.design/schemas/v1/capability.schema.json', schema: capabilitySchema },
|
|
25
|
+
{ uri: 'https://origo.design/schemas/v1/contract.schema.json', schema: contractSchema },
|
|
26
|
+
{ uri: 'https://origo.design/schemas/v1/permission.schema.json', schema: permissionSchema },
|
|
27
|
+
{ uri: 'https://origo.design/schemas/v1/extension.schema.json', schema: extensionSchema },
|
|
28
|
+
],
|
|
29
|
+
});
|
|
30
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>playground</title>
|
|
6
|
+
<base href="/" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
8
|
+
<link rel="icon" type="image/x-icon" href="favicon.ico" />
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<origo-root></origo-root>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://origo.design/schemas/v1/capability.schema.json",
|
|
4
|
+
"title": "Capability",
|
|
5
|
+
"description": "BADL Capability Definition",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"id": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"minLength": 1
|
|
11
|
+
},
|
|
12
|
+
"name": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"enum": ["Create", "Read", "Update", "Delete", "List"],
|
|
15
|
+
"description": "Strict vocabulary of core capability verbs"
|
|
16
|
+
},
|
|
17
|
+
"description": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"type": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"enum": ["Command", "Query"]
|
|
23
|
+
},
|
|
24
|
+
"entityId": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"minLength": 1,
|
|
27
|
+
"description": "Target entity for this capability"
|
|
28
|
+
},
|
|
29
|
+
"outcome_ref": {
|
|
30
|
+
"type": "array",
|
|
31
|
+
"items": {
|
|
32
|
+
"type": "string"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"preconditions": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"items": {
|
|
38
|
+
"type": "string"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"postconditions": {
|
|
42
|
+
"type": "array",
|
|
43
|
+
"items": {
|
|
44
|
+
"type": "string"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"permissions": {
|
|
48
|
+
"type": "array",
|
|
49
|
+
"items": {
|
|
50
|
+
"$ref": "permission.schema.json"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"risk_level": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"enum": ["low", "medium", "high", "critical"]
|
|
56
|
+
},
|
|
57
|
+
"interaction_contract_ref": {
|
|
58
|
+
"type": "string"
|
|
59
|
+
},
|
|
60
|
+
"async": {
|
|
61
|
+
"type": "boolean"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"required": [
|
|
65
|
+
"id",
|
|
66
|
+
"name",
|
|
67
|
+
"description",
|
|
68
|
+
"type",
|
|
69
|
+
"entityId",
|
|
70
|
+
"outcome_ref",
|
|
71
|
+
"preconditions",
|
|
72
|
+
"postconditions",
|
|
73
|
+
"permissions",
|
|
74
|
+
"risk_level",
|
|
75
|
+
"async"
|
|
76
|
+
],
|
|
77
|
+
"additionalProperties": false,
|
|
78
|
+
"allOf": [
|
|
79
|
+
{
|
|
80
|
+
"if": {
|
|
81
|
+
"properties": {
|
|
82
|
+
"name": { "enum": ["Create", "Update", "Delete"] }
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"then": {
|
|
86
|
+
"properties": {
|
|
87
|
+
"type": { "const": "Command" }
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"if": {
|
|
93
|
+
"properties": {
|
|
94
|
+
"name": { "enum": ["Read", "List"] }
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"then": {
|
|
98
|
+
"properties": {
|
|
99
|
+
"type": { "const": "Query" }
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://origo.design/schemas/v1/contract.schema.json",
|
|
4
|
+
"title": "Contract",
|
|
5
|
+
"description": "BADL Contract Definition",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"id": {
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
"name": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"requiredFields": {
|
|
15
|
+
"type": "array",
|
|
16
|
+
"items": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"properties": {
|
|
19
|
+
"name": {
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"type": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"enum": ["string", "boolean", "date", "number", "array", "object"]
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"required": ["name", "type"],
|
|
28
|
+
"additionalProperties": false
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"requiredCapabilities": {
|
|
32
|
+
"type": "array",
|
|
33
|
+
"items": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"properties": {
|
|
36
|
+
"name": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"enum": ["Create", "Read", "Update", "Delete", "List"]
|
|
39
|
+
},
|
|
40
|
+
"type": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"enum": ["Command", "Query"]
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"required": ["name", "type"],
|
|
46
|
+
"additionalProperties": false
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"required": ["id", "name", "requiredFields", "requiredCapabilities"],
|
|
51
|
+
"additionalProperties": false
|
|
52
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://origo.design/schemas/v1/domain.schema.json",
|
|
4
|
+
"title": "Domain",
|
|
5
|
+
"description": "BADL Domain Definition",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"id": {
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
"name": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"version": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"domain": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"entities": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"items": {
|
|
23
|
+
"$ref": "entity.schema.json"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"capabilities": {
|
|
27
|
+
"type": "array",
|
|
28
|
+
"items": {
|
|
29
|
+
"$ref": "capability.schema.json"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"contracts": {
|
|
33
|
+
"type": "array",
|
|
34
|
+
"items": {
|
|
35
|
+
"$ref": "contract.schema.json"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"extensions": {
|
|
39
|
+
"type": "array",
|
|
40
|
+
"items": {
|
|
41
|
+
"$ref": "extension.schema.json"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"required": ["id", "name", "version", "domain", "entities"],
|
|
46
|
+
"additionalProperties": false
|
|
47
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://origo.design/schemas/v1/entity.schema.json",
|
|
4
|
+
"title": "Entity",
|
|
5
|
+
"description": "BADL Entity Definition",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"$defs": {
|
|
8
|
+
"field": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"id": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"name": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"type": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"enum": ["string", "boolean", "date", "number", "array", "object"]
|
|
20
|
+
},
|
|
21
|
+
"itemType": {
|
|
22
|
+
"type": "string"
|
|
23
|
+
},
|
|
24
|
+
"label": {
|
|
25
|
+
"type": "string"
|
|
26
|
+
},
|
|
27
|
+
"references": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"validation": {
|
|
31
|
+
"type": "array",
|
|
32
|
+
"items": {
|
|
33
|
+
"type": "string"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"metadata_path": {
|
|
37
|
+
"type": "string"
|
|
38
|
+
},
|
|
39
|
+
"fields": {
|
|
40
|
+
"type": "array",
|
|
41
|
+
"items": {
|
|
42
|
+
"$ref": "#/$defs/field"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"required": ["id", "name", "type", "label", "validation", "metadata_path"],
|
|
47
|
+
"additionalProperties": false
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"properties": {
|
|
51
|
+
"id": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
},
|
|
54
|
+
"name": {
|
|
55
|
+
"type": "string"
|
|
56
|
+
},
|
|
57
|
+
"implements": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"items": {
|
|
60
|
+
"type": "string"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"fields": {
|
|
64
|
+
"type": "array",
|
|
65
|
+
"items": {
|
|
66
|
+
"$ref": "#/$defs/field"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"required": ["id", "name", "fields"],
|
|
71
|
+
"additionalProperties": false
|
|
72
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://origo.design/schemas/v1/extension.schema.json",
|
|
4
|
+
"title": "Extension",
|
|
5
|
+
"description": "BADL Extension Definition",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"id": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"minLength": 1,
|
|
11
|
+
"pattern": "^[a-zA-Z0-9_-]+$"
|
|
12
|
+
},
|
|
13
|
+
"name": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"minLength": 1
|
|
16
|
+
},
|
|
17
|
+
"version": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"minLength": 1
|
|
20
|
+
},
|
|
21
|
+
"extension_type": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"minLength": 1
|
|
24
|
+
},
|
|
25
|
+
"implements": {
|
|
26
|
+
"type": "array",
|
|
27
|
+
"items": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"minItems": 1
|
|
31
|
+
},
|
|
32
|
+
"plugin_version_range": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"minLength": 1
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"required": ["id", "name", "version", "extension_type", "implements", "plugin_version_range"],
|
|
38
|
+
"additionalProperties": false
|
|
39
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://origo.design/schemas/v1/permission.schema.json",
|
|
4
|
+
"title": "Permission",
|
|
5
|
+
"description": "BADL Role-Based Permission Definition",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"role": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The role required for this permission",
|
|
11
|
+
"minLength": 1
|
|
12
|
+
},
|
|
13
|
+
"access": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"enum": ["grant", "deny"],
|
|
16
|
+
"default": "grant"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"required": ["role"],
|
|
20
|
+
"additionalProperties": false
|
|
21
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import '@analogjs/vite-plugin-angular/setup-vitest';
|
|
2
|
+
import { getTestBed } from '@angular/core/testing';
|
|
3
|
+
import {
|
|
4
|
+
BrowserDynamicTestingModule,
|
|
5
|
+
platformBrowserDynamicTesting,
|
|
6
|
+
} from '@angular/platform-browser-dynamic/testing';
|
|
7
|
+
|
|
8
|
+
// Manual initialization just in case setup-vitest fails
|
|
9
|
+
try {
|
|
10
|
+
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
|
|
11
|
+
} catch (e) {
|
|
12
|
+
if (!(e as Error).message.includes('has already been')) {
|
|
13
|
+
throw e;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
afterEach(() => {
|
|
18
|
+
getTestBed().resetTestingModule();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// Monaco editor requires document.queryCommandSupported in jsdom
|
|
22
|
+
if (typeof document !== 'undefined') {
|
|
23
|
+
document.queryCommandSupported = () => false;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (typeof window !== 'undefined') {
|
|
27
|
+
Object.defineProperty(window, 'matchMedia', {
|
|
28
|
+
writable: true,
|
|
29
|
+
value:
|
|
30
|
+
window.matchMedia ||
|
|
31
|
+
function () {
|
|
32
|
+
return {
|
|
33
|
+
matches: false,
|
|
34
|
+
addListener: function () {
|
|
35
|
+
/* noop */
|
|
36
|
+
},
|
|
37
|
+
removeListener: function () {
|
|
38
|
+
/* noop */
|
|
39
|
+
},
|
|
40
|
+
addEventListener: function () {
|
|
41
|
+
/* noop */
|
|
42
|
+
},
|
|
43
|
+
removeEventListener: function () {
|
|
44
|
+
/* noop */
|
|
45
|
+
},
|
|
46
|
+
dispatchEvent: function () {
|
|
47
|
+
return false;
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
HTMLCanvasElement.prototype.getContext = function () {
|
|
54
|
+
return {
|
|
55
|
+
fillRect: function () {
|
|
56
|
+
/* noop */
|
|
57
|
+
},
|
|
58
|
+
clearRect: function () {
|
|
59
|
+
/* noop */
|
|
60
|
+
},
|
|
61
|
+
getImageData: function (x: number, y: number, w: number, h: number) {
|
|
62
|
+
return { data: new Array(w * h * 4) };
|
|
63
|
+
},
|
|
64
|
+
putImageData: function () {
|
|
65
|
+
/* noop */
|
|
66
|
+
},
|
|
67
|
+
createImageData: function () {
|
|
68
|
+
return [];
|
|
69
|
+
},
|
|
70
|
+
setTransform: function () {
|
|
71
|
+
/* noop */
|
|
72
|
+
},
|
|
73
|
+
drawImage: function () {
|
|
74
|
+
/* noop */
|
|
75
|
+
},
|
|
76
|
+
save: function () {
|
|
77
|
+
/* noop */
|
|
78
|
+
},
|
|
79
|
+
fillText: function () {
|
|
80
|
+
/* noop */
|
|
81
|
+
},
|
|
82
|
+
restore: function () {
|
|
83
|
+
/* noop */
|
|
84
|
+
},
|
|
85
|
+
beginPath: function () {
|
|
86
|
+
/* noop */
|
|
87
|
+
},
|
|
88
|
+
moveTo: function () {
|
|
89
|
+
/* noop */
|
|
90
|
+
},
|
|
91
|
+
lineTo: function () {
|
|
92
|
+
/* noop */
|
|
93
|
+
},
|
|
94
|
+
closePath: function () {
|
|
95
|
+
/* noop */
|
|
96
|
+
},
|
|
97
|
+
stroke: function () {
|
|
98
|
+
/* noop */
|
|
99
|
+
},
|
|
100
|
+
translate: function () {
|
|
101
|
+
/* noop */
|
|
102
|
+
},
|
|
103
|
+
scale: function () {
|
|
104
|
+
/* noop */
|
|
105
|
+
},
|
|
106
|
+
rotate: function () {
|
|
107
|
+
/* noop */
|
|
108
|
+
},
|
|
109
|
+
arc: function () {
|
|
110
|
+
/* noop */
|
|
111
|
+
},
|
|
112
|
+
fill: function () {
|
|
113
|
+
/* noop */
|
|
114
|
+
},
|
|
115
|
+
measureText: function () {
|
|
116
|
+
return { width: 0 };
|
|
117
|
+
},
|
|
118
|
+
transform: function () {
|
|
119
|
+
/* noop */
|
|
120
|
+
},
|
|
121
|
+
rect: function () {
|
|
122
|
+
/* noop */
|
|
123
|
+
},
|
|
124
|
+
clip: function () {
|
|
125
|
+
/* noop */
|
|
126
|
+
},
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
128
|
+
} as any;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
class ResizeObserverMock {
|
|
132
|
+
observe() {
|
|
133
|
+
/* noop */
|
|
134
|
+
}
|
|
135
|
+
unobserve() {
|
|
136
|
+
/* noop */
|
|
137
|
+
}
|
|
138
|
+
disconnect() {
|
|
139
|
+
/* noop */
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
Object.defineProperty(window, 'ResizeObserver', {
|
|
143
|
+
writable: true,
|
|
144
|
+
value: ResizeObserverMock,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import angular from '@analogjs/vite-plugin-angular';
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
worker: {
|
|
6
|
+
format: 'es', // Emit workers as ES modules (standalone files, not inlined)
|
|
7
|
+
},
|
|
8
|
+
optimizeDeps: {
|
|
9
|
+
include: ['monaco-editor'],
|
|
10
|
+
},
|
|
11
|
+
plugins: [angular()],
|
|
12
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineConfig, mergeConfig } from 'vitest/config';
|
|
2
|
+
import viteConfig from './vite.config.ts';
|
|
3
|
+
|
|
4
|
+
export default mergeConfig(
|
|
5
|
+
viteConfig,
|
|
6
|
+
defineConfig({
|
|
7
|
+
test: {
|
|
8
|
+
globals: true,
|
|
9
|
+
environment: 'jsdom',
|
|
10
|
+
setupFiles: ['src/test-setup.ts'],
|
|
11
|
+
include: ['src/**/*.spec.ts'],
|
|
12
|
+
server: {
|
|
13
|
+
deps: {
|
|
14
|
+
inline: ['monaco-editor'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
resolve: {
|
|
19
|
+
alias: {
|
|
20
|
+
'monaco-editor': 'monaco-editor/esm/vs/editor/editor.main.js',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
);
|