@fgv/ts-res 5.0.0-9 → 5.0.1-1

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 (384) hide show
  1. package/CHANGELOG.json +21 -0
  2. package/CHANGELOG.md +14 -1
  3. package/README.md +794 -137
  4. package/dist/ts-res.d.ts +2257 -268
  5. package/dist/tsdoc-metadata.json +1 -1
  6. package/eslint.config.js +16 -0
  7. package/lib/index.d.ts +2 -1
  8. package/lib/index.js +3 -1
  9. package/lib/packlets/bundle/bundleBuilder.js +7 -4
  10. package/lib/packlets/bundle/bundleLoader.js +1 -0
  11. package/lib/packlets/bundle/bundleUtils.js +14 -16
  12. package/lib/packlets/bundle/index.d.ts +3 -1
  13. package/lib/packlets/bundle/index.js +14 -3
  14. package/lib/packlets/common/convert.d.ts +15 -0
  15. package/lib/packlets/common/convert.js +16 -1
  16. package/lib/packlets/common/helpers/context.js +1 -0
  17. package/lib/packlets/common/helpers/resources.d.ts +7 -0
  18. package/lib/packlets/common/helpers/resources.js +13 -0
  19. package/lib/packlets/common/resources.d.ts +44 -1
  20. package/lib/packlets/common/validate/conditions.d.ts +17 -1
  21. package/lib/packlets/common/validate/conditions.js +32 -6
  22. package/lib/packlets/common/validate/regularExpressions.d.ts +4 -0
  23. package/lib/packlets/common/validate/regularExpressions.js +5 -1
  24. package/lib/packlets/common/validate/resources.d.ts +35 -1
  25. package/lib/packlets/common/validate/resources.js +55 -0
  26. package/lib/packlets/conditions/condition.js +1 -0
  27. package/lib/packlets/conditions/conditionSet.d.ts +9 -0
  28. package/lib/packlets/conditions/conditionSet.js +75 -1
  29. package/lib/packlets/config/configInitFactory.d.ts +217 -0
  30. package/lib/packlets/config/configInitFactory.js +302 -0
  31. package/lib/packlets/config/convert.d.ts +9 -0
  32. package/lib/packlets/config/convert.js +12 -1
  33. package/lib/packlets/config/index.d.ts +1 -0
  34. package/lib/packlets/config/index.js +1 -0
  35. package/lib/packlets/config/json.d.ts +1 -1
  36. package/lib/packlets/config/systemConfiguration.d.ts +16 -3
  37. package/lib/packlets/config/systemConfiguration.js +19 -40
  38. package/lib/packlets/import/fsItem.d.ts +2 -1
  39. package/lib/packlets/import/fsItem.js +9 -13
  40. package/lib/packlets/import/importManager.d.ts +2 -1
  41. package/lib/packlets/import/importers/jsonImporter.js +1 -0
  42. package/lib/packlets/import/importers/pathImporter.d.ts +2 -1
  43. package/lib/packlets/import/importers/pathImporter.js +2 -1
  44. package/lib/packlets/qualifier-types/config/convert.d.ts +22 -1
  45. package/lib/packlets/qualifier-types/config/convert.js +67 -2
  46. package/lib/packlets/qualifier-types/config/json.d.ts +24 -2
  47. package/lib/packlets/qualifier-types/config/json.js +11 -0
  48. package/lib/packlets/qualifier-types/convert.d.ts +1 -1
  49. package/lib/packlets/qualifier-types/helpers.d.ts +14 -5
  50. package/lib/packlets/qualifier-types/helpers.js +2 -2
  51. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +28 -2
  52. package/lib/packlets/qualifier-types/languageQualifierType.js +73 -0
  53. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +31 -5
  54. package/lib/packlets/qualifier-types/literalQualifierType.js +75 -0
  55. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts +7 -11
  56. package/lib/packlets/qualifier-types/literalValueHierarchy.js +12 -1
  57. package/lib/packlets/qualifier-types/qualifierType.d.ts +31 -2
  58. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +31 -5
  59. package/lib/packlets/qualifier-types/territoryQualifierType.js +80 -0
  60. package/lib/packlets/qualifiers/qualifierCollector.js +1 -2
  61. package/lib/packlets/resource-json/compiled/convert.js +2 -1
  62. package/lib/packlets/resource-json/compiled/json.d.ts +6 -2
  63. package/lib/packlets/resource-types/config/convert.d.ts +1 -1
  64. package/lib/packlets/resource-types/config/convert.js +3 -1
  65. package/lib/packlets/resource-types/config/json.d.ts +3 -1
  66. package/lib/packlets/resource-types/jsonResourceType.d.ts +10 -1
  67. package/lib/packlets/resource-types/jsonResourceType.js +7 -3
  68. package/lib/packlets/resource-types/resourceType.d.ts +100 -8
  69. package/lib/packlets/resource-types/resourceType.js +39 -3
  70. package/lib/packlets/resources/candidateReducer.js +3 -0
  71. package/lib/packlets/resources/candidateValue.d.ts +92 -0
  72. package/lib/packlets/resources/candidateValue.js +128 -0
  73. package/lib/packlets/resources/candidateValueCollector.d.ts +55 -0
  74. package/lib/packlets/resources/candidateValueCollector.js +96 -0
  75. package/lib/packlets/resources/common.d.ts +14 -0
  76. package/lib/packlets/resources/deltaGenerator.d.ts +189 -0
  77. package/lib/packlets/resources/deltaGenerator.js +344 -0
  78. package/lib/packlets/resources/index.d.ts +3 -0
  79. package/lib/packlets/resources/index.js +3 -0
  80. package/lib/packlets/resources/resource.d.ts +6 -6
  81. package/lib/packlets/resources/resource.js +5 -10
  82. package/lib/packlets/resources/resourceBuilder.d.ts +6 -0
  83. package/lib/packlets/resources/resourceBuilder.js +4 -1
  84. package/lib/packlets/resources/resourceCandidate.d.ts +15 -2
  85. package/lib/packlets/resources/resourceCandidate.js +17 -5
  86. package/lib/packlets/resources/resourceManagerBuilder.d.ts +131 -10
  87. package/lib/packlets/resources/resourceManagerBuilder.js +289 -45
  88. package/lib/packlets/runtime/compiledResourceCollection.d.ts +27 -11
  89. package/lib/packlets/runtime/compiledResourceCollection.js +71 -28
  90. package/lib/packlets/runtime/conditionSetResolutionResult.js +3 -0
  91. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts +53 -3
  92. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts +82 -37
  93. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js +49 -77
  94. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +23 -2
  95. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +53 -31
  96. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +4 -4
  97. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +2 -2
  98. package/lib/packlets/runtime/iResourceManager.d.ts +17 -5
  99. package/lib/packlets/runtime/index.d.ts +1 -0
  100. package/lib/packlets/runtime/index.js +1 -0
  101. package/lib/packlets/runtime/resource-tree/common.d.ts +1 -1
  102. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts +7 -7
  103. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +5 -5
  104. package/lib/packlets/runtime/resourceResolver.d.ts +43 -1
  105. package/lib/packlets/runtime/resourceResolver.js +56 -28
  106. package/lib/packlets/runtime/resourceTreeResolver.d.ts +152 -0
  107. package/lib/packlets/runtime/resourceTreeResolver.js +222 -0
  108. package/lib/packlets/runtime/validate.js +1 -0
  109. package/lib/packlets/zip-archive/convert.d.ts +52 -0
  110. package/lib/packlets/zip-archive/convert.js +103 -0
  111. package/lib/packlets/zip-archive/index.d.ts +23 -0
  112. package/lib/packlets/zip-archive/index.js +95 -0
  113. package/lib/packlets/zip-archive/json.d.ts +64 -0
  114. package/lib/packlets/zip-archive/json.js +24 -0
  115. package/lib/packlets/zip-archive/types.d.ts +98 -0
  116. package/lib/packlets/zip-archive/types.js +39 -0
  117. package/lib/packlets/zip-archive/zipArchiveCreator.d.ts +35 -0
  118. package/lib/packlets/zip-archive/zipArchiveCreator.js +195 -0
  119. package/lib/packlets/zip-archive/zipArchiveFormat.d.ts +70 -0
  120. package/lib/packlets/zip-archive/zipArchiveFormat.js +184 -0
  121. package/lib/packlets/zip-archive/zipArchiveLoader.d.ts +70 -0
  122. package/lib/packlets/zip-archive/zipArchiveLoader.js +286 -0
  123. package/package.json +26 -32
  124. package/CLAUDE.md +0 -186
  125. package/EXAMPLE_INIT_PARAMS.md +0 -88
  126. package/PROGRESS_SUMMARY.md +0 -48
  127. package/lib/index.d.ts.map +0 -1
  128. package/lib/index.js.map +0 -1
  129. package/lib/packlets/bundle/bundleBuilder.d.ts.map +0 -1
  130. package/lib/packlets/bundle/bundleBuilder.js.map +0 -1
  131. package/lib/packlets/bundle/bundleLoader.d.ts.map +0 -1
  132. package/lib/packlets/bundle/bundleLoader.js.map +0 -1
  133. package/lib/packlets/bundle/bundleNormalizer.d.ts.map +0 -1
  134. package/lib/packlets/bundle/bundleNormalizer.js.map +0 -1
  135. package/lib/packlets/bundle/bundleUtils.d.ts.map +0 -1
  136. package/lib/packlets/bundle/bundleUtils.js.map +0 -1
  137. package/lib/packlets/bundle/convert.d.ts.map +0 -1
  138. package/lib/packlets/bundle/convert.js.map +0 -1
  139. package/lib/packlets/bundle/index.d.ts.map +0 -1
  140. package/lib/packlets/bundle/index.js.map +0 -1
  141. package/lib/packlets/bundle/model.d.ts.map +0 -1
  142. package/lib/packlets/bundle/model.js.map +0 -1
  143. package/lib/packlets/common/conditions.d.ts.map +0 -1
  144. package/lib/packlets/common/conditions.js.map +0 -1
  145. package/lib/packlets/common/convert.d.ts.map +0 -1
  146. package/lib/packlets/common/convert.js.map +0 -1
  147. package/lib/packlets/common/helpers/conditions.d.ts.map +0 -1
  148. package/lib/packlets/common/helpers/conditions.js.map +0 -1
  149. package/lib/packlets/common/helpers/context.d.ts.map +0 -1
  150. package/lib/packlets/common/helpers/context.js.map +0 -1
  151. package/lib/packlets/common/helpers/index.d.ts.map +0 -1
  152. package/lib/packlets/common/helpers/index.js.map +0 -1
  153. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +0 -1
  154. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +0 -1
  155. package/lib/packlets/common/helpers/resources.d.ts.map +0 -1
  156. package/lib/packlets/common/helpers/resources.js.map +0 -1
  157. package/lib/packlets/common/index.d.ts.map +0 -1
  158. package/lib/packlets/common/index.js.map +0 -1
  159. package/lib/packlets/common/resources.d.ts.map +0 -1
  160. package/lib/packlets/common/resources.js.map +0 -1
  161. package/lib/packlets/common/validate/conditions.d.ts.map +0 -1
  162. package/lib/packlets/common/validate/conditions.js.map +0 -1
  163. package/lib/packlets/common/validate/index.d.ts.map +0 -1
  164. package/lib/packlets/common/validate/index.js.map +0 -1
  165. package/lib/packlets/common/validate/regularExpressions.d.ts.map +0 -1
  166. package/lib/packlets/common/validate/regularExpressions.js.map +0 -1
  167. package/lib/packlets/common/validate/resources.d.ts.map +0 -1
  168. package/lib/packlets/common/validate/resources.js.map +0 -1
  169. package/lib/packlets/conditions/condition.d.ts.map +0 -1
  170. package/lib/packlets/conditions/condition.js.map +0 -1
  171. package/lib/packlets/conditions/conditionCollector.d.ts.map +0 -1
  172. package/lib/packlets/conditions/conditionCollector.js.map +0 -1
  173. package/lib/packlets/conditions/conditionDecls.d.ts.map +0 -1
  174. package/lib/packlets/conditions/conditionDecls.js.map +0 -1
  175. package/lib/packlets/conditions/conditionSet.d.ts.map +0 -1
  176. package/lib/packlets/conditions/conditionSet.js.map +0 -1
  177. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +0 -1
  178. package/lib/packlets/conditions/conditionSetCollector.js.map +0 -1
  179. package/lib/packlets/conditions/conditionSetDecls.d.ts.map +0 -1
  180. package/lib/packlets/conditions/conditionSetDecls.js.map +0 -1
  181. package/lib/packlets/conditions/conditionToken.d.ts.map +0 -1
  182. package/lib/packlets/conditions/conditionToken.js.map +0 -1
  183. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +0 -1
  184. package/lib/packlets/conditions/convert/conditionSetDecls.js.map +0 -1
  185. package/lib/packlets/conditions/convert/decls.d.ts.map +0 -1
  186. package/lib/packlets/conditions/convert/decls.js.map +0 -1
  187. package/lib/packlets/conditions/convert/index.d.ts.map +0 -1
  188. package/lib/packlets/conditions/convert/index.js.map +0 -1
  189. package/lib/packlets/conditions/index.d.ts.map +0 -1
  190. package/lib/packlets/conditions/index.js.map +0 -1
  191. package/lib/packlets/config/common.d.ts.map +0 -1
  192. package/lib/packlets/config/common.js.map +0 -1
  193. package/lib/packlets/config/convert.d.ts.map +0 -1
  194. package/lib/packlets/config/convert.js.map +0 -1
  195. package/lib/packlets/config/index.d.ts.map +0 -1
  196. package/lib/packlets/config/index.js.map +0 -1
  197. package/lib/packlets/config/json.d.ts.map +0 -1
  198. package/lib/packlets/config/json.js.map +0 -1
  199. package/lib/packlets/config/predefined/default.d.ts.map +0 -1
  200. package/lib/packlets/config/predefined/default.js.map +0 -1
  201. package/lib/packlets/config/predefined/extended.d.ts.map +0 -1
  202. package/lib/packlets/config/predefined/extended.js.map +0 -1
  203. package/lib/packlets/config/predefined/index.d.ts.map +0 -1
  204. package/lib/packlets/config/predefined/index.js.map +0 -1
  205. package/lib/packlets/config/systemConfiguration.d.ts.map +0 -1
  206. package/lib/packlets/config/systemConfiguration.js.map +0 -1
  207. package/lib/packlets/context/contextDecls.d.ts.map +0 -1
  208. package/lib/packlets/context/contextDecls.js.map +0 -1
  209. package/lib/packlets/context/contextToken.d.ts.map +0 -1
  210. package/lib/packlets/context/contextToken.js.map +0 -1
  211. package/lib/packlets/context/convert/decls.d.ts.map +0 -1
  212. package/lib/packlets/context/convert/decls.js.map +0 -1
  213. package/lib/packlets/context/convert/index.d.ts.map +0 -1
  214. package/lib/packlets/context/convert/index.js.map +0 -1
  215. package/lib/packlets/context/index.d.ts.map +0 -1
  216. package/lib/packlets/context/index.js.map +0 -1
  217. package/lib/packlets/decisions/abstractDecision.d.ts.map +0 -1
  218. package/lib/packlets/decisions/abstractDecision.js.map +0 -1
  219. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +0 -1
  220. package/lib/packlets/decisions/abstractDecisionCollector.js.map +0 -1
  221. package/lib/packlets/decisions/candidate.d.ts.map +0 -1
  222. package/lib/packlets/decisions/candidate.js.map +0 -1
  223. package/lib/packlets/decisions/common.d.ts.map +0 -1
  224. package/lib/packlets/decisions/common.js.map +0 -1
  225. package/lib/packlets/decisions/concreteDecision.d.ts.map +0 -1
  226. package/lib/packlets/decisions/concreteDecision.js.map +0 -1
  227. package/lib/packlets/decisions/decision.d.ts.map +0 -1
  228. package/lib/packlets/decisions/decision.js.map +0 -1
  229. package/lib/packlets/decisions/index.d.ts.map +0 -1
  230. package/lib/packlets/decisions/index.js.map +0 -1
  231. package/lib/packlets/import/fsItem.d.ts.map +0 -1
  232. package/lib/packlets/import/fsItem.js.map +0 -1
  233. package/lib/packlets/import/importContext.d.ts.map +0 -1
  234. package/lib/packlets/import/importContext.js.map +0 -1
  235. package/lib/packlets/import/importManager.d.ts.map +0 -1
  236. package/lib/packlets/import/importManager.js.map +0 -1
  237. package/lib/packlets/import/importable.d.ts.map +0 -1
  238. package/lib/packlets/import/importable.js.map +0 -1
  239. package/lib/packlets/import/importers/collectionImporter.d.ts.map +0 -1
  240. package/lib/packlets/import/importers/collectionImporter.js.map +0 -1
  241. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +0 -1
  242. package/lib/packlets/import/importers/fsItemImporter.js.map +0 -1
  243. package/lib/packlets/import/importers/importer.d.ts.map +0 -1
  244. package/lib/packlets/import/importers/importer.js.map +0 -1
  245. package/lib/packlets/import/importers/index.d.ts.map +0 -1
  246. package/lib/packlets/import/importers/index.js.map +0 -1
  247. package/lib/packlets/import/importers/jsonImporter.d.ts.map +0 -1
  248. package/lib/packlets/import/importers/jsonImporter.js.map +0 -1
  249. package/lib/packlets/import/importers/pathImporter.d.ts.map +0 -1
  250. package/lib/packlets/import/importers/pathImporter.js.map +0 -1
  251. package/lib/packlets/import/index.d.ts.map +0 -1
  252. package/lib/packlets/import/index.js.map +0 -1
  253. package/lib/packlets/qualifier-types/config/convert.d.ts.map +0 -1
  254. package/lib/packlets/qualifier-types/config/convert.js.map +0 -1
  255. package/lib/packlets/qualifier-types/config/index.d.ts.map +0 -1
  256. package/lib/packlets/qualifier-types/config/index.js.map +0 -1
  257. package/lib/packlets/qualifier-types/config/json.d.ts.map +0 -1
  258. package/lib/packlets/qualifier-types/config/json.js.map +0 -1
  259. package/lib/packlets/qualifier-types/convert.d.ts.map +0 -1
  260. package/lib/packlets/qualifier-types/convert.js.map +0 -1
  261. package/lib/packlets/qualifier-types/helpers.d.ts.map +0 -1
  262. package/lib/packlets/qualifier-types/helpers.js.map +0 -1
  263. package/lib/packlets/qualifier-types/index.d.ts.map +0 -1
  264. package/lib/packlets/qualifier-types/index.js.map +0 -1
  265. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +0 -1
  266. package/lib/packlets/qualifier-types/languageQualifierType.js.map +0 -1
  267. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +0 -1
  268. package/lib/packlets/qualifier-types/literalQualifierType.js.map +0 -1
  269. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +0 -1
  270. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +0 -1
  271. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +0 -1
  272. package/lib/packlets/qualifier-types/qualifierType.js.map +0 -1
  273. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +0 -1
  274. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +0 -1
  275. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +0 -1
  276. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +0 -1
  277. package/lib/packlets/qualifiers/convert/decls.d.ts.map +0 -1
  278. package/lib/packlets/qualifiers/convert/decls.js.map +0 -1
  279. package/lib/packlets/qualifiers/convert/index.d.ts.map +0 -1
  280. package/lib/packlets/qualifiers/convert/index.js.map +0 -1
  281. package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +0 -1
  282. package/lib/packlets/qualifiers/convert/qualifier.js.map +0 -1
  283. package/lib/packlets/qualifiers/index.d.ts.map +0 -1
  284. package/lib/packlets/qualifiers/index.js.map +0 -1
  285. package/lib/packlets/qualifiers/qualifier.d.ts.map +0 -1
  286. package/lib/packlets/qualifiers/qualifier.js.map +0 -1
  287. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +0 -1
  288. package/lib/packlets/qualifiers/qualifierCollector.js.map +0 -1
  289. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +0 -1
  290. package/lib/packlets/qualifiers/qualifierDecl.js.map +0 -1
  291. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +0 -1
  292. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +0 -1
  293. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +0 -1
  294. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +0 -1
  295. package/lib/packlets/resource-json/compiled/common.d.ts.map +0 -1
  296. package/lib/packlets/resource-json/compiled/common.js.map +0 -1
  297. package/lib/packlets/resource-json/compiled/convert.d.ts.map +0 -1
  298. package/lib/packlets/resource-json/compiled/convert.js.map +0 -1
  299. package/lib/packlets/resource-json/compiled/index.d.ts.map +0 -1
  300. package/lib/packlets/resource-json/compiled/index.js.map +0 -1
  301. package/lib/packlets/resource-json/compiled/json.d.ts.map +0 -1
  302. package/lib/packlets/resource-json/compiled/json.js.map +0 -1
  303. package/lib/packlets/resource-json/convert.d.ts.map +0 -1
  304. package/lib/packlets/resource-json/convert.js.map +0 -1
  305. package/lib/packlets/resource-json/helpers.d.ts.map +0 -1
  306. package/lib/packlets/resource-json/helpers.js.map +0 -1
  307. package/lib/packlets/resource-json/index.d.ts.map +0 -1
  308. package/lib/packlets/resource-json/index.js.map +0 -1
  309. package/lib/packlets/resource-json/json.d.ts.map +0 -1
  310. package/lib/packlets/resource-json/json.js.map +0 -1
  311. package/lib/packlets/resource-json/normalized.d.ts.map +0 -1
  312. package/lib/packlets/resource-json/normalized.js.map +0 -1
  313. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +0 -1
  314. package/lib/packlets/resource-json/resourceDeclCollection.js.map +0 -1
  315. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +0 -1
  316. package/lib/packlets/resource-json/resourceDeclContainer.js.map +0 -1
  317. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +0 -1
  318. package/lib/packlets/resource-json/resourceDeclTree.js.map +0 -1
  319. package/lib/packlets/resource-types/config/convert.d.ts.map +0 -1
  320. package/lib/packlets/resource-types/config/convert.js.map +0 -1
  321. package/lib/packlets/resource-types/config/index.d.ts.map +0 -1
  322. package/lib/packlets/resource-types/config/index.js.map +0 -1
  323. package/lib/packlets/resource-types/config/json.d.ts.map +0 -1
  324. package/lib/packlets/resource-types/config/json.js.map +0 -1
  325. package/lib/packlets/resource-types/helpers.d.ts.map +0 -1
  326. package/lib/packlets/resource-types/helpers.js.map +0 -1
  327. package/lib/packlets/resource-types/index.d.ts.map +0 -1
  328. package/lib/packlets/resource-types/index.js.map +0 -1
  329. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +0 -1
  330. package/lib/packlets/resource-types/jsonResourceType.js.map +0 -1
  331. package/lib/packlets/resource-types/resourceType.d.ts.map +0 -1
  332. package/lib/packlets/resource-types/resourceType.js.map +0 -1
  333. package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +0 -1
  334. package/lib/packlets/resource-types/resourceTypeCollector.js.map +0 -1
  335. package/lib/packlets/resources/candidateReducer.d.ts.map +0 -1
  336. package/lib/packlets/resources/candidateReducer.js.map +0 -1
  337. package/lib/packlets/resources/common.d.ts.map +0 -1
  338. package/lib/packlets/resources/common.js.map +0 -1
  339. package/lib/packlets/resources/index.d.ts.map +0 -1
  340. package/lib/packlets/resources/index.js.map +0 -1
  341. package/lib/packlets/resources/resource.d.ts.map +0 -1
  342. package/lib/packlets/resources/resource.js.map +0 -1
  343. package/lib/packlets/resources/resourceBuilder.d.ts.map +0 -1
  344. package/lib/packlets/resources/resourceBuilder.js.map +0 -1
  345. package/lib/packlets/resources/resourceCandidate.d.ts.map +0 -1
  346. package/lib/packlets/resources/resourceCandidate.js.map +0 -1
  347. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +0 -1
  348. package/lib/packlets/resources/resourceManagerBuilder.js.map +0 -1
  349. package/lib/packlets/runtime/cacheListener.d.ts.map +0 -1
  350. package/lib/packlets/runtime/cacheListener.js.map +0 -1
  351. package/lib/packlets/runtime/cacheMetrics.d.ts.map +0 -1
  352. package/lib/packlets/runtime/cacheMetrics.js.map +0 -1
  353. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +0 -1
  354. package/lib/packlets/runtime/compiledResourceCollection.js.map +0 -1
  355. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +0 -1
  356. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +0 -1
  357. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +0 -1
  358. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +0 -1
  359. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +0 -1
  360. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +0 -1
  361. package/lib/packlets/runtime/context/index.d.ts.map +0 -1
  362. package/lib/packlets/runtime/context/index.js.map +0 -1
  363. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +0 -1
  364. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +0 -1
  365. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +0 -1
  366. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +0 -1
  367. package/lib/packlets/runtime/iResourceManager.d.ts.map +0 -1
  368. package/lib/packlets/runtime/iResourceManager.js.map +0 -1
  369. package/lib/packlets/runtime/index.d.ts.map +0 -1
  370. package/lib/packlets/runtime/index.js.map +0 -1
  371. package/lib/packlets/runtime/resource-tree/common.d.ts.map +0 -1
  372. package/lib/packlets/runtime/resource-tree/common.js.map +0 -1
  373. package/lib/packlets/runtime/resource-tree/index.d.ts.map +0 -1
  374. package/lib/packlets/runtime/resource-tree/index.js.map +0 -1
  375. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +0 -1
  376. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +0 -1
  377. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +0 -1
  378. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +0 -1
  379. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +0 -1
  380. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +0 -1
  381. package/lib/packlets/runtime/resourceResolver.d.ts.map +0 -1
  382. package/lib/packlets/runtime/resourceResolver.js.map +0 -1
  383. package/lib/packlets/runtime/validate.d.ts.map +0 -1
  384. package/lib/packlets/runtime/validate.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource.js","sourceRoot":"","sources":["../../../src/packlets/resources/resource.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAwF;AACxF,sCAAiD;AACjD,2DAAwD;AACxD,yDAAsD;AAEtD,4CAA2E;AA8B3E;;;;GAIG;AACH,MAAa,QAAQ;IAkBnB;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAW,gBAAgB;QACzB,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACH,YAAsB,MAA6B;QACjD,MAAM,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,iBAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9E,IAAI,CAAC,EAAE,GAAG,QAAQ,CAAC,6BAA6B,CAAC,EAAE,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC;QAClF,IAAI,CAAC,aAAa,GAAG,qCAAiB,CAAC,qBAAqB,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,CAAC;aACjG,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;YACf,uFAAuF;YACvF,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;gBACpB,OAAO,IAAA,eAAI,EAAe,GAAG,MAAM,CAAC,EAAE,mDAAmD,CAAC,CAAC;YAC7F,CAAC;YACD,OAAO,I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ted, 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 { MessageAggregator, Result, captureResult, fail, succeed } from '@fgv/ts-utils';\nimport { ResourceId, Validate } from '../common';\nimport { ResourceCandidate } from './resourceCandidate';\nimport { CandidateReducer } from './candidateReducer';\nimport { ResourceType } from '../resource-types';\nimport { ConcreteDecision, AbstractDecisionCollector } from '../decisions';\nimport { IResource } from '../runtime';\nimport { IResourceDeclarationOptions, ICompiledResourceOptionsWithFilter } from './common';\nimport * as ResourceJson from '../resource-json';\nimport * as Context from '../context';\n\n/**\n * Parameters used to create a {@link Resources.Resource | Resource} object.\n * @public\n */\nexport interface IResourceCreateParams {\n /**\n * The id of the resource.\n */\n id?: string;\n /**\n * Optional {@link ResourceTypes.ResourceType | type} of the resource. If not specified, the type will be inferred\n * from the candidates.\n */\n resourceType?: ResourceType;\n /**\n * Array of {@link Resources.ResourceCandidate | candidates} for the resource.\n */\n candidates: ReadonlyArray<ResourceCandidate>;\n /**\n * {@link Decisions.AbstractDecisionCollector | AbstractDecisionCollector} used to create the optimized decision.\n */\n decisions: AbstractDecisionCollector;\n}\n\n/**\n * Represents a single logical resource, with a unique id and a set of possible\n * candidate instances.\n * @public\n */\nexport class Resource implements IResource {\n /**\n * The unique {@link ResourceId | id} of the resource.\n */\n public readonly id: ResourceId;\n /**\n * The {@link ResourceTypes.ResourceType | type} of the resource.\n */\n public readonly _resourceType: ResourceType;\n /**\n * The array of {@link Resources.ResourceCandidate | candidates} for the resource.\n */\n public readonly candidates: ReadonlyArray<ResourceCandidate>;\n /**\n * {@link Decisions.ConcreteDecision | Decision} for optimized resource resolution.\n */\n public readonly decision: ConcreteDecision;\n\n /**\n * Gets the resource type (implements IResource interface).\n */\n public get resourceType(): ResourceType {\n return this._resourceType;\n }\n\n /**\n * Gets the resource type name as a string.\n */\n public get resourceTypeName(): string {\n return this._resourceType.key;\n }\n\n /**\n * Constructor for a {@link Resources.Resource | Resource} object.\n * @param params - {@link Resources.IResourceCreateParams | Parameters} used to create the resource.\n * @public\n */\n protected constructor(params: IResourceCreateParams) {\n const id = params.id ? Validate.toResourceId(params.id).orThrow() : undefined;\n this.id = Resource._validateCandidateResourceIds(id, params.candidates).orThrow();\n this._resourceType = ResourceCandidate.validateResourceTypes(params.candidates, params.resourceType)\n .onSuccess((t) => {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (t === undefined) {\n return fail<ResourceType>(`${params.id}: no type specified and no candidates with types.`);\n }\n return succeed(t);\n })\n .orThrow();\n\n this.candidates = Resource._validateAndNormalizeCandidates(params.candidates).orThrow();\n this.decision = Resource._createOptimizedDecision(this.candidates, params.decisions).orThrow();\n }\n\n /**\n * Creates a new {@link Resources.Resource | Resource} object.\n * @param params - {@link Resources.IResourceCreateParams | Parameters} used to create the resource.\n * @returns `Success` with the new {@link Resources.Resource | Resource} object if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public static create(params: IResourceCreateParams): Result<Resource> {\n return captureResult(() => new Resource(params));\n }\n\n /**\n * Gets the candidates for this resource that match the specified {@link Context.IValidatedContextDecl | context}.\n * @param context - The {@link Context.IValidatedContextDecl | context} to match against.\n * @param options - {@link Context.IContextMatchOptions | options} for the context match.\n * @returns The array of {@link Resources.ResourceCandidate | candidates} that match the context.\n */\n public getCandidatesForContext(\n context: Context.IValidatedContextDecl,\n options?: Context.IContextMatchOptions\n ): ReadonlyArray<ResourceCandidate> {\n return this.candidates.filter((c) => c.canMatchPartialContext(context, options));\n }\n\n /**\n * Gets the {@link ResourceJson.Json.IChildResourceDecl | child resource declaration} for this resource.\n * @param options - {@link ResourceJson.Helpers.IDeclarationOptions | options} for the declaration.\n * @returns The {@link ResourceJson.Json.IChildResourceDecl | child resource declaration}.\n */\n public toChildResourceDecl(options?: IResourceDeclarationOptions): ResourceJson.Json.IChildResourceDecl {\n /* c8 ignore next 1 - defense in depth */\n options = options ?? {};\n const matches = this._getMatchingCandidates(options);\n\n const candidates = options.reduceQualifiers\n ? CandidateReducer.reduceToChildResourceCandidateDecls(matches, options.filterForContext).orThrow()\n : matches.map((c) => c.toChildResourceCandidateDecl());\n\n return {\n resourceTypeName: this.resourceTypeName,\n ...(candidates.length > 0 ? { candidates } : {})\n };\n }\n\n /**\n * Gets the {@link ResourceJson.Json.ILooseResourceDecl | loose resource declaration} for this resource.\n * @param options - {@link Resources.IResourceDeclarationOptions | options} for the declaration.\n * @returns The {@link ResourceJson.Json.ILooseResourceDecl | loose resource declaration}.\n */\n public toLooseResourceDecl(options?: IResourceDeclarationOptions): ResourceJson.Json.ILooseResourceDecl {\n /* c8 ignore next 1 - defense in depth */\n options = options ?? {};\n const matches = this._getMatchingCandidates(options);\n\n const candidates = options.reduceQualifiers\n ? CandidateReducer.reduceToChildResourceCandidateDecls(matches, options.filterForContext).orThrow()\n : matches.map((c) => c.toChildResourceCandidateDecl());\n\n return {\n id: this.id,\n resourceTypeName: this.resourceTypeName,\n ...(candidates.length > 0 ? { candidates } : {})\n };\n }\n\n /**\n * Converts this resource to a compiled resource representation.\n * @param options - Optional compilation options controlling the output format and filtering.\n * @returns A compiled resource object that can be used for serialization or runtime processing.\n * @public\n */\n public toCompiled(\n options?: IResourceDeclarationOptions | ICompiledResourceOptionsWithFilter\n ): ResourceJson.Compiled.ICompiledResource {\n const candidates: ResourceJson.Compiled.ICompiledCandidate[] = this._getMatchingCandidates(options).map(\n (c) => ({\n json: c.json,\n isPartial: c.isPartial,\n mergeMethod: c.mergeMethod\n })\n );\n\n return {\n id: this.id,\n type: this.resourceType.index!,\n decision: this.decision.baseDecision.index!,\n candidates\n };\n }\n\n /**\n * Validates that all candidates have the same id as the resource.\n * @param resourceId - The expected id of the resource.\n * @param candidates - The array of candidates to validate.\n * @returns `Success` with the resource id if all candidates have the same id,\n * `Failure` with an error message otherwise.\n * @internal\n */\n private static _validateCandidateResourceIds(\n resourceId: ResourceId | undefined,\n candidates: ReadonlyArray<ResourceCandidate>\n ): Result<ResourceId> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!resourceId && candidates.length === 0) {\n return fail('unknown: no resource id and no candidates.');\n }\n resourceId = resourceId ?? candidates[0].id;\n\n const mismatched = candidates.filter((c) => c.id !== resourceId).map((c) => c.id);\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (mismatched.length > 0) {\n return fail(`${resourceId}: candidates with mismatched ids ${mismatched.join(', ')}.`);\n }\n return succeed(resourceId);\n }\n\n /**\n * Creates an optimized decision for the given candidates using the decisions collector.\n * @param candidates - The validated and normalized candidates to create a decision for.\n * @param decisions - The {@link Decisions.AbstractDecisionCollector | AbstractDecisionCollector} to use.\n * @returns `Success` with the {@link Decisions.ConcreteDecision | ConcreteDecision} if successful,\n * `Failure` with an error message otherwise.\n * @internal\n */\n private static _createOptimizedDecision(\n candidates: ReadonlyArray<ResourceCandidate>,\n decisions: AbstractDecisionCollector\n ): Result<ConcreteDecision> {\n const decisionCandidates = candidates.map((c) => ({\n conditionSet: c.conditions,\n value: c.json\n }));\n\n return ConcreteDecision.create({\n decisions,\n candidates: decisionCandidates\n });\n }\n\n /**\n * Validates and normalizes an array of {@link Resources.ResourceCandidate | candidates}. Fails if there\n * are multiple candidates for the same set of conditions.\n * @param candidates - The array of candidates to validate.\n * @returns `Success` with the validated and sorted array of candidates if successful,\n * `Failure` with an error message otherwise.\n * @internal\n */\n private static _validateAndNormalizeCandidates(\n candidates: ReadonlyArray<ResourceCandidate>\n ): Result<ReadonlyArray<ResourceCandidate>> {\n const errors = new MessageAggregator();\n const validated: Map<string, ResourceCandidate> = new Map();\n\n for (const candidate of candidates) {\n const conditionSetString = candidate.conditions.toString();\n const existing = validated.get(conditionSetString);\n if (existing) {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!ResourceCandidate.equal(candidate, existing)) {\n errors.addMessage(`${candidate.id}: duplicate candidates for ${conditionSetString}.`);\n }\n } else {\n validated.set(conditionSetString, candidate);\n }\n }\n return errors.returnOrReport(\n succeed(Array.from(validated.values()).sort(ResourceCandidate.compare).reverse())\n );\n }\n\n /**\n * Gets the appropriate candidates based on filtering options.\n * If a validated filter context is provided, returns only matching candidates.\n * Otherwise returns all candidates.\n * @param options - Options that may contain a validated filter context\n * @returns The filtered array of candidates\n * @internal\n */\n protected _getMatchingCandidates(\n options?: IResourceDeclarationOptions | ICompiledResourceOptionsWithFilter\n ): ReadonlyArray<ResourceCandidate> {\n /* c8 ignore next 5 - functional code path tested but coverage intermittently missed */\n if (options?.filterForContext) {\n return this.candidates.filter((candidate) =>\n candidate.canMatchPartialContext(options.filterForContext!, { partialContextMatch: true })\n );\n }\n return this.candidates;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceBuilder.d.ts","sourceRoot":"","sources":["../../../src/packlets/resources/resourceBuilder.ts"],"names":[],"mappings":"AAsBA,OAAO,EACL,WAAW,EACX,cAAc,EACd,MAAM,EACN,SAAS,EAMV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAY,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,iBAAiB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B;IAW1D;;;;;;OAMG;WACW,MAAM,CAAC,MAAM,EAAE,4BAA4B,GAAG,MAAM,CAAC,eAAe,CAAC;IAInF;;;;;OAKG;IACI,uBAAuB,CAC5B,OAAO,EAAE,OAAO,CAAC,qBAAqB,EACtC,OAAO,CAAC,EAAE,OAAO,CAAC,oBAAoB,GACrC,aAAa,CAAC,iBAAiB,CAAC;IAMnC;;;;;;;OAOG;IACI,iBAAiB,CACtB,SAAS,EAAE,YAAY,CAAC,IAAI,CAAC,2BAA2B,GACvD,cAAc,CAAC,iBAAiB,EAAE,2BAA2B,CAAC;IAyBjE;;;;;;;;;;OAUG;IACI,iBAAiB,CACtB,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,2BAA2B,GAClD,cAAc,CAAC,iBAAiB,EAAE,2BAA2B,CAAC;IAmBjE;;;;;;OAMG;IACI,eAAe,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC;IAczE;;;;;OAKG;IACI,KAAK,IAAI,MAAM,CAAC,QAAQ,CAAC;CAkBjC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceBuilder.js","sourceRoot":"","sources":["../../../src/packlets/resources/resourceBuilder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAUuB;AACvB,sCAAiD;AACjD,2DAAwD;AAExD,yCAAsC;AAyBtC;;;;;GAKG;AACH,MAAa,eAAe;IAM1B;;;;OAIG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,qCAAiB,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC;IACzF,CAAC;IA4BD;;;OAGG;IACH,YAAsB,MAAoC;QACxD,IAAI,CAAC,EAAE,GAAG,i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E,CAAC;YACjD,OAAO,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC;QACvB,CAAC;aAAM,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;YAC5C,OAAO,IAAA,eAAI,EACT,GAAG,IAAI,CAAC,EAAE,gCAAgC,IAAI,CAAC,aAAa,CAAC,GAAG,QAAQ,gBAAgB,GAAG,CAC5F,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,SAAS,CAAC,CAAC,YAAY,EAAE,EAAE;YACrF,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;YAClC,OAAO,IAAA,4BAAiB,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,KAAK;QACV,uFAAuF;QACvF,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YAChC,OAAO,IAAA,eAAI,EAAC,GAAG,IAAI,CAAC,EAAE,2BAA2B,CAAC,CAAC;QACrD,CAAC;QAED,uFAAuF;QACvF,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;YACrC,OAAO,IAAA,eAAI,EAAC,GAAG,IAAI,CAAC,EAAE,0CAA0C,CAAC,CAAC;QACpE,CAAC;QAED,OAAO,mBAAQ,CAAC,MAAM,CAAC;YACrB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,YAAY,EAAE,IAAI,CAAC,aAAa;YAChC,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,SAAS,EAAE,IAAI,CAAC,UAAU;SAC3B,CAAC,CAAC;IACL,CAAC;CACF;AAzMD,0CAyMC","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 {\n Collections,\n DetailedResult,\n Result,\n ResultMap,\n captureResult,\n fail,\n failWithDetail,\n succeed,\n succeedWithDetail\n} from '@fgv/ts-utils';\nimport { ResourceId, Validate } from '../common';\nimport { ResourceCandidate } from './resourceCandidate';\nimport { ReadOnlyResourceTypeCollector, ResourceType } from '../resource-types';\nimport { Resource } from './resource';\nimport { ConditionSetCollector } from '../conditions';\nimport { AbstractDecisionCollector } from '../decisions';\nimport * as ResourceJson from '../resource-json';\nimport * as Context from '../context';\n\n/**\n * Parameters for creating a {@link Resources.ResourceBuilder}.\n * @public\n */\nexport interface IResourceBuilderCreateParams {\n id: string;\n typeName?: string;\n conditionSets: ConditionSetCollector;\n resourceTypes: ReadOnlyResourceTypeCollector;\n decisions: AbstractDecisionCollector;\n}\n\n/**\n * Possible result details returned by the resource builder\n * {@link Resources.ResourceBuilder.addLooseCandidate | addLooseCandidate} method.\n * @public\n */\nexport type ResourceBuilderResultDetail = Collections.ResultMapResultDetail | 'id-mismatch' | 'type-mismatch';\n\n/**\n * Represents a builder for a single logical {@link Resources.Resource | resource}. Collects candidates\n * with a common resource ID, validates them against each other and builds a {@link Resources.Resource | resource}\n * object once all candidates are collected.\n * @public\n */\nexport class ResourceBuilder {\n /**\n * The unique {@link ResourceId | id} of the resource being built.\n */\n public readonly id: ResourceId;\n\n /**\n * Supplied or inferred {@link ResourceTypes.ResourceType | type} of the resource being built.\n * If no type is supplied, the type will be inferred from the candidates - at least one candidate must\n * define resource type and all candidates must be of the same type.\n */\n public get resourceType(): ResourceType | undefined {\n return this._resourceType;\n }\n\n /**\n * Array of {@link Resources.ResourceCandidate | candidates} for the resource being built.\n */\n public get candidates(): ReadonlyArray<ResourceCandidate> {\n return Array.from(this._candidates.values()).sort(ResourceCandidate.compare).reverse();\n }\n\n /**\n * The supplied or inferred {@link ResourceTypes.ResourceType | type} of the resource\n * being built.\n */\n protected _resourceType: ResourceType | undefined;\n\n /**\n * Map of {@link Resources.ResourceCandidate | candidates} for the resource being built.\n */\n protected _candidates: ResultMap<string, ResourceCandidate>;\n\n /**\n * Map of all known {@link ResourceTypes.ResourceType | resource types}.\n */\n protected _resourceTypes: ReadOnlyResourceTypeCollector;\n\n /**\n * Common collector for {@link Conditions.ConditionSet | condition sets}.\n */\n protected _conditionSets: ConditionSetCollector;\n\n /**\n * Collector for {@link Decisions.AbstractDecision | abstract decisions}.\n */\n protected _decisions: AbstractDecisionCollector;\n\n /**\n * Constructor for a {@link Resources.ResourceBuilder | ResourceBuilder} object.\n * @param params - Parameters to construct the new {@link Resources.ResourceBuilder | ResourceBuilder}.\n */\n protected constructor(params: IResourceBuilderCreateParams) {\n this.id = Validate.toResourceId(params.id).orThrow();\n this._resourceTypes = params.resourceTypes;\n this._conditionSets = params.conditionSets;\n this._decisions = params.decisions;\n this._candidates = new ResultMap<string, ResourceCandidate>();\n if (params.typeName) {\n this._resourceType = this._resourceTypes.validating.get(params.typeName).orThrow();\n }\n }\n\n /**\n * Creates a new {@link Resources.ResourceBuilder | ResourceBuilder} object.\n * @param params - Parameters to create a new {@link Resources.ResourceBuilder | ResourceBuilder}.\n * @returns `Success` with the new {@link Resources.ResourceBuilder | ResourceBuilder} object if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public static create(params: IResourceBuilderCreateParams): Result<ResourceBuilder> {\n return captureResult(() => new ResourceBuilder(params));\n }\n\n /**\n * Gets the {@link Resources.ResourceCandidate | candidates} that match a given {@link Context.IValidatedContextDecl | context}.\n * @param context - The {@link Context.IValidatedContextDecl | context} to get candidates for.\n * @param options - Optional {@link Context.IContextMatchOptions | context match options} to use when matching candidates.\n * @returns An array of {@link Resources.ResourceCandidate | candidates} that match the given context.\n */\n public getCandidatesForContext(\n context: Context.IValidatedContextDecl,\n options?: Context.IContextMatchOptions\n ): ReadonlyArray<ResourceCandidate> {\n return Array.from(this._candidates.values()).filter((candidate) =>\n candidate.canMatchPartialContext(context, options)\n );\n }\n\n /**\n * Given a {@link ResourceJson.Json.IChildResourceCandidateDecl | child resource candidate declaration}, creates and adds a\n * {@link Resources.ResourceCandidate | candidate} to the resource being built.\n * @param candidate - The {@link ResourceJson.Json.IChildResourceCandidateDecl | IChildResourceCandidateDecl} to add to the\n * resource being built.\n * @returns `Success` with the added {@link Resources.ResourceCandidate | candidate} if successful,\n * or `Failure` with an error message if not.\n */\n public addChildCandidate(\n childDecl: ResourceJson.Json.IChildResourceCandidateDecl\n ): DetailedResult<ResourceCandidate, ResourceBuilderResultDetail> {\n return ResourceCandidate.create({\n id: this.id,\n resourceType: this._resourceType,\n decl: childDecl,\n conditionSets: this._conditionSets\n })\n .withDetail<ResourceBuilderResultDetail>('failure', 'success')\n .onSuccess((candidate) => {\n return this._candidates\n .getOrAdd(candidate.conditions.toString(), candidate)\n .onSuccess((added, detail) => {\n if (detail === 'exists') {\n if (!ResourceCandidate.equal(added, candidate)) {\n return failWithDetail<ResourceCandidate, Collections.ResultMapResultDetail>(\n `${this.id}: conflicting candidates.`,\n 'exists'\n );\n }\n }\n return succeedWithDetail(added, detail);\n });\n });\n }\n\n /**\n * Given a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration}, creates and adds a\n * {@link Resources.ResourceCandidate | candidate} to the resource being built.\n * @param candidate - The {@link ResourceJson.Json.ILooseResourceCandidateDecl | IResourceCandidateDecl} to add to the\n * resource being built.\n * @returns `Success` with the added {@link Resources.ResourceCandidate | candidate} if successful,\n * or `Failure` with an error message if not. Fails with error detail 'type-mismatch' if the candidate\n * specifies a different resource type than previously added candidates, or with 'exists' if a candidate\n * already exists with the same conditions but different values. Succeeds with 'exists' and returns the\n * existing candidate if the candidate to be added is identical to an existing candidate.\n */\n public addLooseCandidate(\n decl: ResourceJson.Json.ILooseResourceCandidateDecl\n ): DetailedResult<ResourceCandidate, ResourceBuilderResultDetail> {\n /* c8 ignore next 6 - functional code path tested but coverage intermittently missed */\n if (decl.id !== this.id) {\n return failWithDetail<ResourceCandidate, ResourceBuilderResultDetail>(\n `${this.id}: mismatched candidate id ${decl.id}.`,\n 'id-mismatch'\n );\n }\n\n if (decl.resourceTypeName !== undefined) {\n const rt = this.setResourceType(decl.resourceTypeName);\n if (rt.isFailure()) {\n return failWithDetail<ResourceCandidate, ResourceBuilderResultDetail>(rt.message, 'type-mismatch');\n }\n }\n\n return this.addChildCandidate(decl);\n }\n\n /**\n * Sets the resource type for the resource being built. Fails if a resource type has already been set\n * and it does not match the new resource type.\n * @param resourceTypeName - The name of the resource type to set.\n * @returns `Success` with the updated {@link Resources.ResourceBuilder | ResourceBuilder} object if successful,\n * or `Failure` with an error message if not.\n */\n public setResourceType(resourceTypeName: string): Result<ResourceBuilder> {\n if (this._resourceType?.key === resourceTypeName) {\n return succeed(this);\n } else if (this._resourceType !== undefined) {\n return fail(\n `${this.id}: conflicting resource types ${this._resourceType.key} !== ${resourceTypeName}.`\n );\n }\n return this._resourceTypes.validating.get(resourceTypeName).onSuccess((resourceType) => {\n this._resourceType = resourceType;\n return succeedWithDetail(this, 'success');\n });\n }\n\n /**\n * Builds the {@link Resources.Resource | resource} object from this builder.\n * @returns `Success` with the new {@link Resources.Resource | Resource} object if successful,\n * or `Failure` with an error message if not. Fails if no candidates have been added\n * or if the resource type is not defined.\n */\n public build(): Result<Resource> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (this._candidates.size === 0) {\n return fail(`${this.id}: no candidates supplied.`);\n }\n\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (this._resourceType === undefined) {\n return fail(`${this.id}: no resource type supplied or inferred.`);\n }\n\n return Resource.create({\n id: this.id,\n resourceType: this._resourceType,\n candidates: this.candidates,\n decisions: this._decisions\n });\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceCandidate.d.ts","sourceRoot":"","sources":["../../../src/packlets/resources/resourceCandidate.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAgB,aAAa,EAAE,UAAU,EAAE,wBAAwB,EAAY,MAAM,WAAW,CAAC;AACxG,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAsD,MAAM,EAAiB,MAAM,eAAe,CAAC;AAC1G,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,2BAA2B,CAAC;IACpD,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,gBAAgB,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IAC5C,aAAa,EAAE,qBAAqB,CAAC;CACtC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAsB,SAAQ,YAAY,CAAC,OAAO,CAAC,m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,SAAS,CAAC,KAAK,EACf,gBAAgB,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,EAC1C,SAAS,CACV,CAAC;oBACF,IAAI,KAAK,KAAK,qBAAY,EAAE,CAAC;wBAC3B,kBAAkB,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;oBACtD,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,kBAAkB,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC;IACtE,CAAC;CACF;AA9PD,8CA8PC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { JsonObject } from '@fgv/ts-json-base';\nimport { PerfectMatch, QualifierName, ResourceId, ResourceValueMergeMethod, Validate } from '../common';\nimport { Condition, ConditionSet, ConditionSetCollector } from '../conditions';\nimport * as ResourceJson from '../resource-json';\nimport { ResourceType } from '../resource-types';\nimport { captureResult, mapResults, Hash, MessageAggregator, Result, fail, succeed } from '@fgv/ts-utils';\nimport * as Context from '../context';\nimport { IResourceCandidate } from '../runtime';\n\n/**\n * Parameters to create a {@link Resources.ResourceCandidate | ResourceCandidate}.\n * @public\n */\nexport interface IResourceCandidateCreateParams {\n id: string;\n decl: ResourceJson.Json.IChildResourceCandidateDecl;\n resourceType?: ResourceType;\n parentConditions?: ReadonlyArray<Condition>;\n conditionSets: ConditionSetCollector;\n}\n\n/**\n * Options for creating a {@link Resources.ResourceCandidate | ResourceCandidate} declaration.\n * @remarks\n * This interface extends the {@link ResourceJson.Helpers.IDeclarationOptions | declaration options}\n * interface to include a `reduceQualifiers` option.\n * @public\n */\nexport interface ICandidateDeclOptions extends ResourceJson.Helpers.IDeclarationOptions {\n /**\n * If provided, reduces the qualifiers of the candidate by removing qualifiers that are made\n * irrelevant by the filterForContext.\n */\n qualifiersToReduce?: ReadonlySet<QualifierName>;\n}\n\n/**\n * A {@link Resources.ResourceCandidate | resource candidate} represents a single possible\n * instance value for some resource, with the conditions under which it applies\n * and instructions on how to merge it with other instances.\n * @public\n */\nexport class ResourceCandidate implements IResourceCandidate {\n /**\n * The unique identifier of the resource for which this candidate\n * is a possible instance.\n */\n public readonly id: ResourceId;\n\n /**\n * The JSON representation of the instance data to be applied.\n */\n public readonly json: JsonObject;\n\n /**\n * The conditions under which this candidate applies.\n */\n public readonly conditions: ConditionSet;\n\n /**\n * True if this candidate is a partial instance.\n */\n public readonly isPartial: boolean;\n\n /**\n * The method to use when merging this candidate with other instances.\n */\n public readonly mergeMethod: ResourceValueMergeMethod;\n\n /**\n * The {@link ResourceTypes.ResourceType | resource type} for the resource to which\n * this candidate belongs.\n */\n public readonly resourceType: ResourceType | undefined;\n\n /**\n * Constructor for a {@link Resources.ResourceCandidate | ResourceCandidate} object.\n * @param params - Parameters to create a new {@link Resources.ResourceCandidate | ResourceCandidate}.\n * @public\n */\n protected constructor(params: IResourceCandidateCreateParams) {\n this.id = Validate.toResourceId(params.id).orThrow();\n this.json = params.decl.json;\n this.conditions = ResourceCandidate._mergeConditions(\n params.conditionSets,\n params.decl.conditions,\n params.parentConditions\n ).orThrow();\n this.isPartial = params.decl.isPartial ?? false;\n this.mergeMethod = params.decl.mergeMethod ?? 'augment';\n this.resourceType = params.resourceType;\n if (this.resourceType) {\n this.resourceType.validateDeclaration(this).orThrow();\n }\n }\n\n /**\n * Creates a new {@link Resources.ResourceCandidate | ResourceCandidate} object.\n * @param params - Parameters to create a new {@link Resources.ResourceCandidate | ResourceCandidate}.\n * @returns `Success` with the new {@link Resources.ResourceCandidate | ResourceCandidate} object if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public static create(params: IResourceCandidateCreateParams): Result<ResourceCandidate> {\n return captureResult(() => new ResourceCandidate(params));\n }\n\n /**\n * Determines if this candidate can match the supplied context (possibly partial).\n * @param context - The context to match.\n * @param options - Options to use when matching.\n * @returns `true` if the candidate can match the context, `false` otherwise.\n */\n public canMatchPartialContext(\n context: Context.IValidatedContextDecl,\n options?: Context.IContextMatchOptions\n ): boolean {\n return this.conditions.canMatchPartialContext(context, options);\n }\n\n /**\n * Gets the {@link ResourceJson.Json.IChildResourceCandidateDecl | child resource candidate declaration}\n * for this candidate.\n * @param options - {@link ResourceJson.Helpers.IDeclarationOptions | options} to use when creating the declaration.\n * @returns The {@link ResourceJson.Json.IChildResourceCandidateDecl | child resource candidate declaration}.\n */\n public toChildResourceCandidateDecl(\n options?: ICandidateDeclOptions\n ): ResourceJson.Json.IChildResourceCandidateDecl {\n const showDefaults = options?.showDefaults === true;\n return {\n json: this.json as JsonObject,\n conditions: this.conditions.toConditionSetRecordDecl(options),\n ...(showDefaults || this.isPartial ? { isPartial: this.isPartial } : {}),\n ...(showDefaults || this.mergeMethod !== 'augment' ? { mergeMethod: this.mergeMethod } : {})\n };\n }\n\n /**\n * Gets the {@link ResourceJson.Json.ILooseResourceCandidateDecl | loose resource candidate declaration}\n * for this candidate.\n * @param options - {@link ResourceJson.Helpers.IDeclarationOptions | options} to use when creating the declaration.\n * @returns The {@link ResourceJson.Json.ILooseResourceCandidateDecl | loose resource candidate declaration}.\n */\n public toLooseResourceCandidateDecl(\n options?: ICandidateDeclOptions\n ): ResourceJson.Json.ILooseResourceCandidateDecl {\n const showDefaults = options?.showDefaults === true;\n const resourceTypeName = this.resourceType?.key;\n return {\n id: this.id.toString(),\n json: this.json as JsonObject,\n conditions: this.conditions.toConditionSetRecordDecl(options),\n ...(showDefaults || this.isPartial ? { isPartial: this.isPartial } : {}),\n ...(showDefaults || this.mergeMethod !== 'augment' ? { mergeMethod: this.mergeMethod } : {}),\n ...(resourceTypeName ? { resourceTypeName } : {})\n };\n }\n\n /**\n * Extracts the {@link ResourceTypes.ResourceType | resource type} from a list of {@link Resources.ResourceCandidate | resource candidates},\n * if present.\n * @param candidates - The list of candidates from which to extract the resource type.\n * @returns `Success` with the resource type if successful, `Success` with `undefined` if none of the candidates\n * specify a resource tap, and `Failure` with an error message if clients specify conflicting resource types.\n * @public\n */\n public static validateResourceTypes(\n candidates: ReadonlyArray<ResourceCandidate>,\n expectedType?: ResourceType\n ): Result<ResourceType | undefined> {\n const errors = new MessageAggregator();\n let selectedType: ResourceType | undefined = expectedType;\n for (const candidate of candidates) {\n if (selectedType === undefined) {\n /* c8 ignore next 1 - functional code path tested but coverage intermittently missed */\n selectedType = candidate.resourceType;\n } else if (candidate.resourceType && selectedType !== candidate.resourceType) {\n /* c8 ignore next 4 - functional code path tested but coverage intermittently missed */\n errors.addMessage(\n `${candidate.id}: resource type mismatch (${selectedType.key} != ${candidate.resourceType.key})`\n );\n }\n }\n return errors.returnOrReport(succeed(selectedType));\n }\n\n /**\n * Compares two {@link Resources.ResourceCandidate | ResourceCandidates} for sorting purposes.\n * @param rc1 - The first candidate to compare.\n * @param rc2 - The second candidate to compare.\n * @returns A negative number if `rc1` should come before `rc2`, a positive number if `rc2` should come before `rc1`,\n * or zero if they are equivalent.\n * @public\n */\n public static compare(rc1: ResourceCandidate, rc2: ResourceCandidate): number {\n return ConditionSet.compare(rc1.conditions, rc2.conditions);\n }\n\n /**\n * Compares two {@link Resources.ResourceCandidate | ResourceCandidates} for equality.\n * @param rc1 - The first candidate to compare.\n * @param rc2 - The second candidate to compare.\n * @returns `true` if the candidates are equal, `false` otherwise.\n * @public\n */\n public static equal(rc1: ResourceCandidate, rc2: ResourceCandidate): boolean {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (rc1 === rc2) {\n return true;\n }\n let equal =\n rc1.id === rc2.id &&\n rc1.isPartial === rc2.isPartial &&\n rc1.mergeMethod === rc2.mergeMethod &&\n ConditionSet.compare(rc1.conditions, rc2.conditions) === 0;\n if (equal) {\n const normalizer = new Hash.Crc32Normalizer();\n const n1 = normalizer.computeHash(rc1.json).orDefault('(n1 normalization failed)');\n const n2 = normalizer.computeHash(rc2.json).orDefault('(n2 normalization failed)');\n equal = n1 === n2;\n }\n return equal;\n }\n\n /**\n * Validates declared conditions and merges them with parent conditions.\n * @param conditionSets - The {@link Conditions.ConditionSetCollector | condition set collector}\n * to use for this candidate.\n * @param declared - The declared conditions for the candidate.\n * @param parent - The parent conditions to merge with the declared conditions.\n * @returns `Success` with the merged conditions if successful, `Failure` otherwise.\n * @internal\n */\n private static _mergeConditions(\n conditionSets: ConditionSetCollector,\n declared: ResourceJson.Json.ConditionSetDecl | undefined,\n parent: ReadonlyArray<Condition> | undefined\n ): Result<ConditionSet> {\n /* c8 ignore next 2 - code coverage is flaky */\n declared = declared ?? {};\n parent = parent ?? [];\n\n const { value: conditionDecls, message } = ResourceJson.Convert.conditionSetDecl.convert(declared);\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (message !== undefined) {\n return fail(message);\n }\n\n return mapResults(\n // get or add all declared conditions from our condition collector\n conditionDecls.map((decl) => conditionSets.conditions.validating.getOrAdd(decl))\n ).onSuccess((declaredConditions) => {\n // make sure our parent conditions all come from our condition collector too\n return mapResults(parent.map((c) => conditionSets.conditions.getOrAdd(c))).onSuccess(\n (parentConditions) => {\n const conditions = [...parentConditions, ...declaredConditions];\n return conditionSets.validating.getOrAdd(conditions);\n }\n );\n });\n }\n\n /**\n * Finds the qualifiers that are made irrelevant by the supplied filterForContext.\n * @param candidates - The candidates to find the reducible qualifiers for.\n * @param filterForContext - The filter for context to use.\n * @returns The qualifiers that are made irrelevant by the filterForContext.\n * @remarks\n * For any given set of candidates, qualifiers that match every candidate perfectly\n * are irrelevant to the filtered content and can be removed. Qualifiers that do not\n * match, that are not in the filterForContext, or which partially match at least one\n * candidate remain relevant and must not be removed.\n * @public\n */\n public static findReducibleQualifiers(\n candidates: ReadonlyArray<ResourceCandidate>,\n filterForContext: Context.IValidatedContextDecl\n ): ReadonlySet<QualifierName> | undefined {\n const qualifiersToReduce = new Set<QualifierName>(Object.keys(filterForContext) as QualifierName[]);\n for (const candidate of candidates) {\n for (const condition of candidate.conditions.conditions) {\n if (qualifiersToReduce.has(condition.qualifier.name)) {\n const match = condition.qualifier.type.matches(\n condition.value,\n filterForContext[condition.qualifier.name],\n 'matches'\n );\n if (match !== PerfectMatch) {\n qualifiersToReduce.delete(condition.qualifier.name);\n }\n }\n }\n }\n return qualifiersToReduce.size > 0 ? qualifiersToReduce : undefined;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceManagerBuilder.d.ts","sourceRoot":"","sources":["../../../src/packlets/resources/resourceManagerBuilder.ts"],"names":[],"mappings":"AAsBA,OAAO,EAEL,WAAW,EACX,cAAc,EAMd,MAAM,EAGN,mBAAmB,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC1B,6BAA6B,EAE7B,SAAS,EACT,YAAY,EAEb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,yBAAyB,EAAE,iCAAiC,EAAE,MAAM,cAAc,CAAC;AAC5F,OAAO,EAAE,2BAA2B,EAAE,MAAM,eA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AChC,OAAO,EAAE,OAAO,CAAC,qBAAqB,EACtC,OAAO,CAAC,EAAE,OAAO,CAAC,oBAAoB,GACrC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAMlC;;;;;;;OAOG;IACI,6BAA6B,CAClC,OAAO,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,wBAAwB,GACvD,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IA+B5D;;;;;;;;OAQG;IACI,yBAAyB,CAC9B,OAAO,CAAC,EAAE,2BAA2B,GACpC,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,uBAAuB,CAAC;IA+B1D;;;;;;;;OAQG;IAEI,KAAK,CAAC,OAAO,CAAC,EAAE,4BAA4B,GAAG,MAAM,CAAC,sBAAsB,CAAC;IAsEpF;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,8BAA8B;IAsB7C;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAmCpC;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAC,gCAAgC;IA+D/C;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAC,iCAAiC;CAsCjD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceManagerBuilder.js","sourceRoot":"","sources":["../../../src/packlets/resources/resourceManagerBuilder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAauB;AACvB,8CASuB;AACvB,4CAA4F;AAG5F,sCAA0D;AAE1D,uDAAiF;AACjF,yCAAsC;AAGtC,+DAAiD;AACjD,oDAAsC;AACtC,kDAAoC;AAmBpC;;;;;;GAMG;AACH,MAAa,sBAAsB;IAYjC;;;;OAIG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;;;OAIG;IACH,IAAW,aAAa;QACtB,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E,gBAAgB,GAC7B,CAAC;QAEF,OAAO,IAAA,kBAAO,EAAC,YAAY,CAAC,CAAC;IAC/B,CAAC;IAED;;;;;;;;OAQG;IACK,MAAM,CAAC,iCAAiC,CAC9C,UAAsB,EACtB,UAA2D,EAC3D,kBAAsC;QAEtC,iEAAiE;QACjE,MAAM,eAAe,GAAoD,EAAE,CAAC;QAE5E,4BAA4B;QAC5B,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5B,OAAO,IAAA,eAAI,EAAC,gEAAgE,CAAC,CAAC;QAChF,CAAC;QAED,qHAAqH;QACrH,MAAM,gBAAgB,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC;QACxD,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,OAAO,IAAA,eAAI,EAAC,0DAA0D,CAAC,CAAC;QAC1E,CAAC;QAED,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,MAAM,cAAc,GAAkD;gBACpE,IAAI,EAAE,SAAS,CAAC,IAAI;gBACpB,UAAU,EAAE,SAAS,CAAC,UAAU;gBAChC,SAAS,EAAE,SAAS,CAAC,SAAS;gBAC9B,WAAW,EAAE,SAAS,CAAC,WAAW;aACnC,CAAC;YACF,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACvC,CAAC;QAED,sCAAsC;QACtC,MAAM,eAAe,GAAyC;YAC5D,EAAE,EAAE,UAAU;YACd,UAAU,EAAE,eAAe;YAC3B,gBAAgB;SACjB,CAAC;QAEF,OAAO,IAAA,kBAAO,EAAC,eAAe,CAAC,CAAC;IAClC,CAAC;CACF;AA/vBD,wDA+vBC","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 {\n captureResult,\n Collections,\n DetailedResult,\n fail,\n failWithDetail,\n Hash,\n mapResults,\n MessageAggregator,\n Result,\n succeed,\n succeedWithDetail,\n ValidatingResultMap\n} from '@fgv/ts-utils';\nimport {\n ConditionCollector,\n ConditionSetCollector,\n ReadOnlyConditionCollector,\n ReadOnlyConditionSetCollector,\n Convert as ConditionsConvert,\n Condition,\n ConditionSet,\n IConditionSetDecl\n} from '../conditions';\nimport { AbstractDecisionCollector, ReadOnlyAbstractDecisionCollector } from '../decisions';\nimport { IReadOnlyQualifierCollector } from '../qualifiers';\nimport { ReadOnlyResourceTypeCollector } from '../resource-types';\nimport { Convert, ResourceId, Validate } from '../common';\nimport { IResourceManager } from '../runtime';\nimport { ResourceBuilder, ResourceBuilderResultDetail } from './resourceBuilder';\nimport { Resource } from './resource';\nimport { ResourceCandidate } from './resourceCandidate';\nimport { IResourceDeclarationOptions, IResourceManagerCloneOptions } from './common';\nimport * as ResourceJson from '../resource-json';\nimport * as Context from '../context';\nimport * as Config from '../config';\n\n/**\n * Interface for parameters to the {@link Resources.ResourceManagerBuilder.create | ResourceManagerBuilder create method}.\n * @public\n */\nexport interface IResourceManagerBuilderCreateParams {\n qualifiers: IReadOnlyQualifierCollector;\n resourceTypes: ReadOnlyResourceTypeCollector;\n}\n\n/**\n * Error details that can be returned by a {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder}.\n * @public\n */\nexport type ResourceManagerBuilderResultDetail =\n | Collections.ResultMapResultDetail\n | ResourceBuilderResultDetail;\n\n/**\n * Builder for a collection of {@link Resources.Resource | resources}. Collects\n * {@link Resources.ResourceCandidate | candidates} for each resource into a\n * {@link Resources.ResourceBuilder | ResourceBuilder} per resource, validates them against each other,\n * and builds a collection of {@link Resources.Resource | resources} once all candidates are collected.\n * @public\n */\nexport class ResourceManagerBuilder implements IResourceManager {\n public readonly qualifiers: IReadOnlyQualifierCollector;\n public readonly resourceTypes: ReadOnlyResourceTypeCollector;\n\n protected readonly _conditions: ConditionCollector;\n protected readonly _conditionSets: ConditionSetCollector;\n protected readonly _decisions: AbstractDecisionCollector;\n protected readonly _resources: ValidatingResultMap<ResourceId, ResourceBuilder>;\n public readonly _builtResources: ValidatingResultMap<ResourceId, Resource>;\n\n protected _built: boolean;\n\n /**\n * A {@link Conditions.ConditionCollector | ConditionCollector} which\n * contains the {@link Conditions.Condition | conditions} used so far by\n * the {@link Resources.ResourceCandidate | resource candidates} in this manager.\n */\n public get conditions(): ReadOnlyConditionCollector {\n return this._conditions;\n }\n\n /**\n * A {@link Conditions.ConditionSetCollector | ConditionSetCollector} which\n * contains the {@link Conditions.ConditionSet | condition sets} used so far by\n * the {@link Resources.ResourceCandidate | resource candidates} in this manager.\n */\n public get conditionSets(): ReadOnlyConditionSetCollector {\n return this._conditionSets;\n }\n\n /**\n * A {@link Decisions.AbstractDecisionCollector | AbstractDecisionCollector} which\n * contains the {@link Decisions.Decision | abstract decisions} used so far by\n * the {@link Resources.ResourceCandidate | resource candidates} in this manager.\n */\n public get decisions(): ReadOnlyAbstractDecisionCollector {\n return this._decisions;\n }\n\n /**\n * A read-only map of {@link Resources.ResourceBuilder | resource builders} used by the manager.\n */\n public get resources(): Collections.IReadOnlyValidatingResultMap<ResourceId, ResourceBuilder> {\n return this._resources;\n }\n\n /**\n * The number of {@link Resources.Resource | resources} contained by the manager.\n */\n public get size(): number {\n return this._resources.size;\n }\n\n /**\n * {@inheritdoc Runtime.IResourceManager.numResources}\n */\n public get numResources(): number {\n return this._resources.size;\n }\n\n /**\n * The number of candidates in this resource manager.\n */\n protected _numCandidates?: number;\n\n /**\n * {@inheritdoc Runtime.IResourceManager.numCandidates}\n */\n public get numCandidates(): number {\n if (this._numCandidates === undefined) {\n this._numCandidates = this.getAllCandidates().length;\n }\n return this._numCandidates;\n }\n\n /**\n * {@inheritdoc Runtime.IResourceManager.builtResources}\n */\n public get builtResources(): Collections.IReadOnlyValidatingResultMap<ResourceId, Resource> {\n return this._performBuild().orThrow();\n }\n\n /**\n * Constructor for a {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} object.\n * @param params - Parameters to create a new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder}.\n * @public\n */\n protected constructor(params: IResourceManagerBuilderCreateParams) {\n this.qualifiers = params.qualifiers;\n this.resourceTypes = params.resourceTypes;\n this._conditions = ConditionCollector.create({ qualifiers: params.qualifiers }).orThrow();\n this._conditionSets = ConditionSetCollector.create({ conditions: this._conditions }).orThrow();\n this._decisions = AbstractDecisionCollector.create({ conditionSets: this._conditionSets }).orThrow();\n this._resources = new ValidatingResultMap({\n converters: new Collections.KeyValueConverters<ResourceId, ResourceBuilder>({\n key: Convert.resourceId,\n /* c8 ignore next 2 - defense in depth against internal error */\n value: (from: unknown) =>\n from instanceof ResourceBuilder ? succeed(from) : fail('not a resource builder')\n })\n });\n this._builtResources = new ValidatingResultMap({\n converters: new Collections.KeyValueConverters<ResourceId, Resource>({\n key: Convert.resourceId,\n /* c8 ignore next 1 - defense in depth against internal error */\n value: (from: unknown) => (from instanceof Resource ? succeed(from) : fail('not a resource'))\n })\n });\n this._built = false;\n }\n\n /**\n * Creates a new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} object.\n * @param params - Parameters to create a new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder}.\n * @returns `Success` with the new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} object if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public static create(params: IResourceManagerBuilderCreateParams): Result<ResourceManagerBuilder> {\n return captureResult(() => new ResourceManagerBuilder(params));\n }\n\n /**\n * Creates a new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} object from a predefined system configuration.\n * @param name - The name of the predefined system configuration to use.\n * @param qualifierDefaultValues - Optional default values for qualifiers.\n * @returns `Success` with the new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} object if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public static createPredefined(\n name: Config.PredefinedSystemConfiguration,\n qualifierDefaultValues?: Config.ISystemConfigurationInitParams['qualifierDefaultValues']\n ): Result<ResourceManagerBuilder> {\n return Config.getPredefinedSystemConfiguration(\n name,\n qualifierDefaultValues ? { qualifierDefaultValues } : undefined\n ).onSuccess((systemConfig) => {\n return ResourceManagerBuilder.create({\n qualifiers: systemConfig.qualifiers,\n resourceTypes: systemConfig.resourceTypes\n });\n });\n }\n\n /**\n * Given a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration}, builds and adds\n * a {@link Resources.ResourceCandidate | candidate} to the manager.\n * @param candidate - The {@link Resources.ResourceCandidate | candidate} to add.\n * @returns `Success` with the candidate if successful, or `Failure` with an error message if not.\n * @public\n */\n public addLooseCandidate(\n decl: ResourceJson.Json.ILooseResourceCandidateDecl\n ): DetailedResult<ResourceCandidate, ResourceBuilderResultDetail> {\n const { value: id, message } = Validate.toResourceId(decl.id);\n if (message !== undefined) {\n return failWithDetail(`${id}: invalid id - ${message}`, 'failure');\n }\n\n const builderResult = this._resources.getOrAdd(id, () =>\n ResourceBuilder.create({\n id,\n resourceTypes: this.resourceTypes,\n conditionSets: this._conditionSets,\n decisions: this._decisions\n })\n );\n /* c8 ignore next 6 - defense in depth against internal error */\n if (builderResult.isFailure()) {\n return failWithDetail(\n `${id}: unable to get or add resource\\n${builderResult.message}`,\n builderResult.detail\n );\n }\n return builderResult.value.addLooseCandidate(decl).onSuccess((c, d) => {\n this._builtResources.delete(id);\n this._built = false;\n this._numCandidates = undefined;\n return succeedWithDetail(c, d);\n });\n }\n\n public addResource(\n decl: ResourceJson.Json.ILooseResourceDecl\n ): DetailedResult<ResourceBuilder, ResourceBuilderResultDetail> {\n const { value: id, message } = Validate.toResourceId(decl.id);\n if (message !== undefined) {\n return failWithDetail(`${id}: invalid id - ${message}`, 'failure');\n }\n\n const {\n value: builder,\n message: getOrAddMessage,\n detail\n } = this._resources.getOrAdd(id, () =>\n ResourceBuilder.create({\n id,\n typeName: decl.resourceTypeName,\n resourceTypes: this.resourceTypes,\n conditionSets: this._conditionSets,\n decisions: this._decisions\n })\n );\n /* c8 ignore next 3 - defense in depth against internal error */\n if (getOrAddMessage !== undefined) {\n return failWithDetail(`${id}: unable to get or add resource\\n${getOrAddMessage}`, detail);\n }\n\n if (detail === 'exists') {\n const { message } = builder.setResourceType(decl.resourceTypeName);\n if (message !== undefined) {\n return failWithDetail(`${id}: unable to set resource type\\n${message}`, 'type-mismatch');\n }\n }\n\n const candidates = decl.candidates ?? [];\n return mapResults(candidates.map((c) => builder.addChildCandidate(c)))\n .onSuccess(() => {\n return succeed(builder);\n })\n .withDetail('failure', detail);\n }\n\n /**\n * Adds a condition to the manager.\n * @param decl - The condition declaration to add.\n * @returns `Success` with the condition if successful, or `Failure` with an error message if not.\n * @public\n */\n public addCondition(decl: ResourceJson.Json.ILooseConditionDecl): Result<Condition> {\n return ConditionsConvert.validatedConditionDecl\n .convert(decl, { qualifiers: this.qualifiers })\n .onSuccess((validated) => {\n return Condition.getKeyForDecl(validated).onSuccess((key) => {\n return this._conditions.validating.getOrAdd(key, () => Condition.create(validated));\n });\n });\n }\n\n /**\n * Adds a condition set to the manager.\n * @param decl - The condition set declaration to add.\n * @returns `Success` with the condition set if successful, or `Failure` with an error message if not.\n * @public\n */\n public addConditionSet(conditions: ResourceJson.Normalized.ConditionSetDecl): Result<ConditionSet> {\n const decl: IConditionSetDecl = { conditions: [...conditions] };\n return ConditionsConvert.validatedConditionSetDecl\n .convert(decl, { conditions: this._conditions })\n .onSuccess((validated) => {\n return ConditionSet.getKeyForDecl(validated).onSuccess((key) => {\n return this._conditionSets.validating.getOrAdd(key, () => ConditionSet.create(validated));\n });\n });\n }\n\n /**\n * Gets a read-only array of all {@link Resources.ResourceBuilder | resource builders} present in the manager.\n * @returns `Success` with the {@link Resources.ResourceBuilder | resource builder} if successful,\n * or `Failure` with an error message if not.\n */\n public getAllResources(): ReadonlyArray<ResourceBuilder> {\n return Array.from(this._resources.values()).sort((a, b) => a.id.localeCompare(b.id));\n }\n\n /**\n * Gets a read-only array of all {@link Resources.ResourceCandidate | resource candidates} present in the manager.\n */\n public getAllCandidates(): ReadonlyArray<ResourceCandidate> {\n return this.getAllResources().flatMap((r) => r.candidates);\n }\n\n /**\n * Gets an individual {@link Resources.Resource | built resource} from the manager.\n * @param id - The {@link ResourceId | id} of the resource to get.\n * @returns `Success` with the resource if successful, or `Failure` with an error message if not.\n * @public\n */\n public getBuiltResource(id: string): Result<Resource> {\n return this._resources.validating\n .get(id)\n .onSuccess((builder) => this._builtResources.validating.getOrAdd(id, () => builder.build()));\n }\n\n /**\n * Validates a context declaration against the qualifiers managed by this resource manager.\n * @param context - The context declaration to validate\n * @returns Success with the validated context if successful, Failure otherwise\n * @public\n */\n /* c8 ignore next 5 - functional code path tested but coverage intermittently missed */\n public validateContext(context: Context.IContextDecl): Result<Context.IValidatedContextDecl> {\n return Context.Convert.validatedContextDecl.convert(context, {\n qualifiers: this.qualifiers\n });\n }\n\n /**\n * Gets a read-only array of all {@link Resources.Resource | built resources} in the manager.\n * @returns `Success` with an array of resources if successful, or `Failure` with an error message if not.\n * @public\n */\n public getAllBuiltResources(): Result<ReadonlyArray<Resource>> {\n return this.build().onSuccess((manager) =>\n succeed(Array.from(manager._builtResources.values()).sort((a, b) => a.id.localeCompare(b.id)))\n );\n }\n\n /**\n * Gets a read-only array of all {@link Resources.Resource | built resources} in the manager.\n * @returns `Success` with an array of resources if successful, or `Failure` with an error message if not.\n * @public\n */\n public getAllBuiltCandidates(): Result<ReadonlyArray<ResourceCandidate>> {\n return this.getAllBuiltResources().onSuccess((built) => succeed(built.flatMap((r) => r.candidates)));\n }\n\n /**\n * Internal helper method that performs the actual building of resources.\n * @returns `Success` with the built resources if all resources were built successfully, `Failure` otherwise.\n * @internal\n */\n public _performBuild(): Result<Collections.IReadOnlyValidatingResultMap<ResourceId, Resource>> {\n if (this._built) {\n return succeed(this._builtResources);\n }\n\n const errors: MessageAggregator = new MessageAggregator();\n this._resources.forEach((r, id) => {\n this._builtResources.getOrAdd(id, () => r.build()).aggregateError(errors);\n });\n /* c8 ignore next 3 - defense in depth against internal error */\n if (errors.hasMessages) {\n return fail(`build failed: ${errors.toString()}`);\n }\n this._built = true;\n return succeed(this._builtResources);\n }\n\n /**\n * Builds the {@link Resources.Resource | resources} from the collected {@link Resources.ResourceCandidate | candidates}.\n * @returns `Success` with the {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} object if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public build(): Result<this> {\n return this._performBuild().onSuccess(() => succeed(this));\n }\n\n /**\n * Gets a read-only array of all {@link Resources.ResourceCandidate | resource candidates} that can match the supplied context.\n * @param context - The {@link Context.IValidatedContextDecl | context} to match against.\n * @param options - {@link Context.IContextMatchOptions | options} for the context match.\n * @returns A read-only array of {@link Resources.ResourceCandidate | candidates} that can match the context.\n * @public\n */\n public getCandidatesForContext(\n context: Context.IValidatedContextDecl,\n options?: Context.IContextMatchOptions\n ): ReadonlyArray<ResourceCandidate> {\n return this.getAllCandidates().filter((candidate) => candidate.canMatchPartialContext(context, options));\n }\n\n /**\n * Gets a read-only array of all {@link Resources.ResourceBuilder | resource builders} that have at least one candidate\n * that can match the supplied context.\n * @param context - The {@link Context.IValidatedContextDecl | context} to match against.\n * @param options - {@link Context.IContextMatchOptions | options} for the context match.\n * @returns A read-only array of {@link Resources.ResourceBuilder | resource builders} with matching candidates.\n * @public\n */\n public getResourcesForContext(\n context: Context.IValidatedContextDecl,\n options?: Context.IContextMatchOptions\n ): ReadonlyArray<ResourceBuilder> {\n return this.getAllResources().filter(\n (resource) => resource.getCandidatesForContext(context, options).length > 0\n );\n }\n\n /**\n * Gets a read-only array of all {@link Resources.ResourceCandidate | built resource candidates} that can match the supplied context.\n * @param context - The {@link Context.IValidatedContextDecl | context} to match against.\n * @param options - {@link Context.IContextMatchOptions | options} for the context match.\n * @returns `Success` with an array of {@link Resources.ResourceCandidate | candidates} if successful, or `Failure` with an error message if not.\n * @public\n */\n public getBuiltCandidatesForContext(\n context: Context.IValidatedContextDecl,\n options?: Context.IContextMatchOptions\n ): Result<ReadonlyArray<ResourceCandidate>> {\n return this.getAllBuiltCandidates().onSuccess((candidates) =>\n succeed(candidates.filter((candidate) => candidate.canMatchPartialContext(context, options)))\n );\n }\n\n /**\n * Gets a read-only array of all {@link Resources.Resource | built resources} that have at least one candidate\n * that can match the supplied context.\n * @param context - The {@link Context.IValidatedContextDecl | context} to match against.\n * @param options - {@link Context.IContextMatchOptions | options} for the context match.\n * @returns `Success` with an array of {@link Resources.Resource | resources} if successful, or `Failure` with an error message if not.\n * @public\n */\n public getBuiltResourcesForContext(\n context: Context.IValidatedContextDecl,\n options?: Context.IContextMatchOptions\n ): Result<ReadonlyArray<Resource>> {\n return this.getAllBuiltResources().onSuccess((resources) =>\n succeed(resources.filter((resource) => resource.getCandidatesForContext(context, options).length > 0))\n );\n }\n\n /**\n * Gets a compiled resource collection from the current state of the resource manager builder.\n * This method generates an optimized, index-based representation of all resources, conditions,\n * and decisions that can be used for serialization or efficient runtime processing.\n * @param options - Optional compilation options controlling the output format.\n * @returns Success with the compiled resource collection if successful, Failure otherwise.\n * @public\n */\n public getCompiledResourceCollection(\n options?: ResourceJson.Compiled.ICompiledResourceOptions\n ): Result<ResourceJson.Compiled.ICompiledResourceCollection> {\n // Build resources first to ensure all data is available\n const buildResult = this._performBuild();\n if (buildResult.isFailure()) {\n return fail(`Failed to build resources: ${buildResult.message}`);\n }\n\n // Generate compiled data from internal collections using the new toCompiled methods\n // Note: All objects have a defined index property due to the collector pattern - indices are assigned during collection building\n const compiledData = {\n qualifierTypes: Array.from(this.qualifiers.qualifierTypes.values()).map((qt) => ({\n name: qt.name\n })),\n qualifiers: Array.from(this.qualifiers.values()).map((q) => ({\n name: q.name,\n type: q.type.index!,\n defaultPriority: q.defaultPriority\n })),\n resourceTypes: Array.from(this.resourceTypes.values()).map((rt) => ({\n name: rt.key\n })),\n conditions: Array.from(this._conditions.values()).map((c) => c.toCompiled(options)),\n conditionSets: Array.from(this._conditionSets.values()).map((cs) => cs.toCompiled(options)),\n decisions: Array.from(this._decisions.values()).map((d) => d.toCompiled(options)),\n resources: Array.from(this._builtResources.values()).map((r) => r.toCompiled(options))\n };\n\n // Apply validation through the converter\n return ResourceJson.Compiled.Convert.compiledResourceCollection.convert(compiledData);\n }\n\n /**\n * Gets a resource collection declaration containing all built resources in a flat array structure.\n * This method returns all built resources as an {@link ResourceJson.Normalized.IResourceCollectionDecl | IResourceCollectionDecl}\n * that can be used for serialization, export, or re-import. Resources are sorted by ID for consistent ordering.\n * @param options - Optional {@link Resources.IResourceDeclarationOptions | declaration options} controlling the output format.\n * If `options.normalized` is `true`, applies hash-based normalization for additional consistency guarantees.\n * @returns Success with the resource collection declaration if successful, Failure otherwise.\n * @public\n */\n public getResourceCollectionDecl(\n options?: IResourceDeclarationOptions\n ): Result<ResourceJson.Normalized.IResourceCollectionDecl> {\n return this._performBuild().onSuccess(() => {\n // Get all built resources and convert to loose resource declarations\n const resources = Array.from(this._builtResources.values()).map((resource) =>\n resource.toLooseResourceDecl(options)\n );\n\n // Sort resources by ID for consistent ordering\n resources.sort((a, b) => a.id.localeCompare(b.id));\n\n // Create the collection declaration structure\n const collectionData = {\n resources\n };\n\n // Convert and validate using the normalized converter\n return ResourceJson.Convert.resourceCollectionDecl\n .convert(collectionData)\n .onSuccess((compiledCollection) => {\n // Apply hash-based normalization only if requested\n if (options?.normalized === true) {\n const normalizer = new Hash.Crc32Normalizer();\n return normalizer\n .normalize(compiledCollection)\n .withErrorFormat((e) => `Failed to normalize resource collection: ${e}`);\n }\n return succeed(compiledCollection);\n });\n });\n }\n\n /**\n * Creates a filtered clone of this ResourceManagerBuilder using the specified context.\n * This is a convenience method that creates a new ResourceManagerBuilder with the same\n * configuration but filtered to include only candidates that match the provided context.\n * If candidates are provided for editing, they will be applied with collision detection.\n * @param options - Options for the cloning operation, including the strongly-typed filterForContext property and optional candidates for edits.\n * @returns A Result containing the new filtered ResourceManagerBuilder.\n * @public\n */\n /* c8 ignore next 21 - functional code path tested but coverage intermittently missed */\n public clone(options?: IResourceManagerCloneOptions): Result<ResourceManagerBuilder> {\n return this.getResourceCollectionDecl(options).onSuccess((collection) => {\n return ResourceManagerBuilder.create({\n qualifiers: this.qualifiers,\n resourceTypes: this.resourceTypes\n }).onSuccess((newManager) => {\n // Check if we have candidates to apply as edits\n const editCandidates = options?.candidates || [];\n const candidatesByResourceResult =\n editCandidates.length > 0\n ? ResourceManagerBuilder._createCandidatesByResourceMap(editCandidates)\n : succeed(new Map());\n\n return candidatesByResourceResult.onSuccess((candidatesByResource) => {\n // Track which resource IDs have been processed from the original collection\n const processedResourceIds = new Set<ResourceId>();\n\n // Add each resource from the filtered collection to the new manager\n if (collection.resources) {\n for (const resourceDecl of collection.resources) {\n processedResourceIds.add(resourceDecl.id as ResourceId);\n\n // Apply edits if there are candidates for this resource\n const editedDeclResult = ResourceManagerBuilder._applyEditsToResourceDeclaration(\n resourceDecl,\n candidatesByResource,\n this._conditions\n );\n\n if (editedDeclResult.isFailure()) {\n return fail(`${resourceDecl.id}: Failed to apply edits: ${editedDeclResult.message}`);\n }\n\n const addResult = newManager.addResource(editedDeclResult.value);\n if (addResult.isFailure()) {\n return fail(\n `${resourceDecl.id}: Failed to add resource to cloned manager: ${addResult.message}`\n );\n }\n }\n }\n\n // Handle any remaining candidates that target new resources not in the original collection\n const errors = new MessageAggregator();\n for (const [resourceId, candidates] of candidatesByResource) {\n if (!processedResourceIds.has(resourceId)) {\n // Create a new resource declaration for candidates targeting a new resource ID\n ResourceManagerBuilder._createResourceDeclFromCandidates(\n resourceId,\n candidates,\n this._conditions\n )\n .withErrorFormat((e) => `${resourceId}: Failed to create new resource from candidates: ${e}`)\n .onSuccess((newResourceDecl) => {\n return newManager\n .addResource(newResourceDecl)\n .withErrorFormat(\n (e) => `${resourceId}: Failed to add new resource to cloned manager: ${e}`\n );\n })\n .aggregateError(errors);\n }\n }\n\n return errors.returnOrReport(succeed(newManager));\n });\n });\n });\n }\n\n /**\n * Creates a resource ID keyed map from an array of loose resource candidate declarations.\n * This enables efficient detection of edit collisions by grouping candidates by their target resource.\n * @param candidates - Array of loose resource candidate declarations to organize\n * @returns A Result containing a Map where keys are validated ResourceIds and values are arrays of candidates for that resource\n * @internal\n */\n private static _createCandidatesByResourceMap(\n candidates: ReadonlyArray<ResourceJson.Json.ILooseResourceCandidateDecl>\n ): Result<Map<ResourceId, ResourceJson.Json.ILooseResourceCandidateDecl[]>> {\n const candidatesByResource = new Map<ResourceId, ResourceJson.Json.ILooseResourceCandidateDecl[]>();\n\n for (const candidate of candidates) {\n const { value: resourceId, message } = Validate.toResourceId(candidate.id);\n if (message !== undefined) {\n return fail(`Invalid resource ID \"${candidate.id}\": ${message}`);\n }\n\n const existingCandidates = candidatesByResource.get(resourceId);\n if (existingCandidates) {\n existingCandidates.push(candidate);\n } else {\n candidatesByResource.set(resourceId, [candidate]);\n }\n }\n\n return succeed(candidatesByResource);\n }\n\n /**\n * Generates a proper ConditionSet token for collision detection using the existing ConditionSet.getKeyForDecl method.\n * @param conditionSet - The condition set to generate a token for\n * @param conditionCollector - The condition collector needed for validation context\n * @returns A Result containing the ConditionSet token if successful, or failure if validation fails\n * @internal\n */\n private static _getConditionSetToken(\n conditionSet: ResourceJson.Json.ConditionSetDecl | undefined,\n conditionCollector: ConditionCollector\n ): Result<string> {\n if (!conditionSet) {\n return succeed(ConditionSet.UnconditionalKey);\n }\n\n // Convert ConditionSetDecl to IConditionSetDecl format\n let conditionSetDecl: { conditions: ResourceJson.Json.ILooseConditionDecl[] };\n\n if (Array.isArray(conditionSet)) {\n // ConditionSetDeclAsArray: array of ILooseConditionDecl\n conditionSetDecl = { conditions: conditionSet };\n } else {\n // ConditionSetDeclAsRecord: Record<string, string | IChildConditionDecl>\n const conditions = Object.entries(conditionSet).map(([qualifierName, value]) => {\n if (typeof value === 'string') {\n return { qualifierName, value };\n } else {\n return { qualifierName, ...value };\n }\n });\n conditionSetDecl = { conditions };\n }\n\n // Validate and convert to IValidatedConditionSetDecl\n return ConditionsConvert.validatedConditionSetDecl\n .convert(conditionSetDecl, { conditions: conditionCollector })\n .onSuccess((validatedDecl) => {\n // Use proper ConditionSet.getKeyForDecl method to generate the token\n return ConditionSet.getKeyForDecl(validatedDecl);\n });\n }\n\n /**\n * Applies candidate edits to a resource declaration, handling collisions using condition set tokens.\n * If there's no collision, adds the candidate. If there's a collision, replaces the original candidate with the edit.\n * @param resourceDecl - The original resource declaration to potentially modify\n * @param candidatesByResource - Map of resource IDs to arrays of candidate edits\n * @param conditionCollector - The condition collector needed for generating condition tokens\n * @returns A Result containing the resource declaration to use (original or modified)\n * @internal\n */\n private static _applyEditsToResourceDeclaration(\n resourceDecl: ResourceJson.Json.ILooseResourceDecl,\n candidatesByResource: Map<ResourceId, ResourceJson.Json.ILooseResourceCandidateDecl[]>,\n conditionCollector: ConditionCollector\n ): Result<ResourceJson.Json.ILooseResourceDecl> {\n const { value: resourceId, message } = Validate.toResourceId(resourceDecl.id);\n if (message !== undefined) {\n return fail(`Invalid resource ID \"${resourceDecl.id}\": ${message}`);\n }\n\n const editCandidates = candidatesByResource.get(resourceId);\n if (!editCandidates || editCandidates.length === 0) {\n return succeed(resourceDecl);\n }\n\n // Use Map approach: apply original candidates first, then replace with edits on collision\n const candidatesByConditionKey = new Map<string, ResourceJson.Json.IChildResourceCandidateDecl>();\n\n // First, add all original candidates keyed by their condition set token\n for (const candidate of resourceDecl.candidates || []) {\n const conditionTokenResult = ResourceManagerBuilder._getConditionSetToken(\n candidate.conditions,\n conditionCollector\n );\n if (conditionTokenResult.isFailure()) {\n return fail(\n `Failed to generate condition token for original candidate: ${conditionTokenResult.message}`\n );\n }\n candidatesByConditionKey.set(conditionTokenResult.value, candidate);\n }\n\n // Then, apply edits (this replaces any colliding original candidates)\n // Convert edit candidates (which have ids) to child candidates (without ids) for merging\n for (const editCandidate of editCandidates) {\n const conditionTokenResult = ResourceManagerBuilder._getConditionSetToken(\n editCandidate.conditions,\n conditionCollector\n );\n if (conditionTokenResult.isFailure()) {\n return fail(`Failed to generate condition token for edit candidate: ${conditionTokenResult.message}`);\n }\n\n const childCandidate: ResourceJson.Json.IChildResourceCandidateDecl = {\n json: editCandidate.json,\n conditions: editCandidate.conditions,\n isPartial: editCandidate.isPartial,\n mergeMethod: editCandidate.mergeMethod\n };\n candidatesByConditionKey.set(conditionTokenResult.value, childCandidate);\n }\n\n // Extract the final merged candidate list\n const mergedCandidates = Array.from(candidatesByConditionKey.values());\n\n const modifiedDecl: ResourceJson.Json.ILooseResourceDecl = {\n ...resourceDecl,\n candidates: mergedCandidates\n };\n\n return succeed(modifiedDecl);\n }\n\n /**\n * Creates a new resource declaration from an array of candidate declarations.\n * This is used when cloning to create new resources that don't exist in the original manager.\n * @param resourceId - The validated resource ID for the new resource\n * @param candidates - Array of loose candidate declarations for the new resource\n * @param conditionCollector - The condition collector for validation context\n * @returns A Result containing the new resource declaration if successful, or failure if validation fails\n * @internal\n */\n private static _createResourceDeclFromCandidates(\n resourceId: ResourceId,\n candidates: ResourceJson.Json.ILooseResourceCandidateDecl[],\n conditionCollector: ConditionCollector\n ): Result<ResourceJson.Json.ILooseResourceDecl> {\n // Convert candidate declarations to child candidate declarations\n const childCandidates: ResourceJson.Json.IChildResourceCandidateDecl[] = [];\n\n // Ensure we have candidates\n if (candidates.length === 0) {\n return fail('Cannot create resource declaration from empty candidates array');\n }\n\n // Extract resourceTypeName from the first candidate (all candidates for the same resource should have the same type)\n const resourceTypeName = candidates[0].resourceTypeName;\n if (!resourceTypeName) {\n return fail('resourceTypeName is required for new resource candidates');\n }\n\n for (const candidate of candidates) {\n const childCandidate: ResourceJson.Json.IChildResourceCandidateDecl = {\n json: candidate.json,\n conditions: candidate.conditions,\n isPartial: candidate.isPartial,\n mergeMethod: candidate.mergeMethod\n };\n childCandidates.push(childCandidate);\n }\n\n // Create the new resource declaration\n const newResourceDecl: ResourceJson.Json.ILooseResourceDecl = {\n id: resourceId,\n candidates: childCandidates,\n resourceTypeName\n };\n\n return succeed(newResourceDecl);\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cacheListener.d.ts","sourceRoot":"","sources":["../../../src/packlets/runtime/cacheListener.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,WAAW,GAAG,cAAc,GAAG,UAAU,CAAC;AAElF;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAE/E;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAElE;;;;OAIG;IACH,WAAW,CAAC,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnE;;;;OAIG;IACH,YAAY,CAAC,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpE;;;OAGG;IACH,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvD;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,yBAAyB,GAAG,IAAI,CAAC;CACtD;AAED;;;GAGG;AACH,qBAAa,iCAAkC,YAAW,8BAA8B;IACtF;;OAEG;IACI,UAAU,CAAC,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAIxE;;OAEG;IACI,WAAW,CAAC,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAIzE;;OAEG;IACI,YAAY,CAAC,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAI1E;;OAEG;IACI,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAI7D;;OAEG;IACI,YAAY,CAAC,KAAK,EAAE,yBAAyB,GAAG,IAAI;CAG5D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cacheListener.js","sourceRoot":"","sources":["../../../src/packlets/runtime/cacheListener.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAqDH;;;GAGG;AACH,MAAa,iCAAiC;IAC5C;;OAEG;IACI,UAAU,CAAC,KAAgC,EAAE,KAAa;QAC/D,QAAQ;IACV,CAAC;IAED;;OAEG;IACI,WAAW,CAAC,KAAgC,EAAE,KAAa;QAChE,QAAQ;IACV,CAAC;IAED;;OAEG;IACI,YAAY,CAAC,KAAgC,EAAE,KAAa;QACjE,QAAQ;IACV,CAAC;IAED;;OAEG;IACI,cAAc,CAAC,SAAiB,EAAE,KAAa;QACpD,QAAQ;IACV,CAAC;IAED;;OAEG;IACI,YAAY,CAAC,KAAgC;QAClD,QAAQ;IACV,CAAC;CACF;AAnCD,8EAmCC","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/**\n * Type indicating which {@link Runtime.ResourceResolver | ResourceResolver} cache is affected.\n * @public\n */\nexport type ResourceResolverCacheType = 'condition' | 'conditionSet' | 'decision';\n\n/**\n * Type indicating the action performed on a {@link Runtime.ResourceResolver | ResourceResolver} cache.\n * @public\n */\nexport type ResourceResolverCacheActivity = 'hit' | 'miss' | 'error' | 'clear';\n\n/**\n * A listener for {@link Runtime.ResourceResolver | ResourceResolver} cache activity.\n * @public\n */\nexport interface IResourceResolverCacheListener {\n /**\n * Called when a cache hit occurs.\n * @param cache - The type of cache that was hit.\n * @param index - The index of the cache that was hit.\n */\n onCacheHit(cache: ResourceResolverCacheType, index: number): void;\n\n /**\n * Called when a cache miss occurs.\n * @param cache - The type of cache that was missed.\n * @param index - The index of the cache that was missed.\n */\n onCacheMiss(cache: ResourceResolverCacheType, index: number): void;\n\n /**\n * Called when a cache error occurs.\n * @param cache - The type of cache that had an error.\n * @param index - The index of the cache that had an error.\n */\n onCacheError(cache: ResourceResolverCacheType, index: number): void;\n\n /**\n * Called when a context error occurs.\n * @param error - The error that occurred.\n */\n onContextError(qualifier: string, error: string): void;\n\n /**\n * Called when a cache is cleared.\n * @param cache - The type of cache that was cleared.\n */\n onCacheClear(cache: ResourceResolverCacheType): void;\n}\n\n/**\n * A no-op implementation of {@link Runtime.IResourceResolverCacheListener}.\n * @public\n */\nexport class NoOpResourceResolverCacheListener implements IResourceResolverCacheListener {\n /**\n * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheHit}\n */\n public onCacheHit(cache: ResourceResolverCacheType, index: number): void {\n // no-op\n }\n\n /**\n * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheMiss}\n */\n public onCacheMiss(cache: ResourceResolverCacheType, index: number): void {\n // no-op\n }\n\n /**\n * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheError}\n */\n public onCacheError(cache: ResourceResolverCacheType, index: number): void {\n // no-op\n }\n\n /**\n * {@inheritDoc Runtime.IResourceResolverCacheListener.onContextError}\n */\n public onContextError(qualifier: string, error: string): void {\n // no-op\n }\n\n /**\n * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheClear}\n */\n public onCacheClear(cache: ResourceResolverCacheType): void {\n // no-op\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cacheMetrics.d.ts","sourceRoot":"","sources":["../../../src/packlets/runtime/cacheMetrics.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,8BAA8B,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAE5F;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,C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ent":["/*\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 { IResourceResolverCacheListener, ResourceResolverCacheType } from './cacheListener';\n\n/**\n * Cache metrics interface for tracking cache performance.\n * @public\n */\nexport interface ICacheMetrics {\n hits: number;\n misses: number;\n errors: number;\n clears: number;\n totalAccesses: number;\n hitRate: number;\n onHit(index: number): void;\n onMiss(index: number): void;\n onError(index: number): void;\n onClear(): void;\n reset(): void;\n}\n\n/**\n * Aggregate cache metrics for a specific cache type.\n * @public\n */\nexport class AggregateCacheMetrics implements ICacheMetrics {\n private _hits: number = 0;\n private _misses: number = 0;\n private _errors: number = 0;\n private _clears: number = 0;\n\n public constructor() {\n this._hits = 0;\n this._misses = 0;\n this._errors = 0;\n this._clears = 0;\n }\n\n public onHit(__index: number): void {\n this._hits++;\n }\n\n public onMiss(__index: number): void {\n this._misses++;\n }\n\n public onError(__index: number): void {\n this._errors++;\n }\n\n public onClear(): void {\n this._hits = 0;\n this._misses = 0;\n this._errors = 0;\n this._clears++;\n }\n\n public get hits(): number {\n return this._hits;\n }\n\n public get misses(): number {\n return this._misses;\n }\n\n public get errors(): number {\n return this._errors;\n }\n\n public get clears(): number {\n return this._clears;\n }\n\n public get totalAccesses(): number {\n return this._hits + this._misses + this._errors;\n }\n\n public get hitRate(): number {\n return this.totalAccesses > 0 ? (this._hits / this.totalAccesses) * 100 : 0;\n }\n\n public get errorRate(): number {\n return this.totalAccesses > 0 ? (this._errors / this.totalAccesses) * 100 : 0;\n }\n\n public reset(): void {\n this._hits = 0;\n this._misses = 0;\n this._errors = 0;\n this._clears = 0;\n }\n}\n\n/**\n * Overall cache metrics across all cache types.\n * @public\n */\nexport type OverallCacheMetrics<TM extends ICacheMetrics = ICacheMetrics> = Record<\n ResourceResolverCacheType,\n TM\n>;\n\n/**\n * A metrics implementation of {@link Runtime.IResourceResolverCacheListener} that tracks\n * hit counts and rates across all cache types.\n * @public\n */\nexport class ResourceResolverCacheMetricsListener<TM extends ICacheMetrics>\n implements IResourceResolverCacheListener\n{\n private readonly _metrics: OverallCacheMetrics<TM>;\n private _contextErrors: number;\n\n public get numContextErrors(): number {\n return this._contextErrors;\n }\n\n public constructor(factory: () => TM);\n public constructor(metrics: OverallCacheMetrics<TM>);\n public constructor(factoryOrMetrics: OverallCacheMetrics<TM> | (() => TM)) {\n if (typeof factoryOrMetrics === 'function') {\n this._metrics = {\n condition: factoryOrMetrics(),\n conditionSet: factoryOrMetrics(),\n decision: factoryOrMetrics()\n };\n } else {\n this._metrics = factoryOrMetrics;\n }\n this._contextErrors = 0;\n }\n\n /**\n * Get the metrics for all cache types.\n * @returns The metrics for all cache types.\n */\n public get metrics(): Readonly<OverallCacheMetrics> {\n return this._metrics;\n }\n\n /**\n * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheHit}\n */\n public onCacheHit(cache: ResourceResolverCacheType, index: number): void {\n this._metrics[cache].onHit(index);\n }\n\n /**\n * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheMiss}\n */\n public onCacheMiss(cache: ResourceResolverCacheType, index: number): void {\n this._metrics[cache].onMiss(index);\n }\n\n /**\n * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheError}\n */\n public onCacheError(cache: ResourceResolverCacheType, index: number): void {\n this._metrics[cache].onError(index);\n }\n\n /**\n * {@inheritDoc Runtime.IResourceResolverCacheListener.onContextError}\n */\n public onContextError(qualifier: string, error: string): void {\n this._contextErrors++;\n }\n\n /**\n * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheClear}\n */\n public onCacheClear(cache: ResourceResolverCacheType): void {\n this._metrics[cache].onClear();\n }\n\n /**\n * Reset all metrics to zero.\n */\n public reset(): void {\n this._metrics.condition.reset();\n this._metrics.conditionSet.reset();\n this._metrics.decision.reset();\n this._contextErrors = 0;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"compiledResourceCollection.d.ts","sourceRoot":"","sources":["../../../src/packlets/runtime/compiledResourceCollection.ts"],"names":[],"mappings":"AAsBA,OAAO,EAEL,WAAW,EAIX,MAAM,EAGP,MAAM,eAAe,CAAC;AACvB,OAAO,EAGL,0BAA0B,EAC1B,6BAA6B,EAC9B,MAAM,eAAe,CAAC;AACvB,OAAO,EAA6B,iCAAiC,EAAE,MAAM,cAAc,CAAC;AAC5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAW,UAAU,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAsB,MAAM,oBAAoB,CAAC;AAGrF,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAA4B,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AACtF,OAAO,KAAK,OAAO,MAAM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AIzG;;OAEG;IACI,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;IAItD;;OAEG;IACI,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC;IAM5F;;;;;;;;;;;;OAYG;IACI,oBAAoB,IAAI,MAAM,CAAC,yBAAyB,CAAC,SAAS,CAAC,CAAC;IAkB3E;;;;;;OAMG;IACH,OAAO,CAAC,oBAAoB;IAa5B;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;IAsBxB;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB;IAa3B;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;IA6DxB;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB;IAqD3B;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;IAqDvB;;;;;;;OAOG;IACH,OAAO,CAAC,eAAe;CAkGxB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"compiledResourceCollection.js","sourceRoot":"","sources":["../../../src/packlets/runtime/compiledResourceCollection.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CASuB;AACvB,8CAKuB;AACvB,4CAA4F;AAC5F,8CAAmD;AACnD,sDAAwE;AACxE,wDAA2E;AAC3E,sCAAgD;AAChD,oDAA+C;AAE/C,4CAAgD;AAChD,qDAAuC;AAEvC,mDAAsF;AACtF,oDAAsC;AAqBtC;;;;;GAKG;AACH,MAAa,0BAA0B;IAWrC;;;OAGG;IACH,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IA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xC,CAAC,CAAC;YACH,+EAA+E;YAC/E,IAAI,sBAAsB,CAAC,SAAS,EAAE,EAAE,CAAC;gBACvC,MAAM,CAAC,UAAU,CACf,mDAAmD,gBAAgB,CAAC,EAAE,KAAK,sBAAsB,CAAC,OAAO,EAAE,CAC5G,CAAC;gBACF,SAAS;YACX,CAAC;YACD,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,KAAK,CAAC;YAEtD,oDAAoD;YACpD,MAAM,QAAQ,GAAc;gBAC1B,EAAE,EAAE,gBAAgB,CAAC,EAAE;gBACvB,YAAY;gBACZ,QAAQ,EAAE,gBAAgB;gBAC1B,UAAU;aACX,CAAC;YAEF,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;YACjE,sEAAsE;YACtE,IAAI,SAAS,CAAC,SAAS,EAAE,EAAE,CAAC;gBAC1B,MAAM,CAAC,UAAU,CAAC,0BAA0B,gBAAgB,CAAC,EAAE,KAAK,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;YAC3F,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,IAAA,eAAI,EAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,IAAA,kBAAO,EAAC,WAAW,CAAC,CAAC;IAC7E,CAAC;CACF;AA1gBD,gEA0gBC","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 {\n captureResult,\n Collections,\n fail,\n mapResults,\n MessageAggregator,\n Result,\n succeed,\n ValidatingResultMap\n} from '@fgv/ts-utils';\nimport {\n ConditionCollector,\n ConditionSetCollector,\n ReadOnlyConditionCollector,\n ReadOnlyConditionSetCollector\n} from '../conditions';\nimport { AbstractDecisionCollector, ReadOnlyAbstractDecisionCollector } from '../decisions';\nimport { QualifierCollector } from '../qualifiers';\nimport { ResourceType, ResourceTypeCollector } from '../resource-types';\nimport { QualifierType, QualifierTypeCollector } from '../qualifier-types';\nimport { Convert, ResourceId } from '../common';\nimport { Converters } from '@fgv/ts-json-base';\nimport { IResourceManager, IResource, IResourceCandidate } from './iResourceManager';\nimport { ConcreteDecision } from '../decisions';\nimport * as Validate from './validate';\nimport * as ResourceJson from '../resource-json';\nimport { ReadOnlyResourceTreeRoot, IReadOnlyResourceTreeRoot } from './resource-tree';\nimport * as Context from '../context';\n\n/**\n * Interface for parameters to create a {@link Runtime.CompiledResourceCollection | CompiledResourceCollection}.\n * @public\n */\nexport interface ICompiledResourceCollectionCreateParams {\n /**\n * The compiled resource collection data.\n */\n compiledCollection: ResourceJson.Compiled.ICompiledResourceCollection;\n /**\n * Map of qualifier type names to qualifier type objects.\n */\n qualifierTypes: Collections.IReadOnlyResultMap<string, QualifierType>;\n /**\n * Map of resource type names to resource type objects.\n */\n resourceTypes: Collections.IReadOnlyResultMap<string, ResourceType>;\n}\n\n/**\n * A compiled resource collection implements {@link Runtime.IResourceManager | IResourceManager}\n * by reconstructing runtime objects from compiled data. This provides an efficient way to load\n * and use pre-compiled resource collections without rebuilding them from scratch.\n * @public\n */\nexport class CompiledResourceCollection implements IResourceManager {\n public readonly conditions: ReadOnlyConditionCollector;\n public readonly conditionSets: ReadOnlyConditionSetCollector;\n public readonly decisions: ReadOnlyAbstractDecisionCollector;\n\n private readonly _qualifierTypes: QualifierTypeCollector;\n private readonly _qualifiers: QualifierCollector;\n private readonly _resourceTypes: ResourceTypeCollector;\n private readonly _builtResources: ValidatingResultMap<ResourceId, IResource>;\n private _cachedResourceTree?: ReadOnlyResourceTreeRoot<IResource>;\n\n /**\n * A {@link QualifierTypes.QualifierTypeCollector | QualifierTypeCollector} which\n * contains the {@link QualifierTypes.QualifierType | qualifier types} used in this collection.\n */\n public get qualifierTypes(): QualifierTypeCollector {\n return this._qualifierTypes;\n }\n\n /**\n * A {@link Qualifiers.QualifierCollector | QualifierCollector} which\n * contains the {@link Qualifiers.Qualifier | qualifiers} used in this collection.\n */\n public get qualifiers(): QualifierCollector {\n return this._qualifiers;\n }\n\n /**\n * A {@link ResourceTypes.ResourceTypeCollector | ResourceTypeCollector} which\n * contains the {@link ResourceTypes.ResourceType | resource types} used in this collection.\n */\n public get resourceTypes(): ResourceTypeCollector {\n return this._resourceTypes;\n }\n\n /**\n * {@inheritdoc Runtime.IResourceManager.builtResources}\n */\n public get builtResources(): Collections.IReadOnlyValidatingResultMap<ResourceId, IResource> {\n return this._builtResources;\n }\n\n /**\n * {@inheritdoc Runtime.IResourceManager.numResources}\n */\n public get numResources(): number {\n return this._builtResources.size;\n }\n\n protected _numCandidates?: number;\n\n /**\n * {@inheritdoc Runtime.IResourceManager.numCandidates}\n */\n public get numCandidates(): number {\n if (this._numCandidates === undefined) {\n this._numCandidates = [...this._builtResources.values()].reduce(\n (acc, resource) => acc + resource.candidates.length,\n 0\n );\n }\n return this._numCandidates;\n }\n\n /**\n * Constructor for a {@link Runtime.CompiledResourceCollection | CompiledResourceCollection} object.\n * @param params - Parameters to create a new {@link Runtime.CompiledResourceCollection | CompiledResourceCollection}.\n * @internal\n */\n protected constructor(params: ICompiledResourceCollectionCreateParams) {\n // Reconstruct collectors from compiled data\n this._qualifierTypes = this._buildQualifierTypes(\n params.compiledCollection,\n params.qualifierTypes\n ).orThrow();\n this._qualifiers = this._buildQualifiers(params.compiledCollection, this._qualifierTypes).orThrow();\n this._resourceTypes = this._buildResourceTypes(params.compiledCollection, params.resourceTypes).orThrow();\n\n // Build collectors from compiled data\n const conditionCollector = this._buildConditions(params.compiledCollection, this._qualifiers).orThrow();\n const conditionSetCollector = this._buildConditionSets(\n params.compiledCollection,\n conditionCollector\n ).orThrow();\n const decisionCollector = this._buildDecisions(\n params.compiledCollection,\n conditionSetCollector\n ).orThrow();\n\n this.conditions = conditionCollector;\n this.conditionSets = conditionSetCollector;\n this.decisions = decisionCollector;\n\n // Build resources from compiled data\n this._builtResources = this._buildResources(\n params.compiledCollection,\n this._resourceTypes,\n decisionCollector\n ).orThrow();\n }\n\n /**\n * Creates a new {@link Runtime.CompiledResourceCollection | CompiledResourceCollection} object.\n * @param params - Parameters to create a new {@link Runtime.CompiledResourceCollection | CompiledResourceCollection}.\n * @returns `Success` with the new {@link Runtime.CompiledResourceCollection | CompiledResourceCollection} object if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public static create(params: ICompiledResourceCollectionCreateParams): Result<CompiledResourceCollection> {\n return captureResult(() => new CompiledResourceCollection(params));\n }\n\n /**\n * {@inheritdoc Runtime.IResourceManager.getBuiltResource}\n */\n public getBuiltResource(id: string): Result<IResource> {\n return this._builtResources.validating.get(id);\n }\n\n /**\n * {@inheritdoc Runtime.IResourceManager.validateContext}\n */\n public validateContext(context: Context.IContextDecl): Result<Context.IValidatedContextDecl> {\n return Context.Convert.validatedContextDecl.convert(context, {\n qualifiers: this._qualifiers\n });\n }\n\n /**\n * Gets a resource tree built from the resources in this collection.\n * The tree provides hierarchical access to resources based on their ResourceId structure.\n * For example, resources with IDs like \"app.messages.welcome\" create a tree structure\n * where \"app\" and \"messages\" are branch nodes, and \"welcome\" is a leaf containing the resource.\n *\n * String-based validation is available through the `children.validating` property,\n * allowing callers to use `tree.children.validating.getById(stringId)` for validated access.\n *\n * Uses lazy initialization with caching for performance.\n * @returns Result containing the resource tree root, or failure if tree construction fails\n * @public\n */\n public getBuiltResourceTree(): Result<IReadOnlyResourceTreeRoot<IResource>> {\n if (this._cachedResourceTree) {\n return succeed(this._cachedResourceTree);\n }\n\n // Convert all built resources to [ResourceId, IResource] pairs\n const resources: [ResourceId, IResource][] = [];\n for (const [id, resource] of this._builtResources.entries()) {\n resources.push([id, resource]);\n }\n\n // Create the resource tree with lazy initialization\n return ReadOnlyResourceTreeRoot.create(resources).onSuccess((tree) => {\n this._cachedResourceTree = tree;\n return succeed(tree);\n });\n }\n\n /**\n * Reconstructs a QualifierTypeCollector from compiled data.\n * @param compiled - The compiled resource collection\n * @param qualifierTypes - Map of qualifier type names to qualifier type objects\n * @returns The reconstructed QualifierTypeCollector\n * @internal\n */\n private _buildQualifierTypes(\n compiled: ResourceJson.Compiled.ICompiledResourceCollection,\n qualifierTypes: Collections.IReadOnlyResultMap<string, QualifierType>\n ): Result<QualifierTypeCollector> {\n return mapResults(\n compiled.qualifierTypes.map((compiledQualifierType) => qualifierTypes.get(compiledQualifierType.name))\n ).onSuccess((referencedQualifierTypes) => {\n return QualifierTypeCollector.create({\n qualifierTypes: referencedQualifierTypes\n });\n });\n }\n\n /**\n * Reconstructs a QualifierCollector from compiled data.\n * @param compiled - The compiled resource collection\n * @param qualifierTypes - The reconstructed QualifierTypeCollector\n * @returns The reconstructed QualifierCollector\n * @internal\n */\n private _buildQualifiers(\n compiled: ResourceJson.Compiled.ICompiledResourceCollection,\n qualifierTypes: QualifierTypeCollector\n ): Result<QualifierCollector> {\n return mapResults(\n compiled.qualifiers.map((compiledQualifier) => {\n return qualifierTypes.getAt(compiledQualifier.type).onSuccess((qualifierType) => {\n return succeed({\n name: compiledQualifier.name,\n typeName: qualifierType.name,\n defaultPriority: compiledQualifier.defaultPriority\n });\n });\n })\n ).onSuccess((qualifierDecls) => {\n return QualifierCollector.create({\n qualifierTypes,\n qualifiers: qualifierDecls\n });\n });\n }\n\n /**\n * Reconstructs a ResourceTypeCollector from compiled data.\n * @param compiled - The compiled resource collection\n * @param resourceTypes - Map of resource type names to resource type objects\n * @returns The reconstructed ResourceTypeCollector\n * @internal\n */\n private _buildResourceTypes(\n compiled: ResourceJson.Compiled.ICompiledResourceCollection,\n resourceTypes: Collections.IReadOnlyResultMap<string, ResourceType>\n ): Result<ResourceTypeCollector> {\n return mapResults(\n compiled.resourceTypes.map((compiledResourceType) => resourceTypes.get(compiledResourceType.name))\n ).onSuccess((referencedResourceTypes) => {\n return ResourceTypeCollector.create({\n resourceTypes: referencedResourceTypes\n });\n });\n }\n\n /**\n * Reconstructs a ConditionCollector from compiled data.\n * @param compiled - The compiled resource collection\n * @param qualifiers - The reconstructed QualifierCollector\n * @returns The reconstructed ConditionCollector\n * @internal\n */\n private _buildConditions(\n compiled: ResourceJson.Compiled.ICompiledResourceCollection,\n qualifiers: QualifierCollector\n ): Result<ConditionCollector> {\n const errors = new MessageAggregator();\n\n const conditionCollectorResult = ConditionCollector.create({ qualifiers });\n /* c8 ignore next 3 - defensive coding for ConditionCollector creation failure */\n if (conditionCollectorResult.isFailure()) {\n return conditionCollectorResult;\n }\n const conditionCollector = conditionCollectorResult.value;\n\n for (const [index, compiledCondition] of compiled.conditions.entries()) {\n const qualifierResult = qualifiers.getAt(compiledCondition.qualifierIndex);\n if (qualifierResult.isFailure()) {\n errors.addMessage(\n `Invalid qualifier index ${compiledCondition.qualifierIndex} at condition ${index}: ${qualifierResult.message}`\n );\n continue;\n }\n const qualifier = qualifierResult.value;\n\n /* c8 ignore next 1 - not really testable atm as \"matches\" is the only supported operator */\n const operator = compiledCondition.operator ?? 'matches'; // Default to 'matches' if not provided\n const conditionDecl = {\n qualifierName: qualifier.name,\n value: compiledCondition.value,\n operator,\n priority: compiledCondition.priority,\n scoreAsDefault: compiledCondition.scoreAsDefault\n };\n\n const conditionResult = conditionCollector.validating.add(conditionDecl);\n /* c8 ignore next 4 - defensive coding for condition addition failure */\n if (conditionResult.isFailure()) {\n errors.addMessage(`Failed to add condition at index ${index}: ${conditionResult.message}`);\n continue;\n }\n const condition = conditionResult.value;\n\n // Validate that the assigned index matches our expected index\n const expectedIndexResult = Convert.conditionIndex.convert(index);\n /* c8 ignore next 4 - defensive coding for invalid condition index conversion */\n if (expectedIndexResult.isFailure()) {\n errors.addMessage(`Invalid condition index ${index}: ${expectedIndexResult.message}`);\n continue;\n }\n const expectedIndex = expectedIndexResult.value;\n\n /* c8 ignore next 5 - defensive coding for condition index mismatch */\n if (condition.index !== expectedIndex) {\n errors.addMessage(\n `Index mismatch at condition ${index}: expected ${expectedIndex}, got ${condition.index}`\n );\n }\n }\n\n return errors.hasMessages ? fail(errors.toString()) : succeed(conditionCollector);\n }\n\n /**\n * Reconstructs a ConditionSetCollector from compiled data.\n * @param compiled - The compiled resource collection\n * @param conditions - The reconstructed ConditionCollector\n * @returns The reconstructed ConditionSetCollector\n * @internal\n */\n private _buildConditionSets(\n compiled: ResourceJson.Compiled.ICompiledResourceCollection,\n conditions: ConditionCollector\n ): Result<ConditionSetCollector> {\n const errors = new MessageAggregator();\n\n const conditionSetCollectorResult = ConditionSetCollector.create({ conditions });\n /* c8 ignore next 3 - defensive coding for ConditionSetCollector creation failure */\n if (conditionSetCollectorResult.isFailure()) {\n return conditionSetCollectorResult;\n }\n const conditionSetCollector = conditionSetCollectorResult.value;\n\n for (const [index, compiledConditionSet] of compiled.conditionSets.entries()) {\n const referencedConditionsResult = mapResults(\n compiledConditionSet.conditions.map((conditionIndex) => conditions.getAt(conditionIndex))\n );\n if (referencedConditionsResult.isFailure()) {\n errors.addMessage(\n `Failed to resolve conditions for condition set ${index}: ${referencedConditionsResult.message}`\n );\n continue;\n }\n const referencedConditions = referencedConditionsResult.value;\n\n const conditionSetResult = conditionSetCollector.validating.getOrAdd(referencedConditions);\n /* c8 ignore next 4 - defensive coding for condition set addition failure */\n if (conditionSetResult.isFailure()) {\n errors.addMessage(`Failed to add condition set at index ${index}: ${conditionSetResult.message}`);\n continue;\n }\n const conditionSet = conditionSetResult.value;\n\n // Validate that the assigned index matches our expected index\n const expectedIndexResult = Convert.conditionSetIndex.convert(index);\n /* c8 ignore next 4 - defensive coding for invalid condition set index conversion */\n if (expectedIndexResult.isFailure()) {\n errors.addMessage(`Invalid condition set index ${index}: ${expectedIndexResult.message}`);\n continue;\n }\n const expectedIndex = expectedIndexResult.value;\n\n /* c8 ignore next 5 - defensive coding for condition set index mismatch */\n if (conditionSet.index !== expectedIndex) {\n errors.addMessage(\n `Index mismatch at condition set ${index}: expected ${expectedIndex}, got ${conditionSet.index}`\n );\n }\n }\n\n return errors.hasMessages ? fail(errors.toString()) : succeed(conditionSetCollector);\n }\n\n /**\n * Reconstructs an AbstractDecisionCollector from compiled data.\n * @param compiled - The compiled resource collection\n * @param conditionSets - The reconstructed ConditionSetCollector\n * @returns The reconstructed AbstractDecisionCollector\n * @internal\n */\n private _buildDecisions(\n compiled: ResourceJson.Compiled.ICompiledResourceCollection,\n conditionSets: ConditionSetCollector\n ): Result<AbstractDecisionCollector> {\n const errors = new MessageAggregator();\n\n const decisionCollectorResult = AbstractDecisionCollector.create({ conditionSets });\n /* c8 ignore next 3 - defensive coding for AbstractDecisionCollector creation failure */\n if (decisionCollectorResult.isFailure()) {\n return decisionCollectorResult;\n }\n const decisionCollector = decisionCollectorResult.value;\n\n for (const [index, compiledDecision] of compiled.decisions.entries()) {\n const referencedConditionSetsResult = mapResults(\n compiledDecision.conditionSets.map((conditionSetIndex) => conditionSets.getAt(conditionSetIndex))\n );\n if (referencedConditionSetsResult.isFailure()) {\n errors.addMessage(\n `Failed to resolve condition sets for decision ${index}: ${referencedConditionSetsResult.message}`\n );\n continue;\n }\n const referencedConditionSets = referencedConditionSetsResult.value;\n\n const decisionResult = decisionCollector.validating.getOrAdd(referencedConditionSets);\n /* c8 ignore next 4 - defensive coding for decision addition failure */\n if (decisionResult.isFailure()) {\n errors.addMessage(`Failed to add decision at index ${index}: ${decisionResult.message}`);\n continue;\n }\n const decision = decisionResult.value;\n\n // Validate that the assigned index matches our expected index\n const expectedIndexResult = Convert.decisionIndex.convert(index);\n /* c8 ignore next 4 - defensive coding for invalid decision index conversion */\n if (expectedIndexResult.isFailure()) {\n errors.addMessage(`Invalid decision index ${index}: ${expectedIndexResult.message}`);\n continue;\n }\n const expectedIndex = expectedIndexResult.value;\n\n /* c8 ignore next 5 - defensive coding for decision index mismatch */\n if (decision.index !== expectedIndex) {\n errors.addMessage(\n `Index mismatch at decision ${index}: expected ${expectedIndex}, got ${decision.index}`\n );\n }\n }\n\n return errors.hasMessages ? fail(errors.toString()) : succeed(decisionCollector);\n }\n\n /**\n * Reconstructs a ValidatingResultMap of resources from compiled data.\n * @param compiled - The compiled resource collection\n * @param resourceTypes - The reconstructed ResourceTypeCollector\n * @param decisions - The reconstructed AbstractDecisionCollector\n * @returns The reconstructed ValidatingResultMap of resources\n * @internal\n */\n private _buildResources(\n compiled: ResourceJson.Compiled.ICompiledResourceCollection,\n resourceTypes: ResourceTypeCollector,\n decisions: AbstractDecisionCollector\n ): Result<ValidatingResultMap<ResourceId, IResource>> {\n const errors = new MessageAggregator();\n\n const resourceMap = new ValidatingResultMap<ResourceId, IResource>({\n converters: new Collections.KeyValueConverters<ResourceId, IResource>({\n key: Convert.resourceId,\n value: (from: unknown): Result<IResource> => {\n return Validate.resource.validate(from);\n }\n })\n });\n\n for (const compiledResource of compiled.resources) {\n const resourceTypeResult = resourceTypes.getAt(compiledResource.type);\n if (resourceTypeResult.isFailure()) {\n errors.addMessage(\n `Invalid resource type index ${compiledResource.type} for resource ${compiledResource.id}: ${resourceTypeResult.message}`\n );\n continue;\n }\n const resourceType = resourceTypeResult.value;\n\n const decisionResult = decisions.getAt(compiledResource.decision);\n if (decisionResult.isFailure()) {\n errors.addMessage(\n `Invalid decision index ${compiledResource.decision} for resource ${compiledResource.id}: ${decisionResult.message}`\n );\n continue;\n }\n const decision = decisionResult.value;\n\n // Build candidates from compiled data\n const candidateDeclsResult = mapResults(\n compiledResource.candidates.map((compiledCandidate) =>\n Converters.jsonObject.convert(compiledCandidate.json).onSuccess((json) => {\n return succeed({\n json,\n isPartial: compiledCandidate.isPartial,\n mergeMethod: compiledCandidate.mergeMethod\n });\n })\n )\n );\n if (candidateDeclsResult.isFailure()) {\n errors.addMessage(\n `Failed to convert candidate JSON for resource ${compiledResource.id}: ${candidateDeclsResult.message}`\n );\n continue;\n }\n const candidateDecls = candidateDeclsResult.value;\n\n // Create minimal candidates that implement IResourceCandidate\n const candidates: IResourceCandidate[] = candidateDecls.map((candidateDecl) => ({\n json: candidateDecl.json,\n isPartial: candidateDecl.isPartial,\n mergeMethod: candidateDecl.mergeMethod\n }));\n\n // Create a ConcreteDecision from the abstract decision and candidate values\n const candidatesWithConditionSets = decision.candidates.map((baseCandidate, idx) => ({\n conditionSet: baseCandidate.conditionSet,\n value: candidates[idx].json\n }));\n\n const concreteDecisionResult = ConcreteDecision.create({\n decisions,\n candidates: candidatesWithConditionSets\n });\n /* c8 ignore next 6 - defensive coding for ConcreteDecision creation failure */\n if (concreteDecisionResult.isFailure()) {\n errors.addMessage(\n `Failed to create concrete decision for resource ${compiledResource.id}: ${concreteDecisionResult.message}`\n );\n continue;\n }\n const concreteDecision = concreteDecisionResult.value;\n\n // Create minimal resource that implements IResource\n const resource: IResource = {\n id: compiledResource.id,\n resourceType,\n decision: concreteDecision,\n candidates\n };\n\n const setResult = resourceMap.set(compiledResource.id, resource);\n /* c8 ignore next 3 - defensive coding for resource map set failure */\n if (setResult.isFailure()) {\n errors.addMessage(`Failed to add resource ${compiledResource.id}: ${setResult.message}`);\n }\n }\n\n return errors.hasMessages ? fail(errors.toString()) : succeed(resourceMap);\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditionSetResolutionResult.d.ts","sourceRoot":"","sources":["../../../src/packlets/runtime/conditionSetResolutionResult.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnE;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,gBAAgB,GAAG,SAAS,CAAC;AAExE;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAC;CACrC;AAED;;;;GAIG;AACH,qBAAa,4BAA4B;IACvC,SAAgB,SAAS,EAAE,kBAAkB,CAAC;IAC9C,SAAgB,OAAO,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAE9D;;;;OAIG;IACH,OAAO;IAKP;;;;;;OAMG;WACW,MAAM,CAClB,SAAS,EAAE,kBAAkB,EAC7B,OAAO,EAAE,aAAa,CAAC,qBAAqB,CAAC,GAC5C,MAAM,CAAC,4BAA4B,CAAC;IAIvC;;;;;;;;;;;;;;;;OAgBG;WACW,OAAO,CAAC,CAAC,EAAE,4BAA4B,EAAE,CAAC,EAAE,4BAA4B,GAAG,MAAM;IA6C/F;;;;OAIG;IACH,IAAW,WAAW,IAAI,iBAAiB,CAK1C;IAED;;;;OAIG;IACH,IAAW,UAAU,IAAI,mBAAmB,CAK3C;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditionSetResolutionResult.js","sourceRoot":"","sources":["../../../src/packlets/runtime/conditionSetResolutionResult.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAsD;AAmBtD;;;;GAIG;AACH,MAAa,4BAA4B;IAIvC;;;;OAIG;IACH,YAAoB,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KAAK,EAAE,CAAC,CAAwB,CAAC;IAC1F,CAAC;CACF;AAjHD,oEAiHC","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, Result } from '@fgv/ts-utils';\nimport { QualifierMatchScore, ConditionPriority } from '../common';\n\n/**\n * The outcome of a condition match.\n * @public\n */\nexport type ConditionMatchType = 'match' | 'matchAsDefault' | 'noMatch';\n\n/**\n * Represents a single condition match result with priority and outcome.\n * @public\n */\nexport interface IConditionMatchResult {\n readonly priority: ConditionPriority;\n readonly matchType: ConditionMatchType;\n readonly score: QualifierMatchScore;\n}\n\n/**\n * Represents the result of resolving a condition set.\n * Contains either a failure indicator or a list of condition priority/score tuples sorted by priority then score.\n * @public\n */\nexport class ConditionSetResolutionResult {\n public readonly matchType: ConditionMatchType;\n public readonly matches: ReadonlyArray<IConditionMatchResult>;\n\n /**\n * Constructor for a {@link Runtime.ConditionSetResolutionResult | ConditionSetResolutionResult}.\n * @param success - Whether the condition set resolution was successful.\n * @param matches - Array of condition match results, if successful.\n */\n private constructor(matchType: ConditionMatchType, matches: ReadonlyArray<IConditionMatchResult>) {\n this.matchType = matchType;\n this.matches = [...matches];\n }\n\n /**\n * Creates a new condition set resolution result.\n * @param matchType - The type of match.\n * @param matches - Array of condition match results.\n * @returns A new {@link Runtime.ConditionSetResolutionResult | ConditionSetResolutionResult}.\n * @public\n */\n public static create(\n matchType: ConditionMatchType,\n matches: ReadonlyArray<IConditionMatchResult>\n ): Result<ConditionSetResolutionResult> {\n return captureResult(() => new ConditionSetResolutionResult(matchType, matches));\n }\n\n /**\n * Compares two condition set resolution results for sorting purposes.\n * The priority of a condition set result cannot be boiled down to a single number -\n * we have to examine each condition result in turn.\n *\n * Comparison logic:\n * - If priority differs, return the higher priority\n * - If priority matches but score is different, return the higher score\n * - If priority and score both match, proceed to the next condition\n * - Failed results are considered lower priority than successful results\n *\n * @param a - The first condition set resolution result to compare.\n * @param b - The second condition set resolution result to compare.\n * @returns A negative number if a should come before b, a positive number if a should\n * come after b, or zero if they are equivalent.\n * @public\n */\n public static compare(a: ConditionSetResolutionResult, b: ConditionSetResolutionResult): number {\n // Failed results are always lower priority than default match which are lower than match\n if (a.matchType === 'match') {\n if (b.matchType !== 'match') return -1;\n } else if (a.matchType === 'matchAsDefault') {\n if (b.matchType === 'match') {\n return 1;\n } else if (b.matchType === 'noMatch') {\n return -1;\n }\n } else {\n // a.matchType === 'noMatch'\n if (b.matchType === 'noMatch') {\n return 0;\n } else {\n return 1; // noMatch comes after any other match type\n }\n }\n\n // Both are successful with the same match type - compare condition by condition\n const minLength = Math.min(a.matches.length, b.matches.length);\n\n for (let i = 0; i < minLength; i++) {\n const matchA = a.matches[i];\n const matchB = b.matches[i];\n\n // Compare priority first\n const priorityDiff = matchB.priority - matchA.priority;\n if (priorityDiff !== 0) {\n return priorityDiff;\n }\n\n // If priority matches, compare score\n const scoreDiff = matchB.score - matchA.score;\n if (scoreDiff !== 0) {\n return scoreDiff;\n }\n\n // If both priority and score match, continue to next condition\n }\n\n // If all compared conditions are equal, the one with more conditions wins\n return b.matches.length - a.matches.length;\n }\n\n /**\n * Gets the highest priority among all condition matches.\n * @returns The highest priority, or 0 if no matches.\n * @public\n */\n public get maxPriority(): ConditionPriority {\n if (this.matchType === 'noMatch' || this.matches.length === 0) {\n return 0 as ConditionPriority;\n }\n return Math.max(...this.matches.map((m) => m.priority)) as ConditionPriority;\n }\n\n /**\n * Gets the total score by summing all condition match scores.\n * @returns The total score, or 0 if no matches.\n * @public\n */\n public get totalScore(): QualifierMatchScore {\n if (this.matchType === 'noMatch' || this.matches.length === 0) {\n return 0 as QualifierMatchScore;\n }\n return this.matches.reduce((sum, match) => sum + match.score, 0) as QualifierMatchScore;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"contextQualifierProvider.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/contextQualifierProvider.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,2BAA2B,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE1E;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;;OAKG;IACH,GAAG,CAAC,sBAAsB,EAAE,aAAa,GAAG,cAAc,GAAG,SAAS,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAEvG;;;;;OAKG;IACH,YAAY,CACV,sBAAsB,EAAE,aAAa,GAAG,cAAc,GAAG,SAAS,GACjE,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAEjC;;;;;OAKG;IACH,GAAG,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAE1C;;;;OAIG;IACH,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;IAEjD;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,2BAA2B,CAAC;CAClD;AAED;;;;GAIG;AACH,8BAAsB,wBAAyB,YAAW,yBAAyB;IACjF;;OAEG;IACH,kBAAyB,UAAU,EAAE,2BAA2B,CAAC;IAEjE;;;;;OAKG;aACa,GAAG,CACjB,sBAAsB,EAAE,aAAa,GAAG,cAAc,GAAG,SAAS,GACjE,MAAM,CAAC,qBAAqB,CAAC;IAEhC;;;;;OAKG;aACa,YAAY,CAC1B,sBAAsB,EAAE,aAAa,GAAG,cAAc,GAAG,SAAS,GACjE,MAAM,CAAC,qBAAqB,CAAC;IAEhC;;;;;OAKG;aACa,GAAG,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC;IAEzD;;;;OAIG;aACa,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;CACjE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"contextQualifierProvider.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/contextQualifierProvider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAmDH;;;;GAIG;AACH,MAAsB,wBAAwB;CAwC7C;AAxCD,4DAwCC","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 } from '@fgv/ts-utils';\nimport { QualifierName, QualifierContextValue, QualifierIndex } from '../../common';\nimport { IReadOnlyQualifierCollector, Qualifier } from '../../qualifiers';\n\n/**\n * Abstract interface for providing qualifier values in an optimized runtime context.\n * Acts as a property bag using the Result pattern for qualifier value lookups.\n * @public\n */\nexport interface IContextQualifierProvider {\n /**\n * Gets a qualifier value by its name, index, or qualifier object.\n * @param nameOrIndexOrQualifier - The {@link QualifierName | qualifier name}, {@link QualifierIndex | index}, or {@link Qualifiers.Qualifier | qualifier object} to look up.\n * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found or an error occurs.\n */\n get(nameOrIndexOrQualifier: QualifierName | QualifierIndex | Qualifier): Result<QualifierContextValue>;\n\n /**\n * Gets a validated qualifier context value by its name, index, or qualifier object.\n * @param nameOrIndexOrQualifier - The {@link QualifierName | qualifier name}, {@link QualifierIndex | index}, or {@link Qualifiers.Qualifier | qualifier object} to look up.\n * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found, invalid, or an error occurs.\n */\n getValidated(\n nameOrIndexOrQualifier: QualifierName | QualifierIndex | Qualifier\n ): Result<QualifierContextValue>;\n\n /**\n * Checks if a qualifier value exists with the given name.\n * @param name - The {@link QualifierName | qualifier name} to check.\n * @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,\n * or `Failure` with an error message if an error occurs during the check.\n */\n has(name: QualifierName): Result<boolean>;\n\n /**\n * Gets all available qualifier names in this context.\n * @returns `Success` with an array of all {@link QualifierName | qualifier names},\n * or `Failure` with an error message if an error occurs.\n */\n getNames(): Result<ReadonlyArray<QualifierName>>;\n\n /**\n * The readonly qualifier collector that defines and validates the qualifiers for this context.\n */\n readonly qualifiers: IReadOnlyQualifierCollector;\n}\n\n/**\n * Abstract base class for implementing context qualifier providers.\n * Provides common functionality and enforces the contract for derived classes.\n * @public\n */\nexport abstract class ContextQualifierProvider implements IContextQualifierProvider {\n /**\n * The readonly qualifier collector that defines and validates the qualifiers for this context.\n */\n public abstract readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Gets a qualifier value by its name, index, or qualifier object.\n * @param nameOrIndexOrQualifier - The {@link QualifierName | qualifier name}, {@link QualifierIndex | index}, or {@link Qualifiers.Qualifier | qualifier object} to look up.\n * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found or an error occurs.\n */\n public abstract get(\n nameOrIndexOrQualifier: QualifierName | QualifierIndex | Qualifier\n ): Result<QualifierContextValue>;\n\n /**\n * Gets a validated qualifier context value by its name, index, or qualifier object.\n * @param nameOrIndexOrQualifier - The {@link QualifierName | qualifier name}, {@link QualifierIndex | index}, or {@link Qualifiers.Qualifier | qualifier object} to look up.\n * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found, invalid, or an error occurs.\n */\n public abstract getValidated(\n nameOrIndexOrQualifier: QualifierName | QualifierIndex | Qualifier\n ): Result<QualifierContextValue>;\n\n /**\n * Checks if a qualifier value exists with the given name.\n * @param name - The {@link QualifierName | qualifier name} to check.\n * @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,\n * or `Failure` with an error message if an error occurs during the check.\n */\n public abstract has(name: QualifierName): Result<boolean>;\n\n /**\n * Gets all available qualifier names in this context.\n * @returns `Success` with an array of all {@link QualifierName | qualifier names},\n * or `Failure` with an error message if an error occurs.\n */\n public abstract getNames(): Result<ReadonlyArray<QualifierName>>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"contextQualifierProviderValidator.d.ts","sourceRoot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AClG;;OAEG;IACH,SAAgB,QAAQ,EAAE,yBAAyB,CAAC;IAEpD;;OAEG;IACH,IAAW,UAAU,IAAI,2BAA2B,CAEnD;IAED;;;OAGG;gBACgB,MAAM,EAAE,8CAA8C;IAIzE;;;;;OAKG;IACI,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC;IAMvD;;;;;OAKG;IACI,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC;IAM/D;;;;;OAKG;IACI,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC;IAMhE;;;;;OAKG;IACI,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC;IAMxE;;;;;OAKG;IACI,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;IAMzC;;;;;;OAMG;IACI,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC;IAqBtE;;;;;OAKG;IACI,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC;IAgB1D;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;IAO9B;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;IAO/B;;;;OAIG;IACH,OAAO,CAAC,8BAA8B;CAMvC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"contextQualifierProviderValidator.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/contextQualifierProviderValidator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAsD;AAsFtD;;;;;GAKG;AACH,MAAa,iCAAiC;IAM5C;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;IAClC,CAAC;IAED;;;OAGG;IACH,YAA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IG;IACK,sBAAsB,CAAC,IAAY;QACzC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAClD,OAAO,IAAA,eAAI,EAAC,4BAA4B,IAAI,GAAG,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,IAAA,kBAAO,EAAC,IAAqB,CAAC,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACK,uBAAuB,CAAC,KAAa;QAC3C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YACvE,OAAO,IAAA,eAAI,EAAC,4BAA4B,KAAK,EAAE,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,IAAA,kBAAO,EAAC,KAAuB,CAAC,CAAC;IAC1C,CAAC;IAED;;;;OAIG;IACK,8BAA8B,CAAC,KAAa;QAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,IAAA,eAAI,EAAC,qCAAqC,KAAK,GAAG,CAAC,CAAC;QAC7D,CAAC;QACD,OAAO,IAAA,kBAAO,EAAC,KAA8B,CAAC,CAAC;IACjD,CAAC;CACF;AAtKD,8EAsKC","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, succeed } from '@fgv/ts-utils';\nimport { QualifierName, QualifierContextValue, QualifierIndex } from '../../common';\nimport { IReadOnlyQualifierCollector } from '../../qualifiers';\nimport { IContextQualifierProvider } from './contextQualifierProvider';\n\n/**\n * A read-only interface exposing non-mutating methods of a {@link Runtime.Context.ContextQualifierProviderValidator | ContextQualifierProviderValidator}.\n * @public\n */\nexport interface IReadOnlyContextQualifierProviderValidator {\n /**\n * {@inheritdoc Runtime.Context.ContextQualifierProviderValidator.provider}\n */\n readonly provider: IContextQualifierProvider;\n\n /**\n * {@inheritdoc Runtime.Context.ContextQualifierProviderValidator.qualifiers}\n */\n readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Gets a qualifier value by its string name, converting to strongly-typed QualifierName.\n * @param name - The string name to convert and look up.\n * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found or an error occurs.\n */\n get(name: string): Result<QualifierContextValue>;\n\n /**\n * Gets a qualifier value by its number index, converting to strongly-typed QualifierIndex.\n * @param index - The number index to convert and look up.\n * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found or an error occurs.\n */\n getByIndex(index: number): Result<QualifierContextValue>;\n\n /**\n * Gets a validated qualifier context value by its string name.\n * @param name - The string name to convert and look up.\n * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found, invalid, or an error occurs.\n */\n getValidated(name: string): Result<QualifierContextValue>;\n\n /**\n * Gets a validated qualifier context value by its number index.\n * @param index - The number index to convert and look up.\n * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found, invalid, or an error occurs.\n */\n getValidatedByIndex(index: number): Result<QualifierContextValue>;\n\n /**\n * Checks if a qualifier value exists with the given string name.\n * @param name - The string name to convert and check.\n * @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,\n * or `Failure` with an error message if an error occurs during the check.\n */\n has(name: string): Result<boolean>;\n\n /**\n * Sets a qualifier value using string inputs, converting to strongly-typed values.\n * @param name - The string name to convert.\n * @param value - The string value to convert.\n * @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,\n * or `Failure` with an error message if an error occurs.\n */\n set(name: string, value: string): Result<QualifierContextValue>;\n\n /**\n * Removes a qualifier value using string input, converting to strongly-typed QualifierName.\n * @param name - The string name to convert.\n * @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,\n * or `Failure` with an error message if an error occurs.\n */\n remove(name: string): Result<QualifierContextValue>;\n}\n\n/**\n * Parameters for constructing a {@link Runtime.Context.ContextQualifierProviderValidator | ContextQualifierProviderValidator}.\n * @public\n */\nexport interface IContextQualifierProviderValidatorCreateParams {\n provider: IContextQualifierProvider;\n}\n\n/**\n * A wrapper for {@link Runtime.Context.IContextQualifierProvider | IContextQualifierProvider} that accepts\n * string inputs and converts them to strongly-typed values before calling the wrapped provider.\n * This eliminates the need for type casting in consumer code while maintaining type safety.\n * @public\n */\nexport class ContextQualifierProviderValidator implements IReadOnlyContextQualifierProviderValidator {\n /**\n * The wrapped context qualifier provider.\n */\n public readonly provider: IContextQualifierProvider;\n\n /**\n * The readonly qualifier collector that defines and validates the qualifiers for this context.\n */\n public get qualifiers(): IReadOnlyQualifierCollector {\n return this.provider.qualifiers;\n }\n\n /**\n * Constructs a new {@link Runtime.Context.ContextQualifierProviderValidator | ContextQualifierProviderValidator}.\n * @param params - Required parameters for constructing the validator.\n */\n public constructor(params: IContextQualifierProviderValidatorCreateParams) {\n this.provider = params.provider;\n }\n\n /**\n * Gets a qualifier value by its string name, converting to strongly-typed QualifierName.\n * @param name - The string name to convert and look up.\n * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found or an error occurs.\n */\n public get(name: string): Result<QualifierContextValue> {\n return this._validateQualifierName(name).onSuccess((qualifierName) => {\n return this.provider.get(qualifierName);\n });\n }\n\n /**\n * Gets a qualifier value by its number index, converting to strongly-typed QualifierIndex.\n * @param index - The number index to convert and look up.\n * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found or an error occurs.\n */\n public getByIndex(index: number): Result<QualifierContextValue> {\n return this._validateQualifierIndex(index).onSuccess((qualifierIndex) => {\n return this.provider.get(qualifierIndex);\n });\n }\n\n /**\n * Gets a validated qualifier context value by its string name.\n * @param name - The string name to convert and look up.\n * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found, invalid, or an error occurs.\n */\n public getValidated(name: string): Result<QualifierContextValue> {\n return this._validateQualifierName(name).onSuccess((qualifierName) => {\n return this.provider.getValidated(qualifierName);\n });\n }\n\n /**\n * Gets a validated qualifier context value by its number index.\n * @param index - The number index to convert and look up.\n * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,\n * or `Failure` with an error message if not found, invalid, or an error occurs.\n */\n public getValidatedByIndex(index: number): Result<QualifierContextValue> {\n return this._validateQualifierIndex(index).onSuccess((qualifierIndex) => {\n return this.provider.getValidated(qualifierIndex);\n });\n }\n\n /**\n * Checks if a qualifier value exists with the given string name.\n * @param name - The string name to convert and check.\n * @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,\n * or `Failure` with an error message if an error occurs during the check.\n */\n public has(name: string): Result<boolean> {\n return this._validateQualifierName(name).onSuccess((qualifierName) => {\n return this.provider.has(qualifierName);\n });\n }\n\n /**\n * Sets a qualifier value using string inputs, converting to strongly-typed values.\n * @param name - The string name to convert.\n * @param value - The string value to convert.\n * @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,\n * or `Failure` with an error message if an error occurs.\n */\n public set(name: string, value: string): Result<QualifierContextValue> {\n return this._validateQualifierName(name)\n .onSuccess((qualifierName) => this._validateQualifierContextValue(value))\n .onSuccess((qualifierValue) => {\n // Check if the provider has a set method (only available on mutable providers)\n if ('set' in this.provider && typeof this.provider.set === 'function') {\n try {\n return (\n this.provider.set as (\n name: QualifierName,\n value: QualifierContextValue\n ) => Result<QualifierContextValue>\n )(name as QualifierName, qualifierValue);\n } catch {\n return fail(`Provider does not support setting values`);\n }\n }\n return fail(`Provider does not support setting values`);\n });\n }\n\n /**\n * Removes a qualifier value using string input, converting to strongly-typed QualifierName.\n * @param name - The string name to convert.\n * @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,\n * or `Failure` with an error message if an error occurs.\n */\n public remove(name: string): Result<QualifierContextValue> {\n return this._validateQualifierName(name).onSuccess((qualifierName) => {\n // Check if the provider has a remove method (only available on mutable providers)\n if ('remove' in this.provider && typeof this.provider.remove === 'function') {\n try {\n return (this.provider.remove as (name: QualifierName) => Result<QualifierContextValue>)(\n qualifierName\n );\n } catch {\n return fail(`Provider does not support removing values`);\n }\n }\n return fail(`Provider does not support removing values`);\n });\n }\n\n /**\n * Validates a string as a QualifierName.\n * @param name - The string to validate.\n * @returns `Success` with the strongly-typed QualifierName, or `Failure` if invalid.\n */\n private _validateQualifierName(name: string): Result<QualifierName> {\n if (typeof name !== 'string' || name.length === 0) {\n return fail(`Invalid qualifier name: \"${name}\"`);\n }\n return succeed(name as QualifierName);\n }\n\n /**\n * Validates a number as a QualifierIndex.\n * @param index - The number to validate.\n * @returns `Success` with the strongly-typed QualifierIndex, or `Failure` if invalid.\n */\n private _validateQualifierIndex(index: number): Result<QualifierIndex> {\n if (typeof index !== 'number' || !Number.isInteger(index) || index < 0) {\n return fail(`Invalid qualifier index: ${index}`);\n }\n return succeed(index as QualifierIndex);\n }\n\n /**\n * Validates a string as a QualifierContextValue.\n * @param value - The string to validate.\n * @returns `Success` with the strongly-typed QualifierContextValue, or `Failure` if invalid.\n */\n private _validateQualifierContextValue(value: string): Result<QualifierContextValue> {\n if (typeof value !== 'string') {\n return fail(`Invalid qualifier context value: \"${value}\"`);\n }\n return succeed(value as QualifierContextValue);\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/index.ts"],"names":[],"mappings":"AAsBA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AACjD,cAAc,4CAA4C,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,6DAA2C;AAC3C,sEAAoD;AACpD,mEAAiD;AACjD,6EAA2D","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 './contextQualifierProvider';\nexport * from './contextQualifierProviderValidator';\nexport * from './simpleContextQualifierProvider';\nexport * from './validatingSimpleContextQualifierProvider';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"simpleContextQualifierProvider.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/simpleContextQualifierProvider.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAA8D,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,cAAc,EAAY,MAAM,cAAc,CAAC;AAC9F,OAAO,EAAE,2BAA2B,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE;;;GAGG;AACH,MAAM,WAAW,2CAA2C;IAC1D;;OAEG;IACH,UAAU,EAAE,2BAA2B,CAAC;IAExC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;CACzD;AAED;;;;GAIG;AACH,qBAAa,8BAA+B,SAAQ,wBAAwB;IAC1E;;OAEG;IACH,SAAgB,UAAU,EAAE,2BAA2B,CAAC;IAExD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAkD;IAEnF;;;OAGG;IACH,SAAS,aAAa,MAAM,EAAE,2CAA2C;IAazE;;;;;;OAMG;WACW,MAAM,CAClB,MAAM,EAAE,2CAA2C,GAClD,MAAM,CAAC,8BAA8B,CAAC;IAIzC;;;;;OAKG;IACI,GAAG,CACR,sBAAsB,EAAE,aAAa,GAAG,cAAc,GAAG,SAAS,GACjE,MAAM,CAAC,qBAAqB,CAAC;IAShC;;;;;;OAMG;IACI,YAAY,CACjB,sBAAsB,EAAE,aAAa,GAAG,cAAc,GAAG,SAAS,GACjE,MAAM,CAAC,qBAAqB,CAAC;IAShC;;;;;OAKG;IACI,GAAG,CAAC,IAAI,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