@safetech/inheriti-client-sdk 1.0.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 (257) hide show
  1. package/README.md +22 -0
  2. package/dist/index.d.ts +4 -0
  3. package/dist/index.js +2 -0
  4. package/dist/src/modules/_shared/domain/contexts/data-provider-context.d.ts +2 -0
  5. package/dist/src/modules/_shared/domain/contexts/service-provider-context.d.ts +2 -0
  6. package/dist/src/modules/_shared/domain/contexts/utils-provider-context.d.ts +5 -0
  7. package/dist/src/modules/_shared/domain/errors/getErrorMessage.d.ts +1 -0
  8. package/dist/src/modules/_shared/domain/hooks/resources/use-create.d.ts +18 -0
  9. package/dist/src/modules/_shared/domain/hooks/resources/use-delete.d.ts +19 -0
  10. package/dist/src/modules/_shared/domain/hooks/resources/use-get-list.d.ts +25 -0
  11. package/dist/src/modules/_shared/domain/hooks/resources/use-get-one.d.ts +17 -0
  12. package/dist/src/modules/_shared/domain/hooks/use-data-provider.d.ts +2 -0
  13. package/dist/src/modules/_shared/domain/hooks/use-repository.d.ts +1 -0
  14. package/dist/src/modules/_shared/domain/hooks/use-service-provider.d.ts +2 -0
  15. package/dist/src/modules/_shared/domain/hooks/use-service.d.ts +1 -0
  16. package/dist/src/modules/_shared/domain/hooks/utils-hooks.d.ts +4 -0
  17. package/dist/src/modules/_shared/domain/models/app-utils.d.ts +10 -0
  18. package/dist/src/modules/_shared/domain/models/currency-price.d.ts +39 -0
  19. package/dist/src/modules/_shared/domain/models/currency.d.ts +24 -0
  20. package/dist/src/modules/_shared/domain/models/euro-currency.d.ts +3 -0
  21. package/dist/src/modules/_shared/domain/models/mutation-options.d.ts +8 -0
  22. package/dist/src/modules/_shared/domain/models/mutation.d.ts +5 -0
  23. package/dist/src/modules/_shared/domain/models/pagination-options.d.ts +4 -0
  24. package/dist/src/modules/_shared/domain/models/query-options.d.ts +6 -0
  25. package/dist/src/modules/_shared/domain/models/query.d.ts +5 -0
  26. package/dist/src/modules/_shared/domain/models/resource-count.d.ts +3 -0
  27. package/dist/src/modules/_shared/domain/models/sort-options.d.ts +4 -0
  28. package/dist/src/modules/_shared/domain/models/use-mutation-value.d.ts +13 -0
  29. package/dist/src/modules/_shared/domain/models/use-query-value.d.ts +11 -0
  30. package/dist/src/modules/_shared/domain/services/mutation-creator.d.ts +6 -0
  31. package/dist/src/modules/_shared/domain/services/query-creator.d.ts +6 -0
  32. package/dist/src/modules/_shared/domain/utils/misc/array-utils.d.ts +48 -0
  33. package/dist/src/modules/_shared/domain/utils/misc/datetime-utils.d.ts +40 -0
  34. package/dist/src/modules/_shared/domain/utils/misc/encrypt-utils.d.ts +17 -0
  35. package/dist/src/modules/_shared/domain/utils/misc/number-utils.d.ts +4 -0
  36. package/dist/src/modules/_shared/domain/utils/misc/object-utils.d.ts +76 -0
  37. package/dist/src/modules/_shared/domain/utils/misc/text-utils.d.ts +7 -0
  38. package/dist/src/modules/_shared/domain/utils/misc/uuid-utils.d.ts +6 -0
  39. package/dist/src/modules/_shared/infrastructure/api/api-repository.d.ts +36 -0
  40. package/dist/src/modules/_shared/infrastructure/api/app-payload-encrypter.d.ts +9 -0
  41. package/dist/src/modules/_shared/infrastructure/http/HttpError.d.ts +7 -0
  42. package/dist/src/modules/_shared/infrastructure/http/fetch.d.ts +48 -0
  43. package/dist/src/modules/_shared/infrastructure/local-storage/browser-local-storage.d.ts +9 -0
  44. package/dist/src/modules/_shared/infrastructure/providers/app-data-provider.d.ts +20 -0
  45. package/dist/src/modules/_shared/infrastructure/providers/app-provider.d.ts +15 -0
  46. package/dist/src/modules/_shared/infrastructure/providers/app-service-provider.d.ts +28 -0
  47. package/dist/src/modules/_shared/infrastructure/providers/app-utils-provider.d.ts +175 -0
  48. package/dist/src/modules/_shared/infrastructure/providers/inheriti-client-provider.d.ts +46 -0
  49. package/dist/src/modules/_shared/infrastructure/secure-storage/app-secure-storage.d.ts +8 -0
  50. package/dist/src/modules/_shared/infrastructure/services/hexEncoder.d.ts +4 -0
  51. package/dist/src/modules/_shared/infrastructure/services/react-q-query-creator.d.ts +7 -0
  52. package/dist/src/modules/_shared/infrastructure/services/react-query-mutation-creator.d.ts +7 -0
  53. package/dist/src/modules/_shared/infrastructure/services/safeshareLegacy.d.ts +29 -0
  54. package/dist/src/modules/_shared/infrastructure/session-storage/browser-session-storage.d.ts +12 -0
  55. package/dist/src/modules/_shared/infrastructure/utils/context-selector.d.ts +2 -0
  56. package/dist/src/modules/_shared/infrastructure/utils/get-api-url.d.ts +1 -0
  57. package/dist/src/modules/_shared/infrastructure/utils/set-query-params.d.ts +5 -0
  58. package/dist/src/modules/auth/application/use-auth-dispatch.d.ts +1 -0
  59. package/dist/src/modules/auth/application/use-auth-provider.d.ts +4 -0
  60. package/dist/src/modules/auth/application/use-auth-state.d.ts +1 -0
  61. package/dist/src/modules/auth/application/use-client.d.ts +27 -0
  62. package/dist/src/modules/auth/application/use-ensure-connected-client.d.ts +3 -0
  63. package/dist/src/modules/auth/application/use-get-identity.d.ts +36 -0
  64. package/dist/src/modules/auth/application/use-is-logged-in.d.ts +8 -0
  65. package/dist/src/modules/auth/application/use-login-client.d.ts +6 -0
  66. package/dist/src/modules/auth/application/use-logout-client.d.ts +5 -0
  67. package/dist/src/modules/auth/domain/contexts/auth-provider-context.d.ts +2 -0
  68. package/dist/src/modules/auth/domain/models/auth-credentials.d.ts +3 -0
  69. package/dist/src/modules/auth/domain/models/user-identity.d.ts +28 -0
  70. package/dist/src/modules/auth/domain/services/auth-provider.d.ts +16 -0
  71. package/dist/src/modules/auth/index.d.ts +6 -0
  72. package/dist/src/modules/auth/infrastructure/providers/app-auth-provider.d.ts +30 -0
  73. package/dist/src/modules/auth/infrastructure/providers/app-identity-service.d.ts +9 -0
  74. package/dist/src/modules/auth/infrastructure/providers/auth-constants.d.ts +6 -0
  75. package/dist/src/modules/beneficiary/domain/models/beneficiary-device.d.ts +28 -0
  76. package/dist/src/modules/beneficiary/domain/models/beneficiary-relation.d.ts +13 -0
  77. package/dist/src/modules/beneficiary/domain/models/beneficiary-type.d.ts +16 -0
  78. package/dist/src/modules/beneficiary/domain/models/beneficiary.d.ts +54 -0
  79. package/dist/src/modules/beneficiary/index.d.ts +1 -0
  80. package/dist/src/modules/beneficiary/infrastructure/mappers/beneficiary-mapper.d.ts +6 -0
  81. package/dist/src/modules/protection-plan/application/configuration-process/blockchain/use-create-smart-contract.d.ts +9 -0
  82. package/dist/src/modules/protection-plan/application/configuration-process/plan-shares/creation/use-create-backup-shares.d.ts +6 -0
  83. package/dist/src/modules/protection-plan/application/configuration-process/plan-shares/creation/use-create-cold-shares.d.ts +6 -0
  84. package/dist/src/modules/protection-plan/application/configuration-process/plan-shares/creation/use-create-mobile-shares.d.ts +6 -0
  85. package/dist/src/modules/protection-plan/application/configuration-process/plan-shares/creation/use-create-validator-shares.d.ts +6 -0
  86. package/dist/src/modules/protection-plan/application/configuration-process/plan-shares/distribution/use-distribute-backup-shares.d.ts +9 -0
  87. package/dist/src/modules/protection-plan/application/configuration-process/plan-shares/distribution/use-distribute-cold-share.d.ts +8 -0
  88. package/dist/src/modules/protection-plan/application/configuration-process/plan-shares/distribution/use-distribute-mobile-shares.d.ts +9 -0
  89. package/dist/src/modules/protection-plan/application/configuration-process/plan-shares/distribution/use-distribute-validator-shares.d.ts +9 -0
  90. package/dist/src/modules/protection-plan/application/configuration-process/use-configure-plan.d.ts +12 -0
  91. package/dist/src/modules/protection-plan/application/configuration-process/use-delete-plan-configuration-process.d.ts +8 -0
  92. package/dist/src/modules/protection-plan/application/configuration-process/use-get-plan-configuration-process.d.ts +12 -0
  93. package/dist/src/modules/protection-plan/application/configuration-process/use-save-plan-creation-process.d.ts +9 -0
  94. package/dist/src/modules/protection-plan/application/creation/use-create-protection-plan.d.ts +24 -0
  95. package/dist/src/modules/protection-plan/application/creation/use-get-available-plan-triggers.d.ts +3 -0
  96. package/dist/src/modules/protection-plan/application/creation/use-get-protection-plan-security-level.d.ts +47 -0
  97. package/dist/src/modules/protection-plan/application/creation/use-persist-protection-plan.d.ts +10 -0
  98. package/dist/src/modules/protection-plan/application/listing/use-find-protection-plan-summary-by-criteria.d.ts +13 -0
  99. package/dist/src/modules/protection-plan/application/listing/use-find-protection-plans-by-criteria.d.ts +15 -0
  100. package/dist/src/modules/protection-plan/application/listing/use-get-protection-plan-summary.d.ts +13 -0
  101. package/dist/src/modules/protection-plan/application/listing/use-is-merge-authority-mode.d.ts +3 -0
  102. package/dist/src/modules/protection-plan/application/listing/use-protection-plan-listener.d.ts +25 -0
  103. package/dist/src/modules/protection-plan/application/merging-process/merge-authority/use-authorize-merge-authority.d.ts +13 -0
  104. package/dist/src/modules/protection-plan/application/merging-process/merge-authority/use-get-merge-authority-protection-plan.d.ts +12 -0
  105. package/dist/src/modules/protection-plan/application/merging-process/merge-authority/use-merge-authority-merge-process-events.d.ts +6 -0
  106. package/dist/src/modules/protection-plan/application/merging-process/merge-triggers/use-retry-active-merge-trigger.d.ts +10 -0
  107. package/dist/src/modules/protection-plan/application/merging-process/merge-triggers/use-validate-merge-trigger.d.ts +12 -0
  108. package/dist/src/modules/protection-plan/application/merging-process/plan-shares/collection/use-collect-backup-shares.d.ts +9 -0
  109. package/dist/src/modules/protection-plan/application/merging-process/plan-shares/collection/use-collect-cold-share.d.ts +8 -0
  110. package/dist/src/modules/protection-plan/application/merging-process/plan-shares/collection/use-collect-mobile-shares.d.ts +5 -0
  111. package/dist/src/modules/protection-plan/application/merging-process/plan-shares/collection/use-collect-released-mobile-shares.d.ts +9 -0
  112. package/dist/src/modules/protection-plan/application/merging-process/plan-shares/collection/use-collect-validator-shares.d.ts +9 -0
  113. package/dist/src/modules/protection-plan/application/merging-process/plan-shares/use-check-can-collect-shares.d.ts +2 -0
  114. package/dist/src/modules/protection-plan/application/merging-process/plan-shares/use-save-release-mobile-share-request.d.ts +11 -0
  115. package/dist/src/modules/protection-plan/application/merging-process/plan-shares/use-send-plan-share-merge-status-event.d.ts +15 -0
  116. package/dist/src/modules/protection-plan/application/merging-process/plan-shares/use-send-plan-shares-merged.d.ts +10 -0
  117. package/dist/src/modules/protection-plan/application/merging-process/use-close-protection-plan.d.ts +10 -0
  118. package/dist/src/modules/protection-plan/application/merging-process/use-create-merging-process.d.ts +9 -0
  119. package/dist/src/modules/protection-plan/application/merging-process/use-delete-merging-process-by-criteria.d.ts +11 -0
  120. package/dist/src/modules/protection-plan/application/merging-process/use-delete-merging-process.d.ts +10 -0
  121. package/dist/src/modules/protection-plan/application/merging-process/use-get-merging-process-by-plan.d.ts +23 -0
  122. package/dist/src/modules/protection-plan/application/merging-process/use-merge-plan-beneficiary-selection.d.ts +27 -0
  123. package/dist/src/modules/protection-plan/application/merging-process/use-persist-merge-process.d.ts +12 -0
  124. package/dist/src/modules/protection-plan/application/merging-process/use-reveal-plan-data.d.ts +13 -0
  125. package/dist/src/modules/protection-plan/application/merging-process/use-save-merging-process.d.ts +9 -0
  126. package/dist/src/modules/protection-plan/application/merging-process/use-scan-plans-from-merge-authority-device.d.ts +10 -0
  127. package/dist/src/modules/protection-plan/application/merging-process/use-shareholder-merge-process-events.d.ts +2 -0
  128. package/dist/src/modules/protection-plan/domain/dto/plan-dto.d.ts +68 -0
  129. package/dist/src/modules/protection-plan/domain/dto/protection-plan-input.d.ts +173 -0
  130. package/dist/src/modules/protection-plan/domain/models/app-process.d.ts +29 -0
  131. package/dist/src/modules/protection-plan/domain/models/backup/backup-plan.d.ts +18 -0
  132. package/dist/src/modules/protection-plan/domain/models/backup/backup-shareholder.d.ts +9 -0
  133. package/dist/src/modules/protection-plan/domain/models/client/protection-plan-summary.d.ts +218 -0
  134. package/dist/src/modules/protection-plan/domain/models/data-asset.d.ts +113 -0
  135. package/dist/src/modules/protection-plan/domain/models/device-share-info.d.ts +10 -0
  136. package/dist/src/modules/protection-plan/domain/models/inheritance/heir.d.ts +9 -0
  137. package/dist/src/modules/protection-plan/domain/models/inheritance/inheritance-plan.d.ts +16 -0
  138. package/dist/src/modules/protection-plan/domain/models/merging-process/active-merge-process.d.ts +15 -0
  139. package/dist/src/modules/protection-plan/domain/models/merging-process/merging-process.d.ts +135 -0
  140. package/dist/src/modules/protection-plan/domain/models/plan-creation-proccess/plan-creation-process.d.ts +69 -0
  141. package/dist/src/modules/protection-plan/domain/models/plan-share.d.ts +69 -0
  142. package/dist/src/modules/protection-plan/domain/models/proccess-step.d.ts +21 -0
  143. package/dist/src/modules/protection-plan/domain/models/protection-plan-details.d.ts +70 -0
  144. package/dist/src/modules/protection-plan/domain/models/protection-plan-passphrase.d.ts +18 -0
  145. package/dist/src/modules/protection-plan/domain/models/protection-plan.d.ts +238 -0
  146. package/dist/src/modules/protection-plan/domain/models/shareholder.d.ts +32 -0
  147. package/dist/src/modules/protection-plan/domain/models/storage-option.d.ts +29 -0
  148. package/dist/src/modules/protection-plan/domain/models/trigger-settings-info.d.ts +6 -0
  149. package/dist/src/modules/protection-plan/domain/models/trigger.d.ts +46 -0
  150. package/dist/src/modules/protection-plan/domain/repositories/merge-authority-protection-plan-repository.d.ts +13 -0
  151. package/dist/src/modules/protection-plan/domain/repositories/merging-process-repository.d.ts +62 -0
  152. package/dist/src/modules/protection-plan/domain/repositories/plan-creation-repository.d.ts +7 -0
  153. package/dist/src/modules/protection-plan/domain/repositories/plan-security-repository.d.ts +7 -0
  154. package/dist/src/modules/protection-plan/domain/repositories/plan-triggers-repository.d.ts +4 -0
  155. package/dist/src/modules/protection-plan/domain/repositories/protection-plan-repository.d.ts +24 -0
  156. package/dist/src/modules/protection-plan/domain/services/blockchain-service.d.ts +32 -0
  157. package/dist/src/modules/protection-plan/domain/services/input-validation/PlanTypeInputValidator.d.ts +4 -0
  158. package/dist/src/modules/protection-plan/domain/services/input-validation/plan-beneficiaries-input-validator.d.ts +240 -0
  159. package/dist/src/modules/protection-plan/domain/services/input-validation/plan-data-assets-input-validator.d.ts +1108 -0
  160. package/dist/src/modules/protection-plan/domain/services/input-validation/plan-details-input-validator.d.ts +23 -0
  161. package/dist/src/modules/protection-plan/domain/services/input-validation/plan-shares-configuration-input-validator.d.ts +13 -0
  162. package/dist/src/modules/protection-plan/domain/services/input-validation/plan-storage-configuration-input-validator.d.ts +25 -0
  163. package/dist/src/modules/protection-plan/domain/services/input-validation/plan-triggers-input-validator.d.ts +105 -0
  164. package/dist/src/modules/protection-plan/domain/services/input-validation/utils/index.d.ts +3 -0
  165. package/dist/src/modules/protection-plan/domain/services/merge-authorization-handler.d.ts +14 -0
  166. package/dist/src/modules/protection-plan/domain/services/merge-process-event-listener.d.ts +14 -0
  167. package/dist/src/modules/protection-plan/domain/services/plan-data-assets-manager.d.ts +69 -0
  168. package/dist/src/modules/protection-plan/domain/services/plan-data-revealer.d.ts +5 -0
  169. package/dist/src/modules/protection-plan/domain/services/plan-event-listener.d.ts +10 -0
  170. package/dist/src/modules/protection-plan/domain/services/plan-merge-threshold-range-calculator.d.ts +8 -0
  171. package/dist/src/modules/protection-plan/domain/services/plan-recovery-shares-range-calculator.d.ts +8 -0
  172. package/dist/src/modules/protection-plan/domain/services/plan-shares-generator.d.ts +18 -0
  173. package/dist/src/modules/protection-plan/domain/services/vault-service.d.ts +10 -0
  174. package/dist/src/modules/protection-plan/domain/utils/plan-details-mapper.d.ts +12 -0
  175. package/dist/src/modules/protection-plan/domain/utils/plan-shares-details-mapper.d.ts +10 -0
  176. package/dist/src/modules/protection-plan/domain/utils/plan-triggers-details-mapper.d.ts +5 -0
  177. package/dist/src/modules/protection-plan/domain/utils/protection-plan-internal-mapper.d.ts +5 -0
  178. package/dist/src/modules/protection-plan/index.d.ts +28 -0
  179. package/dist/src/modules/protection-plan/infrastructure/mappers/backup-shareholder-mapper.d.ts +7 -0
  180. package/dist/src/modules/protection-plan/infrastructure/mappers/draft-protection-plan-mapper.d.ts +8 -0
  181. package/dist/src/modules/protection-plan/infrastructure/mappers/heir-mapper.d.ts +7 -0
  182. package/dist/src/modules/protection-plan/infrastructure/mappers/merging-process-mapper.d.ts +5 -0
  183. package/dist/src/modules/protection-plan/infrastructure/mappers/plan-creation-mapper.d.ts +5 -0
  184. package/dist/src/modules/protection-plan/infrastructure/mappers/protection-plan-filters-mapper.d.ts +4 -0
  185. package/dist/src/modules/protection-plan/infrastructure/mappers/protection-plan-mapper.d.ts +10 -0
  186. package/dist/src/modules/protection-plan/infrastructure/repositories/app-merging-process-repository.d.ts +65 -0
  187. package/dist/src/modules/protection-plan/infrastructure/repositories/app-plan-creation-repository.d.ts +12 -0
  188. package/dist/src/modules/protection-plan/infrastructure/repositories/app-plan-security-repository.d.ts +11 -0
  189. package/dist/src/modules/protection-plan/infrastructure/repositories/app-plan-triggers-repository.d.ts +10 -0
  190. package/dist/src/modules/protection-plan/infrastructure/repositories/protection-plan/app-merge-authority-protection-plan-repository.d.ts +17 -0
  191. package/dist/src/modules/protection-plan/infrastructure/repositories/protection-plan/app-protection-plan-repository.d.ts +13 -0
  192. package/dist/src/modules/protection-plan/infrastructure/services/app-blockchain-service.d.ts +42 -0
  193. package/dist/src/modules/protection-plan/infrastructure/services/app-plan-data-revealer.d.ts +14 -0
  194. package/dist/src/modules/protection-plan/infrastructure/services/app-plan-shares-generator.d.ts +5 -0
  195. package/dist/src/modules/protection-plan/infrastructure/services/constants/device-constants.d.ts +1 -0
  196. package/dist/src/modules/protection-plan/infrastructure/services/inheriti-vault-service.d.ts +15 -0
  197. package/dist/src/modules/protection-plan/infrastructure/services/socket-io-merge-authorization-handler.d.ts +17 -0
  198. package/dist/src/modules/protection-plan/infrastructure/services/socket-io-merge-process-event-listener.d.ts +14 -0
  199. package/dist/src/modules/protection-plan/infrastructure/services/socket-io-plan-event-listener.d.ts +14 -0
  200. package/dist/src/modules/protection-plan/ui/plan-creation-process/hooks/use-distribute-cold-shares-process.d.ts +15 -0
  201. package/dist/src/modules/protection-plan/ui/plan-creation-process/hooks/use-get-active-plan-configuration-process.d.ts +11 -0
  202. package/dist/src/modules/protection-plan/ui/plan-creation-process/hooks/use-plan-configuration-process-steps.d.ts +16 -0
  203. package/dist/src/modules/protection-plan/ui/plan-creation-process/hooks/use-plan-configuration-process.d.ts +25 -0
  204. package/dist/src/modules/protection-plan/ui/plan-creation-process/hooks/use-start-protection-plan-configuration-process.d.ts +10 -0
  205. package/dist/src/modules/protection-plan/ui/plan-creation-process/view-models/plan-configuration-process-view.d.ts +55 -0
  206. package/dist/src/modules/protection-plan/ui/plan-merge-process/hooks/merge-athority/use-merge-authority-sk-mobile-plan-detection.d.ts +13 -0
  207. package/dist/src/modules/protection-plan/ui/plan-merge-process/hooks/merge-athority/use-merge-authority-sk-pro-plan-detection.d.ts +12 -0
  208. package/dist/src/modules/protection-plan/ui/plan-merge-process/hooks/use-abort-merge-process.d.ts +6 -0
  209. package/dist/src/modules/protection-plan/ui/plan-merge-process/hooks/use-active-merge-process-listener.d.ts +9 -0
  210. package/dist/src/modules/protection-plan/ui/plan-merge-process/hooks/use-collect-plan-cold-share-process.d.ts +13 -0
  211. package/dist/src/modules/protection-plan/ui/plan-merge-process/hooks/use-count-down.d.ts +7 -0
  212. package/dist/src/modules/protection-plan/ui/plan-merge-process/hooks/use-initialize-merging-process.d.ts +21 -0
  213. package/dist/src/modules/protection-plan/ui/plan-merge-process/hooks/use-merge-process-controller.d.ts +13 -0
  214. package/dist/src/modules/protection-plan/ui/plan-merge-process/hooks/use-merge-process-release-shares-controller.d.ts +9 -0
  215. package/dist/src/modules/protection-plan/ui/plan-merge-process/hooks/use-plan-merge-process.d.ts +55 -0
  216. package/dist/src/modules/protection-plan/ui/plan-merge-process/hooks/use-process-plan-merge-steps.d.ts +11 -0
  217. package/dist/src/modules/protection-plan/ui/plan-merge-process/hooks/use-reveal-data-controller.d.ts +26 -0
  218. package/dist/src/modules/protection-plan/ui/plan-merge-process/hooks/use-start-merge-process.d.ts +20 -0
  219. package/dist/src/modules/protection-plan/ui/plan-merge-process/hooks/use-trigger-countdown.d.ts +18 -0
  220. package/dist/src/modules/protection-plan/ui/plan-merge-process/utils/merge-process-utils.d.ts +3 -0
  221. package/dist/src/modules/protection-plan/ui/plan-merge-process/view-models/plan-merge-process-view.d.ts +173 -0
  222. package/dist/src/modules/protection-plan/ui/protection-plan/utils/plan-beneficiary-builder.d.ts +12 -0
  223. package/dist/src/modules/protection-plan/ui/protection-plan/utils/plan-data-asset-builder.d.ts +35 -0
  224. package/dist/src/modules/protection-plan/ui/protection-plan/utils/protection-plan-code.d.ts +7 -0
  225. package/dist/src/modules/protection-plan/ui/protection-plan/utils/protection-plan-id.d.ts +7 -0
  226. package/dist/src/modules/protection-plan/ui/protection-plan/utils/trigger-builder.d.ts +24 -0
  227. package/dist/src/modules/safekey/application/use-connect-safekey-pro-device.d.ts +10 -0
  228. package/dist/src/modules/safekey/application/use-disconnect-safekey-device.d.ts +8 -0
  229. package/dist/src/modules/safekey/application/use-safekey-device.d.ts +16 -0
  230. package/dist/src/modules/safekey/application/use-validate-safekey-device-pin.d.ts +12 -0
  231. package/dist/src/modules/safekey/domain/services/cold-storage-service.d.ts +55 -0
  232. package/dist/src/modules/safekey/index.d.ts +4 -0
  233. package/dist/src/modules/safekey/infrastructure/services/safekey-cold-storage-service.d.ts +45 -0
  234. package/dist/src/modules/safekey/infrastructure/services/safekey-service.d.ts +9 -0
  235. package/dist/test/index.js +14 -0
  236. package/dist/tests/modules/_shared/domain/models/FinancialMother.d.ts +11 -0
  237. package/dist/tests/modules/_shared/domain/models/date-mother.d.ts +6 -0
  238. package/dist/tests/modules/_shared/domain/models/email-mother.d.ts +3 -0
  239. package/dist/tests/modules/_shared/domain/models/id-mother.d.ts +3 -0
  240. package/dist/tests/modules/_shared/domain/models/internet-mother.d.ts +11 -0
  241. package/dist/tests/modules/_shared/domain/models/mother-creator.d.ts +3 -0
  242. package/dist/tests/modules/_shared/domain/models/name-mother.d.ts +5 -0
  243. package/dist/tests/modules/_shared/domain/models/number-mother.d.ts +7 -0
  244. package/dist/tests/modules/_shared/domain/models/random-element-picker-mother.d.ts +3 -0
  245. package/dist/tests/modules/_shared/domain/models/uuid-mother.d.ts +3 -0
  246. package/dist/tests/modules/_shared/domain/models/word-mother.d.ts +5 -0
  247. package/dist/tests/modules/index.d.ts +6 -0
  248. package/dist/tests/modules/protection-plan/domain/plan-beneficiary-input-generator.d.ts +18 -0
  249. package/dist/tests/modules/protection-plan/domain/plan-data-asset-input-generator.d.ts +13 -0
  250. package/dist/tests/modules/protection-plan/domain/plan-details-input-generator.d.ts +7 -0
  251. package/dist/tests/modules/protection-plan/domain/plan-shares-configuration-input-generator.d.ts +20 -0
  252. package/dist/tests/modules/protection-plan/domain/plan-storage-configuration-input-generator.d.ts +4 -0
  253. package/dist/tests/modules/protection-plan/domain/plan-trigger-input-generator.d.ts +27 -0
  254. package/dist/tests/modules/protection-plan/domain/protection-plan-input-generator.d.ts +4 -0
  255. package/dist/tests/modules/protection-plan/index.d.ts +8 -0
  256. package/index.ts +6 -0
  257. package/package.json +78 -0
