mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 20:27:12 +00:00
Fix type stuff
This commit is contained in:
@@ -30,14 +30,16 @@ export const GenericCreateAppConnectionFieldsSchema = (
|
|||||||
.describe(AppConnections.CREATE(app).description),
|
.describe(AppConnections.CREATE(app).description),
|
||||||
isPlatformManagedCredentials: supportsPlatformManagedCredentials
|
isPlatformManagedCredentials: supportsPlatformManagedCredentials
|
||||||
? z.boolean().optional().default(false).describe(AppConnections.CREATE(app).isPlatformManagedCredentials)
|
? z.boolean().optional().default(false).describe(AppConnections.CREATE(app).isPlatformManagedCredentials)
|
||||||
: z.literal(false).optional().describe(`Not supported for ${APP_CONNECTION_NAME_MAP[app]} Connections.`),
|
|
||||||
gatewayId: supportsGateways
|
|
||||||
? z
|
|
||||||
.preprocess((val) => (val === "" ? null : val), z.string().uuid().nullish())
|
|
||||||
.describe("The Gateway ID to use for this connection.")
|
|
||||||
: z
|
: z
|
||||||
.union([z.literal(undefined), z.literal("")])
|
.literal(false, {
|
||||||
.transform((v) => (v === "" ? undefined : v))
|
errorMap: () => ({ message: `Not supported for ${APP_CONNECTION_NAME_MAP[app]} Connections` })
|
||||||
|
})
|
||||||
|
.optional()
|
||||||
|
.describe(`Not supported for ${APP_CONNECTION_NAME_MAP[app]} Connections.`),
|
||||||
|
gatewayId: supportsGateways
|
||||||
|
? z.string().uuid().nullish().describe("The Gateway ID to use for this connection.")
|
||||||
|
: z
|
||||||
|
.undefined({ message: `Not supported for ${APP_CONNECTION_NAME_MAP[app]} Connections` })
|
||||||
.describe(`Not supported for ${APP_CONNECTION_NAME_MAP[app]} Connections.`)
|
.describe(`Not supported for ${APP_CONNECTION_NAME_MAP[app]} Connections.`)
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -55,13 +57,15 @@ export const GenericUpdateAppConnectionFieldsSchema = (
|
|||||||
.describe(AppConnections.UPDATE(app).description),
|
.describe(AppConnections.UPDATE(app).description),
|
||||||
isPlatformManagedCredentials: supportsPlatformManagedCredentials
|
isPlatformManagedCredentials: supportsPlatformManagedCredentials
|
||||||
? z.boolean().optional().describe(AppConnections.UPDATE(app).isPlatformManagedCredentials)
|
? z.boolean().optional().describe(AppConnections.UPDATE(app).isPlatformManagedCredentials)
|
||||||
: z.literal(false).optional().describe(`Not supported for ${APP_CONNECTION_NAME_MAP[app]} Connections.`),
|
|
||||||
gatewayId: supportsGateways
|
|
||||||
? z
|
|
||||||
.preprocess((val) => (val === "" ? null : val), z.string().uuid().nullish())
|
|
||||||
.describe("The Gateway ID to use for this connection.")
|
|
||||||
: z
|
: z
|
||||||
.union([z.literal(undefined), z.literal("")])
|
.literal(false, {
|
||||||
.transform((v) => (v === "" ? undefined : v))
|
errorMap: () => ({ message: `Not supported for ${APP_CONNECTION_NAME_MAP[app]} Connections` })
|
||||||
|
})
|
||||||
|
.optional()
|
||||||
|
.describe(`Not supported for ${APP_CONNECTION_NAME_MAP[app]} Connections.`),
|
||||||
|
gatewayId: supportsGateways
|
||||||
|
? z.string().uuid().nullish().describe("The Gateway ID to use for this connection.")
|
||||||
|
: z
|
||||||
|
.undefined({ message: `Not supported for ${APP_CONNECTION_NAME_MAP[app]} Connections` })
|
||||||
.describe(`Not supported for ${APP_CONNECTION_NAME_MAP[app]} Connections.`)
|
.describe(`Not supported for ${APP_CONNECTION_NAME_MAP[app]} Connections.`)
|
||||||
});
|
});
|
||||||
|
|||||||
+4
-1
@@ -7,7 +7,10 @@ import { slugSchema } from "@app/lib/schemas";
|
|||||||
export const genericAppConnectionFieldsSchema = z.object({
|
export const genericAppConnectionFieldsSchema = z.object({
|
||||||
name: slugSchema({ min: 1, max: 64, field: "Name" }),
|
name: slugSchema({ min: 1, max: 64, field: "Name" }),
|
||||||
description: z.string().trim().max(256, "Description cannot exceed 256 characters").nullish(),
|
description: z.string().trim().max(256, "Description cannot exceed 256 characters").nullish(),
|
||||||
gatewayId: z.string().nullish()
|
gatewayId: z
|
||||||
|
.string()
|
||||||
|
.nullish()
|
||||||
|
.transform((v) => (v === "" ? null : v))
|
||||||
});
|
});
|
||||||
|
|
||||||
export const GenericAppConnectionsFields = () => {
|
export const GenericAppConnectionsFields = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user