@openclaw/whatsapp 2026.7.1-beta.2 → 2026.7.1-beta.4
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/{access-control-88UPniDc.js → access-control-DYE5dXna.js} +5 -3
- package/dist/{accounts-DgViSyJx.js → accounts-4YgwroRU.js} +1 -1
- package/dist/{action-runtime-hqza0J8B.js → action-runtime-DPahAqxV.js} +2 -2
- package/dist/action-runtime-api.js +1 -1
- package/dist/action-runtime.runtime.js +1 -1
- package/dist/{active-listener-CFwkn3ho.js → active-listener-B4SDebQ6.js} +1 -1
- package/dist/api.js +14 -13
- package/dist/{approval-handler.runtime-9_SV7vhc.js → approval-handler.runtime-DNWS4aYQ.js} +1 -1
- package/dist/auth-presence.js +1 -1
- package/dist/{auth-store-ECx4h57q.js → auth-store-Db-wfApd.js} +23 -13
- package/dist/call-tool-api.js +233 -0
- package/dist/{channel-fcXxWXic.js → channel-BWp7h1uY.js} +44 -18
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-react-action-Dgy9uUMl.js → channel-react-action-CKJHL_Wf.js} +3 -3
- package/dist/{channel.runtime-B4ThooGF.js → channel.runtime-CAssfx9p.js} +5 -5
- package/dist/{channel.setup-C_WEdyJR.js → channel.setup-CURc5rEt.js} +2 -2
- package/dist/{config-schema-CROZuhT-.js → config-schema-mBX2nmn1.js} +4 -0
- package/dist/{connection-controller-u-tfAFhJ.js → connection-controller-DkbrFSIn.js} +6 -5
- package/dist/connection-controller-registry-TSX_udJp.js +22 -0
- package/dist/contract-api.js +1 -1
- package/dist/{quoted-message-CpA_ujXK.js → group-session-key-BhC1RQOE.js} +31 -2
- package/dist/{identity-CmsTmkKR.js → identity-Dqft3mFA.js} +2 -1
- package/dist/index.js +9 -2
- package/dist/light-runtime-api.js +3 -3
- package/dist/{login-8lHwLmXj.js → login-C48y0jlx.js} +14 -7
- package/dist/{login-qr-BEZZqrTb.js → login-qr-BjId7dll.js} +7 -7
- package/dist/login-qr-runtime.js +1 -1
- package/dist/{monitor-BqkJ4MpT.js → monitor-DD8bXohk.js} +249 -160
- package/dist/runtime-api.js +9 -9
- package/dist/{send-i8Xk5mBQ.js → send-C5CpFcBG.js} +27 -9
- package/dist/{send-api-DndiBJhN.js → send-api-DLlXl8CH.js} +6 -5
- package/dist/{session-WU4SVP8f.js → session-DriaHt7V.js} +3 -3
- package/dist/{session-errors-CbsoQqoy.js → session-errors-BAj9D2La.js} +1 -22
- package/dist/{setup-core-KjSBbWX4.js → setup-core-DH-DFPLY.js} +4 -4
- package/dist/{setup-finalize-WedNP30s.js → setup-finalize-c8dl34sO.js} +3 -3
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-IOdkbWsQ.js → setup-surface-DlWb0Z09.js} +3 -3
- package/dist/{socket-timing-DvMNkIge.js → socket-timing-DhbVFjah.js} +17 -5
- package/dist/{text-runtime-C88QkuU9.js → targets-runtime-C-GiVn6Y.js} +2 -3
- package/dist/text-runtime-DdX6-mC_.js +4 -0
- package/node_modules/@cacheable/memory/README.md +177 -0
- package/node_modules/@cacheable/memory/dist/index.cjs +867 -820
- package/node_modules/@cacheable/memory/dist/index.d.cts +382 -280
- package/node_modules/@cacheable/memory/dist/index.d.mts +412 -0
- package/node_modules/@cacheable/memory/dist/index.mjs +841 -0
- package/node_modules/@cacheable/memory/package.json +9 -9
- package/node_modules/@cacheable/utils/README.md +342 -8
- package/node_modules/@cacheable/utils/dist/index.cjs +1322 -619
- package/node_modules/@cacheable/utils/dist/index.d.cts +769 -173
- package/node_modules/@cacheable/utils/dist/index.d.mts +903 -0
- package/node_modules/@cacheable/utils/dist/index.mjs +1355 -0
- package/node_modules/@cacheable/utils/package.json +8 -8
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/assert/strict.d.ts +10 -1
- package/node_modules/@types/node/assert.d.ts +144 -17
- package/node_modules/@types/node/async_hooks.d.ts +9 -9
- package/node_modules/@types/node/buffer.d.ts +64 -30
- package/node_modules/@types/node/child_process.d.ts +17 -21
- package/node_modules/@types/node/cluster.d.ts +13 -13
- package/node_modules/@types/node/console.d.ts +1 -1
- package/node_modules/@types/node/crypto.d.ts +471 -575
- package/node_modules/@types/node/diagnostics_channel.d.ts +274 -32
- package/node_modules/@types/node/dns.d.ts +15 -15
- package/node_modules/@types/node/events.d.ts +3 -3
- package/node_modules/@types/node/ffi.d.ts +486 -0
- package/node_modules/@types/node/fs/promises.d.ts +7 -4
- package/node_modules/@types/node/fs.d.ts +24 -18
- package/node_modules/@types/node/globals.d.ts +4 -4
- package/node_modules/@types/node/http.d.ts +30 -5
- package/node_modules/@types/node/http2.d.ts +5 -1
- package/node_modules/@types/node/index.d.ts +1 -3
- package/node_modules/@types/node/inspector.d.ts +1 -1
- package/node_modules/@types/node/module.d.ts +16 -45
- package/node_modules/@types/node/net.d.ts +1 -1
- package/node_modules/@types/node/os.d.ts +2 -2
- package/node_modules/@types/node/package.json +4 -4
- package/node_modules/@types/node/perf_hooks.d.ts +1 -9
- package/node_modules/@types/node/process.d.ts +25 -12
- package/node_modules/@types/node/quic.d.ts +92 -11
- package/node_modules/@types/node/readline.d.ts +12 -11
- package/node_modules/@types/node/repl.d.ts +10 -10
- package/node_modules/@types/node/sqlite.d.ts +56 -1
- package/node_modules/@types/node/stream/iter.d.ts +150 -0
- package/node_modules/@types/node/stream/promises.d.ts +2 -2
- package/node_modules/@types/node/stream/web.d.ts +1 -1
- package/node_modules/@types/node/stream.d.ts +37 -5
- package/node_modules/@types/node/test/reporters.d.ts +1 -1
- package/node_modules/@types/node/test.d.ts +120 -10
- package/node_modules/@types/node/tls.d.ts +1 -1
- package/node_modules/@types/node/ts5.6/index.d.ts +2 -4
- package/node_modules/@types/node/ts5.7/index.d.ts +1 -3
- package/node_modules/@types/node/url.d.ts +3 -3
- package/node_modules/@types/node/util/types.d.ts +1 -1
- package/node_modules/@types/node/util.d.ts +22 -22
- package/node_modules/@types/node/v8.d.ts +85 -3
- package/node_modules/@types/node/vm.d.ts +9 -9
- package/node_modules/@types/node/web-globals/domexception.d.ts +15 -0
- package/node_modules/@types/node/worker_threads.d.ts +10 -12
- package/node_modules/@types/node/zlib.d.ts +3 -3
- package/node_modules/cacheable/README.md +309 -30
- package/node_modules/cacheable/dist/index.cjs +1307 -1153
- package/node_modules/cacheable/dist/index.d.cts +741 -469
- package/node_modules/cacheable/dist/index.d.mts +766 -0
- package/node_modules/cacheable/dist/index.mjs +1210 -0
- package/node_modules/cacheable/package.json +10 -10
- package/node_modules/content-type/README.md +32 -57
- package/node_modules/content-type/dist/index.d.ts +26 -0
- package/node_modules/content-type/dist/index.js +170 -0
- package/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/content-type/package.json +35 -25
- package/node_modules/media-typer/README.md +19 -33
- package/node_modules/media-typer/dist/index.d.ts +29 -0
- package/node_modules/media-typer/dist/index.js +64 -0
- package/node_modules/media-typer/dist/index.js.map +1 -0
- package/node_modules/media-typer/package.json +37 -22
- package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.js +2 -2
- package/node_modules/music-metadata/lib/mp4/AtomToken.js +65 -13
- package/node_modules/music-metadata/lib/wav/WaveChunk.d.ts +10 -0
- package/node_modules/music-metadata/lib/wav/WaveChunk.js +13 -3
- package/node_modules/music-metadata/lib/wav/WaveParser.d.ts +1 -0
- package/node_modules/music-metadata/lib/wav/WaveParser.js +6 -5
- package/node_modules/music-metadata/package.json +5 -5
- package/node_modules/typebox/build/compile/validator.d.mts +2 -7
- package/node_modules/typebox/build/compile/validator.mjs +6 -36
- package/node_modules/typebox/build/error/errors.d.mts +1 -7
- package/node_modules/typebox/build/format/_idna.mjs +36 -6
- package/node_modules/typebox/build/format/_puny.mjs +4 -1
- package/node_modules/typebox/build/format/uuid.d.mts +2 -2
- package/node_modules/typebox/build/format/uuid.mjs +3 -3
- package/node_modules/typebox/build/guard/emit.d.mts +0 -4
- package/node_modules/typebox/build/guard/emit.mjs +0 -8
- package/node_modules/typebox/build/guard/guard.d.mts +4 -8
- package/node_modules/typebox/build/guard/guard.mjs +5 -13
- package/node_modules/typebox/build/schema/engine/boolean.d.mts +3 -3
- package/node_modules/typebox/build/schema/engine/boolean.mjs +4 -4
- package/node_modules/typebox/build/schema/engine/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/engine/index.mjs +0 -1
- package/node_modules/typebox/build/schema/engine/schema.mjs +5 -10
- package/node_modules/typebox/build/schema/engine/type.mjs +14 -18
- package/node_modules/typebox/build/schema/types/dependencies.mjs +1 -1
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/types/index.mjs +0 -1
- package/node_modules/typebox/build/schema/types/schema.d.mts +1 -1
- package/node_modules/typebox/build/schema/types/schema.mjs +2 -2
- package/node_modules/typebox/build/system/locale/ar_001.mjs +0 -1
- package/node_modules/typebox/build/system/locale/bn_BD.mjs +0 -1
- package/node_modules/typebox/build/system/locale/cs_CZ.mjs +0 -1
- package/node_modules/typebox/build/system/locale/de_DE.mjs +0 -1
- package/node_modules/typebox/build/system/locale/el_GR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/en_US.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_419.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_AR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_ES.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_MX.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fa_IR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fil_PH.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fr_CA.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fr_FR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ha_NG.mjs +0 -1
- package/node_modules/typebox/build/system/locale/hi_IN.mjs +0 -1
- package/node_modules/typebox/build/system/locale/hu_HU.mjs +0 -1
- package/node_modules/typebox/build/system/locale/id_ID.mjs +0 -1
- package/node_modules/typebox/build/system/locale/it_IT.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ja_JP.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ko_KR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ms_MY.mjs +0 -1
- package/node_modules/typebox/build/system/locale/nl_NL.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pl_PL.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pt_BR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pt_PT.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ro_RO.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ru_RU.mjs +0 -1
- package/node_modules/typebox/build/system/locale/sv_SE.mjs +0 -1
- package/node_modules/typebox/build/system/locale/sw_TZ.mjs +0 -1
- package/node_modules/typebox/build/system/locale/th_TH.mjs +0 -1
- package/node_modules/typebox/build/system/locale/tr_TR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/uk_UA.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ur_PK.mjs +0 -1
- package/node_modules/typebox/build/system/locale/vi_VN.mjs +0 -1
- package/node_modules/typebox/build/system/locale/yo_NG.mjs +0 -1
- package/node_modules/typebox/build/system/locale/zh_Hans.mjs +0 -1
- package/node_modules/typebox/build/system/locale/zh_Hant.mjs +0 -1
- package/node_modules/typebox/build/system/memory/clone.d.mts +2 -3
- package/node_modules/typebox/build/system/memory/clone.mjs +73 -26
- package/node_modules/typebox/build/system/settings/settings.d.mts +15 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +3 -1
- package/node_modules/typebox/build/type/action/_add_immutable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_immutable.mjs +11 -0
- package/node_modules/typebox/build/type/action/_add_optional.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_optional.mjs +11 -0
- package/node_modules/typebox/build/type/action/_add_readonly.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_readonly.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_immutable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_immutable.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_optional.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_optional.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_readonly.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_readonly.mjs +11 -0
- package/node_modules/typebox/build/type/action/conditional.d.mts +2 -3
- package/node_modules/typebox/build/type/action/conditional.mjs +2 -1
- package/node_modules/typebox/build/type/action/index.d.mts +7 -4
- package/node_modules/typebox/build/type/action/index.mjs +7 -4
- package/node_modules/typebox/build/type/action/mapped.d.mts +2 -3
- package/node_modules/typebox/build/type/action/mapped.mjs +2 -1
- package/node_modules/typebox/build/type/action/module.d.mts +8 -7
- package/node_modules/typebox/build/type/action/module.mjs +7 -6
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +0 -5
- package/node_modules/typebox/build/type/action/readonly_object.mjs +0 -5
- package/node_modules/typebox/build/type/action/with.d.mts +11 -0
- package/node_modules/typebox/build/type/action/with.mjs +11 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +1 -1
- package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +3 -2
- package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +2 -2
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +3 -4
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +2 -1
- package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +2 -3
- package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +3 -6
- package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +6 -9
- package/node_modules/typebox/build/type/engine/cyclic/check.mjs +10 -16
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +9 -15
- package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +8 -14
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +2 -5
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +3 -2
- package/node_modules/typebox/build/type/engine/enum/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/enum/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +1 -2
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +2 -6
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +10 -6
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +10 -6
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +3 -3
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +17 -5
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +34 -8
- package/node_modules/typebox/build/type/engine/exclude/operation.d.mts +5 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +11 -12
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +5 -6
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +11 -12
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/index.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/index.mjs +2 -2
- package/node_modules/typebox/build/type/engine/indexable/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +3 -3
- package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +4 -4
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +9 -6
- package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +5 -2
- package/node_modules/typebox/build/type/engine/instantiate.d.mts +44 -31
- package/node_modules/typebox/build/type/engine/instantiate.mjs +82 -83
- package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +3 -6
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +5 -1
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +3 -3
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +5 -4
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +10 -5
- package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +7 -9
- package/node_modules/typebox/build/type/engine/module/instantiate.mjs +17 -15
- package/node_modules/typebox/build/type/engine/object/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/object/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/object/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/object/from_type.mjs +8 -5
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +3 -4
- package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +2 -1
- package/node_modules/typebox/build/type/engine/partial/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/partial/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/partial/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/partial/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/partial/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/partial/from_type.mjs +7 -4
- package/node_modules/typebox/build/type/engine/priority/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/priority/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +20 -0
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +28 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +8 -5
- package/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +2 -2
- package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +3 -3
- package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +6 -6
- package/node_modules/typebox/build/type/engine/required/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/required/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/required/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/required/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/required/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/required/from_type.mjs +7 -4
- package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +3 -3
- package/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +6 -6
- package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +1 -1
- package/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +1 -0
- package/node_modules/typebox/build/type/engine/this/expand_this.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/this/expand_this.mjs +7 -13
- package/node_modules/typebox/build/type/engine/with/instantiate.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/{options → with}/instantiate.mjs +5 -5
- package/node_modules/typebox/build/type/extends/dependent.d.mts +6 -0
- package/node_modules/typebox/build/type/extends/dependent.mjs +6 -0
- package/node_modules/typebox/build/type/extends/enum.d.mts +4 -4
- package/node_modules/typebox/build/type/extends/enum.mjs +3 -2
- package/node_modules/typebox/build/type/extends/extends_left.d.mts +5 -7
- package/node_modules/typebox/build/type/extends/extends_left.mjs +24 -27
- package/node_modules/typebox/build/type/extends/extends_right.d.mts +7 -5
- package/node_modules/typebox/build/type/extends/extends_right.mjs +20 -15
- package/node_modules/typebox/build/type/extends/inference.mjs +1 -1
- package/node_modules/typebox/build/type/extends/object.d.mts +8 -1
- package/node_modules/typebox/build/type/extends/object.mjs +25 -3
- package/node_modules/typebox/build/type/extends/parameters.mjs +2 -2
- package/node_modules/typebox/build/type/extends/record.d.mts +13 -0
- package/node_modules/typebox/build/type/extends/record.mjs +23 -0
- package/node_modules/typebox/build/type/extends/template_literal.d.mts +3 -3
- package/node_modules/typebox/build/type/extends/template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/extends/tuple.d.mts +3 -6
- package/node_modules/typebox/build/type/extends/tuple.mjs +6 -5
- package/node_modules/typebox/build/type/extends/union.mjs +2 -2
- package/node_modules/typebox/build/type/script/mapping.d.mts +84 -99
- package/node_modules/typebox/build/type/script/mapping.mjs +81 -85
- package/node_modules/typebox/build/type/script/parser.d.mts +40 -40
- package/node_modules/typebox/build/type/script/parser.mjs +22 -22
- package/node_modules/typebox/build/type/script/script.d.mts +3 -4
- package/node_modules/typebox/build/type/script/script.mjs +3 -2
- package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -1
- package/node_modules/typebox/build/type/script/token/internal/guard.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/internal/take.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/until.mjs +2 -2
- package/node_modules/typebox/build/type/types/_codec.d.mts +12 -12
- package/node_modules/typebox/build/type/types/_codec.mjs +0 -1
- package/node_modules/typebox/build/type/types/_immutable.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_immutable.mjs +2 -10
- package/node_modules/typebox/build/type/types/_optional.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_optional.mjs +2 -11
- package/node_modules/typebox/build/type/types/_readonly.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_readonly.mjs +2 -10
- package/node_modules/typebox/build/type/types/_refine.d.mts +8 -10
- package/node_modules/typebox/build/type/types/_refine.mjs +1 -2
- package/node_modules/typebox/build/type/types/call.d.mts +3 -3
- package/node_modules/typebox/build/type/types/call.mjs +3 -2
- package/node_modules/typebox/build/type/types/deferred.d.mts +1 -0
- package/node_modules/typebox/build/type/types/deferred.mjs +1 -1
- package/node_modules/typebox/build/type/types/dependent.d.mts +17 -0
- package/node_modules/typebox/build/type/types/dependent.mjs +24 -0
- package/node_modules/typebox/build/type/types/enum.d.mts +3 -1
- package/node_modules/typebox/build/type/types/enum.mjs +5 -0
- package/node_modules/typebox/build/type/types/index.d.mts +1 -4
- package/node_modules/typebox/build/type/types/index.mjs +1 -4
- package/node_modules/typebox/build/type/types/number.d.mts +1 -1
- package/node_modules/typebox/build/type/types/number.mjs +1 -1
- package/node_modules/typebox/build/type/types/record.d.mts +13 -7
- package/node_modules/typebox/build/type/types/record.mjs +15 -9
- package/node_modules/typebox/build/type/types/static.d.mts +2 -5
- package/node_modules/typebox/build/typebox.d.mts +4 -8
- package/node_modules/typebox/build/typebox.mjs +4 -8
- package/node_modules/typebox/build/value/clean/clean.mjs +4 -2
- package/node_modules/typebox/build/value/clean/from_intersect.mjs +2 -2
- package/node_modules/typebox/build/value/clean/from_type.mjs +8 -10
- package/node_modules/typebox/build/value/clean/from_union.d.mts +1 -1
- package/node_modules/typebox/build/value/clean/from_union.mjs +1 -2
- package/node_modules/typebox/build/value/clone/clone.mjs +2 -73
- package/node_modules/typebox/build/value/codec/decode.mjs +4 -2
- package/node_modules/typebox/build/value/codec/encode.mjs +4 -2
- package/node_modules/typebox/build/value/codec/from_array.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_object.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_record.mjs +2 -7
- package/node_modules/typebox/build/value/codec/from_tuple.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_union.mjs +2 -3
- package/node_modules/typebox/build/value/convert/from_enum.mjs +3 -4
- package/node_modules/typebox/build/value/convert/from_template_literal.d.mts +1 -1
- package/node_modules/typebox/build/value/convert/from_template_literal.mjs +2 -3
- package/node_modules/typebox/build/value/convert/from_type.mjs +19 -21
- package/node_modules/typebox/build/value/create/from_enum.mjs +2 -2
- package/node_modules/typebox/build/value/create/from_type.mjs +23 -31
- package/node_modules/typebox/build/value/default/from_object.mjs +1 -1
- package/node_modules/typebox/build/value/default/from_type.mjs +8 -10
- package/node_modules/typebox/build/value/index.d.mts +0 -1
- package/node_modules/typebox/build/value/index.mjs +0 -1
- package/node_modules/typebox/build/value/repair/from_enum.mjs +2 -3
- package/node_modules/typebox/build/value/repair/from_type.mjs +24 -22
- package/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +6 -2
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +62 -26
- package/node_modules/typebox/build/value/value.d.mts +0 -1
- package/node_modules/typebox/build/value/value.mjs +0 -1
- package/node_modules/typebox/package.json +25 -25
- package/node_modules/typebox/readme.md +97 -80
- package/node_modules/undici-types/agent.d.ts +0 -2
- package/node_modules/undici-types/client.d.ts +25 -19
- package/node_modules/undici-types/dispatcher.d.ts +7 -33
- package/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
- package/node_modules/undici-types/fetch.d.ts +24 -4
- package/node_modules/undici-types/h2c-client.d.ts +6 -6
- package/node_modules/undici-types/handlers.d.ts +1 -2
- package/node_modules/undici-types/header.d.ts +5 -0
- package/node_modules/undici-types/index.d.ts +3 -1
- package/node_modules/undici-types/interceptors.d.ts +1 -1
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/pool.d.ts +0 -2
- package/node_modules/undici-types/proxy-agent.d.ts +2 -2
- package/node_modules/undici-types/round-robin-pool.d.ts +0 -2
- package/node_modules/undici-types/snapshot-agent.d.ts +4 -0
- package/node_modules/undici-types/socks5-proxy-agent.d.ts +2 -2
- package/node_modules/undici-types/webidl.d.ts +0 -1
- package/npm-shrinkwrap.json +49 -41
- package/openclaw.plugin.json +12 -0
- package/package.json +5 -5
- package/node_modules/@cacheable/memory/dist/index.d.ts +0 -310
- package/node_modules/@cacheable/memory/dist/index.js +0 -807
- package/node_modules/@cacheable/utils/dist/index.d.ts +0 -307
- package/node_modules/@cacheable/utils/dist/index.js +0 -630
- package/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
- package/node_modules/cacheable/dist/index.d.ts +0 -494
- package/node_modules/cacheable/dist/index.js +0 -1141
- package/node_modules/content-type/HISTORY.md +0 -29
- package/node_modules/content-type/index.js +0 -225
- package/node_modules/media-typer/HISTORY.md +0 -50
- package/node_modules/media-typer/index.js +0 -143
- package/node_modules/typebox/build/schema/engine/_guard.d.mts +0 -6
- package/node_modules/typebox/build/schema/engine/_guard.mjs +0 -26
- package/node_modules/typebox/build/schema/types/_guard.d.mts +0 -10
- package/node_modules/typebox/build/schema/types/_guard.mjs +0 -16
- package/node_modules/typebox/build/type/action/_optional.d.mts +0 -19
- package/node_modules/typebox/build/type/action/_optional.mjs +0 -40
- package/node_modules/typebox/build/type/action/_readonly.d.mts +0 -19
- package/node_modules/typebox/build/type/action/_readonly.mjs +0 -40
- package/node_modules/typebox/build/type/action/awaited.d.mts +0 -15
- package/node_modules/typebox/build/type/action/awaited.mjs +0 -15
- package/node_modules/typebox/build/type/action/options.d.mts +0 -11
- package/node_modules/typebox/build/type/action/options.mjs +0 -11
- package/node_modules/typebox/build/type/engine/awaited/instantiate.d.mts +0 -11
- package/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +0 -20
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.d.mts +0 -14
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs +0 -24
- package/node_modules/typebox/build/type/engine/options/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/options/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/options/instantiate.d.mts +0 -8
- package/node_modules/typebox/build/type/extends/async_iterator.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/async_iterator.mjs +0 -9
- package/node_modules/typebox/build/type/extends/iterator.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/iterator.mjs +0 -9
- package/node_modules/typebox/build/type/extends/promise.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/promise.mjs +0 -9
- package/node_modules/typebox/build/type/types/async_iterator.d.mts +0 -20
- package/node_modules/typebox/build/type/types/async_iterator.mjs +0 -28
- package/node_modules/typebox/build/type/types/base.d.mts +0 -50
- package/node_modules/typebox/build/type/types/base.mjs +0 -84
- package/node_modules/typebox/build/type/types/iterator.d.mts +0 -20
- package/node_modules/typebox/build/type/types/iterator.mjs +0 -28
- package/node_modules/typebox/build/type/types/promise.d.mts +0 -21
- package/node_modules/typebox/build/type/types/promise.mjs +0 -29
- package/node_modules/typebox/build/value/clean/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/clean/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/convert/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/convert/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/create/from_async_iterator.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_async_iterator.mjs +0 -5
- package/node_modules/typebox/build/value/create/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/create/from_iterator.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_iterator.mjs +0 -5
- package/node_modules/typebox/build/value/create/from_promise.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_promise.mjs +0 -5
- package/node_modules/typebox/build/value/default/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/default/from_base.mjs +0 -5
- package/node_modules/typebox/build/value/mutate/error.d.mts +0 -3
- package/node_modules/typebox/build/value/mutate/error.mjs +0 -6
- package/node_modules/typebox/build/value/mutate/from_array.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_array.mjs +0 -16
- package/node_modules/typebox/build/value/mutate/from_object.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_object.mjs +0 -40
- package/node_modules/typebox/build/value/mutate/from_unknown.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_unknown.mjs +0 -7
- package/node_modules/typebox/build/value/mutate/from_value.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_value.mjs +0 -12
- package/node_modules/typebox/build/value/mutate/index.d.mts +0 -1
- package/node_modules/typebox/build/value/mutate/index.mjs +0 -1
- package/node_modules/typebox/build/value/mutate/mutate.d.mts +0 -11
- package/node_modules/typebox/build/value/mutate/mutate.mjs +0 -41
- package/node_modules/typebox/build/value/repair/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/repair/from_base.mjs +0 -8
- package/dist/{approval-resolver-e1hAVRRy.js → approval-resolver-DF-lu8k5.js} +1 -1
- /package/node_modules/typebox/build/type/engine/{awaited → with}/index.d.mts +0 -0
- /package/node_modules/typebox/build/type/engine/{awaited → with}/index.mjs +0 -0
|
@@ -1,630 +0,0 @@
|
|
|
1
|
-
// src/shorthand-time.ts
|
|
2
|
-
var shorthandToMilliseconds = (shorthand) => {
|
|
3
|
-
let milliseconds;
|
|
4
|
-
if (shorthand === void 0) {
|
|
5
|
-
return void 0;
|
|
6
|
-
}
|
|
7
|
-
if (typeof shorthand === "number") {
|
|
8
|
-
milliseconds = shorthand;
|
|
9
|
-
} else {
|
|
10
|
-
if (typeof shorthand !== "string") {
|
|
11
|
-
return void 0;
|
|
12
|
-
}
|
|
13
|
-
shorthand = shorthand.trim();
|
|
14
|
-
if (Number.isNaN(Number(shorthand))) {
|
|
15
|
-
const match = /^([\d.]+)\s*(ms|s|m|h|hr|d)$/i.exec(shorthand);
|
|
16
|
-
if (!match) {
|
|
17
|
-
throw new Error(
|
|
18
|
-
`Unsupported time format: "${shorthand}". Use 'ms', 's', 'm', 'h', 'hr', or 'd'.`
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
const [, value, unit] = match;
|
|
22
|
-
const numericValue = Number.parseFloat(value);
|
|
23
|
-
const unitLower = unit.toLowerCase();
|
|
24
|
-
switch (unitLower) {
|
|
25
|
-
case "ms": {
|
|
26
|
-
milliseconds = numericValue;
|
|
27
|
-
break;
|
|
28
|
-
}
|
|
29
|
-
case "s": {
|
|
30
|
-
milliseconds = numericValue * 1e3;
|
|
31
|
-
break;
|
|
32
|
-
}
|
|
33
|
-
case "m": {
|
|
34
|
-
milliseconds = numericValue * 1e3 * 60;
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
case "h": {
|
|
38
|
-
milliseconds = numericValue * 1e3 * 60 * 60;
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
41
|
-
case "hr": {
|
|
42
|
-
milliseconds = numericValue * 1e3 * 60 * 60;
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
case "d": {
|
|
46
|
-
milliseconds = numericValue * 1e3 * 60 * 60 * 24;
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
/* v8 ignore next -- @preserve */
|
|
50
|
-
default: {
|
|
51
|
-
milliseconds = Number(shorthand);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
} else {
|
|
55
|
-
milliseconds = Number(shorthand);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return milliseconds;
|
|
59
|
-
};
|
|
60
|
-
var shorthandToTime = (shorthand, fromDate) => {
|
|
61
|
-
fromDate ??= /* @__PURE__ */ new Date();
|
|
62
|
-
const milliseconds = shorthandToMilliseconds(shorthand);
|
|
63
|
-
if (milliseconds === void 0) {
|
|
64
|
-
return fromDate.getTime();
|
|
65
|
-
}
|
|
66
|
-
return fromDate.getTime() + milliseconds;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
// src/coalesce-async.ts
|
|
70
|
-
var callbacks = /* @__PURE__ */ new Map();
|
|
71
|
-
function hasKey(key) {
|
|
72
|
-
return callbacks.has(key);
|
|
73
|
-
}
|
|
74
|
-
function addKey(key) {
|
|
75
|
-
callbacks.set(key, []);
|
|
76
|
-
}
|
|
77
|
-
function removeKey(key) {
|
|
78
|
-
callbacks.delete(key);
|
|
79
|
-
}
|
|
80
|
-
function addCallbackToKey(key, callback) {
|
|
81
|
-
const stash = getCallbacksByKey(key);
|
|
82
|
-
stash.push(callback);
|
|
83
|
-
callbacks.set(key, stash);
|
|
84
|
-
}
|
|
85
|
-
function getCallbacksByKey(key) {
|
|
86
|
-
return callbacks.get(key) ?? [];
|
|
87
|
-
}
|
|
88
|
-
async function enqueue(key) {
|
|
89
|
-
return new Promise((resolve, reject) => {
|
|
90
|
-
const callback = { resolve, reject };
|
|
91
|
-
addCallbackToKey(key, callback);
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
function dequeue(key) {
|
|
95
|
-
const stash = getCallbacksByKey(key);
|
|
96
|
-
removeKey(key);
|
|
97
|
-
return stash;
|
|
98
|
-
}
|
|
99
|
-
function coalesce(options) {
|
|
100
|
-
const { key, error, result } = options;
|
|
101
|
-
for (const callback of dequeue(key)) {
|
|
102
|
-
if (error) {
|
|
103
|
-
callback.reject(error);
|
|
104
|
-
} else {
|
|
105
|
-
callback.resolve(result);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
async function coalesceAsync(key, fnc) {
|
|
110
|
-
if (!hasKey(key)) {
|
|
111
|
-
addKey(key);
|
|
112
|
-
try {
|
|
113
|
-
const result = await Promise.resolve(fnc());
|
|
114
|
-
coalesce({ key, result });
|
|
115
|
-
return result;
|
|
116
|
-
} catch (error) {
|
|
117
|
-
coalesce({ key, error });
|
|
118
|
-
throw error;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return enqueue(key);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// src/hash.ts
|
|
125
|
-
import { Hashery } from "hashery";
|
|
126
|
-
var HashAlgorithm = /* @__PURE__ */ ((HashAlgorithm2) => {
|
|
127
|
-
HashAlgorithm2["SHA256"] = "SHA-256";
|
|
128
|
-
HashAlgorithm2["SHA384"] = "SHA-384";
|
|
129
|
-
HashAlgorithm2["SHA512"] = "SHA-512";
|
|
130
|
-
HashAlgorithm2["DJB2"] = "djb2";
|
|
131
|
-
HashAlgorithm2["FNV1"] = "fnv1";
|
|
132
|
-
HashAlgorithm2["MURMER"] = "murmer";
|
|
133
|
-
HashAlgorithm2["CRC32"] = "crc32";
|
|
134
|
-
return HashAlgorithm2;
|
|
135
|
-
})(HashAlgorithm || {});
|
|
136
|
-
async function hash(object, options = {
|
|
137
|
-
algorithm: "SHA-256" /* SHA256 */,
|
|
138
|
-
serialize: JSON.stringify
|
|
139
|
-
}) {
|
|
140
|
-
const algorithm = options?.algorithm ?? "SHA-256" /* SHA256 */;
|
|
141
|
-
const serialize = options?.serialize ?? JSON.stringify;
|
|
142
|
-
const objectString = serialize(object);
|
|
143
|
-
const hashery = new Hashery();
|
|
144
|
-
return hashery.toHash(objectString, { algorithm });
|
|
145
|
-
}
|
|
146
|
-
function hashSync(object, options = {
|
|
147
|
-
algorithm: "djb2" /* DJB2 */,
|
|
148
|
-
serialize: JSON.stringify
|
|
149
|
-
}) {
|
|
150
|
-
const algorithm = options?.algorithm ?? "djb2" /* DJB2 */;
|
|
151
|
-
const serialize = options?.serialize ?? JSON.stringify;
|
|
152
|
-
const objectString = serialize(object);
|
|
153
|
-
const hashery = new Hashery();
|
|
154
|
-
return hashery.toHashSync(objectString, { algorithm });
|
|
155
|
-
}
|
|
156
|
-
async function hashToNumber(object, options = {
|
|
157
|
-
min: 0,
|
|
158
|
-
max: 10,
|
|
159
|
-
algorithm: "SHA-256" /* SHA256 */,
|
|
160
|
-
serialize: JSON.stringify
|
|
161
|
-
}) {
|
|
162
|
-
const min = options?.min ?? 0;
|
|
163
|
-
const max = options?.max ?? 10;
|
|
164
|
-
const algorithm = options?.algorithm ?? "SHA-256" /* SHA256 */;
|
|
165
|
-
const serialize = options?.serialize ?? JSON.stringify;
|
|
166
|
-
const hashLength = options?.hashLength ?? 16;
|
|
167
|
-
if (min >= max) {
|
|
168
|
-
throw new Error(
|
|
169
|
-
`Invalid range: min (${min}) must be less than max (${max})`
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
const objectString = serialize(object);
|
|
173
|
-
const hashery = new Hashery();
|
|
174
|
-
return hashery.toNumber(objectString, {
|
|
175
|
-
algorithm,
|
|
176
|
-
min,
|
|
177
|
-
max,
|
|
178
|
-
hashLength
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
function hashToNumberSync(object, options = {
|
|
182
|
-
min: 0,
|
|
183
|
-
max: 10,
|
|
184
|
-
algorithm: "djb2" /* DJB2 */,
|
|
185
|
-
serialize: JSON.stringify
|
|
186
|
-
}) {
|
|
187
|
-
const min = options?.min ?? 0;
|
|
188
|
-
const max = options?.max ?? 10;
|
|
189
|
-
const algorithm = options?.algorithm ?? "djb2" /* DJB2 */;
|
|
190
|
-
const serialize = options?.serialize ?? JSON.stringify;
|
|
191
|
-
const hashLength = options?.hashLength ?? 16;
|
|
192
|
-
if (min >= max) {
|
|
193
|
-
throw new Error(
|
|
194
|
-
`Invalid range: min (${min}) must be less than max (${max})`
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
const objectString = serialize(object);
|
|
198
|
-
const hashery = new Hashery();
|
|
199
|
-
return hashery.toNumberSync(objectString, {
|
|
200
|
-
algorithm,
|
|
201
|
-
min,
|
|
202
|
-
max,
|
|
203
|
-
hashLength
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// src/is-keyv-instance.ts
|
|
208
|
-
import { Keyv } from "keyv";
|
|
209
|
-
function isKeyvInstance(keyv) {
|
|
210
|
-
if (keyv === null || keyv === void 0) {
|
|
211
|
-
return false;
|
|
212
|
-
}
|
|
213
|
-
if (keyv instanceof Keyv) {
|
|
214
|
-
return true;
|
|
215
|
-
}
|
|
216
|
-
const keyvMethods = [
|
|
217
|
-
"generateIterator",
|
|
218
|
-
"get",
|
|
219
|
-
"getMany",
|
|
220
|
-
"set",
|
|
221
|
-
"setMany",
|
|
222
|
-
"delete",
|
|
223
|
-
"deleteMany",
|
|
224
|
-
"has",
|
|
225
|
-
"hasMany",
|
|
226
|
-
"clear",
|
|
227
|
-
"disconnect",
|
|
228
|
-
"serialize",
|
|
229
|
-
"deserialize"
|
|
230
|
-
];
|
|
231
|
-
return keyvMethods.every((method) => typeof keyv[method] === "function");
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
// src/is-object.ts
|
|
235
|
-
function isObject(value) {
|
|
236
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
// src/less-than.ts
|
|
240
|
-
function lessThan(number1, number2) {
|
|
241
|
-
return typeof number1 === "number" && typeof number2 === "number" ? number1 < number2 : false;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
// src/memoize.ts
|
|
245
|
-
function wrapSync(function_, options) {
|
|
246
|
-
const { ttl, keyPrefix, cache, serialize } = options;
|
|
247
|
-
return (...arguments_) => {
|
|
248
|
-
let cacheKey = createWrapKey(function_, arguments_, {
|
|
249
|
-
keyPrefix,
|
|
250
|
-
serialize
|
|
251
|
-
});
|
|
252
|
-
if (options.createKey) {
|
|
253
|
-
cacheKey = options.createKey(function_, arguments_, options);
|
|
254
|
-
}
|
|
255
|
-
let value = cache.get(cacheKey);
|
|
256
|
-
if (value === void 0) {
|
|
257
|
-
try {
|
|
258
|
-
value = function_(...arguments_);
|
|
259
|
-
cache.set(cacheKey, value, ttl);
|
|
260
|
-
} catch (error) {
|
|
261
|
-
cache.emit("error", error);
|
|
262
|
-
if (options.cacheErrors) {
|
|
263
|
-
cache.set(cacheKey, error, ttl);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
return value;
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
async function getOrSet(key, function_, options) {
|
|
271
|
-
const keyString = typeof key === "function" ? key(options) : key;
|
|
272
|
-
let value;
|
|
273
|
-
try {
|
|
274
|
-
value = await options.cache.get(keyString);
|
|
275
|
-
} catch (error) {
|
|
276
|
-
options.cache.emit("error", error);
|
|
277
|
-
if (options.throwErrors === true || options.throwErrors === "store") {
|
|
278
|
-
throw error;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
if (value === void 0) {
|
|
282
|
-
const cacheId = options.cacheId ?? "default";
|
|
283
|
-
const coalesceKey = `${cacheId}::${keyString}`;
|
|
284
|
-
value = await coalesceAsync(coalesceKey, async () => {
|
|
285
|
-
let result;
|
|
286
|
-
try {
|
|
287
|
-
try {
|
|
288
|
-
result = await function_();
|
|
289
|
-
} catch (error) {
|
|
290
|
-
throw new ErrorEnvelope(
|
|
291
|
-
error,
|
|
292
|
-
"function"
|
|
293
|
-
);
|
|
294
|
-
}
|
|
295
|
-
try {
|
|
296
|
-
await options.cache.set(keyString, result, options.ttl);
|
|
297
|
-
} catch (error) {
|
|
298
|
-
throw new ErrorEnvelope(error, "store");
|
|
299
|
-
}
|
|
300
|
-
return result;
|
|
301
|
-
} catch (caught) {
|
|
302
|
-
const errorType = caught instanceof ErrorEnvelope ? caught.context : (
|
|
303
|
-
/* c8 ignore next 1 */
|
|
304
|
-
void 0
|
|
305
|
-
);
|
|
306
|
-
const error = caught instanceof ErrorEnvelope ? caught.error : caught;
|
|
307
|
-
options.cache.emit("error", error);
|
|
308
|
-
if (options.cacheErrors) {
|
|
309
|
-
await options.cache.set(keyString, error, options.ttl);
|
|
310
|
-
}
|
|
311
|
-
if (options.throwErrors === true || options.throwErrors === errorType) {
|
|
312
|
-
throw error;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
return result;
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
return value;
|
|
319
|
-
}
|
|
320
|
-
function wrap(function_, options) {
|
|
321
|
-
const { keyPrefix, serialize } = options;
|
|
322
|
-
return async (...arguments_) => {
|
|
323
|
-
let cacheKey = createWrapKey(function_, arguments_, {
|
|
324
|
-
keyPrefix,
|
|
325
|
-
serialize
|
|
326
|
-
});
|
|
327
|
-
if (options.createKey) {
|
|
328
|
-
cacheKey = options.createKey(function_, arguments_, options);
|
|
329
|
-
}
|
|
330
|
-
return getOrSet(
|
|
331
|
-
cacheKey,
|
|
332
|
-
async () => function_(...arguments_),
|
|
333
|
-
options
|
|
334
|
-
);
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
function createWrapKey(function_, arguments_, options) {
|
|
338
|
-
const { keyPrefix, serialize } = options || {};
|
|
339
|
-
if (!keyPrefix) {
|
|
340
|
-
return `${function_.name}::${hashSync(arguments_, { serialize })}`;
|
|
341
|
-
}
|
|
342
|
-
return `${keyPrefix}::${function_.name}::${hashSync(arguments_, { serialize })}`;
|
|
343
|
-
}
|
|
344
|
-
var ErrorEnvelope = class {
|
|
345
|
-
constructor(error, context) {
|
|
346
|
-
this.error = error;
|
|
347
|
-
this.context = context;
|
|
348
|
-
}
|
|
349
|
-
};
|
|
350
|
-
|
|
351
|
-
// src/run-if-fn.ts
|
|
352
|
-
function runIfFn(valueOrFunction, ...arguments_) {
|
|
353
|
-
return typeof valueOrFunction === "function" ? valueOrFunction(...arguments_) : valueOrFunction;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
// src/sleep.ts
|
|
357
|
-
var sleep = async (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
358
|
-
|
|
359
|
-
// src/stats.ts
|
|
360
|
-
var Stats = class {
|
|
361
|
-
_hits = 0;
|
|
362
|
-
_misses = 0;
|
|
363
|
-
_gets = 0;
|
|
364
|
-
_sets = 0;
|
|
365
|
-
_deletes = 0;
|
|
366
|
-
_clears = 0;
|
|
367
|
-
_vsize = 0;
|
|
368
|
-
_ksize = 0;
|
|
369
|
-
_count = 0;
|
|
370
|
-
_enabled = false;
|
|
371
|
-
constructor(options) {
|
|
372
|
-
if (options?.enabled) {
|
|
373
|
-
this._enabled = options.enabled;
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* @returns {boolean} - Whether the stats are enabled
|
|
378
|
-
*/
|
|
379
|
-
get enabled() {
|
|
380
|
-
return this._enabled;
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* @param {boolean} enabled - Whether to enable the stats
|
|
384
|
-
*/
|
|
385
|
-
set enabled(enabled) {
|
|
386
|
-
this._enabled = enabled;
|
|
387
|
-
}
|
|
388
|
-
/**
|
|
389
|
-
* @returns {number} - The number of hits
|
|
390
|
-
* @readonly
|
|
391
|
-
*/
|
|
392
|
-
get hits() {
|
|
393
|
-
return this._hits;
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* @returns {number} - The number of misses
|
|
397
|
-
* @readonly
|
|
398
|
-
*/
|
|
399
|
-
get misses() {
|
|
400
|
-
return this._misses;
|
|
401
|
-
}
|
|
402
|
-
/**
|
|
403
|
-
* @returns {number} - The number of gets
|
|
404
|
-
* @readonly
|
|
405
|
-
*/
|
|
406
|
-
get gets() {
|
|
407
|
-
return this._gets;
|
|
408
|
-
}
|
|
409
|
-
/**
|
|
410
|
-
* @returns {number} - The number of sets
|
|
411
|
-
* @readonly
|
|
412
|
-
*/
|
|
413
|
-
get sets() {
|
|
414
|
-
return this._sets;
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* @returns {number} - The number of deletes
|
|
418
|
-
* @readonly
|
|
419
|
-
*/
|
|
420
|
-
get deletes() {
|
|
421
|
-
return this._deletes;
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* @returns {number} - The number of clears
|
|
425
|
-
* @readonly
|
|
426
|
-
*/
|
|
427
|
-
get clears() {
|
|
428
|
-
return this._clears;
|
|
429
|
-
}
|
|
430
|
-
/**
|
|
431
|
-
* @returns {number} - The vsize (value size) of the cache instance
|
|
432
|
-
* @readonly
|
|
433
|
-
*/
|
|
434
|
-
get vsize() {
|
|
435
|
-
return this._vsize;
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* @returns {number} - The ksize (key size) of the cache instance
|
|
439
|
-
* @readonly
|
|
440
|
-
*/
|
|
441
|
-
get ksize() {
|
|
442
|
-
return this._ksize;
|
|
443
|
-
}
|
|
444
|
-
/**
|
|
445
|
-
* @returns {number} - The count of the cache instance
|
|
446
|
-
* @readonly
|
|
447
|
-
*/
|
|
448
|
-
get count() {
|
|
449
|
-
return this._count;
|
|
450
|
-
}
|
|
451
|
-
incrementHits() {
|
|
452
|
-
if (!this._enabled) {
|
|
453
|
-
return;
|
|
454
|
-
}
|
|
455
|
-
this._hits++;
|
|
456
|
-
}
|
|
457
|
-
incrementMisses() {
|
|
458
|
-
if (!this._enabled) {
|
|
459
|
-
return;
|
|
460
|
-
}
|
|
461
|
-
this._misses++;
|
|
462
|
-
}
|
|
463
|
-
incrementGets() {
|
|
464
|
-
if (!this._enabled) {
|
|
465
|
-
return;
|
|
466
|
-
}
|
|
467
|
-
this._gets++;
|
|
468
|
-
}
|
|
469
|
-
incrementSets() {
|
|
470
|
-
if (!this._enabled) {
|
|
471
|
-
return;
|
|
472
|
-
}
|
|
473
|
-
this._sets++;
|
|
474
|
-
}
|
|
475
|
-
incrementDeletes() {
|
|
476
|
-
if (!this._enabled) {
|
|
477
|
-
return;
|
|
478
|
-
}
|
|
479
|
-
this._deletes++;
|
|
480
|
-
}
|
|
481
|
-
incrementClears() {
|
|
482
|
-
if (!this._enabled) {
|
|
483
|
-
return;
|
|
484
|
-
}
|
|
485
|
-
this._clears++;
|
|
486
|
-
}
|
|
487
|
-
incrementVSize(value) {
|
|
488
|
-
if (!this._enabled) {
|
|
489
|
-
return;
|
|
490
|
-
}
|
|
491
|
-
this._vsize += this.roughSizeOfObject(value);
|
|
492
|
-
}
|
|
493
|
-
decreaseVSize(value) {
|
|
494
|
-
if (!this._enabled) {
|
|
495
|
-
return;
|
|
496
|
-
}
|
|
497
|
-
this._vsize -= this.roughSizeOfObject(value);
|
|
498
|
-
}
|
|
499
|
-
incrementKSize(key) {
|
|
500
|
-
if (!this._enabled) {
|
|
501
|
-
return;
|
|
502
|
-
}
|
|
503
|
-
this._ksize += this.roughSizeOfString(key);
|
|
504
|
-
}
|
|
505
|
-
decreaseKSize(key) {
|
|
506
|
-
if (!this._enabled) {
|
|
507
|
-
return;
|
|
508
|
-
}
|
|
509
|
-
this._ksize -= this.roughSizeOfString(key);
|
|
510
|
-
}
|
|
511
|
-
incrementCount() {
|
|
512
|
-
if (!this._enabled) {
|
|
513
|
-
return;
|
|
514
|
-
}
|
|
515
|
-
this._count++;
|
|
516
|
-
}
|
|
517
|
-
decreaseCount() {
|
|
518
|
-
if (!this._enabled) {
|
|
519
|
-
return;
|
|
520
|
-
}
|
|
521
|
-
this._count--;
|
|
522
|
-
}
|
|
523
|
-
setCount(count) {
|
|
524
|
-
if (!this._enabled) {
|
|
525
|
-
return;
|
|
526
|
-
}
|
|
527
|
-
this._count = count;
|
|
528
|
-
}
|
|
529
|
-
roughSizeOfString(value) {
|
|
530
|
-
return value.length * 2;
|
|
531
|
-
}
|
|
532
|
-
roughSizeOfObject(object) {
|
|
533
|
-
const objectList = [];
|
|
534
|
-
const stack = [object];
|
|
535
|
-
let bytes = 0;
|
|
536
|
-
while (stack.length > 0) {
|
|
537
|
-
const value = stack.pop();
|
|
538
|
-
if (typeof value === "boolean") {
|
|
539
|
-
bytes += 4;
|
|
540
|
-
} else if (typeof value === "string") {
|
|
541
|
-
bytes += value.length * 2;
|
|
542
|
-
} else if (typeof value === "number") {
|
|
543
|
-
bytes += 8;
|
|
544
|
-
} else {
|
|
545
|
-
if (value === null || value === void 0) {
|
|
546
|
-
bytes += 4;
|
|
547
|
-
continue;
|
|
548
|
-
}
|
|
549
|
-
if (objectList.includes(value)) {
|
|
550
|
-
continue;
|
|
551
|
-
}
|
|
552
|
-
objectList.push(value);
|
|
553
|
-
for (const key in value) {
|
|
554
|
-
bytes += key.length * 2;
|
|
555
|
-
stack.push(value[key]);
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
return bytes;
|
|
560
|
-
}
|
|
561
|
-
reset() {
|
|
562
|
-
this._hits = 0;
|
|
563
|
-
this._misses = 0;
|
|
564
|
-
this._gets = 0;
|
|
565
|
-
this._sets = 0;
|
|
566
|
-
this._deletes = 0;
|
|
567
|
-
this._clears = 0;
|
|
568
|
-
this._vsize = 0;
|
|
569
|
-
this._ksize = 0;
|
|
570
|
-
this._count = 0;
|
|
571
|
-
}
|
|
572
|
-
resetStoreValues() {
|
|
573
|
-
this._vsize = 0;
|
|
574
|
-
this._ksize = 0;
|
|
575
|
-
this._count = 0;
|
|
576
|
-
}
|
|
577
|
-
};
|
|
578
|
-
|
|
579
|
-
// src/ttl.ts
|
|
580
|
-
function getTtlFromExpires(expires) {
|
|
581
|
-
if (expires === void 0 || expires === null) {
|
|
582
|
-
return void 0;
|
|
583
|
-
}
|
|
584
|
-
const now = Date.now();
|
|
585
|
-
if (expires < now) {
|
|
586
|
-
return void 0;
|
|
587
|
-
}
|
|
588
|
-
return expires - now;
|
|
589
|
-
}
|
|
590
|
-
function getCascadingTtl(cacheableTtl, primaryTtl, secondaryTtl) {
|
|
591
|
-
return secondaryTtl ?? primaryTtl ?? shorthandToMilliseconds(cacheableTtl);
|
|
592
|
-
}
|
|
593
|
-
function calculateTtlFromExpiration(ttl, expires) {
|
|
594
|
-
const ttlFromExpires = getTtlFromExpires(expires);
|
|
595
|
-
const expiresFromTtl = ttl ? Date.now() + ttl : void 0;
|
|
596
|
-
if (ttlFromExpires === void 0) {
|
|
597
|
-
return ttl;
|
|
598
|
-
}
|
|
599
|
-
if (expiresFromTtl === void 0) {
|
|
600
|
-
return ttlFromExpires;
|
|
601
|
-
}
|
|
602
|
-
if (expires && expires > expiresFromTtl) {
|
|
603
|
-
return ttl;
|
|
604
|
-
}
|
|
605
|
-
return ttlFromExpires;
|
|
606
|
-
}
|
|
607
|
-
export {
|
|
608
|
-
HashAlgorithm,
|
|
609
|
-
Stats,
|
|
610
|
-
calculateTtlFromExpiration,
|
|
611
|
-
coalesceAsync,
|
|
612
|
-
createWrapKey,
|
|
613
|
-
getCascadingTtl,
|
|
614
|
-
getOrSet,
|
|
615
|
-
getTtlFromExpires,
|
|
616
|
-
hash,
|
|
617
|
-
hashSync,
|
|
618
|
-
hashToNumber,
|
|
619
|
-
hashToNumberSync,
|
|
620
|
-
isKeyvInstance,
|
|
621
|
-
isObject,
|
|
622
|
-
lessThan,
|
|
623
|
-
runIfFn,
|
|
624
|
-
shorthandToMilliseconds,
|
|
625
|
-
shorthandToTime,
|
|
626
|
-
sleep,
|
|
627
|
-
wrap,
|
|
628
|
-
wrapSync
|
|
629
|
-
};
|
|
630
|
-
/* v8 ignore next -- @preserve */
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// Backwards-compatible iterator interfaces, augmented with iterator helper methods by lib.esnext.iterator in TypeScript 5.6.
|
|
2
|
-
// The IterableIterator interface does not contain these methods, which creates assignability issues in places where IteratorObjects
|
|
3
|
-
// are expected (eg. DOM-compatible APIs) if lib.esnext.iterator is loaded.
|
|
4
|
-
// Also ensures that iterators returned by the Node API, which inherit from Iterator.prototype, correctly expose the iterator helper methods
|
|
5
|
-
// if lib.esnext.iterator is loaded.
|
|
6
|
-
// TODO: remove once this package no longer supports TS 5.5, and replace NodeJS.BuiltinIteratorReturn with BuiltinIteratorReturn.
|
|
7
|
-
|
|
8
|
-
// Placeholders for TS <5.6
|
|
9
|
-
interface IteratorObject<T, TReturn, TNext> {}
|
|
10
|
-
interface AsyncIteratorObject<T, TReturn, TNext> {}
|
|
11
|
-
|
|
12
|
-
declare namespace NodeJS {
|
|
13
|
-
// Populate iterator methods for TS <5.6
|
|
14
|
-
interface Iterator<T, TReturn, TNext> extends globalThis.Iterator<T, TReturn, TNext> {}
|
|
15
|
-
interface AsyncIterator<T, TReturn, TNext> extends globalThis.AsyncIterator<T, TReturn, TNext> {}
|
|
16
|
-
|
|
17
|
-
// Polyfill for TS 5.6's instrinsic BuiltinIteratorReturn type, required for DOM-compatible iterators
|
|
18
|
-
type BuiltinIteratorReturn = ReturnType<any[][typeof Symbol.iterator]> extends
|
|
19
|
-
globalThis.Iterator<any, infer TReturn> ? TReturn
|
|
20
|
-
: any;
|
|
21
|
-
}
|