@fgv/ts-res 5.1.0-3 → 5.1.0-30

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 (545) hide show
  1. package/dist/index.browser.js.map +1 -0
  2. package/dist/index.js.map +1 -0
  3. package/dist/packlets/bundle/bundleBuilder.js.map +1 -0
  4. package/dist/packlets/bundle/bundleLoader.js.map +1 -0
  5. package/dist/packlets/bundle/bundleNormalizer.js.map +1 -0
  6. package/dist/packlets/bundle/bundleUtils.js.map +1 -0
  7. package/dist/packlets/bundle/convert.js.map +1 -0
  8. package/dist/packlets/bundle/index.js.map +1 -0
  9. package/dist/packlets/bundle/model.js.map +1 -0
  10. package/dist/packlets/common/conditions.js.map +1 -0
  11. package/dist/packlets/common/convert.js.map +1 -0
  12. package/dist/packlets/common/helpers/conditions.js.map +1 -0
  13. package/dist/packlets/common/helpers/context.js.map +1 -0
  14. package/dist/packlets/common/helpers/index.js.map +1 -0
  15. package/dist/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  16. package/dist/packlets/common/helpers/resources.js +2 -4
  17. package/dist/packlets/common/helpers/resources.js.map +1 -0
  18. package/dist/packlets/common/index.js.map +1 -0
  19. package/dist/packlets/common/resources.js.map +1 -0
  20. package/dist/packlets/common/validate/conditions.js +4 -4
  21. package/dist/packlets/common/validate/conditions.js.map +1 -0
  22. package/dist/packlets/common/validate/index.js.map +1 -0
  23. package/dist/packlets/common/validate/regularExpressions.js +2 -2
  24. package/dist/packlets/common/validate/regularExpressions.js.map +1 -0
  25. package/dist/packlets/common/validate/resources.js +1 -1
  26. package/dist/packlets/common/validate/resources.js.map +1 -0
  27. package/dist/packlets/conditions/condition.js +3 -7
  28. package/dist/packlets/conditions/condition.js.map +1 -0
  29. package/dist/packlets/conditions/conditionCollector.js.map +1 -0
  30. package/dist/packlets/conditions/conditionDecls.js.map +1 -0
  31. package/dist/packlets/conditions/conditionSet.js +14 -5
  32. package/dist/packlets/conditions/conditionSet.js.map +1 -0
  33. package/dist/packlets/conditions/conditionSetCollector.js.map +1 -0
  34. package/dist/packlets/conditions/conditionSetDecls.js.map +1 -0
  35. package/dist/packlets/conditions/conditionToken.js.map +1 -0
  36. package/dist/packlets/conditions/convert/conditionSetDecls.js +50 -6
  37. package/dist/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  38. package/dist/packlets/conditions/convert/decls.js +61 -5
  39. package/dist/packlets/conditions/convert/decls.js.map +1 -0
  40. package/dist/packlets/conditions/convert/index.js.map +1 -0
  41. package/dist/packlets/conditions/index.js.map +1 -0
  42. package/dist/packlets/config/common.js.map +1 -0
  43. package/dist/packlets/config/configInitFactory.js.map +1 -0
  44. package/dist/packlets/config/convert.js.map +1 -0
  45. package/dist/packlets/config/index.browser.js.map +1 -0
  46. package/dist/packlets/config/index.js.map +1 -0
  47. package/dist/packlets/config/json.js.map +1 -0
  48. package/dist/packlets/config/predefined/default.js.map +1 -0
  49. package/dist/packlets/config/predefined/extended.js.map +1 -0
  50. package/dist/packlets/config/predefined/index.js.map +1 -0
  51. package/dist/packlets/config/systemConfiguration.js.map +1 -0
  52. package/dist/packlets/context/contextDecls.js.map +1 -0
  53. package/dist/packlets/context/contextToken.js.map +1 -0
  54. package/dist/packlets/context/convert/decls.js.map +1 -0
  55. package/dist/packlets/context/convert/index.js.map +1 -0
  56. package/dist/packlets/context/index.js.map +1 -0
  57. package/dist/packlets/decisions/abstractDecision.js.map +1 -0
  58. package/dist/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  59. package/dist/packlets/decisions/candidate.js.map +1 -0
  60. package/dist/packlets/decisions/common.js.map +1 -0
  61. package/dist/packlets/decisions/concreteDecision.js.map +1 -0
  62. package/dist/packlets/decisions/decision.js +1 -1
  63. package/dist/packlets/decisions/decision.js.map +1 -0
  64. package/dist/packlets/decisions/index.js.map +1 -0
  65. package/dist/packlets/import/fsItem.js +1 -4
  66. package/dist/packlets/import/fsItem.js.map +1 -0
  67. package/dist/packlets/import/importContext.js +3 -3
  68. package/dist/packlets/import/importContext.js.map +1 -0
  69. package/dist/packlets/import/importManager.js +7 -3
  70. package/dist/packlets/import/importManager.js.map +1 -0
  71. package/dist/packlets/import/importable.js.map +1 -0
  72. package/dist/packlets/import/importers/collectionImporter.js +2 -2
  73. package/dist/packlets/import/importers/collectionImporter.js.map +1 -0
  74. package/dist/packlets/import/importers/fsItemImporter.js +30 -14
  75. package/dist/packlets/import/importers/fsItemImporter.js.map +1 -0
  76. package/dist/packlets/import/importers/importer.js.map +1 -0
  77. package/dist/packlets/import/importers/index.browser.js.map +1 -0
  78. package/dist/packlets/import/importers/index.js.map +1 -0
  79. package/dist/packlets/import/importers/jsonImporter.js +2 -2
  80. package/dist/packlets/import/importers/jsonImporter.js.map +1 -0
  81. package/dist/packlets/import/importers/pathImporter.js +1 -1
  82. package/dist/packlets/import/importers/pathImporter.js.map +1 -0
  83. package/dist/packlets/import/index.browser.js.map +1 -0
  84. package/dist/packlets/import/index.js.map +1 -0
  85. package/dist/packlets/qualifier-types/config/convert.js.map +1 -0
  86. package/dist/packlets/qualifier-types/config/index.js.map +1 -0
  87. package/dist/packlets/qualifier-types/config/json.js.map +1 -0
  88. package/dist/packlets/qualifier-types/convert.js.map +1 -0
  89. package/dist/packlets/qualifier-types/helpers.js.map +1 -0
  90. package/dist/packlets/qualifier-types/index.js.map +1 -0
  91. package/dist/packlets/qualifier-types/languageQualifierType.js +6 -7
  92. package/dist/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  93. package/dist/packlets/qualifier-types/literalQualifierType.js +7 -10
  94. package/dist/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  95. package/dist/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  96. package/dist/packlets/qualifier-types/qualifierType.js +12 -13
  97. package/dist/packlets/qualifier-types/qualifierType.js.map +1 -0
  98. package/dist/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  99. package/dist/packlets/qualifier-types/territoryQualifierType.js +5 -5
  100. package/dist/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  101. package/dist/packlets/qualifiers/convert/decls.js.map +1 -0
  102. package/dist/packlets/qualifiers/convert/index.js.map +1 -0
  103. package/dist/packlets/qualifiers/convert/qualifier.js.map +1 -0
  104. package/dist/packlets/qualifiers/index.js.map +1 -0
  105. package/dist/packlets/qualifiers/qualifier.js +6 -7
  106. package/dist/packlets/qualifiers/qualifier.js.map +1 -0
  107. package/dist/packlets/qualifiers/qualifierCollector.js +153 -9
  108. package/dist/packlets/qualifiers/qualifierCollector.js.map +1 -0
  109. package/dist/packlets/qualifiers/qualifierDecl.js.map +1 -0
  110. package/dist/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  111. package/dist/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  112. package/dist/packlets/resource-json/compiled/common.js.map +1 -0
  113. package/dist/packlets/resource-json/compiled/convert.js.map +1 -0
  114. package/dist/packlets/resource-json/compiled/index.js.map +1 -0
  115. package/dist/packlets/resource-json/compiled/json.js.map +1 -0
  116. package/dist/packlets/resource-json/convert.js +225 -0
  117. package/dist/packlets/resource-json/convert.js.map +1 -0
  118. package/dist/packlets/resource-json/helpers.js.map +1 -0
  119. package/dist/packlets/resource-json/index.js.map +1 -0
  120. package/dist/packlets/resource-json/json.js +2 -2
  121. package/dist/packlets/resource-json/json.js.map +1 -0
  122. package/dist/packlets/resource-json/normalized.js.map +1 -0
  123. package/dist/packlets/resource-json/resourceDeclCollection.js +1 -1
  124. package/dist/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  125. package/dist/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  126. package/dist/packlets/resource-json/resourceDeclTree.js +1 -1
  127. package/dist/packlets/resource-json/resourceDeclTree.js.map +1 -0
  128. package/dist/packlets/resource-types/config/convert.js.map +1 -0
  129. package/dist/packlets/resource-types/config/index.js.map +1 -0
  130. package/dist/packlets/resource-types/config/json.js.map +1 -0
  131. package/dist/packlets/resource-types/helpers.js.map +1 -0
  132. package/dist/packlets/resource-types/index.js.map +1 -0
  133. package/dist/packlets/resource-types/jsonResourceType.js +2 -2
  134. package/dist/packlets/resource-types/jsonResourceType.js.map +1 -0
  135. package/dist/packlets/resource-types/resourceType.js +2 -2
  136. package/dist/packlets/resource-types/resourceType.js.map +1 -0
  137. package/dist/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  138. package/dist/packlets/resources/candidateReducer.js.map +1 -0
  139. package/dist/packlets/resources/candidateValue.js.map +1 -0
  140. package/dist/packlets/resources/candidateValueCollector.js.map +1 -0
  141. package/dist/packlets/resources/common.js.map +1 -0
  142. package/dist/packlets/resources/deltaGenerator.js.map +1 -0
  143. package/dist/packlets/resources/index.js.map +1 -0
  144. package/dist/packlets/resources/resource.js.map +1 -0
  145. package/dist/packlets/resources/resourceBuilder.js +2 -2
  146. package/dist/packlets/resources/resourceBuilder.js.map +1 -0
  147. package/dist/packlets/resources/resourceCandidate.js.map +1 -0
  148. package/dist/packlets/resources/resourceManagerBuilder.js +5 -5
  149. package/dist/packlets/resources/resourceManagerBuilder.js.map +1 -0
  150. package/dist/packlets/runtime/cacheListener.js.map +1 -0
  151. package/dist/packlets/runtime/cacheMetrics.js.map +1 -0
  152. package/dist/packlets/runtime/compiledResourceCollection.js +5 -5
  153. package/dist/packlets/runtime/compiledResourceCollection.js.map +1 -0
  154. package/dist/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  155. package/dist/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  156. package/dist/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  157. package/dist/packlets/runtime/context/index.js.map +1 -0
  158. package/dist/packlets/runtime/context/simpleContextQualifierProvider.js +3 -0
  159. package/dist/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  160. package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +3 -5
  161. package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  162. package/dist/packlets/runtime/iResourceManager.js.map +1 -0
  163. package/dist/packlets/runtime/index.js.map +1 -0
  164. package/dist/packlets/runtime/resource-tree/common.js.map +1 -0
  165. package/dist/packlets/runtime/resource-tree/index.js.map +1 -0
  166. package/dist/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  167. package/dist/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  168. package/dist/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  169. package/dist/packlets/runtime/resourceResolver.js.map +1 -0
  170. package/dist/packlets/runtime/resourceTreeResolver.js.map +1 -0
  171. package/dist/packlets/runtime/validate.js.map +1 -0
  172. package/dist/packlets/zip-archive/convert.js.map +1 -0
  173. package/dist/packlets/zip-archive/index.browser.js.map +1 -0
  174. package/dist/packlets/zip-archive/index.js.map +1 -0
  175. package/dist/packlets/zip-archive/json.js.map +1 -0
  176. package/dist/packlets/zip-archive/types.js.map +1 -0
  177. package/dist/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  178. package/dist/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  179. package/dist/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  180. package/dist/ts-res.d.ts +576 -164
  181. package/dist/tsdoc-metadata.json +1 -1
  182. package/lib/index.browser.d.ts.map +1 -0
  183. package/lib/index.browser.js.map +1 -0
  184. package/lib/index.d.ts.map +1 -0
  185. package/lib/index.js.map +1 -0
  186. package/lib/packlets/bundle/bundleBuilder.d.ts.map +1 -0
  187. package/lib/packlets/bundle/bundleBuilder.js.map +1 -0
  188. package/lib/packlets/bundle/bundleLoader.d.ts.map +1 -0
  189. package/lib/packlets/bundle/bundleLoader.js.map +1 -0
  190. package/lib/packlets/bundle/bundleNormalizer.d.ts.map +1 -0
  191. package/lib/packlets/bundle/bundleNormalizer.js.map +1 -0
  192. package/lib/packlets/bundle/bundleUtils.d.ts.map +1 -0
  193. package/lib/packlets/bundle/bundleUtils.js.map +1 -0
  194. package/lib/packlets/bundle/convert.d.ts.map +1 -0
  195. package/lib/packlets/bundle/convert.js.map +1 -0
  196. package/lib/packlets/bundle/index.d.ts.map +1 -0
  197. package/lib/packlets/bundle/index.js.map +1 -0
  198. package/lib/packlets/bundle/model.d.ts.map +1 -0
  199. package/lib/packlets/bundle/model.js.map +1 -0
  200. package/lib/packlets/common/conditions.d.ts.map +1 -0
  201. package/lib/packlets/common/conditions.js.map +1 -0
  202. package/lib/packlets/common/convert.d.ts.map +1 -0
  203. package/lib/packlets/common/convert.js.map +1 -0
  204. package/lib/packlets/common/helpers/conditions.d.ts.map +1 -0
  205. package/lib/packlets/common/helpers/conditions.js.map +1 -0
  206. package/lib/packlets/common/helpers/context.d.ts.map +1 -0
  207. package/lib/packlets/common/helpers/context.js.map +1 -0
  208. package/lib/packlets/common/helpers/index.d.ts.map +1 -0
  209. package/lib/packlets/common/helpers/index.js.map +1 -0
  210. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +1 -0
  211. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  212. package/lib/packlets/common/helpers/resources.d.ts +2 -4
  213. package/lib/packlets/common/helpers/resources.d.ts.map +1 -0
  214. package/lib/packlets/common/helpers/resources.js +2 -4
  215. package/lib/packlets/common/helpers/resources.js.map +1 -0
  216. package/lib/packlets/common/index.d.ts.map +1 -0
  217. package/lib/packlets/common/index.js.map +1 -0
  218. package/lib/packlets/common/resources.d.ts.map +1 -0
  219. package/lib/packlets/common/resources.js.map +1 -0
  220. package/lib/packlets/common/validate/conditions.d.ts +4 -4
  221. package/lib/packlets/common/validate/conditions.d.ts.map +1 -0
  222. package/lib/packlets/common/validate/conditions.js +4 -4
  223. package/lib/packlets/common/validate/conditions.js.map +1 -0
  224. package/lib/packlets/common/validate/index.d.ts.map +1 -0
  225. package/lib/packlets/common/validate/index.js.map +1 -0
  226. package/lib/packlets/common/validate/regularExpressions.d.ts +2 -2
  227. package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -0
  228. package/lib/packlets/common/validate/regularExpressions.js +2 -2
  229. package/lib/packlets/common/validate/regularExpressions.js.map +1 -0
  230. package/lib/packlets/common/validate/resources.d.ts +1 -1
  231. package/lib/packlets/common/validate/resources.d.ts.map +1 -0
  232. package/lib/packlets/common/validate/resources.js +1 -1
  233. package/lib/packlets/common/validate/resources.js.map +1 -0
  234. package/lib/packlets/conditions/condition.d.ts +3 -7
  235. package/lib/packlets/conditions/condition.d.ts.map +1 -0
  236. package/lib/packlets/conditions/condition.js +3 -7
  237. package/lib/packlets/conditions/condition.js.map +1 -0
  238. package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -0
  239. package/lib/packlets/conditions/conditionCollector.js.map +1 -0
  240. package/lib/packlets/conditions/conditionDecls.d.ts +6 -1
  241. package/lib/packlets/conditions/conditionDecls.d.ts.map +1 -0
  242. package/lib/packlets/conditions/conditionDecls.js.map +1 -0
  243. package/lib/packlets/conditions/conditionSet.d.ts.map +1 -0
  244. package/lib/packlets/conditions/conditionSet.js +14 -5
  245. package/lib/packlets/conditions/conditionSet.js.map +1 -0
  246. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -0
  247. package/lib/packlets/conditions/conditionSetCollector.js.map +1 -0
  248. package/lib/packlets/conditions/conditionSetDecls.d.ts +7 -2
  249. package/lib/packlets/conditions/conditionSetDecls.d.ts.map +1 -0
  250. package/lib/packlets/conditions/conditionSetDecls.js.map +1 -0
  251. package/lib/packlets/conditions/conditionToken.d.ts.map +1 -0
  252. package/lib/packlets/conditions/conditionToken.js.map +1 -0
  253. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts +30 -2
  254. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +1 -0
  255. package/lib/packlets/conditions/convert/conditionSetDecls.js +51 -5
  256. package/lib/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  257. package/lib/packlets/conditions/convert/decls.d.ts +39 -3
  258. package/lib/packlets/conditions/convert/decls.d.ts.map +1 -0
  259. package/lib/packlets/conditions/convert/decls.js +63 -5
  260. package/lib/packlets/conditions/convert/decls.js.map +1 -0
  261. package/lib/packlets/conditions/convert/index.d.ts.map +1 -0
  262. package/lib/packlets/conditions/convert/index.js.map +1 -0
  263. package/lib/packlets/conditions/index.d.ts.map +1 -0
  264. package/lib/packlets/conditions/index.js.map +1 -0
  265. package/lib/packlets/config/common.d.ts.map +1 -0
  266. package/lib/packlets/config/common.js.map +1 -0
  267. package/lib/packlets/config/configInitFactory.d.ts.map +1 -0
  268. package/lib/packlets/config/configInitFactory.js.map +1 -0
  269. package/lib/packlets/config/convert.d.ts.map +1 -0
  270. package/lib/packlets/config/convert.js.map +1 -0
  271. package/lib/packlets/config/index.browser.d.ts.map +1 -0
  272. package/lib/packlets/config/index.browser.js.map +1 -0
  273. package/lib/packlets/config/index.d.ts.map +1 -0
  274. package/lib/packlets/config/index.js.map +1 -0
  275. package/lib/packlets/config/json.d.ts.map +1 -0
  276. package/lib/packlets/config/json.js.map +1 -0
  277. package/lib/packlets/config/predefined/default.d.ts.map +1 -0
  278. package/lib/packlets/config/predefined/default.js.map +1 -0
  279. package/lib/packlets/config/predefined/extended.d.ts.map +1 -0
  280. package/lib/packlets/config/predefined/extended.js.map +1 -0
  281. package/lib/packlets/config/predefined/index.d.ts.map +1 -0
  282. package/lib/packlets/config/predefined/index.js.map +1 -0
  283. package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
  284. package/lib/packlets/config/systemConfiguration.js.map +1 -0
  285. package/lib/packlets/context/contextDecls.d.ts.map +1 -0
  286. package/lib/packlets/context/contextDecls.js.map +1 -0
  287. package/lib/packlets/context/contextToken.d.ts.map +1 -0
  288. package/lib/packlets/context/contextToken.js.map +1 -0
  289. package/lib/packlets/context/convert/decls.d.ts.map +1 -0
  290. package/lib/packlets/context/convert/decls.js.map +1 -0
  291. package/lib/packlets/context/convert/index.d.ts.map +1 -0
  292. package/lib/packlets/context/convert/index.js.map +1 -0
  293. package/lib/packlets/context/index.d.ts.map +1 -0
  294. package/lib/packlets/context/index.js.map +1 -0
  295. package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -0
  296. package/lib/packlets/decisions/abstractDecision.js.map +1 -0
  297. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -0
  298. package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  299. package/lib/packlets/decisions/candidate.d.ts.map +1 -0
  300. package/lib/packlets/decisions/candidate.js.map +1 -0
  301. package/lib/packlets/decisions/common.d.ts.map +1 -0
  302. package/lib/packlets/decisions/common.js.map +1 -0
  303. package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -0
  304. package/lib/packlets/decisions/concreteDecision.js.map +1 -0
  305. package/lib/packlets/decisions/decision.d.ts +1 -1
  306. package/lib/packlets/decisions/decision.d.ts.map +1 -0
  307. package/lib/packlets/decisions/decision.js +1 -1
  308. package/lib/packlets/decisions/decision.js.map +1 -0
  309. package/lib/packlets/decisions/index.d.ts.map +1 -0
  310. package/lib/packlets/decisions/index.js.map +1 -0
  311. package/lib/packlets/import/fsItem.d.ts +1 -4
  312. package/lib/packlets/import/fsItem.d.ts.map +1 -0
  313. package/lib/packlets/import/fsItem.js +1 -4
  314. package/lib/packlets/import/fsItem.js.map +1 -0
  315. package/lib/packlets/import/importContext.d.ts +5 -5
  316. package/lib/packlets/import/importContext.d.ts.map +1 -0
  317. package/lib/packlets/import/importContext.js +3 -3
  318. package/lib/packlets/import/importContext.js.map +1 -0
  319. package/lib/packlets/import/importManager.d.ts +15 -1
  320. package/lib/packlets/import/importManager.d.ts.map +1 -0
  321. package/lib/packlets/import/importManager.js +7 -3
  322. package/lib/packlets/import/importManager.js.map +1 -0
  323. package/lib/packlets/import/importable.d.ts.map +1 -0
  324. package/lib/packlets/import/importable.js.map +1 -0
  325. package/lib/packlets/import/importers/collectionImporter.d.ts +2 -2
  326. package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -0
  327. package/lib/packlets/import/importers/collectionImporter.js +2 -2
  328. package/lib/packlets/import/importers/collectionImporter.js.map +1 -0
  329. package/lib/packlets/import/importers/fsItemImporter.d.ts +16 -2
  330. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -0
  331. package/lib/packlets/import/importers/fsItemImporter.js +29 -13
  332. package/lib/packlets/import/importers/fsItemImporter.js.map +1 -0
  333. package/lib/packlets/import/importers/importer.d.ts.map +1 -0
  334. package/lib/packlets/import/importers/importer.js.map +1 -0
  335. package/lib/packlets/import/importers/index.browser.d.ts.map +1 -0
  336. package/lib/packlets/import/importers/index.browser.js.map +1 -0
  337. package/lib/packlets/import/importers/index.d.ts.map +1 -0
  338. package/lib/packlets/import/importers/index.js.map +1 -0
  339. package/lib/packlets/import/importers/jsonImporter.d.ts +2 -2
  340. package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -0
  341. package/lib/packlets/import/importers/jsonImporter.js +2 -2
  342. package/lib/packlets/import/importers/jsonImporter.js.map +1 -0
  343. package/lib/packlets/import/importers/pathImporter.d.ts +1 -1
  344. package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -0
  345. package/lib/packlets/import/importers/pathImporter.js +1 -1
  346. package/lib/packlets/import/importers/pathImporter.js.map +1 -0
  347. package/lib/packlets/import/index.browser.d.ts.map +1 -0
  348. package/lib/packlets/import/index.browser.js.map +1 -0
  349. package/lib/packlets/import/index.d.ts.map +1 -0
  350. package/lib/packlets/import/index.js.map +1 -0
  351. package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
  352. package/lib/packlets/qualifier-types/config/convert.js.map +1 -0
  353. package/lib/packlets/qualifier-types/config/index.d.ts.map +1 -0
  354. package/lib/packlets/qualifier-types/config/index.js.map +1 -0
  355. package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
  356. package/lib/packlets/qualifier-types/config/json.js.map +1 -0
  357. package/lib/packlets/qualifier-types/convert.d.ts.map +1 -0
  358. package/lib/packlets/qualifier-types/convert.js.map +1 -0
  359. package/lib/packlets/qualifier-types/helpers.d.ts.map +1 -0
  360. package/lib/packlets/qualifier-types/helpers.js.map +1 -0
  361. package/lib/packlets/qualifier-types/index.d.ts.map +1 -0
  362. package/lib/packlets/qualifier-types/index.js.map +1 -0
  363. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +6 -7
  364. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -0
  365. package/lib/packlets/qualifier-types/languageQualifierType.js +6 -7
  366. package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  367. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +7 -10
  368. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -0
  369. package/lib/packlets/qualifier-types/literalQualifierType.js +7 -10
  370. package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  371. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
  372. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  373. package/lib/packlets/qualifier-types/qualifierType.d.ts +17 -18
  374. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -0
  375. package/lib/packlets/qualifier-types/qualifierType.js +12 -13
  376. package/lib/packlets/qualifier-types/qualifierType.js.map +1 -0
  377. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -0
  378. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  379. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +8 -8
  380. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -0
  381. package/lib/packlets/qualifier-types/territoryQualifierType.js +5 -5
  382. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  383. package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -0
  384. package/lib/packlets/qualifiers/convert/decls.js.map +1 -0
  385. package/lib/packlets/qualifiers/convert/index.d.ts.map +1 -0
  386. package/lib/packlets/qualifiers/convert/index.js.map +1 -0
  387. package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +1 -0
  388. package/lib/packlets/qualifiers/convert/qualifier.js.map +1 -0
  389. package/lib/packlets/qualifiers/index.d.ts.map +1 -0
  390. package/lib/packlets/qualifiers/index.js.map +1 -0
  391. package/lib/packlets/qualifiers/qualifier.d.ts +6 -7
  392. package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -0
  393. package/lib/packlets/qualifiers/qualifier.js +6 -7
  394. package/lib/packlets/qualifiers/qualifier.js.map +1 -0
  395. package/lib/packlets/qualifiers/qualifierCollector.d.ts +107 -9
  396. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -0
  397. package/lib/packlets/qualifiers/qualifierCollector.js +152 -8
  398. package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -0
  399. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -0
  400. package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -0
  401. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +1 -0
  402. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  403. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +1 -0
  404. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  405. package/lib/packlets/resource-json/compiled/common.d.ts.map +1 -0
  406. package/lib/packlets/resource-json/compiled/common.js.map +1 -0
  407. package/lib/packlets/resource-json/compiled/convert.d.ts.map +1 -0
  408. package/lib/packlets/resource-json/compiled/convert.js.map +1 -0
  409. package/lib/packlets/resource-json/compiled/index.d.ts.map +1 -0
  410. package/lib/packlets/resource-json/compiled/index.js.map +1 -0
  411. package/lib/packlets/resource-json/compiled/json.d.ts.map +1 -0
  412. package/lib/packlets/resource-json/compiled/json.js.map +1 -0
  413. package/lib/packlets/resource-json/convert.d.ts +85 -0
  414. package/lib/packlets/resource-json/convert.d.ts.map +1 -0
  415. package/lib/packlets/resource-json/convert.js +237 -0
  416. package/lib/packlets/resource-json/convert.js.map +1 -0
  417. package/lib/packlets/resource-json/helpers.d.ts.map +1 -0
  418. package/lib/packlets/resource-json/helpers.js.map +1 -0
  419. package/lib/packlets/resource-json/index.d.ts.map +1 -0
  420. package/lib/packlets/resource-json/index.js.map +1 -0
  421. package/lib/packlets/resource-json/json.d.ts +128 -39
  422. package/lib/packlets/resource-json/json.d.ts.map +1 -0
  423. package/lib/packlets/resource-json/json.js +2 -2
  424. package/lib/packlets/resource-json/json.js.map +1 -0
  425. package/lib/packlets/resource-json/normalized.d.ts.map +1 -0
  426. package/lib/packlets/resource-json/normalized.js.map +1 -0
  427. package/lib/packlets/resource-json/resourceDeclCollection.d.ts +1 -1
  428. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -0
  429. package/lib/packlets/resource-json/resourceDeclCollection.js +1 -1
  430. package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  431. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -0
  432. package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  433. package/lib/packlets/resource-json/resourceDeclTree.d.ts +1 -1
  434. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -0
  435. package/lib/packlets/resource-json/resourceDeclTree.js +1 -1
  436. package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -0
  437. package/lib/packlets/resource-types/config/convert.d.ts.map +1 -0
  438. package/lib/packlets/resource-types/config/convert.js.map +1 -0
  439. package/lib/packlets/resource-types/config/index.d.ts.map +1 -0
  440. package/lib/packlets/resource-types/config/index.js.map +1 -0
  441. package/lib/packlets/resource-types/config/json.d.ts.map +1 -0
  442. package/lib/packlets/resource-types/config/json.js.map +1 -0
  443. package/lib/packlets/resource-types/helpers.d.ts.map +1 -0
  444. package/lib/packlets/resource-types/helpers.js.map +1 -0
  445. package/lib/packlets/resource-types/index.d.ts.map +1 -0
  446. package/lib/packlets/resource-types/index.js.map +1 -0
  447. package/lib/packlets/resource-types/jsonResourceType.d.ts +17 -5
  448. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -0
  449. package/lib/packlets/resource-types/jsonResourceType.js +2 -2
  450. package/lib/packlets/resource-types/jsonResourceType.js.map +1 -0
  451. package/lib/packlets/resource-types/resourceType.d.ts +5 -5
  452. package/lib/packlets/resource-types/resourceType.d.ts.map +1 -0
  453. package/lib/packlets/resource-types/resourceType.js +2 -2
  454. package/lib/packlets/resource-types/resourceType.js.map +1 -0
  455. package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +1 -0
  456. package/lib/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  457. package/lib/packlets/resources/candidateReducer.d.ts.map +1 -0
  458. package/lib/packlets/resources/candidateReducer.js.map +1 -0
  459. package/lib/packlets/resources/candidateValue.d.ts.map +1 -0
  460. package/lib/packlets/resources/candidateValue.js.map +1 -0
  461. package/lib/packlets/resources/candidateValueCollector.d.ts.map +1 -0
  462. package/lib/packlets/resources/candidateValueCollector.js.map +1 -0
  463. package/lib/packlets/resources/common.d.ts.map +1 -0
  464. package/lib/packlets/resources/common.js.map +1 -0
  465. package/lib/packlets/resources/deltaGenerator.d.ts.map +1 -0
  466. package/lib/packlets/resources/deltaGenerator.js.map +1 -0
  467. package/lib/packlets/resources/index.d.ts.map +1 -0
  468. package/lib/packlets/resources/index.js.map +1 -0
  469. package/lib/packlets/resources/resource.d.ts.map +1 -0
  470. package/lib/packlets/resources/resource.js.map +1 -0
  471. package/lib/packlets/resources/resourceBuilder.d.ts +2 -2
  472. package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -0
  473. package/lib/packlets/resources/resourceBuilder.js +2 -2
  474. package/lib/packlets/resources/resourceBuilder.js.map +1 -0
  475. package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -0
  476. package/lib/packlets/resources/resourceCandidate.js.map +1 -0
  477. package/lib/packlets/resources/resourceManagerBuilder.d.ts +5 -5
  478. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
  479. package/lib/packlets/resources/resourceManagerBuilder.js +5 -5
  480. package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -0
  481. package/lib/packlets/runtime/cacheListener.d.ts.map +1 -0
  482. package/lib/packlets/runtime/cacheListener.js.map +1 -0
  483. package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -0
  484. package/lib/packlets/runtime/cacheMetrics.js.map +1 -0
  485. package/lib/packlets/runtime/compiledResourceCollection.d.ts +5 -5
  486. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
  487. package/lib/packlets/runtime/compiledResourceCollection.js +5 -5
  488. package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -0
  489. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +1 -0
  490. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  491. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +1 -0
  492. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  493. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +1 -0
  494. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  495. package/lib/packlets/runtime/context/index.d.ts.map +1 -0
  496. package/lib/packlets/runtime/context/index.js.map +1 -0
  497. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +9 -2
  498. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -0
  499. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +3 -0
  500. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  501. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +8 -1
  502. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -0
  503. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +3 -5
  504. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  505. package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -0
  506. package/lib/packlets/runtime/iResourceManager.js.map +1 -0
  507. package/lib/packlets/runtime/index.d.ts.map +1 -0
  508. package/lib/packlets/runtime/index.js.map +1 -0
  509. package/lib/packlets/runtime/resource-tree/common.d.ts.map +1 -0
  510. package/lib/packlets/runtime/resource-tree/common.js.map +1 -0
  511. package/lib/packlets/runtime/resource-tree/index.d.ts.map +1 -0
  512. package/lib/packlets/runtime/resource-tree/index.js.map +1 -0
  513. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +1 -0
  514. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  515. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +1 -0
  516. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  517. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +1 -0
  518. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  519. package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -0
  520. package/lib/packlets/runtime/resourceResolver.js.map +1 -0
  521. package/lib/packlets/runtime/resourceTreeResolver.d.ts.map +1 -0
  522. package/lib/packlets/runtime/resourceTreeResolver.js.map +1 -0
  523. package/lib/packlets/runtime/validate.d.ts.map +1 -0
  524. package/lib/packlets/runtime/validate.js.map +1 -0
  525. package/lib/packlets/zip-archive/convert.d.ts.map +1 -0
  526. package/lib/packlets/zip-archive/convert.js.map +1 -0
  527. package/lib/packlets/zip-archive/index.browser.d.ts.map +1 -0
  528. package/lib/packlets/zip-archive/index.browser.js.map +1 -0
  529. package/lib/packlets/zip-archive/index.d.ts.map +1 -0
  530. package/lib/packlets/zip-archive/index.js.map +1 -0
  531. package/lib/packlets/zip-archive/json.d.ts.map +1 -0
  532. package/lib/packlets/zip-archive/json.js.map +1 -0
  533. package/lib/packlets/zip-archive/types.d.ts.map +1 -0
  534. package/lib/packlets/zip-archive/types.js.map +1 -0
  535. package/lib/packlets/zip-archive/zipArchiveCreator.d.ts.map +1 -0
  536. package/lib/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  537. package/lib/packlets/zip-archive/zipArchiveFormat.d.ts.map +1 -0
  538. package/lib/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  539. package/lib/packlets/zip-archive/zipArchiveLoader.d.ts.map +1 -0
  540. package/lib/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  541. package/package.json +12 -10
  542. package/dist/test/data/sample.json +0 -32
  543. package/dist/test/unit/qualifier-types/testQualifierType.js +0 -76
  544. package/dist/test/unit/resource-types/testDerivedResourceType.js +0 -109
  545. package/dist/test/unit/resources/deltaGenerator.helpers.js +0 -282
