@dalmore/api-contracts 0.0.0-dev.785b227 → 0.0.0-dev.801385

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 (60) 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/activity.types.ts +1 -1
  6. package/common/types/auth.types.ts +7 -18
  7. package/common/types/bonus-tier.types.ts +33 -0
  8. package/common/types/cart.types.ts +4 -1
  9. package/common/types/common.types.ts +38 -6
  10. package/common/types/contact-us.types.ts +6 -2
  11. package/common/types/covered-person.types.ts +2 -1
  12. package/common/types/dashboard.types.ts +2 -9
  13. package/common/types/disbursements.types.ts +119 -3
  14. package/common/types/escrow-account.types.ts +3 -3
  15. package/common/types/file.types.ts +20 -4
  16. package/common/types/i-will-do-it-later.types.ts +68 -0
  17. package/common/types/index.ts +2 -0
  18. package/common/types/individuals.types.ts +5 -17
  19. package/common/types/investor-account.types.ts +2 -1
  20. package/common/types/invite.types.ts +27 -1
  21. package/common/types/issuer-offering.types.ts +13 -17
  22. package/common/types/issuer-payment-method.types.ts +41 -0
  23. package/common/types/issuer.types.ts +9 -0
  24. package/common/types/legal-entity.types.ts +3 -2
  25. package/common/types/note.types.ts +1 -1
  26. package/common/types/notification.types.ts +515 -29
  27. package/common/types/offering.types.ts +4 -9
  28. package/common/types/site-settings.types.ts +2 -1
  29. package/common/types/site.types.ts +2 -9
  30. package/common/types/{trade-line-item.type.ts → trade-line-item.types.ts} +2 -9
  31. package/common/types/trade.types.ts +48 -2
  32. package/common/types/transaction.types.ts +12 -1
  33. package/common/types/trusted-contact.types.ts +7 -7
  34. package/common/types/user.types.ts +17 -33
  35. package/contracts/clients/cart/index.ts +21 -1
  36. package/contracts/clients/index.ts +6 -0
  37. package/contracts/clients/issuer-payment-methods/index.ts +39 -0
  38. package/contracts/clients/payment-methods/index.ts +85 -0
  39. package/contracts/clients/trade-line-items/index.ts +1 -1
  40. package/contracts/clients/trades/index.ts +1 -1
  41. package/contracts/clients/transactions/index.ts +37 -0
  42. package/contracts/compliance/account-settings/index.ts +59 -0
  43. package/contracts/compliance/auth/index.ts +4 -3
  44. package/contracts/compliance/bonus-tiers/index.ts +21 -2
  45. package/contracts/compliance/index.ts +4 -0
  46. package/contracts/compliance/invites/index.ts +4 -12
  47. package/contracts/compliance/notification-channels/index.ts +251 -0
  48. package/contracts/compliance/trade-line-items/index.ts +1 -1
  49. package/contracts/compliance/trades/index.ts +19 -0
  50. package/contracts/compliance/users/index.ts +21 -0
  51. package/contracts/investors/bonus-tiers/index.ts +18 -0
  52. package/contracts/investors/individuals/index.ts +22 -0
  53. package/contracts/investors/trade-line-items/index.ts +1 -1
  54. package/contracts/issuers/account-settings/index.ts +36 -0
  55. package/contracts/issuers/auth/index.ts +4 -3
  56. package/contracts/issuers/bonus-tiers/index.ts +18 -0
  57. package/contracts/issuers/disbursements/index.ts +48 -12
  58. package/contracts/issuers/index.ts +4 -0
  59. package/contracts/issuers/notification-channels/index.ts +251 -0
  60. package/package.json +1 -1
@@ -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.785b227",
3
+ "version": "0.0.0-dev.801385",
4
4
  "description": "Type-safe API contracts for Dalmore Client Portal",
5
5
  "main": "./contracts/index.ts",
6
6
  "types": "./contracts/index.ts",