sh3-server 0.17.0 → 0.19.0

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.
@@ -1,2 +0,0 @@
1
- import{invoke as s,transformCallback as d,Resource as l}from"./core-DsojzR6k.js";var n;(function(a){a.WINDOW_RESIZED="tauri://resize",a.WINDOW_MOVED="tauri://move",a.WINDOW_CLOSE_REQUESTED="tauri://close-requested",a.WINDOW_DESTROYED="tauri://destroyed",a.WINDOW_FOCUS="tauri://focus",a.WINDOW_BLUR="tauri://blur",a.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",a.WINDOW_THEME_CHANGED="tauri://theme-changed",a.WINDOW_CREATED="tauri://window-created",a.WEBVIEW_CREATED="tauri://webview-created",a.DRAG_ENTER="tauri://drag-enter",a.DRAG_OVER="tauri://drag-over",a.DRAG_DROP="tauri://drag-drop",a.DRAG_LEAVE="tauri://drag-leave"})(n||(n={}));async function h(a,t){window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(a,t),await s("plugin:event|unlisten",{event:a,eventId:t})}async function o(a,t,e){var r;const u=(r=void 0)!==null&&r!==void 0?r:{kind:"Any"};return s("plugin:event|listen",{event:a,target:u,handler:d(t)}).then(c=>async()=>h(a,c))}async function y(a,t){return await i.load(a,t)}async function g(a){return await i.get(a)}class p{get store(){return this._store||(this._store=y(this.path,this.options)),this._store}constructor(t,e){this.path=t,this.options=e}async init(){await this.store}async set(t,e){return(await this.store).set(t,e)}async get(t){return(await this.store).get(t)}async has(t){return(await this.store).has(t)}async delete(t){return(await this.store).delete(t)}async clear(){await(await this.store).clear()}async reset(){await(await this.store).reset()}async keys(){return(await this.store).keys()}async values(){return(await this.store).values()}async entries(){return(await this.store).entries()}async length(){return(await this.store).length()}async reload(t){await(await this.store).reload(t)}async save(){await(await this.store).save()}async onKeyChange(t,e){return(await this.store).onKeyChange(t,e)}async onChange(t){return(await this.store).onChange(t)}async close(){this._store&&await(await this._store).close()}}class i extends l{constructor(t){super(t)}static async load(t,e){const r=await s("plugin:store|load",{path:t,options:e});return new i(r)}static async get(t){return await s("plugin:store|get_store",{path:t}).then(e=>e?new i(e):null)}async set(t,e){await s("plugin:store|set",{rid:this.rid,key:t,value:e})}async get(t){const[e,r]=await s("plugin:store|get",{rid:this.rid,key:t});return r?e:void 0}async has(t){return await s("plugin:store|has",{rid:this.rid,key:t})}async delete(t){return await s("plugin:store|delete",{rid:this.rid,key:t})}async clear(){await s("plugin:store|clear",{rid:this.rid})}async reset(){await s("plugin:store|reset",{rid:this.rid})}async keys(){return await s("plugin:store|keys",{rid:this.rid})}async values(){return await s("plugin:store|values",{rid:this.rid})}async entries(){return await s("plugin:store|entries",{rid:this.rid})}async length(){return await s("plugin:store|length",{rid:this.rid})}async reload(t){await s("plugin:store|reload",{rid:this.rid,...t})}async save(){await s("plugin:store|save",{rid:this.rid})}async onKeyChange(t,e){return await o("store://change",r=>{r.payload.resourceId===this.rid&&r.payload.key===t&&e(r.payload.exists?r.payload.value:void 0)})}async onChange(t){return await o("store://change",e=>{e.payload.resourceId===this.rid&&t(e.payload.key,e.payload.exists?e.payload.value:void 0)})}}export{p as LazyStore,i as Store,g as getStore,y as load};
2
- //# sourceMappingURL=index-YGsF1N98.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-YGsF1N98.js","sources":["../../../../node_modules/@tauri-apps/api/event.js","../../../../node_modules/@tauri-apps/plugin-store/dist-js/index.js"],"sourcesContent":["import { invoke, transformCallback } from './core.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * The event system allows you to emit events to the backend and listen to events from it.\n *\n * This package is also accessible with `window.__TAURI__.event` when [`app.withGlobalTauri`](https://v2.tauri.app/reference/config/#withglobaltauri) in `tauri.conf.json` is set to `true`.\n * @module\n */\n/**\n * @since 1.1.0\n */\nvar TauriEvent;\n(function (TauriEvent) {\n TauriEvent[\"WINDOW_RESIZED\"] = \"tauri://resize\";\n TauriEvent[\"WINDOW_MOVED\"] = \"tauri://move\";\n TauriEvent[\"WINDOW_CLOSE_REQUESTED\"] = \"tauri://close-requested\";\n TauriEvent[\"WINDOW_DESTROYED\"] = \"tauri://destroyed\";\n TauriEvent[\"WINDOW_FOCUS\"] = \"tauri://focus\";\n TauriEvent[\"WINDOW_BLUR\"] = \"tauri://blur\";\n TauriEvent[\"WINDOW_SCALE_FACTOR_CHANGED\"] = \"tauri://scale-change\";\n TauriEvent[\"WINDOW_THEME_CHANGED\"] = \"tauri://theme-changed\";\n TauriEvent[\"WINDOW_CREATED\"] = \"tauri://window-created\";\n TauriEvent[\"WEBVIEW_CREATED\"] = \"tauri://webview-created\";\n TauriEvent[\"DRAG_ENTER\"] = \"tauri://drag-enter\";\n TauriEvent[\"DRAG_OVER\"] = \"tauri://drag-over\";\n TauriEvent[\"DRAG_DROP\"] = \"tauri://drag-drop\";\n TauriEvent[\"DRAG_LEAVE\"] = \"tauri://drag-leave\";\n})(TauriEvent || (TauriEvent = {}));\n/**\n * Unregister the event listener associated with the given name and id.\n *\n * @ignore\n * @param event The event name\n * @param eventId Event identifier\n * @returns\n */\nasync function _unlisten(event, eventId) {\n window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(event, eventId);\n await invoke('plugin:event|unlisten', {\n event,\n eventId\n });\n}\n/**\n * Listen to an emitted event to any {@link EventTarget|target}.\n *\n * @example\n * ```typescript\n * import { listen } from '@tauri-apps/api/event';\n * const unlisten = await listen<string>('error', (event) => {\n * console.log(`Got error, payload: ${event.payload}`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler callback.\n * @param options Event listening options.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n *\n * @since 1.0.0\n */\nasync function listen(event, handler, options) {\n var _a;\n const target = typeof (options === null || options === void 0 ? void 0 : options.target) === 'string'\n ? { kind: 'AnyLabel', label: options.target }\n : ((_a = options === null || options === void 0 ? void 0 : options.target) !== null && _a !== void 0 ? _a : { kind: 'Any' });\n return invoke('plugin:event|listen', {\n event,\n target,\n handler: transformCallback(handler)\n }).then((eventId) => {\n return async () => _unlisten(event, eventId);\n });\n}\n/**\n * Listens once to an emitted event to any {@link EventTarget|target}.\n *\n * @example\n * ```typescript\n * import { once } from '@tauri-apps/api/event';\n * interface LoadedPayload {\n * loggedIn: boolean,\n * token: string\n * }\n * const unlisten = await once<LoadedPayload>('loaded', (event) => {\n * console.log(`App is loaded, loggedIn: ${event.payload.loggedIn}, token: ${event.payload.token}`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler callback.\n * @param options Event listening options.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n *\n * @since 1.0.0\n */\nasync function once(event, handler, options) {\n return listen(event, (eventData) => {\n void _unlisten(event, eventData.id);\n handler(eventData);\n }, options);\n}\n/**\n * Emits an event to all {@link EventTarget|targets}.\n *\n * @example\n * ```typescript\n * import { emit } from '@tauri-apps/api/event';\n * await emit('frontend-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param payload Event payload.\n *\n * @since 1.0.0\n */\nasync function emit(event, payload) {\n await invoke('plugin:event|emit', {\n event,\n payload\n });\n}\n/**\n * Emits an event to all {@link EventTarget|targets} matching the given target.\n *\n * @example\n * ```typescript\n * import { emitTo } from '@tauri-apps/api/event';\n * await emitTo('main', 'frontend-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n *\n * @param target Label of the target Window/Webview/WebviewWindow or raw {@link EventTarget} object.\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param payload Event payload.\n *\n * @since 2.0.0\n */\nasync function emitTo(target, event, payload) {\n const eventTarget = typeof target === 'string' ? { kind: 'AnyLabel', label: target } : target;\n await invoke('plugin:event|emit_to', {\n target: eventTarget,\n event,\n payload\n });\n}\n\nexport { TauriEvent, emit, emitTo, listen, once };\n","import { listen } from '@tauri-apps/api/event';\nimport { Resource, invoke } from '@tauri-apps/api/core';\n\n// Copyright 2019-2023 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * Create a new Store or load the existing store with the path.\n *\n * @example\n * ```typescript\n * import { Store } from '@tauri-apps/api/store';\n * const store = await Store.load('store.json');\n * ```\n *\n * @param path Path to save the store in `app_data_dir`\n * @param options Store configuration options\n */\nasync function load(path, options) {\n return await Store.load(path, options);\n}\n/**\n * Gets an already loaded store.\n *\n * If the store is not loaded, returns `null`. In this case you must {@link Store.load load} it.\n *\n * This function is more useful when you already know the store is loaded\n * and just need to access its instance. Prefer {@link Store.load} otherwise.\n *\n * @example\n * ```typescript\n * import { getStore } from '@tauri-apps/api/store';\n * const store = await getStore('store.json');\n * ```\n *\n * @param path Path of the store.\n */\nasync function getStore(path) {\n return await Store.get(path);\n}\n/**\n * A lazy loaded key-value store persisted by the backend layer.\n */\nclass LazyStore {\n get store() {\n if (!this._store) {\n this._store = load(this.path, this.options);\n }\n return this._store;\n }\n /**\n * Note that the options are not applied if someone else already created the store\n * @param path Path to save the store in `app_data_dir`\n * @param options Store configuration options\n */\n constructor(path, options) {\n this.path = path;\n this.options = options;\n }\n /**\n * Init/load the store if it's not loaded already\n */\n async init() {\n await this.store;\n }\n async set(key, value) {\n return (await this.store).set(key, value);\n }\n async get(key) {\n return (await this.store).get(key);\n }\n async has(key) {\n return (await this.store).has(key);\n }\n async delete(key) {\n return (await this.store).delete(key);\n }\n async clear() {\n await (await this.store).clear();\n }\n async reset() {\n await (await this.store).reset();\n }\n async keys() {\n return (await this.store).keys();\n }\n async values() {\n return (await this.store).values();\n }\n async entries() {\n return (await this.store).entries();\n }\n async length() {\n return (await this.store).length();\n }\n async reload(options) {\n await (await this.store).reload(options);\n }\n async save() {\n await (await this.store).save();\n }\n async onKeyChange(key, cb) {\n return (await this.store).onKeyChange(key, cb);\n }\n async onChange(cb) {\n return (await this.store).onChange(cb);\n }\n async close() {\n if (this._store) {\n await (await this._store).close();\n }\n }\n}\n/**\n * A key-value store persisted by the backend layer.\n */\nclass Store extends Resource {\n constructor(rid) {\n super(rid);\n }\n /**\n * Create a new Store or load the existing store with the path.\n *\n * @example\n * ```typescript\n * import { Store } from '@tauri-apps/api/store';\n * const store = await Store.load('store.json');\n * ```\n *\n * @param path Path to save the store in `app_data_dir`\n * @param options Store configuration options\n */\n static async load(path, options) {\n const rid = await invoke('plugin:store|load', {\n path,\n options\n });\n return new Store(rid);\n }\n /**\n * Gets an already loaded store.\n *\n * If the store is not loaded, returns `null`. In this case you must {@link Store.load load} it.\n *\n * This function is more useful when you already know the store is loaded\n * and just need to access its instance. Prefer {@link Store.load} otherwise.\n *\n * @example\n * ```typescript\n * import { Store } from '@tauri-apps/api/store';\n * let store = await Store.get('store.json');\n * if (!store) {\n * store = await Store.load('store.json');\n * }\n * ```\n *\n * @param path Path of the store.\n */\n static async get(path) {\n return await invoke('plugin:store|get_store', { path }).then((rid) => (rid ? new Store(rid) : null));\n }\n async set(key, value) {\n await invoke('plugin:store|set', {\n rid: this.rid,\n key,\n value\n });\n }\n async get(key) {\n const [value, exists] = await invoke('plugin:store|get', {\n rid: this.rid,\n key\n });\n return exists ? value : undefined;\n }\n async has(key) {\n return await invoke('plugin:store|has', {\n rid: this.rid,\n key\n });\n }\n async delete(key) {\n return await invoke('plugin:store|delete', {\n rid: this.rid,\n key\n });\n }\n async clear() {\n await invoke('plugin:store|clear', { rid: this.rid });\n }\n async reset() {\n await invoke('plugin:store|reset', { rid: this.rid });\n }\n async keys() {\n return await invoke('plugin:store|keys', { rid: this.rid });\n }\n async values() {\n return await invoke('plugin:store|values', { rid: this.rid });\n }\n async entries() {\n return await invoke('plugin:store|entries', { rid: this.rid });\n }\n async length() {\n return await invoke('plugin:store|length', { rid: this.rid });\n }\n async reload(options) {\n await invoke('plugin:store|reload', { rid: this.rid, ...options });\n }\n async save() {\n await invoke('plugin:store|save', { rid: this.rid });\n }\n async onKeyChange(key, cb) {\n return await listen('store://change', (event) => {\n if (event.payload.resourceId === this.rid && event.payload.key === key) {\n cb(event.payload.exists ? event.payload.value : undefined);\n }\n });\n }\n async onChange(cb) {\n return await listen('store://change', (event) => {\n if (event.payload.resourceId === this.rid) {\n cb(event.payload.key, event.payload.exists ? event.payload.value : undefined);\n }\n });\n }\n}\n\nexport { LazyStore, Store, getStore, load };\n"],"names":["TauriEvent","_unlisten","event","eventId","invoke","listen","handler","options","_a","target","transformCallback","load","path","Store","getStore","LazyStore","key","value","cb","Resource","rid","exists"],"mappings":"iFAcA,IAAIA,GACH,SAAUA,EAAY,CACnBA,EAAW,eAAoB,iBAC/BA,EAAW,aAAkB,eAC7BA,EAAW,uBAA4B,0BACvCA,EAAW,iBAAsB,oBACjCA,EAAW,aAAkB,gBAC7BA,EAAW,YAAiB,eAC5BA,EAAW,4BAAiC,uBAC5CA,EAAW,qBAA0B,wBACrCA,EAAW,eAAoB,yBAC/BA,EAAW,gBAAqB,0BAChCA,EAAW,WAAgB,qBAC3BA,EAAW,UAAe,oBAC1BA,EAAW,UAAe,oBAC1BA,EAAW,WAAgB,oBAC/B,GAAGA,IAAeA,EAAa,CAAA,EAAG,EASlC,eAAeC,EAAUC,EAAOC,EAAS,CACrC,OAAO,iCAAiC,mBAAmBD,EAAOC,CAAO,EACzE,MAAMC,EAAO,wBAAyB,CAClC,MAAAF,EACA,QAAAC,CACR,CAAK,CACL,CAuBA,eAAeE,EAAOH,EAAOI,EAASC,EAAS,CAC3C,IAAIC,EACJ,MAAMC,GAEED,EAA8C,UAA6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