@fgv/ts-res 5.1.0-2 → 5.1.0-20

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 (571) hide show
  1. package/dist/index.browser.js.map +1 -0
  2. package/dist/index.js.map +1 -0
  3. package/dist/packlets/bundle/bundleBuilder.js.map +1 -0
  4. package/dist/packlets/bundle/bundleLoader.js.map +1 -0
  5. package/dist/packlets/bundle/bundleNormalizer.js.map +1 -0
  6. package/dist/packlets/bundle/bundleUtils.js.map +1 -0
  7. package/dist/packlets/bundle/convert.js.map +1 -0
  8. package/dist/packlets/bundle/index.js.map +1 -0
  9. package/dist/packlets/bundle/model.js.map +1 -0
  10. package/dist/packlets/common/conditions.js.map +1 -0
  11. package/dist/packlets/common/convert.js.map +1 -0
  12. package/dist/packlets/common/helpers/conditions.js.map +1 -0
  13. package/dist/packlets/common/helpers/context.js.map +1 -0
  14. package/dist/packlets/common/helpers/index.js.map +1 -0
  15. package/dist/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  16. package/dist/packlets/common/helpers/resources.js +2 -4
  17. package/dist/packlets/common/helpers/resources.js.map +1 -0
  18. package/dist/packlets/common/index.js.map +1 -0
  19. package/dist/packlets/common/resources.js.map +1 -0
  20. package/dist/packlets/common/validate/conditions.js +4 -4
  21. package/dist/packlets/common/validate/conditions.js.map +1 -0
  22. package/dist/packlets/common/validate/index.js.map +1 -0
  23. package/dist/packlets/common/validate/regularExpressions.js +2 -2
  24. package/dist/packlets/common/validate/regularExpressions.js.map +1 -0
  25. package/dist/packlets/common/validate/resources.js +1 -1
  26. package/dist/packlets/common/validate/resources.js.map +1 -0
  27. package/dist/packlets/conditions/condition.js +3 -7
  28. package/dist/packlets/conditions/condition.js.map +1 -0
  29. package/dist/packlets/conditions/conditionCollector.js.map +1 -0
  30. package/dist/packlets/conditions/conditionDecls.js.map +1 -0
  31. package/dist/packlets/conditions/conditionSet.js.map +1 -0
  32. package/dist/packlets/conditions/conditionSetCollector.js.map +1 -0
  33. package/dist/packlets/conditions/conditionSetDecls.js.map +1 -0
  34. package/dist/packlets/conditions/conditionToken.js.map +1 -0
  35. package/dist/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  36. package/dist/packlets/conditions/convert/decls.js.map +1 -0
  37. package/dist/packlets/conditions/convert/index.js.map +1 -0
  38. package/dist/packlets/conditions/index.js.map +1 -0
  39. package/dist/packlets/config/common.js +78 -0
  40. package/dist/packlets/config/common.js.map +1 -0
  41. package/dist/packlets/config/configInitFactory.js +258 -0
  42. package/dist/packlets/config/configInitFactory.js.map +1 -0
  43. package/dist/packlets/config/convert.js +56 -0
  44. package/dist/packlets/config/convert.js.map +1 -0
  45. package/dist/packlets/config/index.browser.js +34 -0
  46. package/dist/packlets/config/index.browser.js.map +1 -0
  47. package/dist/packlets/config/index.js +28 -0
  48. package/dist/packlets/config/index.js.map +1 -0
  49. package/dist/packlets/config/json.js +23 -0
  50. package/dist/packlets/config/json.js.map +1 -0
  51. package/dist/packlets/config/predefined/default.js +138 -0
  52. package/dist/packlets/config/predefined/default.js.map +1 -0
  53. package/dist/packlets/config/predefined/extended.js +190 -0
  54. package/dist/packlets/config/predefined/extended.js.map +1 -0
  55. package/dist/packlets/config/predefined/index.js +25 -0
  56. package/dist/packlets/config/predefined/index.js.map +1 -0
  57. package/dist/packlets/config/systemConfiguration.js +147 -0
  58. package/dist/packlets/config/systemConfiguration.js.map +1 -0
  59. package/dist/packlets/context/contextDecls.js.map +1 -0
  60. package/dist/packlets/context/contextToken.js.map +1 -0
  61. package/dist/packlets/context/convert/decls.js.map +1 -0
  62. package/dist/packlets/context/convert/index.js.map +1 -0
  63. package/dist/packlets/context/index.js.map +1 -0
  64. package/dist/packlets/decisions/abstractDecision.js.map +1 -0
  65. package/dist/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  66. package/dist/packlets/decisions/candidate.js.map +1 -0
  67. package/dist/packlets/decisions/common.js.map +1 -0
  68. package/dist/packlets/decisions/concreteDecision.js.map +1 -0
  69. package/dist/packlets/decisions/decision.js +1 -1
  70. package/dist/packlets/decisions/decision.js.map +1 -0
  71. package/dist/packlets/decisions/index.js.map +1 -0
  72. package/dist/packlets/import/fsItem.js +1 -4
  73. package/dist/packlets/import/fsItem.js.map +1 -0
  74. package/dist/packlets/import/importContext.js +3 -3
  75. package/dist/packlets/import/importContext.js.map +1 -0
  76. package/dist/packlets/import/importManager.js +7 -3
  77. package/dist/packlets/import/importManager.js.map +1 -0
  78. package/dist/packlets/import/importable.js.map +1 -0
  79. package/dist/packlets/import/importers/collectionImporter.js +2 -2
  80. package/dist/packlets/import/importers/collectionImporter.js.map +1 -0
  81. package/dist/packlets/import/importers/fsItemImporter.js +30 -14
  82. package/dist/packlets/import/importers/fsItemImporter.js.map +1 -0
  83. package/dist/packlets/import/importers/importer.js.map +1 -0
  84. package/dist/packlets/import/importers/index.browser.js.map +1 -0
  85. package/dist/packlets/import/importers/index.js.map +1 -0
  86. package/dist/packlets/import/importers/jsonImporter.js +2 -2
  87. package/dist/packlets/import/importers/jsonImporter.js.map +1 -0
  88. package/dist/packlets/import/importers/pathImporter.js +1 -1
  89. package/dist/packlets/import/importers/pathImporter.js.map +1 -0
  90. package/dist/packlets/import/index.browser.js.map +1 -0
  91. package/dist/packlets/import/index.js.map +1 -0
  92. package/dist/packlets/qualifier-types/config/convert.js +124 -0
  93. package/dist/packlets/qualifier-types/config/convert.js.map +1 -0
  94. package/dist/packlets/qualifier-types/config/index.js +25 -0
  95. package/dist/packlets/qualifier-types/config/index.js.map +1 -0
  96. package/dist/packlets/qualifier-types/config/json.js +32 -0
  97. package/dist/packlets/qualifier-types/config/json.js.map +1 -0
  98. package/dist/packlets/qualifier-types/convert.js.map +1 -0
  99. package/dist/packlets/qualifier-types/helpers.js.map +1 -0
  100. package/dist/packlets/qualifier-types/index.js.map +1 -0
  101. package/dist/packlets/qualifier-types/languageQualifierType.js +6 -7
  102. package/dist/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  103. package/dist/packlets/qualifier-types/literalQualifierType.js +7 -10
  104. package/dist/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  105. package/dist/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  106. package/dist/packlets/qualifier-types/qualifierType.js +12 -13
  107. package/dist/packlets/qualifier-types/qualifierType.js.map +1 -0
  108. package/dist/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  109. package/dist/packlets/qualifier-types/territoryQualifierType.js +5 -5
  110. package/dist/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  111. package/dist/packlets/qualifiers/convert/decls.js.map +1 -0
  112. package/dist/packlets/qualifiers/convert/index.js.map +1 -0
  113. package/dist/packlets/qualifiers/convert/qualifier.js.map +1 -0
  114. package/dist/packlets/qualifiers/index.js.map +1 -0
  115. package/dist/packlets/qualifiers/qualifier.js +6 -7
  116. package/dist/packlets/qualifiers/qualifier.js.map +1 -0
  117. package/dist/packlets/qualifiers/qualifierCollector.js +2 -2
  118. package/dist/packlets/qualifiers/qualifierCollector.js.map +1 -0
  119. package/dist/packlets/qualifiers/qualifierDecl.js.map +1 -0
  120. package/dist/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  121. package/dist/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  122. package/dist/packlets/resource-json/compiled/common.js.map +1 -0
  123. package/dist/packlets/resource-json/compiled/convert.js.map +1 -0
  124. package/dist/packlets/resource-json/compiled/index.js.map +1 -0
  125. package/dist/packlets/resource-json/compiled/json.js.map +1 -0
  126. package/dist/packlets/resource-json/convert.js.map +1 -0
  127. package/dist/packlets/resource-json/helpers.js.map +1 -0
  128. package/dist/packlets/resource-json/index.js.map +1 -0
  129. package/dist/packlets/resource-json/json.js.map +1 -0
  130. package/dist/packlets/resource-json/normalized.js.map +1 -0
  131. package/dist/packlets/resource-json/resourceDeclCollection.js +1 -1
  132. package/dist/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  133. package/dist/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  134. package/dist/packlets/resource-json/resourceDeclTree.js +1 -1
  135. package/dist/packlets/resource-json/resourceDeclTree.js.map +1 -0
  136. package/dist/packlets/resource-types/config/convert.js +35 -0
  137. package/dist/packlets/resource-types/config/convert.js.map +1 -0
  138. package/dist/packlets/resource-types/config/index.js +25 -0
  139. package/dist/packlets/resource-types/config/index.js.map +1 -0
  140. package/dist/packlets/resource-types/config/json.js +23 -0
  141. package/dist/packlets/resource-types/config/json.js.map +1 -0
  142. package/dist/packlets/resource-types/helpers.js.map +1 -0
  143. package/dist/packlets/resource-types/index.js.map +1 -0
  144. package/dist/packlets/resource-types/jsonResourceType.js +2 -2
  145. package/dist/packlets/resource-types/jsonResourceType.js.map +1 -0
  146. package/dist/packlets/resource-types/resourceType.js +2 -2
  147. package/dist/packlets/resource-types/resourceType.js.map +1 -0
  148. package/dist/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  149. package/dist/packlets/resources/candidateReducer.js.map +1 -0
  150. package/dist/packlets/resources/candidateValue.js.map +1 -0
  151. package/dist/packlets/resources/candidateValueCollector.js.map +1 -0
  152. package/dist/packlets/resources/common.js.map +1 -0
  153. package/dist/packlets/resources/deltaGenerator.js.map +1 -0
  154. package/dist/packlets/resources/index.js.map +1 -0
  155. package/dist/packlets/resources/resource.js.map +1 -0
  156. package/dist/packlets/resources/resourceBuilder.js +2 -2
  157. package/dist/packlets/resources/resourceBuilder.js.map +1 -0
  158. package/dist/packlets/resources/resourceCandidate.js.map +1 -0
  159. package/dist/packlets/resources/resourceManagerBuilder.js +5 -5
  160. package/dist/packlets/resources/resourceManagerBuilder.js.map +1 -0
  161. package/dist/packlets/runtime/cacheListener.js.map +1 -0
  162. package/dist/packlets/runtime/cacheMetrics.js.map +1 -0
  163. package/dist/packlets/runtime/compiledResourceCollection.js +5 -5
  164. package/dist/packlets/runtime/compiledResourceCollection.js.map +1 -0
  165. package/dist/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  166. package/dist/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  167. package/dist/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  168. package/dist/packlets/runtime/context/index.js.map +1 -0
  169. package/dist/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  170. package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  171. package/dist/packlets/runtime/iResourceManager.js.map +1 -0
  172. package/dist/packlets/runtime/index.js.map +1 -0
  173. package/dist/packlets/runtime/resource-tree/common.js.map +1 -0
  174. package/dist/packlets/runtime/resource-tree/index.js.map +1 -0
  175. package/dist/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  176. package/dist/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  177. package/dist/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  178. package/dist/packlets/runtime/resourceResolver.js.map +1 -0
  179. package/dist/packlets/runtime/resourceTreeResolver.js.map +1 -0
  180. package/dist/packlets/runtime/validate.js.map +1 -0
  181. package/dist/packlets/zip-archive/convert.js.map +1 -0
  182. package/dist/packlets/zip-archive/index.browser.js.map +1 -0
  183. package/dist/packlets/zip-archive/index.js.map +1 -0
  184. package/dist/packlets/zip-archive/json.js.map +1 -0
  185. package/dist/packlets/zip-archive/types.js.map +1 -0
  186. package/dist/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  187. package/dist/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  188. package/dist/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  189. package/dist/ts-res.d.ts +134 -112
  190. package/dist/tsdoc-metadata.json +1 -1
  191. package/lib/index.browser.d.ts.map +1 -0
  192. package/lib/index.browser.js.map +1 -0
  193. package/lib/index.d.ts.map +1 -0
  194. package/lib/index.js.map +1 -0
  195. package/lib/packlets/bundle/bundleBuilder.d.ts.map +1 -0
  196. package/lib/packlets/bundle/bundleBuilder.js.map +1 -0
  197. package/lib/packlets/bundle/bundleLoader.d.ts.map +1 -0
  198. package/lib/packlets/bundle/bundleLoader.js.map +1 -0
  199. package/lib/packlets/bundle/bundleNormalizer.d.ts.map +1 -0
  200. package/lib/packlets/bundle/bundleNormalizer.js.map +1 -0
  201. package/lib/packlets/bundle/bundleUtils.d.ts.map +1 -0
  202. package/lib/packlets/bundle/bundleUtils.js.map +1 -0
  203. package/lib/packlets/bundle/convert.d.ts.map +1 -0
  204. package/lib/packlets/bundle/convert.js.map +1 -0
  205. package/lib/packlets/bundle/index.d.ts.map +1 -0
  206. package/lib/packlets/bundle/index.js.map +1 -0
  207. package/lib/packlets/bundle/model.d.ts.map +1 -0
  208. package/lib/packlets/bundle/model.js.map +1 -0
  209. package/lib/packlets/common/conditions.d.ts.map +1 -0
  210. package/lib/packlets/common/conditions.js.map +1 -0
  211. package/lib/packlets/common/convert.d.ts.map +1 -0
  212. package/lib/packlets/common/convert.js.map +1 -0
  213. package/lib/packlets/common/helpers/conditions.d.ts.map +1 -0
  214. package/lib/packlets/common/helpers/conditions.js.map +1 -0
  215. package/lib/packlets/common/helpers/context.d.ts.map +1 -0
  216. package/lib/packlets/common/helpers/context.js.map +1 -0
  217. package/lib/packlets/common/helpers/index.d.ts.map +1 -0
  218. package/lib/packlets/common/helpers/index.js.map +1 -0
  219. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +1 -0
  220. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  221. package/lib/packlets/common/helpers/resources.d.ts +2 -4
  222. package/lib/packlets/common/helpers/resources.d.ts.map +1 -0
  223. package/lib/packlets/common/helpers/resources.js +2 -4
  224. package/lib/packlets/common/helpers/resources.js.map +1 -0
  225. package/lib/packlets/common/index.d.ts.map +1 -0
  226. package/lib/packlets/common/index.js.map +1 -0
  227. package/lib/packlets/common/resources.d.ts.map +1 -0
  228. package/lib/packlets/common/resources.js.map +1 -0
  229. package/lib/packlets/common/validate/conditions.d.ts +4 -4
  230. package/lib/packlets/common/validate/conditions.d.ts.map +1 -0
  231. package/lib/packlets/common/validate/conditions.js +4 -4
  232. package/lib/packlets/common/validate/conditions.js.map +1 -0
  233. package/lib/packlets/common/validate/index.d.ts.map +1 -0
  234. package/lib/packlets/common/validate/index.js.map +1 -0
  235. package/lib/packlets/common/validate/regularExpressions.d.ts +2 -2
  236. package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -0
  237. package/lib/packlets/common/validate/regularExpressions.js +2 -2
  238. package/lib/packlets/common/validate/regularExpressions.js.map +1 -0
  239. package/lib/packlets/common/validate/resources.d.ts +1 -1
  240. package/lib/packlets/common/validate/resources.d.ts.map +1 -0
  241. package/lib/packlets/common/validate/resources.js +1 -1
  242. package/lib/packlets/common/validate/resources.js.map +1 -0
  243. package/lib/packlets/conditions/condition.d.ts +3 -7
  244. package/lib/packlets/conditions/condition.d.ts.map +1 -0
  245. package/lib/packlets/conditions/condition.js +3 -7
  246. package/lib/packlets/conditions/condition.js.map +1 -0
  247. package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -0
  248. package/lib/packlets/conditions/conditionCollector.js.map +1 -0
  249. package/lib/packlets/conditions/conditionDecls.d.ts.map +1 -0
  250. package/lib/packlets/conditions/conditionDecls.js.map +1 -0
  251. package/lib/packlets/conditions/conditionSet.d.ts.map +1 -0
  252. package/lib/packlets/conditions/conditionSet.js.map +1 -0
  253. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -0
  254. package/lib/packlets/conditions/conditionSetCollector.js.map +1 -0
  255. package/lib/packlets/conditions/conditionSetDecls.d.ts.map +1 -0
  256. package/lib/packlets/conditions/conditionSetDecls.js.map +1 -0
  257. package/lib/packlets/conditions/conditionToken.d.ts.map +1 -0
  258. package/lib/packlets/conditions/conditionToken.js.map +1 -0
  259. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +1 -0
  260. package/lib/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  261. package/lib/packlets/conditions/convert/decls.d.ts.map +1 -0
  262. package/lib/packlets/conditions/convert/decls.js.map +1 -0
  263. package/lib/packlets/conditions/convert/index.d.ts.map +1 -0
  264. package/lib/packlets/conditions/convert/index.js.map +1 -0
  265. package/lib/packlets/conditions/index.d.ts.map +1 -0
  266. package/lib/packlets/conditions/index.js.map +1 -0
  267. package/lib/packlets/config/common.d.ts +35 -0
  268. package/lib/packlets/config/common.d.ts.map +1 -0
  269. package/lib/packlets/config/common.js +97 -0
  270. package/lib/packlets/config/common.js.map +1 -0
  271. package/lib/packlets/config/configInitFactory.d.ts +217 -0
  272. package/lib/packlets/config/configInitFactory.d.ts.map +1 -0
  273. package/lib/packlets/config/configInitFactory.js +303 -0
  274. package/lib/packlets/config/configInitFactory.js.map +1 -0
  275. package/lib/packlets/config/convert.d.ts +23 -0
  276. package/lib/packlets/config/convert.d.ts.map +1 -0
  277. package/lib/packlets/config/convert.js +93 -0
  278. package/lib/packlets/config/convert.js.map +1 -0
  279. package/lib/packlets/config/index.browser.d.ts +7 -0
  280. package/lib/packlets/config/index.browser.d.ts.map +1 -0
  281. package/lib/packlets/config/index.browser.js +74 -0
  282. package/lib/packlets/config/index.browser.js.map +1 -0
  283. package/lib/packlets/config/index.d.ts +7 -0
  284. package/lib/packlets/config/index.d.ts.map +1 -0
  285. package/lib/packlets/config/index.js +68 -0
  286. package/lib/packlets/config/index.js.map +1 -0
  287. package/lib/packlets/config/json.d.ts +20 -0
  288. package/lib/packlets/config/json.d.ts.map +1 -0
  289. package/lib/packlets/config/json.js +24 -0
  290. package/lib/packlets/config/json.js.map +1 -0
  291. package/lib/packlets/config/predefined/default.d.ts +57 -0
  292. package/lib/packlets/config/predefined/default.d.ts.map +1 -0
  293. package/lib/packlets/config/predefined/default.js +141 -0
  294. package/lib/packlets/config/predefined/default.js.map +1 -0
  295. package/lib/packlets/config/predefined/extended.d.ts +25 -0
  296. package/lib/packlets/config/predefined/extended.d.ts.map +1 -0
  297. package/lib/packlets/config/predefined/extended.js +193 -0
  298. package/lib/packlets/config/predefined/extended.js.map +1 -0
  299. package/lib/packlets/config/predefined/index.d.ts +4 -0
  300. package/lib/packlets/config/predefined/index.d.ts.map +1 -0
  301. package/lib/packlets/config/predefined/index.js +62 -0
  302. package/lib/packlets/config/predefined/index.js.map +1 -0
  303. package/lib/packlets/config/systemConfiguration.d.ts +94 -0
  304. package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
  305. package/lib/packlets/config/systemConfiguration.js +152 -0
  306. package/lib/packlets/config/systemConfiguration.js.map +1 -0
  307. package/lib/packlets/context/contextDecls.d.ts.map +1 -0
  308. package/lib/packlets/context/contextDecls.js.map +1 -0
  309. package/lib/packlets/context/contextToken.d.ts.map +1 -0
  310. package/lib/packlets/context/contextToken.js.map +1 -0
  311. package/lib/packlets/context/convert/decls.d.ts.map +1 -0
  312. package/lib/packlets/context/convert/decls.js.map +1 -0
  313. package/lib/packlets/context/convert/index.d.ts.map +1 -0
  314. package/lib/packlets/context/convert/index.js.map +1 -0
  315. package/lib/packlets/context/index.d.ts.map +1 -0
  316. package/lib/packlets/context/index.js.map +1 -0
  317. package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -0
  318. package/lib/packlets/decisions/abstractDecision.js.map +1 -0
  319. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -0
  320. package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  321. package/lib/packlets/decisions/candidate.d.ts.map +1 -0
  322. package/lib/packlets/decisions/candidate.js.map +1 -0
  323. package/lib/packlets/decisions/common.d.ts.map +1 -0
  324. package/lib/packlets/decisions/common.js.map +1 -0
  325. package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -0
  326. package/lib/packlets/decisions/concreteDecision.js.map +1 -0
  327. package/lib/packlets/decisions/decision.d.ts +1 -1
  328. package/lib/packlets/decisions/decision.d.ts.map +1 -0
  329. package/lib/packlets/decisions/decision.js +1 -1
  330. package/lib/packlets/decisions/decision.js.map +1 -0
  331. package/lib/packlets/decisions/index.d.ts.map +1 -0
  332. package/lib/packlets/decisions/index.js.map +1 -0
  333. package/lib/packlets/import/fsItem.d.ts +1 -4
  334. package/lib/packlets/import/fsItem.d.ts.map +1 -0
  335. package/lib/packlets/import/fsItem.js +1 -4
  336. package/lib/packlets/import/fsItem.js.map +1 -0
  337. package/lib/packlets/import/importContext.d.ts +5 -5
  338. package/lib/packlets/import/importContext.d.ts.map +1 -0
  339. package/lib/packlets/import/importContext.js +3 -3
  340. package/lib/packlets/import/importContext.js.map +1 -0
  341. package/lib/packlets/import/importManager.d.ts +15 -1
  342. package/lib/packlets/import/importManager.d.ts.map +1 -0
  343. package/lib/packlets/import/importManager.js +7 -3
  344. package/lib/packlets/import/importManager.js.map +1 -0
  345. package/lib/packlets/import/importable.d.ts.map +1 -0
  346. package/lib/packlets/import/importable.js.map +1 -0
  347. package/lib/packlets/import/importers/collectionImporter.d.ts +2 -2
  348. package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -0
  349. package/lib/packlets/import/importers/collectionImporter.js +2 -2
  350. package/lib/packlets/import/importers/collectionImporter.js.map +1 -0
  351. package/lib/packlets/import/importers/fsItemImporter.d.ts +16 -2
  352. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -0
  353. package/lib/packlets/import/importers/fsItemImporter.js +29 -13
  354. package/lib/packlets/import/importers/fsItemImporter.js.map +1 -0
  355. package/lib/packlets/import/importers/importer.d.ts.map +1 -0
  356. package/lib/packlets/import/importers/importer.js.map +1 -0
  357. package/lib/packlets/import/importers/index.browser.d.ts.map +1 -0
  358. package/lib/packlets/import/importers/index.browser.js.map +1 -0
  359. package/lib/packlets/import/importers/index.d.ts.map +1 -0
  360. package/lib/packlets/import/importers/index.js.map +1 -0
  361. package/lib/packlets/import/importers/jsonImporter.d.ts +2 -2
  362. package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -0
  363. package/lib/packlets/import/importers/jsonImporter.js +2 -2
  364. package/lib/packlets/import/importers/jsonImporter.js.map +1 -0
  365. package/lib/packlets/import/importers/pathImporter.d.ts +1 -1
  366. package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -0
  367. package/lib/packlets/import/importers/pathImporter.js +1 -1
  368. package/lib/packlets/import/importers/pathImporter.js.map +1 -0
  369. package/lib/packlets/import/index.browser.d.ts.map +1 -0
  370. package/lib/packlets/import/index.browser.js.map +1 -0
  371. package/lib/packlets/import/index.d.ts.map +1 -0
  372. package/lib/packlets/import/index.js.map +1 -0
  373. package/lib/packlets/qualifier-types/config/convert.d.ts +65 -0
  374. package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
  375. package/lib/packlets/qualifier-types/config/convert.js +161 -0
  376. package/lib/packlets/qualifier-types/config/convert.js.map +1 -0
  377. package/lib/packlets/qualifier-types/config/index.d.ts +4 -0
  378. package/lib/packlets/qualifier-types/config/index.d.ts.map +1 -0
  379. package/lib/packlets/qualifier-types/config/index.js +64 -0
  380. package/lib/packlets/qualifier-types/config/index.js.map +1 -0
  381. package/lib/packlets/qualifier-types/config/json.d.ts +91 -0
  382. package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
  383. package/lib/packlets/qualifier-types/config/json.js +35 -0
  384. package/lib/packlets/qualifier-types/config/json.js.map +1 -0
  385. package/lib/packlets/qualifier-types/convert.d.ts.map +1 -0
  386. package/lib/packlets/qualifier-types/convert.js.map +1 -0
  387. package/lib/packlets/qualifier-types/helpers.d.ts.map +1 -0
  388. package/lib/packlets/qualifier-types/helpers.js.map +1 -0
  389. package/lib/packlets/qualifier-types/index.d.ts.map +1 -0
  390. package/lib/packlets/qualifier-types/index.js.map +1 -0
  391. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +6 -7
  392. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -0
  393. package/lib/packlets/qualifier-types/languageQualifierType.js +6 -7
  394. package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  395. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +7 -10
  396. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -0
  397. package/lib/packlets/qualifier-types/literalQualifierType.js +7 -10
  398. package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  399. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
  400. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  401. package/lib/packlets/qualifier-types/qualifierType.d.ts +17 -18
  402. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -0
  403. package/lib/packlets/qualifier-types/qualifierType.js +12 -13
  404. package/lib/packlets/qualifier-types/qualifierType.js.map +1 -0
  405. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -0
  406. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  407. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +8 -8
  408. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -0
  409. package/lib/packlets/qualifier-types/territoryQualifierType.js +5 -5
  410. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  411. package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -0
  412. package/lib/packlets/qualifiers/convert/decls.js.map +1 -0
  413. package/lib/packlets/qualifiers/convert/index.d.ts.map +1 -0
  414. package/lib/packlets/qualifiers/convert/index.js.map +1 -0
  415. package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +1 -0
  416. package/lib/packlets/qualifiers/convert/qualifier.js.map +1 -0
  417. package/lib/packlets/qualifiers/index.d.ts.map +1 -0
  418. package/lib/packlets/qualifiers/index.js.map +1 -0
  419. package/lib/packlets/qualifiers/qualifier.d.ts +6 -7
  420. package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -0
  421. package/lib/packlets/qualifiers/qualifier.js +6 -7
  422. package/lib/packlets/qualifiers/qualifier.js.map +1 -0
  423. package/lib/packlets/qualifiers/qualifierCollector.d.ts +3 -3
  424. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -0
  425. package/lib/packlets/qualifiers/qualifierCollector.js +2 -2
  426. package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -0
  427. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -0
  428. package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -0
  429. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +1 -0
  430. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  431. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +1 -0
  432. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  433. package/lib/packlets/resource-json/compiled/common.d.ts.map +1 -0
  434. package/lib/packlets/resource-json/compiled/common.js.map +1 -0
  435. package/lib/packlets/resource-json/compiled/convert.d.ts.map +1 -0
  436. package/lib/packlets/resource-json/compiled/convert.js.map +1 -0
  437. package/lib/packlets/resource-json/compiled/index.d.ts.map +1 -0
  438. package/lib/packlets/resource-json/compiled/index.js.map +1 -0
  439. package/lib/packlets/resource-json/compiled/json.d.ts.map +1 -0
  440. package/lib/packlets/resource-json/compiled/json.js.map +1 -0
  441. package/lib/packlets/resource-json/convert.d.ts.map +1 -0
  442. package/lib/packlets/resource-json/convert.js.map +1 -0
  443. package/lib/packlets/resource-json/helpers.d.ts.map +1 -0
  444. package/lib/packlets/resource-json/helpers.js.map +1 -0
  445. package/lib/packlets/resource-json/index.d.ts.map +1 -0
  446. package/lib/packlets/resource-json/index.js.map +1 -0
  447. package/lib/packlets/resource-json/json.d.ts.map +1 -0
  448. package/lib/packlets/resource-json/json.js.map +1 -0
  449. package/lib/packlets/resource-json/normalized.d.ts.map +1 -0
  450. package/lib/packlets/resource-json/normalized.js.map +1 -0
  451. package/lib/packlets/resource-json/resourceDeclCollection.d.ts +1 -1
  452. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -0
  453. package/lib/packlets/resource-json/resourceDeclCollection.js +1 -1
  454. package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  455. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -0
  456. package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  457. package/lib/packlets/resource-json/resourceDeclTree.d.ts +1 -1
  458. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -0
  459. package/lib/packlets/resource-json/resourceDeclTree.js +1 -1
  460. package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -0
  461. package/lib/packlets/resource-types/config/convert.d.ts +8 -0
  462. package/lib/packlets/resource-types/config/convert.d.ts.map +1 -0
  463. package/lib/packlets/resource-types/config/convert.js +38 -0
  464. package/lib/packlets/resource-types/config/convert.js.map +1 -0
  465. package/lib/packlets/resource-types/config/index.d.ts +4 -0
  466. package/lib/packlets/resource-types/config/index.d.ts.map +1 -0
  467. package/lib/packlets/resource-types/config/index.js +64 -0
  468. package/lib/packlets/resource-types/config/index.js.map +1 -0
  469. package/lib/packlets/resource-types/config/json.d.ts +11 -0
  470. package/lib/packlets/resource-types/config/json.d.ts.map +1 -0
  471. package/lib/packlets/resource-types/config/json.js +24 -0
  472. package/lib/packlets/resource-types/config/json.js.map +1 -0
  473. package/lib/packlets/resource-types/helpers.d.ts.map +1 -0
  474. package/lib/packlets/resource-types/helpers.js.map +1 -0
  475. package/lib/packlets/resource-types/index.d.ts.map +1 -0
  476. package/lib/packlets/resource-types/index.js.map +1 -0
  477. package/lib/packlets/resource-types/jsonResourceType.d.ts +17 -5
  478. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -0
  479. package/lib/packlets/resource-types/jsonResourceType.js +2 -2
  480. package/lib/packlets/resource-types/jsonResourceType.js.map +1 -0
  481. package/lib/packlets/resource-types/resourceType.d.ts +5 -5
  482. package/lib/packlets/resource-types/resourceType.d.ts.map +1 -0
  483. package/lib/packlets/resource-types/resourceType.js +2 -2
  484. package/lib/packlets/resource-types/resourceType.js.map +1 -0
  485. package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +1 -0
  486. package/lib/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  487. package/lib/packlets/resources/candidateReducer.d.ts.map +1 -0
  488. package/lib/packlets/resources/candidateReducer.js.map +1 -0
  489. package/lib/packlets/resources/candidateValue.d.ts.map +1 -0
  490. package/lib/packlets/resources/candidateValue.js.map +1 -0
  491. package/lib/packlets/resources/candidateValueCollector.d.ts.map +1 -0
  492. package/lib/packlets/resources/candidateValueCollector.js.map +1 -0
  493. package/lib/packlets/resources/common.d.ts.map +1 -0
  494. package/lib/packlets/resources/common.js.map +1 -0
  495. package/lib/packlets/resources/deltaGenerator.d.ts.map +1 -0
  496. package/lib/packlets/resources/deltaGenerator.js.map +1 -0
  497. package/lib/packlets/resources/index.d.ts.map +1 -0
  498. package/lib/packlets/resources/index.js.map +1 -0
  499. package/lib/packlets/resources/resource.d.ts.map +1 -0
  500. package/lib/packlets/resources/resource.js.map +1 -0
  501. package/lib/packlets/resources/resourceBuilder.d.ts +2 -2
  502. package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -0
  503. package/lib/packlets/resources/resourceBuilder.js +2 -2
  504. package/lib/packlets/resources/resourceBuilder.js.map +1 -0
  505. package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -0
  506. package/lib/packlets/resources/resourceCandidate.js.map +1 -0
  507. package/lib/packlets/resources/resourceManagerBuilder.d.ts +5 -5
  508. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
  509. package/lib/packlets/resources/resourceManagerBuilder.js +5 -5
  510. package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -0
  511. package/lib/packlets/runtime/cacheListener.d.ts.map +1 -0
  512. package/lib/packlets/runtime/cacheListener.js.map +1 -0
  513. package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -0
  514. package/lib/packlets/runtime/cacheMetrics.js.map +1 -0
  515. package/lib/packlets/runtime/compiledResourceCollection.d.ts +5 -5
  516. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
  517. package/lib/packlets/runtime/compiledResourceCollection.js +5 -5
  518. package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -0
  519. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +1 -0
  520. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  521. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +1 -0
  522. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  523. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +1 -0
  524. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  525. package/lib/packlets/runtime/context/index.d.ts.map +1 -0
  526. package/lib/packlets/runtime/context/index.js.map +1 -0
  527. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -0
  528. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  529. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -0
  530. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  531. package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -0
  532. package/lib/packlets/runtime/iResourceManager.js.map +1 -0
  533. package/lib/packlets/runtime/index.d.ts.map +1 -0
  534. package/lib/packlets/runtime/index.js.map +1 -0
  535. package/lib/packlets/runtime/resource-tree/common.d.ts.map +1 -0
  536. package/lib/packlets/runtime/resource-tree/common.js.map +1 -0
  537. package/lib/packlets/runtime/resource-tree/index.d.ts.map +1 -0
  538. package/lib/packlets/runtime/resource-tree/index.js.map +1 -0
  539. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +1 -0
  540. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  541. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +1 -0
  542. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  543. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +1 -0
  544. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  545. package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -0
  546. package/lib/packlets/runtime/resourceResolver.js.map +1 -0
  547. package/lib/packlets/runtime/resourceTreeResolver.d.ts.map +1 -0
  548. package/lib/packlets/runtime/resourceTreeResolver.js.map +1 -0
  549. package/lib/packlets/runtime/validate.d.ts.map +1 -0
  550. package/lib/packlets/runtime/validate.js.map +1 -0
  551. package/lib/packlets/zip-archive/convert.d.ts.map +1 -0
  552. package/lib/packlets/zip-archive/convert.js.map +1 -0
  553. package/lib/packlets/zip-archive/index.browser.d.ts.map +1 -0
  554. package/lib/packlets/zip-archive/index.browser.js.map +1 -0
  555. package/lib/packlets/zip-archive/index.d.ts.map +1 -0
  556. package/lib/packlets/zip-archive/index.js.map +1 -0
  557. package/lib/packlets/zip-archive/json.d.ts.map +1 -0
  558. package/lib/packlets/zip-archive/json.js.map +1 -0
  559. package/lib/packlets/zip-archive/types.d.ts.map +1 -0
  560. package/lib/packlets/zip-archive/types.js.map +1 -0
  561. package/lib/packlets/zip-archive/zipArchiveCreator.d.ts.map +1 -0
  562. package/lib/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  563. package/lib/packlets/zip-archive/zipArchiveFormat.d.ts.map +1 -0
  564. package/lib/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  565. package/lib/packlets/zip-archive/zipArchiveLoader.d.ts.map +1 -0
  566. package/lib/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  567. package/package.json +28 -26
  568. package/dist/test/data/sample.json +0 -32
  569. package/dist/test/unit/qualifier-types/testQualifierType.js +0 -76
  570. package/dist/test/unit/resource-types/testDerivedResourceType.js +0 -109
  571. package/dist/test/unit/resources/deltaGenerator.helpers.js +0 -282
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2025 Erik Fortune
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be included in all
13
+ * copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ * SOFTWARE.
22
+ */
23
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
24
+ if (k2 === undefined) k2 = k;
25
+ var desc = Object.getOwnPropertyDescriptor(m, k);
26
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
27
+ desc = { enumerable: true, get: function() { return m[k]; } };
28
+ }
29
+ Object.defineProperty(o, k2, desc);
30
+ }) : (function(o, m, k, k2) {
31
+ if (k2 === undefined) k2 = k;
32
+ o[k2] = m[k];
33
+ }));
34
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
35
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
36
+ }) : function(o, v) {
37
+ o["default"] = v;
38
+ });
39
+ var __importStar = (this && this.__importStar) || (function () {
40
+ var ownKeys = function(o) {
41
+ ownKeys = Object.getOwnPropertyNames || function (o) {
42
+ var ar = [];
43
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
44
+ return ar;
45
+ };
46
+ return ownKeys(o);
47
+ };
48
+ return function (mod) {
49
+ if (mod && mod.__esModule) return mod;
50
+ var result = {};
51
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
52
+ __setModuleDefault(result, mod);
53
+ return result;
54
+ };
55
+ })();
56
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
57
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
58
+ };
59
+ Object.defineProperty(exports, "__esModule", { value: true });
60
+ exports.Convert = void 0;
61
+ const Convert = __importStar(require("./convert"));
62
+ exports.Convert = Convert;
63
+ __exportStar(require("./json"), exports);
64
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AAI5B,0BAAO;AAFhB,yCAAuB","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Convert from './convert';\n\nexport * from './json';\n\nexport { Convert };\n"]}
@@ -0,0 +1,91 @@
1
+ import { JsonObject } from '@fgv/ts-json-base';
2
+ /**
3
+ * Templated configuration for {@link QualifierTypes.QualifierType | qualifier type} configuration.
4
+ * @public
5
+ */
6
+ export interface IQualifierTypeConfig<T = JsonObject> {
7
+ name: string;
8
+ systemType: string;
9
+ configuration?: T;
10
+ }
11
+ /**
12
+ * Configuration for {@link QualifierTypes.LanguageQualifierType | language qualifier type} configuration.
13
+ * @public
14
+ */
15
+ export interface ILanguageQualifierTypeConfig {
16
+ allowContextList?: boolean;
17
+ }
18
+ /**
19
+ * Declares a hierarchy of literal values. The keys are the names of the values, and the
20
+ * values are the names of their parents.
21
+ * @remarks
22
+ * The hierarchy is defined as a tree, where each value can have multiple children but
23
+ * only one parent. The root of the tree has no parent. The hierarchy is used to
24
+ * determine the relationship between values when matching conditions and contexts.
25
+ * @public
26
+ */
27
+ export type LiteralValueHierarchyDecl<T extends string> = Record<T, T>;
28
+ /**
29
+ * Configuration for {@link QualifierTypes.TerritoryQualifierType | territory qualifier type} configuration.
30
+ * @public
31
+ */
32
+ export interface ITerritoryQualifierTypeConfig {
33
+ allowContextList?: boolean;
34
+ acceptLowercase?: boolean;
35
+ allowedTerritories?: string[];
36
+ /**
37
+ * Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}
38
+ * of territory values to use for matching. If not provided, no hierarchy will be used.
39
+ */
40
+ hierarchy?: LiteralValueHierarchyDecl<string>;
41
+ }
42
+ /**
43
+ * Configuration for {@link QualifierTypes.LiteralQualifierType | literal qualifier type} configuration.
44
+ * @public
45
+ */
46
+ export interface ILiteralQualifierTypeConfig {
47
+ allowContextList?: boolean;
48
+ caseSensitive?: boolean;
49
+ enumeratedValues?: string[];
50
+ hierarchy?: LiteralValueHierarchyDecl<string>;
51
+ }
52
+ /**
53
+ * Discriminated configuration for {@link QualifierTypes.LanguageQualifierType | language qualifier type} configuration.
54
+ * @public
55
+ */
56
+ export interface ISystemLanguageQualifierTypeConfig extends IQualifierTypeConfig<ILanguageQualifierTypeConfig> {
57
+ systemType: 'language';
58
+ }
59
+ /**
60
+ * Discriminated configuration for {@link QualifierTypes.TerritoryQualifierType | territory qualifier type} configuration.
61
+ * @public
62
+ */
63
+ export interface ISystemTerritoryQualifierTypeConfig extends IQualifierTypeConfig<ITerritoryQualifierTypeConfig> {
64
+ systemType: 'territory';
65
+ }
66
+ /**
67
+ * Discriminated configuration for {@link QualifierTypes.LiteralQualifierType | literal qualifier type} configuration.
68
+ * @public
69
+ */
70
+ export interface ISystemLiteralQualifierTypeConfig extends IQualifierTypeConfig<ILiteralQualifierTypeConfig> {
71
+ systemType: 'literal';
72
+ }
73
+ /**
74
+ * Discriminated configuration for {@link QualifierTypes.QualifierType | qualifier type} configuration.
75
+ * @public
76
+ */
77
+ export type ISystemQualifierTypeConfig = ISystemLanguageQualifierTypeConfig | ISystemTerritoryQualifierTypeConfig | ISystemLiteralQualifierTypeConfig;
78
+ /**
79
+ * A union of all qualifier type configurations.
80
+ * @public
81
+ */
82
+ export type IAnyQualifierTypeConfig = IQualifierTypeConfig | ISystemQualifierTypeConfig;
83
+ /**
84
+ * Checks if a {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} is a
85
+ * {@link QualifierTypes.Config.ISystemQualifierTypeConfig | system qualifier type configuration}.
86
+ * @param config - The {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} to check.
87
+ * @returns `true` if the configuration is a system qualifier type configuration, `false` otherwise.
88
+ * @public
89
+ */
90
+ export declare function isSystemQualifierTypeConfig(config: IAnyQualifierTypeConfig): config is ISystemQualifierTypeConfig;
91
+ //# sourceMappingURL=json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.d.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2B,CAAC;IAC1G,UAAU,EAAE,SAAS,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAClC,kCAAkC,GAClC,mCAAmC,GACnC,iCAAiC,CAAC;AAEtC;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,GAAG,0BAA0B,CAAC;AAExF;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,uBAAuB,GAC9B,MAAM,IAAI,0BAA0B,CAItC"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2025 Erik Fortune
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be included in all
13
+ * copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ * SOFTWARE.
22
+ */
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.isSystemQualifierTypeConfig = isSystemQualifierTypeConfig;
25
+ /**
26
+ * Checks if a {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} is a
27
+ * {@link QualifierTypes.Config.ISystemQualifierTypeConfig | system qualifier type configuration}.
28
+ * @param config - The {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} to check.
29
+ * @returns `true` if the configuration is a system qualifier type configuration, `false` otherwise.
30
+ * @public
31
+ */
32
+ function isSystemQualifierTypeConfig(config) {
33
+ return (config.systemType === 'language' || config.systemType === 'territory' || config.systemType === 'literal');
34
+ }
35
+ //# sourceMappingURL=json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.js","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/json.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AA6GH,kEAMC;AAbD;;;;;;GAMG;AACH,SAAgB,2BAA2B,CACzC,MAA+B;IAE/B,OAAO,CACL,MAAM,CAAC,UAAU,KAAK,UAAU,IAAI,MAAM,CAAC,UAAU,KAAK,WAAW,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS,CACzG,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { JsonObject } from '@fgv/ts-json-base';\n\n/**\n * Templated configuration for {@link QualifierTypes.QualifierType | qualifier type} configuration.\n * @public\n */\nexport interface IQualifierTypeConfig<T = JsonObject> {\n name: string;\n systemType: string;\n configuration?: T;\n}\n\n/**\n * Configuration for {@link QualifierTypes.LanguageQualifierType | language qualifier type} configuration.\n * @public\n */\nexport interface ILanguageQualifierTypeConfig {\n allowContextList?: boolean;\n}\n\n/**\n * Declares a hierarchy of literal values. The keys are the names of the values, and the\n * values are the names of their parents.\n * @remarks\n * The hierarchy is defined as a tree, where each value can have multiple children but\n * only one parent. The root of the tree has no parent. The hierarchy is used to\n * determine the relationship between values when matching conditions and contexts.\n * @public\n */\nexport type LiteralValueHierarchyDecl<T extends string> = Record<T, T>;\n\n/**\n * Configuration for {@link QualifierTypes.TerritoryQualifierType | territory qualifier type} configuration.\n * @public\n */\nexport interface ITerritoryQualifierTypeConfig {\n allowContextList?: boolean;\n\n acceptLowercase?: boolean;\n allowedTerritories?: string[];\n\n /**\n * Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}\n * of territory values to use for matching. If not provided, no hierarchy will be used.\n */\n hierarchy?: LiteralValueHierarchyDecl<string>;\n}\n\n/**\n * Configuration for {@link QualifierTypes.LiteralQualifierType | literal qualifier type} configuration.\n * @public\n */\nexport interface ILiteralQualifierTypeConfig {\n allowContextList?: boolean;\n caseSensitive?: boolean;\n enumeratedValues?: string[];\n hierarchy?: LiteralValueHierarchyDecl<string>;\n}\n\n/**\n * Discriminated configuration for {@link QualifierTypes.LanguageQualifierType | language qualifier type} configuration.\n * @public\n */\nexport interface ISystemLanguageQualifierTypeConfig\n extends IQualifierTypeConfig<ILanguageQualifierTypeConfig> {\n systemType: 'language';\n}\n\n/**\n * Discriminated configuration for {@link QualifierTypes.TerritoryQualifierType | territory qualifier type} configuration.\n * @public\n */\nexport interface ISystemTerritoryQualifierTypeConfig\n extends IQualifierTypeConfig<ITerritoryQualifierTypeConfig> {\n systemType: 'territory';\n}\n\n/**\n * Discriminated configuration for {@link QualifierTypes.LiteralQualifierType | literal qualifier type} configuration.\n * @public\n */\nexport interface ISystemLiteralQualifierTypeConfig extends IQualifierTypeConfig<ILiteralQualifierTypeConfig> {\n systemType: 'literal';\n}\n\n/**\n * Discriminated configuration for {@link QualifierTypes.QualifierType | qualifier type} configuration.\n * @public\n */\nexport type ISystemQualifierTypeConfig =\n | ISystemLanguageQualifierTypeConfig\n | ISystemTerritoryQualifierTypeConfig\n | ISystemLiteralQualifierTypeConfig;\n\n/**\n * A union of all qualifier type configurations.\n * @public\n */\nexport type IAnyQualifierTypeConfig = IQualifierTypeConfig | ISystemQualifierTypeConfig;\n\n/**\n * Checks if a {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} is a\n * {@link QualifierTypes.Config.ISystemQualifierTypeConfig | system qualifier type configuration}.\n * @param config - The {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} to check.\n * @returns `true` if the configuration is a system qualifier type configuration, `false` otherwise.\n * @public\n */\nexport function isSystemQualifierTypeConfig(\n config: IAnyQualifierTypeConfig\n): config is ISystemQualifierTypeConfig {\n return (\n config.systemType === 'language' || config.systemType === 'territory' || config.systemType === 'literal'\n );\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/convert.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAA4B,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,kCAAkC,EAAE,MAAM,yBAAyB,CAAC;AAE7E;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C,cAAc,E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C,CAAC;AACL,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Converter, Converters, Result, fail } from '@fgv/ts-utils';\nimport { QualifierType } from './qualifierType';\nimport { ReadOnlyQualifierTypeCollector } from './qualifierTypeCollector';\nimport { ILiteralValueHierarchyCreateParams } from './literalValueHierarchy';\n\n/**\n * Context necessary to convert a qualifier name or number to an instantiated\n * {@link QualifierTypes.QualifierType}.\n * @public\n */\nexport interface IQualifierTypeConvertContext {\n qualifierTypes: ReadOnlyQualifierTypeCollector;\n}\n\n/**\n * Converter for {@link QualifierTypes.QualifierType | QualifierType} objects,\n * retrieves a {@link QualifierTypes.QualifierType | QualifierType} by name or\n * index from a supplied {@link QualifierTypes.Convert.IQualifierTypeConvertContext | conversion context}.\n * @public\n */\n// eslint-disable-next-line @rushstack/typedef-var\nexport const qualifierType = Converters.generic<QualifierType, IQualifierTypeConvertContext>(\n (\n from: unknown,\n __self: Converter<QualifierType, IQualifierTypeConvertContext>,\n context?: IQualifierTypeConvertContext\n ): Result<QualifierType> => {\n if (!context) {\n return fail('qualifierType converter requires a context');\n }\n if (typeof from === 'string') {\n return context.qualifierTypes.validating.get(from);\n } else if (typeof from === 'number') {\n return context.qualifierTypes.getAt(from);\n }\n return fail('qualifierType converter requires a string or number');\n }\n);\n\n/**\n * Gets a converter for {@link QualifierTypes.ILiteralValueHierarchyCreateParams | ILiteralValueHierarchyCreateParams}\n * objects with values validated by a supplied value converter.\n * @param valueConverter - Converter for the literal value type.\n * @public\n */\nexport function literalValueHierarchyCreateParams<T extends string>(\n valueConverter: Converter<T>\n): Converter<ILiteralValueHierarchyCreateParams<T>> {\n return Converters.object<ILiteralValueHierarchyCreateParams<T>>({\n values: Converters.arrayOf(valueConverter),\n hierarchy: Converters.recordOf(valueConverter, {\n keyConverter: valueConverter\n })\n });\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/helpers.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAQ,MAAM,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,qBAAqB,GAAG,sBAAsB,GAAG,oBAAoB,CAAC;AAExG;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,MAAM,CAAC,uBAAuB,GACzC,MAAM,CAAC,aAAa,CAAC,CAyBvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,mCAAmC,CACjD,UAAU,EAAE,MA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,UAAU,EAAE,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,mCAAmC,CACjD,UAA6C;IAE7C,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC;IAClC,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,UAAU;YACb,OAAO,6CAAqB,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAC5D,KAAK,WAAW;YACd,OAAO,+CAAsB,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAC7D,KAAK,SAAS;YACZ,OAAO,2CAAoB,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC7D,CAAC;IACD,0CAA0C;IAC1C,mBAAmB;IACnB,OAAO,IAAA,eAAI,EAAC,GAAG,UAAU,kCAAkC,CAAC,CAAC;AAC/D,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { fail, Result } from '@fgv/ts-utils';\nimport * as Config from './config';\nimport { QualifierType } from './qualifierType';\nimport { LanguageQualifierType } from './languageQualifierType';\nimport { TerritoryQualifierType } from './territoryQualifierType';\nimport { LiteralQualifierType } from './literalQualifierType';\n\n/**\n * A discriminated union of all system qualifier types.\n * This allows TypeScript to properly discriminate between specific qualifier type implementations\n * and access their specific methods like getConfiguration().\n * @public\n */\nexport type SystemQualifierType = LanguageQualifierType | TerritoryQualifierType | LiteralQualifierType;\n\n/**\n * Creates a {@link QualifierTypes.QualifierType | QualifierType} from a configuration object.\n * This factory function determines the appropriate qualifier type based on the systemType\n * and delegates to the appropriate type-specific createFromConfig method.\n * @param typeConfig - The {@link QualifierTypes.Config.IQualifierTypeConfig | configuration object}\n * containing the name, systemType, and optional type-specific configuration.\n * @returns `Success` with the new {@link QualifierTypes.QualifierType | QualifierType}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\nexport function createQualifierTypeFromConfig(\n typeConfig: Config.IAnyQualifierTypeConfig\n): Result<QualifierType> {\n /* c8 ignore next 1 - defense in depth */\n const childConfig = typeConfig.configuration ?? {};\n switch (typeConfig.systemType) {\n case 'language':\n return Config.Convert.languageQualifierTypeConfig\n .convert(childConfig)\n .onSuccess((configuration) =>\n LanguageQualifierType.createFromConfig({ ...typeConfig, configuration })\n );\n case 'territory':\n return Config.Convert.territoryQualifierTypeConfig\n .convert(childConfig)\n .onSuccess((configuration) =>\n TerritoryQualifierType.createFromConfig({ ...typeConfig, configuration })\n );\n case 'literal':\n return Config.Convert.literalQualifierTypeConfig\n .convert(childConfig)\n .onSuccess((configuration) =>\n LiteralQualifierType.createFromConfig({ ...typeConfig, configuration })\n );\n }\n /* c8 ignore next 1 - defense in depth */\n return fail(`Unknown qualifier type: ${typeConfig.systemType}`);\n}\n\n/**\n * Creates a {@link QualifierTypes.SystemQualifierType | SystemQualifierType} from a system configuration object.\n * This factory function determines the appropriate qualifier type based on the systemType\n * and delegates to the appropriate type-specific createFromConfig method.\n * @param typeConfig - The {@link QualifierTypes.Config.ISystemQualifierTypeConfig | configuration object}\n * containing the name, systemType, and optional type-specific configuration.\n * @returns `Success` with the new {@link QualifierTypes.SystemQualifierType | SystemQualifierType}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\nexport function createQualifierTypeFromSystemConfig(\n typeConfig: Config.ISystemQualifierTypeConfig\n): Result<SystemQualifierType> {\n const { systemType } = typeConfig;\n switch (systemType) {\n case 'language':\n return LanguageQualifierType.createFromConfig(typeConfig);\n case 'territory':\n return TerritoryQualifierType.createFromConfig(typeConfig);\n case 'literal':\n return LiteralQualifierType.createFromConfig(typeConfig);\n }\n /* c8 ignore next 3 - should not happen */\n // @ts-expect-error\n return fail(`${systemType}: Unknown system qualifier type.`);\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,WAAW,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iDAAmC;AAW1B,wBAAM;AAVf,mDAAqC;AAUpB,0BAAO;AARxB,kDAAgC;AAChC,0DAAwC;AACxC,yDAAuC;AACvC,0DAAwC;AACxC,2DAAyC;AACzC,2DAAyC;AACzC,4CAA0B","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Config from './config';\nimport * as Convert from './convert';\n\nexport * from './qualifierType';\nexport * from './languageQualifierType';\nexport * from './literalQualifierType';\nexport * from './literalValueHierarchy';\nexport * from './territoryQualifierType';\nexport * from './qualifierTypeCollector';\nexport * from './helpers';\n\nexport { Config, Convert };\n"]}
@@ -27,14 +27,13 @@ export interface ILanguageQualifierTypeCreateParams extends Partial<IQualifierTy
27
27
  */
