@api-client/core 0.18.63 → 0.18.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/modeling/ai/Semantics.d.ts +7 -0
- package/build/src/modeling/ai/Semantics.d.ts.map +1 -0
- package/build/src/modeling/ai/Semantics.js +552 -0
- package/build/src/modeling/ai/Semantics.js.map +1 -0
- package/build/src/modeling/definitions/Calculated.d.ts +1 -1
- package/build/src/modeling/definitions/Calculated.js.map +1 -1
- package/build/src/modeling/definitions/Country.d.ts +1 -1
- package/build/src/modeling/definitions/Country.js.map +1 -1
- package/build/src/modeling/definitions/Derived.d.ts +1 -1
- package/build/src/modeling/definitions/Derived.js.map +1 -1
- package/build/src/modeling/definitions/Description.d.ts +0 -1
- package/build/src/modeling/definitions/Description.d.ts.map +1 -1
- package/build/src/modeling/definitions/Description.js.map +1 -1
- package/build/src/modeling/definitions/Email.d.ts +5 -1
- package/build/src/modeling/definitions/Email.d.ts.map +1 -1
- package/build/src/modeling/definitions/Email.js.map +1 -1
- package/build/src/modeling/definitions/HTML.d.ts +0 -22
- package/build/src/modeling/definitions/HTML.d.ts.map +1 -1
- package/build/src/modeling/definitions/HTML.js +0 -1
- package/build/src/modeling/definitions/HTML.js.map +1 -1
- package/build/src/modeling/definitions/Markdown.d.ts +0 -16
- package/build/src/modeling/definitions/Markdown.d.ts.map +1 -1
- package/build/src/modeling/definitions/Markdown.js +0 -1
- package/build/src/modeling/definitions/Markdown.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/modeling/ai/Semantics.ts +597 -0
- package/src/modeling/ai/readme.md +7 -0
- package/src/modeling/definitions/Calculated.ts +1 -1
- package/src/modeling/definitions/Country.ts +1 -1
- package/src/modeling/definitions/Derived.ts +1 -1
- package/src/modeling/definitions/Description.ts +0 -1
- package/src/modeling/definitions/Email.ts +5 -1
- package/src/modeling/definitions/HTML.ts +0 -23
- package/src/modeling/definitions/Markdown.ts +0 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calculated.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Calculated.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AA2C9C;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,QAA6B,EAAyC,EAAE;IAC3G,OAAO,QAAQ,CAAC,EAAE,KAAK,YAAY,CAAC,UAAU,CAAA;AAChD,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,MAAwB,EAA6B,EAAE;IAC9F,MAAM,YAAY,GAAG;QACnB,GAAG,yBAAyB;QAC5B,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,UAAU;QAC3B,MAAM,EAAE,YAAY;KACrB,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAA8B;IAClE,mBAAmB,EAAE,IAAI;IACzB,mBAAmB,EAAE,KAAK;CAC3B,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Configuration options for the Calculated semantic.\n * Controls formula, dependencies, and recalculation behavior.\n *\n * Use Calculated when you need mathematical operations, aggregations, or complex business logic.\n */\nexport interface CalculatedConfig {\n /**\n * Formula to calculate the value (e.g., 'price * quantity').\n */\n formula: string\n /**\n * List of field
|
|
1
|
+
{"version":3,"file":"Calculated.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Calculated.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AA2C9C;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,QAA6B,EAAyC,EAAE;IAC3G,OAAO,QAAQ,CAAC,EAAE,KAAK,YAAY,CAAC,UAAU,CAAA;AAChD,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,MAAwB,EAA6B,EAAE;IAC9F,MAAM,YAAY,GAAG;QACnB,GAAG,yBAAyB;QAC5B,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,UAAU;QAC3B,MAAM,EAAE,YAAY;KACrB,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAA8B;IAClE,mBAAmB,EAAE,IAAI;IACzB,mBAAmB,EAAE,KAAK;CAC3B,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Configuration options for the Calculated semantic.\n * Controls formula, dependencies, and recalculation behavior.\n *\n * Use Calculated when you need mathematical operations, aggregations, or complex business logic.\n */\nexport interface CalculatedConfig {\n /**\n * Formula to calculate the value (e.g., 'price * quantity').\n */\n formula: string\n /**\n * List of field keys this calculation depends on.\n */\n dependencies?: string[]\n /**\n * Whether to recalculate the value on update (default: true).\n */\n recalculateOnUpdate?: boolean\n /**\n * Whether to allow manual override of the calculated value.\n */\n allowManualOverride?: boolean\n /**\n * Custom metadata for the calculated 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 Calculated semantic.\n */\nexport interface AppliedCalculatedSemantic extends AppliedDataSemantic {\n id: SemanticType.Calculated\n config?: CalculatedConfig\n}\n\n/**\n * Type guard to check if a semantic is a Calculated semantic.\n */\nexport const isCalculatedSemantic = (semantic: AppliedDataSemantic): semantic is AppliedCalculatedSemantic => {\n return semantic.id === SemanticType.Calculated\n}\n\n/**\n * Helper function to create a Calculated semantic with configuration.\n */\nexport const createCalculatedSemantic = (config: CalculatedConfig): AppliedCalculatedSemantic => {\n const mergedConfig = {\n ...DEFAULT_CALCULATED_CONFIG,\n ...config,\n }\n if (config.metadata) {\n mergedConfig.metadata = { ...config.metadata }\n }\n\n return {\n id: SemanticType.Calculated,\n config: mergedConfig,\n }\n}\n\n/**\n * Default configuration for Calculated semantic.\n */\nexport const DEFAULT_CALCULATED_CONFIG: Partial<CalculatedConfig> = {\n recalculateOnUpdate: true,\n allowManualOverride: false,\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Country.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Country.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAuC9C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAA6B,EAAsC,EAAE;IACrG,OAAO,QAAQ,CAAC,EAAE,KAAK,YAAY,CAAC,OAAO,CAAA;AAC7C,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,SAAwB,EAAE,EAA0B,EAAE;IAC1F,MAAM,YAAY,GAAG;QACnB,GAAG,sBAAsB;QACzB,GAAG,MAAM;KACV,CAAA;IACD,4BAA4B;IAC5B,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,YAAY,CAAC,QAAQ,GAAG,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAA;IAChD,CAAC;IACD,OAAO;QACL,EAAE,EAAE,YAAY,CAAC,OAAO;QACxB,MAAM,EAAE,YAAY;KACrB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAkB;IACnD,MAAM,EAAE,kBAAkB;CAC3B,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\nexport type CountryFormat = 'ISO_3166_Alpha_2' | 'ISO_3166_Alpha_3' | 'Name'\n\nexport interface CountryConfig {\n /**\n * The format of the country code.\n *\n * @default '
|
|
1
|
+
{"version":3,"file":"Country.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Country.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAuC9C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAA6B,EAAsC,EAAE;IACrG,OAAO,QAAQ,CAAC,EAAE,KAAK,YAAY,CAAC,OAAO,CAAA;AAC7C,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,SAAwB,EAAE,EAA0B,EAAE;IAC1F,MAAM,YAAY,GAAG;QACnB,GAAG,sBAAsB;QACzB,GAAG,MAAM;KACV,CAAA;IACD,4BAA4B;IAC5B,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,YAAY,CAAC,QAAQ,GAAG,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAA;IAChD,CAAC;IACD,OAAO;QACL,EAAE,EAAE,YAAY,CAAC,OAAO;QACxB,MAAM,EAAE,YAAY;KACrB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAkB;IACnD,MAAM,EAAE,kBAAkB;CAC3B,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\nexport type CountryFormat = 'ISO_3166_Alpha_2' | 'ISO_3166_Alpha_3' | 'Name'\n\nexport interface CountryConfig {\n /**\n * The format of the country code.\n *\n * @default 'ISO_3166_Alpha_2'\n */\n format?: CountryFormat\n\n /**\n * The list of allowed countries.\n */\n allowedCountries?: string[]\n\n /**\n * The list of disallowed countries.\n */\n disallowedCountries?: string[]\n /**\n * Custom metadata for the country 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 Country semantic.\n */\nexport interface AppliedCountrySemantic extends AppliedDataSemantic {\n id: SemanticType.Country\n config?: CountryConfig\n}\n\nexport const isCountrySemantic = (semantic: AppliedDataSemantic): semantic is AppliedCountrySemantic => {\n return semantic.id === SemanticType.Country\n}\n\nexport const createCountrySemantic = (config: CountryConfig = {}): AppliedCountrySemantic => {\n const mergedConfig = {\n ...DEFAULT_COUNTRY_CONFIG,\n ...config,\n }\n // Merge metadata separately\n if (config.metadata) {\n mergedConfig.metadata = { ...config.metadata }\n }\n return {\n id: SemanticType.Country,\n config: mergedConfig,\n }\n}\n\nexport const DEFAULT_COUNTRY_CONFIG: CountryConfig = {\n format: 'ISO_3166_Alpha_2',\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Derived.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Derived.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AA2C9C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAA6B,EAAsC,EAAE;IACrG,OAAO,QAAQ,CAAC,EAAE,KAAK,YAAY,CAAC,OAAO,CAAA;AAC7C,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,MAAqB,EAA0B,EAAE;IACrF,MAAM,YAAY,GAAG;QACnB,GAAG,sBAAsB;QACzB,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,OAAO;QACxB,MAAM,EAAE,YAAY;KACrB,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAA2B;IAC5D,mBAAmB,EAAE,IAAI;IACzB,mBAAmB,EAAE,KAAK;CAC3B,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Configuration options for the Derived semantic.\n * Controls source fields, transformation, and recalculation behavior.\n *\n * Use Derived when you need to combine, format, or transform existing field values\n */\nexport interface DerivedConfig {\n /**\n * List of source field
|
|
1
|
+
{"version":3,"file":"Derived.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Derived.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AA2C9C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAA6B,EAAsC,EAAE;IACrG,OAAO,QAAQ,CAAC,EAAE,KAAK,YAAY,CAAC,OAAO,CAAA;AAC7C,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,MAAqB,EAA0B,EAAE;IACrF,MAAM,YAAY,GAAG;QACnB,GAAG,sBAAsB;QACzB,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,OAAO;QACxB,MAAM,EAAE,YAAY;KACrB,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAA2B;IAC5D,mBAAmB,EAAE,IAAI;IACzB,mBAAmB,EAAE,KAAK;CAC3B,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Configuration options for the Derived semantic.\n * Controls source fields, transformation, and recalculation behavior.\n *\n * Use Derived when you need to combine, format, or transform existing field values\n */\nexport interface DerivedConfig {\n /**\n * List of source field keys this value is derived from.\n */\n sourceFields: string[]\n /**\n * Name of a transformation function to apply to the source fields.\n */\n transformation?: string\n /**\n * Whether to recalculate the value on update (default: true).\n */\n recalculateOnUpdate?: boolean\n /**\n * Whether to allow manual override of the derived value.\n */\n allowManualOverride?: boolean\n /**\n * Custom metadata for the derived 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 Derived semantic.\n */\nexport interface AppliedDerivedSemantic extends AppliedDataSemantic {\n id: SemanticType.Derived\n config?: DerivedConfig\n}\n\n/**\n * Type guard to check if a semantic is a Derived semantic.\n */\nexport const isDerivedSemantic = (semantic: AppliedDataSemantic): semantic is AppliedDerivedSemantic => {\n return semantic.id === SemanticType.Derived\n}\n\n/**\n * Helper function to create a Derived semantic with configuration.\n */\nexport const createDerivedSemantic = (config: DerivedConfig): AppliedDerivedSemantic => {\n const mergedConfig = {\n ...DEFAULT_DERIVED_CONFIG,\n ...config,\n }\n if (config.metadata) {\n mergedConfig.metadata = { ...config.metadata }\n }\n\n return {\n id: SemanticType.Derived,\n config: mergedConfig,\n }\n}\n\n/**\n * Default configuration for Derived semantic.\n */\nexport const DEFAULT_DERIVED_CONFIG: Partial<DerivedConfig> = {\n recalculateOnUpdate: true,\n allowManualOverride: false,\n}\n"]}
|
|
@@ -2,7 +2,6 @@ import type { AppliedDataSemantic } from '../Semantics.js';
|
|
|
2
2
|
import { SemanticType } from '../Semantics.js';
|
|
3
3
|
/**
|
|
4
4
|
* Configuration options for the Description semantic.
|
|
5
|
-
* Controls length, formatting, and markdown support.
|
|
6
5
|
*/
|
|
7
6
|
export interface DescriptionConfig {
|
|
8
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../../src/modeling/definitions/Description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C
|
|
1
|
+
{"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../../src/modeling/definitions/Description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;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,0BAA2B,SAAQ,mBAAmB;IACrE,EAAE,EAAE,YAAY,CAAC,WAAW,CAAA;IAC5B,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAC3B;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,mBAAmB,KAAG,QAAQ,IAAI,0BAEjF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAQ,iBAAsB,KAAG,0BAa1E,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,iBAAsB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Description.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Description.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"Description.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Description.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAwB9C;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,QAA6B,EAA0C,EAAE;IAC7G,OAAO,QAAQ,CAAC,EAAE,KAAK,YAAY,CAAC,WAAW,CAAA;AACjD,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,SAA4B,EAAE,EAA8B,EAAE;IACtG,MAAM,YAAY,GAAG;QACnB,GAAG,0BAA0B;QAC7B,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,WAAW;QAC5B,MAAM,EAAE,YAAY;KACrB,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAsB,EAAE,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Configuration options for the Description semantic.\n */\nexport interface DescriptionConfig {\n /**\n * Custom metadata for the description 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 Description semantic.\n */\nexport interface AppliedDescriptionSemantic extends AppliedDataSemantic {\n id: SemanticType.Description\n config?: DescriptionConfig\n}\n\n/**\n * Type guard to check if a semantic is a Description semantic.\n */\nexport const isDescriptionSemantic = (semantic: AppliedDataSemantic): semantic is AppliedDescriptionSemantic => {\n return semantic.id === SemanticType.Description\n}\n\n/**\n * Helper function to create a Description semantic with configuration.\n */\nexport const createDescriptionSemantic = (config: DescriptionConfig = {}): AppliedDescriptionSemantic => {\n const mergedConfig = {\n ...DEFAULT_DESCRIPTION_CONFIG,\n ...config,\n }\n if (config.metadata) {\n mergedConfig.metadata = { ...config.metadata }\n }\n\n return {\n id: SemanticType.Description,\n config: mergedConfig,\n }\n}\n\n/**\n * Default configuration for Description semantic.\n */\nexport const DEFAULT_DESCRIPTION_CONFIG: DescriptionConfig = {}\n"]}
|
|
@@ -2,13 +2,17 @@ import type { AppliedDataSemantic } from '../Semantics.js';
|
|
|
2
2
|
import { SemanticType } from '../Semantics.js';
|
|
3
3
|
/**
|
|
4
4
|
* Configuration options for the Email semantic.
|
|
5
|
-
* Controls validation, allowed domains, and verification.
|
|
6
5
|
*/
|
|
7
6
|
export interface EmailConfig {
|
|
8
7
|
/**
|
|
9
8
|
* List of allowed email domains (e.g., ['example.com']).
|
|
9
|
+
* When set, only these domains are allowed.
|
|
10
10
|
*/
|
|
11
11
|
allowedDomains?: string[];
|
|
12
|
+
/**
|
|
13
|
+
* List of disallowed email domains (e.g., ['example.com']).
|
|
14
|
+
*/
|
|
15
|
+
disallowedDomains?: string[];
|
|
12
16
|
/**
|
|
13
17
|
* Whether email verification is required.
|
|
14
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../../../src/modeling/definitions/Email.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C
|
|
1
|
+
{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../../../src/modeling/definitions/Email.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC;;OAEG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAC/D,EAAE,EAAE,YAAY,CAAC,KAAK,CAAA;IACtB,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,UAAU,mBAAmB,KAAG,QAAQ,IAAI,oBAE3E,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAQ,WAAgB,KAAG,oBAa9D,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,WAIlC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Email.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"Email.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Email.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAuD9C;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAA6B,EAAoC,EAAE;IACjG,OAAO,QAAQ,CAAC,EAAE,KAAK,YAAY,CAAC,KAAK,CAAA;AAC3C,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,SAAsB,EAAE,EAAwB,EAAE;IACpF,MAAM,YAAY,GAAG;QACnB,GAAG,oBAAoB;QACvB,GAAG,MAAM;KACV,CAAA;IACD,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,YAAY,CAAC,QAAQ,GAAG,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAA;IAChD,CAAC;IAED,OAAO;QACL,EAAE,EAAE,YAAY,CAAC,KAAK;QACtB,MAAM,EAAE,YAAY;KACrB,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAgB;IAC/C,mBAAmB,EAAE,IAAI;IACzB,kBAAkB,EAAE,IAAI;IACxB,kBAAkB,EAAE,IAAI;CACzB,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Configuration options for the Email semantic.\n */\nexport interface EmailConfig {\n /**\n * List of allowed email domains (e.g., ['example.com']).\n * When set, only these domains are allowed.\n */\n allowedDomains?: string[]\n /**\n * List of disallowed email domains (e.g., ['example.com']).\n */\n disallowedDomains?: string[]\n /**\n * Whether email verification is required.\n */\n requireVerification?: boolean\n /**\n * Whether to allow subaddressing (user+tag@domain.com).\n */\n allowSubaddressing?: boolean\n /**\n * Whether to allow internationalized email addresses.\n *\n * - When true (default): Allows email addresses with non-ASCII characters in the domain part,\n * like user@münchen.de or user@café.com\n * - When false: Only allows ASCII characters in the domain part, like user@example.com\n *\n * Why it exists:\n * - Internationalization: Many countries have domain names with native characters (like German umlauts,\n * French accents, etc.)\n * - RFC 6531: The standard for internationalized email addresses\n * - Validation flexibility: Some systems may need to restrict to ASCII-only domains for compatibility reasons\n */\n allowInternational?: boolean\n /**\n * Custom metadata for the email field.\n */\n metadata?: Record<string, unknown>\n /**\n * Index signature to allow additional properties.\n */\n [key: string]: unknown\n}\n\n/**\n * Type-safe configuration for Email semantic.\n */\nexport interface AppliedEmailSemantic extends AppliedDataSemantic {\n id: SemanticType.Email\n config?: EmailConfig\n}\n\n/**\n * Type guard to check if a semantic is an Email semantic.\n */\nexport const isEmailSemantic = (semantic: AppliedDataSemantic): semantic is AppliedEmailSemantic => {\n return semantic.id === SemanticType.Email\n}\n\n/**\n * Helper function to create an Email semantic with configuration.\n */\nexport const createEmailSemantic = (config: EmailConfig = {}): AppliedEmailSemantic => {\n const mergedConfig = {\n ...DEFAULT_EMAIL_CONFIG,\n ...config,\n }\n if (config.metadata) {\n mergedConfig.metadata = { ...config.metadata }\n }\n\n return {\n id: SemanticType.Email,\n config: mergedConfig,\n }\n}\n\n/**\n * Default configuration for Email semantic.\n */\nexport const DEFAULT_EMAIL_CONFIG: EmailConfig = {\n requireVerification: true,\n allowSubaddressing: true,\n allowInternational: true,\n}\n"]}
|
|
@@ -2,34 +2,12 @@ import type { AppliedDataSemantic } from '../Semantics.js';
|
|
|
2
2
|
import { SemanticType } from '../Semantics.js';
|
|
3
3
|
/**
|
|
4
4
|
* Configuration options for the HTML semantic.
|
|
5
|
-
* Controls rendering, sanitization, and allowed HTML features.
|
|
6
5
|
*/
|
|
7
6
|
export interface HTMLConfig {
|
|
8
7
|
/**
|
|
9
8
|
* List of allowed HTML tags in the content.
|
|
10
9
|
*/
|
|
11
10
|
allowedTags?: string[];
|
|
12
|
-
/**
|
|
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
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
renderMode?: 'html' | 'text' | 'both';
|
|
33
11
|
/**
|
|
34
12
|
* Sanitization level: 'strict', 'moderate', or 'none'.
|
|
35
13
|
*/
|
|
@@ -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
|
|
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;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB;;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,UAYjC,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
|
-
renderMode: 'html',
|
|
30
29
|
sanitizeLevel: 'strict',
|
|
31
30
|
allowImages: true,
|
|
32
31
|
allowLinks: 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;
|
|
1
|
+
{"version":3,"file":"HTML.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/HTML.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAoE9C;;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,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 */\nexport interface HTMLConfig {\n /**\n * List of allowed HTML tags in the content.\n */\n allowedTags?: string[]\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 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,22 +9,6 @@ export interface MarkdownConfig {
|
|
|
9
9
|
* List of allowed HTML tags in the rendered output.
|
|
10
10
|
*/
|
|
11
11
|
allowedTags?: string[];
|
|
12
|
-
/**
|
|
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
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
renderMode?: 'html' | 'text' | 'both';
|
|
28
12
|
/**
|
|
29
13
|
* Sanitization level: 'strict', 'moderate', or 'none'.
|
|
30
14
|
*/
|
|
@@ -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
|
|
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,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,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,cAWrC,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
|
-
renderMode: 'html',
|
|
30
29
|
sanitizeLevel: 'strict',
|
|
31
30
|
allowImages: true,
|
|
32
31
|
allowLinks: 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;
|
|
1
|
+
{"version":3,"file":"Markdown.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Markdown.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAiE9C;;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,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 * 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 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"]}
|