@@ -168,4 +168,229 @@ export const importerResourceCollectionDecl = Converters.generic((from, self, co
168
168
  metadata: JsonConverters.jsonObject.optional()
169
169
  }).convert(from, context);
170
170
  });
171
+ // --- Typed sibling converters (Phase B-2) -----------------------------------
172
+ //
173
+ // Each `typed*<TQualifierNames>(qualifierNameConverter)` returns a converter
174
+ // whose result type is narrowed on `TQualifierNames`. The existing untyped
175
+ // exports above remain unchanged at the signature and behavior level; consumers
176
+ // opt in by calling a typed sibling. Internally each typed factory composes
177
+ // lower-level typed factories so a single `qualifierNameConverter` flows
178
+ // end-to-end through the converter tree.
179
+ //
180
+ // DRIFT HAZARD: each typed sibling duplicates the field list of its untyped
181
+ // twin (the duplication exists to preserve `ObjectConverter` return types on
182
+ // the defaults — see phase-b2-result.md). If a field is added, removed, or
183
+ // re-typed on an untyped converter above, the typed sibling MUST be updated
184
+ // in lockstep. The per-pair `keep in sync with X` markers below flag each
185
+ // pair at the call site.
186
+ /**
187
+ * Returns a `Converter` for a `Json.ILooseConditionDecl<TQualifierNames>`
188
+ * narrowed on a supplied `qualifierName` converter.
189
+ *
190
+ * @public
191
+ */
192
+ // Keep in sync with `looseConditionDecl` above.
193
+ export function typedLooseConditionDecl(qualifierNameConverter) {
194
+ return Converters.strictObject({
195
+ qualifierName: qualifierNameConverter,
196
+ value: Converters.string,
197
+ operator: CommonConvert.conditionOperator.optional(),
198
+ priority: CommonConvert.conditionPriority.optional(),
199
+ scoreAsDefault: Converters.number.optional()
200
+ });
201
+ }
202
+ function _typedConditionSetDeclFromArray(innerLooseConditionDecl) {
203
+ return Converters.arrayOf(innerLooseConditionDecl);
204
+ }
205
+ function _typedConditionSetDeclFromRecord(innerLooseConditionDecl) {
206
+ return Converters.generic((from, __self, context) => {
207
+ /* c8 ignore next 3 - branch covered by underlying record check */
208
+ if (!_isConditionSetRecord(from)) {
209
+ return fail('Expected an object');
210
+ }
211
+ return mapResults(Array.from(Object.entries(from)).map(([qualifierName, value]) => {
212
+ const toConvert = typeof value === 'string' ? { qualifierName, value } : Object.assign({ qualifierName }, value);
213
+ return innerLooseConditionDecl.convert(toConvert, context);
214
+ }));
215
+ });
216
+ }
217
+ /**
218
+ * Returns a `Converter` for a `Json.ConditionSetDecl<TQualifierNames>`
219
+ * (either array form or record form) narrowed on a supplied `qualifierName`
220
+ * converter.
221
+ *
222
+ * @public
223
+ */
224
+ // Keep in sync with `conditionSetDecl` (and its two private feeder converters
225
+ // `conditionSetDeclFromArray` / `conditionSetDeclFromRecord`) above.
226
+ export function typedConditionSetDecl(qualifierNameConverter) {
227
+ const inner = typedLooseConditionDecl(qualifierNameConverter);
228
+ return Converters.oneOf([
229
+ _typedConditionSetDeclFromArray(inner),
230
+ _typedConditionSetDeclFromRecord(inner)
231
+ ]);
232
+ }
233
+ /**
234
+ * Returns a `Converter` for a `Json.ILooseResourceCandidateDecl<TQualifierNames>`
235
+ * narrowed on a supplied `qualifierName` converter.
236
+ *
237
+ * @public
238
+ */
239
+ // Keep in sync with `looseResourceCandidateDecl` above.
240
+ export function typedLooseResourceCandidateDecl(qualifierNameConverter) {
241
+ return Converters.strictObject({
242
+ id: CommonConvert.resourceId,
243
+ json: JsonConverters.jsonObject,
244
+ conditions: typedConditionSetDecl(qualifierNameConverter).optional(),
245
+ mergeMethod: CommonConvert.resourceValueMergeMethod.optional(),
246
+ isPartial: Converters.boolean.optional(),
247
+ resourceTypeName: CommonConvert.resourceTypeName.optional()
248
+ });
249
+ }
250
+ /**
251
+ * Returns a `Converter` for a `Json.IImporterResourceCandidateDecl<TQualifierNames>`
252
+ * narrowed on a supplied `qualifierName` converter.
253
+ *
254
+ * @public
255
+ */
256
+ // Keep in sync with `importerResourceCandidateDecl` above.
257
+ export function typedImporterResourceCandidateDecl(qualifierNameConverter) {
258
+ return Converters.strictObject({
259
+ id: CommonConvert.resourceId.optional(),
260
+ json: JsonConverters.jsonObject,
261
+ conditions: typedConditionSetDecl(qualifierNameConverter).optional(),
262
+ mergeMethod: CommonConvert.resourceValueMergeMethod.optional(),
263
+ isPartial: Converters.boolean.optional(),
264
+ resourceTypeName: CommonConvert.resourceTypeName.optional()
265
+ });
266
+ }
267
+ /**
268
+ * Returns a `Converter` for a `Json.IChildResourceCandidateDecl<TQualifierNames>`
269
+ * narrowed on a supplied `qualifierName` converter.
270
+ *
271
+ * @public
272
+ */
273
+ // Keep in sync with `childResourceCandidateDecl` above.
274
+ export function typedChildResourceCandidateDecl(qualifierNameConverter) {
275
+ return Converters.strictObject({
276
+ json: JsonConverters.jsonObject,
277
+ conditions: typedConditionSetDecl(qualifierNameConverter).optional(),
278
+ isPartial: Converters.boolean.optional(),
279
+ mergeMethod: CommonConvert.resourceValueMergeMethod.optional()
280
+ });
281
+ }
282
+ /**
283
+ * Returns a `Converter` for a `Json.ILooseResourceDecl<TQualifierNames>`
284
+ * narrowed on a supplied `qualifierName` converter.
285
+ *
286
+ * @public
287
+ */
288
+ // Keep in sync with `looseResourceDecl` above.
289
+ export function typedLooseResourceDecl(qualifierNameConverter) {
290
+ return Converters.strictObject({
291
+ id: CommonConvert.resourceId,
292
+ resourceTypeName: CommonConvert.resourceTypeName,
293
+ candidates: Converters.arrayOf(typedChildResourceCandidateDecl(qualifierNameConverter)).optional()
294
+ });
295
+ }
296
+ /**
297
+ * Returns a `Converter` for a `Json.IChildResourceDecl<TQualifierNames>`
298
+ * narrowed on a supplied `qualifierName` converter.
299
+ *
300
+ * @public
301
+ */
302
+ // Keep in sync with `childResourceDecl` above.
303
+ export function typedChildResourceDecl(qualifierNameConverter) {
304
+ return Converters.strictObject({
305
+ resourceTypeName: CommonConvert.resourceTypeName,
306
+ candidates: Converters.arrayOf(typedChildResourceCandidateDecl(qualifierNameConverter)).optional()
307
+ });
308
+ }
309
+ /**
310
+ * Returns a `Converter` for a `Json.IContainerContextDecl<TQualifierNames>`
311
+ * narrowed on a supplied `qualifierName` converter.
312
+ *
313
+ * @public
314
+ */
315
+ // Keep in sync with `containerContextDecl` above.
316
+ export function typedContainerContextDecl(qualifierNameConverter) {
317
+ return Converters.strictObject({
318
+ baseId: Converters.oneOf([CommonConvert.resourceId, Converters.literal('')]).optional(),
319
+ conditions: typedConditionSetDecl(qualifierNameConverter).optional(),
320
+ mergeMethod: CommonConvert.resourceValueMergeMethod.optional()
321
+ });
322
+ }
323
+ /**
324
+ * Returns a `Converter` for a `Json.IResourceTreeChildNodeDecl<TQualifierNames>`
325
+ * narrowed on a supplied `qualifierName` converter.
326
+ *
327
+ * @public
328
+ */
329
+ // Keep in sync with `resourceTreeChildNodeDecl` above.
330
+ export function typedResourceTreeChildNodeDecl(qualifierNameConverter) {
331
+ const childResource = typedChildResourceDecl(qualifierNameConverter);
332
+ return Converters.generic((from, self, context) => {
333
+ return Converters.strictObject({
334
+ resources: Converters.recordOf(childResource).optional(),
335
+ children: Converters.recordOf(self).optional()
336
+ }).convert(from, context);
337
+ });
338
+ }
339
+ /**
340
+ * Returns a `Converter` for a `Json.IResourceTreeRootDecl<TQualifierNames>`
341
+ * narrowed on a supplied `qualifierName` converter.
342
+ *
343
+ * @public
344
+ */
345
+ // Keep in sync with `resourceTreeRootDecl` above.
346
+ export function typedResourceTreeRootDecl(qualifierNameConverter) {
347
+ return Converters.strictObject({
348
+ context: typedContainerContextDecl(qualifierNameConverter).optional(),
349
+ resources: Converters.recordOf(typedChildResourceDecl(qualifierNameConverter)).optional(),
350
+ children: Converters.recordOf(typedResourceTreeChildNodeDecl(qualifierNameConverter)).optional()
351
+ });
352
+ }
353
+ /**
354
+ * Returns a `Converter` for a `Json.IResourceCollectionDecl<TQualifierNames>`
355
+ * narrowed on a supplied `qualifierName` converter.
356
+ *
357
+ * @public
358
+ */
359
+ // Keep in sync with `resourceCollectionDecl` above.
360
+ export function typedResourceCollectionDecl(qualifierNameConverter) {
361
+ const containerContext = typedContainerContextDecl(qualifierNameConverter);
362
+ const looseCandidate = typedLooseResourceCandidateDecl(qualifierNameConverter);
363
+ const looseResource = typedLooseResourceDecl(qualifierNameConverter);
364
+ return Converters.generic((from, self, context) => {
365
+ return Converters.strictObject({
366
+ context: containerContext.optional(),
367
+ candidates: Converters.arrayOf(looseCandidate).optional(),
368
+ resources: Converters.arrayOf(looseResource).optional(),
369
+ collections: Converters.arrayOf(self).optional(),
370
+ metadata: JsonConverters.jsonObject.optional()
371
+ }).convert(from, context);
372
+ });
373
+ }
374
+ /**
375
+ * Returns a `Converter` for a `Json.IImporterResourceCollectionDecl<TQualifierNames>`
376
+ * narrowed on a supplied `qualifierName` converter.
377
+ *
378
+ * @public
379
+ */
380
+ // Keep in sync with `importerResourceCollectionDecl` above.
381
+ export function typedImporterResourceCollectionDecl(qualifierNameConverter) {
382
+ const containerContext = typedContainerContextDecl(qualifierNameConverter);
383
+ const importerCandidate = typedImporterResourceCandidateDecl(qualifierNameConverter);
384
+ const looseResource = typedLooseResourceDecl(qualifierNameConverter);
385
+ const childResource = typedChildResourceDecl(qualifierNameConverter);
386
+ return Converters.generic((from, self, context) => {
387
+ return Converters.strictObject({
388
+ context: containerContext.optional(),
389
+ candidates: Converters.arrayOf(importerCandidate).optional(),
390
+ resources: Converters.arrayOf(Converters.oneOf([looseResource, childResource])).optional(),
391
+ collections: Converters.arrayOf(self).optional(),
392
+ metadata: JsonConverters.jsonObject.optional()
393
+ }).convert(from, context);
394
+ });
395
+ }
171
396
  //# sourceMappingURL=convert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/convert.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;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AQ,EAAE;YAChD,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,QAAQ,EAAE;SAC/C,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC5B,CAAC,CACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,4DAA4D;AAC5D,MAAM,UAAU,mCAAmC,CACjD,sBAAkD;IAElD,MAAM,gBAAgB,GAAG,yBAAyB,CAAC,sBAAsB,CAAC,CAAC;IAC3E,MAAM,iBAAiB,GAAG,kCAAkC,CAAC,sBAAsB,CAAC,CAAC;IACrF,MAAM,aAAa,GAAG,sBAAsB,CAAC,sBAAsB,CAAC,CAAC;IACrE,MAAM,aAAa,GAAG,sBAAsB,CAAC,sBAAsB,CAAC,CAAC;IACrE,OAAO,UAAU,CAAC,OAAO,CACvB,CACE,IAAa,EACb,IAA+E,EAC/E,OAAiB,EAC8C,EAAE;QACjE,OAAO,UAAU,CAAC,YAAY,CAAwD;YACpF,OAAO,EAAE,gBAAgB,CAAC,QAAQ,EAAE;YACpC,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE;YAC5D,SAAS,EAAE,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;YAC1F,WAAW,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;YAChD,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,QAAQ,EAAE;SAC/C,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC5B,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Converter, Converters, mapResults, Result, fail } from '@fgv/ts-utils';\nimport { Convert as CommonConvert } from '../common';\nimport { isJsonObject, Converters as JsonConverters } from '@fgv/ts-json-base';\nimport * as Json from './json';\nimport * as Normalized from './normalized';\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Json.ILooseConditionDecl | loose condition declaration}.\n * @public\n */\nexport const looseConditionDecl: Converter<Json.ILooseConditionDecl> =\n Converters.strictObject<Json.ILooseConditionDecl>({\n qualifierName: CommonConvert.qualifierName,\n value: Converters.string,\n operator: CommonConvert.conditionOperator.optional(),\n priority: CommonConvert.conditionPriority.optional(),\n scoreAsDefault: Converters.number.optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Json.IChildConditionDecl | child condition declaration}.\n * @public\n */\nexport const childConditionDecl: Converter<Json.IChildConditionDecl> =\n Converters.strictObject<Json.IChildConditionDecl>({\n value: Converters.string,\n operator: CommonConvert.conditionOperator.optional(),\n priority: CommonConvert.conditionPriority.optional(),\n scoreAsDefault: Converters.number.optional()\n });\n\nfunction _isConditionSetRecord(from: unknown): from is Record<string, string | Json.IChildConditionDecl> {\n return isJsonObject(from);\n}\n\nconst conditionSetDeclFromArray: Converter<Normalized.ConditionSetDecl> =\n Converters.arrayOf(looseConditionDecl);\nconst conditionSetDeclFromRecord: Converter<Normalized.ConditionSetDecl> = Converters.generic<\n Normalized.ConditionSetDecl,\n unknown\n>(\n (\n from: unknown,\n __self: Converter<Normalized.ConditionSetDecl, unknown>,\n context?: unknown\n ): Result<Normalized.ConditionSetDecl> => {\n /* c8 ignore next 3 - this is tested but coverage is confused */\n if (!_isConditionSetRecord(from)) {\n return fail('Expected an object');\n }\n return mapResults(\n Array.from(Object.entries(from)).map(([qualifierName, value]) => {\n const toConvert: Json.ILooseConditionDecl =\n typeof value === 'string' ? { qualifierName, value } : { qualifierName, ...value };\n return looseConditionDecl.convert(toConvert, context);\n })\n );\n }\n);\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.ConditionSetDecl | condition set declaration}.\n * @public\n */\nexport const conditionSetDecl: Converter<Normalized.ConditionSetDecl> =\n Converters.oneOf<Normalized.ConditionSetDecl>([conditionSetDeclFromArray, conditionSetDeclFromRecord]);\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Json.ILooseResourceCandidateDecl | loose resource candidate declaration}.\n * @public\n */\nexport const looseResourceCandidateDecl: Converter<Normalized.ILooseResourceCandidateDecl> =\n Converters.strictObject<Normalized.ILooseResourceCandidateDecl>({\n id: CommonConvert.resourceId,\n json: JsonConverters.jsonObject,\n conditions: conditionSetDecl.optional(),\n mergeMethod: CommonConvert.resourceValueMergeMethod.optional(),\n isPartial: Converters.boolean.optional(),\n resourceTypeName: CommonConvert.resourceTypeName.optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | importer resource candidate declaration}.\n * @public\n */\nexport const importerResourceCandidateDecl: Converter<Normalized.IImporterResourceCandidateDecl> =\n Converters.strictObject<Normalized.IImporterResourceCandidateDecl>({\n id: CommonConvert.resourceId.optional(),\n json: JsonConverters.jsonObject,\n conditions: conditionSetDecl.optional(),\n mergeMethod: CommonConvert.resourceValueMergeMethod.optional(),\n isPartial: Converters.boolean.optional(),\n resourceTypeName: CommonConvert.resourceTypeName.optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Json.IChildResourceCandidateDecl | child resource candidate declaration}.\n * @public\n */\nexport const childResourceCandidateDecl: Converter<Normalized.IChildResourceCandidateDecl> =\n Converters.strictObject<Normalized.IChildResourceCandidateDecl>({\n json: JsonConverters.jsonObject,\n conditions: conditionSetDecl.optional(),\n isPartial: Converters.boolean.optional(),\n mergeMethod: CommonConvert.resourceValueMergeMethod.optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.ILooseResourceDecl | loose resource declaration}.\n * @public\n */\nexport const looseResourceDecl: Converter<Normalized.ILooseResourceDecl> =\n Converters.strictObject<Normalized.ILooseResourceDecl>({\n id: CommonConvert.resourceId,\n resourceTypeName: CommonConvert.resourceTypeName,\n candidates: Converters.arrayOf(childResourceCandidateDecl).optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IChildResourceDecl | child resource declaration}.\n * @public\n */\nexport const childResourceDecl: Converter<Normalized.IChildResourceDecl> =\n Converters.strictObject<Normalized.IChildResourceDecl>({\n resourceTypeName: CommonConvert.resourceTypeName,\n candidates: Converters.arrayOf(childResourceCandidateDecl).optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IContainerContextDecl | resource context declaration}.\n * @public\n */\nexport const containerContextDecl: Converter<Normalized.IContainerContextDecl> =\n Converters.strictObject<Normalized.IContainerContextDecl>({\n baseId: Converters.oneOf([CommonConvert.resourceId, Converters.literal('')]).optional(),\n conditions: conditionSetDecl.optional(),\n mergeMethod: CommonConvert.resourceValueMergeMethod.optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IResourceTreeChildNodeDecl | resource tree child node declaration}.\n * @public\n */\nexport const resourceTreeChildNodeDecl: Converter<Normalized.IResourceTreeChildNodeDecl> = Converters.generic<\n Normalized.IResourceTreeChildNodeDecl,\n unknown\n>(\n (\n from: unknown,\n self: Converter<Normalized.IResourceTreeChildNodeDecl, unknown>,\n context?: unknown\n ): Result<Normalized.IResourceTreeChildNodeDecl> => {\n return Converters.strictObject<Normalized.IResourceTreeChildNodeDecl>({\n resources: Converters.recordOf(childResourceDecl).optional(),\n children: Converters.recordOf(self).optional()\n }).convert(from, context);\n }\n);\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IResourceTreeRootDecl | resource tree root declaration}.\n * @public\n */\nexport const resourceTreeRootDecl: Converter<Normalized.IResourceTreeRootDecl> =\n Converters.strictObject<Normalized.IResourceTreeRootDecl>({\n context: containerContextDecl.optional(),\n resources: Converters.recordOf(childResourceDecl).optional(),\n children: Converters.recordOf(resourceTreeChildNodeDecl).optional()\n });\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IResourceCollectionDecl | resource collection declaration}.\n * @public\n */\nexport const resourceCollectionDecl: Converter<Normalized.IResourceCollectionDecl> = Converters.generic<\n Normalized.IResourceCollectionDecl,\n unknown\n>(\n (\n from: unknown,\n self: Converter<Normalized.IResourceCollectionDecl, unknown>,\n context?: unknown\n ): Result<Normalized.IResourceCollectionDecl> => {\n return Converters.strictObject<Normalized.IResourceCollectionDecl>({\n context: containerContextDecl.optional(),\n candidates: Converters.arrayOf(looseResourceCandidateDecl).optional(),\n resources: Converters.arrayOf(looseResourceDecl).optional(),\n collections: Converters.arrayOf(self).optional(),\n metadata: JsonConverters.jsonObject.optional()\n }).convert(from, context);\n }\n);\n\n/**\n * `Converter` for a normalized {@link ResourceJson.Normalized.IImporterResourceCollectionDecl | importer resource collection declaration}.\n * This allows for a mix of loose and child resource declarations.\n * @public\n */\nexport const importerResourceCollectionDecl: Converter<Normalized.IImporterResourceCollectionDecl> =\n Converters.generic<Normalized.IImporterResourceCollectionDecl, unknown>(\n (\n from: unknown,\n self: Converter<Normalized.IImporterResourceCollectionDecl, unknown>,\n context?: unknown\n ): Result<Normalized.IImporterResourceCollectionDecl> => {\n return Converters.strictObject<Normalized.IImporterResourceCollectionDecl>({\n context: containerContextDecl.optional(),\n candidates: Converters.arrayOf(importerResourceCandidateDecl).optional(),\n resources: Converters.arrayOf(Converters.oneOf([looseResourceDecl, childResourceDecl])).optional(),\n collections: Converters.arrayOf(self).optional(),\n metadata: JsonConverters.jsonObject.optional()\n }).convert(from, context);\n }\n );\n\n// --- Typed sibling converters (Phase B-2) -----------------------------------\n//\n// Each `typed*<TQualifierNames>(qualifierNameConverter)` returns a converter\n// whose result type is narrowed on `TQualifierNames`. The existing untyped\n// exports above remain unchanged at the signature and behavior level; consumers\n// opt in by calling a typed sibling. Internally each typed factory composes\n// lower-level typed factories so a single `qualifierNameConverter` flows\n// end-to-end through the converter tree.\n//\n// DRIFT HAZARD: each typed sibling duplicates the field list of its untyped\n// twin (the duplication exists to preserve `ObjectConverter` return types on\n// the defaults — see phase-b2-result.md). If a field is added, removed, or\n// re-typed on an untyped converter above, the typed sibling MUST be updated\n// in lockstep. The per-pair `keep in sync with X` markers below flag each\n// pair at the call site.\n\n/**\n * Returns a `Converter` for a `Json.ILooseConditionDecl<TQualifierNames>`\n * narrowed on a supplied `qualifierName` converter.\n *\n * @public\n */\n// Keep in sync with `looseConditionDecl` above.\nexport function typedLooseConditionDecl<TQualifierNames extends string>(\n qualifierNameConverter: Converter<TQualifierNames>\n): Converter<Json.ILooseConditionDecl<TQualifierNames>> {\n return Converters.strictObject<Json.ILooseConditionDecl<TQualifierNames>>({\n qualifierName: qualifierNameConverter,\n value: Converters.string,\n operator: CommonConvert.conditionOperator.optional(),\n priority: CommonConvert.conditionPriority.optional(),\n scoreAsDefault: Converters.number.optional()\n });\n}\n\nfunction _typedConditionSetDeclFromArray<TQualifierNames extends string>(\n innerLooseConditionDecl: Converter<Json.ILooseConditionDecl<TQualifierNames>>\n): Converter<Json.ConditionSetDeclAsArray<TQualifierNames>> {\n return Converters.arrayOf(innerLooseConditionDecl);\n}\n\nfunction _typedConditionSetDeclFromRecord<TQualifierNames extends string>(\n innerLooseConditionDecl: Converter<Json.ILooseConditionDecl<TQualifierNames>>\n): Converter<Json.ConditionSetDecl<TQualifierNames>> {\n return Converters.generic<Json.ConditionSetDecl<TQualifierNames>, unknown>(\n (\n from: unknown,\n __self: Converter<Json.ConditionSetDecl<TQualifierNames>, unknown>,\n context?: unknown\n ): Result<Json.ConditionSetDecl<TQualifierNames>> => {\n /* c8 ignore next 3 - branch covered by underlying record check */\n if (!_isConditionSetRecord(from)) {\n return fail('Expected an object');\n }\n return mapResults(\n Array.from(Object.entries(from)).map(([qualifierName, value]) => {\n const toConvert: Json.ILooseConditionDecl =\n typeof value === 'string' ? { qualifierName, value } : { qualifierName, ...value };\n return innerLooseConditionDecl.convert(toConvert, context);\n })\n );\n }\n );\n}\n\n/**\n * Returns a `Converter` for a `Json.ConditionSetDecl<TQualifierNames>`\n * (either array form or record form) narrowed on a supplied `qualifierName`\n * converter.\n *\n * @public\n */\n// Keep in sync with `conditionSetDecl` (and its two private feeder converters\n// `conditionSetDeclFromArray` / `conditionSetDeclFromRecord`) above.\nexport function typedConditionSetDecl<TQualifierNames extends string>(\n qualifierNameConverter: Converter<TQualifierNames>\n): Converter<Json.ConditionSetDecl<TQualifierNames>> {\n const inner = typedLooseConditionDecl(qualifierNameConverter);\n return Converters.oneOf<Json.ConditionSetDecl<TQualifierNames>>([\n _typedConditionSetDeclFromArray(inner),\n _typedConditionSetDeclFromRecord(inner)\n ]);\n}\n\n/**\n * Returns a `Converter` for a `Json.ILooseResourceCandidateDecl<TQualifierNames>`\n * narrowed on a supplied `qualifierName` converter.\n *\n * @public\n */\n// Keep in sync with `looseResourceCandidateDecl` above.\nexport function typedLooseResourceCandidateDecl<TQualifierNames extends string>(\n qualifierNameConverter: Converter<TQualifierNames>\n): Converter<Json.ILooseResourceCandidateDecl<TQualifierNames>> {\n return Converters.strictObject<Json.ILooseResourceCandidateDecl<TQualifierNames>>({\n id: CommonConvert.resourceId,\n json: JsonConverters.jsonObject,\n conditions: typedConditionSetDecl(qualifierNameConverter).optional(),\n mergeMethod: CommonConvert.resourceValueMergeMethod.optional(),\n isPartial: Converters.boolean.optional(),\n resourceTypeName: CommonConvert.resourceTypeName.optional()\n });\n}\n\n/**\n * Returns a `Converter` for a `Json.IImporterResourceCandidateDecl<TQualifierNames>`\n * narrowed on a supplied `qualifierName` converter.\n *\n * @public\n */\n// Keep in sync with `importerResourceCandidateDecl` above.\nexport function typedImporterResourceCandidateDecl<TQualifierNames extends string>(\n qualifierNameConverter: Converter<TQualifierNames>\n): Converter<Json.IImporterResourceCandidateDecl<TQualifierNames>> {\n return Converters.strictObject<Json.IImporterResourceCandidateDecl<TQualifierNames>>({\n id: CommonConvert.resourceId.optional(),\n json: JsonConverters.jsonObject,\n conditions: typedConditionSetDecl(qualifierNameConverter).optional(),\n mergeMethod: CommonConvert.resourceValueMergeMethod.optional(),\n isPartial: Converters.boolean.optional(),\n resourceTypeName: CommonConvert.resourceTypeName.optional()\n });\n}\n\n/**\n * Returns a `Converter` for a `Json.IChildResourceCandidateDecl<TQualifierNames>`\n * narrowed on a supplied `qualifierName` converter.\n *\n * @public\n */\n// Keep in sync with `childResourceCandidateDecl` above.\nexport function typedChildResourceCandidateDecl<TQualifierNames extends string>(\n qualifierNameConverter: Converter<TQualifierNames>\n): Converter<Json.IChildResourceCandidateDecl<TQualifierNames>> {\n return Converters.strictObject<Json.IChildResourceCandidateDecl<TQualifierNames>>({\n json: JsonConverters.jsonObject,\n conditions: typedConditionSetDecl(qualifierNameConverter).optional(),\n isPartial: Converters.boolean.optional(),\n mergeMethod: CommonConvert.resourceValueMergeMethod.optional()\n });\n}\n\n/**\n * Returns a `Converter` for a `Json.ILooseResourceDecl<TQualifierNames>`\n * narrowed on a supplied `qualifierName` converter.\n *\n * @public\n */\n// Keep in sync with `looseResourceDecl` above.\nexport function typedLooseResourceDecl<TQualifierNames extends string>(\n qualifierNameConverter: Converter<TQualifierNames>\n): Converter<Json.ILooseResourceDecl<TQualifierNames>> {\n return Converters.strictObject<Json.ILooseResourceDecl<TQualifierNames>>({\n id: CommonConvert.resourceId,\n resourceTypeName: CommonConvert.resourceTypeName,\n candidates: Converters.arrayOf(typedChildResourceCandidateDecl(qualifierNameConverter)).optional()\n });\n}\n\n/**\n * Returns a `Converter` for a `Json.IChildResourceDecl<TQualifierNames>`\n * narrowed on a supplied `qualifierName` converter.\n *\n * @public\n */\n// Keep in sync with `childResourceDecl` above.\nexport function typedChildResourceDecl<TQualifierNames extends string>(\n qualifierNameConverter: Converter<TQualifierNames>\n): Converter<Json.IChildResourceDecl<TQualifierNames>> {\n return Converters.strictObject<Json.IChildResourceDecl<TQualifierNames>>({\n resourceTypeName: CommonConvert.resourceTypeName,\n candidates: Converters.arrayOf(typedChildResourceCandidateDecl(qualifierNameConverter)).optional()\n });\n}\n\n/**\n * Returns a `Converter` for a `Json.IContainerContextDecl<TQualifierNames>`\n * narrowed on a supplied `qualifierName` converter.\n *\n * @public\n */\n// Keep in sync with `containerContextDecl` above.\nexport function typedContainerContextDecl<TQualifierNames extends string>(\n qualifierNameConverter: Converter<TQualifierNames>\n): Converter<Json.IContainerContextDecl<TQualifierNames>> {\n return Converters.strictObject<Json.IContainerContextDecl<TQualifierNames>>({\n baseId: Converters.oneOf([CommonConvert.resourceId, Converters.literal('')]).optional(),\n conditions: typedConditionSetDecl(qualifierNameConverter).optional(),\n mergeMethod: CommonConvert.resourceValueMergeMethod.optional()\n });\n}\n\n/**\n * Returns a `Converter` for a `Json.IResourceTreeChildNodeDecl<TQualifierNames>`\n * narrowed on a supplied `qualifierName` converter.\n *\n * @public\n */\n// Keep in sync with `resourceTreeChildNodeDecl` above.\nexport function typedResourceTreeChildNodeDecl<TQualifierNames extends string>(\n qualifierNameConverter: Converter<TQualifierNames>\n): Converter<Json.IResourceTreeChildNodeDecl<TQualifierNames>> {\n const childResource = typedChildResourceDecl(qualifierNameConverter);\n return Converters.generic<Json.IResourceTreeChildNodeDecl<TQualifierNames>, unknown>(\n (\n from: unknown,\n self: Converter<Json.IResourceTreeChildNodeDecl<TQualifierNames>, unknown>,\n context?: unknown\n ): Result<Json.IResourceTreeChildNodeDecl<TQualifierNames>> => {\n return Converters.strictObject<Json.IResourceTreeChildNodeDecl<TQualifierNames>>({\n resources: Converters.recordOf(childResource).optional(),\n children: Converters.recordOf(self).optional()\n }).convert(from, context);\n }\n );\n}\n\n/**\n * Returns a `Converter` for a `Json.IResourceTreeRootDecl<TQualifierNames>`\n * narrowed on a supplied `qualifierName` converter.\n *\n * @public\n */\n// Keep in sync with `resourceTreeRootDecl` above.\nexport function typedResourceTreeRootDecl<TQualifierNames extends string>(\n qualifierNameConverter: Converter<TQualifierNames>\n): Converter<Json.IResourceTreeRootDecl<TQualifierNames>> {\n return Converters.strictObject<Json.IResourceTreeRootDecl<TQualifierNames>>({\n context: typedContainerContextDecl(qualifierNameConverter).optional(),\n resources: Converters.recordOf(typedChildResourceDecl(qualifierNameConverter)).optional(),\n children: Converters.recordOf(typedResourceTreeChildNodeDecl(qualifierNameConverter)).optional()\n });\n}\n\n/**\n * Returns a `Converter` for a `Json.IResourceCollectionDecl<TQualifierNames>`\n * narrowed on a supplied `qualifierName` converter.\n *\n * @public\n */\n// Keep in sync with `resourceCollectionDecl` above.\nexport function typedResourceCollectionDecl<TQualifierNames extends string>(\n qualifierNameConverter: Converter<TQualifierNames>\n): Converter<Json.IResourceCollectionDecl<TQualifierNames>> {\n const containerContext = typedContainerContextDecl(qualifierNameConverter);\n const looseCandidate = typedLooseResourceCandidateDecl(qualifierNameConverter);\n const looseResource = typedLooseResourceDecl(qualifierNameConverter);\n return Converters.generic<Json.IResourceCollectionDecl<TQualifierNames>, unknown>(\n (\n from: unknown,\n self: Converter<Json.IResourceCollectionDecl<TQualifierNames>, unknown>,\n context?: unknown\n ): Result<Json.IResourceCollectionDecl<TQualifierNames>> => {\n return Converters.strictObject<Json.IResourceCollectionDecl<TQualifierNames>>({\n context: containerContext.optional(),\n candidates: Converters.arrayOf(looseCandidate).optional(),\n resources: Converters.arrayOf(looseResource).optional(),\n collections: Converters.arrayOf(self).optional(),\n metadata: JsonConverters.jsonObject.optional()\n }).convert(from, context);\n }\n );\n}\n\n/**\n * Returns a `Converter` for a `Json.IImporterResourceCollectionDecl<TQualifierNames>`\n * narrowed on a supplied `qualifierName` converter.\n *\n * @public\n */\n// Keep in sync with `importerResourceCollectionDecl` above.\nexport function typedImporterResourceCollectionDecl<TQualifierNames extends string>(\n qualifierNameConverter: Converter<TQualifierNames>\n): Converter<Json.IImporterResourceCollectionDecl<TQualifierNames>> {\n const containerContext = typedContainerContextDecl(qualifierNameConverter);\n const importerCandidate = typedImporterResourceCandidateDecl(qualifierNameConverter);\n const looseResource = typedLooseResourceDecl(qualifierNameConverter);\n const childResource = typedChildResourceDecl(qualifierNameConverter);\n return Converters.generic<Json.IImporterResourceCollectionDecl<TQualifierNames>, unknown>(\n (\n from: unknown,\n self: Converter<Json.IImporterResourceCollectionDecl<TQualifierNames>, unknown>,\n context?: unknown\n ): Result<Json.IImporterResourceCollectionDecl<TQualifierNames>> => {\n return Converters.strictObject<Json.IImporterResourceCollectionDecl<TQualifierNames>>({\n context: containerContext.optional(),\n candidates: Converters.arrayOf(importerCandidate).optional(),\n resources: Converters.arrayOf(Converters.oneOf([looseResource, childResource])).optional(),\n collections: Converters.arrayOf(self).optional(),\n metadata: JsonConverters.jsonObject.optional()\n }).convert(from, context);\n }\n );\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,UAAU,EAAU,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAElE,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO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ACf,yCAAyC;QACzC,CAAC,MAAA,QAAQ,CAAC,UAAU,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,mBAAmB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC,CAC/F,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EAAE;YACzB,OAAO,OAAO,iCAAM,QAAQ,KAAE,UAAU,IAAG,CAAC;QAC9C,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAChC,QAAuC,EACvC,IAAY,EACZ,UAAmB,EACnB,gBAA0D;IAE1D,OAAO,aAAa,CAAC,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE;;QACtE,OAAO,UAAU;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,OAAO,iCAAM,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 /* c8 ignore next 7 - functional code tested but coverage intermittently missed */\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 5 - functional code tested but coverage intermittently missed */\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 /* c8 ignore next 10 - functional code tested but coverage intermittently missed */\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 /* c8 ignore next 8 - functional code tested but coverage intermittently missed */\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"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,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","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"]}
