@dalmore/api-contracts 0.0.0-dev.d07da18 → 0.0.0-dev.d29fb02

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 (205) hide show
  1. package/README.md +23 -19
  2. package/common/types/account-contact.types.ts +2 -1
  3. package/common/types/account-manager.types.ts +3 -7
  4. package/common/types/account-setting.types.ts +65 -0
  5. package/common/types/account.types.ts +1 -0
  6. package/common/types/activity.types.ts +1 -1
  7. package/common/types/auth.types.ts +7 -18
  8. package/common/types/bonus-tier.types.ts +33 -0
  9. package/common/types/cart.types.ts +4 -1
  10. package/common/types/common.types.ts +38 -6
  11. package/common/types/contact-us.types.ts +6 -2
  12. package/common/types/covered-person.types.ts +2 -1
  13. package/common/types/dashboard.types.ts +2 -9
  14. package/common/types/disbursements.types.ts +119 -3
  15. package/common/types/escrow-account.types.ts +3 -3
  16. package/common/types/file.types.ts +17 -1
  17. package/common/types/i-will-do-it-later.types.ts +68 -0
  18. package/common/types/index.ts +2 -0
  19. package/common/types/individuals.types.ts +5 -17
  20. package/common/types/investor-account.types.ts +2 -1
  21. package/common/types/invite.types.ts +27 -1
  22. package/common/types/issuer-offering.types.ts +13 -17
  23. package/common/types/issuer-payment-method.types.ts +41 -0
  24. package/common/types/issuer.types.ts +9 -0
  25. package/common/types/legal-entity.types.ts +3 -2
  26. package/common/types/mail-template.types.ts +34 -0
  27. package/common/types/note.types.ts +1 -1
  28. package/common/types/notification.types.ts +525 -29
  29. package/common/types/offering.types.ts +4 -9
  30. package/common/types/site-settings.types.ts +2 -1
  31. package/common/types/site.types.ts +2 -9
  32. package/common/types/{trade-line-item.type.ts → trade-line-item.types.ts} +2 -9
  33. package/common/types/trade.types.ts +48 -2
  34. package/common/types/transaction.types.ts +12 -1
  35. package/common/types/trusted-contact.types.ts +7 -7
  36. package/common/types/user.types.ts +17 -33
  37. package/contracts/clients/cart/index.ts +21 -1
  38. package/contracts/clients/index.ts +6 -0
  39. package/contracts/{investors → clients}/issuer-payment-methods/index.ts +5 -2
  40. package/contracts/{compliance → clients}/payment-methods/index.ts +40 -12
  41. package/contracts/clients/trade-line-items/index.ts +1 -1
  42. package/contracts/clients/trades/index.ts +1 -1
  43. package/contracts/{investors → clients}/transactions/index.ts +3 -3
  44. package/index.ts +10 -0
  45. package/package.json +23 -32
  46. package/contracts/compliance/account-contacts/index.ts +0 -82
  47. package/contracts/compliance/account-managers/index.ts +0 -142
  48. package/contracts/compliance/accounts/index.ts +0 -187
  49. package/contracts/compliance/activities/index.ts +0 -55
  50. package/contracts/compliance/aic/index.ts +0 -60
  51. package/contracts/compliance/api-keys/index.ts +0 -91
  52. package/contracts/compliance/assets/index.ts +0 -122
  53. package/contracts/compliance/auth/index.ts +0 -134
  54. package/contracts/compliance/batch-jobs/index.ts +0 -62
  55. package/contracts/compliance/bonus-tiers/index.ts +0 -55
  56. package/contracts/compliance/checklist/index.ts +0 -87
  57. package/contracts/compliance/checklist-items/index.ts +0 -86
  58. package/contracts/compliance/covered-persons/index.ts +0 -97
  59. package/contracts/compliance/dashboard/index.ts +0 -111
  60. package/contracts/compliance/data-records/index.ts +0 -116
  61. package/contracts/compliance/data-rooms/index.ts +0 -113
  62. package/contracts/compliance/default-theme-configs/index.ts +0 -95
  63. package/contracts/compliance/disbursement/index.ts +0 -165
  64. package/contracts/compliance/disbursement-approval-users/index.ts +0 -84
  65. package/contracts/compliance/disbursement-transactions/index.ts +0 -37
  66. package/contracts/compliance/domain-filters/index.ts +0 -117
  67. package/contracts/compliance/email-themes/index.ts +0 -284
  68. package/contracts/compliance/escrow-accounts/index.ts +0 -85
  69. package/contracts/compliance/exchange-api-keys/index.ts +0 -129
  70. package/contracts/compliance/exchange-imports/index.ts +0 -137
  71. package/contracts/compliance/files/index.ts +0 -267
  72. package/contracts/compliance/files-public/index.ts +0 -188
  73. package/contracts/compliance/health/index.ts +0 -26
  74. package/contracts/compliance/index.ts +0 -147
  75. package/contracts/compliance/individuals/index.ts +0 -57
  76. package/contracts/compliance/investor-accounts/index.ts +0 -141
  77. package/contracts/compliance/invites/index.ts +0 -137
  78. package/contracts/compliance/issuer-bank-accounts/index.ts +0 -81
  79. package/contracts/compliance/issuer-payment-methods/index.ts +0 -81
  80. package/contracts/compliance/issuers/index.ts +0 -97
  81. package/contracts/compliance/job-items/index.ts +0 -58
  82. package/contracts/compliance/jobs/index.ts +0 -59
  83. package/contracts/compliance/kyb/index.ts +0 -54
  84. package/contracts/compliance/kyc/index.ts +0 -77
  85. package/contracts/compliance/legal-entities/index.ts +0 -57
  86. package/contracts/compliance/login-histories/index.ts +0 -37
  87. package/contracts/compliance/notes/index.ts +0 -69
  88. package/contracts/compliance/notion-databases/index.ts +0 -107
  89. package/contracts/compliance/notion-pages/index.ts +0 -105
  90. package/contracts/compliance/offering-reports/index.ts +0 -149
  91. package/contracts/compliance/offerings/index.ts +0 -233
  92. package/contracts/compliance/pages/index.ts +0 -178
  93. package/contracts/compliance/rejection-reasons/index.ts +0 -32
  94. package/contracts/compliance/review/index.ts +0 -169
  95. package/contracts/compliance/roles/index.ts +0 -34
  96. package/contracts/compliance/secondary-customers/index.ts +0 -77
  97. package/contracts/compliance/secondary-orders/index.ts +0 -60
  98. package/contracts/compliance/secondary-trades/index.ts +0 -100
  99. package/contracts/compliance/secure-requests/index.ts +0 -54
  100. package/contracts/compliance/signer/index.ts +0 -369
  101. package/contracts/compliance/site-links/index.ts +0 -128
  102. package/contracts/compliance/site-settings/index.ts +0 -669
  103. package/contracts/compliance/sites/index.ts +0 -56
  104. package/contracts/compliance/state-machine/index.ts +0 -94
  105. package/contracts/compliance/tasks/index.ts +0 -91
  106. package/contracts/compliance/third-parties/index.ts +0 -52
  107. package/contracts/compliance/trade-line-items/index.ts +0 -59
  108. package/contracts/compliance/trades/index.ts +0 -230
  109. package/contracts/compliance/transactions/index.ts +0 -161
  110. package/contracts/compliance/user-manuals/index.ts +0 -271
  111. package/contracts/compliance/user-settings/index.ts +0 -189
  112. package/contracts/compliance/users/index.ts +0 -200
  113. package/contracts/compliance/webhooks/index.ts +0 -41
  114. package/contracts/compliance-apikey/accounts/index.ts +0 -58
  115. package/contracts/compliance-apikey/index.ts +0 -14
  116. package/contracts/index.ts +0 -6
  117. package/contracts/investors/account-contacts/index.ts +0 -58
  118. package/contracts/investors/aic/index.ts +0 -59
  119. package/contracts/investors/assets/index.ts +0 -61
  120. package/contracts/investors/auth/index.ts +0 -116
  121. package/contracts/investors/bonus-tiers/index.ts +0 -37
  122. package/contracts/investors/cart/index.ts +0 -75
  123. package/contracts/investors/contact-us/index.ts +0 -48
  124. package/contracts/investors/data-records/index.ts +0 -113
  125. package/contracts/investors/data-rooms/index.ts +0 -96
  126. package/contracts/investors/files/index.ts +0 -167
  127. package/contracts/investors/files-public/index.ts +0 -185
  128. package/contracts/investors/index.ts +0 -72
  129. package/contracts/investors/individuals/index.ts +0 -99
  130. package/contracts/investors/investor-accounts/index.ts +0 -110
  131. package/contracts/investors/issuers/index.ts +0 -30
  132. package/contracts/investors/legal-entities/index.ts +0 -93
  133. package/contracts/investors/notes/index.ts +0 -69
  134. package/contracts/investors/offerings/index.ts +0 -93
  135. package/contracts/investors/pages/index.ts +0 -88
  136. package/contracts/investors/payment-methods/index.ts +0 -149
  137. package/contracts/investors/portfolios/index.ts +0 -53
  138. package/contracts/investors/sites/index.ts +0 -96
  139. package/contracts/investors/tasks/index.ts +0 -111
  140. package/contracts/investors/trade-line-items/index.ts +0 -75
  141. package/contracts/investors/trades/index.ts +0 -114
  142. package/contracts/investors/trusted-contacts/index.ts +0 -93
  143. package/contracts/investors/user-manuals/index.ts +0 -62
  144. package/contracts/investors/user-settings/index.ts +0 -170
  145. package/contracts/investors/users/index.ts +0 -45
  146. package/contracts/investors/webhooks/index.ts +0 -30
  147. package/contracts/issuers/account-contacts/index.ts +0 -76
  148. package/contracts/issuers/account-integrations/index.ts +0 -97
  149. package/contracts/issuers/accounts/index.ts +0 -97
  150. package/contracts/issuers/activities/index.ts +0 -54
  151. package/contracts/issuers/aic/index.ts +0 -39
  152. package/contracts/issuers/api-key-logs/index.ts +0 -53
  153. package/contracts/issuers/api-keys/index.ts +0 -93
  154. package/contracts/issuers/assets/index.ts +0 -122
  155. package/contracts/issuers/auth/index.ts +0 -152
  156. package/contracts/issuers/bonus-tiers/index.ts +0 -55
  157. package/contracts/issuers/contact-us/index.ts +0 -48
  158. package/contracts/issuers/covered-persons/index.ts +0 -136
  159. package/contracts/issuers/dashboard/index.ts +0 -72
  160. package/contracts/issuers/data-records/index.ts +0 -257
  161. package/contracts/issuers/data-rooms/index.ts +0 -134
  162. package/contracts/issuers/disbursement-approval-users/index.ts +0 -82
  163. package/contracts/issuers/disbursement-transactions/index.ts +0 -53
  164. package/contracts/issuers/disbursements/index.ts +0 -153
  165. package/contracts/issuers/email-themes/index.ts +0 -242
  166. package/contracts/issuers/escrow-accounts/index.ts +0 -81
  167. package/contracts/issuers/exchange-api-keys/index.ts +0 -144
  168. package/contracts/issuers/files/index.ts +0 -166
  169. package/contracts/issuers/files-public/index.ts +0 -166
  170. package/contracts/issuers/health/index.ts +0 -24
  171. package/contracts/issuers/index.ts +0 -112
  172. package/contracts/issuers/investor-accounts/index.ts +0 -148
  173. package/contracts/issuers/invites/index.ts +0 -129
  174. package/contracts/issuers/issuer/index.ts +0 -94
  175. package/contracts/issuers/issuer-bank-accounts/index.ts +0 -81
  176. package/contracts/issuers/issuer-payment-methods/index.ts +0 -136
  177. package/contracts/issuers/kyc/index.ts +0 -38
  178. package/contracts/issuers/login-histories/index.ts +0 -51
  179. package/contracts/issuers/notes/index.ts +0 -69
  180. package/contracts/issuers/offerings/index.ts +0 -206
  181. package/contracts/issuers/pages/index.ts +0 -138
  182. package/contracts/issuers/payment-methods/index.ts +0 -61
  183. package/contracts/issuers/portfolios/index.ts +0 -36
  184. package/contracts/issuers/rejection-reasons/index.ts +0 -32
  185. package/contracts/issuers/review/index.ts +0 -63
  186. package/contracts/issuers/secondary-customers/index.ts +0 -55
  187. package/contracts/issuers/secondary-orders/index.ts +0 -57
  188. package/contracts/issuers/secondary-trades/index.ts +0 -57
  189. package/contracts/issuers/secure-requests/index.ts +0 -34
  190. package/contracts/issuers/site-links/index.ts +0 -116
  191. package/contracts/issuers/site-settings/index.ts +0 -585
  192. package/contracts/issuers/sites/index.ts +0 -32
  193. package/contracts/issuers/tasks/index.ts +0 -111
  194. package/contracts/issuers/trades/index.ts +0 -132
  195. package/contracts/issuers/transactions/index.ts +0 -158
  196. package/contracts/issuers/user-manuals/index.ts +0 -62
  197. package/contracts/issuers/user-settings/index.ts +0 -170
  198. package/contracts/issuers/users/index.ts +0 -126
  199. package/contracts/secondaries/accounts/index.ts +0 -58
  200. package/contracts/secondaries/index.ts +0 -23
  201. package/contracts/secondaries/secondary-customers/index.ts +0 -55
  202. package/contracts/secondaries/secondary-issuers/index.ts +0 -94
  203. package/contracts/secondaries/secondary-orders/index.ts +0 -56
  204. package/contracts/secondaries/secondary-securities/index.ts +0 -95
  205. package/contracts/secondaries/secondary-trades/index.ts +0 -56
