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:
Vendored
+104
-1
@@ -1197,4 +1197,107 @@ type CreateDomainInput = z.infer<typeof createDomainSchema>;
|
||||
type LoginInput = z.infer<typeof loginSchema>;
|
||||
type CreateDnsRecordInput = z.infer<typeof createDnsRecordSchema>;
|
||||
|
||||
export { CERT_ERROR, CERT_EXPIRED, CERT_MONITORING_VALUES, CERT_MONITOR_AUTO, CERT_MONITOR_REQUIRED, CERT_MONITOR_SKIPPED, CERT_OK, CERT_UNKNOWN, CERT_WARNING, type CertMonitoring, type Certificate, type CfDnsRecord, type CfZone, type CreateDnsRecordInput, type CreateDnsRecordPayload, type CreateDomainInput, type CreateGroupInput, type CreateServiceBindingInput, type CreateServiceGroupInput, type CreateServiceInput, type CreateServiceWithConfigInput, type CreateSubdomainInput, type DnsRecord, type Domain, type DomainListItem, type Group, type GroupWithStats, type HealthCheckConfig, type HealthCheckScope, type HealthCheckTarget, type HealthCheckType, type HealthStatusQuery, type IpHealthState, type IpHealthStatus, type JwtClaims, type LbMode, type LoginInput, type LoginRequest, type LoginResponse, type ParsedFqdn, type ReorderServicesInput, SYNC_CONFLICT, SYNC_ERROR, SYNC_PENDING_DELETE, SYNC_PENDING_PUSH, SYNC_SYNCED, type Service, type ServiceBinding, type ServiceBindingView, type ServiceDomainBinding, type ServiceDomainBindingView, type ServiceGroup, type ServiceGroupView, type ServiceGroupsResponse, type ServiceView, type Subdomain, type SubdomainRecord, type SyncJob, type ToggleEnabledInput, type UpdateDomainInput, type UpdateServiceConfigInput, type UpdateServiceGroupInput, type UpdateSubdomainInput, ValidationError, bindingToFqdn, certMonitoringSchema, certStatusFromExpiry, certificateSchema, createDnsRecordSchema, createDomainSchema, createGroupSchema, createServiceBindingSchema, createServiceGroupSchema, createServiceSchema, createServiceWithConfigSchema, createSubdomainSchema, dnsNameToSubdomainLabel, dnsRecordNamesMatch, dnsRecordSchema, domainListItemSchema, domainSchema, fqdnToDisplay, groupSchema, groupWithStatsSchema, healthCheckConfigSchema, healthCheckScopeSchema, healthCheckTypeSchema, healthStatusQuerySchema, ipHealthStateSchema, ipHealthStatusSchema, isValidIpv4, lbModeSchema, loginSchema, normalizeDnsRecordName, parseFqdn, reorderServicesSchema, serviceBindingSchema, serviceDomainBindingSchema, serviceGroupSchema, serviceGroupTypeSchema, serviceGroupViewSchema, serviceGroupsResponseSchema, serviceSchema, serviceViewSchema, shouldMonitorService, subdomainLabelToFqdn, subdomainSchema, toggleEnabledSchema, updateDomainGroupSchema, updateDomainSchema, updateServiceConfigSchema, updateServiceGroupSchema, updateSubdomainSchema, validateDnsRecord };
|
||||
declare const appSwitcherIconSchema: z.ZodEnum<{
|
||||
server: "server";
|
||||
cloud: "cloud";
|
||||
globe: "globe";
|
||||
dashboard: "dashboard";
|
||||
chart: "chart";
|
||||
}>;
|
||||
declare const appSwitcherEntrySchema: z.ZodObject<{
|
||||
id: z.ZodString;
|
||||
name: z.ZodString;
|
||||
subtitle: z.ZodOptional<z.ZodString>;
|
||||
url: z.ZodString;
|
||||
icon: z.ZodDefault<z.ZodEnum<{
|
||||
server: "server";
|
||||
cloud: "cloud";
|
||||
globe: "globe";
|
||||
dashboard: "dashboard";
|
||||
chart: "chart";
|
||||
}>>;
|
||||
shortcut: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>;
|
||||
declare const appSwitcherConfigSchema: z.ZodObject<{
|
||||
menuLabel: z.ZodDefault<z.ZodString>;
|
||||
apps: z.ZodArray<z.ZodObject<{
|
||||
id: z.ZodString;
|
||||
name: z.ZodString;
|
||||
subtitle: z.ZodOptional<z.ZodString>;
|
||||
url: z.ZodString;
|
||||
icon: z.ZodDefault<z.ZodEnum<{
|
||||
server: "server";
|
||||
cloud: "cloud";
|
||||
globe: "globe";
|
||||
dashboard: "dashboard";
|
||||
chart: "chart";
|
||||
}>>;
|
||||
shortcut: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
type AppSwitcherEntry = z.infer<typeof appSwitcherEntrySchema>;
|
||||
type AppSwitcherConfig = z.infer<typeof appSwitcherConfigSchema>;
|
||||
|
||||
declare const cfdmBindingSyncItemSchema: z.ZodObject<{
|
||||
bindingId: z.ZodNumber;
|
||||
serviceId: z.ZodNumber;
|
||||
serviceName: z.ZodString;
|
||||
serviceSlug: z.ZodString;
|
||||
fqdn: z.ZodString;
|
||||
zoneName: z.ZodString;
|
||||
hostname: z.ZodString;
|
||||
ips: z.ZodArray<z.ZodString>;
|
||||
deleted: z.ZodOptional<z.ZodBoolean>;
|
||||
}, z.core.$strip>;
|
||||
declare const cfdmSyncBindingsBodySchema: z.ZodObject<{
|
||||
bindings: z.ZodArray<z.ZodObject<{
|
||||
bindingId: z.ZodNumber;
|
||||
serviceId: z.ZodNumber;
|
||||
serviceName: z.ZodString;
|
||||
serviceSlug: z.ZodString;
|
||||
fqdn: z.ZodString;
|
||||
zoneName: z.ZodString;
|
||||
hostname: z.ZodString;
|
||||
ips: z.ZodArray<z.ZodString>;
|
||||
deleted: z.ZodOptional<z.ZodBoolean>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
type CfdmBindingSyncItem = z.infer<typeof cfdmBindingSyncItemSchema>;
|
||||
declare const appSettingsPatchSchema: z.ZodObject<{
|
||||
appSwitcher: z.ZodOptional<z.ZodObject<{
|
||||
menuLabel: z.ZodDefault<z.ZodString>;
|
||||
apps: z.ZodArray<z.ZodObject<{
|
||||
id: z.ZodString;
|
||||
name: z.ZodString;
|
||||
subtitle: z.ZodOptional<z.ZodString>;
|
||||
url: z.ZodString;
|
||||
icon: z.ZodDefault<z.ZodEnum<{
|
||||
server: "server";
|
||||
cloud: "cloud";
|
||||
globe: "globe";
|
||||
dashboard: "dashboard";
|
||||
chart: "chart";
|
||||
}>>;
|
||||
shortcut: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>>;
|
||||
vpsTrackerUrl: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>;
|
||||
vpsTrackerIntegrationToken: z.ZodOptional<z.ZodString>;
|
||||
vpsTrackerSyncEnabled: z.ZodOptional<z.ZodBoolean>;
|
||||
}, z.core.$strip>;
|
||||
type AppSettingsPatch = z.infer<typeof appSettingsPatchSchema>;
|
||||
declare const vpsTrackerEventSchema: z.ZodObject<{
|
||||
event: z.ZodEnum<{
|
||||
vps_down: "vps_down";
|
||||
vps_up: "vps_up";
|
||||
}>;
|
||||
vps: z.ZodArray<z.ZodObject<{
|
||||
id: z.ZodString;
|
||||
ip: z.ZodOptional<z.ZodString>;
|
||||
label: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
timestamp: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>;
|
||||
type VpsTrackerEvent = z.infer<typeof vpsTrackerEventSchema>;
|
||||
|
||||
export { type AppSettingsPatch, type AppSwitcherConfig, type AppSwitcherEntry, CERT_ERROR, CERT_EXPIRED, CERT_MONITORING_VALUES, CERT_MONITOR_AUTO, CERT_MONITOR_REQUIRED, CERT_MONITOR_SKIPPED, CERT_OK, CERT_UNKNOWN, CERT_WARNING, type CertMonitoring, type Certificate, type CfDnsRecord, type CfZone, type CfdmBindingSyncItem, type CreateDnsRecordInput, type CreateDnsRecordPayload, type CreateDomainInput, type CreateGroupInput, type CreateServiceBindingInput, type CreateServiceGroupInput, type CreateServiceInput, type CreateServiceWithConfigInput, type CreateSubdomainInput, type DnsRecord, type Domain, type DomainListItem, type Group, type GroupWithStats, type HealthCheckConfig, type HealthCheckScope, type HealthCheckTarget, type HealthCheckType, type HealthStatusQuery, type IpHealthState, type IpHealthStatus, type JwtClaims, type LbMode, type LoginInput, type LoginRequest, type LoginResponse, type ParsedFqdn, type ReorderServicesInput, SYNC_CONFLICT, SYNC_ERROR, SYNC_PENDING_DELETE, SYNC_PENDING_PUSH, SYNC_SYNCED, type Service, type ServiceBinding, type ServiceBindingView, type ServiceDomainBinding, type ServiceDomainBindingView, type ServiceGroup, type ServiceGroupView, type ServiceGroupsResponse, type ServiceView, type Subdomain, type SubdomainRecord, type SyncJob, type ToggleEnabledInput, type UpdateDomainInput, type UpdateServiceConfigInput, type UpdateServiceGroupInput, type UpdateSubdomainInput, ValidationError, type VpsTrackerEvent, appSettingsPatchSchema, appSwitcherConfigSchema, appSwitcherEntrySchema, appSwitcherIconSchema, bindingToFqdn, certMonitoringSchema, certStatusFromExpiry, certificateSchema, cfdmBindingSyncItemSchema, cfdmSyncBindingsBodySchema, createDnsRecordSchema, createDomainSchema, createGroupSchema, createServiceBindingSchema, createServiceGroupSchema, createServiceSchema, createServiceWithConfigSchema, createSubdomainSchema, dnsNameToSubdomainLabel, dnsRecordNamesMatch, dnsRecordSchema, domainListItemSchema, domainSchema, fqdnToDisplay, groupSchema, groupWithStatsSchema, healthCheckConfigSchema, healthCheckScopeSchema, healthCheckTypeSchema, healthStatusQuerySchema, ipHealthStateSchema, ipHealthStatusSchema, isValidIpv4, lbModeSchema, loginSchema, normalizeDnsRecordName, parseFqdn, reorderServicesSchema, serviceBindingSchema, serviceDomainBindingSchema, serviceGroupSchema, serviceGroupTypeSchema, serviceGroupViewSchema, serviceGroupsResponseSchema, serviceSchema, serviceViewSchema, shouldMonitorService, subdomainLabelToFqdn, subdomainSchema, toggleEnabledSchema, updateDomainGroupSchema, updateDomainSchema, updateServiceConfigSchema, updateServiceGroupSchema, updateSubdomainSchema, validateDnsRecord, vpsTrackerEventSchema };
|
||||
|
||||
Vendored
+64
-1
@@ -478,6 +478,62 @@ var healthStatusQuerySchema = z.object({
|
||||
scope: healthCheckScopeSchema,
|
||||
ref_id: z.coerce.number().int().positive()
|
||||
});
|
||||
|
||||
// src/app-switcher.ts
|
||||
import { z as z2 } from "zod";
|
||||
var appSwitcherIconSchema = z2.enum([
|
||||
"server",
|
||||
"cloud",
|
||||
"globe",
|
||||
"dashboard",
|
||||
"chart"
|
||||
]);
|
||||
var appSwitcherEntrySchema = z2.object({
|
||||
id: z2.string(),
|
||||
name: z2.string(),
|
||||
subtitle: z2.string().optional(),
|
||||
url: z2.string().url(),
|
||||
icon: appSwitcherIconSchema.default("server"),
|
||||
shortcut: z2.string().optional()
|
||||
});
|
||||
var appSwitcherConfigSchema = z2.object({
|
||||
menuLabel: z2.string().default("\u041F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F"),
|
||||
apps: z2.array(appSwitcherEntrySchema).min(1)
|
||||
});
|
||||
|
||||
// src/integration-vps-tracker.ts
|
||||
import { z as z3 } from "zod";
|
||||
var cfdmBindingSyncItemSchema = z3.object({
|
||||
bindingId: z3.number().int().positive(),
|
||||
serviceId: z3.number().int().positive(),
|
||||
serviceName: z3.string().min(1),
|
||||
serviceSlug: z3.string().min(1),
|
||||
fqdn: z3.string().min(1),
|
||||
zoneName: z3.string().min(1),
|
||||
hostname: z3.string(),
|
||||
ips: z3.array(z3.string()),
|
||||
deleted: z3.boolean().optional()
|
||||
});
|
||||
var cfdmSyncBindingsBodySchema = z3.object({
|
||||
bindings: z3.array(cfdmBindingSyncItemSchema).min(1)
|
||||
});
|
||||
var appSettingsPatchSchema = z3.object({
|
||||
appSwitcher: appSwitcherConfigSchema.optional(),
|
||||
vpsTrackerUrl: z3.string().url().or(z3.literal("")).optional(),
|
||||
vpsTrackerIntegrationToken: z3.string().optional(),
|
||||
vpsTrackerSyncEnabled: z3.boolean().optional()
|
||||
});
|
||||
var vpsTrackerEventSchema = z3.object({
|
||||
event: z3.enum(["vps_down", "vps_up"]),
|
||||
vps: z3.array(
|
||||
z3.object({
|
||||
id: z3.string().min(1),
|
||||
ip: z3.string().optional(),
|
||||
label: z3.string().optional()
|
||||
})
|
||||
),
|
||||
timestamp: z3.string().datetime().optional()
|
||||
});
|
||||
export {
|
||||
CERT_ERROR,
|
||||
CERT_EXPIRED,
|
||||
@@ -494,10 +550,16 @@ export {
|
||||
SYNC_PENDING_PUSH,
|
||||
SYNC_SYNCED,
|
||||
ValidationError,
|
||||
appSettingsPatchSchema,
|
||||
appSwitcherConfigSchema,
|
||||
appSwitcherEntrySchema,
|
||||
appSwitcherIconSchema,
|
||||
bindingToFqdn,
|
||||
certMonitoringSchema,
|
||||
certStatusFromExpiry,
|
||||
certificateSchema,
|
||||
cfdmBindingSyncItemSchema,
|
||||
cfdmSyncBindingsBodySchema,
|
||||
createDnsRecordSchema,
|
||||
createDomainSchema,
|
||||
createGroupSchema,
|
||||
@@ -543,5 +605,6 @@ export {
|
||||
updateServiceConfigSchema,
|
||||
updateServiceGroupSchema,
|
||||
updateSubdomainSchema,
|
||||
validateDnsRecord
|
||||
validateDnsRecord,
|
||||
vpsTrackerEventSchema
|
||||
};
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const appSwitcherIconSchema = z.enum([
|
||||
"server",
|
||||
"cloud",
|
||||
"globe",
|
||||
"dashboard",
|
||||
"chart",
|
||||
]);
|
||||
|
||||
export const appSwitcherEntrySchema = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
subtitle: z.string().optional(),
|
||||
url: z.string().url(),
|
||||
icon: appSwitcherIconSchema.default("server"),
|
||||
shortcut: z.string().optional(),
|
||||
});
|
||||
|
||||
export const appSwitcherConfigSchema = z.object({
|
||||
menuLabel: z.string().default("Приложения"),
|
||||
apps: z.array(appSwitcherEntrySchema).min(1),
|
||||
});
|
||||
|
||||
export type AppSwitcherEntry = z.infer<typeof appSwitcherEntrySchema>;
|
||||
export type AppSwitcherConfig = z.infer<typeof appSwitcherConfigSchema>;
|
||||
@@ -3,6 +3,8 @@ export * from "./validators.js";
|
||||
export * from "./subdomain.js";
|
||||
export * from "./parse-fqdn.js";
|
||||
export * from "./schemas.js";
|
||||
export * from "./app-switcher.js";
|
||||
export * from "./integration-vps-tracker.js";
|
||||
export type {
|
||||
CfZone,
|
||||
CfDnsRecord,
|
||||
|
||||
@@ -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