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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (443) hide show
  1. package/dist/index.browser.js.map +1 -0
  2. package/dist/index.js.map +1 -0
  3. package/dist/packlets/bundle/bundleBuilder.js.map +1 -0
  4. package/dist/packlets/bundle/bundleLoader.js.map +1 -0
  5. package/dist/packlets/bundle/bundleNormalizer.js.map +1 -0
  6. package/dist/packlets/bundle/bundleUtils.js.map +1 -0
  7. package/dist/packlets/bundle/convert.js.map +1 -0
  8. package/dist/packlets/bundle/index.js.map +1 -0
  9. package/dist/packlets/bundle/model.js.map +1 -0
  10. package/dist/packlets/common/conditions.js.map +1 -0
  11. package/dist/packlets/common/convert.js.map +1 -0
  12. package/dist/packlets/common/helpers/conditions.js.map +1 -0
  13. package/dist/packlets/common/helpers/context.js.map +1 -0
  14. package/dist/packlets/common/helpers/index.js.map +1 -0
  15. package/dist/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  16. package/dist/packlets/common/helpers/resources.js.map +1 -0
  17. package/dist/packlets/common/index.js.map +1 -0
  18. package/dist/packlets/common/resources.js.map +1 -0
  19. package/dist/packlets/common/validate/conditions.js.map +1 -0
  20. package/dist/packlets/common/validate/index.js.map +1 -0
  21. package/dist/packlets/common/validate/regularExpressions.js.map +1 -0
  22. package/dist/packlets/common/validate/resources.js.map +1 -0
  23. package/dist/packlets/conditions/condition.js.map +1 -0
  24. package/dist/packlets/conditions/conditionCollector.js.map +1 -0
  25. package/dist/packlets/conditions/conditionDecls.js.map +1 -0
  26. package/dist/packlets/conditions/conditionSet.js.map +1 -0
  27. package/dist/packlets/conditions/conditionSetCollector.js.map +1 -0
  28. package/dist/packlets/conditions/conditionSetDecls.js.map +1 -0
  29. package/dist/packlets/conditions/conditionToken.js.map +1 -0
  30. package/dist/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  31. package/dist/packlets/conditions/convert/decls.js.map +1 -0
  32. package/dist/packlets/conditions/convert/index.js.map +1 -0
  33. package/dist/packlets/conditions/index.js.map +1 -0
  34. package/dist/packlets/config/common.js.map +1 -0
  35. package/dist/packlets/config/configInitFactory.js.map +1 -0
  36. package/dist/packlets/config/convert.js.map +1 -0
  37. package/dist/packlets/config/index.browser.js.map +1 -0
  38. package/dist/packlets/config/index.js.map +1 -0
  39. package/dist/packlets/config/json.js.map +1 -0
  40. package/dist/packlets/config/predefined/default.js.map +1 -0
  41. package/dist/packlets/config/predefined/extended.js.map +1 -0
  42. package/dist/packlets/config/predefined/index.js.map +1 -0
  43. package/dist/packlets/config/systemConfiguration.js.map +1 -0
  44. package/dist/packlets/context/contextDecls.js.map +1 -0
  45. package/dist/packlets/context/contextToken.js.map +1 -0
  46. package/dist/packlets/context/convert/decls.js.map +1 -0
  47. package/dist/packlets/context/convert/index.js.map +1 -0
  48. package/dist/packlets/context/index.js.map +1 -0
  49. package/dist/packlets/decisions/abstractDecision.js.map +1 -0
  50. package/dist/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  51. package/dist/packlets/decisions/candidate.js.map +1 -0
  52. package/dist/packlets/decisions/common.js.map +1 -0
  53. package/dist/packlets/decisions/concreteDecision.js.map +1 -0
  54. package/dist/packlets/decisions/decision.js.map +1 -0
  55. package/dist/packlets/decisions/index.js.map +1 -0
  56. package/dist/packlets/import/fsItem.js.map +1 -0
  57. package/dist/packlets/import/importContext.js.map +1 -0
  58. package/dist/packlets/import/importManager.js.map +1 -0
  59. package/dist/packlets/import/importable.js.map +1 -0
  60. package/dist/packlets/import/importers/collectionImporter.js.map +1 -0
  61. package/dist/packlets/import/importers/fsItemImporter.js.map +1 -0
  62. package/dist/packlets/import/importers/importer.js.map +1 -0
  63. package/dist/packlets/import/importers/index.browser.js.map +1 -0
  64. package/dist/packlets/import/importers/index.js.map +1 -0
  65. package/dist/packlets/import/importers/jsonImporter.js.map +1 -0
  66. package/dist/packlets/import/importers/pathImporter.js.map +1 -0
  67. package/dist/packlets/import/index.browser.js.map +1 -0
  68. package/dist/packlets/import/index.js.map +1 -0
  69. package/dist/packlets/qualifier-types/config/convert.js.map +1 -0
  70. package/dist/packlets/qualifier-types/config/index.js.map +1 -0
  71. package/dist/packlets/qualifier-types/config/json.js.map +1 -0
  72. package/dist/packlets/qualifier-types/convert.js.map +1 -0
  73. package/dist/packlets/qualifier-types/helpers.js.map +1 -0
  74. package/dist/packlets/qualifier-types/index.js.map +1 -0
  75. package/dist/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  76. package/dist/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  77. package/dist/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  78. package/dist/packlets/qualifier-types/qualifierType.js.map +1 -0
  79. package/dist/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  80. package/dist/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  81. package/dist/packlets/qualifiers/convert/decls.js.map +1 -0
  82. package/dist/packlets/qualifiers/convert/index.js.map +1 -0
  83. package/dist/packlets/qualifiers/convert/qualifier.js.map +1 -0
  84. package/dist/packlets/qualifiers/index.js.map +1 -0
  85. package/dist/packlets/qualifiers/qualifier.js.map +1 -0
  86. package/dist/packlets/qualifiers/qualifierCollector.js.map +1 -0
  87. package/dist/packlets/qualifiers/qualifierDecl.js.map +1 -0
  88. package/dist/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  89. package/dist/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  90. package/dist/packlets/resource-json/compiled/common.js.map +1 -0
  91. package/dist/packlets/resource-json/compiled/convert.js.map +1 -0
  92. package/dist/packlets/resource-json/compiled/index.js.map +1 -0
  93. package/dist/packlets/resource-json/compiled/json.js.map +1 -0
  94. package/dist/packlets/resource-json/convert.js.map +1 -0
  95. package/dist/packlets/resource-json/helpers.js.map +1 -0
  96. package/dist/packlets/resource-json/index.js.map +1 -0
  97. package/dist/packlets/resource-json/json.js.map +1 -0
  98. package/dist/packlets/resource-json/normalized.js.map +1 -0
  99. package/dist/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  100. package/dist/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  101. package/dist/packlets/resource-json/resourceDeclTree.js.map +1 -0
  102. package/dist/packlets/resource-types/config/convert.js.map +1 -0
  103. package/dist/packlets/resource-types/config/index.js.map +1 -0
  104. package/dist/packlets/resource-types/config/json.js.map +1 -0
  105. package/dist/packlets/resource-types/helpers.js.map +1 -0
  106. package/dist/packlets/resource-types/index.js.map +1 -0
  107. package/dist/packlets/resource-types/jsonResourceType.js.map +1 -0
  108. package/dist/packlets/resource-types/resourceType.js.map +1 -0
  109. package/dist/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  110. package/dist/packlets/resources/candidateReducer.js.map +1 -0
  111. package/dist/packlets/resources/candidateValue.js.map +1 -0
  112. package/dist/packlets/resources/candidateValueCollector.js.map +1 -0
  113. package/dist/packlets/resources/common.js.map +1 -0
  114. package/dist/packlets/resources/deltaGenerator.js.map +1 -0
  115. package/dist/packlets/resources/index.js.map +1 -0
  116. package/dist/packlets/resources/resource.js.map +1 -0
  117. package/dist/packlets/resources/resourceBuilder.js.map +1 -0
  118. package/dist/packlets/resources/resourceCandidate.js.map +1 -0
  119. package/dist/packlets/resources/resourceManagerBuilder.js.map +1 -0
  120. package/dist/packlets/runtime/cacheListener.js.map +1 -0
  121. package/dist/packlets/runtime/cacheMetrics.js.map +1 -0
  122. package/dist/packlets/runtime/compiledResourceCollection.js.map +1 -0
  123. package/dist/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  124. package/dist/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  125. package/dist/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  126. package/dist/packlets/runtime/context/index.js.map +1 -0
  127. package/dist/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  128. package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  129. package/dist/packlets/runtime/iResourceManager.js.map +1 -0
  130. package/dist/packlets/runtime/index.js.map +1 -0
  131. package/dist/packlets/runtime/resource-tree/common.js.map +1 -0
  132. package/dist/packlets/runtime/resource-tree/index.js.map +1 -0
  133. package/dist/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  134. package/dist/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  135. package/dist/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  136. package/dist/packlets/runtime/resourceResolver.js.map +1 -0
  137. package/dist/packlets/runtime/resourceTreeResolver.js.map +1 -0
  138. package/dist/packlets/runtime/validate.js.map +1 -0
  139. package/dist/packlets/zip-archive/convert.js.map +1 -0
  140. package/dist/packlets/zip-archive/index.browser.js.map +1 -0
  141. package/dist/packlets/zip-archive/index.js.map +1 -0
  142. package/dist/packlets/zip-archive/json.js.map +1 -0
  143. package/dist/packlets/zip-archive/types.js.map +1 -0
  144. package/dist/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  145. package/dist/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  146. package/dist/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  147. package/lib/index.browser.d.ts.map +1 -0
  148. package/lib/index.browser.js.map +1 -0
  149. package/lib/index.d.ts.map +1 -0
  150. package/lib/index.js.map +1 -0
  151. package/lib/packlets/bundle/bundleBuilder.d.ts.map +1 -0
  152. package/lib/packlets/bundle/bundleBuilder.js.map +1 -0
  153. package/lib/packlets/bundle/bundleLoader.d.ts.map +1 -0
  154. package/lib/packlets/bundle/bundleLoader.js.map +1 -0
  155. package/lib/packlets/bundle/bundleNormalizer.d.ts.map +1 -0
  156. package/lib/packlets/bundle/bundleNormalizer.js.map +1 -0
  157. package/lib/packlets/bundle/bundleUtils.d.ts.map +1 -0
  158. package/lib/packlets/bundle/bundleUtils.js.map +1 -0
  159. package/lib/packlets/bundle/convert.d.ts.map +1 -0
  160. package/lib/packlets/bundle/convert.js.map +1 -0
  161. package/lib/packlets/bundle/index.d.ts.map +1 -0
  162. package/lib/packlets/bundle/index.js.map +1 -0
  163. package/lib/packlets/bundle/model.d.ts.map +1 -0
  164. package/lib/packlets/bundle/model.js.map +1 -0
  165. package/lib/packlets/common/conditions.d.ts.map +1 -0
  166. package/lib/packlets/common/conditions.js.map +1 -0
  167. package/lib/packlets/common/convert.d.ts.map +1 -0
  168. package/lib/packlets/common/convert.js.map +1 -0
  169. package/lib/packlets/common/helpers/conditions.d.ts.map +1 -0
  170. package/lib/packlets/common/helpers/conditions.js.map +1 -0
  171. package/lib/packlets/common/helpers/context.d.ts.map +1 -0
  172. package/lib/packlets/common/helpers/context.js.map +1 -0
  173. package/lib/packlets/common/helpers/index.d.ts.map +1 -0
  174. package/lib/packlets/common/helpers/index.js.map +1 -0
  175. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +1 -0
  176. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  177. package/lib/packlets/common/helpers/resources.d.ts.map +1 -0
  178. package/lib/packlets/common/helpers/resources.js.map +1 -0
  179. package/lib/packlets/common/index.d.ts.map +1 -0
  180. package/lib/packlets/common/index.js.map +1 -0
  181. package/lib/packlets/common/resources.d.ts.map +1 -0
  182. package/lib/packlets/common/resources.js.map +1 -0
  183. package/lib/packlets/common/validate/conditions.d.ts.map +1 -0
  184. package/lib/packlets/common/validate/conditions.js.map +1 -0
  185. package/lib/packlets/common/validate/index.d.ts.map +1 -0
  186. package/lib/packlets/common/validate/index.js.map +1 -0
  187. package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -0
  188. package/lib/packlets/common/validate/regularExpressions.js.map +1 -0
  189. package/lib/packlets/common/validate/resources.d.ts.map +1 -0
  190. package/lib/packlets/common/validate/resources.js.map +1 -0
  191. package/lib/packlets/conditions/condition.d.ts.map +1 -0
  192. package/lib/packlets/conditions/condition.js.map +1 -0
  193. package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -0
  194. package/lib/packlets/conditions/conditionCollector.js.map +1 -0
  195. package/lib/packlets/conditions/conditionDecls.d.ts.map +1 -0
  196. package/lib/packlets/conditions/conditionDecls.js.map +1 -0
  197. package/lib/packlets/conditions/conditionSet.d.ts.map +1 -0
  198. package/lib/packlets/conditions/conditionSet.js.map +1 -0
  199. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -0
  200. package/lib/packlets/conditions/conditionSetCollector.js.map +1 -0
  201. package/lib/packlets/conditions/conditionSetDecls.d.ts.map +1 -0
  202. package/lib/packlets/conditions/conditionSetDecls.js.map +1 -0
  203. package/lib/packlets/conditions/conditionToken.d.ts.map +1 -0
  204. package/lib/packlets/conditions/conditionToken.js.map +1 -0
  205. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +1 -0
  206. package/lib/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  207. package/lib/packlets/conditions/convert/decls.d.ts.map +1 -0
  208. package/lib/packlets/conditions/convert/decls.js.map +1 -0
  209. package/lib/packlets/conditions/convert/index.d.ts.map +1 -0
  210. package/lib/packlets/conditions/convert/index.js.map +1 -0
  211. package/lib/packlets/conditions/index.d.ts.map +1 -0
  212. package/lib/packlets/conditions/index.js.map +1 -0
  213. package/lib/packlets/config/common.d.ts.map +1 -0
  214. package/lib/packlets/config/common.js.map +1 -0
  215. package/lib/packlets/config/configInitFactory.d.ts.map +1 -0
  216. package/lib/packlets/config/configInitFactory.js.map +1 -0
  217. package/lib/packlets/config/convert.d.ts.map +1 -0
  218. package/lib/packlets/config/convert.js.map +1 -0
  219. package/lib/packlets/config/index.browser.d.ts.map +1 -0
  220. package/lib/packlets/config/index.browser.js.map +1 -0
  221. package/lib/packlets/config/index.d.ts.map +1 -0
  222. package/lib/packlets/config/index.js.map +1 -0
  223. package/lib/packlets/config/json.d.ts.map +1 -0
  224. package/lib/packlets/config/json.js.map +1 -0
  225. package/lib/packlets/config/predefined/default.d.ts.map +1 -0
  226. package/lib/packlets/config/predefined/default.js.map +1 -0
  227. package/lib/packlets/config/predefined/extended.d.ts.map +1 -0
  228. package/lib/packlets/config/predefined/extended.js.map +1 -0
  229. package/lib/packlets/config/predefined/index.d.ts.map +1 -0
  230. package/lib/packlets/config/predefined/index.js.map +1 -0
  231. package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
  232. package/lib/packlets/config/systemConfiguration.js.map +1 -0
  233. package/lib/packlets/context/contextDecls.d.ts.map +1 -0
  234. package/lib/packlets/context/contextDecls.js.map +1 -0
  235. package/lib/packlets/context/contextToken.d.ts.map +1 -0
  236. package/lib/packlets/context/contextToken.js.map +1 -0
  237. package/lib/packlets/context/convert/decls.d.ts.map +1 -0
  238. package/lib/packlets/context/convert/decls.js.map +1 -0
  239. package/lib/packlets/context/convert/index.d.ts.map +1 -0
  240. package/lib/packlets/context/convert/index.js.map +1 -0
  241. package/lib/packlets/context/index.d.ts.map +1 -0
  242. package/lib/packlets/context/index.js.map +1 -0
  243. package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -0
  244. package/lib/packlets/decisions/abstractDecision.js.map +1 -0
  245. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -0
  246. package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  247. package/lib/packlets/decisions/candidate.d.ts.map +1 -0
  248. package/lib/packlets/decisions/candidate.js.map +1 -0
  249. package/lib/packlets/decisions/common.d.ts.map +1 -0
  250. package/lib/packlets/decisions/common.js.map +1 -0
  251. package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -0
  252. package/lib/packlets/decisions/concreteDecision.js.map +1 -0
  253. package/lib/packlets/decisions/decision.d.ts.map +1 -0
  254. package/lib/packlets/decisions/decision.js.map +1 -0
  255. package/lib/packlets/decisions/index.d.ts.map +1 -0
  256. package/lib/packlets/decisions/index.js.map +1 -0
  257. package/lib/packlets/import/fsItem.d.ts.map +1 -0
  258. package/lib/packlets/import/fsItem.js.map +1 -0
  259. package/lib/packlets/import/importContext.d.ts.map +1 -0
  260. package/lib/packlets/import/importContext.js.map +1 -0
  261. package/lib/packlets/import/importManager.d.ts.map +1 -0
  262. package/lib/packlets/import/importManager.js.map +1 -0
  263. package/lib/packlets/import/importable.d.ts.map +1 -0
  264. package/lib/packlets/import/importable.js.map +1 -0
  265. package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -0
  266. package/lib/packlets/import/importers/collectionImporter.js.map +1 -0
  267. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -0
  268. package/lib/packlets/import/importers/fsItemImporter.js.map +1 -0
  269. package/lib/packlets/import/importers/importer.d.ts.map +1 -0
  270. package/lib/packlets/import/importers/importer.js.map +1 -0
  271. package/lib/packlets/import/importers/index.browser.d.ts.map +1 -0
  272. package/lib/packlets/import/importers/index.browser.js.map +1 -0
  273. package/lib/packlets/import/importers/index.d.ts.map +1 -0
  274. package/lib/packlets/import/importers/index.js.map +1 -0
  275. package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -0
  276. package/lib/packlets/import/importers/jsonImporter.js.map +1 -0
  277. package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -0
  278. package/lib/packlets/import/importers/pathImporter.js.map +1 -0
  279. package/lib/packlets/import/index.browser.d.ts.map +1 -0
  280. package/lib/packlets/import/index.browser.js.map +1 -0
  281. package/lib/packlets/import/index.d.ts.map +1 -0
  282. package/lib/packlets/import/index.js.map +1 -0
  283. package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
  284. package/lib/packlets/qualifier-types/config/convert.js.map +1 -0
  285. package/lib/packlets/qualifier-types/config/index.d.ts.map +1 -0
  286. package/lib/packlets/qualifier-types/config/index.js.map +1 -0
  287. package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
  288. package/lib/packlets/qualifier-types/config/json.js.map +1 -0
  289. package/lib/packlets/qualifier-types/convert.d.ts.map +1 -0
  290. package/lib/packlets/qualifier-types/convert.js.map +1 -0
  291. package/lib/packlets/qualifier-types/helpers.d.ts.map +1 -0
  292. package/lib/packlets/qualifier-types/helpers.js.map +1 -0
  293. package/lib/packlets/qualifier-types/index.d.ts.map +1 -0
  294. package/lib/packlets/qualifier-types/index.js.map +1 -0
  295. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -0
  296. package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  297. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -0
  298. package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  299. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
  300. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  301. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -0
  302. package/lib/packlets/qualifier-types/qualifierType.js.map +1 -0
  303. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -0
  304. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  305. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -0
  306. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  307. package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -0
  308. package/lib/packlets/qualifiers/convert/decls.js.map +1 -0
  309. package/lib/packlets/qualifiers/convert/index.d.ts.map +1 -0
  310. package/lib/packlets/qualifiers/convert/index.js.map +1 -0
  311. package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +1 -0
  312. package/lib/packlets/qualifiers/convert/qualifier.js.map +1 -0
  313. package/lib/packlets/qualifiers/index.d.ts.map +1 -0
  314. package/lib/packlets/qualifiers/index.js.map +1 -0
  315. package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -0
  316. package/lib/packlets/qualifiers/qualifier.js.map +1 -0
  317. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -0
  318. package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -0
  319. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -0
  320. package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -0
  321. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +1 -0
  322. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  323. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +1 -0
  324. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  325. package/lib/packlets/resource-json/compiled/common.d.ts.map +1 -0
  326. package/lib/packlets/resource-json/compiled/common.js.map +1 -0
  327. package/lib/packlets/resource-json/compiled/convert.d.ts.map +1 -0
  328. package/lib/packlets/resource-json/compiled/convert.js.map +1 -0
  329. package/lib/packlets/resource-json/compiled/index.d.ts.map +1 -0
  330. package/lib/packlets/resource-json/compiled/index.js.map +1 -0
  331. package/lib/packlets/resource-json/compiled/json.d.ts.map +1 -0
  332. package/lib/packlets/resource-json/compiled/json.js.map +1 -0
  333. package/lib/packlets/resource-json/convert.d.ts.map +1 -0
  334. package/lib/packlets/resource-json/convert.js.map +1 -0
  335. package/lib/packlets/resource-json/helpers.d.ts.map +1 -0
  336. package/lib/packlets/resource-json/helpers.js.map +1 -0
  337. package/lib/packlets/resource-json/index.d.ts.map +1 -0
  338. package/lib/packlets/resource-json/index.js.map +1 -0
  339. package/lib/packlets/resource-json/json.d.ts.map +1 -0
  340. package/lib/packlets/resource-json/json.js.map +1 -0
  341. package/lib/packlets/resource-json/normalized.d.ts.map +1 -0
  342. package/lib/packlets/resource-json/normalized.js.map +1 -0
  343. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -0
  344. package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  345. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -0
  346. package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  347. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -0
  348. package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -0
  349. package/lib/packlets/resource-types/config/convert.d.ts.map +1 -0
  350. package/lib/packlets/resource-types/config/convert.js.map +1 -0
  351. package/lib/packlets/resource-types/config/index.d.ts.map +1 -0
  352. package/lib/packlets/resource-types/config/index.js.map +1 -0
  353. package/lib/packlets/resource-types/config/json.d.ts.map +1 -0
  354. package/lib/packlets/resource-types/config/json.js.map +1 -0
  355. package/lib/packlets/resource-types/helpers.d.ts.map +1 -0
  356. package/lib/packlets/resource-types/helpers.js.map +1 -0
  357. package/lib/packlets/resource-types/index.d.ts.map +1 -0
  358. package/lib/packlets/resource-types/index.js.map +1 -0
  359. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -0
  360. package/lib/packlets/resource-types/jsonResourceType.js.map +1 -0
  361. package/lib/packlets/resource-types/resourceType.d.ts.map +1 -0
  362. package/lib/packlets/resource-types/resourceType.js.map +1 -0
  363. package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +1 -0
  364. package/lib/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  365. package/lib/packlets/resources/candidateReducer.d.ts.map +1 -0
  366. package/lib/packlets/resources/candidateReducer.js.map +1 -0
  367. package/lib/packlets/resources/candidateValue.d.ts.map +1 -0
  368. package/lib/packlets/resources/candidateValue.js.map +1 -0
  369. package/lib/packlets/resources/candidateValueCollector.d.ts.map +1 -0
  370. package/lib/packlets/resources/candidateValueCollector.js.map +1 -0
  371. package/lib/packlets/resources/common.d.ts.map +1 -0
  372. package/lib/packlets/resources/common.js.map +1 -0
  373. package/lib/packlets/resources/deltaGenerator.d.ts.map +1 -0
  374. package/lib/packlets/resources/deltaGenerator.js.map +1 -0
  375. package/lib/packlets/resources/index.d.ts.map +1 -0
  376. package/lib/packlets/resources/index.js.map +1 -0
  377. package/lib/packlets/resources/resource.d.ts.map +1 -0
  378. package/lib/packlets/resources/resource.js.map +1 -0
  379. package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -0
  380. package/lib/packlets/resources/resourceBuilder.js.map +1 -0
  381. package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -0
  382. package/lib/packlets/resources/resourceCandidate.js.map +1 -0
  383. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
  384. package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -0
  385. package/lib/packlets/runtime/cacheListener.d.ts.map +1 -0
  386. package/lib/packlets/runtime/cacheListener.js.map +1 -0
  387. package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -0
  388. package/lib/packlets/runtime/cacheMetrics.js.map +1 -0
  389. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
  390. package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -0
  391. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +1 -0
  392. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  393. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +1 -0
  394. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  395. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +1 -0
  396. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  397. package/lib/packlets/runtime/context/index.d.ts.map +1 -0
  398. package/lib/packlets/runtime/context/index.js.map +1 -0
  399. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -0
  400. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  401. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -0
  402. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  403. package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -0
  404. package/lib/packlets/runtime/iResourceManager.js.map +1 -0
  405. package/lib/packlets/runtime/index.d.ts.map +1 -0
  406. package/lib/packlets/runtime/index.js.map +1 -0
  407. package/lib/packlets/runtime/resource-tree/common.d.ts.map +1 -0
  408. package/lib/packlets/runtime/resource-tree/common.js.map +1 -0
  409. package/lib/packlets/runtime/resource-tree/index.d.ts.map +1 -0
  410. package/lib/packlets/runtime/resource-tree/index.js.map +1 -0
  411. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +1 -0
  412. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  413. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +1 -0
  414. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  415. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +1 -0
  416. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  417. package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -0
  418. package/lib/packlets/runtime/resourceResolver.js.map +1 -0
  419. package/lib/packlets/runtime/resourceTreeResolver.d.ts.map +1 -0
  420. package/lib/packlets/runtime/resourceTreeResolver.js.map +1 -0
  421. package/lib/packlets/runtime/validate.d.ts.map +1 -0
  422. package/lib/packlets/runtime/validate.js.map +1 -0
  423. package/lib/packlets/zip-archive/convert.d.ts.map +1 -0
  424. package/lib/packlets/zip-archive/convert.js.map +1 -0
  425. package/lib/packlets/zip-archive/index.browser.d.ts.map +1 -0
  426. package/lib/packlets/zip-archive/index.browser.js.map +1 -0
  427. package/lib/packlets/zip-archive/index.d.ts.map +1 -0
  428. package/lib/packlets/zip-archive/index.js.map +1 -0
  429. package/lib/packlets/zip-archive/json.d.ts.map +1 -0
  430. package/lib/packlets/zip-archive/json.js.map +1 -0
  431. package/lib/packlets/zip-archive/types.d.ts.map +1 -0
  432. package/lib/packlets/zip-archive/types.js.map +1 -0
  433. package/lib/packlets/zip-archive/zipArchiveCreator.d.ts.map +1 -0
  434. package/lib/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  435. package/lib/packlets/zip-archive/zipArchiveFormat.d.ts.map +1 -0
  436. package/lib/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  437. package/lib/packlets/zip-archive/zipArchiveLoader.d.ts.map +1 -0
  438. package/lib/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  439. package/package.json +9 -9
  440. package/dist/test/data/sample.json +0 -32
  441. package/dist/test/unit/qualifier-types/testQualifierType.js +0 -76
  442. package/dist/test/unit/resource-types/testDerivedResourceType.js +0 -109
  443. package/dist/test/unit/resources/deltaGenerator.helpers.js +0 -282
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceResolver.js","sourceRoot":"","sources":["../../../src/packlets/runtime/resourceResolver.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAqE;AACrE,oDAAwE;AACxE,0CAA0C;AAC1C,sCAAmE;AAInE,uCAAgG;AAEhG,iFAIwC;AA8DxC;;;;;GAKG;AACH,MAAa,gBAAgB;IAqB3B;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC;IAC1C,CAAC;IAED;;;;OAIG;IACH,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,IAAW,iBAAiB;QAC1B,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAED;;;OAGG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAyBD;;;OAGG;IACH,YAAsB,MAAqC;;QACzD,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;QAC9C,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QAC5C,IAAI,CAAC,wBAAwB,GAAG,MAAM,CAAC,wBAAwB,CAAC;QAChE,IAAI,CAAC,OAAO,GAAG;YACb,oBAAoB,EAAE,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,oBAAoB,mCAAI,KAAK;SACpE,CAAC;QAEF,8EAA8E;QAC9E,MAAM,sBAAsB,GAAG,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC;QAC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AM,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAC1D,OAAO,kDAAwC,CAAC,MAAM,CAAC;YACrD,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,eAAe,EAAE,OAAO;SACzB,CAAC,CAAC,SAAS,CAAC,CAAC,wBAAwB,EAAE,EAAE;YACxC,OAAO,gBAAgB,CAAC,MAAM,CAAC;gBAC7B,eAAe;gBACf,cAAc;gBACd,OAAO;gBACP,wBAAwB;aACzB,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,mBAAmB;;QACxB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACrC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAEpC,MAAA,IAAI,CAAC,SAAS,0CAAE,YAAY,CAAC,WAAW,CAAC,CAAC;QAC1C,MAAA,IAAI,CAAC,SAAS,0CAAE,YAAY,CAAC,cAAc,CAAC,CAAC;QAC7C,MAAA,IAAI,CAAC,SAAS,0CAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IAC3C,CAAC;IAED;;;;OAIG;IACH,IAAW,kBAAkB;QAC3B,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACH,IAAW,qBAAqB;QAC9B,OAAO,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACH,IAAW,iBAAiB;QAC1B,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;IACpC,CAAC;CACF;AA1mBD,4CA0mBC","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, captureResult, fail, succeed } from '@fgv/ts-utils';\nimport { JsonValue, JsonObject, isJsonObject } from '@fgv/ts-json-base';\nimport { JsonEditor } from '@fgv/ts-json';\nimport { IResourceResolver, NoMatch, ResourceId } from '../common';\nimport { Condition, ConditionSet } from '../conditions';\nimport { AbstractDecision } from '../decisions';\nimport { ReadOnlyQualifierTypeCollector } from '../qualifier-types';\nimport { IContextQualifierProvider, ValidatingSimpleContextQualifierProvider } from './context';\nimport { IResourceManager, IResource, IResourceCandidate } from './iResourceManager';\nimport {\n ConditionMatchType,\n ConditionSetResolutionResult,\n IConditionMatchResult\n} from './conditionSetResolutionResult';\nimport { IResourceResolverCacheListener } from './cacheListener';\nimport { IReadOnlyQualifierCollector } from '../qualifiers';\n\n/**\n * Represents the cached result of resolving a decision.\n * Contains either a failure indicator or a list of instance indices for matching condition sets,\n * ordered by condition set priority.\n * @public\n */\nexport type DecisionResolutionResult =\n | { success: false }\n | { success: true; instanceIndices: ReadonlyArray<number>; defaultInstanceIndices: ReadonlyArray<number> };\n\n/**\n * Options for configuring a {@link Runtime.ResourceResolver | ResourceResolver}.\n * @public\n */\nexport interface IResourceResolverOptions {\n /**\n * Controls whether null values in resource composition should suppress properties\n * instead of setting them to null. When true, properties with null values from\n * higher-priority partial candidates will be omitted from the final composed resource.\n * @defaultValue false\n */\n suppressNullAsDelete?: boolean;\n}\n\n/**\n * Parameters for creating a {@link Runtime.ResourceResolver | ResourceResolver}.\n * @public\n */\nexport interface IResourceResolverCreateParams {\n /**\n * The {@link Runtime.IResourceManager | resource manager} that defines the resources available\n * and provides access to qualifiers and conditions.\n */\n resourceManager: IResourceManager;\n\n /**\n * The {@link QualifierTypes.ReadOnlyQualifierTypeCollector | readonly qualifier type collector}\n * that provides qualifier implementations for condition evaluation.\n */\n qualifierTypes: ReadOnlyQualifierTypeCollector;\n\n /**\n * The {@link Runtime.Context.IContextQualifierProvider | context qualifier provider} that resolves\n * qualifier values for the current context.\n */\n contextQualifierProvider: IContextQualifierProvider;\n\n /**\n * An optional listener for {@link Runtime.ResourceResolver | ResourceResolver} cache activity.\n */\n listener?: IResourceResolverCacheListener;\n\n /**\n * Optional configuration options for the {@link Runtime.ResourceResolver | ResourceResolver}.\n */\n options?: IResourceResolverOptions;\n}\n\n/**\n * High-performance runtime resource resolver with O(1) condition caching.\n * Resolves resources for a given context by evaluating conditions against qualifier values\n * and caching results for optimal performance.\n * @public\n */\nexport class ResourceResolver implements IResourceResolver {\n /**\n * The resource manager that defines available resources and provides condition access.\n */\n public readonly resourceManager: IResourceManager;\n\n /**\n * The readonly qualifier type collector that provides qualifier implementations.\n */\n public readonly qualifierTypes: ReadOnlyQualifierTypeCollector;\n\n /**\n * The context qualifier provider that resolves qualifier values.\n */\n public readonly contextQualifierProvider: IContextQualifierProvider;\n\n /**\n * The configuration options for this resource resolver.\n */\n public readonly options: IResourceResolverOptions;\n\n /**\n * The readonly qualifier collector that provides qualifier implementations.\n */\n public get qualifiers(): IReadOnlyQualifierCollector {\n return this.contextQualifierProvider.qualifiers;\n }\n\n /**\n * The resource IDs that this resolver can resolve.\n */\n public get resourceIds(): ReadonlyArray<ResourceId> {\n return this.resourceManager.resourceIds;\n }\n\n /**\n * The cache array for resolved conditions, indexed by condition index for O(1) lookup.\n * Each entry stores the resolved {@link Runtime.IConditionMatchResult | condition match result} for\n * the corresponding condition.\n */\n public get conditionCache(): ReadonlyArray<IConditionMatchResult | undefined> {\n return this._conditionCache;\n }\n\n /**\n * The cache array for resolved condition sets, indexed by condition set index for O(1) lookup.\n * Each entry stores the resolved ConditionSetResolutionResult for the corresponding condition set.\n */\n public get conditionSetCache(): ReadonlyArray<ConditionSetResolutionResult | undefined> {\n return this._conditionSetCache;\n }\n\n /**\n * The cache array for resolved decisions, indexed by decision index for O(1) lookup.\n * Each entry stores the resolved DecisionResolutionResult for the corresponding decision.\n */\n public get decisionCache(): ReadonlyArray<DecisionResolutionResult | undefined> {\n return this._decisionCache;\n }\n\n /**\n * Cache array for resolved conditions, indexed by condition index for O(1) lookup.\n * Each entry stores the resolved QualifierMatchScore for the corresponding condition.\n */\n private readonly _conditionCache: Array<IConditionMatchResult | undefined>;\n\n /**\n * Cache array for resolved condition sets, indexed by condition set index for O(1) lookup.\n * Each entry stores the resolved ConditionSetResolutionResult for the corresponding condition set.\n */\n private readonly _conditionSetCache: Array<ConditionSetResolutionResult | undefined>;\n\n /**\n * Cache array for resolved decisions, indexed by decision index for O(1) lookup.\n * Each entry stores the resolved DecisionResolutionResult for the corresponding decision.\n */\n private readonly _decisionCache: Array<DecisionResolutionResult | undefined>;\n\n /**\n * The listener for {@link Runtime.ResourceResolver | ResourceResolver} cache activity.\n */\n private readonly _listener?: IResourceResolverCacheListener;\n\n /**\n * Constructor for a {@link Runtime.ResourceResolver | ResourceResolver} object.\n * @param params - {@link Runtime.IResourceResolverCreateParams | Parameters} used to create the resolver.\n */\n protected constructor(params: IResourceResolverCreateParams) {\n this.resourceManager = params.resourceManager;\n this.qualifierTypes = params.qualifierTypes;\n this.contextQualifierProvider = params.contextQualifierProvider;\n this.options = {\n suppressNullAsDelete: params.options?.suppressNullAsDelete ?? false\n };\n\n // Initialize condition cache array with size matching the condition collector\n const conditionCollectorSize = this.resourceManager.conditions.size;\n this._conditionCache = new Array<IConditionMatchResult | undefined>(conditionCollectorSize);\n\n // Initialize condition set cache array with size matching the condition set collector\n const conditionSetCollectorSize = this.resourceManager.conditionSets.size;\n this._conditionSetCache = new Array<ConditionSetResolutionResult | undefined>(conditionSetCollectorSize);\n\n // Initialize decision cache array with size matching the decision collector\n const decisionCollectorSize = this.resourceManager.decisions.size;\n this._decisionCache = new Array<DecisionResolutionResult | undefined>(decisionCollectorSize);\n\n this._listener = params.listener;\n }\n\n /**\n * Creates a new {@link Runtime.ResourceResolver | ResourceResolver} object.\n * @param params - {@link Runtime.IResourceResolverCreateParams | Parameters} used to create the resolver.\n * @returns `Success` with the new {@link Runtime.ResourceResolver | ResourceResolver} object if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public static create(params: IResourceResolverCreateParams): Result<ResourceResolver> {\n return captureResult(() => new ResourceResolver(params));\n }\n\n /**\n * Resolves a condition by evaluating it against the current context.\n * Uses O(1) caching based on the condition's globally unique sequential index.\n * @param condition - The {@link Conditions.Condition | condition} to resolve.\n * @returns `Success` with the {@link QualifierMatchScore | match score} if successful,\n * or `Failure` with an error message if the condition cannot be resolved.\n * @public\n */\n public resolveCondition(condition: Condition): Result<IConditionMatchResult> {\n // Get the condition's index for cache lookup\n const conditionIndex = condition.index;\n if (conditionIndex === undefined) {\n return fail(`Condition \"${condition.key}\" does not have a valid index`);\n }\n\n // Check cache first for O(1) lookup\n const cachedResult = this._conditionCache[conditionIndex];\n if (cachedResult !== undefined) {\n this._listener?.onCacheHit('condition', conditionIndex);\n return succeed(cachedResult);\n }\n\n // Resolve the condition by getting qualifier value and evaluating with qualifier type\n const score = this.contextQualifierProvider\n .get(condition.qualifier)\n .onSuccess((qualifierValue) => {\n // Evaluate the condition using the qualifier type's matching logic\n return succeed(condition.qualifier.type.matches(condition.value, qualifierValue, condition.operator));\n })\n .onFailure((err) => {\n this._listener?.onContextError(condition.qualifier.name, err);\n return fail(err);\n })\n .orDefault(NoMatch);\n\n const priority = condition.priority;\n const scoreAsDefault = condition.scoreAsDefault ?? NoMatch;\n const matchResult: IConditionMatchResult =\n score > NoMatch\n ? { score, priority, matchType: 'match' }\n : scoreAsDefault > NoMatch\n ? { score: scoreAsDefault, priority, matchType: 'matchAsDefault' }\n : { score: NoMatch, priority, matchType: 'noMatch' };\n\n // Cache the resolved value for future O(1) lookup\n this._conditionCache[conditionIndex] = matchResult;\n this._listener?.onCacheMiss('condition', conditionIndex);\n\n return succeed(matchResult);\n }\n\n /**\n * Resolves a condition set by evaluating all its constituent conditions against the current context.\n * Uses O(1) caching based on the condition set's globally unique sequential index.\n * @param conditionSet - The {@link Conditions.ConditionSet | condition set} to resolve.\n * @returns `Success` with the {@link Runtime.ConditionSetResolutionResult | resolution result} if successful,\n * or `Failure` with an error message if the condition set cannot be resolved.\n * @public\n */\n public resolveConditionSet(conditionSet: ConditionSet): Result<ConditionSetResolutionResult> {\n // Get the condition set's index for cache lookup\n const conditionSetIndex = conditionSet.index;\n if (conditionSetIndex === undefined) {\n return fail(`ConditionSet \"${conditionSet.key}\" does not have a valid index`);\n }\n\n // Check cache first for O(1) lookup\n const cachedResult = this._conditionSetCache[conditionSetIndex];\n if (cachedResult !== undefined) {\n this._listener?.onCacheHit('conditionSet', conditionSetIndex);\n return succeed(cachedResult);\n }\n\n // Resolve all conditions in the condition set\n const conditions: Array<IConditionMatchResult> = [];\n let matchType: ConditionMatchType = 'match';\n\n for (const condition of conditionSet.conditions) {\n const { value: conditionResult, message: conditionMessage } = this.resolveCondition(condition);\n\n /* c8 ignore next 4 - defensive coding: extreme internal error scenario not reachable in normal operation */\n if (conditionMessage !== undefined) {\n this._listener?.onCacheError('conditionSet', conditionSetIndex);\n return fail(`Failed to resolve condition \"${condition.key}\": ${conditionMessage}`);\n }\n\n conditions.push(conditionResult);\n\n if (conditionResult.matchType === 'noMatch') {\n // Cache the failure result\n return ConditionSetResolutionResult.create('noMatch', conditions)\n .onSuccess((result) => {\n this._conditionSetCache[conditionSetIndex] = result;\n this._listener?.onCacheMiss('conditionSet', conditionSetIndex);\n return succeed(result);\n })\n .onFailure((err) => {\n /* c8 ignore next 4 - defensive coding: extreme internal error scenario not reachable in normal operation */\n this._conditionSetCache[conditionSetIndex] = undefined;\n this._listener?.onCacheError('conditionSet', conditionSetIndex);\n return fail(`${conditionSetIndex}: error creating condition set resolution result: ${err}`);\n });\n }\n\n /* c8 ignore next 3 - edge case: matchAsDefault fallback logic rarely triggered */\n if (conditionResult.matchType === 'matchAsDefault') {\n matchType = 'matchAsDefault';\n }\n }\n\n // Cache the successful result\n return ConditionSetResolutionResult.create(matchType, conditions)\n .onSuccess((result) => {\n this._conditionSetCache[conditionSetIndex] = result;\n this._listener?.onCacheMiss('conditionSet', conditionSetIndex);\n return succeed(result);\n })\n .onFailure((err) => {\n /* c8 ignore next 4 - defensive coding: extreme internal error scenario not reachable in normal operation */\n this._conditionSetCache[conditionSetIndex] = undefined;\n this._listener?.onCacheError('conditionSet', conditionSetIndex);\n return fail(`${conditionSetIndex}: error creating condition set resolution result: ${err}`);\n });\n }\n\n /**\n * Resolves a decision by evaluating all its constituent condition sets against the current context.\n * Uses O(1) caching based on the decision's globally unique sequential index.\n * @param decision - The {@link Decisions.AbstractDecision | abstract decision} to resolve.\n * @returns `Success` with the {@link Runtime.DecisionResolutionResult | resolution result} if successful,\n * or `Failure` with an error message if the decision cannot be resolved.\n * @public\n */\n public resolveDecision(decision: AbstractDecision): Result<DecisionResolutionResult> {\n // Get the decision's index for cache lookup\n const decisionIndex = decision.index;\n if (decisionIndex === undefined) {\n return fail(`Decision \"${decision.key}\" does not have a valid index`);\n }\n\n // Check cache first for O(1) lookup\n const cachedResult = this._decisionCache[decisionIndex];\n if (cachedResult !== undefined) {\n this._listener?.onCacheHit('decision', decisionIndex);\n return succeed(cachedResult);\n }\n\n // Resolve all condition sets in the decision\n const matchingInstanceResults: Array<{ index: number; result: ConditionSetResolutionResult }> = [];\n const matchingDefaultInstanceResults: Array<{ index: number; result: ConditionSetResolutionResult }> = [];\n\n for (let instanceIndex = 0; instanceIndex < decision.candidates.length; instanceIndex++) {\n const candidate = decision.candidates[instanceIndex];\n const conditionSetResult = this.resolveConditionSet(candidate.conditionSet);\n\n /* c8 ignore next 4 - defensive in depth */\n if (conditionSetResult.isFailure()) {\n this._listener?.onCacheError('decision', decisionIndex);\n return fail(`${decision.key}: Failed to resolve condition set\": ${conditionSetResult.message}`);\n }\n\n const resolution = conditionSetResult.value;\n\n // Only include condition sets that match\n if (resolution.matchType === 'match') {\n matchingInstanceResults.push({\n index: instanceIndex,\n result: resolution\n });\n } else if (resolution.matchType === 'matchAsDefault') {\n matchingDefaultInstanceResults.push({\n index: instanceIndex,\n result: resolution\n });\n }\n // If condition set doesn't match, we simply skip it and continue (don't fail the decision)\n }\n\n // Sort by condition set resolution priority using the proper comparison logic\n matchingInstanceResults.sort((a, b) => ConditionSetResolutionResult.compare(a.result, b.result));\n matchingDefaultInstanceResults.sort((a, b) => ConditionSetResolutionResult.compare(a.result, b.result));\n\n // Extract just the instance indices in priority order\n const instanceIndices = matchingInstanceResults.map((item) => item.index);\n const defaultInstanceIndices = matchingDefaultInstanceResults.map((item) => item.index);\n\n // Cache the successful result\n const successResult: DecisionResolutionResult = {\n success: true,\n instanceIndices,\n defaultInstanceIndices\n };\n this._decisionCache[decisionIndex] = successResult;\n this._listener?.onCacheMiss('decision', decisionIndex);\n\n return succeed(successResult);\n }\n\n /**\n * Resolves a resource by finding the best matching candidate.\n * Uses the resource's associated decision to determine the best match based on the current context.\n * @param resource - The {@link Resources.Resource | resource} to resolve.\n * @returns `Success` with the best matching candidate if successful,\n * or `Failure` with an error message if no candidates match or resolution fails.\n * @public\n */\n public resolveResource(resource: IResource): Result<IResourceCandidate>;\n\n /**\n * Resolves a resource by finding the best matching candidate.\n * Uses the resource's associated decision to determine the best match based on the current context.\n * @param resource - The string id of the resource to resolve.\n * @returns `Success` with the best matching candidate if successful,\n * or `Failure` with an error message if no candidates match or resolution fails.\n * @public\n */\n public resolveResource(resource: string): Result<IResourceCandidate>;\n public resolveResource(idOrResource: string | IResource): Result<IResourceCandidate> {\n /* c8 ignore next 4 - defensive coding: string resource resolution should use direct resource calls */\n if (typeof idOrResource === 'string') {\n return this.resourceManager\n .getBuiltResource(idOrResource)\n .onSuccess((resource) => this.resolveResource(resource));\n }\n\n const resource = idOrResource;\n\n // Get the abstract decision from the resource's concrete decision\n const abstractDecision = resource.decision.baseDecision;\n\n // Resolve the decision to get candidate indices in priority order\n const decisionResult = this.resolveDecision(abstractDecision);\n /* c8 ignore next 3 - defense in depth almost impossible to hit */\n if (decisionResult.isFailure()) {\n return fail(`Failed to resolve decision for resource \"${resource.id}\": ${decisionResult.message}`);\n }\n\n const resolution = decisionResult.value;\n\n // Check if any candidates matched (regular or default)\n if (\n !resolution.success ||\n (resolution.instanceIndices.length === 0 && resolution.defaultInstanceIndices.length === 0)\n ) {\n return fail(`No matching candidates found for resource \"${resource.id}\"`);\n }\n\n // Prefer regular matches over default matches\n const candidateIndex =\n resolution.instanceIndices.length > 0\n ? resolution.instanceIndices[0] // Best regular match\n : resolution.defaultInstanceIndices[0]; // Best default match\n\n if (candidateIndex >= resource.candidates.length) {\n return fail(`Invalid candidate index ${candidateIndex} for resource \"${resource.id}\"`);\n }\n\n const bestCandidate = resource.candidates[candidateIndex];\n return succeed(bestCandidate);\n }\n\n /**\n * Resolves all matching resource candidates in priority order.\n * Uses the resource's associated decision to determine all matching candidates based on the current context.\n * @param resource - The {@link Resources.Resource | resource} to resolve.\n * @returns `Success` with an array of all matching candidates in priority order if successful,\n * or `Failure` with an error message if no candidates match or resolution fails.\n * @public\n */\n public resolveAllResourceCandidates(resource: IResource): Result<ReadonlyArray<IResourceCandidate>>;\n\n /**\n * Resolves all matching resource candidates in priority order.\n * Uses the resource's associated decision to determine all matching candidates based on the current context.\n * @param resource - The string id of the resource to resolve.\n * @returns `Success` with an array of all matching candidates in priority order if successful,\n * or `Failure` with an error message if no candidates match or resolution fails.\n * @public\n */\n public resolveAllResourceCandidates(resource: string): Result<ReadonlyArray<IResourceCandidate>>;\n public resolveAllResourceCandidates(\n idOrResource: string | IResource\n ): Result<ReadonlyArray<IResourceCandidate>> {\n if (typeof idOrResource === 'string') {\n return this.resourceManager\n .getBuiltResource(idOrResource)\n .onSuccess((resource) => this.resolveAllResourceCandidates(resource));\n }\n\n const resource = idOrResource;\n\n // Get the abstract decision from the resource's concrete decision\n const abstractDecision = resource.decision.baseDecision;\n\n // Resolve the decision to get candidate indices in priority order\n const decisionResult = this.resolveDecision(abstractDecision);\n /* c8 ignore next 3 - defense in depth almost impossible to hit */\n if (decisionResult.isFailure()) {\n return fail(`Failed to resolve decision for resource \"${resource.id}\": ${decisionResult.message}`);\n }\n\n const resolution = decisionResult.value;\n\n // Check if any candidates matched (regular or default)\n if (\n !resolution.success ||\n (resolution.instanceIndices.length === 0 && resolution.defaultInstanceIndices.length === 0)\n ) {\n return fail(`No matching candidates found for resource \"${resource.id}\"`);\n }\n\n // Get all matching candidates: regular matches first, then default matches\n const candidates: IResourceCandidate[] = [];\n\n // Add all regular matches first (already sorted by priority)\n for (const candidateIndex of resolution.instanceIndices) {\n if (candidateIndex >= resource.candidates.length) {\n return fail(`Invalid candidate index ${candidateIndex} for resource \"${resource.id}\"`);\n }\n const candidate = resource.candidates[candidateIndex];\n candidates.push(candidate);\n }\n\n // Add all default matches after regular matches (already sorted by priority)\n for (const candidateIndex of resolution.defaultInstanceIndices) {\n /* c8 ignore next 3 - defense in depth should not happen */\n if (candidateIndex >= resource.candidates.length) {\n return fail(`Invalid candidate index ${candidateIndex} for resource \"${resource.id}\"`);\n }\n const candidate = resource.candidates[candidateIndex];\n candidates.push(candidate);\n }\n\n return succeed(candidates);\n }\n\n /**\n * Resolves a resource to a composed value by merging matching candidates according to their merge methods.\n * Starting from the highest priority candidates, finds the first \"full\" candidate and merges all higher\n * priority \"partial\" candidates into it in ascending order of priority.\n * @param resource - The {@link Resources.Resource | resource} to resolve.\n * @returns `Success` with the composed JsonValue if successful,\n * or `Failure` with an error message if no candidates match or resolution fails.\n * @public\n */\n public resolveComposedResourceValue(resource: IResource): Result<JsonValue>;\n\n /**\n * Resolves a resource to a composed value by merging matching candidates according to their merge methods.\n * Starting from the highest priority candidates, finds the first \"full\" candidate and merges all higher\n * priority \"partial\" candidates into it in ascending order of priority.\n * @param resource - The string id of the resource to resolve.\n * @returns `Success` with the composed JsonValue if successful,\n * or `Failure` with an error message if no candidates match or resolution fails.\n * @public\n */\n public resolveComposedResourceValue(resource: string): Result<JsonValue>;\n public resolveComposedResourceValue(idOrResource: string | IResource): Result<JsonValue> {\n /* c8 ignore next 4 - defensive coding: string resource resolution should use direct resource calls */\n if (typeof idOrResource === 'string') {\n return this.resourceManager\n .getBuiltResource(idOrResource)\n .onSuccess((resource) => this.resolveComposedResourceValue(resource));\n }\n\n const resource = idOrResource;\n\n return this.resolveAllResourceCandidates(resource).onSuccess((candidates) => {\n /* c8 ignore next 3 - defense in depth should never occur */\n if (candidates.length === 0) {\n return fail(`${resource.id}: No matching candidates found.`);\n }\n\n // Find the first full candidate and collect all partial candidates above it\n let fullCandidateIndex = -1;\n const partialCandidates: IResourceCandidate[] = [];\n\n for (let i = 0; i < candidates.length; i++) {\n const candidate = candidates[i];\n if (!candidate.isPartial) {\n // Found the first full candidate\n fullCandidateIndex = i;\n break;\n } else {\n // Collect partial candidates (these are in ascending priority order)\n partialCandidates.unshift(candidate);\n }\n }\n\n // If no full candidate found, use the last candidate as the base\n const baseCandidateIndex = fullCandidateIndex >= 0 ? fullCandidateIndex : candidates.length - 1;\n const baseCandidate = candidates[baseCandidateIndex];\n\n // If there are no partial candidates to merge, but null-as-delete is enabled,\n // still process through JsonEditor to handle null properties in the base candidate\n if (partialCandidates.length === 0) {\n if (this.options.suppressNullAsDelete || !isJsonObject(baseCandidate.json)) {\n return succeed(baseCandidate.json);\n }\n\n // Process single candidate through JsonEditor to apply null-as-delete\n const editor = JsonEditor.create({\n merge: {\n arrayMergeBehavior: 'replace',\n nullAsDelete: true\n }\n }).orThrow(); // Should never fail with valid options\n\n return editor\n .mergeObjectsInPlace({}, [baseCandidate.json])\n .withErrorFormat((err) => `${resource.id}: Composition failed: ${err}`);\n }\n\n const allCandidates = [\n baseCandidate.json,\n ...partialCandidates.map((candidate) => candidate.json)\n ].filter((v): v is JsonObject => isJsonObject(v));\n\n /* c8 ignore next 3 - defensive check: non-object values in resource candidates should be prevented at validation time */\n if (allCandidates.length !== partialCandidates.length + 1) {\n return fail(`${resource.id}: Unable to compose non-object candidate values.`);\n }\n\n // Create JsonEditor with array replacement behavior and null-as-delete for resource composition\n const editor = JsonEditor.create({\n merge: {\n arrayMergeBehavior: 'replace',\n nullAsDelete: !this.options.suppressNullAsDelete\n }\n }).orThrow(); // Should never fail with valid options\n\n return editor\n .mergeObjectsInPlace({}, allCandidates)\n .withErrorFormat((err) => `${resource.id}: Composition failed: ${err}`);\n });\n }\n\n /**\n * {@inheritDoc IResourceResolver.withContext}\n */\n public withContext(context: Record<string, string>): Result<ResourceResolver> {\n const { resourceManager, qualifierTypes, options } = this;\n return ValidatingSimpleContextQualifierProvider.create({\n qualifiers: this.qualifiers,\n qualifierValues: context\n }).onSuccess((contextQualifierProvider) => {\n return ResourceResolver.create({\n resourceManager,\n qualifierTypes,\n options,\n contextQualifierProvider\n });\n });\n }\n\n /**\n * Clears all caches (condition, condition set, and decision), forcing all cached items\n * to be re-evaluated on next access. This should be called when the context changes and cached\n * results are no longer valid.\n * @public\n */\n public clearConditionCache(): void {\n this._conditionCache.fill(undefined);\n this._conditionSetCache.fill(undefined);\n this._decisionCache.fill(undefined);\n\n this._listener?.onCacheClear('condition');\n this._listener?.onCacheClear('conditionSet');\n this._listener?.onCacheClear('decision');\n }\n\n /**\n * Gets the current size of the condition cache array.\n * @returns The size of the condition cache array.\n * @public\n */\n public get conditionCacheSize(): number {\n return this._conditionCache.length;\n }\n\n /**\n * Gets the current size of the condition set cache array.\n * @returns The size of the condition set cache array.\n * @public\n */\n public get conditionSetCacheSize(): number {\n return this._conditionSetCache.length;\n }\n\n /**\n * Gets the current size of the decision cache array.\n * @returns The size of the decision cache array.\n * @public\n */\n public get decisionCacheSize(): number {\n return this._decisionCache.length;\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceTreeResolver.d.ts","sourceRoot":"","sources":["../../../src/packlets/runtime/resourceTreeResolver.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAAmD,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAgC,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAAoB,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;;;;;;GAQG;AACH,MAAM,MAAM,oBAAoB,GAAG,CACjC,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,gBAAgB,KACvB,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;AAEnC;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,UAAU,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAChD,gBAAgB,EAAE,MAAM,EAAE,EAC1B,QAAQ,EAAE,gBAAgB,KACvB,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;AAEnC;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,oBAAoB,CAAC;IAE3D;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,kBAAkB,CAAC;CACvD;AAED;;;;;;;;;GASG;AACH,qBAAa,oBAAoB;IAC/B;;OAEG;IACH,SAAgB,QAAQ,EAAE,gBAAgB,CAAC;IAE3C;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA8B;IAC/D;;;OAGG;IACH,OAAO,CAAC,KAAK,CAAC,CAA+C;IAE7D;;;OAGG;gBACgB,QAAQ,EAAE,gBAAgB;IAK7C;;;OAGG;WACW,MAAM,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CAAC,oBAAoB,CAAC;IAI9E;;;;;OAKG;IACH,IAAW,IAAI,IAAI,yBAAyB,CAAC,SAAS,CAAC,CAEtD;IAED;;;;;;OAMG;IACI,2BAA2B,CAChC,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,2BAA2B,GACpC,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC;IAEjC;;;;;;OAMG;IACI,2BAA2B,CAChC,IAAI,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAC1C,OAAO,CAAC,EAAE,2BAA2B,GACpC,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC;IAejC,OAAO,CAAC,QAAQ;IAOhB;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAY9B;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAuB5B;;;;;;;OAOG;IACH,OAAO,CAAC,oBAAoB;IAiB5B;;;;;;;OAOG;IACH,OAAO,CAAC,kBAAkB;IAgB1B;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;IAgBxB;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB;CA4D3B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceTreeResolver.js","sourceRoot":"","sources":["../../../src/packlets/runtime/resourceTreeResolver.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAwF;AACxF,oDAAwF;AA2DxF;;;;;;;;;GASG;AACH,MAAa,oBAAoB;IAiB/B;;;OAGG;IACH,YA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C;YACH,CAAC;iBAAM,CAAC;gBACN,IAAI,iBAAiB,KAAK,MAAM,EAAE,CAAC;oBACjC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBAC7C,CAAC;gBACD,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;QAED,8CAA8C;QAC9C,IAAI,iBAAiB,KAAK,MAAM,IAAI,UAAU,CAAC,WAAW,EAAE,CAAC;YAC3D,OAAO,IAAA,eAAI,EAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QACzC,CAAC;QAED,sBAAsB;QACtB,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3C,OAAO,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,cAAc,EAAE,eAAe,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;gBAC9F,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;oBACxB,OAAO,IAAA,kBAAO,EAAC,SAAS,CAAC,CAAC;gBAC5B,CAAC;gBACD,2CAA2C;gBAC3C,OAAO,yBAAc,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAClD,CAAC,CAAC,CAAC;QACL,CAAC;QAED,OAAO,IAAA,kBAAO,EAAC,YAAY,CAAC,CAAC;IAC/B,CAAC;CACF;AA9QD,oDA8QC","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, MessageAggregator, succeed, fail, captureResult } from '@fgv/ts-utils';\nimport { JsonValue, JsonObject, Converters as JsonConverters } from '@fgv/ts-json-base';\nimport { IResourceManager, IResource } from './iResourceManager';\nimport { IReadOnlyResourceTreeNode, IReadOnlyResourceTreeRoot } from './resource-tree/common';\nimport { ResourceResolver } from './resourceResolver';\n\n/**\n * Type for handling resource resolution errors during tree traversal.\n * The handler receives the resource that failed to resolve, the error message, and the resolver for recovery attempts.\n * It can return:\n * - Success(undefined) to omit the property from the result\n * - Success(value) to use an alternate value\n * - Failure to propagate the error\n * @public\n */\nexport type ResourceErrorHandler = (\n resource: IResource,\n message: string,\n resolver: ResourceResolver\n) => Result<JsonValue | undefined>;\n\n/**\n * Type for handling empty branch nodes during tree composition.\n * The handler receives the branch node, names of failed children, and the resolver for recovery attempts.\n * It can return:\n * - Success(undefined) to omit the branch from the result\n * - Success(value) to use an alternate value for the branch\n * - Failure to propagate the error\n * @public\n */\nexport type EmptyBranchHandler = (\n branchNode: IReadOnlyResourceTreeNode<IResource>,\n failedChildNames: string[],\n resolver: ResourceResolver\n) => Result<JsonValue | undefined>;\n\n/**\n * Options for configuring resource tree resolution.\n * @public\n */\nexport interface IResolveResourceTreeOptions {\n /**\n * Controls how errors are handled when resolving individual resources in the tree.\n * - 'fail': Aggregate all errors and fail if any resource fails to resolve\n * - 'ignore': Skip failed resources and omit them from the result\n * - callback: Custom error handler that can provide alternate values or propagate errors\n * @defaultValue 'fail'\n */\n onResourceError?: 'fail' | 'ignore' | ResourceErrorHandler;\n\n /**\n * Controls how empty branch nodes are handled during tree composition.\n * - 'allow': Include empty branches as empty objects in the result\n * - 'omit': Exclude empty branches from the parent object\n * - callback: Custom handler that can provide alternate values or recovery logic\n * @defaultValue 'allow'\n */\n onEmptyBranch?: 'allow' | 'omit' | EmptyBranchHandler;\n}\n\n/**\n * Specialized resolver for resource tree operations, providing enhanced APIs for\n * resolving entire resource trees from either resource IDs or pre-built tree nodes.\n *\n * This class provides a clean separation between individual resource resolution\n * (handled by ResourceResolver) and tree-based operations, with support for\n * lazy tree construction and enhanced error handling.\n *\n * @public\n */\nexport class ResourceTreeResolver {\n /**\n * The {@link Runtime.ResourceResolver | ResourceResolver} to use for individual resource resolution\n */\n public readonly resolver: ResourceResolver;\n\n /**\n * The {@link Runtime.IResourceManager | IResourceManager} to use for lazy tree construction.\n * @internal\n */\n private readonly _resourceManager: IResourceManager<IResource>;\n /**\n * The built resource tree, lazily built on first access.\n * @internal\n */\n private _tree?: Result<IReadOnlyResourceTreeRoot<IResource>>;\n\n /**\n * Creates a {@link Runtime.ResourceTreeResolver | ResourceTreeResolver} instance.\n * @param resolver - The ResourceResolver to use for individual resource resolution\n */\n public constructor(resolver: ResourceResolver) {\n this.resolver = resolver;\n this._resourceManager = resolver.resourceManager;\n }\n\n /**\n * Creates a {@link Runtime.ResourceTreeResolver | ResourceTreeResolver} instance.\n * @param resolver - The ResourceResolver to use for individual resource resolution\n */\n public static create(resolver: ResourceResolver): Result<ResourceTreeResolver> {\n return captureResult(() => new ResourceTreeResolver(resolver));\n }\n\n /**\n * Gets the built resource tree, building it lazily on first access.\n * @returns The resource tree root\n * @throws Error if no resource manager was provided or tree building fails\n * @public\n */\n public get tree(): IReadOnlyResourceTreeRoot<IResource> {\n return this._getTree().orThrow();\n }\n\n /**\n * Resolves a resource tree from a resource ID, building the tree lazily from the resource manager.\n * @param resourceId - The ID of the root resource to resolve\n * @param options - Optional configuration for error handling during resolution\n * @returns Success with the composed JsonObject or undefined, or Failure with error message\n * @public\n */\n public resolveComposedResourceTree(\n resourceId: string,\n options?: IResolveResourceTreeOptions\n ): Result<JsonObject | undefined>;\n\n /**\n * Resolves a pre-built resource tree node.\n * @param node - The resource tree node to resolve\n * @param options - Optional configuration for error handling during resolution\n * @returns Success with the composed JsonObject or undefined, or Failure with error message\n * @public\n */\n public resolveComposedResourceTree(\n node: IReadOnlyResourceTreeNode<IResource>,\n options?: IResolveResourceTreeOptions\n ): Result<JsonObject | undefined>;\n\n /**\n * Implementation for both overloads.\n */\n public resolveComposedResourceTree(\n idOrNode: string | IReadOnlyResourceTreeNode<IResource>,\n options?: IResolveResourceTreeOptions\n ): Result<JsonObject | undefined> {\n if (typeof idOrNode === 'string') {\n return this._resolveFromResourceId(idOrNode, options);\n }\n return this._resolveFromTreeNode(idOrNode, options);\n }\n\n private _getTree(): Result<IReadOnlyResourceTreeRoot<IResource>> {\n if (!this._tree) {\n this._tree = this._resourceManager.getBuiltResourceTree();\n }\n return this._tree;\n }\n\n /**\n * Resolves a tree from a resource ID by first building the tree from the resource manager.\n * @internal\n */\n private _resolveFromResourceId(\n resourceId: string,\n options?: IResolveResourceTreeOptions\n ): Result<JsonObject | undefined> {\n return this._getTree().onSuccess((tree) => {\n return tree.children.validating\n .getById(resourceId)\n .onFailure((message) => fail(`${resourceId}: Resource not found in resource tree: ${message}`))\n .onSuccess((rootNode) => this._resolveFromTreeNode(rootNode, options));\n });\n }\n\n /**\n * Resolves a pre-built tree node using the extracted tree resolution logic.\n * @internal\n */\n private _resolveFromTreeNode(\n node: IReadOnlyResourceTreeNode<IResource>,\n options?: IResolveResourceTreeOptions\n ): Result<JsonObject | undefined> {\n const resourceErrorMode = options?.onResourceError ?? 'fail';\n const emptyBranchMode = options?.onEmptyBranch ?? 'allow';\n\n // Handle root node with proper Result chaining\n return node.isLeaf\n ? this._processLeafNode(node, '', resourceErrorMode).onSuccess((value) =>\n value !== undefined ? JsonConverters.jsonObject.convert(value) : succeed(undefined)\n )\n : this._processBranchNode(node, '', {\n onResourceError: resourceErrorMode,\n onEmptyBranch: emptyBranchMode\n }).onSuccess((value) => {\n // Only convert undefined to {} if emptyBranchMode is 'allow'\n // For 'omit' mode or custom handlers returning undefined, preserve undefined\n /* c8 ignore next 3 - defense in depth */\n return succeed(value === undefined && emptyBranchMode === 'allow' ? {} : value);\n });\n }\n\n /**\n * Handles resource resolution errors according to the specified mode.\n * @param resource - The resource that failed to resolve\n * @param message - The error message from the failed resolution\n * @param mode - The error handling mode\n * @param path - The path to the resource in the tree (for error context)\n * @internal\n */\n private _handleResourceError(\n resource: IResource,\n message: string,\n mode: 'fail' | 'ignore' | ResourceErrorHandler,\n path: string\n ): Result<JsonValue | undefined> {\n if (mode === 'ignore') {\n return succeed(undefined);\n }\n if (mode === 'fail') {\n const errorMessage = path ? `${path}: ${message}` : message;\n return fail(errorMessage);\n }\n // Custom handler - pass the resolver for recovery attempts\n return mode(resource, message, this.resolver);\n }\n\n /**\n * Handles empty branch nodes according to the specified mode.\n * @param node - The empty branch node\n * @param failedChildren - Names of children that failed to resolve\n * @param mode - The empty branch handling mode\n * @param path - The path to the branch in the tree (for error context)\n * @internal\n */\n private _handleEmptyBranch(\n node: IReadOnlyResourceTreeNode<IResource>,\n failedChildren: string[],\n mode: 'allow' | 'omit' | EmptyBranchHandler,\n path: string\n ): Result<JsonValue | undefined> {\n if (mode === 'omit') {\n return succeed(undefined);\n }\n if (mode === 'allow') {\n return succeed({});\n }\n // Custom handler - pass the resolver for recovery attempts\n return mode(node, failedChildren, this.resolver);\n }\n\n /**\n * Processes a leaf node by resolving its resource value.\n * @param node - The leaf node to process (must be a leaf node)\n * @param path - The path to the node in the tree\n * @param resourceErrorMode - How to handle resource resolution errors\n * @internal\n */\n private _processLeafNode(\n node: IReadOnlyResourceTreeNode<IResource>,\n path: string,\n resourceErrorMode: 'fail' | 'ignore' | ResourceErrorHandler\n ): Result<JsonValue | undefined> {\n /* c8 ignore next 3 - defense in depth */\n if (!node.isLeaf) {\n return fail(`Internal error: processLeafNode called on non-leaf node at ${path}`);\n }\n\n return this.resolver\n .resolveComposedResourceValue(node.resource)\n .onSuccess<JsonValue | undefined>((value) => succeed(value))\n .onFailure((message) => this._handleResourceError(node.resource, message, resourceErrorMode, path));\n }\n\n /**\n * Processes a branch node by recursively resolving all its children.\n * @param node - The branch node to process (must be a branch node)\n * @param path - The path to the node in the tree\n * @param options - Resolution options\n * @internal\n */\n private _processBranchNode(\n node: IReadOnlyResourceTreeNode<IResource>,\n path: string,\n options: IResolveResourceTreeOptions\n ): Result<JsonObject | undefined> {\n /* c8 ignore next 3 - defense in depth */\n if (node.isLeaf) {\n return fail(`Internal error: processBranchNode called on leaf node at ${path}`);\n }\n\n /* c8 ignore next 2 - ?? is defense in depth */\n const resourceErrorMode = options.onResourceError ?? 'fail';\n const emptyBranchMode = options.onEmptyBranch ?? 'allow';\n const aggregator = new MessageAggregator();\n\n // Process all children\n const childResults: JsonObject = {};\n const failedChildren: string[] = [];\n\n for (const [childName, childNode] of node.children) {\n const childPath = path ? `${path}.${childName}` : childName;\n\n const childResult = childNode.isLeaf\n ? this._processLeafNode(childNode, childPath, resourceErrorMode)\n : this._processBranchNode(childNode, childPath, options);\n\n // Process the child result and update our state\n if (childResult.isSuccess()) {\n const value = childResult.value;\n if (value !== undefined) {\n childResults[childName] = value;\n } else {\n failedChildren.push(childName);\n }\n } else {\n if (resourceErrorMode === 'fail') {\n aggregator.addMessage(childResult.message);\n }\n failedChildren.push(childName);\n }\n }\n\n // Check for accumulated errors in 'fail' mode\n if (resourceErrorMode === 'fail' && aggregator.hasMessages) {\n return fail(aggregator.toString('; '));\n }\n\n // Handle empty branch\n if (Object.keys(childResults).length === 0) {\n return this._handleEmptyBranch(node, failedChildren, emptyBranchMode, path).onSuccess((value) => {\n if (value === undefined) {\n return succeed(undefined);\n }\n // Ensure we return JsonObject or undefined\n return JsonConverters.jsonObject.convert(value);\n });\n }\n\n return succeed(childResults);\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/packlets/runtime/validate.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAc,SAAS,EAAE,MAAM,eAAe,CAAC;AAKtD,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC,kBAAkB,EAAE,OAAO,CAQjE,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,CAAC,SAAS,EAAE,OAAO,CAejD,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/packlets/runtime/validate.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAsD;AACtD,oDAAiE;AACjE,sCAAiD;AACjD,sDAAiD;AACjD,4CAAgD;AAGhD;;;GAGG;AACU,QAAA,iBAAiB,GAC5B,qBAAU,CAAC,MAAM,CAAqB;IACpC,IAAI,EAAE,yBAAc,CAAC,UAAU;IAC/B,SAAS,EAAE,qBAAU,CAAC,OAAO;IAC7B,WAAW,EAAE,qBAAU,CAAC,GAAG,CACzB,6BAA6B,EAC7B,CAAC,CAAC,EAAyC,EAAE,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,SAAS,CACnG;CACF,CAAC,CAAC;AAEL;;;GAGG;AACU,QAAA,QAAQ,GAAkC,qBAAU,CAAC,MAAM,CAAY;IAClF,EAAE,EAAE,qBAAU,CAAC,GAAG,CAChB,YAAY,EACZ,CAAC,CAAC,EAAmB,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,iBAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAC/E;IACD,IAAI,EAAE,qBAAU,CAAC,GAAG,CAClB,cAAc,EACd,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,iBAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAC7E;IACD,YAAY,EAAE,qBAAU,CAAC,GAAG,CAAC,uBAAuB,EAAE,CAAC,CAAC,EAAqB,EAAE,CAAC,CAAC,YAAY,6BAAY,CAAC;IAC1G,QAAQ,EAAE,qBAAU,CAAC,GAAG,CACtB,2BAA2B,EAC3B,CAAC,CAAC,EAAyB,EAAE,CAAC,CAAC,YAAY,4BAAgB,CAC5D;IACD,UAAU,EAAE,qBAAU,CAAC,OAAO,CAAC,yBAAiB,CAAC;CAClD,CAAC,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Validators, Validator } from '@fgv/ts-utils';\nimport { Validators as JsonValidators } from '@fgv/ts-json-base';\nimport { Validate, ResourceId } from '../common';\nimport { ResourceType } from '../resource-types';\nimport { ConcreteDecision } from '../decisions';\nimport { IResource, IResourceCandidate } from './iResourceManager';\n\n/**\n * Validates an {@link Runtime.IResourceCandidate | IResourceCandidate} object.\n * @public\n */\nexport const resourceCandidate: Validator<IResourceCandidate, unknown> =\n Validators.object<IResourceCandidate>({\n json: JsonValidators.jsonObject,\n isPartial: Validators.boolean,\n mergeMethod: Validators.isA(\n 'resource value merge method',\n (v): v is 'augment' | 'delete' | 'replace' => v === 'augment' || v === 'delete' || v === 'replace'\n )\n });\n\n/**\n * Validates an {@link Runtime.IResource | IResource} object.\n * @public\n */\nexport const resource: Validator<IResource, unknown> = Validators.object<IResource>({\n id: Validators.isA(\n 'ResourceId',\n (v): v is ResourceId => typeof v === 'string' && Validate.isValidResourceId(v)\n ),\n name: Validators.isA(\n 'ResourceName',\n (v): v is string => typeof v === 'string' && Validate.isValidResourceName(v)\n ),\n resourceType: Validators.isA('ResourceType instance', (v): v is ResourceType => v instanceof ResourceType),\n decision: Validators.isA(\n 'ConcreteDecision instance',\n (v): v is ConcreteDecision => v instanceof ConcreteDecision\n ),\n candidates: Validators.arrayOf(resourceCandidate)\n});\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../src/packlets/zip-archive/convert.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAAc,SAAS,EAAc,MAAM,eAAe,CAAC;AAC7E,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,KAAK,IAAI,WAAW,EAA4B,MAAM,WAAW,CAAC;AAE3E;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,CAAC,MAAM,GAAG,WAAW,CAGrD,CAAC;AAEZ;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,CAAC,MAAM,CAAiD,CAAC;AAErG;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,CAAC,IAAI,CAA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["/*\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 { Validator, Validators, Converter, Converters } from '@fgv/ts-utils';\nimport * as Json from './json';\nimport { Model as ConfigModel, Convert as ConfigConvert } from '../config';\n\n/**\n * Validator for ZIP archive input type\n * @public\n */\nexport const zipArchiveInputType: Validator<'file' | 'directory'> = Validators.enumeratedValue([\n 'file',\n 'directory'\n] as const);\n\n/**\n * Validator for ZIP archive config type\n * @public\n */\nexport const zipArchiveConfigType: Validator<'file'> = Validators.enumeratedValue(['file'] as const);\n\n/**\n * Validator for ZIP archive input information\n * @public\n */\nexport const zipArchiveInputInfo: Validator<Json.IZipArchiveInputInfo> =\n Validators.object<Json.IZipArchiveInputInfo>({\n type: zipArchiveInputType,\n originalPath: Validators.string,\n archivePath: Validators.string\n });\n\n/**\n * Validator for ZIP archive config information\n * @public\n */\nexport const zipArchiveConfigInfo: Validator<Json.IZipArchiveConfigInfo> =\n Validators.object<Json.IZipArchiveConfigInfo>({\n type: zipArchiveConfigType,\n originalPath: Validators.string,\n archivePath: Validators.string\n });\n\n/**\n * Validator for ZIP archive manifest\n * Compatible with existing tools from ts-res-browser-cli\n * @public\n */\nexport const zipArchiveManifest: Validator<Json.IZipArchiveManifest> =\n Validators.object<Json.IZipArchiveManifest>({\n timestamp: Validators.string,\n input: zipArchiveInputInfo.optional(),\n config: zipArchiveConfigInfo.optional()\n });\n\n/**\n * Validator for MIME type strings\n * @public\n */\nexport const mimeType: Validator<string> = Validators.string;\n\n/**\n * Converter for imported file\n * @public\n */\nexport const importedFile: Converter<Json.IImportedFile> = Converters.strictObject<Json.IImportedFile>({\n name: Converters.string,\n path: Converters.string,\n content: Converters.string,\n type: Converters.string // MIME type as string\n});\n\n/**\n * Converter for imported directory structure (recursive)\n * Note: Uses Converter pattern because Validators don't support recursion with self parameter\n * @public\n */\nexport const importedDirectory: Converter<Json.IImportedDirectory> = Converters.generic<\n Json.IImportedDirectory,\n unknown\n>((from: unknown, self: Converter<Json.IImportedDirectory, unknown>, context?: unknown) => {\n return Converters.strictObject<Json.IImportedDirectory>({\n name: Converters.string,\n files: Converters.arrayOf(importedFile),\n subdirectories: Converters.arrayOf(self)\n }).convert(from, context);\n});\n\n/**\n * Validator for system configuration (delegates to config packlet)\n * This validates that the parsed JSON conforms to the system configuration schema\n * @public\n */\nexport const systemConfiguration: Validator<ConfigModel.ISystemConfiguration> = Validators.isA(\n 'system configuration',\n (value: unknown): value is ConfigModel.ISystemConfiguration => {\n return ConfigConvert.systemConfiguration.convert(value).isSuccess();\n }\n);\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../../../src/packlets/zip-archive/index.browser.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAGrC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAGzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,YAAY,EACV,sBAAsB,EACtB,0BAA0B,EAC1B,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,kBAAkB,EAClB,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACV,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../../../src/packlets/zip-archive/index.browser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAEH,6CAA+B;AAItB,oBAAI;AAHb,mDAAqC;AAGtB,0BAAO;AAEtB,4EAA4E;AAC5E,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AAgBzB,mBAAmB;AACnB,uDAU4B;AAT1B,4HAAA,wBAAwB,OAAA;AACxB,2HAAA,uBAAuB,OAAA;AACvB,8HAAA,0BAA0B,OAAA;AAC1B,gIAAA,4BAA4B,OAAA;AAC5B,8HAAA,0BAA0B,OAAA;AAC1B,iHAAA,aAAa,OAAA;AACb,oHAAA,gBAAgB,OAAA;AAChB,oHAAA,gBAAgB,OAAA;AAChB,6GAAA,SAAS,OAAA;AAGX,YAAY;AACZ,iCAA8C;AAArC,4GAAA,mBAAmB,OAAA;AAE5B,+EAA+E;AAC/E,iEAAiE;AACjE,6EAA6E","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * Browser-safe ZIP archive functionality for ts-res source file archives\n *\n * This packlet provides consolidated ZIP archive creation and loading functionality\n * for source files, compatible with browsers using fflate.\n *\n * @remarks\n * ZIP archives contain source files for resource ingestion with directory\n * structure preserved and optional validation but no processing or transformation.\n * This is distinct from ZIP bundles which contain processed resource output.\n *\n * ZipArchiveCreator supports browser usage when FileTreeItems are provided directly.\n * Methods accepting file paths require Node.js fs access and should not be called in browser.\n *\n * ZipArchiveLoader is fully browser-compatible and works with File API or ArrayBuffer.\n *\n * @packageDocumentation\n */\n\nimport * as Json from './json';\nimport * as Convert from './convert';\n\n// Namespaces\nexport { Json, Convert };\n\n// Core classes (browser-compatible when used with FileTreeItems or buffers)\nexport { ZipArchiveCreator } from './zipArchiveCreator';\nexport { ZipArchiveLoader } from './zipArchiveLoader';\n\n// Types and interfaces\nexport type {\n IZipArchivePathOptions,\n IZipArchiveFileTreeOptions,\n ZipArchiveOptions,\n IZipArchiveResult,\n IZipArchiveManifest,\n IZipArchiveLoadOptions,\n IZipArchiveLoadResult,\n IImportedFile,\n IImportedDirectory,\n ZipArchiveProgressCallback\n} from './types';\n\n// Format utilities\nexport {\n createZipArchiveManifest,\n parseZipArchiveManifest,\n validateZipArchiveManifest,\n parseZipArchiveConfiguration,\n generateZipArchiveFilename,\n normalizePath,\n getDirectoryName,\n sanitizeFilename,\n isZipFile\n} from './zipArchiveFormat';\n\n// Constants\nexport { ZipArchiveConstants } from './types';\n\n// Note: ZipArchiveCreator._getInputFileTreeItem() and _getConfigFileTreeItem()\n// use FileTree.forFilesystem() internally when given file paths.\n// In browser, provide FileTreeItems directly via IZipArchiveFileTreeOptions.\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/zip-archive/index.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAGrC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAGzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,YAAY,EACV,sBAAsB,EACtB,0BAA0B,EAC1B,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,kBAAkB,EAClB,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACV,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/zip-archive/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH;;;;;;;;;;;;;GAaG;AAEH,6CAA+B;AAItB,oBAAI;AAHb,mDAAqC;AAGtB,0BAAO;AAEtB,eAAe;AACf,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AAgBzB,mBAAmB;AACnB,uDAU4B;AAT1B,4HAAA,wBAAwB,OAAA;AACxB,2HAAA,uBAAuB,OAAA;AACvB,8HAAA,0BAA0B,OAAA;AAC1B,gIAAA,4BAA4B,OAAA;AAC5B,8HAAA,0BAA0B,OAAA;AAC1B,iHAAA,aAAa,OAAA;AACb,oHAAA,gBAAgB,OAAA;AAChB,oHAAA,gBAAgB,OAAA;AAChB,6GAAA,SAAS,OAAA;AAGX,YAAY;AACZ,iCAA8C;AAArC,4GAAA,mBAAmB,OAAA","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * ZIP archive functionality for ts-res source file archives\n *\n * This packlet provides consolidated ZIP archive creation and loading functionality\n * for source files, compatible with existing tools while using fflate for\n * universal browser compatibility.\n *\n * @remarks\n * ZIP archives contain source files for resource ingestion with directory\n * structure preserved and optional validation but no processing or transformation.\n * This is distinct from ZIP bundles which contain processed resource output.\n *\n * @packageDocumentation\n */\n\nimport * as Json from './json';\nimport * as Convert from './convert';\n\n// Namespaces\nexport { Json, Convert };\n\n// Core classes\nexport { ZipArchiveCreator } from './zipArchiveCreator';\nexport { ZipArchiveLoader } from './zipArchiveLoader';\n\n// Types and interfaces\nexport type {\n IZipArchivePathOptions,\n IZipArchiveFileTreeOptions,\n ZipArchiveOptions,\n IZipArchiveResult,\n IZipArchiveManifest,\n IZipArchiveLoadOptions,\n IZipArchiveLoadResult,\n IImportedFile,\n IImportedDirectory,\n ZipArchiveProgressCallback\n} from './types';\n\n// Format utilities\nexport {\n createZipArchiveManifest,\n parseZipArchiveManifest,\n validateZipArchiveManifest,\n parseZipArchiveConfiguration,\n generateZipArchiveFilename,\n normalizePath,\n getDirectoryName,\n sanitizeFilename,\n isZipFile\n} from './zipArchiveFormat';\n\n// Constants\nexport { ZipArchiveConstants } from './types';\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../src/packlets/zip-archive/json.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,wCAAwC;IACxC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,mCAAmC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAElB,wCAAwC;IACxC,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAE7B,8CAA8C;IAC9C,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,qBAAqB;IACrB,cAAc,EAAE,kBAAkB,EAAE,CAAC;CACtC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.js","sourceRoot":"","sources":["../../../src/packlets/zip-archive/json.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * JSON representation of ZIP archive input information\n * @public\n */\nexport interface IZipArchiveInputInfo {\n /** Type of input (file or directory) */\n type: 'file' | 'directory';\n /** Original file/directory path */\n originalPath: string;\n /** Path within the archive (e.g., \"input/mydir\") */\n archivePath: string;\n}\n\n/**\n * JSON representation of ZIP archive config information\n * @public\n */\nexport interface IZipArchiveConfigInfo {\n /** Type of config (always 'file') */\n type: 'file';\n /** Original config file path */\n originalPath: string;\n /** Path within the archive (e.g., \"config.json\") */\n archivePath: string;\n}\n\n/**\n * JSON representation of a ZIP archive manifest\n * Compatible with existing tools from ts-res-browser-cli\n * @public\n */\nexport interface IZipArchiveManifest {\n /** Archive creation timestamp */\n timestamp: string;\n\n /** Optional input source information */\n input?: IZipArchiveInputInfo;\n\n /** Optional configuration file information */\n config?: IZipArchiveConfigInfo;\n}\n\n/**\n * JSON representation of an imported file\n * @public\n */\nexport interface IImportedFile {\n /** File name */\n name: string;\n /** Full path within archive */\n path: string;\n /** File content as string */\n content: string;\n /** MIME type */\n type: string;\n}\n\n/**\n * JSON representation of an imported directory structure\n * @public\n */\nexport interface IImportedDirectory {\n /** Directory name */\n name: string;\n /** Files in this directory */\n files: IImportedFile[];\n /** Subdirectories */\n subdirectories: IImportedDirectory[];\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/packlets/zip-archive/types.ts"],"names":[],"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,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;AAE/C;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC;AAEzD;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG,CACvC,KAAK,EACD,cAAc,GACd,aAAa,GACb,kBAAkB,GAClB,gBAAgB,GAChB,kBAAkB,GAClB,sBAAsB,GACtB,cAAc,EAClB,QAAQ,EAAE,MAAM,EAAE,QAAQ;AAC1B,OAAO,EAAE,MAAM,KACZ,IAAI,CAAC;AAEV;;;GAGG;AACH,eAAO,MAAM,mBAAmB;IAC9B,yBAAyB;;IAEzB,8BAA8B;;IAE9B,4BAA4B;;IAE5B,oCAAoC;;CAE5B,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/packlets/zip-archive/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AA2GH;;;GAGG;AACU,QAAA,mBAAmB,GAAG;IACjC,yBAAyB;IACzB,aAAa,EAAE,eAAe;IAC9B,8BAA8B;IAC9B,WAAW,EAAE,aAAa;IAC1B,4BAA4B;IAC5B,SAAS,EAAE,OAAO;IAClB,oCAAoC;IACpC,UAAU,EAAE,QAAQ;CACZ,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 { Model as ConfigModel } from '../config';\nimport * as Json from './json';\nimport {} from '@fgv/ts-utils';\nimport { FileTree } from '@fgv/ts-json-base';\n\n/**\n * Options for creating a ZIP archive buffer\n * @public\n */\nexport interface IZipArchivePathOptions {\n /** File or directory path to include in the archive */\n inputPath?: string;\n /** Optional configuration file path */\n configPath?: string;\n}\n\n/**\n * Options for creating a ZIP archive buffer from a file tree\n * @public\n */\nexport interface IZipArchiveFileTreeOptions {\n /** Input file or directory */\n inputItem?: FileTree.FileTreeItem;\n /** Optional configuration file */\n configItem?: FileTree.IFileTreeFileItem;\n}\n\n/**\n * Options for creating a ZIP archive buffer\n * @public\n */\nexport type ZipArchiveOptions = IZipArchivePathOptions | IZipArchiveFileTreeOptions;\n\n/**\n * Standardized ZIP archive manifest format (compatible with existing tools)\n * @public\n */\nexport type IZipArchiveManifest = Json.IZipArchiveManifest;\n\n/**\n * Result of ZIP archive buffer creation\n * @public\n */\nexport interface IZipArchiveResult {\n /** Raw ZIP data buffer */\n zipBuffer: Uint8Array;\n /** Archive manifest with metadata */\n manifest: IZipArchiveManifest;\n /** Total ZIP size in bytes */\n size: number;\n}\n\n/**\n * Options for loading a ZIP archive\n * @public\n */\nexport interface IZipArchiveLoadOptions {\n /** Validate manifest strictly */\n strictManifestValidation?: boolean;\n}\n\n/**\n * Result of ZIP archive loading\n * @public\n */\nexport interface IZipArchiveLoadResult {\n /** Parsed archive manifest */\n manifest: IZipArchiveManifest | undefined;\n /** Loaded configuration */\n config: ConfigModel.ISystemConfiguration | undefined;\n /** All files extracted from the archive */\n files: IImportedFile[];\n /** Directory structure if available */\n directory: IImportedDirectory | undefined;\n}\n\n/**\n * Imported file representation\n * @public\n */\nexport type IImportedFile = Json.IImportedFile;\n\n/**\n * Imported directory structure\n * @public\n */\nexport type IImportedDirectory = Json.IImportedDirectory;\n\n/**\n * Progress callback for ZIP operations\n * @public\n */\nexport type ZipArchiveProgressCallback = (\n stage:\n | 'reading-file'\n | 'parsing-zip'\n | 'loading-manifest'\n | 'loading-config'\n | 'extracting-files'\n | 'processing-resources'\n | 'creating-zip',\n progress: number, // 0-100\n details: string\n) => void;\n\n/**\n * Constants for ZIP archive structure\n * @public\n */\nexport const ZipArchiveConstants = {\n /** Manifest file name */\n MANIFEST_FILE: 'manifest.json',\n /** Configuration file name */\n CONFIG_FILE: 'config.json',\n /** Input files directory */\n INPUT_DIR: 'input',\n /** Configuration files directory */\n CONFIG_DIR: 'config'\n} as const;\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zipArchiveCreator.d.ts","sourceRoot":"","sources":["../../../src/packlets/zip-archive/zipArchiveCreator.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAIhG;;;GAGG;AACH,qBAAa,iBAAiB;IAC5B;;;;;OAKG;IACU,gBAAgB,CAC3B,OAAO,EAAE,iBAAiB,EAC1B,UAAU,CAAC,EAAE,0BAA0B,GACtC,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAkGrC;;;;;;OAMG;YACW,qBAAqB;IAYnC;;;;;;;OAOG;YACW,sBAAsB;IAoCpC,OAAO,CAAC,qBAAqB;IAa7B,OAAO,CAAC,sBAAsB;CAY/B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zipArchiveCreator.js","sourceRoot":"","sources":["../../../src/packlets/zip-archive/zipArchiveCreator.ts"],"names":[],"mappings":";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E,CAAC;iBAC9D,SAAS,CAAC,CAAC,QAAQ,EAAE,EAAE,CACtB,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,UAAW,CAAC,CAAC,eAAe,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,8BAA8B,GAAG,EAAE,CAAC,CACpG,CAAC;QACN,CAAC;aAAM,IAAI,YAAY,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YACvE,OAAO,IAAA,kBAAO,EAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,IAAA,kBAAO,EAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;CACF;AApMD,8CAoMC","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 { zipSync } from 'fflate';\nimport { Result, succeed, fail } from '@fgv/ts-utils';\nimport { FileTree } from '@fgv/ts-json-base';\nimport type { IZipArchiveResult, ZipArchiveOptions, ZipArchiveProgressCallback } from './types';\nimport { normalizePath } from './zipArchiveFormat';\nimport * as Json from './json';\n\n/**\n * ZIP archive creator using fflate for universal compatibility\n * @public\n */\nexport class ZipArchiveCreator {\n /**\n * Create a ZIP archive buffer from a supplied buffer\n * @param options - Input paths and configuration\n * @param onProgress - Optional progress callback\n * @returns Result containing ZIP buffer and manifest\n */\n public async createFromBuffer(\n options: ZipArchiveOptions,\n onProgress?: ZipArchiveProgressCallback\n ): Promise<Result<IZipArchiveResult>> {\n try {\n onProgress?.('creating-zip', 0, 'Starting ZIP archive creation');\n\n const files: Record<string, Uint8Array> = {};\n const manifest: Json.IZipArchiveManifest = {\n timestamp: new Date().toISOString()\n };\n\n const { value: inputItem, message: inputItemError } = this._getInputFileTreeItem(options);\n if (inputItemError !== undefined) {\n return fail(inputItemError);\n }\n\n if (inputItem !== undefined) {\n onProgress?.('reading-file', 10, `Processing input: ${inputItem.absolutePath}`);\n\n if (inputItem.type === 'directory') {\n // Add entire directory recursively, preserving structure\n const archivePath = `input/${inputItem.name}`;\n\n const addDirResult = await this._addDirectoryTreeToZip(files, inputItem, archivePath, onProgress);\n /* c8 ignore next 3 - defense in depth against internal error */\n if (addDirResult.isFailure()) {\n return fail(addDirResult.message);\n }\n\n manifest.input = {\n type: 'directory',\n originalPath: inputItem.absolutePath,\n archivePath\n };\n } else if (inputItem.type === 'file') {\n // Add single file\n const archivePath = `input/${inputItem.name}`;\n\n const addFileResult = await this._addFileTreeItemToZip(files, inputItem, archivePath);\n /* c8 ignore next 3 - defense in depth against internal error */\n if (addFileResult.isFailure()) {\n return fail(addFileResult.message);\n }\n\n manifest.input = {\n type: 'file',\n originalPath: inputItem.absolutePath,\n archivePath\n };\n }\n }\n\n const { value: configItem, message: configItemError } = this._getConfigFileTreeItem(options);\n if (configItemError !== undefined) {\n return fail(configItemError);\n }\n\n if (configItem !== undefined) {\n onProgress?.('reading-file', 40, `Processing config: ${configItem.absolutePath}`);\n\n const archivePath = `config/${configItem.name}`;\n\n const addConfigResult = await this._addFileTreeItemToZip(files, configItem, archivePath);\n /* c8 ignore next 3 - defense in depth against internal error */\n if (addConfigResult.isFailure()) {\n return fail(addConfigResult.message);\n }\n\n // Update manifest with config info\n manifest.config = {\n type: 'file',\n originalPath: configItem.absolutePath,\n archivePath\n };\n }\n\n // Add manifest to ZIP\n onProgress?.('creating-zip', 70, 'Adding manifest');\n const manifestJson = JSON.stringify(manifest, null, 2);\n files['manifest.json'] = new TextEncoder().encode(manifestJson);\n\n // Create ZIP buffer using fflate\n onProgress?.('creating-zip', 80, 'Compressing files');\n const zipBuffer = zipSync(files, { level: 6 });\n\n const result: IZipArchiveResult = {\n zipBuffer,\n manifest,\n size: zipBuffer.length\n };\n\n onProgress?.('creating-zip', 100, 'ZIP archive buffer created');\n\n return succeed(result);\n /* c8 ignore next 3 - defense in depth against internal error */\n } catch (error) {\n return fail(`Failed to create ZIP archive: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n /**\n * Add a single FileTree item to the ZIP archive\n * @param files - ZIP files collection\n * @param fileItem - FileTree file item to add\n * @param archivePath - Path within the archive\n * @returns Result indicating success or failure\n */\n private async _addFileTreeItemToZip(\n files: Record<string, Uint8Array>,\n fileItem: FileTree.IFileTreeFileItem,\n archivePath: string\n ): Promise<Result<void>> {\n return fileItem.getRawContents().onSuccess((content) => {\n const contentBuffer = new TextEncoder().encode(content);\n files[normalizePath(archivePath)] = contentBuffer;\n return succeed(undefined);\n });\n }\n\n /**\n * Add a directory recursively to the ZIP archive using FileTree\n * @param files - ZIP files collection\n * @param directoryItem - FileTree directory item to add\n * @param archivePrefix - Prefix path within the archive\n * @param onProgress - Optional progress callback\n * @returns Result indicating success or failure\n */\n private async _addDirectoryTreeToZip(\n files: Record<string, Uint8Array>,\n directoryItem: FileTree.IFileTreeDirectoryItem,\n archivePrefix: string,\n onProgress?: ZipArchiveProgressCallback\n ): Promise<Result<void>> {\n const childrenResult = directoryItem.getChildren();\n /* c8 ignore next 3 - defense in depth against internal error */\n if (childrenResult.isFailure()) {\n return fail(`Failed to read directory ${directoryItem.absolutePath}: ${childrenResult.message}`);\n }\n\n for (const child of childrenResult.value) {\n const itemArchivePath = normalizePath(`${archivePrefix}/${child.name}`);\n\n if (child.type === 'directory') {\n // Recursively add subdirectory\n const addDirResult = await this._addDirectoryTreeToZip(files, child, itemArchivePath, onProgress);\n /* c8 ignore next 3 - defense in depth against internal error */\n if (addDirResult.isFailure()) {\n return fail(addDirResult.message);\n }\n } else if (child.type === 'file') {\n // Add file\n const addFileResult = await this._addFileTreeItemToZip(files, child, itemArchivePath);\n /* c8 ignore next 3 - defense in depth against internal error */\n if (addFileResult.isFailure()) {\n return fail(addFileResult.message);\n }\n onProgress?.('reading-file', 0, `Added file: ${itemArchivePath}`);\n }\n }\n\n return succeed(undefined);\n }\n\n private _getInputFileTreeItem(options: ZipArchiveOptions): Result<FileTree.FileTreeItem | undefined> {\n if ('inputPath' in options && options.inputPath !== undefined) {\n return FileTree.forFilesystem()\n .withErrorFormat((msg) => `Failed to create file tree: ${msg}`)\n .onSuccess((fileTree) =>\n fileTree.getItem(options.inputPath!).withErrorFormat((msg) => `Failed to get item: ${msg}`)\n );\n } else if ('inputItem' in options) {\n return succeed(options.inputItem);\n }\n return succeed(undefined);\n }\n\n private _getConfigFileTreeItem(options: ZipArchiveOptions): Result<FileTree.IFileTreeFileItem | undefined> {\n if ('configPath' in options && options.configPath !== undefined) {\n return FileTree.forFilesystem()\n .withErrorFormat((msg) => `Failed to create file tree: ${msg}`)\n .onSuccess((fileTree) =>\n fileTree.getFile(options.configPath!).withErrorFormat((msg) => `Failed to get config file: ${msg}`)\n );\n } else if ('configItem' in options && options.configItem !== undefined) {\n return succeed(options.configItem);\n }\n return succeed(undefined);\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zipArchiveFormat.d.ts","sourceRoot":"","sources":["../../../src/packlets/zip-archive/zipArchiveFormat.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE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e,EAAE,GAAG,CAAC;SAC7B,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,IAAI,EAAE,CAAC;AACZ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,QAAgB;IACxC,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACjD,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, captureResult } from '@fgv/ts-utils';\nimport { Model as ConfigModel } from '../config';\nimport * as Json from './json';\nimport * as Convert from './convert';\n\n/**\n * Create a ZIP archive manifest object\n * @param inputType - Type of input (file or directory)\n * @param originalPath - Original file/directory path\n * @param archivePath - Path within the archive\n * @param configPath - Optional configuration file path\n * @returns ZIP archive manifest\n * @public\n */\nexport function createZipArchiveManifest(\n inputType: 'file' | 'directory',\n originalPath: string,\n archivePath: string,\n configPath?: string\n): Json.IZipArchiveManifest {\n const manifest: Json.IZipArchiveManifest = {\n timestamp: new Date().toISOString(),\n input: {\n type: inputType,\n originalPath,\n archivePath\n }\n };\n\n if (configPath) {\n manifest.config = {\n type: 'file',\n originalPath: configPath,\n archivePath: 'config.json'\n };\n }\n\n return manifest;\n}\n\n/**\n * Parse and validate a ZIP archive manifest\n * @param manifestData - JSON string containing manifest data\n * @returns Result containing validated manifest\n * @public\n */\nexport function parseZipArchiveManifest(manifestData: string): Result<Json.IZipArchiveManifest> {\n return captureResult(() => {\n const parsed = JSON.parse(manifestData);\n return parsed;\n })\n .onSuccess((parsed) => Convert.zipArchiveManifest.validate(parsed))\n .withErrorFormat((e) => `Failed to parse ZIP archive manifest: ${e}`);\n}\n\n/**\n * Validate a ZIP archive manifest object\n * @param manifest - Object to validate as manifest\n * @returns Result containing validated manifest\n * @public\n */\nexport function validateZipArchiveManifest(manifest: unknown): Result<Json.IZipArchiveManifest> {\n return Convert.zipArchiveManifest.validate(manifest);\n}\n\n/**\n * Parse and validate configuration JSON\n * @param configData - JSON string containing configuration\n * @returns Result containing validated configuration\n * @public\n */\nexport function parseZipArchiveConfiguration(configData: string): Result<ConfigModel.ISystemConfiguration> {\n return captureResult(() => {\n const parsed = JSON.parse(configData);\n return parsed;\n })\n .onSuccess((parsed) => Convert.systemConfiguration.validate(parsed))\n .withErrorFormat((e) => `Failed to parse ZIP archive configuration: ${e}`);\n}\n\n/**\n * Generate a timestamp-based filename for ZIP archives\n * @param customName - Optional custom name prefix\n * @returns Generated filename\n * @public\n */\nexport function generateZipArchiveFilename(customName?: string): string {\n const timestamp = new Date().toISOString().replace(/[:.]/g, '-').replace('T', '_').slice(0, -5);\n return customName ? `${customName}-${timestamp}.zip` : `ts-res-archive-${timestamp}.zip`;\n}\n\n/**\n * Normalize path separators for cross-platform compatibility\n * @param path - Path to normalize\n * @returns Normalized path\n * @public\n */\nexport function normalizePath(path: string): string {\n return path.replace(/\\\\/g, '/').replace(/\\/+/g, '/');\n}\n\n/**\n * Extract directory name from a file path\n * @param path - File path\n * @returns Directory name\n * @public\n */\nexport function getDirectoryName(path: string): string {\n const normalized = normalizePath(path);\n const parts = normalized.split('/');\n return parts[parts.length - 1] || 'archive';\n}\n\n/**\n * Create a safe filename by removing invalid characters\n * @param filename - Original filename\n * @returns Sanitized filename\n * @public\n */\nexport function sanitizeFilename(filename: string): string {\n return filename\n .replace(/[<>:\"/\\\\|?*]/g, '_')\n .replace(/\\s+/g, '_')\n .replace(/_+/g, '_')\n .trim();\n}\n\n/**\n * Validate ZIP file extension\n * @param filename - Filename to validate\n * @returns True if filename has .zip extension\n * @public\n */\nexport function isZipFile(filename: string): boolean {\n return filename.toLowerCase().endsWith('.zip');\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zipArchiveLoader.d.ts","sourceRoot":"","sources":["../../../src/packlets/zip-archive/zipArchiveLoader.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AAItD,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAG3B,MAAM,SAAS,CAAC;AAKjB;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B;;;;;;OAMG;IACU,YAAY,CACvB,IAAI,EAAE,IAAI,EACV,OAAO,GAAE,sBAA2B,EACpC,UAAU,CAAC,EAAE,0BAA0B,GACtC,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAkBzC;;;;;;OAMG;IACU,cAAc,CACzB,MAAM,EAAE,WAAW,EACnB,OAAO,GAAE,sBAA2B,EACpC,UAAU,CAAC,EAAE,0BAA0B,GACtC,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAkDzC;;;;OAIG;IACH,OAAO,CAAC,0BAA0B;IAiBlC;;;;;;OAMG;IACH,OAAO,CAAC,+BAA+B;IAwBvC;;;;;OAKG;YACW,0BAA0B;IAmCxC;;;;;;;;;OASG;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kB,CAAC;YAC5B,KAAK,MAAM,CAAC;YACZ,KAAK,KAAK;gBACR,OAAO,kBAAkB,CAAC;YAC5B,KAAK,KAAK;gBACR,OAAO,iBAAiB,CAAC;YAC3B,KAAK,KAAK;gBACR,OAAO,YAAY,CAAC;YACtB,KAAK,IAAI;gBACP,OAAO,eAAe,CAAC;YACzB,KAAK,IAAI;gBACP,OAAO,wBAAwB,CAAC;YAClC,KAAK,IAAI;gBACP,OAAO,wBAAwB,CAAC;YAClC;gBACE,OAAO,0BAA0B,CAAC;QACtC,CAAC;IACH,CAAC;CACF;AA1UD,4CA0UC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result, succeed, fail } from '@fgv/ts-utils';\nimport { FileTree } from '@fgv/ts-json-base';\n// ZipFileTree is browser-safe - doesn't depend on Node.js crypto/fs modules\nimport { ZipFileTree } from '@fgv/ts-extras';\nimport type {\n IZipArchiveLoadOptions,\n IZipArchiveLoadResult,\n ZipArchiveProgressCallback,\n IImportedFile,\n IImportedDirectory\n} from './types';\nimport { Model as ConfigModel } from '../config';\nimport * as Json from './json';\nimport { parseZipArchiveManifest, parseZipArchiveConfiguration, isZipFile } from './zipArchiveFormat';\n\n/**\n * ZIP archive loader extending ts-extras foundation\n * @public\n */\nexport class ZipArchiveLoader {\n /**\n * Load ZIP archive from File object (Browser)\n * @param file - File object from file input\n * @param options - Loading options\n * @param onProgress - Optional progress callback\n * @returns Result containing loaded archive data\n */\n public async loadFromFile(\n file: File,\n options: IZipArchiveLoadOptions = {},\n onProgress?: ZipArchiveProgressCallback\n ): Promise<Result<IZipArchiveLoadResult>> {\n onProgress?.('reading-file', 0, `Reading file: ${file.name}`);\n\n if (!isZipFile(file.name)) {\n return fail(`File ${file.name} is not a ZIP file`);\n }\n\n try {\n const buffer = await file.arrayBuffer();\n onProgress?.('reading-file', 100, 'File read complete');\n\n return await this.loadFromBuffer(buffer, options, onProgress);\n /* c8 ignore next 3 - defense in depth against internal error */\n } catch (error) {\n return fail(`Failed to read file: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n /**\n * Load ZIP archive from ArrayBuffer (Universal)\n * @param buffer - ZIP data buffer\n * @param options - Loading options\n * @param onProgress - Optional progress callback\n * @returns Result containing loaded archive data\n */\n public async loadFromBuffer(\n buffer: ArrayBuffer,\n options: IZipArchiveLoadOptions = {},\n onProgress?: ZipArchiveProgressCallback\n ): Promise<Result<IZipArchiveLoadResult>> {\n onProgress?.('parsing-zip', 0, 'Parsing ZIP archive');\n\n const zipAccessorsResult = ZipFileTree.ZipFileTreeAccessors.fromBuffer(buffer);\n if (zipAccessorsResult.isFailure()) {\n return fail(`Failed to parse ZIP: ${zipAccessorsResult.message}`);\n }\n\n const zipAccessors = zipAccessorsResult.value;\n onProgress?.('parsing-zip', 100, 'ZIP archive parsed');\n\n // Load manifest\n onProgress?.('loading-manifest', 0, 'Loading manifest');\n const manifestResult = this._loadManifestFromAccessors(zipAccessors);\n if (manifestResult.isFailure()) {\n return fail(manifestResult.message);\n }\n const manifest = manifestResult.value;\n onProgress?.('loading-manifest', 100, 'Manifest loaded');\n\n // Load configuration\n onProgress?.('loading-config', 0, 'Loading configuration');\n const configResult = this._loadConfigurationFromAccessors(zipAccessors, manifest, options);\n if (configResult.isFailure()) {\n return fail(configResult.message);\n }\n const config = configResult.value;\n onProgress?.('loading-config', 100, 'Configuration loaded');\n\n // Extract files and directory structure\n onProgress?.('extracting-files', 0, 'Extracting files');\n const filesResult = await this._extractFilesFromAccessors(zipAccessors, onProgress);\n /* c8 ignore next 3 - defense in depth against internal error */\n if (filesResult.isFailure()) {\n return fail(filesResult.message);\n }\n\n const { files, directory } = filesResult.value;\n onProgress?.('extracting-files', 100, `Extracted ${files.length} files`);\n\n onProgress?.('extracting-files', 100, 'ZIP loading complete');\n\n return succeed({\n manifest,\n config,\n files,\n directory\n });\n }\n\n /**\n * Load manifest from ZIP using ZipFileTreeAccessors\n * @param zipAccessors - ZIP file tree accessors\n * @returns Result containing parsed manifest\n */\n private _loadManifestFromAccessors(\n zipAccessors: ZipFileTree.ZipFileTreeAccessors\n ): Result<Json.IZipArchiveManifest | undefined> {\n const manifestResult = zipAccessors.getFileContents('manifest.json');\n if (manifestResult.isFailure()) {\n // Manifest is optional - return success with undefined\n return succeed(undefined);\n }\n\n const parseResult = parseZipArchiveManifest(manifestResult.value);\n if (parseResult.isFailure()) {\n return fail(`Failed to parse manifest.json: ${parseResult.message}`);\n }\n\n return succeed(parseResult.value);\n }\n\n /**\n * Load configuration from ZIP using ZipFileTreeAccessors\n * @param zipAccessors - ZIP file tree accessors\n * @param manifest - Parsed manifest (may be undefined)\n * @param options - Loading options\n * @returns Result containing parsed configuration\n */\n private _loadConfigurationFromAccessors(\n zipAccessors: ZipFileTree.ZipFileTreeAccessors,\n manifest: Json.IZipArchiveManifest | undefined,\n options: IZipArchiveLoadOptions\n ): Result<ConfigModel.ISystemConfiguration | undefined> {\n // Check if manifest specifies a config file\n const manifestSpecifiesConfig = manifest?.config !== undefined;\n\n if (!manifestSpecifiesConfig) {\n // If no config specified in manifest, config is optional\n return succeed(undefined);\n }\n\n // Get the config path from the manifest\n const configPath = manifest!.config!.archivePath;\n return zipAccessors\n .getFileContents(configPath)\n .withErrorFormat(\n () => `Manifest specifies config file at '${configPath}' but it was not found in archive`\n )\n .onSuccess((configContent) => parseZipArchiveConfiguration(configContent))\n .withErrorFormat((e) => `Failed to parse config file '${configPath}': ${e}`);\n }\n\n /**\n * Extract files and directory structure from ZIP\n * @param zipAccessors - ZIP file tree accessors\n * @param onProgress - Optional progress callback\n * @returns Result containing files and directory structure\n */\n private async _extractFilesFromAccessors(\n zipAccessors: ZipFileTree.ZipFileTreeAccessors,\n onProgress?: ZipArchiveProgressCallback\n ): Promise<Result<{ files: IImportedFile[]; directory: IImportedDirectory | undefined }>> {\n try {\n const files: IImportedFile[] = [];\n const directories = new Map<string, IImportedDirectory>();\n\n // Get all children from root\n const rootChildrenResult = zipAccessors.getChildren('/');\n /* c8 ignore next 3 - defense in depth against internal error */\n if (rootChildrenResult.isFailure()) {\n return fail(`Failed to read ZIP contents: ${rootChildrenResult.message}`);\n }\n\n // Process all items recursively\n await this._processFileTreeItems(\n zipAccessors,\n '/',\n rootChildrenResult.value,\n files,\n directories,\n onProgress\n );\n\n // Build directory structure\n const directory = this._buildDirectoryStructure(files, directories);\n\n return succeed({ files, directory });\n /* c8 ignore next 3 - defense in depth against internal error */\n } catch (error) {\n return fail(`Failed to extract files: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n /**\n * Recursively process file tree items\n * @param zipAccessors - ZIP file tree accessors\n * @param currentPath - Current directory path\n * @param items - Items to process\n * @param files - Files collection\n * @param directories - Directories collection\n * @param onProgress - Optional progress callback\n * @param processed - Processing counter\n */\n private async _processFileTreeItems(\n zipAccessors: ZipFileTree.ZipFileTreeAccessors,\n currentPath: string,\n items: readonly FileTree.FileTreeItem[],\n files: IImportedFile[],\n directories: Map<string, IImportedDirectory>,\n onProgress?: ZipArchiveProgressCallback,\n processed: { count: number } = { count: 0 }\n ): Promise<void> {\n for (const item of items) {\n /* c8 ignore next 1 - defense in depth */\n const itemPath = item.absolutePath.startsWith('/') ? item.absolutePath.substring(1) : item.absolutePath;\n\n if (item.type === 'directory') {\n // Track directory\n if (!directories.has(itemPath)) {\n directories.set(itemPath, {\n name: item.name,\n files: [],\n subdirectories: []\n });\n }\n\n // Recursively process children\n const childrenResult = zipAccessors.getChildren(item.absolutePath);\n if (childrenResult.isSuccess()) {\n await this._processFileTreeItems(\n zipAccessors,\n item.absolutePath,\n childrenResult.value,\n files,\n directories,\n onProgress,\n processed\n );\n }\n } else if (item.type === 'file') {\n // Get file content\n const contentResult = item.getRawContents();\n const content = contentResult.orDefault('');\n\n files.push({\n name: item.name,\n path: itemPath,\n content,\n type: this._getFileType(item.name)\n });\n }\n\n processed.count++;\n onProgress?.('extracting-files', 0, `Processing ${itemPath}`);\n }\n }\n\n /**\n * Build directory structure from files\n * @param files - Extracted files\n * @param directories - Directories map\n * @returns Root directory structure or null\n */\n private _buildDirectoryStructure(\n files: IImportedFile[],\n directories: Map<string, IImportedDirectory>\n ): IImportedDirectory | undefined {\n /* c8 ignore next 3 - should never happen with fflate */\n if (files.length === 0) {\n return undefined;\n }\n\n const rootDir: IImportedDirectory = {\n name: 'root',\n files: [],\n subdirectories: []\n };\n\n // Process files to build directory structure\n for (const file of files) {\n const pathParts = file.path.split('/').filter((part: string) => part.length > 0);\n\n /* c8 ignore next 1 - defense in depth should never happen */\n if (pathParts.length === 0) continue;\n\n // Ensure all parent directories exist\n let currentDir = rootDir;\n for (let i = 0; i < pathParts.length - 1; i++) {\n const dirName = pathParts[i];\n let foundDir = currentDir.subdirectories.find((d) => d.name === dirName);\n\n if (!foundDir) {\n foundDir = {\n name: dirName,\n files: [],\n subdirectories: []\n };\n currentDir.subdirectories.push(foundDir);\n }\n\n currentDir = foundDir;\n }\n\n // Add file to its parent directory\n currentDir.files.push(file);\n }\n\n return rootDir;\n }\n\n /**\n * Get file MIME type based on extension\n * @param filename - Filename\n * @returns MIME type\n */\n private _getFileType(filename: string): string {\n const ext = filename.toLowerCase().split('.').pop();\n /* c8 ignore next 20 - no need to test every one */\n switch (ext) {\n case 'json':\n return 'application/json';\n case 'yaml':\n case 'yml':\n return 'application/yaml';\n case 'xml':\n return 'application/xml';\n case 'txt':\n return 'text/plain';\n case 'md':\n return 'text/markdown';\n case 'js':\n return 'application/javascript';\n case 'ts':\n return 'application/typescript';\n default:\n return 'application/octet-stream';\n }\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fgv/ts-res",
3
- "version": "5.1.0-19",
3
+ "version": "5.1.0-20",
4
4
  "description": "Multi-dimensional Resource Runtime",
5
5
  "main": "lib/index.js",
6
6
  "types": "dist/ts-res.d.ts",
@@ -45,18 +45,18 @@
45
45
  "@types/heft-jest": "1.0.6",
46
46
  "eslint-plugin-tsdoc": "~0.5.2",
47
47
  "typedoc": "~0.28.16",
48
- "@fgv/heft-dual-rig": "5.1.0-19",
49
- "@fgv/typedoc-compact-theme": "5.1.0-19",
50
- "@fgv/ts-extras": "5.1.0-19",
51
- "@fgv/ts-utils-jest": "5.1.0-19"
48
+ "@fgv/heft-dual-rig": "5.1.0-20",
49
+ "@fgv/typedoc-compact-theme": "5.1.0-20",
50
+ "@fgv/ts-utils-jest": "5.1.0-20",
51
+ "@fgv/ts-extras": "5.1.0-20"
52
52
  },
53
53
  "dependencies": {
54
54
  "luxon": "^3.7.2",
55
55
  "fflate": "~0.8.2",
56
- "@fgv/ts-utils": "5.1.0-19",
57
- "@fgv/ts-json-base": "5.1.0-19",
58
- "@fgv/ts-bcp47": "5.1.0-19",
59
- "@fgv/ts-json": "5.1.0-19"
56
+ "@fgv/ts-utils": "5.1.0-20",
57
+ "@fgv/ts-json-base": "5.1.0-20",
58
+ "@fgv/ts-json": "5.1.0-20",
59
+ "@fgv/ts-bcp47": "5.1.0-20"
60
60
  },
61
61
  "exports": {
62
62
  ".": {
@@ -1,32 +0,0 @@
1
- [
2
- {
3
- "id": "some.resource.path",
4
- "json": { "home": "United States" },
5
- "conditions": {
6
- "homeTerritory": "US"
7
- }
8
- },
9
- {
10
- "id": "some.resource.path",
11
- "json": { "speaks": "English" },
12
- "conditions": {
13
- "language": "en"
14
- }
15
- },
16
- {
17
- "id": "some.resource.path",
18
- "json": { "home": "Canada", "speaks": "Canadian English" },
19
- "conditions": {
20
- "homeTerritory": "CA",
21
- "language": "en-CA"
22
- },
23
- "mergeMethod": "replace"
24
- },
25
- {
26
- "id": "some.resource.path",
27
- "json": { "speaks": "Español" },
28
- "conditions": {
29
- "language": "es"
30
- }
31
- }
32
- ]
@@ -1,76 +0,0 @@
1
- /*
2
- * Copyright (c) 2025 Erik Fortune
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in all
12
- * copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
21
- */
22
- import { captureResult, fail, succeed } from '@fgv/ts-utils';
23
- import * as TsRes from '../../../index';
24
- export class TestQualifierType extends TsRes.QualifierTypes.QualifierType {
25
- constructor(params) {
26
- var _a;
27
- super({
28
- name: (_a = params === null || params === void 0 ? void 0 : params.name) !== null && _a !== void 0 ? _a : 'test',
29
- allowContextList: (params === null || params === void 0 ? void 0 : params.allowContextList) === 'true',
30
- index: params === null || params === void 0 ? void 0 : params.index
31
- });
32
- this.systemTypeName = TsRes.Convert.qualifierTypeName
33
- .convert('test')
34
- .orThrow();
35
- }
36
- static create(params) {
37
- return captureResult(() => new TestQualifierType(params));
38
- }
39
- isValidConditionValue(value) {
40
- return true;
41
- }
42
- validateCondition(value, operator) {
43
- return this.isValidConditionValue(value) ? succeed(value) : fail(`Invalid condition value: ${value}`);
44
- }
45
- getConfigurationJson() {
46
- return succeed({
47
- name: this.name,
48
- systemType: 'test',
49
- configuration: {}
50
- });
51
- }
52
- validateConfigurationJson(from) {
53
- // Simple validation for test class
54
- if (typeof from !== 'object' || from === null) {
55
- return fail('Expected object');
56
- }
57
- const obj = from;
58
- if (typeof obj.name !== 'string') {
59
- return fail('name must be string');
60
- }
61
- if (obj.systemType !== 'test') {
62
- return fail('systemType must be test');
63
- }
64
- return succeed(from);
65
- }
66
- _matchOne(condition, context, operator) {
67
- if (condition === context) {
68
- return TsRes.PerfectMatch;
69
- }
70
- if (condition.toLowerCase() === context.toLowerCase()) {
71
- return 0.5;
72
- }
73
- return TsRes.NoMatch;
74
- }
75
- }
76
- //# sourceMappingURL=testQualifierType.js.map