@burdenoff/microfe-security 2026.510.115

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.
Files changed (299) hide show
  1. package/README.md +223 -0
  2. package/dist/dev/main.d.ts +2 -0
  3. package/dist/dev/main.d.ts.map +1 -0
  4. package/dist/generated/global-operations.d.ts +2 -0
  5. package/dist/generated/global-operations.d.ts.map +1 -0
  6. package/dist/generated/global-types.d.ts +21069 -0
  7. package/dist/generated/global-types.d.ts.map +1 -0
  8. package/dist/generated/wspace-operations.d.ts +1461 -0
  9. package/dist/generated/wspace-operations.d.ts.map +1 -0
  10. package/dist/generated/wspace-operations.js +695 -0
  11. package/dist/generated/wspace-operations.js.map +1 -0
  12. package/dist/generated/wspace-types.d.ts +55148 -0
  13. package/dist/generated/wspace-types.d.ts.map +1 -0
  14. package/dist/generated/wspace-types.js +8 -0
  15. package/dist/generated/wspace-types.js.map +1 -0
  16. package/dist/index.d.ts +6 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +7 -0
  19. package/dist/node_modules/clsx/dist/clsx.js +18 -0
  20. package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
  21. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +1674 -0
  22. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  23. package/dist/security/SecurityAdminRoot.d.ts +19 -0
  24. package/dist/security/SecurityAdminRoot.d.ts.map +1 -0
  25. package/dist/security/SecurityAdminRoot.js +14 -0
  26. package/dist/security/SecurityAdminRoot.js.map +1 -0
  27. package/dist/security/SecurityRoot.d.ts +18 -0
  28. package/dist/security/SecurityRoot.d.ts.map +1 -0
  29. package/dist/security/SecurityRoot.js +14 -0
  30. package/dist/security/SecurityRoot.js.map +1 -0
  31. package/dist/security/SecurityRootBase.d.ts +19 -0
  32. package/dist/security/SecurityRootBase.d.ts.map +1 -0
  33. package/dist/security/SecurityRootBase.js +56 -0
  34. package/dist/security/SecurityRootBase.js.map +1 -0
  35. package/dist/security/SecurityUserRoot.d.ts +18 -0
  36. package/dist/security/SecurityUserRoot.d.ts.map +1 -0
  37. package/dist/security/SecurityUserRoot.js +14 -0
  38. package/dist/security/SecurityUserRoot.js.map +1 -0
  39. package/dist/security/components/ActivityTimeline.d.ts +12 -0
  40. package/dist/security/components/ActivityTimeline.d.ts.map +1 -0
  41. package/dist/security/components/ActivityTimeline.js +109 -0
  42. package/dist/security/components/ActivityTimeline.js.map +1 -0
  43. package/dist/security/components/AuditLogTable.d.ts +12 -0
  44. package/dist/security/components/AuditLogTable.d.ts.map +1 -0
  45. package/dist/security/components/BulkActionBar.d.ts +9 -0
  46. package/dist/security/components/BulkActionBar.d.ts.map +1 -0
  47. package/dist/security/components/BulkActionBar.js +94 -0
  48. package/dist/security/components/BulkActionBar.js.map +1 -0
  49. package/dist/security/components/ConfirmDialog.d.ts +19 -0
  50. package/dist/security/components/ConfirmDialog.d.ts.map +1 -0
  51. package/dist/security/components/ConfirmDialog.js +45 -0
  52. package/dist/security/components/ConfirmDialog.js.map +1 -0
  53. package/dist/security/components/CopyButton.d.ts +20 -0
  54. package/dist/security/components/CopyButton.d.ts.map +1 -0
  55. package/dist/security/components/CopyButton.js +48 -0
  56. package/dist/security/components/CopyButton.js.map +1 -0
  57. package/dist/security/components/ExportDialog.d.ts +7 -0
  58. package/dist/security/components/ExportDialog.d.ts.map +1 -0
  59. package/dist/security/components/ExportDialog.js +146 -0
  60. package/dist/security/components/ExportDialog.js.map +1 -0
  61. package/dist/security/components/ImportWizard.d.ts +7 -0
  62. package/dist/security/components/ImportWizard.d.ts.map +1 -0
  63. package/dist/security/components/ImportWizard.js +276 -0
  64. package/dist/security/components/ImportWizard.js.map +1 -0
  65. package/dist/security/components/PageLayout.d.ts +23 -0
  66. package/dist/security/components/PageLayout.d.ts.map +1 -0
  67. package/dist/security/components/PageLayout.js +26 -0
  68. package/dist/security/components/PageLayout.js.map +1 -0
  69. package/dist/security/components/PasswordGenerator.d.ts +17 -0
  70. package/dist/security/components/PasswordGenerator.d.ts.map +1 -0
  71. package/dist/security/components/PasswordGenerator.js +128 -0
  72. package/dist/security/components/PasswordGenerator.js.map +1 -0
  73. package/dist/security/components/ProviderSetupWizard.d.ts +13 -0
  74. package/dist/security/components/ProviderSetupWizard.d.ts.map +1 -0
  75. package/dist/security/components/RotationStatusBadge.d.ts +13 -0
  76. package/dist/security/components/RotationStatusBadge.d.ts.map +1 -0
  77. package/dist/security/components/RotationStatusBadge.js +32 -0
  78. package/dist/security/components/RotationStatusBadge.js.map +1 -0
  79. package/dist/security/components/SecretFormFields.d.ts +23 -0
  80. package/dist/security/components/SecretFormFields.d.ts.map +1 -0
  81. package/dist/security/components/SecretFormFields.js +156 -0
  82. package/dist/security/components/SecretFormFields.js.map +1 -0
  83. package/dist/security/components/SecretRow.d.ts +13 -0
  84. package/dist/security/components/SecretRow.d.ts.map +1 -0
  85. package/dist/security/components/SecretRow.js +88 -0
  86. package/dist/security/components/SecretRow.js.map +1 -0
  87. package/dist/security/components/SecretTypeBadge.d.ts +13 -0
  88. package/dist/security/components/SecretTypeBadge.d.ts.map +1 -0
  89. package/dist/security/components/SecretTypeBadge.js +19 -0
  90. package/dist/security/components/SecretTypeBadge.js.map +1 -0
  91. package/dist/security/components/SecretTypeIcon.d.ts +14 -0
  92. package/dist/security/components/SecretTypeIcon.d.ts.map +1 -0
  93. package/dist/security/components/SecretTypeIcon.js +28 -0
  94. package/dist/security/components/SecretTypeIcon.js.map +1 -0
  95. package/dist/security/components/SecretValueDisplay.d.ts +26 -0
  96. package/dist/security/components/SecretValueDisplay.d.ts.map +1 -0
  97. package/dist/security/components/SecretValueDisplay.js +66 -0
  98. package/dist/security/components/SecretValueDisplay.js.map +1 -0
  99. package/dist/security/components/SecurityPermissionGuard.d.ts +16 -0
  100. package/dist/security/components/SecurityPermissionGuard.d.ts.map +1 -0
  101. package/dist/security/components/SecurityPermissionGuard.js +21 -0
  102. package/dist/security/components/SecurityPermissionGuard.js.map +1 -0
  103. package/dist/security/components/SecurityScoreCard.d.ts +12 -0
  104. package/dist/security/components/SecurityScoreCard.d.ts.map +1 -0
  105. package/dist/security/components/SecurityScoreCard.js +82 -0
  106. package/dist/security/components/SecurityScoreCard.js.map +1 -0
  107. package/dist/security/components/VaultCard.d.ts +13 -0
  108. package/dist/security/components/VaultCard.d.ts.map +1 -0
  109. package/dist/security/components/VaultCard.js +94 -0
  110. package/dist/security/components/VaultCard.js.map +1 -0
  111. package/dist/security/components/VaultFormFields.d.ts +17 -0
  112. package/dist/security/components/VaultFormFields.d.ts.map +1 -0
  113. package/dist/security/components/VaultFormFields.js +110 -0
  114. package/dist/security/components/VaultFormFields.js.map +1 -0
  115. package/dist/security/components/VaultShareDialog.d.ts +16 -0
  116. package/dist/security/components/VaultShareDialog.d.ts.map +1 -0
  117. package/dist/security/components/VaultShareDialog.js +84 -0
  118. package/dist/security/components/VaultShareDialog.js.map +1 -0
  119. package/dist/security/components/ui.d.ts +55 -0
  120. package/dist/security/components/ui.d.ts.map +1 -0
  121. package/dist/security/components/ui.js +87 -0
  122. package/dist/security/components/ui.js.map +1 -0
  123. package/dist/security/config/navigation.d.ts +10 -0
  124. package/dist/security/config/navigation.d.ts.map +1 -0
  125. package/dist/security/config/navigation.js +97 -0
  126. package/dist/security/config/navigation.js.map +1 -0
  127. package/dist/security/constants/featureFlags.d.ts +36 -0
  128. package/dist/security/constants/featureFlags.d.ts.map +1 -0
  129. package/dist/security/constants/featureFlags.js +18 -0
  130. package/dist/security/constants/featureFlags.js.map +1 -0
  131. package/dist/security/constants/permissions.d.ts +11 -0
  132. package/dist/security/constants/permissions.d.ts.map +1 -0
  133. package/dist/security/constants/permissions.js +72 -0
  134. package/dist/security/constants/permissions.js.map +1 -0
  135. package/dist/security/constants/providers.d.ts +12 -0
  136. package/dist/security/constants/providers.d.ts.map +1 -0
  137. package/dist/security/constants/providers.js +45 -0
  138. package/dist/security/constants/providers.js.map +1 -0
  139. package/dist/security/constants/secretTypes.d.ts +16 -0
  140. package/dist/security/constants/secretTypes.d.ts.map +1 -0
  141. package/dist/security/constants/secretTypes.js +66 -0
  142. package/dist/security/constants/secretTypes.js.map +1 -0
  143. package/dist/security/hooks/useAuditLog.d.ts +4 -0
  144. package/dist/security/hooks/useAuditLog.d.ts.map +1 -0
  145. package/dist/security/hooks/useAuditLog.js +20 -0
  146. package/dist/security/hooks/useAuditLog.js.map +1 -0
  147. package/dist/security/hooks/useBulkSecretOperations.d.ts +7 -0
  148. package/dist/security/hooks/useBulkSecretOperations.d.ts.map +1 -0
  149. package/dist/security/hooks/useBulkSecretOperations.js +22 -0
  150. package/dist/security/hooks/useBulkSecretOperations.js.map +1 -0
  151. package/dist/security/hooks/useClipboardAutoClear.d.ts +10 -0
  152. package/dist/security/hooks/useClipboardAutoClear.d.ts.map +1 -0
  153. package/dist/security/hooks/useImportExport.d.ts +55 -0
  154. package/dist/security/hooks/useImportExport.d.ts.map +1 -0
  155. package/dist/security/hooks/useImportExport.js +201 -0
  156. package/dist/security/hooks/useImportExport.js.map +1 -0
  157. package/dist/security/hooks/usePasswordGenerator.d.ts +18 -0
  158. package/dist/security/hooks/usePasswordGenerator.d.ts.map +1 -0
  159. package/dist/security/hooks/useProviderQueries.d.ts +8 -0
  160. package/dist/security/hooks/useProviderQueries.d.ts.map +1 -0
  161. package/dist/security/hooks/useProviderQueries.js +30 -0
  162. package/dist/security/hooks/useProviderQueries.js.map +1 -0
  163. package/dist/security/hooks/useSecretQueries.d.ts +10 -0
  164. package/dist/security/hooks/useSecretQueries.d.ts.map +1 -0
  165. package/dist/security/hooks/useSecretQueries.js +36 -0
  166. package/dist/security/hooks/useSecretQueries.js.map +1 -0
  167. package/dist/security/hooks/useSecretValue.d.ts +12 -0
  168. package/dist/security/hooks/useSecretValue.d.ts.map +1 -0
  169. package/dist/security/hooks/useSecretValue.js +29 -0
  170. package/dist/security/hooks/useSecretValue.js.map +1 -0
  171. package/dist/security/hooks/useSecurityCacheInvalidation.d.ts +2 -0
  172. package/dist/security/hooks/useSecurityCacheInvalidation.d.ts.map +1 -0
  173. package/dist/security/hooks/useSecurityCacheInvalidation.js +52 -0
  174. package/dist/security/hooks/useSecurityCacheInvalidation.js.map +1 -0
  175. package/dist/security/hooks/useSecurityDashboard.d.ts +21 -0
  176. package/dist/security/hooks/useSecurityDashboard.d.ts.map +1 -0
  177. package/dist/security/hooks/useSecurityDashboard.js +34 -0
  178. package/dist/security/hooks/useSecurityDashboard.js.map +1 -0
  179. package/dist/security/hooks/useSecurityEventEmitter.d.ts +14 -0
  180. package/dist/security/hooks/useSecurityEventEmitter.d.ts.map +1 -0
  181. package/dist/security/hooks/useSecurityEventEmitter.js +14 -0
  182. package/dist/security/hooks/useSecurityEventEmitter.js.map +1 -0
  183. package/dist/security/hooks/useSecuritySubscriptions.d.ts +21 -0
  184. package/dist/security/hooks/useSecuritySubscriptions.d.ts.map +1 -0
  185. package/dist/security/hooks/useSecuritySubscriptions.js +44 -0
  186. package/dist/security/hooks/useSecuritySubscriptions.js.map +1 -0
  187. package/dist/security/hooks/useVaultQueries.d.ts +14 -0
  188. package/dist/security/hooks/useVaultQueries.d.ts.map +1 -0
  189. package/dist/security/hooks/useVaultQueries.js +57 -0
  190. package/dist/security/hooks/useVaultQueries.js.map +1 -0
  191. package/dist/security/index.d.ts +31 -0
  192. package/dist/security/index.d.ts.map +1 -0
  193. package/dist/security/index.js +5 -0
  194. package/dist/security/pages/AccessReviewPage.d.ts +2 -0
  195. package/dist/security/pages/AccessReviewPage.d.ts.map +1 -0
  196. package/dist/security/pages/AccessReviewPage.js +154 -0
  197. package/dist/security/pages/AccessReviewPage.js.map +1 -0
  198. package/dist/security/pages/AuditLogPage.d.ts +2 -0
  199. package/dist/security/pages/AuditLogPage.d.ts.map +1 -0
  200. package/dist/security/pages/AuditLogPage.js +186 -0
  201. package/dist/security/pages/AuditLogPage.js.map +1 -0
  202. package/dist/security/pages/ImportExportPage.d.ts +2 -0
  203. package/dist/security/pages/ImportExportPage.d.ts.map +1 -0
  204. package/dist/security/pages/ImportExportPage.js +47 -0
  205. package/dist/security/pages/ImportExportPage.js.map +1 -0
  206. package/dist/security/pages/ProviderDetailPage.d.ts +2 -0
  207. package/dist/security/pages/ProviderDetailPage.d.ts.map +1 -0
  208. package/dist/security/pages/ProviderDetailPage.js +314 -0
  209. package/dist/security/pages/ProviderDetailPage.js.map +1 -0
  210. package/dist/security/pages/ProvidersPage.d.ts +2 -0
  211. package/dist/security/pages/ProvidersPage.d.ts.map +1 -0
  212. package/dist/security/pages/ProvidersPage.js +162 -0
  213. package/dist/security/pages/ProvidersPage.js.map +1 -0
  214. package/dist/security/pages/SecretCreatePage.d.ts +2 -0
  215. package/dist/security/pages/SecretCreatePage.d.ts.map +1 -0
  216. package/dist/security/pages/SecretCreatePage.js +144 -0
  217. package/dist/security/pages/SecretCreatePage.js.map +1 -0
  218. package/dist/security/pages/SecretDetailPage.d.ts +2 -0
  219. package/dist/security/pages/SecretDetailPage.d.ts.map +1 -0
  220. package/dist/security/pages/SecretDetailPage.js +479 -0
  221. package/dist/security/pages/SecretDetailPage.js.map +1 -0
  222. package/dist/security/pages/SecurityDashboardPage.d.ts +2 -0
  223. package/dist/security/pages/SecurityDashboardPage.d.ts.map +1 -0
  224. package/dist/security/pages/SecurityDashboardPage.js +145 -0
  225. package/dist/security/pages/SecurityDashboardPage.js.map +1 -0
  226. package/dist/security/pages/VaultCreatePage.d.ts +2 -0
  227. package/dist/security/pages/VaultCreatePage.d.ts.map +1 -0
  228. package/dist/security/pages/VaultCreatePage.js +87 -0
  229. package/dist/security/pages/VaultCreatePage.js.map +1 -0
  230. package/dist/security/pages/VaultDetailPage.d.ts +2 -0
  231. package/dist/security/pages/VaultDetailPage.d.ts.map +1 -0
  232. package/dist/security/pages/VaultDetailPage.js +292 -0
  233. package/dist/security/pages/VaultDetailPage.js.map +1 -0
  234. package/dist/security/pages/VaultLandingPage.d.ts +10 -0
  235. package/dist/security/pages/VaultLandingPage.d.ts.map +1 -0
  236. package/dist/security/pages/VaultLandingPage.js +81 -0
  237. package/dist/security/pages/VaultLandingPage.js.map +1 -0
  238. package/dist/security/pages/VaultSettingsPage.d.ts +2 -0
  239. package/dist/security/pages/VaultSettingsPage.d.ts.map +1 -0
  240. package/dist/security/pages/VaultSettingsPage.js +366 -0
  241. package/dist/security/pages/VaultSettingsPage.js.map +1 -0
  242. package/dist/security/pages/VaultsDashboardPage.d.ts +2 -0
  243. package/dist/security/pages/VaultsDashboardPage.d.ts.map +1 -0
  244. package/dist/security/pages/VaultsDashboardPage.js +280 -0
  245. package/dist/security/pages/VaultsDashboardPage.js.map +1 -0
  246. package/dist/security/providers/SecurityProvider.d.ts +13 -0
  247. package/dist/security/providers/SecurityProvider.d.ts.map +1 -0
  248. package/dist/security/providers/SecurityProvider.js +103 -0
  249. package/dist/security/providers/SecurityProvider.js.map +1 -0
  250. package/dist/security/routes/SecurityAdminRoutes.d.ts +7 -0
  251. package/dist/security/routes/SecurityAdminRoutes.d.ts.map +1 -0
  252. package/dist/security/routes/SecurityAdminRoutes.js +91 -0
  253. package/dist/security/routes/SecurityAdminRoutes.js.map +1 -0
  254. package/dist/security/routes/SecurityRoutes.d.ts +19 -0
  255. package/dist/security/routes/SecurityRoutes.d.ts.map +1 -0
  256. package/dist/security/routes/SecurityRoutes.js +91 -0
  257. package/dist/security/routes/SecurityRoutes.js.map +1 -0
  258. package/dist/security/routes/SecurityUserRoutes.d.ts +11 -0
  259. package/dist/security/routes/SecurityUserRoutes.d.ts.map +1 -0
  260. package/dist/security/routes/SecurityUserRoutes.js +53 -0
  261. package/dist/security/routes/SecurityUserRoutes.js.map +1 -0
  262. package/dist/security/routes/routeUtils.d.ts +28 -0
  263. package/dist/security/routes/routeUtils.d.ts.map +1 -0
  264. package/dist/security/routes/routeUtils.js +60 -0
  265. package/dist/security/routes/routeUtils.js.map +1 -0
  266. package/dist/security/store/securityStore.d.ts +35 -0
  267. package/dist/security/store/securityStore.d.ts.map +1 -0
  268. package/dist/security/store/securityStore.js +62 -0
  269. package/dist/security/store/securityStore.js.map +1 -0
  270. package/dist/security/types/index.d.ts +283 -0
  271. package/dist/security/types/index.d.ts.map +1 -0
  272. package/dist/security/utils/clipboard.d.ts +20 -0
  273. package/dist/security/utils/clipboard.d.ts.map +1 -0
  274. package/dist/security/utils/clipboard.js +23 -0
  275. package/dist/security/utils/clipboard.js.map +1 -0
  276. package/dist/security/utils/cn.d.ts +7 -0
  277. package/dist/security/utils/cn.d.ts.map +1 -0
  278. package/dist/security/utils/cn.js +10 -0
  279. package/dist/security/utils/cn.js.map +1 -0
  280. package/dist/security/utils/fileParser.d.ts +18 -0
  281. package/dist/security/utils/fileParser.d.ts.map +1 -0
  282. package/dist/security/utils/fileParser.js +108 -0
  283. package/dist/security/utils/fileParser.js.map +1 -0
  284. package/dist/security/utils/i18n.d.ts +5 -0
  285. package/dist/security/utils/i18n.d.ts.map +1 -0
  286. package/dist/security/utils/i18n.js +9 -0
  287. package/dist/security/utils/i18n.js.map +1 -0
  288. package/dist/security/utils/importParsers.d.ts +30 -0
  289. package/dist/security/utils/importParsers.d.ts.map +1 -0
  290. package/dist/security/utils/mappers.d.ts +35 -0
  291. package/dist/security/utils/mappers.d.ts.map +1 -0
  292. package/dist/security/utils/passwordGenerator.d.ts +22 -0
  293. package/dist/security/utils/passwordGenerator.d.ts.map +1 -0
  294. package/dist/security/utils/passwordGenerator.js +61 -0
  295. package/dist/security/utils/passwordGenerator.js.map +1 -0
  296. package/dist/utils/nativeBridge.d.ts +3 -0
  297. package/dist/utils/nativeBridge.d.ts.map +1 -0
  298. package/dist/utils/nativeBridge.js +2 -0
  299. package/package.json +106 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBulkSecretOperations.js","names":[],"sources":["../../../src/security/hooks/useBulkSecretOperations.ts"],"sourcesContent":["import {\n useBulkDeleteSecretsMutation,\n useBulkMoveSecretsMutation,\n useBulkLabelSecretsMutation,\n} from '../../generated/wspace-operations';\n\nexport function useBulkSecretOperations() {\n const [bulkDeleteMutation, { loading: deleteLoading }] = useBulkDeleteSecretsMutation({\n refetchQueries: ['GetSecrets'],\n });\n\n const [bulkMoveMutation, { loading: moveLoading }] = useBulkMoveSecretsMutation({\n refetchQueries: ['GetSecrets'],\n });\n\n const [bulkLabelMutation, { loading: labelLoading }] = useBulkLabelSecretsMutation({\n refetchQueries: ['GetSecrets'],\n });\n\n const bulkDeleteSecrets = async (ids: string[]) => {\n return bulkDeleteMutation({ variables: { ids } });\n };\n\n const bulkMoveSecrets = async (ids: string[], targetVaultId: string) => {\n return bulkMoveMutation({ variables: { ids, targetVaultId } });\n };\n\n const bulkLabelSecrets = async (ids: string[], label: string, color?: string) => {\n return bulkLabelMutation({ variables: { ids, label, color } });\n };\n\n return {\n bulkDeleteSecrets,\n bulkMoveSecrets,\n bulkLabelSecrets,\n loading: deleteLoading || moveLoading || labelLoading,\n };\n}\n"],"mappings":";;AAMA,SAAgB,IAA0B;CACxC,IAAM,CAAC,GAAoB,EAAE,SAAS,OAAmB,EAA6B,EACpF,gBAAgB,CAAC,aAAa,EAC/B,CAAC,EAEI,CAAC,GAAkB,EAAE,SAAS,OAAiB,EAA2B,EAC9E,gBAAgB,CAAC,aAAa,EAC/B,CAAC,EAEI,CAAC,GAAmB,EAAE,SAAS,OAAkB,EAA4B,EACjF,gBAAgB,CAAC,aAAa,EAC/B,CAAC;AAcF,QAAO;EACL,mBAbwB,OAAO,MACxB,EAAmB,EAAE,WAAW,EAAE,QAAK,EAAE,CAAC;EAajD,iBAVsB,OAAO,GAAe,MACrC,EAAiB,EAAE,WAAW;GAAE;GAAK;GAAe,EAAE,CAAC;EAU9D,kBAPuB,OAAO,GAAe,GAAe,MACrD,EAAkB,EAAE,WAAW;GAAE;GAAK;GAAO;GAAO,EAAE,CAAC;EAO9D,SAAS,KAAiB,KAAe;EAC1C"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Hook that copies a value to the clipboard and auto-clears after a timeout.
