@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,726 +0,0 @@
1
- import { TypeID } from 'typeid-js';
2
- import { z } from 'zod';
3
- import { fileIdSchema } from './file.types';
4
- import {
5
- AccountZod,
6
- HexCodeColorSchema,
7
- IPaginationMeta,
8
- SubdomainSchema,
9
- ThemeScope,
10
- UrlSchema,
11
- } from './common.types';
12
- import { accountIdSchema } from './account.types';
13
- import { typographySchema } from './typography.types';
14
- import { PasswordSchema } from './password.type';
15
- import { emailThemeIdSchema } from './email-theme.types';
16
- import { pageIdSchema } from './page.types';
17
- import { defaultThemeConfigIdSchema } from './default-theme-config.types';
18
-
19
- export const themeIdSchema = z.string().refine(
20
- (value) => {
21
- try {
22
- const tid = TypeID.fromString(value);
23
- return tid.getType() === 'theme';
24
- } catch {
25
- return false;
26
- }
27
- },
28
- {
29
- message: `Invalid theme ID format. Must be a valid TypeID with "theme" prefix. Example: theme_01j5y5ghx5fg68d663j1fvy2x7`,
30
- },
31
- );
32
-
33
- export const themeSettingIdSchema = z.string().refine(
34
- (value) => {
35
- try {
36
- const tid = TypeID.fromString(value);
37
- return tid.getType() === 'theme_setting';
38
- } catch {
39
- return false;
40
- }
41
- },
42
- {
43
- message: `Invalid theme_setting ID format. Must be a valid TypeID with "theme_setting" prefix. Example: theme_setting_01j5y5ghx5fg68d663j1fvy2x7`,
44
- },
45
- );
46
-
47
- export const ThemeFiltersZod = z.object({
48
- accountId: accountIdSchema.optional(),
49
- });
50
- export type ThemeFiltersZod = z.infer<typeof ThemeFiltersZod>;
51
-
52
- export const GetPasswordProtectionSettingsZod = z.object({
53
- enabled: z.boolean().optional(),
54
- message: z.string().nullable(),
55
- });
56
- export type GetPasswordProtectionSettingsZod = z.infer<
57
- typeof GetPasswordProtectionSettingsZod
58
- >;
59
-
60
- export const PatchPasswordProtectionSettingsZod = z
61
- .object({
62
- enabled: z.boolean().optional().openapi({ example: true }),
63
- message: z.string().nullable().openapi({
64
- example:
65
- 'This site is password protected. Please enter the password to access the site.',
66
- }),
67
- password: PasswordSchema.nullable()
68
- .optional()
69
- .openapi({ example: '#SecretPassword123' }),
70
- })
71
- .refine(
72
- (data) => {
73
- // If enabled is true, password must be set
74
- if (data.enabled === true) {
75
- return data.password !== null && data.password !== undefined;
76
- }
77
- return true;
78
- },
79
- {
80
- message: 'Password must be set when protection is enabled',
81
- path: ['password'],
82
- },
83
- );
84
-
85
- export type PatchPasswordProtectionSettingsZod = z.infer<
86
- typeof PatchPasswordProtectionSettingsZod
87
- >;
88
-
89
- export const GetSiteDomainZod = z.object({
90
- domain: z.string().nullable(),
91
- customDomain: z.string().nullable(),
92
- });
93
- export type GetSiteDomainZod = z.infer<typeof GetSiteDomainZod>;
94
-
95
- export const PatchSiteDomainZod = z.object({
96
- customDomain: UrlSchema.optional().nullable(),
97
- domain: SubdomainSchema.optional(),
98
- });
99
- export type PatchSiteDomainZod = z.infer<typeof PatchSiteDomainZod>;
100
- export const PatchSiteDomainResponse = z.object({
101
- message: z.string(),
102
- });
103
- export type PatchSiteDomainResponse = z.infer<typeof PatchSiteDomainResponse>;
104
-
105
- export const GetSeoSettingsZod = z.object({
106
- title: z.string().nullable(),
107
- description: z.string().nullable(),
108
- keywords: z.string().nullable(),
109
- });
110
- export type GetSeoSettingsZod = z.infer<typeof GetSeoSettingsZod>;
111
-
112
- export const PatchSeoSettingsZod = GetSeoSettingsZod.extend({
113
- title: z.string().min(2).max(50).optional().openapi({ example: 'example' }),
114
- description: z
115
- .string()
116
- .min(2)
117
- .max(200)
118
- .nullable()
119
- .optional()
120
- .openapi({ example: 'example' }),
121
- keywords: z
122
- .string()
123
- .min(2)
124
- .max(200)
125
- .nullable()
126
- .optional()
127
- .openapi({ example: 'example' }),
128
- });
129
-
130
- export type PatchSeoSettingsZod = z.infer<typeof PatchSeoSettingsZod>;
131
-
132
- export const GetBrandingSettingsZod = z.object({
133
- logo: z.string().nullable(),
134
- favicon: z.string().nullable(),
135
- backgroundImage: z.string().nullable(),
136
- typography: typographySchema.nullable(),
137
- themeId: themeIdSchema.nullable(),
138
- tagline: z.string().nullable(),
139
- });
140
-
141
- export type GetBrandingSettingsZod = z.infer<typeof GetBrandingSettingsZod>;
142
-
143
- export const PatchBrandingSettingsZod = GetBrandingSettingsZod.extend({
144
- logo: z
145
- .lazy(() => fileIdSchema)
146
- .nullable()
147
- .optional()
148
- .openapi({ example: 'file_01j5y5ghx8fvc83dmx3pznq7hv' }),
149
- favicon: z
150
- .lazy(() => fileIdSchema)
151
- .nullable()
152
- .optional()
153
- .openapi({ example: 'file_01j5y5ghx8fvc83dmx3pznq7hv' }),
154
- backgroundImage: z
155
- .lazy(() => fileIdSchema)
156
- .nullable()
157
- .optional()
158
- .openapi({ example: 'file_01j5y5ghx8fvc83dmx3pznq7hv' }),
159
- typography: typographySchema,
160
- themeId: themeIdSchema.nullable().optional(),
161
- tagline: z.string().nullable().optional(),
162
- });
163
-
164
- export type PatchBrandingSettingsZod = z.infer<typeof PatchBrandingSettingsZod>;
165
-
166
- export const GetThemeZod = z.object({
167
- id: themeIdSchema,
168
- name: z.string().nullable(),
169
- accountId: z.lazy(() => accountIdSchema).nullable(),
170
- });
171
- export type GetThemeZod = z.infer<typeof GetThemeZod>;
172
-
173
- export const ThemesList = z.object({
174
- items: z.array(GetThemeZod),
175
- });
176
- export type ThemesList = z.infer<typeof ThemesList>;
177
-
178
- export const ThemeSettingsZod = z.object({
179
- id: themeSettingIdSchema,
180
- name: z.string().nullable(),
181
- category: z.string().nullable(),
182
- darkMode: z.string().nullable(),
183
- lightMode: z.string().nullable(),
184
- });
185
-
186
- export const ITheme = z.object({
187
- id: themeIdSchema,
188
- name: z.string().nullable(),
189
- accountId: z.lazy(() => accountIdSchema).nullable(),
190
- account: z
191
- .lazy(() => AccountZod)
192
- .optional()
193
- .nullable(),
194
- });
195
-
196
- export type ITheme = z.infer<typeof ITheme>;
197
-
198
- export const IThemeSetting = z.object({
199
- id: themeSettingIdSchema,
200
- name: z.string().nullable(),
201
- category: z.string().nullable(),
202
- darkMode: z.string().nullable(),
203
- lightMode: z.string().nullable(),
204
- themeId: themeIdSchema.nullable(),
205
- theme: z
206
- .lazy(() => ITheme)
207
- .optional()
208
- .nullable(),
209
- });
210
- export type IThemeSetting = z.infer<typeof IThemeSetting>;
211
-
212
- export const IThemeSettings = z.array(IThemeSetting);
213
- export type IThemeSettings = z.infer<typeof IThemeSettings>;
214
-
215
- const themesInclude = z.enum(['site', 'themeSettings']);
216
- /**
217
- * @description Query parameters for including related entities
218
- * @xample in contract us as -> query: z.object({}).merge(ThemesIncludeQuery),
219
- */
220
- export const ThemesIncludeQuery = z.object({
221
- include: z
222
- .string()
223
- .optional()
224
- .transform((str) => (str ? str.split(',') : []))
225
- .refine(
226
- (includes) =>
227
- includes.every((include) =>
228
- themesInclude.options.includes(include as any),
229
- ),
230
- {
231
- message: `Invalid include option provided. Valid options are: ${themesInclude.options.join(',')}`,
232
- },
233
- )
234
- .openapi({
235
- example: `${themesInclude.options.join(',')}`,
236
- }),
237
- });
238
-
239
- export const IPaginatedTheme = z.object({
240
- items: z.array(ITheme),
241
- meta: IPaginationMeta,
242
- });
243
- export type IPaginatedTheme = z.infer<typeof IPaginatedTheme>;
244
-
245
- export const PostThemeZod = z.object({
246
- name: z.string().min(2).max(50).openapi({ example: 'theme_name' }),
247
- themeId: themeIdSchema.openapi({
248
- example: 'theme_01j5y5ghx5fg68d663j1fvy2x7',
249
- }),
250
- });
251
- export type PostThemeZod = z.infer<typeof PostThemeZod>;
252
-
253
- export const CompliancePostThemeZod = PostThemeZod.extend({
254
- themeId: themeIdSchema.nullable().optional(),
255
- scope: z.nativeEnum(ThemeScope).default(ThemeScope.ACCOUNT),
256
- accountId: accountIdSchema.optional(),
257
- }).superRefine((data, ctx) => {
258
- if (data.scope === ThemeScope.ACCOUNT) {
259
- if (!data.accountId) {
260
- ctx.addIssue({
261
- code: z.ZodIssueCode.custom,
262
- message: 'Account Id is required when scope is ACCOUNT',
263
- });
264
- }
265
- if (!data.themeId) {
266
- ctx.addIssue({
267
- code: z.ZodIssueCode.custom,
268
- message: 'Theme Id is required when scope is ACCOUNT',
269
- });
270
- }
271
- }
272
- });
273
- export type CompliancePostThemeZod = z.infer<typeof CompliancePostThemeZod>;
274
-
275
- export const PatchThemeSetting = z.object({
276
- darkMode: HexCodeColorSchema.optional(),
277
- lightMode: HexCodeColorSchema.optional(),
278
- });
279
-
280
- export type PatchThemeSetting = z.infer<typeof PatchThemeSetting>;
281
-
282
- export const CompliancePatchThemeSetting = PatchThemeSetting.extend({
283
- accountId: accountIdSchema.optional(),
284
- });
285
- export type CompliancePatchThemeSetting = z.infer<
286
- typeof CompliancePatchThemeSetting
287
- >;
288
-
289
- export const PatchThemeSettings = z
290
- .array(
291
- PatchThemeSetting.extend({
292
- id: themeSettingIdSchema.openapi({
293
- example: 'theme_setting_01j5y5ghx5fg68d663j1fvy2x7',
294
- }),
295
- }),
296
- )
297
- .min(1);
298
- export type PatchThemeSettings = z.infer<typeof PatchThemeSettings>;
299
- export const CompliancePatchThemeSettings = z.object({
300
- accountId: accountIdSchema.nullable().default(null),
301
- themeSettings: PatchThemeSettings,
302
- });
303
-
304
- export type CompliancePatchThemeSettings = z.infer<
305
- typeof CompliancePatchThemeSettings
306
- >;
307
-
308
- export const ThemeExportZod = z.object({
309
- name: z.string().nullable(),
310
- category: z.string().nullable(),
311
- lightMode: HexCodeColorSchema.nullable(),
312
- darkMode: HexCodeColorSchema.nullable(),
313
- });
314
- export type ThemeExportZod = z.infer<typeof ThemeExportZod>;
315
-
316
- export const PatchThemeSettingWithName = z.object({
317
- name: z.string(),
318
- category: z.string(),
319
- darkMode: HexCodeColorSchema.optional(),
320
- lightMode: HexCodeColorSchema.optional(),
321
- });
322
-
323
- export type PatchThemeSettingWithName = z.infer<
324
- typeof PatchThemeSettingWithName
325
- >;
326
-
327
- export const ImportThemeSettingsZod = z.array(PatchThemeSettingWithName);
328
- export type ImportThemeSettingsZod = z.infer<typeof ImportThemeSettingsZod>;
329
-
330
- export const ExportThemeSettingsZod = z.array(ThemeExportZod);
331
- export type ExportThemeSettingsZod = z.infer<typeof ExportThemeSettingsZod>;
332
-
333
- export const PatchThemeNameZod = z.object({
334
- name: z.string().min(2).max(50).openapi({ example: 'green' }),
335
- });
336
- export type PatchThemeNameZod = z.infer<typeof PatchThemeNameZod>;
337
-
338
- export const CompliancePatchThemeNameZod = PatchThemeNameZod.extend({
339
- accountId: accountIdSchema.nullable().optional().openapi({
340
- example: 'account_01j5y5ghx5fg68d663j1fvy2x7',
341
- }),
342
- });
343
- export type CompliancePatchThemeNameZod = z.infer<
344
- typeof CompliancePatchThemeNameZod
345
- >;
346
-
347
- export const UpdateWithPersonaThemeIdZod = z.object({
348
- withPersonaThemeId: z
349
- .string()
350
- .min(6)
351
- .max(48)
352
- .openapi({ example: '123e4567-e89b-12d3-a456-426614174000' }),
353
- });
354
- export type UpdateWithPersonaThemeIdZod = z.infer<
355
- typeof UpdateWithPersonaThemeIdZod
356
- >;
357
-
358
- export const GetEmailSettingsZod = z.object({
359
- senderName: z.string().nullable(),
360
- emailThemeId: emailThemeIdSchema.nullable(),
361
- emailLogo: fileIdSchema.nullable(),
362
- });
363
-
364
- export type GetEmailSettingsZod = z.infer<typeof GetEmailSettingsZod>;
365
-
366
- export const PatchEmailSettingsZod = GetEmailSettingsZod.extend({
367
- senderName: z
368
- .string()
369
- .min(2)
370
- .max(50)
371
- .optional()
372
- .openapi({ example: 'example' }),
373
- emailThemeId: emailThemeIdSchema.nullable().optional(),
374
- emailLogo: fileIdSchema.nullable().optional(),
375
- });
376
-
377
- export type PatchEmailSettingsZod = z.infer<typeof PatchEmailSettingsZod>;
378
-
379
- export const CompliancePatchEmailSettingsZod = z
380
- .object({
381
- accountId: accountIdSchema.openapi({
382
- example: 'account_01j5y5ghx5fg68d663j1fvy2x7',
383
- }),
384
- })
385
- .merge(PatchEmailSettingsZod);
386
- export type CompliancePatchEmailSettingsZod = z.infer<
387
- typeof CompliancePatchEmailSettingsZod
388
- >;
389
-
390
- export const UpdateGaIdZod = z.object({
391
- gaIds: z
392
- .array(
393
- z
394
- .string()
395
- .min(6)
396
- .max(48)
397
- .openapi({ example: '123e4567-e89b-12d3-a456-426614174000' }),
398
- )
399
- .nullable(),
400
- });
401
- export type UpdateGaIdZod = z.infer<typeof UpdateGaIdZod>;
402
-
403
- export const ComplianceUpdateGaIdZod = z
404
- .object({
405
- accountId: accountIdSchema.openapi({
406
- example: 'account_01j5y5ghx5fg68d663j1fvy2x7',
407
- }),
408
- })
409
- .merge(UpdateGaIdZod);
410
- export type ComplianceUpdateGaIdZod = z.infer<typeof ComplianceUpdateGaIdZod>;
411
-
412
- export const GetSynchronizeThemeBlobsZod = z.object({
413
- shouldCheckForExistingBlobs: z.coerce.boolean().default(true).optional(),
414
- });
415
- export type GetSynchronizeThemeBlobsZod = z.infer<
416
- typeof GetSynchronizeThemeBlobsZod
417
- >;
418
-
419
- export const GetInvestorAccountTypeSettingsZod = z.object({
420
- individual: z.boolean(),
421
- joint: z.boolean(),
422
- entity: z.boolean(),
423
- retirement: z.boolean(),
424
- });
425
- export type GetInvestorAccountTypeSettingsZod = z.infer<
426
- typeof GetInvestorAccountTypeSettingsZod
427
- >;
428
-
429
- export const PatchInvestorAccountTypeSettingsZod = z.object({
430
- individual: z.boolean().openapi({ example: true }),
431
- joint: z.boolean().openapi({ example: true }),
432
- entity: z.boolean().openapi({ example: true }),
433
- retirement: z.boolean().openapi({ example: false }),
434
- });
435
- export type PatchInvestorAccountTypeSettingsZod = z.infer<
436
- typeof PatchInvestorAccountTypeSettingsZod
437
- >;
438
-
439
- export const CompliancePatchInvestorAccountTypeSettingsZod =
440
- PatchInvestorAccountTypeSettingsZod.extend({
441
- accountId: accountIdSchema.openapi({
442
- example: 'account_01j5y5ghx5fg68d663j1fvy2x7',
443
- }),
444
- });
445
- export type CompliancePatchInvestorAccountTypeSettingsZod = z.infer<
446
- typeof CompliancePatchInvestorAccountTypeSettingsZod
447
- >;
448
-
449
- export const InvestorAccountTypeSettingsZod = z.object({
450
- individual: z.boolean(),
451
- joint: z.boolean(),
452
- entity: z.boolean(),
453
- retirement: z.boolean(),
454
- });
455
- export type InvestorAccountTypeSettingsZod = z.infer<
456
- typeof InvestorAccountTypeSettingsZod
457
- >;
458
-
459
- export const GetSenderEmailZod = z.object({
460
- senderEmail: z.string(),
461
- });
462
- export type GetSenderEmailZod = z.infer<typeof GetSenderEmailZod>;
463
-
464
- export const PatchSenderEmailZod = z.object({
465
- senderEmail: z.string().email().openapi({ example: 'example@example.com' }),
466
- });
467
- export type PatchSenderEmailZod = z.infer<typeof PatchSenderEmailZod>;
468
-
469
- export const CompliancePatchSenderEmailZod = z
470
- .object({
471
- accountId: accountIdSchema.openapi({
472
- example: 'account_01j5y5ghx5fg68d663j1fvy2x7',
473
- }),
474
- })
475
- .merge(PatchSenderEmailZod);
476
- export type CompliancePatchSenderEmailZod = z.infer<
477
- typeof CompliancePatchSenderEmailZod
478
- >;
479
-
480
- export const GetCurrentLandingPageZod = z.object({
481
- landingPageId: pageIdSchema
482
- .openapi({
483
- example: 'page_01j5y5ghx5fg68d663j1fvy2x7',
484
- })
485
- .nullable(),
486
- });
487
-
488
- export type GetCurrentLandingPageZod = z.infer<typeof GetCurrentLandingPageZod>;
489
-
490
- export const PatchCurrentLandingPageZod = z.object({
491
- landingPageId: pageIdSchema
492
- .openapi({
493
- example: 'page_01j5y5ghx5fg68d663j1fvy2x7',
494
- })
495
- .nullable(),
496
- });
497
- export type PatchCurrentLandingPageZod = z.infer<
498
- typeof PatchCurrentLandingPageZod
499
- >;
500
-
501
- export const CompliancePatchCurrentLandingPageZod =
502
- PatchCurrentLandingPageZod.extend({
503
- accountId: accountIdSchema.openapi({
504
- example: 'account_01j5y5ghx5fg68d663j1fvy2x7',
505
- }),
506
- });
507
- export type CompliancePatchCurrentLandingPageZod = z.infer<
508
- typeof CompliancePatchCurrentLandingPageZod
509
- >;
510
-
511
- export const GetPixelCodeZod = z.object({
512
- trackingPixelCode: z.string().nullable(),
513
- conversionPixelCode: z.string().nullable(),
514
- });
515
- export type GetPixelCodeZod = z.infer<typeof GetPixelCodeZod>;
516
-
517
- export const PatchPixelCodeZod = z.object({
518
- trackingPixelCode: z.string().min(1).max(10000).nullable().optional(),
519
- conversionPixelCode: z.string().min(1).max(10000).nullable().optional(),
520
- });
521
- export type PatchPixelCodeZod = z.infer<typeof PatchPixelCodeZod>;
522
-
523
- export const CompliancePatchPixelCodeZod = PatchPixelCodeZod.extend({
524
- accountId: accountIdSchema.openapi({
525
- example: 'account_01j5y5ghx5fg68d663j1fvy2x7',
526
- }),
527
- });
528
- export type CompliancePatchPixelCodeZod = z.infer<
529
- typeof CompliancePatchPixelCodeZod
530
- >;
531
-
532
- export const GetDemoCredentialsZod = z.object({
533
- email: z.string().email().nullable(),
534
- password: z.string().nullable(),
535
- });
536
- export type GetDemoCredentialsZod = z.infer<typeof GetDemoCredentialsZod>;
537
-
538
- export const UpdateDemoPassword = z.object({
539
- password: PasswordSchema.openapi({ example: 'Secretpassword6#' }),
540
- });
541
- export type UpdateDemoPassword = z.infer<typeof UpdateDemoPassword>;
542
-
543
- export const ComplianceUpdateDemoPassword = UpdateDemoPassword.extend({
544
- accountId: accountIdSchema.openapi({
545
- example: 'account_01j5y5ghx5fg68d663j1fvy2x7',
546
- }),
547
- });
548
- export type ComplianceUpdateDemoPassword = z.infer<
549
- typeof ComplianceUpdateDemoPassword
550
- >;
551
-
552
- export const GetPublicDataTypesZod = z.object({
553
- publicOfferings: z.boolean().default(false),
554
- publicPages: z.boolean().default(false),
555
- publicDataRooms: z.boolean().default(false),
556
- });
557
- export type GetPublicDataTypesZod = z.infer<typeof GetPublicDataTypesZod>;
558
-
559
- export const PatchPublicDataTypesZod = z.object({
560
- publicOfferings: z.boolean().optional(),
561
- publicPages: z.boolean().optional(),
562
- publicDataRooms: z.boolean().optional(),
563
- });
564
- export type PatchPublicDataTypesZod = z.infer<typeof PatchPublicDataTypesZod>;
565
-
566
- export const CompliancePatchPublicDataTypesZod = PatchPublicDataTypesZod.extend(
567
- {
568
- accountId: accountIdSchema.openapi({
569
- example: 'account_01j5y5ghx5fg68d663j1fvy2x7',
570
- }),
571
- },
572
- );
573
- export type CompliancePatchPublicDataTypesZod = z.infer<
574
- typeof CompliancePatchPublicDataTypesZod
575
- >;
576
-
577
- export const DefaultEmailThemeConfigZod = z.object({
578
- id: emailThemeIdSchema,
579
- name: z.string().nullable(),
580
- colors: z.object({
581
- primaryBackground: z.string().nullable(),
582
- primaryText: z.string().nullable(),
583
- secondaryBackground: z.string().nullable(),
584
- secondaryText: z.string().nullable(),
585
- }),
586
- });
587
- export type DefaultEmailThemeConfigZod = z.infer<
588
- typeof DefaultEmailThemeConfigZod
589
- >;
590
-
591
- export const DefaultEmailThemeConfigsZod = z.array(DefaultEmailThemeConfigZod);
592
- export type DefaultEmailThemeConfigsZod = z.infer<
593
- typeof DefaultEmailThemeConfigsZod
594
- >;
595
-
596
- export const GetDefaultThemeConfigZod = z
597
- .object({
598
- id: defaultThemeConfigIdSchema,
599
- name: z.string().nullable(),
600
- themeName: z.string().nullable(),
601
- colors: z.object({
602
- primaryBackground: z.string().nullable(),
603
- primaryText: z.string().nullable(),
604
- secondaryBackground: z.string().nullable(),
605
- secondaryText: z.string().nullable(),
606
- }),
607
- })
608
- .nullable();
609
- export type GetDefaultThemeConfigZod = z.infer<typeof GetDefaultThemeConfigZod>;
610
-
611
- export const ThemeColorsZod = z.object({
612
- primaryBackground: HexCodeColorSchema,
613
- primaryText: HexCodeColorSchema,
614
- secondaryBackground: HexCodeColorSchema,
615
- secondaryText: HexCodeColorSchema,
616
- });
617
-
618
- export type ThemeColorsZod = z.infer<typeof ThemeColorsZod>;
619
-
620
- export type ThemeIds = {
621
- themeId: string;
622
- emailThemeId: string;
623
- };
624
-
625
- export const THEME_COLOR_MAPPINGS = {
626
- REGULAR_THEME: {
627
- entity: 'ThemeSetting',
628
- themeIdField: 'themeId',
629
- primaryBackground: { category: 'background-color', name: 'dark' },
630
- secondaryBackground: { category: 'background-color', name: 'main' },
631
- primaryText: { category: 'text', name: 'dark' },
632
- secondaryText: { category: 'text', name: 'main' },
633
- },
634
- EMAIL_THEME: {
635
- entity: 'EmailThemeSetting',
636
- themeIdField: 'emailThemeId',
637
- primaryBackground: {
638
- category: 'content',
639
- name: 'primary-background-color',
640
- },
641
- secondaryBackground: {
642
- category: 'content',
643
- name: 'secondary-background-color',
644
- },
645
- primaryText: { category: 'content', name: 'text-primary-color' },
646
- secondaryText: { category: 'content', name: 'text-secondary-color' },
647
- },
648
- } as const;
649
-
650
- export const PostDefaultThemeSetupZod = z.object({
651
- defaultThemeConfigId: defaultThemeConfigIdSchema,
652
- colors: ThemeColorsZod,
653
- themeName: z.string().min(2).max(50).nullable().optional(),
654
- });
655
-
656
- export type PostDefaultThemeSetupZod = z.infer<typeof PostDefaultThemeSetupZod>;
657
-
658
- export enum DefaultThemeConfigCase {
659
- NO_THEMES = 'NO_THEMES',
660
- SAME_CONFIG_WITH_THEMES = 'SAME_CONFIG_WITH_THEMES',
661
- SAME_CONFIG_WITHOUT_THEMES = 'SAME_CONFIG_WITHOUT_THEMES',
662
- DIFFERENT_CONFIG_WITH_THEMES = 'DIFFERENT_CONFIG_WITH_THEMES',
663
- DIFFERENT_CONFIG_WITHOUT_THEMES = 'DIFFERENT_CONFIG_WITHOUT_THEMES',
664
- }
665
-
666
- export enum ThemeType {
667
- REGULAR_THEME = 'REGULAR_THEME',
668
- EMAIL_THEME = 'EMAIL_THEME',
669
- }
670
-
671
- export const GetThemesAdminQuery = z.object({
672
- accountId: accountIdSchema.optional(),
673
- search: z.string().max(100).optional(),
674
- });
675
- export type GetThemesAdminQuery = z.infer<typeof GetThemesAdminQuery>;
676
-
677
- export const CreateDefaultThemeSettingsZod = z.object({
678
- name: z.string(),
679
- category: z.string(),
680
- darkMode: z.string(),
681
- lightMode: z.string(),
682
- themeId: themeIdSchema,
683
- });
684
- export type CreateDefaultThemeSettingsZod = z.infer<
685
- typeof CreateDefaultThemeSettingsZod
686
- >;
687
-
688
- export const THEME_SETTINGS_CATEGORIES = {
689
- 'background-color': ['main', 'dark'],
690
- text: ['main', 'light', 'dark'],
691
- link: ['main'],
692
- 'border-input': ['main'],
693
- 'button-text': ['primary'],
694
- 'background-button': ['primary'],
695
- };
696
-
697
- export const DefaultThemesZod = z.object({
698
- themes: z.array(
699
- z.object({
700
- name: z.string(),
701
- themeSettings: z.array(
702
- z.object({
703
- category: z.string(),
704
- name: z.string(),
705
- lightMode: HexCodeColorSchema,
706
- }),
707
- ),
708
- }),
709
- ),
710
- });
711
- export type DefaultThemesZod = z.infer<typeof DefaultThemesZod>;
712
-
713
- export const GetDefaultThemeZod = z.object({
714
- id: themeIdSchema,
715
- name: z.string().nullable(),
716
- colors: z.object({
717
- primaryBackground: HexCodeColorSchema.nullable(),
718
- primaryText: HexCodeColorSchema.nullable(),
719
- secondaryBackground: HexCodeColorSchema.nullable(),
720
- secondaryText: HexCodeColorSchema.nullable(),
721
- }),
722
- });
723
- export type GetDefaultThemeZod = z.infer<typeof GetDefaultThemeZod>;
724
-
725
- export const GetDefaultThemesZod = z.array(GetDefaultThemeZod);
726
- export type GetDefaultThemesZod = z.infer<typeof GetDefaultThemesZod>;