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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (545) hide show
  1. package/dist/index.browser.js.map +1 -0
  2. package/dist/index.js.map +1 -0
  3. package/dist/packlets/bundle/bundleBuilder.js.map +1 -0
  4. package/dist/packlets/bundle/bundleLoader.js.map +1 -0
  5. package/dist/packlets/bundle/bundleNormalizer.js.map +1 -0
  6. package/dist/packlets/bundle/bundleUtils.js.map +1 -0
  7. package/dist/packlets/bundle/convert.js.map +1 -0
  8. package/dist/packlets/bundle/index.js.map +1 -0
  9. package/dist/packlets/bundle/model.js.map +1 -0
  10. package/dist/packlets/common/conditions.js.map +1 -0
  11. package/dist/packlets/common/convert.js.map +1 -0
  12. package/dist/packlets/common/helpers/conditions.js.map +1 -0
  13. package/dist/packlets/common/helpers/context.js.map +1 -0
  14. package/dist/packlets/common/helpers/index.js.map +1 -0
  15. package/dist/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  16. package/dist/packlets/common/helpers/resources.js +2 -4
  17. package/dist/packlets/common/helpers/resources.js.map +1 -0
  18. package/dist/packlets/common/index.js.map +1 -0
  19. package/dist/packlets/common/resources.js.map +1 -0
  20. package/dist/packlets/common/validate/conditions.js +4 -4
  21. package/dist/packlets/common/validate/conditions.js.map +1 -0
  22. package/dist/packlets/common/validate/index.js.map +1 -0
  23. package/dist/packlets/common/validate/regularExpressions.js +2 -2
  24. package/dist/packlets/common/validate/regularExpressions.js.map +1 -0
  25. package/dist/packlets/common/validate/resources.js +1 -1
  26. package/dist/packlets/common/validate/resources.js.map +1 -0
  27. package/dist/packlets/conditions/condition.js +3 -7
  28. package/dist/packlets/conditions/condition.js.map +1 -0
  29. package/dist/packlets/conditions/conditionCollector.js.map +1 -0
  30. package/dist/packlets/conditions/conditionDecls.js.map +1 -0
  31. package/dist/packlets/conditions/conditionSet.js +14 -5
  32. package/dist/packlets/conditions/conditionSet.js.map +1 -0
  33. package/dist/packlets/conditions/conditionSetCollector.js.map +1 -0
  34. package/dist/packlets/conditions/conditionSetDecls.js.map +1 -0
  35. package/dist/packlets/conditions/conditionToken.js.map +1 -0
  36. package/dist/packlets/conditions/convert/conditionSetDecls.js +50 -6
  37. package/dist/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  38. package/dist/packlets/conditions/convert/decls.js +61 -5
  39. package/dist/packlets/conditions/convert/decls.js.map +1 -0
  40. package/dist/packlets/conditions/convert/index.js.map +1 -0
  41. package/dist/packlets/conditions/index.js.map +1 -0
  42. package/dist/packlets/config/common.js.map +1 -0
  43. package/dist/packlets/config/configInitFactory.js.map +1 -0
  44. package/dist/packlets/config/convert.js.map +1 -0
  45. package/dist/packlets/config/index.browser.js.map +1 -0
  46. package/dist/packlets/config/index.js.map +1 -0
  47. package/dist/packlets/config/json.js.map +1 -0
  48. package/dist/packlets/config/predefined/default.js.map +1 -0
  49. package/dist/packlets/config/predefined/extended.js.map +1 -0
  50. package/dist/packlets/config/predefined/index.js.map +1 -0
  51. package/dist/packlets/config/systemConfiguration.js.map +1 -0
  52. package/dist/packlets/context/contextDecls.js.map +1 -0
  53. package/dist/packlets/context/contextToken.js.map +1 -0
  54. package/dist/packlets/context/convert/decls.js.map +1 -0
  55. package/dist/packlets/context/convert/index.js.map +1 -0
  56. package/dist/packlets/context/index.js.map +1 -0
  57. package/dist/packlets/decisions/abstractDecision.js.map +1 -0
  58. package/dist/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  59. package/dist/packlets/decisions/candidate.js.map +1 -0
  60. package/dist/packlets/decisions/common.js.map +1 -0
  61. package/dist/packlets/decisions/concreteDecision.js.map +1 -0
  62. package/dist/packlets/decisions/decision.js +1 -1
  63. package/dist/packlets/decisions/decision.js.map +1 -0
  64. package/dist/packlets/decisions/index.js.map +1 -0
  65. package/dist/packlets/import/fsItem.js +1 -4
  66. package/dist/packlets/import/fsItem.js.map +1 -0
  67. package/dist/packlets/import/importContext.js +3 -3
  68. package/dist/packlets/import/importContext.js.map +1 -0
  69. package/dist/packlets/import/importManager.js +7 -3
  70. package/dist/packlets/import/importManager.js.map +1 -0
  71. package/dist/packlets/import/importable.js.map +1 -0
  72. package/dist/packlets/import/importers/collectionImporter.js +2 -2
  73. package/dist/packlets/import/importers/collectionImporter.js.map +1 -0
  74. package/dist/packlets/import/importers/fsItemImporter.js +30 -14
  75. package/dist/packlets/import/importers/fsItemImporter.js.map +1 -0
  76. package/dist/packlets/import/importers/importer.js.map +1 -0
  77. package/dist/packlets/import/importers/index.browser.js.map +1 -0
  78. package/dist/packlets/import/importers/index.js.map +1 -0
  79. package/dist/packlets/import/importers/jsonImporter.js +2 -2
  80. package/dist/packlets/import/importers/jsonImporter.js.map +1 -0
  81. package/dist/packlets/import/importers/pathImporter.js +1 -1
  82. package/dist/packlets/import/importers/pathImporter.js.map +1 -0
  83. package/dist/packlets/import/index.browser.js.map +1 -0
  84. package/dist/packlets/import/index.js.map +1 -0
  85. package/dist/packlets/qualifier-types/config/convert.js.map +1 -0
  86. package/dist/packlets/qualifier-types/config/index.js.map +1 -0
  87. package/dist/packlets/qualifier-types/config/json.js.map +1 -0
  88. package/dist/packlets/qualifier-types/convert.js.map +1 -0
  89. package/dist/packlets/qualifier-types/helpers.js.map +1 -0
  90. package/dist/packlets/qualifier-types/index.js.map +1 -0
  91. package/dist/packlets/qualifier-types/languageQualifierType.js +6 -7
  92. package/dist/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  93. package/dist/packlets/qualifier-types/literalQualifierType.js +7 -10
  94. package/dist/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  95. package/dist/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  96. package/dist/packlets/qualifier-types/qualifierType.js +12 -13
  97. package/dist/packlets/qualifier-types/qualifierType.js.map +1 -0
  98. package/dist/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  99. package/dist/packlets/qualifier-types/territoryQualifierType.js +5 -5
  100. package/dist/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  101. package/dist/packlets/qualifiers/convert/decls.js.map +1 -0
  102. package/dist/packlets/qualifiers/convert/index.js.map +1 -0
  103. package/dist/packlets/qualifiers/convert/qualifier.js.map +1 -0
  104. package/dist/packlets/qualifiers/index.js.map +1 -0
  105. package/dist/packlets/qualifiers/qualifier.js +6 -7
  106. package/dist/packlets/qualifiers/qualifier.js.map +1 -0
  107. package/dist/packlets/qualifiers/qualifierCollector.js +153 -9
  108. package/dist/packlets/qualifiers/qualifierCollector.js.map +1 -0
  109. package/dist/packlets/qualifiers/qualifierDecl.js.map +1 -0
  110. package/dist/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  111. package/dist/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  112. package/dist/packlets/resource-json/compiled/common.js.map +1 -0
  113. package/dist/packlets/resource-json/compiled/convert.js.map +1 -0
  114. package/dist/packlets/resource-json/compiled/index.js.map +1 -0
  115. package/dist/packlets/resource-json/compiled/json.js.map +1 -0
  116. package/dist/packlets/resource-json/convert.js +225 -0
  117. package/dist/packlets/resource-json/convert.js.map +1 -0
  118. package/dist/packlets/resource-json/helpers.js.map +1 -0
  119. package/dist/packlets/resource-json/index.js.map +1 -0
  120. package/dist/packlets/resource-json/json.js +2 -2
  121. package/dist/packlets/resource-json/json.js.map +1 -0
  122. package/dist/packlets/resource-json/normalized.js.map +1 -0
  123. package/dist/packlets/resource-json/resourceDeclCollection.js +1 -1
  124. package/dist/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  125. package/dist/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  126. package/dist/packlets/resource-json/resourceDeclTree.js +1 -1
  127. package/dist/packlets/resource-json/resourceDeclTree.js.map +1 -0
  128. package/dist/packlets/resource-types/config/convert.js.map +1 -0
  129. package/dist/packlets/resource-types/config/index.js.map +1 -0
  130. package/dist/packlets/resource-types/config/json.js.map +1 -0
  131. package/dist/packlets/resource-types/helpers.js.map +1 -0
  132. package/dist/packlets/resource-types/index.js.map +1 -0
  133. package/dist/packlets/resource-types/jsonResourceType.js +2 -2
  134. package/dist/packlets/resource-types/jsonResourceType.js.map +1 -0
  135. package/dist/packlets/resource-types/resourceType.js +2 -2
  136. package/dist/packlets/resource-types/resourceType.js.map +1 -0
  137. package/dist/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  138. package/dist/packlets/resources/candidateReducer.js.map +1 -0
  139. package/dist/packlets/resources/candidateValue.js.map +1 -0
  140. package/dist/packlets/resources/candidateValueCollector.js.map +1 -0
  141. package/dist/packlets/resources/common.js.map +1 -0
  142. package/dist/packlets/resources/deltaGenerator.js.map +1 -0
  143. package/dist/packlets/resources/index.js.map +1 -0
  144. package/dist/packlets/resources/resource.js.map +1 -0
  145. package/dist/packlets/resources/resourceBuilder.js +2 -2
  146. package/dist/packlets/resources/resourceBuilder.js.map +1 -0
  147. package/dist/packlets/resources/resourceCandidate.js.map +1 -0
  148. package/dist/packlets/resources/resourceManagerBuilder.js +5 -5
  149. package/dist/packlets/resources/resourceManagerBuilder.js.map +1 -0
  150. package/dist/packlets/runtime/cacheListener.js.map +1 -0
  151. package/dist/packlets/runtime/cacheMetrics.js.map +1 -0
  152. package/dist/packlets/runtime/compiledResourceCollection.js +5 -5
  153. package/dist/packlets/runtime/compiledResourceCollection.js.map +1 -0
  154. package/dist/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  155. package/dist/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  156. package/dist/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  157. package/dist/packlets/runtime/context/index.js.map +1 -0
  158. package/dist/packlets/runtime/context/simpleContextQualifierProvider.js +3 -0
  159. package/dist/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  160. package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +3 -5
  161. package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  162. package/dist/packlets/runtime/iResourceManager.js.map +1 -0
  163. package/dist/packlets/runtime/index.js.map +1 -0
  164. package/dist/packlets/runtime/resource-tree/common.js.map +1 -0
  165. package/dist/packlets/runtime/resource-tree/index.js.map +1 -0
  166. package/dist/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  167. package/dist/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  168. package/dist/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  169. package/dist/packlets/runtime/resourceResolver.js.map +1 -0
  170. package/dist/packlets/runtime/resourceTreeResolver.js.map +1 -0
  171. package/dist/packlets/runtime/validate.js.map +1 -0
  172. package/dist/packlets/zip-archive/convert.js.map +1 -0
  173. package/dist/packlets/zip-archive/index.browser.js.map +1 -0
  174. package/dist/packlets/zip-archive/index.js.map +1 -0
  175. package/dist/packlets/zip-archive/json.js.map +1 -0
  176. package/dist/packlets/zip-archive/types.js.map +1 -0
  177. package/dist/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  178. package/dist/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  179. package/dist/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  180. package/dist/ts-res.d.ts +576 -164
  181. package/dist/tsdoc-metadata.json +1 -1
  182. package/lib/index.browser.d.ts.map +1 -0
  183. package/lib/index.browser.js.map +1 -0
  184. package/lib/index.d.ts.map +1 -0
  185. package/lib/index.js.map +1 -0
  186. package/lib/packlets/bundle/bundleBuilder.d.ts.map +1 -0
  187. package/lib/packlets/bundle/bundleBuilder.js.map +1 -0
  188. package/lib/packlets/bundle/bundleLoader.d.ts.map +1 -0
  189. package/lib/packlets/bundle/bundleLoader.js.map +1 -0
  190. package/lib/packlets/bundle/bundleNormalizer.d.ts.map +1 -0
  191. package/lib/packlets/bundle/bundleNormalizer.js.map +1 -0
  192. package/lib/packlets/bundle/bundleUtils.d.ts.map +1 -0
  193. package/lib/packlets/bundle/bundleUtils.js.map +1 -0
  194. package/lib/packlets/bundle/convert.d.ts.map +1 -0
  195. package/lib/packlets/bundle/convert.js.map +1 -0
  196. package/lib/packlets/bundle/index.d.ts.map +1 -0
  197. package/lib/packlets/bundle/index.js.map +1 -0
  198. package/lib/packlets/bundle/model.d.ts.map +1 -0
  199. package/lib/packlets/bundle/model.js.map +1 -0
  200. package/lib/packlets/common/conditions.d.ts.map +1 -0
  201. package/lib/packlets/common/conditions.js.map +1 -0
  202. package/lib/packlets/common/convert.d.ts.map +1 -0
  203. package/lib/packlets/common/convert.js.map +1 -0
  204. package/lib/packlets/common/helpers/conditions.d.ts.map +1 -0
  205. package/lib/packlets/common/helpers/conditions.js.map +1 -0
  206. package/lib/packlets/common/helpers/context.d.ts.map +1 -0
  207. package/lib/packlets/common/helpers/context.js.map +1 -0
  208. package/lib/packlets/common/helpers/index.d.ts.map +1 -0
  209. package/lib/packlets/common/helpers/index.js.map +1 -0
  210. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +1 -0
  211. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  212. package/lib/packlets/common/helpers/resources.d.ts +2 -4
  213. package/lib/packlets/common/helpers/resources.d.ts.map +1 -0
  214. package/lib/packlets/common/helpers/resources.js +2 -4
  215. package/lib/packlets/common/helpers/resources.js.map +1 -0
  216. package/lib/packlets/common/index.d.ts.map +1 -0
  217. package/lib/packlets/common/index.js.map +1 -0
  218. package/lib/packlets/common/resources.d.ts.map +1 -0
  219. package/lib/packlets/common/resources.js.map +1 -0
  220. package/lib/packlets/common/validate/conditions.d.ts +4 -4
  221. package/lib/packlets/common/validate/conditions.d.ts.map +1 -0
  222. package/lib/packlets/common/validate/conditions.js +4 -4
  223. package/lib/packlets/common/validate/conditions.js.map +1 -0
  224. package/lib/packlets/common/validate/index.d.ts.map +1 -0
  225. package/lib/packlets/common/validate/index.js.map +1 -0
  226. package/lib/packlets/common/validate/regularExpressions.d.ts +2 -2
  227. package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -0
  228. package/lib/packlets/common/validate/regularExpressions.js +2 -2
  229. package/lib/packlets/common/validate/regularExpressions.js.map +1 -0
  230. package/lib/packlets/common/validate/resources.d.ts +1 -1
  231. package/lib/packlets/common/validate/resources.d.ts.map +1 -0
  232. package/lib/packlets/common/validate/resources.js +1 -1
  233. package/lib/packlets/common/validate/resources.js.map +1 -0
  234. package/lib/packlets/conditions/condition.d.ts +3 -7
  235. package/lib/packlets/conditions/condition.d.ts.map +1 -0
  236. package/lib/packlets/conditions/condition.js +3 -7
  237. package/lib/packlets/conditions/condition.js.map +1 -0
  238. package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -0
  239. package/lib/packlets/conditions/conditionCollector.js.map +1 -0
  240. package/lib/packlets/conditions/conditionDecls.d.ts +6 -1
  241. package/lib/packlets/conditions/conditionDecls.d.ts.map +1 -0
  242. package/lib/packlets/conditions/conditionDecls.js.map +1 -0
  243. package/lib/packlets/conditions/conditionSet.d.ts.map +1 -0
  244. package/lib/packlets/conditions/conditionSet.js +14 -5
  245. package/lib/packlets/conditions/conditionSet.js.map +1 -0
  246. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -0
  247. package/lib/packlets/conditions/conditionSetCollector.js.map +1 -0
  248. package/lib/packlets/conditions/conditionSetDecls.d.ts +7 -2
  249. package/lib/packlets/conditions/conditionSetDecls.d.ts.map +1 -0
  250. package/lib/packlets/conditions/conditionSetDecls.js.map +1 -0
  251. package/lib/packlets/conditions/conditionToken.d.ts.map +1 -0
  252. package/lib/packlets/conditions/conditionToken.js.map +1 -0
  253. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts +30 -2
  254. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +1 -0
  255. package/lib/packlets/conditions/convert/conditionSetDecls.js +51 -5
  256. package/lib/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  257. package/lib/packlets/conditions/convert/decls.d.ts +39 -3
  258. package/lib/packlets/conditions/convert/decls.d.ts.map +1 -0
  259. package/lib/packlets/conditions/convert/decls.js +63 -5
  260. package/lib/packlets/conditions/convert/decls.js.map +1 -0
  261. package/lib/packlets/conditions/convert/index.d.ts.map +1 -0
  262. package/lib/packlets/conditions/convert/index.js.map +1 -0
  263. package/lib/packlets/conditions/index.d.ts.map +1 -0
  264. package/lib/packlets/conditions/index.js.map +1 -0
  265. package/lib/packlets/config/common.d.ts.map +1 -0
  266. package/lib/packlets/config/common.js.map +1 -0
  267. package/lib/packlets/config/configInitFactory.d.ts.map +1 -0
  268. package/lib/packlets/config/configInitFactory.js.map +1 -0
  269. package/lib/packlets/config/convert.d.ts.map +1 -0
  270. package/lib/packlets/config/convert.js.map +1 -0
  271. package/lib/packlets/config/index.browser.d.ts.map +1 -0
  272. package/lib/packlets/config/index.browser.js.map +1 -0
  273. package/lib/packlets/config/index.d.ts.map +1 -0
  274. package/lib/packlets/config/index.js.map +1 -0
  275. package/lib/packlets/config/json.d.ts.map +1 -0
  276. package/lib/packlets/config/json.js.map +1 -0
  277. package/lib/packlets/config/predefined/default.d.ts.map +1 -0
  278. package/lib/packlets/config/predefined/default.js.map +1 -0
  279. package/lib/packlets/config/predefined/extended.d.ts.map +1 -0
  280. package/lib/packlets/config/predefined/extended.js.map +1 -0
  281. package/lib/packlets/config/predefined/index.d.ts.map +1 -0
  282. package/lib/packlets/config/predefined/index.js.map +1 -0
  283. package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
  284. package/lib/packlets/config/systemConfiguration.js.map +1 -0
  285. package/lib/packlets/context/contextDecls.d.ts.map +1 -0
  286. package/lib/packlets/context/contextDecls.js.map +1 -0
  287. package/lib/packlets/context/contextToken.d.ts.map +1 -0
  288. package/lib/packlets/context/contextToken.js.map +1 -0
  289. package/lib/packlets/context/convert/decls.d.ts.map +1 -0
  290. package/lib/packlets/context/convert/decls.js.map +1 -0
  291. package/lib/packlets/context/convert/index.d.ts.map +1 -0
  292. package/lib/packlets/context/convert/index.js.map +1 -0
  293. package/lib/packlets/context/index.d.ts.map +1 -0
  294. package/lib/packlets/context/index.js.map +1 -0
  295. package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -0
  296. package/lib/packlets/decisions/abstractDecision.js.map +1 -0
  297. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -0
  298. package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  299. package/lib/packlets/decisions/candidate.d.ts.map +1 -0
  300. package/lib/packlets/decisions/candidate.js.map +1 -0
  301. package/lib/packlets/decisions/common.d.ts.map +1 -0
  302. package/lib/packlets/decisions/common.js.map +1 -0
  303. package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -0
  304. package/lib/packlets/decisions/concreteDecision.js.map +1 -0
  305. package/lib/packlets/decisions/decision.d.ts +1 -1
  306. package/lib/packlets/decisions/decision.d.ts.map +1 -0
  307. package/lib/packlets/decisions/decision.js +1 -1
  308. package/lib/packlets/decisions/decision.js.map +1 -0
  309. package/lib/packlets/decisions/index.d.ts.map +1 -0
  310. package/lib/packlets/decisions/index.js.map +1 -0
  311. package/lib/packlets/import/fsItem.d.ts +1 -4
  312. package/lib/packlets/import/fsItem.d.ts.map +1 -0
  313. package/lib/packlets/import/fsItem.js +1 -4
  314. package/lib/packlets/import/fsItem.js.map +1 -0
  315. package/lib/packlets/import/importContext.d.ts +5 -5
  316. package/lib/packlets/import/importContext.d.ts.map +1 -0
  317. package/lib/packlets/import/importContext.js +3 -3
  318. package/lib/packlets/import/importContext.js.map +1 -0
  319. package/lib/packlets/import/importManager.d.ts +15 -1
  320. package/lib/packlets/import/importManager.d.ts.map +1 -0
  321. package/lib/packlets/import/importManager.js +7 -3
  322. package/lib/packlets/import/importManager.js.map +1 -0
  323. package/lib/packlets/import/importable.d.ts.map +1 -0
  324. package/lib/packlets/import/importable.js.map +1 -0
  325. package/lib/packlets/import/importers/collectionImporter.d.ts +2 -2
  326. package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -0
  327. package/lib/packlets/import/importers/collectionImporter.js +2 -2
  328. package/lib/packlets/import/importers/collectionImporter.js.map +1 -0
  329. package/lib/packlets/import/importers/fsItemImporter.d.ts +16 -2
  330. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -0
  331. package/lib/packlets/import/importers/fsItemImporter.js +29 -13
  332. package/lib/packlets/import/importers/fsItemImporter.js.map +1 -0
  333. package/lib/packlets/import/importers/importer.d.ts.map +1 -0
  334. package/lib/packlets/import/importers/importer.js.map +1 -0
  335. package/lib/packlets/import/importers/index.browser.d.ts.map +1 -0
  336. package/lib/packlets/import/importers/index.browser.js.map +1 -0
  337. package/lib/packlets/import/importers/index.d.ts.map +1 -0
  338. package/lib/packlets/import/importers/index.js.map +1 -0
  339. package/lib/packlets/import/importers/jsonImporter.d.ts +2 -2
  340. package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -0
  341. package/lib/packlets/import/importers/jsonImporter.js +2 -2
  342. package/lib/packlets/import/importers/jsonImporter.js.map +1 -0
  343. package/lib/packlets/import/importers/pathImporter.d.ts +1 -1
  344. package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -0
  345. package/lib/packlets/import/importers/pathImporter.js +1 -1
  346. package/lib/packlets/import/importers/pathImporter.js.map +1 -0
  347. package/lib/packlets/import/index.browser.d.ts.map +1 -0
  348. package/lib/packlets/import/index.browser.js.map +1 -0
  349. package/lib/packlets/import/index.d.ts.map +1 -0
  350. package/lib/packlets/import/index.js.map +1 -0
  351. package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
  352. package/lib/packlets/qualifier-types/config/convert.js.map +1 -0
  353. package/lib/packlets/qualifier-types/config/index.d.ts.map +1 -0
  354. package/lib/packlets/qualifier-types/config/index.js.map +1 -0
  355. package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
  356. package/lib/packlets/qualifier-types/config/json.js.map +1 -0
  357. package/lib/packlets/qualifier-types/convert.d.ts.map +1 -0
  358. package/lib/packlets/qualifier-types/convert.js.map +1 -0
  359. package/lib/packlets/qualifier-types/helpers.d.ts.map +1 -0
  360. package/lib/packlets/qualifier-types/helpers.js.map +1 -0
  361. package/lib/packlets/qualifier-types/index.d.ts.map +1 -0
  362. package/lib/packlets/qualifier-types/index.js.map +1 -0
  363. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +6 -7
  364. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -0
  365. package/lib/packlets/qualifier-types/languageQualifierType.js +6 -7
  366. package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  367. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +7 -10
  368. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -0
  369. package/lib/packlets/qualifier-types/literalQualifierType.js +7 -10
  370. package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  371. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
  372. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  373. package/lib/packlets/qualifier-types/qualifierType.d.ts +17 -18
  374. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -0
  375. package/lib/packlets/qualifier-types/qualifierType.js +12 -13
  376. package/lib/packlets/qualifier-types/qualifierType.js.map +1 -0
  377. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -0
  378. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  379. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +8 -8
  380. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -0
  381. package/lib/packlets/qualifier-types/territoryQualifierType.js +5 -5
  382. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  383. package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -0
  384. package/lib/packlets/qualifiers/convert/decls.js.map +1 -0
  385. package/lib/packlets/qualifiers/convert/index.d.ts.map +1 -0
  386. package/lib/packlets/qualifiers/convert/index.js.map +1 -0
  387. package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +1 -0
  388. package/lib/packlets/qualifiers/convert/qualifier.js.map +1 -0
  389. package/lib/packlets/qualifiers/index.d.ts.map +1 -0
  390. package/lib/packlets/qualifiers/index.js.map +1 -0
  391. package/lib/packlets/qualifiers/qualifier.d.ts +6 -7
  392. package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -0
  393. package/lib/packlets/qualifiers/qualifier.js +6 -7
  394. package/lib/packlets/qualifiers/qualifier.js.map +1 -0
  395. package/lib/packlets/qualifiers/qualifierCollector.d.ts +107 -9
  396. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -0
  397. package/lib/packlets/qualifiers/qualifierCollector.js +152 -8
  398. package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -0
  399. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -0
  400. package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -0
  401. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +1 -0
  402. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  403. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +1 -0
  404. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  405. package/lib/packlets/resource-json/compiled/common.d.ts.map +1 -0
  406. package/lib/packlets/resource-json/compiled/common.js.map +1 -0
  407. package/lib/packlets/resource-json/compiled/convert.d.ts.map +1 -0
  408. package/lib/packlets/resource-json/compiled/convert.js.map +1 -0
  409. package/lib/packlets/resource-json/compiled/index.d.ts.map +1 -0
  410. package/lib/packlets/resource-json/compiled/index.js.map +1 -0
  411. package/lib/packlets/resource-json/compiled/json.d.ts.map +1 -0
  412. package/lib/packlets/resource-json/compiled/json.js.map +1 -0
  413. package/lib/packlets/resource-json/convert.d.ts +85 -0
  414. package/lib/packlets/resource-json/convert.d.ts.map +1 -0
  415. package/lib/packlets/resource-json/convert.js +237 -0
  416. package/lib/packlets/resource-json/convert.js.map +1 -0
  417. package/lib/packlets/resource-json/helpers.d.ts.map +1 -0
  418. package/lib/packlets/resource-json/helpers.js.map +1 -0
  419. package/lib/packlets/resource-json/index.d.ts.map +1 -0
  420. package/lib/packlets/resource-json/index.js.map +1 -0
  421. package/lib/packlets/resource-json/json.d.ts +128 -39
  422. package/lib/packlets/resource-json/json.d.ts.map +1 -0
  423. package/lib/packlets/resource-json/json.js +2 -2
  424. package/lib/packlets/resource-json/json.js.map +1 -0
  425. package/lib/packlets/resource-json/normalized.d.ts.map +1 -0
  426. package/lib/packlets/resource-json/normalized.js.map +1 -0
  427. package/lib/packlets/resource-json/resourceDeclCollection.d.ts +1 -1
  428. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -0
  429. package/lib/packlets/resource-json/resourceDeclCollection.js +1 -1
  430. package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  431. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -0
  432. package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  433. package/lib/packlets/resource-json/resourceDeclTree.d.ts +1 -1
  434. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -0
  435. package/lib/packlets/resource-json/resourceDeclTree.js +1 -1
  436. package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -0
  437. package/lib/packlets/resource-types/config/convert.d.ts.map +1 -0
  438. package/lib/packlets/resource-types/config/convert.js.map +1 -0
  439. package/lib/packlets/resource-types/config/index.d.ts.map +1 -0
  440. package/lib/packlets/resource-types/config/index.js.map +1 -0
  441. package/lib/packlets/resource-types/config/json.d.ts.map +1 -0
  442. package/lib/packlets/resource-types/config/json.js.map +1 -0
  443. package/lib/packlets/resource-types/helpers.d.ts.map +1 -0
  444. package/lib/packlets/resource-types/helpers.js.map +1 -0
  445. package/lib/packlets/resource-types/index.d.ts.map +1 -0
  446. package/lib/packlets/resource-types/index.js.map +1 -0
  447. package/lib/packlets/resource-types/jsonResourceType.d.ts +17 -5
  448. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -0
  449. package/lib/packlets/resource-types/jsonResourceType.js +2 -2
  450. package/lib/packlets/resource-types/jsonResourceType.js.map +1 -0
  451. package/lib/packlets/resource-types/resourceType.d.ts +5 -5
  452. package/lib/packlets/resource-types/resourceType.d.ts.map +1 -0
  453. package/lib/packlets/resource-types/resourceType.js +2 -2
  454. package/lib/packlets/resource-types/resourceType.js.map +1 -0
  455. package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +1 -0
  456. package/lib/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  457. package/lib/packlets/resources/candidateReducer.d.ts.map +1 -0
  458. package/lib/packlets/resources/candidateReducer.js.map +1 -0
  459. package/lib/packlets/resources/candidateValue.d.ts.map +1 -0
  460. package/lib/packlets/resources/candidateValue.js.map +1 -0
  461. package/lib/packlets/resources/candidateValueCollector.d.ts.map +1 -0
  462. package/lib/packlets/resources/candidateValueCollector.js.map +1 -0
  463. package/lib/packlets/resources/common.d.ts.map +1 -0
  464. package/lib/packlets/resources/common.js.map +1 -0
  465. package/lib/packlets/resources/deltaGenerator.d.ts.map +1 -0
  466. package/lib/packlets/resources/deltaGenerator.js.map +1 -0
  467. package/lib/packlets/resources/index.d.ts.map +1 -0
  468. package/lib/packlets/resources/index.js.map +1 -0
  469. package/lib/packlets/resources/resource.d.ts.map +1 -0
  470. package/lib/packlets/resources/resource.js.map +1 -0
  471. package/lib/packlets/resources/resourceBuilder.d.ts +2 -2
  472. package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -0
  473. package/lib/packlets/resources/resourceBuilder.js +2 -2
  474. package/lib/packlets/resources/resourceBuilder.js.map +1 -0
  475. package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -0
  476. package/lib/packlets/resources/resourceCandidate.js.map +1 -0
  477. package/lib/packlets/resources/resourceManagerBuilder.d.ts +5 -5
  478. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
  479. package/lib/packlets/resources/resourceManagerBuilder.js +5 -5
  480. package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -0
  481. package/lib/packlets/runtime/cacheListener.d.ts.map +1 -0
  482. package/lib/packlets/runtime/cacheListener.js.map +1 -0
  483. package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -0
  484. package/lib/packlets/runtime/cacheMetrics.js.map +1 -0
  485. package/lib/packlets/runtime/compiledResourceCollection.d.ts +5 -5
  486. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
  487. package/lib/packlets/runtime/compiledResourceCollection.js +5 -5
  488. package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -0
  489. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +1 -0
  490. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  491. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +1 -0
  492. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  493. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +1 -0
  494. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  495. package/lib/packlets/runtime/context/index.d.ts.map +1 -0
  496. package/lib/packlets/runtime/context/index.js.map +1 -0
  497. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +9 -2
  498. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -0
  499. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +3 -0
  500. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  501. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +8 -1
  502. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -0
  503. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +3 -5
  504. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  505. package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -0
  506. package/lib/packlets/runtime/iResourceManager.js.map +1 -0
  507. package/lib/packlets/runtime/index.d.ts.map +1 -0
  508. package/lib/packlets/runtime/index.js.map +1 -0
  509. package/lib/packlets/runtime/resource-tree/common.d.ts.map +1 -0
  510. package/lib/packlets/runtime/resource-tree/common.js.map +1 -0
  511. package/lib/packlets/runtime/resource-tree/index.d.ts.map +1 -0
  512. package/lib/packlets/runtime/resource-tree/index.js.map +1 -0
  513. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +1 -0
  514. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  515. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +1 -0
  516. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  517. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +1 -0
  518. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  519. package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -0
  520. package/lib/packlets/runtime/resourceResolver.js.map +1 -0
  521. package/lib/packlets/runtime/resourceTreeResolver.d.ts.map +1 -0
  522. package/lib/packlets/runtime/resourceTreeResolver.js.map +1 -0
  523. package/lib/packlets/runtime/validate.d.ts.map +1 -0
  524. package/lib/packlets/runtime/validate.js.map +1 -0
  525. package/lib/packlets/zip-archive/convert.d.ts.map +1 -0
  526. package/lib/packlets/zip-archive/convert.js.map +1 -0
  527. package/lib/packlets/zip-archive/index.browser.d.ts.map +1 -0
  528. package/lib/packlets/zip-archive/index.browser.js.map +1 -0
  529. package/lib/packlets/zip-archive/index.d.ts.map +1 -0
  530. package/lib/packlets/zip-archive/index.js.map +1 -0
  531. package/lib/packlets/zip-archive/json.d.ts.map +1 -0
  532. package/lib/packlets/zip-archive/json.js.map +1 -0
  533. package/lib/packlets/zip-archive/types.d.ts.map +1 -0
  534. package/lib/packlets/zip-archive/types.js.map +1 -0
  535. package/lib/packlets/zip-archive/zipArchiveCreator.d.ts.map +1 -0
  536. package/lib/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  537. package/lib/packlets/zip-archive/zipArchiveFormat.d.ts.map +1 -0
  538. package/lib/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  539. package/lib/packlets/zip-archive/zipArchiveLoader.d.ts.map +1 -0
  540. package/lib/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  541. package/package.json +12 -10
  542. package/dist/test/data/sample.json +0 -32
  543. package/dist/test/unit/qualifier-types/testQualifierType.js +0 -76
  544. package/dist/test/unit/resource-types/testDerivedResourceType.js +0 -109
  545. package/dist/test/unit/resources/deltaGenerator.helpers.js +0 -282
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,iEAAiE;AAEjE,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AACpD,0HAA0H;AAC1H,OAAO,KAAK,MAAM,MAAM,iCAAiC,CAAC;AAC1D,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAC3D,0HAA0H;AAC1H,OAAO,KAAK,MAAM,MAAM,iCAAiC,CAAC;AAC1D,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,0HAA0H;AAC1H,OAAO,KAAK,UAAU,MAAM,sCAAsC,CAAC;AAEnE,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EAAoB,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EACL,MAAM,EACN,aAAa,EACb,YAAY,EACZ,SAAS,EACT,UAAU,EACV,YAAY,EACZ,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,EACT,MAAM,EAEN,SAAS,EACT,aAAa,EACb,cAAc,EACd,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,OAAO,EACP,UAAU,EACX,CAAC;AAEF,yBAAyB;AACzB,kFAAkF;AAClF,sFAAsF;AACtF,gFAAgF","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n// Browser entry point - excludes Node.js filesystem dependencies\n\nimport * as Bundle from './packlets/bundle';\nimport * as QualifierTypes from './packlets/qualifier-types';\nimport * as Qualifiers from './packlets/qualifiers';\nimport * as Conditions from './packlets/conditions';\n// eslint-disable-next-line @rushstack/packlets/mechanics -- browser-specific entry point excludes Node.js fs dependencies\nimport * as Config from './packlets/config/index.browser';\nimport * as Context from './packlets/context';\nimport * as Decisions from './packlets/decisions';\nimport * as ResourceJson from './packlets/resource-json';\nimport * as Resources from './packlets/resources';\nimport * as ResourceTypes from './packlets/resource-types';\n// eslint-disable-next-line @rushstack/packlets/mechanics -- browser-specific entry point excludes Node.js fs dependencies\nimport * as Import from './packlets/import/index.browser';\nimport * as Runtime from './packlets/runtime';\n// eslint-disable-next-line @rushstack/packlets/mechanics -- browser-specific entry point excludes Node.js fs dependencies\nimport * as ZipArchive from './packlets/zip-archive/index.browser';\n\nexport * from './packlets/common';\n\nimport { Condition, ConditionSet } from './packlets/conditions';\nimport { Decision } from './packlets/decisions';\nimport { QualifierType } from './packlets/qualifier-types';\nimport { Qualifier } from './packlets/qualifiers';\nimport { ResourceType } from './packlets/resource-types';\nimport { Resource, ResourceCandidate, ResourceManagerBuilder } from './packlets/resources';\nimport { IResourceManager, ResourceResolver } from './packlets/runtime';\nimport { BundleBuilder, BundleLoader } from './packlets/bundle';\n\nexport {\n Bundle,\n BundleBuilder,\n BundleLoader,\n Condition,\n Conditions,\n ConditionSet,\n Config,\n Context,\n Decision,\n Decisions,\n Import,\n IResourceManager,\n Qualifier,\n QualifierType,\n QualifierTypes,\n Qualifiers,\n Resource,\n ResourceCandidate,\n ResourceJson,\n ResourceResolver,\n ResourceManagerBuilder,\n ResourceType,\n ResourceTypes,\n Resources,\n Runtime,\n ZipArchive\n};\n\n// Excluded from browser:\n// - Config: SystemConfiguration.loadFromFile() (requires Node.js fs via JsonFile)\n// - Import: PathImporter, FsItemImporter, FsItem.createForPath() (require Node.js fs)\n// - ZipArchive: ZipArchiveCreator methods using file paths (require Node.js fs)\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAErD,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EAAoB,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EACL,MAAM,EACN,aAAa,EACb,YAAY,EACZ,SAAS,EACT,UAAU,EACV,YAAY,EACZ,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,EACT,MAAM,EAEN,SAAS,EACT,aAAa,EACb,cAAc,EACd,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,OAAO,EACP,UAAU,EACX,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Bundle from './packlets/bundle';\nimport * as QualifierTypes from './packlets/qualifier-types';\nimport * as Qualifiers from './packlets/qualifiers';\nimport * as Conditions from './packlets/conditions';\nimport * as Config from './packlets/config';\nimport * as Context from './packlets/context';\nimport * as Decisions from './packlets/decisions';\nimport * as ResourceJson from './packlets/resource-json';\nimport * as Resources from './packlets/resources';\nimport * as ResourceTypes from './packlets/resource-types';\nimport * as Import from './packlets/import';\nimport * as Runtime from './packlets/runtime';\nimport * as ZipArchive from './packlets/zip-archive';\n\nexport * from './packlets/common';\n\nimport { Condition, ConditionSet } from './packlets/conditions';\nimport { Decision } from './packlets/decisions';\nimport { QualifierType } from './packlets/qualifier-types';\nimport { Qualifier } from './packlets/qualifiers';\nimport { ResourceType } from './packlets/resource-types';\nimport { Resource, ResourceCandidate, ResourceManagerBuilder } from './packlets/resources';\nimport { IResourceManager, ResourceResolver } from './packlets/runtime';\nimport { BundleBuilder, BundleLoader } from './packlets/bundle';\n\nexport {\n Bundle,\n BundleBuilder,\n BundleLoader,\n Condition,\n Conditions,\n ConditionSet,\n Config,\n Context,\n Decision,\n Decisions,\n Import,\n IResourceManager,\n Qualifier,\n QualifierType,\n QualifierTypes,\n Qualifiers,\n Resource,\n ResourceCandidate,\n ResourceJson,\n ResourceResolver,\n ResourceManagerBuilder,\n ResourceType,\n ResourceTypes,\n Resources,\n Runtime,\n ZipArchive\n};\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundleBuilder.js","sourceRoot":"","sources":["../../../src/packlets/bundle/bundleBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAU,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAGL,gCAAgC,EACjC,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,OAAO,aAAa;IACxB;;;;;;;OAOG;IACI,MAAM,CAAC,MAAM,CAClB,OAA+B,EAC/B,YAAiC,EACjC,MAA4B;;QAE5B,yCAAyC;QACzC,MAAM,GAAG,MAAM,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C;gBACL,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACK,MAAM,CAAC,iBAAiB,CAC9B,kBAA2B,EAC3B,cAAsC;QAEtC,OAAO,cAAc,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACxD,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result, succeed, Hash } from '@fgv/ts-utils';\nimport { ResourceManagerBuilder } from '../resources';\nimport {\n SystemConfiguration,\n PredefinedSystemConfiguration,\n getPredefinedSystemConfiguration\n} from '../config';\nimport { IBundle, IBundleCreateParams, IBundleMetadata } from './model';\nimport { BundleNormalizer } from './bundleNormalizer';\n\n/**\n * Builder for creating resource bundles from a ResourceManagerBuilder.\n * Handles the compilation, configuration extraction, and integrity verification\n * needed to create a complete, portable bundle.\n * @public\n */\nexport class BundleBuilder {\n /**\n * Creates a resource bundle from a ResourceManagerBuilder.\n * @param builder - The ResourceManagerBuilder containing the resources to bundle\n * @param systemConfig - The SystemConfiguration used to create the builder\n * @param params - Optional parameters for bundle creation\n * @returns Success with the created bundle if successful, Failure with error message otherwise\n * @public\n */\n public static create(\n builder: ResourceManagerBuilder,\n systemConfig: SystemConfiguration,\n params?: IBundleCreateParams\n ): Result<IBundle> {\n /* c8 ignore next 2 - defense in depth */\n params = params ?? {};\n const hashNormalizer = params.hashNormalizer ?? new Hash.Crc32Normalizer();\n\n const builderToUse =\n params.normalize === true\n ? BundleNormalizer.normalize(builder, systemConfig)\n : /* c8 ignore next 1 - is tested but coverage gets confused */\n succeed(builder);\n\n return builderToUse.onSuccess((targetBuilder) => {\n return systemConfig.getConfig().onSuccess((config) => {\n return targetBuilder.getCompiledResourceCollection().onSuccess((compiledCollection) => {\n return BundleBuilder._generateChecksum(compiledCollection, hashNormalizer).onSuccess((checksum) => {\n /* c8 ignore next 1 - defense in depth */\n const dateBuilt = params.dateBuilt ?? new Date().toISOString();\n\n const metadata: IBundleMetadata = {\n dateBuilt,\n checksum,\n version: params.version,\n description: params.description\n };\n\n const bundle: IBundle = {\n metadata,\n config,\n compiledCollection\n };\n\n return succeed(bundle);\n });\n });\n });\n });\n }\n\n /**\n * Creates a resource bundle from a ResourceManagerBuilder using a predefined system configuration.\n * This is a convenience method for the common case of using predefined configurations.\n * @param builder - The ResourceManagerBuilder containing the resources to bundle\n * @param configName - The name of the predefined system configuration used\n * @param params - Optional parameters for bundle creation\n * @returns Success with the created bundle if successful, Failure with error message otherwise\n * @public\n */\n public static createFromPredefined(\n builder: ResourceManagerBuilder,\n configName: PredefinedSystemConfiguration,\n params?: IBundleCreateParams\n ): Result<IBundle> {\n /* c8 ignore next 1 */\n params = params ?? {};\n const hashNormalizer = params.hashNormalizer ?? new Hash.Crc32Normalizer();\n\n // Determine which builder to use based on normalization setting\n const builderToUse = params.normalize\n ? BundleNormalizer.normalizeFromPredefined(builder, configName)\n : succeed(builder);\n\n return builderToUse.onSuccess((targetBuilder) => {\n return getPredefinedSystemConfiguration(configName).onSuccess((systemConfig) => {\n return systemConfig.getConfig().onSuccess((config) => {\n return targetBuilder.getCompiledResourceCollection().onSuccess((compiledCollection) => {\n return BundleBuilder._generateChecksum(compiledCollection, hashNormalizer).onSuccess(\n (checksum) => {\n /* c8 ignore next 1 - defense in depth */\n const dateBuilt = params.dateBuilt ?? new Date().toISOString();\n\n const metadata: IBundleMetadata = {\n dateBuilt,\n checksum,\n version: params.version,\n /* c8 ignore next 1 - defense in depth */\n description: params?.description\n };\n\n const bundle: IBundle = {\n metadata,\n config,\n compiledCollection\n };\n\n return succeed(bundle);\n }\n );\n });\n });\n });\n });\n }\n\n /**\n * Generates a hash checksum for the compiled resource collection.\n * The checksum is calculated using the provided hash normalizer.\n * @param compiledCollection - The compiled resource collection to generate checksum for\n * @param hashNormalizer - The hash normalizer to use for checksum generation\n * @returns Success with the checksum string if successful, Failure otherwise\n * @internal\n */\n private static _generateChecksum(\n compiledCollection: unknown,\n hashNormalizer: Hash.HashingNormalizer\n ): Result<string> {\n return hashNormalizer.computeHash(compiledCollection);\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundleLoader.js","sourceRoot":"","sources":["../../../src/packlets/bundle/bundleLoader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAU,OAAO,EAAE,IAAI,EAAe,IAAI,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAoB,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AA6BhD;;;;GAIG;AACH,MAAM,OAAO,YAAY;IACvB;;;;;OAKG;IACI,MAAM,CAAC,uBAAuB,CAAC,MAAiC;;QACrE,yCAAyC;QACzC,MAAM,cAAc,GAAG,MAAA,MAAM,CAAC,cAAc,mCAAI,IAAI,IAAI,CAAC,eAAe,E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MAAM,CAAC,CAAC;IACnD,CAAC;IAED;;;;;;;OAOG;IACK,MAAM,CAAC,iCAAiC,CAC9C,MAAe,EACf,cAAqE,EACrE,aAAmE;QAEnE,OAAO,0BAA0B,CAAC,MAAM,CAAC;YACvC,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;YAC7C,cAAc;YACd,aAAa;SACd,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result, succeed, fail, Collections, Hash } from '@fgv/ts-utils';\nimport { CompiledResourceCollection, IResourceManager } from '../runtime';\nimport { SystemConfiguration } from '../config';\nimport { ResourceType } from '../resource-types';\nimport { QualifierType } from '../qualifier-types';\nimport { IBundle } from './model';\n\n/**\n * Parameters for creating a BundleLoader.\n * @public\n */\nexport interface IBundleLoaderCreateParams {\n /**\n * The bundle to load.\n */\n bundle: IBundle;\n\n /**\n * Whether to skip checksum verification during loading.\n * Default is false - checksum verification is performed.\n */\n skipChecksumVerification?: boolean;\n\n /**\n * Optional hash normalizer for verifying checksums. If not provided,\n * a CRC32 normalizer will be used for browser compatibility.\n * Must match the normalizer used during bundle creation.\n */\n hashNormalizer?: Hash.HashingNormalizer;\n}\n\n/**\n * Loader for creating an IResourceManager from a resource bundle.\n * Handles integrity verification and reconstruction of the runtime resource manager.\n * @public\n */\nexport class BundleLoader {\n /**\n * Creates an IResourceManager from a resource bundle.\n * @param params - Parameters for bundle loading including the bundle and options\n * @returns Success with the IResourceManager if successful, Failure with error message otherwise\n * @public\n */\n public static createManagerFromBundle(params: IBundleLoaderCreateParams): Result<IResourceManager> {\n /* c8 ignore next 1 - defense in depth */\n const hashNormalizer = params.hashNormalizer ?? new Hash.Crc32Normalizer();\n\n return BundleLoader._verifyBundleIntegrity(\n params.bundle,\n params.skipChecksumVerification ?? false,\n hashNormalizer\n ).onSuccess(() => {\n return BundleLoader._createSystemConfiguration(params.bundle).onSuccess((systemConfig) => {\n return BundleLoader._createCompiledResourceCollection(\n params.bundle,\n systemConfig.qualifierTypes,\n systemConfig.resourceTypes\n );\n });\n });\n }\n\n /**\n * Verifies the integrity of a bundle by checking its checksum.\n * @param bundle - The bundle to verify\n * @param skipVerification - Whether to skip verification\n * @param hashNormalizer - The hash normalizer to use for verification\n * @returns Success if verification passes or is skipped, Failure otherwise\n * @internal\n */\n private static _verifyBundleIntegrity(\n bundle: IBundle,\n skipVerification: boolean,\n hashNormalizer: Hash.HashingNormalizer\n ): Result<boolean> {\n if (skipVerification) {\n return succeed(true);\n }\n\n return BundleLoader._generateChecksum(bundle.compiledCollection, hashNormalizer).onSuccess(\n (calculatedChecksum) => {\n if (calculatedChecksum !== bundle.metadata.checksum) {\n return fail(\n `Bundle integrity verification failed: expected checksum ${bundle.metadata.checksum}, got ${calculatedChecksum}`\n );\n }\n return succeed(true);\n }\n );\n }\n\n /**\n * Generates a hash checksum for the compiled resource collection.\n * @param compiledCollection - The compiled resource collection to generate checksum for\n * @param hashNormalizer - The hash normalizer to use for checksum generation\n * @returns Success with the checksum string if successful, Failure otherwise\n * @internal\n */\n private static _generateChecksum(\n compiledCollection: unknown,\n hashNormalizer: Hash.HashingNormalizer\n ): Result<string> {\n return hashNormalizer.computeHash(compiledCollection);\n }\n\n /**\n * Creates a SystemConfiguration from the bundle's configuration.\n * @param bundle - The bundle containing the configuration\n * @returns Success with the SystemConfiguration if successful, Failure otherwise\n * @internal\n */\n private static _createSystemConfiguration(bundle: IBundle): Result<SystemConfiguration> {\n return SystemConfiguration.create(bundle.config);\n }\n\n /**\n * Creates a CompiledResourceCollection from the bundle.\n * @param bundle - The bundle to load\n * @param qualifierTypes - The qualifier type collector from the system configuration\n * @param resourceTypes - The resource type collector from the system configuration\n * @returns Success with the CompiledResourceCollection if successful, Failure otherwise\n * @internal\n */\n private static _createCompiledResourceCollection(\n bundle: IBundle,\n qualifierTypes: Collections.IReadOnlyResultMap<string, QualifierType>,\n resourceTypes: Collections.IReadOnlyResultMap<string, ResourceType>\n ): Result<CompiledResourceCollection> {\n return CompiledResourceCollection.create({\n compiledCollection: bundle.compiledCollection,\n qualifierTypes,\n resourceTypes\n });\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundleNormalizer.js","sourceRoot":"","sources":["../../../src/packlets/bundle/bundleNormalizer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAU,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAExD;;;;;;;;GAQG;AACH,MAAM,OAAO,gBAAgB;IAC3B;;;;;;;;OAQG;IACI,MAAM,CAAC,SAAS,CACrB,eAAuC,EACvC,YAAiC;QAEjC,6DAA6D;QA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C,CAAC;QACnE,CAAC;QAED,OAAO,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;;;;OAQG;IACK,MAAM,CAAC,uBAAuB,CACpC,eAAuC,EACvC,iBAAyC;QAEzC,OAAO,gBAAgB,CAAC,oBAAoB,CAAC,eAAe,EAAE,iBAAiB,CAAC;aAC7E,SAAS,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;aAC7F,SAAS,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAChG,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result, succeed, MessageAggregator } from '@fgv/ts-utils';\nimport { ResourceManagerBuilder } from '../resources';\nimport { ResourceCandidate } from '../resources';\nimport { SystemConfiguration, PredefinedSystemConfiguration } from '../config';\nimport { Condition, ConditionSet } from '../conditions';\n\n/**\n * Normalizes ResourceManagerBuilder instances to ensure consistent ordering\n * of internal entities, enabling order-independent bundle checksums.\n *\n * The normalization process rebuilds the ResourceManagerBuilder from the ground up\n * in a canonical order to ensure identical index assignments regardless of\n * original construction order.\n * @public\n */\nexport class BundleNormalizer {\n /**\n * Creates a normalized ResourceManagerBuilder from an existing builder.\n * The normalized builder will have identical entities but arranged in\n * canonical order to ensure consistent index assignments.\n *\n * @param originalBuilder - The ResourceManagerBuilder to normalize\n * @param systemConfig - The SystemConfiguration used to create the original builder\n * @returns Success with the normalized ResourceManagerBuilder if successful, Failure otherwise\n */\n public static normalize(\n originalBuilder: ResourceManagerBuilder,\n systemConfig: SystemConfiguration\n ): Result<ResourceManagerBuilder> {\n // Create a fresh builder using the same system configuration\n return ResourceManagerBuilder.create({\n qualifiers: systemConfig.qualifiers,\n resourceTypes: systemConfig.resourceTypes\n }).onSuccess((normalizedBuilder) => {\n return BundleNormalizer._addNormalizedResources(originalBuilder, normalizedBuilder).onSuccess(() =>\n succeed(normalizedBuilder)\n );\n });\n }\n\n /**\n * Creates a normalized ResourceManagerBuilder using a predefined system configuration.\n * This is a convenience method for the common case of using predefined configurations.\n *\n * @param originalBuilder - The ResourceManagerBuilder to normalize\n * @param configName - The name of the predefined system configuration used\n * @returns Success with the normalized ResourceManagerBuilder if successful, Failure otherwise\n */\n public static normalizeFromPredefined(\n originalBuilder: ResourceManagerBuilder,\n configName: PredefinedSystemConfiguration\n ): Result<ResourceManagerBuilder> {\n return ResourceManagerBuilder.createPredefined(configName).onSuccess((normalizedBuilder) => {\n return BundleNormalizer._addNormalizedResources(originalBuilder, normalizedBuilder).onSuccess(() =>\n succeed(normalizedBuilder)\n );\n });\n }\n\n /**\n * Normalizes all conditions from the original builder by adding them to the\n * normalized builder in sorted order using loose condition declarations.\n *\n * @param originalBuilder - The source ResourceManagerBuilder\n * @param normalizedBuilder - The target normalized ResourceManagerBuilder\n * @returns Success if all conditions were normalized successfully, Failure otherwise\n * @internal\n */\n private static _normalizeConditions(\n originalBuilder: ResourceManagerBuilder,\n normalizedBuilder: ResourceManagerBuilder\n ): Result<boolean> {\n const conditions = Array.from(originalBuilder.conditions.values()).sort(Condition.compare);\n\n const errors = new MessageAggregator();\n for (const condition of conditions) {\n const looseDecl = condition.toLooseConditionDecl();\n normalizedBuilder.addCondition(looseDecl).aggregateError(errors);\n }\n\n return errors.returnOrReport(succeed(true));\n }\n\n /**\n * Normalizes all condition sets from the original builder by adding them to the\n * normalized builder in sorted order using loose condition set declarations.\n *\n * @param originalBuilder - The source ResourceManagerBuilder\n * @param normalizedBuilder - The target normalized ResourceManagerBuilder\n * @returns Success if all condition sets were normalized successfully, Failure otherwise\n * @internal\n */\n private static _normalizeConditionSets(\n originalBuilder: ResourceManagerBuilder,\n normalizedBuilder: ResourceManagerBuilder\n ): Result<boolean> {\n const conditionSets = Array.from(originalBuilder.conditionSets.values()).sort(ConditionSet.compare);\n\n const errors = new MessageAggregator();\n for (const conditionSet of conditionSets) {\n const conditions = conditionSet.toConditionSetArrayDecl();\n normalizedBuilder.addConditionSet(conditions).aggregateError(errors);\n }\n\n return errors.returnOrReport(succeed(true));\n }\n\n /**\n * Normalizes all candidates by sorting them first by resource ID, then by condition set.\n *\n * @param originalBuilder - The source ResourceManagerBuilder\n * @param normalizedBuilder - The target normalized ResourceManagerBuilder\n * @returns Success if all candidates were normalized successfully, Failure otherwise\n * @internal\n */\n private static _normalizeCandidates(\n originalBuilder: ResourceManagerBuilder,\n normalizedBuilder: ResourceManagerBuilder\n ): Result<boolean> {\n const candidates = Array.from(originalBuilder.getAllCandidates()).sort((c1, c2) => {\n const idCompare = c1.id.localeCompare(c2.id);\n return idCompare !== 0 ? idCompare : ResourceCandidate.compare(c1, c2);\n });\n\n const errors = new MessageAggregator();\n for (const candidate of candidates) {\n const decl = candidate.toLooseResourceCandidateDecl();\n normalizedBuilder.addLooseCandidate(decl).aggregateError(errors);\n }\n\n return errors.returnOrReport(succeed(true));\n }\n\n /**\n * Adds normalized resources to the target builder by first normalizing conditions,\n * then condition sets, then candidates.\n *\n * @param originalBuilder - The source ResourceManagerBuilder\n * @param normalizedBuilder - The target normalized ResourceManagerBuilder\n * @returns Success if all resources were added successfully, Failure otherwise\n * @internal\n */\n private static _addNormalizedResources(\n originalBuilder: ResourceManagerBuilder,\n normalizedBuilder: ResourceManagerBuilder\n ): Result<boolean> {\n return BundleNormalizer._normalizeConditions(originalBuilder, normalizedBuilder)\n .onSuccess(() => BundleNormalizer._normalizeConditionSets(originalBuilder, normalizedBuilder))\n .onSuccess(() => BundleNormalizer._normalizeCandidates(originalBuilder, normalizedBuilder));\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundleUtils.js","sourceRoot":"","sources":["../../../src/packlets/bundle/bundleUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAU,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGhD,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,WAAW,CAAC;AAuBtD;;;;GAIG;AACH,MAAM,OAAO,WAAW;IACtB;;;;;;OAMG;IACI,MAAM,CAAC,YAAY,CAAC,IAAa;QACtC,OAAO,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;IACnD,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,uBAAuB,CAAC,UAAmB;QACvD,OAAO,eAAe;aACnB,OAAO,CAAC,UAAU,CAAC;aACnB,eAAe,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,6BAA6B,GAAG,EAAE,CAAC;aAC5D,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE;YACpB,OAAO,mBAAmB,CAAC,MAAM,CAAC,MAAM,CA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QAAQ,CAAC,cAAc,CAAC;YAClC,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC;YAClC,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC;YAClC,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAC9D,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result, succeed, fail } from '@fgv/ts-utils';\nimport { SystemConfiguration } from '../config';\nimport { Compiled as ResourceJsonCompiled } from '../resource-json';\nimport { IBundleMetadata } from './model';\nimport { bundle as bundleConverter } from './convert';\n\n/**\n * Components extracted from a bundle for reuse in different contexts.\n * @public\n */\nexport interface IBundleComponents {\n /**\n * The system configuration from the bundle.\n */\n systemConfiguration: SystemConfiguration;\n\n /**\n * The compiled resource collection from the bundle.\n */\n compiledCollection: ResourceJsonCompiled.ICompiledResourceCollection;\n\n /**\n * The bundle metadata including build information.\n */\n metadata: IBundleMetadata;\n}\n\n/**\n * Utility functions for working with resource bundles.\n * Provides reusable logic for bundle detection, parsing, and component extraction.\n * @public\n */\nexport class BundleUtils {\n /**\n * Checks if the given object appears to be a bundle file by examining its structure.\n * This is a lightweight check that doesn't perform full validation.\n * @param data - The data to check\n * @returns True if the data appears to be a bundle structure\n * @public\n */\n public static isBundleFile(data: unknown): boolean {\n return bundleConverter.convert(data).isSuccess();\n }\n\n /**\n * Extracts and validates components from a bundle for reuse.\n * Performs full validation of the bundle structure and creates typed components.\n * @param bundleData - The raw bundle data to extract components from\n * @returns Success with bundle components if valid, Failure with error message otherwise\n * @public\n */\n public static extractBundleComponents(bundleData: unknown): Result<IBundleComponents> {\n return bundleConverter\n .convert(bundleData)\n .withErrorFormat((err) => `Invalid bundle structure: ${err}`)\n .onSuccess((bundle) => {\n return SystemConfiguration.create(bundle.config)\n .withErrorFormat((err) => `Invalid system configuration in bundle: ${err}`)\n .onSuccess((systemConfiguration) => {\n return succeed({\n systemConfiguration,\n compiledCollection: bundle.compiledCollection,\n metadata: bundle.metadata\n });\n });\n });\n }\n\n /**\n * Extracts just the metadata from potential bundle data without full validation.\n * Useful for displaying bundle information without processing the entire bundle.\n * @param data - The data to extract metadata from\n * @returns Success with metadata if found and valid, Failure otherwise\n * @public\n */\n public static extractBundleMetadata(data: unknown): Result<IBundleMetadata> {\n return bundleConverter\n .convert(data)\n .onSuccess((bundle) => {\n return succeed(bundle.metadata);\n })\n .withErrorFormat((err) => {\n return `Not a bundle file: ${err}`;\n });\n }\n\n /**\n * Parses bundle data from a JSON string.\n * Convenience method that combines JSON parsing with bundle component extraction.\n * @param jsonString - The JSON string containing bundle data\n * @returns Success with bundle components if valid, Failure with error message otherwise\n * @public\n */\n public static parseBundleFromJson(jsonString: string): Result<IBundleComponents> {\n try {\n const data = JSON.parse(jsonString);\n return BundleUtils.extractBundleComponents(data);\n } catch (error) {\n /* c8 ignore next 1 - defense in depth */\n return fail(`Failed to parse JSON: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n /**\n * Checks if a file name suggests it might be a bundle file.\n * This is a heuristic check based on file naming conventions.\n * @param fileName - The file name to check\n * @returns True if the file name suggests a bundle file\n * @public\n */\n public static isBundleFileName(fileName: string): boolean {\n const lowerName = fileName.toLowerCase();\n return (\n lowerName.endsWith('.bundle.json') ||\n lowerName.endsWith('-bundle.json') ||\n lowerName.endsWith('_bundle.json') ||\n (lowerName.includes('bundle') && lowerName.endsWith('.json'))\n );\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../src/packlets/bundle/convert.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAa,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,QAAQ,IAAI,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGpE;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAA+B,UAAU,CAAC,YAAY,CAAkB;IACjG,SAAS,EAAE,UAAU,CAAC,MAAM;IAC5B,QAAQ,EAAE,UAAU,CAAC,MAAM;IAC3B,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE;IACrC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,UAAU,CAAC,YAAY,CAAwB;IAC7C,UAAU,EAAE,UAAU,CAAC,MAAM;IAC7B,YAAY,EAAE,UAAU,CAAC,MAAM;IAC/B,IAAI,EAAE,UAAU,CAAC,MAAM;IACvB,aAAa,EAAE,cAAc,CAAC,UAAU,CAAC,QAAQ,EAAE;CACpD,CAAC,CAAC;AAEL;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAuB,UAAU,CAAC,YAAY,CAAU;IACzE,QAAQ,EAAE,cAAc;IACxB,MAAM,EAAE,aAAa,CAAC,mBAAmB;IACzC,kBAAkB,EAAE,oBAAoB,CAAC,OAAO,CAAC,0BAA0B;IAC3E,cAAc,EAAE,oBAAoB,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAC7B,UAAU,CAAC,YAAY,CAAsB;IAC3C,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE;IACrC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE;IACzC,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAEL;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAIvB,UAAU,CAAC,YAAY,CAAC;IAC3B,QAAQ,EAAE,cAAc;IACxB,MAAM,EAAE,cAAc,CAAC,SAAS;IAChC,kBAAkB,EAAE,cAAc,CAAC,SAAS;CAC7C,CAAC,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Converter, Converters } from '@fgv/ts-utils';\nimport { Converters as JsonConverters } from '@fgv/ts-json-base';\nimport { Convert as ConfigConvert } from '../config';\nimport { Compiled as ResourceJsonCompiled } from '../resource-json';\nimport { IBundleMetadata, IBundleExportMetadata, IBundle, IBundleCreateParams } from './model';\n\n/**\n * `Converter` for a {@link Bundle.IBundleMetadata | bundle metadata} object.\n * @public\n */\nexport const bundleMetadata: Converter<IBundleMetadata> = Converters.strictObject<IBundleMetadata>({\n dateBuilt: Converters.string,\n checksum: Converters.string,\n version: Converters.string.optional(),\n description: Converters.string.optional()\n});\n\n/**\n * `Converter` for {@link Bundle.IBundleExportMetadata | bundle export metadata}.\n * @public\n */\nexport const bundleExportMetadata: Converter<IBundleExportMetadata> =\n Converters.strictObject<IBundleExportMetadata>({\n exportedAt: Converters.string,\n exportedFrom: Converters.string,\n type: Converters.string,\n filterContext: JsonConverters.jsonObject.optional()\n });\n\n/**\n * `Converter` for a {@link Bundle.IBundle | bundle} object.\n * @public\n */\nexport const bundle: Converter<IBundle> = Converters.strictObject<IBundle>({\n metadata: bundleMetadata,\n config: ConfigConvert.systemConfiguration,\n compiledCollection: ResourceJsonCompiled.Convert.compiledResourceCollection,\n exportMetadata: bundleExportMetadata.optional()\n});\n\n/**\n * `Converter` for {@link Bundle.IBundleCreateParams | bundle creation parameters}.\n * @public\n */\nexport const bundleCreateParams: Converter<IBundleCreateParams> =\n Converters.strictObject<IBundleCreateParams>({\n version: Converters.string.optional(),\n description: Converters.string.optional(),\n dateBuilt: Converters.string.optional()\n });\n\n/**\n * Lightweight converter for bundle structure validation without full processing.\n * Useful for detecting bundle files without the overhead of full validation.\n * @public\n */\nexport const bundleStructure: Converter<{\n metadata: IBundleMetadata;\n config: unknown;\n compiledCollection: unknown;\n}> = Converters.strictObject({\n metadata: bundleMetadata,\n config: JsonConverters.jsonValue,\n compiledCollection: JsonConverters.jsonValue\n});\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/bundle/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;;;;GAQG;AAEH,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAKrC,6BAA6B;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,YAAY;AACZ,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAE1B,8CAA8C;AAC9C,gBAAgB;AAChB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * Bundle packlet providing functionality for creating and loading resource bundles.\n *\n * Resource bundles encapsulate compiled resources, configuration, and metadata with\n * integrity verification. They provide a portable way to distribute pre-compiled\n * resource collections.\n *\n * @packageDocumentation\n */\n\nimport * as Model from './model';\nimport * as Convert from './convert';\n\n// Model interfaces\nexport type { IBundleMetadata, IBundleExportMetadata, IBundle, IBundleCreateParams } from './model';\n\n// Builder and loader classes\nexport { BundleBuilder } from './bundleBuilder';\nexport { BundleLoader } from './bundleLoader';\nexport type { IBundleLoaderCreateParams } from './bundleLoader';\n\n// Utilities\nexport { BundleUtils } from './bundleUtils';\nexport type { IBundleComponents } from './bundleUtils';\n\nexport { Model, Convert };\n\n// Internal utilities (not part of public API)\n/** @internal */\nexport { BundleNormalizer } from './bundleNormalizer';\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/packlets/bundle/model.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 { Hash } from '@fgv/ts-utils';\nimport { Model as ConfigModel } from '../config';\nimport { Compiled as ResourceJsonCompiled } from '../resource-json';\n\n/**\n * Metadata for a resource bundle, including build information and integrity verification.\n * @public\n */\nexport interface IBundleMetadata {\n /**\n * ISO timestamp indicating when the bundle was built.\n */\n dateBuilt: string;\n\n /**\n * SHA-256 checksum of the serialized compiled resource collection for integrity verification.\n */\n checksum: string;\n\n /**\n * Optional version identifier for the bundle.\n */\n version?: string;\n\n /**\n * Optional human-readable description of the bundle.\n */\n description?: string;\n}\n\n/**\n * Optional export metadata for tracking bundle export information.\n * @public\n */\nexport interface IBundleExportMetadata {\n /**\n * ISO timestamp indicating when the bundle was exported.\n */\n exportedAt: string;\n\n /**\n * Tool or application that exported the bundle.\n */\n exportedFrom: string;\n\n /**\n * Type of bundle export (e.g., 'ts-res-bundle', 'ts-res-bundle-filtered').\n */\n type: string;\n\n /**\n * Optional filter context if the bundle represents filtered data.\n */\n filterContext?: Record<string, unknown>;\n}\n\n/**\n * A complete resource bundle that encapsulates built resources, configuration, and metadata.\n * Bundles provide a portable, integrity-verified way to distribute pre-compiled resource collections.\n * @public\n */\nexport interface IBundle {\n /**\n * Metadata about the bundle including build date and integrity checksum.\n */\n metadata: IBundleMetadata;\n\n /**\n * The system configuration that was used to build the resources in this bundle.\n */\n config: ConfigModel.ISystemConfiguration;\n\n /**\n * The compiled resource collection containing all resources, conditions, and decisions.\n */\n compiledCollection: ResourceJsonCompiled.ICompiledResourceCollection;\n\n /**\n * Optional export metadata for tracking when and how the bundle was exported.\n */\n exportMetadata?: IBundleExportMetadata;\n}\n\n/**\n * Optional parameters for bundle creation.\n * @public\n */\nexport interface IBundleCreateParams {\n /**\n * Optional version identifier to include in the bundle metadata.\n */\n version?: string;\n\n /**\n * Optional description to include in the bundle metadata.\n */\n description?: string;\n\n /**\n * Optional custom build date. If not provided, the current date will be used.\n */\n dateBuilt?: string;\n\n /**\n * Optional hash normalizer for generating checksums. If not provided,\n * a CRC32 normalizer will be used for browser compatibility.\n */\n hashNormalizer?: Hash.HashingNormalizer;\n\n /**\n * Whether to normalize the ResourceManagerBuilder before bundle creation.\n * When true, the builder is reconstructed in canonical order to ensure\n * order-independent checksums. Defaults to false for Phase 1 compatibility.\n */\n normalize?: boolean;\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../src/packlets/common/conditions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AA2DH;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAwB,GAA0B,CAAC;AAEvE;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAwB,GAA0B,CAAC;AAQ5E;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAsB,CAAsB,CAAC;AAE9E;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAsB,IAAyB,CAAC;AAQjF;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAwB,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Brand } from '@fgv/ts-utils';\n\n/**\n * Branded string representing a validated qualifier name.\n * @public\n */\nexport type QualifierName = Brand<string, 'QualifierName'>;\n\n/**\n * Branded number representing a validated qualifier index.\n * @public\n */\nexport type QualifierIndex = Brand<number, 'QualifierIndex'>;\n\n/**\n * Branded string representing a validated qualifier type name.\n * @public\n */\nexport type QualifierTypeName = Brand<string, 'QualifierTypeName'>;\n\n/**\n * Branded number representing a validated qualifier type index.\n * @public\n */\nexport type QualifierTypeIndex = Brand<number, 'QualifierTypeIndex'>;\n\n/**\n * Branded type for a validated qualifier condition value - i.e. a value\n * that has been determined to be valid for use in a condition attached\n * to some resource.\n *\n * @example\n * For a language qualifier type, it is likely that a single language\n * tag can be used for either a condition or a context value. However,\n * a list of languages would likely only be valid as a context value.\n * @public\n */\nexport type QualifierConditionValue = Brand<string, 'QualifierConditionValue'>;\n\n/**\n * Branded type for a validated qualifier context value - i.e. a value\n * that has been determined to be valid for use in some runtime context.\n * @example\n * For a language qualifier type, it is likely that a single language\n * tag can be used for either a condition or a context value. However,\n * a list of languages would likely only be valid as a context value.\n * @public\n */\nexport type QualifierContextValue = Brand<string, 'QualifierContextValue'>;\n\n/**\n * Branded number representing a score in the range 0.0 (no match) .. 1.0 (perfect match)\n * which results from evaluating some condition.\n * @public\n */\nexport type QualifierMatchScore = Brand<number, 'QualifierMatchScore'>;\n\n/**\n * {@link QualifierMatchScore | Match score} indicating no match.\n * @public\n */\nexport const NoMatch: QualifierMatchScore = 0.0 as QualifierMatchScore;\n\n/**\n * {@link QualifierMatchScore | Match score} indicating a perfect match.\n * @public\n */\nexport const PerfectMatch: QualifierMatchScore = 1.0 as QualifierMatchScore;\n\n/**\n * Branded number representing a validated condition priority.\n * @public\n */\nexport type ConditionPriority = Brand<number, 'ConditionPriority'>;\n\n/**\n * Minimum valid priority for a condition.\n * @public\n */\nexport const MinConditionPriority: ConditionPriority = 0 as ConditionPriority;\n\n/**\n * Maximum valid priority for a condition.\n * @public\n */\nexport const MaxConditionPriority: ConditionPriority = 1000 as ConditionPriority;\n\n/**\n * Condition operators for use in conditions.\n * @public\n */\nexport type ConditionOperator = 'always' | 'never' | 'matches';\n\n/**\n * Array of all valid condition operators.\n * @public\n */\nexport const allConditionOperators: ConditionOperator[] = ['always', 'never', 'matches'];\n\n/**\n * Branded number representing a validated condition index.\n * @public\n */\nexport type ConditionIndex = Brand<number, 'ConditionIndex'>;\n\n/**\n * A branded string representing a validated condition key. A condition key is a\n * string value which fully describes the condition apart from index. The condition\n * key can be used to quickly determine if two conditions are identical apart from\n * index, or for inspection.\n * @public\n */\nexport type ConditionKey = Brand<string, 'ConditionKey'>;\n\n/**\n * A string representing a validated condition token. Condition tokens are\n * typically extracted from the name of some resource (e.g. file or folder)\n * being imported. A condition token has the form `<qualifierName>=<value>`\n * or `<value>`.\n * @public\n */\nexport type ConditionToken = Brand<string, 'ConditionToken'>;\n\n/**\n * Branded number representing a validated condition set index.\n * @public\n */\nexport type ConditionSetIndex = Brand<number, 'ConditionSetIndex'>;\n\n/**\n * Branded string representing a validated condition set key. A condition set key\n * is a string value which fully describes the condition set apart from index. The\n * condition set key can be used to quickly determine if two condition sets are\n * identical apart from index, or for inspection.\n * @public\n */\nexport type ConditionSetKey = Brand<string, 'ConditionSetKey'>;\n\n/**\n * A string representing a validated condition set token. Condition set tokens are\n * typically extracted from the name of some resource (e.g. file or folder) being\n * imported. A condition set token is a comma-separated list of one or more\n * {@link ConditionToken | condition tokens}, where a condition token has either\n * the form `<qualifierName>=<value>` or `<value>`.\n * @public\n */\nexport type ConditionSetToken = Brand<string, 'ConditionSetToken'>;\n\n/**\n * Branded string representing a hash value for a condition set. The hash value\n * is an 8-character string derived from the crc32 hash of the condition set key\n * and is used to quickly and compactly identify a condition set or compare for\n * equality.\n * @public\n */\nexport type ConditionSetHash = Brand<string, 'ConditionSetHash'>;\n\n/**\n * Branded string representing a validated decision key. A decision key is a string\n * value which fully describes the decision apart from index. The decision key can\n * be used to quickly determine if two decisions are identical apart from index.\n * @public\n */\nexport type DecisionKey = Brand<string, 'DecisionKey'>;\n\n/**\n * Branded number representing a validated decision index.\n * @public\n */\nexport type DecisionIndex = Brand<number, 'DecisionIndex'>;\n\n/**\n * A string representing a validated context qualifier token. Context qualifier tokens are used\n * for filtering resources by context criteria. A context qualifier token has the form\n * `<qualifierName>=<value>` or `<value>`.\n * @public\n */\nexport type ContextQualifierToken = Brand<string, 'ContextQualifierToken'>;\n\n/**\n * A string representing a validated context token. Context tokens are\n * pipe-separated lists of one or more context qualifier tokens. Uses \"|\" as separator\n * to avoid conflicts with comma-separated values within context values.\n * Example: \"language=en-US,de-DE|territory=US|role=admin\"\n * @public\n */\nexport type ContextToken = Brand<string, 'ContextToken'>;\n\n/**\n * A string representing a single qualifier default value assignment.\n * Format: \"qualifierName=defaultValue\" or \"qualifierName=\" (to remove default)\n * Example: \"language=en-US,en-CA\" or \"territory=US\"\n * @public\n */\nexport type QualifierDefaultValueToken = Brand<string, 'QualifierDefaultValueToken'>;\n\n/**\n * A string representing a validated qualifier default values token. Default value tokens are\n * pipe-separated lists of one or more qualifier default value tokens. Uses \"|\" as separator\n * to avoid conflicts with comma-separated values within default values.\n * Example: \"language=en-US,en-CA|territory=US|device=desktop,tablet\"\n * @public\n */\nexport type QualifierDefaultValuesToken = Brand<string, 'QualifierDefaultValuesToken'>;\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../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QAAQ,CAAC,6BAA6B,CAAC,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Converters } from '@fgv/ts-utils';\nimport * as Validate from './validate';\nimport { allConditionOperators } from './conditions';\nimport { allResourceValueMergeMethods } from './resources';\n\n/* eslint-disable @rushstack/typedef-var */\n\n/**\n * `Converter` which validates an `unknown` value as a {@link QualifierName | QualifierName}.\n * @public\n */\nexport const qualifierName = Converters.string.map(Validate.toQualifierName);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link QualifierIndex | QualifierIndex}.\n * @public\n */\nexport const qualifierIndex = Converters.number.map(Validate.toQualifierIndex);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link QualifierTypeName | QualifierTypeName}.\n * @public\n */\nexport const qualifierTypeName = Converters.string.map(Validate.toQualifierTypeName);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link QualifierTypeIndex | QualifierTypeIndex}.\n * @public\n */\nexport const qualifierTypeIndex = Converters.number.map(Validate.toQualifierTypeIndex);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link QualifierContextValue | QualifierContextValue}.\n * @public\n */\nexport const qualifierContextValue = Converters.string.map(Validate.toQualifierContextValue);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link QualifierConditionValue | QualifierConditionValue}.\n * @public\n */\nexport const qualifierMatchScore = Converters.number.map(Validate.toQualifierMatchScore);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link ConditionPriority | ConditionPriority}.\n * @public\n */\nexport const conditionPriority = Converters.number.map(Validate.toConditionPriority);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link ConditionOperator | ConditionOperator}.\n * @public\n */\nexport const conditionOperator = Converters.enumeratedValue(allConditionOperators);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link ConditionIndex | ConditionIndex}.\n * @public\n */\nexport const conditionIndex = Converters.number.map(Validate.toConditionIndex);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link ConditionKey | ConditionKey}.\n * @public\n */\nexport const conditionKey = Converters.string.map(Validate.toConditionKey);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link ConditionToken | ConditionToken}.\n * @public\n */\nexport const conditionToken = Converters.string.map(Validate.toConditionToken);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link ConditionSetIndex | ConditionSetIndex}.\n * @public\n */\nexport const conditionSetIndex = Converters.number.map(Validate.toConditionSetIndex);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link ConditionSetKey | ConditionSetKey}.\n * @public\n */\nexport const conditionSetKey = Converters.string.map(Validate.toConditionSetKey);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link ConditionSetToken | ConditionSetToken}.\n * @public\n */\nexport const conditionSetToken = Converters.string.map(Validate.toConditionSetToken);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link ConditionSetHash | ConditionSetHash}.\n * @public\n */\nexport const conditionSetHash = Converters.string.map(Validate.toConditionSetHash);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link DecisionIndex | DecisionIndex}.\n * @public\n */\nexport const decisionIndex = Converters.number.map(Validate.toDecisionIndex);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link DecisionKey | DecisionKey}.\n * @public\n */\nexport const decisionKey = Converters.string.map(Validate.toDecisionKey);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link ResourceId | ResourceId}.\n * @public\n */\nexport const resourceId = Converters.string.map(Validate.toResourceId);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link ResourceName | ResourceName}.\n * @public\n */\nexport const resourceName = Converters.string.map(Validate.toResourceName);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link ResourceIndex | ResourceIndex}.\n * @public\n */\nexport const resourceIndex = Converters.number.map(Validate.toResourceIndex);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link ResourceTypeName | ResourceTypeName}.\n * @public\n */\nexport const resourceTypeName = Converters.string.map(Validate.toResourceTypeName);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link ResourceTypeIndex | ResourceTypeIndex}.\n * @public\n */\nexport const resourceTypeIndex = Converters.number.map(Validate.toResourceTypeIndex);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link CandidateValueKey | CandidateValueKey}.\n * @public\n */\nexport const candidateValueKey = Converters.string.map(Validate.toCandidateValueKey);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link CandidateValueIndex | CandidateValueIndex}.\n * @public\n */\nexport const candidateValueIndex = Converters.number.map(Validate.toCandidateValueIndex);\n\n/**\n * `Converter` for a resource value merge method.\n * @public\n */\nexport const resourceValueMergeMethod = Converters.enumeratedValue(allResourceValueMergeMethods);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link ContextQualifierToken | ContextQualifierToken}.\n * @public\n */\nexport const contextQualifierToken = Converters.string.map(Validate.toContextQualifierToken);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link ContextToken | ContextToken}.\n * @public\n */\nexport const contextToken = Converters.string.map(Validate.toContextToken);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link QualifierDefaultValueToken | QualifierDefaultValueToken}.\n * @public\n */\nexport const qualifierDefaultValueToken = Converters.string.map(Validate.toQualifierDefaultValueToken);\n\n/**\n * `Converter` which validates an `unknown` value as a {@link QualifierDefaultValuesToken | QualifierDefaultValuesToken}.\n * @public\n */\nexport const qualifierDefaultValuesToken = Converters.string.map(Validate.toQualifierDefaultValuesToken);\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/packlets/common/helpers/conditions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,UAAU,EAAU,OAAO,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AAYxC;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAE,SAAS,EAAE,KAAK,EAAwB;IAC5E,OAAO,QAAQ,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAChF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CACpC,KAA0C;IAE1C,OAAO,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CACrE,QAAQ,CAAC,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAC/C,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAa;IACpD,OAAO,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;QACtD,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC3B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CAAC,KAAa;IACvD,OAAO,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,CAAC;AACpE,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { mapResults, Result, succeed } from '@fgv/ts-utils';\nimport * as Validate from '../validate';\nimport { ConditionSetToken, ConditionToken } from '../conditions';\n\n/**\n * The values needed to create a {@link ConditionToken | condition token}.\n * @public\n */\nexport interface IConditionTokenParts {\n qualifier?: string;\n value: string;\n}\n\n/**\n * Converts a {@link Helpers.IConditionTokenParts | the parts that make up a condition token} into\n * a syntactically validated {@link ConditionToken | condition token}.\n * @param parts - the parts to convert\n * @public\n */\nexport function buildConditionToken({ qualifier, value }: IConditionTokenParts): Result<ConditionToken> {\n return Validate.toConditionToken(qualifier ? `${qualifier}=${value}` : value);\n}\n\n/**\n * Converts an array of {@link Helpers.IConditionTokenParts | condition token parts} into an array of\n * syntactically validated {@link ConditionToken | condition tokens}.\n * @param parts - the parts to convert\n * @public\n */\nexport function buildConditionSetToken(\n parts: ReadonlyArray<IConditionTokenParts>\n): Result<ConditionSetToken> {\n return mapResults(parts.map(buildConditionToken)).onSuccess((tokens) =>\n Validate.toConditionSetToken(tokens.join(','))\n );\n}\n\n/**\n * Parses a condition token string into its {@link Helpers.IConditionTokenParts | parts}.\n * @param token - the token string to parse.\n * @returns `Success` with the parts if successful, `Failure` with an error message if not.\n * @public\n */\nexport function parseConditionTokenParts(token: string): Result<IConditionTokenParts> {\n return Validate.toConditionToken(token).onSuccess((t) => {\n const parts = t.split('=');\n if (parts.length === 1) {\n return succeed({ value: parts[0] });\n }\n return succeed({ qualifier: parts[0], value: parts[1] });\n });\n}\n\n/**\n * Parses a condition set token string into an array of {@link Helpers.IConditionTokenParts | condition token parts}.\n * @param token - the conditions set token string to parse.\n * @returns `Success` with the parts if successful, `Failure` with an error message if not.\n * @public\n */\nexport function parseConditionSetTokenParts(token: string): Result<IConditionTokenParts[]> {\n return mapResults(token.split(',').map(parseConditionTokenParts));\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../src/packlets/common/helpers/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,UAAU,EAAU,OAAO,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,QAAQ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AK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,+BAA+B,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAClG,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { mapResults, Result, succeed } from '@fgv/ts-utils';\nimport * as Validate from '../validate';\nimport { ContextToken, ContextQualifierToken } from '../conditions';\n\n/**\n * The values needed to create a {@link ContextQualifierToken | context qualifier token}.\n * @public\n */\nexport interface IContextTokenParts {\n qualifier?: string;\n value: string;\n}\n\n/**\n * Converts a {@link Helpers.IContextTokenParts | the parts that make up a context qualifier token} into\n * a syntactically validated {@link ContextQualifierToken | context qualifier token}.\n * @param parts - the parts to convert\n * @public\n */\nexport function buildContextQualifierToken({\n qualifier,\n value\n}: IContextTokenParts): Result<ContextQualifierToken> {\n /* c8 ignore next 1 - edge case: ternary expression alternate branch rarely hit */\n return Validate.toContextQualifierToken(qualifier ? `${qualifier}=${value}` : value);\n}\n\n/**\n * Converts an array of {@link Helpers.IContextTokenParts | context qualifier token parts} into a\n * syntactically validated {@link ContextToken | context token}.\n * @param parts - the parts to convert\n * @public\n */\nexport function buildContextToken(parts: ReadonlyArray<IContextTokenParts>): Result<ContextToken> {\n return mapResults(parts.map(buildContextQualifierToken)).onSuccess((tokens) =>\n Validate.toContextToken(tokens.join('|'))\n );\n}\n\n/**\n * Parses a context qualifier token string into its {@link Helpers.IContextTokenParts | parts}.\n * @param token - the token string to parse.\n * @returns `Success` with the parts if successful, `Failure` with an error message if not.\n * @public\n */\nexport function parseContextQualifierTokenParts(token: string): Result<IContextTokenParts> {\n return Validate.toContextQualifierToken(token).onSuccess((t) => {\n const parts = t.split('=');\n if (parts.length === 1) {\n return succeed({ value: parts[0] });\n }\n return succeed({ qualifier: parts[0], value: parts[1] });\n });\n}\n\n/**\n * Parses a context token string into an array of {@link Helpers.IContextTokenParts | context qualifier token parts}.\n * @param token - the context token string to parse.\n * @returns `Success` with the parts if successful, `Failure` with an error message if not.\n * @public\n */\nexport function parseContextTokenParts(token: string): Result<IContextTokenParts[]> {\n if (token === '') {\n return succeed([]);\n }\n return mapResults(token.split('|').map((part) => parseContextQualifierTokenParts(part.trim())));\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/common/helpers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,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\nexport * from './conditions';\nexport * from './context';\nexport * from './qualifierDefaultValues';\nexport * from './resources';\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualifierDefaultValues.js","sourceRoot":"","sources":["../../../../src/packlets/common/helpers/qualifierDefaultValues.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,UAAU,EAAU,OAAO,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AAYxC;;;;;GAKG;AACH,MAAM,UAAU,+BAA+B,CAAC,EAC9C,SAAS,EACT,KAAK,EAC4B;IACjC,OAAO,QAAQ,CAAC,4BAA4B,CAAC,GAAG,SAAS,IAAI,KAAK,EAAE,CAAC,CAAC;AACxE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gCAAgC,CAC9C,KAAsD;IAEtD,OAAO,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CACjF,QAAQ,CAAC,6BAA6B,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CACzD,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oCAAoC,CAClD,KAAa;IAEb,OAAO,QAAQ,CAAC,4BAA4B,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;QAClE,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACxC,OAAO,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qCAAqC,CACnD,KAAa;IAEb,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;QACjB,OAAO,OAAO,CAAC,EAAE,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,oCAAoC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACvG,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { mapResults, Result, succeed } from '@fgv/ts-utils';\nimport * as Validate from '../validate';\nimport { QualifierDefaultValueToken, QualifierDefaultValuesToken } from '../conditions';\n\n/**\n * The values needed to create a {@link QualifierDefaultValueToken | qualifier default value token}.\n * @public\n */\nexport interface IQualifierDefaultValueTokenParts {\n qualifier: string;\n value: string;\n}\n\n/**\n * Converts a {@link Helpers.IQualifierDefaultValueTokenParts | the parts that make up a qualifier default value token} into\n * a syntactically validated {@link QualifierDefaultValueToken | qualifier default value token}.\n * @param parts - the parts to convert\n * @public\n */\nexport function buildQualifierDefaultValueToken({\n qualifier,\n value\n}: IQualifierDefaultValueTokenParts): Result<QualifierDefaultValueToken> {\n return Validate.toQualifierDefaultValueToken(`${qualifier}=${value}`);\n}\n\n/**\n * Converts an array of {@link Helpers.IQualifierDefaultValueTokenParts | qualifier default value token parts} into a\n * syntactically validated {@link QualifierDefaultValuesToken | qualifier default values token}.\n * @param parts - the parts to convert\n * @public\n */\nexport function buildQualifierDefaultValuesToken(\n parts: ReadonlyArray<IQualifierDefaultValueTokenParts>\n): Result<QualifierDefaultValuesToken> {\n return mapResults(parts.map(buildQualifierDefaultValueToken)).onSuccess((tokens) =>\n Validate.toQualifierDefaultValuesToken(tokens.join('|'))\n );\n}\n\n/**\n * Parses a qualifier default value token string into its {@link Helpers.IQualifierDefaultValueTokenParts | parts}.\n * @param token - the token string to parse.\n * @returns `Success` with the parts if successful, `Failure` with an error message if not.\n * @public\n */\nexport function parseQualifierDefaultValueTokenParts(\n token: string\n): Result<IQualifierDefaultValueTokenParts> {\n return Validate.toQualifierDefaultValueToken(token).onSuccess((t) => {\n const [qualifier, value] = t.split('=');\n return succeed({ qualifier, value });\n });\n}\n\n/**\n * Parses a qualifier default values token string into an array of {@link Helpers.IQualifierDefaultValueTokenParts | qualifier default value token parts}.\n * @param token - the qualifier default values token string to parse.\n * @returns `Success` with the parts if successful, `Failure` with an error message if not.\n * @public\n */\nexport function parseQualifierDefaultValuesTokenParts(\n token: string\n): Result<IQualifierDefaultValueTokenParts[]> {\n if (token === '') {\n return succeed([]);\n }\n return mapResults(token.split('|').map((part) => parseQualifierDefaultValueTokenParts(part.trim())));\n}\n"]}
@@ -40,8 +40,7 @@ export function splitResourceId(id) {
40
40
  * Joins a list of {@link ResourceId | resource ID} or {@link ResourceName | resource name} with
41
41
  * to create a new {@link ResourceId | resource ID}. Fails if resulting ID is invalid or empty.
42
42
  *
43
- * @param base - The base name or ID to join.
44
- * @param names - Additional names to join.
43
+ * @param ids - The names or IDs to join.
45
44
  * @returns `Success` with the new ID if the base and names are valid, or `Failure` with an error message
46
45
  * if not.
47
46
  * @public
@@ -61,8 +60,7 @@ export function joinResourceIds(...ids) {
61
60
  * Joins a list of {@link ResourceId | resource ID} or {@link ResourceName | resource name} with
62
61
  * to create a new {@link ResourceId | resource ID}. Returns `undefined` if no names are defined.
63
62
  *
64
- * @param base - The base name or ID to join.
65
- * @param names - Additional names to join.
63
+ * @param ids - The names or IDs to join.
66
64
  * @returns `Success` with the new ID if the base and names are valid, `Success` with `undefined`
67
65
  * if names were present, or `Failure` with an error message if the resulting id is invalid.
68
66
  * @public
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["../../../../src/packlets/common/helpers/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,iBAAiB,EAAU,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE/E,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,EAAsB;IACpD,8FAA8F;IAC9F,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QACrB,OAAO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AC,CAAC;IAC3B,OAAO,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,EAAsB;IACzD,OAAO,eAAe,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;QAC7C,0DAA0D;QAC1D,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,uBAAuB,CAAC,CAAC;IAClG,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { MessageAggregator, Result, mapResults, succeed } from '@fgv/ts-utils';\nimport { ResourceId, ResourceName } from '../resources';\nimport { toResourceId, toResourceName } from '../validate/resources';\n\n/**\n * Splits a {@link ResourceId | resource id} into its component {@link ResourceName | resource names}.\n *\n * @param id - The ID to split.\n * @returns `Success`with an array of {@link ResourceName | ResourceName} objects if the ID is valid, or\n * `Failure` with an error message if not.\n * @public\n */\nexport function splitResourceId(id: string | undefined): Result<ResourceName[]> {\n /* c8 ignore next 3 - edge case: undefined resource ID should not occur in normal operation */\n if (id === undefined) {\n return succeed([]);\n }\n return mapResults(id.split('.').map(toResourceName));\n}\n\n/**\n * Joins a list of {@link ResourceId | resource ID} or {@link ResourceName | resource name} with\n * to create a new {@link ResourceId | resource ID}. Fails if resulting ID is invalid or empty.\n *\n * @param ids - The names or IDs to join.\n * @returns `Success` with the new ID if the base and names are valid, or `Failure` with an error message\n * if not.\n * @public\n */\nexport function joinResourceIds(...ids: (string | undefined)[]): Result<ResourceId> {\n const errors: MessageAggregator = new MessageAggregator();\n const parts: ResourceName[] = [];\n ids\n .filter((id) => id !== '')\n .forEach((id) => {\n parts.push(...splitResourceId(id).aggregateError(errors).orDefault([]));\n });\n const id = parts.join('.');\n return errors.returnOrReport(toResourceId(id));\n}\n\n/**\n * Joins a list of {@link ResourceId | resource ID} or {@link ResourceName | resource name} with\n * to create a new {@link ResourceId | resource ID}. Returns `undefined` if no names are defined.\n *\n * @param ids - The names or IDs to join.\n * @returns `Success` with the new ID if the base and names are valid, `Success` with `undefined`\n * if names were present, or `Failure` with an error message if the resulting id is invalid.\n * @public\n */\nexport function joinOptionalResourceIds(...ids: (string | undefined)[]): Result<ResourceId | undefined> {\n const errors: MessageAggregator = new MessageAggregator();\n const parts: ResourceName[] = [];\n ids\n .filter((id) => id !== '')\n .forEach((id) => {\n parts.push(...splitResourceId(id).aggregateError(errors).orDefault([]));\n });\n const id = parts.join('.');\n return errors.returnOrReport(id ? toResourceId(id) : succeed(undefined));\n}\n\n/**\n * Gets the name for a resource ID.\n * @param id - The resource ID to get the name for.\n * @returns `Success` with the resource name if found, or `Failure` with an error message if not.\n * @public\n */\nexport function getNameForResourceId(id: string | undefined): Result<ResourceName> {\n return splitResourceId(id).onSuccess((parts) => {\n /* c8 ignore next 1 - tested but coverage having issues */\n return parts.length > 0 ? succeed(parts[parts.length - 1]) : fail(`${id}: invalid resource id`);\n });\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAEvC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Convert from './convert';\nimport * as Helpers from './helpers';\nimport * as Validate from './validate';\n\nexport * from './conditions';\nexport * from './resources';\n\nexport { Convert, Helpers, Validate };\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["../../../src/packlets/common/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AA6CH;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAA+B,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { JsonValue } from '@fgv/ts-json-base';\nimport { Brand, Result } from '@fgv/ts-utils';\n\n/**\n * Branded string representing a validated resource id. A resource ID\n * is a dot-separated sequence of resource names.\n * @public\n */\nexport type ResourceId = Brand<string, 'ResourceId'>;\n\n/**\n * Branded string representing a validated resource name.\n * @public\n */\nexport type ResourceName = Brand<string, 'ResourceName'>;\n\n/**\n * Branded number representing a validated resource index.\n * @public\n */\nexport type ResourceIndex = Brand<number, 'ResourceIndex'>;\n\n/**\n * Branded string representing a validated resource type name.\n * @public\n */\nexport type ResourceTypeName = Brand<string, 'ResourceTypeName'>;\n\n/**\n * Branded number representing a validated resource type index.\n * @public\n */\nexport type ResourceTypeIndex = Brand<number, 'ResourceTypeIndex'>;\n\n/**\n * Type representing the possible ways that a resource value can be merged into an existing resource.\n * - 'augment' means that the new value should be merged into the existing value, with new properties added and existing properties updated.\n * - 'delete' means that the existing values should be deleted.\n * - 'replace' means that the new value should replace the existing value.\n * @public\n */\nexport type ResourceValueMergeMethod = 'augment' | 'delete' | 'replace';\n\n/**\n * Array of all possible {@link ResourceValueMergeMethod | resource merge type} values.\n * @public\n */\nexport const allResourceValueMergeMethods: ResourceValueMergeMethod[] = ['augment', 'delete', 'replace'];\n\n/**\n * The completeness of a resource candidate value. A full value is one that\n * contains all of the required properties for the resource type. A partial\n * value is one that contains some of the required properties for the resource\n * type.\n * @public\n */\nexport type CandidateCompleteness = 'full' | 'partial';\n\n/**\n * Branded number representing a validated candidate value index.\n * Candidate value indices are used to identify candidate values\n * within a resource set and to enable sharing of like values.\n * @public\n */\nexport type CandidateValueIndex = Brand<number, 'CandidateValueIndex'>;\n\n/**\n * Branded string representing a validated candidate value key.\n * Candidate value keys are used to identify candidate values\n * within a resource set and to enable sharing of like values.\n * @public\n */\nexport type CandidateValueKey = Brand<string, 'CandidateValueKey'>;\n\n/**\n * Minimal resource resolver\n * @public\n */\nexport interface IResourceResolver {\n /**\n * The resource IDs that this resolver can resolve.\n */\n readonly resourceIds: ReadonlyArray<ResourceId>;\n\n /**\n * Resolves a resource to a composed value by merging matching candidates according to their merge methods.\n * Starting from the highest priority candidates, finds the first \"full\" candidate and merges all higher\n * priority \"partial\" candidates into it in ascending order of priority.\n * @param resource - The string id of the resource to resolve.\n * @returns `Success` with the composed JsonValue if successful,\n * or `Failure` with an error message if no candidates match or resolution fails.\n * @public\n */\n resolveComposedResourceValue(resource: string): Result<JsonValue>;\n\n /**\n * Creates a new {@link IResourceResolver | resource resolver} with the given context.\n * @param context - The context to use for the new resource resolver.\n * @returns `Success` with the new resource resolver if successful,\n * or `Failure` with an error message if the context is invalid.\n * @public\n */\n withContext(context: Record<string, string>): Result<IResourceResolver>;\n}\n"]}
@@ -389,7 +389,7 @@ export function toConditionSetToken(token) {
389
389
  }
390
390
  /**
391
391
  * Converts a string to a {@link ConditionSetHash} if it is a valid condition set hash.
392
- * @param key - the string to convert
392
+ * @param hash - the string to convert
393
393
  * @returns `Success` with the converted {@link ConditionSetHash} if successful, or `Failure` with an
394
394
  * error message if not.
395
395
  * @public
@@ -401,9 +401,9 @@ export function toConditionSetHash(hash) {
401
401
  return succeed(hash);
402
402
  }
403
403
  /**
404
- * Converts a number to a {@link DecisionIndex} if it is a valid decision index.
405
- * @param index - the number to convert
406
- * @returns `Success` with the converted {@link DecisionIndex} if successful, or `Failure` with an
404
+ * Converts a string to a {@link DecisionKey} if it is a valid decision key.
405
+ * @param key - the string to convert
406
+ * @returns `Success` with the converted {@link DecisionKey} if successful, or `Failure` with an
407
407
  * error message if not.
408
408
  * @public
409
409
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/packlets/common/validate/conditions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAU,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAeL,OAAO,EACP,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EAEpB,qBAAqB,EAOtB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,WAAW,EACX,UAAU,EACV,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,sBAAsB,CA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AC,CAAC;AACxB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,uFAAuF;IACvF,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC,GAAG,KAAK,yBAAyB,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,iCAAiC,CAAC,KAAa;IAC7D,OAAO,0BAA0B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kCAAkC,CAAC,KAAa;IAC9D,uFAAuF;IACvF,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,2BAA2B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,4BAA4B,CAAC,KAAa;IACxD,uFAAuF;IACvF,IAAI,CAAC,iCAAiC,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAC,GAAG,KAAK,yCAAyC,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,6BAA6B,CAAC,KAAa;IACzD,uFAAuF;IACvF,IAAI,CAAC,kCAAkC,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/C,OAAO,IAAI,CAAC,GAAG,KAAK,0CAA0C,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result, fail, succeed } from '@fgv/ts-utils';\nimport {\n ConditionPriority,\n QualifierName,\n QualifierTypeName,\n QualifierIndex,\n QualifierTypeIndex,\n ConditionIndex,\n ConditionSetIndex,\n QualifierMatchScore,\n QualifierContextValue,\n ConditionKey,\n ConditionSetKey,\n DecisionKey,\n DecisionIndex,\n ConditionSetHash,\n NoMatch,\n PerfectMatch,\n MinConditionPriority,\n MaxConditionPriority,\n ConditionOperator,\n allConditionOperators,\n ConditionToken,\n ConditionSetToken,\n ContextQualifierToken,\n ContextToken,\n QualifierDefaultValueToken,\n QualifierDefaultValuesToken\n} from '../conditions';\nimport {\n conditionKey,\n conditionSetHash,\n conditionToken,\n contextToken,\n decisionKey,\n identifier,\n qualifierDefaultValueToken,\n qualifierDefaultValuesToken\n} from './regularExpressions';\n\n/**\n * Determines whether a string is a valid qualifier name.\n * @param name - the string to validate\n * @returns true if the string is a valid qualifier name, false otherwise.\n * @public\n */\nexport function isValidQualifierName(name: string): name is QualifierName {\n return identifier.test(name);\n}\n\n/***\n * Determines whether a string is a valid qualifier type name.\n * @param name - the string to validate\n * @returns true if the string is a valid qualifier type name, false otherwise.\n * @public\n */\nexport function isValidQualifierTypeName(name: string): name is QualifierTypeName {\n return identifier.test(name);\n}\n\n/**\n * Determines whether a number is a valid priority.\n * @param priority - the number to validate\n * @returns true if the number is a valid priority, false otherwise.\n * @public\n */\nexport function isValidConditionPriority(priority: number): priority is ConditionPriority {\n return priority >= MinConditionPriority && priority <= MaxConditionPriority;\n}\n\n/**\n * Determines whether a number is a valid qualifier index.\n * @param index - the number to validate\n * @returns true if the number is a valid qualifier index, false otherwise.\n * @public\n */\nexport function isValidQualifierIndex(index: number): index is QualifierIndex {\n return index >= 0;\n}\n\n/**\n * Determines whether a number is a valid qualifier type index.\n * @param index - the number to validate\n * @returns true if the number is a valid qualifier type index, false otherwise.\n * @public\n */\nexport function isValidQualifierTypeIndex(index: number): index is QualifierTypeIndex {\n return index >= 0;\n}\n\n/**\n * Determines whether a supplied value is a valid {@link QualifierMatchScore | match score}.\n * @param value - The value to validate.\n * @returns - `true` if the value is a valid match score, `false` otherwise.\n * @public\n */\nexport function isValidQualifierMatchScore(value: number): value is QualifierMatchScore {\n return value >= NoMatch && value <= PerfectMatch;\n}\n\n/**\n * Determines whether a number is a valid condition index.\n * @param index - the number to validate\n * @returns true if the number is a valid condition index, false otherwise.\n * @public\n */\nexport function isValidConditionIndex(index: number): index is ConditionIndex {\n return index >= 0;\n}\n\n/**\n * Determines whether a string is a valid condition operator.\n * @param operator - the string to validate\n * @returns true if the string is a valid condition operator, false otherwise.\n * @public\n */\nexport function isValidConditionOperator(operator: string): operator is ConditionOperator {\n return allConditionOperators.includes(operator as ConditionOperator);\n}\n\n/**\n * Determines whether a string is a valid condition key. A condition key has\n * the format:\n * `<qualifierName>(-<operator>)?-[<value>]@<priority>`\n * where operator is omitted for the default 'matches' operator.\n * @param key - the string to validate\n * @returns `true` if the string is a valid condition key, `false` otherwise.\n * @public\n */\nexport function isValidConditionKey(key: string): key is ConditionKey {\n return conditionKey.test(key);\n}\n\n/**\n * Determines whether a string is a valid {@link ConditionToken | condition token}.\n * A condition token has the format:\n * `<qualifierName>=<value>` or `<value>`\n * @param token -\n * @returns `true` if the string is a valid condition token, `false` otherwise.\n * @public\n */\nexport function isValidConditionToken(token: string): token is ConditionToken {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (token === '') {\n return true;\n }\n return conditionToken.test(token);\n}\n\n/**\n * Determines whether a number is a valid condition set index.\n * @param index - the number to validate\n * @returns true if the number is a valid condition set index, false otherwise.\n * @public\n */\nexport function isValidConditionSetIndex(index: number): index is ConditionSetIndex {\n return index >= 0;\n}\n\n/**\n * Determines whether a string is a valid condition set key.\n * @param key - the string to validate.\n * @returns `true` if the string is a valid condition set key, `false` otherwise.\n * @public\n */\nexport function isValidConditionSetKey(key: string): key is ConditionSetKey {\n if (key === '') {\n return true;\n }\n /* c8 ignore next 2 - edge case: condition set key validation rarely fails */\n // a condition set key is a `+` separated list of condition keys\n return key.split('+').every(isValidConditionKey);\n}\n\n/**\n * Determines whether a string is a valid condition set token.\n * @param token - the string to validate.\n * @returns `true` if the string is a valid condition set token, `false` otherwise.\n * @public\n */\nexport function isValidConditionSetToken(token: string): token is ConditionSetToken {\n return token.split(',').every(isValidConditionToken);\n}\n\n/**\n * Determines whether a string is a valid condition set hash.\n * @param hash - the string to validate.\n * @returns `true` if the string is a valid condition set hash, `false` otherwise.\n * @public\n */\nexport function isValidConditionSetHash(hash: string): hash is ConditionSetHash {\n return conditionSetHash.test(hash);\n}\n\n/**\n * Determines whether a string is a valid decision key.\n * @param key - the string to validate\n * @returns `true` if the string is a valid decision key, `false` otherwise.\n * @public\n */\nexport function isValidDecisionKey(key: string): key is DecisionKey {\n if (key === '') {\n return true;\n }\n return decisionKey.test(key);\n}\n\n/**\n * Determines whether a number is a valid decision index.\n * @param index - the number to validate\n * @returns `true` if the number is a valid decision index, `false` otherwise.\n * @public\n */\nexport function isValidDecisionIndex(index: number): index is DecisionIndex {\n return index >= 0;\n}\n\n/**\n * Determines whether a string is a valid qualifier context value.\n * For now, any non-empty string is considered a valid context value.\n * @param value - the string to validate\n * @returns true if the string is a valid qualifier context value, false otherwise.\n * @public\n */\nexport function isValidQualifierContextValue(value: string): value is QualifierContextValue {\n return typeof value === 'string' && value.length > 0;\n}\n\n/**\n * Converts a string to a {@link QualifierName} if it is a valid qualifier name.\n * @param name - the string to convert\n * @returns `Success` with the converted {@link QualifierName} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toQualifierName(name: string): Result<QualifierName> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!isValidQualifierName(name)) {\n return fail(`${name}: invalid qualifier name`);\n }\n return succeed(name);\n}\n\n/**\n * Converts a string to a {@link QualifierContextValue} if it is a valid qualifier context value.\n * @param value - the string to convert\n * @returns `Success` with the converted {@link QualifierContextValue} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toQualifierContextValue(value: string): Result<QualifierContextValue> {\n if (!isValidQualifierContextValue(value)) {\n return fail(`${value}: invalid qualifier context value`);\n }\n return succeed(value);\n}\n\n/**\n * Converts a number to a {@link QualifierIndex} if it is a valid qualifier index.\n * @param index - the number to convert\n * @returns `Success` with the converted {@link QualifierIndex} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toQualifierIndex(index: number): Result<QualifierIndex> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidQualifierIndex(index)) {\n return fail(`${index}: invalid qualifier index`);\n }\n return succeed(index as QualifierIndex);\n}\n\n/**\n * Converts a string to a {@link QualifierTypeName} if it is a valid qualifier type name.\n * @param name - the string to convert\n * @returns `Success` with the converted {@link QualifierTypeName} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toQualifierTypeName(name: string): Result<QualifierTypeName> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!isValidQualifierTypeName(name)) {\n return fail(`${name}: invalid qualifier type name`);\n }\n return succeed(name);\n}\n\n/**\n * Converts a number to a {@link QualifierTypeIndex} if it is a valid qualifier type index.\n * @param index - the number to convert\n * @returns `Success` with the converted {@link QualifierTypeIndex} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toQualifierTypeIndex(index: number): Result<QualifierTypeIndex> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!isValidQualifierTypeIndex(index)) {\n return fail(`${index}: invalid qualifier type index`);\n }\n return succeed(index);\n}\n\n/**\n * Converts a number to a {@link QualifierMatchScore | match score} if it is a valid score.\n * @param value - The number to convert.\n * @returns `Success` with the converted score if successful, or `Failure` with an error message\n * if not.\n * @public\n */\nexport function toQualifierMatchScore(value: number): Result<QualifierMatchScore> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidQualifierMatchScore(value)) {\n return fail(`${value}: invalid match score`);\n }\n return succeed(value as QualifierMatchScore);\n}\n\n/**\n * Converts a number to a {@link ConditionPriority} if it is a valid priority.\n * @param priority - the number to convert\n * @returns `Success` with the converted {@link ConditionPriority} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toConditionPriority(priority: number): Result<ConditionPriority> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidConditionPriority(priority)) {\n return fail(`${priority}: invalid priority`);\n }\n return succeed(priority);\n}\n\n/**\n * Converts a number to a {@link ConditionIndex} if it is a valid condition index.\n * @param index - the number to convert\n * @returns `Success` with the converted {@link ConditionIndex} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toConditionIndex(index: number): Result<ConditionIndex> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidConditionIndex(index)) {\n return fail(`${index}: invalid condition index`);\n }\n return succeed(index);\n}\n\n/**\n * Converts a string to a {@link ConditionOperator} if it is a valid condition operator.\n * @param operator - the string to convert\n * @returns `Success` with the converted {@link ConditionOperator} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toConditionOperator(operator: string): Result<ConditionOperator> {\n if (!isValidConditionOperator(operator)) {\n return fail(`${operator}: invalid condition operator`);\n }\n return succeed(operator as ConditionOperator);\n}\n\n/**\n * Converts a string to a {@link ConditionKey} if it is a valid condition key.\n * @param key - the string to convert\n * @returns `Success` with the converted {@link ConditionKey} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toConditionKey(key: string): Result<ConditionKey> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidConditionKey(key)) {\n return fail(`${key}: invalid condition key`);\n }\n return succeed(key);\n}\n\n/**\n * Converts a string to a {@link ConditionToken} if it is a valid condition token.\n * @param token - the string to convert\n * @returns `Success` with the converted {@link ConditionToken} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toConditionToken(token: string): Result<ConditionToken> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidConditionToken(token)) {\n return fail(`${token}: invalid condition token`);\n }\n return succeed(token);\n}\n\n/**\n * Converts a number to a {@link ConditionSetIndex} if it is a valid condition set index.\n * @param index - the number to convert\n * @returns `Success` with the converted {@link ConditionSetIndex} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toConditionSetIndex(index: number): Result<ConditionSetIndex> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidConditionSetIndex(index)) {\n return fail(`${index}: invalid condition set index`);\n }\n return succeed(index);\n}\n\n/**\n * Converts a string to a {@link ConditionSetKey} if it is a valid condition set key.\n * @param key - the string to convert\n * @returns `Success` with the converted {@link ConditionSetKey} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toConditionSetKey(key: string): Result<ConditionSetKey> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidConditionSetKey(key)) {\n return fail(`${key}: invalid condition set key`);\n }\n return succeed(key);\n}\n\n/**\n * Converts a string to a {@link ConditionSetToken} if it is a valid condition set token.\n * @param token - the string to convert\n * @returns `Success` with the converted {@link ConditionSetToken} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toConditionSetToken(token: string): Result<ConditionSetToken> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!isValidConditionSetToken(token)) {\n return fail(`${token}: invalid condition set token`);\n }\n return succeed(token);\n}\n\n/**\n * Converts a string to a {@link ConditionSetHash} if it is a valid condition set hash.\n * @param hash - the string to convert\n * @returns `Success` with the converted {@link ConditionSetHash} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toConditionSetHash(hash: string): Result<ConditionSetHash> {\n if (!isValidConditionSetHash(hash)) {\n return fail(`${hash}: invalid condition set hash`);\n }\n return succeed(hash);\n}\n\n/**\n * Converts a string to a {@link DecisionKey} if it is a valid decision key.\n * @param key - the string to convert\n * @returns `Success` with the converted {@link DecisionKey} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toDecisionKey(key: string): Result<DecisionKey> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidDecisionKey(key)) {\n return fail(`${key}: invalid decision key`);\n }\n return succeed(key);\n}\n\n/**\n * Converts a number to a {@link DecisionIndex} if it is a valid decision index.\n * @param index - the number to convert\n * @returns `Success` with the converted {@link DecisionIndex} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toDecisionIndex(index: number): Result<DecisionIndex> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidDecisionIndex(index)) {\n return fail(`${index}: invalid decision index`);\n }\n return succeed(index);\n}\n\n/**\n * Determines whether a string is a valid {@link ContextQualifierToken | context qualifier token}.\n * A context qualifier token has the format:\n * `<qualifierName>=<value>` or `<value>`\n * Context qualifier tokens allow broader character set including commas for comma-separated values.\n * @param token - the string to validate\n * @returns `true` if the string is a valid context qualifier token, `false` otherwise.\n * @public\n */\nexport function isValidContextQualifierToken(token: string): token is ContextQualifierToken {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (token === '') {\n return true;\n }\n return contextToken.test(token);\n}\n\n/**\n * Determines whether a string is a valid context token.\n * Context tokens are pipe-separated lists of context qualifier tokens.\n * @param token - the string to validate.\n * @returns `true` if the string is a valid context token, `false` otherwise.\n * @public\n */\nexport function isValidContextToken(token: string): token is ContextToken {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (token === '') {\n return true;\n }\n const parts = token.split('|').map((part) => part.trim());\n return parts.every((part) => part !== '' && isValidContextQualifierToken(part));\n}\n\n/**\n * Converts a string to a {@link ContextQualifierToken} if it is a valid context qualifier token.\n * @param token - the string to convert\n * @returns `Success` with the converted {@link ContextQualifierToken} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toContextQualifierToken(token: string): Result<ContextQualifierToken> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!isValidContextQualifierToken(token)) {\n return fail(`${token}: invalid context qualifier token`);\n }\n return succeed(token);\n}\n\n/**\n * Converts a string to a {@link ContextToken} if it is a valid context token.\n * @param token - the string to convert\n * @returns `Success` with the converted {@link ContextToken} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toContextToken(token: string): Result<ContextToken> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!isValidContextToken(token)) {\n return fail(`${token}: invalid context token`);\n }\n return succeed(token);\n}\n\n/**\n * Determines whether a string is a valid {@link QualifierDefaultValueToken | qualifier default value token}.\n * A qualifier default value token has the format:\n * `<qualifierName>=<value>` or `<qualifierName>=` (to remove default)\n * Default values allow broader character set including commas for comma-separated values.\n * @param token - the string to validate\n * @returns `true` if the string is a valid qualifier default value token, `false` otherwise.\n * @public\n */\nexport function isValidQualifierDefaultValueToken(token: string): token is QualifierDefaultValueToken {\n return qualifierDefaultValueToken.test(token);\n}\n\n/**\n * Determines whether a string is a valid qualifier default values token.\n * Qualifier default values tokens are pipe-separated lists of qualifier default value tokens.\n * @param token - the string to validate.\n * @returns `true` if the string is a valid qualifier default values token, `false` otherwise.\n * @public\n */\nexport function isValidQualifierDefaultValuesToken(token: string): token is QualifierDefaultValuesToken {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (token === '') {\n return true;\n }\n return qualifierDefaultValuesToken.test(token);\n}\n\n/**\n * Converts a string to a {@link QualifierDefaultValueToken} if it is a valid qualifier default value token.\n * @param token - the string to convert\n * @returns `Success` with the converted {@link QualifierDefaultValueToken} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toQualifierDefaultValueToken(token: string): Result<QualifierDefaultValueToken> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!isValidQualifierDefaultValueToken(token)) {\n return fail(`${token}: invalid qualifier default value token`);\n }\n return succeed(token);\n}\n\n/**\n * Converts a string to a {@link QualifierDefaultValuesToken} if it is a valid qualifier default values token.\n * @param token - the string to convert\n * @returns `Success` with the converted {@link QualifierDefaultValuesToken} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toQualifierDefaultValuesToken(token: string): Result<QualifierDefaultValuesToken> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!isValidQualifierDefaultValuesToken(token)) {\n return fail(`${token}: invalid qualifier default values token`);\n }\n return succeed(token);\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/common/validate/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAE5B,OAAO,KAAK,kBAAkB,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport * from './conditions';\nexport * from './resources';\n\nimport * as RegularExpressions from './regularExpressions';\nexport { RegularExpressions };\n"]}
@@ -33,8 +33,8 @@ export const segmentedIdentifier = /^[a-zA-Z_][a-zA-Z0-9_\-]*(\.[a-zA-Z_][a-zA-Z
33
33
  export const identifierList = /^[a-zA-Z_][a-zA-Z0-9_\-]*(,[a-zA-Z_][a-zA-Z0-9_\-]*)*$/;
34
34
  /**
35
35
  * The format of a {@link ConditionKey | condition key} is:
36
- * <qualifierName>-[<value>][\@<priority>](<scoreAsDefault>) where operator is `matches`, or
37
- * <qualifierName>-<operator>-[<value>][\@<priority>](<scoreAsDefault>)
36
+ * \<qualifierName\>-\[<value>\]\[\@<priority>\]\(\<scoreAsDefault\>\) where operator is `matches`, or
37
+ * \<qualifierName\>-\<operator\>-\[<value>\]\[\@<priority>\]\(\<scoreAsDefault\>\)
38
38
  * @internal
39
39
  */
40
40
  export const conditionKey = /^[a-zA-Z_][a-zA-Z0-9_\-]*(-matches)?-\[.*\](?:@[0-9]{1,4})?(?:\([01](?:\.[0-9]+)?\))?$/;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regularExpressions.js","sourceRoot":"","sources":["../../../../src/packlets/common/validate/regularExpressions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAW,4BAA4B,CAAC;AAE/D;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAW,yDAAyD,CAAC;AAErG;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAW,wDAAwD,CAAC;AAE/F;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GACvB,wFAAwF,CAAC;AAE3F;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAW,iDAAiD,CAAC;AAExF;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAW,oDAAoD,CAAC;AAEzF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAW,kBAAkB,CAAC;AAE3D;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAW,4DAA4D,CAAC;AAEhG;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAW,gBAAgB,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAW,oDAAoD,CAAC;AAEvG;;;;;GAKG;AACH,MAAM,CAAC,MAAM,2BAA2B,GACtC,2GAA2G,CAAC;AAE9G;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAW,eAAe,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * @internal\n */\nexport const identifier: RegExp = /^[a-zA-Z_][a-zA-Z0-9_\\-]*$/;\n\n/**\n * @internal\n */\nexport const segmentedIdentifier: RegExp = /^[a-zA-Z_][a-zA-Z0-9_\\-]*(\\.[a-zA-Z_][a-zA-Z0-9_\\-]*)*$/;\n\n/**\n * @internal\n */\nexport const identifierList: RegExp = /^[a-zA-Z_][a-zA-Z0-9_\\-]*(,[a-zA-Z_][a-zA-Z0-9_\\-]*)*$/;\n\n/**\n * The format of a {@link ConditionKey | condition key} is:\n * \\<qualifierName\\>-\\[<value>\\]\\[\\@<priority>\\]\\(\\<scoreAsDefault\\>\\) where operator is `matches`, or\n * \\<qualifierName\\>-\\<operator\\>-\\[<value>\\]\\[\\@<priority>\\]\\(\\<scoreAsDefault\\>\\)\n * @internal\n */\nexport const conditionKey: RegExp =\n /^[a-zA-Z_][a-zA-Z0-9_\\-]*(-matches)?-\\[.*\\](?:@[0-9]{1,4})?(?:\\([01](?:\\.[0-9]+)?\\))?$/;\n\n/**\n * A {@link ConditionToken | condition token} is a comma-separated list of one or more\n * condition specifiers, where a condition specifier has either the form\n * `<qualifierName>=<value>` or `<value>`.\n * @internal\n */\nexport const conditionToken: RegExp = /^[a-zA-Z_][a-zA-Z0-9_\\-]*(?:=[a-zA-Z0-9_\\-]+)?$/;\n\n/**\n * A {@link ContextToken | context token} has the form `<qualifierName>=<value>` or `<value>`.\n * Context tokens allow broader character set including commas for comma-separated values.\n * @internal\n */\nexport const contextToken: RegExp = /^[a-zA-Z_][a-zA-Z0-9_\\-]*(?:=[a-zA-Z0-9_\\-,\\s]+)?$/;\n\n/**\n * @internal\n */\nexport const conditionSetHash: RegExp = /^[a-zA-Z0-9]{8}$/;\n\n/**\n * @internal\n */\nexport const decisionKey: RegExp = /^[a-zA-Z0-9]{8}(?:\\+[a-zA-Z0-9]{8})*(?:\\|[a-zA-Z0-9]{8})?$/;\n\n/**\n * @internal\n */\nexport const candidateValueKey: RegExp = /^[a-zA-Z0-9]+$/;\n\n/**\n * A {@link QualifierDefaultValueToken | qualifier default value token} has the form\n * `<qualifierName>=<value>` or `<qualifierName>=` (to remove default).\n * Default values allow broader character set including commas for comma-separated values.\n * @internal\n */\nexport const qualifierDefaultValueToken: RegExp = /^[a-zA-Z_][a-zA-Z0-9_\\-]*=(?:[a-zA-Z0-9_\\-,\\s]*)?$/;\n\n/**\n * A {@link QualifierDefaultValuesToken | qualifier default values token} is a\n * pipe-separated list of one or more qualifier default value tokens.\n * Uses \"|\" as separator to avoid conflicts with comma-separated values within defaults.\n * @internal\n */\nexport const qualifierDefaultValuesToken: RegExp =\n /^[a-zA-Z_][a-zA-Z0-9_\\-]*=(?:[a-zA-Z0-9_\\-,\\s]*)?(?:\\|[a-zA-Z_][a-zA-Z0-9_\\-]*=(?:[a-zA-Z0-9_\\-,\\s]*)?)*$/;\n\n/**\n * @internal\n */\nexport const territoryCode: RegExp = /^[a-zA-Z]{2}$/;\n"]}
@@ -94,7 +94,7 @@ export function isValidCandidateValueKey(key) {
94
94
  /**
95
95
  * Converts a string to a {@link ResourceName | resource name}.
96
96
  *
97
- * @param id - The string to convert.
97
+ * @param name - The string to convert.
98
98
  * @returns `Success` with the converted name if valid, or `Failure` with an error message
99
99
  * if not.
100
100
  * @public
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["../../../../src/packlets/common/validate/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAU,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAW1F;;;;;;GAMG;A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,UAAU,qBAAqB,CAAC,KAAa;IACjD,+CAA+C;IAC/C,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,EAAE,CAAC;QACvC,OAAO,IAAI,CAAC,GAAG,KAAK,kCAAkC,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { fail, succeed, Result } from '@fgv/ts-utils';\nimport { candidateValueKey, identifier, segmentedIdentifier } from './regularExpressions';\nimport {\n CandidateValueIndex,\n CandidateValueKey,\n ResourceId,\n ResourceIndex,\n ResourceName,\n ResourceTypeIndex,\n ResourceTypeName\n} from '../resources';\n\n/**\n * Checks if the given name is a valid resource name.\n *\n * @param name - The name to validate.\n * @returns `true` if the name is a valid resource name, otherwise `false`.\n * @public\n */\nexport function isValidResourceName(name: string): name is ResourceName {\n return identifier.test(name);\n}\n\n/**\n * Checks if the given ID is a valid resource ID.\n *\n * @param id - The ID to validate.\n * @returns `true` if the ID is a valid resource ID, otherwise `false`.\n * @public\n */\nexport function isValidResourceId(id: string): id is ResourceId {\n return segmentedIdentifier.test(id);\n}\n\n/**\n * Checks if the given index is a valid resource index.\n *\n * @param index - The index to validate.\n * @returns `true` if the index is a valid resource index, otherwise `false`.\n * @public\n */\nexport function isValidResourceIndex(index: number): index is ResourceIndex {\n return index >= 0;\n}\n\n/**\n * Checks if the given name is a valid resource type name.\n *\n * @param name - The name to validate.\n * @returns `true` if the name is a valid resource type name, otherwise `false`.\n * @public\n */\nexport function isValidResourceTypeName(name: string): name is ResourceTypeName {\n return identifier.test(name);\n}\n\n/**\n * Checks if the given index is a valid resource type index.\n *\n * @param index - The index to validate.\n * @returns `true` if the index is a valid resource type index, otherwise `false`.\n * @public\n */\nexport function isValidResourceTypeIndex(index: number): index is ResourceTypeIndex {\n return index >= 0;\n}\n\n/**\n * Checks if the given index is a valid candidate value index.\n *\n * @param index - The index to validate.\n * @returns `true` if the index is a valid candidate value index, otherwise `false`.\n * @public\n */\nexport function isValidCandidateValueIndex(index: number): index is CandidateValueIndex {\n return index >= 0;\n}\n\n/**\n * Checks if the given key is a valid candidate value key.\n *\n * @param key - The key to validate.\n * @returns `true` if the key is a valid candidate value key, otherwise `false`.\n * @public\n */\nexport function isValidCandidateValueKey(key: string): key is CandidateValueKey {\n return candidateValueKey.test(key);\n}\n\n/**\n * Converts a string to a {@link ResourceName | resource name}.\n *\n * @param name - The string to convert.\n * @returns `Success` with the converted name if valid, or `Failure` with an error message\n * if not.\n * @public\n */\nexport function toResourceName(name: string): Result<ResourceName> {\n /* c8 ignore next 3 - coverage having issues */\n if (!isValidResourceName(name)) {\n return fail(`${name}: invalid resource name.`);\n }\n return succeed(name);\n}\n\n/**\n * Converts a string to a {@link ResourceId | resource ID}.\n *\n * @param id - The string to convert.\n * @returns `Success` with the converted ID if valid, or `Failure` with an error message\n * if not.\n * @public\n */\nexport function toResourceId(id: string): Result<ResourceId> {\n /* c8 ignore next 3 - defensive coding: resource ID validation should prevent invalid IDs */\n if (!isValidResourceId(id)) {\n return fail(`${id}: invalid resource ID.`);\n }\n return succeed(id);\n}\n\n/**\n * Converts an optional string to an optional {@link ResourceId | resource ID}.\n *\n * @param id - The string to convert.\n * @returns `Success` with the converted ID if valid, or `Failure` with an error message\n * if not.\n * @public\n */\nexport function toOptionalResourceId(id?: string): Result<ResourceId | undefined> {\n return id ? toResourceId(id) : succeed(undefined);\n}\n\n/**\n * Converts a number to a {@link ResourceIndex | resource index}.\n *\n * @param index - The number to convert.\n * @returns `Success` with the converted index if valid, or `Failure` with an error message\n * if not.\n * @public\n */\nexport function toResourceIndex(index: number): Result<ResourceIndex> {\n if (!isValidResourceIndex(index)) {\n return fail(`${index}: invalid resource index.`);\n }\n return succeed(index);\n}\n\n/**\n * Converts a string to a {@link ResourceTypeName | resource type name}.\n *\n * @param name - The string to convert.\n * @returns `Success` with the converted name if valid, or `Failure` with an error message\n * if not.\n * @public\n */\nexport function toResourceTypeName(name: string): Result<ResourceTypeName> {\n /* c8 ignore next 3 - coverage having issues */\n if (!isValidResourceTypeName(name)) {\n return fail(`${name}: invalid resource type name.`);\n }\n return succeed(name);\n}\n\n/**\n * Converts a number to a {@link ResourceTypeIndex | resource type index}.\n *\n * @param index - The number to convert.\n * @returns `Success` with the converted index if valid, or `Failure` with an error message\n * if not.\n * @public\n */\nexport function toResourceTypeIndex(index: number): Result<ResourceTypeIndex> {\n /* c8 ignore next 3 - coverage having issues */\n if (!isValidResourceTypeIndex(index)) {\n return fail(`${index}: invalid resource type index.`);\n }\n return succeed(index);\n}\n\n/**\n * Converts a string to a {@link CandidateValueKey | candidate value key}.\n *\n * @param key - The key to convert.\n * @returns `Success` with the converted key if valid, or `Failure` with an error message\n * if not.\n * @public\n */\nexport function toCandidateValueKey(key: string): Result<CandidateValueKey> {\n /* c8 ignore next 3 - coverage having issues */\n if (!isValidCandidateValueKey(key)) {\n return fail(`${key}: invalid candidate value key.`);\n }\n return succeed(key);\n}\n\n/**\n * Converts a number to a {@link CandidateValueIndex | candidate value index}.\n *\n * @param index - The number to convert.\n * @returns `Success` with the converted index if valid, or `Failure` with an error message\n * if not.\n * @public\n */\nexport function toCandidateValueIndex(index: number): Result<CandidateValueIndex> {\n /* c8 ignore next 3 - coverage having issues */\n if (!isValidCandidateValueIndex(index)) {\n return fail(`${index}: invalid candidate value index.`);\n }\n return succeed(index);\n}\n"]}
@@ -30,12 +30,8 @@ const scoreFormatter = new Intl.NumberFormat('en-US', { minimumFractionDigits: 0
30
30
  export class Condition {
31
31
  /**
32
32
  * Constructs a new {@link Conditions.Condition | Condition} object.
33
- * @param qualifier - The {@link Qualifiers.Qualifier | qualifier} used in this condition.
34
- * @param value - The value to be matched in this condition.
35
- * @param operator - The {@link ConditionOperator | operator} used when matching context value to condition value.
36
- * @param priority - The {@link ConditionPriority | relative priority} of this condition.
37
- * @param scoreAsDefault - The {@link QualifierMatchScore | score} to be used when this condition is the default.
38
- * @param index - The index of this condition.
33
+ * @param params - The {@link Conditions.IValidatedConditionDecl | validated condition declaration}
34
+ * used to construct this condition.
39
35
  * @public
40
36
  */
41
37
  constructor({ qualifier, value, operator, priority, scoreAsDefault, index }) {
@@ -85,7 +81,7 @@ export class Condition {
85
81
  * @returns A {@link QualifierMatchScore | match score} indicating match quality if the condition is present
86
82
  * in the context to be matched, `undefined` otherwise.
87
83
  * @remarks
88
- * If {@link Context.IContextMatchOptions.partialContextMatch | `options.partialContextMatch``} is `true`, then
84
+ * If {@link Context.IContextMatchOptions.partialContextMatch | `options.partialContextMatch`} is `true`, then
89
85
  * the method will return `undefined` if the corresponding qualifier is not present in the context.
90
86
  */
91
87
  getContextMatch(context, options) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"condition.js","sourceRoot":"","sources":["../../../src/packlets/conditions/condition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,aAAa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AQ,GAAG,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;QACzE,uBACE,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,KAAM,EACrC,QAAQ,EACR,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,cAAc,EAAE,IAAI,CAAC,cAAc,IAChC,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,MAAK,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAC7E;IACJ,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,aAAa,CAAC,IAA6B;QACvD,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACpG,MAAM,GAAG,GACP,IAAI,CAAC,QAAQ,KAAK,SAAS;YACzB,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,QAAQ,GAAG,cAAc,EAAE;YAC5E,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,QAAQ,GAAG,cAAc,EAAE,CAAC;QAClG,OAAO,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, Collections, Result, fail } from '@fgv/ts-utils';\nimport {\n Convert as CommonConvert,\n ConditionIndex,\n ConditionKey,\n ConditionOperator,\n ConditionPriority,\n ConditionToken,\n NoMatch,\n QualifierConditionValue,\n QualifierMatchScore,\n Validate\n} from '../common';\nimport { Qualifier } from '../qualifiers';\nimport { IValidatedConditionDecl } from './conditionDecls';\nimport * as ResourceJson from '../resource-json';\nimport * as Context from '../context';\n\n// eslint-disable-next-line @rushstack/typedef-var\nconst scoreFormatter = new Intl.NumberFormat('en-US', { minimumFractionDigits: 0, maximumFractionDigits: 3 });\n\n/**\n * Represents a single condition applied to some resource instance.\n * @public\n */\nexport class Condition implements IValidatedConditionDecl {\n /**\n * The {@link Qualifiers.Qualifier | qualifier} used in this condition.\n */\n public readonly qualifier: Qualifier;\n\n /**\n * The value to be matched in this condition.\n */\n public readonly value: QualifierConditionValue;\n\n /**\n * The {@link ConditionOperator | operator} used when matching context value to condition value.\n */\n public readonly operator: ConditionOperator;\n\n /**\n * The {@link ConditionPriority | relative priority} of this condition.\n */\n public readonly priority: ConditionPriority;\n\n /**\n * The {@link QualifierMatchScore | score} to be used when this condition is the default.\n */\n public readonly scoreAsDefault?: QualifierMatchScore;\n\n protected _collectible: Collections.Collectible<ConditionKey, ConditionIndex>;\n\n /**\n * Constructs a new {@link Conditions.Condition | Condition} object.\n * @param params - The {@link Conditions.IValidatedConditionDecl | validated condition declaration}\n * used to construct this condition.\n * @public\n */\n protected constructor({\n qualifier,\n value,\n operator,\n priority,\n scoreAsDefault,\n index\n }: IValidatedConditionDecl) {\n if (scoreAsDefault === undefined && qualifier.defaultValue !== undefined) {\n /* c8 ignore next 4 - edge case: default value matching logic rarely triggered */\n const defaultMatch = qualifier.type.matches(value, qualifier.defaultValue, 'matches');\n if (defaultMatch !== NoMatch) {\n scoreAsDefault = defaultMatch;\n }\n }\n this.qualifier = qualifier;\n this.operator = operator;\n this.value = qualifier.validateCondition(value, operator).orThrow();\n this.priority = priority;\n this.scoreAsDefault = scoreAsDefault;\n this._collectible = new Collections.Collectible({\n key: this.toKey(),\n index,\n indexConverter: CommonConvert.conditionIndex\n });\n }\n\n public get key(): ConditionKey {\n return this._collectible.key;\n }\n\n public get index(): ConditionIndex | undefined {\n return this._collectible.index;\n }\n\n public setIndex(index: ConditionIndex): Result<ConditionIndex> {\n return this._collectible.setIndex(index);\n }\n\n /**\n * Creates a new {@link Conditions.Condition | Condition} object from the supplied\n * {@link Conditions.IValidatedConditionDecl | validated condition declaration}.\n * @param decl - The {@link Conditions.IValidatedConditionDecl | validated condition declaration}\n * describing the condition to create.\n * @returns `Success` with the new {@link Conditions.Condition | Condition} if successful,\n * `Failure` otherwise.\n * @public\n */\n public static create(decl: IValidatedConditionDecl): Result<Condition> {\n return captureResult(() => new Condition(decl));\n }\n\n /**\n * Determines if this condition matches the supplied {@link Context.IValidatedContextDecl | validated context}.\n * @param context - The {@link Context.IValidatedContextDecl | context} to match against.\n * @param options - The {@link Context.IContextMatchOptions | options} to use when matching the context.\n * @returns A {@link QualifierMatchScore | match score} indicating match quality if the condition is present\n * in the context to be matched, `undefined` otherwise.\n * @remarks\n * If {@link Context.IContextMatchOptions.partialContextMatch | `options.partialContextMatch`} is `true`, then\n * the method will return `undefined` if the corresponding qualifier is not present in the context.\n */\n public getContextMatch(\n context: Context.IValidatedContextDecl,\n options?: Context.IContextMatchOptions\n ): QualifierMatchScore | undefined {\n options = options ?? {};\n if (this.qualifier.name in context) {\n const contextValue = context[this.qualifier.name];\n const match = this.qualifier.type.matches(this.value, contextValue, this.operator);\n if (match === NoMatch && options.acceptDefaultScore === true && this.scoreAsDefault !== undefined) {\n return this.scoreAsDefault;\n }\n return match;\n }\n return options.partialContextMatch === true ? undefined : NoMatch;\n }\n\n /**\n * Determines if this condition can match the supplied context, even if the context is partial.\n *\n * Returns true if:\n * - The qualifier specified in the condition is not present in the context\n * - The qualifier is present and matches the condition\n *\n * Returns false if:\n * - The qualifier is present in the context and does not match the condition\n *\n * @param context - The context to match against.\n * @param options - Options to use when matching the context.\n * @returns `true` if the condition can match the (possibly partial) context, `false` otherwise.\n * @public\n */\n public canMatchPartialContext(\n context: Context.IValidatedContextDecl,\n options?: Context.IContextMatchOptions\n ): boolean {\n /* c8 ignore next 1 - defense in depth */\n const scoreAsDefault = this.scoreAsDefault ?? NoMatch;\n if (!(this.qualifier.name in context) || scoreAsDefault > NoMatch) {\n return true;\n }\n return this.qualifier.type.isPotentialMatch(this.value, context[this.qualifier.name]);\n }\n\n /**\n * Compares two conditions for sorting purposes.\n * @param c1 - The first {@link Conditions.Condition | condition} to compare.\n * @param c2 - The second {@link Conditions.Condition | condition} to compare.\n * @returns A negative number if c1 should come before c2, a positive number\n * if c2 should come before c1, or zero if they are equivalent.\n * @public\n */\n public static compare(c1: Condition, c2: Condition): number {\n let diff = c1.priority - c2.priority;\n diff = diff === 0 ? (c1.scoreAsDefault ?? 0) - (c2.scoreAsDefault ?? 0) : diff;\n diff = diff === 0 ? c1.qualifier.name.localeCompare(c2.qualifier.name) : diff;\n diff = diff === 0 ? c1.value.localeCompare(c2.value) : diff;\n return diff;\n }\n\n /**\n * Gets a {@link ConditionToken | condition token} for this condition, if possible.\n * It is not possible to get a token for a condition with an operator other than `matches`,\n * with other-than-default priority, or with a name or value that contains other than alphanumeric\n * characters, underscore or non-leading hyphen.\n * @param terse - if `true` and if the qualifier token is optional, the token will be omitted\n * from the generated {@link ConditionToken | condition token}.\n * @returns\n */\n public toToken(terse?: boolean): Result<ConditionToken> {\n /* c8 ignore next 3 - defense in depth very difficult to induce */\n if (this.operator !== 'matches') {\n return fail(`${this.operator}: cannot create condition token for operator other than 'matches'`);\n }\n if (this.priority !== this.qualifier.defaultPriority) {\n return fail(`${this.priority}: cannot create condition token for non-default priority`);\n }\n if (terse && this.qualifier.tokenIsOptional) {\n return Validate.toConditionToken(this.value);\n }\n /* c8 ignore next 1 - coverage having a bad day */\n const name = this.qualifier.token ?? this.qualifier.name;\n return Validate.toConditionToken(`${name}=${this.value}`);\n }\n\n /**\n * Gets the {@link ConditionKey | key} for this condition.\n * @returns -\n */\n public toKey(): ConditionKey {\n return Condition.getKeyForDecl(this).orThrow();\n }\n\n /**\n * Get a human-readable string representation of the condition.\n * @returns A string representation of the condition.\n * @public\n */\n public toString(): string {\n return this.toKey();\n }\n\n /**\n * Gets the {@link ResourceJson.Json.IChildConditionDecl | child condition declaration} for this condition.\n * @param options - The {@link ResourceJson.Helpers.IDeclarationOptions | options} to use when creating the child\n * condition declaration.\n * @returns The {@link ResourceJson.Json.IChildConditionDecl | child condition declaration} for this condition.\n * @public\n */\n public toChildConditionDecl(\n options?: ResourceJson.Helpers.IDeclarationOptions\n ): ResourceJson.Json.IChildConditionDecl {\n const showDefaults = options?.showDefaults === true;\n return {\n value: this.value,\n /* c8 ignore next 1 - not really possible to reproduce right now */\n ...(showDefaults || this.operator !== 'matches' ? { operator: this.operator } : {}),\n ...(showDefaults || this.priority !== this.qualifier.defaultPriority\n ? { priority: this.priority }\n : {}),\n ...(this.scoreAsDefault ? { scoreAsDefault: this.scoreAsDefault } : {})\n };\n }\n\n /**\n * Gets the value for this condition, or the {@link ResourceJson.Json.IChildConditionDecl | child condition declaration}\n * if the condition has non-default operator, priority or a score as default.\n * @param options - The {@link ResourceJson.Helpers.IDeclarationOptions | options} to use when creating the child\n * condition declaration.\n * @returns A string value for this condition, or the {@link ResourceJson.Json.IChildConditionDecl | child condition declaration}\n * if the condition has non-default operator, priority or a score as default.\n */\n public toValueOrChildConditionDecl(\n options?: ResourceJson.Helpers.IDeclarationOptions\n ): string | ResourceJson.Json.IChildConditionDecl {\n if (\n options?.showDefaults !== true &&\n this.operator === 'matches' &&\n this.priority === this.qualifier.defaultPriority &&\n this.scoreAsDefault === undefined\n ) {\n return this.value;\n }\n /* c8 ignore next 2 - unreachable: matches is the only real operator in practice */\n return this.toChildConditionDecl(options);\n }\n\n /**\n * Gets the {@link ResourceJson.Json.ILooseConditionDecl | loose condition declaration} for this condition.\n * @param options - The {@link ResourceJson.Helpers.IDeclarationOptions | options} to use when creating the loose\n * condition declaration.\n * @returns The {@link ResourceJson.Json.ILooseConditionDecl | loose condition declaration} for this condition.\n * @public\n */\n public toLooseConditionDecl(\n options?: ResourceJson.Helpers.IDeclarationOptions\n ): ResourceJson.Json.ILooseConditionDecl {\n const showDefaults = options?.showDefaults === true;\n return {\n qualifierName: this.qualifier.name,\n value: this.value,\n /* c8 ignore next 1 - not really possible to reproduce right now */\n ...(showDefaults || this.operator !== 'matches' ? { operator: this.operator } : {}),\n ...(showDefaults || this.priority !== this.qualifier.defaultPriority\n ? { priority: this.priority }\n : {}),\n ...(this.scoreAsDefault ? { scoreAsDefault: this.scoreAsDefault } : {})\n };\n }\n\n /**\n * Converts this condition to a compiled condition representation.\n * @param options - Optional compilation options controlling the output format.\n * @returns A compiled condition object that can be used for serialization or runtime processing.\n * @public\n */\n public toCompiled(\n options?: ResourceJson.Compiled.ICompiledResourceOptions\n ): ResourceJson.Compiled.ICompiledCondition {\n /* c8 ignore next 1 - defense in depth */\n const operator = this.operator === 'matches' ? undefined : this.operator;\n return {\n qualifierIndex: this.qualifier.index!,\n operator,\n value: this.value,\n priority: this.priority,\n scoreAsDefault: this.scoreAsDefault,\n ...(options?.includeMetadata === true ? { metadata: { key: this.key } } : {})\n };\n }\n\n /**\n * Gets the {@link ConditionKey | condition key} for a supplied {@link Conditions.IValidatedConditionDecl | condition declaration}.\n * @param decl - The {@link Conditions.IValidatedConditionDecl | condition declaration} for which to get the key.\n * @returns `Success` with the condition key if successful, `Failure` otherwise.\n * @public\n */\n public static getKeyForDecl(decl: IValidatedConditionDecl): Result<ConditionKey> {\n const scoreAsDefault = decl.scoreAsDefault ? `(${scoreFormatter.format(decl.scoreAsDefault)})` : '';\n const key =\n decl.operator === 'matches'\n ? `${decl.qualifier.name}-[${decl.value}]@${decl.priority}${scoreAsDefault}`\n : `${decl.qualifier.name}-${decl.operator}-[${decl.value}]@${decl.priority}${scoreAsDefault}`;\n return Validate.toConditionKey(key);\n }\n}\n"]}