fix(deps): update tauri monorepo (#815)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

Committed via a GitHub action: https://github.com/tauri-apps/plugins-workspace/actions/runs/7288671708

Co-authored-by: FabianLars <FabianLars@users.noreply.github.com>
This commit is contained in:
renovate[bot]
2023-12-21 13:20:08 +00:00
committed by tauri-bot
parent dc68af3679
commit f4ded1cd45
3 changed files with 66 additions and 7 deletions

69
dist-js/index.min.js vendored
View File

@@ -1,12 +1,71 @@
var d$1=Object.defineProperty;var e=(c,a)=>{for(var b in a)d$1(c,b,{get:a[b],enumerable:!0});};
var u={};e(u,{convertFileSrc:()=>d,invoke:()=>_,transformCallback:()=>s});function l(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(e,r=!1){let n=l(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e?.(o)),writable:!1,configurable:!0}),n}async function _(e,r={}){return new Promise((n,t)=>{let o=s(i=>{n(i),Reflect.deleteProperty(window,`_${c}`);},!0),c=s(i=>{t(i),Reflect.deleteProperty(window,`_${o}`);},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:c,...r});})}function d(e,r="asset"){return window.__TAURI__.convertFileSrc(e,r)}
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
/** @ignore */
function uid() {
return window.crypto.getRandomValues(new Uint32Array(1))[0];
}
/**
* Transforms a callback function to a string identifier that can be passed to the backend.
* The backend uses the identifier to `eval()` the callback.
*
* @return A unique identifier associated with the callback function.
*
* @since 1.0.0
*/
function transformCallback(callback, once = false) {
const identifier = uid();
const prop = `_${identifier}`;
Object.defineProperty(window, prop, {
value: (result) => {
if (once) {
Reflect.deleteProperty(window, prop);
}
return callback?.(result);
},
writable: false,
configurable: true
});
return identifier;
}
/**
* Sends a message to the backend.
* @example
* ```typescript
* import { invoke } from '@tauri-apps/api/tauri';
* await invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' });
* ```
*
* @param cmd The command name.
* @param args The optional arguments to pass to the command.
* @return A promise resolving or rejecting to the backend response.
*
* @since 1.0.0
*/
async function invoke(cmd, args = {}) {
return new Promise((resolve, reject) => {
const callback = transformCallback((e) => {
resolve(e);
Reflect.deleteProperty(window, `_${error}`);
}, true);
const error = transformCallback((e) => {
reject(e);
Reflect.deleteProperty(window, `_${callback}`);
}, true);
window.__TAURI_IPC__({
cmd,
callback,
error,
...args
});
});
}
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
async function metadata(path) {
return await _("plugin:fs-extra|metadata", {
return await invoke("plugin:fs-extra|metadata", {
path,
}).then((metadata) => {
const { accessedAtMs, createdAtMs, modifiedAtMs, ...data } = metadata;
@@ -19,7 +78,7 @@ async function metadata(path) {
});
}
async function exists(path) {
return await _("plugin:fs-extra|exists", { path });
return await invoke("plugin:fs-extra|exists", { path });
}
export { exists, metadata };

File diff suppressed because one or more lines are too long

View File

@@ -28,6 +28,6 @@
"tslib": "2.6.2"
},
"dependencies": {
"@tauri-apps/api": "1.5.1"
"@tauri-apps/api": "1.5.3"
}
}