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

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 (176) hide show
  1. package/README.md +23 -19
  2. package/common/types/account.types.ts +1 -0
  3. package/common/types/comply-advantage-api.types.ts +3 -3
  4. package/common/types/mail-template.types.ts +34 -0
  5. package/common/types/notification.types.ts +10 -0
  6. package/common/types/trade.types.ts +2 -0
  7. package/common/types/webhook.types.ts +142 -0
  8. package/index.ts +10 -0
  9. package/package.json +23 -32
  10. package/contracts/compliance/account-contacts/index.ts +0 -82
  11. package/contracts/compliance/account-managers/index.ts +0 -142
  12. package/contracts/compliance/account-settings/index.ts +0 -59
  13. package/contracts/compliance/accounts/index.ts +0 -187
  14. package/contracts/compliance/activities/index.ts +0 -55
  15. package/contracts/compliance/aic/index.ts +0 -60
  16. package/contracts/compliance/api-keys/index.ts +0 -91
  17. package/contracts/compliance/assets/index.ts +0 -122
  18. package/contracts/compliance/auth/index.ts +0 -135
  19. package/contracts/compliance/batch-jobs/index.ts +0 -62
  20. package/contracts/compliance/bonus-tiers/index.ts +0 -74
  21. package/contracts/compliance/checklist/index.ts +0 -87
  22. package/contracts/compliance/checklist-items/index.ts +0 -86
  23. package/contracts/compliance/covered-persons/index.ts +0 -97
  24. package/contracts/compliance/dashboard/index.ts +0 -111
  25. package/contracts/compliance/data-records/index.ts +0 -116
  26. package/contracts/compliance/data-rooms/index.ts +0 -113
  27. package/contracts/compliance/default-theme-configs/index.ts +0 -95
  28. package/contracts/compliance/disbursement/index.ts +0 -165
  29. package/contracts/compliance/disbursement-approval-users/index.ts +0 -84
  30. package/contracts/compliance/disbursement-transactions/index.ts +0 -37
  31. package/contracts/compliance/domain-filters/index.ts +0 -117
  32. package/contracts/compliance/email-themes/index.ts +0 -284
  33. package/contracts/compliance/escrow-accounts/index.ts +0 -85
  34. package/contracts/compliance/exchange-api-keys/index.ts +0 -129
  35. package/contracts/compliance/exchange-imports/index.ts +0 -137
  36. package/contracts/compliance/files/index.ts +0 -267
  37. package/contracts/compliance/files-public/index.ts +0 -188
  38. package/contracts/compliance/health/index.ts +0 -26
  39. package/contracts/compliance/index.ts +0 -151
  40. package/contracts/compliance/individuals/index.ts +0 -57
  41. package/contracts/compliance/investor-accounts/index.ts +0 -141
  42. package/contracts/compliance/invites/index.ts +0 -129
  43. package/contracts/compliance/issuer-bank-accounts/index.ts +0 -81
  44. package/contracts/compliance/issuer-payment-methods/index.ts +0 -81
  45. package/contracts/compliance/issuers/index.ts +0 -97
  46. package/contracts/compliance/job-items/index.ts +0 -58
  47. package/contracts/compliance/jobs/index.ts +0 -59
  48. package/contracts/compliance/kyb/index.ts +0 -54
  49. package/contracts/compliance/kyc/index.ts +0 -77
  50. package/contracts/compliance/legal-entities/index.ts +0 -57
  51. package/contracts/compliance/login-histories/index.ts +0 -37
  52. package/contracts/compliance/notes/index.ts +0 -69
  53. package/contracts/compliance/notification-channels/index.ts +0 -251
  54. package/contracts/compliance/notion-databases/index.ts +0 -107
  55. package/contracts/compliance/notion-pages/index.ts +0 -105
  56. package/contracts/compliance/offering-reports/index.ts +0 -149
  57. package/contracts/compliance/offerings/index.ts +0 -233
  58. package/contracts/compliance/pages/index.ts +0 -178
  59. package/contracts/compliance/payment-methods/index.ts +0 -57
  60. package/contracts/compliance/rejection-reasons/index.ts +0 -32
  61. package/contracts/compliance/review/index.ts +0 -169
  62. package/contracts/compliance/roles/index.ts +0 -34
  63. package/contracts/compliance/secondary-customers/index.ts +0 -77
  64. package/contracts/compliance/secondary-orders/index.ts +0 -60
  65. package/contracts/compliance/secondary-trades/index.ts +0 -100
  66. package/contracts/compliance/secure-requests/index.ts +0 -54
  67. package/contracts/compliance/signer/index.ts +0 -369
  68. package/contracts/compliance/site-links/index.ts +0 -128
  69. package/contracts/compliance/site-settings/index.ts +0 -669
  70. package/contracts/compliance/sites/index.ts +0 -56
  71. package/contracts/compliance/state-machine/index.ts +0 -94
  72. package/contracts/compliance/tasks/index.ts +0 -91
  73. package/contracts/compliance/third-parties/index.ts +0 -52
  74. package/contracts/compliance/trade-line-items/index.ts +0 -59
  75. package/contracts/compliance/trades/index.ts +0 -249
  76. package/contracts/compliance/transactions/index.ts +0 -161
  77. package/contracts/compliance/user-manuals/index.ts +0 -271
  78. package/contracts/compliance/user-settings/index.ts +0 -189
  79. package/contracts/compliance/users/index.ts +0 -221
  80. package/contracts/compliance/webhooks/index.ts +0 -41
  81. package/contracts/compliance-apikey/accounts/index.ts +0 -58
  82. package/contracts/compliance-apikey/index.ts +0 -14
  83. package/contracts/index.ts +0 -6
  84. package/contracts/investors/account-contacts/index.ts +0 -58
  85. package/contracts/investors/aic/index.ts +0 -59
  86. package/contracts/investors/assets/index.ts +0 -61
  87. package/contracts/investors/auth/index.ts +0 -116
  88. package/contracts/investors/bonus-tiers/index.ts +0 -55
  89. package/contracts/investors/cart/index.ts +0 -75
  90. package/contracts/investors/contact-us/index.ts +0 -48
  91. package/contracts/investors/data-records/index.ts +0 -113
  92. package/contracts/investors/data-rooms/index.ts +0 -96
  93. package/contracts/investors/files/index.ts +0 -167
  94. package/contracts/investors/files-public/index.ts +0 -185
  95. package/contracts/investors/index.ts +0 -72
  96. package/contracts/investors/individuals/index.ts +0 -121
  97. package/contracts/investors/investor-accounts/index.ts +0 -110
  98. package/contracts/investors/issuer-payment-methods/index.ts +0 -36
  99. package/contracts/investors/issuers/index.ts +0 -30
  100. package/contracts/investors/legal-entities/index.ts +0 -93
  101. package/contracts/investors/notes/index.ts +0 -69
  102. package/contracts/investors/offerings/index.ts +0 -93
  103. package/contracts/investors/pages/index.ts +0 -88
  104. package/contracts/investors/payment-methods/index.ts +0 -149
  105. package/contracts/investors/portfolios/index.ts +0 -53
  106. package/contracts/investors/sites/index.ts +0 -96
  107. package/contracts/investors/tasks/index.ts +0 -111
  108. package/contracts/investors/trade-line-items/index.ts +0 -75
  109. package/contracts/investors/trades/index.ts +0 -114
  110. package/contracts/investors/transactions/index.ts +0 -37
  111. package/contracts/investors/trusted-contacts/index.ts +0 -93
  112. package/contracts/investors/user-manuals/index.ts +0 -62
  113. package/contracts/investors/user-settings/index.ts +0 -170
  114. package/contracts/investors/users/index.ts +0 -45
  115. package/contracts/investors/webhooks/index.ts +0 -30
  116. package/contracts/issuers/account-contacts/index.ts +0 -76
  117. package/contracts/issuers/account-integrations/index.ts +0 -97
  118. package/contracts/issuers/account-settings/index.ts +0 -36
  119. package/contracts/issuers/accounts/index.ts +0 -97
  120. package/contracts/issuers/activities/index.ts +0 -54
  121. package/contracts/issuers/aic/index.ts +0 -39
  122. package/contracts/issuers/api-key-logs/index.ts +0 -53
  123. package/contracts/issuers/api-keys/index.ts +0 -93
  124. package/contracts/issuers/assets/index.ts +0 -122
  125. package/contracts/issuers/auth/index.ts +0 -153
  126. package/contracts/issuers/bonus-tiers/index.ts +0 -73
  127. package/contracts/issuers/contact-us/index.ts +0 -48
  128. package/contracts/issuers/covered-persons/index.ts +0 -136
  129. package/contracts/issuers/dashboard/index.ts +0 -72
  130. package/contracts/issuers/data-records/index.ts +0 -257
  131. package/contracts/issuers/data-rooms/index.ts +0 -134
  132. package/contracts/issuers/disbursement-approval-users/index.ts +0 -82
  133. package/contracts/issuers/disbursement-transactions/index.ts +0 -53
  134. package/contracts/issuers/disbursements/index.ts +0 -189
  135. package/contracts/issuers/email-themes/index.ts +0 -242
  136. package/contracts/issuers/escrow-accounts/index.ts +0 -81
  137. package/contracts/issuers/exchange-api-keys/index.ts +0 -144
  138. package/contracts/issuers/files/index.ts +0 -166
  139. package/contracts/issuers/files-public/index.ts +0 -166
  140. package/contracts/issuers/health/index.ts +0 -24
  141. package/contracts/issuers/index.ts +0 -116
  142. package/contracts/issuers/investor-accounts/index.ts +0 -148
  143. package/contracts/issuers/invites/index.ts +0 -129
  144. package/contracts/issuers/issuer/index.ts +0 -94
  145. package/contracts/issuers/issuer-bank-accounts/index.ts +0 -81
  146. package/contracts/issuers/issuer-payment-methods/index.ts +0 -136
  147. package/contracts/issuers/kyc/index.ts +0 -38
  148. package/contracts/issuers/login-histories/index.ts +0 -51
  149. package/contracts/issuers/notes/index.ts +0 -69
  150. package/contracts/issuers/notification-channels/index.ts +0 -251
  151. package/contracts/issuers/offerings/index.ts +0 -206
  152. package/contracts/issuers/pages/index.ts +0 -138
  153. package/contracts/issuers/payment-methods/index.ts +0 -61
  154. package/contracts/issuers/portfolios/index.ts +0 -36
  155. package/contracts/issuers/rejection-reasons/index.ts +0 -32
  156. package/contracts/issuers/review/index.ts +0 -63
  157. package/contracts/issuers/secondary-customers/index.ts +0 -55
  158. package/contracts/issuers/secondary-orders/index.ts +0 -57
  159. package/contracts/issuers/secondary-trades/index.ts +0 -57
  160. package/contracts/issuers/secure-requests/index.ts +0 -34
  161. package/contracts/issuers/site-links/index.ts +0 -116
  162. package/contracts/issuers/site-settings/index.ts +0 -585
  163. package/contracts/issuers/sites/index.ts +0 -32
  164. package/contracts/issuers/tasks/index.ts +0 -111
  165. package/contracts/issuers/trades/index.ts +0 -132
  166. package/contracts/issuers/transactions/index.ts +0 -158
  167. package/contracts/issuers/user-manuals/index.ts +0 -62
  168. package/contracts/issuers/user-settings/index.ts +0 -170
  169. package/contracts/issuers/users/index.ts +0 -126
  170. package/contracts/secondaries/accounts/index.ts +0 -58
  171. package/contracts/secondaries/index.ts +0 -23
  172. package/contracts/secondaries/secondary-customers/index.ts +0 -55
  173. package/contracts/secondaries/secondary-issuers/index.ts +0 -94
  174. package/contracts/secondaries/secondary-orders/index.ts +0 -56
  175. package/contracts/secondaries/secondary-securities/index.ts +0 -95
  176. package/contracts/secondaries/secondary-trades/index.ts +0 -56
