@carbonenginejs/runtime-resource 0.1.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 (372) hide show
  1. package/FORMAT-PROVENANCE.md +135 -0
  2. package/LICENSE +21 -0
  3. package/NOTICE +29 -0
  4. package/README.md +241 -0
  5. package/dist/CjsMotherLode.js +56 -0
  6. package/dist/CjsMotherLode.js.map +1 -0
  7. package/dist/CjsResMan.js +740 -0
  8. package/dist/CjsResMan.js.map +1 -0
  9. package/dist/CjsResManQueue.js +214 -0
  10. package/dist/CjsResManQueue.js.map +1 -0
  11. package/dist/CjsResource.js +366 -0
  12. package/dist/CjsResource.js.map +1 -0
  13. package/dist/CjsResourceSource.js +59 -0
  14. package/dist/CjsResourceSource.js.map +1 -0
  15. package/dist/_virtual/_rollupPluginBabelHelpers.js +153 -0
  16. package/dist/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
  17. package/dist/format/CjsFormat.js +178 -0
  18. package/dist/format/CjsFormat.js.map +1 -0
  19. package/dist/format/CjsResourceProbe.js +269 -0
  20. package/dist/format/CjsResourceProbe.js.map +1 -0
  21. package/dist/format/payloadContract.js +173 -0
  22. package/dist/format/payloadContract.js.map +1 -0
  23. package/dist/formats/black/CjsBlackFormat.js +272 -0
  24. package/dist/formats/black/CjsBlackFormat.js.map +1 -0
  25. package/dist/formats/black/core/CjsBlackBinaryReader.js +153 -0
  26. package/dist/formats/black/core/CjsBlackBinaryReader.js.map +1 -0
  27. package/dist/formats/black/core/CjsBlackPropertyReaders.js +382 -0
  28. package/dist/formats/black/core/CjsBlackPropertyReaders.js.map +1 -0
  29. package/dist/formats/black/core/CjsBlackReader.js +760 -0
  30. package/dist/formats/black/core/CjsBlackReader.js.map +1 -0
  31. package/dist/formats/black/core/CjsBlackSchemaRegistry.js +433 -0
  32. package/dist/formats/black/core/CjsBlackSchemaRegistry.js.map +1 -0
  33. package/dist/formats/black/core/black-schema-v1-2026-07-11.json.js +4 -0
  34. package/dist/formats/black/core/black-schema-v1-2026-07-11.json.js.map +1 -0
  35. package/dist/formats/black/core/blackConstants.js +7 -0
  36. package/dist/formats/black/core/blackConstants.js.map +1 -0
  37. package/dist/formats/black/core/blackDefinitions.js +10 -0
  38. package/dist/formats/black/core/blackDefinitions.js.map +1 -0
  39. package/dist/formats/black/core/blackEnums.js +6 -0
  40. package/dist/formats/black/core/blackEnums.js.map +1 -0
  41. package/dist/formats/black/core/blackSchema.js +3 -0
  42. package/dist/formats/black/core/blackSchema.js.map +1 -0
  43. package/dist/formats/black/core/blackVersion.js +22 -0
  44. package/dist/formats/black/core/blackVersion.js.map +1 -0
  45. package/dist/formats/black/core/helpers.js +182 -0
  46. package/dist/formats/black/core/helpers.js.map +1 -0
  47. package/dist/formats/black/core/schema.js +4 -0
  48. package/dist/formats/black/core/schema.js.map +1 -0
  49. package/dist/formats/black/index.js +2 -0
  50. package/dist/formats/black/index.js.map +1 -0
  51. package/dist/formats/bnk/CjsBnkFormat.js +245 -0
  52. package/dist/formats/bnk/CjsBnkFormat.js.map +1 -0
  53. package/dist/formats/bnk/core/helpers.js +354 -0
  54. package/dist/formats/bnk/core/helpers.js.map +1 -0
  55. package/dist/formats/bnk/core/soundbanksInfo.js +246 -0
  56. package/dist/formats/bnk/core/soundbanksInfo.js.map +1 -0
  57. package/dist/formats/bnk/index.js +3 -0
  58. package/dist/formats/bnk/index.js.map +1 -0
  59. package/dist/formats/cmf/CjsCmfFormat.js +491 -0
  60. package/dist/formats/cmf/CjsCmfFormat.js.map +1 -0
  61. package/dist/formats/cmf/core/binary.js +118 -0
  62. package/dist/formats/cmf/core/binary.js.map +1 -0
  63. package/dist/formats/cmf/core/buffers.js +233 -0
  64. package/dist/formats/cmf/core/buffers.js.map +1 -0
  65. package/dist/formats/cmf/core/constants.js +47 -0
  66. package/dist/formats/cmf/core/constants.js.map +1 -0
  67. package/dist/formats/cmf/core/gr2Anim.js +453 -0
  68. package/dist/formats/cmf/core/gr2Anim.js.map +1 -0
  69. package/dist/formats/cmf/core/helpers.js +287 -0
  70. package/dist/formats/cmf/core/helpers.js.map +1 -0
  71. package/dist/formats/cmf/core/pack.js +276 -0
  72. package/dist/formats/cmf/core/pack.js.map +1 -0
  73. package/dist/formats/cmf/core/schema.js +364 -0
  74. package/dist/formats/cmf/core/schema.js.map +1 -0
  75. package/dist/formats/cmf/core/shared.js +268 -0
  76. package/dist/formats/cmf/core/shared.js.map +1 -0
  77. package/dist/formats/cmf/core/writer.js +517 -0
  78. package/dist/formats/cmf/core/writer.js.map +1 -0
  79. package/dist/formats/cmf/index.js +2 -0
  80. package/dist/formats/cmf/index.js.map +1 -0
  81. package/dist/formats/dds/CjsDdsFormat.js +187 -0
  82. package/dist/formats/dds/CjsDdsFormat.js.map +1 -0
  83. package/dist/formats/dds/core/helpers.js +812 -0
  84. package/dist/formats/dds/core/helpers.js.map +1 -0
  85. package/dist/formats/dds/index.js +2 -0
  86. package/dist/formats/dds/index.js.map +1 -0
  87. package/dist/formats/fbx/CjsFbxFormat.js +260 -0
  88. package/dist/formats/fbx/CjsFbxFormat.js.map +1 -0
  89. package/dist/formats/fbx/core/helpers.js +3901 -0
  90. package/dist/formats/fbx/core/helpers.js.map +1 -0
  91. package/dist/formats/fbx/index.js +2 -0
  92. package/dist/formats/fbx/index.js.map +1 -0
  93. package/dist/formats/flac/CjsFlacFormat.js +81 -0
  94. package/dist/formats/flac/CjsFlacFormat.js.map +1 -0
  95. package/dist/formats/flac/core/helpers.js +295 -0
  96. package/dist/formats/flac/core/helpers.js.map +1 -0
  97. package/dist/formats/flac/index.js +2 -0
  98. package/dist/formats/flac/index.js.map +1 -0
  99. package/dist/formats/gif/CjsGifFormat.js +81 -0
  100. package/dist/formats/gif/CjsGifFormat.js.map +1 -0
  101. package/dist/formats/gif/core/helpers.js +360 -0
  102. package/dist/formats/gif/core/helpers.js.map +1 -0
  103. package/dist/formats/gif/index.js +2 -0
  104. package/dist/formats/gif/index.js.map +1 -0
  105. package/dist/formats/gltf/CjsGltfFormat.js +284 -0
  106. package/dist/formats/gltf/CjsGltfFormat.js.map +1 -0
  107. package/dist/formats/gltf/core/helpers.js +292 -0
  108. package/dist/formats/gltf/core/helpers.js.map +1 -0
  109. package/dist/formats/gltf/core/json.js +79 -0
  110. package/dist/formats/gltf/core/json.js.map +1 -0
  111. package/dist/formats/gltf/core/parser.js +666 -0
  112. package/dist/formats/gltf/core/parser.js.map +1 -0
  113. package/dist/formats/gltf/core/targets.js +163 -0
  114. package/dist/formats/gltf/core/targets.js.map +1 -0
  115. package/dist/formats/gltf/index.js +2 -0
  116. package/dist/formats/gltf/index.js.map +1 -0
  117. package/dist/formats/index.js +23 -0
  118. package/dist/formats/index.js.map +1 -0
  119. package/dist/formats/jpeg/CjsJpegFormat.js +200 -0
  120. package/dist/formats/jpeg/CjsJpegFormat.js.map +1 -0
  121. package/dist/formats/jpeg/core/helpers.js +350 -0
  122. package/dist/formats/jpeg/core/helpers.js.map +1 -0
  123. package/dist/formats/jpeg/core/jpeg.js +377 -0
  124. package/dist/formats/jpeg/core/jpeg.js.map +1 -0
  125. package/dist/formats/jpeg/index.js +2 -0
  126. package/dist/formats/jpeg/index.js.map +1 -0
  127. package/dist/formats/mp3/CjsMp3Format.js +186 -0
  128. package/dist/formats/mp3/CjsMp3Format.js.map +1 -0
  129. package/dist/formats/mp3/core/helpers.js +338 -0
  130. package/dist/formats/mp3/core/helpers.js.map +1 -0
  131. package/dist/formats/mp3/index.js +2 -0
  132. package/dist/formats/mp3/index.js.map +1 -0
  133. package/dist/formats/mp4/CjsMp4Format.js +185 -0
  134. package/dist/formats/mp4/CjsMp4Format.js.map +1 -0
  135. package/dist/formats/mp4/core/helpers.js +449 -0
  136. package/dist/formats/mp4/core/helpers.js.map +1 -0
  137. package/dist/formats/mp4/index.js +2 -0
  138. package/dist/formats/mp4/index.js.map +1 -0
  139. package/dist/formats/obj/CjsObjFormat.js +247 -0
  140. package/dist/formats/obj/CjsObjFormat.js.map +1 -0
  141. package/dist/formats/obj/core/helpers.js +573 -0
  142. package/dist/formats/obj/core/helpers.js.map +1 -0
  143. package/dist/formats/obj/core/json.js +64 -0
  144. package/dist/formats/obj/core/json.js.map +1 -0
  145. package/dist/formats/obj/core/parser.js +321 -0
  146. package/dist/formats/obj/core/parser.js.map +1 -0
  147. package/dist/formats/obj/index.js +2 -0
  148. package/dist/formats/obj/index.js.map +1 -0
  149. package/dist/formats/ogg/CjsOggFormat.js +82 -0
  150. package/dist/formats/ogg/CjsOggFormat.js.map +1 -0
  151. package/dist/formats/ogg/core/helpers.js +387 -0
  152. package/dist/formats/ogg/core/helpers.js.map +1 -0
  153. package/dist/formats/ogg/core/imdct.js +178 -0
  154. package/dist/formats/ogg/core/imdct.js.map +1 -0
  155. package/dist/formats/ogg/core/vorbis.js +999 -0
  156. package/dist/formats/ogg/core/vorbis.js.map +1 -0
  157. package/dist/formats/ogg/index.js +2 -0
  158. package/dist/formats/ogg/index.js.map +1 -0
  159. package/dist/formats/png/CjsPngFormat.js +189 -0
  160. package/dist/formats/png/CjsPngFormat.js.map +1 -0
  161. package/dist/formats/png/core/helpers.js +583 -0
  162. package/dist/formats/png/core/helpers.js.map +1 -0
  163. package/dist/formats/png/index.js +2 -0
  164. package/dist/formats/png/index.js.map +1 -0
  165. package/dist/formats/red/CjsRedFormat.js +247 -0
  166. package/dist/formats/red/CjsRedFormat.js.map +1 -0
  167. package/dist/formats/red/core/CjsRedReader.js +201 -0
  168. package/dist/formats/red/core/CjsRedReader.js.map +1 -0
  169. package/dist/formats/red/core/blackDefinitions.js +3 -0
  170. package/dist/formats/red/core/blackDefinitions.js.map +1 -0
  171. package/dist/formats/red/core/helpers.js +136 -0
  172. package/dist/formats/red/core/helpers.js.map +1 -0
  173. package/dist/formats/red/core/redGraph.js +68 -0
  174. package/dist/formats/red/core/redGraph.js.map +1 -0
  175. package/dist/formats/red/core/schema.js +4 -0
  176. package/dist/formats/red/core/schema.js.map +1 -0
  177. package/dist/formats/red/index.js +2 -0
  178. package/dist/formats/red/index.js.map +1 -0
  179. package/dist/formats/stl/CjsStlFormat.js +304 -0
  180. package/dist/formats/stl/CjsStlFormat.js.map +1 -0
  181. package/dist/formats/stl/core/helpers.js +257 -0
  182. package/dist/formats/stl/core/helpers.js.map +1 -0
  183. package/dist/formats/stl/core/json.js +51 -0
  184. package/dist/formats/stl/core/json.js.map +1 -0
  185. package/dist/formats/stl/core/stl.js +544 -0
  186. package/dist/formats/stl/core/stl.js.map +1 -0
  187. package/dist/formats/stl/core/targets.js +163 -0
  188. package/dist/formats/stl/core/targets.js.map +1 -0
  189. package/dist/formats/stl/index.js +2 -0
  190. package/dist/formats/stl/index.js.map +1 -0
  191. package/dist/formats/tga/CjsTgaFormat.js +186 -0
  192. package/dist/formats/tga/CjsTgaFormat.js.map +1 -0
  193. package/dist/formats/tga/core/helpers.js +446 -0
  194. package/dist/formats/tga/core/helpers.js.map +1 -0
  195. package/dist/formats/tga/index.js +2 -0
  196. package/dist/formats/tga/index.js.map +1 -0
  197. package/dist/formats/wav/CjsWavFormat.js +186 -0
  198. package/dist/formats/wav/CjsWavFormat.js.map +1 -0
  199. package/dist/formats/wav/core/helpers.js +328 -0
  200. package/dist/formats/wav/core/helpers.js.map +1 -0
  201. package/dist/formats/wav/index.js +2 -0
  202. package/dist/formats/wav/index.js.map +1 -0
  203. package/dist/formats/webm/CjsWebmFormat.js +185 -0
  204. package/dist/formats/webm/CjsWebmFormat.js.map +1 -0
  205. package/dist/formats/webm/core/helpers.js +537 -0
  206. package/dist/formats/webm/core/helpers.js.map +1 -0
  207. package/dist/formats/webm/index.js +2 -0
  208. package/dist/formats/webm/index.js.map +1 -0
  209. package/dist/formats/webp/CjsWebpFormat.js +80 -0
  210. package/dist/formats/webp/CjsWebpFormat.js.map +1 -0
  211. package/dist/formats/webp/core/helpers.js +214 -0
  212. package/dist/formats/webp/core/helpers.js.map +1 -0
  213. package/dist/formats/webp/index.js +2 -0
  214. package/dist/formats/webp/index.js.map +1 -0
  215. package/dist/formats/wem/CjsWemFormat.js +197 -0
  216. package/dist/formats/wem/CjsWemFormat.js.map +1 -0
  217. package/dist/formats/wem/core/bitStream.js +259 -0
  218. package/dist/formats/wem/core/bitStream.js.map +1 -0
  219. package/dist/formats/wem/core/codebookLibrary.js +164 -0
  220. package/dist/formats/wem/core/codebookLibrary.js.map +1 -0
  221. package/dist/formats/wem/core/helpers.js +336 -0
  222. package/dist/formats/wem/core/helpers.js.map +1 -0
  223. package/dist/formats/wem/core/packedCodebooksAotuv603.js +30 -0
  224. package/dist/formats/wem/core/packedCodebooksAotuv603.js.map +1 -0
  225. package/dist/formats/wem/core/wemToOgg.js +485 -0
  226. package/dist/formats/wem/core/wemToOgg.js.map +1 -0
  227. package/dist/formats/wem/index.js +2 -0
  228. package/dist/formats/wem/index.js.map +1 -0
  229. package/dist/formats/yaml/CjsYamlFormat.js +77 -0
  230. package/dist/formats/yaml/CjsYamlFormat.js.map +1 -0
  231. package/dist/formats/yaml/core/CjsYamlReader.js +304 -0
  232. package/dist/formats/yaml/core/CjsYamlReader.js.map +1 -0
  233. package/dist/formats/yaml/core/helpers.js +160 -0
  234. package/dist/formats/yaml/core/helpers.js.map +1 -0
  235. package/dist/formats/yaml/index.js +2 -0
  236. package/dist/formats/yaml/index.js.map +1 -0
  237. package/dist/generated/resources/AudioGeometryResData.js +47 -0
  238. package/dist/generated/resources/AudioGeometryResData.js.map +1 -0
  239. package/dist/generated/resources/CmfVertexReader.js +46 -0
  240. package/dist/generated/resources/CmfVertexReader.js.map +1 -0
  241. package/dist/generated/resources/GStateBindingCallbackData.js +31 -0
  242. package/dist/generated/resources/GStateBindingCallbackData.js.map +1 -0
  243. package/dist/generated/resources/MeshDecalData.js +37 -0
  244. package/dist/generated/resources/MeshDecalData.js.map +1 -0
  245. package/dist/generated/resources/MeshDecalLodData.js +34 -0
  246. package/dist/generated/resources/MeshDecalLodData.js.map +1 -0
  247. package/dist/generated/resources/Tr2AsyncSave.js +46 -0
  248. package/dist/generated/resources/Tr2AsyncSave.js.map +1 -0
  249. package/dist/generated/resources/Tr2CmfContents.js +37 -0
  250. package/dist/generated/resources/Tr2CmfContents.js.map +1 -0
  251. package/dist/generated/resources/Tr2GrannyIntersectionResult.js +58 -0
  252. package/dist/generated/resources/Tr2GrannyIntersectionResult.js.map +1 -0
  253. package/dist/generated/resources/Tr2LoadPrepareFence.js +37 -0
  254. package/dist/generated/resources/Tr2LoadPrepareFence.js.map +1 -0
  255. package/dist/generated/resources/Tr2MaterialArea.js +34 -0
  256. package/dist/generated/resources/Tr2MaterialArea.js.map +1 -0
  257. package/dist/generated/resources/Tr2MaterialMesh.js +31 -0
  258. package/dist/generated/resources/Tr2MaterialMesh.js.map +1 -0
  259. package/dist/generated/resources/Tr2MaterialRes.js +34 -0
  260. package/dist/generated/resources/Tr2MaterialRes.js.map +1 -0
  261. package/dist/generated/resources/Tr2ShaderPermutation.js +43 -0
  262. package/dist/generated/resources/Tr2ShaderPermutation.js.map +1 -0
  263. package/dist/generated/resources/Tr2TextureLodManager.js +60 -0
  264. package/dist/generated/resources/Tr2TextureLodManager.js.map +1 -0
  265. package/dist/generated/resources/Tr2TextureLodUpdateRequest.js +37 -0
  266. package/dist/generated/resources/Tr2TextureLodUpdateRequest.js.map +1 -0
  267. package/dist/generated/resources/Tr2TexturePackChannel.js +37 -0
  268. package/dist/generated/resources/Tr2TexturePackChannel.js.map +1 -0
  269. package/dist/generated/resources/Tr2TexturePipeline.js +44 -0
  270. package/dist/generated/resources/Tr2TexturePipeline.js.map +1 -0
  271. package/dist/generated/resources/Tr2TexturePipelineParams.js +34 -0
  272. package/dist/generated/resources/Tr2TexturePipelineParams.js.map +1 -0
  273. package/dist/generated/resources/Tr2TexturePipelineStepCompress.js +40 -0
  274. package/dist/generated/resources/Tr2TexturePipelineStepCompress.js.map +1 -0
  275. package/dist/generated/resources/Tr2TexturePipelineStepLimitSize.js +34 -0
  276. package/dist/generated/resources/Tr2TexturePipelineStepLimitSize.js.map +1 -0
  277. package/dist/generated/resources/Tr2TexturePipelineStepLoad.js +31 -0
  278. package/dist/generated/resources/Tr2TexturePipelineStepLoad.js.map +1 -0
  279. package/dist/generated/resources/Tr2TexturePipelineStepPack.js +43 -0
  280. package/dist/generated/resources/Tr2TexturePipelineStepPack.js.map +1 -0
  281. package/dist/generated/resources/TriGeometryResAreaData.js +59 -0
  282. package/dist/generated/resources/TriGeometryResAreaData.js.map +1 -0
  283. package/dist/generated/resources/TriGeometryResJointData.js +38 -0
  284. package/dist/generated/resources/TriGeometryResJointData.js.map +1 -0
  285. package/dist/generated/resources/TriGeometryResLodData.js +88 -0
  286. package/dist/generated/resources/TriGeometryResLodData.js.map +1 -0
  287. package/dist/generated/resources/TriGeometryResMeshData.js +63 -0
  288. package/dist/generated/resources/TriGeometryResMeshData.js.map +1 -0
  289. package/dist/generated/resources/TriGeometryResSkeletonData.js +34 -0
  290. package/dist/generated/resources/TriGeometryResSkeletonData.js.map +1 -0
  291. package/dist/generated/resources/TriJointBinding.js +38 -0
  292. package/dist/generated/resources/TriJointBinding.js.map +1 -0
  293. package/dist/generated/resources/TriMorphTargetGeometryConstants.js +46 -0
  294. package/dist/generated/resources/TriMorphTargetGeometryConstants.js.map +1 -0
  295. package/dist/generated/resources/TriRtGeometryConstants.js +88 -0
  296. package/dist/generated/resources/TriRtGeometryConstants.js.map +1 -0
  297. package/dist/generated/resources/enums.js +18 -0
  298. package/dist/generated/resources/enums.js.map +1 -0
  299. package/dist/generated/resources/index.js +32 -0
  300. package/dist/generated/resources/index.js.map +1 -0
  301. package/dist/index.js +52 -0
  302. package/dist/index.js.map +1 -0
  303. package/dist/resourcePath.js +18 -0
  304. package/dist/resourcePath.js.map +1 -0
  305. package/dist/resourceStates.js +9 -0
  306. package/dist/resourceStates.js.map +1 -0
  307. package/dist/resources/Tr2EffectRes.js +71 -0
  308. package/dist/resources/Tr2EffectRes.js.map +1 -0
  309. package/dist/resources/Tr2GrannyStateRes.js +44 -0
  310. package/dist/resources/Tr2GrannyStateRes.js.map +1 -0
  311. package/dist/resources/Tr2ImageRes.js +114 -0
  312. package/dist/resources/Tr2ImageRes.js.map +1 -0
  313. package/dist/resources/Tr2LightProfileRes.js +40 -0
  314. package/dist/resources/Tr2LightProfileRes.js.map +1 -0
  315. package/dist/resources/TriGeometryRes.js +216 -0
  316. package/dist/resources/TriGeometryRes.js.map +1 -0
  317. package/dist/resources/TriGrannyRes.js +43 -0
  318. package/dist/resources/TriGrannyRes.js.map +1 -0
  319. package/dist/resources/TriTextureRes.js +304 -0
  320. package/dist/resources/TriTextureRes.js.map +1 -0
  321. package/dist/resources/resourceBoundary.js +47 -0
  322. package/dist/resources/resourceBoundary.js.map +1 -0
  323. package/dist/texture/CjsTextureArrayRes.js +406 -0
  324. package/dist/texture/CjsTextureArrayRes.js.map +1 -0
  325. package/dist/texture/CjsTextureParameterProxy.js +133 -0
  326. package/dist/texture/CjsTextureParameterProxy.js.map +1 -0
  327. package/format-notices/black/LICENSE +21 -0
  328. package/format-notices/black/NOTICE +47 -0
  329. package/format-notices/bnk/LICENSE +21 -0
  330. package/format-notices/bnk/NOTICE +17 -0
  331. package/format-notices/cmf/LICENSE +21 -0
  332. package/format-notices/cmf/NOTICE +36 -0
  333. package/format-notices/dds/LICENSE +21 -0
  334. package/format-notices/dds/NOTICE +14 -0
  335. package/format-notices/fbx/LICENSE +21 -0
  336. package/format-notices/fbx/NOTICE +14 -0
  337. package/format-notices/flac/LICENSE +21 -0
  338. package/format-notices/flac/NOTICE +14 -0
  339. package/format-notices/gif/LICENSE +21 -0
  340. package/format-notices/gif/NOTICE +14 -0
  341. package/format-notices/gltf/LICENSE +21 -0
  342. package/format-notices/gltf/NOTICE +27 -0
  343. package/format-notices/jpeg/LICENSE +21 -0
  344. package/format-notices/jpeg/NOTICE +14 -0
  345. package/format-notices/mp3/LICENSE +21 -0
  346. package/format-notices/mp3/NOTICE +14 -0
  347. package/format-notices/mp4/LICENSE +21 -0
  348. package/format-notices/mp4/NOTICE +14 -0
  349. package/format-notices/obj/LICENSE +21 -0
  350. package/format-notices/obj/NOTICE +26 -0
  351. package/format-notices/ogg/LICENSE +21 -0
  352. package/format-notices/ogg/NOTICE +28 -0
  353. package/format-notices/png/LICENSE +21 -0
  354. package/format-notices/png/NOTICE +14 -0
  355. package/format-notices/red/LICENSE +21 -0
  356. package/format-notices/red/NOTICE +31 -0
  357. package/format-notices/stl/LICENSE +21 -0
  358. package/format-notices/stl/NOTICE +21 -0
  359. package/format-notices/tga/LICENSE +21 -0
  360. package/format-notices/tga/NOTICE +14 -0
  361. package/format-notices/wav/LICENSE +21 -0
  362. package/format-notices/wav/NOTICE +14 -0
  363. package/format-notices/webm/LICENSE +21 -0
  364. package/format-notices/webm/NOTICE +14 -0
  365. package/format-notices/webp/LICENSE +21 -0
  366. package/format-notices/webp/NOTICE +14 -0
  367. package/format-notices/wem/LICENSE +57 -0
  368. package/format-notices/wem/NOTICE +33 -0
  369. package/format-notices/yaml/LICENSE +21 -0
  370. package/format-notices/yaml/NOTICE +44 -0
  371. package/package.json +51 -0
  372. package/resource-lifecycle.md +487 -0
