@fgv/ts-res 4.5.0-2 → 5.0.0-0

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 (405) hide show
  1. package/CHANGELOG.json +26 -0
  2. package/CHANGELOG.md +14 -0
  3. package/CLAUDE.md +186 -0
  4. package/EXAMPLE_INIT_PARAMS.md +88 -0
  5. package/PROGRESS_SUMMARY.md +48 -0
  6. package/README.md +535 -14
  7. package/dist/ts-res.d.ts +4225 -324
  8. package/dist/tsdoc-metadata.json +1 -1
  9. package/lib/index.d.ts +4 -1
  10. package/lib/index.d.ts.map +1 -1
  11. package/lib/index.js +7 -1
  12. package/lib/index.js.map +1 -1
  13. package/lib/packlets/common/conditions.d.ts +30 -0
  14. package/lib/packlets/common/conditions.d.ts.map +1 -1
  15. package/lib/packlets/common/conditions.js.map +1 -1
  16. package/lib/packlets/common/convert.d.ts +22 -2
  17. package/lib/packlets/common/convert.d.ts.map +1 -1
  18. package/lib/packlets/common/convert.js +21 -1
  19. package/lib/packlets/common/convert.js.map +1 -1
  20. package/lib/packlets/common/helpers/context.d.ts +39 -0
  21. package/lib/packlets/common/helpers/context.d.ts.map +1 -0
  22. package/lib/packlets/common/helpers/context.js +108 -0
  23. package/lib/packlets/common/helpers/context.js.map +1 -0
  24. package/lib/packlets/common/helpers/index.d.ts +2 -0
  25. package/lib/packlets/common/helpers/index.d.ts.map +1 -1
  26. package/lib/packlets/common/helpers/index.js +2 -0
  27. package/lib/packlets/common/helpers/index.js.map +1 -1
  28. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts +39 -0
  29. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +1 -0
  30. package/lib/packlets/common/helpers/qualifierDefaultValues.js +105 -0
  31. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  32. package/lib/packlets/common/helpers/resources.d.ts.map +1 -1
  33. package/lib/packlets/common/helpers/resources.js +6 -2
  34. package/lib/packlets/common/helpers/resources.js.map +1 -1
  35. package/lib/packlets/common/validate/conditions.d.ts +69 -1
  36. package/lib/packlets/common/validate/conditions.d.ts.map +1 -1
  37. package/lib/packlets/common/validate/conditions.js +126 -0
  38. package/lib/packlets/common/validate/conditions.js.map +1 -1
  39. package/lib/packlets/common/validate/regularExpressions.d.ts +20 -0
  40. package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -1
  41. package/lib/packlets/common/validate/regularExpressions.js +21 -1
  42. package/lib/packlets/common/validate/regularExpressions.js.map +1 -1
  43. package/lib/packlets/conditions/condition.d.ts +37 -0
  44. package/lib/packlets/conditions/condition.d.ts.map +1 -1
  45. package/lib/packlets/conditions/condition.js +67 -1
  46. package/lib/packlets/conditions/condition.js.map +1 -1
  47. package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -1
  48. package/lib/packlets/conditions/conditionCollector.js +1 -0
  49. package/lib/packlets/conditions/conditionCollector.js.map +1 -1
  50. package/lib/packlets/conditions/conditionSet.d.ts +34 -3
  51. package/lib/packlets/conditions/conditionSet.d.ts.map +1 -1
  52. package/lib/packlets/conditions/conditionSet.js +31 -3
  53. package/lib/packlets/conditions/conditionSet.js.map +1 -1
  54. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -1
  55. package/lib/packlets/conditions/conditionSetCollector.js +3 -0
  56. package/lib/packlets/conditions/conditionSetCollector.js.map +1 -1
  57. package/lib/packlets/conditions/conditionToken.d.ts.map +1 -1
  58. package/lib/packlets/conditions/conditionToken.js +2 -1
  59. package/lib/packlets/conditions/conditionToken.js.map +1 -1
  60. package/lib/packlets/conditions/convert/decls.js +1 -1
  61. package/lib/packlets/conditions/convert/decls.js.map +1 -1
  62. package/lib/packlets/config/common.d.ts +35 -0
  63. package/lib/packlets/config/common.d.ts.map +1 -0
  64. package/lib/packlets/config/common.js +96 -0
  65. package/lib/packlets/config/common.js.map +1 -0
  66. package/lib/packlets/config/convert.d.ts +14 -0
  67. package/lib/packlets/config/convert.d.ts.map +1 -0
  68. package/lib/packlets/config/convert.js +82 -0
  69. package/lib/packlets/config/convert.js.map +1 -0
  70. package/lib/packlets/config/index.d.ts +6 -0
  71. package/lib/packlets/config/index.d.ts.map +1 -0
  72. package/lib/packlets/config/index.js +67 -0
  73. package/lib/packlets/config/index.js.map +1 -0
  74. package/lib/packlets/config/json.d.ts +20 -0
  75. package/lib/packlets/config/json.d.ts.map +1 -0
  76. package/lib/packlets/config/json.js +24 -0
  77. package/lib/packlets/config/json.js.map +1 -0
  78. package/lib/packlets/config/predefined/default.d.ts +57 -0
  79. package/lib/packlets/config/predefined/default.d.ts.map +1 -0
  80. package/lib/packlets/config/predefined/default.js +141 -0
  81. package/lib/packlets/config/predefined/default.js.map +1 -0
  82. package/lib/packlets/config/predefined/extended.d.ts +25 -0
  83. package/lib/packlets/config/predefined/extended.d.ts.map +1 -0
  84. package/lib/packlets/config/predefined/extended.js +193 -0
  85. package/lib/packlets/config/predefined/extended.js.map +1 -0
  86. package/lib/packlets/config/predefined/index.d.ts +4 -0
  87. package/lib/packlets/config/predefined/index.d.ts.map +1 -0
  88. package/lib/packlets/config/predefined/index.js +62 -0
  89. package/lib/packlets/config/predefined/index.js.map +1 -0
  90. package/lib/packlets/config/systemConfiguration.d.ts +81 -0
  91. package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
  92. package/lib/packlets/config/systemConfiguration.js +172 -0
  93. package/lib/packlets/config/systemConfiguration.js.map +1 -0
  94. package/lib/packlets/context/contextDecls.d.ts +49 -0
  95. package/lib/packlets/context/contextDecls.d.ts.map +1 -0
  96. package/lib/packlets/context/contextDecls.js +24 -0
  97. package/lib/packlets/context/contextDecls.js.map +1 -0
  98. package/lib/packlets/context/contextToken.d.ts +111 -0
  99. package/lib/packlets/context/contextToken.d.ts.map +1 -0
  100. package/lib/packlets/context/contextToken.js +206 -0
  101. package/lib/packlets/context/contextToken.js.map +1 -0
  102. package/lib/packlets/context/convert/decls.d.ts +37 -0
  103. package/lib/packlets/context/convert/decls.d.ts.map +1 -0
  104. package/lib/packlets/context/convert/decls.js +94 -0
  105. package/lib/packlets/context/convert/decls.js.map +1 -0
  106. package/lib/packlets/context/convert/index.d.ts +2 -0
  107. package/lib/packlets/context/convert/index.d.ts.map +1 -0
  108. package/lib/packlets/context/convert/index.js +39 -0
  109. package/lib/packlets/context/convert/index.js.map +1 -0
  110. package/lib/packlets/context/index.d.ts +5 -0
  111. package/lib/packlets/context/index.d.ts.map +1 -0
  112. package/lib/packlets/context/index.js +65 -0
  113. package/lib/packlets/context/index.js.map +1 -0
  114. package/lib/packlets/decisions/abstractDecision.d.ts +8 -0
  115. package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -1
  116. package/lib/packlets/decisions/abstractDecision.js +9 -0
  117. package/lib/packlets/decisions/abstractDecision.js.map +1 -1
  118. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -1
  119. package/lib/packlets/decisions/abstractDecisionCollector.js +2 -0
  120. package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -1
  121. package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -1
  122. package/lib/packlets/decisions/concreteDecision.js +3 -2
  123. package/lib/packlets/decisions/concreteDecision.js.map +1 -1
  124. package/lib/packlets/decisions/decision.d.ts.map +1 -1
  125. package/lib/packlets/decisions/decision.js +4 -0
  126. package/lib/packlets/decisions/decision.js.map +1 -1
  127. package/lib/packlets/import/fsItem.d.ts.map +1 -1
  128. package/lib/packlets/import/fsItem.js +1 -0
  129. package/lib/packlets/import/fsItem.js.map +1 -1
  130. package/lib/packlets/import/importContext.d.ts +19 -0
  131. package/lib/packlets/import/importContext.d.ts.map +1 -1
  132. package/lib/packlets/import/importContext.js +39 -0
  133. package/lib/packlets/import/importContext.js.map +1 -1
  134. package/lib/packlets/import/importManager.d.ts +5 -5
  135. package/lib/packlets/import/importManager.d.ts.map +1 -1
  136. package/lib/packlets/import/importManager.js.map +1 -1
  137. package/lib/packlets/import/importers/collectionImporter.d.ts +11 -13
  138. package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -1
  139. package/lib/packlets/import/importers/collectionImporter.js +29 -20
  140. package/lib/packlets/import/importers/collectionImporter.js.map +1 -1
  141. package/lib/packlets/import/importers/fsItemImporter.d.ts +2 -2
  142. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -1
  143. package/lib/packlets/import/importers/fsItemImporter.js +2 -2
  144. package/lib/packlets/import/importers/fsItemImporter.js.map +1 -1
  145. package/lib/packlets/import/importers/importer.d.ts +3 -3
  146. package/lib/packlets/import/importers/importer.d.ts.map +1 -1
  147. package/lib/packlets/import/importers/importer.js.map +1 -1
  148. package/lib/packlets/import/importers/jsonImporter.d.ts +2 -3
  149. package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -1
  150. package/lib/packlets/import/importers/jsonImporter.js +10 -20
  151. package/lib/packlets/import/importers/jsonImporter.js.map +1 -1
  152. package/lib/packlets/import/importers/pathImporter.d.ts +2 -2
  153. package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -1
  154. package/lib/packlets/import/importers/pathImporter.js.map +1 -1
  155. package/lib/packlets/qualifier-types/config/convert.d.ts +44 -0
  156. package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
  157. package/lib/packlets/qualifier-types/config/convert.js +96 -0
  158. package/lib/packlets/qualifier-types/config/convert.js.map +1 -0
  159. package/lib/packlets/qualifier-types/config/index.d.ts +4 -0
  160. package/lib/packlets/qualifier-types/config/index.d.ts.map +1 -0
  161. package/lib/packlets/qualifier-types/config/index.js +64 -0
  162. package/lib/packlets/qualifier-types/config/index.js.map +1 -0
  163. package/lib/packlets/qualifier-types/config/json.d.ts +69 -0
  164. package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
  165. package/lib/packlets/qualifier-types/config/json.js +24 -0
  166. package/lib/packlets/qualifier-types/config/json.js.map +1 -0
  167. package/lib/packlets/qualifier-types/convert.d.ts +10 -2
  168. package/lib/packlets/qualifier-types/convert.d.ts.map +1 -1
  169. package/lib/packlets/qualifier-types/convert.js +15 -0
  170. package/lib/packlets/qualifier-types/convert.js.map +1 -1
  171. package/lib/packlets/qualifier-types/helpers.d.ts +27 -0
  172. package/lib/packlets/qualifier-types/helpers.d.ts.map +1 -0
  173. package/lib/packlets/qualifier-types/helpers.js +118 -0
  174. package/lib/packlets/qualifier-types/helpers.js.map +1 -0
  175. package/lib/packlets/qualifier-types/index.d.ts +4 -1
  176. package/lib/packlets/qualifier-types/index.d.ts.map +1 -1
  177. package/lib/packlets/qualifier-types/index.js +5 -1
  178. package/lib/packlets/qualifier-types/index.js.map +1 -1
  179. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +19 -8
  180. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -1
  181. package/lib/packlets/qualifier-types/languageQualifierType.js +28 -9
  182. package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -1
  183. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +38 -13
  184. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -1
  185. package/lib/packlets/qualifier-types/literalQualifierType.js +44 -10
  186. package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -1
  187. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts +107 -0
  188. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
  189. package/lib/packlets/qualifier-types/literalValueHierarchy.js +215 -0
  190. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  191. package/lib/packlets/qualifier-types/qualifierType.d.ts +22 -18
  192. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -1
  193. package/lib/packlets/qualifier-types/qualifierType.js +9 -4
  194. package/lib/packlets/qualifier-types/qualifierType.js.map +1 -1
  195. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts +4 -2
  196. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -1
  197. package/lib/packlets/qualifier-types/qualifierTypeCollector.js +2 -1
  198. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -1
  199. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +47 -11
  200. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -1
  201. package/lib/packlets/qualifier-types/territoryQualifierType.js +61 -17
  202. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -1
  203. package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -1
  204. package/lib/packlets/qualifiers/convert/decls.js +17 -15
  205. package/lib/packlets/qualifiers/convert/decls.js.map +1 -1
  206. package/lib/packlets/qualifiers/index.d.ts +2 -0
  207. package/lib/packlets/qualifiers/index.d.ts.map +1 -1
  208. package/lib/packlets/qualifiers/index.js +2 -0
  209. package/lib/packlets/qualifiers/index.js.map +1 -1
  210. package/lib/packlets/qualifiers/qualifier.d.ts +22 -2
  211. package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -1
  212. package/lib/packlets/qualifiers/qualifier.js +26 -1
  213. package/lib/packlets/qualifiers/qualifier.js.map +1 -1
  214. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -1
  215. package/lib/packlets/qualifiers/qualifierCollector.js +4 -0
  216. package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -1
  217. package/lib/packlets/qualifiers/qualifierDecl.d.ts +6 -1
  218. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -1
  219. package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -1
  220. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts +32 -0
  221. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +1 -0
  222. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js +24 -0
  223. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  224. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts +96 -0
  225. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +1 -0
  226. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js +179 -0
  227. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  228. package/lib/packlets/resource-json/compiled/common.d.ts +14 -0
  229. package/lib/packlets/resource-json/compiled/common.d.ts.map +1 -0
  230. package/lib/packlets/resource-json/compiled/common.js +24 -0
  231. package/lib/packlets/resource-json/compiled/common.js.map +1 -0
  232. package/lib/packlets/resource-json/compiled/convert.d.ts +63 -0
  233. package/lib/packlets/resource-json/compiled/convert.d.ts.map +1 -0
  234. package/lib/packlets/resource-json/compiled/convert.js +167 -0
  235. package/lib/packlets/resource-json/compiled/convert.js.map +1 -0
  236. package/lib/packlets/resource-json/compiled/index.d.ts +5 -0
  237. package/lib/packlets/resource-json/compiled/index.d.ts.map +1 -0
  238. package/lib/packlets/resource-json/compiled/index.js +65 -0
  239. package/lib/packlets/resource-json/compiled/index.js.map +1 -0
  240. package/lib/packlets/resource-json/compiled/json.d.ts +204 -0
  241. package/lib/packlets/resource-json/compiled/json.d.ts.map +1 -0
  242. package/lib/packlets/resource-json/compiled/json.js +3 -0
  243. package/lib/packlets/resource-json/compiled/json.js.map +1 -0
  244. package/lib/packlets/resource-json/convert.d.ts +16 -0
  245. package/lib/packlets/resource-json/convert.d.ts.map +1 -1
  246. package/lib/packlets/resource-json/convert.js +41 -6
  247. package/lib/packlets/resource-json/convert.js.map +1 -1
  248. package/lib/packlets/resource-json/helpers.d.ts +82 -3
  249. package/lib/packlets/resource-json/helpers.d.ts.map +1 -1
  250. package/lib/packlets/resource-json/helpers.js +185 -2
  251. package/lib/packlets/resource-json/helpers.js.map +1 -1
  252. package/lib/packlets/resource-json/index.d.ts +2 -1
  253. package/lib/packlets/resource-json/index.d.ts.map +1 -1
  254. package/lib/packlets/resource-json/index.js +3 -1
  255. package/lib/packlets/resource-json/index.js.map +1 -1
  256. package/lib/packlets/resource-json/json.d.ts +55 -3
  257. package/lib/packlets/resource-json/json.d.ts.map +1 -1
  258. package/lib/packlets/resource-json/json.js +16 -0
  259. package/lib/packlets/resource-json/json.js.map +1 -1
  260. package/lib/packlets/resource-json/normalized.d.ts +46 -3
  261. package/lib/packlets/resource-json/normalized.d.ts.map +1 -1
  262. package/lib/packlets/resource-json/normalized.js.map +1 -1
  263. package/lib/packlets/resource-json/resourceDeclCollection.d.ts +14 -10
  264. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -1
  265. package/lib/packlets/resource-json/resourceDeclCollection.js +18 -14
  266. package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -1
  267. package/lib/packlets/resource-json/resourceDeclContainer.d.ts +15 -2
  268. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -1
  269. package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -1
  270. package/lib/packlets/resource-json/resourceDeclTree.d.ts +6 -2
  271. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -1
  272. package/lib/packlets/resource-json/resourceDeclTree.js +12 -3
  273. package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -1
  274. package/lib/packlets/resource-types/config/convert.d.ts +8 -0
  275. package/lib/packlets/resource-types/config/convert.d.ts.map +1 -0
  276. package/lib/packlets/resource-types/config/convert.js +36 -0
  277. package/lib/packlets/resource-types/config/convert.js.map +1 -0
  278. package/lib/packlets/resource-types/config/index.d.ts +4 -0
  279. package/lib/packlets/resource-types/config/index.d.ts.map +1 -0
  280. package/lib/packlets/resource-types/config/index.js +64 -0
  281. package/lib/packlets/resource-types/config/index.js.map +1 -0
  282. package/lib/packlets/resource-types/config/json.d.ts +9 -0
  283. package/lib/packlets/resource-types/config/json.d.ts.map +1 -0
  284. package/lib/packlets/resource-types/config/json.js +24 -0
  285. package/lib/packlets/resource-types/config/json.js.map +1 -0
  286. package/lib/packlets/resource-types/helpers.d.ts +13 -0
  287. package/lib/packlets/resource-types/helpers.d.ts.map +1 -0
  288. package/lib/packlets/resource-types/helpers.js +44 -0
  289. package/lib/packlets/resource-types/helpers.js.map +1 -0
  290. package/lib/packlets/resource-types/index.d.ts +3 -0
  291. package/lib/packlets/resource-types/index.d.ts.map +1 -1
  292. package/lib/packlets/resource-types/index.js +26 -0
  293. package/lib/packlets/resource-types/index.js.map +1 -1
  294. package/lib/packlets/resource-types/jsonResourceType.d.ts +5 -13
  295. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -1
  296. package/lib/packlets/resource-types/jsonResourceType.js +5 -2
  297. package/lib/packlets/resource-types/jsonResourceType.js.map +1 -1
  298. package/lib/packlets/resource-types/resourceType.d.ts +33 -32
  299. package/lib/packlets/resource-types/resourceType.d.ts.map +1 -1
  300. package/lib/packlets/resource-types/resourceType.js.map +1 -1
  301. package/lib/packlets/resources/candidateReducer.d.ts +98 -0
  302. package/lib/packlets/resources/candidateReducer.d.ts.map +1 -0
  303. package/lib/packlets/resources/candidateReducer.js +247 -0
  304. package/lib/packlets/resources/candidateReducer.js.map +1 -0
  305. package/lib/packlets/resources/common.d.ts +60 -0
  306. package/lib/packlets/resources/common.d.ts.map +1 -0
  307. package/lib/packlets/resources/common.js +24 -0
  308. package/lib/packlets/resources/common.js.map +1 -0
  309. package/lib/packlets/resources/index.d.ts +3 -1
  310. package/lib/packlets/resources/index.d.ts.map +1 -1
  311. package/lib/packlets/resources/index.js +3 -1
  312. package/lib/packlets/resources/index.js.map +1 -1
  313. package/lib/packlets/resources/resource.d.ts +57 -5
  314. package/lib/packlets/resources/resource.d.ts.map +1 -1
  315. package/lib/packlets/resources/resource.js +96 -6
  316. package/lib/packlets/resources/resource.js.map +1 -1
  317. package/lib/packlets/resources/resourceBuilder.d.ts +14 -0
  318. package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -1
  319. package/lib/packlets/resources/resourceBuilder.js +19 -1
  320. package/lib/packlets/resources/resourceBuilder.js.map +1 -1
  321. package/lib/packlets/resources/resourceCandidate.d.ts +42 -6
  322. package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -1
  323. package/lib/packlets/resources/resourceCandidate.js +40 -1
  324. package/lib/packlets/resources/resourceCandidate.js.map +1 -1
  325. package/lib/packlets/resources/resourceManagerBuilder.d.ts +220 -0
  326. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
  327. package/lib/packlets/resources/resourceManagerBuilder.js +451 -0
  328. package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -0
  329. package/lib/packlets/runtime/cacheListener.d.ts +62 -0
  330. package/lib/packlets/runtime/cacheListener.d.ts.map +1 -0
  331. package/lib/packlets/runtime/cacheListener.js +56 -0
  332. package/lib/packlets/runtime/cacheListener.js.map +1 -0
  333. package/lib/packlets/runtime/cacheMetrics.d.ts +82 -0
  334. package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -0
  335. package/lib/packlets/runtime/cacheMetrics.js +143 -0
  336. package/lib/packlets/runtime/cacheMetrics.js.map +1 -0
  337. package/lib/packlets/runtime/compiledResourceCollection.d.ts +167 -0
  338. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
  339. package/lib/packlets/runtime/compiledResourceCollection.js +466 -0
  340. package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -0
  341. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts +70 -0
  342. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +1 -0
  343. package/lib/packlets/runtime/conditionSetResolutionResult.js +135 -0
  344. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  345. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts +80 -0
  346. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +1 -0
  347. package/lib/packlets/runtime/context/contextQualifierProvider.js +33 -0
  348. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  349. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts +165 -0
  350. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +1 -0
  351. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js +179 -0
  352. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  353. package/lib/packlets/runtime/context/index.d.ts +5 -0
  354. package/lib/packlets/runtime/context/index.d.ts.map +1 -0
  355. package/lib/packlets/runtime/context/index.js +42 -0
  356. package/lib/packlets/runtime/context/index.js.map +1 -0
  357. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +111 -0
  358. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -0
  359. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +177 -0
  360. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  361. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +47 -0
  362. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -0
  363. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +64 -0
  364. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  365. package/lib/packlets/runtime/iResourceManager.d.ts +88 -0
  366. package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -0
  367. package/lib/packlets/runtime/iResourceManager.js +24 -0
  368. package/lib/packlets/runtime/iResourceManager.js.map +1 -0
  369. package/lib/packlets/runtime/index.d.ts +12 -0
  370. package/lib/packlets/runtime/index.d.ts.map +1 -0
  371. package/lib/packlets/runtime/index.js +73 -0
  372. package/lib/packlets/runtime/index.js.map +1 -0
  373. package/lib/packlets/runtime/resource-tree/common.d.ts +91 -0
  374. package/lib/packlets/runtime/resource-tree/common.d.ts.map +1 -0
  375. package/lib/packlets/runtime/resource-tree/common.js +24 -0
  376. package/lib/packlets/runtime/resource-tree/common.js.map +1 -0
  377. package/lib/packlets/runtime/resource-tree/index.d.ts +5 -0
  378. package/lib/packlets/runtime/resource-tree/index.d.ts.map +1 -0
  379. package/lib/packlets/runtime/resource-tree/index.js +42 -0
  380. package/lib/packlets/runtime/resource-tree/index.js.map +1 -0
  381. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts +141 -0
  382. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +1 -0
  383. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js +224 -0
  384. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  385. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts +24 -0
  386. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +1 -0
  387. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js +98 -0
  388. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  389. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts +99 -0
  390. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +1 -0
  391. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +165 -0
  392. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  393. package/lib/packlets/runtime/resourceResolver.d.ts +196 -0
  394. package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -0
  395. package/lib/packlets/runtime/resourceResolver.js +437 -0
  396. package/lib/packlets/runtime/resourceResolver.js.map +1 -0
  397. package/lib/packlets/runtime/validate.d.ts +13 -0
  398. package/lib/packlets/runtime/validate.d.ts.map +1 -0
  399. package/lib/packlets/runtime/validate.js +49 -0
  400. package/lib/packlets/runtime/validate.js.map +1 -0
  401. package/package.json +76 -75
  402. package/lib/packlets/resources/resourceManager.d.ts +0 -104
  403. package/lib/packlets/resources/resourceManager.d.ts.map +0 -1
  404. package/lib/packlets/resources/resourceManager.js +0 -201
  405. package/lib/packlets/resources/resourceManager.js.map +0 -1
