@openclaw/matrix 2026.11.5-beta.4 → 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
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import type { IGetToken } from '@tokenizer/token';
|
|
2
|
+
export interface IFileInfo {
|
|
3
|
+
/**
|
|
4
|
+
* File size in bytes
|
|
5
|
+
*/
|
|
6
|
+
size?: number;
|
|
7
|
+
/**
|
|
8
|
+
* MIME-type of file
|
|
9
|
+
*/
|
|
10
|
+
mimeType?: string;
|
|
11
|
+
/**
|
|
12
|
+
* File path
|
|
13
|
+
*/
|
|
14
|
+
path?: string;
|
|
15
|
+
/**
|
|
16
|
+
* File URL
|
|
17
|
+
*/
|
|
18
|
+
url?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface IRandomAccessFileInfo extends IFileInfo {
|
|
21
|
+
/**
|
|
22
|
+
* File size in bytes
|
|
23
|
+
*/
|
|
24
|
+
size: number;
|
|
25
|
+
}
|
|
26
|
+
export interface IReadChunkOptions {
|
|
27
|
+
/**
|
|
28
|
+
* Number of bytes to read.
|
|
29
|
+
*/
|
|
30
|
+
length?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Position where to begin reading from the file.
|
|
33
|
+
* Default it is `tokenizer.position`.
|
|
34
|
+
* Position may not be less than `tokenizer.position`, unless `supportsRandomAccess()` returns `true`.
|
|
35
|
+
*/
|
|
36
|
+
position?: number;
|
|
37
|
+
/**
|
|
38
|
+
* If set, will not throw an EOF error if not all off the requested data could be read
|
|
39
|
+
*/
|
|
40
|
+
mayBeLess?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface IRandomAccessTokenizer extends ITokenizer {
|
|
43
|
+
/**
|
|
44
|
+
* Provide access to information of the underlying information stream or file.
|
|
45
|
+
*/
|
|
46
|
+
fileInfo: IRandomAccessFileInfo;
|
|
47
|
+
/**
|
|
48
|
+
* Change the position (offset) of the tokenizer
|
|
49
|
+
* @param position New position, a non-negative safe integer. May be past EOF.
|
|
50
|
+
*/
|
|
51
|
+
setPosition(position: number): void;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The tokenizer allows us to read or peek from the tokenizer-stream.
|
|
55
|
+
* The tokenizer-stream is an abstraction of a stream, file or Buffer.
|
|
56
|
+
*/
|
|
57
|
+
export interface ITokenizer {
|
|
58
|
+
/**
|
|
59
|
+
* Provide access to information of the underlying information stream or file.
|
|
60
|
+
*/
|
|
61
|
+
readonly fileInfo: IFileInfo;
|
|
62
|
+
/**
|
|
63
|
+
* Offset in bytes (= number of bytes read) since beginning of file or stream
|
|
64
|
+
*/
|
|
65
|
+
readonly position: number;
|
|
66
|
+
/**
|
|
67
|
+
* Peek (read ahead) buffer from tokenizer
|
|
68
|
+
* @param buffer - Target buffer to fill with data peek from the tokenizer-stream
|
|
69
|
+
* @param options - Read behaviour options
|
|
70
|
+
* @returns Promise with number of bytes read
|
|
71
|
+
*/
|
|
72
|
+
peekBuffer(buffer: Uint8Array, options?: IReadChunkOptions): Promise<number>;
|
|
73
|
+
/**
|
|
74
|
+
* Peek (read ahead) buffer from tokenizer
|
|
75
|
+
* @param buffer - Target buffer to fill with data peeked from the tokenizer-stream
|
|
76
|
+
* @param options - Additional read options
|
|
77
|
+
* @returns Promise with number of bytes read
|
|
78
|
+
*/
|
|
79
|
+
readBuffer(buffer: Uint8Array, options?: IReadChunkOptions): Promise<number>;
|
|
80
|
+
/**
|
|
81
|
+
* Peek a token from the tokenizer-stream.
|
|
82
|
+
* @param token - Token to peek from the tokenizer-stream.
|
|
83
|
+
* @param position - Offset where to begin reading within the file. If position is null, data will be read from the current file position.
|
|
84
|
+
* @param maybeless - If set, will not throw an EOF error if the less then the requested length could be read.
|
|
85
|
+
*/
|
|
86
|
+
peekToken<T>(token: IGetToken<T>, position?: number | null, maybeless?: boolean): Promise<T>;
|
|
87
|
+
/**
|
|
88
|
+
* Read a token from the tokenizer-stream.
|
|
89
|
+
* @param token - Token to peek from the tokenizer-stream.
|
|
90
|
+
* @param position - Offset where to begin reading within the file. If position is null, data will be read from the current file position.
|
|
91
|
+
*/
|
|
92
|
+
readToken<T>(token: IGetToken<T>, position?: number): Promise<T>;
|
|
93
|
+
/**
|
|
94
|
+
* Peek a numeric token from the stream
|
|
95
|
+
* @param token - Numeric token
|
|
96
|
+
* @returns Promise with number
|
|
97
|
+
*/
|
|
98
|
+
peekNumber(token: IGetToken<number>): Promise<number>;
|
|
99
|
+
/**
|
|
100
|
+
* Read a numeric token from the stream
|
|
101
|
+
* @param token - Numeric token
|
|
102
|
+
* @returns Promise with number
|
|
103
|
+
*/
|
|
104
|
+
readNumber(token: IGetToken<number>): Promise<number>;
|
|
105
|
+
/**
|
|
106
|
+
* Ignore given number of bytes
|
|
107
|
+
* @param length - Number of bytes ignored
|
|
108
|
+
*/
|
|
109
|
+
ignore(length: number): Promise<number>;
|
|
110
|
+
/**
|
|
111
|
+
* Clean up resources.
|
|
112
|
+
* It does not close the stream for StreamReader, but is does close the file-descriptor.
|
|
113
|
+
*/
|
|
114
|
+
close(): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Abort pending asynchronous operations
|
|
117
|
+
*/
|
|
118
|
+
abort(): Promise<void>;
|
|
119
|
+
/**
|
|
120
|
+
* Returns true when the underlying file supports random access
|
|
121
|
+
*/
|
|
122
|
+
supportsRandomAccess(): boolean;
|
|
123
|
+
}
|
|
124
|
+
export type OnClose = () => Promise<void>;
|
|
125
|
+
export interface ITokenizerOptions {
|
|
126
|
+
/**
|
|
127
|
+
* Maximum bytes in a dynamically sized tokenizer buffer or stream lookahead span.
|
|
128
|
+
* Set once when creating the tokenizer; applies to subsequent reads and peeks.
|
|
129
|
+
* Disabled by default (Infinity). Must be a positive safe integer or Infinity.
|
|
130
|
+
* Does not limit total process memory, caller-owned buffers, or decoded token values.
|
|
131
|
+
*/
|
|
132
|
+
maxBufferSize?: number;
|
|
133
|
+
/**
|
|
134
|
+
* Pass additional file information to the tokenizer
|
|
135
|
+
*/
|
|
136
|
+
fileInfo?: IFileInfo;
|
|
137
|
+
/**
|
|
138
|
+
* Asynchronous callback invoked at most once when a buffer, blob, or file tokenizer is closed.
|
|
139
|
+
* Stream tokenizers manage their reader directly and do not invoke this callback.
|
|
140
|
+
*/
|
|
141
|
+
onClose?: OnClose;
|
|
142
|
+
/**
|
|
143
|
+
* Pass `AbortSignal` which can stop active async operations
|
|
144
|
+
* Ref: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
|
|
145
|
+
*/
|
|
146
|
+
abortSignal?: AbortSignal;
|
|
147
|
+
}
|
|
148
|
+
/** A finite, borrowed range of a tokenizer with positions relative to its start. */
|
|
149
|
+
export interface ITokenizerView extends ITokenizer {
|
|
150
|
+
/** Declared range size; this is not a guarantee that the source contains all bytes. */
|
|
151
|
+
readonly fileInfo: IRandomAccessFileInfo;
|
|
152
|
+
/** Declared bytes between the shared cursor and the end of the view. */
|
|
153
|
+
readonly remaining: number;
|
|
154
|
+
/** Create a nested view at the current position without consuming input. */
|
|
155
|
+
createView(length: number): ITokenizerView;
|
|
156
|
+
/** Consume exactly the remaining bytes, rejecting with EndOfStreamError on truncation. */
|
|
157
|
+
consumeRemainder(): Promise<number>;
|
|
158
|
+
}
|
|
159
|
+
/** A view exposes position control only when its source supports random access. */
|
|
160
|
+
export interface IRandomAccessTokenizerView extends ITokenizerView, IRandomAccessTokenizer {
|
|
161
|
+
readonly fileInfo: IRandomAccessFileInfo;
|
|
162
|
+
createView(length: number): IRandomAccessTokenizerView;
|
|
163
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "strtok3",
|
|
3
|
+
"version": "10.6.3",
|
|
4
|
+
"description": "A promise based streaming tokenizer",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Borewit",
|
|
7
|
+
"url": "https://github.com/Borewit"
|
|
8
|
+
},
|
|
9
|
+
"funding": {
|
|
10
|
+
"type": "github",
|
|
11
|
+
"url": "https://github.com/sponsors/Borewit"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"clean": "del-cli 'lib/**/*.js' 'lib/**/*.js.map' 'lib/**/*.d.ts' 'test/**/*.js' 'test/**/*.js.map'",
|
|
15
|
+
"compile-src": "tsc -p lib --sourceMap false",
|
|
16
|
+
"compile-src:dev": "tsc -p lib --sourceMap --inlineSources",
|
|
17
|
+
"compile-test": "tsc -p test",
|
|
18
|
+
"compile": "yarn run compile-src && yarn run compile-test && yarn run test:types",
|
|
19
|
+
"build": "yarn run clean && yarn run compile",
|
|
20
|
+
"build:dev": "yarn run clean && yarn run compile-test && yarn run compile-src:dev && yarn run test:types",
|
|
21
|
+
"prepublishOnly": "yarn run build",
|
|
22
|
+
"eslint": "eslint lib test",
|
|
23
|
+
"lint:md": "remark -u preset-lint-recommended .",
|
|
24
|
+
"lint:ts": "biome check",
|
|
25
|
+
"lint": "yarn run lint:md && yarn run lint:ts",
|
|
26
|
+
"fix": "yarn run lint:ts:fix",
|
|
27
|
+
"test": "mocha",
|
|
28
|
+
"test:types": "tsc -p test/types && tsc -p test/types/tsconfig.browser.json",
|
|
29
|
+
"bun:test": "bun run --bun test",
|
|
30
|
+
"test-coverage": "c8 yarn run test",
|
|
31
|
+
"start": "yarn run compile && yarn run lint && yarn run cover-test",
|
|
32
|
+
"update-biome": "yarn add -D --exact @biomejs/biome && npx @biomejs/biome migrate --write",
|
|
33
|
+
"lint:ts:fix": "biome check --write"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=18"
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/Borewit/strtok3.git"
|
|
41
|
+
},
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"type": "module",
|
|
44
|
+
"exports": {
|
|
45
|
+
".": {
|
|
46
|
+
"node": "./lib/index.js",
|
|
47
|
+
"default": "./lib/core.js"
|
|
48
|
+
},
|
|
49
|
+
"./core": "./lib/core.js"
|
|
50
|
+
},
|
|
51
|
+
"types": "lib/index.d.ts",
|
|
52
|
+
"files": [
|
|
53
|
+
"lib/**/*.js",
|
|
54
|
+
"lib/**/*.d.ts"
|
|
55
|
+
],
|
|
56
|
+
"bugs": {
|
|
57
|
+
"url": "https://github.com/Borewit/strtok3/issues"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@tokenizer/token": "^0.3.0"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@biomejs/biome": "2.5.15",
|
|
64
|
+
"@types/chai": "^5.2.3",
|
|
65
|
+
"@types/chai-as-promised": "^8.0.2",
|
|
66
|
+
"@types/debug": "^4.1.13",
|
|
67
|
+
"@types/mocha": "^10.0.10",
|
|
68
|
+
"@types/node": "^26.6.5",
|
|
69
|
+
"c8": "^12.0.0",
|
|
70
|
+
"chai": "^6.3.0",
|
|
71
|
+
"chai-as-promised": "^8.0.2",
|
|
72
|
+
"del-cli": "^8.0.1",
|
|
73
|
+
"mocha": "^11.8.0",
|
|
74
|
+
"node-readable-to-web-readable-stream": "^0.4.2",
|
|
75
|
+
"remark-cli": "^12.0.1",
|
|
76
|
+
"remark-preset-lint-recommended": "^7.0.1",
|
|
77
|
+
"token-types": "^6.1.2",
|
|
78
|
+
"tsx": "^4.23.15",
|
|
79
|
+
"typescript": "^7.0.2",
|
|
80
|
+
"uint8array-extras": "^1.6.0"
|
|
81
|
+
},
|
|
82
|
+
"keywords": [
|
|
83
|
+
"tokenizer",
|
|
84
|
+
"reader",
|
|
85
|
+
"token",
|
|
86
|
+
"async",
|
|
87
|
+
"promise",
|
|
88
|
+
"parser",
|
|
89
|
+
"decoder",
|
|
90
|
+
"binary",
|
|
91
|
+
"endian",
|
|
92
|
+
"uint",
|
|
93
|
+
"stream",
|
|
94
|
+
"streaming"
|
|
95
|
+
],
|
|
96
|
+
"packageManager": "yarn@4.18.1"
|
|
97
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenizer/inflate",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Tokenized zip support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./lib/index.js",
|
|
@@ -34,23 +34,23 @@
|
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"packageManager": "yarn@4.18.1",
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@aws-sdk/client-s3": "^3.
|
|
37
|
+
"@aws-sdk/client-s3": "^3.1152.0",
|
|
38
38
|
"@biomejs/biome": "2.5.15",
|
|
39
39
|
"@tokenizer/s3": "^1.0.4",
|
|
40
40
|
"@types/chai": "^5.2.3",
|
|
41
41
|
"@types/debug": "^4",
|
|
42
42
|
"@types/mocha": "^10.0.10",
|
|
43
|
-
"@types/node": "^26.6.
|
|
43
|
+
"@types/node": "^26.6.5",
|
|
44
44
|
"chai": "^6.3.0",
|
|
45
45
|
"del-cli": "^8.0.1",
|
|
46
|
-
"file-type": "^22.
|
|
46
|
+
"file-type": "^22.2.0",
|
|
47
47
|
"mocha": "^12.0.3",
|
|
48
|
-
"strtok3": "^10.5.0",
|
|
49
48
|
"tsx": "^4.23.15",
|
|
50
49
|
"typescript": "^7.0.2"
|
|
51
50
|
},
|
|
52
51
|
"dependencies": {
|
|
53
52
|
"debug": "^4.4.3",
|
|
53
|
+
"strtok3": "^10.6.2",
|
|
54
54
|
"token-types": "^6.1.2"
|
|
55
55
|
},
|
|
56
56
|
"repository": {
|
|
@@ -204,19 +204,19 @@ import "fake-indexeddb/auto";
|
|
|
204
204
|
|
|
205
205
|
## Quality
|
|
206
206
|
|
|
207
|
-
Here's a comparison of fake-indexeddb and real browser IndexedDB implementations on [the Web Platform Tests IndexedDB suite](https://wpt.fyi/results/IndexedDB) as of <!-- last_updated_date_start -->
|
|
207
|
+
Here's a comparison of fake-indexeddb and real browser IndexedDB implementations on [the Web Platform Tests IndexedDB suite](https://wpt.fyi/results/IndexedDB) as of <!-- last_updated_date_start -->October 29, 2026<!-- last_updated_date_end -->:
|
|
208
208
|
|
|
209
209
|
<!-- DO NOT MANUALLY OVERWRITE THE TABLE BELOW! -->
|
|
210
210
|
<!-- To update the results, run `pnpm run update-wpt-results` -->
|
|
211
211
|
<!-- wpt_results_start -->
|
|
212
|
-
<!-- wpt_results_total=
|
|
212
|
+
<!-- wpt_results_total=1678 -->
|
|
213
213
|
| Implementation | Version | Passed | % |
|
|
214
214
|
| --- | --- | --- | --- |
|
|
215
|
-
| Chrome |
|
|
216
|
-
| Firefox |
|
|
217
|
-
| Safari |
|
|
218
|
-
| Ladybird | 1.0-
|
|
219
|
-
| fake-indexeddb | 6.2.
|
|
215
|
+
| Chrome | 159.0.8130.0 | 1672 | 99.6% |
|
|
216
|
+
| Firefox | 161.0a1 | 1671 | 99.6% |
|
|
217
|
+
| Safari | 255 preview | 1676 | 99.9% |
|
|
218
|
+
| Ladybird | 1.0-28077c350dc | 1668 | 99.4% |
|
|
219
|
+
| fake-indexeddb | 6.2.7 | 1369 | 81.6% |
|
|
220
220
|
<!-- wpt_results_end -->
|
|
221
221
|
|
|
222
222
|
Keep in mind that these tests include a lot of edge cases (such as rare error conditions), so even hitting ~40% likely means that the core IndexedDB functionality is covered. Your app will probably work fine.
|
|
@@ -82,11 +82,14 @@ class Index {
|
|
|
82
82
|
return records;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
//
|
|
86
|
-
|
|
85
|
+
// The index key that an object store record with this value is stored under, or undefined if the value does not
|
|
86
|
+
// belong in this index. For a multiEntry index given an array, this is the array of individual index keys (invalid
|
|
87
|
+
// and duplicate elements removed). Shared by storeRecord and deleteRecord so that deletion finds exactly what
|
|
88
|
+
// insertion stored.
|
|
89
|
+
getIndexKey(value) {
|
|
87
90
|
let indexKey;
|
|
88
91
|
try {
|
|
89
|
-
indexKey = (0, _extractKey.default)(this.keyPath,
|
|
92
|
+
indexKey = (0, _extractKey.default)(this.keyPath, value).key;
|
|
90
93
|
} catch (err) {
|
|
91
94
|
if (err.name === "DataError") {
|
|
92
95
|
// Invalid key is not an actual error, just means we do not store an entry in this index
|
|
@@ -100,20 +103,29 @@ class Index {
|
|
|
100
103
|
} catch (e) {
|
|
101
104
|
return;
|
|
102
105
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
106
|
+
return indexKey;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// remove any elements from index key that are not valid keys and remove any duplicate elements from index
|
|
110
|
+
// key such that only one instance of the duplicate value remains.
|
|
111
|
+
const keep = [];
|
|
112
|
+
for (const part of indexKey) {
|
|
113
|
+
if (keep.indexOf(part) < 0) {
|
|
114
|
+
try {
|
|
115
|
+
keep.push((0, _valueToKey.default)(part));
|
|
116
|
+
} catch (err) {
|
|
117
|
+
/* Do nothing */
|
|
114
118
|
}
|
|
115
119
|
}
|
|
116
|
-
|
|
120
|
+
}
|
|
121
|
+
return keep;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#dfn-steps-for-storing-a-record-into-an-object-store (step 7)
|
|
125
|
+
storeRecord(newRecord) {
|
|
126
|
+
const indexKey = this.getIndexKey(newRecord.value);
|
|
127
|
+
if (indexKey === undefined) {
|
|
128
|
+
return;
|
|
117
129
|
}
|
|
118
130
|
if (!this.multiEntry || !Array.isArray(indexKey)) {
|
|
119
131
|
if (this.unique) {
|
|
@@ -122,6 +134,10 @@ class Index {
|
|
|
122
134
|
throw new _errors.ConstraintError();
|
|
123
135
|
}
|
|
124
136
|
}
|
|
137
|
+
this.records.put({
|
|
138
|
+
key: indexKey,
|
|
139
|
+
value: newRecord.key
|
|
140
|
+
});
|
|
125
141
|
} else {
|
|
126
142
|
if (this.unique) {
|
|
127
143
|
for (const individualIndexKey of indexKey) {
|
|
@@ -131,13 +147,6 @@ class Index {
|
|
|
131
147
|
}
|
|
132
148
|
}
|
|
133
149
|
}
|
|
134
|
-
}
|
|
135
|
-
if (!this.multiEntry || !Array.isArray(indexKey)) {
|
|
136
|
-
this.records.put({
|
|
137
|
-
key: indexKey,
|
|
138
|
-
value: newRecord.key
|
|
139
|
-
});
|
|
140
|
-
} else {
|
|
141
150
|
for (const individualIndexKey of indexKey) {
|
|
142
151
|
this.records.put({
|
|
143
152
|
key: individualIndexKey,
|
|
@@ -146,6 +155,22 @@ class Index {
|
|
|
146
155
|
}
|
|
147
156
|
}
|
|
148
157
|
}
|
|
158
|
+
|
|
159
|
+
// Remove the index records that storeRecord created for this object store record. Looking them up by index key is
|
|
160
|
+
// O(log n) per index record, where scanning the whole index for records pointing at this primary key is O(n).
|
|
161
|
+
deleteRecord(record) {
|
|
162
|
+
const indexKey = this.getIndexKey(record.value);
|
|
163
|
+
if (indexKey === undefined) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if (!this.multiEntry || !Array.isArray(indexKey)) {
|
|
167
|
+
this.records.deleteByKeyAndValue(indexKey, record.key);
|
|
168
|
+
} else {
|
|
169
|
+
for (const individualIndexKey of indexKey) {
|
|
170
|
+
this.records.deleteByKeyAndValue(individualIndexKey, record.key);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
149
174
|
initialize(transaction) {
|
|
150
175
|
if (this.initialized) {
|
|
151
176
|
throw new Error("Index already initialized");
|
|
@@ -176,7 +176,7 @@ class ObjectStore {
|
|
|
176
176
|
// Delete existing indexes
|
|
177
177
|
if (existingRecord) {
|
|
178
178
|
for (const rawIndex of this.rawIndexes.values()) {
|
|
179
|
-
rawIndex.
|
|
179
|
+
rawIndex.deleteRecord(existingRecord);
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
|
|
@@ -210,7 +210,9 @@ class ObjectStore {
|
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
for (const rawIndex of this.rawIndexes.values()) {
|
|
213
|
-
|
|
213
|
+
for (const record of deletedRecords) {
|
|
214
|
+
rawIndex.deleteRecord(record);
|
|
215
|
+
}
|
|
214
216
|
}
|
|
215
217
|
}
|
|
216
218
|
|
|
@@ -34,16 +34,21 @@ class RecordStore {
|
|
|
34
34
|
}
|
|
35
35
|
return deletedRecords;
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Delete the record with this key and this value, if there is one. Used by indexes, where the value is the primary
|
|
40
|
+
* key of the object store record that the index record points to.
|
|
41
|
+
*/
|
|
42
|
+
deleteByKeyAndValue(key, value) {
|
|
43
|
+
// In a non-unique store the value is part of the sort order, so this finds the exact record. In a unique store
|
|
44
|
+
// it finds the only record with this key, which may point at a different primary key.
|
|
45
|
+
const record = this.records.get({
|
|
46
|
+
key,
|
|
47
|
+
value
|
|
48
|
+
});
|
|
49
|
+
if (record !== undefined && (0, _cmp.cmpKeys)(record.value, value) === 0) {
|
|
50
|
+
this.records.delete(record);
|
|
45
51
|
}
|
|
46
|
-
return deletedRecords;
|
|
47
52
|
}
|
|
48
53
|
clear() {
|
|
49
54
|
const deletedRecords = [...this.records.getAllRecords()];
|
|
@@ -75,11 +75,14 @@ class Index {
|
|
|
75
75
|
return records;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
//
|
|
79
|
-
|
|
78
|
+
// The index key that an object store record with this value is stored under, or undefined if the value does not
|
|
79
|
+
// belong in this index. For a multiEntry index given an array, this is the array of individual index keys (invalid
|
|
80
|
+
// and duplicate elements removed). Shared by storeRecord and deleteRecord so that deletion finds exactly what
|
|
81
|
+
// insertion stored.
|
|
82
|
+
getIndexKey(value) {
|
|
80
83
|
let indexKey;
|
|
81
84
|
try {
|
|
82
|
-
indexKey = extractKey(this.keyPath,
|
|
85
|
+
indexKey = extractKey(this.keyPath, value).key;
|
|
83
86
|
} catch (err) {
|
|
84
87
|
if (err.name === "DataError") {
|
|
85
88
|
// Invalid key is not an actual error, just means we do not store an entry in this index
|
|
@@ -93,20 +96,29 @@ class Index {
|
|
|
93
96
|
} catch (e) {
|
|
94
97
|
return;
|
|
95
98
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
99
|
+
return indexKey;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// remove any elements from index key that are not valid keys and remove any duplicate elements from index
|
|
103
|
+
// key such that only one instance of the duplicate value remains.
|
|
104
|
+
const keep = [];
|
|
105
|
+
for (const part of indexKey) {
|
|
106
|
+
if (keep.indexOf(part) < 0) {
|
|
107
|
+
try {
|
|
108
|
+
keep.push(valueToKey(part));
|
|
109
|
+
} catch (err) {
|
|
110
|
+
/* Do nothing */
|
|
107
111
|
}
|
|
108
112
|
}
|
|
109
|
-
|
|
113
|
+
}
|
|
114
|
+
return keep;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#dfn-steps-for-storing-a-record-into-an-object-store (step 7)
|
|
118
|
+
storeRecord(newRecord) {
|
|
119
|
+
const indexKey = this.getIndexKey(newRecord.value);
|
|
120
|
+
if (indexKey === undefined) {
|
|
121
|
+
return;
|
|
110
122
|
}
|
|
111
123
|
if (!this.multiEntry || !Array.isArray(indexKey)) {
|
|
112
124
|
if (this.unique) {
|
|
@@ -115,6 +127,10 @@ class Index {
|
|
|
115
127
|
throw new ConstraintError();
|
|
116
128
|
}
|
|
117
129
|
}
|
|
130
|
+
this.records.put({
|
|
131
|
+
key: indexKey,
|
|
132
|
+
value: newRecord.key
|
|
133
|
+
});
|
|
118
134
|
} else {
|
|
119
135
|
if (this.unique) {
|
|
120
136
|
for (const individualIndexKey of indexKey) {
|
|
@@ -124,13 +140,6 @@ class Index {
|
|
|
124
140
|
}
|
|
125
141
|
}
|
|
126
142
|
}
|
|
127
|
-
}
|
|
128
|
-
if (!this.multiEntry || !Array.isArray(indexKey)) {
|
|
129
|
-
this.records.put({
|
|
130
|
-
key: indexKey,
|
|
131
|
-
value: newRecord.key
|
|
132
|
-
});
|
|
133
|
-
} else {
|
|
134
143
|
for (const individualIndexKey of indexKey) {
|
|
135
144
|
this.records.put({
|
|
136
145
|
key: individualIndexKey,
|
|
@@ -139,6 +148,22 @@ class Index {
|
|
|
139
148
|
}
|
|
140
149
|
}
|
|
141
150
|
}
|
|
151
|
+
|
|
152
|
+
// Remove the index records that storeRecord created for this object store record. Looking them up by index key is
|
|
153
|
+
// O(log n) per index record, where scanning the whole index for records pointing at this primary key is O(n).
|
|
154
|
+
deleteRecord(record) {
|
|
155
|
+
const indexKey = this.getIndexKey(record.value);
|
|
156
|
+
if (indexKey === undefined) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (!this.multiEntry || !Array.isArray(indexKey)) {
|
|
160
|
+
this.records.deleteByKeyAndValue(indexKey, record.key);
|
|
161
|
+
} else {
|
|
162
|
+
for (const individualIndexKey of indexKey) {
|
|
163
|
+
this.records.deleteByKeyAndValue(individualIndexKey, record.key);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
142
167
|
initialize(transaction) {
|
|
143
168
|
if (this.initialized) {
|
|
144
169
|
throw new Error("Index already initialized");
|
|
@@ -169,7 +169,7 @@ class ObjectStore {
|
|
|
169
169
|
// Delete existing indexes
|
|
170
170
|
if (existingRecord) {
|
|
171
171
|
for (const rawIndex of this.rawIndexes.values()) {
|
|
172
|
-
rawIndex.
|
|
172
|
+
rawIndex.deleteRecord(existingRecord);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
|
|
@@ -203,7 +203,9 @@ class ObjectStore {
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
for (const rawIndex of this.rawIndexes.values()) {
|
|
206
|
-
|
|
206
|
+
for (const record of deletedRecords) {
|
|
207
|
+
rawIndex.deleteRecord(record);
|
|
208
|
+
}
|
|
207
209
|
}
|
|
208
210
|
}
|
|
209
211
|
|
|
@@ -27,16 +27,21 @@ class RecordStore {
|
|
|
27
27
|
}
|
|
28
28
|
return deletedRecords;
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Delete the record with this key and this value, if there is one. Used by indexes, where the value is the primary
|
|
33
|
+
* key of the object store record that the index record points to.
|
|
34
|
+
*/
|
|
35
|
+
deleteByKeyAndValue(key, value) {
|
|
36
|
+
// In a non-unique store the value is part of the sort order, so this finds the exact record. In a unique store
|
|
37
|
+
// it finds the only record with this key, which may point at a different primary key.
|
|
38
|
+
const record = this.records.get({
|
|
39
|
+
key,
|
|
40
|
+
value
|
|
41
|
+
});
|
|
42
|
+
if (record !== undefined && cmpKeys(record.value, value) === 0) {
|
|
43
|
+
this.records.delete(record);
|
|
38
44
|
}
|
|
39
|
-
return deletedRecords;
|
|
40
45
|
}
|
|
41
46
|
clear() {
|
|
42
47
|
const deletedRecords = [...this.records.getAllRecords()];
|