@dalmore/api-contracts 0.0.0-dev.9d42e16 → 0.0.0-dev.a9772b4

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