@@ -1 +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,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;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,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,GAAG,cAAc,CAAC,WAAW,EAAE,EAAE,oBAAoB,CAAC,CAAC;CAC1G"}
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"}
@@ -1 +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 { ResourceManager } 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.ResourceManager | resource manager} 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(item: IImportable, manager: ResourceManager): DetailedResult<IImportable[], ImporterResultDetail>;\n}\n"]}
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"]}
@@ -1,6 +1,6 @@
1
1
  import { DetailedResult, Result } from '@fgv/ts-utils';
2
2
  import { IImporter, ImporterResultDetail } from './importer';
3
- import { ResourceManager } from '../../resources';
3
+ import { ResourceManagerBuilder } from '../../resources';
4
4
  import { IImportable } from '../importable';
5
5
  /**
6
6
  * {@link Import.Importers.IImporter | Importer} implementation which imports resources from a JSON object.
@@ -24,9 +24,8 @@ export declare class JsonImporter implements IImporter {
24
24
  /**
25
25
  * {@inheritdoc Import.Importers.IImporter.import}
26
26
  */
27
- import(item: IImportable, manager: ResourceManager): DetailedResult<IImportable[], ImporterResultDetail>;
27
+ import(item: IImportable, manager: ResourceManagerBuilder): DetailedResult<IImportable[], ImporterResultDetail>;
28
28
  private _tryImportResourceCollection;
