@dalmore/api-contracts 0.0.0-dev.d6badc9 → 0.0.0-dev.dc7fdf8

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 (190) 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/auth.types.ts +7 -18
  5. package/common/types/common.types.ts +22 -0
  6. package/common/types/comply-advantage-api.types.ts +3 -3
  7. package/common/types/contact-us.types.ts +6 -2
  8. package/common/types/covered-person.types.ts +2 -1
  9. package/common/types/escrow-account.types.ts +3 -3
  10. package/common/types/individuals.types.ts +3 -2
  11. package/common/types/investor-account.types.ts +2 -1
  12. package/common/types/invite.types.ts +27 -1
  13. package/common/types/legal-entity.types.ts +3 -2
  14. package/common/types/mail-template.types.ts +34 -0
  15. package/common/types/note.types.ts +1 -1
  16. package/common/types/notification.types.ts +10 -0
  17. package/common/types/site-settings.types.ts +2 -1
  18. package/common/types/trade.types.ts +49 -1
  19. package/common/types/trusted-contact.types.ts +7 -7
  20. package/common/types/user.types.ts +2 -5
  21. package/common/types/webhook.types.ts +142 -0
  22. package/index.ts +10 -0
  23. package/package.json +23 -32
  24. package/contracts/compliance/account-contacts/index.ts +0 -82
  25. package/contracts/compliance/account-managers/index.ts +0 -142
  26. package/contracts/compliance/account-settings/index.ts +0 -59
  27. package/contracts/compliance/accounts/index.ts +0 -187
  28. package/contracts/compliance/activities/index.ts +0 -55
  29. package/contracts/compliance/aic/index.ts +0 -60
  30. package/contracts/compliance/api-keys/index.ts +0 -91
  31. package/contracts/compliance/assets/index.ts +0 -122
  32. package/contracts/compliance/auth/index.ts +0 -134
  33. package/contracts/compliance/batch-jobs/index.ts +0 -62
  34. package/contracts/compliance/bonus-tiers/index.ts +0 -74
  35. package/contracts/compliance/checklist/index.ts +0 -87
  36. package/contracts/compliance/checklist-items/index.ts +0 -86
  37. package/contracts/compliance/covered-persons/index.ts +0 -97
  38. package/contracts/compliance/dashboard/index.ts +0 -111
  39. package/contracts/compliance/data-records/index.ts +0 -116
  40. package/contracts/compliance/data-rooms/index.ts +0 -113
  41. package/contracts/compliance/default-theme-configs/index.ts +0 -95
  42. package/contracts/compliance/disbursement/index.ts +0 -165
  43. package/contracts/compliance/disbursement-approval-users/index.ts +0 -84
  44. package/contracts/compliance/disbursement-transactions/index.ts +0 -37
  45. package/contracts/compliance/domain-filters/index.ts +0 -117
  46. package/contracts/compliance/email-themes/index.ts +0 -284
  47. package/contracts/compliance/escrow-accounts/index.ts +0 -85
  48. package/contracts/compliance/exchange-api-keys/index.ts +0 -129
  49. package/contracts/compliance/exchange-imports/index.ts +0 -137
  50. package/contracts/compliance/files/index.ts +0 -267
  51. package/contracts/compliance/files-public/index.ts +0 -188
  52. package/contracts/compliance/health/index.ts +0 -26
  53. package/contracts/compliance/index.ts +0 -151
  54. package/contracts/compliance/individuals/index.ts +0 -57
  55. package/contracts/compliance/investor-accounts/index.ts +0 -141
  56. package/contracts/compliance/invites/index.ts +0 -137
  57. package/contracts/compliance/issuer-bank-accounts/index.ts +0 -81
  58. package/contracts/compliance/issuer-payment-methods/index.ts +0 -81
  59. package/contracts/compliance/issuers/index.ts +0 -97
  60. package/contracts/compliance/job-items/index.ts +0 -58
  61. package/contracts/compliance/jobs/index.ts +0 -59
  62. package/contracts/compliance/kyb/index.ts +0 -54
  63. package/contracts/compliance/kyc/index.ts +0 -77
  64. package/contracts/compliance/legal-entities/index.ts +0 -57
  65. package/contracts/compliance/login-histories/index.ts +0 -37
  66. package/contracts/compliance/notes/index.ts +0 -69
  67. package/contracts/compliance/notification-channels/index.ts +0 -251
  68. package/contracts/compliance/notion-databases/index.ts +0 -107
  69. package/contracts/compliance/notion-pages/index.ts +0 -105
  70. package/contracts/compliance/offering-reports/index.ts +0 -149
  71. package/contracts/compliance/offerings/index.ts +0 -233
  72. package/contracts/compliance/pages/index.ts +0 -178
  73. package/contracts/compliance/payment-methods/index.ts +0 -57
  74. package/contracts/compliance/rejection-reasons/index.ts +0 -32
  75. package/contracts/compliance/review/index.ts +0 -169
  76. package/contracts/compliance/roles/index.ts +0 -34
  77. package/contracts/compliance/secondary-customers/index.ts +0 -77
  78. package/contracts/compliance/secondary-orders/index.ts +0 -60
  79. package/contracts/compliance/secondary-trades/index.ts +0 -100
  80. package/contracts/compliance/secure-requests/index.ts +0 -54
  81. package/contracts/compliance/signer/index.ts +0 -369
  82. package/contracts/compliance/site-links/index.ts +0 -128
  83. package/contracts/compliance/site-settings/index.ts +0 -669
  84. package/contracts/compliance/sites/index.ts +0 -56
  85. package/contracts/compliance/state-machine/index.ts +0 -94
  86. package/contracts/compliance/tasks/index.ts +0 -91
  87. package/contracts/compliance/third-parties/index.ts +0 -52
  88. package/contracts/compliance/trade-line-items/index.ts +0 -59
  89. package/contracts/compliance/trades/index.ts +0 -230
  90. package/contracts/compliance/transactions/index.ts +0 -161
  91. package/contracts/compliance/user-manuals/index.ts +0 -271
  92. package/contracts/compliance/user-settings/index.ts +0 -189
  93. package/contracts/compliance/users/index.ts +0 -221
  94. package/contracts/compliance/webhooks/index.ts +0 -41
  95. package/contracts/compliance-apikey/accounts/index.ts +0 -58
  96. package/contracts/compliance-apikey/index.ts +0 -14
  97. package/contracts/index.ts +0 -6
  98. package/contracts/investors/account-contacts/index.ts +0 -58
  99. package/contracts/investors/aic/index.ts +0 -59
  100. package/contracts/investors/assets/index.ts +0 -61
  101. package/contracts/investors/auth/index.ts +0 -116
  102. package/contracts/investors/bonus-tiers/index.ts +0 -55
  103. package/contracts/investors/cart/index.ts +0 -75
  104. package/contracts/investors/contact-us/index.ts +0 -48
  105. package/contracts/investors/data-records/index.ts +0 -113
  106. package/contracts/investors/data-rooms/index.ts +0 -96
  107. package/contracts/investors/files/index.ts +0 -167
  108. package/contracts/investors/files-public/index.ts +0 -185
  109. package/contracts/investors/index.ts +0 -72
  110. package/contracts/investors/individuals/index.ts +0 -121
  111. package/contracts/investors/investor-accounts/index.ts +0 -110
  112. package/contracts/investors/issuer-payment-methods/index.ts +0 -36
  113. package/contracts/investors/issuers/index.ts +0 -30
  114. package/contracts/investors/legal-entities/index.ts +0 -93
  115. package/contracts/investors/notes/index.ts +0 -69
  116. package/contracts/investors/offerings/index.ts +0 -93
  117. package/contracts/investors/pages/index.ts +0 -88
  118. package/contracts/investors/payment-methods/index.ts +0 -149
  119. package/contracts/investors/portfolios/index.ts +0 -53
  120. package/contracts/investors/sites/index.ts +0 -96
  121. package/contracts/investors/tasks/index.ts +0 -111
  122. package/contracts/investors/trade-line-items/index.ts +0 -75
  123. package/contracts/investors/trades/index.ts +0 -114
  124. package/contracts/investors/transactions/index.ts +0 -37
  125. package/contracts/investors/trusted-contacts/index.ts +0 -93
  126. package/contracts/investors/user-manuals/index.ts +0 -62
  127. package/contracts/investors/user-settings/index.ts +0 -170
  128. package/contracts/investors/users/index.ts +0 -45
  129. package/contracts/investors/webhooks/index.ts +0 -30
  130. package/contracts/issuers/account-contacts/index.ts +0 -76
  131. package/contracts/issuers/account-integrations/index.ts +0 -97
  132. package/contracts/issuers/account-settings/index.ts +0 -36
  133. package/contracts/issuers/accounts/index.ts +0 -97
  134. package/contracts/issuers/activities/index.ts +0 -54
  135. package/contracts/issuers/aic/index.ts +0 -39
  136. package/contracts/issuers/api-key-logs/index.ts +0 -53
  137. package/contracts/issuers/api-keys/index.ts +0 -93
  138. package/contracts/issuers/assets/index.ts +0 -122
  139. package/contracts/issuers/auth/index.ts +0 -152
  140. package/contracts/issuers/bonus-tiers/index.ts +0 -73
  141. package/contracts/issuers/contact-us/index.ts +0 -48
  142. package/contracts/issuers/covered-persons/index.ts +0 -136
  143. package/contracts/issuers/dashboard/index.ts +0 -72
  144. package/contracts/issuers/data-records/index.ts +0 -257
  145. package/contracts/issuers/data-rooms/index.ts +0 -134
  146. package/contracts/issuers/disbursement-approval-users/index.ts +0 -82
  147. package/contracts/issuers/disbursement-transactions/index.ts +0 -53
  148. package/contracts/issuers/disbursements/index.ts +0 -189
  149. package/contracts/issuers/email-themes/index.ts +0 -242
  150. package/contracts/issuers/escrow-accounts/index.ts +0 -81
  151. package/contracts/issuers/exchange-api-keys/index.ts +0 -144
  152. package/contracts/issuers/files/index.ts +0 -166
  153. package/contracts/issuers/files-public/index.ts +0 -166
  154. package/contracts/issuers/health/index.ts +0 -24
  155. package/contracts/issuers/index.ts +0 -116
  156. package/contracts/issuers/investor-accounts/index.ts +0 -148
  157. package/contracts/issuers/invites/index.ts +0 -129
  158. package/contracts/issuers/issuer/index.ts +0 -94
  159. package/contracts/issuers/issuer-bank-accounts/index.ts +0 -81
  160. package/contracts/issuers/issuer-payment-methods/index.ts +0 -136
  161. package/contracts/issuers/kyc/index.ts +0 -38
  162. package/contracts/issuers/login-histories/index.ts +0 -51
  163. package/contracts/issuers/notes/index.ts +0 -69
  164. package/contracts/issuers/notification-channels/index.ts +0 -251
  165. package/contracts/issuers/offerings/index.ts +0 -206
  166. package/contracts/issuers/pages/index.ts +0 -138
  167. package/contracts/issuers/payment-methods/index.ts +0 -61
  168. package/contracts/issuers/portfolios/index.ts +0 -36
  169. package/contracts/issuers/rejection-reasons/index.ts +0 -32
  170. package/contracts/issuers/review/index.ts +0 -63
  171. package/contracts/issuers/secondary-customers/index.ts +0 -55
  172. package/contracts/issuers/secondary-orders/index.ts +0 -57
  173. package/contracts/issuers/secondary-trades/index.ts +0 -57
  174. package/contracts/issuers/secure-requests/index.ts +0 -34
  175. package/contracts/issuers/site-links/index.ts +0 -116
  176. package/contracts/issuers/site-settings/index.ts +0 -585
  177. package/contracts/issuers/sites/index.ts +0 -32
  178. package/contracts/issuers/tasks/index.ts +0 -111
  179. package/contracts/issuers/trades/index.ts +0 -132
  180. package/contracts/issuers/transactions/index.ts +0 -158
  181. package/contracts/issuers/user-manuals/index.ts +0 -62
  182. package/contracts/issuers/user-settings/index.ts +0 -170
  183. package/contracts/issuers/users/index.ts +0 -126
  184. package/contracts/secondaries/accounts/index.ts +0 -58
  185. package/contracts/secondaries/index.ts +0 -23
  186. package/contracts/secondaries/secondary-customers/index.ts +0 -55
  187. package/contracts/secondaries/secondary-issuers/index.ts +0 -94
  188. package/contracts/secondaries/secondary-orders/index.ts +0 -56
  189. package/contracts/secondaries/secondary-securities/index.ts +0 -95
  190. package/contracts/secondaries/secondary-trades/index.ts +0 -56
