@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.
- package/README.md +23 -19
- package/common/types/account-contact.types.ts +2 -1
- package/common/types/account-manager.types.ts +3 -7
- package/common/types/account-setting.types.ts +65 -0
- package/common/types/account.types.ts +1 -0
- package/common/types/activity.types.ts +1 -1
- package/common/types/auth.types.ts +7 -18
- package/common/types/bonus-tier.types.ts +33 -0
- package/common/types/cart.types.ts +4 -1
- package/common/types/common.types.ts +38 -6
- package/common/types/contact-us.types.ts +6 -2
- package/common/types/covered-person.types.ts +2 -1
- package/common/types/dashboard.types.ts +2 -9
- package/common/types/disbursements.types.ts +119 -3
- package/common/types/escrow-account.types.ts +3 -3
- package/common/types/file.types.ts +17 -1
- package/common/types/i-will-do-it-later.types.ts +68 -0
- package/common/types/index.ts +2 -0
- package/common/types/individuals.types.ts +5 -17
- package/common/types/investor-account.types.ts +2 -1
- package/common/types/invite.types.ts +27 -1
- package/common/types/issuer-offering.types.ts +13 -17
- package/common/types/issuer-payment-method.types.ts +41 -0
- package/common/types/issuer.types.ts +9 -0
- package/common/types/legal-entity.types.ts +3 -2
- package/common/types/mail-template.types.ts +34 -0
- package/common/types/note.types.ts +1 -1
- package/common/types/notification.types.ts +525 -29
- package/common/types/offering.types.ts +4 -9
- package/common/types/site-settings.types.ts +2 -1
- package/common/types/site.types.ts +2 -9
- package/common/types/{trade-line-item.type.ts → trade-line-item.types.ts} +2 -9
- package/common/types/trade.types.ts +48 -2
- package/common/types/transaction.types.ts +12 -1
- package/common/types/trusted-contact.types.ts +7 -7
- package/common/types/user.types.ts +17 -33
- package/contracts/clients/cart/index.ts +21 -1
- package/contracts/clients/index.ts +6 -0
- package/contracts/{investors → clients}/issuer-payment-methods/index.ts +5 -2
- package/contracts/{compliance → clients}/payment-methods/index.ts +40 -12
- package/contracts/clients/trade-line-items/index.ts +1 -1
- package/contracts/clients/trades/index.ts +1 -1
- package/contracts/{investors → clients}/transactions/index.ts +3 -3
- package/index.ts +10 -0
- package/package.json +23 -32
- package/contracts/compliance/account-contacts/index.ts +0 -82
- package/contracts/compliance/account-managers/index.ts +0 -142
- package/contracts/compliance/accounts/index.ts +0 -187
- package/contracts/compliance/activities/index.ts +0 -55
- package/contracts/compliance/aic/index.ts +0 -60
- package/contracts/compliance/api-keys/index.ts +0 -91
- package/contracts/compliance/assets/index.ts +0 -122
- package/contracts/compliance/auth/index.ts +0 -134
- package/contracts/compliance/batch-jobs/index.ts +0 -62
- package/contracts/compliance/bonus-tiers/index.ts +0 -55
- package/contracts/compliance/checklist/index.ts +0 -87
- package/contracts/compliance/checklist-items/index.ts +0 -86
- package/contracts/compliance/covered-persons/index.ts +0 -97
- package/contracts/compliance/dashboard/index.ts +0 -111
- package/contracts/compliance/data-records/index.ts +0 -116
- package/contracts/compliance/data-rooms/index.ts +0 -113
- package/contracts/compliance/default-theme-configs/index.ts +0 -95
- package/contracts/compliance/disbursement/index.ts +0 -165
- package/contracts/compliance/disbursement-approval-users/index.ts +0 -84
- package/contracts/compliance/disbursement-transactions/index.ts +0 -37
- package/contracts/compliance/domain-filters/index.ts +0 -117
- package/contracts/compliance/email-themes/index.ts +0 -284
- package/contracts/compliance/escrow-accounts/index.ts +0 -85
- package/contracts/compliance/exchange-api-keys/index.ts +0 -129
- package/contracts/compliance/exchange-imports/index.ts +0 -137
- package/contracts/compliance/files/index.ts +0 -267
- package/contracts/compliance/files-public/index.ts +0 -188
- package/contracts/compliance/health/index.ts +0 -26
- package/contracts/compliance/index.ts +0 -147
- package/contracts/compliance/individuals/index.ts +0 -57
- package/contracts/compliance/investor-accounts/index.ts +0 -141
- package/contracts/compliance/invites/index.ts +0 -137
- package/contracts/compliance/issuer-bank-accounts/index.ts +0 -81
- package/contracts/compliance/issuer-payment-methods/index.ts +0 -81
- package/contracts/compliance/issuers/index.ts +0 -97
- package/contracts/compliance/job-items/index.ts +0 -58
- package/contracts/compliance/jobs/index.ts +0 -59
- package/contracts/compliance/kyb/index.ts +0 -54
- package/contracts/compliance/kyc/index.ts +0 -77
- package/contracts/compliance/legal-entities/index.ts +0 -57
- package/contracts/compliance/login-histories/index.ts +0 -37
- package/contracts/compliance/notes/index.ts +0 -69
- package/contracts/compliance/notion-databases/index.ts +0 -107
- package/contracts/compliance/notion-pages/index.ts +0 -105
- package/contracts/compliance/offering-reports/index.ts +0 -149
- package/contracts/compliance/offerings/index.ts +0 -233
- package/contracts/compliance/pages/index.ts +0 -178
- package/contracts/compliance/rejection-reasons/index.ts +0 -32
- package/contracts/compliance/review/index.ts +0 -169
- package/contracts/compliance/roles/index.ts +0 -34
- package/contracts/compliance/secondary-customers/index.ts +0 -77
- package/contracts/compliance/secondary-orders/index.ts +0 -60
- package/contracts/compliance/secondary-trades/index.ts +0 -100
- package/contracts/compliance/secure-requests/index.ts +0 -54
- package/contracts/compliance/signer/index.ts +0 -369
- package/contracts/compliance/site-links/index.ts +0 -128
- package/contracts/compliance/site-settings/index.ts +0 -669
- package/contracts/compliance/sites/index.ts +0 -56
- package/contracts/compliance/state-machine/index.ts +0 -94
- package/contracts/compliance/tasks/index.ts +0 -91
- package/contracts/compliance/third-parties/index.ts +0 -52
- package/contracts/compliance/trade-line-items/index.ts +0 -59
- package/contracts/compliance/trades/index.ts +0 -230
- package/contracts/compliance/transactions/index.ts +0 -161
- package/contracts/compliance/user-manuals/index.ts +0 -271
- package/contracts/compliance/user-settings/index.ts +0 -189
- package/contracts/compliance/users/index.ts +0 -200
- package/contracts/compliance/webhooks/index.ts +0 -41
- package/contracts/compliance-apikey/accounts/index.ts +0 -58
- package/contracts/compliance-apikey/index.ts +0 -14
- package/contracts/index.ts +0 -6
- package/contracts/investors/account-contacts/index.ts +0 -58
- package/contracts/investors/aic/index.ts +0 -59
- package/contracts/investors/assets/index.ts +0 -61
- package/contracts/investors/auth/index.ts +0 -116
- package/contracts/investors/bonus-tiers/index.ts +0 -37
- package/contracts/investors/cart/index.ts +0 -75
- package/contracts/investors/contact-us/index.ts +0 -48
- package/contracts/investors/data-records/index.ts +0 -113
- package/contracts/investors/data-rooms/index.ts +0 -96
- package/contracts/investors/files/index.ts +0 -167
- package/contracts/investors/files-public/index.ts +0 -185
- package/contracts/investors/index.ts +0 -72
- package/contracts/investors/individuals/index.ts +0 -99
- package/contracts/investors/investor-accounts/index.ts +0 -110
- package/contracts/investors/issuers/index.ts +0 -30
- package/contracts/investors/legal-entities/index.ts +0 -93
- package/contracts/investors/notes/index.ts +0 -69
- package/contracts/investors/offerings/index.ts +0 -93
- package/contracts/investors/pages/index.ts +0 -88
- package/contracts/investors/payment-methods/index.ts +0 -149
- package/contracts/investors/portfolios/index.ts +0 -53
- package/contracts/investors/sites/index.ts +0 -96
- package/contracts/investors/tasks/index.ts +0 -111
- package/contracts/investors/trade-line-items/index.ts +0 -75
- package/contracts/investors/trades/index.ts +0 -114
- package/contracts/investors/trusted-contacts/index.ts +0 -93
- package/contracts/investors/user-manuals/index.ts +0 -62
- package/contracts/investors/user-settings/index.ts +0 -170
- package/contracts/investors/users/index.ts +0 -45
- package/contracts/investors/webhooks/index.ts +0 -30
- package/contracts/issuers/account-contacts/index.ts +0 -76
- package/contracts/issuers/account-integrations/index.ts +0 -97
- package/contracts/issuers/accounts/index.ts +0 -97
- package/contracts/issuers/activities/index.ts +0 -54
- package/contracts/issuers/aic/index.ts +0 -39
- package/contracts/issuers/api-key-logs/index.ts +0 -53
- package/contracts/issuers/api-keys/index.ts +0 -93
- package/contracts/issuers/assets/index.ts +0 -122
- package/contracts/issuers/auth/index.ts +0 -152
- package/contracts/issuers/bonus-tiers/index.ts +0 -55
- package/contracts/issuers/contact-us/index.ts +0 -48
- package/contracts/issuers/covered-persons/index.ts +0 -136
- package/contracts/issuers/dashboard/index.ts +0 -72
- package/contracts/issuers/data-records/index.ts +0 -257
- package/contracts/issuers/data-rooms/index.ts +0 -134
- package/contracts/issuers/disbursement-approval-users/index.ts +0 -82
- package/contracts/issuers/disbursement-transactions/index.ts +0 -53
- package/contracts/issuers/disbursements/index.ts +0 -153
- package/contracts/issuers/email-themes/index.ts +0 -242
- package/contracts/issuers/escrow-accounts/index.ts +0 -81
- package/contracts/issuers/exchange-api-keys/index.ts +0 -144
- package/contracts/issuers/files/index.ts +0 -166
- package/contracts/issuers/files-public/index.ts +0 -166
- package/contracts/issuers/health/index.ts +0 -24
- package/contracts/issuers/index.ts +0 -112
- package/contracts/issuers/investor-accounts/index.ts +0 -148
- package/contracts/issuers/invites/index.ts +0 -129
- package/contracts/issuers/issuer/index.ts +0 -94
- package/contracts/issuers/issuer-bank-accounts/index.ts +0 -81
- package/contracts/issuers/issuer-payment-methods/index.ts +0 -136
- package/contracts/issuers/kyc/index.ts +0 -38
- package/contracts/issuers/login-histories/index.ts +0 -51
- package/contracts/issuers/notes/index.ts +0 -69
- package/contracts/issuers/offerings/index.ts +0 -206
- package/contracts/issuers/pages/index.ts +0 -138
- package/contracts/issuers/payment-methods/index.ts +0 -61
- package/contracts/issuers/portfolios/index.ts +0 -36
- package/contracts/issuers/rejection-reasons/index.ts +0 -32
- package/contracts/issuers/review/index.ts +0 -63
- package/contracts/issuers/secondary-customers/index.ts +0 -55
- package/contracts/issuers/secondary-orders/index.ts +0 -57
- package/contracts/issuers/secondary-trades/index.ts +0 -57
- package/contracts/issuers/secure-requests/index.ts +0 -34
- package/contracts/issuers/site-links/index.ts +0 -116
- package/contracts/issuers/site-settings/index.ts +0 -585
- package/contracts/issuers/sites/index.ts +0 -32
- package/contracts/issuers/tasks/index.ts +0 -111
- package/contracts/issuers/trades/index.ts +0 -132
- package/contracts/issuers/transactions/index.ts +0 -158
- package/contracts/issuers/user-manuals/index.ts +0 -62
- package/contracts/issuers/user-settings/index.ts +0 -170
- package/contracts/issuers/users/index.ts +0 -126
- package/contracts/secondaries/accounts/index.ts +0 -58
- package/contracts/secondaries/index.ts +0 -23
- package/contracts/secondaries/secondary-customers/index.ts +0 -55
- package/contracts/secondaries/secondary-issuers/index.ts +0 -94
- package/contracts/secondaries/secondary-orders/index.ts +0 -56
- package/contracts/secondaries/secondary-securities/index.ts +0 -95
- package/contracts/secondaries/secondary-trades/index.ts +0 -56
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { initContract } from '@ts-rest/core';
|
|
3
|
-
import {
|
|
4
|
-
BadRequestError,
|
|
5
|
-
ForbiddenError,
|
|
6
|
-
InternalError,
|
|
7
|
-
NotFoundError,
|
|
8
|
-
PaginationOptionsZod,
|
|
9
|
-
UnauthorizedError,
|
|
10
|
-
} from '../../../common/types';
|
|
11
|
-
import {
|
|
12
|
-
dataRoomIdSchema,
|
|
13
|
-
DataRoomPasswordQueryZod,
|
|
14
|
-
DataRoomsFilters,
|
|
15
|
-
DataRoomsIncludeQuery,
|
|
16
|
-
DataRoomStructureZod,
|
|
17
|
-
DataRoomZod,
|
|
18
|
-
DeleteDataRoom,
|
|
19
|
-
IPaginatedDataRooms,
|
|
20
|
-
PatchDataRoomZod,
|
|
21
|
-
PostDataRoom,
|
|
22
|
-
} from '../../../common/types/data-room.types';
|
|
23
|
-
|
|
24
|
-
const c = initContract();
|
|
25
|
-
|
|
26
|
-
export const dataRoomsContract = c.router(
|
|
27
|
-
{
|
|
28
|
-
getDataRooms: {
|
|
29
|
-
summary:
|
|
30
|
-
'Get Data Rooms - returns flat data room objects. See getDataRoomStructure for tree structure',
|
|
31
|
-
method: 'GET',
|
|
32
|
-
path: '',
|
|
33
|
-
metadata: {
|
|
34
|
-
auth: true,
|
|
35
|
-
},
|
|
36
|
-
query: PaginationOptionsZod.merge(DataRoomsFilters).merge(
|
|
37
|
-
DataRoomsIncludeQuery,
|
|
38
|
-
),
|
|
39
|
-
responses: {
|
|
40
|
-
200: IPaginatedDataRooms,
|
|
41
|
-
401: UnauthorizedError,
|
|
42
|
-
403: ForbiddenError,
|
|
43
|
-
500: InternalError,
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
getDataRoom: {
|
|
47
|
-
summary:
|
|
48
|
-
'Get data room by id - returns a flat data room object. See getDataRoomStructure for tree structure',
|
|
49
|
-
method: 'GET',
|
|
50
|
-
path: '/:id',
|
|
51
|
-
metadata: {
|
|
52
|
-
auth: true,
|
|
53
|
-
},
|
|
54
|
-
query: DataRoomsIncludeQuery.merge(DataRoomPasswordQueryZod),
|
|
55
|
-
pathParams: z.object({ id: dataRoomIdSchema }),
|
|
56
|
-
responses: {
|
|
57
|
-
200: DataRoomZod,
|
|
58
|
-
401: UnauthorizedError,
|
|
59
|
-
403: ForbiddenError,
|
|
60
|
-
404: NotFoundError,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
getDataRoomStructure: {
|
|
64
|
-
summary:
|
|
65
|
-
'Get data room structure by id - shows the proper tree structure of the data room',
|
|
66
|
-
method: 'GET',
|
|
67
|
-
path: '/:id/structure',
|
|
68
|
-
metadata: {
|
|
69
|
-
auth: true,
|
|
70
|
-
},
|
|
71
|
-
pathParams: z.object({ id: dataRoomIdSchema }),
|
|
72
|
-
query: DataRoomPasswordQueryZod,
|
|
73
|
-
responses: {
|
|
74
|
-
200: DataRoomStructureZod,
|
|
75
|
-
401: UnauthorizedError,
|
|
76
|
-
403: ForbiddenError,
|
|
77
|
-
404: NotFoundError,
|
|
78
|
-
500: InternalError,
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
postDataRoom: {
|
|
82
|
-
summary: 'Create a data room',
|
|
83
|
-
method: 'POST',
|
|
84
|
-
path: '',
|
|
85
|
-
metadata: {
|
|
86
|
-
auth: true,
|
|
87
|
-
},
|
|
88
|
-
body: PostDataRoom,
|
|
89
|
-
responses: {
|
|
90
|
-
201: DataRoomZod,
|
|
91
|
-
401: UnauthorizedError,
|
|
92
|
-
403: ForbiddenError,
|
|
93
|
-
500: InternalError,
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
patchDataRoom: {
|
|
97
|
-
summary: 'Update data room',
|
|
98
|
-
method: 'PATCH',
|
|
99
|
-
path: '/:id',
|
|
100
|
-
metadata: {
|
|
101
|
-
auth: true,
|
|
102
|
-
},
|
|
103
|
-
pathParams: z.object({ id: dataRoomIdSchema }),
|
|
104
|
-
body: PatchDataRoomZod,
|
|
105
|
-
responses: {
|
|
106
|
-
201: DataRoomZod,
|
|
107
|
-
400: BadRequestError,
|
|
108
|
-
401: UnauthorizedError,
|
|
109
|
-
403: ForbiddenError,
|
|
110
|
-
404: NotFoundError,
|
|
111
|
-
500: InternalError,
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
deleteDataRoom: {
|
|
115
|
-
summary:
|
|
116
|
-
'Deletes a data room and optionally (force=true) all its contents (subfolders and file associations)',
|
|
117
|
-
method: 'DELETE',
|
|
118
|
-
path: '',
|
|
119
|
-
metadata: {
|
|
120
|
-
auth: true,
|
|
121
|
-
},
|
|
122
|
-
body: DeleteDataRoom,
|
|
123
|
-
responses: {
|
|
124
|
-
204: z.object({ success: z.boolean() }),
|
|
125
|
-
401: UnauthorizedError,
|
|
126
|
-
403: ForbiddenError,
|
|
127
|
-
500: InternalError,
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
pathPrefix: 'data-rooms',
|
|
133
|
-
},
|
|
134
|
-
);
|
|
@@ -1,82 +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 { z } from 'zod';
|
|
11
|
-
import {
|
|
12
|
-
DisbursementApprovalUserFiltersZod,
|
|
13
|
-
disbursementApprovalUserIdSchema,
|
|
14
|
-
DisbursementApprovalUsersIncludeQuery,
|
|
15
|
-
DisbursementApprovalUserZod,
|
|
16
|
-
IPaginatedDisbursementApprovalUser,
|
|
17
|
-
PostDisbursementApprovalUser,
|
|
18
|
-
} from '../../../common/types/disbursement-approval-user.types';
|
|
19
|
-
|
|
20
|
-
const c = initContract();
|
|
21
|
-
|
|
22
|
-
export const disbursementApprovalUsersContract = c.router(
|
|
23
|
-
{
|
|
24
|
-
getDisbursementApprovalUsers: {
|
|
25
|
-
summary: 'Get disbursement approval users',
|
|
26
|
-
method: 'GET',
|
|
27
|
-
path: '',
|
|
28
|
-
metadata: {
|
|
29
|
-
auth: true,
|
|
30
|
-
},
|
|
31
|
-
query: PaginationOptionsZod.merge(
|
|
32
|
-
DisbursementApprovalUserFiltersZod,
|
|
33
|
-
).merge(DisbursementApprovalUsersIncludeQuery),
|
|
34
|
-
responses: {
|
|
35
|
-
200: IPaginatedDisbursementApprovalUser,
|
|
36
|
-
401: UnauthorizedError,
|
|
37
|
-
403: ForbiddenError,
|
|
38
|
-
404: NotFoundError,
|
|
39
|
-
500: InternalError,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
postDisbursementApprovalUser: {
|
|
43
|
-
summary: 'Create disbursement approval user',
|
|
44
|
-
method: 'POST',
|
|
45
|
-
path: '',
|
|
46
|
-
metadata: {
|
|
47
|
-
auth: true,
|
|
48
|
-
},
|
|
49
|
-
body: PostDisbursementApprovalUser,
|
|
50
|
-
responses: {
|
|
51
|
-
201: DisbursementApprovalUserZod,
|
|
52
|
-
400: BadRequestError,
|
|
53
|
-
401: UnauthorizedError,
|
|
54
|
-
404: NotFoundError,
|
|
55
|
-
500: InternalError,
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
deleteDisbursementApprovalUser: {
|
|
60
|
-
summary: '[ADMIN] Delete disbursement approval user',
|
|
61
|
-
method: 'DELETE',
|
|
62
|
-
path: '/:id',
|
|
63
|
-
metadata: {
|
|
64
|
-
auth: true,
|
|
65
|
-
},
|
|
66
|
-
pathParams: z.object({
|
|
67
|
-
id: disbursementApprovalUserIdSchema,
|
|
68
|
-
}),
|
|
69
|
-
responses: {
|
|
70
|
-
200: z.object({ success: z.boolean() }),
|
|
71
|
-
400: BadRequestError,
|
|
72
|
-
401: UnauthorizedError,
|
|
73
|
-
403: ForbiddenError,
|
|
74
|
-
404: NotFoundError,
|
|
75
|
-
500: InternalError,
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
pathPrefix: 'disbursement-approval-users',
|
|
81
|
-
},
|
|
82
|
-
);
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { initContract } from '@ts-rest/core';
|
|
2
|
-
import {
|
|
3
|
-
BadRequestError,
|
|
4
|
-
ForbiddenError,
|
|
5
|
-
InternalError,
|
|
6
|
-
NotFoundError,
|
|
7
|
-
UnauthorizedError,
|
|
8
|
-
} from '../../../common/types';
|
|
9
|
-
import {
|
|
10
|
-
DisbursementTransactionZod,
|
|
11
|
-
PostDisbursementTransactionZod,
|
|
12
|
-
} from '../../../common/types/disbursement-transaction.types';
|
|
13
|
-
|
|
14
|
-
const c = initContract();
|
|
15
|
-
|
|
16
|
-
export const disbursementTransactionsContract = c.router(
|
|
17
|
-
{
|
|
18
|
-
postDisbursementTransaction: {
|
|
19
|
-
summary: 'Create a disbursement transaction',
|
|
20
|
-
method: 'POST',
|
|
21
|
-
path: '',
|
|
22
|
-
metadata: {
|
|
23
|
-
auth: true,
|
|
24
|
-
},
|
|
25
|
-
body: PostDisbursementTransactionZod,
|
|
26
|
-
responses: {
|
|
27
|
-
201: DisbursementTransactionZod,
|
|
28
|
-
400: BadRequestError,
|
|
29
|
-
401: UnauthorizedError,
|
|
30
|
-
404: NotFoundError,
|
|
31
|
-
500: InternalError,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
getDisbursementTransactions: {
|
|
35
|
-
summary: 'Get disbursement transactions',
|
|
36
|
-
method: 'GET',
|
|
37
|
-
path: '',
|
|
38
|
-
metadata: {
|
|
39
|
-
auth: true,
|
|
40
|
-
},
|
|
41
|
-
responses: {
|
|
42
|
-
200: DisbursementTransactionZod.array(),
|
|
43
|
-
401: UnauthorizedError,
|
|
44
|
-
403: ForbiddenError,
|
|
45
|
-
404: NotFoundError,
|
|
46
|
-
500: InternalError,
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
pathPrefix: 'disbursement-transactions',
|
|
52
|
-
},
|
|
53
|
-
);
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { initContract } from '@ts-rest/core';
|
|
2
|
-
import {
|
|
3
|
-
BadRequestError,
|
|
4
|
-
ForbiddenError,
|
|
5
|
-
InternalError,
|
|
6
|
-
NotFoundError,
|
|
7
|
-
PaginationOptionsZod,
|
|
8
|
-
UnauthorizedError,
|
|
9
|
-
} from '../../../common/types';
|
|
10
|
-
|
|
11
|
-
import { z } from 'zod';
|
|
12
|
-
import { PostDisbursementReviewZod } from '../../../common/types/disbursement-review.types';
|
|
13
|
-
import {
|
|
14
|
-
DisbursementBalanceZod,
|
|
15
|
-
DisbursementFiltersZod,
|
|
16
|
-
disbursementIdSchema,
|
|
17
|
-
DisbursementMissingConfigZod,
|
|
18
|
-
DisbursementsIncludeQuery,
|
|
19
|
-
DisbursementsMissingConfigQuery,
|
|
20
|
-
DisbursementSummaryZod,
|
|
21
|
-
DisbursementZod,
|
|
22
|
-
IPaginatedDisbursement,
|
|
23
|
-
PostDisbursementBalanceZod,
|
|
24
|
-
PostDisbursementSummaryZod,
|
|
25
|
-
PostDisbursementZod,
|
|
26
|
-
} from '../../../common/types/disbursements.types';
|
|
27
|
-
|
|
28
|
-
const c = initContract();
|
|
29
|
-
|
|
30
|
-
export const disbursementsContract = c.router(
|
|
31
|
-
{
|
|
32
|
-
postDisbursement: {
|
|
33
|
-
summary: 'Create a disbursement',
|
|
34
|
-
method: 'POST',
|
|
35
|
-
path: '',
|
|
36
|
-
metadata: {
|
|
37
|
-
auth: true,
|
|
38
|
-
},
|
|
39
|
-
body: PostDisbursementZod,
|
|
40
|
-
responses: {
|
|
41
|
-
201: DisbursementZod,
|
|
42
|
-
400: BadRequestError,
|
|
43
|
-
401: UnauthorizedError,
|
|
44
|
-
404: NotFoundError,
|
|
45
|
-
500: InternalError,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
postDisbursementBalance: {
|
|
49
|
-
summary: 'Get a disbursement balance',
|
|
50
|
-
method: 'POST',
|
|
51
|
-
path: '/balance',
|
|
52
|
-
metadata: {
|
|
53
|
-
auth: true,
|
|
54
|
-
},
|
|
55
|
-
body: PostDisbursementBalanceZod,
|
|
56
|
-
responses: {
|
|
57
|
-
201: DisbursementBalanceZod,
|
|
58
|
-
400: BadRequestError,
|
|
59
|
-
401: UnauthorizedError,
|
|
60
|
-
404: NotFoundError,
|
|
61
|
-
500: InternalError,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
postDisbursementSummary: {
|
|
65
|
-
summary: 'Get a disbursement summary',
|
|
66
|
-
method: 'POST',
|
|
67
|
-
path: '/summary',
|
|
68
|
-
metadata: {
|
|
69
|
-
auth: true,
|
|
70
|
-
},
|
|
71
|
-
body: PostDisbursementSummaryZod,
|
|
72
|
-
responses: {
|
|
73
|
-
201: DisbursementSummaryZod,
|
|
74
|
-
400: BadRequestError,
|
|
75
|
-
401: UnauthorizedError,
|
|
76
|
-
404: NotFoundError,
|
|
77
|
-
500: InternalError,
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
getDisbursements: {
|
|
81
|
-
summary: 'Get disbursements',
|
|
82
|
-
method: 'GET',
|
|
83
|
-
path: '',
|
|
84
|
-
metadata: {
|
|
85
|
-
auth: true,
|
|
86
|
-
},
|
|
87
|
-
query: PaginationOptionsZod.merge(DisbursementFiltersZod).merge(
|
|
88
|
-
DisbursementsIncludeQuery,
|
|
89
|
-
),
|
|
90
|
-
responses: {
|
|
91
|
-
200: IPaginatedDisbursement,
|
|
92
|
-
400: BadRequestError,
|
|
93
|
-
401: UnauthorizedError,
|
|
94
|
-
404: NotFoundError,
|
|
95
|
-
500: InternalError,
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
getDisbursementsMissingConfig: {
|
|
100
|
-
summary: 'Get mssing configurations for disbursements',
|
|
101
|
-
method: 'GET',
|
|
102
|
-
path: '/config',
|
|
103
|
-
metadata: {
|
|
104
|
-
auth: true,
|
|
105
|
-
},
|
|
106
|
-
query: DisbursementsMissingConfigQuery,
|
|
107
|
-
responses: {
|
|
108
|
-
200: DisbursementMissingConfigZod,
|
|
109
|
-
401: UnauthorizedError,
|
|
110
|
-
403: ForbiddenError,
|
|
111
|
-
404: NotFoundError,
|
|
112
|
-
500: InternalError,
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
getDisbursement: {
|
|
117
|
-
summary: 'Get disbursement by id',
|
|
118
|
-
method: 'GET',
|
|
119
|
-
path: '/:id',
|
|
120
|
-
metadata: {
|
|
121
|
-
auth: true,
|
|
122
|
-
},
|
|
123
|
-
query: z.object({}).merge(DisbursementsIncludeQuery),
|
|
124
|
-
pathParams: z.object({ id: disbursementIdSchema }),
|
|
125
|
-
responses: {
|
|
126
|
-
200: DisbursementZod,
|
|
127
|
-
401: UnauthorizedError,
|
|
128
|
-
403: ForbiddenError,
|
|
129
|
-
404: NotFoundError,
|
|
130
|
-
500: InternalError,
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
reviewDisbursements: {
|
|
134
|
-
summary: 'Review Disbursements',
|
|
135
|
-
method: 'POST',
|
|
136
|
-
path: '/review',
|
|
137
|
-
metadata: {
|
|
138
|
-
auth: true,
|
|
139
|
-
},
|
|
140
|
-
body: PostDisbursementReviewZod,
|
|
141
|
-
responses: {
|
|
142
|
-
201: z.object({ success: z.boolean() }),
|
|
143
|
-
401: UnauthorizedError,
|
|
144
|
-
403: ForbiddenError,
|
|
145
|
-
404: NotFoundError,
|
|
146
|
-
500: InternalError,
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
pathPrefix: 'disbursements',
|
|
152
|
-
},
|
|
153
|
-
);
|
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
import { initContract } from '@ts-rest/core';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import {
|
|
4
|
-
ForbiddenError,
|
|
5
|
-
PaginationOptionsZod,
|
|
6
|
-
UnauthorizedError,
|
|
7
|
-
NotFoundError,
|
|
8
|
-
InternalError,
|
|
9
|
-
} from '../../../common/types';
|
|
10
|
-
import {} from '../../../common/types';
|
|
11
|
-
import {
|
|
12
|
-
emailThemeIdSchema,
|
|
13
|
-
emailThemeSettingIdSchema,
|
|
14
|
-
EmailThemesList,
|
|
15
|
-
IEmailTheme,
|
|
16
|
-
IEmailThemeSetting,
|
|
17
|
-
PatchEmailThemeSetting,
|
|
18
|
-
IEmailThemeSettings,
|
|
19
|
-
PatchEmailThemeSettings,
|
|
20
|
-
PostEmailThemeZod,
|
|
21
|
-
ExportEmailThemeSettingsZod,
|
|
22
|
-
PatchEmailThemeNameZod,
|
|
23
|
-
ImportEmailThemeSettingsZod,
|
|
24
|
-
PreviewEmailThemeResponse,
|
|
25
|
-
SendPreviewEmailResponse,
|
|
26
|
-
SendPreviewEmailZod,
|
|
27
|
-
PreviewEmailThemeZod,
|
|
28
|
-
GenerateTemplatePreviewHtmlZod,
|
|
29
|
-
} from '../../../common/types/email-theme.types';
|
|
30
|
-
|
|
31
|
-
const c = initContract();
|
|
32
|
-
|
|
33
|
-
export const emailThemesContract = c.router(
|
|
34
|
-
{
|
|
35
|
-
previewEmailTheme: {
|
|
36
|
-
summary: 'Preview an email theme',
|
|
37
|
-
method: 'GET',
|
|
38
|
-
path: '/preview',
|
|
39
|
-
metadata: {
|
|
40
|
-
auth: true,
|
|
41
|
-
},
|
|
42
|
-
responses: {
|
|
43
|
-
200: PreviewEmailThemeResponse,
|
|
44
|
-
401: UnauthorizedError,
|
|
45
|
-
403: ForbiddenError,
|
|
46
|
-
404: NotFoundError,
|
|
47
|
-
500: InternalError,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
getEmailThemes: {
|
|
51
|
-
summary: 'Get the email themes for the current account',
|
|
52
|
-
method: 'GET',
|
|
53
|
-
path: '',
|
|
54
|
-
metadata: {
|
|
55
|
-
auth: true,
|
|
56
|
-
},
|
|
57
|
-
responses: {
|
|
58
|
-
200: EmailThemesList,
|
|
59
|
-
401: UnauthorizedError,
|
|
60
|
-
403: ForbiddenError,
|
|
61
|
-
404: NotFoundError,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
getEmailTheme: {
|
|
66
|
-
summary: 'Get the email theme for the current account',
|
|
67
|
-
method: 'GET',
|
|
68
|
-
path: '/:id',
|
|
69
|
-
metadata: {
|
|
70
|
-
auth: true,
|
|
71
|
-
},
|
|
72
|
-
query: PaginationOptionsZod,
|
|
73
|
-
responses: {
|
|
74
|
-
200: IEmailTheme,
|
|
75
|
-
401: UnauthorizedError,
|
|
76
|
-
403: ForbiddenError,
|
|
77
|
-
404: NotFoundError,
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
sendPreviewEmail: {
|
|
81
|
-
summary: 'Send a preview email',
|
|
82
|
-
method: 'POST',
|
|
83
|
-
path: '/send-preview-email',
|
|
84
|
-
metadata: {
|
|
85
|
-
auth: true,
|
|
86
|
-
},
|
|
87
|
-
body: SendPreviewEmailZod,
|
|
88
|
-
responses: {
|
|
89
|
-
201: SendPreviewEmailResponse,
|
|
90
|
-
401: UnauthorizedError,
|
|
91
|
-
403: ForbiddenError,
|
|
92
|
-
404: NotFoundError,
|
|
93
|
-
500: InternalError,
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
sendTemplateEmail: {
|
|
97
|
-
summary: 'Send a template email',
|
|
98
|
-
method: 'POST',
|
|
99
|
-
path: '/send-template-email',
|
|
100
|
-
metadata: {
|
|
101
|
-
auth: true,
|
|
102
|
-
},
|
|
103
|
-
body: PreviewEmailThemeZod,
|
|
104
|
-
responses: {
|
|
105
|
-
201: SendPreviewEmailResponse,
|
|
106
|
-
401: UnauthorizedError,
|
|
107
|
-
403: ForbiddenError,
|
|
108
|
-
404: NotFoundError,
|
|
109
|
-
500: InternalError,
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
generateTemplatePreviewHtml: {
|
|
113
|
-
summary: 'Generate HTML for a template email',
|
|
114
|
-
method: 'POST',
|
|
115
|
-
path: '/generate-template-preview-html',
|
|
116
|
-
metadata: {
|
|
117
|
-
auth: true,
|
|
118
|
-
},
|
|
119
|
-
body: GenerateTemplatePreviewHtmlZod,
|
|
120
|
-
responses: {
|
|
121
|
-
200: PreviewEmailThemeResponse,
|
|
122
|
-
401: UnauthorizedError,
|
|
123
|
-
403: ForbiddenError,
|
|
124
|
-
404: NotFoundError,
|
|
125
|
-
500: InternalError,
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
postEmailTheme: {
|
|
129
|
-
summary: 'Post a email theme',
|
|
130
|
-
method: 'POST',
|
|
131
|
-
path: '',
|
|
132
|
-
metadata: {
|
|
133
|
-
auth: true,
|
|
134
|
-
},
|
|
135
|
-
body: PostEmailThemeZod,
|
|
136
|
-
responses: {
|
|
137
|
-
201: IEmailTheme,
|
|
138
|
-
401: UnauthorizedError,
|
|
139
|
-
403: ForbiddenError,
|
|
140
|
-
500: InternalError,
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
patchEmailThemeSettings: {
|
|
145
|
-
summary: 'Patch email theme settings',
|
|
146
|
-
method: 'PATCH',
|
|
147
|
-
path: '/:id/email-theme-settings',
|
|
148
|
-
metadata: {
|
|
149
|
-
auth: true,
|
|
150
|
-
},
|
|
151
|
-
pathParams: z.object({
|
|
152
|
-
id: emailThemeIdSchema,
|
|
153
|
-
}),
|
|
154
|
-
body: PatchEmailThemeSettings,
|
|
155
|
-
responses: {
|
|
156
|
-
201: IEmailThemeSettings,
|
|
157
|
-
401: UnauthorizedError,
|
|
158
|
-
403: ForbiddenError,
|
|
159
|
-
500: InternalError,
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
patchEmailThemeSetting: {
|
|
163
|
-
summary: 'Patch a email theme setting',
|
|
164
|
-
method: 'PATCH',
|
|
165
|
-
path: '/:id/email-theme/:emailThemeId',
|
|
166
|
-
metadata: {
|
|
167
|
-
auth: true,
|
|
168
|
-
},
|
|
169
|
-
pathParams: z.object({
|
|
170
|
-
id: emailThemeSettingIdSchema,
|
|
171
|
-
emailThemeId: emailThemeIdSchema,
|
|
172
|
-
}),
|
|
173
|
-
body: PatchEmailThemeSetting,
|
|
174
|
-
responses: {
|
|
175
|
-
201: IEmailThemeSetting,
|
|
176
|
-
401: UnauthorizedError,
|
|
177
|
-
403: ForbiddenError,
|
|
178
|
-
500: InternalError,
|
|
179
|
-
},
|
|
180
|
-
},
|
|
181
|
-
importEmailThemeSettings: {
|
|
182
|
-
summary: 'Import email theme settings',
|
|
183
|
-
method: 'POST',
|
|
184
|
-
path: '/:id/import-theme-settings',
|
|
185
|
-
metadata: {
|
|
186
|
-
auth: true,
|
|
187
|
-
},
|
|
188
|
-
pathParams: z.object({
|
|
189
|
-
id: emailThemeIdSchema,
|
|
190
|
-
}),
|
|
191
|
-
body: ImportEmailThemeSettingsZod,
|
|
192
|
-
responses: {
|
|
193
|
-
201: IEmailThemeSettings,
|
|
194
|
-
401: UnauthorizedError,
|
|
195
|
-
403: ForbiddenError,
|
|
196
|
-
404: NotFoundError,
|
|
197
|
-
500: InternalError,
|
|
198
|
-
},
|
|
199
|
-
},
|
|
200
|
-
|
|
201
|
-
exportEmailThemeSettings: {
|
|
202
|
-
summary: 'Export email theme settings',
|
|
203
|
-
method: 'GET',
|
|
204
|
-
path: '/:id/export-theme-settings',
|
|
205
|
-
metadata: {
|
|
206
|
-
auth: true,
|
|
207
|
-
},
|
|
208
|
-
pathParams: z.object({
|
|
209
|
-
id: emailThemeIdSchema,
|
|
210
|
-
}),
|
|
211
|
-
responses: {
|
|
212
|
-
200: ExportEmailThemeSettingsZod,
|
|
213
|
-
401: UnauthorizedError,
|
|
214
|
-
403: ForbiddenError,
|
|
215
|
-
404: NotFoundError,
|
|
216
|
-
500: InternalError,
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
|
-
patchEmailThemeName: {
|
|
220
|
-
summary: 'Patch the name of a email theme',
|
|
221
|
-
method: 'PATCH',
|
|
222
|
-
path: '/:id/name',
|
|
223
|
-
metadata: {
|
|
224
|
-
auth: true,
|
|
225
|
-
},
|
|
226
|
-
pathParams: z.object({
|
|
227
|
-
id: emailThemeIdSchema,
|
|
228
|
-
}),
|
|
229
|
-
body: PatchEmailThemeNameZod,
|
|
230
|
-
responses: {
|
|
231
|
-
201: IEmailTheme,
|
|
232
|
-
401: UnauthorizedError,
|
|
233
|
-
403: ForbiddenError,
|
|
234
|
-
404: NotFoundError,
|
|
235
|
-
500: InternalError,
|
|
236
|
-
},
|
|
237
|
-
},
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
pathPrefix: 'email-themes',
|
|
241
|
-
},
|
|
242
|
-
);
|