@api-client/core 0.17.3 → 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 +6 -1
  2. package/build/src/modeling/Semantics.d.ts.map +1 -1
  3. package/build/src/modeling/Semantics.js +32 -4
  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 +37 -4
  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
@@ -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,sBAAsB,CAAC;QAClC,aAAa,EAAE,SAAS;QACxB,eAAe,EAAE,KAAK;QACtB,aAAa,EAAE,CAAC;QAChB,aAAa,EAAE,KAAK;KACrB,CAAC;IAEF;;OAEG;IACH,SAAS,EAAE,sBAAsB,CAAC;QAChC,aAAa,EAAE,eAAe;QAC9B,eAAe,EAAE,KAAK;QACtB,aAAa,EAAE,CAAC;QAChB,aAAa,EAAE,KAAK;KACrB,CAAC;IAEF;;OAEG;IACH,cAAc,EAAE,sBAAsB,CAAC;QACrC,aAAa,EAAE,gBAAgB;QAC/B,iBAAiB,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;QACtD,aAAa,EAAE,CAAC;QAChB,aAAa,EAAE,KAAK;KACrB,CAAC;IAEF;;OAEG;IACH,cAAc,EAAE,sBAAsB,CAAC;QACrC,aAAa,EAAE,SAAS;QACxB,eAAe,EAAE,KAAK;QACtB,aAAa,EAAE,CAAC;QAChB,aAAa,EAAE,IAAI;KACpB,CAAC;IAEF;;OAEG;IACH,cAAc,EAAE,sBAAsB,CAAC;QACrC,aAAa,EAAE,SAAS;QACxB,eAAe,EAAE,KAAK;QACtB,aAAa,EAAE,CAAC;QAChB,aAAa,EAAE,KAAK;KACrB,CAAC;CACM,CAAA;AAEV;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,MAAsB,EAAY,EAAE;IACzE,MAAM,MAAM,GAAa,EAAE,CAAA;IAE3B,IAAI,MAAM,CAAC,aAAa,KAAK,gBAAgB,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;QACzE,MAAM,CAAC,IAAI,CAAC,sEAAsE,CAAC,CAAA;IACrF,CAAC;IAED,IAAI,MAAM,CAAC,aAAa,KAAK,SAAS,IAAI,MAAM,CAAC,aAAa,GAAG,CAAC,EAAE,CAAC;QACnE,MAAM,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAA;IACnD,CAAC;IAED,OAAO,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,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;IACrC;;OAEG;IACH,aAAa,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAA;IAC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tB;;;;;;;;;;;;;;;;;;;OAmBG;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,CAAC,EAAE,OAAO,CAAA;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;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,mBAAoB,SAAQ,mBAAmB;IAC9D,EAAE,EAAE,YAAY,CAAC,IAAI,CAAA;IACrB,MAAM,CAAC,EAAE,UAAU,CAAA;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,mBAAmB,KAAG,QAAQ,IAAI,mBAE1E,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAQ,UAAe,KAAG,mBAa5D,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,UAajC,CAAA"}
@@ -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,CAAC,EAAE,OAAO,CAAA;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,C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W,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"]}
@@ -15,7 +15,7 @@ export interface StatusConfig {
15
15
  * Default state when creating new records.
16
16
  * Must be one of the allowedStates (if specified) or enum values from the schema.
17
17
  */
18
- defaultState: string;
18
+ defaultState?: string;
19
19
  /**
20
20
  * State transitions configuration.
21
21
  * Maps from current state to array of allowed next states.
@@ -1 +1 @@
1
- {"version":3,"file":"Status.d.ts","sourceRoot":"","sources":["../../../../src/modeling/definitions/Status.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,YAAY;IAC3B;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IAExB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAEtC;;OAEG;IACH,cA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,YA0BnC,CAAA"}
@@ -32,6 +32,7 @@ export const createStatusSemantic = (config = {}) => {
32
32
  * Default configuration for Status semantic.
33
33
  */
34
34
  export const DEFAULT_STATUS_CONFIG = {
35
+ allowedStates: ['draft', 'published', 'archived'],
35
36
  defaultState: 'draft',
36
37
  stateBehaviors: {
37
38
  draft: {
@@ -1 +1 @@
1
- {"version":3,"file":"Status.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Status.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAoK9C;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAA6B,EAAqC,EAAE;IACnG,OAAO,QAAQ,CAAC,EAAE,KAAK,YAAY,CAAC,MAAM,CAAA;AAC5C,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,SAAgC,EAAE,EAAyB,EAAE;IAChG,MAAM,YAAY,GAAG;QACnB,GAAG,qBAAqB;QACxB,GAAG,MAAM;QACT,4BAA4B;QAC5B,cAAc,EAAE,MAAM,CAAC,cAAc;YACnC,CAAC,CAAC,EAAE,GAAG,qBAAqB,CAAC,cAAc,EAAE,GAAG,MAAM,CAAC,cAAc,EAAE;YACvE,CAAC,CAAC,qBAAqB,CAAC,cAAc;QACxC,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACvB,CAAC,CAAC,EAAE,GAAG,qBAAqB,CAAC,QAAQ,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE;YAC3D,CAAC,CAAC,qBAAqB,CAAC,QAAQ;KACnC,CAAA;IAED,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,MAAM;QACvB,MAAM,EAAE,YAAY;KACrB,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAiB;IACjD,YAAY,EAAE,OAAO;IACrB,cAAc,EAAE;QACd,KAAK,EAAE;YACL,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,IAAI;SAClB;QACD,SAAS,EAAE;YACT,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,KAAK;SACnB;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;YACjB,WAAW,EAAE,KAAK;SACnB;KACF;IACD,QAAQ,EAAE;QACR,gBAAgB,EAAE,KAAK;QACvB,iBAAiB,EAAE,KAAK;QACxB,UAAU,EAAE,IAAI;QAChB,gBAAgB,EAAE,KAAK;KACxB;CACF,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Configuration options for the Status semantic.\n * These options control state management and workflow behavior.\n */\nexport interface StatusConfig {\n /**\n * Allowed states for this status field.\n * Only required when the field doesn't have enum values defined in the schema.\n * If enum values are defined in DomainProperty > Schema, those values will be used instead.\n */\n allowedStates?: string[]\n\n /**\n * Default state when creating new records.\n * Must be one of the allowedStates (if specified) or enum values from the schema.\n */\n defaultState: string\n\n /**\n * State transitions configuration.\n * Maps from current state to array of allowed next states.\n */\n transitions?: Record<string, string[]>\n\n /**\n * State-specific behaviors and permissions.\n */\n stateBehaviors?: Record<\n string,\n {\n /**\n * Whether records in this state are publicly visible.\n * Defaults to true if not specified.\n */\n isPublic?: boolean\n\n /**\n * Whether records in this state can be edited.\n * Defaults to true if not specified.\n */\n isEditable?: boolean\n\n /**\n * Whether records in this state can be deleted.\n * Defaults to false if not specified.\n */\n isDeletable?: boolean\n\n /**\n * Whether this state requires approval before transition.\n * Defaults to false if not specified.\n */\n requiresApproval?: boolean\n\n /**\n * Custom display name for this state.\n */\n displayName?: string\n\n /**\n * Custom description for this state.\n */\n description?: string\n\n /**\n * Color or visual indicator for this state.\n */\n color?: string\n\n /**\n * Icon for this state.\n */\n icon?: string\n }\n >\n\n /**\n * Workflow configuration for status management.\n */\n workflow?: {\n /**\n * Whether status changes require approval.\n * Defaults to false if not specified.\n */\n requiresApproval?: boolean\n\n /**\n * Roles that can approve status changes.\n * Required if requiresApproval is true.\n */\n approvalRoles?: string[]\n\n /**\n * Whether to send notifications on status changes.\n * Defaults to false if not specified.\n */\n sendNotifications?: boolean\n\n /**\n * Notification channels to use.\n */\n notificationChannels?: ('email' | 'sms' | 'push' | 'webhook')[]\n\n /**\n * Whether to log status change history.\n * Defaults to true if not specified.\n */\n logHistory?: boolean\n\n /**\n * Whether to allow bulk status changes.\n * Defaults to false if not specified.\n */\n allowBulkChanges?: boolean\n }\n\n /**\n * Auto-transitions based on conditions.\n */\n autoTransitions?: {\n /**\n * Current state that triggers the auto-transition.\n */\n from: string\n\n /**\n * Target state to transition to.\n */\n to: string\n\n /**\n * Condition that triggers the transition.\n * Examples: \"after 24 hours\", \"when approved\", \"when payment received\"\n */\n condition: string\n\n /**\n * Whether this auto-transition requires approval.\n * Defaults to false if not specified.\n */\n requiresApproval?: boolean\n }[]\n\n /**\n * Custom metadata for the status 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 Status semantic.\n */\nexport interface AppliedStatusSemantic extends AppliedDataSemantic {\n id: SemanticType.Status\n config?: StatusConfig\n}\n\n/**\n * Type guard to check if a semantic is a Status semantic.\n */\nexport const isStatusSemantic = (semantic: AppliedDataSemantic): semantic is AppliedStatusSemantic => {\n return semantic.id === SemanticType.Status\n}\n\n/**\n * Helper function to create a Status semantic with configuration.\n */\nexport const createStatusSemantic = (config: Partial<StatusConfig> = {}): AppliedStatusSemantic => {\n const mergedConfig = {\n ...DEFAULT_STATUS_CONFIG,\n ...config,\n // Deep merge nested objects\n stateBehaviors: config.stateBehaviors\n ? { ...DEFAULT_STATUS_CONFIG.stateBehaviors, ...config.stateBehaviors }\n : DEFAULT_STATUS_CONFIG.stateBehaviors,\n workflow: config.workflow\n ? { ...DEFAULT_STATUS_CONFIG.workflow, ...config.workflow }\n : DEFAULT_STATUS_CONFIG.workflow,\n }\n\n if (config.metadata) {\n mergedConfig.metadata = { ...config.metadata }\n }\n\n return {\n id: SemanticType.Status,\n config: mergedConfig,\n }\n}\n\n/**\n * Default configuration for Status semantic.\n */\nexport const DEFAULT_STATUS_CONFIG: StatusConfig = {\n defaultState: 'draft',\n stateBehaviors: {\n draft: {\n isPublic: false,\n isEditable: true,\n isDeletable: true,\n },\n published: {\n isPublic: true,\n isEditable: true,\n isDeletable: false,\n },\n archived: {\n isPublic: false,\n isEditable: false,\n isDeletable: false,\n },\n },\n workflow: {\n requiresApproval: false,\n sendNotifications: false,\n logHistory: true,\n allowBulkChanges: false,\n },\n}\n"]}
1
+ {"version":3,"file":"Status.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Status.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAoK9C;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAA6B,EAAqC,EAAE;IACnG,OAAO,QAAQ,CAAC,EAAE,KAAK,YAAY,CAAC,MAAM,CAAA;AAC5C,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,SAAgC,EAAE,EAAyB,EAAE;IAChG,MAAM,YAAY,GAAG;QACnB,GAAG,qBAAqB;QACxB,GAAG,MAAM;QACT,4BAA4B;QAC5B,cAAc,EAAE,MAAM,CAAC,cAAc;YACnC,CAAC,CAAC,EAAE,GAAG,qBAAqB,CAAC,cAAc,EAAE,GAAG,MAAM,CAAC,cAAc,EAAE;YACvE,CAAC,CAAC,qBAAqB,CAAC,cAAc;QACxC,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACvB,CAAC,CAAC,EAAE,GAAG,qBAAqB,CAAC,QAAQ,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE;YAC3D,CAAC,CAAC,qBAAqB,CAAC,QAAQ;KACnC,CAAA;IAED,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,MAAM;QACvB,MAAM,EAAE,YAAY;KACrB,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAiB;IACjD,aAAa,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,UAAU,CAAC;IACjD,YAAY,EAAE,OAAO;IACrB,cAAc,EAAE;QACd,KAAK,EAAE;YACL,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,IAAI;SAClB;QACD,SAAS,EAAE;YACT,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,KAAK;SACnB;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;YACjB,WAAW,EAAE,KAAK;SACnB;KACF;IACD,QAAQ,EAAE;QACR,gBAAgB,EAAE,KAAK;QACvB,iBAAiB,EAAE,KAAK;QACxB,UAAU,EAAE,IAAI;QAChB,gBAAgB,EAAE,KAAK;KACxB;CACF,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Configuration options for the Status semantic.\n * These options control state management and workflow behavior.\n */\nexport interface StatusConfig {\n /**\n * Allowed states for this status field.\n * Only required when the field doesn't have enum values defined in the schema.\n * If enum values are defined in DomainProperty > Schema, those values will be used instead.\n */\n allowedStates?: string[]\n\n /**\n * Default state when creating new records.\n * Must be one of the allowedStates (if specified) or enum values from the schema.\n */\n defaultState?: string\n\n /**\n * State transitions configuration.\n * Maps from current state to array of allowed next states.\n */\n transitions?: Record<string, string[]>\n\n /**\n * State-specific behaviors and permissions.\n */\n stateBehaviors?: Record<\n string,\n {\n /**\n * Whether records in this state are publicly visible.\n * Defaults to true if not specified.\n */\n isPublic?: boolean\n\n /**\n * Whether records in this state can be edited.\n * Defaults to true if not specified.\n */\n isEditable?: boolean\n\n /**\n * Whether records in this state can be deleted.\n * Defaults to false if not specified.\n */\n isDeletable?: boolean\n\n /**\n * Whether this state requires approval before transition.\n * Defaults to false if not specified.\n */\n requiresApproval?: boolean\n\n /**\n * Custom display name for this state.\n */\n displayName?: string\n\n /**\n * Custom description for this state.\n */\n description?: string\n\n /**\n * Color or visual indicator for this state.\n */\n color?: string\n\n /**\n * Icon for this state.\n */\n icon?: string\n }\n >\n\n /**\n * Workflow configuration for status management.\n */\n workflow?: {\n /**\n * Whether status changes require approval.\n * Defaults to false if not specified.\n */\n requiresApproval?: boolean\n\n /**\n * Roles that can approve status changes.\n * Required if requiresApproval is true.\n */\n approvalRoles?: string[]\n\n /**\n * Whether to send notifications on status changes.\n * Defaults to false if not specified.\n */\n sendNotifications?: boolean\n\n /**\n * Notification channels to use.\n */\n notificationChannels?: ('email' | 'sms' | 'push' | 'webhook')[]\n\n /**\n * Whether to log status change history.\n * Defaults to true if not specified.\n */\n logHistory?: boolean\n\n /**\n * Whether to allow bulk status changes.\n * Defaults to false if not specified.\n */\n allowBulkChanges?: boolean\n }\n\n /**\n * Auto-transitions based on conditions.\n */\n autoTransitions?: {\n /**\n * Current state that triggers the auto-transition.\n */\n from: string\n\n /**\n * Target state to transition to.\n */\n to: string\n\n /**\n * Condition that triggers the transition.\n * Examples: \"after 24 hours\", \"when approved\", \"when payment received\"\n */\n condition: string\n\n /**\n * Whether this auto-transition requires approval.\n * Defaults to false if not specified.\n */\n requiresApproval?: boolean\n }[]\n\n /**\n * Custom metadata for the status 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 Status semantic.\n */\nexport interface AppliedStatusSemantic extends AppliedDataSemantic {\n id: SemanticType.Status\n config?: StatusConfig\n}\n\n/**\n * Type guard to check if a semantic is a Status semantic.\n */\nexport const isStatusSemantic = (semantic: AppliedDataSemantic): semantic is AppliedStatusSemantic => {\n return semantic.id === SemanticType.Status\n}\n\n/**\n * Helper function to create a Status semantic with configuration.\n */\nexport const createStatusSemantic = (config: Partial<StatusConfig> = {}): AppliedStatusSemantic => {\n const mergedConfig = {\n ...DEFAULT_STATUS_CONFIG,\n ...config,\n // Deep merge nested objects\n stateBehaviors: config.stateBehaviors\n ? { ...DEFAULT_STATUS_CONFIG.stateBehaviors, ...config.stateBehaviors }\n : DEFAULT_STATUS_CONFIG.stateBehaviors,\n workflow: config.workflow\n ? { ...DEFAULT_STATUS_CONFIG.workflow, ...config.workflow }\n : DEFAULT_STATUS_CONFIG.workflow,\n }\n\n if (config.metadata) {\n mergedConfig.metadata = { ...config.metadata }\n }\n\n return {\n id: SemanticType.Status,\n config: mergedConfig,\n }\n}\n\n/**\n * Default configuration for Status semantic.\n */\nexport const DEFAULT_STATUS_CONFIG: StatusConfig = {\n allowedStates: ['draft', 'published', 'archived'],\n defaultState: 'draft',\n stateBehaviors: {\n draft: {\n isPublic: false,\n isEditable: true,\n isDeletable: true,\n },\n published: {\n isPublic: true,\n isEditable: true,\n isDeletable: false,\n },\n archived: {\n isPublic: false,\n isEditable: false,\n isDeletable: false,\n },\n },\n workflow: {\n requiresApproval: false,\n sendNotifications: false,\n logHistory: true,\n allowBulkChanges: false,\n },\n}\n"]}