@dalmore/api-contracts 1.0.2 → 1.0.5

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 (295) hide show
  1. package/README.md +34 -55
  2. package/index.d.mts +17 -0
  3. package/index.d.ts +17 -0
  4. package/index.mjs +10970 -0
  5. package/package.json +10 -46
  6. package/common/helpers/index.ts +0 -205
  7. package/common/types/account-contact.types.ts +0 -98
  8. package/common/types/account-detail.types.ts +0 -27
  9. package/common/types/account-integration.types.ts +0 -143
  10. package/common/types/account-manager.types.ts +0 -124
  11. package/common/types/account.types.ts +0 -296
  12. package/common/types/activity.types.ts +0 -274
  13. package/common/types/address.types.ts +0 -41
  14. package/common/types/aic.types.ts +0 -246
  15. package/common/types/aml.types.ts +0 -18
  16. package/common/types/api-key-logs.types.ts +0 -66
  17. package/common/types/api-keys.types.ts +0 -69
  18. package/common/types/asset.types.ts +0 -338
  19. package/common/types/auth.types.ts +0 -370
  20. package/common/types/batch-jobs.types.ts +0 -150
  21. package/common/types/bonus-tier.types.ts +0 -147
  22. package/common/types/cart.types.ts +0 -18
  23. package/common/types/checklist-items.types.ts +0 -70
  24. package/common/types/checklist.types.ts +0 -97
  25. package/common/types/common.types.ts +0 -1520
  26. package/common/types/comply-advantage-api.types.ts +0 -316
  27. package/common/types/comply-advantage.types.ts +0 -25
  28. package/common/types/contact-us.types.ts +0 -107
  29. package/common/types/contract-helpers.ts +0 -205
  30. package/common/types/countries.types.ts +0 -375
  31. package/common/types/covered-person.types.ts +0 -274
  32. package/common/types/dashboard.types.ts +0 -799
  33. package/common/types/data-record.types.ts +0 -325
  34. package/common/types/data-room.types.ts +0 -242
  35. package/common/types/default-theme-config.types.ts +0 -87
  36. package/common/types/disbursement-adjustment.types.ts +0 -32
  37. package/common/types/disbursement-approval-user.types.ts +0 -100
  38. package/common/types/disbursement-review.types.ts +0 -110
  39. package/common/types/disbursement-transaction.types.ts +0 -72
  40. package/common/types/disbursements.types.ts +0 -310
  41. package/common/types/domain-filter.types.ts +0 -55
  42. package/common/types/email-theme.types.ts +0 -442
  43. package/common/types/entity.types.ts +0 -15
  44. package/common/types/error-responses.types.ts +0 -135
  45. package/common/types/escrow-account.types.ts +0 -104
  46. package/common/types/exchange-api-key.types.ts +0 -121
  47. package/common/types/exchange-import.types.ts +0 -36
  48. package/common/types/exchange-provider.types.ts +0 -329
  49. package/common/types/file.types.ts +0 -461
  50. package/common/types/health.types.ts +0 -29
  51. package/common/types/index.ts +0 -48
  52. package/common/types/individuals.types.ts +0 -554
  53. package/common/types/investor-account.types.ts +0 -1239
  54. package/common/types/investorAccountIdSchema.type.ts +0 -0
  55. package/common/types/investors-offering.types.ts +0 -65
  56. package/common/types/invite.types.ts +0 -133
  57. package/common/types/issuer-bank-account.types.ts +0 -107
  58. package/common/types/issuer-offering.types.ts +0 -306
  59. package/common/types/issuer-payment-method.types.ts +0 -341
  60. package/common/types/issuer.types.ts +0 -312
  61. package/common/types/job-item.types.ts +0 -119
  62. package/common/types/jobs.types.ts +0 -171
  63. package/common/types/kyb.types.ts +0 -53
  64. package/common/types/kyc.types.ts +0 -188
  65. package/common/types/legal-entity.types.ts +0 -185
  66. package/common/types/login-history.types.ts +0 -46
  67. package/common/types/mail-template.types.ts +0 -436
  68. package/common/types/north-cap-integration.types.ts +0 -190
  69. package/common/types/note.types.ts +0 -109
  70. package/common/types/notification.types.ts +0 -58
  71. package/common/types/notion-api.types.ts +0 -374
  72. package/common/types/notion-database.types.ts +0 -125
  73. package/common/types/notion-page.types.ts +0 -267
  74. package/common/types/offering-reports.types.ts +0 -153
  75. package/common/types/offering-submission.types.ts +0 -314
  76. package/common/types/offering.types.ts +0 -590
  77. package/common/types/page-revision.types.ts +0 -86
  78. package/common/types/page.types.ts +0 -436
  79. package/common/types/password.type.ts +0 -15
  80. package/common/types/payment-methods.types.ts +0 -298
  81. package/common/types/phone.type.ts +0 -27
  82. package/common/types/portfolio.types.ts +0 -50
  83. package/common/types/privacy-policy-and-tos.types.ts +0 -231
  84. package/common/types/queue.types.ts +0 -111
  85. package/common/types/registered-reps.types.ts +0 -25
  86. package/common/types/rejection-reasons.types.ts +0 -56
  87. package/common/types/review.types.ts +0 -133
  88. package/common/types/role.types.ts +0 -26
  89. package/common/types/secondary-customer.types.ts +0 -66
  90. package/common/types/secondary-issuer.types.ts +0 -50
  91. package/common/types/secondary-order.types.ts +0 -58
  92. package/common/types/secondary-security.types.ts +0 -60
  93. package/common/types/secondary-trade.entity.ts +0 -16
  94. package/common/types/secondary-trade.types.ts +0 -95
  95. package/common/types/secure-request.types.ts +0 -68
  96. package/common/types/signer.types.ts +0 -651
  97. package/common/types/site-link.types.ts +0 -166
  98. package/common/types/site-settings.types.ts +0 -726
  99. package/common/types/site.types.ts +0 -270
  100. package/common/types/sms.types.ts +0 -30
  101. package/common/types/state-machine.types.ts +0 -177
  102. package/common/types/states.types.ts +0 -163
  103. package/common/types/subdoc-preview.types.ts +0 -35
  104. package/common/types/task.types.ts +0 -258
  105. package/common/types/trade-adjustment.type.ts +0 -33
  106. package/common/types/trade-line-item.type.ts +0 -132
  107. package/common/types/trade.types.ts +0 -931
  108. package/common/types/transaction.types.ts +0 -198
  109. package/common/types/trusted-contact.types.ts +0 -122
  110. package/common/types/typography.types.ts +0 -75
  111. package/common/types/user-manual.types.ts +0 -290
  112. package/common/types/user-setting.types.ts +0 -133
  113. package/common/types/user.types.ts +0 -320
  114. package/common/types/webhook.types.ts +0 -588
  115. package/common/types/zip.type.ts +0 -36
  116. package/contracts/clients/accounts/index.ts +0 -61
  117. package/contracts/clients/aic/index.ts +0 -59
  118. package/contracts/clients/api-key-logs/index.ts +0 -53
  119. package/contracts/clients/api-keys/index.ts +0 -73
  120. package/contracts/clients/assets/index.ts +0 -102
  121. package/contracts/clients/auth/index.ts +0 -50
  122. package/contracts/clients/files/index.ts +0 -166
  123. package/contracts/clients/files-public/index.ts +0 -166
  124. package/contracts/clients/index.ts +0 -44
  125. package/contracts/clients/individuals/index.ts +0 -93
  126. package/contracts/clients/investor-accounts/index.ts +0 -93
  127. package/contracts/clients/issuers/index.ts +0 -94
  128. package/contracts/clients/legal-entities/index.ts +0 -93
  129. package/contracts/clients/offerings/index.ts +0 -117
  130. package/contracts/clients/secure-requests/index.ts +0 -34
  131. package/contracts/clients/sites/index.ts +0 -56
  132. package/contracts/clients/trades/index.ts +0 -122
  133. package/contracts/compliance/account-contacts/index.ts +0 -82
  134. package/contracts/compliance/account-managers/index.ts +0 -142
  135. package/contracts/compliance/accounts/index.ts +0 -187
  136. package/contracts/compliance/activities/index.ts +0 -55
  137. package/contracts/compliance/aic/index.ts +0 -60
  138. package/contracts/compliance/api-keys/index.ts +0 -91
  139. package/contracts/compliance/assets/index.ts +0 -122
  140. package/contracts/compliance/auth/index.ts +0 -134
  141. package/contracts/compliance/batch-jobs/index.ts +0 -62
  142. package/contracts/compliance/bonus-tiers/index.ts +0 -55
  143. package/contracts/compliance/checklist/index.ts +0 -87
  144. package/contracts/compliance/checklist-items/index.ts +0 -86
  145. package/contracts/compliance/covered-persons/index.ts +0 -97
  146. package/contracts/compliance/dashboard/index.ts +0 -111
  147. package/contracts/compliance/data-records/index.ts +0 -116
  148. package/contracts/compliance/data-rooms/index.ts +0 -113
  149. package/contracts/compliance/default-theme-configs/index.ts +0 -95
  150. package/contracts/compliance/disbursement/index.ts +0 -165
  151. package/contracts/compliance/disbursement-approval-users/index.ts +0 -84
  152. package/contracts/compliance/disbursement-transactions/index.ts +0 -37
  153. package/contracts/compliance/domain-filters/index.ts +0 -117
  154. package/contracts/compliance/email-themes/index.ts +0 -284
  155. package/contracts/compliance/escrow-accounts/index.ts +0 -85
  156. package/contracts/compliance/exchange-api-keys/index.ts +0 -129
  157. package/contracts/compliance/exchange-imports/index.ts +0 -137
  158. package/contracts/compliance/files/index.ts +0 -267
  159. package/contracts/compliance/files-public/index.ts +0 -188
  160. package/contracts/compliance/health/index.ts +0 -26
  161. package/contracts/compliance/index.ts +0 -147
  162. package/contracts/compliance/individuals/index.ts +0 -57
  163. package/contracts/compliance/investor-accounts/index.ts +0 -141
  164. package/contracts/compliance/invites/index.ts +0 -137
  165. package/contracts/compliance/issuer-bank-accounts/index.ts +0 -81
  166. package/contracts/compliance/issuer-payment-methods/index.ts +0 -81
  167. package/contracts/compliance/issuers/index.ts +0 -97
  168. package/contracts/compliance/job-items/index.ts +0 -58
  169. package/contracts/compliance/jobs/index.ts +0 -59
  170. package/contracts/compliance/kyb/index.ts +0 -54
  171. package/contracts/compliance/kyc/index.ts +0 -77
  172. package/contracts/compliance/legal-entities/index.ts +0 -57
  173. package/contracts/compliance/login-histories/index.ts +0 -37
  174. package/contracts/compliance/notes/index.ts +0 -69
  175. package/contracts/compliance/notion-databases/index.ts +0 -107
  176. package/contracts/compliance/notion-pages/index.ts +0 -105
  177. package/contracts/compliance/offering-reports/index.ts +0 -149
  178. package/contracts/compliance/offerings/index.ts +0 -233
  179. package/contracts/compliance/pages/index.ts +0 -178
  180. package/contracts/compliance/payment-methods/index.ts +0 -57
  181. package/contracts/compliance/rejection-reasons/index.ts +0 -32
  182. package/contracts/compliance/review/index.ts +0 -169
  183. package/contracts/compliance/roles/index.ts +0 -34
  184. package/contracts/compliance/secondary-customers/index.ts +0 -77
  185. package/contracts/compliance/secondary-orders/index.ts +0 -60
  186. package/contracts/compliance/secondary-trades/index.ts +0 -100
  187. package/contracts/compliance/secure-requests/index.ts +0 -54
  188. package/contracts/compliance/signer/index.ts +0 -369
  189. package/contracts/compliance/site-links/index.ts +0 -128
  190. package/contracts/compliance/site-settings/index.ts +0 -669
  191. package/contracts/compliance/sites/index.ts +0 -56
  192. package/contracts/compliance/state-machine/index.ts +0 -94
  193. package/contracts/compliance/tasks/index.ts +0 -91
  194. package/contracts/compliance/third-parties/index.ts +0 -52
  195. package/contracts/compliance/trade-line-items/index.ts +0 -59
  196. package/contracts/compliance/trades/index.ts +0 -230
  197. package/contracts/compliance/transactions/index.ts +0 -161
  198. package/contracts/compliance/user-manuals/index.ts +0 -271
  199. package/contracts/compliance/user-settings/index.ts +0 -189
  200. package/contracts/compliance/users/index.ts +0 -200
  201. package/contracts/compliance/webhooks/index.ts +0 -41
  202. package/contracts/compliance-apikey/accounts/index.ts +0 -58
  203. package/contracts/compliance-apikey/index.ts +0 -14
  204. package/contracts/index.ts +0 -6
  205. package/contracts/investors/account-contacts/index.ts +0 -58
  206. package/contracts/investors/aic/index.ts +0 -59
  207. package/contracts/investors/assets/index.ts +0 -61
  208. package/contracts/investors/auth/index.ts +0 -116
  209. package/contracts/investors/bonus-tiers/index.ts +0 -37
  210. package/contracts/investors/cart/index.ts +0 -75
  211. package/contracts/investors/contact-us/index.ts +0 -48
  212. package/contracts/investors/data-records/index.ts +0 -113
  213. package/contracts/investors/data-rooms/index.ts +0 -96
  214. package/contracts/investors/files/index.ts +0 -167
  215. package/contracts/investors/files-public/index.ts +0 -185
  216. package/contracts/investors/index.ts +0 -72
  217. package/contracts/investors/individuals/index.ts +0 -99
  218. package/contracts/investors/investor-accounts/index.ts +0 -110
  219. package/contracts/investors/issuer-payment-methods/index.ts +0 -36
  220. package/contracts/investors/issuers/index.ts +0 -30
  221. package/contracts/investors/legal-entities/index.ts +0 -93
  222. package/contracts/investors/notes/index.ts +0 -69
  223. package/contracts/investors/offerings/index.ts +0 -93
  224. package/contracts/investors/pages/index.ts +0 -88
  225. package/contracts/investors/payment-methods/index.ts +0 -149
  226. package/contracts/investors/portfolios/index.ts +0 -53
  227. package/contracts/investors/sites/index.ts +0 -96
  228. package/contracts/investors/tasks/index.ts +0 -111
  229. package/contracts/investors/trade-line-items/index.ts +0 -75
  230. package/contracts/investors/trades/index.ts +0 -114
  231. package/contracts/investors/transactions/index.ts +0 -37
  232. package/contracts/investors/trusted-contacts/index.ts +0 -93
  233. package/contracts/investors/user-manuals/index.ts +0 -62
  234. package/contracts/investors/user-settings/index.ts +0 -170
  235. package/contracts/investors/users/index.ts +0 -45
  236. package/contracts/investors/webhooks/index.ts +0 -30
  237. package/contracts/issuers/account-contacts/index.ts +0 -76
  238. package/contracts/issuers/account-integrations/index.ts +0 -97
  239. package/contracts/issuers/accounts/index.ts +0 -97
  240. package/contracts/issuers/activities/index.ts +0 -54
  241. package/contracts/issuers/aic/index.ts +0 -39
  242. package/contracts/issuers/api-key-logs/index.ts +0 -53
  243. package/contracts/issuers/api-keys/index.ts +0 -93
  244. package/contracts/issuers/assets/index.ts +0 -122
  245. package/contracts/issuers/auth/index.ts +0 -152
  246. package/contracts/issuers/bonus-tiers/index.ts +0 -55
  247. package/contracts/issuers/contact-us/index.ts +0 -48
  248. package/contracts/issuers/covered-persons/index.ts +0 -136
  249. package/contracts/issuers/dashboard/index.ts +0 -72
  250. package/contracts/issuers/data-records/index.ts +0 -257
  251. package/contracts/issuers/data-rooms/index.ts +0 -134
  252. package/contracts/issuers/disbursement-approval-users/index.ts +0 -82
  253. package/contracts/issuers/disbursement-transactions/index.ts +0 -53
  254. package/contracts/issuers/disbursements/index.ts +0 -153
  255. package/contracts/issuers/email-themes/index.ts +0 -242
  256. package/contracts/issuers/escrow-accounts/index.ts +0 -81
  257. package/contracts/issuers/exchange-api-keys/index.ts +0 -144
  258. package/contracts/issuers/files/index.ts +0 -166
  259. package/contracts/issuers/files-public/index.ts +0 -166
  260. package/contracts/issuers/health/index.ts +0 -24
  261. package/contracts/issuers/index.ts +0 -112
  262. package/contracts/issuers/investor-accounts/index.ts +0 -148
  263. package/contracts/issuers/invites/index.ts +0 -129
  264. package/contracts/issuers/issuer/index.ts +0 -94
  265. package/contracts/issuers/issuer-bank-accounts/index.ts +0 -81
  266. package/contracts/issuers/issuer-payment-methods/index.ts +0 -136
  267. package/contracts/issuers/kyc/index.ts +0 -38
  268. package/contracts/issuers/login-histories/index.ts +0 -51
  269. package/contracts/issuers/notes/index.ts +0 -69
  270. package/contracts/issuers/offerings/index.ts +0 -206
  271. package/contracts/issuers/pages/index.ts +0 -138
  272. package/contracts/issuers/payment-methods/index.ts +0 -61
  273. package/contracts/issuers/portfolios/index.ts +0 -36
  274. package/contracts/issuers/rejection-reasons/index.ts +0 -32
  275. package/contracts/issuers/review/index.ts +0 -63
  276. package/contracts/issuers/secondary-customers/index.ts +0 -55
  277. package/contracts/issuers/secondary-orders/index.ts +0 -57
  278. package/contracts/issuers/secondary-trades/index.ts +0 -57
  279. package/contracts/issuers/secure-requests/index.ts +0 -34
  280. package/contracts/issuers/site-links/index.ts +0 -116
  281. package/contracts/issuers/site-settings/index.ts +0 -585
  282. package/contracts/issuers/sites/index.ts +0 -32
  283. package/contracts/issuers/tasks/index.ts +0 -111
  284. package/contracts/issuers/trades/index.ts +0 -132
  285. package/contracts/issuers/transactions/index.ts +0 -158
  286. package/contracts/issuers/user-manuals/index.ts +0 -62
  287. package/contracts/issuers/user-settings/index.ts +0 -170
  288. package/contracts/issuers/users/index.ts +0 -126
  289. package/contracts/secondaries/accounts/index.ts +0 -58
  290. package/contracts/secondaries/index.ts +0 -23
  291. package/contracts/secondaries/secondary-customers/index.ts +0 -55
  292. package/contracts/secondaries/secondary-issuers/index.ts +0 -94
  293. package/contracts/secondaries/secondary-orders/index.ts +0 -56
  294. package/contracts/secondaries/secondary-securities/index.ts +0 -95
  295. package/contracts/secondaries/secondary-trades/index.ts +0 -56
