@fgv/ts-res 5.0.0-2 → 5.0.0-21

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 (557) hide show
  1. package/.vscode/4.json +3 -0
  2. package/.vscode/launch.json +16 -0
  3. package/.vscode/settings.json +3 -0
  4. package/config/api-extractor.json +343 -0
  5. package/config/rig.json +16 -0
  6. package/dist/ts-res.d.ts +1528 -161
  7. package/dist/tsdoc-metadata.json +1 -1
  8. package/lib/index.d.ts +11 -2
  9. package/lib/index.js +25 -2
  10. package/lib/packlets/bundle/bundleBuilder.d.ts +41 -0
  11. package/lib/packlets/bundle/bundleBuilder.js +134 -0
  12. package/lib/packlets/bundle/bundleLoader.d.ts +72 -0
  13. package/lib/packlets/bundle/bundleLoader.js +105 -0
  14. package/lib/packlets/bundle/bundleNormalizer.d.ts +73 -0
  15. package/lib/packlets/bundle/bundleNormalizer.js +142 -0
  16. package/lib/packlets/bundle/bundleUtils.d.ts +70 -0
  17. package/lib/packlets/bundle/bundleUtils.js +117 -0
  18. package/lib/packlets/bundle/convert.d.ts +33 -0
  19. package/lib/packlets/bundle/convert.js +78 -0
  20. package/lib/packlets/bundle/index.d.ts +21 -0
  21. package/lib/packlets/bundle/index.js +83 -0
  22. package/lib/packlets/bundle/model.d.ts +100 -0
  23. package/lib/packlets/bundle/model.js +24 -0
  24. package/lib/packlets/common/helpers/resources.d.ts +7 -0
  25. package/lib/packlets/common/helpers/resources.js +12 -0
  26. package/lib/packlets/common/resources.d.ts +8 -0
  27. package/lib/packlets/conditions/conditionSet.d.ts +9 -0
  28. package/lib/packlets/conditions/conditionSet.js +74 -1
  29. package/lib/packlets/config/configInitFactory.d.ts +78 -0
  30. package/lib/packlets/config/configInitFactory.js +147 -0
  31. package/lib/packlets/config/convert.d.ts +9 -0
  32. package/lib/packlets/config/convert.js +11 -0
  33. package/lib/packlets/config/index.d.ts +1 -0
  34. package/lib/packlets/config/index.js +1 -0
  35. package/lib/packlets/config/systemConfiguration.d.ts +16 -3
  36. package/lib/packlets/config/systemConfiguration.js +19 -40
  37. package/lib/packlets/import/fsItem.js +8 -13
  38. package/lib/packlets/import/importers/jsonImporter.js +1 -0
  39. package/lib/packlets/qualifier-types/config/json.d.ts +13 -0
  40. package/lib/packlets/qualifier-types/config/json.js +11 -0
  41. package/lib/packlets/qualifier-types/literalValueHierarchy.js +1 -1
  42. package/lib/packlets/qualifiers/qualifierCollector.js +1 -2
  43. package/lib/packlets/resource-types/jsonResourceType.d.ts +9 -4
  44. package/lib/packlets/resource-types/jsonResourceType.js +8 -1
  45. package/lib/packlets/resource-types/resourceType.d.ts +102 -13
  46. package/lib/packlets/resource-types/resourceType.js +34 -2
  47. package/lib/packlets/resources/common.d.ts +26 -0
  48. package/lib/packlets/resources/resource.d.ts +6 -6
  49. package/lib/packlets/resources/resource.js +3 -8
  50. package/lib/packlets/resources/resourceCandidate.d.ts +5 -1
  51. package/lib/packlets/resources/resourceCandidate.js +6 -0
  52. package/lib/packlets/resources/resourceManagerBuilder.d.ts +182 -11
  53. package/lib/packlets/resources/resourceManagerBuilder.js +469 -15
  54. package/lib/packlets/runtime/cacheListener.d.ts +9 -0
  55. package/lib/packlets/runtime/cacheListener.js +6 -0
  56. package/lib/packlets/runtime/cacheMetrics.d.ts +6 -0
  57. package/lib/packlets/runtime/cacheMetrics.js +11 -0
  58. package/lib/packlets/runtime/compiledResourceCollection.d.ts +3 -3
  59. package/lib/packlets/runtime/compiledResourceCollection.js +7 -0
  60. package/lib/packlets/runtime/iResourceManager.d.ts +13 -5
  61. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts +7 -7
  62. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +5 -5
  63. package/lib/packlets/runtime/resourceResolver.d.ts +21 -0
  64. package/lib/packlets/runtime/resourceResolver.js +39 -17
  65. package/lib/packlets/runtime/validate.js +1 -0
  66. package/lib/packlets/zip-archive/convert.d.ts +52 -0
  67. package/lib/packlets/zip-archive/convert.js +104 -0
  68. package/lib/packlets/zip-archive/index.d.ts +23 -0
  69. package/lib/packlets/zip-archive/index.js +95 -0
  70. package/lib/packlets/zip-archive/json.d.ts +64 -0
  71. package/lib/packlets/zip-archive/json.js +24 -0
  72. package/lib/packlets/zip-archive/types.d.ts +98 -0
  73. package/lib/packlets/zip-archive/types.js +39 -0
  74. package/lib/packlets/zip-archive/zipArchiveCreator.d.ts +35 -0
  75. package/lib/packlets/zip-archive/zipArchiveCreator.js +194 -0
  76. package/lib/packlets/zip-archive/zipArchiveFormat.d.ts +70 -0
  77. package/lib/packlets/zip-archive/zipArchiveFormat.js +184 -0
  78. package/lib/packlets/zip-archive/zipArchiveLoader.d.ts +70 -0
  79. package/lib/packlets/zip-archive/zipArchiveLoader.js +285 -0
  80. package/lib/test/data/sample.json +32 -0
  81. package/lib/test/unit/bundle/bundleBuilder.test.d.ts +2 -0
  82. package/lib/test/unit/bundle/bundleLoader.test.d.ts +2 -0
  83. package/lib/test/unit/bundle/bundleUtils.test.d.ts +2 -0
  84. package/lib/test/unit/bundle/convert.test.d.ts +2 -0
  85. package/lib/test/unit/bundle/integration.test.d.ts +2 -0
  86. package/lib/test/unit/bundle/model.test.d.ts +2 -0
  87. package/lib/test/unit/bundle/normalization.test.d.ts +2 -0
  88. package/lib/test/unit/common/conditions.test.d.ts +2 -0
  89. package/lib/test/unit/common/helpers/conditions.test.d.ts +2 -0
  90. package/lib/test/unit/common/helpers/contexts.test.d.ts +2 -0
  91. package/lib/test/unit/common/helpers/qualifierDefaultValues.test.d.ts +2 -0
  92. package/lib/test/unit/common/resources.test.d.ts +2 -0
  93. package/lib/test/unit/conditions/condition.test.d.ts +2 -0
  94. package/lib/test/unit/conditions/conditionCollector.test.d.ts +2 -0
  95. package/lib/test/unit/conditions/conditionScoreAsDefault.test.d.ts +2 -0
  96. package/lib/test/unit/conditions/conditionSet.test.d.ts +2 -0
  97. package/lib/test/unit/conditions/conditionSetCollector.test.d.ts +2 -0
  98. package/lib/test/unit/conditions/conditionToken.test.d.ts +2 -0
  99. package/lib/test/unit/conditions/convert.test.d.ts +2 -0
  100. package/lib/test/unit/config/common.test.d.ts +2 -0
  101. package/lib/test/unit/config/convert.test.d.ts +2 -0
  102. package/lib/test/unit/config/predefined/default.test.d.ts +2 -0
  103. package/lib/test/unit/config/predefined/extended.test.d.ts +2 -0
  104. package/lib/test/unit/config/systemConfiguration.test.d.ts +2 -0
  105. package/lib/test/unit/config/systemConfigurationInitParams.test.d.ts +2 -0
  106. package/lib/test/unit/context/contextToken.test.d.ts +2 -0
  107. package/lib/test/unit/context/convert.test.d.ts +2 -0
  108. package/lib/test/unit/decisions/abstractDecision.test.d.ts +2 -0
  109. package/lib/test/unit/decisions/abstractDecisionCollector.test.d.ts +2 -0
  110. package/lib/test/unit/decisions/candidate.test.d.ts +2 -0
  111. package/lib/test/unit/decisions/concreteDecision.test.d.ts +2 -0
  112. package/lib/test/unit/decisions/decision.test.d.ts +2 -0
  113. package/lib/test/unit/import/collectionImporter.test.d.ts +2 -0
  114. package/lib/test/unit/import/fsItem.test.d.ts +2 -0
  115. package/lib/test/unit/import/fsItemImporter.test.d.ts +2 -0
  116. package/lib/test/unit/import/importContext.test.d.ts +2 -0
  117. package/lib/test/unit/import/importManager.test.d.ts +2 -0
  118. package/lib/test/unit/import/jsonImporter.test.d.ts +2 -0
  119. package/lib/test/unit/import/pathImporter.test.d.ts +2 -0
  120. package/lib/test/unit/qualifier-types/convert.test.d.ts +2 -0
  121. package/lib/test/unit/qualifier-types/helpers.test.d.ts +2 -0
  122. package/lib/test/unit/qualifier-types/languageQualifierType.test.d.ts +2 -0
  123. package/lib/test/unit/qualifier-types/literalQualifierType.test.d.ts +2 -0
  124. package/lib/test/unit/qualifier-types/literalValueHierarchy.test.d.ts +2 -0
  125. package/lib/test/unit/qualifier-types/qualifierType.test.d.ts +2 -0
  126. package/lib/test/unit/qualifier-types/qualifierTypeCollector.test.d.ts +2 -0
  127. package/lib/test/unit/qualifier-types/territoryQualifierType.test.d.ts +2 -0
  128. package/lib/test/unit/qualifier-types/testQualifierType.d.ts +15 -0
  129. package/lib/test/unit/qualifier-types/testQualifierType.js +89 -0
  130. package/lib/test/unit/qualifiers/convert.test.d.ts +2 -0
  131. package/lib/test/unit/qualifiers/qualifierCollector.test.d.ts +2 -0
  132. package/lib/test/unit/qualifiers/qualifierDefaultValue.test.d.ts +2 -0
  133. package/lib/test/unit/qualifiers/qualifierDefaultValueToken.test.d.ts +2 -0
  134. package/lib/test/unit/resource-json/convert.test.d.ts +2 -0
  135. package/lib/test/unit/resource-json/nameInheritance.test.d.ts +2 -0
  136. package/lib/test/unit/resource-json/resourceDeclCollection.test.d.ts +2 -0
  137. package/lib/test/unit/resource-json/resourceDeclTree.test.d.ts +2 -0
  138. package/lib/test/unit/resource-types/jsonResourceType.test.d.ts +2 -0
  139. package/lib/test/unit/resource-types/resourceTypeCollector.test.d.ts +2 -0
  140. package/lib/test/unit/resources/candidateReducer.integration.test.d.ts +2 -0
  141. package/lib/test/unit/resources/candidateReducer.test.d.ts +2 -0
  142. package/lib/test/unit/resources/reduceCandidates.test.d.ts +2 -0
  143. package/lib/test/unit/resources/reduceQualifiers.comprehensive.test.d.ts +2 -0
  144. package/lib/test/unit/resources/reduceQualifiers.test.d.ts +2 -0
  145. package/lib/test/unit/resources/resource.test.d.ts +2 -0
  146. package/lib/test/unit/resources/resourceBuilder.test.d.ts +2 -0
  147. package/lib/test/unit/resources/resourceCandidate.test.d.ts +2 -0
  148. package/lib/test/unit/resources/resourceManagerBuilder.clone.test.d.ts +2 -0
  149. package/lib/test/unit/resources/resourceManagerBuilder.getBuiltResourceTree.test.d.ts +2 -0
  150. package/lib/test/unit/resources/resourceManagerBuilder.test.d.ts +2 -0
  151. package/lib/test/unit/runtime/cacheListener.test.d.ts +2 -0
  152. package/lib/test/unit/runtime/cacheMetrics.test.d.ts +2 -0
  153. package/lib/test/unit/runtime/compiledResourceCollection.test.d.ts +2 -0
  154. package/lib/test/unit/runtime/conditionSetResolutionResult.comprehensive.test.d.ts +2 -0
  155. package/lib/test/unit/runtime/conditionSetResolutionResult.test.d.ts +2 -0
  156. package/lib/test/unit/runtime/context/contextQualifierProvider.test.d.ts +2 -0
  157. package/lib/test/unit/runtime/context/contextQualifierProviderValidator.test.d.ts +2 -0
  158. package/lib/test/unit/runtime/context/simpleContextQualifierProvider.test.d.ts +2 -0
  159. package/lib/test/unit/runtime/context/validatingSimpleContextQualifierProvider.test.d.ts +2 -0
  160. package/lib/test/unit/runtime/resource-tree/readOnlyResourceTree.test.d.ts +2 -0
  161. package/lib/test/unit/runtime/resource-tree/resourceTreeChildren.test.d.ts +2 -0
  162. package/lib/test/unit/runtime/resource-tree/resourceTreeChildrenValidator.test.d.ts +2 -0
  163. package/lib/test/unit/runtime/resourceResolver.defaultResolution.test.d.ts +2 -0
  164. package/lib/test/unit/runtime/resourceResolver.test.d.ts +2 -0
  165. package/lib/test/unit/runtime/validate.test.d.ts +2 -0
  166. package/lib/test/unit/zip-archive/convert.test.d.ts +2 -0
  167. package/lib/test/unit/zip-archive/json.test.d.ts +2 -0
  168. package/lib/test/unit/zip-archive/zipArchiveCreator.test.d.ts +2 -0
  169. package/lib/test/unit/zip-archive/zipArchiveFormat.test.d.ts +2 -0
  170. package/lib/test/unit/zip-archive/zipArchiveIdempotency.test.d.ts +2 -0
  171. package/lib/test/unit/zip-archive/zipArchiveLoader.test.d.ts +2 -0
  172. package/package.json +19 -25
  173. package/src/index.ts +75 -0
  174. package/src/packlets/bundle/bundleBuilder.ts +159 -0
  175. package/src/packlets/bundle/bundleLoader.ts +157 -0
  176. package/src/packlets/bundle/bundleNormalizer.ts +173 -0
  177. package/src/packlets/bundle/bundleUtils.ts +142 -0
  178. package/src/packlets/bundle/convert.ts +87 -0
  179. package/src/packlets/bundle/index.ts +52 -0
  180. package/src/packlets/bundle/model.ts +138 -0
  181. package/src/packlets/common/conditions.ts +226 -0
  182. package/src/packlets/common/convert.ts +184 -0
  183. package/src/packlets/common/helpers/conditions.ts +84 -0
  184. package/src/packlets/common/helpers/context.ts +88 -0
  185. package/src/packlets/common/helpers/index.ts +26 -0
  186. package/src/packlets/common/helpers/qualifierDefaultValues.ts +91 -0
  187. package/src/packlets/common/helpers/resources.ts +96 -0
  188. package/src/packlets/common/index.ts +30 -0
  189. package/src/packlets/common/resources.ts +78 -0
  190. package/src/packlets/common/validate/conditions.ts +595 -0
  191. package/src/packlets/common/validate/index.ts +27 -0
  192. package/src/packlets/common/validate/regularExpressions.ts +92 -0
  193. package/src/packlets/common/validate/resources.ts +170 -0
  194. package/src/packlets/conditions/condition.ts +351 -0
  195. package/src/packlets/conditions/conditionCollector.ts +103 -0
  196. package/src/packlets/conditions/conditionDecls.ts +50 -0
  197. package/src/packlets/conditions/conditionSet.ts +318 -0
  198. package/src/packlets/conditions/conditionSetCollector.ts +127 -0
  199. package/src/packlets/conditions/conditionSetDecls.ts +41 -0
  200. package/src/packlets/conditions/conditionToken.ts +180 -0
  201. package/src/packlets/conditions/convert/conditionSetDecls.ts +72 -0
  202. package/src/packlets/conditions/convert/decls.ts +95 -0
  203. package/src/packlets/conditions/convert/index.ts +24 -0
  204. package/src/packlets/conditions/index.ts +33 -0
  205. package/src/packlets/config/common.ts +107 -0
  206. package/src/packlets/config/configInitFactory.ts +142 -0
  207. package/src/packlets/config/convert.ts +61 -0
  208. package/src/packlets/config/index.ts +30 -0
  209. package/src/packlets/config/json.ts +43 -0
  210. package/src/packlets/config/predefined/default.ts +150 -0
  211. package/src/packlets/config/predefined/extended.ts +198 -0
  212. package/src/packlets/config/predefined/index.ts +26 -0
  213. package/src/packlets/config/systemConfiguration.ts +217 -0
  214. package/src/packlets/context/contextDecls.ts +76 -0
  215. package/src/packlets/context/contextToken.ts +252 -0
  216. package/src/packlets/context/convert/decls.ts +126 -0
  217. package/src/packlets/context/convert/index.ts +23 -0
  218. package/src/packlets/context/index.ts +27 -0
  219. package/src/packlets/decisions/abstractDecision.ts +87 -0
  220. package/src/packlets/decisions/abstractDecisionCollector.ts +122 -0
  221. package/src/packlets/decisions/candidate.ts +101 -0
  222. package/src/packlets/decisions/common.ts +37 -0
  223. package/src/packlets/decisions/concreteDecision.ts +157 -0
  224. package/src/packlets/decisions/decision.ts +172 -0
  225. package/src/packlets/decisions/index.ts +28 -0
  226. package/src/packlets/import/fsItem.ts +212 -0
  227. package/src/packlets/import/importContext.ts +183 -0
  228. package/src/packlets/import/importManager.ts +187 -0
  229. package/src/packlets/import/importable.ts +107 -0
  230. package/src/packlets/import/importers/collectionImporter.ts +153 -0
  231. package/src/packlets/import/importers/fsItemImporter.ts +154 -0
  232. package/src/packlets/import/importers/importer.ts +58 -0
  233. package/src/packlets/import/importers/index.ts +27 -0
  234. package/src/packlets/import/importers/jsonImporter.ts +133 -0
  235. package/src/packlets/import/importers/pathImporter.ts +134 -0
  236. package/src/packlets/import/index.ts +29 -0
  237. package/src/packlets/qualifier-types/config/convert.ts +108 -0
  238. package/src/packlets/qualifier-types/config/index.ts +27 -0
  239. package/src/packlets/qualifier-types/config/json.ts +126 -0
  240. package/src/packlets/qualifier-types/convert.ts +77 -0
  241. package/src/packlets/qualifier-types/helpers.ts +94 -0
  242. package/src/packlets/qualifier-types/index.ts +34 -0
  243. package/src/packlets/qualifier-types/languageQualifierType.ts +143 -0
  244. package/src/packlets/qualifier-types/literalQualifierType.ts +244 -0
  245. package/src/packlets/qualifier-types/literalValueHierarchy.ts +332 -0
  246. package/src/packlets/qualifier-types/qualifierType.ts +360 -0
  247. package/src/packlets/qualifier-types/qualifierTypeCollector.ts +102 -0
  248. package/src/packlets/qualifier-types/territoryQualifierType.ts +255 -0
  249. package/src/packlets/qualifiers/convert/decls.ts +90 -0
  250. package/src/packlets/qualifiers/convert/index.ts +24 -0
  251. package/src/packlets/qualifiers/convert/qualifier.ts +55 -0
  252. package/src/packlets/qualifiers/index.ts +31 -0
  253. package/src/packlets/qualifiers/qualifier.ts +169 -0
  254. package/src/packlets/qualifiers/qualifierCollector.ts +194 -0
  255. package/src/packlets/qualifiers/qualifierDecl.ts +80 -0
  256. package/src/packlets/qualifiers/qualifierDefaultValueDecls.ts +57 -0
  257. package/src/packlets/qualifiers/qualifierDefaultValueToken.ts +230 -0
  258. package/src/packlets/resource-json/compiled/common.ts +35 -0
  259. package/src/packlets/resource-json/compiled/convert.ts +143 -0
  260. package/src/packlets/resource-json/compiled/index.ts +27 -0
  261. package/src/packlets/resource-json/compiled/json.ts +239 -0
  262. package/src/packlets/resource-json/convert.ts +236 -0
  263. package/src/packlets/resource-json/helpers.ts +284 -0
  264. package/src/packlets/resource-json/index.ts +33 -0
  265. package/src/packlets/resource-json/json.ts +295 -0
  266. package/src/packlets/resource-json/normalized.ts +211 -0
  267. package/src/packlets/resource-json/resourceDeclCollection.ts +117 -0
  268. package/src/packlets/resource-json/resourceDeclContainer.ts +48 -0
  269. package/src/packlets/resource-json/resourceDeclTree.ts +116 -0
  270. package/src/packlets/resource-types/config/convert.ts +36 -0
  271. package/src/packlets/resource-types/config/index.ts +27 -0
  272. package/src/packlets/resource-types/config/json.ts +30 -0
  273. package/src/packlets/resource-types/helpers.ts +44 -0
  274. package/src/packlets/resource-types/index.ts +30 -0
  275. package/src/packlets/resource-types/jsonResourceType.ts +104 -0
  276. package/src/packlets/resource-types/resourceType.ts +259 -0
  277. package/src/packlets/resource-types/resourceTypeCollector.ts +79 -0
  278. package/src/packlets/resources/candidateReducer.ts +331 -0
  279. package/src/packlets/resources/common.ts +114 -0
  280. package/src/packlets/resources/index.ts +28 -0
  281. package/src/packlets/resources/resource.ts +307 -0
  282. package/src/packlets/resources/resourceBuilder.ts +269 -0
  283. package/src/packlets/resources/resourceCandidate.ts +333 -0
  284. package/src/packlets/resources/resourceManagerBuilder.ts +1169 -0
  285. package/src/packlets/runtime/cacheListener.ts +113 -0
  286. package/src/packlets/runtime/cacheMetrics.ts +206 -0
  287. package/src/packlets/runtime/compiledResourceCollection.ts +607 -0
  288. package/src/packlets/runtime/conditionSetResolutionResult.ts +160 -0
  289. package/src/packlets/runtime/context/contextQualifierProvider.ts +117 -0
  290. package/src/packlets/runtime/context/contextQualifierProviderValidator.ts +281 -0
  291. package/src/packlets/runtime/context/index.ts +26 -0
  292. package/src/packlets/runtime/context/simpleContextQualifierProvider.ts +225 -0
  293. package/src/packlets/runtime/context/validatingSimpleContextQualifierProvider.ts +96 -0
  294. package/src/packlets/runtime/iResourceManager.ts +130 -0
  295. package/src/packlets/runtime/index.ts +35 -0
  296. package/src/packlets/runtime/resource-tree/common.ts +126 -0
  297. package/src/packlets/runtime/resource-tree/index.ts +26 -0
  298. package/src/packlets/runtime/resource-tree/readOnlyResourceTree.ts +342 -0
  299. package/src/packlets/runtime/resource-tree/resourceTreeChildren.ts +125 -0
  300. package/src/packlets/runtime/resource-tree/resourceTreeChildrenValidator.ts +187 -0
  301. package/src/packlets/runtime/resourceResolver.ts +626 -0
  302. package/src/packlets/runtime/validate.ts +63 -0
  303. package/src/packlets/zip-archive/convert.ts +121 -0
  304. package/src/packlets/zip-archive/index.ts +76 -0
  305. package/src/packlets/zip-archive/json.ts +91 -0
  306. package/src/packlets/zip-archive/types.ts +140 -0
  307. package/src/packlets/zip-archive/zipArchiveCreator.ts +229 -0
  308. package/src/packlets/zip-archive/zipArchiveFormat.ts +158 -0
  309. package/src/packlets/zip-archive/zipArchiveLoader.ts +370 -0
  310. package/CHANGELOG.md +0 -14
  311. package/CLAUDE.md +0 -186
  312. package/EXAMPLE_INIT_PARAMS.md +0 -88
  313. package/PROGRESS_SUMMARY.md +0 -48
  314. package/lib/index.d.ts.map +0 -1
  315. package/lib/index.js.map +0 -1
  316. package/lib/packlets/common/conditions.d.ts.map +0 -1
  317. package/lib/packlets/common/conditions.js.map +0 -1
  318. package/lib/packlets/common/convert.d.ts.map +0 -1
  319. package/lib/packlets/common/convert.js.map +0 -1
  320. package/lib/packlets/common/helpers/conditions.d.ts.map +0 -1
  321. package/lib/packlets/common/helpers/conditions.js.map +0 -1
  322. package/lib/packlets/common/helpers/context.d.ts.map +0 -1
  323. package/lib/packlets/common/helpers/context.js.map +0 -1
  324. package/lib/packlets/common/helpers/index.d.ts.map +0 -1
  325. package/lib/packlets/common/helpers/index.js.map +0 -1
  326. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +0 -1
  327. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +0 -1
  328. package/lib/packlets/common/helpers/resources.d.ts.map +0 -1
  329. package/lib/packlets/common/helpers/resources.js.map +0 -1
  330. package/lib/packlets/common/index.d.ts.map +0 -1
  331. package/lib/packlets/common/index.js.map +0 -1
  332. package/lib/packlets/common/resources.d.ts.map +0 -1
  333. package/lib/packlets/common/resources.js.map +0 -1
  334. package/lib/packlets/common/validate/conditions.d.ts.map +0 -1
  335. package/lib/packlets/common/validate/conditions.js.map +0 -1
  336. package/lib/packlets/common/validate/index.d.ts.map +0 -1
  337. package/lib/packlets/common/validate/index.js.map +0 -1
  338. package/lib/packlets/common/validate/regularExpressions.d.ts.map +0 -1
  339. package/lib/packlets/common/validate/regularExpressions.js.map +0 -1
  340. package/lib/packlets/common/validate/resources.d.ts.map +0 -1
  341. package/lib/packlets/common/validate/resources.js.map +0 -1
  342. package/lib/packlets/conditions/condition.d.ts.map +0 -1
  343. package/lib/packlets/conditions/condition.js.map +0 -1
  344. package/lib/packlets/conditions/conditionCollector.d.ts.map +0 -1
  345. package/lib/packlets/conditions/conditionCollector.js.map +0 -1
  346. package/lib/packlets/conditions/conditionDecls.d.ts.map +0 -1
  347. package/lib/packlets/conditions/conditionDecls.js.map +0 -1
  348. package/lib/packlets/conditions/conditionSet.d.ts.map +0 -1
  349. package/lib/packlets/conditions/conditionSet.js.map +0 -1
  350. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +0 -1
  351. package/lib/packlets/conditions/conditionSetCollector.js.map +0 -1
  352. package/lib/packlets/conditions/conditionSetDecls.d.ts.map +0 -1
  353. package/lib/packlets/conditions/conditionSetDecls.js.map +0 -1
  354. package/lib/packlets/conditions/conditionToken.d.ts.map +0 -1
  355. package/lib/packlets/conditions/conditionToken.js.map +0 -1
  356. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +0 -1
  357. package/lib/packlets/conditions/convert/conditionSetDecls.js.map +0 -1
  358. package/lib/packlets/conditions/convert/decls.d.ts.map +0 -1
  359. package/lib/packlets/conditions/convert/decls.js.map +0 -1
  360. package/lib/packlets/conditions/convert/index.d.ts.map +0 -1
  361. package/lib/packlets/conditions/convert/index.js.map +0 -1
  362. package/lib/packlets/conditions/index.d.ts.map +0 -1
  363. package/lib/packlets/conditions/index.js.map +0 -1
  364. package/lib/packlets/config/common.d.ts.map +0 -1
  365. package/lib/packlets/config/common.js.map +0 -1
  366. package/lib/packlets/config/convert.d.ts.map +0 -1
  367. package/lib/packlets/config/convert.js.map +0 -1
  368. package/lib/packlets/config/index.d.ts.map +0 -1
  369. package/lib/packlets/config/index.js.map +0 -1
  370. package/lib/packlets/config/json.d.ts.map +0 -1
  371. package/lib/packlets/config/json.js.map +0 -1
  372. package/lib/packlets/config/predefined/default.d.ts.map +0 -1
  373. package/lib/packlets/config/predefined/default.js.map +0 -1
  374. package/lib/packlets/config/predefined/extended.d.ts.map +0 -1
  375. package/lib/packlets/config/predefined/extended.js.map +0 -1
  376. package/lib/packlets/config/predefined/index.d.ts.map +0 -1
  377. package/lib/packlets/config/predefined/index.js.map +0 -1
  378. package/lib/packlets/config/systemConfiguration.d.ts.map +0 -1
  379. package/lib/packlets/config/systemConfiguration.js.map +0 -1
  380. package/lib/packlets/context/contextDecls.d.ts.map +0 -1
  381. package/lib/packlets/context/contextDecls.js.map +0 -1
  382. package/lib/packlets/context/contextToken.d.ts.map +0 -1
  383. package/lib/packlets/context/contextToken.js.map +0 -1
  384. package/lib/packlets/context/convert/decls.d.ts.map +0 -1
  385. package/lib/packlets/context/convert/decls.js.map +0 -1
  386. package/lib/packlets/context/convert/index.d.ts.map +0 -1
  387. package/lib/packlets/context/convert/index.js.map +0 -1
  388. package/lib/packlets/context/index.d.ts.map +0 -1
  389. package/lib/packlets/context/index.js.map +0 -1
  390. package/lib/packlets/decisions/abstractDecision.d.ts.map +0 -1
  391. package/lib/packlets/decisions/abstractDecision.js.map +0 -1
  392. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +0 -1
  393. package/lib/packlets/decisions/abstractDecisionCollector.js.map +0 -1
  394. package/lib/packlets/decisions/candidate.d.ts.map +0 -1
  395. package/lib/packlets/decisions/candidate.js.map +0 -1
  396. package/lib/packlets/decisions/common.d.ts.map +0 -1
  397. package/lib/packlets/decisions/common.js.map +0 -1
  398. package/lib/packlets/decisions/concreteDecision.d.ts.map +0 -1
  399. package/lib/packlets/decisions/concreteDecision.js.map +0 -1
  400. package/lib/packlets/decisions/decision.d.ts.map +0 -1
  401. package/lib/packlets/decisions/decision.js.map +0 -1
  402. package/lib/packlets/decisions/index.d.ts.map +0 -1
  403. package/lib/packlets/decisions/index.js.map +0 -1
  404. package/lib/packlets/import/fsItem.d.ts.map +0 -1
  405. package/lib/packlets/import/fsItem.js.map +0 -1
  406. package/lib/packlets/import/importContext.d.ts.map +0 -1
  407. package/lib/packlets/import/importContext.js.map +0 -1
  408. package/lib/packlets/import/importManager.d.ts.map +0 -1
  409. package/lib/packlets/import/importManager.js.map +0 -1
  410. package/lib/packlets/import/importable.d.ts.map +0 -1
  411. package/lib/packlets/import/importable.js.map +0 -1
  412. package/lib/packlets/import/importers/collectionImporter.d.ts.map +0 -1
  413. package/lib/packlets/import/importers/collectionImporter.js.map +0 -1
  414. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +0 -1
  415. package/lib/packlets/import/importers/fsItemImporter.js.map +0 -1
  416. package/lib/packlets/import/importers/importer.d.ts.map +0 -1
  417. package/lib/packlets/import/importers/importer.js.map +0 -1
  418. package/lib/packlets/import/importers/index.d.ts.map +0 -1
  419. package/lib/packlets/import/importers/index.js.map +0 -1
  420. package/lib/packlets/import/importers/jsonImporter.d.ts.map +0 -1
  421. package/lib/packlets/import/importers/jsonImporter.js.map +0 -1
  422. package/lib/packlets/import/importers/pathImporter.d.ts.map +0 -1
  423. package/lib/packlets/import/importers/pathImporter.js.map +0 -1
  424. package/lib/packlets/import/index.d.ts.map +0 -1
  425. package/lib/packlets/import/index.js.map +0 -1
  426. package/lib/packlets/qualifier-types/config/convert.d.ts.map +0 -1
  427. package/lib/packlets/qualifier-types/config/convert.js.map +0 -1
  428. package/lib/packlets/qualifier-types/config/index.d.ts.map +0 -1
  429. package/lib/packlets/qualifier-types/config/index.js.map +0 -1
  430. package/lib/packlets/qualifier-types/config/json.d.ts.map +0 -1
  431. package/lib/packlets/qualifier-types/config/json.js.map +0 -1
  432. package/lib/packlets/qualifier-types/convert.d.ts.map +0 -1
  433. package/lib/packlets/qualifier-types/convert.js.map +0 -1
  434. package/lib/packlets/qualifier-types/helpers.d.ts.map +0 -1
  435. package/lib/packlets/qualifier-types/helpers.js.map +0 -1
  436. package/lib/packlets/qualifier-types/index.d.ts.map +0 -1
  437. package/lib/packlets/qualifier-types/index.js.map +0 -1
  438. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +0 -1
  439. package/lib/packlets/qualifier-types/languageQualifierType.js.map +0 -1
  440. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +0 -1
  441. package/lib/packlets/qualifier-types/literalQualifierType.js.map +0 -1
  442. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +0 -1
  443. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +0 -1
  444. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +0 -1
  445. package/lib/packlets/qualifier-types/qualifierType.js.map +0 -1
  446. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +0 -1
  447. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +0 -1
  448. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +0 -1
  449. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +0 -1
  450. package/lib/packlets/qualifiers/convert/decls.d.ts.map +0 -1
  451. package/lib/packlets/qualifiers/convert/decls.js.map +0 -1
  452. package/lib/packlets/qualifiers/convert/index.d.ts.map +0 -1
  453. package/lib/packlets/qualifiers/convert/index.js.map +0 -1
  454. package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +0 -1
  455. package/lib/packlets/qualifiers/convert/qualifier.js.map +0 -1
  456. package/lib/packlets/qualifiers/index.d.ts.map +0 -1
  457. package/lib/packlets/qualifiers/index.js.map +0 -1
  458. package/lib/packlets/qualifiers/qualifier.d.ts.map +0 -1
  459. package/lib/packlets/qualifiers/qualifier.js.map +0 -1
  460. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +0 -1
  461. package/lib/packlets/qualifiers/qualifierCollector.js.map +0 -1
  462. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +0 -1
  463. package/lib/packlets/qualifiers/qualifierDecl.js.map +0 -1
  464. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +0 -1
  465. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +0 -1
  466. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +0 -1
  467. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +0 -1
  468. package/lib/packlets/resource-json/compiled/common.d.ts.map +0 -1
  469. package/lib/packlets/resource-json/compiled/common.js.map +0 -1
  470. package/lib/packlets/resource-json/compiled/convert.d.ts.map +0 -1
  471. package/lib/packlets/resource-json/compiled/convert.js.map +0 -1
  472. package/lib/packlets/resource-json/compiled/index.d.ts.map +0 -1
  473. package/lib/packlets/resource-json/compiled/index.js.map +0 -1
  474. package/lib/packlets/resource-json/compiled/json.d.ts.map +0 -1
  475. package/lib/packlets/resource-json/compiled/json.js.map +0 -1
  476. package/lib/packlets/resource-json/convert.d.ts.map +0 -1
  477. package/lib/packlets/resource-json/convert.js.map +0 -1
  478. package/lib/packlets/resource-json/helpers.d.ts.map +0 -1
  479. package/lib/packlets/resource-json/helpers.js.map +0 -1
  480. package/lib/packlets/resource-json/index.d.ts.map +0 -1
  481. package/lib/packlets/resource-json/index.js.map +0 -1
  482. package/lib/packlets/resource-json/json.d.ts.map +0 -1
  483. package/lib/packlets/resource-json/json.js.map +0 -1
  484. package/lib/packlets/resource-json/normalized.d.ts.map +0 -1
  485. package/lib/packlets/resource-json/normalized.js.map +0 -1
  486. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +0 -1
  487. package/lib/packlets/resource-json/resourceDeclCollection.js.map +0 -1
  488. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +0 -1
  489. package/lib/packlets/resource-json/resourceDeclContainer.js.map +0 -1
  490. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +0 -1
  491. package/lib/packlets/resource-json/resourceDeclTree.js.map +0 -1
  492. package/lib/packlets/resource-types/config/convert.d.ts.map +0 -1
  493. package/lib/packlets/resource-types/config/convert.js.map +0 -1
  494. package/lib/packlets/resource-types/config/index.d.ts.map +0 -1
  495. package/lib/packlets/resource-types/config/index.js.map +0 -1
  496. package/lib/packlets/resource-types/config/json.d.ts.map +0 -1
  497. package/lib/packlets/resource-types/config/json.js.map +0 -1
  498. package/lib/packlets/resource-types/helpers.d.ts.map +0 -1
  499. package/lib/packlets/resource-types/helpers.js.map +0 -1
  500. package/lib/packlets/resource-types/index.d.ts.map +0 -1
  501. package/lib/packlets/resource-types/index.js.map +0 -1
  502. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +0 -1
  503. package/lib/packlets/resource-types/jsonResourceType.js.map +0 -1
  504. package/lib/packlets/resource-types/resourceType.d.ts.map +0 -1
  505. package/lib/packlets/resource-types/resourceType.js.map +0 -1
  506. package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +0 -1
  507. package/lib/packlets/resource-types/resourceTypeCollector.js.map +0 -1
  508. package/lib/packlets/resources/candidateReducer.d.ts.map +0 -1
  509. package/lib/packlets/resources/candidateReducer.js.map +0 -1
  510. package/lib/packlets/resources/common.d.ts.map +0 -1
  511. package/lib/packlets/resources/common.js.map +0 -1
  512. package/lib/packlets/resources/index.d.ts.map +0 -1
  513. package/lib/packlets/resources/index.js.map +0 -1
  514. package/lib/packlets/resources/resource.d.ts.map +0 -1
  515. package/lib/packlets/resources/resource.js.map +0 -1
  516. package/lib/packlets/resources/resourceBuilder.d.ts.map +0 -1
  517. package/lib/packlets/resources/resourceBuilder.js.map +0 -1
  518. package/lib/packlets/resources/resourceCandidate.d.ts.map +0 -1
  519. package/lib/packlets/resources/resourceCandidate.js.map +0 -1
  520. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +0 -1
  521. package/lib/packlets/resources/resourceManagerBuilder.js.map +0 -1
  522. package/lib/packlets/runtime/cacheListener.d.ts.map +0 -1
  523. package/lib/packlets/runtime/cacheListener.js.map +0 -1
  524. package/lib/packlets/runtime/cacheMetrics.d.ts.map +0 -1
  525. package/lib/packlets/runtime/cacheMetrics.js.map +0 -1
  526. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +0 -1
  527. package/lib/packlets/runtime/compiledResourceCollection.js.map +0 -1
  528. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +0 -1
  529. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +0 -1
  530. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +0 -1
  531. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +0 -1
  532. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +0 -1
  533. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +0 -1
  534. package/lib/packlets/runtime/context/index.d.ts.map +0 -1
  535. package/lib/packlets/runtime/context/index.js.map +0 -1
  536. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +0 -1
  537. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +0 -1
  538. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +0 -1
  539. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +0 -1
  540. package/lib/packlets/runtime/iResourceManager.d.ts.map +0 -1
  541. package/lib/packlets/runtime/iResourceManager.js.map +0 -1
  542. package/lib/packlets/runtime/index.d.ts.map +0 -1
  543. package/lib/packlets/runtime/index.js.map +0 -1
  544. package/lib/packlets/runtime/resource-tree/common.d.ts.map +0 -1
  545. package/lib/packlets/runtime/resource-tree/common.js.map +0 -1
  546. package/lib/packlets/runtime/resource-tree/index.d.ts.map +0 -1
  547. package/lib/packlets/runtime/resource-tree/index.js.map +0 -1
  548. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +0 -1
  549. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +0 -1
  550. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +0 -1
  551. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +0 -1
  552. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +0 -1
  553. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +0 -1
  554. package/lib/packlets/runtime/resourceResolver.d.ts.map +0 -1
  555. package/lib/packlets/runtime/resourceResolver.js.map +0 -1
  556. package/lib/packlets/runtime/validate.d.ts.map +0 -1
  557. package/lib/packlets/runtime/validate.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCH,4CA0BC;AAUD,kDAeC;AA4BD,wDAiBC;AASD,kDAOC;AAUD,gDAmBC;AAsCD,sDAwBC;AAYD,gDAcC;AArQD,4CAAkE;AAElE,6CAA+B;AAC/B,sCAAqD;AACrD,oDAAuD;AAoBvD;;;;;;;GAOG;AACH,SAAgB,gBAAgB,CAC9B,IAAuC,EACvC,UAAmB,EACnB,gBAA0D;;IAE1D,IAAI,CAAC,IAAI,EAAE,CA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AS,EAAE,cAAc,CAAC,CAAC,CAC/F,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EAAE;YACzB,OAAO,IAAA,kBAAO,kCAAM,QAAQ,KAAE,UAAU,IAAG,CAAC;QAC9C,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,kBAAkB,CAChC,QAAuC,EACvC,IAAY,EACZ,UAAmB,EACnB,gBAA0D;IAE1D,OAAO,gBAAa,CAAC,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE;;QACtE,OAAO,IAAA,qBAAU;QACf,yCAAyC;QACzC,CAAC,MAAA,QAAQ,CAAC,UAAU,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,mBAAmB,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC,CACjG,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EAAE;YACzB,OAAO,IAAA,kBAAO,kCAAM,QAAQ,KAAE,EAAE,EAAE,UAAU,IAAG,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { 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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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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CAAC,OAAO,CAAC,EAAE,qBAAqB,CAAC;IACzC,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,2BAA2B,CAAC,CAAC;IACjE,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACvD,QAAQ,CAAC,WAAW,CAAC,EAAE,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;;;;GAIG;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"}
@@ -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,CAAC;IACtC,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAAC,IAAa;QAChC,OAAO,OAAO,CAAC,8BAA8B;aAC1C,OAAO,CAAC,IAAI,CAAC;aACb,eAAe,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,gCAAgC,GAAG,EAAE,CAAC;aAC/D,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;YAClB,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACI,oBAAoB;QACzB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED;;;;OAIG;IACI,qBAAqB;QAC1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M,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,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C,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,EAAW,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACtD,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;IAC5D;;;;;OAKG;IACH,SAAS,aAAa,GAAG,EAAE,gBAAgB,EAAE,KAAK,CAAC,EAAE,MAAM;IAI3D;;;;;OAKG;WACW,MAAM,CAAC,MAAM,CAAC,EAAE,6BAA6B,GAAG,MAAM,CAAC,gBAAgB,CAAC;IAMtF;;OAEG;IAEI,mBAAmB,CAAC,KAAK,EAAE,sCAAsC,GAAG,MAAM,CAAC,UAAU,CAAC;IAI7F;;OAEG;IACI,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;IACtE;;OAEG;IACI,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC;IACvE;;OAEG;IACI,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC;CAI1E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsonResourceType.js","sourceRoot":"","sources":["../../../src/packlets/resource-types/jsonResourceType.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,oDAA6E;AAC7E,iDAAsF;AACtF,sCAAsD;AACtD,4CAAsD;AAoBtD;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,2BAAwB;IAC5D;;;;;OAKG;IACH,YAAsB,GAAqB,EAAE,KAAc;QACzD,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAAC,MAAsC;;QACzD,OAAO,gBAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,mCAAI,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE;YAC/E,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,gBAAgB,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,WAAqB;QACrD,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 { 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, isPartial: true): Result<JsonObject>;\n /**\n * {@inheritdoc ResourceTypes.ResourceType.(validate:2)}\n */\n public validate(json: JsonObject, isPartial: false): Result<JsonObject>;\n /**\n * {@inheritdoc ResourceTypes.ResourceType.(validate:3)}\n */\n public validate(json: JsonObject, isPartial: boolean): Result<JsonObject>;\n public validate(json: JsonObject, __isPartial?: boolean): 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,EAGL,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,UAAU,EACX,MAAM,WAAW,CAAC;AAEnB;;;GAGG;AACH,MAAM,WAAW,sCAAsC;IACrD;;;OAGG;IACH,EAAE,EAAE,U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,sCAOmB;AAgCnB;;;;;GAKG;AACH,MAAsB,YAAY;IAEhC;;OAEG;IACH,IAAW,GAAG;QACZ,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;IACjC,CAAC;IAED,YAAsB,GAAqB,EAAE,KAAc;QACzD,IAAI,CAAC,YAAY,GAAG,IAAI,sBAAW,CAAC,WAAW,CAAsC;YACnF,GAAG;YACH,qDAAqD;YACrD,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,iBAAQ,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS;YACtF,cAAc,EAAE,gBAAa,CAAC,iBAAiB;SAChD,CAAC,CAAC;IACL,CAAC;IA0CD;;OAEG;IACI,QAAQ,CAAC,KAAa;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;CACF;AAvED,oCAuEC","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 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 isPartial - `true` indicates that the value is expected to be partial.\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, isPartial: true): 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 isPartial - `false` indicates that the value is expected to be complete.\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, isPartial: false): Result<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 isPartial - Indicates whether the value is expected to be partial.\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, isPartial?: boolean): 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,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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"}
@@ -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"]}
@@ -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;IAC5B;;OAEG;IACH,UAAU,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC7C;;OAEG;IACH,SAAS,EAAE,yBAAyB,CAAC;CACtC;AAED;;;;GAIG;AACH,qBAAa,QAAS,YAAW,SA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,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;YACnD,IAAI,QAAQ,EAAE,CAAC;gBACb,uFAAuF;gBACvF,IAAI,CAAC,qCAAiB,CAAC,KAAK,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,CAAC;oBAClD,MAAM,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC,EAAE,8BAA8B,kBAAkB,GAAG,CAAC,CAAC;gBACxF,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,SAAS,CAAC,GAAG,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;YAC/C,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC,cAAc,CAC1B,IAAA,kBAAO,EAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,qCAAiB,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,CAClF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACO,sBAAsB,CAC9B,OAA0E;QAE1E,uFAAuF;QACvF,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAC1C,SAAS,CAAC,sBAAsB,CAAC,OAAO,CAAC,gBAAiB,EAAE,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAAC,CAC3F,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF;AAnPD,4BAmPC","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 { MessageAggregator, Result, captureResult, fail, succeed } from '@fgv/ts-utils';\nimport { ResourceId, Validate } from '../common';\nimport { ResourceCandidate } from './resourceCandidate';\nimport { CandidateReducer } from './candidateReducer';\nimport { ResourceType } from '../resource-types';\nimport { ConcreteDecision, AbstractDecisionCollector } from '../decisions';\nimport { IResource } from '../runtime';\nimport { IResourceDeclarationOptions, ICompiledResourceOptionsWithFilter } from './common';\nimport * as ResourceJson from '../resource-json';\nimport * as Context from '../context';\n\n/**\n * Parameters used to create a {@link Resources.Resource | Resource} object.\n * @public\n */\nexport interface IResourceCreateParams {\n /**\n * The id of the resource.\n */\n id?: string;\n /**\n * Optional {@link ResourceTypes.ResourceType | type} of the resource. If not specified, the type will be inferred\n * from the candidates.\n */\n resourceType?: ResourceType;\n /**\n * Array of {@link Resources.ResourceCandidate | candidates} for the resource.\n */\n candidates: ReadonlyArray<ResourceCandidate>;\n /**\n * {@link Decisions.AbstractDecisionCollector | AbstractDecisionCollector} used to create the optimized decision.\n */\n decisions: AbstractDecisionCollector;\n}\n\n/**\n * Represents a single logical resource, with a unique id and a set of possible\n * candidate instances.\n * @public\n */\nexport class Resource implements IResource {\n /**\n * The unique {@link ResourceId | id} of the resource.\n */\n public readonly id: ResourceId;\n /**\n * The {@link ResourceTypes.ResourceType | type} of the resource.\n */\n public readonly _resourceType: ResourceType;\n /**\n * The array of {@link Resources.ResourceCandidate | candidates} for the resource.\n */\n public readonly candidates: ReadonlyArray<ResourceCandidate>;\n /**\n * {@link Decisions.ConcreteDecision | Decision} for optimized resource resolution.\n */\n public readonly decision: ConcreteDecision;\n\n /**\n * Gets the resource type (implements IResource interface).\n */\n public get resourceType(): ResourceType {\n return this._resourceType;\n }\n\n /**\n * Gets the resource type name as a string.\n */\n public get resourceTypeName(): string {\n return this._resourceType.key;\n }\n\n /**\n * Constructor for a {@link Resources.Resource | Resource} object.\n * @param params - {@link Resources.IResourceCreateParams | Parameters} used to create the resource.\n * @public\n */\n protected constructor(params: IResourceCreateParams) {\n const id = params.id ? Validate.toResourceId(params.id).orThrow() : undefined;\n this.id = Resource._validateCandidateResourceIds(id, params.candidates).orThrow();\n this._resourceType = ResourceCandidate.validateResourceTypes(params.candidates, params.resourceType)\n .onSuccess((t) => {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (t === undefined) {\n return fail<ResourceType>(`${params.id}: no type specified and no candidates with types.`);\n }\n return succeed(t);\n })\n .orThrow();\n\n this.candidates = Resource._validateAndNormalizeCandidates(params.candidates).orThrow();\n this.decision = Resource._createOptimizedDecision(this.candidates, params.decisions).orThrow();\n }\n\n /**\n * Creates a new {@link Resources.Resource | Resource} object.\n * @param params - {@link Resources.IResourceCreateParams | Parameters} used to create the resource.\n * @returns `Success` with the new {@link Resources.Resource | Resource} object if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public static create(params: IResourceCreateParams): Result<Resource> {\n return captureResult(() => new Resource(params));\n }\n\n /**\n * Gets the candidates for this resource that match the specified {@link Context.IValidatedContextDecl | context}.\n * @param context - The {@link Context.IValidatedContextDecl | context} to match against.\n * @param options - {@link Context.IContextMatchOptions | options} for the context match.\n * @returns The array of {@link Resources.ResourceCandidate | candidates} that match the context.\n */\n public getCandidatesForContext(\n context: Context.IValidatedContextDecl,\n options?: Context.IContextMatchOptions\n ): ReadonlyArray<ResourceCandidate> {\n return this.candidates.filter((c) => c.canMatchPartialContext(context, options));\n }\n\n /**\n * Gets the {@link ResourceJson.Json.IChildResourceDecl | child resource declaration} for this resource.\n * @param options - {@link ResourceJson.Helpers.IDeclarationOptions | options} for the declaration.\n * @returns The {@link ResourceJson.Json.IChildResourceDecl | child resource declaration}.\n */\n public toChildResourceDecl(options?: IResourceDeclarationOptions): ResourceJson.Json.IChildResourceDecl {\n /* c8 ignore next 1 - defense in depth */\n options = options ?? {};\n const matches = this._getMatchingCandidates(options);\n\n const candidates = options.reduceQualifiers\n ? CandidateReducer.reduceToChildResourceCandidateDecls(matches, options.filterForContext).orThrow()\n : matches.map((c) => c.toChildResourceCandidateDecl());\n\n return {\n resourceTypeName: this.resourceTypeName,\n ...(candidates.length > 0 ? { candidates } : {})\n };\n }\n\n /**\n * Gets the {@link ResourceJson.Json.ILooseResourceDecl | loose resource declaration} for this resource.\n * @param options - {@link Resources.IResourceDeclarationOptions | options} for the declaration.\n * @returns The {@link ResourceJson.Json.ILooseResourceDecl | loose resource declaration}.\n */\n public toLooseResourceDecl(options?: IResourceDeclarationOptions): ResourceJson.Json.ILooseResourceDecl {\n /* c8 ignore next 1 - defense in depth */\n options = options ?? {};\n const matches = this._getMatchingCandidates(options);\n\n const candidates = options.reduceQualifiers\n ? CandidateReducer.reduceToChildResourceCandidateDecls(matches, options.filterForContext).orThrow()\n : matches.map((c) => c.toChildResourceCandidateDecl());\n\n return {\n id: this.id,\n resourceTypeName: this.resourceTypeName,\n ...(candidates.length > 0 ? { candidates } : {})\n };\n }\n\n /**\n * Converts this resource to a compiled resource representation.\n * @param options - Optional compilation options controlling the output format and filtering.\n * @returns A compiled resource object that can be used for serialization or runtime processing.\n * @public\n */\n public toCompiled(\n options?: IResourceDeclarationOptions | ICompiledResourceOptionsWithFilter\n ): ResourceJson.Compiled.ICompiledResource {\n const candidates: ResourceJson.Compiled.ICompiledCandidate[] = this._getMatchingCandidates(options).map(\n (c) => ({\n json: c.json,\n isPartial: c.isPartial,\n mergeMethod: c.mergeMethod\n })\n );\n\n return {\n id: this.id,\n type: this.resourceType.index!,\n decision: this.decision.baseDecision.index!,\n candidates\n };\n }\n\n /**\n * Validates that all candidates have the same id as the resource.\n * @param resourceId - The expected id of the resource.\n * @param candidates - The array of candidates to validate.\n * @returns `Success` with the resource id if all candidates have the same id,\n * `Failure` with an error message otherwise.\n * @internal\n */\n private static _validateCandidateResourceIds(\n resourceId: ResourceId | undefined,\n candidates: ReadonlyArray<ResourceCandidate>\n ): Result<ResourceId> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!resourceId && candidates.length === 0) {\n return fail('unknown: no resource id and no candidates.');\n }\n resourceId = resourceId ?? candidates[0].id;\n\n const mismatched = candidates.filter((c) => c.id !== resourceId).map((c) => c.id);\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (mismatched.length > 0) {\n return fail(`${resourceId}: candidates with mismatched ids ${mismatched.join(', ')}.`);\n }\n return succeed(resourceId);\n }\n\n /**\n * Creates an optimized decision for the given candidates using the decisions collector.\n * @param candidates - The validated and normalized candidates to create a decision for.\n * @param decisions - The {@link Decisions.AbstractDecisionCollector | AbstractDecisionCollector} to use.\n * @returns `Success` with the {@link Decisions.ConcreteDecision | ConcreteDecision} if successful,\n * `Failure` with an error message otherwise.\n * @internal\n */\n private static _createOptimizedDecision(\n candidates: ReadonlyArray<ResourceCandidate>,\n decisions: AbstractDecisionCollector\n ): Result<ConcreteDecision> {\n const decisionCandidates = candidates.map((c) => ({\n conditionSet: c.conditions,\n value: c.json\n }));\n\n return ConcreteDecision.create({\n decisions,\n candidates: decisionCandidates\n });\n }\n\n /**\n * Validates and normalizes an array of {@link Resources.ResourceCandidate | candidates}. Fails if there\n * are multiple candidates for the same set of conditions.\n * @param candidates - The array of candidates to validate.\n * @returns `Success` with the validated and sorted array of candidates if successful,\n * `Failure` with an error message otherwise.\n * @internal\n */\n private static _validateAndNormalizeCandidates(\n candidates: ReadonlyArray<ResourceCandidate>\n ): Result<ReadonlyArray<ResourceCandidate>> {\n const errors = new MessageAggregator();\n const validated: Map<string, ResourceCandidate> = new Map();\n\n for (const candidate of candidates) {\n const conditionSetString = candidate.conditions.toString();\n const existing = validated.get(conditionSetString);\n if (existing) {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!ResourceCandidate.equal(candidate, existing)) {\n errors.addMessage(`${candidate.id}: duplicate candidates for ${conditionSetString}.`);\n }\n } else {\n validated.set(conditionSetString, candidate);\n }\n }\n return errors.returnOrReport(\n succeed(Array.from(validated.values()).sort(ResourceCandidate.compare).reverse())\n );\n }\n\n /**\n * Gets the appropriate candidates based on filtering options.\n * If a validated filter context is provided, returns only matching candidates.\n * Otherwise returns all candidates.\n * @param options - Options that may contain a validated filter context\n * @returns The filtered array of candidates\n * @internal\n */\n protected _getMatchingCandidates(\n options?: IResourceDeclarationOptions | ICompiledResourceOptionsWithFilter\n ): ReadonlyArray<ResourceCandidate> {\n /* c8 ignore next 5 - functional code path tested but coverage intermittently missed */\n if (options?.filterForContext) {\n return this.candidates.filter((candidate) =>\n candidate.canMatchPartialContext(options.filterForContext!, { partialContextMatch: true })\n );\n }\n return this.candidates;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceBuilder.d.ts","sourceRoot":"","sources":["../../../src/packlets/resources/resourceBuilder.ts"],"names":[],"mappings":"AAsBA,OAAO,EACL,WAAW,EACX,cAAc,EACd,MAAM,EACN,SAAS,EAMV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAY,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,6BAA6B,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC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,CAAC,aAAa,CAAC,GAAG,QAAQ,gBAAgB,GAAG,CAC5F,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,SAAS,CAAC,CAAC,YAAY,EAAE,EAAE;YACrF,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;YAClC,OAAO,IAAA,4BAAiB,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,KAAK;QACV,uFAAuF;QACvF,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YAChC,OAAO,IAAA,eAAI,EAAC,GAAG,IAAI,CAAC,EAAE,2BAA2B,CAAC,CAAC;QACrD,CAAC;QAED,uFAAuF;QACvF,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;YACrC,OAAO,IAAA,eAAI,EAAC,GAAG,IAAI,CAAC,EAAE,0CAA0C,CAAC,CAAC;QACpE,CAAC;QAED,OAAO,mBAAQ,CAAC,MAAM,CAAC;YACrB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,YAAY,EAAE,IAAI,CAAC,aAAa;YAChC,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,SAAS,EAAE,IAAI,CAAC,UAAU;SAC3B,CAAC,CAAC;IACL,CAAC;CACF;AAzMD,0CAyMC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport {\n Collections,\n DetailedResult,\n Result,\n ResultMap,\n captureResult,\n fail,\n failWithDetail,\n succeed,\n succeedWithDetail\n} from '@fgv/ts-utils';\nimport { ResourceId, Validate } from '../common';\nimport { ResourceCandidate } from './resourceCandidate';\nimport { ReadOnlyResourceTypeCollector, ResourceType } from '../resource-types';\nimport { Resource } from './resource';\nimport { ConditionSetCollector } from '../conditions';\nimport { AbstractDecisionCollector } from '../decisions';\nimport * as ResourceJson from '../resource-json';\nimport * as Context from '../context';\n\n/**\n * Parameters for creating a {@link Resources.ResourceBuilder}.\n * @public\n */\nexport interface IResourceBuilderCreateParams {\n id: string;\n typeName?: string;\n conditionSets: ConditionSetCollector;\n resourceTypes: ReadOnlyResourceTypeCollector;\n decisions: AbstractDecisionCollector;\n}\n\n/**\n * Possible result details returned by the resource builder\n * {@link Resources.ResourceBuilder.addLooseCandidate | addLooseCandidate} method.\n * @public\n */\nexport type ResourceBuilderResultDetail = Collections.ResultMapResultDetail | 'id-mismatch' | 'type-mismatch';\n\n/**\n * Represents a builder for a single logical {@link Resources.Resource | resource}. Collects candidates\n * with a common resource ID, validates them against each other and builds a {@link Resources.Resource | resource}\n * object once all candidates are collected.\n * @public\n */\nexport class ResourceBuilder {\n /**\n * The unique {@link ResourceId | id} of the resource being built.\n */\n public readonly id: ResourceId;\n\n /**\n * Supplied or inferred {@link ResourceTypes.ResourceType | type} of the resource being built.\n * If no type is supplied, the type will be inferred from the candidates - at least one candidate must\n * define resource type and all candidates must be of the same type.\n */\n public get resourceType(): ResourceType | undefined {\n return this._resourceType;\n }\n\n /**\n * Array of {@link Resources.ResourceCandidate | candidates} for the resource being built.\n */\n public get candidates(): ReadonlyArray<ResourceCandidate> {\n return Array.from(this._candidates.values()).sort(ResourceCandidate.compare).reverse();\n }\n\n /**\n * The supplied or inferred {@link ResourceTypes.ResourceType | type} of the resource\n * being built.\n */\n protected _resourceType: ResourceType | undefined;\n\n /**\n * Map of {@link Resources.ResourceCandidate | candidates} for the resource being built.\n */\n protected _candidates: ResultMap<string, ResourceCandidate>;\n\n /**\n * Map of all known {@link ResourceTypes.ResourceType | resource types}.\n */\n protected _resourceTypes: ReadOnlyResourceTypeCollector;\n\n /**\n * Common collector for {@link Conditions.ConditionSet | condition sets}.\n */\n protected _conditionSets: ConditionSetCollector;\n\n /**\n * Collector for {@link Decisions.AbstractDecision | abstract decisions}.\n */\n protected _decisions: AbstractDecisionCollector;\n\n /**\n * Constructor for a {@link Resources.ResourceBuilder | ResourceBuilder} object.\n * @param params - Parameters to construct the new {@link Resources.ResourceBuilder | ResourceBuilder}.\n */\n protected constructor(params: IResourceBuilderCreateParams) {\n this.id = Validate.toResourceId(params.id).orThrow();\n this._resourceTypes = params.resourceTypes;\n this._conditionSets = params.conditionSets;\n this._decisions = params.decisions;\n this._candidates = new ResultMap<string, ResourceCandidate>();\n if (params.typeName) {\n this._resourceType = this._resourceTypes.validating.get(params.typeName).orThrow();\n }\n }\n\n /**\n * Creates a new {@link Resources.ResourceBuilder | ResourceBuilder} object.\n * @param params - Parameters to create a new {@link Resources.ResourceBuilder | ResourceBuilder}.\n * @returns `Success` with the new {@link Resources.ResourceBuilder | ResourceBuilder} object if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public static create(params: IResourceBuilderCreateParams): Result<ResourceBuilder> {\n return captureResult(() => new ResourceBuilder(params));\n }\n\n /**\n * Gets the {@link Resources.ResourceCandidate | candidates} that match a given {@link Context.IValidatedContextDecl | context}.\n * @param context - The {@link Context.IValidatedContextDecl | context} to get candidates for.\n * @param options - Optional {@link Context.IContextMatchOptions | context match options} to use when matching candidates.\n * @returns An array of {@link Resources.ResourceCandidate | candidates} that match the given context.\n */\n public getCandidatesForContext(\n context: Context.IValidatedContextDecl,\n options?: Context.IContextMatchOptions\n ): ReadonlyArray<ResourceCandidate> {\n return Array.from(this._candidates.values()).filter((candidate) =>\n candidate.canMatchPartialContext(context, options)\n );\n }\n\n /**\n * Given a {@link ResourceJson.Json.IChildResourceCandidateDecl | child resource candidate declaration}, creates and adds a\n * {@link Resources.ResourceCandidate | candidate} to the resource being built.\n * @param candidate - The {@link ResourceJson.Json.IChildResourceCandidateDecl | IChildResourceCandidateDecl} to add to the\n * resource being built.\n * @returns `Success` with the added {@link Resources.ResourceCandidate | candidate} if successful,\n * or `Failure` with an error message if not.\n */\n public addChildCandidate(\n childDecl: ResourceJson.Json.IChildResourceCandidateDecl\n ): DetailedResult<ResourceCandidate, ResourceBuilderResultDetail> {\n return ResourceCandidate.create({\n id: this.id,\n resourceType: this._resourceType,\n decl: childDecl,\n conditionSets: this._conditionSets\n })\n .withDetail<ResourceBuilderResultDetail>('failure', 'success')\n .onSuccess((candidate) => {\n return this._candidates\n .getOrAdd(candidate.conditions.toString(), candidate)\n .onSuccess((added, detail) => {\n if (detail === 'exists') {\n if (!ResourceCandidate.equal(added, candidate)) {\n return failWithDetail<ResourceCandidate, Collections.ResultMapResultDetail>(\n `${this.id}: conflicting candidates.`,\n 'exists'\n );\n }\n }\n return succeedWithDetail(added, detail);\n });\n });\n }\n\n /**\n * Given a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration}, creates and adds a\n * {@link Resources.ResourceCandidate | candidate} to the resource being built.\n * @param candidate - The {@link ResourceJson.Json.ILooseResourceCandidateDecl | IResourceCandidateDecl} to add to the\n * resource being built.\n * @returns `Success` with the added {@link Resources.ResourceCandidate | candidate} if successful,\n * or `Failure` with an error message if not. Fails with error detail 'type-mismatch' if the candidate\n * specifies a different resource type than previously added candidates, or with 'exists' if a candidate\n * already exists with the same conditions but different values. Succeeds with 'exists' and returns the\n * existing candidate if the candidate to be added is identical to an existing candidate.\n */\n public addLooseCandidate(\n decl: ResourceJson.Json.ILooseResourceCandidateDecl\n ): DetailedResult<ResourceCandidate, ResourceBuilderResultDetail> {\n /* c8 ignore next 6 - functional code path tested but coverage intermittently missed */\n if (decl.id !== this.id) {\n return failWithDetail<ResourceCandidate, ResourceBuilderResultDetail>(\n `${this.id}: mismatched candidate id ${decl.id}.`,\n 'id-mismatch'\n );\n }\n\n if (decl.resourceTypeName !== undefined) {\n const rt = this.setResourceType(decl.resourceTypeName);\n if (rt.isFailure()) {\n return failWithDetail<ResourceCandidate, ResourceBuilderResultDetail>(rt.message, 'type-mismatch');\n }\n }\n\n return this.addChildCandidate(decl);\n }\n\n /**\n * Sets the resource type for the resource being built. Fails if a resource type has already been set\n * and it does not match the new resource type.\n * @param resourceTypeName - The name of the resource type to set.\n * @returns `Success` with the updated {@link Resources.ResourceBuilder | ResourceBuilder} object if successful,\n * or `Failure` with an error message if not.\n */\n public setResourceType(resourceTypeName: string): Result<ResourceBuilder> {\n if (this._resourceType?.key === resourceTypeName) {\n return succeed(this);\n } else if (this._resourceType !== undefined) {\n return fail(\n `${this.id}: conflicting resource types ${this._resourceType.key} !== ${resourceTypeName}.`\n );\n }\n return this._resourceTypes.validating.get(resourceTypeName).onSuccess((resourceType) => {\n this._resourceType = resourceType;\n return succeedWithDetail(this, 'success');\n });\n }\n\n /**\n * Builds the {@link Resources.Resource | resource} object from this builder.\n * @returns `Success` with the new {@link Resources.Resource | Resource} object if successful,\n * or `Failure` with an error message if not. Fails if no candidates have been added\n * or if the resource type is not defined.\n */\n public build(): Result<Resource> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (this._candidates.size === 0) {\n return fail(`${this.id}: no candidates supplied.`);\n }\n\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (this._resourceType === undefined) {\n return fail(`${this.id}: no resource type supplied or inferred.`);\n }\n\n return Resource.create({\n id: this.id,\n resourceType: this._resourceType,\n candidates: this.candidates,\n decisions: this._decisions\n });\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceCandidate.d.ts","sourceRoot":"","sources":["../../../src/packlets/resources/resourceCandidate.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAgB,aAAa,EAAE,UAAU,EAAE,wBAAwB,EAAY,MAAM,WAAW,CAAC;AACxG,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAsD,MAAM,EAAiB,MAAM,eAAe,CAAC;AAC1G,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,2BAA2B,CAAC;IACpD,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,gBAAgB,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IAC5C,aAAa,EAAE,qBAAqB,CAAC;CACtC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAsB,SAAQ,YAAY,CAAC,OAAO,CAAC,mBAAmB;IACrF;;;OAGG;IACH,kBAAkB,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CACjD;AAED;;;;;GAKG;AACH,qBAAa,iBAAkB,YAAW,kBAAkB;IAC1D;;;OAGG;IACH,SAAgB,EAAE,EAAE,UAAU,CAAC;IAE/B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AS,CAAC,IAAI,CAAC,CAAC;oBACtD,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,kBAAkB,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC;IACtE,CAAC;CACF;AA9PD,8CA8PC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { JsonObject } from '@fgv/ts-json-base';\nimport { PerfectMatch, QualifierName, ResourceId, ResourceValueMergeMethod, Validate } from '../common';\nimport { Condition, ConditionSet, ConditionSetCollector } from '../conditions';\nimport * as ResourceJson from '../resource-json';\nimport { ResourceType } from '../resource-types';\nimport { captureResult, mapResults, Hash, MessageAggregator, Result, fail, succeed } from '@fgv/ts-utils';\nimport * as Context from '../context';\nimport { IResourceCandidate } from '../runtime';\n\n/**\n * Parameters to create a {@link Resources.ResourceCandidate | ResourceCandidate}.\n * @public\n */\nexport interface IResourceCandidateCreateParams {\n id: string;\n decl: ResourceJson.Json.IChildResourceCandidateDecl;\n resourceType?: ResourceType;\n parentConditions?: ReadonlyArray<Condition>;\n conditionSets: ConditionSetCollector;\n}\n\n/**\n * Options for creating a {@link Resources.ResourceCandidate | ResourceCandidate} declaration.\n * @remarks\n * This interface extends the {@link ResourceJson.Helpers.IDeclarationOptions | declaration options}\n * interface to include a `reduceQualifiers` option.\n * @public\n */\nexport interface ICandidateDeclOptions extends ResourceJson.Helpers.IDeclarationOptions {\n /**\n * If provided, reduces the qualifiers of the candidate by removing qualifiers that are made\n * irrelevant by the filterForContext.\n */\n qualifiersToReduce?: ReadonlySet<QualifierName>;\n}\n\n/**\n * A {@link Resources.ResourceCandidate | resource candidate} represents a single possible\n * instance value for some resource, with the conditions under which it applies\n * and instructions on how to merge it with other instances.\n * @public\n */\nexport class ResourceCandidate implements IResourceCandidate {\n /**\n * The unique identifier of the resource for which this candidate\n * is a possible instance.\n */\n public readonly id: ResourceId;\n\n /**\n * The JSON representation of the instance data to be applied.\n */\n public readonly json: JsonObject;\n\n /**\n * The conditions under which this candidate applies.\n */\n public readonly conditions: ConditionSet;\n\n /**\n * True if this candidate is a partial instance.\n */\n public readonly isPartial: boolean;\n\n /**\n * The method to use when merging this candidate with other instances.\n */\n public readonly mergeMethod: ResourceValueMergeMethod;\n\n /**\n * The {@link ResourceTypes.ResourceType | resource type} for the resource to which\n * this candidate belongs.\n */\n public readonly resourceType: ResourceType | undefined;\n\n /**\n * Constructor for a {@link Resources.ResourceCandidate | ResourceCandidate} object.\n * @param params - Parameters to create a new {@link Resources.ResourceCandidate | ResourceCandidate}.\n * @public\n */\n protected constructor(params: IResourceCandidateCreateParams) {\n this.id = Validate.toResourceId(params.id).orThrow();\n this.json = params.decl.json;\n this.conditions = ResourceCandidate._mergeConditions(\n params.conditionSets,\n params.decl.conditions,\n params.parentConditions\n ).orThrow();\n this.isPartial = params.decl.isPartial ?? false;\n this.mergeMethod = params.decl.mergeMethod ?? 'augment';\n this.resourceType = params.resourceType;\n if (this.resourceType) {\n this.resourceType.validateDeclaration(this).orThrow();\n }\n }\n\n /**\n * Creates a new {@link Resources.ResourceCandidate | ResourceCandidate} object.\n * @param params - Parameters to create a new {@link Resources.ResourceCandidate | ResourceCandidate}.\n * @returns `Success` with the new {@link Resources.ResourceCandidate | ResourceCandidate} object if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public static create(params: IResourceCandidateCreateParams): Result<ResourceCandidate> {\n return captureResult(() => new ResourceCandidate(params));\n }\n\n /**\n * Determines if this candidate can match the supplied context (possibly partial).\n * @param context - The context to match.\n * @param options - Options to use when matching.\n * @returns `true` if the candidate can match the context, `false` otherwise.\n */\n public canMatchPartialContext(\n context: Context.IValidatedContextDecl,\n options?: Context.IContextMatchOptions\n ): boolean {\n return this.conditions.canMatchPartialContext(context, options);\n }\n\n /**\n * Gets the {@link ResourceJson.Json.IChildResourceCandidateDecl | child resource candidate declaration}\n * for this candidate.\n * @param options - {@link ResourceJson.Helpers.IDeclarationOptions | options} to use when creating the declaration.\n * @returns The {@link ResourceJson.Json.IChildResourceCandidateDecl | child resource candidate declaration}.\n */\n public toChildResourceCandidateDecl(\n options?: ICandidateDeclOptions\n ): ResourceJson.Json.IChildResourceCandidateDecl {\n const showDefaults = options?.showDefaults === true;\n return {\n json: this.json as JsonObject,\n conditions: this.conditions.toConditionSetRecordDecl(options),\n ...(showDefaults || this.isPartial ? { isPartial: this.isPartial } : {}),\n ...(showDefaults || this.mergeMethod !== 'augment' ? { mergeMethod: this.mergeMethod } : {})\n };\n }\n\n /**\n * Gets the {@link ResourceJson.Json.ILooseResourceCandidateDecl | loose resource candidate declaration}\n * for this candidate.\n * @param options - {@link ResourceJson.Helpers.IDeclarationOptions | options} to use when creating the declaration.\n * @returns The {@link ResourceJson.Json.ILooseResourceCandidateDecl | loose resource candidate declaration}.\n */\n public toLooseResourceCandidateDecl(\n options?: ICandidateDeclOptions\n ): ResourceJson.Json.ILooseResourceCandidateDecl {\n const showDefaults = options?.showDefaults === true;\n const resourceTypeName = this.resourceType?.key;\n return {\n id: this.id.toString(),\n json: this.json as JsonObject,\n conditions: this.conditions.toConditionSetRecordDecl(options),\n ...(showDefaults || this.isPartial ? { isPartial: this.isPartial } : {}),\n ...(showDefaults || this.mergeMethod !== 'augment' ? { mergeMethod: this.mergeMethod } : {}),\n ...(resourceTypeName ? { resourceTypeName } : {})\n };\n }\n\n /**\n * Extracts the {@link ResourceTypes.ResourceType | resource type} from a list of {@link Resources.ResourceCandidate | resource candidates},\n * if present.\n * @param candidates - The list of candidates from which to extract the resource type.\n * @returns `Success` with the resource type if successful, `Success` with `undefined` if none of the candidates\n * specify a resource tap, and `Failure` with an error message if clients specify conflicting resource types.\n * @public\n */\n public static validateResourceTypes(\n candidates: ReadonlyArray<ResourceCandidate>,\n expectedType?: ResourceType\n ): Result<ResourceType | undefined> {\n const errors = new MessageAggregator();\n let selectedType: ResourceType | undefined = expectedType;\n for (const candidate of candidates) {\n if (selectedType === undefined) {\n /* c8 ignore next 1 - functional code path tested but coverage intermittently missed */\n selectedType = candidate.resourceType;\n } else if (candidate.resourceType && selectedType !== candidate.resourceType) {\n /* c8 ignore next 4 - functional code path tested but coverage intermittently missed */\n errors.addMessage(\n `${candidate.id}: resource type mismatch (${selectedType.key} != ${candidate.resourceType.key})`\n );\n }\n }\n return errors.returnOrReport(succeed(selectedType));\n }\n\n /**\n * Compares two {@link Resources.ResourceCandidate | ResourceCandidates} for sorting purposes.\n * @param rc1 - The first candidate to compare.\n * @param rc2 - The second candidate to compare.\n * @returns A negative number if `rc1` should come before `rc2`, a positive number if `rc2` should come before `rc1`,\n * or zero if they are equivalent.\n * @public\n */\n public static compare(rc1: ResourceCandidate, rc2: ResourceCandidate): number {\n return ConditionSet.compare(rc1.conditions, rc2.conditions);\n }\n\n /**\n * Compares two {@link Resources.ResourceCandidate | ResourceCandidates} for equality.\n * @param rc1 - The first candidate to compare.\n * @param rc2 - The second candidate to compare.\n * @returns `true` if the candidates are equal, `false` otherwise.\n * @public\n */\n public static equal(rc1: ResourceCandidate, rc2: ResourceCandidate): boolean {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (rc1 === rc2) {\n return true;\n }\n let equal =\n rc1.id === rc2.id &&\n rc1.isPartial === rc2.isPartial &&\n rc1.mergeMethod === rc2.mergeMethod &&\n ConditionSet.compare(rc1.conditions, rc2.conditions) === 0;\n if (equal) {\n const normalizer = new Hash.Crc32Normalizer();\n const n1 = normalizer.computeHash(rc1.json).orDefault('(n1 normalization failed)');\n const n2 = normalizer.computeHash(rc2.json).orDefault('(n2 normalization failed)');\n equal = n1 === n2;\n }\n return equal;\n }\n\n /**\n * Validates declared conditions and merges them with parent conditions.\n * @param conditionSets - The {@link Conditions.ConditionSetCollector | condition set collector}\n * to use for this candidate.\n * @param declared - The declared conditions for the candidate.\n * @param parent - The parent conditions to merge with the declared conditions.\n * @returns `Success` with the merged conditions if successful, `Failure` otherwise.\n * @internal\n */\n private static _mergeConditions(\n conditionSets: ConditionSetCollector,\n declared: ResourceJson.Json.ConditionSetDecl | undefined,\n parent: ReadonlyArray<Condition> | undefined\n ): Result<ConditionSet> {\n /* c8 ignore next 2 - code coverage is flaky */\n declared = declared ?? {};\n parent = parent ?? [];\n\n const { value: conditionDecls, message } = ResourceJson.Convert.conditionSetDecl.convert(declared);\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (message !== undefined) {\n return fail(message);\n }\n\n return mapResults(\n // get or add all declared conditions from our condition collector\n conditionDecls.map((decl) => conditionSets.conditions.validating.getOrAdd(decl))\n ).onSuccess((declaredConditions) => {\n // make sure our parent conditions all come from our condition collector too\n return mapResults(parent.map((c) => conditionSets.conditions.getOrAdd(c))).onSuccess(\n (parentConditions) => {\n const conditions = [...parentConditions, ...declaredConditions];\n return conditionSets.validating.getOrAdd(conditions);\n }\n );\n });\n }\n\n /**\n * Finds the qualifiers that are made irrelevant by the supplied filterForContext.\n * @param candidates - The candidates to find the reducible qualifiers for.\n * @param filterForContext - The filter for context to use.\n * @returns The qualifiers that are made irrelevant by the filterForContext.\n * @remarks\n * For any given set of candidates, qualifiers that match every candidate perfectly\n * are irrelevant to the filtered content and can be removed. Qualifiers that do not\n * match, that are not in the filterForContext, or which partially match at least one\n * candidate remain relevant and must not be removed.\n * @public\n */\n public static findReducibleQualifiers(\n candidates: ReadonlyArray<ResourceCandidate>,\n filterForContext: Context.IValidatedContextDecl\n ): ReadonlySet<QualifierName> | undefined {\n const qualifiersToReduce = new Set<QualifierName>(Object.keys(filterForContext) as QualifierName[]);\n for (const candidate of candidates) {\n for (const condition of candidate.conditions.conditions) {\n if (qualifiersToReduce.has(condition.qualifier.name)) {\n const match = condition.qualifier.type.matches(\n condition.value,\n filterForContext[condition.qualifier.name],\n 'matches'\n );\n if (match !== PerfectMatch) {\n qualifiersToReduce.delete(condition.qualifier.name);\n }\n }\n }\n }\n return qualifiersToReduce.size > 0 ? qualifiersToReduce : undefined;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceManagerBuilder.d.ts","sourceRoot":"","sources":["../../../src/packlets/resources/resourceManagerBuilder.ts"],"names":[],"mappings":"AAsBA,OAAO,EAEL,WAAW,EACX,cAAc,EAMd,MAAM,EAGN,mBAAmB,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC1B,6BAA6B,EAC9B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,yBAAyB,EAAE,iCAAiC,EAAE,MAAM,cAAc,CAAC;AAC5F,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAW,UAAU,EAAY,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM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