@fgv/ts-res 4.5.0-3 → 5.0.0-2

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 (405) hide show
  1. package/CHANGELOG.json +26 -0
  2. package/CHANGELOG.md +14 -0
  3. package/CLAUDE.md +186 -0
  4. package/EXAMPLE_INIT_PARAMS.md +88 -0
  5. package/PROGRESS_SUMMARY.md +48 -0
  6. package/README.md +535 -14
  7. package/dist/ts-res.d.ts +4241 -318
  8. package/dist/tsdoc-metadata.json +1 -1
  9. package/lib/index.d.ts +4 -1
  10. package/lib/index.d.ts.map +1 -1
  11. package/lib/index.js +7 -1
  12. package/lib/index.js.map +1 -1
  13. package/lib/packlets/common/conditions.d.ts +30 -0
  14. package/lib/packlets/common/conditions.d.ts.map +1 -1
  15. package/lib/packlets/common/conditions.js.map +1 -1
  16. package/lib/packlets/common/convert.d.ts +22 -2
  17. package/lib/packlets/common/convert.d.ts.map +1 -1
  18. package/lib/packlets/common/convert.js +21 -1
  19. package/lib/packlets/common/convert.js.map +1 -1
  20. package/lib/packlets/common/helpers/context.d.ts +39 -0
  21. package/lib/packlets/common/helpers/context.d.ts.map +1 -0
  22. package/lib/packlets/common/helpers/context.js +108 -0
  23. package/lib/packlets/common/helpers/context.js.map +1 -0
  24. package/lib/packlets/common/helpers/index.d.ts +2 -0
  25. package/lib/packlets/common/helpers/index.d.ts.map +1 -1
  26. package/lib/packlets/common/helpers/index.js +2 -0
  27. package/lib/packlets/common/helpers/index.js.map +1 -1
  28. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts +39 -0
  29. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +1 -0
  30. package/lib/packlets/common/helpers/qualifierDefaultValues.js +105 -0
  31. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  32. package/lib/packlets/common/helpers/resources.d.ts.map +1 -1
  33. package/lib/packlets/common/helpers/resources.js +6 -2
  34. package/lib/packlets/common/helpers/resources.js.map +1 -1
  35. package/lib/packlets/common/validate/conditions.d.ts +69 -1
  36. package/lib/packlets/common/validate/conditions.d.ts.map +1 -1
  37. package/lib/packlets/common/validate/conditions.js +126 -0
  38. package/lib/packlets/common/validate/conditions.js.map +1 -1
  39. package/lib/packlets/common/validate/regularExpressions.d.ts +20 -0
  40. package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -1
  41. package/lib/packlets/common/validate/regularExpressions.js +21 -1
  42. package/lib/packlets/common/validate/regularExpressions.js.map +1 -1
  43. package/lib/packlets/conditions/condition.d.ts +37 -0
  44. package/lib/packlets/conditions/condition.d.ts.map +1 -1
  45. package/lib/packlets/conditions/condition.js +67 -1
  46. package/lib/packlets/conditions/condition.js.map +1 -1
  47. package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -1
  48. package/lib/packlets/conditions/conditionCollector.js +1 -0
  49. package/lib/packlets/conditions/conditionCollector.js.map +1 -1
  50. package/lib/packlets/conditions/conditionSet.d.ts +34 -3
  51. package/lib/packlets/conditions/conditionSet.d.ts.map +1 -1
  52. package/lib/packlets/conditions/conditionSet.js +31 -3
  53. package/lib/packlets/conditions/conditionSet.js.map +1 -1
  54. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -1
  55. package/lib/packlets/conditions/conditionSetCollector.js +3 -0
  56. package/lib/packlets/conditions/conditionSetCollector.js.map +1 -1
  57. package/lib/packlets/conditions/conditionToken.d.ts.map +1 -1
  58. package/lib/packlets/conditions/conditionToken.js +2 -1
  59. package/lib/packlets/conditions/conditionToken.js.map +1 -1
  60. package/lib/packlets/conditions/convert/decls.js +1 -1
  61. package/lib/packlets/conditions/convert/decls.js.map +1 -1
  62. package/lib/packlets/config/common.d.ts +35 -0
  63. package/lib/packlets/config/common.d.ts.map +1 -0
  64. package/lib/packlets/config/common.js +96 -0
  65. package/lib/packlets/config/common.js.map +1 -0
  66. package/lib/packlets/config/convert.d.ts +14 -0
  67. package/lib/packlets/config/convert.d.ts.map +1 -0
  68. package/lib/packlets/config/convert.js +82 -0
  69. package/lib/packlets/config/convert.js.map +1 -0
  70. package/lib/packlets/config/index.d.ts +6 -0
  71. package/lib/packlets/config/index.d.ts.map +1 -0
  72. package/lib/packlets/config/index.js +67 -0
  73. package/lib/packlets/config/index.js.map +1 -0
  74. package/lib/packlets/config/json.d.ts +20 -0
  75. package/lib/packlets/config/json.d.ts.map +1 -0
  76. package/lib/packlets/config/json.js +24 -0
  77. package/lib/packlets/config/json.js.map +1 -0
  78. package/lib/packlets/config/predefined/default.d.ts +57 -0
  79. package/lib/packlets/config/predefined/default.d.ts.map +1 -0
  80. package/lib/packlets/config/predefined/default.js +141 -0
  81. package/lib/packlets/config/predefined/default.js.map +1 -0
  82. package/lib/packlets/config/predefined/extended.d.ts +25 -0
  83. package/lib/packlets/config/predefined/extended.d.ts.map +1 -0
  84. package/lib/packlets/config/predefined/extended.js +193 -0
  85. package/lib/packlets/config/predefined/extended.js.map +1 -0
  86. package/lib/packlets/config/predefined/index.d.ts +4 -0
  87. package/lib/packlets/config/predefined/index.d.ts.map +1 -0
  88. package/lib/packlets/config/predefined/index.js +62 -0
  89. package/lib/packlets/config/predefined/index.js.map +1 -0
  90. package/lib/packlets/config/systemConfiguration.d.ts +81 -0
  91. package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
  92. package/lib/packlets/config/systemConfiguration.js +172 -0
  93. package/lib/packlets/config/systemConfiguration.js.map +1 -0
  94. package/lib/packlets/context/contextDecls.d.ts +49 -0
  95. package/lib/packlets/context/contextDecls.d.ts.map +1 -0
  96. package/lib/packlets/context/contextDecls.js +24 -0
  97. package/lib/packlets/context/contextDecls.js.map +1 -0
  98. package/lib/packlets/context/contextToken.d.ts +111 -0
  99. package/lib/packlets/context/contextToken.d.ts.map +1 -0
  100. package/lib/packlets/context/contextToken.js +206 -0
  101. package/lib/packlets/context/contextToken.js.map +1 -0
  102. package/lib/packlets/context/convert/decls.d.ts +37 -0
  103. package/lib/packlets/context/convert/decls.d.ts.map +1 -0
  104. package/lib/packlets/context/convert/decls.js +94 -0
  105. package/lib/packlets/context/convert/decls.js.map +1 -0
  106. package/lib/packlets/context/convert/index.d.ts +2 -0
  107. package/lib/packlets/context/convert/index.d.ts.map +1 -0
  108. package/lib/packlets/context/convert/index.js +39 -0
  109. package/lib/packlets/context/convert/index.js.map +1 -0
  110. package/lib/packlets/context/index.d.ts +5 -0
  111. package/lib/packlets/context/index.d.ts.map +1 -0
  112. package/lib/packlets/context/index.js +65 -0
  113. package/lib/packlets/context/index.js.map +1 -0
  114. package/lib/packlets/decisions/abstractDecision.d.ts +8 -0
  115. package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -1
  116. package/lib/packlets/decisions/abstractDecision.js +9 -0
  117. package/lib/packlets/decisions/abstractDecision.js.map +1 -1
  118. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -1
  119. package/lib/packlets/decisions/abstractDecisionCollector.js +2 -0
  120. package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -1
  121. package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -1
  122. package/lib/packlets/decisions/concreteDecision.js +1 -0
  123. package/lib/packlets/decisions/concreteDecision.js.map +1 -1
  124. package/lib/packlets/decisions/decision.d.ts.map +1 -1
  125. package/lib/packlets/decisions/decision.js +4 -0
  126. package/lib/packlets/decisions/decision.js.map +1 -1
  127. package/lib/packlets/import/fsItem.d.ts.map +1 -1
  128. package/lib/packlets/import/fsItem.js +1 -0
  129. package/lib/packlets/import/fsItem.js.map +1 -1
  130. package/lib/packlets/import/importContext.d.ts +19 -0
  131. package/lib/packlets/import/importContext.d.ts.map +1 -1
  132. package/lib/packlets/import/importContext.js +39 -0
  133. package/lib/packlets/import/importContext.js.map +1 -1
  134. package/lib/packlets/import/importManager.d.ts +5 -5
  135. package/lib/packlets/import/importManager.d.ts.map +1 -1
  136. package/lib/packlets/import/importManager.js.map +1 -1
  137. package/lib/packlets/import/importers/collectionImporter.d.ts +11 -13
  138. package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -1
  139. package/lib/packlets/import/importers/collectionImporter.js +29 -20
  140. package/lib/packlets/import/importers/collectionImporter.js.map +1 -1
  141. package/lib/packlets/import/importers/fsItemImporter.d.ts +2 -2
  142. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -1
  143. package/lib/packlets/import/importers/fsItemImporter.js +2 -2
  144. package/lib/packlets/import/importers/fsItemImporter.js.map +1 -1
  145. package/lib/packlets/import/importers/importer.d.ts +3 -3
  146. package/lib/packlets/import/importers/importer.d.ts.map +1 -1
  147. package/lib/packlets/import/importers/importer.js.map +1 -1
  148. package/lib/packlets/import/importers/jsonImporter.d.ts +2 -3
  149. package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -1
  150. package/lib/packlets/import/importers/jsonImporter.js +10 -20
  151. package/lib/packlets/import/importers/jsonImporter.js.map +1 -1
  152. package/lib/packlets/import/importers/pathImporter.d.ts +2 -2
  153. package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -1
  154. package/lib/packlets/import/importers/pathImporter.js.map +1 -1
  155. package/lib/packlets/qualifier-types/config/convert.d.ts +44 -0
  156. package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
  157. package/lib/packlets/qualifier-types/config/convert.js +96 -0
  158. package/lib/packlets/qualifier-types/config/convert.js.map +1 -0
  159. package/lib/packlets/qualifier-types/config/index.d.ts +4 -0
  160. package/lib/packlets/qualifier-types/config/index.d.ts.map +1 -0
  161. package/lib/packlets/qualifier-types/config/index.js +64 -0
  162. package/lib/packlets/qualifier-types/config/index.js.map +1 -0
  163. package/lib/packlets/qualifier-types/config/json.d.ts +69 -0
  164. package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
  165. package/lib/packlets/qualifier-types/config/json.js +24 -0
  166. package/lib/packlets/qualifier-types/config/json.js.map +1 -0
  167. package/lib/packlets/qualifier-types/convert.d.ts +10 -2
  168. package/lib/packlets/qualifier-types/convert.d.ts.map +1 -1
  169. package/lib/packlets/qualifier-types/convert.js +15 -0
  170. package/lib/packlets/qualifier-types/convert.js.map +1 -1
  171. package/lib/packlets/qualifier-types/helpers.d.ts +27 -0
  172. package/lib/packlets/qualifier-types/helpers.d.ts.map +1 -0
  173. package/lib/packlets/qualifier-types/helpers.js +118 -0
  174. package/lib/packlets/qualifier-types/helpers.js.map +1 -0
  175. package/lib/packlets/qualifier-types/index.d.ts +4 -1
  176. package/lib/packlets/qualifier-types/index.d.ts.map +1 -1
  177. package/lib/packlets/qualifier-types/index.js +5 -1
  178. package/lib/packlets/qualifier-types/index.js.map +1 -1
  179. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +19 -8
  180. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -1
  181. package/lib/packlets/qualifier-types/languageQualifierType.js +28 -9
  182. package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -1
  183. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +42 -13
  184. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -1
  185. package/lib/packlets/qualifier-types/literalQualifierType.js +58 -10
  186. package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -1
  187. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts +114 -0
  188. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
  189. package/lib/packlets/qualifier-types/literalValueHierarchy.js +228 -0
  190. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  191. package/lib/packlets/qualifier-types/qualifierType.d.ts +33 -18
  192. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -1
  193. package/lib/packlets/qualifier-types/qualifierType.js +18 -4
  194. package/lib/packlets/qualifier-types/qualifierType.js.map +1 -1
  195. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts +4 -2
  196. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -1
  197. package/lib/packlets/qualifier-types/qualifierTypeCollector.js +2 -1
  198. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -1
  199. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +47 -11
  200. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -1
  201. package/lib/packlets/qualifier-types/territoryQualifierType.js +61 -17
  202. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -1
  203. package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -1
  204. package/lib/packlets/qualifiers/convert/decls.js +17 -15
  205. package/lib/packlets/qualifiers/convert/decls.js.map +1 -1
  206. package/lib/packlets/qualifiers/index.d.ts +2 -0
  207. package/lib/packlets/qualifiers/index.d.ts.map +1 -1
  208. package/lib/packlets/qualifiers/index.js +2 -0
  209. package/lib/packlets/qualifiers/index.js.map +1 -1
  210. package/lib/packlets/qualifiers/qualifier.d.ts +22 -2
  211. package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -1
  212. package/lib/packlets/qualifiers/qualifier.js +26 -1
  213. package/lib/packlets/qualifiers/qualifier.js.map +1 -1
  214. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -1
  215. package/lib/packlets/qualifiers/qualifierCollector.js +4 -0
  216. package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -1
  217. package/lib/packlets/qualifiers/qualifierDecl.d.ts +6 -1
  218. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -1
  219. package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -1
  220. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts +32 -0
  221. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +1 -0
  222. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js +24 -0
  223. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  224. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts +96 -0
  225. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +1 -0
  226. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js +179 -0
  227. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  228. package/lib/packlets/resource-json/compiled/common.d.ts +14 -0
  229. package/lib/packlets/resource-json/compiled/common.d.ts.map +1 -0
  230. package/lib/packlets/resource-json/compiled/common.js +24 -0
  231. package/lib/packlets/resource-json/compiled/common.js.map +1 -0
  232. package/lib/packlets/resource-json/compiled/convert.d.ts +63 -0
  233. package/lib/packlets/resource-json/compiled/convert.d.ts.map +1 -0
  234. package/lib/packlets/resource-json/compiled/convert.js +167 -0
  235. package/lib/packlets/resource-json/compiled/convert.js.map +1 -0
  236. package/lib/packlets/resource-json/compiled/index.d.ts +5 -0
  237. package/lib/packlets/resource-json/compiled/index.d.ts.map +1 -0
  238. package/lib/packlets/resource-json/compiled/index.js +65 -0
  239. package/lib/packlets/resource-json/compiled/index.js.map +1 -0
  240. package/lib/packlets/resource-json/compiled/json.d.ts +204 -0
  241. package/lib/packlets/resource-json/compiled/json.d.ts.map +1 -0
  242. package/lib/packlets/resource-json/compiled/json.js +3 -0
  243. package/lib/packlets/resource-json/compiled/json.js.map +1 -0
  244. package/lib/packlets/resource-json/convert.d.ts +16 -0
  245. package/lib/packlets/resource-json/convert.d.ts.map +1 -1
  246. package/lib/packlets/resource-json/convert.js +41 -6
  247. package/lib/packlets/resource-json/convert.js.map +1 -1
  248. package/lib/packlets/resource-json/helpers.d.ts +82 -3
  249. package/lib/packlets/resource-json/helpers.d.ts.map +1 -1
  250. package/lib/packlets/resource-json/helpers.js +185 -2
  251. package/lib/packlets/resource-json/helpers.js.map +1 -1
  252. package/lib/packlets/resource-json/index.d.ts +2 -1
  253. package/lib/packlets/resource-json/index.d.ts.map +1 -1
  254. package/lib/packlets/resource-json/index.js +3 -1
  255. package/lib/packlets/resource-json/index.js.map +1 -1
  256. package/lib/packlets/resource-json/json.d.ts +55 -3
  257. package/lib/packlets/resource-json/json.d.ts.map +1 -1
  258. package/lib/packlets/resource-json/json.js +16 -0
  259. package/lib/packlets/resource-json/json.js.map +1 -1
  260. package/lib/packlets/resource-json/normalized.d.ts +46 -3
  261. package/lib/packlets/resource-json/normalized.d.ts.map +1 -1
  262. package/lib/packlets/resource-json/normalized.js.map +1 -1
  263. package/lib/packlets/resource-json/resourceDeclCollection.d.ts +14 -10
  264. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -1
  265. package/lib/packlets/resource-json/resourceDeclCollection.js +18 -14
  266. package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -1
  267. package/lib/packlets/resource-json/resourceDeclContainer.d.ts +15 -2
  268. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -1
  269. package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -1
  270. package/lib/packlets/resource-json/resourceDeclTree.d.ts +6 -2
  271. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -1
  272. package/lib/packlets/resource-json/resourceDeclTree.js +12 -3
  273. package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -1
  274. package/lib/packlets/resource-types/config/convert.d.ts +8 -0
  275. package/lib/packlets/resource-types/config/convert.d.ts.map +1 -0
  276. package/lib/packlets/resource-types/config/convert.js +36 -0
  277. package/lib/packlets/resource-types/config/convert.js.map +1 -0
  278. package/lib/packlets/resource-types/config/index.d.ts +4 -0
  279. package/lib/packlets/resource-types/config/index.d.ts.map +1 -0
  280. package/lib/packlets/resource-types/config/index.js +64 -0
  281. package/lib/packlets/resource-types/config/index.js.map +1 -0
  282. package/lib/packlets/resource-types/config/json.d.ts +9 -0
  283. package/lib/packlets/resource-types/config/json.d.ts.map +1 -0
  284. package/lib/packlets/resource-types/config/json.js +24 -0
  285. package/lib/packlets/resource-types/config/json.js.map +1 -0
  286. package/lib/packlets/resource-types/helpers.d.ts +13 -0
  287. package/lib/packlets/resource-types/helpers.d.ts.map +1 -0
  288. package/lib/packlets/resource-types/helpers.js +44 -0
  289. package/lib/packlets/resource-types/helpers.js.map +1 -0
  290. package/lib/packlets/resource-types/index.d.ts +3 -0
  291. package/lib/packlets/resource-types/index.d.ts.map +1 -1
  292. package/lib/packlets/resource-types/index.js +26 -0
  293. package/lib/packlets/resource-types/index.js.map +1 -1
  294. package/lib/packlets/resource-types/jsonResourceType.d.ts +5 -13
  295. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -1
  296. package/lib/packlets/resource-types/jsonResourceType.js +5 -2
  297. package/lib/packlets/resource-types/jsonResourceType.js.map +1 -1
  298. package/lib/packlets/resource-types/resourceType.d.ts +31 -30
  299. package/lib/packlets/resource-types/resourceType.d.ts.map +1 -1
  300. package/lib/packlets/resource-types/resourceType.js.map +1 -1
  301. package/lib/packlets/resources/candidateReducer.d.ts +98 -0
  302. package/lib/packlets/resources/candidateReducer.d.ts.map +1 -0
  303. package/lib/packlets/resources/candidateReducer.js +247 -0
  304. package/lib/packlets/resources/candidateReducer.js.map +1 -0
  305. package/lib/packlets/resources/common.d.ts +60 -0
  306. package/lib/packlets/resources/common.d.ts.map +1 -0
  307. package/lib/packlets/resources/common.js +24 -0
  308. package/lib/packlets/resources/common.js.map +1 -0
  309. package/lib/packlets/resources/index.d.ts +3 -1
  310. package/lib/packlets/resources/index.d.ts.map +1 -1
  311. package/lib/packlets/resources/index.js +3 -1
  312. package/lib/packlets/resources/index.js.map +1 -1
  313. package/lib/packlets/resources/resource.d.ts +57 -5
  314. package/lib/packlets/resources/resource.d.ts.map +1 -1
  315. package/lib/packlets/resources/resource.js +96 -6
  316. package/lib/packlets/resources/resource.js.map +1 -1
  317. package/lib/packlets/resources/resourceBuilder.d.ts +14 -0
  318. package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -1
  319. package/lib/packlets/resources/resourceBuilder.js +19 -1
  320. package/lib/packlets/resources/resourceBuilder.js.map +1 -1
  321. package/lib/packlets/resources/resourceCandidate.d.ts +42 -6
  322. package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -1
  323. package/lib/packlets/resources/resourceCandidate.js +40 -1
  324. package/lib/packlets/resources/resourceCandidate.js.map +1 -1
  325. package/lib/packlets/resources/resourceManagerBuilder.d.ts +220 -0
  326. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
  327. package/lib/packlets/resources/resourceManagerBuilder.js +451 -0
  328. package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -0
  329. package/lib/packlets/runtime/cacheListener.d.ts +62 -0
  330. package/lib/packlets/runtime/cacheListener.d.ts.map +1 -0
  331. package/lib/packlets/runtime/cacheListener.js +56 -0
  332. package/lib/packlets/runtime/cacheListener.js.map +1 -0
  333. package/lib/packlets/runtime/cacheMetrics.d.ts +82 -0
  334. package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -0
  335. package/lib/packlets/runtime/cacheMetrics.js +143 -0
  336. package/lib/packlets/runtime/cacheMetrics.js.map +1 -0
  337. package/lib/packlets/runtime/compiledResourceCollection.d.ts +167 -0
  338. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
  339. package/lib/packlets/runtime/compiledResourceCollection.js +466 -0
  340. package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -0
  341. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts +70 -0
  342. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +1 -0
  343. package/lib/packlets/runtime/conditionSetResolutionResult.js +135 -0
  344. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  345. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts +80 -0
  346. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +1 -0
  347. package/lib/packlets/runtime/context/contextQualifierProvider.js +33 -0
  348. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  349. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts +165 -0
  350. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +1 -0
  351. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js +179 -0
  352. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  353. package/lib/packlets/runtime/context/index.d.ts +5 -0
  354. package/lib/packlets/runtime/context/index.d.ts.map +1 -0
  355. package/lib/packlets/runtime/context/index.js +42 -0
  356. package/lib/packlets/runtime/context/index.js.map +1 -0
  357. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +111 -0
  358. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -0
  359. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +177 -0
  360. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  361. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +47 -0
  362. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -0
  363. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +64 -0
  364. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  365. package/lib/packlets/runtime/iResourceManager.d.ts +88 -0
  366. package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -0
  367. package/lib/packlets/runtime/iResourceManager.js +24 -0
  368. package/lib/packlets/runtime/iResourceManager.js.map +1 -0
  369. package/lib/packlets/runtime/index.d.ts +12 -0
  370. package/lib/packlets/runtime/index.d.ts.map +1 -0
  371. package/lib/packlets/runtime/index.js +73 -0
  372. package/lib/packlets/runtime/index.js.map +1 -0
  373. package/lib/packlets/runtime/resource-tree/common.d.ts +91 -0
  374. package/lib/packlets/runtime/resource-tree/common.d.ts.map +1 -0
  375. package/lib/packlets/runtime/resource-tree/common.js +24 -0
  376. package/lib/packlets/runtime/resource-tree/common.js.map +1 -0
  377. package/lib/packlets/runtime/resource-tree/index.d.ts +5 -0
  378. package/lib/packlets/runtime/resource-tree/index.d.ts.map +1 -0
  379. package/lib/packlets/runtime/resource-tree/index.js +42 -0
  380. package/lib/packlets/runtime/resource-tree/index.js.map +1 -0
  381. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts +141 -0
  382. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +1 -0
  383. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js +224 -0
  384. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  385. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts +24 -0
  386. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +1 -0
  387. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js +98 -0
  388. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  389. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts +99 -0
  390. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +1 -0
  391. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +165 -0
  392. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  393. package/lib/packlets/runtime/resourceResolver.d.ts +196 -0
  394. package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -0
  395. package/lib/packlets/runtime/resourceResolver.js +437 -0
  396. package/lib/packlets/runtime/resourceResolver.js.map +1 -0
  397. package/lib/packlets/runtime/validate.d.ts +13 -0
  398. package/lib/packlets/runtime/validate.d.ts.map +1 -0
  399. package/lib/packlets/runtime/validate.js +49 -0
  400. package/lib/packlets/runtime/validate.js.map +1 -0
  401. package/package.json +76 -75
  402. package/lib/packlets/resources/resourceManager.d.ts +0 -104
  403. package/lib/packlets/resources/resourceManager.d.ts.map +0 -1
  404. package/lib/packlets/resources/resourceManager.js +0 -201
  405. package/lib/packlets/resources/resourceManager.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"conditionSetCollector.js","sourceRoot":"","sources":["../../../src/packlets/conditions/conditionSetCollector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAA6G;AAG7G,iDAA8C;AAC9C,uCAAsD;AACtD,sCAAmG;AAoBnG;;;;;;GAMG;AACH,MAAa,qBAAsB,SAAQ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E,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CACxF,CAAC,UAAU,EAAE,EAAE,CAAC,2BAAY,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,CACpD,CAAC;QACJ,CAAC;QACD,OAAO,mCAAyB;aAC7B,OAAO,CAAC,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,iBAAiB,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;aAC5E,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,2BAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;;AA9DH,sDA+DC;AAhDC;;GAEG;AACW,wCAAkB,GAAsB,iBAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,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 { captureResult, Collections, mapResults, Result, succeed, ValidatingCollector } from '@fgv/ts-utils';\nimport { ConditionCollector } from './conditionCollector';\nimport { IConditionSetDecl } from './conditionSetDecls';\nimport { ConditionSet } from './conditionSet';\nimport { validatedConditionSetDecl } from './convert';\nimport { ConditionSetKey, Convert as CommonConvert, ConditionSetIndex, Validate } from '../common';\n\n/**\n * Parameters for creating a {@link Conditions.ConditionSetCollector | ConditionSetCollector}.\n * @public\n */\nexport interface IConditionSetCollectorCreateParams {\n /**\n * The {@link Conditions.ConditionCollector | ConditionCollector} used to create conditions\n * for conditions in this collector.\n */\n conditions: ConditionCollector;\n\n /**\n * Optional array of {@link Conditions.IConditionSetDecl | condition set declarations} to add to\n * the collector.\n */\n conditionSets?: IConditionSetDecl[];\n}\n\n/**\n * A `ValidatingCollector` for {@link Conditions.ConditionSet | ConditionSets},\n * which collects condition sets supplied as {@link Conditions.ConditionSet | ConditionSet} or\n * as {@link Conditions.IConditionSetDecl | IConditionSetDecl} via the methods on the\n * `validating` property.\n * @public\n */\nexport class ConditionSetCollector extends ValidatingCollector<ConditionSet> {\n /**\n * Gets the {@link Conditions.ConditionCollector | ConditionCollector} used to create conditions\n * for conditions in this collector.\n */\n public conditions: ConditionCollector;\n\n /**\n * Gets the {@link Conditions.ConditionSet | ConditionSet} at the unconditional\n * condition set index.\n */\n public get unconditionalConditionSet(): ConditionSet {\n return this.getAt(ConditionSetCollector.UnconditionalIndex).orThrow();\n }\n\n /**\n * The index of the unconditional condition set.\n */\n public static UnconditionalIndex: ConditionSetIndex = Validate.toConditionSetIndex(0).orThrow();\n\n /**\n * Creates a new {@link Conditions.ConditionSetCollector | ConditionSetCollector}.\n * @param params - {@link Conditions.IConditionSetCollectorCreateParams | Parameters} used to create\n * the collector.\n */\n protected constructor(params: IConditionSetCollectorCreateParams) {\n super({\n converters: new Collections.KeyValueConverters<ConditionSetKey, ConditionSet>({\n key: CommonConvert.conditionSetKey,\n value: (from: unknown) => this._toConditionSet(from)\n })\n });\n this.conditions = params.conditions;\n // it's very helpful for debugging if the unconditional condition set is always\n // in position 0\n this.validating.add(ConditionSet.create({ conditions: [] }).orThrow()).orThrow();\n params.conditionSets?.forEach((item) => this.validating.add(item).orThrow());\n }\n\n /**\n * Creates a new {@link Conditions.ConditionSetCollector | ConditionSetCollector}.\n * @param params - {@link Conditions.IConditionSetCollectorCreateParams | Parameters} used to create\n * the collector.\n * @returns `Success` with the new collector if successful, or `Failure` with an error message\n * if not.\n */\n public static create(params: IConditionSetCollectorCreateParams): Result<ConditionSetCollector> {\n return captureResult(() => new ConditionSetCollector(params));\n }\n\n private _toConditionSet(from: unknown): Result<ConditionSet> {\n if (from instanceof ConditionSet) {\n return succeed(from);\n }\n if (Array.isArray(from)) {\n return mapResults(from.map((item) => this.conditions.validating.getOrAdd(item))).onSuccess(\n (conditions) => ConditionSet.create({ conditions })\n );\n }\n return validatedConditionSetDecl\n .convert(from, { conditions: this.conditions, conditionSetIndex: this.size })\n .onSuccess((c) => ConditionSet.create(c));\n }\n}\n\n/**\n * A read-only {@link Conditions.ConditionSetCollector | ConditionSetCollector}.\n * @public\n */\nexport type ReadOnlyConditionSetCollector = Collections.IReadOnlyValidatingCollector<ConditionSet>;\n"]}