@@ -1,185 +0,0 @@
1
- import { z } from 'zod';
2
- import { IBaseEntity } from './entity.types';
3
- import {
4
- dateSchema,
5
- IPaginationMeta,
6
- KYBStatus,
7
- SanctionsStatus,
8
- SetupStatusType,
9
- } from './common.types';
10
- import { KybZod } from './kyb.types';
11
- import { extendZodWithOpenApi } from '@anatine/zod-openapi';
12
- import { TypeID } from 'typeid-js';
13
- import { AddressSchema } from './address.types';
14
- import { PhoneZodSchema } from './phone.type';
15
- extendZodWithOpenApi(z);
16
-
17
- // importing investorAccountIdSchema directly from './investor-account.types' causes 500 server errors due to circular import
18
- const investorAccountIdSchema = z.string().refine(
19
- (value) => {
20
- try {
21
- const tid = TypeID.fromString(value);
22
- return tid.getType() === 'investor_account';
23
- } catch {
24
- return false;
25
- }
26
- },
27
- {
28
- message:
29
- 'Invalid investor_account ID format. Must be a valid TypeID with "investor_account" prefix.',
30
- },
31
- );
32
-
33
- export const legalEntityIdSchema = z.string().refine(
34
- (value) => {
35
- try {
36
- const tid = TypeID.fromString(value);
37
- return tid.getType() === 'legal_entity';
38
- } catch {
39
- return false;
40
- }
41
- },
42
- {
43
- message:
44
- 'Invalid legal_entity ID format. Must be a valid TypeID with "legal_entity" prefix.',
45
- },
46
- );
47
- export const LegalEntityZod = IBaseEntity.extend({
48
- thirdPartyId: z
49
- .string()
50
- .openapi({ example: 'third_party_legal_entity_123' })
51
- .nullable(),
52
- accountId: z
53
- .string()
54
- .openapi({ example: 'account_01j1xgme5qeqq97gpdztd7e4a6' }),
55
- investorAccountId: z
56
- .string()
57
- .openapi({ example: 'investor_account_01j1xgme5qeqq97gpdztd7e4a7' }),
58
- kybStatus: z
59
- .lazy(() => z.nativeEnum(KYBStatus))
60
- .openapi({ example: 'PENDING' }),
61
- sanctionsStatus: z
62
- .lazy(() => z.nativeEnum(SanctionsStatus))
63
- .openapi({ example: 'PENDING' }),
64
- kybs: z.array(KybZod).optional(),
65
- name: z.string().openapi({ example: 'Acme Corporation' }),
66
- ein: z.string().openapi({ example: '12-3456789' }).nullish(),
67
- companyType: z.string().openapi({ example: 'LLC' }).nullish(),
68
- streetAddress: z.string().openapi({ example: '123 Main St' }).nullish(),
69
- city: z.string().openapi({ example: 'Anytown' }).nullish(),
70
- state: z.string().openapi({ example: 'CA' }).nullable(),
71
- zip: z.string().openapi({ example: '12345' }).nullish(),
72
- country: z.string().openapi({ example: 'USA' }).nullish(),
73
- phone: z.string().openapi({ example: '+12124567890' }).nullish(),
74
- setupStatus: z.nativeEnum(SetupStatusType),
75
- });
76
- export type LegalEntityZod = z.infer<typeof LegalEntityZod>;
77
-
78
- export const IPaginatedLegalEntity = z.object({
79
- items: z.array(LegalEntityZod),
80
- meta: IPaginationMeta,
81
- });
82
- export type IPaginatedLegalEntity = z.infer<typeof IPaginatedLegalEntity>;
83
-
84
- const legalEntitiesInclude = z.enum(['kybs']);
85
-
86
- export const LegalEntityFiltersZod = z.object({
87
- kybStatus: z.nativeEnum(KYBStatus).optional(),
88
- sanctionsStatus: z.nativeEnum(SanctionsStatus).optional(),
89
- });
90
-
91
- /**
92
- * @description Query parameters for including related entities
93
- * @xample in contract us as -> query: z.object({}).merge(UsersIncludeQuery),
94
- */
95
- export const LegalEntitiesIncludeQuery = z.object({
96
- include: z
97
- .string()
98
- .optional()
99
- .transform((str) => (str ? str.split(',') : []))
100
- .refine(
101
- (includes) =>
102
- includes.every((include) =>
103
- legalEntitiesInclude.options.includes(include as any),
104
- ),
105
- {
106
- message: `Invalid include option provided. Valid options are: ${legalEntitiesInclude.options.join(',')}`,
107
- },
108
- )
109
- .openapi({
110
- example: `${legalEntitiesInclude.options.join(',')}`,
111
- }),
112
- });
113
- export interface LegalEntitiesIncludeQuery
114
- extends z.infer<typeof LegalEntitiesIncludeQuery> {}
115
- export const EINSchema = z
116
- .string()
117
- .openapi({ example: '123456789' })
118
- .length(9, 'Ein shall be of 9 characters')
119
- .refine((v) => !isNaN(Number(v)), {
120
- message: `Ein can only consist of numbers`,
121
- })
122
- .optional();
123
-
124
- export const CompanyNameSchema = z
125
- .string()
126
- .openapi({ example: 'Acme Corporation' })
127
- .min(2, 'Name is less than 2 characters ')
128
- .max(50, 'Name is more than 50 characters ');
129
-
130
- export const CompanyTypeSchema = z
131
- .string()
132
- .openapi({ example: 'LLC' })
133
- .min(2, 'companyType is less than 2 characters ')
134
- .max(50, 'companyType is more than 50 characters ');
135
-
136
- export const PostLegalEntitySchema = z
137
- .object({
138
- investorAccountId: investorAccountIdSchema,
139
- name: CompanyNameSchema,
140
- ein: EINSchema,
141
- email: z.string().email().optional(),
142
- companyType: CompanyTypeSchema.optional(),
143
- phone: PhoneZodSchema.openapi({ example: '+12124567890' }).optional(),
144
- dateOfIncorporation: z.lazy(() => dateSchema).optional(),
145
- stateOfIncorporation: z.string().optional(),
146
- })
147
- .and(AddressSchema);
148
-
149
- export type PostLegalEntityType = z.infer<typeof PostLegalEntitySchema>;
150
-
151
- export const UpdateLegalEntitySchema = z
152
- .object({
153
- id: legalEntityIdSchema.optional(),
154
- name: CompanyNameSchema.optional(),
155
- ein: EINSchema,
156
- email: z.string().email().optional(),
157
- companyType: CompanyTypeSchema.optional(),
158
- phone: PhoneZodSchema.openapi({ example: '+12124567890' }).optional(),
159
- dateOfIncorporation: z.lazy(() => dateSchema).optional(),
160
- stateOfIncorporation: z.string().optional(),
161
- })
162
- .and(AddressSchema);
163
-
164
- export type UpdateLegalEntityType = z.infer<typeof UpdateLegalEntitySchema>;
165
-
166
- export const ResponseLegalEntitySchema = z.object({
167
- id: legalEntityIdSchema,
168
- accountId: z.string(),
169
- investorAccountId: z.string(),
170
- name: CompanyNameSchema,
171
- ein: EINSchema.nullish(),
172
- email: z.string().email().nullable(),
173
- companyType: z.string().nullable(),
174
- address: z.string().nullable(),
175
- address2: z.string().nullable(),
176
- city: z.string().nullable(),
177
- state: z.string().nullable(),
178
- zip: z.string().nullable(),
179
- country: z.string().nullable(),
180
- phone: z.string().nullable(),
181
- dateOfIncorporation: z.coerce.date().nullable(),
182
- stateOfIncorporation: z.string().nullable(),
183
- setupStatus: z.nativeEnum(SetupStatusType),
184
- });
185
- export type ResponseLegalEntityType = z.infer<typeof ResponseLegalEntitySchema>;
@@ -1,46 +0,0 @@
1
- import { TypeID } from 'typeid-js';
2
- import { z } from 'zod';
3
- import { IBaseEntity } from './entity.types';
4
- export const loginHistoryIdSchema = z.string().refine(
5
- (value) => {
6
- try {
7
- const tid = TypeID.fromString(value);
8
- return tid.getType() === 'login_history';
9
- } catch {
10
- return false;
11
- }
12
- },
13
- {
14
- message:
15
- 'Invalid login history ID format. Must be a valid TypeID with "login_history" prefix.',
16
- },
17
- );
18
- export const ILoginHistory = IBaseEntity.extend({
19
- id: loginHistoryIdSchema,
20
- ipAddress: z.string().ip().nullable(),
21
- location: z.string().nullable(),
22
- browser: z.string().nullable(),
23
- deviceString: z.string().nullable(),
24
- osVersion: z.string().nullable(),
25
- browserVersion: z.string().nullable(),
26
- os: z.string().nullable(),
27
- userId: z.string().nullable(),
28
- user: z.any().nullable(),
29
- });
30
- export type ILoginHistory = z.infer<typeof ILoginHistory>;
31
-
32
- export const PostLoginHistoryZod = z.object({
33
- ipAddress: z.string().ip().nullable(),
34
- location: z.string().nullable(),
35
- browser: z.string().nullable(),
36
- deviceString: z.string().nullable(),
37
- osVersion: z.string().nullable(),
38
- browserVersion: z.string().nullable(),
39
- os: z.string().nullable(),
40
- });
41
- export type PostLoginHistoryZod = z.infer<typeof PostLoginHistoryZod>;
42
-
43
- export const IListLoginHistories = z.object({
44
- items: z.array(ILoginHistory),
45
- });
46
- export type IListLoginHistories = z.infer<typeof IListLoginHistories>;
@@ -1,436 +0,0 @@
1
- import { z } from 'zod';
2
- import { InvestorAccountType } from './common.types';
3
-
4
- export const IssuerWelcomeEmailTemplateZod = z.object({
5
- issuerName: z.string(),
6
- });
7
- export type IssuerWelcomeEmailTemplateZod = z.infer<
8
- typeof IssuerWelcomeEmailTemplateZod
9
- >;
10
-
11
- export const ResetPasswordEmailTemplateZod = z.object({
12
- name: z.string(),
13
- resetPasswordLink: z.string(),
14
- resetPasswordCode: z.string(),
15
- });
16
- export type ResetPasswordEmailTemplateZod = z.infer<
17
- typeof ResetPasswordEmailTemplateZod
18
- >;
19
-
20
- export const InvitationEmailTemplateZod = z.object({
21
- issuerName: z.string(),
22
- role: z.string(),
23
- invitationLink: z.string(),
24
- });
25
- export type InvitationEmailTemplateZod = z.infer<
26
- typeof InvitationEmailTemplateZod
27
- >;
28
-
29
- export const InvestorWelcomeEmailTemplateZod = z.object({
30
- investorName: z.string(),
31
- issuerName: z.string(),
32
- loginLink: z.string(),
33
- });
34
- export type InvestorWelcomeEmailTemplateZod = z.infer<
35
- typeof InvestorWelcomeEmailTemplateZod
36
- >;
37
-
38
- export const PlacedOrderLineItemsZod = z.object({
39
- name: z.string(),
40
- pricePerShare: z.number(),
41
- numberOfSharesPurchased: z.number(),
42
- totalInvestment: z.number(),
43
- });
44
- export type PlacedOrderLineItemsZod = z.infer<typeof PlacedOrderLineItemsZod>;
45
-
46
- export const OrderPlacedEmailTemplateZod = z.object({
47
- issuerName: z.string(),
48
- investorName: z.string(),
49
- investorAccountType: z.nativeEnum(InvestorAccountType),
50
- lineItems: z.array(PlacedOrderLineItemsZod),
51
- tradeDetailsEndpoint: z.string(),
52
- isWirePayment: z.boolean(),
53
- usAccountHolderName: z.string(),
54
- usBankName: z.string(),
55
- usRoutingNumber: z.string(),
56
- usAccountNumber: z.string(),
57
- reference: z.string(),
58
- swiftId: z.string(),
59
- });
60
- export type OrderPlacedEmailTemplateZod = z.infer<
61
- typeof OrderPlacedEmailTemplateZod
62
- >;
63
-
64
- export const OrderApprovedEmailTemplateZod = OrderPlacedEmailTemplateZod.omit({
65
- lineItems: true,
66
- }).extend({
67
- pricePerShare: z.number(),
68
- numberOfAssetsPurchased: z.number(),
69
- name: z.string(),
70
- totalAmount: z.number(),
71
- isWirePayment: z.boolean(),
72
- usAccountHolderName: z.string(),
73
- usBankName: z.string(),
74
- usRoutingNumber: z.string(),
75
- usAccountNumber: z.string(),
76
- reference: z.string(),
77
- swiftId: z.string(),
78
- });
79
- export type OrderApprovedEmailTemplateZod = z.infer<
80
- typeof OrderApprovedEmailTemplateZod
81
- >;
82
-
83
- export const TaskAssignedEmailTemplateZod = z.object({
84
- userName: z.string(),
85
- taskName: z.string(),
86
- assignedBy: z.string(),
87
- dueDate: z.string(),
88
- taskType: z.string(),
89
- priority: z.string(),
90
- description: z.string(),
91
- completeTaskEndpoint: z.string(),
92
- });
93
- export type TaskAssignedEmailTemplateZod = z.infer<
94
- typeof TaskAssignedEmailTemplateZod
95
- >;
96
- export const ResetPasswordSuccessEmailTemplateZod = z.object({
97
- name: z.string(),
98
- loginLink: z.string(),
99
- });
100
- export type ResetPasswordSuccessEmailTemplateZod = z.infer<
101
- typeof ResetPasswordSuccessEmailTemplateZod
102
- >;
103
-
104
- export const PaymentFailedEmailTemplateZod = z.object({
105
- firstName: z.string(),
106
- tradeDetailsEndpoint: z.string(),
107
- });
108
- export type PaymentFailedEmailTemplateZod = z.infer<
109
- typeof PaymentFailedEmailTemplateZod
110
- >;
111
- export const RetirementInstructionEmailTemplateZod = z.object({
112
- name: z.string(),
113
- instruction: z.string(),
114
- });
115
- export type RetirementInstructionEmailTemplateZod = z.infer<
116
- typeof RetirementInstructionEmailTemplateZod
117
- >;
118
-
119
- export const ContactUsEmailTemplateZod = z.object({
120
- firstName: z.string(),
121
- lastName: z.string(),
122
- email: z.string(),
123
- subject: z.string(),
124
- message: z.string(),
125
- timestamp: z.string(),
126
- });
127
- export type ContactUsEmailTemplateZod = z.infer<
128
- typeof ContactUsEmailTemplateZod
129
- >;
130
-
131
- export const SignatureRequestEmailTemplateZod = z.object({
132
- investorName: z.string(),
133
- requestedBy: z.string(),
134
- requestedByEmail: z.string(),
135
- documentName: z.string(),
136
- expirationDate: z.string(),
137
- signersList: z.array(
138
- z.object({
139
- name: z.string(),
140
- email: z.string(),
141
- }),
142
- ),
143
- });
144
- export type SignatureRequestEmailTemplateZod = z.infer<
145
- typeof SignatureRequestEmailTemplateZod
146
- >;
147
- // TODO: Add EMAIL_VERIFICATION
148
- export const EMAIL_TEMPLATES = {
149
- WELCOME_ISSUER: {
150
- subject: 'Welcome to Dalmore',
151
- path: 'welcome-issuer.mjml',
152
- body: `<html>
153
- <body>
154
- <p>Hello {{issuerName}},</p>
155
-
156
- <p>Welcome to Dalmore! We're thrilled to have you here as you take the next step in raising investments.</p>
157
-
158
- <p>Getting started is simple. Complete setting up your issuer account, submit your offering for review, and once approved, you'll be ready to connect with investors.</p>
159
-
160
- <p>For more details on how Dalmore can support your fundraising efforts, we've attached a brief info guide.</p>
161
-
162
- <p>If you have any questions, feel free to reach out.</p>
163
-
164
- <p>Best,<br>
165
- The Dalmore Team</p>
166
- </body>
167
- </html>`,
168
- },
169
-
170
- WELCOME_INVESTOR: {
171
- subject: 'Start Investing with {{issuerName}} on Dalmore',
172
- path: 'welcome-investor.mjml',
173
- body: `<html>
174
- <body>
175
- <p>Hello {{investorName}},</p>
176
-
177
- <p>{{issuerName}} is now accepting investments on Dalmore. Explore the offering and invest today.</p>
178
-
179
- <p>You can view the offering here:</p>
180
-
181
- <p><a href="{{heroAssetLink}}">View Offering</a></p>
182
-
183
- <p>If you have any questions, we're here to help.</p>
184
-
185
- <p>Best,<br>
186
- The Dalmore Team</p>
187
- </body>
188
- </html>`,
189
- },
190
-
191
- RESET_PASSWORD: {
192
- subject: 'Reset your password',
193
- path: 'reset-password.mjml',
194
- body: `<html>
195
- <body>
196
- <p>Hello {{name}},</p>
197
-
198
- <p>We received a request to reset your password. Click below to set a new one:</p>
199
-
200
- <p>Code: {{resetPasswordCode}}</p>
201
-
202
- <p><a href="{{resetPasswordLink}}">Reset Password</a></p>
203
-
204
- <p>If you didn't request this, please ignore this email.</p>
205
-
206
- <p>Best,<br>
207
- The Dalmore Team</p>
208
- </body>
209
- </html>`,
210
- },
211
-
212
- ISSUER_INVITATION: {
213
- subject: "You've Been Invited to Join an Issuer Account",
214
- path: 'invitation.mjml',
215
- body: `<html>
216
- <body>
217
- <p>Hello,</p>
218
-
219
- <p>You've been invited to join the {{issuerName}}'s account on Dalmore with the role of {{role}}.</p>
220
-
221
- <p>Click below to accept the invitation and access the account:</p>
222
-
223
- <p>{{invitationLink}}</p>
224
-
225
- <p>If you have any questions, feel free to reach out.</p>
226
-
227
- <p>Best,<br>
228
- The Dalmore Team</p>
229
- </body>
230
- </html>`,
231
- },
232
-
233
- COMPLIANCE_INVITATION: {
234
- subject: "You've Been Invited to Join an Compliance Account",
235
- path: 'compliance-invitation.mjml',
236
- body: `<html>
237
- <body>
238
- <p>Hello,</p>
239
-
240
- <p>You've been invited to join the Dalmore Group Compliance Portal with the role of {{role}}.</p>
241
-
242
- <p>Click below to accept the invitation and access the account:</p>
243
-
244
- <p>{{invitationLink}}</p>
245
-
246
- <p>If you have any questions, feel free to reach out.</p>
247
-
248
- <p>Best,<br>
249
- The Dalmore Team</p>
250
- </body>
251
- </html>`,
252
- },
253
-
254
- ORDER_PLACED: {
255
- subject: 'Your Trade Has Been Placed',
256
- path: 'order-placed.mjml',
257
- body: `<html>
258
- <body>
259
- <p>Hello {{investorName}},</p>
260
-
261
- <p>Your trade has been successfully placed with {{issuerName}}. Here are the details:</p>
262
-
263
- <p><b>Investor Account Type:</b> {{investorAccountType}}<br>
264
- <b>Offering Name:</b> {{offeringName}}<br>
265
- <b>Number of Assets Purchased:</b> {{numberOfAssetsPurchased}}<br>
266
- <b>Total Investment Value:</b> {{totalInvestmentAmount}}</p>
267
-
268
- <p>You will receive a confirmation once the order is reviewed.</p>
269
-
270
- <p><a href="{{tradeDetailsEndpoint}}">View Trade Details</a></p>
271
-
272
- <p>Best,<br>
273
- The Dalmore Team</p>
274
- </body>
275
- </html>`,
276
- },
277
-
278
- ORDER_APPROVED: {
279
- subject: 'Your Trade Has Been Approved',
280
- path: 'order-approved.mjml',
281
- body: `<html>
282
- <body>
283
- <p>Hello {{investorName}},</p>
284
-
285
- <p>Your trade with {{issuerName}} has been reviewed and approved. Here are the details:</p>
286
-
287
- <p><b>Investor Account Type:</b> {{investorAccountType}}<br>
288
- <b>Offering Name:</b> {{offeringName}}<br>
289
- <b>Number of Assets Purchased:</b> {{numberOfAssetsPurchased}}<br>
290
- <b>Total Investment Value:</b> {{totalInvestmentAmount}}</p>
291
-
292
- <p>You can view your trade details in your account.</p>
293
-
294
- <p>Best,<br>
295
- The Dalmore Team</p>
296
- </body>
297
- </html>`,
298
- },
299
- TASK_ASSIGNED: {
300
- subject: 'New Task Assigned',
301
- path: 'task-assigned.mjml',
302
- body: `<html>
303
- <body>
304
- <p>Hi, {{userName}}!</p>
305
-
306
- <p>You have a new task assigned to you. Please review the details below:</p>
307
-
308
- <p>Task Name: {{taskName}}<br>
309
- Assigned By: {{assignedBy}}<br>
310
- Due Date: {{dueDate}}<br>
311
- Task Type: {{taskType}}<br>
312
- Priority: {{priority}}<br>
313
- Description: {{description}}</p>
314
-
315
- <p><a href="{{completeTaskEndpoint}}">Complete Task</a></p>
316
- </body>
317
- </html>
318
- `,
319
- },
320
- AML_PENDING: {
321
- subject: 'AML Pending',
322
- path: 'aml-pending.mjml',
323
- body: `<html>
324
- <body>
325
- <p>Hi, {{userName}}!</p>
326
-
327
- <p>Your AML status is pending. Please complete your AML.</p>
328
-
329
- <p>Click below to visit your AML record:</p>
330
-
331
- <p><a href="{{completeAmlEndpoint}}">Visit AML</a></p>
332
- </body>
333
- </html>
334
- `,
335
- },
336
- PAYMENT_FAILED: {
337
- subject: 'Payment Failed',
338
- path: 'payment-failed.mjml',
339
- body: ``,
340
- },
341
- RESET_PASSWORD_SUCCESS: {
342
- subject: 'Password Changed Successfully',
343
- path: 'reset-password-successful.mjml',
344
- body: ``,
345
- },
346
- RETIREMENT_INSTRUCTION: {
347
- subject: 'Retirement Instruction',
348
- path: 'retirement-instruction.mjml',
349
- body: ``,
350
- },
351
- EMAIL_NOTIFICATION: {
352
- subject: '{{subject}}',
353
- path: 'email-notification.mjml',
354
- body: ``,
355
- },
356
- CONTACT_US: {
357
- subject: 'New Contact Message',
358
- path: 'contact-us.mjml',
359
- body: ``,
360
- },
361
- SUBMIT_PAYMENT: {
362
- subject: 'New Task Assigned – Submit Payment',
363
- path: 'submit-payment.mjml',
364
- body: ``,
365
- },
366
- SIGNATURE_REQUEST: {
367
- subject: 'Document Signature Request',
368
- path: 'signature-request.mjml',
369
- body: ``,
370
- },
371
- };
372
- // TODO: Add EMAIL_VERIFICATION
373
- export enum EmailTemplatesType {
374
- WELCOME_ISSUER = 'WELCOME_ISSUER',
375
- WELCOME_INVESTOR = 'WELCOME_INVESTOR',
376
- RESET_PASSWORD = 'RESET_PASSWORD',
377
- RESET_PASSWORD_SUCCESS = 'RESET_PASSWORD_SUCCESS',
378
- ISSUER_INVITATION = 'ISSUER_INVITATION',
379
- COMPLIANCE_INVITATION = 'COMPLIANCE_INVITATION',
380
- EMAIL_NOTIFICATION = 'EMAIL_NOTIFICATION',
381
- ORDER_PLACED = 'ORDER_PLACED',
382
- ORDER_APPROVED = 'ORDER_APPROVED',
383
- TASK_ASSIGNED = 'TASK_ASSIGNED',
384
- PAYMENT_FAILED = 'PAYMENT_FAILED',
385
- UPDATE_PAYMENT = 'UPDATE_PAYMENT',
386
- KYC_VERIFICATION_REQUIRED = 'KYC_VERIFICATION_REQUIRED',
387
- DOCUMENT_SIGNATURE_PENDING = 'DOCUMENT_SIGNATURE_PENDING',
388
- VERIFY_ACCOUNT = 'VERIFY_ACCOUNT',
389
- SIGNATURE_REQUEST = 'SIGNATURE_REQUEST',
390
- SUBMIT_PAYMENT = 'SUBMIT_PAYMENT',
391
- RETIREMENT_INSTRUCTION = 'RETIREMENT_INSTRUCTION',
392
- AML_PENDING = 'AML_PENDING',
393
- CONTACT_US = 'CONTACT_US',
394
- NONE = 'NONE',
395
- }
396
-
397
- export enum EmailAttachmentsType {
398
- USER_MANUAL = 'USER_MANUAL',
399
- BROKER_DEALER = 'BROKER_DEALER',
400
- STREAM = 'STREAM',
401
- STREAMS = 'STREAMS',
402
- OTHER = 'OTHER',
403
- NONE = 'NONE',
404
- }
405
-
406
- export const FooterZod = z.object({
407
- linkedinUrl: z.string().url().nullable(),
408
- twitterUrl: z.string().url().nullable(),
409
- facebookUrl: z.string().url().nullable(),
410
- instagramUrl: z.string().url().nullable(),
411
- mailSupporter: z.string().email().nullable(),
412
- websiteUrl: z.string().url().nullable(),
413
- otherUrls: z.array(z.string().url().nullable()).nullable(),
414
- poweredByImageUrl: z.string().url().nullable(),
415
- contactUsUrl: z.string().url().nullable(),
416
- });
417
- export type FooterZod = z.infer<typeof FooterZod>;
418
-
419
- export const HeaderZod = z.object({
420
- companyName: z.string(),
421
- logoUrl: z.string().nullable(),
422
- });
423
-
424
- export type HeaderZod = z.infer<typeof HeaderZod>;
425
-
426
- export const HeaderAndFooterZod = z.object({
427
- header: HeaderZod,
428
- footer: FooterZod,
429
- });
430
- export type HeaderAndFooterZod = z.infer<typeof HeaderAndFooterZod>;
431
-
432
- export const EmailThemeSettingZod = z.record(z.string(), z.string().nullable());
433
- export type EmailThemeSetting = z.infer<typeof EmailThemeSettingZod>;
434
-
435
- export const EmailThemeSettingsZod = z.array(EmailThemeSettingZod);
436
- export type EmailThemeSettingsZod = z.infer<typeof EmailThemeSettingsZod>;