@dalmore/api-contracts 0.0.0-dev.d8ef117 → 0.0.0-dev.e6235a7

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 (40) hide show
  1. package/common/types/account-contact.types.ts +2 -1
  2. package/common/types/account-manager.types.ts +3 -7
  3. package/common/types/account-setting.types.ts +65 -0
  4. package/common/types/account.types.ts +1 -0
  5. package/common/types/auth.types.ts +7 -18
  6. package/common/types/bonus-tier.types.ts +9 -0
  7. package/common/types/common.types.ts +32 -6
  8. package/common/types/contact-us.types.ts +6 -2
  9. package/common/types/covered-person.types.ts +2 -1
  10. package/common/types/dashboard.types.ts +2 -9
  11. package/common/types/escrow-account.types.ts +3 -3
  12. package/common/types/individuals.types.ts +3 -2
  13. package/common/types/investor-account.types.ts +2 -1
  14. package/common/types/invite.types.ts +27 -1
  15. package/common/types/issuer-offering.types.ts +11 -17
  16. package/common/types/legal-entity.types.ts +3 -2
  17. package/common/types/notification.types.ts +515 -29
  18. package/common/types/offering.types.ts +2 -9
  19. package/common/types/site-settings.types.ts +2 -1
  20. package/common/types/site.types.ts +2 -9
  21. package/common/types/{trade-line-item.type.ts → trade-line-item.types.ts} +2 -9
  22. package/common/types/trade.types.ts +1 -1
  23. package/common/types/trusted-contact.types.ts +7 -7
  24. package/common/types/user.types.ts +11 -32
  25. package/contracts/clients/trade-line-items/index.ts +1 -1
  26. package/contracts/clients/trades/index.ts +1 -1
  27. package/contracts/compliance/account-settings/index.ts +59 -0
  28. package/contracts/compliance/auth/index.ts +4 -3
  29. package/contracts/compliance/bonus-tiers/index.ts +2 -2
  30. package/contracts/compliance/index.ts +4 -0
  31. package/contracts/compliance/invites/index.ts +4 -12
  32. package/contracts/compliance/notification-channels/index.ts +251 -0
  33. package/contracts/compliance/trade-line-items/index.ts +1 -1
  34. package/contracts/investors/trade-line-items/index.ts +1 -1
  35. package/contracts/issuers/account-settings/index.ts +36 -0
  36. package/contracts/issuers/auth/index.ts +4 -3
  37. package/contracts/issuers/disbursements/index.ts +17 -17
  38. package/contracts/issuers/index.ts +4 -0
  39. package/contracts/issuers/notification-channels/index.ts +251 -0
  40. package/package.json +1 -1
@@ -117,23 +117,6 @@ export const disbursementsContract = c.router(
117
117
  },
118
118
  },
119
119
 
120
- getDisbursement: {
121
- summary: 'Get disbursement by id',
122
- method: 'GET',
123
- path: '/:id',
124
- metadata: {
125
- auth: true,
126
- },
127
- query: z.object({}).merge(DisbursementsIncludeQuery),
128
- pathParams: z.object({ id: disbursementIdSchema }),
129
- responses: {
130
- 200: DisbursementZod,
131
- 401: UnauthorizedError,
132
- 403: ForbiddenError,
133
- 404: NotFoundError,
134
- 500: InternalError,
135
- },
136
- },
137
120
  reviewDisbursements: {
138
121
  summary: 'Review Disbursements',
139
122
  method: 'POST',
@@ -182,6 +165,23 @@ export const disbursementsContract = c.router(
182
165
  500: InternalError,
183
166
  },
184
167
  },
168
+ getDisbursement: {
169
+ summary: 'Get disbursement by id',
170
+ method: 'GET',
171
+ path: '/:id',
172
+ metadata: {
173
+ auth: true,
174
+ },
175
+ query: z.object({}).merge(DisbursementsIncludeQuery),
176
+ pathParams: z.object({ id: disbursementIdSchema }),
177
+ responses: {
178
+ 200: DisbursementZod,
179
+ 401: UnauthorizedError,
180
+ 403: ForbiddenError,
181
+ 404: NotFoundError,
182
+ 500: InternalError,
183
+ },
184
+ },
185
185
  },
