@dalmore/api-contracts 1.0.3 → 1.0.6
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 +34 -60
- package/index.mjs +1001 -18638
- package/package.json +5 -53
- package/src/common/types/address.spec.ts +203 -0
- package/src/common/types/batch-jobs.types.ts +1 -0
- package/src/common/types/common.types.spec.ts +336 -0
- package/src/common/types/files.types.spec.ts +154 -0
- package/src/common/types/issuer-payment-method.types.spec.ts +612 -0
- package/src/common/types/offering.types.spec.ts +91 -0
- package/src/common/types/phone.spec.ts +76 -0
- package/src/common/types/queue.types.ts +1 -0
- package/src/common/types/reminder-config.types.ts +40 -0
- package/src/common/types/site-link.types.spec.ts +134 -0
- package/src/common/types/trade.types.ts +2 -4
- package/clients/index.mjs +0 -10970
- package/compliance/index.mjs +0 -20016
- package/compliance-apikey/index.mjs +0 -9795
- package/helpers/index.mjs +0 -146
- package/investors/index.mjs +0 -12844
- package/issuers/index.mjs +0 -16168
- package/secondaries/index.mjs +0 -10282
- package/src/common/helpers/index.ts +0 -205
- package/src/contracts/compliance/account-contacts/index.ts +0 -82
- package/src/contracts/compliance/account-managers/index.ts +0 -142
- package/src/contracts/compliance/accounts/index.ts +0 -187
- package/src/contracts/compliance/activities/index.ts +0 -55
- package/src/contracts/compliance/aic/index.ts +0 -60
- package/src/contracts/compliance/api-keys/index.ts +0 -91
- package/src/contracts/compliance/assets/index.ts +0 -122
- package/src/contracts/compliance/auth/index.ts +0 -134
- package/src/contracts/compliance/batch-jobs/index.ts +0 -62
- package/src/contracts/compliance/bonus-tiers/index.ts +0 -55
- package/src/contracts/compliance/checklist/index.ts +0 -87
- package/src/contracts/compliance/checklist-items/index.ts +0 -86
- package/src/contracts/compliance/covered-persons/index.ts +0 -97
- package/src/contracts/compliance/dashboard/index.ts +0 -111
- package/src/contracts/compliance/data-records/index.ts +0 -116
- package/src/contracts/compliance/data-rooms/index.ts +0 -113
- package/src/contracts/compliance/default-theme-configs/index.ts +0 -95
- package/src/contracts/compliance/disbursement/index.ts +0 -165
- package/src/contracts/compliance/disbursement-approval-users/index.ts +0 -84
- package/src/contracts/compliance/disbursement-transactions/index.ts +0 -37
- package/src/contracts/compliance/domain-filters/index.ts +0 -117
- package/src/contracts/compliance/email-themes/index.ts +0 -284
- package/src/contracts/compliance/escrow-accounts/index.ts +0 -85
- package/src/contracts/compliance/exchange-api-keys/index.ts +0 -129
- package/src/contracts/compliance/exchange-imports/index.ts +0 -137
- package/src/contracts/compliance/files/index.ts +0 -267
- package/src/contracts/compliance/files-public/index.ts +0 -188
- package/src/contracts/compliance/health/index.ts +0 -26
- package/src/contracts/compliance/index.ts +0 -147
- package/src/contracts/compliance/individuals/index.ts +0 -57
- package/src/contracts/compliance/investor-accounts/index.ts +0 -141
- package/src/contracts/compliance/invites/index.ts +0 -137
- package/src/contracts/compliance/issuer-bank-accounts/index.ts +0 -81
- package/src/contracts/compliance/issuer-payment-methods/index.ts +0 -81
- package/src/contracts/compliance/issuers/index.ts +0 -97
- package/src/contracts/compliance/job-items/index.ts +0 -58
- package/src/contracts/compliance/jobs/index.ts +0 -59
- package/src/contracts/compliance/kyb/index.ts +0 -54
- package/src/contracts/compliance/kyc/index.ts +0 -77
- package/src/contracts/compliance/legal-entities/index.ts +0 -57
- package/src/contracts/compliance/login-histories/index.ts +0 -37
- package/src/contracts/compliance/notes/index.ts +0 -69
- package/src/contracts/compliance/notion-databases/index.ts +0 -107
- package/src/contracts/compliance/notion-pages/index.ts +0 -105
- package/src/contracts/compliance/offering-reports/index.ts +0 -149
- package/src/contracts/compliance/offerings/index.ts +0 -233
- package/src/contracts/compliance/pages/index.ts +0 -178
- package/src/contracts/compliance/payment-methods/index.ts +0 -57
- package/src/contracts/compliance/rejection-reasons/index.ts +0 -32
- package/src/contracts/compliance/review/index.ts +0 -169
- package/src/contracts/compliance/roles/index.ts +0 -34
- package/src/contracts/compliance/secondary-customers/index.ts +0 -77
- package/src/contracts/compliance/secondary-orders/index.ts +0 -60
- package/src/contracts/compliance/secondary-trades/index.ts +0 -100
- package/src/contracts/compliance/secure-requests/index.ts +0 -54
- package/src/contracts/compliance/signer/index.ts +0 -369
- package/src/contracts/compliance/site-links/index.ts +0 -128
- package/src/contracts/compliance/site-settings/index.ts +0 -669
- package/src/contracts/compliance/sites/index.ts +0 -56
- package/src/contracts/compliance/state-machine/index.ts +0 -94
- package/src/contracts/compliance/tasks/index.ts +0 -91
- package/src/contracts/compliance/third-parties/index.ts +0 -52
- package/src/contracts/compliance/trade-line-items/index.ts +0 -59
- package/src/contracts/compliance/trades/index.ts +0 -230
- package/src/contracts/compliance/transactions/index.ts +0 -161
- package/src/contracts/compliance/user-manuals/index.ts +0 -271
- package/src/contracts/compliance/user-settings/index.ts +0 -189
- package/src/contracts/compliance/users/index.ts +0 -200
- package/src/contracts/compliance/webhooks/index.ts +0 -41
- package/src/contracts/compliance-apikey/accounts/index.ts +0 -58
- package/src/contracts/compliance-apikey/index.ts +0 -14
- package/src/contracts/index.ts +0 -6
- package/src/contracts/investors/account-contacts/index.ts +0 -58
- package/src/contracts/investors/aic/index.ts +0 -59
- package/src/contracts/investors/assets/index.ts +0 -61
- package/src/contracts/investors/auth/index.ts +0 -116
- package/src/contracts/investors/bonus-tiers/index.ts +0 -37
- package/src/contracts/investors/cart/index.ts +0 -75
- package/src/contracts/investors/contact-us/index.ts +0 -48
- package/src/contracts/investors/data-records/index.ts +0 -113
- package/src/contracts/investors/data-rooms/index.ts +0 -96
- package/src/contracts/investors/files/index.ts +0 -167
- package/src/contracts/investors/files-public/index.ts +0 -185
- package/src/contracts/investors/index.ts +0 -72
- package/src/contracts/investors/individuals/index.ts +0 -99
- package/src/contracts/investors/investor-accounts/index.ts +0 -110
- package/src/contracts/investors/issuer-payment-methods/index.ts +0 -36
- package/src/contracts/investors/issuers/index.ts +0 -30
- package/src/contracts/investors/legal-entities/index.ts +0 -93
- package/src/contracts/investors/notes/index.ts +0 -69
- package/src/contracts/investors/offerings/index.ts +0 -93
- package/src/contracts/investors/pages/index.ts +0 -88
- package/src/contracts/investors/payment-methods/index.ts +0 -149
- package/src/contracts/investors/portfolios/index.ts +0 -53
- package/src/contracts/investors/sites/index.ts +0 -96
- package/src/contracts/investors/tasks/index.ts +0 -111
- package/src/contracts/investors/trade-line-items/index.ts +0 -75
- package/src/contracts/investors/trades/index.ts +0 -114
- package/src/contracts/investors/transactions/index.ts +0 -37
- package/src/contracts/investors/trusted-contacts/index.ts +0 -93
- package/src/contracts/investors/user-manuals/index.ts +0 -62
- package/src/contracts/investors/user-settings/index.ts +0 -170
- package/src/contracts/investors/users/index.ts +0 -45
- package/src/contracts/investors/webhooks/index.ts +0 -30
- package/src/contracts/issuers/account-contacts/index.ts +0 -76
- package/src/contracts/issuers/account-integrations/index.ts +0 -97
- package/src/contracts/issuers/accounts/index.ts +0 -97
- package/src/contracts/issuers/activities/index.ts +0 -54
- package/src/contracts/issuers/aic/index.ts +0 -39
- package/src/contracts/issuers/api-key-logs/index.ts +0 -53
- package/src/contracts/issuers/api-keys/index.ts +0 -93
- package/src/contracts/issuers/assets/index.ts +0 -122
- package/src/contracts/issuers/auth/index.ts +0 -152
- package/src/contracts/issuers/bonus-tiers/index.ts +0 -55
- package/src/contracts/issuers/contact-us/index.ts +0 -48
- package/src/contracts/issuers/covered-persons/index.ts +0 -136
- package/src/contracts/issuers/dashboard/index.ts +0 -72
- package/src/contracts/issuers/data-records/index.ts +0 -257
- package/src/contracts/issuers/data-rooms/index.ts +0 -134
- package/src/contracts/issuers/disbursement-approval-users/index.ts +0 -82
- package/src/contracts/issuers/disbursement-transactions/index.ts +0 -53
- package/src/contracts/issuers/disbursements/index.ts +0 -153
- package/src/contracts/issuers/email-themes/index.ts +0 -242
- package/src/contracts/issuers/escrow-accounts/index.ts +0 -81
- package/src/contracts/issuers/exchange-api-keys/index.ts +0 -144
- package/src/contracts/issuers/files/index.ts +0 -166
- package/src/contracts/issuers/files-public/index.ts +0 -166
- package/src/contracts/issuers/health/index.ts +0 -24
- package/src/contracts/issuers/index.ts +0 -112
- package/src/contracts/issuers/investor-accounts/index.ts +0 -148
- package/src/contracts/issuers/invites/index.ts +0 -129
- package/src/contracts/issuers/issuer/index.ts +0 -94
- package/src/contracts/issuers/issuer-bank-accounts/index.ts +0 -81
- package/src/contracts/issuers/issuer-payment-methods/index.ts +0 -136
- package/src/contracts/issuers/kyc/index.ts +0 -38
- package/src/contracts/issuers/login-histories/index.ts +0 -51
- package/src/contracts/issuers/notes/index.ts +0 -69
- package/src/contracts/issuers/offerings/index.ts +0 -206
- package/src/contracts/issuers/pages/index.ts +0 -138
- package/src/contracts/issuers/payment-methods/index.ts +0 -61
- package/src/contracts/issuers/portfolios/index.ts +0 -36
- package/src/contracts/issuers/rejection-reasons/index.ts +0 -32
- package/src/contracts/issuers/review/index.ts +0 -63
- package/src/contracts/issuers/secondary-customers/index.ts +0 -55
- package/src/contracts/issuers/secondary-orders/index.ts +0 -57
- package/src/contracts/issuers/secondary-trades/index.ts +0 -57
- package/src/contracts/issuers/secure-requests/index.ts +0 -34
- package/src/contracts/issuers/site-links/index.ts +0 -116
- package/src/contracts/issuers/site-settings/index.ts +0 -585
- package/src/contracts/issuers/sites/index.ts +0 -32
- package/src/contracts/issuers/tasks/index.ts +0 -111
- package/src/contracts/issuers/trades/index.ts +0 -132
- package/src/contracts/issuers/transactions/index.ts +0 -158
- package/src/contracts/issuers/user-manuals/index.ts +0 -62
- package/src/contracts/issuers/user-settings/index.ts +0 -170
- package/src/contracts/issuers/users/index.ts +0 -126
- package/src/contracts/secondaries/accounts/index.ts +0 -58
- package/src/contracts/secondaries/index.ts +0 -23
- package/src/contracts/secondaries/secondary-customers/index.ts +0 -55
- package/src/contracts/secondaries/secondary-issuers/index.ts +0 -94
- package/src/contracts/secondaries/secondary-orders/index.ts +0 -56
- package/src/contracts/secondaries/secondary-securities/index.ts +0 -95
- package/src/contracts/secondaries/secondary-trades/index.ts +0 -56
- package/types/index.mjs +0 -10320
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { initContract } from '@ts-rest/core';
|
|
2
|
-
import {
|
|
3
|
-
ForbiddenError,
|
|
4
|
-
InternalError,
|
|
5
|
-
NotFoundError,
|
|
6
|
-
UnauthorizedError,
|
|
7
|
-
PaginationOptionsZod,
|
|
8
|
-
BadRequestError,
|
|
9
|
-
accountIdSchema,
|
|
10
|
-
} from '../../../common/types';
|
|
11
|
-
import { z } from 'zod';
|
|
12
|
-
import {
|
|
13
|
-
DisbursementApprovalUserFiltersZod,
|
|
14
|
-
disbursementApprovalUserIdSchema,
|
|
15
|
-
DisbursementApprovalUsersIncludeQuery,
|
|
16
|
-
DisbursementApprovalUserZod,
|
|
17
|
-
IPaginatedDisbursementApprovalUser,
|
|
18
|
-
PostComplianceDisbursementApprovalUser,
|
|
19
|
-
} from '../../../common/types/disbursement-approval-user.types';
|
|
20
|
-
|
|
21
|
-
const c = initContract();
|
|
22
|
-
|
|
23
|
-
export const disbursementApprovalUsersContract = c.router(
|
|
24
|
-
{
|
|
25
|
-
getDisbursementApprovalUsers: {
|
|
26
|
-
summary: '[ADMIN] Get disbursement approval users',
|
|
27
|
-
method: 'GET',
|
|
28
|
-
path: '',
|
|
29
|
-
metadata: {
|
|
30
|
-
auth: true,
|
|
31
|
-
},
|
|
32
|
-
query: PaginationOptionsZod.merge(
|
|
33
|
-
DisbursementApprovalUserFiltersZod,
|
|
34
|
-
).merge(DisbursementApprovalUsersIncludeQuery),
|
|
35
|
-
responses: {
|
|
36
|
-
200: IPaginatedDisbursementApprovalUser,
|
|
37
|
-
401: UnauthorizedError,
|
|
38
|
-
403: ForbiddenError,
|
|
39
|
-
404: NotFoundError,
|
|
40
|
-
500: InternalError,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
postDisbursementApprovalUser: {
|
|
44
|
-
summary: '[ADMIN] Create disbursement approval user',
|
|
45
|
-
method: 'POST',
|
|
46
|
-
path: '',
|
|
47
|
-
metadata: {
|
|
48
|
-
auth: true,
|
|
49
|
-
},
|
|
50
|
-
body: PostComplianceDisbursementApprovalUser,
|
|
51
|
-
responses: {
|
|
52
|
-
201: DisbursementApprovalUserZod,
|
|
53
|
-
400: BadRequestError,
|
|
54
|
-
401: UnauthorizedError,
|
|
55
|
-
404: NotFoundError,
|
|
56
|
-
500: InternalError,
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
deleteDisbursementApprovalUser: {
|
|
61
|
-
summary: '[ADMIN] Delete disbursement approval user',
|
|
62
|
-
method: 'DELETE',
|
|
63
|
-
path: '/:id',
|
|
64
|
-
metadata: {
|
|
65
|
-
auth: true,
|
|
66
|
-
},
|
|
67
|
-
pathParams: z.object({
|
|
68
|
-
id: disbursementApprovalUserIdSchema,
|
|
69
|
-
}),
|
|
70
|
-
query: z.object({ accountId: accountIdSchema.optional() }),
|
|
71
|
-
responses: {
|
|
72
|
-
200: z.object({ success: z.boolean() }),
|
|
73
|
-
400: BadRequestError,
|
|
74
|
-
401: UnauthorizedError,
|
|
75
|
-
403: ForbiddenError,
|
|
76
|
-
404: NotFoundError,
|
|
77
|
-
500: InternalError,
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
pathPrefix: 'disbursement-approval-users',
|
|
83
|
-
},
|
|
84
|
-
);
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { initContract } from '@ts-rest/core';
|
|
2
|
-
import {
|
|
3
|
-
BadRequestError,
|
|
4
|
-
InternalError,
|
|
5
|
-
NotFoundError,
|
|
6
|
-
UnauthorizedError,
|
|
7
|
-
} from '../../../common/types';
|
|
8
|
-
import {
|
|
9
|
-
CompliancePostDisbursementTransactionZod,
|
|
10
|
-
DisbursementTransactionZod,
|
|
11
|
-
} from '../../../common/types/disbursement-transaction.types';
|
|
12
|
-
|
|
13
|
-
const c = initContract();
|
|
14
|
-
|
|
15
|
-
export const disbursementTransactionsContract = c.router(
|
|
16
|
-
{
|
|
17
|
-
postDisbursementTransaction: {
|
|
18
|
-
summary: 'Create a disbursement transaction',
|
|
19
|
-
method: 'POST',
|
|
20
|
-
path: '',
|
|
21
|
-
metadata: {
|
|
22
|
-
auth: true,
|
|
23
|
-
},
|
|
24
|
-
body: CompliancePostDisbursementTransactionZod,
|
|
25
|
-
responses: {
|
|
26
|
-
201: DisbursementTransactionZod,
|
|
27
|
-
400: BadRequestError,
|
|
28
|
-
401: UnauthorizedError,
|
|
29
|
-
404: NotFoundError,
|
|
30
|
-
500: InternalError,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
pathPrefix: 'disbursement-transactions',
|
|
36
|
-
},
|
|
37
|
-
);
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { initContract } from '@ts-rest/core';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import {
|
|
4
|
-
BadRequestError,
|
|
5
|
-
PaginationOptionsZod,
|
|
6
|
-
DomainFilterFiltersZod,
|
|
7
|
-
IPaginatedDomainFilter,
|
|
8
|
-
ForbiddenError,
|
|
9
|
-
UnauthorizedError,
|
|
10
|
-
NotFoundError,
|
|
11
|
-
domainFilterIdSchema,
|
|
12
|
-
DomainFilterZod,
|
|
13
|
-
PostDomainFilterZod,
|
|
14
|
-
ConflictError,
|
|
15
|
-
InternalError,
|
|
16
|
-
PatchDomainFilterZod,
|
|
17
|
-
DomainFilterDeleteResponseZod,
|
|
18
|
-
} from '../../../common/types';
|
|
19
|
-
|
|
20
|
-
const c = initContract();
|
|
21
|
-
|
|
22
|
-
export const domainFiltersContract = c.router(
|
|
23
|
-
{
|
|
24
|
-
getDomainFilters: {
|
|
25
|
-
summary: 'Get domain filters',
|
|
26
|
-
method: 'GET',
|
|
27
|
-
path: '',
|
|
28
|
-
metadata: {
|
|
29
|
-
auth: true,
|
|
30
|
-
},
|
|
31
|
-
query: PaginationOptionsZod.merge(DomainFilterFiltersZod),
|
|
32
|
-
responses: {
|
|
33
|
-
200: IPaginatedDomainFilter,
|
|
34
|
-
400: BadRequestError,
|
|
35
|
-
401: UnauthorizedError,
|
|
36
|
-
403: ForbiddenError,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
getDomainFilter: {
|
|
40
|
-
summary: 'Get domain filter by id',
|
|
41
|
-
method: 'GET',
|
|
42
|
-
path: '/:id',
|
|
43
|
-
metadata: {
|
|
44
|
-
auth: true,
|
|
45
|
-
},
|
|
46
|
-
pathParams: z.object({
|
|
47
|
-
id: domainFilterIdSchema,
|
|
48
|
-
}),
|
|
49
|
-
responses: {
|
|
50
|
-
200: DomainFilterZod,
|
|
51
|
-
400: BadRequestError,
|
|
52
|
-
401: UnauthorizedError,
|
|
53
|
-
403: ForbiddenError,
|
|
54
|
-
404: NotFoundError,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
createDomainFilter: {
|
|
58
|
-
summary: 'Create domain filter',
|
|
59
|
-
method: 'POST',
|
|
60
|
-
path: '',
|
|
61
|
-
metadata: {
|
|
62
|
-
auth: true,
|
|
63
|
-
},
|
|
64
|
-
body: PostDomainFilterZod,
|
|
65
|
-
responses: {
|
|
66
|
-
200: DomainFilterZod,
|
|
67
|
-
400: BadRequestError,
|
|
68
|
-
401: UnauthorizedError,
|
|
69
|
-
403: ForbiddenError,
|
|
70
|
-
409: ConflictError,
|
|
71
|
-
500: InternalError,
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
updateDomainFilter: {
|
|
75
|
-
summary: 'Update domain filter',
|
|
76
|
-
method: 'PATCH',
|
|
77
|
-
path: '/:id',
|
|
78
|
-
metadata: {
|
|
79
|
-
auth: true,
|
|
80
|
-
},
|
|
81
|
-
pathParams: z.object({
|
|
82
|
-
id: domainFilterIdSchema,
|
|
83
|
-
}),
|
|
84
|
-
body: PatchDomainFilterZod,
|
|
85
|
-
responses: {
|
|
86
|
-
200: DomainFilterZod,
|
|
87
|
-
400: BadRequestError,
|
|
88
|
-
401: UnauthorizedError,
|
|
89
|
-
403: ForbiddenError,
|
|
90
|
-
409: ConflictError,
|
|
91
|
-
500: InternalError,
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
deleteDomainFilter: {
|
|
95
|
-
summary: 'Delete domain filter',
|
|
96
|
-
method: 'DELETE',
|
|
97
|
-
path: '/:id',
|
|
98
|
-
metadata: {
|
|
99
|
-
auth: true,
|
|
100
|
-
},
|
|
101
|
-
pathParams: z.object({
|
|
102
|
-
id: domainFilterIdSchema,
|
|
103
|
-
}),
|
|
104
|
-
responses: {
|
|
105
|
-
200: DomainFilterDeleteResponseZod,
|
|
106
|
-
400: BadRequestError,
|
|
107
|
-
401: UnauthorizedError,
|
|
108
|
-
403: ForbiddenError,
|
|
109
|
-
404: NotFoundError,
|
|
110
|
-
500: InternalError,
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
pathPrefix: 'domain-filters',
|
|
116
|
-
},
|
|
117
|
-
);
|
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
import { initContract } from '@ts-rest/core';
|
|
2
|
-
import {
|
|
3
|
-
ForbiddenError,
|
|
4
|
-
NotFoundError,
|
|
5
|
-
InternalError,
|
|
6
|
-
UnauthorizedError,
|
|
7
|
-
accountIdSchema,
|
|
8
|
-
EmailThemesList,
|
|
9
|
-
EmailThemeFiltersZod,
|
|
10
|
-
IEmailTheme,
|
|
11
|
-
emailThemeIdSchema,
|
|
12
|
-
IEmailThemeSettings,
|
|
13
|
-
emailThemeSettingIdSchema,
|
|
14
|
-
IEmailThemeSetting,
|
|
15
|
-
ExportEmailThemeSettingsZod,
|
|
16
|
-
CompliancePostEmailThemeZod,
|
|
17
|
-
CompliancePatchEmailThemeSettings,
|
|
18
|
-
CompliancePatchEmailThemeSetting,
|
|
19
|
-
ComplianceImportEmailThemeSettingsZod,
|
|
20
|
-
CompliancePatchEmailThemeNameZod,
|
|
21
|
-
ComplianceSendPreviewEmailZod,
|
|
22
|
-
SendPreviewEmailResponse,
|
|
23
|
-
PreviewEmailThemeResponse,
|
|
24
|
-
PaginationOptionsZod,
|
|
25
|
-
GetEmailThemesAdminQuery,
|
|
26
|
-
CompliancePreviewEmailThemeZod,
|
|
27
|
-
ComplianceGenerateTemplatePreviewHtmlZod,
|
|
28
|
-
GetDefaultEmailThemesZod,
|
|
29
|
-
} from '../../../common/types';
|
|
30
|
-
import { z } from 'zod';
|
|
31
|
-
|
|
32
|
-
const c = initContract();
|
|
33
|
-
|
|
34
|
-
export const emailThemesContract = c.router(
|
|
35
|
-
{
|
|
36
|
-
previewEmailTheme: {
|
|
37
|
-
summary: '[ADMIN] Preview an email theme',
|
|
38
|
-
method: 'GET',
|
|
39
|
-
path: '/preview',
|
|
40
|
-
metadata: {
|
|
41
|
-
auth: true,
|
|
42
|
-
},
|
|
43
|
-
query: z.object({
|
|
44
|
-
accountId: accountIdSchema,
|
|
45
|
-
}),
|
|
46
|
-
responses: {
|
|
47
|
-
200: PreviewEmailThemeResponse,
|
|
48
|
-
401: UnauthorizedError,
|
|
49
|
-
403: ForbiddenError,
|
|
50
|
-
404: NotFoundError,
|
|
51
|
-
500: InternalError,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
getEmailThemesAdmin: {
|
|
55
|
-
summary: '[ADMIN] Get the email themes for the admin users',
|
|
56
|
-
method: 'GET',
|
|
57
|
-
path: '/admin',
|
|
58
|
-
metadata: {
|
|
59
|
-
auth: true,
|
|
60
|
-
},
|
|
61
|
-
query: PaginationOptionsZod.merge(GetEmailThemesAdminQuery),
|
|
62
|
-
responses: {
|
|
63
|
-
200: EmailThemesList,
|
|
64
|
-
401: UnauthorizedError,
|
|
65
|
-
403: ForbiddenError,
|
|
66
|
-
404: NotFoundError,
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
getDefaultEmailThemes: {
|
|
70
|
-
summary: '[ADMIN] Get the default email themes',
|
|
71
|
-
method: 'GET',
|
|
72
|
-
path: '/default-email-themes',
|
|
73
|
-
metadata: {
|
|
74
|
-
auth: true,
|
|
75
|
-
},
|
|
76
|
-
responses: {
|
|
77
|
-
200: GetDefaultEmailThemesZod,
|
|
78
|
-
401: UnauthorizedError,
|
|
79
|
-
403: ForbiddenError,
|
|
80
|
-
404: NotFoundError,
|
|
81
|
-
500: InternalError,
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
getEmailThemes: {
|
|
85
|
-
summary: '[ADMIN] Get the themes for the specified account',
|
|
86
|
-
method: 'GET',
|
|
87
|
-
path: '/account/:accountId',
|
|
88
|
-
metadata: {
|
|
89
|
-
auth: true,
|
|
90
|
-
},
|
|
91
|
-
pathParams: z.object({
|
|
92
|
-
accountId: accountIdSchema,
|
|
93
|
-
}),
|
|
94
|
-
responses: {
|
|
95
|
-
200: EmailThemesList,
|
|
96
|
-
401: UnauthorizedError,
|
|
97
|
-
403: ForbiddenError,
|
|
98
|
-
404: NotFoundError,
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
getEmailTheme: {
|
|
102
|
-
summary: '[ADMIN] Get the theme by id for the specified account',
|
|
103
|
-
method: 'GET',
|
|
104
|
-
path: '/:id',
|
|
105
|
-
metadata: {
|
|
106
|
-
auth: true,
|
|
107
|
-
},
|
|
108
|
-
pathParams: z.object({
|
|
109
|
-
id: emailThemeIdSchema,
|
|
110
|
-
}),
|
|
111
|
-
query: z.object({}).merge(EmailThemeFiltersZod),
|
|
112
|
-
responses: {
|
|
113
|
-
200: IEmailTheme,
|
|
114
|
-
401: UnauthorizedError,
|
|
115
|
-
403: ForbiddenError,
|
|
116
|
-
404: NotFoundError,
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
sendPreviewEmail: {
|
|
120
|
-
summary: '[ADMIN] Send a preview email',
|
|
121
|
-
method: 'POST',
|
|
122
|
-
path: '/send-preview-email',
|
|
123
|
-
metadata: {
|
|
124
|
-
auth: true,
|
|
125
|
-
},
|
|
126
|
-
body: ComplianceSendPreviewEmailZod,
|
|
127
|
-
responses: {
|
|
128
|
-
201: SendPreviewEmailResponse,
|
|
129
|
-
401: UnauthorizedError,
|
|
130
|
-
403: ForbiddenError,
|
|
131
|
-
404: NotFoundError,
|
|
132
|
-
500: InternalError,
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
sendTemplateEmail: {
|
|
136
|
-
summary: '[ADMIN] Send a template email',
|
|
137
|
-
method: 'POST',
|
|
138
|
-
path: '/send-template-email',
|
|
139
|
-
metadata: {
|
|
140
|
-
auth: true,
|
|
141
|
-
},
|
|
142
|
-
body: CompliancePreviewEmailThemeZod,
|
|
143
|
-
responses: {
|
|
144
|
-
201: SendPreviewEmailResponse,
|
|
145
|
-
401: UnauthorizedError,
|
|
146
|
-
403: ForbiddenError,
|
|
147
|
-
404: NotFoundError,
|
|
148
|
-
500: InternalError,
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
generateTemplatePreviewHtml: {
|
|
152
|
-
summary: '[ADMIN] Generate HTML for a template email',
|
|
153
|
-
method: 'POST',
|
|
154
|
-
path: '/generate-template-preview-html',
|
|
155
|
-
metadata: {
|
|
156
|
-
auth: true,
|
|
157
|
-
},
|
|
158
|
-
body: ComplianceGenerateTemplatePreviewHtmlZod,
|
|
159
|
-
responses: {
|
|
160
|
-
200: PreviewEmailThemeResponse,
|
|
161
|
-
401: UnauthorizedError,
|
|
162
|
-
403: ForbiddenError,
|
|
163
|
-
404: NotFoundError,
|
|
164
|
-
500: InternalError,
|
|
165
|
-
},
|
|
166
|
-
},
|
|
167
|
-
postEmailTheme: {
|
|
168
|
-
summary: '[ADMIN] Post a email theme',
|
|
169
|
-
method: 'POST',
|
|
170
|
-
path: '',
|
|
171
|
-
metadata: {
|
|
172
|
-
auth: true,
|
|
173
|
-
},
|
|
174
|
-
body: CompliancePostEmailThemeZod,
|
|
175
|
-
responses: {
|
|
176
|
-
201: IEmailTheme,
|
|
177
|
-
401: UnauthorizedError,
|
|
178
|
-
403: ForbiddenError,
|
|
179
|
-
404: NotFoundError,
|
|
180
|
-
500: InternalError,
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
patchEmailThemeSettings: {
|
|
185
|
-
summary: '[ADMIN] Patch email theme settings',
|
|
186
|
-
method: 'PATCH',
|
|
187
|
-
path: '/:id/email-theme-settings',
|
|
188
|
-
metadata: {
|
|
189
|
-
auth: true,
|
|
190
|
-
},
|
|
191
|
-
pathParams: z.object({
|
|
192
|
-
id: emailThemeIdSchema,
|
|
193
|
-
}),
|
|
194
|
-
body: CompliancePatchEmailThemeSettings,
|
|
195
|
-
responses: {
|
|
196
|
-
201: IEmailThemeSettings,
|
|
197
|
-
401: UnauthorizedError,
|
|
198
|
-
403: ForbiddenError,
|
|
199
|
-
404: NotFoundError,
|
|
200
|
-
500: InternalError,
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
patchEmailThemeSetting: {
|
|
204
|
-
summary: '[ADMIN] Patch a email theme setting',
|
|
205
|
-
method: 'PATCH',
|
|
206
|
-
path: '/:id/email-theme/:emailThemeId',
|
|
207
|
-
metadata: {
|
|
208
|
-
auth: true,
|
|
209
|
-
},
|
|
210
|
-
pathParams: z.object({
|
|
211
|
-
id: emailThemeSettingIdSchema,
|
|
212
|
-
emailThemeId: emailThemeIdSchema,
|
|
213
|
-
}),
|
|
214
|
-
body: CompliancePatchEmailThemeSetting,
|
|
215
|
-
responses: {
|
|
216
|
-
201: IEmailThemeSetting,
|
|
217
|
-
401: UnauthorizedError,
|
|
218
|
-
403: ForbiddenError,
|
|
219
|
-
404: NotFoundError,
|
|
220
|
-
500: InternalError,
|
|
221
|
-
},
|
|
222
|
-
},
|
|
223
|
-
importEmailThemeSettings: {
|
|
224
|
-
summary: '[ADMIN] Import email theme settings',
|
|
225
|
-
method: 'POST',
|
|
226
|
-
path: '/:id/import-email-theme-settings',
|
|
227
|
-
metadata: {
|
|
228
|
-
auth: true,
|
|
229
|
-
},
|
|
230
|
-
pathParams: z.object({
|
|
231
|
-
id: emailThemeIdSchema,
|
|
232
|
-
}),
|
|
233
|
-
body: ComplianceImportEmailThemeSettingsZod,
|
|
234
|
-
responses: {
|
|
235
|
-
201: IEmailThemeSettings,
|
|
236
|
-
401: UnauthorizedError,
|
|
237
|
-
403: ForbiddenError,
|
|
238
|
-
404: NotFoundError,
|
|
239
|
-
500: InternalError,
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
exportEmailThemeSettings: {
|
|
244
|
-
summary: '[ADMIN] Export email theme settings',
|
|
245
|
-
method: 'GET',
|
|
246
|
-
path: '/:id/export-email-theme-settings',
|
|
247
|
-
metadata: {
|
|
248
|
-
auth: true,
|
|
249
|
-
},
|
|
250
|
-
pathParams: z.object({
|
|
251
|
-
id: emailThemeIdSchema,
|
|
252
|
-
}),
|
|
253
|
-
responses: {
|
|
254
|
-
200: ExportEmailThemeSettingsZod,
|
|
255
|
-
401: UnauthorizedError,
|
|
256
|
-
403: ForbiddenError,
|
|
257
|
-
404: NotFoundError,
|
|
258
|
-
500: InternalError,
|
|
259
|
-
},
|
|
260
|
-
},
|
|
261
|
-
patchEmailThemeName: {
|
|
262
|
-
summary: '[ADMIN] Patch the name of a email theme',
|
|
263
|
-
method: 'PATCH',
|
|
264
|
-
path: '/:id/name',
|
|
265
|
-
metadata: {
|
|
266
|
-
auth: true,
|
|
267
|
-
},
|
|
268
|
-
pathParams: z.object({
|
|
269
|
-
id: emailThemeIdSchema,
|
|
270
|
-
}),
|
|
271
|
-
body: CompliancePatchEmailThemeNameZod,
|
|
272
|
-
responses: {
|
|
273
|
-
201: IEmailTheme,
|
|
274
|
-
401: UnauthorizedError,
|
|
275
|
-
403: ForbiddenError,
|
|
276
|
-
404: NotFoundError,
|
|
277
|
-
500: InternalError,
|
|
278
|
-
},
|
|
279
|
-
},
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
pathPrefix: 'email-themes',
|
|
283
|
-
},
|
|
284
|
-
);
|
|
@@ -1,85 +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
|
-
CompliancePostEscrowAccount,
|
|
12
|
-
escrowAccountIdSchema,
|
|
13
|
-
EscrowAccountsFilter,
|
|
14
|
-
EscrowAccountsIncludeQuery,
|
|
15
|
-
IEscrowAccount,
|
|
16
|
-
IPaginatedEscrowAccount,
|
|
17
|
-
PatchEscrowAccount,
|
|
18
|
-
} from '../../../common/types/escrow-account.types';
|
|
19
|
-
import { z } from 'zod';
|
|
20
|
-
|
|
21
|
-
const c = initContract();
|
|
22
|
-
|
|
23
|
-
export const escrowAccountsContract = c.router(
|
|
24
|
-
{
|
|
25
|
-
getEscrowAccounts: {
|
|
26
|
-
summary: 'Get escrow accounts',
|
|
27
|
-
method: 'GET',
|
|
28
|
-
path: '',
|
|
29
|
-
metadata: {
|
|
30
|
-
auth: true,
|
|
31
|
-
},
|
|
32
|
-
query: PaginationOptionsZod.merge(EscrowAccountsFilter).merge(
|
|
33
|
-
EscrowAccountsIncludeQuery,
|
|
34
|
-
),
|
|
35
|
-
responses: {
|
|
36
|
-
200: IPaginatedEscrowAccount,
|
|
37
|
-
401: UnauthorizedError,
|
|
38
|
-
403: ForbiddenError,
|
|
39
|
-
404: NotFoundError,
|
|
40
|
-
500: InternalError,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
postEscrowAccount: {
|
|
44
|
-
summary: 'Create an escrow account',
|
|
45
|
-
method: 'POST',
|
|
46
|
-
path: '',
|
|
47
|
-
metadata: {
|
|
48
|
-
auth: true,
|
|
49
|
-
},
|
|
50
|
-
body: CompliancePostEscrowAccount,
|
|
51
|
-
/*
|
|
52
|
-
for compliance portal we'll be taking accountId from body as `ESCROW ACCOUNT` will
|
|
53
|
-
be of some issuer.
|
|
54
|
-
*/
|
|
55
|
-
responses: {
|
|
56
|
-
201: IEscrowAccount,
|
|
57
|
-
400: BadRequestError,
|
|
58
|
-
401: UnauthorizedError,
|
|
59
|
-
404: NotFoundError,
|
|
60
|
-
500: InternalError,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
patchEscrowAccount: {
|
|
64
|
-
summary: 'Update escrow account',
|
|
65
|
-
method: 'PATCH',
|
|
66
|
-
path: '/:id',
|
|
67
|
-
metadata: {
|
|
68
|
-
auth: true,
|
|
69
|
-
},
|
|
70
|
-
pathParams: z.object({ id: escrowAccountIdSchema }),
|
|
71
|
-
body: PatchEscrowAccount,
|
|
72
|
-
responses: {
|
|
73
|
-
201: IEscrowAccount,
|
|
74
|
-
400: BadRequestError,
|
|
75
|
-
401: UnauthorizedError,
|
|
76
|
-
403: ForbiddenError,
|
|
77
|
-
404: NotFoundError,
|
|
78
|
-
500: InternalError,
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
pathPrefix: 'escrow-accounts',
|
|
84
|
-
},
|
|
85
|
-
);
|