@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,81 +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
|
-
IIssuerBankAccount,
|
|
12
|
-
IPaginatedIssuerBankAccount,
|
|
13
|
-
issuerBankAccountIdSchema,
|
|
14
|
-
IssuerBankAccountsFilter,
|
|
15
|
-
IssuerBankAccountsIncludeQuery,
|
|
16
|
-
PatchIssuerBankAccount,
|
|
17
|
-
PostIssuerBankAccount,
|
|
18
|
-
} from '../../../common/types/issuer-bank-account.types';
|
|
19
|
-
import { z } from 'zod';
|
|
20
|
-
|
|
21
|
-
const c = initContract();
|
|
22
|
-
|
|
23
|
-
export const issuerBankAccountsContract = c.router(
|
|
24
|
-
{
|
|
25
|
-
getIssuerBankAccounts: {
|
|
26
|
-
summary: 'Get issuer bank accounts',
|
|
27
|
-
method: 'GET',
|
|
28
|
-
path: '',
|
|
29
|
-
metadata: {
|
|
30
|
-
auth: true,
|
|
31
|
-
},
|
|
32
|
-
query: PaginationOptionsZod.merge(IssuerBankAccountsFilter).merge(
|
|
33
|
-
IssuerBankAccountsIncludeQuery,
|
|
34
|
-
),
|
|
35
|
-
responses: {
|
|
36
|
-
200: IPaginatedIssuerBankAccount,
|
|
37
|
-
401: UnauthorizedError,
|
|
38
|
-
403: ForbiddenError,
|
|
39
|
-
404: NotFoundError,
|
|
40
|
-
500: InternalError,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
postIssuerBankAccount: {
|
|
44
|
-
summary: 'Create an issuer bank account',
|
|
45
|
-
method: 'POST',
|
|
46
|
-
path: '',
|
|
47
|
-
metadata: {
|
|
48
|
-
auth: true,
|
|
49
|
-
},
|
|
50
|
-
body: PostIssuerBankAccount,
|
|
51
|
-
responses: {
|
|
52
|
-
201: IIssuerBankAccount,
|
|
53
|
-
400: BadRequestError,
|
|
54
|
-
401: UnauthorizedError,
|
|
55
|
-
404: NotFoundError,
|
|
56
|
-
500: InternalError,
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
patchIssuerBankAccount: {
|
|
60
|
-
summary: 'Update issuer bank account',
|
|
61
|
-
method: 'PATCH',
|
|
62
|
-
path: '/:id',
|
|
63
|
-
metadata: {
|
|
64
|
-
auth: true,
|
|
65
|
-
},
|
|
66
|
-
pathParams: z.object({ id: issuerBankAccountIdSchema }),
|
|
67
|
-
body: PatchIssuerBankAccount,
|
|
68
|
-
responses: {
|
|
69
|
-
201: IIssuerBankAccount,
|
|
70
|
-
400: BadRequestError,
|
|
71
|
-
401: UnauthorizedError,
|
|
72
|
-
403: ForbiddenError,
|
|
73
|
-
404: NotFoundError,
|
|
74
|
-
500: InternalError,
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
pathPrefix: 'issuer-bank-accounts',
|
|
80
|
-
},
|
|
81
|
-
);
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { initContract } from '@ts-rest/core';
|
|
2
|
-
import {
|
|
3
|
-
ForbiddenError,
|
|
4
|
-
InternalError,
|
|
5
|
-
NotFoundError,
|
|
6
|
-
UnauthorizedError,
|
|
7
|
-
GetIssuerPaymentMethodZod,
|
|
8
|
-
IIssuerPaymentMethod,
|
|
9
|
-
IPaginatedIssuerPaymentMethod,
|
|
10
|
-
issuerPaymentMethodIdSchema,
|
|
11
|
-
PatchIssuerPaymentMethodZod,
|
|
12
|
-
PaginationOptionsZod,
|
|
13
|
-
ConnectIssuerPaymentMethodZod,
|
|
14
|
-
BadRequestError,
|
|
15
|
-
} from '../../../common/types';
|
|
16
|
-
import { z } from 'zod';
|
|
17
|
-
|
|
18
|
-
const c = initContract();
|
|
19
|
-
|
|
20
|
-
export const issuerPaymentMethodsContract = c.router(
|
|
21
|
-
{
|
|
22
|
-
getIssuerPaymentMethods: {
|
|
23
|
-
summary: 'get payment methods',
|
|
24
|
-
method: 'GET',
|
|
25
|
-
path: '',
|
|
26
|
-
metadata: {
|
|
27
|
-
auth: true,
|
|
28
|
-
},
|
|
29
|
-
query: PaginationOptionsZod.merge(GetIssuerPaymentMethodZod),
|
|
30
|
-
responses: {
|
|
31
|
-
200: IPaginatedIssuerPaymentMethod,
|
|
32
|
-
401: UnauthorizedError,
|
|
33
|
-
403: ForbiddenError,
|
|
34
|
-
404: NotFoundError,
|
|
35
|
-
500: InternalError,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
patchIssuerPaymentMethod: {
|
|
39
|
-
summary: 'PATCH issuer payment method',
|
|
40
|
-
method: 'PATCH',
|
|
41
|
-
path: '/:id',
|
|
42
|
-
pathParams: z.object({
|
|
43
|
-
id: issuerPaymentMethodIdSchema,
|
|
44
|
-
}),
|
|
45
|
-
metadata: {
|
|
46
|
-
auth: true,
|
|
47
|
-
},
|
|
48
|
-
body: PatchIssuerPaymentMethodZod,
|
|
49
|
-
responses: {
|
|
50
|
-
201: IIssuerPaymentMethod,
|
|
51
|
-
401: UnauthorizedError,
|
|
52
|
-
403: ForbiddenError,
|
|
53
|
-
404: NotFoundError,
|
|
54
|
-
500: InternalError,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
toggleIssuerPaymentMethod: {
|
|
58
|
-
summary: 'Toggle issuer payment method',
|
|
59
|
-
method: 'PATCH',
|
|
60
|
-
path: '/:id/toggle',
|
|
61
|
-
metadata: {
|
|
62
|
-
auth: true,
|
|
63
|
-
},
|
|
64
|
-
pathParams: z.object({
|
|
65
|
-
id: issuerPaymentMethodIdSchema,
|
|
66
|
-
}),
|
|
67
|
-
body: z.object({
|
|
68
|
-
enabled: z.boolean(),
|
|
69
|
-
}),
|
|
70
|
-
responses: {
|
|
71
|
-
200: IIssuerPaymentMethod,
|
|
72
|
-
401: UnauthorizedError,
|
|
73
|
-
403: ForbiddenError,
|
|
74
|
-
404: NotFoundError,
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
connectIssuerPaymentMethod: {
|
|
78
|
-
summary: 'Connect issuer payment method',
|
|
79
|
-
method: 'POST',
|
|
80
|
-
path: '/integrations/connect',
|
|
81
|
-
metadata: {
|
|
82
|
-
auth: true,
|
|
83
|
-
},
|
|
84
|
-
body: ConnectIssuerPaymentMethodZod,
|
|
85
|
-
responses: {
|
|
86
|
-
200: z.array(IIssuerPaymentMethod),
|
|
87
|
-
400: BadRequestError,
|
|
88
|
-
401: UnauthorizedError,
|
|
89
|
-
403: ForbiddenError,
|
|
90
|
-
404: NotFoundError,
|
|
91
|
-
500: InternalError,
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
disconnectIssuerPaymentMethod: {
|
|
95
|
-
summary: 'Disconnect issuer payment method',
|
|
96
|
-
method: 'PATCH',
|
|
97
|
-
path: '/:id/integrations/disconnect',
|
|
98
|
-
metadata: {
|
|
99
|
-
auth: true,
|
|
100
|
-
},
|
|
101
|
-
pathParams: z.object({
|
|
102
|
-
id: issuerPaymentMethodIdSchema,
|
|
103
|
-
}),
|
|
104
|
-
body: z.object({}),
|
|
105
|
-
responses: {
|
|
106
|
-
200: IIssuerPaymentMethod,
|
|
107
|
-
401: UnauthorizedError,
|
|
108
|
-
403: ForbiddenError,
|
|
109
|
-
404: NotFoundError,
|
|
110
|
-
500: InternalError,
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
createIssuerPaymentMethodAccountLink: {
|
|
114
|
-
summary: 'Create issuer payment method account link',
|
|
115
|
-
method: 'POST',
|
|
116
|
-
path: '/:id/integrations/account-link',
|
|
117
|
-
metadata: {
|
|
118
|
-
auth: true,
|
|
119
|
-
},
|
|
120
|
-
pathParams: z.object({
|
|
121
|
-
id: issuerPaymentMethodIdSchema,
|
|
122
|
-
}),
|
|
123
|
-
body: z.object({}),
|
|
124
|
-
responses: {
|
|
125
|
-
200: IIssuerPaymentMethod,
|
|
126
|
-
401: UnauthorizedError,
|
|
127
|
-
403: ForbiddenError,
|
|
128
|
-
404: NotFoundError,
|
|
129
|
-
500: InternalError,
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
pathPrefix: 'issuer-payment-methods',
|
|
135
|
-
},
|
|
136
|
-
);
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { initContract } from '@ts-rest/core';
|
|
2
|
-
import {
|
|
3
|
-
ForbiddenError,
|
|
4
|
-
InternalError,
|
|
5
|
-
UnauthorizedError,
|
|
6
|
-
inquiryIdSchema,
|
|
7
|
-
InquiryResponse,
|
|
8
|
-
ServiceUnavailableError,
|
|
9
|
-
} from '../../../common/types';
|
|
10
|
-
import { z } from 'zod';
|
|
11
|
-
|
|
12
|
-
const c = initContract();
|
|
13
|
-
|
|
14
|
-
export const kycsContract = c.router(
|
|
15
|
-
{
|
|
16
|
-
getInquiry: {
|
|
17
|
-
summary: 'KYC inquiry by ID',
|
|
18
|
-
method: 'GET',
|
|
19
|
-
path: '/inquiries/:inquiryId',
|
|
20
|
-
metadata: {
|
|
21
|
-
auth: true,
|
|
22
|
-
},
|
|
23
|
-
pathParams: z.object({
|
|
24
|
-
inquiryId: inquiryIdSchema,
|
|
25
|
-
}),
|
|
26
|
-
responses: {
|
|
27
|
-
200: InquiryResponse,
|
|
28
|
-
401: UnauthorizedError,
|
|
29
|
-
403: ForbiddenError,
|
|
30
|
-
500: InternalError,
|
|
31
|
-
503: ServiceUnavailableError,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
pathPrefix: 'kycs',
|
|
37
|
-
},
|
|
38
|
-
);
|
|
@@ -1,51 +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
|
-
getLoginHistories: {
|
|
17
|
-
summary: 'Get Login Histories',
|
|
18
|
-
method: 'GET',
|
|
19
|
-
path: '',
|
|
20
|
-
metadata: {
|
|
21
|
-
auth: true,
|
|
22
|
-
},
|
|
23
|
-
responses: {
|
|
24
|
-
200: IListLoginHistories,
|
|
25
|
-
400: BadRequestError,
|
|
26
|
-
401: UnauthorizedError,
|
|
27
|
-
403: ForbiddenError,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
getLoginHistoriesByUserId: {
|
|
31
|
-
summary: 'Get Login Histories by User id',
|
|
32
|
-
method: 'GET',
|
|
33
|
-
path: '/:userId',
|
|
34
|
-
metadata: {
|
|
35
|
-
auth: true,
|
|
36
|
-
},
|
|
37
|
-
pathParams: z.object({
|
|
38
|
-
userId: userIdSchema,
|
|
39
|
-
}),
|
|
40
|
-
responses: {
|
|
41
|
-
200: IListLoginHistories,
|
|
42
|
-
400: BadRequestError,
|
|
43
|
-
401: UnauthorizedError,
|
|
44
|
-
403: ForbiddenError,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
pathPrefix: 'login-histories',
|
|
50
|
-
},
|
|
51
|
-
);
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { initContract } from '@ts-rest/core';
|
|
2
|
-
import {
|
|
3
|
-
BadRequestError,
|
|
4
|
-
InternalError,
|
|
5
|
-
IPaginatedNote,
|
|
6
|
-
noteIdSchema,
|
|
7
|
-
NotesFilters,
|
|
8
|
-
NoteZod,
|
|
9
|
-
NotFoundError,
|
|
10
|
-
PaginationOptionsZod,
|
|
11
|
-
PostNoteBody,
|
|
12
|
-
UnauthorizedError,
|
|
13
|
-
} from '../../../common/types';
|
|
14
|
-
import { z } from 'zod';
|
|
15
|
-
|
|
16
|
-
const c = initContract();
|
|
17
|
-
|
|
18
|
-
export const issuerNotesContract = c.router(
|
|
19
|
-
{
|
|
20
|
-
postNote: {
|
|
21
|
-
summary: 'Create a note',
|
|
22
|
-
method: 'POST',
|
|
23
|
-
path: '',
|
|
24
|
-
metadata: {
|
|
25
|
-
auth: true,
|
|
26
|
-
},
|
|
27
|
-
body: PostNoteBody,
|
|
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,206 +0,0 @@
|
|
|
1
|
-
import { initContract } from '@ts-rest/core';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import {
|
|
4
|
-
BadRequestError,
|
|
5
|
-
ForbiddenError,
|
|
6
|
-
IIssuerOffering,
|
|
7
|
-
InternalError,
|
|
8
|
-
IOffering,
|
|
9
|
-
IPaginatedIssuerOffering,
|
|
10
|
-
IssuerOfferingsDeleteResponse,
|
|
11
|
-
IssuerOfferingsFilterZod,
|
|
12
|
-
IssuerOfferingsIncludeQuery,
|
|
13
|
-
NotFoundError,
|
|
14
|
-
OfferingCapTableFiltersZod,
|
|
15
|
-
OfferingCapTableResponse,
|
|
16
|
-
offeringIdSchema,
|
|
17
|
-
OfferingsIncludeQuery,
|
|
18
|
-
OfferingSummaryFiltersZod,
|
|
19
|
-
PaginatedOfferingSummaryResponseZod,
|
|
20
|
-
PaginationOptionsZod,
|
|
21
|
-
PatchIssuerOffering,
|
|
22
|
-
PostIssuerOffering,
|
|
23
|
-
SubmitIssuerOfferingResponse,
|
|
24
|
-
UnauthorizedError,
|
|
25
|
-
} from '../../../common/types';
|
|
26
|
-
|
|
27
|
-
const c = initContract();
|
|
28
|
-
|
|
29
|
-
export const issuersOfferingsContract = c.router(
|
|
30
|
-
{
|
|
31
|
-
getOfferings: {
|
|
32
|
-
summary: 'Get offerings',
|
|
33
|
-
method: 'GET',
|
|
34
|
-
path: '',
|
|
35
|
-
metadata: {
|
|
36
|
-
auth: true,
|
|
37
|
-
},
|
|
38
|
-
query: PaginationOptionsZod.merge(IssuerOfferingsIncludeQuery).merge(
|
|
39
|
-
IssuerOfferingsFilterZod,
|
|
40
|
-
),
|
|
41
|
-
responses: {
|
|
42
|
-
200: IPaginatedIssuerOffering,
|
|
43
|
-
400: BadRequestError,
|
|
44
|
-
401: UnauthorizedError,
|
|
45
|
-
403: ForbiddenError,
|
|
46
|
-
500: InternalError,
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
getOfferingsSummary: {
|
|
50
|
-
summary: 'Get offerings summary',
|
|
51
|
-
method: 'GET',
|
|
52
|
-
path: '/summary',
|
|
53
|
-
metadata: {
|
|
54
|
-
auth: true,
|
|
55
|
-
},
|
|
56
|
-
query: PaginationOptionsZod.merge(OfferingSummaryFiltersZod),
|
|
57
|
-
responses: {
|
|
58
|
-
200: PaginatedOfferingSummaryResponseZod,
|
|
59
|
-
400: BadRequestError,
|
|
60
|
-
401: UnauthorizedError,
|
|
61
|
-
403: ForbiddenError,
|
|
62
|
-
500: InternalError,
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
getOfferingCapTable: {
|
|
66
|
-
summary: 'Get offering cap table',
|
|
67
|
-
method: 'GET',
|
|
68
|
-
path: '/:id/cap-table',
|
|
69
|
-
metadata: {
|
|
70
|
-
auth: true,
|
|
71
|
-
},
|
|
72
|
-
pathParams: z.object({
|
|
73
|
-
id: offeringIdSchema,
|
|
74
|
-
}),
|
|
75
|
-
query: OfferingCapTableFiltersZod,
|
|
76
|
-
responses: {
|
|
77
|
-
200: OfferingCapTableResponse,
|
|
78
|
-
400: BadRequestError,
|
|
79
|
-
401: UnauthorizedError,
|
|
80
|
-
403: ForbiddenError,
|
|
81
|
-
404: NotFoundError,
|
|
82
|
-
500: InternalError,
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
getOffering: {
|
|
86
|
-
summary: 'Get offering by id',
|
|
87
|
-
method: 'GET',
|
|
88
|
-
path: '/:id',
|
|
89
|
-
metadata: {
|
|
90
|
-
auth: true,
|
|
91
|
-
},
|
|
92
|
-
query: z.object({}).merge(OfferingsIncludeQuery),
|
|
93
|
-
pathParams: z.object({
|
|
94
|
-
id: offeringIdSchema,
|
|
95
|
-
}),
|
|
96
|
-
responses: {
|
|
97
|
-
200: IIssuerOffering,
|
|
98
|
-
400: BadRequestError,
|
|
99
|
-
401: UnauthorizedError,
|
|
100
|
-
403: ForbiddenError,
|
|
101
|
-
404: NotFoundError,
|
|
102
|
-
500: InternalError,
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
submitOffering: {
|
|
106
|
-
summary: 'Submit offering for review',
|
|
107
|
-
method: 'PATCH',
|
|
108
|
-
path: '/:id/submit',
|
|
109
|
-
metadata: {
|
|
110
|
-
auth: true,
|
|
111
|
-
},
|
|
112
|
-
pathParams: z.object({
|
|
113
|
-
id: offeringIdSchema,
|
|
114
|
-
}),
|
|
115
|
-
body: z.object({}),
|
|
116
|
-
responses: {
|
|
117
|
-
201: SubmitIssuerOfferingResponse,
|
|
118
|
-
400: BadRequestError,
|
|
119
|
-
401: UnauthorizedError,
|
|
120
|
-
403: ForbiddenError,
|
|
121
|
-
404: NotFoundError,
|
|
122
|
-
500: InternalError,
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
patchOffering: {
|
|
126
|
-
summary: 'Update offering by id',
|
|
127
|
-
method: 'PATCH',
|
|
128
|
-
path: '/:id',
|
|
129
|
-
metadata: {
|
|
130
|
-
auth: true,
|
|
131
|
-
},
|
|
132
|
-
pathParams: z.object({
|
|
133
|
-
id: offeringIdSchema,
|
|
134
|
-
}),
|
|
135
|
-
body: PatchIssuerOffering,
|
|
136
|
-
responses: {
|
|
137
|
-
201: IIssuerOffering,
|
|
138
|
-
400: BadRequestError,
|
|
139
|
-
401: UnauthorizedError,
|
|
140
|
-
403: ForbiddenError,
|
|
141
|
-
404: NotFoundError,
|
|
142
|
-
500: InternalError,
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
postOffering: {
|
|
146
|
-
summary: '[ADMIN] Create offering',
|
|
147
|
-
method: 'POST',
|
|
148
|
-
path: '',
|
|
149
|
-
metadata: {
|
|
150
|
-
auth: true,
|
|
151
|
-
},
|
|
152
|
-
body: PostIssuerOffering,
|
|
153
|
-
responses: {
|
|
154
|
-
201: IIssuerOffering,
|
|
155
|
-
400: BadRequestError,
|
|
156
|
-
401: UnauthorizedError,
|
|
157
|
-
403: ForbiddenError,
|
|
158
|
-
500: InternalError,
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
toggleOffering: {
|
|
162
|
-
summary: 'Toggle offering by id',
|
|
163
|
-
method: 'PATCH',
|
|
164
|
-
path: '/:id/toggle',
|
|
165
|
-
metadata: {
|
|
166
|
-
auth: true,
|
|
167
|
-
},
|
|
168
|
-
pathParams: z.object({
|
|
169
|
-
id: offeringIdSchema,
|
|
170
|
-
}),
|
|
171
|
-
body: z.object({
|
|
172
|
-
enabled: z.boolean(),
|
|
173
|
-
}),
|
|
174
|
-
responses: {
|
|
175
|
-
200: IOffering,
|
|
176
|
-
400: BadRequestError,
|
|
177
|
-
401: UnauthorizedError,
|
|
178
|
-
403: ForbiddenError,
|
|
179
|
-
404: NotFoundError,
|
|
180
|
-
500: InternalError,
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
deleteOffering: {
|
|
184
|
-
summary: 'Delete offering by id',
|
|
185
|
-
method: 'DELETE',
|
|
186
|
-
path: '/:id',
|
|
187
|
-
metadata: {
|
|
188
|
-
auth: true,
|
|
189
|
-
},
|
|
190
|
-
pathParams: z.object({
|
|
191
|
-
id: offeringIdSchema,
|
|
192
|
-
}),
|
|
193
|
-
responses: {
|
|
194
|
-
200: IssuerOfferingsDeleteResponse,
|
|
195
|
-
400: BadRequestError,
|
|
196
|
-
401: UnauthorizedError,
|
|
197
|
-
403: ForbiddenError,
|
|
198
|
-
404: NotFoundError,
|
|
199
|
-
500: InternalError,
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
pathPrefix: 'offerings',
|
|
205
|
-
},
|
|
206
|
-
);
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { initContract } from '@ts-rest/core';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
BadRequestError,
|
|
5
|
-
ForbiddenError,
|
|
6
|
-
InternalError,
|
|
7
|
-
NotFoundError,
|
|
8
|
-
PaginationOptionsZod,
|
|
9
|
-
UnauthorizedError,
|
|
10
|
-
pageRevisionIdSchema,
|
|
11
|
-
PagesIncludeQuery,
|
|
12
|
-
GetPagesZod,
|
|
13
|
-
IPaginatedPages,
|
|
14
|
-
pageIdSchema,
|
|
15
|
-
IPage,
|
|
16
|
-
PostPageZod,
|
|
17
|
-
PatchPageZod,
|
|
18
|
-
ConflictError,
|
|
19
|
-
IPageRevision,
|
|
20
|
-
GetLandingPageCandidatesResponse,
|
|
21
|
-
} from '../../../common/types';
|
|
22
|
-
|
|
23
|
-
import { z } from 'zod';
|
|
24
|
-
const c = initContract();
|
|
25
|
-
|
|
26
|
-
export const pagesContract = c.router(
|
|
27
|
-
{
|
|
28
|
-
getPages: {
|
|
29
|
-
summary: 'Get Pages',
|
|
30
|
-
method: 'GET',
|
|
31
|
-
path: '',
|
|
32
|
-
metadata: {
|
|
33
|
-
auth: true,
|
|
34
|
-
},
|
|
35
|
-
query: PaginationOptionsZod.merge(PagesIncludeQuery).merge(GetPagesZod),
|
|
36
|
-
responses: {
|
|
37
|
-
200: IPaginatedPages,
|
|
38
|
-
400: BadRequestError,
|
|
39
|
-
401: UnauthorizedError,
|
|
40
|
-
403: ForbiddenError,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
getLandingPageCandidates: {
|
|
44
|
-
summary: 'Get pages that are qualified to be presented as landing page',
|
|
45
|
-
method: 'GET',
|
|
46
|
-
path: '/landing-page-candidates',
|
|
47
|
-
metadata: {
|
|
48
|
-
auth: true,
|
|
49
|
-
},
|
|
50
|
-
responses: {
|
|
51
|
-
200: GetLandingPageCandidatesResponse,
|
|
52
|
-
400: BadRequestError,
|
|
53
|
-
401: UnauthorizedError,
|
|
54
|
-
403: ForbiddenError,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
getPage: {
|
|
58
|
-
summary: 'Get Page',
|
|
59
|
-
method: 'GET',
|
|
60
|
-
path: '/:id',
|
|
61
|
-
metadata: {
|
|
62
|
-
auth: true,
|
|
63
|
-
},
|
|
64
|
-
query: z.object({}).merge(PagesIncludeQuery),
|
|
65
|
-
pathParams: z.object({
|
|
66
|
-
id: pageIdSchema,
|
|
67
|
-
}),
|
|
68
|
-
responses: {
|
|
69
|
-
200: IPage,
|
|
70
|
-
400: BadRequestError,
|
|
71
|
-
401: UnauthorizedError,
|
|
72
|
-
403: ForbiddenError,
|
|
73
|
-
404: NotFoundError,
|
|
74
|
-
500: InternalError,
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
postPage: {
|
|
78
|
-
summary: 'Post Pages',
|
|
79
|
-
method: 'POST',
|
|
80
|
-
path: '',
|
|
81
|
-
metadata: {
|
|
82
|
-
auth: true,
|
|
83
|
-
},
|
|
84
|
-
body: PostPageZod,
|
|
85
|
-
responses: {
|
|
86
|
-
201: IPage,
|
|
87
|
-
400: BadRequestError,
|
|
88
|
-
401: UnauthorizedError,
|
|
89
|
-
403: ForbiddenError,
|
|
90
|
-
409: ConflictError,
|
|
91
|
-
500: InternalError,
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
updatePublishedVersion: {
|
|
95
|
-
summary: 'Update the current published version',
|
|
96
|
-
method: 'PATCH',
|
|
97
|
-
path: '/published-version',
|
|
98
|
-
metadata: {
|
|
99
|
-
auth: true,
|
|
100
|
-
},
|
|
101
|
-
body: z.object({
|
|
102
|
-
id: pageRevisionIdSchema,
|
|
103
|
-
}),
|
|
104
|
-
responses: {
|
|
105
|
-
201: IPageRevision,
|
|
106
|
-
400: BadRequestError,
|
|
107
|
-
401: UnauthorizedError,
|
|
108
|
-
403: ForbiddenError,
|
|
109
|
-
404: NotFoundError,
|
|
110
|
-
500: InternalError,
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
patchPage: {
|
|
114
|
-
summary: 'Patch Pages',
|
|
115
|
-
method: 'PATCH',
|
|
116
|
-
path: '/:id',
|
|
117
|
-
metadata: {
|
|
118
|
-
auth: true,
|
|
119
|
-
},
|
|
120
|
-
pathParams: z.object({
|
|
121
|
-
id: pageIdSchema,
|
|
122
|
-
}),
|
|
123
|
-
body: PatchPageZod,
|
|
124
|
-
responses: {
|
|
125
|
-
201: IPage,
|
|
126
|
-
400: BadRequestError,
|
|
127
|
-
401: UnauthorizedError,
|
|
128
|
-
403: ForbiddenError,
|
|
129
|
-
409: ConflictError,
|
|
130
|
-
404: NotFoundError,
|
|
131
|
-
500: InternalError,
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
pathPrefix: 'pages',
|
|
137
|
-
},
|
|
138
|
-
);
|