mirror of
https://github.com/logto-io/logto.git
synced 2025-02-17 22:04:19 -05:00
fix(schemas): remove catchall from cloudflare data guard (#5271)
This commit is contained in:
parent
cb5763f449
commit
0d4d1b16f5
2 changed files with 11 additions and 25 deletions
|
@ -38,13 +38,6 @@ export const mockCloudflareData: CloudflareData = {
|
|||
status: 'pending',
|
||||
ssl: {
|
||||
status: 'pending',
|
||||
txt_name: mockSslTxtName,
|
||||
txt_value: mockSslTxtValue,
|
||||
},
|
||||
ownership_verification: {
|
||||
type: 'TXT',
|
||||
name: mockTxtName,
|
||||
value: mockTxtValue,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -53,8 +46,6 @@ export const mockCloudflareDataPendingSSL: CloudflareData = {
|
|||
status: 'active',
|
||||
ssl: {
|
||||
status: 'pending',
|
||||
txt_name: mockSslTxtName,
|
||||
txt_value: mockSslTxtValue,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -11,25 +11,20 @@ export type DomainDnsRecords = z.infer<typeof domainDnsRecordsGuard>;
|
|||
|
||||
// https://developers.cloudflare.com/api/operations/custom-hostname-for-a-zone-list-custom-hostnames#Responses
|
||||
// Predefine the "useful" fields
|
||||
export const cloudflareDataGuard = z
|
||||
.object({
|
||||
id: z.string(),
|
||||
export const cloudflareDataGuard = z.object({
|
||||
id: z.string(),
|
||||
status: z.string(),
|
||||
ssl: z.object({
|
||||
status: z.string(),
|
||||
ssl: z
|
||||
validation_errors: z
|
||||
.object({
|
||||
status: z.string(),
|
||||
validation_errors: z
|
||||
.object({
|
||||
message: z.string(),
|
||||
})
|
||||
.catchall(z.unknown())
|
||||
.array()
|
||||
.optional(),
|
||||
message: z.string(),
|
||||
})
|
||||
.catchall(z.unknown()),
|
||||
verification_errors: z.string().array().optional(),
|
||||
})
|
||||
.catchall(z.unknown());
|
||||
.array()
|
||||
.optional(),
|
||||
}),
|
||||
verification_errors: z.string().array().optional(),
|
||||
});
|
||||
|
||||
export type CloudflareData = z.infer<typeof cloudflareDataGuard>;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue