feat: fixed secret approval for architecture v2

This commit is contained in:
=
2024-07-30 23:19:06 +05:30
parent acf9a488ac
commit f7ef86eb11
5 changed files with 76 additions and 70 deletions
@@ -261,31 +261,30 @@ export const registerSecretApprovalRequestRouter = async (server: FastifyZodProv
secretPath: z.string(),
commits: secretRawSchema
.omit({ _id: true, environment: true, workspace: true, type: true, version: true })
.merge(
z.object({
tags: tagSchema,
secret: z
.object({
id: z.string(),
version: z.number(),
secretKey: z.string(),
secretValue: z.string().optional(),
secretComment: z.string().optional()
})
.optional()
.nullable(),
secretVersion: z
.object({
id: z.string(),
version: z.number(),
secretKey: z.string(),
secretValue: z.string().optional(),
secretComment: z.string().optional(),
tags: tagSchema
})
.optional()
})
)
.extend({
op: z.string(),
tags: tagSchema,
secret: z
.object({
id: z.string(),
version: z.number(),
secretKey: z.string(),
secretValue: z.string().optional(),
secretComment: z.string().optional()
})
.optional()
.nullable(),
secretVersion: z
.object({
id: z.string(),
version: z.number(),
secretKey: z.string(),
secretValue: z.string().optional(),
secretComment: z.string().optional(),
tags: tagSchema
})
.optional()
})
.array()
})
)
+10 -11
View File
@@ -29,17 +29,16 @@ export const registerSnapshotRouter = async (server: FastifyZodProvider) => {
name: z.string()
}),
secretVersions: secretRawSchema
.omit({ _id: true, environment: true, workspace: true, type: true, version: true })
.merge(
z.object({
tags: SecretTagsSchema.pick({
id: true,
slug: true,
name: true,
color: true
}).array()
})
)
.omit({ _id: true, environment: true, workspace: true, type: true })
.extend({
secretId: z.string(),
tags: SecretTagsSchema.pick({
id: true,
slug: true,
name: true,
color: true
}).array()
})
.array(),
folderVersion: z.object({ id: z.string(), name: z.string() }).array(),
createdAt: z.date(),