mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-10-18 23:07:27 +02:00
`convertToRustHeaders` replaced `options.headers` of the object passed to `check`, `download` and `downloadAndInstall` with an array of entries. The headers are now converted into the invoke payload only (`toRustHeaders`). E2E: `check` leaves the options object untouched. plugins/updater/guest-js/index.ts
2 lines
1.3 KiB
JavaScript
2 lines
1.3 KiB
JavaScript
if("__TAURI__"in window){var __TAURI_PLUGIN_UPDATER__=function(e,n){"use strict";class a extends n.Resource{constructor(e){super(e.rid),this.available=!0,this.currentVersion=e.currentVersion,this.version=e.version,this.date=e.date,this.body=e.body,this.rawJson=e.rawJson}async download(e,a){const s=new n.Channel;e&&(s.onmessage=e);const d=await n.invoke("plugin:updater|download",{onEvent:s,rid:this.rid,...a,headers:t(a?.headers)});await(this.downloadedBytes?.close().catch(()=>{})),this.downloadedBytes=new n.Resource(d)}async install(e){if(!this.downloadedBytes)throw new Error("Update.install called before Update.download");await n.invoke("plugin:updater|install",{updateRid:this.rid,bytesRid:this.downloadedBytes.rid,...e}),this.downloadedBytes=void 0}async downloadAndInstall(e,a){const s=new n.Channel;e&&(s.onmessage=e),await n.invoke("plugin:updater|download_and_install",{onEvent:s,rid:this.rid,...a,headers:t(a?.headers)})}async close(){await(this.downloadedBytes?.close()),await super.close()}}function t(e){return e?Array.from(new Headers(e).entries()):void 0}return e.Update=a,e.check=async function(e){const s=await n.invoke("plugin:updater|check",{...e,headers:t(e?.headers)});return s?new a(s):null},e}({},window.__TAURI__.core);Object.defineProperty(window.__TAURI__,"updater",{value:__TAURI_PLUGIN_UPDATER__})}
|