@api-client/core 0.15.1 → 0.16.0

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 (126) hide show
  1. package/TESTING_READY.md +114 -0
  2. package/TESTING_SETUP.md +198 -0
  3. package/build/src/modeling/Semantics.d.ts +126 -2
  4. package/build/src/modeling/Semantics.d.ts.map +1 -1
  5. package/build/src/modeling/Semantics.js +281 -13
  6. package/build/src/modeling/Semantics.js.map +1 -1
  7. package/build/src/modeling/definitions/Calculated.d.ts +54 -0
  8. package/build/src/modeling/definitions/Calculated.d.ts.map +1 -0
  9. package/build/src/modeling/definitions/Calculated.js +31 -0
  10. package/build/src/modeling/definitions/Calculated.js.map +1 -0
  11. package/build/src/modeling/definitions/Categories.d.ts +60 -0
  12. package/build/src/modeling/definitions/Categories.d.ts.map +1 -0
  13. package/build/src/modeling/definitions/Categories.js +33 -0
  14. package/build/src/modeling/definitions/Categories.js.map +1 -0
  15. package/build/src/modeling/definitions/Derived.d.ts +54 -0
  16. package/build/src/modeling/definitions/Derived.d.ts.map +1 -0
  17. package/build/src/modeling/definitions/Derived.js +31 -0
  18. package/build/src/modeling/definitions/Derived.js.map +1 -0
  19. package/build/src/modeling/definitions/Description.d.ts +36 -0
  20. package/build/src/modeling/definitions/Description.d.ts.map +1 -0
  21. package/build/src/modeling/definitions/Description.js +28 -0
  22. package/build/src/modeling/definitions/Description.js.map +1 -0
  23. package/build/src/modeling/definitions/Email.d.ts +66 -0
  24. package/build/src/modeling/definitions/Email.d.ts.map +1 -0
  25. package/build/src/modeling/definitions/Email.js +33 -0
  26. package/build/src/modeling/definitions/Email.js.map +1 -0
  27. package/build/src/modeling/definitions/GeospatialCoordinates.d.ts +212 -0
  28. package/build/src/modeling/definitions/GeospatialCoordinates.d.ts.map +1 -0
  29. package/build/src/modeling/definitions/GeospatialCoordinates.js +129 -0
  30. package/build/src/modeling/definitions/GeospatialCoordinates.js.map +1 -0
  31. package/build/src/modeling/definitions/HTML.d.ts +88 -0
  32. package/build/src/modeling/definitions/HTML.d.ts.map +1 -0
  33. package/build/src/modeling/definitions/HTML.js +42 -0
  34. package/build/src/modeling/definitions/HTML.js.map +1 -0
  35. package/build/src/modeling/definitions/Markdown.d.ts +84 -0
  36. package/build/src/modeling/definitions/Markdown.d.ts.map +1 -0
  37. package/build/src/modeling/definitions/Markdown.js +41 -0
  38. package/build/src/modeling/definitions/Markdown.js.map +1 -0
  39. package/build/src/modeling/definitions/Password.d.ts +112 -0
  40. package/build/src/modeling/definitions/Password.d.ts.map +1 -0
  41. package/build/src/modeling/definitions/Password.js +57 -0
  42. package/build/src/modeling/definitions/Password.js.map +1 -0
  43. package/build/src/modeling/definitions/Phone.d.ts +83 -0
  44. package/build/src/modeling/definitions/Phone.d.ts.map +1 -0
  45. package/build/src/modeling/definitions/Phone.js +39 -0
  46. package/build/src/modeling/definitions/Phone.js.map +1 -0
  47. package/build/src/modeling/definitions/Price.d.ts +102 -0
  48. package/build/src/modeling/definitions/Price.d.ts.map +1 -0
  49. package/build/src/modeling/definitions/Price.js +99 -0
  50. package/build/src/modeling/definitions/Price.js.map +1 -0
  51. package/build/src/modeling/definitions/PublicUniqueName.d.ts +69 -0
  52. package/build/src/modeling/definitions/PublicUniqueName.d.ts.map +1 -0
  53. package/build/src/modeling/definitions/PublicUniqueName.js +34 -0
  54. package/build/src/modeling/definitions/PublicUniqueName.js.map +1 -0
  55. package/build/src/modeling/definitions/SKU.d.ts +127 -0
  56. package/build/src/modeling/definitions/SKU.d.ts.map +1 -0
  57. package/build/src/modeling/definitions/SKU.js +142 -0
  58. package/build/src/modeling/definitions/SKU.js.map +1 -0
  59. package/build/src/modeling/definitions/Status.d.ts +150 -0
  60. package/build/src/modeling/definitions/Status.d.ts.map +1 -0
  61. package/build/src/modeling/definitions/Status.js +60 -0
  62. package/build/src/modeling/definitions/Status.js.map +1 -0
  63. package/build/src/modeling/definitions/Summary.d.ts +53 -0
  64. package/build/src/modeling/definitions/Summary.d.ts.map +1 -0
  65. package/build/src/modeling/definitions/Summary.js +50 -0
  66. package/build/src/modeling/definitions/Summary.js.map +1 -0
  67. package/build/src/modeling/definitions/Tags.d.ts +52 -0
  68. package/build/src/modeling/definitions/Tags.d.ts.map +1 -0
  69. package/build/src/modeling/definitions/Tags.js +32 -0
  70. package/build/src/modeling/definitions/Tags.js.map +1 -0
  71. package/build/src/modeling/definitions/URL.d.ts +68 -0
  72. package/build/src/modeling/definitions/URL.d.ts.map +1 -0
  73. package/build/src/modeling/definitions/URL.js +37 -0
  74. package/build/src/modeling/definitions/URL.js.map +1 -0
  75. package/build/src/modeling/validation/semantic_validation.d.ts +4 -0
  76. package/build/src/modeling/validation/semantic_validation.d.ts.map +1 -1
  77. package/build/src/modeling/validation/semantic_validation.js +32 -1
  78. package/build/src/modeling/validation/semantic_validation.js.map +1 -1
  79. package/build/tsconfig.tsbuildinfo +1 -1
  80. package/data/models/example-generator-api.json +11 -11
  81. package/package.json +1 -1
  82. package/src/modeling/Semantics.ts +297 -14
  83. package/src/modeling/definitions/Calculated.ts +76 -0
  84. package/src/modeling/definitions/Categories.ts +84 -0
  85. package/src/modeling/definitions/Derived.ts +76 -0
  86. package/src/modeling/definitions/Description.ts +55 -0
  87. package/src/modeling/definitions/Email.ts +90 -0
  88. package/src/modeling/definitions/GeospatialCoordinates.ts +274 -0
  89. package/src/modeling/definitions/HTML.ts +121 -0
  90. package/src/modeling/definitions/Markdown.ts +116 -0
  91. package/src/modeling/definitions/Password.ts +156 -0
  92. package/src/modeling/definitions/Phone.ts +116 -0
  93. package/src/modeling/definitions/Price.examples.md +158 -0
  94. package/src/modeling/definitions/Price.ts +180 -0
  95. package/src/modeling/definitions/PublicUniqueName.ts +98 -0
  96. package/src/modeling/definitions/SKU.examples.md +230 -0
  97. package/src/modeling/definitions/SKU.ts +254 -0
  98. package/src/modeling/definitions/Status.ts +227 -0
  99. package/src/modeling/definitions/Summary.ts +73 -0
  100. package/src/modeling/definitions/Tags.ts +75 -0
  101. package/src/modeling/definitions/URL.ts +96 -0
  102. package/src/modeling/validation/semantic_validation.ts +35 -1
  103. package/tests/example-test-setup.ts +133 -0
  104. package/tests/template-node.spec.ts +75 -0
  105. package/tests/test-utils.ts +293 -0
  106. package/tests/unit/modeling/definitions/calculated.spec.ts +33 -0
  107. package/tests/unit/modeling/definitions/categories.spec.ts +38 -0
  108. package/tests/unit/modeling/definitions/derived.spec.ts +34 -0
  109. package/tests/unit/modeling/definitions/description.spec.ts +38 -0
  110. package/tests/unit/modeling/definitions/email.spec.ts +38 -0
  111. package/tests/unit/modeling/definitions/geospatial-coordinates.spec.ts +41 -0
  112. package/tests/unit/modeling/definitions/html.spec.ts +38 -0
  113. package/tests/unit/modeling/definitions/markdown.spec.ts +38 -0
  114. package/tests/unit/modeling/definitions/password.spec.ts +347 -0
  115. package/tests/unit/modeling/definitions/phone.spec.ts +38 -0
  116. package/tests/unit/modeling/definitions/price.spec.ts +465 -0
  117. package/tests/unit/modeling/definitions/public-unique-name.spec.ts +38 -0
  118. package/tests/unit/modeling/definitions/sku.spec.ts +240 -0
  119. package/tests/unit/modeling/definitions/status.spec.ts +37 -0
  120. package/tests/unit/modeling/definitions/summary.spec.ts +36 -0
  121. package/tests/unit/modeling/definitions/tags.spec.ts +38 -0
  122. package/tests/unit/modeling/definitions/url.spec.ts +38 -0
  123. package/tests/unit/modeling/domain_property.spec.ts +106 -0
  124. package/tests/unit/modeling/domain_validation.spec.ts +5 -5
  125. package/tests/unit/modeling/semantic-configs.spec.ts +569 -0
  126. package/tests/unit/modeling/semantics.spec.ts +52 -0
