@dalmore/api-contracts 1.0.3 → 1.0.6

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 (186) hide show
  1. package/README.md +34 -60
  2. package/index.mjs +1001 -18638
  3. package/package.json +5 -53
  4. package/src/common/types/address.spec.ts +203 -0
  5. package/src/common/types/batch-jobs.types.ts +1 -0
  6. package/src/common/types/common.types.spec.ts +336 -0
  7. package/src/common/types/files.types.spec.ts +154 -0
  8. package/src/common/types/issuer-payment-method.types.spec.ts +612 -0
  9. package/src/common/types/offering.types.spec.ts +91 -0
  10. package/src/common/types/phone.spec.ts +76 -0
  11. package/src/common/types/queue.types.ts +1 -0
  12. package/src/common/types/reminder-config.types.ts +40 -0
  13. package/src/common/types/site-link.types.spec.ts +134 -0
  14. package/src/common/types/trade.types.ts +2 -4
  15. package/clients/index.mjs +0 -10970
  16. package/compliance/index.mjs +0 -20016
  17. package/compliance-apikey/index.mjs +0 -9795
  18. package/helpers/index.mjs +0 -146
  19. package/investors/index.mjs +0 -12844
  20. package/issuers/index.mjs +0 -16168
  21. package/secondaries/index.mjs +0 -10282
  22. package/src/common/helpers/index.ts +0 -205
  23. package/src/contracts/compliance/account-contacts/index.ts +0 -82
  24. package/src/contracts/compliance/account-managers/index.ts +0 -142
  25. package/src/contracts/compliance/accounts/index.ts +0 -187
  26. package/src/contracts/compliance/activities/index.ts +0 -55
  27. package/src/contracts/compliance/aic/index.ts +0 -60
  28. package/src/contracts/compliance/api-keys/index.ts +0 -91
  29. package/src/contracts/compliance/assets/index.ts +0 -122
  30. package/src/contracts/compliance/auth/index.ts +0 -134
  31. package/src/contracts/compliance/batch-jobs/index.ts +0 -62
  32. package/src/contracts/compliance/bonus-tiers/index.ts +0 -55
  33. package/src/contracts/compliance/checklist/index.ts +0 -87
  34. package/src/contracts/compliance/checklist-items/index.ts +0 -86
  35. package/src/contracts/compliance/covered-persons/index.ts +0 -97
  36. package/src/contracts/compliance/dashboard/index.ts +0 -111
  37. package/src/contracts/compliance/data-records/index.ts +0 -116
  38. package/src/contracts/compliance/data-rooms/index.ts +0 -113
  39. package/src/contracts/compliance/default-theme-configs/index.ts +0 -95
  40. package/src/contracts/compliance/disbursement/index.ts +0 -165
  41. package/src/contracts/compliance/disbursement-approval-users/index.ts +0 -84
  42. package/src/contracts/compliance/disbursement-transactions/index.ts +0 -37
  43. package/src/contracts/compliance/domain-filters/index.ts +0 -117
  44. package/src/contracts/compliance/email-themes/index.ts +0 -284
  45. package/src/contracts/compliance/escrow-accounts/index.ts +0 -85
  46. package/src/contracts/compliance/exchange-api-keys/index.ts +0 -129
  47. package/src/contracts/compliance/exchange-imports/index.ts +0 -137
  48. package/src/contracts/compliance/files/index.ts +0 -267
  49. package/src/contracts/compliance/files-public/index.ts +0 -188
  50. package/src/contracts/compliance/health/index.ts +0 -26
  51. package/src/contracts/compliance/index.ts +0 -147
  52. package/src/contracts/compliance/individuals/index.ts +0 -57
  53. package/src/contracts/compliance/investor-accounts/index.ts +0 -141
  54. package/src/contracts/compliance/invites/index.ts +0 -137
  55. package/src/contracts/compliance/issuer-bank-accounts/index.ts +0 -81
  56. package/src/contracts/compliance/issuer-payment-methods/index.ts +0 -81
  57. package/src/contracts/compliance/issuers/index.ts +0 -97
  58. package/src/contracts/compliance/job-items/index.ts +0 -58
  59. package/src/contracts/compliance/jobs/index.ts +0 -59
  60. package/src/contracts/compliance/kyb/index.ts +0 -54
  61. package/src/contracts/compliance/kyc/index.ts +0 -77
  62. package/src/contracts/compliance/legal-entities/index.ts +0 -57
  63. package/src/contracts/compliance/login-histories/index.ts +0 -37
  64. package/src/contracts/compliance/notes/index.ts +0 -69
  65. package/src/contracts/compliance/notion-databases/index.ts +0 -107
  66. package/src/contracts/compliance/notion-pages/index.ts +0 -105
  67. package/src/contracts/compliance/offering-reports/index.ts +0 -149
  68. package/src/contracts/compliance/offerings/index.ts +0 -233
  69. package/src/contracts/compliance/pages/index.ts +0 -178
  70. package/src/contracts/compliance/payment-methods/index.ts +0 -57
  71. package/src/contracts/compliance/rejection-reasons/index.ts +0 -32
  72. package/src/contracts/compliance/review/index.ts +0 -169
  73. package/src/contracts/compliance/roles/index.ts +0 -34
  74. package/src/contracts/compliance/secondary-customers/index.ts +0 -77
  75. package/src/contracts/compliance/secondary-orders/index.ts +0 -60
  76. package/src/contracts/compliance/secondary-trades/index.ts +0 -100
  77. package/src/contracts/compliance/secure-requests/index.ts +0 -54
  78. package/src/contracts/compliance/signer/index.ts +0 -369
  79. package/src/contracts/compliance/site-links/index.ts +0 -128
  80. package/src/contracts/compliance/site-settings/index.ts +0 -669
  81. package/src/contracts/compliance/sites/index.ts +0 -56
  82. package/src/contracts/compliance/state-machine/index.ts +0 -94
  83. package/src/contracts/compliance/tasks/index.ts +0 -91
  84. package/src/contracts/compliance/third-parties/index.ts +0 -52
  85. package/src/contracts/compliance/trade-line-items/index.ts +0 -59
  86. package/src/contracts/compliance/trades/index.ts +0 -230
  87. package/src/contracts/compliance/transactions/index.ts +0 -161
  88. package/src/contracts/compliance/user-manuals/index.ts +0 -271
  89. package/src/contracts/compliance/user-settings/index.ts +0 -189
  90. package/src/contracts/compliance/users/index.ts +0 -200
  91. package/src/contracts/compliance/webhooks/index.ts +0 -41
  92. package/src/contracts/compliance-apikey/accounts/index.ts +0 -58
  93. package/src/contracts/compliance-apikey/index.ts +0 -14
  94. package/src/contracts/index.ts +0 -6
  95. package/src/contracts/investors/account-contacts/index.ts +0 -58
  96. package/src/contracts/investors/aic/index.ts +0 -59
  97. package/src/contracts/investors/assets/index.ts +0 -61
  98. package/src/contracts/investors/auth/index.ts +0 -116
  99. package/src/contracts/investors/bonus-tiers/index.ts +0 -37
  100. package/src/contracts/investors/cart/index.ts +0 -75
  101. package/src/contracts/investors/contact-us/index.ts +0 -48
  102. package/src/contracts/investors/data-records/index.ts +0 -113
  103. package/src/contracts/investors/data-rooms/index.ts +0 -96
  104. package/src/contracts/investors/files/index.ts +0 -167
  105. package/src/contracts/investors/files-public/index.ts +0 -185
  106. package/src/contracts/investors/index.ts +0 -72
  107. package/src/contracts/investors/individuals/index.ts +0 -99
  108. package/src/contracts/investors/investor-accounts/index.ts +0 -110
  109. package/src/contracts/investors/issuer-payment-methods/index.ts +0 -36
  110. package/src/contracts/investors/issuers/index.ts +0 -30
  111. package/src/contracts/investors/legal-entities/index.ts +0 -93
  112. package/src/contracts/investors/notes/index.ts +0 -69
  113. package/src/contracts/investors/offerings/index.ts +0 -93
  114. package/src/contracts/investors/pages/index.ts +0 -88
  115. package/src/contracts/investors/payment-methods/index.ts +0 -149
  116. package/src/contracts/investors/portfolios/index.ts +0 -53
  117. package/src/contracts/investors/sites/index.ts +0 -96
  118. package/src/contracts/investors/tasks/index.ts +0 -111
  119. package/src/contracts/investors/trade-line-items/index.ts +0 -75
  120. package/src/contracts/investors/trades/index.ts +0 -114
  121. package/src/contracts/investors/transactions/index.ts +0 -37
  122. package/src/contracts/investors/trusted-contacts/index.ts +0 -93
  123. package/src/contracts/investors/user-manuals/index.ts +0 -62
  124. package/src/contracts/investors/user-settings/index.ts +0 -170
  125. package/src/contracts/investors/users/index.ts +0 -45
  126. package/src/contracts/investors/webhooks/index.ts +0 -30
  127. package/src/contracts/issuers/account-contacts/index.ts +0 -76
  128. package/src/contracts/issuers/account-integrations/index.ts +0 -97
  129. package/src/contracts/issuers/accounts/index.ts +0 -97
  130. package/src/contracts/issuers/activities/index.ts +0 -54
  131. package/src/contracts/issuers/aic/index.ts +0 -39
  132. package/src/contracts/issuers/api-key-logs/index.ts +0 -53
  133. package/src/contracts/issuers/api-keys/index.ts +0 -93
  134. package/src/contracts/issuers/assets/index.ts +0 -122
  135. package/src/contracts/issuers/auth/index.ts +0 -152
  136. package/src/contracts/issuers/bonus-tiers/index.ts +0 -55
  137. package/src/contracts/issuers/contact-us/index.ts +0 -48
  138. package/src/contracts/issuers/covered-persons/index.ts +0 -136
  139. package/src/contracts/issuers/dashboard/index.ts +0 -72
  140. package/src/contracts/issuers/data-records/index.ts +0 -257
  141. package/src/contracts/issuers/data-rooms/index.ts +0 -134
  142. package/src/contracts/issuers/disbursement-approval-users/index.ts +0 -82
  143. package/src/contracts/issuers/disbursement-transactions/index.ts +0 -53
  144. package/src/contracts/issuers/disbursements/index.ts +0 -153
  145. package/src/contracts/issuers/email-themes/index.ts +0 -242
  146. package/src/contracts/issuers/escrow-accounts/index.ts +0 -81
  147. package/src/contracts/issuers/exchange-api-keys/index.ts +0 -144
  148. package/src/contracts/issuers/files/index.ts +0 -166
  149. package/src/contracts/issuers/files-public/index.ts +0 -166
  150. package/src/contracts/issuers/health/index.ts +0 -24
  151. package/src/contracts/issuers/index.ts +0 -112
  152. package/src/contracts/issuers/investor-accounts/index.ts +0 -148
  153. package/src/contracts/issuers/invites/index.ts +0 -129
  154. package/src/contracts/issuers/issuer/index.ts +0 -94
  155. package/src/contracts/issuers/issuer-bank-accounts/index.ts +0 -81
  156. package/src/contracts/issuers/issuer-payment-methods/index.ts +0 -136
  157. package/src/contracts/issuers/kyc/index.ts +0 -38
  158. package/src/contracts/issuers/login-histories/index.ts +0 -51
  159. package/src/contracts/issuers/notes/index.ts +0 -69
  160. package/src/contracts/issuers/offerings/index.ts +0 -206
  161. package/src/contracts/issuers/pages/index.ts +0 -138
  162. package/src/contracts/issuers/payment-methods/index.ts +0 -61
  163. package/src/contracts/issuers/portfolios/index.ts +0 -36
  164. package/src/contracts/issuers/rejection-reasons/index.ts +0 -32
  165. package/src/contracts/issuers/review/index.ts +0 -63
  166. package/src/contracts/issuers/secondary-customers/index.ts +0 -55
  167. package/src/contracts/issuers/secondary-orders/index.ts +0 -57
  168. package/src/contracts/issuers/secondary-trades/index.ts +0 -57
  169. package/src/contracts/issuers/secure-requests/index.ts +0 -34
  170. package/src/contracts/issuers/site-links/index.ts +0 -116
  171. package/src/contracts/issuers/site-settings/index.ts +0 -585
  172. package/src/contracts/issuers/sites/index.ts +0 -32
  173. package/src/contracts/issuers/tasks/index.ts +0 -111
  174. package/src/contracts/issuers/trades/index.ts +0 -132
  175. package/src/contracts/issuers/transactions/index.ts +0 -158
  176. package/src/contracts/issuers/user-manuals/index.ts +0 -62
  177. package/src/contracts/issuers/user-settings/index.ts +0 -170
  178. package/src/contracts/issuers/users/index.ts +0 -126
  179. package/src/contracts/secondaries/accounts/index.ts +0 -58
  180. package/src/contracts/secondaries/index.ts +0 -23
  181. package/src/contracts/secondaries/secondary-customers/index.ts +0 -55
  182. package/src/contracts/secondaries/secondary-issuers/index.ts +0 -94
  183. package/src/contracts/secondaries/secondary-orders/index.ts +0 -56
  184. package/src/contracts/secondaries/secondary-securities/index.ts +0 -95
  185. package/src/contracts/secondaries/secondary-trades/index.ts +0 -56
  186. package/types/index.mjs +0 -10320