@@ -24,13 +24,13 @@
24
24
  * @public
25
25
  */
26
26
  export function isLooseResourceCandidateDecl(decl) {
27
- return 'id' in decl;
27
+ return 'id' in decl && typeof decl.id === 'string';
28
28
  }
29
29
  /**
30
30
  * Type guard function to check if a resource declaration is a loose resource declaration.
31
31
  * @public
32
32
  */
33
33
  export function isLooseResourceDecl(decl) {
34
- return 'id' in decl;
34
+ return 'id' in decl && typeof decl.id === 'string';
35
35
  }
36
36
  //# sourceMappingURL=json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAuWH;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAC1C,IAAqD;IAErD,OAAO,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,EAAE,KAAK,QAAQ,CAAC;AACrD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAA4C;IAE5C,OAAO,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,EAAE,KAAK,QAAQ,CAAC;AACrD,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 *\n * @remarks\n * Parameterized on `TQualifierNames` so consumers authoring conditions\n * in code can opt into compile-time axis-name discipline (e.g. via a\n * literal-string union derived from a `qualifiers: ['tone'] as const`\n * decl-array). Defaults to `string`, so existing untyped callers\n * compile unchanged.\n *\n * @public\n */\nexport interface ILooseConditionDecl<TQualifierNames extends string = string> {\n /**\n * The name of the {@link Qualifiers.Qualifier | qualifier} to be compared.\n */\n qualifierName: TQualifierNames;\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 array-form declaration of a {@link Conditions.ConditionSet | condition set}.\n *\n * @remarks\n * Parameterized on `TQualifierNames` via `ILooseConditionDecl`;\n * defaults to `string` for back-compat with existing untyped callers.\n *\n * @public\n */\nexport type ConditionSetDeclAsArray<TQualifierNames extends string = string> = ReadonlyArray<\n ILooseConditionDecl<TQualifierNames>\n>;\n\n/**\n * Non-validated record-form declaration of a {@link Conditions.ConditionSet | condition set}.\n *\n * @remarks\n * Parameterized on `TQualifierNames`; defaults to `string` for back-compat with\n * existing untyped callers. Uses `Readonly<Partial<Record<...>>>` to align with\n * runtime reality (missing keys produce `undefined`; the `Partial` makes TypeScript\n * aware of this, which is a strict type-system tightening).\n *\n * @public\n */\nexport type ConditionSetDeclAsRecord<TQualifierNames extends string = string> = Readonly<\n Partial<Record<TQualifierNames, string | IChildConditionDecl>>\n>;\n\n/**\n * Non-validated declaration of a {@link Conditions.ConditionSet | condition set}.\n *\n * @remarks\n * Parameterized on `TQualifierNames`; defaults to `string`. Both the\n * array form (`ConditionSetDeclAsArray`) and the record form\n * (`ConditionSetDeclAsRecord`) inherit the parameter, so a\n * consumer threading a narrow `TQualifierNames` gets compile-time\n * rejection of typo'd axis names in either form.\n *\n * @public\n */\nexport type ConditionSetDecl<TQualifierNames extends string = string> =\n | ConditionSetDeclAsArray<TQualifierNames>\n | ConditionSetDeclAsRecord<TQualifierNames>;\n\n/**\n * Non-validated child declaration of a {@link Resources.ResourceCandidate | resource candidate}.\n *\n * @remarks\n * Parameterized on `TQualifierNames` so the `conditions` field can carry a\n * narrowed axis-name set. Defaults to `string` so existing untyped callers\n * compile unchanged.\n *\n * @public\n */\nexport interface IChildResourceCandidateDecl<TQualifierNames extends string = string> {\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<TQualifierNames>;\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 *\n * @remarks\n * Parameterized on `TQualifierNames`; inherits via `IChildResourceCandidateDecl`.\n * Defaults to `string` for back-compat.\n *\n * @public\n */\nexport interface IImporterResourceCandidateDecl<TQualifierNames extends string = string>\n extends IChildResourceCandidateDecl<TQualifierNames> {\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 *\n * @remarks\n * Parameterized on `TQualifierNames`; inherits via `IChildResourceCandidateDecl`.\n * Defaults to `string` for back-compat.\n *\n * @public\n */\nexport interface ILooseResourceCandidateDecl<TQualifierNames extends string = string>\n extends IChildResourceCandidateDecl<TQualifierNames> {\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<TQualifierNames>;\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 *\n * @remarks\n * Parameterized on `TQualifierNames` so the `candidates` field threads the\n * narrowed axis-name set down to each candidate. Defaults to `string` for\n * back-compat.\n *\n * @public\n */\nexport interface IChildResourceDecl<TQualifierNames extends string = string> {\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<TQualifierNames>>;\n}\n\n/**\n * Non-validated loose declaration of a {@link Resources.Resource | resource}.\n *\n * @remarks\n * Parameterized on `TQualifierNames`; inherits via `IChildResourceDecl`.\n * Defaults to `string` for back-compat.\n *\n * @public\n */\nexport interface ILooseResourceDecl<TQualifierNames extends string = string>\n extends IChildResourceDecl<TQualifierNames> {\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<TQualifierNames>>;\n}\n\n/**\n * Normalized non-validated declaration of a {@link Resources.Resource | resource} tree node.\n *\n * @remarks\n * Parameterized on `TQualifierNames` so the `resources` and `children` fields\n * thread the narrowed axis-name set throughout the tree. Defaults to `string` for\n * back-compat.\n *\n * @public\n */\nexport interface IResourceTreeChildNodeDecl<TQualifierNames extends string = string> {\n readonly resources?: Record<string, IChildResourceDecl<TQualifierNames>>;\n readonly children?: Record<string, IResourceTreeChildNodeDecl<TQualifierNames>>;\n}\n\n/**\n * Declared context for a resource container.\n *\n * @remarks\n * Parameterized on `TQualifierNames` so the `conditions` field threads the\n * narrowed axis-name set to the container context. Defaults to `string` for\n * back-compat.\n *\n * @public\n */\nexport interface IContainerContextDecl<TQualifierNames extends string = string> {\n readonly baseId?: string;\n readonly conditions?: ConditionSetDecl<TQualifierNames>;\n readonly mergeMethod?: ResourceValueMergeMethod;\n}\n\n/**\n * Normalized non-validated declaration of a {@link Resources.Resource | resource} tree root.\n *\n * @remarks\n * Parameterized on `TQualifierNames` so the `context` field threads the\n * narrowed axis-name set to the tree root context. Defaults to `string` for\n * back-compat.\n *\n * @public\n */\nexport interface IResourceTreeRootDecl<TQualifierNames extends string = string>\n extends IResourceTreeChildNodeDecl<TQualifierNames> {\n readonly context?: IContainerContextDecl<TQualifierNames>;\n readonly resources?: Record<string, IChildResourceDecl<TQualifierNames>>;\n readonly children?: Record<string, IResourceTreeChildNodeDecl<TQualifierNames>>;\n readonly metadata?: JsonObject;\n}\n\n/**\n * Non-validated declaration of a collection of resources.\n *\n * @remarks\n * Parameterized on `TQualifierNames` so the `context`, `candidates`, and\n * `resources` fields thread the narrowed axis-name set throughout the\n * collection. Defaults to `string` for back-compat.\n *\n * @public\n */\nexport interface IResourceCollectionDecl<TQualifierNames extends string = string> {\n readonly context?: IContainerContextDecl<TQualifierNames>;\n readonly candidates?: ReadonlyArray<ILooseResourceCandidateDecl<TQualifierNames>>;\n readonly resources?: ReadonlyArray<ILooseResourceDecl<TQualifierNames>>;\n readonly collections?: ReadonlyArray<IResourceCollectionDecl<TQualifierNames>>;\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 *\n * @remarks\n * Parameterized on `TQualifierNames`; defaults to `string` for back-compat.\n *\n * @public\n */\nexport type IImporterResourceDecl<TQualifierNames extends string = string> =\n | ILooseResourceDecl<TQualifierNames>\n | IChildResourceDecl<TQualifierNames>;\n\n/**\n * Non-validated declaration of a collection of resources for an importer.\n *\n * @remarks\n * Parameterized on `TQualifierNames` so the `context`, `candidates`, and\n * `resources` fields thread the narrowed axis-name set throughout the\n * importer collection. Defaults to `string` for back-compat.\n *\n * @public\n */\nexport interface IImporterResourceCollectionDecl<TQualifierNames extends string = string> {\n readonly context?: IContainerContextDecl<TQualifierNames>;\n readonly candidates?: ReadonlyArray<IImporterResourceCandidateDecl<TQualifierNames>>;\n readonly resources?: ReadonlyArray<IImporterResourceDecl<TQualifierNames>>;\n readonly collections?: ReadonlyArray<IImporterResourceCollectionDecl<TQualifierNames>>;\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<TQualifierNames extends string = string>(\n decl: IImporterResourceCandidateDecl<TQualifierNames>\n): decl is ILooseResourceCandidateDecl<TQualifierNames> {\n return 'id' in decl && typeof decl.id === 'string';\n}\n\n/**\n * Type guard function to check if a resource declaration is a loose resource declaration.\n * @public\n */\nexport function isLooseResourceDecl<TQualifierNames extends string = string>(\n decl: IImporterResourceDecl<TQualifierNames>\n): decl is ILooseResourceDecl<TQualifierNames> {\n return 'id' in decl && typeof decl.id === 'string';\n}\n"]}
