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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (405) hide show
  1. package/CHANGELOG.json +26 -0
  2. package/CHANGELOG.md +14 -0
  3. package/CLAUDE.md +186 -0
  4. package/EXAMPLE_INIT_PARAMS.md +88 -0
  5. package/PROGRESS_SUMMARY.md +48 -0
  6. package/README.md +535 -14
  7. package/dist/ts-res.d.ts +4225 -324
  8. package/dist/tsdoc-metadata.json +1 -1
  9. package/lib/index.d.ts +4 -1
  10. package/lib/index.d.ts.map +1 -1
  11. package/lib/index.js +7 -1
  12. package/lib/index.js.map +1 -1
  13. package/lib/packlets/common/conditions.d.ts +30 -0
  14. package/lib/packlets/common/conditions.d.ts.map +1 -1
  15. package/lib/packlets/common/conditions.js.map +1 -1
  16. package/lib/packlets/common/convert.d.ts +22 -2
  17. package/lib/packlets/common/convert.d.ts.map +1 -1
  18. package/lib/packlets/common/convert.js +21 -1
  19. package/lib/packlets/common/convert.js.map +1 -1
  20. package/lib/packlets/common/helpers/context.d.ts +39 -0
  21. package/lib/packlets/common/helpers/context.d.ts.map +1 -0
  22. package/lib/packlets/common/helpers/context.js +108 -0
  23. package/lib/packlets/common/helpers/context.js.map +1 -0
  24. package/lib/packlets/common/helpers/index.d.ts +2 -0
  25. package/lib/packlets/common/helpers/index.d.ts.map +1 -1
  26. package/lib/packlets/common/helpers/index.js +2 -0
  27. package/lib/packlets/common/helpers/index.js.map +1 -1
  28. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts +39 -0
  29. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +1 -0
  30. package/lib/packlets/common/helpers/qualifierDefaultValues.js +105 -0
  31. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  32. package/lib/packlets/common/helpers/resources.d.ts.map +1 -1
  33. package/lib/packlets/common/helpers/resources.js +6 -2
  34. package/lib/packlets/common/helpers/resources.js.map +1 -1
  35. package/lib/packlets/common/validate/conditions.d.ts +69 -1
  36. package/lib/packlets/common/validate/conditions.d.ts.map +1 -1
  37. package/lib/packlets/common/validate/conditions.js +126 -0
  38. package/lib/packlets/common/validate/conditions.js.map +1 -1
  39. package/lib/packlets/common/validate/regularExpressions.d.ts +20 -0
  40. package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -1
  41. package/lib/packlets/common/validate/regularExpressions.js +21 -1
  42. package/lib/packlets/common/validate/regularExpressions.js.map +1 -1
  43. package/lib/packlets/conditions/condition.d.ts +37 -0
  44. package/lib/packlets/conditions/condition.d.ts.map +1 -1
  45. package/lib/packlets/conditions/condition.js +67 -1
  46. package/lib/packlets/conditions/condition.js.map +1 -1
  47. package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -1
  48. package/lib/packlets/conditions/conditionCollector.js +1 -0
  49. package/lib/packlets/conditions/conditionCollector.js.map +1 -1
  50. package/lib/packlets/conditions/conditionSet.d.ts +34 -3
  51. package/lib/packlets/conditions/conditionSet.d.ts.map +1 -1
  52. package/lib/packlets/conditions/conditionSet.js +31 -3
  53. package/lib/packlets/conditions/conditionSet.js.map +1 -1
  54. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -1
  55. package/lib/packlets/conditions/conditionSetCollector.js +3 -0
  56. package/lib/packlets/conditions/conditionSetCollector.js.map +1 -1
  57. package/lib/packlets/conditions/conditionToken.d.ts.map +1 -1
  58. package/lib/packlets/conditions/conditionToken.js +2 -1
  59. package/lib/packlets/conditions/conditionToken.js.map +1 -1
  60. package/lib/packlets/conditions/convert/decls.js +1 -1
  61. package/lib/packlets/conditions/convert/decls.js.map +1 -1
  62. package/lib/packlets/config/common.d.ts +35 -0
  63. package/lib/packlets/config/common.d.ts.map +1 -0
  64. package/lib/packlets/config/common.js +96 -0
  65. package/lib/packlets/config/common.js.map +1 -0
  66. package/lib/packlets/config/convert.d.ts +14 -0
  67. package/lib/packlets/config/convert.d.ts.map +1 -0
  68. package/lib/packlets/config/convert.js +82 -0
  69. package/lib/packlets/config/convert.js.map +1 -0
  70. package/lib/packlets/config/index.d.ts +6 -0
  71. package/lib/packlets/config/index.d.ts.map +1 -0
  72. package/lib/packlets/config/index.js +67 -0
  73. package/lib/packlets/config/index.js.map +1 -0
  74. package/lib/packlets/config/json.d.ts +20 -0
  75. package/lib/packlets/config/json.d.ts.map +1 -0
  76. package/lib/packlets/config/json.js +24 -0
  77. package/lib/packlets/config/json.js.map +1 -0
  78. package/lib/packlets/config/predefined/default.d.ts +57 -0
  79. package/lib/packlets/config/predefined/default.d.ts.map +1 -0
  80. package/lib/packlets/config/predefined/default.js +141 -0
  81. package/lib/packlets/config/predefined/default.js.map +1 -0
  82. package/lib/packlets/config/predefined/extended.d.ts +25 -0
  83. package/lib/packlets/config/predefined/extended.d.ts.map +1 -0
  84. package/lib/packlets/config/predefined/extended.js +193 -0
  85. package/lib/packlets/config/predefined/extended.js.map +1 -0
  86. package/lib/packlets/config/predefined/index.d.ts +4 -0
  87. package/lib/packlets/config/predefined/index.d.ts.map +1 -0
  88. package/lib/packlets/config/predefined/index.js +62 -0
  89. package/lib/packlets/config/predefined/index.js.map +1 -0
  90. package/lib/packlets/config/systemConfiguration.d.ts +81 -0
  91. package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
  92. package/lib/packlets/config/systemConfiguration.js +172 -0
  93. package/lib/packlets/config/systemConfiguration.js.map +1 -0
  94. package/lib/packlets/context/contextDecls.d.ts +49 -0
  95. package/lib/packlets/context/contextDecls.d.ts.map +1 -0
  96. package/lib/packlets/context/contextDecls.js +24 -0
  97. package/lib/packlets/context/contextDecls.js.map +1 -0
  98. package/lib/packlets/context/contextToken.d.ts +111 -0
  99. package/lib/packlets/context/contextToken.d.ts.map +1 -0
  100. package/lib/packlets/context/contextToken.js +206 -0
  101. package/lib/packlets/context/contextToken.js.map +1 -0
  102. package/lib/packlets/context/convert/decls.d.ts +37 -0
  103. package/lib/packlets/context/convert/decls.d.ts.map +1 -0
  104. package/lib/packlets/context/convert/decls.js +94 -0
  105. package/lib/packlets/context/convert/decls.js.map +1 -0
  106. package/lib/packlets/context/convert/index.d.ts +2 -0
  107. package/lib/packlets/context/convert/index.d.ts.map +1 -0
  108. package/lib/packlets/context/convert/index.js +39 -0
  109. package/lib/packlets/context/convert/index.js.map +1 -0
  110. package/lib/packlets/context/index.d.ts +5 -0
  111. package/lib/packlets/context/index.d.ts.map +1 -0
  112. package/lib/packlets/context/index.js +65 -0
  113. package/lib/packlets/context/index.js.map +1 -0
  114. package/lib/packlets/decisions/abstractDecision.d.ts +8 -0
  115. package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -1
  116. package/lib/packlets/decisions/abstractDecision.js +9 -0
  117. package/lib/packlets/decisions/abstractDecision.js.map +1 -1
  118. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -1
  119. package/lib/packlets/decisions/abstractDecisionCollector.js +2 -0
  120. package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -1
  121. package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -1
  122. package/lib/packlets/decisions/concreteDecision.js +3 -2
  123. package/lib/packlets/decisions/concreteDecision.js.map +1 -1
  124. package/lib/packlets/decisions/decision.d.ts.map +1 -1
  125. package/lib/packlets/decisions/decision.js +4 -0
  126. package/lib/packlets/decisions/decision.js.map +1 -1
  127. package/lib/packlets/import/fsItem.d.ts.map +1 -1
  128. package/lib/packlets/import/fsItem.js +1 -0
  129. package/lib/packlets/import/fsItem.js.map +1 -1
  130. package/lib/packlets/import/importContext.d.ts +19 -0
  131. package/lib/packlets/import/importContext.d.ts.map +1 -1
  132. package/lib/packlets/import/importContext.js +39 -0
  133. package/lib/packlets/import/importContext.js.map +1 -1
  134. package/lib/packlets/import/importManager.d.ts +5 -5
  135. package/lib/packlets/import/importManager.d.ts.map +1 -1
  136. package/lib/packlets/import/importManager.js.map +1 -1
  137. package/lib/packlets/import/importers/collectionImporter.d.ts +11 -13
  138. package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -1
  139. package/lib/packlets/import/importers/collectionImporter.js +29 -20
  140. package/lib/packlets/import/importers/collectionImporter.js.map +1 -1
  141. package/lib/packlets/import/importers/fsItemImporter.d.ts +2 -2
  142. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -1
  143. package/lib/packlets/import/importers/fsItemImporter.js +2 -2
  144. package/lib/packlets/import/importers/fsItemImporter.js.map +1 -1
  145. package/lib/packlets/import/importers/importer.d.ts +3 -3
  146. package/lib/packlets/import/importers/importer.d.ts.map +1 -1
  147. package/lib/packlets/import/importers/importer.js.map +1 -1
  148. package/lib/packlets/import/importers/jsonImporter.d.ts +2 -3
  149. package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -1
  150. package/lib/packlets/import/importers/jsonImporter.js +10 -20
  151. package/lib/packlets/import/importers/jsonImporter.js.map +1 -1
  152. package/lib/packlets/import/importers/pathImporter.d.ts +2 -2
  153. package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -1
  154. package/lib/packlets/import/importers/pathImporter.js.map +1 -1
  155. package/lib/packlets/qualifier-types/config/convert.d.ts +44 -0
  156. package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
  157. package/lib/packlets/qualifier-types/config/convert.js +96 -0
  158. package/lib/packlets/qualifier-types/config/convert.js.map +1 -0
  159. package/lib/packlets/qualifier-types/config/index.d.ts +4 -0
  160. package/lib/packlets/qualifier-types/config/index.d.ts.map +1 -0
  161. package/lib/packlets/qualifier-types/config/index.js +64 -0
  162. package/lib/packlets/qualifier-types/config/index.js.map +1 -0
  163. package/lib/packlets/qualifier-types/config/json.d.ts +69 -0
  164. package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
  165. package/lib/packlets/qualifier-types/config/json.js +24 -0
  166. package/lib/packlets/qualifier-types/config/json.js.map +1 -0
  167. package/lib/packlets/qualifier-types/convert.d.ts +10 -2
  168. package/lib/packlets/qualifier-types/convert.d.ts.map +1 -1
  169. package/lib/packlets/qualifier-types/convert.js +15 -0
  170. package/lib/packlets/qualifier-types/convert.js.map +1 -1
  171. package/lib/packlets/qualifier-types/helpers.d.ts +27 -0
  172. package/lib/packlets/qualifier-types/helpers.d.ts.map +1 -0
  173. package/lib/packlets/qualifier-types/helpers.js +118 -0
  174. package/lib/packlets/qualifier-types/helpers.js.map +1 -0
  175. package/lib/packlets/qualifier-types/index.d.ts +4 -1
  176. package/lib/packlets/qualifier-types/index.d.ts.map +1 -1
  177. package/lib/packlets/qualifier-types/index.js +5 -1
  178. package/lib/packlets/qualifier-types/index.js.map +1 -1
  179. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +19 -8
  180. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -1
  181. package/lib/packlets/qualifier-types/languageQualifierType.js +28 -9
  182. package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -1
  183. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +38 -13
  184. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -1
  185. package/lib/packlets/qualifier-types/literalQualifierType.js +44 -10
  186. package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -1
  187. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts +107 -0
  188. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
  189. package/lib/packlets/qualifier-types/literalValueHierarchy.js +215 -0
  190. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  191. package/lib/packlets/qualifier-types/qualifierType.d.ts +22 -18
  192. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -1
  193. package/lib/packlets/qualifier-types/qualifierType.js +9 -4
  194. package/lib/packlets/qualifier-types/qualifierType.js.map +1 -1
  195. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts +4 -2
  196. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -1
  197. package/lib/packlets/qualifier-types/qualifierTypeCollector.js +2 -1
  198. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -1
  199. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +47 -11
  200. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -1
  201. package/lib/packlets/qualifier-types/territoryQualifierType.js +61 -17
  202. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -1
  203. package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -1
  204. package/lib/packlets/qualifiers/convert/decls.js +17 -15
  205. package/lib/packlets/qualifiers/convert/decls.js.map +1 -1
  206. package/lib/packlets/qualifiers/index.d.ts +2 -0
  207. package/lib/packlets/qualifiers/index.d.ts.map +1 -1
  208. package/lib/packlets/qualifiers/index.js +2 -0
  209. package/lib/packlets/qualifiers/index.js.map +1 -1
  210. package/lib/packlets/qualifiers/qualifier.d.ts +22 -2
  211. package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -1
  212. package/lib/packlets/qualifiers/qualifier.js +26 -1
  213. package/lib/packlets/qualifiers/qualifier.js.map +1 -1
  214. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -1
  215. package/lib/packlets/qualifiers/qualifierCollector.js +4 -0
  216. package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -1
  217. package/lib/packlets/qualifiers/qualifierDecl.d.ts +6 -1
  218. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -1
  219. package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -1
  220. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts +32 -0
  221. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +1 -0
  222. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js +24 -0
  223. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  224. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts +96 -0
  225. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +1 -0
  226. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js +179 -0
  227. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  228. package/lib/packlets/resource-json/compiled/common.d.ts +14 -0
  229. package/lib/packlets/resource-json/compiled/common.d.ts.map +1 -0
  230. package/lib/packlets/resource-json/compiled/common.js +24 -0
  231. package/lib/packlets/resource-json/compiled/common.js.map +1 -0
  232. package/lib/packlets/resource-json/compiled/convert.d.ts +63 -0
  233. package/lib/packlets/resource-json/compiled/convert.d.ts.map +1 -0
  234. package/lib/packlets/resource-json/compiled/convert.js +167 -0
  235. package/lib/packlets/resource-json/compiled/convert.js.map +1 -0
  236. package/lib/packlets/resource-json/compiled/index.d.ts +5 -0
  237. package/lib/packlets/resource-json/compiled/index.d.ts.map +1 -0
  238. package/lib/packlets/resource-json/compiled/index.js +65 -0
  239. package/lib/packlets/resource-json/compiled/index.js.map +1 -0
  240. package/lib/packlets/resource-json/compiled/json.d.ts +204 -0
  241. package/lib/packlets/resource-json/compiled/json.d.ts.map +1 -0
  242. package/lib/packlets/resource-json/compiled/json.js +3 -0
  243. package/lib/packlets/resource-json/compiled/json.js.map +1 -0
  244. package/lib/packlets/resource-json/convert.d.ts +16 -0
  245. package/lib/packlets/resource-json/convert.d.ts.map +1 -1
  246. package/lib/packlets/resource-json/convert.js +41 -6
  247. package/lib/packlets/resource-json/convert.js.map +1 -1
  248. package/lib/packlets/resource-json/helpers.d.ts +82 -3
  249. package/lib/packlets/resource-json/helpers.d.ts.map +1 -1
  250. package/lib/packlets/resource-json/helpers.js +185 -2
  251. package/lib/packlets/resource-json/helpers.js.map +1 -1
  252. package/lib/packlets/resource-json/index.d.ts +2 -1
  253. package/lib/packlets/resource-json/index.d.ts.map +1 -1
  254. package/lib/packlets/resource-json/index.js +3 -1
  255. package/lib/packlets/resource-json/index.js.map +1 -1
  256. package/lib/packlets/resource-json/json.d.ts +55 -3
  257. package/lib/packlets/resource-json/json.d.ts.map +1 -1
  258. package/lib/packlets/resource-json/json.js +16 -0
  259. package/lib/packlets/resource-json/json.js.map +1 -1
  260. package/lib/packlets/resource-json/normalized.d.ts +46 -3
  261. package/lib/packlets/resource-json/normalized.d.ts.map +1 -1
  262. package/lib/packlets/resource-json/normalized.js.map +1 -1
  263. package/lib/packlets/resource-json/resourceDeclCollection.d.ts +14 -10
  264. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -1
  265. package/lib/packlets/resource-json/resourceDeclCollection.js +18 -14
  266. package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -1
  267. package/lib/packlets/resource-json/resourceDeclContainer.d.ts +15 -2
  268. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -1
  269. package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -1
  270. package/lib/packlets/resource-json/resourceDeclTree.d.ts +6 -2
  271. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -1
  272. package/lib/packlets/resource-json/resourceDeclTree.js +12 -3
  273. package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -1
  274. package/lib/packlets/resource-types/config/convert.d.ts +8 -0
  275. package/lib/packlets/resource-types/config/convert.d.ts.map +1 -0
  276. package/lib/packlets/resource-types/config/convert.js +36 -0
  277. package/lib/packlets/resource-types/config/convert.js.map +1 -0
  278. package/lib/packlets/resource-types/config/index.d.ts +4 -0
  279. package/lib/packlets/resource-types/config/index.d.ts.map +1 -0
  280. package/lib/packlets/resource-types/config/index.js +64 -0
  281. package/lib/packlets/resource-types/config/index.js.map +1 -0
  282. package/lib/packlets/resource-types/config/json.d.ts +9 -0
  283. package/lib/packlets/resource-types/config/json.d.ts.map +1 -0
  284. package/lib/packlets/resource-types/config/json.js +24 -0
  285. package/lib/packlets/resource-types/config/json.js.map +1 -0
  286. package/lib/packlets/resource-types/helpers.d.ts +13 -0
  287. package/lib/packlets/resource-types/helpers.d.ts.map +1 -0
  288. package/lib/packlets/resource-types/helpers.js +44 -0
  289. package/lib/packlets/resource-types/helpers.js.map +1 -0
  290. package/lib/packlets/resource-types/index.d.ts +3 -0
  291. package/lib/packlets/resource-types/index.d.ts.map +1 -1
  292. package/lib/packlets/resource-types/index.js +26 -0
  293. package/lib/packlets/resource-types/index.js.map +1 -1
  294. package/lib/packlets/resource-types/jsonResourceType.d.ts +5 -13
  295. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -1
  296. package/lib/packlets/resource-types/jsonResourceType.js +5 -2
  297. package/lib/packlets/resource-types/jsonResourceType.js.map +1 -1
  298. package/lib/packlets/resource-types/resourceType.d.ts +33 -32
  299. package/lib/packlets/resource-types/resourceType.d.ts.map +1 -1
  300. package/lib/packlets/resource-types/resourceType.js.map +1 -1
  301. package/lib/packlets/resources/candidateReducer.d.ts +98 -0
  302. package/lib/packlets/resources/candidateReducer.d.ts.map +1 -0
  303. package/lib/packlets/resources/candidateReducer.js +247 -0
  304. package/lib/packlets/resources/candidateReducer.js.map +1 -0
  305. package/lib/packlets/resources/common.d.ts +60 -0
  306. package/lib/packlets/resources/common.d.ts.map +1 -0
  307. package/lib/packlets/resources/common.js +24 -0
  308. package/lib/packlets/resources/common.js.map +1 -0
  309. package/lib/packlets/resources/index.d.ts +3 -1
  310. package/lib/packlets/resources/index.d.ts.map +1 -1
  311. package/lib/packlets/resources/index.js +3 -1
  312. package/lib/packlets/resources/index.js.map +1 -1
  313. package/lib/packlets/resources/resource.d.ts +57 -5
  314. package/lib/packlets/resources/resource.d.ts.map +1 -1
  315. package/lib/packlets/resources/resource.js +96 -6
  316. package/lib/packlets/resources/resource.js.map +1 -1
  317. package/lib/packlets/resources/resourceBuilder.d.ts +14 -0
  318. package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -1
  319. package/lib/packlets/resources/resourceBuilder.js +19 -1
  320. package/lib/packlets/resources/resourceBuilder.js.map +1 -1
  321. package/lib/packlets/resources/resourceCandidate.d.ts +42 -6
  322. package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -1
  323. package/lib/packlets/resources/resourceCandidate.js +40 -1
  324. package/lib/packlets/resources/resourceCandidate.js.map +1 -1
  325. package/lib/packlets/resources/resourceManagerBuilder.d.ts +220 -0
  326. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
  327. package/lib/packlets/resources/resourceManagerBuilder.js +451 -0
  328. package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -0
  329. package/lib/packlets/runtime/cacheListener.d.ts +62 -0
  330. package/lib/packlets/runtime/cacheListener.d.ts.map +1 -0
  331. package/lib/packlets/runtime/cacheListener.js +56 -0
  332. package/lib/packlets/runtime/cacheListener.js.map +1 -0
  333. package/lib/packlets/runtime/cacheMetrics.d.ts +82 -0
  334. package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -0
  335. package/lib/packlets/runtime/cacheMetrics.js +143 -0
  336. package/lib/packlets/runtime/cacheMetrics.js.map +1 -0
  337. package/lib/packlets/runtime/compiledResourceCollection.d.ts +167 -0
  338. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
  339. package/lib/packlets/runtime/compiledResourceCollection.js +466 -0
  340. package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -0
  341. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts +70 -0
  342. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +1 -0
  343. package/lib/packlets/runtime/conditionSetResolutionResult.js +135 -0
  344. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  345. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts +80 -0
  346. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +1 -0
  347. package/lib/packlets/runtime/context/contextQualifierProvider.js +33 -0
  348. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  349. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts +165 -0
  350. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +1 -0
  351. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js +179 -0
  352. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  353. package/lib/packlets/runtime/context/index.d.ts +5 -0
  354. package/lib/packlets/runtime/context/index.d.ts.map +1 -0
  355. package/lib/packlets/runtime/context/index.js +42 -0
  356. package/lib/packlets/runtime/context/index.js.map +1 -0
  357. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +111 -0
  358. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -0
  359. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +177 -0
  360. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  361. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +47 -0
  362. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -0
  363. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +64 -0
  364. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  365. package/lib/packlets/runtime/iResourceManager.d.ts +88 -0
  366. package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -0
  367. package/lib/packlets/runtime/iResourceManager.js +24 -0
  368. package/lib/packlets/runtime/iResourceManager.js.map +1 -0
  369. package/lib/packlets/runtime/index.d.ts +12 -0
  370. package/lib/packlets/runtime/index.d.ts.map +1 -0
  371. package/lib/packlets/runtime/index.js +73 -0
  372. package/lib/packlets/runtime/index.js.map +1 -0
  373. package/lib/packlets/runtime/resource-tree/common.d.ts +91 -0
  374. package/lib/packlets/runtime/resource-tree/common.d.ts.map +1 -0
  375. package/lib/packlets/runtime/resource-tree/common.js +24 -0
  376. package/lib/packlets/runtime/resource-tree/common.js.map +1 -0
  377. package/lib/packlets/runtime/resource-tree/index.d.ts +5 -0
  378. package/lib/packlets/runtime/resource-tree/index.d.ts.map +1 -0
  379. package/lib/packlets/runtime/resource-tree/index.js +42 -0
  380. package/lib/packlets/runtime/resource-tree/index.js.map +1 -0
  381. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts +141 -0
  382. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +1 -0
  383. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js +224 -0
  384. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  385. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts +24 -0
  386. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +1 -0
  387. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js +98 -0
  388. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  389. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts +99 -0
  390. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +1 -0
  391. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +165 -0
  392. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  393. package/lib/packlets/runtime/resourceResolver.d.ts +196 -0
  394. package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -0
  395. package/lib/packlets/runtime/resourceResolver.js +437 -0
  396. package/lib/packlets/runtime/resourceResolver.js.map +1 -0
  397. package/lib/packlets/runtime/validate.d.ts +13 -0
  398. package/lib/packlets/runtime/validate.d.ts.map +1 -0
  399. package/lib/packlets/runtime/validate.js +49 -0
  400. package/lib/packlets/runtime/validate.js.map +1 -0
  401. package/package.json +76 -75
  402. package/lib/packlets/resources/resourceManager.d.ts +0 -104
  403. package/lib/packlets/resources/resourceManager.d.ts.map +0 -1
  404. package/lib/packlets/resources/resourceManager.js +0 -201
  405. package/lib/packlets/resources/resourceManager.js.map +0 -1
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2025 Erik Fortune
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be included in all
13
+ * copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ * SOFTWARE.
22
+ */
23
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
24
+ if (k2 === undefined) k2 = k;
25
+ var desc = Object.getOwnPropertyDescriptor(m, k);
26
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
27
+ desc = { enumerable: true, get: function() { return m[k]; } };
28
+ }
29
+ Object.defineProperty(o, k2, desc);
30
+ }) : (function(o, m, k, k2) {
31
+ if (k2 === undefined) k2 = k;
32
+ o[k2] = m[k];
33
+ }));
34
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
35
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
36
+ }) : function(o, v) {
37
+ o["default"] = v;
38
+ });
39
+ var __importStar = (this && this.__importStar) || (function () {
40
+ var ownKeys = function(o) {
41
+ ownKeys = Object.getOwnPropertyNames || function (o) {
42
+ var ar = [];
43
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
44
+ return ar;
45
+ };
46
+ return ownKeys(o);
47
+ };
48
+ return function (mod) {
49
+ if (mod && mod.__esModule) return mod;
50
+ var result = {};
51
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
52
+ __setModuleDefault(result, mod);
53
+ return result;
54
+ };
55
+ })();
56
+ Object.defineProperty(exports, "__esModule", { value: true });
57
+ exports.buildQualifierDefaultValueToken = buildQualifierDefaultValueToken;
58
+ exports.buildQualifierDefaultValuesToken = buildQualifierDefaultValuesToken;
59
+ exports.parseQualifierDefaultValueTokenParts = parseQualifierDefaultValueTokenParts;
60
+ exports.parseQualifierDefaultValuesTokenParts = parseQualifierDefaultValuesTokenParts;
61
+ const ts_utils_1 = require("@fgv/ts-utils");
62
+ const Validate = __importStar(require("../validate"));
63
+ /**
64
+ * Converts a {@link Helpers.IQualifierDefaultValueTokenParts | the parts that make up a qualifier default value token} into
65
+ * a syntactically validated {@link QualifierDefaultValueToken | qualifier default value token}.
66
+ * @param parts - the parts to convert
67
+ * @public
68
+ */
69
+ function buildQualifierDefaultValueToken({ qualifier, value }) {
70
+ return Validate.toQualifierDefaultValueToken(`${qualifier}=${value}`);
71
+ }
72
+ /**
73
+ * Converts an array of {@link Helpers.IQualifierDefaultValueTokenParts | qualifier default value token parts} into a
74
+ * syntactically validated {@link QualifierDefaultValuesToken | qualifier default values token}.
75
+ * @param parts - the parts to convert
76
+ * @public
77
+ */
78
+ function buildQualifierDefaultValuesToken(parts) {
79
+ return (0, ts_utils_1.mapResults)(parts.map(buildQualifierDefaultValueToken)).onSuccess((tokens) => Validate.toQualifierDefaultValuesToken(tokens.join('|')));
80
+ }
81
+ /**
82
+ * Parses a qualifier default value token string into its {@link Helpers.IQualifierDefaultValueTokenParts | parts}.
83
+ * @param token - the token string to parse.
84
+ * @returns `Success` with the parts if successful, `Failure` with an error message if not.
85
+ * @public
86
+ */
87
+ function parseQualifierDefaultValueTokenParts(token) {
88
+ return Validate.toQualifierDefaultValueToken(token).onSuccess((t) => {
89
+ const [qualifier, value] = t.split('=');
90
+ return (0, ts_utils_1.succeed)({ qualifier, value });
91
+ });
92
+ }
93
+ /**
94
+ * Parses a qualifier default values token string into an array of {@link Helpers.IQualifierDefaultValueTokenParts | qualifier default value token parts}.
95
+ * @param token - the qualifier default values token string to parse.
96
+ * @returns `Success` with the parts if successful, `Failure` with an error message if not.
97
+ * @public
98
+ */
99
+ function parseQualifierDefaultValuesTokenParts(token) {
100
+ if (token === '') {
101
+ return (0, ts_utils_1.succeed)([]);
102
+ }
103
+ return (0, ts_utils_1.mapResults)(token.split('|').map((part) => parseQualifierDefaultValueTokenParts(part.trim())));
104
+ }
105
+ //# sourceMappingURL=qualifierDefaultValues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualifierDefaultValues.js","sourceRoot":"","sources":["../../../../src/packlets/common/helpers/qualifierDefaultValues.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBH,0EAKC;AAQD,4EAMC;AAQD,oFAOC;AAQD,sFAOC;AApED,4CAA4D;AAC5D,sDAAwC;AAYxC;;;;;GAKG;AACH,SAAgB,+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,SAAgB,gCAAgC,CAC9C,KAAsD;IAEtD,OAAO,IAAA,qBAAU,EAAC,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,SAAgB,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,IAAA,kBAAO,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,SAAgB,qCAAqC,CACnD,KAAa;IAEb,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;QACjB,OAAO,IAAA,kBAAO,EAAC,EAAE,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,IAAA,qBAAU,EAAC,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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../../src/packlets/common/helpers/resources.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAqB,MAAM,EAAuB,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGxD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC,CAK9E;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,GAAG,GAAG,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAQlF;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,GAAG,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GAAG,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC,CAQtG"}
1
+ {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../../src/packlets/common/helpers/resources.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAqB,MAAM,EAAuB,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGxD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC,CAK9E;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,GAAG,GAAG,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAUlF;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,GAAG,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GAAG,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC,CAUtG"}
@@ -53,7 +53,9 @@ function splitResourceId(id) {
53
53
  function joinResourceIds(...ids) {
54
54
  const errors = new ts_utils_1.MessageAggregator();
55
55
  const parts = [];
56
- ids.forEach((id) => {
56
+ ids
57
+ .filter((id) => id !== '')
58
+ .forEach((id) => {
57
59
  parts.push(...splitResourceId(id).aggregateError(errors).orDefault([]));
58
60
  });
59
61
  const id = parts.join('.');
@@ -72,7 +74,9 @@ function joinResourceIds(...ids) {
72
74
  function joinOptionalResourceIds(...ids) {
73
75
  const errors = new ts_utils_1.MessageAggregator();
74
76
  const parts = [];
75
- ids.forEach((id) => {
77
+ ids
78
+ .filter((id) => id !== '')
79
+ .forEach((id) => {
76
80
  parts.push(...splitResourceId(id).aggregateError(errors).orDefault([]));
77
81
  });
78
82
  const id = parts.join('.');
@@ -1 +1 @@
1
- {"version":3,"file":"resources.js","sourceRoot":"","sources":["../../../../src/packlets/common/helpers/resources.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAcH,0CAKC;AAYD,0CAQC;AAYD,0DAQC;AAzDD,4CAA+E;AAE/E,qDAAqE;AAErE;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,EAAsB;IACpD,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QACrB,OAAO,IAAA,kBAAO,EAAC,EAAE,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,IAAA,qBAAU,EAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,0BAAc,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,eAAe,CAAC,GAAG,GAA2B;IAC5D,MAAM,MAAM,GAAsB,IAAI,4BAAiB,EAAE,CAAC;IAC1D,MAAM,KAAK,GAAmB,EAAE,CAAC;IACjC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;QACjB,KAAK,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IACH,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,OAAO,MAAM,CAAC,cAAc,CAAC,IAAA,wBAAY,EAAC,EAAE,CAAC,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,uBAAuB,CAAC,GAAG,GAA2B;IACpE,MAAM,MAAM,GAAsB,IAAI,4BAAiB,EAAE,CAAC;IAC1D,MAAM,KAAK,GAAmB,EAAE,CAAC;IACjC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;QACjB,KAAK,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IACH,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,OAAO,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,IAAA,wBAAY,EAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAA,kBAAO,EAAC,SAAS,CAAC,CAAC,CAAC;AAC3E,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 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 base - The base name or ID to join.\n * @param names - Additional names 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.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 base - The base name or ID to join.\n * @param names - Additional names 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.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"]}
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["../../../../src/packlets/common/helpers/resources.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAcH,0CAKC;AAYD,0CAUC;AAYD,0DAUC;AA7DD,4CAA+E;AAE/E,qDAAqE;AAErE;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,EAAsB;IACpD,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QACrB,OAAO,IAAA,kBAAO,EAAC,EAAE,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,IAAA,qBAAU,EAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,0BAAc,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,eAAe,CAAC,GAAG,GAA2B;IAC5D,MAAM,MAAM,GAAsB,IAAI,4BAAiB,EAAE,CAAC;IAC1D,MAAM,KAAK,GAAmB,EAAE,CAAC;IACjC,GAAG;SACA,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;SACzB,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;QACd,KAAK,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IACL,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,OAAO,MAAM,CAAC,cAAc,CAAC,IAAA,wBAAY,EAAC,EAAE,CAAC,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,uBAAuB,CAAC,GAAG,GAA2B;IACpE,MAAM,MAAM,GAAsB,IAAI,4BAAiB,EAAE,CAAC;IAC1D,MAAM,KAAK,GAAmB,EAAE,CAAC;IACjC,GAAG;SACA,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;SACzB,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;QACd,KAAK,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IACL,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,OAAO,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,IAAA,wBAAY,EAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAA,kBAAO,EAAC,SAAS,CAAC,CAAC,CAAC;AAC3E,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 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 base - The base name or ID to join.\n * @param names - Additional names 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 base - The base name or ID to join.\n * @param names - Additional names 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"]}
@@ -1,5 +1,5 @@
1
1
  import { Result } from '@fgv/ts-utils';
2
- import { ConditionPriority, QualifierName, QualifierTypeName, QualifierIndex, QualifierTypeIndex, ConditionIndex, ConditionSetIndex, QualifierMatchScore, ConditionKey, ConditionSetKey, DecisionKey, DecisionIndex, ConditionSetHash, ConditionOperator, ConditionToken, ConditionSetToken } from '../conditions';
2
+ import { ConditionPriority, QualifierName, QualifierTypeName, QualifierIndex, QualifierTypeIndex, ConditionIndex, ConditionSetIndex, QualifierMatchScore, ConditionKey, ConditionSetKey, DecisionKey, DecisionIndex, ConditionSetHash, ConditionOperator, ConditionToken, ConditionSetToken, ContextQualifierToken, ContextToken, QualifierDefaultValueToken, QualifierDefaultValuesToken } from '../conditions';
3
3
  /**
4
4
  * Determines whether a string is a valid qualifier name.
5
5
  * @param name - the string to validate
@@ -245,4 +245,72 @@ export declare function toDecisionKey(key: string): Result<DecisionKey>;
245
245
  * @public
246
246
  */
247
247
  export declare function toDecisionIndex(index: number): Result<DecisionIndex>;
248
+ /**
249
+ * Determines whether a string is a valid {@link ContextQualifierToken | context qualifier token}.
250
+ * A context qualifier token has the format:
251
+ * `<qualifierName>=<value>` or `<value>`
252
+ * Context qualifier tokens allow broader character set including commas for comma-separated values.
253
+ * @param token - the string to validate
254
+ * @returns `true` if the string is a valid context qualifier token, `false` otherwise.
255
+ * @public
256
+ */
257
+ export declare function isValidContextQualifierToken(token: string): token is ContextQualifierToken;
258
+ /**
259
+ * Determines whether a string is a valid context token.
260
+ * Context tokens are pipe-separated lists of context qualifier tokens.
261
+ * @param token - the string to validate.
262
+ * @returns `true` if the string is a valid context token, `false` otherwise.
263
+ * @public
264
+ */
265
+ export declare function isValidContextToken(token: string): token is ContextToken;
266
+ /**
267
+ * Converts a string to a {@link ContextQualifierToken} if it is a valid context qualifier token.
268
+ * @param token - the string to convert
269
+ * @returns `Success` with the converted {@link ContextQualifierToken} if successful, or `Failure` with an
270
+ * error message if not.
271
+ * @public
272
+ */
273
+ export declare function toContextQualifierToken(token: string): Result<ContextQualifierToken>;
274
+ /**
275
+ * Converts a string to a {@link ContextToken} if it is a valid context token.
276
+ * @param token - the string to convert
277
+ * @returns `Success` with the converted {@link ContextToken} if successful, or `Failure` with an
278
+ * error message if not.
279
+ * @public
280
+ */
281
+ export declare function toContextToken(token: string): Result<ContextToken>;
282
+ /**
283
+ * Determines whether a string is a valid {@link QualifierDefaultValueToken | qualifier default value token}.
284
+ * A qualifier default value token has the format:
285
+ * `<qualifierName>=<value>` or `<qualifierName>=` (to remove default)
286
+ * Default values allow broader character set including commas for comma-separated values.
287
+ * @param token - the string to validate
288
+ * @returns `true` if the string is a valid qualifier default value token, `false` otherwise.
289
+ * @public
290
+ */
291
+ export declare function isValidQualifierDefaultValueToken(token: string): token is QualifierDefaultValueToken;
292
+ /**
293
+ * Determines whether a string is a valid qualifier default values token.
294
+ * Qualifier default values tokens are pipe-separated lists of qualifier default value tokens.
295
+ * @param token - the string to validate.
296
+ * @returns `true` if the string is a valid qualifier default values token, `false` otherwise.
297
+ * @public
298
+ */
299
+ export declare function isValidQualifierDefaultValuesToken(token: string): token is QualifierDefaultValuesToken;
300
+ /**
301
+ * Converts a string to a {@link QualifierDefaultValueToken} if it is a valid qualifier default value token.
302
+ * @param token - the string to convert
303
+ * @returns `Success` with the converted {@link QualifierDefaultValueToken} if successful, or `Failure` with an
304
+ * error message if not.
305
+ * @public
306
+ */
307
+ export declare function toQualifierDefaultValueToken(token: string): Result<QualifierDefaultValueToken>;
308
+ /**
309
+ * Converts a string to a {@link QualifierDefaultValuesToken} if it is a valid qualifier default values token.
310
+ * @param token - the string to convert
311
+ * @returns `Success` with the converted {@link QualifierDefaultValuesToken} if successful, or `Failure` with an
312
+ * error message if not.
313
+ * @public
314
+ */
315
+ export declare function toQualifierDefaultValuesToken(token: string): Result<QualifierDefaultValuesToken>;
248
316
  //# sourceMappingURL=conditions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../../../src/packlets/common/validate/conditions.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AACtD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,eAAe,EACf,WAAW,EACX,aAAa,EACb,gBAAgB,EAKhB,iBAAiB,EAEjB,cAAc,EACd,iBAAiB,EAClB,MAAM,eAAe,CAAC;AASvB;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,aAAa,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,iBAAiB,CAEhF;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,IAAI,iBAAiB,CAExF;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,cAAc,CAE5E;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,kBAAkB,CAEpF;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,mBAAmB,CAEtF;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,cAAc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E"}
1
+ {"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../../../src/packlets/common/validate/conditions.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AACtD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,eAAe,EACf,WAAW,EACX,aAAa,EACb,gBAAgB,EAKhB,iBAAiB,EAEjB,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,EACZ,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,eAAe,CAAC;AAYvB;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,aAAa,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,iBAAiB,CAEhF;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,IAAI,iBAAiB,CAExF;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,cAAc,CAE5E;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,kBAAkB,CAEpF;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,mBAAmB,CAEtF;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,cAAc,CAE5E;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,IAAI,iBAAiB,CAExF;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAA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AC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,YAAY,CAOxE;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAMpF;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,CAMlE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,0BAA0B,CAEpG;AAED;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,2BAA2B,CAMtG;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAM9F;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAMhG"}
@@ -53,6 +53,14 @@ exports.toConditionSetToken = toConditionSetToken;
53
53
  exports.toConditionSetHash = toConditionSetHash;
54
54
  exports.toDecisionKey = toDecisionKey;
55
55
  exports.toDecisionIndex = toDecisionIndex;
56
+ exports.isValidContextQualifierToken = isValidContextQualifierToken;
57
+ exports.isValidContextToken = isValidContextToken;
58
+ exports.toContextQualifierToken = toContextQualifierToken;
59
+ exports.toContextToken = toContextToken;
60
+ exports.isValidQualifierDefaultValueToken = isValidQualifierDefaultValueToken;
61
+ exports.isValidQualifierDefaultValuesToken = isValidQualifierDefaultValuesToken;
62
+ exports.toQualifierDefaultValueToken = toQualifierDefaultValueToken;
63
+ exports.toQualifierDefaultValuesToken = toQualifierDefaultValuesToken;
56
64
  const ts_utils_1 = require("@fgv/ts-utils");
57
65
  const conditions_1 = require("../conditions");
58
66
  const regularExpressions_1 = require("./regularExpressions");
@@ -224,6 +232,7 @@ function isValidDecisionIndex(index) {
224
232
  * @public
225
233
  */
226
234
  function toQualifierName(name) {
235
+ /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
227
236
  if (!isValidQualifierName(name)) {
228
237
  return (0, ts_utils_1.fail)(`${name}: not a valid qualifier name`);
229
238
  }
@@ -251,6 +260,7 @@ function toQualifierIndex(index) {
251
260
  * @public
252
261
  */
253
262
  function toQualifierTypeName(name) {
263
+ /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
254
264
  if (!isValidQualifierTypeName(name)) {
255
265
  return (0, ts_utils_1.fail)(`${name}: not a valid qualifier type name`);
256
266
  }
@@ -264,6 +274,7 @@ function toQualifierTypeName(name) {
264
274
  * @public
265
275
  */
266
276
  function toQualifierTypeIndex(index) {
277
+ /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
267
278
  if (!isValidQualifierTypeIndex(index)) {
268
279
  return (0, ts_utils_1.fail)(`${index}: not a valid qualifier type index`);
269
280
  }
@@ -277,6 +288,7 @@ function toQualifierTypeIndex(index) {
277
288
  * @public
278
289
  */
279
290
  function toQualifierMatchScore(value) {
291
+ /* c8 ignore next 3 - coverage is having a bad day */
280
292
  if (!isValidQualifierMatchScore(value)) {
281
293
  return (0, ts_utils_1.fail)(`${value}: not a valid match score`);
282
294
  }
@@ -387,6 +399,7 @@ function toConditionSetKey(key) {
387
399
  * @public
388
400
  */
389
401
  function toConditionSetToken(token) {
402
+ /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
390
403
  if (!isValidConditionSetToken(token)) {
391
404
  return (0, ts_utils_1.fail)(`${token}: not a valid condition set token`);
392
405
  }
@@ -433,4 +446,117 @@ function toDecisionIndex(index) {
433
446
  }
434
447
  return (0, ts_utils_1.succeed)(index);
435
448
  }
449
+ /**
450
+ * Determines whether a string is a valid {@link ContextQualifierToken | context qualifier token}.
451
+ * A context qualifier token has the format:
452
+ * `<qualifierName>=<value>` or `<value>`
453
+ * Context qualifier tokens allow broader character set including commas for comma-separated values.
454
+ * @param token - the string to validate
455
+ * @returns `true` if the string is a valid context qualifier token, `false` otherwise.
456
+ * @public
457
+ */
458
+ function isValidContextQualifierToken(token) {
459
+ /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
460
+ if (token === '') {
461
+ return true;
462
+ }
463
+ return regularExpressions_1.contextToken.test(token);
464
+ }
465
+ /**
466
+ * Determines whether a string is a valid context token.
467
+ * Context tokens are pipe-separated lists of context qualifier tokens.
468
+ * @param token - the string to validate.
469
+ * @returns `true` if the string is a valid context token, `false` otherwise.
470
+ * @public
471
+ */
472
+ function isValidContextToken(token) {
473
+ /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
474
+ if (token === '') {
475
+ return true;
476
+ }
477
+ const parts = token.split('|').map((part) => part.trim());
478
+ return parts.every((part) => part !== '' && isValidContextQualifierToken(part));
479
+ }
480
+ /**
481
+ * Converts a string to a {@link ContextQualifierToken} if it is a valid context qualifier token.
482
+ * @param token - the string to convert
483
+ * @returns `Success` with the converted {@link ContextQualifierToken} if successful, or `Failure` with an
484
+ * error message if not.
485
+ * @public
486
+ */
487
+ function toContextQualifierToken(token) {
488
+ /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
489
+ if (!isValidContextQualifierToken(token)) {
490
+ return (0, ts_utils_1.fail)(`${token}: not a valid context qualifier token`);
491
+ }
492
+ return (0, ts_utils_1.succeed)(token);
493
+ }
494
+ /**
495
+ * Converts a string to a {@link ContextToken} if it is a valid context token.
496
+ * @param token - the string to convert
497
+ * @returns `Success` with the converted {@link ContextToken} if successful, or `Failure` with an
498
+ * error message if not.
499
+ * @public
500
+ */
501
+ function toContextToken(token) {
502
+ /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
503
+ if (!isValidContextToken(token)) {
504
+ return (0, ts_utils_1.fail)(`${token}: not a valid context token`);
505
+ }
506
+ return (0, ts_utils_1.succeed)(token);
507
+ }
508
+ /**
509
+ * Determines whether a string is a valid {@link QualifierDefaultValueToken | qualifier default value token}.
510
+ * A qualifier default value token has the format:
511
+ * `<qualifierName>=<value>` or `<qualifierName>=` (to remove default)
512
+ * Default values allow broader character set including commas for comma-separated values.
513
+ * @param token - the string to validate
514
+ * @returns `true` if the string is a valid qualifier default value token, `false` otherwise.
515
+ * @public
516
+ */
517
+ function isValidQualifierDefaultValueToken(token) {
518
+ return regularExpressions_1.qualifierDefaultValueToken.test(token);
519
+ }
520
+ /**
521
+ * Determines whether a string is a valid qualifier default values token.
522
+ * Qualifier default values tokens are pipe-separated lists of qualifier default value tokens.
523
+ * @param token - the string to validate.
524
+ * @returns `true` if the string is a valid qualifier default values token, `false` otherwise.
525
+ * @public
526
+ */
527
+ function isValidQualifierDefaultValuesToken(token) {
528
+ /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
529
+ if (token === '') {
530
+ return true;
531
+ }
532
+ return regularExpressions_1.qualifierDefaultValuesToken.test(token);
533
+ }
534
+ /**
535
+ * Converts a string to a {@link QualifierDefaultValueToken} if it is a valid qualifier default value token.
536
+ * @param token - the string to convert
537
+ * @returns `Success` with the converted {@link QualifierDefaultValueToken} if successful, or `Failure` with an
538
+ * error message if not.
539
+ * @public
540
+ */
541
+ function toQualifierDefaultValueToken(token) {
542
+ /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
543
+ if (!isValidQualifierDefaultValueToken(token)) {
544
+ return (0, ts_utils_1.fail)(`${token}: not a valid qualifier default value token`);
545
+ }
546
+ return (0, ts_utils_1.succeed)(token);
547
+ }
548
+ /**
549
+ * Converts a string to a {@link QualifierDefaultValuesToken} if it is a valid qualifier default values token.
550
+ * @param token - the string to convert
551
+ * @returns `Success` with the converted {@link QualifierDefaultValuesToken} if successful, or `Failure` with an
552
+ * error message if not.
553
+ * @public
554
+ */
555
+ function toQualifierDefaultValuesToken(token) {
556
+ /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
557
+ if (!isValidQualifierDefaultValuesToken(token)) {
558
+ return (0, ts_utils_1.fail)(`${token}: not a valid qualifier default values token`);
559
+ }
560
+ return (0, ts_utils_1.succeed)(token);
561
+ }
436
562
  //# sourceMappingURL=conditions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/packlets/common/validate/conditions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAwCH,oDAEC;AAQD,4DAEC;AAQD,4DAEC;AAQD,sDAEC;AAQD,8DAEC;AAQD,gEAEC;AAQD,sDAEC;AAQD,4DAEC;AAWD,kDAEC;AAUD,sDAMC;AAQD,4DAEC;AAQD,wDAMC;AAQD,4DAEC;AAQD,0DAEC;AAQD,gDAKC;AAQD,oDAEC;AASD,0CAKC;AASD,4CAMC;AASD,kDAKC;AASD,oDAKC;AASD,sDAKC;AASD,kDAMC;AASD,4CAMC;AASD,kDAKC;AASD,wCAMC;AASD,4CAMC;AASD,kDAMC;AASD,8CAMC;AASD,kDAKC;AASD,gDAKC;AASD,sCAMC;AASD,0CAMC;AAvbD,4CAAsD;AACtD,8CAsBuB;AACvB,6DAM8B;AAE9B;;;;;GAKG;AACH,SAAgB,oBAAoB,CAAC,IAAY;IAC/C,OAAO,+BAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;GAKG;AACH,SAAgB,wBAAwB,CAAC,IAAY;IACnD,OAAO,+BAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;GAKG;AACH,SAAgB,wBAAwB,CAAC,QAAgB;IACvD,OAAO,QAAQ,IAAI,iCAAoB,IAAI,QAAQ,IAAI,iCAAoB,CAAC;AAC9E,CAAC;AAED;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,KAAa;IACjD,OAAO,KAAK,IAAI,CAAC,CAAC;AACpB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,yBAAyB,CAAC,KAAa;IACrD,OAAO,KAAK,IAAI,CAAC,CAAC;AACpB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,0BAA0B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kC,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC;AACvB,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,GAAW;IACvC,qDAAqD;IACrD,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7B,OAAO,IAAA,eAAI,EAAC,GAAG,GAAG,4BAA4B,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,IAAA,kBAAO,EAAC,GAAG,CAAC,CAAC;AACtB,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,eAAe,CAAC,KAAa;IAC3C,qDAAqD;IACrD,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,IAAA,eAAI,EAAC,GAAG,KAAK,8BAA8B,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,IAAA,kBAAO,EAAC,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 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} from '../conditions';\nimport {\n conditionKey,\n conditionSetHash,\n conditionToken,\n decisionKey,\n identifier\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 // 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 * 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 if (!isValidQualifierName(name)) {\n return fail(`${name}: not a valid qualifier name`);\n }\n return succeed(name);\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}: not a valid 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 if (!isValidQualifierTypeName(name)) {\n return fail(`${name}: not a valid 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 if (!isValidQualifierTypeIndex(index)) {\n return fail(`${index}: not a valid 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 if (!isValidQualifierMatchScore(value)) {\n return fail(`${value}: not a valid 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}: not a valid 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}: not a valid 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}: not a valid 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}: not a valid 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}: not a valid 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}: not a valid 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}: not a valid 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 if (!isValidConditionSetToken(token)) {\n return fail(`${token}: not a valid 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 key - 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}: not a valid condition set hash`);\n }\n return succeed(hash);\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 toDecisionKey(key: string): Result<DecisionKey> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidDecisionKey(key)) {\n return fail(`${key}: not a valid 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}: not a valid decision index`);\n }\n return succeed(index);\n}\n"]}
1
+ {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/packlets/common/validate/conditions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AA+CH,oDAEC;AAQD,4DAEC;AAQD,4DAEC;AAQD,sDAEC;AAQD,8DAEC;AAQD,gEAEC;AAQD,sDAEC;AAQD,4DAEC;AAWD,kDAEC;AAUD,sDAMC;AAQD,4DAEC;AAQD,wDAMC;AAQD,4DAEC;AAQD,0DAEC;AAQD,gDAKC;AAQD,oDAEC;AASD,0CAMC;AASD,4CAMC;AASD,kDAMC;AASD,oDAMC;AASD,sDAMC;AASD,kDAMC;AASD,4CAMC;AASD,k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;IACvF,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,IAAA,eAAI,EAAC,GAAG,KAAK,6BAA6B,CAAC,CAAC;IACrD,CAAC;IACD,OAAO,IAAA,kBAAO,EAAC,KAAK,CAAC,CAAC;AACxB,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,iCAAiC,CAAC,KAAa;IAC7D,OAAO,+CAA0B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,kCAAkC,CAAC,KAAa;IAC9D,uFAAuF;IACvF,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,gDAA2B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,4BAA4B,CAAC,KAAa;IACxD,uFAAuF;IACvF,IAAI,CAAC,iCAAiC,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9C,OAAO,IAAA,eAAI,EAAC,GAAG,KAAK,6CAA6C,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,IAAA,kBAAO,EAAC,KAAK,CAAC,CAAC;AACxB,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,6BAA6B,CAAC,KAAa;IACzD,uFAAuF;IACvF,IAAI,CAAC,kCAAkC,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/C,OAAO,IAAA,eAAI,EAAC,GAAG,KAAK,8CAA8C,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,IAAA,kBAAO,EAAC,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 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 // 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 * 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}: not a valid qualifier name`);\n }\n return succeed(name);\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}: not a valid 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}: not a valid 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}: not a valid 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}: not a valid 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}: not a valid 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}: not a valid 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}: not a valid 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}: not a valid 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}: not a valid 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}: not a valid 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}: not a valid 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}: not a valid 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 key - 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}: not a valid condition set hash`);\n }\n return succeed(hash);\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 toDecisionKey(key: string): Result<DecisionKey> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidDecisionKey(key)) {\n return fail(`${key}: not a valid 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}: not a valid 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}: not a valid 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}: not a valid 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}: not a valid 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}: not a valid qualifier default values token`);\n }\n return succeed(token);\n}\n"]}
@@ -24,6 +24,12 @@ export declare const conditionKey: RegExp;
24
24
  * @internal
25
25
  */
26
26
  export declare const conditionToken: RegExp;
27
+ /**
28
+ * A {@link ContextToken | context token} has the form `<qualifierName>=<value>` or `<value>`.
29
+ * Context tokens allow broader character set including commas for comma-separated values.
30
+ * @internal
31
+ */
32
+ export declare const contextToken: RegExp;
27
33
  /**
28
34
  * @internal
29
35
  */
@@ -32,6 +38,20 @@ export declare const conditionSetHash: RegExp;
32
38
  * @internal
33
39
  */
34
40
  export declare const decisionKey: RegExp;
41
+ /**
42
+ * A {@link QualifierDefaultValueToken | qualifier default value token} has the form
43
+ * `<qualifierName>=<value>` or `<qualifierName>=` (to remove default).
44
+ * Default values allow broader character set including commas for comma-separated values.
45
+ * @internal
46
+ */
47
+ export declare const qualifierDefaultValueToken: RegExp;
48
+ /**
49
+ * A {@link QualifierDefaultValuesToken | qualifier default values token} is a
50
+ * pipe-separated list of one or more qualifier default value tokens.
51
+ * Uses "|" as separator to avoid conflicts with comma-separated values within defaults.
52
+ * @internal
53
+ */
54
+ export declare const qualifierDefaultValuesToken: RegExp;
35
55
  /**
36
56
  * @internal
37
57
  */
@@ -1 +1 @@
1
- {"version":3,"file":"regularExpressions.d.ts","sourceRoot":"","sources":["../../../../src/packlets/common/validate/regularExpressions.ts"],"names":[],"mappings":"AAsBA;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAAqC,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAkE,CAAC;AAErG;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAiE,CAAC;AAE/F;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,MAC+D,CAAC;AAE3F;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,MAA0D,CAAC;AAExF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAA2B,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAAqE,CAAC;AAEhG;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAwB,CAAC"}
1
+ {"version":3,"file":"regularExpressions.d.ts","sourceRoot":"","sources":["../../../../src/packlets/common/validate/regularExpressions.ts"],"names":[],"mappings":"AAsBA;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAAqC,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAkE,CAAC;AAErG;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAiE,CAAC;AAE/F;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,MAC+D,CAAC;AAE3F;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,MAA0D,CAAC;AAExF;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,MAA6D,CAAC;AAEzF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAA2B,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAAqE,CAAC;AAEhG;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAA6D,CAAC;AAEvG;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,EAAE,MACmE,CAAC;AAE9G;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAwB,CAAC"}