@api-client/core 0.18.56 → 0.18.58
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/build/src/modeling/ApiModel.d.ts +7 -5
- package/build/src/modeling/ApiModel.d.ts.map +1 -1
- package/build/src/modeling/ApiModel.js +35 -16
- package/build/src/modeling/ApiModel.js.map +1 -1
- package/build/src/modeling/ExposedEntity.d.ts +5 -2
- package/build/src/modeling/ExposedEntity.d.ts.map +1 -1
- package/build/src/modeling/ExposedEntity.js +11 -8
- package/build/src/modeling/ExposedEntity.js.map +1 -1
- package/build/src/modeling/actions/Action.d.ts +41 -0
- package/build/src/modeling/actions/Action.d.ts.map +1 -0
- package/build/src/modeling/actions/Action.js +64 -0
- package/build/src/modeling/actions/Action.js.map +1 -0
- package/build/src/modeling/actions/CreateAction.d.ts +18 -0
- package/build/src/modeling/actions/CreateAction.d.ts.map +1 -0
- package/build/src/modeling/actions/CreateAction.js +37 -0
- package/build/src/modeling/actions/CreateAction.js.map +1 -0
- package/build/src/modeling/actions/DeleteAction.d.ts +34 -0
- package/build/src/modeling/actions/DeleteAction.d.ts.map +1 -0
- package/build/src/modeling/actions/DeleteAction.js +57 -0
- package/build/src/modeling/actions/DeleteAction.js.map +1 -0
- package/build/src/modeling/actions/ListAction.d.ts +37 -0
- package/build/src/modeling/actions/ListAction.d.ts.map +1 -0
- package/build/src/modeling/actions/ListAction.js +70 -0
- package/build/src/modeling/actions/ListAction.js.map +1 -0
- package/build/src/modeling/actions/ReadAction.d.ts +18 -0
- package/build/src/modeling/actions/ReadAction.d.ts.map +1 -0
- package/build/src/modeling/actions/ReadAction.js +37 -0
- package/build/src/modeling/actions/ReadAction.js.map +1 -0
- package/build/src/modeling/actions/SearchAction.d.ts +24 -0
- package/build/src/modeling/actions/SearchAction.d.ts.map +1 -0
- package/build/src/modeling/actions/SearchAction.js +47 -0
- package/build/src/modeling/actions/SearchAction.js.map +1 -0
- package/build/src/modeling/actions/UpdateAction.d.ts +27 -0
- package/build/src/modeling/actions/UpdateAction.d.ts.map +1 -0
- package/build/src/modeling/actions/UpdateAction.js +47 -0
- package/build/src/modeling/actions/UpdateAction.js.map +1 -0
- package/build/src/modeling/actions/index.d.ts +24 -0
- package/build/src/modeling/actions/index.d.ts.map +1 -0
- package/build/src/modeling/actions/index.js +9 -0
- package/build/src/modeling/actions/index.js.map +1 -0
- package/build/src/modeling/helpers/Intelisense.d.ts +1 -0
- package/build/src/modeling/helpers/Intelisense.d.ts.map +1 -1
- package/build/src/modeling/helpers/Intelisense.js +23 -0
- package/build/src/modeling/helpers/Intelisense.js.map +1 -1
- package/build/src/modeling/index.d.ts +12 -0
- package/build/src/modeling/index.d.ts.map +1 -0
- package/build/src/modeling/index.js +12 -0
- package/build/src/modeling/index.js.map +1 -0
- package/build/src/modeling/rules/AccessRule.d.ts +17 -0
- package/build/src/modeling/rules/AccessRule.d.ts.map +1 -0
- package/build/src/modeling/rules/AccessRule.js +19 -0
- package/build/src/modeling/rules/AccessRule.js.map +1 -0
- package/build/src/modeling/rules/AllowAuthenticated.d.ts +19 -0
- package/build/src/modeling/rules/AllowAuthenticated.d.ts.map +1 -0
- package/build/src/modeling/rules/AllowAuthenticated.js +14 -0
- package/build/src/modeling/rules/AllowAuthenticated.js.map +1 -0
- package/build/src/modeling/rules/AllowPublic.d.ts +19 -0
- package/build/src/modeling/rules/AllowPublic.d.ts.map +1 -0
- package/build/src/modeling/rules/AllowPublic.js +14 -0
- package/build/src/modeling/rules/AllowPublic.js.map +1 -0
- package/build/src/modeling/rules/MatchEmailDomain.d.ts +25 -0
- package/build/src/modeling/rules/MatchEmailDomain.d.ts.map +1 -0
- package/build/src/modeling/rules/MatchEmailDomain.js +40 -0
- package/build/src/modeling/rules/MatchEmailDomain.js.map +1 -0
- package/build/src/modeling/rules/MatchResourceOwner.d.ts +29 -0
- package/build/src/modeling/rules/MatchResourceOwner.d.ts.map +1 -0
- package/build/src/modeling/rules/MatchResourceOwner.js +40 -0
- package/build/src/modeling/rules/MatchResourceOwner.js.map +1 -0
- package/build/src/modeling/rules/MatchUserProperty.d.ts +28 -0
- package/build/src/modeling/rules/MatchUserProperty.d.ts.map +1 -0
- package/build/src/modeling/rules/MatchUserProperty.js +49 -0
- package/build/src/modeling/rules/MatchUserProperty.js.map +1 -0
- package/build/src/modeling/rules/MatchUserRole.d.ts +29 -0
- package/build/src/modeling/rules/MatchUserRole.d.ts.map +1 -0
- package/build/src/modeling/rules/MatchUserRole.js +40 -0
- package/build/src/modeling/rules/MatchUserRole.js.map +1 -0
- package/build/src/modeling/rules/RateLimitRule.d.ts +61 -0
- package/build/src/modeling/rules/RateLimitRule.d.ts.map +1 -0
- package/build/src/modeling/rules/RateLimitRule.js +101 -0
- package/build/src/modeling/rules/RateLimitRule.js.map +1 -0
- package/build/src/modeling/rules/RateLimitingConfiguration.d.ts +18 -0
- package/build/src/modeling/rules/RateLimitingConfiguration.d.ts.map +1 -0
- package/build/src/modeling/rules/RateLimitingConfiguration.js +35 -0
- package/build/src/modeling/rules/RateLimitingConfiguration.js.map +1 -0
- package/build/src/modeling/rules/index.d.ts +13 -0
- package/build/src/modeling/rules/index.d.ts.map +1 -0
- package/build/src/modeling/rules/index.js +10 -0
- package/build/src/modeling/rules/index.js.map +1 -0
- package/build/src/modeling/types.d.ts +6 -257
- package/build/src/modeling/types.d.ts.map +1 -1
- package/build/src/modeling/types.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/example-generator-api.json +27 -27
- package/package.json +2 -7
- package/src/modeling/ApiModel.ts +21 -19
- package/src/modeling/ExposedEntity.ts +13 -18
- package/src/modeling/actions/Action.ts +64 -0
- package/src/modeling/actions/CreateAction.ts +30 -0
- package/src/modeling/actions/DeleteAction.ts +51 -0
- package/src/modeling/actions/ListAction.ts +58 -0
- package/src/modeling/actions/ReadAction.ts +32 -0
- package/src/modeling/actions/SearchAction.ts +38 -0
- package/src/modeling/actions/UpdateAction.ts +41 -0
- package/src/modeling/helpers/Intelisense.ts +23 -0
- package/src/modeling/rules/AccessRule.ts +29 -0
- package/src/modeling/rules/AllowAuthenticated.ts +24 -0
- package/src/modeling/rules/AllowPublic.ts +24 -0
- package/src/modeling/rules/MatchEmailDomain.ts +39 -0
- package/src/modeling/rules/MatchResourceOwner.ts +43 -0
- package/src/modeling/rules/MatchUserProperty.ts +44 -0
- package/src/modeling/rules/MatchUserRole.ts +43 -0
- package/src/modeling/rules/RateLimitRule.ts +104 -0
- package/src/modeling/rules/RateLimitingConfiguration.ts +32 -0
- package/src/modeling/types.ts +6 -276
- package/tests/unit/modeling/actions/Action.spec.ts +109 -0
- package/tests/unit/modeling/actions/CreateAction.spec.ts +65 -0
- package/tests/unit/modeling/actions/DeleteAction.spec.ts +78 -0
- package/tests/unit/modeling/actions/ListAction.spec.ts +106 -0
- package/tests/unit/modeling/actions/ReadAction.spec.ts +77 -0
- package/tests/unit/modeling/actions/SearchAction.spec.ts +73 -0
- package/tests/unit/modeling/actions/UpdateAction.spec.ts +73 -0
- package/tests/unit/modeling/api_model.spec.ts +48 -3
- package/tests/unit/modeling/exposed_entity.spec.ts +73 -0
- package/tests/unit/modeling/helpers/intellisense.spec.ts +46 -0
- package/tests/unit/modeling/rules/AccessRule.spec.ts +42 -0
- package/tests/unit/modeling/rules/AllowAuthenticated.spec.ts +28 -0
- package/tests/unit/modeling/rules/AllowPublic.spec.ts +28 -0
- package/tests/unit/modeling/rules/MatchEmailDomain.spec.ts +52 -0
- package/tests/unit/modeling/rules/MatchResourceOwner.spec.ts +37 -0
- package/tests/unit/modeling/rules/MatchUserProperty.spec.ts +58 -0
- package/tests/unit/modeling/rules/MatchUserRole.spec.ts +52 -0
- package/tests/unit/modeling/rules/RateLimitRule.spec.ts +70 -0
- package/tests/unit/modeling/rules/RateLimitingConfiguration.spec.ts +61 -0
- package/build/src/modeling/templates/index.d.ts +0 -21
- package/build/src/modeling/templates/index.d.ts.map +0 -1
- package/build/src/modeling/templates/index.js +0 -176
- package/build/src/modeling/templates/index.js.map +0 -1
- package/build/src/modeling/templates/meta/blog-publishing-platform.json +0 -1
- package/build/src/modeling/templates/meta/ecommerce-platform.json +0 -1
- package/build/src/modeling/templates/meta/education-management-platform.json +0 -1
- package/build/src/modeling/templates/meta/financial-services-platform.json +0 -1
- package/build/src/modeling/templates/meta/gaming-platform.json +0 -1
- package/build/src/modeling/templates/meta/healthcare-management-platform.json +0 -1
- package/build/src/modeling/templates/meta/hospitality-platform.json +0 -1
- package/build/src/modeling/templates/meta/index.d.ts +0 -64
- package/build/src/modeling/templates/meta/index.d.ts.map +0 -1
- package/build/src/modeling/templates/meta/index.js +0 -150
- package/build/src/modeling/templates/meta/index.js.map +0 -1
- package/build/src/modeling/templates/meta/iot-smart-home-platform.json +0 -1
- package/build/src/modeling/templates/meta/legal-services-platform.json +0 -1
- package/build/src/modeling/templates/meta/manufacturing-platform.json +0 -1
- package/build/src/modeling/templates/meta/non-profit-platform.json +0 -1
- package/build/src/modeling/templates/meta/real-estate-management-platform.json +0 -1
- package/build/src/modeling/templates/template-registry.d.ts +0 -55
- package/build/src/modeling/templates/template-registry.d.ts.map +0 -1
- package/build/src/modeling/templates/template-registry.js +0 -111
- package/build/src/modeling/templates/template-registry.js.map +0 -1
- package/build/src/modeling/templates/types.d.ts +0 -167
- package/build/src/modeling/templates/types.d.ts.map +0 -1
- package/build/src/modeling/templates/types.js +0 -2
- package/build/src/modeling/templates/types.js.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.d.ts +0 -39
- package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.js +0 -672
- package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.d.ts +0 -40
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js +0 -942
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.d.ts +0 -45
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.js +0 -797
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/index.d.ts +0 -21
- package/build/src/modeling/templates/verticals/business-services/index.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/index.js +0 -50
- package/build/src/modeling/templates/verticals/business-services/index.js.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.d.ts +0 -46
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.js +0 -837
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/education-training/education-domain.d.ts +0 -40
- package/build/src/modeling/templates/verticals/education-training/education-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/education-training/education-domain.js +0 -725
- package/build/src/modeling/templates/verticals/education-training/education-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/education-training/index.d.ts +0 -18
- package/build/src/modeling/templates/verticals/education-training/index.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/education-training/index.js +0 -21
- package/build/src/modeling/templates/verticals/education-training/index.js.map +0 -1
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.d.ts +0 -40
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.js +0 -859
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.d.ts +0 -18
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.js +0 -21
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.js.map +0 -1
- package/build/src/modeling/templates/verticals/index.d.ts +0 -79
- package/build/src/modeling/templates/verticals/index.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/index.js +0 -186
- package/build/src/modeling/templates/verticals/index.js.map +0 -1
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.d.ts +0 -18
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.js +0 -22
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.js.map +0 -1
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.d.ts +0 -45
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.js +0 -710
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/public-sector/index.d.ts +0 -18
- package/build/src/modeling/templates/verticals/public-sector/index.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/public-sector/index.js +0 -22
- package/build/src/modeling/templates/verticals/public-sector/index.js.map +0 -1
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.d.ts +0 -47
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.js +0 -864
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/real-estate-construction/index.d.ts +0 -18
- package/build/src/modeling/templates/verticals/real-estate-construction/index.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/real-estate-construction/index.js +0 -21
- package/build/src/modeling/templates/verticals/real-estate-construction/index.js.map +0 -1
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.d.ts +0 -40
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.js +0 -727
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.d.ts +0 -40
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.js +0 -629
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.d.ts +0 -46
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.js +0 -1033
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/technology-media/index.d.ts +0 -21
- package/build/src/modeling/templates/verticals/technology-media/index.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/technology-media/index.js +0 -42
- package/build/src/modeling/templates/verticals/technology-media/index.js.map +0 -1
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.d.ts +0 -47
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js +0 -1029
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js.map +0 -1
- package/src/modeling/templates/meta/blog-publishing-platform.json +0 -1
- package/src/modeling/templates/meta/ecommerce-platform.json +0 -1
- package/src/modeling/templates/meta/education-management-platform.json +0 -1
- package/src/modeling/templates/meta/financial-services-platform.json +0 -1
- package/src/modeling/templates/meta/gaming-platform.json +0 -1
- package/src/modeling/templates/meta/healthcare-management-platform.json +0 -1
- package/src/modeling/templates/meta/hospitality-platform.json +0 -1
- package/src/modeling/templates/meta/iot-smart-home-platform.json +0 -1
- package/src/modeling/templates/meta/legal-services-platform.json +0 -1
- package/src/modeling/templates/meta/manufacturing-platform.json +0 -1
- package/src/modeling/templates/meta/non-profit-platform.json +0 -1
- package/src/modeling/templates/meta/real-estate-management-platform.json +0 -1
- package/src/modeling/templates/readme.md +0 -260
- package/src/modeling/templates/template-registry.ts +0 -140
- package/src/modeling/templates/types.ts +0 -175
- package/src/modeling/templates/verticals/README.md +0 -122
- package/src/modeling/templates/verticals/business-services/ecommerce-domain.ts +0 -844
- package/src/modeling/templates/verticals/business-services/financial-services-domain.ts +0 -1177
- package/src/modeling/templates/verticals/business-services/hospitality-domain.ts +0 -994
- package/src/modeling/templates/verticals/business-services/legal-services-domain.ts +0 -1059
- package/src/modeling/templates/verticals/education-training/education-domain.ts +0 -922
- package/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.ts +0 -1111
- package/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.ts +0 -895
- package/src/modeling/templates/verticals/public-sector/non-profit-domain.ts +0 -1109
- package/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.ts +0 -944
- package/src/modeling/templates/verticals/technology-media/blog-domain.ts +0 -796
- package/src/modeling/templates/verticals/technology-media/gaming-domain.ts +0 -1290
- package/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.ts +0 -1289
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
# Domain Templates
|
|
2
|
-
|
|
3
|
-
The domain templates allow creating or updating existing data domains from a template. Templates follow the Domain-Driven Design (DDD) principles and provide pre-built business domain structures that users can instantiate or extend.
|
|
4
|
-
|
|
5
|
-
## Organization by Industry Verticals
|
|
6
|
-
|
|
7
|
-
Templates are organized by industry verticals to provide better categorization and discovery:
|
|
8
|
-
|
|
9
|
-
- **Business Services**: E-commerce, Financial Services, Legal Services
|
|
10
|
-
- **Healthcare & Life Sciences**: Healthcare, Pharmaceutical, Research
|
|
11
|
-
- **Education & Training**: Education, Corporate Training, Certification
|
|
12
|
-
- **Real Estate & Construction**: Real Estate, Construction, Property Management
|
|
13
|
-
- **Manufacturing & Logistics**: Manufacturing, Supply Chain, Distribution
|
|
14
|
-
- **Technology & Media**: Gaming, IoT, Content Management, Social Media
|
|
15
|
-
- **Public Sector**: Government, Non-Profit, Healthcare
|
|
16
|
-
|
|
17
|
-
See `verticals/README.md` for detailed information about the vertical organization.
|
|
18
|
-
|
|
19
|
-
## Template Structure
|
|
20
|
-
|
|
21
|
-
Each template is a TypeScript file that exports a default function conforming to the template signature. Templates create comprehensive data domains with proper namespace organization, entity relationships, and semantic annotations.
|
|
22
|
-
|
|
23
|
-
### Required Function Signature
|
|
24
|
-
|
|
25
|
-
```typescript
|
|
26
|
-
import type { CreateTemplateOptions } from './types.js'
|
|
27
|
-
import { DataDomain } from '../DataDomain.js'
|
|
28
|
-
|
|
29
|
-
export default function createMyDomain(options: CreateTemplateOptions = {}): DataDomain {
|
|
30
|
-
// Template implementation
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Template Implementation Pattern
|
|
35
|
-
|
|
36
|
-
```typescript
|
|
37
|
-
/**
|
|
38
|
-
* Template Documentation Header
|
|
39
|
-
*
|
|
40
|
-
* Provide comprehensive documentation explaining:
|
|
41
|
-
* - What business domain this template models
|
|
42
|
-
* - Key entities and relationships included
|
|
43
|
-
* - Semantic annotations and business rules applied
|
|
44
|
-
* - Example usage scenarios
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
import { DataDomain } from '../DataDomain.js'
|
|
48
|
-
import { SemanticType } from '../Semantics.js'
|
|
49
|
-
import {
|
|
50
|
-
addIdField,
|
|
51
|
-
addNameField,
|
|
52
|
-
addEmailField,
|
|
53
|
-
// Import other helper functions as needed
|
|
54
|
-
} from '../helpers/Intelisense.js'
|
|
55
|
-
import type { CreateTemplateOptions } from './types.js'
|
|
56
|
-
|
|
57
|
-
function createDomain(): DataDomain {
|
|
58
|
-
return new DataDomain({
|
|
59
|
-
info: {
|
|
60
|
-
name: 'My Business Domain',
|
|
61
|
-
displayName: 'My Business Domain',
|
|
62
|
-
description: 'Clear description of what this domain models',
|
|
63
|
-
},
|
|
64
|
-
})
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export default function createMyDomain(options: CreateTemplateOptions = {}): DataDomain {
|
|
68
|
-
// Use existing domain if provided, otherwise create new one
|
|
69
|
-
const domain = options.domain ?? createDomain()
|
|
70
|
-
|
|
71
|
-
// Create namespaces following business capabilities
|
|
72
|
-
const coreNamespace = domain.addNamespace({
|
|
73
|
-
info: { name: 'CoreManagement' }
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
// Add models to organize related entities
|
|
77
|
-
const entityModel = coreNamespace.addModel({
|
|
78
|
-
info: { name: 'CoreEntities' }
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
// Create entities with proper semantic annotations
|
|
82
|
-
const mainEntity = entityModel.addEntity({
|
|
83
|
-
info: { name: 'MainEntity' },
|
|
84
|
-
semantics: [{ type: SemanticType.User }] // If applicable
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
// Add properties using helper functions for consistency
|
|
88
|
-
addIdField(mainEntity)
|
|
89
|
-
addNameField(mainEntity)
|
|
90
|
-
addEmailField(mainEntity)
|
|
91
|
-
|
|
92
|
-
// Add custom properties with proper semantics
|
|
93
|
-
mainEntity.addProperty({
|
|
94
|
-
info: { name: 'customField' },
|
|
95
|
-
type: 'string',
|
|
96
|
-
required: false,
|
|
97
|
-
semantics: [/* appropriate semantics */]
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
// Create associations between entities
|
|
101
|
-
// (Add more entities and relationships as needed)
|
|
102
|
-
|
|
103
|
-
return domain
|
|
104
|
-
}
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
## Adding a Template
|
|
108
|
-
|
|
109
|
-
### 1. Create the Template File
|
|
110
|
-
|
|
111
|
-
Create a new file `[domain-name]-domain.ts` in `src/modeling/templates/` following the naming convention:
|
|
112
|
-
|
|
113
|
-
- Use kebab-case for file names
|
|
114
|
-
- End with `-domain.ts`
|
|
115
|
-
- Examples: `healthcare-domain.ts`, `financial-services-domain.ts`
|
|
116
|
-
|
|
117
|
-
### 2. Follow Modeling Guidelines
|
|
118
|
-
|
|
119
|
-
Templates must adhere to the modeling instructions in `.github/instructions/modeling.instructions.md`:
|
|
120
|
-
|
|
121
|
-
- **Business-First Approach**: Model business concepts, not technical concerns
|
|
122
|
-
- **Proper Hierarchy**: DataDomain → DomainNamespace → DomainModel → DomainEntity → DomainProperty
|
|
123
|
-
- **Semantic Annotations**: Use `SemanticType` for passwords, emails, timestamps, etc.
|
|
124
|
-
- **Security**: Mark sensitive properties as `writeOnly`, validate all inputs
|
|
125
|
-
- **Database Compliance**: Follow PostgreSQL naming conventions (snake_case conversion)
|
|
126
|
-
|
|
127
|
-
### 3. Required Imports
|
|
128
|
-
|
|
129
|
-
Include these essential imports:
|
|
130
|
-
|
|
131
|
-
```typescript
|
|
132
|
-
import { DataDomain } from '../DataDomain.js'
|
|
133
|
-
import { SemanticType } from '../Semantics.js'
|
|
134
|
-
import type { CreateTemplateOptions } from './types.js'
|
|
135
|
-
|
|
136
|
-
// Import semantic definition helpers as needed
|
|
137
|
-
import { createCalculatedSemantic } from '../definitions/Calculated.js'
|
|
138
|
-
import { createCurrencySemantic } from '../definitions/Currency.js'
|
|
139
|
-
|
|
140
|
-
// Import property helper functions for consistency
|
|
141
|
-
import {
|
|
142
|
-
addIdField,
|
|
143
|
-
addNameField,
|
|
144
|
-
addEmailField,
|
|
145
|
-
addPasswordField,
|
|
146
|
-
addCreatedAtField,
|
|
147
|
-
addUpdatedAtField,
|
|
148
|
-
// ... other helpers as needed
|
|
149
|
-
} from '../helpers/Intelisense.js'
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### 4. Handle Template Options
|
|
153
|
-
|
|
154
|
-
Always support the `CreateTemplateOptions` interface:
|
|
155
|
-
|
|
156
|
-
```typescript
|
|
157
|
-
export default function createMyDomain(options: CreateTemplateOptions = {}): DataDomain {
|
|
158
|
-
// Use provided domain or create new one
|
|
159
|
-
const domain = options.domain ?? createDomain()
|
|
160
|
-
|
|
161
|
-
// If domain is provided, you're extending an existing domain
|
|
162
|
-
// If not provided, you're creating a new domain
|
|
163
|
-
|
|
164
|
-
return domain
|
|
165
|
-
}
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
## Registering Templates
|
|
169
|
-
|
|
170
|
-
### 1. Add to Generation Script
|
|
171
|
-
|
|
172
|
-
Edit `scripts/generate-template-metadata.js` and add your template to the registry:
|
|
173
|
-
|
|
174
|
-
```javascript
|
|
175
|
-
// Import your template function
|
|
176
|
-
import createMyDomain from '../build/src/modeling/templates/my-domain.js'
|
|
177
|
-
|
|
178
|
-
// Add to templates array
|
|
179
|
-
const TEMPLATE_CONFIGS = [
|
|
180
|
-
{
|
|
181
|
-
id: 'my-business-domain',
|
|
182
|
-
name: 'My Business Domain',
|
|
183
|
-
description: 'Brief description for UI display',
|
|
184
|
-
version: '1.0.0',
|
|
185
|
-
author: 'API Now! Core Team',
|
|
186
|
-
tags: ['business', 'industry-specific'], // For categorization
|
|
187
|
-
createdAt: '2025-01-01T00:00:00.000Z',
|
|
188
|
-
updatedAt: '2025-01-01T00:00:00.000Z',
|
|
189
|
-
createDomainFn: createMyDomain,
|
|
190
|
-
},
|
|
191
|
-
// ... other templates
|
|
192
|
-
]
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### 2. Template Metadata
|
|
196
|
-
|
|
197
|
-
The generation script will create metadata including:
|
|
198
|
-
|
|
199
|
-
- Template structure analysis (namespaces, models, entities)
|
|
200
|
-
- Property counts and types
|
|
201
|
-
- Association mappings
|
|
202
|
-
- Semantic annotation usage
|
|
203
|
-
- UI presentation information
|
|
204
|
-
|
|
205
|
-
## Generating Metadata
|
|
206
|
-
|
|
207
|
-
Each template needs to be processed to generate metadata files. These metadata are used to generate the templates view in the UI.
|
|
208
|
-
|
|
209
|
-
**If you won't generate metadata, the template won't get registered by the UI.**
|
|
210
|
-
|
|
211
|
-
### 1. Build the Project First
|
|
212
|
-
|
|
213
|
-
```sh
|
|
214
|
-
npm run build
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
### 2. Run the Metadata Generation Script
|
|
218
|
-
|
|
219
|
-
```sh
|
|
220
|
-
node scripts/generate-template-metadata.js
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### 3. Rebuild to Include New Metadata
|
|
224
|
-
|
|
225
|
-
```sh
|
|
226
|
-
npm run build
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
All metadata are generated under `src/modeling/templates/meta` directory as JSON files.
|
|
230
|
-
|
|
231
|
-
## Best Practices
|
|
232
|
-
|
|
233
|
-
### Domain Design
|
|
234
|
-
|
|
235
|
-
1. **Business Alignment**: Model actual business processes and entities
|
|
236
|
-
2. **Clear Naming**: Use business-meaningful names, not technical jargon
|
|
237
|
-
3. **Proper Grouping**: Organize entities into logical namespaces and models
|
|
238
|
-
4. **Semantic Richness**: Apply appropriate semantic annotations for security and behavior
|
|
239
|
-
|
|
240
|
-
### Code Quality
|
|
241
|
-
|
|
242
|
-
1. **Documentation**: Include comprehensive JSDoc comments explaining the business purpose
|
|
243
|
-
2. **Type Safety**: Use TypeScript interfaces and proper type annotations
|
|
244
|
-
3. **Error Handling**: Validate inputs and provide clear error messages
|
|
245
|
-
4. **Consistency**: Use helper functions from `helpers/Intelisense.js` for common patterns
|
|
246
|
-
|
|
247
|
-
### Security
|
|
248
|
-
|
|
249
|
-
1. **Sensitive Data**: Mark passwords and sensitive fields as `writeOnly`
|
|
250
|
-
2. **Validation**: Validate all user inputs and model structures
|
|
251
|
-
3. **Access Control**: Consider data access patterns in your domain design
|
|
252
|
-
|
|
253
|
-
## Example Templates
|
|
254
|
-
|
|
255
|
-
Refer to existing templates for comprehensive examples:
|
|
256
|
-
|
|
257
|
-
- `ecommerce-domain.ts` - E-commerce platform with users, products, orders
|
|
258
|
-
- `blog-domain.ts` - Content management with publishing workflow
|
|
259
|
-
|
|
260
|
-
These demonstrate proper structure, semantic usage, and business modeling patterns.
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import type { DomainTemplate } from './types.js'
|
|
2
|
-
import {
|
|
3
|
-
getAllTemplates,
|
|
4
|
-
getTemplate,
|
|
5
|
-
getTemplatesByTag,
|
|
6
|
-
getTemplatesByCategory,
|
|
7
|
-
searchTemplates,
|
|
8
|
-
getTemplateStats,
|
|
9
|
-
} from './meta/index.js'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Registry of all available domain templates with their metadata.
|
|
13
|
-
* This provides a central location for UI components to discover and present templates.
|
|
14
|
-
*
|
|
15
|
-
* The templates are pre-processed at build time using the generate-template-metadata.js script
|
|
16
|
-
* to avoid loading and processing all templates on the client side.
|
|
17
|
-
*/
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
19
|
-
export class TemplateRegistry {
|
|
20
|
-
/**
|
|
21
|
-
* Gets all available templates
|
|
22
|
-
*/
|
|
23
|
-
static getAllTemplates(): DomainTemplate[] {
|
|
24
|
-
return getAllTemplates()
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Gets a template by its ID
|
|
29
|
-
*/
|
|
30
|
-
static getTemplate(id: string): DomainTemplate | undefined {
|
|
31
|
-
return getTemplate(id)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Gets templates filtered by tags
|
|
36
|
-
*/
|
|
37
|
-
static getTemplatesByTag(tag: string): DomainTemplate[] {
|
|
38
|
-
return getTemplatesByTag(tag)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Gets templates filtered by category (based on tags)
|
|
43
|
-
*/
|
|
44
|
-
static getTemplatesByCategory(category: 'business' | 'content' | 'social' | 'technical'): DomainTemplate[] {
|
|
45
|
-
return getTemplatesByCategory(category)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Gets templates filtered by industry vertical
|
|
50
|
-
*/
|
|
51
|
-
static getTemplatesByVertical(vertical: string): DomainTemplate[] {
|
|
52
|
-
// This would need to be implemented in the meta/index.js
|
|
53
|
-
return getAllTemplates().filter((template) =>
|
|
54
|
-
template.tags?.some((tag) => tag.toLowerCase().includes(vertical.toLowerCase()))
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Gets all available industry verticals
|
|
60
|
-
*/
|
|
61
|
-
static getIndustryVerticals(): {
|
|
62
|
-
id: string
|
|
63
|
-
name: string
|
|
64
|
-
description: string
|
|
65
|
-
subcategories: string[]
|
|
66
|
-
templateCount: number
|
|
67
|
-
}[] {
|
|
68
|
-
return [
|
|
69
|
-
{
|
|
70
|
-
id: 'business-services',
|
|
71
|
-
name: 'Business Services',
|
|
72
|
-
description: 'E-commerce, Financial Services, Legal Services',
|
|
73
|
-
subcategories: ['E-commerce', 'Financial Services', 'Legal Services'],
|
|
74
|
-
templateCount: 4,
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
id: 'healthcare-life-sciences',
|
|
78
|
-
name: 'Healthcare & Life Sciences',
|
|
79
|
-
description: 'Healthcare, Pharmaceutical, Research',
|
|
80
|
-
subcategories: ['Healthcare', 'Pharmaceutical', 'Research'],
|
|
81
|
-
templateCount: 1,
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
id: 'education-training',
|
|
85
|
-
name: 'Education & Training',
|
|
86
|
-
description: 'Education, Corporate Training, Certification',
|
|
87
|
-
subcategories: ['Education', 'Corporate Training', 'Certification'],
|
|
88
|
-
templateCount: 1,
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
id: 'real-estate-construction',
|
|
92
|
-
name: 'Real Estate & Construction',
|
|
93
|
-
description: 'Real Estate, Construction, Property Management',
|
|
94
|
-
subcategories: ['Real Estate', 'Construction', 'Property Management'],
|
|
95
|
-
templateCount: 1,
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
id: 'manufacturing-logistics',
|
|
99
|
-
name: 'Manufacturing & Logistics',
|
|
100
|
-
description: 'Manufacturing, Supply Chain, Distribution',
|
|
101
|
-
subcategories: ['Manufacturing', 'Supply Chain', 'Distribution'],
|
|
102
|
-
templateCount: 1,
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
id: 'technology-media',
|
|
106
|
-
name: 'Technology & Media',
|
|
107
|
-
description: 'Gaming, IoT, Content Management, Social Media',
|
|
108
|
-
subcategories: ['Gaming', 'IoT', 'Content Management', 'Social Media'],
|
|
109
|
-
templateCount: 3,
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
id: 'public-sector',
|
|
113
|
-
name: 'Public Sector',
|
|
114
|
-
description: 'Government, Non-Profit, Healthcare',
|
|
115
|
-
subcategories: ['Government', 'Non-Profit', 'Healthcare'],
|
|
116
|
-
templateCount: 1,
|
|
117
|
-
},
|
|
118
|
-
]
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Searches templates by name or description
|
|
123
|
-
*/
|
|
124
|
-
static searchTemplates(query: string): DomainTemplate[] {
|
|
125
|
-
return searchTemplates(query)
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Gets template statistics for analytics
|
|
130
|
-
*/
|
|
131
|
-
static getTemplateStats(): {
|
|
132
|
-
totalTemplates: number
|
|
133
|
-
totalEntities: number
|
|
134
|
-
totalProperties: number
|
|
135
|
-
totalAssociations: number
|
|
136
|
-
categoryCounts: Record<string, number>
|
|
137
|
-
} {
|
|
138
|
-
return getTemplateStats()
|
|
139
|
-
}
|
|
140
|
-
}
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import type { DataDomain } from '../DataDomain.js'
|
|
2
|
-
|
|
3
|
-
export interface CreateTemplateOptions {
|
|
4
|
-
/**
|
|
5
|
-
* The DataDomain instance to use for the template.
|
|
6
|
-
* If not provided, a new DataDomain instance will be created.
|
|
7
|
-
*/
|
|
8
|
-
domain?: DataDomain
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Template metadata for UI presentation
|
|
13
|
-
*/
|
|
14
|
-
export interface DomainTemplate {
|
|
15
|
-
/** Unique identifier for the template */
|
|
16
|
-
id: string
|
|
17
|
-
/** Display name of the template */
|
|
18
|
-
name: string
|
|
19
|
-
/** Short description of what the template does (plain text, no HTML/markdown) */
|
|
20
|
-
description: string
|
|
21
|
-
/** When the template was created (ISO string) */
|
|
22
|
-
createdAt: string
|
|
23
|
-
/** When the template was last updated (ISO string) */
|
|
24
|
-
updatedAt: string
|
|
25
|
-
/** Template version */
|
|
26
|
-
version: string
|
|
27
|
-
/** Author information */
|
|
28
|
-
author: string
|
|
29
|
-
/** Template categorization tags */
|
|
30
|
-
tags: string[]
|
|
31
|
-
/** Detailed domain structure for UI presentation */
|
|
32
|
-
structure: DomainTemplateStructure
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Detailed domain structure information for UI presentation
|
|
37
|
-
*/
|
|
38
|
-
export interface DomainTemplateStructure {
|
|
39
|
-
/** Domain information */
|
|
40
|
-
domain: DomainInfo
|
|
41
|
-
/** List of namespaces in the domain */
|
|
42
|
-
namespaces: NamespaceInfo[]
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Domain-level information
|
|
47
|
-
*/
|
|
48
|
-
export interface DomainInfo {
|
|
49
|
-
/** Domain name */
|
|
50
|
-
name: string
|
|
51
|
-
/** Domain description */
|
|
52
|
-
description?: string
|
|
53
|
-
/** Total number of entities across all namespaces */
|
|
54
|
-
totalEntities: number
|
|
55
|
-
/** Total number of properties across all entities */
|
|
56
|
-
totalProperties: number
|
|
57
|
-
/** Total number of associations across all entities */
|
|
58
|
-
totalAssociations: number
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Namespace-level information
|
|
63
|
-
*/
|
|
64
|
-
export interface NamespaceInfo {
|
|
65
|
-
/** Namespace name */
|
|
66
|
-
name: string
|
|
67
|
-
/** Namespace display name */
|
|
68
|
-
displayName?: string
|
|
69
|
-
/** Namespace description */
|
|
70
|
-
description?: string
|
|
71
|
-
/** Number of models in this namespace */
|
|
72
|
-
modelCount: number
|
|
73
|
-
/** Number of entities in this namespace */
|
|
74
|
-
entityCount: number
|
|
75
|
-
/** List of models in this namespace */
|
|
76
|
-
models: ModelInfo[]
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Model-level information
|
|
81
|
-
*/
|
|
82
|
-
export interface ModelInfo {
|
|
83
|
-
/** Model name */
|
|
84
|
-
name: string
|
|
85
|
-
/** Model display name */
|
|
86
|
-
displayName?: string
|
|
87
|
-
/** Model description */
|
|
88
|
-
description?: string
|
|
89
|
-
/** Number of entities in this model */
|
|
90
|
-
entityCount: number
|
|
91
|
-
/** List of entities in this model */
|
|
92
|
-
entities: EntityInfo[]
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Entity-level information for UI presentation
|
|
97
|
-
*/
|
|
98
|
-
export interface EntityInfo {
|
|
99
|
-
/** Entity name */
|
|
100
|
-
name: string
|
|
101
|
-
/** Entity display name */
|
|
102
|
-
displayName?: string
|
|
103
|
-
/** Entity description */
|
|
104
|
-
description?: string
|
|
105
|
-
/** Number of properties */
|
|
106
|
-
propertyCount: number
|
|
107
|
-
/** Number of associations */
|
|
108
|
-
associationCount: number
|
|
109
|
-
/** Whether this entity is deprecated */
|
|
110
|
-
deprecated?: boolean
|
|
111
|
-
/** List of properties for this entity */
|
|
112
|
-
properties: PropertyInfo[]
|
|
113
|
-
/** List of associations for this entity */
|
|
114
|
-
associations: AssociationInfo[]
|
|
115
|
-
/** Applied semantic types */
|
|
116
|
-
semantics: string[]
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Property-level information for UI presentation
|
|
121
|
-
*/
|
|
122
|
-
export interface PropertyInfo {
|
|
123
|
-
/** Property name */
|
|
124
|
-
name: string
|
|
125
|
-
/** Property display name */
|
|
126
|
-
displayName?: string
|
|
127
|
-
/** Property description */
|
|
128
|
-
description?: string
|
|
129
|
-
/** Data type (string, number, boolean, etc.) */
|
|
130
|
-
type: string
|
|
131
|
-
/** Whether this property is required */
|
|
132
|
-
required?: boolean
|
|
133
|
-
/** Whether this property allows multiple values */
|
|
134
|
-
multiple?: boolean
|
|
135
|
-
/** Whether this property is a primary key */
|
|
136
|
-
primary?: boolean
|
|
137
|
-
/** Whether this property is unique */
|
|
138
|
-
unique?: boolean
|
|
139
|
-
/** Whether this property is read-only */
|
|
140
|
-
readOnly?: boolean
|
|
141
|
-
/** Whether this property is write-only */
|
|
142
|
-
writeOnly?: boolean
|
|
143
|
-
/** Whether this property is deprecated */
|
|
144
|
-
deprecated?: boolean
|
|
145
|
-
/** Applied semantic types */
|
|
146
|
-
semantics: string[]
|
|
147
|
-
/** Enum values if applicable */
|
|
148
|
-
enumValues?: string[]
|
|
149
|
-
/** Default value if specified */
|
|
150
|
-
defaultValue?: string
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Association-level information for UI presentation
|
|
155
|
-
*/
|
|
156
|
-
export interface AssociationInfo {
|
|
157
|
-
/** Association name */
|
|
158
|
-
name: string
|
|
159
|
-
/** Association display name */
|
|
160
|
-
displayName?: string
|
|
161
|
-
/** Association description */
|
|
162
|
-
description?: string
|
|
163
|
-
/** Whether this association is required */
|
|
164
|
-
required?: boolean
|
|
165
|
-
/** Whether this association allows multiple targets */
|
|
166
|
-
multiple?: boolean
|
|
167
|
-
/** Whether this association is read-only */
|
|
168
|
-
readOnly?: boolean
|
|
169
|
-
/** Target entity names this association points to */
|
|
170
|
-
targetEntities: string[]
|
|
171
|
-
/** Applied semantic types */
|
|
172
|
-
semantics: string[]
|
|
173
|
-
/** Relationship cardinality description (e.g., "One-to-Many", "Many-to-Many") */
|
|
174
|
-
cardinality: string
|
|
175
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
# Industry Vertical Templates
|
|
2
|
-
|
|
3
|
-
This directory organizes domain templates by industry verticals to provide better categorization and discovery for users looking for domain-specific templates.
|
|
4
|
-
|
|
5
|
-
## Structure
|
|
6
|
-
|
|
7
|
-
```plain
|
|
8
|
-
verticals/
|
|
9
|
-
├── business-services/ # E-commerce, Financial Services, Legal Services
|
|
10
|
-
│ ├── ecommerce-domain.ts
|
|
11
|
-
│ ├── financial-services-domain.ts
|
|
12
|
-
│ └── index.ts
|
|
13
|
-
├── healthcare-life-sciences/ # Healthcare, Pharmaceutical, Research
|
|
14
|
-
│ ├── healthcare-domain.ts
|
|
15
|
-
│ └── index.ts
|
|
16
|
-
├── education-training/ # Education, Corporate Training, Certification
|
|
17
|
-
│ ├── education-domain.ts
|
|
18
|
-
│ └── index.ts
|
|
19
|
-
├── real-estate-construction/ # Real Estate, Construction, Property Management
|
|
20
|
-
│ ├── real-estate-domain.ts
|
|
21
|
-
│ └── index.ts
|
|
22
|
-
├── technology-media/ # Gaming, IoT, Content Management, Social Media
|
|
23
|
-
│ ├── blog-domain.ts
|
|
24
|
-
│ └── index.ts
|
|
25
|
-
├── manufacturing-logistics/ # Manufacturing, Supply Chain, Distribution
|
|
26
|
-
│ └── index.ts
|
|
27
|
-
├── public-sector/ # Government, Non-Profit, Healthcare
|
|
28
|
-
│ └── index.ts
|
|
29
|
-
└── index.ts # Main verticals index
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Industry Verticals
|
|
33
|
-
|
|
34
|
-
### 1. Business Services
|
|
35
|
-
|
|
36
|
-
- **E-commerce Platform**: Complete e-commerce data domain with product management, orders, customers, and payments
|
|
37
|
-
- **Financial Services Platform**: Comprehensive financial services data domain with accounts, transactions, investments, and compliance
|
|
38
|
-
|
|
39
|
-
### 2. Healthcare & Life Sciences
|
|
40
|
-
|
|
41
|
-
- **Healthcare Management Platform**: Comprehensive healthcare data domain with patients, providers, facilities, and medical records
|
|
42
|
-
|
|
43
|
-
### 3. Education & Training
|
|
44
|
-
|
|
45
|
-
- **Education Management Platform**: Comprehensive education data domain with students, courses, faculty, and academic management
|
|
46
|
-
|
|
47
|
-
### 4. Real Estate & Construction
|
|
48
|
-
|
|
49
|
-
- **Real Estate Management Platform**: Comprehensive real estate data domain with properties, clients, transactions, and marketing
|
|
50
|
-
|
|
51
|
-
### 5. Technology & Media
|
|
52
|
-
|
|
53
|
-
- **Blog Publishing Platform**: Complete blog and content publishing data domain with articles, authors, and media management
|
|
54
|
-
|
|
55
|
-
### 6. Manufacturing & Logistics
|
|
56
|
-
|
|
57
|
-
- *No templates yet* - Planned for Manufacturing, Supply Chain, Distribution
|
|
58
|
-
|
|
59
|
-
### 7. Public Sector
|
|
60
|
-
|
|
61
|
-
- *No templates yet* - Planned for Government, Non-Profit, Healthcare
|
|
62
|
-
|
|
63
|
-
## Usage
|
|
64
|
-
|
|
65
|
-
### Importing Templates by Vertical
|
|
66
|
-
|
|
67
|
-
```typescript
|
|
68
|
-
// Import all verticals
|
|
69
|
-
import {
|
|
70
|
-
businessServicesTemplates,
|
|
71
|
-
healthcareLifeSciencesTemplates,
|
|
72
|
-
educationTrainingTemplates,
|
|
73
|
-
realEstateConstructionTemplates,
|
|
74
|
-
technologyMediaTemplates,
|
|
75
|
-
manufacturingLogisticsTemplates,
|
|
76
|
-
publicSectorTemplates
|
|
77
|
-
} from './verticals/index.js'
|
|
78
|
-
|
|
79
|
-
// Import specific templates
|
|
80
|
-
import { createEcommerceDomain } from './verticals/business-services/index.js'
|
|
81
|
-
import { createHealthcareDomain } from './verticals/healthcare-life-sciences/index.js'
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### Using the Template Registry
|
|
85
|
-
|
|
86
|
-
```typescript
|
|
87
|
-
import { TemplateRegistry } from './template-registry.js'
|
|
88
|
-
|
|
89
|
-
// Get all industry verticals
|
|
90
|
-
const verticals = TemplateRegistry.getIndustryVerticals()
|
|
91
|
-
|
|
92
|
-
// Get templates by vertical
|
|
93
|
-
const businessTemplates = TemplateRegistry.getTemplatesByVertical('business-services')
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Adding New Templates
|
|
97
|
-
|
|
98
|
-
1. **Choose the appropriate vertical** based on the industry focus
|
|
99
|
-
2. **Create the template file** in the corresponding vertical directory
|
|
100
|
-
3. **Update the vertical's index.ts** to export the new template
|
|
101
|
-
4. **Update the main verticals index.ts** to include the template metadata
|
|
102
|
-
5. **Update the metadata generation script** to include the new template
|
|
103
|
-
6. **Run the build and metadata generation**:
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
npm run build
|
|
107
|
-
node scripts/generate-template-metadata.js
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
## Template Categories
|
|
111
|
-
|
|
112
|
-
Each vertical can contain multiple subcategories:
|
|
113
|
-
|
|
114
|
-
- **Business Services**: E-commerce, Financial Services, Legal Services
|
|
115
|
-
- **Healthcare & Life Sciences**: Healthcare, Pharmaceutical, Research
|
|
116
|
-
- **Education & Training**: Education, Corporate Training, Certification
|
|
117
|
-
- **Real Estate & Construction**: Real Estate, Construction, Property Management
|
|
118
|
-
- **Manufacturing & Logistics**: Manufacturing, Supply Chain, Distribution
|
|
119
|
-
- **Technology & Media**: Gaming, IoT, Content Management, Social Media
|
|
120
|
-
- **Public Sector**: Government, Non-Profit, Healthcare
|
|
121
|
-
|
|
122
|
-
This organization helps users quickly find templates relevant to their industry and use case.
|