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

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 (436) 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 +5253 -699
  8. package/dist/tsdoc-metadata.json +1 -1
  9. package/lib/index.d.ts +13 -2
  10. package/lib/index.d.ts.map +1 -1
  11. package/lib/index.js +29 -2
  12. package/lib/index.js.map +1 -1
  13. package/lib/packlets/bundle/bundleBuilder.d.ts +41 -0
  14. package/lib/packlets/bundle/bundleBuilder.d.ts.map +1 -0
  15. package/lib/packlets/bundle/bundleBuilder.js +134 -0
  16. package/lib/packlets/bundle/bundleBuilder.js.map +1 -0
  17. package/lib/packlets/bundle/bundleLoader.d.ts +72 -0
  18. package/lib/packlets/bundle/bundleLoader.d.ts.map +1 -0
  19. package/lib/packlets/bundle/bundleLoader.js +105 -0
  20. package/lib/packlets/bundle/bundleLoader.js.map +1 -0
  21. package/lib/packlets/bundle/bundleNormalizer.d.ts +73 -0
  22. package/lib/packlets/bundle/bundleNormalizer.d.ts.map +1 -0
  23. package/lib/packlets/bundle/bundleNormalizer.js +142 -0
  24. package/lib/packlets/bundle/bundleNormalizer.js.map +1 -0
  25. package/lib/packlets/bundle/bundleUtils.d.ts +70 -0
  26. package/lib/packlets/bundle/bundleUtils.d.ts.map +1 -0
  27. package/lib/packlets/bundle/bundleUtils.js +117 -0
  28. package/lib/packlets/bundle/bundleUtils.js.map +1 -0
  29. package/lib/packlets/bundle/convert.d.ts +33 -0
  30. package/lib/packlets/bundle/convert.d.ts.map +1 -0
  31. package/lib/packlets/bundle/convert.js +78 -0
  32. package/lib/packlets/bundle/convert.js.map +1 -0
  33. package/lib/packlets/bundle/index.d.ts +21 -0
  34. package/lib/packlets/bundle/index.d.ts.map +1 -0
  35. package/lib/packlets/bundle/index.js +83 -0
  36. package/lib/packlets/bundle/index.js.map +1 -0
  37. package/lib/packlets/bundle/model.d.ts +100 -0
  38. package/lib/packlets/bundle/model.d.ts.map +1 -0
  39. package/lib/packlets/bundle/model.js +24 -0
  40. package/lib/packlets/bundle/model.js.map +1 -0
  41. package/lib/packlets/common/conditions.d.ts +30 -0
  42. package/lib/packlets/common/conditions.d.ts.map +1 -1
  43. package/lib/packlets/common/conditions.js.map +1 -1
  44. package/lib/packlets/common/convert.d.ts +22 -2
  45. package/lib/packlets/common/convert.d.ts.map +1 -1
  46. package/lib/packlets/common/convert.js +21 -1
  47. package/lib/packlets/common/convert.js.map +1 -1
  48. package/lib/packlets/common/helpers/context.d.ts +39 -0
  49. package/lib/packlets/common/helpers/context.d.ts.map +1 -0
  50. package/lib/packlets/common/helpers/context.js +108 -0
  51. package/lib/packlets/common/helpers/context.js.map +1 -0
  52. package/lib/packlets/common/helpers/index.d.ts +2 -0
  53. package/lib/packlets/common/helpers/index.d.ts.map +1 -1
  54. package/lib/packlets/common/helpers/index.js +2 -0
  55. package/lib/packlets/common/helpers/index.js.map +1 -1
  56. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts +39 -0
  57. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +1 -0
  58. package/lib/packlets/common/helpers/qualifierDefaultValues.js +105 -0
  59. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  60. package/lib/packlets/common/helpers/resources.d.ts.map +1 -1
  61. package/lib/packlets/common/helpers/resources.js +6 -2
  62. package/lib/packlets/common/helpers/resources.js.map +1 -1
  63. package/lib/packlets/common/resources.d.ts +8 -0
  64. package/lib/packlets/common/resources.d.ts.map +1 -1
  65. package/lib/packlets/common/resources.js.map +1 -1
  66. package/lib/packlets/common/validate/conditions.d.ts +69 -1
  67. package/lib/packlets/common/validate/conditions.d.ts.map +1 -1
  68. package/lib/packlets/common/validate/conditions.js +126 -0
  69. package/lib/packlets/common/validate/conditions.js.map +1 -1
  70. package/lib/packlets/common/validate/regularExpressions.d.ts +20 -0
  71. package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -1
  72. package/lib/packlets/common/validate/regularExpressions.js +21 -1
  73. package/lib/packlets/common/validate/regularExpressions.js.map +1 -1
  74. package/lib/packlets/conditions/condition.d.ts +37 -0
  75. package/lib/packlets/conditions/condition.d.ts.map +1 -1
  76. package/lib/packlets/conditions/condition.js +67 -1
  77. package/lib/packlets/conditions/condition.js.map +1 -1
  78. package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -1
  79. package/lib/packlets/conditions/conditionCollector.js +1 -0
  80. package/lib/packlets/conditions/conditionCollector.js.map +1 -1
  81. package/lib/packlets/conditions/conditionSet.d.ts +43 -3
  82. package/lib/packlets/conditions/conditionSet.d.ts.map +1 -1
  83. package/lib/packlets/conditions/conditionSet.js +104 -3
  84. package/lib/packlets/conditions/conditionSet.js.map +1 -1
  85. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -1
  86. package/lib/packlets/conditions/conditionSetCollector.js +3 -0
  87. package/lib/packlets/conditions/conditionSetCollector.js.map +1 -1
  88. package/lib/packlets/conditions/conditionToken.d.ts.map +1 -1
  89. package/lib/packlets/conditions/conditionToken.js +2 -1
  90. package/lib/packlets/conditions/conditionToken.js.map +1 -1
  91. package/lib/packlets/conditions/convert/decls.js +1 -1
  92. package/lib/packlets/conditions/convert/decls.js.map +1 -1
  93. package/lib/packlets/config/common.d.ts +35 -0
  94. package/lib/packlets/config/common.d.ts.map +1 -0
  95. package/lib/packlets/config/common.js +96 -0
  96. package/lib/packlets/config/common.js.map +1 -0
  97. package/lib/packlets/config/convert.d.ts +14 -0
  98. package/lib/packlets/config/convert.d.ts.map +1 -0
  99. package/lib/packlets/config/convert.js +82 -0
  100. package/lib/packlets/config/convert.js.map +1 -0
  101. package/lib/packlets/config/index.d.ts +6 -0
  102. package/lib/packlets/config/index.d.ts.map +1 -0
  103. package/lib/packlets/config/index.js +67 -0
  104. package/lib/packlets/config/index.js.map +1 -0
  105. package/lib/packlets/config/json.d.ts +20 -0
  106. package/lib/packlets/config/json.d.ts.map +1 -0
  107. package/lib/packlets/config/json.js +24 -0
  108. package/lib/packlets/config/json.js.map +1 -0
  109. package/lib/packlets/config/predefined/default.d.ts +57 -0
  110. package/lib/packlets/config/predefined/default.d.ts.map +1 -0
  111. package/lib/packlets/config/predefined/default.js +141 -0
  112. package/lib/packlets/config/predefined/default.js.map +1 -0
  113. package/lib/packlets/config/predefined/extended.d.ts +25 -0
  114. package/lib/packlets/config/predefined/extended.d.ts.map +1 -0
  115. package/lib/packlets/config/predefined/extended.js +193 -0
  116. package/lib/packlets/config/predefined/extended.js.map +1 -0
  117. package/lib/packlets/config/predefined/index.d.ts +4 -0
  118. package/lib/packlets/config/predefined/index.d.ts.map +1 -0
  119. package/lib/packlets/config/predefined/index.js +62 -0
  120. package/lib/packlets/config/predefined/index.js.map +1 -0
  121. package/lib/packlets/config/systemConfiguration.d.ts +81 -0
  122. package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
  123. package/lib/packlets/config/systemConfiguration.js +172 -0
  124. package/lib/packlets/config/systemConfiguration.js.map +1 -0
  125. package/lib/packlets/context/contextDecls.d.ts +49 -0
  126. package/lib/packlets/context/contextDecls.d.ts.map +1 -0
  127. package/lib/packlets/context/contextDecls.js +24 -0
  128. package/lib/packlets/context/contextDecls.js.map +1 -0
  129. package/lib/packlets/context/contextToken.d.ts +111 -0
  130. package/lib/packlets/context/contextToken.d.ts.map +1 -0
  131. package/lib/packlets/context/contextToken.js +206 -0
  132. package/lib/packlets/context/contextToken.js.map +1 -0
  133. package/lib/packlets/context/convert/decls.d.ts +37 -0
  134. package/lib/packlets/context/convert/decls.d.ts.map +1 -0
  135. package/lib/packlets/context/convert/decls.js +94 -0
  136. package/lib/packlets/context/convert/decls.js.map +1 -0
  137. package/lib/packlets/context/convert/index.d.ts +2 -0
  138. package/lib/packlets/context/convert/index.d.ts.map +1 -0
  139. package/lib/packlets/context/convert/index.js +39 -0
  140. package/lib/packlets/context/convert/index.js.map +1 -0
  141. package/lib/packlets/context/index.d.ts +5 -0
  142. package/lib/packlets/context/index.d.ts.map +1 -0
  143. package/lib/packlets/context/index.js +65 -0
  144. package/lib/packlets/context/index.js.map +1 -0
  145. package/lib/packlets/decisions/abstractDecision.d.ts +8 -0
  146. package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -1
  147. package/lib/packlets/decisions/abstractDecision.js +9 -0
  148. package/lib/packlets/decisions/abstractDecision.js.map +1 -1
  149. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -1
  150. package/lib/packlets/decisions/abstractDecisionCollector.js +2 -0
  151. package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -1
  152. package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -1
  153. package/lib/packlets/decisions/concreteDecision.js +1 -0
  154. package/lib/packlets/decisions/concreteDecision.js.map +1 -1
  155. package/lib/packlets/decisions/decision.d.ts.map +1 -1
  156. package/lib/packlets/decisions/decision.js +4 -0
  157. package/lib/packlets/decisions/decision.js.map +1 -1
  158. package/lib/packlets/import/fsItem.d.ts.map +1 -1
  159. package/lib/packlets/import/fsItem.js +8 -12
  160. package/lib/packlets/import/fsItem.js.map +1 -1
  161. package/lib/packlets/import/importContext.d.ts +19 -0
  162. package/lib/packlets/import/importContext.d.ts.map +1 -1
  163. package/lib/packlets/import/importContext.js +39 -0
  164. package/lib/packlets/import/importContext.js.map +1 -1
  165. package/lib/packlets/import/importManager.d.ts +5 -5
  166. package/lib/packlets/import/importManager.d.ts.map +1 -1
  167. package/lib/packlets/import/importManager.js.map +1 -1
  168. package/lib/packlets/import/importers/collectionImporter.d.ts +11 -13
  169. package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -1
  170. package/lib/packlets/import/importers/collectionImporter.js +29 -20
  171. package/lib/packlets/import/importers/collectionImporter.js.map +1 -1
  172. package/lib/packlets/import/importers/fsItemImporter.d.ts +2 -2
  173. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -1
  174. package/lib/packlets/import/importers/fsItemImporter.js +2 -2
  175. package/lib/packlets/import/importers/fsItemImporter.js.map +1 -1
  176. package/lib/packlets/import/importers/importer.d.ts +3 -3
  177. package/lib/packlets/import/importers/importer.d.ts.map +1 -1
  178. package/lib/packlets/import/importers/importer.js.map +1 -1
  179. package/lib/packlets/import/importers/jsonImporter.d.ts +2 -3
  180. package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -1
  181. package/lib/packlets/import/importers/jsonImporter.js +11 -20
  182. package/lib/packlets/import/importers/jsonImporter.js.map +1 -1
  183. package/lib/packlets/import/importers/pathImporter.d.ts +2 -2
  184. package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -1
  185. package/lib/packlets/import/importers/pathImporter.js.map +1 -1
  186. package/lib/packlets/qualifier-types/config/convert.d.ts +44 -0
  187. package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
  188. package/lib/packlets/qualifier-types/config/convert.js +96 -0
  189. package/lib/packlets/qualifier-types/config/convert.js.map +1 -0
  190. package/lib/packlets/qualifier-types/config/index.d.ts +4 -0
  191. package/lib/packlets/qualifier-types/config/index.d.ts.map +1 -0
  192. package/lib/packlets/qualifier-types/config/index.js +64 -0
  193. package/lib/packlets/qualifier-types/config/index.js.map +1 -0
  194. package/lib/packlets/qualifier-types/config/json.d.ts +69 -0
  195. package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
  196. package/lib/packlets/qualifier-types/config/json.js +24 -0
  197. package/lib/packlets/qualifier-types/config/json.js.map +1 -0
  198. package/lib/packlets/qualifier-types/convert.d.ts +10 -2
  199. package/lib/packlets/qualifier-types/convert.d.ts.map +1 -1
  200. package/lib/packlets/qualifier-types/convert.js +15 -0
  201. package/lib/packlets/qualifier-types/convert.js.map +1 -1
  202. package/lib/packlets/qualifier-types/helpers.d.ts +27 -0
  203. package/lib/packlets/qualifier-types/helpers.d.ts.map +1 -0
  204. package/lib/packlets/qualifier-types/helpers.js +118 -0
  205. package/lib/packlets/qualifier-types/helpers.js.map +1 -0
  206. package/lib/packlets/qualifier-types/index.d.ts +4 -1
  207. package/lib/packlets/qualifier-types/index.d.ts.map +1 -1
  208. package/lib/packlets/qualifier-types/index.js +5 -1
  209. package/lib/packlets/qualifier-types/index.js.map +1 -1
  210. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +19 -8
  211. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -1
  212. package/lib/packlets/qualifier-types/languageQualifierType.js +28 -9
  213. package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -1
  214. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +42 -13
  215. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -1
  216. package/lib/packlets/qualifier-types/literalQualifierType.js +58 -10
  217. package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -1
  218. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts +114 -0
  219. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
  220. package/lib/packlets/qualifier-types/literalValueHierarchy.js +228 -0
  221. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  222. package/lib/packlets/qualifier-types/qualifierType.d.ts +33 -18
  223. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -1
  224. package/lib/packlets/qualifier-types/qualifierType.js +18 -4
  225. package/lib/packlets/qualifier-types/qualifierType.js.map +1 -1
  226. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts +4 -2
  227. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -1
  228. package/lib/packlets/qualifier-types/qualifierTypeCollector.js +2 -1
  229. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -1
  230. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +47 -11
  231. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -1
  232. package/lib/packlets/qualifier-types/territoryQualifierType.js +61 -17
  233. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -1
  234. package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -1
  235. package/lib/packlets/qualifiers/convert/decls.js +17 -15
  236. package/lib/packlets/qualifiers/convert/decls.js.map +1 -1
  237. package/lib/packlets/qualifiers/index.d.ts +2 -0
  238. package/lib/packlets/qualifiers/index.d.ts.map +1 -1
  239. package/lib/packlets/qualifiers/index.js +2 -0
  240. package/lib/packlets/qualifiers/index.js.map +1 -1
  241. package/lib/packlets/qualifiers/qualifier.d.ts +22 -2
  242. package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -1
  243. package/lib/packlets/qualifiers/qualifier.js +26 -1
  244. package/lib/packlets/qualifiers/qualifier.js.map +1 -1
  245. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -1
  246. package/lib/packlets/qualifiers/qualifierCollector.js +3 -0
  247. package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -1
  248. package/lib/packlets/qualifiers/qualifierDecl.d.ts +6 -1
  249. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -1
  250. package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -1
  251. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts +32 -0
  252. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +1 -0
  253. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js +24 -0
  254. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  255. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts +96 -0
  256. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +1 -0
  257. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js +179 -0
  258. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  259. package/lib/packlets/resource-json/compiled/common.d.ts +14 -0
  260. package/lib/packlets/resource-json/compiled/common.d.ts.map +1 -0
  261. package/lib/packlets/resource-json/compiled/common.js +24 -0
  262. package/lib/packlets/resource-json/compiled/common.js.map +1 -0
  263. package/lib/packlets/resource-json/compiled/convert.d.ts +63 -0
  264. package/lib/packlets/resource-json/compiled/convert.d.ts.map +1 -0
  265. package/lib/packlets/resource-json/compiled/convert.js +167 -0
  266. package/lib/packlets/resource-json/compiled/convert.js.map +1 -0
  267. package/lib/packlets/resource-json/compiled/index.d.ts +5 -0
  268. package/lib/packlets/resource-json/compiled/index.d.ts.map +1 -0
  269. package/lib/packlets/resource-json/compiled/index.js +65 -0
  270. package/lib/packlets/resource-json/compiled/index.js.map +1 -0
  271. package/lib/packlets/resource-json/compiled/json.d.ts +204 -0
  272. package/lib/packlets/resource-json/compiled/json.d.ts.map +1 -0
  273. package/lib/packlets/resource-json/compiled/json.js +3 -0
  274. package/lib/packlets/resource-json/compiled/json.js.map +1 -0
  275. package/lib/packlets/resource-json/convert.d.ts +16 -0
  276. package/lib/packlets/resource-json/convert.d.ts.map +1 -1
  277. package/lib/packlets/resource-json/convert.js +41 -6
  278. package/lib/packlets/resource-json/convert.js.map +1 -1
  279. package/lib/packlets/resource-json/helpers.d.ts +82 -3
  280. package/lib/packlets/resource-json/helpers.d.ts.map +1 -1
  281. package/lib/packlets/resource-json/helpers.js +185 -2
  282. package/lib/packlets/resource-json/helpers.js.map +1 -1
  283. package/lib/packlets/resource-json/index.d.ts +2 -1
  284. package/lib/packlets/resource-json/index.d.ts.map +1 -1
  285. package/lib/packlets/resource-json/index.js +3 -1
  286. package/lib/packlets/resource-json/index.js.map +1 -1
  287. package/lib/packlets/resource-json/json.d.ts +55 -3
  288. package/lib/packlets/resource-json/json.d.ts.map +1 -1
  289. package/lib/packlets/resource-json/json.js +16 -0
  290. package/lib/packlets/resource-json/json.js.map +1 -1
  291. package/lib/packlets/resource-json/normalized.d.ts +46 -3
  292. package/lib/packlets/resource-json/normalized.d.ts.map +1 -1
  293. package/lib/packlets/resource-json/normalized.js.map +1 -1
  294. package/lib/packlets/resource-json/resourceDeclCollection.d.ts +14 -10
  295. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -1
  296. package/lib/packlets/resource-json/resourceDeclCollection.js +18 -14
  297. package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -1
  298. package/lib/packlets/resource-json/resourceDeclContainer.d.ts +15 -2
  299. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -1
  300. package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -1
  301. package/lib/packlets/resource-json/resourceDeclTree.d.ts +6 -2
  302. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -1
  303. package/lib/packlets/resource-json/resourceDeclTree.js +12 -3
  304. package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -1
  305. package/lib/packlets/resource-types/config/convert.d.ts +8 -0
  306. package/lib/packlets/resource-types/config/convert.d.ts.map +1 -0
  307. package/lib/packlets/resource-types/config/convert.js +36 -0
  308. package/lib/packlets/resource-types/config/convert.js.map +1 -0
  309. package/lib/packlets/resource-types/config/index.d.ts +4 -0
  310. package/lib/packlets/resource-types/config/index.d.ts.map +1 -0
  311. package/lib/packlets/resource-types/config/index.js +64 -0
  312. package/lib/packlets/resource-types/config/index.js.map +1 -0
  313. package/lib/packlets/resource-types/config/json.d.ts +9 -0
  314. package/lib/packlets/resource-types/config/json.d.ts.map +1 -0
  315. package/lib/packlets/resource-types/config/json.js +24 -0
  316. package/lib/packlets/resource-types/config/json.js.map +1 -0
  317. package/lib/packlets/resource-types/helpers.d.ts +13 -0
  318. package/lib/packlets/resource-types/helpers.d.ts.map +1 -0
  319. package/lib/packlets/resource-types/helpers.js +44 -0
  320. package/lib/packlets/resource-types/helpers.js.map +1 -0
  321. package/lib/packlets/resource-types/index.d.ts +3 -0
  322. package/lib/packlets/resource-types/index.d.ts.map +1 -1
  323. package/lib/packlets/resource-types/index.js +26 -0
  324. package/lib/packlets/resource-types/index.js.map +1 -1
  325. package/lib/packlets/resource-types/jsonResourceType.d.ts +8 -16
  326. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -1
  327. package/lib/packlets/resource-types/jsonResourceType.js +6 -3
  328. package/lib/packlets/resource-types/jsonResourceType.js.map +1 -1
  329. package/lib/packlets/resource-types/resourceType.d.ts +45 -35
  330. package/lib/packlets/resource-types/resourceType.d.ts.map +1 -1
  331. package/lib/packlets/resource-types/resourceType.js.map +1 -1
  332. package/lib/packlets/resources/candidateReducer.d.ts +98 -0
  333. package/lib/packlets/resources/candidateReducer.d.ts.map +1 -0
  334. package/lib/packlets/resources/candidateReducer.js +247 -0
  335. package/lib/packlets/resources/candidateReducer.js.map +1 -0
  336. package/lib/packlets/resources/common.d.ts +72 -0
  337. package/lib/packlets/resources/common.d.ts.map +1 -0
  338. package/lib/packlets/resources/common.js +24 -0
  339. package/lib/packlets/resources/common.js.map +1 -0
  340. package/lib/packlets/resources/index.d.ts +3 -1
  341. package/lib/packlets/resources/index.d.ts.map +1 -1
  342. package/lib/packlets/resources/index.js +3 -1
  343. package/lib/packlets/resources/index.js.map +1 -1
  344. package/lib/packlets/resources/resource.d.ts +57 -5
  345. package/lib/packlets/resources/resource.d.ts.map +1 -1
  346. package/lib/packlets/resources/resource.js +96 -6
  347. package/lib/packlets/resources/resource.js.map +1 -1
  348. package/lib/packlets/resources/resourceBuilder.d.ts +14 -0
  349. package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -1
  350. package/lib/packlets/resources/resourceBuilder.js +19 -1
  351. package/lib/packlets/resources/resourceBuilder.js.map +1 -1
  352. package/lib/packlets/resources/resourceCandidate.d.ts +46 -6
  353. package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -1
  354. package/lib/packlets/resources/resourceCandidate.js +46 -1
  355. package/lib/packlets/resources/resourceCandidate.js.map +1 -1
  356. package/lib/packlets/resources/resourceManagerBuilder.d.ts +347 -0
  357. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
  358. package/lib/packlets/resources/resourceManagerBuilder.js +893 -0
  359. package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -0
  360. package/lib/packlets/runtime/cacheListener.d.ts +71 -0
  361. package/lib/packlets/runtime/cacheListener.d.ts.map +1 -0
  362. package/lib/packlets/runtime/cacheListener.js +62 -0
  363. package/lib/packlets/runtime/cacheListener.js.map +1 -0
  364. package/lib/packlets/runtime/cacheMetrics.d.ts +88 -0
  365. package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -0
  366. package/lib/packlets/runtime/cacheMetrics.js +154 -0
  367. package/lib/packlets/runtime/cacheMetrics.js.map +1 -0
  368. package/lib/packlets/runtime/compiledResourceCollection.d.ts +167 -0
  369. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
  370. package/lib/packlets/runtime/compiledResourceCollection.js +466 -0
  371. package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -0
  372. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts +70 -0
  373. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +1 -0
  374. package/lib/packlets/runtime/conditionSetResolutionResult.js +135 -0
  375. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  376. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts +80 -0
  377. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +1 -0
  378. package/lib/packlets/runtime/context/contextQualifierProvider.js +33 -0
  379. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  380. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts +165 -0
  381. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +1 -0
  382. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js +179 -0
  383. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  384. package/lib/packlets/runtime/context/index.d.ts +5 -0
  385. package/lib/packlets/runtime/context/index.d.ts.map +1 -0
  386. package/lib/packlets/runtime/context/index.js +42 -0
  387. package/lib/packlets/runtime/context/index.js.map +1 -0
  388. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +111 -0
  389. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -0
  390. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +177 -0
  391. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  392. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +47 -0
  393. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -0
  394. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +64 -0
  395. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  396. package/lib/packlets/runtime/iResourceManager.d.ts +94 -0
  397. package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -0
  398. package/lib/packlets/runtime/iResourceManager.js +24 -0
  399. package/lib/packlets/runtime/iResourceManager.js.map +1 -0
  400. package/lib/packlets/runtime/index.d.ts +12 -0
  401. package/lib/packlets/runtime/index.d.ts.map +1 -0
  402. package/lib/packlets/runtime/index.js +73 -0
  403. package/lib/packlets/runtime/index.js.map +1 -0
  404. package/lib/packlets/runtime/resource-tree/common.d.ts +91 -0
  405. package/lib/packlets/runtime/resource-tree/common.d.ts.map +1 -0
  406. package/lib/packlets/runtime/resource-tree/common.js +24 -0
  407. package/lib/packlets/runtime/resource-tree/common.js.map +1 -0
  408. package/lib/packlets/runtime/resource-tree/index.d.ts +5 -0
  409. package/lib/packlets/runtime/resource-tree/index.d.ts.map +1 -0
  410. package/lib/packlets/runtime/resource-tree/index.js +42 -0
  411. package/lib/packlets/runtime/resource-tree/index.js.map +1 -0
  412. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts +141 -0
  413. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +1 -0
  414. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js +224 -0
  415. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  416. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts +24 -0
  417. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +1 -0
  418. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js +98 -0
  419. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  420. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts +99 -0
  421. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +1 -0
  422. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +165 -0
  423. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  424. package/lib/packlets/runtime/resourceResolver.d.ts +217 -0
  425. package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -0
  426. package/lib/packlets/runtime/resourceResolver.js +459 -0
  427. package/lib/packlets/runtime/resourceResolver.js.map +1 -0
  428. package/lib/packlets/runtime/validate.d.ts +13 -0
  429. package/lib/packlets/runtime/validate.d.ts.map +1 -0
  430. package/lib/packlets/runtime/validate.js +49 -0
  431. package/lib/packlets/runtime/validate.js.map +1 -0
  432. package/package.json +76 -75
  433. package/lib/packlets/resources/resourceManager.d.ts +0 -104
  434. package/lib/packlets/resources/resourceManager.d.ts.map +0 -1
  435. package/lib/packlets/resources/resourceManager.js +0 -201
  436. package/lib/packlets/resources/resourceManager.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextDecls.js","sourceRoot":"","sources":["../../../src/packlets/context/contextDecls.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 { QualifierContextValue, QualifierName } from '../common';\nimport { Qualifier } from '../qualifiers';\n\n/**\n * Options to control matching of conditions against a context.\n * @public\n */\nexport interface IContextMatchOptions {\n /**\n * If true, then conditions which would otherwise yield\n * {@link NoMatch | NoMatch} but have a defined {@link Conditions.Condition.scoreAsDefault | scoreAsDefault}\n * will yield `scoreAsDefault`instead of `NoMatch`.\n */\n acceptDefaultScore?: boolean;\n\n /**\n * If true, then conditions for which a corresponding values is not present in the\n * context being matched will yield `undefined` instead of `NoMatch`.\n */\n partialContextMatch?: boolean;\n}\n\n/**\n * Non-validated declaration of a single context qualifier value.\n * @public\n */\nexport interface IContextQualifierValueDecl {\n qualifier: string;\n value: string;\n}\n\n/**\n * Non-validated declaration of a context, consisting of named\n * values.\n * @public\n */\nexport type IContextDecl = Record<string, string>;\n\n/**\n * Validated declaration of a single context qualifier value.\n * @public\n */\nexport interface IValidatedContextQualifierValueDecl {\n qualifier: Qualifier;\n value: QualifierContextValue;\n}\n\n/**\n * Validated declaration of a context, a record with strongly-typed\n * {@link QualifierTypeName | qualifier type names} as keys and\n * {@link QualifierContextValue | qualifier context values} as values.\n * @public\n */\nexport type IValidatedContextDecl = Record<QualifierName, QualifierContextValue>;\n"]}
