@brightchain/brightchain-lib 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/package.json +2 -2
  2. package/src/lib/documents/member/memberProfileHydration.d.ts.map +1 -1
  3. package/src/lib/documents/member/memberProfileHydration.js +6 -0
  4. package/src/lib/documents/member/memberProfileHydration.js.map +1 -1
  5. package/src/lib/enumerations/brightChainStrings.d.ts +39 -0
  6. package/src/lib/enumerations/brightChainStrings.d.ts.map +1 -1
  7. package/src/lib/enumerations/brightChainStrings.js +47 -0
  8. package/src/lib/enumerations/brightChainStrings.js.map +1 -1
  9. package/src/lib/enumerations/identityValidationErrorType.d.ts +11 -0
  10. package/src/lib/enumerations/identityValidationErrorType.d.ts.map +1 -0
  11. package/src/lib/enumerations/identityValidationErrorType.js +15 -0
  12. package/src/lib/enumerations/identityValidationErrorType.js.map +1 -0
  13. package/src/lib/enumerations/index.d.ts +4 -0
  14. package/src/lib/enumerations/index.d.ts.map +1 -1
  15. package/src/lib/enumerations/index.js +5 -0
  16. package/src/lib/enumerations/index.js.map +1 -1
  17. package/src/lib/enumerations/memberStatusType.d.ts +2 -1
  18. package/src/lib/enumerations/memberStatusType.d.ts.map +1 -1
  19. package/src/lib/enumerations/memberStatusType.js +1 -0
  20. package/src/lib/enumerations/memberStatusType.js.map +1 -1
  21. package/src/lib/enumerations/proposalActionType.d.ts +22 -0
  22. package/src/lib/enumerations/proposalActionType.d.ts.map +1 -0
  23. package/src/lib/enumerations/proposalActionType.js +26 -0
  24. package/src/lib/enumerations/proposalActionType.js.map +1 -0
  25. package/src/lib/enumerations/proposalStatus.d.ts +14 -0
  26. package/src/lib/enumerations/proposalStatus.d.ts.map +1 -0
  27. package/src/lib/enumerations/proposalStatus.js +18 -0
  28. package/src/lib/enumerations/proposalStatus.js.map +1 -0
  29. package/src/lib/enumerations/quorumErrorType.d.ts +30 -1
  30. package/src/lib/enumerations/quorumErrorType.d.ts.map +1 -1
  31. package/src/lib/enumerations/quorumErrorType.js +37 -0
  32. package/src/lib/enumerations/quorumErrorType.js.map +1 -1
  33. package/src/lib/enumerations/quorumOperationalMode.d.ts +16 -0
  34. package/src/lib/enumerations/quorumOperationalMode.d.ts.map +1 -0
  35. package/src/lib/enumerations/quorumOperationalMode.js +20 -0
  36. package/src/lib/enumerations/quorumOperationalMode.js.map +1 -0
  37. package/src/lib/enumerations/sealingErrorType.d.ts +3 -1
  38. package/src/lib/enumerations/sealingErrorType.d.ts.map +1 -1
  39. package/src/lib/enumerations/sealingErrorType.js +2 -0
  40. package/src/lib/enumerations/sealingErrorType.js.map +1 -1
  41. package/src/lib/errors/identityValidationError.d.ts +8 -0
  42. package/src/lib/errors/identityValidationError.d.ts.map +1 -0
  43. package/src/lib/errors/identityValidationError.js +26 -0
  44. package/src/lib/errors/identityValidationError.js.map +1 -0
  45. package/src/lib/errors/index.d.ts +4 -0
  46. package/src/lib/errors/index.d.ts.map +1 -1
  47. package/src/lib/errors/index.js +7 -0
  48. package/src/lib/errors/index.js.map +1 -1
  49. package/src/lib/errors/quorumError.d.ts.map +1 -1
  50. package/src/lib/errors/quorumError.js +37 -0
  51. package/src/lib/errors/quorumError.js.map +1 -1
  52. package/src/lib/errors/sealingError.d.ts.map +1 -1
  53. package/src/lib/errors/sealingError.js +2 -0
  54. package/src/lib/errors/sealingError.js.map +1 -1
  55. package/src/lib/i18n/strings/englishUs.d.ts.map +1 -1
  56. package/src/lib/i18n/strings/englishUs.js +45 -0
  57. package/src/lib/i18n/strings/englishUs.js.map +1 -1
  58. package/src/lib/i18n/strings/french.d.ts.map +1 -1
  59. package/src/lib/i18n/strings/french.js +37 -0
  60. package/src/lib/i18n/strings/french.js.map +1 -1
  61. package/src/lib/i18n/strings/german.d.ts.map +1 -1
  62. package/src/lib/i18n/strings/german.js +37 -0
  63. package/src/lib/i18n/strings/german.js.map +1 -1
  64. package/src/lib/i18n/strings/japanese.d.ts.map +1 -1
  65. package/src/lib/i18n/strings/japanese.js +37 -0
  66. package/src/lib/i18n/strings/japanese.js.map +1 -1
  67. package/src/lib/i18n/strings/mandarin.d.ts.map +1 -1
  68. package/src/lib/i18n/strings/mandarin.js +37 -0
  69. package/src/lib/i18n/strings/mandarin.js.map +1 -1
  70. package/src/lib/i18n/strings/spanish.d.ts.map +1 -1
  71. package/src/lib/i18n/strings/spanish.js +37 -0
  72. package/src/lib/i18n/strings/spanish.js.map +1 -1
  73. package/src/lib/i18n/strings/ukrainian.d.ts.map +1 -1
  74. package/src/lib/i18n/strings/ukrainian.js +37 -0
  75. package/src/lib/i18n/strings/ukrainian.js.map +1 -1
  76. package/src/lib/interfaces/aliasRecord.d.ts +34 -0
  77. package/src/lib/interfaces/aliasRecord.d.ts.map +1 -0
  78. package/src/lib/interfaces/aliasRecord.js +11 -0
  79. package/src/lib/interfaces/aliasRecord.js.map +1 -0
  80. package/src/lib/interfaces/api/index.d.ts +2 -0
  81. package/src/lib/interfaces/api/index.d.ts.map +1 -0
  82. package/src/lib/interfaces/api/index.js +5 -0
  83. package/src/lib/interfaces/api/index.js.map +1 -0
  84. package/src/lib/interfaces/api/quorumApi.d.ts +97 -0
  85. package/src/lib/interfaces/api/quorumApi.d.ts.map +1 -0
  86. package/src/lib/interfaces/api/quorumApi.js +12 -0
  87. package/src/lib/interfaces/api/quorumApi.js.map +1 -0
  88. package/src/lib/interfaces/auditLogEntry.d.ts +34 -0
  89. package/src/lib/interfaces/auditLogEntry.d.ts.map +1 -0
  90. package/src/lib/interfaces/auditLogEntry.js +10 -0
  91. package/src/lib/interfaces/auditLogEntry.js.map +1 -0
  92. package/src/lib/interfaces/availability/gossipService.d.ts +116 -2
  93. package/src/lib/interfaces/availability/gossipService.d.ts.map +1 -1
  94. package/src/lib/interfaces/availability/gossipService.js +62 -0
  95. package/src/lib/interfaces/availability/gossipService.js.map +1 -1
  96. package/src/lib/interfaces/chainedAuditLogEntry.d.ts +27 -0
  97. package/src/lib/interfaces/chainedAuditLogEntry.d.ts.map +1 -0
  98. package/src/lib/interfaces/chainedAuditLogEntry.js +12 -0
  99. package/src/lib/interfaces/chainedAuditLogEntry.js.map +1 -0
  100. package/src/lib/interfaces/contentWithIdentity.d.ts +39 -0
  101. package/src/lib/interfaces/contentWithIdentity.d.ts.map +1 -0
  102. package/src/lib/interfaces/contentWithIdentity.js +24 -0
  103. package/src/lib/interfaces/contentWithIdentity.js.map +1 -0
  104. package/src/lib/interfaces/energyAccount.d.ts +3 -1
  105. package/src/lib/interfaces/energyAccount.d.ts.map +1 -1
  106. package/src/lib/interfaces/identityRecoveryRecord.d.ts +41 -0
  107. package/src/lib/interfaces/identityRecoveryRecord.d.ts.map +1 -0
  108. package/src/lib/interfaces/identityRecoveryRecord.js +11 -0
  109. package/src/lib/interfaces/identityRecoveryRecord.js.map +1 -0
  110. package/src/lib/interfaces/index.d.ts +16 -0
  111. package/src/lib/interfaces/index.d.ts.map +1 -1
  112. package/src/lib/interfaces/index.js +4 -0
  113. package/src/lib/interfaces/index.js.map +1 -1
  114. package/src/lib/interfaces/initResult.d.ts +6 -6
  115. package/src/lib/interfaces/initResult.d.ts.map +1 -1
  116. package/src/lib/interfaces/member/brightChainBaseInitResult.d.ts +4 -1
  117. package/src/lib/interfaces/member/brightChainBaseInitResult.d.ts.map +1 -1
  118. package/src/lib/interfaces/member/brightChainInitResult.d.ts +1 -1
  119. package/src/lib/interfaces/member/brightChainInitResult.d.ts.map +1 -1
  120. package/src/lib/interfaces/member/memberData.d.ts +3 -0
  121. package/src/lib/interfaces/member/memberData.d.ts.map +1 -1
  122. package/src/lib/interfaces/member/profileStorage.d.ts +5 -0
  123. package/src/lib/interfaces/member/profileStorage.d.ts.map +1 -1
  124. package/src/lib/interfaces/operationalState.d.ts +20 -0
  125. package/src/lib/interfaces/operationalState.d.ts.map +1 -0
  126. package/src/lib/interfaces/operationalState.js +10 -0
  127. package/src/lib/interfaces/operationalState.js.map +1 -0
  128. package/src/lib/interfaces/proposal.d.ts +59 -0
  129. package/src/lib/interfaces/proposal.d.ts.map +1 -0
  130. package/src/lib/interfaces/proposal.js +10 -0
  131. package/src/lib/interfaces/proposal.js.map +1 -0
  132. package/src/lib/interfaces/quorumDocumentMetadata.d.ts +20 -0
  133. package/src/lib/interfaces/quorumDocumentMetadata.d.ts.map +1 -0
  134. package/src/lib/interfaces/quorumDocumentMetadata.js +10 -0
  135. package/src/lib/interfaces/quorumDocumentMetadata.js.map +1 -0
  136. package/src/lib/interfaces/quorumEpoch.d.ts +33 -0
  137. package/src/lib/interfaces/quorumEpoch.d.ts.map +1 -0
  138. package/src/lib/interfaces/quorumEpoch.js +11 -0
  139. package/src/lib/interfaces/quorumEpoch.js.map +1 -0
  140. package/src/lib/interfaces/quorumMetrics.d.ts +49 -0
  141. package/src/lib/interfaces/quorumMetrics.d.ts.map +1 -0
  142. package/src/lib/interfaces/quorumMetrics.js +10 -0
  143. package/src/lib/interfaces/quorumMetrics.js.map +1 -0
  144. package/src/lib/interfaces/redistributionJournalEntry.d.ts +25 -0
  145. package/src/lib/interfaces/redistributionJournalEntry.d.ts.map +1 -0
  146. package/src/lib/interfaces/redistributionJournalEntry.js +11 -0
  147. package/src/lib/interfaces/redistributionJournalEntry.js.map +1 -0
  148. package/src/lib/interfaces/responses/backupCodesResponseData.d.ts +3 -5
  149. package/src/lib/interfaces/responses/backupCodesResponseData.d.ts.map +1 -1
  150. package/src/lib/interfaces/responses/challengeResponseData.d.ts +5 -0
  151. package/src/lib/interfaces/responses/challengeResponseData.d.ts.map +1 -1
  152. package/src/lib/interfaces/responses/codeCountResponseData.d.ts +3 -5
  153. package/src/lib/interfaces/responses/codeCountResponseData.d.ts.map +1 -1
  154. package/src/lib/interfaces/responses/index.d.ts +4 -2
  155. package/src/lib/interfaces/responses/index.d.ts.map +1 -1
  156. package/src/lib/interfaces/responses/passwordChangeResponse.d.ts +2 -0
  157. package/src/lib/interfaces/responses/passwordChangeResponse.d.ts.map +1 -0
  158. package/src/lib/interfaces/responses/passwordChangeResponse.js +3 -0
  159. package/src/lib/interfaces/responses/passwordChangeResponse.js.map +1 -0
  160. package/src/lib/interfaces/responses/recoveryResponse.d.ts +2 -0
  161. package/src/lib/interfaces/responses/recoveryResponse.d.ts.map +1 -0
  162. package/src/lib/interfaces/responses/recoveryResponse.js +3 -0
  163. package/src/lib/interfaces/responses/recoveryResponse.js.map +1 -0
  164. package/src/lib/interfaces/responses/registrationResponseData.d.ts +2 -2
  165. package/src/lib/interfaces/responses/registrationResponseData.d.ts.map +1 -1
  166. package/src/lib/interfaces/services/contentIngestion.d.ts +61 -0
  167. package/src/lib/interfaces/services/contentIngestion.d.ts.map +1 -0
  168. package/src/lib/interfaces/services/contentIngestion.js +12 -0
  169. package/src/lib/interfaces/services/contentIngestion.js.map +1 -0
  170. package/src/lib/interfaces/services/expirationScheduler.d.ts +55 -0
  171. package/src/lib/interfaces/services/expirationScheduler.d.ts.map +1 -0
  172. package/src/lib/interfaces/services/expirationScheduler.js +11 -0
  173. package/src/lib/interfaces/services/expirationScheduler.js.map +1 -0
  174. package/src/lib/interfaces/services/identitySealingPipeline.d.ts +56 -0
  175. package/src/lib/interfaces/services/identitySealingPipeline.d.ts.map +1 -0
  176. package/src/lib/interfaces/services/identitySealingPipeline.js +12 -0
  177. package/src/lib/interfaces/services/identitySealingPipeline.js.map +1 -0
  178. package/src/lib/interfaces/services/identityValidator.d.ts +44 -0
  179. package/src/lib/interfaces/services/identityValidator.d.ts.map +1 -0
  180. package/src/lib/interfaces/services/identityValidator.js +11 -0
  181. package/src/lib/interfaces/services/identityValidator.js.map +1 -0
  182. package/src/lib/interfaces/services/index.d.ts +9 -0
  183. package/src/lib/interfaces/services/index.d.ts.map +1 -1
  184. package/src/lib/interfaces/services/membershipProof.d.ts +40 -0
  185. package/src/lib/interfaces/services/membershipProof.d.ts.map +1 -0
  186. package/src/lib/interfaces/services/membershipProof.js +11 -0
  187. package/src/lib/interfaces/services/membershipProof.js.map +1 -0
  188. package/src/lib/interfaces/services/operatorPrompt.d.ts +68 -0
  189. package/src/lib/interfaces/services/operatorPrompt.d.ts.map +1 -0
  190. package/src/lib/interfaces/services/operatorPrompt.js +11 -0
  191. package/src/lib/interfaces/services/operatorPrompt.js.map +1 -0
  192. package/src/lib/interfaces/services/quorumDatabase.d.ts +207 -0
  193. package/src/lib/interfaces/services/quorumDatabase.d.ts.map +1 -0
  194. package/src/lib/interfaces/services/quorumDatabase.js +13 -0
  195. package/src/lib/interfaces/services/quorumDatabase.js.map +1 -0
  196. package/src/lib/interfaces/services/quorumService.d.ts +3 -0
  197. package/src/lib/interfaces/services/quorumService.d.ts.map +1 -1
  198. package/src/lib/interfaces/services/quorumStateMachine.d.ts +128 -0
  199. package/src/lib/interfaces/services/quorumStateMachine.d.ts.map +1 -0
  200. package/src/lib/interfaces/services/quorumStateMachine.js +12 -0
  201. package/src/lib/interfaces/services/quorumStateMachine.js.map +1 -0
  202. package/src/lib/interfaces/services/redistributionConfig.d.ts +20 -0
  203. package/src/lib/interfaces/services/redistributionConfig.d.ts.map +1 -0
  204. package/src/lib/interfaces/services/redistributionConfig.js +10 -0
  205. package/src/lib/interfaces/services/redistributionConfig.js.map +1 -0
  206. package/src/lib/interfaces/statuteConfig.d.ts +22 -0
  207. package/src/lib/interfaces/statuteConfig.d.ts.map +1 -0
  208. package/src/lib/interfaces/statuteConfig.js +18 -0
  209. package/src/lib/interfaces/statuteConfig.js.map +1 -0
  210. package/src/lib/interfaces/storage/documentStore.d.ts +46 -24
  211. package/src/lib/interfaces/storage/documentStore.d.ts.map +1 -1
  212. package/src/lib/interfaces/storage/documentStore.js +6 -2
  213. package/src/lib/interfaces/storage/documentStore.js.map +1 -1
  214. package/src/lib/interfaces/userManagement.d.ts +49 -0
  215. package/src/lib/interfaces/userManagement.d.ts.map +1 -0
  216. package/src/lib/interfaces/userManagement.js +9 -0
  217. package/src/lib/interfaces/userManagement.js.map +1 -0
  218. package/src/lib/interfaces/vote.d.ts +45 -0
  219. package/src/lib/interfaces/vote.d.ts.map +1 -0
  220. package/src/lib/interfaces/vote.js +10 -0
  221. package/src/lib/interfaces/vote.js.map +1 -0
  222. package/src/lib/quorumDataRecord.d.ts +7 -1
  223. package/src/lib/quorumDataRecord.d.ts.map +1 -1
  224. package/src/lib/quorumDataRecord.js +12 -4
  225. package/src/lib/quorumDataRecord.js.map +1 -1
  226. package/src/lib/quorumDataRecordDto.d.ts +6 -0
  227. package/src/lib/quorumDataRecordDto.d.ts.map +1 -1
  228. package/src/lib/services/aliasRegistry.d.ts +77 -0
  229. package/src/lib/services/aliasRegistry.d.ts.map +1 -0
  230. package/src/lib/services/aliasRegistry.js +138 -0
  231. package/src/lib/services/aliasRegistry.js.map +1 -0
  232. package/src/lib/services/auditLogService.d.ts +100 -0
  233. package/src/lib/services/auditLogService.d.ts.map +1 -0
  234. package/src/lib/services/auditLogService.js +223 -0
  235. package/src/lib/services/auditLogService.js.map +1 -0
  236. package/src/lib/services/blockService.d.ts +2 -1
  237. package/src/lib/services/blockService.d.ts.map +1 -1
  238. package/src/lib/services/blockService.js +7 -2
  239. package/src/lib/services/blockService.js.map +1 -1
  240. package/src/lib/services/identitySealingPipeline.d.ts +120 -0
  241. package/src/lib/services/identitySealingPipeline.d.ts.map +1 -0
  242. package/src/lib/services/identitySealingPipeline.js +288 -0
  243. package/src/lib/services/identitySealingPipeline.js.map +1 -0
  244. package/src/lib/services/identityValidator.d.ts +75 -0
  245. package/src/lib/services/identityValidator.d.ts.map +1 -0
  246. package/src/lib/services/identityValidator.js +202 -0
  247. package/src/lib/services/identityValidator.js.map +1 -0
  248. package/src/lib/services/index.d.ts +6 -0
  249. package/src/lib/services/index.d.ts.map +1 -1
  250. package/src/lib/services/index.js +6 -0
  251. package/src/lib/services/index.js.map +1 -1
  252. package/src/lib/services/member/memberCblService.d.ts.map +1 -1
  253. package/src/lib/services/member/memberCblService.js +12 -1
  254. package/src/lib/services/member/memberCblService.js.map +1 -1
  255. package/src/lib/services/memberStore.d.ts.map +1 -1
  256. package/src/lib/services/memberStore.js +2 -0
  257. package/src/lib/services/memberStore.js.map +1 -1
  258. package/src/lib/services/membershipProofService.d.ts +90 -0
  259. package/src/lib/services/membershipProofService.d.ts.map +1 -0
  260. package/src/lib/services/membershipProofService.js +361 -0
  261. package/src/lib/services/membershipProofService.js.map +1 -0
  262. package/src/lib/services/quorumStateMachine.d.ts +336 -0
  263. package/src/lib/services/quorumStateMachine.d.ts.map +1 -0
  264. package/src/lib/services/quorumStateMachine.js +1396 -0
  265. package/src/lib/services/quorumStateMachine.js.map +1 -0
  266. package/src/lib/services/sealing.service.d.ts +80 -0
  267. package/src/lib/services/sealing.service.d.ts.map +1 -1
  268. package/src/lib/services/sealing.service.js +192 -0
  269. package/src/lib/services/sealing.service.js.map +1 -1
  270. package/src/lib/stores/energyAccountStore.d.ts +13 -11
  271. package/src/lib/stores/energyAccountStore.d.ts.map +1 -1
  272. package/src/lib/stores/energyAccountStore.js +18 -20
  273. package/src/lib/stores/energyAccountStore.js.map +1 -1