@@ -1,77 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import {
3
- ForbiddenError,
4
- IPaginatedKyc,
5
- NotFoundError,
6
- PaginationOptionsZod,
7
- UnauthorizedError,
8
- KycZod,
9
- KycFiltersZod,
10
- kycIdSchema,
11
- InternalError,
12
- inquiryIdSchema,
13
- ServiceUnavailableError,
14
- KycTimelineResponse,
15
- } from '../../../common/types';
16
- import { z } from 'zod';
17
-
18
- const c = initContract();
19
-
20
- export const kycsContract = c.router(
21
- {
22
- getKyc: {
23
- summary: 'Get kyc by id',
24
- method: 'GET',
25
- path: '/:id',
26
- metadata: {
27
- auth: true,
28
- },
29
- query: z.object({}).merge(KycFiltersZod),
30
- pathParams: z.object({
31
- id: kycIdSchema,
32
- }),
33
- responses: {
34
- 200: KycZod,
35
- 401: UnauthorizedError,
36
- 403: ForbiddenError,
37
- 404: NotFoundError,
38
- },
39
- },
40
- getKycs: {
41
- summary: 'Get kycs',
42
- method: 'GET',
43
- path: '',
44
- metadata: {
45
- auth: true,
46
- },
47
- query: PaginationOptionsZod.merge(KycFiltersZod),
48
- responses: {
49
- 200: IPaginatedKyc,
50
- 401: UnauthorizedError,
51
- 403: ForbiddenError,
52
- },
53
- },
54
- getInquiry: {
55
- summary: 'Get KYC inquiry',
56
- method: 'GET',
57
- path: '/inquiries/:inquiryId',
58
- metadata: {
59
- auth: true,
60
- },
61
- pathParams: z.object({
62
- inquiryId: inquiryIdSchema,
63
- }),
64
- responses: {
65
- 200: KycTimelineResponse,
66
- 401: UnauthorizedError,
67
- 403: ForbiddenError,
68
- 404: NotFoundError,
69
- 500: InternalError,
70
- 503: ServiceUnavailableError,
71
- },
72
- },
73
- },
74
- {
75
- pathPrefix: 'kycs',
76
- },
77
- );
@@ -1,57 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import {
3
- ForbiddenError,
4
- IPaginatedLegalEntity,
5
- NotFoundError,
6
- PaginationOptionsZod,
7
- UnauthorizedError,
8
- LegalEntityFiltersZod,
9
- LegalEntitiesIncludeQuery,
10
- LegalEntityZod,
11
- legalEntityIdSchema,
12
- } from '../../../common/types';
13
- import { z } from 'zod';
14
-
15
- const c = initContract();
16
-
17
- export const legalEntitiesContract = c.router(
18
- {
19
- getLegalEntity: {
20
- summary: 'Get legalEntity by id',
21
- method: 'GET',
22
- path: '/:id',
23
- metadata: {
24
- auth: true,
25
- },
26
- query: z.object({}).merge(LegalEntitiesIncludeQuery),
27
- pathParams: z.object({
28
- id: legalEntityIdSchema,
29
- }),
30
- responses: {
31
- 200: LegalEntityZod,
32
- 401: UnauthorizedError,
33
- 403: ForbiddenError,
34
- 404: NotFoundError,
35
- },
36
- },
37
- getLegalEntities: {
38
- summary: 'Get legalEntities',
39
- method: 'GET',
40
- path: '',
41
- metadata: {
42
- auth: true,
43
- },
44
- query: PaginationOptionsZod.merge(LegalEntityFiltersZod).merge(
45
- LegalEntitiesIncludeQuery,
46
- ),
47
- responses: {
48
- 200: IPaginatedLegalEntity,
49
- 401: UnauthorizedError,
50
- 403: ForbiddenError,
51
- },
52
- },
53
- },
54
- {
55
- pathPrefix: 'legal-entities',
56
- },
57
- );
@@ -1,37 +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
- getLoginHistoriesByUserId: {
17
- summary: 'Get Login Histories by User id',
18
- method: 'GET',
19
- path: '/:userId',
20
- metadata: {
21
- auth: true,
22
- },
23
- pathParams: z.object({
24
- userId: userIdSchema,
25
- }),
26
- responses: {
27
- 200: IListLoginHistories,
28
- 400: BadRequestError,
29
- 401: UnauthorizedError,
30
- 403: ForbiddenError,
31
- },
32
- },
33
- },
34
- {
35
- pathPrefix: 'login-histories',
36
- },
37
- );
@@ -1,69 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import {
3
- BadRequestError,
4
- CompliancePostNoteBody,
5
- InternalError,
6
- IPaginatedNote,
7
- noteIdSchema,
8
- NotesFilters,
9
- NoteZod,
10
- NotFoundError,
11
- PaginationOptionsZod,
12
- UnauthorizedError,
13
- } from '../../../common/types';
14
- import { z } from 'zod';
15
-
16
- const c = initContract();
17
-
18
- export const notesContract = c.router(
19
- {
20
- postNote: {
21
- summary: 'Create a note',
22
- method: 'POST',
23
- path: '',
24
- metadata: {
25
- auth: true,
26
- },
27
- body: CompliancePostNoteBody,
28
- responses: {
29
- 201: NoteZod,
30
- 400: BadRequestError,
31
- 401: UnauthorizedError,
32
- 404: NotFoundError,
33
- 500: InternalError,
34
- },
35
- },
36
- getNotes: {
37
- summary: 'Get notes',
38
- method: 'GET',
39
- path: '',
40
- metadata: {
41
- auth: true,
42
- },
43
- query: PaginationOptionsZod.merge(NotesFilters),
44
- responses: {
45
- 200: IPaginatedNote,
46
- 401: UnauthorizedError,
47
- },
48
- },
49
- getNote: {
50
- summary: 'Get note by id',
51
- method: 'GET',
52
- path: '/:id',
53
- metadata: {
54
- auth: true,
55
- },
56
- pathParams: z.object({
57
- id: noteIdSchema,
58
- }),
59
- responses: {
60
- 200: NoteZod,
61
- 401: UnauthorizedError,
62
- 404: NotFoundError,
63
- },
64
- },
65
- },
66
- {
67
- pathPrefix: 'notes',
68
- },
69
- );
@@ -1,251 +0,0 @@
1
- import { initContract } from '@ts-rest/core';
2
- import { z } from 'zod';
3
- import {
4
- CreateChannelInputSchema,
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 notificationChannelsContract = c.router(
32
- {
33
- getChannels: {
34
- summary: 'Get notification channels',
35
- method: 'GET',
36
- path: '',
37
- metadata: {
38
- auth: true,
39
- },
40
- query: PaginationOptionsZod.merge(NotificationChannelFilters).merge(
41
- NotificationChannelsIncludeQuery,
42
- ),
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',
69
- method: 'POST',
70
- path: '',
71
- metadata: {
72
- auth: true,
73
- },
74
- body: CreateChannelInputSchema,
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',
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
- );
@@ -1,107 +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
- NotionDatabaseZod,
13
- IPaginatedNotionDatabases,
14
- NotionDatabaseFiltersZod,
15
- NotionDatabaseIncludeQuery,
16
- PostNotionDatabaseSchema,
17
- UpdateNotionDatabaseSchema,
18
- notionDatabaseIdSchema,
19
- TriggerNotionDatabaseSync,
20
- } from '../../../common/types/notion-database.types';
21
-
22
- const c = initContract();
23
-
24
- export const notionDatabasesContract = c.router(
25
- {
26
- getNotionDatabases: {
27
- summary: 'Get all notion databases',
28
- method: 'GET',
29
- path: '',
30
- metadata: {
31
- auth: true,
32
- },
33
- query: PaginationOptionsZod.merge(NotionDatabaseFiltersZod).merge(
34
- NotionDatabaseIncludeQuery,
35
- ),
36
- responses: {
37
- 200: IPaginatedNotionDatabases,
38
- 400: BadRequestError,
39
- 401: UnauthorizedError,
40
- 403: ForbiddenError,
41
- 500: InternalError,
42
- },
43
- },
44
-
45
- createNotionDatabase: {
46
- summary: 'Create a new notion database',
47
- method: 'POST',
48
- path: '',
49
- metadata: {
50
- auth: true,
51
- },
52
- body: PostNotionDatabaseSchema,
53
- responses: {
54
- 201: NotionDatabaseZod,
55
- 400: BadRequestError,
56
- 401: UnauthorizedError,
57
- 403: ForbiddenError,
58
- 500: InternalError,
59
- },
60
- },
61
-
62
- updateNotionDatabase: {
63
- summary: 'Update a notion database',
64
- method: 'PUT',
65
- path: '/:id',
66
- metadata: {
67
- auth: true,
68
- },
69
- pathParams: z.object({
70
- id: notionDatabaseIdSchema,
71
- }),
72
- body: UpdateNotionDatabaseSchema,
73
- responses: {
74
- 200: NotionDatabaseZod,
75
- 400: BadRequestError,
76
- 401: UnauthorizedError,
77
- 403: ForbiddenError,
78
- 404: NotFoundError,
79
- 500: InternalError,
80
- },
81
- },
82
-
83
- triggerNotionDatabaseSync: {
84
- summary: '[ADMIN] Trigger sync for a notion database',
85
- method: 'POST',
86
- path: '/:id/sync',
87
- metadata: {
88
- auth: true,
89
- },
90
- body: TriggerNotionDatabaseSync,
91
- pathParams: z.object({
92
- id: notionDatabaseIdSchema,
93
- }),
94
- responses: {
95
- 200: NotionDatabaseZod,
96
- 400: BadRequestError,
97
- 401: UnauthorizedError,
98
- 403: ForbiddenError,
99
- 404: NotFoundError,
100
- 500: InternalError,
101
- },
102
- },
103
- },
104
- {
105
- pathPrefix: 'notion-databases',
106
- },
107
- );
@@ -1,105 +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
- NotionPageZod,
13
- IPaginatedNotionPages,
14
- NotionPageFiltersZod,
15
- UpdateNotionPageSchema,
16
- notionPageIdSchema,
17
- NotionPageIncludeQuery,
18
- NotionPageDropdownZod,
19
- NotionPageContentResponseSchema,
20
- } from '../../../common/types/notion-page.types';
21
-
22
- const c = initContract();
23
-
24
- export const notionPagesContract = c.router(
25
- {
26
- getNotionPages: {
27
- summary: 'Get all notion pages',
28
- method: 'GET',
29
- path: '',
30
- metadata: {
31
- auth: true,
32
- },
33
- query: PaginationOptionsZod.merge(NotionPageFiltersZod).merge(
34
- NotionPageIncludeQuery,
35
- ),
36
- responses: {
37
- 200: IPaginatedNotionPages,
38
- 400: BadRequestError,
39
- 401: UnauthorizedError,
40
- 403: ForbiddenError,
41
- 500: InternalError,
42
- },
43
- },
44
-
45
- getNotionPagesDropdown: {
46
- summary: 'Get notion pages dropdown data',
47
- method: 'GET',
48
- path: '/dropdown',
49
- metadata: {
50
- auth: true,
51
- },
52
- responses: {
53
- 200: z.array(NotionPageDropdownZod),
54
- 400: BadRequestError,
55
- 401: UnauthorizedError,
56
- 403: ForbiddenError,
57
- 500: InternalError,
58
- },
59
- },
60
-
61
- updateNotionPage: {
62
- summary: 'Update a notion page',
63
- method: 'PUT',
64
- path: '/:id',
65
- metadata: {
66
- auth: true,
67
- },
68
- pathParams: z.object({
69
- id: notionPageIdSchema,
70
- }),
71
- body: UpdateNotionPageSchema,
72
- responses: {
73
- 200: NotionPageZod,
74
- 400: BadRequestError,
75
- 401: UnauthorizedError,
76
- 403: ForbiddenError,
77
- 404: NotFoundError,
78
- 500: InternalError,
79
- },
80
- },
81
-
82
- getNotionPageContent: {
83
- summary: 'Get a notion page content',
84
- method: 'GET',
85
- path: '/:id/content',
86
- metadata: {
87
- auth: true,
88
- },
89
- pathParams: z.object({
90
- id: notionPageIdSchema,
91
- }),
92
- responses: {
93
- 200: NotionPageContentResponseSchema,
94
- 400: BadRequestError,
95
- 401: UnauthorizedError,
96
- 403: ForbiddenError,
97
- 404: NotFoundError,
98
- 500: InternalError,
99
- },
100
- },
101
- },
102
- {
103
- pathPrefix: 'notion-pages',
104
- },
105
- );