186
186
  {
187
187
  pathPrefix: 'disbursements',
@@ -2,7 +2,9 @@ import { initContract } from '@ts-rest/core';
2
2
  import { accountsContract } from './accounts';
3
3
  import { accountContactsContract } from './account-contacts';
4
4
  import { accountIntegrationsContract } from './account-integrations';
5
+ import { issuerAccountSettingsContract } from './account-settings';
5
6
  import { assetsContract } from './assets';
7
+ import { issuerNotificationChannelsContract } from './notification-channels';
6
8
  import { healthContract } from './health';
7
9
  import { issuerContract } from './issuer';
8
10
  import { authContract } from './auth';
@@ -57,6 +59,7 @@ export const issuersContract = c.router(
57
59
  accounts: accountsContract,
58
60
  accountContacts: accountContactsContract,
59
61
  accountIntegrations: accountIntegrationsContract,
62
+ accountSettings: issuerAccountSettingsContract,
60
63
  activities: activitiesContract,
61
64
  aic: aicContract,
62
65
  assets: assetsContract,
@@ -86,6 +89,7 @@ export const issuersContract = c.router(
86
89
  kycs: kycsContract,
87
90
  loginHistories: loginHistoriesContract,
88
91
  notes: issuerNotesContract,
92
+ notificationChannels: issuerNotificationChannelsContract,
89
93
  offerings: issuersOfferingsContract,
90
94
  pages: pagesContract,
91
95
  paymentMethods: paymentMethodsContract,
@@ -0,0 +1,251 @@
1
+ import { initContract } from '@ts-rest/core';
2
+ import { z } from 'zod';
3
+ import {
4
+ IssuerCreateChannelInputSchema,
5
+ CreateTriggerInputSchema,
6
+ IAvailableTriggersResponse,
7
+ INotificationChannelTriggerZod,
8
+ INotificationChannelZod,
9
+ INotificationRecordZod,
10
+ IPaginatedNotificationChannel,
11
+ IPaginatedNotificationRecord,
12
+ NotificationChannelFilters,
13
+ NotificationChannelsIncludeQuery,
14
+ notificationChannelIdSchema,
15
+ notificationChannelTriggerIdSchema,
16
+ NotificationRecordFilters,
17
+ NotificationRecordsIncludeQuery,
18
+ notificationRecordIdSchema,
19
+ UpdateChannelInputSchema,
20
+ } from '../../../common/types/notification.types';
21
+ import {
22
+ BadRequestError,
23
+ InternalError,
24
+ NotFoundError,
25
+ PaginationOptionsZod,
26
+ UnauthorizedError,
27
+ } from '../../../common/types';
28
+
29
+ const c = initContract();
30
+
31
+ export const issuerNotificationChannelsContract = c.router(
32
+ {
33
+ getChannels: {
34
+ summary: 'Get notification channels for current account',
35
+ method: 'GET',
36
+ path: '',
37
+ metadata: {
38
+ auth: true,
39
+ },
40
+ query: PaginationOptionsZod.merge(
41
+ NotificationChannelFilters.omit({ accountSettingsId: true }),
42
+ ).merge(NotificationChannelsIncludeQuery),
43
+ responses: {
44
+ 200: IPaginatedNotificationChannel,
45
+ 401: UnauthorizedError,
46
+ 500: InternalError,
47
+ },
48
+ },
49
+ getChannel: {
50
+ summary: 'Get notification channel by id',
51
+ method: 'GET',
52
+ path: '/:id',
53
+ metadata: {
54
+ auth: true,
55
+ },
56
+ pathParams: z.object({
57
+ id: notificationChannelIdSchema,
58
+ }),
59
+ query: z.object({}).merge(NotificationChannelsIncludeQuery),
60
+ responses: {
61
+ 200: INotificationChannelZod,
62
+ 401: UnauthorizedError,
63
+ 404: NotFoundError,
64
+ 500: InternalError,
65
+ },
66
+ },
67
+ createChannel: {
68
+ summary: 'Create notification channel for current account',
69
+ method: 'POST',
70
+ path: '',
71
+ metadata: {
72
+ auth: true,
73
+ },
74
+ body: IssuerCreateChannelInputSchema,
75
+ responses: {
76
+ 201: INotificationChannelZod,
77
+ 400: BadRequestError,
78
+ 401: UnauthorizedError,
79
+ 500: InternalError,
80
+ },
81
+ },
82
+ updateChannel: {
83
+ summary: 'Update notification channel',
84
+ method: 'PATCH',
85
+ path: '/:id',
86
+ metadata: {
87
+ auth: true,
88
+ },
89
+ pathParams: z.object({
90
+ id: notificationChannelIdSchema,
91
+ }),
92
+ body: UpdateChannelInputSchema,
93
+ responses: {
94
+ 200: INotificationChannelZod,
95
+ 400: BadRequestError,
96
+ 401: UnauthorizedError,
97
+ 404: NotFoundError,
98
+ 500: InternalError,
99
+ },
100
+ },
101
+ deleteChannel: {
102
+ summary: 'Delete notification channel',
103
+ method: 'DELETE',
104
+ path: '/:id',
105
+ metadata: {
106
+ auth: true,
107
+ },
108
+ pathParams: z.object({
109
+ id: notificationChannelIdSchema,
110
+ }),
111
+ body: z.object({}),
112
+ responses: {
113
+ 200: z.object({ success: z.boolean() }),
114
+ 401: UnauthorizedError,
115
+ 404: NotFoundError,
116
+ 500: InternalError,
117
+ },
118
+ },
119
+ createTrigger: {
120
+ summary: 'Create notification channel trigger',
121
+ method: 'POST',
122
+ path: '/:id/triggers',
123
+ metadata: {
124
+ auth: true,
125
+ },
126
+ pathParams: z.object({
127
+ id: notificationChannelIdSchema,
128
+ }),
129
+ body: CreateTriggerInputSchema.omit({ notificationChannelId: true }),
130
+ responses: {
131
+ 201: INotificationChannelTriggerZod,
132
+ 400: BadRequestError,
133
+ 401: UnauthorizedError,
134
+ 404: NotFoundError,
135
+ 500: InternalError,
136
+ },
137
+ },
138
+ getAvailableTriggers: {
139
+ summary: 'Get all available triggers for a channel',
140
+ method: 'GET',
141
+ path: '/:id/triggers/available',
142
+ metadata: {
143
+ auth: true,
144
+ },
145
+ pathParams: z.object({
146
+ id: notificationChannelIdSchema,
147
+ }),
148
+ responses: {
149
+ 200: IAvailableTriggersResponse,
150
+ 401: UnauthorizedError,
151
+ 404: NotFoundError,
152
+ 500: InternalError,
153
+ },
154
+ },
155
+ updateTrigger: {
156
+ summary: 'Update notification channel trigger',
157
+ method: 'PATCH',
158
+ path: '/:id/triggers/:triggerId',
159
+ metadata: {
160
+ auth: true,
161
+ },
162
+ pathParams: z.object({
163
+ id: notificationChannelIdSchema,
164
+ triggerId: notificationChannelTriggerIdSchema,
165
+ }),
166
+ body: z.object({ enabled: z.boolean() }),
167
+ responses: {
168
+ 200: INotificationChannelTriggerZod,
169
+ 400: BadRequestError,
170
+ 401: UnauthorizedError,
171
+ 404: NotFoundError,
172
+ 500: InternalError,
173
+ },
174
+ },
175
+ deleteTrigger: {
176
+ summary: 'Delete notification channel trigger',
177
+ method: 'DELETE',
178
+ path: '/:id/triggers/:triggerId',
179
+ metadata: {
180
+ auth: true,
181
+ },
182
+ pathParams: z.object({
183
+ id: notificationChannelIdSchema,
184
+ triggerId: notificationChannelTriggerIdSchema,
185
+ }),
186
+ body: z.object({}),
187
+ responses: {
188
+ 200: z.object({ success: z.boolean() }),
189
+ 401: UnauthorizedError,
190
+ 404: NotFoundError,
191
+ 500: InternalError,
192
+ },
193
+ },
194
+ getRecords: {
195
+ summary: 'Get notification records for current account',
196
+ method: 'GET',
197
+ path: '/records',
198
+ metadata: {
199
+ auth: true,
200
+ },
201
+ query: PaginationOptionsZod.merge(NotificationRecordFilters).merge(
202
+ NotificationRecordsIncludeQuery,
203
+ ),
204
+ responses: {
205
+ 200: IPaginatedNotificationRecord,
206
+ 401: UnauthorizedError,
207
+ 500: InternalError,
208
+ },
209
+ },
210
+ getRecord: {
211
+ summary: 'Get notification record by id',
212
+ method: 'GET',
213
+ path: '/records/:recordId',
214
+ metadata: {
215
+ auth: true,
216
+ },
217
+ pathParams: z.object({
218
+ recordId: notificationRecordIdSchema,
219
+ }),
220
+ query: z.object({}).merge(NotificationRecordsIncludeQuery),
221
+ responses: {
222
+ 200: INotificationRecordZod,
223
+ 401: UnauthorizedError,
224
+ 404: NotFoundError,
225
+ 500: InternalError,
226
+ },
227
+ },
228
+ retryRecord: {
229
+ summary: 'Retry failed notification record',
230
+ method: 'POST',
231
+ path: '/records/:recordId/retry',
232
+ metadata: {
233
+ auth: true,
234
+ },
235
+ pathParams: z.object({
236
+ recordId: notificationRecordIdSchema,
237
+ }),
238
+ body: z.object({}),
239
+ responses: {
240
+ 200: INotificationRecordZod,
241
+ 400: BadRequestError,
242
+ 401: UnauthorizedError,
243
+ 404: NotFoundError,
244
+ 500: InternalError,
245
+ },
246
+ },
247
+ },
248
+ {
249
+ pathPrefix: 'notification-channels',
250
+ },
251
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dalmore/api-contracts",
3
- "version": "0.0.0-dev.d8ef117",
3
+ "version": "0.0.0-dev.e6235a7",
4
4
  "description": "Type-safe API contracts for Dalmore Client Portal",
5
5
  "main": "./contracts/index.ts",
6
6
  "types": "./contracts/index.ts",