@carbonenginejs/runtime-resource 0.20.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/NOTICE +6 -0
  2. package/dist/CjsResMan.js +1374 -1318
  3. package/dist/CjsResMan.js.map +1 -1
  4. package/dist/format/CjsFormat.js +393 -164
  5. package/dist/format/CjsFormat.js.map +1 -1
  6. package/dist/format/CjsFormatStore.js +315 -0
  7. package/dist/format/CjsFormatStore.js.map +1 -0
  8. package/dist/format/CjsResourceProbe.js +66 -234
  9. package/dist/format/CjsResourceProbe.js.map +1 -1
  10. package/dist/format/payloadContract.js +47 -6
  11. package/dist/format/payloadContract.js.map +1 -1
  12. package/dist/formats/black/CjsBlackFormat.js +23 -6
  13. package/dist/formats/black/CjsBlackFormat.js.map +1 -1
  14. package/dist/formats/bnk/CjsBnkFormat.js +122 -120
  15. package/dist/formats/bnk/CjsBnkFormat.js.map +1 -1
  16. package/dist/formats/bnk/core/helpers.js +5 -15
  17. package/dist/formats/bnk/core/helpers.js.map +1 -1
  18. package/dist/formats/cmf/CjsCmfFormat.js +31 -14
  19. package/dist/formats/cmf/CjsCmfFormat.js.map +1 -1
  20. package/dist/formats/dds/CjsDdsFormat.js +29 -19
  21. package/dist/formats/dds/CjsDdsFormat.js.map +1 -1
  22. package/dist/formats/dds/core/helpers.js +4 -5
  23. package/dist/formats/dds/core/helpers.js.map +1 -1
  24. package/dist/formats/dxbc/CjsDxbcFormat.js +15 -13
  25. package/dist/formats/dxbc/CjsDxbcFormat.js.map +1 -1
  26. package/dist/formats/fbx/CjsFbxFormat.js +27 -19
  27. package/dist/formats/fbx/CjsFbxFormat.js.map +1 -1
  28. package/dist/formats/fbx/core/helpers.js +4 -4
  29. package/dist/formats/fbx/core/helpers.js.map +1 -1
  30. package/dist/formats/flac/CjsFlacFormat.js +19 -17
  31. package/dist/formats/flac/CjsFlacFormat.js.map +1 -1
  32. package/dist/formats/flac/core/helpers.js +5 -11
  33. package/dist/formats/flac/core/helpers.js.map +1 -1
  34. package/dist/formats/fsd/32/CjsFsd32Format.js +55 -0
  35. package/dist/formats/fsd/32/CjsFsd32Format.js.map +1 -0
  36. package/dist/formats/fsd/32/index.js +2 -0
  37. package/dist/formats/fsd/32/index.js.map +1 -0
  38. package/dist/formats/fsd/64/CjsFsd64Format.js +119 -0
  39. package/dist/formats/fsd/64/CjsFsd64Format.js.map +1 -0
  40. package/dist/formats/fsd/64/core/CjsFsd64Binary.js +393 -0
  41. package/dist/formats/fsd/64/core/CjsFsd64Binary.js.map +1 -0
  42. package/dist/formats/fsd/64/core/CjsFsd64Reader.js +138 -0
  43. package/dist/formats/fsd/64/core/CjsFsd64Reader.js.map +1 -0
  44. package/dist/formats/fsd/64/core/CjsFsd64SchemaDecoder.js +389 -0
  45. package/dist/formats/fsd/64/core/CjsFsd64SchemaDecoder.js.map +1 -0
  46. package/dist/formats/fsd/64/core/CjsFsd64SchemaReader.js +43 -0
  47. package/dist/formats/fsd/64/core/CjsFsd64SchemaReader.js.map +1 -0
  48. package/dist/formats/fsd/64/core/fsd64Records.js +60 -0
  49. package/dist/formats/fsd/64/core/fsd64Records.js.map +1 -0
  50. package/dist/formats/fsd/64/index.js +7 -0
  51. package/dist/formats/fsd/64/index.js.map +1 -0
  52. package/dist/formats/fsd/64/readers/CjsFsd64ReaderSetCharacterStaticData.js +33 -0
  53. package/dist/formats/fsd/64/readers/CjsFsd64ReaderSetCharacterStaticData.js.map +1 -0
  54. package/dist/formats/fsd/64/readers/CjsFsd64SchemaAgentTypes.js +35 -0
  55. package/dist/formats/fsd/64/readers/CjsFsd64SchemaAgentTypes.js.map +1 -0
  56. package/dist/formats/fsd/64/readers/CjsFsd64SchemaAgentsInSpace.js +50 -0
  57. package/dist/formats/fsd/64/readers/CjsFsd64SchemaAgentsInSpace.js.map +1 -0
  58. package/dist/formats/fsd/64/readers/CjsFsd64SchemaAncestries.js +75 -0
  59. package/dist/formats/fsd/64/readers/CjsFsd64SchemaAncestries.js.map +1 -0
  60. package/dist/formats/fsd/64/readers/CjsFsd64SchemaArchetypes.js +57 -0
  61. package/dist/formats/fsd/64/readers/CjsFsd64SchemaArchetypes.js.map +1 -0
  62. package/dist/formats/fsd/64/readers/CjsFsd64SchemaAudioMetadata.js +201 -0
  63. package/dist/formats/fsd/64/readers/CjsFsd64SchemaAudioMetadata.js.map +1 -0
  64. package/dist/formats/fsd/64/readers/CjsFsd64SchemaBloodlines.js +73 -0
  65. package/dist/formats/fsd/64/readers/CjsFsd64SchemaBloodlines.js.map +1 -0
  66. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCategories.js +53 -0
  67. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCategories.js.map +1 -0
  68. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterAvatarBehaviors.js +44 -0
  69. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterAvatarBehaviors.js.map +1 -0
  70. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterColorLocations.js +38 -0
  71. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterColorLocations.js.map +1 -0
  72. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterColorNames.js +34 -0
  73. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterColorNames.js.map +1 -0
  74. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterModifierLocations.js +34 -0
  75. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterModifierLocations.js.map +1 -0
  76. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterPortraitResources.js +44 -0
  77. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterPortraitResources.js.map +1 -0
  78. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterResources.js +81 -0
  79. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterResources.js.map +1 -0
  80. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterSculptingLocations.js +34 -0
  81. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterSculptingLocations.js.map +1 -0
  82. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCompressibleTypes.js +41 -0
  83. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCompressibleTypes.js.map +1 -0
  84. package/dist/formats/fsd/64/readers/CjsFsd64SchemaContrabandTypes.js +63 -0
  85. package/dist/formats/fsd/64/readers/CjsFsd64SchemaContrabandTypes.js.map +1 -0
  86. package/dist/formats/fsd/64/readers/CjsFsd64SchemaControlTowerResources.js +76 -0
  87. package/dist/formats/fsd/64/readers/CjsFsd64SchemaControlTowerResources.js.map +1 -0
  88. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCorporationActivities.js +38 -0
  89. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCorporationActivities.js.map +1 -0
  90. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCorporationRoleGroups.js +74 -0
  91. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCorporationRoleGroups.js.map +1 -0
  92. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCorporationRoles.js +59 -0
  93. package/dist/formats/fsd/64/readers/CjsFsd64SchemaCorporationRoles.js.map +1 -0
  94. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaAttributeCategories.js +46 -0
  95. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaAttributeCategories.js.map +1 -0
  96. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaAttributes.js +133 -0
  97. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaAttributes.js.map +1 -0
  98. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaEffects.js +236 -0
  99. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaEffects.js.map +1 -0
  100. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaUnits.js +60 -0
  101. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaUnits.js.map +1 -0
  102. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDynamicItemAttributes.js +95 -0
  103. package/dist/formats/fsd/64/readers/CjsFsd64SchemaDynamicItemAttributes.js.map +1 -0
  104. package/dist/formats/fsd/64/readers/CjsFsd64SchemaEpicArcs.js +106 -0
  105. package/dist/formats/fsd/64/readers/CjsFsd64SchemaEpicArcs.js.map +1 -0
  106. package/dist/formats/fsd/64/readers/CjsFsd64SchemaExpertSystems.js +86 -0
  107. package/dist/formats/fsd/64/readers/CjsFsd64SchemaExpertSystems.js.map +1 -0
  108. package/dist/formats/fsd/64/readers/CjsFsd64SchemaFactions.js +117 -0
  109. package/dist/formats/fsd/64/readers/CjsFsd64SchemaFactions.js.map +1 -0
  110. package/dist/formats/fsd/64/readers/CjsFsd64SchemaGraphicIds.js +70 -0
  111. package/dist/formats/fsd/64/readers/CjsFsd64SchemaGraphicIds.js.map +1 -0
  112. package/dist/formats/fsd/64/readers/CjsFsd64SchemaGraphicMaterialSets.js +173 -0
  113. package/dist/formats/fsd/64/readers/CjsFsd64SchemaGraphicMaterialSets.js.map +1 -0
  114. package/dist/formats/fsd/64/readers/CjsFsd64SchemaGroups.js +77 -0
  115. package/dist/formats/fsd/64/readers/CjsFsd64SchemaGroups.js.map +1 -0
  116. package/dist/formats/fsd/64/readers/CjsFsd64SchemaIcons.js +62 -0
  117. package/dist/formats/fsd/64/readers/CjsFsd64SchemaIcons.js.map +1 -0
  118. package/dist/formats/fsd/64/readers/CjsFsd64SchemaMarketGroups.js +63 -0
  119. package/dist/formats/fsd/64/readers/CjsFsd64SchemaMarketGroups.js.map +1 -0
  120. package/dist/formats/fsd/64/readers/CjsFsd64SchemaMetaGroups.js +86 -0
  121. package/dist/formats/fsd/64/readers/CjsFsd64SchemaMetaGroups.js.map +1 -0
  122. package/dist/formats/fsd/64/readers/CjsFsd64SchemaNpcCorporationDivisions.js +72 -0
  123. package/dist/formats/fsd/64/readers/CjsFsd64SchemaNpcCorporationDivisions.js.map +1 -0
  124. package/dist/formats/fsd/64/readers/CjsFsd64SchemaNpcCorporations.js +326 -0
  125. package/dist/formats/fsd/64/readers/CjsFsd64SchemaNpcCorporations.js.map +1 -0
  126. package/dist/formats/fsd/64/readers/CjsFsd64SchemaPaperdolls.js +279 -0
  127. package/dist/formats/fsd/64/readers/CjsFsd64SchemaPaperdolls.js.map +1 -0
  128. package/dist/formats/fsd/64/readers/CjsFsd64SchemaRaces.js +64 -0
  129. package/dist/formats/fsd/64/readers/CjsFsd64SchemaRaces.js.map +1 -0
  130. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSchoolMap.js +40 -0
  131. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSchoolMap.js.map +1 -0
  132. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSchools.js +113 -0
  133. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSchools.js.map +1 -0
  134. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkillPlans.js +130 -0
  135. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkillPlans.js.map +1 -0
  136. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponentCategories.js +38 -0
  137. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponentCategories.js.map +1 -0
  138. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponentPointValues.js +45 -0
  139. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponentPointValues.js.map +1 -0
  140. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponentRarities.js +44 -0
  141. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponentRarities.js.map +1 -0
  142. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponents.js +163 -0
  143. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponents.js.map +1 -0
  144. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlotCategories.js +37 -0
  145. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlotCategories.js.map +1 -0
  146. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlotConfigurations.js +77 -0
  147. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlotConfigurations.js.map +1 -0
  148. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlotNames.js +37 -0
  149. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlotNames.js.map +1 -0
  150. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlots.js +74 -0
  151. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlots.js.map +1 -0
  152. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrTierThresholds.js +44 -0
  153. package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrTierThresholds.js.map +1 -0
  154. package/dist/formats/fsd/64/readers/CjsFsd64SchemaStationOperations.js +120 -0
  155. package/dist/formats/fsd/64/readers/CjsFsd64SchemaStationOperations.js.map +1 -0
  156. package/dist/formats/fsd/64/readers/CjsFsd64SchemaStationServices.js +49 -0
  157. package/dist/formats/fsd/64/readers/CjsFsd64SchemaStationServices.js.map +1 -0
  158. package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypeDogma.js +73 -0
  159. package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypeDogma.js.map +1 -0
  160. package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypeLists.js +122 -0
  161. package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypeLists.js.map +1 -0
  162. package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypeMaterials.js +83 -0
  163. package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypeMaterials.js.map +1 -0
  164. package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypes.js +194 -0
  165. package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypes.js.map +1 -0
  166. package/dist/formats/fsd/64/readers/index.js +58 -0
  167. package/dist/formats/fsd/64/readers/index.js.map +1 -0
  168. package/dist/formats/fsd/CjsFsdFormat.js +62 -0
  169. package/dist/formats/fsd/CjsFsdFormat.js.map +1 -0
  170. package/dist/formats/fsd/index.js +9 -0
  171. package/dist/formats/fsd/index.js.map +1 -0
  172. package/dist/formats/gif/CjsGifFormat.js +26 -16
  173. package/dist/formats/gif/CjsGifFormat.js.map +1 -1
  174. package/dist/formats/gif/core/helpers.js +6 -18
  175. package/dist/formats/gif/core/helpers.js.map +1 -1
  176. package/dist/formats/gltf/CjsGltfFormat.js +25 -13
  177. package/dist/formats/gltf/CjsGltfFormat.js.map +1 -1
  178. package/dist/formats/gr2/CjsGr2Format.js +27 -6
  179. package/dist/formats/gr2/CjsGr2Format.js.map +1 -1
  180. package/dist/formats/hlsl/CjsHlslFormat.js +20 -16
  181. package/dist/formats/hlsl/CjsHlslFormat.js.map +1 -1
  182. package/dist/formats/hlsl/core/analysis.js +1 -1
  183. package/dist/formats/index.js +5 -0
  184. package/dist/formats/index.js.map +1 -1
  185. package/dist/formats/jpeg/CjsJpegFormat.js +26 -19
  186. package/dist/formats/jpeg/CjsJpegFormat.js.map +1 -1
  187. package/dist/formats/jpeg/core/helpers.js +6 -15
  188. package/dist/formats/jpeg/core/helpers.js.map +1 -1
  189. package/dist/formats/jpeg/core/jpeg.js +0 -3
  190. package/dist/formats/jpeg/core/jpeg.js.map +1 -1
  191. package/dist/formats/mp3/CjsMp3Format.js +19 -19
  192. package/dist/formats/mp3/CjsMp3Format.js.map +1 -1
  193. package/dist/formats/mp3/core/helpers.js +5 -11
  194. package/dist/formats/mp3/core/helpers.js.map +1 -1
  195. package/dist/formats/mp4/CjsMp4Format.js +20 -19
  196. package/dist/formats/mp4/CjsMp4Format.js.map +1 -1
  197. package/dist/formats/mp4/core/helpers.js +6 -15
  198. package/dist/formats/mp4/core/helpers.js.map +1 -1
  199. package/dist/formats/obj/CjsObjFormat.js +25 -12
  200. package/dist/formats/obj/CjsObjFormat.js.map +1 -1
  201. package/dist/formats/ogg/CjsOggFormat.js +26 -17
  202. package/dist/formats/ogg/CjsOggFormat.js.map +1 -1
  203. package/dist/formats/ogg/core/helpers.js +5 -16
  204. package/dist/formats/ogg/core/helpers.js.map +1 -1
  205. package/dist/formats/pickle/CjsPickleFormat.js +64 -5
  206. package/dist/formats/pickle/CjsPickleFormat.js.map +1 -1
  207. package/dist/formats/png/CjsPngFormat.js +28 -19
  208. package/dist/formats/png/CjsPngFormat.js.map +1 -1
  209. package/dist/formats/png/core/helpers.js +5 -14
  210. package/dist/formats/png/core/helpers.js.map +1 -1
  211. package/dist/formats/red/CjsRedFormat.js +19 -5
  212. package/dist/formats/red/CjsRedFormat.js.map +1 -1
  213. package/dist/formats/schemabound/CjsSchemaBoundFormat.js +48 -38
  214. package/dist/formats/schemabound/CjsSchemaBoundFormat.js.map +1 -1
  215. package/dist/formats/sqlite/CjsSqliteFormat.js +49 -41
  216. package/dist/formats/sqlite/CjsSqliteFormat.js.map +1 -1
  217. package/dist/formats/static/CjsStaticFormat.js +15 -57
  218. package/dist/formats/static/CjsStaticFormat.js.map +1 -1
  219. package/dist/formats/static/staticContainers.js +6 -6
  220. package/dist/formats/static/staticContainers.js.map +1 -1
  221. package/dist/formats/stl/CjsStlFormat.js +25 -12
  222. package/dist/formats/stl/CjsStlFormat.js.map +1 -1
  223. package/dist/formats/tga/CjsTgaFormat.js +26 -19
  224. package/dist/formats/tga/CjsTgaFormat.js.map +1 -1
  225. package/dist/formats/tga/core/helpers.js +7 -22
  226. package/dist/formats/tga/core/helpers.js.map +1 -1
  227. package/dist/formats/wav/CjsWavFormat.js +26 -19
  228. package/dist/formats/wav/CjsWavFormat.js.map +1 -1
  229. package/dist/formats/wav/core/helpers.js +7 -16
  230. package/dist/formats/wav/core/helpers.js.map +1 -1
  231. package/dist/formats/webgl/CjsWebglFormat.js +11 -13
  232. package/dist/formats/webgl/CjsWebglFormat.js.map +1 -1
  233. package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js +31 -1
  234. package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
  235. package/dist/formats/webgl/core/readGlslEffectContainer.js +8 -8
  236. package/dist/formats/webgl/core/readGlslEffectContainer.js.map +1 -1
  237. package/dist/formats/webgpu/CjsWebgpuFormat.js +11 -5
  238. package/dist/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
  239. package/dist/formats/webm/CjsWebmFormat.js +20 -19
  240. package/dist/formats/webm/CjsWebmFormat.js.map +1 -1
  241. package/dist/formats/webm/core/helpers.js +6 -15
  242. package/dist/formats/webm/core/helpers.js.map +1 -1
  243. package/dist/formats/webp/CjsWebpFormat.js +19 -17
  244. package/dist/formats/webp/CjsWebpFormat.js.map +1 -1
  245. package/dist/formats/webp/core/helpers.js +5 -11
  246. package/dist/formats/webp/core/helpers.js.map +1 -1
  247. package/dist/formats/wem/CjsWemFormat.js +128 -141
  248. package/dist/formats/wem/CjsWemFormat.js.map +1 -1
  249. package/dist/formats/wem/core/helpers.js +1 -114
  250. package/dist/formats/wem/core/helpers.js.map +1 -1
  251. package/dist/formats/wem/core/{resolve.js → probeCodecSupport.js} +11 -18
  252. package/dist/formats/wem/core/probeCodecSupport.js.map +1 -0
  253. package/dist/formats/yaml/CjsYamlFormat.js +20 -5
  254. package/dist/formats/yaml/CjsYamlFormat.js.map +1 -1
  255. package/dist/generated/index.js +2 -0
  256. package/dist/generated/index.js.map +1 -0
  257. package/dist/generated/resources/Tr2RaycastGeometryRes.js +34 -0
  258. package/dist/generated/resources/Tr2RaycastGeometryRes.js.map +1 -0
  259. package/dist/generated/resources/index.js +2 -0
  260. package/dist/generated/resources/index.js.map +1 -0
  261. package/dist/index.js +3 -1
  262. package/dist/index.js.map +1 -1
  263. package/dist/resource/CjsResource.js +134 -0
  264. package/dist/resource/CjsResource.js.map +1 -1
  265. package/dist/resource/ResourceRequirement.js +42 -0
  266. package/dist/resource/ResourceRequirement.js.map +1 -0
  267. package/dist/resource/Tr2LightProfileRes.js +2 -1
  268. package/dist/resource/Tr2LightProfileRes.js.map +1 -1
  269. package/dist/resource/geometry/TriGeometryRes.js +34 -7
  270. package/dist/resource/geometry/TriGeometryRes.js.map +1 -1
  271. package/dist/resource/geometry/granny/Tr2GrannyStateRes.js +184 -7
  272. package/dist/resource/geometry/granny/Tr2GrannyStateRes.js.map +1 -1
  273. package/dist/resource/geometry/granny/TriGrannyRes.js +20 -8
  274. package/dist/resource/geometry/granny/TriGrannyRes.js.map +1 -1
  275. package/dist/resource/index.js +1 -0
  276. package/dist/resource/index.js.map +1 -1
  277. package/dist/resource/resourceBoundary.js +24 -1
  278. package/dist/resource/resourceBoundary.js.map +1 -1
  279. package/dist/resource/shader/Tr2EffectRes.js +2 -1
  280. package/dist/resource/shader/Tr2EffectRes.js.map +1 -1
  281. package/dist/resource/texture/CjsTextureArrayRes.js +2 -1
  282. package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -1
  283. package/dist/resource/texture/Tr2ImageRes.js +2 -1
  284. package/dist/resource/texture/Tr2ImageRes.js.map +1 -1
  285. package/dist/resource/texture/TriTextureRes.js +40 -2
  286. package/dist/resource/texture/TriTextureRes.js.map +1 -1
  287. package/docs/architecture.md +121 -116
  288. package/docs/concepts/format-capabilities.md +90 -0
  289. package/docs/formats/README.md +14 -6
  290. package/docs/formats/fsd.md +104 -0
  291. package/docs/formats/gr2.md +1 -1
  292. package/docs/formats/hlsl/reference/api.md +6 -4
  293. package/docs/formats/provenance.md +18 -0
  294. package/docs/formats/schemabound.md +10 -4
  295. package/docs/formats/static.md +26 -26
  296. package/docs/formats/webgpu/reference/api.md +4 -3
  297. package/docs/reference/classes/core.md +22 -2
  298. package/docs/reference/classes/formats.md +643 -1
  299. package/docs/reference/classes/resources.md +463 -453
  300. package/docs/reference/queues.md +205 -194
  301. package/docs/roadmap.md +14 -18
  302. package/format-notices/fsd/LICENSE +21 -0
  303. package/format-notices/fsd/NOTICE +11 -0
  304. package/package.json +70 -64
  305. package/dist/formats/wem/core/resolve.js.map +0 -1
  306. package/docs/concepts/format-type-resolution.md +0 -79