1
+ {"version":3,"file":"conditionSetCollector.js","sourceRoot":"","sources":["../../../src/packlets/conditions/conditionSetCollector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAA6G;AAG7G,iDAA8C;AAC9C,uCAAsD;AACtD,sCAAmG;AAoBnG;;;;;;GAMG;AACH,MAAa,qBAAsB,SAAQ,8BAAiC;IAO1E;;;OAGG;IACH,IAAW,yBAAyB;QAClC,OAAO,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,CAAC,OAAO,EAAE,CAAC;IACxE,CAAC;IAOD;;;;OAIG;IACH,YAAsB,MAA0C;;QAC9D,KAAK,CAAC;YACJ,UAAU,EA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,CACpD,CAAC;QACJ,CAAC;QACD,uFAAuF;QACvF,OAAO,mCAAyB;aAC7B,OAAO,CAAC,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,iBAAiB,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;aAC5E,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,2BAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;;AAjEH,sDAkEC;AAnDC;;GAEG;AACW,wCAAkB,GAAsB,iBAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,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 { captureResult, Collections, mapResults, Result, succeed, ValidatingCollector } from '@fgv/ts-utils';\nimport { ConditionCollector } from './conditionCollector';\nimport { IConditionSetDecl } from './conditionSetDecls';\nimport { ConditionSet } from './conditionSet';\nimport { validatedConditionSetDecl } from './convert';\nimport { ConditionSetKey, Convert as CommonConvert, ConditionSetIndex, Validate } from '../common';\n\n/**\n * Parameters for creating a {@link Conditions.ConditionSetCollector | ConditionSetCollector}.\n * @public\n */\nexport interface IConditionSetCollectorCreateParams {\n /**\n * The {@link Conditions.ConditionCollector | ConditionCollector} used to create conditions\n * for conditions in this collector.\n */\n conditions: ConditionCollector;\n\n /**\n * Optional array of {@link Conditions.IConditionSetDecl | condition set declarations} to add to\n * the collector.\n */\n conditionSets?: IConditionSetDecl[];\n}\n\n/**\n * A `ValidatingCollector` for {@link Conditions.ConditionSet | ConditionSets},\n * which collects condition sets supplied as {@link Conditions.ConditionSet | ConditionSet} or\n * as {@link Conditions.IConditionSetDecl | IConditionSetDecl} via the methods on the\n * `validating` property.\n * @public\n */\nexport class ConditionSetCollector extends ValidatingCollector<ConditionSet> {\n /**\n * Gets the {@link Conditions.ConditionCollector | ConditionCollector} used to create conditions\n * for conditions in this collector.\n */\n public conditions: ConditionCollector;\n\n /**\n * Gets the {@link Conditions.ConditionSet | ConditionSet} at the unconditional\n * condition set index.\n */\n public get unconditionalConditionSet(): ConditionSet {\n return this.getAt(ConditionSetCollector.UnconditionalIndex).orThrow();\n }\n\n /**\n * The index of the unconditional condition set.\n */\n public static UnconditionalIndex: ConditionSetIndex = Validate.toConditionSetIndex(0).orThrow();\n\n /**\n * Creates a new {@link Conditions.ConditionSetCollector | ConditionSetCollector}.\n * @param params - {@link Conditions.IConditionSetCollectorCreateParams | Parameters} used to create\n * the collector.\n */\n protected constructor(params: IConditionSetCollectorCreateParams) {\n super({\n converters: new Collections.KeyValueConverters<ConditionSetKey, ConditionSet>({\n key: CommonConvert.conditionSetKey,\n /* c8 ignore next 1 - there's a test but coverage is having a bad day */\n value: (from: unknown) => this._toConditionSet(from)\n })\n });\n this.conditions = params.conditions;\n // it's very helpful for debugging if the unconditional condition set is always\n // in position 0\n this.validating.add(ConditionSet.create({ conditions: [] }).orThrow()).orThrow();\n /* c8 ignore next 1 - ? is defense in depth */\n params.conditionSets?.forEach((item) => this.validating.add(item).orThrow());\n }\n\n /**\n * Creates a new {@link Conditions.ConditionSetCollector | ConditionSetCollector}.\n * @param params - {@link Conditions.IConditionSetCollectorCreateParams | Parameters} used to create\n * the collector.\n * @returns `Success` with the new collector if successful, or `Failure` with an error message\n * if not.\n */\n public static create(params: IConditionSetCollectorCreateParams): Result<ConditionSetCollector> {\n return captureResult(() => new ConditionSetCollector(params));\n }\n\n private _toConditionSet(from: unknown): Result<ConditionSet> {\n if (from instanceof ConditionSet) {\n return succeed(from);\n }\n if (Array.isArray(from)) {\n return mapResults(from.map((item) => this.conditions.validating.getOrAdd(item))).onSuccess(\n (conditions) => ConditionSet.create({ conditions })\n );\n }\n /* c8 ignore next 4 - functional code path tested but coverage intermittently missed */\n return validatedConditionSetDecl\n .convert(from, { conditions: this.conditions, conditionSetIndex: this.size })\n .onSuccess((c) => ConditionSet.create(c));\n }\n}\n\n/**\n * A read-only {@link Conditions.ConditionSetCollector | ConditionSetCollector}.\n * @public\n */\nexport type ReadOnlyConditionSetCollector = Collections.IReadOnlyValidatingCollector<ConditionSet>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"conditionToken.d.ts","sourceRoot":"","sources":["../../../src/packlets/conditions/conditionToken.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAc,MAAM,EAAiB,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAqB,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEvE;;;GAGG;AACH,qBAAa,eAAe;IAC1B;;;OAGG;IACH,SAAgB,UAAU,EAAE,2BAA2B,CAAC;IAExD;;;OAGG;gBACgB,UAAU,EAAE,2BAA2B;IAI1D;;;;;;OAMG;IACI,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,uBAAuB,CAAC;IAI1E;;;;;;OAMG;IACI,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,uBAAuB,EAAE,CAAC;IAI/E;;;;OAIG;IACI,2BAA2B,CAChC,KAAK,EAAE,aAAa,CAAC,oBAAoB,GACxC,MAAM,CAAC,uBAAuB,CAAC;IAIlC;;;;;OAKG;IACI,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;IAI9D;;;;;;;OAOG;WACW,mBAAmB,CAC/B,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,uBAAuB,CAAC;IAMlC;;;;;;;OAOG;WACW,sBAAsB,CAClC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,uBAAuB,EAAE,CAAC;IAMpC;;;;;;;;OAQG;WACW,2BAA2B,CACvC,KAAK,EAAE,aAAa,CAAC,oBAAoB,EACzC,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,uBAAuB,CAAC;IAkBlC;;;;;;OAMG;WACW,qBAAqB,CACjC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,SAAS,CAAC;CAerB"}
1
+ {"version":3,"file":"conditionToken.d.ts","sourceRoot":"","sources":["../../../src/packlets/conditions/conditionToken.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAc,MAAM,EAAiB,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAqB,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEvE;;;GAGG;AACH,qBAAa,eAAe;IAC1B;;;OAGG;IACH,SAAgB,UAAU,EAAE,2BAA2B,CAAC;IAExD;;;OAGG;gBACgB,UAAU,EAAE,2BAA2B;IAI1D;;;;;;OAMG;IACI,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,uBAAuB,CAAC;IAI1E;;;;;;OAMG;IACI,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,uBAAuB,EAAE,CAAC;IAI/E;;;;OAIG;IACI,2BAA2B,CAChC,KAAK,EAAE,aAAa,CAAC,oBAAoB,GACxC,MAAM,CAAC,uBAAuB,CAAC;IAIlC;;;;;OAKG;IACI,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;IAI9D;;;;;;;OAOG;WACW,mBAAmB,CAC/B,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,uBAAuB,CAAC;IAMlC;;;;;;;OAOG;WACW,sBAAsB,CAClC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,uBAAuB,EAAE,CAAC;IAMpC;;;;;;;;OAQG;WACW,2BAA2B,CACvC,KAAK,EAAE,aAAa,CAAC,oBAAoB,EACzC,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,uBAAuB,CAAC;IAkBlC;;;;;;OAMG;WACW,qBAAqB,CACjC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,SAAS,CAAC;CAgBrB"}
@@ -133,13 +133,14 @@ class ConditionTokens {
133
133
  static findQualifierForValue(value, qualifiers) {
134
134
  const matched = [];
135
135
  for (const qualifier of qualifiers.values()) {
136
- if (qualifier.tokenIsOptional && qualifier.type.validateCondition(value).isSuccess()) {
136
+ if (qualifier.tokenIsOptional && qualifier.validateCondition(value).isSuccess()) {
137
137
  matched.push(qualifier);
138
138
  }
139
139
  }
140
140
  if (matched.length === 0) {
141
141
  return (0, ts_utils_1.fail)(`${value}: does not match any qualifier`);
142
142
  }
143
+ /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
143
144
  if (matched.length > 1) {
144
145
  return (0, ts_utils_1.fail)(`${value}: matches multiple qualifiers (${matched.map((q) => q.name).join(', ')})`);
145
146
  }
@@ -1 +1 @@
1
- {"version":3,"file":"conditionToken.js","sourceRoot":"","sources":["../../../src/packlets/conditions/conditionToken.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAkE;AAClE,sCAAwE;AAIxE;;;GAGG;AACH,MAAa,eAAe;IAO1B;;;OAGG;IACH,YAAmB,UAAuC;QACxD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACI,mBAAmB,CAAC,KAAa;QACtC,OAAO,eAAe,CAAC,mBAAmB,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;OAMG;IACI,sBAAsB,CAAC,KAAa;QACzC,OAAO,eAAe,CAAC,sBAAsB,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACxE,CAAC;IAED;;;;OAIG;IACI,2BAA2B,CAChC,KAAyC;QAEzC,OAAO,eAAe,CAAC,2BAA2B,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;OAKG;IACI,qBAAqB,CAAC,KAAa;QACxC,OAAO,eAAe,CAAC,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACvE,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,CAAC,mBAAmB,CAC/B,KAAa,EACb,UAAuC;QAEvC,OAAO,gBAAa,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;YACvE,OAAO,eAAe,CAAC,2BAA2B,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QACxE,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,C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AAM,EAAE,EAAE,CAAC;YAC5C,IAAI,SAAS,CAAC,eAAe,IAAI,SAAS,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC;gBACrF,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,IAAA,eAAI,EAAC,GAAG,KAAK,gCAAgC,CAAC,CAAC;QACxD,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,IAAA,eAAI,EAAC,GAAG,KAAK,kCAAkC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClG,CAAC;QACD,OAAO,IAAA,kBAAO,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;CACF;AAnJD,0CAmJC","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 { mapResults, Result, fail, succeed } from '@fgv/ts-utils';\nimport { Helpers as CommonHelpers, ConditionOperator } from '../common';\nimport { IValidatedConditionDecl } from './conditionDecls';\nimport { IReadOnlyQualifierCollector, Qualifier } from '../qualifiers';\n\n/**\n * Helper class to parse and validate condition tokens.\n * @public\n */\nexport class ConditionTokens {\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} used to validate\n * qualifier names and values.\n */\n public readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Constructs a new {@link Conditions.ConditionTokens | ConditionTokens } instance.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n */\n public constructor(qualifiers: IReadOnlyQualifierCollector) {\n this.qualifiers = qualifiers;\n }\n\n /**i\n * Parses a {@link ConditionToken | condition token} string and validates the parts\n * against the qualifiers present in the {@link Conditions.ConditionTokens.qualifiers | qualifier collector}.\n * @param token - the token string to parse.\n * @returns `Success` with the {@link Conditions.IValidatedConditionDecl | validated condition declaration}\n * if successful, `Failure` with an error message if not.\n */\n public parseConditionToken(token: string): Result<IValidatedConditionDecl> {\n return ConditionTokens.parseConditionToken(token, this.qualifiers);\n }\n\n /**\n * Parses a {@link ConditionSetToken | condition set token} string and validates the parts\n * against the qualifiers present in the {@link Conditions.ConditionTokens.qualifiers | qualifier collector}.\n * @param token - the token string to parse.\n * @returns `Success` with the array of {@link Conditions.IValidatedConditionDecl | validated condition declarations}\n * if successful, `Failure` with an error message if not.\n */\n public parseConditionSetToken(token: string): Result<IValidatedConditionDecl[]> {\n return ConditionTokens.parseConditionSetToken(token, this.qualifiers);\n }\n\n /**\n * Validates the {@link Helpers.IConditionTokenParts | parts} of a {@link ConditionToken | condition token}.\n * @param parts - the parts to validate\n * @returns `Success` with the validated declaration if successful, `Failure` with an error message if not.\n */\n public validateConditionTokenParts(\n parts: CommonHelpers.IConditionTokenParts\n ): Result<IValidatedConditionDecl> {\n return ConditionTokens.validateConditionTokenParts(parts, this.qualifiers);\n }\n\n /**\n * Given a value, finds a single token-optional qualifier that matches the value.\n * Fails if no qualifiers match, or if more than one qualifier matches.\n * @param value - the value to match.\n * @returns `Success` with the matching qualifier if successful, `Failure` with an error message if not.\n */\n public findQualifierForValue(value: string): Result<Qualifier> {\n return ConditionTokens.findQualifierForValue(value, this.qualifiers);\n }\n\n /**\n * Parses a {@link ConditionToken | condition token} and validates it against the qualifiers\n * present in the supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param token - the token string to parse.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n * @returns `Success` with a {@link Conditions.IValidatedConditionDecl | validated condition declaration} if successful,\n * `Failure` with an error message if not.\n */\n public static parseConditionToken(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedConditionDecl> {\n return CommonHelpers.parseConditionTokenParts(token).onSuccess((parts) => {\n return ConditionTokens.validateConditionTokenParts(parts, qualifiers);\n });\n }\n\n /**\n * Parses a {@link ConditionSetToken | condition set token} and validates it against the qualifiers\n * present in the supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param token - the token string to parse.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n * @returns `Success` with an array of {@link Conditions.IValidatedConditionDecl | validated condition declarations}\n * if successful, `Failure` with an error message if not\n */\n public static parseConditionSetToken(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedConditionDecl[]> {\n return CommonHelpers.parseConditionSetTokenParts(token).onSuccess((parts) => {\n return mapResults(parts.map((part) => ConditionTokens.validateConditionTokenParts(part, qualifiers)));\n });\n }\n\n /**\n * Validates the parts of a condition token against the qualifiers present in the supplied\n * {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param parts - the {@link Helpers.IConditionTokenParts | condition token parts} to validate.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} used to\n * validate qualifier names and values.\n * @returns `Success` with a {@link Conditions.IValidatedConditionDecl | validated condition declaration} if successful,\n * `Failure` with an error message if not.\n */\n public static validateConditionTokenParts(\n parts: CommonHelpers.IConditionTokenParts,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedConditionDecl> {\n const qualifierLookup =\n parts.qualifier === undefined\n ? ConditionTokens.findQualifierForValue(parts.value, qualifiers)\n : qualifiers.getByNameOrToken(parts.qualifier);\n\n return qualifierLookup.onSuccess((qualifier) => {\n return qualifier.type\n .validateCondition(parts.value)\n .onSuccess((value) => {\n const operator: ConditionOperator = 'matches';\n const priority = qualifier.defaultPriority;\n return succeed({ qualifier, value, operator, priority });\n })\n .withDetail('failure', 'success');\n });\n }\n\n /**\n * Given a value and a set of qualifiers, finds a single token-optional qualifier that matches the value.\n * Fails if no qualifiers match, or if more than one qualifier matches.\n * @param value - the value to match.\n * @param qualifiers - the qualifiers to match against.\n * @returns `Success` with the matching qualifier if successful, `Failure` with an error message if not.\n */\n public static findQualifierForValue(\n value: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<Qualifier> {\n const matched: Qualifier[] = [];\n for (const qualifier of qualifiers.values()) {\n if (qualifier.tokenIsOptional && qualifier.type.validateCondition(value).isSuccess()) {\n matched.push(qualifier);\n }\n }\n if (matched.length === 0) {\n return fail(`${value}: does not match any qualifier`);\n }\n if (matched.length > 1) {\n return fail(`${value}: matches multiple qualifiers (${matched.map((q) => q.name).join(', ')})`);\n }\n return succeed(matched[0]);\n }\n}\n"]}
1
+ {"version":3,"file":"conditionToken.js","sourceRoot":"","sources":["../../../src/packlets/conditions/conditionToken.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAkE;AAClE,sCAAwE;AAIxE;;;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C,GAAG,KAAK,gCAAgC,CAAC,CAAC;QACxD,CAAC;QACD,uFAAuF;QACvF,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,IAAA,eAAI,EAAC,GAAG,KAAK,kCAAkC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClG,CAAC;QACD,OAAO,IAAA,kBAAO,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;CACF;AApJD,0CAoJC","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 { mapResults, Result, fail, succeed } from '@fgv/ts-utils';\nimport { Helpers as CommonHelpers, ConditionOperator } from '../common';\nimport { IValidatedConditionDecl } from './conditionDecls';\nimport { IReadOnlyQualifierCollector, Qualifier } from '../qualifiers';\n\n/**\n * Helper class to parse and validate condition tokens.\n * @public\n */\nexport class ConditionTokens {\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} used to validate\n * qualifier names and values.\n */\n public readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Constructs a new {@link Conditions.ConditionTokens | ConditionTokens } instance.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n */\n public constructor(qualifiers: IReadOnlyQualifierCollector) {\n this.qualifiers = qualifiers;\n }\n\n /**i\n * Parses a {@link ConditionToken | condition token} string and validates the parts\n * against the qualifiers present in the {@link Conditions.ConditionTokens.qualifiers | qualifier collector}.\n * @param token - the token string to parse.\n * @returns `Success` with the {@link Conditions.IValidatedConditionDecl | validated condition declaration}\n * if successful, `Failure` with an error message if not.\n */\n public parseConditionToken(token: string): Result<IValidatedConditionDecl> {\n return ConditionTokens.parseConditionToken(token, this.qualifiers);\n }\n\n /**\n * Parses a {@link ConditionSetToken | condition set token} string and validates the parts\n * against the qualifiers present in the {@link Conditions.ConditionTokens.qualifiers | qualifier collector}.\n * @param token - the token string to parse.\n * @returns `Success` with the array of {@link Conditions.IValidatedConditionDecl | validated condition declarations}\n * if successful, `Failure` with an error message if not.\n */\n public parseConditionSetToken(token: string): Result<IValidatedConditionDecl[]> {\n return ConditionTokens.parseConditionSetToken(token, this.qualifiers);\n }\n\n /**\n * Validates the {@link Helpers.IConditionTokenParts | parts} of a {@link ConditionToken | condition token}.\n * @param parts - the parts to validate\n * @returns `Success` with the validated declaration if successful, `Failure` with an error message if not.\n */\n public validateConditionTokenParts(\n parts: CommonHelpers.IConditionTokenParts\n ): Result<IValidatedConditionDecl> {\n return ConditionTokens.validateConditionTokenParts(parts, this.qualifiers);\n }\n\n /**\n * Given a value, finds a single token-optional qualifier that matches the value.\n * Fails if no qualifiers match, or if more than one qualifier matches.\n * @param value - the value to match.\n * @returns `Success` with the matching qualifier if successful, `Failure` with an error message if not.\n */\n public findQualifierForValue(value: string): Result<Qualifier> {\n return ConditionTokens.findQualifierForValue(value, this.qualifiers);\n }\n\n /**\n * Parses a {@link ConditionToken | condition token} and validates it against the qualifiers\n * present in the supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param token - the token string to parse.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n * @returns `Success` with a {@link Conditions.IValidatedConditionDecl | validated condition declaration} if successful,\n * `Failure` with an error message if not.\n */\n public static parseConditionToken(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedConditionDecl> {\n return CommonHelpers.parseConditionTokenParts(token).onSuccess((parts) => {\n return ConditionTokens.validateConditionTokenParts(parts, qualifiers);\n });\n }\n\n /**\n * Parses a {@link ConditionSetToken | condition set token} and validates it against the qualifiers\n * present in the supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param token - the token string to parse.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n * @returns `Success` with an array of {@link Conditions.IValidatedConditionDecl | validated condition declarations}\n * if successful, `Failure` with an error message if not\n */\n public static parseConditionSetToken(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedConditionDecl[]> {\n return CommonHelpers.parseConditionSetTokenParts(token).onSuccess((parts) => {\n return mapResults(parts.map((part) => ConditionTokens.validateConditionTokenParts(part, qualifiers)));\n });\n }\n\n /**\n * Validates the parts of a condition token against the qualifiers present in the supplied\n * {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param parts - the {@link Helpers.IConditionTokenParts | condition token parts} to validate.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} used to\n * validate qualifier names and values.\n * @returns `Success` with a {@link Conditions.IValidatedConditionDecl | validated condition declaration} if successful,\n * `Failure` with an error message if not.\n */\n public static validateConditionTokenParts(\n parts: CommonHelpers.IConditionTokenParts,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedConditionDecl> {\n const qualifierLookup =\n parts.qualifier === undefined\n ? ConditionTokens.findQualifierForValue(parts.value, qualifiers)\n : qualifiers.getByNameOrToken(parts.qualifier);\n\n return qualifierLookup.onSuccess((qualifier) => {\n return qualifier.type\n .validateCondition(parts.value)\n .onSuccess((value) => {\n const operator: ConditionOperator = 'matches';\n const priority = qualifier.defaultPriority;\n return succeed({ qualifier, value, operator, priority });\n })\n .withDetail('failure', 'success');\n });\n }\n\n /**\n * Given a value and a set of qualifiers, finds a single token-optional qualifier that matches the value.\n * Fails if no qualifiers match, or if more than one qualifier matches.\n * @param value - the value to match.\n * @param qualifiers - the qualifiers to match against.\n * @returns `Success` with the matching qualifier if successful, `Failure` with an error message if not.\n */\n public static findQualifierForValue(\n value: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<Qualifier> {\n const matched: Qualifier[] = [];\n for (const qualifier of qualifiers.values()) {\n if (qualifier.tokenIsOptional && qualifier.validateCondition(value).isSuccess()) {\n matched.push(qualifier);\n }\n }\n if (matched.length === 0) {\n return fail(`${value}: does not match any qualifier`);\n }\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (matched.length > 1) {\n return fail(`${value}: matches multiple qualifiers (${matched.map((q) => q.name).join(', ')})`);\n }\n return succeed(matched[0]);\n }\n}\n"]}
@@ -86,7 +86,7 @@ exports.validatedConditionDecl = ts_utils_1.Converters.generic((from, __self, co
86
86
  return context.qualifiers.validating.get(decl.qualifierName).onSuccess((qualifier) => {
87
87
  return (0, ts_utils_1.populateObject)({
88
88
  qualifier: () => (0, ts_utils_1.succeed)(qualifier),
89
- value: () => qualifier.type.validateCondition(decl.value, operator),
89
+ value: () => qualifier.validateCondition(decl.value, operator),
90
90
  operator: () => (0, ts_utils_1.succeed)(operator),
91
91
  priority: () => decl.priority
92
92
  ? Common.Convert.conditionPriority.convert(decl.priority)
@@ -1 +1 @@
1
- {"version":3,"file":"decls.js","sourceRoot":"","sources":["../../../../src/packlets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;gBACnE,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAA,kBAAO,EAAC,QAAQ,CAAC;gBACjC,QAAQ,EAAE,GAAG,EAAE,CACb,IAAI,CAAC,QAAQ;oBACX,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;oBACzD,CAAC,CAAC,IAAA,kBAAO,EAAC,SAAS,CAAC,eAAe,CAAC;gBACxC,cAAc,EAAE,GAAG,EAAE,CACnB,IAAI,CAAC,cAAc;oBACjB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC;oBACjE,CAAC,CAAC,IAAA,kBAAO,EAAC,SAAS,CAAC;gBACxB,KAAK,EAAE,GAAG,EAAE,CACV,OAAO,CAAC,cAAc;oBACpB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC;oBAC/D,CAAC,CAAC,IAAA,kBAAO,EAAC,SAAS,CAAC;aACzB,CAAC;iBACC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE;gBACpB,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;oBACzC,OAAO,CAAC,cAAc,EAAE,CAAC;gBAC3B,CAAC;gBACD,OAAO,IAAA,kBAAO,EAAC,MAAM,CAAC,CAAC;YACzB,CAAC,CAAC;iBACD,UAAU,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,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 * as Common from '../../common';\nimport { Converters, populateObject, Result, fail, succeed } from '@fgv/ts-utils';\nimport { IConditionDecl, IValidatedConditionDecl } from '../conditionDecls';\nimport { IReadOnlyQualifierCollector } from '../../qualifiers';\n\n/* eslint-disable @rushstack/typedef-var */\n\n/**\n * Converter for a {@link Conditions.IConditionDecl | condition declaration}.\n * @public\n */\nexport const conditionDecl = Converters.strictObject<IConditionDecl>({\n qualifierName: Converters.string,\n value: Converters.string,\n operator: Common.Convert.conditionOperator.optional(),\n priority: Converters.number.optional(),\n scoreAsDefault: Converters.number.optional()\n});\n\n/**\n * Conversion context to uses when converting\n * a {@link Conditions.IValidatedConditionDecl | validated condition declaration}.\n * @public\n */\nexport interface IConditionDeclConvertContext {\n readonly qualifiers: IReadOnlyQualifierCollector;\n conditionIndex?: number;\n}\n\n/**\n * Converter which constructs a {@link Conditions.IValidatedConditionDecl | validated condition declaration}\n * from a {@link Conditions.IConditionDecl | condition declaration}, instantiating qualifiers by name\n * from a supplied {@link Conditions.Convert.IConditionDeclConvertContext | conversion context}.\n * @public\n */\nexport const validatedConditionDecl = Converters.generic<\n IValidatedConditionDecl,\n IConditionDeclConvertContext\n>((from: unknown, __self, context?: IConditionDeclConvertContext): Result<IValidatedConditionDecl> => {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!context) {\n return fail('validatedConditionDecl converter requires a context');\n }\n return conditionDecl.convert(from).onSuccess((decl) => {\n const operator = decl.operator ?? 'matches';\n return context.qualifiers.validating.get(decl.qualifierName).onSuccess((qualifier) => {\n return populateObject<IValidatedConditionDecl>({\n qualifier: () => succeed(qualifier),\n value: () => qualifier.type.validateCondition(decl.value, operator),\n operator: () => succeed(operator),\n priority: () =>\n decl.priority\n ? Common.Convert.conditionPriority.convert(decl.priority)\n : succeed(qualifier.defaultPriority),\n scoreAsDefault: () =>\n decl.scoreAsDefault\n ? Common.Convert.qualifierMatchScore.convert(decl.scoreAsDefault)\n : succeed(undefined),\n index: () =>\n context.conditionIndex\n ? Common.Convert.conditionIndex.convert(context.conditionIndex)\n : succeed(undefined)\n })\n .onSuccess((result) => {\n if (context.conditionIndex !== undefined) {\n context.conditionIndex++;\n }\n return succeed(result);\n })\n .withDetail('success');\n });\n });\n});\n"]}
1
+ {"version":3,"file":"decls.js","sourceRoot":"","sources":["../../../../src/packlets/conditions/convert/decls.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,qDAAuC;AACvC,4CAAkF;AAIlF,2CAA2C;AAE3C;;;GAGG;AACU,QAAA,aAAa,GAAG,qBAAU,CAAC,YAAY,CAAiB;IACnE,aAAa,EAAE,qBAAU,CAAC,MAAM;IAChC,KAAK,EAAE,qBAAU,CAAC,MAAM;IACxB,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,QAAQ,EAAE;IACrD,QAAQ,EAAE,qBAAU,CAAC,MAAM,CAAC,QAAQ,EAAE;IACtC,cAAc,EAAE,qBAAU,CAAC,MAAM,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC;AAYH;;;;;GAKG;AACU,QAAA,sBAAsB,GAAG,qBAAU,CAAC,OAAO,CAGtD,CA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C,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC;oBAC/D,CAAC,CAAC,IAAA,kBAAO,EAAC,SAAS,CAAC;aACzB,CAAC;iBACC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE;gBACpB,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;oBACzC,OAAO,CAAC,cAAc,EAAE,CAAC;gBAC3B,CAAC;gBACD,OAAO,IAAA,kBAAO,EAAC,MAAM,CAAC,CAAC;YACzB,CAAC,CAAC;iBACD,UAAU,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,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 * as Common from '../../common';\nimport { Converters, populateObject, Result, fail, succeed } from '@fgv/ts-utils';\nimport { IConditionDecl, IValidatedConditionDecl } from '../conditionDecls';\nimport { IReadOnlyQualifierCollector } from '../../qualifiers';\n\n/* eslint-disable @rushstack/typedef-var */\n\n/**\n * Converter for a {@link Conditions.IConditionDecl | condition declaration}.\n * @public\n */\nexport const conditionDecl = Converters.strictObject<IConditionDecl>({\n qualifierName: Converters.string,\n value: Converters.string,\n operator: Common.Convert.conditionOperator.optional(),\n priority: Converters.number.optional(),\n scoreAsDefault: Converters.number.optional()\n});\n\n/**\n * Conversion context to uses when converting\n * a {@link Conditions.IValidatedConditionDecl | validated condition declaration}.\n * @public\n */\nexport interface IConditionDeclConvertContext {\n readonly qualifiers: IReadOnlyQualifierCollector;\n conditionIndex?: number;\n}\n\n/**\n * Converter which constructs a {@link Conditions.IValidatedConditionDecl | validated condition declaration}\n * from a {@link Conditions.IConditionDecl | condition declaration}, instantiating qualifiers by name\n * from a supplied {@link Conditions.Convert.IConditionDeclConvertContext | conversion context}.\n * @public\n */\nexport const validatedConditionDecl = Converters.generic<\n IValidatedConditionDecl,\n IConditionDeclConvertContext\n>((from: unknown, __self, context?: IConditionDeclConvertContext): Result<IValidatedConditionDecl> => {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!context) {\n return fail('validatedConditionDecl converter requires a context');\n }\n return conditionDecl.convert(from).onSuccess((decl) => {\n const operator = decl.operator ?? 'matches';\n return context.qualifiers.validating.get(decl.qualifierName).onSuccess((qualifier) => {\n return populateObject<IValidatedConditionDecl>({\n qualifier: () => succeed(qualifier),\n value: () => qualifier.validateCondition(decl.value, operator),\n operator: () => succeed(operator),\n priority: () =>\n decl.priority\n ? Common.Convert.conditionPriority.convert(decl.priority)\n : succeed(qualifier.defaultPriority),\n scoreAsDefault: () =>\n decl.scoreAsDefault\n ? Common.Convert.qualifierMatchScore.convert(decl.scoreAsDefault)\n : succeed(undefined),\n index: () =>\n context.conditionIndex\n ? Common.Convert.conditionIndex.convert(context.conditionIndex)\n : succeed(undefined)\n })\n .onSuccess((result) => {\n if (context.conditionIndex !== undefined) {\n context.conditionIndex++;\n }\n return succeed(result);\n })\n .withDetail('success');\n });\n });\n});\n"]}
@@ -0,0 +1,35 @@
1
+ import { Result } from '@fgv/ts-utils';
2
+ import { ISystemConfiguration } from './json';
3
+ import { SystemConfiguration, ISystemConfigurationInitParams } from './systemConfiguration';
4
+ /**
5
+ * A `string` literal type representing a well-known predefined system configuration.
6
+ * @public
7
+ */
8
+ export type PredefinedSystemConfiguration = 'default' | 'language-priority' | 'territory-priority' | 'extended-example';
9
+ /**
10
+ * An array of all well-known predefined system configurations.
11
+ * @public
12
+ */
13
+ export declare const allPredefinedSystemConfigurations: ReadonlyArray<PredefinedSystemConfiguration>;
14
+ export * from './predefined';
15
+ /**
16
+ * Returns the {@link Config.Model.ISystemConfiguration | system configuration} declaration for the
17
+ * specified predefined system configuration.
18
+ * @param name - The name of the predefined system configuration.
19
+ * @param initParams - Optional {@link Config.ISystemConfigurationInitParams | initialization parameters}.
20
+ * @returns `Success` with the {@link Config.Model.ISystemConfiguration | system configuration}
21
+ * declaration if successful, `Failure` with an error message otherwise.
22
+ * @public
23
+ */
24
+ export declare function getPredefinedDeclaration(name: PredefinedSystemConfiguration, initParams?: ISystemConfigurationInitParams): Result<ISystemConfiguration>;
25
+ /**
26
+ * Returns the {@link Config.SystemConfiguration | SystemConfiguration} for the specified
27
+ * predefined system configuration.
28
+ * @param name - The name of the predefined system configuration.
29
+ * @param initParams - Optional {@link Config.ISystemConfigurationInitParams | initialization parameters}.
30
+ * @returns `Success` with the {@link Config.SystemConfiguration | SystemConfiguration}
31
+ * if successful, `Failure` with an error message otherwise.
32
+ * @public
33
+ */
34
+ export declare function getPredefinedSystemConfiguration(name: PredefinedSystemConfiguration, initParams?: ISystemConfigurationInitParams): Result<SystemConfiguration>;
35
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/packlets/config/common.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAAQ,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,mBAAmB,EACnB,8BAA8B,EAE/B,MAAM,uBAAuB,CAAC;AAI/B;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GACrC,SAAS,GACT,mBAAmB,GACnB,oBAAoB,GACpB,kBAAkB,CAAC;AAEvB;;;GAGG;AACH,eAAO,MAAM,iCAAiC,EAAE,aAAa,CAAC,6BAA6B,CAK1F,CAAC;AAEF,cAAc,cAAc,CAAC;AAS7B;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,6BAA6B,EACnC,UAAU,CAAC,EAAE,8BAA8B,GAC1C,MAAM,CAAC,oBAAoB,CAAC,CAY9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,6BAA6B,EACnC,UAAU,CAAC,EAAE,8BAA8B,GAC1C,MAAM,CAAC,mBAAmB,CAAC,CAM7B"}
@@ -0,0 +1,96 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
35
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
36
+ };
37
+ Object.defineProperty(exports, "__esModule", { value: true });
38
+ exports.allPredefinedSystemConfigurations = void 0;
39
+ exports.getPredefinedDeclaration = getPredefinedDeclaration;
40
+ exports.getPredefinedSystemConfiguration = getPredefinedSystemConfiguration;
41
+ const ts_utils_1 = require("@fgv/ts-utils");
42
+ const systemConfiguration_1 = require("./systemConfiguration");
43
+ const ts_json_base_1 = require("@fgv/ts-json-base");
44
+ const predefined_1 = require("./predefined");
45
+ /**
46
+ * An array of all well-known predefined system configurations.
47
+ * @public
48
+ */
49
+ exports.allPredefinedSystemConfigurations = [
50
+ 'default',
51
+ 'language-priority',
52
+ 'territory-priority',
53
+ 'extended-example'
54
+ ];
55
+ __exportStar(require("./predefined"), exports);
56
+ const predefinedDecls = {
57
+ default: predefined_1.Default.DefaultSystemConfiguration,
58
+ 'language-priority': predefined_1.Default.LanguagePrioritySystemConfiguration,
59
+ 'territory-priority': predefined_1.Default.TerritoryPrioritySystemConfiguration,
60
+ 'extended-example': predefined_1.Example.ExtendedSystemConfiguration
61
+ };
62
+ /**
63
+ * Returns the {@link Config.Model.ISystemConfiguration | system configuration} declaration for the
64
+ * specified predefined system configuration.
65
+ * @param name - The name of the predefined system configuration.
66
+ * @param initParams - Optional {@link Config.ISystemConfigurationInitParams | initialization parameters}.
67
+ * @returns `Success` with the {@link Config.Model.ISystemConfiguration | system configuration}
68
+ * declaration if successful, `Failure` with an error message otherwise.
69
+ * @public
70
+ */
71
+ function getPredefinedDeclaration(name, initParams) {
72
+ if (name in predefinedDecls) {
73
+ const baseConfig = (0, ts_json_base_1.sanitizeJsonObject)(predefinedDecls[name]);
74
+ if (initParams === null || initParams === void 0 ? void 0 : initParams.qualifierDefaultValues) {
75
+ return baseConfig.onSuccess((config) => (0, systemConfiguration_1.updateSystemConfigurationQualifierDefaultValues)(config, initParams.qualifierDefaultValues));
76
+ }
77
+ return baseConfig;
78
+ }
79
+ return (0, ts_utils_1.fail)(`Unknown predefined system configuration: ${name}`);
80
+ }
81
+ /**
82
+ * Returns the {@link Config.SystemConfiguration | SystemConfiguration} for the specified
83
+ * predefined system configuration.
84
+ * @param name - The name of the predefined system configuration.
85
+ * @param initParams - Optional {@link Config.ISystemConfigurationInitParams | initialization parameters}.
86
+ * @returns `Success` with the {@link Config.SystemConfiguration | SystemConfiguration}
87
+ * if successful, `Failure` with an error message otherwise.
88
+ * @public
89
+ */
90
+ function getPredefinedSystemConfiguration(name, initParams) {
91
+ if (name in predefinedDecls) {
92
+ return systemConfiguration_1.SystemConfiguration.create(predefinedDecls[name], initParams);
93
+ }
94
+ return (0, ts_utils_1.fail)(`Unknown predefined system configuration: ${name}`);
95
+ }
96
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/packlets/config/common.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;AAmDH,4DAeC;AAWD,4EASC;AApFD,4CAA6C;AAE7C,+DAI+B;AAC/B,oDAAuD;AACvD,6CAAgD;AAYhD;;;GAGG;AACU,QAAA,iCAAiC,GAAiD;IAC7F,SAAS;IACT,mBAAmB;IACnB,oBAAoB;IACpB,kBAAkB;CACnB,CAAC;AAEF,+CAA6B;AAE7B,MAAM,eAAe,GAAgE;IACnF,OAAO,EAAE,oBAAO,CAAC,0BAA0B;IAC3C,mBAAmB,EAAE,oBAAO,CAAC,mCAAmC;IAChE,oBAAoB,EAAE,oBAAO,CAAC,oCAAoC;IAClE,kBAAkB,EAAE,oBAAO,CAAC,2BAA2B;CACxD,CAAC;AAEF;;;;;;;;GAQG;AACH,SAAgB,wBAAwB,CACtC,IAAmC,EACnC,UAA2C;IAE3C,IAAI,IAAI,IAAI,eAAe,EAAE,CAAC;QAC5B,MAAM,UAAU,GAAG,IAAA,iCAAkB,EAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7D,IAAI,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,sBAAsB,EAAE,CAAC;YACvC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CACrC,IAAA,qEAA+C,EAAC,MAAM,EAAE,UAAU,CAAC,sBAAuB,CAAC,CAC5F,CAAC;QACJ,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,OAAO,IAAA,eAAI,EAAC,4CAA4C,IAAI,EAAE,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,gCAAgC,CAC9C,IAAmC,EACnC,UAA2C;IAE3C,IAAI,IAAI,IAAI,eAAe,EAAE,CAAC;QAC5B,OAAO,yCAAmB,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,IAAA,eAAI,EAAC,4CAA4C,IAAI,EAAE,CAAC,CAAC;AAClE,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 { Result, fail } from '@fgv/ts-utils';\nimport { ISystemConfiguration } from './json';\nimport {\n SystemConfiguration,\n ISystemConfigurationInitParams,\n updateSystemConfigurationQualifierDefaultValues\n} from './systemConfiguration';\nimport { sanitizeJsonObject } from '@fgv/ts-json-base';\nimport { Default, Example } from './predefined';\n\n/**\n * A `string` literal type representing a well-known predefined system configuration.\n * @public\n */\nexport type PredefinedSystemConfiguration =\n | 'default'\n | 'language-priority'\n | 'territory-priority'\n | 'extended-example';\n\n/**\n * An array of all well-known predefined system configurations.\n * @public\n */\nexport const allPredefinedSystemConfigurations: ReadonlyArray<PredefinedSystemConfiguration> = [\n 'default',\n 'language-priority',\n 'territory-priority',\n 'extended-example'\n];\n\nexport * from './predefined';\n\nconst predefinedDecls: Record<PredefinedSystemConfiguration, ISystemConfiguration> = {\n default: Default.DefaultSystemConfiguration,\n 'language-priority': Default.LanguagePrioritySystemConfiguration,\n 'territory-priority': Default.TerritoryPrioritySystemConfiguration,\n 'extended-example': Example.ExtendedSystemConfiguration\n};\n\n/**\n * Returns the {@link Config.Model.ISystemConfiguration | system configuration} declaration for the\n * specified predefined system configuration.\n * @param name - The name of the predefined system configuration.\n * @param initParams - Optional {@link Config.ISystemConfigurationInitParams | initialization parameters}.\n * @returns `Success` with the {@link Config.Model.ISystemConfiguration | system configuration}\n * declaration if successful, `Failure` with an error message otherwise.\n * @public\n */\nexport function getPredefinedDeclaration(\n name: PredefinedSystemConfiguration,\n initParams?: ISystemConfigurationInitParams\n): Result<ISystemConfiguration> {\n if (name in predefinedDecls) {\n const baseConfig = sanitizeJsonObject(predefinedDecls[name]);\n if (initParams?.qualifierDefaultValues) {\n return baseConfig.onSuccess((config) =>\n updateSystemConfigurationQualifierDefaultValues(config, initParams.qualifierDefaultValues!)\n );\n }\n return baseConfig;\n }\n\n return fail(`Unknown predefined system configuration: ${name}`);\n}\n\n/**\n * Returns the {@link Config.SystemConfiguration | SystemConfiguration} for the specified\n * predefined system configuration.\n * @param name - The name of the predefined system configuration.\n * @param initParams - Optional {@link Config.ISystemConfigurationInitParams | initialization parameters}.\n * @returns `Success` with the {@link Config.SystemConfiguration | SystemConfiguration}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\nexport function getPredefinedSystemConfiguration(\n name: PredefinedSystemConfiguration,\n initParams?: ISystemConfigurationInitParams\n): Result<SystemConfiguration> {\n if (name in predefinedDecls) {\n return SystemConfiguration.create(predefinedDecls[name], initParams);\n }\n\n return fail(`Unknown predefined system configuration: ${name}`);\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import { ISystemConfiguration } from './json';
2
+ /**
3
+ * A `Converter` for {@link Config.Model.ISystemConfiguration | ISystemConfiguration} objects.
4
+ * @returns A `Converter` for {@link Config.Model.ISystemConfiguration | ISystemConfiguration} objects.
5
+ * @public
6
+ */
7
+ export declare const systemConfiguration: import("@fgv/ts-utils").ObjectConverter<ISystemConfiguration, unknown>;
8
+ /**
9
+ * A `Converter` for {@link Config.PredefinedSystemConfiguration | PredefinedSystemConfiguration} values.
10
+ * @returns A `Converter` for {@link Config.PredefinedSystemConfiguration | PredefinedSystemConfiguration} values.
11
+ * @public
12
+ */
13
+ export declare const predefinedSystemConfiguration: import("@fgv/ts-utils").Converter<import("./common").PredefinedSystemConfiguration, readonly import("./common").PredefinedSystemConfiguration[]>;
14
+ //# sourceMappingURL=convert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../src/packlets/config/convert.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAM9C;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,wEAM9B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,kJAAgE,CAAC"}
@@ -0,0 +1,82 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
57
+ exports.predefinedSystemConfiguration = exports.systemConfiguration = void 0;
58
+ /* eslint-disable @rushstack/typedef-var */
59
+ const ts_utils_1 = require("@fgv/ts-utils");
60
+ const QualifierTypes = __importStar(require("../qualifier-types"));
61
+ const Qualifiers = __importStar(require("../qualifiers"));
62
+ const ResourceTypes = __importStar(require("../resource-types"));
63
+ const common_1 = require("./common");
64
+ /**
65
+ * A `Converter` for {@link Config.Model.ISystemConfiguration | ISystemConfiguration} objects.
66
+ * @returns A `Converter` for {@link Config.Model.ISystemConfiguration | ISystemConfiguration} objects.
67
+ * @public
68
+ */
69
+ exports.systemConfiguration = ts_utils_1.Converters.strictObject({
70
+ name: ts_utils_1.Converters.optionalString,
71
+ description: ts_utils_1.Converters.optionalString,
72
+ qualifierTypes: ts_utils_1.Converters.arrayOf(QualifierTypes.Config.Convert.systemQualifierTypeConfig),
73
+ qualifiers: ts_utils_1.Converters.arrayOf(Qualifiers.Convert.qualifierDecl),
74
+ resourceTypes: ts_utils_1.Converters.arrayOf(ResourceTypes.Config.Convert.resourceTypeConfig)
75
+ });
76
+ /**
77
+ * A `Converter` for {@link Config.PredefinedSystemConfiguration | PredefinedSystemConfiguration} values.
78
+ * @returns A `Converter` for {@link Config.PredefinedSystemConfiguration | PredefinedSystemConfiguration} values.
79
+ * @public
80
+ */
81
+ exports.predefinedSystemConfiguration = ts_utils_1.Converters.enumeratedValue(common_1.allPredefinedSystemConfigurations);
82
+ //# sourceMappingURL=convert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../src/packlets/config/convert.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA2C;AAE3C,4CAA2C;AAE3C,mEAAqD;AACrD,0DAA4C;AAC5C,iEAAmD;AACnD,qCAA6D;AAE7D;;;;GAIG;AACU,QAAA,mBAAmB,GAAG,qBAAU,CAAC,YAAY,CAAuB;IAC/E,IAAI,EAAE,qBAAU,CAAC,cAAc;IAC/B,WAAW,EAAE,qBAAU,CAAC,cAAc;IACtC,cAAc,EAAE,qBAAU,CAAC,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,yBAAyB,CAAC;IAC3F,UAAU,EAAE,qBAAU,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,aAAa,CAAC;IAChE,aAAa,EAAE,qBAAU,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC;CACnF,CAAC,CAAC;AAEH;;;;GAIG;AACU,QAAA,6BAA6B,GAAG,qBAAU,CAAC,eAAe,CAAC,0CAAiC,CAAC,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\n/* eslint-disable @rushstack/typedef-var */\n\nimport { Converters } from '@fgv/ts-utils';\nimport { ISystemConfiguration } from './json';\nimport * as QualifierTypes from '../qualifier-types';\nimport * as Qualifiers from '../qualifiers';\nimport * as ResourceTypes from '../resource-types';\nimport { allPredefinedSystemConfigurations } from './common';\n\n/**\n * A `Converter` for {@link Config.Model.ISystemConfiguration | ISystemConfiguration} objects.\n * @returns A `Converter` for {@link Config.Model.ISystemConfiguration | ISystemConfiguration} objects.\n * @public\n */\nexport const systemConfiguration = Converters.strictObject<ISystemConfiguration>({\n name: Converters.optionalString,\n description: Converters.optionalString,\n qualifierTypes: Converters.arrayOf(QualifierTypes.Config.Convert.systemQualifierTypeConfig),\n qualifiers: Converters.arrayOf(Qualifiers.Convert.qualifierDecl),\n resourceTypes: Converters.arrayOf(ResourceTypes.Config.Convert.resourceTypeConfig)\n});\n\n/**\n * A `Converter` for {@link Config.PredefinedSystemConfiguration | PredefinedSystemConfiguration} values.\n * @returns A `Converter` for {@link Config.PredefinedSystemConfiguration | PredefinedSystemConfiguration} values.\n * @public\n */\nexport const predefinedSystemConfiguration = Converters.enumeratedValue(allPredefinedSystemConfigurations);\n"]}
@@ -0,0 +1,6 @@
1
+ import * as Model from './json';
2
+ import * as Convert from './convert';
3
+ export * from './systemConfiguration';
4
+ export * from './common';
5
+ export { Model, Convert };
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/config/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,KAAK,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AAEzB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1,67 @@
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 = exports.Model = void 0;
61
+ const Model = __importStar(require("./json"));
62
+ exports.Model = Model;
63
+ const Convert = __importStar(require("./convert"));
64
+ exports.Convert = Convert;
65
+ __exportStar(require("./systemConfiguration"), exports);
66
+ __exportStar(require("./common"), exports);
67
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/config/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,8CAAgC;AAMvB,sBAAK;AALd,mDAAqC;AAKrB,0BAAO;AAHvB,wDAAsC;AACtC,2CAAyB","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 Model from './json';\nimport * as Convert from './convert';\n\nexport * from './systemConfiguration';\nexport * from './common';\n\nexport { Model, Convert };\n"]}
@@ -0,0 +1,20 @@
1
+ import * as QualifierTypes from '../qualifier-types';
2
+ import * as Qualifiers from '../qualifiers';
3
+ import * as ResourceTypes from '../resource-types';
4
+ /**
5
+ * System configuration for both runtime or build.
6
+ * @public
7
+ */
8
+ export interface ISystemConfiguration {
9
+ /** Optional human-readable name for the configuration. */
10
+ name?: string;
11
+ /** Optional description explaining the purpose and use case of the configuration. */
12
+ description?: string;
13
+ /** Qualifier type configurations that define the available qualifier types in the system. */
14
+ qualifierTypes: QualifierTypes.Config.ISystemQualifierTypeConfig[];
15
+ /** Qualifier declarations that define the available qualifiers in the system. */
16
+ qualifiers: Qualifiers.IQualifierDecl[];
17
+ /** Resource type configurations that define the available resource types in the system. */
18
+ resourceTypes: ResourceTypes.Config.IResourceTypeConfig[];
19
+ }
20
+ //# sourceMappingURL=json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../src/packlets/config/json.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,cAAc,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,aAAa,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,0DAA0D;IAE1D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qFAAqF;IACrF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6FAA6F;IAC7F,cAAc,EAAE,cAAc,CAAC,MAAM,CAAC,0BAA0B,EAAE,CAAC;IACnE,iFAAiF;IACjF,UAAU,EAAE,UAAU,CAAC,cAAc,EAAE,CAAC;IACxC,2FAA2F;IAC3F,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC;CAC3D"}
@@ -0,0 +1,24 @@
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
+ //# sourceMappingURL=json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.js","sourceRoot":"","sources":["../../../src/packlets/config/json.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","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 QualifierTypes from '../qualifier-types';\nimport * as Qualifiers from '../qualifiers';\nimport * as ResourceTypes from '../resource-types';\n\n/**\n * System configuration for both runtime or build.\n * @public\n */\nexport interface ISystemConfiguration {\n /** Optional human-readable name for the configuration. */\n\n name?: string;\n /** Optional description explaining the purpose and use case of the configuration. */\n description?: string;\n /** Qualifier type configurations that define the available qualifier types in the system. */\n qualifierTypes: QualifierTypes.Config.ISystemQualifierTypeConfig[];\n /** Qualifier declarations that define the available qualifiers in the system. */\n qualifiers: Qualifiers.IQualifierDecl[];\n /** Resource type configurations that define the available resource types in the system. */\n resourceTypes: ResourceTypes.Config.IResourceTypeConfig[];\n}\n"]}