29
29
  private _tryImportResourceTree;
30
- private _tryImportResource;
31
30
  }
32
31
  //# sourceMappingURL=jsonImporter.d.ts.map
@@ -1 +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;AAE/F,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,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,eAAe,GACvB,cAAc,CAAC,WAAW,EAAE,EAAE,oBAAoB,CAAC;IAWtD,OAAO,CAAC,4BAA4B;IAepC,OAAO,CAAC,sBAAsB;IAa9B,OAAO,CAAC,kBAAkB;CAkB3B"}
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;IAqBtD,OAAO,CAAC,4BAA4B;IAepC,OAAO,CAAC,sBAAsB;CAqC/B"}
@@ -56,7 +56,6 @@ var __importStar = (this && this.__importStar) || (function () {
56
56
  Object.defineProperty(exports, "__esModule", { value: true });
57
57
  exports.JsonImporter = void 0;
58
58
  const ts_utils_1 = require("@fgv/ts-utils");
59
- const ts_json_base_1 = require("@fgv/ts-json-base");
60
59
  const importable_1 = require("../importable");
61
60
  const ResourceJson = __importStar(require("../../resource-json"));
62
61
  /**
@@ -87,13 +86,20 @@ class JsonImporter {
87
86
  import(item, manager) {
88
87
  var _a, _b;
89
88
  if (!(0, importable_1.isImportable)(item) || item.type !== 'json') {
90
- /* c8 ignore next 1 - defense in depth */
89
+ /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
91
90
  const name = (_b = (_a = item.context) === null || _a === void 0 ? void 0 : _a.baseId) !== null && _b !== void 0 ? _b : 'unknown';
92
91
  return (0, ts_utils_1.failWithDetail)(`${name}: not a valid JSON importable (${item.type})`, 'skipped');
93
92
  }
94
- return this._tryImportResourceCollection(item)
93
+ return (this._tryImportResourceCollection(item)
95
94
  .onFailure(() => this._tryImportResourceTree(item))
96
- .onFailure(() => this._tryImportResource(item, manager));
95
+ // experimenting with this, accepting any JSON object here makes it
96
+ // very hard to distinguish a collection or tree with a typo from a
97
+ // legitimate single loose resource, which yields extremely confusing
98
+ // error messages. Disabled until/unless we come up with a better plan.
99
+ //.onFailure(() => this._tryImportResource(item, manager));
100
+ .onFailure(() => { var _a, _b;
101
+ /* c8 ignore next 1 - defense in depth */
102
+ return (0, ts_utils_1.failWithDetail)(`${(_b = (_a = item.context) === null || _a === void 0 ? void 0 : _a.baseId) !== null && _b !== void 0 ? _b : 'unknown'}: unrecognized JSON format.`, 'failed'); }));
97
103
  }
