@fgv/ts-res 5.1.0-2 → 5.1.0-20

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 (571) 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.map +1 -0
  32. package/dist/packlets/conditions/conditionSetCollector.js.map +1 -0
  33. package/dist/packlets/conditions/conditionSetDecls.js.map +1 -0
  34. package/dist/packlets/conditions/conditionToken.js.map +1 -0
  35. package/dist/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  36. package/dist/packlets/conditions/convert/decls.js.map +1 -0
  37. package/dist/packlets/conditions/convert/index.js.map +1 -0
  38. package/dist/packlets/conditions/index.js.map +1 -0
  39. package/dist/packlets/config/common.js +78 -0
  40. package/dist/packlets/config/common.js.map +1 -0
  41. package/dist/packlets/config/configInitFactory.js +258 -0
  42. package/dist/packlets/config/configInitFactory.js.map +1 -0
  43. package/dist/packlets/config/convert.js +56 -0
  44. package/dist/packlets/config/convert.js.map +1 -0
  45. package/dist/packlets/config/index.browser.js +34 -0
  46. package/dist/packlets/config/index.browser.js.map +1 -0
  47. package/dist/packlets/config/index.js +28 -0
  48. package/dist/packlets/config/index.js.map +1 -0
  49. package/dist/packlets/config/json.js +23 -0
  50. package/dist/packlets/config/json.js.map +1 -0
  51. package/dist/packlets/config/predefined/default.js +138 -0
  52. package/dist/packlets/config/predefined/default.js.map +1 -0
  53. package/dist/packlets/config/predefined/extended.js +190 -0
  54. package/dist/packlets/config/predefined/extended.js.map +1 -0
  55. package/dist/packlets/config/predefined/index.js +25 -0
  56. package/dist/packlets/config/predefined/index.js.map +1 -0
  57. package/dist/packlets/config/systemConfiguration.js +147 -0
  58. package/dist/packlets/config/systemConfiguration.js.map +1 -0
  59. package/dist/packlets/context/contextDecls.js.map +1 -0
  60. package/dist/packlets/context/contextToken.js.map +1 -0
  61. package/dist/packlets/context/convert/decls.js.map +1 -0
  62. package/dist/packlets/context/convert/index.js.map +1 -0
  63. package/dist/packlets/context/index.js.map +1 -0
  64. package/dist/packlets/decisions/abstractDecision.js.map +1 -0
  65. package/dist/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  66. package/dist/packlets/decisions/candidate.js.map +1 -0
  67. package/dist/packlets/decisions/common.js.map +1 -0
  68. package/dist/packlets/decisions/concreteDecision.js.map +1 -0
  69. package/dist/packlets/decisions/decision.js +1 -1
  70. package/dist/packlets/decisions/decision.js.map +1 -0
  71. package/dist/packlets/decisions/index.js.map +1 -0
  72. package/dist/packlets/import/fsItem.js +1 -4
  73. package/dist/packlets/import/fsItem.js.map +1 -0
  74. package/dist/packlets/import/importContext.js +3 -3
  75. package/dist/packlets/import/importContext.js.map +1 -0
  76. package/dist/packlets/import/importManager.js +7 -3
  77. package/dist/packlets/import/importManager.js.map +1 -0
  78. package/dist/packlets/import/importable.js.map +1 -0
  79. package/dist/packlets/import/importers/collectionImporter.js +2 -2
  80. package/dist/packlets/import/importers/collectionImporter.js.map +1 -0
  81. package/dist/packlets/import/importers/fsItemImporter.js +30 -14
  82. package/dist/packlets/import/importers/fsItemImporter.js.map +1 -0
  83. package/dist/packlets/import/importers/importer.js.map +1 -0
  84. package/dist/packlets/import/importers/index.browser.js.map +1 -0
  85. package/dist/packlets/import/importers/index.js.map +1 -0
  86. package/dist/packlets/import/importers/jsonImporter.js +2 -2
  87. package/dist/packlets/import/importers/jsonImporter.js.map +1 -0
  88. package/dist/packlets/import/importers/pathImporter.js +1 -1
  89. package/dist/packlets/import/importers/pathImporter.js.map +1 -0
  90. package/dist/packlets/import/index.browser.js.map +1 -0
  91. package/dist/packlets/import/index.js.map +1 -0
  92. package/dist/packlets/qualifier-types/config/convert.js +124 -0
  93. package/dist/packlets/qualifier-types/config/convert.js.map +1 -0
  94. package/dist/packlets/qualifier-types/config/index.js +25 -0
  95. package/dist/packlets/qualifier-types/config/index.js.map +1 -0
  96. package/dist/packlets/qualifier-types/config/json.js +32 -0
  97. package/dist/packlets/qualifier-types/config/json.js.map +1 -0
  98. package/dist/packlets/qualifier-types/convert.js.map +1 -0
  99. package/dist/packlets/qualifier-types/helpers.js.map +1 -0
  100. package/dist/packlets/qualifier-types/index.js.map +1 -0
  101. package/dist/packlets/qualifier-types/languageQualifierType.js +6 -7
  102. package/dist/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  103. package/dist/packlets/qualifier-types/literalQualifierType.js +7 -10
  104. package/dist/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  105. package/dist/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  106. package/dist/packlets/qualifier-types/qualifierType.js +12 -13
  107. package/dist/packlets/qualifier-types/qualifierType.js.map +1 -0
  108. package/dist/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  109. package/dist/packlets/qualifier-types/territoryQualifierType.js +5 -5
  110. package/dist/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  111. package/dist/packlets/qualifiers/convert/decls.js.map +1 -0
  112. package/dist/packlets/qualifiers/convert/index.js.map +1 -0
  113. package/dist/packlets/qualifiers/convert/qualifier.js.map +1 -0
  114. package/dist/packlets/qualifiers/index.js.map +1 -0
  115. package/dist/packlets/qualifiers/qualifier.js +6 -7
  116. package/dist/packlets/qualifiers/qualifier.js.map +1 -0
  117. package/dist/packlets/qualifiers/qualifierCollector.js +2 -2
  118. package/dist/packlets/qualifiers/qualifierCollector.js.map +1 -0
  119. package/dist/packlets/qualifiers/qualifierDecl.js.map +1 -0
  120. package/dist/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  121. package/dist/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  122. package/dist/packlets/resource-json/compiled/common.js.map +1 -0
  123. package/dist/packlets/resource-json/compiled/convert.js.map +1 -0
  124. package/dist/packlets/resource-json/compiled/index.js.map +1 -0
  125. package/dist/packlets/resource-json/compiled/json.js.map +1 -0
  126. package/dist/packlets/resource-json/convert.js.map +1 -0
  127. package/dist/packlets/resource-json/helpers.js.map +1 -0
  128. package/dist/packlets/resource-json/index.js.map +1 -0
  129. package/dist/packlets/resource-json/json.js.map +1 -0
  130. package/dist/packlets/resource-json/normalized.js.map +1 -0
  131. package/dist/packlets/resource-json/resourceDeclCollection.js +1 -1
  132. package/dist/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  133. package/dist/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  134. package/dist/packlets/resource-json/resourceDeclTree.js +1 -1
  135. package/dist/packlets/resource-json/resourceDeclTree.js.map +1 -0
  136. package/dist/packlets/resource-types/config/convert.js +35 -0
  137. package/dist/packlets/resource-types/config/convert.js.map +1 -0
  138. package/dist/packlets/resource-types/config/index.js +25 -0
  139. package/dist/packlets/resource-types/config/index.js.map +1 -0
  140. package/dist/packlets/resource-types/config/json.js +23 -0
  141. package/dist/packlets/resource-types/config/json.js.map +1 -0
  142. package/dist/packlets/resource-types/helpers.js.map +1 -0
  143. package/dist/packlets/resource-types/index.js.map +1 -0
  144. package/dist/packlets/resource-types/jsonResourceType.js +2 -2
  145. package/dist/packlets/resource-types/jsonResourceType.js.map +1 -0
  146. package/dist/packlets/resource-types/resourceType.js +2 -2
  147. package/dist/packlets/resource-types/resourceType.js.map +1 -0
  148. package/dist/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  149. package/dist/packlets/resources/candidateReducer.js.map +1 -0
  150. package/dist/packlets/resources/candidateValue.js.map +1 -0
  151. package/dist/packlets/resources/candidateValueCollector.js.map +1 -0
  152. package/dist/packlets/resources/common.js.map +1 -0
  153. package/dist/packlets/resources/deltaGenerator.js.map +1 -0
  154. package/dist/packlets/resources/index.js.map +1 -0
  155. package/dist/packlets/resources/resource.js.map +1 -0
  156. package/dist/packlets/resources/resourceBuilder.js +2 -2
  157. package/dist/packlets/resources/resourceBuilder.js.map +1 -0
  158. package/dist/packlets/resources/resourceCandidate.js.map +1 -0
  159. package/dist/packlets/resources/resourceManagerBuilder.js +5 -5
  160. package/dist/packlets/resources/resourceManagerBuilder.js.map +1 -0
  161. package/dist/packlets/runtime/cacheListener.js.map +1 -0
  162. package/dist/packlets/runtime/cacheMetrics.js.map +1 -0
  163. package/dist/packlets/runtime/compiledResourceCollection.js +5 -5
  164. package/dist/packlets/runtime/compiledResourceCollection.js.map +1 -0
  165. package/dist/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  166. package/dist/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  167. package/dist/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  168. package/dist/packlets/runtime/context/index.js.map +1 -0
  169. package/dist/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  170. package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  171. package/dist/packlets/runtime/iResourceManager.js.map +1 -0
  172. package/dist/packlets/runtime/index.js.map +1 -0
  173. package/dist/packlets/runtime/resource-tree/common.js.map +1 -0
  174. package/dist/packlets/runtime/resource-tree/index.js.map +1 -0
  175. package/dist/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  176. package/dist/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  177. package/dist/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  178. package/dist/packlets/runtime/resourceResolver.js.map +1 -0
  179. package/dist/packlets/runtime/resourceTreeResolver.js.map +1 -0
  180. package/dist/packlets/runtime/validate.js.map +1 -0
  181. package/dist/packlets/zip-archive/convert.js.map +1 -0
  182. package/dist/packlets/zip-archive/index.browser.js.map +1 -0
  183. package/dist/packlets/zip-archive/index.js.map +1 -0
  184. package/dist/packlets/zip-archive/json.js.map +1 -0
  185. package/dist/packlets/zip-archive/types.js.map +1 -0
  186. package/dist/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  187. package/dist/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  188. package/dist/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  189. package/dist/ts-res.d.ts +134 -112
  190. package/dist/tsdoc-metadata.json +1 -1
  191. package/lib/index.browser.d.ts.map +1 -0
  192. package/lib/index.browser.js.map +1 -0
  193. package/lib/index.d.ts.map +1 -0
  194. package/lib/index.js.map +1 -0
  195. package/lib/packlets/bundle/bundleBuilder.d.ts.map +1 -0
  196. package/lib/packlets/bundle/bundleBuilder.js.map +1 -0
  197. package/lib/packlets/bundle/bundleLoader.d.ts.map +1 -0
  198. package/lib/packlets/bundle/bundleLoader.js.map +1 -0
  199. package/lib/packlets/bundle/bundleNormalizer.d.ts.map +1 -0
  200. package/lib/packlets/bundle/bundleNormalizer.js.map +1 -0
  201. package/lib/packlets/bundle/bundleUtils.d.ts.map +1 -0
  202. package/lib/packlets/bundle/bundleUtils.js.map +1 -0
  203. package/lib/packlets/bundle/convert.d.ts.map +1 -0
  204. package/lib/packlets/bundle/convert.js.map +1 -0
  205. package/lib/packlets/bundle/index.d.ts.map +1 -0
  206. package/lib/packlets/bundle/index.js.map +1 -0
  207. package/lib/packlets/bundle/model.d.ts.map +1 -0
  208. package/lib/packlets/bundle/model.js.map +1 -0
  209. package/lib/packlets/common/conditions.d.ts.map +1 -0
  210. package/lib/packlets/common/conditions.js.map +1 -0
  211. package/lib/packlets/common/convert.d.ts.map +1 -0
  212. package/lib/packlets/common/convert.js.map +1 -0
  213. package/lib/packlets/common/helpers/conditions.d.ts.map +1 -0
  214. package/lib/packlets/common/helpers/conditions.js.map +1 -0
  215. package/lib/packlets/common/helpers/context.d.ts.map +1 -0
  216. package/lib/packlets/common/helpers/context.js.map +1 -0
  217. package/lib/packlets/common/helpers/index.d.ts.map +1 -0
  218. package/lib/packlets/common/helpers/index.js.map +1 -0
  219. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +1 -0
  220. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  221. package/lib/packlets/common/helpers/resources.d.ts +2 -4
  222. package/lib/packlets/common/helpers/resources.d.ts.map +1 -0
  223. package/lib/packlets/common/helpers/resources.js +2 -4
  224. package/lib/packlets/common/helpers/resources.js.map +1 -0
  225. package/lib/packlets/common/index.d.ts.map +1 -0
  226. package/lib/packlets/common/index.js.map +1 -0
  227. package/lib/packlets/common/resources.d.ts.map +1 -0
  228. package/lib/packlets/common/resources.js.map +1 -0
  229. package/lib/packlets/common/validate/conditions.d.ts +4 -4
  230. package/lib/packlets/common/validate/conditions.d.ts.map +1 -0
  231. package/lib/packlets/common/validate/conditions.js +4 -4
  232. package/lib/packlets/common/validate/conditions.js.map +1 -0
  233. package/lib/packlets/common/validate/index.d.ts.map +1 -0
  234. package/lib/packlets/common/validate/index.js.map +1 -0
  235. package/lib/packlets/common/validate/regularExpressions.d.ts +2 -2
  236. package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -0
  237. package/lib/packlets/common/validate/regularExpressions.js +2 -2
  238. package/lib/packlets/common/validate/regularExpressions.js.map +1 -0
  239. package/lib/packlets/common/validate/resources.d.ts +1 -1
  240. package/lib/packlets/common/validate/resources.d.ts.map +1 -0
  241. package/lib/packlets/common/validate/resources.js +1 -1
  242. package/lib/packlets/common/validate/resources.js.map +1 -0
  243. package/lib/packlets/conditions/condition.d.ts +3 -7
  244. package/lib/packlets/conditions/condition.d.ts.map +1 -0
  245. package/lib/packlets/conditions/condition.js +3 -7
  246. package/lib/packlets/conditions/condition.js.map +1 -0
  247. package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -0
  248. package/lib/packlets/conditions/conditionCollector.js.map +1 -0
  249. package/lib/packlets/conditions/conditionDecls.d.ts.map +1 -0
  250. package/lib/packlets/conditions/conditionDecls.js.map +1 -0
  251. package/lib/packlets/conditions/conditionSet.d.ts.map +1 -0
  252. package/lib/packlets/conditions/conditionSet.js.map +1 -0
  253. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -0
  254. package/lib/packlets/conditions/conditionSetCollector.js.map +1 -0
  255. package/lib/packlets/conditions/conditionSetDecls.d.ts.map +1 -0
  256. package/lib/packlets/conditions/conditionSetDecls.js.map +1 -0
  257. package/lib/packlets/conditions/conditionToken.d.ts.map +1 -0
  258. package/lib/packlets/conditions/conditionToken.js.map +1 -0
  259. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +1 -0
  260. package/lib/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  261. package/lib/packlets/conditions/convert/decls.d.ts.map +1 -0
  262. package/lib/packlets/conditions/convert/decls.js.map +1 -0
  263. package/lib/packlets/conditions/convert/index.d.ts.map +1 -0
  264. package/lib/packlets/conditions/convert/index.js.map +1 -0
  265. package/lib/packlets/conditions/index.d.ts.map +1 -0
  266. package/lib/packlets/conditions/index.js.map +1 -0
  267. package/lib/packlets/config/common.d.ts +35 -0
  268. package/lib/packlets/config/common.d.ts.map +1 -0
  269. package/lib/packlets/config/common.js +97 -0
  270. package/lib/packlets/config/common.js.map +1 -0
  271. package/lib/packlets/config/configInitFactory.d.ts +217 -0
  272. package/lib/packlets/config/configInitFactory.d.ts.map +1 -0
  273. package/lib/packlets/config/configInitFactory.js +303 -0
  274. package/lib/packlets/config/configInitFactory.js.map +1 -0
  275. package/lib/packlets/config/convert.d.ts +23 -0
  276. package/lib/packlets/config/convert.d.ts.map +1 -0
  277. package/lib/packlets/config/convert.js +93 -0
  278. package/lib/packlets/config/convert.js.map +1 -0
  279. package/lib/packlets/config/index.browser.d.ts +7 -0
  280. package/lib/packlets/config/index.browser.d.ts.map +1 -0
  281. package/lib/packlets/config/index.browser.js +74 -0
  282. package/lib/packlets/config/index.browser.js.map +1 -0
  283. package/lib/packlets/config/index.d.ts +7 -0
  284. package/lib/packlets/config/index.d.ts.map +1 -0
  285. package/lib/packlets/config/index.js +68 -0
  286. package/lib/packlets/config/index.js.map +1 -0
  287. package/lib/packlets/config/json.d.ts +20 -0
  288. package/lib/packlets/config/json.d.ts.map +1 -0
  289. package/lib/packlets/config/json.js +24 -0
  290. package/lib/packlets/config/json.js.map +1 -0
  291. package/lib/packlets/config/predefined/default.d.ts +57 -0
  292. package/lib/packlets/config/predefined/default.d.ts.map +1 -0
  293. package/lib/packlets/config/predefined/default.js +141 -0
  294. package/lib/packlets/config/predefined/default.js.map +1 -0
  295. package/lib/packlets/config/predefined/extended.d.ts +25 -0
  296. package/lib/packlets/config/predefined/extended.d.ts.map +1 -0
  297. package/lib/packlets/config/predefined/extended.js +193 -0
  298. package/lib/packlets/config/predefined/extended.js.map +1 -0
  299. package/lib/packlets/config/predefined/index.d.ts +4 -0
  300. package/lib/packlets/config/predefined/index.d.ts.map +1 -0
  301. package/lib/packlets/config/predefined/index.js +62 -0
  302. package/lib/packlets/config/predefined/index.js.map +1 -0
  303. package/lib/packlets/config/systemConfiguration.d.ts +94 -0
  304. package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
  305. package/lib/packlets/config/systemConfiguration.js +152 -0
  306. package/lib/packlets/config/systemConfiguration.js.map +1 -0
  307. package/lib/packlets/context/contextDecls.d.ts.map +1 -0
  308. package/lib/packlets/context/contextDecls.js.map +1 -0
  309. package/lib/packlets/context/contextToken.d.ts.map +1 -0
  310. package/lib/packlets/context/contextToken.js.map +1 -0
  311. package/lib/packlets/context/convert/decls.d.ts.map +1 -0
  312. package/lib/packlets/context/convert/decls.js.map +1 -0
  313. package/lib/packlets/context/convert/index.d.ts.map +1 -0
  314. package/lib/packlets/context/convert/index.js.map +1 -0
  315. package/lib/packlets/context/index.d.ts.map +1 -0
  316. package/lib/packlets/context/index.js.map +1 -0
  317. package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -0
  318. package/lib/packlets/decisions/abstractDecision.js.map +1 -0
  319. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -0
  320. package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  321. package/lib/packlets/decisions/candidate.d.ts.map +1 -0
  322. package/lib/packlets/decisions/candidate.js.map +1 -0
  323. package/lib/packlets/decisions/common.d.ts.map +1 -0
  324. package/lib/packlets/decisions/common.js.map +1 -0
  325. package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -0
  326. package/lib/packlets/decisions/concreteDecision.js.map +1 -0
  327. package/lib/packlets/decisions/decision.d.ts +1 -1
  328. package/lib/packlets/decisions/decision.d.ts.map +1 -0
  329. package/lib/packlets/decisions/decision.js +1 -1
  330. package/lib/packlets/decisions/decision.js.map +1 -0
  331. package/lib/packlets/decisions/index.d.ts.map +1 -0
  332. package/lib/packlets/decisions/index.js.map +1 -0
  333. package/lib/packlets/import/fsItem.d.ts +1 -4
  334. package/lib/packlets/import/fsItem.d.ts.map +1 -0
  335. package/lib/packlets/import/fsItem.js +1 -4
  336. package/lib/packlets/import/fsItem.js.map +1 -0
  337. package/lib/packlets/import/importContext.d.ts +5 -5
  338. package/lib/packlets/import/importContext.d.ts.map +1 -0
  339. package/lib/packlets/import/importContext.js +3 -3
  340. package/lib/packlets/import/importContext.js.map +1 -0
  341. package/lib/packlets/import/importManager.d.ts +15 -1
  342. package/lib/packlets/import/importManager.d.ts.map +1 -0
  343. package/lib/packlets/import/importManager.js +7 -3
  344. package/lib/packlets/import/importManager.js.map +1 -0
  345. package/lib/packlets/import/importable.d.ts.map +1 -0
  346. package/lib/packlets/import/importable.js.map +1 -0
  347. package/lib/packlets/import/importers/collectionImporter.d.ts +2 -2
  348. package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -0
  349. package/lib/packlets/import/importers/collectionImporter.js +2 -2
  350. package/lib/packlets/import/importers/collectionImporter.js.map +1 -0
  351. package/lib/packlets/import/importers/fsItemImporter.d.ts +16 -2
  352. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -0
  353. package/lib/packlets/import/importers/fsItemImporter.js +29 -13
  354. package/lib/packlets/import/importers/fsItemImporter.js.map +1 -0
  355. package/lib/packlets/import/importers/importer.d.ts.map +1 -0
  356. package/lib/packlets/import/importers/importer.js.map +1 -0
  357. package/lib/packlets/import/importers/index.browser.d.ts.map +1 -0
  358. package/lib/packlets/import/importers/index.browser.js.map +1 -0
  359. package/lib/packlets/import/importers/index.d.ts.map +1 -0
  360. package/lib/packlets/import/importers/index.js.map +1 -0
  361. package/lib/packlets/import/importers/jsonImporter.d.ts +2 -2
  362. package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -0
  363. package/lib/packlets/import/importers/jsonImporter.js +2 -2
  364. package/lib/packlets/import/importers/jsonImporter.js.map +1 -0
  365. package/lib/packlets/import/importers/pathImporter.d.ts +1 -1
  366. package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -0
  367. package/lib/packlets/import/importers/pathImporter.js +1 -1
  368. package/lib/packlets/import/importers/pathImporter.js.map +1 -0
  369. package/lib/packlets/import/index.browser.d.ts.map +1 -0
  370. package/lib/packlets/import/index.browser.js.map +1 -0
  371. package/lib/packlets/import/index.d.ts.map +1 -0
  372. package/lib/packlets/import/index.js.map +1 -0
  373. package/lib/packlets/qualifier-types/config/convert.d.ts +65 -0
  374. package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
  375. package/lib/packlets/qualifier-types/config/convert.js +161 -0
  376. package/lib/packlets/qualifier-types/config/convert.js.map +1 -0
  377. package/lib/packlets/qualifier-types/config/index.d.ts +4 -0
  378. package/lib/packlets/qualifier-types/config/index.d.ts.map +1 -0
  379. package/lib/packlets/qualifier-types/config/index.js +64 -0
  380. package/lib/packlets/qualifier-types/config/index.js.map +1 -0
  381. package/lib/packlets/qualifier-types/config/json.d.ts +91 -0
  382. package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
  383. package/lib/packlets/qualifier-types/config/json.js +35 -0
  384. package/lib/packlets/qualifier-types/config/json.js.map +1 -0
  385. package/lib/packlets/qualifier-types/convert.d.ts.map +1 -0
  386. package/lib/packlets/qualifier-types/convert.js.map +1 -0
  387. package/lib/packlets/qualifier-types/helpers.d.ts.map +1 -0
  388. package/lib/packlets/qualifier-types/helpers.js.map +1 -0
  389. package/lib/packlets/qualifier-types/index.d.ts.map +1 -0
  390. package/lib/packlets/qualifier-types/index.js.map +1 -0
  391. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +6 -7
  392. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -0
  393. package/lib/packlets/qualifier-types/languageQualifierType.js +6 -7
  394. package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  395. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +7 -10
  396. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -0
  397. package/lib/packlets/qualifier-types/literalQualifierType.js +7 -10
  398. package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  399. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
  400. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  401. package/lib/packlets/qualifier-types/qualifierType.d.ts +17 -18
  402. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -0
  403. package/lib/packlets/qualifier-types/qualifierType.js +12 -13
  404. package/lib/packlets/qualifier-types/qualifierType.js.map +1 -0
  405. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -0
  406. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  407. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +8 -8
  408. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -0
  409. package/lib/packlets/qualifier-types/territoryQualifierType.js +5 -5
  410. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  411. package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -0
  412. package/lib/packlets/qualifiers/convert/decls.js.map +1 -0
  413. package/lib/packlets/qualifiers/convert/index.d.ts.map +1 -0
  414. package/lib/packlets/qualifiers/convert/index.js.map +1 -0
  415. package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +1 -0
  416. package/lib/packlets/qualifiers/convert/qualifier.js.map +1 -0
  417. package/lib/packlets/qualifiers/index.d.ts.map +1 -0
  418. package/lib/packlets/qualifiers/index.js.map +1 -0
  419. package/lib/packlets/qualifiers/qualifier.d.ts +6 -7
  420. package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -0
  421. package/lib/packlets/qualifiers/qualifier.js +6 -7
  422. package/lib/packlets/qualifiers/qualifier.js.map +1 -0
  423. package/lib/packlets/qualifiers/qualifierCollector.d.ts +3 -3
  424. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -0
  425. package/lib/packlets/qualifiers/qualifierCollector.js +2 -2
  426. package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -0
  427. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -0
  428. package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -0
  429. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +1 -0
  430. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  431. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +1 -0
  432. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  433. package/lib/packlets/resource-json/compiled/common.d.ts.map +1 -0
  434. package/lib/packlets/resource-json/compiled/common.js.map +1 -0
  435. package/lib/packlets/resource-json/compiled/convert.d.ts.map +1 -0
  436. package/lib/packlets/resource-json/compiled/convert.js.map +1 -0
  437. package/lib/packlets/resource-json/compiled/index.d.ts.map +1 -0
  438. package/lib/packlets/resource-json/compiled/index.js.map +1 -0
  439. package/lib/packlets/resource-json/compiled/json.d.ts.map +1 -0
  440. package/lib/packlets/resource-json/compiled/json.js.map +1 -0
  441. package/lib/packlets/resource-json/convert.d.ts.map +1 -0
  442. package/lib/packlets/resource-json/convert.js.map +1 -0
  443. package/lib/packlets/resource-json/helpers.d.ts.map +1 -0
  444. package/lib/packlets/resource-json/helpers.js.map +1 -0
  445. package/lib/packlets/resource-json/index.d.ts.map +1 -0
  446. package/lib/packlets/resource-json/index.js.map +1 -0
  447. package/lib/packlets/resource-json/json.d.ts.map +1 -0
  448. package/lib/packlets/resource-json/json.js.map +1 -0
  449. package/lib/packlets/resource-json/normalized.d.ts.map +1 -0
  450. package/lib/packlets/resource-json/normalized.js.map +1 -0
  451. package/lib/packlets/resource-json/resourceDeclCollection.d.ts +1 -1
  452. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -0
  453. package/lib/packlets/resource-json/resourceDeclCollection.js +1 -1
  454. package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  455. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -0
  456. package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  457. package/lib/packlets/resource-json/resourceDeclTree.d.ts +1 -1
  458. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -0
  459. package/lib/packlets/resource-json/resourceDeclTree.js +1 -1
  460. package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -0
  461. package/lib/packlets/resource-types/config/convert.d.ts +8 -0
  462. package/lib/packlets/resource-types/config/convert.d.ts.map +1 -0
  463. package/lib/packlets/resource-types/config/convert.js +38 -0
  464. package/lib/packlets/resource-types/config/convert.js.map +1 -0
  465. package/lib/packlets/resource-types/config/index.d.ts +4 -0
  466. package/lib/packlets/resource-types/config/index.d.ts.map +1 -0
  467. package/lib/packlets/resource-types/config/index.js +64 -0
  468. package/lib/packlets/resource-types/config/index.js.map +1 -0
  469. package/lib/packlets/resource-types/config/json.d.ts +11 -0
  470. package/lib/packlets/resource-types/config/json.d.ts.map +1 -0
  471. package/lib/packlets/resource-types/config/json.js +24 -0
  472. package/lib/packlets/resource-types/config/json.js.map +1 -0
  473. package/lib/packlets/resource-types/helpers.d.ts.map +1 -0
  474. package/lib/packlets/resource-types/helpers.js.map +1 -0
  475. package/lib/packlets/resource-types/index.d.ts.map +1 -0
  476. package/lib/packlets/resource-types/index.js.map +1 -0
  477. package/lib/packlets/resource-types/jsonResourceType.d.ts +17 -5
  478. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -0
  479. package/lib/packlets/resource-types/jsonResourceType.js +2 -2
  480. package/lib/packlets/resource-types/jsonResourceType.js.map +1 -0
  481. package/lib/packlets/resource-types/resourceType.d.ts +5 -5
  482. package/lib/packlets/resource-types/resourceType.d.ts.map +1 -0
  483. package/lib/packlets/resource-types/resourceType.js +2 -2
  484. package/lib/packlets/resource-types/resourceType.js.map +1 -0
  485. package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +1 -0
  486. package/lib/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  487. package/lib/packlets/resources/candidateReducer.d.ts.map +1 -0
  488. package/lib/packlets/resources/candidateReducer.js.map +1 -0
  489. package/lib/packlets/resources/candidateValue.d.ts.map +1 -0
  490. package/lib/packlets/resources/candidateValue.js.map +1 -0
  491. package/lib/packlets/resources/candidateValueCollector.d.ts.map +1 -0
  492. package/lib/packlets/resources/candidateValueCollector.js.map +1 -0
  493. package/lib/packlets/resources/common.d.ts.map +1 -0
  494. package/lib/packlets/resources/common.js.map +1 -0
  495. package/lib/packlets/resources/deltaGenerator.d.ts.map +1 -0
  496. package/lib/packlets/resources/deltaGenerator.js.map +1 -0
  497. package/lib/packlets/resources/index.d.ts.map +1 -0
  498. package/lib/packlets/resources/index.js.map +1 -0
  499. package/lib/packlets/resources/resource.d.ts.map +1 -0
  500. package/lib/packlets/resources/resource.js.map +1 -0
  501. package/lib/packlets/resources/resourceBuilder.d.ts +2 -2
  502. package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -0
  503. package/lib/packlets/resources/resourceBuilder.js +2 -2
  504. package/lib/packlets/resources/resourceBuilder.js.map +1 -0
  505. package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -0
  506. package/lib/packlets/resources/resourceCandidate.js.map +1 -0
  507. package/lib/packlets/resources/resourceManagerBuilder.d.ts +5 -5
  508. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
  509. package/lib/packlets/resources/resourceManagerBuilder.js +5 -5
  510. package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -0
  511. package/lib/packlets/runtime/cacheListener.d.ts.map +1 -0
  512. package/lib/packlets/runtime/cacheListener.js.map +1 -0
  513. package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -0
  514. package/lib/packlets/runtime/cacheMetrics.js.map +1 -0
  515. package/lib/packlets/runtime/compiledResourceCollection.d.ts +5 -5
  516. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
  517. package/lib/packlets/runtime/compiledResourceCollection.js +5 -5
  518. package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -0
  519. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +1 -0
  520. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  521. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +1 -0
  522. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  523. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +1 -0
  524. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  525. package/lib/packlets/runtime/context/index.d.ts.map +1 -0
  526. package/lib/packlets/runtime/context/index.js.map +1 -0
  527. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -0
  528. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  529. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -0
  530. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  531. package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -0
  532. package/lib/packlets/runtime/iResourceManager.js.map +1 -0
  533. package/lib/packlets/runtime/index.d.ts.map +1 -0
  534. package/lib/packlets/runtime/index.js.map +1 -0
  535. package/lib/packlets/runtime/resource-tree/common.d.ts.map +1 -0
  536. package/lib/packlets/runtime/resource-tree/common.js.map +1 -0
  537. package/lib/packlets/runtime/resource-tree/index.d.ts.map +1 -0
  538. package/lib/packlets/runtime/resource-tree/index.js.map +1 -0
  539. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +1 -0
  540. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  541. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +1 -0
  542. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  543. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +1 -0
  544. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  545. package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -0
  546. package/lib/packlets/runtime/resourceResolver.js.map +1 -0
  547. package/lib/packlets/runtime/resourceTreeResolver.d.ts.map +1 -0
  548. package/lib/packlets/runtime/resourceTreeResolver.js.map +1 -0
  549. package/lib/packlets/runtime/validate.d.ts.map +1 -0
  550. package/lib/packlets/runtime/validate.js.map +1 -0
  551. package/lib/packlets/zip-archive/convert.d.ts.map +1 -0
  552. package/lib/packlets/zip-archive/convert.js.map +1 -0
  553. package/lib/packlets/zip-archive/index.browser.d.ts.map +1 -0
  554. package/lib/packlets/zip-archive/index.browser.js.map +1 -0
  555. package/lib/packlets/zip-archive/index.d.ts.map +1 -0
  556. package/lib/packlets/zip-archive/index.js.map +1 -0
  557. package/lib/packlets/zip-archive/json.d.ts.map +1 -0
  558. package/lib/packlets/zip-archive/json.js.map +1 -0
  559. package/lib/packlets/zip-archive/types.d.ts.map +1 -0
  560. package/lib/packlets/zip-archive/types.js.map +1 -0
  561. package/lib/packlets/zip-archive/zipArchiveCreator.d.ts.map +1 -0
  562. package/lib/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  563. package/lib/packlets/zip-archive/zipArchiveFormat.d.ts.map +1 -0
  564. package/lib/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  565. package/lib/packlets/zip-archive/zipArchiveLoader.d.ts.map +1 -0
  566. package/lib/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  567. package/package.json +28 -26
  568. package/dist/test/data/sample.json +0 -32
  569. package/dist/test/unit/qualifier-types/testQualifierType.js +0 -76
  570. package/dist/test/unit/resource-types/testDerivedResourceType.js +0 -109
  571. package/dist/test/unit/resources/deltaGenerator.helpers.js +0 -282
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextToken.js","sourceRoot":"","sources":["../../../src/packlets/context/contextToken.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAkE;AAClE,sCAA2F;AAI3F;;;GAGG;AACH,MAAa,aAA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E5B,KAAK,MAAM,CAAC,aAAa,EAAE,YAAY,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YACpE,mCAAmC;YACnC,MAAM,CAAC,IAAI,CAAC,GAAG,aAAa,IAAI,YAAY,EAAE,CAAC,CAAC;QAClD,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,IAAA,kBAAO,EAAC,EAAE,CAAC,CAAC;QACrB,CAAC;QAED,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAErC,+BAA+B;QAC/B,OAAO,gBAAa,CAAC,iBAAiB,CACpC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACnB,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;QAC9B,CAAC,CAAC,CACH,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAA,kBAAO,EAAC,WAAW,CAAC,CAAC,CAAC;IAC1C,CAAC;CACF;AA5ND,sCA4NC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { mapResults, Result, fail, succeed } from '@fgv/ts-utils';\nimport { Helpers as CommonHelpers, QualifierName, QualifierContextValue } from '../common';\nimport { IValidatedContextQualifierValueDecl, IValidatedContextDecl } from './contextDecls';\nimport { IReadOnlyQualifierCollector, Qualifier } from '../qualifiers';\n\n/**\n * Helper class to parse and validate context tokens.\n * @public\n */\nexport class ContextTokens {\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} used to validate\n * qualifier names and values.\n */\n public readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Constructs a new {@link Context.ContextTokens | ContextTokens } instance.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n */\n public constructor(qualifiers: IReadOnlyQualifierCollector) {\n this.qualifiers = qualifiers;\n }\n\n /**\n * Parses a {@link ContextQualifierToken | context qualifier token} string and validates the parts\n * against the qualifiers present in the {@link Context.ContextTokens.qualifiers | qualifier collector}.\n * @param token - the token string to parse.\n * @returns `Success` with the {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declaration}\n * if successful, `Failure` with an error message if not.\n */\n public parseContextQualifierToken(token: string): Result<IValidatedContextQualifierValueDecl> {\n return ContextTokens.parseContextQualifierToken(token, this.qualifiers);\n }\n\n /**\n * Parses a {@link ContextToken | context token} string and validates the parts\n * against the qualifiers present in the {@link Context.ContextTokens.qualifiers | qualifier collector}.\n * @param token - the token string to parse.\n * @returns `Success` with the array of {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declarations}\n * if successful, `Failure` with an error message if not.\n */\n public parseContextToken(token: string): Result<IValidatedContextQualifierValueDecl[]> {\n return ContextTokens.parseContextToken(token, this.qualifiers);\n }\n\n /**\n * Validates the {@link Helpers.IContextTokenParts | parts} of a {@link ContextToken | context token}.\n * @param parts - the parts to validate\n * @returns `Success` with the validated declaration if successful, `Failure` with an error message if not.\n */\n public validateContextTokenParts(\n parts: CommonHelpers.IContextTokenParts\n ): Result<IValidatedContextQualifierValueDecl> {\n return ContextTokens.validateContextTokenParts(parts, this.qualifiers);\n }\n\n /**\n * Given a value, finds a single token-optional qualifier that matches the value.\n * Fails if no qualifiers match, or if more than one qualifier matches.\n * @param value - the value to match.\n * @returns `Success` with the matching qualifier if successful, `Failure` with an error message if not.\n */\n public findQualifierForValue(value: string): Result<Qualifier> {\n return ContextTokens.findQualifierForValue(value, this.qualifiers);\n }\n\n /**\n * Converts a {@link ContextToken | context token} to a validated partial context.\n * @param token - the context token to convert\n * @returns `Success` with the validated partial context if successful, `Failure` with an error message if not.\n */\n public contextTokenToPartialContext(token: string): Result<IValidatedContextDecl> {\n return ContextTokens.contextTokenToPartialContext(token, this.qualifiers);\n }\n\n /**\n * Converts a validated partial context to a {@link ContextToken | context token}.\n * @param context - the validated partial context to convert\n * @returns `Success` with the context token if successful, `Failure` with an error message if not.\n */\n public partialContextToContextToken(context: IValidatedContextDecl): Result<string> {\n return ContextTokens.partialContextToContextToken(context);\n }\n\n /**\n * Parses a {@link ContextQualifierToken | context qualifier token} and validates it against the qualifiers\n * present in the supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param token - the token string to parse.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n * @returns `Success` with a {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declaration} if successful,\n * `Failure` with an error message if not.\n */\n public static parseContextQualifierToken(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedContextQualifierValueDecl> {\n return CommonHelpers.parseContextQualifierTokenParts(token).onSuccess((parts) => {\n return ContextTokens.validateContextTokenParts(parts, qualifiers);\n });\n }\n\n /**\n * Parses a {@link ContextToken | context token} and validates it against the qualifiers\n * present in the supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param token - the token string to parse.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n * @returns `Success` with an array of {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declarations}\n * if successful, `Failure` with an error message if not\n */\n public static parseContextToken(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedContextQualifierValueDecl[]> {\n return CommonHelpers.parseContextTokenParts(token).onSuccess((parts) => {\n return mapResults(parts.map((part) => ContextTokens.validateContextTokenParts(part, qualifiers)));\n });\n }\n\n /**\n * Validates the parts of a context token against the qualifiers present in the supplied\n * {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param parts - the {@link Helpers.IContextTokenParts | context token parts} to validate.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} used to\n * validate qualifier names and values.\n * @returns `Success` with a {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declaration} if successful,\n * `Failure` with an error message if not.\n */\n public static validateContextTokenParts(\n parts: CommonHelpers.IContextTokenParts,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedContextQualifierValueDecl> {\n const qualifierLookup =\n parts.qualifier === undefined\n ? ContextTokens.findQualifierForValue(parts.value, qualifiers)\n : qualifiers.getByNameOrToken(parts.qualifier);\n\n return qualifierLookup.onSuccess((qualifier) => {\n return qualifier.type\n .validateContextValue(parts.value)\n .onSuccess((value) => {\n return succeed({ qualifier, value });\n })\n .withDetail('failure', 'success');\n });\n }\n\n /**\n * Given a value and a set of qualifiers, finds a single token-optional qualifier that matches the value.\n * Fails if no qualifiers match, or if more than one qualifier matches.\n * @param value - the value to match.\n * @param qualifiers - the qualifiers to match against.\n * @returns `Success` with the matching qualifier if successful, `Failure` with an error message if not.\n */\n public static findQualifierForValue(\n value: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<Qualifier> {\n const matched: Qualifier[] = [];\n for (const qualifier of qualifiers.values()) {\n if (qualifier.tokenIsOptional && qualifier.validateContextValue(value).isSuccess()) {\n matched.push(qualifier);\n }\n }\n if (matched.length === 0) {\n return fail(`${value}: does not match any qualifier`);\n }\n if (matched.length > 1) {\n return fail(`${value}: matches multiple qualifiers (${matched.map((q) => q.name).join(', ')})`);\n }\n return succeed(matched[0]);\n }\n\n /**\n * Converts a {@link ContextToken | context token} to a validated partial context.\n * @param token - the context token to convert\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n * @returns `Success` with the validated partial context if successful, `Failure` with an error message if not.\n */\n public static contextTokenToPartialContext(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedContextDecl> {\n return ContextTokens.parseContextToken(token, qualifiers).onSuccess((qualifierValues) => {\n const context: IValidatedContextDecl = {};\n\n for (const { qualifier, value } of qualifierValues) {\n const qualifierName = qualifier.name as QualifierName;\n const contextValue = value as QualifierContextValue;\n\n // Check for duplicate qualifiers\n if (qualifierName in context) {\n return fail(`${qualifier.name}: duplicate qualifier in context token`);\n }\n\n context[qualifierName] = contextValue;\n }\n\n return succeed(context);\n });\n }\n\n /**\n * Converts a validated partial context to a {@link ContextToken | context token}.\n * @param context - the validated partial context to convert\n * @returns `Success` with the context token if successful, `Failure` with an error message if not.\n */\n public static partialContextToContextToken(context: IValidatedContextDecl): Result<string> {\n const tokens: string[] = [];\n\n for (const [qualifierName, contextValue] of Object.entries(context)) {\n // Build token as \"qualifier=value\"\n tokens.push(`${qualifierName}=${contextValue}`);\n }\n\n if (tokens.length === 0) {\n return succeed('');\n }\n\n const tokenString = tokens.join('|');\n\n // Validate the generated token\n return CommonHelpers.buildContextToken(\n tokens.map((token) => {\n const [qualifier, value] = token.split('=');\n return { qualifier, value };\n })\n ).onSuccess(() => succeed(tokenString));\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decls.d.ts","sourceRoot":"","sources":["../../../../src/packlets/context/convert/decls.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,mCAAmC,EACpC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAI/D;;;GAGG;AACH,eAAO,MAAM,yBAAyB,8EAGpC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,WAAW,oEAAyC,CAAC;AAElE;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,UAAU,EAAE,2BAA2B,CAAC;CAClD;AAED;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,oGAyB9C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,sFA4BhC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decls.js","sourceRoot":"","sources":["../../../../src/packlets/context/convert/decls.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAiG;AAQjG,2CAA2C;AAE3C;;;GAGG;AACU,QAAA,yBAAyB,GAAG,qBAAU,CAAC,YAAY,CAA6B;IAC3F,SAAS,EAAE,qBAAU,CAAC,MAAM;IAC5B,KAAK,EAAE,qBAAU,CAAC,MAAM;CACzB,CAAC,CAAC;AAEH;;;GAGG;AACU,QAAA,WAAW,GAAG,qBAAU,CAAC,QAAQ,CAAC,qBAAU,CAAC,MAAM,CAAC,CAAC;AAalE;;;;;GAKG;AACU,QAAA,kCAAkC,GAAG,qBAAU,CAAC,OAAO,CAIlE,CACE,IAAa,EACb,MAAM,EACN,OAAoC,EACS,EAAE;IAC/C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,kBAAO,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,iCAAyB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,IA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ACN,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;yBAC/B,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;wBACnB,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;wBAC/B,OAAO,IAAA,kBAAO,EAAC,KAAK,CAAC,CAAC;oBACxB,CAAC,CAAC;yBACD,cAAc,CAAC,MAAM,CAAC,CAAC;gBAC5B,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC,cAAc,CAAC,kBAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC,CACF,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Converters, Failure, MessageAggregator, Result, succeed, Success } from '@fgv/ts-utils';\nimport {\n IContextQualifierValueDecl,\n IValidatedContextDecl,\n IValidatedContextQualifierValueDecl\n} from '../contextDecls';\nimport { IReadOnlyQualifierCollector } from '../../qualifiers';\n\n/* eslint-disable @rushstack/typedef-var */\n\n/**\n * Converter for a {@link Context.IContextQualifierValueDecl | context qualifier value declaration}.\n * @public\n */\nexport const contextQualifierValueDecl = Converters.strictObject<IContextQualifierValueDecl>({\n qualifier: Converters.string,\n value: Converters.string\n});\n\n/**\n * Converter for a {@link Context.IContextDecl | context declaration}.\n * @public\n */\nexport const contextDecl = Converters.recordOf(Converters.string);\n\n/**\n * Context necessary to convert a {@link Context.IContextQualifierValueDecl | context qualifier value declaration}\n * or {@link Context.IContextDecl | context declaration} to their\n * equivalent - {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declaration}\n * or {@link Context.IValidatedContextDecl | validated context declaration}, respectively.\n * @public\n */\nexport interface IContextDeclConvertContext {\n readonly qualifiers: IReadOnlyQualifierCollector;\n}\n\n/**\n * Converter which constructs a {@link Context.IValidatedContextQualifierValueDecl | validated context qualifier value declaration}\n * from a {@link Context.IContextQualifierValueDecl | context qualifier value declaration}, instantiating qualifiers by name\n * from a supplied {@link Context.Convert.IContextDeclConvertContext | conversion context}.\n * @public\n */\nexport const validatedContextQualifierValueDecl = Converters.generic<\n IValidatedContextQualifierValueDecl,\n IContextDeclConvertContext\n>(\n (\n from: unknown,\n __self,\n context?: IContextDeclConvertContext\n ): Result<IValidatedContextQualifierValueDecl> => {\n if (!context) {\n return Failure.with('validatedContextQualifierValueDecl converter requires a context');\n }\n return contextQualifierValueDecl.convert(from).onSuccess((decl) => {\n const { value: qualifier, message } = context.qualifiers.validating.get(decl.qualifier);\n if (message !== undefined) {\n return Failure.with(message);\n }\n return qualifier.validateContextValue(decl.value).onSuccess((value) => {\n return Success.with({\n qualifier,\n value\n });\n });\n });\n }\n);\n\n/**\n * Converter which constructs a {@link Context.IValidatedContextDecl | validated context declaration}\n * from a {@link Context.IContextDecl | context declaration}, instantiating qualifiers by name\n * from a supplied {@link Context.Convert.IContextDeclConvertContext | conversion context}.\n * @public\n */\nexport const validatedContextDecl = Converters.generic<IValidatedContextDecl, IContextDeclConvertContext>(\n (from: unknown, __self, context?: IContextDeclConvertContext): Result<IValidatedContextDecl> => {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!context) {\n return Failure.with('validatedContextDecl converter requires a context');\n }\n\n return contextDecl.convert(from).onSuccess((decl) => {\n const errors = new MessageAggregator();\n const result: IValidatedContextDecl = {};\n\n for (const key in decl) {\n if (key in decl) {\n const { value: qualifier } = context.qualifiers.validating.get(key).aggregateError(errors);\n if (qualifier !== undefined) {\n qualifier\n .validateContextValue(decl[key])\n .onSuccess((value) => {\n result[qualifier.name] = value;\n return succeed(value);\n })\n .aggregateError(errors);\n }\n }\n }\n return errors.returnOrReport(Success.with(result));\n });\n }\n);\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/context/convert/index.ts"],"names":[],"mappings":"AAsBA,cAAc,SAAS,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/context/convert/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,0CAAwB","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport * from './decls';\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/context/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/context/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AAI5B,0BAAO;AAHhB,iDAA+B;AAC/B,iDAA+B","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';\nexport * from './contextDecls';\nexport * from './contextToken';\n\nexport { Convert };\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractDecision.d.ts","sourceRoot":"","sources":["../../../src/packlets/decisions/abstractDecision.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC;AAEjD;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC5C,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,qBAAa,gBAAiB,SAAQ,QAAQ,CAAC,MAAM,CAAC;IACpD;;;;;OAKG;IACH,SAAS,aAAa,MAAM,EAAE,6BAA6B;IAO3D;;;;;;;OAOG;WACW,sBAAsB,CAAC,MAAM,EAAE,6BAA6B,GAAG,MAAM,CAAC,gBAAgB,CAAC;IAIrG;;;;;OAKG;IACI,UAAU,CACf,OAAO,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,wBAAwB,GACvD,YAAY,CAAC,QAAQ,CAAC,yBAAyB;CAMnD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractDecision.js","sourceRoot":"","sources":["../../../src/packlets/decisions/abstractDecision.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAsD;AAEtD,2CAAwC;AACxC,yCAAsC;AAYtC;;;;;;;;GAQG;AACH,MAAa,gBAAiB,SAAQ,mBAAgB;IACpD;;;;;OAKG;IACH,YAAsB,MAAqC;QACzD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;aAChD,GAAG,CAAC,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE,CAAC,qBAAS,CAAC,eAAe,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;aAC1F,IAAI,CAAC,qBAAS,CAAC,OAAO,CAAC,CAAC;QAC3B,KAAK,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,CAAC,sBAAsB,CAAC,MAAqC;QACxE,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;OAKG;IACI,UAAU,CACf,OAAwD;QAExD,uBACE,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,KAAM,CAAC,IAC7D,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,MAAK,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAC7E;IACJ,CAAC;CACF;AAxCD,4CAwCC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, Result } from '@fgv/ts-utils';\nimport { ConditionSet } from '../conditions';\nimport { Candidate } from './candidate';\nimport { Decision } from './decision';\nimport * as ResourceJson from '../resource-json';\n\n/**\n * Parameters to create an {@link Decisions.AbstractDecision | AbstractDecision}.\n * @public\n */\nexport interface IAbstractDecisionCreateParams {\n conditionSets: ConditionSet[];\n index?: number;\n}\n\n/**\n * An abstract decision represents a class of decisions with candidates\n * that differ only in value. It is a {@link Decisions.Decision | IDecision<number>}\n * in which the `number` values are sequentially assigned indexes.\n * This allows us to represent each related {@link Decisions.IDecision | decision} as an\n * {@link Decisions.AbstractDecision | abstract decision} and a matching array containing\n * the corresponding value for each candidate. This representation is highly cacheable.\n * @public\n */\nexport class AbstractDecision extends Decision<number> {\n /**\n * Constructor for an {@link Decisions.AbstractDecision | AbstractDecision} object.\n * @param params - {@link Decisions.IAbstractDecisionCreateParams | Parameters}\n * used to create the decision.\n * @public\n */\n protected constructor(params: IAbstractDecisionCreateParams) {\n const candidates = Array.from(params.conditionSets)\n .map((conditionSet, value) => Candidate.createCandidate({ conditionSet, value }).orThrow())\n .sort(Candidate.compare);\n super({ candidates, index: params.index, isAbstract: true });\n }\n\n /**\n * Creates a new {@link Decisions.AbstractDecision | AbstractDecision} object.\n * @param params - {@link Decisions.IAbstractDecisionCreateParams | Parameters}\n * used to create the decision.\n * @returns `Success` with the new decision if successful, or `Failure` with an\n * error message if not.\n * @public\n */\n public static createAbstractDecision(params: IAbstractDecisionCreateParams): Result<AbstractDecision> {\n return captureResult(() => new AbstractDecision(params));\n }\n\n /**\n * Converts this abstract decision to a compiled abstract decision representation.\n * @param options - Optional compilation options controlling the output format.\n * @returns A compiled abstract decision object that can be used for serialization or runtime processing.\n * @public\n */\n public toCompiled(\n options?: ResourceJson.Compiled.ICompiledResourceOptions\n ): ResourceJson.Compiled.ICompiledAbstractDecision {\n return {\n conditionSets: this.candidates.map((c) => c.conditionSet.index!),\n ...(options?.includeMetadata === true ? { metadata: { key: this.key } } : {})\n };\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractDecisionCollector.d.ts","sourceRoot":"","sources":["../../../src/packlets/decisions/abstractDecisionCollector.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,WAAW,EAAE,MAAM,EAAiB,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAA4B,aAAa,EAAyB,MAAM,WAAW,CAAC;AAC3F,OAAO,EAAgB,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAE5E;;;GAGG;AACH,MAAM,WAAW,sCAAsC;IACrD;;;OAGG;IACH,aAAa,EAAE,6BAA6B,CAAC;CAC9C;AAED;;;GAGG;AACH,qBAAa,yBAA0B,SAAQ,mBAAmB,CAAC,gBAAgB,CAAC;IAClF;;;OAGG;IACH,SAAgB,aAAa,EAAE,6BAA6B,CAAC;IAE7D;;OAEG;IACH,IAAW,aAAa,IAAI,gBAAgB,CAE3C;IAED;;OAEG;IACH,IAAW,mBAAmB,IAAI,gBAAgB,CAEjD;IAED;;OAEG;IACH,gBAAuB,kBAAkB,EAAE,aAAa,CAAyC;IAEjG;;OAEG;IACH,gBAAuB,wBAAwB,EAAE,aAAa,CAAyC;IAEvG;;OAEG;IACH,SAAS,aAAa,MAAM,EAAE,sCAAsC;IAapE;;;OAGG;WACW,MAAM,CAAC,MAAM,EAAE,sCAAsC,GAAG,MAAM,CAAC,yBAAyB,CAAC;IAIvG,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,oBAAoB;CAG7B;AAED;;;GAGG;AACH,MAAM,MAAM,iCAAiC,GAAG,WAAW,CAAC,4BAA4B,CAAC,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractDecisionCollector.js","sourceRoot":"","sources":["../../../src/packlets/decisions/abstractDecisionCollector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAuG;AACvG,yDAAsD;AACtD,sCAA2F;AAC3F,8CAA4E;AAc5E;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,8BAAqC;IAOlF;;OAEG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,CAAC,OAAO,EAAE,CAAC;IAC5E,CAAC;IAED;;OAEG;IACH,IAAW,mBAAmB;QAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,wBAAwB,CAAC,CAAC,OAAO,EAAE,CAAC;IAClF,CAAC;IAYD;;OAEG;IACH,YAAsB,MAA8C;QAClE,KAAK,CAAC;YACJ,UAAU,EAAE,IAAI,sBAAW,CAAC,kBAAkB,CAAgC;gBAC5E,GAAG,EAAE,gBAAa,CAAC,WAAW;gBAC9B,KAAK,EAAE,CAAC,IAAa,EAAE,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC;aACzD,CAAC;SACH,CAAC,CAAC;QACH,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;QAC1C,IAAI,CAAC,GAAG,CAAC,mCAAgB,CAAC,sBAAsB,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,E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AAE,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 { captureResult, Collections, Result, fail, succeed, ValidatingCollector } from '@fgv/ts-utils';\nimport { AbstractDecision } from './abstractDecision';\nimport { Convert as CommonConvert, DecisionIndex, DecisionKey, Validate } from '../common';\nimport { ConditionSet, ReadOnlyConditionSetCollector } from '../conditions';\n\n/**\n * Parameters for creating a {@link Decisions.AbstractDecisionCollector | AbstractDecisionCollector}.\n * @public\n */\nexport interface IAbstractDecisionCollectorCreateParams {\n /**\n * {@link Conditions.ReadOnlyConditionSetCollector | ConditionSetCollector} used to create conditions\n * sets for decisions in this collector.\n */\n conditionSets: ReadOnlyConditionSetCollector;\n}\n\n/**\n * A `ValidatingCollector` for {@link Decisions.AbstractDecision | AbstractDecisions}.\n * @public\n */\nexport class AbstractDecisionCollector extends ValidatingCollector<AbstractDecision> {\n /**\n * The {@link Conditions.ReadOnlyConditionSetCollector | ConditionSetCollector} used to create conditions\n * sets for decisions in this collector.\n */\n public readonly conditionSets: ReadOnlyConditionSetCollector;\n\n /**\n * The empty decision (no condition sets) for this collector.\n */\n public get emptyDecision(): AbstractDecision {\n return this.getAt(AbstractDecisionCollector.EmptyDecisionIndex).orThrow();\n }\n\n /**\n * The default-only decision (one condition set with no conditions) for this collector.\n */\n public get defaultOnlyDecision(): AbstractDecision {\n return this.getAt(AbstractDecisionCollector.DefaultOnlyDecisionIndex).orThrow();\n }\n\n /**\n * The index for the empty decision.\n */\n public static readonly EmptyDecisionIndex: DecisionIndex = Validate.toDecisionIndex(0).orThrow();\n\n /**\n * The index for the default-only decision.\n */\n public static readonly DefaultOnlyDecisionIndex: DecisionIndex = Validate.toDecisionIndex(1).orThrow();\n\n /**\n * Creates a new instance of {@link Decisions.AbstractDecisionCollector | AbstractDecisionCollector}.\n */\n protected constructor(params: IAbstractDecisionCollectorCreateParams) {\n super({\n converters: new Collections.KeyValueConverters<DecisionKey, AbstractDecision>({\n key: CommonConvert.decisionKey,\n value: (from: unknown) => this._toAbstractDecision(from)\n })\n });\n this.conditionSets = params.conditionSets;\n this.add(AbstractDecision.createAbstractDecision({ conditionSets: [] }).orThrow()).orThrow();\n const cs = this.conditionSets.validating.get('').orThrow();\n this.add(AbstractDecision.createAbstractDecision({ conditionSets: [cs] }).orThrow()).orThrow();\n }\n\n /**\n * Creates a new instance of {@link Decisions.AbstractDecisionCollector | AbstractDecisionCollector}.\n * @returns `Success` with the new instance, or `Failure` with an error if the instance could not be created.\n */\n public static create(params: IAbstractDecisionCollectorCreateParams): Result<AbstractDecisionCollector> {\n return captureResult(() => new AbstractDecisionCollector(params));\n }\n\n private _toAbstractDecision(from: unknown): Result<AbstractDecision> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (from instanceof AbstractDecision) {\n return succeed(from);\n }\n if (this._isConditionSetArray(from)) {\n return AbstractDecision.createAbstractDecision({\n conditionSets: from\n });\n }\n /* c8 ignore next 2 - functional code path tested but coverage intermittently missed */\n return fail('invalid value: not an abstract decision or condition sets');\n }\n\n private _isConditionSetArray(from: unknown): from is ConditionSet[] {\n return Array.isArray(from) && from.every((e) => e instanceof ConditionSet);\n }\n}\n\n/**\n * A read-only {@link Decisions.AbstractDecisionCollector | AbstractDecisionCollector}.\n * @public\n */\nexport type ReadOnlyAbstractDecisionCollector = Collections.IReadOnlyValidatingCollector<AbstractDecision>;\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"candidate.d.ts","sourceRoot":"","sources":["../../../src/packlets/decisions/candidate.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD;;;;GAIG;AACH,MAAM,WAAW,UAAU,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS;IAC9D,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,wBAAwB,CAAC;CACjD;AAED;;;;GAIG;AACH,qBAAa,SAAS,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS,CAAE,YAAW,UAAU,CAAC,MAAM,CAAC;IACxF,SAAgB,YAAY,EAAE,YAAY,CAAC;IAC3C,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,SAAS,EAAE,OAAO,CAAC;IACnC,SAAgB,WAAW,EAAE,wBAAwB,CAAC;IAEtD;;OAEG;IACH,IAAW,GAAG,IAAI,MAAM,CAEvB;IAED;;;;OAIG;IACH,SAAS,aAAa,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC;IAOhD;;;;;;OAMG;WACW,e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KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;IACtD,CAAC;CACF;AAxDD,8BAwDC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { JsonValue } from '@fgv/ts-json-base';\nimport { ConditionSet } from '../conditions';\nimport { captureResult, Result } from '@fgv/ts-utils';\nimport { ResourceValueMergeMethod } from '../common';\n\n/**\n * A {@link Decisions.ICandidate | resource candidate} represents a single\n * possible value for some resource, with the conditions under which it is valid.\n * @public\n */\nexport interface ICandidate<TVALUE extends JsonValue = JsonValue> {\n readonly conditionSet: ConditionSet;\n readonly value: TVALUE;\n readonly isPartial?: boolean;\n readonly mergeMethod?: ResourceValueMergeMethod;\n}\n\n/**\n * Simple implementation of {@link Decisions.ICandidate | ICandidate} with\n * helper methods for sorting and presentation.\n * @public\n */\nexport class Candidate<TVALUE extends JsonValue = JsonValue> implements ICandidate<TVALUE> {\n public readonly conditionSet: ConditionSet;\n public readonly value: TVALUE;\n public readonly isPartial: boolean;\n public readonly mergeMethod: ResourceValueMergeMethod;\n\n /**\n * Key of the condition set for this candidate.\n */\n public get key(): string {\n return this.conditionSet.key;\n }\n\n /**\n * Construct a new {@link Decisions.Candidate | Candidate}.\n * @param params - The {@link Decisions.ICandidate | parameters} to use to create the\n * new candidate.\n */\n protected constructor(params: ICandidate<TVALUE>) {\n this.conditionSet = params.conditionSet;\n this.value = params.value;\n this.isPartial = params.isPartial === true;\n this.mergeMethod = params.mergeMethod ?? 'augment';\n }\n\n /**\n * Create a new {@link Decisions.Candidate | candidate}.\n * @param params - The {@link Decisions.ICandidate | parameters} to use to create the\n * new candidate.\n * @returns `Success` with the new candidate if successful, or `Failure` if the\n * candidate could not be created.\n */\n public static createCandidate<TVALUE extends JsonValue>(\n params: ICandidate<TVALUE>\n ): Result<Candidate<TVALUE>> {\n return captureResult(() => new Candidate(params));\n }\n\n /**\n * Compare two {@link Decisions.ICandidate | candidates} for sorting purposes.\n * @param c1 - The first candidate to compare.\n * @param c2 - The second candidate to compare.\n * @returns A negative number if c1 should come before c2, a positive number if c1 should\n * come after c2, or zero if they are equivalent.\n */\n public static compare(c1: ICandidate, c2: ICandidate): number {\n return ConditionSet.compare(c1.conditionSet, c2.conditionSet);\n }\n\n /**\n * Returns a string representation of the {@link Decisions.Candidate | candidate}.\n * @returns A string representation of this candidate.\n */\n public toString(): string {\n return `${this.key}: ${JSON.stringify(this.value)}`;\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/packlets/decisions/common.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,WAAW,SAAS,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS;IAC7D,GAAG,EAAE,WAAW,CAAC;IACjB,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/packlets/decisions/common.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { DecisionIndex, DecisionKey } from '../common';\nimport { JsonValue } from '@fgv/ts-json-base';\nimport { ICandidate } from './candidate';\n\n/**\n * Represents a decision, which is comprised of zero or more\n * {@link Decisions.Candidate | candidates}, each of which represents a possible\n * value for some resource, along with the conditions under which that value is valid.\n * @public\n */\nexport interface IDecision<TVALUE extends JsonValue = JsonValue> {\n key: DecisionKey;\n candidates: ReadonlyArray<ICandidate<TVALUE>>;\n index?: DecisionIndex;\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"concreteDecision.d.ts","sourceRoot":"","sources":["../../../src/packlets/decisions/concreteDecision.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAa,UAAU,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAA0C,MAAM,EAAiB,MAAM,eAAe,CAAC;AAE9F,OAAO,EAA4B,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGjF;;;;;GAKG;AACH,MAAM,WAAW,6BAA6B,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS;IACjF,SAAS,EAAE,yBAAyB,CAAC;IACrC,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,kCAAkC,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS;IACtF,YAAY,EAAE,gBAAgB,CAAC;IAC/B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;;;;;GAMG;AACH,qBAAa,gBAAgB,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS,CAAE,YAAW,SAAS,CAAC,MAAM,CAAC;IAC9F,SAAgB,YAAY,EAAE,gBAAgB,CAAC;IAC/C,SAAgB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjC,SAAgB,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAE9D;;;OAGG;IACH,IAAW,GAAG,IAAI,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AC;YACD,OAAO,IAAA,kBAAO,EAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC,CAAC,CACH,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE;YACrB,0EAA0E;YAC1E,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;gBACjB,OAAO,gBAAa,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;oBAC3E,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,gBAAgB,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;gBACpF,CAAC,CAAC,CAAC;YACL,CAAC;YACD,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,gBAAgB,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QAC7E,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACI,QAAQ,CAAC,KAAa;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;CACF;AA7FD,4CA6FC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { JsonValue } from '@fgv/ts-json-base';\nimport { Candidate, ICandidate } from './candidate';\nimport { IDecision } from './common';\nimport { AbstractDecisionCollector } from './abstractDecisionCollector';\nimport { AbstractDecision } from './abstractDecision';\nimport { captureResult, Collections, mapResults, Result, fail, succeed } from '@fgv/ts-utils';\nimport { ConditionSet } from '../conditions';\nimport { Convert as CommonConvert, DecisionIndex, DecisionKey } from '../common';\nimport { Decision } from './decision';\n\n/**\n * Parameters used to create a new {@link Decisions.ConcreteDecision | ConcreteDecision},\n * given an {@link Decisions.AbstractDecisionCollector | AbstractDecisionCollector} and a\n * list of {@link Decisions.ICandidate | candidates}.\n * @public\n */\nexport interface IConcreteDecisionCreateParams<TVALUE extends JsonValue = JsonValue> {\n decisions: AbstractDecisionCollector;\n candidates: ReadonlyArray<ICandidate<TVALUE>>;\n index?: number;\n}\n\n/**\n * Protected constructor parameters for {@link Decisions.ConcreteDecision | ConcreteDecision},\n * used to create a new concrete decision from an existing {@link Decisions.AbstractDecision | AbstractDecision}\n * and a list of values.\n * @public\n */\nexport interface IConcreteDecisionConstructorParams<TVALUE extends JsonValue = JsonValue> {\n baseDecision: AbstractDecision;\n values: TVALUE[];\n index?: DecisionIndex;\n}\n\n/**\n * A {@link Decisions.ConcreteDecision | concrete decision} is a {@link Decisions.IDecision | decision}\n * implemented as a reference to a common {@link Decisions.AbstractDecision | abstract decision} and a list of\n * values that correspond to the candidates in the abstract decision. This allows us to represent a large\n * number of related decisions with a single abstract decision and a list of values.\n * @public\n */\nexport class ConcreteDecision<TVALUE extends JsonValue = JsonValue> implements IDecision<TVALUE> {\n public readonly baseDecision: AbstractDecision;\n public readonly values: TVALUE[];\n public readonly candidates: ReadonlyArray<ICandidate<TVALUE>>;\n\n /**\n * Unique global key for this decision, derived from the condition set and\n * candidate values.\n */\n public get key(): DecisionKey {\n return this._collectible.key;\n }\n\n /**\n * Unique global index for this decision.\n */\n public get index(): DecisionIndex | undefined {\n return this._collectible.index;\n }\n\n private _collectible: Collections.Collectible<DecisionKey, DecisionIndex>;\n\n /**\n * Constructor for a {@link Decisions.ConcreteDecision | ConcreteDecision} object.\n * @param params - {@link Decisions.IConcreteDecisionConstructorParams | Parameters}\n * used to create the decision.\n * @public\n */\n protected constructor(params: IConcreteDecisionConstructorParams<TVALUE>) {\n this.baseDecision = params.baseDecision;\n this.values = params.values;\n this.candidates = this.baseDecision.candidates.map((candidate) => {\n const value = this.values[candidate.value];\n return Candidate.createCandidate({ conditionSet: candidate.conditionSet, value }).orThrow();\n });\n this._collectible = new Collections.Collectible({\n key: Decision.getKey(this.candidates),\n index: params.index,\n indexConverter: CommonConvert.decisionIndex\n });\n }\n\n /**\n * Creates a new {@link Decisions.ConcreteDecision | ConcreteDecision} object.\n * @param params - {@link Decisions.IConcreteDecisionCreateParams | Parameters}\n * used to create the decision.\n * @returns `Success` with the new decision if successful, or `Failure` with an\n * error message if not.\n * @public\n */\n public static create<TVALUE extends JsonValue = JsonValue>(\n params: IConcreteDecisionCreateParams<TVALUE>\n ): Result<ConcreteDecision<TVALUE>> {\n const conditionSets = params.candidates\n .map((candidate) => candidate.conditionSet)\n .sort(ConditionSet.compare)\n .reverse();\n\n const getBase = params.decisions.validating.getOrAdd(conditionSets);\n /* c8 ignore next 3 - defense in depth against internal error hard to repro */\n if (getBase.isFailure()) {\n return fail<ConcreteDecision<TVALUE>>(getBase.message);\n }\n const baseDecision = getBase.value;\n return mapResults(\n params.candidates.map((candidate, index) => {\n /* c8 ignore next 5 - defense in depth against internal error hard to repro */\n if (candidate.conditionSet.key !== baseDecision.candidates[index].conditionSet.key) {\n return fail<TVALUE>(\n `${candidate.conditionSet.key}: Candidate does not match base decision ${candidate.conditionSet.key}`\n );\n }\n return succeed(candidate.value);\n })\n ).onSuccess((values) => {\n /* c8 ignore next 5 - defense in depth against invalid index conversion */\n if (params.index) {\n return CommonConvert.decisionIndex.convert(params.index).onSuccess((index) => {\n return captureResult(() => new ConcreteDecision({ baseDecision, values, index }));\n });\n }\n return captureResult(() => new ConcreteDecision({ baseDecision, values }));\n });\n }\n\n /**\n * Sets the index for this decision. Once set, index is immutable.\n * @param index - The index to set.\n * @returns `Success` with the new index if successful, or `Failure` with an error message if not.\n */\n public setIndex(index: number): Result<DecisionIndex> {\n return this._collectible.setIndex(index);\n }\n}\n"]}
@@ -82,7 +82,7 @@ export declare class Decision<TVALUE extends JsonValue = JsonValue> implements I
82
82
  static getAbstractKey(conditionSets: ReadonlyArray<ConditionSet>): DecisionKey;
83
83
  /**
84
84
  * Helper function to return a stable key for a set of condition sets.
85
- * @param conditionSets - The condition sets to use to create the key.
85
+ * @param candidates - The candidates whose condition sets are used to create the key.
86
86
  * @returns A key derived from the condition set hashes.
87
87
  * @public
88
88
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decision.d.ts","sourceRoot":"","sources":["../../../src/packlets/decisions/decision.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAoC,MAAM,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAA4B,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS;IACzE,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,0BAA0B,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS,CAC9E,SAAQ,qBAAqB,CAAC,MAAM,CAAC;IACrC,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,qBAAa,QAAQ,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS,CAAE,YAAW,SAAS,CAAC,MAAM,CAAC;IACtF;;;OAGG;IACH,SAAgB,UAAU,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAE7D;;;OAGG;IACH,IAAW,GAAG,IAAI,WAAW,CAE5B;IAED;;OAEG;IACH,IAAW,KAAK,IAAI,aAAa,GAAG,SAAS,CAE5C;IAED;;OAEG;IACH,gBAAuB,gBAAgB,EAAE,WAAW,CAAmD;IAEvG;;OAEG;IACH,gBAAuB,sBAAsB,EAAE,WAAW,CAE7C;IAEb,OAAO,CAAC,YAAY,CAAsD;IAE1E;;;;OAIG;IACH,SAAS,aAAa,MAAM,EAAE,0BAA0B,CAAC,MAAM,CAAC;IAkBhE;;;;;OAKG;WACW,cAAc,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,CAAC,QAAQ,CAAC;IAI7E;;;;;OAKG;IACI,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC;IAIrD;;;;;;;;OAQG;WACW,cAAc,CAAC,aAAa,EAAE,aAAa,CAAC,YAAY,CAAC,GAAG,WAAW;IAYrF;;;;;OAKG;WACW,MAAM,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS,EACvD,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,GAC5C,WAAW;CASf"}
@@ -102,7 +102,7 @@ class Decision {
102
102
  }
103
103
  /**
104
104
  * Helper function to return a stable key for a set of condition sets.
105
- * @param conditionSets - The condition sets to use to create the key.
105
+ * @param candidates - The candidates whose condition sets are used to create the key.
106
106
  * @returns A key derived from the condition set hashes.
107
107
  * @public
108
108
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decision.js","sourceRoot":"","sources":["../../../src/packlets/decisions/decision.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAyE;AACzE,sCAAiF;AAEjF,2CAAoD;AAEpD,8CAA6C;AAuB7C;;;GAGG;AACH,MAAa,QAAQ;IAOnB;;;OAGG;IACH,IAAW,GAAG;QACZ,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;IACjC,CAAC;IAgBD;;;;OAIG;IACH,YAAsB,MAA0C;QAC9D,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;aAC5C,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,qBAAS,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;aAClD,IAAI,CAAC,qBAAS,CAAC,OAAO,CAAC;aACvB,OAAO,EAAE,CAAC;QAEb,qDAAqD;QACrD,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU;YAC3B,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;YACrE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAErC,IAAI,CAAC,YAAY,GAAG,IAAI,sBAAW,CAAC,WAAW,CAA6B;YAC1E,GAAG;YACH,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,cAAc,EAAE,gBAAa,CAAC,aAAa;SAC5C,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IAC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E,CAAC;IACnF,CAAC;;AApHH,4BAqHC;AA/FC;;GAEG;AACoB,yBAAgB,GAAgB,gBAAa,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;AAEvG;;GAEG;AACoB,+BAAsB,GAAgB,gBAAa,CAAC,WAAW;KACnF,OAAO,CAAC,UAAU,CAAC;KACnB,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 { captureResult, Collections, Hash, Result } from '@fgv/ts-utils';\nimport { Convert as CommonConvert, DecisionIndex, DecisionKey } from '../common';\nimport { JsonValue } from '@fgv/ts-json-base';\nimport { Candidate, ICandidate } from './candidate';\nimport { IDecision } from './common';\nimport { ConditionSet } from '../conditions';\n\n/**\n * Parameters used to create a new {@link Decisions.Decision | Decision}\n * with the {@link Decisions.Decision.createDecision | createDecision}\n * static method.\n * @public\n */\nexport interface IDecisionCreateParams<TVALUE extends JsonValue = JsonValue> {\n candidates: ReadonlyArray<ICandidate<TVALUE>>;\n index?: number;\n}\n\n/**\n * Parameters used to construct a new {@link Decisions.Decision | Decision} with\n * the protected constructor.\n * @public\n */\nexport interface IDecisionConstructorParams<TVALUE extends JsonValue = JsonValue>\n extends IDecisionCreateParams<TVALUE> {\n isAbstract: boolean;\n}\n\n/**\n * Simple collectible implementation of {@link Decisions.IDecision | IDecision}.\n * @public\n */\nexport class Decision<TVALUE extends JsonValue = JsonValue> implements IDecision<TVALUE> {\n /**\n * The sorted {@link Conditions.ConditionSet | ConditionSets} that make up this decision.\n * @public\n */\n public readonly candidates: ReadonlyArray<Candidate<TVALUE>>;\n\n /**\n * Unique global key for this decision, derived from the contents\n * of the decision.\n */\n public get key(): DecisionKey {\n return this._collectible.key;\n }\n\n /**\n * Unique global index for this decision.\n */\n public get index(): DecisionIndex | undefined {\n return this._collectible.index;\n }\n\n /**\n * Key for the empty decision (no condition sets).\n */\n public static readonly EmptyDecisionKey: DecisionKey = CommonConvert.decisionKey.convert('').orThrow();\n\n /**\n * Key for the default-only decision (single condition set with no conditions).\n */\n public static readonly DefaultOnlyDecisionKey: DecisionKey = CommonConvert.decisionKey\n .convert('00000000')\n .orThrow();\n\n private _collectible: Collections.Collectible<DecisionKey, DecisionIndex>;\n\n /**\n * Constructor for a {@link Decisions.Decision | Decision} object.\n * @param params - {@link Decisions.IDecisionConstructorParams | Parameters} used to create the decision.\n * @public\n */\n protected constructor(params: IDecisionConstructorParams<TVALUE>) {\n this.candidates = Array.from(params.candidates)\n .map((c) => Candidate.createCandidate(c).orThrow())\n .sort(Candidate.compare)\n .reverse();\n\n /* c8 ignore next 3 - coverage having a rough time */\n const key = params.isAbstract\n ? Decision.getAbstractKey(this.candidates.map((c) => c.conditionSet))\n : Decision.getKey(this.candidates);\n\n this._collectible = new Collections.Collectible<DecisionKey, DecisionIndex>({\n key,\n index: params.index,\n indexConverter: CommonConvert.decisionIndex\n });\n }\n\n /**\n * Creates a new {@link Decisions.Decision | Decision} object.\n * @param params - {@link Decisions.IDecisionCreateParams | Parameters} used to create the decision.\n * @returns `Success` with the new decision if successful, or `Failure` with an error message if not.\n * @public\n */\n public static createDecision(params: IDecisionCreateParams): Result<Decision> {\n return captureResult(() => new Decision({ ...params, isAbstract: false }));\n }\n\n /**\n * Sets the index for this decision. Once set, index is immutable.\n * @param index - The index to set.\n * @returns `Success` with the new index if successful, or `Failure` with an error message if not.\n * @public\n */\n public setIndex(index: number): Result<DecisionIndex> {\n return this._collectible.setIndex(index);\n }\n\n /**\n * Helper function to return a stable key for a the condition sets that\n * make up a {@link Decisions.Decision | decision}. The abstract\n * key is a `+`-separated list of the hashes of the sorted condition sets\n * that make up the decision.\n * @param conditionSets - The condition sets to use to create the key.\n * @returns A key derived from the condition set hashes.\n * @public\n */\n public static getAbstractKey(conditionSets: ReadonlyArray<ConditionSet>): DecisionKey {\n return CommonConvert.decisionKey\n .convert(\n Array.from(conditionSets)\n .sort(ConditionSet.compare)\n .reverse()\n .map((c) => c.toHash())\n .join('+')\n )\n .orThrow();\n }\n\n /**\n * Helper function to return a stable key for a set of condition sets.\n * @param candidates - The candidates whose condition sets are used to create the key.\n * @returns A key derived from the condition set hashes.\n * @public\n */\n public static getKey<TVALUE extends JsonValue = JsonValue>(\n candidates: ReadonlyArray<ICandidate<TVALUE>>\n ): DecisionKey {\n if (candidates.length === 0) {\n /* c8 ignore next 2 - functional code path tested but coverage intermittently missed */\n return Decision.EmptyDecisionKey;\n }\n const abstractKey = Decision.getAbstractKey(candidates.map((c) => c.conditionSet));\n const valueKey = Hash.Crc32Normalizer.crc32Hash(candidates.map((c) => JSON.stringify(c.value)));\n return CommonConvert.decisionKey.convert(`${abstractKey}|${valueKey}`).orThrow();\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/decisions/index.ts"],"names":[],"mappings":"AAsBA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/decisions/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,8CAA4B;AAC5B,6CAA2B;AAC3B,qDAAmC;AACnC,8DAA4C;AAC5C,qDAAmC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport * from './common';\nexport * from './candidate';\nexport * from './decision';\nexport * from './abstractDecision';\nexport * from './abstractDecisionCollector';\nexport * from './concreteDecision';\n"]}
@@ -54,9 +54,6 @@ export declare class FsItem implements IFsItemProps {
54
54
  * @param props - The {@link Import.IFsItemProps | file system item properties} to use for this item.
55
55
  * @param qualifiers - The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} used to parse
56
56
  * embedded condition set tokens.
57
- * @param tree - file tree implementation to use for this item.
58
- * @returns `Success` containing the new {@link Import.FsItem | FsItem} if successful, or a `Failure`
59
- * containing an error message if not.
60
57
  */
61
58
  protected constructor(props: IFsItemProps, qualifiers: IReadOnlyQualifierCollector);
62
59
  /**
@@ -74,7 +71,7 @@ export declare class FsItem implements IFsItemProps {
74
71
  * @param importPath - The path to the file system item to import.
75
72
  * @param qualifiers - The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} used to parse
76
73
  * embedded condition set tokens.
77
- * @param fs - An optional {@link Import.IImporterFilesystem | file system implementation} to use for this item.
74
+ * @param tree - An optional {@link FileTree.FileTree | file tree} to use for this item.
78
75
  * @returns `Success` containing the new {@link Import.FsItem | FsItem} if an item is created
79
76
  * successfully, or a `Failure` containing an error message if it is not. Note that the result detail
80
77
  * `skipped` indicates that the item was not created because it is not relevant - this is a soft error
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fsItem.d.ts","sourceRoot":"","sources":["../../../src/packlets/import/fsItem.ts"],"names":[],"mappings":"AAsBA,OAAO,EAEL,cAAc,EAEd,MAAM,EAIP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AAEpE;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC;IAErC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC,uBAAuB,EAAE,CAAC;CAC3D;AAED;;;GAGG;AACH,qBAAa,MAAO,YAAW,YAAY;IACzC;;OAEG;IACH,SAAgB,QAAQ,EAAE,MAAM,CAAC;IAEjC;;OAEG;IACH,SAAgB,UAAU,EAAE,UAAU,CAAC,uBAAuB,EAAE,CAAC;IAEjE;;OAEG;IACH,SAAgB,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC;IAE5C;;OAEG;IACH,SAAgB,UAAU,EAAE,2BAA2B,CAAC;IAExD;;;;;OAKG;IACH,SAAS,aAAa,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,2BAA2B;IAQlF;;;;;;;;OAQG;WACW,aAAa,CACzB,IAAI,EAAE,QAAQ,CAAC,YAAY,EAC3B,UAAU,EAAE,2BAA2B,GACtC,cAAc,CAAC,MAAM,EAAE,kBAAkB,CAAC;IAW7C;;;;;;;;;;OAUG;WACW,aAAa,CACzB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,2BAA2B,EACvC,IAAI,CAAC,EAAE,QAAQ,CAAC,QAAQ,GACvB,cAAc,CAAC,MAAM,EAAE,kBAAkB,CAAC;IAW7C;;;;;;;OAOG;WACW,gBAAgB,CAC5B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAyBrC;;;;OAIG;IACI,UAAU,IAAI,MAAM,CAAC,aAAa,CAAC;CAa3C"}
@@ -70,9 +70,6 @@ class FsItem {
70
70
  * @param props - The {@link Import.IFsItemProps | file system item properties} to use for this item.
71
71
  * @param qualifiers - The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} used to parse
72
72
  * embedded condition set tokens.
73
- * @param tree - file tree implementation to use for this item.
74
- * @returns `Success` containing the new {@link Import.FsItem | FsItem} if successful, or a `Failure`
75
- * containing an error message if not.
76
73
  */
77
74
  constructor(props, qualifiers) {
78
75
  const { baseName, conditions, item } = props;
@@ -104,7 +101,7 @@ class FsItem {
104
101
  * @param importPath - The path to the file system item to import.
105
102
  * @param qualifiers - The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} used to parse
106
103
  * embedded condition set tokens.
107
- * @param fs - An optional {@link Import.IImporterFilesystem | file system implementation} to use for this item.
104
+ * @param tree - An optional {@link FileTree.FileTree | file tree} to use for this item.
108
105
  * @returns `Success` containing the new {@link Import.FsItem | FsItem} if an item is created
109
106
  * successfully, or a `Failure` containing an error message if it is not. Note that the result detail
110
107
  * `skipped` indicates that the item was not created because it is not relevant - this is a soft error
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fsItem.js","sourceRoot":"","sources":["../../../src/packlets/import/fsItem.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAQuB;AACvB,oDAA6C;AAC7C,sCAA+D;AAC/D,0DAA4C;AAE5C,mDAAgD;AA+BhD;;;GAGG;AACH,MAAa,MAAM;IAqBjB;;;;;OAKG;IACH,YAAsB,KAAmB,EAAE,UAAuC;QAChF,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;QAC7C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED;;;;;;;;OAQG;IACI,MAAM,CAAC,aAAa,CACzB,IAA2B,EAC3B,UAAuC;QAEvC,MAAM,QAAQ,GAAW,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAE1E,OAAO,MAAM,CAAC,gBAAgB,CAAC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C,CAAC,EAAE,EAAE;gBAC3C,OAAO;oBACL,aAAa,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI;oBAC/B,KAAK,EAAE,CAAC,CAAC,KAAK;oBACd,QAAQ,EAAE,CAAC,CAAC,QAAQ;oBACpB,QAAQ,EAAE,CAAC,CAAC,QAAQ;iBACrB,CAAC;YACJ,CAAC,CAAC,CAAC;YACH,OAAO,6BAAa,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA1ID,wBA0IC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport {\n captureResult,\n DetailedResult,\n mapResults,\n Result,\n fail,\n succeed,\n useOrInitialize\n} from '@fgv/ts-utils';\nimport { FileTree } from '@fgv/ts-json-base';\nimport { Helpers as CommonHelpers, Validate } from '../common';\nimport * as Conditions from '../conditions';\nimport { IReadOnlyQualifierCollector } from '../qualifiers';\nimport { ImportContext } from './importContext';\n\n/**\n * Result details for {@link Import.FsItem | FsItem} operations.\n * @public\n */\nexport type FsItemResultDetail = 'failed' | 'skipped' | 'succeeded';\n\n/**\n * Interface describing some single file system item.\n * @public\n */\nexport interface IFsItemProps {\n /**\n * The underlying `FileTreeItem` for this item.\n */\n readonly item: FileTree.FileTreeItem;\n\n /**\n * The base name of the file system item, once\n * any conditions set tokens have been removed.\n */\n readonly baseName: string;\n\n /**\n * {@link Conditions.IValidatedConditionDecl | Conditions} extracted\n * from the base name of the {@link Import.FsItem | FsItem}.\n */\n readonly conditions: Conditions.IValidatedConditionDecl[];\n}\n\n/**\n * Class describing some file system item to be imported.\n * @public\n */\nexport class FsItem implements IFsItemProps {\n /**\n * {@inheritDoc Import.IFsItemProps.baseName}\n */\n public readonly baseName: string;\n\n /**\n * {@inheritDoc Import.IFsItemProps.conditions}\n */\n public readonly conditions: Conditions.IValidatedConditionDecl[];\n\n /**\n * {@inheritDoc Import.IFsItemProps.item}\n */\n public readonly item: FileTree.FileTreeItem;\n\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} to use for this item.\n */\n public readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Protected constructor creates a new {@link Import.FsItem | FsItem}.\n * @param props - The {@link Import.IFsItemProps | file system item properties} to use for this item.\n * @param qualifiers - The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} used to parse\n * embedded condition set tokens.\n */\n protected constructor(props: IFsItemProps, qualifiers: IReadOnlyQualifierCollector) {\n const { baseName, conditions, item } = props;\n this.baseName = baseName;\n this.conditions = conditions;\n this.item = item;\n this.qualifiers = qualifiers;\n }\n\n /**\n * Creates a new {@link Import.FsItem | FsItem} from a `FileTreeItem`.\n * @param item - The `FileTreeItem` to import.\n * @param qualifiers - The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} used to parse\n * embedded condition set tokens.\n * @returns `Success` containing the new {@link Import.FsItem | FsItem} if successful, or a `Failure`\n * containing an error message if not. Note that the result detail `skipped` indicates that the item\n * was not created because it is not relevant - this is a soft error that should be silently ignored.\n */\n public static createForItem(\n item: FileTree.FileTreeItem,\n qualifiers: IReadOnlyQualifierCollector\n ): DetailedResult<FsItem, FsItemResultDetail> {\n const baseName: string = item.type === 'file' ? item.baseName : item.name;\n\n return FsItem.tryParseBaseName(baseName, qualifiers)\n .withErrorFormat((msg) => `${baseName}: error extracting conditions - ${msg}`)\n .onSuccess(({ baseName: newBaseName, conditions }) => {\n return captureResult(() => new FsItem({ baseName: newBaseName, conditions, item }, qualifiers));\n })\n .withDetail('failed', 'succeeded');\n }\n\n /**\n * Creates a new {@link Import.FsItem | FsItem} from a file system path.\n * @param importPath - The path to the file system item to import.\n * @param qualifiers - The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} used to parse\n * embedded condition set tokens.\n * @param tree - An optional {@link FileTree.FileTree | file tree} to use for this item.\n * @returns `Success` containing the new {@link Import.FsItem | FsItem} if an item is created\n * successfully, or a `Failure` containing an error message if it is not. Note that the result detail\n * `skipped` indicates that the item was not created because it is not relevant - this is a soft error\n * that should be silently ignored.\n */\n public static createForPath(\n importPath: string,\n qualifiers: IReadOnlyQualifierCollector,\n tree?: FileTree.FileTree\n ): DetailedResult<FsItem, FsItemResultDetail> {\n return useOrInitialize(tree, () => FileTree.forFilesystem())\n .withDetail<FsItemResultDetail>('failed', 'succeeded')\n .onSuccess((tree) => {\n return tree\n .getItem(importPath)\n .withDetail<FsItemResultDetail>('failed')\n .onSuccess((item) => FsItem.createForItem(item, qualifiers));\n });\n }\n\n /**\n * Tries to parse a base name into a base name and a set of conditions.\n * @param baseName - The base name to parse.\n * @param qualifiers - The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} used to parse\n * embedded condition set tokens.\n * @returns `Success` containing the parsed base name and conditions on success, or `Failure` containing\n * an error message if it is not.\n */\n public static tryParseBaseName(\n baseName: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<Omit<IFsItemProps, 'item'>> {\n const nameParts = baseName.split('.');\n const segmentToTest = nameParts.length > 1 ? nameParts[nameParts.length - 1] : nameParts[0];\n const validatedConditions = CommonHelpers.parseConditionSetTokenParts(segmentToTest).onSuccess(\n (parts) => {\n return mapResults(\n parts.map((part) => Conditions.ConditionTokens.validateConditionTokenParts(part, qualifiers))\n ).onFailure((msg) => {\n if (parts.length === 1 && parts[0].qualifier === undefined) {\n return succeed([]);\n }\n return fail(msg);\n });\n }\n );\n if (validatedConditions.isFailure()) {\n return fail(validatedConditions.message);\n }\n const conditions = validatedConditions.value;\n if (conditions.length > 0) {\n baseName = nameParts.filter((s) => s !== segmentToTest).join('.');\n }\n return succeed({ baseName, conditions });\n }\n\n /**\n * Gets the context for this file system item.\n * @returns `Success` containing the {@link Import.ImportContext | import context} for this item\n * if successful, or a `Failure` containing an error message if an error occurs.\n */\n public getContext(): Result<ImportContext> {\n return Validate.toOptionalResourceId(this.baseName).onSuccess((baseId) => {\n const conditions = this.conditions.map((c) => {\n return {\n qualifierName: c.qualifier.name,\n value: c.value,\n operator: c.operator,\n priority: c.priority\n };\n });\n return ImportContext.create({ baseId, conditions });\n });\n }\n}\n"]}
@@ -38,18 +38,18 @@ export interface IValidatedImportContext {
38
38
  */
39
39
  export declare class ImportContext implements IValidatedImportContext {
40
40
  /**
41
- * {@inheritdoc Import.IImportContext.baseId}
41
+ * {@inheritDoc Import.IImportContext.baseId}
42
42
  */
43
43
  readonly baseId: ResourceId | undefined;
44
44
  /**
45
- * {@inheritdoc Import.IImportContext.conditions}
45
+ * {@inheritDoc Import.IImportContext.conditions}
46
46
  */
47
47
  readonly conditions: ReadonlyArray<IConditionDecl>;
48
48
  /**
49
49
  * Protected {@link Import.ImportContext | import context} for derived classes.
50
50
  * Public consumers use {@link Import.ImportContext.create | create} to create new instances.
51
- * @param baseId - The base ID for the import context.
52
- * @param conditions - Conditions to be applied to resources imported in this context.
51
+ * @param params - The {@link Import.IImportContext | import context} parameters including
52
+ * the base ID and conditions to be applied to resources imported in this context.
53
53
  */
54
54
  protected constructor({ baseId, conditions }: IImportContext);
55
55
  /**
@@ -69,7 +69,7 @@ export declare class ImportContext implements IValidatedImportContext {
69
69
  withConditions(conditions: IConditionDecl[]): Result<ImportContext>;
70
70
  /**
71
71
  * Appends names to the base ID of the import context.
72
- * @param name - The base name to set.
72
+ * @param names - The name segments to append to the base ID.
73
73
  * @returns `Success` with a new {@link Import.ImportContext | import context} containing the new base ID
74
74
  * if successful, or `Failure` with an error message if the operation fails.
75
75
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"importContext.d.ts","sourceRoot":"","sources":["../../../src/packlets/import/importContext.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAiB,MAAM,EAAW,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC;AAEjD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;CACrD;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;CACpD;AAED;;;GAGG;AACH,qBAAa,aAAc,YAAW,uBAAuB;IAC3D;;OAEG;IACH,SAAgB,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC;IAE/C;;OAEG;IACH,SAAgB,UAAU,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IAE1D;;;;;OAKG;IACH,SAAS,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,cAAc;IAK5D;;;;;;OAMG;WACW,MAAM,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC;IAMrE;;;;;OAKG;IACI,cAAc,CAAC,UAAU,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,aAAa,CAAC;IAO1E;;;;;OAKG;IACI,QAAQ,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,aAAa,CAAC;IAM1D;;;;;;OAMG;IACI,MAAM,CAAC,OAAO,CAAC,EAAE,uBAAuB,GAAG,MAAM,CAAC,aAAa,CAAC;IASvE;;;;;;;;;;;;;;;;OAgBG;WACW,kBAAkB,CAC9B,SAAS,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,qBAAqB,EACzD,QAAQ,CAAC,EAAE,aAAa,GACvB,MAAM,CAAC,aAAa,GAAG,SAAS,CAAC;CAsBrC"}
@@ -32,8 +32,8 @@ class ImportContext {
32
32
  /**
33
33
  * Protected {@link Import.ImportContext | import context} for derived classes.
34
34
  * Public consumers use {@link Import.ImportContext.create | create} to create new instances.
35
- * @param baseId - The base ID for the import context.
36
- * @param conditions - Conditions to be applied to resources imported in this context.
35
+ * @param params - The {@link Import.IImportContext | import context} parameters including
36
+ * the base ID and conditions to be applied to resources imported in this context.
37
37
  */
38
38
  constructor({ baseId, conditions }) {
39
39
  this.baseId = common_1.Helpers.joinOptionalResourceIds(baseId).orThrow();
@@ -65,7 +65,7 @@ class ImportContext {
65
65
  }
66
66
  /**
67
67
  * Appends names to the base ID of the import context.
68
- * @param name - The base name to set.
68
+ * @param names - The name segments to append to the base ID.
69
69
  * @returns `Success` with a new {@link Import.ImportContext | import context} containing the new base ID
70
70
  * if successful, or `Failure` with an error message if the operation fails.
71
71
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"importContext.js","sourceRoot":"","sources":["../../../src/packlets/import/importContext.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;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AAO,EAAC,SAAS,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;CACF;AAtHD,sCAsHC","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 { Helpers } from '../common';\nimport { captureResult, Result, succeed } from '@fgv/ts-utils';\nimport { IConditionDecl } from '../conditions';\nimport { ResourceId } from '../common';\nimport * as ResourceJson from '../resource-json';\n\n/**\n * Accumulated context of a resource import operation.\n * @public\n */\nexport interface IImportContext {\n /**\n * Base ID for the import context for resources imported\n * in this context.\n */\n readonly baseId?: string;\n /**\n * Conditions to be applied to resources imported in this context.\n */\n readonly conditions?: ReadonlyArray<IConditionDecl>;\n}\n\n/**\n * Accumulated context of a resource import operation.\n * @public\n */\nexport interface IValidatedImportContext {\n /**\n * Base ID for the import context for resources imported\n * in this context.\n */\n readonly baseId?: ResourceId;\n /**\n * Conditions to be applied to resources imported in this context.\n */\n readonly conditions: ReadonlyArray<IConditionDecl>;\n}\n\n/**\n * Class to accumulate context for a resource import operation.\n * @public\n */\nexport class ImportContext implements IValidatedImportContext {\n /**\n * {@inheritDoc Import.IImportContext.baseId}\n */\n public readonly baseId: ResourceId | undefined;\n\n /**\n * {@inheritDoc Import.IImportContext.conditions}\n */\n public readonly conditions: ReadonlyArray<IConditionDecl>;\n\n /**\n * Protected {@link Import.ImportContext | import context} for derived classes.\n * Public consumers use {@link Import.ImportContext.create | create} to create new instances.\n * @param params - The {@link Import.IImportContext | import context} parameters including\n * the base ID and conditions to be applied to resources imported in this context.\n */\n protected constructor({ baseId, conditions }: IImportContext) {\n this.baseId = Helpers.joinOptionalResourceIds(baseId).orThrow();\n this.conditions = Array.from(conditions ?? []);\n }\n\n /**\n * Factory method to create a new {@link Import.ImportContext | import context}.\n * @param context - The {@link Import.IImportContext | import context} to create\n * the new context from.\n * @returns `Success` with the new {@link Import.ImportContext | import context}\n * if successful, or `Failure` with an error message if creation fails.\n */\n public static create(context?: IImportContext): Result<ImportContext> {\n /* c8 ignore next */\n context = context ?? { conditions: [] };\n return captureResult(() => new ImportContext(context));\n }\n\n /**\n * Adds conditions to the import context.\n * @param conditions - Conditions to be added to the import context.\n * @returns `Success` with a new {@link Import.ImportContext | import context} containing the added conditions\n * if successful, or `Failure` with an error message if the operation fails.\n */\n public withConditions(conditions: IConditionDecl[]): Result<ImportContext> {\n return ImportContext.create({\n baseId: this.baseId,\n conditions: [...this.conditions, ...conditions]\n });\n }\n\n /**\n * Appends names to the base ID of the import context.\n * @param names - The name segments to append to the base ID.\n * @returns `Success` with a new {@link Import.ImportContext | import context} containing the new base ID\n * if successful, or `Failure` with an error message if the operation fails.\n */\n public withName(...names: string[]): Result<ImportContext> {\n return Helpers.joinResourceIds(this.baseId, ...names).onSuccess((baseId) => {\n return ImportContext.create({ baseId, conditions: this.conditions });\n });\n }\n\n /**\n * Extends the import context with additional name segments and conditions.\n * @param context - The {@link Import.IImportContext | import context} to extend this context with.\n * @returns `Success` with a new {@link Import.ImportContext | import context}\n * containing the extended context if successful, or `Failure` with an error\n * message if the operation fails.\n */\n public extend(context?: IValidatedImportContext): Result<ImportContext> {\n /* c8 ignore next 1 */\n context = context ?? { conditions: [] };\n const conditions = [...this.conditions, ...context.conditions];\n return Helpers.joinOptionalResourceIds(this.baseId, context.baseId).onSuccess((baseId) => {\n return ImportContext.create({ baseId, conditions });\n });\n }\n\n /**\n * Creates a new {@link Import.ImportContext | import context} to import resources from a\n * container with the specified {@link ResourceJson.Normalized.IContainerContextDecl | container context declaration}e\n * @param container - The {@link ResourceJson.Normalized.IContainerContextDecl | container context declaration}\n * to consider when creating the new context.\n * @param importer - The base {@link Import.ImportContext | import context} to adjust for the container\n * context.\n * @returns `Success` with the new {@link Import.ImportContext | import context} if successful,\n * or `Failure` with an error message if the operation fails.\n * @remarks\n * A container context declaration may specify a merge method, which determines how the\n * container context is merged with the base context. The merge method can be one of the following:\n * - `augment`: The base context is augmented with the container context. This is the default behavior.\n * - `replace`: The base context is selectively replaced with the container context. If the container context\n * specifies a base ID or conditions, the corresponding values in the base context are ignored.\n * - `delete`: The base context is deleted. This means that the container context is not used at all.\n */\n public static forContainerImport(\n container?: ResourceJson.Normalized.IContainerContextDecl,\n importer?: ImportContext\n ): Result<ImportContext | undefined> {\n if (!importer) {\n return succeed(undefined);\n }\n /* c8 ignore next 1 */\n container = container ?? {};\n const mergeMethod = container.mergeMethod ?? 'augment';\n\n switch (mergeMethod) {\n case 'augment':\n return succeed(importer);\n case 'replace': {\n // if the container defines baseId or conditions, then we ignore\n // the corresponding values in the importer\n const baseId = container.baseId ? undefined : importer.baseId;\n const conditions = container.conditions ? undefined : importer.conditions;\n return ImportContext.create({ baseId, conditions });\n }\n case 'delete':\n return succeed(undefined);\n }\n }\n}\n"]}
@@ -1,5 +1,7 @@
1
1
  import { Result } from '@fgv/ts-utils';
2
2
  import { FileTree } from '@fgv/ts-json-base';
3
+ import { Converter } from '@fgv/ts-utils';
4
+ import { JsonValue } from '@fgv/ts-json-base';
3
5
  import { ResourceManagerBuilder } from '../resources';
4
6
  import { ImportContext } from './importContext';
5
7
  import { IImportable } from './importable';
@@ -27,6 +29,14 @@ export interface IImporterCreateParams {
27
29
  * An optional list of {@link Import.Importers.IImporter | importers} to use for the import.
28
30
  */
29
31
  importers?: IImporter[];
32
+ /**
33
+ * An optional converter used to pre-process file contents before JSON import validation.
34
+ */
35
+ fileContentConverter?: Converter<JsonValue>;
36
+ /**
37
+ * Optional file extensions which should be parsed using the supplied file content converter.
38
+ */
39
+ fileContentExtensions?: ReadonlyArray<string>;
30
40
  }
31
41
  /**
32
42
  * Class to manage the import of resources from various sources.
@@ -80,9 +90,13 @@ export declare class ImportManager {
80
90
  * and optional `FileTree`.
81
91
  * @param qualifiers - The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} to use for the import.
82
92
  * @param tree - An optional `FileTree` for importing path items.
93
+ * @param fileContentConverter - An optional converter used to pre-process raw file contents before JSON import
94
+ * validation.
95
+ * @param fileContentExtensions - Optional file extensions which should be parsed using the supplied file
96
+ * content converter.
83
97
  * @returns A read-only array of {@link Import.Importers.IImporter | importers}.
84
98
  */
85
- static getDefaultImporters(qualifiers: IReadOnlyQualifierCollector, tree?: FileTree.FileTree): ReadonlyArray<IImporter>;
99
+ static getDefaultImporters(qualifiers: IReadOnlyQualifierCollector, tree?: FileTree.FileTree, fileContentConverter?: Converter<JsonValue>, fileContentExtensions?: ReadonlyArray<string>): ReadonlyArray<IImporter>;
86
100
  /**
87
101
  * Imports any items on the import stack.
88
102
  * @returns `Success` with the {@link Import.ImportManager | ImportManager} if successful,
@@ -0,0 +1 @@
1
+ {"version":3,"file":"importManager.d.ts","sourceRoot":"","sources":["../../../src/packlets/import/importManager.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAoC,MAAM,EAAW,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,O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oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC;IAKpE;;;;;;;;;;OAUG;WACW,mBAAmB,CAC/B,UAAU,EAAE,2BAA2B,EACvC,IAAI,CAAC,EAAE,QAAQ,CAAC,QAAQ,EACxB,oBAAoB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,EAC3C,qBAAqB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAC5C,aAAa,CAAC,SAAS,CAAC;IAS3B;;;;;OAKG;IACH,SAAS,CAAC,OAAO,IAAI,MAAM,CAAC,aAAa,CAAC;CAiC3C"}
@@ -48,7 +48,7 @@ class ImportManager {
48
48
  this._importers = [];
49
49
  this.resources = params.resources;
50
50
  this.initialContext = (_a = params.initialContext) !== null && _a !== void 0 ? _a : importContext_1.ImportContext.create().orThrow();
51
- this._importers = Array.from((_b = params.importers) !== null && _b !== void 0 ? _b : ImportManager.getDefaultImporters(this.resources.qualifiers, params.fileTree));
51
+ this._importers = Array.from((_b = params.importers) !== null && _b !== void 0 ? _b : ImportManager.getDefaultImporters(this.resources.qualifiers, params.fileTree, params.fileContentConverter, params.fileContentExtensions));
52
52
  }
53
53
  /**
54
54
  * Factory method to create a new {@link Import.ImportManager | ImportManager}.
@@ -84,12 +84,16 @@ class ImportManager {
84
84
  * and optional `FileTree`.
85
85
  * @param qualifiers - The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} to use for the import.
86
86
  * @param tree - An optional `FileTree` for importing path items.
87
+ * @param fileContentConverter - An optional converter used to pre-process raw file contents before JSON import
88
+ * validation.
89
+ * @param fileContentExtensions - Optional file extensions which should be parsed using the supplied file
90
+ * content converter.
87
91
  * @returns A read-only array of {@link Import.Importers.IImporter | importers}.
88
92
  */
89
- static getDefaultImporters(qualifiers, tree) {
93
+ static getDefaultImporters(qualifiers, tree, fileContentConverter, fileContentExtensions) {
90
94
  return [
91
95
  importers_1.PathImporter.create({ qualifiers, tree }).orThrow(),
92
- fsItemImporter_1.FsItemImporter.create({ qualifiers }).orThrow(),
96
+ fsItemImporter_1.FsItemImporter.create({ qualifiers, fileContentConverter, fileContentExtensions }).orThrow(),
93
97
  importers_1.JsonImporter.create().orThrow(),
94
98
  importers_1.CollectionImporter.create().orThrow()
95
99
  ];
@@ -0,0 +1 @@
1
+ {"version":3,"file":"importManager.js","sourceRoot":"","sources":["../../../src/packlets/import/importManager.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAkF;AAKlF,mDAAgD;AAEhD,+DAA4D;AAC5D,2CAAwF;AAwCxF;;;GAGG;AACH,MAAa,aAAa;IAOxB;;;OAGG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAUD;;;OAGG;IACH,YAAsB,MAA6B;;QAPzC,WAAM,GAAkB,EAAE,CAAC;QAC3B,eAAU,GAAgB,EAAE,CAAC;QAOrC,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QAClC,IAAI,CAAC,cAAc,GAAG,MAAA,MAAM,CAAC,cAAc,mCAAI,6BAAa,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC;QAChF,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAC1B,MAAA,MAAM,CAAC,SAAS,mCACd,aAAa,CAAC,mBAAmB,CAC/B,IAAI,CAAC,SAAS,CAAC,UAAU,EACzB,MAAM,CAAC,QAAQ,EACf,MAAM,CAAC,oBAAoB,EAC3B,MAAM,CAAC,qBAAqB,CAC7B,CACJ,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAAC,MAA6B;QAChD,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;IACxD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,UAAuB;QACnC,IAAI,CAAC,MAAM,CAAC,IAAI,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C;oBAED,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;oBAC5E,SAAS,GAAG,SAAS,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC;oBACrD,QAAQ,GAAG,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU,CAAC;oBAEpD,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;wBACvB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;oBACpC,CAAC;yBAAM,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;wBACvC,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;oBACvD,CAAC;gBACH,CAAC;gBAED,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,IAAI,8BAA8B,CAAC,CAAC;gBAChE,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC,cAAc,CAAC,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF;AAzID,sCAyIC","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, MessageAggregator, Result, succeed } from '@fgv/ts-utils';\nimport { FileTree } from '@fgv/ts-json-base';\nimport { Converter } from '@fgv/ts-utils';\nimport { JsonValue } from '@fgv/ts-json-base';\nimport { ResourceManagerBuilder } from '../resources';\nimport { ImportContext } from './importContext';\nimport { IImportable, IImportablePath } from './importable';\nimport { FsItemImporter } from './importers/fsItemImporter';\nimport { CollectionImporter, IImporter, JsonImporter, PathImporter } from './importers';\nimport { IReadOnlyQualifierCollector } from '../qualifiers';\n\n/**\n * Parameters for creating an {@link Import.ImportManager | ImportManager}.\n * @public\n */\nexport interface IImporterCreateParams {\n /**\n * The {@link Resources.ResourceManagerBuilder | resource manager builder} into which resources\n * will be imported.\n */\n resources: ResourceManagerBuilder;\n\n /**\n * An optional initial {@link Import.ImportContext | import context} for the import operation.\n */\n initialContext?: ImportContext;\n\n /**\n * An optional `FileTree` for importing path items.\n */\n fileTree?: FileTree.FileTree;\n\n /**\n * An optional list of {@link Import.Importers.IImporter | importers} to use for the import.\n */\n importers?: IImporter[];\n\n /**\n * An optional converter used to pre-process file contents before JSON import validation.\n */\n fileContentConverter?: Converter<JsonValue>;\n\n /**\n * Optional file extensions which should be parsed using the supplied file content converter.\n */\n fileContentExtensions?: ReadonlyArray<string>;\n}\n\n/**\n * Class to manage the import of resources from various sources.\n * @public\n */\nexport class ImportManager {\n /**\n * The {@link Resources.ResourceManagerBuilder | resource manager builder} into which resources\n * will be imported.\n */\n public readonly resources: ResourceManagerBuilder;\n\n /**\n * The list of {@link Import.Importers.IImporter | importers} to use for the\n * import operations.\n */\n public get importers(): ReadonlyArray<IImporter> {\n return this._importers;\n }\n\n /**\n * The initial {@link Import.ImportContext | import context} for the import operation.\n */\n public initialContext: ImportContext;\n\n protected _stack: IImportable[] = [];\n protected _importers: IImporter[] = [];\n\n /**\n * Protected constructor for the {@link Import.ImportManager | ImportManager}.\n * @param params - Parameters for creating the {@link Import.ImportManager | ImportManager}.\n */\n protected constructor(params: IImporterCreateParams) {\n this.resources = params.resources;\n this.initialContext = params.initialContext ?? ImportContext.create().orThrow();\n this._importers = Array.from(\n params.importers ??\n ImportManager.getDefaultImporters(\n this.resources.qualifiers,\n params.fileTree,\n params.fileContentConverter,\n params.fileContentExtensions\n )\n );\n }\n\n /**\n * Factory method to create a new {@link Import.ImportManager | ImportManager}.\n * @param params - Parameters for creating the {@link Import.ImportManager | ImportManager}.\n * @returns `Success` with the new {@link Import.ImportManager | ImportManager}\n * if successful, or `Failure` with an error message if creation fails.\n */\n public static create(params: IImporterCreateParams): Result<ImportManager> {\n return captureResult(() => new ImportManager(params));\n }\n\n /**\n * Imports resources from an {@link Import.IImportable | importable} object.\n * @param importable - The {@link Import.IImportable | importable} object to import.\n * @returns `Success` with the {@link Import.ImportManager | ImportManager} if successful,\n * or `Failure` with an error message if the import fails.\n */\n public import(importable: IImportable): Result<ImportManager> {\n this._stack.push(importable);\n return this._import();\n }\n\n /**\n * Imports resources from a file system path.\n * @param filePath - The path to import resources from.\n * @returns `Success` with the {@link Import.ImportManager | ImportManager} if successful,\n * or `Failure` with an error message if the import fails.\n */\n public importFromFileSystem(filePath: string): Result<ImportManager> {\n const importable: IImportablePath = { type: 'path', path: filePath };\n return this.import(importable);\n }\n\n /**\n * Gets the default importers using supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers}\n * and optional `FileTree`.\n * @param qualifiers - The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} to use for the import.\n * @param tree - An optional `FileTree` for importing path items.\n * @param fileContentConverter - An optional converter used to pre-process raw file contents before JSON import\n * validation.\n * @param fileContentExtensions - Optional file extensions which should be parsed using the supplied file\n * content converter.\n * @returns A read-only array of {@link Import.Importers.IImporter | importers}.\n */\n public static getDefaultImporters(\n qualifiers: IReadOnlyQualifierCollector,\n tree?: FileTree.FileTree,\n fileContentConverter?: Converter<JsonValue>,\n fileContentExtensions?: ReadonlyArray<string>\n ): ReadonlyArray<IImporter> {\n return [\n PathImporter.create({ qualifiers, tree }).orThrow(),\n FsItemImporter.create({ qualifiers, fileContentConverter, fileContentExtensions }).orThrow(),\n JsonImporter.create().orThrow(),\n CollectionImporter.create().orThrow()\n ];\n }\n\n /**\n * Imports any items on the import stack.\n * @returns `Success` with the {@link Import.ImportManager | ImportManager} if successful,\n * or `Failure` with an error message if the import fails.\n * @public\n */\n protected _import(): Result<ImportManager> {\n const errors: MessageAggregator = new MessageAggregator();\n\n while (this._stack.length > 0) {\n const item = this._stack.pop();\n if (item !== undefined) {\n let processed: boolean = false;\n let consumed: boolean = false;\n\n for (const importer of this._importers) {\n if (consumed || !importer.types.includes(item.type)) {\n continue;\n }\n\n const result = importer.import(item, this.resources).aggregateError(errors);\n processed = processed || result.detail !== 'skipped';\n consumed = consumed || result.detail === 'consumed';\n\n if (result.isSuccess()) {\n this._stack.push(...result.value);\n } else if (result.detail !== 'skipped') {\n errors.addMessage(`${item.type}: ${result.message}`);\n }\n }\n\n if (!processed) {\n errors.addMessage(`${item.type}: No matching importer found`);\n }\n }\n }\n\n return errors.returnOrReport(succeed(this));\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"importable.d.ts","sourceRoot":"","sources":["../../../src/packlets/import/importable.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA8B,SAAQ,WAAW;IAChE,IAAI,EAAE,oBAAoB,CAAC;IAC3B,UAAU,EAAE,YAAY,CAAC,sBAAsB,CAAC;IAChD,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,WAAW;IAC1D,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,YAAY,CAAC,gBAAgB,CAAC;IACpC,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,MAAM,UAAU,GAClB,eAAe,GACf,iBAAiB,GACjB,eAAe,GACf,6BAA6B,GAC7B,uBAAuB,CAAC;AAE5B;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,IAAI,UAAU,CAE5D"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"importable.js","sourceRoot":"","sources":["../../../src/packlets/import/importable.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAoFH,oCAEC;AATD;;;;;;GAMG;AACH,SAAgB,YAAY,CAAC,CAAc;IACzC,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,oBAAoB,EAAE,cAAc,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAC3F,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 { JsonValue } from '@fgv/ts-json-base';\nimport * as ResourceJson from '../resource-json';\nimport { ImportContext } from './importContext';\nimport { FsItem } from './fsItem';\n\n/**\n * Base interface for importable entities.\n * @public\n */\nexport interface IImportable {\n type: string;\n context?: ImportContext;\n}\n\n/**\n * Represents a filesystem path to be imported.\n * @public\n */\nexport interface IImportablePath extends IImportable {\n type: 'path';\n path: string;\n context?: ImportContext;\n}\n\n/**\n * Represents a filesystem item to be imported.\n * @public\n */\nexport interface IImportableFsItem extends IImportable {\n type: 'fsItem';\n item: FsItem;\n context?: ImportContext;\n}\n\n/**\n * Represents some JSON to be imported.\n * @public\n */\nexport interface IImportableJson extends IImportable {\n type: 'json';\n json: JsonValue;\n context?: ImportContext;\n}\n\n/**\n * Represents a resource collection to be imported.\n * @public\n */\nexport interface IImportableResourceCollection extends IImportable {\n type: 'resourceCollection';\n collection: ResourceJson.ResourceDeclCollection;\n context?: ImportContext;\n}\n\n/**\n * Represents a resource tree to be imported.\n * @public\n */\nexport interface IImportableResourceTree extends IImportable {\n type: 'resourceTree';\n tree: ResourceJson.ResourceDeclTree;\n context?: ImportContext;\n}\n\n/**\n * Type of importable entities.\n * @public\n */\nexport type Importable =\n | IImportablePath\n | IImportableFsItem\n | IImportableJson\n | IImportableResourceCollection\n | IImportableResourceTree;\n\n/**\n * Type guard for {@link Import.Importable | importables}.\n * @param i - The entity to check.\n * @returns `true` if the supplied {@link Import.IImportable | IImportable} is a\n * {@link Import.Importable | known importable}, `false` otherwise.\n * @public\n */\nexport function isImportable(i: IImportable): i is Importable {\n return ['path', 'fsItem', 'json', 'resourceCollection', 'resourceTree'].includes(i.type);\n}\n"]}
@@ -10,7 +10,7 @@ import { IImporter, ImporterResultDetail } from './importer';
10
10
  */
11
11
  export declare class CollectionImporter implements IImporter {
12
12
  /**
13
- * {@inheritdoc Import.Importers.IImporter.types}
13
+ * {@inheritDoc Import.Importers.IImporter.types}
14
14
  */
15
15
  readonly types: string[];
16
16
  /**
@@ -24,7 +24,7 @@ export declare class CollectionImporter implements IImporter {
24
24
  */
25
25
  static create(): Result<CollectionImporter>;
26
26
  /**
27
- * {@inheritdoc Import.Importers.IImporter.import}
27
+ * {@inheritDoc Import.Importers.IImporter.import}
28
28
  */
29
29
  import(item: IImportable, manager: ResourceManagerBuilder): DetailedResult<IImportable[], ImporterResultDetail>;
30
30
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collectionImporter.d.ts","sourceRoot":"","sources":["../../../../src/packlets/import/importers/collectionImporter.ts"],"names":[],"mappings":"AAsBA,OAAO,EAEL,cAAc,EAGd,MAAM,EAEP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAsC,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAgB,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAI7D;;;;;GAKG;AACH,qBAAa,kBAAmB,YAAW,SAAS;IAClD;;OAEG;IACH,SAAgB,KAAK,EAAE,MAAM,EAAE,CAA0C;IAEzE;;OAEG;IACH,SAAS;IAET;;;;OAIG;WACW,MAAM,IAAI,MAAM,CAAC,kBAAkB,CAAC;IAIlD;;OAEG;IACI,MAAM,CACX,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,sBAAsB,GAC9B,cAAc,CAAC,WAAW,EAAE,EAAE,oBAAoB,CAAC;IAwBtD;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,YAAY;IAiBpB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,aAAa;CAkBtB"}
@@ -71,7 +71,7 @@ class CollectionImporter {
71
71
  */
72
72
  constructor() {
73
73
  /**
74
- * {@inheritdoc Import.Importers.IImporter.types}
74
+ * {@inheritDoc Import.Importers.IImporter.types}
75
75
  */
76
76
  this.types = ['resourceCollection', 'resourceTree'];
77
77
  }
@@ -84,7 +84,7 @@ class CollectionImporter {
84
84
  return (0, ts_utils_1.captureResult)(() => new CollectionImporter());
85
85
  }
86
86
  /**
87
- * {@inheritdoc Import.Importers.IImporter.import}
87
+ * {@inheritDoc Import.Importers.IImporter.import}
88
88
  */
89
89
  import(item, manager) {
90
90
  var _a, _b;