28
28
  export declare class LanguageQualifierType extends QualifierType<JsonCompatibleType<Config.ILanguageQualifierTypeConfig>> {
29
29
  /**
30
- * {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
30
+ * {@inheritDoc QualifierTypes.IQualifierType.systemTypeName}
31
31
  */
32
32
  readonly systemTypeName: QualifierTypeName;
33
33
  /**
34
34
  * Creates a new instance of a {@link QualifierTypes.LanguageQualifierType | language qualifier type}.
35
- * @param name - Optional name for the qualifier type. Defaults to 'language'.
36
- * @param allowContextList - Optional flag indicating whether the context can be a
37
- * list of values. Defaults to `true`.
35
+ * @param params - The {@link QualifierTypes.ILanguageQualifierTypeCreateParams | create parameters}
36
+ * for this qualifier type.
38
37
  * @public
39
38
  */
40
39
  protected constructor({ name, allowContextList, index }: ILanguageQualifierTypeCreateParams);
@@ -56,7 +55,7 @@ export declare class LanguageQualifierType extends QualifierType<JsonCompatibleT
56
55
  */
57
56
  static createFromConfig(config: Config.IQualifierTypeConfig<Config.ILanguageQualifierTypeConfig>): Result<LanguageQualifierType>;
58
57
  /**
59
- * {@inheritdoc QualifierTypes.IQualifierType.isValidConditionValue}
58
+ * {@inheritDoc QualifierTypes.IQualifierType.isValidConditionValue}
60
59
  */
61
60
  isValidConditionValue(value: string): value is QualifierConditionValue;
62
61
  /**
@@ -66,11 +65,11 @@ export declare class LanguageQualifierType extends QualifierType<JsonCompatibleT
66
65
  */
67
66
  getConfiguration(): Result<Config.ISystemLanguageQualifierTypeConfig>;
68
67
  /**
69
- * {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
68
+ * {@inheritDoc QualifierTypes.IQualifierType.getConfigurationJson}
70
69
  */
71
70
  getConfigurationJson(): Result<JsonCompatibleType<Config.ISystemLanguageQualifierTypeConfig>>;
72
71
  /**
73
- * {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
72
+ * {@inheritDoc QualifierTypes.IQualifierType.validateConfigurationJson}
74
73
  */
75
74
  validateConfigurationJson(from: unknown): Result<JsonCompatibleType<Config.ISystemLanguageQualifierTypeConfig>>;
76
75
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"languageQualifierType.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/languageQualifierType.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAA0B,MAAM,eAAe,CAAC;AAE/D,OAAO,EACL,iBAAiB,EAGjB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EAElB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE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AG,MAAM,CAAC,MAAM,CAAC,kCAAkC,CAAC;IAI9F;;;;;;;OAOG;IACH,SAAS,CAAC,SAAS,CACjB,SAAS,EAAE,uBAAuB,EAClC,OAAO,EAAE,qBAAqB,EAC9B,QAAQ,EAAE,iBAAiB,GAC1B,mBAAmB;CASvB"}
@@ -70,9 +70,8 @@ const ts_json_base_1 = require("@fgv/ts-json-base");
70
70
  class LanguageQualifierType extends qualifierType_1.QualifierType {
71
71
  /**
72
72
  * Creates a new instance of a {@link QualifierTypes.LanguageQualifierType | language qualifier type}.
73
- * @param name - Optional name for the qualifier type. Defaults to 'language'.
74
- * @param allowContextList - Optional flag indicating whether the context can be a
75
- * list of values. Defaults to `true`.
73
+ * @param params - The {@link QualifierTypes.ILanguageQualifierTypeCreateParams | create parameters}
74
+ * for this qualifier type.
76
75
  * @public
77
76
  */
78
77
  constructor({ name, allowContextList, index }) {
@@ -83,7 +82,7 @@ class LanguageQualifierType extends qualifierType_1.QualifierType {
83
82
  super(Object.assign({ name,
84
83
  allowContextList }, validated));
85
84
  /**
86
- * {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
85
+ * {@inheritDoc QualifierTypes.IQualifierType.systemTypeName}
87
86
  */
88
87
  this.systemTypeName = common_1.Convert.qualifierTypeName.convert('language').orThrow();
89
88
  }
@@ -115,7 +114,7 @@ class LanguageQualifierType extends qualifierType_1.QualifierType {
115
114
  }).onSuccess(LanguageQualifierType.create);
116
115
  }
