feat: update type resolvers to include password

This commit is contained in:
lemmyMwaura
2024-08-06 12:27:16 +03:00
parent 0321ec32fb
commit ecdbb3eb53
3 changed files with 5 additions and 0 deletions
+1
View File
@@ -21,6 +21,7 @@ export const SecretSharingSchema = z.object({
expiresAfterViews: z.number().nullable().optional(), expiresAfterViews: z.number().nullable().optional(),
accessType: z.string().default("anyone"), accessType: z.string().default("anyone"),
name: z.string().nullable().optional(), name: z.string().nullable().optional(),
password: z.string().optional(),
lastViewedAt: z.date().nullable().optional() lastViewedAt: z.date().nullable().optional()
}); });
@@ -101,6 +101,7 @@ export const registerSecretSharingRouter = async (server: FastifyZodProvider) =>
schema: { schema: {
body: z.object({ body: z.object({
encryptedValue: z.string(), encryptedValue: z.string(),
password: z.string().optional(),
hashedHex: z.string(), hashedHex: z.string(),
iv: z.string(), iv: z.string(),
tag: z.string(), tag: z.string(),
@@ -131,6 +132,7 @@ export const registerSecretSharingRouter = async (server: FastifyZodProvider) =>
schema: { schema: {
body: z.object({ body: z.object({
name: z.string().max(50).optional(), name: z.string().max(50).optional(),
password: z.string().optional(),
encryptedValue: z.string(), encryptedValue: z.string(),
hashedHex: z.string(), hashedHex: z.string(),
iv: z.string(), iv: z.string(),
@@ -15,6 +15,7 @@ export type TSharedSecretPermission = {
orgId: string; orgId: string;
accessType?: SecretSharingAccessType; accessType?: SecretSharingAccessType;
name?: string; name?: string;
password?: string;
}; };
export type TCreatePublicSharedSecretDTO = { export type TCreatePublicSharedSecretDTO = {
@@ -24,6 +25,7 @@ export type TCreatePublicSharedSecretDTO = {
tag: string; tag: string;
expiresAt: string; expiresAt: string;
expiresAfterViews?: number; expiresAfterViews?: number;
password?: string;
accessType: SecretSharingAccessType; accessType: SecretSharingAccessType;
}; };