@@ -1,148 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import {
3
- BadRequestError,
4
- ForbiddenError,
5
- IIndividualZod,
6
- InternalError,
7
- NotFoundError,
8
- PaginationOptionsZod,
9
- tradeIdSchema,
10
- UnauthorizedError,
11
- } from '../../../common/types';
12
- import { z } from 'zod';
13
- import {
14
- InvestorAccountsIncludeQuery,
15
- investorAccountIdSchema,
16
- IInvestorAccount,
17
- IssuerInvestorAccountsFiltersZod,
18
- IPaginatedInvestorAccounts,
19
- InvestorAccountExportFilters,
20
- GetInvestorAccountDetailsQuery,
21
- RegisteredInvestorUserFiltersZod,
22
- IPaginatedRegisteredInvestorUserZod,
23
- IInvestorAccountSummary,
24
- } from '../../../common/types/investor-account.types';
25
-
26
- const c = initContract();
27
-
28
- export const investorAccountsContract = c.router(
29
- {
30
- exportInvestorAccounts: {
31
- summary: 'Export investor accounts to CSV',
32
- method: 'GET',
33
- path: '/export',
34
- query: InvestorAccountExportFilters,
35
- metadata: {
36
- auth: true,
37
- },
38
- responses: {
39
- 200: z.unknown(),
40
- 401: UnauthorizedError,
41
- 404: NotFoundError,
42
- },
43
- },
44
- exportRegisteredInvestorUsers: {
45
- summary: 'Export registered investor users to CSV',
46
- method: 'GET',
47
- path: '/registered-users/export',
48
- query: RegisteredInvestorUserFiltersZod,
49
- metadata: {
50
- auth: true,
51
- },
52
- responses: {
53
- 200: z.unknown(),
54
- 401: UnauthorizedError,
55
- 404: NotFoundError,
56
- },
57
- },
58
- getInvestorAccounts: {
59
- summary: 'Get investor accounts',
60
- method: 'GET',
61
- path: '',
62
- metadata: {
63
- auth: true,
64
- },
65
- query: PaginationOptionsZod.merge(IssuerInvestorAccountsFiltersZod),
66
- responses: {
67
- 200: IPaginatedInvestorAccounts,
68
- 401: UnauthorizedError,
69
- 403: ForbiddenError,
70
- },
71
- },
72
- getRegisteredInvestorUsers: {
73
- summary: 'Get registered investor users',
74
- method: 'GET',
75
- path: '/registered-users',
76
- query: PaginationOptionsZod.merge(RegisteredInvestorUserFiltersZod),
77
- metadata: {
78
- auth: true,
79
- },
80
- responses: {
81
- 200: IPaginatedRegisteredInvestorUserZod,
82
- 401: UnauthorizedError,
83
- 403: ForbiddenError,
84
- 500: InternalError,
85
- },
86
- },
87
- getInvestorAccount: {
88
- summary: 'Get investor account by id',
89
- method: 'GET',
90
- path: '/:id',
91
- metadata: {
92
- auth: true,
93
- },
94
- query: z.object({}).merge(InvestorAccountsIncludeQuery),
95
- pathParams: z.object({
96
- id: investorAccountIdSchema,
97
- }),
98
- responses: {
99
- 200: IInvestorAccount,
100
- 401: UnauthorizedError,
101
- 403: ForbiddenError,
102
- 404: NotFoundError,
103
- },
104
- },
105
- getInvestorAccountDetails: {
106
- summary: 'Get investor account details',
107
- method: 'GET',
108
- path: '/:id/details',
109
- metadata: {
110
- auth: true,
111
- },
112
- pathParams: z.object({
113
- id: investorAccountIdSchema,
114
- }),
115
- query: GetInvestorAccountDetailsQuery,
116
- responses: {
117
- 200: IIndividualZod,
118
- 400: BadRequestError,
119
- 401: UnauthorizedError,
120
- 403: ForbiddenError,
121
- 404: NotFoundError,
122
- },
123
- },
124
- getInvestorAccountSummary: {
125
- summary: 'Get investor account summary',
126
- method: 'GET',
127
- path: '/:id/summary',
128
- metadata: {
129
- auth: true,
130
- },
131
- pathParams: z.object({
132
- id: investorAccountIdSchema,
133
- }),
134
- query: z.object({
135
- tradeId: tradeIdSchema.optional(),
136
- }),
137
- responses: {
138
- 200: IInvestorAccountSummary,
139
- 401: UnauthorizedError,
140
- 403: ForbiddenError,
141
- 404: NotFoundError,
142
- },
143
- },
144
- },
145
- {
146
- pathPrefix: 'investor-accounts',
147
- },
148
- );
@@ -1,129 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import {
3
- BadRequestError,
4
- ForbiddenError,
5
- NotFoundError,
6
- InternalError,
7
- InviteWithUrl,
8
- IPaginatedInvite,
9
- PaginationOptionsZod,
10
- PostIssuerInviteZod,
11
- IssuerInvitesFiltersZod,
12
- UnauthorizedError,
13
- IssuerVerifyInviteResponse,
14
- IssuerInvitesDecisionResponse,
15
- inviteIdSchema,
16
- InvitesIncludeQuery,
17
- PatchInviteRoleZod,
18
- } from '../../../common/types';
19
- import { z } from 'zod';
20
-
21
- const c = initContract();
22
-
23
- export const issuerInvitesContract = c.router(
24
- {
25
- getInvites: {
26
- summary: '[OWNER] Get invites',
27
- method: 'GET',
28
- path: '',
29
- metadata: {
30
- auth: true,
31
- },
32
- query: PaginationOptionsZod.merge(IssuerInvitesFiltersZod).merge(
33
- InvitesIncludeQuery,
34
- ),
35
- responses: {
36
- 200: IPaginatedInvite,
37
- 400: BadRequestError,
38
- 401: UnauthorizedError,
39
- 403: ForbiddenError,
40
- },
41
- },
42
- verifyInvite: {
43
- summary: 'Verify invite',
44
- method: 'GET',
45
- path: '/verify/:code',
46
- pathParams: z.object({
47
- code: z.string(),
48
- }),
49
- responses: {
50
- 200: IssuerVerifyInviteResponse,
51
- 400: BadRequestError,
52
- 404: NotFoundError,
53
- },
54
- },
55
- postInvite: {
56
- summary: '[OWNER] Invite user',
57
- method: 'POST',
58
- path: '',
59
- metadata: {
60
- auth: true,
61
- },
62
- body: PostIssuerInviteZod,
63
- responses: {
64
- 201: InviteWithUrl,
65
- 400: BadRequestError,
66
- 401: UnauthorizedError,
67
- 403: ForbiddenError,
68
- 500: InternalError,
69
- },
70
- },
71
- acceptInvite: {
72
- summary: 'Accept invite',
73
- method: 'PATCH',
74
- path: '/accept/:id',
75
- pathParams: z.object({
76
- id: inviteIdSchema,
77
- }),
78
- body: z.object({}),
79
- responses: {
80
- 201: IssuerInvitesDecisionResponse,
81
- 400: BadRequestError,
82
- 401: UnauthorizedError,
83
- 403: ForbiddenError,
84
- 404: NotFoundError,
85
- 500: InternalError,
86
- },
87
- },
88
- rejectInvite: {
89
- summary: 'Verify invite',
90
- method: 'PATCH',
91
- path: '/reject/:id',
92
- body: z.object({}),
93
- pathParams: z.object({
94
- id: inviteIdSchema,
95
- }),
96
- responses: {
97
- 201: IssuerInvitesDecisionResponse,
98
- 400: BadRequestError,
99
- 401: UnauthorizedError,
100
- 403: ForbiddenError,
101
- 404: NotFoundError,
102
- 500: InternalError,
103
- },
104
- },
105
- patchInviteRole: {
106
- summary: 'Patch invite role',
107
- method: 'PATCH',
108
- path: '/role/:id',
109
- pathParams: z.object({
110
- id: inviteIdSchema,
111
- }),
112
- metadata: {
113
- auth: true,
114
- },
115
- body: PatchInviteRoleZod,
116
- responses: {
117
- 201: InviteWithUrl,
118
- 400: BadRequestError,
119
- 401: UnauthorizedError,
120
- 403: ForbiddenError,
121
- 404: NotFoundError,
122
- 500: InternalError,
123
- },
124
- },
125
- },
126
- {
127
- pathPrefix: 'invites',
128
- },
129
- );
@@ -1,94 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import { z } from 'zod';
3
- import {
4
- BadRequestError,
5
- ForbiddenError,
6
- InternalError,
7
- NotFoundError,
8
- PaginationOptionsZod,
9
- UnauthorizedError,
10
- } from '../../../common/types';
11
- import {
12
- GetIssuersZod,
13
- IIssuer,
14
- IPaginatedIssuer,
15
- IssuersIncludeQuery,
16
- issuerIdSchema,
17
- PostIssuerZod,
18
- PutIssuerZod,
19
- } from '../../../common/types/issuer.types';
20
- const c = initContract();
21
-
22
- export const issuerContract = c.router(
23
- {
24
- getIssuers: {
25
- summary: 'Get Issuers',
26
- method: 'GET',
27
- path: '',
28
- metadata: {
29
- auth: true,
30
- },
31
- query:
32
- PaginationOptionsZod.merge(IssuersIncludeQuery).merge(GetIssuersZod),
33
- responses: {
34
- 200: IPaginatedIssuer,
35
- 401: UnauthorizedError,
36
- 403: ForbiddenError,
37
- },
38
- },
39
- postIssuer: {
40
- summary: 'Create an issuer',
41
- method: 'POST',
42
- path: '',
43
- metadata: {
44
- auth: true,
45
- },
46
- body: PostIssuerZod,
47
- responses: {
48
- 201: IIssuer,
49
- 401: UnauthorizedError,
50
- 403: ForbiddenError,
51
- 500: InternalError,
52
- },
53
- },
54
- getIssuer: {
55
- summary: 'Get issuer by id',
56
- method: 'GET',
57
- path: '/:id',
58
- metadata: {
59
- auth: true,
60
- },
61
- query: z.object({}).merge(IssuersIncludeQuery),
62
- pathParams: z.object({ id: issuerIdSchema }),
63
- responses: {
64
- 200: IIssuer,
65
- 401: UnauthorizedError,
66
- 403: ForbiddenError,
67
- 404: NotFoundError,
68
- },
69
- },
70
- updateIssuer: {
71
- summary: 'Update issuer',
72
- method: 'PUT',
73
- path: '/:id',
74
- metadata: {
75
- auth: true,
76
- },
77
- pathParams: z.object({
78
- id: issuerIdSchema,
79
- }),
80
- body: PutIssuerZod,
81
- responses: {
82
- 201: IIssuer,
83
- 400: BadRequestError,
84
- 401: UnauthorizedError,
85
- 403: ForbiddenError,
86
- 404: NotFoundError,
87
- 500: InternalError,
88
- },
89
- },
90
- },
91
- {
92
- pathPrefix: 'issuers',
93
- },
94
- );
@@ -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,136 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import {
3
- ForbiddenError,
4
- InternalError,
5
- NotFoundError,
6
- UnauthorizedError,
7
- GetIssuerPaymentMethodZod,
8
- IIssuerPaymentMethod,
9
- IPaginatedIssuerPaymentMethod,
10
- issuerPaymentMethodIdSchema,
11
- PatchIssuerPaymentMethodZod,
12
- PaginationOptionsZod,
13
- ConnectIssuerPaymentMethodZod,
14
- BadRequestError,
15
- } from '../../../common/types';
16
- import { z } from 'zod';
17
-
18
- const c = initContract();
19
-
20
- export const issuerPaymentMethodsContract = c.router(
21
- {
22
- getIssuerPaymentMethods: {
23
- summary: 'get payment methods',
24
- method: 'GET',
25
- path: '',
26
- metadata: {
27
- auth: true,
28
- },
29
- query: PaginationOptionsZod.merge(GetIssuerPaymentMethodZod),
30
- responses: {
31
- 200: IPaginatedIssuerPaymentMethod,
32
- 401: UnauthorizedError,
33
- 403: ForbiddenError,
34
- 404: NotFoundError,
35
- 500: InternalError,
36
- },
37
- },
38
- patchIssuerPaymentMethod: {
39
- summary: 'PATCH issuer payment method',
40
- method: 'PATCH',
41
- path: '/:id',
42
- pathParams: z.object({
43
- id: issuerPaymentMethodIdSchema,
44
- }),
45
- metadata: {
46
- auth: true,
47
- },
48
- body: PatchIssuerPaymentMethodZod,
49
- responses: {
50
- 201: IIssuerPaymentMethod,
51
- 401: UnauthorizedError,
52
- 403: ForbiddenError,
53
- 404: NotFoundError,
54
- 500: InternalError,
55
- },
56
- },
57
- toggleIssuerPaymentMethod: {
58
- summary: 'Toggle issuer payment method',
59
- method: 'PATCH',
60
- path: '/:id/toggle',
61
- metadata: {
62
- auth: true,
63
- },
64
- pathParams: z.object({
65
- id: issuerPaymentMethodIdSchema,
66
- }),
67
- body: z.object({
68
- enabled: z.boolean(),
69
- }),
70
- responses: {
71
- 200: IIssuerPaymentMethod,
72
- 401: UnauthorizedError,
73
- 403: ForbiddenError,
74
- 404: NotFoundError,
75
- },
76
- },
77
- connectIssuerPaymentMethod: {
78
- summary: 'Connect issuer payment method',
79
- method: 'POST',
80
- path: '/integrations/connect',
81
- metadata: {
82
- auth: true,
83
- },
84
- body: ConnectIssuerPaymentMethodZod,
85
- responses: {
86
- 200: z.array(IIssuerPaymentMethod),
87
- 400: BadRequestError,
88
- 401: UnauthorizedError,
89
- 403: ForbiddenError,
90
- 404: NotFoundError,
91
- 500: InternalError,
92
- },
93
- },
94
- disconnectIssuerPaymentMethod: {
95
- summary: 'Disconnect issuer payment method',
96
- method: 'PATCH',
97
- path: '/:id/integrations/disconnect',
98
- metadata: {
99
- auth: true,
100
- },
101
- pathParams: z.object({
102
- id: issuerPaymentMethodIdSchema,
103
- }),
104
- body: z.object({}),
105
- responses: {
106
- 200: IIssuerPaymentMethod,
107
- 401: UnauthorizedError,
108
- 403: ForbiddenError,
109
- 404: NotFoundError,
110
- 500: InternalError,
111
- },
112
- },
113
- createIssuerPaymentMethodAccountLink: {
114
- summary: 'Create issuer payment method account link',
115
- method: 'POST',
116
- path: '/:id/integrations/account-link',
117
- metadata: {
118
- auth: true,
119
- },
120
- pathParams: z.object({
121
- id: issuerPaymentMethodIdSchema,
122
- }),
123
- body: z.object({}),
124
- responses: {
125
- 200: IIssuerPaymentMethod,
126
- 401: UnauthorizedError,
127
- 403: ForbiddenError,
128
- 404: NotFoundError,
129
- 500: InternalError,
130
- },
131
- },
132
- },
133
- {
134
- pathPrefix: 'issuer-payment-methods',
135
- },
136
- );
@@ -1,38 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import {
3
- ForbiddenError,
4
- InternalError,
5
- UnauthorizedError,
6
- inquiryIdSchema,
7
- InquiryResponse,
8
- ServiceUnavailableError,
9
- } from '../../../common/types';
10
- import { z } from 'zod';
11
-
12
- const c = initContract();
13
-
14
- export const kycsContract = c.router(
15
- {
16
- getInquiry: {
17
- summary: 'KYC inquiry by ID',
18
- method: 'GET',
19
- path: '/inquiries/:inquiryId',
20
- metadata: {
21
- auth: true,
22
- },
23
- pathParams: z.object({
24
- inquiryId: inquiryIdSchema,
25
- }),
26
- responses: {
27
- 200: InquiryResponse,
28
- 401: UnauthorizedError,
29
- 403: ForbiddenError,
30
- 500: InternalError,
31
- 503: ServiceUnavailableError,
32
- },
33
- },
34
- },
35
- {
36
- pathPrefix: 'kycs',
37
- },
38
- );
@@ -1,51 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
-
3
- import {
4
- BadRequestError,
5
- ForbiddenError,
6
- UnauthorizedError,
7
- IListLoginHistories,
8
- userIdSchema,
9
- } from '../../../common/types';
10
- import { z } from 'zod';
11
-
12
- const c = initContract();
13
-
14
- export const loginHistoriesContract = c.router(
15
- {
16
- getLoginHistories: {
17
- summary: 'Get Login Histories',
18
- method: 'GET',
19
- path: '',
20
- metadata: {
21
- auth: true,
22
- },
23
- responses: {
24
- 200: IListLoginHistories,
25
- 400: BadRequestError,
26
- 401: UnauthorizedError,
27
- 403: ForbiddenError,
28
- },
29
- },
30
- getLoginHistoriesByUserId: {
31
- summary: 'Get Login Histories by User id',
32
- method: 'GET',
33
- path: '/:userId',
34
- metadata: {
35
- auth: true,
36
- },
37
- pathParams: z.object({
38
- userId: userIdSchema,
39
- }),
40
- responses: {
41
- 200: IListLoginHistories,
42
- 400: BadRequestError,
43
- 401: UnauthorizedError,
44
- 403: ForbiddenError,
45
- },
46
- },
47
- },
48
- {
49
- pathPrefix: 'login-histories',
50
- },
51
- );