117
116
  /**
118
- * {@inheritdoc QualifierTypes.IQualifierType.isValidConditionValue}
117
+ * {@inheritDoc QualifierTypes.IQualifierType.isValidConditionValue}
119
118
  */
120
119
  isValidConditionValue(value) {
121
120
  return ts_bcp47_1.Bcp47.tag(value)
@@ -131,7 +130,7 @@ class LanguageQualifierType extends qualifierType_1.QualifierType {
131
130
  return this.getConfigurationJson().onSuccess((json) => Config.Convert.systemLanguageQualifierTypeConfig.convert(json));
132
131
  }
133
132
  /**
134
- * {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
133
+ * {@inheritDoc QualifierTypes.IQualifierType.getConfigurationJson}
135
134
  */
136
135
  getConfigurationJson() {
137
136
  return (0, ts_utils_1.succeed)({
@@ -143,7 +142,7 @@ class LanguageQualifierType extends qualifierType_1.QualifierType {
143
142
  });
144
143
  }
145
144
  /**
146
- * {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
145
+ * {@inheritDoc QualifierTypes.IQualifierType.validateConfigurationJson}
147
146
  */
148
147
  validateConfigurationJson(from) {
149
148
  return Config.Convert.systemLanguageQualifierTypeConfig.convert(from);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"languageQualifierType.js","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/languageQualifierType.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAA+D;AAC/D,4CAAsC;AACtC,sCASmB;AACnB,mDAA4E;AAC5E,iDAAmC;AACnC,oDAA2E;AAoB3E;;;;;GAKG;AACH,MAAa,qBAAsB,SAAQ,6BAE1C;IAMC;;;;;OAKG;IACH,YAAsB,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAsC;QACzF,gBAAgB,GAAG,gBAAgB,KAAK,KAAK,CAAC;QAC9C,iGAAiG;QACjG,IAAI,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,UAAU,CAAC;QAC1B,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,gBAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAE9F,KAAK,iBACH,IAAI;YACJ,gBAAgB,IACb,SAAS,EACZ,CAAC;QArBL;;WAEG;QACa,mBAAc,GAAsB,gBAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,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,OAAO,MAAM,CAAC,OAAO,CAAC,iCAAiC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACxE,CAAC;IAED;;;;;OAKG;IACI,qBAAqB,CAAC,IAAa;QACxC,OAAO,MAAM,CAAC,OAAO,CAAC,iCAAiC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACxE,CAAC;IAED;;;;;;;OAOG;IACO,SAAS,CACjB,SAAkC,EAClC,OAA8B,EAC9B,QAA2B;QAE3B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,UAAU,GAAG,gBAAK,CAAC,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,gBAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;YAC5F,IAAI,UAAU,GAAG,GAAG,IAAI,iBAAQ,CAAC,0BAA0B,CAAC,UAAU,CAAC,EAAE,CAAC;gBACxE,OAAO,UAAU,CAAC;YACpB,CAAC;QACH,CAAC;QACD,OAAO,gBAAO,CAAC;IACjB,CAAC;CACF;AAlID,sDAkIC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result, captureResult, succeed } from '@fgv/ts-utils';\nimport { Bcp47 } from '@fgv/ts-bcp47';\nimport {\n ConditionOperator,\n Convert,\n NoMatch,\n QualifierConditionValue,\n QualifierContextValue,\n QualifierMatchScore,\n QualifierTypeName,\n Validate\n} from '../common';\nimport { IQualifierTypeCreateParams, QualifierType } from './qualifierType';\nimport * as Config from './config';\nimport { JsonCompatibleType, sanitizeJsonObject } from '@fgv/ts-json-base';\n\n/**\n * Interface defining the parameters that can be used to create a new\n * {@link QualifierTypes.LanguageQualifierType | LanguageQualifierType}.\n * @public\n */\nexport interface ILanguageQualifierTypeCreateParams extends Partial<IQualifierTypeCreateParams> {\n /**\n * Optional name for the qualifier type. Defaults to 'language'.\n */\n name?: string;\n\n /**\n * Optional flag indicating whether the context can be a list of values.\n * Defaults to `true`.\n */\n allowContextList?: boolean;\n}\n\n/**\n * {@link QualifierTypes.QualifierType | Qualifier type} which matches BCP-47 language tags\n * applying {@link https://github.com/ErikFortune/fgv/tree/main/libraries/ts-bcp47#tag-matching | similarity matching}.\n * Accepts a list of language tags in the context by default.\n * @public\n */\nexport class LanguageQualifierType extends QualifierType<\n JsonCompatibleType<Config.ILanguageQualifierTypeConfig>\n> {\n /**\n * {@inheritDoc QualifierTypes.IQualifierType.systemTypeName}\n */\n public readonly systemTypeName: QualifierTypeName = Convert.qualifierTypeName.convert('language').orThrow();\n\n /**\n * Creates a new instance of a {@link QualifierTypes.LanguageQualifierType | language qualifier type}.\n * @param params - The {@link QualifierTypes.ILanguageQualifierTypeCreateParams | create parameters}\n * for this qualifier type.\n * @public\n */\n protected constructor({ name, allowContextList, index }: ILanguageQualifierTypeCreateParams) {\n allowContextList = allowContextList !== false;\n /* c8 ignore next 2 - coverage intermittently drops these two lines even though they're tested */\n name = name ?? 'language';\n const validated = index ? { index: Convert.qualifierTypeIndex.convert(index).orThrow() } : {};\n\n super({\n name,\n allowContextList,\n ...validated\n });\n }\n\n /**\n * Creates a new instance of a {@link QualifierTypes.LanguageQualifierType | language qualifier type}.\n * @param params - Optional {@link QualifierTypes.ILanguageQualifierTypeCreateParams | parameters}\n * to use when creating the new instance.\n * @returns `Success` with the new {@link QualifierTypes.LanguageQualifierType | language qualifier type}\n * if successful, `Failure` otherwise.\n */\n public static create(params?: ILanguageQualifierTypeCreateParams): Result<LanguageQualifierType> {\n /* c8 ignore next 1 - coverage seems to intermittently miss the branch even though it's tested */\n params = params ?? {};\n return captureResult(() => new LanguageQualifierType(params));\n }\n\n /**\n * Creates a new {@link QualifierTypes.LanguageQualifierType | LanguageQualifierType} from a configuration object.\n * @param config - The {@link QualifierTypes.Config.IQualifierTypeConfig | configuration object} containing\n * the name, systemType, and optional language-specific configuration.\n * @returns `Success` with the new {@link QualifierTypes.LanguageQualifierType | LanguageQualifierType}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\n public static createFromConfig(\n config: Config.IQualifierTypeConfig<Config.ILanguageQualifierTypeConfig>\n ): Result<LanguageQualifierType> {\n return sanitizeJsonObject<ILanguageQualifierTypeCreateParams>({\n name: config.name,\n allowContextList: config.configuration?.allowContextList === true\n }).onSuccess(LanguageQualifierType.create);\n }\n\n /**\n * {@inheritDoc QualifierTypes.IQualifierType.isValidConditionValue}\n */\n public isValidConditionValue(value: string): value is QualifierConditionValue {\n return Bcp47.tag(value)\n .onSuccess((tag) => succeed(tag.isValid))\n .orDefault(false);\n }\n\n /**\n * Gets a {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | strongly typed configuration object}\n * for this qualifier type.\n * @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.\n */\n public getConfiguration(): Result<Config.ISystemLanguageQualifierTypeConfig> {\n return this.getConfigurationJson().onSuccess((json) =>\n Config.Convert.systemLanguageQualifierTypeConfig.convert(json)\n );\n }\n\n /**\n * {@inheritDoc QualifierTypes.IQualifierType.getConfigurationJson}\n */\n public getConfigurationJson(): Result<JsonCompatibleType<Config.ISystemLanguageQualifierTypeConfig>> {\n return succeed({\n name: this.name,\n systemType: 'language' as const,\n configuration: {\n allowContextList: this.allowContextList\n }\n });\n }\n\n /**\n * {@inheritDoc QualifierTypes.IQualifierType.validateConfigurationJson}\n */\n public validateConfigurationJson(\n from: unknown\n ): Result<JsonCompatibleType<Config.ISystemLanguageQualifierTypeConfig>> {\n return Config.Convert.systemLanguageQualifierTypeConfig.convert(from);\n }\n\n /**\n * Validates a {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | strongly typed configuration object}\n * for this qualifier type.\n * @param from - The unknown data to validate as a configuration object.\n * @returns `Success` with the validated configuration if successful, `Failure` with an error message otherwise.\n */\n public validateConfiguration(from: unknown): Result<Config.ISystemLanguageQualifierTypeConfig> {\n return Config.Convert.systemLanguageQualifierTypeConfig.convert(from);\n }\n\n /**\n * Matches a single language condition against a single language context value using\n * {@link https://github.com/ErikFortune/fgv/tree/main/libraries/ts-bcp47#tag-matching | similarity matching}.\n * @param condition - The language condition value to match.\n * @param context - The language context value to match against.\n * @param operator - The operator to use for the match. Must be 'matches'.\n * @returns The match score, or `noMatch` if the match fails.\n */\n protected _matchOne(\n condition: QualifierConditionValue,\n context: QualifierContextValue,\n operator: ConditionOperator\n ): QualifierMatchScore {\n if (operator === 'matches') {\n const similarity = Bcp47.similarity(condition, context).orDefault(Bcp47.tagSimilarity.none);\n if (similarity > 0.0 && Validate.isValidQualifierMatchScore(similarity)) {\n return similarity;\n }\n }\n return NoMatch;\n }\n}\n"]}
@@ -46,7 +46,7 @@ export interface ILiteralQualifierTypeCreateParams {
46
46
  */
47
47
  export declare class LiteralQualifierType extends QualifierType<JsonCompatibleType<Config.ILiteralQualifierTypeConfig>> {
48
48
  /**
49
- * {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
49
+ * {@inheritDoc QualifierTypes.IQualifierType.systemTypeName}
50
50
  */
51
51
  readonly systemTypeName: QualifierTypeName;
52
52
  /**
@@ -64,11 +64,8 @@ export declare class LiteralQualifierType extends QualifierType<JsonCompatibleTy
64
64
  readonly hierarchy?: LiteralValueHierarchy<string>;
65
65
  /**
66
66
  * Constructs a new {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType}.
67
- * @param name - Optional name for the qualifier type. Defaults to 'literal'.
68
- * @param caseSensitive - Optional flag indicating whether the match should be
69
- * case-sensitive. Defaults to `false`.
70
- * @param allowContextList - Optional flag indicating whether the context can be a
71
- * list of values. Defaults to `false`.
67
+ * @param params - The {@link QualifierTypes.ILiteralQualifierTypeCreateParams | create parameters}
68
+ * for this qualifier type.
72
69
  * @public
73
70
  */
74
71
  protected constructor({ name, caseSensitive, allowContextList, enumeratedValues, hierarchy, index }: ILiteralQualifierTypeCreateParams);
@@ -81,7 +78,7 @@ export declare class LiteralQualifierType extends QualifierType<JsonCompatibleTy
81
78
  */
82
79
  isValidConditionValue(value: string): value is QualifierConditionValue;
83
80
  /**
84
- * {@inheritdoc QualifierTypes.IQualifierType.isPotentialMatch}
81
+ * {@inheritDoc QualifierTypes.IQualifierType.isPotentialMatch}
85
82
  */
86
83
  isPotentialMatch(conditionValue: string, contextValue: string): boolean;
87
84
  /**
@@ -91,11 +88,11 @@ export declare class LiteralQualifierType extends QualifierType<JsonCompatibleTy
91
88
  */
92
89
  getConfiguration(): Result<Config.ISystemLiteralQualifierTypeConfig>;
93
90
  /**
94
- * {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
91
+ * {@inheritDoc QualifierTypes.IQualifierType.getConfigurationJson}
95
92
  */
96
93
  getConfigurationJson(): Result<JsonCompatibleType<Config.ISystemLiteralQualifierTypeConfig>>;
97
94
  /**
98
- * {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
95
+ * {@inheritDoc QualifierTypes.IQualifierType.validateConfigurationJson}
99
96
  */
100
97
  validateConfigurationJson(from: unknown): Result<JsonCompatibleType<Config.ISystemLiteralQualifierTypeConfig>>;
101
98
  /**
@@ -106,7 +103,7 @@ export declare class LiteralQualifierType extends QualifierType<JsonCompatibleTy
106
103
  */
107
104
  validateConfiguration(from: unknown): Result<Config.ISystemLiteralQualifierTypeConfig>;
108
105
  /**
109
- * {@inheritdoc QualifierTypes.QualifierType._matchOne}
106
+ * {@inheritDoc QualifierTypes.QualifierType._matchOne}
110
107
  */
111
108
  protected _matchOne(condition: QualifierConditionValue, context: QualifierContextValue, __operator: ConditionOperator): QualifierMatchScore;
112
109
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"literalQualifierType.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/literalQualifierType.ts"],"names":[],"mappings":"AAsBA,OAAO,EAA6B,MAAM,EAAiB,MAAM,eAAe,CAAC;AACjF,OAAO,EACL,iBAAiB,EAIjB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EAElB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAkC,MAAM,mBAAmB,CAAC;AAEvF;;;;GAIG;AACH,MAAM,WAAW,iCAAiC;IAChD;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAEzC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,yBAAyB,CAAC,MAAM,CAAC,CAAC;IAErD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,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AC;IAI9F;;;;;;;;OAQG;WACW,gBAAgB,CAC5B,MAAM,EAAE,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,2BAA2B,CAAC,GACtE,MAAM,CAAC,oBAAoB,CAAC;IAW/B;;;;;OAKG;WACW,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,uBAAuB;IAIzF;;;;;;OAMG;WACW,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,uBAAuB,CAAC;CAKrF"}
@@ -69,11 +69,8 @@ const ts_json_base_1 = require("@fgv/ts-json-base");
69
69
  class LiteralQualifierType extends qualifierType_1.QualifierType {
70
70
  /**
71
71
  * Constructs a new {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType}.
72
- * @param name - Optional name for the qualifier type. Defaults to 'literal'.
73
- * @param caseSensitive - Optional flag indicating whether the match should be
74
- * case-sensitive. Defaults to `false`.
75
- * @param allowContextList - Optional flag indicating whether the context can be a
76
- * list of values. Defaults to `false`.
72
+ * @param params - The {@link QualifierTypes.ILiteralQualifierTypeCreateParams | create parameters}
73
+ * for this qualifier type.
77
74
  * @public
78
75
  */
79
76
  constructor({ name, caseSensitive, allowContextList, enumeratedValues, hierarchy, index }) {
@@ -84,7 +81,7 @@ class LiteralQualifierType extends qualifierType_1.QualifierType {
84
81
  index: index !== undefined ? common_1.Convert.qualifierTypeIndex.convert(index).orThrow() : undefined
85
82
  });
86
83
  /**
87
- * {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
84
+ * {@inheritDoc QualifierTypes.IQualifierType.systemTypeName}
88
85
  */
89
86
  this.systemTypeName = common_1.Convert.qualifierTypeName.convert('literal').orThrow();
90
87
  this.caseSensitive = caseSensitive === true;
@@ -116,7 +113,7 @@ class LiteralQualifierType extends qualifierType_1.QualifierType {
116
113
  return LiteralQualifierType.isValidLiteralConditionValue(value);
117
114
  }
118
115
  /**
119
- * {@inheritdoc QualifierTypes.IQualifierType.isPotentialMatch}
116
+ * {@inheritDoc QualifierTypes.IQualifierType.isPotentialMatch}
120
117
  */
121
118
  isPotentialMatch(conditionValue, contextValue) {
122
119
  if (this.isValidConditionValue(conditionValue) && this.isValidContextValue(contextValue)) {
@@ -138,7 +135,7 @@ class LiteralQualifierType extends qualifierType_1.QualifierType {
138
135
  return this.getConfigurationJson().onSuccess((json) => Config.Convert.systemLiteralQualifierTypeConfig.convert(json));
139
136
  }
140
137
  /**
141
- * {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
138
+ * {@inheritDoc QualifierTypes.IQualifierType.getConfigurationJson}
142
139
  */
143
140
  getConfigurationJson() {
144
141
  const hierarchy = this.hierarchy ? { hierarchy: this.hierarchy.asRecord() } : {};
@@ -152,7 +149,7 @@ class LiteralQualifierType extends qualifierType_1.QualifierType {
152
149
  });
153
150
  }
154
151
  /**
155
- * {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
152
+ * {@inheritDoc QualifierTypes.IQualifierType.validateConfigurationJson}
156
153
  */
157
154
  validateConfigurationJson(from) {
158
155
  return Config.Convert.systemLiteralQualifierTypeConfig.convert(from);
@@ -167,7 +164,7 @@ class LiteralQualifierType extends qualifierType_1.QualifierType {
167
164
  return Config.Convert.systemLiteralQualifierTypeConfig.convert(from);
168
165
  }
169
166
  /**
170
- * {@inheritdoc QualifierTypes.QualifierType._matchOne}
167
+ * {@inheritDoc QualifierTypes.QualifierType._matchOne}
171
168
  */
172
169
  _matchOne(condition, context, __operator) {
173
170
  if (this.hierarchy) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"literalQualifierType.js","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/literalQualifierType.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAAiF;AACjF,sCAUmB;AACnB,mDAAgD;AAChD,mEAAgE;AAChE,iDAAmC;AACnC,oDAAuF;AA2CvF;;;;GAIG;AACH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AAM,cAAN,MAAM,GAAI,EAAE,CAAC,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;OAQG;IACI,MAAM,CAAC,gBAAgB,CAC5B,MAAuE;;QAEvE,MAAM,aAAa,GAAG,MAAA,MAAM,CAAC,aAAa,mCAAI,EAAE,CAAC;QACjD,OAAO,IAAA,iCAAkB,EAAoC;YAC3D,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,gBAAgB,EAAE,aAAa,CAAC,gBAAgB,KAAK,IAAI;YACzD,aAAa,EAAE,aAAa,CAAC,aAAa;YAC1C,gBAAgB,EAAE,aAAa,CAAC,gBAAgB;YAChD,SAAS,EAAE,aAAa,CAAC,SAAS;SACnC,CAAC,CAAC,SAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,4BAA4B,CAAC,IAAY;QACrD,OAAO,iBAAQ,CAAC,kBAAkB,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,uBAAuB,CAAC,IAAY;QAChD,OAAO,oBAAoB,CAAC,4BAA4B,CAAC,IAAI,CAAC;YAC5D,CAAC,CAAC,IAAA,kBAAO,EAAC,IAAI,CAAC;YACf,CAAC,CAAC,IAAA,eAAI,EAAC,GAAG,IAAI,oCAAoC,CAAC,CAAC;IACxD,CAAC;CACF;AArND,oDAqNC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, mapResults, Result, fail, succeed } from '@fgv/ts-utils';\nimport {\n ConditionOperator,\n Convert,\n NoMatch,\n PerfectMatch,\n QualifierConditionValue,\n QualifierContextValue,\n QualifierMatchScore,\n QualifierTypeName,\n Validate\n} from '../common';\nimport { QualifierType } from './qualifierType';\nimport { LiteralValueHierarchy } from './literalValueHierarchy';\nimport * as Config from './config';\nimport { JsonCompatibleType, JsonObject, sanitizeJsonObject } from '@fgv/ts-json-base';\n\n/**\n * Interface defining the parameters that can be used to create a new\n * {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType}.\n * @public\n */\nexport interface ILiteralQualifierTypeCreateParams {\n /**\n * Optional name for the qualifier type. Defaults to 'literal'.\n */\n name?: string;\n\n /**\n * Optional flag indicating whether the context can be a list of values.\n * Defaults to `true`.\n */\n allowContextList?: boolean;\n\n /**\n * Optional flag indicating whether the match should be case-sensitive.\n * Defaults to `false`.\n */\n caseSensitive?: boolean;\n\n /**\n * Optional array of enumerated values to further constrain the type.\n * Defaults to no constraint.\n */\n enumeratedValues?: ReadonlyArray<string>;\n\n /**\n * Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}\n * of literal values to use for matching. If not provided, no hierarchy will be used.\n */\n hierarchy?: Config.LiteralValueHierarchyDecl<string>;\n\n /**\n * Global index for this qualifier type.\n */\n index?: number;\n}\n\n/**\n * A {@link QualifierTypes.QualifierType | qualifier} that matches a literal value,\n * optionally case-sensitive or matching against an ordered list of values at runtime.\n * @public\n */\nexport class LiteralQualifierType extends QualifierType<\n JsonCompatibleType<Config.ILiteralQualifierTypeConfig>\n> {\n /**\n * {@inheritDoc QualifierTypes.IQualifierType.systemTypeName}\n */\n public readonly systemTypeName: QualifierTypeName = Convert.qualifierTypeName.convert('literal').orThrow();\n\n /**\n * Indicates whether the qualifier match is case-sensitive.\n */\n public readonly caseSensitive: boolean;\n\n /**\n * Optional array of enumerated values to further constrain the type.\n */\n public readonly enumeratedValues?: ReadonlyArray<QualifierConditionValue>;\n\n /**\n * Optional {@link QualifierTypes.LiteralValueHierarchy | hierarchy} of literal\n * values to use for matching. If not provided, no hierarchy will be used.\n */\n public readonly hierarchy?: LiteralValueHierarchy<string>;\n\n /**\n * Constructs a new {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType}.\n * @param params - The {@link QualifierTypes.ILiteralQualifierTypeCreateParams | create parameters}\n * for this qualifier type.\n * @public\n */\n protected constructor({\n name,\n caseSensitive,\n allowContextList,\n enumeratedValues,\n hierarchy,\n index\n }: ILiteralQualifierTypeCreateParams) {\n allowContextList = allowContextList !== false;\n super({\n name: name ?? 'literal',\n allowContextList,\n index: index !== undefined ? Convert.qualifierTypeIndex.convert(index).orThrow() : undefined\n });\n this.caseSensitive = caseSensitive === true;\n this.enumeratedValues = enumeratedValues\n ? mapResults(Array.from(enumeratedValues).map(LiteralQualifierType.toLiteralConditionValue)).orThrow()\n : undefined;\n if (hierarchy) {\n /* c8 ignore next 5 - defensive coding: enumeratedValues ?? [] fallback enables open values mode */\n this.hierarchy = LiteralValueHierarchy.create({\n values: enumeratedValues ?? [],\n hierarchy: hierarchy\n }).orThrow();\n }\n }\n\n /**\n * Determines whether a value is a valid condition value for a literal qualifier.\n * The {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType} accepts\n * any identifier as a valid condition value.\n * @param value - The value to validate.\n * @returns `true` if the value is a valid condition value, `false` otherwise.\n */\n public isValidConditionValue(value: string): value is QualifierConditionValue {\n if (this.enumeratedValues) {\n if (this.caseSensitive) {\n return this.enumeratedValues.includes(value as QualifierConditionValue);\n }\n return this.enumeratedValues.some((v) => v.toLowerCase() === value.toLowerCase());\n }\n return LiteralQualifierType.isValidLiteralConditionValue(value);\n }\n\n /**\n * {@inheritDoc QualifierTypes.IQualifierType.isPotentialMatch}\n */\n public isPotentialMatch(conditionValue: string, contextValue: string): boolean {\n if (this.isValidConditionValue(conditionValue) && this.isValidContextValue(contextValue)) {\n if (this._matchOne(conditionValue, contextValue, 'matches') !== NoMatch) {\n return true;\n }\n if (this.hierarchy) {\n return this.hierarchy.isAncestor(conditionValue, contextValue);\n }\n }\n return false;\n }\n\n /**\n * Gets a {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | strongly typed configuration object}\n * for this qualifier type.\n * @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.\n */\n public getConfiguration(): Result<Config.ISystemLiteralQualifierTypeConfig> {\n return this.getConfigurationJson().onSuccess((json) =>\n Config.Convert.systemLiteralQualifierTypeConfig.convert(json)\n );\n }\n\n /**\n * {@inheritDoc QualifierTypes.IQualifierType.getConfigurationJson}\n */\n public getConfigurationJson(): Result<JsonCompatibleType<Config.ISystemLiteralQualifierTypeConfig>> {\n const hierarchy: JsonObject = this.hierarchy ? { hierarchy: this.hierarchy.asRecord() } : {};\n const enumeratedValues: JsonObject = this.enumeratedValues\n ? { enumeratedValues: [...this.enumeratedValues] }\n : {};\n return succeed({\n name: this.name,\n systemType: 'literal' as const,\n configuration: {\n allowContextList: this.allowContextList,\n caseSensitive: this.caseSensitive,\n ...enumeratedValues,\n ...hierarchy\n }\n });\n }\n\n /**\n * {@inheritDoc QualifierTypes.IQualifierType.validateConfigurationJson}\n */\n public validateConfigurationJson(\n from: unknown\n ): Result<JsonCompatibleType<Config.ISystemLiteralQualifierTypeConfig>> {\n return Config.Convert.systemLiteralQualifierTypeConfig.convert(from);\n }\n\n /**\n * Validates a {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | strongly typed configuration object}\n * for this qualifier type.\n * @param from - The unknown data to validate as a configuration object.\n * @returns `Success` with the validated configuration if successful, `Failure` with an error message otherwise.\n */\n public validateConfiguration(from: unknown): Result<Config.ISystemLiteralQualifierTypeConfig> {\n return Config.Convert.systemLiteralQualifierTypeConfig.convert(from);\n }\n\n /**\n * {@inheritDoc QualifierTypes.QualifierType._matchOne}\n */\n protected _matchOne(\n condition: QualifierConditionValue,\n context: QualifierContextValue,\n __operator: ConditionOperator\n ): QualifierMatchScore {\n if (this.hierarchy) {\n return this.hierarchy.match(condition, context, __operator);\n }\n if (this.caseSensitive) {\n return condition === (context as string) ? PerfectMatch : NoMatch;\n } else {\n return condition.toLowerCase() === context.toLowerCase() ? PerfectMatch : NoMatch;\n }\n }\n\n /**\n * Creates a new {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType}.\n * @param params - Optional {@link QualifierTypes.ILiteralQualifierTypeCreateParams | parameters}\n * to use when creating the new instance.\n * @returns `Success` with the new {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\n public static create(params?: ILiteralQualifierTypeCreateParams): Result<LiteralQualifierType> {\n return captureResult(() => new LiteralQualifierType(params ?? {}));\n }\n\n /**\n * Creates a new {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType} from a configuration object.\n * @param config - The {@link QualifierTypes.Config.IQualifierTypeConfig | configuration object} containing\n * the name, systemType, and optional literal-specific configuration including case sensitivity,\n * enumerated values, and hierarchy information.\n * @returns `Success` with the new {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\n public static createFromConfig(\n config: Config.IQualifierTypeConfig<Config.ILiteralQualifierTypeConfig>\n ): Result<LiteralQualifierType> {\n const literalConfig = config.configuration ?? {};\n return sanitizeJsonObject<ILiteralQualifierTypeCreateParams>({\n name: config.name,\n allowContextList: literalConfig.allowContextList === true,\n caseSensitive: literalConfig.caseSensitive,\n enumeratedValues: literalConfig.enumeratedValues,\n hierarchy: literalConfig.hierarchy\n }).onSuccess(LiteralQualifierType.create);\n }\n\n /**\n * Checks if the given value is a valid literal condition value.\n * @param from - The value to validate.\n * @returns `true` if the value is a valid literal condition value, otherwise `false`.\n * @public\n */\n public static isValidLiteralConditionValue(from: string): from is QualifierConditionValue {\n return Validate.RegularExpressions.identifier.test(from);\n }\n\n /**\n * Converts a string to a {@link QualifierConditionValue | literal condition value}.\n * @param from - The string to convert.\n * @returns `Success` with the converted value if valid, or `Failure` with an error\n * message if not.\n * @public\n */\n public static toLiteralConditionValue(from: string): Result<QualifierConditionValue> {\n return LiteralQualifierType.isValidLiteralConditionValue(from)\n ? succeed(from)\n : fail(`${from}: invalid literal condition value.`);\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"literalValueHierarchy.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/literalValueHierarchy.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAoC,MAAM,EAAiB,MAAM,eAAe,CAAC;AACxF,OAAO,EACL,iBAAiB,EAGjB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EAEpB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAErD;;;GAGG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,MAAM;IAC7C,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjB,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;CACtC;AAED;;;;GAIG;AACH,MAAM,WAAW,kCAAkC,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC3E,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CA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,WAAW,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAoE3C;;;OAGG;IACI,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAM1C"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"literalValueHierarchy.js","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/literalValueHierarchy.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAwF;AACxF,sCAQmB;AAkCnB;;;;;;;;;;;;;;GAcG;AACH,MAAa,qBAAqB;IAahC,YAAsB,MAA6C;QACjE,MAAM,MAAM,GAAG,qBAAqB,CAAC,yBAAyB,CAAC,MAAM,CAAC,CAAC;QACvE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;QAC/B,IAAI,CAAC,YAAY,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC;IACnE,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAClB,MAA6C;QAE7C,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC;IAChE,CAAC;IAED;;;;OAIG;IACI,QAAQ,CAAC,KAAQ;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,OAAO,IAAA,kBAAO,EACZ,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;aAC7B,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;aACxB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CACtB,CAAC;IACJ,CAAC;IAED;;;;;OAK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CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBACnC,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,QAAQ,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBACjC,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC,cAAc,CAAC,IAAA,kBAAO,EAAC,QAAQ,CAAC,CAAC,CAAC;IAClD,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;aAC7C,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC;aACrC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACxC,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACF;AA9PD,sDA8PC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, MessageAggregator, Result, succeed, fail } from '@fgv/ts-utils';\nimport {\n ConditionOperator,\n NoMatch,\n PerfectMatch,\n QualifierConditionValue,\n QualifierContextValue,\n QualifierMatchScore,\n Convert as CommonConverters\n} from '../common';\nimport { LiteralValueHierarchyDecl } from './config';\n\n/**\n * Describes a single valid literal value including optional parent and child values.\n * @public\n */\nexport interface ILiteralValue<T extends string> {\n readonly name: T;\n readonly parent?: ILiteralValue<T>;\n readonly children?: ReadonlyArray<T>;\n}\n\n/**\n * Describes the parameters used to create a new\n * {@link QualifierTypes.LiteralValueHierarchy | LiteralValueHierarchy}.\n * @public\n */\nexport interface ILiteralValueHierarchyCreateParams<T extends string = string> {\n values: ReadonlyArray<T>;\n hierarchy?: Partial<LiteralValueHierarchyDecl<T>>;\n}\n\n/**\n * Internal interface used during hierarchy construction to build\n * {@link QualifierTypes.ILiteralValue | ILiteralValue} objects.\n * @public\n */\ninterface ILiteralValueBuilder<T extends string> {\n readonly name: T;\n parent?: ILiteralValue<T>;\n children?: T[];\n}\n\n/**\n * A class that implements a hierarchy of literal values. The hierarchy is defined as a\n * tree, where each value can have multiple children but only one parent. The root of the\n * tree has no parent. The hierarchy is used to determine the relationship between values\n * when matching conditions and contexts.\n *\n * @remarks\n * The hierarchy can be created in two modes:\n * - **Constrained mode**: When enumerated values are provided, only those values are allowed\n * in the hierarchy and matching operations.\n * - **Open values mode**: When no enumerated values are provided, all values referenced in\n * the hierarchy are automatically collected and used. This allows for flexible hierarchies\n * where any value can be used in matching operations.\n * @public\n */\nexport class LiteralValueHierarchy<T extends string = string> {\n /**\n * A map of all allowed literal values to the corresponding\n * {@link QualifierTypes.ILiteralValue | ILiteralValue} validated definition.\n */\n public readonly values: ReadonlyMap<T, ILiteralValue<T>>;\n\n /**\n * Indicates whether this hierarchy was created with open values (no enumerated values\n * provided), allowing any value to be used in matching operations.\n */\n public readonly isOpenValues: boolean;\n\n protected constructor(params: ILiteralValueHierarchyCreateParams<T>) {\n const result = LiteralValueHierarchy._buildValuesFromHierarchy(params);\n this.values = result.orThrow();\n this.isOpenValues = !params.values || params.values.length === 0;\n }\n\n /**\n * Creates a new {@link QualifierTypes.LiteralValueHierarchy | LiteralValueHierarchy} instance.\n * @param params - The {@link QualifierTypes.ILiteralValueHierarchyCreateParams | parameters}\n * used to create the hierarchy.\n * @returns `Success` with the new hierarchy or `Failure` with an error message.\n */\n public static create<T extends string>(\n params: ILiteralValueHierarchyCreateParams<T>\n ): Result<LiteralValueHierarchy<T>> {\n return captureResult(() => new LiteralValueHierarchy(params));\n }\n\n /**\n * Checks if a value exists in the hierarchy.\n * @param value - The value to check.\n * @returns `true` if the value exists in the hierarchy, `false` otherwise.\n */\n public hasValue(value: T): boolean {\n return this.values.has(value);\n }\n\n /**\n * Gets all root values (values with no parent) in the hierarchy.\n * @returns `Success` with an array of root values.\n */\n public getRoots(): Result<T[]> {\n return succeed(\n Array.from(this.values.values())\n .filter((v) => !v.parent)\n .map((v) => v.name)\n );\n }\n\n /**\n * Gets all ancestors of a value in the hierarchy.\n * @param value - The value to get ancestors for.\n * @returns `Success` with an array of ancestor values, ordered from immediate parent\n * to root, or `Failure` if the value is not in the hierarchy.\n */\n public getAncestors(value: T): Result<T[]> {\n const current = this.values.get(value);\n /* c8 ignore next 3 - functional error case tested but coverage intermittently missed */\n if (!current) {\n return fail(`${value}: not found in hierarchy`);\n }\n\n const ancestors: T[] = [];\n let ancestor = current.parent;\n\n while (ancestor) {\n ancestors.push(ancestor.name);\n ancestor = ancestor.parent;\n }\n\n return succeed(ancestors);\n }\n\n /**\n * Determines if a value is an ancestor of a possible ancestor value.\n * @param value - The value to check.\n * @param possibleAncestor - The possible ancestor value.\n * @returns `true` if the value is an ancestor of the possible ancestor, `false` otherwise.\n */\n public isAncestor(value: T, possibleAncestor: T): boolean {\n const ancestors = this.getAncestors(value);\n if (ancestors.isSuccess()) {\n return ancestors.value.includes(possibleAncestor);\n }\n /* c8 ignore next 2 - edge case: ancestor validation fallback */\n return false;\n }\n\n /**\n * Gets all descendants of a value in the hierarchy.\n * @param value - The value to get descendants for.\n * @returns `Success` with an array of descendant values, or `Failure` if the value\n * is not in the hierarchy.\n */\n public getDescendants(value: T): Result<T[]> {\n const current = this.values.get(value);\n if (!current) {\n return fail(`${value}: not found in hierarchy`);\n }\n\n const descendants: T[] = [];\n if (current.children) {\n for (const childName of current.children) {\n descendants.push(childName);\n const childDescendants = this.getDescendants(childName);\n if (childDescendants.isSuccess()) {\n descendants.push(...childDescendants.value);\n }\n }\n }\n\n return succeed(descendants);\n }\n\n public match(condition: T, context: T): QualifierMatchScore;\n /**\n * Matches a condition value against a context value, where an exact match of the\n * condition and context returns {@link PerfectMatch | PerfectMatch}, a condition\n * value that does not match the context value or any of its ancestors returns\n * {@link NoMatch | NoMatch}, and a condition value that matches the context value\n * or any of its ancestors returns a positive score that is less than\n * {@link PerfectMatch | PerfectMatch}, with the score decreasing with each ancestor\n * in the hierarchy.\n * @param condition - The condition value to match.\n * @param context - The context value to match against.\n * @param __operator - The operator used for matching (not used in this implementation).\n * @returns A {@link QualifierMatchScore | QualifierMatchScore} indicating the match score.\n */\n public match(\n condition: QualifierConditionValue,\n context: QualifierContextValue,\n __operator?: ConditionOperator\n ): QualifierMatchScore;\n public match(condition: string, context: string, __operator?: ConditionOperator): QualifierMatchScore {\n // For open hierarchies, skip validation and allow any values\n if (!this.isOpenValues) {\n // Validate that both condition and context exist in the hierarchy\n /* c8 ignore next 3 - functional error case tested but coverage intermittently missed */\n if (!this.values.has(condition as T)) {\n return NoMatch;\n }\n /* c8 ignore next 3 - functional error case tested but coverage intermittently missed */\n if (!this.values.has(context as T)) {\n return NoMatch;\n }\n }\n\n if ((condition as string) === (context as string)) {\n return PerfectMatch;\n }\n\n // For open hierarchies, if values aren't in the hierarchy, treat as no match\n // but don't fail validation\n const values: ReadonlyMap<string, ILiteralValue<string>> = this.values;\n /* c8 ignore next 1 - ? is defense in depth */\n let value = values.get(context)?.parent;\n /* c8 ignore next 2 - functional error case tested but coverage intermittently missed */\n if (!value) {\n return NoMatch;\n }\n let score = PerfectMatch as number;\n while (value) {\n score *= 0.9;\n if (value.name === condition) {\n return CommonConverters.qualifierMatchScore.convert(score).orDefault(NoMatch);\n }\n value = value.parent;\n }\n return NoMatch;\n }\n\n protected static _buildValuesFromHierarchy<T extends string>(\n params: ILiteralValueHierarchyCreateParams<T>\n ): Result<ReadonlyMap<T, ILiteralValue<T>>> {\n const errors = new MessageAggregator();\n const values = params.values;\n /* c8 ignore next 1 - defense in depth */\n const hierarchy = params.hierarchy ?? {};\n\n // If no values are provided, collect all values from the hierarchy\n let allValues: T[];\n if (!values || values.length === 0) {\n const hierarchyValues = new Set<T>();\n // Add all keys and values from the hierarchy\n Object.keys(hierarchy).forEach((key) => hierarchyValues.add(key as T));\n Object.values(hierarchy).forEach((value) => hierarchyValues.add(value as T));\n allValues = Array.from(hierarchyValues);\n } else {\n allValues = [...values];\n }\n\n const valueMap = new Map<T, ILiteralValueBuilder<T>>(allValues.map((name) => [name, { name }]));\n\n if (hierarchy) {\n for (const [valueName, parentName] of Object.entries(hierarchy)) {\n const value = valueMap.get(valueName as T);\n if (!value) {\n errors.addMessage(`${valueName}: invalid literal value.`);\n continue;\n }\n\n const parent = valueMap.get(parentName as T);\n if (!parent) {\n errors.addMessage(`${valueName}: parent ${parentName} is invalid literal value.`);\n continue;\n }\n\n let ancestor = parent.parent;\n let circular = false;\n const ancestors: T[] = [];\n\n while (ancestor) {\n /* c8 ignore next 1 - defensive coding: complex circular reference detection intermittently missed */\n ancestors.push(ancestor.name);\n /* c8 ignore next 1 - defensive coding: ancestor.parent === value is very difficult to reach */\n if (ancestor.parent === parent || ancestor.parent === value) {\n /* c8 ignore next 4 - defensive coding: circular reference error reporting intermittently missed */\n errors.addMessage(`${valueName}: Circular reference detected: ${ancestors.join('->')}`);\n circular = true;\n break;\n }\n ancestor = ancestor.parent;\n }\n\n /* c8 ignore next 3 - defensive coding: circular reference handling intermittently missed */\n if (circular) {\n continue;\n }\n\n value.parent = parent;\n if (parent.children) {\n parent.children.push(value.name);\n } else {\n parent.children = [value.name];\n }\n }\n }\n\n return errors.returnOrReport(succeed(valueMap));\n }\n\n /**\n * Converts the hierarchy to a record of parent-child relationships.\n * @returns A record of parent-child relationships.\n */\n public asRecord(): Record<string, string> {\n const entries = Array.from(this.values.values())\n .filter((v) => v.parent !== undefined)\n .map((v) => [v.name, v.parent!.name]);\n return Object.fromEntries(entries);\n }\n}\n"]}