@@ -1,26 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import { InternalError } from '../../../common/types';
3
- import {
4
- HealthCheckResponseSchema,
5
- HealthErrorSchema,
6
- } from '../../../common/types/health.types';
7
-
8
- const c = initContract();
9
-
10
- export const healthContract = c.router(
11
- {
12
- getHealth: {
13
- summary: 'Health Check',
14
- method: 'GET',
15
- path: '',
16
- responses: {
17
- 200: HealthCheckResponseSchema,
18
- 500: InternalError,
19
- 503: HealthErrorSchema,
20
- },
21
- },
22
- },
23
- {
24
- pathPrefix: 'health/',
25
- },
26
- );
@@ -1,147 +0,0 @@
1
- import { accountsContract } from './accounts';
2
- import { accountContactsContract } from './account-contacts';
3
- import { accountManagersContract } from './account-managers';
4
- import { activitiesContract } from './activities';
5
- import { apiKeysContract } from './api-keys';
6
- import { assetsContract } from './assets';
7
- import { authContract } from './auth';
8
- import { checkListContract } from './checklist';
9
- import { checkListItemsContract } from './checklist-items';
10
- import { coveredPersonsContract } from './covered-persons';
11
- import { dashboardContract } from './dashboard';
12
- import { dataRecordsContract } from './data-records';
13
- import { dataRoomsContract } from './data-rooms';
14
- import { disbursementApprovalUsersContract } from './disbursement-approval-users';
15
- import { disbursementContract } from './disbursement';
16
- import { disbursementTransactionsContract } from './disbursement-transactions';
17
- import { emailThemesContract } from './email-themes';
18
- import { escrowAccountsContract } from './escrow-accounts';
19
- import { filesContract } from './files';
20
- import { filesPublicContract } from './files-public';
21
- import { individualsContract } from './individuals';
22
- import { initContract } from '@ts-rest/core';
23
- import { investorAccountsContract } from './investor-accounts';
24
- import { invitesContract } from './invites';
25
- import { issuerBankAccountsContract } from './issuer-bank-accounts';
26
- import { issuerPaymentMethodsContract } from './issuer-payment-methods';
27
- import { issuersContract } from './issuers';
28
- import { jobsContract } from './jobs';
29
- import { kybsContract } from './kyb';
30
- import { kycsContract } from './kyc';
31
- import { legalEntitiesContract } from './legal-entities';
32
- import { loginHistoriesContract } from './login-histories';
33
- import { notesContract } from './notes';
34
- import { offeringsContract } from './offerings';
35
- import { pagesContract } from './pages';
36
- import { paymentMethodsContract } from './payment-methods';
37
- import { rejectionReasonsContract } from './rejection-reasons';
38
- import { reviewContract } from './review';
39
- import { rolesContract } from './roles';
40
- import { secureRequestContract } from './secure-requests';
41
- import { siteLinksContract } from './site-links';
42
- import { sitesContract } from './sites';
43
- import { siteSettingsContract } from './site-settings';
44
- import { tasksContract } from './tasks';
45
- import { thirdPartiesContract } from './third-parties';
46
- import { tradeLineItemsContract } from './trade-line-items';
47
- import { tradesContract } from './trades';
48
- import { transactionsContract } from './transactions';
49
- import { userManualsContract } from './user-manuals';
50
- import { usersContract } from './users';
51
- import { userSettingsContract } from './user-settings';
52
- import { webhooksContract } from './webhooks';
53
- import { domainFiltersContract } from './domain-filters';
54
- import { healthContract } from './health';
55
- import { signerContract } from './signer';
56
- import { secondaryCustomersContract } from './secondary-customers';
57
- import { secondaryOrdersContract } from './secondary-orders';
58
- import { batchJobsContract } from './batch-jobs';
59
- import { jobItemsContract } from './job-items';
60
- import { exchangeImportsContract } from './exchange-imports';
61
- import { secondaryTradesContract } from './secondary-trades';
62
- import { exchangeApiKeysContract } from './exchange-api-keys';
63
- import { notionDatabasesContract } from './notion-databases';
64
- import { notionPagesContract } from './notion-pages';
65
- import { defaultThemeConfigsContract } from './default-theme-configs';
66
- import { aicContract } from './aic';
67
- import { stateMachineContract } from './state-machine';
68
- import { offeringReportsContract } from './offering-reports';
69
- import { bonusTiersContract } from './bonus-tiers';
70
-
71
- const c = initContract();
72
-
73
- export const complianceContract = c.router(
74
- {
75
- accounts: accountsContract,
76
- accountContacts: accountContactsContract,
77
- accountManagers: accountManagersContract,
78
- activities: activitiesContract,
79
- apiKeys: apiKeysContract,
80
- assets: assetsContract,
81
- auth: authContract,
82
- aic: aicContract,
83
- batchJobs: batchJobsContract,
84
- bonusTiers: bonusTiersContract,
85
- checklist: checkListContract,
86
- checklistItems: checkListItemsContract,
87
- coveredPersons: coveredPersonsContract,
88
- dashboard: dashboardContract,
89
- dataRecords: dataRecordsContract,
90
- dataRooms: dataRoomsContract,
91
- defaultThemeConfigs: defaultThemeConfigsContract,
92
- disbursementApprovalUsers: disbursementApprovalUsersContract,
93
- disbursements: disbursementContract,
94
- disbursementTransactions: disbursementTransactionsContract,
95
- domainFilters: domainFiltersContract,
96
- emailThemes: emailThemesContract,
97
- escrowAccounts: escrowAccountsContract,
98
- exchangeApiKeys: exchangeApiKeysContract,
99
- exchangeImports: exchangeImportsContract,
100
- files: filesContract,
101
- filesPublic: filesPublicContract,
102
- health: healthContract,
103
- individuals: individualsContract,
104
- investorAccounts: investorAccountsContract,
105
- invites: invitesContract,
106
- issuerBankAccounts: issuerBankAccountsContract,
107
- issuerPaymentMethods: issuerPaymentMethodsContract,
108
- issuers: issuersContract,
109
- jobs: jobsContract,
110
- kybs: kybsContract,
111
- kycs: kycsContract,
112
- legalEntities: legalEntitiesContract,
113
- loginHistories: loginHistoriesContract,
114
- notes: notesContract,
115
- offerings: offeringsContract,
116
- pages: pagesContract,
117
- paymentMethods: paymentMethodsContract,
118
- review: reviewContract,
119
- roles: rolesContract,
120
- rejectionReasons: rejectionReasonsContract,
121
- secondaryCustomers: secondaryCustomersContract,
122
- secondaryOrders: secondaryOrdersContract,
123
- secondaryTrades: secondaryTradesContract,
124
- secureRequests: secureRequestContract,
125
- stateMachine: stateMachineContract,
126
- signer: signerContract,
127
- siteLinks: siteLinksContract,
128
- sites: sitesContract,
129
- siteSettings: siteSettingsContract,
130
- tasks: tasksContract,
131
- thirdParties: thirdPartiesContract,
132
- trades: tradesContract,
133
- transactions: transactionsContract,
134
- tradeLineItems: tradeLineItemsContract,
135
- userManuals: userManualsContract,
136
- users: usersContract,
137
- userSettings: userSettingsContract,
138
- webhooks: webhooksContract,
139
- jobItems: jobItemsContract,
140
- notionDatabases: notionDatabasesContract,
141
- notionPages: notionPagesContract,
142
- offeringReports: offeringReportsContract,
143
- },
144
- {
145
- pathPrefix: '/compliance/api/v1/',
146
- },
147
- );
@@ -1,57 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import {
3
- ForbiddenError,
4
- IPaginatedIndividual,
5
- NotFoundError,
6
- PaginationOptionsZod,
7
- UnauthorizedError,
8
- ComplianceIndividualFiltersZod,
9
- IndividualsIncludeQuery,
10
- IIndividualZod,
11
- individualIdSchema,
12
- } from '../../../common/types';
13
- import { z } from 'zod';
14
-
15
- const c = initContract();
16
-
17
- export const individualsContract = c.router(
18
- {
19
- getIndividual: {
20
- summary: 'Get individual by id',
21
- method: 'GET',
22
- path: '/:id',
23
- metadata: {
24
- auth: true,
25
- },
26
- query: z.object({}).merge(IndividualsIncludeQuery),
27
- pathParams: z.object({
28
- id: individualIdSchema,
29
- }),
30
- responses: {
31
- 200: IIndividualZod,
32
- 401: UnauthorizedError,
33
- 403: ForbiddenError,
34
- 404: NotFoundError,
35
- },
36
- },
37
- getIndividuals: {
38
- summary: 'Get individuals',
39
- method: 'GET',
40
- path: '',
41
- metadata: {
42
- auth: true,
43
- },
44
- query: PaginationOptionsZod.merge(ComplianceIndividualFiltersZod).merge(
45
- IndividualsIncludeQuery,
46
- ),
47
- responses: {
48
- 200: IPaginatedIndividual,
49
- 401: UnauthorizedError,
50
- 403: ForbiddenError,
51
- },
52
- },
53
- },
54
- {
55
- pathPrefix: 'individuals',
56
- },
57
- );
@@ -1,141 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import {
3
- accountIdSchema,
4
- BadRequestError,
5
- ForbiddenError,
6
- InternalError,
7
- NotFoundError,
8
- PaginationOptionsZod,
9
- tradeIdSchema,
10
- UnauthorizedError,
11
- } from '../../../common/types';
12
- import { z } from 'zod';
13
- import {
14
- ExportInvestorAccountsResponse,
15
- IInvestorAccount,
16
- IInvestorAccountSummary,
17
- investorAccountIdSchema,
18
- InvestorAccountsFiltersZod,
19
- InvestorAccountsIncludeQuery,
20
- InvestorAccountsSortZod,
21
- IPaginatedInvestorAccounts,
22
- IPaginatedRegisteredInvestorUserZod,
23
- RegisteredInvestorUserFiltersZod,
24
- SeedInvestorAccountsForDemoUsersZod,
25
- } from '../../../common/types/investor-account.types';
26
-
27
- const c = initContract();
28
-
29
- export const investorAccountsContract = c.router(
30
- {
31
- getRegisteredInvestorUsers: {
32
- summary: 'Get registered investor users',
33
- method: 'GET',
34
- path: '/registered-users/:accountId',
35
- metadata: {
36
- auth: true,
37
- },
38
- pathParams: z.object({
39
- accountId: accountIdSchema,
40
- }),
41
- query: PaginationOptionsZod.merge(RegisteredInvestorUserFiltersZod),
42
- responses: {
43
- 200: IPaginatedRegisteredInvestorUserZod,
44
- 401: UnauthorizedError,
45
- 403: ForbiddenError,
46
- 500: InternalError,
47
- },
48
- },
49
- getInvestorAccount: {
50
- summary: 'Get investor account by id',
51
- method: 'GET',
52
- path: '/:id',
53
- metadata: {
54
- auth: true,
55
- },
56
- query: z.object({}).merge(InvestorAccountsIncludeQuery),
57
- pathParams: z.object({
58
- id: investorAccountIdSchema,
59
- }),
60
- responses: {
61
- 200: IInvestorAccount,
62
- 401: UnauthorizedError,
63
- 403: ForbiddenError,
64
- 404: NotFoundError,
65
- },
66
- },
67
- getInvestorAccounts: {
68
- summary: 'Get investor accounts',
69
- method: 'GET',
70
- path: '',
71
- metadata: {
72
- auth: true,
73
- },
74
- query: PaginationOptionsZod.merge(InvestorAccountsFiltersZod).merge(
75
- InvestorAccountsSortZod,
76
- ),
77
- responses: {
78
- 200: IPaginatedInvestorAccounts,
79
- 401: UnauthorizedError,
80
- 403: ForbiddenError,
81
- },
82
- },
83
- getInvestorAccountSummary: {
84
- summary: 'Get investor account summary',
85
- method: 'GET',
86
- path: '/:id/summary',
87
- metadata: {
88
- auth: true,
89
- },
90
- pathParams: z.object({
91
- id: investorAccountIdSchema,
92
- }),
93
- query: z.object({
94
- tradeId: tradeIdSchema.optional(),
95
- }),
96
- responses: {
97
- 200: IInvestorAccountSummary,
98
- 401: UnauthorizedError,
99
- 403: ForbiddenError,
100
- 404: NotFoundError,
101
- },
102
- },
103
- seedInvestorAccountsForDemoUsers: {
104
- summary: '[Admin] Seed investor accounts for demo users',
105
- method: 'POST',
106
- path: '/seed',
107
- metadata: {
108
- auth: true,
109
- },
110
- body: SeedInvestorAccountsForDemoUsersZod,
111
- responses: {
112
- 200: ExportInvestorAccountsResponse,
113
- 400: BadRequestError,
114
- 401: UnauthorizedError,
115
- 403: ForbiddenError,
116
- 404: NotFoundError,
117
- 500: InternalError,
118
- },
119
- },
120
- seedInvestorAccountsForAllDemoUsers: {
121
- summary: '[Admin] Seed investor accounts for all demo users',
122
- method: 'POST',
123
- path: '/seed-all',
124
- metadata: {
125
- auth: true,
126
- },
127
- body: z.object({}),
128
- responses: {
129
- 200: ExportInvestorAccountsResponse,
130
- 400: BadRequestError,
131
- 401: UnauthorizedError,
132
- 403: ForbiddenError,
133
- 404: NotFoundError,
134
- 500: InternalError,
135
- },
136
- },
137
- },
138
- {
139
- pathPrefix: 'investor-accounts',
140
- },
141
- );
@@ -1,137 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import {
3
- BadRequestError,
4
- ForbiddenError,
5
- InternalError,
6
- inviteIdSchema,
7
- InviteWithoutSecretZod,
8
- InviteWithUrl,
9
- IPaginatedInvite,
10
- NotFoundError,
11
- PaginationOptionsZod,
12
- PatchInviteForComplianceZod,
13
- PortalType,
14
- UnauthorizedError,
15
- UserRole,
16
- } from '../../../common/types';
17
- import { z } from 'zod';
18
-
19
- const c = initContract();
20
-
21
- export const invitesContract = c.router(
22
- {
23
- getInvites: {
24
- summary: '[ADMIN] Get invites',
25
- method: 'GET',
26
- path: '',
27
- metadata: {
28
- auth: true,
29
- },
30
- query: PaginationOptionsZod,
31
- responses: {
32
- 200: IPaginatedInvite,
33
- 400: BadRequestError,
34
- 401: UnauthorizedError,
35
- 403: ForbiddenError,
36
- },
37
- },
38
- postInvite: {
39
- summary: '[ADMIN] Invite user',
40
- method: 'POST',
41
- path: '',
42
- metadata: {
43
- auth: true,
44
- },
45
- body: z.object({
46
- email: z.string().email(),
47
- role: z.nativeEnum(UserRole),
48
- accountId: z.string().optional(),
49
- portalType: z.nativeEnum(PortalType).optional(),
50
- }),
51
- responses: {
52
- 201: InviteWithUrl,
53
- 400: BadRequestError,
54
- 401: UnauthorizedError,
55
- 403: ForbiddenError,
56
- },
57
- },
58
- postInviteForCompliance: {
59
- summary: '[ADMIN] Invite user for Compliance',
60
- method: 'POST',
61
- path: '/compliance',
62
- metadata: {
63
- auth: true,
64
- },
65
- body: z.object({
66
- email: z.string().email(),
67
- role: z.nativeEnum(UserRole),
68
- }),
69
- responses: {
70
- 201: InviteWithUrl,
71
- 400: BadRequestError,
72
- 401: UnauthorizedError,
73
- 403: ForbiddenError,
74
- 500: InternalError,
75
- },
76
- },
77
- verifyInvite: {
78
- summary: 'Verify invite',
79
- method: 'GET',
80
- path: '/verify/:code',
81
- pathParams: z.object({
82
- code: z.string(),
83
- }),
84
- responses: {
85
- 200: z.object({
86
- valid: z.boolean(),
87
- email: z.string().email().nullable(),
88
- }),
89
- 400: BadRequestError,
90
- },
91
- },
92
- patchInviteRole: {
93
- summary: 'Patch invite role',
94
- method: 'PATCH',
95
- path: '/:id/role',
96
- pathParams: z.object({
97
- id: inviteIdSchema,
98
- }),
99
- metadata: {
100
- auth: true,
101
- },
102
- body: PatchInviteForComplianceZod,
103
- responses: {
104
- 201: InviteWithoutSecretZod,
105
- 400: BadRequestError,
106
- 401: UnauthorizedError,
107
- 403: ForbiddenError,
108
- 404: NotFoundError,
109
- 500: InternalError,
110
- },
111
- },
112
- deleteInvite: {
113
- summary: 'Delete invite by id',
114
- method: 'DELETE',
115
- path: '/:id',
116
- metadata: {
117
- auth: true,
118
- },
119
- pathParams: z.object({
120
- id: inviteIdSchema,
121
- }),
122
- responses: {
123
- 200: z.object({
124
- message: z.string(),
125
- }),
126
- 400: BadRequestError,
127
- 401: UnauthorizedError,
128
- 403: ForbiddenError,
129
- 404: NotFoundError,
130
- 500: InternalError,
131
- },
132
- },
133
- },
134
- {
135
- pathPrefix: 'invites',
136
- },
137
- );
@@ -1,81 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import {
3
- ForbiddenError,
4
- InternalError,
5
- NotFoundError,
6
- UnauthorizedError,
7
- PaginationOptionsZod,
8
- BadRequestError,
9
- } from '../../../common/types';
10
- import {
11
- IIssuerBankAccount,
12
- IPaginatedIssuerBankAccount,
13
- issuerBankAccountIdSchema,
14
- IssuerBankAccountsFilter,
15
- IssuerBankAccountsIncludeQuery,
16
- PatchIssuerBankAccount,
17
- PostIssuerBankAccount,
18
- } from '../../../common/types/issuer-bank-account.types';
19
- import { z } from 'zod';
20
-
21
- const c = initContract();
22
-
23
- export const issuerBankAccountsContract = c.router(
24
- {
25
- getIssuerBankAccounts: {
26
- summary: 'Get issuer bank accounts',
27
- method: 'GET',
28
- path: '',
29
- metadata: {
30
- auth: true,
31
- },
32
- query: PaginationOptionsZod.merge(IssuerBankAccountsFilter).merge(
33
- IssuerBankAccountsIncludeQuery,
34
- ),
35
- responses: {
36
- 200: IPaginatedIssuerBankAccount,
37
- 401: UnauthorizedError,
38
- 403: ForbiddenError,
39
- 404: NotFoundError,
40
- 500: InternalError,
41
- },
42
- },
43
- postIssuerBankAccount: {
44
- summary: 'Create an issuer bank account',
45
- method: 'POST',
46
- path: '',
47
- metadata: {
48
- auth: true,
49
- },
50
- body: PostIssuerBankAccount,
51
- responses: {
52
- 201: IIssuerBankAccount,
53
- 400: BadRequestError,
54
- 401: UnauthorizedError,
55
- 404: NotFoundError,
56
- 500: InternalError,
57
- },
58
- },
59
- patchIssuerBankAccount: {
60
- summary: 'Update issuer bank account',
61
- method: 'PATCH',
62
- path: '/:id',
63
- metadata: {
64
- auth: true,
65
- },
66
- pathParams: z.object({ id: issuerBankAccountIdSchema }),
67
- body: PatchIssuerBankAccount,
68
- responses: {
69
- 201: IIssuerBankAccount,
70
- 400: BadRequestError,
71
- 401: UnauthorizedError,
72
- 403: ForbiddenError,
73
- 404: NotFoundError,
74
- 500: InternalError,
75
- },
76
- },
77
- },
78
- {
79
- pathPrefix: 'issuer-bank-accounts',
80
- },
81
- );
@@ -1,81 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import {
3
- ForbiddenError,
4
- InternalError,
5
- NotFoundError,
6
- UnauthorizedError,
7
- ComplianceGetIssuerPaymentMethodZod,
8
- IIssuerPaymentMethod,
9
- IPaginatedIssuerPaymentMethod,
10
- issuerPaymentMethodIdSchema,
11
- PaginationOptionsZod,
12
- accountIdSchema,
13
- CompliancePatchIssuerPaymentMethodZod,
14
- } from '../../../common/types';
15
- import { z } from 'zod';
16
-
17
- const c = initContract();
18
-
19
- export const issuerPaymentMethodsContract = c.router(
20
- {
21
- getIssuerPaymentMethods: {
22
- summary: 'get payment methods',
23
- method: 'GET',
24
- path: '',
25
- metadata: {
26
- auth: true,
27
- },
28
- query: PaginationOptionsZod.merge(ComplianceGetIssuerPaymentMethodZod),
29
- responses: {
30
- 200: IPaginatedIssuerPaymentMethod,
31
- 401: UnauthorizedError,
32
- 403: ForbiddenError,
33
- 404: NotFoundError,
34
- 500: InternalError,
35
- },
36
- },
37
- patchIssuerPaymentMethod: {
38
- summary: 'PATCH issuer payment method for compliance',
39
- method: 'PATCH',
40
- path: '/:id',
41
- pathParams: z.object({
42
- id: issuerPaymentMethodIdSchema,
43
- }),
44
- metadata: {
45
- auth: true,
46
- },
47
- body: CompliancePatchIssuerPaymentMethodZod,
48
- responses: {
49
- 201: IIssuerPaymentMethod,
50
- 401: UnauthorizedError,
51
- 403: ForbiddenError,
52
- 404: NotFoundError,
53
- 500: InternalError,
54
- },
55
- },
56
- toggleIssuerPaymentMethod: {
57
- summary: 'Toggle issuer payment method',
58
- method: 'PATCH',
59
- path: '/:id/toggle',
60
- metadata: {
61
- auth: true,
62
- },
63
- pathParams: z.object({
64
- id: issuerPaymentMethodIdSchema,
65
- }),
66
- body: z.object({
67
- enabled: z.boolean(),
68
- accountId: accountIdSchema,
69
- }),
70
- responses: {
71
- 200: IIssuerPaymentMethod,
72
- 401: UnauthorizedError,
73
- 403: ForbiddenError,
74
- 404: NotFoundError,
75
- },
76
- },
77
- },
78
- {
79
- pathPrefix: 'issuer-payment-methods',
80
- },
81
- );