@@ -0,0 +1,207 @@
1
+ /**
2
+ * @fileoverview IQuorumDatabase interface.
3
+ *
4
+ * Abstraction over BrightChainDb with a dedicated "quorum-system" pool.
5
+ * Provides full CRUD for epochs, members, documents, proposals, votes,
6
+ * identity records, aliases, audit log, redistribution journal,
7
+ * statute config, operational state, transactions, and health check.
8
+ *
9
+ * @see Requirements 9, 10
10
+ */
11
+ import { PlatformID, ShortHexGuid } from '@digitaldefiance/ecies-lib';
12
+ import { QuorumDataRecord } from '../../quorumDataRecord';
13
+ import { AliasRecord } from '../aliasRecord';
14
+ import { QuorumAuditLogEntry } from '../auditLogEntry';
15
+ import { ChainedAuditLogEntry } from '../chainedAuditLogEntry';
16
+ import { IdentityRecoveryRecord } from '../identityRecoveryRecord';
17
+ import { OperationalState } from '../operationalState';
18
+ import { Proposal } from '../proposal';
19
+ import { QuorumEpoch } from '../quorumEpoch';
20
+ import { RedistributionJournalEntry } from '../redistributionJournalEntry';
21
+ import { StatuteOfLimitationsConfig } from '../statuteConfig';
22
+ import { Vote } from '../vote';
23
+ import { IQuorumMember } from './quorumService';
24
+ /**
25
+ * Abstraction over BrightChainDb with a dedicated "quorum-system" pool.
26
+ *
27
+ * Implementations live in brightchain-api-lib (QuorumDatabaseAdapter).
28
+ * All quorum data is routed through the PooledStoreAdapter for isolation.
29
+ *
30
+ * @template TID - Platform ID type for frontend/backend DTO compatibility
31
+ */
32
+ export interface IQuorumDatabase<TID extends PlatformID = Uint8Array> {
33
+ /**
34
+ * Persist an epoch record.
35
+ * @param epoch - The epoch to save
36
+ */
37
+ saveEpoch(epoch: QuorumEpoch<TID>): Promise<void>;
38
+ /**
39
+ * Retrieve an epoch by its number.
40
+ * @param epochNumber - The epoch number
41
+ * @returns The epoch, or null if not found
42
+ */
43
+ getEpoch(epochNumber: number): Promise<QuorumEpoch<TID> | null>;
44
+ /**
45
+ * Get the current (latest) epoch.
46
+ * @returns The current epoch
47
+ */
48
+ getCurrentEpoch(): Promise<QuorumEpoch<TID>>;
49
+ /**
50
+ * Persist a quorum member record.
51
+ * @param member - The member to save
52
+ */
53
+ saveMember(member: IQuorumMember<TID>): Promise<void>;
54
+ /**
55
+ * Retrieve a member by their ID.
56
+ * @param memberId - The member ID
57
+ * @returns The member, or null if not found
58
+ */
59
+ getMember(memberId: ShortHexGuid): Promise<IQuorumMember<TID> | null>;
60
+ /**
61
+ * List all active members in the quorum.
62
+ * @returns Array of active quorum members
63
+ */
64
+ listActiveMembers(): Promise<IQuorumMember<TID>[]>;
65
+ /**
66
+ * Persist a sealed document.
67
+ * @param doc - The document to save
68
+ */
69
+ saveDocument(doc: QuorumDataRecord<TID>): Promise<void>;
70
+ /**
71
+ * Retrieve a sealed document by its ID.
72
+ * @param docId - The document ID
73
+ * @returns The document, or null if not found
74
+ */
75
+ getDocument(docId: ShortHexGuid): Promise<QuorumDataRecord<TID> | null>;
76
+ /**
77
+ * List documents sealed under a specific epoch with pagination.
78
+ * @param epochNumber - The epoch number to filter by
79
+ * @param page - Zero-based page number
80
+ * @param pageSize - Number of documents per page
81
+ * @returns Array of documents for the given epoch and page
82
+ */
83
+ listDocumentsByEpoch(epochNumber: number, page: number, pageSize: number): Promise<QuorumDataRecord<TID>[]>;
84
+ /**
85
+ * Persist a proposal.
86
+ * @param proposal - The proposal to save
87
+ */
88
+ saveProposal(proposal: Proposal<TID>): Promise<void>;
89
+ /**
90
+ * Retrieve a proposal by its ID.
91
+ * @param proposalId - The proposal ID
92
+ * @returns The proposal, or null if not found
93
+ */
94
+ getProposal(proposalId: ShortHexGuid): Promise<Proposal<TID> | null>;
95
+ /**
96
+ * Persist a vote.
97
+ * @param vote - The vote to save
98
+ */
99
+ saveVote(vote: Vote<TID>): Promise<void>;
100
+ /**
101
+ * Get all votes for a specific proposal.
102
+ * @param proposalId - The proposal ID
103
+ * @returns Array of votes for the proposal
104
+ */
105
+ getVotesForProposal(proposalId: ShortHexGuid): Promise<Vote<TID>[]>;
106
+ /**
107
+ * Persist an identity recovery record.
108
+ * @param record - The record to save
109
+ */
110
+ saveIdentityRecord(record: IdentityRecoveryRecord<TID>): Promise<void>;
111
+ /**
112
+ * Retrieve an identity recovery record by its ID.
113
+ * @param recordId - The record ID
114
+ * @returns The record, or null if not found
115
+ */
116
+ getIdentityRecord(recordId: ShortHexGuid): Promise<IdentityRecoveryRecord<TID> | null>;
117
+ /**
118
+ * Delete an identity recovery record (used by expiration scheduler).
119
+ * @param recordId - The record ID to delete
120
+ */
121
+ deleteIdentityRecord(recordId: ShortHexGuid): Promise<void>;
122
+ /**
123
+ * List expired identity recovery records with pagination.
124
+ * @param before - Records with expiresAt before this date are considered expired
125
+ * @param page - Zero-based page number
126
+ * @param pageSize - Number of records per page
127
+ * @returns Array of expired identity recovery records
128
+ */
129
+ listExpiredIdentityRecords(before: Date, page: number, pageSize: number): Promise<IdentityRecoveryRecord<TID>[]>;
130
+ /**
131
+ * Persist an alias record.
132
+ * @param alias - The alias record to save
133
+ */
134
+ saveAlias(alias: AliasRecord<TID>): Promise<void>;
135
+ /**
136
+ * Retrieve an alias record by name.
137
+ * @param aliasName - The alias name
138
+ * @returns The alias record, or null if not found
139
+ */
140
+ getAlias(aliasName: string): Promise<AliasRecord<TID> | null>;
141
+ /**
142
+ * Check if an alias name is available for registration.
143
+ * @param aliasName - The alias name to check
144
+ * @returns True if the alias is available
145
+ */
146
+ isAliasAvailable(aliasName: string): Promise<boolean>;
147
+ /**
148
+ * Append an audit log entry.
149
+ * @param entry - The audit log entry to append
150
+ */
151
+ appendAuditEntry(entry: QuorumAuditLogEntry): Promise<void>;
152
+ /**
153
+ * Get the latest chained audit log entry (needed for chain linking).
154
+ * @returns The latest chained entry, or null if the log is empty
155
+ */
156
+ getLatestAuditEntry(): Promise<ChainedAuditLogEntry | null>;
157
+ /**
158
+ * Save a redistribution journal entry for rollback support.
159
+ * @param entry - The journal entry to save
160
+ */
161
+ saveJournalEntry(entry: RedistributionJournalEntry): Promise<void>;
162
+ /**
163
+ * Get all journal entries for a specific epoch.
164
+ * @param epochNumber - The epoch number
165
+ * @returns Array of journal entries for the epoch
166
+ */
167
+ getJournalEntries(epochNumber: number): Promise<RedistributionJournalEntry[]>;
168
+ /**
169
+ * Delete all journal entries for a specific epoch.
170
+ * @param epochNumber - The epoch number
171
+ */
172
+ deleteJournalEntries(epochNumber: number): Promise<void>;
173
+ /**
174
+ * Persist statute of limitations configuration.
175
+ * @param config - The configuration to save
176
+ */
177
+ saveStatuteConfig(config: StatuteOfLimitationsConfig): Promise<void>;
178
+ /**
179
+ * Get the current statute of limitations configuration.
180
+ * @returns The configuration, or null if not configured
181
+ */
182
+ getStatuteConfig(): Promise<StatuteOfLimitationsConfig | null>;
183
+ /**
184
+ * Persist the operational state (mode and current epoch).
185
+ * @param state - The operational state to save
186
+ */
187
+ saveOperationalState(state: OperationalState): Promise<void>;
188
+ /**
189
+ * Get the persisted operational state.
190
+ * @returns The operational state, or null if not yet initialized
191
+ */
192
+ getOperationalState(): Promise<OperationalState | null>;
193
+ /**
194
+ * Execute a function within a database transaction.
195
+ * If the function throws, the transaction is rolled back.
196
+ * @param fn - The function to execute within the transaction
197
+ * @returns The result of the function
198
+ */
199
+ withTransaction<R>(fn: () => Promise<R>): Promise<R>;
200
+ /**
201
+ * Check if the quorum database pool is available.
202
+ * Detects pool deletion/corruption on startup.
203
+ * @returns True if the database is available and healthy
204
+ */
205
+ isAvailable(): Promise<boolean>;
206
+ }
207
+ //# sourceMappingURL=quorumDatabase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quorumDatabase.d.ts","sourceRoot":"","sources":["../../../../../../brightchain-lib/src/lib/interfaces/services/quorumDatabase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IAGlE;;;OAGG;IACH,SA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AO,CAAC,IAAI,CAAC,CAAC;IAEnE;;;;OAIG;IACH,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAAC;IAE9E;;;OAGG;IACH,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAIzD;;;OAGG;IACH,iBAAiB,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAErE;;;OAGG;IACH,gBAAgB,IAAI,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAAC;IAI/D;;;OAGG;IACH,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7D;;;OAGG;IACH,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAIxD;;;;;OAKG;IACH,eAAe,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAIrD;;;;OAIG;IACH,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CACjC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview IQuorumDatabase interface.
4
+ *
5
+ * Abstraction over BrightChainDb with a dedicated "quorum-system" pool.
6
+ * Provides full CRUD for epochs, members, documents, proposals, votes,
7
+ * identity records, aliases, audit log, redistribution journal,
8
+ * statute config, operational state, transactions, and health check.
9
+ *
10
+ * @see Requirements 9, 10
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ //# sourceMappingURL=quorumDatabase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quorumDatabase.js","sourceRoot":"","sources":["../../../../../../brightchain-lib/src/lib/interfaces/services/quorumDatabase.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG"}
@@ -1,4 +1,5 @@
1
1
  import { GuidV4Uint8Array, Member, PlatformID, ShortHexGuid } from '@digitaldefiance/ecies-lib';
