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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (545) hide show
  1. package/dist/index.browser.js.map +1 -0
  2. package/dist/index.js.map +1 -0
  3. package/dist/packlets/bundle/bundleBuilder.js.map +1 -0
  4. package/dist/packlets/bundle/bundleLoader.js.map +1 -0
  5. package/dist/packlets/bundle/bundleNormalizer.js.map +1 -0
  6. package/dist/packlets/bundle/bundleUtils.js.map +1 -0
  7. package/dist/packlets/bundle/convert.js.map +1 -0
  8. package/dist/packlets/bundle/index.js.map +1 -0
  9. package/dist/packlets/bundle/model.js.map +1 -0
  10. package/dist/packlets/common/conditions.js.map +1 -0
  11. package/dist/packlets/common/convert.js.map +1 -0
  12. package/dist/packlets/common/helpers/conditions.js.map +1 -0
  13. package/dist/packlets/common/helpers/context.js.map +1 -0
  14. package/dist/packlets/common/helpers/index.js.map +1 -0
  15. package/dist/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  16. package/dist/packlets/common/helpers/resources.js +2 -4
  17. package/dist/packlets/common/helpers/resources.js.map +1 -0
  18. package/dist/packlets/common/index.js.map +1 -0
  19. package/dist/packlets/common/resources.js.map +1 -0
  20. package/dist/packlets/common/validate/conditions.js +4 -4
  21. package/dist/packlets/common/validate/conditions.js.map +1 -0
  22. package/dist/packlets/common/validate/index.js.map +1 -0
  23. package/dist/packlets/common/validate/regularExpressions.js +2 -2
  24. package/dist/packlets/common/validate/regularExpressions.js.map +1 -0
  25. package/dist/packlets/common/validate/resources.js +1 -1
  26. package/dist/packlets/common/validate/resources.js.map +1 -0
  27. package/dist/packlets/conditions/condition.js +3 -7
  28. package/dist/packlets/conditions/condition.js.map +1 -0
  29. package/dist/packlets/conditions/conditionCollector.js.map +1 -0
  30. package/dist/packlets/conditions/conditionDecls.js.map +1 -0
  31. package/dist/packlets/conditions/conditionSet.js +14 -5
  32. package/dist/packlets/conditions/conditionSet.js.map +1 -0
  33. package/dist/packlets/conditions/conditionSetCollector.js.map +1 -0
  34. package/dist/packlets/conditions/conditionSetDecls.js.map +1 -0
  35. package/dist/packlets/conditions/conditionToken.js.map +1 -0
  36. package/dist/packlets/conditions/convert/conditionSetDecls.js +50 -6
  37. package/dist/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  38. package/dist/packlets/conditions/convert/decls.js +61 -5
  39. package/dist/packlets/conditions/convert/decls.js.map +1 -0
  40. package/dist/packlets/conditions/convert/index.js.map +1 -0
  41. package/dist/packlets/conditions/index.js.map +1 -0
  42. package/dist/packlets/config/common.js.map +1 -0
  43. package/dist/packlets/config/configInitFactory.js.map +1 -0
  44. package/dist/packlets/config/convert.js.map +1 -0
  45. package/dist/packlets/config/index.browser.js.map +1 -0
  46. package/dist/packlets/config/index.js.map +1 -0
  47. package/dist/packlets/config/json.js.map +1 -0
  48. package/dist/packlets/config/predefined/default.js.map +1 -0
  49. package/dist/packlets/config/predefined/extended.js.map +1 -0
  50. package/dist/packlets/config/predefined/index.js.map +1 -0
  51. package/dist/packlets/config/systemConfiguration.js.map +1 -0
  52. package/dist/packlets/context/contextDecls.js.map +1 -0
  53. package/dist/packlets/context/contextToken.js.map +1 -0
  54. package/dist/packlets/context/convert/decls.js.map +1 -0
  55. package/dist/packlets/context/convert/index.js.map +1 -0
  56. package/dist/packlets/context/index.js.map +1 -0
  57. package/dist/packlets/decisions/abstractDecision.js.map +1 -0
  58. package/dist/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  59. package/dist/packlets/decisions/candidate.js.map +1 -0
  60. package/dist/packlets/decisions/common.js.map +1 -0
  61. package/dist/packlets/decisions/concreteDecision.js.map +1 -0
  62. package/dist/packlets/decisions/decision.js +1 -1
  63. package/dist/packlets/decisions/decision.js.map +1 -0
  64. package/dist/packlets/decisions/index.js.map +1 -0
  65. package/dist/packlets/import/fsItem.js +1 -4
  66. package/dist/packlets/import/fsItem.js.map +1 -0
  67. package/dist/packlets/import/importContext.js +3 -3
  68. package/dist/packlets/import/importContext.js.map +1 -0
  69. package/dist/packlets/import/importManager.js +7 -3
  70. package/dist/packlets/import/importManager.js.map +1 -0
  71. package/dist/packlets/import/importable.js.map +1 -0
  72. package/dist/packlets/import/importers/collectionImporter.js +2 -2
  73. package/dist/packlets/import/importers/collectionImporter.js.map +1 -0
  74. package/dist/packlets/import/importers/fsItemImporter.js +30 -14
  75. package/dist/packlets/import/importers/fsItemImporter.js.map +1 -0
  76. package/dist/packlets/import/importers/importer.js.map +1 -0
  77. package/dist/packlets/import/importers/index.browser.js.map +1 -0
  78. package/dist/packlets/import/importers/index.js.map +1 -0
  79. package/dist/packlets/import/importers/jsonImporter.js +2 -2
  80. package/dist/packlets/import/importers/jsonImporter.js.map +1 -0
  81. package/dist/packlets/import/importers/pathImporter.js +1 -1
  82. package/dist/packlets/import/importers/pathImporter.js.map +1 -0
  83. package/dist/packlets/import/index.browser.js.map +1 -0
  84. package/dist/packlets/import/index.js.map +1 -0
  85. package/dist/packlets/qualifier-types/config/convert.js.map +1 -0
  86. package/dist/packlets/qualifier-types/config/index.js.map +1 -0
  87. package/dist/packlets/qualifier-types/config/json.js.map +1 -0
  88. package/dist/packlets/qualifier-types/convert.js.map +1 -0
  89. package/dist/packlets/qualifier-types/helpers.js.map +1 -0
  90. package/dist/packlets/qualifier-types/index.js.map +1 -0
  91. package/dist/packlets/qualifier-types/languageQualifierType.js +6 -7
  92. package/dist/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  93. package/dist/packlets/qualifier-types/literalQualifierType.js +7 -10
  94. package/dist/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  95. package/dist/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  96. package/dist/packlets/qualifier-types/qualifierType.js +12 -13
  97. package/dist/packlets/qualifier-types/qualifierType.js.map +1 -0
  98. package/dist/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  99. package/dist/packlets/qualifier-types/territoryQualifierType.js +5 -5
  100. package/dist/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  101. package/dist/packlets/qualifiers/convert/decls.js.map +1 -0
  102. package/dist/packlets/qualifiers/convert/index.js.map +1 -0
  103. package/dist/packlets/qualifiers/convert/qualifier.js.map +1 -0
  104. package/dist/packlets/qualifiers/index.js.map +1 -0
  105. package/dist/packlets/qualifiers/qualifier.js +6 -7
  106. package/dist/packlets/qualifiers/qualifier.js.map +1 -0
  107. package/dist/packlets/qualifiers/qualifierCollector.js +153 -9
  108. package/dist/packlets/qualifiers/qualifierCollector.js.map +1 -0
  109. package/dist/packlets/qualifiers/qualifierDecl.js.map +1 -0
  110. package/dist/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  111. package/dist/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  112. package/dist/packlets/resource-json/compiled/common.js.map +1 -0
  113. package/dist/packlets/resource-json/compiled/convert.js.map +1 -0
  114. package/dist/packlets/resource-json/compiled/index.js.map +1 -0
  115. package/dist/packlets/resource-json/compiled/json.js.map +1 -0
  116. package/dist/packlets/resource-json/convert.js +225 -0
  117. package/dist/packlets/resource-json/convert.js.map +1 -0
  118. package/dist/packlets/resource-json/helpers.js.map +1 -0
  119. package/dist/packlets/resource-json/index.js.map +1 -0
  120. package/dist/packlets/resource-json/json.js +2 -2
  121. package/dist/packlets/resource-json/json.js.map +1 -0
  122. package/dist/packlets/resource-json/normalized.js.map +1 -0
  123. package/dist/packlets/resource-json/resourceDeclCollection.js +1 -1
  124. package/dist/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  125. package/dist/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  126. package/dist/packlets/resource-json/resourceDeclTree.js +1 -1
  127. package/dist/packlets/resource-json/resourceDeclTree.js.map +1 -0
  128. package/dist/packlets/resource-types/config/convert.js.map +1 -0
  129. package/dist/packlets/resource-types/config/index.js.map +1 -0
  130. package/dist/packlets/resource-types/config/json.js.map +1 -0
  131. package/dist/packlets/resource-types/helpers.js.map +1 -0
  132. package/dist/packlets/resource-types/index.js.map +1 -0
  133. package/dist/packlets/resource-types/jsonResourceType.js +2 -2
  134. package/dist/packlets/resource-types/jsonResourceType.js.map +1 -0
  135. package/dist/packlets/resource-types/resourceType.js +2 -2
  136. package/dist/packlets/resource-types/resourceType.js.map +1 -0
  137. package/dist/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  138. package/dist/packlets/resources/candidateReducer.js.map +1 -0
  139. package/dist/packlets/resources/candidateValue.js.map +1 -0
  140. package/dist/packlets/resources/candidateValueCollector.js.map +1 -0
  141. package/dist/packlets/resources/common.js.map +1 -0
  142. package/dist/packlets/resources/deltaGenerator.js.map +1 -0
  143. package/dist/packlets/resources/index.js.map +1 -0
  144. package/dist/packlets/resources/resource.js.map +1 -0
  145. package/dist/packlets/resources/resourceBuilder.js +2 -2
  146. package/dist/packlets/resources/resourceBuilder.js.map +1 -0
  147. package/dist/packlets/resources/resourceCandidate.js.map +1 -0
  148. package/dist/packlets/resources/resourceManagerBuilder.js +5 -5
  149. package/dist/packlets/resources/resourceManagerBuilder.js.map +1 -0
  150. package/dist/packlets/runtime/cacheListener.js.map +1 -0
  151. package/dist/packlets/runtime/cacheMetrics.js.map +1 -0
  152. package/dist/packlets/runtime/compiledResourceCollection.js +5 -5
  153. package/dist/packlets/runtime/compiledResourceCollection.js.map +1 -0
  154. package/dist/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  155. package/dist/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  156. package/dist/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  157. package/dist/packlets/runtime/context/index.js.map +1 -0
  158. package/dist/packlets/runtime/context/simpleContextQualifierProvider.js +3 -0
  159. package/dist/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  160. package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +3 -5
  161. package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  162. package/dist/packlets/runtime/iResourceManager.js.map +1 -0
  163. package/dist/packlets/runtime/index.js.map +1 -0
  164. package/dist/packlets/runtime/resource-tree/common.js.map +1 -0
  165. package/dist/packlets/runtime/resource-tree/index.js.map +1 -0
  166. package/dist/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  167. package/dist/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  168. package/dist/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  169. package/dist/packlets/runtime/resourceResolver.js.map +1 -0
  170. package/dist/packlets/runtime/resourceTreeResolver.js.map +1 -0
  171. package/dist/packlets/runtime/validate.js.map +1 -0
  172. package/dist/packlets/zip-archive/convert.js.map +1 -0
  173. package/dist/packlets/zip-archive/index.browser.js.map +1 -0
  174. package/dist/packlets/zip-archive/index.js.map +1 -0
  175. package/dist/packlets/zip-archive/json.js.map +1 -0
  176. package/dist/packlets/zip-archive/types.js.map +1 -0
  177. package/dist/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  178. package/dist/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  179. package/dist/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  180. package/dist/ts-res.d.ts +576 -164
  181. package/dist/tsdoc-metadata.json +1 -1
  182. package/lib/index.browser.d.ts.map +1 -0
  183. package/lib/index.browser.js.map +1 -0
  184. package/lib/index.d.ts.map +1 -0
  185. package/lib/index.js.map +1 -0
  186. package/lib/packlets/bundle/bundleBuilder.d.ts.map +1 -0
  187. package/lib/packlets/bundle/bundleBuilder.js.map +1 -0
  188. package/lib/packlets/bundle/bundleLoader.d.ts.map +1 -0
  189. package/lib/packlets/bundle/bundleLoader.js.map +1 -0
  190. package/lib/packlets/bundle/bundleNormalizer.d.ts.map +1 -0
  191. package/lib/packlets/bundle/bundleNormalizer.js.map +1 -0
  192. package/lib/packlets/bundle/bundleUtils.d.ts.map +1 -0
  193. package/lib/packlets/bundle/bundleUtils.js.map +1 -0
  194. package/lib/packlets/bundle/convert.d.ts.map +1 -0
  195. package/lib/packlets/bundle/convert.js.map +1 -0
  196. package/lib/packlets/bundle/index.d.ts.map +1 -0
  197. package/lib/packlets/bundle/index.js.map +1 -0
  198. package/lib/packlets/bundle/model.d.ts.map +1 -0
  199. package/lib/packlets/bundle/model.js.map +1 -0
  200. package/lib/packlets/common/conditions.d.ts.map +1 -0
  201. package/lib/packlets/common/conditions.js.map +1 -0
  202. package/lib/packlets/common/convert.d.ts.map +1 -0
  203. package/lib/packlets/common/convert.js.map +1 -0
  204. package/lib/packlets/common/helpers/conditions.d.ts.map +1 -0
  205. package/lib/packlets/common/helpers/conditions.js.map +1 -0
  206. package/lib/packlets/common/helpers/context.d.ts.map +1 -0
  207. package/lib/packlets/common/helpers/context.js.map +1 -0
  208. package/lib/packlets/common/helpers/index.d.ts.map +1 -0
  209. package/lib/packlets/common/helpers/index.js.map +1 -0
  210. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +1 -0
  211. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  212. package/lib/packlets/common/helpers/resources.d.ts +2 -4
  213. package/lib/packlets/common/helpers/resources.d.ts.map +1 -0
  214. package/lib/packlets/common/helpers/resources.js +2 -4
  215. package/lib/packlets/common/helpers/resources.js.map +1 -0
  216. package/lib/packlets/common/index.d.ts.map +1 -0
  217. package/lib/packlets/common/index.js.map +1 -0
  218. package/lib/packlets/common/resources.d.ts.map +1 -0
  219. package/lib/packlets/common/resources.js.map +1 -0
  220. package/lib/packlets/common/validate/conditions.d.ts +4 -4
  221. package/lib/packlets/common/validate/conditions.d.ts.map +1 -0
  222. package/lib/packlets/common/validate/conditions.js +4 -4
  223. package/lib/packlets/common/validate/conditions.js.map +1 -0
  224. package/lib/packlets/common/validate/index.d.ts.map +1 -0
  225. package/lib/packlets/common/validate/index.js.map +1 -0
  226. package/lib/packlets/common/validate/regularExpressions.d.ts +2 -2
  227. package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -0
  228. package/lib/packlets/common/validate/regularExpressions.js +2 -2
  229. package/lib/packlets/common/validate/regularExpressions.js.map +1 -0
  230. package/lib/packlets/common/validate/resources.d.ts +1 -1
  231. package/lib/packlets/common/validate/resources.d.ts.map +1 -0
  232. package/lib/packlets/common/validate/resources.js +1 -1
  233. package/lib/packlets/common/validate/resources.js.map +1 -0
  234. package/lib/packlets/conditions/condition.d.ts +3 -7
  235. package/lib/packlets/conditions/condition.d.ts.map +1 -0
  236. package/lib/packlets/conditions/condition.js +3 -7
  237. package/lib/packlets/conditions/condition.js.map +1 -0
  238. package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -0
  239. package/lib/packlets/conditions/conditionCollector.js.map +1 -0
  240. package/lib/packlets/conditions/conditionDecls.d.ts +6 -1
  241. package/lib/packlets/conditions/conditionDecls.d.ts.map +1 -0
  242. package/lib/packlets/conditions/conditionDecls.js.map +1 -0
  243. package/lib/packlets/conditions/conditionSet.d.ts.map +1 -0
  244. package/lib/packlets/conditions/conditionSet.js +14 -5
  245. package/lib/packlets/conditions/conditionSet.js.map +1 -0
  246. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -0
  247. package/lib/packlets/conditions/conditionSetCollector.js.map +1 -0
  248. package/lib/packlets/conditions/conditionSetDecls.d.ts +7 -2
  249. package/lib/packlets/conditions/conditionSetDecls.d.ts.map +1 -0
  250. package/lib/packlets/conditions/conditionSetDecls.js.map +1 -0
  251. package/lib/packlets/conditions/conditionToken.d.ts.map +1 -0
  252. package/lib/packlets/conditions/conditionToken.js.map +1 -0
  253. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts +30 -2
  254. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +1 -0
  255. package/lib/packlets/conditions/convert/conditionSetDecls.js +51 -5
  256. package/lib/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  257. package/lib/packlets/conditions/convert/decls.d.ts +39 -3
  258. package/lib/packlets/conditions/convert/decls.d.ts.map +1 -0
  259. package/lib/packlets/conditions/convert/decls.js +63 -5
  260. package/lib/packlets/conditions/convert/decls.js.map +1 -0
  261. package/lib/packlets/conditions/convert/index.d.ts.map +1 -0
  262. package/lib/packlets/conditions/convert/index.js.map +1 -0
  263. package/lib/packlets/conditions/index.d.ts.map +1 -0
  264. package/lib/packlets/conditions/index.js.map +1 -0
  265. package/lib/packlets/config/common.d.ts.map +1 -0
  266. package/lib/packlets/config/common.js.map +1 -0
  267. package/lib/packlets/config/configInitFactory.d.ts.map +1 -0
  268. package/lib/packlets/config/configInitFactory.js.map +1 -0
  269. package/lib/packlets/config/convert.d.ts.map +1 -0
  270. package/lib/packlets/config/convert.js.map +1 -0
  271. package/lib/packlets/config/index.browser.d.ts.map +1 -0
  272. package/lib/packlets/config/index.browser.js.map +1 -0
  273. package/lib/packlets/config/index.d.ts.map +1 -0
  274. package/lib/packlets/config/index.js.map +1 -0
  275. package/lib/packlets/config/json.d.ts.map +1 -0
  276. package/lib/packlets/config/json.js.map +1 -0
  277. package/lib/packlets/config/predefined/default.d.ts.map +1 -0
  278. package/lib/packlets/config/predefined/default.js.map +1 -0
  279. package/lib/packlets/config/predefined/extended.d.ts.map +1 -0
  280. package/lib/packlets/config/predefined/extended.js.map +1 -0
  281. package/lib/packlets/config/predefined/index.d.ts.map +1 -0
  282. package/lib/packlets/config/predefined/index.js.map +1 -0
  283. package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
  284. package/lib/packlets/config/systemConfiguration.js.map +1 -0
  285. package/lib/packlets/context/contextDecls.d.ts.map +1 -0
  286. package/lib/packlets/context/contextDecls.js.map +1 -0
  287. package/lib/packlets/context/contextToken.d.ts.map +1 -0
  288. package/lib/packlets/context/contextToken.js.map +1 -0
  289. package/lib/packlets/context/convert/decls.d.ts.map +1 -0
  290. package/lib/packlets/context/convert/decls.js.map +1 -0
  291. package/lib/packlets/context/convert/index.d.ts.map +1 -0
  292. package/lib/packlets/context/convert/index.js.map +1 -0
  293. package/lib/packlets/context/index.d.ts.map +1 -0
  294. package/lib/packlets/context/index.js.map +1 -0
  295. package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -0
  296. package/lib/packlets/decisions/abstractDecision.js.map +1 -0
  297. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -0
  298. package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  299. package/lib/packlets/decisions/candidate.d.ts.map +1 -0
  300. package/lib/packlets/decisions/candidate.js.map +1 -0
  301. package/lib/packlets/decisions/common.d.ts.map +1 -0
  302. package/lib/packlets/decisions/common.js.map +1 -0
  303. package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -0
  304. package/lib/packlets/decisions/concreteDecision.js.map +1 -0
  305. package/lib/packlets/decisions/decision.d.ts +1 -1
  306. package/lib/packlets/decisions/decision.d.ts.map +1 -0
  307. package/lib/packlets/decisions/decision.js +1 -1
  308. package/lib/packlets/decisions/decision.js.map +1 -0
  309. package/lib/packlets/decisions/index.d.ts.map +1 -0
  310. package/lib/packlets/decisions/index.js.map +1 -0
  311. package/lib/packlets/import/fsItem.d.ts +1 -4
  312. package/lib/packlets/import/fsItem.d.ts.map +1 -0
  313. package/lib/packlets/import/fsItem.js +1 -4
  314. package/lib/packlets/import/fsItem.js.map +1 -0
  315. package/lib/packlets/import/importContext.d.ts +5 -5
  316. package/lib/packlets/import/importContext.d.ts.map +1 -0
  317. package/lib/packlets/import/importContext.js +3 -3
  318. package/lib/packlets/import/importContext.js.map +1 -0
  319. package/lib/packlets/import/importManager.d.ts +15 -1
  320. package/lib/packlets/import/importManager.d.ts.map +1 -0
  321. package/lib/packlets/import/importManager.js +7 -3
  322. package/lib/packlets/import/importManager.js.map +1 -0
  323. package/lib/packlets/import/importable.d.ts.map +1 -0
  324. package/lib/packlets/import/importable.js.map +1 -0
  325. package/lib/packlets/import/importers/collectionImporter.d.ts +2 -2
  326. package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -0
  327. package/lib/packlets/import/importers/collectionImporter.js +2 -2
  328. package/lib/packlets/import/importers/collectionImporter.js.map +1 -0
  329. package/lib/packlets/import/importers/fsItemImporter.d.ts +16 -2
  330. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -0
  331. package/lib/packlets/import/importers/fsItemImporter.js +29 -13
  332. package/lib/packlets/import/importers/fsItemImporter.js.map +1 -0
  333. package/lib/packlets/import/importers/importer.d.ts.map +1 -0
  334. package/lib/packlets/import/importers/importer.js.map +1 -0
  335. package/lib/packlets/import/importers/index.browser.d.ts.map +1 -0
  336. package/lib/packlets/import/importers/index.browser.js.map +1 -0
  337. package/lib/packlets/import/importers/index.d.ts.map +1 -0
  338. package/lib/packlets/import/importers/index.js.map +1 -0
  339. package/lib/packlets/import/importers/jsonImporter.d.ts +2 -2
  340. package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -0
  341. package/lib/packlets/import/importers/jsonImporter.js +2 -2
  342. package/lib/packlets/import/importers/jsonImporter.js.map +1 -0
  343. package/lib/packlets/import/importers/pathImporter.d.ts +1 -1
  344. package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -0
  345. package/lib/packlets/import/importers/pathImporter.js +1 -1
  346. package/lib/packlets/import/importers/pathImporter.js.map +1 -0
  347. package/lib/packlets/import/index.browser.d.ts.map +1 -0
  348. package/lib/packlets/import/index.browser.js.map +1 -0
  349. package/lib/packlets/import/index.d.ts.map +1 -0
  350. package/lib/packlets/import/index.js.map +1 -0
  351. package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
  352. package/lib/packlets/qualifier-types/config/convert.js.map +1 -0
  353. package/lib/packlets/qualifier-types/config/index.d.ts.map +1 -0
  354. package/lib/packlets/qualifier-types/config/index.js.map +1 -0
  355. package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
  356. package/lib/packlets/qualifier-types/config/json.js.map +1 -0
  357. package/lib/packlets/qualifier-types/convert.d.ts.map +1 -0
  358. package/lib/packlets/qualifier-types/convert.js.map +1 -0
  359. package/lib/packlets/qualifier-types/helpers.d.ts.map +1 -0
  360. package/lib/packlets/qualifier-types/helpers.js.map +1 -0
  361. package/lib/packlets/qualifier-types/index.d.ts.map +1 -0
  362. package/lib/packlets/qualifier-types/index.js.map +1 -0
  363. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +6 -7
  364. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -0
  365. package/lib/packlets/qualifier-types/languageQualifierType.js +6 -7
  366. package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  367. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +7 -10
  368. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -0
  369. package/lib/packlets/qualifier-types/literalQualifierType.js +7 -10
  370. package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  371. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
  372. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  373. package/lib/packlets/qualifier-types/qualifierType.d.ts +17 -18
  374. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -0
  375. package/lib/packlets/qualifier-types/qualifierType.js +12 -13
  376. package/lib/packlets/qualifier-types/qualifierType.js.map +1 -0
  377. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -0
  378. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  379. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +8 -8
  380. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -0
  381. package/lib/packlets/qualifier-types/territoryQualifierType.js +5 -5
  382. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  383. package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -0
  384. package/lib/packlets/qualifiers/convert/decls.js.map +1 -0
  385. package/lib/packlets/qualifiers/convert/index.d.ts.map +1 -0
  386. package/lib/packlets/qualifiers/convert/index.js.map +1 -0
  387. package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +1 -0
  388. package/lib/packlets/qualifiers/convert/qualifier.js.map +1 -0
  389. package/lib/packlets/qualifiers/index.d.ts.map +1 -0
  390. package/lib/packlets/qualifiers/index.js.map +1 -0
  391. package/lib/packlets/qualifiers/qualifier.d.ts +6 -7
  392. package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -0
  393. package/lib/packlets/qualifiers/qualifier.js +6 -7
  394. package/lib/packlets/qualifiers/qualifier.js.map +1 -0
  395. package/lib/packlets/qualifiers/qualifierCollector.d.ts +107 -9
  396. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -0
  397. package/lib/packlets/qualifiers/qualifierCollector.js +152 -8
  398. package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -0
  399. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -0
  400. package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -0
  401. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +1 -0
  402. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  403. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +1 -0
  404. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  405. package/lib/packlets/resource-json/compiled/common.d.ts.map +1 -0
  406. package/lib/packlets/resource-json/compiled/common.js.map +1 -0
  407. package/lib/packlets/resource-json/compiled/convert.d.ts.map +1 -0
  408. package/lib/packlets/resource-json/compiled/convert.js.map +1 -0
  409. package/lib/packlets/resource-json/compiled/index.d.ts.map +1 -0
  410. package/lib/packlets/resource-json/compiled/index.js.map +1 -0
  411. package/lib/packlets/resource-json/compiled/json.d.ts.map +1 -0
  412. package/lib/packlets/resource-json/compiled/json.js.map +1 -0
  413. package/lib/packlets/resource-json/convert.d.ts +85 -0
  414. package/lib/packlets/resource-json/convert.d.ts.map +1 -0
  415. package/lib/packlets/resource-json/convert.js +237 -0
  416. package/lib/packlets/resource-json/convert.js.map +1 -0
  417. package/lib/packlets/resource-json/helpers.d.ts.map +1 -0
  418. package/lib/packlets/resource-json/helpers.js.map +1 -0
  419. package/lib/packlets/resource-json/index.d.ts.map +1 -0
  420. package/lib/packlets/resource-json/index.js.map +1 -0
  421. package/lib/packlets/resource-json/json.d.ts +128 -39
  422. package/lib/packlets/resource-json/json.d.ts.map +1 -0
  423. package/lib/packlets/resource-json/json.js +2 -2
  424. package/lib/packlets/resource-json/json.js.map +1 -0
  425. package/lib/packlets/resource-json/normalized.d.ts.map +1 -0
  426. package/lib/packlets/resource-json/normalized.js.map +1 -0
  427. package/lib/packlets/resource-json/resourceDeclCollection.d.ts +1 -1
  428. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -0
  429. package/lib/packlets/resource-json/resourceDeclCollection.js +1 -1
  430. package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  431. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -0
  432. package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  433. package/lib/packlets/resource-json/resourceDeclTree.d.ts +1 -1
  434. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -0
  435. package/lib/packlets/resource-json/resourceDeclTree.js +1 -1
  436. package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -0
  437. package/lib/packlets/resource-types/config/convert.d.ts.map +1 -0
  438. package/lib/packlets/resource-types/config/convert.js.map +1 -0
  439. package/lib/packlets/resource-types/config/index.d.ts.map +1 -0
  440. package/lib/packlets/resource-types/config/index.js.map +1 -0
  441. package/lib/packlets/resource-types/config/json.d.ts.map +1 -0
  442. package/lib/packlets/resource-types/config/json.js.map +1 -0
  443. package/lib/packlets/resource-types/helpers.d.ts.map +1 -0
  444. package/lib/packlets/resource-types/helpers.js.map +1 -0
  445. package/lib/packlets/resource-types/index.d.ts.map +1 -0
  446. package/lib/packlets/resource-types/index.js.map +1 -0
  447. package/lib/packlets/resource-types/jsonResourceType.d.ts +17 -5
  448. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -0
  449. package/lib/packlets/resource-types/jsonResourceType.js +2 -2
  450. package/lib/packlets/resource-types/jsonResourceType.js.map +1 -0
  451. package/lib/packlets/resource-types/resourceType.d.ts +5 -5
  452. package/lib/packlets/resource-types/resourceType.d.ts.map +1 -0
  453. package/lib/packlets/resource-types/resourceType.js +2 -2
  454. package/lib/packlets/resource-types/resourceType.js.map +1 -0
  455. package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +1 -0
  456. package/lib/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  457. package/lib/packlets/resources/candidateReducer.d.ts.map +1 -0
  458. package/lib/packlets/resources/candidateReducer.js.map +1 -0
  459. package/lib/packlets/resources/candidateValue.d.ts.map +1 -0
  460. package/lib/packlets/resources/candidateValue.js.map +1 -0
  461. package/lib/packlets/resources/candidateValueCollector.d.ts.map +1 -0
  462. package/lib/packlets/resources/candidateValueCollector.js.map +1 -0
  463. package/lib/packlets/resources/common.d.ts.map +1 -0
  464. package/lib/packlets/resources/common.js.map +1 -0
  465. package/lib/packlets/resources/deltaGenerator.d.ts.map +1 -0
  466. package/lib/packlets/resources/deltaGenerator.js.map +1 -0
  467. package/lib/packlets/resources/index.d.ts.map +1 -0
  468. package/lib/packlets/resources/index.js.map +1 -0
  469. package/lib/packlets/resources/resource.d.ts.map +1 -0
  470. package/lib/packlets/resources/resource.js.map +1 -0
  471. package/lib/packlets/resources/resourceBuilder.d.ts +2 -2
  472. package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -0
  473. package/lib/packlets/resources/resourceBuilder.js +2 -2
  474. package/lib/packlets/resources/resourceBuilder.js.map +1 -0
  475. package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -0
  476. package/lib/packlets/resources/resourceCandidate.js.map +1 -0
  477. package/lib/packlets/resources/resourceManagerBuilder.d.ts +5 -5
  478. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
  479. package/lib/packlets/resources/resourceManagerBuilder.js +5 -5
  480. package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -0
  481. package/lib/packlets/runtime/cacheListener.d.ts.map +1 -0
  482. package/lib/packlets/runtime/cacheListener.js.map +1 -0
  483. package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -0
  484. package/lib/packlets/runtime/cacheMetrics.js.map +1 -0
  485. package/lib/packlets/runtime/compiledResourceCollection.d.ts +5 -5
  486. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
  487. package/lib/packlets/runtime/compiledResourceCollection.js +5 -5
  488. package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -0
  489. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +1 -0
  490. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  491. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +1 -0
  492. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  493. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +1 -0
  494. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  495. package/lib/packlets/runtime/context/index.d.ts.map +1 -0
  496. package/lib/packlets/runtime/context/index.js.map +1 -0
  497. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +9 -2
  498. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -0
  499. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +3 -0
  500. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  501. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +8 -1
  502. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -0
  503. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +3 -5
  504. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  505. package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -0
  506. package/lib/packlets/runtime/iResourceManager.js.map +1 -0
  507. package/lib/packlets/runtime/index.d.ts.map +1 -0
  508. package/lib/packlets/runtime/index.js.map +1 -0
  509. package/lib/packlets/runtime/resource-tree/common.d.ts.map +1 -0
  510. package/lib/packlets/runtime/resource-tree/common.js.map +1 -0
  511. package/lib/packlets/runtime/resource-tree/index.d.ts.map +1 -0
  512. package/lib/packlets/runtime/resource-tree/index.js.map +1 -0
  513. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +1 -0
  514. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  515. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +1 -0
  516. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  517. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +1 -0
  518. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  519. package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -0
  520. package/lib/packlets/runtime/resourceResolver.js.map +1 -0
  521. package/lib/packlets/runtime/resourceTreeResolver.d.ts.map +1 -0
  522. package/lib/packlets/runtime/resourceTreeResolver.js.map +1 -0
  523. package/lib/packlets/runtime/validate.d.ts.map +1 -0
  524. package/lib/packlets/runtime/validate.js.map +1 -0
  525. package/lib/packlets/zip-archive/convert.d.ts.map +1 -0
  526. package/lib/packlets/zip-archive/convert.js.map +1 -0
  527. package/lib/packlets/zip-archive/index.browser.d.ts.map +1 -0
  528. package/lib/packlets/zip-archive/index.browser.js.map +1 -0
  529. package/lib/packlets/zip-archive/index.d.ts.map +1 -0
  530. package/lib/packlets/zip-archive/index.js.map +1 -0
  531. package/lib/packlets/zip-archive/json.d.ts.map +1 -0
  532. package/lib/packlets/zip-archive/json.js.map +1 -0
  533. package/lib/packlets/zip-archive/types.d.ts.map +1 -0
  534. package/lib/packlets/zip-archive/types.js.map +1 -0
  535. package/lib/packlets/zip-archive/zipArchiveCreator.d.ts.map +1 -0
  536. package/lib/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  537. package/lib/packlets/zip-archive/zipArchiveFormat.d.ts.map +1 -0
  538. package/lib/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  539. package/lib/packlets/zip-archive/zipArchiveLoader.d.ts.map +1 -0
  540. package/lib/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  541. package/package.json +12 -10
  542. package/dist/test/data/sample.json +0 -32
  543. package/dist/test/unit/qualifier-types/testQualifierType.js +0 -76
  544. package/dist/test/unit/resource-types/testDerivedResourceType.js +0 -109
  545. package/dist/test/unit/resources/deltaGenerator.helpers.js +0 -282