@@ -0,0 +1,16 @@
1
+ import Heir, { HeirPrimitiveProps } from '../../../../protection-plan/domain/models/inheritance/heir';
2
+ import ProtectionPlanDetails from '../../../../protection-plan/domain/models/protection-plan-details';
3
+ import ProtectionPlan, { ProtectionPlanPrimitiveProps, ProtectionPlanProps } from '../../../../protection-plan/domain/models/protection-plan';
4
+ export interface InheritancePlanProps extends Omit<ProtectionPlanProps, 'type'> {
5
+ heirs: Heir[];
6
+ }
7
+ export interface InheritancePlanPrimitiveProps extends ProtectionPlanPrimitiveProps {
8
+ heirs: HeirPrimitiveProps[];
9
+ }
10
+ export default class InheritancePlan extends ProtectionPlan<InheritancePlanProps> {
11
+ constructor(props: InheritancePlanProps);
12
+ get details(): ProtectionPlanDetails;
13
+ get heirs(): Heir[];
14
+ static fromPrimitives(props: InheritancePlanPrimitiveProps): InheritancePlan;
15
+ toPrimitives(): InheritancePlanPrimitiveProps;
16
+ }
@@ -0,0 +1,15 @@
1
+ export interface ActiveMergeProcess {
2
+ id: string;
3
+ requestedAt: Date;
4
+ selectedBeneficiariesIds: string[];
5
+ activeTrigger?: {
6
+ id: string;
7
+ startedAt: Date;
8
+ expiresAt: Date;
9
+ lastRetryAt?: Date;
10
+ retryAttempts: number;
11
+ canRetry: boolean;
12
+ timeframeForRetryInSecs: number;
13
+ };
14
+ mergeAuthorityId: string;
15
+ }
@@ -0,0 +1,135 @@
1
+ import AppProcess, { AppProcessPrimitiveProps, AppProcessProps } from '../../../../protection-plan/domain/models/app-process';
2
+ import ProcessStep from '../../../../protection-plan/domain/models/proccess-step';
3
+ import ProtectionPlan, { ProtectionPlanPrimitiveProps } from '../../../../protection-plan/domain/models/protection-plan';
4
+ import PlanShare from '../../../../protection-plan/domain/models/plan-share';
5
+ import { DeviceShareInfo } from '../../../../protection-plan/domain/models/device-share-info';
6
+ interface LoadedShareData {
7
+ type: string;
8
+ data: string[] | DeviceShareInfo;
9
+ isBackup: boolean;
10
+ }
11
+ export type CollectedSharesData = LoadedShareData & {
12
+ id: string;
13
+ };
14
+ export interface RevealOptions {
15
+ timeoutMinutes: number;
16
+ }
17
+ export interface MergingProcessProps extends AppProcessProps<any> {
18
+ plan: ProtectionPlan<any>;
19
+ planType: 'BACKUP' | 'INHERITANCE';
20
+ backupStore?: any[];
21
+ loadedShares?: {
22
+ [shareId: string]: LoadedShareData;
23
+ };
24
+ activated: boolean;
25
+ triggersRequestedAt?: Date | null;
26
+ selectedBeneficiariesIds: string[];
27
+ mergeAuthorityId: string;
28
+ revealOptions?: RevealOptions;
29
+ expiresAt?: Date;
30
+ pendingTrigger?: {
31
+ id: string;
32
+ startedAt: Date;
33
+ expiresAt: Date;
34
+ };
35
+ }
36
+ export interface MergingProcessPrimitiveProps extends Omit<AppProcessPrimitiveProps<any>, 'plan'> {
37
+ plan: ProtectionPlanPrimitiveProps;
38
+ planType: 'BACKUP' | 'INHERITANCE';
39
+ backupStore?: any[];
40
+ loadedShares?: {
41
+ [shareId: string]: LoadedShareData;
42
+ };
43
+ activated: boolean;
44
+ triggersRequestedAt?: Date | null;
45
+ selectedBeneficiariesIds: string[];
46
+ mergeAuthorityId: string;
47
+ revealOptions?: RevealOptions;
48
+ expiresAt?: Date;
49
+ pendingTrigger?: {
50
+ id: string;
51
+ startedAt: Date;
52
+ expiresAt: Date;
53
+ };
54
+ }
55
+ interface MergingProcessParam {
56
+ id: string;
57
+ plan: ProtectionPlan<any>;
58
+ planType: 'BACKUP' | 'INHERITANCE';
59
+ triggersRequestedAt?: Date | null;
60
+ selectedBeneficiariesIds: string[];
61
+ mergeAuthorityId: string;
62
+ expiresAt?: Date;
63
+ }
64
+ export default class MergingProcess extends AppProcess<MergingProcessProps, any> {
65
+ constructor(props: MergingProcessProps);
66
+ get allSharesLoaded(): boolean;
67
+ get requiresSmartContract(): boolean;
68
+ get selectedBeneficiariesIds(): string[];
69
+ get isCollectingMaShare(): boolean;
70
+ get currentStep(): ProcessStep<any>;
71
+ get planIsReleased(): boolean;
72
+ get hasLoadedShares(): boolean;
73
+ get plan(): ProtectionPlan<any>;
74
+ get planRequiresMobileEndToEndEncryption(): boolean;
75
+ get isActivated(): boolean;
76
+ get ownerId(): string;
77
+ get remainingColdShares(): PlanShare[] | undefined;
78
+ get mergeAuthorityColdShare(): PlanShare | undefined;
79
+ get remainingAdditionalColdShares(): PlanShare[];
80
+ get remainingAdditionalMobileShareholdersIds(): string[];
81
+ get planValidatorShares(): PlanShare[];
82
+ get planMainChain(): import("../storage-option").PlanStorageOption;
83
+ get isCollectingColdShares(): boolean;
84
+ get selectedAdditionalPlanColdShares(): PlanShare[];
85
+ get selectedAdditionalPlanMobileShares(): PlanShare[];
86
+ get mobileShareInvitationSent(): boolean;
87
+ get selectedAdditionalPlanMobileSharesAmount(): number;
88
+ get selectedAdditionalPlanColdSharesAmount(): number;
89
+ get planTitle(): string;
90
+ get planCode(): string;
91
+ get planType(): "BACKUP" | "INHERITANCE";
92
+ get isBackupPlan(): boolean;
93
+ get isInheritancePlan(): boolean;
94
+ get planId(): string;
95
+ get canBeMerged(): boolean;
96
+ get planContractAddress(): string | undefined;
97
+ get isPlanFree(): boolean | undefined;
98
+ get allAdditionalColdSharesLoaded(): boolean;
99
+ get mergeAuthorityShare(): PlanShare | undefined;
100
+ get mergeAuthorityShareLoaded(): boolean;
101
+ get allAdditionalMobileSharesLoaded(): boolean;
102
+ get collectedShares(): CollectedSharesData[];
103
+ get triggersRequestedAt(): Date | undefined;
104
+ get backupStore(): any[] | undefined;
105
+ get pendingTrigger(): {
106
+ startedAt: Date;
107
+ expiresAt: Date;
108
+ id: string;
109
+ } | undefined;
110
+ private get activeStepIndex();
111
+ static create(props: MergingProcessParam): MergingProcess;
112
+ static fromPrimitives(props: MergingProcessPrimitiveProps): MergingProcess;
113
+ reset(): void;
114
+ completeStep(step: ProcessStep<any>): void;
115
+ completeStepById(stepId: string): void;
116
+ markAsInProgress(stepId: string): void;
117
+ isStepCompleted(stepId: string): boolean;
118
+ complete(): void;
119
+ setBackupSharesCollecting(): void;
120
+ setBackupSharesCollected(shareData: any[]): void;
121
+ setValidatorShareCollecting(): void;
122
+ setValidatorShareCollected(shareData: any): void;
123
+ setMobileShareCollected(share: PlanShare, shareData: any): void;
124
+ setColdShareCollecting(share: PlanShare): void;
125
+ setColdShareCollected(share: PlanShare, shareData: any): void;
126
+ isShareCollected(share: PlanShare): boolean;
127
+ toPrimitives(): MergingProcessPrimitiveProps;
128
+ activate(): void;
129
+ setMergeExpiration(mergeExpiresAt: Date): void;
130
+ filterSelectedShares(shares: PlanShare[]): PlanShare[];
131
+ private ensureAllParamsAreValid;
132
+ private markNextAsInProgress;
133
+ private setLoadedShare;
134
+ }
135
+ export {};
@@ -0,0 +1,69 @@
1
+ import AppProcess, { AppProcessPrimitiveProps, AppProcessProps } from '../../../../protection-plan/domain/models/app-process';
2
+ import ProcessStep from '../../../../protection-plan/domain/models/proccess-step';
3
+ import ProtectionPlan, { PlanPrivateKeys, ProtectionPlanPrimitiveProps } from '../../../../protection-plan/domain/models/protection-plan';
4
+ import { ShareCreationStatus, ShareType } from '../../../../protection-plan/domain/models/plan-share';
5
+ import { ProtectionPlanPassphraseProps } from '../../../../protection-plan/domain/models/protection-plan-passphrase';
6
+ export interface PlanCreationProcessProps extends AppProcessProps<any> {
7
+ plan: ProtectionPlan<any>;
8
+ planType: 'BACKUP' | 'INHERITANCE';
9
+ stepErrors?: Record<string, string>;
10
+ stepsAttempts?: Record<string, number>;
11
+ mobileSharesPassphrase?: string;
12
+ }
13
+ export interface PlanCreationProcessPrimitiveProps extends Omit<AppProcessPrimitiveProps<any>, 'plan' | 'payment'> {
14
+ plan: ProtectionPlanPrimitiveProps;
15
+ planType: 'BACKUP' | 'INHERITANCE';
16
+ stepErrors?: Record<string, string>;
17
+ stepsAttempts?: Record<string, number>;
18
+ mobileSharesPassphrase?: string;
19
+ }
20
+ interface PlanCreationProcessParam {
21
+ plan: ProtectionPlan<any>;
22
+ planType: 'BACKUP' | 'INHERITANCE';
23
+ }
24
+ export default class PlanCreationProcess extends AppProcess<PlanCreationProcessProps, any> {
25
+ constructor(props: PlanCreationProcessProps);
26
+ get isDistributingColdShares(): boolean;
27
+ get currentStep(): ProcessStep<any>;
28
+ get plan(): ProtectionPlan<any>;
29
+ get allPlanShares(): import("../../../../protection-plan/domain/models/plan-share").default[];
30
+ get planColdShares(): import("../../../../protection-plan/domain/models/plan-share").default[];
31
+ get planBackupShares(): import("../../../../protection-plan/domain/models/plan-share").default[];
32
+ get planValidatorShares(): import("../../../../protection-plan/domain/models/plan-share").default[];
33
+ get planType(): "BACKUP" | "INHERITANCE";
34
+ get planId(): string;
35
+ get planRequiresMobileEndToEndEncryption(): boolean;
36
+ get mobileSharesPassphrase(): string | undefined;
37
+ get activeStepIndex(): number;
38
+ get planPrivateKeys(): PlanPrivateKeys | undefined;
39
+ get hasErrors(): boolean;
40
+ static create(props: PlanCreationProcessParam): PlanCreationProcess;
41
+ static fromPrimitives(props: PlanCreationProcessPrimitiveProps): PlanCreationProcess;
42
+ start(): void;
43
+ isAfter(id: string): boolean;
44
+ getStepByIndex(index: number): ProcessStep<any>;
45
+ reset(): void;
46
+ completeStep(step: ProcessStep<any>): void;
47
+ completeStepById(stepId: string): void;
48
+ setPlanContractAddress(address: string): void;
49
+ updatePlanPassphrase(passphrase: ProtectionPlanPassphraseProps): void;
50
+ setMobileSharesPassPhrase(passphrase: string): void;
51
+ updatePlanPrivateKeys(keys: PlanPrivateKeys): void;
52
+ toPrimitives(): PlanCreationProcessPrimitiveProps;
53
+ setStepError(id: string, message: string): void;
54
+ updateStepAttempt(id: string): void;
55
+ getStepAttempt(id: string): number;
56
+ cleanStepError(id: string): void;
57
+ getStepError(id: string): string | undefined;
58
+ isStepProcessing(id: string): boolean;
59
+ updatePlanSharesCreationStatus(type: ShareType, status: ShareCreationStatus, shareId?: string): void;
60
+ updateUpdateShareDeviceInfo(shareId: string, data: {
61
+ deviceId: string;
62
+ devicePassword?: string;
63
+ }): void;
64
+ updatePlanSharesAddresses(type: ShareType, shares: {
65
+ [p: string]: string[];
66
+ }): void;
67
+ stepCompleted(id: string): boolean | undefined;
68
+ }
69
+ export {};
@@ -0,0 +1,69 @@
1
+ import StorageOption, { StorageOptionPrimitiveProps } from '../../../protection-plan/domain/models/storage-option';
2
+ import Shareholder, { ShareholderPrimitiveProps } from '../../../protection-plan/domain/models/shareholder';
3
+ export type ShareType = 'VALIDATOR' | 'COLD' | 'MOBILE' | 'BACKUP';
4
+ export type ShareStatus = 'DISTRIBUTED' | 'PENDING' | 'CLAIMED' | 'RELEASED' | 'COLLECTED' | "PENDING_CLAIM" | "PENDING_VERIFICATION";
5
+ export type ShareCreationStatus = 'UNCREATED' | 'CREATING' | 'CREATED' | 'DISTRIBUTING' | 'DISTRIBUTED';
6
+ export interface PlanShareProps {
7
+ id: string;
8
+ shareholder?: Shareholder;
9
+ addresses: string[];
10
+ shareData?: string[];
11
+ type: ShareType;
12
+ storage: StorageOption;
13
+ status: ShareStatus;
14
+ creationStatus: ShareCreationStatus;
15
+ claimedAt?: Date;
16
+ verifiedAt?: Date;
17
+ mobileShareVerification?: string;
18
+ }
19
+ export interface PlanSharePrimitiveProps extends Omit<PlanShareProps, 'shareholder' | 'storage'> {
20
+ shareholder?: ShareholderPrimitiveProps;
21
+ storage: StorageOptionPrimitiveProps;
22
+ }
23
+ export default class PlanShare {
24
+ private props;
25
+ constructor(props: PlanShareProps);
26
+ get id(): string;
27
+ get endToEndEncrypted(): boolean;
28
+ get deviceId(): string | undefined;
29
+ get shareholderEmail(): string | undefined;
30
+ get shareholder(): Shareholder | undefined;
31
+ get addressesCount(): number;
32
+ get addresses(): string[];
33
+ get shareData(): string[] | undefined;
34
+ get isValidator(): boolean;
35
+ get isInBlockchain(): boolean;
36
+ get isInVault(): boolean;
37
+ get typeName(): "" | "Merge Authority shares" | "Recovery shares" | "Validator share";
38
+ get storageName(): "HSM" | "SafeKey Pro" | "SafeKey Mobile" | "vechain" | "Ethereum" | "Optimism" | "Inheriti® Chain" | "Vault" | "Unknown Name";
39
+ get status(): ShareStatus;
40
+ get creationStatus(): ShareCreationStatus;
41
+ get isCreating(): boolean;
42
+ get isDistributing(): boolean;
43
+ get isCollecting(): boolean;
44
+ get isCollected(): boolean;
45
+ get isDistributed(): boolean;
46
+ get type(): ShareType;
47
+ get isBackup(): boolean;
48
+ get isMobile(): boolean;
49
+ get isCold(): boolean;
50
+ get isMergeAuthority(): boolean;
51
+ get storage(): StorageOption;
52
+ get claimedAt(): Date | null;
53
+ get isClaimed(): boolean;
54
+ get isVerified(): boolean;
55
+ get isPending(): boolean;
56
+ get shareholderId(): string | undefined;
57
+ /** @ignore */
58
+ static fromPrimitives(props: PlanSharePrimitiveProps): PlanShare;
59
+ reset(): void;
60
+ updateStatus(status: ShareStatus): void;
61
+ updateCreationStatus(status: ShareCreationStatus): void;
62
+ updateAddresses(addresses: string[]): void;
63
+ setShareData(data: string[]): void;
64
+ setCollecting(): void;
65
+ setDeviceId(id: string): void;
66
+ setDevicePassword(password: string): void;
67
+ /** @ignore */
68
+ toPrimitives(): PlanSharePrimitiveProps;
69
+ }
@@ -0,0 +1,21 @@
1
+ export interface ProcessStepProps {
2
+ id: string;
3
+ status: 'COMPLETE' | 'INCOMPLETE' | 'IN_PROCESS';
4
+ }
5
+ export interface ProcessStepPrimitiveProps extends ProcessStepProps {
6
+ }
7
+ export default class ProcessStep<T> {
8
+ private props;
9
+ constructor(props: ProcessStepProps & T);
10
+ get id(): string;
11
+ get isComplete(): boolean;
12
+ get status(): "COMPLETE" | "INCOMPLETE" | "IN_PROCESS";
13
+ get isPending(): boolean;
14
+ get isInProcess(): boolean;
15
+ static fromPrimitives(props: ProcessStepPrimitiveProps): ProcessStep<unknown>;
16
+ reset(): void;
17
+ markAsComplete(): void;
18
+ markAsInProgress(): void;
19
+ markAsIncomplete(): void;
20
+ toPrimitives(): ProcessStepPrimitiveProps;
21
+ }
@@ -0,0 +1,70 @@
1
+ import StorageOption from '../../../protection-plan/domain/models/storage-option';
2
+ import { ProtectionPlanStatus } from '../../../protection-plan/domain/models/protection-plan';
3
+ interface ProtectionPlanDetailsProps {
4
+ code: string;
5
+ owner: {
6
+ id: string;
7
+ firstName: string;
8
+ lastName: string;
9
+ profilePicture?: string;
10
+ };
11
+ name: string;
12
+ description?: string;
13
+ privateNotes?: string;
14
+ data: string;
15
+ createdAt: Date;
16
+ contractAddress?: string;
17
+ network?: string;
18
+ status: ProtectionPlanStatus;
19
+ triggers: string[];
20
+ mergeThreshold: number;
21
+ mergeCount: number;
22
+ lastReleasedAt?: Date;
23
+ shareholders: {
24
+ id: string;
25
+ storageOption: StorageOption;
26
+ }[];
27
+ shares: {
28
+ addressCount: number;
29
+ type: string;
30
+ shareholderId: string;
31
+ storageOption: StorageOption;
32
+ }[];
33
+ chain: {
34
+ id: string;
35
+ name: string;
36
+ };
37
+ type: 'BACKUP' | 'INHERITANCE';
38
+ isFree?: boolean;
39
+ }
40
+ export default class ProtectionPlanDetails {
41
+ private props;
42
+ constructor(props: ProtectionPlanDetailsProps);
43
+ get code(): string;
44
+ get isFree(): boolean | undefined;
45
+ get isBackupPlan(): boolean;
46
+ get storageLayers(): string[];
47
+ get network(): string | undefined;
48
+ get triggers(): string[];
49
+ get owner(): {
50
+ id: string;
51
+ firstName: string;
52
+ lastName: string;
53
+ profilePicture?: string;
54
+ };
55
+ get name(): string;
56
+ get description(): string | undefined;
57
+ get lastReleasedAt(): Date | undefined;
58
+ get mergeThreshold(): number;
59
+ get mergeCount(): number;
60
+ get privateNotes(): string | undefined;
61
+ get mobileSharesCount(): number;
62
+ get coldSharesCount(): number;
63
+ get backupSharesCount(): number;
64
+ get sharesCount(): number;
65
+ get data(): string;
66
+ get createdAt(): Date;
67
+ get contractAddress(): string | undefined;
68
+ get status(): ProtectionPlanStatus;
69
+ }
70
+ export {};
@@ -0,0 +1,18 @@
1
+ export interface ProtectionPlanPassphraseProps {
2
+ validator?: string;
3
+ backup?: string;
4
+ mobile?: string;
5
+ }
6
+ export interface ProtectionPlanPassphrasePrimitiveProps extends ProtectionPlanPassphraseProps {
7
+ }
8
+ export default class ProtectionPlanPassphrase {
9
+ private props;
10
+ constructor(props: ProtectionPlanPassphraseProps);
11
+ get validator(): string | undefined;
12
+ get backup(): string | undefined;
13
+ get mobile(): string | undefined;
14
+ static fromPrimitives(primitives: ProtectionPlanPassphrasePrimitiveProps): ProtectionPlanPassphrase;
15
+ static merge(entity: ProtectionPlanPassphrase, props: Partial<ProtectionPlanPassphraseProps>): ProtectionPlanPassphrase;
16
+ static fromEmpty(): ProtectionPlanPassphrase;
17
+ toPrimitives(): ProtectionPlanPassphrasePrimitiveProps;
18
+ }
@@ -0,0 +1,238 @@
1
+ import PlanShare, { PlanSharePrimitiveProps, ShareCreationStatus, ShareType } from '../../../protection-plan/domain/models/plan-share';
2
+ import Trigger, { MergeTriggerStatus, TriggerPrimitiveProps, TriggerStatus, TriggerType } from '../../../protection-plan/domain/models/trigger';
3
+ import ProtectionPlanPassphrase, { ProtectionPlanPassphrasePrimitiveProps, ProtectionPlanPassphraseProps } from '../../../protection-plan/domain/models/protection-plan-passphrase';
4
+ export type ProtectionPlanStatus = 'PROTECTED' | 'DRAFT' | 'FAILED' | 'PENDING_SHARES' | 'MERGING_INITIALIZED' | 'MERGING_IN_PROGRESS' | 'SHARES_MERGED' | 'DATA_RELEASED';
5
+ export interface PlanPrivateKeys {
6
+ validator?: string;
7
+ backup?: string;
8
+ }
9
+ export interface PlanActiveMergeProcess {
10
+ id: string;
11
+ initializedAt?: Date;
12
+ expiresAt?: Date;
13
+ }
14
+ export interface ProtectionPlanProps {
15
+ id: string;
16
+ code: string;
17
+ contractAddress?: string;
18
+ network?: string;
19
+ passphrase?: ProtectionPlanPassphrase;
20
+ privateKeys?: PlanPrivateKeys;
21
+ owner: {
22
+ id: string;
23
+ firstName: string;
24
+ lastName: string;
25
+ profilePicture?: string;
26
+ };
27
+ details: {
28
+ name: string;
29
+ description?: string;
30
+ privateNotes?: string;
31
+ };
32
+ mergeThreshold: number;
33
+ encryptedData?: string;
34
+ status: ProtectionPlanStatus;
35
+ triggers: Trigger[];
36
+ shares: PlanShare[];
37
+ isDraft: boolean;
38
+ createdAt: Date;
39
+ type: 'BACKUP' | 'INHERITANCE';
40
+ paidAt?: Date;
41
+ activeMergeProcess?: PlanActiveMergeProcess;
42
+ assetsMetadata: any;
43
+ assetsConfig?: string;
44
+ lastReleasedAt?: Date;
45
+ mergeCount: number;
46
+ lastReleaseRequest?: Date;
47
+ isFree?: boolean;
48
+ configuredAt?: Date;
49
+ }
50
+ export interface ProtectionPlanPrimitiveProps extends Omit<ProtectionPlanProps, 'passphrase' | 'shares' | 'triggers'> {
51
+ shares: PlanSharePrimitiveProps[];
52
+ triggers: TriggerPrimitiveProps[];
53
+ passphrase?: ProtectionPlanPassphrasePrimitiveProps;
54
+ }
55
+ export declare const MAX_ADDITIONAL_PLAN_BENEFICIARIES = 9;
56
+ export default class ProtectionPlan<T> {
57
+ protected props: ProtectionPlanProps & T;
58
+ constructor(props: ProtectionPlanProps & T);
59
+ get isConfigured(): boolean;
60
+ get isBlockchain(): boolean;
61
+ get assetsConfig(): string | undefined;
62
+ get defaultMergeBeneficiariesIds(): string[];
63
+ get defaultMergeAuthorityId(): string;
64
+ get canProceedMergingProcess(): boolean;
65
+ get id(): string;
66
+ get isFree(): boolean | undefined;
67
+ get isTestNet(): boolean;
68
+ get encryptedData(): string | undefined;
69
+ get isReleased(): boolean;
70
+ get remainingSecondsForClose(): number | undefined;
71
+ get timeoutMinutesForClose(): number;
72
+ get mergeExpiresAt(): Date | undefined;
73
+ get name(): string;
74
+ get network(): string | undefined;
75
+ get code(): string;
76
+ get status(): ProtectionPlanStatus;
77
+ get isInMergeProcess(): boolean;
78
+ get isDraft(): boolean;
79
+ get isIncomplete(): boolean;
80
+ get isMergeInitialized(): boolean;
81
+ get isPendingShares(): boolean;
82
+ get description(): string | undefined;
83
+ get privateNotes(): string | undefined;
84
+ get createdAt(): Date;
85
+ get isPaid(): boolean;
86
+ get triggers(): Trigger[];
87
+ get pendingTrigger(): Trigger | undefined;
88
+ get unresolvedTrigger(): Trigger | undefined;
89
+ get deniedTrigger(): Trigger | undefined;
90
+ get expiredTrigger(): Trigger | undefined;
91
+ get loginTrigger(): Trigger | undefined;
92
+ get clickLinkTrigger(): Trigger | undefined;
93
+ get safeKeyTrigger(): Trigger | undefined;
94
+ get smsTrigger(): Trigger | undefined;
95
+ get phoneCallTrigger(): Trigger | undefined;
96
+ get backupSharesAmount(): number;
97
+ get mobileSharesAmount(): number;
98
+ get coldSharesAmount(): number;
99
+ get mobileShares(): PlanShare[];
100
+ get coldShares(): PlanShare[];
101
+ get vaultShares(): PlanShare[];
102
+ get planMainStorage(): import("../../../protection-plan/domain/models/storage-option").PlanStorageOption;
103
+ get planMainChain(): import("../../../protection-plan/domain/models/storage-option").PlanStorageOption;
104
+ get planMainChainName(): "HSM" | "SafeKey Pro" | "SafeKey Mobile" | "vechain" | "Ethereum" | "Optimism" | "Inheriti® Chain" | "Vault" | "Unknown Name";
105
+ get validatorShares(): PlanShare[];
106
+ get backupShares(): PlanShare[];
107
+ get validatorSharesCreated(): boolean;
108
+ get validatorSharesCreating(): boolean;
109
+ get validatorSharesUncreated(): boolean;
110
+ get coldSharesCreated(): boolean;
111
+ get coldSharesCreating(): boolean;
112
+ get coldSharesUncreated(): boolean;
113
+ get mobileSharesCreated(): boolean;
114
+ get mobileSharesCreating(): boolean;
115
+ get mobileSharesUncreated(): boolean;
116
+ get backupSharesCreated(): boolean;
117
+ get backupSharesCreating(): boolean;
118
+ get backupSharesUncreated(): boolean;
119
+ get coldSharesDistributed(): boolean;
120
+ get shareHoldersAmount(): number;
121
+ get beneficiaryShares(): PlanShare[];
122
+ get shares(): PlanShare[];
123
+ get ownerFullName(): string;
124
+ get ownerId(): string;
125
+ get owner(): {
126
+ fullName: string;
127
+ id: string;
128
+ firstName: string;
129
+ lastName: string;
130
+ profilePicture?: string;
131
+ };
132
+ get ownerShareholder(): import("./shareholder").default | undefined;
133
+ get ownerProfilePicture(): string | undefined;
134
+ get mergeThreshold(): number;
135
+ get isBackupPlan(): boolean;
136
+ get type(): "BACKUP" | "INHERITANCE";
137
+ get isInheritancePlan(): boolean;
138
+ get blockchainShares(): PlanShare[];
139
+ get contractAddress(): string | undefined;
140
+ get totalShares(): number;
141
+ get hasDataReleased(): boolean;
142
+ get privateKeys(): PlanPrivateKeys | undefined;
143
+ get isProtected(): boolean;
144
+ get collectingShareType(): ShareType | undefined;
145
+ get activeMergeProcessId(): string | undefined;
146
+ get mergeCount(): number;
147
+ get lastReleasedAt(): Date | undefined;
148
+ get storageLayers(): {
149
+ id: import("../../../protection-plan/domain/models/storage-option").PlanStorageOption;
150
+ name: string;
151
+ }[];
152
+ get isValidatorCollected(): boolean;
153
+ get requiresMobileEndToEndEncryption(): boolean;
154
+ get lastReleaseRequest(): Date | undefined;
155
+ private get lastCollectedShareType();
156
+ private get mergeProcessShares();
157
+ private get additionalShareholdersCount();
158
+ static fromPrimitives(props: ProtectionPlanPrimitiveProps): ProtectionPlan<{
159
+ passphrase: ProtectionPlanPassphrase | undefined;
160
+ shares: PlanShare[];
161
+ triggers: Trigger[];
162
+ id: string;
163
+ code: string;
164
+ type: "BACKUP" | "INHERITANCE";
165
+ status: ProtectionPlanStatus;
166
+ contractAddress?: string | undefined;
167
+ network?: string | undefined;
168
+ privateKeys?: PlanPrivateKeys | undefined;
169
+ owner: {
170
+ id: string;
171
+ firstName: string;
172
+ lastName: string;
173
+ profilePicture?: string;
174
+ };
175
+ details: {
176
+ name: string;
177
+ description?: string;
178
+ privateNotes?: string;
179
+ };
180
+ mergeThreshold: number;
181
+ encryptedData?: string | undefined;
182
+ isDraft: boolean;
183
+ createdAt: Date;
184
+ paidAt?: Date | undefined;
185
+ activeMergeProcess?: PlanActiveMergeProcess | undefined;
186
+ assetsMetadata: any;
187
+ assetsConfig?: string | undefined;
188
+ lastReleasedAt?: Date | undefined;
189
+ mergeCount: number;
190
+ lastReleaseRequest?: Date | undefined;
191
+ isFree?: boolean | undefined;
192
+ configuredAt?: Date | undefined;
193
+ }>;
194
+ findShareholderByDeviceId(deviceId: string): import("./shareholder").default | undefined;
195
+ findShareholderByCriteria(beneficiary: OnlyOne<{
196
+ id: string;
197
+ email: string;
198
+ code: string;
199
+ deviceId: string;
200
+ }>): import("./shareholder").default | undefined;
201
+ markAsPendingShares(): void;
202
+ markAsProtected(): void;
203
+ findMobileSharesForBeneficiary(deviceId: string): PlanShare[];
204
+ findVaultSharesForBeneficiary(deviceId: string): PlanShare[];
205
+ findOwnerBeneficiariesVaultShares(loggedUserDeviceId: string): PlanShare[];
206
+ getTriggerMergeStatus(triggerId: string): MergeTriggerStatus;
207
+ getTriggerStatus(triggerId: string): TriggerStatus;
208
+ isMergeAuthority(id: string): boolean;
209
+ isUserMergeAuthority(email: string): boolean | undefined;
210
+ includesBeneficiary(id: string): boolean;
211
+ findBeneficiaryShare(id: string): PlanShare | undefined;
212
+ findShareByBeneficiaryEmail(email: string): PlanShare | undefined;
213
+ findShareByDeviceId(deviceId: string): PlanShare | undefined;
214
+ updateShares(shares: PlanShare[]): void;
215
+ updateColdShare(share: PlanShare): void;
216
+ updateMobileShare(share: PlanShare): void;
217
+ setContractAddress(address: string): void;
218
+ setPassphrase(passphrase: ProtectionPlanPassphrase): void;
219
+ toPrimitives(): ProtectionPlanPrimitiveProps;
220
+ findShare(shareId: string): PlanShare | undefined;
221
+ isTriggerActivated(triggerId: TriggerType): boolean;
222
+ updatePlanPassphrase(passphrase: ProtectionPlanPassphraseProps): void;
223
+ updatePrivateKeys(keys: PlanPrivateKeys): void;
224
+ setHexData(data: any): void;
225
+ isShareCollected(share: PlanShare): boolean;
226
+ updateSharesCreationStatus(type: string, status: ShareCreationStatus, shareId?: string): void;
227
+ updateShareDeviceInfo(shareId: string, data: {
228
+ deviceId: string;
229
+ devicePassword?: string;
230
+ }): void;
231
+ updateSharesAddresses(type: ShareType, shares: {
232
+ [p: string]: string[];
233
+ }): void;
234
+ findBeneficiariesShares(shareholdersIds: string[]): PlanShare[];
235
+ hasTriggersConfigured(triggersIds: string[]): boolean;
236
+ hasTriggerConfigured(triggersId: string): boolean;
237
+ private sortSharesByMergeProcess;
238
+ }