dsh-vault 1.9.6 → 1.9.7
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/lib/client.js +90 -90
- package/lib/index.js +26 -3
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -17,111 +17,111 @@ window.__ModuleLoader__.load({
|
|
|
17
17
|
document.head.appendChild(tag);
|
|
18
18
|
}
|
|
19
19
|
var VaultSection_module_css_default = {
|
|
20
|
-
"rowSelected": "t_j5va_rowSelected",
|
|
21
|
-
"editor": "t_j5va_editor",
|
|
22
|
-
"pinStar": "t_j5va_pinStar",
|
|
23
|
-
"emptyHint": "t_j5va_emptyHint",
|
|
24
20
|
"selectActive": "t_j5va_selectActive",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"reportTitle": "t_j5va_reportTitle",
|
|
34
|
-
"toolbar": "t_j5va_toolbar",
|
|
21
|
+
"policyField": "t_j5va_policyField",
|
|
22
|
+
"pwHistPwd": "t_j5va_pwHistPwd",
|
|
23
|
+
"histLink": "t_j5va_histLink",
|
|
24
|
+
"pwMeter": "t_j5va_pwMeter",
|
|
25
|
+
"searchBox": "t_j5va_searchBox",
|
|
26
|
+
"footer": "t_j5va_footer",
|
|
27
|
+
"detailItem": "t_j5va_detailItem",
|
|
28
|
+
"resultCount": "t_j5va_resultCount",
|
|
35
29
|
"uriCode": "t_j5va_uriCode",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"pinOff": "t_j5va_pinOff",
|
|
43
|
-
"reportBox": "t_j5va_reportBox",
|
|
44
|
-
"kindIcon": "t_j5va_kindIcon",
|
|
45
|
-
"highBadge": "t_j5va_highBadge",
|
|
30
|
+
"lockedTag": "t_j5va_lockedTag",
|
|
31
|
+
"bulkItem": "t_j5va_bulkItem",
|
|
32
|
+
"tabs": "t_j5va_tabs",
|
|
33
|
+
"editorActions": "t_j5va_editorActions",
|
|
34
|
+
"secretField": "t_j5va_secretField",
|
|
35
|
+
"moreButton": "t_j5va_moreButton",
|
|
46
36
|
"totpRing": "t_j5va_totpRing",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"modeAuto": "t_j5va_modeAuto",
|
|
37
|
+
"dueBadge": "t_j5va_dueBadge",
|
|
38
|
+
"policyBar": "t_j5va_policyBar",
|
|
39
|
+
"reportLine": "t_j5va_reportLine",
|
|
40
|
+
"bulkCount": "t_j5va_bulkCount",
|
|
52
41
|
"title": "t_j5va_title",
|
|
53
|
-
"
|
|
54
|
-
"
|
|
42
|
+
"healthBar": "t_j5va_healthBar",
|
|
43
|
+
"clearButton": "t_j5va_clearButton",
|
|
55
44
|
"auditIssues": "t_j5va_auditIssues",
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"moreMenu": "t_j5va_moreMenu",
|
|
61
|
-
"empty": "t_j5va_empty",
|
|
62
|
-
"trashButton": "t_j5va_trashButton",
|
|
63
|
-
"secretField": "t_j5va_secretField",
|
|
64
|
-
"dangerButton": "t_j5va_dangerButton",
|
|
65
|
-
"badgeDanger": "t_j5va_badgeDanger",
|
|
66
|
-
"rowMain": "t_j5va_rowMain",
|
|
67
|
-
"histNeutral": "t_j5va_histNeutral",
|
|
45
|
+
"retryButton": "t_j5va_retryButton",
|
|
46
|
+
"genHist": "t_j5va_genHist",
|
|
47
|
+
"tab": "t_j5va_tab",
|
|
48
|
+
"kindIcon": "t_j5va_kindIcon",
|
|
68
49
|
"histUpdate": "t_j5va_histUpdate",
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"genOptRow": "t_j5va_genOptRow",
|
|
72
|
-
"pwFair": "t_j5va_pwFair",
|
|
73
|
-
"pwStrong": "t_j5va_pwStrong",
|
|
74
|
-
"histAdd": "t_j5va_histAdd",
|
|
75
|
-
"policyBar": "t_j5va_policyBar",
|
|
76
|
-
"kindChip": "t_j5va_kindChip",
|
|
77
|
-
"bulkBar": "t_j5va_bulkBar",
|
|
78
|
-
"histDanger": "t_j5va_histDanger",
|
|
79
|
-
"tabs": "t_j5va_tabs",
|
|
80
|
-
"identity": "t_j5va_identity",
|
|
81
|
-
"pwHistTime": "t_j5va_pwHistTime",
|
|
82
|
-
"pwBar": "t_j5va_pwBar",
|
|
50
|
+
"emptyBox": "t_j5va_emptyBox",
|
|
51
|
+
"highBadge": "t_j5va_highBadge",
|
|
83
52
|
"row": "t_j5va_row",
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"error": "t_j5va_error",
|
|
88
|
-
"pinOn": "t_j5va_pinOn",
|
|
89
|
-
"revealButton": "t_j5va_revealButton",
|
|
90
|
-
"sortButton": "t_j5va_sortButton",
|
|
53
|
+
"genOptRow": "t_j5va_genOptRow",
|
|
54
|
+
"srOnly": "t_j5va_srOnly",
|
|
55
|
+
"rowSelected": "t_j5va_rowSelected",
|
|
91
56
|
"auditRow": "t_j5va_auditRow",
|
|
92
|
-
"reportLine": "t_j5va_reportLine",
|
|
93
|
-
"badgeWarn": "t_j5va_badgeWarn",
|
|
94
|
-
"copied": "t_j5va_copied",
|
|
95
|
-
"dueBadge": "t_j5va_dueBadge",
|
|
96
|
-
"policyField": "t_j5va_policyField",
|
|
97
|
-
"tabPane": "t_j5va_tabPane",
|
|
98
57
|
"list": "t_j5va_list",
|
|
99
|
-
"
|
|
100
|
-
"pwHistPwd": "t_j5va_pwHistPwd",
|
|
101
|
-
"moreButton": "t_j5va_moreButton",
|
|
102
|
-
"histLink": "t_j5va_histLink",
|
|
103
|
-
"bulkItem": "t_j5va_bulkItem",
|
|
104
|
-
"moreWrap": "t_j5va_moreWrap",
|
|
105
|
-
"reportSub": "t_j5va_reportSub",
|
|
106
|
-
"intro": "t_j5va_intro",
|
|
107
|
-
"footer": "t_j5va_footer",
|
|
108
|
-
"detailItem": "t_j5va_detailItem",
|
|
109
|
-
"retryButton": "t_j5va_retryButton",
|
|
58
|
+
"saveButton": "t_j5va_saveButton",
|
|
110
59
|
"genOpts": "t_j5va_genOpts",
|
|
60
|
+
"copied": "t_j5va_copied",
|
|
61
|
+
"error": "t_j5va_error",
|
|
62
|
+
"identity": "t_j5va_identity",
|
|
111
63
|
"dupNames": "t_j5va_dupNames",
|
|
112
|
-
"resultCount": "t_j5va_resultCount",
|
|
113
|
-
"rowExpired": "t_j5va_rowExpired",
|
|
114
64
|
"dupMerge": "t_j5va_dupMerge",
|
|
115
|
-
"
|
|
65
|
+
"pwHistBox": "t_j5va_pwHistBox",
|
|
66
|
+
"editor": "t_j5va_editor",
|
|
67
|
+
"trashButton": "t_j5va_trashButton",
|
|
68
|
+
"modeAsk": "t_j5va_modeAsk",
|
|
116
69
|
"detailBox": "t_j5va_detailBox",
|
|
117
|
-
"
|
|
70
|
+
"scoreRing": "t_j5va_scoreRing",
|
|
71
|
+
"pwFair": "t_j5va_pwFair",
|
|
72
|
+
"section": "t_j5va_section",
|
|
73
|
+
"tabPane": "t_j5va_tabPane",
|
|
74
|
+
"rowMain": "t_j5va_rowMain",
|
|
75
|
+
"deleteButton": "t_j5va_deleteButton",
|
|
76
|
+
"pinOff": "t_j5va_pinOff",
|
|
77
|
+
"badgeOk": "t_j5va_badgeOk",
|
|
78
|
+
"bulkBar": "t_j5va_bulkBar",
|
|
79
|
+
"intro": "t_j5va_intro",
|
|
80
|
+
"lockedBanner": "t_j5va_lockedBanner",
|
|
81
|
+
"reportTitle": "t_j5va_reportTitle",
|
|
82
|
+
"histAdd": "t_j5va_histAdd",
|
|
118
83
|
"status": "t_j5va_status",
|
|
119
|
-
"pwMeter": "t_j5va_pwMeter",
|
|
120
84
|
"addButton": "t_j5va_addButton",
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"
|
|
85
|
+
"emptyHint": "t_j5va_emptyHint",
|
|
86
|
+
"checkField": "t_j5va_checkField",
|
|
87
|
+
"revealButton": "t_j5va_revealButton",
|
|
88
|
+
"pinOn": "t_j5va_pinOn",
|
|
89
|
+
"dangerButton": "t_j5va_dangerButton",
|
|
90
|
+
"dupGroup": "t_j5va_dupGroup",
|
|
91
|
+
"pwHistRow": "t_j5va_pwHistRow",
|
|
92
|
+
"reportBox": "t_j5va_reportBox",
|
|
93
|
+
"modeReadonly": "t_j5va_modeReadonly",
|
|
94
|
+
"totp": "t_j5va_totp",
|
|
95
|
+
"badgeWarn": "t_j5va_badgeWarn",
|
|
96
|
+
"pwBar": "t_j5va_pwBar",
|
|
97
|
+
"histNeutral": "t_j5va_histNeutral",
|
|
98
|
+
"rowExpired": "t_j5va_rowExpired",
|
|
99
|
+
"badge": "t_j5va_badge",
|
|
100
|
+
"healthSummary": "t_j5va_healthSummary",
|
|
101
|
+
"pwStrong": "t_j5va_pwStrong",
|
|
102
|
+
"rowCheck": "t_j5va_rowCheck",
|
|
103
|
+
"toolbar": "t_j5va_toolbar",
|
|
104
|
+
"modeAuto": "t_j5va_modeAuto",
|
|
105
|
+
"moreMenu": "t_j5va_moreMenu",
|
|
106
|
+
"empty": "t_j5va_empty",
|
|
107
|
+
"pwHistTime": "t_j5va_pwHistTime",
|
|
108
|
+
"backupButton": "t_j5va_backupButton",
|
|
109
|
+
"kindFilter": "t_j5va_kindFilter",
|
|
110
|
+
"moreWrap": "t_j5va_moreWrap",
|
|
111
|
+
"actionPrimary": "t_j5va_actionPrimary",
|
|
112
|
+
"field": "t_j5va_field",
|
|
113
|
+
"reportSub": "t_j5va_reportSub",
|
|
114
|
+
"editorBody": "t_j5va_editorBody",
|
|
115
|
+
"histDanger": "t_j5va_histDanger",
|
|
116
|
+
"pinStar": "t_j5va_pinStar",
|
|
117
|
+
"rowDue": "t_j5va_rowDue",
|
|
118
|
+
"badgeDanger": "t_j5va_badgeDanger",
|
|
119
|
+
"rowActions": "t_j5va_rowActions",
|
|
120
|
+
"sortButton": "t_j5va_sortButton",
|
|
121
|
+
"pwWeak": "t_j5va_pwWeak",
|
|
122
|
+
"pwLabel": "t_j5va_pwLabel",
|
|
123
|
+
"kindChip": "t_j5va_kindChip",
|
|
124
|
+
"tabActive": "t_j5va_tabActive"
|
|
125
125
|
};
|
|
126
126
|
//#endregion
|
|
127
127
|
//#region src/client/VaultSection.tsx
|
package/lib/index.js
CHANGED
|
@@ -4887,20 +4887,28 @@ let VaultGateway = (() => {
|
|
|
4887
4887
|
if (await store.restore(e.id))
|
|
4888
4888
|
restored++;
|
|
4889
4889
|
}
|
|
4890
|
+
if (restored > 0)
|
|
4891
|
+
void this.autoBackup();
|
|
4890
4892
|
return { restored };
|
|
4891
4893
|
}
|
|
4892
4894
|
/** Restore a trashed entry (non-secret summary returned). */
|
|
4893
4895
|
async restore(id) {
|
|
4894
4896
|
this.assertWritable('restore');
|
|
4895
4897
|
const store = await this.guardedStore();
|
|
4896
|
-
|
|
4898
|
+
const restored = await store.restore(id);
|
|
4899
|
+
if (restored)
|
|
4900
|
+
void this.autoBackup();
|
|
4901
|
+
return { restored };
|
|
4897
4902
|
}
|
|
4898
4903
|
/** Permanently remove a trashed (or active) entry from the Settings UI
|
|
4899
4904
|
* ("empty trash" / individual purge). */
|
|
4900
4905
|
async purge(id) {
|
|
4901
4906
|
this.assertWritable('purge');
|
|
4902
4907
|
const store = await this.guardedStore();
|
|
4903
|
-
|
|
4908
|
+
const purged = await store.purge(id);
|
|
4909
|
+
if (purged)
|
|
4910
|
+
void this.autoBackup();
|
|
4911
|
+
return { purged };
|
|
4904
4912
|
}
|
|
4905
4913
|
/** Days since last backup + backup count (no secrets). */
|
|
4906
4914
|
async backup(maxBackups) {
|
|
@@ -4932,6 +4940,14 @@ let VaultGateway = (() => {
|
|
|
4932
4940
|
catch { /* no dir yet */ }
|
|
4933
4941
|
return { path: backup, kept: Math.max(1, Math.min(total, max)), pruned };
|
|
4934
4942
|
}
|
|
4943
|
+
/** Best-effort auto-backup after a write (1Password-style). Retention is
|
|
4944
|
+
* bounded by the configured keep count; failures never break the write. */
|
|
4945
|
+
async autoBackup() {
|
|
4946
|
+
try {
|
|
4947
|
+
await this.backup(this.backupRetention);
|
|
4948
|
+
}
|
|
4949
|
+
catch { /* backup is best-effort */ }
|
|
4950
|
+
}
|
|
4935
4951
|
async backupStatus() {
|
|
4936
4952
|
const dir = dirname(this.vaultPath ?? defaultVaultPath(this.activeName));
|
|
4937
4953
|
const stamps = [];
|
|
@@ -5889,6 +5905,8 @@ let VaultGateway = (() => {
|
|
|
5889
5905
|
async setFavorite(id, favorite) {
|
|
5890
5906
|
const store = await this.guardedStore();
|
|
5891
5907
|
const updated = await store.setFavorite(id, favorite);
|
|
5908
|
+
if (updated !== undefined)
|
|
5909
|
+
void this.autoBackup();
|
|
5892
5910
|
return { found: updated !== undefined };
|
|
5893
5911
|
}
|
|
5894
5912
|
/** List an entry's attachments (names + sizes, never the data). */
|
|
@@ -5940,6 +5958,7 @@ let VaultGateway = (() => {
|
|
|
5940
5958
|
throw new Error('vault: title must not be empty');
|
|
5941
5959
|
const store = await this.guardedStore();
|
|
5942
5960
|
const entry = await store.add(patch);
|
|
5961
|
+
void this.autoBackup();
|
|
5943
5962
|
return toSummary(entry);
|
|
5944
5963
|
}
|
|
5945
5964
|
/** Update an existing entry's fields; returns the updated summary or not-found. */
|
|
@@ -5949,13 +5968,17 @@ let VaultGateway = (() => {
|
|
|
5949
5968
|
const updated = await store.update(id, patch);
|
|
5950
5969
|
if (updated === undefined)
|
|
5951
5970
|
return { found: false };
|
|
5971
|
+
void this.autoBackup();
|
|
5952
5972
|
return { found: true, entry: toSummary(updated) };
|
|
5953
5973
|
}
|
|
5954
5974
|
/** Delete an entry by id. */
|
|
5955
5975
|
async delete(id) {
|
|
5956
5976
|
this.assertWritable('delete');
|
|
5957
5977
|
const store = await this.guardedStore();
|
|
5958
|
-
|
|
5978
|
+
const deleted = await store.delete(id);
|
|
5979
|
+
if (deleted)
|
|
5980
|
+
void this.autoBackup();
|
|
5981
|
+
return { deleted };
|
|
5959
5982
|
}
|
|
5960
5983
|
/** Generate the current TOTP code for a stored otpSecret (or bare secret). */
|
|
5961
5984
|
async totp(id, secret) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-vault",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.7",
|
|
4
4
|
"description": "Encrypted credential vault for DeepSeek Harness: store and retrieve usernames, emails, phone numbers, passwords, TOTP secrets, SSH/API-key/OAuth developer credentials through model tools and a Settings UI page.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|