@@ -0,0 +1,129 @@
1
+ import { SemanticType } from '../Semantics.js';
2
+ /**
3
+ * Supported coordinate formats for geospatial data.
4
+ */
5
+ export var GeospatialCoordinateFormat;
6
+ (function (GeospatialCoordinateFormat) {
7
+ /**
8
+ * Latitude, Longitude format: "40.7128,-74.0060"
9
+ */
10
+ GeospatialCoordinateFormat["LatLon"] = "lat,lon";
11
+ /**
12
+ * Longitude, Latitude format: "-74.0060,40.7128"
13
+ */
14
+ GeospatialCoordinateFormat["LonLat"] = "lon,lat";
15
+ /**
16
+ * PostGIS POINT format: "POINT(-74.0060 40.7128)"
17
+ */
18
+ GeospatialCoordinateFormat["PostGIS"] = "postgis";
19
+ /**
20
+ * Degree format with cardinal directions: "40.7128°N, 74.0060°W"
21
+ */
22
+ GeospatialCoordinateFormat["Degree"] = "degree";
23
+ /**
24
+ * Well-Known Text (WKT) format: "POINT(-74.0060 40.7128)"
25
+ */
26
+ GeospatialCoordinateFormat["WKT"] = "wkt";
27
+ /**
28
+ * GeoJSON format: {"type": "Point", "coordinates": [-74.0060, 40.7128]}
29
+ */
30
+ GeospatialCoordinateFormat["GeoJSON"] = "geojson";
31
+ })(GeospatialCoordinateFormat || (GeospatialCoordinateFormat = {}));
32
+ /**
33
+ * Supported distance units for spatial queries.
34
+ */
35
+ export var GeospatialDistanceUnit;
36
+ (function (GeospatialDistanceUnit) {
37
+ /**
38
+ * Meters (SI unit)
39
+ */
40
+ GeospatialDistanceUnit["Meters"] = "meters";
41
+ /**
42
+ * Kilometers
43
+ */
44
+ GeospatialDistanceUnit["Kilometers"] = "kilometers";
45
+ /**
46
+ * Miles (imperial)
47
+ */
48
+ GeospatialDistanceUnit["Miles"] = "miles";
49
+ /**
50
+ * Feet (imperial)
51
+ */
52
+ GeospatialDistanceUnit["Feet"] = "feet";
53
+ /**
54
+ * Yards (imperial)
55
+ */
56
+ GeospatialDistanceUnit["Yards"] = "yards";
57
+ /**
58
+ * Nautical miles
59
+ */
60
+ GeospatialDistanceUnit["NauticalMiles"] = "nautical_miles";
61
+ })(GeospatialDistanceUnit || (GeospatialDistanceUnit = {}));
62
+ /**
63
+ * Supported spatial reference systems.
64
+ */
65
+ export var GeospatialSpatialReferenceSystem;
66
+ (function (GeospatialSpatialReferenceSystem) {
67
+ /**
68
+ * WGS84 (World Geodetic System 1984) - Most common for GPS coordinates
69
+ */
70
+ GeospatialSpatialReferenceSystem["WGS84"] = "EPSG:4326";
71
+ /**
72
+ * Web Mercator - Common for web mapping
73
+ */
74
+ GeospatialSpatialReferenceSystem["WebMercator"] = "EPSG:3857";
75
+ /**
76
+ * NAD83 (North American Datum 1983)
77
+ */
78
+ GeospatialSpatialReferenceSystem["NAD83"] = "EPSG:4269";
79
+ /**
80
+ * NAD27 (North American Datum 1927)
81
+ */
82
+ GeospatialSpatialReferenceSystem["NAD27"] = "EPSG:4267";
83
+ })(GeospatialSpatialReferenceSystem || (GeospatialSpatialReferenceSystem = {}));
84
+ /**
85
+ * Type guard to check if a semantic is a GeospatialCoordinates semantic.
86
+ */
87
+ export const isGeospatialCoordinatesSemantic = (semantic) => {
88
+ return semantic.id === SemanticType.GeospatialCoordinates;
89
+ };
90
+ /**
91
+ * Helper function to create a GeospatialCoordinates semantic with configuration.
92
+ */
93
+ export const createGeospatialCoordinatesSemantic = (config = {}) => {
94
+ const mergedConfig = {
95
+ ...DEFAULT_GEOSPATIAL_CONFIG,
96
+ ...config,
97
+ };
98
+ if (config.metadata) {
99
+ mergedConfig.metadata = { ...config.metadata };
100
+ }
101
+ if (config.validationBounds) {
102
+ mergedConfig.validationBounds = { ...config.validationBounds };
103
+ }
104
+ return {
105
+ id: SemanticType.GeospatialCoordinates,
106
+ config: mergedConfig,
107
+ };
108
+ };
109
+ /**
110
+ * Default configuration for GeospatialCoordinates semantic.
111
+ */
112
+ export const DEFAULT_GEOSPATIAL_CONFIG = {
113
+ format: GeospatialCoordinateFormat.LatLon,
114
+ spatialReferenceSystem: GeospatialSpatialReferenceSystem.WGS84,
115
+ defaultDistanceUnit: GeospatialDistanceUnit.Meters,
116
+ enableSpatialIndexing: true,
117
+ enableValidation: true,
118
+ enablePostGISIntegration: true,
119
+ postGISGeometryType: 'POINT',
120
+ enableDistanceQueries: true,
121
+ maxQueryDistance: 100000,
122
+ enableBoundingBoxQueries: true,
123
+ enablePolygonQueries: false,
124
+ apiEndpointPrefix: '/nearby',
125
+ includeElevation: false,
126
+ coordinatePrecision: 6,
127
+ enableReverseGeocoding: false,
128
+ };
129
+ //# sourceMappingURL=GeospatialCoordinates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GeospatialCoordinates.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/GeospatialCoordinates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;GAEG;AACH,MAAM,CAAN,IAAY,0BAyBX;AAzBD,WAAY,0BAA0B;IACpC;;OAEG;IACH,gDAAkB,CAAA;IAClB;;OAEG;IACH,gDAAkB,CAAA;IAClB;;OAEG;IACH,iDAAmB,CAAA;IACnB;;OAEG;IACH,+CAAiB,CAAA;IACjB;;OAEG;IACH,yCAAW,CAAA;IACX;;OAEG;IACH,iDAAmB,CAAA;AACrB,CAAC,EAzBW,0BAA0B,KAA1B,0BAA0B,QAyBrC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,sBAyBX;AAzBD,WAAY,sBAAsB;IAChC;;OAEG;IACH,2CAAiB,CAAA;IACjB;;OAEG;IACH,mDAAyB,CAAA;IACzB;;OAEG;IACH,yCAAe,CAAA;IACf;;OAEG;IACH,uCAAa,CAAA;IACb;;OAEG;IACH,yCAAe,CAAA;IACf;;OAEG;IACH,0DAAgC,CAAA;AAClC,CAAC,EAzBW,sBAAsB,KAAtB,sBAAsB,QAyBjC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,gCAiBX;AAjBD,WAAY,gCAAgC;IAC1C;;OAEG;IACH,uDAAmB,CAAA;IACnB;;OAEG;IACH,6DAAyB,CAAA;IACzB;;OAEG;IACH,uDAAmB,CAAA;IACnB;;OAEG;IACH,uDAAmB,CAAA;AACrB,CAAC,EAjBW,gCAAgC,KAAhC,gCAAgC,QAiB3C;AA2ID;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAC7C,QAA6B,EACqB,EAAE;IACpD,OAAO,QAAQ,CAAC,EAAE,KAAK,YAAY,CAAC,qBAAqB,CAAA;AAC3D,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,CACjD,SAAsC,EAAE,EACF,EAAE;IACxC,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;IACD,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC5B,YAAY,CAAC,gBAAgB,GAAG,EAAE,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAA;IAChE,CAAC;IAED,OAAO;QACL,EAAE,EAAE,YAAY,CAAC,qBAAqB;QACtC,MAAM,EAAE,YAAY;KACrB,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAgC;IACpE,MAAM,EAAE,0BAA0B,CAAC,MAAM;IACzC,sBAAsB,EAAE,gCAAgC,CAAC,KAAK;IAC9D,mBAAmB,EAAE,sBAAsB,CAAC,MAAM;IAClD,qBAAqB,EAAE,IAAI;IAC3B,gBAAgB,EAAE,IAAI;IACtB,wBAAwB,EAAE,IAAI;IAC9B,mBAAmB,EAAE,OAAO;IAC5B,qBAAqB,EAAE,IAAI;IAC3B,gBAAgB,EAAE,MAAM;IACxB,wBAAwB,EAAE,IAAI;IAC9B,oBAAoB,EAAE,KAAK;IAC3B,iBAAiB,EAAE,SAAS;IAC5B,gBAAgB,EAAE,KAAK;IACvB,mBAAmB,EAAE,CAAC;IACtB,sBAAsB,EAAE,KAAK;CAC9B,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Supported coordinate formats for geospatial data.\n */\nexport enum GeospatialCoordinateFormat {\n /**\n * Latitude, Longitude format: \"40.7128,-74.0060\"\n */\n LatLon = 'lat,lon',\n /**\n * Longitude, Latitude format: \"-74.0060,40.7128\"\n */\n LonLat = 'lon,lat',\n /**\n * PostGIS POINT format: \"POINT(-74.0060 40.7128)\"\n */\n PostGIS = 'postgis',\n /**\n * Degree format with cardinal directions: \"40.7128°N, 74.0060°W\"\n */\n Degree = 'degree',\n /**\n * Well-Known Text (WKT) format: \"POINT(-74.0060 40.7128)\"\n */\n WKT = 'wkt',\n /**\n * GeoJSON format: {\"type\": \"Point\", \"coordinates\": [-74.0060, 40.7128]}\n */\n GeoJSON = 'geojson',\n}\n\n/**\n * Supported distance units for spatial queries.\n */\nexport enum GeospatialDistanceUnit {\n /**\n * Meters (SI unit)\n */\n Meters = 'meters',\n /**\n * Kilometers\n */\n Kilometers = 'kilometers',\n /**\n * Miles (imperial)\n */\n Miles = 'miles',\n /**\n * Feet (imperial)\n */\n Feet = 'feet',\n /**\n * Yards (imperial)\n */\n Yards = 'yards',\n /**\n * Nautical miles\n */\n NauticalMiles = 'nautical_miles',\n}\n\n/**\n * Supported spatial reference systems.\n */\nexport enum GeospatialSpatialReferenceSystem {\n /**\n * WGS84 (World Geodetic System 1984) - Most common for GPS coordinates\n */\n WGS84 = 'EPSG:4326',\n /**\n * Web Mercator - Common for web mapping\n */\n WebMercator = 'EPSG:3857',\n /**\n * NAD83 (North American Datum 1983)\n */\n NAD83 = 'EPSG:4269',\n /**\n * NAD27 (North American Datum 1927)\n */\n NAD27 = 'EPSG:4267',\n}\n\n/**\n * Configuration options for the GeospatialCoordinates semantic.\n * These options control how the runtime handles geospatial data and queries.\n */\nexport interface GeospatialCoordinatesConfig {\n /**\n * The coordinate format expected for input/output.\n * Defaults to 'lat,lon' if not specified.\n */\n format?: GeospatialCoordinateFormat\n\n /**\n * The spatial reference system (SRS) for the coordinates.\n * Defaults to WGS84 (EPSG:4326) if not specified.\n */\n spatialReferenceSystem?: GeospatialSpatialReferenceSystem\n\n /**\n * The default distance unit for spatial queries.\n * Defaults to 'meters' if not specified.\n */\n defaultDistanceUnit?: GeospatialDistanceUnit\n\n /**\n * Whether to enable automatic spatial indexing.\n * Defaults to true if not specified.\n */\n enableSpatialIndexing?: boolean\n\n /**\n * Whether to enable automatic coordinate validation.\n * Defaults to true if not specified.\n */\n enableValidation?: boolean\n\n /**\n * Custom validation rules for coordinate bounds.\n * If not specified, uses standard latitude (-90 to 90) and longitude (-180 to 180) bounds.\n */\n validationBounds?: {\n /**\n * Minimum latitude value\n */\n minLatitude?: number\n /**\n * Maximum latitude value\n */\n maxLatitude?: number\n /**\n * Minimum longitude value\n */\n minLongitude?: number\n /**\n * Maximum longitude value\n */\n maxLongitude?: number\n }\n\n /**\n * Whether to enable automatic PostGIS integration when using PostgreSQL.\n * Defaults to true if not specified.\n */\n enablePostGISIntegration?: boolean\n\n /**\n * The PostGIS geometry type to use for storage.\n * Defaults to 'POINT' if not specified.\n */\n postGISGeometryType?: 'POINT' | 'LINESTRING' | 'POLYGON' | 'MULTIPOINT' | 'MULTILINESTRING' | 'MULTIPOLYGON'\n\n /**\n * Whether to enable distance-based query endpoints.\n * Defaults to true if not specified.\n */\n enableDistanceQueries?: boolean\n\n /**\n * Maximum distance allowed in distance queries (in the default distance unit).\n * Defaults to 100000 (100km) if not specified.\n */\n maxQueryDistance?: number\n\n /**\n * Whether to enable bounding box query endpoints.\n * Defaults to true if not specified.\n */\n enableBoundingBoxQueries?: boolean\n\n /**\n * Whether to enable polygon intersection query endpoints.\n * Defaults to false if not specified.\n */\n enablePolygonQueries?: boolean\n\n /**\n * Custom API endpoint prefix for geospatial queries.\n * Defaults to '/nearby' if not specified.\n */\n apiEndpointPrefix?: string\n\n /**\n * Whether to include elevation data in coordinates (3D coordinates).\n * Defaults to false if not specified.\n */\n includeElevation?: boolean\n\n /**\n * Precision for coordinate storage (number of decimal places).\n * Defaults to 6 if not specified.\n */\n coordinatePrecision?: number\n\n /**\n * Whether to enable reverse geocoding capabilities.\n * Defaults to false if not specified.\n */\n enableReverseGeocoding?: boolean\n\n /**\n * Custom metadata for the geospatial 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 GeospatialCoordinates semantic.\n */\nexport interface AppliedGeospatialCoordinatesSemantic extends AppliedDataSemantic {\n id: SemanticType.GeospatialCoordinates\n config?: GeospatialCoordinatesConfig\n}\n\n/**\n * Type guard to check if a semantic is a GeospatialCoordinates semantic.\n */\nexport const isGeospatialCoordinatesSemantic = (\n semantic: AppliedDataSemantic\n): semantic is AppliedGeospatialCoordinatesSemantic => {\n return semantic.id === SemanticType.GeospatialCoordinates\n}\n\n/**\n * Helper function to create a GeospatialCoordinates semantic with configuration.\n */\nexport const createGeospatialCoordinatesSemantic = (\n config: GeospatialCoordinatesConfig = {}\n): AppliedGeospatialCoordinatesSemantic => {\n const mergedConfig = {\n ...DEFAULT_GEOSPATIAL_CONFIG,\n ...config,\n }\n if (config.metadata) {\n mergedConfig.metadata = { ...config.metadata }\n }\n if (config.validationBounds) {\n mergedConfig.validationBounds = { ...config.validationBounds }\n }\n\n return {\n id: SemanticType.GeospatialCoordinates,\n config: mergedConfig,\n }\n}\n\n/**\n * Default configuration for GeospatialCoordinates semantic.\n */\nexport const DEFAULT_GEOSPATIAL_CONFIG: GeospatialCoordinatesConfig = {\n format: GeospatialCoordinateFormat.LatLon,\n spatialReferenceSystem: GeospatialSpatialReferenceSystem.WGS84,\n defaultDistanceUnit: GeospatialDistanceUnit.Meters,\n enableSpatialIndexing: true,\n enableValidation: true,\n enablePostGISIntegration: true,\n postGISGeometryType: 'POINT',\n enableDistanceQueries: true,\n maxQueryDistance: 100000,\n enableBoundingBoxQueries: true,\n enablePolygonQueries: false,\n apiEndpointPrefix: '/nearby',\n includeElevation: false,\n coordinatePrecision: 6,\n enableReverseGeocoding: false,\n}\n"]}
@@ -0,0 +1,88 @@
1
+ import type { AppliedDataSemantic } from '../Semantics.js';
2
+ import { SemanticType } from '../Semantics.js';
3
+ /**
4
+ * Configuration options for the HTML semantic.
5
+ * Controls rendering, sanitization, and allowed HTML features.
6
+ */
7
+ export interface HTMLConfig {
8
+ /**
9
+ * List of allowed HTML tags in the content.
10
+ */
11
+ allowedTags?: string[];
12
+ /**
13
+ * Maximum length of the HTML content.
14
+ */
15
+ maxLength?: number;
16
+ /**
17
+ * Render mode: 'html', 'text', or 'both'.
18
+ */
19
+ renderMode?: 'html' | 'text' | 'both';
20
+ /**
21
+ * Sanitization level: 'strict', 'moderate', or 'none'.
22
+ */
23
+ sanitizeLevel?: 'strict' | 'moderate' | 'none';
24
+ /**
25
+ * Whether to allow images in HTML.
26
+ */
27
+ allowImages?: boolean;
28
+ /**
29
+ * Whether to allow links in HTML.
30
+ */
31
+ allowLinks?: boolean;
32
+ /**
33
+ * Whether to allow tables in HTML.
34
+ */
35
+ allowTables?: boolean;
36
+ /**
37
+ * Whether to allow forms in HTML.
38
+ */
39
+ allowForms?: boolean;
40
+ /**
41
+ * Whether to allow scripts in HTML.
42
+ */
43
+ allowScripts?: boolean;
44
+ /**
45
+ * Whether to allow iframes in HTML.
46
+ */
47
+ allowIframes?: boolean;
48
+ /**
49
+ * Whether to allow embedded content (video, audio, etc.).
50
+ */
51
+ allowEmbedded?: boolean;
52
+ /**
53
+ * Whether to allow CSS styles in HTML.
54
+ */
55
+ allowStyles?: boolean;
56
+ /**
57
+ * Whether to allow data attributes in HTML.
58
+ */
59
+ allowDataAttributes?: boolean;
60
+ /**
61
+ * Custom metadata for the HTML field.
62
+ */
63
+ metadata?: Record<string, unknown>;
64
+ /**
65
+ * Index signature to allow additional properties.
66
+ */
67
+ [key: string]: unknown;
68
+ }
69
+ /**
70
+ * Type-safe configuration for HTML semantic.
71
+ */
72
+ export interface AppliedHTMLSemantic extends AppliedDataSemantic {
73
+ id: SemanticType.HTML;
74
+ config?: HTMLConfig;
75
+ }
76
+ /**
77
+ * Type guard to check if a semantic is an HTML semantic.
78
+ */
79
+ export declare const isHTMLSemantic: (semantic: AppliedDataSemantic) => semantic is AppliedHTMLSemantic;
80
+ /**
81
+ * Helper function to create an HTML semantic with configuration.
82
+ */
83
+ export declare const createHTMLSemantic: (config?: HTMLConfig) => AppliedHTMLSemantic;
84
+ /**
85
+ * Default configuration for HTML semantic.
86
+ */
87
+ export declare const DEFAULT_HTML_CONFIG: HTMLConfig;
88
+ //# sourceMappingURL=HTML.d.ts.map
@@ -0,0 +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;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,UAcjC,CAAA"}
@@ -0,0 +1,42 @@
1
+ import { SemanticType } from '../Semantics.js';
2
+ /**
3
+ * Type guard to check if a semantic is an HTML semantic.
4
+ */
5
+ export const isHTMLSemantic = (semantic) => {
6
+ return semantic.id === SemanticType.HTML;
7
+ };
8
+ /**
9
+ * Helper function to create an HTML semantic with configuration.
10
+ */
11
+ export const createHTMLSemantic = (config = {}) => {
12
+ const mergedConfig = {
13
+ ...DEFAULT_HTML_CONFIG,
14
+ ...config,
15
+ };
16
+ if (config.metadata) {
17
+ mergedConfig.metadata = { ...config.metadata };
18
+ }
19
+ return {
20
+ id: SemanticType.HTML,
21
+ config: mergedConfig,
22
+ };
23
+ };
24
+ /**
25
+ * Default configuration for HTML semantic.
26
+ */
27
+ export const DEFAULT_HTML_CONFIG = {
28
+ allowedTags: ['b', 'i', 'em', 'strong', 'a', 'ul', 'ol', 'li', 'p', 'br', 'pre', 'code', 'div', 'span'],
29
+ maxLength: 10000,
30
+ renderMode: 'html',
31
+ sanitizeLevel: 'strict',
32
+ allowImages: true,
33
+ allowLinks: true,
34
+ allowTables: true,
35
+ allowForms: false,
36
+ allowScripts: false,
37
+ allowIframes: false,
38
+ allowEmbedded: false,
39
+ allowStyles: false,
40
+ allowDataAttributes: false,
41
+ };
42
+ //# sourceMappingURL=HTML.js.map
@@ -0,0 +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"]}
@@ -0,0 +1,84 @@
1
+ import type { AppliedDataSemantic } from '../Semantics.js';
2
+ import { SemanticType } from '../Semantics.js';
3
+ /**
4
+ * Configuration options for the Markdown semantic.
5
+ * Controls rendering, sanitization, and allowed features.
6
+ */
7
+ export interface MarkdownConfig {
8
+ /**
9
+ * List of allowed HTML tags in the rendered output.
10
+ */
11
+ allowedTags?: string[];
12
+ /**
13
+ * Maximum length of the markdown content.
14
+ */
15
+ maxLength?: number;
16
+ /**
17
+ * Render mode: 'html', 'text', or 'both'.
18
+ */
19
+ renderMode?: 'html' | 'text' | 'both';
20
+ /**
21
+ * Sanitization level: 'strict', 'moderate', or 'none'.
22
+ */
23
+ sanitizeLevel?: 'strict' | 'moderate' | 'none';
24
+ /**
25
+ * Whether to allow images in markdown.
26
+ */
27
+ allowImages?: boolean;
28
+ /**
29
+ * Whether to allow links in markdown.
30
+ */
31
+ allowLinks?: boolean;
32
+ /**
33
+ * Whether to allow tables in markdown.
34
+ */
35
+ allowTables?: boolean;
36
+ /**
37
+ * Whether to allow raw HTML in markdown.
38
+ */
39
+ allowHtml?: boolean;
40
+ /**
41
+ * Whether to allow footnotes in markdown.
42
+ */
43
+ allowFootnotes?: boolean;
44
+ /**
45
+ * Whether to allow GitHub-style task lists.
46
+ */
47
+ allowTaskLists?: boolean;
48
+ /**
49
+ * Whether to allow strikethrough formatting.
50
+ */
51
+ allowStrikethrough?: boolean;
52
+ /**
53
+ * Whether to allow math expressions (e.g., LaTeX).
54
+ */
55
+ allowMath?: boolean;
56
+ /**
57
+ * Custom metadata for the markdown field.
58
+ */
59
+ metadata?: Record<string, unknown>;
60
+ /**
61
+ * Index signature to allow additional properties.
62
+ */
63
+ [key: string]: unknown;
64
+ }
65
+ /**
66
+ * Type-safe configuration for Markdown semantic.
67
+ */
68
+ export interface AppliedMarkdownSemantic extends AppliedDataSemantic {
69
+ id: SemanticType.Markdown;
70
+ config?: MarkdownConfig;
71
+ }
72
+ /**
73
+ * Type guard to check if a semantic is a Markdown semantic.
74
+ */
75
+ export declare const isMarkdownSemantic: (semantic: AppliedDataSemantic) => semantic is AppliedMarkdownSemantic;
76
+ /**
77
+ * Helper function to create a Markdown semantic with configuration.
78
+ */
79
+ export declare const createMarkdownSemantic: (config?: MarkdownConfig) => AppliedMarkdownSemantic;
80
+ /**
81
+ * Default configuration for Markdown semantic.
82
+ */
83
+ export declare const DEFAULT_MARKDOWN_CONFIG: MarkdownConfig;
84
+ //# sourceMappingURL=Markdown.d.ts.map
@@ -0,0 +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,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,cAarC,CAAA"}
@@ -0,0 +1,41 @@
1
+ import { SemanticType } from '../Semantics.js';
2
+ /**
3
+ * Type guard to check if a semantic is a Markdown semantic.
4
+ */
5
+ export const isMarkdownSemantic = (semantic) => {
6
+ return semantic.id === SemanticType.Markdown;
7
+ };
8
+ /**
9
+ * Helper function to create a Markdown semantic with configuration.
10
+ */
11
+ export const createMarkdownSemantic = (config = {}) => {
12
+ const mergedConfig = {
13
+ ...DEFAULT_MARKDOWN_CONFIG,
14
+ ...config,
15
+ };
16
+ if (config.metadata) {
17
+ mergedConfig.metadata = { ...config.metadata };
18
+ }
19
+ return {
20
+ id: SemanticType.Markdown,
21
+ config: mergedConfig,
22
+ };
23
+ };
24
+ /**
25
+ * Default configuration for Markdown semantic.
26
+ */
27
+ export const DEFAULT_MARKDOWN_CONFIG = {
28
+ allowedTags: ['b', 'i', 'em', 'strong', 'a', 'ul', 'ol', 'li', 'p', 'br', 'pre', 'code'],
29
+ maxLength: 10000,
30
+ renderMode: 'html',
31
+ sanitizeLevel: 'strict',
32
+ allowImages: true,
33
+ allowLinks: true,
34
+ allowTables: true,
35
+ allowHtml: false,
36
+ allowFootnotes: false,
37
+ allowTaskLists: false,
38
+ allowStrikethrough: true,
39
+ allowMath: false,
40
+ };
41
+ //# sourceMappingURL=Markdown.js.map
@@ -0,0 +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"]}
@@ -0,0 +1,112 @@
1
+ import type { AppliedDataSemantic } from '../Semantics.js';
2
+ import { SemanticType } from '../Semantics.js';
3
+ /**
4
+ * Supported encryption algorithms for password hashing.
5
+ */
6
+ export declare enum PasswordEncryptionAlgorithm {
7
+ /**
8
+ * bcrypt - Industry standard, secure, and widely supported
9
+ */
10
+ Bcrypt = "bcrypt",
11
+ /**
12
+ * Argon2 - Winner of the Password Hashing Competition, very secure
13
+ */
14
+ Argon2 = "argon2",
15
+ /**
16
+ * scrypt - Memory-hard function, good for high-security applications
17
+ */
18
+ Scrypt = "scrypt"
19
+ }
20
+ /**
21
+ * Configuration options for the Password semantic.
22
+ * These options control password validation and encryption behavior.
23
+ */
24
+ export interface PasswordConfig {
25
+ /**
26
+ * Whether to require special characters.
27
+ * Defaults to false if not specified.
28
+ */
29
+ requireSpecialChars?: boolean;
30
+ /**
31
+ * Whether to require numbers.
32
+ * Defaults to false if not specified.
33
+ */
34
+ requireNumbers?: boolean;
35
+ /**
36
+ * Whether to require uppercase letters.
37
+ * Defaults to false if not specified.
38
+ */
39
+ requireUppercase?: boolean;
40
+ /**
41
+ * Whether to require lowercase letters.
42
+ * Defaults to false if not specified.
43
+ */
44
+ requireLowercase?: boolean;
45
+ /**
46
+ * Encryption algorithm to use for password hashing.
47
+ * Defaults to 'bcrypt' if not specified.
48
+ */
49
+ encryptionAlgorithm?: PasswordEncryptionAlgorithm;
50
+ /**
51
+ * Number of salt rounds for bcrypt.
52
+ * Defaults to 12 if not specified.
53
+ */
54
+ saltRounds?: number;
55
+ /**
56
+ * Maximum age of password in days before requiring change.
57
+ * Defaults to null (no expiration) if not specified.
58
+ */
59
+ maxAge?: number;
60
+ /**
61
+ * Whether to prevent reuse of recent passwords.
62
+ * Defaults to false if not specified.
63
+ */
64
+ preventReuse?: boolean;
65
+ /**
66
+ * Number of recent passwords to prevent reuse.
67
+ * Defaults to 5 if preventReuse is true.
68
+ */
69
+ preventReuseCount?: number;
70
+ /**
71
+ * Custom password validation regex pattern.
72
+ * If specified, overrides other validation rules.
73
+ */
74
+ customPattern?: string;
75
+ /**
76
+ * Custom error message for validation failures.
77
+ */
78
+ customErrorMessage?: string;
79
+ /**
80
+ * Whether to allow common passwords.
81
+ * Defaults to false if not specified.
82
+ */
83
+ allowCommonPasswords?: boolean;
84
+ /**
85
+ * Custom metadata for the password field.
86
+ */
87
+ metadata?: Record<string, unknown>;
88
+ /**
89
+ * Index signature to allow additional properties.
90
+ */
91
+ [key: string]: unknown;
92
+ }
93
+ /**
94
+ * Type-safe configuration for Password semantic.
95
+ */
96
+ export interface AppliedPasswordSemantic extends AppliedDataSemantic {
97
+ id: SemanticType.Password;
98
+ config?: PasswordConfig;
99
+ }
100
+ /**
101
+ * Type guard to check if a semantic is a Password semantic.
102
+ */
103
+ export declare const isPasswordSemantic: (semantic: AppliedDataSemantic) => semantic is AppliedPasswordSemantic;
104
+ /**
105
+ * Helper function to create a Password semantic with configuration.
106
+ */
107
+ export declare const createPasswordSemantic: (config?: PasswordConfig) => AppliedPasswordSemantic;
108
+ /**
109
+ * Default configuration for Password semantic.
110
+ */
111
+ export declare const DEFAULT_PASSWORD_CONFIG: PasswordConfig;
112
+ //# sourceMappingURL=Password.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Password.d.ts","sourceRoot":"","sources":["../../../../src/modeling/definitions/Password.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;GAEG;AACH,oBAAY,2BAA2B;IACrC;;OAEG;IACH,MAAM,WAAW;IACjB;;OAEG;IACH,MAAM,WAAW;IACjB;;OAEG;IACH,MAAM,WAAW;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAE7B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IAExB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAE1B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAE1B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,2BAA2B,CAAA;IAEjD;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IAEtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IAEtB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B;;;OAGG;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,uBAapE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,cAWrC,CAAA"}
@@ -0,0 +1,57 @@
1
+ import { SemanticType } from '../Semantics.js';
2
+ /**
3
+ * Supported encryption algorithms for password hashing.
4
+ */
5
+ export var PasswordEncryptionAlgorithm;
6
+ (function (PasswordEncryptionAlgorithm) {
7
+ /**
8
+ * bcrypt - Industry standard, secure, and widely supported
9
+ */
10
+ PasswordEncryptionAlgorithm["Bcrypt"] = "bcrypt";
11
+ /**
12
+ * Argon2 - Winner of the Password Hashing Competition, very secure
13
+ */
14
+ PasswordEncryptionAlgorithm["Argon2"] = "argon2";
15
+ /**
16
+ * scrypt - Memory-hard function, good for high-security applications
17
+ */
18
+ PasswordEncryptionAlgorithm["Scrypt"] = "scrypt";
19
+ })(PasswordEncryptionAlgorithm || (PasswordEncryptionAlgorithm = {}));
20
+ /**
21
+ * Type guard to check if a semantic is a Password semantic.
22
+ */
23
+ export const isPasswordSemantic = (semantic) => {
24
+ return semantic.id === SemanticType.Password;
25
+ };
26
+ /**
27
+ * Helper function to create a Password semantic with configuration.
28
+ */
29
+ export const createPasswordSemantic = (config = {}) => {
30
+ const mergedConfig = {
31
+ ...DEFAULT_PASSWORD_CONFIG,
32
+ ...config,
33
+ };
34
+ if (config.metadata) {
35
+ mergedConfig.metadata = { ...config.metadata };
36
+ }
37
+ return {
38
+ id: SemanticType.Password,
39
+ config: mergedConfig,
40
+ };
41
+ };
42
+ /**
43
+ * Default configuration for Password semantic.
44
+ */
45
+ export const DEFAULT_PASSWORD_CONFIG = {
46
+ requireSpecialChars: true,
47
+ requireNumbers: true,
48
+ requireUppercase: true,
49
+ requireLowercase: true,
50
+ encryptionAlgorithm: PasswordEncryptionAlgorithm.Bcrypt,
51
+ saltRounds: 12,
52
+ maxAge: undefined,
53
+ preventReuse: false,
54
+ preventReuseCount: 5,
55
+ allowCommonPasswords: false,
56
+ };
57
+ //# sourceMappingURL=Password.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Password.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Password.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;GAEG;AACH,MAAM,CAAN,IAAY,2BAaX;AAbD,WAAY,2BAA2B;IACrC;;OAEG;IACH,gDAAiB,CAAA;IACjB;;OAEG;IACH,gDAAiB,CAAA;IACjB;;OAEG;IACH,gDAAiB,CAAA;AACnB,CAAC,EAbW,2BAA2B,KAA3B,2BAA2B,QAatC;AAiGD;;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,mBAAmB,EAAE,IAAI;IACzB,cAAc,EAAE,IAAI;IACpB,gBAAgB,EAAE,IAAI;IACtB,gBAAgB,EAAE,IAAI;IACtB,mBAAmB,EAAE,2BAA2B,CAAC,MAAM;IACvD,UAAU,EAAE,EAAE;IACd,MAAM,EAAE,SAAS;IACjB,YAAY,EAAE,KAAK;IACnB,iBAAiB,EAAE,CAAC;IACpB,oBAAoB,EAAE,KAAK;CAC5B,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Supported encryption algorithms for password hashing.\n */\nexport enum PasswordEncryptionAlgorithm {\n /**\n * bcrypt - Industry standard, secure, and widely supported\n */\n Bcrypt = 'bcrypt',\n /**\n * Argon2 - Winner of the Password Hashing Competition, very secure\n */\n Argon2 = 'argon2',\n /**\n * scrypt - Memory-hard function, good for high-security applications\n */\n Scrypt = 'scrypt',\n}\n\n/**\n * Configuration options for the Password semantic.\n * These options control password validation and encryption behavior.\n */\nexport interface PasswordConfig {\n /**\n * Whether to require special characters.\n * Defaults to false if not specified.\n */\n requireSpecialChars?: boolean\n\n /**\n * Whether to require numbers.\n * Defaults to false if not specified.\n */\n requireNumbers?: boolean\n\n /**\n * Whether to require uppercase letters.\n * Defaults to false if not specified.\n */\n requireUppercase?: boolean\n\n /**\n * Whether to require lowercase letters.\n * Defaults to false if not specified.\n */\n requireLowercase?: boolean\n\n /**\n * Encryption algorithm to use for password hashing.\n * Defaults to 'bcrypt' if not specified.\n */\n encryptionAlgorithm?: PasswordEncryptionAlgorithm\n\n /**\n * Number of salt rounds for bcrypt.\n * Defaults to 12 if not specified.\n */\n saltRounds?: number\n\n /**\n * Maximum age of password in days before requiring change.\n * Defaults to null (no expiration) if not specified.\n */\n maxAge?: number\n\n /**\n * Whether to prevent reuse of recent passwords.\n * Defaults to false if not specified.\n */\n preventReuse?: boolean\n\n /**\n * Number of recent passwords to prevent reuse.\n * Defaults to 5 if preventReuse is true.\n */\n preventReuseCount?: number\n\n /**\n * Custom password validation regex pattern.\n * If specified, overrides other validation rules.\n */\n customPattern?: string\n\n /**\n * Custom error message for validation failures.\n */\n customErrorMessage?: string\n\n /**\n * Whether to allow common passwords.\n * Defaults to false if not specified.\n */\n allowCommonPasswords?: boolean\n\n /**\n * Custom metadata for the password 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 Password semantic.\n */\nexport interface AppliedPasswordSemantic extends AppliedDataSemantic {\n id: SemanticType.Password\n config?: PasswordConfig\n}\n\n/**\n * Type guard to check if a semantic is a Password semantic.\n */\nexport const isPasswordSemantic = (semantic: AppliedDataSemantic): semantic is AppliedPasswordSemantic => {\n return semantic.id === SemanticType.Password\n}\n\n/**\n * Helper function to create a Password semantic with configuration.\n */\nexport const createPasswordSemantic = (config: PasswordConfig = {}): AppliedPasswordSemantic => {\n const mergedConfig = {\n ...DEFAULT_PASSWORD_CONFIG,\n ...config,\n }\n if (config.metadata) {\n mergedConfig.metadata = { ...config.metadata }\n }\n\n return {\n id: SemanticType.Password,\n config: mergedConfig,\n }\n}\n\n/**\n * Default configuration for Password semantic.\n */\nexport const DEFAULT_PASSWORD_CONFIG: PasswordConfig = {\n requireSpecialChars: true,\n requireNumbers: true,\n requireUppercase: true,\n requireLowercase: true,\n encryptionAlgorithm: PasswordEncryptionAlgorithm.Bcrypt,\n saltRounds: 12,\n maxAge: undefined,\n preventReuse: false,\n preventReuseCount: 5,\n allowCommonPasswords: false,\n}\n"]}