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',
|
status: 'pending',
|
||||||
ssl: {
|
ssl: {
|
||||||
status: 'pending',
|
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',
|
status: 'active',
|
||||||
ssl: {
|
ssl: {
|
||||||
status: 'pending',
|
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
|
// https://developers.cloudflare.com/api/operations/custom-hostname-for-a-zone-list-custom-hostnames#Responses
|
||||||
// Predefine the "useful" fields
|
// Predefine the "useful" fields
|
||||||
export const cloudflareDataGuard = z
|
export const cloudflareDataGuard = z.object({
|
||||||
.object({
|
|
||||||
id: z.string(),
|
id: z.string(),
|
||||||
status: z.string(),
|
status: z.string(),
|
||||||
ssl: z
|
ssl: z.object({
|
||||||
.object({
|
|
||||||
status: z.string(),
|
status: z.string(),
|
||||||
validation_errors: z
|
validation_errors: z
|
||||||
.object({
|
.object({
|
||||||
message: z.string(),
|
message: z.string(),
|
||||||
})
|
})
|
||||||
.catchall(z.unknown())
|
|
||||||
.array()
|
.array()
|
||||||
.optional(),
|
.optional(),
|
||||||
})
|
}),
|
||||||
.catchall(z.unknown()),
|
|
||||||
verification_errors: z.string().array().optional(),
|
verification_errors: z.string().array().optional(),
|
||||||
})
|
});
|
||||||
.catchall(z.unknown());
|
|
||||||
|
|
||||||
export type CloudflareData = z.infer<typeof cloudflareDataGuard>;
|
export type CloudflareData = z.infer<typeof cloudflareDataGuard>;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue