@api-client/core 0.17.4 → 0.17.5

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.
Files changed (34) hide show
  1. package/build/src/modeling/Semantics.d.ts +1 -1
  2. package/build/src/modeling/Semantics.d.ts.map +1 -1
  3. package/build/src/modeling/Semantics.js +6 -6
  4. package/build/src/modeling/Semantics.js.map +1 -1
  5. package/build/src/modeling/definitions/{Price.d.ts → Currency.d.ts} +24 -24
  6. package/build/src/modeling/definitions/Currency.d.ts.map +1 -0
  7. package/build/src/modeling/definitions/{Price.js → Currency.js} +18 -18
  8. package/build/src/modeling/definitions/Currency.js.map +1 -0
  9. package/build/src/modeling/definitions/HTML.d.ts +17 -4
  10. package/build/src/modeling/definitions/HTML.d.ts.map +1 -1
  11. package/build/src/modeling/definitions/HTML.js +0 -1
  12. package/build/src/modeling/definitions/HTML.js.map +1 -1
  13. package/build/src/modeling/definitions/Markdown.d.ts +12 -4
  14. package/build/src/modeling/definitions/Markdown.d.ts.map +1 -1
  15. package/build/src/modeling/definitions/Markdown.js +0 -1
  16. package/build/src/modeling/definitions/Markdown.js.map +1 -1
  17. package/build/src/modeling/definitions/Status.d.ts +1 -1
  18. package/build/src/modeling/definitions/Status.d.ts.map +1 -1
  19. package/build/src/modeling/definitions/Status.js +1 -0
  20. package/build/src/modeling/definitions/Status.js.map +1 -1
  21. package/build/tsconfig.tsbuildinfo +1 -1
  22. package/package.json +1 -1
  23. package/src/modeling/Semantics.ts +6 -6
  24. package/src/modeling/definitions/{Price.examples.md → Currency.examples.md} +12 -12
  25. package/src/modeling/definitions/{Price.ts → Currency.ts} +26 -26
  26. package/src/modeling/definitions/HTML.ts +17 -5
  27. package/src/modeling/definitions/Markdown.ts +12 -5
  28. package/src/modeling/definitions/Status.ts +2 -1
  29. package/tests/unit/modeling/definitions/{price.spec.ts → currency.spec.ts} +114 -114
  30. package/tests/unit/modeling/definitions/description.spec.ts +0 -2
  31. package/tests/unit/modeling/semantic-configs.spec.ts +44 -44
  32. package/tests/unit/modeling/semantics.spec.ts +10 -1
  33. package/build/src/modeling/definitions/Price.d.ts.map +0 -1
  34. package/build/src/modeling/definitions/Price.js.map +0 -1
