@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":"common.js","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/common.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * Options for controlling the compilation of resource objects.\n * @public\n */\nexport interface ICompiledResourceOptions {\n /**\n * Whether to include metadata in the compiled objects.\n * Metadata includes human-readable information like semantic keys\n * that can be useful for debugging or tooling.\n * @defaultValue false\n */\n includeMetadata?: boolean;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/convert.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,KAAK,MAAM,QAAQ,CAAC;AAIhC;;;GAGG;AACH,eAAO,MAAM,yBAAyB,oFAEpC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,4BAA4B,uFAEvC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,wBAAwB,mFAEnC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB,gFAEhC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,4EAI5B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,oBAAoB,+EAE/B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,4EAO5B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,oBAAoB,+EAG/B,CAAC;AACH;;;GAGG;AACH,eAAO,MAAM,wBAAwB,mFAGnC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,4EAI5B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,2EAK3B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,qFAQrC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/convert.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qDAAuC;AACvC,4CAA2C;AAC3C,oDAAiE;AAGjE,2CAA2C;AAE3C;;;GAGG;AACU,QAAA,yBAAyB,GAAG,qBAAU,CAAC,YAAY,CAAmC;IACjG,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,YAAY;CACjC,CAAC,CAAC;AAEH;;;GAGG;AACU,QAAA,4BAA4B,GAAG,qBAAU,CAAC,YAAY,CAAsC;IACvG,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC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BAAgB,CAAC;CAChD,CAAC,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nimport * as Common from '../../common';\nimport { Converters } from '@fgv/ts-utils';\nimport { Converters as JsonConverters } from '@fgv/ts-json-base';\nimport * as Model from './json';\n\n/* eslint-disable @rushstack/typedef-var */\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledConditionMetadata | compiled condition metadata}.\n * @public\n */\nexport const compiledConditionMetadata = Converters.strictObject<Model.ICompiledConditionMetadata>({\n key: Common.Convert.conditionKey\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledConditionSetMetadata | compiled condition set metadata}.\n * @public\n */\nexport const compiledConditionSetMetadata = Converters.strictObject<Model.ICompiledConditionSetMetadata>({\n key: Common.Convert.conditionSetKey\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledDecisionMetadata | compiled decision metadata}.\n * @public\n */\nexport const compiledDecisionMetadata = Converters.strictObject<Model.ICompiledDecisionMetadata>({\n key: Common.Convert.decisionKey\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledQualifierType | compiled qualifier type}.\n * @public\n */\nexport const compiledQualifierType = Converters.strictObject<Model.ICompiledQualifierType>({\n name: Common.Convert.qualifierTypeName\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledQualifier | compiled qualifier}.\n * @public\n */\nexport const compiledQualifier = Converters.strictObject<Model.ICompiledQualifier>({\n name: Common.Convert.qualifierName,\n type: Common.Convert.qualifierTypeIndex,\n defaultPriority: Common.Convert.conditionPriority\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledResourceType | compiled resource type}.\n * @public\n */\nexport const compiledResourceType = Converters.strictObject<Model.ICompiledResourceType>({\n name: Common.Convert.resourceTypeName\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledCondition | compiled condition}.\n * @public\n */\nexport const compiledCondition = Converters.strictObject<Model.ICompiledCondition>({\n qualifierIndex: Common.Convert.qualifierIndex,\n operator: Common.Convert.conditionOperator.optional(),\n value: Converters.string,\n priority: Common.Convert.conditionPriority,\n scoreAsDefault: Common.Convert.qualifierMatchScore.optional(),\n metadata: compiledConditionMetadata.optional()\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledConditionSet | compiled condition set}.\n * @public\n */\nexport const compiledConditionSet = Converters.strictObject<Model.ICompiledConditionSet>({\n conditions: Converters.arrayOf(Common.Convert.conditionIndex),\n metadata: compiledConditionSetMetadata.optional()\n});\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledAbstractDecision | compiled abstract decision}.\n * @public\n */\nexport const compiledAbstractDecision = Converters.strictObject<Model.ICompiledAbstractDecision>({\n conditionSets: Converters.arrayOf(Common.Convert.conditionSetIndex),\n metadata: compiledDecisionMetadata.optional()\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledCandidate | compiled candidate}.\n * @public\n */\nexport const compiledCandidate = Converters.strictObject<Model.ICompiledCandidate>({\n json: JsonConverters.jsonValue,\n isPartial: Converters.boolean,\n mergeMethod: Common.Convert.resourceValueMergeMethod\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledResource | compiled resource}.\n * @public\n */\nexport const compiledResource = Converters.strictObject<Model.ICompiledResource>({\n id: Common.Convert.resourceId,\n type: Common.Convert.resourceTypeIndex,\n decision: Common.Convert.decisionIndex,\n candidates: Converters.arrayOf(compiledCandidate)\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledResourceCollection | compiled resource collection}.\n * This combines all the individual converters into a single converter for the entire resource collection.\n * @public\n */\nexport const compiledResourceCollection = Converters.strictObject<Model.ICompiledResourceCollection>({\n qualifiers: Converters.arrayOf(compiledQualifier),\n qualifierTypes: Converters.arrayOf(compiledQualifierType),\n resourceTypes: Converters.arrayOf(compiledResourceType),\n conditions: Converters.arrayOf(compiledCondition),\n conditionSets: Converters.arrayOf(compiledConditionSet),\n decisions: Converters.arrayOf(compiledAbstractDecision),\n resources: Converters.arrayOf(compiledResource)\n});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AAI5B,0BAAO;AAFhB,2CAAyB;AACzB,yCAAuB","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Convert from './convert';\n\nexport * from './common';\nexport * from './json';\nexport { Convert };\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/json.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC,YAAY,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC,eAAe,CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC,WAAW,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC,iBAAiB,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;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC,UAAU,CAAC;IAEtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC,iBAAiB,CAAC;IAE/B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC,aAAa,CAAC;IAC/B;;OAEG;IACH,UAAU,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CAC/C;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,cAAc,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;IACtD;;OAEG;IACH,UAAU,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAC9C;;OAEG;IACH,aAAa,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IACpD;;OAEG;IACH,UAAU,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAC9C;;OAEG;IACH,aAAa,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IACpD;;OAEG;IACH,SAAS,EAAE,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACpD;;OAEG;IACH,SAAS,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;CAC7C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"json.js","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/json.ts"],"names":[],"mappings":"","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 */\nimport * as Common from '../../common';\nimport { JsonValue } from '@fgv/ts-json-base';\n\n/**\n * Metadata for a compiled condition, containing human-readable information.\n * @public\n */\nexport interface ICompiledConditionMetadata {\n /**\n * The semantic key of the condition (e.g., \"language=en-US\").\n */\n key: Common.ConditionKey;\n}\n\n/**\n * Metadata for a compiled condition set, containing human-readable information.\n * @public\n */\nexport interface ICompiledConditionSetMetadata {\n /**\n * The semantic key of the condition set (e.g., \"language=en-US,territory=US\").\n */\n key: Common.ConditionSetKey;\n}\n\n/**\n * Metadata for a compiled decision, containing human-readable information.\n * @public\n */\nexport interface ICompiledDecisionMetadata {\n /**\n * The semantic key of the decision (e.g., \"language=en-US,territory=US OR language=fr,territory=CA\").\n */\n key: Common.DecisionKey;\n}\n\n/**\n * Represents a compiled qualifier type with a name.\n * @public\n */\nexport interface ICompiledQualifierType {\n /**\n * The name of the qualifier type.\n */\n name: Common.QualifierTypeName;\n}\n\n/**\n * Represents a compiled qualifier with a name and type reference.\n * @public\n */\nexport interface ICompiledQualifier {\n /**\n * The name of the qualifier.\n */\n name: Common.QualifierName;\n /**\n * Index reference to the qualifier type.\n */\n type: Common.QualifierTypeIndex;\n\n /**\n * The token used to identify the qualifier in resource names or paths.\n */\n defaultPriority: Common.ConditionPriority;\n}\n\n/**\n * Represents a compiled resource type with a name.\n * @public\n */\nexport interface ICompiledResourceType {\n /**\n * The name of the resource type.\n */\n name: Common.ResourceTypeName;\n}\n\n/**\n * Represents a compiled condition used for resource selection.\n * @public\n */\nexport interface ICompiledCondition {\n /**\n * Index reference to the qualifier being evaluated.\n */\n qualifierIndex: Common.QualifierIndex;\n /**\n * Optional operator to apply in the condition evaluation.\n */\n operator?: Common.ConditionOperator;\n /**\n * The value to compare against when evaluating the condition.\n */\n value: string;\n /**\n * The priority of the condition when multiple conditions match.\n */\n priority: Common.ConditionPriority;\n /**\n * Optional score to use when treating this condition as a default.\n */\n scoreAsDefault?: Common.QualifierMatchScore;\n /**\n * Optional metadata containing human-readable information about this condition.\n */\n metadata?: ICompiledConditionMetadata;\n}\n\n/**\n * Represents a compiled set of conditions that must be satisfied together.\n * @public\n */\nexport interface ICompiledConditionSet {\n /**\n * Array of indices referencing the conditions in this set.\n */\n conditions: ReadonlyArray<Common.ConditionIndex>;\n /**\n * Optional metadata containing human-readable information about this condition set.\n */\n metadata?: ICompiledConditionSetMetadata;\n}\n\n/**\n * Represents a compiled abstract decision with condition sets.\n * @public\n */\nexport interface ICompiledAbstractDecision {\n /**\n * Array of indices referencing the condition sets for this decision.\n */\n conditionSets: ReadonlyArray<Common.ConditionSetIndex>;\n /**\n * Optional metadata containing human-readable information about this decision.\n */\n metadata?: ICompiledDecisionMetadata;\n}\n\n/**\n * Represents a compiled resource candidate with JSON value and merge properties.\n * @public\n */\nexport interface ICompiledCandidate {\n /**\n * The JSON value of the candidate.\n */\n json: JsonValue;\n /**\n * Indicates if this is a partial resource that needs to be merged.\n */\n isPartial: boolean;\n /**\n * The method to use when merging this candidate with others.\n */\n mergeMethod: Common.ResourceValueMergeMethod;\n}\n\n/**\n * Represents a compiled resource with an identifier and associated candidates.\n * @public\n */\nexport interface ICompiledResource {\n /**\n * The unique identifier of the resource.\n */\n id: Common.ResourceId;\n\n /**\n * Index reference to the resource type of this resource.\n */\n type: Common.ResourceTypeIndex;\n\n /**\n * Index reference to the decision that determines when this resource applies.\n */\n decision: Common.DecisionIndex;\n /**\n * Array of candidate values for this resource.\n */\n candidates: ReadonlyArray<ICompiledCandidate>;\n}\n\n/**\n * Represents a complete compiled collection of resources with their associated\n * qualifiers, types, conditions, and decisions.\n * @public\n */\nexport interface ICompiledResourceCollection {\n /**\n * Array of all qualifier types in the collection.\n */\n qualifierTypes: ReadonlyArray<ICompiledQualifierType>;\n /**\n * Array of all qualifiers in the collection.\n */\n qualifiers: ReadonlyArray<ICompiledQualifier>;\n /**\n * Array of all resource types in the collection.\n */\n resourceTypes: ReadonlyArray<ICompiledResourceType>;\n /**\n * Array of all conditions in the collection.\n */\n conditions: ReadonlyArray<ICompiledCondition>;\n /**\n * Array of all condition sets in the collection.\n */\n conditionSets: ReadonlyArray<ICompiledConditionSet>;\n /**\n * Array of all decisions in the collection.\n */\n decisions: ReadonlyArray<ICompiledAbstractDecision>;\n /**\n * Array of all resources in the collection.\n */\n resources: ReadonlyArray<ICompiledResource>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/convert.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAAwC,MAAM,eAAe,CAAC;AAGhF,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,IAAI,CAAC,mBAAmB,CAO/D,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,IAAI,CAAC,mBAAmB,CAM/D,CAAC;AA+BL;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,CAAC,UAAU,CAAC,gBAAgB,CACoC,CAAC;AAEzG;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,SAAS,CAAC,UAAU,CAAC,2BAA2B,CAQrF,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,SAAS,CAAC,UAAU,CAAC,8BAA8B,CAQ3F,CAAC;AAEL;;;GAGG;AACH,e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C,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5B,CAAC,CACF,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Converter, Converters, mapResults, Result, fail } from '@fgv/ts-utils';\nimport { Convert as CommonConvert } from '../common';\nimport { isJsonObject, Converters as JsonConverters } from '@fgv/ts-json-base';\nimport * as Json from './json';\nimport * as Normalized from './normalized';\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Json.ILooseConditionDecl | loose condition declaration}.\n * @public\n */\nexport const looseConditionDecl: Converter<Json.ILooseConditionDecl> =\n Converters.strictObject<Json.ILooseConditionDecl>({\n qualifierName: CommonConvert.qualifierName,\n value: Converters.string,\n operator: CommonConvert.conditionOperator.optional(),\n priority: CommonConvert.conditionPriority.optional(),\n scoreAsDefault: Converters.number.optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Json.IChildConditionDecl | child condition declaration}.\n * @public\n */\nexport const childConditionDecl: Converter<Json.IChildConditionDecl> =\n Converters.strictObject<Json.IChildConditionDecl>({\n value: Converters.string,\n operator: CommonConvert.conditionOperator.optional(),\n priority: CommonConvert.conditionPriority.optional(),\n scoreAsDefault: Converters.number.optional()\n });\n\nfunction _isConditionSetRecord(from: unknown): from is Record<string, string | Json.IChildConditionDecl> {\n return isJsonObject(from);\n}\n\nconst conditionSetDeclFromArray: Converter<Normalized.ConditionSetDecl> =\n Converters.arrayOf(looseConditionDecl);\nconst conditionSetDeclFromRecord: Converter<Normalized.ConditionSetDecl> = Converters.generic<\n Normalized.ConditionSetDecl,\n unknown\n>(\n (\n from: unknown,\n __self: Converter<Normalized.ConditionSetDecl, unknown>,\n context?: unknown\n ): Result<Normalized.ConditionSetDecl> => {\n /* c8 ignore next 3 - this is tested but coverage is confused */\n if (!_isConditionSetRecord(from)) {\n return fail('Expected an object');\n }\n return mapResults(\n Array.from(Object.entries(from)).map(([qualifierName, value]) => {\n const toConvert: Json.ILooseConditionDecl =\n typeof value === 'string' ? { qualifierName, value } : { qualifierName, ...value };\n return looseConditionDecl.convert(toConvert, context);\n })\n );\n }\n);\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.ConditionSetDecl | condition set declaration}.\n * @public\n */\nexport const conditionSetDecl: Converter<Normalized.ConditionSetDecl> =\n Converters.oneOf<Normalized.ConditionSetDecl>([conditionSetDeclFromArray, conditionSetDeclFromRecord]);\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Json.ILooseResourceCandidateDecl | loose resource candidate declaration}.\n * @public\n */\nexport const looseResourceCandidateDecl: Converter<Normalized.ILooseResourceCandidateDecl> =\n Converters.strictObject<Normalized.ILooseResourceCandidateDecl>({\n id: CommonConvert.resourceId,\n json: JsonConverters.jsonObject,\n conditions: conditionSetDecl.optional(),\n mergeMethod: CommonConvert.resourceValueMergeMethod.optional(),\n isPartial: Converters.boolean.optional(),\n resourceTypeName: CommonConvert.resourceTypeName.optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | importer resource candidate declaration}.\n * @public\n */\nexport const importerResourceCandidateDecl: Converter<Normalized.IImporterResourceCandidateDecl> =\n Converters.strictObject<Normalized.IImporterResourceCandidateDecl>({\n id: CommonConvert.resourceId.optional(),\n json: JsonConverters.jsonObject,\n conditions: conditionSetDecl.optional(),\n mergeMethod: CommonConvert.resourceValueMergeMethod.optional(),\n isPartial: Converters.boolean.optional(),\n resourceTypeName: CommonConvert.resourceTypeName.optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Json.IChildResourceCandidateDecl | child resource candidate declaration}.\n * @public\n */\nexport const childResourceCandidateDecl: Converter<Normalized.IChildResourceCandidateDecl> =\n Converters.strictObject<Normalized.IChildResourceCandidateDecl>({\n json: JsonConverters.jsonObject,\n conditions: conditionSetDecl.optional(),\n isPartial: Converters.boolean.optional(),\n mergeMethod: CommonConvert.resourceValueMergeMethod.optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.ILooseResourceDecl | loose resource declaration}.\n * @public\n */\nexport const looseResourceDecl: Converter<Normalized.ILooseResourceDecl> =\n Converters.strictObject<Normalized.ILooseResourceDecl>({\n id: CommonConvert.resourceId,\n resourceTypeName: CommonConvert.resourceTypeName,\n candidates: Converters.arrayOf(childResourceCandidateDecl).optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IChildResourceDecl | child resource declaration}.\n * @public\n */\nexport const childResourceDecl: Converter<Normalized.IChildResourceDecl> =\n Converters.strictObject<Normalized.IChildResourceDecl>({\n resourceTypeName: CommonConvert.resourceTypeName,\n candidates: Converters.arrayOf(childResourceCandidateDecl).optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IContainerContextDecl | resource context declaration}.\n * @public\n */\nexport const containerContextDecl: Converter<Normalized.IContainerContextDecl> =\n Converters.strictObject<Normalized.IContainerContextDecl>({\n baseId: Converters.oneOf([CommonConvert.resourceId, Converters.literal('')]).optional(),\n conditions: conditionSetDecl.optional(),\n mergeMethod: CommonConvert.resourceValueMergeMethod.optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IResourceTreeChildNodeDecl | resource tree child node declaration}.\n * @public\n */\nexport const resourceTreeChildNodeDecl: Converter<Normalized.IResourceTreeChildNodeDecl> = Converters.generic<\n Normalized.IResourceTreeChildNodeDecl,\n unknown\n>(\n (\n from: unknown,\n self: Converter<Normalized.IResourceTreeChildNodeDecl, unknown>,\n context?: unknown\n ): Result<Normalized.IResourceTreeChildNodeDecl> => {\n return Converters.strictObject<Normalized.IResourceTreeChildNodeDecl>({\n resources: Converters.recordOf(childResourceDecl).optional(),\n children: Converters.recordOf(self).optional()\n }).convert(from, context);\n }\n);\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IResourceTreeRootDecl | resource tree root declaration}.\n * @public\n */\nexport const resourceTreeRootDecl: Converter<Normalized.IResourceTreeRootDecl> =\n Converters.strictObject<Normalized.IResourceTreeRootDecl>({\n context: containerContextDecl.optional(),\n resources: Converters.recordOf(childResourceDecl).optional(),\n children: Converters.recordOf(resourceTreeChildNodeDecl).optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IResourceCollectionDecl | resource collection declaration}.\n * @public\n */\nexport const resourceCollectionDecl: Converter<Normalized.IResourceCollectionDecl> = Converters.generic<\n Normalized.IResourceCollectionDecl,\n unknown\n>(\n (\n from: unknown,\n self: Converter<Normalized.IResourceCollectionDecl, unknown>,\n context?: unknown\n ): Result<Normalized.IResourceCollectionDecl> => {\n return Converters.strictObject<Normalized.IResourceCollectionDecl>({\n context: containerContextDecl.optional(),\n candidates: Converters.arrayOf(looseResourceCandidateDecl).optional(),\n resources: Converters.arrayOf(looseResourceDecl).optional(),\n collections: Converters.arrayOf(self).optional(),\n metadata: JsonConverters.jsonObject.optional()\n }).convert(from, context);\n }\n);\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IImporterResourceCollectionDecl | importer resource collection declaration}.\n * This allows for a mix of loose and child resource declarations.\n * @public\n */\nexport const importerResourceCollectionDecl: Converter<Normalized.IImporterResourceCollectionDecl> =\n Converters.generic<Normalized.IImporterResourceCollectionDecl, unknown>(\n (\n from: unknown,\n self: Converter<Normalized.IImporterResourceCollectionDecl, unknown>,\n context?: unknown\n ): Result<Normalized.IImporterResourceCollectionDecl> => {\n return Converters.strictObject<Normalized.IImporterResourceCollectionDecl>({\n context: containerContextDecl.optional(),\n candidates: Converters.arrayOf(importerResourceCandidateDecl).optional(),\n resources: Converters.arrayOf(Converters.oneOf([looseResourceDecl, childResourceDecl])).optional(),\n collections: Converters.arrayOf(self).optional(),\n metadata: JsonConverters.jsonObject.optional()\n }).convert(from, context);\n }\n );\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/helpers.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAc,MAAM,EAAiB,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAI/B;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,CAAC,EAAE,UAAU,CAAC,qBAAqB,EACvC,UAAU,CAAC,EAAE,MAAM,EACnB,gBAAgB,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,mBAAmB,CAAC,GACzD,MAAM,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAsB1C;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,UAAU,CAAC,8BAA8B,EACpD,QAAQ,CAAC,EAAE,MAAM,EACjB,cAAc,CAAC,EAAE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;AACL,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { mapResults, Result, fail, succeed } from '@fgv/ts-utils';\nimport * as Normalized from './normalized';\nimport * as Json from './json';\nimport { Helpers as CommonHelpers } from '../common';\nimport { sanitizeJsonObject } from '@fgv/ts-json-base';\n\n/**\n * Common options when creating or displaying declarations.\n * @public\n */\nexport interface IDeclarationOptions {\n /**\n * If `true`, properties with default values will be included in the\n * output. If omitted or `false`, properties with default values will be omitted.\n */\n showDefaults?: boolean;\n\n /**\n * If `true`, the output will be normalized using hash-based ordering for consistent structure.\n * If omitted or `false`, no normalization will be applied. Defaults to `false`.\n */\n normalized?: boolean;\n}\n\n/**\n * Helper method to merge a resource context declaration with a parent name and conditions.\n * @param decl - The resource context declaration to merge.\n * @param parentName - The name of the parent resource.\n * @param parentConditions - The conditions of the parent resource.\n * @returns `Success` with the merged resource context declaration if successful, otherwise `Failure`.\n * @public\n */\nexport function mergeContextDecl(\n decl?: Normalized.IContainerContextDecl,\n parentName?: string,\n parentConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n): Result<Normalized.IContainerContextDecl> {\n if (!decl) {\n return sanitizeJsonObject({ baseId: parentName, conditions: parentConditions });\n } else if (!parentName && !parentConditions) {\n return succeed(decl);\n }\n switch (decl.mergeMethod ?? 'augment') {\n case 'augment':\n return CommonHelpers.joinResourceIds(parentName, decl.baseId).onSuccess((baseId) => {\n /* c8 ignore next 1 - defense in depth */\n const conditions = [...(parentConditions ?? []), ...(decl.conditions ?? [])];\n return sanitizeJsonObject({ baseId, conditions });\n });\n case 'replace': {\n const baseId = decl.baseId ?? parentName;\n const conditions = decl.conditions ?? parentConditions;\n return sanitizeJsonObject({ baseId, conditions });\n }\n case 'delete': {\n return sanitizeJsonObject({});\n }\n }\n}\n\n/**\n * Helper method to merge a loose candidate with a base name and conditions.\n * @param candidate - The candidate to merge.\n * @param baseName - The base name to merge with the candidate.\n * @param baseConditions - The base conditions to merge with the candidate.\n * @returns `Success` with the merged candidate if successful, otherwise `Failure`.\n * @public\n */\nexport function mergeLooseCandidate(\n candidate: Normalized.IImporterResourceCandidateDecl,\n baseName?: string,\n baseConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n): Result<Normalized.ILooseResourceCandidateDecl> {\n const candidateId = Json.isLooseResourceCandidateDecl(candidate) ? candidate.id : '';\n if (!Json.isLooseResourceCandidateDecl(candidate) && !baseName) {\n return fail('id is required in mergeLooseCandidate');\n }\n\n return CommonHelpers.joinResourceIds(baseName, candidateId).onSuccess((id) => {\n /* c8 ignore next 1 - defense in depth */\n const conditions = [...(baseConditions ?? []), ...(candidate.conditions ?? [])];\n return succeed({ ...candidate, id, conditions });\n });\n}\n\n/**\n * Helper method to merge a resource candidate with a base name and conditions from import context.\n * This function enables name inheritance for resource candidates, similar to resources.\n *\n * @param candidate - The candidate to merge. Can have an optional ID that will be joined with baseName.\n * @param baseName - The base name from import context to merge with the candidate.\n * When provided, this will be used as the parent component of the candidate ID.\n * @param baseConditions - The base conditions from import context to merge with the candidate's conditions.\n * @returns `Success` with the merged candidate if successful, otherwise `Failure`.\n *\n * @remarks\n * This function supports name inheritance for candidates:\n * - Joins baseName with candidate's existing ID using dot notation\n * - If candidate has no ID, uses baseName as the full ID\n * - Always merges base conditions with candidate's existing conditions\n *\n * @example\n * ```typescript\n * // Candidate inherits full name from import context\n * const candidate = { value: \"Hello\", conditions: [...] }; // No id field\n * const result = mergeImporterCandidate(candidate, \"pages.home.greeting\", []);\n * // Result: { id: \"pages.home.greeting\", value: \"Hello\", conditions: [...] }\n * ```\n *\n * @public\n */\nexport function mergeImporterCandidate(\n candidate: Normalized.IImporterResourceCandidateDecl,\n baseName?: string,\n baseConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n): Result<Normalized.IImporterResourceCandidateDecl> {\n if (baseName || Json.isLooseResourceCandidateDecl(candidate)) {\n const candidateId = 'id' in candidate ? candidate.id : '';\n return CommonHelpers.joinResourceIds(baseName, candidateId).onSuccess((id) => {\n /* c8 ignore next 1 - defense in depth */\n const conditions = [...(baseConditions ?? []), ...(candidate.conditions ?? [])];\n return succeed({ ...candidate, id, conditions });\n });\n } else {\n /* c8 ignore next 1 - defense in depth */\n const conditions = [...(baseConditions ?? []), ...(candidate.conditions ?? [])];\n return succeed({ ...candidate, conditions });\n }\n}\n\n/**\n * Helper method to merge a child candidate with base conditions.\n * @param candidate - The candidate to merge.\n * @param baseConditions - The base conditions to merge with the candidate.\n * @returns `Success` with the merged candidate if successful, otherwise `Failure`.\n * @public\n */\nexport function mergeChildCandidate(\n candidate: Normalized.IChildResourceCandidateDecl,\n baseConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n): Result<Normalized.IChildResourceCandidateDecl> {\n /* c8 ignore next 1 - defense in depth */\n const conditions = [...(baseConditions ?? []), ...(candidate.conditions ?? [])];\n return succeed({ ...candidate, conditions });\n}\n\n/**\n * Helper method to merge a loose resource with a base name and conditions.\n * @param resource - The resource to merge.\n * @param baseName - The base name to merge with the resource.\n * @param baseConditions - The base conditions to merge with the resource.\n * @returns `Success` with the merged resource if successful, otherwise `Failure`.\n * @public\n */\nexport function mergeLooseResource(\n resource: Normalized.IImporterResourceDecl,\n baseName?: string,\n baseConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n): Result<Normalized.ILooseResourceDecl> {\n /* c8 ignore next 1 - defense in depth */\n const resourceId = Json.isLooseResourceDecl(resource) ? resource.id : '';\n if (!baseName && !Json.isLooseResourceDecl(resource)) {\n return fail('id is required in mergeLooseResource');\n }\n\n return CommonHelpers.joinResourceIds(baseName, resourceId).onSuccess((id) => {\n return mapResults(\n /* c8 ignore next 1 - defense in depth */\n (resource.candidates ?? []).map((candidate) => mergeChildCandidate(candidate, baseConditions))\n ).onSuccess((candidates) => {\n return succeed({ ...resource, id, candidates });\n });\n });\n}\n\n/**\n * Helper method to merge a resource with a base name and conditions from import context.\n * This function enables name inheritance where resources can automatically inherit their\n * resource ID from the import context when no explicit ID is provided in the resource declaration.\n *\n * @param resource - The resource to merge. Can be either a loose resource (with optional ID)\n * or a child resource (without ID).\n * @param baseName - The base name from import context to merge with the resource.\n * When provided, this will be used as the parent component of the resource ID.\n * @param baseConditions - The base conditions from import context to merge with the resource's conditions.\n * @returns `Success` with the merged resource if successful, otherwise `Failure`.\n *\n * @remarks\n * This function supports several scenarios for name inheritance:\n * - **Explicit ID + Base Name**: Joins baseName.resourceId (e.g., \"pages.home\" + \"greeting\" = \"pages.home.greeting\")\n * - **No ID + Base Name**: Uses baseName as the resource ID (enables name inheritance from import context)\n * - **Explicit ID + No Base Name**: Uses the resource's existing ID\n * - **No ID + No Base Name**: Returns resource without ID (for child resources)\n *\n * Base conditions are always merged with the resource's existing conditions.\n *\n * @example\n * ```typescript\n * // Resource without ID inherits name from import context\n * const resource = { candidates: [...] }; // No id field\n * const result = mergeImporterResource(resource, \"pages.home\", []);\n * // Result: { id: \"pages.home\", candidates: [...] }\n *\n * // Resource with ID gets joined with base name\n * const resource = { id: \"greeting\", candidates: [...] };\n * const result = mergeImporterResource(resource, \"pages.home\", []);\n * // Result: { id: \"pages.home.greeting\", candidates: [...] }\n * ```\n *\n * @public\n */\nexport function mergeImporterResource(\n resource: Normalized.IImporterResourceDecl,\n baseName?: string,\n baseConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n): Result<Normalized.IImporterResourceDecl> {\n if (baseName || `id` in resource) {\n const resourceId = 'id' in resource ? resource.id : '';\n // If we have a base name or the resource has no id, we can just\n return CommonHelpers.joinResourceIds(baseName, resourceId).onSuccess((id) => {\n return mapResults(\n /* c8 ignore next 1 - defense in depth */\n (resource.candidates ?? []).map((candidate) => mergeChildCandidate(candidate, baseConditions))\n ).onSuccess((candidates) => {\n return succeed({ ...resource, id, candidates });\n });\n });\n } else {\n return mapResults(\n /* c8 ignore next 1 - defense in depth */\n (resource.candidates ?? []).map((candidate) => mergeChildCandidate(candidate, baseConditions))\n ).onSuccess((candidates) => {\n return succeed({ ...resource, candidates });\n });\n }\n}\n\n/**\n * Helper method to merge a child resource with a parent name and conditions.\n * @param resource - The resource to merge.\n * @param name - The name of the resource.\n *\n * @param parentName - The name of the parent resource.\n * @param parentConditions - The conditions of the parent resource.\n * @returns `Success` with the merged resource if successful, otherwise `Failure`.\n * @public\n */\nexport function mergeChildResource(\n resource: Normalized.IChildResourceDecl,\n name: string,\n parentName?: string,\n parentConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n): Result<Normalized.ILooseResourceDecl> {\n return CommonHelpers.joinResourceIds(parentName, name).onSuccess((id) => {\n return mapResults(\n /* c8 ignore next 1 - defense in depth */\n (resource.candidates ?? []).map((candidate) => mergeChildCandidate(candidate, parentConditions))\n ).onSuccess((candidates) => {\n return succeed({ ...resource, id, candidates });\n });\n });\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;AAExD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,qDAAuC;AAM9B,4BAAQ;AALjB,mDAAqC;AAKlB,0BAAO;AAJ1B,mDAAqC;AAIT,0BAAO;AAHnC,6CAA+B;AAGM,oBAAI;AAFzC,yDAA2C;AAEA,gCAAU;AAErD,0DAAwC;AACxC,2DAAyC;AACzC,qDAAmC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Compiled from './compiled';\nimport * as Convert from './convert';\nimport * as Helpers from './helpers';\nimport * as Json from './json';\nimport * as Normalized from './normalized';\n\nexport { Compiled, Convert, Helpers, Json, Normalized };\n\nexport * from './resourceDeclContainer';\nexport * from './resourceDeclCollection';\nexport * from './resourceDeclTree';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/json.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAExE;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,aAAa,CAAC,mBAAmB,CAAC,CAAC;AAEzE;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE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AE,aAAa,CAAC,uBAAuB,CAAC,CAAC;IAC9D,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;AAE5E;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,OAAO,CAAC,EAAE,qBAAqB,CAAC;IACzC,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,8BAA8B,CAAC,CAAC;IACpE,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAC1D,QAAQ,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC,+BAA+B,CAAC,CAAC;IACtE,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;CAChC;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,8BAA8B,GACnC,IAAI,IAAI,2BAA2B,CAErC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,IAAI,kBAAkB,CAE3F"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"json.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/json.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAsQH,oEAIC;AAMD,kDAEC;AAhBD;;;GAGG;AACH,SAAgB,4BAA4B,CAC1C,IAAoC;IAEpC,OAAO,IAAI,IAAI,IAAI,CAAC;AACtB,CAAC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,IAA2B;IAC7D,OAAO,IAAI,IAAI,IAAI,CAAC;AACtB,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { JsonObject } from '@fgv/ts-json-base';\nimport { ConditionOperator, ResourceValueMergeMethod } from '../common';\n\n/**\n * Non-validated loose declaration of a {@link Conditions.Condition | condition}.\n * @public\n */\nexport interface ILooseConditionDecl {\n /**\n * The name of the {@link Qualifiers.Qualifier | qualifier} to be compared.\n */\n qualifierName: string;\n /**\n * The value to be compared.\n */\n value: string;\n /**\n * The operator to be used in the comparison.\n * Default is 'matches'.\n */\n operator?: ConditionOperator;\n\n /**\n * The priority of the condition. Default is the default priority for the qualifier.\n */\n priority?: number;\n\n /**\n * The score to be used if the condition is used as a default.\n */\n scoreAsDefault?: number;\n}\n\n/**\n * Non-validated child declaration of a {@link Conditions.Condition | condition}.\n * @public\n */\nexport interface IChildConditionDecl {\n /**\n * The value to be compared.\n */\n value: string;\n /**\n * The operator to be used in the comparison.\n * Default is 'matches'.\n */\n operator?: ConditionOperator;\n\n /**\n * The priority of the condition. Default is the default priority for the qualifier.\n */\n priority?: number;\n\n /**\n * The score to be used if the condition is used as a default.\n */\n scoreAsDefault?: number;\n}\n\n/**\n * Non-validated declaration of a {@link Conditions.Condition | condition}.\n * @public\n */\nexport type ConditionSetDeclAsArray = ReadonlyArray<ILooseConditionDecl>;\n\n/**\n * Non-validated declaration of a {@link Conditions.Condition | condition}.\n * @public\n */\nexport type ConditionSetDeclAsRecord = Record<string, string | IChildConditionDecl>;\n\n/**\n * Non-validated declaration of a {@link Conditions.Condition | condition}.\n * @public\n */\nexport type ConditionSetDecl = ConditionSetDeclAsArray | ConditionSetDeclAsRecord;\n\n/**\n * Non-validated child declaration of a {@link Resources.ResourceCandidate | resource candidate}.\n * @public\n */\nexport interface IChildResourceCandidateDecl {\n /**\n * The JSON value of the resource.\n */\n readonly json: JsonObject;\n\n /**\n * The conditions that must be met for the resource to be selected.\n */\n readonly conditions?: ConditionSetDecl;\n\n /**\n * If true, the resource is only a partial representation of the full resource.\n */\n readonly isPartial?: boolean;\n\n /**\n * The merge method to be used when merging the resource into the existing resource.\n * default is 'augment'.\n */\n readonly mergeMethod?: ResourceValueMergeMethod;\n}\n\n/**\n * Non-validated declaration of a resource candidate for import,\n * which can be either a loose or child resource candidate.\n * @public\n */\nexport interface IImporterResourceCandidateDecl extends IChildResourceCandidateDecl {\n /**\n * The {@link ResourceId | id} of the resource.\n */\n readonly id?: string;\n\n /**\n * The name of the type of this resource.\n */\n readonly resourceTypeName?: string;\n}\n\n/**\n * Non-validated loose declaration of a {@link Resources.ResourceCandidate | resource candidate}.\n * @public\n */\nexport interface ILooseResourceCandidateDecl extends IChildResourceCandidateDecl {\n /**\n * The {@link ResourceId | id} of the resource.\n */\n readonly id: string;\n\n /**\n * The JSON value of the resource.\n */\n readonly json: JsonObject;\n\n /**\n * The conditions that must be met for the resource to be selected.\n */\n readonly conditions?: ConditionSetDecl;\n\n /**\n * If true, the resource is only a partial representation of the full resource.\n */\n readonly isPartial?: boolean;\n\n /**\n * The merge method to be used when merging the resource into the existing resource.\n * default is 'augment'.\n */\n readonly mergeMethod?: ResourceValueMergeMethod;\n\n /**\n * The type of the resource.\n */\n readonly resourceTypeName?: string;\n}\n\n/**\n * Non-validated child declaration of a {@link Resources.Resource | resource}.\n * @public\n */\nexport interface IChildResourceDecl {\n /**\n * The name of the type of this resource.\n */\n readonly resourceTypeName: string;\n\n /**\n * Possible candidates for this value.\n */\n readonly candidates?: ReadonlyArray<IChildResourceCandidateDecl>;\n}\n\n/**\n * Non-validated loose declaration of a {@link Resources.Resource | resource}.\n * @public\n */\nexport interface ILooseResourceDecl extends IChildResourceDecl {\n /**\n * The id of the resource.\n */\n readonly id: string;\n\n /**\n * The name of the type of this resource.\n */\n readonly resourceTypeName: string;\n\n /**\n * Possible candidates for this value.\n */\n readonly candidates?: ReadonlyArray<IChildResourceCandidateDecl>;\n}\n\n/**\n * Normalized non-validated declaration of a {@link Resources.Resource | resource} tree node.\n * @public\n */\nexport interface IResourceTreeChildNodeDecl {\n readonly resources?: Record<string, IChildResourceDecl>;\n readonly children?: Record<string, IResourceTreeChildNodeDecl>;\n}\n\n/**\n * Declared context for a resource container.\n * @public\n */\nexport interface IContainerContextDecl {\n readonly baseId?: string;\n readonly conditions?: ConditionSetDecl;\n readonly mergeMethod?: ResourceValueMergeMethod;\n}\n\n/**\n * Normalized non-validated declaration of a {@link Resources.Resource | resource} tree root.\n * @public\n */\nexport interface IResourceTreeRootDecl extends IResourceTreeChildNodeDecl {\n readonly context?: IContainerContextDecl;\n readonly resources?: Record<string, IChildResourceDecl>;\n readonly children?: Record<string, IResourceTreeChildNodeDecl>;\n readonly metadata?: JsonObject;\n}\n\n/**\n * Non-validated declaration of a collection of resources.\n * @public\n */\nexport interface IResourceCollectionDecl {\n readonly context?: IContainerContextDecl;\n readonly candidates?: ReadonlyArray<ILooseResourceCandidateDecl>;\n readonly resources?: ReadonlyArray<ILooseResourceDecl>;\n readonly collections?: ReadonlyArray<IResourceCollectionDecl>;\n readonly metadata?: JsonObject;\n}\n\n/**\n * Non-validated declaration of a resource for import,\n * which can be either a loose or child resource.\n * @public\n */\nexport type IImporterResourceDecl = ILooseResourceDecl | IChildResourceDecl;\n\n/**\n * Non-validated declaration of a collection of resources for an importer.\n * @public\n */\nexport interface IImporterResourceCollectionDecl {\n readonly context?: IContainerContextDecl;\n readonly candidates?: ReadonlyArray<IImporterResourceCandidateDecl>;\n readonly resources?: ReadonlyArray<IImporterResourceDecl>;\n readonly collections?: ReadonlyArray<IImporterResourceCollectionDecl>;\n readonly metadata?: JsonObject;\n}\n\n/**\n * Type guard function to check if a resource candidate declaration is a loose resource candidate declaration.\n * @public\n */\nexport function isLooseResourceCandidateDecl(\n decl: IImporterResourceCandidateDecl\n): decl is ILooseResourceCandidateDecl {\n return 'id' in decl;\n}\n\n/**\n * Type guard function to check if a resource declaration is a loose resource declaration.\n * @public\n */\nexport function isLooseResourceDecl(decl: IImporterResourceDecl): decl is ILooseResourceDecl {\n return 'id' in decl;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalized.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/normalized.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC,mBAAmB,CAAC,CAAC;AAElE;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAEvC;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,wBAAwB,CAAC;CACjD;AAED;;;;GAIG;AACH,MAAM,WAAW,8BAA+B,SAAQ,2BAA2B;IACjF;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG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@ -1 +0,0 @@
1
- {"version":3,"file":"normalized.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/normalized.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { JsonObject } from '@fgv/ts-json-base';\nimport { ResourceValueMergeMethod } from '../common';\nimport { ILooseConditionDecl } from './json';\n\n/**\n * Normalized non-validated declaration of a {@link Conditions.Condition | condition}.\n * @public\n */\nexport type ConditionSetDecl = ReadonlyArray<ILooseConditionDecl>;\n\n/**\n * Normalized non-validated child declaration of a {@link Resources.ResourceCandidate | resource candidate}.\n * @public\n */\nexport interface IChildResourceCandidateDecl {\n /**\n * The JSON value of the resource.\n */\n readonly json: JsonObject;\n\n /**\n * The conditions that must be met for the resource to be selected.\n */\n readonly conditions?: ConditionSetDecl;\n\n /**\n * If true, the resource is only a partial representation of the full resource.\n */\n readonly isPartial?: boolean;\n\n /**\n * The merge method to be used when merging the resource into the existing resource.\n * default is 'augment'.\n */\n readonly mergeMethod?: ResourceValueMergeMethod;\n}\n\n/**\n * Normalized non-validated declaration of a resource candidate for import,\n * which can be either a loose or child resource candidate.\n * @public\n */\nexport interface IImporterResourceCandidateDecl extends IChildResourceCandidateDecl {\n /**\n * The {@link ResourceId | id} of the resource.\n */\n readonly id?: string;\n\n /**\n * The name of the type of this resource.\n */\n readonly resourceTypeName?: string;\n}\n\n/**\n * Normalized non-validated loose declaration of a {@link Resources.ResourceCandidate | resource candidate}.\n * @public\n */\nexport interface ILooseResourceCandidateDecl extends IChildResourceCandidateDecl {\n /**\n * The {@link ResourceId | id} of the resource.\n */\n readonly id: string;\n\n /**\n * The JSON value of the resource.\n */\n readonly json: JsonObject;\n\n /**\n * The conditions that must be met for the resource to be selected.\n */\n readonly conditions?: ConditionSetDecl;\n\n /**\n * If true, the resource is only a partial representation of the full resource.\n */\n readonly isPartial?: boolean;\n\n /**\n * The merge method to be used when merging the resource into the existing resource.\n * default is 'augment'.\n */\n readonly mergeMethod?: ResourceValueMergeMethod;\n\n /**\n * The type of the resource.\n */\n readonly resourceTypeName?: string;\n}\n\n/**\n * Normalized non-validated child declaration of a {@link Resources.Resource | resource}.\n * @public\n */\nexport interface IChildResourceDecl {\n /**\n * The name of the type of this resource.\n */\n readonly resourceTypeName: string;\n\n /**\n * Possible candidates for this value.\n */\n readonly candidates?: ReadonlyArray<IChildResourceCandidateDecl>;\n}\n\n/**\n * Normalized non-validated loose declaration of a {@link Resources.Resource | resource}.\n * @public\n */\nexport interface ILooseResourceDecl extends IChildResourceDecl {\n /**\n * The id of the resource.\n */\n readonly id: string;\n\n /**\n * The name of the type of this resource.\n */\n readonly resourceTypeName: string;\n\n /**\n * Possible candidates for this value.\n */\n readonly candidates?: ReadonlyArray<IChildResourceCandidateDecl>;\n}\n\n/**\n * Normalized non-validated declaration of a {@link Resources.Resource | resource} tree node.\n * @public\n */\nexport interface IResourceTreeChildNodeDecl {\n readonly resources?: Record<string, IChildResourceDecl>;\n readonly children?: Record<string, IResourceTreeChildNodeDecl>;\n}\n\n/**\n * Declared context for a resource container.\n * @public\n */\nexport interface IContainerContextDecl {\n readonly baseId?: string;\n readonly conditions?: ConditionSetDecl;\n readonly mergeMethod?: ResourceValueMergeMethod;\n}\n\n/**\n * Normalized non-validated declaration of a {@link Resources.Resource | resource} tree root.\n * @public\n */\nexport interface IResourceTreeRootDecl extends IResourceTreeChildNodeDecl {\n readonly context?: IContainerContextDecl;\n readonly resources?: Record<string, IChildResourceDecl>;\n readonly children?: Record<string, IResourceTreeChildNodeDecl>;\n readonly metadata?: JsonObject;\n}\n\n/**\n * Normalized non-validated declaration of a collection of resources.\n * @public\n */\nexport interface IResourceCollectionDecl {\n readonly context?: IContainerContextDecl;\n readonly candidates?: ReadonlyArray<ILooseResourceCandidateDecl>;\n readonly resources?: ReadonlyArray<ILooseResourceDecl>;\n readonly collections?: ReadonlyArray<IResourceCollectionDecl>;\n readonly metadata?: JsonObject;\n}\n\n/**\n * Normalized non-validated declaration of a resource for import,\n * which can be either a loose or child resource.\n * @public\n */\nexport type IImporterResourceDecl = ILooseResourceDecl | IChildResourceDecl;\n\n/**\n * Normalized non-validated declaration of a collection of resources for importers.\n * This allows for a mix of loose and child resource declarations.\n * @public\n */\nexport interface IImporterResourceCollectionDecl {\n readonly context?: IContainerContextDecl;\n readonly candidates?: ReadonlyArray<IImporterResourceCandidateDecl>;\n readonly resources?: ReadonlyArray<IImporterResourceDecl>;\n readonly collections?: ReadonlyArray<IImporterResourceCollectionDecl>;\n readonly metadata?: JsonObject;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceDeclCollection.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclCollection.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAgD,MAAM,EAAW,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAI3C;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,sBAAsB;IACnE;;;OAGG;IACH,SAAgB,UAAU,EAAE,UAAU,CAAC,+BAA+B,CAAC;IAEvE;;OAEG;IACH,IAAW,OAAO,IAAI,UAAU,CAAC,qBAAqB,GAAG,SAAS,CAEjE;IAED,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,qBAAqB,EAAE,CAAM;IAC9D,SAAS,CAAC,WAAW,EAAE,UAAU,CAAC,8BAA8B,EAAE,CAAM;IAExE,SAAS,aAAa,UAAU,EAAE,UAAU,CAAC,+BAA+B;IAK5E;;;;;OAKG;WACW,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,sBAAsB,CAAC;IASnE;;;;OAIG;IACI,oBAAoB,IAAI,aAAa,CAAC,UAAU,CAAC,qBAAqB,CAAC;IAI9E;;;;OAIG;IACI,qBAAqB,IAAI,aAAa,CAAC,UAAU,CAAC,8BAA8B,CAAC;IAIxF,OAAO,CAAC,QAAQ;CA2BjB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceDeclCollection.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclCollection.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAA8F;AAE9F,mDAAqC;AAGrC,uCAA4F;AAE5F;;;;GAIG;AACH,MAAa,sBAAsB;IAOjC;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;IACjC,CAAC;IAKD,YAAsB,UAAsD;QAHlE,eAAU,GAAuC,EAAE,CAAC;QACpD,gBAAW,GAAgD,EAAE,CAAC;QAGtE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,C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CAAC,QAAQ,EAAE,EAAE,CACrC,IAAA,+BAAqB,EAAC,QAAQ,EAAE,QAAQ,EAAE,cAAc,CAAC,CAC1D,mCAAI,EAAE,CAAC;YACV,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,IAAA,qBAAU,EAAC,eAAe,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;YAE1F,MAAA,UAAU,CAAC,WAAW,0CAAE,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE;gBAChD,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YAChF,CAAC,CAAC,CAAC;YACH,OAAO,MAAM,CAAC,cAAc,CAAC,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;QAC9C,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAlFD,wDAkFC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, mapResults, MessageAggregator, Result, succeed } from '@fgv/ts-utils';\nimport { IResourceDeclContainer } from './resourceDeclContainer';\nimport * as Convert from './convert';\nimport * as Normalized from './normalized';\nimport * as Json from './json';\nimport { mergeContextDecl, mergeImporterCandidate, mergeImporterResource } from './helpers';\n\n/**\n * Class that extracts resources and candidates from a\n * {@link ResourceJson.Json.IResourceCollectionDecl | resource collection declaration}.\n * @public\n */\nexport class ResourceDeclCollection implements IResourceDeclContainer {\n /**\n * The {@link ResourceJson.Normalized.IResourceCollectionDecl | resource collection declaration}\n * being processed.\n */\n public readonly collection: Normalized.IImporterResourceCollectionDecl;\n\n /**\n * {@inheritdoc ResourceJson.IResourceDeclContainer.context}\n */\n public get context(): Normalized.IContainerContextDecl | undefined {\n return this.collection.context;\n }\n\n protected _resources: Normalized.IImporterResourceDecl[] = [];\n protected _candidates: Normalized.IImporterResourceCandidateDecl[] = [];\n\n protected constructor(collection: Normalized.IImporterResourceCollectionDecl) {\n this.collection = collection;\n this._extract(collection).orThrow();\n }\n\n /**\n * Creates a new {@link ResourceJson.ResourceDeclCollection | ResourceDeclCollection} from an\n * untyped {@link ResourceJson.Json.IResourceCollectionDecl | resource collection declaration}.\n * @param from - The JSON object to convert.\n * @returns `Success` with the new collection if the JSON object is valid, otherwise `Failure`.\n */\n public static create(from: unknown): Result<ResourceDeclCollection> {\n return Convert.importerResourceCollectionDecl\n .convert(from)\n .withErrorFormat((err) => `Invalid resource collection: ${err}`)\n .onSuccess((decl) => {\n return captureResult(() => new ResourceDeclCollection(decl));\n });\n }\n\n /**\n * Gets the importer resources extracted from the collection.\n * @returns The {@link ResourceJson.Normalized.IImporterResourceDecl | importer resource declarations}\n * extracted from the collection.\n */\n public getImporterResources(): ReadonlyArray<Normalized.IImporterResourceDecl> {\n return this._resources;\n }\n\n /**\n * Gets the importer candidates extracted from the collection.\n * @returns The {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | importer resource candidate declarations}\n * extracted from the collection.\n */\n public getImporterCandidates(): ReadonlyArray<Normalized.IImporterResourceCandidateDecl> {\n return this._candidates;\n }\n\n private _extract(\n collection: Normalized.IImporterResourceCollectionDecl,\n parentName?: string,\n parentConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n ): Result<this> {\n const errors: MessageAggregator = new MessageAggregator();\n return mergeContextDecl(collection.context, parentName, parentConditions).onSuccess(\n ({ baseId: baseName, conditions: baseConditions }) => {\n const mergedCandidates =\n collection.candidates?.map((candidate) =>\n mergeImporterCandidate(candidate, baseName, baseConditions)\n ) ?? [];\n this._candidates.push(...mapResults(mergedCandidates).aggregateError(errors).orDefault([]));\n\n const mergedResources =\n collection.resources?.map((resource) =>\n mergeImporterResource(resource, baseName, baseConditions)\n ) ?? [];\n this._resources.push(...mapResults(mergedResources).aggregateError(errors).orDefault([]));\n\n collection.collections?.forEach((subCollection) => {\n this._extract(subCollection, baseName, baseConditions).aggregateError(errors);\n });\n return errors.returnOrReport(succeed(this));\n }\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceDeclContainer.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclContainer.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAE3C;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,qBAAqB,CAAC;IAEpD;;;OAGG;IACH,oBAAoB,IAAI,aAAa,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;IAExE;;;OAGG;IACH,qBAAqB,IAAI,aAAa,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC;CACnF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceDeclContainer.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclContainer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Normalized from './normalized';\n\n/**\n * Generic container for resource and resource candidate\n * declarations.\n * @public\n */\nexport interface IResourceDeclContainer {\n /**\n * Optional initial {@link ResourceJson.Normalized.IContainerContextDecl | resource context}\n * declaration for the container.\n */\n readonly context?: Normalized.IContainerContextDecl;\n\n /**\n * Gets a normalized array of {@link ResourceJson.Normalized.IImporterResourceDecl | importer resource}\n * declarations for all resources in the container, including children.\n */\n getImporterResources(): ReadonlyArray<Normalized.IImporterResourceDecl>;\n\n /**\n * Gets a normalized array of {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | importer resource candidate}\n * declarations for all resources in the container, including children.\n */\n getImporterCandidates(): ReadonlyArray<Normalized.IImporterResourceCandidateDecl>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceDeclTree.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclTree.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAgD,MAAM,EAAW,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAK3C;;;;GAIG;AACH,qBAAa,gBAAiB,YAAW,sBAAsB;IAC7D;;;OAGG;IACH,SAAgB,IAAI,EAAE,UAAU,CAAC,qBAAqB,CAAC;IAEvD;;OAEG;IACH,IAAW,OAAO,IAAI,UAAU,CAAC,qBAAqB,GAAG,SAAS,CAEjE;IAED,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,kBAAkB,EAAE,CAAM;IAC3D,SAAS,CAAC,WAAW,EAAE,UAAU,CAAC,2BAA2B,EAAE,CAAM;IAErE,SAAS,aAAa,IAAI,EAAE,UAAU,CAAC,qBAAqB;IAO5D;;;;;OAKG;WACW,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,gBAAgB,CAAC;IAS7D;;;;OAIG;IACI,oBAAoB,IAAI,aAAa,CAAC,UAAU,CAAC,kBAAkB,CAAC;IAI3E;;;;OAIG;IACI,qBAAqB,IAAI,aAAa,CAAC,UAAU,CAAC,2BAA2B,CAAC;IAIrF,OAAO,CAAC,QAAQ;CAuBjB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceDeclTree.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclTree.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAA8F;AAE9F,mDAAqC;AAGrC,sCAAqD;AACrD,uCAA+C;AAE/C;;;;GAIG;AACH,MAAa,gBAAgB;IAO3B;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC3B,CAAC;IAKD,YAAsB,IAAsC;;QAHlD,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,EAAE,UAAU,EAAE,gBAAgB,CAAC,CACjE,CAAC;QACF,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,IAAA,qBAAU,EAAC,eAAe,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QAE1F,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAA,IAAI,CAAC,QAAQ,mCAAI,EAAE,CAAC,CAAC,CAAC;QACjE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE;YACrC,gBAAa,CAAC,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC;iBAC5C,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE;gBACvB,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YACtF,CAAC,CAAC;iBACD,cAAc,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,cAAc,CAAC,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF;AAhFD,4CAgFC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, mapResults, MessageAggregator, Result, succeed } from '@fgv/ts-utils';\nimport { IResourceDeclContainer } from './resourceDeclContainer';\nimport * as Convert from './convert';\nimport * as Normalized from './normalized';\nimport * as Json from './json';\nimport { Helpers as CommonHelpers } from '../common';\nimport { mergeChildResource } from './helpers';\n\n/**\n * Class that extracts resources and candidates from a\n * {@link ResourceJson.Json.IResourceTreeRootDecl | resource tree root}.\n * @public\n */\nexport class ResourceDeclTree implements IResourceDeclContainer {\n /**\n * The {@link ResourceJson.Normalized.IResourceTreeRootDecl | resource tree root declaration}\n * being processed.\n */\n public readonly tree: Normalized.IResourceTreeRootDecl;\n\n /**\n * {@inheritdoc ResourceJson.IResourceDeclContainer.context}\n */\n public get context(): Normalized.IContainerContextDecl | undefined {\n return this.tree.context;\n }\n\n protected _resources: Normalized.ILooseResourceDecl[] = [];\n protected _candidates: Normalized.ILooseResourceCandidateDecl[] = [];\n\n protected constructor(tree: Normalized.IResourceTreeRootDecl) {\n this.tree = tree;\n const id = tree.context?.baseId;\n const conditions = tree.context?.conditions;\n this._extract(tree, id, conditions).orThrow();\n }\n\n /**\n * Creates a new {@link ResourceJson.ResourceDeclTree | ResourceDeclTree} from an\n * untyped {@link ResourceJson.Json.IResourceTreeRootDecl | resource tree root declaration}.\n * @param from - The JSON object to convert.\n * @returns `Success` with the new tree if the JSON object is valid, otherwise `Failure`.\n */\n public static create(from: unknown): Result<ResourceDeclTree> {\n return Convert.resourceTreeRootDecl\n .convert(from)\n .withErrorFormat((err) => `Invalid resource tree: ${err}`)\n .onSuccess((decl) => {\n return captureResult(() => new ResourceDeclTree(decl));\n });\n }\n\n /**\n * Gets the loose resources extracted from the collection.\n * @returns The {@link ResourceJson.Normalized.ILooseResourceDecl | loose resource declarations}\n * extracted from the collection.\n */\n public getImporterResources(): ReadonlyArray<Normalized.ILooseResourceDecl> {\n return this._resources;\n }\n\n /**\n * Gets the loose candidates extracted from the collection.\n * @returns The {@link ResourceJson.Normalized.ILooseResourceCandidateDecl | loose resource candidate declarations}\n * extracted from the collection.\n */\n public getImporterCandidates(): ReadonlyArray<Normalized.ILooseResourceCandidateDecl> {\n return this._candidates;\n }\n\n private _extract(\n node: Normalized.IResourceTreeChildNodeDecl,\n parentName?: string,\n parentConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n ): Result<this> {\n const errors: MessageAggregator = new MessageAggregator();\n\n const resourceEntries = Array.from(Object.entries(node.resources ?? {}));\n const mergedResources = resourceEntries.map(([name, resource]) =>\n mergeChildResource(resource, name, parentName, parentConditions)\n );\n this._resources.push(...mapResults(mergedResources).aggregateError(errors).orDefault([]));\n\n const children = Array.from(Object.entries(node.children ?? {}));\n children.forEach(([name, childNode]) => {\n CommonHelpers.joinResourceIds(parentName, name)\n .onSuccess((childName) => {\n return this._extract(childNode, childName, parentConditions).aggregateError(errors);\n })\n .aggregateError(errors);\n });\n return errors.returnOrReport(succeed(this));\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../../src/packlets/resource-types/config/convert.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,uEAG7B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../../src/packlets/resource-types/config/convert.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,2CAA2C;AAE3C,4CAA2C;AAG3C;;;;GAIG;AACU,QAAA,kBAAkB,GAAG,qBAAU,CAAC,YAAY,CAAsB;IAC7E,IAAI,EAAE,qBAAU,CAAC,MAAM;IACvB,QAAQ,EAAE,qBAAU,CAAC,MAAM;CAC5B,CAAC,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/* eslint-disable @rushstack/typedef-var */\n\nimport { Converters } from '@fgv/ts-utils';\nimport { IResourceTypeConfig } from './json';\n\n/**\n * A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.\n * @returns A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.\n * @public\n */\nexport const resourceTypeConfig = Converters.strictObject<IResourceTypeConfig>({\n name: Converters.string,\n typeName: Converters.string\n});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/resource-types/config/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,cAAc,QAAQ,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/resource-types/config/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AAI5B,0BAAO;AAFhB,yCAAuB","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Convert from './convert';\n\nexport * from './json';\n\nexport { Convert };\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../../src/packlets/resource-types/config/json.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"json.js","sourceRoot":"","sources":["../../../../src/packlets/resource-types/config/json.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * Configuration for a {@link ResourceTypes.ResourceType | resource type}.\n * @public\n */\nexport interface IResourceTypeConfig {\n name: string;\n typeName: string;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-types/helpers.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAQ,MAAM,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAAC,YAAY,CAAC,CAO9F"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/packlets/resource-types/helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAgBH,oEAOC;AArBD,4CAA6C;AAG7C,yDAAsD;AACtD,sCAAwD;AAExD;;;;;;;GAOG;AACH,SAAgB,4BAA4B,CAAC,MAA2B;IACtE,IAAI,MAAM,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;QAC/B,OAAO,gBAAgB,CAAC,gBAAgB;aACrC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;aACpB,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,mCAAgB,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,IAAA,eAAI,EAAC,GAAG,MAAM,CAAC,QAAQ,0BAA0B,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { fail, Result } from '@fgv/ts-utils';\nimport { IResourceTypeConfig } from './config';\nimport { ResourceType } from './resourceType';\nimport { JsonResourceType } from './jsonResourceType';\nimport { Convert as CommonConverters } from '../common';\n\n/**\n * Creates a {@link ResourceTypes.ResourceType | ResourceType} from a configuration object.\n * @param config - The {@link ResourceTypes.Config.IResourceTypeConfig | configuration object}\n * containing the name and type name of the resource type.\n * @returns `Success` with the new {@link ResourceTypes.ResourceType | ResourceType}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\nexport function createResourceTypeFromConfig(config: IResourceTypeConfig): Result<ResourceType> {\n if (config.typeName === 'json') {\n return CommonConverters.resourceTypeName\n .convert(config.name)\n .onSuccess((key) => JsonResourceType.create({ key }));\n }\n return fail(`${config.typeName}: Unknown resource type.`);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-types/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/resource-types/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iDAAmC;AAO1B,wBAAM;AALf,iDAA+B;AAC/B,0DAAwC;AACxC,qDAAmC;AACnC,4CAA0B","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Config from './config';\n\nexport * from './resourceType';\nexport * from './resourceTypeCollector';\nexport * from './jsonResourceType';\nexport * from './helpers';\n\nexport { Config };\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsonResourceType.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-types/jsonResourceType.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAgC,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,sCAAsC,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAW,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7E,OAAO,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,YAAY,CAAC,UAAU,CAAC;IAC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CAAC,GAAG,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IAEI,mBAAmB,CAAC,KAA6C;QACtE,OAAO,yBAAc,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;IAcM,QAAQ,CAAC,IAAgB,EAAE,cAAsC;QACtE,OAAO,yBAAc,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;CACF;AA9CD,4CA8CC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Converters as JsonConverters, JsonObject } from '@fgv/ts-json-base';\nimport { IResourceCandidateValidationProperties, ResourceType } from './resourceType';\nimport { CandidateCompleteness, Convert, ResourceTypeName } from '../common';\nimport { captureResult, Result } from '@fgv/ts-utils';\n\n/**\n * Parameters to create a {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.\n * @public\n */\nexport interface IJsonResourceTypeCreateParams {\n /**\n * Optional key for the new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.\n * Defaults to 'json'.\n */\n key?: string;\n\n /**\n * Optional index for the new {@link ResourceTypes.JsonResourceType | JsonResourceType}\n * instance.\n */\n index?: number;\n}\n\n/**\n * Implementation of a {@link ResourceTypes.ResourceType | ResourceType} for JSON values.\n * @public\n */\nexport class JsonResourceType extends ResourceType<JsonObject> {\n /**\n * Protected {@link ResourceTypes.JsonResourceType | JsonResourceType} constructor for use by subclasses.\n * Use {@link ResourceTypes.JsonResourceType.create | JsonResourceType.create} to create a new instance.\n * @param key - The key for the new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.\n * @param index - Optional index for the new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.\n */\n protected constructor(key: ResourceTypeName, index?: number) {\n super(key, index);\n }\n\n /**\n * Factory method to create a new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.\n * @param params - {@link ResourceTypes.IJsonResourceTypeCreateParams | Parameters} to create the new instance.\n * @returns `Success` with the new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance if successful\n * or `Failure` with an error message if not.\n */\n public static create(params?: IJsonResourceTypeCreateParams): Result<JsonResourceType> {\n return Convert.resourceTypeName.convert(params?.key ?? 'json').onSuccess((key) => {\n return captureResult(() => new JsonResourceType(key, params?.index));\n });\n }\n\n /**\n * {@inheritdoc ResourceTypes.ResourceType.validateDeclaration}\n */\n\n public validateDeclaration(props: IResourceCandidateValidationProperties): Result<JsonObject> {\n return JsonConverters.jsonObject.convert(props.json);\n }\n\n /**\n * {@inheritdoc ResourceTypes.ResourceType.(validate:1)}\n */\n public validate(json: JsonObject, completeness: CandidateCompleteness): Result<JsonObject>;\n /**\n * {@inheritdoc ResourceTypes.ResourceType.(validate:2)}\n */\n public validate(json: JsonObject, completeness: 'full'): Result<JsonObject>;\n /**\n * {@inheritdoc ResourceTypes.ResourceType.(validate:3)}\n */\n public validate(json: JsonObject, completeness: 'partial'): Result<JsonObject>;\n public validate(json: JsonObject, __completeness?: CandidateCompleteness): Result<JsonObject> {\n return JsonConverters.jsonObject.convert(json);\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceType.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-types/resourceType.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAe,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EACL,qBAAqB,EAGrB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,UAAU,EACX,MAAM,WAAW,CAAC;AAEnB;;;GAGG;AACH,MAAM,WAAW,sCAAsC;IACrD;;;OAGG;IACH,EAAE,EAAE,UAAU,CAAC;IAEf;;;OAGG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,IAAI,EAAE,SAAS,CAAC;IAEhB;;;OAGG;IACH,WAAW,EAAE,wBAAwB,CAAC;CACvC;AAED;;;;;GAKG;AACH,8BAAsB,YAAY,CAAC,CAAC,GAAG,OAAO,CAAE,YAAW,YAAY,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;IAC1G,OAAO,CAAC,YAAY,CAA+D;IACnF;;OAEG;IACH,IAAW,GAAG,IAAI,gBAAgB,CAEjC;IAED;;OAEG;IACH,IAAW,KAAK,IAAI,iBAAiB,GAAG,SAAS,CAEhD;IAED,SAAS,aAAa,GAAG,EAAE,gBAAgB,EAAE,KAAK,CAAC,EAAE,MAAM;IAS3D;;;;;;;OAOG;aACa,mBAAmB,CAAC,KAAK,EAAE,sCAAsC,GAAG,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAE1G;;;;;;;OAOG;aACa,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,qBAAqB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AAC;IAoDD;;OAEG;IACI,QAAQ,CAAC,KAAa;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;CACF;AAjFD,oCAiFC","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 { JsonValue } from '@fgv/ts-json-base';\nimport { Collections, ICollectible, Result } from '@fgv/ts-utils';\nimport {\n CandidateCompleteness,\n Convert as CommonConvert,\n Validate,\n ResourceTypeIndex,\n ResourceTypeName,\n ResourceValueMergeMethod,\n ResourceId\n} from '../common';\n\n/**\n * Parameters used to validate a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration}.\n * @public\n */\nexport interface IResourceCandidateValidationProperties {\n /**\n * {@inheritdoc ResourceJson.Json.ILooseResourceCandidateDecl.id}\n * @public\n */\n id: ResourceId;\n\n /**\n * {@inheritdoc ResourceJson.Json.ILooseResourceCandidateDecl.isPartial}\n * @public\n */\n isPartial: boolean;\n\n /**\n * {@inheritdoc ResourceJson.Json.ILooseResourceCandidateDecl.json}\n * @public\n */\n json: JsonValue;\n\n /**\n * {@inheritdoc ResourceJson.Json.ILooseResourceCandidateDecl.mergeMethod}\n * @public\n */\n mergeMethod: ResourceValueMergeMethod;\n}\n\n/**\n * Abstract base class for resource types which are responsible for\n * validating and converting JSON values into the appropriate strongly-typed\n * resource value.\n * @public\n */\nexport abstract class ResourceType<T = unknown> implements ICollectible<ResourceTypeName, ResourceTypeIndex> {\n private _collectible: Collections.Collectible<ResourceTypeName, ResourceTypeIndex>;\n /**\n * The key for this resource type.\n */\n public get key(): ResourceTypeName {\n return this._collectible.key;\n }\n\n /**\n * The index for this resource type.\n */\n public get index(): ResourceTypeIndex | undefined {\n return this._collectible.index;\n }\n\n protected constructor(key: ResourceTypeName, index?: number) {\n this._collectible = new Collections.Collectible<ResourceTypeName, ResourceTypeIndex>({\n key,\n /* c8 ignore next 1 - coverage having a rough time */\n index: index !== undefined ? Validate.toResourceTypeIndex(index).orThrow() : undefined,\n indexConverter: CommonConvert.resourceTypeIndex\n });\n }\n\n /**\n * Validates properties of a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration} for\n * a resource instance value.\n * @param props - The {@link ResourceTypes.IResourceCandidateValidationProperties | properties } to validate.\n * @returns `Success` with the strongly-typed resource value if the JSON and merge method\n * are valid, `Failure` with an error message otherwise.\n * @public\n */\n public abstract validateDeclaration(props: IResourceCandidateValidationProperties): Result<T | Partial<T>>;\n\n /**\n * Validates a JSON value for use as a partial resource instance value.\n * @param json - The JSON value to validate.\n * @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.\n * @returns `Success` with the strongly-typed partial resource value if the JSON is valid,\n * `Failure` with an error message otherwise.\n * @public\n */\n public abstract validate(json: JsonValue, completeness: CandidateCompleteness): Result<Partial<T>>;\n\n /**\n * Validates a JSON value for use as a complete resource instance value.\n * @param json - The JSON value to validate.\n * @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.\n * @returns `Success` with the strongly-typed resource value if the JSON is valid,\n * `Failure` with an error message otherwise.\n * @public\n */\n public abstract validate(json: JsonValue, completeness: 'full'): Result<T>;\n\n /**\n * Validates a JSON value for use as a partial resource instance value.\n * @param json - The JSON value to validate.\n * @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.\n * @returns `Success` with the strongly-typed partial resource value if the JSON is valid,\n * `Failure` with an error message otherwise.\n * @public\n */\n public abstract validate(json: JsonValue, completeness: 'partial'): Result<Partial<T>>;\n\n /**\n * Validates a JSON value for use as a full or partial resource instance value.\n * @param json - The JSON value to validate.\n * @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.\n * @returns `Success` with the strongly-typed full or partial resource value if\n * the JSON is valid, `Failure` with an error message otherwise.\n * @public\n */\n public abstract validate(json: JsonValue, completeness?: CandidateCompleteness): Result<T | Partial<T>>;\n\n /**\n * Sets the index for this resource type. Once set, the index cannot be changed.\n */\n public setIndex(index: number): Result<ResourceTypeIndex> {\n return this._collectible.setIndex(index);\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceTypeCollector.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-types/resourceTypeCollector.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAiB,mBAAmB,EAAiB,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC;AAED;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,mBAAmB,CAAC,YAAY,CAAC;IAC1E,SAAS,aAAa,EAAE,aAAa,EAAE,EAAE,8BAA8B;IAevE;;;;;OAKG;WACW,MAAM,CAAC,MAAM,CAAC,EAAE,8BAA8B,GAAG,MAAM,CAAC,qBAAqB,CAAC;IAM5F,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC;CAM/D;AAED;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG,WAAW,CAAC,4BAA4B,CAAC,YAAY,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceTypeCollector.js","sourceRoot":"","sources":["../../../src/packlets/resource-types/resourceTypeCollector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAuG;AACvG,iDAA8C;AAC9C,sCAAuE;AAUvE;;;GAGG;AACH,MAAa,qBAAsB,SAAQ,8BAAiC;IAC1E,YAAsB,EAAE,aAAa,EAAkC;QACrE,oDAAoD;QACpD,aAAa,GAAG,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,EAAE,CAAC;QAEpC,KAAK,CAAC;YACJ,UAAU,EAAE,IAAI,sBAAW,CAAC,kBAAkB,CAAiC;gBAC7E,GAAG,EAAE,gBAAa,CAAC,gBAAgB;gBACnC,KAAK,EAAE,CAAC,IAAa,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;aACrD,CAAC;SACH,CAAC,CAAC;QACH,aAAa,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE;YACrC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;QACnC,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAAC,MAAuC;QAC1D,oDAAoD;QACpD,MAAM,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAC;QACtB,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,eAAe,CAAC,IAAa;QACrC,IAAI,IAAI,YAAY,2BAAY,EAAE,CAAC;YACjC,OAAO,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC;QACvB,CAAC;QACD,OAAO,IAAA,eAAI,EAAC,sBAAsB,CAAC,CAAC;IACtC,CAAC;CACF;AAlCD,sDAkCC","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 { Collections, Result, fail, succeed, ValidatingCollector, captureResult } from '@fgv/ts-utils';\nimport { ResourceType } from './resourceType';\nimport { Convert as CommonConvert, ResourceTypeName } from '../common';\n\n/**\n * Parameters for creating a {@link ResourceTypes.ResourceTypeCollector | ResourceTypeCollector}.\n * @public\n */\nexport interface IResourceCollectorCreateParams {\n resourceTypes?: ResourceType[];\n}\n\n/**\n * Map {@link ResourceTypeName | resource type names} to {@link ResourceTypes.ResourceType | resource types}.\n * @public\n */\nexport class ResourceTypeCollector extends ValidatingCollector<ResourceType> {\n protected constructor({ resourceTypes }: IResourceCollectorCreateParams) {\n /* c8 ignore next 1 - coverage having a rough day */\n resourceTypes = resourceTypes ?? [];\n\n super({\n converters: new Collections.KeyValueConverters<ResourceTypeName, ResourceType>({\n key: CommonConvert.resourceTypeName,\n value: (from: unknown) => this._toResourceType(from)\n })\n });\n resourceTypes.forEach((resourceType) => {\n this.add(resourceType).orThrow();\n });\n }\n\n /**\n * Creates a new {@link ResourceTypes.ResourceTypeCollector | ResourceTypeCollector}.\n * @param params - Optional for creating the new collector.\n * @returns `Success` with the new instance, or `Failure` with an error\n * message if the collector could not be created.\n */\n public static create(params?: IResourceCollectorCreateParams): Result<ResourceTypeCollector> {\n /* c8 ignore next 1 - coverage having a rough day */\n params = params ?? {};\n return captureResult(() => new ResourceTypeCollector(params));\n }\n\n protected _toResourceType(from: unknown): Result<ResourceType> {\n if (from instanceof ResourceType) {\n return succeed(from);\n }\n return fail('Not a resource type.');\n }\n}\n\n/**\n * A read-only version of {@link ResourceTypes.ResourceTypeCollector | ResourceTypeCollector}.\n * @public\n */\nexport type ReadOnlyResourceTypeCollector = Collections.IReadOnlyValidatingCollector<ResourceType>;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"candidateReducer.d.ts","sourceRoot":"","sources":["../../../src/packlets/resources/candidateReducer.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,UAAU,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,MAAM,EAA6B,MAAM,eAAe,CAAC;AAElE;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,SAAS,GAAG,YAAY,CAAC;AAErE;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC9C,MAAM,EAAE,e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CACJ,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACI,eAAe,CAAC,SAA4B;;QACjD,MAAM,aAAa,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,KAAK,SAAS,CAAC,CAAC;QAChG,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,OAAO,IAAA,eAAI,EAAC,sCAAsC,CAAC,CAAC;QACtD,CAAC;QAED,IAAI,aAAa,CAAC,MAAM,KAAK,YAAY,EAAE,CAAC;YAC1C,OAAO,IAAA,kBAAO,EAAC,SAAS,CAAC,CAAC;QAC5B,CAAC;QAED,yEAAyE;QACzE,MAAM,kBAAkB,GAAG,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE;YAC5E,uCAAY,GAAG,KAAE,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,SAAS,CAAC,KAAK,IAAG;QAChE,CAAC,EAAE,EAAwC,CAAC,CAAC;QAE7C,OAAO,IAAA,kBAAO,EAAC;YACb,SAAS;YACT,UAAU,EAAE,kBAAkB;YAC9B,IAAI,EAAE,MAAA,aAAa,CAAC,IAAI,mCAAI,SAAS,CAAC,IAAI;YAC1C,SAAS,EAAE,SAAS,CAAC,SAAS;YAC9B,WAAW,EAAE,SAAS,CAAC,WAAW;SACnC,CAAC,CAAC;IACL,CAAC;CACF;AAzQD,4CAyQC","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 { QualifierName, ResourceId, ResourceValueMergeMethod } from '../common';\nimport * as Context from '../context';\nimport * as ResourceJson from '../resource-json';\nimport { ResourceCandidate } from './resourceCandidate';\nimport { JsonObject } from '@fgv/ts-json-base';\nimport { JsonEditor } from '@fgv/ts-json';\nimport { Result, succeed, fail, mapResults } from '@fgv/ts-utils';\n\n/**\n * Action taken on a candidate during reduction processing.\n * @public\n */\nexport type CandidateAction = 'unchanged' | 'reduced' | 'suppressed';\n\n/**\n * Information about a candidate being processed by the reducer.\n * @public\n */\nexport interface ICandidateInfo {\n readonly originalCandidate: ResourceCandidate;\n action: CandidateAction;\n conditions: ResourceJson.Json.ILooseConditionDecl[];\n conditionSetKey: string;\n readonly json?: JsonObject;\n}\n\n/**\n * Represents a reduced candidate after applying reduction logic.\n * @public\n */\nexport interface IReducedCandidate {\n readonly candidate: ResourceCandidate;\n readonly conditions: ResourceJson.Json.ConditionSetDecl;\n readonly json?: JsonObject;\n readonly isPartial?: boolean;\n readonly mergeMethod?: ResourceValueMergeMethod;\n}\n\n/**\n * Manages candidate reduction logic for filtering and qualifier reduction operations.\n * Encapsulates the state and logic needed to consistently process candidates for reduction.\n * @public\n */\nexport class CandidateReducer {\n private readonly _candidateInfos: ICandidateInfo[];\n private readonly _filterForContext: Context.IValidatedContextDecl;\n private readonly _qualifiersToReduce: ReadonlySet<QualifierName>;\n\n /**\n * Constructor for CandidateReducer.\n * @param candidates - The set of candidates to potentially reduce\n * @param filterForContext - Context to filter candidates against\n */\n public constructor(\n candidates: ReadonlyArray<ResourceCandidate>,\n filterForContext: Context.IValidatedContextDecl\n ) {\n this._filterForContext = filterForContext;\n\n // Use existing logic to determine reducible qualifiers\n this._qualifiersToReduce =\n ResourceCandidate.findReducibleQualifiers(candidates, filterForContext) ?? new Set();\n\n // Initialize candidate info array with initial reduction attempts\n this._candidateInfos = candidates.map((candidate): ICandidateInfo => {\n const filteredConditions = candidate.conditions.conditions.filter(\n (c) => !this._qualifiersToReduce.has(c.qualifier.name)\n );\n\n const reducedConditions = filteredConditions.map((c) => c.toLooseConditionDecl());\n const conditionSetKey = CandidateReducer._computeConditionSetKey(reducedConditions);\n\n const action: CandidateAction =\n filteredConditions.length < candidate.conditions.conditions.length ? 'reduced' : 'unchanged';\n\n return {\n originalCandidate: candidate,\n action,\n conditions: reducedConditions,\n conditionSetKey,\n json: undefined // Will be set later when needed\n };\n });\n\n // Resolve collisions by reverting reduced candidates to unchanged when they collide\n this._resolveCollisions();\n }\n\n /**\n * Computes a string key for a set of condition declarations for collision detection.\n * @param conditions - The conditions to compute a key for\n * @returns A string key representing the condition set\n */\n private static _computeConditionSetKey(conditions: ResourceJson.Json.ILooseConditionDecl[]): string {\n if (conditions.length === 0) {\n return '{}';\n }\n\n // Sort conditions by qualifier name for consistent keys\n const sortedConditions = [...conditions].sort((a, b) => a.qualifierName.localeCompare(b.qualifierName));\n const pairs = sortedConditions.map((c) => `${c.qualifierName}:${c.value}`);\n return `{${pairs.join(',')}}`;\n }\n\n /**\n * Merges a partial candidate's JSON value into a base candidate's JSON value.\n * @param baseJson - The base JSON value to merge into\n * @param partialJson - The partial JSON value to merge from\n * @returns The merged JSON value\n * @internal\n */\n private static _mergeJsonValues(baseJson: JsonObject, partialJson: JsonObject): JsonObject {\n // Create JsonEditor with array replacement behavior for candidate merging\n const editor = JsonEditor.create({\n merge: {\n arrayMergeBehavior: 'replace'\n }\n }).orThrow(); // Should never fail with valid options\n\n return editor.mergeObjectsInPlace({}, [baseJson, partialJson]).orThrow(); // Internal method should throw on error - this indicates a serious bug\n }\n\n /**\n * Resolves collisions using smart collision resolution rules.\n * - If a reduced candidate collides with an unchanged candidate and only one reduced candidate collides:\n * - If reduced candidate is complete: suppress unchanged, keep reduced\n * - If reduced candidate is partial: merge into unchanged, suppress reduced\n * - Otherwise: revert reduced candidates to unchanged to avoid collisions\n * @internal\n */\n private _resolveCollisions(): void {\n let hasCollisions = true;\n let iterationCount = 0;\n const maxIterations = this._candidateInfos.length; // Safety limit\n\n while (hasCollisions && iterationCount < maxIterations) {\n hasCollisions = false;\n iterationCount++;\n\n // Group candidates by their condition set keys (excluding suppressed)\n const conditionKeyGroups = new Map<string, ICandidateInfo[]>();\n\n for (const candidateInfo of this._candidateInfos) {\n if (candidateInfo.action !== 'suppressed') {\n // Don't include suppressed candidates\n const key = candidateInfo.conditionSetKey;\n if (!conditionKeyGroups.has(key)) {\n conditionKeyGroups.set(key, []);\n }\n conditionKeyGroups.get(key)!.push(candidateInfo);\n }\n }\n\n // Apply smart collision resolution\n for (const [, candidatesWithSameKey] of conditionKeyGroups) {\n if (candidatesWithSameKey.length > 1) {\n // Categorize candidates\n const unchangedCandidates = candidatesWithSameKey.filter((c) => c.action === 'unchanged');\n const reducedCandidates = candidatesWithSameKey.filter((c) => c.action === 'reduced');\n\n if (unchangedCandidates.length === 1 && reducedCandidates.length === 1) {\n // Simple case: one unchanged vs one reduced - apply smart resolution\n const unchangedCandidate = unchangedCandidates[0];\n const reducedCandidate = reducedCandidates[0];\n\n if (!reducedCandidate.originalCandidate.isPartial) {\n // Complete reduced candidate wins - suppress unchanged\n unchangedCandidate.action = 'suppressed';\n hasCollisions = true;\n } else {\n // Partial reduced candidate - merge into unchanged and suppress reduced\n const mergedJson = CandidateReducer._mergeJsonValues(\n unchangedCandidate.originalCandidate.json,\n reducedCandidate.originalCandidate.json\n );\n\n // Update unchanged candidate with merged JSON, keeping its isPartial status\n (unchangedCandidate as { json?: JsonObject }).json = mergedJson;\n\n // Suppress the reduced candidate\n reducedCandidate.action = 'suppressed';\n hasCollisions = true;\n }\n } else {\n // Complex collision case - revert all reduced candidates to unchanged\n for (const candidateInfo of reducedCandidates) {\n // Revert to original conditions and mark as unchanged\n const originalConditions = candidateInfo.originalCandidate.conditions.conditions.map((c) =>\n c.toLooseConditionDecl()\n );\n const originalKey = CandidateReducer._computeConditionSetKey(originalConditions);\n\n // Update the candidate info to revert to original state\n candidateInfo.action = 'unchanged';\n candidateInfo.conditions = originalConditions;\n candidateInfo.conditionSetKey = originalKey;\n\n hasCollisions = true;\n }\n }\n }\n }\n }\n }\n\n /**\n * Static convenience method to construct an array of properly reduced\n * {@link ResourceJson.Json.IChildResourceCandidateDecl | child resource candidate declarations}\n * from a set of {@link Resources.ResourceCandidate | resource candidates}.\n * @param candidates - The candidates to reduce\n * @param filterForContext - Optional context to filter against\n * @returns Result with array of reduced candidate declarations, or Failure if reduction fails\n */\n public static reduceToChildResourceCandidateDecls(\n candidates: ReadonlyArray<ResourceCandidate>,\n filterForContext?: Context.IValidatedContextDecl\n ): Result<ResourceJson.Json.IChildResourceCandidateDecl[]> {\n if (!filterForContext || Object.keys(filterForContext).length === 0) {\n return succeed(candidates.map((candidate) => candidate.toChildResourceCandidateDecl()));\n }\n\n const reducer = new CandidateReducer(candidates, filterForContext);\n const reductionResults = mapResults(candidates.map((candidate) => reducer.reduceCandidate(candidate)));\n\n return reductionResults.onSuccess((reductions) => {\n const validReductions = reductions.filter(\n (reduction): reduction is IReducedCandidate => reduction !== undefined\n );\n\n return succeed(\n validReductions.map((reduction) => ({\n /* c8 ignore next 3 -- defense in depth */\n json: reduction.json ?? reduction.candidate.json,\n isPartial: reduction.isPartial ?? reduction.candidate.isPartial,\n mergeMethod: reduction.mergeMethod ?? reduction.candidate.mergeMethod,\n conditions: reduction.conditions\n }))\n );\n });\n }\n\n /**\n * Static convenience method to construct an array of properly reduced\n * {@link ResourceJson.Json.ILooseResourceCandidateDecl | loose resource candidate declarations}\n * from a set of {@link Resources.ResourceCandidate | resource candidates}.\n * @param id - The id of the resource\n * @param candidates - The candidates to reduce\n * @param filterForContext - Optional context to filter against\n * @returns Result with array of reduced candidate declarations, or Failure if reduction fails\n */\n public static reduceToLooseResourceCandidateDecls(\n id: ResourceId,\n candidates: ReadonlyArray<ResourceCandidate>,\n filterForContext?: Context.IValidatedContextDecl\n ): Result<ResourceJson.Json.ILooseResourceCandidateDecl[]> {\n if (!filterForContext || Object.keys(filterForContext).length === 0) {\n return succeed(candidates.map((candidate) => candidate.toLooseResourceCandidateDecl()));\n }\n\n const reducer = new CandidateReducer(candidates, filterForContext);\n const reductionResults = mapResults(candidates.map((candidate) => reducer.reduceCandidate(candidate)));\n\n return reductionResults.onSuccess((reductions) => {\n const validReductions = reductions.filter(\n (reduction): reduction is IReducedCandidate => reduction !== undefined\n );\n\n return succeed(\n validReductions.map((reduction) => ({\n id,\n /* c8 ignore next 3 -- defense in depth */\n json: reduction.json ?? reduction.candidate.json,\n isPartial: reduction.isPartial ?? reduction.candidate.isPartial,\n mergeMethod: reduction.mergeMethod ?? reduction.candidate.mergeMethod,\n conditions: reduction.conditions\n }))\n );\n });\n }\n\n /**\n * Reduces a single candidate according to the configured reduction rules.\n * @param candidate - The candidate to reduce\n * @returns Either a reduced candidate declaration or an error if the candidate is not found\n */\n public reduceCandidate(candidate: ResourceCandidate): Result<IReducedCandidate | undefined> {\n const candidateInfo = this._candidateInfos.find((info) => info.originalCandidate === candidate);\n if (!candidateInfo) {\n return fail(`Candidate not found in reducer state`);\n }\n\n if (candidateInfo.action === 'suppressed') {\n return succeed(undefined);\n }\n\n // Convert array of conditions back to ConditionSetDecl for compatibility\n const conditionsAsRecord = candidateInfo.conditions.reduce((acc, condition) => {\n return { ...acc, [condition.qualifierName]: condition.value };\n }, {} as ResourceJson.Json.ConditionSetDecl);\n\n return succeed({\n candidate,\n conditions: conditionsAsRecord,\n json: candidateInfo.json ?? candidate.json,\n isPartial: candidate.isPartial,\n mergeMethod: candidate.mergeMethod\n });\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/packlets/resources/common.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,2BAA4B,SAAQ,YAAY,CAAC,OAAO,CAAC,mBAAmB;IAC3F;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;IAEzC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;GAKG;AACH,MAAM,WAAW,kCAAmC,SAAQ,YAAY,CAAC,QAAQ,CAAC,wBAAwB;IACxG;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;CAC1C;AAED;;;;GAIG;AACH,MAAM,WAAW,4BAA6B,SAAQ,2BAA2B;IAC/E;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;CACpF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/packlets/resources/common.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as ResourceJson from '../resource-json';\nimport { IValidatedContextDecl } from '../context';\n\n/**\n * Options for resource declaration operations with strongly-typed context filtering.\n * Extends the base IDeclarationOptions with proper type safety for context filtering.\n *\n * @example\n * ```typescript\n * // Preferred Result pattern with onSuccess chaining\n * resourceManager.validateContext({ language: 'en' })\n * .onSuccess((validatedContext) => {\n * return resourceManager.clone({ filterForContext: validatedContext });\n * })\n * .onSuccess((clonedManager) => {\n * return clonedManager.getResourceCollectionDecl();\n * })\n * .onFailure((error) => {\n * console.error('Failed to create filtered clone:', error);\n * });\n * ```\n * @public\n */\nexport interface IResourceDeclarationOptions extends ResourceJson.Helpers.IDeclarationOptions {\n /**\n * If provided, filters resource candidates to only include those that can match the\n * specified validated context. This provides strongly-typed context filtering.\n *\n * Use resourceManager.validateContext() to create a validated context from an IContextDecl.\n */\n filterForContext?: IValidatedContextDecl;\n\n /**\n * If true, reduces the qualifiers of the resource candidates by removing qualifiers that are made\n * irrelevant by the filterForContext.\n * @defaultValue false\n */\n reduceQualifiers?: boolean;\n\n /**\n * Whether to include metadata in compiled outputs.\n * Metadata includes human-readable information like semantic keys\n * that can be useful for debugging or tooling.\n * @defaultValue false\n */\n includeMetadata?: boolean;\n}\n\n/**\n * Extended compiled resource options that includes context filtering capabilities.\n * This interface combines the standard compilation options with strongly-typed\n * context filtering for resource candidates.\n * @public\n */\nexport interface ICompiledResourceOptionsWithFilter extends ResourceJson.Compiled.ICompiledResourceOptions {\n /**\n * If provided, filters resource candidates to only include those that can match the\n * specified validated context. This provides strongly-typed context filtering.\n *\n * Use resourceManager.validateContext() to create a validated context from an IContextDecl.\n */\n filterForContext?: IValidatedContextDecl;\n}\n\n/**\n * Options for ResourceManagerBuilder clone operations.\n * Extends IDeclarationOptions to include support for applying edits when cloning.\n * @public\n */\nexport interface IResourceManagerCloneOptions extends IResourceDeclarationOptions {\n /**\n * Optional array of loose condition declarations to be applied as edits during the clone operation.\n * These conditions can modify or extend the resource candidates in the cloned manager.\n */\n readonly candidates?: ReadonlyArray<ResourceJson.Json.ILooseResourceCandidateDecl>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/resources/index.ts"],"names":[],"mappings":"AAsBA,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,UAAU,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/resources/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,qDAAmC;AACnC,sDAAoC;AACpC,6CAA2B;AAC3B,oDAAkC;AAClC,2DAAyC;AACzC,2CAAyB","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport * from './candidateReducer';\nexport * from './resourceCandidate';\nexport * from './resource';\nexport * from './resourceBuilder';\nexport * from './resourceManagerBuilder';\nexport * from './common';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../src/packlets/resources/resource.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAqB,MAAM,EAAgC,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,UAAU,EAAY,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,2BAA2B,EAAE,kCAAkC,EAAE,MAAM,UAAU,CAAC;AAC3F,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AAEtC;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5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