@wailsnet/plugin-stronghold 0.0.0-stage → 0.1.0-alpha.1
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/LICENSE +21 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +29 -0
- package/package.json +28 -3
- package/README.md +0 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Wails.Net Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* stronghold 插件前端 API(命令前缀 `stronghold.*`)。
|
|
3
|
+
* 对应后端 Wails.Net.Plugins.Stronghold.StrongholdPlugin 注册的命令。
|
|
4
|
+
* 使用 AES-GCM 认证加密和 PBKDF2 密钥派生,加密数据持久化到 JSON 文件。
|
|
5
|
+
*/
|
|
6
|
+
export declare const stronghold: {
|
|
7
|
+
/** 使用密码解锁或创建金库,成功返回 true。vaultPath 省略时使用默认金库路径。 */
|
|
8
|
+
unlock: (password: string, vaultPath?: string | null) => import("@wailsnet/runtime").CancellablePromise<boolean>;
|
|
9
|
+
/** 锁定金库(清除内存中的密钥和秘密数据)。vaultPath 省略时使用默认金库路径。 */
|
|
10
|
+
lock: (vaultPath?: string | null) => import("@wailsnet/runtime").CancellablePromise<void>;
|
|
11
|
+
/** 保存加密秘密,成功返回 true。vaultPath 省略时使用默认金库路径。 */
|
|
12
|
+
saveSecret: (key: string, value: string, vaultPath?: string | null) => import("@wailsnet/runtime").CancellablePromise<boolean>;
|
|
13
|
+
/** 获取解密秘密;未找到或金库未解锁返回 null。vaultPath 省略时使用默认金库路径。 */
|
|
14
|
+
getSecret: (key: string, vaultPath?: string | null) => import("@wailsnet/runtime").CancellablePromise<string | null>;
|
|
15
|
+
/** 删除秘密,成功返回 true。vaultPath 省略时使用默认金库路径。 */
|
|
16
|
+
deleteSecret: (key: string, vaultPath?: string | null) => import("@wailsnet/runtime").CancellablePromise<boolean>;
|
|
17
|
+
/** 列出所有秘密键;金库未解锁返回 null。vaultPath 省略时使用默认金库路径。 */
|
|
18
|
+
listKeys: (vaultPath?: string | null) => import("@wailsnet/runtime").CancellablePromise<string[] | null>;
|
|
19
|
+
/** 检查金库是否已解锁。vaultPath 省略时使用默认金库路径。 */
|
|
20
|
+
isUnlocked: (vaultPath?: string | null) => import("@wailsnet/runtime").CancellablePromise<boolean>;
|
|
21
|
+
/** 修改金库密码,旧密码错误返回 false。vaultPath 省略时使用默认金库路径。 */
|
|
22
|
+
changePassword: (oldPassword: string, newPassword: string, vaultPath?: string | null) => import("@wailsnet/runtime").CancellablePromise<boolean>;
|
|
23
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @wailsnet/plugin-stronghold — stronghold 插件前端封装。
|
|
3
|
+
* 命令前缀 `stronghold.*`(M3 runtime 变薄:从 @wailsnet/runtime 迁移至此,按需安装)。
|
|
4
|
+
* @platform windows,linux,macos,android 全平台通用插件。
|
|
5
|
+
*/
|
|
6
|
+
import { call } from "@wailsnet/runtime";
|
|
7
|
+
/**
|
|
8
|
+
* stronghold 插件前端 API(命令前缀 `stronghold.*`)。
|
|
9
|
+
* 对应后端 Wails.Net.Plugins.Stronghold.StrongholdPlugin 注册的命令。
|
|
10
|
+
* 使用 AES-GCM 认证加密和 PBKDF2 密钥派生,加密数据持久化到 JSON 文件。
|
|
11
|
+
*/
|
|
12
|
+
export const stronghold = {
|
|
13
|
+
/** 使用密码解锁或创建金库,成功返回 true。vaultPath 省略时使用默认金库路径。 */
|
|
14
|
+
unlock: (password, vaultPath) => call("stronghold.unlock", [password, vaultPath ?? null]),
|
|
15
|
+
/** 锁定金库(清除内存中的密钥和秘密数据)。vaultPath 省略时使用默认金库路径。 */
|
|
16
|
+
lock: (vaultPath) => call("stronghold.lock", [vaultPath ?? null]),
|
|
17
|
+
/** 保存加密秘密,成功返回 true。vaultPath 省略时使用默认金库路径。 */
|
|
18
|
+
saveSecret: (key, value, vaultPath) => call("stronghold.saveSecret", [key, value, vaultPath ?? null]),
|
|
19
|
+
/** 获取解密秘密;未找到或金库未解锁返回 null。vaultPath 省略时使用默认金库路径。 */
|
|
20
|
+
getSecret: (key, vaultPath) => call("stronghold.getSecret", [key, vaultPath ?? null]),
|
|
21
|
+
/** 删除秘密,成功返回 true。vaultPath 省略时使用默认金库路径。 */
|
|
22
|
+
deleteSecret: (key, vaultPath) => call("stronghold.deleteSecret", [key, vaultPath ?? null]),
|
|
23
|
+
/** 列出所有秘密键;金库未解锁返回 null。vaultPath 省略时使用默认金库路径。 */
|
|
24
|
+
listKeys: (vaultPath) => call("stronghold.listKeys", [vaultPath ?? null]),
|
|
25
|
+
/** 检查金库是否已解锁。vaultPath 省略时使用默认金库路径。 */
|
|
26
|
+
isUnlocked: (vaultPath) => call("stronghold.isUnlocked", [vaultPath ?? null]),
|
|
27
|
+
/** 修改金库密码,旧密码错误返回 false。vaultPath 省略时使用默认金库路径。 */
|
|
28
|
+
changePassword: (oldPassword, newPassword, vaultPath) => call("stronghold.changePassword", [oldPassword, newPassword, vaultPath ?? null]),
|
|
29
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wailsnet/plugin-stronghold",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./package.json": "./package.json"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@wailsnet/runtime": "0.1.0-alpha.1"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"typescript": "^5.9.3"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public",
|
|
25
|
+
"registry": "https://registry.npmjs.org"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc -p tsconfig.json",
|
|
29
|
+
"typecheck": "tsc --noEmit"
|
|
30
|
+
}
|
|
6
31
|
}
|
package/README.md
DELETED