@@ -132,7 +132,7 @@ export declare enum SemanticType {
132
132
  * Can store simple decimal amounts or complex objects with amount and currency.
133
133
  * Enforces proper decimal handling to avoid floating-point errors.
134
134
  */
135
- Price = "Semantic#Price",
135
+ Currency = "Semantic#Currency",
136
136
  /**
137
137
  * Annotates a field as a URL with validation and allowed protocols.
138
138
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Semantics.d.ts","sourceRoot":"","sources":["../../../src/modeling/Semantics.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEzD;;;GAGG;AACH,oBAAY,YAAY;IAKtB;;OAEG;IACH,IAAI,kBAAkB;IAMtB;;;;OAIG;IACH,QAAQ,sBAAsB;IAC9B;;;OAGG;IACH,gBAAgB,8BAA8B;IAC9C;;;OAGG;IACH,gBAAgB,8BAA8B;IAC9C;;;;;OAKG;IACH,gBAAgB,8BAA8B;IAC9C;;;;OAIG;IACH,WAAW,yBAAyB;IACpC;;;;;;OAMG;IACH,gBAAgB,8BAA8B;IAC9C;;;;OAIG;IACH,KAAK,mBAAmB;IACxB;;;;;;OAMG;IACH,QAAQ,sBAAsB;IAC9B;;;;;;;;;OASG;IACH,MAAM,oBAAoB;IAE1B;;;;OAIG;IACH,OAAO,qBAAqB;IAE5B;;;OAGG;IACH,QAAQ,sBAAsB;IAE9B;;;OAGG;IACH,OAAO,qBAAqB;IAE5B;;;;;;OAMG;IACH,QAAQ,sBAAsB;IAE9B;;;;;;OAMG;IACH,IAAI,kBAAkB;IAEtB;;;;;;;;;;;;;;;OAeG;IACH,qBAAqB,mCAAmC;IAExD;;OAEG;IACH,KAAK,mBAAmB;IACxB;;OAEG;IACH,KAAK,mBAAmB;IACxB;;;;OAIG;IACH,KAAK,m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AAI,UAAU,YAAY,KAAG,QAAQ,IAAI,cAC7B,CAAA;AAEzC;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,UAAU,YAAY,KAAG,QAAQ,IAAI,gBAC7B,CAAA;AAE3C;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,YAAY,KAAG,QAAQ,IAAI,mBAC7B,CAAA;AAE9C;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG,gBAAgB,GAAG,mBAAmB,CAAA;AAElF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,YAAY,EAAE,YAAY,CAgS5D,CAAA;AAED,wBAAgB,sBAAsB,IAAI,MAAM,CAAC,gBAAgB,EAAE,YAAY,EAAE,CAAC,CAAA;AAClF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,gBAAgB,EAAE,cAAc,EAAE,CAAC,CAAA;AAC/G,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,aAAa,CAAC,QAAQ,GAAG,MAAM,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,CAAC,CAAA;AACnH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,aAAa,CAAC,WAAW,GAC/B,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,EAAE,CAAC,CAAA;AA+BlD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GAAI,UAAU,gBAAgB,KAAG,YAAY,EAEnF,CAAA;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,EAAE,EAAE,YAAY,CAAA;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACjC"}
@@ -138,7 +138,7 @@ export var SemanticType;
138
138
  * Can store simple decimal amounts or complex objects with amount and currency.
139
139
  * Enforces proper decimal handling to avoid floating-point errors.
140
140
  */
141
- SemanticType["Price"] = "Semantic#Price";
141
+ SemanticType["Currency"] = "Semantic#Currency";
142
142
  /**
143
143
  * Annotates a field as a URL with validation and allowed protocols.
144
144
  */
@@ -371,7 +371,7 @@ export const DataSemantics = {
371
371
  description: 'Detailed description text',
372
372
  category: SemanticCategory.Content,
373
373
  applicableDataTypes: ['string'],
374
- hasConfig: true,
374
+ hasConfig: false,
375
375
  },
376
376
  [SemanticType.Summary]: {
377
377
  id: SemanticType.Summary,
@@ -380,7 +380,7 @@ export const DataSemantics = {
380
380
  description: 'Brief summary text',
381
381
  category: SemanticCategory.Content,
382
382
  applicableDataTypes: ['string'],
383
- hasConfig: true,
383
+ hasConfig: false,
384
384
  },
385
385
  [SemanticType.Markdown]: {
386
386
  id: SemanticType.Markdown,
@@ -430,9 +430,9 @@ export const DataSemantics = {
430
430
  applicableDataTypes: ['string'],
431
431
  hasConfig: true,
432
432
  },
433
- [SemanticType.Price]: {
434
- id: SemanticType.Price,
435
- displayName: 'Price',
433
+ [SemanticType.Currency]: {
434
+ id: SemanticType.Currency,
435
+ displayName: 'Currency',
436
436
  scope: SemanticScope.Property,
437
437
  description: 'Monetary value with currency',
438
438
  category: SemanticCategory.Business,
@@ -1 +1 @@
1
- {"version":3,"file":"Semantics.js","sourceRoot":"","sources":["../../../src/modeling/Semantics.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,CAAN,IAAY,YAuMX;AAvMD,WAAY,YAAY;IACtB,EAAE;IACF,yBAAyB;IACzB,EAAE;IAEF;;OAEG;IACH,sCAAsB,CAAA;IAEtB,EAAE;IACF,2BAA2B;IAC3B,EAAE;IAEF;;;;OAIG;IACH,8CAA8B,CAAA;IAC9B;;;OAGG;IACH,8DAA8C,CAAA;IAC9C;;;OAGG;IACH,8DAA8C,CAAA;IAC9C;;;;;OAKG;IACH,8DAA8C,CAAA;IAC9C;;;;OAIG;IACH,oDAAoC,CAAA;IACpC;;;;;;OAMG;IACH,8DAA8C,CAAA;IAC9C;;;;OAIG;IACH,wCAAwB,CAAA;I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;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAqB;IAC1D,MAAM,MAAM,GAA6C;QACvD,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,EAAE;QAC/B,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,EAAE;QAChC,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,EAAE;QAC9B,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,EAAE;QAC/B,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,EAAE;QAC9B,CAAC,gBAAgB,CAAC,YAAY,CAAC,EAAE,EAAE;QACnC,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,EAAE;QAC/B,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,EAAE;KAChC,CAAA;IAED,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QAChD,yDAAyD;QACzD,IAAI,KAAK,IAAI,QAAQ,CAAC,KAAK,KAAK,KAAK,EAAE,CAAC;YACtC,OAAM;QACR,CAAC;QACD,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC1C,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,QAA0B,EAAkB,EAAE;IACvF,OAAO,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAA;AAC1F,CAAC,CAAA","sourcesContent":["/* eslint-disable no-redeclare */\n/* eslint-disable max-len */\nimport type { DomainPropertyType } from './DataFormat.js'\n\n/**\n * Defines the names for all available data semantics.\n * Using a string enum makes it easy to add or remove semantics in a single place.\n */\nexport enum SemanticType {\n //\n // Entity-Level Semantics\n //\n\n /**\n * Designates a Data Entity that represents users of the system.\n */\n User = 'Semantic#User',\n\n //\n // Property-Level Semantics\n //\n\n /**\n * Annotates the field as the user password.\n * The runtime should treat this field with special care,\n * ensuring it is encrypted and not exposed in API responses.\n */\n Password = 'Semantic#Password',\n /**\n * Designates a Data Property as the `createdAt` timestamp of an entity.\n * This is used to track when the entity was first created.\n */\n CreatedTimestamp = 'Semantic#CreatedTimestamp',\n /**\n * Designates a Data Property as the `updatedAt` timestamp of an entity.\n * This is used to track when the entity was last modified.\n */\n UpdatedTimestamp = 'Semantic#UpdatedTimestamp',\n /**\n * Designates a Data Property as the `deletedAt` timestamp of an entity.\n * This is used to track when the entity was soft-deleted.\n * Soft-deletion means the entity is not physically removed from the database,\n * but marked as deleted for logical deletion purposes.\n */\n DeletedTimestamp = 'Semantic#DeletedTimestamp',\n /**\n * Designates a Data Property as a boolean flag indicating whether the entity is deleted.\n * This is used for soft-deletion, where the entity is not physically removed from the database,\n * but marked as deleted.\n */\n DeletedFlag = 'Semantic#DeletedFlag',\n /**\n * Designates a Data Property as a unique public identifier for a resource (the slug).\n * This is often used in URLs to provide a user-friendly way to access the resource.\n * For example, a blog post might have a public unique name like \"my-first-post\".\n * A URL-friendly text field. The runtime automatically generates a unique, URL-safe string from another field (like a title or name). The user needs to specify which field is used to generate\n * the slug.\n */\n PublicUniqueName = 'Semantic#PublicUniqueName',\n /**\n * A semantic that describes a title of an article, blog post, and so on. This semantic is used with\n * the `PublicUniqueName` to determine which field is responsible for the slug generation. However,\n * we may add more automation related to the `title` property in the future.\n */\n Title = 'Semantic#Title',\n /**\n * Designates a Data Property as the `role` of a user within the system.\n * This is used to define the user's permissions and access levels.\n * For example, a user with the role of \"admin\" would have elevated permissions\n * compared to a user with the role of \"guest\".\n * Roles are defined on the entity as enums, or as a string property with a controlled vocabulary.\n */\n UserRole = 'Semantic#UserRole',\n /**\n * A text or enum field to represent the state of a record (e.g., `draft`, `published`, `pending_review`, `archived`).\n *\n * Defined behaviors:\n * - State-Based Filtering: Automatically prevents public users from seeing records in a draft state.\n * - State Transitions: In principle, the runtime should prevent the user from skipping some states.\n * For example, when the record is in the `draft` state, it cannot be moved to the `archived` state without publishing it first. However,\n * we do not have enough customer feedback to design this functionality correctly right now, so\n * it serves as a placeholder semantic annotation.\n */\n Status = 'Semantic#Status',\n\n /**\n * Annotates an integer field that automatically increments.\n * The runtime automatically increments this number on every update, providing a simple way\n * to track changes and implement optimistic locking to prevent mid-air collisions.\n */\n Version = 'Semantic#Version',\n\n /**\n * Annotates a field that holds a reference to an image data via an URL.\n * The application + runtime should validate that the input is a well-formed URL.\n */\n ImageURL = 'Semantic#ImageURL',\n\n /**\n * Annotates a field that holds a reference to a file object via an URL. Ity is distinct from the\n * `ImageURL` semantic as it implicitly states that the target is non-image, binary data (an attachment, for example).\n */\n FileURL = 'Semantic#FileURL',\n\n /**\n * Annotates the field as a markdown-interpreted field.\n * When an object is created, the runtime performs additional sanitization to prevent XSS attacks.\n *\n * The annotation describes whether the data should be translated to the HTML output when\n * record is read or the original MD content should be returned.\n */\n Markdown = 'Semantic#Markdown',\n\n /**\n * Annotates the field as containing HTML content.\n * The runtime performs sanitization to prevent XSS attacks and validates HTML structure.\n *\n * The annotation describes whether the data should be rendered as HTML output when\n * record is read or the original HTML content should be returned.\n */\n HTML = 'Semantic#HTML',\n\n /**\n * Annotates a field that holds geospatial coordinate data (latitude/longitude).\n * The runtime automatically generates API capabilities for location-based queries,\n * such as \"find all restaurants within a 5-mile radius.\"\n *\n * The field should contain coordinate data in a standard format:\n * - \"40.7128,-74.0060\" (lat,lon)\n * - \"POINT(-74.0060 40.7128)\" (PostGIS format)\n * - \"40.7128°N, 74.0060°W\" (degree format)\n *\n * Defined behaviors:\n * - Spatial Indexing: The runtime automatically creates spatial indexes for efficient location-based queries\n * - Distance Queries: Enables API endpoints for finding records within specified distances\n * - Coordinate Validation: Validates that the input follows proper coordinate format\n * - PostGIS Integration: When using PostgreSQL, automatically maps to PostGIS geometry types\n */\n GeospatialCoordinates = 'Semantic#GeospatialCoordinates',\n\n /**\n * Annotates a field as an email address with validation and verification options.\n */\n Email = 'Semantic#Email',\n /**\n * Annotates a field as a phone number with validation and formatting options.\n */\n Phone = 'Semantic#Phone',\n /**\n * Annotates a field as a monetary value with currency support and precision control.\n * Can store simple decimal amounts or complex objects with amount and currency.\n * Enforces proper decimal handling to avoid floating-point errors.\n */\n Price = 'Semantic#Price',\n /**\n * Annotates a field as a URL with validation and allowed protocols.\n */\n URL = 'Semantic#URL',\n /**\n * Annotates a field as a Stock Keeping Unit (SKU).\n * Enforces uniqueness at the database level, critical for product catalogs.\n * Provides automatic validation and formatting for product identification codes.\n */\n SKU = 'Semantic#SKU',\n /**\n * Annotates a field as a long-form description.\n */\n Description = 'Semantic#Description',\n /**\n * Annotates a field as a short summary.\n */\n Summary = 'Semantic#Summary',\n /**\n * Annotates a field as a calculated value based on a formula.\n */\n Calculated = 'Semantic#Calculated',\n /**\n * Annotates a field as derived from other fields.\n */\n Derived = 'Semantic#Derived',\n\n //\n // Association-Level Semantics\n //\n\n /**\n * Designates an association that links a resource to a \"User\" entity instance.\n * This is used to indicate ownership of the resource for access control purposes.\n * For example, a blog post might have a resource owner identifier that points to the user who created it.\n *\n * Defined behaviors:\n * - Automatic Ownership: When a new record is created, this field is automatically populated with the ID of the authenticated user. It also creates a foreign relationship to the `User` semantic object.\n * - Scoped Access: The runtime automatically filters list and read operations to show only records where the Owner matches the current user. update and delete operations are similarly restricted.\n */\n ResourceOwnerIdentifier = 'Semantic#ResourceOwnerIdentifier',\n /**\n * Annotates an association as supporting tag functionality.\n * Applied to associations between entities to enable tagging behavior.\n * For example, a Product-Category association with Tags semantic enables product tagging.\n */\n Tags = 'Semantic#Tags',\n /**\n * Annotates an association as supporting category functionality.\n * Applied to associations between entities to enable categorization behavior.\n * For example, a Product-Category association with Categories semantic enables product categorization.\n */\n Categories = 'Semantic#Categories',\n}\n\n/**\n * Defines the scope at which a semantic can be applied.\n */\nexport enum SemanticScope {\n /**\n * The semantic applies to an entire Data Entity.\n * This is used for semantics that provide context or constraints at the entity level.\n */\n Entity = 'Entity',\n /**\n * The semantic applies to a single Data Property.\n * This is used for semantics that provide context or constraints at the property level.\n */\n Property = 'Property',\n /**\n * The semantic applies to an Association between Data Entities.\n * This is used for semantics that provide context or constraints at the association level.\n */\n Association = 'Association',\n}\n\n/**\n * Defines categories for organizing semantics in the UI.\n */\nexport enum SemanticCategory {\n /**\n * User management, authentication, and access control\n */\n Identity = 'Identity & Authentication',\n /**\n * Timestamps, versioning, and record lifecycle\n */\n Lifecycle = 'Timestamps & Versioning',\n /**\n * Text content, media, and rich content types\n */\n Content = 'Content & Media',\n /**\n * Business-specific data like pricing, inventory, status\n */\n Business = 'Business Data',\n /**\n * Contact information and communication\n */\n Contact = 'Contact Information',\n /**\n * Organization, categorization, and tagging\n */\n Organization = 'Classification & Organization',\n /**\n * Location and geographical data\n */\n Location = 'Location & Geography',\n /**\n * Calculated and derived values\n */\n Computed = 'Computed Values',\n}\n\n/**\n * A base interface for all Data Semantics, containing common properties.\n * A semantic is an annotation applied to a Data Entity, Property, or Association\n * to provide additional context or constraints.\n * This interface is extended by more specific semantic types.\n */\ninterface BaseDataSemantic {\n /**\n * A unique identifier for the semantic definition.\n */\n id: SemanticType\n /**\n * A human-readable name for the semantic.\n */\n displayName: string\n /**\n * A description of the semantic's purpose and impact.\n */\n description: string\n /**\n * Specifies whether the semantic applies to an Entity, Property, or Association.\n */\n scope: SemanticScope\n /**\n * The category this semantic belongs to for UI organization.\n */\n category: SemanticCategory\n /**\n * Whether the semantic has a configuration or additional options.\n * This is used to determine if the semantic requires additional setup or configuration.\n */\n hasConfig: boolean\n}\n\n/**\n * Represents a semantic that can be applied to an entire Data Entity.\n */\nexport interface EntitySemantic extends BaseDataSemantic {\n scope: SemanticScope.Entity\n}\n\n/**\n * Represents a semantic that can be applied to a single property.\n */\nexport interface PropertySemantic extends BaseDataSemantic {\n scope: SemanticScope.Property\n /**\n * Optional array of data types this semantic can be applied to.\n * Enforces constraints, e.g., DeletedTimestamp on a DateTime property.\n */\n applicableDataTypes?: DomainPropertyType[]\n}\n\n/**\n * Represents a semantic that can be applied to an association between entities.\n */\nexport interface AssociationSemantic extends BaseDataSemantic {\n scope: SemanticScope.Association\n}\n\n/**\n * A type guard to check if a semantic is an EntitySemantic.\n */\nexport const isEntitySemantic = (semantic: DataSemantic): semantic is EntitySemantic =>\n semantic.scope === SemanticScope.Entity\n\n/**\n * A type guard to check if a semantic is a PropertySemantic.\n */\nexport const isPropertySemantic = (semantic: DataSemantic): semantic is PropertySemantic =>\n semantic.scope === SemanticScope.Property\n\n/**\n * A type guard to check if a semantic is a AssociationSemantic.\n */\nexport const isAssociationSemantic = (semantic: DataSemantic): semantic is AssociationSemantic =>\n semantic.scope === SemanticScope.Association\n\n/**\n * Union type for any kind of data semantic\n */\nexport type DataSemantic = EntitySemantic | PropertySemantic | AssociationSemantic\n\n/**\n * A map to store the definitions of all available data semantics.\n * This acts as a central registry for the application.\n */\nexport const DataSemantics: Record<SemanticType, DataSemantic> = {\n //\n // Identity & Authentication\n //\n\n [SemanticType.User]: {\n id: SemanticType.User,\n displayName: 'User Entity',\n scope: SemanticScope.Entity,\n description: 'System users and accounts',\n category: SemanticCategory.Identity,\n hasConfig: false,\n },\n [SemanticType.Password]: {\n id: SemanticType.Password,\n displayName: 'User Password',\n scope: SemanticScope.Property,\n description: 'Secure password field',\n category: SemanticCategory.Identity,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.UserRole]: {\n id: SemanticType.UserRole,\n displayName: 'User Role Field',\n scope: SemanticScope.Property,\n description: 'User permissions and access level',\n category: SemanticCategory.Identity,\n applicableDataTypes: ['string'],\n hasConfig: false,\n },\n [SemanticType.ResourceOwnerIdentifier]: {\n id: SemanticType.ResourceOwnerIdentifier,\n displayName: 'Resource Owner Identifier',\n scope: SemanticScope.Association,\n description: 'Links record to owner user',\n category: SemanticCategory.Identity,\n hasConfig: false,\n },\n\n //\n // Timestamps & Versioning\n //\n\n [SemanticType.CreatedTimestamp]: {\n id: SemanticType.CreatedTimestamp,\n displayName: 'Creation Timestamp',\n scope: SemanticScope.Property,\n description: 'When record was created',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['datetime'],\n hasConfig: false,\n },\n [SemanticType.UpdatedTimestamp]: {\n id: SemanticType.UpdatedTimestamp,\n displayName: 'Update Timestamp',\n scope: SemanticScope.Property,\n description: 'When record was last modified',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['datetime'],\n hasConfig: false,\n },\n [SemanticType.DeletedTimestamp]: {\n id: SemanticType.DeletedTimestamp,\n displayName: 'Soft Delete Timestamp',\n scope: SemanticScope.Property,\n description: 'When record was marked deleted',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['datetime'],\n hasConfig: false,\n },\n [SemanticType.DeletedFlag]: {\n id: SemanticType.DeletedFlag,\n displayName: 'Soft Delete Flag',\n scope: SemanticScope.Property,\n description: 'Mark record as deleted',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['boolean'],\n hasConfig: false,\n },\n [SemanticType.Version]: {\n id: SemanticType.Version,\n displayName: 'Version Number',\n scope: SemanticScope.Property,\n description: 'Auto-incrementing version counter',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['number'],\n hasConfig: false,\n },\n\n //\n // Content & Media\n //\n\n [SemanticType.Title]: {\n id: SemanticType.Title,\n displayName: 'Record Title',\n scope: SemanticScope.Property,\n description: 'Main title or heading',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: false,\n },\n [SemanticType.Description]: {\n id: SemanticType.Description,\n displayName: 'Description',\n scope: SemanticScope.Property,\n description: 'Detailed description text',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.Summary]: {\n id: SemanticType.Summary,\n displayName: 'Summary',\n scope: SemanticScope.Property,\n description: 'Brief summary text',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.Markdown]: {\n id: SemanticType.Markdown,\n displayName: 'Markdown Content',\n scope: SemanticScope.Property,\n description: 'Formatted text content',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.HTML]: {\n id: SemanticType.HTML,\n displayName: 'HTML Content',\n scope: SemanticScope.Property,\n description: 'Rich HTML content',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.ImageURL]: {\n id: SemanticType.ImageURL,\n displayName: 'Image URL',\n scope: SemanticScope.Property,\n description: 'Link to image file',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: false,\n },\n [SemanticType.FileURL]: {\n id: SemanticType.FileURL,\n displayName: 'File URL',\n scope: SemanticScope.Property,\n description: 'Link to file attachment',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: false,\n },\n\n //\n // Business Data\n //\n\n [SemanticType.Status]: {\n id: SemanticType.Status,\n displayName: 'Record Status',\n scope: SemanticScope.Property,\n description: 'Current state of record',\n category: SemanticCategory.Business,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.Price]: {\n id: SemanticType.Price,\n displayName: 'Price',\n scope: SemanticScope.Property,\n description: 'Monetary value with currency',\n category: SemanticCategory.Business,\n applicableDataTypes: ['number', 'string'],\n hasConfig: true,\n },\n [SemanticType.SKU]: {\n id: SemanticType.SKU,\n displayName: 'SKU',\n scope: SemanticScope.Property,\n description: 'Product identification code',\n category: SemanticCategory.Business,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n\n //\n // Contact Information\n //\n\n [SemanticType.Email]: {\n id: SemanticType.Email,\n displayName: 'Email',\n scope: SemanticScope.Property,\n description: 'Email address',\n category: SemanticCategory.Contact,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.Phone]: {\n id: SemanticType.Phone,\n displayName: 'Phone',\n scope: SemanticScope.Property,\n description: 'Phone number',\n category: SemanticCategory.Contact,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.URL]: {\n id: SemanticType.URL,\n displayName: 'URL',\n scope: SemanticScope.Property,\n description: 'Web address or link',\n category: SemanticCategory.Contact,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n\n //\n // Classification & Organization\n //\n\n [SemanticType.PublicUniqueName]: {\n id: SemanticType.PublicUniqueName,\n displayName: 'Public Unique Name (Slug)',\n scope: SemanticScope.Property,\n description: 'URL-friendly unique identifier',\n category: SemanticCategory.Organization,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.Tags]: {\n id: SemanticType.Tags,\n displayName: 'Tags',\n scope: SemanticScope.Association,\n description: 'Enable tagging functionality',\n category: SemanticCategory.Organization,\n hasConfig: true,\n },\n [SemanticType.Categories]: {\n id: SemanticType.Categories,\n displayName: 'Categories',\n scope: SemanticScope.Association,\n description: 'Enable categorization functionality',\n category: SemanticCategory.Organization,\n hasConfig: true,\n },\n\n //\n // Location & Geography\n //\n\n [SemanticType.GeospatialCoordinates]: {\n id: SemanticType.GeospatialCoordinates,\n displayName: 'Geospatial Coordinates',\n scope: SemanticScope.Property,\n description: 'Location coordinates',\n category: SemanticCategory.Location,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n\n //\n // Computed Values\n //\n\n [SemanticType.Calculated]: {\n id: SemanticType.Calculated,\n displayName: 'Calculated',\n scope: SemanticScope.Property,\n description: 'Auto-calculated field value',\n category: SemanticCategory.Computed,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.Derived]: {\n id: SemanticType.Derived,\n displayName: 'Derived',\n scope: SemanticScope.Property,\n description: 'Value derived from other fields',\n category: SemanticCategory.Computed,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n}\n\nexport function getSemanticsByCategory(): Record<SemanticCategory, DataSemantic[]>\nexport function getSemanticsByCategory(scope: SemanticScope.Entity): Record<SemanticCategory, EntitySemantic[]>\nexport function getSemanticsByCategory(scope: SemanticScope.Property): Record<SemanticCategory, PropertySemantic[]>\nexport function getSemanticsByCategory(\n scope: SemanticScope.Association\n): Record<SemanticCategory, AssociationSemantic[]>\n\n/**\n * Helper function to get all semantics grouped by category.\n * Useful for organizing semantics in UI dropdowns and forms.\n *\n * @param scope Optional scope to filter semantics by (Entity, Property, Association)\n */\nexport function getSemanticsByCategory(scope?: SemanticScope): Record<SemanticCategory, DataSemantic[]> {\n const result: Record<SemanticCategory, DataSemantic[]> = {\n [SemanticCategory.Identity]: [],\n [SemanticCategory.Lifecycle]: [],\n [SemanticCategory.Content]: [],\n [SemanticCategory.Business]: [],\n [SemanticCategory.Contact]: [],\n [SemanticCategory.Organization]: [],\n [SemanticCategory.Location]: [],\n [SemanticCategory.Computed]: [],\n }\n\n Object.values(DataSemantics).forEach((semantic) => {\n // If a scope is provided, filter semantics by that scope\n if (scope && semantic.scope !== scope) {\n return\n }\n result[semantic.category].push(semantic)\n })\n\n return result\n}\n\n/**\n * Helper function to get semantics for a specific category.\n * @param category The category to filter by\n * @returns Array of semantics in the specified category\n */\nexport const getSemanticsByCategoryType = (category: SemanticCategory): DataSemantic[] => {\n return Object.values(DataSemantics).filter((semantic) => semantic.category === category)\n}\n\n/**\n * Represents the application of a data semantic to a specific\n * entity or property within a user's data model.\n */\nexport interface AppliedDataSemantic {\n /**\n * The unique identifier of the semantic being applied.\n */\n id: SemanticType\n\n /**\n * Optional configuration or values specific to this application.\n */\n config?: Record<string, unknown>\n}\n"]}
1
+ {"version":3,"file":"Semantics.js","sourceRoot":"","sources":["../../../src/modeling/Semantics.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,CAAN,IAAY,YAuMX;AAvMD,WAAY,YAAY;IACtB,EAAE;IACF,yBAAyB;IACzB,EAAE;IAEF;;OAEG;IACH,sCAAsB,CAAA;IAEtB,EAAE;IACF,2BAA2B;IAC3B,EAAE;IAEF;;;;OAIG;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EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAA;AAC1F,CAAC,CAAA","sourcesContent":["/* eslint-disable no-redeclare */\n/* eslint-disable max-len */\nimport type { DomainPropertyType } from './DataFormat.js'\n\n/**\n * Defines the names for all available data semantics.\n * Using a string enum makes it easy to add or remove semantics in a single place.\n */\nexport enum SemanticType {\n //\n // Entity-Level Semantics\n //\n\n /**\n * Designates a Data Entity that represents users of the system.\n */\n User = 'Semantic#User',\n\n //\n // Property-Level Semantics\n //\n\n /**\n * Annotates the field as the user password.\n * The runtime should treat this field with special care,\n * ensuring it is encrypted and not exposed in API responses.\n */\n Password = 'Semantic#Password',\n /**\n * Designates a Data Property as the `createdAt` timestamp of an entity.\n * This is used to track when the entity was first created.\n */\n CreatedTimestamp = 'Semantic#CreatedTimestamp',\n /**\n * Designates a Data Property as the `updatedAt` timestamp of an entity.\n * This is used to track when the entity was last modified.\n */\n UpdatedTimestamp = 'Semantic#UpdatedTimestamp',\n /**\n * Designates a Data Property as the `deletedAt` timestamp of an entity.\n * This is used to track when the entity was soft-deleted.\n * Soft-deletion means the entity is not physically removed from the database,\n * but marked as deleted for logical deletion purposes.\n */\n DeletedTimestamp = 'Semantic#DeletedTimestamp',\n /**\n * Designates a Data Property as a boolean flag indicating whether the entity is deleted.\n * This is used for soft-deletion, where the entity is not physically removed from the database,\n * but marked as deleted.\n */\n DeletedFlag = 'Semantic#DeletedFlag',\n /**\n * Designates a Data Property as a unique public identifier for a resource (the slug).\n * This is often used in URLs to provide a user-friendly way to access the resource.\n * For example, a blog post might have a public unique name like \"my-first-post\".\n * A URL-friendly text field. The runtime automatically generates a unique, URL-safe string from another field (like a title or name). The user needs to specify which field is used to generate\n * the slug.\n */\n PublicUniqueName = 'Semantic#PublicUniqueName',\n /**\n * A semantic that describes a title of an article, blog post, and so on. This semantic is used with\n * the `PublicUniqueName` to determine which field is responsible for the slug generation. However,\n * we may add more automation related to the `title` property in the future.\n */\n Title = 'Semantic#Title',\n /**\n * Designates a Data Property as the `role` of a user within the system.\n * This is used to define the user's permissions and access levels.\n * For example, a user with the role of \"admin\" would have elevated permissions\n * compared to a user with the role of \"guest\".\n * Roles are defined on the entity as enums, or as a string property with a controlled vocabulary.\n */\n UserRole = 'Semantic#UserRole',\n /**\n * A text or enum field to represent the state of a record (e.g., `draft`, `published`, `pending_review`, `archived`).\n *\n * Defined behaviors:\n * - State-Based Filtering: Automatically prevents public users from seeing records in a draft state.\n * - State Transitions: In principle, the runtime should prevent the user from skipping some states.\n * For example, when the record is in the `draft` state, it cannot be moved to the `archived` state without publishing it first. However,\n * we do not have enough customer feedback to design this functionality correctly right now, so\n * it serves as a placeholder semantic annotation.\n */\n Status = 'Semantic#Status',\n\n /**\n * Annotates an integer field that automatically increments.\n * The runtime automatically increments this number on every update, providing a simple way\n * to track changes and implement optimistic locking to prevent mid-air collisions.\n */\n Version = 'Semantic#Version',\n\n /**\n * Annotates a field that holds a reference to an image data via an URL.\n * The application + runtime should validate that the input is a well-formed URL.\n */\n ImageURL = 'Semantic#ImageURL',\n\n /**\n * Annotates a field that holds a reference to a file object via an URL. Ity is distinct from the\n * `ImageURL` semantic as it implicitly states that the target is non-image, binary data (an attachment, for example).\n */\n FileURL = 'Semantic#FileURL',\n\n /**\n * Annotates the field as a markdown-interpreted field.\n * When an object is created, the runtime performs additional sanitization to prevent XSS attacks.\n *\n * The annotation describes whether the data should be translated to the HTML output when\n * record is read or the original MD content should be returned.\n */\n Markdown = 'Semantic#Markdown',\n\n /**\n * Annotates the field as containing HTML content.\n * The runtime performs sanitization to prevent XSS attacks and validates HTML structure.\n *\n * The annotation describes whether the data should be rendered as HTML output when\n * record is read or the original HTML content should be returned.\n */\n HTML = 'Semantic#HTML',\n\n /**\n * Annotates a field that holds geospatial coordinate data (latitude/longitude).\n * The runtime automatically generates API capabilities for location-based queries,\n * such as \"find all restaurants within a 5-mile radius.\"\n *\n * The field should contain coordinate data in a standard format:\n * - \"40.7128,-74.0060\" (lat,lon)\n * - \"POINT(-74.0060 40.7128)\" (PostGIS format)\n * - \"40.7128°N, 74.0060°W\" (degree format)\n *\n * Defined behaviors:\n * - Spatial Indexing: The runtime automatically creates spatial indexes for efficient location-based queries\n * - Distance Queries: Enables API endpoints for finding records within specified distances\n * - Coordinate Validation: Validates that the input follows proper coordinate format\n * - PostGIS Integration: When using PostgreSQL, automatically maps to PostGIS geometry types\n */\n GeospatialCoordinates = 'Semantic#GeospatialCoordinates',\n\n /**\n * Annotates a field as an email address with validation and verification options.\n */\n Email = 'Semantic#Email',\n /**\n * Annotates a field as a phone number with validation and formatting options.\n */\n Phone = 'Semantic#Phone',\n /**\n * Annotates a field as a monetary value with currency support and precision control.\n * Can store simple decimal amounts or complex objects with amount and currency.\n * Enforces proper decimal handling to avoid floating-point errors.\n */\n Currency = 'Semantic#Currency',\n /**\n * Annotates a field as a URL with validation and allowed protocols.\n */\n URL = 'Semantic#URL',\n /**\n * Annotates a field as a Stock Keeping Unit (SKU).\n * Enforces uniqueness at the database level, critical for product catalogs.\n * Provides automatic validation and formatting for product identification codes.\n */\n SKU = 'Semantic#SKU',\n /**\n * Annotates a field as a long-form description.\n */\n Description = 'Semantic#Description',\n /**\n * Annotates a field as a short summary.\n */\n Summary = 'Semantic#Summary',\n /**\n * Annotates a field as a calculated value based on a formula.\n */\n Calculated = 'Semantic#Calculated',\n /**\n * Annotates a field as derived from other fields.\n */\n Derived = 'Semantic#Derived',\n\n //\n // Association-Level Semantics\n //\n\n /**\n * Designates an association that links a resource to a \"User\" entity instance.\n * This is used to indicate ownership of the resource for access control purposes.\n * For example, a blog post might have a resource owner identifier that points to the user who created it.\n *\n * Defined behaviors:\n * - Automatic Ownership: When a new record is created, this field is automatically populated with the ID of the authenticated user. It also creates a foreign relationship to the `User` semantic object.\n * - Scoped Access: The runtime automatically filters list and read operations to show only records where the Owner matches the current user. update and delete operations are similarly restricted.\n */\n ResourceOwnerIdentifier = 'Semantic#ResourceOwnerIdentifier',\n /**\n * Annotates an association as supporting tag functionality.\n * Applied to associations between entities to enable tagging behavior.\n * For example, a Product-Category association with Tags semantic enables product tagging.\n */\n Tags = 'Semantic#Tags',\n /**\n * Annotates an association as supporting category functionality.\n * Applied to associations between entities to enable categorization behavior.\n * For example, a Product-Category association with Categories semantic enables product categorization.\n */\n Categories = 'Semantic#Categories',\n}\n\n/**\n * Defines the scope at which a semantic can be applied.\n */\nexport enum SemanticScope {\n /**\n * The semantic applies to an entire Data Entity.\n * This is used for semantics that provide context or constraints at the entity level.\n */\n Entity = 'Entity',\n /**\n * The semantic applies to a single Data Property.\n * This is used for semantics that provide context or constraints at the property level.\n */\n Property = 'Property',\n /**\n * The semantic applies to an Association between Data Entities.\n * This is used for semantics that provide context or constraints at the association level.\n */\n Association = 'Association',\n}\n\n/**\n * Defines categories for organizing semantics in the UI.\n */\nexport enum SemanticCategory {\n /**\n * User management, authentication, and access control\n */\n Identity = 'Identity & Authentication',\n /**\n * Timestamps, versioning, and record lifecycle\n */\n Lifecycle = 'Timestamps & Versioning',\n /**\n * Text content, media, and rich content types\n */\n Content = 'Content & Media',\n /**\n * Business-specific data like pricing, inventory, status\n */\n Business = 'Business Data',\n /**\n * Contact information and communication\n */\n Contact = 'Contact Information',\n /**\n * Organization, categorization, and tagging\n */\n Organization = 'Classification & Organization',\n /**\n * Location and geographical data\n */\n Location = 'Location & Geography',\n /**\n * Calculated and derived values\n */\n Computed = 'Computed Values',\n}\n\n/**\n * A base interface for all Data Semantics, containing common properties.\n * A semantic is an annotation applied to a Data Entity, Property, or Association\n * to provide additional context or constraints.\n * This interface is extended by more specific semantic types.\n */\ninterface BaseDataSemantic {\n /**\n * A unique identifier for the semantic definition.\n */\n id: SemanticType\n /**\n * A human-readable name for the semantic.\n */\n displayName: string\n /**\n * A description of the semantic's purpose and impact.\n */\n description: string\n /**\n * Specifies whether the semantic applies to an Entity, Property, or Association.\n */\n scope: SemanticScope\n /**\n * The category this semantic belongs to for UI organization.\n */\n category: SemanticCategory\n /**\n * Whether the semantic has a configuration or additional options.\n * This is used to determine if the semantic requires additional setup or configuration.\n */\n hasConfig: boolean\n}\n\n/**\n * Represents a semantic that can be applied to an entire Data Entity.\n */\nexport interface EntitySemantic extends BaseDataSemantic {\n scope: SemanticScope.Entity\n}\n\n/**\n * Represents a semantic that can be applied to a single property.\n */\nexport interface PropertySemantic extends BaseDataSemantic {\n scope: SemanticScope.Property\n /**\n * Optional array of data types this semantic can be applied to.\n * Enforces constraints, e.g., DeletedTimestamp on a DateTime property.\n */\n applicableDataTypes?: DomainPropertyType[]\n}\n\n/**\n * Represents a semantic that can be applied to an association between entities.\n */\nexport interface AssociationSemantic extends BaseDataSemantic {\n scope: SemanticScope.Association\n}\n\n/**\n * A type guard to check if a semantic is an EntitySemantic.\n */\nexport const isEntitySemantic = (semantic: DataSemantic): semantic is EntitySemantic =>\n semantic.scope === SemanticScope.Entity\n\n/**\n * A type guard to check if a semantic is a PropertySemantic.\n */\nexport const isPropertySemantic = (semantic: DataSemantic): semantic is PropertySemantic =>\n semantic.scope === SemanticScope.Property\n\n/**\n * A type guard to check if a semantic is a AssociationSemantic.\n */\nexport const isAssociationSemantic = (semantic: DataSemantic): semantic is AssociationSemantic =>\n semantic.scope === SemanticScope.Association\n\n/**\n * Union type for any kind of data semantic\n */\nexport type DataSemantic = EntitySemantic | PropertySemantic | AssociationSemantic\n\n/**\n * A map to store the definitions of all available data semantics.\n * This acts as a central registry for the application.\n */\nexport const DataSemantics: Record<SemanticType, DataSemantic> = {\n //\n // Identity & Authentication\n //\n\n [SemanticType.User]: {\n id: SemanticType.User,\n displayName: 'User Entity',\n scope: SemanticScope.Entity,\n description: 'System users and accounts',\n category: SemanticCategory.Identity,\n hasConfig: false,\n },\n [SemanticType.Password]: {\n id: SemanticType.Password,\n displayName: 'User Password',\n scope: SemanticScope.Property,\n description: 'Secure password field',\n category: SemanticCategory.Identity,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.UserRole]: {\n id: SemanticType.UserRole,\n displayName: 'User Role Field',\n scope: SemanticScope.Property,\n description: 'User permissions and access level',\n category: SemanticCategory.Identity,\n applicableDataTypes: ['string'],\n hasConfig: false,\n },\n [SemanticType.ResourceOwnerIdentifier]: {\n id: SemanticType.ResourceOwnerIdentifier,\n displayName: 'Resource Owner Identifier',\n scope: SemanticScope.Association,\n description: 'Links record to owner user',\n category: SemanticCategory.Identity,\n hasConfig: false,\n },\n\n //\n // Timestamps & Versioning\n //\n\n [SemanticType.CreatedTimestamp]: {\n id: SemanticType.CreatedTimestamp,\n displayName: 'Creation Timestamp',\n scope: SemanticScope.Property,\n description: 'When record was created',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['datetime'],\n hasConfig: false,\n },\n [SemanticType.UpdatedTimestamp]: {\n id: SemanticType.UpdatedTimestamp,\n displayName: 'Update Timestamp',\n scope: SemanticScope.Property,\n description: 'When record was last modified',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['datetime'],\n hasConfig: false,\n },\n [SemanticType.DeletedTimestamp]: {\n id: SemanticType.DeletedTimestamp,\n displayName: 'Soft Delete Timestamp',\n scope: SemanticScope.Property,\n description: 'When record was marked deleted',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['datetime'],\n hasConfig: false,\n },\n [SemanticType.DeletedFlag]: {\n id: SemanticType.DeletedFlag,\n displayName: 'Soft Delete Flag',\n scope: SemanticScope.Property,\n description: 'Mark record as deleted',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['boolean'],\n hasConfig: false,\n },\n [SemanticType.Version]: {\n id: SemanticType.Version,\n displayName: 'Version Number',\n scope: SemanticScope.Property,\n description: 'Auto-incrementing version counter',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['number'],\n hasConfig: false,\n },\n\n //\n // Content & Media\n //\n\n [SemanticType.Title]: {\n id: SemanticType.Title,\n displayName: 'Record Title',\n scope: SemanticScope.Property,\n description: 'Main title or heading',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: false,\n },\n [SemanticType.Description]: {\n id: SemanticType.Description,\n displayName: 'Description',\n scope: SemanticScope.Property,\n description: 'Detailed description text',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: false,\n },\n [SemanticType.Summary]: {\n id: SemanticType.Summary,\n displayName: 'Summary',\n scope: SemanticScope.Property,\n description: 'Brief summary text',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: false,\n },\n [SemanticType.Markdown]: {\n id: SemanticType.Markdown,\n displayName: 'Markdown Content',\n scope: SemanticScope.Property,\n description: 'Formatted text content',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.HTML]: {\n id: SemanticType.HTML,\n displayName: 'HTML Content',\n scope: SemanticScope.Property,\n description: 'Rich HTML content',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.ImageURL]: {\n id: SemanticType.ImageURL,\n displayName: 'Image URL',\n scope: SemanticScope.Property,\n description: 'Link to image file',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: false,\n },\n [SemanticType.FileURL]: {\n id: SemanticType.FileURL,\n displayName: 'File URL',\n scope: SemanticScope.Property,\n description: 'Link to file attachment',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: false,\n },\n\n //\n // Business Data\n //\n\n [SemanticType.Status]: {\n id: SemanticType.Status,\n displayName: 'Record Status',\n scope: SemanticScope.Property,\n description: 'Current state of record',\n category: SemanticCategory.Business,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.Currency]: {\n id: SemanticType.Currency,\n displayName: 'Currency',\n scope: SemanticScope.Property,\n description: 'Monetary value with currency',\n category: SemanticCategory.Business,\n applicableDataTypes: ['number', 'string'],\n hasConfig: true,\n },\n [SemanticType.SKU]: {\n id: SemanticType.SKU,\n displayName: 'SKU',\n scope: SemanticScope.Property,\n description: 'Product identification code',\n category: SemanticCategory.Business,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n\n //\n // Contact Information\n //\n\n [SemanticType.Email]: {\n id: SemanticType.Email,\n displayName: 'Email',\n scope: SemanticScope.Property,\n description: 'Email address',\n category: SemanticCategory.Contact,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.Phone]: {\n id: SemanticType.Phone,\n displayName: 'Phone',\n scope: SemanticScope.Property,\n description: 'Phone number',\n category: SemanticCategory.Contact,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.URL]: {\n id: SemanticType.URL,\n displayName: 'URL',\n scope: SemanticScope.Property,\n description: 'Web address or link',\n category: SemanticCategory.Contact,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n\n //\n // Classification & Organization\n //\n\n [SemanticType.PublicUniqueName]: {\n id: SemanticType.PublicUniqueName,\n displayName: 'Public Unique Name (Slug)',\n scope: SemanticScope.Property,\n description: 'URL-friendly unique identifier',\n category: SemanticCategory.Organization,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.Tags]: {\n id: SemanticType.Tags,\n displayName: 'Tags',\n scope: SemanticScope.Association,\n description: 'Enable tagging functionality',\n category: SemanticCategory.Organization,\n hasConfig: true,\n },\n [SemanticType.Categories]: {\n id: SemanticType.Categories,\n displayName: 'Categories',\n scope: SemanticScope.Association,\n description: 'Enable categorization functionality',\n category: SemanticCategory.Organization,\n hasConfig: true,\n },\n\n //\n // Location & Geography\n //\n\n [SemanticType.GeospatialCoordinates]: {\n id: SemanticType.GeospatialCoordinates,\n displayName: 'Geospatial Coordinates',\n scope: SemanticScope.Property,\n description: 'Location coordinates',\n category: SemanticCategory.Location,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n\n //\n // Computed Values\n //\n\n [SemanticType.Calculated]: {\n id: SemanticType.Calculated,\n displayName: 'Calculated',\n scope: SemanticScope.Property,\n description: 'Auto-calculated field value',\n category: SemanticCategory.Computed,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.Derived]: {\n id: SemanticType.Derived,\n displayName: 'Derived',\n scope: SemanticScope.Property,\n description: 'Value derived from other fields',\n category: SemanticCategory.Computed,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n}\n\nexport function getSemanticsByCategory(): Record<SemanticCategory, DataSemantic[]>\nexport function getSemanticsByCategory(scope: SemanticScope.Entity): Record<SemanticCategory, EntitySemantic[]>\nexport function getSemanticsByCategory(scope: SemanticScope.Property): Record<SemanticCategory, PropertySemantic[]>\nexport function getSemanticsByCategory(\n scope: SemanticScope.Association\n): Record<SemanticCategory, AssociationSemantic[]>\n\n/**\n * Helper function to get all semantics grouped by category.\n * Useful for organizing semantics in UI dropdowns and forms.\n *\n * @param scope Optional scope to filter semantics by (Entity, Property, Association)\n */\nexport function getSemanticsByCategory(scope?: SemanticScope): Record<SemanticCategory, DataSemantic[]> {\n const result: Record<SemanticCategory, DataSemantic[]> = {\n [SemanticCategory.Identity]: [],\n [SemanticCategory.Lifecycle]: [],\n [SemanticCategory.Content]: [],\n [SemanticCategory.Business]: [],\n [SemanticCategory.Contact]: [],\n [SemanticCategory.Organization]: [],\n [SemanticCategory.Location]: [],\n [SemanticCategory.Computed]: [],\n }\n\n Object.values(DataSemantics).forEach((semantic) => {\n // If a scope is provided, filter semantics by that scope\n if (scope && semantic.scope !== scope) {\n return\n }\n result[semantic.category].push(semantic)\n })\n\n return result\n}\n\n/**\n * Helper function to get semantics for a specific category.\n * @param category The category to filter by\n * @returns Array of semantics in the specified category\n */\nexport const getSemanticsByCategoryType = (category: SemanticCategory): DataSemantic[] => {\n return Object.values(DataSemantics).filter((semantic) => semantic.category === category)\n}\n\n/**\n * Represents the application of a data semantic to a specific\n * entity or property within a user's data model.\n */\nexport interface AppliedDataSemantic {\n /**\n * The unique identifier of the semantic being applied.\n */\n id: SemanticType\n\n /**\n * Optional configuration or values specific to this application.\n */\n config?: Record<string, unknown>\n}\n"]}
@@ -3,12 +3,12 @@ import { SemanticType } from '../Semantics.js';
3
3
  /**
4
4
  * Supported storage formats for monetary values.
5
5
  */
6
- export type PriceStorageFormat = 'decimal' | 'integer_cents' | 'complex_object';
6
+ export type CurrencyStorageFormat = 'decimal' | 'integer_cents' | 'complex_object';
7
7
  /**
8
- * Configuration options for the Price semantic.
8
+ * Configuration options for the Currency semantic.
9
9
  * Controls monetary value storage, validation, currency handling, and precision.
10
10
  */
11
- export interface PriceConfig {
11
+ export interface CurrencyConfig {
12
12
  /**
13
13
  * How the monetary value is stored in the database.
14
14
  *
@@ -16,7 +16,7 @@ export interface PriceConfig {
16
16
  * - 'integer_cents': Store as INTEGER in smallest currency unit (e.g., 1999 for $19.99)
17
17
  * - 'complex_object': Store as JSON/JSONB with amount and currency (e.g., {"amount": 1999, "currency": "USD"})
18
18
  */
19
- storageFormat?: PriceStorageFormat;
19
+ storageFormat?: CurrencyStorageFormat;
20
20
  /**
21
21
  * Default currency code (ISO 4217) when not specified.
22
22
  * Required when using 'decimal' or 'integer_cents' format.
@@ -42,7 +42,7 @@ export interface PriceConfig {
42
42
  */
43
43
  validateCurrencyCode?: boolean;
44
44
  /**
45
- * Custom metadata for the price field.
45
+ * Custom metadata for the currency field.
46
46
  */
47
47
  metadata?: Record<string, unknown>;
48
48
  /**
@@ -51,52 +51,52 @@ export interface PriceConfig {
51
51
  [key: string]: unknown;
52
52
  }
53
53
  /**
54
- * Type-safe configuration for Price semantic.
54
+ * Type-safe configuration for Currency semantic.
55
55
  */
56
- export interface AppliedPriceSemantic extends AppliedDataSemantic {
57
- id: SemanticType.Price;
58
- config?: PriceConfig;
56
+ export interface AppliedCurrencySemantic extends AppliedDataSemantic {
57
+ id: SemanticType.Currency;
58
+ config?: CurrencyConfig;
59
59
  }
60
60
  /**
61
- * Type guard to check if a semantic is a Price semantic.
61
+ * Type guard to check if a semantic is a Currency semantic.
62
62
  */
63
- export declare const isPriceSemantic: (semantic: AppliedDataSemantic) => semantic is AppliedPriceSemantic;
63
+ export declare const isCurrencySemantic: (semantic: AppliedDataSemantic) => semantic is AppliedCurrencySemantic;
64
64
  /**
65
- * Helper function to create a Price semantic with configuration.
65
+ * Helper function to create a Currency semantic with configuration.
66
66
  */
67
- export declare const createPriceSemantic: (config?: PriceConfig) => AppliedPriceSemantic;
67
+ export declare const createCurrencySemantic: (config?: CurrencyConfig) => AppliedCurrencySemantic;
68
68
  /**
69
- * Default configuration for Price semantic.
69
+ * Default configuration for Currency semantic.
70
70
  * Optimized for common e-commerce use cases with USD currency.
71
71
  */
72
- export declare const DEFAULT_PRICE_CONFIG: PriceConfig;
72
+ export declare const DEFAULT_CURRENCY_CONFIG: CurrencyConfig;
73
73
  /**
74
74
  * Predefined configurations for common use cases.
75
75
  */
76
- export declare const PRICE_PRESETS: {
76
+ export declare const CURRENCY_PRESETS: {
77
77
  /**
78
78
  * Simple USD decimal storage - good for most e-commerce sites.
79
79
  */
80
- readonly USD_DECIMAL: AppliedPriceSemantic;
80
+ readonly USD_DECIMAL: AppliedCurrencySemantic;
81
81
  /**
82
82
  * Integer cents storage - avoids floating point issues, good for financial calculations.
83
83
  */
84
- readonly USD_CENTS: AppliedPriceSemantic;
84
+ readonly USD_CENTS: AppliedCurrencySemantic;
85
85
  /**
86
86
  * Multi-currency support with complex object storage.
87
87
  */
88
- readonly MULTI_CURRENCY: AppliedPriceSemantic;
88
+ readonly MULTI_CURRENCY: AppliedCurrencySemantic;
89
89
  /**
90
90
  * Configuration that allows negative values for refunds, discounts, etc.
91
91
  */
92
- readonly WITH_NEGATIVES: AppliedPriceSemantic;
92
+ readonly WITH_NEGATIVES: AppliedCurrencySemantic;
93
93
  /**
94
94
  * High-precision configuration for cryptocurrency or precious metals.
95
95
  */
96
- readonly HIGH_PRECISION: AppliedPriceSemantic;
96
+ readonly HIGH_PRECISION: AppliedCurrencySemantic;
97
97
  };
98
98
  /**
99
- * Helper function to validate a price configuration.
99
+ * Helper function to validate a currency configuration.
100
100
  */
101
- export declare const validatePriceConfig: (config: PriceConfig) => string[];
102
- //# sourceMappingURL=Price.d.ts.map
101
+ export declare const validateCurrencyConfig: (config: CurrencyConfig) => string[];
102
+ //# sourceMappingURL=Currency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../../../src/modeling/definitions/Currency.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,eAAe,GAAG,gBAAgB,CAAA;AAElF;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,qBAAqB,CAAA;IAErC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAE5B;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IAEtB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAE9B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAElC;;OAEG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,mBAAmB;IAClE,EAAE,EAAE,YAAY,CAAC,QAAQ,CAAA;IACzB,MAAM,CAAC,EAAE,cAAc,CAAA;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,UAAU,mBAAmB,KAAG,QAAQ,IAAI,uBAE9E,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAAI,SAAQ,cAAmB,KAAG,uBAepE,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,cAMrC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB;IAC3B;;OAEG;;IAQH;;OAEG;;IAQH;;OAEG;;IAQH;;OAEG;;IAQH;;OAEG;;CAOK,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAAI,QAAQ,cAAc,KAAG,MAAM,EAYrE,CAAA"}
@@ -1,16 +1,16 @@
1
1
  import { SemanticType } from '../Semantics.js';
2
2
  /**
3
- * Type guard to check if a semantic is a Price semantic.
3
+ * Type guard to check if a semantic is a Currency semantic.
4
4
  */
5
- export const isPriceSemantic = (semantic) => {
6
- return semantic.id === SemanticType.Price;
5
+ export const isCurrencySemantic = (semantic) => {
6
+ return semantic.id === SemanticType.Currency;
7
7
  };
8
8
  /**
9
- * Helper function to create a Price semantic with configuration.
9
+ * Helper function to create a Currency semantic with configuration.
10
10
  */
11
- export const createPriceSemantic = (config = {}) => {
11
+ export const createCurrencySemantic = (config = {}) => {
12
12
  const mergedConfig = {
13
- ...DEFAULT_PRICE_CONFIG,
13
+ ...DEFAULT_CURRENCY_CONFIG,
14
14
  ...config,
15
15
  };
16
16
  // Merge metadata separately
@@ -18,15 +18,15 @@ export const createPriceSemantic = (config = {}) => {
18
18
  mergedConfig.metadata = { ...config.metadata };
19
19
  }
20
20
  return {
21
- id: SemanticType.Price,
21
+ id: SemanticType.Currency,
22
22
  config: mergedConfig,
23
23
  };
24
24
  };
25
25
  /**
26
- * Default configuration for Price semantic.
26
+ * Default configuration for Currency semantic.
27
27
  * Optimized for common e-commerce use cases with USD currency.
28
28
  */
29
- export const DEFAULT_PRICE_CONFIG = {
29
+ export const DEFAULT_CURRENCY_CONFIG = {
30
30
  storageFormat: 'decimal',
31
31
  defaultCurrency: 'USD',
32
32
  decimalPlaces: 2,
@@ -36,11 +36,11 @@ export const DEFAULT_PRICE_CONFIG = {
36
36
  /**
37
37
  * Predefined configurations for common use cases.
38
38
  */
39
- export const PRICE_PRESETS = {
39
+ export const CURRENCY_PRESETS = {
40
40
  /**
41
41
  * Simple USD decimal storage - good for most e-commerce sites.
42
42
  */
43
- USD_DECIMAL: createPriceSemantic({
43
+ USD_DECIMAL: createCurrencySemantic({
44
44
  storageFormat: 'decimal',
45
45
  defaultCurrency: 'USD',
46
46
  decimalPlaces: 2,
@@ -49,7 +49,7 @@ export const PRICE_PRESETS = {
49
49
  /**
50
50
  * Integer cents storage - avoids floating point issues, good for financial calculations.
51
51
  */
52
- USD_CENTS: createPriceSemantic({
52
+ USD_CENTS: createCurrencySemantic({
53
53
  storageFormat: 'integer_cents',
54
54
  defaultCurrency: 'USD',
55
55
  decimalPlaces: 2,
@@ -58,7 +58,7 @@ export const PRICE_PRESETS = {
58
58
  /**
59
59
  * Multi-currency support with complex object storage.
60
60
  */
61
- MULTI_CURRENCY: createPriceSemantic({
61
+ MULTI_CURRENCY: createCurrencySemantic({
62
62
  storageFormat: 'complex_object',
63
63
  allowedCurrencies: ['USD', 'EUR', 'GBP', 'JPY', 'CAD'],
64
64
  decimalPlaces: 2,
@@ -67,7 +67,7 @@ export const PRICE_PRESETS = {
67
67
  /**
68
68
  * Configuration that allows negative values for refunds, discounts, etc.
69
69
  */
70
- WITH_NEGATIVES: createPriceSemantic({
70
+ WITH_NEGATIVES: createCurrencySemantic({
71
71
  storageFormat: 'decimal',
72
72
  defaultCurrency: 'USD',
73
73
  decimalPlaces: 2,
@@ -76,7 +76,7 @@ export const PRICE_PRESETS = {
76
76
  /**
77
77
  * High-precision configuration for cryptocurrency or precious metals.
78
78
  */
79
- HIGH_PRECISION: createPriceSemantic({
79
+ HIGH_PRECISION: createCurrencySemantic({
80
80
  storageFormat: 'decimal',
81
81
  defaultCurrency: 'BTC',
82
82
  decimalPlaces: 8,
@@ -84,9 +84,9 @@ export const PRICE_PRESETS = {
84
84
  }),
85
85
  };
86
86
  /**
87
- * Helper function to validate a price configuration.
87
+ * Helper function to validate a currency configuration.
88
88
  */
89
- export const validatePriceConfig = (config) => {
89
+ export const validateCurrencyConfig = (config) => {
90
90
  const errors = [];
91
91
  if (config.storageFormat !== 'complex_object' && !config.defaultCurrency) {
92
92
  errors.push('defaultCurrency is required when storageFormat is not complex_object');
@@ -96,4 +96,4 @@ export const validatePriceConfig = (config) => {
96
96
  }
97
97
  return errors;
98
98
  };
99
- //# sourceMappingURL=Price.js.map
99
+ //# sourceMappingURL=Currency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Currency.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Currency.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAqE9C;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAA6B,EAAuC,EAAE;IACvG,OAAO,QAAQ,CAAC,EAAE,KAAK,YAAY,CAAC,QAAQ,CAAA;AAC9C,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,SAAyB,EAAE,EAA2B,EAAE;IAC7F,MAAM,YAAY,GAAG;QACnB,GAAG,uBAAuB;QAC1B,GAAG,MAAM;KACV,CAAA;IAED,4BAA4B;IAC5B,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,YAAY,CAAC,QAAQ,GAAG,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAA;IAChD,CAAC;IAED,OAAO;QACL,EAAE,EAAE,YAAY,CAAC,QAAQ;QACzB,MAAM,EAAE,YAAY;KACrB,CAAA;AACH,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAmB;IACrD,aAAa,EAAE,SAAS;IACxB,eAAe,EAAE,KAAK;IACtB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,KAAK;IACpB,oBAAoB,EAAE,IAAI;CAC3B,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B;;OAEG;IACH,WAAW,EAAE,sBAA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MAAM,CAAA;AACf,CAAC,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Supported storage formats for monetary values.\n */\nexport type CurrencyStorageFormat = 'decimal' | 'integer_cents' | 'complex_object'\n\n/**\n * Configuration options for the Currency semantic.\n * Controls monetary value storage, validation, currency handling, and precision.\n */\nexport interface CurrencyConfig {\n /**\n * How the monetary value is stored in the database.\n *\n * - 'decimal': Store as DECIMAL/NUMERIC type (e.g., 19.99)\n * - 'integer_cents': Store as INTEGER in smallest currency unit (e.g., 1999 for $19.99)\n * - 'complex_object': Store as JSON/JSONB with amount and currency (e.g., {\"amount\": 1999, \"currency\": \"USD\"})\n */\n storageFormat?: CurrencyStorageFormat\n\n /**\n * Default currency code (ISO 4217) when not specified.\n * Required when using 'decimal' or 'integer_cents' format.\n */\n defaultCurrency?: string\n\n /**\n * List of allowed currency codes (ISO 4217).\n * If not specified, all valid ISO 4217 currencies are allowed.\n */\n allowedCurrencies?: string[]\n\n /**\n * Number of decimal places for precision.\n * Default: 2 (for most currencies like USD, EUR)\n * Some currencies may need 0 (JPY, KRW) or 3 (BHD, KWD)\n */\n decimalPlaces?: number\n\n /**\n * Whether negative values are allowed (for refunds, discounts, etc.).\n */\n allowNegative?: boolean\n\n /**\n * Whether to automatically validate currency codes against ISO 4217.\n */\n validateCurrencyCode?: boolean\n\n /**\n * Custom metadata for the currency field.\n */\n metadata?: Record<string, unknown>\n\n /**\n * Index signature to allow additional properties.\n */\n [key: string]: unknown\n}\n\n/**\n * Type-safe configuration for Currency semantic.\n */\nexport interface AppliedCurrencySemantic extends AppliedDataSemantic {\n id: SemanticType.Currency\n config?: CurrencyConfig\n}\n\n/**\n * Type guard to check if a semantic is a Currency semantic.\n */\nexport const isCurrencySemantic = (semantic: AppliedDataSemantic): semantic is AppliedCurrencySemantic => {\n return semantic.id === SemanticType.Currency\n}\n\n/**\n * Helper function to create a Currency semantic with configuration.\n */\nexport const createCurrencySemantic = (config: CurrencyConfig = {}): AppliedCurrencySemantic => {\n const mergedConfig = {\n ...DEFAULT_CURRENCY_CONFIG,\n ...config,\n }\n\n // Merge metadata separately\n if (config.metadata) {\n mergedConfig.metadata = { ...config.metadata }\n }\n\n return {\n id: SemanticType.Currency,\n config: mergedConfig,\n }\n}\n\n/**\n * Default configuration for Currency semantic.\n * Optimized for common e-commerce use cases with USD currency.\n */\nexport const DEFAULT_CURRENCY_CONFIG: CurrencyConfig = {\n storageFormat: 'decimal',\n defaultCurrency: 'USD',\n decimalPlaces: 2,\n allowNegative: false,\n validateCurrencyCode: true,\n}\n\n/**\n * Predefined configurations for common use cases.\n */\nexport const CURRENCY_PRESETS = {\n /**\n * Simple USD decimal storage - good for most e-commerce sites.\n */\n USD_DECIMAL: createCurrencySemantic({\n storageFormat: 'decimal',\n defaultCurrency: 'USD',\n decimalPlaces: 2,\n allowNegative: false,\n }),\n\n /**\n * Integer cents storage - avoids floating point issues, good for financial calculations.\n */\n USD_CENTS: createCurrencySemantic({\n storageFormat: 'integer_cents',\n defaultCurrency: 'USD',\n decimalPlaces: 2,\n allowNegative: false,\n }),\n\n /**\n * Multi-currency support with complex object storage.\n */\n MULTI_CURRENCY: createCurrencySemantic({\n storageFormat: 'complex_object',\n allowedCurrencies: ['USD', 'EUR', 'GBP', 'JPY', 'CAD'],\n decimalPlaces: 2,\n allowNegative: false,\n }),\n\n /**\n * Configuration that allows negative values for refunds, discounts, etc.\n */\n WITH_NEGATIVES: createCurrencySemantic({\n storageFormat: 'decimal',\n defaultCurrency: 'USD',\n decimalPlaces: 2,\n allowNegative: true,\n }),\n\n /**\n * High-precision configuration for cryptocurrency or precious metals.\n */\n HIGH_PRECISION: createCurrencySemantic({\n storageFormat: 'decimal',\n defaultCurrency: 'BTC',\n decimalPlaces: 8,\n allowNegative: false,\n }),\n} as const\n\n/**\n * Helper function to validate a currency configuration.\n */\nexport const validateCurrencyConfig = (config: CurrencyConfig): string[] => {\n const errors: string[] = []\n\n if (config.storageFormat !== 'complex_object' && !config.defaultCurrency) {\n errors.push('defaultCurrency is required when storageFormat is not complex_object')\n }\n\n if (config.decimalPlaces !== undefined && config.decimalPlaces < 0) {\n errors.push('decimalPlaces must be non-negative')\n }\n\n return errors\n}\n"]}
@@ -9,12 +9,25 @@ export interface HTMLConfig {
9
9
  * List of allowed HTML tags in the content.
10
10
  */
11
11
  allowedTags?: string[];
12
- /**
13
- * Maximum length of the HTML content.
14
- */
15
- maxLength?: number;
16
12
  /**
17
13
  * Render mode: 'html', 'text', or 'both'.
14
+ *
15
+ * - `html` - The API returns the HTML content as-is (after sanitization based on your other rules like allowedTags).
16
+ * - `text` - The API returns the text content, stripping out all HTML tags.
17
+ * This is extremely useful for various backend and frontend tasks:
18
+ * - **Search Indexing**: You can easily feed the plain text content into a search engine like Elasticsearch
19
+ * without the noise of HTML tags.
20
+ * - **Content Previews/Summaries**: Displaying a snippet of the content in a list view or a notification
21
+ * where formatting is not desired.
22
+ * - **Compatibility**: Sending the content to systems that don't support HTML, such as plain-text
23
+ * emails or SMS notifications.
24
+ * - `both` - The API returns an object containing both the raw HTML and the plain text version. For example:
25
+ * ```json
26
+ * {
27
+ * "html": "<p>Hello, <strong>world</strong>!</p>",
28
+ * "text": "Hello, world!"
29
+ * }
30
+ * ```
18
31
  */
19
32
  renderMode?: 'html' | 'text' | 'both';
20
33
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"HTML.d.ts","sourceRoot":"","sources":["../../../../src/modeling/definitions/HTML.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,UAAU,CAAC,EA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26,7 +26,6 @@ export const createHTMLSemantic = (config = {}) => {
26
26
  */
27
27
  export const DEFAULT_HTML_CONFIG = {
28
28
  allowedTags: ['b', 'i', 'em', 'strong', 'a', 'ul', 'ol', 'li', 'p', 'br', 'pre', 'code', 'div', 'span'],
29
- maxLength: 10000,
30
29
  renderMode: 'html',
31
30
  sanitizeLevel: 'strict',
32
31
  allowImages: true,
@@ -1 +1 @@
1
- {"version":3,"file":"HTML.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/HTML.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AA6E9C;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAA6B,EAAmC,EAAE;IAC/F,OAAO,QAAQ,CAAC,EAAE,KAAK,YAAY,CAAC,IAAI,CAAA;AAC1C,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,SAAqB,EAAE,EAAuB,EAAE;IACjF,MAAM,YAAY,GAAG;QACnB,GAAG,mBAAmB;QACtB,GAAG,MAAM;KACV,CAAA;IACD,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,YAAY,CAAC,QAAQ,GAAG,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAA;IAChD,CAAC;IAED,OAAO;QACL,EAAE,EAAE,YAAY,CAAC,IAAI;QACrB,MAAM,EAAE,YAAY;KACrB,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAe;IAC7C,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC;IACvG,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,MAAM;IAClB,aAAa,EAAE,QAAQ;IACvB,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,KAAK;IACjB,YAAY,EAAE,KAAK;IACnB,YAAY,EAAE,KAAK;IACnB,aAAa,EAAE,KAAK;IACpB,WAAW,EAAE,KAAK;IAClB,mBAAmB,EAAE,KAAK;CAC3B,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Configuration options for the HTML semantic.\n * Controls rendering, sanitization, and allowed HTML features.\n */\nexport interface HTMLConfig {\n /**\n * List of allowed HTML tags in the content.\n */\n allowedTags?: string[]\n /**\n * Maximum length of the HTML content.\n */\n maxLength?: number\n /**\n * Render mode: 'html', 'text', or 'both'.\n */\n renderMode?: 'html' | 'text' | 'both'\n /**\n * Sanitization level: 'strict', 'moderate', or 'none'.\n */\n sanitizeLevel?: 'strict' | 'moderate' | 'none'\n /**\n * Whether to allow images in HTML.\n */\n allowImages?: boolean\n /**\n * Whether to allow links in HTML.\n */\n allowLinks?: boolean\n /**\n * Whether to allow tables in HTML.\n */\n allowTables?: boolean\n /**\n * Whether to allow forms in HTML.\n */\n allowForms?: boolean\n /**\n * Whether to allow scripts in HTML.\n */\n allowScripts?: boolean\n /**\n * Whether to allow iframes in HTML.\n */\n allowIframes?: boolean\n /**\n * Whether to allow embedded content (video, audio, etc.).\n */\n allowEmbedded?: boolean\n /**\n * Whether to allow CSS styles in HTML.\n */\n allowStyles?: boolean\n /**\n * Whether to allow data attributes in HTML.\n */\n allowDataAttributes?: boolean\n /**\n * Custom metadata for the HTML field.\n */\n metadata?: Record<string, unknown>\n /**\n * Index signature to allow additional properties.\n */\n [key: string]: unknown\n}\n\n/**\n * Type-safe configuration for HTML semantic.\n */\nexport interface AppliedHTMLSemantic extends AppliedDataSemantic {\n id: SemanticType.HTML\n config?: HTMLConfig\n}\n\n/**\n * Type guard to check if a semantic is an HTML semantic.\n */\nexport const isHTMLSemantic = (semantic: AppliedDataSemantic): semantic is AppliedHTMLSemantic => {\n return semantic.id === SemanticType.HTML\n}\n\n/**\n * Helper function to create an HTML semantic with configuration.\n */\nexport const createHTMLSemantic = (config: HTMLConfig = {}): AppliedHTMLSemantic => {\n const mergedConfig = {\n ...DEFAULT_HTML_CONFIG,\n ...config,\n }\n if (config.metadata) {\n mergedConfig.metadata = { ...config.metadata }\n }\n\n return {\n id: SemanticType.HTML,\n config: mergedConfig,\n }\n}\n\n/**\n * Default configuration for HTML semantic.\n */\nexport const DEFAULT_HTML_CONFIG: HTMLConfig = {\n allowedTags: ['b', 'i', 'em', 'strong', 'a', 'ul', 'ol', 'li', 'p', 'br', 'pre', 'code', 'div', 'span'],\n maxLength: 10000,\n renderMode: 'html',\n sanitizeLevel: 'strict',\n allowImages: true,\n allowLinks: true,\n allowTables: true,\n allowForms: false,\n allowScripts: false,\n allowIframes: false,\n allowEmbedded: false,\n allowStyles: false,\n allowDataAttributes: false,\n}\n"]}
1
+ {"version":3,"file":"HTML.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/HTML.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AA0F9C;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAA6B,EAAmC,EAAE;IAC/F,OAAO,QAAQ,CAAC,EAAE,KAAK,YAAY,CAAC,IAAI,CAAA;AAC1C,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,SAAqB,EAAE,EAAuB,EAAE;IACjF,MAAM,YAAY,GAAG;QACnB,GAAG,mBAAmB;QACtB,GAAG,MAAM;KACV,CAAA;IACD,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,YAAY,CAAC,QAAQ,GAAG,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAA;IAChD,CAAC;IAED,OAAO;QACL,EAAE,EAAE,YAAY,CAAC,IAAI;QACrB,MAAM,EAAE,YAAY;KACrB,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAe;IAC7C,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC;IACvG,UAAU,EAAE,MAAM;IAClB,aAAa,EAAE,QAAQ;IACvB,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,KAAK;IACjB,YAAY,EAAE,KAAK;IACnB,YAAY,EAAE,KAAK;IACnB,aAAa,EAAE,KAAK;IACpB,WAAW,EAAE,KAAK;IAClB,mBAAmB,EAAE,KAAK;CAC3B,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Configuration options for the HTML semantic.\n * Controls rendering, sanitization, and allowed HTML features.\n */\nexport interface HTMLConfig {\n /**\n * List of allowed HTML tags in the content.\n */\n allowedTags?: string[]\n /**\n * Render mode: 'html', 'text', or 'both'.\n *\n * - `html` - The API returns the HTML content as-is (after sanitization based on your other rules like allowedTags).\n * - `text` - The API returns the text content, stripping out all HTML tags.\n * This is extremely useful for various backend and frontend tasks:\n * - **Search Indexing**: You can easily feed the plain text content into a search engine like Elasticsearch\n * without the noise of HTML tags.\n * - **Content Previews/Summaries**: Displaying a snippet of the content in a list view or a notification\n * where formatting is not desired.\n * - **Compatibility**: Sending the content to systems that don't support HTML, such as plain-text\n * emails or SMS notifications.\n * - `both` - The API returns an object containing both the raw HTML and the plain text version. For example:\n * ```json\n * {\n * \"html\": \"<p>Hello, <strong>world</strong>!</p>\",\n * \"text\": \"Hello, world!\"\n * }\n * ```\n */\n renderMode?: 'html' | 'text' | 'both'\n /**\n * Sanitization level: 'strict', 'moderate', or 'none'.\n */\n sanitizeLevel?: 'strict' | 'moderate' | 'none'\n /**\n * Whether to allow images in HTML.\n */\n allowImages?: boolean\n /**\n * Whether to allow links in HTML.\n */\n allowLinks?: boolean\n /**\n * Whether to allow tables in HTML.\n */\n allowTables?: boolean\n /**\n * Whether to allow forms in HTML.\n */\n allowForms?: boolean\n /**\n * Whether to allow scripts in HTML.\n */\n allowScripts?: boolean\n /**\n * Whether to allow iframes in HTML.\n */\n allowIframes?: boolean\n /**\n * Whether to allow embedded content (video, audio, etc.).\n */\n allowEmbedded?: boolean\n /**\n * Whether to allow CSS styles in HTML.\n */\n allowStyles?: boolean\n /**\n * Whether to allow data attributes in HTML.\n */\n allowDataAttributes?: boolean\n /**\n * Custom metadata for the HTML field.\n */\n metadata?: Record<string, unknown>\n /**\n * Index signature to allow additional properties.\n */\n [key: string]: unknown\n}\n\n/**\n * Type-safe configuration for HTML semantic.\n */\nexport interface AppliedHTMLSemantic extends AppliedDataSemantic {\n id: SemanticType.HTML\n config?: HTMLConfig\n}\n\n/**\n * Type guard to check if a semantic is an HTML semantic.\n */\nexport const isHTMLSemantic = (semantic: AppliedDataSemantic): semantic is AppliedHTMLSemantic => {\n return semantic.id === SemanticType.HTML\n}\n\n/**\n * Helper function to create an HTML semantic with configuration.\n */\nexport const createHTMLSemantic = (config: HTMLConfig = {}): AppliedHTMLSemantic => {\n const mergedConfig = {\n ...DEFAULT_HTML_CONFIG,\n ...config,\n }\n if (config.metadata) {\n mergedConfig.metadata = { ...config.metadata }\n }\n\n return {\n id: SemanticType.HTML,\n config: mergedConfig,\n }\n}\n\n/**\n * Default configuration for HTML semantic.\n */\nexport const DEFAULT_HTML_CONFIG: HTMLConfig = {\n allowedTags: ['b', 'i', 'em', 'strong', 'a', 'ul', 'ol', 'li', 'p', 'br', 'pre', 'code', 'div', 'span'],\n renderMode: 'html',\n sanitizeLevel: 'strict',\n allowImages: true,\n allowLinks: true,\n allowTables: true,\n allowForms: false,\n allowScripts: false,\n allowIframes: false,\n allowEmbedded: false,\n allowStyles: false,\n allowDataAttributes: false,\n}\n"]}
@@ -9,12 +9,20 @@ export interface MarkdownConfig {
9
9
  * List of allowed HTML tags in the rendered output.
10
10
  */
11
11
  allowedTags?: string[];
12
- /**
13
- * Maximum length of the markdown content.
14
- */
15
- maxLength?: number;
16
12
  /**
17
13
  * Render mode: 'html', 'text', or 'both'.
14
+ * This controls how the stored Markdown content is transformed and returned by the API.
15
+ *
16
+ * - `html` - The API converts the Markdown to HTML and returns the sanitized result.
17
+ * - `text` - The original Markdown as when created, but sanitized.
18
+ * - `both` - The API returns an object containing both the rendered HTML and the plain text version.
19
+ * This provides maximum flexibility for client applications.
20
+ * ```json
21
+ * {
22
+ * "html": "<h1>Title</h1><p>Some <strong>bold</strong> text.</p>",
23
+ * "text": "Title Some bold text."
24
+ * }
25
+ * ```
18
26
  */
19
27
  renderMode?: 'html' | 'text' | 'both';
20
28
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../../src/modeling/definitions/Markdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;IACrC;;OAEG;IACH,aAAa,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAA;IAC9C;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,WAAW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C9C;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC;;OAEG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,mBAAmB;IAClE,EAAE,EAAE,YAAY,CAAC,QAAQ,CAAA;IACzB,MAAM,CAAC,EAAE,cAAc,CAAA;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,UAAU,mBAAmB,KAAG,QAAQ,IAAI,uBAE9E,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAAI,SAAQ,cAAmB,KAAG,uBAapE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,cAYrC,CAAA"}
@@ -26,7 +26,6 @@ export const createMarkdownSemantic = (config = {}) => {
26
26
  */
27
27
  export const DEFAULT_MARKDOWN_CONFIG = {
28
28
  allowedTags: ['b', 'i', 'em', 'strong', 'a', 'ul', 'ol', 'li', 'p', 'br', 'pre', 'code'],
29
- maxLength: 10000,
30
29
  renderMode: 'html',
31
30
  sanitizeLevel: 'strict',
32
31
  allowImages: true,
@@ -1 +1 @@
1
- {"version":3,"file":"Markdown.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Markdown.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAyE9C;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAA6B,EAAuC,EAAE;IACvG,OAAO,QAAQ,CAAC,EAAE,KAAK,YAAY,CAAC,QAAQ,CAAA;AAC9C,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,SAAyB,EAAE,EAA2B,EAAE;IAC7F,MAAM,YAAY,GAAG;QACnB,GAAG,uBAAuB;QAC1B,GAAG,MAAM;KACV,CAAA;IACD,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,YAAY,CAAC,QAAQ,GAAG,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAA;IAChD,CAAC;IAED,OAAO;QACL,EAAE,EAAE,YAAY,CAAC,QAAQ;QACzB,MAAM,EAAE,YAAY;KACrB,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAmB;IACrD,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC;IACxF,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,MAAM;IAClB,aAAa,EAAE,QAAQ;IACvB,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,KAAK;IAChB,cAAc,EAAE,KAAK;IACrB,cAAc,EAAE,KAAK;IACrB,kBAAkB,EAAE,IAAI;IACxB,SAAS,EAAE,KAAK;CACjB,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Configuration options for the Markdown semantic.\n * Controls rendering, sanitization, and allowed features.\n */\nexport interface MarkdownConfig {\n /**\n * List of allowed HTML tags in the rendered output.\n */\n allowedTags?: string[]\n /**\n * Maximum length of the markdown content.\n */\n maxLength?: number\n /**\n * Render mode: 'html', 'text', or 'both'.\n */\n renderMode?: 'html' | 'text' | 'both'\n /**\n * Sanitization level: 'strict', 'moderate', or 'none'.\n */\n sanitizeLevel?: 'strict' | 'moderate' | 'none'\n /**\n * Whether to allow images in markdown.\n */\n allowImages?: boolean\n /**\n * Whether to allow links in markdown.\n */\n allowLinks?: boolean\n /**\n * Whether to allow tables in markdown.\n */\n allowTables?: boolean\n /**\n * Whether to allow raw HTML in markdown.\n */\n allowHtml?: boolean\n /**\n * Whether to allow footnotes in markdown.\n */\n allowFootnotes?: boolean\n /**\n * Whether to allow GitHub-style task lists.\n */\n allowTaskLists?: boolean\n /**\n * Whether to allow strikethrough formatting.\n */\n allowStrikethrough?: boolean\n /**\n * Whether to allow math expressions (e.g., LaTeX).\n */\n allowMath?: boolean\n /**\n * Custom metadata for the markdown field.\n */\n metadata?: Record<string, unknown>\n /**\n * Index signature to allow additional properties.\n */\n [key: string]: unknown\n}\n\n/**\n * Type-safe configuration for Markdown semantic.\n */\nexport interface AppliedMarkdownSemantic extends AppliedDataSemantic {\n id: SemanticType.Markdown\n config?: MarkdownConfig\n}\n\n/**\n * Type guard to check if a semantic is a Markdown semantic.\n */\nexport const isMarkdownSemantic = (semantic: AppliedDataSemantic): semantic is AppliedMarkdownSemantic => {\n return semantic.id === SemanticType.Markdown\n}\n\n/**\n * Helper function to create a Markdown semantic with configuration.\n */\nexport const createMarkdownSemantic = (config: MarkdownConfig = {}): AppliedMarkdownSemantic => {\n const mergedConfig = {\n ...DEFAULT_MARKDOWN_CONFIG,\n ...config,\n }\n if (config.metadata) {\n mergedConfig.metadata = { ...config.metadata }\n }\n\n return {\n id: SemanticType.Markdown,\n config: mergedConfig,\n }\n}\n\n/**\n * Default configuration for Markdown semantic.\n */\nexport const DEFAULT_MARKDOWN_CONFIG: MarkdownConfig = {\n allowedTags: ['b', 'i', 'em', 'strong', 'a', 'ul', 'ol', 'li', 'p', 'br', 'pre', 'code'],\n maxLength: 10000,\n renderMode: 'html',\n sanitizeLevel: 'strict',\n allowImages: true,\n allowLinks: true,\n allowTables: true,\n allowHtml: false,\n allowFootnotes: false,\n allowTaskLists: false,\n allowStrikethrough: true,\n allowMath: false,\n}\n"]}
1
+ {"version":3,"file":"Markdown.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Markdown.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAiF9C;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAA6B,EAAuC,EAAE;IACvG,OAAO,QAAQ,CAAC,EAAE,KAAK,YAAY,CAAC,QAAQ,CAAA;AAC9C,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,SAAyB,EAAE,EAA2B,EAAE;IAC7F,MAAM,YAAY,GAAG;QACnB,GAAG,uBAAuB;QAC1B,GAAG,MAAM;KACV,CAAA;IACD,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,YAAY,CAAC,QAAQ,GAAG,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAA;IAChD,CAAC;IAED,OAAO;QACL,EAAE,EAAE,YAAY,CAAC,QAAQ;QACzB,MAAM,EAAE,YAAY;KACrB,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAmB;IACrD,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC;IACxF,UAAU,EAAE,MAAM;IAClB,aAAa,EAAE,QAAQ;IACvB,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,KAAK;IAChB,cAAc,EAAE,KAAK;IACrB,cAAc,EAAE,KAAK;IACrB,kBAAkB,EAAE,IAAI;IACxB,SAAS,EAAE,KAAK;CACjB,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Configuration options for the Markdown semantic.\n * Controls rendering, sanitization, and allowed features.\n */\nexport interface MarkdownConfig {\n /**\n * List of allowed HTML tags in the rendered output.\n */\n allowedTags?: string[]\n /**\n * Render mode: 'html', 'text', or 'both'.\n * This controls how the stored Markdown content is transformed and returned by the API.\n *\n * - `html` - The API converts the Markdown to HTML and returns the sanitized result.\n * - `text` - The original Markdown as when created, but sanitized.\n * - `both` - The API returns an object containing both the rendered HTML and the plain text version.\n * This provides maximum flexibility for client applications.\n * ```json\n * {\n * \"html\": \"<h1>Title</h1><p>Some <strong>bold</strong> text.</p>\",\n * \"text\": \"Title Some bold text.\"\n * }\n * ```\n */\n renderMode?: 'html' | 'text' | 'both'\n /**\n * Sanitization level: 'strict', 'moderate', or 'none'.\n */\n sanitizeLevel?: 'strict' | 'moderate' | 'none'\n /**\n * Whether to allow images in markdown.\n */\n allowImages?: boolean\n /**\n * Whether to allow links in markdown.\n */\n allowLinks?: boolean\n /**\n * Whether to allow tables in markdown.\n */\n allowTables?: boolean\n /**\n * Whether to allow raw HTML in markdown.\n */\n allowHtml?: boolean\n /**\n * Whether to allow footnotes in markdown.\n */\n allowFootnotes?: boolean\n /**\n * Whether to allow GitHub-style task lists.\n */\n allowTaskLists?: boolean\n /**\n * Whether to allow strikethrough formatting.\n */\n allowStrikethrough?: boolean\n /**\n * Whether to allow math expressions (e.g., LaTeX).\n */\n allowMath?: boolean\n /**\n * Custom metadata for the markdown field.\n */\n metadata?: Record<string, unknown>\n /**\n * Index signature to allow additional properties.\n */\n [key: string]: unknown\n}\n\n/**\n * Type-safe configuration for Markdown semantic.\n */\nexport interface AppliedMarkdownSemantic extends AppliedDataSemantic {\n id: SemanticType.Markdown\n config?: MarkdownConfig\n}\n\n/**\n * Type guard to check if a semantic is a Markdown semantic.\n */\nexport const isMarkdownSemantic = (semantic: AppliedDataSemantic): semantic is AppliedMarkdownSemantic => {\n return semantic.id === SemanticType.Markdown\n}\n\n/**\n * Helper function to create a Markdown semantic with configuration.\n */\nexport const createMarkdownSemantic = (config: MarkdownConfig = {}): AppliedMarkdownSemantic => {\n const mergedConfig = {\n ...DEFAULT_MARKDOWN_CONFIG,\n ...config,\n }\n if (config.metadata) {\n mergedConfig.metadata = { ...config.metadata }\n }\n\n return {\n id: SemanticType.Markdown,\n config: mergedConfig,\n }\n}\n\n/**\n * Default configuration for Markdown semantic.\n */\nexport const DEFAULT_MARKDOWN_CONFIG: MarkdownConfig = {\n allowedTags: ['b', 'i', 'em', 'strong', 'a', 'ul', 'ol', 'li', 'p', 'br', 'pre', 'code'],\n renderMode: 'html',\n sanitizeLevel: 'strict',\n allowImages: true,\n allowLinks: true,\n allowTables: true,\n allowHtml: false,\n allowFootnotes: false,\n allowTaskLists: false,\n allowStrikethrough: true,\n allowMath: false,\n}\n"]}