3
+ * Returns the copy handler, copied state, and remaining countdown.
4
+ */
5
+ export declare function useClipboardAutoClear(): {
6
+ copy: (text: string) => Promise<void>;
7
+ isCopied: boolean;
8
+ countdown: number;
9
+ };
10
+ //# sourceMappingURL=useClipboardAutoClear.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useClipboardAutoClear.d.ts","sourceRoot":"","sources":["../../../src/security/hooks/useClipboardAutoClear.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,qBAAqB;iBAuBpB,MAAM;;;EAqCtB"}
@@ -0,0 +1,55 @@
1
+ import { ParsedSecret } from '../utils/fileParser';
2
+
3
+ /**
4
+ * Wizard state machine for plain/backup imports.
5
+ *
6
+ * `status` is the single source of truth for what the wizard should
7
+ * render. Five terminal states are distinguished so consumers can light
8
+ * up the right affordance without inspecting `results`:
9
+ *
10
+ * - `completed` — at least one row was created, with no row-level
11
+ * errors. Green success banner.
12
+ * - `partial` — at least one row was created AND at least one row
13
+ * errored. Yellow / amber "imported some but not all" banner.
14
+ * `error` carries a one-line summary; per-row detail is in
15
+ * `results.errors`.
16
+ * - `skipped` — zero imported, all rows were duplicates and skipped
17
+ * (no row-level errors). Neutral "nothing to import" banner.
18
+ * `error` carries a count message.
19
+ * - `error` — zero imported AND every row errored, OR the
20
+ * mutation itself threw. Red failure banner. `error` carries a
21
+ * one-line summary including the first row error message.
22
+ */
23
+ export interface ImportState {
24
+ file: File | null;
25
+ fileName: string | null;
26
+ parsedSecrets: ParsedSecret[];
27
+ encodedBackup: string | null;
28
+ sourceType: 'plain' | 'backup' | null;
29
+ error: string | null;
30
+ status: 'idle' | 'parsing' | 'ready' | 'importing' | 'completed' | 'partial' | 'skipped' | 'error';
31
+ results?: {
32
+ imported: number;
33
+ skipped: number;
34
+ errors: string[];
35
+ };
36
+ }
37
+ export interface BackupExportResult {
38
+ fileId: string;
39
+ fileName: string;
40
+ downloadUrl: string;
41
+ count: number;
42
+ format: string;
43
+ passwordDelivered: boolean;
44
+ deliveryStatus: string;
45
+ }
46
+ export declare function useImportExport(): {
47
+ importState: ImportState;
48
+ importing: boolean;
49
+ exporting: boolean;
50
+ handleFileSelect: (file: File) => Promise<void>;
51
+ executeImport: (vaultId: string, backupPassword?: string) => Promise<void>;
52
+ resetImport: () => void;
53
+ createBackup: (vaultId: string, selectedSecretIds?: string[]) => Promise<BackupExportResult>;
54
+ };
55
+ //# sourceMappingURL=useImportExport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useImportExport.d.ts","sourceRoot":"","sources":["../../../src/security/hooks/useImportExport.ts"],"names":[],"mappings":"AAQA,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AA4GzE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC;IACtC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EACF,MAAM,GACN,SAAS,GACT,OAAO,GACP,WAAW,GACX,WAAW,GACX,SAAS,GACT,SAAS,GACT,OAAO,CAAC;IACZ,OAAO,CAAC,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;CACxB;AAYD,wBAAgB,eAAe;;;;6BAgCqB,IAAI;6BA2CpC,MAAM,mBAAmB,MAAM;;4BAsL/B,MAAM,sBAAsB,MAAM,EAAE,KAAG,OAAO,CAAC,kBAAkB,CAAC;EAmCrF"}
@@ -0,0 +1,201 @@
1
+ import { GetSecretsDocument as e, useBulkCreateSecretsMutation as t } from "../../generated/wspace-operations.js";
2
+ import { SecretType as n } from "../../generated/wspace-types.js";
3
+ import { parseImportFile as r } from "../utils/fileParser.js";
4
+ import { useCallback as i, useState as a } from "react";
5
+ import { gql as o } from "@apollo/client";
6
+ import { useMutation as s } from "@apollo/client/react";
7
+ //#region src/security/hooks/useImportExport.ts
8
+ var c = 140;
9
+ function l(e) {
10
+ let t = e.trim();
11
+ if (t.length <= c) return t;
12
+ let n = [...t];
13
+ return n.length <= c ? t : `${n.slice(0, c - 1).join("")}…`;
14
+ }
15
+ var u = [e], d = new Map(Object.values(n).map((e) => [e.toUpperCase(), e]));
16
+ function f(e) {
17
+ if (!e) return n.Text;
18
+ let t = e.trim().toUpperCase();
19
+ return d.get(t) ?? n.Text;
20
+ }
21
+ function p(e) {
22
+ let t = /* @__PURE__ */ new Set();
23
+ for (let n of e) {
24
+ let e = n.type?.trim();
25
+ e && (d.has(e.toUpperCase()) || t.add(e));
26
+ }
27
+ t.size !== 0 && console.warn(`[useImportExport] Unrecognized secret types — falling back to TEXT: ${[...t].join(", ")}. Valid values: ${[...d.keys()].join(", ")}`);
28
+ }
29
+ var m = o`
30
+ mutation CreateVaultBackup($input: CreateVaultBackupInput!) {
31
+ createVaultBackup(input: $input) {
32
+ fileId
33
+ fileName
34
+ downloadUrl
35
+ count
36
+ format
37
+ passwordDelivered
38
+ deliveryStatus
39
+ }
40
+ }
41
+ `, h = o`
42
+ mutation RestoreVaultBackup($input: RestoreVaultBackupInput!) {
43
+ restoreVaultBackup(input: $input) {
44
+ imported
45
+ skipped
46
+ errors
47
+ }
48
+ }
49
+ `;
50
+ function g(e, t) {
51
+ let n = document.createElement("a");
52
+ n.href = e, n.download = t, n.rel = "noopener", document.body.appendChild(n), n.click(), document.body.removeChild(n);
53
+ }
54
+ function _() {
55
+ let [e, n] = a({
56
+ file: null,
57
+ fileName: null,
58
+ parsedSecrets: [],
59
+ encodedBackup: null,
60
+ sourceType: null,
61
+ error: null,
62
+ status: "idle"
63
+ }), [o, { loading: c }] = t({ refetchQueries: u }), [d, { loading: _ }] = s(h, { refetchQueries: u }), [v, { loading: y }] = s(m), b = i(async (e) => {
64
+ n((t) => ({
65
+ ...t,
66
+ status: "parsing",
67
+ file: e,
68
+ fileName: e.name,
69
+ error: null,
70
+ results: void 0
71
+ }));
72
+ try {
73
+ let t = await r(e);
74
+ if (t.kind === "backup") {
75
+ n((e) => ({
76
+ ...e,
77
+ status: "ready",
78
+ sourceType: "backup",
79
+ encodedBackup: t.encodedBackup,
80
+ parsedSecrets: []
81
+ }));
82
+ return;
83
+ }
84
+ n((e) => ({
85
+ ...e,
86
+ status: "ready",
87
+ sourceType: "plain",
88
+ parsedSecrets: t.secrets,
89
+ encodedBackup: null
90
+ }));
91
+ } catch (e) {
92
+ n((t) => ({
93
+ ...t,
94
+ status: "error",
95
+ sourceType: null,
96
+ encodedBackup: null,
97
+ parsedSecrets: [],
98
+ error: e instanceof Error ? e.message : "Failed to parse file"
99
+ }));
100
+ }
101
+ }, []), x = i(async (t, r) => {
102
+ if (t) {
103
+ n((e) => ({
104
+ ...e,
105
+ status: "importing",
106
+ error: null
107
+ }));
108
+ try {
109
+ if (e.sourceType === "backup") {
110
+ if (!e.encodedBackup) throw Error("No backup payload is available for restore");
111
+ if (!r?.trim()) throw Error("Backup password is required to restore the archive");
112
+ let { data: i } = await d({ variables: { input: {
113
+ vaultId: t,
114
+ data: e.encodedBackup,
115
+ password: r,
116
+ overwriteExisting: !1
117
+ } } }), a = i?.restoreVaultBackup;
118
+ if (!a) throw Error("Restore completed without a response");
119
+ n((e) => ({
120
+ ...e,
121
+ status: "completed",
122
+ results: a
123
+ }));
124
+ return;
125
+ }
126
+ if (!e.parsedSecrets.length) throw Error("No secrets available for import");
127
+ p(e.parsedSecrets);
128
+ let { data: i } = await o({ variables: { input: {
129
+ vaultId: t,
130
+ secrets: e.parsedSecrets.map((e) => ({
131
+ name: e.name,
132
+ key: e.key,
133
+ value: e.value,
134
+ type: f(e.type),
135
+ description: e.description
136
+ }))
137
+ } } }), a = i?.bulkCreateSecrets;
138
+ if (!a) throw Error("Bulk import completed without a response");
139
+ let s = a.errors[0] ? l(a.errors[0]) : "", c = a.imported > 0, u = a.errors.length > 0, m = a.skipped > 0, h = "completed", g = null;
140
+ if (!c && u) h = "error", g = `Import failed: ${a.errors.length} secret${a.errors.length === 1 ? "" : "s"} could not be created — ${s}`;
141
+ else if (c && u) {
142
+ h = "partial";
143
+ let t = e.parsedSecrets.length;
144
+ g = `Imported ${a.imported} of ${t} secrets — ${a.errors.length} failed${m ? `, ${a.skipped} skipped` : ""}. First error: ${s}`;
145
+ } else !c && m ? (h = "skipped", g = `Nothing imported: ${a.skipped} duplicate secret${a.skipped === 1 ? "" : "s"} skipped`) : !c && !u && !m && (h = "skipped", g = "Nothing was imported — the server returned an empty result.");
146
+ let _ = !c && !u && !m;
147
+ n((e) => ({
148
+ ...e,
149
+ status: h,
150
+ results: _ ? void 0 : a,
151
+ error: g
152
+ }));
153
+ } catch (e) {
154
+ n((t) => ({
155
+ ...t,
156
+ status: "error",
157
+ error: e instanceof Error ? e.message : "Import failed"
158
+ }));
159
+ }
160
+ }
161
+ }, [
162
+ o,
163
+ e.encodedBackup,
164
+ e.parsedSecrets,
165
+ e.sourceType,
166
+ d
167
+ ]), S = i(() => {
168
+ n({
169
+ file: null,
170
+ fileName: null,
171
+ parsedSecrets: [],
172
+ encodedBackup: null,
173
+ sourceType: null,
174
+ error: null,
175
+ status: "idle",
176
+ results: void 0
177
+ });
178
+ }, []), C = i(async (e, t) => {
179
+ let { data: n, error: r } = await v({ variables: { input: {
180
+ vaultId: e,
181
+ secretIds: t && t.length > 0 ? t : void 0
182
+ } } });
183
+ if (r) throw r;
184
+ let i = n?.createVaultBackup;
185
+ if (!i) throw Error("Backup completed without a response");
186
+ return g(i.downloadUrl, i.fileName), i;
187
+ }, [v]);
188
+ return {
189
+ importState: e,
190
+ importing: c || _,
191
+ exporting: y,
192
+ handleFileSelect: b,
193
+ executeImport: x,
194
+ resetImport: S,
195
+ createBackup: C
196
+ };
197
+ }
198
+ //#endregion
199
+ export { _ as useImportExport };
200
+
201
+ //# sourceMappingURL=useImportExport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useImportExport.js","names":[],"sources":["../../../src/security/hooks/useImportExport.ts"],"sourcesContent":["import { useState, useCallback } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation } from '@apollo/client/react';\nimport {\n GetSecretsDocument,\n useBulkCreateSecretsMutation,\n} from '../../generated/wspace-operations';\nimport { SecretType } from '../../generated/wspace-types';\nimport { parseImportFile, type ParsedSecret } from '../utils/fileParser';\n\n/** Maximum length for the truncated server error string we display in the wizard banner. */\nconst MAX_BANNER_ERROR_LENGTH = 140;\n\n/**\n * Truncate raw server error strings before they are interpolated into\n * the wizard's banner. The gateway is supposed to normalise its errors\n * but a raw Prisma message (\"Unique constraint failed on field `key`\")\n * would otherwise leak schema details into the UI. The full text is\n * still available on `results.errors` for the per-row error list.\n *\n * Iterates over Unicode code points via the spread iterator (not the\n * UTF-16 code units that `String.prototype.slice` uses) so a truncation\n * boundary cannot land in the middle of a surrogate pair and produce a\n * mangled emoji or Asian-script character.\n */\nfunction summarizeError(raw: string): string {\n const trimmed = raw.trim();\n if (trimmed.length <= MAX_BANNER_ERROR_LENGTH) return trimmed;\n const codepoints = [...trimmed];\n if (codepoints.length <= MAX_BANNER_ERROR_LENGTH) return trimmed;\n return `${codepoints.slice(0, MAX_BANNER_ERROR_LENGTH - 1).join('')}…`;\n}\n\nconst REFETCH_VAULT_SECRETS = [GetSecretsDocument];\n\n/**\n * Lookup table from \"uppercased enum value\" to the canonical SecretType\n * enum entry, derived directly from codegen output. Using a Map keyed by\n * the uppercased value makes this robust regardless of whether the\n * codegen emits values in SCREAMING_SNAKE_CASE (current) or in some\n * other casing in the future. A future enum addition will surface here\n * as a type error rather than as a runtime \"invalid enum value\" rejection\n * from the gateway.\n *\n * Anything we cannot map falls back to TEXT, matching\n * `fileParser.normalizeSecret`'s default for blank columns. Unknown\n * inputs also emit a `console.warn` in non-production builds so a\n * typo in a CSV `type` column (e.g. \"CERTIFCATE\") doesn't silently\n * import the row as TEXT.\n */\nconst SECRET_TYPE_BY_UPPER: ReadonlyMap<string, SecretType> = new Map(\n Object.values(SecretType).map((value) => [value.toUpperCase(), value])\n);\n\nfunction coerceSecretType(input: string | undefined): SecretType {\n if (!input) return SecretType.Text;\n const normalized = input.trim().toUpperCase();\n return SECRET_TYPE_BY_UPPER.get(normalized) ?? SecretType.Text;\n}\n\n/**\n * Walk the parsed-secrets list and emit a single `console.warn`\n * summarising every unrecognised `type` value before the bulk\n * mutation runs, instead of `coerceSecretType` itself logging once\n * per row. This:\n * - de-duplicates noisy retry warnings if the user re-runs\n * `executeImport` against the same parsed file (e.g. after a\n * transient network error)\n * - prevents a typo'd row from silently importing as TEXT without\n * any signal in the browser console\n *\n * Uses one log line containing the full set of bad type values so a\n * 100-row CSV with 50 different typos doesn't spam the console with\n * 50 separate warnings.\n */\nfunction logUnknownSecretTypesOnce(secrets: ReadonlyArray<{ type?: string }>): void {\n const unknown = new Set<string>();\n for (const s of secrets) {\n const raw = s.type?.trim();\n if (!raw) continue;\n if (!SECRET_TYPE_BY_UPPER.has(raw.toUpperCase())) {\n unknown.add(raw);\n }\n }\n if (unknown.size === 0) return;\n // eslint-disable-next-line no-console\n console.warn(\n `[useImportExport] Unrecognized secret types — falling back to TEXT: ` +\n `${[...unknown].join(', ')}. Valid values: ${[...SECRET_TYPE_BY_UPPER.keys()].join(', ')}`\n );\n}\n\nconst CREATE_VAULT_BACKUP_MUTATION = gql`\n mutation CreateVaultBackup($input: CreateVaultBackupInput!) {\n createVaultBackup(input: $input) {\n fileId\n fileName\n downloadUrl\n count\n format\n passwordDelivered\n deliveryStatus\n }\n }\n`;\n\nconst RESTORE_VAULT_BACKUP_MUTATION = gql`\n mutation RestoreVaultBackup($input: RestoreVaultBackupInput!) {\n restoreVaultBackup(input: $input) {\n imported\n skipped\n errors\n }\n }\n`;\n\n/**\n * Wizard state machine for plain/backup imports.\n *\n * `status` is the single source of truth for what the wizard should\n * render. Five terminal states are distinguished so consumers can light\n * up the right affordance without inspecting `results`:\n *\n * - `completed` — at least one row was created, with no row-level\n * errors. Green success banner.\n * - `partial` — at least one row was created AND at least one row\n * errored. Yellow / amber \"imported some but not all\" banner.\n * `error` carries a one-line summary; per-row detail is in\n * `results.errors`.\n * - `skipped` — zero imported, all rows were duplicates and skipped\n * (no row-level errors). Neutral \"nothing to import\" banner.\n * `error` carries a count message.\n * - `error` — zero imported AND every row errored, OR the\n * mutation itself threw. Red failure banner. `error` carries a\n * one-line summary including the first row error message.\n */\nexport interface ImportState {\n file: File | null;\n fileName: string | null;\n parsedSecrets: ParsedSecret[];\n encodedBackup: string | null;\n sourceType: 'plain' | 'backup' | null;\n error: string | null;\n status:\n | 'idle'\n | 'parsing'\n | 'ready'\n | 'importing'\n | 'completed'\n | 'partial'\n | 'skipped'\n | 'error';\n results?: {\n imported: number;\n skipped: number;\n errors: string[];\n };\n}\n\nexport interface BackupExportResult {\n fileId: string;\n fileName: string;\n downloadUrl: string;\n count: number;\n format: string;\n passwordDelivered: boolean;\n deliveryStatus: string;\n}\n\nfunction triggerDownload(url: string, fileName: string): void {\n const link = document.createElement('a');\n link.href = url;\n link.download = fileName;\n link.rel = 'noopener';\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n}\n\nexport function useImportExport() {\n const [importState, setImportState] = useState<ImportState>({\n file: null,\n fileName: null,\n parsedSecrets: [],\n encodedBackup: null,\n sourceType: null,\n error: null,\n status: 'idle',\n });\n\n const [bulkCreateMutation, { loading: bulkImporting }] = useBulkCreateSecretsMutation({\n // Refetch the vault's secret list so the detail page shows the freshly\n // imported rows. We deliberately do NOT pass `awaitRefetchQueries: true`\n // here so the success banner appears as soon as the mutation resolves;\n // the cache update happens in the background. The old per-row\n // `useCreateSecret` helper had the same property — it issued a refetch\n // per call but did not block the mutation promise on it.\n refetchQueries: REFETCH_VAULT_SECRETS,\n });\n const [restoreBackupMutation, { loading: restoringBackup }] = useMutation<{\n restoreVaultBackup: { imported: number; skipped: number; errors: string[] };\n }>(RESTORE_VAULT_BACKUP_MUTATION, {\n // Same parity as the bulk-import path: refetch GetSecrets so the\n // vault detail page picks up the restored rows. Background refetch —\n // see the bulkCreateMutation comment for why we don't await it.\n refetchQueries: REFETCH_VAULT_SECRETS,\n });\n const [createBackupMutation, { loading: creatingBackup }] = useMutation<{\n createVaultBackup: BackupExportResult;\n }>(CREATE_VAULT_BACKUP_MUTATION);\n\n const handleFileSelect = useCallback(async (file: File) => {\n setImportState((previous) => ({\n ...previous,\n status: 'parsing',\n file,\n fileName: file.name,\n error: null,\n results: undefined,\n }));\n\n try {\n const parsed = await parseImportFile(file);\n if (parsed.kind === 'backup') {\n setImportState((previous) => ({\n ...previous,\n status: 'ready',\n sourceType: 'backup',\n encodedBackup: parsed.encodedBackup,\n parsedSecrets: [],\n }));\n return;\n }\n\n setImportState((previous) => ({\n ...previous,\n status: 'ready',\n sourceType: 'plain',\n parsedSecrets: parsed.secrets,\n encodedBackup: null,\n }));\n } catch (error) {\n setImportState((previous) => ({\n ...previous,\n status: 'error',\n sourceType: null,\n encodedBackup: null,\n parsedSecrets: [],\n error: error instanceof Error ? error.message : 'Failed to parse file',\n }));\n }\n }, []);\n\n const executeImport = useCallback(\n async (vaultId: string, backupPassword?: string) => {\n if (!vaultId) return;\n\n setImportState((previous) => ({ ...previous, status: 'importing', error: null }));\n\n try {\n if (importState.sourceType === 'backup') {\n if (!importState.encodedBackup) {\n throw new Error('No backup payload is available for restore');\n }\n if (!backupPassword?.trim()) {\n throw new Error('Backup password is required to restore the archive');\n }\n\n const { data } = await restoreBackupMutation({\n variables: {\n input: {\n vaultId,\n data: importState.encodedBackup,\n password: backupPassword,\n overwriteExisting: false,\n },\n },\n });\n\n const result = data?.restoreVaultBackup;\n if (!result) {\n throw new Error('Restore completed without a response');\n }\n\n setImportState((previous) => ({\n ...previous,\n status: 'completed',\n results: result,\n }));\n return;\n }\n\n if (!importState.parsedSecrets.length) {\n throw new Error('No secrets available for import');\n }\n\n // Surface any unrecognized `type` columns once, before the\n // mutation runs, so a typo doesn't silently import the row as\n // TEXT without any signal in the browser console.\n logUnknownSecretTypesOnce(importState.parsedSecrets);\n\n // Plain CSV/JSON upload: hand off to the bulkCreateSecrets mutation\n // so the server batches encryption + version rows in one round-trip\n // and reports per-secret errors. The previous per-secret loop here\n // multiplied gateway calls by N and lost partial-failure detail.\n //\n // overwriteExisting is intentionally not set — the server defaults\n // to false (skip duplicates), and the `skipped` count in the\n // result drives the wizard's `'skipped'` / `'partial'` states.\n // If a future \"overwrite duplicates\" toggle is added to the UI,\n // forward it through here.\n const { data } = await bulkCreateMutation({\n variables: {\n input: {\n vaultId,\n secrets: importState.parsedSecrets.map((s) => ({\n name: s.name,\n key: s.key,\n value: s.value,\n type: coerceSecretType(s.type),\n description: s.description,\n })),\n },\n },\n });\n\n const bulkResult = data?.bulkCreateSecrets;\n if (!bulkResult) {\n throw new Error('Bulk import completed without a response');\n }\n\n const firstError = bulkResult.errors[0] ? summarizeError(bulkResult.errors[0]) : '';\n\n // Resolve the four terminal `status` values from the server's\n // (imported, skipped, errors) tuple. Each branch is mutually\n // exclusive and the resolved status, paired with the `error`\n // string, is the unambiguous signal the wizard renders against.\n const hasImports = bulkResult.imported > 0;\n const hasErrors = bulkResult.errors.length > 0;\n const hasSkips = bulkResult.skipped > 0;\n\n let nextStatus: ImportState['status'] = 'completed';\n let nextError: string | null = null;\n\n if (!hasImports && hasErrors) {\n nextStatus = 'error';\n nextError = `Import failed: ${bulkResult.errors.length} secret${\n bulkResult.errors.length === 1 ? '' : 's'\n } could not be created — ${firstError}`;\n } else if (hasImports && hasErrors) {\n nextStatus = 'partial';\n // Use the row count the user actually uploaded as the denominator\n // — server-side math (imported + errors + skipped) would\n // disagree with the wizard's preview if the gateway dedupes or\n // truncates rows.\n const totalRows = importState.parsedSecrets.length;\n nextError = `Imported ${bulkResult.imported} of ${totalRows} secrets — ${\n bulkResult.errors.length\n } failed${hasSkips ? `, ${bulkResult.skipped} skipped` : ''}. First error: ${firstError}`;\n } else if (!hasImports && hasSkips) {\n nextStatus = 'skipped';\n nextError = `Nothing imported: ${bulkResult.skipped} duplicate secret${\n bulkResult.skipped === 1 ? '' : 's'\n } skipped`;\n } else if (!hasImports && !hasErrors && !hasSkips) {\n // Defensive: server returned an empty result tuple. Should not\n // happen because we guard `parsedSecrets.length > 0` above, but\n // protect the wizard from showing a green \"Import complete\"\n // banner with a \"0 imported\" badge if the gateway ever filters\n // every row out before processing.\n nextStatus = 'skipped';\n nextError = 'Nothing was imported — the server returned an empty result.';\n }\n\n // For the empty-result defensive branch we deliberately omit\n // `results` so the wizard's terminal-state card renders the\n // error message alone, instead of an extra \"0 imported\" badge\n // row that would contradict the message.\n const isEmptyResult = !hasImports && !hasErrors && !hasSkips;\n\n setImportState((previous) => ({\n ...previous,\n status: nextStatus,\n results: isEmptyResult ? undefined : bulkResult,\n error: nextError,\n }));\n } catch (error) {\n setImportState((previous) => ({\n ...previous,\n status: 'error',\n error: error instanceof Error ? error.message : 'Import failed',\n }));\n }\n },\n [\n bulkCreateMutation,\n importState.encodedBackup,\n importState.parsedSecrets,\n importState.sourceType,\n restoreBackupMutation,\n ]\n );\n\n const resetImport = useCallback(() => {\n setImportState({\n file: null,\n fileName: null,\n parsedSecrets: [],\n encodedBackup: null,\n sourceType: null,\n error: null,\n status: 'idle',\n results: undefined,\n });\n }, []);\n\n // INTENTIONALLY NOT IMPLEMENTED: a plain `exportSecrets` query path.\n //\n // The wspace-security-svc schema exposes\n // `exportSecrets(vaultId, passphrase, secretIds)` as a GraphQL query,\n // but a *query* is the wrong transport for a flow that takes a\n // user-supplied passphrase: any persisted-query / GET link config\n // would put the cleartext passphrase on the URL and into HTTP access\n // logs. The dormant `exportSecrets.graphql` operation that used to\n // live in `src/operations/wspace/queries/` was deleted in BOFF-2225\n // for that reason — it had zero callers in `src/` outside the\n // generated codegen output.\n //\n // The export flow now goes exclusively through `createBackup` /\n // `CREATE_VAULT_BACKUP_MUTATION` (a POST mutation) which produces\n // an encrypted backup archive, uploads it via files-svc, and emails\n // the password via channel-svc. If a \"download as encrypted JSON\"\n // UI is needed in the future it should be added as a new mutation,\n // not by re-introducing the query.\n\n const createBackup = useCallback(\n async (vaultId: string, selectedSecretIds?: string[]): Promise<BackupExportResult> => {\n const { data, error } = await createBackupMutation({\n variables: {\n input: {\n vaultId,\n secretIds:\n selectedSecretIds && selectedSecretIds.length > 0 ? selectedSecretIds : undefined,\n },\n },\n });\n\n if (error) {\n throw error;\n }\n\n const result = data?.createVaultBackup;\n if (!result) {\n throw new Error('Backup completed without a response');\n }\n\n triggerDownload(result.downloadUrl, result.fileName);\n return result;\n },\n [createBackupMutation]\n );\n\n return {\n importState,\n importing: bulkImporting || restoringBackup,\n exporting: creatingBackup,\n handleFileSelect,\n executeImport,\n resetImport,\n createBackup,\n };\n}\n"],"mappings":"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"}
@@ -0,0 +1,18 @@
1
+ import { PasswordOptions } from '../utils/passwordGenerator';
2
+
3
+ /**
4
+ * Hook wrapping password generation with configurable options and strength calculation.
5
+ */
6
+ export declare function usePasswordGenerator(): {
7
+ password: string;
8
+ options: PasswordOptions;
9
+ strength: {
10
+ score: number;
11
+ label: "weak" | "fair" | "good" | "strong" | "excellent";
12
+ color: string;
13
+ };
14
+ regenerate: () => void;
15
+ updateOption: (key: keyof PasswordOptions, value: boolean | number) => void;
16
+ setOptions: import('react').Dispatch<import('react').SetStateAction<PasswordOptions>>;
17
+ };
18
+ //# sourceMappingURL=usePasswordGenerator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePasswordGenerator.d.ts","sourceRoot":"","sources":["../../../src/security/hooks/usePasswordGenerator.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,4BAA4B,CAAC;AAEpC;;GAEG;AACH,wBAAgB,oBAAoB;;;;;;;;;wBAS1B,MAAM,eAAe,SAAS,OAAO,GAAG,MAAM;;EAkBvD"}
@@ -0,0 +1,8 @@
1
+ import { VaultSyncLogFilterInput, SecurityPaginationInput } from '../../generated/wspace-types';
2
+
3
+ export declare function useVaultIntegrations(vaultId: string | undefined): import("@apollo/client/react").useQuery.Result<Types.GetVaultIntegrationsQuery, Types.GetVaultIntegrationsQueryVariables, "empty" | "complete" | "streaming", Types.GetVaultIntegrationsQueryVariables>;
4
+ export declare function useCreateIntegration(): import("@apollo/client/react").useMutation.ResultTuple<Types.CreateVaultIntegrationMutation, any, import('@apollo/client').ApolloCache>;
5
+ export declare function useDeleteIntegration(): import("@apollo/client/react").useMutation.ResultTuple<Types.DeleteVaultIntegrationMutation, any, import('@apollo/client').ApolloCache>;
6
+ export declare function useTriggerSync(): import("@apollo/client/react").useMutation.ResultTuple<Types.TriggerVaultSyncMutation, any, import('@apollo/client').ApolloCache>;
7
+ export declare function useVaultSyncLogs(integrationId: string | undefined, filter?: VaultSyncLogFilterInput, pagination?: SecurityPaginationInput): import("@apollo/client/react").useQuery.Result<Types.GetVaultSyncLogsQuery, Types.GetVaultSyncLogsQueryVariables, "empty" | "complete" | "streaming", Types.GetVaultSyncLogsQueryVariables>;
8
+ //# sourceMappingURL=useProviderQueries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useProviderQueries.d.ts","sourceRoot":"","sources":["../../../src/security/hooks/useProviderQueries.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAEV,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,8BAA8B,CAAC;AAEtC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,2MAM/D;AAED,wBAAgB,oBAAoB,4IAInC;AAED,wBAAgB,oBAAoB,4IAInC;AAED,wBAAgB,cAAc,sIAI7B;AAED,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,MAAM,CAAC,EAAE,uBAAuB,EAChC,UAAU,CAAC,EAAE,uBAAuB,+LAWrC"}
@@ -0,0 +1,30 @@
1
+ import { useDeleteVaultIntegrationMutation as e, useGetVaultIntegrationsQuery as t, useGetVaultSyncLogsQuery as n, useTriggerVaultSyncMutation as r } from "../../generated/wspace-operations.js";
2
+ //#region src/security/hooks/useProviderQueries.ts
3
+ function i(e) {
4
+ return t({
5
+ variables: { vaultId: e ?? "" },
6
+ skip: !e,
7
+ fetchPolicy: "network-only"
8
+ });
9
+ }
10
+ function a() {
11
+ return e({ refetchQueries: ["GetVaultIntegrations"] });
12
+ }
13
+ function o() {
14
+ return r({ refetchQueries: ["GetVaultSyncLogs"] });
15
+ }
16
+ function s(e, t, r) {
17
+ return n({
18
+ variables: {
19
+ integrationId: e ?? "",
20
+ filter: t,
21
+ pagination: r
22
+ },
23
+ skip: !e,
24
+ fetchPolicy: "network-only"
25
+ });
26
+ }
27
+ //#endregion
28
+ export { a as useDeleteIntegration, o as useTriggerSync, i as useVaultIntegrations, s as useVaultSyncLogs };
29
+
30
+ //# sourceMappingURL=useProviderQueries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useProviderQueries.js","names":[],"sources":["../../../src/security/hooks/useProviderQueries.ts"],"sourcesContent":["import {\n useGetVaultIntegrationsQuery,\n useCreateVaultIntegrationMutation,\n useDeleteVaultIntegrationMutation,\n useTriggerVaultSyncMutation,\n useGetVaultSyncLogsQuery,\n} from '../../generated/wspace-operations';\nimport type {\n CreateVaultIntegrationInput,\n VaultSyncLogFilterInput,\n SecurityPaginationInput,\n} from '../../generated/wspace-types';\n\nexport function useVaultIntegrations(vaultId: string | undefined) {\n return useGetVaultIntegrationsQuery({\n variables: { vaultId: vaultId ?? '' },\n skip: !vaultId,\n fetchPolicy: 'network-only',\n });\n}\n\nexport function useCreateIntegration() {\n return useCreateVaultIntegrationMutation({\n refetchQueries: ['GetVaultIntegrations'],\n });\n}\n\nexport function useDeleteIntegration() {\n return useDeleteVaultIntegrationMutation({\n refetchQueries: ['GetVaultIntegrations'],\n });\n}\n\nexport function useTriggerSync() {\n return useTriggerVaultSyncMutation({\n refetchQueries: ['GetVaultSyncLogs'],\n });\n}\n\nexport function useVaultSyncLogs(\n integrationId: string | undefined,\n filter?: VaultSyncLogFilterInput,\n pagination?: SecurityPaginationInput\n) {\n return useGetVaultSyncLogsQuery({\n variables: {\n integrationId: integrationId ?? '',\n filter,\n pagination,\n },\n skip: !integrationId,\n fetchPolicy: 'network-only',\n });\n}\n"],"mappings":";;AAaA,SAAgB,EAAqB,GAA6B;AAChE,QAAO,EAA6B;EAClC,WAAW,EAAE,SAAS,KAAW,IAAI;EACrC,MAAM,CAAC;EACP,aAAa;EACd,CAAC;;AASJ,SAAgB,IAAuB;AACrC,QAAO,EAAkC,EACvC,gBAAgB,CAAC,uBAAuB,EACzC,CAAC;;AAGJ,SAAgB,IAAiB;AAC/B,QAAO,EAA4B,EACjC,gBAAgB,CAAC,mBAAmB,EACrC,CAAC;;AAGJ,SAAgB,EACd,GACA,GACA,GACA;AACA,QAAO,EAAyB;EAC9B,WAAW;GACT,eAAe,KAAiB;GAChC;GACA;GACD;EACD,MAAM,CAAC;EACP,aAAa;EACd,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { SecretFilterInput, SecurityPaginationInput } from '../../generated/wspace-types';
2
+
3
+ export declare function useGetSecrets(vaultId: string | undefined, filter?: SecretFilterInput, pagination?: SecurityPaginationInput): import("@apollo/client/react").useQuery.Result<Types.GetSecretsQuery, Types.GetSecretsQueryVariables, "empty" | "complete" | "streaming", Types.GetSecretsQueryVariables>;
4
+ export declare function useGetSecret(id: string | null): import("@apollo/client/react").useQuery.Result<Types.GetSecretQuery, Types.GetSecretQueryVariables, "empty" | "complete" | "streaming", Types.GetSecretQueryVariables>;
5
+ export declare function useCreateSecret(): import("@apollo/client/react").useMutation.ResultTuple<Types.CreateSecretMutation, any, import('@apollo/client').ApolloCache>;
6
+ export declare function useUpdateSecret(): import("@apollo/client/react").useMutation.ResultTuple<Types.UpdateSecretMutation, any, import('@apollo/client').ApolloCache>;
7
+ export declare function useDeleteSecret(): import("@apollo/client/react").useMutation.ResultTuple<Types.DeleteSecretMutation, any, import('@apollo/client').ApolloCache>;
8
+ export declare function useRotateSecret(): import("@apollo/client/react").useMutation.ResultTuple<Types.RotateSecretMutation, any, import('@apollo/client').ApolloCache>;
9
+ export declare function useRollbackSecret(): import("@apollo/client/react").useMutation.ResultTuple<Types.RollbackSecretMutation, any, import('@apollo/client').ApolloCache>;
10
+ //# sourceMappingURL=useSecretQueries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSecretQueries.d.ts","sourceRoot":"","sources":["../../../src/security/hooks/useSecretQueries.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EAGxB,MAAM,8BAA8B,CAAC;AAEtC,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,MAAM,CAAC,EAAE,iBAAiB,EAC1B,UAAU,CAAC,EAAE,uBAAuB,6KAOrC;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,0KAM7C;AAED,wBAAgB,eAAe,kIAI9B;AAED,wBAAgB,eAAe,kIAE9B;AAED,wBAAgB,eAAe,kIAI9B;AAED,wBAAgB,eAAe,kIAE9B;AAED,wBAAgB,iBAAiB,oIAEhC"}
@@ -0,0 +1,36 @@
1
+ import { useCreateSecretMutation as e, useDeleteSecretMutation as t, useGetSecretQuery as n, useGetSecretsQuery as r, useRollbackSecretMutation as i, useRotateSecretMutation as a } from "../../generated/wspace-operations.js";
2
+ //#region src/security/hooks/useSecretQueries.ts
3
+ function o(e, t, n) {
4
+ return r({
5
+ variables: {
6
+ vaultId: e ?? "",
7
+ filter: t,
8
+ pagination: n
9
+ },
10
+ skip: !e,
11
+ fetchPolicy: "network-only"
12
+ });
13
+ }
14
+ function s(e) {
15
+ return n({
16
+ variables: { id: e ?? "" },
17
+ skip: !e,
18
+ fetchPolicy: "network-only"
19
+ });
20
+ }
21
+ function c() {
22
+ return e({ refetchQueries: ["GetSecrets"] });
23
+ }
24
+ function l() {
25
+ return t({ refetchQueries: ["GetSecrets"] });
26
+ }
27
+ function u() {
28
+ return a();
29
+ }
30
+ function d() {
31
+ return i();
32
+ }
33
+ //#endregion
34
+ export { c as useCreateSecret, l as useDeleteSecret, s as useGetSecret, o as useGetSecrets, d as useRollbackSecret, u as useRotateSecret };
35
+
36
+ //# sourceMappingURL=useSecretQueries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSecretQueries.js","names":[],"sources":["../../../src/security/hooks/useSecretQueries.ts"],"sourcesContent":["import {\n useGetSecretsQuery,\n useGetSecretQuery,\n useCreateSecretMutation,\n useUpdateSecretMutation,\n useDeleteSecretMutation,\n useRotateSecretMutation,\n useRollbackSecretMutation,\n} from '../../generated/wspace-operations';\nimport type {\n SecretFilterInput,\n SecurityPaginationInput,\n CreateSecretInput,\n UpdateSecretInput,\n} from '../../generated/wspace-types';\n\nexport function useGetSecrets(\n vaultId: string | undefined,\n filter?: SecretFilterInput,\n pagination?: SecurityPaginationInput\n) {\n return useGetSecretsQuery({\n variables: { vaultId: vaultId ?? '', filter, pagination },\n skip: !vaultId,\n fetchPolicy: 'network-only',\n });\n}\n\nexport function useGetSecret(id: string | null) {\n return useGetSecretQuery({\n variables: { id: id ?? '' },\n skip: !id,\n fetchPolicy: 'network-only',\n });\n}\n\nexport function useCreateSecret() {\n return useCreateSecretMutation({\n refetchQueries: ['GetSecrets'],\n });\n}\n\nexport function useUpdateSecret() {\n return useUpdateSecretMutation();\n}\n\nexport function useDeleteSecret() {\n return useDeleteSecretMutation({\n refetchQueries: ['GetSecrets'],\n });\n}\n\nexport function useRotateSecret() {\n return useRotateSecretMutation();\n}\n\nexport function useRollbackSecret() {\n return useRollbackSecretMutation();\n}\n"],"mappings":";;AAgBA,SAAgB,EACd,GACA,GACA,GACA;AACA,QAAO,EAAmB;EACxB,WAAW;GAAE,SAAS,KAAW;GAAI;GAAQ;GAAY;EACzD,MAAM,CAAC;EACP,aAAa;EACd,CAAC;;AAGJ,SAAgB,EAAa,GAAmB;AAC9C,QAAO,EAAkB;EACvB,WAAW,EAAE,IAAI,KAAM,IAAI;EAC3B,MAAM,CAAC;EACP,aAAa;EACd,CAAC;;AAGJ,SAAgB,IAAkB;AAChC,QAAO,EAAwB,EAC7B,gBAAgB,CAAC,aAAa,EAC/B,CAAC;;AAOJ,SAAgB,IAAkB;AAChC,QAAO,EAAwB,EAC7B,gBAAgB,CAAC,aAAa,EAC/B,CAAC;;AAGJ,SAAgB,IAAkB;AAChC,QAAO,GAAyB;;AAGlC,SAAgB,IAAoB;AAClC,QAAO,GAA2B"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Hook that fetches a decrypted secret value, stores in local state,
3
+ * and auto-clears after a configurable timeout.
4
+ */
5
+ export declare function useSecretValue(secretId: string): {
6
+ value: string | null;
7
+ reveal: () => Promise<void>;
8
+ hide: () => void;
9
+ loading: boolean;
10
+ isRevealed: boolean;
11
+ };
12
+ //# sourceMappingURL=useSecretValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSecretValue.d.ts","sourceRoot":"","sources":["../../../src/security/hooks/useSecretValue.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM;;;;;;EA4B9C"}
@@ -0,0 +1,29 @@
1
+ import { useDecryptSecretLazyQuery as e } from "../../generated/wspace-operations.js";
2
+ import { useSecurityStore as t } from "../store/securityStore.js";
3
+ import { useCallback as n, useEffect as r, useRef as i, useState as a } from "react";
4
+ //#region src/security/hooks/useSecretValue.ts
5
+ function o(o) {
6
+ let [s, c] = a(null), l = i(void 0), u = t((e) => e.clipboardAutoClearMs), [d, { loading: f }] = e({ fetchPolicy: "no-cache" }), p = n(async () => {
7
+ let e = (await d({ variables: { id: o } })).data;
8
+ e?.decryptSecret?.value && (c(e.decryptSecret.value), l.current && clearTimeout(l.current), l.current = setTimeout(() => c(null), u));
9
+ }, [
10
+ o,
11
+ d,
12
+ u
13
+ ]), m = n(() => {
14
+ c(null), l.current && clearTimeout(l.current);
15
+ }, []);
16
+ return r(() => () => {
17
+ l.current && clearTimeout(l.current);
18
+ }, []), {
19
+ value: s,
20
+ reveal: p,
21
+ hide: m,
22
+ loading: f,
23
+ isRevealed: s !== null
24
+ };
25
+ }
26
+ //#endregion
27
+ export { o as useSecretValue };
28
+
29
+ //# sourceMappingURL=useSecretValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSecretValue.js","names":[],"sources":["../../../src/security/hooks/useSecretValue.ts"],"sourcesContent":["import { useState, useCallback, useEffect, useRef } from 'react';\nimport { useDecryptSecretLazyQuery } from '../../generated/wspace-operations';\nimport { useSecurityStore } from '../store/securityStore.js';\n\n/**\n * Hook that fetches a decrypted secret value, stores in local state,\n * and auto-clears after a configurable timeout.\n */\nexport function useSecretValue(secretId: string) {\n const [value, setValue] = useState<string | null>(null);\n const timerRef = useRef<ReturnType<typeof setTimeout>>(undefined);\n const clipboardAutoClearMs = useSecurityStore((s) => s.clipboardAutoClearMs);\n const [decrypt, { loading }] = useDecryptSecretLazyQuery({ fetchPolicy: 'no-cache' });\n\n const reveal = useCallback(async () => {\n const result = await decrypt({ variables: { id: secretId } });\n const data = result.data;\n if (data?.decryptSecret?.value) {\n setValue(data.decryptSecret.value);\n if (timerRef.current) clearTimeout(timerRef.current);\n timerRef.current = setTimeout(() => setValue(null), clipboardAutoClearMs);\n }\n }, [secretId, decrypt, clipboardAutoClearMs]);\n\n const hide = useCallback(() => {\n setValue(null);\n if (timerRef.current) clearTimeout(timerRef.current);\n }, []);\n\n useEffect(() => {\n return () => {\n if (timerRef.current) clearTimeout(timerRef.current);\n };\n }, []);\n\n return { value, reveal, hide, loading, isRevealed: value !== null };\n}\n"],"mappings":";;;;AAQA,SAAgB,EAAe,GAAkB;CAC/C,IAAM,CAAC,GAAO,KAAY,EAAwB,KAAK,EACjD,IAAW,EAAsC,KAAA,EAAU,EAC3D,IAAuB,GAAkB,MAAM,EAAE,qBAAqB,EACtE,CAAC,GAAS,EAAE,gBAAa,EAA0B,EAAE,aAAa,YAAY,CAAC,EAE/E,IAAS,EAAY,YAAY;EAErC,IAAM,KADS,MAAM,EAAQ,EAAE,WAAW,EAAE,IAAI,GAAU,EAAE,CAAC,EACzC;AACpB,EAAI,GAAM,eAAe,UACvB,EAAS,EAAK,cAAc,MAAM,EAC9B,EAAS,WAAS,aAAa,EAAS,QAAQ,EACpD,EAAS,UAAU,iBAAiB,EAAS,KAAK,EAAE,EAAqB;IAE1E;EAAC;EAAU;EAAS;EAAqB,CAAC,EAEvC,IAAO,QAAkB;AAE7B,EADA,EAAS,KAAK,EACV,EAAS,WAAS,aAAa,EAAS,QAAQ;IACnD,EAAE,CAAC;AAQN,QANA,cACe;AACX,EAAI,EAAS,WAAS,aAAa,EAAS,QAAQ;IAErD,EAAE,CAAC,EAEC;EAAE;EAAO;EAAQ;EAAM;EAAS,YAAY,MAAU;EAAM"}
@@ -0,0 +1,2 @@
1
+ export declare function useSecurityCacheInvalidation(): void;
2
+ //# sourceMappingURL=useSecurityCacheInvalidation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSecurityCacheInvalidation.d.ts","sourceRoot":"","sources":["../../../src/security/hooks/useSecurityCacheInvalidation.ts"],"names":[],"mappings":"AAkCA,wBAAgB,4BAA4B,IAAI,IAAI,CA6CnD"}
@@ -0,0 +1,52 @@
1
+ import { useEffect as e } from "react";
2
+ import { useApolloClient as t } from "@apollo/client/react";
3
+ import { useEventBus as n } from "@burdenoff/fe-libs/shared/events";
4
+ //#region src/security/hooks/useSecurityCacheInvalidation.ts
5
+ var r = [
6
+ "GetVaults",
7
+ "GetVault",
8
+ "GetVaultWithSecrets",
9
+ "GetSecrets",
10
+ "GetSecret",
11
+ "GetSecretVersionsPaginated",
12
+ "GetAuditLogs"
13
+ ];
14
+ function i() {
15
+ let i = t(), a = n();
16
+ e(() => {
17
+ let e = [
18
+ "vault.created",
19
+ "vault.updated",
20
+ "vault.deleted",
21
+ "vault.locked",
22
+ "vault.unlocked",
23
+ "vault.accessed",
24
+ "secret.created",
25
+ "secret.updated",
26
+ "secret.deleted",
27
+ "secret.accessed",
28
+ "secret.rotated",
29
+ "secret.rollback",
30
+ "member.added",
31
+ "member.removed",
32
+ "member.role_changed"
33
+ ].map((e) => a.on(e, () => {
34
+ r.forEach((e) => {
35
+ try {
36
+ i.refetchQueries({ include: [e] });
37
+ } catch {}
38
+ });
39
+ }));
40
+ return () => {
41
+ e.forEach((e) => {
42
+ try {
43
+ e();
44
+ } catch {}
45
+ });
46
+ };
47
+ }, [a, i]);
48
+ }
49
+ //#endregion
50
+ export { i as useSecurityCacheInvalidation };
51
+
52
+ //# sourceMappingURL=useSecurityCacheInvalidation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSecurityCacheInvalidation.js","names":[],"sources":["../../../src/security/hooks/useSecurityCacheInvalidation.ts"],"sourcesContent":["/**\n * Listens to security-domain events on the host event bus and invalidates\n * the Apollo cache for the affected queries.\n *\n * The MFE never invokes Apollo cache APIs from feature code directly — it\n * subscribes to the bus and reacts. This is the subscribe-side counterpart\n * to `useSecurityEventEmitter`. Per spec 47, all cross-MFE coordination flows\n * through the bus; this hook is wired once at the root so every page in\n * the MFE benefits without each page needing its own subscription.\n */\nimport { useEffect } from 'react';\nimport { useApolloClient } from '@apollo/client/react';\nimport { useEventBus } from '@burdenoff/fe-libs/shared/events';\nimport type { SecurityDomainEvent } from './useSecurityEventEmitter';\n\ninterface BusEvent<T = unknown> {\n name: string;\n payload: T;\n}\n\ntype DynamicBus = {\n on: (name: string, handler: (event: BusEvent) => void) => () => void;\n};\n\nconst QUERIES_TO_REFETCH = [\n 'GetVaults',\n 'GetVault',\n 'GetVaultWithSecrets',\n 'GetSecrets',\n 'GetSecret',\n 'GetSecretVersionsPaginated',\n 'GetAuditLogs',\n];\n\nexport function useSecurityCacheInvalidation(): void {\n const client = useApolloClient();\n const bus = useEventBus() as unknown as DynamicBus;\n\n useEffect(() => {\n const events: SecurityDomainEvent[] = [\n 'vault.created',\n 'vault.updated',\n 'vault.deleted',\n 'vault.locked',\n 'vault.unlocked',\n 'vault.accessed',\n 'secret.created',\n 'secret.updated',\n 'secret.deleted',\n 'secret.accessed',\n 'secret.rotated',\n 'secret.rollback',\n 'member.added',\n 'member.removed',\n 'member.role_changed',\n ];\n\n const offHandlers = events.map((name) =>\n bus.on(name, () => {\n QUERIES_TO_REFETCH.forEach((q) => {\n try {\n void client.refetchQueries({ include: [q] });\n } catch {\n // Refetch failures are non-fatal; cached data stays usable.\n }\n });\n })\n );\n\n return () => {\n offHandlers.forEach((off) => {\n try {\n off();\n } catch {\n /* noop */\n }\n });\n };\n }, [bus, client]);\n}\n"],"mappings":";;;;AAwBA,IAAM,IAAqB;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,SAAgB,IAAqC;CACnD,IAAM,IAAS,GAAiB,EAC1B,IAAM,GAAa;AAEzB,SAAgB;EAmBd,IAAM,IAlBgC;GACpC;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAE0B,KAAK,MAC9B,EAAI,GAAG,SAAY;AACjB,KAAmB,SAAS,MAAM;AAChC,QAAI;AACG,OAAO,eAAe,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC;YACtC;KAGR;IACF,CACH;AAED,eAAa;AACX,KAAY,SAAS,MAAQ;AAC3B,QAAI;AACF,QAAK;YACC;KAGR;;IAEH,CAAC,GAAK,EAAO,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Aggregating hook that fetches vaults and recent audit logs
3
+ * to produce a security health dashboard view.
4
+ *
5
+ * Dashboard metrics are derived from vault-level data (secretCount,
6
+ * memberCount) so we do not need to query getSecrets (which requires
7
+ * a vaultId).
8
+ */
9
+ export declare function useSecurityDashboard(): {
10
+ dashboard: {
11
+ totalVaults: any;
12
+ totalSecrets: any;
13
+ totalMembers: any;
14
+ healthScore: number;
15
+ lockedVaults: any;
16
+ recentActivity: any;
17
+ };
18
+ loading: boolean;
19
+ error: import('@apollo/client').ErrorLike | null;
20
+ };
21
+ //# sourceMappingURL=useSecurityDashboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSecurityDashboard.d.ts","sourceRoot":"","sources":["../../../src/security/hooks/useSecurityDashboard.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,wBAAgB,oBAAoB;;;;;;;;;;;EA8DnC"}