98
104
  _tryImportResourceCollection(item) {
99
105
  return ResourceJson.ResourceDeclCollection.create(item.json)
@@ -119,22 +125,6 @@ class JsonImporter {
119
125
  })
120
126
  .withDetail('skipped', 'consumed');
121
127
  }
122
- _tryImportResource(item, manager) {
123
- return ts_json_base_1.Converters.jsonObject
124
- .convert(item.json)
125
- .onSuccess((json) => {
126
- var _a, _b, _c;
127
- /* c8 ignore next 2 - defense in depth */
128
- const id = (_b = (_a = item.context) === null || _a === void 0 ? void 0 : _a.baseId) !== null && _b !== void 0 ? _b : '';
129
- const conditions = (_c = item.context) === null || _c === void 0 ? void 0 : _c.conditions;
130
- const candidate = { id, conditions, json };
131
- return manager.addLooseCandidate(candidate);
132
- })
133
- .onSuccess(() => {
134
- return (0, ts_utils_1.succeed)([]);
135
- })
136
- .withDetail('failed', 'consumed');
137
- }
138
128
  }
139
129
  exports.JsonImporter = JsonImporter;
140
130
  //# sourceMappingURL=jsonImporter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"jsonImporter.js","sourceRoot":"","sources":["../../../../src/packlets/import/importers/jsonImporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAA+F;AAC/F,oDAAiE;AAGjE,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,OAAwB;;QAExB,IAAI,CAAC,IAAA,yBAAY,EAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAChD,yCAAyC;YACzC,MAAM,IAAI,GAAG,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,MAAM,mCAAI,SAAS,CAAC;YAC/C,OAAO,IAAA,yBAAc,EAAC,GAAG,IAAI,kCAAkC,IAAI,CAAC,IAAI,GAAG,EAAE,SAAS,CAAC,CAAC;QAC1F,CAAC;QACD,OAAO,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC;aAC3C,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;aAClD,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAC7D,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;IAEO,kBAAkB,CACxB,IAAqB,EACrB,OAAwB;QAExB,OAAO,yBAAc,CAAC,UAAU;aAC7B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;aAClB,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;;YAClB,yCAAyC;YACzC,MAAM,EAAE,GAAG,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,MAAM,mCAAI,EAAE,CAAC;YACtC,MAAM,UAAU,GAAG,MAAA,IAAI,CAAC,OAAO,0CAAE,UAAU,CAAC;YAC5C,MAAM,SAAS,GAAkD,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;YAC1F,OAAO,OAAO,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAC9C,CAAC,CAAC;aACD,SAAS,CAAC,GAAG,EAAE;YACd,OAAO,IAAA,kBAAO,EAAC,EAAE,CAAC,CAAC;QACrB,CAAC,CAAC;aACD,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACtC,CAAC;CACF;AAnFD,oCAmFC","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 { Converters as JsonConverters } from '@fgv/ts-json-base';\nimport { IImporter, ImporterResultDetail } from './importer';\nimport { ResourceManager } 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: ResourceManager\n ): DetailedResult<IImportable[], ImporterResultDetail> {\n if (!isImportable(item) || item.type !== 'json') {\n /* c8 ignore next 1 - defense in depth */\n const name = item.context?.baseId ?? 'unknown';\n return failWithDetail(`${name}: not a valid JSON importable (${item.type})`, 'skipped');\n }\n return this._tryImportResourceCollection(item)\n .onFailure(() => this._tryImportResourceTree(item))\n .onFailure(() => this._tryImportResource(item, manager));\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 private _tryImportResource(\n item: IImportableJson,\n manager: ResourceManager\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"]}
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,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,kCAAkC,IAAI,CAAC,IAAI,GAAG,EAAE,SAAS,CAAC,CAAC;QAC1F,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;AAnGD,oCAmGC","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 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}: not a valid 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"]}
@@ -1,5 +1,5 @@
1
1
  import { DetailedResult, Result, FileTree } from '@fgv/ts-utils';