@@ -0,0 +1,182 @@
1
+ import { classes } from './blackDefinitions.js';
2
+
3
+ const OUTPUT_JSON = "json";
4
+ const OUTPUT_RAW = "raw";
5
+ const OUTPUT_DOCUMENT = "document";
6
+ const OUTPUT_PAYLOAD = "payload";
7
+ const OUTPUT_RUNTIME = "runtime";
8
+ const DEFAULT_VALUES = Object.freeze({
9
+ emit: OUTPUT_JSON,
10
+ schema: classes,
11
+ registry: null,
12
+ sourceShapes: null,
13
+ rootName: "default",
14
+ firstId: 1,
15
+ metadata: null,
16
+ includeMetadata: false,
17
+ includeClassMetadata: false,
18
+ includeFieldTrace: false,
19
+ includeRefIndex: false,
20
+ trace: false,
21
+ debug: false,
22
+ decodeBinaryBlocks: false,
23
+ captureUnknownBlackFields: false,
24
+ captureUnknownResourceFields: false,
25
+ captureUnknownWhenNoBlackFields: false,
26
+ allowUnknownStringFallback: false,
27
+ rootFields: null,
28
+ payloadRootFields: null,
29
+ payloadTypeField: "_type",
30
+ payloadIdField: "_id",
31
+ payloadReferenceField: "_reference",
32
+ pathHandler: null,
33
+ adapter: null,
34
+ adapters: null,
35
+ classes: Object.freeze({})
36
+ });
37
+ const OPTION_KEYS = new Set(Object.keys(DEFAULT_VALUES));
38
+ function hasOwn(value, key) {
39
+ return Object.prototype.hasOwnProperty.call(value, key);
40
+ }
41
+ function normalizeEmit(emit, readerName) {
42
+ if (emit === undefined || emit === OUTPUT_JSON) return OUTPUT_JSON;
43
+ if (emit === OUTPUT_RAW) return OUTPUT_RAW;
44
+ if (emit === OUTPUT_DOCUMENT) return OUTPUT_DOCUMENT;
45
+ if (emit === OUTPUT_PAYLOAD) return OUTPUT_PAYLOAD;
46
+ if (emit === OUTPUT_RUNTIME) return OUTPUT_RUNTIME;
47
+ throw new Error(`${readerName} unknown emit value "${emit}"`);
48
+ }
49
+ function assertKnownOptions(options, readerName) {
50
+ for (const key of Object.keys(options)) {
51
+ if (!OPTION_KEYS.has(key)) {
52
+ throw new TypeError(`${readerName} unknown option "${key}"`);
53
+ }
54
+ }
55
+ }
56
+ function classMap(values) {
57
+ return values && values.classes ? values.classes : {};
58
+ }
59
+ function cloneValues(values) {
60
+ return {
61
+ emit: values.emit,
62
+ schema: values.schema ?? null,
63
+ registry: values.registry ?? null,
64
+ sourceShapes: values.sourceShapes ?? null,
65
+ rootName: values.rootName ?? "default",
66
+ firstId: values.firstId ?? 1,
67
+ metadata: values.metadata ?? null,
68
+ includeMetadata: Boolean(values.includeMetadata),
69
+ includeClassMetadata: Boolean(values.includeClassMetadata),
70
+ includeFieldTrace: Boolean(values.includeFieldTrace),
71
+ includeRefIndex: Boolean(values.includeRefIndex),
72
+ trace: Boolean(values.trace),
73
+ debug: Boolean(values.debug),
74
+ decodeBinaryBlocks: Boolean(values.decodeBinaryBlocks),
75
+ captureUnknownBlackFields: Boolean(values.captureUnknownBlackFields),
76
+ captureUnknownResourceFields: Boolean(values.captureUnknownResourceFields),
77
+ captureUnknownWhenNoBlackFields: Boolean(values.captureUnknownWhenNoBlackFields),
78
+ allowUnknownStringFallback: Boolean(values.allowUnknownStringFallback),
79
+ rootFields: cloneListOrValue(values.rootFields),
80
+ payloadRootFields: cloneListOrValue(values.payloadRootFields),
81
+ payloadTypeField: values.payloadTypeField,
82
+ payloadIdField: values.payloadIdField,
83
+ payloadReferenceField: values.payloadReferenceField,
84
+ pathHandler: values.pathHandler ?? null,
85
+ adapter: values.adapter ?? null,
86
+ adapters: values.adapters ?? null,
87
+ classes: {
88
+ ...classMap(values)
89
+ }
90
+ };
91
+ }
92
+ function cloneListOrValue(value) {
93
+ return Array.isArray(value) ? value.slice() : value ?? null;
94
+ }
95
+ function validateClassKey(classKeys, key, readerName) {
96
+ if (typeof key !== "string" || !key) {
97
+ throw new Error(`${readerName} class type must be a non-empty string`);
98
+ }
99
+ }
100
+ function validateClass(classKeys, type, Class, readerName) {
101
+ validateClassKey(classKeys, type, readerName);
102
+ if (typeof Class !== "function") {
103
+ throw new TypeError(`${readerName} class "${type}" must be a constructor`);
104
+ }
105
+ }
106
+ function mergeClasses(values, classes, classKeys, readerName) {
107
+ if (!classes || typeof classes !== "object") {
108
+ throw new TypeError(`${readerName} classes option must be an object`);
109
+ }
110
+ const next = {
111
+ ...values.classes
112
+ };
113
+ for (const [type, Class] of Object.entries(classes)) {
114
+ validateClass(classKeys, type, Class, readerName);
115
+ next[type] = Class;
116
+ }
117
+ values.classes = next;
118
+ }
119
+ function normalizeValues(base, options, classKeys, readerName) {
120
+ if (!options || typeof options !== "object") {
121
+ throw new TypeError(`${readerName} options must be an object`);
122
+ }
123
+ assertKnownOptions(options, readerName);
124
+ const values = cloneValues(base);
125
+ if (hasOwn(options, "emit")) values.emit = normalizeEmit(options.emit, readerName);
126
+ if (hasOwn(options, "schema")) values.schema = options.schema ?? null;
127
+ if (hasOwn(options, "registry")) values.registry = options.registry ?? null;
128
+ if (hasOwn(options, "sourceShapes")) values.sourceShapes = options.sourceShapes ?? null;
129
+ if (hasOwn(options, "rootName")) values.rootName = options.rootName ?? "default";
130
+ if (hasOwn(options, "firstId")) values.firstId = options.firstId ?? 1;
131
+ if (hasOwn(options, "metadata")) values.metadata = options.metadata ?? null;
132
+ if (hasOwn(options, "includeMetadata")) values.includeMetadata = Boolean(options.includeMetadata);
133
+ if (hasOwn(options, "includeClassMetadata")) values.includeClassMetadata = Boolean(options.includeClassMetadata);
134
+ if (hasOwn(options, "includeFieldTrace")) values.includeFieldTrace = Boolean(options.includeFieldTrace);
135
+ if (hasOwn(options, "includeRefIndex")) values.includeRefIndex = Boolean(options.includeRefIndex);
136
+ if (hasOwn(options, "trace")) values.trace = Boolean(options.trace);
137
+ if (hasOwn(options, "debug")) values.debug = Boolean(options.debug);
138
+ if (hasOwn(options, "decodeBinaryBlocks")) values.decodeBinaryBlocks = Boolean(options.decodeBinaryBlocks);
139
+ if (hasOwn(options, "captureUnknownBlackFields")) values.captureUnknownBlackFields = Boolean(options.captureUnknownBlackFields);
140
+ if (hasOwn(options, "captureUnknownResourceFields")) values.captureUnknownResourceFields = Boolean(options.captureUnknownResourceFields);
141
+ if (hasOwn(options, "captureUnknownWhenNoBlackFields")) values.captureUnknownWhenNoBlackFields = Boolean(options.captureUnknownWhenNoBlackFields);
142
+ if (hasOwn(options, "allowUnknownStringFallback")) values.allowUnknownStringFallback = Boolean(options.allowUnknownStringFallback);
143
+ if (hasOwn(options, "rootFields")) values.rootFields = cloneListOrValue(options.rootFields);
144
+ if (hasOwn(options, "payloadRootFields")) values.payloadRootFields = cloneListOrValue(options.payloadRootFields);
145
+ if (hasOwn(options, "payloadTypeField")) values.payloadTypeField = options.payloadTypeField;
146
+ if (hasOwn(options, "payloadIdField")) values.payloadIdField = options.payloadIdField;
147
+ if (hasOwn(options, "payloadReferenceField")) values.payloadReferenceField = options.payloadReferenceField;
148
+ if (hasOwn(options, "adapter")) values.adapter = options.adapter ?? null;
149
+ if (hasOwn(options, "adapters")) values.adapters = options.adapters ?? null;
150
+ if (hasOwn(options, "pathHandler")) {
151
+ if (options.pathHandler !== null && options.pathHandler !== undefined && typeof options.pathHandler !== "function") {
152
+ throw new TypeError(`${readerName} pathHandler option must be a function`);
153
+ }
154
+ values.pathHandler = options.pathHandler ?? null;
155
+ }
156
+ if (hasOwn(options, "classes")) mergeClasses(values, options.classes, classKeys, readerName);
157
+ return values;
158
+ }
159
+ function toJsonValue(value, seen = new WeakSet()) {
160
+ if (value === null || typeof value !== "object") return value;
161
+ if (ArrayBuffer.isView(value)) return Array.from(value, item => toJsonValue(item, seen));
162
+ if (Array.isArray(value)) return value.map(item => toJsonValue(item, seen));
163
+ if (seen.has(value)) {
164
+ throw new TypeError("Reader.toJSON cannot convert circular data");
165
+ }
166
+ if (typeof value.toJSON === "function") {
167
+ seen.add(value);
168
+ const json = toJsonValue(value.toJSON(), seen);
169
+ seen.delete(value);
170
+ return json;
171
+ }
172
+ seen.add(value);
173
+ const out = {};
174
+ for (const key of Object.keys(value)) {
175
+ out[key] = toJsonValue(value[key], seen);
176
+ }
177
+ seen.delete(value);
178
+ return out;
179
+ }
180
+
181
+ export { DEFAULT_VALUES, OUTPUT_DOCUMENT, OUTPUT_JSON, OUTPUT_PAYLOAD, OUTPUT_RAW, OUTPUT_RUNTIME, normalizeValues, toJsonValue, validateClass, validateClassKey };
182
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sources":["../../../../../src/formats/black/core/helpers.js"],"sourcesContent":["import blackDefinitions from \"./blackSchema.js\";\n\nexport const OUTPUT_JSON = \"json\";\nexport const OUTPUT_RAW = \"raw\";\nexport const OUTPUT_DOCUMENT = \"document\";\nexport const OUTPUT_PAYLOAD = \"payload\";\nexport const OUTPUT_RUNTIME = \"runtime\";\n\nexport const DEFAULT_VALUES = Object.freeze({\n emit: OUTPUT_JSON,\n schema: blackDefinitions,\n registry: null,\n sourceShapes: null,\n rootName: \"default\",\n firstId: 1,\n metadata: null,\n includeMetadata: false,\n includeClassMetadata: false,\n includeFieldTrace: false,\n includeRefIndex: false,\n trace: false,\n debug: false,\n decodeBinaryBlocks: false,\n captureUnknownBlackFields: false,\n captureUnknownResourceFields: false,\n captureUnknownWhenNoBlackFields: false,\n allowUnknownStringFallback: false,\n rootFields: null,\n payloadRootFields: null,\n payloadTypeField: \"_type\",\n payloadIdField: \"_id\",\n payloadReferenceField: \"_reference\",\n pathHandler: null,\n adapter: null,\n adapters: null,\n classes: Object.freeze({})\n});\n\nconst OPTION_KEYS = new Set(Object.keys(DEFAULT_VALUES));\n\nfunction hasOwn(value, key)\n{\n return Object.prototype.hasOwnProperty.call(value, key);\n}\n\nfunction normalizeEmit(emit, readerName)\n{\n if (emit === undefined || emit === OUTPUT_JSON) return OUTPUT_JSON;\n if (emit === OUTPUT_RAW) return OUTPUT_RAW;\n if (emit === OUTPUT_DOCUMENT) return OUTPUT_DOCUMENT;\n if (emit === OUTPUT_PAYLOAD) return OUTPUT_PAYLOAD;\n if (emit === OUTPUT_RUNTIME) return OUTPUT_RUNTIME;\n throw new Error(`${readerName} unknown emit value \"${emit}\"`);\n}\n\nfunction assertKnownOptions(options, readerName)\n{\n for (const key of Object.keys(options))\n {\n if (!OPTION_KEYS.has(key))\n {\n throw new TypeError(`${readerName} unknown option \"${key}\"`);\n }\n }\n}\n\nfunction classMap(values)\n{\n return values && values.classes ? values.classes : {};\n}\n\nfunction cloneValues(values)\n{\n return {\n emit: values.emit,\n schema: values.schema ?? null,\n registry: values.registry ?? null,\n sourceShapes: values.sourceShapes ?? null,\n rootName: values.rootName ?? \"default\",\n firstId: values.firstId ?? 1,\n metadata: values.metadata ?? null,\n includeMetadata: Boolean(values.includeMetadata),\n includeClassMetadata: Boolean(values.includeClassMetadata),\n includeFieldTrace: Boolean(values.includeFieldTrace),\n includeRefIndex: Boolean(values.includeRefIndex),\n trace: Boolean(values.trace),\n debug: Boolean(values.debug),\n decodeBinaryBlocks: Boolean(values.decodeBinaryBlocks),\n captureUnknownBlackFields: Boolean(values.captureUnknownBlackFields),\n captureUnknownResourceFields: Boolean(values.captureUnknownResourceFields),\n captureUnknownWhenNoBlackFields: Boolean(values.captureUnknownWhenNoBlackFields),\n allowUnknownStringFallback: Boolean(values.allowUnknownStringFallback),\n rootFields: cloneListOrValue(values.rootFields),\n payloadRootFields: cloneListOrValue(values.payloadRootFields),\n payloadTypeField: values.payloadTypeField,\n payloadIdField: values.payloadIdField,\n payloadReferenceField: values.payloadReferenceField,\n pathHandler: values.pathHandler ?? null,\n adapter: values.adapter ?? null,\n adapters: values.adapters ?? null,\n classes: { ...classMap(values) }\n };\n}\n\nfunction cloneListOrValue(value)\n{\n return Array.isArray(value) ? value.slice() : value ?? null;\n}\n\nexport function validateClassKey(classKeys, key, readerName)\n{\n if (typeof key !== \"string\" || !key)\n {\n throw new Error(`${readerName} class type must be a non-empty string`);\n }\n}\n\nexport function validateClass(classKeys, type, Class, readerName)\n{\n validateClassKey(classKeys, type, readerName);\n if (typeof Class !== \"function\")\n {\n throw new TypeError(`${readerName} class \"${type}\" must be a constructor`);\n }\n}\n\nfunction mergeClasses(values, classes, classKeys, readerName)\n{\n if (!classes || typeof classes !== \"object\")\n {\n throw new TypeError(`${readerName} classes option must be an object`);\n }\n\n const next = { ...values.classes };\n for (const [ type, Class ] of Object.entries(classes))\n {\n validateClass(classKeys, type, Class, readerName);\n next[type] = Class;\n }\n values.classes = next;\n}\n\nexport function normalizeValues(base, options, classKeys, readerName)\n{\n if (!options || typeof options !== \"object\")\n {\n throw new TypeError(`${readerName} options must be an object`);\n }\n\n assertKnownOptions(options, readerName);\n\n const values = cloneValues(base);\n if (hasOwn(options, \"emit\")) values.emit = normalizeEmit(options.emit, readerName);\n if (hasOwn(options, \"schema\")) values.schema = options.schema ?? null;\n if (hasOwn(options, \"registry\")) values.registry = options.registry ?? null;\n if (hasOwn(options, \"sourceShapes\")) values.sourceShapes = options.sourceShapes ?? null;\n if (hasOwn(options, \"rootName\")) values.rootName = options.rootName ?? \"default\";\n if (hasOwn(options, \"firstId\")) values.firstId = options.firstId ?? 1;\n if (hasOwn(options, \"metadata\")) values.metadata = options.metadata ?? null;\n if (hasOwn(options, \"includeMetadata\")) values.includeMetadata = Boolean(options.includeMetadata);\n if (hasOwn(options, \"includeClassMetadata\")) values.includeClassMetadata = Boolean(options.includeClassMetadata);\n if (hasOwn(options, \"includeFieldTrace\")) values.includeFieldTrace = Boolean(options.includeFieldTrace);\n if (hasOwn(options, \"includeRefIndex\")) values.includeRefIndex = Boolean(options.includeRefIndex);\n if (hasOwn(options, \"trace\")) values.trace = Boolean(options.trace);\n if (hasOwn(options, \"debug\")) values.debug = Boolean(options.debug);\n if (hasOwn(options, \"decodeBinaryBlocks\")) values.decodeBinaryBlocks = Boolean(options.decodeBinaryBlocks);\n if (hasOwn(options, \"captureUnknownBlackFields\")) values.captureUnknownBlackFields = Boolean(options.captureUnknownBlackFields);\n if (hasOwn(options, \"captureUnknownResourceFields\")) values.captureUnknownResourceFields = Boolean(options.captureUnknownResourceFields);\n if (hasOwn(options, \"captureUnknownWhenNoBlackFields\")) values.captureUnknownWhenNoBlackFields = Boolean(options.captureUnknownWhenNoBlackFields);\n if (hasOwn(options, \"allowUnknownStringFallback\")) values.allowUnknownStringFallback = Boolean(options.allowUnknownStringFallback);\n if (hasOwn(options, \"rootFields\")) values.rootFields = cloneListOrValue(options.rootFields);\n if (hasOwn(options, \"payloadRootFields\")) values.payloadRootFields = cloneListOrValue(options.payloadRootFields);\n if (hasOwn(options, \"payloadTypeField\")) values.payloadTypeField = options.payloadTypeField;\n if (hasOwn(options, \"payloadIdField\")) values.payloadIdField = options.payloadIdField;\n if (hasOwn(options, \"payloadReferenceField\")) values.payloadReferenceField = options.payloadReferenceField;\n if (hasOwn(options, \"adapter\")) values.adapter = options.adapter ?? null;\n if (hasOwn(options, \"adapters\")) values.adapters = options.adapters ?? null;\n if (hasOwn(options, \"pathHandler\"))\n {\n if (options.pathHandler !== null && options.pathHandler !== undefined && typeof options.pathHandler !== \"function\")\n {\n throw new TypeError(`${readerName} pathHandler option must be a function`);\n }\n values.pathHandler = options.pathHandler ?? null;\n }\n if (hasOwn(options, \"classes\")) mergeClasses(values, options.classes, classKeys, readerName);\n return values;\n}\n\nexport function notImplemented(readerName, methodName)\n{\n return new Error(`${readerName}.${methodName} is not implemented yet`);\n}\n\nexport function toJsonValue(value, seen = new WeakSet())\n{\n if (value === null || typeof value !== \"object\") return value;\n if (ArrayBuffer.isView(value)) return Array.from(value, item => toJsonValue(item, seen));\n if (Array.isArray(value)) return value.map(item => toJsonValue(item, seen));\n\n if (seen.has(value))\n {\n throw new TypeError(\"Reader.toJSON cannot convert circular data\");\n }\n\n if (typeof value.toJSON === \"function\")\n {\n seen.add(value);\n const json = toJsonValue(value.toJSON(), seen);\n seen.delete(value);\n return json;\n }\n\n seen.add(value);\n const out = {};\n for (const key of Object.keys(value))\n {\n out[key] = toJsonValue(value[key], seen);\n }\n seen.delete(value);\n return out;\n}\n"],"names":["OUTPUT_JSON","OUTPUT_RAW","OUTPUT_DOCUMENT","OUTPUT_PAYLOAD","OUTPUT_RUNTIME","DEFAULT_VALUES","Object","freeze","emit","schema","blackDefinitions","registry","sourceShapes","rootName","firstId","metadata","includeMetadata","includeClassMetadata","includeFieldTrace","includeRefIndex","trace","debug","decodeBinaryBlocks","captureUnknownBlackFields","captureUnknownResourceFields","captureUnknownWhenNoBlackFields","allowUnknownStringFallback","rootFields","payloadRootFields","payloadTypeField","payloadIdField","payloadReferenceField","pathHandler","adapter","adapters","classes","OPTION_KEYS","Set","keys","hasOwn","value","key","prototype","hasOwnProperty","call","normalizeEmit","readerName","undefined","Error","assertKnownOptions","options","has","TypeError","classMap","values","cloneValues","Boolean","cloneListOrValue","Array","isArray","slice","validateClassKey","classKeys","validateClass","type","Class","mergeClasses","next","entries","normalizeValues","base","toJsonValue","seen","WeakSet","ArrayBuffer","isView","from","item","map","toJSON","add","json","delete","out"],"mappings":";;AAEO,MAAMA,WAAW,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sC,GAAG,CAACD,IAAI,IAAIN,WAAW,CAACM,IAAI,EAAEL,IAAI,CAAC,CAAC;AAE3E,EAAA,IAAIA,IAAI,CAACrB,GAAG,CAACX,KAAK,CAAC,EACnB;AACI,IAAA,MAAM,IAAIY,SAAS,CAAC,4CAA4C,CAAC;AACrE,EAAA;AAEA,EAAA,IAAI,OAAOZ,KAAK,CAACuC,MAAM,KAAK,UAAU,EACtC;AACIP,IAAAA,IAAI,CAACQ,GAAG,CAACxC,KAAK,CAAC;IACf,MAAMyC,IAAI,GAAGV,WAAW,CAAC/B,KAAK,CAACuC,MAAM,EAAE,EAAEP,IAAI,CAAC;AAC9CA,IAAAA,IAAI,CAACU,MAAM,CAAC1C,KAAK,CAAC;AAClB,IAAA,OAAOyC,IAAI;AACf,EAAA;AAEAT,EAAAA,IAAI,CAACQ,GAAG,CAACxC,KAAK,CAAC;EACf,MAAM2C,GAAG,GAAG,EAAE;EACd,KAAK,MAAM1C,GAAG,IAAInC,MAAM,CAACgC,IAAI,CAACE,KAAK,CAAC,EACpC;AACI2C,IAAAA,GAAG,CAAC1C,GAAG,CAAC,GAAG8B,WAAW,CAAC/B,KAAK,CAACC,GAAG,CAAC,EAAE+B,IAAI,CAAC;AAC5C,EAAA;AACAA,EAAAA,IAAI,CAACU,MAAM,CAAC1C,KAAK,CAAC;AAClB,EAAA,OAAO2C,GAAG;AACd;;;;"}
@@ -0,0 +1,4 @@
1
+ const CLASS_KEYS = Object.freeze(["Root", "Object", "Field", "Array", "Value", "Reference"]);
2
+
3
+ export { CLASS_KEYS };
4
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sources":["../../../../../src/formats/black/core/schema.js"],"sourcesContent":["export const CLASS_KEYS = Object.freeze([\n \"Root\",\n \"Object\",\n \"Field\",\n \"Array\",\n \"Value\",\n \"Reference\"\n]);\n"],"names":["CLASS_KEYS","Object","freeze"],"mappings":"AAAO,MAAMA,UAAU,GAAGC,MAAM,CAACC,MAAM,CAAC,CACpC,MAAM,EACN,QAAQ,EACR,OAAO,EACP,OAAO,EACP,OAAO,EACP,WAAW,CACd;;;;"}
@@ -0,0 +1,2 @@
1
+ export { CjsBlackFormat, CjsBlackFormat as default } from './CjsBlackFormat.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,245 @@
1
+ import { isSoundbanksInfo, parseSoundbanksInfo, buildSoundbanksCatalog, joinSoundbanksInfo, wwiseIdFromName } from './core/soundbanksInfo.js';
2
+ import { DEFAULT_VALUES, normalizeValues, readWithValues, inspectWithValues, isSupportedWithValues, toJsonValue, toBytes, extractMedia, isBNK, OUTPUT_RAW, OUTPUT_JSON, OUTPUT_BNK_JSON, OUTPUT_MEDIA, HIRC_TYPE_NAMES } from './core/helpers.js';
3
+
4
+ const FORMAT_NAME = "CjsBnkFormat";
5
+
6
+ /**
7
+ * Reader for Audiokinetic Wwise soundbank (.bnk) containers.
8
+ *
9
+ * Inspection decodes the bank header, embedded media index, object hierarchy
10
+ * listing, and referenced bank names without copying payloads. Read can emit
11
+ * the raw bank, debug JSON, or the embedded media items undecoded; Wwise
12
+ * event/graph semantics are deliberately out of scope for this reader.
13
+ */
14
+ class CjsBnkFormat {
15
+ #values = DEFAULT_VALUES;
16
+
17
+ /**
18
+ * Create a reusable bnk format profile.
19
+ *
20
+ * @param {object} [options] Default read/inspect options.
21
+ */
22
+ constructor(options = {}) {
23
+ this.SetValues(options);
24
+ }
25
+
26
+ /**
27
+ * Merge options into this profile.
28
+ *
29
+ * @param {object} [options] Values to merge.
30
+ * @returns {CjsBnkFormat} This format profile.
31
+ */
32
+ SetValues(options = {}) {
33
+ this.#values = normalizeValues(this.#values, options, FORMAT_NAME);
34
+ return this;
35
+ }
36
+
37
+ /**
38
+ * Get normalized profile values with optional per-call overrides.
39
+ *
40
+ * @param {object} [options] Per-call values.
41
+ * @returns {object} Normalized read values.
42
+ */
43
+ GetValues(options = {}) {
44
+ return normalizeValues(this.#values, options, FORMAT_NAME);
45
+ }
46
+
47
+ /**
48
+ * Read soundbank bytes with this profile.
49
+ *
50
+ * @param {Uint8Array|ArrayBuffer|DataView} input Soundbank bytes.
51
+ * @param {object} [options] Per-call values.
52
+ * @returns {object} GPU-free raw/debug/media payload for the selected emit target.
53
+ */
54
+ Read(input, options = {}) {
55
+ return readWithValues(input, this.GetValues(options));
56
+ }
57
+
58
+ /**
59
+ * Read soundbank bytes asynchronously with this profile.
60
+ *
61
+ * @param {Uint8Array|ArrayBuffer|DataView} input Soundbank bytes.
62
+ * @param {object} [options] Per-call values.
63
+ * @returns {Promise<object>} GPU-free raw/debug/media payload for the selected emit target.
64
+ */
65
+ async ReadAsync(input, options = {}) {
66
+ return this.Read(input, options);
67
+ }
68
+
69
+ /**
70
+ * Inspect soundbank bytes without copying media payloads.
71
+ *
72
+ * @param {Uint8Array|ArrayBuffer|DataView} input Soundbank bytes.
73
+ * @param {object} [options] Per-call values.
74
+ * @returns {object} Soundbank metadata.
75
+ */
76
+ Inspect(input, options = {}) {
77
+ return inspectWithValues(input, this.GetValues(options));
78
+ }
79
+
80
+ /**
81
+ * Report whether soundbank input and requested output variants are supported.
82
+ *
83
+ * @param {Uint8Array|ArrayBuffer|DataView} input Soundbank bytes.
84
+ * @param {object} [options] Per-call values.
85
+ * @returns {object} Support/probe report.
86
+ */
87
+ IsSupported(input, options = {}) {
88
+ return isSupportedWithValues(input, this.GetValues(options));
89
+ }
90
+
91
+ /**
92
+ * Convert format output into JSON-compatible debug data.
93
+ *
94
+ * @param {any} value Format output.
95
+ * @returns {any} JSON-compatible value.
96
+ */
97
+ ToJSON(value) {
98
+ return toJsonValue(value);
99
+ }
100
+
101
+ /**
102
+ * One-shot soundbank read.
103
+ *
104
+ * @param {Uint8Array|ArrayBuffer|DataView} input Soundbank bytes.
105
+ * @param {object} [options] Read options.
106
+ * @returns {object} GPU-free raw/debug/media payload for the selected emit target.
107
+ */
108
+ static read(input, options = {}) {
109
+ return readWithValues(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));
110
+ }
111
+
112
+ /**
113
+ * One-shot asynchronous soundbank read.
114
+ *
115
+ * @param {Uint8Array|ArrayBuffer|DataView} input Soundbank bytes.
116
+ * @param {object} [options] Read options.
117
+ * @returns {Promise<object>} GPU-free raw/debug/media payload for the selected emit target.
118
+ */
119
+ static async readAsync(input, options = {}) {
120
+ return CjsBnkFormat.read(input, options);
121
+ }
122
+
123
+ /**
124
+ * One-shot soundbank inspection.
125
+ *
126
+ * @param {Uint8Array|ArrayBuffer|DataView} input Soundbank bytes.
127
+ * @param {object} [options] Inspect options.
128
+ * @returns {object} Soundbank metadata.
129
+ */
130
+ static inspect(input, options = {}) {
131
+ return inspectWithValues(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));
132
+ }
133
+
134
+ /**
135
+ * One-shot soundbank support probe.
136
+ *
137
+ * @param {Uint8Array|ArrayBuffer|DataView} input Soundbank bytes.
138
+ * @param {object} [options] Probe options.
139
+ * @returns {object} Support/probe report.
140
+ */
141
+ static isSupported(input, options = {}) {
142
+ return isSupportedWithValues(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));
143
+ }
144
+
145
+ /**
146
+ * Extract embedded media payloads as views over the soundbank bytes.
147
+ *
148
+ * @param {Uint8Array|ArrayBuffer|DataView} input Soundbank bytes.
149
+ * @param {number} [mediaId] Optional single media id filter.
150
+ * @returns {Array<object>} Extracted media items with undecoded bytes.
151
+ */
152
+ static extractMedia(input, mediaId) {
153
+ const bytes = toBytes(input);
154
+ const metadata = inspectWithValues(bytes, DEFAULT_VALUES);
155
+ return extractMedia(bytes, metadata, mediaId);
156
+ }
157
+
158
+ /**
159
+ * Convert format output into JSON-compatible debug data.
160
+ *
161
+ * @param {any} value Format output.
162
+ * @returns {any} JSON-compatible value.
163
+ */
164
+ static toJSON(value) {
165
+ return toJsonValue(value);
166
+ }
167
+
168
+ /**
169
+ * Test whether input looks like a Wwise SoundbanksInfo document.
170
+ *
171
+ * @param {Uint8Array|ArrayBuffer|DataView|string|object} input Candidate document.
172
+ * @returns {boolean} True when a SoundBanksInfo bank list is present.
173
+ */
174
+ static isSoundbanksInfo(input) {
175
+ return isSoundbanksInfo(input);
176
+ }
177
+
178
+ /**
179
+ * Parse a SoundbanksInfo document into a normalized summary.
180
+ *
181
+ * @param {Uint8Array|ArrayBuffer|DataView|string|object} input SoundbanksInfo JSON bytes, text, or object.
182
+ * @returns {object} Normalized document summary with per-bank details.
183
+ */
184
+ static parseSoundbanksInfo(input) {
185
+ return parseSoundbanksInfo(input);
186
+ }
187
+
188
+ /**
189
+ * Build id-keyed lookup tables from a SoundbanksInfo document.
190
+ *
191
+ * @param {Uint8Array|ArrayBuffer|DataView|string|object} input SoundbanksInfo JSON bytes, text, or object.
192
+ * @returns {object} Catalog with banksById, mediaById, eventsById, and eventsByName.
193
+ */
194
+ static buildSoundbanksCatalog(input) {
195
+ return buildSoundbanksCatalog(input);
196
+ }
197
+
198
+ /**
199
+ * Join a bank inspection result with a SoundbanksInfo catalog.
200
+ *
201
+ * @param {object} bankInfo Inspect output for a soundbank.
202
+ * @param {object} catalog `buildSoundbanksCatalog` output.
203
+ * @returns {object} Bank/media/event annotations for the inspected bank.
204
+ */
205
+ static joinSoundbanksInfo(bankInfo, catalog) {
206
+ return joinSoundbanksInfo(bankInfo, catalog);
207
+ }
208
+
209
+ /**
210
+ * Compute the Wwise 32-bit id for a bank, event, switch, or language name.
211
+ *
212
+ * @param {string} name Wwise object name.
213
+ * @returns {number} Unsigned 32-bit Wwise id (FNV-1 of the lowercased name).
214
+ */
215
+ static wwiseIdFromName(name) {
216
+ return wwiseIdFromName(name);
217
+ }
218
+
219
+ /**
220
+ * Test whether bytes look like a Wwise soundbank.
221
+ *
222
+ * @param {Uint8Array|ArrayBuffer|DataView} input Candidate soundbank bytes.
223
+ * @returns {boolean} True when the BKHD header chunk is present.
224
+ */
225
+ static isBNK(input) {
226
+ try {
227
+ return isBNK(toBytes(input));
228
+ } catch {
229
+ return false;
230
+ }
231
+ }
232
+ static OUTPUT_RAW = OUTPUT_RAW;
233
+ static OUTPUT_JSON = OUTPUT_JSON;
234
+ static OUTPUT_BNK_JSON = OUTPUT_BNK_JSON;
235
+ static OUTPUT_MEDIA = OUTPUT_MEDIA;
236
+ static HIRC_TYPE_NAMES = HIRC_TYPE_NAMES;
237
+ static type = Object.freeze(["audio"]);
238
+ static mediaTypes = Object.freeze(["audio"]);
239
+ static inputTypes = Object.freeze(["bnk"]);
240
+ static outputTypes = Object.freeze([OUTPUT_RAW, OUTPUT_MEDIA]);
241
+ static debugOutputTypes = Object.freeze([OUTPUT_BNK_JSON, OUTPUT_RAW]);
242
+ }
243
+
244
+ export { CjsBnkFormat };
245
+ //# sourceMappingURL=CjsBnkFormat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CjsBnkFormat.js","sources":["../../../../src/formats/bnk/CjsBnkFormat.js"],"sourcesContent":["import {\n buildSoundbanksCatalog,\n isSoundbanksInfo,\n joinSoundbanksInfo,\n parseSoundbanksInfo,\n wwiseIdFromName\n} from \"./core/soundbanksInfo.js\";\nimport {\n DEFAULT_VALUES,\n HIRC_TYPE_NAMES,\n OUTPUT_BNK_JSON,\n OUTPUT_JSON,\n OUTPUT_MEDIA,\n OUTPUT_RAW,\n extractMedia,\n inspectWithValues,\n isBNK,\n isSupportedWithValues,\n normalizeValues,\n readWithValues,\n toBytes,\n toJsonValue\n} from \"./core/helpers.js\";\n\nconst FORMAT_NAME = \"CjsBnkFormat\";\n\n/**\n * Reader for Audiokinetic Wwise soundbank (.bnk) containers.\n *\n * Inspection decodes the bank header, embedded media index, object hierarchy\n * listing, and referenced bank names without copying payloads. Read can emit\n * the raw bank, debug JSON, or the embedded media items undecoded; Wwise\n * event/graph semantics are deliberately out of scope for this reader.\n */\nexport class CjsBnkFormat\n{\n #values = DEFAULT_VALUES;\n\n /**\n * Create a reusable bnk format profile.\n *\n * @param {object} [options] Default read/inspect options.\n */\n constructor(options = {})\n {\n this.SetValues(options);\n }\n\n /**\n * Merge options into this profile.\n *\n * @param {object} [options] Values to merge.\n * @returns {CjsBnkFormat} This format profile.\n */\n SetValues(options = {})\n {\n this.#values = normalizeValues(this.#values, options, FORMAT_NAME);\n return this;\n }\n\n /**\n * Get normalized profile values with optional per-call overrides.\n *\n * @param {object} [options] Per-call values.\n * @returns {object} Normalized read values.\n */\n GetValues(options = {})\n {\n return normalizeValues(this.#values, options, FORMAT_NAME);\n }\n\n /**\n * Read soundbank bytes with this profile.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Soundbank bytes.\n * @param {object} [options] Per-call values.\n * @returns {object} GPU-free raw/debug/media payload for the selected emit target.\n */\n Read(input, options = {})\n {\n return readWithValues(input, this.GetValues(options));\n }\n\n /**\n * Read soundbank bytes asynchronously with this profile.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Soundbank bytes.\n * @param {object} [options] Per-call values.\n * @returns {Promise<object>} GPU-free raw/debug/media payload for the selected emit target.\n */\n async ReadAsync(input, options = {})\n {\n return this.Read(input, options);\n }\n\n /**\n * Inspect soundbank bytes without copying media payloads.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Soundbank bytes.\n * @param {object} [options] Per-call values.\n * @returns {object} Soundbank metadata.\n */\n Inspect(input, options = {})\n {\n return inspectWithValues(input, this.GetValues(options));\n }\n\n /**\n * Report whether soundbank input and requested output variants are supported.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Soundbank bytes.\n * @param {object} [options] Per-call values.\n * @returns {object} Support/probe report.\n */\n IsSupported(input, options = {})\n {\n return isSupportedWithValues(input, this.GetValues(options));\n }\n\n /**\n * Convert format output into JSON-compatible debug data.\n *\n * @param {any} value Format output.\n * @returns {any} JSON-compatible value.\n */\n ToJSON(value)\n {\n return toJsonValue(value);\n }\n\n /**\n * One-shot soundbank read.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Soundbank bytes.\n * @param {object} [options] Read options.\n * @returns {object} GPU-free raw/debug/media payload for the selected emit target.\n */\n static read(input, options = {})\n {\n return readWithValues(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * One-shot asynchronous soundbank read.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Soundbank bytes.\n * @param {object} [options] Read options.\n * @returns {Promise<object>} GPU-free raw/debug/media payload for the selected emit target.\n */\n static async readAsync(input, options = {})\n {\n return CjsBnkFormat.read(input, options);\n }\n\n /**\n * One-shot soundbank inspection.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Soundbank bytes.\n * @param {object} [options] Inspect options.\n * @returns {object} Soundbank metadata.\n */\n static inspect(input, options = {})\n {\n return inspectWithValues(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * One-shot soundbank support probe.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Soundbank bytes.\n * @param {object} [options] Probe options.\n * @returns {object} Support/probe report.\n */\n static isSupported(input, options = {})\n {\n return isSupportedWithValues(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * Extract embedded media payloads as views over the soundbank bytes.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Soundbank bytes.\n * @param {number} [mediaId] Optional single media id filter.\n * @returns {Array<object>} Extracted media items with undecoded bytes.\n */\n static extractMedia(input, mediaId)\n {\n const bytes = toBytes(input);\n const metadata = inspectWithValues(bytes, DEFAULT_VALUES);\n return extractMedia(bytes, metadata, mediaId);\n }\n\n /**\n * Convert format output into JSON-compatible debug data.\n *\n * @param {any} value Format output.\n * @returns {any} JSON-compatible value.\n */\n static toJSON(value)\n {\n return toJsonValue(value);\n }\n\n /**\n * Test whether input looks like a Wwise SoundbanksInfo document.\n *\n * @param {Uint8Array|ArrayBuffer|DataView|string|object} input Candidate document.\n * @returns {boolean} True when a SoundBanksInfo bank list is present.\n */\n static isSoundbanksInfo(input)\n {\n return isSoundbanksInfo(input);\n }\n\n /**\n * Parse a SoundbanksInfo document into a normalized summary.\n *\n * @param {Uint8Array|ArrayBuffer|DataView|string|object} input SoundbanksInfo JSON bytes, text, or object.\n * @returns {object} Normalized document summary with per-bank details.\n */\n static parseSoundbanksInfo(input)\n {\n return parseSoundbanksInfo(input);\n }\n\n /**\n * Build id-keyed lookup tables from a SoundbanksInfo document.\n *\n * @param {Uint8Array|ArrayBuffer|DataView|string|object} input SoundbanksInfo JSON bytes, text, or object.\n * @returns {object} Catalog with banksById, mediaById, eventsById, and eventsByName.\n */\n static buildSoundbanksCatalog(input)\n {\n return buildSoundbanksCatalog(input);\n }\n\n /**\n * Join a bank inspection result with a SoundbanksInfo catalog.\n *\n * @param {object} bankInfo Inspect output for a soundbank.\n * @param {object} catalog `buildSoundbanksCatalog` output.\n * @returns {object} Bank/media/event annotations for the inspected bank.\n */\n static joinSoundbanksInfo(bankInfo, catalog)\n {\n return joinSoundbanksInfo(bankInfo, catalog);\n }\n\n /**\n * Compute the Wwise 32-bit id for a bank, event, switch, or language name.\n *\n * @param {string} name Wwise object name.\n * @returns {number} Unsigned 32-bit Wwise id (FNV-1 of the lowercased name).\n */\n static wwiseIdFromName(name)\n {\n return wwiseIdFromName(name);\n }\n\n /**\n * Test whether bytes look like a Wwise soundbank.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Candidate soundbank bytes.\n * @returns {boolean} True when the BKHD header chunk is present.\n */\n static isBNK(input)\n {\n try\n {\n return isBNK(toBytes(input));\n }\n catch\n {\n return false;\n }\n }\n\n static OUTPUT_RAW = OUTPUT_RAW;\n static OUTPUT_JSON = OUTPUT_JSON;\n static OUTPUT_BNK_JSON = OUTPUT_BNK_JSON;\n static OUTPUT_MEDIA = OUTPUT_MEDIA;\n static HIRC_TYPE_NAMES = HIRC_TYPE_NAMES;\n static type = Object.freeze([ \"audio\" ]);\n static mediaTypes = Object.freeze([ \"audio\" ]);\n static inputTypes = Object.freeze([ \"bnk\" ]);\n static outputTypes = Object.freeze([ OUTPUT_RAW, OUTPUT_MEDIA ]);\n static debugOutputTypes = Object.freeze([ OUTPUT_BNK_JSON, OUTPUT_RAW ]);\n}\n\nexport default CjsBnkFormat;\n"],"names":["FORMAT_NAME","CjsBnkFormat","DEFAULT_VALUES","constructor","options","SetValues","normalizeValues","GetValues","Read","input","readWithValues","ReadAsync","Inspect","inspectWithValues","IsSupported","isSupportedWithValues","ToJSON","value","toJsonValue","read","readAsync","inspect","isSupported","extractMedia","mediaId","bytes","toBytes","metadata","toJSON","isSoundbanksInfo","parseSoundbanksInfo","buildSoundbanksCatalog","joinSoundbanksInfo","bankInfo","catalog","wwiseIdFromName","name","isBNK","OUTPUT_RAW","OUTPUT_JSON","OUTPUT_BNK_JSON","OUTPUT_MEDIA","HIRC_TYPE_NAMES","type","Object","freeze","mediaTypes","inputTypes","outputTypes","debugOutputTypes"],"mappings":";;;AAwBA,MAAMA,WAAW,GAAG,cAAc;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,YAAY,CACzB;EACI,OAAO,GAAGC,cAAc;;AAExB;AACJ;AACA;AACA;AACA;AACIC,EAAAA,WAAWA,CAACC,OAAO,GAAG,EAAE,EACxB;AACI,IAAA,IAAI,CAACC,SAAS,CAACD,OAAO,CAAC;AAC3B,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACIC,EAAAA,SAASA,CAACD,OAAO,GAAG,EAAE,EACtB;AACI,IAAA,IAAI,CAAC,OAAO,GAAGE,eAAe,CAAC,IAAI,CAAC,OAAO,EAAEF,OAAO,EAAEJ,WAAW,CAAC;AAClE,IAAA,OAAO,IAAI;AACf,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACIO,EAAAA,SAASA,CAACH,OAAO,GAAG,EAAE,EACtB;IACI,OAAOE,eAAe,CAAC,IAAI,CAAC,OAAO,EAAEF,OAAO,EAAEJ,WAAW,CAAC;AAC9D,EAAA;;AAEA;AACJ;AAC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