feat: интеграция с VPS Tracker
Build, Test, and Push CFDM Docker Image / test (push) Failing after 3m36s
Build, Test, and Push CFDM Docker Image / build-and-push (push) Has been skipped
Build, Test, and Push CFDM Docker Image / update-wiki (push) Has been skipped
Build, Test, and Push CFDM Docker Image / create-release (push) Has been skipped
Build, Test, and Push CFDM Docker Image / test (push) Failing after 3m36s
Build, Test, and Push CFDM Docker Image / build-and-push (push) Has been skipped
Build, Test, and Push CFDM Docker Image / update-wiki (push) Has been skipped
Build, Test, and Push CFDM Docker Image / create-release (push) Has been skipped
Исходящий sync bindings после updateConfig, настройки в app_settings, страница Интеграции, приём событий vps_down для DNS failover. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import { z } from "zod";
|
||||
import { appSwitcherConfigSchema } from "./app-switcher.js";
|
||||
|
||||
export const cfdmBindingSyncItemSchema = z.object({
|
||||
bindingId: z.number().int().positive(),
|
||||
serviceId: z.number().int().positive(),
|
||||
serviceName: z.string().min(1),
|
||||
serviceSlug: z.string().min(1),
|
||||
fqdn: z.string().min(1),
|
||||
zoneName: z.string().min(1),
|
||||
hostname: z.string(),
|
||||
ips: z.array(z.string()),
|
||||
deleted: z.boolean().optional(),
|
||||
});
|
||||
|
||||
export const cfdmSyncBindingsBodySchema = z.object({
|
||||
bindings: z.array(cfdmBindingSyncItemSchema).min(1),
|
||||
});
|
||||
|
||||
export type CfdmBindingSyncItem = z.infer<typeof cfdmBindingSyncItemSchema>;
|
||||
|
||||
export const appSettingsPatchSchema = z.object({
|
||||
appSwitcher: appSwitcherConfigSchema.optional(),
|
||||
vpsTrackerUrl: z.string().url().or(z.literal("")).optional(),
|
||||
vpsTrackerIntegrationToken: z.string().optional(),
|
||||
vpsTrackerSyncEnabled: z.boolean().optional(),
|
||||
});
|
||||
|
||||
export type AppSettingsPatch = z.infer<typeof appSettingsPatchSchema>;
|
||||
|
||||
export const vpsTrackerEventSchema = z.object({
|
||||
event: z.enum(["vps_down", "vps_up"]),
|
||||
vps: z.array(
|
||||
z.object({
|
||||
id: z.string().min(1),
|
||||
ip: z.string().optional(),
|
||||
label: z.string().optional(),
|
||||
}),
|
||||
),
|
||||
timestamp: z.string().datetime().optional(),
|
||||
});
|
||||
|
||||
export type VpsTrackerEvent = z.infer<typeof vpsTrackerEventSchema>;
|
||||
Reference in New Issue
Block a user