2
- import { ResourceManager } from '../../resources';
2
+ import { ResourceManagerBuilder } from '../../resources';
3
3
  import { IImportable } from '../importable';
4
4
  import { IImporter, ImporterResultDetail } from './importer';
5
5
  import { IReadOnlyQualifierCollector } from '../../qualifiers';
@@ -50,7 +50,7 @@ export declare class PathImporter implements IImporter {
50
50
  /**
51
51
  * {@inheritdoc Import.Importers.IImporter.import}
52
52
  */
53
- import(item: IImportable, __manager: ResourceManager): DetailedResult<IImportable[], ImporterResultDetail>;
53
+ import(item: IImportable, __manager: ResourceManagerBuilder): DetailedResult<IImportable[], ImporterResultDetail>;
54
54
  /**
55
55
  * Gets an {@link Import.FsItem | FsItem} from an {@link Import.IImportable | importable}.
56
56
  * @param item - The importable to convert.
@@ -1 +1 @@
1
- {"version":3,"file":"pathImporter.d.ts","sourceRoot":"","sources":["../../../../src/packlets/import/importers/pathImporter.ts"],"names":[],"mappings":"AAsBA,OAAO,EAEL,cAAc,EAEd,MAAM,EAEN,QAAQ,EACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,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,eAAe,GACzB,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"}
1
+ {"version":3,"file":"pathImporter.d.ts","sourceRoot":"","sources":["../../../../src/packlets/import/importers/pathImporter.ts"],"names":[],"mappings":"AAsBA,OAAO,EAEL,cAAc,EAEd,MAAM,EAEN,QAAQ,EACT,MAAM,eAAe,CAAC;AACvB,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"pathImporter.js","sourceRoot":"","sources":["../../../../src/packlets/import/importers/pathImporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAOuB;AAKvB,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,mBAAQ,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,SAA0B;QAE1B,MAAM,EACJ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,aAAa,EACtB,GAAG,IAAI,CAAC,8BAA8B,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YACjC,OAAO,IAAA,yBAAc,EAAC,cAAc,EAAE,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QAC5F,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;YACxF,OAAO,IAAA,4BAAiB,EAAC,EAAE,EAAE,WAAW,CAAC,CAAC;QAC5C,CAAC;QAED,8EAA8E;QAC9E,mCAAmC;QACnC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE7B,OAAO,IAAA,4BAAiB,EAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC;IACrF,CAAC;IAED;;;;OAIG;IACO,8BAA8B,CAAC,IAAiB;QACxD,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACzB,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACpD,OAAO,eAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YACrE,CAAC;YACD,OAAO,IAAA,yBAAc,EAAC,0DAA0D,EAAE,QAAQ,CAAC,CAAC;QAC9F,CAAC;QACD,OAAO,IAAA,yBAAc,EAAC,GAAG,IAAI,CAAC,IAAI,8CAA8C,EAAE,SAAS,CAAC,CAAC;IAC/F,CAAC;CACF;AAlFD,oCAkFC","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 Result,\n succeedWithDetail,\n FileTree\n} from '@fgv/ts-utils';\nimport { ResourceManager } 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: ResourceManager\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"]}
1
+ {"version":3,"file":"pathImporter.js","sourceRoot":"","sources":["../../../../src/packlets/import/importers/pathImporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAOuB;AAKvB,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,mBAAQ,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,MAAM,EAAE,aAAa,EACtB,GAAG,IAAI,CAAC,8BAA8B,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YACjC,OAAO,IAAA,yBAAc,EAAC,cAAc,EAAE,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QAC5F,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;YACxF,OAAO,IAAA,4BAAiB,EAAC,EAAE,EAAE,WAAW,CAAC,CAAC;QAC5C,CAAC;QAED,8EAA8E;QAC9E,mCAAmC;QACnC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE7B,OAAO,IAAA,4BAAiB,EAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC;IACrF,CAAC;IAED;;;;OAIG;IACO,8BAA8B,CAAC,IAAiB;QACxD,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACzB,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACpD,OAAO,eAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YACrE,CAAC;YACD,OAAO,IAAA,yBAAc,EAAC,0DAA0D,EAAE,QAAQ,CAAC,CAAC;QAC9F,CAAC;QACD,OAAO,IAAA,yBAAc,EAAC,GAAG,IAAI,CAAC,IAAI,8CAA8C,EAAE,SAAS,CAAC,CAAC;IAC/F,CAAC;CACF;AAlFD,oCAkFC","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 Result,\n succeedWithDetail,\n FileTree\n} from '@fgv/ts-utils';\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,44 @@
1
+ import * as Model from './json';
2
+ /**
3
+ * A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.
4
+ * @returns A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.
5
+ * @public
6
+ */
7
+ export declare const languageQualifierTypeConfig: import("@fgv/ts-utils").ObjectConverter<Model.ILanguageQualifierTypeConfig, unknown>;
8
+ /**
9
+ * A `Converter` for {@link QualifierTypes.Config.ITerritoryQualifierTypeConfig | TerritoryQualifierTypeConfig} objects.
10
+ * @returns A `Converter` for {@link QualifierTypes.Config.ITerritoryQualifierTypeConfig | TerritoryQualifierTypeConfig} objects.
11
+ * @public
12
+ */
13
+ export declare const territoryQualifierTypeConfig: import("@fgv/ts-utils").ObjectConverter<Model.ITerritoryQualifierTypeConfig, unknown>;
14
+ /**
15
+ * A `Converter` for {@link QualifierTypes.Config.ILiteralQualifierTypeConfig | LiteralQualifierTypeConfig} objects.
16
+ * @returns A `Converter` for {@link QualifierTypes.Config.ILiteralQualifierTypeConfig | LiteralQualifierTypeConfig} objects.
17
+ * @public
18
+ */
19
+ export declare const literalQualifierTypeConfig: import("@fgv/ts-utils").ObjectConverter<Model.ILiteralQualifierTypeConfig, unknown>;
20
+ /**
21
+ * A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.
22
+ * @returns A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.
23
+ * @public
24
+ */
25
+ export declare const systemLanguageQualifierTypeConfig: import("@fgv/ts-utils").ObjectConverter<Model.ISystemLanguageQualifierTypeConfig, unknown>;
26
+ /**
27
+ * A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.
28
+ * @returns A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.
29
+ * @public
30
+ */
31
+ export declare const systemTerritoryQualifierTypeConfig: import("@fgv/ts-utils").ObjectConverter<Model.ISystemTerritoryQualifierTypeConfig, unknown>;
32
+ /**
33
+ * A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.
34
+ * @returns A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.
35
+ * @public
36
+ */
37
+ export declare const systemLiteralQualifierTypeConfig: import("@fgv/ts-utils").ObjectConverter<Model.ISystemLiteralQualifierTypeConfig, unknown>;
38
+ /**
39
+ * A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.
40
+ * @returns A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.
41
+ * @public
42
+ */
43
+ export declare const systemQualifierTypeConfig: import("@fgv/ts-utils").Converter<Model.ISystemQualifierTypeConfig, unknown>;
44
+ //# sourceMappingURL=convert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/convert.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,KAAK,MAAM,QAAQ,CAAC;AAEhC;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,sFAEtC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,uFAIvC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,qFAKrC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,4FAK1C,CAAC;AAEL;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,6FAK3C,CAAC;AAEL;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,2FAKzC,CAAC;AAEL;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,8EAOrC,CAAC"}
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2025 Erik Fortune
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be included in all
13
+ * copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ * SOFTWARE.
22
+ */
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.systemQualifierTypeConfig = exports.systemLiteralQualifierTypeConfig = exports.systemTerritoryQualifierTypeConfig = exports.systemLanguageQualifierTypeConfig = exports.literalQualifierTypeConfig = exports.territoryQualifierTypeConfig = exports.languageQualifierTypeConfig = void 0;
25
+ /* eslint-disable @rushstack/typedef-var */
26
+ const ts_utils_1 = require("@fgv/ts-utils");
27
+ /**
28
+ * A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.
29
+ * @returns A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.
30
+ * @public
31
+ */
32
+ exports.languageQualifierTypeConfig = ts_utils_1.Converters.strictObject({
33
+ allowContextList: ts_utils_1.Converters.boolean.optional()
34
+ });
35
+ /**
36
+ * A `Converter` for {@link QualifierTypes.Config.ITerritoryQualifierTypeConfig | TerritoryQualifierTypeConfig} objects.
37
+ * @returns A `Converter` for {@link QualifierTypes.Config.ITerritoryQualifierTypeConfig | TerritoryQualifierTypeConfig} objects.
38
+ * @public
39
+ */
40
+ exports.territoryQualifierTypeConfig = ts_utils_1.Converters.strictObject({
41
+ allowContextList: ts_utils_1.Converters.boolean,
42
+ acceptLowercase: ts_utils_1.Converters.boolean.optional(),
43
+ allowedTerritories: ts_utils_1.Converters.arrayOf(ts_utils_1.Converters.string).optional()
44
+ });
45
+ /**
46
+ * A `Converter` for {@link QualifierTypes.Config.ILiteralQualifierTypeConfig | LiteralQualifierTypeConfig} objects.
47
+ * @returns A `Converter` for {@link QualifierTypes.Config.ILiteralQualifierTypeConfig | LiteralQualifierTypeConfig} objects.
48
+ * @public
49
+ */
50
+ exports.literalQualifierTypeConfig = ts_utils_1.Converters.strictObject({
51
+ allowContextList: ts_utils_1.Converters.boolean.optional(),
52
+ caseSensitive: ts_utils_1.Converters.boolean.optional(),
53
+ enumeratedValues: ts_utils_1.Converters.arrayOf(ts_utils_1.Converters.string).optional(),
54
+ hierarchy: ts_utils_1.Converters.recordOf(ts_utils_1.Converters.string).optional()
55
+ });
56
+ /**
57
+ * A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.
58
+ * @returns A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.
59
+ * @public
60
+ */
61
+ exports.systemLanguageQualifierTypeConfig = ts_utils_1.Converters.strictObject({
62
+ name: ts_utils_1.Converters.string,
63
+ systemType: ts_utils_1.Converters.literal('language'),
64
+ configuration: exports.languageQualifierTypeConfig.optional()
65
+ });
66
+ /**
67
+ * A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.
68
+ * @returns A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.
69
+ * @public
70
+ */
71
+ exports.systemTerritoryQualifierTypeConfig = ts_utils_1.Converters.strictObject({
72
+ name: ts_utils_1.Converters.string,
73
+ systemType: ts_utils_1.Converters.literal('territory'),
74
+ configuration: exports.territoryQualifierTypeConfig.optional()
75
+ });
76
+ /**
77
+ * A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.
78
+ * @returns A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.
79
+ * @public
80
+ */
81
+ exports.systemLiteralQualifierTypeConfig = ts_utils_1.Converters.strictObject({
82
+ name: ts_utils_1.Converters.string,
83
+ systemType: ts_utils_1.Converters.literal('literal'),
84
+ configuration: exports.literalQualifierTypeConfig.optional()
85
+ });
86
+ /**
87
+ * A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.
88
+ * @returns A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.
89
+ * @public
90
+ */
91
+ exports.systemQualifierTypeConfig = ts_utils_1.Converters.discriminatedObject('systemType', {
92
+ language: exports.systemLanguageQualifierTypeConfig,
93
+ territory: exports.systemTerritoryQualifierTypeConfig,
94
+ literal: exports.systemLiteralQualifierTypeConfig
95
+ });
96
+ //# sourceMappingURL=convert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/convert.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,2CAA2C;AAE3C,4CAA2C;AAG3C;;;;GAIG;AACU,QAAA,2BAA2B,GAAG,qBAAU,CAAC,YAAY,CAAqC;IACrG,gBAAgB,EAAE,qBAAU,CAAC,OAAO,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAC;AAEH;;;;GAIG;AACU,QAAA,4BAA4B,GAAG,qBAAU,CAAC,YAAY,CAAsC;IACvG,gBAAgB,EAAE,qBAAU,CAAC,OAAO;IACpC,eAAe,EAAE,qBAAU,CAAC,OAAO,CAAC,QAAQ,EAAE;IAC9C,kBAAkB,EAAE,qBAAU,CAAC,OAAO,CAAC,qBAAU,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;CACrE,CAAC,CAAC;AAEH;;;;GAIG;AACU,QAAA,0BAA0B,GAAG,qBAAU,CAAC,YAAY,CAAoC;IACnG,gBAAgB,EAAE,qBAAU,CAAC,OAAO,CAAC,QAAQ,EAAE;IAC/C,aAAa,EAAE,qBAAU,CAAC,OAAO,CAAC,QAAQ,EAAE;IAC5C,gBAAgB,EAAE,qBAAU,CAAC,OAAO,CAAC,qBAAU,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;IAClE,SAAS,EAAE,qBAAU,CAAC,QAAQ,CAAC,qBAAU,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;CAC7D,CAAC,CAAC;AAEH;;;;GAIG;AACU,QAAA,iCAAiC,GAC5C,qBAAU,CAAC,YAAY,CAA2C;IAChE,IAAI,EAAE,qBAAU,CAAC,MAAM;IACvB,UAAU,EAAE,qBAAU,CAAC,OAAO,CAAC,UAAU,CAAC;IAC1C,aAAa,EAAE,mCAA2B,CAAC,QAAQ,EAAE;CACtD,CAAC,CAAC;AAEL;;;;GAIG;AACU,QAAA,kCAAkC,GAC7C,qBAAU,CAAC,YAAY,CAA4C;IACjE,IAAI,EAAE,qBAAU,CAAC,MAAM;IACvB,UAAU,EAAE,qBAAU,CAAC,OAAO,CAAC,WAAW,CAAC;IAC3C,aAAa,EAAE,oCAA4B,CAAC,QAAQ,EAAE;CACvD,CAAC,CAAC;AAEL;;;;GAIG;AACU,QAAA,gCAAgC,GAC3C,qBAAU,CAAC,YAAY,CAA0C;IAC/D,IAAI,EAAE,qBAAU,CAAC,MAAM;IACvB,UAAU,EAAE,qBAAU,CAAC,OAAO,CAAC,SAAS,CAAC;IACzC,aAAa,EAAE,kCAA0B,CAAC,QAAQ,EAAE;CACrD,CAAC,CAAC;AAEL;;;;GAIG;AACU,QAAA,yBAAyB,GAAG,qBAAU,CAAC,mBAAmB,CACrE,YAAY,EACZ;IACE,QAAQ,EAAE,yCAAiC;IAC3C,SAAS,EAAE,0CAAkC;IAC7C,OAAO,EAAE,wCAAgC;CAC1C,CACF,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/* eslint-disable @rushstack/typedef-var */\n\nimport { Converters } from '@fgv/ts-utils';\nimport * as Model from './json';\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});\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"]}
@@ -0,0 +1,4 @@
1
+ import * as Convert from './convert';
2
+ export * from './json';
3
+ export { Convert };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -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,64 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2025 Erik Fortune
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be included in all
13
+ * copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ * SOFTWARE.
22
+ */
23
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
24
+ if (k2 === undefined) k2 = k;
25
+ var desc = Object.getOwnPropertyDescriptor(m, k);
26
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
27
+ desc = { enumerable: true, get: function() { return m[k]; } };
28
+ }
29
+ Object.defineProperty(o, k2, desc);
30
+ }) : (function(o, m, k, k2) {
31
+ if (k2 === undefined) k2 = k;
32
+ o[k2] = m[k];
33
+ }));
34
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
35
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
36
+ }) : function(o, v) {
37
+ o["default"] = v;
38
+ });
39
+ var __importStar = (this && this.__importStar) || (function () {
40
+ var ownKeys = function(o) {
41
+ ownKeys = Object.getOwnPropertyNames || function (o) {
42
+ var ar = [];
43
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
44
+ return ar;
45
+ };
46
+ return ownKeys(o);
47
+ };
48
+ return function (mod) {
49
+ if (mod && mod.__esModule) return mod;
50
+ var result = {};
51
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
52
+ __setModuleDefault(result, mod);
53
+ return result;
54
+ };
55
+ })();
56
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
57
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
58
+ };
59
+ Object.defineProperty(exports, "__esModule", { value: true });
60
+ exports.Convert = void 0;
61
+ const Convert = __importStar(require("./convert"));
62
+ exports.Convert = Convert;
63
+ __exportStar(require("./json"), exports);
64
+ //# sourceMappingURL=index.js.map
@@ -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,69 @@
1
+ import { JsonObject } from '@fgv/ts-json-base';
2
+ import { LiteralValueHierarchyDecl } from '../literalValueHierarchy';
3
+ /**
4
+ * Templated configuration for {@link QualifierTypes.QualifierType | qualifier type} configuration.
5
+ * @public
6
+ */
7
+ export interface IQualifierTypeConfig<T = JsonObject> {
8
+ name: string;
9
+ systemType: string;
10
+ configuration?: T;
11
+ }
12
+ /**
13
+ * Configuration for {@link QualifierTypes.LanguageQualifierType | language qualifier type} configuration.
14
+ * @public
15
+ */
16
+ export interface ILanguageQualifierTypeConfig {
17
+ allowContextList?: boolean;
18
+ }
19
+ /**
20
+ * Configuration for {@link QualifierTypes.TerritoryQualifierType | territory qualifier type} configuration.
21
+ * @public
22
+ */
23
+ export interface ITerritoryQualifierTypeConfig {
24
+ allowContextList?: boolean;
25
+ acceptLowercase?: boolean;
26
+ allowedTerritories?: string[];
27
+ /**
28
+ * Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}
29
+ * of territory values to use for matching. If not provided, no hierarchy will be used.
30
+ */
31
+ hierarchy?: LiteralValueHierarchyDecl<string>;
32
+ }
33
+ /**
34
+ * Configuration for {@link QualifierTypes.LiteralQualifierType | literal qualifier type} configuration.
35
+ * @public
36
+ */
37
+ export interface ILiteralQualifierTypeConfig {
38
+ allowContextList?: boolean;
39
+ caseSensitive?: boolean;
40
+ enumeratedValues?: string[];
41
+ hierarchy?: LiteralValueHierarchyDecl<string>;
42
+ }
43
+ /**
44
+ * Discriminated configuration for {@link QualifierTypes.LanguageQualifierType | language qualifier type} configuration.
45
+ * @public
46
+ */
47
+ export interface ISystemLanguageQualifierTypeConfig extends IQualifierTypeConfig<ILanguageQualifierTypeConfig> {
48
+ systemType: 'language';
49
+ }
50
+ /**
51
+ * Discriminated configuration for {@link QualifierTypes.TerritoryQualifierType | territory qualifier type} configuration.
52
+ * @public
53
+ */
54
+ export interface ISystemTerritoryQualifierTypeConfig extends IQualifierTypeConfig<ITerritoryQualifierTypeConfig> {
55
+ systemType: 'territory';
56
+ }
57
+ /**
58
+ * Discriminated configuration for {@link QualifierTypes.LiteralQualifierType | literal qualifier type} configuration.
59
+ * @public
60
+ */
61
+ export interface ISystemLiteralQualifierTypeConfig extends IQualifierTypeConfig<ILiteralQualifierTypeConfig> {
62
+ systemType: 'literal';
63
+ }
64
+ /**
65
+ * Discriminated configuration for {@link QualifierTypes.QualifierType | qualifier type} configuration.
66
+ * @public
67
+ */
68
+ export type ISystemQualifierTypeConfig = ISystemLanguageQualifierTypeConfig | ISystemTerritoryQualifierTypeConfig | ISystemLiteralQualifierTypeConfig;
69
+ //# sourceMappingURL=json.d.ts.map
@@ -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;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE;;;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;;;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"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2025 Erik Fortune
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be included in all
13
+ * copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ * SOFTWARE.
22
+ */
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ //# sourceMappingURL=json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.js","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/json.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { JsonObject } from '@fgv/ts-json-base';\nimport { LiteralValueHierarchyDecl } from '../literalValueHierarchy';\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 * 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.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"]}
@@ -1,9 +1,10 @@
1
1
  import { Converter } from '@fgv/ts-utils';
