@api-client/core 0.18.22 → 0.18.24
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/definitions/Email.d.ts +0 -4
- package/build/src/modeling/definitions/Email.d.ts.map +1 -1
- package/build/src/modeling/definitions/Email.js +0 -1
- package/build/src/modeling/definitions/Email.js.map +1 -1
- package/build/src/modeling/helpers/database.js +2 -2
- package/build/src/modeling/helpers/database.js.map +1 -1
- package/build/src/modeling/templates/meta/index.d.ts +10 -2
- package/build/src/modeling/templates/meta/index.d.ts.map +1 -1
- package/build/src/modeling/templates/meta/index.js +31 -1
- package/build/src/modeling/templates/meta/index.js.map +1 -1
- package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.js +3 -3
- package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.js.map +1 -1
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.js +5 -5
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/example-generator-api.json +6 -6
- package/package.json +1 -1
- package/src/modeling/definitions/Email.ts +0 -5
- package/src/modeling/helpers/database.ts +2 -2
- package/src/modeling/templates/verticals/business-services/ecommerce-domain.ts +3 -3
- package/src/modeling/templates/verticals/technology-media/blog-domain.ts +5 -5
- package/tests/unit/modeling/definitions/email.spec.ts +0 -1
- package/tests/unit/modeling/semantic-configs.spec.ts +0 -1
|
@@ -13,10 +13,6 @@ export interface EmailConfig {
|
|
|
13
13
|
* Whether email verification is required.
|
|
14
14
|
*/
|
|
15
15
|
requireVerification?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Method to use for verification: 'email' or 'sms'.
|
|
18
|
-
*/
|
|
19
|
-
verificationMethod?: 'email' | 'sms';
|
|
20
16
|
/**
|
|
21
17
|
* Whether to allow subaddressing (user+tag@domain.com).
|
|
22
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../../../src/modeling/definitions/Email.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../../../src/modeling/definitions/Email.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC;;OAEG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAC/D,EAAE,EAAE,YAAY,CAAC,KAAK,CAAA;IACtB,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,UAAU,mBAAmB,KAAG,QAAQ,IAAI,oBAE3E,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAQ,WAAgB,KAAG,oBAa9D,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,WAIlC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Email.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"Email.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Email.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAmD9C;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAA6B,EAAoC,EAAE;IACjG,OAAO,QAAQ,CAAC,EAAE,KAAK,YAAY,CAAC,KAAK,CAAA;AAC3C,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,SAAsB,EAAE,EAAwB,EAAE;IACpF,MAAM,YAAY,GAAG;QACnB,GAAG,oBAAoB;QACvB,GAAG,MAAM;KACV,CAAA;IACD,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,YAAY,CAAC,QAAQ,GAAG,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAA;IAChD,CAAC;IAED,OAAO;QACL,EAAE,EAAE,YAAY,CAAC,KAAK;QACtB,MAAM,EAAE,YAAY;KACrB,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAgB;IAC/C,mBAAmB,EAAE,KAAK;IAC1B,kBAAkB,EAAE,IAAI;IACxB,kBAAkB,EAAE,IAAI;CACzB,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Configuration options for the Email semantic.\n * Controls validation, allowed domains, and verification.\n */\nexport interface EmailConfig {\n /**\n * List of allowed email domains (e.g., ['example.com']).\n */\n allowedDomains?: string[]\n /**\n * Whether email verification is required.\n */\n requireVerification?: boolean\n /**\n * Whether to allow subaddressing (user+tag@domain.com).\n */\n allowSubaddressing?: boolean\n /**\n * Whether to allow internationalized email addresses.\n *\n * - When true (default): Allows email addresses with non-ASCII characters in the domain part,\n * like user@münchen.de or user@café.com\n * - When false: Only allows ASCII characters in the domain part, like user@example.com\n *\n * Why it exists:\n * - Internationalization: Many countries have domain names with native characters (like German umlauts,\n * French accents, etc.)\n * - RFC 6531: The standard for internationalized email addresses\n * - Validation flexibility: Some systems may need to restrict to ASCII-only domains for compatibility reasons\n */\n allowInternational?: boolean\n /**\n * Custom metadata for the email field.\n */\n metadata?: Record<string, unknown>\n /**\n * Index signature to allow additional properties.\n */\n [key: string]: unknown\n}\n\n/**\n * Type-safe configuration for Email semantic.\n */\nexport interface AppliedEmailSemantic extends AppliedDataSemantic {\n id: SemanticType.Email\n config?: EmailConfig\n}\n\n/**\n * Type guard to check if a semantic is an Email semantic.\n */\nexport const isEmailSemantic = (semantic: AppliedDataSemantic): semantic is AppliedEmailSemantic => {\n return semantic.id === SemanticType.Email\n}\n\n/**\n * Helper function to create an Email semantic with configuration.\n */\nexport const createEmailSemantic = (config: EmailConfig = {}): AppliedEmailSemantic => {\n const mergedConfig = {\n ...DEFAULT_EMAIL_CONFIG,\n ...config,\n }\n if (config.metadata) {\n mergedConfig.metadata = { ...config.metadata }\n }\n\n return {\n id: SemanticType.Email,\n config: mergedConfig,\n }\n}\n\n/**\n * Default configuration for Email semantic.\n */\nexport const DEFAULT_EMAIL_CONFIG: EmailConfig = {\n requireVerification: false,\n allowSubaddressing: true,\n allowInternational: true,\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SNAKE_CASE } from '@pawel-up/jexl/string.js';
|
|
2
2
|
import DOMPurify from '../../lib/dom_purify.js';
|
|
3
3
|
export function sanitizeInput(input) {
|
|
4
4
|
return DOMPurify.sanitize(input);
|
|
@@ -17,7 +17,7 @@ export function toDatabaseColumnName(inputName, defaultName = 'untitled_column')
|
|
|
17
17
|
// 1. Sanitize
|
|
18
18
|
let name = sanitizeInput(inputName);
|
|
19
19
|
// 2. Convert to lowercase
|
|
20
|
-
name =
|
|
20
|
+
name = SNAKE_CASE(name);
|
|
21
21
|
// 3. Replace spaces and multiple hyphens/underscores with a single underscore
|
|
22
22
|
name = name.replace(/[\s-]+/g, '_');
|
|
23
23
|
// 4. Remove any characters that are not alphanumeric or underscore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../../../src/modeling/helpers/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../../../src/modeling/helpers/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,SAAS,MAAM,yBAAyB,CAAA;AAE/C,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,OAAO,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAClC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAAiB,EAAE,WAAW,GAAG,iBAAiB;IACrF,cAAc;IACd,IAAI,IAAI,GAAG,aAAa,CAAC,SAAS,CAAC,CAAA;IAEnC,0BAA0B;IAC1B,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;IAEvB,8EAA8E;IAC9E,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;IAEnC,mEAAmE;IACnE,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAA;IAEtC,qFAAqF;IACrF,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;IAEnC,OAAO,IAAI,IAAI,WAAW,CAAA;AAC5B,CAAC;AACD;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAiB,EAAE,WAAW,GAAG,gBAAgB;IACnF,OAAO,oBAAoB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAA;AACrD,CAAC","sourcesContent":["import { SNAKE_CASE } from '@pawel-up/jexl/string.js'\nimport DOMPurify from '../../lib/dom_purify.js'\n\nexport function sanitizeInput(input: string): string {\n return DOMPurify.sanitize(input)\n}\n\n/**\n * Converts a string into a sanitized, database column friendly name.\n * - Sanitizes the input using DOMPurify.\n * - Converts to lowercase.\n * - Replaces spaces and multiple underscores with a single underscore.\n * - Removes any characters that are not alphanumeric or underscore.\n *\n * @param inputName The string to format.\n * @returns A database column friendly name.\n */\nexport function toDatabaseColumnName(inputName: string, defaultName = 'untitled_column'): string {\n // 1. Sanitize\n let name = sanitizeInput(inputName)\n\n // 2. Convert to lowercase\n name = SNAKE_CASE(name)\n\n // 3. Replace spaces and multiple hyphens/underscores with a single underscore\n name = name.replace(/[\\s-]+/g, '_')\n\n // 4. Remove any characters that are not alphanumeric or underscore\n name = name.replace(/[^a-z0-9_]/g, '')\n\n // 5. Ensure it doesn't start or end with an underscore (optional, but good practice)\n name = name.replace(/^_+|_+$/g, '')\n\n return name || defaultName\n}\n/**\n * Converts a string into a sanitized, database table friendly name.\n * - Sanitizes the input using DOMPurify.\n * - Converts to lowercase.\n * - Replaces spaces and multiple underscores with a single underscore.\n * - Removes any characters that are not alphanumeric or underscore.\n *\n * @param inputName The string to format.\n * @returns A database table friendly name.\n */\nexport function toDatabaseTableName(inputName: string, defaultName = 'untitled_table'): string {\n return toDatabaseColumnName(inputName, defaultName)\n}\n"]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auto-generated template registry index
|
|
3
|
-
* Generated on: 2025-07-
|
|
3
|
+
* Generated on: 2025-07-30T05:20:58.948Z
|
|
4
4
|
*
|
|
5
5
|
* This file is auto-generated by scripts/generate-template-metadata.js
|
|
6
6
|
* Do not edit manually - your changes will be overwritten.
|
|
7
7
|
*/
|
|
8
|
-
import type { DomainTemplate } from '../types.js';
|
|
8
|
+
import type { CreateTemplateOptions, DomainTemplate } from '../types.js';
|
|
9
|
+
import { DataDomain } from '../../DataDomain.js';
|
|
9
10
|
/**
|
|
10
11
|
* Registry of all available template metadata
|
|
11
12
|
*/
|
|
@@ -53,4 +54,11 @@ export declare function getTemplateStats(): {
|
|
|
53
54
|
totalAssociations: number;
|
|
54
55
|
categoryCounts: Record<string, number>;
|
|
55
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* Creates a domain by its ID
|
|
59
|
+
* @param id The ID of the template
|
|
60
|
+
* @param options Options for creating the template
|
|
61
|
+
* @returns The created data domain
|
|
62
|
+
*/
|
|
63
|
+
export declare function createDomainById(id: string, options?: CreateTemplateOptions): DataDomain;
|
|
56
64
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modeling/templates/meta/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAkBhD;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAa5D,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,YAAY,oVAaf,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;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,UAAU,CAsBxF"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auto-generated template registry index
|
|
3
|
-
* Generated on: 2025-07-
|
|
3
|
+
* Generated on: 2025-07-30T05:20:58.948Z
|
|
4
4
|
*
|
|
5
5
|
* This file is auto-generated by scripts/generate-template-metadata.js
|
|
6
6
|
* Do not edit manually - your changes will be overwritten.
|
|
7
7
|
*/
|
|
8
|
+
import * as domains from '../verticals/index.js';
|
|
8
9
|
// Template metadata imports
|
|
9
10
|
import ecommercePlatformMetadata from './ecommerce-platform.json' with { type: 'json' };
|
|
10
11
|
import blogPublishingPlatformMetadata from './blog-publishing-platform.json' with { type: 'json' };
|
|
@@ -117,4 +118,33 @@ export function getTemplateStats() {
|
|
|
117
118
|
categoryCounts,
|
|
118
119
|
};
|
|
119
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Creates a domain by its ID
|
|
123
|
+
* @param id The ID of the template
|
|
124
|
+
* @param options Options for creating the template
|
|
125
|
+
* @returns The created data domain
|
|
126
|
+
*/
|
|
127
|
+
export function createDomainById(id, options) {
|
|
128
|
+
const map = new Map();
|
|
129
|
+
map.set('ecommerce-platform', 'createEcommerceDomain');
|
|
130
|
+
map.set('blog-publishing-platform', 'createBlogDomain');
|
|
131
|
+
map.set('healthcare-management-platform', 'createHealthcareDomain');
|
|
132
|
+
map.set('financial-services-platform', 'createFinancialServicesDomain');
|
|
133
|
+
map.set('education-management-platform', 'createEducationDomain');
|
|
134
|
+
map.set('real-estate-management-platform', 'createRealEstateDomain');
|
|
135
|
+
map.set('manufacturing-platform', 'createManufacturingDomain');
|
|
136
|
+
map.set('hospitality-platform', 'createHospitalityDomain');
|
|
137
|
+
map.set('legal-services-platform', 'createLegalServicesDomain');
|
|
138
|
+
map.set('non-profit-platform', 'createNonProfitDomain');
|
|
139
|
+
map.set('iot-smart-home-platform', 'createIoTSmartHomeDomain');
|
|
140
|
+
map.set('gaming-platform', 'createGamingDomain');
|
|
141
|
+
const createDomainFn = map.get(id);
|
|
142
|
+
if (!createDomainFn) {
|
|
143
|
+
throw new Error(`No create function found for template ID ${id}`);
|
|
144
|
+
}
|
|
145
|
+
if (typeof domains[createDomainFn] !== 'function') {
|
|
146
|
+
throw new Error(`Function ${createDomainFn} is not defined in domains module`);
|
|
147
|
+
}
|
|
148
|
+
return domains[createDomainFn](options);
|
|
149
|
+
}
|
|
120
150
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +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;AAClG,OAAO,oCAAoC,MAAM,uCAAuC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC9G,OAAO,iCAAiC,MAAM,oCAAoC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE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,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,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-29T00:46:22.520Z\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' }\nimport healthcareManagementPlatformMetadata from './healthcare-management-platform.json' with { type: 'json' }\nimport financialServicesPlatformMetadata from './financial-services-platform.json' with { type: 'json' }\nimport educationManagementPlatformMetadata from './education-management-platform.json' with { type: 'json' }\nimport realEstateManagementPlatformMetadata from './real-estate-management-platform.json' with { type: 'json' }\nimport manufacturingPlatformMetadata from './manufacturing-platform.json' with { type: 'json' }\nimport hospitalityPlatformMetadata from './hospitality-platform.json' with { type: 'json' }\nimport legalServicesPlatformMetadata from './legal-services-platform.json' with { type: 'json' }\nimport nonProfitPlatformMetadata from './non-profit-platform.json' with { type: 'json' }\nimport iotSmartHomePlatformMetadata from './iot-smart-home-platform.json' with { type: 'json' }\nimport gamingPlatformMetadata from './gaming-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 'healthcare-management-platform': healthcareManagementPlatformMetadata as DomainTemplate,\n 'financial-services-platform': financialServicesPlatformMetadata as DomainTemplate,\n 'education-management-platform': educationManagementPlatformMetadata as DomainTemplate,\n 'real-estate-management-platform': realEstateManagementPlatformMetadata as DomainTemplate,\n 'manufacturing-platform': manufacturingPlatformMetadata as DomainTemplate,\n 'hospitality-platform': hospitalityPlatformMetadata as DomainTemplate,\n 'legal-services-platform': legalServicesPlatformMetadata as DomainTemplate,\n 'non-profit-platform': nonProfitPlatformMetadata as DomainTemplate,\n 'iot-smart-home-platform': iotSmartHomePlatformMetadata as DomainTemplate,\n 'gaming-platform': gamingPlatformMetadata 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 'healthcare-management-platform',\n 'financial-services-platform',\n 'education-management-platform',\n 'real-estate-management-platform',\n 'manufacturing-platform',\n 'hospitality-platform',\n 'legal-services-platform',\n 'non-profit-platform',\n 'iot-smart-home-platform',\n 'gaming-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"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modeling/templates/meta/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAA;AAGhD,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;AAClG,OAAO,oCAAoC,MAAM,uCAAuC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC9G,OAAO,iCAAiC,MAAM,oCAAoC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACxG,OAAO,mCAAmC,MAAM,sCAAsC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC5G,OAAO,oCAAoC,MAAM,wCAAwC,CAAC,OAAO,IAAI,EAAE,MAAM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UAAU,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CAAC,YAAY,cAAc,mCAAmC,CAAC,CAAA;IAChF,CAAC;IACD,OAAO,OAAO,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAA;AACzC,CAAC","sourcesContent":["/**\n * Auto-generated template registry index\n * Generated on: 2025-07-30T05:20:58.948Z\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 { CreateTemplateOptions, DomainTemplate } from '../types.js'\nimport { DataDomain } from '../../DataDomain.js'\nimport * as domains from '../verticals/index.js'\nimport type * as Verticals from '../verticals/index.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' }\nimport healthcareManagementPlatformMetadata from './healthcare-management-platform.json' with { type: 'json' }\nimport financialServicesPlatformMetadata from './financial-services-platform.json' with { type: 'json' }\nimport educationManagementPlatformMetadata from './education-management-platform.json' with { type: 'json' }\nimport realEstateManagementPlatformMetadata from './real-estate-management-platform.json' with { type: 'json' }\nimport manufacturingPlatformMetadata from './manufacturing-platform.json' with { type: 'json' }\nimport hospitalityPlatformMetadata from './hospitality-platform.json' with { type: 'json' }\nimport legalServicesPlatformMetadata from './legal-services-platform.json' with { type: 'json' }\nimport nonProfitPlatformMetadata from './non-profit-platform.json' with { type: 'json' }\nimport iotSmartHomePlatformMetadata from './iot-smart-home-platform.json' with { type: 'json' }\nimport gamingPlatformMetadata from './gaming-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 'healthcare-management-platform': healthcareManagementPlatformMetadata as DomainTemplate,\n 'financial-services-platform': financialServicesPlatformMetadata as DomainTemplate,\n 'education-management-platform': educationManagementPlatformMetadata as DomainTemplate,\n 'real-estate-management-platform': realEstateManagementPlatformMetadata as DomainTemplate,\n 'manufacturing-platform': manufacturingPlatformMetadata as DomainTemplate,\n 'hospitality-platform': hospitalityPlatformMetadata as DomainTemplate,\n 'legal-services-platform': legalServicesPlatformMetadata as DomainTemplate,\n 'non-profit-platform': nonProfitPlatformMetadata as DomainTemplate,\n 'iot-smart-home-platform': iotSmartHomePlatformMetadata as DomainTemplate,\n 'gaming-platform': gamingPlatformMetadata 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 'healthcare-management-platform',\n 'financial-services-platform',\n 'education-management-platform',\n 'real-estate-management-platform',\n 'manufacturing-platform',\n 'hospitality-platform',\n 'legal-services-platform',\n 'non-profit-platform',\n 'iot-smart-home-platform',\n 'gaming-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\n/**\n * Creates a domain by its ID\n * @param id The ID of the template\n * @param options Options for creating the template\n * @returns The created data domain\n */\nexport function createDomainById(id: string, options?: CreateTemplateOptions): DataDomain {\n const map = new Map<string, keyof typeof Verticals>()\n map.set('ecommerce-platform', 'createEcommerceDomain')\n map.set('blog-publishing-platform', 'createBlogDomain')\n map.set('healthcare-management-platform', 'createHealthcareDomain')\n map.set('financial-services-platform', 'createFinancialServicesDomain')\n map.set('education-management-platform', 'createEducationDomain')\n map.set('real-estate-management-platform', 'createRealEstateDomain')\n map.set('manufacturing-platform', 'createManufacturingDomain')\n map.set('hospitality-platform', 'createHospitalityDomain')\n map.set('legal-services-platform', 'createLegalServicesDomain')\n map.set('non-profit-platform', 'createNonProfitDomain')\n map.set('iot-smart-home-platform', 'createIoTSmartHomeDomain')\n map.set('gaming-platform', 'createGamingDomain')\n const createDomainFn = map.get(id)\n if (!createDomainFn) {\n throw new Error(`No create function found for template ID ${id}`)\n }\n if (typeof domains[createDomainFn] !== 'function') {\n throw new Error(`Function ${createDomainFn} is not defined in domains module`)\n }\n return domains[createDomainFn](options)\n}\n"]}
|
|
@@ -440,7 +440,7 @@ export default function createEcommerceDomain(options = {}) {
|
|
|
440
440
|
allowNegative: false,
|
|
441
441
|
}),
|
|
442
442
|
createCalculatedSemantic({
|
|
443
|
-
formula:
|
|
443
|
+
formula: `{{${cartUnitPrice.key}}} * {{${cartItemQuantity.key}}}`,
|
|
444
444
|
dependencies: [cartUnitPrice.key, cartItemQuantity.key],
|
|
445
445
|
recalculateOnUpdate: true,
|
|
446
446
|
}),
|
|
@@ -507,7 +507,7 @@ export default function createEcommerceDomain(options = {}) {
|
|
|
507
507
|
allowNegative: false,
|
|
508
508
|
}),
|
|
509
509
|
createCalculatedSemantic({
|
|
510
|
-
formula:
|
|
510
|
+
formula: `{{${subtotal.key}}} + {{${taxAmount.key}}} + {{${shippingAmount.key}}}`,
|
|
511
511
|
dependencies: [subtotal.key, taxAmount.key, shippingAmount.key],
|
|
512
512
|
recalculateOnUpdate: true,
|
|
513
513
|
}),
|
|
@@ -562,7 +562,7 @@ export default function createEcommerceDomain(options = {}) {
|
|
|
562
562
|
allowNegative: false,
|
|
563
563
|
}),
|
|
564
564
|
createCalculatedSemantic({
|
|
565
|
-
formula:
|
|
565
|
+
formula: `{{${quantity.key}}} * {{${unitPrice.key}}}`,
|
|
566
566
|
dependencies: [quantity.key, unitPrice.key],
|
|
567
567
|
recalculateOnUpdate: true,
|
|
568
568
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ecommerce-domain.js","sourceRoot":"","sources":["../../../../../../src/modeling/templates/verticals/business-services/ecommerce-domain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAA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EAAE,UAAU,EAAE,WAAW,EAAE,+BAA+B,EAAE;QACjG,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE;YACN,YAAY,EAAE;gBACZ,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,KAAK;aACb;SACF;KACF,CAAC,CAAA;IAEF,aAAa,CAAC,WAAW,CAAC;QACxB,IAAI,EAAE;YACJ,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EAAE,2CAA2C;SACzD;QACD,IAAI,EAAE,QAAQ;KACf,CAAC,CAAA;IAEF,8BAA8B;IAC9B,YAAY;IACZ,+BAA+B;IAC/B,uCAAuC;IACvC,wDAAwD;IACxD,OAAO;IACP,oBAAoB;IACpB,oBAAoB;IACpB,KAAK;IAEL,iBAAiB,CAAC,aAAa,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC,CAAA;IAEjF,0CAA0C;IAC1C,WAAW,CAAC,cAAc,CACxB,EAAE,GAAG,EAAE,aAAa,CAAC,GAAG,EAAE,EAC1B;QACE,IAAI,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,qCAAqC,EAAE;QAC7G,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,UAAU,EAAE,+CAA+C;KACtE,CACF,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["/**\n * E-Commerce Data Domain Example\n *\n * This file demonstrates how to create a comprehensive e-commerce data domain\n * using the API Client Core modeling system. It follows the business-first approach\n * and demonstrates proper use of namespaces, models, entities, properties,\n * associations, and semantic annotations.\n *\n * The example includes:\n * - User Management domain with proper authentication setup\n * - Product Catalog with categories and inventory\n * - Order Management with cart functionality and payment processing\n * - Proper semantic annotations for security, timestamps, and business logic\n * - Realistic associations between entities with proper cardinality\n *\n * @example\n * ```typescript\n * import { createEcommerceDomain } from './ecommerce-domain.js'\n *\n * const domain = createEcommerceDomain()\n * console.log('Domain created with', domain.graph.nodeCount(), 'nodes')\n * ```\n */\n\nimport { DataDomain } from '../../../DataDomain.js'\nimport { SemanticType } from '../../../Semantics.js'\nimport { createCalculatedSemantic } from '../../../definitions/Calculated.js'\nimport { createCurrencySemantic } from '../../../definitions/Currency.js'\nimport { createSummarySemantic } from '../../../definitions/Summary.js'\nimport {\n addAvatarUrlField,\n addCreatedAtField,\n addDescriptionField,\n addEmailField,\n addFirstNameField,\n addIdField,\n addLastNameField,\n addNameField,\n addPasswordField,\n addPhoneField,\n addPublicUniqueNameField,\n addUpdatedAtField,\n addSkuField,\n addPriceField,\n addQuantityField,\n addWeightField,\n addImagesField,\n addCustomStatusField,\n addBooleanField,\n addSessionIdField,\n addExpiresAtField,\n addUnitPriceField,\n addCurrencyAmountField,\n} from '../../../helpers/Intelisense.js'\nimport type { CreateTemplateOptions } from '../../types.js'\n\nfunction createDomain(): DataDomain {\n return new DataDomain({\n info: {\n name: 'E-Commerce Platform',\n displayName: 'E-Commerce Platform',\n description:\n 'A comprehensive e-commerce platform with user management, product catalog, and order processing capabilities',\n },\n })\n}\n\n/**\n * Creates a comprehensive e-commerce data domain following domain-driven design principles.\n *\n * This function demonstrates the proper hierarchy and organization for a business domain:\n * 1. Creates the root DataDomain\n * 2. Organizes functionality into logical namespaces (User Management, Product Catalog, etc.)\n * 3. Groups related entities into models within each namespace\n * 4. Defines entities with proper semantic annotations\n * 5. Establishes associations with appropriate cardinality and business rules\n *\n * @returns A fully configured DataDomain with all e-commerce entities and relationships\n */\nexport default function createEcommerceDomain(options: CreateTemplateOptions = {}): DataDomain {\n // Ensure the root data domain\n const domain = options.domain ?? createDomain()\n\n //\n // 1. USER MANAGEMENT NAMESPACE\n //\n const userManagement = domain.addNamespace({\n info: {\n name: 'UserManagement',\n displayName: 'User Management',\n description: 'Handles user authentication, authorization, and profile management',\n },\n })\n\n // User Authentication Model\n const authModel = userManagement.addModel({\n info: {\n name: 'Authentication',\n displayName: 'User Authentication',\n description: 'User accounts and authentication data',\n },\n })\n\n // User Entity - The core user account\n const userEntity = authModel.addEntity({\n info: {\n name: 'User',\n displayName: 'User Account',\n description: 'Represents a user account in the system',\n },\n semantics: [{ id: SemanticType.User }], // Mark this as a User entity for system-wide recognition\n })\n\n // User properties with proper semantic annotations\n addIdField(userEntity, { displayName: 'User ID', description: 'Unique identifier for the user' })\n addEmailField(userEntity, { description: 'User email address for login and communication' })\n addPasswordField(userEntity, { description: 'User password for authentication' })\n\n const fName = addFirstNameField(userEntity, { description: 'User first name' })\n fName.required = true\n\n const lName = addLastNameField(userEntity, { description: 'User last name' })\n lName.required = true\n\n userEntity.addProperty({\n info: { name: 'role', displayName: 'User Role', description: 'User role for permission management' },\n type: 'string',\n required: true,\n schema: {\n enum: ['customer', 'admin', 'moderator'],\n defaultValue: {\n type: 'literal',\n value: 'customer',\n },\n },\n semantics: [{ id: SemanticType.UserRole }],\n })\n\n userEntity.addProperty({\n info: {\n name: 'email_verified',\n displayName: 'Email Verified',\n description: 'Whether the user has verified their email address',\n },\n type: 'boolean',\n required: true,\n schema: {\n defaultValue: {\n type: 'literal',\n value: 'false',\n },\n },\n })\n\n addCreatedAtField(userEntity, { description: 'When the user account was created' })\n addUpdatedAtField(userEntity, { description: 'When the user account was last updated' })\n\n // User Profile Model\n const profileModel = userManagement.addModel({\n info: {\n name: 'UserProfile',\n displayName: 'User Profile',\n description: 'Extended user profile information',\n },\n })\n\n // User Profile Entity\n const userProfileEntity = profileModel.addEntity({\n info: {\n name: 'user_profile',\n displayName: 'User Profile',\n description: 'Extended profile information for users',\n },\n })\n\n addIdField(userProfileEntity, { displayName: 'Profile ID', description: 'Unique identifier for the profile' })\n\n userProfileEntity.addProperty({\n info: { name: 'birthdate', displayName: 'Date of Birth', description: 'User date of birth' },\n type: 'date',\n })\n\n addPhoneField(userProfileEntity, { description: 'User phone number' })\n addAvatarUrlField(userProfileEntity, { description: 'URL to user profile picture' })\n\n // User-Profile Association (One-to-One), not required for registration flows.\n userEntity.addAssociation(\n { key: userProfileEntity.key },\n {\n info: { name: 'profile', displayName: 'User Profile', description: 'Link to extended profile information' },\n required: false,\n multiple: false,\n }\n )\n\n // Address Entity\n const addressEntity = profileModel.addEntity({\n info: {\n name: 'address',\n displayName: 'Address',\n description: 'Physical address information',\n },\n })\n\n addIdField(addressEntity, { displayName: 'Address ID', description: 'Unique identifier for the address' })\n\n addressEntity.addProperty({\n info: { name: 'type', displayName: 'Address Type', description: 'Type of address (shipping, billing, etc.)' },\n type: 'string',\n required: true,\n schema: {\n enum: ['shipping', 'billing', 'both'],\n },\n })\n\n addressEntity.addProperty({\n info: {\n name: 'line1',\n displayName: 'Address Line 1',\n description: 'Primary street address, including house number and street name',\n },\n type: 'string',\n required: true,\n })\n\n addressEntity.addProperty({\n info: {\n name: 'line2',\n displayName: 'Address Line 2',\n description: 'Optional field for additional street-level information like apartment numbers or building names.',\n },\n type: 'string',\n required: false,\n })\n\n addressEntity.addProperty({\n info: {\n name: 'line3',\n displayName: 'Address Line 3',\n description: 'Optional field for additional street-level information like apartment numbers or building names.',\n },\n type: 'string',\n required: false,\n })\n\n addressEntity.addProperty({\n info: { name: 'city', displayName: 'City', description: 'City name' },\n type: 'string',\n required: true,\n })\n\n addressEntity.addProperty({\n info: { name: 'state', displayName: 'State/Province', description: 'State or province' },\n type: 'string',\n required: true,\n })\n\n addressEntity.addProperty({\n info: { name: 'postal_code', displayName: 'ZIP/Postal Code', description: 'ZIP or postal code' },\n type: 'string',\n required: true,\n })\n\n addressEntity.addProperty({\n info: { name: 'country', displayName: 'Country', description: 'Country name' },\n type: 'string',\n required: true,\n })\n\n // User-Address Association (One-to-Many)\n userEntity.addAssociation(\n { key: addressEntity.key },\n {\n info: { name: 'addresses', displayName: 'User Addresses', description: 'User shipping and billing addresses' },\n required: false,\n multiple: true,\n }\n )\n\n //\n // 2. PRODUCT CATALOG NAMESPACE\n //\n const productCatalog = domain.addNamespace({\n info: {\n name: 'ProductCatalog',\n displayName: 'Product Catalog',\n description: 'Product information, categories, and inventory management',\n },\n })\n\n // Product Management Model\n const productModel = productCatalog.addModel({\n info: {\n name: 'Products',\n displayName: 'Product Management',\n description: 'Core product entities and relationships',\n },\n })\n\n // Category Entity\n const categoryEntity = productModel.addEntity({\n info: {\n name: 'category',\n displayName: 'Product Category',\n description: 'Product categorization for organization and navigation',\n },\n })\n addIdField(categoryEntity, { displayName: 'Category ID', description: 'Unique identifier for the category' })\n addNameField(categoryEntity, { displayName: 'Category Name', description: 'Display name of the category' })\n addPublicUniqueNameField(categoryEntity, {\n displayName: 'URL Slug',\n description: 'URL-friendly identifier for the category',\n })\n addDescriptionField(categoryEntity, { description: 'Category description' })\n\n // Self-referencing association for category hierarchy\n categoryEntity.addAssociation(\n { key: categoryEntity.key },\n {\n info: {\n name: 'parent_category',\n displayName: 'Parent Category',\n description: 'Parent category for hierarchical organization',\n },\n required: false,\n multiple: false,\n }\n )\n\n // Product Entity\n const productEntity = productModel.addEntity({\n info: {\n name: 'product',\n displayName: 'Product',\n description: 'Core product information and specifications',\n },\n })\n\n addIdField(productEntity, { displayName: 'Product ID', description: 'Unique identifier for the product' })\n addNameField(productEntity, { displayName: 'Product Name', description: 'Display name of the product' })\n addPublicUniqueNameField(productEntity, {\n displayName: 'URL Slug',\n description: 'URL-friendly identifier for the product',\n })\n addDescriptionField(productEntity, { description: 'Detailed product description' })\n\n productEntity.addProperty({\n info: { name: 'short_description', displayName: 'Short Description', description: 'Brief product summary' },\n type: 'string',\n semantics: [createSummarySemantic()],\n })\n\n addSkuField(productEntity, { description: 'Stock Keeping Unit - unique product identifier' })\n\n addPriceField(productEntity, { description: 'Product price in cents (USD)' })\n\n productEntity.addProperty({\n info: {\n name: 'compare_at_price',\n displayName: 'Compare at Price',\n description: 'Original price for discount display',\n },\n type: 'number',\n schema: {\n maximum: 0,\n },\n bindings: [\n {\n type: 'web',\n schema: {\n dataType: 'float',\n },\n },\n ],\n semantics: [\n createCurrencySemantic({\n storageFormat: 'integer_cents',\n defaultCurrency: 'USD',\n decimalPlaces: 2,\n allowNegative: false,\n validateCurrencyCode: true,\n }),\n ],\n })\n\n addCustomStatusField(productEntity, ['inactive', 'active', 'pending', 'archived'], {\n description: 'Current status of the product',\n })\n\n addWeightField(productEntity, { description: 'Product weight in grams' })\n\n addImagesField(productEntity, { description: 'Array of product image URLs' })\n\n addCreatedAtField(productEntity, { description: 'When the product was created' })\n addUpdatedAtField(productEntity, { description: 'When the product was last updated' })\n\n // Product-Category Association (Many-to-Many)\n productEntity.addAssociation(\n { key: categoryEntity.key },\n {\n info: {\n name: 'categories',\n displayName: 'Product Categories',\n description: 'Categories this product belongs to',\n },\n required: true,\n multiple: true,\n semantics: [{ id: SemanticType.Categories }],\n }\n )\n\n // Inventory Model\n const inventoryModel = productCatalog.addModel({\n info: {\n name: 'Inventory',\n displayName: 'Inventory Management',\n description: 'Stock levels and inventory tracking',\n },\n })\n\n // Inventory Entity\n const inventoryEntity = inventoryModel.addEntity({\n info: {\n name: 'inventory',\n displayName: 'Inventory',\n description: 'Stock levels and inventory information for products',\n },\n })\n\n addIdField(inventoryEntity, {\n displayName: 'Inventory ID',\n description: 'Unique identifier for the inventory record',\n })\n\n addQuantityField(inventoryEntity, { displayName: 'Stock Quantity', description: 'Available stock quantity' })\n\n const reservedQty = addQuantityField(inventoryEntity, {\n name: 'reserved_quantity',\n displayName: 'Reserved Quantity',\n description: 'Quantity reserved for pending orders',\n })\n reservedQty.schema = {\n defaultValue: {\n type: 'literal',\n value: '0',\n },\n minimum: 0,\n }\n\n addBooleanField(inventoryEntity, 'trackQuantity', 'true', {\n displayName: 'Track Quantity',\n description: 'Whether to track inventory for this product',\n })\n\n addBooleanField(inventoryEntity, 'allowBackorder', 'false', {\n displayName: 'Allow Backorder',\n description: 'Whether to allow ordering when out of stock',\n })\n\n // Product-Inventory Association (One-to-One)\n productEntity.addAssociation(\n { key: inventoryEntity.key },\n {\n info: {\n name: 'inventory',\n displayName: 'Product Inventory',\n description: 'Inventory information for this product',\n },\n required: true,\n multiple: false,\n }\n )\n\n //\n // 3. ORDER MANAGEMENT NAMESPACE\n //\n const orderManagement = domain.addNamespace({\n info: {\n name: 'OrderManagement',\n displayName: 'Order Management',\n description: 'Shopping cart, orders, and payment processing',\n },\n })\n\n // Shopping Cart Model\n const cartModel = orderManagement.addModel({\n info: {\n name: 'ShoppingCart',\n displayName: 'Shopping Cart',\n description: 'Shopping cart and cart items',\n },\n })\n\n // Cart Entity\n const cartEntity = cartModel.addEntity({\n info: {\n name: 'cart',\n displayName: 'Shopping Cart',\n description: 'User shopping cart',\n },\n })\n\n addIdField(cartEntity, { displayName: 'Cart ID', description: 'Unique identifier for the cart' })\n\n addSessionIdField(cartEntity, { description: 'Session identifier for guest carts' })\n\n addExpiresAtField(cartEntity, { description: 'When the cart expires for cleanup' })\n\n addCreatedAtField(cartEntity, { description: 'When the cart was created' })\n addUpdatedAtField(cartEntity, { description: 'When the cart was last updated' })\n\n // Cart-User Association (Many-to-One)\n cartEntity.addAssociation(\n { key: userEntity.key },\n {\n info: { name: 'user', displayName: 'Cart Owner', description: 'User who owns this cart' },\n required: false,\n multiple: false,\n semantics: [{ id: SemanticType.ResourceOwnerIdentifier }],\n }\n )\n\n // Cart Item Entity\n const cartItemEntity = cartModel.addEntity({\n info: {\n name: 'cart_item',\n displayName: 'Cart Item',\n description: 'Individual items in a shopping cart',\n },\n })\n\n addIdField(cartItemEntity, { displayName: 'Cart Item ID', description: 'Unique identifier for the cart item' })\n\n const cartItemQuantity = addQuantityField(cartItemEntity, { description: 'Number of items' })\n cartItemQuantity.schema = { minimum: 1 }\n\n const cartUnitPrice = addUnitPriceField(cartItemEntity, { description: 'Price per unit at time of adding to cart' })\n\n cartItemEntity.addProperty({\n info: { name: 'total_price', displayName: 'Total Price', description: 'Total price for this line item' },\n type: 'number',\n required: true,\n readOnly: true,\n semantics: [\n createCurrencySemantic({\n storageFormat: 'integer_cents',\n defaultCurrency: 'USD',\n decimalPlaces: 2,\n allowNegative: false,\n }),\n createCalculatedSemantic({\n formula: '{{unitPrice}} * {{quantity}}',\n dependencies: [cartUnitPrice.key, cartItemQuantity.key],\n recalculateOnUpdate: true,\n }),\n ],\n })\n\n // Cart-CartItem Association (One-to-Many)\n cartEntity.addAssociation(\n { key: cartItemEntity.key },\n {\n info: { name: 'items', displayName: 'Cart Items', description: 'Items in this cart' },\n required: false,\n multiple: true,\n onDelete: 'cascade',\n }\n )\n\n // CartItem-Product Association (Many-to-One)\n cartItemEntity.addAssociation(\n { key: productEntity.key },\n {\n info: { name: 'product', displayName: 'Product', description: 'Product for this cart item' },\n required: true,\n multiple: false,\n }\n )\n\n // Order Processing Model\n const orderModel = orderManagement.addModel({\n info: {\n name: 'Orders',\n displayName: 'Order Processing',\n description: 'Orders and order fulfillment',\n },\n })\n\n // Order Entity\n const orderEntity = orderModel.addEntity({\n info: {\n name: 'order',\n displayName: 'Order',\n description: 'Customer order',\n },\n })\n\n addIdField(orderEntity, { displayName: 'Order ID', description: 'Unique identifier for the order' })\n\n orderEntity.addProperty({\n info: { name: 'order_number', displayName: 'Order Number', description: 'Human-readable order number' },\n type: 'string',\n required: true,\n unique: true,\n })\n\n addCustomStatusField(\n orderEntity,\n ['pending', 'confirmed', 'processing', 'shipped', 'delivered', 'cancelled', 'refunded'],\n {\n displayName: 'Order Status',\n description: 'Current status of the order',\n }\n )\n\n const subtotal = addCurrencyAmountField(orderEntity, 'subtotal', 'Subtotal', {\n description: 'Order subtotal before taxes and shipping',\n })\n\n const taxAmount = addCurrencyAmountField(orderEntity, 'taxAmount', 'Tax Amount', {\n description: 'Total tax amount',\n })\n\n const shippingAmount = addCurrencyAmountField(orderEntity, 'shippingAmount', 'Shipping Amount', {\n description: 'Shipping cost',\n })\n\n orderEntity.addProperty({\n info: { name: 'total_amount', displayName: 'Total Amount', description: 'Final order total' },\n type: 'number',\n required: true,\n semantics: [\n createCurrencySemantic({\n storageFormat: 'integer_cents',\n defaultCurrency: 'USD',\n decimalPlaces: 2,\n allowNegative: false,\n }),\n createCalculatedSemantic({\n formula: '{{subtotal}} + {{taxAmount}} + {{shippingAmount}}',\n dependencies: [subtotal.key, taxAmount.key, shippingAmount.key],\n recalculateOnUpdate: true,\n }),\n ],\n })\n\n orderEntity.addProperty({\n info: { name: 'notes', displayName: 'Order Notes', description: 'Customer notes or special instructions' },\n type: 'string',\n })\n\n addCreatedAtField(orderEntity, { description: 'When the order was created' })\n addUpdatedAtField(orderEntity, { description: 'When the order was last updated' })\n\n // Order-User Association (Many-to-One)\n orderEntity.addAssociation(\n { key: userEntity.key },\n {\n info: { name: 'customer', displayName: 'Customer', description: 'Customer who placed this order' },\n required: true,\n multiple: false,\n semantics: [{ id: SemanticType.ResourceOwnerIdentifier }],\n }\n )\n\n // Order-Address Associations (Many-to-One)\n orderEntity.addAssociation(\n { key: addressEntity.key },\n {\n info: { name: 'shipping_address', displayName: 'Shipping Address', description: 'Address for order delivery' },\n required: true,\n multiple: false,\n }\n )\n\n orderEntity.addAssociation(\n { key: addressEntity.key },\n {\n info: { name: 'billing_address', displayName: 'Billing Address', description: 'Address for billing purposes' },\n required: true,\n multiple: false,\n }\n )\n\n // Order Line Item Entity\n const orderItemEntity = orderModel.addEntity({\n info: {\n name: 'order_item',\n displayName: 'Order Line Item',\n description: 'Individual line items in an order',\n },\n })\n\n addIdField(orderItemEntity, { displayName: 'Order Item ID', description: 'Unique identifier for the order item' })\n\n const quantity = addQuantityField(orderItemEntity, { description: 'Number of items ordered' })\n quantity.schema = { minimum: 1 }\n\n const unitPrice = addUnitPriceField(orderItemEntity, { description: 'Price per unit at time of order' })\n\n orderItemEntity.addProperty({\n info: { name: 'total_price', displayName: 'Total Price', description: 'Total price for this line item' },\n type: 'number',\n required: true,\n readOnly: true,\n semantics: [\n createCurrencySemantic({\n storageFormat: 'integer_cents',\n defaultCurrency: 'USD',\n decimalPlaces: 2,\n allowNegative: false,\n }),\n createCalculatedSemantic({\n formula: '{{quantity}} * {{unitPrice}}',\n dependencies: [quantity.key, unitPrice.key],\n recalculateOnUpdate: true,\n }),\n ],\n })\n\n // orderItemEntity.addProperty({\n // info: {\n // name: 'productSnapshot',\n // displayName: 'Product Snapshot',\n // description: 'Snapshot of product data at time of order',\n // },\n // type: 'object',\n // required: true,\n // readOnly: true,\n // })\n\n // Order-OrderItem Association (One-to-Many)\n orderEntity.addAssociation(\n { key: orderItemEntity.key },\n {\n info: { name: 'items', displayName: 'Order Items', description: 'Items in this order' },\n required: true,\n multiple: true,\n onDelete: 'cascade',\n }\n )\n\n // OrderItem-Product Association (Many-to-One)\n orderItemEntity.addAssociation(\n { key: productEntity.key },\n {\n info: { name: 'product', displayName: 'Product', description: 'Product for this order item' },\n required: true,\n multiple: false,\n }\n )\n\n // Payment Model\n const paymentModel = orderManagement.addModel({\n info: {\n name: 'Payments',\n displayName: 'Payment Processing',\n description: 'Payment methods and transactions',\n },\n })\n\n // Payment Entity\n const paymentEntity = paymentModel.addEntity({\n info: {\n name: 'payment',\n displayName: 'Payment',\n description: 'Payment transaction record',\n },\n })\n\n addIdField(paymentEntity, { displayName: 'Payment ID', description: 'Unique identifier for the payment' })\n\n paymentEntity.addProperty({\n info: { name: 'method', displayName: 'Payment Method', description: 'Method used for payment' },\n type: 'string',\n required: true,\n schema: {\n enum: ['credit_card', 'debit_card', 'paypal', 'bank_transfer', 'apple_pay', 'google_pay'],\n },\n })\n\n addCustomStatusField(paymentEntity, ['pending', 'authorized', 'captured', 'failed', 'cancelled', 'refunded'], {\n displayName: 'Payment Status',\n description: 'Current status of the payment',\n })\n\n addCurrencyAmountField(paymentEntity, 'amount', 'Payment Amount', { description: 'Amount charged' })\n\n paymentEntity.addProperty({\n info: { name: 'currency', displayName: 'Currency', description: 'Currency code for the payment' },\n type: 'string',\n required: true,\n schema: {\n defaultValue: {\n type: 'literal',\n value: 'USD',\n },\n },\n })\n\n paymentEntity.addProperty({\n info: {\n name: 'transaction_id',\n displayName: 'Transaction ID',\n description: 'External payment processor transaction ID',\n },\n type: 'string',\n })\n\n // paymentEntity.addProperty({\n // info: {\n // name: 'gatewayResponse',\n // displayName: 'Gateway Response',\n // description: 'Raw response from payment gateway',\n // },\n // type: 'object',\n // readOnly: true,\n // })\n\n addCreatedAtField(paymentEntity, { description: 'When the payment was created' })\n\n // Order-Payment Association (One-to-Many)\n orderEntity.addAssociation(\n { key: paymentEntity.key },\n {\n info: { name: 'payments', displayName: 'Order Payments', description: 'Payment transactions for this order' },\n required: false,\n multiple: true,\n onDelete: 'restrict', // Don't allow order deletion if payments exist\n }\n )\n\n return domain\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ecommerce-domain.js","sourceRoot":"","sources":["../../../../../../src/modeling/templates/verticals/business-services/ecommerce-domain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAA;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;AACvE,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,wBAAwB,EACxB,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,iCAAiC,CAAA;AAGxC,SAAS,YAAY;IACnB,OAAO,IAAI,UAAU,CAAC;QACpB,IAAI,EAAE;YACJ,IAAI,EAAE,qBAAqB;YAC3B,WAAW,EAA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;IAC9B,YAAY;IACZ,+BAA+B;IAC/B,uCAAuC;IACvC,wDAAwD;IACxD,OAAO;IACP,oBAAoB;IACpB,oBAAoB;IACpB,KAAK;IAEL,iBAAiB,CAAC,aAAa,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC,CAAA;IAEjF,0CAA0C;IAC1C,WAAW,CAAC,cAAc,CACxB,EAAE,GAAG,EAAE,aAAa,CAAC,GAAG,EAAE,EAC1B;QACE,IAAI,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,qCAAqC,EAAE;QAC7G,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,UAAU,EAAE,+CAA+C;KACtE,CACF,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["/**\n * E-Commerce Data Domain Example\n *\n * This file demonstrates how to create a comprehensive e-commerce data domain\n * using the API Client Core modeling system. It follows the business-first approach\n * and demonstrates proper use of namespaces, models, entities, properties,\n * associations, and semantic annotations.\n *\n * The example includes:\n * - User Management domain with proper authentication setup\n * - Product Catalog with categories and inventory\n * - Order Management with cart functionality and payment processing\n * - Proper semantic annotations for security, timestamps, and business logic\n * - Realistic associations between entities with proper cardinality\n *\n * @example\n * ```typescript\n * import { createEcommerceDomain } from './ecommerce-domain.js'\n *\n * const domain = createEcommerceDomain()\n * console.log('Domain created with', domain.graph.nodeCount(), 'nodes')\n * ```\n */\n\nimport { DataDomain } from '../../../DataDomain.js'\nimport { SemanticType } from '../../../Semantics.js'\nimport { createCalculatedSemantic } from '../../../definitions/Calculated.js'\nimport { createCurrencySemantic } from '../../../definitions/Currency.js'\nimport { createSummarySemantic } from '../../../definitions/Summary.js'\nimport {\n addAvatarUrlField,\n addCreatedAtField,\n addDescriptionField,\n addEmailField,\n addFirstNameField,\n addIdField,\n addLastNameField,\n addNameField,\n addPasswordField,\n addPhoneField,\n addPublicUniqueNameField,\n addUpdatedAtField,\n addSkuField,\n addPriceField,\n addQuantityField,\n addWeightField,\n addImagesField,\n addCustomStatusField,\n addBooleanField,\n addSessionIdField,\n addExpiresAtField,\n addUnitPriceField,\n addCurrencyAmountField,\n} from '../../../helpers/Intelisense.js'\nimport type { CreateTemplateOptions } from '../../types.js'\n\nfunction createDomain(): DataDomain {\n return new DataDomain({\n info: {\n name: 'E-Commerce Platform',\n displayName: 'E-Commerce Platform',\n description:\n 'A comprehensive e-commerce platform with user management, product catalog, and order processing capabilities',\n },\n })\n}\n\n/**\n * Creates a comprehensive e-commerce data domain following domain-driven design principles.\n *\n * This function demonstrates the proper hierarchy and organization for a business domain:\n * 1. Creates the root DataDomain\n * 2. Organizes functionality into logical namespaces (User Management, Product Catalog, etc.)\n * 3. Groups related entities into models within each namespace\n * 4. Defines entities with proper semantic annotations\n * 5. Establishes associations with appropriate cardinality and business rules\n *\n * @returns A fully configured DataDomain with all e-commerce entities and relationships\n */\nexport default function createEcommerceDomain(options: CreateTemplateOptions = {}): DataDomain {\n // Ensure the root data domain\n const domain = options.domain ?? createDomain()\n\n //\n // 1. USER MANAGEMENT NAMESPACE\n //\n const userManagement = domain.addNamespace({\n info: {\n name: 'UserManagement',\n displayName: 'User Management',\n description: 'Handles user authentication, authorization, and profile management',\n },\n })\n\n // User Authentication Model\n const authModel = userManagement.addModel({\n info: {\n name: 'Authentication',\n displayName: 'User Authentication',\n description: 'User accounts and authentication data',\n },\n })\n\n // User Entity - The core user account\n const userEntity = authModel.addEntity({\n info: {\n name: 'User',\n displayName: 'User Account',\n description: 'Represents a user account in the system',\n },\n semantics: [{ id: SemanticType.User }], // Mark this as a User entity for system-wide recognition\n })\n\n // User properties with proper semantic annotations\n addIdField(userEntity, { displayName: 'User ID', description: 'Unique identifier for the user' })\n addEmailField(userEntity, { description: 'User email address for login and communication' })\n addPasswordField(userEntity, { description: 'User password for authentication' })\n\n const fName = addFirstNameField(userEntity, { description: 'User first name' })\n fName.required = true\n\n const lName = addLastNameField(userEntity, { description: 'User last name' })\n lName.required = true\n\n userEntity.addProperty({\n info: { name: 'role', displayName: 'User Role', description: 'User role for permission management' },\n type: 'string',\n required: true,\n schema: {\n enum: ['customer', 'admin', 'moderator'],\n defaultValue: {\n type: 'literal',\n value: 'customer',\n },\n },\n semantics: [{ id: SemanticType.UserRole }],\n })\n\n userEntity.addProperty({\n info: {\n name: 'email_verified',\n displayName: 'Email Verified',\n description: 'Whether the user has verified their email address',\n },\n type: 'boolean',\n required: true,\n schema: {\n defaultValue: {\n type: 'literal',\n value: 'false',\n },\n },\n })\n\n addCreatedAtField(userEntity, { description: 'When the user account was created' })\n addUpdatedAtField(userEntity, { description: 'When the user account was last updated' })\n\n // User Profile Model\n const profileModel = userManagement.addModel({\n info: {\n name: 'UserProfile',\n displayName: 'User Profile',\n description: 'Extended user profile information',\n },\n })\n\n // User Profile Entity\n const userProfileEntity = profileModel.addEntity({\n info: {\n name: 'user_profile',\n displayName: 'User Profile',\n description: 'Extended profile information for users',\n },\n })\n\n addIdField(userProfileEntity, { displayName: 'Profile ID', description: 'Unique identifier for the profile' })\n\n userProfileEntity.addProperty({\n info: { name: 'birthdate', displayName: 'Date of Birth', description: 'User date of birth' },\n type: 'date',\n })\n\n addPhoneField(userProfileEntity, { description: 'User phone number' })\n addAvatarUrlField(userProfileEntity, { description: 'URL to user profile picture' })\n\n // User-Profile Association (One-to-One), not required for registration flows.\n userEntity.addAssociation(\n { key: userProfileEntity.key },\n {\n info: { name: 'profile', displayName: 'User Profile', description: 'Link to extended profile information' },\n required: false,\n multiple: false,\n }\n )\n\n // Address Entity\n const addressEntity = profileModel.addEntity({\n info: {\n name: 'address',\n displayName: 'Address',\n description: 'Physical address information',\n },\n })\n\n addIdField(addressEntity, { displayName: 'Address ID', description: 'Unique identifier for the address' })\n\n addressEntity.addProperty({\n info: { name: 'type', displayName: 'Address Type', description: 'Type of address (shipping, billing, etc.)' },\n type: 'string',\n required: true,\n schema: {\n enum: ['shipping', 'billing', 'both'],\n },\n })\n\n addressEntity.addProperty({\n info: {\n name: 'line1',\n displayName: 'Address Line 1',\n description: 'Primary street address, including house number and street name',\n },\n type: 'string',\n required: true,\n })\n\n addressEntity.addProperty({\n info: {\n name: 'line2',\n displayName: 'Address Line 2',\n description: 'Optional field for additional street-level information like apartment numbers or building names.',\n },\n type: 'string',\n required: false,\n })\n\n addressEntity.addProperty({\n info: {\n name: 'line3',\n displayName: 'Address Line 3',\n description: 'Optional field for additional street-level information like apartment numbers or building names.',\n },\n type: 'string',\n required: false,\n })\n\n addressEntity.addProperty({\n info: { name: 'city', displayName: 'City', description: 'City name' },\n type: 'string',\n required: true,\n })\n\n addressEntity.addProperty({\n info: { name: 'state', displayName: 'State/Province', description: 'State or province' },\n type: 'string',\n required: true,\n })\n\n addressEntity.addProperty({\n info: { name: 'postal_code', displayName: 'ZIP/Postal Code', description: 'ZIP or postal code' },\n type: 'string',\n required: true,\n })\n\n addressEntity.addProperty({\n info: { name: 'country', displayName: 'Country', description: 'Country name' },\n type: 'string',\n required: true,\n })\n\n // User-Address Association (One-to-Many)\n userEntity.addAssociation(\n { key: addressEntity.key },\n {\n info: { name: 'addresses', displayName: 'User Addresses', description: 'User shipping and billing addresses' },\n required: false,\n multiple: true,\n }\n )\n\n //\n // 2. PRODUCT CATALOG NAMESPACE\n //\n const productCatalog = domain.addNamespace({\n info: {\n name: 'ProductCatalog',\n displayName: 'Product Catalog',\n description: 'Product information, categories, and inventory management',\n },\n })\n\n // Product Management Model\n const productModel = productCatalog.addModel({\n info: {\n name: 'Products',\n displayName: 'Product Management',\n description: 'Core product entities and relationships',\n },\n })\n\n // Category Entity\n const categoryEntity = productModel.addEntity({\n info: {\n name: 'category',\n displayName: 'Product Category',\n description: 'Product categorization for organization and navigation',\n },\n })\n addIdField(categoryEntity, { displayName: 'Category ID', description: 'Unique identifier for the category' })\n addNameField(categoryEntity, { displayName: 'Category Name', description: 'Display name of the category' })\n addPublicUniqueNameField(categoryEntity, {\n displayName: 'URL Slug',\n description: 'URL-friendly identifier for the category',\n })\n addDescriptionField(categoryEntity, { description: 'Category description' })\n\n // Self-referencing association for category hierarchy\n categoryEntity.addAssociation(\n { key: categoryEntity.key },\n {\n info: {\n name: 'parent_category',\n displayName: 'Parent Category',\n description: 'Parent category for hierarchical organization',\n },\n required: false,\n multiple: false,\n }\n )\n\n // Product Entity\n const productEntity = productModel.addEntity({\n info: {\n name: 'product',\n displayName: 'Product',\n description: 'Core product information and specifications',\n },\n })\n\n addIdField(productEntity, { displayName: 'Product ID', description: 'Unique identifier for the product' })\n addNameField(productEntity, { displayName: 'Product Name', description: 'Display name of the product' })\n addPublicUniqueNameField(productEntity, {\n displayName: 'URL Slug',\n description: 'URL-friendly identifier for the product',\n })\n addDescriptionField(productEntity, { description: 'Detailed product description' })\n\n productEntity.addProperty({\n info: { name: 'short_description', displayName: 'Short Description', description: 'Brief product summary' },\n type: 'string',\n semantics: [createSummarySemantic()],\n })\n\n addSkuField(productEntity, { description: 'Stock Keeping Unit - unique product identifier' })\n\n addPriceField(productEntity, { description: 'Product price in cents (USD)' })\n\n productEntity.addProperty({\n info: {\n name: 'compare_at_price',\n displayName: 'Compare at Price',\n description: 'Original price for discount display',\n },\n type: 'number',\n schema: {\n maximum: 0,\n },\n bindings: [\n {\n type: 'web',\n schema: {\n dataType: 'float',\n },\n },\n ],\n semantics: [\n createCurrencySemantic({\n storageFormat: 'integer_cents',\n defaultCurrency: 'USD',\n decimalPlaces: 2,\n allowNegative: false,\n validateCurrencyCode: true,\n }),\n ],\n })\n\n addCustomStatusField(productEntity, ['inactive', 'active', 'pending', 'archived'], {\n description: 'Current status of the product',\n })\n\n addWeightField(productEntity, { description: 'Product weight in grams' })\n\n addImagesField(productEntity, { description: 'Array of product image URLs' })\n\n addCreatedAtField(productEntity, { description: 'When the product was created' })\n addUpdatedAtField(productEntity, { description: 'When the product was last updated' })\n\n // Product-Category Association (Many-to-Many)\n productEntity.addAssociation(\n { key: categoryEntity.key },\n {\n info: {\n name: 'categories',\n displayName: 'Product Categories',\n description: 'Categories this product belongs to',\n },\n required: true,\n multiple: true,\n semantics: [{ id: SemanticType.Categories }],\n }\n )\n\n // Inventory Model\n const inventoryModel = productCatalog.addModel({\n info: {\n name: 'Inventory',\n displayName: 'Inventory Management',\n description: 'Stock levels and inventory tracking',\n },\n })\n\n // Inventory Entity\n const inventoryEntity = inventoryModel.addEntity({\n info: {\n name: 'inventory',\n displayName: 'Inventory',\n description: 'Stock levels and inventory information for products',\n },\n })\n\n addIdField(inventoryEntity, {\n displayName: 'Inventory ID',\n description: 'Unique identifier for the inventory record',\n })\n\n addQuantityField(inventoryEntity, { displayName: 'Stock Quantity', description: 'Available stock quantity' })\n\n const reservedQty = addQuantityField(inventoryEntity, {\n name: 'reserved_quantity',\n displayName: 'Reserved Quantity',\n description: 'Quantity reserved for pending orders',\n })\n reservedQty.schema = {\n defaultValue: {\n type: 'literal',\n value: '0',\n },\n minimum: 0,\n }\n\n addBooleanField(inventoryEntity, 'trackQuantity', 'true', {\n displayName: 'Track Quantity',\n description: 'Whether to track inventory for this product',\n })\n\n addBooleanField(inventoryEntity, 'allowBackorder', 'false', {\n displayName: 'Allow Backorder',\n description: 'Whether to allow ordering when out of stock',\n })\n\n // Product-Inventory Association (One-to-One)\n productEntity.addAssociation(\n { key: inventoryEntity.key },\n {\n info: {\n name: 'inventory',\n displayName: 'Product Inventory',\n description: 'Inventory information for this product',\n },\n required: true,\n multiple: false,\n }\n )\n\n //\n // 3. ORDER MANAGEMENT NAMESPACE\n //\n const orderManagement = domain.addNamespace({\n info: {\n name: 'OrderManagement',\n displayName: 'Order Management',\n description: 'Shopping cart, orders, and payment processing',\n },\n })\n\n // Shopping Cart Model\n const cartModel = orderManagement.addModel({\n info: {\n name: 'ShoppingCart',\n displayName: 'Shopping Cart',\n description: 'Shopping cart and cart items',\n },\n })\n\n // Cart Entity\n const cartEntity = cartModel.addEntity({\n info: {\n name: 'cart',\n displayName: 'Shopping Cart',\n description: 'User shopping cart',\n },\n })\n\n addIdField(cartEntity, { displayName: 'Cart ID', description: 'Unique identifier for the cart' })\n\n addSessionIdField(cartEntity, { description: 'Session identifier for guest carts' })\n\n addExpiresAtField(cartEntity, { description: 'When the cart expires for cleanup' })\n\n addCreatedAtField(cartEntity, { description: 'When the cart was created' })\n addUpdatedAtField(cartEntity, { description: 'When the cart was last updated' })\n\n // Cart-User Association (Many-to-One)\n cartEntity.addAssociation(\n { key: userEntity.key },\n {\n info: { name: 'user', displayName: 'Cart Owner', description: 'User who owns this cart' },\n required: false,\n multiple: false,\n semantics: [{ id: SemanticType.ResourceOwnerIdentifier }],\n }\n )\n\n // Cart Item Entity\n const cartItemEntity = cartModel.addEntity({\n info: {\n name: 'cart_item',\n displayName: 'Cart Item',\n description: 'Individual items in a shopping cart',\n },\n })\n\n addIdField(cartItemEntity, { displayName: 'Cart Item ID', description: 'Unique identifier for the cart item' })\n\n const cartItemQuantity = addQuantityField(cartItemEntity, { description: 'Number of items' })\n cartItemQuantity.schema = { minimum: 1 }\n\n const cartUnitPrice = addUnitPriceField(cartItemEntity, { description: 'Price per unit at time of adding to cart' })\n\n cartItemEntity.addProperty({\n info: { name: 'total_price', displayName: 'Total Price', description: 'Total price for this line item' },\n type: 'number',\n required: true,\n readOnly: true,\n semantics: [\n createCurrencySemantic({\n storageFormat: 'integer_cents',\n defaultCurrency: 'USD',\n decimalPlaces: 2,\n allowNegative: false,\n }),\n createCalculatedSemantic({\n formula: `{{${cartUnitPrice.key}}} * {{${cartItemQuantity.key}}}`,\n dependencies: [cartUnitPrice.key, cartItemQuantity.key],\n recalculateOnUpdate: true,\n }),\n ],\n })\n\n // Cart-CartItem Association (One-to-Many)\n cartEntity.addAssociation(\n { key: cartItemEntity.key },\n {\n info: { name: 'items', displayName: 'Cart Items', description: 'Items in this cart' },\n required: false,\n multiple: true,\n onDelete: 'cascade',\n }\n )\n\n // CartItem-Product Association (Many-to-One)\n cartItemEntity.addAssociation(\n { key: productEntity.key },\n {\n info: { name: 'product', displayName: 'Product', description: 'Product for this cart item' },\n required: true,\n multiple: false,\n }\n )\n\n // Order Processing Model\n const orderModel = orderManagement.addModel({\n info: {\n name: 'Orders',\n displayName: 'Order Processing',\n description: 'Orders and order fulfillment',\n },\n })\n\n // Order Entity\n const orderEntity = orderModel.addEntity({\n info: {\n name: 'order',\n displayName: 'Order',\n description: 'Customer order',\n },\n })\n\n addIdField(orderEntity, { displayName: 'Order ID', description: 'Unique identifier for the order' })\n\n orderEntity.addProperty({\n info: { name: 'order_number', displayName: 'Order Number', description: 'Human-readable order number' },\n type: 'string',\n required: true,\n unique: true,\n })\n\n addCustomStatusField(\n orderEntity,\n ['pending', 'confirmed', 'processing', 'shipped', 'delivered', 'cancelled', 'refunded'],\n {\n displayName: 'Order Status',\n description: 'Current status of the order',\n }\n )\n\n const subtotal = addCurrencyAmountField(orderEntity, 'subtotal', 'Subtotal', {\n description: 'Order subtotal before taxes and shipping',\n })\n\n const taxAmount = addCurrencyAmountField(orderEntity, 'taxAmount', 'Tax Amount', {\n description: 'Total tax amount',\n })\n\n const shippingAmount = addCurrencyAmountField(orderEntity, 'shippingAmount', 'Shipping Amount', {\n description: 'Shipping cost',\n })\n\n orderEntity.addProperty({\n info: { name: 'total_amount', displayName: 'Total Amount', description: 'Final order total' },\n type: 'number',\n required: true,\n semantics: [\n createCurrencySemantic({\n storageFormat: 'integer_cents',\n defaultCurrency: 'USD',\n decimalPlaces: 2,\n allowNegative: false,\n }),\n createCalculatedSemantic({\n formula: `{{${subtotal.key}}} + {{${taxAmount.key}}} + {{${shippingAmount.key}}}`,\n dependencies: [subtotal.key, taxAmount.key, shippingAmount.key],\n recalculateOnUpdate: true,\n }),\n ],\n })\n\n orderEntity.addProperty({\n info: { name: 'notes', displayName: 'Order Notes', description: 'Customer notes or special instructions' },\n type: 'string',\n })\n\n addCreatedAtField(orderEntity, { description: 'When the order was created' })\n addUpdatedAtField(orderEntity, { description: 'When the order was last updated' })\n\n // Order-User Association (Many-to-One)\n orderEntity.addAssociation(\n { key: userEntity.key },\n {\n info: { name: 'customer', displayName: 'Customer', description: 'Customer who placed this order' },\n required: true,\n multiple: false,\n semantics: [{ id: SemanticType.ResourceOwnerIdentifier }],\n }\n )\n\n // Order-Address Associations (Many-to-One)\n orderEntity.addAssociation(\n { key: addressEntity.key },\n {\n info: { name: 'shipping_address', displayName: 'Shipping Address', description: 'Address for order delivery' },\n required: true,\n multiple: false,\n }\n )\n\n orderEntity.addAssociation(\n { key: addressEntity.key },\n {\n info: { name: 'billing_address', displayName: 'Billing Address', description: 'Address for billing purposes' },\n required: true,\n multiple: false,\n }\n )\n\n // Order Line Item Entity\n const orderItemEntity = orderModel.addEntity({\n info: {\n name: 'order_item',\n displayName: 'Order Line Item',\n description: 'Individual line items in an order',\n },\n })\n\n addIdField(orderItemEntity, { displayName: 'Order Item ID', description: 'Unique identifier for the order item' })\n\n const quantity = addQuantityField(orderItemEntity, { description: 'Number of items ordered' })\n quantity.schema = { minimum: 1 }\n\n const unitPrice = addUnitPriceField(orderItemEntity, { description: 'Price per unit at time of order' })\n\n orderItemEntity.addProperty({\n info: { name: 'total_price', displayName: 'Total Price', description: 'Total price for this line item' },\n type: 'number',\n required: true,\n readOnly: true,\n semantics: [\n createCurrencySemantic({\n storageFormat: 'integer_cents',\n defaultCurrency: 'USD',\n decimalPlaces: 2,\n allowNegative: false,\n }),\n createCalculatedSemantic({\n formula: `{{${quantity.key}}} * {{${unitPrice.key}}}`,\n dependencies: [quantity.key, unitPrice.key],\n recalculateOnUpdate: true,\n }),\n ],\n })\n\n // orderItemEntity.addProperty({\n // info: {\n // name: 'productSnapshot',\n // displayName: 'Product Snapshot',\n // description: 'Snapshot of product data at time of order',\n // },\n // type: 'object',\n // required: true,\n // readOnly: true,\n // })\n\n // Order-OrderItem Association (One-to-Many)\n orderEntity.addAssociation(\n { key: orderItemEntity.key },\n {\n info: { name: 'items', displayName: 'Order Items', description: 'Items in this order' },\n required: true,\n multiple: true,\n onDelete: 'cascade',\n }\n )\n\n // OrderItem-Product Association (Many-to-One)\n orderItemEntity.addAssociation(\n { key: productEntity.key },\n {\n info: { name: 'product', displayName: 'Product', description: 'Product for this order item' },\n required: true,\n multiple: false,\n }\n )\n\n // Payment Model\n const paymentModel = orderManagement.addModel({\n info: {\n name: 'Payments',\n displayName: 'Payment Processing',\n description: 'Payment methods and transactions',\n },\n })\n\n // Payment Entity\n const paymentEntity = paymentModel.addEntity({\n info: {\n name: 'payment',\n displayName: 'Payment',\n description: 'Payment transaction record',\n },\n })\n\n addIdField(paymentEntity, { displayName: 'Payment ID', description: 'Unique identifier for the payment' })\n\n paymentEntity.addProperty({\n info: { name: 'method', displayName: 'Payment Method', description: 'Method used for payment' },\n type: 'string',\n required: true,\n schema: {\n enum: ['credit_card', 'debit_card', 'paypal', 'bank_transfer', 'apple_pay', 'google_pay'],\n },\n })\n\n addCustomStatusField(paymentEntity, ['pending', 'authorized', 'captured', 'failed', 'cancelled', 'refunded'], {\n displayName: 'Payment Status',\n description: 'Current status of the payment',\n })\n\n addCurrencyAmountField(paymentEntity, 'amount', 'Payment Amount', { description: 'Amount charged' })\n\n paymentEntity.addProperty({\n info: { name: 'currency', displayName: 'Currency', description: 'Currency code for the payment' },\n type: 'string',\n required: true,\n schema: {\n defaultValue: {\n type: 'literal',\n value: 'USD',\n },\n },\n })\n\n paymentEntity.addProperty({\n info: {\n name: 'transaction_id',\n displayName: 'Transaction ID',\n description: 'External payment processor transaction ID',\n },\n type: 'string',\n })\n\n // paymentEntity.addProperty({\n // info: {\n // name: 'gatewayResponse',\n // displayName: 'Gateway Response',\n // description: 'Raw response from payment gateway',\n // },\n // type: 'object',\n // readOnly: true,\n // })\n\n addCreatedAtField(paymentEntity, { description: 'When the payment was created' })\n\n // Order-Payment Association (One-to-Many)\n orderEntity.addAssociation(\n { key: paymentEntity.key },\n {\n info: { name: 'payments', displayName: 'Order Payments', description: 'Payment transactions for this order' },\n required: false,\n multiple: true,\n onDelete: 'restrict', // Don't allow order deletion if payments exist\n }\n )\n\n return domain\n}\n"]}
|
|
@@ -191,7 +191,7 @@ export default function createBlogDomain(options = {}) {
|
|
|
191
191
|
type: 'string',
|
|
192
192
|
semantics: [{ id: SemanticType.Summary }],
|
|
193
193
|
});
|
|
194
|
-
postEntity.addProperty({
|
|
194
|
+
const postContent = postEntity.addProperty({
|
|
195
195
|
info: { name: 'content', displayName: 'Content', description: 'Full content of the post in HTML or Markdown' },
|
|
196
196
|
type: 'string',
|
|
197
197
|
required: true,
|
|
@@ -243,8 +243,8 @@ export default function createBlogDomain(options = {}) {
|
|
|
243
243
|
readOnly: true,
|
|
244
244
|
semantics: [
|
|
245
245
|
createCalculatedSemantic({
|
|
246
|
-
formula:
|
|
247
|
-
dependencies: [],
|
|
246
|
+
formula: `CEIL(LENGTH(REPLACE({{${postContent.key}}}, " ", "")) / 250)`,
|
|
247
|
+
dependencies: [postContent.key],
|
|
248
248
|
recalculateOnUpdate: true,
|
|
249
249
|
}),
|
|
250
250
|
],
|
|
@@ -255,8 +255,8 @@ export default function createBlogDomain(options = {}) {
|
|
|
255
255
|
readOnly: true,
|
|
256
256
|
semantics: [
|
|
257
257
|
createCalculatedSemantic({
|
|
258
|
-
formula:
|
|
259
|
-
dependencies: [],
|
|
258
|
+
formula: `LENGTH({{${postContent.key}}}) - LENGTH(REPLACE({{${postContent.key}}}, " ", "")) + 1`,
|
|
259
|
+
dependencies: [postContent.key],
|
|
260
260
|
recalculateOnUpdate: true,
|
|
261
261
|
}),
|
|
262
262
|
],
|