@burdenoff/microfe-security 2026.1120.2 → 2026.1122.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/dist/generated/global-types.d.ts +5953 -796
- package/dist/generated/wspace-operations.d.ts +315 -3
- package/dist/generated/wspace-operations.js +216 -62
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +74118 -10624
- package/dist/generated/wspace-types.js +3 -1
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/security/components/BulkPickerDialogs.js.map +1 -1
- package/dist/security/components/ImportWizard.js.map +1 -1
- package/dist/security/components/SecretFormFields.js.map +1 -1
- package/dist/security/components/SecretShareDialog.d.ts +6 -0
- package/dist/security/components/SecretShareDialog.js +150 -270
- package/dist/security/components/SecretShareDialog.js.map +1 -1
- package/dist/security/components/SecretShareLinkPanel.d.ts +33 -0
- package/dist/security/components/SecretShareLinkPanel.js +144 -0
- package/dist/security/components/SecretShareLinkPanel.js.map +1 -0
- package/dist/security/components/SecretSharePeoplePanel.d.ts +26 -0
- package/dist/security/components/SecretSharePeoplePanel.js +87 -0
- package/dist/security/components/SecretSharePeoplePanel.js.map +1 -0
- package/dist/security/components/SecurityScoreCard.d.ts +2 -1
- package/dist/security/components/SecurityScoreCard.js +9 -3
- package/dist/security/components/SecurityScoreCard.js.map +1 -1
- package/dist/security/components/VaultFormFields.js.map +1 -1
- package/dist/security/components/VaultShareDialog.js.map +1 -1
- package/dist/security/components/secretShareTypes.d.ts +22 -0
- package/dist/security/components/ui.js.map +1 -1
- package/dist/security/hooks/useSecurityDashboard.d.ts +10 -1
- package/dist/security/hooks/useSecurityDashboard.js +18 -17
- package/dist/security/hooks/useSecurityDashboard.js.map +1 -1
- package/dist/security/hooks/useShareQueries.js +11 -8
- package/dist/security/hooks/useShareQueries.js.map +1 -1
- package/dist/security/pages/AccessReviewPage.js.map +1 -1
- package/dist/security/pages/AuditLogPage.js.map +1 -1
- package/dist/security/pages/ProviderDetailPage.js.map +1 -1
- package/dist/security/pages/ProvidersPage.js.map +1 -1
- package/dist/security/pages/SecretCreatePage.js.map +1 -1
- package/dist/security/pages/SecretDetailPage.js.map +1 -1
- package/dist/security/pages/SecurityDashboardPage.js.map +1 -1
- package/dist/security/pages/SharedWithMePage.js +48 -26
- package/dist/security/pages/SharedWithMePage.js.map +1 -1
- package/dist/security/pages/VaultCreatePage.js.map +1 -1
- package/dist/security/pages/VaultDetailPage.js.map +1 -1
- package/dist/security/pages/VaultSettingsPage.js.map +1 -1
- package/dist/security/pages/VaultShareViewer.js.map +1 -1
- package/dist/security/pages/VaultsDashboardPage.js.map +1 -1
- package/dist/security/routes/SecurityRoutes.js +50 -44
- package/dist/security/routes/SecurityRoutes.js.map +1 -1
- package/dist/security/translations/en.d.ts +5 -0
- package/dist/security/translations/en.js +6 -1
- package/dist/security/translations/en.js.map +1 -1
- package/dist/security/v2/SecurityV2Routes.d.ts +15 -0
- package/dist/security/v2/SecurityV2Routes.js +119 -0
- package/dist/security/v2/SecurityV2Routes.js.map +1 -0
- package/dist/security/v2/components/AuditEntries.d.ts +11 -0
- package/dist/security/v2/components/AuditEntries.js +37 -0
- package/dist/security/v2/components/AuditEntries.js.map +1 -0
- package/dist/security/v2/components/MaskedValue.d.ts +15 -0
- package/dist/security/v2/components/MaskedValue.js +109 -0
- package/dist/security/v2/components/MaskedValue.js.map +1 -0
- package/dist/security/v2/components/auditWords.d.ts +32 -0
- package/dist/security/v2/components/auditWords.js +103 -0
- package/dist/security/v2/components/auditWords.js.map +1 -0
- package/dist/security/v2/components/dates.d.ts +9 -0
- package/dist/security/v2/components/dates.js +37 -0
- package/dist/security/v2/components/dates.js.map +1 -0
- package/dist/security/v2/components/healthWords.d.ts +25 -0
- package/dist/security/v2/components/healthWords.js +76 -0
- package/dist/security/v2/components/healthWords.js.map +1 -0
- package/dist/security/v2/components/pieces.d.ts +33 -0
- package/dist/security/v2/components/pieces.js +49 -0
- package/dist/security/v2/components/pieces.js.map +1 -0
- package/dist/security/v2/components/typeWords.d.ts +7 -0
- package/dist/security/v2/components/typeWords.js +26 -0
- package/dist/security/v2/components/typeWords.js.map +1 -0
- package/dist/security/v2/dialogs/AccessReviewDialog.d.ts +20 -0
- package/dist/security/v2/dialogs/AccessReviewDialog.js +196 -0
- package/dist/security/v2/dialogs/AccessReviewDialog.js.map +1 -0
- package/dist/security/v2/dialogs/ImportExportDialog.d.ts +19 -0
- package/dist/security/v2/dialogs/ImportExportDialog.js +85 -0
- package/dist/security/v2/dialogs/ImportExportDialog.js.map +1 -0
- package/dist/security/v2/dialogs/LockedDialog.d.ts +12 -0
- package/dist/security/v2/dialogs/LockedDialog.js +32 -0
- package/dist/security/v2/dialogs/LockedDialog.js.map +1 -0
- package/dist/security/v2/dialogs/SecurityHealthDialog.d.ts +19 -0
- package/dist/security/v2/dialogs/SecurityHealthDialog.js +151 -0
- package/dist/security/v2/dialogs/SecurityHealthDialog.js.map +1 -0
- package/dist/security/v2/dialogs/import-export/ExportPanel.d.ts +25 -0
- package/dist/security/v2/dialogs/import-export/ExportPanel.js +70 -0
- package/dist/security/v2/dialogs/import-export/ExportPanel.js.map +1 -0
- package/dist/security/v2/dialogs/import-export/ImportPanel.d.ts +26 -0
- package/dist/security/v2/dialogs/import-export/ImportPanel.js +240 -0
- package/dist/security/v2/dialogs/import-export/ImportPanel.js.map +1 -0
- package/dist/security/v2/dialogs/import-export/TransferFooters.d.ts +21 -0
- package/dist/security/v2/dialogs/import-export/TransferFooters.js +51 -0
- package/dist/security/v2/dialogs/import-export/TransferFooters.js.map +1 -0
- package/dist/security/v2/dialogs/import-export/useTransfers.d.ts +23 -0
- package/dist/security/v2/dialogs/import-export/useTransfers.js +69 -0
- package/dist/security/v2/dialogs/import-export/useTransfers.js.map +1 -0
- package/dist/security/v2/dialogs/reviewWords.d.ts +15 -0
- package/dist/security/v2/dialogs/reviewWords.js +48 -0
- package/dist/security/v2/dialogs/reviewWords.js.map +1 -0
- package/dist/security/v2/hooks/useActorNames.d.ts +15 -0
- package/dist/security/v2/hooks/useActorNames.js +40 -0
- package/dist/security/v2/hooks/useActorNames.js.map +1 -0
- package/dist/security/v2/hooks/useAuditEvents.d.ts +23 -0
- package/dist/security/v2/hooks/useAuditEvents.js +28 -0
- package/dist/security/v2/hooks/useAuditEvents.js.map +1 -0
- package/dist/security/v2/hooks/useSavedValuesData.d.ts +85 -0
- package/dist/security/v2/hooks/useSavedValuesData.js +111 -0
- package/dist/security/v2/hooks/useSavedValuesData.js.map +1 -0
- package/dist/security/v2/hooks/useSavedValuesGates.d.ts +24 -0
- package/dist/security/v2/hooks/useSavedValuesGates.js +22 -0
- package/dist/security/v2/hooks/useSavedValuesGates.js.map +1 -0
- package/dist/security/v2/hooks/useSavedValuesNav.d.ts +11 -0
- package/dist/security/v2/hooks/useSavedValuesNav.js +26 -0
- package/dist/security/v2/hooks/useSavedValuesNav.js.map +1 -0
- package/dist/security/v2/hooks/useVaultActions.d.ts +12 -0
- package/dist/security/v2/hooks/useVaultActions.js +81 -0
- package/dist/security/v2/hooks/useVaultActions.js.map +1 -0
- package/dist/security/v2/hooks/useVaultPage.d.ts +86 -0
- package/dist/security/v2/hooks/useVaultPage.js +174 -0
- package/dist/security/v2/hooks/useVaultPage.js.map +1 -0
- package/dist/security/v2/model/access.d.ts +63 -0
- package/dist/security/v2/model/access.js +57 -0
- package/dist/security/v2/model/access.js.map +1 -0
- package/dist/security/v2/model/audit.d.ts +43 -0
- package/dist/security/v2/model/audit.js +113 -0
- package/dist/security/v2/model/audit.js.map +1 -0
- package/dist/security/v2/model/health.d.ts +70 -0
- package/dist/security/v2/model/health.js +118 -0
- package/dist/security/v2/model/health.js.map +1 -0
- package/dist/security/v2/model/params.d.ts +40 -0
- package/dist/security/v2/model/params.js +65 -0
- package/dist/security/v2/model/params.js.map +1 -0
- package/dist/security/v2/model/review.d.ts +99 -0
- package/dist/security/v2/model/review.js +141 -0
- package/dist/security/v2/model/review.js.map +1 -0
- package/dist/security/v2/model/shared.d.ts +40 -0
- package/dist/security/v2/model/shared.js +26 -0
- package/dist/security/v2/model/shared.js.map +1 -0
- package/dist/security/v2/model/time.d.ts +24 -0
- package/dist/security/v2/model/time.js +37 -0
- package/dist/security/v2/model/time.js.map +1 -0
- package/dist/security/v2/model/vaults.d.ts +46 -0
- package/dist/security/v2/model/vaults.js +55 -0
- package/dist/security/v2/model/vaults.js.map +1 -0
- package/dist/security/v2/pages/AuditLogPage.d.ts +6 -0
- package/dist/security/v2/pages/AuditLogPage.js +170 -0
- package/dist/security/v2/pages/AuditLogPage.js.map +1 -0
- package/dist/security/v2/pages/SavedValuesPage.d.ts +5 -0
- package/dist/security/v2/pages/SavedValuesPage.js +98 -0
- package/dist/security/v2/pages/SavedValuesPage.js.map +1 -0
- package/dist/security/v2/pages/VaultPage.d.ts +5 -0
- package/dist/security/v2/pages/VaultPage.js +201 -0
- package/dist/security/v2/pages/VaultPage.js.map +1 -0
- package/dist/security/v2/pages/saved/HealthSummary.d.ts +15 -0
- package/dist/security/v2/pages/saved/HealthSummary.js +44 -0
- package/dist/security/v2/pages/saved/HealthSummary.js.map +1 -0
- package/dist/security/v2/pages/saved/RevealSharedDialog.d.ts +11 -0
- package/dist/security/v2/pages/saved/RevealSharedDialog.js +65 -0
- package/dist/security/v2/pages/saved/RevealSharedDialog.js.map +1 -0
- package/dist/security/v2/pages/saved/SavedValuesDialogs.d.ts +14 -0
- package/dist/security/v2/pages/saved/SavedValuesDialogs.js +55 -0
- package/dist/security/v2/pages/saved/SavedValuesDialogs.js.map +1 -0
- package/dist/security/v2/pages/saved/SharedWithMeTab.d.ts +10 -0
- package/dist/security/v2/pages/saved/SharedWithMeTab.js +178 -0
- package/dist/security/v2/pages/saved/SharedWithMeTab.js.map +1 -0
- package/dist/security/v2/pages/saved/VaultCard.d.ts +17 -0
- package/dist/security/v2/pages/saved/VaultCard.js +91 -0
- package/dist/security/v2/pages/saved/VaultCard.js.map +1 -0
- package/dist/security/v2/pages/saved/VaultsTab.d.ts +23 -0
- package/dist/security/v2/pages/saved/VaultsTab.js +133 -0
- package/dist/security/v2/pages/saved/VaultsTab.js.map +1 -0
- package/dist/security/v2/pages/saved/useSavedValuesPage.d.ts +75 -0
- package/dist/security/v2/pages/saved/useSavedValuesPage.js +80 -0
- package/dist/security/v2/pages/saved/useSavedValuesPage.js.map +1 -0
- package/dist/security/v2/pages/vault/AccessTab.d.ts +48 -0
- package/dist/security/v2/pages/vault/AccessTab.js +162 -0
- package/dist/security/v2/pages/vault/AccessTab.js.map +1 -0
- package/dist/security/v2/pages/vault/ActivityTab.d.ts +15 -0
- package/dist/security/v2/pages/vault/ActivityTab.js +50 -0
- package/dist/security/v2/pages/vault/ActivityTab.js.map +1 -0
- package/dist/security/v2/pages/vault/ValuesTab.d.ts +25 -0
- package/dist/security/v2/pages/vault/ValuesTab.js +187 -0
- package/dist/security/v2/pages/vault/ValuesTab.js.map +1 -0
- package/dist/security/v2/pages/vault/VaultHeader.d.ts +40 -0
- package/dist/security/v2/pages/vault/VaultHeader.js +128 -0
- package/dist/security/v2/pages/vault/VaultHeader.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { WorkspaceIcon } from '@burdenoff/fe-libs/ui';
|
|
2
|
+
import { useTr } from '../../hooks/useTr';
|
|
3
|
+
import { AuditEvent, AuditVerb, AuditWhat } from '../model/audit';
|
|
4
|
+
type Tr = ReturnType<typeof useTr>;
|
|
5
|
+
export interface AuditNames {
|
|
6
|
+
person: (actorId: string | null) => string;
|
|
7
|
+
/** Whether an id is the signed-in person: "gave access to you", not "to You". */
|
|
8
|
+
isMe?: (actorId: string | null) => boolean;
|
|
9
|
+
/** The avatar's name (the person's own name, not "You"); defaults to `person`. */
|
|
10
|
+
avatar?: (actorId: string | null) => string;
|
|
11
|
+
vault: (vaultId: string | null) => string | null;
|
|
12
|
+
value: (valueId: string | null) => string | null;
|
|
13
|
+
}
|
|
14
|
+
/** One audit row as "<actor> <verb> <object>" and the vault it belongs to. */
|
|
15
|
+
export interface AuditSentence {
|
|
16
|
+
actor: string;
|
|
17
|
+
verb: string;
|
|
18
|
+
object: string | null;
|
|
19
|
+
area: string | null;
|
|
20
|
+
}
|
|
21
|
+
export declare function auditWords(tr: Tr): {
|
|
22
|
+
what: (value: AuditWhat) => string;
|
|
23
|
+
verb: (value: AuditVerb) => string;
|
|
24
|
+
sentence: (event: AuditEvent, names: AuditNames) => AuditSentence;
|
|
25
|
+
};
|
|
26
|
+
export declare function useAuditWords(): {
|
|
27
|
+
what: (value: AuditWhat) => string;
|
|
28
|
+
verb: (value: AuditVerb) => string;
|
|
29
|
+
sentence: (event: AuditEvent, names: AuditNames) => AuditSentence;
|
|
30
|
+
};
|
|
31
|
+
export declare function auditIcon(what: AuditWhat): WorkspaceIcon;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { useTr as e } from "../../hooks/useTr.js";
|
|
2
|
+
import { useMemo as t } from "react";
|
|
3
|
+
import { ArrowLeftRight as n, KeyRound as r, Lock as i, Pencil as a, Plus as o, Trash2 as s, UserCheck as c } from "lucide-react";
|
|
4
|
+
// src/security/v2/components/auditWords.ts
|
|
5
|
+
function l(e) {
|
|
6
|
+
let t = (t) => {
|
|
7
|
+
switch (t) {
|
|
8
|
+
case "added": return e("security.v2.audit.what.added", "Added");
|
|
9
|
+
case "changed": return e("security.v2.audit.what.changed", "Changed");
|
|
10
|
+
case "removed": return e("security.v2.audit.what.removed", "Removed");
|
|
11
|
+
case "access": return e("security.v2.audit.what.access", "Access");
|
|
12
|
+
case "transfer": return e("security.v2.audit.what.transfer", "Imports and exports");
|
|
13
|
+
case "lock": return e("security.v2.audit.what.lock", "Locked and unlocked");
|
|
14
|
+
case "other": return e("security.v2.audit.what.other", "Other");
|
|
15
|
+
}
|
|
16
|
+
}, n = (t) => {
|
|
17
|
+
switch (t) {
|
|
18
|
+
case "vault-created": return e("security.v2.audit.verb.vaultCreated", "created the vault");
|
|
19
|
+
case "vault-changed": return e("security.v2.audit.verb.vaultChanged", "changed the vault");
|
|
20
|
+
case "vault-deleted": return e("security.v2.audit.verb.vaultDeleted", "deleted the vault");
|
|
21
|
+
case "vault-archived": return e("security.v2.audit.verb.vaultArchived", "archived the vault");
|
|
22
|
+
case "vault-restored": return e("security.v2.audit.verb.vaultRestored", "restored the vault");
|
|
23
|
+
case "vault-locked": return e("security.v2.audit.verb.vaultLocked", "locked the vault");
|
|
24
|
+
case "vault-unlocked": return e("security.v2.audit.verb.vaultUnlocked", "unlocked the vault");
|
|
25
|
+
case "value-added": return e("security.v2.audit.verb.valueAdded", "added");
|
|
26
|
+
case "value-changed": return e("security.v2.audit.verb.valueChanged", "changed");
|
|
27
|
+
case "value-rotated": return e("security.v2.audit.verb.valueRotated", "replaced the value of");
|
|
28
|
+
case "value-rolled-back": return e("security.v2.audit.verb.valueRolledBack", "restored an earlier version of");
|
|
29
|
+
case "value-deleted": return e("security.v2.audit.verb.valueDeleted", "deleted");
|
|
30
|
+
case "values-imported": return e("security.v2.audit.verb.imported", "imported values into");
|
|
31
|
+
case "values-exported": return e("security.v2.audit.verb.exported", "exported");
|
|
32
|
+
case "backup-made": return e("security.v2.audit.verb.backup", "made an encrypted backup of");
|
|
33
|
+
case "backup-restored": return e("security.v2.audit.verb.restored", "restored a backup into");
|
|
34
|
+
case "access-given": return e("security.v2.audit.verb.accessGiven", "gave access to");
|
|
35
|
+
case "access-removed": return e("security.v2.audit.verb.accessRemoved", "removed access for");
|
|
36
|
+
case "access-changed": return e("security.v2.audit.verb.accessChanged", "changed access for");
|
|
37
|
+
case "outside-vault": return e("security.v2.audit.verb.outside", "changed an outside vault connection");
|
|
38
|
+
case "other": return e("security.v2.audit.verb.other", "made a security change");
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
what: t,
|
|
43
|
+
verb: n,
|
|
44
|
+
sentence: (t, r) => {
|
|
45
|
+
let i = r.vault(t.vaultId), a = e("security.v2.audit.aValue", "a value"), o = null;
|
|
46
|
+
switch (t.verb) {
|
|
47
|
+
case "vault-created":
|
|
48
|
+
case "vault-changed":
|
|
49
|
+
case "vault-deleted":
|
|
50
|
+
case "vault-archived":
|
|
51
|
+
case "vault-restored":
|
|
52
|
+
case "vault-locked":
|
|
53
|
+
case "vault-unlocked":
|
|
54
|
+
case "values-imported":
|
|
55
|
+
case "values-exported":
|
|
56
|
+
case "backup-made":
|
|
57
|
+
case "backup-restored":
|
|
58
|
+
o = t.objectName ?? i ?? e("security.v2.audit.aVault", "a vault");
|
|
59
|
+
break;
|
|
60
|
+
case "value-added":
|
|
61
|
+
case "value-changed":
|
|
62
|
+
case "value-rotated":
|
|
63
|
+
case "value-rolled-back":
|
|
64
|
+
case "value-deleted":
|
|
65
|
+
o = t.objectName ?? r.value(t.entityId) ?? a;
|
|
66
|
+
break;
|
|
67
|
+
case "access-given":
|
|
68
|
+
case "access-removed":
|
|
69
|
+
case "access-changed":
|
|
70
|
+
o = t.targetActorId ? r.isMe?.(t.targetActorId) ? e("security.v2.audit.you", "you") : r.person(t.targetActorId) : e("security.v2.audit.someone", "someone");
|
|
71
|
+
break;
|
|
72
|
+
case "outside-vault":
|
|
73
|
+
case "other": o = null;
|
|
74
|
+
}
|
|
75
|
+
let s = t.verb.startsWith("vault-") || t.verb.startsWith("backup");
|
|
76
|
+
return {
|
|
77
|
+
actor: r.person(t.actorId),
|
|
78
|
+
verb: n(t.verb),
|
|
79
|
+
object: o,
|
|
80
|
+
area: s ? null : i
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function u() {
|
|
86
|
+
let n = e();
|
|
87
|
+
return t(() => l(n), [n]);
|
|
88
|
+
}
|
|
89
|
+
var d = {
|
|
90
|
+
added: o,
|
|
91
|
+
changed: a,
|
|
92
|
+
removed: s,
|
|
93
|
+
access: c,
|
|
94
|
+
transfer: n,
|
|
95
|
+
lock: i,
|
|
96
|
+
other: r
|
|
97
|
+
};
|
|
98
|
+
function f(e) {
|
|
99
|
+
return d[e];
|
|
100
|
+
}
|
|
101
|
+
export { f as auditIcon, l as auditWords, u as useAuditWords };
|
|
102
|
+
|
|
103
|
+
//# sourceMappingURL=auditWords.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auditWords.js","names":["auditWords","what","value","tr","verb","vaultName","names","event","someValue","object","vaultIsObject","useAuditWords","useTr","useMemo","ICON_OF","Plus","Pencil","Trash2","UserCheck","ArrowLeftRight","Lock","KeyRound","auditIcon"],"sources":["../../../../src/security/v2/components/auditWords.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { ArrowLeftRight, KeyRound, Lock, Pencil, Plus, Trash2, UserCheck } from 'lucide-react';\nimport type { WorkspaceIcon } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../../hooks/useTr';\nimport type { AuditEvent, AuditVerb, AuditWhat } from '../model/audit';\n\ntype Tr = ReturnType<typeof useTr>;\n\nexport interface AuditNames {\n person: (actorId: string | null) => string;\n /** Whether an id is the signed-in person: \"gave access to you\", not \"to You\". */\n isMe?: (actorId: string | null) => boolean;\n /** The avatar's name (the person's own name, not \"You\"); defaults to `person`. */\n avatar?: (actorId: string | null) => string;\n vault: (vaultId: string | null) => string | null;\n value: (valueId: string | null) => string | null;\n}\n\n/** One audit row as \"<actor> <verb> <object>\" and the vault it belongs to. */\nexport interface AuditSentence {\n actor: string;\n verb: string;\n object: string | null;\n area: string | null;\n}\n\nexport function auditWords(tr: Tr) {\n const what = (value: AuditWhat): string => {\n switch (value) {\n case 'added':\n return tr('security.v2.audit.what.added', 'Added');\n case 'changed':\n return tr('security.v2.audit.what.changed', 'Changed');\n case 'removed':\n return tr('security.v2.audit.what.removed', 'Removed');\n case 'access':\n return tr('security.v2.audit.what.access', 'Access');\n case 'transfer':\n return tr('security.v2.audit.what.transfer', 'Imports and exports');\n case 'lock':\n return tr('security.v2.audit.what.lock', 'Locked and unlocked');\n case 'other':\n return tr('security.v2.audit.what.other', 'Other');\n }\n };\n\n const verb = (value: AuditVerb): string => {\n switch (value) {\n case 'vault-created':\n return tr('security.v2.audit.verb.vaultCreated', 'created the vault');\n case 'vault-changed':\n return tr('security.v2.audit.verb.vaultChanged', 'changed the vault');\n case 'vault-deleted':\n return tr('security.v2.audit.verb.vaultDeleted', 'deleted the vault');\n case 'vault-archived':\n return tr('security.v2.audit.verb.vaultArchived', 'archived the vault');\n case 'vault-restored':\n return tr('security.v2.audit.verb.vaultRestored', 'restored the vault');\n case 'vault-locked':\n return tr('security.v2.audit.verb.vaultLocked', 'locked the vault');\n case 'vault-unlocked':\n return tr('security.v2.audit.verb.vaultUnlocked', 'unlocked the vault');\n case 'value-added':\n return tr('security.v2.audit.verb.valueAdded', 'added');\n case 'value-changed':\n return tr('security.v2.audit.verb.valueChanged', 'changed');\n case 'value-rotated':\n return tr('security.v2.audit.verb.valueRotated', 'replaced the value of');\n case 'value-rolled-back':\n return tr('security.v2.audit.verb.valueRolledBack', 'restored an earlier version of');\n case 'value-deleted':\n return tr('security.v2.audit.verb.valueDeleted', 'deleted');\n case 'values-imported':\n return tr('security.v2.audit.verb.imported', 'imported values into');\n case 'values-exported':\n return tr('security.v2.audit.verb.exported', 'exported');\n case 'backup-made':\n return tr('security.v2.audit.verb.backup', 'made an encrypted backup of');\n case 'backup-restored':\n return tr('security.v2.audit.verb.restored', 'restored a backup into');\n case 'access-given':\n return tr('security.v2.audit.verb.accessGiven', 'gave access to');\n case 'access-removed':\n return tr('security.v2.audit.verb.accessRemoved', 'removed access for');\n case 'access-changed':\n return tr('security.v2.audit.verb.accessChanged', 'changed access for');\n case 'outside-vault':\n return tr('security.v2.audit.verb.outside', 'changed an outside vault connection');\n case 'other':\n return tr('security.v2.audit.verb.other', 'made a security change');\n }\n };\n\n const sentence = (event: AuditEvent, names: AuditNames): AuditSentence => {\n const vaultName = names.vault(event.vaultId);\n const someValue = tr('security.v2.audit.aValue', 'a value');\n let object: string | null = null;\n switch (event.verb) {\n case 'vault-created':\n case 'vault-changed':\n case 'vault-deleted':\n case 'vault-archived':\n case 'vault-restored':\n case 'vault-locked':\n case 'vault-unlocked':\n case 'values-imported':\n case 'values-exported':\n case 'backup-made':\n case 'backup-restored':\n object = event.objectName ?? vaultName ?? tr('security.v2.audit.aVault', 'a vault');\n break;\n case 'value-added':\n case 'value-changed':\n case 'value-rotated':\n case 'value-rolled-back':\n case 'value-deleted':\n object = event.objectName ?? names.value(event.entityId) ?? someValue;\n break;\n case 'access-given':\n case 'access-removed':\n case 'access-changed':\n object = !event.targetActorId\n ? tr('security.v2.audit.someone', 'someone')\n : names.isMe?.(event.targetActorId)\n ? tr('security.v2.audit.you', 'you')\n : names.person(event.targetActorId);\n break;\n case 'outside-vault':\n case 'other':\n object = null;\n }\n const vaultIsObject = event.verb.startsWith('vault-') || event.verb.startsWith('backup');\n return {\n actor: names.person(event.actorId),\n verb: verb(event.verb),\n object,\n area: vaultIsObject ? null : vaultName,\n };\n };\n\n return { what, verb, sentence };\n}\n\nexport function useAuditWords() {\n const tr = useTr();\n return useMemo(() => auditWords(tr), [tr]);\n}\n\nconst ICON_OF: Readonly<Record<AuditWhat, WorkspaceIcon>> = {\n added: Plus,\n changed: Pencil,\n removed: Trash2,\n access: UserCheck,\n transfer: ArrowLeftRight,\n lock: Lock,\n other: KeyRound,\n};\n\nexport function auditIcon(what: AuditWhat): WorkspaceIcon {\n return ICON_OF[what];\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** "3 days ago", "in 2 weeks", in the app's language. */
|
|
2
|
+
export declare function relativeTime(value: string | null | undefined, now: Date, locale: string): string | null;
|
|
3
|
+
/** "21 Nov 2026", in the app's language. */
|
|
4
|
+
export declare function shortDate(value: string | null | undefined, locale: string): string | null;
|
|
5
|
+
/** Dates in the app's language, relative to one "now" (the page's, fixed when it mounts). */
|
|
6
|
+
export declare function useDates(now: Date): {
|
|
7
|
+
ago: (value: string | null | undefined) => string | null;
|
|
8
|
+
date: (value: string | null | undefined) => string | null;
|
|
9
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { toTime as e } from "../model/time.js";
|
|
2
|
+
import { useMemo as t } from "react";
|
|
3
|
+
import { useI18n as n } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
4
|
+
// src/security/v2/components/dates.ts
|
|
5
|
+
var r = [
|
|
6
|
+
["year", 31536e3],
|
|
7
|
+
["month", 2592e3],
|
|
8
|
+
["week", 604800],
|
|
9
|
+
["day", 86400],
|
|
10
|
+
["hour", 3600],
|
|
11
|
+
["minute", 60]
|
|
12
|
+
];
|
|
13
|
+
function i(t, n, i) {
|
|
14
|
+
let a = e(t);
|
|
15
|
+
if (a === null) return null;
|
|
16
|
+
let o = Math.round((a - n.getTime()) / 1e3), s = new Intl.RelativeTimeFormat(i, { numeric: "auto" });
|
|
17
|
+
for (let [e, t] of r) if (Math.abs(o) >= t) return s.format(Math.trunc(o / t), e);
|
|
18
|
+
return s.format(0, "minute");
|
|
19
|
+
}
|
|
20
|
+
function a(t, n) {
|
|
21
|
+
let r = e(t);
|
|
22
|
+
return r === null ? null : new Intl.DateTimeFormat(n, {
|
|
23
|
+
day: "numeric",
|
|
24
|
+
month: "short",
|
|
25
|
+
year: "numeric"
|
|
26
|
+
}).format(new Date(r));
|
|
27
|
+
}
|
|
28
|
+
function o(e) {
|
|
29
|
+
let { locale: r } = n();
|
|
30
|
+
return t(() => ({
|
|
31
|
+
ago: (t) => i(t, e, r),
|
|
32
|
+
date: (e) => a(e, r)
|
|
33
|
+
}), [e, r]);
|
|
34
|
+
}
|
|
35
|
+
export { i as relativeTime, a as shortDate, o as useDates };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=dates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dates.js","names":["UNITS","relativeTime","time","toTime","value","seconds","now","format","locale","unit","size","shortDate","useDates","useI18n","useMemo"],"sources":["../../../../src/security/v2/components/dates.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { toTime } from '../model/time';\n\n/** Dates in Saved values v2 (BOFF-15820), in the app's language. */\n\nconst UNITS: ReadonlyArray<[Intl.RelativeTimeFormatUnit, number]> = [\n ['year', 365 * 24 * 3600],\n ['month', 30 * 24 * 3600],\n ['week', 7 * 24 * 3600],\n ['day', 24 * 3600],\n ['hour', 3600],\n ['minute', 60],\n];\n\n/** \"3 days ago\", \"in 2 weeks\", in the app's language. */\nexport function relativeTime(\n value: string | null | undefined,\n now: Date,\n locale: string\n): string | null {\n const time = toTime(value);\n if (time === null) return null;\n const seconds = Math.round((time - now.getTime()) / 1000);\n const format = new Intl.RelativeTimeFormat(locale, { numeric: 'auto' });\n for (const [unit, size] of UNITS) {\n if (Math.abs(seconds) >= size) return format.format(Math.trunc(seconds / size), unit);\n }\n return format.format(0, 'minute');\n}\n\n/** \"21 Nov 2026\", in the app's language. */\nexport function shortDate(value: string | null | undefined, locale: string): string | null {\n const time = toTime(value);\n if (time === null) return null;\n return new Intl.DateTimeFormat(locale, {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n }).format(new Date(time));\n}\n\n/** Dates in the app's language, relative to one \"now\" (the page's, fixed when it mounts). */\nexport function useDates(now: Date) {\n const { locale } = useI18n();\n return useMemo(\n () => ({\n ago: (value: string | null | undefined) => relativeTime(value, now, locale),\n date: (value: string | null | undefined) => shortDate(value, locale),\n }),\n [now, locale]\n );\n}\n"],"mappings":";;;;AAMA,IAAMA,IAA8D;CAClE,CAAC,QAAQ,OAAe;CACxB,CAAC,SAAS,MAAc;CACxB,CAAC,QAAQ,MAAa;CACtB,CAAC,OAAO,KAAS;CACjB,CAAC,QAAQ,IAAI;CACb,CAAC,UAAU,EAAE;AACf;AAGA,SAAgBC,EACd,GACA,GACA,GACe;CACf,IAAMC,IAAOC,EAAOC,CAAK;CACzB,IAAIF,MAAS,MAAM,OAAO;CAC1B,IAAMG,IAAU,KAAK,OAAOH,IAAOI,EAAI,QAAQ,KAAK,GAAI,GAClDC,IAAS,IAAI,KAAK,mBAAmBC,GAAQ,EAAE,SAAS,OAAO,CAAC;CACtE,KAAK,IAAM,CAACC,GAAMC,MAASV,GACzB,IAAI,KAAK,IAAIK,CAAO,KAAKK,GAAM,OAAOH,EAAO,OAAO,KAAK,MAAMF,IAAUK,CAAI,GAAGD,CAAI;CAEtF,OAAOF,EAAO,OAAO,GAAG,QAAQ;AAClC;AAGA,SAAgBI,EAAU,GAAkC,GAA+B;CACzF,IAAMT,IAAOC,EAAOC,CAAK;CAEzB,OADIF,MAAS,OAAa,OACnB,IAAI,KAAK,eAAeM,GAAQ;EACrC,KAAK;EACL,OAAO;EACP,MAAM;CACR,CAAC,CAAC,CAAC,OAAO,IAAI,KAAKN,CAAI,CAAC;AAC1B;AAGA,SAAgBU,EAAS,GAAW;CAClC,IAAM,EAAE,cAAWC,EAAQ;CAC3B,OAAOC,SACE;EACL,MAAM,MAAqCb,EAAaG,GAAOE,GAAKE,CAAM;EAC1E,OAAO,MAAqCG,EAAUP,GAAOI,CAAM;CACrE,IACA,CAACF,GAAKE,CAAM,CACd;AACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useTr } from '../../hooks/useTr';
|
|
2
|
+
import { HealthGrade, HealthIssue, HealthReport, PassingCheckId, VaultHealthReason } from '../model/health';
|
|
3
|
+
type Tr = ReturnType<typeof useTr>;
|
|
4
|
+
/** The words of the health card, the Security health dialog and the vault cards' reasons. */
|
|
5
|
+
export declare function healthWords(tr: Tr): {
|
|
6
|
+
grade: (value: HealthGrade) => string;
|
|
7
|
+
issueTitle: (issue: HealthIssue) => string;
|
|
8
|
+
issueDetail: (issue: HealthIssue) => string;
|
|
9
|
+
passing: (id: PassingCheckId) => string;
|
|
10
|
+
title: (report: HealthReport) => string;
|
|
11
|
+
summary: (report: HealthReport) => string;
|
|
12
|
+
scoreLabel: (report: HealthReport) => string;
|
|
13
|
+
vaultReason: (reason: VaultHealthReason) => string;
|
|
14
|
+
};
|
|
15
|
+
export declare function useHealthWords(): {
|
|
16
|
+
grade: (value: HealthGrade) => string;
|
|
17
|
+
issueTitle: (issue: HealthIssue) => string;
|
|
18
|
+
issueDetail: (issue: HealthIssue) => string;
|
|
19
|
+
passing: (id: PassingCheckId) => string;
|
|
20
|
+
title: (report: HealthReport) => string;
|
|
21
|
+
summary: (report: HealthReport) => string;
|
|
22
|
+
scoreLabel: (report: HealthReport) => string;
|
|
23
|
+
vaultReason: (reason: VaultHealthReason) => string;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { useTr as e } from "../../hooks/useTr.js";
|
|
2
|
+
import { useMemo as t } from "react";
|
|
3
|
+
// src/security/v2/components/healthWords.ts
|
|
4
|
+
function n(e, t, n) {
|
|
5
|
+
let r = t.join(", ");
|
|
6
|
+
return n > 0 ? e("security.v2.health.listMore", "{{names}} and {{count}} more", {
|
|
7
|
+
names: r,
|
|
8
|
+
count: n
|
|
9
|
+
}) : r;
|
|
10
|
+
}
|
|
11
|
+
function r(e) {
|
|
12
|
+
let t = (t) => {
|
|
13
|
+
switch (t) {
|
|
14
|
+
case "good": return e("security.v2.health.grade.good", "Good");
|
|
15
|
+
case "fair": return e("security.v2.health.grade.fair", "Fair");
|
|
16
|
+
case "weak": return e("security.v2.health.grade.weak", "Needs work");
|
|
17
|
+
case "poor": return e("security.v2.health.grade.poor", "Poor");
|
|
18
|
+
case "none": return e("security.v2.health.grade.none", "No data yet");
|
|
19
|
+
}
|
|
20
|
+
}, r = (t) => {
|
|
21
|
+
switch (t.id) {
|
|
22
|
+
case "expired": return t.count === 1 ? e("security.v2.health.issue.expired.one", "A value has expired") : e("security.v2.health.issue.expired.many", "{{count}} values have expired", { count: t.count });
|
|
23
|
+
case "stale-year": return t.count === 1 ? e("security.v2.health.issue.staleYear.one", "A value not changed in over a year") : e("security.v2.health.issue.staleYear.many", "{{count}} values not changed in over a year", { count: t.count });
|
|
24
|
+
case "stale": return t.count === 1 ? e("security.v2.health.issue.stale.one", "A value not changed in 180 days") : e("security.v2.health.issue.stale.many", "{{count}} values not changed in 180 days", { count: t.count });
|
|
25
|
+
case "public-links": return t.count === 1 ? e("security.v2.health.issue.links.one", "A share link is open") : e("security.v2.health.issue.links.many", "{{count}} share links are open", { count: t.count });
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
grade: t,
|
|
30
|
+
issueTitle: r,
|
|
31
|
+
issueDetail: (t) => {
|
|
32
|
+
let r = n(e, t.vaultNames.slice(0, 3), t.vaultNames.length - 3);
|
|
33
|
+
switch (t.id) {
|
|
34
|
+
case "expired": return e("security.v2.health.issue.expired.detail", "{{items}} in {{vaults}}. Replace it, or remove it if nothing uses it.", {
|
|
35
|
+
items: n(e, t.itemNames, t.count - t.itemNames.length),
|
|
36
|
+
vaults: r
|
|
37
|
+
});
|
|
38
|
+
case "stale-year":
|
|
39
|
+
case "stale": return e("security.v2.health.issue.stale.detail", "{{items}} in {{vaults}}. Change them where they are issued, then here.", {
|
|
40
|
+
items: n(e, t.itemNames, t.count - t.itemNames.length),
|
|
41
|
+
vaults: r
|
|
42
|
+
});
|
|
43
|
+
case "public-links": return e("security.v2.health.issue.links.detail", "Anyone with the link can open a value in {{vaults}}. Close the ones nobody needs.", { vaults: r });
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
passing: (t) => {
|
|
47
|
+
switch (t) {
|
|
48
|
+
case "encrypted": return e("security.v2.health.pass.encrypted", "Every value is stored encrypted");
|
|
49
|
+
case "none-expired": return e("security.v2.health.pass.noneExpired", "No value has expired");
|
|
50
|
+
case "all-fresh": return e("security.v2.health.pass.allFresh", "Every value changed in the last 180 days");
|
|
51
|
+
case "no-public-links": return e("security.v2.health.pass.noLinks", "No value is shared by an open link");
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
title: (n) => e("security.v2.health.title", "Security health: {{grade}}", { grade: t(n.grade) }),
|
|
55
|
+
summary: (t) => t.score === null ? t.vaultCount === 0 ? e("security.v2.health.noVaults", "Add a vault and its values, and the checks run here.") : e("security.v2.health.noValues", "Add values to your vaults, and the checks run here.") : t.worst ? e("security.v2.health.worst", "{{things}} The worst: {{issue}}.", {
|
|
56
|
+
things: t.issues.length === 1 ? e("security.v2.health.oneThing", "1 thing to fix.") : e("security.v2.health.things", "{{count}} things to fix.", { count: t.issues.length }),
|
|
57
|
+
issue: r(t.worst).toLowerCase()
|
|
58
|
+
}) : e("security.v2.health.allGood", "Nothing to fix in the {{count}} vaults you can open.", { count: t.vaultCount }),
|
|
59
|
+
scoreLabel: (t) => t.score === null ? e("security.v2.health.scoreNone", "Health score: no data yet") : e("security.v2.health.scoreLabel", "Health score {{score}} out of 100", { score: t.score }),
|
|
60
|
+
vaultReason: (t) => {
|
|
61
|
+
switch (t.id) {
|
|
62
|
+
case "expired": return t.count === 1 ? e("security.v2.vaults.reason.expired.one", "1 value has expired") : e("security.v2.vaults.reason.expired.many", "{{count}} values have expired", { count: t.count });
|
|
63
|
+
case "stale-year": return t.count === 1 ? e("security.v2.vaults.reason.staleYear.one", "1 value not changed in over a year") : e("security.v2.vaults.reason.staleYear.many", "{{count}} values not changed in over a year", { count: t.count });
|
|
64
|
+
case "stale": return t.count === 1 ? e("security.v2.vaults.reason.stale.one", "1 value not changed in 180 days") : e("security.v2.vaults.reason.stale.many", "{{count}} values not changed in 180 days", { count: t.count });
|
|
65
|
+
case "public-links": return t.count === 1 ? e("security.v2.vaults.reason.links.one", "Shared by an open link") : e("security.v2.vaults.reason.links.many", "Shared by {{count}} open links", { count: t.count });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function i() {
|
|
71
|
+
let n = e();
|
|
72
|
+
return t(() => r(n), [n]);
|
|
73
|
+
}
|
|
74
|
+
export { r as healthWords, i as useHealthWords };
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=healthWords.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"healthWords.js","names":["list","shown","names","more","tr","healthWords","grade","value","issueTitle","issue","vaults","id","report","reason","useHealthWords","useTr","useMemo"],"sources":["../../../../src/security/v2/components/healthWords.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useTr } from '../../hooks/useTr';\nimport type {\n HealthGrade,\n HealthIssue,\n HealthReport,\n PassingCheckId,\n VaultHealthReason,\n} from '../model/health';\n\ntype Tr = ReturnType<typeof useTr>;\n\nfunction list(tr: Tr, names: readonly string[], more: number): string {\n const shown = names.join(', ');\n return more > 0\n ? tr('security.v2.health.listMore', '{{names}} and {{count}} more', {\n names: shown,\n count: more,\n })\n : shown;\n}\n\n/** The words of the health card, the Security health dialog and the vault cards' reasons. */\nexport function healthWords(tr: Tr) {\n const grade = (value: HealthGrade): string => {\n switch (value) {\n case 'good':\n return tr('security.v2.health.grade.good', 'Good');\n case 'fair':\n return tr('security.v2.health.grade.fair', 'Fair');\n case 'weak':\n return tr('security.v2.health.grade.weak', 'Needs work');\n case 'poor':\n return tr('security.v2.health.grade.poor', 'Poor');\n case 'none':\n return tr('security.v2.health.grade.none', 'No data yet');\n }\n };\n\n const issueTitle = (issue: HealthIssue): string => {\n switch (issue.id) {\n case 'expired':\n return issue.count === 1\n ? tr('security.v2.health.issue.expired.one', 'A value has expired')\n : tr('security.v2.health.issue.expired.many', '{{count}} values have expired', {\n count: issue.count,\n });\n case 'stale-year':\n return issue.count === 1\n ? tr('security.v2.health.issue.staleYear.one', 'A value not changed in over a year')\n : tr(\n 'security.v2.health.issue.staleYear.many',\n '{{count}} values not changed in over a year',\n {\n count: issue.count,\n }\n );\n case 'stale':\n return issue.count === 1\n ? tr('security.v2.health.issue.stale.one', 'A value not changed in 180 days')\n : tr('security.v2.health.issue.stale.many', '{{count}} values not changed in 180 days', {\n count: issue.count,\n });\n case 'public-links':\n return issue.count === 1\n ? tr('security.v2.health.issue.links.one', 'A share link is open')\n : tr('security.v2.health.issue.links.many', '{{count}} share links are open', {\n count: issue.count,\n });\n }\n };\n\n const issueDetail = (issue: HealthIssue): string => {\n const vaults = list(tr, issue.vaultNames.slice(0, 3), issue.vaultNames.length - 3);\n switch (issue.id) {\n case 'expired':\n return tr(\n 'security.v2.health.issue.expired.detail',\n '{{items}} in {{vaults}}. Replace it, or remove it if nothing uses it.',\n {\n items: list(tr, issue.itemNames, issue.count - issue.itemNames.length),\n vaults,\n }\n );\n case 'stale-year':\n case 'stale':\n return tr(\n 'security.v2.health.issue.stale.detail',\n '{{items}} in {{vaults}}. Change them where they are issued, then here.',\n {\n items: list(tr, issue.itemNames, issue.count - issue.itemNames.length),\n vaults,\n }\n );\n case 'public-links':\n return tr(\n 'security.v2.health.issue.links.detail',\n 'Anyone with the link can open a value in {{vaults}}. Close the ones nobody needs.',\n {\n vaults,\n }\n );\n }\n };\n\n const passing = (id: PassingCheckId): string => {\n switch (id) {\n case 'encrypted':\n return tr('security.v2.health.pass.encrypted', 'Every value is stored encrypted');\n case 'none-expired':\n return tr('security.v2.health.pass.noneExpired', 'No value has expired');\n case 'all-fresh':\n return tr('security.v2.health.pass.allFresh', 'Every value changed in the last 180 days');\n case 'no-public-links':\n return tr('security.v2.health.pass.noLinks', 'No value is shared by an open link');\n }\n };\n\n const title = (report: HealthReport): string =>\n tr('security.v2.health.title', 'Security health: {{grade}}', { grade: grade(report.grade) });\n\n const summary = (report: HealthReport): string => {\n if (report.score === null) {\n return report.vaultCount === 0\n ? tr('security.v2.health.noVaults', 'Add a vault and its values, and the checks run here.')\n : tr('security.v2.health.noValues', 'Add values to your vaults, and the checks run here.');\n }\n if (!report.worst) {\n return tr(\n 'security.v2.health.allGood',\n 'Nothing to fix in the {{count}} vaults you can open.',\n {\n count: report.vaultCount,\n }\n );\n }\n const things =\n report.issues.length === 1\n ? tr('security.v2.health.oneThing', '1 thing to fix.')\n : tr('security.v2.health.things', '{{count}} things to fix.', {\n count: report.issues.length,\n });\n return tr('security.v2.health.worst', '{{things}} The worst: {{issue}}.', {\n things,\n issue: issueTitle(report.worst).toLowerCase(),\n });\n };\n\n const scoreLabel = (report: HealthReport): string =>\n report.score === null\n ? tr('security.v2.health.scoreNone', 'Health score: no data yet')\n : tr('security.v2.health.scoreLabel', 'Health score {{score}} out of 100', {\n score: report.score,\n });\n\n const vaultReason = (reason: VaultHealthReason): string => {\n switch (reason.id) {\n case 'expired':\n return reason.count === 1\n ? tr('security.v2.vaults.reason.expired.one', '1 value has expired')\n : tr('security.v2.vaults.reason.expired.many', '{{count}} values have expired', {\n count: reason.count,\n });\n case 'stale-year':\n return reason.count === 1\n ? tr('security.v2.vaults.reason.staleYear.one', '1 value not changed in over a year')\n : tr(\n 'security.v2.vaults.reason.staleYear.many',\n '{{count}} values not changed in over a year',\n {\n count: reason.count,\n }\n );\n case 'stale':\n return reason.count === 1\n ? tr('security.v2.vaults.reason.stale.one', '1 value not changed in 180 days')\n : tr('security.v2.vaults.reason.stale.many', '{{count}} values not changed in 180 days', {\n count: reason.count,\n });\n case 'public-links':\n return reason.count === 1\n ? tr('security.v2.vaults.reason.links.one', 'Shared by an open link')\n : tr('security.v2.vaults.reason.links.many', 'Shared by {{count}} open links', {\n count: reason.count,\n });\n }\n };\n\n return { grade, issueTitle, issueDetail, passing, title, summary, scoreLabel, vaultReason };\n}\n\nexport function useHealthWords() {\n const tr = useTr();\n return useMemo(() => healthWords(tr), [tr]);\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { TabbedDialogSize, TabbedDialogWidth } from '@burdenoff/fe-libs/ui';
|
|
3
|
+
type IconType = ComponentType<{
|
|
4
|
+
className?: string;
|
|
5
|
+
'aria-hidden'?: boolean | 'true';
|
|
6
|
+
}>;
|
|
7
|
+
/** A decorative tile with one icon, the size of a card's or a row's picture. */
|
|
8
|
+
export declare function Tile({ icon: Icon, size }: {
|
|
9
|
+
icon: IconType;
|
|
10
|
+
size?: 'sm' | 'md';
|
|
11
|
+
}): import('react').JSX.Element;
|
|
12
|
+
export interface DialogShellProps {
|
|
13
|
+
open: boolean;
|
|
14
|
+
onOpenChange: (open: boolean) => void;
|
|
15
|
+
title: string;
|
|
16
|
+
/** One line under the title (also the dialog's description for screen readers). */
|
|
17
|
+
description: string;
|
|
18
|
+
icon: IconType;
|
|
19
|
+
width?: TabbedDialogWidth;
|
|
20
|
+
size?: TabbedDialogSize;
|
|
21
|
+
/** A `TabbedDialogTabs` for a tabbed dialog; otherwise `children` is the one scrolling panel. */
|
|
22
|
+
tabs?: ReactNode;
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
footer?: ReactNode;
|
|
25
|
+
/** While working: Escape, the backdrop and × do not close it. */
|
|
26
|
+
busy?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* One Saved values dialog on the stable tabbed-dialog frame: fixed height, the header and footer
|
|
30
|
+
* pinned, one scroller, a bottom sheet on phones.
|
|
31
|
+
*/
|
|
32
|
+
export declare function DialogShell({ open, onOpenChange, title, description, icon, width, size, tabs, children, footer, busy, }: DialogShellProps): import('react').JSX.Element;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useCallback as e } from "react";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import { IconTile as r, TabbedDialog as i, TabbedDialogContent as a, TabbedDialogFooter as o, TabbedDialogHeader as s } from "@burdenoff/fe-libs/ui";
|
|
4
|
+
// src/security/v2/components/pieces.tsx
|
|
5
|
+
function c({ icon: e, size: n = "md" }) {
|
|
6
|
+
return /* @__PURE__ */ t(r, {
|
|
7
|
+
size: n,
|
|
8
|
+
"aria-hidden": "true",
|
|
9
|
+
children: /* @__PURE__ */ t(e, {
|
|
10
|
+
className: n === "sm" ? "size-3.5" : "size-4",
|
|
11
|
+
"aria-hidden": "true"
|
|
12
|
+
})
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
var l = "[data-slot=\"sv2-dialog-body\"] input:not([disabled]):not([type=\"hidden\"]):not([type=\"file\"]), [data-slot=\"tabbed-dialog-tabs\"] [role=\"tab\"][data-state=\"active\"]";
|
|
16
|
+
function u({ open: r, onOpenChange: u, title: d, description: f, icon: p, width: m = "medium", size: h = "form", tabs: g, children: _, footer: v, busy: y = !1 }) {
|
|
17
|
+
let b = e((e) => {
|
|
18
|
+
let t = (e.currentTarget instanceof HTMLElement ? e.currentTarget : null)?.querySelector(l);
|
|
19
|
+
t && (e.preventDefault(), t.focus({ preventScroll: !0 }));
|
|
20
|
+
}, []);
|
|
21
|
+
return /* @__PURE__ */ t(i, {
|
|
22
|
+
open: r,
|
|
23
|
+
onOpenChange: (e) => {
|
|
24
|
+
(!y || e) && u(e);
|
|
25
|
+
},
|
|
26
|
+
children: /* @__PURE__ */ n(a, {
|
|
27
|
+
width: m,
|
|
28
|
+
size: h,
|
|
29
|
+
presentation: "sheet",
|
|
30
|
+
onOpenAutoFocus: b,
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ t(s, {
|
|
33
|
+
title: d,
|
|
34
|
+
description: f,
|
|
35
|
+
icon: /* @__PURE__ */ t(c, { icon: p })
|
|
36
|
+
}),
|
|
37
|
+
g ?? /* @__PURE__ */ t("div", {
|
|
38
|
+
"data-slot": "sv2-dialog-body",
|
|
39
|
+
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain p-5 max-md:p-4",
|
|
40
|
+
children: _
|
|
41
|
+
}),
|
|
42
|
+
v ? /* @__PURE__ */ t(o, { children: v }) : null
|
|
43
|
+
]
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export { u as DialogShell, c as Tile };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=pieces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pieces.js","names":["Tile","Icon","IconTile","size","INITIAL_FOCUS","DialogShell","focusStart","useCallback","first","event","TabbedDialog","busy","next","onOpenChange","TabbedDialogContent","TabbedDialogHeader","tabs","footer","TabbedDialogFooter"],"sources":["../../../../src/security/v2/components/pieces.tsx"],"sourcesContent":["/**\n * Compositions of fe-libs parts that Saved values v2 uses in several places (BOFF-15820). Nothing\n * here is a new kind of control: the dialog is fe-libs' stable tabbed dialog (BOFF-15607), the\n * tile is `IconTile`, the chips are `StatusChip`.\n */\nimport { useCallback, type ComponentType, type ReactNode } from 'react';\nimport {\n IconTile,\n TabbedDialog,\n TabbedDialogContent,\n TabbedDialogFooter,\n TabbedDialogHeader,\n type TabbedDialogSize,\n type TabbedDialogWidth,\n} from '@burdenoff/fe-libs/ui';\n\ntype IconType = ComponentType<{ className?: string; 'aria-hidden'?: boolean | 'true' }>;\n\n/** A decorative tile with one icon, the size of a card's or a row's picture. */\nexport function Tile({ icon: Icon, size = 'md' }: { icon: IconType; size?: 'sm' | 'md' }) {\n return (\n <IconTile size={size} aria-hidden=\"true\">\n <Icon className={size === 'sm' ? 'size-3.5' : 'size-4'} aria-hidden=\"true\" />\n </IconTile>\n );\n}\n\nexport interface DialogShellProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title: string;\n /** One line under the title (also the dialog's description for screen readers). */\n description: string;\n icon: IconType;\n width?: TabbedDialogWidth;\n size?: TabbedDialogSize;\n /** A `TabbedDialogTabs` for a tabbed dialog; otherwise `children` is the one scrolling panel. */\n tabs?: ReactNode;\n children?: ReactNode;\n footer?: ReactNode;\n /** While working: Escape, the backdrop and × do not close it. */\n busy?: boolean;\n}\n\n/** Where a dialog's focus starts: its first field, else the open tab. */\nconst INITIAL_FOCUS = [\n '[data-slot=\"sv2-dialog-body\"] input:not([disabled]):not([type=\"hidden\"]):not([type=\"file\"])',\n '[data-slot=\"tabbed-dialog-tabs\"] [role=\"tab\"][data-state=\"active\"]',\n].join(', ');\n\n/**\n * One Saved values dialog on the stable tabbed-dialog frame: fixed height, the header and footer\n * pinned, one scroller, a bottom sheet on phones.\n */\nexport function DialogShell({\n open,\n onOpenChange,\n title,\n description,\n icon,\n width = 'medium',\n size = 'form',\n tabs,\n children,\n footer,\n busy = false,\n}: DialogShellProps) {\n const focusStart = useCallback((event: Event) => {\n const box = event.currentTarget instanceof HTMLElement ? event.currentTarget : null;\n const first = box?.querySelector<HTMLElement>(INITIAL_FOCUS);\n if (!first) return;\n event.preventDefault();\n first.focus({ preventScroll: true });\n }, []);\n return (\n <TabbedDialog\n open={open}\n onOpenChange={(next) => {\n if (!busy || next) onOpenChange(next);\n }}\n >\n <TabbedDialogContent\n width={width}\n size={size}\n presentation=\"sheet\"\n onOpenAutoFocus={focusStart}\n >\n <TabbedDialogHeader title={title} description={description} icon={<Tile icon={icon} />} />\n {tabs ?? (\n <div\n data-slot=\"sv2-dialog-body\"\n className=\"min-h-0 flex-1 overflow-y-auto overscroll-contain p-5 max-md:p-4\"\n >\n {children}\n </div>\n )}\n {footer ? <TabbedDialogFooter>{footer}</TabbedDialogFooter> : null}\n </TabbedDialogContent>\n </TabbedDialog>\n );\n}\n"],"mappings":";;;;AAmBA,SAAgBA,EAAK,EAAE,MAAMC,GAAM,UAAO,QAAgD;CACxF,OACE,kBAACC,GAAD;EAAgB;EAAM,eAAY;EAChC,UAAA,kBAACD,GAAD;GAAM,WAAWE,MAAS,OAAO,aAAa;GAAU,eAAY;EAAQ,CAAA;CACpE,CAAA;AAEd;AAoBA,IAAMC,IAAgB;AAStB,SAAgBC,EAAY,EAC1B,SACA,iBACA,UACA,gBACA,SACA,WAAQ,UACR,UAAO,QACP,SACA,aACA,WACA,UAAO,MACY;CACnB,IAAMC,IAAaC,GAAa,MAAiB;EAE/C,IAAMC,KADMC,EAAM,yBAAyB,cAAcA,EAAM,gBAAgB,KAAA,EAC5D,cAA2BL,CAAa;EAC3D,AAAKI,MACLC,EAAM,eAAe,GACrBD,EAAM,MAAM,EAAE,eAAe,GAAK,CAAC;CACrC,GAAG,CAAC,CAAC;CACL,OACE,kBAACE,GAAD;EACQ;EACN,eAAe,MAAS;GACtB,CAAI,CAACC,KAAQC,MAAMC,EAAaD,CAAI;EACtC;EAEA,UAAA,kBAACE,GAAD;GACS;GACD;GACN,cAAa;GACb,iBAAiBR;GAJnB,UAAA;IAME,kBAACS,GAAD;KAA2B;KAAoB;KAAa,MAAM,kBAACf,GAAD,EAAY,QAAO,CAAA;IAAI,CAAA;IACxFgB,KACC,kBAAC,OAAD;KACE,aAAU;KACV,WAAU;KAET;IACE,CAAA;IAENC,IAAS,kBAACC,GAAD,EAAA,UAAqBD,EAA2B,CAAA,IAAI;GAC3C;;CACT,CAAA;AAElB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useTr } from '../../hooks/useTr';
|
|
2
|
+
type Tr = ReturnType<typeof useTr>;
|
|
3
|
+
/** The service's value types (SecretType). */
|
|
4
|
+
export declare const VALUE_TYPES: readonly ["API_KEY", "TOKEN", "CREDENTIAL", "CERTIFICATE", "PRIVATE_KEY", "TEXT", "STRUCTURED_DATA", "FILE"];
|
|
5
|
+
/** A value's type in plain words: "API key", "Password". */
|
|
6
|
+
export declare function typeWord(tr: Tr, type: string): string;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/security/v2/components/typeWords.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"API_KEY",
|
|
4
|
+
"TOKEN",
|
|
5
|
+
"CREDENTIAL",
|
|
6
|
+
"CERTIFICATE",
|
|
7
|
+
"PRIVATE_KEY",
|
|
8
|
+
"TEXT",
|
|
9
|
+
"STRUCTURED_DATA",
|
|
10
|
+
"FILE"
|
|
11
|
+
];
|
|
12
|
+
function t(e, t) {
|
|
13
|
+
switch (t) {
|
|
14
|
+
case "API_KEY": return e("security.v2.type.apiKey", "API key");
|
|
15
|
+
case "TOKEN": return e("security.v2.type.token", "Token");
|
|
16
|
+
case "CREDENTIAL": return e("security.v2.type.credential", "Password");
|
|
17
|
+
case "CERTIFICATE": return e("security.v2.type.certificate", "Certificate");
|
|
18
|
+
case "PRIVATE_KEY": return e("security.v2.type.privateKey", "Private key");
|
|
19
|
+
case "STRUCTURED_DATA": return e("security.v2.type.structured", "Structured data");
|
|
20
|
+
case "FILE": return e("security.v2.type.file", "File");
|
|
21
|
+
default: return e("security.v2.type.text", "Text");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export { e as VALUE_TYPES, t as typeWord };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=typeWords.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeWords.js","names":["VALUE_TYPES","typeWord","type","tr"],"sources":["../../../../src/security/v2/components/typeWords.ts"],"sourcesContent":["import { useTr } from '../../hooks/useTr';\n\ntype Tr = ReturnType<typeof useTr>;\n\n/** The service's value types (SecretType). */\nexport const VALUE_TYPES = [\n 'API_KEY',\n 'TOKEN',\n 'CREDENTIAL',\n 'CERTIFICATE',\n 'PRIVATE_KEY',\n 'TEXT',\n 'STRUCTURED_DATA',\n 'FILE',\n] as const;\n\n/** A value's type in plain words: \"API key\", \"Password\". */\nexport function typeWord(tr: Tr, type: string): string {\n switch (type) {\n case 'API_KEY':\n return tr('security.v2.type.apiKey', 'API key');\n case 'TOKEN':\n return tr('security.v2.type.token', 'Token');\n case 'CREDENTIAL':\n return tr('security.v2.type.credential', 'Password');\n case 'CERTIFICATE':\n return tr('security.v2.type.certificate', 'Certificate');\n case 'PRIVATE_KEY':\n return tr('security.v2.type.privateKey', 'Private key');\n case 'STRUCTURED_DATA':\n return tr('security.v2.type.structured', 'Structured data');\n case 'FILE':\n return tr('security.v2.type.file', 'File');\n default:\n return tr('security.v2.type.text', 'Text');\n }\n}\n"],"mappings":";AAKA,IAAaA,IAAc;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,SAAgBC,EAAS,GAAQ,GAAsB;CACrD,QAAQC,GAAR;EACE,KAAK,WACH,OAAOC,EAAG,2BAA2B,SAAS;EAChD,KAAK,SACH,OAAOA,EAAG,0BAA0B,OAAO;EAC7C,KAAK,cACH,OAAOA,EAAG,+BAA+B,UAAU;EACrD,KAAK,eACH,OAAOA,EAAG,gCAAgC,aAAa;EACzD,KAAK,eACH,OAAOA,EAAG,+BAA+B,aAAa;EACxD,KAAK,mBACH,OAAOA,EAAG,+BAA+B,iBAAiB;EAC5D,KAAK,QACH,OAAOA,EAAG,yBAAyB,MAAM;EAC3C,SACE,OAAOA,EAAG,yBAAyB,MAAM;CAC7C;AACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReviewRow } from '../model/review';
|
|
2
|
+
import { ActorNames } from '../hooks/useActorNames';
|
|
3
|
+
export interface AccessReviewDialogProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onOpenChange: (open: boolean) => void;
|
|
6
|
+
rows: readonly ReviewRow[];
|
|
7
|
+
loading: boolean;
|
|
8
|
+
error: unknown;
|
|
9
|
+
/** Some vaults' shares are not known: their shared people are missing. */
|
|
10
|
+
incomplete: boolean;
|
|
11
|
+
names: ActorNames;
|
|
12
|
+
ago: (value: string | null) => string | null;
|
|
13
|
+
/** After removals: reload the vaults and their shares. */
|
|
14
|
+
onChanged: () => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Access review (BOFF-15820; was the Access Review page): who can still use each vault, a Keep or
|
|
18
|
+
* Remove per row, progress, and Finish, which asks through the shared confirm and then removes.
|
|
19
|
+
*/
|
|
20
|
+
export declare function AccessReviewDialog({ open, onOpenChange, rows, loading, error, incomplete, names, ago, onChanged, }: AccessReviewDialogProps): import('react').JSX.Element;
|