@dalmore/api-contracts 0.0.0-dev.d6badc9 → 0.0.0-dev.e6235a7
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/common/types/account-contact.types.ts +2 -1
- package/common/types/account-manager.types.ts +3 -7
- package/common/types/auth.types.ts +7 -18
- package/common/types/common.types.ts +16 -0
- package/common/types/contact-us.types.ts +6 -2
- package/common/types/covered-person.types.ts +2 -1
- package/common/types/escrow-account.types.ts +3 -3
- package/common/types/individuals.types.ts +3 -2
- package/common/types/investor-account.types.ts +2 -1
- package/common/types/invite.types.ts +27 -1
- package/common/types/legal-entity.types.ts +3 -2
- package/common/types/site-settings.types.ts +2 -1
- package/common/types/trusted-contact.types.ts +7 -7
- package/common/types/user.types.ts +2 -5
- package/contracts/compliance/auth/index.ts +4 -3
- package/contracts/compliance/invites/index.ts +4 -12
- package/contracts/issuers/auth/index.ts +4 -3
- package/contracts/issuers/disbursements/index.ts +17 -17
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ import { PhoneZodSchema } from './phone.type';
|
|
|
6
6
|
import {
|
|
7
7
|
AccountContactType,
|
|
8
8
|
AccountZod,
|
|
9
|
+
EmailSchema,
|
|
9
10
|
IPaginationMeta,
|
|
10
11
|
} from './common.types';
|
|
11
12
|
import { IBaseEntity } from './entity.types';
|
|
@@ -60,7 +61,7 @@ export const PatchAccountContactZod = z.object({
|
|
|
60
61
|
.openapi({ example: 'Mr' }),
|
|
61
62
|
firstName: z.string().min(1).max(150).openapi({ example: 'John' }),
|
|
62
63
|
lastName: z.string().min(1).max(150).openapi({ example: 'Doe' }),
|
|
63
|
-
email:
|
|
64
|
+
email: EmailSchema.openapi({ example: 'john.doe@example.com' }),
|
|
64
65
|
phone: PhoneZodSchema.nullable()
|
|
65
66
|
.optional()
|
|
66
67
|
.openapi({ example: '+12124567890' }),
|
|
@@ -4,7 +4,7 @@ import { TypeID } from 'typeid-js';
|
|
|
4
4
|
import { IBaseEntity } from './entity.types';
|
|
5
5
|
import { PhoneNumberData } from './sms.types';
|
|
6
6
|
import { userIdSchema, UserZod } from './user.types';
|
|
7
|
-
import { IPaginationMeta } from './common.types';
|
|
7
|
+
import { EmailSchema, IPaginationMeta } from './common.types';
|
|
8
8
|
import { PhoneZodSchema } from './phone.type';
|
|
9
9
|
|
|
10
10
|
extendZodWithOpenApi(z);
|
|
@@ -68,7 +68,7 @@ export type IAccountManagerZod = z.infer<typeof IAccountManagerZod>;
|
|
|
68
68
|
export const PostAccountManagerZod = z.object({
|
|
69
69
|
firstName: z.string().min(1).max(255).openapi({ example: 'John' }),
|
|
70
70
|
lastName: z.string().min(1).max(255).openapi({ example: 'Doe' }),
|
|
71
|
-
email:
|
|
71
|
+
email: EmailSchema,
|
|
72
72
|
phone: PhoneZodSchema.nullable()
|
|
73
73
|
.optional()
|
|
74
74
|
.openapi({ example: '+12124567890' }),
|
|
@@ -80,11 +80,7 @@ export type PostAccountManagerZod = z.infer<typeof PostAccountManagerZod>;
|
|
|
80
80
|
export const PatchAccountManagerZod = z.object({
|
|
81
81
|
firstName: z.string().min(1).max(255).optional().openapi({ example: 'John' }),
|
|
82
82
|
lastName: z.string().min(1).max(255).optional().openapi({ example: 'Doe' }),
|
|
83
|
-
email:
|
|
84
|
-
.string()
|
|
85
|
-
.email()
|
|
86
|
-
.optional()
|
|
87
|
-
.openapi({ example: 'john.doe@example.com' }),
|
|
83
|
+
email: EmailSchema.optional(),
|
|
88
84
|
phone: PhoneZodSchema.nullable()
|
|
89
85
|
.optional()
|
|
90
86
|
.openapi({ example: '+12124567890' }),
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
ManagedByType,
|
|
9
9
|
UserRole,
|
|
10
10
|
createUrlSchema,
|
|
11
|
+
EmailSchema,
|
|
11
12
|
} from './common.types';
|
|
12
13
|
import { TypeID } from 'typeid-js';
|
|
13
14
|
import { TwoFactorMethod } from './sms.types';
|
|
@@ -60,13 +61,7 @@ const BaseAuthBody = z.object({
|
|
|
60
61
|
.openapi({
|
|
61
62
|
example: 'Armstrong',
|
|
62
63
|
}),
|
|
63
|
-
email:
|
|
64
|
-
.string()
|
|
65
|
-
.email()
|
|
66
|
-
.transform((val) => val.toLowerCase())
|
|
67
|
-
.openapi({
|
|
68
|
-
example: 'neil@dalmoregroup.com',
|
|
69
|
-
}),
|
|
64
|
+
email: EmailSchema,
|
|
70
65
|
password: PasswordSchema,
|
|
71
66
|
});
|
|
72
67
|
|
|
@@ -99,13 +94,7 @@ export const IChangePasswordBodyZod = z
|
|
|
99
94
|
});
|
|
100
95
|
|
|
101
96
|
export const LoginBody = z.object({
|
|
102
|
-
email:
|
|
103
|
-
.string()
|
|
104
|
-
.email()
|
|
105
|
-
.transform((val) => val.toLowerCase())
|
|
106
|
-
.openapi({
|
|
107
|
-
example: 'neil@dalmoregroup.com',
|
|
108
|
-
}),
|
|
97
|
+
email: EmailSchema,
|
|
109
98
|
password: z.string().openapi({
|
|
110
99
|
example: 'Secretpassword6#',
|
|
111
100
|
}),
|
|
@@ -297,7 +286,7 @@ export const RegisterBodyInvestors = BaseAuthBody.extend({
|
|
|
297
286
|
});
|
|
298
287
|
|
|
299
288
|
export const ResetPasswordVerifyBody = z.object({
|
|
300
|
-
email:
|
|
289
|
+
email: EmailSchema,
|
|
301
290
|
code: z.string().length(6, 'code is not 6 characters').openapi({
|
|
302
291
|
example: '123456',
|
|
303
292
|
}),
|
|
@@ -315,7 +304,7 @@ export type ResetPasswordVerifyResponseType = z.infer<
|
|
|
315
304
|
>;
|
|
316
305
|
|
|
317
306
|
export const ResetPasswordBody = z.object({
|
|
318
|
-
email:
|
|
307
|
+
email: EmailSchema,
|
|
319
308
|
code: z.string().length(6, 'code is not 6 characters').openapi({
|
|
320
309
|
example: '123456',
|
|
321
310
|
}),
|
|
@@ -337,7 +326,7 @@ export type ClientAuthSuccessResponse = z.infer<
|
|
|
337
326
|
>;
|
|
338
327
|
|
|
339
328
|
export const AdminForgotPasswordRequestZod = z.object({
|
|
340
|
-
email:
|
|
329
|
+
email: EmailSchema,
|
|
341
330
|
portal: z.nativeEnum(PortalType),
|
|
342
331
|
});
|
|
343
332
|
export type AdminForgotPasswordRequestZod = z.infer<
|
|
@@ -345,7 +334,7 @@ export type AdminForgotPasswordRequestZod = z.infer<
|
|
|
345
334
|
>;
|
|
346
335
|
|
|
347
336
|
export const InvestorForgotPasswordRequestZod = z.object({
|
|
348
|
-
email:
|
|
337
|
+
email: EmailSchema,
|
|
349
338
|
url: createUrlSchema({ strict: true }),
|
|
350
339
|
});
|
|
351
340
|
export type InvestorForgotPasswordRequestZod = z.infer<
|
|
@@ -1528,3 +1528,19 @@ export const StringToBooleanSchema = z.preprocess(
|
|
|
1528
1528
|
z.boolean(),
|
|
1529
1529
|
);
|
|
1530
1530
|
export type StringToBooleanSchema = z.infer<typeof StringToBooleanSchema>;
|
|
1531
|
+
|
|
1532
|
+
/**
|
|
1533
|
+
* Reusable email schema that validates email format, transforms to lowercase,
|
|
1534
|
+
* and includes OpenAPI metadata.
|
|
1535
|
+
*
|
|
1536
|
+
* @example
|
|
1537
|
+
* EmailSchema.parse('John.Doe@EXAMPLE.COM'); // returns 'john.doe@example.com'
|
|
1538
|
+
* EmailSchema.optional().parse(undefined); // returns undefined
|
|
1539
|
+
*/
|
|
1540
|
+
export const EmailSchema = z
|
|
1541
|
+
.string()
|
|
1542
|
+
.email()
|
|
1543
|
+
.transform((val) => val.toLowerCase())
|
|
1544
|
+
.openapi({
|
|
1545
|
+
example: 'neil@dalmoregroup.com',
|
|
1546
|
+
});
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { extendZodWithOpenApi } from '@anatine/zod-openapi';
|
|
3
3
|
import { TypeID } from 'typeid-js';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
BaseContactUsOptions,
|
|
6
|
+
createUrlSchema,
|
|
7
|
+
EmailSchema,
|
|
8
|
+
} from './common.types';
|
|
5
9
|
extendZodWithOpenApi(z);
|
|
6
10
|
|
|
7
11
|
export const contactUsIdSchema = z.string().refine(
|
|
@@ -55,7 +59,7 @@ export const InvestorPostContactUsZod = PostContactUsZod.extend({
|
|
|
55
59
|
export type InvestorPostContactUsZod = z.infer<typeof InvestorPostContactUsZod>;
|
|
56
60
|
|
|
57
61
|
export const PublicInvestorContactUsZod = PostContactUsZod.extend({
|
|
58
|
-
email:
|
|
62
|
+
email: EmailSchema,
|
|
59
63
|
firstName: z.string().min(1).max(100).openapi({ example: 'John' }),
|
|
60
64
|
lastName: z.string().min(1).max(100).openapi({ example: 'Doe' }),
|
|
61
65
|
contactOption: z.nativeEnum(InvestorContactOptions).openapi({
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
ComplianceReview,
|
|
7
7
|
CoveredPersonsRoleType,
|
|
8
8
|
CoveredPersonsStatus,
|
|
9
|
+
EmailSchema,
|
|
9
10
|
IDType,
|
|
10
11
|
IPaginationMeta,
|
|
11
12
|
} from './common.types';
|
|
@@ -137,7 +138,7 @@ export const PatchCoveredPersonsZod = z
|
|
|
137
138
|
.openapi({ example: CoveredPersonsRoleType.ACCOUNTING }),
|
|
138
139
|
|
|
139
140
|
ownership: z.number().min(0).max(100).openapi({ example: 15 }).optional(),
|
|
140
|
-
email:
|
|
141
|
+
email: EmailSchema.nullable().optional(),
|
|
141
142
|
idType: z
|
|
142
143
|
.nativeEnum(IDType)
|
|
143
144
|
.optional()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { extendZodWithOpenApi } from '@anatine/zod-openapi';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { AccountZod, IPaginationMeta } from './common.types';
|
|
3
|
+
import { AccountZod, EmailSchema, IPaginationMeta } from './common.types';
|
|
4
4
|
import { IBaseEntity } from './entity.types';
|
|
5
5
|
import { TypeID } from 'typeid-js';
|
|
6
6
|
import { accountIdSchema } from './account.types';
|
|
@@ -43,7 +43,7 @@ export const PostEscrowAccount = z.object({
|
|
|
43
43
|
accountNumber: z.string().optional().nullable(),
|
|
44
44
|
routingNumber: z.string().min(9).max(9).optional().nullable(),
|
|
45
45
|
agentName: z.string().min(2).max(50),
|
|
46
|
-
agentEmail:
|
|
46
|
+
agentEmail: EmailSchema,
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
export type PostEscrowAccount = z.infer<typeof PostEscrowAccount>;
|
|
@@ -65,7 +65,7 @@ export const PatchEscrowAccount = z.object({
|
|
|
65
65
|
accountNumber: z.string().min(10).max(18).optional().nullable().optional(),
|
|
66
66
|
routingNumber: z.string().min(9).max(9).optional().nullable().optional(),
|
|
67
67
|
agentName: z.string().min(2).max(50).optional(),
|
|
68
|
-
agentEmail:
|
|
68
|
+
agentEmail: EmailSchema.optional(),
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
export type PatchEscrowAccount = z.infer<typeof PatchEscrowAccount>;
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
EmploymentStatus,
|
|
17
17
|
SourceOfIncome,
|
|
18
18
|
AMLProvider,
|
|
19
|
+
EmailSchema,
|
|
19
20
|
} from './common.types';
|
|
20
21
|
import { IBaseEntity } from './entity.types';
|
|
21
22
|
import { IInvestorAccount } from './investor-account.types';
|
|
@@ -288,7 +289,7 @@ export const PostIndividualBodySchema = z
|
|
|
288
289
|
.string()
|
|
289
290
|
.length(3, 'currencyCode must be 3 digits')
|
|
290
291
|
.optional(),
|
|
291
|
-
email:
|
|
292
|
+
email: EmailSchema.optional(),
|
|
292
293
|
role: z.nativeEnum(IndividualRole),
|
|
293
294
|
phone: PhoneZodSchema.openapi({ example: '+12124567890' }).optional(),
|
|
294
295
|
ownership: z.coerce
|
|
@@ -387,7 +388,7 @@ export const UpdateIndividualBodySchema = z
|
|
|
387
388
|
.length(3, 'currencyCode must be 3 digits')
|
|
388
389
|
.optional(),
|
|
389
390
|
phone: PhoneZodSchema.openapi({ example: '+12124567890' }).optional(),
|
|
390
|
-
email:
|
|
391
|
+
email: EmailSchema.optional(),
|
|
391
392
|
ownership: z.coerce
|
|
392
393
|
.number()
|
|
393
394
|
.min(0, 'Ownership is less than 0')
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
SortBy,
|
|
25
25
|
SortOrder,
|
|
26
26
|
AMLProvider,
|
|
27
|
+
EmailSchema,
|
|
27
28
|
} from './common.types';
|
|
28
29
|
import { accountIdSchema } from './account.types';
|
|
29
30
|
import { SaStatus, tradeIdSchema, TradeZod } from './trade.types';
|
|
@@ -131,7 +132,7 @@ export type PostClientInvestorAccountBody = z.infer<
|
|
|
131
132
|
|
|
132
133
|
export const UpdateInvestorAccountBodySchema = z.object({
|
|
133
134
|
name: z.string().optional(),
|
|
134
|
-
email:
|
|
135
|
+
email: EmailSchema.optional(),
|
|
135
136
|
});
|
|
136
137
|
export type UpdateInvestorAccountBody = z.infer<
|
|
137
138
|
typeof UpdateInvestorAccountBodySchema
|
|
@@ -3,7 +3,9 @@ import {
|
|
|
3
3
|
AccountZod,
|
|
4
4
|
IPaginationMeta,
|
|
5
5
|
IssuerRole,
|
|
6
|
+
PortalType,
|
|
6
7
|
UserRole,
|
|
8
|
+
EmailSchema,
|
|
7
9
|
} from './common.types';
|
|
8
10
|
import { extendZodWithOpenApi } from '@anatine/zod-openapi';
|
|
9
11
|
import { TypeID } from 'typeid-js';
|
|
@@ -48,7 +50,7 @@ export const InviteWithUrl = InviteWithoutSecretZod.extend({
|
|
|
48
50
|
export type InviteWithUrl = z.infer<typeof InviteWithUrl>;
|
|
49
51
|
|
|
50
52
|
export const PostIssuerInviteZod = z.object({
|
|
51
|
-
email:
|
|
53
|
+
email: EmailSchema,
|
|
52
54
|
role: z.nativeEnum(IssuerRole),
|
|
53
55
|
});
|
|
54
56
|
|
|
@@ -131,3 +133,27 @@ export const PatchInviteForComplianceZod = PatchInviteRoleZod.extend({
|
|
|
131
133
|
export type PatchInviteForComplianceZod = z.infer<
|
|
132
134
|
typeof PatchInviteForComplianceZod
|
|
133
135
|
>;
|
|
136
|
+
|
|
137
|
+
export const PostInviteZod = z.object({
|
|
138
|
+
email: EmailSchema,
|
|
139
|
+
role: z.nativeEnum(UserRole).openapi({
|
|
140
|
+
example: UserRole.ADMIN,
|
|
141
|
+
}),
|
|
142
|
+
accountId: z.string().optional().openapi({
|
|
143
|
+
example: 'account_01j5y5ghx5fg68d663j1fvy2x7',
|
|
144
|
+
}),
|
|
145
|
+
portalType: z.nativeEnum(PortalType).optional().openapi({
|
|
146
|
+
example: PortalType.ISSUER,
|
|
147
|
+
}),
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
export type PostInviteZod = z.infer<typeof PostInviteZod>;
|
|
151
|
+
|
|
152
|
+
export const CompliancePostInviteZod = z.object({
|
|
153
|
+
email: EmailSchema,
|
|
154
|
+
role: z.nativeEnum(UserRole).openapi({
|
|
155
|
+
example: UserRole.ADMIN,
|
|
156
|
+
}),
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
export type CompliancePostInviteZod = z.infer<typeof CompliancePostInviteZod>;
|
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { IBaseEntity } from './entity.types';
|
|
3
3
|
import {
|
|
4
4
|
dateSchema,
|
|
5
|
+
EmailSchema,
|
|
5
6
|
IPaginationMeta,
|
|
6
7
|
KYBStatus,
|
|
7
8
|
SanctionsStatus,
|
|
@@ -138,7 +139,7 @@ export const PostLegalEntitySchema = z
|
|
|
138
139
|
investorAccountId: investorAccountIdSchema,
|
|
139
140
|
name: CompanyNameSchema,
|
|
140
141
|
ein: EINSchema,
|
|
141
|
-
email:
|
|
142
|
+
email: EmailSchema.optional(),
|
|
142
143
|
companyType: CompanyTypeSchema.optional(),
|
|
143
144
|
phone: PhoneZodSchema.openapi({ example: '+12124567890' }).optional(),
|
|
144
145
|
dateOfIncorporation: z.lazy(() => dateSchema).optional(),
|
|
@@ -153,7 +154,7 @@ export const UpdateLegalEntitySchema = z
|
|
|
153
154
|
id: legalEntityIdSchema.optional(),
|
|
154
155
|
name: CompanyNameSchema.optional(),
|
|
155
156
|
ein: EINSchema,
|
|
156
|
-
email:
|
|
157
|
+
email: EmailSchema.optional(),
|
|
157
158
|
companyType: CompanyTypeSchema.optional(),
|
|
158
159
|
phone: PhoneZodSchema.openapi({ example: '+12124567890' }).optional(),
|
|
159
160
|
dateOfIncorporation: z.lazy(() => dateSchema).optional(),
|
|
@@ -3,6 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
import { fileIdSchema } from './file.types';
|
|
4
4
|
import {
|
|
5
5
|
AccountZod,
|
|
6
|
+
EmailSchema,
|
|
6
7
|
HexCodeColorSchema,
|
|
7
8
|
IPaginationMeta,
|
|
8
9
|
SubdomainSchema,
|
|
@@ -462,7 +463,7 @@ export const GetSenderEmailZod = z.object({
|
|
|
462
463
|
export type GetSenderEmailZod = z.infer<typeof GetSenderEmailZod>;
|
|
463
464
|
|
|
464
465
|
export const PatchSenderEmailZod = z.object({
|
|
465
|
-
senderEmail:
|
|
466
|
+
senderEmail: EmailSchema,
|
|
466
467
|
});
|
|
467
468
|
export type PatchSenderEmailZod = z.infer<typeof PatchSenderEmailZod>;
|
|
468
469
|
|
|
@@ -2,7 +2,11 @@ import { extendZodWithOpenApi } from '@anatine/zod-openapi';
|
|
|
2
2
|
import { TypeID } from 'typeid-js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { IBaseEntity } from './entity.types';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
EmailSchema,
|
|
7
|
+
IPaginationMeta,
|
|
8
|
+
TrustedContactRelationship,
|
|
9
|
+
} from './common.types';
|
|
6
10
|
import { PhoneZodSchema } from './phone.type';
|
|
7
11
|
import { AddressSchema } from './address.types';
|
|
8
12
|
import { investorAccountIdSchema } from './investor-account.types';
|
|
@@ -68,7 +72,7 @@ export const PostTrustedContactZod = z
|
|
|
68
72
|
.object({
|
|
69
73
|
firstName: z.string().min(1).max(255).openapi({ example: 'John' }),
|
|
70
74
|
lastName: z.string().min(1).max(255).openapi({ example: 'Doe' }),
|
|
71
|
-
email:
|
|
75
|
+
email: EmailSchema.openapi({ example: 'john.doe@example.com' }),
|
|
72
76
|
phone: PhoneZodSchema.nullable().optional(),
|
|
73
77
|
relationship: z
|
|
74
78
|
.nativeEnum(TrustedContactRelationship)
|
|
@@ -92,11 +96,7 @@ export const PatchTrustedContactZod = z
|
|
|
92
96
|
.optional()
|
|
93
97
|
.openapi({ example: 'John' }),
|
|
94
98
|
lastName: z.string().min(1).max(255).optional().openapi({ example: 'Doe' }),
|
|
95
|
-
email:
|
|
96
|
-
.string()
|
|
97
|
-
.email()
|
|
98
|
-
.optional()
|
|
99
|
-
.openapi({ example: 'john.doe@example.com' }),
|
|
99
|
+
email: EmailSchema.optional(),
|
|
100
100
|
phone: PhoneZodSchema.nullable().optional(),
|
|
101
101
|
relationship: z.nativeEnum(TrustedContactRelationship).optional().openapi({
|
|
102
102
|
example: TrustedContactRelationship.CHILD,
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
StringToBooleanSchema,
|
|
12
12
|
UserRole,
|
|
13
13
|
UserType,
|
|
14
|
+
EmailSchema,
|
|
14
15
|
} from './common.types';
|
|
15
16
|
import { dateOrString, IBaseEntity } from './entity.types';
|
|
16
17
|
import { PhoneZodSchema } from './phone.type';
|
|
@@ -147,11 +148,7 @@ export const UserMeUpdateZod = z.object({
|
|
|
147
148
|
firstName: z.string().optional(),
|
|
148
149
|
lastName: z.string().optional(),
|
|
149
150
|
password: z.string().min(6).optional(),
|
|
150
|
-
email:
|
|
151
|
-
.string()
|
|
152
|
-
.email()
|
|
153
|
-
.transform((val) => val.toLowerCase())
|
|
154
|
-
.optional(),
|
|
151
|
+
email: EmailSchema.optional(),
|
|
155
152
|
});
|
|
156
153
|
|
|
157
154
|
export const UserZod = IBaseEntity.extend({
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
LoginBody2FA,
|
|
11
11
|
NotFoundError,
|
|
12
12
|
UnauthorizedError,
|
|
13
|
+
EmailSchema,
|
|
13
14
|
} from '../../../common/types';
|
|
14
15
|
import { z } from 'zod';
|
|
15
16
|
|
|
@@ -49,7 +50,7 @@ export const authContract = c.router(
|
|
|
49
50
|
method: 'POST',
|
|
50
51
|
path: 'forgot-password',
|
|
51
52
|
body: z.object({
|
|
52
|
-
email:
|
|
53
|
+
email: EmailSchema,
|
|
53
54
|
}),
|
|
54
55
|
responses: {
|
|
55
56
|
200: null,
|
|
@@ -75,7 +76,7 @@ export const authContract = c.router(
|
|
|
75
76
|
method: 'POST',
|
|
76
77
|
path: 'reset-password/verify',
|
|
77
78
|
body: z.object({
|
|
78
|
-
email:
|
|
79
|
+
email: EmailSchema,
|
|
79
80
|
code: z.string(),
|
|
80
81
|
}),
|
|
81
82
|
responses: {
|
|
@@ -90,7 +91,7 @@ export const authContract = c.router(
|
|
|
90
91
|
method: 'POST',
|
|
91
92
|
path: 'reset-password',
|
|
92
93
|
body: z.object({
|
|
93
|
-
email:
|
|
94
|
+
email: EmailSchema,
|
|
94
95
|
code: z.string(),
|
|
95
96
|
password: z.string().min(6),
|
|
96
97
|
}),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { initContract } from '@ts-rest/core';
|
|
2
2
|
import {
|
|
3
3
|
BadRequestError,
|
|
4
|
+
CompliancePostInviteZod,
|
|
4
5
|
ForbiddenError,
|
|
5
6
|
InternalError,
|
|
6
7
|
inviteIdSchema,
|
|
@@ -10,9 +11,8 @@ import {
|
|
|
10
11
|
NotFoundError,
|
|
11
12
|
PaginationOptionsZod,
|
|
12
13
|
PatchInviteForComplianceZod,
|
|
13
|
-
|
|
14
|
+
PostInviteZod,
|
|
14
15
|
UnauthorizedError,
|
|
15
|
-
UserRole,
|
|
16
16
|
} from '../../../common/types';
|
|
17
17
|
import { z } from 'zod';
|
|
18
18
|
|
|
@@ -42,12 +42,7 @@ export const invitesContract = c.router(
|
|
|
42
42
|
metadata: {
|
|
43
43
|
auth: true,
|
|
44
44
|
},
|
|
45
|
-
body:
|
|
46
|
-
email: z.string().email(),
|
|
47
|
-
role: z.nativeEnum(UserRole),
|
|
48
|
-
accountId: z.string().optional(),
|
|
49
|
-
portalType: z.nativeEnum(PortalType).optional(),
|
|
50
|
-
}),
|
|
45
|
+
body: PostInviteZod,
|
|
51
46
|
responses: {
|
|
52
47
|
201: InviteWithUrl,
|
|
53
48
|
400: BadRequestError,
|
|
@@ -62,10 +57,7 @@ export const invitesContract = c.router(
|
|
|
62
57
|
metadata: {
|
|
63
58
|
auth: true,
|
|
64
59
|
},
|
|
65
|
-
body:
|
|
66
|
-
email: z.string().email(),
|
|
67
|
-
role: z.nativeEnum(UserRole),
|
|
68
|
-
}),
|
|
60
|
+
body: CompliancePostInviteZod,
|
|
69
61
|
responses: {
|
|
70
62
|
201: InviteWithUrl,
|
|
71
63
|
400: BadRequestError,
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
SelectAccountIssuersResponse,
|
|
14
14
|
SwitchAccountIssuersBody,
|
|
15
15
|
UnauthorizedError,
|
|
16
|
+
EmailSchema,
|
|
16
17
|
} from '../../../common/types';
|
|
17
18
|
import { z } from 'zod';
|
|
18
19
|
|
|
@@ -78,7 +79,7 @@ export const authContract = c.router(
|
|
|
78
79
|
method: 'POST',
|
|
79
80
|
path: 'forgot-password',
|
|
80
81
|
body: z.object({
|
|
81
|
-
email:
|
|
82
|
+
email: EmailSchema,
|
|
82
83
|
}),
|
|
83
84
|
responses: {
|
|
84
85
|
200: z.string(),
|
|
@@ -92,7 +93,7 @@ export const authContract = c.router(
|
|
|
92
93
|
method: 'POST',
|
|
93
94
|
path: 'reset-password/verify',
|
|
94
95
|
body: z.object({
|
|
95
|
-
email:
|
|
96
|
+
email: EmailSchema,
|
|
96
97
|
code: z.string(),
|
|
97
98
|
}),
|
|
98
99
|
responses: {
|
|
@@ -108,7 +109,7 @@ export const authContract = c.router(
|
|
|
108
109
|
method: 'POST',
|
|
109
110
|
path: 'reset-password',
|
|
110
111
|
body: z.object({
|
|
111
|
-
email:
|
|
112
|
+
email: EmailSchema,
|
|
112
113
|
code: z.string(),
|
|
113
114
|
password: z.string().min(6),
|
|
114
115
|
}),
|
|
@@ -117,23 +117,6 @@ export const disbursementsContract = c.router(
|
|
|
117
117
|
},
|
|
118
118
|
},
|
|
119
119
|
|
|
120
|
-
getDisbursement: {
|
|
121
|
-
summary: 'Get disbursement by id',
|
|
122
|
-
method: 'GET',
|
|
123
|
-
path: '/:id',
|
|
124
|
-
metadata: {
|
|
125
|
-
auth: true,
|
|
126
|
-
},
|
|
127
|
-
query: z.object({}).merge(DisbursementsIncludeQuery),
|
|
128
|
-
pathParams: z.object({ id: disbursementIdSchema }),
|
|
129
|
-
responses: {
|
|
130
|
-
200: DisbursementZod,
|
|
131
|
-
401: UnauthorizedError,
|
|
132
|
-
403: ForbiddenError,
|
|
133
|
-
404: NotFoundError,
|
|
134
|
-
500: InternalError,
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
120
|
reviewDisbursements: {
|
|
138
121
|
summary: 'Review Disbursements',
|
|
139
122
|
method: 'POST',
|
|
@@ -182,6 +165,23 @@ export const disbursementsContract = c.router(
|
|
|
182
165
|
500: InternalError,
|
|
183
166
|
},
|
|
184
167
|
},
|
|
168
|
+
getDisbursement: {
|
|
169
|
+
summary: 'Get disbursement by id',
|
|
170
|
+
method: 'GET',
|
|
171
|
+
path: '/:id',
|
|
172
|
+
metadata: {
|
|
173
|
+
auth: true,
|
|
174
|
+
},
|
|
175
|
+
query: z.object({}).merge(DisbursementsIncludeQuery),
|
|
176
|
+
pathParams: z.object({ id: disbursementIdSchema }),
|
|
177
|
+
responses: {
|
|
178
|
+
200: DisbursementZod,
|
|
179
|
+
401: UnauthorizedError,
|
|
180
|
+
403: ForbiddenError,
|
|
181
|
+
404: NotFoundError,
|
|
182
|
+
500: InternalError,
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
185
|
},
|
|
186
186
|
{
|
|
187
187
|
pathPrefix: 'disbursements',
|
package/package.json
CHANGED