@dalmore/api-contracts 0.0.0-dev.d07da18 → 0.0.0-dev.d2fe663

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 (693) hide show
  1. package/README.md +23 -19
  2. package/common/helpers/index.d.ts +50 -0
  3. package/common/helpers/index.js +136 -0
  4. package/common/helpers/index.js.map +1 -0
  5. package/common/types/account-contact.types.d.ts +485 -0
  6. package/common/types/account-contact.types.js +75 -0
  7. package/common/types/account-contact.types.js.map +1 -0
  8. package/common/types/account-detail.types.d.ts +304 -0
  9. package/common/types/account-detail.types.js +20 -0
  10. package/common/types/account-detail.types.js.map +1 -0
  11. package/common/types/account-integration.types.d.ts +242 -0
  12. package/common/types/account-integration.types.js +121 -0
  13. package/common/types/account-integration.types.js.map +1 -0
  14. package/common/types/account-manager.types.d.ts +917 -0
  15. package/common/types/account-manager.types.js +89 -0
  16. package/common/types/account-manager.types.js.map +1 -0
  17. package/common/types/account-setting.types.d.ts +120 -0
  18. package/common/types/account-setting.types.js +44 -0
  19. package/common/types/account-setting.types.js.map +1 -0
  20. package/common/types/account.types.d.ts +595 -0
  21. package/common/types/account.types.js +214 -0
  22. package/common/types/account.types.js.map +1 -0
  23. package/common/types/activity.types.d.ts +580 -0
  24. package/common/types/activity.types.js +245 -0
  25. package/common/types/activity.types.js.map +1 -0
  26. package/common/types/address.types.d.ts +89 -0
  27. package/common/types/address.types.js +36 -0
  28. package/common/types/address.types.js.map +1 -0
  29. package/common/types/aic.types.d.ts +434 -0
  30. package/common/types/aic.types.js +170 -0
  31. package/common/types/aic.types.js.map +1 -0
  32. package/common/types/aml.types.d.ts +41 -0
  33. package/common/types/aml.types.js +16 -0
  34. package/common/types/aml.types.js.map +1 -0
  35. package/common/types/api-key-logs.types.d.ts +204 -0
  36. package/common/types/api-key-logs.types.js +52 -0
  37. package/common/types/api-key-logs.types.js.map +1 -0
  38. package/common/types/api-keys.types.d.ts +192 -0
  39. package/common/types/api-keys.types.js +57 -0
  40. package/common/types/api-keys.types.js.map +1 -0
  41. package/common/types/asset.types.d.ts +888 -0
  42. package/common/types/asset.types.js +280 -0
  43. package/common/types/asset.types.js.map +1 -0
  44. package/common/types/auth.types.d.ts +487 -0
  45. package/common/types/auth.types.js +279 -0
  46. package/common/types/auth.types.js.map +1 -0
  47. package/common/types/batch-jobs.types.d.ts +321 -0
  48. package/common/types/batch-jobs.types.js +111 -0
  49. package/common/types/batch-jobs.types.js.map +1 -0
  50. package/common/types/bonus-tier.types.d.ts +888 -0
  51. package/common/types/bonus-tier.types.js +130 -0
  52. package/common/types/bonus-tier.types.js.map +1 -0
  53. package/common/types/cart.types.d.ts +28 -0
  54. package/common/types/cart.types.js +19 -0
  55. package/common/types/cart.types.js.map +1 -0
  56. package/common/types/checklist-items.types.d.ts +195 -0
  57. package/common/types/checklist-items.types.js +54 -0
  58. package/common/types/checklist-items.types.js.map +1 -0
  59. package/common/types/checklist.types.d.ts +140 -0
  60. package/common/types/checklist.types.js +71 -0
  61. package/common/types/checklist.types.js.map +1 -0
  62. package/common/types/common.types.d.ts +1495 -0
  63. package/common/types/common.types.js +1430 -0
  64. package/common/types/common.types.js.map +1 -0
  65. package/common/types/comply-advantage-api.types.d.ts +3959 -0
  66. package/common/types/comply-advantage-api.types.js +270 -0
  67. package/common/types/comply-advantage-api.types.js.map +1 -0
  68. package/common/types/comply-advantage.types.d.ts +48 -0
  69. package/common/types/comply-advantage.types.js +21 -0
  70. package/common/types/comply-advantage.types.js.map +1 -0
  71. package/common/types/contact-us.types.d.ts +126 -0
  72. package/common/types/contact-us.types.js +91 -0
  73. package/common/types/contact-us.types.js.map +1 -0
  74. package/common/types/countries.types.d.ts +77 -0
  75. package/common/types/countries.types.js +349 -0
  76. package/common/types/countries.types.js.map +1 -0
  77. package/common/types/covered-person.types.d.ts +204 -0
  78. package/common/types/covered-person.types.js +234 -0
  79. package/common/types/covered-person.types.js.map +1 -0
  80. package/common/types/dashboard.types.d.ts +2086 -0
  81. package/common/types/dashboard.types.js +690 -0
  82. package/common/types/dashboard.types.js.map +1 -0
  83. package/common/types/data-record.types.d.ts +347 -0
  84. package/common/types/data-record.types.js +261 -0
  85. package/common/types/data-record.types.js.map +1 -0
  86. package/common/types/data-room.types.d.ts +1277 -0
  87. package/common/types/data-room.types.js +167 -0
  88. package/common/types/data-room.types.js.map +1 -0
  89. package/common/types/default-theme-config.types.d.ts +445 -0
  90. package/common/types/default-theme-config.types.js +63 -0
  91. package/common/types/default-theme-config.types.js.map +1 -0
  92. package/common/types/disbursement-adjustment.types.d.ts +21 -0
  93. package/common/types/disbursement-adjustment.types.js +25 -0
  94. package/common/types/disbursement-adjustment.types.js.map +1 -0
  95. package/common/types/disbursement-approval-user.types.d.ts +935 -0
  96. package/common/types/disbursement-approval-user.types.js +68 -0
  97. package/common/types/disbursement-approval-user.types.js.map +1 -0
  98. package/common/types/disbursement-review.types.d.ts +923 -0
  99. package/common/types/disbursement-review.types.js +76 -0
  100. package/common/types/disbursement-review.types.js.map +1 -0
  101. package/common/types/disbursement-transaction.types.d.ts +621 -0
  102. package/common/types/disbursement-transaction.types.js +51 -0
  103. package/common/types/disbursement-transaction.types.js.map +1 -0
  104. package/common/types/disbursements.types.d.ts +2343 -0
  105. package/common/types/disbursements.types.js +308 -0
  106. package/common/types/disbursements.types.js.map +1 -0
  107. package/common/types/domain-filter.types.d.ts +135 -0
  108. package/common/types/domain-filter.types.js +40 -0
  109. package/common/types/domain-filter.types.js.map +1 -0
  110. package/common/types/email-theme.types.d.ts +1359 -0
  111. package/common/types/email-theme.types.js +318 -0
  112. package/common/types/email-theme.types.js.map +1 -0
  113. package/common/types/entity.types.d.ts +21 -0
  114. package/common/types/entity.types.js +14 -0
  115. package/common/types/entity.types.js.map +1 -0
  116. package/common/types/error-responses.types.d.ts +144 -0
  117. package/common/types/error-responses.types.js +125 -0
  118. package/common/types/error-responses.types.js.map +1 -0
  119. package/common/types/escrow-account.types.d.ts +398 -0
  120. package/common/types/escrow-account.types.js +75 -0
  121. package/common/types/escrow-account.types.js.map +1 -0
  122. package/common/types/exchange-api-key.types.d.ts +1010 -0
  123. package/common/types/exchange-api-key.types.js +90 -0
  124. package/common/types/exchange-api-key.types.js.map +1 -0
  125. package/common/types/exchange-import.types.d.ts +23 -0
  126. package/common/types/exchange-import.types.js +23 -0
  127. package/common/types/exchange-import.types.js.map +1 -0
  128. package/common/types/exchange-provider.types.d.ts +1308 -0
  129. package/common/types/exchange-provider.types.js +268 -0
  130. package/common/types/exchange-provider.types.js.map +1 -0
  131. package/common/types/file.types.d.ts +401 -0
  132. package/common/types/file.types.js +378 -0
  133. package/common/types/file.types.js.map +1 -0
  134. package/common/types/health.types.d.ts +112 -0
  135. package/common/types/health.types.js +22 -0
  136. package/common/types/health.types.js.map +1 -0
  137. package/common/types/i-will-do-it-later.types.d.ts +51 -0
  138. package/common/types/i-will-do-it-later.types.js +30 -0
  139. package/common/types/i-will-do-it-later.types.js.map +1 -0
  140. package/common/types/{index.ts → index.d.ts} +4 -3
  141. package/common/types/index.js +51 -0
  142. package/common/types/index.js.map +1 -0
  143. package/common/types/individuals.types.d.ts +1899 -0
  144. package/common/types/individuals.types.js +500 -0
  145. package/common/types/individuals.types.js.map +1 -0
  146. package/common/types/investor-account.types.d.ts +2996 -0
  147. package/common/types/investor-account.types.js +930 -0
  148. package/common/types/investor-account.types.js.map +1 -0
  149. package/common/types/investorAccountIdSchema.type.js +1 -0
  150. package/common/types/investorAccountIdSchema.type.js.map +1 -0
  151. package/common/types/investors-offering.types.d.ts +391 -0
  152. package/common/types/investors-offering.types.js +49 -0
  153. package/common/types/investors-offering.types.js.map +1 -0
  154. package/common/types/invite.types.d.ts +641 -0
  155. package/common/types/invite.types.js +113 -0
  156. package/common/types/invite.types.js.map +1 -0
  157. package/common/types/issuer-bank-account.types.d.ts +385 -0
  158. package/common/types/issuer-bank-account.types.js +81 -0
  159. package/common/types/issuer-bank-account.types.js.map +1 -0
  160. package/common/types/issuer-offering.types.d.ts +1245 -0
  161. package/common/types/issuer-offering.types.js +344 -0
  162. package/common/types/issuer-offering.types.js.map +1 -0
  163. package/common/types/issuer-payment-method.types.d.ts +1100 -0
  164. package/common/types/issuer-payment-method.types.js +311 -0
  165. package/common/types/issuer-payment-method.types.js.map +1 -0
  166. package/common/types/issuer.types.d.ts +539 -0
  167. package/common/types/issuer.types.js +275 -0
  168. package/common/types/issuer.types.js.map +1 -0
  169. package/common/types/job-item.types.d.ts +230 -0
  170. package/common/types/job-item.types.js +89 -0
  171. package/common/types/job-item.types.js.map +1 -0
  172. package/common/types/jobs.types.d.ts +296 -0
  173. package/common/types/jobs.types.js +150 -0
  174. package/common/types/jobs.types.js.map +1 -0
  175. package/common/types/kyb.types.d.ts +167 -0
  176. package/common/types/kyb.types.js +45 -0
  177. package/common/types/kyb.types.js.map +1 -0
  178. package/common/types/kyc.types.d.ts +2197 -0
  179. package/common/types/kyc.types.js +301 -0
  180. package/common/types/kyc.types.js.map +1 -0
  181. package/common/types/legal-entity.types.d.ts +638 -0
  182. package/common/types/legal-entity.types.js +148 -0
  183. package/common/types/legal-entity.types.js.map +1 -0
  184. package/common/types/login-history.types.d.ts +160 -0
  185. package/common/types/login-history.types.js +39 -0
  186. package/common/types/login-history.types.js.map +1 -0
  187. package/common/types/mail-template.types.d.ts +595 -0
  188. package/common/types/mail-template.types.js +401 -0
  189. package/common/types/mail-template.types.js.map +1 -0
  190. package/common/types/north-cap-integration.types.d.ts +1303 -0
  191. package/common/types/north-cap-integration.types.js +145 -0
  192. package/common/types/north-cap-integration.types.js.map +1 -0
  193. package/common/types/note.types.d.ts +216 -0
  194. package/common/types/note.types.js +82 -0
  195. package/common/types/note.types.js.map +1 -0
  196. package/common/types/notification.types.d.ts +2689 -0
  197. package/common/types/notification.types.js +408 -0
  198. package/common/types/notification.types.js.map +1 -0
  199. package/common/types/notion-api.types.d.ts +3626 -0
  200. package/common/types/notion-api.types.js +271 -0
  201. package/common/types/notion-api.types.js.map +1 -0
  202. package/common/types/notion-database.types.d.ts +191 -0
  203. package/common/types/notion-database.types.js +95 -0
  204. package/common/types/notion-database.types.js.map +1 -0
  205. package/common/types/notion-page.types.d.ts +3482 -0
  206. package/common/types/notion-page.types.js +208 -0
  207. package/common/types/notion-page.types.js.map +1 -0
  208. package/common/types/offering-reports.types.d.ts +525 -0
  209. package/common/types/offering-reports.types.js +111 -0
  210. package/common/types/offering-reports.types.js.map +1 -0
  211. package/common/types/offering-submission.types.d.ts +587 -0
  212. package/common/types/offering-submission.types.js +278 -0
  213. package/common/types/offering-submission.types.js.map +1 -0
  214. package/common/types/offering.types.d.ts +2335 -0
  215. package/common/types/offering.types.js +505 -0
  216. package/common/types/offering.types.js.map +1 -0
  217. package/common/types/page-revision.types.d.ts +74 -0
  218. package/common/types/page-revision.types.js +68 -0
  219. package/common/types/page-revision.types.js.map +1 -0
  220. package/common/types/page.types.d.ts +540 -0
  221. package/common/types/page.types.js +361 -0
  222. package/common/types/page.types.js.map +1 -0
  223. package/common/types/password.type.d.ts +2 -0
  224. package/common/types/password.type.js +14 -0
  225. package/common/types/password.type.js.map +1 -0
  226. package/common/types/payment-methods.types.d.ts +800 -0
  227. package/common/types/payment-methods.types.js +260 -0
  228. package/common/types/payment-methods.types.js.map +1 -0
  229. package/common/types/phone.type.d.ts +12 -0
  230. package/common/types/phone.type.js +29 -0
  231. package/common/types/phone.type.js.map +1 -0
  232. package/common/types/portfolio.types.d.ts +185 -0
  233. package/common/types/portfolio.types.js +36 -0
  234. package/common/types/portfolio.types.js.map +1 -0
  235. package/common/types/privacy-policy-and-tos.types.d.ts +2 -0
  236. package/common/types/{privacy-policy-and-tos.types.ts → privacy-policy-and-tos.types.js} +1 -1
  237. package/common/types/privacy-policy-and-tos.types.js.map +1 -0
  238. package/common/types/queue.types.d.ts +22 -0
  239. package/common/types/queue.types.js +73 -0
  240. package/common/types/queue.types.js.map +1 -0
  241. package/common/types/registered-reps.types.d.ts +6 -0
  242. package/common/types/registered-reps.types.js +21 -0
  243. package/common/types/registered-reps.types.js.map +1 -0
  244. package/common/types/rejection-reasons.types.d.ts +35 -0
  245. package/common/types/rejection-reasons.types.js +49 -0
  246. package/common/types/rejection-reasons.types.js.map +1 -0
  247. package/common/types/review.types.d.ts +419 -0
  248. package/common/types/review.types.js +101 -0
  249. package/common/types/review.types.js.map +1 -0
  250. package/common/types/role.types.d.ts +30 -0
  251. package/common/types/role.types.js +21 -0
  252. package/common/types/role.types.js.map +1 -0
  253. package/common/types/secondary-customer.types.d.ts +586 -0
  254. package/common/types/secondary-customer.types.js +39 -0
  255. package/common/types/secondary-customer.types.js.map +1 -0
  256. package/common/types/secondary-issuer.types.d.ts +283 -0
  257. package/common/types/secondary-issuer.types.js +37 -0
  258. package/common/types/secondary-issuer.types.js.map +1 -0
  259. package/common/types/secondary-order.types.d.ts +508 -0
  260. package/common/types/secondary-order.types.js +40 -0
  261. package/common/types/secondary-order.types.js.map +1 -0
  262. package/common/types/secondary-security.types.d.ts +175 -0
  263. package/common/types/secondary-security.types.js +45 -0
  264. package/common/types/secondary-security.types.js.map +1 -0
  265. package/common/types/secondary-trade.entity.d.ts +16 -0
  266. package/common/types/secondary-trade.entity.js +12 -0
  267. package/common/types/secondary-trade.entity.js.map +1 -0
  268. package/common/types/secondary-trade.types.d.ts +465 -0
  269. package/common/types/secondary-trade.types.js +61 -0
  270. package/common/types/secondary-trade.types.js.map +1 -0
  271. package/common/types/secure-request.types.d.ts +171 -0
  272. package/common/types/secure-request.types.js +51 -0
  273. package/common/types/secure-request.types.js.map +1 -0
  274. package/common/types/signer.types.d.ts +3394 -0
  275. package/common/types/signer.types.js +517 -0
  276. package/common/types/signer.types.js.map +1 -0
  277. package/common/types/site-link.types.d.ts +875 -0
  278. package/common/types/site-link.types.js +126 -0
  279. package/common/types/site-link.types.js.map +1 -0
  280. package/common/types/site-settings.types.d.ts +1673 -0
  281. package/common/types/site-settings.types.js +500 -0
  282. package/common/types/site-settings.types.js.map +1 -0
  283. package/common/types/site.types.d.ts +1476 -0
  284. package/common/types/site.types.js +213 -0
  285. package/common/types/site.types.js.map +1 -0
  286. package/common/types/sms.types.d.ts +40 -0
  287. package/common/types/sms.types.js +27 -0
  288. package/common/types/sms.types.js.map +1 -0
  289. package/common/types/state-machine.types.d.ts +591 -0
  290. package/common/types/state-machine.types.js +144 -0
  291. package/common/types/state-machine.types.js.map +1 -0
  292. package/common/types/states.types.d.ts +77 -0
  293. package/common/types/states.types.js +137 -0
  294. package/common/types/states.types.js.map +1 -0
  295. package/common/types/subdoc-preview.types.d.ts +379 -0
  296. package/common/types/subdoc-preview.types.js +24 -0
  297. package/common/types/subdoc-preview.types.js.map +1 -0
  298. package/common/types/task.types.d.ts +537 -0
  299. package/common/types/task.types.js +211 -0
  300. package/common/types/task.types.js.map +1 -0
  301. package/common/types/trade-adjustment.type.d.ts +40 -0
  302. package/common/types/trade-adjustment.type.js +26 -0
  303. package/common/types/trade-adjustment.type.js.map +1 -0
  304. package/common/types/trade-line-item.types.d.ts +312 -0
  305. package/common/types/trade-line-item.types.js +89 -0
  306. package/common/types/trade-line-item.types.js.map +1 -0
  307. package/common/types/trade.types.d.ts +1987 -0
  308. package/common/types/trade.types.js +780 -0
  309. package/common/types/trade.types.js.map +1 -0
  310. package/common/types/transaction.types.d.ts +375 -0
  311. package/common/types/transaction.types.js +154 -0
  312. package/common/types/transaction.types.js.map +1 -0
  313. package/common/types/trusted-contact.types.d.ts +440 -0
  314. package/common/types/trusted-contact.types.js +95 -0
  315. package/common/types/trusted-contact.types.js.map +1 -0
  316. package/common/types/typography.types.d.ts +52 -0
  317. package/common/types/typography.types.js +67 -0
  318. package/common/types/typography.types.js.map +1 -0
  319. package/common/types/user-manual.types.d.ts +287 -0
  320. package/common/types/user-manual.types.js +192 -0
  321. package/common/types/user-manual.types.js.map +1 -0
  322. package/common/types/user-setting.types.d.ts +273 -0
  323. package/common/types/user-setting.types.js +85 -0
  324. package/common/types/user-setting.types.js.map +1 -0
  325. package/common/types/user.types.d.ts +1946 -0
  326. package/common/types/user.types.js +237 -0
  327. package/common/types/user.types.js.map +1 -0
  328. package/common/types/webhook.types.d.ts +10829 -0
  329. package/common/types/webhook.types.js +658 -0
  330. package/common/types/webhook.types.js.map +1 -0
  331. package/common/types/zip.type.d.ts +35 -0
  332. package/common/types/zip.type.js +28 -0
  333. package/common/types/zip.type.js.map +1 -0
  334. package/contracts/clients/accounts/index.d.ts +308 -0
  335. package/contracts/clients/accounts/index.js +43 -0
  336. package/contracts/clients/accounts/index.js.map +1 -0
  337. package/contracts/clients/aic/index.d.ts +280 -0
  338. package/contracts/clients/aic/index.js +47 -0
  339. package/contracts/clients/aic/index.js.map +1 -0
  340. package/contracts/clients/api-key-logs/index.d.ts +287 -0
  341. package/contracts/clients/api-key-logs/index.js +37 -0
  342. package/contracts/clients/api-key-logs/index.js.map +1 -0
  343. package/contracts/clients/api-keys/index.d.ts +374 -0
  344. package/contracts/clients/api-keys/index.js +59 -0
  345. package/contracts/clients/api-keys/index.js.map +1 -0
  346. package/contracts/clients/assets/index.d.ts +1028 -0
  347. package/contracts/clients/assets/index.js +80 -0
  348. package/contracts/clients/assets/index.js.map +1 -0
  349. package/contracts/clients/auth/index.d.ts +236 -0
  350. package/contracts/clients/auth/index.js +38 -0
  351. package/contracts/clients/auth/index.js.map +1 -0
  352. package/contracts/clients/cart/index.d.ts +229 -0
  353. package/contracts/clients/cart/index.js +63 -0
  354. package/contracts/clients/cart/index.js.map +1 -0
  355. package/contracts/clients/files/index.d.ts +552 -0
  356. package/contracts/clients/files/index.js +142 -0
  357. package/contracts/clients/files/index.js.map +1 -0
  358. package/contracts/clients/files-public/index.d.ts +552 -0
  359. package/contracts/clients/files-public/index.js +142 -0
  360. package/contracts/clients/files-public/index.js.map +1 -0
  361. package/contracts/clients/index.d.ts +12476 -0
  362. package/contracts/clients/index.js +52 -0
  363. package/contracts/clients/index.js.map +1 -0
  364. package/contracts/clients/individuals/index.d.ts +3199 -0
  365. package/contracts/clients/individuals/index.js +74 -0
  366. package/contracts/clients/individuals/index.js.map +1 -0
  367. package/contracts/clients/investor-accounts/index.d.ts +339 -0
  368. package/contracts/clients/investor-accounts/index.js +73 -0
  369. package/contracts/clients/investor-accounts/index.js.map +1 -0
  370. package/contracts/clients/issuer-payment-methods/index.d.ts +276 -0
  371. package/contracts/clients/issuer-payment-methods/index.js +24 -0
  372. package/contracts/clients/issuer-payment-methods/index.js.map +1 -0
  373. package/contracts/clients/issuers/index.d.ts +449 -0
  374. package/contracts/clients/issuers/index.js +75 -0
  375. package/contracts/clients/issuers/index.js.map +1 -0
  376. package/contracts/clients/kyc/index.d.ts +345 -0
  377. package/contracts/clients/kyc/index.js +49 -0
  378. package/contracts/clients/kyc/index.js.map +1 -0
  379. package/contracts/clients/legal-entities/index.d.ts +887 -0
  380. package/contracts/clients/legal-entities/index.js +74 -0
  381. package/contracts/clients/legal-entities/index.js.map +1 -0
  382. package/contracts/clients/offerings/index.d.ts +767 -0
  383. package/contracts/clients/offerings/index.js +95 -0
  384. package/contracts/clients/offerings/index.js.map +1 -0
  385. package/contracts/clients/payment-methods/index.d.ts +456 -0
  386. package/contracts/clients/payment-methods/index.js +68 -0
  387. package/contracts/clients/payment-methods/index.js.map +1 -0
  388. package/contracts/clients/secure-requests/index.d.ts +100 -0
  389. package/contracts/clients/secure-requests/index.js +22 -0
  390. package/contracts/clients/secure-requests/index.js.map +1 -0
  391. package/contracts/clients/sites/index.d.ts +657 -0
  392. package/contracts/clients/sites/index.js +40 -0
  393. package/contracts/clients/sites/index.js.map +1 -0
  394. package/contracts/clients/trade-line-items/index.d.ts +216 -0
  395. package/contracts/clients/trade-line-items/index.js +47 -0
  396. package/contracts/clients/trade-line-items/index.js.map +1 -0
  397. package/contracts/clients/trades/index.d.ts +865 -0
  398. package/contracts/clients/trades/index.js +156 -0
  399. package/contracts/clients/trades/index.js.map +1 -0
  400. package/contracts/clients/transactions/index.d.ts +88 -0
  401. package/contracts/clients/transactions/index.js +25 -0
  402. package/contracts/clients/transactions/index.js.map +1 -0
  403. package/package.json +27 -36
  404. package/common/helpers/index.ts +0 -59
  405. package/common/types/account-contact.types.ts +0 -98
  406. package/common/types/account-detail.types.ts +0 -27
  407. package/common/types/account-integration.types.ts +0 -143
  408. package/common/types/account-manager.types.ts +0 -124
  409. package/common/types/account.types.ts +0 -296
  410. package/common/types/activity.types.ts +0 -274
  411. package/common/types/address.types.ts +0 -41
  412. package/common/types/aic.types.ts +0 -246
  413. package/common/types/aml.types.ts +0 -18
  414. package/common/types/api-key-logs.types.ts +0 -66
  415. package/common/types/api-keys.types.ts +0 -69
  416. package/common/types/asset.types.ts +0 -338
  417. package/common/types/auth.types.ts +0 -370
  418. package/common/types/batch-jobs.types.ts +0 -151
  419. package/common/types/bonus-tier.types.ts +0 -147
  420. package/common/types/cart.types.ts +0 -18
  421. package/common/types/checklist-items.types.ts +0 -70
  422. package/common/types/checklist.types.ts +0 -97
  423. package/common/types/common.types.ts +0 -1520
  424. package/common/types/comply-advantage-api.types.ts +0 -316
  425. package/common/types/comply-advantage.types.ts +0 -25
  426. package/common/types/contact-us.types.ts +0 -107
  427. package/common/types/countries.types.ts +0 -375
  428. package/common/types/covered-person.types.ts +0 -274
  429. package/common/types/dashboard.types.ts +0 -799
  430. package/common/types/data-record.types.ts +0 -325
  431. package/common/types/data-room.types.ts +0 -242
  432. package/common/types/default-theme-config.types.ts +0 -87
  433. package/common/types/disbursement-adjustment.types.ts +0 -32
  434. package/common/types/disbursement-approval-user.types.ts +0 -100
  435. package/common/types/disbursement-review.types.ts +0 -110
  436. package/common/types/disbursement-transaction.types.ts +0 -72
  437. package/common/types/disbursements.types.ts +0 -310
  438. package/common/types/domain-filter.types.ts +0 -55
  439. package/common/types/email-theme.types.ts +0 -442
  440. package/common/types/entity.types.ts +0 -15
  441. package/common/types/error-responses.types.ts +0 -135
  442. package/common/types/escrow-account.types.ts +0 -104
  443. package/common/types/exchange-api-key.types.ts +0 -121
  444. package/common/types/exchange-import.types.ts +0 -36
  445. package/common/types/exchange-provider.types.ts +0 -329
  446. package/common/types/file.types.ts +0 -461
  447. package/common/types/health.types.ts +0 -29
  448. package/common/types/individuals.types.ts +0 -554
  449. package/common/types/investor-account.types.ts +0 -1239
  450. package/common/types/investors-offering.types.ts +0 -65
  451. package/common/types/invite.types.ts +0 -133
  452. package/common/types/issuer-bank-account.types.ts +0 -107
  453. package/common/types/issuer-offering.types.ts +0 -393
  454. package/common/types/issuer-payment-method.types.ts +0 -341
  455. package/common/types/issuer.types.ts +0 -312
  456. package/common/types/job-item.types.ts +0 -119
  457. package/common/types/jobs.types.ts +0 -171
  458. package/common/types/kyb.types.ts +0 -53
  459. package/common/types/kyc.types.ts +0 -188
  460. package/common/types/legal-entity.types.ts +0 -185
  461. package/common/types/login-history.types.ts +0 -46
  462. package/common/types/mail-template.types.ts +0 -436
  463. package/common/types/north-cap-integration.types.ts +0 -190
  464. package/common/types/note.types.ts +0 -109
  465. package/common/types/notification.types.ts +0 -58
  466. package/common/types/notion-api.types.ts +0 -374
  467. package/common/types/notion-database.types.ts +0 -125
  468. package/common/types/notion-page.types.ts +0 -267
  469. package/common/types/offering-reports.types.ts +0 -153
  470. package/common/types/offering-submission.types.ts +0 -314
  471. package/common/types/offering.types.ts +0 -681
  472. package/common/types/page-revision.types.ts +0 -86
  473. package/common/types/page.types.ts +0 -436
  474. package/common/types/password.type.ts +0 -15
  475. package/common/types/payment-methods.types.ts +0 -298
  476. package/common/types/phone.type.ts +0 -27
  477. package/common/types/portfolio.types.ts +0 -50
  478. package/common/types/queue.types.ts +0 -112
  479. package/common/types/registered-reps.types.ts +0 -25
  480. package/common/types/rejection-reasons.types.ts +0 -56
  481. package/common/types/reminder-config.types.ts +0 -40
  482. package/common/types/review.types.ts +0 -133
  483. package/common/types/role.types.ts +0 -26
  484. package/common/types/secondary-customer.types.ts +0 -66
  485. package/common/types/secondary-issuer.types.ts +0 -50
  486. package/common/types/secondary-order.types.ts +0 -58
  487. package/common/types/secondary-security.types.ts +0 -60
  488. package/common/types/secondary-trade.entity.ts +0 -16
  489. package/common/types/secondary-trade.types.ts +0 -95
  490. package/common/types/secure-request.types.ts +0 -68
  491. package/common/types/signer.types.ts +0 -651
  492. package/common/types/site-link.types.ts +0 -166
  493. package/common/types/site-settings.types.ts +0 -726
  494. package/common/types/site.types.ts +0 -270
  495. package/common/types/sms.types.ts +0 -30
  496. package/common/types/state-machine.types.ts +0 -177
  497. package/common/types/states.types.ts +0 -163
  498. package/common/types/subdoc-preview.types.ts +0 -35
  499. package/common/types/task.types.ts +0 -258
  500. package/common/types/trade-adjustment.type.ts +0 -33
  501. package/common/types/trade-line-item.type.ts +0 -132
  502. package/common/types/trade.types.ts +0 -999
  503. package/common/types/transaction.types.ts +0 -198
  504. package/common/types/trusted-contact.types.ts +0 -122
  505. package/common/types/typography.types.ts +0 -75
  506. package/common/types/user-manual.types.ts +0 -290
  507. package/common/types/user-setting.types.ts +0 -133
  508. package/common/types/user.types.ts +0 -320
  509. package/common/types/webhook.types.ts +0 -588
  510. package/common/types/zip.type.ts +0 -36
  511. package/contracts/clients/accounts/index.ts +0 -61
  512. package/contracts/clients/aic/index.ts +0 -59
  513. package/contracts/clients/api-key-logs/index.ts +0 -53
  514. package/contracts/clients/api-keys/index.ts +0 -73
  515. package/contracts/clients/assets/index.ts +0 -102
  516. package/contracts/clients/auth/index.ts +0 -50
  517. package/contracts/clients/cart/index.ts +0 -60
  518. package/contracts/clients/files/index.ts +0 -166
  519. package/contracts/clients/files-public/index.ts +0 -166
  520. package/contracts/clients/index.ts +0 -48
  521. package/contracts/clients/individuals/index.ts +0 -93
  522. package/contracts/clients/investor-accounts/index.ts +0 -93
  523. package/contracts/clients/issuers/index.ts +0 -94
  524. package/contracts/clients/legal-entities/index.ts +0 -93
  525. package/contracts/clients/offerings/index.ts +0 -117
  526. package/contracts/clients/secure-requests/index.ts +0 -34
  527. package/contracts/clients/sites/index.ts +0 -56
  528. package/contracts/clients/trade-line-items/index.ts +0 -66
  529. package/contracts/clients/trades/index.ts +0 -186
  530. package/contracts/compliance/account-contacts/index.ts +0 -82
  531. package/contracts/compliance/account-managers/index.ts +0 -142
  532. package/contracts/compliance/accounts/index.ts +0 -187
  533. package/contracts/compliance/activities/index.ts +0 -55
  534. package/contracts/compliance/aic/index.ts +0 -60
  535. package/contracts/compliance/api-keys/index.ts +0 -91
  536. package/contracts/compliance/assets/index.ts +0 -122
  537. package/contracts/compliance/auth/index.ts +0 -134
  538. package/contracts/compliance/batch-jobs/index.ts +0 -62
  539. package/contracts/compliance/bonus-tiers/index.ts +0 -55
  540. package/contracts/compliance/checklist/index.ts +0 -87
  541. package/contracts/compliance/checklist-items/index.ts +0 -86
  542. package/contracts/compliance/covered-persons/index.ts +0 -97
  543. package/contracts/compliance/dashboard/index.ts +0 -111
  544. package/contracts/compliance/data-records/index.ts +0 -116
  545. package/contracts/compliance/data-rooms/index.ts +0 -113
  546. package/contracts/compliance/default-theme-configs/index.ts +0 -95
  547. package/contracts/compliance/disbursement/index.ts +0 -165
  548. package/contracts/compliance/disbursement-approval-users/index.ts +0 -84
  549. package/contracts/compliance/disbursement-transactions/index.ts +0 -37
  550. package/contracts/compliance/domain-filters/index.ts +0 -117
  551. package/contracts/compliance/email-themes/index.ts +0 -284
  552. package/contracts/compliance/escrow-accounts/index.ts +0 -85
  553. package/contracts/compliance/exchange-api-keys/index.ts +0 -129
  554. package/contracts/compliance/exchange-imports/index.ts +0 -137
  555. package/contracts/compliance/files/index.ts +0 -267
  556. package/contracts/compliance/files-public/index.ts +0 -188
  557. package/contracts/compliance/health/index.ts +0 -26
  558. package/contracts/compliance/index.ts +0 -147
  559. package/contracts/compliance/individuals/index.ts +0 -57
  560. package/contracts/compliance/investor-accounts/index.ts +0 -141
  561. package/contracts/compliance/invites/index.ts +0 -137
  562. package/contracts/compliance/issuer-bank-accounts/index.ts +0 -81
  563. package/contracts/compliance/issuer-payment-methods/index.ts +0 -81
  564. package/contracts/compliance/issuers/index.ts +0 -97
  565. package/contracts/compliance/job-items/index.ts +0 -58
  566. package/contracts/compliance/jobs/index.ts +0 -59
  567. package/contracts/compliance/kyb/index.ts +0 -54
  568. package/contracts/compliance/kyc/index.ts +0 -77
  569. package/contracts/compliance/legal-entities/index.ts +0 -57
  570. package/contracts/compliance/login-histories/index.ts +0 -37
  571. package/contracts/compliance/notes/index.ts +0 -69
  572. package/contracts/compliance/notion-databases/index.ts +0 -107
  573. package/contracts/compliance/notion-pages/index.ts +0 -105
  574. package/contracts/compliance/offering-reports/index.ts +0 -149
  575. package/contracts/compliance/offerings/index.ts +0 -233
  576. package/contracts/compliance/pages/index.ts +0 -178
  577. package/contracts/compliance/payment-methods/index.ts +0 -57
  578. package/contracts/compliance/rejection-reasons/index.ts +0 -32
  579. package/contracts/compliance/review/index.ts +0 -169
  580. package/contracts/compliance/roles/index.ts +0 -34
  581. package/contracts/compliance/secondary-customers/index.ts +0 -77
  582. package/contracts/compliance/secondary-orders/index.ts +0 -60
  583. package/contracts/compliance/secondary-trades/index.ts +0 -100
  584. package/contracts/compliance/secure-requests/index.ts +0 -54
  585. package/contracts/compliance/signer/index.ts +0 -369
  586. package/contracts/compliance/site-links/index.ts +0 -128
  587. package/contracts/compliance/site-settings/index.ts +0 -669
  588. package/contracts/compliance/sites/index.ts +0 -56
  589. package/contracts/compliance/state-machine/index.ts +0 -94
  590. package/contracts/compliance/tasks/index.ts +0 -91
  591. package/contracts/compliance/third-parties/index.ts +0 -52
  592. package/contracts/compliance/trade-line-items/index.ts +0 -59
  593. package/contracts/compliance/trades/index.ts +0 -230
  594. package/contracts/compliance/transactions/index.ts +0 -161
  595. package/contracts/compliance/user-manuals/index.ts +0 -271
  596. package/contracts/compliance/user-settings/index.ts +0 -189
  597. package/contracts/compliance/users/index.ts +0 -200
  598. package/contracts/compliance/webhooks/index.ts +0 -41
  599. package/contracts/compliance-apikey/accounts/index.ts +0 -58
  600. package/contracts/compliance-apikey/index.ts +0 -14
  601. package/contracts/index.ts +0 -6
  602. package/contracts/investors/account-contacts/index.ts +0 -58
  603. package/contracts/investors/aic/index.ts +0 -59
  604. package/contracts/investors/assets/index.ts +0 -61
  605. package/contracts/investors/auth/index.ts +0 -116
  606. package/contracts/investors/bonus-tiers/index.ts +0 -37
  607. package/contracts/investors/cart/index.ts +0 -75
  608. package/contracts/investors/contact-us/index.ts +0 -48
  609. package/contracts/investors/data-records/index.ts +0 -113
  610. package/contracts/investors/data-rooms/index.ts +0 -96
  611. package/contracts/investors/files/index.ts +0 -167
  612. package/contracts/investors/files-public/index.ts +0 -185
  613. package/contracts/investors/index.ts +0 -72
  614. package/contracts/investors/individuals/index.ts +0 -99
  615. package/contracts/investors/investor-accounts/index.ts +0 -110
  616. package/contracts/investors/issuer-payment-methods/index.ts +0 -36
  617. package/contracts/investors/issuers/index.ts +0 -30
  618. package/contracts/investors/legal-entities/index.ts +0 -93
  619. package/contracts/investors/notes/index.ts +0 -69
  620. package/contracts/investors/offerings/index.ts +0 -93
  621. package/contracts/investors/pages/index.ts +0 -88
  622. package/contracts/investors/payment-methods/index.ts +0 -149
  623. package/contracts/investors/portfolios/index.ts +0 -53
  624. package/contracts/investors/sites/index.ts +0 -96
  625. package/contracts/investors/tasks/index.ts +0 -111
  626. package/contracts/investors/trade-line-items/index.ts +0 -75
  627. package/contracts/investors/trades/index.ts +0 -114
  628. package/contracts/investors/transactions/index.ts +0 -37
  629. package/contracts/investors/trusted-contacts/index.ts +0 -93
  630. package/contracts/investors/user-manuals/index.ts +0 -62
  631. package/contracts/investors/user-settings/index.ts +0 -170
  632. package/contracts/investors/users/index.ts +0 -45
  633. package/contracts/investors/webhooks/index.ts +0 -30
  634. package/contracts/issuers/account-contacts/index.ts +0 -76
  635. package/contracts/issuers/account-integrations/index.ts +0 -97
  636. package/contracts/issuers/accounts/index.ts +0 -97
  637. package/contracts/issuers/activities/index.ts +0 -54
  638. package/contracts/issuers/aic/index.ts +0 -39
  639. package/contracts/issuers/api-key-logs/index.ts +0 -53
  640. package/contracts/issuers/api-keys/index.ts +0 -93
  641. package/contracts/issuers/assets/index.ts +0 -122
  642. package/contracts/issuers/auth/index.ts +0 -152
  643. package/contracts/issuers/bonus-tiers/index.ts +0 -55
  644. package/contracts/issuers/contact-us/index.ts +0 -48
  645. package/contracts/issuers/covered-persons/index.ts +0 -136
  646. package/contracts/issuers/dashboard/index.ts +0 -72
  647. package/contracts/issuers/data-records/index.ts +0 -257
  648. package/contracts/issuers/data-rooms/index.ts +0 -134
  649. package/contracts/issuers/disbursement-approval-users/index.ts +0 -82
  650. package/contracts/issuers/disbursement-transactions/index.ts +0 -53
  651. package/contracts/issuers/disbursements/index.ts +0 -153
  652. package/contracts/issuers/email-themes/index.ts +0 -242
  653. package/contracts/issuers/escrow-accounts/index.ts +0 -81
  654. package/contracts/issuers/exchange-api-keys/index.ts +0 -144
  655. package/contracts/issuers/files/index.ts +0 -166
  656. package/contracts/issuers/files-public/index.ts +0 -166
  657. package/contracts/issuers/health/index.ts +0 -24
  658. package/contracts/issuers/index.ts +0 -112
  659. package/contracts/issuers/investor-accounts/index.ts +0 -148
  660. package/contracts/issuers/invites/index.ts +0 -129
  661. package/contracts/issuers/issuer/index.ts +0 -94
  662. package/contracts/issuers/issuer-bank-accounts/index.ts +0 -81
  663. package/contracts/issuers/issuer-payment-methods/index.ts +0 -136
  664. package/contracts/issuers/kyc/index.ts +0 -38
  665. package/contracts/issuers/login-histories/index.ts +0 -51
  666. package/contracts/issuers/notes/index.ts +0 -69
  667. package/contracts/issuers/offerings/index.ts +0 -206
  668. package/contracts/issuers/pages/index.ts +0 -138
  669. package/contracts/issuers/payment-methods/index.ts +0 -61
  670. package/contracts/issuers/portfolios/index.ts +0 -36
  671. package/contracts/issuers/rejection-reasons/index.ts +0 -32
  672. package/contracts/issuers/review/index.ts +0 -63
  673. package/contracts/issuers/secondary-customers/index.ts +0 -55
  674. package/contracts/issuers/secondary-orders/index.ts +0 -57
  675. package/contracts/issuers/secondary-trades/index.ts +0 -57
  676. package/contracts/issuers/secure-requests/index.ts +0 -34
  677. package/contracts/issuers/site-links/index.ts +0 -116
  678. package/contracts/issuers/site-settings/index.ts +0 -585
  679. package/contracts/issuers/sites/index.ts +0 -32
  680. package/contracts/issuers/tasks/index.ts +0 -111
  681. package/contracts/issuers/trades/index.ts +0 -132
  682. package/contracts/issuers/transactions/index.ts +0 -158
  683. package/contracts/issuers/user-manuals/index.ts +0 -62
  684. package/contracts/issuers/user-settings/index.ts +0 -170
  685. package/contracts/issuers/users/index.ts +0 -126
  686. package/contracts/secondaries/accounts/index.ts +0 -58
  687. package/contracts/secondaries/index.ts +0 -23
  688. package/contracts/secondaries/secondary-customers/index.ts +0 -55
  689. package/contracts/secondaries/secondary-issuers/index.ts +0 -94
  690. package/contracts/secondaries/secondary-orders/index.ts +0 -56
  691. package/contracts/secondaries/secondary-securities/index.ts +0 -95
  692. package/contracts/secondaries/secondary-trades/index.ts +0 -56
  693. /package/common/types/{investorAccountIdSchema.type.ts → investorAccountIdSchema.type.d.ts} +0 -0
