@api-client/core 0.18.20 → 0.18.21

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.
@@ -0,0 +1,20 @@
1
+ import type { DataDomain } from '../DataDomain.js';
2
+ import type { DomainTemplate, DomainTemplateStructure } from './types.js';
3
+ /**
4
+ * Creates template metadata from a DataDomain instance for UI presentation
5
+ */
6
+ export declare function createTemplateMetadata(domain: DataDomain, templateInfo: {
7
+ id: string;
8
+ name: string;
9
+ description: string;
10
+ version: string;
11
+ author: string;
12
+ tags?: string[];
13
+ createdAt: string;
14
+ updatedAt: string;
15
+ }): DomainTemplate;
16
+ /**
17
+ * Analyzes a DataDomain to extract structural information for UI presentation
18
+ */
19
+ export declare function analyzeDomainStructure(domain: DataDomain): DomainTemplateStructure;
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modeling/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAMlD,OAAO,KAAK,EAEV,cAAc,EACd,uBAAuB,EAKxB,MAAM,YAAY,CAAA;AAEnB;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB,GACA,cAAc,CAchB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,UAAU,GAAG,uBAAuB,CAgClF"}
@@ -0,0 +1,174 @@
1
+ /**
2
+ * Creates template metadata from a DataDomain instance for UI presentation
3
+ */
4
+ export function createTemplateMetadata(domain, templateInfo) {
5
+ const structure = analyzeDomainStructure(domain);
6
+ return {
7
+ id: templateInfo.id,
8
+ name: templateInfo.name,
9
+ description: templateInfo.description,
10
+ createdAt: templateInfo.createdAt,
11
+ updatedAt: templateInfo.updatedAt,
12
+ version: templateInfo.version,
13
+ author: templateInfo.author,
14
+ tags: templateInfo.tags || [],
15
+ structure,
16
+ };
17
+ }
18
+ /**
19
+ * Analyzes a DataDomain to extract structural information for UI presentation
20
+ */
21
+ export function analyzeDomainStructure(domain) {
22
+ const namespaces = [];
23
+ let totalEntities = 0;
24
+ let totalProperties = 0;
25
+ let totalAssociations = 0;
26
+ // Analyze each namespace
27
+ for (const namespace of domain.listNamespaces()) {
28
+ const namespaceInfo = analyzeNamespace(namespace);
29
+ namespaces.push(namespaceInfo);
30
+ totalEntities += namespaceInfo.entityCount;
31
+ totalProperties += namespaceInfo.models.reduce((sum, model) => sum + model.entities.reduce((entitySum, entity) => entitySum + entity.propertyCount, 0), 0);
32
+ totalAssociations += namespaceInfo.models.reduce((sum, model) => sum + model.entities.reduce((entitySum, entity) => entitySum + entity.associationCount, 0), 0);
33
+ }
34
+ return {
35
+ domain: {
36
+ name: domain.info.name || 'Unnamed Domain',
37
+ description: domain.info.description,
38
+ totalEntities,
39
+ totalProperties,
40
+ totalAssociations,
41
+ },
42
+ namespaces,
43
+ };
44
+ }
45
+ /**
46
+ * Analyzes a DomainNamespace to extract information for UI presentation
47
+ */
48
+ function analyzeNamespace(namespace) {
49
+ const models = [];
50
+ let entityCount = 0;
51
+ // Analyze each model in the namespace
52
+ for (const model of namespace.listModels()) {
53
+ const modelInfo = analyzeModel(model);
54
+ models.push(modelInfo);
55
+ entityCount += modelInfo.entityCount;
56
+ }
57
+ return {
58
+ name: namespace.info.name || 'Unnamed Namespace',
59
+ displayName: namespace.info.displayName,
60
+ description: namespace.info.description,
61
+ modelCount: models.length,
62
+ entityCount,
63
+ models,
64
+ };
65
+ }
66
+ /**
67
+ * Analyzes a DomainModel to extract information for UI presentation
68
+ */
69
+ function analyzeModel(model) {
70
+ const entities = [];
71
+ // Analyze each entity in the model
72
+ for (const entity of model.listEntities()) {
73
+ const entityInfo = analyzeEntity(entity);
74
+ entities.push(entityInfo);
75
+ }
76
+ return {
77
+ name: model.info.name || 'Unnamed Model',
78
+ displayName: model.info.displayName,
79
+ description: model.info.description,
80
+ entityCount: entities.length,
81
+ entities,
82
+ };
83
+ }
84
+ /**
85
+ * Analyzes a DomainEntity to extract information for UI presentation
86
+ */
87
+ function analyzeEntity(entity) {
88
+ const properties = [];
89
+ const associations = [];
90
+ // Analyze properties
91
+ for (const property of entity.listProperties()) {
92
+ properties.push(analyzeProperty(property));
93
+ }
94
+ // Analyze associations
95
+ for (const association of entity.listAssociations()) {
96
+ associations.push(analyzeAssociation(association));
97
+ }
98
+ return {
99
+ name: entity.info.name || 'Unnamed Entity',
100
+ displayName: entity.info.displayName,
101
+ description: entity.info.description,
102
+ propertyCount: properties.length,
103
+ associationCount: associations.length,
104
+ deprecated: entity.deprecated,
105
+ properties,
106
+ associations,
107
+ semantics: entity.semantics?.map((s) => s.id) || [],
108
+ };
109
+ }
110
+ /**
111
+ * Analyzes a DomainProperty to extract information for UI presentation
112
+ */
113
+ function analyzeProperty(property) {
114
+ const semantics = property.semantics?.map((s) => s.id) || [];
115
+ // Extract enum values if present
116
+ let enumValues;
117
+ if (property.schema?.enum && Array.isArray(property.schema.enum)) {
118
+ enumValues = property.schema.enum.map((v) => String(v));
119
+ }
120
+ // Extract default value
121
+ let defaultValue;
122
+ if (property.schema?.defaultValue) {
123
+ if (property.schema.defaultValue.type === 'literal') {
124
+ defaultValue = String(property.schema.defaultValue.value);
125
+ }
126
+ }
127
+ return {
128
+ name: property.info.name || 'Unnamed Property',
129
+ displayName: property.info.displayName,
130
+ description: property.info.description,
131
+ type: property.type || 'string',
132
+ required: property.required,
133
+ multiple: property.multiple,
134
+ primary: property.primary,
135
+ unique: property.unique,
136
+ readOnly: property.readOnly,
137
+ writeOnly: property.writeOnly,
138
+ deprecated: property.deprecated,
139
+ semantics,
140
+ enumValues,
141
+ defaultValue,
142
+ };
143
+ }
144
+ /**
145
+ * Analyzes a DomainAssociation to extract information for UI presentation
146
+ */
147
+ function analyzeAssociation(association) {
148
+ const semantics = association.semantics?.map((s) => s.id) || [];
149
+ // Get target entity names
150
+ const targetEntities = association.targets?.map((target) => {
151
+ // Try to resolve the target entity to get its name
152
+ const targetEntity = association.domain.findEntity(target.key);
153
+ return targetEntity?.info.name || target.key;
154
+ }) || [];
155
+ // Determine cardinality description
156
+ let cardinality = 'One-to-One';
157
+ if (association.multiple) {
158
+ cardinality = 'One-to-Many';
159
+ }
160
+ // Note: Many-to-Many would typically be determined by looking at the reverse association
161
+ // but for simplicity in UI presentation, we'll use the current association's multiplicity
162
+ return {
163
+ name: association.info.name || 'Unnamed Association',
164
+ displayName: association.info.displayName,
165
+ description: association.info.description,
166
+ required: association.required,
167
+ multiple: association.multiple,
168
+ readOnly: association.readOnly,
169
+ targetEntities,
170
+ semantics,
171
+ cardinality,
172
+ };
173
+ }
174
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modeling/templates/index.ts"],"names":[],"mappings":"AAgBA;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAAkB,EAClB,YASC;IAED,MAAM,SAAS,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAA;IAEhD,OAAO;QACL,EAAE,EAAE,YAAY,CAAC,EAAE;QACnB,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,WAAW,EAAE,YAAY,CAAC,WAAW;QACrC,SAAS,EAAE,YAAY,CAAC,SAAS;QACjC,SAAS,EAAE,YAAY,CAAC,SAAS;QACjC,OAAO,EAAE,YAAY,CAAC,OAAO;QAC7B,MAAM,EAAE,YAAY,CAAC,MAAM;QAC3B,IAAI,EAAE,YAAY,CAAC,I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M,CAAC,GAAG,CAAC,CAAA;QAC9D,OAAO,YAAY,EAAE,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,GAAG,CAAA;IAC9C,CAAC,CAAC,IAAI,EAAE,CAAA;IAEV,oCAAoC;IACpC,IAAI,WAAW,GAAG,YAAY,CAAA;IAC9B,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;QACzB,WAAW,GAAG,aAAa,CAAA;IAC7B,CAAC;IACD,yFAAyF;IACzF,0FAA0F;IAE1F,OAAO;QACL,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,IAAI,qBAAqB;QACpD,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,WAAW;QACzC,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,WAAW;QACzC,QAAQ,EAAE,WAAW,CAAC,QAAQ;QAC9B,QAAQ,EAAE,WAAW,CAAC,QAAQ;QAC9B,QAAQ,EAAE,WAAW,CAAC,QAAQ;QAC9B,cAAc;QACd,SAAS;QACT,WAAW;KACZ,CAAA;AACH,CAAC","sourcesContent":["import type { DataDomain } from '../DataDomain.js'\nimport type { DomainNamespace } from '../DomainNamespace.js'\nimport type { DomainModel } from '../DomainModel.js'\nimport type { DomainEntity } from '../DomainEntity.js'\nimport type { DomainProperty } from '../DomainProperty.js'\nimport type { DomainAssociation } from '../DomainAssociation.js'\nimport type {\n AssociationInfo,\n DomainTemplate,\n DomainTemplateStructure,\n EntityInfo,\n ModelInfo,\n NamespaceInfo,\n PropertyInfo,\n} from './types.js'\n\n/**\n * Creates template metadata from a DataDomain instance for UI presentation\n */\nexport function createTemplateMetadata(\n domain: DataDomain,\n templateInfo: {\n id: string\n name: string\n description: string\n version: string\n author: string\n tags?: string[]\n createdAt: string\n updatedAt: string\n }\n): DomainTemplate {\n const structure = analyzeDomainStructure(domain)\n\n return {\n id: templateInfo.id,\n name: templateInfo.name,\n description: templateInfo.description,\n createdAt: templateInfo.createdAt,\n updatedAt: templateInfo.updatedAt,\n version: templateInfo.version,\n author: templateInfo.author,\n tags: templateInfo.tags || [],\n structure,\n }\n}\n\n/**\n * Analyzes a DataDomain to extract structural information for UI presentation\n */\nexport function analyzeDomainStructure(domain: DataDomain): DomainTemplateStructure {\n const namespaces: NamespaceInfo[] = []\n let totalEntities = 0\n let totalProperties = 0\n let totalAssociations = 0\n\n // Analyze each namespace\n for (const namespace of domain.listNamespaces()) {\n const namespaceInfo = analyzeNamespace(namespace)\n namespaces.push(namespaceInfo)\n\n totalEntities += namespaceInfo.entityCount\n totalProperties += namespaceInfo.models.reduce(\n (sum, model) => sum + model.entities.reduce((entitySum, entity) => entitySum + entity.propertyCount, 0),\n 0\n )\n totalAssociations += namespaceInfo.models.reduce(\n (sum, model) => sum + model.entities.reduce((entitySum, entity) => entitySum + entity.associationCount, 0),\n 0\n )\n }\n\n return {\n domain: {\n name: domain.info.name || 'Unnamed Domain',\n description: domain.info.description,\n totalEntities,\n totalProperties,\n totalAssociations,\n },\n namespaces,\n }\n}\n\n/**\n * Analyzes a DomainNamespace to extract information for UI presentation\n */\nfunction analyzeNamespace(namespace: DomainNamespace): NamespaceInfo {\n const models: ModelInfo[] = []\n let entityCount = 0\n\n // Analyze each model in the namespace\n for (const model of namespace.listModels()) {\n const modelInfo = analyzeModel(model)\n models.push(modelInfo)\n entityCount += modelInfo.entityCount\n }\n\n return {\n name: namespace.info.name || 'Unnamed Namespace',\n displayName: namespace.info.displayName,\n description: namespace.info.description,\n modelCount: models.length,\n entityCount,\n models,\n }\n}\n\n/**\n * Analyzes a DomainModel to extract information for UI presentation\n */\nfunction analyzeModel(model: DomainModel): ModelInfo {\n const entities: EntityInfo[] = []\n\n // Analyze each entity in the model\n for (const entity of model.listEntities()) {\n const entityInfo = analyzeEntity(entity)\n entities.push(entityInfo)\n }\n\n return {\n name: model.info.name || 'Unnamed Model',\n displayName: model.info.displayName,\n description: model.info.description,\n entityCount: entities.length,\n entities,\n }\n}\n\n/**\n * Analyzes a DomainEntity to extract information for UI presentation\n */\nfunction analyzeEntity(entity: DomainEntity): EntityInfo {\n const properties: PropertyInfo[] = []\n const associations: AssociationInfo[] = []\n\n // Analyze properties\n for (const property of entity.listProperties()) {\n properties.push(analyzeProperty(property))\n }\n\n // Analyze associations\n for (const association of entity.listAssociations()) {\n associations.push(analyzeAssociation(association))\n }\n\n return {\n name: entity.info.name || 'Unnamed Entity',\n displayName: entity.info.displayName,\n description: entity.info.description,\n propertyCount: properties.length,\n associationCount: associations.length,\n deprecated: entity.deprecated,\n properties,\n associations,\n semantics: entity.semantics?.map((s) => s.id) || [],\n }\n}\n\n/**\n * Analyzes a DomainProperty to extract information for UI presentation\n */\nfunction analyzeProperty(property: DomainProperty): PropertyInfo {\n const semantics = property.semantics?.map((s) => s.id) || []\n\n // Extract enum values if present\n let enumValues: string[] | undefined\n if (property.schema?.enum && Array.isArray(property.schema.enum)) {\n enumValues = property.schema.enum.map((v) => String(v))\n }\n\n // Extract default value\n let defaultValue: string | undefined\n if (property.schema?.defaultValue) {\n if (property.schema.defaultValue.type === 'literal') {\n defaultValue = String(property.schema.defaultValue.value)\n }\n }\n\n return {\n name: property.info.name || 'Unnamed Property',\n displayName: property.info.displayName,\n description: property.info.description,\n type: property.type || 'string',\n required: property.required,\n multiple: property.multiple,\n primary: property.primary,\n unique: property.unique,\n readOnly: property.readOnly,\n writeOnly: property.writeOnly,\n deprecated: property.deprecated,\n semantics,\n enumValues,\n defaultValue,\n }\n}\n\n/**\n * Analyzes a DomainAssociation to extract information for UI presentation\n */\nfunction analyzeAssociation(association: DomainAssociation): AssociationInfo {\n const semantics = association.semantics?.map((s) => s.id) || []\n\n // Get target entity names\n const targetEntities =\n association.targets?.map((target) => {\n // Try to resolve the target entity to get its name\n const targetEntity = association.domain.findEntity(target.key)\n return targetEntity?.info.name || target.key\n }) || []\n\n // Determine cardinality description\n let cardinality = 'One-to-One'\n if (association.multiple) {\n cardinality = 'One-to-Many'\n }\n // Note: Many-to-Many would typically be determined by looking at the reverse association\n // but for simplicity in UI presentation, we'll use the current association's multiplicity\n\n return {\n name: association.info.name || 'Unnamed Association',\n displayName: association.info.displayName,\n description: association.info.description,\n required: association.required,\n multiple: association.multiple,\n readOnly: association.readOnly,\n targetEntities,\n semantics,\n cardinality,\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ { "id": "blog-publishing-platform", "name": "Blog Publishing Platform", "description": "A comprehensive content management and publishing platform for blogs, magazines, and digital publications. Includes content management, user roles, publishing workflow, and social features.", "createdAt": "2025-07-27T21:14:57.328Z", "updatedAt": "2025-07-27T21:14:57.328Z", "version": "1.0.0", "author": "API Now! Core Team", "tags": ["blog", "cms", "publishing", "content", "media", "editorial"], "structure": { "domain": { "name": "Blog Publishing Platform", "description": "A comprehensive content management and publishing platform for blogs, magazines, and digital publications", "totalEntities": 8, "totalProperties": 68, "totalAssociations": 14 }, "namespaces": [{ "name": "ContentManagement", "displayName": "Content Management", "description": "Core content creation, editing, and organization features", "modelCount": 2, "entityCount": 4, "models": [{ "name": "Publications", "displayName": "Publications Management", "description": "Individual blogs, magazines, or publications within the platform", "entityCount": 1, "entities": [{ "name": "publication", "displayName": "Publication", "description": "Individual blog or publication site", "propertyCount": 8, "associationCount": 0, "properties": [{ "name": "id", "displayName": "Publication ID", "description": "Unique identifier for the publication", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "name", "displayName": "Publication Name", "description": "Display name of the publication", "type": "string", "semantics": ["Semantic#Title"] }, { "name": "slug", "displayName": "URL Slug", "description": "URL-friendly identifier for the publication", "type": "string", "required": true, "unique": true, "semantics": ["Semantic#PublicUniqueName"] }, { "name": "description", "displayName": "Description", "description": "Publication description and tagline", "type": "string", "semantics": ["Semantic#Description"] }, { "name": "domain", "displayName": "Custom Domain", "description": "Custom domain name for the publication", "type": "string", "semantics": [] }, { "name": "logo_url", "displayName": "Logo URL", "description": "URL to publication logo image", "type": "string", "semantics": ["Semantic#ImageURL"] }, { "name": "status", "displayName": "Publication Status", "description": "Current status of the publication", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["active", "suspended", "archived"], "defaultValue": "active" }, { "name": "created_at", "displayName": "Created At", "description": "When the publication was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [], "semantics": [] }] }, { "name": "Content", "displayName": "Content Management", "description": "Posts, pages, and other content types", "entityCount": 3, "entities": [{ "name": "category", "displayName": "Content Category", "description": "Content categorization for organization and navigation", "propertyCount": 5, "associationCount": 2, "properties": [{ "name": "id", "displayName": "Category ID", "description": "Unique identifier for the category", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "name", "displayName": "Category Name", "description": "Display name of the category", "type": "string", "semantics": ["Semantic#Title"] }, { "name": "slug", "displayName": "URL Slug", "description": "URL-friendly identifier for the category", "type": "string", "required": true, "unique": true, "semantics": ["Semantic#PublicUniqueName"] }, { "name": "description", "displayName": "Description", "description": "Category description", "type": "string", "semantics": ["Semantic#Description"] }, { "name": "color", "displayName": "Color", "description": "Theme color for the category", "type": "string", "semantics": [] }], "associations": [{ "name": "publication", "displayName": "Publication", "description": "Publication this category belongs to", "required": true, "multiple": false, "targetEntities": ["publication"], "semantics": [], "cardinality": "One-to-One" }, { "name": "parentCategory", "displayName": "Parent Category", "description": "Parent category for hierarchical organization", "required": false, "multiple": false, "targetEntities": ["category"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }, { "name": "Tag", "displayName": "Content Tag", "description": "Tags for flexible content labeling and discovery", "propertyCount": 3, "associationCount": 1, "properties": [{ "name": "id", "displayName": "Tag ID", "description": "Unique identifier for the tag", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "name", "displayName": "Tag Name", "description": "Display name of the tag", "type": "string", "semantics": ["Semantic#Title"] }, { "name": "slug", "displayName": "URL Slug", "description": "URL-friendly identifier for the tag", "type": "string", "required": true, "unique": true, "semantics": ["Semantic#PublicUniqueName"] }], "associations": [{ "name": "publication", "displayName": "Publication", "description": "Publication this tag belongs to", "required": true, "multiple": false, "targetEntities": ["publication"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }, { "name": "Post", "displayName": "Blog Post", "description": "Individual blog posts and articles", "propertyCount": 16, "associationCount": 4, "properties": [{ "name": "id", "displayName": "Post ID", "description": "Unique identifier for the post", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "title", "displayName": "Post Title", "description": "Title of the blog post", "type": "string", "required": true, "semantics": ["Semantic#Title"] }, { "name": "slug", "displayName": "URL Slug", "description": "URL-friendly identifier for the post", "type": "string", "required": true, "unique": true, "semantics": ["Semantic#PublicUniqueName"] }, { "name": "excerpt", "displayName": "Excerpt", "description": "Brief summary or excerpt of the post", "type": "string", "semantics": ["Semantic#Summary"] }, { "name": "content", "displayName": "Content", "description": "Full content of the post in HTML or Markdown", "type": "string", "required": true, "semantics": ["Semantic#HTML"] }, { "name": "content_format", "displayName": "Content Format", "description": "Format of the content (HTML, Markdown, etc.)", "type": "string", "required": true, "semantics": [], "enumValues": ["html", "markdown", "richtext"], "defaultValue": "markdown" }, { "name": "featured_image_url", "displayName": "Featured Image URL", "description": "URL to featured image", "type": "string", "semantics": ["Semantic#ImageURL"] }, { "name": "status", "displayName": "Post Status", "description": "Current publishing status of the post", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["draft", "pending_review", "scheduled", "published", "archived"], "defaultValue": "draft" }, { "name": "published_at", "displayName": "Published At", "description": "When the post was published", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }, { "name": "scheduled_at", "displayName": "Scheduled At", "description": "When the post is scheduled to be published", "type": "datetime", "semantics": [] }, { "name": "view_count", "displayName": "View Count", "description": "Number of times the post has been viewed", "type": "number", "required": true, "semantics": [] }, { "name": "reading_time", "displayName": "Reading Time", "description": "Estimated reading time in minutes", "type": "number", "readOnly": true, "semantics": ["Semantic#Calculated"] }, { "name": "word_count", "displayName": "Word Count", "description": "Number of words in the post content", "type": "number", "readOnly": true, "semantics": ["Semantic#Calculated"] }, { "name": "meta_title", "displayName": "Meta Title", "description": "SEO meta title", "type": "string", "semantics": [] }, { "name": "meta_description", "displayName": "Meta Description", "description": "SEO meta description", "type": "string", "semantics": [] }, { "name": "updated_at", "displayName": "Updated At", "description": "When the post was last updated", "type": "datetime", "readOnly": true, "semantics": ["Semantic#UpdatedTimestamp"] }], "associations": [{ "name": "publication", "displayName": "Publication", "description": "Publication this post belongs to", "required": true, "multiple": false, "targetEntities": ["publication"], "semantics": [], "cardinality": "One-to-One" }, { "name": "categories", "displayName": "Post Categories", "description": "Categories this post belongs to", "required": false, "multiple": true, "targetEntities": ["category"], "semantics": ["Semantic#Categories"], "cardinality": "One-to-Many" }, { "name": "tags", "displayName": "Post Tags", "description": "Tags associated with this post", "required": false, "multiple": true, "targetEntities": ["Tag"], "semantics": ["Semantic#Tags"], "cardinality": "One-to-Many" }, { "name": "author", "displayName": "Post Author", "description": "Author who wrote this post", "required": true, "multiple": false, "targetEntities": ["user"], "semantics": ["Semantic#ResourceOwnerIdentifier"], "cardinality": "One-to-One" }], "semantics": [] }] }] }, { "name": "UserManagement", "displayName": "User Management", "description": "Authors, editors, subscribers, and user roles management", "modelCount": 1, "entityCount": 1, "models": [{ "name": "Users", "displayName": "User Management", "description": "User accounts and authentication", "entityCount": 1, "entities": [{ "name": "user", "displayName": "User Account", "description": "User account for authors, editors, and subscribers", "propertyCount": 13, "associationCount": 0, "properties": [{ "name": "id", "displayName": "User ID", "description": "Unique identifier for the user", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "email", "displayName": "Email Address", "description": "User email address for login and communication", "type": "string", "required": true, "semantics": ["Semantic#Email"] }, { "name": "password", "displayName": "Password", "description": "Encrypted password for authentication", "type": "string", "required": true, "semantics": ["Semantic#Password"] }, { "name": "username", "displayName": "Username", "description": "Unique username for the user", "type": "string", "required": true, "unique": true, "semantics": ["Semantic#PublicUniqueName"] }, { "name": "display_name", "displayName": "Display Name", "description": "Public display name for the user", "type": "string", "required": true, "semantics": [] }, { "name": "first_name", "displayName": "First Name", "description": "User first name", "type": "string", "semantics": [] }, { "name": "last_name", "displayName": "Last Name", "description": "User last name", "type": "string", "semantics": [] }, { "name": "bio", "displayName": "Biography", "description": "User biography and description", "type": "string", "semantics": ["Semantic#Description"] }, { "name": "avatar_url", "displayName": "Avatar URL", "description": "URL to user profile picture", "type": "string", "semantics": ["Semantic#ImageURL"] }, { "name": "website", "displayName": "Website", "description": "User personal website URL", "type": "string", "semantics": ["Semantic#URL"] }, { "name": "role", "displayName": "User Role", "description": "User role for permission management", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["subscriber", "author", "editor", "admin", "super_admin"], "defaultValue": "subscriber" }, { "name": "emailVerified", "displayName": "Email Verified", "description": "Whether the user has verified their email", "type": "boolean", "required": true, "semantics": [], "defaultValue": "false" }, { "name": "created_at", "displayName": "Created At", "description": "When the user account was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [], "semantics": ["Semantic#User"] }] }] }, { "name": "SocialFeatures", "displayName": "Social Features", "description": "Comments, likes, shares, and social interactions", "modelCount": 1, "entityCount": 1, "models": [{ "name": "Comments", "displayName": "Comment System", "description": "Post comments and replies", "entityCount": 1, "entities": [{ "name": "comment", "displayName": "Comment", "description": "User comments on posts", "propertyCount": 7, "associationCount": 3, "properties": [{ "name": "id", "displayName": "Comment ID", "description": "Unique identifier for the comment", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "content", "displayName": "Comment Content", "description": "Content of the comment", "type": "string", "required": true, "semantics": [] }, { "name": "author_name", "displayName": "Author Name", "description": "Name of the comment author (for guest comments)", "type": "string", "semantics": [] }, { "name": "author_email", "displayName": "Author Email", "description": "Email of the comment author (for guest comments)", "type": "string", "required": true, "semantics": ["Semantic#Email"] }, { "name": "status", "displayName": "Comment Status", "description": "Moderation status of the comment", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["pending", "approved", "rejected", "spam"], "defaultValue": "pending" }, { "name": "user_agent", "displayName": "User Agent", "description": "Browser user agent string", "type": "string", "semantics": [] }, { "name": "created_at", "displayName": "Created At", "description": "When the comment was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [{ "name": "post", "displayName": "Post", "description": "Post this comment belongs to", "required": true, "multiple": false, "targetEntities": ["Post"], "semantics": [], "cardinality": "One-to-One" }, { "name": "author", "displayName": "Comment Author", "description": "Registered user who wrote this comment", "required": false, "multiple": false, "targetEntities": ["user"], "semantics": ["Semantic#ResourceOwnerIdentifier"], "cardinality": "One-to-One" }, { "name": "parent_comment", "displayName": "Parent Comment", "description": "Parent comment for replies", "required": false, "multiple": false, "targetEntities": ["comment"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }] }] }, { "name": "Analytics", "displayName": "Analytics & Tracking", "description": "Analytics, metrics, and performance tracking", "modelCount": 1, "entityCount": 1, "models": [{ "name": "Analytics", "displayName": "Content Analytics", "description": "Content performance and user engagement metrics", "entityCount": 1, "entities": [{ "name": "page_view", "displayName": "Page View", "description": "Individual page view tracking record", "propertyCount": 6, "associationCount": 2, "properties": [{ "name": "id", "displayName": "Page View ID", "description": "Unique identifier for the page view", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "path", "displayName": "Page Path", "description": "URL path of the viewed page", "type": "string", "required": true, "semantics": [] }, { "name": "referrer", "displayName": "Referrer", "description": "Referring URL", "type": "string", "semantics": ["Semantic#URL"] }, { "name": "user_agent", "displayName": "User Agent", "description": "Browser user agent string", "type": "string", "semantics": [] }, { "name": "session_id", "displayName": "Session ID", "description": "Visitor session identifier", "type": "string", "semantics": [] }, { "name": "viewed_at", "displayName": "Viewed At", "description": "When the page was viewed", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [{ "name": "post", "displayName": "Viewed Post", "description": "Post that was viewed (if applicable)", "required": false, "multiple": false, "targetEntities": ["Post"], "semantics": [], "cardinality": "One-to-One" }, { "name": "publication", "displayName": "Publication", "description": "Publication this page view belongs to", "required": true, "multiple": false, "targetEntities": ["publication"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }] }] }, { "name": "MediaManagement", "displayName": "Media Management", "description": "Image, video, and file upload management", "modelCount": 1, "entityCount": 1, "models": [{ "name": "Media", "displayName": "Media Library", "description": "Uploaded files, images, and media assets", "entityCount": 1, "entities": [{ "name": "media_file", "displayName": "Media File", "description": "Uploaded media files (images, videos, documents)", "propertyCount": 10, "associationCount": 2, "properties": [{ "name": "id", "displayName": "Media File ID", "description": "Unique identifier for the media file", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "filename", "displayName": "File Name", "description": "Original filename of the uploaded file", "type": "string", "required": true, "semantics": [] }, { "name": "storage_key", "displayName": "Storage Key", "description": "Unique storage key for the file", "type": "string", "required": true, "unique": true, "semantics": [] }, { "name": "url", "displayName": "File URL", "description": "Public URL to access the file", "type": "string", "required": true, "semantics": ["Semantic#URL"] }, { "name": "mime_type", "displayName": "MIME Type", "description": "MIME type of the file", "type": "string", "required": true, "semantics": [] }, { "name": "file_size", "displayName": "File Size", "description": "File size in bytes", "type": "number", "required": true, "semantics": [] }, { "name": "width", "displayName": "Image Width", "description": "Width in pixels (for images)", "type": "number", "required": true, "semantics": [] }, { "name": "height", "displayName": "Image Height", "description": "Height in pixels (for images)", "type": "number", "required": true, "semantics": [] }, { "name": "alt_text", "displayName": "Alt Text", "description": "Alternative text for accessibility", "type": "string", "semantics": [] }, { "name": "uploaded_at", "displayName": "Uploaded At", "description": "When the file was uploaded", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [{ "name": "uploader", "displayName": "File Uploader", "description": "User who uploaded this file", "required": true, "multiple": false, "targetEntities": ["user"], "semantics": ["Semantic#ResourceOwnerIdentifier"], "cardinality": "One-to-One" }, { "name": "publication", "displayName": "Publication", "description": "Publication this media file belongs to", "required": true, "multiple": false, "targetEntities": ["publication"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }] }] }] } }
@@ -0,0 +1 @@
1
+ { "id": "ecommerce-platform", "name": "E-Commerce Platform", "description": "A comprehensive e-commerce platform with user management, product catalog, inventory, and order processing capabilities. Perfect for online stores, marketplaces, and retail businesses.", "createdAt": "2025-07-27T21:14:57.328Z", "updatedAt": "2025-07-27T21:14:57.328Z", "version": "1.0.0", "author": "API Now! Core Team", "tags": ["e-commerce", "retail", "shopping", "business", "inventory", "orders"], "structure": { "domain": { "name": "E-Commerce Platform", "description": "A comprehensive e-commerce platform with user management, product catalog, and order processing capabilities", "totalEntities": 11, "totalProperties": 73, "totalAssociations": 14 }, "namespaces": [{ "name": "UserManagement", "displayName": "User Management", "description": "Handles user authentication, authorization, and profile management", "modelCount": 2, "entityCount": 3, "models": [{ "name": "Authentication", "displayName": "User Authentication", "description": "User accounts and authentication data", "entityCount": 1, "entities": [{ "name": "User", "displayName": "User Account", "description": "Represents a user account in the system", "propertyCount": 9, "associationCount": 2, "properties": [{ "name": "id", "displayName": "User ID", "description": "Unique identifier for the user", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "email", "displayName": "Email Address", "description": "User email address for login and communication", "type": "string", "required": true, "semantics": ["Semantic#Email"] }, { "name": "password", "displayName": "Password", "description": "User password for authentication", "type": "string", "required": true, "semantics": ["Semantic#Password"] }, { "name": "first_name", "displayName": "First Name", "description": "User first name", "type": "string", "required": true, "semantics": [] }, { "name": "last_name", "displayName": "Last Name", "description": "User last name", "type": "string", "required": true, "semantics": [] }, { "name": "role", "displayName": "User Role", "description": "User role for permission management", "type": "string", "required": true, "semantics": ["Semantic#UserRole"], "enumValues": ["customer", "admin", "moderator"], "defaultValue": "customer" }, { "name": "email_verified", "displayName": "Email Verified", "description": "Whether the user has verified their email address", "type": "boolean", "required": true, "semantics": [], "defaultValue": "false" }, { "name": "created_at", "displayName": "Created At", "description": "When the user account was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }, { "name": "updated_at", "displayName": "Updated At", "description": "When the user account was last updated", "type": "datetime", "readOnly": true, "semantics": ["Semantic#UpdatedTimestamp"] }], "associations": [{ "name": "profile", "displayName": "User Profile", "description": "Link to extended profile information", "required": false, "multiple": false, "targetEntities": ["user_profile"], "semantics": [], "cardinality": "One-to-One" }, { "name": "addresses", "displayName": "User Addresses", "description": "User shipping and billing addresses", "required": false, "multiple": true, "targetEntities": ["address"], "semantics": [], "cardinality": "One-to-Many" }], "semantics": ["Semantic#User"] }] }, { "name": "UserProfile", "displayName": "User Profile", "description": "Extended user profile information", "entityCount": 2, "entities": [{ "name": "user_profile", "displayName": "User Profile", "description": "Extended profile information for users", "propertyCount": 4, "associationCount": 0, "properties": [{ "name": "id", "displayName": "Profile ID", "description": "Unique identifier for the profile", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "birthdate", "displayName": "Date of Birth", "description": "User date of birth", "type": "date", "semantics": [] }, { "name": "phone", "displayName": "Phone Number", "description": "User phone number", "type": "string", "semantics": ["Semantic#Phone"] }, { "name": "avatar_url", "displayName": "Avatar URL", "description": "URL to user profile picture", "type": "string", "semantics": ["Semantic#ImageURL"] }], "associations": [], "semantics": [] }, { "name": "address", "displayName": "Address", "description": "Physical address information", "propertyCount": 9, "associationCount": 0, "properties": [{ "name": "id", "displayName": "Address ID", "description": "Unique identifier for the address", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "type", "displayName": "Address Type", "description": "Type of address (shipping, billing, etc.)", "type": "string", "required": true, "semantics": [], "enumValues": ["shipping", "billing", "both"] }, { "name": "line1", "displayName": "Address Line 1", "description": "Primary street address, including house number and street name", "type": "string", "required": true, "semantics": [] }, { "name": "line2", "displayName": "Address Line 2", "description": "Optional field for additional street-level information like apartment numbers or building names.", "type": "string", "required": false, "semantics": [] }, { "name": "line3", "displayName": "Address Line 3", "description": "Optional field for additional street-level information like apartment numbers or building names.", "type": "string", "required": false, "semantics": [] }, { "name": "city", "displayName": "City", "description": "City name", "type": "string", "required": true, "semantics": [] }, { "name": "state", "displayName": "State/Province", "description": "State or province", "type": "string", "required": true, "semantics": [] }, { "name": "postal_code", "displayName": "ZIP/Postal Code", "description": "ZIP or postal code", "type": "string", "required": true, "semantics": [] }, { "name": "country", "displayName": "Country", "description": "Country name", "type": "string", "required": true, "semantics": [] }], "associations": [], "semantics": [] }] }] }, { "name": "ProductCatalog", "displayName": "Product Catalog", "description": "Product information, categories, and inventory management", "modelCount": 2, "entityCount": 3, "models": [{ "name": "Products", "displayName": "Product Management", "description": "Core product entities and relationships", "entityCount": 2, "entities": [{ "name": "category", "displayName": "Product Category", "description": "Product categorization for organization and navigation", "propertyCount": 4, "associationCount": 1, "properties": [{ "name": "id", "displayName": "Category ID", "description": "Unique identifier for the category", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "name", "displayName": "Category Name", "description": "Display name of the category", "type": "string", "semantics": ["Semantic#Title"] }, { "name": "slug", "displayName": "URL Slug", "description": "URL-friendly identifier for the category", "type": "string", "required": true, "unique": true, "semantics": ["Semantic#PublicUniqueName"] }, { "name": "description", "displayName": "Description", "description": "Category description", "type": "string", "semantics": ["Semantic#Description"] }], "associations": [{ "name": "parent_category", "displayName": "Parent Category", "description": "Parent category for hierarchical organization", "required": false, "multiple": false, "targetEntities": ["category"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }, { "name": "product", "displayName": "Product", "description": "Core product information and specifications", "propertyCount": 13, "associationCount": 2, "properties": [{ "name": "id", "displayName": "Product ID", "description": "Unique identifier for the product", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "name", "displayName": "Product Name", "description": "Display name of the product", "type": "string", "semantics": ["Semantic#Title"] }, { "name": "slug", "displayName": "URL Slug", "description": "URL-friendly identifier for the product", "type": "string", "required": true, "unique": true, "semantics": ["Semantic#PublicUniqueName"] }, { "name": "description", "displayName": "Description", "description": "Detailed product description", "type": "string", "semantics": ["Semantic#Description"] }, { "name": "short_description", "displayName": "Short Description", "description": "Brief product summary", "type": "string", "semantics": ["Semantic#Summary"] }, { "name": "sku", "displayName": "SKU", "description": "Stock Keeping Unit - unique product identifier", "type": "string", "required": true, "unique": true, "semantics": ["Semantic#SKU"] }, { "name": "price", "displayName": "Price", "description": "Product price in cents (USD)", "type": "number", "required": true, "semantics": ["Semantic#Currency"] }, { "name": "compare_at_price", "displayName": "Compare at Price", "description": "Original price for discount display", "type": "number", "semantics": ["Semantic#Currency"] }, { "name": "status", "displayName": "Status", "description": "Current status of the product", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["inactive", "active", "pending", "archived"], "defaultValue": "inactive" }, { "name": "weight", "displayName": "Weight", "description": "Product weight in grams", "type": "number", "semantics": [] }, { "name": "images", "displayName": "Images", "description": "Array of product image URLs", "type": "string", "multiple": true, "semantics": ["Semantic#ImageURL"] }, { "name": "created_at", "displayName": "Created At", "description": "When the product was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }, { "name": "updated_at", "displayName": "Updated At", "description": "When the product was last updated", "type": "datetime", "readOnly": true, "semantics": ["Semantic#UpdatedTimestamp"] }], "associations": [{ "name": "categories", "displayName": "Product Categories", "description": "Categories this product belongs to", "required": true, "multiple": true, "targetEntities": ["category"], "semantics": ["Semantic#Categories"], "cardinality": "One-to-Many" }, { "name": "inventory", "displayName": "Product Inventory", "description": "Inventory information for this product", "required": true, "multiple": false, "targetEntities": ["inventory"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }] }, { "name": "Inventory", "displayName": "Inventory Management", "description": "Stock levels and inventory tracking", "entityCount": 1, "entities": [{ "name": "inventory", "displayName": "Inventory", "description": "Stock levels and inventory information for products", "propertyCount": 4, "associationCount": 0, "properties": [{ "name": "id", "displayName": "Inventory ID", "description": "Unique identifier for the inventory record", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "quantity", "displayName": "Stock Quantity", "description": "Available stock quantity", "type": "number", "required": true, "semantics": [], "defaultValue": "0" }, { "name": "trackQuantity", "displayName": "Track Quantity", "description": "Whether to track inventory for this product", "type": "boolean", "required": true, "semantics": [], "defaultValue": "true" }, { "name": "allowBackorder", "displayName": "Allow Backorder", "description": "Whether to allow ordering when out of stock", "type": "boolean", "required": true, "semantics": [], "defaultValue": "false" }], "associations": [], "semantics": [] }] }] }, { "name": "OrderManagement", "displayName": "Order Management", "description": "Shopping cart, orders, and payment processing", "modelCount": 3, "entityCount": 5, "models": [{ "name": "ShoppingCart", "displayName": "Shopping Cart", "description": "Shopping cart and cart items", "entityCount": 2, "entities": [{ "name": "cart", "displayName": "Shopping Cart", "description": "User shopping cart", "propertyCount": 5, "associationCount": 2, "properties": [{ "name": "id", "displayName": "Cart ID", "description": "Unique identifier for the cart", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "sessionId", "displayName": "Session ID", "description": "Session identifier for guest carts", "type": "string", "semantics": [] }, { "name": "expiresAt", "displayName": "Expires At", "description": "When the cart expires for cleanup", "type": "datetime", "semantics": [] }, { "name": "created_at", "displayName": "Created At", "description": "When the cart was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }, { "name": "updated_at", "displayName": "Updated At", "description": "When the cart was last updated", "type": "datetime", "readOnly": true, "semantics": ["Semantic#UpdatedTimestamp"] }], "associations": [{ "name": "user", "displayName": "Cart Owner", "description": "User who owns this cart", "required": false, "multiple": false, "targetEntities": ["User"], "semantics": ["Semantic#ResourceOwnerIdentifier"], "cardinality": "One-to-One" }, { "name": "items", "displayName": "Cart Items", "description": "Items in this cart", "required": false, "multiple": true, "targetEntities": ["cart_item"], "semantics": [], "cardinality": "One-to-Many" }], "semantics": [] }, { "name": "cart_item", "displayName": "Cart Item", "description": "Individual items in a shopping cart", "propertyCount": 4, "associationCount": 1, "properties": [{ "name": "id", "displayName": "Cart Item ID", "description": "Unique identifier for the cart item", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "quantity", "displayName": "Quantity", "description": "Number of items", "type": "number", "required": true, "semantics": [] }, { "name": "unitPrice", "displayName": "Unit Price", "description": "Price per unit at time of adding to cart", "type": "number", "required": true, "semantics": ["Semantic#Currency"] }, { "name": "total_price", "displayName": "Total Price", "description": "Total price for this line item", "type": "number", "required": true, "readOnly": true, "semantics": ["Semantic#Currency", "Semantic#Calculated"] }], "associations": [{ "name": "product", "displayName": "Product", "description": "Product for this cart item", "required": true, "multiple": false, "targetEntities": ["product"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }] }, { "name": "Orders", "displayName": "Order Processing", "description": "Orders and order fulfillment", "entityCount": 2, "entities": [{ "name": "order", "displayName": "Order", "description": "Customer order", "propertyCount": 10, "associationCount": 5, "properties": [{ "name": "id", "displayName": "Order ID", "description": "Unique identifier for the order", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "order_number", "displayName": "Order Number", "description": "Human-readable order number", "type": "string", "required": true, "unique": true, "semantics": [] }, { "name": "status", "displayName": "Order Status", "description": "Current status of the order", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["pending", "confirmed", "processing", "shipped", "delivered", "cancelled", "refunded"], "defaultValue": "pending" }, { "name": "subtotal", "displayName": "Subtotal", "description": "Order subtotal before taxes and shipping", "type": "number", "required": true, "semantics": ["Semantic#Currency"] }, { "name": "taxAmount", "displayName": "Tax Amount", "description": "Total tax amount", "type": "number", "required": true, "semantics": ["Semantic#Currency"] }, { "name": "shippingAmount", "displayName": "Shipping Amount", "description": "Shipping cost", "type": "number", "required": true, "semantics": ["Semantic#Currency"] }, { "name": "total_amount", "displayName": "Total Amount", "description": "Final order total", "type": "number", "required": true, "semantics": ["Semantic#Currency", "Semantic#Calculated"] }, { "name": "notes", "displayName": "Order Notes", "description": "Customer notes or special instructions", "type": "string", "semantics": [] }, { "name": "created_at", "displayName": "Created At", "description": "When the order was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }, { "name": "updated_at", "displayName": "Updated At", "description": "When the order was last updated", "type": "datetime", "readOnly": true, "semantics": ["Semantic#UpdatedTimestamp"] }], "associations": [{ "name": "customer", "displayName": "Customer", "description": "Customer who placed this order", "required": true, "multiple": false, "targetEntities": ["User"], "semantics": ["Semantic#ResourceOwnerIdentifier"], "cardinality": "One-to-One" }, { "name": "shipping_address", "displayName": "Shipping Address", "description": "Address for order delivery", "required": true, "multiple": false, "targetEntities": ["address"], "semantics": [], "cardinality": "One-to-One" }, { "name": "billing_address", "displayName": "Billing Address", "description": "Address for billing purposes", "required": true, "multiple": false, "targetEntities": ["address"], "semantics": [], "cardinality": "One-to-One" }, { "name": "items", "displayName": "Order Items", "description": "Items in this order", "required": true, "multiple": true, "targetEntities": ["order_item"], "semantics": [], "cardinality": "One-to-Many" }, { "name": "payments", "displayName": "Order Payments", "description": "Payment transactions for this order", "required": false, "multiple": true, "targetEntities": ["payment"], "semantics": [], "cardinality": "One-to-Many" }], "semantics": [] }, { "name": "order_item", "displayName": "Order Line Item", "description": "Individual line items in an order", "propertyCount": 4, "associationCount": 1, "properties": [{ "name": "id", "displayName": "Order Item ID", "description": "Unique identifier for the order item", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "quantity", "displayName": "Quantity", "description": "Number of items ordered", "type": "number", "required": true, "semantics": [] }, { "name": "unitPrice", "displayName": "Unit Price", "description": "Price per unit at time of order", "type": "number", "required": true, "semantics": ["Semantic#Currency"] }, { "name": "total_price", "displayName": "Total Price", "description": "Total price for this line item", "type": "number", "required": true, "readOnly": true, "semantics": ["Semantic#Currency", "Semantic#Calculated"] }], "associations": [{ "name": "product", "displayName": "Product", "description": "Product for this order item", "required": true, "multiple": false, "targetEntities": ["product"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }] }, { "name": "Payments", "displayName": "Payment Processing", "description": "Payment methods and transactions", "entityCount": 1, "entities": [{ "name": "payment", "displayName": "Payment", "description": "Payment transaction record", "propertyCount": 7, "associationCount": 0, "properties": [{ "name": "id", "displayName": "Payment ID", "description": "Unique identifier for the payment", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "method", "displayName": "Payment Method", "description": "Method used for payment", "type": "string", "required": true, "semantics": [], "enumValues": ["credit_card", "debit_card", "paypal", "bank_transfer", "apple_pay", "google_pay"] }, { "name": "status", "displayName": "Payment Status", "description": "Current status of the payment", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["pending", "authorized", "captured", "failed", "cancelled", "refunded"], "defaultValue": "pending" }, { "name": "amount", "displayName": "Payment Amount", "description": "Amount charged", "type": "number", "required": true, "semantics": ["Semantic#Currency"] }, { "name": "currency", "displayName": "Currency", "description": "Currency code for the payment", "type": "string", "required": true, "semantics": [], "defaultValue": "USD" }, { "name": "transaction_id", "displayName": "Transaction ID", "description": "External payment processor transaction ID", "type": "string", "semantics": [] }, { "name": "created_at", "displayName": "Created At", "description": "When the payment was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [], "semantics": [] }] }] }] } }
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Auto-generated template registry index
3
+ * Generated on: 2025-07-27T21:25:00.112Z
4
+ *
5
+ * This file is auto-generated by scripts/generate-template-metadata.js
6
+ * Do not edit manually - your changes will be overwritten.
7
+ */
8
+ import type { DomainTemplate } from '../types.js';
9
+ /**
10
+ * Registry of all available template metadata
11
+ */
12
+ export declare const TEMPLATE_METADATA_REGISTRY: Record<string, DomainTemplate>;
13
+ /**
14
+ * Array of all template IDs for iteration
15
+ */
16
+ export declare const TEMPLATE_IDS: readonly ["ecommerce-platform", "blog-publishing-platform"];
17
+ /**
18
+ * Template categories for filtering
19
+ */
20
+ export declare const TEMPLATE_CATEGORIES: {
21
+ readonly business: readonly ["e-commerce", "retail", "business", "inventory", "orders", "crm", "finance"];
22
+ readonly content: readonly ["blog", "cms", "publishing", "content", "media", "editorial"];
23
+ readonly social: readonly ["social", "community", "networking", "communication"];
24
+ readonly technical: readonly ["api", "service", "microservice", "system", "integration"];
25
+ };
26
+ /**
27
+ * Get all templates
28
+ */
29
+ export declare function getAllTemplates(): DomainTemplate[];
30
+ /**
31
+ * Get template by ID
32
+ */
33
+ export declare function getTemplate(id: string): DomainTemplate | undefined;
34
+ /**
35
+ * Get templates by tag
36
+ */
37
+ export declare function getTemplatesByTag(tag: string): DomainTemplate[];
38
+ /**
39
+ * Get templates by category
40
+ */
41
+ export declare function getTemplatesByCategory(category: keyof typeof TEMPLATE_CATEGORIES): DomainTemplate[];
42
+ /**
43
+ * Search templates
44
+ */
45
+ export declare function searchTemplates(query: string): DomainTemplate[];
46
+ /**
47
+ * Get template statistics
48
+ */
49
+ export declare function getTemplateStats(): {
50
+ totalTemplates: number;
51
+ totalEntities: number;
52
+ totalProperties: number;
53
+ totalAssociations: number;
54
+ categoryCounts: Record<string, number>;
55
+ };
56
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modeling/templates/meta/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAMjD;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAG5D,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,YAAY,6DAGf,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;CAKtB,CAAA;AAEV;;GAEG;AACH,wBAAgB,eAAe,IAAI,cAAc,EAAE,CAElD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAElE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,EAAE,CAE/D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,OAAO,mBAAmB,GAAG,cAAc,EAAE,CAKnG;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,EAAE,CAQ/D;AAED;;GAEG;AACH,wBAAgB,gBAAgB;;;;;;EAqB/B"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Auto-generated template registry index
3
+ * Generated on: 2025-07-27T21:25:00.112Z
4
+ *
5
+ * This file is auto-generated by scripts/generate-template-metadata.js
6
+ * Do not edit manually - your changes will be overwritten.
7
+ */
8
+ // Template metadata imports
9
+ import ecommercePlatformMetadata from './ecommerce-platform.json' with { type: 'json' };
10
+ import blogPublishingPlatformMetadata from './blog-publishing-platform.json' with { type: 'json' };
11
+ /**
12
+ * Registry of all available template metadata
13
+ */
14
+ export const TEMPLATE_METADATA_REGISTRY = {
15
+ 'ecommerce-platform': ecommercePlatformMetadata,
16
+ 'blog-publishing-platform': blogPublishingPlatformMetadata,
17
+ };
18
+ /**
19
+ * Array of all template IDs for iteration
20
+ */
21
+ export const TEMPLATE_IDS = [
22
+ 'ecommerce-platform',
23
+ 'blog-publishing-platform',
24
+ ];
25
+ /**
26
+ * Template categories for filtering
27
+ */
28
+ export const TEMPLATE_CATEGORIES = {
29
+ business: ['e-commerce', 'retail', 'business', 'inventory', 'orders', 'crm', 'finance'],
30
+ content: ['blog', 'cms', 'publishing', 'content', 'media', 'editorial'],
31
+ social: ['social', 'community', 'networking', 'communication'],
32
+ technical: ['api', 'service', 'microservice', 'system', 'integration'],
33
+ };
34
+ /**
35
+ * Get all templates
36
+ */
37
+ export function getAllTemplates() {
38
+ return Object.values(TEMPLATE_METADATA_REGISTRY);
39
+ }
40
+ /**
41
+ * Get template by ID
42
+ */
43
+ export function getTemplate(id) {
44
+ return TEMPLATE_METADATA_REGISTRY[id];
45
+ }
46
+ /**
47
+ * Get templates by tag
48
+ */
49
+ export function getTemplatesByTag(tag) {
50
+ return getAllTemplates().filter((template) => template.tags.includes(tag.toLowerCase()));
51
+ }
52
+ /**
53
+ * Get templates by category
54
+ */
55
+ export function getTemplatesByCategory(category) {
56
+ const categoryTags = TEMPLATE_CATEGORIES[category] || [];
57
+ return getAllTemplates().filter((template) => template.tags.some((tag) => categoryTags.includes(tag)));
58
+ }
59
+ /**
60
+ * Search templates
61
+ */
62
+ export function searchTemplates(query) {
63
+ const searchTerm = query.toLowerCase();
64
+ return getAllTemplates().filter((template) => template.name.toLowerCase().includes(searchTerm) ||
65
+ template.description.toLowerCase().includes(searchTerm) ||
66
+ template.tags.some((tag) => tag.includes(searchTerm)));
67
+ }
68
+ /**
69
+ * Get template statistics
70
+ */
71
+ export function getTemplateStats() {
72
+ const templates = getAllTemplates();
73
+ const totalEntities = templates.reduce((sum, t) => sum + t.structure.domain.totalEntities, 0);
74
+ const totalProperties = templates.reduce((sum, t) => sum + t.structure.domain.totalProperties, 0);
75
+ const totalAssociations = templates.reduce((sum, t) => sum + t.structure.domain.totalAssociations, 0);
76
+ const categoryCounts = {};
77
+ templates.forEach((template) => {
78
+ template.tags.forEach((tag) => {
79
+ categoryCounts[tag] = (categoryCounts[tag] || 0) + 1;
80
+ });
81
+ });
82
+ return {
83
+ totalTemplates: templates.length,
84
+ totalEntities,
85
+ totalProperties,
86
+ totalAssociations,
87
+ categoryCounts,
88
+ };
89
+ }
90
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modeling/templates/meta/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,4BAA4B;AAC5B,OAAO,yBAAyB,MAAM,2BAA2B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACvF,OAAO,8BAA8B,MAAM,iCAAiC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAElG;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAmC;IACxE,oBAAoB,EAAE,yBAA2C;IACjE,0BAA0B,EAAE,8BAAgD;CACpE,CAAA;AAEV;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,oBAAoB;IACpB,0BAA0B;CAClB,CAAA;AAEV;;GA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AI,CAAC,CAAC,GAAG,CAAC,CAAA;QACtD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,OAAO;QACL,cAAc,EAAE,SAAS,CAAC,MAAM;QAChC,aAAa;QACb,eAAe;QACf,iBAAiB;QACjB,cAAc;KACf,CAAA;AACH,CAAC","sourcesContent":["/**\n * Auto-generated template registry index\n * Generated on: 2025-07-27T21:25:00.112Z\n *\n * This file is auto-generated by scripts/generate-template-metadata.js\n * Do not edit manually - your changes will be overwritten.\n */\n\nimport type { DomainTemplate } from '../types.js'\n\n// Template metadata imports\nimport ecommercePlatformMetadata from './ecommerce-platform.json' with { type: 'json' }\nimport blogPublishingPlatformMetadata from './blog-publishing-platform.json' with { type: 'json' }\n\n/**\n * Registry of all available template metadata\n */\nexport const TEMPLATE_METADATA_REGISTRY: Record<string, DomainTemplate> = {\n 'ecommerce-platform': ecommercePlatformMetadata as DomainTemplate,\n 'blog-publishing-platform': blogPublishingPlatformMetadata as DomainTemplate,\n} as const\n\n/**\n * Array of all template IDs for iteration\n */\nexport const TEMPLATE_IDS = [\n 'ecommerce-platform',\n 'blog-publishing-platform',\n] as const\n\n/**\n * Template categories for filtering\n */\nexport const TEMPLATE_CATEGORIES = {\n business: ['e-commerce', 'retail', 'business', 'inventory', 'orders', 'crm', 'finance'],\n content: ['blog', 'cms', 'publishing', 'content', 'media', 'editorial'],\n social: ['social', 'community', 'networking', 'communication'],\n technical: ['api', 'service', 'microservice', 'system', 'integration'],\n} as const\n\n/**\n * Get all templates\n */\nexport function getAllTemplates(): DomainTemplate[] {\n return Object.values(TEMPLATE_METADATA_REGISTRY)\n}\n\n/**\n * Get template by ID\n */\nexport function getTemplate(id: string): DomainTemplate | undefined {\n return TEMPLATE_METADATA_REGISTRY[id]\n}\n\n/**\n * Get templates by tag\n */\nexport function getTemplatesByTag(tag: string): DomainTemplate[] {\n return getAllTemplates().filter((template) => template.tags.includes(tag.toLowerCase()))\n}\n\n/**\n * Get templates by category\n */\nexport function getTemplatesByCategory(category: keyof typeof TEMPLATE_CATEGORIES): DomainTemplate[] {\n const categoryTags = TEMPLATE_CATEGORIES[category] || []\n return getAllTemplates().filter((template) =>\n template.tags.some((tag) => (categoryTags as readonly string[]).includes(tag))\n )\n}\n\n/**\n * Search templates\n */\nexport function searchTemplates(query: string): DomainTemplate[] {\n const searchTerm = query.toLowerCase()\n return getAllTemplates().filter(\n (template) =>\n template.name.toLowerCase().includes(searchTerm) ||\n template.description.toLowerCase().includes(searchTerm) ||\n template.tags.some((tag) => tag.includes(searchTerm))\n )\n}\n\n/**\n * Get template statistics\n */\nexport function getTemplateStats() {\n const templates = getAllTemplates()\n\n const totalEntities = templates.reduce((sum, t) => sum + t.structure.domain.totalEntities, 0)\n const totalProperties = templates.reduce((sum, t) => sum + t.structure.domain.totalProperties, 0)\n const totalAssociations = templates.reduce((sum, t) => sum + t.structure.domain.totalAssociations, 0)\n\n const categoryCounts: Record<string, number> = {}\n templates.forEach((template) => {\n template.tags.forEach((tag) => {\n categoryCounts[tag] = (categoryCounts[tag] || 0) + 1\n })\n })\n\n return {\n totalTemplates: templates.length,\n totalEntities,\n totalProperties,\n totalAssociations,\n categoryCounts,\n }\n}\n"]}
@@ -0,0 +1,41 @@
1
+ import type { DomainTemplate } from './types.js';
2
+ /**
3
+ * Registry of all available domain templates with their metadata.
4
+ * This provides a central location for UI components to discover and present templates.
5
+ *
6
+ * The templates are pre-processed at build time using the generate-template-metadata.js script
7
+ * to avoid loading and processing all templates on the client side.
8
+ */
9
+ export declare class TemplateRegistry {
10
+ /**
11
+ * Gets all available templates
12
+ */
13
+ static getAllTemplates(): DomainTemplate[];
14
+ /**
15
+ * Gets a template by its ID
16
+ */
17
+ static getTemplate(id: string): DomainTemplate | undefined;
18
+ /**
19
+ * Gets templates filtered by tags
20
+ */
21
+ static getTemplatesByTag(tag: string): DomainTemplate[];
22
+ /**
23
+ * Gets templates filtered by category (based on tags)
24
+ */
25
+ static getTemplatesByCategory(category: 'business' | 'content' | 'social' | 'technical'): DomainTemplate[];
26
+ /**
27
+ * Searches templates by name or description
28
+ */
29
+ static searchTemplates(query: string): DomainTemplate[];
30
+ /**
31
+ * Gets template statistics for analytics
32
+ */
33
+ static getTemplateStats(): {
34
+ totalTemplates: number;
35
+ totalEntities: number;
36
+ totalProperties: number;
37
+ totalAssociations: number;
38
+ categoryCounts: Record<string, number>;
39
+ };
40
+ }
41
+ //# sourceMappingURL=template-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-registry.d.ts","sourceRoot":"","sources":["../../../../src/modeling/templates/template-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAUhD;;;;;;GAMG;AAEH,qBAAa,gBAAgB;IAC3B;;OAEG;IACH,MAAM,CAAC,eAAe,IAAI,cAAc,EAAE;IAI1C;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAI1D;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,EAAE;IAIvD;;OAEG;IACH,MAAM,CAAC,sBAAsB,CAAC,QAAQ,EAAE,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,cAAc,EAAE;IAI1G;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,EAAE;IAIvD;;OAEG;IACH,MAAM,CAAC,gBAAgB,IAAI;QACzB,cAAc,EAAE,MAAM,CAAA;QACtB,aAAa,EAAE,MAAM,CAAA;QACrB,eAAe,EAAE,MAAM,CAAA;QACvB,iBAAiB,EAAE,MAAM,CAAA;QACzB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KACvC;CAGF"}
@@ -0,0 +1,48 @@
1
+ import { getAllTemplates, getTemplate, getTemplatesByTag, getTemplatesByCategory, searchTemplates, getTemplateStats, } from './meta/index.js';
2
+ /**
3
+ * Registry of all available domain templates with their metadata.
4
+ * This provides a central location for UI components to discover and present templates.
5
+ *
6
+ * The templates are pre-processed at build time using the generate-template-metadata.js script
7
+ * to avoid loading and processing all templates on the client side.
8
+ */
9
+ // eslint-disable-next-line @typescript-eslint/no-extraneous-class
10
+ export class TemplateRegistry {
11
+ /**
12
+ * Gets all available templates
13
+ */
14
+ static getAllTemplates() {
15
+ return getAllTemplates();
16
+ }
17
+ /**
18
+ * Gets a template by its ID
19
+ */
20
+ static getTemplate(id) {
21
+ return getTemplate(id);
22
+ }
23
+ /**
24
+ * Gets templates filtered by tags
25
+ */
26
+ static getTemplatesByTag(tag) {
27
+ return getTemplatesByTag(tag);
28
+ }
29
+ /**
30
+ * Gets templates filtered by category (based on tags)
31
+ */
32
+ static getTemplatesByCategory(category) {
33
+ return getTemplatesByCategory(category);
34
+ }
35
+ /**
36
+ * Searches templates by name or description
37
+ */
38
+ static searchTemplates(query) {
39
+ return searchTemplates(query);
40
+ }
41
+ /**
42
+ * Gets template statistics for analytics
43
+ */
44
+ static getTemplateStats() {
45
+ return getTemplateStats();
46
+ }
47
+ }
48
+ //# sourceMappingURL=template-registry.js.map