UNPKG

@bitwarden/cli

Version:

A secure and free password manager for all of your devices.

1,454 lines (1,356 loc) 3.17 MB
#!/usr/bin/env node /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({ /***/ 330: /***/ ((module) => { module.exports = /*#__PURE__*/JSON.parse('{"name":"@bitwarden/cli","description":"A secure and free password manager for all of your devices.","version":"2025.12.0","keywords":["bitwarden","password","vault","password manager","cli"],"author":"Bitwarden Inc. <hello@bitwarden.com> (https://bitwarden.com)","homepage":"https://bitwarden.com","repository":{"type":"git","url":"git+https://github.com/bitwarden/clients.git"},"license":"SEE LICENSE IN LICENSE.txt","scripts":{"clean":"rimraf dist","build:oss":"webpack","build:oss:debug":"npm run build:oss && node --inspect ./build/bw.js","build:oss:watch":"webpack --watch","build:oss:prod":"cross-env NODE_ENV=production webpack","build:oss:prod:watch":"cross-env NODE_ENV=production webpack --watch","debug":"node --inspect ./build/bw.js","publish:npm":"npm run build:oss:prod && npm publish --access public","build:bit":"webpack -c ../../bitwarden_license/bit-cli/webpack.config.js","build:bit:debug":"npm run build:bit && node --inspect ./build/bw.js","build:bit:watch":"webpack --watch -c ../../bitwarden_license/bit-cli/webpack.config.js","build:bit:prod":"cross-env NODE_ENV=production npm run build:bit","build:bit:prod:watch":"cross-env NODE_ENV=production npm run build:bit:watch","dist:oss:win":"npm run build:oss:prod && npm run clean && npm run package:oss:win","dist:oss:mac":"npm run build:oss:prod && npm run clean && npm run package:oss:mac","dist:oss:mac-arm64":"npm run build:oss:prod && npm run clean && npm run package:oss:mac-arm64","dist:oss:lin":"npm run build:oss:prod && npm run clean && npm run package:oss:lin","dist:oss:lin-arm64":"npm run build:oss:prod && npm run clean && npm run package:oss:lin-arm64","dist:bit:win":"npm run build:bit:prod && npm run clean && npm run package:bit:win","dist:bit:mac":"npm run build:bit:prod && npm run clean && npm run package:bit:mac","dist:bit:mac-arm64":"npm run build:bit:prod && npm run clean && npm run package:bit:mac-arm64","dist:bit:lin":"npm run build:bit:prod && npm run clean && npm run package:bit:lin","dist:bit:lin-arm64":"npm run build:bit:prod && npm run clean && npm run package:bit:lin-arm64","package:oss:win":"pkg . --targets win-x64 --output ./dist/oss/windows/bw.exe","package:oss:mac":"pkg . --targets macos-x64 --output ./dist/oss/macos/bw","package:oss:mac-arm64":"pkg . --targets macos-arm64 --output ./dist/oss/macos-arm64/bw","package:oss:lin":"pkg . --targets linux-x64 --output ./dist/oss/linux/bw","package:oss:lin-arm64":"pkg . --targets linux-arm64 --output ./dist/oss/linux-arm64/bw","package:bit:win":"pkg . --targets win-x64 --output ./dist/bit/windows/bw.exe","package:bit:mac":"pkg . --targets macos-x64 --output ./dist/bit/macos/bw","package:bit:mac-arm64":"pkg . --targets macos-arm64 --output ./dist/bit/macos-arm64/bw","package:bit:lin":"pkg . --targets linux-x64 --output ./dist/bit/linux/bw","package:bit:lin-arm64":"pkg . --targets linux-arm64 --output ./dist/bit/linux-arm64/bw","test":"jest","test:watch":"jest --watch","test:watch:all":"jest --watchAll"},"bin":{"bw":"build/bw.js"},"pkg":{"assets":["./build/**/*"]},"dependencies":{"@koa/multer":"4.0.0","@koa/router":"14.0.0","big-integer":"1.6.52","browser-hrtime":"1.1.8","chalk":"4.1.2","commander":"14.0.0","core-js":"3.45.0","form-data":"4.0.4","https-proxy-agent":"7.0.6","inquirer":"8.2.6","jsdom":"26.1.0","jszip":"3.10.1","koa":"2.16.3","koa-bodyparser":"4.4.1","koa-json":"2.0.2","lowdb":"1.0.0","lunr":"2.3.9","multer":"2.0.2","node-fetch":"2.6.12","node-forge":"1.3.2","open":"10.1.2","papaparse":"5.5.3","proper-lockfile":"4.1.2","rxjs":"7.8.1","semver":"7.7.3","tldts":"7.0.18","zxcvbn":"4.4.2"}}'); /***/ }), /***/ 431: /***/ ((module, __webpack_exports__, __webpack_require__) => { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $As: () => (/* binding */ __wbg_list_056c98609a1fb3ef), /* harmony export */ $Pc: () => (/* binding */ __wbg_new_8a6f238a6ece86ea), /* harmony export */ $yx: () => (/* binding */ __wbg___wbindgen_jsval_eq_6b13ab83478b1c50), /* harmony export */ Ajz: () => (/* binding */ __wbg_instanceof_ArrayBuffer_70beb1189ca63b38), /* harmony export */ B$5: () => (/* binding */ __wbg_arrayBuffer_b375eccb84b4ddf3), /* harmony export */ BI1: () => (/* binding */ __wbg_error_3e929987fcd3e155), /* harmony export */ BZb: () => (/* binding */ __wbindgen_object_clone_ref), /* harmony export */ BiA: () => (/* binding */ __wbg_target_1447f5d3a6fa6fe0), /* harmony export */ BtZ: () => (/* binding */ __wbg_length_cdd215e10d9dd507), /* harmony export */ C$D: () => (/* binding */ __wbg_info_68cd5b51ef7e5137), /* harmony export */ CAO: () => (/* binding */ __wbg_set_907fb406c34a251d), /* harmony export */ CB9: () => (/* binding */ __wbg_crypto_574e78ad8b13b65f), /* harmony export */ CDy: () => (/* binding */ __wbg_subarray_480600f3d6a9f26c), /* harmony export */ Cqu: () => (/* binding */ __wbg_next_020810e0ae8ebcb0), /* harmony export */ Cyf: () => (/* binding */ __wbg__wbg_cb_unref_2454a539ea5790d9), /* harmony export */ Czj: () => (/* binding */ __wbg_iterator_e5822695327a3c39), /* harmony export */ D4i: () => (/* binding */ __wbg___wbindgen_boolean_get_6d5a1ee65bab5f68), /* harmony export */ Deq: () => (/* binding */ __wbg_get_efcb449f58ec27c2), /* harmony export */ Duf: () => (/* binding */ __wbg_set_signal_dda2cf7ccb6bee0f), /* harmony export */ E9A: () => (/* binding */ __wbg_set_method_c02d8cbbe204ac2d), /* harmony export */ EEW: () => (/* binding */ __wbg_stringify_b5fb28f6465d9c3e), /* harmony export */ ESg: () => (/* binding */ __wbg_prototypesetcall_2a6620b6922694b2), /* harmony export */ Eip: () => (/* binding */ __wbg___wbindgen_is_object_c818261d21f283a4), /* harmony export */ Fxh: () => (/* binding */ __wbg_msCrypto_a61aeb35a24c1329), /* harmony export */ GPN: () => (/* binding */ __wbg_get_with_ref_key_1dc361bd10053bfe), /* harmony export */ Geh: () => (/* binding */ init_sdk), /* harmony export */ GgR: () => (/* binding */ __wbg_list_78accfdd0a91ad5f), /* harmony export */ GvV: () => (/* binding */ __wbg_append_b577eb3a177bc0fa), /* harmony export */ H4N: () => (/* binding */ __wbg___wbindgen_throw_b855445ff6a94295), /* harmony export */ HYJ: () => (/* binding */ __wbg_instanceof_WorkerGlobalScope_e31f49b6d33fcadd), /* harmony export */ HpL: () => (/* binding */ __wbg_new_5a79be3ab53b8aa5), /* harmony export */ HvI: () => (/* binding */ __wbg_ipcclientsubscription_new), /* harmony export */ I8U: () => (/* binding */ __wbg_instanceof_Uint8Array_20c8e73002f7af98), /* harmony export */ IEs: () => (/* binding */ PureCrypto), /* harmony export */ ISg: () => (/* binding */ __wbg_warn_8f5b5437666d0885), /* harmony export */ IZ7: () => (/* binding */ __wbg_randomFillSync_ac0988aba3254290), /* harmony export */ Ia5: () => (/* binding */ __wbg_get_7bed016f185add81), /* harmony export */ Ilo: () => (/* binding */ __wbg_set_c2abbebe8b9ebee1), /* harmony export */ Ip3: () => (/* binding */ __wbg_set_variant_d1d41b778dfe9c17), /* harmony export */ ItQ: () => (/* binding */ __wbg_new_a7442b4b19c1a356), /* harmony export */ Iv: () => (/* binding */ __wbg_get_ab3c82eecdf4bc91), /* harmony export */ Iwk: () => (/* binding */ __wbg_next_2c826fe5dfec6b6a), /* harmony export */ Iy7: () => (/* binding */ __wbg_remove_7648970db543e157), /* harmony export */ J5t: () => (/* binding */ __wbg_error_a7f8fbb0523dae15), /* harmony export */ JME: () => (/* binding */ __wbg_warn_1d74dddbe2fd1dbb), /* harmony export */ JeQ: () => (/* binding */ __wbg_resolve_caf97c30b83f7053), /* harmony export */ KTv: () => (/* binding */ __wbg_length_69bca3cb64fc8748), /* harmony export */ KwY: () => (/* binding */ __wbg_versions_c01dfd4722a88165), /* harmony export */ Lpo: () => (/* binding */ __wbg_abort_3b256cd5ad0ac232), /* harmony export */ Lqc: () => (/* binding */ __wbg_abort_28ad55c5825b004d), /* harmony export */ Lxb: () => (/* binding */ __wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e), /* harmony export */ MVt: () => (/* binding */ __wbg_static_accessor_SELF_6fdf4b64710cc91b), /* harmony export */ MXC: () => (/* binding */ __wbg_abort_e7eb059f72f9ed0c), /* harmony export */ MpJ: () => (/* binding */ __wbg_entries_e171b586f8f6bdbf), /* harmony export */ MtL: () => (/* binding */ __wbg_mark_05056c522bddc362), /* harmony export */ N0M: () => (/* binding */ __wbg_new_1acc0b6eea89d040), /* harmony export */ NJs: () => (/* binding */ __wbg_set_3f1d0b984ed272ed), /* harmony export */ Nke: () => (/* binding */ __wbg_remove_2d6d9bd3eaac392b), /* harmony export */ O0Z: () => (/* binding */ __wbg_new_3c3d849046688a66), /* harmony export */ Oyk: () => (/* binding */ __wbg_String_8f0eb39a4a4c2f66), /* harmony export */ PQG: () => (/* binding */ __wbg_append_45ddba58b0706f62), /* harmony export */ PUO: () => (/* binding */ FieldType), /* harmony export */ PmN: () => (/* binding */ __wbg_debug_e55e1461940eb14d), /* harmony export */ PrK: () => (/* binding */ __wbg_instanceof_Window_4846dbb3de56c84c), /* harmony export */ Q4Q: () => (/* binding */ __wbindgen_cast_cb9088102bce6b30), /* harmony export */ QGd: () => (/* binding */ __wbg_set_mode_52ef73cfa79639cb), /* harmony export */ REh: () => (/* binding */ __wbindgen_cast_1e9dc1058b799ead), /* harmony export */ RLo: () => (/* binding */ __wbg_set_onerror_dc82fea584ffccaa), /* harmony export */ RS6: () => (/* binding */ __wbg_push_df81a39d04db858c), /* harmony export */ RV8: () => (/* binding */ __wbg___wbindgen_is_function_ee8a6c5833c90377), /* harmony export */ Rg: () => (/* binding */ __wbindgen_cast_9ae0607507abb057), /* harmony export */ Rhw: () => (/* binding */ __wbg___wbindgen_debug_string_df47ffb5e35e6763), /* harmony export */ Rto: () => (/* binding */ __wbg_name_3a33ad25b892b2dd), /* harmony export */ SE3: () => (/* binding */ __wbg_append_892c5e2d5bdd60ac), /* harmony export */ S_8: () => (/* binding */ __wbg_new_68651c719dcda04e), /* harmony export */ SaD: () => (/* binding */ __wbg_set_c213c871859d6500), /* harmony export */ St$: () => (/* binding */ __wbg_incomingmessage_new), /* harmony export */ Tm2: () => (/* binding */ __wbg_isSafeInteger_d216eda7911dde36), /* harmony export */ Tt0: () => (/* binding */ __wbg_send_9b8fc6bb517867dd), /* harmony export */ U1K: () => (/* binding */ __wbg_parse_2a704d6b78abb2b8), /* harmony export */ Uq6: () => (/* binding */ __wbg_call_e762c39fa8ea36bf), /* harmony export */ V1r: () => (/* binding */ __wbg___wbindgen_is_string_fbb76cb2940daafd), /* harmony export */ VB8: () => (/* binding */ __wbg_then_4f46f6544e6b4a28), /* harmony export */ VO6: () => (/* binding */ __wbg___wbindgen_is_undefined_2d472862bd29a478), /* harmony export */ W53: () => (/* binding */ __wbg_signal_4db5aa055bf9eb9a), /* harmony export */ WYM: () => (/* binding */ __wbg_error_7534b8e9a36f1ab4), /* harmony export */ WmO: () => (/* binding */ __wbg_then_70d05cf780a18d77), /* harmony export */ Wy_: () => (/* binding */ __wbg_instanceof_IdbRequest_26754883a3cc8f81), /* harmony export */ XKx: () => (/* binding */ __wbg_addEventListener_dc3da056b615f634), /* harmony export */ XXv: () => (/* binding */ __wbindgen_cast_6b441f2e42512d6e), /* harmony export */ YV2: () => (/* binding */ __wbg_info_e674a11f4f50cc0c), /* harmony export */ YVq: () => (/* binding */ __wbg_append_cb0bba4cf263a60b), /* harmony export */ ZI_: () => (/* binding */ __wbg___wbindgen_jsval_loose_eq_b664b38a2f582147), /* harmony export */ ZT8: () => (/* binding */ __wbg_error_d8b22cf4e59a6791), /* harmony export */ Z_s: () => (/* binding */ __wbg_cipher_1cdb0d79866a6837), /* harmony export */ _5w: () => (/* binding */ __wbg_result_25e75004b82b9830), /* harmony export */ _RG: () => (/* binding */ __wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2), /* harmony export */ a5H: () => (/* binding */ __wbg_getTime_14776bfb48a1bff9), /* harmony export */ aht: () => (/* binding */ __wbg_clearTimeout_b1115618e821c3b2), /* harmony export */ azX: () => (/* binding */ __wbindgen_cast_5fea77eff9dd275c), /* harmony export */ bRr: () => (/* binding */ __wbg_instanceof_DomException_83b15e7b042a0b1a), /* harmony export */ bax: () => (/* binding */ __wbg_instanceof_Map_8579b5e2ab5437c7), /* harmony export */ bcK: () => (/* binding */ __wbg_set_headers_6926da238cd32ee4), /* harmony export */ bkt: () => (/* binding */ __wbindgen_object_drop_ref), /* harmony export */ bz7: () => (/* binding */ __wbg_setTimeout_ca12ead8b48245e2), /* harmony export */ cEh: () => (/* binding */ __wbg_folder_bf0beccb0458352a), /* harmony export */ cPU: () => (/* binding */ PasswordManagerClient), /* harmony export */ cXT: () => (/* binding */ __wbg_headers_b87d7eaba61c3278), /* harmony export */ ctP: () => (/* binding */ __wbg_indexedDB_62bfbbd55ec74b14), /* harmony export */ dC$: () => (/* binding */ __wbg_instanceof_IdbDatabase_fcf75ffeeec3ec8c), /* harmony export */ dEp: () => (/* binding */ __wbg_instanceof_IdbOpenDbRequest_08e4929084e51476), /* harmony export */ d_O: () => (/* binding */ __wbg_measure_7728846525e2cced), /* harmony export */ eD1: () => (/* binding */ __wbg_value_692627309814bb8c), /* harmony export */ eLG: () => (/* binding */ __wbg_mark_24a1a597f4f00679), /* harmony export */ eaJ: () => (/* binding */ __wbg_create_f2b6bfa66a83e88e), /* harmony export */ ekg: () => (/* binding */ __wbg_set_type_63fa4c18251f6545), /* harmony export */ fRO: () => (/* binding */ __wbg_set_7f395f02ecd2904e), /* harmony export */ fWr: () => (/* binding */ __wbg_measure_0b7379f5cfacac6d), /* harmony export */ faW: () => (/* binding */ __wbg_new_e17d9f43105b08be), /* harmony export */ fgh: () => (/* binding */ __wbg_static_accessor_performance_da77b3a901a72934), /* harmony export */ g4C: () => (/* binding */ __wbg_text_dc33c15c17bdfb52), /* harmony export */ gN5: () => (/* binding */ __wbg_set_name_c0e2d6f348c746f4), /* harmony export */ gR3: () => (/* binding */ __wbg_new_with_str_and_init_0ae7728b6ec367b1), /* harmony export */ gkX: () => (/* binding */ isCryptoError), /* harmony export */ hEI: () => (/* binding */ __wbg_new_6f694bb0585846e0), /* harmony export */ hGK: () => (/* binding */ __wbg___wbindgen_is_bigint_cb320707dcd35f0b), /* harmony export */ hkC: () => (/* binding */ __wbg_new_no_args_ee98eee5275000a4), /* harmony export */ iSd: () => (/* binding */ __wbg_queueMicrotask_9d76cacb20c84d58), /* harmony export */ ibl: () => (/* binding */ __wbindgen_cast_daac1d8e48fc3ba0), /* harmony export */ iqP: () => (/* binding */ __wbindgen_cast_ef90a087adb7475d), /* harmony export */ jQA: () => (/* binding */ __wbg_set_onsuccess_f367d002b462109e), /* harmony export */ jkw: () => (/* binding */ __wbg_url_b36d2a5008eb056f), /* harmony export */ kJV: () => (/* binding */ __wbg_queueMicrotask_34d692c25c47d05b), /* harmony export */ kie: () => (/* binding */ __wbg_new_9edf9838a2def39c), /* harmony export */ kj1: () => (/* binding */ __wbg_transaction_9fb8349a0a81725c), /* harmony export */ lIU: () => (/* binding */ __wbg_set_wasm), /* harmony export */ lU$: () => (/* binding */ __wbg_node_905d3e251edff8a2), /* harmony export */ lnM: () => (/* binding */ __wbg_deleteObjectStore_444a266b213fafcf), /* harmony export */ ltG: () => (/* binding */ __wbg_Number_bb48ca12f395cd08), /* harmony export */ m9z: () => (/* binding */ __wbg_indexedDB_8b464318fe56681e), /* harmony export */ mEh: () => (/* binding */ __wbg_require_60cc747a6bc5215a), /* harmony export */ n0P: () => (/* binding */ __wbg_status_de7eed5a7a5bfd5d), /* harmony export */ nJv: () => (/* binding */ __wbindgen_cast_d87bfd09ab1288e4), /* harmony export */ oKC: () => (/* binding */ __wbg___wbindgen_string_get_e4f06c90489ad01b), /* harmony export */ og0: () => (/* binding */ __wbg_performance_121b9855d716e029), /* harmony export */ okU: () => (/* binding */ __wbg_has_787fafc980c3ccdb), /* harmony export */ okn: () => (/* binding */ __wbg___wbindgen_number_get_a20bf9b85341449d), /* harmony export */ oul: () => (/* binding */ __wbg_set_onupgradeneeded_0a519a73284a1418), /* harmony export */ pII: () => (/* binding */ __wbindgen_cast_4625c577ab2ec9ee), /* harmony export */ pLY: () => (/* binding */ __wbg_open_9d8c51d122a5a6ea), /* harmony export */ pXu: () => (/* binding */ __wbg___wbindgen_in_bb933bd9e1b3bc0f), /* harmony export */ pYi: () => (/* binding */ __wbindgen_cast_2241b6af4c4b2941), /* harmony export */ ps7: () => (/* binding */ __wbg_Error_e83987f665cf5504), /* harmony export */ px3: () => (/* binding */ __wbg_new_0_f9740686d739025c), /* harmony export */ q$k: () => (/* binding */ __wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac), /* harmony export */ q83: () => (/* binding */ __wbg_debug_f4b0c59db649db48), /* harmony export */ q8u: () => (/* binding */ __wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd), /* harmony export */ qqE: () => (/* binding */ __wbg_set_body_3c365989753d61f4), /* harmony export */ qsA: () => (/* binding */ __wbg_preventDefault_1f362670ce7ef430), /* harmony export */ rlX: () => (/* binding */ __wbindgen_cast_c5e8bf91c85dc4ef), /* harmony export */ rqp: () => (/* binding */ __wbg_new_with_length_01aa0dc35aa13543), /* harmony export */ s5K: () => (/* binding */ __wbg_getRandomValues_38097e921c2494c3), /* harmony export */ sGC: () => (/* binding */ __wbg_new_from_slice_92f4d78ca282a2d2), /* harmony export */ sPv: () => (/* binding */ __wbg_isArray_96e0af9891d0945d), /* harmony export */ sTy: () => (/* binding */ __wbg_createObjectStore_283a43a822bf49ca), /* harmony export */ sdu: () => (/* binding */ __wbindgen_cast_7a6d185652cd8149), /* harmony export */ tY3: () => (/* binding */ __wbg_get_access_token_418fcb38cdc8413d), /* harmony export */ tff: () => (/* binding */ __wbg_collectionviewnodeitem_new), /* harmony export */ typ: () => (/* binding */ __wbg_getRandomValues_b8f5dbd5f3995a9e), /* harmony export */ tys: () => (/* binding */ __wbg_call_525440f72fbfc0ea), /* harmony export */ u4f: () => (/* binding */ __wbg_done_2042aa2670fb1db1), /* harmony export */ uK7: () => (/* binding */ __wbg_get_1b7efe6c2c00e86d), /* harmony export */ uVl: () => (/* binding */ __wbg_now_f5ba683d8ce2c571), /* harmony export */ vUh: () => (/* binding */ __wbg_new_f24b6d53abe5bc82), /* harmony export */ vh6: () => (/* binding */ __wbg_set_credentials_f621cd2d85c0c228), /* harmony export */ wBj: () => (/* binding */ __wbg_set_5235cc0f26ed539b), /* harmony export */ x$X: () => (/* binding */ __wbg_stack_0ed75d68575b0f3c), /* harmony export */ x2q: () => (/* binding */ __wbg_process_dc0fbacc7c1c06f7), /* harmony export */ xFA: () => (/* binding */ __wbg_instanceof_Response_f4f3e87e07f3135c), /* harmony export */ xhx: () => (/* binding */ __wbg_fetch_f8ba0e29a9d6de0d), /* harmony export */ xiq: () => (/* binding */ __wbg_getFullYear_8240d5a15191feae), /* harmony export */ yM2: () => (/* binding */ __wbg_new_with_u8_array_sequence_and_options_0c1d0bd56d93d25a), /* harmony export */ yle: () => (/* binding */ __wbindgen_cast_d6cd19b81560fd6e), /* harmony export */ ymW: () => (/* binding */ __wbg_new_2531773dac38ebb3), /* harmony export */ you: () => (/* binding */ __wbg_fetch_3afbdcc7ddbf16fe) /* harmony export */ }); /* unused harmony exports generate_ssh_key, import_ssh_key, isTestError, isCollectionDecryptError, isMasterPasswordError, isDeriveKeyConnectorError, isEnrollAdminPasswordResetError, isCryptoClientError, isStatefulCryptoError, isEncryptionSettingsError, isExportError, isUsernameError, isPasswordError, ipcRegisterDiscoverHandler, ipcRequestDiscover, isChannelError, isDeserializeError, isRequestError, isTypedReceiveError, isReceiveError, isSubscribeError, isSshKeyExportError, isSshKeyImportError, isKeyGenerationError, isDatabaseError, isStateRegistryError, isCallError, isDecryptError, isEncryptError, isTotpError, isGetFolderError, isEditFolderError, isCreateFolderError, isCipherRiskError, isGetCipherError, isEditCipherError, isCreateCipherError, isCipherError, isDecryptFileError, isEncryptFileError, CardLinkedIdType, CipherRepromptType, CipherType, IdentityLinkedIdType, LogLevel, LoginLinkedIdType, RsaError, SecureNoteType, UriMatchType, AttachmentsClient, AuthClient, CipherRiskClient, CiphersClient, CollectionViewNodeItem, CollectionViewTree, CollectionsClient, CommercialPasswordManagerClient, CommercialVaultClient, CryptoClient, ExporterClient, FoldersClient, GeneratorClient, IdentityClient, IncomingMessage, IpcClient, IpcClientSubscription, IpcCommunicationBackend, OutgoingMessage, PlatformClient, SendAccessClient, StateClient, TotpClient, VaultClient */ /* module decorator */ module = __webpack_require__.hmd(module); let wasm; function __wbg_set_wasm(val) { wasm = val; } let cachedUint8ArrayMemory0 = null; function getUint8ArrayMemory0() { if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); } return cachedUint8ArrayMemory0; } let cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }); cachedTextDecoder.decode(); const MAX_SAFARI_DECODE_BYTES = 2146435072; let numBytesDecoded = 0; function decodeText(ptr, len) { numBytesDecoded += len; if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) { cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }); cachedTextDecoder.decode(); numBytesDecoded = len; } return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); } function getStringFromWasm0(ptr, len) { ptr = ptr >>> 0; return decodeText(ptr, len); } let heap = new Array(128).fill(undefined); heap.push(undefined, null, true, false); let heap_next = heap.length; function addHeapObject(obj) { if (heap_next === heap.length) heap.push(heap.length + 1); const idx = heap_next; heap_next = heap[idx]; heap[idx] = obj; return idx; } function getObject(idx) { return heap[idx]; } let WASM_VECTOR_LEN = 0; const cachedTextEncoder = new TextEncoder(); if (!("encodeInto" in cachedTextEncoder)) { cachedTextEncoder.encodeInto = function (arg, view) { const buf = cachedTextEncoder.encode(arg); view.set(buf); return { read: arg.length, written: buf.length, }; }; } function passStringToWasm0(arg, malloc, realloc) { if (realloc === undefined) { const buf = cachedTextEncoder.encode(arg); const ptr = malloc(buf.length, 1) >>> 0; getUint8ArrayMemory0() .subarray(ptr, ptr + buf.length) .set(buf); WASM_VECTOR_LEN = buf.length; return ptr; } let len = arg.length; let ptr = malloc(len, 1) >>> 0; const mem = getUint8ArrayMemory0(); let offset = 0; for (; offset < len; offset++) { const code = arg.charCodeAt(offset); if (code > 0x7f) break; mem[ptr + offset] = code; } if (offset !== len) { if (offset !== 0) { arg = arg.slice(offset); } ptr = realloc(ptr, len, (len = offset + arg.length * 3), 1) >>> 0; const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); const ret = cachedTextEncoder.encodeInto(arg, view); offset += ret.written; ptr = realloc(ptr, len, offset, 1) >>> 0; } WASM_VECTOR_LEN = offset; return ptr; } let cachedDataViewMemory0 = null; function getDataViewMemory0() { if ( cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer) ) { cachedDataViewMemory0 = new DataView(wasm.memory.buffer); } return cachedDataViewMemory0; } function isLikeNone(x) { return x === undefined || x === null; } function debugString(val) { // primitive types const type = typeof val; if (type == "number" || type == "boolean" || val == null) { return `${val}`; } if (type == "string") { return `"${val}"`; } if (type == "symbol") { const description = val.description; if (description == null) { return "Symbol"; } else { return `Symbol(${description})`; } } if (type == "function") { const name = val.name; if (typeof name == "string" && name.length > 0) { return `Function(${name})`; } else { return "Function"; } } // objects if (Array.isArray(val)) { const length = val.length; let debug = "["; if (length > 0) { debug += debugString(val[0]); } for (let i = 1; i < length; i++) { debug += ", " + debugString(val[i]); } debug += "]"; return debug; } // Test for built-in const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); let className; if (builtInMatches && builtInMatches.length > 1) { className = builtInMatches[1]; } else { // Failed to match the standard '[object ClassName]' return toString.call(val); } if (className == "Object") { // we're a user defined class or Object // JSON.stringify avoids problems with cycles, and is generally much // easier than looping through ownProperties of `val`. try { return "Object(" + JSON.stringify(val) + ")"; } catch (_) { return "Object"; } } // errors if (val instanceof Error) { return `${val.name}: ${val.message}\n${val.stack}`; } // TODO we could test for more things here, like `Set`s and `Map`s. return className; } function handleError(f, args) { try { return f.apply(this, args); } catch (e) { wasm.__wbindgen_exn_store(addHeapObject(e)); } } function dropObject(idx) { if (idx < 132) return; heap[idx] = heap_next; heap_next = idx; } function takeObject(idx) { const ret = getObject(idx); dropObject(idx); return ret; } function getArrayU8FromWasm0(ptr, len) { ptr = ptr >>> 0; return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len); } const CLOSURE_DTORS = typeof FinalizationRegistry === "undefined" ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry((state) => state.dtor(state.a, state.b)); function makeMutClosure(arg0, arg1, dtor, f) { const state = { a: arg0, b: arg1, cnt: 1, dtor }; const real = (...args) => { // First up with a closure we increment the internal reference // count. This ensures that the Rust closure environment won't // be deallocated while we're invoking it. state.cnt++; const a = state.a; state.a = 0; try { return f(a, state.b, ...args); } finally { state.a = a; real._wbg_cb_unref(); } }; real._wbg_cb_unref = () => { if (--state.cnt === 0) { state.dtor(state.a, state.b); state.a = 0; CLOSURE_DTORS.unregister(state); } }; CLOSURE_DTORS.register(real, state, state); return real; } function getArrayJsValueFromWasm0(ptr, len) { ptr = ptr >>> 0; const mem = getDataViewMemory0(); const result = []; for (let i = ptr; i < ptr + 4 * len; i += 4) { result.push(takeObject(mem.getUint32(i, true))); } return result; } /** * @param {LogLevel | null} [log_level] */ function init_sdk(log_level) { wasm.init_sdk(isLikeNone(log_level) ? 5 : log_level); } function passArray8ToWasm0(arg, malloc) { const ptr = malloc(arg.length * 1, 1) >>> 0; getUint8ArrayMemory0().set(arg, ptr / 1); WASM_VECTOR_LEN = arg.length; return ptr; } /** * Generate a new SSH key pair * * # Arguments * - `key_algorithm` - The algorithm to use for the key pair * * # Returns * - `Ok(SshKey)` if the key was successfully generated * - `Err(KeyGenerationError)` if the key could not be generated * @param {KeyAlgorithm} key_algorithm * @returns {SshKeyView} */ function generate_ssh_key(key_algorithm) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); wasm.generate_ssh_key(retptr, addHeapObject(key_algorithm)); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); if (r2) { throw takeObject(r1); } return takeObject(r0); } finally { wasm.__wbindgen_add_to_stack_pointer(16); } } /** * Convert a PCKS8 or OpenSSH encrypted or unencrypted private key * to an OpenSSH private key with public key and fingerprint * * # Arguments * - `imported_key` - The private key to convert * - `password` - The password to use for decrypting the key * * # Returns * - `Ok(SshKey)` if the key was successfully coneverted * - `Err(PasswordRequired)` if the key is encrypted and no password was provided * - `Err(WrongPassword)` if the password provided is incorrect * - `Err(ParsingError)` if the key could not be parsed * - `Err(UnsupportedKeyType)` if the key type is not supported * @param {string} imported_key * @param {string | null} [password] * @returns {SshKeyView} */ function import_ssh_key(imported_key, password) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); const ptr0 = passStringToWasm0(imported_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; var ptr1 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len1 = WASM_VECTOR_LEN; wasm.import_ssh_key(retptr, ptr0, len0, ptr1, len1); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); if (r2) { throw takeObject(r1); } return takeObject(r0); } finally { wasm.__wbindgen_add_to_stack_pointer(16); } } let stack_pointer = 128; function addBorrowedObject(obj) { if (stack_pointer == 1) throw new Error("out of js stack"); heap[--stack_pointer] = obj; return stack_pointer; } /** * @param {any} error * @returns {boolean} */ function isTestError(error) { try { const ret = wasm.isTestError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isCollectionDecryptError(error) { try { const ret = wasm.isCollectionDecryptError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isMasterPasswordError(error) { try { const ret = wasm.isMasterPasswordError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isDeriveKeyConnectorError(error) { try { const ret = wasm.isDeriveKeyConnectorError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isEnrollAdminPasswordResetError(error) { try { const ret = wasm.isEnrollAdminPasswordResetError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isCryptoClientError(error) { try { const ret = wasm.isCryptoClientError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isStatefulCryptoError(error) { try { const ret = wasm.isStatefulCryptoError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isEncryptionSettingsError(error) { try { const ret = wasm.isEncryptionSettingsError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isCryptoError(error) { try { const ret = wasm.isCryptoError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } function passArrayJsValueToWasm0(array, malloc) { const ptr = malloc(array.length * 4, 4) >>> 0; const mem = getDataViewMemory0(); for (let i = 0; i < array.length; i++) { mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true); } WASM_VECTOR_LEN = array.length; return ptr; } /** * @param {any} error * @returns {boolean} */ function isExportError(error) { try { const ret = wasm.isExportError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isUsernameError(error) { try { const ret = wasm.isUsernameError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isPasswordError(error) { try { const ret = wasm.isPasswordError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } function _assertClass(instance, klass) { if (!(instance instanceof klass)) { throw new Error(`expected instance of ${klass.name}`); } } /** * Registers a DiscoverHandler so that the client can respond to DiscoverRequests. * @param {IpcClient} ipc_client * @param {DiscoverResponse} response * @returns {Promise<void>} */ function ipcRegisterDiscoverHandler(ipc_client, response) { _assertClass(ipc_client, IpcClient); const ret = wasm.ipcRegisterDiscoverHandler(ipc_client.__wbg_ptr, addHeapObject(response)); return takeObject(ret); } /** * Sends a DiscoverRequest to the specified destination and returns the response. * @param {IpcClient} ipc_client * @param {Endpoint} destination * @param {AbortSignal | null} [abort_signal] * @returns {Promise<DiscoverResponse>} */ function ipcRequestDiscover(ipc_client, destination, abort_signal) { _assertClass(ipc_client, IpcClient); const ret = wasm.ipcRequestDiscover( ipc_client.__wbg_ptr, addHeapObject(destination), isLikeNone(abort_signal) ? 0 : addHeapObject(abort_signal), ); return takeObject(ret); } /** * @param {any} error * @returns {boolean} */ function isChannelError(error) { try { const ret = wasm.isChannelError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isDeserializeError(error) { try { const ret = wasm.isDeserializeError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isRequestError(error) { try { const ret = wasm.isRequestError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isTypedReceiveError(error) { try { const ret = wasm.isTypedReceiveError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isReceiveError(error) { try { const ret = wasm.isReceiveError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isSubscribeError(error) { try { const ret = wasm.isSubscribeError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isSshKeyExportError(error) { try { const ret = wasm.isSshKeyExportError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isSshKeyImportError(error) { try { const ret = wasm.isSshKeyImportError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isKeyGenerationError(error) { try { const ret = wasm.isKeyGenerationError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isDatabaseError(error) { try { const ret = wasm.isDatabaseError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isStateRegistryError(error) { try { const ret = wasm.isStateRegistryError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isCallError(error) { try { const ret = wasm.isCallError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isDecryptError(error) { try { const ret = wasm.isDecryptError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isEncryptError(error) { try { const ret = wasm.isEncryptError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isTotpError(error) { try { const ret = wasm.isTotpError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isGetFolderError(error) { try { const ret = wasm.isGetFolderError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isEditFolderError(error) { try { const ret = wasm.isEditFolderError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isCreateFolderError(error) { try { const ret = wasm.isCreateFolderError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isCipherRiskError(error) { try { const ret = wasm.isCipherRiskError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isGetCipherError(error) { try { const ret = wasm.isGetCipherError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isEditCipherError(error) { try { const ret = wasm.isEditCipherError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isCreateCipherError(error) { try { const ret = wasm.isCreateCipherError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isCipherError(error) { try { const ret = wasm.isCipherError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isDecryptFileError(error) { try { const ret = wasm.isDecryptFileError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } /** * @param {any} error * @returns {boolean} */ function isEncryptFileError(error) { try { const ret = wasm.isEncryptFileError(addBorrowedObject(error)); return ret !== 0; } finally { heap[stack_pointer++] = undefined; } } function wasm_bindgen__convert__closures_____invoke__hbc1220c6b5cbd1c8(arg0, arg1, arg2) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); wasm.wasm_bindgen__convert__closures_____invoke__hbc1220c6b5cbd1c8( retptr, arg0, arg1, addHeapObject(arg2), ); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); if (r1) { throw takeObject(r0); } } finally { wasm.__wbindgen_add_to_stack_pointer(16); } } function wasm_bindgen__convert__closures_____invoke__h092300064b8afb1e(arg0, arg1) { wasm.wasm_bindgen__convert__closures_____invoke__h092300064b8afb1e(arg0, arg1); } function wasm_bindgen__convert__closures_____invoke__hdc41283f124c06e5(arg0, arg1, arg2) { wasm.wasm_bindgen__convert__closures_____invoke__hdc41283f124c06e5( arg0, arg1, addHeapObject(arg2), ); } function wasm_bindgen__convert__closures_____invoke__h43dfd80678632d6f(arg0, arg1, arg2, arg3) { wasm.wasm_bindgen__convert__closures_____invoke__h43dfd80678632d6f( arg0, arg1, addHeapObject(arg2), addHeapObject(arg3), ); } /** * @enum {300 | 301 | 302 | 303 | 304 | 305} */ const CardLinkedIdType = Object.freeze({ CardholderName: 300, 300: "CardholderName", ExpMonth: 301, 301: "ExpMonth", ExpYear: 302, 302: "ExpYear", Code: 303, 303: "Code", Brand: 304, 304: "Brand", Number: 305, 305: "Number", }); /** * @enum {0 | 1} */ const CipherRepromptType = Object.freeze({ None: 0, 0: "None", Password: 1, 1: "Password", }); /** * @enum {1 | 2 | 3 | 4 | 5} */ const CipherType = Object.freeze({ Login: 1, 1: "Login", SecureNote: 2, 2: "SecureNote", Card: 3, 3: "Card", Identity: 4, 4: "Identity", SshKey: 5, 5: "SshKey", }); /** * Represents the type of a [FieldView]. * @enum {0 | 1 | 2 | 3} */ const FieldType = Object.freeze({ /** * Text field */ Text: 0, 0: "Text", /** * Hidden text field */ Hidden: 1, 1: "Hidden", /** * Boolean field */ Boolean: 2, 2: "Boolean", /** * Linked field */ Linked: 3, 3: "Linked", }); /** * @enum {400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418} */ const IdentityLinkedIdType = Object.freeze({ Title: 400, 400: "Title", MiddleName: 401, 401: "MiddleName", Address1: 402, 402: "Address1", Address2: 403, 403: "Address2", Address3: 404, 404: "Address3", City: 405, 405: "City", State: 406, 406: "State", PostalCode: 407, 407: "PostalCode", Country: 408, 408: "Country", Company: 409, 409: "Company", Email: 410, 410: "Email", Phone: 411, 411: "Phone", Ssn: 412, 412: "Ssn", Username: 413, 413: "Username", PassportNumber: 414, 414: "PassportNumber", LicenseNumber: 415, 415: "LicenseNumber", FirstName: 416, 416: "FirstName", LastName: 417, 417: "LastName", FullName: 418, 418: "FullName", }); /** * @enum {0 | 1 | 2 | 3 | 4} */ const LogLevel = Object.freeze({ Trace: 0, 0: "Trace", Debug: 1, 1: "Debug", Info: 2, 2: "Info", Warn: 3, 3: "Warn", Error: 4, 4: "Error", }); /** * @enum {100 | 101} */ const LoginLinkedIdType = Object.freeze({ Username: 100, 100: "Username", Password: 101, 101: "Password", }); /** * @enum {0 | 1 | 2 | 3} */ const RsaError = Object.freeze({ Decryption: 0, 0: "Decryption", Encryption: 1, 1: "Encryption", KeyParse: 2, 2: "KeyParse", KeySerialize: 3, 3: "KeySerialize", }); /** * @enum {0} */ const SecureNoteType = Object.freeze({ Generic: 0, 0: "Generic", }); /** * @enum {0 | 1 | 2 | 3 | 4 | 5} */ const UriMatchType = Object.freeze({ Domain: 0, 0: "Domain", Host: 1, 1: "Host", StartsWith: 2, 2: "StartsWith", Exact: 3, 3: "Exact", RegularExpression: 4, 4: "RegularExpression", Never: 5, 5: "Never", }); const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"]; const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"]; const AttachmentsClientFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry((ptr) => wasm.__wbg_attachmentsclient_free(ptr >>> 0, 1)); class AttachmentsClient { static __wrap(ptr) { ptr = ptr >>> 0; const obj = Object.create(AttachmentsClient.prototype); obj.__wbg_ptr = ptr; AttachmentsClientFinalization.register(obj, obj.__wbg_ptr, obj); return obj; } __destroy_into_raw() { const ptr = this.__wbg_ptr; this.__wbg_ptr = 0; AttachmentsClientFinalization.unregister(this); return ptr; } free() { const ptr = this.__destroy_into_raw(); wasm.__wbg_attachmentsclient_free(ptr, 0); } /** * @param {Cipher} cipher * @param {AttachmentView} attachment * @param {Uint8Array} encrypted_buffer * @returns {Uint8Array} */ decrypt_buffer(cipher, attachment, encrypted_buffer) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); const ptr0 = passArray8ToWasm0(encrypted_buffer, wasm.__wbindgen_malloc); const len0 = WASM_VECTOR_LEN; wasm.attachmentsclient_decrypt_buffer( retptr, this.__wbg_ptr, addHeapObject(cipher), addHeapObject(attachment), ptr0, len0, ); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true); if (r3) { throw takeObject(r2); } var v2 = getArrayU8FromWasm0(r0, r1).slice(); wasm.__wbindgen_free(r0, r1 * 1, 1); return v2; } finally { wasm.__wbindgen_add_to_stack_pointer(16); } } } if (Symbol.dispose) AttachmentsClient.prototype[Symbol.dispose] = AttachmentsClient.prototype.free; const AuthClientFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry((ptr) => wasm.__wbg_authclient_free(ptr >>> 0, 1)); /** * Subclient containing auth functionality. */ class AuthClient { static __wrap(ptr) { ptr = ptr >>> 0; const obj = Object.create(AuthClient.prototype); obj.__wbg_ptr = ptr; AuthClientFinalization.register(obj, obj.__wbg_ptr, obj); return obj; } __destroy_into_raw() { const ptr = this.__wbg_ptr; this.__wbg_ptr = 0; AuthClientFinalization.unregister(this); return ptr; } free() { const ptr = this.__destroy_into_raw(); wasm.__wbg_authclient_free(ptr, 0); } /** * Client for identity functionality * @returns {IdentityClient} */ identity() { const ret = wasm.authclient_identity(this.__wbg_ptr); return IdentityClient.__wrap(ret); } /** * Client for send access functionality * @returns {SendAccessClient} */ send_access() { const ret = wasm.authclient_identity(this.__wbg_ptr); return SendAccessClient.__wrap(ret); } } if (Symbol.dispose) AuthClient.prototype[Symbol.dispose] = AuthClient.prototype.free; const CipherRiskClientFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry((ptr) => wasm.__wbg_cipherriskclient_free(ptr >>> 0, 1)); /** * Client for evaluating credential risk for login ciphers. */ class CipherRiskClient { static __wrap(ptr) { ptr = ptr >>> 0; const obj = Object.create(CipherRiskClient.prototype); obj.__wbg_ptr = ptr; CipherRiskClientFinalization.register(obj, obj.__wbg_ptr, obj); return obj; } __destroy_into_raw() { const ptr = this.__wbg_ptr; this.__wbg_ptr = 0; CipherRiskClientFinalization.unregister(this); return ptr; } free() { const ptr = this.__destroy_into_raw(); wasm.__wbg_cipherriskclient_free(ptr, 0); } /** * Build password reuse map for a list of login ciphers. * * Returns a map where keys are passwords and values are the number of times * each password appears in the provided list. This map can be passed to `compute_risk()` * to enable password reuse detection. * @param {CipherLoginDetails[]} login_details * @returns {PasswordReuseMap} */ password_reuse_map(login_details) { const ptr0 = passArrayJsValueToWasm0(login_details, wasm.__wbindgen_malloc); const len0 = WASM_VECTOR_LEN; const ret = wasm.cipherriskclient_password_reuse_map(this.__wbg_ptr, ptr0, len0); return takeObject(ret); } /** * Evaluate security risks for multiple login ciphers concurrently. * * For each cipher: * 1. Calculates password strength (0-4) using zxcvbn with cipher-specific context * 2. Optionally checks if the password has been exposed via Have I Been Pwned API * 3. Counts how many times the password is reused in the provided `password_map` * * Returns a vector of `CipherRisk` results, one for each input cipher. * * ## HIBP Check Results (`exposed_result` field) * * The `exposed_result` field uses the `ExposedPasswordResult` enum with three possible states: * - `NotChecked`: Password exposure check was not performed because: * - `che