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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (545) hide show
  1. package/dist/index.browser.js.map +1 -0
  2. package/dist/index.js.map +1 -0
  3. package/dist/packlets/bundle/bundleBuilder.js.map +1 -0
  4. package/dist/packlets/bundle/bundleLoader.js.map +1 -0
  5. package/dist/packlets/bundle/bundleNormalizer.js.map +1 -0
  6. package/dist/packlets/bundle/bundleUtils.js.map +1 -0
  7. package/dist/packlets/bundle/convert.js.map +1 -0
  8. package/dist/packlets/bundle/index.js.map +1 -0
  9. package/dist/packlets/bundle/model.js.map +1 -0
  10. package/dist/packlets/common/conditions.js.map +1 -0
  11. package/dist/packlets/common/convert.js.map +1 -0
  12. package/dist/packlets/common/helpers/conditions.js.map +1 -0
  13. package/dist/packlets/common/helpers/context.js.map +1 -0
  14. package/dist/packlets/common/helpers/index.js.map +1 -0
  15. package/dist/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  16. package/dist/packlets/common/helpers/resources.js +2 -4
  17. package/dist/packlets/common/helpers/resources.js.map +1 -0
  18. package/dist/packlets/common/index.js.map +1 -0
  19. package/dist/packlets/common/resources.js.map +1 -0
  20. package/dist/packlets/common/validate/conditions.js +4 -4
  21. package/dist/packlets/common/validate/conditions.js.map +1 -0
  22. package/dist/packlets/common/validate/index.js.map +1 -0
  23. package/dist/packlets/common/validate/regularExpressions.js +2 -2
  24. package/dist/packlets/common/validate/regularExpressions.js.map +1 -0
  25. package/dist/packlets/common/validate/resources.js +1 -1
  26. package/dist/packlets/common/validate/resources.js.map +1 -0
  27. package/dist/packlets/conditions/condition.js +3 -7
  28. package/dist/packlets/conditions/condition.js.map +1 -0
  29. package/dist/packlets/conditions/conditionCollector.js.map +1 -0
  30. package/dist/packlets/conditions/conditionDecls.js.map +1 -0
  31. package/dist/packlets/conditions/conditionSet.js +14 -5
  32. package/dist/packlets/conditions/conditionSet.js.map +1 -0
  33. package/dist/packlets/conditions/conditionSetCollector.js.map +1 -0
  34. package/dist/packlets/conditions/conditionSetDecls.js.map +1 -0
  35. package/dist/packlets/conditions/conditionToken.js.map +1 -0
  36. package/dist/packlets/conditions/convert/conditionSetDecls.js +50 -6
  37. package/dist/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  38. package/dist/packlets/conditions/convert/decls.js +61 -5
  39. package/dist/packlets/conditions/convert/decls.js.map +1 -0
  40. package/dist/packlets/conditions/convert/index.js.map +1 -0
  41. package/dist/packlets/conditions/index.js.map +1 -0
  42. package/dist/packlets/config/common.js.map +1 -0
  43. package/dist/packlets/config/configInitFactory.js.map +1 -0
  44. package/dist/packlets/config/convert.js.map +1 -0
  45. package/dist/packlets/config/index.browser.js.map +1 -0
  46. package/dist/packlets/config/index.js.map +1 -0
  47. package/dist/packlets/config/json.js.map +1 -0
  48. package/dist/packlets/config/predefined/default.js.map +1 -0
  49. package/dist/packlets/config/predefined/extended.js.map +1 -0
  50. package/dist/packlets/config/predefined/index.js.map +1 -0
  51. package/dist/packlets/config/systemConfiguration.js.map +1 -0
  52. package/dist/packlets/context/contextDecls.js.map +1 -0
  53. package/dist/packlets/context/contextToken.js.map +1 -0
  54. package/dist/packlets/context/convert/decls.js.map +1 -0
  55. package/dist/packlets/context/convert/index.js.map +1 -0
  56. package/dist/packlets/context/index.js.map +1 -0
  57. package/dist/packlets/decisions/abstractDecision.js.map +1 -0
  58. package/dist/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  59. package/dist/packlets/decisions/candidate.js.map +1 -0
  60. package/dist/packlets/decisions/common.js.map +1 -0
  61. package/dist/packlets/decisions/concreteDecision.js.map +1 -0
  62. package/dist/packlets/decisions/decision.js +1 -1
  63. package/dist/packlets/decisions/decision.js.map +1 -0
  64. package/dist/packlets/decisions/index.js.map +1 -0
  65. package/dist/packlets/import/fsItem.js +1 -4
  66. package/dist/packlets/import/fsItem.js.map +1 -0
  67. package/dist/packlets/import/importContext.js +3 -3
  68. package/dist/packlets/import/importContext.js.map +1 -0
  69. package/dist/packlets/import/importManager.js +7 -3
  70. package/dist/packlets/import/importManager.js.map +1 -0
  71. package/dist/packlets/import/importable.js.map +1 -0
  72. package/dist/packlets/import/importers/collectionImporter.js +2 -2
  73. package/dist/packlets/import/importers/collectionImporter.js.map +1 -0
  74. package/dist/packlets/import/importers/fsItemImporter.js +30 -14
  75. package/dist/packlets/import/importers/fsItemImporter.js.map +1 -0
  76. package/dist/packlets/import/importers/importer.js.map +1 -0
  77. package/dist/packlets/import/importers/index.browser.js.map +1 -0
  78. package/dist/packlets/import/importers/index.js.map +1 -0
  79. package/dist/packlets/import/importers/jsonImporter.js +2 -2
  80. package/dist/packlets/import/importers/jsonImporter.js.map +1 -0
  81. package/dist/packlets/import/importers/pathImporter.js +1 -1
  82. package/dist/packlets/import/importers/pathImporter.js.map +1 -0
  83. package/dist/packlets/import/index.browser.js.map +1 -0
  84. package/dist/packlets/import/index.js.map +1 -0
  85. package/dist/packlets/qualifier-types/config/convert.js.map +1 -0
  86. package/dist/packlets/qualifier-types/config/index.js.map +1 -0
  87. package/dist/packlets/qualifier-types/config/json.js.map +1 -0
  88. package/dist/packlets/qualifier-types/convert.js.map +1 -0
  89. package/dist/packlets/qualifier-types/helpers.js.map +1 -0
  90. package/dist/packlets/qualifier-types/index.js.map +1 -0
  91. package/dist/packlets/qualifier-types/languageQualifierType.js +6 -7
  92. package/dist/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  93. package/dist/packlets/qualifier-types/literalQualifierType.js +7 -10
  94. package/dist/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  95. package/dist/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  96. package/dist/packlets/qualifier-types/qualifierType.js +12 -13
  97. package/dist/packlets/qualifier-types/qualifierType.js.map +1 -0
  98. package/dist/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  99. package/dist/packlets/qualifier-types/territoryQualifierType.js +5 -5
  100. package/dist/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  101. package/dist/packlets/qualifiers/convert/decls.js.map +1 -0
  102. package/dist/packlets/qualifiers/convert/index.js.map +1 -0
  103. package/dist/packlets/qualifiers/convert/qualifier.js.map +1 -0
  104. package/dist/packlets/qualifiers/index.js.map +1 -0
  105. package/dist/packlets/qualifiers/qualifier.js +6 -7
  106. package/dist/packlets/qualifiers/qualifier.js.map +1 -0
  107. package/dist/packlets/qualifiers/qualifierCollector.js +153 -9
  108. package/dist/packlets/qualifiers/qualifierCollector.js.map +1 -0
  109. package/dist/packlets/qualifiers/qualifierDecl.js.map +1 -0
  110. package/dist/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  111. package/dist/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  112. package/dist/packlets/resource-json/compiled/common.js.map +1 -0
  113. package/dist/packlets/resource-json/compiled/convert.js.map +1 -0
  114. package/dist/packlets/resource-json/compiled/index.js.map +1 -0
  115. package/dist/packlets/resource-json/compiled/json.js.map +1 -0
  116. package/dist/packlets/resource-json/convert.js +225 -0
  117. package/dist/packlets/resource-json/convert.js.map +1 -0
  118. package/dist/packlets/resource-json/helpers.js.map +1 -0
  119. package/dist/packlets/resource-json/index.js.map +1 -0
  120. package/dist/packlets/resource-json/json.js +2 -2
  121. package/dist/packlets/resource-json/json.js.map +1 -0
  122. package/dist/packlets/resource-json/normalized.js.map +1 -0
  123. package/dist/packlets/resource-json/resourceDeclCollection.js +1 -1
  124. package/dist/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  125. package/dist/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  126. package/dist/packlets/resource-json/resourceDeclTree.js +1 -1
  127. package/dist/packlets/resource-json/resourceDeclTree.js.map +1 -0
  128. package/dist/packlets/resource-types/config/convert.js.map +1 -0
  129. package/dist/packlets/resource-types/config/index.js.map +1 -0
  130. package/dist/packlets/resource-types/config/json.js.map +1 -0
  131. package/dist/packlets/resource-types/helpers.js.map +1 -0
  132. package/dist/packlets/resource-types/index.js.map +1 -0
  133. package/dist/packlets/resource-types/jsonResourceType.js +2 -2
  134. package/dist/packlets/resource-types/jsonResourceType.js.map +1 -0
  135. package/dist/packlets/resource-types/resourceType.js +2 -2
  136. package/dist/packlets/resource-types/resourceType.js.map +1 -0
  137. package/dist/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  138. package/dist/packlets/resources/candidateReducer.js.map +1 -0
  139. package/dist/packlets/resources/candidateValue.js.map +1 -0
  140. package/dist/packlets/resources/candidateValueCollector.js.map +1 -0
  141. package/dist/packlets/resources/common.js.map +1 -0
  142. package/dist/packlets/resources/deltaGenerator.js.map +1 -0
  143. package/dist/packlets/resources/index.js.map +1 -0
  144. package/dist/packlets/resources/resource.js.map +1 -0
  145. package/dist/packlets/resources/resourceBuilder.js +2 -2
  146. package/dist/packlets/resources/resourceBuilder.js.map +1 -0
  147. package/dist/packlets/resources/resourceCandidate.js.map +1 -0
  148. package/dist/packlets/resources/resourceManagerBuilder.js +5 -5
  149. package/dist/packlets/resources/resourceManagerBuilder.js.map +1 -0
  150. package/dist/packlets/runtime/cacheListener.js.map +1 -0
  151. package/dist/packlets/runtime/cacheMetrics.js.map +1 -0
  152. package/dist/packlets/runtime/compiledResourceCollection.js +5 -5
  153. package/dist/packlets/runtime/compiledResourceCollection.js.map +1 -0
  154. package/dist/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  155. package/dist/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  156. package/dist/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  157. package/dist/packlets/runtime/context/index.js.map +1 -0
  158. package/dist/packlets/runtime/context/simpleContextQualifierProvider.js +3 -0
  159. package/dist/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  160. package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +3 -5
  161. package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  162. package/dist/packlets/runtime/iResourceManager.js.map +1 -0
  163. package/dist/packlets/runtime/index.js.map +1 -0
  164. package/dist/packlets/runtime/resource-tree/common.js.map +1 -0
  165. package/dist/packlets/runtime/resource-tree/index.js.map +1 -0
  166. package/dist/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  167. package/dist/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  168. package/dist/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  169. package/dist/packlets/runtime/resourceResolver.js.map +1 -0
  170. package/dist/packlets/runtime/resourceTreeResolver.js.map +1 -0
  171. package/dist/packlets/runtime/validate.js.map +1 -0
  172. package/dist/packlets/zip-archive/convert.js.map +1 -0
  173. package/dist/packlets/zip-archive/index.browser.js.map +1 -0
  174. package/dist/packlets/zip-archive/index.js.map +1 -0
  175. package/dist/packlets/zip-archive/json.js.map +1 -0
  176. package/dist/packlets/zip-archive/types.js.map +1 -0
  177. package/dist/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  178. package/dist/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  179. package/dist/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  180. package/dist/ts-res.d.ts +576 -164
  181. package/dist/tsdoc-metadata.json +1 -1
  182. package/lib/index.browser.d.ts.map +1 -0
  183. package/lib/index.browser.js.map +1 -0
  184. package/lib/index.d.ts.map +1 -0
  185. package/lib/index.js.map +1 -0
  186. package/lib/packlets/bundle/bundleBuilder.d.ts.map +1 -0
  187. package/lib/packlets/bundle/bundleBuilder.js.map +1 -0
  188. package/lib/packlets/bundle/bundleLoader.d.ts.map +1 -0
  189. package/lib/packlets/bundle/bundleLoader.js.map +1 -0
  190. package/lib/packlets/bundle/bundleNormalizer.d.ts.map +1 -0
  191. package/lib/packlets/bundle/bundleNormalizer.js.map +1 -0
  192. package/lib/packlets/bundle/bundleUtils.d.ts.map +1 -0
  193. package/lib/packlets/bundle/bundleUtils.js.map +1 -0
  194. package/lib/packlets/bundle/convert.d.ts.map +1 -0
  195. package/lib/packlets/bundle/convert.js.map +1 -0
  196. package/lib/packlets/bundle/index.d.ts.map +1 -0
  197. package/lib/packlets/bundle/index.js.map +1 -0
  198. package/lib/packlets/bundle/model.d.ts.map +1 -0
  199. package/lib/packlets/bundle/model.js.map +1 -0
  200. package/lib/packlets/common/conditions.d.ts.map +1 -0
  201. package/lib/packlets/common/conditions.js.map +1 -0
  202. package/lib/packlets/common/convert.d.ts.map +1 -0
  203. package/lib/packlets/common/convert.js.map +1 -0
  204. package/lib/packlets/common/helpers/conditions.d.ts.map +1 -0
  205. package/lib/packlets/common/helpers/conditions.js.map +1 -0
  206. package/lib/packlets/common/helpers/context.d.ts.map +1 -0
  207. package/lib/packlets/common/helpers/context.js.map +1 -0
  208. package/lib/packlets/common/helpers/index.d.ts.map +1 -0
  209. package/lib/packlets/common/helpers/index.js.map +1 -0
  210. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +1 -0
  211. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  212. package/lib/packlets/common/helpers/resources.d.ts +2 -4
  213. package/lib/packlets/common/helpers/resources.d.ts.map +1 -0
  214. package/lib/packlets/common/helpers/resources.js +2 -4
  215. package/lib/packlets/common/helpers/resources.js.map +1 -0
  216. package/lib/packlets/common/index.d.ts.map +1 -0
  217. package/lib/packlets/common/index.js.map +1 -0
  218. package/lib/packlets/common/resources.d.ts.map +1 -0
  219. package/lib/packlets/common/resources.js.map +1 -0
  220. package/lib/packlets/common/validate/conditions.d.ts +4 -4
  221. package/lib/packlets/common/validate/conditions.d.ts.map +1 -0
  222. package/lib/packlets/common/validate/conditions.js +4 -4
  223. package/lib/packlets/common/validate/conditions.js.map +1 -0
  224. package/lib/packlets/common/validate/index.d.ts.map +1 -0
  225. package/lib/packlets/common/validate/index.js.map +1 -0
  226. package/lib/packlets/common/validate/regularExpressions.d.ts +2 -2
  227. package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -0
  228. package/lib/packlets/common/validate/regularExpressions.js +2 -2
  229. package/lib/packlets/common/validate/regularExpressions.js.map +1 -0
  230. package/lib/packlets/common/validate/resources.d.ts +1 -1
  231. package/lib/packlets/common/validate/resources.d.ts.map +1 -0
  232. package/lib/packlets/common/validate/resources.js +1 -1
  233. package/lib/packlets/common/validate/resources.js.map +1 -0
  234. package/lib/packlets/conditions/condition.d.ts +3 -7
  235. package/lib/packlets/conditions/condition.d.ts.map +1 -0
  236. package/lib/packlets/conditions/condition.js +3 -7
  237. package/lib/packlets/conditions/condition.js.map +1 -0
  238. package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -0
  239. package/lib/packlets/conditions/conditionCollector.js.map +1 -0
  240. package/lib/packlets/conditions/conditionDecls.d.ts +6 -1
  241. package/lib/packlets/conditions/conditionDecls.d.ts.map +1 -0
  242. package/lib/packlets/conditions/conditionDecls.js.map +1 -0
  243. package/lib/packlets/conditions/conditionSet.d.ts.map +1 -0
  244. package/lib/packlets/conditions/conditionSet.js +14 -5
  245. package/lib/packlets/conditions/conditionSet.js.map +1 -0
  246. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -0
  247. package/lib/packlets/conditions/conditionSetCollector.js.map +1 -0
  248. package/lib/packlets/conditions/conditionSetDecls.d.ts +7 -2
  249. package/lib/packlets/conditions/conditionSetDecls.d.ts.map +1 -0
  250. package/lib/packlets/conditions/conditionSetDecls.js.map +1 -0
  251. package/lib/packlets/conditions/conditionToken.d.ts.map +1 -0
  252. package/lib/packlets/conditions/conditionToken.js.map +1 -0
  253. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts +30 -2
  254. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +1 -0
  255. package/lib/packlets/conditions/convert/conditionSetDecls.js +51 -5
  256. package/lib/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  257. package/lib/packlets/conditions/convert/decls.d.ts +39 -3
  258. package/lib/packlets/conditions/convert/decls.d.ts.map +1 -0
  259. package/lib/packlets/conditions/convert/decls.js +63 -5
  260. package/lib/packlets/conditions/convert/decls.js.map +1 -0
  261. package/lib/packlets/conditions/convert/index.d.ts.map +1 -0
  262. package/lib/packlets/conditions/convert/index.js.map +1 -0
  263. package/lib/packlets/conditions/index.d.ts.map +1 -0
  264. package/lib/packlets/conditions/index.js.map +1 -0
  265. package/lib/packlets/config/common.d.ts.map +1 -0
  266. package/lib/packlets/config/common.js.map +1 -0
  267. package/lib/packlets/config/configInitFactory.d.ts.map +1 -0
  268. package/lib/packlets/config/configInitFactory.js.map +1 -0
  269. package/lib/packlets/config/convert.d.ts.map +1 -0
  270. package/lib/packlets/config/convert.js.map +1 -0
  271. package/lib/packlets/config/index.browser.d.ts.map +1 -0
  272. package/lib/packlets/config/index.browser.js.map +1 -0
  273. package/lib/packlets/config/index.d.ts.map +1 -0
  274. package/lib/packlets/config/index.js.map +1 -0
  275. package/lib/packlets/config/json.d.ts.map +1 -0
  276. package/lib/packlets/config/json.js.map +1 -0
  277. package/lib/packlets/config/predefined/default.d.ts.map +1 -0
  278. package/lib/packlets/config/predefined/default.js.map +1 -0
  279. package/lib/packlets/config/predefined/extended.d.ts.map +1 -0
  280. package/lib/packlets/config/predefined/extended.js.map +1 -0
  281. package/lib/packlets/config/predefined/index.d.ts.map +1 -0
  282. package/lib/packlets/config/predefined/index.js.map +1 -0
  283. package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
  284. package/lib/packlets/config/systemConfiguration.js.map +1 -0
  285. package/lib/packlets/context/contextDecls.d.ts.map +1 -0
  286. package/lib/packlets/context/contextDecls.js.map +1 -0
  287. package/lib/packlets/context/contextToken.d.ts.map +1 -0
  288. package/lib/packlets/context/contextToken.js.map +1 -0
  289. package/lib/packlets/context/convert/decls.d.ts.map +1 -0
  290. package/lib/packlets/context/convert/decls.js.map +1 -0
  291. package/lib/packlets/context/convert/index.d.ts.map +1 -0
  292. package/lib/packlets/context/convert/index.js.map +1 -0
  293. package/lib/packlets/context/index.d.ts.map +1 -0
  294. package/lib/packlets/context/index.js.map +1 -0
  295. package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -0
  296. package/lib/packlets/decisions/abstractDecision.js.map +1 -0
  297. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -0
  298. package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  299. package/lib/packlets/decisions/candidate.d.ts.map +1 -0
  300. package/lib/packlets/decisions/candidate.js.map +1 -0
  301. package/lib/packlets/decisions/common.d.ts.map +1 -0
  302. package/lib/packlets/decisions/common.js.map +1 -0
  303. package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -0
  304. package/lib/packlets/decisions/concreteDecision.js.map +1 -0
  305. package/lib/packlets/decisions/decision.d.ts +1 -1
  306. package/lib/packlets/decisions/decision.d.ts.map +1 -0
  307. package/lib/packlets/decisions/decision.js +1 -1
  308. package/lib/packlets/decisions/decision.js.map +1 -0
  309. package/lib/packlets/decisions/index.d.ts.map +1 -0
  310. package/lib/packlets/decisions/index.js.map +1 -0
  311. package/lib/packlets/import/fsItem.d.ts +1 -4
  312. package/lib/packlets/import/fsItem.d.ts.map +1 -0
  313. package/lib/packlets/import/fsItem.js +1 -4
  314. package/lib/packlets/import/fsItem.js.map +1 -0
  315. package/lib/packlets/import/importContext.d.ts +5 -5
  316. package/lib/packlets/import/importContext.d.ts.map +1 -0
  317. package/lib/packlets/import/importContext.js +3 -3
  318. package/lib/packlets/import/importContext.js.map +1 -0
  319. package/lib/packlets/import/importManager.d.ts +15 -1
  320. package/lib/packlets/import/importManager.d.ts.map +1 -0
  321. package/lib/packlets/import/importManager.js +7 -3
  322. package/lib/packlets/import/importManager.js.map +1 -0
  323. package/lib/packlets/import/importable.d.ts.map +1 -0
  324. package/lib/packlets/import/importable.js.map +1 -0
  325. package/lib/packlets/import/importers/collectionImporter.d.ts +2 -2
  326. package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -0
  327. package/lib/packlets/import/importers/collectionImporter.js +2 -2
  328. package/lib/packlets/import/importers/collectionImporter.js.map +1 -0
  329. package/lib/packlets/import/importers/fsItemImporter.d.ts +16 -2
  330. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -0
  331. package/lib/packlets/import/importers/fsItemImporter.js +29 -13
  332. package/lib/packlets/import/importers/fsItemImporter.js.map +1 -0
  333. package/lib/packlets/import/importers/importer.d.ts.map +1 -0
  334. package/lib/packlets/import/importers/importer.js.map +1 -0
  335. package/lib/packlets/import/importers/index.browser.d.ts.map +1 -0
  336. package/lib/packlets/import/importers/index.browser.js.map +1 -0
  337. package/lib/packlets/import/importers/index.d.ts.map +1 -0
  338. package/lib/packlets/import/importers/index.js.map +1 -0
  339. package/lib/packlets/import/importers/jsonImporter.d.ts +2 -2
  340. package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -0
  341. package/lib/packlets/import/importers/jsonImporter.js +2 -2
  342. package/lib/packlets/import/importers/jsonImporter.js.map +1 -0
  343. package/lib/packlets/import/importers/pathImporter.d.ts +1 -1
  344. package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -0
  345. package/lib/packlets/import/importers/pathImporter.js +1 -1
  346. package/lib/packlets/import/importers/pathImporter.js.map +1 -0
  347. package/lib/packlets/import/index.browser.d.ts.map +1 -0
  348. package/lib/packlets/import/index.browser.js.map +1 -0
  349. package/lib/packlets/import/index.d.ts.map +1 -0
  350. package/lib/packlets/import/index.js.map +1 -0
  351. package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
  352. package/lib/packlets/qualifier-types/config/convert.js.map +1 -0
  353. package/lib/packlets/qualifier-types/config/index.d.ts.map +1 -0
  354. package/lib/packlets/qualifier-types/config/index.js.map +1 -0
  355. package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
  356. package/lib/packlets/qualifier-types/config/json.js.map +1 -0
  357. package/lib/packlets/qualifier-types/convert.d.ts.map +1 -0
  358. package/lib/packlets/qualifier-types/convert.js.map +1 -0
  359. package/lib/packlets/qualifier-types/helpers.d.ts.map +1 -0
  360. package/lib/packlets/qualifier-types/helpers.js.map +1 -0
  361. package/lib/packlets/qualifier-types/index.d.ts.map +1 -0
  362. package/lib/packlets/qualifier-types/index.js.map +1 -0
  363. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +6 -7
  364. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -0
  365. package/lib/packlets/qualifier-types/languageQualifierType.js +6 -7
  366. package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  367. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +7 -10
  368. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -0
  369. package/lib/packlets/qualifier-types/literalQualifierType.js +7 -10
  370. package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  371. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
  372. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  373. package/lib/packlets/qualifier-types/qualifierType.d.ts +17 -18
  374. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -0
  375. package/lib/packlets/qualifier-types/qualifierType.js +12 -13
  376. package/lib/packlets/qualifier-types/qualifierType.js.map +1 -0
  377. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -0
  378. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  379. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +8 -8
  380. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -0
  381. package/lib/packlets/qualifier-types/territoryQualifierType.js +5 -5
  382. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  383. package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -0
  384. package/lib/packlets/qualifiers/convert/decls.js.map +1 -0
  385. package/lib/packlets/qualifiers/convert/index.d.ts.map +1 -0
  386. package/lib/packlets/qualifiers/convert/index.js.map +1 -0
  387. package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +1 -0
  388. package/lib/packlets/qualifiers/convert/qualifier.js.map +1 -0
  389. package/lib/packlets/qualifiers/index.d.ts.map +1 -0
  390. package/lib/packlets/qualifiers/index.js.map +1 -0
  391. package/lib/packlets/qualifiers/qualifier.d.ts +6 -7
  392. package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -0
  393. package/lib/packlets/qualifiers/qualifier.js +6 -7
  394. package/lib/packlets/qualifiers/qualifier.js.map +1 -0
  395. package/lib/packlets/qualifiers/qualifierCollector.d.ts +107 -9
  396. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -0
  397. package/lib/packlets/qualifiers/qualifierCollector.js +152 -8
  398. package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -0
  399. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -0
  400. package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -0
  401. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +1 -0
  402. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  403. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +1 -0
  404. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  405. package/lib/packlets/resource-json/compiled/common.d.ts.map +1 -0
  406. package/lib/packlets/resource-json/compiled/common.js.map +1 -0
  407. package/lib/packlets/resource-json/compiled/convert.d.ts.map +1 -0
  408. package/lib/packlets/resource-json/compiled/convert.js.map +1 -0
  409. package/lib/packlets/resource-json/compiled/index.d.ts.map +1 -0
  410. package/lib/packlets/resource-json/compiled/index.js.map +1 -0
  411. package/lib/packlets/resource-json/compiled/json.d.ts.map +1 -0
  412. package/lib/packlets/resource-json/compiled/json.js.map +1 -0
  413. package/lib/packlets/resource-json/convert.d.ts +85 -0
  414. package/lib/packlets/resource-json/convert.d.ts.map +1 -0
  415. package/lib/packlets/resource-json/convert.js +237 -0
  416. package/lib/packlets/resource-json/convert.js.map +1 -0
  417. package/lib/packlets/resource-json/helpers.d.ts.map +1 -0
  418. package/lib/packlets/resource-json/helpers.js.map +1 -0
  419. package/lib/packlets/resource-json/index.d.ts.map +1 -0
  420. package/lib/packlets/resource-json/index.js.map +1 -0
  421. package/lib/packlets/resource-json/json.d.ts +128 -39
  422. package/lib/packlets/resource-json/json.d.ts.map +1 -0
  423. package/lib/packlets/resource-json/json.js +2 -2
  424. package/lib/packlets/resource-json/json.js.map +1 -0
  425. package/lib/packlets/resource-json/normalized.d.ts.map +1 -0
  426. package/lib/packlets/resource-json/normalized.js.map +1 -0
  427. package/lib/packlets/resource-json/resourceDeclCollection.d.ts +1 -1
  428. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -0
  429. package/lib/packlets/resource-json/resourceDeclCollection.js +1 -1
  430. package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  431. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -0
  432. package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  433. package/lib/packlets/resource-json/resourceDeclTree.d.ts +1 -1
  434. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -0
  435. package/lib/packlets/resource-json/resourceDeclTree.js +1 -1
  436. package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -0
  437. package/lib/packlets/resource-types/config/convert.d.ts.map +1 -0
  438. package/lib/packlets/resource-types/config/convert.js.map +1 -0
  439. package/lib/packlets/resource-types/config/index.d.ts.map +1 -0
  440. package/lib/packlets/resource-types/config/index.js.map +1 -0
  441. package/lib/packlets/resource-types/config/json.d.ts.map +1 -0
  442. package/lib/packlets/resource-types/config/json.js.map +1 -0
  443. package/lib/packlets/resource-types/helpers.d.ts.map +1 -0
  444. package/lib/packlets/resource-types/helpers.js.map +1 -0
  445. package/lib/packlets/resource-types/index.d.ts.map +1 -0
  446. package/lib/packlets/resource-types/index.js.map +1 -0
  447. package/lib/packlets/resource-types/jsonResourceType.d.ts +17 -5
  448. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -0
  449. package/lib/packlets/resource-types/jsonResourceType.js +2 -2
  450. package/lib/packlets/resource-types/jsonResourceType.js.map +1 -0
  451. package/lib/packlets/resource-types/resourceType.d.ts +5 -5
  452. package/lib/packlets/resource-types/resourceType.d.ts.map +1 -0
  453. package/lib/packlets/resource-types/resourceType.js +2 -2
  454. package/lib/packlets/resource-types/resourceType.js.map +1 -0
  455. package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +1 -0
  456. package/lib/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  457. package/lib/packlets/resources/candidateReducer.d.ts.map +1 -0
  458. package/lib/packlets/resources/candidateReducer.js.map +1 -0
  459. package/lib/packlets/resources/candidateValue.d.ts.map +1 -0
  460. package/lib/packlets/resources/candidateValue.js.map +1 -0
  461. package/lib/packlets/resources/candidateValueCollector.d.ts.map +1 -0
  462. package/lib/packlets/resources/candidateValueCollector.js.map +1 -0
  463. package/lib/packlets/resources/common.d.ts.map +1 -0
  464. package/lib/packlets/resources/common.js.map +1 -0
  465. package/lib/packlets/resources/deltaGenerator.d.ts.map +1 -0
  466. package/lib/packlets/resources/deltaGenerator.js.map +1 -0
  467. package/lib/packlets/resources/index.d.ts.map +1 -0
  468. package/lib/packlets/resources/index.js.map +1 -0
  469. package/lib/packlets/resources/resource.d.ts.map +1 -0
  470. package/lib/packlets/resources/resource.js.map +1 -0
  471. package/lib/packlets/resources/resourceBuilder.d.ts +2 -2
  472. package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -0
  473. package/lib/packlets/resources/resourceBuilder.js +2 -2
  474. package/lib/packlets/resources/resourceBuilder.js.map +1 -0
  475. package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -0
  476. package/lib/packlets/resources/resourceCandidate.js.map +1 -0
  477. package/lib/packlets/resources/resourceManagerBuilder.d.ts +5 -5
  478. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
  479. package/lib/packlets/resources/resourceManagerBuilder.js +5 -5
  480. package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -0
  481. package/lib/packlets/runtime/cacheListener.d.ts.map +1 -0
  482. package/lib/packlets/runtime/cacheListener.js.map +1 -0
  483. package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -0
  484. package/lib/packlets/runtime/cacheMetrics.js.map +1 -0
  485. package/lib/packlets/runtime/compiledResourceCollection.d.ts +5 -5
  486. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
  487. package/lib/packlets/runtime/compiledResourceCollection.js +5 -5
  488. package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -0
  489. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +1 -0
  490. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  491. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +1 -0
  492. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  493. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +1 -0
  494. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  495. package/lib/packlets/runtime/context/index.d.ts.map +1 -0
  496. package/lib/packlets/runtime/context/index.js.map +1 -0
  497. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +9 -2
  498. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -0
  499. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +3 -0
  500. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  501. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +8 -1
  502. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -0
  503. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +3 -5
  504. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  505. package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -0
  506. package/lib/packlets/runtime/iResourceManager.js.map +1 -0
  507. package/lib/packlets/runtime/index.d.ts.map +1 -0
  508. package/lib/packlets/runtime/index.js.map +1 -0
  509. package/lib/packlets/runtime/resource-tree/common.d.ts.map +1 -0
  510. package/lib/packlets/runtime/resource-tree/common.js.map +1 -0
  511. package/lib/packlets/runtime/resource-tree/index.d.ts.map +1 -0
  512. package/lib/packlets/runtime/resource-tree/index.js.map +1 -0
  513. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +1 -0
  514. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  515. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +1 -0
  516. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  517. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +1 -0
  518. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  519. package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -0
  520. package/lib/packlets/runtime/resourceResolver.js.map +1 -0
  521. package/lib/packlets/runtime/resourceTreeResolver.d.ts.map +1 -0
  522. package/lib/packlets/runtime/resourceTreeResolver.js.map +1 -0
  523. package/lib/packlets/runtime/validate.d.ts.map +1 -0
  524. package/lib/packlets/runtime/validate.js.map +1 -0
  525. package/lib/packlets/zip-archive/convert.d.ts.map +1 -0
  526. package/lib/packlets/zip-archive/convert.js.map +1 -0
  527. package/lib/packlets/zip-archive/index.browser.d.ts.map +1 -0
  528. package/lib/packlets/zip-archive/index.browser.js.map +1 -0
  529. package/lib/packlets/zip-archive/index.d.ts.map +1 -0
  530. package/lib/packlets/zip-archive/index.js.map +1 -0
  531. package/lib/packlets/zip-archive/json.d.ts.map +1 -0
  532. package/lib/packlets/zip-archive/json.js.map +1 -0
  533. package/lib/packlets/zip-archive/types.d.ts.map +1 -0
  534. package/lib/packlets/zip-archive/types.js.map +1 -0
  535. package/lib/packlets/zip-archive/zipArchiveCreator.d.ts.map +1 -0
  536. package/lib/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  537. package/lib/packlets/zip-archive/zipArchiveFormat.d.ts.map +1 -0
  538. package/lib/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  539. package/lib/packlets/zip-archive/zipArchiveLoader.d.ts.map +1 -0
  540. package/lib/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  541. package/package.json +12 -10
  542. package/dist/test/data/sample.json +0 -32
  543. package/dist/test/unit/qualifier-types/testQualifierType.js +0 -76
  544. package/dist/test/unit/resource-types/testDerivedResourceType.js +0 -109
  545. package/dist/test/unit/resources/deltaGenerator.helpers.js +0 -282
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collectionImporter.js","sourceRoot":"","sources":["../../../../src/packlets/import/importers/collectionImporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAOuB;AAEvB,8CAA0D;AAE1D,kEAAoD;AACpD,oDAAiD;AAEjD;;;;;GAKG;AACH,MAAa,kBAAkB;IAM7B;;OAEG;IACH;QARA;;WAEG;QACa,UAAK,GAAa,CAAC,oBAAoB,EAAE,cAAc,CAAC,CAAC;IAKhD,CAAC;IAE1B;;;;OAIG;IACI,MAAM,CAAC,MAAM;QAClB,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,kBAAkB,EAAE,CAAC,CAAC;IACvD,CAAC;IAED;;OAEG;IACI,MAAM,CACX,IAAiB,EACjB,OAA+B;;QAE/B,IAAI,CAAC,IAAA,yBAAY,EAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,oBAAoB,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,EAAE,CAAC;YAChG,yCAAyC;YACzC,MAAM,IAAI,GAAG,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,MAAM,mCAAI,SAAS,CAAC;YAC/C,OAAO,IAAA,yBAAc,EAAC,GAAG,IAAI,6CAA6C,IAAI,CAAC,IAAI,GAAG,EAAE,SAAS,CAAC,CAAC;QACrG,CAAC;QAED,M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,CAAC,QAAQ,CAAC,EAChD,CAAC;YACD,OAAO,IAAI,CAAC,sCAAsC,CAAC,CAAC;QACtD,CAAC;QACD,OAAO,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED;;;;;;;;;;;OAWG;IACK,aAAa,CACnB,OAA+B,EAC/B,SAAiE,EACjE,OAAuB;QAEvB,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,YAAY,CAAC,OAAO,CAAC,mBAAmB,CAC7C,SAAS,EACT,OAAO,CAAC,MAAM,EACd,OAAO,CAAC,UAAU,CACnB,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,sEAAsE;aAAM,IAC5E,CAAC,YAAY,CAAC,IAAI,CAAC,4BAA4B,CAAC,SAAS,CAAC,EAC1D,CAAC;YACD,OAAO,IAAI,CAAC,gDAAgD,CAAC,CAAC;QAChE,CAAC;QACD,OAAO,OAAO,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC9C,CAAC;CACF;AA9GD,gDA8GC","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 failWithDetail,\n MessageAggregator,\n Result,\n succeed\n} from '@fgv/ts-utils';\nimport { ResourceBuilder, ResourceCandidate, ResourceManagerBuilder } from '../../resources';\nimport { IImportable, isImportable } from '../importable';\nimport { IImporter, ImporterResultDetail } from './importer';\nimport * as ResourceJson from '../../resource-json';\nimport { ImportContext } from '../importContext';\n\n/**\n * {@link Import.Importers.IImporter | Importer} implementation which imports\n * a {@link ResourceJson.ResourceDeclCollection | resource collection} or\n * {@link ResourceJson.ResourceDeclTree | resource tree} from an importable item.\n * @public\n */\nexport class CollectionImporter implements IImporter {\n /**\n * {@inheritDoc Import.Importers.IImporter.types}\n */\n public readonly types: string[] = ['resourceCollection', 'resourceTree'];\n\n /**\n * Protected {@link Import.Importers.CollectionImporter | CollectionImporter} constructor for derived classes\n */\n protected constructor() {}\n\n /**\n * Creates a new {@link Import.Importers.CollectionImporter | CollectionImporter} instance.\n * @returns `Success` with the new {@link Import.Importers.CollectionImporter | CollectionImporter} if successful,\n * `Failure` otherwise.\n */\n public static create(): Result<CollectionImporter> {\n return captureResult(() => new CollectionImporter());\n }\n\n /**\n * {@inheritDoc Import.Importers.IImporter.import}\n */\n public import(\n item: IImportable,\n manager: ResourceManagerBuilder\n ): DetailedResult<IImportable[], ImporterResultDetail> {\n if (!isImportable(item) || (item.type !== 'resourceCollection' && item.type !== 'resourceTree')) {\n /* c8 ignore next 1 - defense in depth */\n const name = item.context?.baseId ?? 'unknown';\n return failWithDetail(`${name}: invalid resource collection importable (${item.type})`, 'skipped');\n }\n\n const container = item.type === 'resourceCollection' ? item.collection : item.tree;\n\n return ImportContext.forContainerImport(container.context, item.context)\n .onSuccess((context) => {\n const errors: MessageAggregator = new MessageAggregator();\n for (const resource of container.getImporterResources()) {\n this._addResource(manager, resource, context).aggregateError(errors);\n }\n\n for (const candidate of container.getImporterCandidates()) {\n this._addCandidate(manager, candidate, context).aggregateError(errors);\n }\n return errors.returnOrReport(succeed([]));\n })\n .withDetail('failed', 'consumed');\n }\n\n /**\n * Adds a {@link ResourceJson.Normalized.IImporterResourceDecl | declared resource} to\n * the supplied {@link Resources.ResourceManagerBuilder | resource manager builder}, merging an\n * optional {@link Import.ImportContext | import context} if provided.\n * @param manager - The {@link Resources.ResourceManagerBuilder | resource manager builder} to which\n * the resource will be added.\n * @param resource - The {@link ResourceJson.Normalized.IImporterResourceDecl | resource}\n * to add.\n * @param context - Optional {@link Import.ImportContext | import context} to merge\n * with the resource.\n * @returns `Success` with the {@link Resources.ResourceBuilder | resource builder}\n * for the resource if successful, `Failure` with an error message if not.\n */\n private _addResource(\n manager: ResourceManagerBuilder,\n resource: ResourceJson.Normalized.IImporterResourceDecl,\n context?: ImportContext\n ): Result<ResourceBuilder> {\n if (context) {\n return ResourceJson.Helpers.mergeLooseResource(resource, context.baseId, context.conditions).onSuccess(\n (merged) => manager.addResource(merged)\n );\n } /* c8 ignore next 4 - defense in depth, should be guarded elsewhere */ else if (\n !ResourceJson.Json.isLooseResourceDecl(resource)\n ) {\n return fail('cannot add child resource to manager');\n }\n return manager.addResource(resource);\n }\n\n /**\n * Adds a {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | declared resource candidate}\n * to the supplied {@link Resources.ResourceManagerBuilder | resource manager builder}, merging an optional\n * {@link Import.ImportContext | import context} if provided.\n * @param manager - The {@link Resources.ResourceManagerBuilder | resource manager builder} to which the\n * candidate will be added.\n * @param candidate - The {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | candidate}\n * to add.\n * @param context - Optional {@link Import.ImportContext | import context} to merge with the candidate.\n * @returns `Success` with the {@link Resources.ResourceCandidate | resource candidate} if successful,\n * `Failure` with an error message if not.\n */\n private _addCandidate(\n manager: ResourceManagerBuilder,\n candidate: ResourceJson.Normalized.IImporterResourceCandidateDecl,\n context?: ImportContext\n ): Result<ResourceCandidate> {\n if (context) {\n return ResourceJson.Helpers.mergeLooseCandidate(\n candidate,\n context.baseId,\n context.conditions\n ).onSuccess((merged) => manager.addLooseCandidate(merged));\n } /* c8 ignore next 4 - defense in depth, should be guarded elsewhere */ else if (\n !ResourceJson.Json.isLooseResourceCandidateDecl(candidate)\n ) {\n return fail('cannot add child resource candidate to manager');\n }\n return manager.addLooseCandidate(candidate);\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
- import { DetailedResult, Result } from '@fgv/ts-utils';
1
+ import { DetailedResult, Result, Converter } from '@fgv/ts-utils';
2
+ import { JsonValue } from '@fgv/ts-json-base';
2
3
  import { ResourceManagerBuilder } from '../../resources';
3
4
  import { IImportable } from '../importable';
4
5
  import { IImporter, ImporterResultDetail } from './importer';
@@ -10,6 +11,8 @@ import { FsItem, FsItemResultDetail } from '../fsItem';
10
11
  */
11
12
  export interface IFsItemImporterCreateParams {
12
13
  qualifiers: IReadOnlyQualifierCollector;
14
+ fileContentConverter?: Converter<JsonValue>;
15
+ fileContentExtensions?: ReadonlyArray<string>;
13
16
  }
14
17
  /**
15
18
  * {@link Import.Importers.IImporter | Importer} implementation which imports resources from a `FileTree`.
@@ -20,6 +23,14 @@ export declare class FsItemImporter implements IImporter {
20
23
  * The {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use for this importer.
21
24
  */
22
25
  readonly qualifiers: IReadOnlyQualifierCollector;
26
+ /**
27
+ * Optional converter used to parse raw file contents before they are exposed as JSON importables.
28
+ */
29
+ readonly fileContentConverter?: Converter<JsonValue>;
30
+ /**
31
+ * Optional list of file extensions which should be parsed using the file content converter.
32
+ */
33
+ readonly fileContentExtensions?: ReadonlyArray<string>;
23
34
  /**
24
35
  * The types of {@link Import.IImportable | importables} that this importer can handle.
25
36
  */
@@ -36,9 +47,12 @@ export declare class FsItemImporter implements IImporter {
36
47
  */
37
48
  static create(params: IFsItemImporterCreateParams): Result<FsItemImporter>;
38
49
  /**
39
- * {@inheritdoc Import.Importers.IImporter.import}
50
+ * {@inheritDoc Import.Importers.IImporter.import}
40
51
  */
41
52
  import(item: IImportable, __manager: ResourceManagerBuilder): DetailedResult<IImportable[], ImporterResultDetail>;
53
+ private _isSupportedFileExtension;
54
+ private _getJsonContents;
55
+ private _canConvertFileExtension;
42
56
  /**
43
57
  * Gets an {@link Import.FsItem | FsItem} from an {@link Import.IImportable | importable}.
44
58
  * @param item - The importable to convert.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fsItemImporter.d.ts","sourceRoot":"","sources":["../../../../src/packlets/import/importers/fsItemImporter.ts"],"names":[],"mappings":"AAsBA,OAAO,EAEL,cAAc,EAGd,MAAM,EAGN,SAAS,EACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAA0C,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,WAAW,EAA+B,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,UAAU,EAAE,2BAA2B,CAAC;IACxC,oBAAoB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5C,qBAAqB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC/C;AAED;;;GAGG;AACH,qBAAa,cAAe,YAAW,SAAS;IAC9C;;OAEG;IACH,SAAgB,UAAU,EAAE,2BAA2B,CAAC;IAExD;;OAEG;IACH,SAAgB,oBAAoB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE5D;;OAEG;IACH,SAAgB,qBAAqB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAE9D;;OAEG;IACH,SAAgB,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAc;IAE1D;;;OAGG;IACH,SAAS,aAAa,MAAM,EAAE,2BAA2B;IAMzD;;;;OAIG;WACW,MAAM,CAAC,MAAM,EAAE,2BAA2B,GAAG,MAAM,CAAC,cAAc,CAAC;IAIjF;;OAEG;IACI,MAAM,CACX,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,sBAAsB,GAChC,cAAc,CAAC,WAAW,EAAE,EAAE,oBAAoB,CAAC;IAwDtD,OAAO,CAAC,yBAAyB;IAIjC,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,wBAAwB;IAMhC;;;;OAIG;IACH,SAAS,CAAC,8BAA8B,CAAC,IAAI,EAAE,WAAW,GAAG,cAAc,CAAC,MAAM,EAAE,kBAAkB,CAAC;CASxG"}
@@ -40,6 +40,8 @@ class FsItemImporter {
40
40
  */
41
41
  this.types = ['fsItem'];
42
42
  this.qualifiers = params.qualifiers;
43
+ this.fileContentConverter = params.fileContentConverter;
44
+ this.fileContentExtensions = params.fileContentExtensions;
43
45
  }
44
46
  /**
45
47
  * Creates a new {@link Import.Importers.FsItemImporter | FsItemImporter}.
@@ -50,7 +52,7 @@ class FsItemImporter {
50
52
  return (0, ts_utils_1.captureResult)(() => new FsItemImporter(params));
51
53
  }
52
54
  /**
53
- * {@inheritdoc Import.Importers.IImporter.import}
55
+ * {@inheritDoc Import.Importers.IImporter.import}
54
56
  */
55
57
  import(item, __manager) {
56
58
  const { value: fsItem, message: getTreeMessage, detail: getTreeDetail } = this._getFileTreeItemFromImportable(item);
@@ -84,23 +86,37 @@ class FsItemImporter {
84
86
  .withDetail('failed', 'processed');
85
87
  }
86
88
  else if (fsItem.item.type === 'file') {
87
- if (fsItem.item.extension === '.json') {
88
- return fsItem.item
89
- .getContents(ts_json_base_1.Converters.jsonValue)
90
- .onSuccess((json) => {
91
- const jsonItem = {
92
- type: 'json',
93
- json,
94
- context
95
- };
96
- return (0, ts_utils_1.succeed)([jsonItem]);
97
- })
98
- .withDetail('failed', 'processed');
89
+ if (!this._isSupportedFileExtension(fsItem.item.extension)) {
90
+ return (0, ts_utils_1.succeedWithDetail)([], 'skipped');
99
91
  }
92
+ return this._getJsonContents(fsItem.item)
93
+ .onSuccess((json) => {
94
+ const jsonItem = {
95
+ type: 'json',
96
+ json,
97
+ context
98
+ };
99
+ return (0, ts_utils_1.succeed)([jsonItem]);
100
+ })
101
+ .withDetail('failed', 'processed');
100
102
  }
101
103
  /* c8 ignore next 2 - defensive coding: fallback case for unsupported file types */
102
104
  return (0, ts_utils_1.succeedWithDetail)([], 'skipped');
103
105
  }
106
+ _isSupportedFileExtension(extension) {
107
+ return extension === '.json' || this._canConvertFileExtension(extension);
108
+ }
109
+ _getJsonContents(file) {
110
+ const converter = this.fileContentConverter;
111
+ if (converter !== undefined) {
112
+ return file.getRawContents().onSuccess((contents) => converter.convert(contents));
113
+ }
114
+ return file.getContents(ts_json_base_1.Converters.jsonValue);
115
+ }
116
+ _canConvertFileExtension(extension) {
117
+ var _a;
118
+ return (this.fileContentConverter !== undefined && ((_a = this.fileContentExtensions) === null || _a === void 0 ? void 0 : _a.includes(extension)) === true);
119
+ }
104
120
  /**
105
121
  * Gets an {@link Import.FsItem | FsItem} from an {@link Import.IImportable | importable}.
106
122
  * @param item - The importable to convert.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fsItemImporter.js","sourceRoot":"","sources":["../../../../src/packlets/import/importers/fsItemImporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CASuB;AACvB,oDAAsF;AAKtF,sCAAuD;AAYvD;;;GAGG;AACH,MAAa,cAAc;IAqBzB;;;OAGG;IACH,YAAsB,MAAmC;QATzD;;WAEG;QACa,UAAK,GAA0B,CAAC,QAAQ,CAAC,CAAC;QAOxD,IA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IAAI,CAAC,IAAI,iDAAiD,EAAE,SAAS,CAAC,CAAC;IAClG,CAAC;CACF;AAvID,wCAuIC","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 failWithDetail,\n MessageAggregator,\n Result,\n succeed,\n succeedWithDetail,\n Converter\n} from '@fgv/ts-utils';\nimport { Converters as JsonConverters, FileTree, JsonValue } from '@fgv/ts-json-base';\nimport { ResourceManagerBuilder } from '../../resources';\nimport { IImportable, IImportableJson, Importable } from '../importable';\nimport { IImporter, ImporterResultDetail } from './importer';\nimport { IReadOnlyQualifierCollector } from '../../qualifiers';\nimport { FsItem, FsItemResultDetail } from '../fsItem';\n\n/**\n * Parameters for creating a {@link Import.Importers.FsItemImporter | FsItemImporter}.\n * @public\n */\nexport interface IFsItemImporterCreateParams {\n qualifiers: IReadOnlyQualifierCollector;\n fileContentConverter?: Converter<JsonValue>;\n fileContentExtensions?: ReadonlyArray<string>;\n}\n\n/**\n * {@link Import.Importers.IImporter | Importer} implementation which imports resources from a `FileTree`.\n * @public\n */\nexport class FsItemImporter implements IImporter {\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use for this importer.\n */\n public readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Optional converter used to parse raw file contents before they are exposed as JSON importables.\n */\n public readonly fileContentConverter?: Converter<JsonValue>;\n\n /**\n * Optional list of file extensions which should be parsed using the file content converter.\n */\n public readonly fileContentExtensions?: ReadonlyArray<string>;\n\n /**\n * The types of {@link Import.IImportable | importables} that this importer can handle.\n */\n public readonly types: ReadonlyArray<string> = ['fsItem'];\n\n /**\n * Protected constructor for the {@link Import.Importers.FsItemImporter | FsItemImporter}.\n * @param params - Parameters for creating the {@link Import.Importers.FsItemImporter | FsItemImporter}.\n */\n protected constructor(params: IFsItemImporterCreateParams) {\n this.qualifiers = params.qualifiers;\n this.fileContentConverter = params.fileContentConverter;\n this.fileContentExtensions = params.fileContentExtensions;\n }\n\n /**\n * Creates a new {@link Import.Importers.FsItemImporter | FsItemImporter}.\n * @param params - Parameters for creating the {@link Import.Importers.FsItemImporter | FsItemImporter}.\n * @returns `Success` with the new `FsItemImporter` if successful, `Failure` with an error message if not.\n */\n public static create(params: IFsItemImporterCreateParams): Result<FsItemImporter> {\n return captureResult(() => new FsItemImporter(params));\n }\n\n /**\n * {@inheritDoc Import.Importers.IImporter.import}\n */\n public import(\n item: IImportable,\n __manager: ResourceManagerBuilder\n ): DetailedResult<IImportable[], ImporterResultDetail> {\n const {\n value: fsItem,\n message: getTreeMessage,\n detail: getTreeDetail\n } = this._getFileTreeItemFromImportable(item);\n if (getTreeMessage !== undefined) {\n return failWithDetail(getTreeMessage, getTreeDetail === 'skipped' ? 'skipped' : 'failed');\n }\n\n const { value: context, message: getContextMessage } = fsItem.getContext().onSuccess((fsItemContext) => {\n return item.context ? item.context.extend(fsItemContext) : succeed(fsItemContext);\n });\n\n /* c8 ignore next 3 - defensive coding: getContext failure is extremely rare in practice */\n if (getContextMessage) {\n return failWithDetail(getContextMessage, 'failed');\n }\n\n if (fsItem.item.type === 'directory') {\n return fsItem.item\n .getChildren()\n .onSuccess((children) => {\n const errors = new MessageAggregator();\n const items: Importable[] = [];\n for (const child of children) {\n const { value: item, message, detail } = FsItem.createForItem(child, this.qualifiers);\n if (item) {\n items.push({ type: 'fsItem', item, context });\n } else if (detail !== 'skipped') {\n errors.addMessage(message);\n }\n }\n return errors.returnOrReport(succeed(items));\n })\n .withDetail('failed', 'processed');\n } else if (fsItem.item.type === 'file') {\n if (!this._isSupportedFileExtension(fsItem.item.extension)) {\n return succeedWithDetail([], 'skipped');\n }\n\n return this._getJsonContents(fsItem.item)\n .onSuccess((json) => {\n const jsonItem: IImportableJson = {\n type: 'json',\n json,\n context\n };\n return succeed([jsonItem]);\n })\n .withDetail('failed', 'processed');\n }\n /* c8 ignore next 2 - defensive coding: fallback case for unsupported file types */\n return succeedWithDetail([], 'skipped');\n }\n\n private _isSupportedFileExtension(extension: string): boolean {\n return extension === '.json' || this._canConvertFileExtension(extension);\n }\n\n private _getJsonContents(file: FileTree.IFileTreeFileItem): Result<JsonValue> {\n const converter = this.fileContentConverter;\n if (converter !== undefined) {\n return file.getRawContents().onSuccess((contents) => converter.convert(contents));\n }\n\n return file.getContents(JsonConverters.jsonValue);\n }\n\n private _canConvertFileExtension(extension: string): boolean {\n return (\n this.fileContentConverter !== undefined && this.fileContentExtensions?.includes(extension) === true\n );\n }\n\n /**\n * Gets an {@link Import.FsItem | FsItem} from an {@link Import.IImportable | importable}.\n * @param item - The importable to convert.\n * @returns `Success` containing the `FsItem` if successful, `Failure` with an error message if not.\n */\n protected _getFileTreeItemFromImportable(item: IImportable): DetailedResult<FsItem, FsItemResultDetail> {\n if (item.type === 'fsItem') {\n if ('item' in item && item.item instanceof FsItem) {\n return succeedWithDetail(item.item, 'succeeded');\n }\n return failWithDetail(`malformed fsItem importable does not contain a valid item`, 'failed');\n }\n return failWithDetail(`${item.type}: invalid importable type for an FsItemImporter`, 'skipped');\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"importer.d.ts","sourceRoot":"","sources":["../../../../src/packlets/import/importers/importer.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEnF;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAEtC;;;;;;;OAOG;IACH,MAAM,CACJ,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,sBAAsB,GAC9B,cAAc,CAAC,WAAW,EAAE,EAAE,oBAAoB,CAAC,CAAC;CACxD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"importer.js","sourceRoot":"","sources":["../../../../src/packlets/import/importers/importer.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 { DetailedResult } from '@fgv/ts-utils';\nimport { IImportable } from '../importable';\nimport { ResourceManagerBuilder } from '../../resources';\n\n/**\n * Possible results of an import operation.\n * @public\n */\nexport type ImporterResultDetail = 'consumed' | 'processed' | 'skipped' | 'failed';\n\n/**\n * Generic interface for an importer than accepts a typed\n * {@link Import.IImportable | importable} item, extracts any resources\n * or candidates from it, and returns an optional list of\n * additional importable items derived from the original.\n * @public\n */\nexport interface IImporter {\n /**\n * The types of {@link Import.Importable | importable} items that this importer can process.\n */\n readonly types: ReadonlyArray<string>;\n\n /**\n * Imports an item, extracting any resources or candidates from it and returns an optional\n * list of additional importable items derived from it.\n * @param item - The {@link Import.IImportable | importable} item to import.\n * @param manager - The {@link Resources.ResourceManagerBuilder | resource manager builder} to use for the import.\n * @returns `Success` with a list of additional importable items derived from the original, or\n * `Failure` with an error message and a {@link Import.Importers.ImporterResultDetail | result detail}.\n */\n import(\n item: IImportable,\n manager: ResourceManagerBuilder\n ): DetailedResult<IImportable[], ImporterResultDetail>;\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../../../../src/packlets/import/importers/index.browser.ts"],"names":[],"mappings":"AAwBA,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../../../../src/packlets/import/importers/index.browser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,oEAAoE;AAEpE,6CAA2B;AAC3B,uDAAqC;AACrC,iDAA+B;AAE/B,yBAAyB;AACzB,gDAAgD;AAChD,oEAAoE","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n// Browser-safe importers - excludes Node.js filesystem dependencies\n\nexport * from './importer';\nexport * from './collectionImporter';\nexport * from './jsonImporter';\n\n// Excluded from browser:\n// - fsItemImporter (processes filesystem items)\n// - pathImporter (requires Node.js fs via FileTree.forFilesystem())\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/import/importers/index.ts"],"names":[],"mappings":"AAsBA,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/import/importers/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,6CAA2B;AAC3B,uDAAqC;AACrC,mDAAiC;AACjC,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\nexport * from './importer';\nexport * from './collectionImporter';\nexport * from './fsItemImporter';\nexport * from './jsonImporter';\nexport * from './pathImporter';\n"]}
@@ -8,7 +8,7 @@ import { IImportable } from '../importable';
8
8
  */
9
9
  export declare class JsonImporter implements IImporter {
10
10
  /**
11
- * {@inheritdoc Import.Importers.IImporter.types}
11
+ * {@inheritDoc Import.Importers.IImporter.types}
12
12
  */
13
13
  readonly types: ReadonlyArray<string>;
14
14
  /**
@@ -22,7 +22,7 @@ export declare class JsonImporter implements IImporter {
22
22
  */
23
23
  static create(): Result<JsonImporter>;
24
24
  /**
25
- * {@inheritdoc Import.Importers.IImporter.import}
25
+ * {@inheritDoc Import.Importers.IImporter.import}
26
26
  */
27
27
  import(item: IImportable, manager: ResourceManagerBuilder): DetailedResult<IImportable[], ImporterResultDetail>;
28
28
  private _tryImportResourceCollection;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonImporter.d.ts","sourceRoot":"","sources":["../../../../src/packlets/import/importers/jsonImporter.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,cAAc,EAAkB,MAAM,EAAW,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,WAAW,EAA6C,MAAM,eAAe,CAAC;AAGvF;;;GAGG;AACH,qBAAa,YAAa,YAAW,SAAS;IAC5C;;OAEG;IACH,SAAgB,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAY;IAExD;;OAEG;IACH,SAAS;IAET;;;;OAIG;WACW,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC;IAI5C;;OAEG;IACI,MAAM,CACX,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,sBAAsB,GAC9B,cAAc,CAAC,WAAW,EAAE,EAAE,oBAAoB,CAAC;IAsBtD,OAAO,CAAC,4BAA4B;IAepC,OAAO,CAAC,sBAAsB;CAqC/B"}
@@ -68,7 +68,7 @@ class JsonImporter {
68
68
  */
69
69
  constructor() {
70
70
  /**
71
- * {@inheritdoc Import.Importers.IImporter.types}
71
+ * {@inheritDoc Import.Importers.IImporter.types}
72
72
  */
73
73
  this.types = ['json'];
74
74
  }
@@ -81,7 +81,7 @@ class JsonImporter {
81
81
  return (0, ts_utils_1.captureResult)(() => new JsonImporter());
82
82
  }
83
83
  /**
84
- * {@inheritdoc Import.Importers.IImporter.import}
84
+ * {@inheritDoc Import.Importers.IImporter.import}
85
85
  */
86
86
  import(item, manager) {
87
87
  var _a, _b;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonImporter.js","sourceRoot":"","sources":["../../../../src/packlets/import/importers/jsonImporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAA+F;AAG/F,8CAAuF;AACvF,kEAAoD;AAEpD;;;GAGG;AACH,MAAa,YAAY;IAMvB;;OAEG;IACH;QARA;;WAEG;QACa,UAAK,GAA0B,CAAC,MAAM,CAAC,CAAC;IAK/B,CAAC;IAE1B;;;;OAIG;IACI,MAAM,CAAC,MAAM;QAClB,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,YAAY,EAAE,CAAC,CAAC;IACjD,CAAC;IAED;;OAEG;IACI,MAAM,CACX,IAAiB,EACjB,OAA+B;;QAE/B,qEAAqE;QACrE,IAAI,CAAC,IAAA,yBAAY,EAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAChD,uFAAuF;YACvF,MAAM,IAAI,GAAG,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,MAAM,mCAAI,SAAS,CAAC;YAC/C,OAAO,IAAA,yBAAc,EAAC,GAAG,IAAI,8BAA8B,IAAI,CAAC,IAAI,GAAG,EAAE,SAAS,CAAC,CAAC;QACtF,CAAC;QACD,OAAO,CACL,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC;aACpC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;YACnD,mEAAmE;YACnE,mEAAmE;YACnE,qEAAqE;YACrE,uEAAuE;YACvE,2DAA2D;aAC1D,SAAS,CAAC,GAAG,EAAE;QACd,yCAAyC;QACzC,OAAA,IAAA,yBAAc,EAAC,GAAG,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,MAAM,mCAAI,SAAS,6BAA6B,EAAE,QAAQ,CAAC,CAAA,EAAA,CAC5F,CACJ,CAAC;IACJ,CAAC;IAEO,4BAA4B,CAClC,IAAqB;QAErB,OAAO,YAAY,CAAC,sBAAsB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;aACzD,SAAS,CAAC,CAAC,UAAU,EAAE,EAAE;YACxB,MAAM,UAAU,GAAe;gBAC7B,IAAI,EAAE,oBAAoB;gBAC1B,UAAU;gBACV,OAAO,EAAE,IAAI,CAAC,OAAO;aACtB,CAAC;YACF,OAAO,IAAA,kBAAO,EAAC,CAAC,UAAU,CAAC,CAAC,CAAC;QAC/B,CAAC,CAAC;aACD,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACvC,CAAC;IAEO,sBAAsB,CAAC,IAAqB;QAClD,OAAO,YAAY,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;aACnD,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;YAClB,MAAM,UAAU,GAAe;gBAC7B,IAAI,EAAE,cAAc;gBACpB,IAAI;gBACJ,OAAO,EAAE,IAAI,CAAC,OAAO;aACtB,CAAC;YACF,OAAO,IAAA,kBAAO,EAAC,CAAC,UAAU,CAAC,CAAC,CAAC;QAC/B,CAAC,CAAC;aACD,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACvC,CAAC;CA0BF;AApGD,oCAoGC","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, DetailedResult, failWithDetail, Result, succeed } from '@fgv/ts-utils';\nimport { IImporter, ImporterResultDetail } from './importer';\nimport { ResourceManagerBuilder } from '../../resources';\nimport { IImportable, IImportableJson, Importable, isImportable } from '../importable';\nimport * as ResourceJson from '../../resource-json';\n\n/**\n * {@link Import.Importers.IImporter | Importer} implementation which imports resources from a JSON object.\n * @public\n */\nexport class JsonImporter implements IImporter {\n /**\n * {@inheritDoc Import.Importers.IImporter.types}\n */\n public readonly types: ReadonlyArray<string> = ['json'];\n\n /**\n * Protected {@link Import.Importers.JsonImporter | JsonImporter} constructor for derived classes.\n */\n protected constructor() {}\n\n /**\n * Creates a new {@link Import.Importers.JsonImporter | JsonImporter} instance.\n * @returns `Success` with the new {@link Import.Importers.JsonImporter | JsonImporter} if successful,\n * `Failure` otherwise.\n */\n public static create(): Result<JsonImporter> {\n return captureResult(() => new JsonImporter());\n }\n\n /**\n * {@inheritDoc Import.Importers.IImporter.import}\n */\n public import(\n item: IImportable,\n manager: ResourceManagerBuilder\n ): DetailedResult<IImportable[], ImporterResultDetail> {\n /* c8 ignore next 1 - coverage intermittently misses the next line */\n if (!isImportable(item) || item.type !== 'json') {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n const name = item.context?.baseId ?? 'unknown';\n return failWithDetail(`${name}: invalid JSON importable (${item.type})`, 'skipped');\n }\n return (\n this._tryImportResourceCollection(item)\n .onFailure(() => this._tryImportResourceTree(item))\n // experimenting with this, accepting any JSON object here makes it\n // very hard to distinguish a collection or tree with a typo from a\n // legitimate single loose resource, which yields extremely confusing\n // error messages. Disabled until/unless we come up with a better plan.\n //.onFailure(() => this._tryImportResource(item, manager));\n .onFailure(() =>\n /* c8 ignore next 1 - defense in depth */\n failWithDetail(`${item.context?.baseId ?? 'unknown'}: unrecognized JSON format.`, 'failed')\n )\n );\n }\n\n private _tryImportResourceCollection(\n item: IImportableJson\n ): DetailedResult<IImportable[], ImporterResultDetail> {\n return ResourceJson.ResourceDeclCollection.create(item.json)\n .onSuccess((collection) => {\n const importable: Importable = {\n type: 'resourceCollection',\n collection,\n context: item.context\n };\n return succeed([importable]);\n })\n .withDetail('skipped', 'consumed');\n }\n\n private _tryImportResourceTree(item: IImportableJson): DetailedResult<IImportable[], ImporterResultDetail> {\n return ResourceJson.ResourceDeclTree.create(item.json)\n .onSuccess((tree) => {\n const importable: Importable = {\n type: 'resourceTree',\n tree,\n context: item.context\n };\n return succeed([importable]);\n })\n .withDetail('skipped', 'consumed');\n }\n\n /* \n * This is disabled for now because it's too easy to accidentally import\n * a single loose resource as a collection or tree, which yields extremely\n * confusing error messages.\n\n private _tryImportResource(\n item: IImportableJson,\n manager: ResourceManagerBuilder\n ): DetailedResult<IImportable[], ImporterResultDetail> {\n return JsonConverters.jsonObject\n .convert(item.json)\n .onSuccess((json) => {\n // c8 ignore next 2 - defense in depth\n const id = item.context?.baseId ?? '';\n const conditions = item.context?.conditions;\n const candidate: ResourceJson.Json.ILooseResourceCandidateDecl = { id, conditions, json };\n return manager.addLooseCandidate(candidate);\n })\n .onSuccess(() => {\n return succeed([]);\n })\n .withDetail('failed', 'consumed');\n }\n */\n}\n"]}
@@ -49,7 +49,7 @@ export declare class PathImporter implements IImporter {
49
49
  */
50
50
  static create(params: IPathImporterCreateParams): Result<PathImporter>;
51
51
  /**
52
- * {@inheritdoc Import.Importers.IImporter.import}
52
+ * {@inheritDoc Import.Importers.IImporter.import}
53
53
  */
54
54
  import(item: IImportable, __manager: ResourceManagerBuilder): DetailedResult<IImportable[], ImporterResultDetail>;
55
55
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pathImporter.d.ts","sourceRoot":"","sources":["../../../../src/packlets/import/importers/pathImporter.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,cAAc,EAAkB,MAAM,EAAqB,MAAM,eAAe,CAAC;AACzG,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,2BAA2B,CAAC;IACxC,IAAI,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED;;;;GAIG;AACH,qBAAa,YAAa,YAAW,SAAS;IAC5C;;OAEG;IACH,SAAgB,UAAU,EAAE,2BAA2B,CAAC;IAExD;;OAEG;IACH,SAAgB,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAExC;;OAEG;IACH,SAAgB,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAY;IAExD;;;OAGG;IACH,SAAgB,eAAe,EAAE,MAAM,EAAE,CAAC;IAE1C;;;OAGG;IACH,SAAS,aAAa,MAAM,EAAE,yBAAyB;IAMvD;;;;OAIG;WACW,MAAM,CAAC,MAAM,EAAE,yBAAyB,GAAG,MAAM,CAAC,YAAY,CAAC;IAI7E;;OAEG;IACI,MAAM,CACX,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,sBAAsB,GAChC,cAAc,CAAC,WAAW,EAAE,EAAE,oBAAoB,CAAC;IAqBtD;;;;OAIG;IACH,SAAS,CAAC,8BAA8B,CAAC,IAAI,EAAE,WAAW,GAAG,cAAc,CAAC,MAAM,EAAE,kBAAkB,CAAC;CASxG"}
@@ -54,7 +54,7 @@ class PathImporter {
54
54
  return (0, ts_utils_1.captureResult)(() => new PathImporter(params));
55
55
  }
56
56
  /**
57
- * {@inheritdoc Import.Importers.IImporter.import}
57
+ * {@inheritDoc Import.Importers.IImporter.import}
58
58
  */
59
59
  import(item, __manager) {
60
60
  const { value: fsItem, message: getTreeMessage, detail: getTreeDetail } = this._getFileTreeItemFromImportable(item);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pathImporter.js","sourceRoot":"","sources":["../../../../src/packlets/import/importers/pathImporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAyG;AACzG,oDAA6C;AAK7C,sCAAuD;AAYvD;;;;GAIG;AACH,MAAa,YAAY;IAsBvB;;;OAGG;IACH,YAAsB,MAAiC;;QAfvD;;WAEG;QACa,UAAK,GAA0B,CAAC,MAAM,CAAC,CAAC;QAatD,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,MAAA,MAAM,CAAC,IAAI,mCAAI,uBAAQ,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,CAAC;QAC9D,IAAI,CAAC,eAAe,GAAG,MAAA,MAAM,CAAC,eAAe,mCAAI,EAAE,CAAC;IACtD,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,MAAM,CAAC,MAAiC;QACpD,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IACvD,CAAC;IAED;;OAEG;IACI,MAAM,CACX,IAAiB,EACjB,SAAiC;QAEjC,MAAM,EACJ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,cAAc,EACvB,M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 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, DetailedResult, failWithDetail, Result, succeedWithDetail } from '@fgv/ts-utils';\nimport { FileTree } from '@fgv/ts-json-base';\nimport { ResourceManagerBuilder } from '../../resources';\nimport { IImportable } from '../importable';\nimport { IImporter, ImporterResultDetail } from './importer';\nimport { IReadOnlyQualifierCollector } from '../../qualifiers';\nimport { FsItem, FsItemResultDetail } from '../fsItem';\n\n/**\n * Parameters for creating a {@link Import.Importers.PathImporter | PathImporter}.\n * @public\n */\nexport interface IPathImporterCreateParams {\n qualifiers: IReadOnlyQualifierCollector;\n tree?: FileTree.FileTree;\n ignoreFileTypes?: string[];\n}\n\n/**\n * {@link Import.Importers.IImporter | Importer} implementation which imports resources from a `FileTree`\n * given a path.\n * @public\n */\nexport class PathImporter implements IImporter {\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use for this importer.\n */\n public readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * The `FileTree` from which resources will be imported.\n */\n public readonly tree: FileTree.FileTree;\n\n /**\n * The types of {@link Import.IImportable | importables} that this importer can handle.\n */\n public readonly types: ReadonlyArray<string> = ['path'];\n\n /**\n * The types of files to ignore when importing. Any file not ignored is converted\n * to an {@link Import.IImportableFsItem | IImportableFsItem}.\n */\n public readonly ignoreFileTypes: string[];\n\n /**\n * Protected constructor for the {@link Import.Importers.PathImporter | PathImporter}.\n * @param params - Parameters for creating the {@link Import.Importers.PathImporter | PathImporter}.\n */\n protected constructor(params: IPathImporterCreateParams) {\n this.qualifiers = params.qualifiers;\n this.tree = params.tree ?? FileTree.forFilesystem().orThrow();\n this.ignoreFileTypes = params.ignoreFileTypes ?? [];\n }\n\n /**\n * Creates a new {@link Import.Importers.PathImporter | PathImporter}.\n * @param params - Parameters for creating the {@link Import.Importers.PathImporter | dirPathImporter}.\n * @returns `Success` with the new `PathImporter` if successful, `Failure` with an error message if not.\n */\n public static create(params: IPathImporterCreateParams): Result<PathImporter> {\n return captureResult(() => new PathImporter(params));\n }\n\n /**\n * {@inheritDoc Import.Importers.IImporter.import}\n */\n public import(\n item: IImportable,\n __manager: ResourceManagerBuilder\n ): DetailedResult<IImportable[], ImporterResultDetail> {\n const {\n value: fsItem,\n message: getTreeMessage,\n detail: getTreeDetail\n } = this._getFileTreeItemFromImportable(item);\n if (getTreeMessage !== undefined) {\n return failWithDetail(getTreeMessage, getTreeDetail === 'skipped' ? 'skipped' : 'failed');\n }\n\n if (fsItem.item.type === 'file' && this.ignoreFileTypes.includes(fsItem.item.extension)) {\n return succeedWithDetail([], 'processed');\n }\n\n // extracted characteristics are in the fsItem so add them to the context when\n // that is imported instead of now.\n const context = item.context;\n\n return succeedWithDetail([{ type: 'fsItem', item: fsItem, context }], 'processed');\n }\n\n /**\n * Gets an {@link Import.FsItem | FsItem} from an {@link Import.IImportable | importable}.\n * @param item - The importable to convert.\n * @returns `Success` containing the `FsItem` if successful, `Failure` with an error message if not.\n */\n protected _getFileTreeItemFromImportable(item: IImportable): DetailedResult<FsItem, FsItemResultDetail> {\n if (item.type === 'path') {\n if ('path' in item && typeof item.path === 'string') {\n return FsItem.createForPath(item.path, this.qualifiers, this.tree);\n }\n return failWithDetail(`malformed path importable does not contain a string path`, 'failed');\n }\n return failWithDetail(`${item.type}: invalid importable type for a PathImporter`, 'skipped');\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../../../src/packlets/import/index.browser.ts"],"names":[],"mappings":"AAwBA,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAGhC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../../../src/packlets/import/index.browser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yEAAyE;AAEzE,kDAAgC;AAChC,+CAA6B;AAC7B,kDAAgC;AAEhC,kEAAkE;AAClE,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AAEf,mCAAmC;AACnC,qEAAuD;AAC9C,8BAAS;AAElB,yBAAyB;AACzB,4FAA4F;AAC5F,qEAAqE","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n// Browser-safe import exports - excludes Node.js filesystem dependencies\n\nexport * from './importContext';\nexport * from './importable';\nexport * from './importManager';\n\n// Export FsItem class (browser-safe for in-memory FileTree usage)\nexport { FsItem } from './fsItem';\n\n// Use browser-safe importers index\nimport * as Importers from './importers/index.browser';\nexport { Importers };\n\n// Excluded from browser:\n// - FsItem.createForPath() static method (requires Node.js fs via FileTree.forFilesystem())\n// - PathImporter and FsItemImporter (via importers/index.browser.ts)\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/import/index.ts"],"names":[],"mappings":"AAsBA,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAEhC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/import/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,kDAAgC;AAChC,+CAA6B;AAC7B,2CAAyB;AACzB,kDAAgC;AAEhC,uDAAyC;AAChC,8BAAS","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 './importContext';\nexport * from './importable';\nexport * from './fsItem';\nexport * from './importManager';\n\nimport * as Importers from './importers';\nexport { Importers };\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/convert.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAc,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEjE;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,sFAEtC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,uFAKvC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,qFAKrC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,4FAK1C,CAAC;AAEL;;;;GAIG;AACH,eAAO,MA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C;AAEF;;;;;GAKG;AACH,SAAgB,mBAAmB,CACjC,MAAwB;IAExB,OAAO,qBAAU,CAAC,YAAY,CAAoC;QAChE,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,iBAAiB;QACtC,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,iBAAiB;QAC5C,aAAa,EAAE,MAAM,CAAC,QAAQ,EAAE;KACjC,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACU,QAAA,uBAAuB,GAAG,mBAAmB,CAAC,yBAAc,CAAC,UAAU,CAAC,CAAC;AAEtF;;;;GAIG;AACU,QAAA,sBAAsB,GAAG,qBAAU,CAAC,KAAK,CAAgC;IACpF,+BAAuB;IACvB,iCAAyB;CAC1B,CAAC,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/* eslint-disable @rushstack/typedef-var */\n\nimport { Converter, Converters } from '@fgv/ts-utils';\nimport * as Model from './json';\nimport * as Common from '../../common';\nimport { Converters as JsonConverters } from '@fgv/ts-json-base';\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.\n * @public\n */\nexport const languageQualifierTypeConfig = Converters.strictObject<Model.ILanguageQualifierTypeConfig>({\n allowContextList: Converters.boolean.optional()\n});\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ITerritoryQualifierTypeConfig | TerritoryQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ITerritoryQualifierTypeConfig | TerritoryQualifierTypeConfig} objects.\n * @public\n */\nexport const territoryQualifierTypeConfig = Converters.strictObject<Model.ITerritoryQualifierTypeConfig>({\n allowContextList: Converters.boolean,\n acceptLowercase: Converters.boolean.optional(),\n allowedTerritories: Converters.arrayOf(Converters.string).optional(),\n hierarchy: Converters.recordOf(Converters.string).optional()\n});\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ILiteralQualifierTypeConfig | LiteralQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ILiteralQualifierTypeConfig | LiteralQualifierTypeConfig} objects.\n * @public\n */\nexport const literalQualifierTypeConfig = Converters.strictObject<Model.ILiteralQualifierTypeConfig>({\n allowContextList: Converters.boolean.optional(),\n caseSensitive: Converters.boolean.optional(),\n enumeratedValues: Converters.arrayOf(Converters.string).optional(),\n hierarchy: Converters.recordOf(Converters.string).optional()\n});\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.\n * @public\n */\nexport const systemLanguageQualifierTypeConfig =\n Converters.strictObject<Model.ISystemLanguageQualifierTypeConfig>({\n name: Converters.string,\n systemType: Converters.literal('language'),\n configuration: languageQualifierTypeConfig.optional()\n });\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.\n * @public\n */\nexport const systemTerritoryQualifierTypeConfig =\n Converters.strictObject<Model.ISystemTerritoryQualifierTypeConfig>({\n name: Converters.string,\n systemType: Converters.literal('territory'),\n configuration: territoryQualifierTypeConfig.optional()\n });\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.\n * @public\n */\nexport const systemLiteralQualifierTypeConfig =\n Converters.strictObject<Model.ISystemLiteralQualifierTypeConfig>({\n name: Converters.string,\n systemType: Converters.literal('literal'),\n configuration: literalQualifierTypeConfig.optional()\n });\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.\n * @public\n */\nexport const systemQualifierTypeConfig = Converters.discriminatedObject<Model.ISystemQualifierTypeConfig>(\n 'systemType',\n {\n language: systemLanguageQualifierTypeConfig,\n territory: systemTerritoryQualifierTypeConfig,\n literal: systemLiteralQualifierTypeConfig\n }\n);\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.\n * @param config - A `Converter` for the configuration object.\n * @public\n */\nexport function qualifierTypeConfig<T, TD = unknown>(\n config: Converter<T, TD>\n): Converter<Model.IQualifierTypeConfig<T>, TD> {\n return Converters.strictObject<Model.IQualifierTypeConfig<T>, TD>({\n name: Common.Convert.qualifierTypeName,\n systemType: Common.Convert.qualifierTypeName,\n configuration: config.optional()\n });\n}\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.\n * @public\n */\nexport const jsonQualifierTypeConfig = qualifierTypeConfig(JsonConverters.jsonObject);\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.IAnyQualifierTypeConfig | AnyQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.IAnyQualifierTypeConfig | AnyQualifierTypeConfig} objects.\n * @public\n */\nexport const anyQualifierTypeConfig = Converters.oneOf<Model.IAnyQualifierTypeConfig>([\n jsonQualifierTypeConfig,\n systemQualifierTypeConfig\n]);\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,cAAc,QAAQ,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AAI5B,0BAAO;AAFhB,yCAAuB","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Convert from './convert';\n\nexport * from './json';\n\nexport { Convert };\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/json.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;;GAGG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,UAAU;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,yBAAyB,CAAC,CAAC,SAAS,MAAM,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEvE;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC5C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE9B;;;OAGG;IACH,SAAS,CAAC,EAAE,yBAAyB,CAAC,MAAM,CAAC,CAAC;CAC/C;AAED;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,yBAAyB,CAAC,MAAM,CAAC,CAAC;CAC/C;AAED;;;GAGG;AACH,MAAM,WAAW,kCACf,SAAQ,oBAAoB,CAAC,4BAA4B,CAAC;IAC1D,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,mCACf,SAAQ,oBAAoB,CAAC,6BAA6B,CAAC;IAC3D,UAAU,EAAE,WAAW,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,iCAAkC,SAAQ,oBAAoB,CAAC,2BAA2B,CAAC;IAC1G,UAAU,EAAE,SAAS,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAClC,kCAAkC,GAClC,mCAAmC,GACnC,iCAAiC,CAAC;AAEtC;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,GAAG,0BAA0B,CAAC;AAExF;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,uBAAuB,GAC9B,MAAM,IAAI,0BAA0B,CAItC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.js","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/json.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AA6GH,kEAMC;AAbD;;;;;;GAMG;AACH,SAAgB,2BAA2B,CACzC,MAA+B;IAE/B,OAAO,CACL,MAAM,CAAC,UAAU,KAAK,UAAU,IAAI,MAAM,CAAC,UAAU,KAAK,WAAW,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS,CACzG,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { JsonObject } from '@fgv/ts-json-base';\n\n/**\n * Templated configuration for {@link QualifierTypes.QualifierType | qualifier type} configuration.\n * @public\n */\nexport interface IQualifierTypeConfig<T = JsonObject> {\n name: string;\n systemType: string;\n configuration?: T;\n}\n\n/**\n * Configuration for {@link QualifierTypes.LanguageQualifierType | language qualifier type} configuration.\n * @public\n */\nexport interface ILanguageQualifierTypeConfig {\n allowContextList?: boolean;\n}\n\n/**\n * Declares a hierarchy of literal values. The keys are the names of the values, and the\n * values are the names of their parents.\n * @remarks\n * The hierarchy is defined as a tree, where each value can have multiple children but\n * only one parent. The root of the tree has no parent. The hierarchy is used to\n * determine the relationship between values when matching conditions and contexts.\n * @public\n */\nexport type LiteralValueHierarchyDecl<T extends string> = Record<T, T>;\n\n/**\n * Configuration for {@link QualifierTypes.TerritoryQualifierType | territory qualifier type} configuration.\n * @public\n */\nexport interface ITerritoryQualifierTypeConfig {\n allowContextList?: boolean;\n\n acceptLowercase?: boolean;\n allowedTerritories?: string[];\n\n /**\n * Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}\n * of territory values to use for matching. If not provided, no hierarchy will be used.\n */\n hierarchy?: LiteralValueHierarchyDecl<string>;\n}\n\n/**\n * Configuration for {@link QualifierTypes.LiteralQualifierType | literal qualifier type} configuration.\n * @public\n */\nexport interface ILiteralQualifierTypeConfig {\n allowContextList?: boolean;\n caseSensitive?: boolean;\n enumeratedValues?: string[];\n hierarchy?: LiteralValueHierarchyDecl<string>;\n}\n\n/**\n * Discriminated configuration for {@link QualifierTypes.LanguageQualifierType | language qualifier type} configuration.\n * @public\n */\nexport interface ISystemLanguageQualifierTypeConfig\n extends IQualifierTypeConfig<ILanguageQualifierTypeConfig> {\n systemType: 'language';\n}\n\n/**\n * Discriminated configuration for {@link QualifierTypes.TerritoryQualifierType | territory qualifier type} configuration.\n * @public\n */\nexport interface ISystemTerritoryQualifierTypeConfig\n extends IQualifierTypeConfig<ITerritoryQualifierTypeConfig> {\n systemType: 'territory';\n}\n\n/**\n * Discriminated configuration for {@link QualifierTypes.LiteralQualifierType | literal qualifier type} configuration.\n * @public\n */\nexport interface ISystemLiteralQualifierTypeConfig extends IQualifierTypeConfig<ILiteralQualifierTypeConfig> {\n systemType: 'literal';\n}\n\n/**\n * Discriminated configuration for {@link QualifierTypes.QualifierType | qualifier type} configuration.\n * @public\n */\nexport type ISystemQualifierTypeConfig =\n | ISystemLanguageQualifierTypeConfig\n | ISystemTerritoryQualifierTypeConfig\n | ISystemLiteralQualifierTypeConfig;\n\n/**\n * A union of all qualifier type configurations.\n * @public\n */\nexport type IAnyQualifierTypeConfig = IQualifierTypeConfig | ISystemQualifierTypeConfig;\n\n/**\n * Checks if a {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} is a\n * {@link QualifierTypes.Config.ISystemQualifierTypeConfig | system qualifier type configuration}.\n * @param config - The {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} to check.\n * @returns `true` if the configuration is a system qualifier type configuration, `false` otherwise.\n * @public\n */\nexport function isSystemQualifierTypeConfig(\n config: IAnyQualifierTypeConfig\n): config is ISystemQualifierTypeConfig {\n return (\n config.systemType === 'language' || config.systemType === 'territory' || config.systemType === 'literal'\n );\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/convert.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAA4B,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,kCAAkC,EAAE,MAAM,yBAAyB,CAAC;AAE7E;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C,cAAc,EAAE,8BAA8B,CAAC;CAChD;AAED;;;;;GAKG;AAEH,eAAO,MAAM,aAAa,gGAgBzB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,CAAC,SAAS,MAAM,EAChE,cAAc,EAAE,SAAS,CAAC,CAAC,CAAC,GAC3B,SAAS,CAAC,kCAAkC,CAAC,CAAC,CAAC,CAAC,CAOlD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/convert.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AA+CH,8EASC;AAtDD,4CAAoE;AAcpE;;;;;GAKG;AACH,kDAAkD;AACrC,QAAA,aAAa,GAAG,qBAAU,CAAC,OAAO,CAC7C,CACE,IAAa,EACb,MAA8D,EAC9D,OAAsC,EACf,EAAE;IACzB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAA,eAAI,EAAC,4CAA4C,CAAC,CAAC;IAC5D,CAAC;IACD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;SAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,IAAA,eAAI,EAAC,qDAAqD,CAAC,CAAC;AACrE,CAAC,CACF,CAAC;AAEF;;;;;GAKG;AACH,SAAgB,iCAAiC,CAC/C,cAA4B;IAE5B,OAAO,qBAAU,CAAC,MAAM,CAAwC;QAC9D,MAAM,EAAE,qBAAU,CAAC,OAAO,CAAC,cAAc,CAAC;QAC1C,SAAS,EAAE,qBAAU,CAAC,QAAQ,CAAC,cAAc,EAAE;YAC7C,YAAY,EAAE,cAAc;SAC7B,CAAC;KACH,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Converter, Converters, Result, fail } from '@fgv/ts-utils';\nimport { QualifierType } from './qualifierType';\nimport { ReadOnlyQualifierTypeCollector } from './qualifierTypeCollector';\nimport { ILiteralValueHierarchyCreateParams } from './literalValueHierarchy';\n\n/**\n * Context necessary to convert a qualifier name or number to an instantiated\n * {@link QualifierTypes.QualifierType}.\n * @public\n */\nexport interface IQualifierTypeConvertContext {\n qualifierTypes: ReadOnlyQualifierTypeCollector;\n}\n\n/**\n * Converter for {@link QualifierTypes.QualifierType | QualifierType} objects,\n * retrieves a {@link QualifierTypes.QualifierType | QualifierType} by name or\n * index from a supplied {@link QualifierTypes.Convert.IQualifierTypeConvertContext | conversion context}.\n * @public\n */\n// eslint-disable-next-line @rushstack/typedef-var\nexport const qualifierType = Converters.generic<QualifierType, IQualifierTypeConvertContext>(\n (\n from: unknown,\n __self: Converter<QualifierType, IQualifierTypeConvertContext>,\n context?: IQualifierTypeConvertContext\n ): Result<QualifierType> => {\n if (!context) {\n return fail('qualifierType converter requires a context');\n }\n if (typeof from === 'string') {\n return context.qualifierTypes.validating.get(from);\n } else if (typeof from === 'number') {\n return context.qualifierTypes.getAt(from);\n }\n return fail('qualifierType converter requires a string or number');\n }\n);\n\n/**\n * Gets a converter for {@link QualifierTypes.ILiteralValueHierarchyCreateParams | ILiteralValueHierarchyCreateParams}\n * objects with values validated by a supplied value converter.\n * @param valueConverter - Converter for the literal value type.\n * @public\n */\nexport function literalValueHierarchyCreateParams<T extends string>(\n valueConverter: Converter<T>\n): Converter<ILiteralValueHierarchyCreateParams<T>> {\n return Converters.object<ILiteralValueHierarchyCreateParams<T>>({\n values: Converters.arrayOf(valueConverter),\n hierarchy: Converters.recordOf(valueConverter, {\n keyConverter: valueConverter\n })\n });\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/helpers.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAQ,MAAM,EAAE,MAAM,eAAe,C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,UAAU,KAAE,aAAa,IAAG,CACzE,CAAC;QACN,KAAK,WAAW;YACd,OAAO,MAAM,CAAC,OAAO,CAAC,4BAA4B;iBAC/C,OAAO,CAAC,WAAW,CAAC;iBACpB,SAAS,CAAC,CAAC,aAAa,EAAE,EAAE,CAC3B,+CAAsB,CAAC,gBAAgB,iCAAM,UAAU,KAAE,aAAa,IAAG,CAC1E,CAAC;QACN,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC,OAAO,CAAC,0BAA0B;iBAC7C,OAAO,CAAC,WAAW,CAAC;iBACpB,SAAS,CAAC,CAAC,aAAa,EAAE,EAAE,CAC3B,2CAAoB,CAAC,gBAAgB,iCAAM,UAAU,KAAE,aAAa,IAAG,CACxE,CAAC;IACR,CAAC;IACD,yCAAyC;IACzC,OAAO,IAAA,eAAI,EAAC,2BAA2B,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,mCAAmC,CACjD,UAA6C;IAE7C,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC;IAClC,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,UAAU;YACb,OAAO,6CAAqB,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAC5D,KAAK,WAAW;YACd,OAAO,+CAAsB,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAC7D,KAAK,SAAS;YACZ,OAAO,2CAAoB,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC7D,CAAC;IACD,0CAA0C;IAC1C,mBAAmB;IACnB,OAAO,IAAA,eAAI,EAAC,GAAG,UAAU,kCAAkC,CAAC,CAAC;AAC/D,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { fail, Result } from '@fgv/ts-utils';\nimport * as Config from './config';\nimport { QualifierType } from './qualifierType';\nimport { LanguageQualifierType } from './languageQualifierType';\nimport { TerritoryQualifierType } from './territoryQualifierType';\nimport { LiteralQualifierType } from './literalQualifierType';\n\n/**\n * A discriminated union of all system qualifier types.\n * This allows TypeScript to properly discriminate between specific qualifier type implementations\n * and access their specific methods like getConfiguration().\n * @public\n */\nexport type SystemQualifierType = LanguageQualifierType | TerritoryQualifierType | LiteralQualifierType;\n\n/**\n * Creates a {@link QualifierTypes.QualifierType | QualifierType} from a configuration object.\n * This factory function determines the appropriate qualifier type based on the systemType\n * and delegates to the appropriate type-specific createFromConfig method.\n * @param typeConfig - The {@link QualifierTypes.Config.IQualifierTypeConfig | configuration object}\n * containing the name, systemType, and optional type-specific configuration.\n * @returns `Success` with the new {@link QualifierTypes.QualifierType | QualifierType}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\nexport function createQualifierTypeFromConfig(\n typeConfig: Config.IAnyQualifierTypeConfig\n): Result<QualifierType> {\n /* c8 ignore next 1 - defense in depth */\n const childConfig = typeConfig.configuration ?? {};\n switch (typeConfig.systemType) {\n case 'language':\n return Config.Convert.languageQualifierTypeConfig\n .convert(childConfig)\n .onSuccess((configuration) =>\n LanguageQualifierType.createFromConfig({ ...typeConfig, configuration })\n );\n case 'territory':\n return Config.Convert.territoryQualifierTypeConfig\n .convert(childConfig)\n .onSuccess((configuration) =>\n TerritoryQualifierType.createFromConfig({ ...typeConfig, configuration })\n );\n case 'literal':\n return Config.Convert.literalQualifierTypeConfig\n .convert(childConfig)\n .onSuccess((configuration) =>\n LiteralQualifierType.createFromConfig({ ...typeConfig, configuration })\n );\n }\n /* c8 ignore next 1 - defense in depth */\n return fail(`Unknown qualifier type: ${typeConfig.systemType}`);\n}\n\n/**\n * Creates a {@link QualifierTypes.SystemQualifierType | SystemQualifierType} from a system configuration object.\n * This factory function determines the appropriate qualifier type based on the systemType\n * and delegates to the appropriate type-specific createFromConfig method.\n * @param typeConfig - The {@link QualifierTypes.Config.ISystemQualifierTypeConfig | configuration object}\n * containing the name, systemType, and optional type-specific configuration.\n * @returns `Success` with the new {@link QualifierTypes.SystemQualifierType | SystemQualifierType}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\nexport function createQualifierTypeFromSystemConfig(\n typeConfig: Config.ISystemQualifierTypeConfig\n): Result<SystemQualifierType> {\n const { systemType } = typeConfig;\n switch (systemType) {\n case 'language':\n return LanguageQualifierType.createFromConfig(typeConfig);\n case 'territory':\n return TerritoryQualifierType.createFromConfig(typeConfig);\n case 'literal':\n return LiteralQualifierType.createFromConfig(typeConfig);\n }\n /* c8 ignore next 3 - should not happen */\n // @ts-expect-error\n return fail(`${systemType}: Unknown system qualifier type.`);\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,WAAW,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iDAAmC;AAW1B,wBAAM;AAVf,mDAAqC;AAUpB,0BAAO;AARxB,kDAAgC;AAChC,0DAAwC;AACxC,yDAAuC;AACvC,0DAAwC;AACxC,2DAAyC;AACzC,2DAAyC;AACzC,4CAA0B","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Config from './config';\nimport * as Convert from './convert';\n\nexport * from './qualifierType';\nexport * from './languageQualifierType';\nexport * from './literalQualifierType';\nexport * from './literalValueHierarchy';\nexport * from './territoryQualifierType';\nexport * from './qualifierTypeCollector';\nexport * from './helpers';\n\nexport { Config, Convert };\n"]}
@@ -27,14 +27,13 @@ export interface ILanguageQualifierTypeCreateParams extends Partial<IQualifierTy
27
27
  */
28
28
  export declare class LanguageQualifierType extends QualifierType<JsonCompatibleType<Config.ILanguageQualifierTypeConfig>> {
29
29
  /**
30
- * {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
30
+ * {@inheritDoc QualifierTypes.IQualifierType.systemTypeName}
31
31
  */
32
32
  readonly systemTypeName: QualifierTypeName;
33
33
  /**
34
34
  * Creates a new instance of a {@link QualifierTypes.LanguageQualifierType | language qualifier type}.
35
- * @param name - Optional name for the qualifier type. Defaults to 'language'.
36
- * @param allowContextList - Optional flag indicating whether the context can be a
37
- * list of values. Defaults to `true`.
35
+ * @param params - The {@link QualifierTypes.ILanguageQualifierTypeCreateParams | create parameters}
36
+ * for this qualifier type.
38
37
  * @public
39
38
  */
40
39
  protected constructor({ name, allowContextList, index }: ILanguageQualifierTypeCreateParams);
@@ -56,7 +55,7 @@ export declare class LanguageQualifierType extends QualifierType<JsonCompatibleT
56
55
  */
57
56
  static createFromConfig(config: Config.IQualifierTypeConfig<Config.ILanguageQualifierTypeConfig>): Result<LanguageQualifierType>;
58
57
  /**
59
- * {@inheritdoc QualifierTypes.IQualifierType.isValidConditionValue}
58
+ * {@inheritDoc QualifierTypes.IQualifierType.isValidConditionValue}
60
59
  */
61
60
  isValidConditionValue(value: string): value is QualifierConditionValue;
62
61
  /**
@@ -66,11 +65,11 @@ export declare class LanguageQualifierType extends QualifierType<JsonCompatibleT
66
65
  */
67
66
  getConfiguration(): Result<Config.ISystemLanguageQualifierTypeConfig>;
68
67
  /**
69
- * {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
68
+ * {@inheritDoc QualifierTypes.IQualifierType.getConfigurationJson}
70
69
  */
71
70
  getConfigurationJson(): Result<JsonCompatibleType<Config.ISystemLanguageQualifierTypeConfig>>;
72
71
  /**
73
- * {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
72
+ * {@inheritDoc QualifierTypes.IQualifierType.validateConfigurationJson}
74
73
  */
75
74
  validateConfigurationJson(from: unknown): Result<JsonCompatibleType<Config.ISystemLanguageQualifierTypeConfig>>;
76
75
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"languageQualifierType.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/languageQualifierType.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAA0B,MAAM,eAAe,CAAC;AAE/D,OAAO,EACL,iBAAiB,EAGjB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EAElB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAsB,MAAM,mBAAmB,CAAC;AAE3E;;;;GAIG;AACH,MAAM,WAAW,kCAAmC,SAAQ,OAAO,CAAC,0BAA0B,CAAC;IAC7F;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;GAKG;AACH,qBAAa,qBAAsB,SAAQ,aAAa,CACtD,kBAAkB,CAAC,MAAM,CAAC,4BAA4B,CAAC,CACxD;IACC;;OAEG;IACH,SAAgB,cAAc,EAAE,iBAAiB,CAA2D;IAE5G;;;;;OAKG;IACH,SAAS,aAAa,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,EAAE,kCAAkC;IAa3F;;;;;;OAMG;WACW,MAAM,CAAC,MAAM,CAAC,EAAE,kCAAkC,GAAG,MAAM,CAAC,qBAAqB,CAAC;IAMhG;;;;;;;OAOG;WACW,gBAAgB,CAC5B,MAAM,EAAE,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,4BAA4B,CAAC,GACvE,MAAM,CAAC,qBAAqB,CAAC;IAOhC;;OAEG;IACI,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,uBAAuB;IAM7E;;;;OAIG;IACI,gBAAgB,IAAI,MAAM,CAAC,MAAM,CAAC,kCAAkC,CAAC;IAM5E;;OAEG;IACI,oBAAoB,IAAI,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,kCAAkC,CAAC,CAAC;IAUpG;;OAEG;IACI,yBAAyB,CAC9B,IAAI,EAAE,OAAO,GACZ,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,kCAAkC,CAAC,CAAC;IAIxE;;;;;OAKG;IACI,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,kCAAkC,CAAC;IAI9F;;;;;;;OAOG;IACH,SAAS,CAAC,SAAS,CACjB,SAAS,EAAE,uBAAuB,EAClC,OAAO,EAAE,qBAAqB,EAC9B,QAAQ,EAAE,iBAAiB,GAC1B,mBAAmB;CASvB"}
@@ -70,9 +70,8 @@ const ts_json_base_1 = require("@fgv/ts-json-base");
70
70
  class LanguageQualifierType extends qualifierType_1.QualifierType {
71
71
  /**
72
72
  * Creates a new instance of a {@link QualifierTypes.LanguageQualifierType | language qualifier type}.
73
- * @param name - Optional name for the qualifier type. Defaults to 'language'.
74
- * @param allowContextList - Optional flag indicating whether the context can be a
75
- * list of values. Defaults to `true`.
73
+ * @param params - The {@link QualifierTypes.ILanguageQualifierTypeCreateParams | create parameters}
74
+ * for this qualifier type.
76
75
  * @public
77
76
  */
78
77
  constructor({ name, allowContextList, index }) {
@@ -83,7 +82,7 @@ class LanguageQualifierType extends qualifierType_1.QualifierType {
83
82
  super(Object.assign({ name,
84
83
  allowContextList }, validated));
85
84
  /**
86
- * {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
85
+ * {@inheritDoc QualifierTypes.IQualifierType.systemTypeName}
87
86
  */
88
87
  this.systemTypeName = common_1.Convert.qualifierTypeName.convert('language').orThrow();
89
88
  }
@@ -115,7 +114,7 @@ class LanguageQualifierType extends qualifierType_1.QualifierType {
115
114
  }).onSuccess(LanguageQualifierType.create);
116
115
  }
117
116
  /**
118
- * {@inheritdoc QualifierTypes.IQualifierType.isValidConditionValue}
117
+ * {@inheritDoc QualifierTypes.IQualifierType.isValidConditionValue}
119
118
  */
120
119
  isValidConditionValue(value) {
121
120
  return ts_bcp47_1.Bcp47.tag(value)
@@ -131,7 +130,7 @@ class LanguageQualifierType extends qualifierType_1.QualifierType {
131
130
  return this.getConfigurationJson().onSuccess((json) => Config.Convert.systemLanguageQualifierTypeConfig.convert(json));
132
131
  }
133
132
  /**
134
- * {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
133
+ * {@inheritDoc QualifierTypes.IQualifierType.getConfigurationJson}
135
134
  */
136
135
  getConfigurationJson() {
137
136
  return (0, ts_utils_1.succeed)({
@@ -143,7 +142,7 @@ class LanguageQualifierType extends qualifierType_1.QualifierType {
143
142
  });
144
143
  }
145
144
  /**
146
- * {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
145
+ * {@inheritDoc QualifierTypes.IQualifierType.validateConfigurationJson}
147
146
  */
148
147
  validateConfigurationJson(from) {
149
148
  return Config.Convert.systemLanguageQualifierTypeConfig.convert(from);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"languageQualifierType.js","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/languageQualifierType.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAA+D;AAC/D,4CAAsC;AACtC,sCASmB;AACnB,mDAA4E;AAC5E,iDAAmC;AACnC,oDAA2E;AAoB3E;;;;;GAKG;AACH,MAAa,qBAAsB,SAAQ,6BAE1C;IAMC;;;;;O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ortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result, captureResult, succeed } from '@fgv/ts-utils';\nimport { Bcp47 } from '@fgv/ts-bcp47';\nimport {\n ConditionOperator,\n Convert,\n NoMatch,\n QualifierConditionValue,\n QualifierContextValue,\n QualifierMatchScore,\n QualifierTypeName,\n Validate\n} from '../common';\nimport { IQualifierTypeCreateParams, QualifierType } from './qualifierType';\nimport * as Config from './config';\nimport { JsonCompatibleType, sanitizeJsonObject } from '@fgv/ts-json-base';\n\n/**\n * Interface defining the parameters that can be used to create a new\n * {@link QualifierTypes.LanguageQualifierType | LanguageQualifierType}.\n * @public\n */\nexport interface ILanguageQualifierTypeCreateParams extends Partial<IQualifierTypeCreateParams> {\n /**\n * Optional name for the qualifier type. Defaults to 'language'.\n */\n name?: string;\n\n /**\n * Optional flag indicating whether the context can be a list of values.\n * Defaults to `true`.\n */\n allowContextList?: boolean;\n}\n\n/**\n * {@link QualifierTypes.QualifierType | Qualifier type} which matches BCP-47 language tags\n * applying {@link https://github.com/ErikFortune/fgv/tree/main/libraries/ts-bcp47#tag-matching | similarity matching}.\n * Accepts a list of language tags in the context by default.\n * @public\n */\nexport class LanguageQualifierType extends QualifierType<\n JsonCompatibleType<Config.ILanguageQualifierTypeConfig>\n> {\n /**\n * {@inheritDoc QualifierTypes.IQualifierType.systemTypeName}\n */\n public readonly systemTypeName: QualifierTypeName = Convert.qualifierTypeName.convert('language').orThrow();\n\n /**\n * Creates a new instance of a {@link QualifierTypes.LanguageQualifierType | language qualifier type}.\n * @param params - The {@link QualifierTypes.ILanguageQualifierTypeCreateParams | create parameters}\n * for this qualifier type.\n * @public\n */\n protected constructor({ name, allowContextList, index }: ILanguageQualifierTypeCreateParams) {\n allowContextList = allowContextList !== false;\n /* c8 ignore next 2 - coverage intermittently drops these two lines even though they're tested */\n name = name ?? 'language';\n const validated = index ? { index: Convert.qualifierTypeIndex.convert(index).orThrow() } : {};\n\n super({\n name,\n allowContextList,\n ...validated\n });\n }\n\n /**\n * Creates a new instance of a {@link QualifierTypes.LanguageQualifierType | language qualifier type}.\n * @param params - Optional {@link QualifierTypes.ILanguageQualifierTypeCreateParams | parameters}\n * to use when creating the new instance.\n * @returns `Success` with the new {@link QualifierTypes.LanguageQualifierType | language qualifier type}\n * if successful, `Failure` otherwise.\n */\n public static create(params?: ILanguageQualifierTypeCreateParams): Result<LanguageQualifierType> {\n /* c8 ignore next 1 - coverage seems to intermittently miss the branch even though it's tested */\n params = params ?? {};\n return captureResult(() => new LanguageQualifierType(params));\n }\n\n /**\n * Creates a new {@link QualifierTypes.LanguageQualifierType | LanguageQualifierType} from a configuration object.\n * @param config - The {@link QualifierTypes.Config.IQualifierTypeConfig | configuration object} containing\n * the name, systemType, and optional language-specific configuration.\n * @returns `Success` with the new {@link QualifierTypes.LanguageQualifierType | LanguageQualifierType}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\n public static createFromConfig(\n config: Config.IQualifierTypeConfig<Config.ILanguageQualifierTypeConfig>\n ): Result<LanguageQualifierType> {\n return sanitizeJsonObject<ILanguageQualifierTypeCreateParams>({\n name: config.name,\n allowContextList: config.configuration?.allowContextList === true\n }).onSuccess(LanguageQualifierType.create);\n }\n\n /**\n * {@inheritDoc QualifierTypes.IQualifierType.isValidConditionValue}\n */\n public isValidConditionValue(value: string): value is QualifierConditionValue {\n return Bcp47.tag(value)\n .onSuccess((tag) => succeed(tag.isValid))\n .orDefault(false);\n }\n\n /**\n * Gets a {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | strongly typed configuration object}\n * for this qualifier type.\n * @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.\n */\n public getConfiguration(): Result<Config.ISystemLanguageQualifierTypeConfig> {\n return this.getConfigurationJson().onSuccess((json) =>\n Config.Convert.systemLanguageQualifierTypeConfig.convert(json)\n );\n }\n\n /**\n * {@inheritDoc QualifierTypes.IQualifierType.getConfigurationJson}\n */\n public getConfigurationJson(): Result<JsonCompatibleType<Config.ISystemLanguageQualifierTypeConfig>> {\n return succeed({\n name: this.name,\n systemType: 'language' as const,\n configuration: {\n allowContextList: this.allowContextList\n }\n });\n }\n\n /**\n * {@inheritDoc QualifierTypes.IQualifierType.validateConfigurationJson}\n */\n public validateConfigurationJson(\n from: unknown\n ): Result<JsonCompatibleType<Config.ISystemLanguageQualifierTypeConfig>> {\n return Config.Convert.systemLanguageQualifierTypeConfig.convert(from);\n }\n\n /**\n * Validates a {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | strongly typed configuration object}\n * for this qualifier type.\n * @param from - The unknown data to validate as a configuration object.\n * @returns `Success` with the validated configuration if successful, `Failure` with an error message otherwise.\n */\n public validateConfiguration(from: unknown): Result<Config.ISystemLanguageQualifierTypeConfig> {\n return Config.Convert.systemLanguageQualifierTypeConfig.convert(from);\n }\n\n /**\n * Matches a single language condition against a single language context value using\n * {@link https://github.com/ErikFortune/fgv/tree/main/libraries/ts-bcp47#tag-matching | similarity matching}.\n * @param condition - The language condition value to match.\n * @param context - The language context value to match against.\n * @param operator - The operator to use for the match. Must be 'matches'.\n * @returns The match score, or `noMatch` if the match fails.\n */\n protected _matchOne(\n condition: QualifierConditionValue,\n context: QualifierContextValue,\n operator: ConditionOperator\n ): QualifierMatchScore {\n if (operator === 'matches') {\n const similarity = Bcp47.similarity(condition, context).orDefault(Bcp47.tagSimilarity.none);\n if (similarity > 0.0 && Validate.isValidQualifierMatchScore(similarity)) {\n return similarity;\n }\n }\n return NoMatch;\n }\n}\n"]}