@@ -0,0 +1 @@
1
+ {"version":3,"file":"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,YAAmB,QAA0B;QAC3C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC,eAAe,CAAC;IACnD,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,MAAM,CAAC,QAA0B;QAC7C,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjE,CAAC;IAED;;;;;OAKG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC;IACnC,CAAC;IA0BD;;OAEG;IACI,2BAA2B,CAChC,QAAuD,EACvD,OAAqC;QAErC,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACjC,OAAO,IAAI,CAAC,sBAAsB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACxD,CAAC;QACD,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAEO,QAAQ;QACd,IAAI,CAAC,IA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O,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,CAAC,oBAAoB,CAKjE,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,CAAC,IAAI,CAAC,qBAAqB,CAKnE,CAAC;AAEL;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,IAAI,CAAC,mBAAmB,CAK/D,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,CAAC,MAAM,CAAqB,CAAC;AAE7D;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,SAAS,CAAC,IAAI,CAAC,aAAa,CAKrD,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC,IAAI,CAAC,kBAAkB,CAS/D,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,CAAC,WAAW,CAAC,oBAAoB,CAK3E,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../src/packlets/zip-archive/convert.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG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a,EAAE,IAAiD,EAAE,OAAiB,EAAE,EAAE;IACxF,OAAO,qBAAU,CAAC,YAAY,CAA0B;QACtD,IAAI,EAAE,qBAAU,CAAC,MAAM;QACvB,KAAK,EAAE,qBAAU,CAAC,OAAO,CAAC,oBAAY,CAAC;QACvC,cAAc,EAAE,qBAAU,CAAC,OAAO,CAAC,IAAI,CAAC;KACzC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5B,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACU,QAAA,mBAAmB,GAAgD,qBAAU,CAAC,GAAG,CAC5F,sBAAsB,EACtB,CAAC,KAAc,EAA6C,EAAE;IAC5D,OAAO,gBAAa,CAAC,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,CAAC;AACtE,CAAC,CACF,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\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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ACZ,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":[],"mappings":"AAsBA,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,8BAA8B;IAC9B,SAAS,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IAClC,kCAAkC;IAClC,UAAU,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC;CACzC;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,GAAG,0BAA0B,CAAC;AAEpF;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAC;AAE3D;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,0BAA0B;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BAA8B;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,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ACtB,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,SAAU,CAAC,CAAC,eAAe,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,uBAAuB,GAAG,EAAE,CAAC,CAC5F,CAAC;QACN,CAAC;aAAM,IAAI,WAAW,IAAI,OAAO,EAAE,CAAC;YAClC,OAAO,IAAA,kBAAO,EAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,IAAA,kBAAO,EAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IAEO,sBAAsB,CAAC,OAA0B;QACvD,IAAI,YAAY,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YAChE,OAAO,uBAAQ,CAAC,aAAa,EAAE;iBAC5B,eAAe,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,+BAA+B,GAAG,EAAE,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,MAAM,EAAiB,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAG/B;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,GAAG,WAAW,EAC/B,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,GAClB,IAAI,CAAC,mBAAmB,CAmB1B;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAO9F;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAE9F;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAOzG;AAED;;;;;GAKG;AACH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AAM,CAAC;AAC3F,CAAC;AAED;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AACvD,CAAC;AAED;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,IAAY;IAC3C,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,SAAS,CAAC;AAC9C,CAAC;AAED;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,QAAgB;IAC/C,OAAO,QAAQ;SACZ,OAAO,CAAC,eAAe,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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IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,EAAE;wBACT,cAAc,EAAE,EAAE;qBACnB,CAAC;oBACF,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAC3C,CAAC;gBAED,UAAU,GAAG,QAAQ,CAAC;YACxB,CAAC;YAED,mCAAmC;YACnC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACK,YAAY,CAAC,QAAgB;QACnC,MAAM,GAAG,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;QACpD,mDAAmD;QACnD,QAAQ,GAAG,EAAE,CAAC;YACZ,KAAK,MAAM;gBACT,OAAO,kBAAkB,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-3",
3
+ "version": "5.1.0-30",
4
4
  "description": "Multi-dimensional Resource Runtime",
5
5
  "main": "lib/index.js",
6
6
  "types": "dist/ts-res.d.ts",
@@ -39,22 +39,24 @@
39
39
  "typescript": "5.9.3",
40
40
  "eslint-plugin-n": "^17.23.1",
41
41
  "@rushstack/eslint-config": "4.6.4",
42
- "@rushstack/heft": "1.2.6",
42
+ "@rushstack/heft": "1.2.7",
43
43
  "@rushstack/heft-jest-plugin": "1.2.6",
44
- "@rushstack/heft-node-rig": "2.11.26",
44
+ "@rushstack/heft-node-rig": "2.11.27",
45
45
  "@types/heft-jest": "1.0.6",
46
46
  "eslint-plugin-tsdoc": "~0.5.2",
47
- "@fgv/ts-utils-jest": "5.1.0-3",
48
- "@fgv/heft-dual-rig": "5.1.0-3",
49
- "@fgv/ts-extras": "5.1.0-3"
47
+ "typedoc": "~0.28.16",
48
+ "@fgv/heft-dual-rig": "5.1.0-30",
49
+ "@fgv/typedoc-compact-theme": "5.1.0-30",
50
+ "@fgv/ts-extras": "5.1.0-30",
51
+ "@fgv/ts-utils-jest": "5.1.0-30"
50
52
  },