2
+ import { MemberStatusType } from '../../enumerations/memberStatusType';
2
3
  /**
3
4
  * Metadata for a quorum member
4
5
  */
@@ -16,6 +17,8 @@ export interface IQuorumMember<TID extends PlatformID = GuidV4Uint8Array> {
16
17
  publicKey: Uint8Array;
17
18
  metadata: QuorumMemberMetadata;
18
19
  isActive: boolean;
20
+ /** Member status for access control (banned/suspended checks). Defaults to Active. */
21
+ status?: MemberStatusType;
19
22
  createdAt: Date;
20
23
  updatedAt: Date;
21
24
  _platformId?: TID;
@@ -1 +1 @@
1
- {"version":3,"file":"quorumService.d.ts","sourceRoot":"","sources":["../../../../../../brightchain-lib/src/lib/interfaces/services/quorumService.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,MAAM,EACN,UAAU,EACV,YAAY,EACb,MAAM,4BAA4B,CAAC;AAEpC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa,CAAC,GAAG,SAAS,UAAU,GAAG,gBAAgB;IACtE,EAAE,EAAE,YAAY,CAAC;IACjB,SAAS,EAAE,UAAU,CAAC;IACtB,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAEhB,WAAW,CAAC,EAAE,GAAG,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,YAAY,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB,CACnC,GAAG,SAAS,UAAU,GAAG,gBAAgB;IAEzC,UAAU,EAAE,YAAY,CAA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MAAM,GACtB,OAAO,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC;IAItC;;;;;OAKG;IACH,cAAc,CAAC,CAAC,EACd,UAAU,EAAE,YAAY,EACxB,qBAAqB,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,GACnC,OAAO,CAAC,CAAC,CAAC,CAAC;IAId;;;;OAIG;IACH,WAAW,CAAC,UAAU,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAE1E;;;;OAIG;IACH,aAAa,CAAC,QAAQ,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAEtE;;;OAGG;IACH,cAAc,CAAC,UAAU,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExD;;;;;OAKG;IACH,SAAS,CACP,UAAU,EAAE,YAAY,EACxB,SAAS,EAAE,YAAY,EAAE,GACxB,OAAO,CAAC,eAAe,CAAC,CAAC;CAC7B"}
1
+ {"version":3,"file":"quorumService.d.ts","sourceRoot":"","sources":["../../../../../../brightchain-lib/src/lib/interfaces/services/quorumService.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,MAAM,EACN,UAAU,EACV,YAAY,EACb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa,CAAC,GAAG,SAAS,UAAU,GAAG,gBAAgB;IACtE,EAAE,EAAE,YAAY,CAAC;IACjB,SAAS,EAAE,UAAU,CAAC;IACtB,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,sFAAsF;IACtF,M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AS,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IAEtE;;;OAGG;IACH,WAAW,IAAI,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAI7C;;;;;;;OAOG;IACH,YAAY,CAAC,CAAC,EACZ,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,EAClB,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,YAAY,EAAE,EACzB,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC;IAItC;;;;;OAKG;IACH,cAAc,CAAC,CAAC,EACd,UAAU,EAAE,YAAY,EACxB,qBAAqB,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,GACnC,OAAO,CAAC,CAAC,CAAC,CAAC;IAId;;;;OAIG;IACH,WAAW,CAAC,UAAU,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAE1E;;;;OAIG;IACH,aAAa,CAAC,QAAQ,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAEtE;;;OAGG;IACH,cAAc,CAAC,UAAU,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExD;;;;;OAKG;IACH,SAAS,CACP,UAAU,EAAE,YAAY,EACxB,SAAS,EAAE,YAAY,EAAE,GACxB,OAAO,CAAC,eAAe,CAAC,CAAC;CAC7B"}
@@ -0,0 +1,128 @@
1
+ /**
2
+ * @fileoverview IQuorumStateMachine interface.
3
+ *
4
+ * Central coordinator for the quorum system. Manages operational mode,
5
+ * epoch lifecycle, proposal/vote orchestration, and delegates to
6
+ * SealingService for cryptographic operations.
7
+ *
8
+ * @see Requirements 1-7, 10-13
9
+ */
10
+ import { Member, PlatformID, ShortHexGuid } from '@digitaldefiance/ecies-lib';
11
+ import { QuorumOperationalMode } from '../../enumerations/quorumOperationalMode';
12
+ import { Proposal, ProposalInput } from '../proposal';
13
+ import { QuorumEpoch } from '../quorumEpoch';
14
+ import { QuorumMetrics } from '../quorumMetrics';
15
+ import { VoteInput } from '../vote';
16
+ import { QuorumMemberMetadata, SealedDocumentResult } from './quorumService';
17
+ import { RedistributionConfig } from './redistributionConfig';
18
+ /**
19
+ * Central quorum state machine interface.
20
+ *
21
+ * Replaces the current QuorumService as the central coordinator.
22
+ * Manages operational mode, epoch lifecycle, proposal/vote orchestration,
23
+ * and delegates to SealingService for cryptographic operations.
24
+ *
25
+ * @template TID - Platform ID type for frontend/backend DTO compatibility
26
+ */
27
+ export interface IQuorumStateMachine<TID extends PlatformID = Uint8Array> {
28
+ /**
29
+ * Get the current operational mode of the quorum system.
30
+ * @returns The current mode (Bootstrap, Quorum, or TransitionInProgress)
31
+ */
32
+ getMode(): Promise<QuorumOperationalMode>;
33
+ /**
34
+ * Initialize the quorum system with an initial set of members and threshold.
35
+ * Enters Bootstrap mode if members < threshold, Quorum mode otherwise.
36
+ * Detects TransitionInProgress on startup and triggers rollback recovery.
37
+ * @param members - Initial member set
38
+ * @param threshold - Configured quorum threshold
39
+ * @returns The initial QuorumEpoch
40
+ */
41
+ initialize(members: Member<TID>[], threshold: number): Promise<QuorumEpoch<TID>>;
42
+ /**
43
+ * Initiate a transition ceremony from Bootstrap to Quorum mode.
44
+ * Verifies member count >= threshold, blocks operations, and re-splits
45
+ * all bootstrap-sealed documents.
46
+ * @throws QuorumError with TransitionInProgress if already transitioning
47
+ * @throws QuorumError with InsufficientMembersForTransition if members < threshold
48
+ */
49
+ initiateTransition(): Promise<void>;
50
+ /**
51
+ * Add a new member to the quorum.
52
+ * Increments epoch, triggers share redistribution for all documents,
53
+ * and emits audit entries.
54
+ * @param member - The member to add
55
+ * @param metadata - Metadata for the member
56
+ * @param redistributionConfig - Optional redistribution configuration
57
+ * @returns The new QuorumEpoch after member addition
58
+ */
59
+ addMember(member: Member<TID>, metadata: QuorumMemberMetadata, redistributionConfig?: Partial<RedistributionConfig>): Promise<QuorumEpoch<TID>>;
60
+ /**
61
+ * Remove a member from the quorum.
62
+ * Validates remaining count >= threshold, increments epoch,
63
+ * triggers share redistribution with fresh polynomial coefficients,
64
+ * and emits audit entries.
65
+ * @param memberId - ID of the member to remove
66
+ * @param redistributionConfig - Optional redistribution configuration
67
+ * @returns The new QuorumEpoch after member removal
68
+ * @throws QuorumError with InsufficientRemainingMembers if removal would drop below threshold
69
+ */
70
+ removeMember(memberId: ShortHexGuid, redistributionConfig?: Partial<RedistributionConfig>): Promise<QuorumEpoch<TID>>;
71
+ /**
72
+ * Submit a proposal for quorum voting.
73
+ * Validates proposer, assigns ID, stores as pending, announces via gossip.
74
+ * @param proposal - The proposal input
75
+ * @returns The created Proposal with assigned ID and status
76
+ */
77
+ submitProposal(proposal: ProposalInput<TID>): Promise<Proposal<TID>>;
78
+ /**
79
+ * Submit a vote on a pending proposal.
80
+ * Validates voter is active member on proposal, checks for duplicates,
81
+ * stores vote, announces via gossip.
82
+ * @param vote - The vote input
83
+ */
84
+ submitVote(vote: VoteInput<TID>): Promise<void>;
85
+ /**
86
+ * Get a proposal by its ID.
87
+ * @param proposalId - The proposal ID
88
+ * @returns The proposal, or null if not found
89
+ */
90
+ getProposal(proposalId: ShortHexGuid): Promise<Proposal<TID> | null>;
91
+ /**
92
+ * Seal a document so it can only be accessed when enough quorum members agree.
93
+ * Delegates to SealingService with bootstrap or quorum parameters.
94
+ * Tags document with epoch and sealedUnderBootstrap flag.
95
+ * @param agent - The member performing the sealing operation
96
+ * @param document - The document to seal
97
+ * @param memberIds - IDs of members who will receive shares
98
+ * @param sharesRequired - Optional number of shares required to unseal
99
+ * @returns The sealed document result
100
+ */
101
+ sealDocument<T>(agent: Member<TID>, document: T, memberIds: ShortHexGuid[], sharesRequired?: number): Promise<SealedDocumentResult<TID>>;
102
+ /**
103
+ * Unseal a document using member shares.
104
+ * Verifies checksum (SHA-3) and creator signature using constant-time
105
+ * comparison before delegating to SealingService.
106
+ * @param documentId - The ID of the document to unseal
107
+ * @param membersWithPrivateKey - Members with loaded private keys for decryption
108
+ * @returns The unsealed document
109
+ */
110
+ unsealDocument<T>(documentId: ShortHexGuid, membersWithPrivateKey: Member<TID>[]): Promise<T>;
111
+ /**
112
+ * Get the current epoch.
113
+ * @returns The current QuorumEpoch
114
+ */
115
+ getCurrentEpoch(): Promise<QuorumEpoch<TID>>;
116
+ /**
117
+ * Get a specific epoch by number.
118
+ * @param epochNumber - The epoch number to retrieve
119
+ * @returns The QuorumEpoch, or null if not found
120
+ */
121
+ getEpoch(epochNumber: number): Promise<QuorumEpoch<TID> | null>;
122
+ /**
123
+ * Get quorum system metrics for monitoring.
124
+ * @returns QuorumMetrics with proposal, vote, redistribution, member, epoch, and expiration stats
125
+ */
126
+ getMetrics(): Promise<QuorumMetrics>;
127
+ }
128
+ //# sourceMappingURL=quorumStateMachine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quorumStateMachine.d.ts","sourceRoot":"","sources":["../../../../../../brightchain-lib/src/lib/interfaces/services/quorumStateMachine.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAA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AAM,GACtB,OAAO,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC;IAEtC;;;;;;;OAOG;IACH,cAAc,CAAC,CAAC,EACd,UAAU,EAAE,YAAY,EACxB,qBAAqB,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,GACnC,OAAO,CAAC,CAAC,CAAC,CAAC;IAEd;;;OAGG;IACH,eAAe,IAAI,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IAE7C;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IAEhE;;;OAGG;IACH,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;CACtC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview IQuorumStateMachine interface.
4
+ *
5
+ * Central coordinator for the quorum system. Manages operational mode,
6
+ * epoch lifecycle, proposal/vote orchestration, and delegates to
7
+ * SealingService for cryptographic operations.
8
+ *
9
+ * @see Requirements 1-7, 10-13
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ //# sourceMappingURL=quorumStateMachine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quorumStateMachine.js","sourceRoot":"","sources":["../../../../../../brightchain-lib/src/lib/interfaces/services/quorumStateMachine.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @fileoverview RedistributionConfig interface.
3
+ *
4
+ * Configuration for batched share redistribution operations.
5
+ *
6
+ * @see Requirements 3, 4, 12.3
7
+ */
8
+ import { ShortHexGuid } from '@digitaldefiance/ecies-lib';
9
+ /**
10
+ * Configuration for batched share redistribution.
11
+ */
12
+ export interface RedistributionConfig {
13
+ /** Number of documents to process per batch. Default: 100 */
14
+ batchSize: number;
15
+ /** Callback for progress reporting */
16
+ onProgress?: (processed: number, total: number, failed: ShortHexGuid[]) => void;
17
+ /** Whether to continue on individual document failure. Default: true */
18
+ continueOnFailure: boolean;
19
+ }
20
+ //# sourceMappingURL=redistributionConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redistributionConfig.d.ts","sourceRoot":"","sources":["../../../../../../brightchain-lib/src/lib/interfaces/services/redistributionConfig.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,UAAU,CAAC,EAAE,CACX,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,YAAY,EAAE,KACnB,IAAI,CAAC;IACV,wEAAwE;IACxE,iBAAiB,EAAE,OAAO,CAAC;CAC5B"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview RedistributionConfig interface.
4
+ *
5
+ * Configuration for batched share redistribution operations.
6
+ *
7
+ * @see Requirements 3, 4, 12.3
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ //# sourceMappingURL=redistributionConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redistributionConfig.js","sourceRoot":"","sources":["../../../../../../brightchain-lib/src/lib/interfaces/services/redistributionConfig.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @fileoverview StatuteOfLimitationsConfig interface.
3
+ *
4
+ * Configuration for the digital statute of limitations that controls
5
+ * when identity recovery shards are permanently deleted.
6
+ *
7
+ * @see Requirements 17
8
+ */
9
+ /**
10
+ * Default fallback duration for statute of limitations: 7 years in milliseconds.
11
+ */
12
+ export declare const DEFAULT_STATUTE_FALLBACK_DURATION_MS: number;
13
+ /**
14
+ * Configuration for the digital statute of limitations.
15
+ */
16
+ export interface StatuteOfLimitationsConfig {
17
+ /** Default expiration duration per content type (e.g., 'post', 'message', 'financial_record'), in milliseconds */
18
+ defaultDurations: Map<string, number>;
19
+ /** Fallback duration if content type is not configured. Default: 7 years (~220,898,800,000 ms) */
20
+ fallbackDurationMs: number;
21
+ }
22
+ //# sourceMappingURL=statuteConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statuteConfig.d.ts","sourceRoot":"","sources":["../../../../../brightchain-lib/src/lib/interfaces/statuteConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH;;GAEG;AACH,eAAO,MAAM,oCAAoC,QAAiB,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,kHAAkH;IAClH,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,kGAAkG;IAClG,kBAAkB,EAAE,MAAM,CAAC;CAC5B"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview StatuteOfLimitationsConfig interface.
4
+ *
5
+ * Configuration for the digital statute of limitations that controls
6
+ * when identity recovery shards are permanently deleted.
7
+ *
8
+ * @see Requirements 17
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.DEFAULT_STATUTE_FALLBACK_DURATION_MS = void 0;
12
+ /** Seven years in milliseconds (default fallback duration) */
13
+ const SEVEN_YEARS_MS = 7 * 365.25 * 24 * 60 * 60 * 1000;
14
+ /**
15
+ * Default fallback duration for statute of limitations: 7 years in milliseconds.
16
+ */
17
+ exports.DEFAULT_STATUTE_FALLBACK_DURATION_MS = SEVEN_YEARS_MS;
18
+ //# sourceMappingURL=statuteConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statuteConfig.js","sourceRoot":"","sources":["../../../../../brightchain-lib/src/lib/interfaces/statuteConfig.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,8DAA8D;AAC9D,MAAM,cAAc,GAAG,CAAC,GAAG,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAExD;;GAEG;AACU,QAAA,oCAAoC,GAAG,cAAc,CAAC"}
@@ -1,37 +1,59 @@
1
1
  /**
2
- * Minimal document store abstraction that BrightChainDb can satisfy
3
- * without brightchain-lib depending on brightchain-db.
2
+ * Minimal typed-collection abstraction that the Model system in
3
+ * brightchain-db naturally satisfies.
4
4
  *
5
5
  * This keeps the dependency direction clean:
6
6
  * brightchain-db depends on brightchain-lib (not the reverse).
7
+ *
8
+ * EnergyAccountStore (in brightchain-lib) depends only on this interface,
9
+ * so it can work with any backend that provides typed find/replaceOne/deleteOne
10
+ * with automatic hydration/dehydration.
7
11
  */
8
12
  /**
9
- * A cursor-like result from a find operation.
13
+ * A cursor-like result from a find operation that yields typed documents.
10
14
  */
11
- export interface IDocumentCursor<T> {
12
- toArray(): Promise<T[]>;
15
+ export interface ITypedCursor<TTyped> {
16
+ toArray(): Promise<TTyped[]>;
13
17
  }
14
18
  /**
15
- * Minimal collection interface for document CRUD operations.
16
- * Intentionally simpler than the full ICollection from node-express-suite
17
- * to avoid coupling EnergyAccountStore to MongoDB-specific contracts.
19
+ * A typed collection that automatically hydrates reads and dehydrates writes.
20
+ *
21
+ * This is the interface that Model<TStored, TTyped> in brightchain-db
22
+ * satisfies. EnergyAccountStore depends on this rather than on the
23
+ * concrete Model class, keeping brightchain-lib free of brightchain-db imports.
24
+ *
25
+ * TStored is the shape of documents in the database (flat DTO).
26
+ * TTyped is the shape your application code works with (rich objects).
18
27
  */
19
- export interface IDocumentCollection<T> {
20
- find(filter: Partial<T>): Promise<IDocumentCursor<T>>;
21
- replaceOne(filter: Partial<T>, doc: T, options?: {
28
+ export interface ITypedCollection<TStored, TTyped> {
29
+ /**
30
+ * Find documents matching a filter on stored field names/values.
31
+ * Returns a cursor that yields hydrated (TTyped) documents.
32
+ */
33
+ find(filter?: Partial<TStored>): ITypedCursor<TTyped>;
34
+ /**
35
+ * Find a single document matching a filter.
36
+ * Returns the hydrated document or null.
37
+ */
38
+ findOne(filter?: Partial<TStored>): Promise<TTyped | null>;
39
+ /**
40
+ * Replace a single document matching the filter with a typed replacement.
41
+ * The implementation dehydrates the replacement before writing.
42
+ */
43
+ replaceOne(filter: Partial<TStored>, replacement: TTyped, options?: {
22
44
  upsert?: boolean;
23
- }): Promise<void>;
24
- deleteOne(filter: Partial<T>): Promise<boolean>;
25
- }
26
- /**
27
- * Minimal document store interface for connection lifecycle and
28
- * collection access. BrightChainDb implements this so that
29
- * EnergyAccountStore (in brightchain-lib) can persist without
30
- * importing brightchain-db directly.
31
- */
32
- export interface IDocumentStore {
33
- collection<T>(name: string): IDocumentCollection<T>;
34
- connect(uri?: string): Promise<void>;
35
- isConnected(): boolean;
45
+ }): Promise<unknown>;
46
+ /**
47
+ * Delete a single document matching the filter.
48
+ */
49
+ deleteOne(filter: Partial<TStored>): Promise<unknown>;
50
+ /**
51
+ * Convert a typed document to its stored form (for manual operations).
52
+ */
53
+ dehydrate(typed: TTyped): TStored;
54
+ /**
55
+ * Convert a stored document to its typed form (for manual operations).
56
+ */
57
+ hydrate(stored: TStored): TTyped;
36
58
  }
37
59
  //# sourceMappingURL=documentStore.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"documentStore.d.ts","sourceRoot":"","sources":["../../../../../../brightchain-lib/src/lib/interfaces/storage/documentStore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,OAAO,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,UAAU,CACR,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAClB,GAAG,EAAE,CAAC,EACN,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,GAC7B,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACjD;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,WAAW,IAAI,OAAO,CAAC;CACxB"}
1
+ {"version":3,"file":"documentStore.d.ts","sourceRoot":"","sources":["../../../../../../brightchain-lib/src/lib/interfaces/storage/documentStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,MAAM;IAClC,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CAC9B;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,gBAAgB,CAAC,OAAO,EAAE,MAAM;IAC/C;;;OAGG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAEtD;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAE3D;;;OAGG;IACH,UAAU,CACR,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,EACxB,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,GAC7B,OAAO,CAAC,OAAO,CAAC,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtD;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IAElC;;OAEG;IACH,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC;CAClC"}
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
2
  /**
3
- * Minimal document store abstraction that BrightChainDb can satisfy
4
- * without brightchain-lib depending on brightchain-db.
3
+ * Minimal typed-collection abstraction that the Model system in
4
+ * brightchain-db naturally satisfies.
5
5
  *
6
6
  * This keeps the dependency direction clean:
7
7
  * brightchain-db depends on brightchain-lib (not the reverse).
8
+ *
9
+ * EnergyAccountStore (in brightchain-lib) depends only on this interface,
10
+ * so it can work with any backend that provides typed find/replaceOne/deleteOne
11
+ * with automatic hydration/dehydration.
8
12
  */
9
13
  Object.defineProperty(exports, "__esModule", { value: true });
10
14
  //# sourceMappingURL=documentStore.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"documentStore.js","sourceRoot":"","sources":["../../../../../../brightchain-lib/src/lib/interfaces/storage/documentStore.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG"}
1
+ {"version":3,"file":"documentStore.js","sourceRoot":"","sources":["../../../../../../brightchain-lib/src/lib/interfaces/storage/documentStore.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG"}