2
2
  import { QualifierType } from './qualifierType';
3
3
  import { ReadOnlyQualifierTypeCollector } from './qualifierTypeCollector';
4
+ import { ILiteralValueHierarchyCreateParams } from './literalValueHierarchy';
4
5
  /**
5
- * Context necessary to convert a qualifier name or number to an
6
- * instantiated {@link QualifierTypes.QualifierType}.
6
+ * Context necessary to convert a qualifier name or number to an instantiated
7
+ * {@link QualifierTypes.QualifierType}.
7
8
  * @public
8
9
  */
9
10
  export interface IQualifierTypeConvertContext {
@@ -16,4 +17,11 @@ export interface IQualifierTypeConvertContext {
16
17
  * @public
17
18
  */
18
19
  export declare const qualifierType: Converter<QualifierType, IQualifierTypeConvertContext>;
20
+ /**
21
+ * Gets a converter for {@link QualifierTypes.ILiteralValueHierarchyCreateParams | ILiteralValueHierarchyCreateParams}
22
+ * objects with values validated by a supplied value converter.
23
+ * @param valueConverter - Converter for the literal value type.
24
+ * @public
25
+ */
26
+ export declare function literalValueHierarchyCreateParams<T extends string>(valueConverter: Converter<T>): Converter<ILiteralValueHierarchyCreateParams<T>>;
19
27
  //# sourceMappingURL=convert.d.ts.map
@@ -1 +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;AAE1E;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C,cAAc,EAAE,8BAA8B,CAAC;CAChD;AAED;;;;;GAKG;AAEH,eAAO,MAAM,aAAa,wDAgBzB,CAAC"}
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,wDAgBzB,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"}