@@ -0,0 +1,111 @@
1
+ import { Result } from '@fgv/ts-utils';
2
+ import { Helpers as CommonHelpers } from '../common';
3
+ import { IValidatedContextQualifierValueDecl, IValidatedContextDecl } from './contextDecls';
4
+ import { IReadOnlyQualifierCollector, Qualifier } from '../qualifiers';
5
+ /**
6
+ * Helper class to parse and validate context tokens.
7
+ * @public
8
+ */
9
+ export declare class ContextTokens {
10
+ /**
11
+ * The {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} used to validate
12
+ * qualifier names and values.
13
+ */
14
+ readonly qualifiers: IReadOnlyQualifierCollector;
15
+ /**
16
+ * Constructs a new {@link Context.ContextTokens | ContextTokens } instance.
17
+ * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use
18
+ */
19
+ constructor(qualifiers: IReadOnlyQualifierCollector);
20
+ /**
21
+ * Parses a {@link ContextQualifierToken | context qualifier token} string and validates the parts
22
+ * against the qualifiers present in the {@link Context.ContextTokens.qualifiers | qualifier collector}.
23
+ * @param token - the token string to parse.
24
+ * @returns `Success` with the {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declaration}
25
+ * if successful, `Failure` with an error message if not.
26
+ */
27
+ parseContextQualifierToken(token: string): Result<IValidatedContextQualifierValueDecl>;
28
+ /**
29
+ * Parses a {@link ContextToken | context token} string and validates the parts
30
+ * against the qualifiers present in the {@link Context.ContextTokens.qualifiers | qualifier collector}.
31
+ * @param token - the token string to parse.
32
+ * @returns `Success` with the array of {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declarations}
33
+ * if successful, `Failure` with an error message if not.
34
+ */
35
+ parseContextToken(token: string): Result<IValidatedContextQualifierValueDecl[]>;
36
+ /**
37
+ * Validates the {@link Helpers.IContextTokenParts | parts} of a {@link ContextToken | context token}.
38
+ * @param parts - the parts to validate
39
+ * @returns `Success` with the validated declaration if successful, `Failure` with an error message if not.
40
+ */
41
+ validateContextTokenParts(parts: CommonHelpers.IContextTokenParts): Result<IValidatedContextQualifierValueDecl>;
42
+ /**
43
+ * Given a value, finds a single token-optional qualifier that matches the value.
44
+ * Fails if no qualifiers match, or if more than one qualifier matches.
45
+ * @param value - the value to match.
46
+ * @returns `Success` with the matching qualifier if successful, `Failure` with an error message if not.
47
+ */
48
+ findQualifierForValue(value: string): Result<Qualifier>;
49
+ /**
50
+ * Converts a {@link ContextToken | context token} to a validated partial context.
51
+ * @param token - the context token to convert
52
+ * @returns `Success` with the validated partial context if successful, `Failure` with an error message if not.
53
+ */
54
+ contextTokenToPartialContext(token: string): Result<IValidatedContextDecl>;
55
+ /**
56
+ * Converts a validated partial context to a {@link ContextToken | context token}.
57
+ * @param context - the validated partial context to convert
58
+ * @returns `Success` with the context token if successful, `Failure` with an error message if not.
59
+ */
60
+ partialContextToContextToken(context: IValidatedContextDecl): Result<string>;
61
+ /**
62
+ * Parses a {@link ContextQualifierToken | context qualifier token} and validates it against the qualifiers
63
+ * present in the supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.
64
+ * @param token - the token string to parse.
65
+ * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use
66
+ * @returns `Success` with a {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declaration} if successful,
67
+ * `Failure` with an error message if not.
68
+ */
69
+ static parseContextQualifierToken(token: string, qualifiers: IReadOnlyQualifierCollector): Result<IValidatedContextQualifierValueDecl>;
70
+ /**
71
+ * Parses a {@link ContextToken | context token} and validates it against the qualifiers
72
+ * present in the supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.
73
+ * @param token - the token string to parse.
74
+ * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use
75
+ * @returns `Success` with an array of {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declarations}
76
+ * if successful, `Failure` with an error message if not
77
+ */
78
+ static parseContextToken(token: string, qualifiers: IReadOnlyQualifierCollector): Result<IValidatedContextQualifierValueDecl[]>;
79
+ /**
80
+ * Validates the parts of a context token against the qualifiers present in the supplied
81
+ * {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.
82
+ * @param parts - the {@link Helpers.IContextTokenParts | context token parts} to validate.
83
+ * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} used to
84
+ * validate qualifier names and values.
85
+ * @returns `Success` with a {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declaration} if successful,
86
+ * `Failure` with an error message if not.
87
+ */
88
+ static validateContextTokenParts(parts: CommonHelpers.IContextTokenParts, qualifiers: IReadOnlyQualifierCollector): Result<IValidatedContextQualifierValueDecl>;
89
+ /**
90
+ * Given a value and a set of qualifiers, finds a single token-optional qualifier that matches the value.
91
+ * Fails if no qualifiers match, or if more than one qualifier matches.
92
+ * @param value - the value to match.
93
+ * @param qualifiers - the qualifiers to match against.
94
+ * @returns `Success` with the matching qualifier if successful, `Failure` with an error message if not.
95
+ */
96
+ static findQualifierForValue(value: string, qualifiers: IReadOnlyQualifierCollector): Result<Qualifier>;
97
+ /**
98
+ * Converts a {@link ContextToken | context token} to a validated partial context.
99
+ * @param token - the context token to convert
100
+ * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use
101
+ * @returns `Success` with the validated partial context if successful, `Failure` with an error message if not.
102
+ */
103
+ static contextTokenToPartialContext(token: string, qualifiers: IReadOnlyQualifierCollector): Result<IValidatedContextDecl>;
104
+ /**
105
+ * Converts a validated partial context to a {@link ContextToken | context token}.
106
+ * @param context - the validated partial context to convert
107
+ * @returns `Success` with the context token if successful, `Failure` with an error message if not.
108
+ */
109
+ static partialContextToContextToken(context: IValidatedContextDecl): Result<string>;
110
+ }
111
+ //# sourceMappingURL=contextToken.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextToken.d.ts","sourceRoot":"","sources":["../../../src/packlets/context/contextToken.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAc,MAAM,EAAiB,MAAM,eAAe,CAAC;AAClE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AgB9C;;;;;;OAMG;WACW,qBAAqB,CACjC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,SAAS,CAAC;IAgBpB;;;;;OAKG;WACW,4BAA4B,CACxC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,qBAAqB,CAAC;IAoBhC;;;;OAIG;WACW,4BAA4B,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC;CAsB3F"}
@@ -0,0 +1,206 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2025 Erik Fortune
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be included in all
13
+ * copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ * SOFTWARE.
22
+ */
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.ContextTokens = void 0;
25
+ const ts_utils_1 = require("@fgv/ts-utils");
26
+ const common_1 = require("../common");
27
+ /**
28
+ * Helper class to parse and validate context tokens.
29
+ * @public
30
+ */
31
+ class ContextTokens {
32
+ /**
33
+ * Constructs a new {@link Context.ContextTokens | ContextTokens } instance.
34
+ * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use
35
+ */
36
+ constructor(qualifiers) {
37
+ this.qualifiers = qualifiers;
38
+ }
39
+ /**
40
+ * Parses a {@link ContextQualifierToken | context qualifier token} string and validates the parts
41
+ * against the qualifiers present in the {@link Context.ContextTokens.qualifiers | qualifier collector}.
42
+ * @param token - the token string to parse.
43
+ * @returns `Success` with the {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declaration}
44
+ * if successful, `Failure` with an error message if not.
45
+ */
46
+ parseContextQualifierToken(token) {
47
+ return ContextTokens.parseContextQualifierToken(token, this.qualifiers);
48
+ }
49
+ /**
50
+ * Parses a {@link ContextToken | context token} string and validates the parts
51
+ * against the qualifiers present in the {@link Context.ContextTokens.qualifiers | qualifier collector}.
52
+ * @param token - the token string to parse.
53
+ * @returns `Success` with the array of {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declarations}
54
+ * if successful, `Failure` with an error message if not.
55
+ */
56
+ parseContextToken(token) {
57
+ return ContextTokens.parseContextToken(token, this.qualifiers);
58
+ }
59
+ /**
60
+ * Validates the {@link Helpers.IContextTokenParts | parts} of a {@link ContextToken | context token}.
61
+ * @param parts - the parts to validate
62
+ * @returns `Success` with the validated declaration if successful, `Failure` with an error message if not.
63
+ */
64
+ validateContextTokenParts(parts) {
65
+ return ContextTokens.validateContextTokenParts(parts, this.qualifiers);
66
+ }
67
+ /**
68
+ * Given a value, finds a single token-optional qualifier that matches the value.
69
+ * Fails if no qualifiers match, or if more than one qualifier matches.
70
+ * @param value - the value to match.
71
+ * @returns `Success` with the matching qualifier if successful, `Failure` with an error message if not.
72
+ */
73
+ findQualifierForValue(value) {
74
+ return ContextTokens.findQualifierForValue(value, this.qualifiers);
75
+ }
76
+ /**
77
+ * Converts a {@link ContextToken | context token} to a validated partial context.
78
+ * @param token - the context token to convert
79
+ * @returns `Success` with the validated partial context if successful, `Failure` with an error message if not.
80
+ */
81
+ contextTokenToPartialContext(token) {
82
+ return ContextTokens.contextTokenToPartialContext(token, this.qualifiers);
83
+ }
84
+ /**
85
+ * Converts a validated partial context to a {@link ContextToken | context token}.
86
+ * @param context - the validated partial context to convert
87
+ * @returns `Success` with the context token if successful, `Failure` with an error message if not.
88
+ */
89
+ partialContextToContextToken(context) {
90
+ return ContextTokens.partialContextToContextToken(context);
91
+ }
92
+ /**
93
+ * Parses a {@link ContextQualifierToken | context qualifier token} and validates it against the qualifiers
94
+ * present in the supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.
95
+ * @param token - the token string to parse.
96
+ * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use
97
+ * @returns `Success` with a {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declaration} if successful,
98
+ * `Failure` with an error message if not.
99
+ */
100
+ static parseContextQualifierToken(token, qualifiers) {
101
+ return common_1.Helpers.parseContextQualifierTokenParts(token).onSuccess((parts) => {
102
+ return ContextTokens.validateContextTokenParts(parts, qualifiers);
103
+ });
104
+ }
105
+ /**
106
+ * Parses a {@link ContextToken | context token} and validates it against the qualifiers
107
+ * present in the supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.
108
+ * @param token - the token string to parse.
109
+ * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use
110
+ * @returns `Success` with an array of {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declarations}
111
+ * if successful, `Failure` with an error message if not
112
+ */
113
+ static parseContextToken(token, qualifiers) {
114
+ return common_1.Helpers.parseContextTokenParts(token).onSuccess((parts) => {
115
+ return (0, ts_utils_1.mapResults)(parts.map((part) => ContextTokens.validateContextTokenParts(part, qualifiers)));
116
+ });
117
+ }
118
+ /**
119
+ * Validates the parts of a context token against the qualifiers present in the supplied
120
+ * {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.
121
+ * @param parts - the {@link Helpers.IContextTokenParts | context token parts} to validate.
122
+ * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} used to
123
+ * validate qualifier names and values.
124
+ * @returns `Success` with a {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declaration} if successful,
125
+ * `Failure` with an error message if not.
126
+ */
127
+ static validateContextTokenParts(parts, qualifiers) {
128
+ const qualifierLookup = parts.qualifier === undefined
129
+ ? ContextTokens.findQualifierForValue(parts.value, qualifiers)
130
+ : qualifiers.getByNameOrToken(parts.qualifier);
131
+ return qualifierLookup.onSuccess((qualifier) => {
132
+ return qualifier.type
133
+ .validateContextValue(parts.value)
134
+ .onSuccess((value) => {
135
+ return (0, ts_utils_1.succeed)({ qualifier, value });
136
+ })
137
+ .withDetail('failure', 'success');
138
+ });
139
+ }
140
+ /**
141
+ * Given a value and a set of qualifiers, finds a single token-optional qualifier that matches the value.
142
+ * Fails if no qualifiers match, or if more than one qualifier matches.
143
+ * @param value - the value to match.
144
+ * @param qualifiers - the qualifiers to match against.
145
+ * @returns `Success` with the matching qualifier if successful, `Failure` with an error message if not.
146
+ */
147
+ static findQualifierForValue(value, qualifiers) {
148
+ const matched = [];
149
+ for (const qualifier of qualifiers.values()) {
150
+ if (qualifier.tokenIsOptional && qualifier.validateContextValue(value).isSuccess()) {
151
+ matched.push(qualifier);
152
+ }
153
+ }
154
+ if (matched.length === 0) {
155
+ return (0, ts_utils_1.fail)(`${value}: does not match any qualifier`);
156
+ }
157
+ if (matched.length > 1) {
158
+ return (0, ts_utils_1.fail)(`${value}: matches multiple qualifiers (${matched.map((q) => q.name).join(', ')})`);
159
+ }
160
+ return (0, ts_utils_1.succeed)(matched[0]);
161
+ }
162
+ /**
163
+ * Converts a {@link ContextToken | context token} to a validated partial context.
164
+ * @param token - the context token to convert
165
+ * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use
166
+ * @returns `Success` with the validated partial context if successful, `Failure` with an error message if not.
167
+ */
168
+ static contextTokenToPartialContext(token, qualifiers) {
169
+ return ContextTokens.parseContextToken(token, qualifiers).onSuccess((qualifierValues) => {
170
+ const context = {};
171
+ for (const { qualifier, value } of qualifierValues) {
172
+ const qualifierName = qualifier.name;
173
+ const contextValue = value;
174
+ // Check for duplicate qualifiers
175
+ if (qualifierName in context) {
176
+ return (0, ts_utils_1.fail)(`${qualifier.name}: duplicate qualifier in context token`);
177
+ }
178
+ context[qualifierName] = contextValue;
179
+ }
180
+ return (0, ts_utils_1.succeed)(context);
181
+ });
182
+ }
183
+ /**
184
+ * Converts a validated partial context to a {@link ContextToken | context token}.
185
+ * @param context - the validated partial context to convert
186
+ * @returns `Success` with the context token if successful, `Failure` with an error message if not.
187
+ */
188
+ static partialContextToContextToken(context) {
189
+ const tokens = [];
190
+ for (const [qualifierName, contextValue] of Object.entries(context)) {
191
+ // Build token as "qualifier=value"
192
+ tokens.push(`${qualifierName}=${contextValue}`);
193
+ }
194
+ if (tokens.length === 0) {
195
+ return (0, ts_utils_1.succeed)('');
196
+ }
197
+ const tokenString = tokens.join('|');
198
+ // Validate the generated token
199
+ return common_1.Helpers.buildContextToken(tokens.map((token) => {
200
+ const [qualifier, value] = token.split('=');
201
+ return { qualifier, value };
202
+ })).onSuccess(() => (0, ts_utils_1.succeed)(tokenString));
203
+ }
204
+ }
205
+ exports.ContextTokens = ContextTokens;
206
+ //# sourceMappingURL=contextToken.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextToken.js","sourceRoot":"","sources":["../../../src/packlets/context/contextToken.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAkE;AAClE,sCAA2F;AAI3F;;;GAGG;AACH,MAAa,aAAa;IAOxB;;;OAGG;IACH,YAAmB,UAAuC;QACxD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACI,0BAA0B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MAAM,CAAC,IAAI,CAAC,GAAG,aAAa,IAAI,YAAY,EAAE,CAAC,CAAC;QAClD,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,IAAA,kBAAO,EAAC,EAAE,CAAC,CAAC;QACrB,CAAC;QAED,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAErC,+BAA+B;QAC/B,OAAO,gBAAa,CAAC,iBAAiB,CACpC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACnB,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;QAC9B,CAAC,CAAC,CACH,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAA,kBAAO,EAAC,WAAW,CAAC,CAAC,CAAC;IAC1C,CAAC;CACF;AA5ND,sCA4NC","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, QualifierName, QualifierContextValue } from '../common';\nimport { IValidatedContextQualifierValueDecl, IValidatedContextDecl } from './contextDecls';\nimport { IReadOnlyQualifierCollector, Qualifier } from '../qualifiers';\n\n/**\n * Helper class to parse and validate context tokens.\n * @public\n */\nexport class ContextTokens {\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 Context.ContextTokens | ContextTokens } 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 /**\n * Parses a {@link ContextQualifierToken | context qualifier token} string and validates the parts\n * against the qualifiers present in the {@link Context.ContextTokens.qualifiers | qualifier collector}.\n * @param token - the token string to parse.\n * @returns `Success` with the {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declaration}\n * if successful, `Failure` with an error message if not.\n */\n public parseContextQualifierToken(token: string): Result<IValidatedContextQualifierValueDecl> {\n return ContextTokens.parseContextQualifierToken(token, this.qualifiers);\n }\n\n /**\n * Parses a {@link ContextToken | context token} string and validates the parts\n * against the qualifiers present in the {@link Context.ContextTokens.qualifiers | qualifier collector}.\n * @param token - the token string to parse.\n * @returns `Success` with the array of {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declarations}\n * if successful, `Failure` with an error message if not.\n */\n public parseContextToken(token: string): Result<IValidatedContextQualifierValueDecl[]> {\n return ContextTokens.parseContextToken(token, this.qualifiers);\n }\n\n /**\n * Validates the {@link Helpers.IContextTokenParts | parts} of a {@link ContextToken | context 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 validateContextTokenParts(\n parts: CommonHelpers.IContextTokenParts\n ): Result<IValidatedContextQualifierValueDecl> {\n return ContextTokens.validateContextTokenParts(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 ContextTokens.findQualifierForValue(value, this.qualifiers);\n }\n\n /**\n * Converts a {@link ContextToken | context token} to a validated partial context.\n * @param token - the context token to convert\n * @returns `Success` with the validated partial context if successful, `Failure` with an error message if not.\n */\n public contextTokenToPartialContext(token: string): Result<IValidatedContextDecl> {\n return ContextTokens.contextTokenToPartialContext(token, this.qualifiers);\n }\n\n /**\n * Converts a validated partial context to a {@link ContextToken | context token}.\n * @param context - the validated partial context to convert\n * @returns `Success` with the context token if successful, `Failure` with an error message if not.\n */\n public partialContextToContextToken(context: IValidatedContextDecl): Result<string> {\n return ContextTokens.partialContextToContextToken(context);\n }\n\n /**\n * Parses a {@link ContextQualifierToken | context qualifier 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 Context.IValidatedContextQualifierValueDecl | validated context qualifier value declaration} if successful,\n * `Failure` with an error message if not.\n */\n public static parseContextQualifierToken(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedContextQualifierValueDecl> {\n return CommonHelpers.parseContextQualifierTokenParts(token).onSuccess((parts) => {\n return ContextTokens.validateContextTokenParts(parts, qualifiers);\n });\n }\n\n /**\n * Parses a {@link ContextToken | context 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 Context.IValidatedContextQualifierValueDecl | validated context qualifier value declarations}\n * if successful, `Failure` with an error message if not\n */\n public static parseContextToken(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedContextQualifierValueDecl[]> {\n return CommonHelpers.parseContextTokenParts(token).onSuccess((parts) => {\n return mapResults(parts.map((part) => ContextTokens.validateContextTokenParts(part, qualifiers)));\n });\n }\n\n /**\n * Validates the parts of a context token against the qualifiers present in the supplied\n * {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param parts - the {@link Helpers.IContextTokenParts | context 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 Context.IValidatedContextQualifierValueDecl | validated context qualifier value declaration} if successful,\n * `Failure` with an error message if not.\n */\n public static validateContextTokenParts(\n parts: CommonHelpers.IContextTokenParts,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedContextQualifierValueDecl> {\n const qualifierLookup =\n parts.qualifier === undefined\n ? ContextTokens.findQualifierForValue(parts.value, qualifiers)\n : qualifiers.getByNameOrToken(parts.qualifier);\n\n return qualifierLookup.onSuccess((qualifier) => {\n return qualifier.type\n .validateContextValue(parts.value)\n .onSuccess((value) => {\n return succeed({ qualifier, value });\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.validateContextValue(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 /**\n * Converts a {@link ContextToken | context token} to a validated partial context.\n * @param token - the context token to convert\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n * @returns `Success` with the validated partial context if successful, `Failure` with an error message if not.\n */\n public static contextTokenToPartialContext(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedContextDecl> {\n return ContextTokens.parseContextToken(token, qualifiers).onSuccess((qualifierValues) => {\n const context: IValidatedContextDecl = {};\n\n for (const { qualifier, value } of qualifierValues) {\n const qualifierName = qualifier.name as QualifierName;\n const contextValue = value as QualifierContextValue;\n\n // Check for duplicate qualifiers\n if (qualifierName in context) {\n return fail(`${qualifier.name}: duplicate qualifier in context token`);\n }\n\n context[qualifierName] = contextValue;\n }\n\n return succeed(context);\n });\n }\n\n /**\n * Converts a validated partial context to a {@link ContextToken | context token}.\n * @param context - the validated partial context to convert\n * @returns `Success` with the context token if successful, `Failure` with an error message if not.\n */\n public static partialContextToContextToken(context: IValidatedContextDecl): Result<string> {\n const tokens: string[] = [];\n\n for (const [qualifierName, contextValue] of Object.entries(context)) {\n // Build token as \"qualifier=value\"\n tokens.push(`${qualifierName}=${contextValue}`);\n }\n\n if (tokens.length === 0) {\n return succeed('');\n }\n\n const tokenString = tokens.join('|');\n\n // Validate the generated token\n return CommonHelpers.buildContextToken(\n tokens.map((token) => {\n const [qualifier, value] = token.split('=');\n return { qualifier, value };\n })\n ).onSuccess(() => succeed(tokenString));\n }\n}\n"]}
@@ -0,0 +1,37 @@
1
+ import { IContextQualifierValueDecl, IValidatedContextDecl, IValidatedContextQualifierValueDecl } from '../contextDecls';
2
+ import { IReadOnlyQualifierCollector } from '../../qualifiers';
3
+ /**
4
+ * Converter for a {@link Context.IContextQualifierValueDecl | context qualifier value declaration}.
5
+ * @public
6
+ */
7
+ export declare const contextQualifierValueDecl: import("@fgv/ts-utils").ObjectConverter<IContextQualifierValueDecl, unknown>;
8
+ /**
9
+ * Converter for a {@link Context.IContextDecl | context declaration}.
10
+ * @public
11
+ */
12
+ export declare const contextDecl: import("@fgv/ts-utils").Converter<Record<string, string>, unknown>;
13
+ /**
14
+ * Context necessary to convert a {@link Context.IContextQualifierValueDecl | context qualifier value declaration}
15
+ * or {@link Context.IContextDecl | context declaration} to their
16
+ * equivalent - {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declaration}
17
+ * or {@link Context.IValidatedContextDecl | validated context declaration}, respectively.
18
+ * @public
19
+ */
20
+ export interface IContextDeclConvertContext {
21
+ readonly qualifiers: IReadOnlyQualifierCollector;
22
+ }
23
+ /**
24
+ * Converter which constructs a {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declaration}
25
+ * from a {@link Context.IContextQualifierValueDecl | context qualifier value declaration}, instantiating qualifiers by name
26
+ * from a supplied {@link Context.Convert.IContextDeclConvertContext | conversion context}.
27
+ * @public
28
+ */
29
+ export declare const validatedContextQualifierValueDecl: import("@fgv/ts-utils").Converter<IValidatedContextQualifierValueDecl, IContextDeclConvertContext>;
30
+ /**
31
+ * Converter which constructs a {@link Context.IValidatedContextDecl | validated context declaration}
32
+ * from a {@link Context.IContextDecl | context declaration}, instantiating qualifiers by name
33
+ * from a supplied {@link Context.Convert.IContextDeclConvertContext | conversion context}.
34
+ * @public
35
+ */
36
+ export declare const validatedContextDecl: import("@fgv/ts-utils").Converter<IValidatedContextDecl, IContextDeclConvertContext>;
37
+ //# sourceMappingURL=decls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decls.d.ts","sourceRoot":"","sources":["../../../../src/packlets/context/convert/decls.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,mCAAmC,EACpC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAI/D;;;GAGG;AACH,eAAO,MAAM,yBAAyB,8EAGpC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,WAAW,oEAAyC,CAAC;AAElE;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,UAAU,EAAE,2BAA2B,CAAC;CAClD;AAED;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,oGAyB9C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,sFA4BhC,CAAC"}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2025 Erik Fortune
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be included in all
13
+ * copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ * SOFTWARE.
22
+ */
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.validatedContextDecl = exports.validatedContextQualifierValueDecl = exports.contextDecl = exports.contextQualifierValueDecl = void 0;
25
+ const ts_utils_1 = require("@fgv/ts-utils");
26
+ /* eslint-disable @rushstack/typedef-var */
27
+ /**
28
+ * Converter for a {@link Context.IContextQualifierValueDecl | context qualifier value declaration}.
29
+ * @public
30
+ */
31
+ exports.contextQualifierValueDecl = ts_utils_1.Converters.strictObject({
32
+ qualifier: ts_utils_1.Converters.string,
33
+ value: ts_utils_1.Converters.string
34
+ });
35
+ /**
36
+ * Converter for a {@link Context.IContextDecl | context declaration}.
37
+ * @public
38
+ */
39
+ exports.contextDecl = ts_utils_1.Converters.recordOf(ts_utils_1.Converters.string);
40
+ /**
41
+ * Converter which constructs a {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declaration}
42
+ * from a {@link Context.IContextQualifierValueDecl | context qualifier value declaration}, instantiating qualifiers by name
43
+ * from a supplied {@link Context.Convert.IContextDeclConvertContext | conversion context}.
44
+ * @public
45
+ */
46
+ exports.validatedContextQualifierValueDecl = ts_utils_1.Converters.generic((from, __self, context) => {
47
+ if (!context) {
48
+ return ts_utils_1.Failure.with('validatedContextQualifierValueDecl converter requires a context');
49
+ }
50
+ return exports.contextQualifierValueDecl.convert(from).onSuccess((decl) => {
51
+ const { value: qualifier, message } = context.qualifiers.validating.get(decl.qualifier);
52
+ if (message !== undefined) {
53
+ return ts_utils_1.Failure.with(message);
54
+ }
55
+ return qualifier.validateContextValue(decl.value).onSuccess((value) => {
56
+ return ts_utils_1.Success.with({
57
+ qualifier,
58
+ value
59
+ });
60
+ });
61
+ });
62
+ });
63
+ /**
64
+ * Converter which constructs a {@link Context.IValidatedContextDecl | validated context declaration}
65
+ * from a {@link Context.IContextDecl | context declaration}, instantiating qualifiers by name
66
+ * from a supplied {@link Context.Convert.IContextDeclConvertContext | conversion context}.
67
+ * @public
68
+ */
69
+ exports.validatedContextDecl = ts_utils_1.Converters.generic((from, __self, context) => {
70
+ if (!context) {
71
+ /* c8 ignore next 2 - functional code path tested but coverage intermittently missed */
72
+ return ts_utils_1.Failure.with('validatedContextDecl converter requires a context');
73
+ }
74
+ return exports.contextDecl.convert(from).onSuccess((decl) => {
75
+ const errors = new ts_utils_1.MessageAggregator();
76
+ const result = {};
77
+ for (const key in decl) {
78
+ if (key in decl) {
79
+ const { value: qualifier } = context.qualifiers.validating.get(key).aggregateError(errors);
80
+ if (qualifier !== undefined) {
81
+ qualifier
82
+ .validateContextValue(decl[key])
83
+ .onSuccess((value) => {
84
+ result[qualifier.name] = value;
85
+ return (0, ts_utils_1.succeed)(value);
86
+ })
87
+ .aggregateError(errors);
88
+ }
89
+ }
90
+ }
91
+ return errors.returnOrReport(ts_utils_1.Success.with(result));
92
+ });
93
+ });
94
+ //# sourceMappingURL=decls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decls.js","sourceRoot":"","sources":["../../../../src/packlets/context/convert/decls.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAiG;AAQjG,2CAA2C;AAE3C;;;GAGG;AACU,QAAA,yBAAyB,GAAG,qBAAU,CAAC,YAAY,CAA6B;IAC3F,SAAS,EAAE,qBAAU,CAAC,MAAM;IAC5B,KAAK,EAAE,qBAAU,CAAC,MAAM;CACzB,CAAC,CAAC;AAEH;;;GAGG;AACU,QAAA,WAAW,GAAG,qBAAU,CAAC,QAAQ,CAAC,qBAAU,CAAC,MAAM,CAAC,CAAC;AAalE;;;;;GAKG;AACU,QAAA,kCAAkC,GAAG,qBAAU,CAAC,OAAO,CAIlE,CACE,IAAa,EACb,MAAM,EACN,OAAoC,EACS,EAAE;IAC/C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,kBAAO,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,iCAAyB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;QAChE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,OAAO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EAAE,EAAE;wBACnB,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;wBAC/B,OAAO,IAAA,kBAAO,EAAC,KAAK,CAAC,CAAC;oBACxB,CAAC,CAAC;yBACD,cAAc,CAAC,MAAM,CAAC,CAAC;gBAC5B,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC,cAAc,CAAC,kBAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC,CACF,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 { Converters, Failure, MessageAggregator, Result, succeed, Success } from '@fgv/ts-utils';\nimport {\n IContextQualifierValueDecl,\n IValidatedContextDecl,\n IValidatedContextQualifierValueDecl\n} from '../contextDecls';\nimport { IReadOnlyQualifierCollector } from '../../qualifiers';\n\n/* eslint-disable @rushstack/typedef-var */\n\n/**\n * Converter for a {@link Context.IContextQualifierValueDecl | context qualifier value declaration}.\n * @public\n */\nexport const contextQualifierValueDecl = Converters.strictObject<IContextQualifierValueDecl>({\n qualifier: Converters.string,\n value: Converters.string\n});\n\n/**\n * Converter for a {@link Context.IContextDecl | context declaration}.\n * @public\n */\nexport const contextDecl = Converters.recordOf(Converters.string);\n\n/**\n * Context necessary to convert a {@link Context.IContextQualifierValueDecl | context qualifier value declaration}\n * or {@link Context.IContextDecl | context declaration} to their\n * equivalent - {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declaration}\n * or {@link Context.IValidatedContextDecl | validated context declaration}, respectively.\n * @public\n */\nexport interface IContextDeclConvertContext {\n readonly qualifiers: IReadOnlyQualifierCollector;\n}\n\n/**\n * Converter which constructs a {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declaration}\n * from a {@link Context.IContextQualifierValueDecl | context qualifier value declaration}, instantiating qualifiers by name\n * from a supplied {@link Context.Convert.IContextDeclConvertContext | conversion context}.\n * @public\n */\nexport const validatedContextQualifierValueDecl = Converters.generic<\n IValidatedContextQualifierValueDecl,\n IContextDeclConvertContext\n>(\n (\n from: unknown,\n __self,\n context?: IContextDeclConvertContext\n ): Result<IValidatedContextQualifierValueDecl> => {\n if (!context) {\n return Failure.with('validatedContextQualifierValueDecl converter requires a context');\n }\n return contextQualifierValueDecl.convert(from).onSuccess((decl) => {\n const { value: qualifier, message } = context.qualifiers.validating.get(decl.qualifier);\n if (message !== undefined) {\n return Failure.with(message);\n }\n return qualifier.validateContextValue(decl.value).onSuccess((value) => {\n return Success.with({\n qualifier,\n value\n });\n });\n });\n }\n);\n\n/**\n * Converter which constructs a {@link Context.IValidatedContextDecl | validated context declaration}\n * from a {@link Context.IContextDecl | context declaration}, instantiating qualifiers by name\n * from a supplied {@link Context.Convert.IContextDeclConvertContext | conversion context}.\n * @public\n */\nexport const validatedContextDecl = Converters.generic<IValidatedContextDecl, IContextDeclConvertContext>(\n (from: unknown, __self, context?: IContextDeclConvertContext): Result<IValidatedContextDecl> => {\n if (!context) {\n /* c8 ignore next 2 - functional code path tested but coverage intermittently missed */\n return Failure.with('validatedContextDecl converter requires a context');\n }\n\n return contextDecl.convert(from).onSuccess((decl) => {\n const errors = new MessageAggregator();\n const result: IValidatedContextDecl = {};\n\n for (const key in decl) {\n if (key in decl) {\n const { value: qualifier } = context.qualifiers.validating.get(key).aggregateError(errors);\n if (qualifier !== undefined) {\n qualifier\n .validateContextValue(decl[key])\n .onSuccess((value) => {\n result[qualifier.name] = value;\n return succeed(value);\n })\n .aggregateError(errors);\n }\n }\n }\n return errors.returnOrReport(Success.with(result));\n });\n }\n);\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './decls';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/context/convert/index.ts"],"names":[],"mappings":"AAsBA,cAAc,SAAS,CAAC"}
@@ -0,0 +1,39 @@
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
+ __exportStar(require("./decls"), exports);
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/context/convert/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,0CAAwB","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\nexport * from './decls';\n"]}
@@ -0,0 +1,5 @@
1
+ import * as Convert from './convert';
2
+ export * from './contextDecls';
3
+ export * from './contextToken';
4
+ export { Convert };
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/context/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,OAAO,EAAE,CAAC"}