51
53
  "dependencies": {
52
54
  "luxon": "^3.7.2",
53
55
  "fflate": "~0.8.2",
54
- "@fgv/ts-utils": "5.1.0-3",
55
- "@fgv/ts-json-base": "5.1.0-3",
56
- "@fgv/ts-bcp47": "5.1.0-3",
57
- "@fgv/ts-json": "5.1.0-3"
56
+ "@fgv/ts-utils": "5.1.0-30",
57
+ "@fgv/ts-json": "5.1.0-30",
58
+ "@fgv/ts-bcp47": "5.1.0-30",
59
+ "@fgv/ts-json-base": "5.1.0-30"
58
60
  },
59
61
  "exports": {
60
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
@@ -1,109 +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 { Convert } from '../../../packlets/common';
24
- // eslint-disable-next-line @rushstack/packlets/mechanics
25
- import { ResourceType } from '../../../packlets/resource-types/resourceType';
26
- /**
27
- * A derived resource type for testing that demonstrates:
28
- * 1. Custom validation logic
29
- * 2. Using a resource resolver to look up template values
30
- * 3. Type-specific defaults and error handling
31
- */
32
- export class TestDerivedResourceType extends ResourceType {
33
- constructor(key, index, template, templateResourceId) {
34
- super(key, index, template);
35
- this.systemTypeName = Convert.resourceTypeName
36
- .convert('test-derived')
37
- .orThrow();
38
- this._templateResourceId = templateResourceId;
39
- }
40
- /**
41
- * Factory method to create a new TestDerivedResourceType instance.
42
- */
43
- static create(params) {
44
- var _a;
45
- return Convert.resourceTypeName.convert((_a = params === null || params === void 0 ? void 0 : params.key) !== null && _a !== void 0 ? _a : 'test-derived').onSuccess((key) => {
46
- return captureResult(() => new TestDerivedResourceType(key, params === null || params === void 0 ? void 0 : params.index, params === null || params === void 0 ? void 0 : params.template, params === null || params === void 0 ? void 0 : params.templateResourceId));
47
- });
48
- }
49
- /**
50
- * Validates a resource candidate declaration with custom logic.
51
- */
52
- validateDeclaration(props) {
53
- // Custom validation: merge method must be 'replace' for full candidates
54
- if (props.completeness === 'full' && props.mergeMethod !== 'replace') {
55
- return fail(`${this.key}: Full candidates must use 'replace' merge method, got '${props.mergeMethod}'`);
56
- }
57
- return this.validate(props.json, props.completeness);
58
- }
59
- validate(json, completeness) {
60
- if (typeof json !== 'object' || json === null || Array.isArray(json)) {
61
- return fail(`${this.key}: Expected JSON object, got ${typeof json}`);
62
- }
63
- const obj = json;
64
- // Validate required title field for full resources
65
- if (completeness === 'full' && (typeof obj.title !== 'string' || !obj.title.trim())) {
66
- return fail(`${this.key}: 'title' field is required and must be a non-empty string`);
67
- }
68
- // Validate optional description
69
- if (obj.description !== undefined && typeof obj.description !== 'string') {
70
- return fail(`${this.key}: 'description' field must be a string if provided`);
71
- }
72
- // Validate optional metadata
73
- if (obj.metadata !== undefined) {
74
- if (typeof obj.metadata !== 'object' || obj.metadata === null || Array.isArray(obj.metadata)) {
75
- return fail(`${this.key}: 'metadata' field must be an object if provided`);
76
- }
77
- }
78
- const result = Object.assign(Object.assign(Object.assign({}, (obj.title && { title: obj.title })), (obj.description && { description: obj.description })), (obj.metadata && { metadata: obj.metadata }));
79
- return succeed(result);
80
- }
81
- /**
82
- * Override to demonstrate looking up template values from another resource.
83
- */
84
- getDefaultTemplateCandidate(json, conditions, resolver) {
85
- // If a template resource ID is configured and resolver is available, try to resolve it
86
- if (this._templateResourceId && resolver && !json) {
87
- return resolver
88
- .resolveComposedResourceValue(this._templateResourceId)
89
- .onFailure((error) => fail(`${this.key}: Failed to resolve template resource '${this._templateResourceId}': ${error}`))
90
- .onSuccess((resolvedValue) => {
91
- // Use the resolved value as our JSON template
92
- return super.getDefaultTemplateCandidate(resolvedValue, conditions, resolver);
93
- });
94
- }
95
- // Use provided JSON or fall back to base implementation
96
- return super.getDefaultTemplateCandidate(json, conditions, resolver);
97
- }
98
- /**
99
- * Override createTemplate to add additional validation for the derived type.
100
- */
101
- createTemplate(resourceId, init, conditions, resolver) {
102
- // Additional validation: warn if trying to use resolver functionality without a resolver
103
- if (this._templateResourceId && !resolver) {
104
- return fail(`${this.key}: Template resource ID '${this._templateResourceId}' is configured but no resolver provided`);
105
- }
106
- return super.createTemplate(resourceId, init, conditions, resolver);
107
- }
108
- }
109
- //# sourceMappingURL=testDerivedResourceType.js.map