@api-client/core 0.18.20 → 0.18.22
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/helpers/Intelisense.d.ts +1 -0
- package/build/src/modeling/helpers/Intelisense.d.ts.map +1 -1
- package/build/src/modeling/helpers/Intelisense.js +1 -0
- package/build/src/modeling/helpers/Intelisense.js.map +1 -1
- package/build/src/modeling/templates/index.d.ts +21 -0
- package/build/src/modeling/templates/index.d.ts.map +1 -0
- package/build/src/modeling/templates/index.js +176 -0
- package/build/src/modeling/templates/index.js.map +1 -0
- package/build/src/modeling/templates/meta/blog-publishing-platform.json +1 -0
- package/build/src/modeling/templates/meta/ecommerce-platform.json +1 -0
- package/build/src/modeling/templates/meta/education-management-platform.json +1 -0
- package/build/src/modeling/templates/meta/financial-services-platform.json +1 -0
- package/build/src/modeling/templates/meta/gaming-platform.json +1 -0
- package/build/src/modeling/templates/meta/healthcare-management-platform.json +1 -0
- package/build/src/modeling/templates/meta/hospitality-platform.json +1 -0
- package/build/src/modeling/templates/meta/index.d.ts +56 -0
- package/build/src/modeling/templates/meta/index.d.ts.map +1 -0
- package/build/src/modeling/templates/meta/index.js +120 -0
- package/build/src/modeling/templates/meta/index.js.map +1 -0
- package/build/src/modeling/templates/meta/iot-smart-home-platform.json +1 -0
- package/build/src/modeling/templates/meta/legal-services-platform.json +1 -0
- package/build/src/modeling/templates/meta/manufacturing-platform.json +1 -0
- package/build/src/modeling/templates/meta/non-profit-platform.json +1 -0
- package/build/src/modeling/templates/meta/real-estate-management-platform.json +1 -0
- package/build/src/modeling/templates/template-registry.d.ts +55 -0
- package/build/src/modeling/templates/template-registry.d.ts.map +1 -0
- package/build/src/modeling/templates/template-registry.js +111 -0
- package/build/src/modeling/templates/template-registry.js.map +1 -0
- package/build/src/modeling/templates/types.d.ts +158 -0
- package/build/src/modeling/templates/types.d.ts.map +1 -1
- package/build/src/modeling/templates/types.js.map +1 -1
- package/build/src/modeling/templates/{ecommerce-domain.d.ts → verticals/business-services/ecommerce-domain.d.ts} +2 -2
- package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/{ecommerce-domain.js → verticals/business-services/ecommerce-domain.js} +6 -6
- package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.d.ts +40 -0
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js +744 -0
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.d.ts +45 -0
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.js +797 -0
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/index.d.ts +21 -0
- package/build/src/modeling/templates/verticals/business-services/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/index.js +50 -0
- package/build/src/modeling/templates/verticals/business-services/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.d.ts +46 -0
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.js +837 -0
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/education-training/education-domain.d.ts +40 -0
- package/build/src/modeling/templates/verticals/education-training/education-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/education-training/education-domain.js +725 -0
- package/build/src/modeling/templates/verticals/education-training/education-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/education-training/index.d.ts +18 -0
- package/build/src/modeling/templates/verticals/education-training/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/education-training/index.js +21 -0
- package/build/src/modeling/templates/verticals/education-training/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.d.ts +40 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.js +859 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.d.ts +18 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.js +21 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/index.d.ts +79 -0
- package/build/src/modeling/templates/verticals/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/index.js +186 -0
- package/build/src/modeling/templates/verticals/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.d.ts +18 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.js +22 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.d.ts +45 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.js +710 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/public-sector/index.d.ts +18 -0
- package/build/src/modeling/templates/verticals/public-sector/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/public-sector/index.js +22 -0
- package/build/src/modeling/templates/verticals/public-sector/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.d.ts +47 -0
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.js +864 -0
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/index.d.ts +18 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/index.js +21 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.d.ts +40 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.js +727 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.js.map +1 -0
- package/build/src/modeling/templates/{blog-domain.d.ts → verticals/technology-media/blog-domain.d.ts} +2 -2
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/{blog-domain.js → verticals/technology-media/blog-domain.js} +5 -5
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.d.ts +46 -0
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.js +1033 -0
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/technology-media/index.d.ts +21 -0
- package/build/src/modeling/templates/verticals/technology-media/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/technology-media/index.js +42 -0
- package/build/src/modeling/templates/verticals/technology-media/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.d.ts +47 -0
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js +1027 -0
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/example-generator-api.json +6 -6
- package/package.json +1 -1
- package/src/modeling/helpers/Intelisense.ts +1 -0
- package/src/modeling/templates/meta/blog-publishing-platform.json +1 -0
- package/src/modeling/templates/meta/ecommerce-platform.json +1 -0
- package/src/modeling/templates/meta/education-management-platform.json +1 -0
- package/src/modeling/templates/meta/financial-services-platform.json +1 -0
- package/src/modeling/templates/meta/gaming-platform.json +1 -0
- package/src/modeling/templates/meta/healthcare-management-platform.json +1 -0
- package/src/modeling/templates/meta/hospitality-platform.json +1 -0
- package/src/modeling/templates/meta/iot-smart-home-platform.json +1 -0
- package/src/modeling/templates/meta/legal-services-platform.json +1 -0
- package/src/modeling/templates/meta/manufacturing-platform.json +1 -0
- package/src/modeling/templates/meta/non-profit-platform.json +1 -0
- package/src/modeling/templates/meta/real-estate-management-platform.json +1 -0
- package/src/modeling/templates/readme.md +260 -0
- package/src/modeling/templates/template-registry.ts +140 -0
- package/src/modeling/templates/types.ts +166 -0
- package/src/modeling/templates/verticals/README.md +122 -0
- package/src/modeling/templates/{ecommerce-domain.ts → verticals/business-services/ecommerce-domain.ts} +7 -7
- package/src/modeling/templates/verticals/business-services/financial-services-domain.ts +943 -0
- package/src/modeling/templates/verticals/business-services/hospitality-domain.ts +994 -0
- package/src/modeling/templates/verticals/business-services/legal-services-domain.ts +1059 -0
- package/src/modeling/templates/verticals/education-training/education-domain.ts +922 -0
- package/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.ts +1111 -0
- package/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.ts +895 -0
- package/src/modeling/templates/verticals/public-sector/non-profit-domain.ts +1109 -0
- package/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.ts +944 -0
- package/src/modeling/templates/{blog-domain.ts → verticals/technology-media/blog-domain.ts} +6 -6
- package/src/modeling/templates/verticals/technology-media/gaming-domain.ts +1290 -0
- package/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.ts +1287 -0
- package/build/src/modeling/templates/blog-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/blog-domain.js.map +0 -1
- package/build/src/modeling/templates/ecommerce-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/ecommerce-domain.js.map +0 -1
|
@@ -384,6 +384,7 @@ export declare function addWeightField(entity: DomainEntity, info?: Partial<IThi
|
|
|
384
384
|
export declare function addImagesField(entity: DomainEntity, info?: Partial<IThing>): DomainProperty;
|
|
385
385
|
/**
|
|
386
386
|
* Adds a status field with custom enum values to the specified entity.
|
|
387
|
+
* This is not a regular enum field, it should represent a record status.
|
|
387
388
|
* If a status field already exists, it returns the existing field.
|
|
388
389
|
* Otherwise, it creates a new status field with provided enum values.
|
|
389
390
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Intelisense.d.ts","sourceRoot":"","sources":["../../../../src/modeling/helpers/Intelisense.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAWnD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,aAAa,CAyDnF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,GAAE,OAAO,CAAC,MAAM,CAAM,GAAG,aAAa,CAiB1F;AAED;;;;;;GAMG;AACH,wBAAgB,aAA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0LD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,EAAE,CA4B1E"}
|
|
@@ -813,6 +813,7 @@ export function addImagesField(entity, info = {}) {
|
|
|
813
813
|
}
|
|
814
814
|
/**
|
|
815
815
|
* Adds a status field with custom enum values to the specified entity.
|
|
816
|
+
* This is not a regular enum field, it should represent a record status.
|
|
816
817
|
* If a status field already exists, it returns the existing field.
|
|
817
818
|
* Otherwise, it creates a new status field with provided enum values.
|
|
818
819
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Intelisense.js","sourceRoot":"","sources":["../../../../src/modeling/helpers/Intelisense.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,8BAA8B,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAA;AACtH,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAA;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnD;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,MAAoB,EAAE,SAAiB;IAClE,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,IAAI;YACP,OAAO,UAAU,CAAC,MAAM,CAAC,CAAA;QAC3B,KAAK,OAAO;YACV,OAAO,aAAa,CAAC,MAAM,CAAC,CAAA;QAC9B,KAAK,MAAM;YACT,OAAO,YAAY,CAAC,MAAM,CAAC,CAAA;QAC7B,KAAK,aAAa;YAChB,OAAO,mBA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,EACN,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,QAAQ,CAAC,IAAI,KAAK,UAAU,EAChF,MAAM,CACP,CAAA;AACH,CAAC","sourcesContent":["import type { DomainEntity } from '../DomainEntity.js'\nimport type { DomainElement } from '../DomainElement.js'\nimport type { DomainProperty } from '../DomainProperty.js'\nimport type { DomainAssociation } from '../DomainAssociation.js'\nimport type { IThing } from '../../models/Thing.js'\nimport { SemanticType } from '../Semantics.js'\nimport { createEmailSemantic } from '../definitions/Email.js'\nimport { createPasswordSemantic } from '../definitions/Password.js'\nimport { createPhoneSemantic } from '../definitions/Phone.js'\nimport { createPublicUniqueNameSemantic, DEFAULT_PUBLIC_UNIQUE_NAME_CONFIG } from '../definitions/PublicUniqueName.js'\nimport { createDescriptionSemantic } from '../definitions/Description.js'\nimport { createCurrencySemantic } from '../definitions/Currency.js'\nimport { createStatusSemantic } from '../definitions/Status.js'\nimport { SKU_PRESETS } from '../definitions/SKU.js'\n\n/**\n * Adds a field to the given entity that is automatically generated by the system.\n *\n * @param entity The entity to which the auto field will be added.\n * @param autoField The name of the auto field to add.\n * @returns The added DomainElement representing the auto field.\n * @throws Error if the auto field is not supported.\n */\nexport function addAutoField(entity: DomainEntity, autoField: string): DomainElement {\n switch (autoField) {\n case 'id':\n return addIdField(entity)\n case 'email':\n return addEmailField(entity)\n case 'name':\n return addNameField(entity)\n case 'description':\n return addDescriptionField(entity)\n case 'status':\n return addStatusField(entity)\n case 'version':\n return addVersionField(entity)\n case 'owner':\n return addOwnerField(entity)\n case 'created':\n return addCreatedAtField(entity)\n // case 'created-by':\n // return addCreatedByField(entity)\n case 'updated':\n return addUpdatedAtField(entity)\n case 'updated-by':\n return addUpdatedByField(entity)\n case 'is-deleted':\n return addIsDeletedField(entity)\n case 'deleted':\n return addDeletedAtField(entity)\n case 'first-name':\n return addFirstNameField(entity)\n case 'last-name':\n return addLastNameField(entity)\n case 'phone':\n return addPhoneField(entity)\n case 'avatar-url':\n return addAvatarUrlField(entity)\n case 'public-unique-name':\n return addPublicUniqueNameField(entity)\n case 'price':\n return addPriceField(entity)\n case 'sku':\n return addSkuField(entity)\n case 'quantity':\n return addQuantityField(entity)\n case 'weight':\n return addWeightField(entity)\n case 'images':\n return addImagesField(entity)\n case 'session-id':\n return addSessionIdField(entity)\n case 'expires-at':\n return addExpiresAtField(entity)\n case 'unit-price':\n return addUnitPriceField(entity)\n default:\n throw new Error(`Unsupported auto field: ${autoField}`)\n }\n}\n\n/**\n * Adds the primary field (ID) to the given entity.\n * If the ID field already exists, it returns the existing field.\n * Otherwise, it creates a new ID field with a name based on the entity's name.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'id'\n * - primary: true\n * - readOnly: true\n * - schema.defaultValue: { type: 'function', value: 'uuid-v4' }\n *\n * @param entity The entity to which the ID field will be added.\n * @returns The added primary field property.\n */\nexport function addIdField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findIdField(entity, true)\n if (existing) {\n // If the ID field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: `id`, ...info },\n primary: true,\n readOnly: true,\n // I don't think we need to index the ID field..\n // index: true,\n type: 'string',\n // @TODO: We should experiment with the random ID generation using the nano library.\n schema: { defaultValue: { type: 'function', value: 'uuid-v4' } },\n })\n return prop\n}\n\n/**\n * Adds an email field to the given entity.\n * If the email field already exists, it returns the existing field.\n * Otherwise, it creates a new email field with a semantic annotation.\n * @param entity The entity to which the email field will be added.\n * @returns The added email field property.\n */\nexport function addEmailField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findEmailField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'email', displayName: 'Email Address', ...info },\n type: 'string',\n required: true,\n index: true,\n semantics: [\n createEmailSemantic({\n requireVerification: true,\n verificationMethod: 'email',\n }),\n ],\n })\n return prop\n}\n\n/**\n * Adds a password field to the given entity.\n * If the password field already exists, it returns the existing field.\n * Otherwise, it creates a new password field with a semantic annotation.\n * @param entity The entity to which the password field will be added.\n * @param info Additional information for the password field.\n * @returns The added password field property.\n */\nexport function addPasswordField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findPasswordField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'password', displayName: 'Password', ...info },\n type: 'string',\n required: true,\n semantics: [\n createPasswordSemantic({\n requireSpecialChars: true,\n requireNumbers: true,\n requireUppercase: true,\n requireLowercase: true,\n minLength: 8,\n }),\n ],\n })\n return prop\n}\n\n/**\n * Adds a version field to the given entity.\n * @param entity The entity to which the version field will be added.\n * The version field is used to track the version of the entity.\n * @returns The added version field property.\n */\nexport function addVersionField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findVersionField(entity, true)\n if (existing) {\n // If the version field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'version', displayName: 'Version', ...info },\n readOnly: true,\n index: true,\n type: 'number',\n schema: { defaultValue: { type: 'function', value: 'incremental' }, minimum: 0 },\n })\n prop.addSemantic({\n id: SemanticType.Version,\n })\n return prop\n}\n\nexport function addNameField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findNameField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'name', displayName: 'Name', ...info },\n type: 'string',\n })\n prop.addSemantic({\n id: SemanticType.Title,\n })\n return prop\n}\n\n/**\n * Adds a description field to the specified entity.\n * If a description field already exists, it returns the existing field.\n * Otherwise, it creates a new description field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'description'\n * - info.displayName: 'Description'\n *\n * Set semantics:\n * - `SemanticType.Description`\n *\n * @param entity The entity to which the description field will be added.\n * @returns The added description field property.\n */\nexport function addDescriptionField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findDescriptionField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'description', displayName: 'Description', ...info },\n type: 'string',\n semantics: [createDescriptionSemantic()],\n })\n return prop\n}\n\n/**\n * Adds a status field to the specified entity.\n * If a status field already exists, it returns the existing field.\n * Otherwise, it creates a new status field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'status'\n * - info.displayName: 'Status'\n * - schema.enum: ['Active', 'Draft', 'Archived']\n * - schema.defaultValue: { type: 'literal', value: 'Draft' }\n *\n * Set semantics:\n * - `SemanticType.Status`\n *\n * @param entity The entity to which the status field will be added.\n * @param info Additional information about the field.\n * @returns The added status field property.\n */\nexport function addStatusField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findStatusField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'status', displayName: 'Status', ...info },\n type: 'string',\n schema: {\n enum: ['Active', 'Draft', 'Archived'],\n defaultValue: { type: 'literal', value: 'Draft' },\n },\n })\n prop.addSemantic({\n id: SemanticType.Status,\n })\n return prop\n}\n\n/**\n * Adds an owner field to the specified entity.\n * If an owner field already exists, it returns the existing field.\n * Otherwise, it creates a new owner field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'owner'\n * - info.displayName: 'Owner'\n * - required: true\n *\n * Set semantics:\n * - `SemanticType.ResourceOwnerIdentifier`\n *\n * @param entity The entity to which the owner field will be added.\n * @param info Additional information about the field.\n * @returns The added owner field property.\n */\nexport function addOwnerField(entity: DomainEntity, info: Partial<IThing> = {}): DomainAssociation {\n const existing = findOwnerField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addAssociation(\n {},\n {\n info: { name: 'owner', displayName: 'Owner', ...info },\n required: true,\n }\n )\n prop.addSemantic({\n id: SemanticType.ResourceOwnerIdentifier,\n })\n return prop\n}\n\n// This is owner with different name. Use that one instead.\n// function addCreatedByField(entity: DomainEntity): DomainElement {\n// const existing = findCreatedByField(entity, true)\n// if (existing) {\n// return existing\n// }\n// const prop = entity.addProperty({\n// info: { name: 'created_by', displayName: 'Created By' },\n// type: 'string',\n// readOnly: true,\n// index: true,\n// })\n// prop.addSemantic({\n// id: SemanticType.CreatedTimestamp,\n// })\n// return prop\n// }\n\n/**\n * Adds an updated by field to the specified entity as an association to the User entity.\n * If an updated by field already exists, it returns the existing field.\n * Otherwise, it creates a new updated by field with the specified information.\n *\n * Set properties:\n * - info.name: 'updated_by'\n * - info.displayName: 'Updated By'\n * - required: true\n *\n * Set semantics:\n * - `SemanticType.ResourceOwnerIdentifier`\n *\n * @param entity The entity to which the updated by field will be added.\n * @param info Additional information about the field.\n * @returns The added updated by field property.\n */\nexport function addUpdatedByField(entity: DomainEntity, info: Partial<IThing> = {}): DomainAssociation {\n const existing = findUpdatedByField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addAssociation(\n {},\n {\n info: { name: 'updated_by', displayName: 'Updated By', ...info },\n required: true,\n }\n )\n prop.addSemantic({\n id: SemanticType.ResourceOwnerIdentifier,\n })\n return prop\n}\n\n/**\n * Adds a created at field to the specified entity.\n * If a created at field already exists, it returns the existing field.\n * Otherwise, it creates a new created at field with the specified information.\n *\n * Set properties:\n * - type: 'datetime'\n * - info.name: 'created_at'\n * - info.displayName: 'Created At'\n * - readOnly: true\n * - index: true\n * - schema.defaultValue: { type: 'function', value: 'now' }\n *\n * Set semantics:\n * - `CreatedTimestamp`\n *\n * @param entity The entity to which the created at field will be added.\n * @param info Additional information about the field.\n * @returns The created created at field.\n */\nexport function addCreatedAtField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findCreatedAtField(entity, true)\n if (existing) {\n // If the created_at field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'created_at', displayName: 'Created At', ...info },\n readOnly: true,\n index: true,\n type: 'datetime',\n schema: { defaultValue: { type: 'function', value: 'now' } },\n })\n prop.addSemantic({\n id: SemanticType.CreatedTimestamp,\n })\n return prop\n}\n\n/**\n * Adds an updated at field to the specified entity.\n * If an updated at field already exists, it returns the existing field.\n * Otherwise, it creates a new updated at field with the specified information.\n *\n * Set properties:\n * - type: 'datetime'\n * - info.name: 'updated_at'\n * - info.displayName: 'Updated At'\n * - readOnly: true\n * - index: true\n * - schema.defaultValue: { type: 'function', value: 'now' }\n *\n * Set semantics:\n * - `UpdatedTimestamp`\n *\n * @param entity The entity to which the updated at field will be added.\n * @param info Additional information about the field.\n * @returns The created updated at field.\n */\nexport function addUpdatedAtField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findUpdatedAtField(entity, true)\n if (existing) {\n // If the updated_at field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'updated_at', displayName: 'Updated At', ...info },\n readOnly: true,\n index: true,\n type: 'datetime',\n schema: { defaultValue: { type: 'function', value: 'now' } },\n })\n prop.addSemantic({\n id: SemanticType.UpdatedTimestamp,\n })\n return prop\n}\n\n/**\n * Adds a deleted at field to the specified entity.\n * If a deleted at field already exists, it returns the existing field.\n * Otherwise, it creates a new deleted at field with the specified information.\n *\n * Set properties:\n * - required: true\n * - type: 'datetime'\n * - info.name: 'deleted_at'\n * - info.displayName: 'Deleted At'\n * - readOnly: true\n * - index: true\n * - schema.defaultValue: { type: 'function', value: 'now' }\n *\n * Set semantics:\n * - `SemanticType.DeletedTimestamp`\n *\n * @param entity The entity to which the deleted_at field will be added.\n * @param info Additional information about the field.\n * @returns The added deleted at field property.\n */\nexport function addDeletedAtField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findDeletedAtField(entity, true)\n if (existing) {\n // If the deleted_at field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'deleted_at', displayName: 'Deleted At', ...info },\n readOnly: true,\n index: true,\n type: 'datetime',\n schema: { defaultValue: { type: 'function', value: 'now' } },\n })\n prop.addSemantic({\n id: SemanticType.DeletedTimestamp,\n })\n return prop\n}\n\n/**\n * Adds an is_deleted field to the specified entity.\n * If an is_deleted field already exists, it returns the existing field.\n * Otherwise, it creates a new is_deleted field with the specified information.\n *\n * Set properties:\n * - type: 'boolean'\n * - info.name: 'is_deleted'\n * - info.displayName: 'Is Deleted'\n * - readOnly: true\n * - index: true\n * - schema.defaultValue: { type: 'literal', value: 'false' }\n *\n * Set semantics:\n * - `SemanticType.DeletedFlag`\n *\n * @param entity The entity to which the is_deleted field will be added.\n * @param info Additional information about the field.\n * @returns The added is_deleted field property.\n */\nexport function addIsDeletedField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findIsDeletedField(entity, true)\n if (existing) {\n // If the is_deleted field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'is_deleted', displayName: 'Is Deleted', ...info },\n readOnly: true,\n index: true,\n type: 'boolean',\n schema: { defaultValue: { type: 'literal', value: 'false' } },\n })\n prop.addSemantic({\n id: SemanticType.DeletedFlag,\n })\n return prop\n}\n\n/**\n * Adds a first name field to the specified entity.\n * If a first name field already exists, it returns the existing field.\n * Otherwise, it creates a new first name field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'first_name'\n * - info.displayName: 'First Name'\n *\n * @param entity The entity to which the first name field will be added.\n * @param info Additional information about the field.\n * @returns The created first name field.\n */\nexport function addFirstNameField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findFirstNameField(entity)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'first_name', displayName: 'First Name', ...info },\n type: 'string',\n })\n return prop\n}\n\n/**\n * Adds a first name field to the specified entity.\n * If a first name field already exists, it returns the existing field.\n * Otherwise, it creates a new first name field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'first_name'\n * - info.displayName: 'First Name'\n *\n * @param entity The entity to which the first name field will be added.\n * @param info Additional information about the field.\n * @returns The created first name field.\n */\nexport function addLastNameField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findLastNameField(entity)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'last_name', displayName: 'Last Name', ...info },\n type: 'string',\n })\n return prop\n}\n\n/**\n * Adds a phone field to the specified entity.\n * If a phone field already exists, it returns the existing field.\n * Otherwise, it creates a new phone field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'phone'\n * - info.displayName: 'Phone Number'\n * - index: true (to search by phone number)\n *\n * Set semantics:\n * - id: SemanticType.Phone\n *\n * @param entity The entity to which the phone field will be added.\n * @param info Additional information about the field.\n * @returns The created phone field.\n */\nexport function addPhoneField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findPhoneField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'phone', displayName: 'Phone Number', ...info },\n type: 'string',\n index: true,\n semantics: [\n createPhoneSemantic({\n format: 'international',\n requireCountryCode: true,\n requireVerification: true,\n verificationMethod: 'sms',\n }),\n ],\n })\n return prop\n}\n\n/**\n * Adds an avatar URL field to the specified entity.\n * If an avatar URL field already exists, it returns the existing field.\n * Otherwise, it creates a new avatar URL field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'avatar_url'\n * - info.displayName: 'Avatar URL'\n *\n * Set semantics:\n * - id: SemanticType.ImageURL\n *\n * @param entity The entity to which the avatar URL field will be added.\n * @param info Additional information about the field.\n * @returns The created avatar URL field.\n */\nexport function addAvatarUrlField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findAvatarUrlField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'avatar_url', displayName: 'Avatar URL', ...info },\n type: 'string',\n semantics: [{ id: SemanticType.ImageURL }],\n })\n return prop\n}\n\n/**\n * Adds a public unique name (slug) field to the specified entity.\n * If a public unique name field already exists, it returns the existing field.\n * Otherwise, it creates a new public unique name field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'slug'\n * - info.displayName: 'Public Unique Name'\n * - index: true\n * - required: true\n * - unique: true\n *\n * Set semantics:\n * - id: SemanticType.PublicUniqueName\n *\n * @param entity The entity to which the public unique name field will be added.\n * @param info Additional information about the field.\n * @returns The created public unique name field.\n */\nexport function addPublicUniqueNameField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findPublicUniqueNameField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'slug', displayName: 'Public Unique Name', ...info },\n type: 'string',\n index: true,\n required: true,\n unique: true,\n semantics: [createPublicUniqueNameSemantic(DEFAULT_PUBLIC_UNIQUE_NAME_CONFIG)],\n })\n return prop\n}\n\n/**\n * Adds a SKU field to the specified entity.\n * If a SKU field already exists, it returns the existing field.\n * Otherwise, it creates a new SKU field with semantic annotation.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'sku'\n * - info.displayName: 'SKU'\n * - required: true\n * - unique: true\n *\n * @param entity The entity to which the SKU field will be added.\n * @param info Additional information about the field.\n * @returns The created SKU field.\n */\nexport function addSkuField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findSkuField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'sku', displayName: 'SKU', ...info },\n type: 'string',\n required: true,\n unique: true,\n semantics: [{ ...SKU_PRESETS.PRODUCT_STANDARD }],\n })\n return prop\n}\n\n/**\n * Adds a price field to the specified entity with currency semantic.\n * If a price field already exists, it returns the existing field.\n * Otherwise, it creates a new price field with proper currency handling.\n *\n * Set properties:\n * - type: 'number'\n * - info.name: 'price'\n * - info.displayName: 'Price'\n * - required: true\n * - schema.maximum: 0\n *\n * @param entity The entity to which the price field will be added.\n * @param info Additional information about the field.\n * @returns The created price field.\n */\nexport function addPriceField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findPriceField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'price', displayName: 'Price', ...info },\n type: 'number',\n required: true,\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 return prop\n}\n\n/**\n * Adds a quantity field to the specified entity.\n * If a quantity field already exists, it returns the existing field.\n * Otherwise, it creates a new quantity field with validation.\n *\n * Set properties:\n * - type: 'number'\n * - info.name: 'quantity'\n * - info.displayName: 'Quantity'\n * - required: true\n * - schema.minimum: 0\n *\n * @param entity The entity to which the quantity field will be added.\n * @param info Additional information about the field.\n * @returns The created quantity field.\n */\nexport function addQuantityField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findQuantityField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'quantity', displayName: 'Quantity', ...info },\n type: 'number',\n required: true,\n schema: {\n minimum: 0,\n },\n })\n return prop\n}\n\n/**\n * Adds a weight field to the specified entity.\n * If a weight field already exists, it returns the existing field.\n * Otherwise, it creates a new weight field.\n *\n * Set properties:\n * - type: 'number'\n * - info.name: 'weight'\n * - info.displayName: 'Weight'\n *\n * @param entity The entity to which the weight field will be added.\n * @param info Additional information about the field.\n * @returns The created weight field.\n */\nexport function addWeightField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findWeightField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'weight', displayName: 'Weight', ...info },\n type: 'number',\n })\n return prop\n}\n\n/**\n * Adds an images field to the specified entity for multiple image URLs.\n * If an images field already exists, it returns the existing field.\n * Otherwise, it creates a new images field with ImageURL semantic.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'images'\n * - info.displayName: 'Images'\n * - multiple: true\n *\n * @param entity The entity to which the images field will be added.\n * @param info Additional information about the field.\n * @returns The created images field.\n */\nexport function addImagesField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findImagesField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'images', displayName: 'Images', ...info },\n type: 'string',\n multiple: true,\n semantics: [{ id: SemanticType.ImageURL }],\n })\n return prop\n}\n\n/**\n * Adds a status field with custom enum values to the specified entity.\n * If a status field already exists, it returns the existing field.\n * Otherwise, it creates a new status field with provided enum values.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'status'\n * - info.displayName: 'Status'\n * - required: true\n * - schema.enum: provided enum values\n * - schema.defaultValue: first enum value\n *\n * @param entity The entity to which the status field will be added.\n * @param enumValues Array of status values.\n * @param info Additional information about the field.\n * @returns The created status field.\n */\nexport function addCustomStatusField(\n entity: DomainEntity,\n enumValues: string[],\n info: Partial<IThing> = {}\n): DomainProperty {\n const existing = findStatusField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'status', displayName: 'Status', ...info },\n type: 'string',\n required: true,\n semantics: [createStatusSemantic()],\n schema: {\n enum: enumValues,\n defaultValue: {\n type: 'literal',\n value: enumValues[0],\n },\n },\n })\n return prop\n}\n\n/**\n * Adds a boolean field to the specified entity.\n * If the field already exists, it returns the existing field.\n * Otherwise, it creates a new boolean field with default value.\n *\n * Set properties:\n * - type: 'boolean'\n * - required: true\n * - schema.defaultValue: provided default or 'false'\n *\n * @param entity The entity to which the boolean field will be added.\n * @param fieldName Name of the boolean field.\n * @param defaultValue Default boolean value.\n * @param info Additional information about the field.\n * @returns The created boolean field.\n */\nexport function addBooleanField(\n entity: DomainEntity,\n fieldName: string,\n defaultValue = 'false',\n info: Partial<IThing> = {}\n): DomainProperty {\n const existing = findBooleanField(entity, fieldName, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: fieldName, ...info },\n type: 'boolean',\n required: true,\n schema: {\n defaultValue: {\n type: 'literal',\n value: defaultValue,\n },\n },\n })\n return prop\n}\n\n/**\n * Adds a session ID field to the specified entity.\n * If a session ID field already exists, it returns the existing field.\n * Otherwise, it creates a new session ID field.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'sessionId'\n * - info.displayName: 'Session ID'\n *\n * @param entity The entity to which the session ID field will be added.\n * @param info Additional information about the field.\n * @returns The created session ID field.\n */\nexport function addSessionIdField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findSessionIdField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'sessionId', displayName: 'Session ID', ...info },\n type: 'string',\n })\n return prop\n}\n\n/**\n * Adds an expiration datetime field to the specified entity.\n * If an expiration field already exists, it returns the existing field.\n * Otherwise, it creates a new expiration field.\n *\n * Set properties:\n * - type: 'datetime'\n * - info.name: 'expiresAt'\n * - info.displayName: 'Expires At'\n *\n * @param entity The entity to which the expiration field will be added.\n * @param info Additional information about the field.\n * @returns The created expiration field.\n */\nexport function addExpiresAtField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findExpiresAtField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'expiresAt', displayName: 'Expires At', ...info },\n type: 'datetime',\n })\n return prop\n}\n\n/**\n * Adds a unit price field to the specified entity with currency semantic.\n * If a unit price field already exists, it returns the existing field.\n * Otherwise, it creates a new unit price field with proper currency handling.\n *\n * Set properties:\n * - type: 'number'\n * - info.name: 'unitPrice'\n * - info.displayName: 'Unit Price'\n * - required: true\n *\n * @param entity The entity to which the unit price field will be added.\n * @param info Additional information about the field.\n * @returns The created unit price field.\n */\nexport function addUnitPriceField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findUnitPriceField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'unitPrice', displayName: 'Unit Price', ...info },\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 ],\n })\n return prop\n}\n\n/**\n * Adds a currency amount field (subtotal, tax, shipping, etc.).\n */\nexport function addCurrencyAmountField(\n entity: DomainEntity,\n fieldName: string,\n displayName: string,\n info: Partial<IThing> = {}\n): DomainProperty {\n return entity.addProperty({\n info: {\n name: fieldName,\n displayName,\n ...info,\n },\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 ],\n })\n}\n\n/**\n * Finds a field in the given entity that matches the specified predicate.\n * @param entity The entity to search within.\n * @param predicate A function that defines the search criteria.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found field property or undefined.\n */\nfunction findPropertyField(\n entity: DomainEntity,\n predicate: (property: DomainProperty) => boolean,\n direct = false\n): DomainProperty | undefined {\n for (const property of entity.properties) {\n if (predicate(property)) {\n return property\n }\n }\n if (direct) {\n return undefined\n }\n for (const parent of entity.listParents()) {\n // we can't call a recursive function here because it would scan vertically through the hierarchy\n // and not horizontally through all parents. We need to check each **direct** parent separately,\n // and then move up.\n for (const property of parent.properties) {\n if (predicate(property)) {\n return property\n }\n }\n }\n return undefined\n}\n\n/**\n * Finds a field in the given entity that matches the specified predicate.\n * @param entity The entity to search within.\n * @param predicate A function that defines the search criteria.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found field association or undefined.\n */\nfunction findAssociationField(\n entity: DomainEntity,\n predicate: (property: DomainAssociation) => boolean,\n direct = false\n): DomainAssociation | undefined {\n for (const assoc of entity.associations) {\n if (predicate(assoc)) {\n return assoc\n }\n }\n if (direct) {\n return undefined\n }\n for (const parent of entity.listParents()) {\n // we can't call a recursive function here because it would scan vertically through the hierarchy\n // and not horizontally through all parents. We need to check each **direct** parent separately,\n // and then move up.\n for (const assoc of parent.associations) {\n if (predicate(assoc)) {\n return assoc\n }\n }\n }\n return undefined\n}\n\n/**\n * Searches for the ID field in the given entity.\n * @param entity The entity to search for the ID field.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found ID field property or undefined.\n */\nfunction findIdField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n if (!direct) {\n // Find the primary key property in the entity, which can be inherited or defined on the entity itself.\n return entity.primaryKey()\n }\n for (const property of entity.properties) {\n if (property.primary) {\n return property\n }\n }\n}\n\n/**\n * Searches for the email field in the given entity.\n * @param entity The entity to search for the email field.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found email field property or undefined.\n */\nfunction findEmailField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Email), direct)\n}\n\n/**\n * Searches for the password field in the given entity.\n * @param entity The entity to search for the password field.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found password field property or undefined.\n */\nfunction findPasswordField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Password), direct)\n}\n\nfunction findVersionField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => {\n return property.hasSemantic(SemanticType.Version)\n },\n direct\n )\n}\n\nfunction findNameField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Title), direct)\n}\n\nfunction findDescriptionField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Description), direct)\n}\n\nfunction findStatusField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Status), direct)\n}\n\nfunction findOwnerField(entity: DomainEntity, direct = false): DomainAssociation | undefined {\n return findAssociationField(\n entity,\n (association) =>\n association.hasSemantic(SemanticType.ResourceOwnerIdentifier) &&\n ['owner', 'author'].includes(association.info.name || ''),\n direct\n )\n}\n\n// function findCreatedByField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n// return findField(entity, (property) => property.hasSemantic(SemanticType.CreatedTimestamp), direct)\n// }\n\nfunction findUpdatedByField(entity: DomainEntity, direct = false): DomainAssociation | undefined {\n return findAssociationField(\n entity,\n (association) =>\n association.hasSemantic(SemanticType.ResourceOwnerIdentifier) &&\n ['updated_by', 'updatedBy'].includes(association.info.name || ''),\n direct\n )\n}\n\nfunction findCreatedAtField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => {\n return property.hasSemantic(SemanticType.CreatedTimestamp)\n },\n direct\n )\n}\n\nfunction findUpdatedAtField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => {\n return property.hasSemantic(SemanticType.UpdatedTimestamp)\n },\n direct\n )\n}\n\nfunction findDeletedAtField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => {\n return property.hasSemantic(SemanticType.DeletedTimestamp)\n },\n direct\n )\n}\n\nfunction findIsDeletedField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.DeletedFlag), direct)\n}\n\nexport function addRecommendedFields(entity: DomainEntity): DomainElement[] {\n const fields: DomainElement[] = []\n if (!findIdField(entity)) {\n fields.push(addIdField(entity))\n }\n // The version field is not always recommended, so we don't add it by default.\n // if (!findVersionField(entity)) {\n // fields.push(addVersionField(entity))\n // }\n if (!findCreatedAtField(entity)) {\n fields.push(addCreatedAtField(entity))\n }\n // if (!findCreatedByField(entity)) {\n // fields.push(addCreatedByField(entity))\n // }\n if (!findUpdatedAtField(entity)) {\n fields.push(addUpdatedAtField(entity))\n }\n if (!findUpdatedByField(entity)) {\n fields.push(addUpdatedByField(entity))\n }\n if (!findDeletedAtField(entity)) {\n fields.push(addDeletedAtField(entity))\n }\n if (!findIsDeletedField(entity)) {\n fields.push(addIsDeletedField(entity))\n }\n return fields\n}\n\nfunction findFirstNameField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => ['first_name', 'firstName'].includes(property.info.name || ''), direct)\n}\n\nfunction findLastNameField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => ['last_name', 'lastName'].includes(property.info.name || ''), direct)\n}\n\n// Avatar URL has the `SemanticType.ImageURL` semantic, but it can be used for any image URL.\n// It is not a specific semantic, but it is a common field in many entities.\nfunction findAvatarUrlField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => ['avatar_url', 'avatarUrl'].includes(property.info.name || ''), direct)\n}\n\nfunction findPhoneField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Phone), direct)\n}\n\nfunction findPublicUniqueNameField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.PublicUniqueName), direct)\n}\n\nfunction findSkuField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.SKU), direct)\n}\n\nfunction findPriceField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) =>\n ['price', 'unitPrice', 'totalPrice'].includes(property.info.name || '') &&\n property.hasSemantic(SemanticType.Currency),\n direct\n )\n}\n\nfunction findQuantityField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => ['quantity', 'stock', 'amount'].includes(property.info.name || '') && property.type === 'number',\n direct\n )\n}\n\nfunction findWeightField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.info.name === 'weight' && property.type === 'number', direct)\n}\n\nfunction findImagesField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => property.info.name === 'images' && property.hasSemantic(SemanticType.ImageURL),\n direct\n )\n}\n\nfunction findBooleanField(entity: DomainEntity, fieldName: string, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => property.info.name === fieldName && property.type === 'boolean',\n direct\n )\n}\n\nfunction findSessionIdField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.info.name === 'sessionId', direct)\n}\n\nfunction findUnitPriceField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => property.info.name === 'unitPrice' && property.hasSemantic(SemanticType.Currency),\n direct\n )\n}\n\nfunction findExpiresAtField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => property.info.name === 'expiresAt' && property.type === 'datetime',\n direct\n )\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Intelisense.js","sourceRoot":"","sources":["../../../../src/modeling/helpers/Intelisense.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,8BAA8B,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAA;AACtH,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAA;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnD;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,MAAoB,EAAE,SAAiB;IAClE,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,IAAI;YACP,OAAO,UAAU,CAAC,MAAM,CAAC,CAAA;QAC3B,KAAK,OAAO;YACV,OAAO,aAAa,CAAC,MAAM,CAAC,CAAA;QAC9B,KAAK,MAAM;YACT,OAAO,YAAY,CAAC,MAAM,CAAC,CAAA;QAC7B,KAAK,aAAa;YAChB,OAAO,mBAAmB,CAAC,MAAM,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Q,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,QAAQ,CAAC,IAAI,KAAK,UAAU,EAChF,MAAM,CACP,CAAA;AACH,CAAC","sourcesContent":["import type { DomainEntity } from '../DomainEntity.js'\nimport type { DomainElement } from '../DomainElement.js'\nimport type { DomainProperty } from '../DomainProperty.js'\nimport type { DomainAssociation } from '../DomainAssociation.js'\nimport type { IThing } from '../../models/Thing.js'\nimport { SemanticType } from '../Semantics.js'\nimport { createEmailSemantic } from '../definitions/Email.js'\nimport { createPasswordSemantic } from '../definitions/Password.js'\nimport { createPhoneSemantic } from '../definitions/Phone.js'\nimport { createPublicUniqueNameSemantic, DEFAULT_PUBLIC_UNIQUE_NAME_CONFIG } from '../definitions/PublicUniqueName.js'\nimport { createDescriptionSemantic } from '../definitions/Description.js'\nimport { createCurrencySemantic } from '../definitions/Currency.js'\nimport { createStatusSemantic } from '../definitions/Status.js'\nimport { SKU_PRESETS } from '../definitions/SKU.js'\n\n/**\n * Adds a field to the given entity that is automatically generated by the system.\n *\n * @param entity The entity to which the auto field will be added.\n * @param autoField The name of the auto field to add.\n * @returns The added DomainElement representing the auto field.\n * @throws Error if the auto field is not supported.\n */\nexport function addAutoField(entity: DomainEntity, autoField: string): DomainElement {\n switch (autoField) {\n case 'id':\n return addIdField(entity)\n case 'email':\n return addEmailField(entity)\n case 'name':\n return addNameField(entity)\n case 'description':\n return addDescriptionField(entity)\n case 'status':\n return addStatusField(entity)\n case 'version':\n return addVersionField(entity)\n case 'owner':\n return addOwnerField(entity)\n case 'created':\n return addCreatedAtField(entity)\n // case 'created-by':\n // return addCreatedByField(entity)\n case 'updated':\n return addUpdatedAtField(entity)\n case 'updated-by':\n return addUpdatedByField(entity)\n case 'is-deleted':\n return addIsDeletedField(entity)\n case 'deleted':\n return addDeletedAtField(entity)\n case 'first-name':\n return addFirstNameField(entity)\n case 'last-name':\n return addLastNameField(entity)\n case 'phone':\n return addPhoneField(entity)\n case 'avatar-url':\n return addAvatarUrlField(entity)\n case 'public-unique-name':\n return addPublicUniqueNameField(entity)\n case 'price':\n return addPriceField(entity)\n case 'sku':\n return addSkuField(entity)\n case 'quantity':\n return addQuantityField(entity)\n case 'weight':\n return addWeightField(entity)\n case 'images':\n return addImagesField(entity)\n case 'session-id':\n return addSessionIdField(entity)\n case 'expires-at':\n return addExpiresAtField(entity)\n case 'unit-price':\n return addUnitPriceField(entity)\n default:\n throw new Error(`Unsupported auto field: ${autoField}`)\n }\n}\n\n/**\n * Adds the primary field (ID) to the given entity.\n * If the ID field already exists, it returns the existing field.\n * Otherwise, it creates a new ID field with a name based on the entity's name.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'id'\n * - primary: true\n * - readOnly: true\n * - schema.defaultValue: { type: 'function', value: 'uuid-v4' }\n *\n * @param entity The entity to which the ID field will be added.\n * @returns The added primary field property.\n */\nexport function addIdField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findIdField(entity, true)\n if (existing) {\n // If the ID field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: `id`, ...info },\n primary: true,\n readOnly: true,\n // I don't think we need to index the ID field..\n // index: true,\n type: 'string',\n // @TODO: We should experiment with the random ID generation using the nano library.\n schema: { defaultValue: { type: 'function', value: 'uuid-v4' } },\n })\n return prop\n}\n\n/**\n * Adds an email field to the given entity.\n * If the email field already exists, it returns the existing field.\n * Otherwise, it creates a new email field with a semantic annotation.\n * @param entity The entity to which the email field will be added.\n * @returns The added email field property.\n */\nexport function addEmailField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findEmailField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'email', displayName: 'Email Address', ...info },\n type: 'string',\n required: true,\n index: true,\n semantics: [\n createEmailSemantic({\n requireVerification: true,\n verificationMethod: 'email',\n }),\n ],\n })\n return prop\n}\n\n/**\n * Adds a password field to the given entity.\n * If the password field already exists, it returns the existing field.\n * Otherwise, it creates a new password field with a semantic annotation.\n * @param entity The entity to which the password field will be added.\n * @param info Additional information for the password field.\n * @returns The added password field property.\n */\nexport function addPasswordField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findPasswordField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'password', displayName: 'Password', ...info },\n type: 'string',\n required: true,\n semantics: [\n createPasswordSemantic({\n requireSpecialChars: true,\n requireNumbers: true,\n requireUppercase: true,\n requireLowercase: true,\n minLength: 8,\n }),\n ],\n })\n return prop\n}\n\n/**\n * Adds a version field to the given entity.\n * @param entity The entity to which the version field will be added.\n * The version field is used to track the version of the entity.\n * @returns The added version field property.\n */\nexport function addVersionField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findVersionField(entity, true)\n if (existing) {\n // If the version field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'version', displayName: 'Version', ...info },\n readOnly: true,\n index: true,\n type: 'number',\n schema: { defaultValue: { type: 'function', value: 'incremental' }, minimum: 0 },\n })\n prop.addSemantic({\n id: SemanticType.Version,\n })\n return prop\n}\n\nexport function addNameField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findNameField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'name', displayName: 'Name', ...info },\n type: 'string',\n })\n prop.addSemantic({\n id: SemanticType.Title,\n })\n return prop\n}\n\n/**\n * Adds a description field to the specified entity.\n * If a description field already exists, it returns the existing field.\n * Otherwise, it creates a new description field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'description'\n * - info.displayName: 'Description'\n *\n * Set semantics:\n * - `SemanticType.Description`\n *\n * @param entity The entity to which the description field will be added.\n * @returns The added description field property.\n */\nexport function addDescriptionField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findDescriptionField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'description', displayName: 'Description', ...info },\n type: 'string',\n semantics: [createDescriptionSemantic()],\n })\n return prop\n}\n\n/**\n * Adds a status field to the specified entity.\n * If a status field already exists, it returns the existing field.\n * Otherwise, it creates a new status field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'status'\n * - info.displayName: 'Status'\n * - schema.enum: ['Active', 'Draft', 'Archived']\n * - schema.defaultValue: { type: 'literal', value: 'Draft' }\n *\n * Set semantics:\n * - `SemanticType.Status`\n *\n * @param entity The entity to which the status field will be added.\n * @param info Additional information about the field.\n * @returns The added status field property.\n */\nexport function addStatusField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findStatusField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'status', displayName: 'Status', ...info },\n type: 'string',\n schema: {\n enum: ['Active', 'Draft', 'Archived'],\n defaultValue: { type: 'literal', value: 'Draft' },\n },\n })\n prop.addSemantic({\n id: SemanticType.Status,\n })\n return prop\n}\n\n/**\n * Adds an owner field to the specified entity.\n * If an owner field already exists, it returns the existing field.\n * Otherwise, it creates a new owner field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'owner'\n * - info.displayName: 'Owner'\n * - required: true\n *\n * Set semantics:\n * - `SemanticType.ResourceOwnerIdentifier`\n *\n * @param entity The entity to which the owner field will be added.\n * @param info Additional information about the field.\n * @returns The added owner field property.\n */\nexport function addOwnerField(entity: DomainEntity, info: Partial<IThing> = {}): DomainAssociation {\n const existing = findOwnerField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addAssociation(\n {},\n {\n info: { name: 'owner', displayName: 'Owner', ...info },\n required: true,\n }\n )\n prop.addSemantic({\n id: SemanticType.ResourceOwnerIdentifier,\n })\n return prop\n}\n\n// This is owner with different name. Use that one instead.\n// function addCreatedByField(entity: DomainEntity): DomainElement {\n// const existing = findCreatedByField(entity, true)\n// if (existing) {\n// return existing\n// }\n// const prop = entity.addProperty({\n// info: { name: 'created_by', displayName: 'Created By' },\n// type: 'string',\n// readOnly: true,\n// index: true,\n// })\n// prop.addSemantic({\n// id: SemanticType.CreatedTimestamp,\n// })\n// return prop\n// }\n\n/**\n * Adds an updated by field to the specified entity as an association to the User entity.\n * If an updated by field already exists, it returns the existing field.\n * Otherwise, it creates a new updated by field with the specified information.\n *\n * Set properties:\n * - info.name: 'updated_by'\n * - info.displayName: 'Updated By'\n * - required: true\n *\n * Set semantics:\n * - `SemanticType.ResourceOwnerIdentifier`\n *\n * @param entity The entity to which the updated by field will be added.\n * @param info Additional information about the field.\n * @returns The added updated by field property.\n */\nexport function addUpdatedByField(entity: DomainEntity, info: Partial<IThing> = {}): DomainAssociation {\n const existing = findUpdatedByField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addAssociation(\n {},\n {\n info: { name: 'updated_by', displayName: 'Updated By', ...info },\n required: true,\n }\n )\n prop.addSemantic({\n id: SemanticType.ResourceOwnerIdentifier,\n })\n return prop\n}\n\n/**\n * Adds a created at field to the specified entity.\n * If a created at field already exists, it returns the existing field.\n * Otherwise, it creates a new created at field with the specified information.\n *\n * Set properties:\n * - type: 'datetime'\n * - info.name: 'created_at'\n * - info.displayName: 'Created At'\n * - readOnly: true\n * - index: true\n * - schema.defaultValue: { type: 'function', value: 'now' }\n *\n * Set semantics:\n * - `CreatedTimestamp`\n *\n * @param entity The entity to which the created at field will be added.\n * @param info Additional information about the field.\n * @returns The created created at field.\n */\nexport function addCreatedAtField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findCreatedAtField(entity, true)\n if (existing) {\n // If the created_at field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'created_at', displayName: 'Created At', ...info },\n readOnly: true,\n index: true,\n type: 'datetime',\n schema: { defaultValue: { type: 'function', value: 'now' } },\n })\n prop.addSemantic({\n id: SemanticType.CreatedTimestamp,\n })\n return prop\n}\n\n/**\n * Adds an updated at field to the specified entity.\n * If an updated at field already exists, it returns the existing field.\n * Otherwise, it creates a new updated at field with the specified information.\n *\n * Set properties:\n * - type: 'datetime'\n * - info.name: 'updated_at'\n * - info.displayName: 'Updated At'\n * - readOnly: true\n * - index: true\n * - schema.defaultValue: { type: 'function', value: 'now' }\n *\n * Set semantics:\n * - `UpdatedTimestamp`\n *\n * @param entity The entity to which the updated at field will be added.\n * @param info Additional information about the field.\n * @returns The created updated at field.\n */\nexport function addUpdatedAtField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findUpdatedAtField(entity, true)\n if (existing) {\n // If the updated_at field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'updated_at', displayName: 'Updated At', ...info },\n readOnly: true,\n index: true,\n type: 'datetime',\n schema: { defaultValue: { type: 'function', value: 'now' } },\n })\n prop.addSemantic({\n id: SemanticType.UpdatedTimestamp,\n })\n return prop\n}\n\n/**\n * Adds a deleted at field to the specified entity.\n * If a deleted at field already exists, it returns the existing field.\n * Otherwise, it creates a new deleted at field with the specified information.\n *\n * Set properties:\n * - required: true\n * - type: 'datetime'\n * - info.name: 'deleted_at'\n * - info.displayName: 'Deleted At'\n * - readOnly: true\n * - index: true\n * - schema.defaultValue: { type: 'function', value: 'now' }\n *\n * Set semantics:\n * - `SemanticType.DeletedTimestamp`\n *\n * @param entity The entity to which the deleted_at field will be added.\n * @param info Additional information about the field.\n * @returns The added deleted at field property.\n */\nexport function addDeletedAtField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findDeletedAtField(entity, true)\n if (existing) {\n // If the deleted_at field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'deleted_at', displayName: 'Deleted At', ...info },\n readOnly: true,\n index: true,\n type: 'datetime',\n schema: { defaultValue: { type: 'function', value: 'now' } },\n })\n prop.addSemantic({\n id: SemanticType.DeletedTimestamp,\n })\n return prop\n}\n\n/**\n * Adds an is_deleted field to the specified entity.\n * If an is_deleted field already exists, it returns the existing field.\n * Otherwise, it creates a new is_deleted field with the specified information.\n *\n * Set properties:\n * - type: 'boolean'\n * - info.name: 'is_deleted'\n * - info.displayName: 'Is Deleted'\n * - readOnly: true\n * - index: true\n * - schema.defaultValue: { type: 'literal', value: 'false' }\n *\n * Set semantics:\n * - `SemanticType.DeletedFlag`\n *\n * @param entity The entity to which the is_deleted field will be added.\n * @param info Additional information about the field.\n * @returns The added is_deleted field property.\n */\nexport function addIsDeletedField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findIsDeletedField(entity, true)\n if (existing) {\n // If the is_deleted field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'is_deleted', displayName: 'Is Deleted', ...info },\n readOnly: true,\n index: true,\n type: 'boolean',\n schema: { defaultValue: { type: 'literal', value: 'false' } },\n })\n prop.addSemantic({\n id: SemanticType.DeletedFlag,\n })\n return prop\n}\n\n/**\n * Adds a first name field to the specified entity.\n * If a first name field already exists, it returns the existing field.\n * Otherwise, it creates a new first name field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'first_name'\n * - info.displayName: 'First Name'\n *\n * @param entity The entity to which the first name field will be added.\n * @param info Additional information about the field.\n * @returns The created first name field.\n */\nexport function addFirstNameField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findFirstNameField(entity)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'first_name', displayName: 'First Name', ...info },\n type: 'string',\n })\n return prop\n}\n\n/**\n * Adds a first name field to the specified entity.\n * If a first name field already exists, it returns the existing field.\n * Otherwise, it creates a new first name field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'first_name'\n * - info.displayName: 'First Name'\n *\n * @param entity The entity to which the first name field will be added.\n * @param info Additional information about the field.\n * @returns The created first name field.\n */\nexport function addLastNameField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findLastNameField(entity)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'last_name', displayName: 'Last Name', ...info },\n type: 'string',\n })\n return prop\n}\n\n/**\n * Adds a phone field to the specified entity.\n * If a phone field already exists, it returns the existing field.\n * Otherwise, it creates a new phone field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'phone'\n * - info.displayName: 'Phone Number'\n * - index: true (to search by phone number)\n *\n * Set semantics:\n * - id: SemanticType.Phone\n *\n * @param entity The entity to which the phone field will be added.\n * @param info Additional information about the field.\n * @returns The created phone field.\n */\nexport function addPhoneField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findPhoneField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'phone', displayName: 'Phone Number', ...info },\n type: 'string',\n index: true,\n semantics: [\n createPhoneSemantic({\n format: 'international',\n requireCountryCode: true,\n requireVerification: true,\n verificationMethod: 'sms',\n }),\n ],\n })\n return prop\n}\n\n/**\n * Adds an avatar URL field to the specified entity.\n * If an avatar URL field already exists, it returns the existing field.\n * Otherwise, it creates a new avatar URL field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'avatar_url'\n * - info.displayName: 'Avatar URL'\n *\n * Set semantics:\n * - id: SemanticType.ImageURL\n *\n * @param entity The entity to which the avatar URL field will be added.\n * @param info Additional information about the field.\n * @returns The created avatar URL field.\n */\nexport function addAvatarUrlField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findAvatarUrlField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'avatar_url', displayName: 'Avatar URL', ...info },\n type: 'string',\n semantics: [{ id: SemanticType.ImageURL }],\n })\n return prop\n}\n\n/**\n * Adds a public unique name (slug) field to the specified entity.\n * If a public unique name field already exists, it returns the existing field.\n * Otherwise, it creates a new public unique name field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'slug'\n * - info.displayName: 'Public Unique Name'\n * - index: true\n * - required: true\n * - unique: true\n *\n * Set semantics:\n * - id: SemanticType.PublicUniqueName\n *\n * @param entity The entity to which the public unique name field will be added.\n * @param info Additional information about the field.\n * @returns The created public unique name field.\n */\nexport function addPublicUniqueNameField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findPublicUniqueNameField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'slug', displayName: 'Public Unique Name', ...info },\n type: 'string',\n index: true,\n required: true,\n unique: true,\n semantics: [createPublicUniqueNameSemantic(DEFAULT_PUBLIC_UNIQUE_NAME_CONFIG)],\n })\n return prop\n}\n\n/**\n * Adds a SKU field to the specified entity.\n * If a SKU field already exists, it returns the existing field.\n * Otherwise, it creates a new SKU field with semantic annotation.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'sku'\n * - info.displayName: 'SKU'\n * - required: true\n * - unique: true\n *\n * @param entity The entity to which the SKU field will be added.\n * @param info Additional information about the field.\n * @returns The created SKU field.\n */\nexport function addSkuField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findSkuField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'sku', displayName: 'SKU', ...info },\n type: 'string',\n required: true,\n unique: true,\n semantics: [{ ...SKU_PRESETS.PRODUCT_STANDARD }],\n })\n return prop\n}\n\n/**\n * Adds a price field to the specified entity with currency semantic.\n * If a price field already exists, it returns the existing field.\n * Otherwise, it creates a new price field with proper currency handling.\n *\n * Set properties:\n * - type: 'number'\n * - info.name: 'price'\n * - info.displayName: 'Price'\n * - required: true\n * - schema.maximum: 0\n *\n * @param entity The entity to which the price field will be added.\n * @param info Additional information about the field.\n * @returns The created price field.\n */\nexport function addPriceField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findPriceField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'price', displayName: 'Price', ...info },\n type: 'number',\n required: true,\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 return prop\n}\n\n/**\n * Adds a quantity field to the specified entity.\n * If a quantity field already exists, it returns the existing field.\n * Otherwise, it creates a new quantity field with validation.\n *\n * Set properties:\n * - type: 'number'\n * - info.name: 'quantity'\n * - info.displayName: 'Quantity'\n * - required: true\n * - schema.minimum: 0\n *\n * @param entity The entity to which the quantity field will be added.\n * @param info Additional information about the field.\n * @returns The created quantity field.\n */\nexport function addQuantityField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findQuantityField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'quantity', displayName: 'Quantity', ...info },\n type: 'number',\n required: true,\n schema: {\n minimum: 0,\n },\n })\n return prop\n}\n\n/**\n * Adds a weight field to the specified entity.\n * If a weight field already exists, it returns the existing field.\n * Otherwise, it creates a new weight field.\n *\n * Set properties:\n * - type: 'number'\n * - info.name: 'weight'\n * - info.displayName: 'Weight'\n *\n * @param entity The entity to which the weight field will be added.\n * @param info Additional information about the field.\n * @returns The created weight field.\n */\nexport function addWeightField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findWeightField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'weight', displayName: 'Weight', ...info },\n type: 'number',\n })\n return prop\n}\n\n/**\n * Adds an images field to the specified entity for multiple image URLs.\n * If an images field already exists, it returns the existing field.\n * Otherwise, it creates a new images field with ImageURL semantic.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'images'\n * - info.displayName: 'Images'\n * - multiple: true\n *\n * @param entity The entity to which the images field will be added.\n * @param info Additional information about the field.\n * @returns The created images field.\n */\nexport function addImagesField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findImagesField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'images', displayName: 'Images', ...info },\n type: 'string',\n multiple: true,\n semantics: [{ id: SemanticType.ImageURL }],\n })\n return prop\n}\n\n/**\n * Adds a status field with custom enum values to the specified entity.\n * This is not a regular enum field, it should represent a record status.\n * If a status field already exists, it returns the existing field.\n * Otherwise, it creates a new status field with provided enum values.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'status'\n * - info.displayName: 'Status'\n * - required: true\n * - schema.enum: provided enum values\n * - schema.defaultValue: first enum value\n *\n * @param entity The entity to which the status field will be added.\n * @param enumValues Array of status values.\n * @param info Additional information about the field.\n * @returns The created status field.\n */\nexport function addCustomStatusField(\n entity: DomainEntity,\n enumValues: string[],\n info: Partial<IThing> = {}\n): DomainProperty {\n const existing = findStatusField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'status', displayName: 'Status', ...info },\n type: 'string',\n required: true,\n semantics: [createStatusSemantic()],\n schema: {\n enum: enumValues,\n defaultValue: {\n type: 'literal',\n value: enumValues[0],\n },\n },\n })\n return prop\n}\n\n/**\n * Adds a boolean field to the specified entity.\n * If the field already exists, it returns the existing field.\n * Otherwise, it creates a new boolean field with default value.\n *\n * Set properties:\n * - type: 'boolean'\n * - required: true\n * - schema.defaultValue: provided default or 'false'\n *\n * @param entity The entity to which the boolean field will be added.\n * @param fieldName Name of the boolean field.\n * @param defaultValue Default boolean value.\n * @param info Additional information about the field.\n * @returns The created boolean field.\n */\nexport function addBooleanField(\n entity: DomainEntity,\n fieldName: string,\n defaultValue = 'false',\n info: Partial<IThing> = {}\n): DomainProperty {\n const existing = findBooleanField(entity, fieldName, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: fieldName, ...info },\n type: 'boolean',\n required: true,\n schema: {\n defaultValue: {\n type: 'literal',\n value: defaultValue,\n },\n },\n })\n return prop\n}\n\n/**\n * Adds a session ID field to the specified entity.\n * If a session ID field already exists, it returns the existing field.\n * Otherwise, it creates a new session ID field.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'sessionId'\n * - info.displayName: 'Session ID'\n *\n * @param entity The entity to which the session ID field will be added.\n * @param info Additional information about the field.\n * @returns The created session ID field.\n */\nexport function addSessionIdField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findSessionIdField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'sessionId', displayName: 'Session ID', ...info },\n type: 'string',\n })\n return prop\n}\n\n/**\n * Adds an expiration datetime field to the specified entity.\n * If an expiration field already exists, it returns the existing field.\n * Otherwise, it creates a new expiration field.\n *\n * Set properties:\n * - type: 'datetime'\n * - info.name: 'expiresAt'\n * - info.displayName: 'Expires At'\n *\n * @param entity The entity to which the expiration field will be added.\n * @param info Additional information about the field.\n * @returns The created expiration field.\n */\nexport function addExpiresAtField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findExpiresAtField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'expiresAt', displayName: 'Expires At', ...info },\n type: 'datetime',\n })\n return prop\n}\n\n/**\n * Adds a unit price field to the specified entity with currency semantic.\n * If a unit price field already exists, it returns the existing field.\n * Otherwise, it creates a new unit price field with proper currency handling.\n *\n * Set properties:\n * - type: 'number'\n * - info.name: 'unitPrice'\n * - info.displayName: 'Unit Price'\n * - required: true\n *\n * @param entity The entity to which the unit price field will be added.\n * @param info Additional information about the field.\n * @returns The created unit price field.\n */\nexport function addUnitPriceField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findUnitPriceField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'unitPrice', displayName: 'Unit Price', ...info },\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 ],\n })\n return prop\n}\n\n/**\n * Adds a currency amount field (subtotal, tax, shipping, etc.).\n */\nexport function addCurrencyAmountField(\n entity: DomainEntity,\n fieldName: string,\n displayName: string,\n info: Partial<IThing> = {}\n): DomainProperty {\n return entity.addProperty({\n info: {\n name: fieldName,\n displayName,\n ...info,\n },\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 ],\n })\n}\n\n/**\n * Finds a field in the given entity that matches the specified predicate.\n * @param entity The entity to search within.\n * @param predicate A function that defines the search criteria.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found field property or undefined.\n */\nfunction findPropertyField(\n entity: DomainEntity,\n predicate: (property: DomainProperty) => boolean,\n direct = false\n): DomainProperty | undefined {\n for (const property of entity.properties) {\n if (predicate(property)) {\n return property\n }\n }\n if (direct) {\n return undefined\n }\n for (const parent of entity.listParents()) {\n // we can't call a recursive function here because it would scan vertically through the hierarchy\n // and not horizontally through all parents. We need to check each **direct** parent separately,\n // and then move up.\n for (const property of parent.properties) {\n if (predicate(property)) {\n return property\n }\n }\n }\n return undefined\n}\n\n/**\n * Finds a field in the given entity that matches the specified predicate.\n * @param entity The entity to search within.\n * @param predicate A function that defines the search criteria.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found field association or undefined.\n */\nfunction findAssociationField(\n entity: DomainEntity,\n predicate: (property: DomainAssociation) => boolean,\n direct = false\n): DomainAssociation | undefined {\n for (const assoc of entity.associations) {\n if (predicate(assoc)) {\n return assoc\n }\n }\n if (direct) {\n return undefined\n }\n for (const parent of entity.listParents()) {\n // we can't call a recursive function here because it would scan vertically through the hierarchy\n // and not horizontally through all parents. We need to check each **direct** parent separately,\n // and then move up.\n for (const assoc of parent.associations) {\n if (predicate(assoc)) {\n return assoc\n }\n }\n }\n return undefined\n}\n\n/**\n * Searches for the ID field in the given entity.\n * @param entity The entity to search for the ID field.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found ID field property or undefined.\n */\nfunction findIdField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n if (!direct) {\n // Find the primary key property in the entity, which can be inherited or defined on the entity itself.\n return entity.primaryKey()\n }\n for (const property of entity.properties) {\n if (property.primary) {\n return property\n }\n }\n}\n\n/**\n * Searches for the email field in the given entity.\n * @param entity The entity to search for the email field.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found email field property or undefined.\n */\nfunction findEmailField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Email), direct)\n}\n\n/**\n * Searches for the password field in the given entity.\n * @param entity The entity to search for the password field.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found password field property or undefined.\n */\nfunction findPasswordField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Password), direct)\n}\n\nfunction findVersionField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => {\n return property.hasSemantic(SemanticType.Version)\n },\n direct\n )\n}\n\nfunction findNameField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Title), direct)\n}\n\nfunction findDescriptionField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Description), direct)\n}\n\nfunction findStatusField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Status), direct)\n}\n\nfunction findOwnerField(entity: DomainEntity, direct = false): DomainAssociation | undefined {\n return findAssociationField(\n entity,\n (association) =>\n association.hasSemantic(SemanticType.ResourceOwnerIdentifier) &&\n ['owner', 'author'].includes(association.info.name || ''),\n direct\n )\n}\n\n// function findCreatedByField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n// return findField(entity, (property) => property.hasSemantic(SemanticType.CreatedTimestamp), direct)\n// }\n\nfunction findUpdatedByField(entity: DomainEntity, direct = false): DomainAssociation | undefined {\n return findAssociationField(\n entity,\n (association) =>\n association.hasSemantic(SemanticType.ResourceOwnerIdentifier) &&\n ['updated_by', 'updatedBy'].includes(association.info.name || ''),\n direct\n )\n}\n\nfunction findCreatedAtField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => {\n return property.hasSemantic(SemanticType.CreatedTimestamp)\n },\n direct\n )\n}\n\nfunction findUpdatedAtField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => {\n return property.hasSemantic(SemanticType.UpdatedTimestamp)\n },\n direct\n )\n}\n\nfunction findDeletedAtField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => {\n return property.hasSemantic(SemanticType.DeletedTimestamp)\n },\n direct\n )\n}\n\nfunction findIsDeletedField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.DeletedFlag), direct)\n}\n\nexport function addRecommendedFields(entity: DomainEntity): DomainElement[] {\n const fields: DomainElement[] = []\n if (!findIdField(entity)) {\n fields.push(addIdField(entity))\n }\n // The version field is not always recommended, so we don't add it by default.\n // if (!findVersionField(entity)) {\n // fields.push(addVersionField(entity))\n // }\n if (!findCreatedAtField(entity)) {\n fields.push(addCreatedAtField(entity))\n }\n // if (!findCreatedByField(entity)) {\n // fields.push(addCreatedByField(entity))\n // }\n if (!findUpdatedAtField(entity)) {\n fields.push(addUpdatedAtField(entity))\n }\n if (!findUpdatedByField(entity)) {\n fields.push(addUpdatedByField(entity))\n }\n if (!findDeletedAtField(entity)) {\n fields.push(addDeletedAtField(entity))\n }\n if (!findIsDeletedField(entity)) {\n fields.push(addIsDeletedField(entity))\n }\n return fields\n}\n\nfunction findFirstNameField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => ['first_name', 'firstName'].includes(property.info.name || ''), direct)\n}\n\nfunction findLastNameField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => ['last_name', 'lastName'].includes(property.info.name || ''), direct)\n}\n\n// Avatar URL has the `SemanticType.ImageURL` semantic, but it can be used for any image URL.\n// It is not a specific semantic, but it is a common field in many entities.\nfunction findAvatarUrlField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => ['avatar_url', 'avatarUrl'].includes(property.info.name || ''), direct)\n}\n\nfunction findPhoneField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Phone), direct)\n}\n\nfunction findPublicUniqueNameField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.PublicUniqueName), direct)\n}\n\nfunction findSkuField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.SKU), direct)\n}\n\nfunction findPriceField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) =>\n ['price', 'unitPrice', 'totalPrice'].includes(property.info.name || '') &&\n property.hasSemantic(SemanticType.Currency),\n direct\n )\n}\n\nfunction findQuantityField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => ['quantity', 'stock', 'amount'].includes(property.info.name || '') && property.type === 'number',\n direct\n )\n}\n\nfunction findWeightField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.info.name === 'weight' && property.type === 'number', direct)\n}\n\nfunction findImagesField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => property.info.name === 'images' && property.hasSemantic(SemanticType.ImageURL),\n direct\n )\n}\n\nfunction findBooleanField(entity: DomainEntity, fieldName: string, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => property.info.name === fieldName && property.type === 'boolean',\n direct\n )\n}\n\nfunction findSessionIdField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.info.name === 'sessionId', direct)\n}\n\nfunction findUnitPriceField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => property.info.name === 'unitPrice' && property.hasSemantic(SemanticType.Currency),\n direct\n )\n}\n\nfunction findExpiresAtField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => property.info.name === 'expiresAt' && property.type === 'datetime',\n direct\n )\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DataDomain } from '../DataDomain.js';
|
|
2
|
+
import type { DomainTemplate, DomainTemplateStructure } from './types.js';
|
|
3
|
+
export * from './verticals/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Creates template metadata from a DataDomain instance for UI presentation
|
|
6
|
+
*/
|
|
7
|
+
export declare function createTemplateMetadata(domain: DataDomain, templateInfo: {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
version: string;
|
|
12
|
+
author: string;
|
|
13
|
+
tags?: string[];
|
|
14
|
+
createdAt: string;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
}): DomainTemplate;
|
|
17
|
+
/**
|
|
18
|
+
* Analyzes a DataDomain to extract structural information for UI presentation
|
|
19
|
+
*/
|
|
20
|
+
export declare function analyzeDomainStructure(domain: DataDomain): DomainTemplateStructure;
|
|
21
|
+
//# 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;AAGnB,cAAc,sBAAsB,CAAA;AAEpC;;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,176 @@
|
|
|
1
|
+
// Import vertical organization
|
|
2
|
+
export * from './verticals/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates template metadata from a DataDomain instance for UI presentation
|
|
5
|
+
*/
|
|
6
|
+
export function createTemplateMetadata(domain, templateInfo) {
|
|
7
|
+
const structure = analyzeDomainStructure(domain);
|
|
8
|
+
return {
|
|
9
|
+
id: templateInfo.id,
|
|
10
|
+
name: templateInfo.name,
|
|
11
|
+
description: templateInfo.description,
|
|
12
|
+
createdAt: templateInfo.createdAt,
|
|
13
|
+
updatedAt: templateInfo.updatedAt,
|
|
14
|
+
version: templateInfo.version,
|
|
15
|
+
author: templateInfo.author,
|
|
16
|
+
tags: templateInfo.tags || [],
|
|
17
|
+
structure,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Analyzes a DataDomain to extract structural information for UI presentation
|
|
22
|
+
*/
|
|
23
|
+
export function analyzeDomainStructure(domain) {
|
|
24
|
+
const namespaces = [];
|
|
25
|
+
let totalEntities = 0;
|
|
26
|
+
let totalProperties = 0;
|
|
27
|
+
let totalAssociations = 0;
|
|
28
|
+
// Analyze each namespace
|
|
29
|
+
for (const namespace of domain.listNamespaces()) {
|
|
30
|
+
const namespaceInfo = analyzeNamespace(namespace);
|
|
31
|
+
namespaces.push(namespaceInfo);
|
|
32
|
+
totalEntities += namespaceInfo.entityCount;
|
|
33
|
+
totalProperties += namespaceInfo.models.reduce((sum, model) => sum + model.entities.reduce((entitySum, entity) => entitySum + entity.propertyCount, 0), 0);
|
|
34
|
+
totalAssociations += namespaceInfo.models.reduce((sum, model) => sum + model.entities.reduce((entitySum, entity) => entitySum + entity.associationCount, 0), 0);
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
domain: {
|
|
38
|
+
name: domain.info.name || 'Unnamed Domain',
|
|
39
|
+
description: domain.info.description,
|
|
40
|
+
totalEntities,
|
|
41
|
+
totalProperties,
|
|
42
|
+
totalAssociations,
|
|
43
|
+
},
|
|
44
|
+
namespaces,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Analyzes a DomainNamespace to extract information for UI presentation
|
|
49
|
+
*/
|
|
50
|
+
function analyzeNamespace(namespace) {
|
|
51
|
+
const models = [];
|
|
52
|
+
let entityCount = 0;
|
|
53
|
+
// Analyze each model in the namespace
|
|
54
|
+
for (const model of namespace.listModels()) {
|
|
55
|
+
const modelInfo = analyzeModel(model);
|
|
56
|
+
models.push(modelInfo);
|
|
57
|
+
entityCount += modelInfo.entityCount;
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
name: namespace.info.name || 'Unnamed Namespace',
|
|
61
|
+
displayName: namespace.info.displayName,
|
|
62
|
+
description: namespace.info.description,
|
|
63
|
+
modelCount: models.length,
|
|
64
|
+
entityCount,
|
|
65
|
+
models,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Analyzes a DomainModel to extract information for UI presentation
|
|
70
|
+
*/
|
|
71
|
+
function analyzeModel(model) {
|
|
72
|
+
const entities = [];
|
|
73
|
+
// Analyze each entity in the model
|
|
74
|
+
for (const entity of model.listEntities()) {
|
|
75
|
+
const entityInfo = analyzeEntity(entity);
|
|
76
|
+
entities.push(entityInfo);
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
name: model.info.name || 'Unnamed Model',
|
|
80
|
+
displayName: model.info.displayName,
|
|
81
|
+
description: model.info.description,
|
|
82
|
+
entityCount: entities.length,
|
|
83
|
+
entities,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Analyzes a DomainEntity to extract information for UI presentation
|
|
88
|
+
*/
|
|
89
|
+
function analyzeEntity(entity) {
|
|
90
|
+
const properties = [];
|
|
91
|
+
const associations = [];
|
|
92
|
+
// Analyze properties
|
|
93
|
+
for (const property of entity.listProperties()) {
|
|
94
|
+
properties.push(analyzeProperty(property));
|
|
95
|
+
}
|
|
96
|
+
// Analyze associations
|
|
97
|
+
for (const association of entity.listAssociations()) {
|
|
98
|
+
associations.push(analyzeAssociation(association));
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
name: entity.info.name || 'Unnamed Entity',
|
|
102
|
+
displayName: entity.info.displayName,
|
|
103
|
+
description: entity.info.description,
|
|
104
|
+
propertyCount: properties.length,
|
|
105
|
+
associationCount: associations.length,
|
|
106
|
+
deprecated: entity.deprecated,
|
|
107
|
+
properties,
|
|
108
|
+
associations,
|
|
109
|
+
semantics: entity.semantics?.map((s) => s.id) || [],
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Analyzes a DomainProperty to extract information for UI presentation
|
|
114
|
+
*/
|
|
115
|
+
function analyzeProperty(property) {
|
|
116
|
+
const semantics = property.semantics?.map((s) => s.id) || [];
|
|
117
|
+
// Extract enum values if present
|
|
118
|
+
let enumValues;
|
|
119
|
+
if (property.schema?.enum && Array.isArray(property.schema.enum)) {
|
|
120
|
+
enumValues = property.schema.enum.map((v) => String(v));
|
|
121
|
+
}
|
|
122
|
+
// Extract default value
|
|
123
|
+
let defaultValue;
|
|
124
|
+
if (property.schema?.defaultValue) {
|
|
125
|
+
if (property.schema.defaultValue.type === 'literal') {
|
|
126
|
+
defaultValue = String(property.schema.defaultValue.value);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
name: property.info.name || 'Unnamed Property',
|
|
131
|
+
displayName: property.info.displayName,
|
|
132
|
+
description: property.info.description,
|
|
133
|
+
type: property.type || 'string',
|
|
134
|
+
required: property.required,
|
|
135
|
+
multiple: property.multiple,
|
|
136
|
+
primary: property.primary,
|
|
137
|
+
unique: property.unique,
|
|
138
|
+
readOnly: property.readOnly,
|
|
139
|
+
writeOnly: property.writeOnly,
|
|
140
|
+
deprecated: property.deprecated,
|
|
141
|
+
semantics,
|
|
142
|
+
enumValues,
|
|
143
|
+
defaultValue,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Analyzes a DomainAssociation to extract information for UI presentation
|
|
148
|
+
*/
|
|
149
|
+
function analyzeAssociation(association) {
|
|
150
|
+
const semantics = association.semantics?.map((s) => s.id) || [];
|
|
151
|
+
// Get target entity names
|
|
152
|
+
const targetEntities = association.targets?.map((target) => {
|
|
153
|
+
// Try to resolve the target entity to get its name
|
|
154
|
+
const targetEntity = association.domain.findEntity(target.key);
|
|
155
|
+
return targetEntity?.info.name || target.key;
|
|
156
|
+
}) || [];
|
|
157
|
+
// Determine cardinality description
|
|
158
|
+
let cardinality = 'One-to-One';
|
|
159
|
+
if (association.multiple) {
|
|
160
|
+
cardinality = 'One-to-Many';
|
|
161
|
+
}
|
|
162
|
+
// Note: Many-to-Many would typically be determined by looking at the reverse association
|
|
163
|
+
// but for simplicity in UI presentation, we'll use the current association's multiplicity
|
|
164
|
+
return {
|
|
165
|
+
name: association.info.name || 'Unnamed Association',
|
|
166
|
+
displayName: association.info.displayName,
|
|
167
|
+
description: association.info.description,
|
|
168
|
+
required: association.required,
|
|
169
|
+
multiple: association.multiple,
|
|
170
|
+
readOnly: association.readOnly,
|
|
171
|
+
targetEntities,
|
|
172
|
+
semantics,
|
|
173
|
+
cardinality,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modeling/templates/index.ts"],"names":[],"mappings":"AAgBA,+BAA+B;AAC/B,cAAc,sBAAsB,CAAA;AAEpC;;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,IAAI,IAAI,EAAE;QAC7B,SAAS;KACV,CAAA;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAkB;IACvD,MAAM,UAAU,GAAoB,EAAE,CAAA;IACtC,IAAI,aAAa,GAAG,CAAC,CAAA;IACrB,IAAI,eAAe,GAAG,CAAC,CAAA;IACvB,IAAI,iBAAiB,GAAG,CAAC,CAAA;IAEzB,yBAAyB;IACzB,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC;QAChD,MAAM,aAAa,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAA;QACjD,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QAE9B,aAAa,IAAI,aAAa,CAAC,WAAW,CAAA;QAC1C,eAAe,IAAI,aAAa,CAAC,MAAM,CAAC,MAAM,CAC5C,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,E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H,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// Import vertical organization\nexport * from './verticals/index.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"]}
|