@openclaw/matrix 2026.11.5 → 2026.11.10-beta.1
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.
- package/dist/.setup/{account-config-CRsKoMqJ.mjs → account-config-CVM2a28p.mjs} +1 -2
- package/dist/.setup/{account-selection-UUPhMBmu.mjs → account-selection-Cow3TMFO.mjs} +5 -8
- package/dist/.setup/{approval-handler.runtime-Ca12_7Qa.mjs → approval-handler.runtime-D7KO6ds_.mjs} +8 -9
- package/dist/.setup/{approval-reactions-BazmsDbe.mjs → approval-reactions-Bz_8XB01.mjs} +2 -3
- package/dist/.setup/{backup-health-Dm_YMVFT.mjs → backup-health-BxH69np2.mjs} +1 -2
- package/dist/.setup/{channel-FfaEmyIU.mjs → channel-BJGiol_v.mjs} +30 -40
- package/dist/.setup/{channel.runtime-CkkHG8zy.mjs → channel.runtime-BrSYy4Qm.mjs} +10 -12
- package/dist/.setup/{channel.setup-B00zzOOL.mjs → channel.setup-DJdvsvAL.mjs} +9 -7
- package/dist/.setup/{cli-dz9hd2dR.mjs → cli-CjjggD1Y.mjs} +25 -34
- package/dist/.setup/{cli-metadata-CwUhA9CY.mjs → cli-metadata-nnz3uf_k.mjs} +3 -5
- package/dist/.setup/{client-D1bsidwU.mjs → client-DIeTvz6C.mjs} +21 -26
- package/dist/.setup/{client-bootstrap-CTT0VF6v.mjs → client-bootstrap-CvbnV_7R.mjs} +2 -3
- package/dist/.setup/{client-support-B_Mp4Qk9.mjs → client-support-CqXAOZp3.mjs} +2 -3
- package/dist/.setup/{client-CFPYqaYK.mjs → client-uAX074II.mjs} +4 -5
- package/dist/.setup/{config-paths-CnREYb1Y.mjs → config-paths-DBpHxDyc.mjs} +1 -2
- package/dist/.setup/{create-client-Ccf5wyS3.mjs → create-client-XL9SKJ2s.mjs} +8 -9
- package/dist/.setup/{credentials-kT20jk_u.mjs → credentials-CGgWuhFV.mjs} +5 -6
- package/dist/.setup/{credentials-read-CM6wXUjL.mjs → credentials-read-rPqEpuxv.mjs} +5 -6
- package/dist/.setup/{credentials-state-B3cuUFwZ.mjs → credentials-state-jxq29yQw.mjs} +1 -2
- package/dist/.setup/{crypto-node.runtime-6Aj_ltHQ.mjs → crypto-node.runtime-E_hqXGxm.mjs} +1 -2
- package/dist/.setup/{crypto-runtime-DZNytKX5.mjs → crypto-runtime-D96thr_g.mjs} +10 -15
- package/dist/.setup/{crypto-state-store-BZLlwkv_.mjs → crypto-state-store-CzAmeC_Z.mjs} +4 -4
- package/dist/.setup/{crypto-store-ownership-CiQ1l_O7.mjs → crypto-store-ownership-DPO9WcVz.mjs} +3 -4
- package/dist/.setup/{crypto-unsafe-state-doctor-Dh1dtuSz.mjs → crypto-unsafe-state-doctor-CkhtP1mQ.mjs} +7 -8
- package/dist/.setup/{deps-D-W_QQjz.mjs → deps-CVPT2Ros.mjs} +1 -2
- package/dist/.setup/{device-health-Ck2YpEVN.mjs → device-health-D7n-lPeb.mjs} +2 -3
- package/dist/.setup/{direct-management-Dp1giZ34.mjs → direct-management-D59C1WO-.mjs} +7 -11
- package/dist/.setup/{directory-live-ufzRheWx.mjs → directory-live-5RgaKKuc.mjs} +5 -6
- package/dist/.setup/{doctor-contract-BANpMUbP.mjs → doctor-contract-GiXgCj7k.mjs} +2 -3
- package/dist/.setup/{draft-stream-BPjjKSoI.mjs → draft-stream-CjEpElZ-.mjs} +3 -4
- package/dist/.setup/{encryption-guidance-Br3Lv9Hm.mjs → encryption-guidance-DfbEaKct.mjs} +3 -4
- package/dist/.setup/{env-vars-aEBngJPa.mjs → env-vars-Bh1iOXJ1.mjs} +1 -2
- package/dist/.setup/{errors-Bw4EHwKX.mjs → errors-CL3YJV8U.mjs} +1 -2
- package/dist/.setup/{event-helpers-CxNgMQqH.mjs → event-helpers-DDUjVVf7.mjs} +1 -2
- package/dist/.setup/{exec-approvals-BwEOyI1-.mjs → exec-approvals-DcQS_LNp.mjs} +6 -9
- package/dist/.setup/{file-sync-store-BpS12yaK.mjs → file-sync-store-CAhnwOPA.mjs} +6 -36
- package/dist/.setup/{http-client-B_ohXrBm.mjs → http-client-CqnKFKUH.mjs} +5 -8
- package/dist/.setup/{idb-persistence-BTOsltD9.mjs → idb-persistence-DeGUs--C.mjs} +6 -7
- package/dist/.setup/{idb-persistence-lock-Bh3ZLIsE.mjs → idb-persistence-lock-CH2K6d_3.mjs} +1 -2
- package/dist/.setup/{joined-room-encryption-C0gHa2DG.mjs → joined-room-encryption-9sJK1kM-.mjs} +2 -3
- package/dist/.setup/{logger-CuAzdD8Q.mjs → logger-B9TwnY6C.mjs} +2 -3
- package/dist/.setup/{logging-CoaEyRtA.mjs → logging-Bnsn7s4r.mjs} +3 -4
- package/dist/.setup/{messages-DpJ9naJa.mjs → messages-CmlRhlPp.mjs} +9 -14
- package/dist/.setup/{monitor-vpzawYrB.mjs → monitor-DG8yTCh9.mjs} +98 -137
- package/dist/.setup/{onboarding-BK-V2ZLT.mjs → onboarding-CY_oesMI.mjs} +10 -11
- package/dist/.setup/{outbound-DydCDuvM.mjs → outbound-BY9kS8Kt.mjs} +5 -6
- package/dist/.setup/{profile-update-RLsY-gu6.mjs → profile-update-BRugBHSm.mjs} +13 -10
- package/dist/.setup/{reaction-events-lcgVF3M5.mjs → reaction-events-B1DQTt9d.mjs} +8 -9
- package/dist/.setup/{resolve-targets-DYW8ULZS.mjs → resolve-targets-CUBvJ37V.mjs} +4 -5
- package/dist/.setup/{retired-state-JGUEBE72.mjs → retired-state-BsxdpJNk.mjs} +3 -41
- package/dist/.setup/{room-info-Dhc4efkA.mjs → room-info-CJVhaCvB.mjs} +6 -8
- package/dist/.setup/{runtime-1kn1P6io.mjs → runtime-Ck8TjD7L.mjs} +1 -2
- package/dist/.setup/{runtime-doctor-migrations-hxP-CXX7.mjs → runtime-doctor-migrations-CSvRANPN.mjs} +5 -10
- package/dist/.setup/{runtime-setter-api-i2MOXoT3.mjs → runtime-setter-api-CpwhcBQK.mjs} +1 -1
- package/dist/.setup/{sdk-DPXiQ3jr.mjs → sdk-CRJQM2N0.mjs} +33 -47
- package/dist/.setup/{secret-contract-DxyzKSzf.mjs → secret-contract-AKnr45nw.mjs} +2 -3
- package/dist/.setup/{secret-contract-api-Dukgvike.mjs → secret-contract-api-DMSwMIxd.mjs} +1 -1
- package/dist/.setup/{send-HHAbKARg.mjs → send-QWCT3NT9.mjs} +58 -44
- package/dist/.setup/{send-currentness-DGxiiBn9.mjs → send-currentness-D1x6YP9O.mjs} +2 -4
- package/dist/.setup/{setup-bootstrap-DaT2j28V.mjs → setup-bootstrap-DrBapwjQ.mjs} +4 -5
- package/dist/.setup/{setup-core-DcqQbLZv.mjs → setup-core-B4sVj_9e.mjs} +13 -20
- package/dist/.setup/setup-plugin-api-t9yhI-Tq.mjs +2 -0
- package/dist/.setup/sqlite-state-D6Zpz1q1.mjs +36 -0
- package/dist/.setup/{startup-verification-UkaoSldm.mjs → startup-verification-DfOuAruK.mjs} +5 -5
- package/dist/.setup/{state-layout-walk-BQMgMykU.mjs → state-layout-walk-BqCZTHpp.mjs} +2 -3
- package/dist/.setup/{storage-C3N6YZIn.mjs → storage-CCarF_gm.mjs} +9 -10
- package/dist/.setup/{storage-paths-B51JM-pC.mjs → storage-paths-e_Vq6cvw.mjs} +1 -2
- package/dist/.setup/{subagent-hooks-CfGAysJi.mjs → subagent-hooks-BdbuojSv.mjs} +2 -3
- package/dist/.setup/{sync-cache-state-BKVaKRzQ.mjs → sync-cache-state-BMvqW4Ii.mjs} +5 -5
- package/dist/.setup/{sync-state-CWbp0QSY.mjs → sync-state-Cu1nagBV.mjs} +1 -2
- package/dist/.setup/{target-ids-HhcaKX1n.mjs → target-ids-DltG_ZHJ.mjs} +1 -2
- package/dist/.setup/{task-runner-DY3aKiQa.mjs → task-runner-CYyGHdNW.mjs} +1 -2
- package/dist/.setup/{thread-binding-api-BvuaKpd0.mjs → thread-binding-api-OtSciHmZ.mjs} +2 -3
- package/dist/.setup/{thread-bindings-891JsKXF.mjs → thread-bindings-jNXWItIL.mjs} +54 -23
- package/dist/.setup/{thread-bindings-shared-QmZOfX9Q.mjs → thread-bindings-shared-DEAGGuDA.mjs} +6 -3
- package/dist/.setup/{tool-actions-8mXdq9OV.mjs → tool-actions-4sdtsvN2.mjs} +25 -25
- package/dist/.setup/{url-validation-By_2hsXr.mjs → url-validation-DesoKUns.mjs} +1 -2
- package/dist/.setup/{verification-CcZIVL8P.mjs → verification-DQu-OS0V.mjs} +4 -5
- package/dist/.source-module-urls/1cd4d4ff8d44e1c8b830932b44d7cf8a7f3350e09e169910e1d7a85e131b7bea.json +1 -1
- package/dist/api.js +8 -8
- package/dist/auth-presence.js +2 -3
- package/dist/channel-plugin-api.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/contract-api.js +2 -2
- package/dist/doctor-contract-api.js +14 -16
- package/dist/helper-api.js +3 -3
- package/dist/index.js +3 -4
- package/dist/plugin-entry.handlers.runtime.js +3 -4
- package/dist/runtime-api.js +7 -8
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/session-binding-contract-api.js +2 -2
- package/dist/setup-entry.js +4 -5
- package/dist/setup-plugin-api.js +1 -1
- package/dist/subagent-hooks-api.js +2 -3
- package/dist/thread-binding-api.js +1 -1
- package/dist/thread-bindings-runtime.js +1 -1
- package/node_modules/@openclaw/fs-safe/CHANGELOG.md +45 -1
- package/node_modules/@openclaw/fs-safe/README.md +4 -0
- package/node_modules/@openclaw/fs-safe/dist/absolute-path.js +2 -2
- package/node_modules/@openclaw/fs-safe/dist/advanced.d.ts +2 -2
- package/node_modules/@openclaw/fs-safe/dist/advanced.js +2 -2
- package/node_modules/@openclaw/fs-safe/dist/archive-parser.wasm +0 -0
- package/node_modules/@openclaw/fs-safe/dist/atomic-io.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/atomic-io.js +6 -0
- package/node_modules/@openclaw/fs-safe/dist/atomic.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-node.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-node.js +13 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-options.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-options.js +6 -0
- package/node_modules/@openclaw/fs-safe/dist/errors.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/errors.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-admission.d.ts +0 -1
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-admission.js +1 -11
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.js +3 -3
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-stale-admission.js +2 -3
- package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.d.ts +3 -3
- package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.js +30 -4
- package/node_modules/@openclaw/fs-safe/dist/file-store-prune.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/file-store-prune.js +7 -1
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-directory.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-directory.js +30 -4
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-write.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-write.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store.d.ts +2 -1
- package/node_modules/@openclaw/fs-safe/dist/file-store.js +5 -0
- package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.js +9 -0
- package/node_modules/@openclaw/fs-safe/dist/json-store.d.ts +2 -1
- package/node_modules/@openclaw/fs-safe/dist/native-binding.d.ts +4 -1
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/native-staged-file.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/native-staged-file.js +19 -13
- package/node_modules/@openclaw/fs-safe/dist/overwrite-file-handle.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/overwrite-file-handle.js +27 -5
- package/node_modules/@openclaw/fs-safe/dist/path-prefix.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/path-prefix.js +84 -7
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-input.js +0 -11
- package/node_modules/@openclaw/fs-safe/dist/prepare-directory-mode.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/prepare-directory-mode.js +61 -0
- package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.js +2 -1
- package/node_modules/@openclaw/fs-safe/dist/realpath.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/realpath.js +16 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.d.ts +2 -1
- package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.js +8 -6
- package/node_modules/@openclaw/fs-safe/dist/replace-file-types.d.ts +2 -1
- package/node_modules/@openclaw/fs-safe/dist/replace-file.js +20 -13
- package/node_modules/@openclaw/fs-safe/dist/root-context.js +4 -1
- package/node_modules/@openclaw/fs-safe/dist/root-create-native.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/root-create-native.js +18 -9
- package/node_modules/@openclaw/fs-safe/dist/root-errors.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/root-errors.js +9 -0
- package/node_modules/@openclaw/fs-safe/dist/root-impl.js +4 -1
- package/node_modules/@openclaw/fs-safe/dist/root-mkdir-native.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/root-mkdir-native.js +35 -16
- package/node_modules/@openclaw/fs-safe/dist/root-path-existing.d.ts +6 -2
- package/node_modules/@openclaw/fs-safe/dist/root-path-existing.js +32 -20
- package/node_modules/@openclaw/fs-safe/dist/root-path.js +32 -26
- package/node_modules/@openclaw/fs-safe/dist/root-write-admission.js +4 -1
- package/node_modules/@openclaw/fs-safe/dist/secret-file.d.ts +2 -1
- package/node_modules/@openclaw/fs-safe/dist/secret-file.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/sibling-temp.d.ts +2 -1
- package/node_modules/@openclaw/fs-safe/dist/sibling-temp.js +5 -4
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-policy.d.ts +3 -2
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-policy.js +8 -9
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-stale-admission.js +3 -1
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-types.d.ts +2 -1
- package/node_modules/@openclaw/fs-safe/dist/text-atomic.d.ts +2 -1
- package/node_modules/@openclaw/fs-safe/dist/types.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-hints.js +12 -3
- package/node_modules/@openclaw/fs-safe/dist/windows-security-helper.exe +0 -0
- package/node_modules/@openclaw/fs-safe/dist/write-file-handle.d.ts +0 -1
- package/node_modules/@openclaw/fs-safe/dist/write-file-handle.js +10 -12
- package/node_modules/@openclaw/fs-safe/docs/advanced.md +3 -3
- package/node_modules/@openclaw/fs-safe/docs/atomic.md +16 -3
- package/node_modules/@openclaw/fs-safe/docs/compiler-qualification.md +1 -1
- package/node_modules/@openclaw/fs-safe/docs/contributing.md +27 -18
- package/node_modules/@openclaw/fs-safe/docs/errors.md +3 -1
- package/node_modules/@openclaw/fs-safe/docs/file-store.md +14 -2
- package/node_modules/@openclaw/fs-safe/docs/in-place-write.md +31 -0
- package/node_modules/@openclaw/fs-safe/docs/install.md +1 -1
- package/node_modules/@openclaw/fs-safe/docs/json-store.md +6 -1
- package/node_modules/@openclaw/fs-safe/docs/json.md +5 -1
- package/node_modules/@openclaw/fs-safe/docs/path-prefix.md +14 -4
- package/node_modules/@openclaw/fs-safe/docs/public-api.md +4 -2
- package/node_modules/@openclaw/fs-safe/docs/secret-file.md +5 -1
- package/node_modules/@openclaw/fs-safe/docs/sidecar-lock.md +4 -0
- package/node_modules/@openclaw/fs-safe/docs/temp.md +9 -1
- package/node_modules/@openclaw/fs-safe/docs/types.md +5 -1
- package/node_modules/@openclaw/fs-safe/package.json +12 -12
- package/node_modules/@openclaw/fs-safe-darwin-arm64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-arm64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-darwin-x64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-x64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-freebsd-arm64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-freebsd-arm64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-freebsd-x64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-freebsd-x64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-arm64-musl/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-arm64-musl/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-x64-gnu/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-gnu/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-x64-musl/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-musl/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-win32-arm64-msvc/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-win32-arm64-msvc/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-win32-x64-msvc/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-win32-x64-msvc/package.json +1 -1
- package/node_modules/@tokenizer/inflate/README.md +57 -17
- package/node_modules/@tokenizer/inflate/lib/ZipHandler.d.ts +12 -1
- package/node_modules/@tokenizer/inflate/lib/ZipHandler.js +127 -57
- package/node_modules/@tokenizer/inflate/lib/ZipLimitError.d.ts +18 -4
- package/node_modules/@tokenizer/inflate/lib/ZipLimitError.js +1 -1
- package/node_modules/@tokenizer/inflate/lib/index.d.ts +1 -1
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/LICENSE.txt +21 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/README.md +736 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/AbortSignal.d.ts +2 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/AbortSignal.js +7 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/AbstractTokenizer.d.ts +117 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/AbstractTokenizer.js +204 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/BlobTokenizer.d.ts +29 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/BlobTokenizer.js +57 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/BufferSizeError.d.ts +19 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/BufferSizeError.js +27 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/BufferTokenizer.d.ts +29 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/BufferTokenizer.js +51 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/FileTokenizer.d.ts +47 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/FileTokenizer.js +83 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/NotRegularFileError.d.ts +5 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/NotRegularFileError.js +8 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/ReadStreamTokenizer.d.ts +34 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/ReadStreamTokenizer.js +140 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/TokenizerBoundaryError.d.ts +7 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/TokenizerBoundaryError.js +10 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/TokenizerView.d.ts +9 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/TokenizerView.js +184 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/core.d.ts +44 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/core.js +56 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/index.d.ts +17 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/index.js +46 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/isRandomAccessTokenizer.d.ts +6 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/isRandomAccessTokenizer.js +10 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/AbstractStreamReader.d.ts +54 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/AbstractStreamReader.js +73 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/Deferred.d.ts +6 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/Deferred.js +10 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/Errors.d.ts +10 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/Errors.js +16 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/StreamReader.d.ts +34 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/StreamReader.js +125 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamByobReader.d.ts +14 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamByobReader.js +29 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamDefaultReader.d.ts +19 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamDefaultReader.js +67 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamReader.d.ts +24 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamReader.js +13 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamReaderFactory.d.ts +5 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamReaderFactory.js +19 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/index.d.ts +6 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/index.js +5 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/types.d.ts +163 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/types.js +1 -0
- package/node_modules/@tokenizer/inflate/node_modules/strtok3/package.json +97 -0
- package/node_modules/@tokenizer/inflate/package.json +5 -5
- package/node_modules/fake-indexeddb/README.md +7 -7
- package/node_modules/fake-indexeddb/build/cjs/lib/Index.js +47 -22
- package/node_modules/fake-indexeddb/build/cjs/lib/ObjectStore.js +4 -2
- package/node_modules/fake-indexeddb/build/cjs/lib/RecordStore.js +14 -9
- package/node_modules/fake-indexeddb/build/esm/lib/Index.js +47 -22
- package/node_modules/fake-indexeddb/build/esm/lib/ObjectStore.js +4 -2
- package/node_modules/fake-indexeddb/build/esm/lib/RecordStore.js +14 -9
- package/node_modules/fake-indexeddb/package.json +1 -1
- package/node_modules/file-type/node_modules/strtok3/README.md +154 -9
- package/node_modules/file-type/node_modules/strtok3/lib/AbstractTokenizer.d.ts +3 -0
- package/node_modules/file-type/node_modules/strtok3/lib/AbstractTokenizer.js +12 -4
- package/node_modules/file-type/node_modules/strtok3/lib/BlobTokenizer.js +1 -0
- package/node_modules/file-type/node_modules/strtok3/lib/BufferTokenizer.js +2 -1
- package/node_modules/file-type/node_modules/strtok3/lib/FileTokenizer.d.ts +1 -1
- package/node_modules/file-type/node_modules/strtok3/lib/FileTokenizer.js +3 -3
- package/node_modules/file-type/node_modules/strtok3/lib/ReadStreamTokenizer.js +17 -2
- package/node_modules/file-type/node_modules/strtok3/lib/TokenizerBoundaryError.d.ts +7 -0
- package/node_modules/file-type/node_modules/strtok3/lib/TokenizerBoundaryError.js +10 -0
- package/node_modules/file-type/node_modules/strtok3/lib/TokenizerView.d.ts +9 -0
- package/node_modules/file-type/node_modules/strtok3/lib/TokenizerView.js +184 -0
- package/node_modules/file-type/node_modules/strtok3/lib/core.d.ts +4 -1
- package/node_modules/file-type/node_modules/strtok3/lib/core.js +5 -18
- package/node_modules/file-type/node_modules/strtok3/lib/index.js +28 -5
- package/node_modules/file-type/node_modules/strtok3/lib/isRandomAccessTokenizer.d.ts +6 -0
- package/node_modules/file-type/node_modules/strtok3/lib/isRandomAccessTokenizer.js +10 -0
- package/node_modules/file-type/node_modules/strtok3/lib/stream/StreamReader.d.ts +4 -0
- package/node_modules/file-type/node_modules/strtok3/lib/stream/StreamReader.js +29 -8
- package/node_modules/file-type/node_modules/strtok3/lib/stream/WebStreamReader.d.ts +12 -2
- package/node_modules/file-type/node_modules/strtok3/lib/types.d.ts +19 -2
- package/node_modules/file-type/node_modules/strtok3/package.json +10 -8
- package/node_modules/file-type/package.json +3 -3
- package/node_modules/file-type/source/detectors/ebml.js +31 -16
- package/node_modules/file-type/source/detectors/zip.js +21 -203
- package/node_modules/matrix-js-sdk/CHANGELOG.md +28 -0
- package/node_modules/matrix-js-sdk/lib/matrixrtc/CallMembership.d.ts +30 -25
- package/node_modules/matrix-js-sdk/lib/matrixrtc/CallMembership.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/CallMembership.js +91 -100
- package/node_modules/matrix-js-sdk/lib/matrixrtc/CallMembership.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/EncryptionManager.d.ts +6 -4
- package/node_modules/matrix-js-sdk/lib/matrixrtc/EncryptionManager.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/EncryptionManager.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/IMembershipManager.d.ts +2 -15
- package/node_modules/matrix-js-sdk/lib/matrixrtc/IMembershipManager.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/IMembershipManager.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.d.ts +36 -7
- package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.js +29 -2
- package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.d.ts +12 -51
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.js +10 -66
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.d.ts +5 -10
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.js +25 -44
- package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.d.ts +8 -8
- package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.js +30 -22
- package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/ToDeviceKeyTransport.js +7 -8
- package/node_modules/matrix-js-sdk/lib/matrixrtc/ToDeviceKeyTransport.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/rtc.d.ts +8 -13
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/rtc.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/rtc.js +2 -11
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/rtc.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/session.d.ts +6 -2
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/session.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/session.js +3 -0
- package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/session.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/types.d.ts +5 -0
- package/node_modules/matrix-js-sdk/lib/matrixrtc/types.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/matrixrtc/types.js +5 -0
- package/node_modules/matrix-js-sdk/lib/matrixrtc/types.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/event-timeline-set.d.ts +9 -2
- package/node_modules/matrix-js-sdk/lib/models/event-timeline-set.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/event-timeline-set.js +8 -5
- package/node_modules/matrix-js-sdk/lib/models/event-timeline-set.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.d.ts +17 -2
- package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.js +88 -47
- package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room.d.ts +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/room.js +8 -2
- package/node_modules/matrix-js-sdk/lib/models/room.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/thread.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/models/thread.js +23 -2
- package/node_modules/matrix-js-sdk/lib/models/thread.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/MSC4108SignInWithQR.d.ts +3 -3
- package/node_modules/matrix-js-sdk/lib/rendezvous/MSC4108SignInWithQR.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/MSC4108SignInWithQR.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/SignInWithQRFlow.d.ts +95 -0
- package/node_modules/matrix-js-sdk/lib/rendezvous/SignInWithQRFlow.d.ts.map +1 -0
- package/node_modules/matrix-js-sdk/lib/rendezvous/SignInWithQRFlow.js +3 -0
- package/node_modules/matrix-js-sdk/lib/rendezvous/SignInWithQRFlow.js.map +1 -0
- package/node_modules/matrix-js-sdk/lib/rendezvous/index.d.ts +1 -0
- package/node_modules/matrix-js-sdk/lib/rendezvous/index.d.ts.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rendezvous/index.js.map +1 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/index.js +5 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/index.js.map +1 -1
- package/node_modules/matrix-js-sdk/package.json +3 -3
- package/node_modules/matrix-js-sdk/src/matrixrtc/CallMembership.ts +85 -95
- package/node_modules/matrix-js-sdk/src/matrixrtc/EncryptionManager.ts +6 -4
- package/node_modules/matrix-js-sdk/src/matrixrtc/IMembershipManager.ts +2 -15
- package/node_modules/matrix-js-sdk/src/matrixrtc/LivekitTransport.ts +58 -9
- package/node_modules/matrix-js-sdk/src/matrixrtc/MatrixRTCSession.ts +21 -80
- package/node_modules/matrix-js-sdk/src/matrixrtc/MembershipManager.ts +23 -40
- package/node_modules/matrix-js-sdk/src/matrixrtc/RTCEncryptionManager.ts +51 -39
- package/node_modules/matrix-js-sdk/src/matrixrtc/ToDeviceKeyTransport.ts +7 -7
- package/node_modules/matrix-js-sdk/src/matrixrtc/membershipData/rtc.ts +9 -23
- package/node_modules/matrix-js-sdk/src/matrixrtc/membershipData/session.ts +14 -2
- package/node_modules/matrix-js-sdk/src/matrixrtc/types.ts +6 -0
- package/node_modules/matrix-js-sdk/src/models/event-timeline-set.ts +19 -4
- package/node_modules/matrix-js-sdk/src/models/room-sticky-events.ts +92 -58
- package/node_modules/matrix-js-sdk/src/models/room.ts +8 -2
- package/node_modules/matrix-js-sdk/src/models/thread.ts +25 -3
- package/node_modules/matrix-js-sdk/src/rendezvous/MSC4108SignInWithQR.ts +3 -3
- package/node_modules/matrix-js-sdk/src/rendezvous/SignInWithQRFlow.ts +117 -0
- package/node_modules/matrix-js-sdk/src/rendezvous/index.ts +1 -0
- package/node_modules/matrix-js-sdk/src/rust-crypto/index.ts +5 -1
- package/node_modules/music-metadata/README.md +62 -67
- package/node_modules/music-metadata/lib/ParserFactory.js +3 -1
- package/node_modules/music-metadata/lib/aiff/AiffParser.d.ts +2 -0
- package/node_modules/music-metadata/lib/aiff/AiffParser.js +42 -3
- package/node_modules/music-metadata/lib/aiff/AiffToken.d.ts +1 -0
- package/node_modules/music-metadata/lib/aiff/AiffToken.js +1 -0
- package/node_modules/music-metadata/lib/apev2/APEv2Parser.js +11 -1
- package/node_modules/music-metadata/lib/asf/AsfObject.d.ts +2 -2
- package/node_modules/music-metadata/lib/asf/AsfObject.js +81 -111
- package/node_modules/music-metadata/lib/asf/AsfParser.js +5 -3
- package/node_modules/music-metadata/lib/asf/AsfTagMapper.js +27 -3
- package/node_modules/music-metadata/lib/asf/AsfUtil.d.ts +1 -1
- package/node_modules/music-metadata/lib/caf/CafParser.js +13 -2
- package/node_modules/music-metadata/lib/caf/CafToken.d.ts +2 -2
- package/node_modules/music-metadata/lib/caf/CafToken.js +9 -2
- package/node_modules/music-metadata/lib/common/Allocation.d.ts +6 -0
- package/node_modules/music-metadata/lib/common/Allocation.js +18 -0
- package/node_modules/music-metadata/lib/common/GenericTagMapper.js +1 -1
- package/node_modules/music-metadata/lib/common/MetadataCollector.d.ts +2 -0
- package/node_modules/music-metadata/lib/common/MetadataCollector.js +21 -4
- package/node_modules/music-metadata/lib/common/Util.d.ts +4 -0
- package/node_modules/music-metadata/lib/common/Util.js +34 -1
- package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.d.ts +4 -1
- package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.js +32 -36
- package/node_modules/music-metadata/lib/ebml/EbmlIterator.js +6 -2
- package/node_modules/music-metadata/lib/flac/FlacParser.js +2 -1
- package/node_modules/music-metadata/lib/id3v2/FrameParser.d.ts +7 -3
- package/node_modules/music-metadata/lib/id3v2/FrameParser.js +91 -46
- package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.js +6 -0
- package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.d.ts +5 -0
- package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.js +6 -4
- package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.d.ts +2 -1
- package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.js +57 -15
- package/node_modules/music-metadata/lib/lrc/LyricsParser.d.ts +18 -2
- package/node_modules/music-metadata/lib/lrc/LyricsParser.js +14 -3
- package/node_modules/music-metadata/lib/mp4/Atom.d.ts +3 -3
- package/node_modules/music-metadata/lib/mp4/Atom.js +14 -7
- package/node_modules/music-metadata/lib/mp4/AtomToken.d.ts +25 -25
- package/node_modules/music-metadata/lib/mp4/AtomToken.js +136 -119
- package/node_modules/music-metadata/lib/mp4/MP4Parser.d.ts +16 -2
- package/node_modules/music-metadata/lib/mp4/MP4Parser.js +370 -132
- package/node_modules/music-metadata/lib/mp4/MP4TagMapper.js +30 -0
- package/node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.js +19 -8
- package/node_modules/music-metadata/lib/ogg/OggParser.js +6 -2
- package/node_modules/music-metadata/lib/ogg/OggToken.d.ts +2 -2
- package/node_modules/music-metadata/lib/ogg/OggToken.js +3 -9
- package/node_modules/music-metadata/lib/ogg/flac/FlacStream.d.ts +9 -11
- package/node_modules/music-metadata/lib/ogg/flac/FlacStream.js +111 -27
- package/node_modules/music-metadata/lib/ogg/speex/SpeexStream.js +6 -0
- package/node_modules/music-metadata/lib/ogg/theora/TheoraStream.js +6 -0
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.d.ts +2 -2
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.js +8 -4
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.d.ts +1 -0
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.js +23 -3
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.d.ts +4 -0
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.js +15 -2
- package/node_modules/music-metadata/lib/riff/RiffInfoTagMap.js +1 -0
- package/node_modules/music-metadata/lib/type.d.ts +23 -6
- package/node_modules/music-metadata/lib/wav/BwfChunk.d.ts +12 -2
- package/node_modules/music-metadata/lib/wav/BwfChunk.js +39 -11
- package/node_modules/music-metadata/lib/wav/WaveParser.js +13 -2
- package/node_modules/music-metadata/package.json +2 -1
- package/node_modules/typebox/build/format/date_time.d.mts +2 -1
- package/node_modules/typebox/build/format/date_time.mjs +12 -3
- package/node_modules/typebox/package.json +1 -1
- package/package.json +9 -9
- package/dist/.setup/setup-plugin-api-Cg4TelGZ.mjs +0 -2
- package/node_modules/fake-indexeddb/build/cjs/test/fakeIndexedDB/auto.js +0 -54
- package/node_modules/fake-indexeddb/build/cjs/test/fakeIndexedDB/binarySearchTree.js +0 -413
- package/node_modules/fake-indexeddb/build/cjs/test/fakeIndexedDB/fakeIndexedDB.js +0 -1018
- package/node_modules/fake-indexeddb/build/cjs/test/fakeIndexedDB/forceCloseDatabase.js +0 -99
- package/node_modules/fake-indexeddb/build/cjs/test/fakeIndexedDB/getAll.js +0 -707
- package/node_modules/fake-indexeddb/build/cjs/test/fakeIndexedDB/memoryLeaks.js +0 -42
- package/node_modules/fake-indexeddb/build/esm/test/fakeIndexedDB/auto.js +0 -52
- package/node_modules/fake-indexeddb/build/esm/test/fakeIndexedDB/binarySearchTree.js +0 -409
- package/node_modules/fake-indexeddb/build/esm/test/fakeIndexedDB/fakeIndexedDB.js +0 -1014
- package/node_modules/fake-indexeddb/build/esm/test/fakeIndexedDB/forceCloseDatabase.js +0 -95
- package/node_modules/fake-indexeddb/build/esm/test/fakeIndexedDB/getAll.js +0 -703
- package/node_modules/fake-indexeddb/build/esm/test/fakeIndexedDB/memoryLeaks.js +0 -38
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { defaultMaxMetadataEntries } from '../common/Allocation.js';
|
|
1
2
|
// ASF Objects
|
|
3
|
+
import { createTokenizerView, EndOfStreamError, TokenizerBoundaryError } from 'strtok3';
|
|
2
4
|
import * as Token from 'token-types';
|
|
3
5
|
import { AttachedPictureType } from '../id3v2/ID3v2Token.js';
|
|
4
6
|
import { makeUnexpectedFileContentError } from '../ParseError.js';
|
|
@@ -6,6 +8,39 @@ import AsfGuid from './AsfGuid.js';
|
|
|
6
8
|
import { getParserForAttr, parseUnicodeAttr } from './AsfUtil.js';
|
|
7
9
|
export class AsfContentParseError extends makeUnexpectedFileContentError('ASF') {
|
|
8
10
|
}
|
|
11
|
+
/** Synchronous reads restricted to one declared ASF object payload. */
|
|
12
|
+
class ByteCursor {
|
|
13
|
+
context;
|
|
14
|
+
data;
|
|
15
|
+
position = 0;
|
|
16
|
+
constructor(buf, off, length, context) {
|
|
17
|
+
this.context = context;
|
|
18
|
+
if (off < 0 || length < 0 || length > buf.length - off) {
|
|
19
|
+
throw new AsfContentParseError(`Truncated ${context}`);
|
|
20
|
+
}
|
|
21
|
+
this.data = buf.subarray(off, off + length);
|
|
22
|
+
}
|
|
23
|
+
get remaining() {
|
|
24
|
+
return this.data.length - this.position;
|
|
25
|
+
}
|
|
26
|
+
require(length, message = `Truncated ${this.context}`) {
|
|
27
|
+
if (length > this.remaining) {
|
|
28
|
+
throw new AsfContentParseError(message);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
read(token) {
|
|
32
|
+
this.require(token.len);
|
|
33
|
+
const value = token.get(this.data, this.position);
|
|
34
|
+
this.position += token.len;
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
bytes(length, message) {
|
|
38
|
+
this.require(length, message);
|
|
39
|
+
const start = this.position;
|
|
40
|
+
this.position += length;
|
|
41
|
+
return this.data.subarray(start, this.position);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
9
44
|
/**
|
|
10
45
|
* Data Type: Specifies the type of information being stored. The following values are recognized.
|
|
11
46
|
*/
|
|
@@ -217,42 +252,6 @@ const CodecListObjectHeader = {
|
|
|
217
252
|
};
|
|
218
253
|
}
|
|
219
254
|
};
|
|
220
|
-
class BoundedReader {
|
|
221
|
-
tokenizer;
|
|
222
|
-
remaining;
|
|
223
|
-
constructor(tokenizer, size) {
|
|
224
|
-
this.tokenizer = tokenizer;
|
|
225
|
-
this.remaining = size;
|
|
226
|
-
}
|
|
227
|
-
async readToken(token) {
|
|
228
|
-
this.ensureAvailable(token.len);
|
|
229
|
-
const value = await this.tokenizer.readToken(token);
|
|
230
|
-
this.remaining -= token.len;
|
|
231
|
-
return value;
|
|
232
|
-
}
|
|
233
|
-
async readNumber(token) {
|
|
234
|
-
return this.readToken(token);
|
|
235
|
-
}
|
|
236
|
-
async readBuffer(length) {
|
|
237
|
-
this.ensureAvailable(length);
|
|
238
|
-
const buffer = new Uint8Array(length);
|
|
239
|
-
await this.tokenizer.readBuffer(buffer);
|
|
240
|
-
this.remaining -= length;
|
|
241
|
-
return buffer;
|
|
242
|
-
}
|
|
243
|
-
async ignoreRemaining() {
|
|
244
|
-
const ignored = await this.tokenizer.ignore(this.remaining);
|
|
245
|
-
if (ignored !== this.remaining) {
|
|
246
|
-
throw new AsfContentParseError(`Unexpected end of ASF Codec List Object; missing ${this.remaining - ignored} bytes`);
|
|
247
|
-
}
|
|
248
|
-
this.remaining = 0;
|
|
249
|
-
}
|
|
250
|
-
ensureAvailable(length) {
|
|
251
|
-
if (length > this.remaining) {
|
|
252
|
-
throw new AsfContentParseError(`ASF Codec List field size ${length} exceeds remaining object payload size ${this.remaining}`);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
255
|
async function readString(reader) {
|
|
257
256
|
const length = await reader.readNumber(Token.UINT16_LE);
|
|
258
257
|
return (await reader.readToken(new Token.StringType(length * 2, 'utf-16le'))).replace('\0', '');
|
|
@@ -261,19 +260,33 @@ async function readString(reader) {
|
|
|
261
260
|
* 3.5: Read the Codec-List-Object, which provides user-friendly information about the codecs and formats used to encode the content found in the ASF file.
|
|
262
261
|
* Ref: http://drang.s4.xrea.com/program/tips/id3tag/wmp/03_asf_top_level_header_object.html#3_5
|
|
263
262
|
*/
|
|
264
|
-
export async function readCodecEntries(tokenizer, payloadSize) {
|
|
265
|
-
const reader =
|
|
266
|
-
const codecHeader = await reader.readToken(CodecListObjectHeader);
|
|
263
|
+
export async function readCodecEntries(tokenizer, payloadSize, maxEntries = defaultMaxMetadataEntries) {
|
|
264
|
+
const reader = createTokenizerView(tokenizer, payloadSize);
|
|
267
265
|
const entries = [];
|
|
268
|
-
|
|
269
|
-
|
|
266
|
+
try {
|
|
267
|
+
const codecHeader = await reader.readToken(CodecListObjectHeader);
|
|
268
|
+
if (codecHeader.entryCount > maxEntries) {
|
|
269
|
+
throw new AsfContentParseError(`ASF Codec List entry count ${codecHeader.entryCount} exceeds entry limit ${maxEntries}`);
|
|
270
|
+
}
|
|
271
|
+
for (let i = 0; i < codecHeader.entryCount; ++i) {
|
|
272
|
+
entries.push(await readCodecEntry(reader));
|
|
273
|
+
}
|
|
274
|
+
await reader.consumeRemainder();
|
|
275
|
+
}
|
|
276
|
+
catch (error) {
|
|
277
|
+
if (error instanceof EndOfStreamError || error instanceof TokenizerBoundaryError) {
|
|
278
|
+
throw new AsfContentParseError(`Unexpected end of ASF Codec List Object: ${error.message}`);
|
|
279
|
+
}
|
|
280
|
+
throw error;
|
|
281
|
+
}
|
|
282
|
+
finally {
|
|
283
|
+
await reader.close();
|
|
270
284
|
}
|
|
271
|
-
await reader.ignoreRemaining();
|
|
272
285
|
return entries;
|
|
273
286
|
}
|
|
274
287
|
async function readInformation(reader) {
|
|
275
288
|
const length = await reader.readNumber(Token.UINT16_LE);
|
|
276
|
-
return reader.
|
|
289
|
+
return reader.readToken(new Token.Uint8ArrayType(length));
|
|
277
290
|
}
|
|
278
291
|
/**
|
|
279
292
|
* Read Codec-Entries
|
|
@@ -299,22 +312,14 @@ export class ContentDescriptionObjectState extends State {
|
|
|
299
312
|
static guid = AsfGuid.ContentDescriptionObject;
|
|
300
313
|
static contentDescTags = ['Title', 'Author', 'Copyright', 'Description', 'Rating'];
|
|
301
314
|
get(buf, off) {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
}
|
|
315
|
+
const cursor = new ByteCursor(buf, off, this.len, 'Content Description Object');
|
|
316
|
+
const lengths = cursor.bytes(10, 'Truncated Content Description Object');
|
|
305
317
|
const tags = [];
|
|
306
|
-
const data = buf.subarray(off, off + this.len);
|
|
307
|
-
const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
308
|
-
let pos = 10;
|
|
309
318
|
for (const [i, tagName] of ContentDescriptionObjectState.contentDescTags.entries()) {
|
|
310
|
-
const length =
|
|
311
|
-
|
|
312
|
-
throw new AsfContentParseError(`${tagName} length ${length} exceeds Content Description payload`);
|
|
313
|
-
}
|
|
319
|
+
const length = Token.UINT16_LE.get(lengths, i * 2);
|
|
320
|
+
const value = cursor.bytes(length, `${tagName} length ${length} exceeds Content Description payload`);
|
|
314
321
|
if (length > 0) {
|
|
315
|
-
|
|
316
|
-
tags.push({ id: tagName, value: parseUnicodeAttr(data.subarray(pos, end)) });
|
|
317
|
-
pos = end;
|
|
322
|
+
tags.push({ id: tagName, value: parseUnicodeAttr(value) });
|
|
318
323
|
}
|
|
319
324
|
}
|
|
320
325
|
return tags;
|
|
@@ -327,37 +332,20 @@ export class ContentDescriptionObjectState extends State {
|
|
|
327
332
|
export class ExtendedContentDescriptionObjectState extends State {
|
|
328
333
|
static guid = AsfGuid.ExtendedContentDescriptionObject;
|
|
329
334
|
get(buf, off) {
|
|
330
|
-
|
|
331
|
-
throw new AsfContentParseError('Truncated Extended Content Description Object');
|
|
332
|
-
}
|
|
335
|
+
const cursor = new ByteCursor(buf, off, this.len, 'Extended Content Description Object');
|
|
333
336
|
const tags = [];
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
const attrCount = view.getUint16(0, true);
|
|
337
|
-
if (attrCount > (payload.length - 2) / 6) {
|
|
337
|
+
const attrCount = cursor.read(Token.UINT16_LE);
|
|
338
|
+
if (attrCount > cursor.remaining / 6) {
|
|
338
339
|
throw new AsfContentParseError('Extended Content Description count exceeds payload');
|
|
339
340
|
}
|
|
340
|
-
let pos = 2;
|
|
341
341
|
for (let i = 0; i < attrCount; i += 1) {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
}
|
|
350
|
-
const name = parseUnicodeAttr(payload.subarray(pos, pos + nameLen));
|
|
351
|
-
pos += nameLen;
|
|
352
|
-
const valueType = view.getUint16(pos, true);
|
|
353
|
-
pos += 2;
|
|
354
|
-
const valueLen = view.getUint16(pos, true);
|
|
355
|
-
pos += 2;
|
|
356
|
-
if (valueLen > payload.length - pos) {
|
|
357
|
-
throw new AsfContentParseError('Extended Content Description value exceeds payload');
|
|
358
|
-
}
|
|
359
|
-
const value = payload.subarray(pos, pos + valueLen);
|
|
360
|
-
pos += valueLen;
|
|
342
|
+
cursor.require(6, 'Truncated Extended Content Description record');
|
|
343
|
+
const nameLen = cursor.read(Token.UINT16_LE);
|
|
344
|
+
cursor.require(nameLen + 4, 'Extended Content Description name exceeds payload');
|
|
345
|
+
const name = parseUnicodeAttr(cursor.bytes(nameLen, 'Extended Content Description name exceeds payload'));
|
|
346
|
+
const valueType = cursor.read(Token.UINT16_LE);
|
|
347
|
+
const valueLen = cursor.read(Token.UINT16_LE);
|
|
348
|
+
const value = cursor.bytes(valueLen, 'Extended Content Description value exceeds payload');
|
|
361
349
|
this.postProcessTag(tags, name, valueType, value);
|
|
362
350
|
}
|
|
363
351
|
return tags;
|
|
@@ -441,38 +429,20 @@ export class ExtendedStreamPropertiesObjectState extends State {
|
|
|
441
429
|
export class MetadataObjectState extends State {
|
|
442
430
|
static guid = AsfGuid.MetadataObject;
|
|
443
431
|
get(uint8Array, off) {
|
|
444
|
-
|
|
445
|
-
throw new AsfContentParseError('Truncated Metadata Object');
|
|
446
|
-
}
|
|
432
|
+
const cursor = new ByteCursor(uint8Array, off, this.len, 'Metadata Object');
|
|
447
433
|
const tags = [];
|
|
448
|
-
const
|
|
449
|
-
|
|
450
|
-
const descriptionRecordsCount = view.getUint16(0, true);
|
|
451
|
-
if (descriptionRecordsCount > (payload.length - 2) / 12) {
|
|
434
|
+
const descriptionRecordsCount = cursor.read(Token.UINT16_LE);
|
|
435
|
+
if (descriptionRecordsCount > cursor.remaining / 12) {
|
|
452
436
|
throw new AsfContentParseError('Metadata record count exceeds payload');
|
|
453
437
|
}
|
|
454
|
-
let pos = 2;
|
|
455
438
|
for (let i = 0; i < descriptionRecordsCount; i += 1) {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
const
|
|
461
|
-
|
|
462
|
-
const
|
|
463
|
-
pos += 2;
|
|
464
|
-
const dataLen = view.getUint32(pos, true);
|
|
465
|
-
pos += 4;
|
|
466
|
-
if (nameLen > payload.length - pos) {
|
|
467
|
-
throw new AsfContentParseError('Metadata name exceeds payload');
|
|
468
|
-
}
|
|
469
|
-
const name = parseUnicodeAttr(payload.subarray(pos, pos + nameLen));
|
|
470
|
-
pos += nameLen;
|
|
471
|
-
if (dataLen > payload.length - pos) {
|
|
472
|
-
throw new AsfContentParseError('Metadata value exceeds payload');
|
|
473
|
-
}
|
|
474
|
-
const data = payload.subarray(pos, pos + dataLen);
|
|
475
|
-
pos += dataLen;
|
|
439
|
+
cursor.require(12, 'Truncated Metadata record header');
|
|
440
|
+
cursor.read(Token.UINT32_LE); // Reserved and stream number
|
|
441
|
+
const nameLen = cursor.read(Token.UINT16_LE);
|
|
442
|
+
const dataType = cursor.read(Token.UINT16_LE);
|
|
443
|
+
const dataLen = cursor.read(Token.UINT32_LE);
|
|
444
|
+
const name = parseUnicodeAttr(cursor.bytes(nameLen, 'Metadata name exceeds payload'));
|
|
445
|
+
const data = cursor.bytes(dataLen, 'Metadata value exceeds payload');
|
|
476
446
|
this.postProcessTag(tags, name, dataType, data);
|
|
477
447
|
}
|
|
478
448
|
return tags;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import initDebug from 'debug';
|
|
2
2
|
import { EndOfStreamError } from 'strtok3';
|
|
3
3
|
import * as Token from 'token-types';
|
|
4
|
-
import { validateAllocation } from '../common/Allocation.js';
|
|
4
|
+
import { getMaxMetadataEntries, validateAllocation } from '../common/Allocation.js';
|
|
5
5
|
import { BasicParser } from '../common/BasicParser.js';
|
|
6
6
|
import { TrackType } from '../type.js';
|
|
7
7
|
import AsfGuid from './AsfGuid.js';
|
|
@@ -157,13 +157,15 @@ export class AsfParser extends BasicParser {
|
|
|
157
157
|
this.validateAllocationSize(payloadSize, 'Codec List Object');
|
|
158
158
|
let codecs;
|
|
159
159
|
try {
|
|
160
|
-
codecs = await AsfObject.readCodecEntries(this.tokenizer, payloadSize);
|
|
160
|
+
codecs = await AsfObject.readCodecEntries(this.tokenizer, payloadSize, getMaxMetadataEntries(this.options));
|
|
161
161
|
}
|
|
162
162
|
catch (error) {
|
|
163
163
|
const message = error instanceof Error ? error.message : String(error);
|
|
164
164
|
throw new AsfContentParseError(`Invalid ASF Codec List Object: ${message}`);
|
|
165
165
|
}
|
|
166
|
-
|
|
166
|
+
for (const codec of codecs) {
|
|
167
|
+
this.codecs.push(codec);
|
|
168
|
+
}
|
|
167
169
|
const audioCodecs = codecs
|
|
168
170
|
.filter(codec => codec.type.audioCodec)
|
|
169
171
|
.map(codec => codec.codecName)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CommonTagMapper } from '../common/GenericTagMapper.js';
|
|
2
|
+
import { toRatio } from '../common/Util.js';
|
|
2
3
|
/**
|
|
3
4
|
* ASF Metadata tag mappings.
|
|
4
5
|
* See http://msdn.microsoft.com/en-us/library/ms867702.aspx
|
|
@@ -13,6 +14,7 @@ const asfTagMap = {
|
|
|
13
14
|
'WM/OriginalReleaseYear': 'originalyear',
|
|
14
15
|
Description: 'comment',
|
|
15
16
|
'WM/TrackNumber': 'track',
|
|
17
|
+
TotalTracks: 'totaltracks',
|
|
16
18
|
'WM/PartOfSet': 'disk',
|
|
17
19
|
'WM/Genre': 'genre',
|
|
18
20
|
'WM/Composer': 'composer',
|
|
@@ -33,7 +35,14 @@ const asfTagMap = {
|
|
|
33
35
|
'WM/ContentGroupDescription': 'grouping',
|
|
34
36
|
'WM/SubTitle': 'subtitle',
|
|
35
37
|
'WM/SetSubTitle': 'discsubtitle',
|
|
36
|
-
|
|
38
|
+
REPLAYGAIN_TRACK_GAIN: 'replaygain_track_gain',
|
|
39
|
+
REPLAYGAIN_TRACK_PEAK: 'replaygain_track_peak',
|
|
40
|
+
REPLAYGAIN_ALBUM_GAIN: 'replaygain_album_gain',
|
|
41
|
+
REPLAYGAIN_ALBUM_PEAK: 'replaygain_album_peak',
|
|
42
|
+
replaygain_track_gain: 'replaygain_track_gain',
|
|
43
|
+
replaygain_track_peak: 'replaygain_track_peak',
|
|
44
|
+
replaygain_album_gain: 'replaygain_album_gain',
|
|
45
|
+
replaygain_album_peak: 'replaygain_album_peak',
|
|
37
46
|
'WM/IsCompilation': 'compilation',
|
|
38
47
|
'WM/SharedUserRating': 'rating',
|
|
39
48
|
POPULARIMETER: 'rating',
|
|
@@ -83,10 +92,25 @@ export class AsfTagMapper extends CommonTagMapper {
|
|
|
83
92
|
super(['asf'], asfTagMap);
|
|
84
93
|
}
|
|
85
94
|
postMap(tag, warnings) {
|
|
95
|
+
if (this.getCommonName(tag.id)?.startsWith('replaygain_')) {
|
|
96
|
+
const value = typeof tag.value === 'string'
|
|
97
|
+
? tag.value.trim().match(/^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)\s*(dB)?$/i)
|
|
98
|
+
: null;
|
|
99
|
+
const normalized = value ? `${value[1]}${value[2] ? ' dB' : ''}` : undefined;
|
|
100
|
+
const ratio = normalized ? toRatio(normalized) : undefined;
|
|
101
|
+
// A silent peak of zero is valid (its dB value is -Infinity).
|
|
102
|
+
if (!ratio || !Number.isFinite(ratio.ratio) || Number.isNaN(ratio.dB)) {
|
|
103
|
+
warnings.addWarning(`Invalid ASF ReplayGain value for ${tag.id}`);
|
|
104
|
+
tag.id = ''; // Keep invalid values native without mapping them to common metadata.
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
tag.value = normalized;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
86
110
|
switch (tag.id) {
|
|
87
111
|
case 'POPULARIMETER': {
|
|
88
112
|
// popm-style attribute, written by e.g. foobar2000; value is "email|rating|counter"
|
|
89
|
-
const [email, rating] = tag.value.split('|');
|
|
113
|
+
const [email, rating] = tag.value.split('|', 2);
|
|
90
114
|
const value = Number(rating);
|
|
91
115
|
const valid = /^\d+$/.test(rating) && Number.isInteger(value) && value >= 0 && value <= 255;
|
|
92
116
|
if (!valid) {
|
|
@@ -99,7 +123,7 @@ export class AsfTagMapper extends CommonTagMapper {
|
|
|
99
123
|
break;
|
|
100
124
|
}
|
|
101
125
|
case 'WM/SharedUserRating': {
|
|
102
|
-
const keys = tag.id.split(':');
|
|
126
|
+
const keys = tag.id.split(':', 2);
|
|
103
127
|
tag.value = AsfTagMapper.toRating(tag.value);
|
|
104
128
|
tag.id = keys[0];
|
|
105
129
|
break;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { DataType } from './AsfObject.js';
|
|
2
2
|
export type AttributeParser = (buf: Uint8Array) => boolean | string | number | bigint | Uint8Array;
|
|
3
|
-
export declare function getParserForAttr(i: DataType): AttributeParser;
|
|
3
|
+
export declare function getParserForAttr(i: DataType): AttributeParser | undefined;
|
|
4
4
|
export declare function parseUnicodeAttr(uint8Array: Uint8Array): string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import initDebug from 'debug';
|
|
2
2
|
import * as strtok3 from 'strtok3';
|
|
3
3
|
import * as Token from 'token-types';
|
|
4
|
+
import { getMaxMetadataEntries } from '../common/Allocation.js';
|
|
4
5
|
import { BasicParser } from '../common/BasicParser.js';
|
|
5
6
|
import * as CafToken from './CafToken.js';
|
|
6
7
|
import { CafContentError } from './CafToken.js';
|
|
@@ -157,7 +158,17 @@ export class CafParser extends BasicParser {
|
|
|
157
158
|
throw new CafContentError(`Information chunk size ${chunkSize} is too small to hold mNumEntries`);
|
|
158
159
|
}
|
|
159
160
|
const body = await this.readChunkBody(chunkSize, 'Information');
|
|
160
|
-
|
|
161
|
+
const entries = CafToken.parseInfoEntries(body, getMaxMetadataEntries(this.options));
|
|
162
|
+
for (const { key, value } of entries) {
|
|
163
|
+
if (['artist', 'composer', 'lyricist', 'genre'].includes(key)) {
|
|
164
|
+
let count = 1;
|
|
165
|
+
for (let offset = value.indexOf(','); offset >= 0; offset = value.indexOf(',', offset + 1)) {
|
|
166
|
+
++count;
|
|
167
|
+
}
|
|
168
|
+
if (count > getMaxMetadataEntries(this.options)) {
|
|
169
|
+
throw new CafContentError(`Comma-separated value count ${count} exceeds entry limit ${getMaxMetadataEntries(this.options)}`);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
161
172
|
debug(`info key=${key}`);
|
|
162
173
|
await this.metadata.addTag('CAF', key, value);
|
|
163
174
|
}
|
|
@@ -174,7 +185,7 @@ export class CafParser extends BasicParser {
|
|
|
174
185
|
throw new CafContentError(`Channel Layout chunk declares ${header.numberChannelDescriptions} description(s) which exceed its size of ${chunkSize}`);
|
|
175
186
|
}
|
|
176
187
|
const descriptions = descriptionLen > 0
|
|
177
|
-
? CafToken.parseChannelDescriptions(await this.readChunkBody(descriptionLen, 'Channel Layout'), header.numberChannelDescriptions)
|
|
188
|
+
? CafToken.parseChannelDescriptions(await this.readChunkBody(descriptionLen, 'Channel Layout'), header.numberChannelDescriptions, getMaxMetadataEntries(this.options))
|
|
178
189
|
: [];
|
|
179
190
|
await this.addChannelLayout(header, descriptions);
|
|
180
191
|
await this.tokenizer.ignore(chunkSize - bodyLen);
|
|
@@ -65,11 +65,11 @@ export interface IChannelDescription {
|
|
|
65
65
|
}
|
|
66
66
|
export declare const channelDescriptionLen = 20;
|
|
67
67
|
/** Each CAFChannelDescription has a UInt32 label, UInt32 flags and three Float32 coordinates */
|
|
68
|
-
export declare function parseChannelDescriptions(body: Uint8Array, count: number): IChannelDescription[];
|
|
68
|
+
export declare function parseChannelDescriptions(body: Uint8Array, count: number, maxEntries?: number): IChannelDescription[];
|
|
69
69
|
export interface IInfoEntry {
|
|
70
70
|
key: string;
|
|
71
71
|
value: string;
|
|
72
72
|
}
|
|
73
73
|
/** Reads the NUL terminated UTF-8 pairs, the declared entry count is authoritative */
|
|
74
|
-
export declare function parseInfoEntries(body: Uint8Array): IInfoEntry[];
|
|
74
|
+
export declare function parseInfoEntries(body: Uint8Array, maxEntries?: number): IInfoEntry[];
|
|
75
75
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { textDecode } from '@borewit/text-codec';
|
|
2
2
|
import * as Token from 'token-types';
|
|
3
|
+
import { defaultMaxMetadataEntries } from '../common/Allocation.js';
|
|
3
4
|
import { makeUnexpectedFileContentError } from '../ParseError.js';
|
|
4
5
|
export class CafContentError extends makeUnexpectedFileContentError('CAF') {
|
|
5
6
|
}
|
|
@@ -94,10 +95,13 @@ export const ChannelLayoutHeader = {
|
|
|
94
95
|
};
|
|
95
96
|
export const channelDescriptionLen = 20;
|
|
96
97
|
/** Each CAFChannelDescription has a UInt32 label, UInt32 flags and three Float32 coordinates */
|
|
97
|
-
export function parseChannelDescriptions(body, count) {
|
|
98
|
+
export function parseChannelDescriptions(body, count, maxEntries = defaultMaxMetadataEntries) {
|
|
98
99
|
if (count * channelDescriptionLen > body.length) {
|
|
99
100
|
throw new CafContentError(`Channel Layout chunk declares ${count} description(s) for ${body.length} byte(s)`);
|
|
100
101
|
}
|
|
102
|
+
if (count > maxEntries) {
|
|
103
|
+
throw new CafContentError(`Channel Layout description count ${count} exceeds entry limit ${maxEntries}`);
|
|
104
|
+
}
|
|
101
105
|
const descriptions = [];
|
|
102
106
|
for (let i = 0; i < count; ++i) {
|
|
103
107
|
const off = i * channelDescriptionLen;
|
|
@@ -114,7 +118,7 @@ export function parseChannelDescriptions(body, count) {
|
|
|
114
118
|
return descriptions;
|
|
115
119
|
}
|
|
116
120
|
/** Reads the NUL terminated UTF-8 pairs, the declared entry count is authoritative */
|
|
117
|
-
export function parseInfoEntries(body) {
|
|
121
|
+
export function parseInfoEntries(body, maxEntries = defaultMaxMetadataEntries) {
|
|
118
122
|
const readString = (from) => {
|
|
119
123
|
const end = body.indexOf(0, from);
|
|
120
124
|
if (end < 0) {
|
|
@@ -123,6 +127,9 @@ export function parseInfoEntries(body) {
|
|
|
123
127
|
return { value: textDecode(body.subarray(from, end), 'utf8'), next: end + 1 };
|
|
124
128
|
};
|
|
125
129
|
const numEntries = Token.UINT32_BE.get(body, 0);
|
|
130
|
+
if (numEntries > maxEntries) {
|
|
131
|
+
throw new CafContentError(`Information entry count ${numEntries} exceeds entry limit ${maxEntries}`);
|
|
132
|
+
}
|
|
126
133
|
const entries = [];
|
|
127
134
|
let offset = 4;
|
|
128
135
|
for (let i = 0; i < numEntries; ++i) {
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { IGetToken } from '@tokenizer/token';
|
|
2
2
|
import { type IFileInfo, type ITokenizer, type ITokenizerOptions } from 'strtok3';
|
|
3
3
|
import type { IOptions } from '../type.js';
|
|
4
|
+
export declare const defaultMaxMetadataEntries = 100000;
|
|
5
|
+
export declare const defaultMaxChapterCount = 1000;
|
|
4
6
|
type ErrorFactory = (message: string) => Error;
|
|
5
7
|
export declare function getMaxMemoryAllocation(options: IOptions): number;
|
|
8
|
+
/** Limit entries in an individual decoded list or table, independently of byte-buffer limits. */
|
|
9
|
+
export declare function getMaxMetadataEntries(options: IOptions): number;
|
|
10
|
+
/** Maximum chapters returned by supported chapter parsers. */
|
|
11
|
+
export declare function getMaxChapterCount(options: IOptions): number;
|
|
6
12
|
/** Configure the tokenizer safety net once, using the same limit as parser-owned buffers. */
|
|
7
13
|
export declare function getTokenizerOptions(options: IOptions, fileInfo?: IFileInfo): ITokenizerOptions;
|
|
8
14
|
/** Check untrusted lengths before allocating, including accumulated stream payloads. */
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { EndOfStreamError, isRandomAccessTokenizer } from 'strtok3';
|
|
2
2
|
import { UnexpectedFileContentError } from '../ParseError.js';
|
|
3
3
|
const defaultMaxMemoryAllocation = 64 * 1024 * 1024;
|
|
4
|
+
export const defaultMaxMetadataEntries = 100_000;
|
|
5
|
+
export const defaultMaxChapterCount = 1_000;
|
|
4
6
|
const readChunkSize = 64 * 1024;
|
|
5
7
|
const allocationError = message => new UnexpectedFileContentError('metadata', message);
|
|
6
8
|
export function getMaxMemoryAllocation(options) {
|
|
@@ -10,6 +12,22 @@ export function getMaxMemoryAllocation(options) {
|
|
|
10
12
|
}
|
|
11
13
|
return limit;
|
|
12
14
|
}
|
|
15
|
+
/** Limit entries in an individual decoded list or table, independently of byte-buffer limits. */
|
|
16
|
+
export function getMaxMetadataEntries(options) {
|
|
17
|
+
const limit = options.maxMetadataEntries ?? defaultMaxMetadataEntries;
|
|
18
|
+
if (!Number.isSafeInteger(limit) || limit <= 0) {
|
|
19
|
+
throw new RangeError('maxMetadataEntries must be a positive safe integer');
|
|
20
|
+
}
|
|
21
|
+
return limit;
|
|
22
|
+
}
|
|
23
|
+
/** Maximum chapters returned by supported chapter parsers. */
|
|
24
|
+
export function getMaxChapterCount(options) {
|
|
25
|
+
const limit = options.maxChapterCount ?? defaultMaxChapterCount;
|
|
26
|
+
if (!Number.isSafeInteger(limit) || limit <= 0) {
|
|
27
|
+
throw new RangeError('maxChapterCount must be a positive safe integer');
|
|
28
|
+
}
|
|
29
|
+
return limit;
|
|
30
|
+
}
|
|
13
31
|
/** Configure the tokenizer safety net once, using the same limit as parser-owned buffers. */
|
|
14
32
|
export function getTokenizerOptions(options, fileInfo) {
|
|
15
33
|
return { maxBufferSize: getMaxMemoryAllocation(options), fileInfo };
|
|
@@ -8,7 +8,7 @@ export class CommonTagMapper {
|
|
|
8
8
|
// converts 1/10 to no : 1, of : 10
|
|
9
9
|
// or 1 to no : 1, of : 0
|
|
10
10
|
static normalizeTrack(origVal) {
|
|
11
|
-
const split = origVal.toString().split('/');
|
|
11
|
+
const split = origVal.toString().split('/', 2);
|
|
12
12
|
return {
|
|
13
13
|
no: Number.parseInt(split[0], 10) || null,
|
|
14
14
|
of: Number.parseInt(split[1], 10) || null
|
|
@@ -24,6 +24,8 @@ export interface INativeMetadataCollector extends IWarningCollector {
|
|
|
24
24
|
setFormat<K extends keyof IFormat>(key: K, value: IFormat[K]): void;
|
|
25
25
|
registerTagType(tagType: TagType): void;
|
|
26
26
|
addTag(tagType: TagType, tagId: string, value: AnyTagValue): Promise<void>;
|
|
27
|
+
/** Map a derived common value without adding a synthetic native tag. */
|
|
28
|
+
postMap(tagType: TagType, tag: IGenericTag): Promise<void>;
|
|
27
29
|
addStreamInfo(streamInfo: ITrackInfo): void;
|
|
28
30
|
setAudioOnly(): void;
|
|
29
31
|
}
|
|
@@ -2,7 +2,7 @@ import initDebug from 'debug';
|
|
|
2
2
|
import { fileTypeFromBuffer } from 'file-type';
|
|
3
3
|
import { parseLyrics } from '../lrc/LyricsParser.js';
|
|
4
4
|
import { TrackTypeValueToKeyMap } from '../type.js';
|
|
5
|
-
import { getMaxMemoryAllocation } from './Allocation.js';
|
|
5
|
+
import { getMaxMemoryAllocation, getMaxMetadataEntries } from './Allocation.js';
|
|
6
6
|
import { CombinedTagMapper } from './CombinedTagMapper.js';
|
|
7
7
|
import { CommonTagMapper } from './GenericTagMapper.js';
|
|
8
8
|
import { isSingleton, isUnique } from './GenericTagTypes.js';
|
|
@@ -175,10 +175,10 @@ export class MetadataCollector {
|
|
|
175
175
|
tag.value = toRatio(tag.value);
|
|
176
176
|
break;
|
|
177
177
|
case 'replaygain_track_minmax':
|
|
178
|
-
tag.value = tag.value.split(',').map(v => Number.parseInt(v, 10));
|
|
178
|
+
tag.value = tag.value.split(',', 2).map(v => Number.parseInt(v, 10));
|
|
179
179
|
break;
|
|
180
180
|
case 'replaygain_undo': {
|
|
181
|
-
const minMix = tag.value.split(',').map(v => Number.parseInt(v, 10));
|
|
181
|
+
const minMix = tag.value.split(',', 2).map(v => Number.parseInt(v, 10));
|
|
182
182
|
tag.value = {
|
|
183
183
|
leftChannel: minMix[0],
|
|
184
184
|
rightChannel: minMix[1]
|
|
@@ -209,7 +209,7 @@ export class MetadataCollector {
|
|
|
209
209
|
break;
|
|
210
210
|
case 'lyrics':
|
|
211
211
|
if (typeof tag.value === 'string') {
|
|
212
|
-
tag.value = parseLyrics(tag.value);
|
|
212
|
+
tag.value = parseLyrics(tag.value, getMaxMetadataEntries(this.opts ?? {}));
|
|
213
213
|
}
|
|
214
214
|
break;
|
|
215
215
|
default:
|
|
@@ -290,6 +290,23 @@ export class MetadataCollector {
|
|
|
290
290
|
* Convert native tag to common tags
|
|
291
291
|
*/
|
|
292
292
|
async toCommon(tagType, tagId, value) {
|
|
293
|
+
// Expand involved-person roles for mapping without adding synthetic native tags.
|
|
294
|
+
if (((tagType === 'ID3v2.2' && tagId === 'IPL') ||
|
|
295
|
+
(tagType === 'ID3v2.3' && tagId === 'IPLS') ||
|
|
296
|
+
(tagType === 'ID3v2.4' && tagId === 'TIPL')) &&
|
|
297
|
+
value !== null &&
|
|
298
|
+
typeof value === 'object') {
|
|
299
|
+
for (const [role, people] of Object.entries(value)) {
|
|
300
|
+
if (Array.isArray(people)) {
|
|
301
|
+
for (const person of people) {
|
|
302
|
+
if (typeof person === 'string' && person.length > 0) {
|
|
303
|
+
await this.toCommon(tagType, `${tagId}:${role}`, person);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
293
310
|
const tag = { id: tagId, value };
|
|
294
311
|
const genericTag = this.tagMapper.mapTag(tagType, tag, this);
|
|
295
312
|
if (genericTag) {
|
|
@@ -9,6 +9,10 @@ export declare function getBit(buf: Uint8Array, off: number, bit: number): boole
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function findZero(uint8Array: Uint8Array, encoding?: StringEncoding): number;
|
|
11
11
|
export declare function trimRightNull(x: string): string;
|
|
12
|
+
/** Split text, validating the value count before allocation. By default, omit empty segments except for empty results. */
|
|
13
|
+
export declare function splitText(text: string, separator: string, context: string, validateCount: (count: number, context: string) => void, { keepEmpty }?: {
|
|
14
|
+
keepEmpty?: boolean;
|
|
15
|
+
}): string[];
|
|
12
16
|
/**
|
|
13
17
|
* Decode string
|
|
14
18
|
*/
|
|
@@ -33,6 +33,39 @@ export function trimRightNull(x) {
|
|
|
33
33
|
const pos0 = x.indexOf('\0');
|
|
34
34
|
return pos0 === -1 ? x : x.substring(0, pos0);
|
|
35
35
|
}
|
|
36
|
+
/** Split text, validating the value count before allocation. By default, omit empty segments except for empty results. */
|
|
37
|
+
export function splitText(text, separator, context, validateCount, { keepEmpty = false } = {}) {
|
|
38
|
+
if (separator.length === 0) {
|
|
39
|
+
throw new RangeError('Text separator must not be empty');
|
|
40
|
+
}
|
|
41
|
+
let count = 0;
|
|
42
|
+
let start = 0;
|
|
43
|
+
for (let end = text.indexOf(separator); end >= 0; end = text.indexOf(separator, start)) {
|
|
44
|
+
if (keepEmpty || end > start) {
|
|
45
|
+
++count;
|
|
46
|
+
}
|
|
47
|
+
start = end + separator.length;
|
|
48
|
+
}
|
|
49
|
+
if (keepEmpty || start < text.length) {
|
|
50
|
+
++count;
|
|
51
|
+
}
|
|
52
|
+
validateCount(Math.max(count, 1), context);
|
|
53
|
+
const values = [];
|
|
54
|
+
start = 0;
|
|
55
|
+
for (let end = text.indexOf(separator); end >= 0; end = text.indexOf(separator, start)) {
|
|
56
|
+
if (keepEmpty || end > start) {
|
|
57
|
+
values.push(text.slice(start, end));
|
|
58
|
+
}
|
|
59
|
+
start = end + separator.length;
|
|
60
|
+
}
|
|
61
|
+
if (keepEmpty || start < text.length) {
|
|
62
|
+
values.push(text.slice(start));
|
|
63
|
+
}
|
|
64
|
+
else if (values.length === 0) {
|
|
65
|
+
values.push('');
|
|
66
|
+
}
|
|
67
|
+
return values;
|
|
68
|
+
}
|
|
36
69
|
function swapBytes(uint8Array) {
|
|
37
70
|
const l = uint8Array.length;
|
|
38
71
|
if ((l & 1) !== 0) {
|
|
@@ -133,7 +166,7 @@ export function dbToRatio(dB) {
|
|
|
133
166
|
* @param value string holding a ratio like '0.034' or '-7.54 dB'
|
|
134
167
|
*/
|
|
135
168
|
export function toRatio(value) {
|
|
136
|
-
const ps = value.split(' ').map(p => p.trim().toLowerCase());
|
|
169
|
+
const ps = value.split(' ', 2).map(p => p.trim().toLowerCase());
|
|
137
170
|
if (ps.length >= 1) {
|
|
138
171
|
const v = Number.parseFloat(ps[0]);
|
|
139
172
|
return ps.length === 2 && ps[1] === 'db'
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type IGetToken } from 'strtok3';
|
|
1
2
|
import { BasicParser } from '../common/BasicParser.js';
|
|
2
3
|
declare const DsdiffContentParseError_base: {
|
|
3
4
|
new (message: string): {
|
|
@@ -21,11 +22,13 @@ export declare class DsdiffContentParseError extends DsdiffContentParseError_bas
|
|
|
21
22
|
* - http://www.sonicstudio.com/pdf/dsd/DSDIFF_1.5_Spec.pdf
|
|
22
23
|
*/
|
|
23
24
|
export declare class DsdiffParser extends BasicParser {
|
|
25
|
+
private input;
|
|
26
|
+
protected readToken<T>(token: IGetToken<T>): Promise<T>;
|
|
24
27
|
parse(): Promise<void>;
|
|
25
28
|
private validateChunkSize;
|
|
26
29
|
private requireChunkSize;
|
|
27
30
|
private ignoreBytes;
|
|
28
|
-
private
|
|
31
|
+
private readChunks;
|
|
29
32
|
private readData;
|
|
30
33
|
private handleSoundPropertyChunks;
|
|
31
34
|
private handleChannelChunks;
|