@@ -0,0 +1 @@
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"]}
@@ -29,7 +29,7 @@ import { mergeContextDecl, mergeImporterCandidate, mergeImporterResource } from
29
29
  */
30
30
  export class ResourceDeclCollection {
31
31
  /**
32
- * {@inheritdoc ResourceJson.IResourceDeclContainer.context}
32
+ * {@inheritDoc ResourceJson.IResourceDeclContainer.context}
33
33
  */
34
34
  get context() {
35
35
  return this.collection.context;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceDeclCollection.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclCollection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,iBAAiB,EAAU,OAAO,EAAE,MAAM,eAAe,CAAC;AAE9F,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AAE,EAAE;;YACnD,MAAM,gBAAgB,GACpB,MAAA,MAAA,UAAU,CAAC,UAAU,0CAAE,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CACvC,sBAAsB,CAAC,SAAS,EAAE,QAAQ,EAAE,cAAc,CAAC,CAC5D,mCAAI,EAAE,CAAC;YACV,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;YAE5F,MAAM,eAAe,GACnB,MAAA,MAAA,UAAU,CAAC,SAAS,0CAAE,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CACrC,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,EAAE,cAAc,CAAC,CAC1D,mCAAI,EAAE,CAAC;YACV,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;YAE1F,MAAA,UAAU,CAAC,WAAW,0CAAE,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE;gBAChD,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YAChF,CAAC,CAAC,CAAC;YACH,OAAO,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9C,CAAC,CACF,CAAC;IACJ,CAAC;CACF","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"]}
@@ -0,0 +1 @@
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"]}
@@ -30,7 +30,7 @@ import { mergeChildResource } from './helpers';
30
30
  */
31
31
  export class ResourceDeclTree {
32
32
  /**
33
- * {@inheritdoc ResourceJson.IResourceDeclContainer.context}
33
+ * {@inheritDoc ResourceJson.IResourceDeclContainer.context}
34
34
  */
35
35
  get context() {
36
36
  return this.tree.context;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceDeclTree.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclTree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,iBAAiB,EAAU,OAAO,EAAE,MAAM,eAAe,CAAC;AAE9F,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAGrC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C;;;;GAIG;AACH,MAAM,OAAO,gBAAgB;IAO3B;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC3B,CAAC;IAKD,YAAsB,IAAsC;;QAHlD,eAAU,GAAoC,EAAE,CAAC;QACjD,gBAAW,GAA6C,EAAE,CAAC;QAGnE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,MAAM,EAAE,GAAG,MAAA,IAAI,CAAC,OAAO,0CAAE,MAAM,CAAC;QAChC,MAAM,UAAU,GAAG,MAAA,IAAI,CAAC,OAAO,0CAAE,UAAU,CAAC;QAC5C,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC;IAChD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAAC,IAAa;QAChC,OAAO,OAAO,CAAC,oBAAoB;aAChC,OAAO,CAAC,IAAI,CAAC;aACb,eAAe,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,0BAA0B,GAAG,EAAE,CAAC;aACzD,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;YAClB,OAAO,aAAa,CAAC,GAAG,EAAE,CAAC,IAAI,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BACD,cAAc,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF","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"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../../src/packlets/resource-types/config/convert.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,2CAA2C;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGjE;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAAC,YAAY,CAAsB;IAC7E,IAAI,EAAE,UAAU,CAAC,MAAM;IACvB,QAAQ,EAAE,UAAU,CAAC,MAAM;IAC3B,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,QAAQ,EAAE;CAC/C,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 { Converters as JsonConverters } from '@fgv/ts-json-base';\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 template: JsonConverters.jsonObject.optional()\n});\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/resource-types/config/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,cAAc,QAAQ,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Convert from './convert';\n\nexport * from './json';\n\nexport { Convert };\n"]}
@@ -0,0 +1 @@
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\nimport { JsonObject } from '@fgv/ts-json-base';\n\n/**\n * Configuration for a {@link ResourceTypes.ResourceType | resource type}.\n * @public\n */\nexport interface IResourceTypeConfig<T extends JsonObject = JsonObject> {\n name: string;\n typeName: string;\n template?: T;\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/packlets/resource-types/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,IAAI,EAAU,MAAM,eAAe,CAAC;AAG7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAExD;;;;;;;GAOG;AACH,MAAM,UAAU,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,gBAAgB,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IAC1D,CAAC;IACD,kFAAkF;IAClF,OAAO,IAAI,CAAC,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 /* c8 ignore next 2 - functional code tested but coverage intermittently missed */\n return fail(`${config.typeName}: Unknown resource type.`);\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/resource-types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,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","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"]}
@@ -37,7 +37,7 @@ export class JsonResourceType extends ResourceType {
37
37
  constructor(key, index, template) {
38
38
  super(key, index, template);
39
39
  /**
40
- * {@inheritdoc ResourceTypes.ResourceType.systemTypeName}
40
+ * {@inheritDoc ResourceTypes.ResourceType.systemTypeName}
41
41
  */
42
42
  this.systemTypeName = Convert.resourceTypeName.convert('json').orThrow();
43
43
  }
@@ -54,7 +54,7 @@ export class JsonResourceType extends ResourceType {
54
54
  });
55
55
  }
56
56
  /**
57
- * {@inheritdoc ResourceTypes.ResourceType.validateDeclaration}
57
+ * {@inheritDoc ResourceTypes.ResourceType.validateDeclaration}
58
58
  */
59
59
  validateDeclaration(props) {
60
60
  return JsonConverters.jsonObject.convert(props.json);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonResourceType.js","sourceRoot":"","sources":["../../../src/packlets/resource-types/jsonResourceType.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,UAAU,IAAI,cAAc,EAAc,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAA0C,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EAAyB,OAAO,EAAoB,MAAM,WAAW,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAU,MAAM,eAAe,CAAC;AA0BtD;;;GAGG;AACH,MAAM,OAAO,gBAAiB,SAAQ,YAAwB;IAM5D;;;;;OAKG;IACH,YAAsB,GAAqB,EAAE,KAAc,EAAE,QAAqB;QAChF,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;QAZ9B;;WAEG;QACa,mBAAc,GAAqB,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC;IAUtG,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAAC,MAAsC;;QACzD,OAAO,OAAO,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,aAAa,CAAC,GAAG,EAAE,CAAC,IAAI,gBAAgB,CAAC,GAAG,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAC,CAAC,CAAC;QACzF,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IAEI,mBAAmB,CAAC,KAA6C;QACtE,OAAO,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;IA0BM,QAAQ,CAAC,IAAgB,EAAE,cAAsC;QACtE,OAAO,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Converters as JsonConverters, JsonObject } from '@fgv/ts-json-base';\nimport { IResourceCandidateValidationProperties, ResourceType } from './resourceType';\nimport { CandidateCompleteness, Convert, ResourceTypeName } from '../common';\nimport { captureResult, Result } from '@fgv/ts-utils';\n\n/**\n * Parameters to create a {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.\n * @public\n */\nexport interface IJsonResourceTypeCreateParams {\n /**\n * Optional key for the new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.\n * Defaults to 'json'.\n */\n key?: string;\n\n /**\n * Optional index for the new {@link ResourceTypes.JsonResourceType | JsonResourceType}\n * instance.\n */\n index?: number;\n\n /**\n * Optional template for new instances of {@link ResourceTypes.JsonResourceType | JsonResourceType}\n * resources.\n */\n template?: JsonObject;\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 * {@inheritDoc ResourceTypes.ResourceType.systemTypeName}\n */\n public readonly systemTypeName: ResourceTypeName = Convert.resourceTypeName.convert('json').orThrow();\n\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, template?: JsonObject) {\n super(key, index, template);\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, params?.template));\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 * Validates a JSON value for use as a resource instance value.\n * @param json - The JSON value to validate.\n * @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.\n * @returns `Success` with the strongly-typed resource value if the JSON is valid,\n * `Failure` with an error message otherwise.\n */\n public validate(json: JsonObject, completeness: CandidateCompleteness): Result<JsonObject>;\n /**\n * Validates a JSON value for use as a complete resource instance value.\n * @param json - The JSON value to validate.\n * @param completeness - Must be `'full'` to indicate a complete value.\n * @returns `Success` with the strongly-typed resource value if the JSON is valid,\n * `Failure` with an error message otherwise.\n */\n public validate(json: JsonObject, completeness: 'full'): Result<JsonObject>;\n /**\n * Validates a JSON value for use as a partial resource instance value.\n * @param json - The JSON value to validate.\n * @param completeness - Must be `'partial'` to indicate a partial value.\n * @returns `Success` with the strongly-typed partial resource value if the JSON is valid,\n * `Failure` with an error message otherwise.\n */\n public validate(json: JsonObject, completeness: 'partial'): Result<JsonObject>;\n public validate(json: JsonObject, __completeness?: CandidateCompleteness): Result<JsonObject> {\n return JsonConverters.jsonObject.convert(json);\n }\n}\n"]}
@@ -30,13 +30,13 @@ import { Convert as CommonConvert, Validate } from '../common';
30
30
  */
31
31
  export class ResourceType {
32
32
  /**
33
- * {@inheritdoc ResourceTypes.IResourceType.key}
33
+ * {@inheritDoc ResourceTypes.IResourceType.key}
34
34
  */
35
35
  get key() {
36
36
  return this._collectible.key;
37
37
  }
38
38
  /**
39
- * {@inheritdoc ResourceTypes.IResourceType.index}
39
+ * {@inheritDoc ResourceTypes.IResourceType.index}
40
40
  */
41
41
  get index() {
42
42
  return this._collectible.index;