@@ -0,0 +1,389 @@
1
+ import { AssertFlags, ReadRequiredString } from './fsd64Records.js';
2
+ import { CjsFsd64Binary } from './CjsFsd64Binary.js';
3
+
4
+ const SCHEMA_NAME = "carbonenginejs.fsdBinarySchema";
5
+ const SCHEMA_VERSION = 1;
6
+ const TYPE_SIZES = {
7
+ [CjsFsd64Binary.Type.BOOLEAN]: 1,
8
+ [CjsFsd64Binary.Type.FLOAT_32]: 4,
9
+ [CjsFsd64Binary.Type.FLOAT_64]: 8,
10
+ [CjsFsd64Binary.Type.INT_32]: 4,
11
+ [CjsFsd64Binary.Type.INT_32_IDENTIFIER]: 4,
12
+ [CjsFsd64Binary.Type.LIST]: 8,
13
+ [CjsFsd64Binary.Type.MAP]: 16,
14
+ [CjsFsd64Binary.Type.STRING]: 8,
15
+ [CjsFsd64Binary.Type.UINT_8]: 1,
16
+ [CjsFsd64Binary.Type.UINT_32]: 4,
17
+ [CjsFsd64Binary.Type.UINT_32_IDENTIFIER]: 4,
18
+ [CjsFsd64Binary.Type.UINT_64]: 8,
19
+ [CjsFsd64Binary.Type.UINT_64_IDENTIFIER]: 8
20
+ };
21
+
22
+ /**
23
+ * Validates declarative binary schemas and decodes caller-supplied bytes.
24
+ */
25
+ class CjsFsd64SchemaDecoder {
26
+ /**
27
+ * Validates and returns one inert JSON schema definition.
28
+ */
29
+ static defineSchema(schema) {
30
+ ValidateSchema(schema);
31
+ return schema;
32
+ }
33
+
34
+ /**
35
+ * Decodes a schema-defined value using the established private reader
36
+ * contract: Maps and numeric identifier values.
37
+ */
38
+ static read(bytes, schema) {
39
+ return DecodeRoot(bytes, schema, false);
40
+ }
41
+
42
+ /**
43
+ * Decodes a schema-defined value to plain JSON-compatible objects.
44
+ * Identifier keys and values are emitted as lossless decimal strings.
45
+ */
46
+ static readJSON(bytes, schema) {
47
+ return DecodeRoot(bytes, schema, true);
48
+ }
49
+ }
50
+ function DecodeRoot(bytes, schema, json) {
51
+ ValidateSchema(schema);
52
+ const binary = new CjsFsd64Binary(bytes, {
53
+ path: schema.path,
54
+ schemaID: [schema.schemaID, ...(schema.acceptedSchemaIDs ?? [])]
55
+ });
56
+ const containerOffset = binary.RootOffset + (schema.container.offset ?? 0);
57
+
58
+ // A root OBJECT is how a dataset that publishes several independent maps is
59
+ // described, such as audio metadata's events, sound banks and WEM files.
60
+ return ResolveFsdType(schema.container.type) === CjsFsd64Binary.Type.OBJECT ? DecodeObject(binary, containerOffset, schema.container, json, schema.path) : DecodeMap(binary, containerOffset, schema.container, json, schema.path);
61
+ }
62
+ function DecodeValue(binary, baseOffset, descriptor, json, path, field) {
63
+ const type = ResolveFsdType(descriptor.type);
64
+ const offset = baseOffset + (descriptor.offset ?? 0);
65
+ switch (type) {
66
+ case CjsFsd64Binary.Type.BOOLEAN:
67
+ return (binary.Byte(offset) & 1 << (descriptor.bit ?? 0)) !== 0;
68
+ case CjsFsd64Binary.Type.FLOAT_32:
69
+ return binary.Float32(offset);
70
+ case CjsFsd64Binary.Type.FLOAT_64:
71
+ return binary.Float64(offset);
72
+ case CjsFsd64Binary.Type.INT_32:
73
+ return binary.Int32(offset);
74
+ case CjsFsd64Binary.Type.INT_32_IDENTIFIER:
75
+ return FormatIdentifier(binary.Int32(offset), json);
76
+ case CjsFsd64Binary.Type.LIST:
77
+ return DecodeList(binary, offset, descriptor, json, path, field);
78
+ case CjsFsd64Binary.Type.MAP:
79
+ return DecodeMap(binary, offset, descriptor, json, path);
80
+ case CjsFsd64Binary.Type.OBJECT:
81
+ return DecodeObject(binary, offset, descriptor, json, path);
82
+ case CjsFsd64Binary.Type.STRING:
83
+ return ReadRequiredString(binary, offset, path, field);
84
+ case CjsFsd64Binary.Type.UINT_8:
85
+ return binary.Byte(offset);
86
+ case CjsFsd64Binary.Type.UINT_32:
87
+ return binary.Uint32(offset);
88
+ case CjsFsd64Binary.Type.UINT_32_IDENTIFIER:
89
+ return FormatIdentifier(binary.Uint32(offset), json);
90
+ case CjsFsd64Binary.Type.UINT_64:
91
+ return binary.Uint64(offset);
92
+ case CjsFsd64Binary.Type.UINT_64_IDENTIFIER:
93
+ return json ? binary.Uint64Identity(offset) : binary.Uint64(offset);
94
+ default:
95
+ throw SchemaError(`Unsupported FSD binary type: ${descriptor.type}`);
96
+ }
97
+ }
98
+ function DecodeObject(binary, baseOffset, descriptor, json, path) {
99
+ const flags = descriptor.presence ? DecodeValue(binary, baseOffset, descriptor.presence, false, path, "<presence>") : 0;
100
+ if (descriptor.presence) {
101
+ AssertFlags(flags, descriptor.presence.allowedMask, path);
102
+ }
103
+ const value = {};
104
+ for (const field of descriptor.fields) {
105
+ if (field.presenceMask !== undefined && (flags & field.presenceMask) === 0) {
106
+ continue;
107
+ }
108
+ DefineValue(value, field.name, DecodeValue(binary, baseOffset, field, json, path, field.name));
109
+ }
110
+ return value;
111
+ }
112
+ function DecodeList(binary, pointerOffset, descriptor, json, path, field) {
113
+ const relativeOffset = binary.Uint64(pointerOffset);
114
+ const offsets = binary.ListEntries(relativeOffset, descriptor.itemSize, descriptor.maximumCount ?? Number.MAX_SAFE_INTEGER);
115
+ return offsets.map(offset => DecodeValue(binary, offset, descriptor.item, json, path, `${field}[]`));
116
+ }
117
+ function DecodeMap(binary, headerOffset, descriptor, json, path) {
118
+ const entries = [];
119
+ for (const recordOffset of binary.MapEntries(descriptor.recordSize, headerOffset)) {
120
+ const key = DecodeValue(binary, recordOffset, descriptor.key, json, path, "<key>");
121
+ const value = descriptor.value ? DecodeValue(binary, recordOffset, descriptor.value, json, path, "<value>") : DecodeObject(binary, recordOffset + (descriptor.recordOffset ?? 0), descriptor, json, path);
122
+ entries.push([key, value]);
123
+ }
124
+ return json ? CreateJSONObject(entries, path, descriptor.key.type) : CreateMap(entries, path);
125
+ }
126
+ function FormatIdentifier(value, json) {
127
+ return json ? value.toString(10) : value;
128
+ }
129
+ function CreateMap(entries, path) {
130
+ const result = new Map();
131
+ for (const [key, value] of entries) {
132
+ if (result.has(key)) {
133
+ throw DuplicateKeyError(key, path);
134
+ }
135
+ result.set(key, value);
136
+ }
137
+ return result;
138
+ }
139
+ function CreateJSONObject(entries, path, keyType) {
140
+ entries.sort(([left], [right]) => CompareKeys(left, right, keyType));
141
+ const result = {};
142
+ for (const [key, value] of entries) {
143
+ const property = String(key);
144
+ if (Object.hasOwn(result, property)) {
145
+ throw DuplicateKeyError(property, path);
146
+ }
147
+ DefineValue(result, property, value);
148
+ }
149
+ return result;
150
+ }
151
+ function CompareKeys(left, right, type) {
152
+ if (IsIntegerType(type)) {
153
+ const leftValue = BigInt(left);
154
+ const rightValue = BigInt(right);
155
+ return leftValue < rightValue ? -1 : leftValue > rightValue ? 1 : 0;
156
+ }
157
+ const leftValue = String(left);
158
+ const rightValue = String(right);
159
+ return leftValue < rightValue ? -1 : leftValue > rightValue ? 1 : 0;
160
+ }
161
+ function IsIntegerType(type) {
162
+ return type === CjsFsd64Binary.Type.INT_32 || type === CjsFsd64Binary.Type.INT_32_IDENTIFIER || type === CjsFsd64Binary.Type.UINT_8 || type === CjsFsd64Binary.Type.UINT_32 || type === CjsFsd64Binary.Type.UINT_32_IDENTIFIER || type === CjsFsd64Binary.Type.UINT_64 || type === CjsFsd64Binary.Type.UINT_64_IDENTIFIER;
163
+ }
164
+ function DefineValue(target, property, value) {
165
+ Object.defineProperty(target, property, {
166
+ configurable: true,
167
+ enumerable: true,
168
+ value,
169
+ writable: true
170
+ });
171
+ }
172
+ function DuplicateKeyError(key, path) {
173
+ const error = new Error(`Duplicate FSD map key in ${path}: ${key}`);
174
+ error.code = "CJS_FSD_DUPLICATE_KEY";
175
+ error.key = key;
176
+ error.path = path;
177
+ return error;
178
+ }
179
+ function ValidateSchema(schema) {
180
+ if (!IsPlainObject(schema) || schema.schema !== SCHEMA_NAME || schema.schemaVersion !== SCHEMA_VERSION) {
181
+ throw SchemaError(`FSD binary schema must be ${SCHEMA_NAME} version ${SCHEMA_VERSION}.`);
182
+ }
183
+ if (typeof schema.path !== "string" || schema.path.trim() === "") {
184
+ throw SchemaError("FSD binary schema path must be a non-empty string.");
185
+ }
186
+ if (typeof schema.name !== "string" || schema.name.trim() === "") {
187
+ throw SchemaError("FSD binary schema name must be a non-empty string.");
188
+ }
189
+
190
+ // 32 characters pin the layout alone, which survives a content change and
191
+ // another publisher's build; 48 additionally pin one build's content digest.
192
+ if (typeof schema.schemaID !== "string" || !/^(?:[0-9a-f]{32}|[0-9a-f]{48})$/iu.test(schema.schemaID)) {
193
+ throw SchemaError("FSD binary schema identity must contain 32 or 48 hexadecimal characters.");
194
+ }
195
+
196
+ // A schema identity is not a hash of the byte layout alone, so one layout
197
+ // can carry two of them across publishers. Additional identities are
198
+ // accepted only where the layout was measured to be the same.
199
+ if (schema.acceptedSchemaIDs !== undefined) {
200
+ if (!Array.isArray(schema.acceptedSchemaIDs) || schema.acceptedSchemaIDs.some(value => typeof value !== "string" || !/^(?:[0-9a-f]{32}|[0-9a-f]{48})$/iu.test(value))) {
201
+ throw SchemaError("FSD binary accepted schema identities must be 32 or 48 hexadecimal characters each.");
202
+ }
203
+ }
204
+ if (!IsPlainObject(schema.container)) {
205
+ throw SchemaError("FSD binary schema root must be a MAP or an OBJECT.");
206
+ }
207
+ const rootType = ResolveFsdType(schema.container.type);
208
+ if (rootType !== CjsFsd64Binary.Type.MAP && rootType !== CjsFsd64Binary.Type.OBJECT) {
209
+ throw SchemaError("FSD binary schema root must be a MAP or an OBJECT.");
210
+ }
211
+ AssertOffset(schema.container.offset ?? 0, "container.offset");
212
+ if (rootType === CjsFsd64Binary.Type.OBJECT) {
213
+ AssertPositiveInteger(schema.container.headerSize, "container.headerSize");
214
+ ValidateObjectDescriptor(schema.container, schema.container.headerSize, "container");
215
+ return;
216
+ }
217
+ ValidateMapDescriptor(schema.container, "container");
218
+ }
219
+ function ValidateMapDescriptor(descriptor, label) {
220
+ AssertPositiveInteger(descriptor.recordSize, `${label}.recordSize`);
221
+ ValidateValueDescriptor(descriptor.key, descriptor.recordSize, `${label}.key`);
222
+ if (descriptor.value !== undefined) {
223
+ if (descriptor.fields !== undefined || descriptor.presence !== undefined || descriptor.recordOffset !== undefined) {
224
+ throw SchemaError(`${label} cannot combine value with object record metadata.`);
225
+ }
226
+ ValidateValueDescriptor(descriptor.value, descriptor.recordSize, `${label}.value`);
227
+ return;
228
+ }
229
+ const recordOffset = descriptor.recordOffset ?? 0;
230
+ AssertOffset(recordOffset, `${label}.recordOffset`);
231
+ if (recordOffset > descriptor.recordSize) {
232
+ throw SchemaError(`${label}.recordOffset exceeds the record size.`);
233
+ }
234
+ ValidateObjectDescriptor(descriptor, descriptor.recordSize - recordOffset, label);
235
+ }
236
+ function ValidateObjectDescriptor(descriptor, availableSize, label) {
237
+ if (!Array.isArray(descriptor.fields)) {
238
+ throw SchemaError(`${label}.fields must be an array.`);
239
+ }
240
+ if (descriptor.presence !== undefined) {
241
+ ValidateValueDescriptor(descriptor.presence, availableSize, `${label}.presence`);
242
+ const presenceType = ResolveFsdType(descriptor.presence.type);
243
+ if (presenceType !== CjsFsd64Binary.Type.UINT_32 && presenceType !== CjsFsd64Binary.Type.UINT_64) {
244
+ throw SchemaError(`${label}.presence must use UINT_32 or UINT_64.`);
245
+ }
246
+ AssertSafeMask(descriptor.presence.allowedMask, `${label}.presence.allowedMask`);
247
+ }
248
+ const names = new Set();
249
+ let previousOffset = -1;
250
+ for (let index = 0; index < descriptor.fields.length; index++) {
251
+ const field = descriptor.fields[index];
252
+ const fieldLabel = `${label}.fields[${index}]`;
253
+ ValidateValueDescriptor(field, availableSize, fieldLabel);
254
+ const offset = field.offset ?? 0;
255
+ if (offset < previousOffset) {
256
+ throw SchemaError(`${label}.fields must be ordered by byte offset.`);
257
+ }
258
+ previousOffset = offset;
259
+ if (typeof field.name !== "string" || field.name === "") {
260
+ throw SchemaError(`${fieldLabel}.name must be a non-empty string.`);
261
+ }
262
+ if (names.has(field.name)) {
263
+ throw SchemaError(`FSD binary schema field is duplicated: ${field.name}`);
264
+ }
265
+ names.add(field.name);
266
+ ValidateSourceName(field, fieldLabel);
267
+ ValidatePresenceMask(field, descriptor.presence, fieldLabel);
268
+ }
269
+ }
270
+
271
+ /**
272
+ * Converts a client field name to the name the export publishes.
273
+ *
274
+ * The newer datasets name fields in snake_case and CCP's exporter camelCases
275
+ * them, with one wrinkle worth writing down rather than remembering: a trailing
276
+ * `id` segment becomes `ID`, so `type_id` is published as `typeID` and not
277
+ * `typeId`. That rule was applied by hand across the SKINR schemas before it
278
+ * was written anywhere, and by hand it was applied inconsistently.
279
+ *
280
+ * @param {string} sourceName Field name as the client stores it.
281
+ * @returns {string} Field name as the export publishes it.
282
+ */
283
+ function CamelizeFieldName(sourceName) {
284
+ return String(sourceName).split("_").map((segment, index) => {
285
+ if (segment.toLowerCase() === "id") return "ID";
286
+ return index === 0 ? segment : segment.charAt(0).toUpperCase() + segment.slice(1);
287
+ }).join("");
288
+ }
289
+
290
+ /**
291
+ * Checks a field's name against the client's own name for it.
292
+ *
293
+ * A schema may record `sourceName`, the name the loader gives the field. When
294
+ * it does, the decoded name must be the mechanical conversion of it - which is
295
+ * what makes the conversion checkable rather than a transcription nobody can
296
+ * audit. A field that departs deliberately, such as a label identifier the
297
+ * export republishes as resolved text, declares `renamed: true` and says why in
298
+ * the reader.
299
+ */
300
+ function ValidateSourceName(descriptor, label) {
301
+ if (descriptor.sourceName === undefined) return;
302
+ if (typeof descriptor.sourceName !== "string" || descriptor.sourceName === "") {
303
+ throw SchemaError(`${label}.sourceName must be a non-empty string.`);
304
+ }
305
+ if (descriptor.renamed === true) return;
306
+ const expected = CamelizeFieldName(descriptor.sourceName);
307
+ if (descriptor.name !== expected) {
308
+ throw SchemaError(`${label} is named ${descriptor.name} but its source ${descriptor.sourceName} ` + `converts to ${expected}. Set renamed: true if the departure is deliberate.`);
309
+ }
310
+ }
311
+ function ValidateValueDescriptor(descriptor, availableSize, label) {
312
+ if (!IsPlainObject(descriptor)) {
313
+ throw SchemaError(`${label} must be an object.`);
314
+ }
315
+ const type = ResolveFsdType(descriptor.type);
316
+ if (type === CjsFsd64Binary.Type.OBJECT) {
317
+ const offset = descriptor.offset ?? 0;
318
+ AssertOffset(offset, `${label}.offset`);
319
+ if (offset > availableSize) {
320
+ throw SchemaError(`${label}.offset exceeds its containing record.`);
321
+ }
322
+ ValidateObjectDescriptor(descriptor, availableSize - offset, label);
323
+ return;
324
+ }
325
+ AssertOffset(descriptor.offset, `${label}.offset`);
326
+ if (descriptor.offset + TYPE_SIZES[type] > availableSize) {
327
+ throw SchemaError(`${label} exceeds its ${availableSize}-byte record.`);
328
+ }
329
+ if (type === CjsFsd64Binary.Type.LIST) {
330
+ AssertPositiveInteger(descriptor.itemSize, `${label}.itemSize`);
331
+ if (descriptor.maximumCount !== undefined) {
332
+ AssertPositiveInteger(descriptor.maximumCount, `${label}.maximumCount`);
333
+ }
334
+ ValidateValueDescriptor(descriptor.item, descriptor.itemSize, `${label}.item`);
335
+ } else if (type === CjsFsd64Binary.Type.MAP) {
336
+ ValidateMapDescriptor(descriptor, label);
337
+ }
338
+ }
339
+ function ValidatePresenceMask(field, presence, label) {
340
+ if (field.presenceMask === undefined) {
341
+ return;
342
+ }
343
+ if (!presence) {
344
+ throw SchemaError(`${label}.presenceMask requires record presence metadata.`);
345
+ }
346
+ AssertSafeMask(field.presenceMask, `${label}.presenceMask`);
347
+ if (field.presenceMask === 0 || !Number.isInteger(Math.log2(field.presenceMask))) {
348
+ throw SchemaError(`${label}.presenceMask must contain exactly one bit.`);
349
+ }
350
+ if ((field.presenceMask & presence.allowedMask) === 0) {
351
+ throw SchemaError(`${label}.presenceMask is outside the allowed presence mask.`);
352
+ }
353
+ }
354
+ function ResolveFsdType(type) {
355
+ if (typeof type !== "string" || !Object.hasOwn(CjsFsd64Binary.Type, type)) {
356
+ throw SchemaError(`Unknown FSD binary type: ${String(type)}`);
357
+ }
358
+ return CjsFsd64Binary.Type[type];
359
+ }
360
+ function AssertOffset(value, label) {
361
+ if (!Number.isSafeInteger(value) || value < 0) {
362
+ throw SchemaError(`${label} must be a non-negative safe integer.`);
363
+ }
364
+ }
365
+ function AssertPositiveInteger(value, label) {
366
+ if (!Number.isSafeInteger(value) || value < 1) {
367
+ throw SchemaError(`${label} must be a positive safe integer.`);
368
+ }
369
+ }
370
+ function AssertSafeMask(value, label) {
371
+ if (!Number.isSafeInteger(value) || value < 0) {
372
+ throw SchemaError(`${label} must be a non-negative safe-integer mask.`);
373
+ }
374
+ }
375
+ function IsPlainObject(value) {
376
+ if (value === null || typeof value !== "object") {
377
+ return false;
378
+ }
379
+ const prototype = Object.getPrototypeOf(value);
380
+ return prototype === Object.prototype || prototype === null;
381
+ }
382
+ function SchemaError(message) {
383
+ const error = new TypeError(message);
384
+ error.code = "CJS_FSD_BINARY_SCHEMA_INVALID";
385
+ return error;
386
+ }
387
+
388
+ export { CamelizeFieldName, CjsFsd64SchemaDecoder };
389
+ //# sourceMappingURL=CjsFsd64SchemaDecoder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CjsFsd64SchemaDecoder.js","sources":["../../../../../../src/formats/fsd/64/core/CjsFsd64SchemaDecoder.js"],"sourcesContent":["import { AssertFlags, ReadRequiredString } from \"./fsd64Records.js\";\nimport { CjsFsd64Binary } from \"./CjsFsd64Binary.js\";\n\nconst SCHEMA_NAME = \"carbonenginejs.fsdBinarySchema\";\nconst SCHEMA_VERSION = 1;\nconst TYPE_SIZES = {\n [CjsFsd64Binary.Type.BOOLEAN]: 1,\n [CjsFsd64Binary.Type.FLOAT_32]: 4,\n [CjsFsd64Binary.Type.FLOAT_64]: 8,\n [CjsFsd64Binary.Type.INT_32]: 4,\n [CjsFsd64Binary.Type.INT_32_IDENTIFIER]: 4,\n [CjsFsd64Binary.Type.LIST]: 8,\n [CjsFsd64Binary.Type.MAP]: 16,\n [CjsFsd64Binary.Type.STRING]: 8,\n [CjsFsd64Binary.Type.UINT_8]: 1,\n [CjsFsd64Binary.Type.UINT_32]: 4,\n [CjsFsd64Binary.Type.UINT_32_IDENTIFIER]: 4,\n [CjsFsd64Binary.Type.UINT_64]: 8,\n [CjsFsd64Binary.Type.UINT_64_IDENTIFIER]: 8,\n};\n\n/**\n * Validates declarative binary schemas and decodes caller-supplied bytes.\n */\nexport class CjsFsd64SchemaDecoder\n{\n /**\n * Validates and returns one inert JSON schema definition.\n */\n static defineSchema(schema)\n {\n ValidateSchema(schema);\n return schema;\n }\n\n /**\n * Decodes a schema-defined value using the established private reader\n * contract: Maps and numeric identifier values.\n */\n static read(bytes, schema)\n {\n return DecodeRoot(bytes, schema, false);\n }\n\n /**\n * Decodes a schema-defined value to plain JSON-compatible objects.\n * Identifier keys and values are emitted as lossless decimal strings.\n */\n static readJSON(bytes, schema)\n {\n return DecodeRoot(bytes, schema, true);\n }\n}\n\nfunction DecodeRoot(bytes, schema, json)\n{\n ValidateSchema(schema);\n\n const binary = new CjsFsd64Binary(bytes, {\n path: schema.path,\n schemaID: [ schema.schemaID, ...(schema.acceptedSchemaIDs ?? []) ],\n });\n const containerOffset = binary.RootOffset + (schema.container.offset ?? 0);\n\n // A root OBJECT is how a dataset that publishes several independent maps is\n // described, such as audio metadata's events, sound banks and WEM files.\n return ResolveFsdType(schema.container.type) === CjsFsd64Binary.Type.OBJECT\n ? DecodeObject(binary, containerOffset, schema.container, json, schema.path)\n : DecodeMap(binary, containerOffset, schema.container, json, schema.path);\n}\n\nfunction DecodeValue(binary, baseOffset, descriptor, json, path, field)\n{\n const type = ResolveFsdType(descriptor.type);\n const offset = baseOffset + (descriptor.offset ?? 0);\n\n switch (type)\n {\n case CjsFsd64Binary.Type.BOOLEAN:\n return (binary.Byte(offset) & (1 << (descriptor.bit ?? 0))) !== 0;\n\n case CjsFsd64Binary.Type.FLOAT_32:\n return binary.Float32(offset);\n\n case CjsFsd64Binary.Type.FLOAT_64:\n return binary.Float64(offset);\n\n case CjsFsd64Binary.Type.INT_32:\n return binary.Int32(offset);\n\n case CjsFsd64Binary.Type.INT_32_IDENTIFIER:\n return FormatIdentifier(binary.Int32(offset), json);\n\n case CjsFsd64Binary.Type.LIST:\n return DecodeList(binary, offset, descriptor, json, path, field);\n\n case CjsFsd64Binary.Type.MAP:\n return DecodeMap(binary, offset, descriptor, json, path);\n\n case CjsFsd64Binary.Type.OBJECT:\n return DecodeObject(binary, offset, descriptor, json, path);\n\n case CjsFsd64Binary.Type.STRING:\n return ReadRequiredString(binary, offset, path, field);\n\n case CjsFsd64Binary.Type.UINT_8:\n return binary.Byte(offset);\n\n case CjsFsd64Binary.Type.UINT_32:\n return binary.Uint32(offset);\n\n case CjsFsd64Binary.Type.UINT_32_IDENTIFIER:\n return FormatIdentifier(binary.Uint32(offset), json);\n\n case CjsFsd64Binary.Type.UINT_64:\n return binary.Uint64(offset);\n\n case CjsFsd64Binary.Type.UINT_64_IDENTIFIER:\n return json ? binary.Uint64Identity(offset) : binary.Uint64(offset);\n\n default:\n throw SchemaError(`Unsupported FSD binary type: ${descriptor.type}`);\n }\n}\n\nfunction DecodeObject(binary, baseOffset, descriptor, json, path)\n{\n const flags = descriptor.presence\n ? DecodeValue(binary, baseOffset, descriptor.presence, false, path, \"<presence>\")\n : 0;\n\n if (descriptor.presence)\n {\n AssertFlags(flags, descriptor.presence.allowedMask, path);\n }\n\n const value = {};\n\n for (const field of descriptor.fields)\n {\n if (field.presenceMask !== undefined && (flags & field.presenceMask) === 0)\n {\n continue;\n }\n\n DefineValue(value, field.name, DecodeValue(\n binary,\n baseOffset,\n field,\n json,\n path,\n field.name,\n ));\n }\n\n return value;\n}\n\nfunction DecodeList(binary, pointerOffset, descriptor, json, path, field)\n{\n const relativeOffset = binary.Uint64(pointerOffset);\n const offsets = binary.ListEntries(\n relativeOffset,\n descriptor.itemSize,\n descriptor.maximumCount ?? Number.MAX_SAFE_INTEGER,\n );\n\n return offsets.map(offset => DecodeValue(\n binary,\n offset,\n descriptor.item,\n json,\n path,\n `${field}[]`,\n ));\n}\n\nfunction DecodeMap(binary, headerOffset, descriptor, json, path)\n{\n const entries = [];\n\n for (const recordOffset of binary.MapEntries(descriptor.recordSize, headerOffset))\n {\n const key = DecodeValue(binary, recordOffset, descriptor.key, json, path, \"<key>\");\n const value = descriptor.value\n ? DecodeValue(binary, recordOffset, descriptor.value, json, path, \"<value>\")\n : DecodeObject(\n binary,\n recordOffset + (descriptor.recordOffset ?? 0),\n descriptor,\n json,\n path,\n );\n entries.push([ key, value ]);\n }\n\n return json\n ? CreateJSONObject(entries, path, descriptor.key.type)\n : CreateMap(entries, path);\n}\n\nfunction FormatIdentifier(value, json)\n{\n return json ? value.toString(10) : value;\n}\n\nfunction CreateMap(entries, path)\n{\n const result = new Map();\n\n for (const [ key, value ] of entries)\n {\n if (result.has(key))\n {\n throw DuplicateKeyError(key, path);\n }\n\n result.set(key, value);\n }\n\n return result;\n}\n\nfunction CreateJSONObject(entries, path, keyType)\n{\n entries.sort(([ left ], [ right ]) => CompareKeys(left, right, keyType));\n const result = {};\n\n for (const [ key, value ] of entries)\n {\n const property = String(key);\n\n if (Object.hasOwn(result, property))\n {\n throw DuplicateKeyError(property, path);\n }\n\n DefineValue(result, property, value);\n }\n\n return result;\n}\n\nfunction CompareKeys(left, right, type)\n{\n if (IsIntegerType(type))\n {\n const leftValue = BigInt(left);\n const rightValue = BigInt(right);\n return leftValue < rightValue ? -1 : leftValue > rightValue ? 1 : 0;\n }\n\n const leftValue = String(left);\n const rightValue = String(right);\n return leftValue < rightValue ? -1 : leftValue > rightValue ? 1 : 0;\n}\n\nfunction IsIntegerType(type)\n{\n return type === CjsFsd64Binary.Type.INT_32 ||\n type === CjsFsd64Binary.Type.INT_32_IDENTIFIER ||\n type === CjsFsd64Binary.Type.UINT_8 ||\n type === CjsFsd64Binary.Type.UINT_32 ||\n type === CjsFsd64Binary.Type.UINT_32_IDENTIFIER ||\n type === CjsFsd64Binary.Type.UINT_64 ||\n type === CjsFsd64Binary.Type.UINT_64_IDENTIFIER;\n}\n\nfunction DefineValue(target, property, value)\n{\n Object.defineProperty(target, property, {\n configurable: true,\n enumerable: true,\n value,\n writable: true,\n });\n}\n\nfunction DuplicateKeyError(key, path)\n{\n const error = new Error(`Duplicate FSD map key in ${path}: ${key}`);\n error.code = \"CJS_FSD_DUPLICATE_KEY\";\n error.key = key;\n error.path = path;\n return error;\n}\n\nfunction ValidateSchema(schema)\n{\n if (!IsPlainObject(schema) || schema.schema !== SCHEMA_NAME ||\n schema.schemaVersion !== SCHEMA_VERSION)\n {\n throw SchemaError(\n `FSD binary schema must be ${SCHEMA_NAME} version ${SCHEMA_VERSION}.`,\n );\n }\n\n if (typeof schema.path !== \"string\" || schema.path.trim() === \"\")\n {\n throw SchemaError(\"FSD binary schema path must be a non-empty string.\");\n }\n\n if (typeof schema.name !== \"string\" || schema.name.trim() === \"\")\n {\n throw SchemaError(\"FSD binary schema name must be a non-empty string.\");\n }\n\n // 32 characters pin the layout alone, which survives a content change and\n // another publisher's build; 48 additionally pin one build's content digest.\n if (typeof schema.schemaID !== \"string\" || !/^(?:[0-9a-f]{32}|[0-9a-f]{48})$/iu.test(schema.schemaID))\n {\n throw SchemaError(\"FSD binary schema identity must contain 32 or 48 hexadecimal characters.\");\n }\n\n // A schema identity is not a hash of the byte layout alone, so one layout\n // can carry two of them across publishers. Additional identities are\n // accepted only where the layout was measured to be the same.\n if (schema.acceptedSchemaIDs !== undefined)\n {\n if (!Array.isArray(schema.acceptedSchemaIDs) ||\n schema.acceptedSchemaIDs.some(value =>\n typeof value !== \"string\" || !/^(?:[0-9a-f]{32}|[0-9a-f]{48})$/iu.test(value)))\n {\n throw SchemaError(\n \"FSD binary accepted schema identities must be 32 or 48 hexadecimal characters each.\",\n );\n }\n }\n\n if (!IsPlainObject(schema.container))\n {\n throw SchemaError(\"FSD binary schema root must be a MAP or an OBJECT.\");\n }\n\n const rootType = ResolveFsdType(schema.container.type);\n\n if (rootType !== CjsFsd64Binary.Type.MAP && rootType !== CjsFsd64Binary.Type.OBJECT)\n {\n throw SchemaError(\"FSD binary schema root must be a MAP or an OBJECT.\");\n }\n\n AssertOffset(schema.container.offset ?? 0, \"container.offset\");\n\n if (rootType === CjsFsd64Binary.Type.OBJECT)\n {\n AssertPositiveInteger(schema.container.headerSize, \"container.headerSize\");\n ValidateObjectDescriptor(schema.container, schema.container.headerSize, \"container\");\n\n return;\n }\n\n ValidateMapDescriptor(schema.container, \"container\");\n}\n\nfunction ValidateMapDescriptor(descriptor, label)\n{\n AssertPositiveInteger(descriptor.recordSize, `${label}.recordSize`);\n ValidateValueDescriptor(descriptor.key, descriptor.recordSize, `${label}.key`);\n\n if (descriptor.value !== undefined)\n {\n if (descriptor.fields !== undefined || descriptor.presence !== undefined ||\n descriptor.recordOffset !== undefined)\n {\n throw SchemaError(`${label} cannot combine value with object record metadata.`);\n }\n\n ValidateValueDescriptor(descriptor.value, descriptor.recordSize, `${label}.value`);\n return;\n }\n\n const recordOffset = descriptor.recordOffset ?? 0;\n AssertOffset(recordOffset, `${label}.recordOffset`);\n\n if (recordOffset > descriptor.recordSize)\n {\n throw SchemaError(`${label}.recordOffset exceeds the record size.`);\n }\n\n ValidateObjectDescriptor(\n descriptor,\n descriptor.recordSize - recordOffset,\n label,\n );\n}\n\nfunction ValidateObjectDescriptor(descriptor, availableSize, label)\n{\n if (!Array.isArray(descriptor.fields))\n {\n throw SchemaError(`${label}.fields must be an array.`);\n }\n\n if (descriptor.presence !== undefined)\n {\n ValidateValueDescriptor(descriptor.presence, availableSize, `${label}.presence`);\n const presenceType = ResolveFsdType(descriptor.presence.type);\n\n if (presenceType !== CjsFsd64Binary.Type.UINT_32 &&\n presenceType !== CjsFsd64Binary.Type.UINT_64)\n {\n throw SchemaError(`${label}.presence must use UINT_32 or UINT_64.`);\n }\n\n AssertSafeMask(descriptor.presence.allowedMask, `${label}.presence.allowedMask`);\n }\n\n const names = new Set();\n let previousOffset = -1;\n\n for (let index = 0; index < descriptor.fields.length; index++)\n {\n const field = descriptor.fields[index];\n const fieldLabel = `${label}.fields[${index}]`;\n ValidateValueDescriptor(field, availableSize, fieldLabel);\n\n const offset = field.offset ?? 0;\n\n if (offset < previousOffset)\n {\n throw SchemaError(`${label}.fields must be ordered by byte offset.`);\n }\n\n previousOffset = offset;\n\n if (typeof field.name !== \"string\" || field.name === \"\")\n {\n throw SchemaError(`${fieldLabel}.name must be a non-empty string.`);\n }\n\n if (names.has(field.name))\n {\n throw SchemaError(`FSD binary schema field is duplicated: ${field.name}`);\n }\n\n names.add(field.name);\n ValidateSourceName(field, fieldLabel);\n ValidatePresenceMask(field, descriptor.presence, fieldLabel);\n }\n}\n\n/**\n * Converts a client field name to the name the export publishes.\n *\n * The newer datasets name fields in snake_case and CCP's exporter camelCases\n * them, with one wrinkle worth writing down rather than remembering: a trailing\n * `id` segment becomes `ID`, so `type_id` is published as `typeID` and not\n * `typeId`. That rule was applied by hand across the SKINR schemas before it\n * was written anywhere, and by hand it was applied inconsistently.\n *\n * @param {string} sourceName Field name as the client stores it.\n * @returns {string} Field name as the export publishes it.\n */\nexport function CamelizeFieldName(sourceName)\n{\n return String(sourceName)\n .split(\"_\")\n .map((segment, index) =>\n {\n if (segment.toLowerCase() === \"id\") return \"ID\";\n\n return index === 0 ? segment : segment.charAt(0).toUpperCase() + segment.slice(1);\n })\n .join(\"\");\n}\n\n/**\n * Checks a field's name against the client's own name for it.\n *\n * A schema may record `sourceName`, the name the loader gives the field. When\n * it does, the decoded name must be the mechanical conversion of it - which is\n * what makes the conversion checkable rather than a transcription nobody can\n * audit. A field that departs deliberately, such as a label identifier the\n * export republishes as resolved text, declares `renamed: true` and says why in\n * the reader.\n */\nfunction ValidateSourceName(descriptor, label)\n{\n if (descriptor.sourceName === undefined) return;\n\n if (typeof descriptor.sourceName !== \"string\" || descriptor.sourceName === \"\")\n {\n throw SchemaError(`${label}.sourceName must be a non-empty string.`);\n }\n\n if (descriptor.renamed === true) return;\n\n const expected = CamelizeFieldName(descriptor.sourceName);\n\n if (descriptor.name !== expected)\n {\n throw SchemaError(\n `${label} is named ${descriptor.name} but its source ${descriptor.sourceName} `\n + `converts to ${expected}. Set renamed: true if the departure is deliberate.`,\n );\n }\n}\n\nfunction ValidateValueDescriptor(descriptor, availableSize, label)\n{\n if (!IsPlainObject(descriptor))\n {\n throw SchemaError(`${label} must be an object.`);\n }\n\n const type = ResolveFsdType(descriptor.type);\n\n if (type === CjsFsd64Binary.Type.OBJECT)\n {\n const offset = descriptor.offset ?? 0;\n AssertOffset(offset, `${label}.offset`);\n\n if (offset > availableSize)\n {\n throw SchemaError(`${label}.offset exceeds its containing record.`);\n }\n\n ValidateObjectDescriptor(descriptor, availableSize - offset, label);\n return;\n }\n\n AssertOffset(descriptor.offset, `${label}.offset`);\n\n if (descriptor.offset + TYPE_SIZES[type] > availableSize)\n {\n throw SchemaError(`${label} exceeds its ${availableSize}-byte record.`);\n }\n\n if (type === CjsFsd64Binary.Type.LIST)\n {\n AssertPositiveInteger(descriptor.itemSize, `${label}.itemSize`);\n\n if (descriptor.maximumCount !== undefined)\n {\n AssertPositiveInteger(descriptor.maximumCount, `${label}.maximumCount`);\n }\n\n ValidateValueDescriptor(descriptor.item, descriptor.itemSize, `${label}.item`);\n }\n else if (type === CjsFsd64Binary.Type.MAP)\n {\n ValidateMapDescriptor(descriptor, label);\n }\n}\n\nfunction ValidatePresenceMask(field, presence, label)\n{\n if (field.presenceMask === undefined)\n {\n return;\n }\n\n if (!presence)\n {\n throw SchemaError(`${label}.presenceMask requires record presence metadata.`);\n }\n\n AssertSafeMask(field.presenceMask, `${label}.presenceMask`);\n\n if (field.presenceMask === 0 ||\n !Number.isInteger(Math.log2(field.presenceMask)))\n {\n throw SchemaError(`${label}.presenceMask must contain exactly one bit.`);\n }\n\n if ((field.presenceMask & presence.allowedMask) === 0)\n {\n throw SchemaError(`${label}.presenceMask is outside the allowed presence mask.`);\n }\n}\n\nfunction ResolveFsdType(type)\n{\n if (typeof type !== \"string\" || !Object.hasOwn(CjsFsd64Binary.Type, type))\n {\n throw SchemaError(`Unknown FSD binary type: ${String(type)}`);\n }\n\n return CjsFsd64Binary.Type[type];\n}\n\nfunction AssertOffset(value, label)\n{\n if (!Number.isSafeInteger(value) || value < 0)\n {\n throw SchemaError(`${label} must be a non-negative safe integer.`);\n }\n}\n\nfunction AssertPositiveInteger(value, label)\n{\n if (!Number.isSafeInteger(value) || value < 1)\n {\n throw SchemaError(`${label} must be a positive safe integer.`);\n }\n}\n\nfunction AssertSafeMask(value, label)\n{\n if (!Number.isSafeInteger(value) || value < 0)\n {\n throw SchemaError(`${label} must be a non-negative safe-integer mask.`);\n }\n}\n\nfunction IsPlainObject(value)\n{\n if (value === null || typeof value !== \"object\")\n {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\n\nfunction SchemaError(message)\n{\n const error = new TypeError(message);\n error.code = \"CJS_FSD_BINARY_SCHEMA_INVALID\";\n return error;\n}\n\nexport default CjsFsd64SchemaDecoder;\n"],"names":["SCHEMA_NAME","SCHEMA_VERSION","TYPE_SIZES","CjsFsd64Binary","Type","BOOLEAN","FLOAT_32","FLOAT_64","INT_32","INT_32_IDENTIFIER","LIST","MAP","STRING","UINT_8","UINT_32","UINT_32_IDENTIFIER","UINT_64","UINT_64_IDENTIFIER","CjsFsd64SchemaDecoder","defineSchema","schema","ValidateSchema","read","bytes","DecodeRoot","readJSON","json","binary","path","schemaID","acceptedSchemaIDs","containerOffset","RootOffset","container","offset","ResolveFsdType","type","OBJECT","DecodeObject","DecodeMap","DecodeValue","baseOffset","descriptor","field","Byte","bit","Float32","Float64","Int32","FormatIdentifier","DecodeList","ReadRequiredString","Uint32","Uint64","Uint64Identity","SchemaError","flags","presence","AssertFlags","allowedMask","value","fields","presenceMask","undefined","DefineValue","name","pointerOffset","relativeOffset","offsets","ListEntries","itemSize","maximumCount","Number","MAX_SAFE_INTEGER","map","item","headerOffset","entries","recordOffset","MapEntries","recordSize","key","push","CreateJSONObject","CreateMap","toString","result","Map","has","DuplicateKeyError","set","keyType","sort","left","right","CompareKeys","property","String","Object","hasOwn","IsIntegerType","leftValue","BigInt","rightValue","target","defineProperty","configurable","enumerable","writable","error","Error","code","IsPlainObject","schemaVersion","trim","test","Array","isArray","some","rootType","AssertOffset","AssertPositiveInteger","headerSize","ValidateObjectDescriptor","ValidateMapDescriptor","label","ValidateValueDescriptor","availableSize","presenceType","AssertSafeMask","names","Set","previousOffset","index","length","fieldLabel","add","ValidateSourceName","ValidatePresenceMask","CamelizeFieldName","sourceName","split","segment","toLowerCase","charAt","toUpperCase","slice","join","renamed","expected","isInteger","Math","log2","isSafeInteger","prototype","getPrototypeOf","message","TypeError"],"mappings":";;;AAGA,MAAMA,WAAW,GAAG,gCAAgC;AACpD,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,UAAU,GAAG;AACf,EAAA,CAACC,cAAc,CAACC,IAAI,CAACC,OAAO,GAAG,CAAC;AAChC,EAAA,CAACF,cAAc,CAACC,IAAI,CAACE,QAAQ,GAAG,CAAC;AACjC,EAAA,CAACH,cAAc,CAACC,IAAI,CAACG,QAAQ,GAAG,CAAC;AACjC,EAAA,CAACJ,cAAc,CAACC,IAAI,CAACI,MAAM,GAAG,CAAC;AAC/B,EAAA,CAACL,cAAc,CAACC,IAAI,CAACK,iBAAiB,GAAG,CAAC;AAC1C,EAAA,CAACN,cAAc,CAACC,IAAI,CAACM,IAAI,GAAG,CAAC;AAC7B,EAAA,CAACP,cAAc,CAACC,IAAI,CAACO,GAAG,GAAG,EAAE;AAC7B,EAAA,CAACR,cAAc,CAACC,IAAI,CAACQ,MAAM,GAAG,CAAC;AAC/B,EAAA,CAACT,cAAc,CAACC,IAAI,CAACS,MAAM,GAAG,CAAC;AAC/B,EAAA,CAACV,cAAc,CAACC,IAAI,CAACU,OAAO,GAAG,CAAC;AAChC,EAAA,CAACX,cAAc,CAACC,IAAI,CAACW,kBAAkB,GAAG,CAAC;AAC3C,EAAA,CAACZ,cAAc,CAACC,IAAI,CAACY,OAAO,GAAG,CAAC;AAChC,EAAA,CAACb,cAAc,CAACC,IAAI,CAACa,kBAAkB,GAAG;AAC9C,CAAC;;AAED;AACA;AACA;AACO,MAA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AAO8F,SAAS,KAAKxD,MAAM,CAACwD,SAAS,IAAIA,SAAS,KAAK,IAAI;AAC/D;AAEA,SAASnG,WAAWA,CAACqG,OAAO,EAC5B;AACI,EAAA,MAAM/C,KAAK,GAAG,IAAIgD,SAAS,CAACD,OAAO,CAAC;EACpC/C,KAAK,CAACE,IAAI,GAAG,+BAA+B;AAC5C,EAAA,OAAOF,KAAK;AAChB;;;;"}
@@ -0,0 +1,43 @@
1
+ import { CjsFsd64SchemaDecoder } from './CjsFsd64SchemaDecoder.js';
2
+
3
+ /**
4
+ * Base class for file-specific readers defined by JSON-shaped JavaScript layouts.
5
+ */
6
+ class CjsFsd64SchemaReader {
7
+ /**
8
+ * Decodes bytes to the existing private Map-based reader representation.
9
+ */
10
+ Read(bytes) {
11
+ return CjsFsd64SchemaDecoder.read(bytes, this.constructor.getFsdSchema());
12
+ }
13
+
14
+ /**
15
+ * Decodes bytes to a plain JSON-compatible value with lossless identities.
16
+ */
17
+ ReadJSON(bytes) {
18
+ return CjsFsd64SchemaDecoder.readJSON(bytes, this.constructor.getFsdSchema());
19
+ }
20
+
21
+ /** Returns the binary-layout schema owned by a reader class. */
22
+ static getFsdSchema() {
23
+ throw new Error("FSD schema reader must define static getFsdSchema().");
24
+ }
25
+
26
+ /** Bind one inline schema to a subclass-owned getFsdSchema function. */
27
+ static bindFsdSchema(schema) {
28
+ return () => schema;
29
+ }
30
+
31
+ /** Returns the logical resource path declared by the schema. */
32
+ static get path() {
33
+ return this.getFsdSchema().path;
34
+ }
35
+
36
+ /** Returns the binary schema identity declared by the schema. */
37
+ static get schemaID() {
38
+ return this.getFsdSchema().schemaID;
39
+ }
40
+ }
41
+
42
+ export { CjsFsd64SchemaReader };
43
+ //# sourceMappingURL=CjsFsd64SchemaReader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CjsFsd64SchemaReader.js","sources":["../../../../../../src/formats/fsd/64/core/CjsFsd64SchemaReader.js"],"sourcesContent":["import { CjsFsd64SchemaDecoder } from \"./CjsFsd64SchemaDecoder.js\";\n\n/**\n * Base class for file-specific readers defined by JSON-shaped JavaScript layouts.\n */\nexport class CjsFsd64SchemaReader\n{\n /**\n * Decodes bytes to the existing private Map-based reader representation.\n */\n Read(bytes)\n {\n return CjsFsd64SchemaDecoder.read(bytes, this.constructor.getFsdSchema());\n }\n\n /**\n * Decodes bytes to a plain JSON-compatible value with lossless identities.\n */\n ReadJSON(bytes)\n {\n return CjsFsd64SchemaDecoder.readJSON(bytes, this.constructor.getFsdSchema());\n }\n\n /** Returns the binary-layout schema owned by a reader class. */\n static getFsdSchema()\n {\n throw new Error(\"FSD schema reader must define static getFsdSchema().\");\n }\n\n /** Bind one inline schema to a subclass-owned getFsdSchema function. */\n static bindFsdSchema(schema)\n {\n return () => schema;\n }\n\n /** Returns the logical resource path declared by the schema. */\n static get path()\n {\n return this.getFsdSchema().path;\n }\n\n /** Returns the binary schema identity declared by the schema. */\n static get schemaID()\n {\n return this.getFsdSchema().schemaID;\n }\n\n}\n\nexport default CjsFsd64SchemaReader;\n"],"names":["CjsFsd64SchemaReader","Read","bytes","CjsFsd64SchemaDecoder","read","constructor","getFsdSchema","ReadJSON","readJSON","Error","bindFsdSchema","schema","path","schemaID"],"mappings":";;AAEA;AACA;AACA;AACO,MAAMA,oBAAoB,CACjC;AACI;AACJ;AACA;EACIC,IAAIA,CAACC,KAAK,EACV;AACI,IAAA,OAAOC,qBAAqB,CAACC,IAAI,CAACF,KAAK,EAAE,IAAI,CAACG,WAAW,CAACC,YAAY,EAAE,CAAC;AAC7E,EAAA;;AAEA;AACJ;AACA;EACIC,QAAQA,CAACL,KAAK,EACd;AACI,IAAA,OAAOC,qBAAqB,CAACK,QAAQ,CAACN,KAAK,EAAE,IAAI,CAACG,WAAW,CAACC,YAAY,EAAE,CAAC;AACjF,EAAA;;AAEA;EACA,OAAOA,YAAYA,GACnB;AACI,IAAA,MAAM,IAAIG,KAAK,CAAC,sDAAsD,CAAC;AAC3E,EAAA;;AAEA;EACA,OAAOC,aAAaA,CAACC,MAAM,EAC3B;AACI,IAAA,OAAO,MAAMA,MAAM;AACvB,EAAA;;AAEA;EACA,WAAWC,IAAIA,GACf;AACI,IAAA,OAAO,IAAI,CAACN,YAAY,EAAE,CAACM,IAAI;AACnC,EAAA;;AAEA;EACA,WAAWC,QAAQA,GACnB;AACI,IAAA,OAAO,IAAI,CAACP,YAAY,EAAE,CAACO,QAAQ;AACvC,EAAA;AAEJ;;;;"}
@@ -0,0 +1,60 @@
1
+ import { CjsFsd64Binary } from './CjsFsd64Binary.js';
2
+
3
+ /** Decodes one map using a caller-supplied fixed-record function. */
4
+ function ReadFsdMap(bytes, options, readRecord) {
5
+ const binary = new CjsFsd64Binary(bytes, options);
6
+ const result = new Map();
7
+ for (const offset of binary.MapEntries(options.recordSize)) {
8
+ const [key, value] = readRecord(binary, offset);
9
+ if (result.has(key)) {
10
+ const error = new Error(`Duplicate FSD map key in ${options.path}: ${key}`);
11
+ error.code = "CJS_FSD_DUPLICATE_KEY";
12
+ error.key = key;
13
+ error.path = options.path;
14
+ throw error;
15
+ }
16
+ result.set(key, value);
17
+ }
18
+ return result;
19
+ }
20
+
21
+ /** Reads a required UTF-8 field and reports its logical field identity on failure. */
22
+ function ReadRequiredString(binary, pointerOffset, path, field) {
23
+ const value = binary.Utf8StringAtDataPointer(binary.Uint64(pointerOffset));
24
+ if (value === null) {
25
+ const error = new Error(`Invalid FSD string for ${path} field ${field}.`);
26
+ error.code = "CJS_FSD_STRING_INVALID";
27
+ error.field = field;
28
+ error.path = path;
29
+ throw error;
30
+ }
31
+ return value;
32
+ }
33
+
34
+ /** Reads a required string-list field and reports its logical field identity on failure. */
35
+ function ReadRequiredStringList(binary, pointerOffset, path, field, maximumCount = 100) {
36
+ const value = binary.StringList(binary.Uint64(pointerOffset), maximumCount);
37
+ if (value === null) {
38
+ const error = new Error(`Invalid FSD string list for ${path} field ${field}.`);
39
+ error.code = "CJS_FSD_LIST_INVALID";
40
+ error.field = field;
41
+ error.path = path;
42
+ throw error;
43
+ }
44
+ return value;
45
+ }
46
+
47
+ /** Rejects presence flags outside a reader's supported mask. */
48
+ function AssertFlags(flags, mask, path) {
49
+ if ((flags & ~mask) !== 0) {
50
+ const error = new Error(`Unsupported FSD presence flags for ${path}: ${flags}`);
51
+ error.code = "CJS_FSD_FLAGS_UNSUPPORTED";
52
+ error.flags = flags;
53
+ error.mask = mask;
54
+ error.path = path;
55
+ throw error;
56
+ }
57
+ }
58
+
59
+ export { AssertFlags, ReadFsdMap, ReadRequiredString, ReadRequiredStringList };
60
+ //# sourceMappingURL=fsd64Records.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fsd64Records.js","sources":["../../../../../../src/formats/fsd/64/core/fsd64Records.js"],"sourcesContent":["import { CjsFsd64Binary } from \"./CjsFsd64Binary.js\";\n\n/** Decodes one map using a caller-supplied fixed-record function. */\nexport function ReadFsdMap(bytes, options, readRecord)\n{\n const binary = new CjsFsd64Binary(bytes, options);\n const result = new Map();\n\n for (const offset of binary.MapEntries(options.recordSize))\n {\n const [ key, value ] = readRecord(binary, offset);\n\n if (result.has(key))\n {\n const error = new Error(`Duplicate FSD map key in ${options.path}: ${key}`);\n error.code = \"CJS_FSD_DUPLICATE_KEY\";\n error.key = key;\n error.path = options.path;\n throw error;\n }\n\n result.set(key, value);\n }\n\n return result;\n}\n\n/** Reads a required UTF-8 field and reports its logical field identity on failure. */\nexport function ReadRequiredString(binary, pointerOffset, path, field)\n{\n const value = binary.Utf8StringAtDataPointer(binary.Uint64(pointerOffset));\n\n if (value === null)\n {\n const error = new Error(`Invalid FSD string for ${path} field ${field}.`);\n error.code = \"CJS_FSD_STRING_INVALID\";\n error.field = field;\n error.path = path;\n throw error;\n }\n\n return value;\n}\n\n/** Reads a required string-list field and reports its logical field identity on failure. */\nexport function ReadRequiredStringList(binary, pointerOffset, path, field, maximumCount = 100)\n{\n const value = binary.StringList(binary.Uint64(pointerOffset), maximumCount);\n\n if (value === null)\n {\n const error = new Error(`Invalid FSD string list for ${path} field ${field}.`);\n error.code = \"CJS_FSD_LIST_INVALID\";\n error.field = field;\n error.path = path;\n throw error;\n }\n\n return value;\n}\n\n/** Rejects presence flags outside a reader's supported mask. */\nexport function AssertFlags(flags, mask, path)\n{\n if ((flags & ~mask) !== 0)\n {\n const error = new Error(`Unsupported FSD presence flags for ${path}: ${flags}`);\n error.code = \"CJS_FSD_FLAGS_UNSUPPORTED\";\n error.flags = flags;\n error.mask = mask;\n error.path = path;\n throw error;\n }\n}\n"],"names":["ReadFsdMap","bytes","options","readRecord","binary","CjsFsd64Binary","result","Map","offset","MapEntries","recordSize","key","value","has","error","Error","path","code","set","ReadRequiredString","pointerOffset","field","Utf8StringAtDataPointer","Uint64","ReadRequiredStringList","maximumCount","StringList","AssertFlags","flags","mask"],"mappings":";;AAEA;AACO,SAASA,UAAUA,CAACC,KAAK,EAAEC,OAAO,EAAEC,UAAU,EACrD;EACI,MAAMC,MAAM,GAAG,IAAIC,cAAc,CAACJ,KAAK,EAAEC,OAAO,CAAC;AACjD,EAAA,MAAMI,MAAM,GAAG,IAAIC,GAAG,EAAE;EAExB,KAAK,MAAMC,MAAM,IAAIJ,MAAM,CAACK,UAAU,CAACP,OAAO,CAACQ,UAAU,CAAC,EAC1D;IACI,MAAM,CAAEC,GAAG,EAAEC,KAAK,CAAE,GAAGT,UAAU,CAACC,MAAM,EAAEI,MAAM,CAAC;AAEjD,IAAA,IAAIF,MAAM,CAACO,GAAG,CAACF,GAAG,CAAC,EACnB;AACI,MAAA,MAAMG,KAAK,GAAG,IAAIC,KAAK,CAAC,CAAA,yBAAA,EAA4Bb,OAAO,CAACc,IAAI,CAAA,EAAA,EAAKL,GAAG,CAAA,CAAE,CAAC;MAC3EG,KAAK,CAACG,IAAI,GAAG,uBAAuB;MACpCH,KAAK,CAACH,GAAG,GAAGA,GAAG;AACfG,MAAAA,KAAK,CAACE,IAAI,GAAGd,OAAO,CAACc,IAAI;AACzB,MAAA,MAAMF,KAAK;A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AK,EAAEC,IAAI,EAAEb,IAAI,EAC7C;AACI,EAAA,IAAI,CAACY,KAAK,GAAG,CAACC,IAAI,MAAM,CAAC,EACzB;IACI,MAAMf,KAAK,GAAG,IAAIC,KAAK,CAAC,sCAAsCC,IAAI,CAAA,EAAA,EAAKY,KAAK,CAAA,CAAE,CAAC;IAC/Ed,KAAK,CAACG,IAAI,GAAG,2BAA2B;IACxCH,KAAK,CAACc,KAAK,GAAGA,KAAK;IACnBd,KAAK,CAACe,IAAI,GAAGA,IAAI;IACjBf,KAAK,CAACE,IAAI,GAAGA,IAAI;AACjB,IAAA,MAAMF,KAAK;AACf,EAAA;AACJ;;;;"}
@@ -0,0 +1,7 @@
1
+ export { CjsFsd64Format, CjsFsd64Format as default } from './CjsFsd64Format.js';
2
+ export { CjsFsd64Binary } from './core/CjsFsd64Binary.js';
3
+ export { CjsFsd64Reader } from './core/CjsFsd64Reader.js';
4
+ export { CjsFsd64SchemaDecoder } from './core/CjsFsd64SchemaDecoder.js';
5
+ export { CjsFsd64SchemaReader } from './core/CjsFsd64SchemaReader.js';
6
+ export { AssertFlags, ReadFsdMap, ReadRequiredString, ReadRequiredStringList } from './core/fsd64Records.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -0,0 +1,33 @@
1
+ import ancestriesReader from './CjsFsd64SchemaAncestries.js';
2
+ import archetypesReader from './CjsFsd64SchemaArchetypes.js';
3
+ import bloodlinesReader from './CjsFsd64SchemaBloodlines.js';
4
+ import characterAvatarBehaviorsReader from './CjsFsd64SchemaCharacterAvatarBehaviors.js';
5
+ import characterColorLocationsReader from './CjsFsd64SchemaCharacterColorLocations.js';
6
+ import characterColorNamesReader from './CjsFsd64SchemaCharacterColorNames.js';
7
+ import characterModifierLocationsReader from './CjsFsd64SchemaCharacterModifierLocations.js';
8
+ import characterPortraitResourcesReader from './CjsFsd64SchemaCharacterPortraitResources.js';
9
+ import characterResourcesReader from './CjsFsd64SchemaCharacterResources.js';
10
+ import characterSculptingLocationsReader from './CjsFsd64SchemaCharacterSculptingLocations.js';
11
+ import paperdollsReader from './CjsFsd64SchemaPaperdolls.js';
12
+ import racesReader from './CjsFsd64SchemaRaces.js';
13
+
14
+ const CHARACTER_STATIC_DATA_READERS = [ancestriesReader, archetypesReader, bloodlinesReader, characterAvatarBehaviorsReader, characterColorLocationsReader, characterColorNamesReader, characterModifierLocationsReader, characterPortraitResourcesReader, characterResourcesReader, characterSculptingLocationsReader, paperdollsReader, racesReader];
15
+ const CHARACTER_STATIC_DATA_PATHS = CHARACTER_STATIC_DATA_READERS.map(reader => reader.constructor.path);
16
+
17
+ /**
18
+ * File-specific character/staticdata readers.
19
+ */
20
+ class CjsFsd64ReaderSetCharacterStaticData {
21
+ static create() {
22
+ return [...CHARACTER_STATIC_DATA_READERS];
23
+ }
24
+ static registerAll(registry) {
25
+ for (const reader of this.create()) {
26
+ registry.Register(reader.constructor.path, reader);
27
+ }
28
+ return registry;
29
+ }
30
+ }
31
+
32
+ export { CHARACTER_STATIC_DATA_PATHS, CjsFsd64ReaderSetCharacterStaticData };
33
+ //# sourceMappingURL=CjsFsd64ReaderSetCharacterStaticData.js.map