@@ -1,62 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import {
3
- ForbiddenError,
4
- NotFoundError,
5
- PaginationOptionsZod,
6
- UnauthorizedError,
7
- InternalError,
8
- } from '../../../common/types';
9
- import { z } from 'zod';
10
- import {
11
- BatchJobFiltersZod,
12
- batchJobIdSchema,
13
- BatchJobsIncludeQuery,
14
- BatchJobZod,
15
- IPaginatedBatchJob,
16
- } from '../../../common/types/batch-jobs.types';
17
-
18
- const c = initContract();
19
-
20
- export const batchJobsContract = c.router(
21
- {
22
- getBatchJob: {
23
- summary: 'Get batch job by id',
24
- method: 'GET',
25
- path: '/:id',
26
- metadata: {
27
- auth: true,
28
- },
29
- query: z.object({}).merge(BatchJobsIncludeQuery),
30
- pathParams: z.object({
31
- id: batchJobIdSchema,
32
- }),
33
- responses: {
34
- 200: BatchJobZod,
35
- 401: UnauthorizedError,
36
- 403: ForbiddenError,
37
- 404: NotFoundError,
38
- 500: InternalError,
39
- },
40
- },
41
- getBatchJobs: {
42
- summary: 'Get batch jobs',
43
- method: 'GET',
44
- path: '',
45
- metadata: {
46
- auth: true,
47
- },
48
- query: PaginationOptionsZod.merge(BatchJobFiltersZod).merge(
49
- BatchJobsIncludeQuery,
50
- ),
51
- responses: {
52
- 200: IPaginatedBatchJob,
53
- 401: UnauthorizedError,
54
- 403: ForbiddenError,
55
- 500: InternalError,
56
- },
57
- },
58
- },
59
- {
60
- pathPrefix: 'batch-jobs',
61
- },
62
- );
@@ -1,74 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import {
3
- BadRequestError,
4
- ForbiddenError,
5
- InternalError,
6
- UnauthorizedError,
7
- } from '../../../common/types';
8
- import {
9
- ComplianceEstimateBonusTierCalculationZod,
10
- CompliancePostBonusTierZod,
11
- EstimateBonusTierCalculationResponseZod,
12
- IBonusTierList,
13
- PurchaseCalculationResponseZod,
14
- PurchaseCalculationZod,
15
- } from '../../../common/types/bonus-tier.types';
16
-
17
- const c = initContract();
18
-
19
- export const bonusTiersContract = c.router(
20
- {
21
- estimateCalculation: {
22
- summary: 'Estimate bonus tier calculation',
23
- method: 'POST',
24
- path: '/estimate-calculation',
25
- metadata: {
26
- auth: true,
27
- },
28
- body: ComplianceEstimateBonusTierCalculationZod,
29
- responses: {
30
- 200: EstimateBonusTierCalculationResponseZod,
31
- 400: BadRequestError,
32
- 401: UnauthorizedError,
33
- 403: ForbiddenError,
34
- 500: InternalError,
35
- },
36
- },
37
- purchaseCalculation: {
38
- summary:
39
- '[ADMIN] Calculate the bonus shares that would be awarded for a trade',
40
- method: 'POST',
41
- path: '/purchase-calculation',
42
- metadata: {
43
- auth: true,
44
- },
45
- body: PurchaseCalculationZod,
46
- responses: {
47
- 200: PurchaseCalculationResponseZod,
48
- 400: BadRequestError,
49
- 401: UnauthorizedError,
50
- 403: ForbiddenError,
51
- 500: InternalError,
52
- },
53
- },
54
- postBonusTier: {
55
- summary: 'Create a new bonus tier',
56
- method: 'POST',
57
- path: '/',
58
- metadata: {
59
- auth: true,
60
- },
61
- body: CompliancePostBonusTierZod,
62
- responses: {
63
- 201: IBonusTierList,
64
- 400: BadRequestError,
65
- 401: UnauthorizedError,
66
- 403: ForbiddenError,
67
- 500: InternalError,
68
- },
69
- },
70
- },
71
- {
72
- pathPrefix: 'bonus-tiers',
73
- },
74
- );
@@ -1,87 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import {
3
- ForbiddenError,
4
- NotFoundError,
5
- PaginationOptionsZod,
6
- UnauthorizedError,
7
- } from '../../../common/types';
8
- import {
9
- ChecklistFiltersZodSchema,
10
- ChecklistIncludeQuerySchema,
11
- ChecklistParamsZodSchema,
12
- IPaginatedChecklistSchema,
13
- PatchChecklistSchema,
14
- PostChecklistSchema,
15
- ResponseChecklistZodSchema,
16
- } from '../../../common/types/checklist.types';
17
-
18
- const c = initContract();
19
-
20
- export const checkListContract = c.router(
21
- {
22
- getChecklist: {
23
- summary: 'Get checklist by id',
24
- method: 'GET',
25
- path: '/:id',
26
- metadata: {
27
- auth: true,
28
- },
29
- pathParams: ChecklistParamsZodSchema,
30
- query: ChecklistIncludeQuerySchema,
31
- responses: {
32
- 200: ResponseChecklistZodSchema,
33
- 401: UnauthorizedError,
34
- 403: ForbiddenError,
35
- 404: NotFoundError,
36
- },
37
- },
38
- getChecklists: {
39
- summary: 'Query checklist by name or type',
40
- method: 'GET',
41
- path: '',
42
- metadata: {
43
- auth: true,
44
- },
45
- query: PaginationOptionsZod.merge(ChecklistFiltersZodSchema).merge(
46
- ChecklistIncludeQuerySchema,
47
- ),
48
- responses: {
49
- 200: IPaginatedChecklistSchema,
50
- 401: UnauthorizedError,
51
- 403: ForbiddenError,
52
- 404: NotFoundError,
53
- },
54
- },
55
- createChecklist: {
56
- summary: 'Create checklist ',
57
- method: 'POST',
58
- path: '',
59
- body: PostChecklistSchema,
60
- responses: {
61
- 201: ResponseChecklistZodSchema,
62
- 401: UnauthorizedError,
63
- 403: ForbiddenError,
64
- 404: NotFoundError,
65
- },
66
- },
67
- updateChecklist: {
68
- summary: 'Update checklist ',
69
- method: 'PATCH',
70
- path: '/:id',
71
- metadata: {
72
- auth: true,
73
- },
74
- body: PatchChecklistSchema,
75
- pathParams: ChecklistParamsZodSchema,
76
- responses: {
77
- 201: ResponseChecklistZodSchema,
78
- 401: UnauthorizedError,
79
- 403: ForbiddenError,
80
- 404: NotFoundError,
81
- },
82
- },
83
- },
84
- {
85
- pathPrefix: 'checklists',
86
- },
87
- );
@@ -1,86 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import {
3
- ForbiddenError,
4
- NotFoundError,
5
- PaginationOptionsZod,
6
- UnauthorizedError,
7
- } from '../../../common/types';
8
- import {
9
- ChecklistItemsFiltersZodSchema,
10
- IPaginatedChecklistItemSchema,
11
- ParamsChecklistItemSchema,
12
- PatchChecklistItemSchema,
13
- PostChecklistItemSchema,
14
- ResponseChecklistItemSchema,
15
- } from '../../../common/types/checklist-items.types';
16
-
17
- const c = initContract();
18
-
19
- export const checkListItemsContract = c.router(
20
- {
21
- createChecklistItem: {
22
- summary: 'Create checklist Item ',
23
- method: 'POST',
24
- path: '/',
25
- metadata: {
26
- auth: true,
27
- },
28
- body: PostChecklistItemSchema,
29
- responses: {
30
- 201: ResponseChecklistItemSchema,
31
- 401: UnauthorizedError,
32
- 403: ForbiddenError,
33
- 404: NotFoundError,
34
- },
35
- },
36
- updateChecklistItem: {
37
- summary: 'Update checklist item',
38
- method: 'PATCH',
39
- path: '/:id',
40
- metadata: {
41
- auth: true,
42
- },
43
- body: PatchChecklistItemSchema,
44
- pathParams: ParamsChecklistItemSchema,
45
- responses: {
46
- 201: ResponseChecklistItemSchema,
47
- 401: UnauthorizedError,
48
- 403: ForbiddenError,
49
- 404: NotFoundError,
50
- },
51
- },
52
- queryChecklistItem: {
53
- summary: 'GET checklist items by Checklist id',
54
- method: 'GET',
55
- path: '/',
56
- metadata: {
57
- auth: true,
58
- },
59
- query: PaginationOptionsZod.merge(ChecklistItemsFiltersZodSchema),
60
- responses: {
61
- 200: IPaginatedChecklistItemSchema,
62
- 401: UnauthorizedError,
63
- 403: ForbiddenError,
64
- 404: NotFoundError,
65
- },
66
- },
67
- getChecklistItem: {
68
- summary: 'GET checklist items by Checklist id',
69
- method: 'GET',
70
- pathParams: ParamsChecklistItemSchema,
71
- path: '/:id',
72
- metadata: {
73
- auth: true,
74
- },
75
- responses: {
76
- 200: ResponseChecklistItemSchema,
77
- 401: UnauthorizedError,
78
- 403: ForbiddenError,
79
- 404: NotFoundError,
80
- },
81
- },
82
- },
83
- {
84
- pathPrefix: 'checklist-items',
85
- },
86
- );
@@ -1,97 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import {
3
- BadRequestError,
4
- ForbiddenError,
5
- InternalError,
6
- NotFoundError,
7
- PaginationOptionsZod,
8
- PatchCoveredPersonsZod,
9
- ReviewCoveredPersons,
10
- UnauthorizedError,
11
- } from '../../../common/types';
12
-
13
- import {
14
- coveredPersonIdSchema,
15
- CoveredPersonsIncludeQuery,
16
- GetCoveredPersonsZod,
17
- ICoveredPerson,
18
- IPaginatedCoveredPerson,
19
- } from '../../../common/types';
20
- import { z } from 'zod';
21
-
22
- const c = initContract();
23
-
24
- export const coveredPersonsContract = c.router(
25
- {
26
- getCoveredPersons: {
27
- summary: 'Get Covered Persons',
28
- method: 'GET',
29
- path: '',
30
- metadata: {
31
- auth: true,
32
- },
33
- query: PaginationOptionsZod.merge(CoveredPersonsIncludeQuery).merge(
34
- GetCoveredPersonsZod,
35
- ),
36
- responses: {
37
- 200: IPaginatedCoveredPerson,
38
- 401: UnauthorizedError,
39
- 403: ForbiddenError,
40
- 500: InternalError,
41
- },
42
- },
43
- getCoveredPerson: {
44
- summary: 'Get covered person by id',
45
- method: 'GET',
46
- path: '/:id',
47
- metadata: {
48
- auth: true,
49
- },
50
- query: z.object({}).merge(CoveredPersonsIncludeQuery),
51
- pathParams: z.object({ id: coveredPersonIdSchema }),
52
- responses: {
53
- 200: ICoveredPerson,
54
- 401: UnauthorizedError,
55
- 403: ForbiddenError,
56
- 404: NotFoundError,
57
- },
58
- },
59
- patchCoveredPerson: {
60
- summary: 'Update covered person',
61
- method: 'PATCH',
62
- path: '/:id',
63
- metadata: {
64
- auth: true,
65
- },
66
- pathParams: z.object({ id: coveredPersonIdSchema }),
67
- body: PatchCoveredPersonsZod,
68
- responses: {
69
- 201: ICoveredPerson,
70
- 400: BadRequestError,
71
- 401: UnauthorizedError,
72
- 403: ForbiddenError,
73
- 404: NotFoundError,
74
- 500: InternalError,
75
- },
76
- },
77
- reviewCoveredPersons: {
78
- summary: 'Review CoveredPersons',
79
- method: 'POST',
80
- path: '/review',
81
- metadata: {
82
- auth: true,
83
- },
84
- body: ReviewCoveredPersons,
85
- responses: {
86
- 201: z.object({ success: z.boolean() }),
87
- 401: UnauthorizedError,
88
- 403: ForbiddenError,
89
- 404: NotFoundError,
90
- 500: InternalError,
91
- },
92
- },
93
- },
94
- {
95
- pathPrefix: 'covered-persons',
96
- },
97
- );
@@ -1,111 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import {
3
- ForbiddenError,
4
- PaginationOptionsZod,
5
- UnauthorizedError,
6
- IPaginatedTradeSummaryResponse,
7
- InternalError,
8
- BadRequestError,
9
- TradeSummaryFilterZod,
10
- IPaginatedOnboardingOfferingSummaryResponse,
11
- OnboardingOfferingSummaryFilterZod,
12
- } from '../../../common/types';
13
- import { IPaginatedSecondaryTradeSummaryResponse } from '../../../common/types/secondary-trade.types';
14
- import {
15
- DocumentSummaryFilterZod,
16
- IPaginatedDocumentSummaryResponse,
17
- } from '../../../common/types/dashboard.types';
18
- import {
19
- IPaginatedOnboardingAccountSummaryResponse,
20
- OnboardingAccountSummaryFilterZod,
21
- } from '../../../common/types/account.types';
22
-
23
- const c = initContract();
24
-
25
- export const dashboardContract = c.router(
26
- {
27
- getPaginatedTradesSummary: {
28
- summary: 'Get trades summary with pagination',
29
- method: 'GET',
30
- path: '/trades',
31
- metadata: {
32
- auth: true,
33
- },
34
- query: PaginationOptionsZod.merge(TradeSummaryFilterZod),
35
- responses: {
36
- 200: IPaginatedTradeSummaryResponse,
37
- 400: BadRequestError,
38
- 401: UnauthorizedError,
39
- 403: ForbiddenError,
40
- 500: InternalError,
41
- },
42
- },
43
- getPaginatedSecondaryTradesSummary: {
44
- summary: 'Get secondary trades summary with pagination',
45
- method: 'GET',
46
- path: '/secondary-trades',
47
- metadata: {
48
- auth: true,
49
- },
50
- query: PaginationOptionsZod,
51
- responses: {
52
- 200: IPaginatedSecondaryTradeSummaryResponse,
53
- 400: BadRequestError,
54
- 401: UnauthorizedError,
55
- 403: ForbiddenError,
56
- 500: InternalError,
57
- },
58
- },
59
- getDocumentsSummary: {
60
- summary: 'Get documents summary with pagination',
61
- method: 'GET',
62
- path: '/documents',
63
- metadata: {
64
- auth: true,
65
- },
66
- query: PaginationOptionsZod.merge(DocumentSummaryFilterZod),
67
- responses: {
68
- 200: IPaginatedDocumentSummaryResponse,
69
- 400: BadRequestError,
70
- 401: UnauthorizedError,
71
- 403: ForbiddenError,
72
- 500: InternalError,
73
- },
74
- },
75
- getPaginatedOnBoardingAccountSummary: {
76
- summary: 'Get onboarding account summary with pagination',
77
- method: 'GET',
78
- path: '/onboarding-accounts',
79
- metadata: {
80
- auth: true,
81
- },
82
- query: PaginationOptionsZod.merge(OnboardingAccountSummaryFilterZod),
83
- responses: {
84
- 200: IPaginatedOnboardingAccountSummaryResponse,
85
- 400: BadRequestError,
86
- 401: UnauthorizedError,
87
- 403: ForbiddenError,
88
- 500: InternalError,
89
- },
90
- },
91
- getPaginatedOnBoardingOfferingSummary: {
92
- summary: 'Get onboarding offering summary with pagination',
93
- method: 'GET',
94
- path: '/onboarding-offerings',
95
- metadata: {
96
- auth: true,
97
- },
98
- query: PaginationOptionsZod.merge(OnboardingOfferingSummaryFilterZod),
99
- responses: {
100
- 200: IPaginatedOnboardingOfferingSummaryResponse,
101
- 400: BadRequestError,
102
- 401: UnauthorizedError,
103
- 403: ForbiddenError,
104
- 500: InternalError,
105
- },
106
- },
107
- },
108
- {
109
- pathPrefix: 'dashboard',
110
- },
111
- );
@@ -1,116 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import {
3
- ComplianceReview,
4
- ForbiddenError,
5
- InternalError,
6
- NotFoundError,
7
- PaginationOptionsZod,
8
- UnauthorizedError,
9
- } from '../../../common/types';
10
- import {
11
- dataRecordIdSchema,
12
- DataRecordsFilters,
13
- DataRecordsIncludeQuery,
14
- DataRecordStructureZod,
15
- DataRecordZod,
16
- IPaginatedDataRecords,
17
- NavigationSummaryZod,
18
- RecordPathResponse,
19
- } from '../../../common/types/data-record.types';
20
- import { z } from 'zod';
21
-
22
- const c = initContract();
23
-
24
- export const dataRecordsContract = c.router(
25
- {
26
- getDataRecords: {
27
- summary: 'Get Data Records',
28
- method: 'GET',
29
- path: '',
30
- metadata: {
31
- auth: true,
32
- },
33
- query: PaginationOptionsZod.merge(DataRecordsFilters).merge(
34
- DataRecordsIncludeQuery,
35
- ),
36
- responses: {
37
- 200: IPaginatedDataRecords,
38
- 401: UnauthorizedError,
39
- 403: ForbiddenError,
40
- 500: InternalError,
41
- },
42
- },
43
- getDataRecord: {
44
- summary: 'Get data record by id',
45
- method: 'GET',
46
- path: '/:id',
47
- metadata: {
48
- auth: true,
49
- },
50
- pathParams: z.object({ id: dataRecordIdSchema }),
51
- query: z
52
- .object({ status: z.nativeEnum(ComplianceReview) })
53
- .merge(DataRecordsIncludeQuery),
54
- responses: {
55
- 200: DataRecordZod,
56
- 401: UnauthorizedError,
57
- 403: ForbiddenError,
58
- 404: NotFoundError,
59
- 500: InternalError,
60
- },
61
- },
62
- getDataRecordStructure: {
63
- summary:
64
- 'Get data record structure by id - shows the proper tree structure of the data record',
65
- method: 'GET',
66
- path: '/:id/structure',
67
- metadata: {
68
- auth: true,
69
- },
70
- pathParams: z.object({ id: dataRecordIdSchema }),
71
- responses: {
72
- 200: DataRecordStructureZod,
73
- 401: UnauthorizedError,
74
- 403: ForbiddenError,
75
- 404: NotFoundError,
76
- 500: InternalError,
77
- },
78
- },
79
- getDataRecordPath: {
80
- summary:
81
- 'Get data record path by id - useful for navigation and showing the user where they are in the folder structure. Returns the path to the record',
82
- method: 'GET',
83
- path: '/:id/path',
84
- metadata: {
85
- auth: true,
86
- },
87
- pathParams: z.object({ id: dataRecordIdSchema }),
88
- responses: {
89
- 200: RecordPathResponse,
90
- 401: UnauthorizedError,
91
- 403: ForbiddenError,
92
- 404: NotFoundError,
93
- 500: InternalError,
94
- },
95
- },
96
- getNavigationSummary: {
97
- summary:
98
- 'Get navigation summary for a data record - useful for breadcrumbs',
99
- method: 'GET',
100
- path: '/:id/navigation',
101
- metadata: {
102
- auth: true,
103
- },
104
- pathParams: z.object({ id: dataRecordIdSchema }),
105
- responses: {
106
- 200: NavigationSummaryZod,
107
- 401: UnauthorizedError,
108
- 403: ForbiddenError,
109
- 500: InternalError,
110
- },
111
- },
112
- },
113
- {
114
- pathPrefix: 'data-records',
115
- },
116
- );