@@ -1,1520 +0,0 @@
1
- import { extendZodWithOpenApi } from '@anatine/zod-openapi';
2
- import { IBaseEntity } from './entity.types';
3
- import { z } from 'zod';
4
- import { TypeID } from 'typeid-js';
5
- import { ErrorHttpStatusCode } from '@ts-rest/core';
6
- import { TwoFactorMethod } from './sms.types';
7
- import { normalizeShortDate } from '../helpers';
8
- import { HttpStatus } from '@nestjs/common';
9
-
10
- extendZodWithOpenApi(z);
11
-
12
- // All possible statuses for the system
13
- export enum BaseStatus {
14
- NEEDS_REVIEW = 'NEEDS_REVIEW',
15
- PENDING = 'PENDING',
16
- APPROVED = 'APPROVED',
17
- REJECTED = 'REJECTED',
18
- IN_REVIEW = 'IN_REVIEW',
19
- ADDITIONAL_INFO = 'ADDITIONAL_INFO',
20
- SUBMITTED = 'SUBMITTED',
21
- IN_PROGRESS = 'IN_PROGRESS',
22
- CANCELLED = 'CANCELLED',
23
- SETTLED = 'SETTLED',
24
- REFUNDED = 'REFUNDED',
25
- RESUBMIT = 'RESUBMIT',
26
- FUNDED = 'FUNDED',
27
- COMPLETED = 'COMPLETED',
28
- SIGNED = 'SIGNED',
29
- DECLINED = 'DECLINED',
30
- CART = 'CART',
31
- PLACED = 'PLACED',
32
- NEEDS_INFO = 'NEEDS_INFO',
33
- NEEDS_PAYMENT_INFO = 'NEEDS_PAYMENT_INFO',
34
- FUNDING = 'FUNDING',
35
- CHARGED = 'CHARGED',
36
- NEW = 'NEW',
37
- IMPORT_ERROR = 'IMPORT_ERROR',
38
- ERROR = 'ERROR',
39
- UPDATE_PAYMENT_METHOD = 'UPDATE_PAYMENT_METHOD',
40
- RE_SIGN = 'RE_SIGN',
41
- RESET_2FA = 'RESET_2FA',
42
- FORGOT_PASSWORD = 'FORGOT_PASSWORD',
43
- RESET_PASSWORD = 'RESET_PASSWORD',
44
- TWO_FACTOR_LOGIN = 'TWO_FACTOR_LOGIN',
45
- LOGIN = 'LOGIN',
46
- FAILED = 'FAILED',
47
- AUTHORIZING = 'AUTHORIZING',
48
- VALID = 'VALID',
49
- DELETED = 'DELETED',
50
- REVOKED = 'REVOKED',
51
- WARNING = 'WARNING',
52
- READY_TO_APPROVE = 'READY_TO_APPROVE',
53
- INCOMPLETE = 'INCOMPLETE',
54
- RE_PROCESS = 'RE_PROCESS',
55
- INVALID = 'INVALID',
56
- NOT_PROCESSED = 'NOT_PROCESSED',
57
- PROCESSING = 'PROCESSING',
58
- PROCESSING_ERROR = 'PROCESSING_ERROR',
59
- REVIEW_ERROR = 'REVIEW_ERROR',
60
- PROCESSED = 'PROCESSED',
61
- SAVE = 'SAVE',
62
- ACCEPTED = 'ACCEPTED',
63
- ONBOARDING = 'ONBOARDING',
64
- LIVE = 'LIVE',
65
- OVERDUE = 'OVERDUE',
66
- SUSPENDED = 'SUSPENDED',
67
- INACTIVE = 'INACTIVE',
68
- PARTIALLY_REFUNDED = 'PARTIALLY_REFUNDED',
69
- VOIDED = 'VOIDED',
70
- JOIN = 'JOIN',
71
- RESTORE = 'RESTORE',
72
- }
73
-
74
- export const UserWithoutPasswordAccountZod = IBaseEntity.extend({
75
- firstName: z.string().openapi({ example: 'Daniel' }),
76
- lastName: z.string().openapi({ example: 'Ice' }),
77
- email: z.string().email().openapi({ example: 'test@test.com' }),
78
- provider: z.string().openapi({ example: 'email' }),
79
- active: z.boolean().openapi({ example: true }),
80
- lastLoginAt: z.date().nullable().openapi({ example: new Date() }),
81
- loginCount: z.number().openapi({ example: 1 }),
82
- inviteId: z
83
- .string()
84
- .nullable()
85
- .openapi({ example: 'invite_01j1xgme5mfrasd02hmfwsy13a' }),
86
- accountId: z
87
- .string()
88
- .nullable()
89
- .openapi({ example: 'account_01j1xgme5mfrasd02hmfwsy13a' }),
90
- });
91
- export type UserWithoutPasswordAccountZod = z.infer<
92
- typeof UserWithoutPasswordAccountZod
93
- >;
94
- export enum ManagedByType {
95
- DALMORE = 'DALMORE',
96
- ISSUER = 'ISSUER',
97
- }
98
-
99
- export enum Platform {
100
- DALMORE = 'DALMORE',
101
- INTEGRATION = 'INTEGRATION',
102
- }
103
-
104
- export enum HttpMethod {
105
- GET = 'GET',
106
- POST = 'POST',
107
- PUT = 'PUT',
108
- PATCH = 'PATCH',
109
- DELETE = 'DELETE',
110
- HEAD = 'HEAD',
111
- OPTIONS = 'OPTIONS',
112
- }
113
-
114
- export const SENSITIVE_PATTERNS = [
115
- /password/i,
116
- /credit.*card/i,
117
- /ssn/i,
118
- /social.*security/i,
119
- /token/i,
120
- /access.*token/i,
121
- /code/i,
122
- /apiKey/i,
123
- /key/i,
124
- /stripeSecretKey/i,
125
- /usAccountNumber/i,
126
- /recoveryCodes/i,
127
- /totpSecret/i,
128
- /totpTemporarySecret/i,
129
- /smsVerificationCode/i,
130
- ];
131
-
132
- export enum AccountStatus {
133
- ONBOARDING = BaseStatus.ONBOARDING,
134
- LIVE = BaseStatus.LIVE,
135
- OVERDUE = BaseStatus.OVERDUE,
136
- SUSPENDED = BaseStatus.SUSPENDED,
137
- INACTIVE = BaseStatus.INACTIVE,
138
- }
139
- // CHANGES TO THIS WILL REQUIRE:
140
- // - Migrations to update the database
141
- // - Update to createDefaultIssuerPaymentMethods
142
- // - Update to existing issuers payment methods, see UpdateIssuerPaymentMethod1755035846643
143
- // - Updates to TradeFundingTransitionWorker
144
- export enum PaymentMethodType {
145
- CREDIT_CARD = 'CREDIT_CARD',
146
- WIRE = 'WIRE',
147
- ACH = 'ACH',
148
- BANK_ACCOUNT = 'BANK_ACCOUNT',
149
- CHECK = 'CHECK',
150
- RETIREMENT = 'RETIREMENT',
151
- }
152
-
153
- export const AccountZod = IBaseEntity.extend({
154
- name: z.string().openapi({ example: 'Dalmore' }),
155
- status: z.nativeEnum(AccountStatus).openapi({ example: AccountStatus.LIVE }),
156
- managedBy: z
157
- .nativeEnum(ManagedByType)
158
- .nullable()
159
- .openapi({ example: ManagedByType.DALMORE }),
160
- platform: z.nativeEnum(Platform).openapi({ example: Platform.INTEGRATION }),
161
- onboardingReviewerId: z
162
- .string()
163
- .nullable()
164
- .openapi({ example: 'user_01j1xgme5mfrasd02hmfwsy13a' }),
165
- onboardingReviewAt: z.date().nullable(),
166
- allowPendingComplianceReview: z.boolean().openapi({ example: false }),
167
- });
168
- export type AccountZod = z.infer<typeof AccountZod>;
169
-
170
- export const AccountWithoutUsersZod = IBaseEntity.extend({
171
- name: z.string().openapi({ example: 'Dalmore' }),
172
- status: z.nativeEnum(AccountStatus).openapi({ example: AccountStatus.LIVE }),
173
- managedBy: z
174
- .nativeEnum(ManagedByType)
175
- .nullable()
176
- .openapi({ example: ManagedByType.DALMORE }),
177
- platform: z.nativeEnum(Platform).openapi({ example: Platform.INTEGRATION }),
178
- onboardingReviewerId: z
179
- .string()
180
- .nullable()
181
- .openapi({ example: 'user_01j1xgme5mfrasd02hmfwsy13a' }),
182
- onboardingReviewAt: z.date().nullable(),
183
- allowPendingComplianceReview: z.boolean().openapi({ example: false }),
184
- });
185
- export type AccountWithoutUsersZod = z.infer<typeof AccountWithoutUsersZod>;
186
-
187
- export enum PortalType {
188
- COMPLIANCE = 'COMPLIANCE',
189
- ISSUER = 'ISSUER',
190
- INVESTOR = 'INVESTOR',
191
- CLIENT = 'CLIENT',
192
- SECONDARIES = 'SECONDARIES',
193
- COMPLIANCE_APIKEY = 'COMPLIANCE_APIKEY',
194
- }
195
-
196
- export enum UserType {
197
- USER = 'USER',
198
- LEAD = 'LEAD',
199
- INVESTOR = 'INVESTOR',
200
- DEMO = 'DEMO',
201
- }
202
-
203
- export enum UserStatus {
204
- ACTIVE = 'ACTIVE',
205
- LOCKED = 'LOCKED',
206
- }
207
-
208
- export enum UserRole {
209
- API_KEY = 'API_KEY',
210
- IMPORT = 'IMPORT',
211
- VIEWER = 'VIEWER',
212
- SUPPORT = 'SUPPORT',
213
- COMPLIANCE = 'COMPLIANCE',
214
- ADMIN = 'ADMIN',
215
- MARKETER = 'MARKETER',
216
- OWNER = 'OWNER',
217
- LEGAL = 'LEGAL',
218
- COMMUNITY_MANAGER = 'COMMUNITY_MANAGER',
219
- ESCROW_AGENT = 'ESCROW_AGENT',
220
- AGENT = 'AGENT',
221
- ONBOARDING = 'ONBOARDING',
222
- }
223
- export enum IssuerRole {
224
- VIEWER = 'VIEWER',
225
- OWNER = 'OWNER',
226
- MARKETER = 'MARKETER',
227
- LEGAL = 'LEGAL',
228
- COMMUNITY_MANAGER = 'COMMUNITY_MANAGER',
229
- COMPLIANCE = 'COMPLIANCE',
230
- ADMIN = 'ADMIN',
231
- SUPPORT = 'SUPPORT',
232
- }
233
-
234
- export enum FileContainerType {
235
- SITE = 'SITE',
236
- PRIVATE = 'PRIVATE',
237
- PUBLIC = 'PUBLIC',
238
- ASSET = 'ASSET',
239
- }
240
- export enum UserDataType {
241
- LIVE = 'LIVE',
242
- TEST = 'TEST',
243
- }
244
- // Base interface for role hierarchies
245
- interface RoleHierarchy {
246
- type: PortalType;
247
- roles: string[];
248
- }
249
-
250
- export enum AccountContactType {
251
- GENERAL = 'GENERAL',
252
- INVESTOR = 'INVESTOR',
253
- ISSUER = 'ISSUER',
254
- }
255
-
256
- // Configuration for portals and their roles - in order of hierarchy
257
- export const PortalConfig: Record<PortalType, RoleHierarchy> = {
258
- // JWT AUTH
259
- [PortalType.COMPLIANCE]: {
260
- type: PortalType.COMPLIANCE,
261
- roles: [
262
- UserRole.IMPORT,
263
- UserRole.VIEWER,
264
- UserRole.SUPPORT,
265
- UserRole.COMPLIANCE,
266
- UserRole.ADMIN,
267
- ],
268
- },
269
- [PortalType.ISSUER]: {
270
- type: PortalType.ISSUER,
271
- roles: [UserRole.MARKETER, UserRole.OWNER],
272
- },
273
- [PortalType.INVESTOR]: {
274
- type: PortalType.INVESTOR,
275
- roles: [UserRole.VIEWER, UserRole.OWNER],
276
- },
277
- // API KEY AUTH
278
- [PortalType.CLIENT]: {
279
- type: PortalType.CLIENT,
280
- roles: [UserRole.API_KEY],
281
- },
282
- [PortalType.SECONDARIES]: {
283
- type: PortalType.SECONDARIES,
284
- roles: [UserRole.API_KEY],
285
- },
286
- [PortalType.COMPLIANCE_APIKEY]: {
287
- type: PortalType.COMPLIANCE_APIKEY,
288
- roles: [UserRole.API_KEY],
289
- },
290
- };
291
-
292
- export const BaseAuthReq = z.object({
293
- id: z.string(),
294
- accountId: z.string(),
295
- isInactiveAccount: z.boolean(),
296
- active: z.boolean(),
297
- role: z.nativeEnum(UserRole),
298
- type: z.nativeEnum(PortalType),
299
- roleId: z.string(),
300
- });
301
-
302
- // Regular user type extending base
303
- export const AuthUserReq = BaseAuthReq.extend({
304
- userLoginId: z.string(),
305
- firstName: z.string(),
306
- lastName: z.string(),
307
- email: z.string().email(),
308
- provider: z.string(),
309
- status: z.lazy(() => z.nativeEnum(UserStatus)),
310
- lastLoginAt: z.date().nullable(),
311
- loginCount: z.number(),
312
- requiresTwoFactorSetup: z.boolean().optional(),
313
- twoFactorEnabled: z.boolean().optional(),
314
- twoFactorMethod: z.nativeEnum(TwoFactorMethod).optional(),
315
- managedBy: z.nativeEnum(ManagedByType).optional(),
316
- userType: z.nativeEnum(UserType).optional(),
317
- });
318
-
319
- // API key type extending base
320
- export const AuthApiKeyReq = BaseAuthReq.extend({
321
- name: z.string(),
322
- description: z.string().nullable(),
323
- lastUsedAt: z.date().nullable(),
324
- });
325
-
326
- export type BaseAuthReq = z.infer<typeof BaseAuthReq>;
327
- export type AuthUserReq = z.infer<typeof AuthUserReq>;
328
- export type AuthApiKeyReq = z.infer<typeof AuthApiKeyReq>;
329
-
330
- export const UserWithoutPasswordZod = IBaseEntity.extend({
331
- firstName: z.string().openapi({ example: 'Daniel' }),
332
- lastName: z.string().openapi({ example: 'Ice' }),
333
- email: z.string().email().openapi({ example: 'test@test.com' }),
334
- provider: z.string().openapi({ example: 'email' }),
335
- active: z.boolean().openapi({ example: true }),
336
- lastLoginAt: z.date().nullable().openapi({ example: new Date() }),
337
- loginCount: z.number().openapi({ example: 1 }),
338
- inviteId: z
339
- .string()
340
- .nullable()
341
- .openapi({ example: 'invite_01j1xgme5mfrasd02hmfwsy13a' }),
342
- accountId: z
343
- .string()
344
- .nullable()
345
- .openapi({ example: 'account_01j1xgme5mfrasd02hmfwsy13a' }),
346
- account: AccountWithoutUsersZod.optional(),
347
- });
348
- export type UserWithoutPasswordZod = z.infer<typeof UserWithoutPasswordZod>;
349
-
350
- export type ErrorResult = {
351
- status: ErrorHttpStatusCode;
352
- message: string;
353
- };
354
-
355
- export type ExtendedErrorResult = ErrorResult & {
356
- errors?: ErrorResponseZod;
357
- };
358
-
359
- export const IPaginationMeta = z.object({
360
- itemCount: z.number().openapi({ example: 1 }),
361
- totalItems: z.number().optional().openapi({ example: 10 }),
362
- itemsPerPage: z.number().openapi({ example: 1 }),
363
- totalPages: z.number().optional().openapi({ example: 10 }),
364
- currentPage: z.number().openapi({ example: 1 }),
365
- });
366
- export type IPaginationMeta = z.infer<typeof IPaginationMeta>;
367
-
368
- export const PaginationOptionsZod = z.object({
369
- page: z.coerce
370
- .number()
371
- .transform((val) => (val === 0 ? 1 : val))
372
- .optional()
373
- .default(1),
374
- limit: z.coerce
375
- .number()
376
- .transform((val) => (val === 0 ? 10 : val))
377
- .optional()
378
- .default(10),
379
- });
380
- export type PaginationOptionsZod = z.infer<typeof PaginationOptionsZod>;
381
-
382
- export interface IPaginationOptions
383
- extends z.infer<typeof PaginationOptionsZod> {}
384
-
385
- // The base action types for the system
386
- export enum BaseAction {
387
- CREATE = 'CREATE',
388
- READ = 'READ',
389
- UPDATE = 'UPDATE',
390
- DELETE = 'DELETE',
391
- IMPORT = 'IMPORT',
392
- }
393
-
394
- export enum KYCStatus {
395
- NEEDS_REVIEW = BaseStatus.NEEDS_REVIEW,
396
- PENDING = BaseStatus.PENDING,
397
- APPROVED = BaseStatus.APPROVED,
398
- REJECTED = BaseStatus.REJECTED,
399
- CANCELLED = BaseStatus.CANCELLED,
400
- RESUBMIT = BaseStatus.RESUBMIT,
401
- ERROR = BaseStatus.ERROR,
402
- }
403
- export enum AMLStatus {
404
- NEEDS_REVIEW = BaseStatus.NEEDS_REVIEW,
405
- PENDING = BaseStatus.PENDING,
406
- APPROVED = BaseStatus.APPROVED,
407
- REJECTED = BaseStatus.REJECTED,
408
- ERROR = BaseStatus.ERROR,
409
- }
410
-
411
- export enum AicStatus {
412
- NEEDS_REVIEW = BaseStatus.NEEDS_REVIEW,
413
- PENDING = BaseStatus.PENDING,
414
- APPROVED = BaseStatus.APPROVED,
415
- REJECTED = BaseStatus.REJECTED,
416
- PROCESSED = BaseStatus.PROCESSED,
417
- }
418
- export enum IssuerStatus {
419
- REJECTED = BaseStatus.REJECTED,
420
- IN_REVIEW = BaseStatus.IN_REVIEW,
421
- ADDITIONAL_INFO = BaseStatus.ADDITIONAL_INFO,
422
- SUBMITTED = BaseStatus.SUBMITTED,
423
- IN_PROGRESS = BaseStatus.IN_PROGRESS,
424
- APPROVED = BaseStatus.APPROVED,
425
- }
426
-
427
- export enum KYBStatus {
428
- NEEDS_REVIEW = BaseStatus.NEEDS_REVIEW,
429
- PENDING = BaseStatus.PENDING,
430
- APPROVED = BaseStatus.APPROVED,
431
- REJECTED = BaseStatus.REJECTED,
432
- }
433
-
434
- export enum SanctionsStatus {
435
- NEEDS_REVIEW = BaseStatus.NEEDS_REVIEW,
436
- PENDING = BaseStatus.PENDING,
437
- APPROVED = BaseStatus.APPROVED,
438
- REJECTED = BaseStatus.REJECTED,
439
- }
440
-
441
- export enum FundingStatus {
442
- PENDING = BaseStatus.PENDING,
443
- CANCELLED = BaseStatus.CANCELLED,
444
- SETTLED = BaseStatus.SETTLED,
445
- REFUNDED = BaseStatus.REFUNDED,
446
- DECLINED = BaseStatus.DECLINED,
447
- FUNDING = BaseStatus.FUNDING,
448
- AUTHORIZING = BaseStatus.AUTHORIZING,
449
- FAILED = BaseStatus.FAILED,
450
- }
451
-
452
- export enum TxnCheck {
453
- PENDING = BaseStatus.PENDING,
454
- NEEDS_REVIEW = BaseStatus.NEEDS_REVIEW,
455
- APPROVED = BaseStatus.APPROVED,
456
- REJECTED = BaseStatus.REJECTED,
457
- }
458
-
459
- export enum ApprovalStatus {
460
- PENDING = BaseStatus.PENDING,
461
- FUNDED = BaseStatus.FUNDED,
462
- APPROVED = BaseStatus.APPROVED,
463
- REJECTED = BaseStatus.REJECTED,
464
- REFUNDED = BaseStatus.REFUNDED,
465
- }
466
-
467
- export enum IraCheck {
468
- PENDING = BaseStatus.PENDING,
469
- APPROVED = BaseStatus.APPROVED,
470
- NEEDS_REVIEW = BaseStatus.NEEDS_REVIEW,
471
- REJECTED = BaseStatus.REJECTED,
472
- }
473
-
474
- export enum CoveredPersonsStatus {
475
- REJECTED = BaseStatus.REJECTED,
476
- IN_REVIEW = BaseStatus.IN_REVIEW,
477
- IN_PROGRESS = BaseStatus.IN_PROGRESS,
478
- COMPLETED = BaseStatus.COMPLETED,
479
- }
480
-
481
- export enum ComplianceReview {
482
- PENDING = BaseStatus.PENDING,
483
- APPROVED = BaseStatus.APPROVED,
484
- REJECTED = BaseStatus.REJECTED,
485
- NEEDS_REVIEW = BaseStatus.NEEDS_REVIEW,
486
- CANCELLED = BaseStatus.CANCELLED,
487
- READY_TO_APPROVE = BaseStatus.READY_TO_APPROVE,
488
- }
489
-
490
- export enum KYCDocumentType {
491
- PASSPORT = 'PASSPORT',
492
- DRIVER_LICENSE = 'DRIVER_LICENSE',
493
- STATE_ID = 'STATE_ID',
494
- }
495
-
496
- export enum InvestmentType {
497
- INDIVIDUAL = 'INDIVIDUAL',
498
- JOINT = 'JOINT',
499
- ENTITY = 'ENTITY',
500
- }
501
-
502
- export enum AicAccreditationType {
503
- PENDING = 'PENDING',
504
- INCOME = 'INCOME',
505
- NET_WORTH = 'NET_WORTH',
506
- PROFESSIONAL_CERTIFICATION = 'PROFESSIONAL_CERTIFICATION',
507
- KNOWLEDGEABLE_EMPLOYEE = 'KNOWLEDGEABLE_EMPLOYEE',
508
- }
509
-
510
- export enum InvestorAccountType {
511
- INDIVIDUAL = 'INDIVIDUAL',
512
- JOINT = 'JOINT',
513
- RETIREMENT = 'RETIREMENT',
514
- LEGAL_ENTITY = 'LEGAL_ENTITY',
515
- }
516
-
517
- export enum SetupStatusType {
518
- IN_PROGRESS = 'IN_PROGRESS',
519
- COMPLETE = 'COMPLETE',
520
- }
521
-
522
- export enum SetupStepType {
523
- NEW = 'NEW',
524
- PERSONAL_INFO = 'PERSONAL_INFO',
525
- ADDRESS = 'ADDRESS',
526
- KYC = 'KYC',
527
- INCOME = 'INCOME',
528
- AIC_QUESTIONS = 'AIC_QUESTIONS',
529
- AIC_FILES = 'AIC_FILES',
530
- }
531
-
532
- export enum OfferingType {
533
- REG_A = 'REG_A',
534
- REG_CF = 'REG_CF',
535
- REG_D = 'REG_D',
536
- S1 = 'S1',
537
- EXCHANGE_NOTE = 'EXCHANGE_NOTE',
538
- }
539
-
540
- export enum AssetType {
541
- BOND = 'BOND',
542
- STOCK = 'STOCK',
543
- }
544
-
545
- export enum AdjustmentType {
546
- CREDIT_CARD_FEES = 'CREDIT_CARD_FEES',
547
- SERVICE_CHARGES = 'SERVICE_CHARGES',
548
- SUBSCRIPTION_DISCOUNT = 'SUBSCRIPTION_DISCOUNT',
549
- }
550
-
551
- export enum SignatureStatus {
552
- PENDING = BaseStatus.PENDING,
553
- SIGNED = BaseStatus.SIGNED,
554
- DECLINED = BaseStatus.DECLINED,
555
- NEEDS_REVIEW = BaseStatus.NEEDS_REVIEW,
556
- RE_SIGN = BaseStatus.RE_SIGN,
557
- }
558
-
559
- export enum TemplateType {
560
- INDIVIDUAL = 'INDIVIDUAL',
561
- JOINT = 'JOINT',
562
- ENTITY = 'ENTITY',
563
- RETIREMENT = 'RETIREMENT',
564
- GENERAL = 'GENERAL',
565
- }
566
-
567
- export enum TemplateStatus {
568
- PENDING = BaseStatus.PENDING,
569
- VALID = BaseStatus.VALID,
570
- ERROR = BaseStatus.ERROR,
571
- }
572
-
573
- export enum SenderIdentityStatus {
574
- PENDING = BaseStatus.PENDING,
575
- APPROVED = BaseStatus.APPROVED,
576
- REJECTED = BaseStatus.DECLINED,
577
- DELETED = BaseStatus.DELETED,
578
- REVOKED = BaseStatus.REVOKED,
579
- }
580
-
581
- export enum DurationType {
582
- DAY = 'DAYS',
583
- WEEK = 'WEEKS',
584
- MONTH = 'MONTHS',
585
- YEAR = 'YEARS',
586
- }
587
- export enum CoveredPersonsRoleType {
588
- ENTITY = 'ENTITY',
589
- BOARD_MEMBER = 'BOARD_MEMBER',
590
- ADVISOR = 'ADVISOR',
591
- CEO = 'CEO',
592
- CFO = 'CFO',
593
- ACCOUNTING = 'ACCOUNTING',
594
- CPA = 'CPA',
595
- LEGAL = 'LEGAL',
596
- EXECUTIVE = 'EXECUTIVE',
597
- EMPLOYEE = 'EMPLOYEE',
598
- INVESTOR = 'INVESTOR',
599
- PROMOTER = 'PROMOTER',
600
- OWNER = 'OWNER',
601
- AFFILIATED = 'AFFILIATED',
602
- }
603
- export enum IDType {
604
- PASSPORT = 'PASSPORT',
605
- DRIVERS_LICENSE = 'DRIVERS_LICENSE',
606
- }
607
- export enum CoveredPersonType {
608
- CHILD = 'CHILD',
609
- PARENT = 'PARENT',
610
- }
611
-
612
- export enum CoveredPersonFileLabels {
613
- IDENTITY_FRONT = 'IDENTITY_FRONT',
614
- IDENTITY_BACK = 'IDENTITY_BACK',
615
- BAD_ACTOR_REPORT_FILE = 'BAD_ACTOR_REPORT_FILE',
616
- }
617
-
618
- export enum IdentityFileLabels {
619
- IDENTITY_FRONT = 'IDENTITY_FRONT',
620
- IDENTITY_BACK = 'IDENTITY_BACK',
621
- PASSPORT = 'PASSPORT',
622
- }
623
-
624
- export enum IssuerFileLabels {
625
- SS4_LETTER = 'SS4_LETTER',
626
- FORMATION_DOCUMENT = 'FORMATION_DOCUMENT',
627
- COVER_ART = 'COVER_ART',
628
- }
629
-
630
- export enum OfferingFileLabels {
631
- MEMORANDUM = 'MEMORANDUM',
632
- SUBSCRIPTION_AGREEMENT = 'SUBSCRIPTION_AGREEMENT',
633
- COVER_ART = 'COVER_ART',
634
- }
635
- export enum SiteBrandingFileLabels {
636
- LOGO = 'LOGO',
637
- FAVICON = 'FAVICON',
638
- BACKGROUND_IMAGE = 'BACKGROUND_IMAGE',
639
- }
640
-
641
- export enum TradeFileLables {
642
- TRADE_DOCUMENT = 'TRADE_DOCUMENT',
643
- }
644
-
645
- export enum RetirementFileLabels {
646
- CUSTODIAN_INSTRUCTION_DOCUMENT = 'CUSTODIAN_INSTRUCTION_DOCUMENT',
647
- }
648
- export enum AccreditationFileLabels {
649
- PROOF_OF_INCOME = 'PROOF_OF_INCOME',
650
- PROOF_OF_NET_WORTH = 'PROOF_OF_NET_WORTH',
651
- EMPLOYEE = 'EMPLOYEE',
652
- TAX_RETURNS = 'TAX_RETURNS',
653
- ACCOUNT_STATEMENT = 'ACCOUNT_STATEMENT',
654
- ACCREDITATION_LETTER = 'ACCREDITATION_LETTER',
655
- LICENSE = 'LICENSE',
656
- }
657
-
658
- export enum OtherFileLabels {
659
- OTHER = 'OTHER',
660
- COMPLIANCE_REQUEST = 'COMPLIANCE_REQUEST',
661
- SUB_DOC = 'SUB_DOC',
662
- }
663
-
664
- export const FileLabels = {
665
- ...AccreditationFileLabels,
666
- ...CoveredPersonFileLabels,
667
- ...OtherFileLabels,
668
- ...RetirementFileLabels,
669
- ...SiteBrandingFileLabels,
670
- ...OfferingFileLabels,
671
- ...IssuerFileLabels,
672
- ...IdentityFileLabels,
673
- ...TradeFileLables,
674
- } as const;
675
-
676
- export type FileLabels = (typeof FileLabels)[keyof typeof FileLabels];
677
- export const FileLabelsEnum = z.enum(
678
- Object.values(FileLabels) as [string, ...string[]],
679
- );
680
-
681
- export enum TradeType {
682
- PURCHASE = 'PURCHASE',
683
- CONVERSION = 'CONVERSION',
684
- TRANSFER = 'TRANSFER',
685
- }
686
- export enum TradeStatus {
687
- CART = BaseStatus.CART,
688
- PLACED = BaseStatus.PLACED,
689
- IN_REVIEW = BaseStatus.IN_REVIEW,
690
- NEEDS_INFO = BaseStatus.NEEDS_INFO,
691
- NEEDS_PAYMENT_INFO = BaseStatus.NEEDS_PAYMENT_INFO,
692
- FUNDING = BaseStatus.FUNDING,
693
- CANCELLED = BaseStatus.CANCELLED,
694
- SETTLED = BaseStatus.SETTLED,
695
- IMPORT_ERROR = BaseStatus.IMPORT_ERROR,
696
- ERROR = BaseStatus.ERROR,
697
- UPDATE_PAYMENT_METHOD = BaseStatus.UPDATE_PAYMENT_METHOD,
698
- }
699
-
700
- export enum SavedQuery {
701
- ERROR_REPORT = 'ERROR_REPORT',
702
- STUCK_TRADES = 'STUCK_TRADES',
703
- }
704
-
705
- export enum SystemReviewLogTrigger {
706
- AML_STATUS_UPDATE = 'AML_STATUS_UPDATE',
707
- AIC_STATUS_UPDATE = 'AIC_STATUS_UPDATE',
708
- INDIVIDUAL_UPDATE = 'INDIVIDUAL_UPDATE',
709
- TRADE_STATUS_UPDATE = 'TRADE_STATUS_UPDATE',
710
- KYC_STATUS_UPDATE = 'KYC_STATUS_UPDATE',
711
- SUBDOC_STATUS_UPDATE = 'SUBDOC_STATUS_UPDATE',
712
- VALIDATE_PLACED_TRADES_WORKER = 'VALIDATE_PLACED_TRADES_WORKER',
713
- }
714
-
715
- export enum OfferingOnboardingStatus {
716
- IN_REVIEW = BaseStatus.IN_REVIEW,
717
- COMPLETE = BaseStatus.COMPLETED,
718
- }
719
-
720
- export enum ExchangeProvider {
721
- PPEX = 'PPEX',
722
- PHOENIX = 'PHOENIX',
723
- NORTHCAP = 'NORTHCAP',
724
- }
725
-
726
- export enum RunnerType {
727
- WORKER = 'WORKER',
728
- PIPELINE = 'PIPELINE',
729
- }
730
- export enum PublicDataType {
731
- DATA_ROOM = 'DATA_ROOM',
732
- PAGE = 'PAGE',
733
- OFFERING = 'OFFERING',
734
- }
735
-
736
- export enum TrustedContactRelationship {
737
- SIBLING = 'SIBLING',
738
- GUARDIAN = 'GUARDIAN',
739
- CHILD = 'CHILD',
740
- FRIEND = 'FRIEND',
741
- OTHER = 'OTHER',
742
- }
743
- export enum FileStatus {
744
- PENDING = BaseStatus.PENDING,
745
- ERROR = BaseStatus.ERROR,
746
- VALID = BaseStatus.VALID,
747
- INVALID = BaseStatus.INVALID,
748
- NOT_PROCESSED = BaseStatus.NOT_PROCESSED,
749
- PROCESSING = BaseStatus.PROCESSING,
750
- PROCESSING_ERROR = BaseStatus.PROCESSING_ERROR,
751
- REVIEW_ERROR = BaseStatus.REVIEW_ERROR,
752
- PROCESSED = BaseStatus.PROCESSED,
753
- }
754
- export enum SystemReviewStatus {
755
- PENDING = BaseStatus.PENDING,
756
- NEEDS_INFO = BaseStatus.NEEDS_INFO,
757
- READY_TO_APPROVE = BaseStatus.READY_TO_APPROVE,
758
- NEEDS_REVIEW = BaseStatus.NEEDS_REVIEW,
759
- APPROVED = BaseStatus.APPROVED,
760
- REJECTED = BaseStatus.REJECTED,
761
- }
762
-
763
- export enum FilingStatus {
764
- SINGLE = 'SINGLE',
765
- JOINT = 'JOINT',
766
- }
767
- export enum AccountType {
768
- CHECKING = 'CHECKING',
769
- SAVINGS = 'SAVINGS',
770
- BROKERAGE = 'BROKERAGE',
771
- REAL_ESTATE = 'REAL_ESTATE',
772
- OTHER = 'OTHER',
773
- }
774
- export enum SourceOfIncome {
775
- EMPLOYED = 'EMPLOYED',
776
- SELF_EMPLOYED = 'SELF_EMPLOYED',
777
- UNEMPLOYED = 'UNEMPLOYED',
778
- RETIREMENT = 'RETIREMENT',
779
- STUDENT = 'STUDENT',
780
- }
781
-
782
- export enum DateField {
783
- RAW_ORDER_CREATED_DATE = 'rawOrder.createdDate',
784
- RAW_TRADE_CREATED_DATE = 'rawTrade.createdDate',
785
- CREATED_AT = 'createdAt',
786
- }
787
-
788
- export const DateFieldMap = {
789
- [DateField.RAW_ORDER_CREATED_DATE]: "raw_order_data->>'createdDate'",
790
- [DateField.RAW_TRADE_CREATED_DATE]: "raw_trade_data->>'createdDate'",
791
- [DateField.CREATED_AT]: 'entity.createdAt',
792
- };
793
-
794
- /**
795
- * Event fields represent database entity columns that can be changed using status.changed events.
796
- * These enum values correspond to actual column names in various database entities
797
- * and are used to track field-level changes in the system's activity logging.
798
- */
799
- export enum EventField {
800
- STATUS = 'status',
801
- TRADE_STATUS = 'tradeStatus',
802
- FUNDING_STATUS = 'fundingStatus',
803
- COMPLIANCE_REVIEW = 'complianceReview',
804
- SYSTEM_REVIEW_CHECK = 'systemReviewCheck',
805
- SYSTEM_REVIEW = 'systemReview',
806
- KYC_STATUS = 'kycStatus',
807
- AML_STATUS = 'amlStatus',
808
- AIC_STATUS = 'aicStatus',
809
- SA_STATUS = 'saStatus',
810
- ONBOARDING_STATUS = 'onboardingStatus',
811
- TRANSACTION_STATUS = 'transactionStatus',
812
- }
813
-
814
- export enum EventName {
815
- STATUS_CHANGED = 'status.changed',
816
- UPDATE_FIELD = 'update.field',
817
- ACTION_PERFORMED = 'action.performed',
818
- PENDING_OVERDUE_TRADES_ALERT = 'pending_overdue.trades.alert',
819
- IN_REVIEW_TRADES_ALERT = 'trade.inreview.alert',
820
- INDIVIDUAL_AML_STATUS_CHANGED = 'individual.aml_status.changed',
821
- }
822
-
823
- // pending charged settled refunded cancelled
824
- export enum TransactionStatus {
825
- PENDING = BaseStatus.PENDING,
826
- CHARGED = BaseStatus.CHARGED,
827
- APPROVED = BaseStatus.APPROVED,
828
- SETTLED = BaseStatus.SETTLED,
829
- REFUNDED = BaseStatus.REFUNDED,
830
- CANCELLED = BaseStatus.CANCELLED,
831
- DECLINED = BaseStatus.DECLINED,
832
- FAILED = BaseStatus.FAILED,
833
- AUTHORIZING = BaseStatus.AUTHORIZING,
834
- FUNDING = BaseStatus.FUNDING,
835
- PARTIALLY_REFUNDED = BaseStatus.PARTIALLY_REFUNDED,
836
- VOIDED = BaseStatus.VOIDED,
837
- }
838
-
839
- //charge, refund, adjustment
840
- export enum TransactionType {
841
- CHARGE = 'CHARGE',
842
- REFUND = 'REFUND',
843
- ADJUSTMENT = 'ADJUSTMENT',
844
- }
845
-
846
- const parseDate = (str: string | null): Date | null => {
847
- if (!str) return null;
848
- const [monthStr, dayStr, yearStr] = str.split('/');
849
- const month = Number(monthStr);
850
- const day = Number(dayStr);
851
- const year = Number(yearStr);
852
- if (isNaN(month) || isNaN(day) || isNaN(year)) {
853
- return null;
854
- }
855
- return new Date(year, month - 1, day);
856
- };
857
-
858
- export const dateSchema = z
859
- .string()
860
- .nullable()
861
- .refine(
862
- (val) => {
863
- if (!val) return true;
864
- const regex = /^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/\d{4}$/;
865
- return regex.test(val);
866
- },
867
- { message: 'Date must be in MM/DD/YYYY format' },
868
- )
869
- .transform((val) => (val ? parseDate(val) : null));
870
-
871
- /**
872
- * Creates a Zod schema for parsing and transforming date strings in MM/DD/YYYY format.
873
- * The schema accepts a parameter to determine if the date should be formatted as the start or end of the day.
874
- * - If param is 'START', the time is set to 00:00:00.000 (local, no timezone effect).
875
- * - If param is 'END', the time is set to 23:59:59.999 (local, no timezone effect).
876
- * - Otherwise, the time is set to 00:00:00.000.
877
- * The returned value is a Date object or null.
878
- */
879
- export const createDateSchema = (param?: 'START' | 'END') =>
880
- z
881
- .string()
882
- .nullable()
883
- .refine(
884
- (val) => {
885
- if (!val) return true;
886
- const regex = /^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/\d{4}$/;
887
- return regex.test(val);
888
- },
889
- { message: 'Date must be in MM/DD/YYYY format' },
890
- )
891
- .transform((val) => {
892
- if (!val) return null;
893
- const [monthStr, dayStr, yearStr] = val.split('/');
894
- const month = Number(monthStr);
895
- const day = Number(dayStr);
896
- const year = Number(yearStr);
897
- if (isNaN(month) || isNaN(day) || isNaN(year)) {
898
- return null;
899
- }
900
- let date: Date;
901
- if (param === 'END') {
902
- // Set to 23:59:59.999 local, then force to end of day in UTC
903
- date = new Date(Date.UTC(year, month - 1, day, 23, 59, 59, 999));
904
- } else {
905
- // Default to START or normal, set to 00:00:00.000 UTC
906
- date = new Date(Date.UTC(year, month - 1, day, 0, 0, 0, 0));
907
- }
908
- return date;
909
- });
910
-
911
- /**
912
- * Default dateSchema (no param) for backward compatibility.
913
- */
914
- export const dateSchemaWithParam = createDateSchema();
915
-
916
- export enum IssuerOnboardingSetupType {
917
- OFFERING = 'OFFERING',
918
- INVESTOR_PORTAL = 'INVESTOR_PORTAL',
919
- PAYMENT_METHOD = 'PAYMENT_METHOD',
920
- ACCOUNT_CONTACTS = 'ACCOUNT_CONTACTS',
921
- }
922
-
923
- export enum ThemeScope {
924
- ACCOUNT = 'ACCOUNT',
925
- SYSTEM = 'SYSTEM',
926
- }
927
-
928
- /**
929
- * The configuration for the target tables. Used in Notes, Files, and Activities
930
- * All tables that need to be targeted should be added here.
931
- * to determine the target table from the target ID.
932
- * TODO: UPDATE WITH MORE TABLES
933
- * CHANGES HERE WILL REQUIRE A MIGRATION
934
- */
935
- export const TargetTableConfig = {
936
- KYCS: { table: 'kycs', idPrefix: 'kyc' },
937
- AMLS: { table: 'amls', idPrefix: 'aml' },
938
- AICS: { table: 'aics', idPrefix: 'aic' },
939
- KYBS: { table: 'kybs', idPrefix: 'kyb' },
940
- INDIVIDUALS: { table: 'individuals', idPrefix: 'individual' },
941
- LEGAL_ENTITIES: { table: 'legal_entities', idPrefix: 'legal_entity' },
942
- INVESTOR_ACCOUNTS: {
943
- table: 'investor_accounts',
944
- idPrefix: 'investor_account',
945
- },
946
- TRADES: { table: 'trades', idPrefix: 'trade' },
947
- OFFERINGS: { table: 'offerings', idPrefix: 'offering' },
948
- ISSUERS: { table: 'issuers', idPrefix: 'issuer' },
949
- COVERED_PERSONS: { table: 'covered_persons', idPrefix: 'covered_person' },
950
- PAYMENT_METHODS: { table: 'payment_methods', idPrefix: 'payment_method' },
951
- NOTES: { table: 'notes', idPrefix: 'note' },
952
- USERS: { table: 'users', idPrefix: 'user' },
953
- ACCOUNTS: { table: 'accounts', idPrefix: 'account' },
954
- PAGES: { table: 'pages', idPrefix: 'page' },
955
- TASKS: { table: 'tasks', idPrefix: 'task' },
956
- FILES: { table: 'files', idPrefix: 'file' },
957
- DATA_RECORD_FILES: {
958
- table: 'data_record_files',
959
- idPrefix: 'data_record_file',
960
- },
961
- ASSETS: { table: 'assets', idPrefix: 'asset' },
962
- SITES: { table: 'sites', idPrefix: 'site' },
963
- PAGE_REVISIONS: { table: 'page_revisions', idPrefix: 'page_revision' },
964
- TRADE_LINE_ITEMS: { table: 'trade_line_items', idPrefix: 'trade_line_item' },
965
- TRANSACTIONS: { table: 'transactions', idPrefix: 'transaction' },
966
- DISBURSEMENTS: { table: 'disbursements', idPrefix: 'disbursement' },
967
- DISBURSEMENT_REVIEWS: {
968
- table: 'disbursement_reviews',
969
- idPrefix: 'disbursement_review',
970
- },
971
- ISSUER_PAYMENT_METHODS: {
972
- table: 'issuer_payment_methods',
973
- idPrefix: 'issuer_payment_method',
974
- },
975
- SIGNER_BRANDS: { table: 'signer_brands', idPrefix: 'signer_brand' },
976
- THEMES: { table: 'themes', idPrefix: 'theme' },
977
- THEME_SETTINGS: { table: 'theme_settings', idPrefix: 'theme_setting' },
978
- } as const;
979
-
980
- export type TargetTableType = keyof typeof TargetTableConfig;
981
- export const TargetTableEnum = Object.keys(TargetTableConfig) as [
982
- TargetTableType,
983
- ...TargetTableType[],
984
- ];
985
-
986
- /**
987
- * Get the target table name from a target ID.
988
- * @param targetId - The target ID to get the table name for.
989
- * @returns The target table name or null if the target ID is invalid.
990
- */
991
- export function getTargetTableFromId(targetId: string): string | null {
992
- try {
993
- const tid = TypeID.fromString(targetId);
994
- const prefix = tid.getType();
995
-
996
- for (const config of Object.values(TargetTableConfig)) {
997
- if (config.idPrefix === prefix) {
998
- return config.table;
999
- }
1000
- }
1001
- } catch {
1002
- return null;
1003
- }
1004
-
1005
- return null;
1006
- }
1007
- export enum UrlClassification {
1008
- BASE64 = 'BASE64',
1009
- REGULAR = 'REGULAR',
1010
- INVALID = 'INVALID',
1011
- }
1012
-
1013
- export enum OfferingVersioningType {
1014
- PUBLISHED = 'PUBLISHED',
1015
- DRAFT = 'DRAFT',
1016
- }
1017
- /**
1018
- * Get the target table type from a target ID.
1019
- * @param targetId - The target ID to get the table type for.
1020
- * @returns The target table type or null if the target ID is invalid.
1021
- */
1022
- export function getTargetTableTypeFromId(
1023
- targetId: string,
1024
- ): TargetTableType | null {
1025
- try {
1026
- const tid = TypeID.fromString(targetId);
1027
- const prefix = tid.getType();
1028
-
1029
- for (const [tableType, config] of Object.entries(TargetTableConfig)) {
1030
- if (config.idPrefix === prefix) {
1031
- return tableType as TargetTableType;
1032
- }
1033
- }
1034
- } catch {
1035
- return null;
1036
- }
1037
-
1038
- return null;
1039
- }
1040
-
1041
- export const REDACTED = '[REDACTED]';
1042
-
1043
- /**
1044
- * Zod schema for validating and normalizing URLs.
1045
- *
1046
- * This schema ensures that the URL is valid and normalizes it by removing the protocol (http/https)
1047
- * and any path after the main domain.
1048
- *
1049
- * @example
1050
- * UrlSchema.parse('https://www.example.com'); // Valid URL, normalized to 'www.example.com'
1051
- * UrlSchema.parse('abc.example.org'); // Valid URL, normalized to 'abc.example.org'
1052
- * UrlSchema.parse('https://subdomain.example.co.uk/path'); // Valid URL, normalized to 'subdomain.example.co.uk'
1053
- * UrlSchema.parse('ftp://example.com'); // Throws validation error
1054
- * UrlSchema.parse('invalid-url'); // Throws validation error
1055
- */
1056
- export const createUrlSchema = (options?: { strict?: boolean }) => {
1057
- return z
1058
- .string()
1059
- .refine(
1060
- (value) => {
1061
- try {
1062
- // If strict mode is enabled, require abc.def.com format (at least one subdomain)
1063
- const urlPattern = options?.strict
1064
- ? /^(https?:\/\/)?([a-zA-Z0-9-]+\.[a-zA-Z0-9-]+\.[a-zA-Z]{2,})(\/.*)?$/
1065
- : /^(https?:\/\/)?(www\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/.*)?$/;
1066
- return urlPattern.test(value);
1067
- } catch {
1068
- return false;
1069
- }
1070
- },
1071
- {
1072
- message: options?.strict
1073
- ? 'Invalid URL. Must be in format abc.def.com'
1074
- : 'Invalid URL',
1075
- },
1076
- )
1077
- .transform((value) => {
1078
- try {
1079
- const url = new URL(
1080
- value.startsWith('http') || value.startsWith('https')
1081
- ? value
1082
- : `http://${value}`,
1083
- );
1084
- return url.hostname.toLowerCase();
1085
- } catch {
1086
- return value.toLowerCase();
1087
- }
1088
- })
1089
- .openapi({
1090
- example: options?.strict ? 'subdomain.example.com' : 'www.example.com',
1091
- });
1092
- };
1093
-
1094
- export const UrlSchema = createUrlSchema();
1095
-
1096
- /**
1097
- * Zod schema for validating subdomains.
1098
- *
1099
- * This schema ensures that the subdomain contains only alphanumeric characters and hyphens,
1100
- * does not start or end with a hyphen, and follows standard subdomain naming conventions.
1101
- *
1102
- * @example
1103
- * SubdomainSchema.parse('my-site'); // Valid subdomain
1104
- * SubdomainSchema.parse('123test'); // Valid subdomain
1105
- * SubdomainSchema.parse('my_site'); // Throws validation error (underscore not allowed)
1106
- * SubdomainSchema.parse('-mysite'); // Throws validation error (cannot start with hyphen)
1107
- * SubdomainSchema.parse('mysite-'); // Throws validation error (cannot end with hyphen)
1108
- */
1109
- export const SubdomainSchema = z
1110
- .string()
1111
- .min(1, { message: 'Subdomain cannot be empty' })
1112
- .max(63, { message: 'Subdomain cannot exceed 63 characters' })
1113
- .refine(
1114
- (value) => {
1115
- // Subdomain can only contain alphanumeric characters and hyphens
1116
- // Cannot start or end with a hyphen
1117
- const subdomainPattern = /^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/;
1118
- return subdomainPattern.test(value);
1119
- },
1120
- {
1121
- message:
1122
- 'Subdomain can only contain letters, numbers, and hyphens, and cannot start or end with a hyphen',
1123
- },
1124
- )
1125
- .transform((value) => value.toLowerCase())
1126
- .openapi({ example: 'my-site' });
1127
-
1128
- /**
1129
- * Zod schema for validating domain names without subdomains.
1130
- *
1131
- * This schema ensures the domain is in a valid format (example.com) without subdomains.
1132
- *
1133
- * @example
1134
- * DomainSchema.parse('example.com'); // Valid domain
1135
- * DomainSchema.parse('subdomain.example.com'); // Throws validation error
1136
- */
1137
- export const DomainSchema = z
1138
- .string()
1139
- .refine(
1140
- (value) => {
1141
- // Only allow a single dot to prevent subdomains
1142
- const parts = value.split('.');
1143
- if (parts.length !== 2) return false;
1144
-
1145
- // Basic domain format validation
1146
- const domainPattern = /^[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$/;
1147
- return domainPattern.test(value);
1148
- },
1149
- {
1150
- message:
1151
- 'Invalid domain format. Must be a domain without subdomains (e.g., example.com)',
1152
- },
1153
- )
1154
- .openapi({ example: 'example.com' });
1155
-
1156
- /**
1157
- * Zod schema for validating hex color codes (with optional alpha/transparency).
1158
- *
1159
- * This schema allows hex codes with or without a leading '#', and accepts 3, 4, 6, 7, or 8 hex digits (e.g., #RRGGBB, #RRGGBBA, #RRGGBBAA, #RGB, #RGBA, #XXXXXXX).
1160
- * The 7-digit form (e.g., #RRGGBBA) is supported to allow for transparency/alpha values at the end.
1161
- * It also trims whitespace and lowercases the value.
1162
- *
1163
- * @example
1164
- * HexCodeColorSchema.parse('#FF0000'); // Valid hex code
1165
- * HexCodeColorSchema.parse('FF0000'); // Valid hex code
1166
- * HexCodeColorSchema.parse('#F00'); // Valid hex code
1167
- * HexCodeColorSchema.parse('F00'); // Valid hex code
1168
- * HexCodeColorSchema.parse('#FF000080'); // Valid hex code (with alpha)
1169
- * HexCodeColorSchema.parse('#D9D9D14'); // Valid hex code (7 digits, with transparency)
1170
- * HexCodeColorSchema.parse(' #abc '); // Valid hex code, returns '#abc'
1171
- * HexCodeColorSchema.parse('#XYZ'); // Throws validation error
1172
- */
1173
- export const HexCodeColorSchema = z
1174
- .string()
1175
- .trim()
1176
- .transform((val) => (val.startsWith('#') ? val : `#${val}`))
1177
- .refine(
1178
- (val) =>
1179
- /^#[A-Fa-f0-9]{3}$/.test(val) || // #RGB
1180
- /^#[A-Fa-f0-9]{4}$/.test(val) || // #RGBA
1181
- /^#[A-Fa-f0-9]{6}$/.test(val) || // #RRGGBB
1182
- /^#[A-Fa-f0-9]{7}$/.test(val) || // #RRGGBBA (7 digits, e.g., with transparency)
1183
- /^#[A-Fa-f0-9]{8}$/.test(val), // #RRGGBBAA
1184
- {
1185
- message:
1186
- 'Invalid color hex code. It should be 3, 4, 6, 7, or 8 hex digits, with or without a leading "#".',
1187
- },
1188
- )
1189
- .openapi({ example: '#FFA500' });
1190
-
1191
- export const WithCoverArtUrl = z.object({
1192
- coverArtUrl: z.string().nullable().optional(),
1193
- });
1194
-
1195
- export const UNKNOWN = 'unknown';
1196
-
1197
- export enum UserManualType {
1198
- FAQ = 'FAQ',
1199
- USER_MANUAL = 'USER_MANUAL',
1200
- }
1201
- export enum BulkExportType {
1202
- INVESTOR_ACCOUNTS = 'INVESTOR_ACCOUNTS',
1203
- TRADES = 'TRADES',
1204
- COMPLIANCE_TRADES = 'COMPLIANCE_TRADES',
1205
- SECONDARY_CUSTOMERS = 'SECONDARY_CUSTOMERS',
1206
- SECONDARY_TRADES = 'SECONDARY_TRADES',
1207
- }
1208
- export const SubmitIssuerOfferingError = z.object({
1209
- field: z.string(),
1210
- message: z.string(),
1211
- id: z.string().optional(),
1212
- });
1213
- export type SubmitIssuerOfferingError = z.infer<
1214
- typeof SubmitIssuerOfferingError
1215
- >;
1216
- export const ErrorResponseZod = z.object({
1217
- valid: z.boolean(),
1218
- errors: z.array(SubmitIssuerOfferingError),
1219
- });
1220
- export type ErrorResponseZod = z.infer<typeof ErrorResponseZod>;
1221
-
1222
- /**
1223
- * A Zod schema that preprocesses a value to convert it to a number if it is a string.
1224
- * If the value is a string, it attempts to parse it as a float. If parsing fails, it returns `undefined`.
1225
- * If the value is already a number, it is returned as is.
1226
- *
1227
- * @example
1228
- * numberFromStringOrNumber.parse("123.45"); // returns 123.45
1229
- * numberFromStringOrNumber.parse(123.45); // returns 123.45
1230
- * numberFromStringOrNumber.parse("abc"); // throws a ZodError
1231
- *
1232
- * @type {ZodSchema<number>}
1233
- */
1234
- export const numberFromStringOrNumber = (fieldName: string) =>
1235
- z.preprocess(
1236
- (val) => {
1237
- if (typeof val === 'string') {
1238
- const parsed = parseFloat(val);
1239
- return isNaN(parsed) ? undefined : parsed;
1240
- }
1241
- return val;
1242
- },
1243
- z.number({
1244
- required_error: `${fieldName} field is required.`,
1245
- invalid_type_error: `${fieldName} field is required.`,
1246
- }),
1247
- );
1248
-
1249
- /**
1250
- * Creates a Zod schema for transforming number values to a specified decimal precision.
1251
- * Transforms the number to exactly the specified decimal places without validation.
1252
- * Accepts a base number schema with constraints (e.g., .positive(), .max()) and applies precision transformation.
1253
- *
1254
- * @param precision - The number of decimal places to enforce. Defaults to 2.
1255
- * @param baseSchema - Optional base number schema with constraints. Defaults to z.number().
1256
- * @returns A Zod schema that transforms numbers to the specified decimal precision.
1257
- *
1258
- * @example
1259
- * numberPrecisionSchema(2).parse(123.456); // returns 123.46 (transformed)
1260
- * numberPrecisionSchema(2).parse(123.45); // returns 123.45
1261
- * numberPrecisionSchema(2).parse(123.4); // returns 123.40 (transformed)
1262
- * numberPrecisionSchema(3, z.number().positive().max(1000)).parse(500.9999); // returns 501.000 (transformed)
1263
- * numberPrecisionSchema(2, z.number().positive().max(1000)).parse(500.99); // returns 500.99
1264
- */
1265
- export const numberPrecisionSchema = (
1266
- precision: number = 2,
1267
- baseSchema: z.ZodNumber = z.number(),
1268
- ) =>
1269
- baseSchema.transform((value) => {
1270
- if (!isFinite(value)) {
1271
- return value; // Return Infinity or -Infinity as-is
1272
- }
1273
-
1274
- if (precision === 0) {
1275
- return Math.round(value);
1276
- }
1277
-
1278
- // Round in two steps to reduce floating-point drift:
1279
- // 1) trim the value with extra precision
1280
- // 2) round the trimmed value at the target precision
1281
- const factor = Math.pow(10, precision);
1282
-
1283
- // Trim with extra precision (precision + 5) to keep enough significant digits
1284
- const trimmed = parseFloat(value.toFixed(Math.min(precision + 5, 20)));
1285
-
1286
- // Round at target precision
1287
- const rounded = Math.round(trimmed * factor) / factor;
1288
-
1289
- // Ensure the returned number has exact decimal places
1290
- return parseFloat(rounded.toFixed(precision));
1291
- });
1292
-
1293
- /**
1294
- * Convenience function for 2 decimal precision (backward compatibility).
1295
- * @deprecated Use numberPrecisionSchema(2) instead.
1296
- */
1297
- export const amountPrecision2Schema = (baseSchema: z.ZodNumber = z.number()) =>
1298
- numberPrecisionSchema(2, baseSchema);
1299
-
1300
- export enum RetirementAccountType {
1301
- SELF_DIRECTED = 'SELF_DIRECTED',
1302
- CUSTODIAN_MANAGED = 'CUSTODIAN_MANAGED',
1303
- }
1304
- export enum EmploymentStatus {
1305
- EMPLOYED = 'EMPLOYED',
1306
- UNEMPLOYED = 'UNEMPLOYED',
1307
- SELF_EMPLOYED = 'SELF_EMPLOYED',
1308
- RETIRED = 'RETIRED',
1309
- STUDENT = 'STUDENT',
1310
- OTHER = 'OTHER',
1311
- }
1312
-
1313
- export const dateSchemaWithNormalization = z
1314
- .string()
1315
- .nullable()
1316
- .transform((val) => (val ? normalizeShortDate(val) : null))
1317
- .refine(
1318
- (val) => {
1319
- if (!val) return true;
1320
- const regex = /^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/\d{4}$/;
1321
- return regex.test(val);
1322
- },
1323
- { message: 'Date must be in MM/DD/YYYY format' },
1324
- )
1325
- .transform((val) => (val ? parseDate(val) : null));
1326
-
1327
- export const DateRangeFiltersZod = z.object({
1328
- from: dateSchema.optional().openapi({ example: 'MM/DD/YYYY' }),
1329
- to: dateSchema.optional().openapi({ example: 'MM/DD/YYYY' }),
1330
- });
1331
-
1332
- export const metadataSchema = z
1333
- .string()
1334
- .min(2)
1335
- .max(600000)
1336
- .refine(
1337
- (data) => {
1338
- try {
1339
- if (!data) return true;
1340
- const parsedData = JSON.parse(data);
1341
- if (typeof parsedData !== 'object' || parsedData === null) return false;
1342
- return true;
1343
- } catch (error) {
1344
- return false;
1345
- }
1346
- },
1347
- {
1348
- message: 'must be a valid JSON object.',
1349
- path: [],
1350
- },
1351
- )
1352
- .transform((data) =>
1353
- data
1354
- ? { user_defined_data: JSON.parse(data), expected: JSON.parse(data) }
1355
- : null,
1356
- );
1357
-
1358
- export const LogContextZod = z.object({
1359
- queueName: z.string(),
1360
- jobId: z.string(),
1361
- jobName: z.string(),
1362
- shouldAlert: z.boolean().optional(),
1363
- });
1364
-
1365
- export type LogContext = z.infer<typeof LogContextZod>;
1366
-
1367
- /**
1368
- * Maps all documented Cloudflare Turnstile error codes to their corresponding HTTP status and user-friendly message.
1369
- *
1370
- * @see {@link https://developers.cloudflare.com/turnstile/get-started/server-side-validation/ Cloudflare Turnstile Server-side Validation}
1371
- */
1372
- export const errorMap: Record<string, { status: HttpStatus; message: string }> =
1373
- {
1374
- 'missing-input-secret': {
1375
- status: HttpStatus.INTERNAL_SERVER_ERROR,
1376
- message:
1377
- 'Captcha server configuration is missing the secret key. Please ensure the secret key is included.',
1378
- },
1379
- 'invalid-input-secret': {
1380
- status: HttpStatus.INTERNAL_SERVER_ERROR,
1381
- message:
1382
- 'Captcha server secret key is invalid or expired. Please check your secret key in the Cloudflare dashboard.',
1383
- },
1384
- 'missing-input-response': {
1385
- status: HttpStatus.BAD_REQUEST,
1386
- message:
1387
- 'Captcha response is missing. Please ensure the token is included and try again.',
1388
- },
1389
- 'invalid-input-response': {
1390
- status: HttpStatus.BAD_REQUEST,
1391
- message:
1392
- 'Captcha response is invalid, malformed, or expired. Please retry the challenge.',
1393
- },
1394
- 'bad-request': {
1395
- status: HttpStatus.BAD_REQUEST,
1396
- message:
1397
- 'The captcha verification request was malformed. Please check the request format and parameters.',
1398
- },
1399
- 'timeout-or-duplicate': {
1400
- status: HttpStatus.CONFLICT,
1401
- message:
1402
- 'Captcha token has already been validated or expired. Each token can only be used once. Please refresh and try again.',
1403
- },
1404
- 'internal-error': {
1405
- status: HttpStatus.INTERNAL_SERVER_ERROR,
1406
- message:
1407
- 'An internal error occurred during captcha verification. Please retry the request.',
1408
- },
1409
- };
1410
-
1411
- export enum BaseContactUsOptions {
1412
- ISSUER = 'ISSUER',
1413
- TECHNICAL_SUPPORT = 'TECHNICAL_SUPPORT',
1414
- SALES = 'SALES',
1415
- ACCOUNT_MANAGER = 'ACCOUNT_MANAGER',
1416
- }
1417
-
1418
- export enum SortOrder {
1419
- ASC = 'ASC',
1420
- DESC = 'DESC',
1421
- }
1422
-
1423
- export enum SortBy {
1424
- CREATED_AT = 'created_at',
1425
- UPDATED_AT = 'updated_at',
1426
- PLACEDAT = 'placedAt',
1427
- NAME = 'name',
1428
- TITLE = 'title',
1429
- LEGAL_NAME = 'legal_name',
1430
- }
1431
-
1432
- export enum PersonaStatus {
1433
- APPROVED = 'approved',
1434
- ACTIVE = 'active',
1435
- CREATED = 'created',
1436
- COMPLETED = 'completed',
1437
- DRAFT = 'draft',
1438
- DECLINED = 'declined',
1439
- EXPIRED = 'expired',
1440
- FAILED = 'failed',
1441
- NEEDS_REVIEW = 'needs_review',
1442
- PUBLISHED = 'published',
1443
- PENDING = 'pending',
1444
- REDACTED = 'redacted',
1445
- }
1446
-
1447
- export enum AMLProvider {
1448
- COMPLY_ADVANTAGE = 'ComplyAdvantage',
1449
- }
1450
-
1451
- export enum ThemeFileType {
1452
- LIGHT = 'light',
1453
- DARK = 'dark',
1454
- }
1455
-
1456
- /**
1457
- * Common timezone identifiers using IANA timezone database format.
1458
- * These are the most commonly used timezones in business applications.
1459
- */
1460
- export enum TimeZone {
1461
- // UTC
1462
- UTC = 'UTC',
1463
-
1464
- // North America
1465
- PACIFIC = 'America/Los_Angeles',
1466
- MOUNTAIN = 'America/Denver',
1467
- CENTRAL = 'America/Chicago',
1468
- EASTERN = 'America/New_York',
1469
-
1470
- // Europe
1471
- LONDON = 'Europe/London',
1472
- PARIS = 'Europe/Paris',
1473
- BERLIN = 'Europe/Berlin',
1474
- ROME = 'Europe/Rome',
1475
- MADRID = 'Europe/Madrid',
1476
- AMSTERDAM = 'Europe/Amsterdam',
1477
- ZURICH = 'Europe/Zurich',
1478
-
1479
- // Asia
1480
- TOKYO = 'Asia/Tokyo',
1481
- SHANGHAI = 'Asia/Shanghai',
1482
- HONG_KONG = 'Asia/Hong_Kong',
1483
- SINGAPORE = 'Asia/Singapore',
1484
- MUMBAI = 'Asia/Kolkata',
1485
- DUBAI = 'Asia/Dubai',
1486
-
1487
- // Australia
1488
- SYDNEY = 'Australia/Sydney',
1489
- MELBOURNE = 'Australia/Melbourne',
1490
-
1491
- // Other major business centers
1492
- SAO_PAULO = 'America/Sao_Paulo',
1493
- TORONTO = 'America/Toronto',
1494
- VANCOUVER = 'America/Vancouver',
1495
- }
1496
-
1497
- export const SenderDataZod = z.object({
1498
- senderName: z.string().nullable(),
1499
- senderEmail: z.string().nullable(),
1500
- });
1501
-
1502
- export type SenderDataZod = z.infer<typeof SenderDataZod>;
1503
-
1504
- export enum JobState {
1505
- COMPLETED = 'completed',
1506
- FAILED = 'failed',
1507
- WAITING = 'waiting',
1508
- ACTIVE = 'active',
1509
- DELAYED = 'delayed',
1510
- PRIORITIZED = 'prioritized',
1511
- WAITING_CHILDREN = 'waiting-children',
1512
- }
1513
-
1514
- export const SUBJECT_TYPE_MAP: Record<BulkExportType, string> = {
1515
- [BulkExportType.INVESTOR_ACCOUNTS]: 'Investor Accounts',
1516
- [BulkExportType.TRADES]: 'Trades',
1517
- [BulkExportType.COMPLIANCE_TRADES]: 'Compliance Trades',
1518
- [BulkExportType.SECONDARY_CUSTOMERS]: 'Secondary Customers',
1519
- [BulkExportType.SECONDARY_TRADES]: 'Secondary Trades',
1520
- };